From 404ce58be9e4b9a6914b8ced1b60adceea85b989 Mon Sep 17 00:00:00 2001 From: "Luis R. Rodriguez" Date: Fri, 6 Aug 2010 16:15:57 -0700 Subject: [PATCH] compat-wireless: use new br_port_exists() from compat.git This lets us simplify the way we backport the new bridge port changes on the bridge code. We can nuke this new patch file if we later get br_port_exists() accepted to be used on drivers. Signed-off-by: Luis R. Rodriguez --- patches/30-br-port-backport.patch | 31 --------------------- patches/30-bridge-port.patch | 45 +++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 31 deletions(-) delete mode 100644 patches/30-br-port-backport.patch create mode 100644 patches/30-bridge-port.patch diff --git a/patches/30-br-port-backport.patch b/patches/30-br-port-backport.patch deleted file mode 100644 index 67f86eb1a2a6..000000000000 --- a/patches/30-br-port-backport.patch +++ /dev/null @@ -1,31 +0,0 @@ -In commit f350a0a87374418635689471606454abc7beaa3a the br_port -attribute was replaced with a private flag. - ---- a/net/wireless/nl80211.c -+++ b/net/wireless/nl80211.c -@@ -1140,7 +1140,11 @@ static int nl80211_valid_4addr(struct cf - enum nl80211_iftype iftype) - { - if (!use_4addr) { -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) - if (netdev && (netdev->priv_flags & IFF_BRIDGE_PORT)) -+#else -+ if (netdev && netdev->br_port) -+#endif - return -EBUSY; - return 0; - } ---- a/net/wireless/util.c -+++ b/net/wireless/util.c -@@ -770,7 +770,11 @@ int cfg80211_change_iface(struct cfg8021 - return -EOPNOTSUPP; - - /* if it's part of a bridge, reject changing type to station/ibss */ -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) - if ((dev->priv_flags & IFF_BRIDGE_PORT) && -+#else -+ if (dev->br_port && -+#endif - (ntype == NL80211_IFTYPE_ADHOC || ntype == NL80211_IFTYPE_STATION)) - return -EBUSY; - diff --git a/patches/30-bridge-port.patch b/patches/30-bridge-port.patch new file mode 100644 index 000000000000..1ee46616732e --- /dev/null +++ b/patches/30-bridge-port.patch @@ -0,0 +1,45 @@ +The patch titled: + + bridge: use rx_handler_data pointer to store net_bridge_port pointer + +by Jiri Pirko moved the br_ports pointer +out of the netdev which older kernels relied on and then added +a flag to the netdev to check for it as follows: + +- dev->br_port) { ++ (dev->priv_flags & IFF_BRIDGE_PORT)) { + +So to backport this we instead rely on a br_port_exists() call +which compat.git provides and depending on the kernel it will either +check for the dev->br_port or the IFF_BRIDGE_PORT flag. A patch +to get the blow code merged upstream and to use br_port_exists() +everywhere else will be submitted but not sure if it will be +accepted. + +This patch can be removed once we get br_port_exists() accessible +to drivers and not just private bridge code. If that patch doesn't +get accepted upstream we'l have to carry this patch around for +compat-wireless. + +--- a/net/wireless/util.c ++++ b/net/wireless/util.c +@@ -770,7 +770,7 @@ int cfg80211_change_iface(struct cfg8021 + return -EOPNOTSUPP; + + /* if it's part of a bridge, reject changing type to station/ibss */ +- if ((dev->priv_flags & IFF_BRIDGE_PORT) && ++ if (br_port_exists(dev) && + (ntype == NL80211_IFTYPE_ADHOC || ntype == NL80211_IFTYPE_STATION)) + return -EBUSY; + +--- a/net/wireless/nl80211.c ++++ b/net/wireless/nl80211.c +@@ -1140,7 +1140,7 @@ static int nl80211_valid_4addr(struct cf + enum nl80211_iftype iftype) + { + if (!use_4addr) { +- if (netdev && (netdev->priv_flags & IFF_BRIDGE_PORT)) ++ if (netdev && br_port_exists(netdev)) + return -EBUSY; + return 0; + } -- 2.30.2