#ifndef _WLAN_DECL_H_
 #define _WLAN_DECL_H_
 
+#include <linux/device.h>
+
 #include "defs.h"
 
 /** Function Prototype Declaration */
 /* main.c */
 struct chan_freq_power *libertas_get_region_cfp_table(u8 region, u8 band,
                                                             int *cfp_no);
-wlan_private *libertas_add_card(void *card);
+wlan_private *libertas_add_card(void *card, struct device *dmdev);
 int libertas_activate_card(wlan_private *priv, char *fw_name);
 int libertas_remove_card(wlan_private *priv);
-int libertas_add_mesh(wlan_private *priv);
+int libertas_add_mesh(wlan_private *priv, struct device *dev);
 void libertas_remove_mesh(wlan_private *priv);
 
 
 
                }
        }
 
-
-       /* At this point libertas_add_card() will be called.  Don't worry
-        * about keeping pwlanpriv around since it will be set on our
-        * usb device data in -> add() -> hw_register_dev() -> if_usb_register_dev.
-        */
-       if (!(priv = libertas_add_card(cardp)))
+       if (!(priv = libertas_add_card(cardp, &udev->dev)))
                goto dealloc;
 
-       if (libertas_add_mesh(priv))
+       if (libertas_add_mesh(priv, &udev->dev))
                goto err_add_mesh;
 
        priv->hw_register_dev = if_usb_register_dev;
        cardp->eth_dev = priv->dev;
        priv->hotplug_device = &(cardp->udev->dev);
 
-       SET_NETDEV_DEV(cardp->eth_dev, &(cardp->udev->dev));
-       SET_NETDEV_DEV(priv->mesh_dev, &(cardp->udev->dev));
-
        lbs_deb_usbd(&cardp->udev->dev, "udev pointer is at %p\n",
                    cardp->udev);
 
 
  *  @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;
        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);
 
  *  @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;
        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