[PATCH] libertas: call SET_NETDEV_DEV from common code

Move usage of SET_NETDEV_DEV into common code since it has nothing
to do with bus-specific devices.  Also fixes a bug where the mesh
device was getting SET_NETDEV_DEV called after register_netdevice,
resulting in no 'device' link in /sys/class/net/mshX/.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
Dan Williams
2007-05-25 13:13:25 -04:00
committed by John W. Linville
parent 0681f98935
commit 7732ca45c6
3 changed files with 12 additions and 14 deletions

View File

@@ -763,7 +763,7 @@ static int wlan_service_main_thread(void *data)
* @param card A pointer to card
* @return A pointer to wlan_private structure
*/
wlan_private *libertas_add_card(void *card)
wlan_private *libertas_add_card(void *card, struct device *dmdev)
{
struct net_device *dev = NULL;
wlan_private *priv = NULL;
@@ -808,6 +808,8 @@ wlan_private *libertas_add_card(void *card)
dev->flags |= IFF_BROADCAST | IFF_MULTICAST;
dev->set_multicast_list = wlan_set_multicast_list;
SET_NETDEV_DEV(dev, dmdev);
INIT_LIST_HEAD(&priv->adapter->cmdfreeq);
INIT_LIST_HEAD(&priv->adapter->cmdpendingq);
@@ -891,7 +893,7 @@ EXPORT_SYMBOL_GPL(libertas_activate_card);
* @param priv A pointer to the wlan_private structure
* @return 0 if successful, -X otherwise
*/
int libertas_add_mesh(wlan_private *priv)
int libertas_add_mesh(wlan_private *priv, struct device *dev)
{
struct net_device *mesh_dev = NULL;
int ret = 0;
@@ -918,6 +920,8 @@ int libertas_add_mesh(wlan_private *priv)
memcpy(mesh_dev->dev_addr, priv->dev->dev_addr,
sizeof(priv->dev->dev_addr));
SET_NETDEV_DEV(priv->mesh_dev, dev);
#ifdef WIRELESS_EXT
mesh_dev->wireless_handlers = (struct iw_handler_def *)&libertas_handler_def;
#endif