|
| 1 | +--- a/include/linux/netdevice.h |
| 2 | ++++ b/include/linux/netdevice.h |
| 3 | +@@ -2133,8 +2133,6 @@ struct net_device { |
| 4 | + |
| 5 | + /* Protocol-specific pointers */ |
| 6 | + |
| 7 | +- struct in_device __rcu *ip_ptr; |
| 8 | +- struct inet6_dev __rcu *ip6_ptr; |
| 9 | + #if IS_ENABLED(CONFIG_VLAN_8021Q) |
| 10 | + struct vlan_info __rcu *vlan_info; |
| 11 | + #endif |
| 12 | +@@ -2147,18 +2145,16 @@ struct net_device { |
| 13 | + #if IS_ENABLED(CONFIG_ATALK) |
| 14 | + void *atalk_ptr; |
| 15 | + #endif |
| 16 | ++ struct in_device __rcu *ip_ptr; |
| 17 | + #if IS_ENABLED(CONFIG_DECNET) |
| 18 | + struct dn_dev __rcu *dn_ptr; |
| 19 | + #endif |
| 20 | ++ struct inet6_dev __rcu *ip6_ptr; |
| 21 | + #if IS_ENABLED(CONFIG_AX25) |
| 22 | + void *ax25_ptr; |
| 23 | + #endif |
| 24 | +-#if IS_ENABLED(CONFIG_CFG80211) |
| 25 | + struct wireless_dev *ieee80211_ptr; |
| 26 | +-#endif |
| 27 | +-#if IS_ENABLED(CONFIG_IEEE802154) || IS_ENABLED(CONFIG_6LOWPAN) |
| 28 | + struct wpan_dev *ieee802154_ptr; |
| 29 | +-#endif |
| 30 | + #if IS_ENABLED(CONFIG_MPLS_ROUTING) |
| 31 | + struct mpls_dev __rcu *mpls_ptr; |
| 32 | + #endif |
| 33 | +--- a/include/net/cfg80211.h |
| 34 | ++++ b/include/net/cfg80211.h |
| 35 | +@@ -8379,9 +8379,7 @@ int cfg80211_register_netdevice(struct n |
| 36 | + */ |
| 37 | + static inline void cfg80211_unregister_netdevice(struct net_device *dev) |
| 38 | + { |
| 39 | +-#if IS_ENABLED(CONFIG_CFG80211) |
| 40 | + cfg80211_unregister_wdev(dev->ieee80211_ptr); |
| 41 | +-#endif |
| 42 | + } |
| 43 | + |
| 44 | + /** |
| 45 | +--- a/include/net/cfg802154.h |
| 46 | ++++ b/include/net/cfg802154.h |
| 47 | +@@ -373,7 +373,6 @@ struct wpan_dev { |
| 48 | + |
| 49 | + #define to_phy(_dev) container_of(_dev, struct wpan_phy, dev) |
| 50 | + |
| 51 | +-#if IS_ENABLED(CONFIG_IEEE802154) || IS_ENABLED(CONFIG_6LOWPAN) |
| 52 | + static inline int |
| 53 | + wpan_dev_hard_header(struct sk_buff *skb, struct net_device *dev, |
| 54 | + const struct ieee802154_addr *daddr, |
| 55 | +@@ -384,7 +383,6 @@ wpan_dev_hard_header(struct sk_buff *skb |
| 56 | + |
| 57 | + return wpan_dev->header_ops->create(skb, dev, daddr, saddr, len); |
| 58 | + } |
| 59 | +-#endif |
| 60 | + |
| 61 | + struct wpan_phy * |
| 62 | + wpan_phy_new(const struct cfg802154_ops *ops, size_t priv_size); |
| 63 | +--- a/net/batman-adv/hard-interface.c |
| 64 | ++++ b/net/batman-adv/hard-interface.c |
| 65 | +@@ -308,11 +308,9 @@ static bool batadv_is_cfg80211_netdev(st |
| 66 | + if (!net_device) |
| 67 | + return false; |
| 68 | + |
| 69 | +-#if IS_ENABLED(CONFIG_CFG80211) |
| 70 | + /* cfg80211 drivers have to set ieee80211_ptr */ |
| 71 | + if (net_device->ieee80211_ptr) |
| 72 | + return true; |
| 73 | +-#endif |
| 74 | + |
| 75 | + return false; |
| 76 | + } |
| 77 | +--- a/net/core/net-sysfs.c |
| 78 | ++++ b/net/core/net-sysfs.c |
| 79 | +@@ -747,6 +747,7 @@ static const struct attribute_group nets |
| 80 | + .attrs = netstat_attrs, |
| 81 | + }; |
| 82 | + |
| 83 | ++#if IS_ENABLED(CONFIG_WIRELESS_EXT) || IS_ENABLED(CONFIG_CFG80211) |
| 84 | + static struct attribute *wireless_attrs[] = { |
| 85 | + NULL |
| 86 | + }; |
| 87 | +@@ -755,19 +756,7 @@ static const struct attribute_group wire |
| 88 | + .name = "wireless", |
| 89 | + .attrs = wireless_attrs, |
| 90 | + }; |
| 91 | +- |
| 92 | +-static bool wireless_group_needed(struct net_device *ndev) |
| 93 | +-{ |
| 94 | +-#if IS_ENABLED(CONFIG_CFG80211) |
| 95 | +- if (ndev->ieee80211_ptr) |
| 96 | +- return true; |
| 97 | + #endif |
| 98 | +-#if IS_ENABLED(CONFIG_WIRELESS_EXT) |
| 99 | +- if (ndev->wireless_handlers) |
| 100 | +- return true; |
| 101 | +-#endif |
| 102 | +- return false; |
| 103 | +-} |
| 104 | + |
| 105 | + #else /* CONFIG_SYSFS */ |
| 106 | + #define net_class_groups NULL |
| 107 | +@@ -2008,8 +1997,14 @@ int netdev_register_kobject(struct net_d |
| 108 | + |
| 109 | + *groups++ = &netstat_group; |
| 110 | + |
| 111 | +- if (wireless_group_needed(ndev)) |
| 112 | ++#if IS_ENABLED(CONFIG_WIRELESS_EXT) || IS_ENABLED(CONFIG_CFG80211) |
| 113 | ++ if (ndev->ieee80211_ptr) |
| 114 | ++ *groups++ = &wireless_group; |
| 115 | ++#if IS_ENABLED(CONFIG_WIRELESS_EXT) |
| 116 | ++ else if (ndev->wireless_handlers) |
| 117 | + *groups++ = &wireless_group; |
| 118 | ++#endif |
| 119 | ++#endif |
| 120 | + #endif /* CONFIG_SYSFS */ |
| 121 | + |
| 122 | + error = device_add(dev); |
0 commit comments