Eliminate ATH_GET_NETDEV_DEV, it breaks on some CentOS kernels
authorproski <proski@0192ed92-7a03-0410-a25b-9323aeb14dbd>
Fri, 7 Oct 2011 21:30:59 +0000 (21:30 +0000)
committerproski <proski@0192ed92-7a03-0410-a25b-9323aeb14dbd>
Fri, 7 Oct 2011 21:30:59 +0000 (21:30 +0000)
Instead, use sc->sc_bdev to find the physical device.  sc->sc_bdev is
NULL on AHB and we don't use SET_NETDEV_DEV on AHB anyway, so do it on
PCI only.

git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@4170 0192ed92-7a03-0410-a25b-9323aeb14dbd

ath/if_ath.c
ath/if_athvar.h

index 5eacfc4de4e124993a6597846c9999792a3cb7ea..eb30927fde35f68c032dfef5efdb1140bed0a00f 100644 (file)
@@ -1493,7 +1493,9 @@ ath_vap_create(struct ieee80211com *ic, const char *name,
        }
        if (sc->sc_hastsfadd)
                ath_hal_settsfadjust(sc->sc_ah, sc->sc_stagbeacons);
-       SET_NETDEV_DEV(dev, ATH_GET_NETDEV_DEV(mdev));
+#ifdef ATH_PCI
+       SET_NETDEV_DEV(dev, &((struct pci_dev *)sc->sc_bdev)->dev);
+#endif
        /* complete setup */
        (void) ieee80211_vap_attach(vap,
                ieee80211_media_change, ieee80211_media_status);
index afafc231615fa9e7555bd95dc0d148d66cf852df..6f44db649e8d8ebd52809dcb5cf39c3fb4c631bb 100644 (file)
@@ -125,12 +125,6 @@ typedef void irqreturn_t;
 #define        SET_NETDEV_DEV(ndev, pdev)
 #endif
 
-#ifdef to_net_dev
-#define ATH_GET_NETDEV_DEV(ndev)       ((ndev)->dev.parent)
-#else
-#define ATH_GET_NETDEV_DEV(ndev)       ((ndev)->class_dev.dev)
-#endif
-
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,23)
 static inline struct net_device *_alloc_netdev(int sizeof_priv, const char *mask,
                                               void (*setup)(struct net_device *))