diff for duplicates of <4C8A8FF8.4030900@candelatech.com> diff --git a/a/1.txt b/N1/1.txt index 0d7ff6a..c0242bd 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -13,9 +13,3 @@ Ben -- Ben Greear <greearb@candelatech.com> Candela Technologies Inc http://www.candelatech.com - - --------------- next part -------------- -An embedded and charset-unspecified text was scrubbed... -Name: wt-36-vsta-ok-c.patch -Url: http://lists.ath9k.org/pipermail/ath9k-devel/attachments/20100910/2bb9cea1/attachment-0001.txt diff --git a/N1/2.hdr b/N1/2.hdr new file mode 100644 index 0000000..cc623e8 --- /dev/null +++ b/N1/2.hdr @@ -0,0 +1,5 @@ +Content-Type: text/plain; + name="wt-36-vsta-ok-c.patch" +Content-Transfer-Encoding: 7bit +Content-Disposition: attachment; + filename="wt-36-vsta-ok-c.patch" diff --git a/N1/2.txt b/N1/2.txt new file mode 100644 index 0000000..e9b78c9 --- /dev/null +++ b/N1/2.txt @@ -0,0 +1,297 @@ +diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c +index 2a6e45a..26fb322 100644 +--- a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c ++++ b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c +@@ -416,6 +416,7 @@ static void ath9k_htc_opmode_init(struct ath9k_htc_priv *priv) + + /* configure bssid mask */ + if (ah->caps.hw_caps & ATH9K_HW_CAP_BSSIDMASK) ++ /* NOTE: Maybe this should be ath9k_set_bssid_mask?? */ + ath_hw_setbssidmask(common); + + /* configure operational mode */ +diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c +index b32c8f0..4ce4029 100644 +--- a/drivers/net/wireless/ath/ath9k/recv.c ++++ b/drivers/net/wireless/ath/ath9k/recv.c +@@ -110,7 +110,6 @@ static void ath_setdefantenna(struct ath_softc *sc, u32 antenna) + static void ath_opmode_init(struct ath_softc *sc) + { + struct ath_hw *ah = sc->sc_ah; +- struct ath_common *common = ath9k_hw_common(ah); + + u32 rfilt, mfilt[2]; + +@@ -118,9 +117,15 @@ static void ath_opmode_init(struct ath_softc *sc) + rfilt = ath_calcrxfilter(sc); + ath9k_hw_setrxfilter(ah, rfilt); + +- /* configure bssid mask */ +- if (ah->caps.hw_caps & ATH9K_HW_CAP_BSSIDMASK) +- ath_hw_setbssidmask(common); ++ /* configure bssid mask, if ah->hw is configured. ++ * it is NOT configured when mac80211 is calling ++ * ieee80211_do_open, but probably just as well since ++ * this STA isn't in the list yet. ++ */ ++ if (ah->hw) { ++ if (ah->caps.hw_caps & ATH9K_HW_CAP_BSSIDMASK) ++ ath9k_set_bssid_mask(ah->hw); ++ } + + /* configure operational mode */ + ath9k_hw_setopmode(ah); +@@ -426,6 +431,7 @@ u32 ath_calcrxfilter(struct ath_softc *sc) + #define RX_FILTER_PRESERVE (ATH9K_RX_FILTER_PHYERR | ATH9K_RX_FILTER_PHYRADAR) + + u32 rfilt; ++ int avifs = ieee80211_count_sta_atomic(sc->hw); + + rfilt = (ath9k_hw_getrxfilter(sc->sc_ah) & RX_FILTER_PRESERVE) + | ATH9K_RX_FILTER_UCAST | ATH9K_RX_FILTER_BCAST +@@ -448,7 +454,11 @@ u32 ath_calcrxfilter(struct ath_softc *sc) + if (sc->rx.rxfilter & FIF_CONTROL) + rfilt |= ATH9K_RX_FILTER_CONTROL; + ++ /* If we have more than one active STA, then we need to ++ * accept more than just MYBEACON. ++ */ + if ((sc->sc_ah->opmode == NL80211_IFTYPE_STATION) && ++ (avifs <= 1) && + !(sc->rx.rxfilter & FIF_BCN_PRBRESP_PROMISC)) + rfilt |= ATH9K_RX_FILTER_MYBEACON; + else +@@ -463,9 +473,7 @@ u32 ath_calcrxfilter(struct ath_softc *sc) + if (conf_is_ht(&sc->hw->conf)) + rfilt |= ATH9K_RX_FILTER_COMP_BAR; + +- if (sc->sec_wiphy || (sc->rx.rxfilter & FIF_OTHER_BSS)) { +- /* TODO: only needed if more than one BSSID is in use in +- * station/adhoc mode */ ++ if (sc->sec_wiphy || (avifs > 1) || (sc->rx.rxfilter & FIF_OTHER_BSS)) { + /* The following may also be needed for other older chips */ + if (sc->sc_ah->hw_version.macVersion == AR_SREV_VERSION_9160) + rfilt |= ATH9K_RX_FILTER_PROM; +diff --git a/drivers/net/wireless/ath/ath9k/virtual.c b/drivers/net/wireless/ath/ath9k/virtual.c +index fd20241..9c1d529 100644 +--- a/drivers/net/wireless/ath/ath9k/virtual.c ++++ b/drivers/net/wireless/ath/ath9k/virtual.c +@@ -59,15 +59,17 @@ void ath9k_set_bssid_mask(struct ieee80211_hw *hw) + } else + iter_data.count = 0; + +- /* Get list of all active MAC addresses */ ++ /* Get list of all MAC addresses for STA and ADHOC interfaces. */ + spin_lock_bh(&sc->wiphy_lock); +- ieee80211_iterate_active_interfaces_atomic(sc->hw, ath9k_vif_iter, +- &iter_data); ++ ieee80211_iterate_interfaces_helper(sc->hw, true, false, ++ ath9k_vif_iter, ++ &iter_data); + for (i = 0; i < sc->num_sec_wiphy; i++) { + if (sc->sec_wiphy[i] == NULL) + continue; +- ieee80211_iterate_active_interfaces_atomic( +- sc->sec_wiphy[i]->hw, ath9k_vif_iter, &iter_data); ++ ieee80211_iterate_interfaces_helper( ++ sc->sec_wiphy[i]->hw, true, false, ++ ath9k_vif_iter, &iter_data); + } + spin_unlock_bh(&sc->wiphy_lock); + +diff --git a/include/net/mac80211.h b/include/net/mac80211.h +index f91fc33..e87396d 100644 +--- a/include/net/mac80211.h ++++ b/include/net/mac80211.h +@@ -2320,6 +2320,35 @@ void ieee80211_iterate_active_interfaces_atomic(struct ieee80211_hw *hw, + u8 *mac, + struct ieee80211_vif *vif), + void *data); ++/** ++ * ieee80211_iterate_interfaces_helper - iterate interfaces ++ * ++ * This function iterates over the interfaces associated with a given ++ * hardware and calls the callback for them. If do_atomic is true, ++ * this function requires the iterator callback function to be atomic, ++ * if that is not desired, set do_atomic to false. ++ * If you want only active interfaces, set active_only to true. ++ * See also: @ieee80211_iterate_active_interfaces ++ * @ieee80211_iterate_active_interfaces_atomic ++ * ++ * Returns number of interfaces to be filtered. ++ * @hw: the hardware struct of which the interfaces should be iterated over ++ * @do_atomic: Should iterator be treated as atomic or not. ++ * @active_only: Should we only iterate over active interfaces. ++ * @iterator: the iterator function to call, cannot sleep ++ * @data: first argument of the iterator function ++ */ ++int ieee80211_iterate_interfaces_helper(struct ieee80211_hw *hw, ++ bool do_atomic, ++ bool active_only, ++ void (*iterator)(void *data, u8 *mac, ++ struct ieee80211_vif *vif), ++ void *data); ++ ++/** Return a count of all station-like interfaces for ++ * this hardware. Running/Stopped state has no affect. ++ */ ++int ieee80211_count_sta_atomic(struct ieee80211_hw *hw); + + /** + * ieee80211_queue_work - add work onto the mac80211 workqueue +diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c +index 687077e..db751f1 100644 +--- a/net/mac80211/sta_info.c ++++ b/net/mac80211/sta_info.c +@@ -440,7 +440,7 @@ int sta_info_insert_rcu(struct sta_info *sta) __acquires(RCU) + + spin_lock_irqsave(&local->sta_lock, flags); + /* check if STA exists already */ +- if (sta_info_get_bss(sdata, sta->sta.addr)) { ++ if (sta_info_get(sdata, sta->sta.addr)) { + spin_unlock_irqrestore(&local->sta_lock, flags); + mutex_unlock(&local->sta_mtx); + rcu_read_lock(); +diff --git a/net/mac80211/util.c b/net/mac80211/util.c +index bd40b11..1096dac 100644 +--- a/net/mac80211/util.c ++++ b/net/mac80211/util.c +@@ -461,37 +461,75 @@ void ieee80211_wake_queues(struct ieee80211_hw *hw) + } + EXPORT_SYMBOL(ieee80211_wake_queues); + +-void ieee80211_iterate_active_interfaces( ++static int _iter_loop_helper( ++ struct ieee80211_sub_if_data *sdata, ++ bool active_only, ++ void (*iterator)(void *data, u8 *mac, ++ struct ieee80211_vif *vif), ++ void *data) ++{ ++ switch (sdata->vif.type) { ++ case NUM_NL80211_IFTYPES: ++ case NL80211_IFTYPE_UNSPECIFIED: ++ case NL80211_IFTYPE_MONITOR: ++ case NL80211_IFTYPE_AP_VLAN: ++ return 0; ++ case NL80211_IFTYPE_AP: ++ case NL80211_IFTYPE_STATION: ++ case NL80211_IFTYPE_ADHOC: ++ case NL80211_IFTYPE_WDS: ++ case NL80211_IFTYPE_MESH_POINT: ++ break; ++ } ++ if (ieee80211_sdata_running(sdata) || !active_only) { ++ if (iterator) ++ iterator(data, sdata->vif.addr, ++ &sdata->vif); ++ return 1; ++ } ++ return 0; ++} ++ ++int ieee80211_iterate_interfaces_helper( + struct ieee80211_hw *hw, ++ bool do_atomic, ++ bool active_only, + void (*iterator)(void *data, u8 *mac, + struct ieee80211_vif *vif), + void *data) + { + struct ieee80211_local *local = hw_to_local(hw); + struct ieee80211_sub_if_data *sdata; ++ int cnt = 0; + +- mutex_lock(&local->iflist_mtx); ++ if (do_atomic) { ++ rcu_read_lock(); + +- list_for_each_entry(sdata, &local->interfaces, list) { +- switch (sdata->vif.type) { +- case NUM_NL80211_IFTYPES: +- case NL80211_IFTYPE_UNSPECIFIED: +- case NL80211_IFTYPE_MONITOR: +- case NL80211_IFTYPE_AP_VLAN: +- continue; +- case NL80211_IFTYPE_AP: +- case NL80211_IFTYPE_STATION: +- case NL80211_IFTYPE_ADHOC: +- case NL80211_IFTYPE_WDS: +- case NL80211_IFTYPE_MESH_POINT: +- break; ++ list_for_each_entry_rcu(sdata, &local->interfaces, list) { ++ cnt += _iter_loop_helper(sdata, active_only, ++ iterator, data); + } +- if (ieee80211_sdata_running(sdata)) +- iterator(data, sdata->vif.addr, +- &sdata->vif); ++ rcu_read_unlock(); ++ } else { ++ mutex_lock(&local->iflist_mtx); ++ list_for_each_entry(sdata, &local->interfaces, list) { ++ cnt += _iter_loop_helper(sdata, active_only, ++ iterator, data); ++ } ++ mutex_unlock(&local->iflist_mtx); + } ++ return cnt; ++} ++EXPORT_SYMBOL_GPL(ieee80211_iterate_interfaces_helper); ++ + +- mutex_unlock(&local->iflist_mtx); ++void ieee80211_iterate_active_interfaces( ++ struct ieee80211_hw *hw, ++ void (*iterator)(void *data, u8 *mac, ++ struct ieee80211_vif *vif), ++ void *data) ++{ ++ ieee80211_iterate_interfaces_helper(hw, false, false, iterator, data); + } + EXPORT_SYMBOL_GPL(ieee80211_iterate_active_interfaces); + +@@ -501,33 +539,20 @@ void ieee80211_iterate_active_interfaces_atomic( + struct ieee80211_vif *vif), + void *data) + { +- struct ieee80211_local *local = hw_to_local(hw); +- struct ieee80211_sub_if_data *sdata; ++ ieee80211_iterate_interfaces_helper(hw, true, false, iterator, data); ++} ++EXPORT_SYMBOL_GPL(ieee80211_iterate_active_interfaces_atomic); + +- rcu_read_lock(); + +- list_for_each_entry_rcu(sdata, &local->interfaces, list) { +- switch (sdata->vif.type) { +- case NUM_NL80211_IFTYPES: +- case NL80211_IFTYPE_UNSPECIFIED: +- case NL80211_IFTYPE_MONITOR: +- case NL80211_IFTYPE_AP_VLAN: +- continue; +- case NL80211_IFTYPE_AP: +- case NL80211_IFTYPE_STATION: +- case NL80211_IFTYPE_ADHOC: +- case NL80211_IFTYPE_WDS: +- case NL80211_IFTYPE_MESH_POINT: +- break; +- } +- if (ieee80211_sdata_running(sdata)) +- iterator(data, sdata->vif.addr, +- &sdata->vif); +- } + +- rcu_read_unlock(); ++/** Return a count of all station-like interfaces for ++ * this hardware. Running/Stopped state has no affect. ++ */ ++int ieee80211_count_sta_atomic(struct ieee80211_hw *hw) ++{ ++ return ieee80211_iterate_interfaces_helper(hw, true, false, NULL, NULL); + } +-EXPORT_SYMBOL_GPL(ieee80211_iterate_active_interfaces_atomic); ++EXPORT_SYMBOL_GPL(ieee80211_count_sta_atomic); + + /* + * Nothing should have been stuffed into the workqueue during diff --git a/a/content_digest b/N1/content_digest index 36a0502..e6c6d09 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -1,8 +1,9 @@ "From\0Ben Greear <greearb@candelatech.com>\0" - "Subject\0[ath9k-devel] RFC: v3: Support multiple STA on same AP with ath9k\0" + "Subject\0RFC: v3: Support multiple STA on same AP with ath9k\0" "Date\0Fri, 10 Sep 2010 13:07:20 -0700\0" - "To\0ath9k-devel@lists.ath9k.org\0" - "\00:1\0" + "To\0linux-wireless@vger.kernel.org <linux-wireless@vger.kernel.org>" + " ath9k-devel@lists.ath9k.org <ath9k-devel@venema.h4ckr.net>\0" + "\01:1\0" "b\0" "The attached patch lets mac80111 create multiple STA on the same\n" "AP, and the changes to ath9k let it function properly, at least for\n" @@ -18,12 +19,306 @@ "\n" "-- \n" "Ben Greear <greearb@candelatech.com>\n" - "Candela Technologies Inc http://www.candelatech.com\n" - "\n" - "\n" - "-------------- next part --------------\n" - "An embedded and charset-unspecified text was scrubbed...\n" - "Name: wt-36-vsta-ok-c.patch\n" - Url: http://lists.ath9k.org/pipermail/ath9k-devel/attachments/20100910/2bb9cea1/attachment-0001.txt + Candela Technologies Inc http://www.candelatech.com + "\01:2\0" + "fn\0wt-36-vsta-ok-c.patch\0" + "b\0" + "diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c\n" + "index 2a6e45a..26fb322 100644\n" + "--- a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c\n" + "+++ b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c\n" + "@@ -416,6 +416,7 @@ static void ath9k_htc_opmode_init(struct ath9k_htc_priv *priv)\n" + " \n" + " \t/* configure bssid mask */\n" + " \tif (ah->caps.hw_caps & ATH9K_HW_CAP_BSSIDMASK)\n" + "+\t\t/* NOTE: Maybe this should be ath9k_set_bssid_mask?? */\n" + " \t\tath_hw_setbssidmask(common);\n" + " \n" + " \t/* configure operational mode */\n" + "diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c\n" + "index b32c8f0..4ce4029 100644\n" + "--- a/drivers/net/wireless/ath/ath9k/recv.c\n" + "+++ b/drivers/net/wireless/ath/ath9k/recv.c\n" + "@@ -110,7 +110,6 @@ static void ath_setdefantenna(struct ath_softc *sc, u32 antenna)\n" + " static void ath_opmode_init(struct ath_softc *sc)\n" + " {\n" + " \tstruct ath_hw *ah = sc->sc_ah;\n" + "-\tstruct ath_common *common = ath9k_hw_common(ah);\n" + " \n" + " \tu32 rfilt, mfilt[2];\n" + " \n" + "@@ -118,9 +117,15 @@ static void ath_opmode_init(struct ath_softc *sc)\n" + " \trfilt = ath_calcrxfilter(sc);\n" + " \tath9k_hw_setrxfilter(ah, rfilt);\n" + " \n" + "-\t/* configure bssid mask */\n" + "-\tif (ah->caps.hw_caps & ATH9K_HW_CAP_BSSIDMASK)\n" + "-\t\tath_hw_setbssidmask(common);\n" + "+\t/* configure bssid mask, if ah->hw is configured.\n" + "+\t * it is NOT configured when mac80211 is calling\n" + "+\t * ieee80211_do_open, but probably just as well since\n" + "+\t * this STA isn't in the list yet.\n" + "+\t */\n" + "+\tif (ah->hw) {\n" + "+\t\tif (ah->caps.hw_caps & ATH9K_HW_CAP_BSSIDMASK)\n" + "+\t\t\tath9k_set_bssid_mask(ah->hw);\n" + "+\t}\n" + " \n" + " \t/* configure operational mode */\n" + " \tath9k_hw_setopmode(ah);\n" + "@@ -426,6 +431,7 @@ u32 ath_calcrxfilter(struct ath_softc *sc)\n" + " #define\tRX_FILTER_PRESERVE (ATH9K_RX_FILTER_PHYERR | ATH9K_RX_FILTER_PHYRADAR)\n" + " \n" + " \tu32 rfilt;\n" + "+\tint avifs = ieee80211_count_sta_atomic(sc->hw);\n" + " \n" + " \trfilt = (ath9k_hw_getrxfilter(sc->sc_ah) & RX_FILTER_PRESERVE)\n" + " \t\t| ATH9K_RX_FILTER_UCAST | ATH9K_RX_FILTER_BCAST\n" + "@@ -448,7 +454,11 @@ u32 ath_calcrxfilter(struct ath_softc *sc)\n" + " \tif (sc->rx.rxfilter & FIF_CONTROL)\n" + " \t\trfilt |= ATH9K_RX_FILTER_CONTROL;\n" + " \n" + "+\t/* If we have more than one active STA, then we need to\n" + "+\t * accept more than just MYBEACON.\n" + "+\t */\n" + " \tif ((sc->sc_ah->opmode == NL80211_IFTYPE_STATION) &&\n" + "+\t (avifs <= 1) &&\n" + " \t !(sc->rx.rxfilter & FIF_BCN_PRBRESP_PROMISC))\n" + " \t\trfilt |= ATH9K_RX_FILTER_MYBEACON;\n" + " \telse\n" + "@@ -463,9 +473,7 @@ u32 ath_calcrxfilter(struct ath_softc *sc)\n" + " \tif (conf_is_ht(&sc->hw->conf))\n" + " \t\trfilt |= ATH9K_RX_FILTER_COMP_BAR;\n" + " \n" + "-\tif (sc->sec_wiphy || (sc->rx.rxfilter & FIF_OTHER_BSS)) {\n" + "-\t\t/* TODO: only needed if more than one BSSID is in use in\n" + "-\t\t * station/adhoc mode */\n" + "+\tif (sc->sec_wiphy || (avifs > 1) || (sc->rx.rxfilter & FIF_OTHER_BSS)) {\n" + " \t\t/* The following may also be needed for other older chips */\n" + " \t\tif (sc->sc_ah->hw_version.macVersion == AR_SREV_VERSION_9160)\n" + " \t\t\trfilt |= ATH9K_RX_FILTER_PROM;\n" + "diff --git a/drivers/net/wireless/ath/ath9k/virtual.c b/drivers/net/wireless/ath/ath9k/virtual.c\n" + "index fd20241..9c1d529 100644\n" + "--- a/drivers/net/wireless/ath/ath9k/virtual.c\n" + "+++ b/drivers/net/wireless/ath/ath9k/virtual.c\n" + "@@ -59,15 +59,17 @@ void ath9k_set_bssid_mask(struct ieee80211_hw *hw)\n" + " \t} else\n" + " \t\titer_data.count = 0;\n" + " \n" + "-\t/* Get list of all active MAC addresses */\n" + "+\t/* Get list of all MAC addresses for STA and ADHOC interfaces. */\n" + " \tspin_lock_bh(&sc->wiphy_lock);\n" + "-\tieee80211_iterate_active_interfaces_atomic(sc->hw, ath9k_vif_iter,\n" + "-\t\t\t\t\t\t &iter_data);\n" + "+\tieee80211_iterate_interfaces_helper(sc->hw, true, false,\n" + "+\t\t\t\t\t ath9k_vif_iter,\n" + "+\t\t\t\t\t &iter_data);\n" + " \tfor (i = 0; i < sc->num_sec_wiphy; i++) {\n" + " \t\tif (sc->sec_wiphy[i] == NULL)\n" + " \t\t\tcontinue;\n" + "-\t\tieee80211_iterate_active_interfaces_atomic(\n" + "-\t\t\tsc->sec_wiphy[i]->hw, ath9k_vif_iter, &iter_data);\n" + "+\t\tieee80211_iterate_interfaces_helper(\n" + "+\t\t\tsc->sec_wiphy[i]->hw, true, false,\n" + "+\t\t\tath9k_vif_iter, &iter_data);\n" + " \t}\n" + " \tspin_unlock_bh(&sc->wiphy_lock);\n" + " \n" + "diff --git a/include/net/mac80211.h b/include/net/mac80211.h\n" + "index f91fc33..e87396d 100644\n" + "--- a/include/net/mac80211.h\n" + "+++ b/include/net/mac80211.h\n" + "@@ -2320,6 +2320,35 @@ void ieee80211_iterate_active_interfaces_atomic(struct ieee80211_hw *hw,\n" + " \t\t\t\t\t\t u8 *mac,\n" + " \t\t\t\t\t\t struct ieee80211_vif *vif),\n" + " \t\t\t\t\t\tvoid *data);\n" + "+/**\n" + "+ * ieee80211_iterate_interfaces_helper - iterate interfaces\n" + "+ *\n" + "+ * This function iterates over the interfaces associated with a given\n" + "+ * hardware and calls the callback for them. If do_atomic is true,\n" + "+ * this function requires the iterator callback function to be atomic,\n" + "+ * if that is not desired, set do_atomic to false.\n" + "+ * If you want only active interfaces, set active_only to true.\n" + "+ * See also: @ieee80211_iterate_active_interfaces\n" + "+ * @ieee80211_iterate_active_interfaces_atomic\n" + "+ *\n" + "+ * Returns number of interfaces to be filtered.\n" + "+ * @hw: the hardware struct of which the interfaces should be iterated over\n" + "+ * @do_atomic: Should iterator be treated as atomic or not.\n" + "+ * @active_only: Should we only iterate over active interfaces.\n" + "+ * @iterator: the iterator function to call, cannot sleep\n" + "+ * @data: first argument of the iterator function\n" + "+ */\n" + "+int ieee80211_iterate_interfaces_helper(struct ieee80211_hw *hw,\n" + "+\t\t\t\t\tbool do_atomic,\n" + "+\t\t\t\t\tbool active_only,\n" + "+\t\t\t\t\tvoid (*iterator)(void *data, u8 *mac,\n" + "+\t\t\t\t\t\tstruct ieee80211_vif *vif),\n" + "+\t\t\t\t\tvoid *data);\n" + "+\n" + "+/** Return a count of all station-like interfaces for\n" + "+ * this hardware. Running/Stopped state has no affect.\n" + "+ */\n" + "+int ieee80211_count_sta_atomic(struct ieee80211_hw *hw);\n" + " \n" + " /**\n" + " * ieee80211_queue_work - add work onto the mac80211 workqueue\n" + "diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c\n" + "index 687077e..db751f1 100644\n" + "--- a/net/mac80211/sta_info.c\n" + "+++ b/net/mac80211/sta_info.c\n" + "@@ -440,7 +440,7 @@ int sta_info_insert_rcu(struct sta_info *sta) __acquires(RCU)\n" + " \n" + " \tspin_lock_irqsave(&local->sta_lock, flags);\n" + " \t/* check if STA exists already */\n" + "-\tif (sta_info_get_bss(sdata, sta->sta.addr)) {\n" + "+\tif (sta_info_get(sdata, sta->sta.addr)) {\n" + " \t\tspin_unlock_irqrestore(&local->sta_lock, flags);\n" + " \t\tmutex_unlock(&local->sta_mtx);\n" + " \t\trcu_read_lock();\n" + "diff --git a/net/mac80211/util.c b/net/mac80211/util.c\n" + "index bd40b11..1096dac 100644\n" + "--- a/net/mac80211/util.c\n" + "+++ b/net/mac80211/util.c\n" + "@@ -461,37 +461,75 @@ void ieee80211_wake_queues(struct ieee80211_hw *hw)\n" + " }\n" + " EXPORT_SYMBOL(ieee80211_wake_queues);\n" + " \n" + "-void ieee80211_iterate_active_interfaces(\n" + "+static int _iter_loop_helper(\n" + "+\tstruct ieee80211_sub_if_data *sdata,\n" + "+\tbool active_only,\n" + "+\tvoid (*iterator)(void *data, u8 *mac,\n" + "+\t\t\t struct ieee80211_vif *vif),\n" + "+\tvoid *data)\n" + "+{\n" + "+\tswitch (sdata->vif.type) {\n" + "+\tcase NUM_NL80211_IFTYPES:\n" + "+\tcase NL80211_IFTYPE_UNSPECIFIED:\n" + "+\tcase NL80211_IFTYPE_MONITOR:\n" + "+\tcase NL80211_IFTYPE_AP_VLAN:\n" + "+\t\treturn 0;\n" + "+\tcase NL80211_IFTYPE_AP:\n" + "+\tcase NL80211_IFTYPE_STATION:\n" + "+\tcase NL80211_IFTYPE_ADHOC:\n" + "+\tcase NL80211_IFTYPE_WDS:\n" + "+\tcase NL80211_IFTYPE_MESH_POINT:\n" + "+\t\tbreak;\n" + "+\t}\n" + "+\tif (ieee80211_sdata_running(sdata) || !active_only) {\n" + "+\t\tif (iterator)\n" + "+\t\t\titerator(data, sdata->vif.addr,\n" + "+\t\t\t\t &sdata->vif);\n" + "+\t\treturn 1;\n" + "+\t}\n" + "+\treturn 0;\n" + "+}\n" + "+\n" + "+int ieee80211_iterate_interfaces_helper(\n" + " \tstruct ieee80211_hw *hw,\n" + "+\tbool do_atomic,\n" + "+\tbool active_only,\n" + " \tvoid (*iterator)(void *data, u8 *mac,\n" + " \t\t\t struct ieee80211_vif *vif),\n" + " \tvoid *data)\n" + " {\n" + " \tstruct ieee80211_local *local = hw_to_local(hw);\n" + " \tstruct ieee80211_sub_if_data *sdata;\n" + "+\tint cnt = 0;\n" + " \n" + "-\tmutex_lock(&local->iflist_mtx);\n" + "+\tif (do_atomic) {\n" + "+\t\trcu_read_lock();\n" + " \n" + "-\tlist_for_each_entry(sdata, &local->interfaces, list) {\n" + "-\t\tswitch (sdata->vif.type) {\n" + "-\t\tcase NUM_NL80211_IFTYPES:\n" + "-\t\tcase NL80211_IFTYPE_UNSPECIFIED:\n" + "-\t\tcase NL80211_IFTYPE_MONITOR:\n" + "-\t\tcase NL80211_IFTYPE_AP_VLAN:\n" + "-\t\t\tcontinue;\n" + "-\t\tcase NL80211_IFTYPE_AP:\n" + "-\t\tcase NL80211_IFTYPE_STATION:\n" + "-\t\tcase NL80211_IFTYPE_ADHOC:\n" + "-\t\tcase NL80211_IFTYPE_WDS:\n" + "-\t\tcase NL80211_IFTYPE_MESH_POINT:\n" + "-\t\t\tbreak;\n" + "+\t\tlist_for_each_entry_rcu(sdata, &local->interfaces, list) {\n" + "+\t\t\tcnt += _iter_loop_helper(sdata, active_only,\n" + "+\t\t\t\t\t\t iterator, data);\n" + " \t\t}\n" + "-\t\tif (ieee80211_sdata_running(sdata))\n" + "-\t\t\titerator(data, sdata->vif.addr,\n" + "-\t\t\t\t &sdata->vif);\n" + "+\t\trcu_read_unlock();\n" + "+\t} else {\n" + "+\t\tmutex_lock(&local->iflist_mtx);\n" + "+\t\tlist_for_each_entry(sdata, &local->interfaces, list) {\n" + "+\t\t\tcnt += _iter_loop_helper(sdata, active_only,\n" + "+\t\t\t\t\t\t iterator, data);\n" + "+\t\t}\n" + "+\t\tmutex_unlock(&local->iflist_mtx);\n" + " \t}\n" + "+\treturn cnt;\n" + "+}\n" + "+EXPORT_SYMBOL_GPL(ieee80211_iterate_interfaces_helper);\n" + "+\n" + " \n" + "-\tmutex_unlock(&local->iflist_mtx);\n" + "+void ieee80211_iterate_active_interfaces(\n" + "+\tstruct ieee80211_hw *hw,\n" + "+\tvoid (*iterator)(void *data, u8 *mac,\n" + "+\t\t\t struct ieee80211_vif *vif),\n" + "+\tvoid *data)\n" + "+{\n" + "+\tieee80211_iterate_interfaces_helper(hw, false, false, iterator, data);\n" + " }\n" + " EXPORT_SYMBOL_GPL(ieee80211_iterate_active_interfaces);\n" + " \n" + "@@ -501,33 +539,20 @@ void ieee80211_iterate_active_interfaces_atomic(\n" + " \t\t\t struct ieee80211_vif *vif),\n" + " \tvoid *data)\n" + " {\n" + "-\tstruct ieee80211_local *local = hw_to_local(hw);\n" + "-\tstruct ieee80211_sub_if_data *sdata;\n" + "+\tieee80211_iterate_interfaces_helper(hw, true, false, iterator, data);\n" + "+}\n" + "+EXPORT_SYMBOL_GPL(ieee80211_iterate_active_interfaces_atomic);\n" + " \n" + "-\trcu_read_lock();\n" + " \n" + "-\tlist_for_each_entry_rcu(sdata, &local->interfaces, list) {\n" + "-\t\tswitch (sdata->vif.type) {\n" + "-\t\tcase NUM_NL80211_IFTYPES:\n" + "-\t\tcase NL80211_IFTYPE_UNSPECIFIED:\n" + "-\t\tcase NL80211_IFTYPE_MONITOR:\n" + "-\t\tcase NL80211_IFTYPE_AP_VLAN:\n" + "-\t\t\tcontinue;\n" + "-\t\tcase NL80211_IFTYPE_AP:\n" + "-\t\tcase NL80211_IFTYPE_STATION:\n" + "-\t\tcase NL80211_IFTYPE_ADHOC:\n" + "-\t\tcase NL80211_IFTYPE_WDS:\n" + "-\t\tcase NL80211_IFTYPE_MESH_POINT:\n" + "-\t\t\tbreak;\n" + "-\t\t}\n" + "-\t\tif (ieee80211_sdata_running(sdata))\n" + "-\t\t\titerator(data, sdata->vif.addr,\n" + "-\t\t\t\t &sdata->vif);\n" + "-\t}\n" + " \n" + "-\trcu_read_unlock();\n" + "+/** Return a count of all station-like interfaces for\n" + "+ * this hardware. Running/Stopped state has no affect.\n" + "+ */\n" + "+int ieee80211_count_sta_atomic(struct ieee80211_hw *hw)\n" + "+{\n" + "+\treturn ieee80211_iterate_interfaces_helper(hw, true, false, NULL, NULL);\n" + " }\n" + "-EXPORT_SYMBOL_GPL(ieee80211_iterate_active_interfaces_atomic);\n" + "+EXPORT_SYMBOL_GPL(ieee80211_count_sta_atomic);\n" + " \n" + " /*\n" + * Nothing should have been stuffed into the workqueue during -21dcf19e0675175cee627657cc0197892bc47425ef96d2d98b526f4ac3d70669 +b74724face7c1181909a26522c96a8c7970f8c847af94cbd324e86566e168036
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.