Fixes following error: nl80211: New interface wlan0-1 created: ifindex=38 nl80211: Add own interface ifindex 38 Could not set interface wlan0-1 flags (UP): Device or resource busy nl80211: Remove interface ifindex=38 Failed to add BSS (BSSID=c6:93:00:zz:yy:xx)
Signed-off-by: Petr Štetiar <yn...@true.cz> --- ...ecate-max_sta_intf-field-of-struct-rt2x00.patch | 146 ++++++++++++++++++ ...ace-open-coded-interface-checking-with-in.patch | 162 ++++++++++++++++++++ 2 files changed, 308 insertions(+) create mode 100644 package/mac80211/patches/622-rt2x00-Deprecate-max_sta_intf-field-of-struct-rt2x00.patch create mode 100644 package/mac80211/patches/623-rt2x00-Replace-open-coded-interface-checking-with-in.patch diff --git a/package/mac80211/patches/622-rt2x00-Deprecate-max_sta_intf-field-of-struct-rt2x00.patch b/package/mac80211/patches/622-rt2x00-Deprecate-max_sta_intf-field-of-struct-rt2x00.patch new file mode 100644 index 0000000..0eb3267 --- /dev/null +++ b/package/mac80211/patches/622-rt2x00-Deprecate-max_sta_intf-field-of-struct-rt2x00.patch @@ -0,0 +1,146 @@ +From 3e4c4151e56ff367fb1487ea79134eea74104077 Mon Sep 17 00:00:00 2001 +From: Gertjan van Wingerde <gwinge...@gmail.com> +Date: Sun, 23 Sep 2012 20:22:53 +0200 +Subject: [PATCH] rt2x00: Deprecate max_sta_intf field of struct rt2x00_ops. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +All drivers set this value to 1, so there is no need (currently) to let +drivers set this. Therefor, remove the field; we can always add it back when +it is needed. + +Inspired by an earlier patch from Paul Fertser. + +Signed-off-by: Gertjan van Wingerde <gwinge...@gmail.com> +Cc: Paul Fertser <fercer...@gmail.com> +Signed-off-by: John W. Linville <linvi...@tuxdriver.com> +Signed-off-by: Petr Štetiar <yn...@true.cz> +--- + drivers/net/wireless/rt2x00/rt2400pci.c | 1 - + drivers/net/wireless/rt2x00/rt2500pci.c | 1 - + drivers/net/wireless/rt2x00/rt2500usb.c | 1 - + drivers/net/wireless/rt2x00/rt2800pci.c | 1 - + drivers/net/wireless/rt2x00/rt2800usb.c | 1 - + drivers/net/wireless/rt2x00/rt2x00.h | 1 - + drivers/net/wireless/rt2x00/rt2x00mac.c | 5 ++--- + drivers/net/wireless/rt2x00/rt61pci.c | 1 - + drivers/net/wireless/rt2x00/rt73usb.c | 1 - + 9 files changed, 2 insertions(+), 11 deletions(-) + +diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c +index 6458ab8..e3a2d90 100644 +--- a/drivers/net/wireless/rt2x00/rt2400pci.c ++++ b/drivers/net/wireless/rt2x00/rt2400pci.c +@@ -1789,7 +1789,6 @@ static const struct data_queue_desc rt2400pci_queue_atim = { + + static const struct rt2x00_ops rt2400pci_ops = { + .name = KBUILD_MODNAME, +- .max_sta_intf = 1, + .max_ap_intf = 1, + .eeprom_size = EEPROM_SIZE, + .rf_size = RF_SIZE, +diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c +index 68bca14..479d756 100644 +--- a/drivers/net/wireless/rt2x00/rt2500pci.c ++++ b/drivers/net/wireless/rt2x00/rt2500pci.c +@@ -2081,7 +2081,6 @@ static const struct data_queue_desc rt2500pci_queue_atim = { + + static const struct rt2x00_ops rt2500pci_ops = { + .name = KBUILD_MODNAME, +- .max_sta_intf = 1, + .max_ap_intf = 1, + .eeprom_size = EEPROM_SIZE, + .rf_size = RF_SIZE, +diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c +index daf8579..50dfd1c 100644 +--- a/drivers/net/wireless/rt2x00/rt2500usb.c ++++ b/drivers/net/wireless/rt2x00/rt2500usb.c +@@ -1896,7 +1896,6 @@ static const struct data_queue_desc rt2500usb_queue_atim = { + + static const struct rt2x00_ops rt2500usb_ops = { + .name = KBUILD_MODNAME, +- .max_sta_intf = 1, + .max_ap_intf = 1, + .eeprom_size = EEPROM_SIZE, + .rf_size = RF_SIZE, +diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c +index 885e10e..08262fa 100644 +--- a/drivers/net/wireless/rt2x00/rt2800pci.c ++++ b/drivers/net/wireless/rt2x00/rt2800pci.c +@@ -1094,7 +1094,6 @@ static const struct data_queue_desc rt2800pci_queue_bcn = { + static const struct rt2x00_ops rt2800pci_ops = { + .name = KBUILD_MODNAME, + .drv_data_size = sizeof(struct rt2800_drv_data), +- .max_sta_intf = 1, + .max_ap_intf = 8, + .eeprom_size = EEPROM_SIZE, + .rf_size = RF_SIZE, +diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c +index 253083f..0283cf6 100644 +--- a/drivers/net/wireless/rt2x00/rt2800usb.c ++++ b/drivers/net/wireless/rt2x00/rt2800usb.c +@@ -870,7 +870,6 @@ static const struct data_queue_desc rt2800usb_queue_bcn = { + static const struct rt2x00_ops rt2800usb_ops = { + .name = KBUILD_MODNAME, + .drv_data_size = sizeof(struct rt2800_drv_data), +- .max_sta_intf = 1, + .max_ap_intf = 8, + .eeprom_size = EEPROM_SIZE, + .rf_size = RF_SIZE, +diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h +index 501cece..01e4712 100644 +--- a/drivers/net/wireless/rt2x00/rt2x00.h ++++ b/drivers/net/wireless/rt2x00/rt2x00.h +@@ -659,7 +659,6 @@ struct rt2x00lib_ops { + struct rt2x00_ops { + const char *name; + const unsigned int drv_data_size; +- const unsigned int max_sta_intf; + const unsigned int max_ap_intf; + const unsigned int eeprom_size; + const unsigned int rf_size; +diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c +index c3d0f2f..2f98d3d 100644 +--- a/drivers/net/wireless/rt2x00/rt2x00mac.c ++++ b/drivers/net/wireless/rt2x00/rt2x00mac.c +@@ -243,10 +243,9 @@ int rt2x00mac_add_interface(struct ieee80211_hw *hw, + return -ENOBUFS; + + /* +- * Check if we exceeded the maximum amount +- * of supported interfaces. ++ * We don't support multiple STA interfaces. + */ +- if (rt2x00dev->intf_sta_count >= rt2x00dev->ops->max_sta_intf) ++ if (rt2x00dev->intf_sta_count) + return -ENOBUFS; + + break; +diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c +index bc84361..1511d9e 100644 +--- a/drivers/net/wireless/rt2x00/rt61pci.c ++++ b/drivers/net/wireless/rt2x00/rt61pci.c +@@ -3050,7 +3050,6 @@ static const struct data_queue_desc rt61pci_queue_bcn = { + + static const struct rt2x00_ops rt61pci_ops = { + .name = KBUILD_MODNAME, +- .max_sta_intf = 1, + .max_ap_intf = 4, + .eeprom_size = EEPROM_SIZE, + .rf_size = RF_SIZE, +diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c +index a37b631..6c5197b 100644 +--- a/drivers/net/wireless/rt2x00/rt73usb.c ++++ b/drivers/net/wireless/rt2x00/rt73usb.c +@@ -2382,7 +2382,6 @@ static const struct data_queue_desc rt73usb_queue_bcn = { + + static const struct rt2x00_ops rt73usb_ops = { + .name = KBUILD_MODNAME, +- .max_sta_intf = 1, + .max_ap_intf = 4, + .eeprom_size = EEPROM_SIZE, + .rf_size = RF_SIZE, +-- +1.7.9.5 + diff --git a/package/mac80211/patches/623-rt2x00-Replace-open-coded-interface-checking-with-in.patch b/package/mac80211/patches/623-rt2x00-Replace-open-coded-interface-checking-with-in.patch new file mode 100644 index 0000000..0d217e6 --- /dev/null +++ b/package/mac80211/patches/623-rt2x00-Replace-open-coded-interface-checking-with-in.patch @@ -0,0 +1,162 @@ +From 55d2e9da744ba11eae900b4bfc2da72eace3c1e1 Mon Sep 17 00:00:00 2001 +From: Gertjan van Wingerde <gwinge...@gmail.com> +Date: Sun, 23 Sep 2012 20:22:54 +0200 +Subject: [PATCH] rt2x00: Replace open coded interface checking with interface + combinations. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Mac80211 has formal infrastructure to specify which interface combinations are +supported. Make use of this facility in favor of open coding it ourselves. So +far we only have to specify we can support multiple AP interfaces, no other +combinations are supported. + +Inspired by an earlier patch from Paul Fertser. + +Signed-off-by: Gertjan van Wingerde <gwinge...@gmail.com> +Cc: Paul Fertser <fercer...@gmail.com> +Signed-off-by: John W. Linville <linvi...@tuxdriver.com> +Signed-off-by: Petr Štetiar <yn...@true.cz> +--- + drivers/net/wireless/rt2x00/rt2x00.h | 14 +++++++++++ + drivers/net/wireless/rt2x00/rt2x00dev.c | 33 ++++++++++++++++++++++++++ + drivers/net/wireless/rt2x00/rt2x00mac.c | 39 ------------------------------- + 3 files changed, 47 insertions(+), 39 deletions(-) + +diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h +index 01e4712..8b82e77 100644 +--- a/drivers/net/wireless/rt2x00/rt2x00.h ++++ b/drivers/net/wireless/rt2x00/rt2x00.h +@@ -745,6 +745,14 @@ enum rt2x00_capability_flags { + }; + + /* ++ * Interface combinations ++ */ ++enum { ++ IF_COMB_AP = 0, ++ NUM_IF_COMB, ++}; ++ ++/* + * rt2x00 device structure. + */ + struct rt2x00_dev { +@@ -871,6 +879,12 @@ struct rt2x00_dev { + unsigned int intf_beaconing; + + /* ++ * Interface combinations ++ */ ++ struct ieee80211_iface_limit if_limits_ap; ++ struct ieee80211_iface_combination if_combinations[NUM_IF_COMB]; ++ ++ /* + * Link quality + */ + struct link link; +diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c +index 22b9666..14f9209 100644 +--- a/drivers/net/wireless/rt2x00/rt2x00dev.c ++++ b/drivers/net/wireless/rt2x00/rt2x00dev.c +@@ -1146,6 +1146,34 @@ void rt2x00lib_stop(struct rt2x00_dev *rt2x00dev) + rt2x00dev->intf_associated = 0; + } + ++static inline void rt2x00lib_set_if_combinations(struct rt2x00_dev *rt2x00dev) ++{ ++ struct ieee80211_iface_limit *if_limit; ++ struct ieee80211_iface_combination *if_combination; ++ ++ /* ++ * Build up AP interface limits structure. ++ */ ++ if_limit = &rt2x00dev->if_limits_ap; ++ if_limit->max = rt2x00dev->ops->max_ap_intf; ++ if_limit->types = BIT(NL80211_IFTYPE_AP); ++ ++ /* ++ * Build up AP interface combinations structure. ++ */ ++ if_combination = &rt2x00dev->if_combinations[IF_COMB_AP]; ++ if_combination->limits = if_limit; ++ if_combination->n_limits = 1; ++ if_combination->max_interfaces = if_limit->max; ++ if_combination->num_different_channels = 1; ++ ++ /* ++ * Finally, specify the possible combinations to mac80211. ++ */ ++ rt2x00dev->hw->wiphy->iface_combinations = rt2x00dev->if_combinations; ++ rt2x00dev->hw->wiphy->n_iface_combinations = 1; ++} ++ + /* + * driver allocation handlers. + */ +@@ -1165,6 +1193,11 @@ int rt2x00lib_probe_dev(struct rt2x00_dev *rt2x00dev) + } + } + ++ /* ++ * Set possible interface combinations. ++ */ ++ rt2x00lib_set_if_combinations(rt2x00dev); ++ + spin_lock_init(&rt2x00dev->irqmask_lock); + mutex_init(&rt2x00dev->csr_mutex); + +diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c +index 2f98d3d..98a9e48 100644 +--- a/drivers/net/wireless/rt2x00/rt2x00mac.c ++++ b/drivers/net/wireless/rt2x00/rt2x00mac.c +@@ -214,45 +214,6 @@ int rt2x00mac_add_interface(struct ieee80211_hw *hw, + !test_bit(DEVICE_STATE_STARTED, &rt2x00dev->flags)) + return -ENODEV; + +- switch (vif->type) { +- case NL80211_IFTYPE_AP: +- /* +- * We don't support mixed combinations of +- * sta and ap interfaces. +- */ +- if (rt2x00dev->intf_sta_count) +- return -ENOBUFS; +- +- /* +- * Check if we exceeded the maximum amount +- * of supported interfaces. +- */ +- if (rt2x00dev->intf_ap_count >= rt2x00dev->ops->max_ap_intf) +- return -ENOBUFS; +- +- break; +- case NL80211_IFTYPE_STATION: +- case NL80211_IFTYPE_ADHOC: +- case NL80211_IFTYPE_MESH_POINT: +- case NL80211_IFTYPE_WDS: +- /* +- * We don't support mixed combinations of +- * sta and ap interfaces. +- */ +- if (rt2x00dev->intf_ap_count) +- return -ENOBUFS; +- +- /* +- * We don't support multiple STA interfaces. +- */ +- if (rt2x00dev->intf_sta_count) +- return -ENOBUFS; +- +- break; +- default: +- return -EINVAL; +- } +- + /* + * Loop through all beacon queues to find a free + * entry. Since there are as much beacon entries +-- +1.7.9.5 + -- 1.7.9.5 _______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel