]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - wl12xx/compat-wireless.git/blob - patches/30-bridge-port.patch
compat-wireless: turn on TESTMODE and MAC DEBUGFS, turn off BT
[wl12xx/compat-wireless.git] / patches / 30-bridge-port.patch
1 The patch titled:
3     bridge: use rx_handler_data pointer to store net_bridge_port pointer
4    
5 by Jiri Pirko <jpirko@redhat.com> moved the br_ports pointer
6 out of the netdev which older kernels relied on and then added
7 a flag to the netdev to check for it as follows:
9 -                               dev->br_port) {
10 +                   (dev->priv_flags & IFF_BRIDGE_PORT)) {
12 So to backport this we instead rely on a br_port_exists() call
13 which compat.git provides and depending on the kernel it will either
14 check for the dev->br_port or the IFF_BRIDGE_PORT flag. A patch
15 to get the blow code merged upstream and to use br_port_exists()
16 everywhere else will be submitted but not sure if it will be
17 accepted.
19 This patch can be removed once we get br_port_exists() accessible
20 to drivers and not just private bridge code. If that patch doesn't
21 get accepted upstream we'l have to carry this patch around for
22 compat-wireless.
24 --- a/net/wireless/util.c
25 +++ b/net/wireless/util.c
26 @@ -795,7 +795,7 @@ int cfg80211_change_iface(struct cfg8021
27                 return -EOPNOTSUPP;
28  
29         /* if it's part of a bridge, reject changing type to station/ibss */
30 -       if ((dev->priv_flags & IFF_BRIDGE_PORT) &&
31 +       if (br_port_exists(dev) &&
32             (ntype == NL80211_IFTYPE_ADHOC ||
33              ntype == NL80211_IFTYPE_STATION ||
34              ntype == NL80211_IFTYPE_P2P_CLIENT))
35 --- a/net/wireless/nl80211.c
36 +++ b/net/wireless/nl80211.c
37 @@ -1599,7 +1599,7 @@ static int nl80211_valid_4addr(struct cf
38                                enum nl80211_iftype iftype)
39  {
40         if (!use_4addr) {
41 -               if (netdev && (netdev->priv_flags & IFF_BRIDGE_PORT))
42 +               if (netdev && br_port_exists(netdev))
43                         return -EBUSY;
44                 return 0;
45         }