mirror of https://github.com/proski/madwifi
Use netdev_notifier_info_to_dev(), needed for Linux 3.11+
Not using netdev_notifier_info_to_dev() gives no compile warnings but crashes the kernel, so this patch is intentionally applied before Linux 3.10 procfs support is enabled to avoid a revision that compiles and crashes on new kernels.
This commit is contained in:
parent
0196108e9c
commit
f83c3d758e
|
@ -12359,7 +12359,7 @@ static int
|
||||||
ath_rcv_dev_event(struct notifier_block *this, unsigned long event,
|
ath_rcv_dev_event(struct notifier_block *this, unsigned long event,
|
||||||
void *ptr)
|
void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = (struct net_device *)ptr;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
struct ath_softc *sc = (struct ath_softc *)netdev_priv(dev);
|
struct ath_softc *sc = (struct ath_softc *)netdev_priv(dev);
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)
|
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)
|
||||||
|
|
|
@ -242,6 +242,10 @@ typedef unsigned long resource_size_t;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)
|
||||||
|
#define netdev_notifier_info_to_dev(ptr) ((struct net_device *)(ptr))
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* __KERNEL__ */
|
#endif /* __KERNEL__ */
|
||||||
|
|
||||||
#endif /* _ATH_COMPAT_H_ */
|
#endif /* _ATH_COMPAT_H_ */
|
||||||
|
|
|
@ -1186,7 +1186,7 @@ static int
|
||||||
ieee80211_rcv_dev_event(struct notifier_block *this, unsigned long event,
|
ieee80211_rcv_dev_event(struct notifier_block *this, unsigned long event,
|
||||||
void *ptr)
|
void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = (struct net_device *)ptr;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)
|
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)
|
||||||
if (!dev || dev->open != &ieee80211_open)
|
if (!dev || dev->open != &ieee80211_open)
|
||||||
|
|
Loading…
Reference in New Issue