Use register_invisible_netdevice for master interface.

Signed-off-by: Jiri Benc <[EMAIL PROTECTED]>

---
 net/d80211/ieee80211.c       |   22 ++--------------------
 net/d80211/ieee80211_iface.c |    8 ++++++--
 2 files changed, 8 insertions(+), 22 deletions(-)

--- dscape.orig/net/d80211/ieee80211.c
+++ dscape/net/d80211/ieee80211.c
@@ -4540,23 +4540,11 @@ int ieee80211_register_hw(struct ieee802
        memcpy(local->mdev->dev_addr, local->hw.perm_addr, ETH_ALEN);
        SET_NETDEV_DEV(local->mdev, local->hw.dev);
 
-       result = register_netdevice(local->mdev);
+       result = register_invisible_netdevice(local->mdev);
        if (result < 0) {
                rtnl_unlock();
                goto fail_dev;
        }
-       result = sysfs_create_link(&local->class_dev.kobj,
-                                  &local->mdev->class_dev.kobj,
-                                  "master");
-       if (result < 0) {
-               rtnl_unlock();
-               goto fail_masterlink;
-       }
-       result = ieee80211_sysfs_add_netdevice(local->mdev);
-       if (result < 0) {
-               rtnl_unlock();
-               goto fail_if_sysfs;
-       }
 
        result = ieee80211_init_rate_ctrl_alg(local, NULL);
        rtnl_unlock();
@@ -4593,11 +4581,7 @@ int ieee80211_register_hw(struct ieee802
 fail_wep:
        rate_control_deinitialize(local);
 fail_rate:
-       ieee80211_sysfs_remove_netdevice(local->mdev);
-fail_if_sysfs:
-       sysfs_remove_link(&local->class_dev.kobj, "master");
-fail_masterlink:
-       unregister_netdev(local->mdev);
+       unregister_invisible_netdevice(local->mdev);
 fail_dev:
        sta_info_stop(local);
 fail_sta_info:
@@ -4655,8 +4639,6 @@ void ieee80211_unregister_hw(struct ieee
        if (local->apdev)
                ieee80211_if_del_mgmt(local);
 
-       sysfs_remove_link(&local->class_dev.kobj, "master");
-
        list_for_each_entry_safe(sdata, tmp, &local->sub_if_list, list)
                __ieee80211_if_del(local, sdata);
 
--- dscape.orig/net/d80211/ieee80211_iface.c
+++ dscape/net/d80211/ieee80211_iface.c
@@ -309,8 +309,12 @@ void __ieee80211_if_del(struct ieee80211
        struct net_device *dev = sdata->dev;
 
        list_del(&sdata->list);
-       ieee80211_sysfs_remove_netdevice(dev);
-       unregister_netdevice(dev);
+       if (dev == local->mdev)
+               unregister_invisible_netdevice(dev);
+       else {
+               ieee80211_sysfs_remove_netdevice(dev);
+               unregister_netdevice(dev);
+       }
        /* Except master interface, the net_device will be freed by
         * net_device->destructor (i. e. ieee80211_if_free). */
 }
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to