nl80211: rename csa counter attributes countdown counters
Subsystems (9)
PATCH v4 1/5 nl80211: rename csa counter attributes countdown counters
We want to reuse the attributes for other counters such as BSS color change. Rename them to more generic names.
--- include/uapi/linux/nl80211.h | 14 ++++++++------ net/wireless/nl80211.c | 16 ++++++++-------- 2 files changed, 16 insertions(+), 14 deletions(-)
include/uapi/linux/nl80211.h +8 -6
@@ -2082,10 +2082,10 @@ enum nl80211_commands {* operation). * @NL80211_ATTR_CSA_IES: Nested set of attributes containing the IE information * for the time while performing a channel switch. -* @NL80211_ATTR_CSA_C_OFF_BEACON: An array of offsets (u16) to the channel -* switch counters in the beacons tail (%NL80211_ATTR_BEACON_TAIL). -* @NL80211_ATTR_CSA_C_OFF_PRESP: An array of offsets (u16) to the channel -* switch counters in the probe response (%NL80211_ATTR_PROBE_RESP). +* @NL80211_ATTR_CNTDWN_OFFS_BEACON: An array of offsets (u16) to the channel +* switch or color change counters in the beacons tail (%NL80211_ATTR_BEACON_TAIL). +* @NL80211_ATTR_CNTDWN_OFFS_PRESP: An array of offsets (u16) to the channel +* switch or color change counters in the probe response (%NL80211_ATTR_PROBE_RESP). * * @NL80211_ATTR_RXMGMT_FLAGS: flags for nl80211_send_mgmt(), u32. * As specified in the &enum nl80211_rxmgmt_flags.
@@ -2821,8 +2821,8 @@ enum nl80211_attrs {NL80211_ATTR_CH_SWITCH_COUNT ,NL80211_ATTR_CH_SWITCH_BLOCK_TX ,NL80211_ATTR_CSA_IES , -NL80211_ATTR_CSA_C_OFF_BEACON , -NL80211_ATTR_CSA_C_OFF_PRESP , +NL80211_ATTR_CNTDWN_OFFS_BEACON , +NL80211_ATTR_CNTDWN_OFFS_PRESP , NL80211_ATTR_RXMGMT_FLAGS,
@@ -3009,6 +3009,8 @@ enum nl80211_attrs {#define NL80211_ATTR_MESH_PARAMS NL80211_ATTR_MESH_CONFIG#define NL80211_ATTR_IFACE_SOCKET_OWNER NL80211_ATTR_SOCKET_OWNER#define NL80211_ATTR_SAE_DATA NL80211_ATTR_AUTH_DATA +#define NL80211_ATTR_CSA_C_OFF_BEACON NL80211_ATTR_CNTDWN_OFFS_BEACON +#define NL80211_ATTR_CSA_C_OFF_PRESP NL80211_ATTR_CNTDWN_OFFS_PRESP/* * Allow user space programs to use #ifdef on new attributes by defining them
net/wireless/nl80211.c +8 -8
@@ -567,8 +567,8 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { [NL80211_ATTR_CH_SWITCH_COUNT] = { .type = NLA_U32 }, [NL80211_ATTR_CH_SWITCH_BLOCK_TX] = { .type = NLA_FLAG }, [NL80211_ATTR_CSA_IES] = { .type = NLA_NESTED }, - [NL80211_ATTR_CSA_C_OFF_BEACON] = { .type = NLA_BINARY }, - [NL80211_ATTR_CSA_C_OFF_PRESP] = { .type = NLA_BINARY }, + [NL80211_ATTR_CNTDWN_OFFS_BEACON] = { .type = NLA_BINARY }, + [NL80211_ATTR_CNTDWN_OFFS_PRESP] = { .type = NLA_BINARY }, [NL80211_ATTR_STA_SUPPORTED_CHANNELS] = { .type = NLA_BINARY }, [NL80211_ATTR_STA_SUPPORTED_OPER_CLASSES] = { .type = NLA_BINARY }, [NL80211_ATTR_HANDLE_DFS] = { .type = NLA_FLAG },
@@ -8787,10 +8787,10 @@ static int nl80211_channel_switch(struct sk_buff *skb, struct genl_info *info)if (err)return err; -if (!csa_attrs[NL80211_ATTR_CSA_C_OFF_BEACON ]) +if (!csa_attrs[NL80211_ATTR_CNTDWN_OFFS_BEACON ])return -EINVAL ; - len =nla_len (csa_attrs[NL80211_ATTR_CSA_C_OFF_BEACON ]); + len =nla_len (csa_attrs[NL80211_ATTR_CNTDWN_OFFS_BEACON ]);if (!len || (len %sizeof (u16)))return -EINVAL ;
@@ -8801,7 +8801,7 @@ static int nl80211_channel_switch(struct sk_buff *skb, struct genl_info *info)return -EINVAL ; params.counter_offsets_beacon = -nla_data (csa_attrs[NL80211_ATTR_CSA_C_OFF_BEACON ]); +nla_data (csa_attrs[NL80211_ATTR_CNTDWN_OFFS_BEACON ]);/* sanity checks - counters should fit and be the same */ for (i =0 ; i < params.n_counter_offsets_beacon; i++) {
@@ -8814,8 +8814,8 @@ static int nl80211_channel_switch(struct sk_buff *skb, struct genl_info *info)return -EINVAL ; } -if (csa_attrs[NL80211_ATTR_CSA_C_OFF_PRESP ]) { - len =nla_len (csa_attrs[NL80211_ATTR_CSA_C_OFF_PRESP ]); +if (csa_attrs[NL80211_ATTR_CNTDWN_OFFS_PRESP ]) { + len =nla_len (csa_attrs[NL80211_ATTR_CNTDWN_OFFS_PRESP ]);if (!len || (len %sizeof (u16)))return -EINVAL ;
@@ -8826,7 +8826,7 @@ static int nl80211_channel_switch(struct sk_buff *skb, struct genl_info *info)return -EINVAL ; params.counter_offsets_presp = -nla_data (csa_attrs[NL80211_ATTR_CSA_C_OFF_PRESP ]); +nla_data (csa_attrs[NL80211_ATTR_CNTDWN_OFFS_PRESP ]);/* sanity checks - counters should fit and be the same */ for (i =0 ; i < params.n_counter_offsets_presp; i++) {
Signature · 7 lines
2.25.1 -- ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH v4 2/5 mac80211: rename csa counters to countdown counters
We want to reuse the functions and structs for other counters such as BSS color change. Rename them to more generic names.
--- drivers/net/wireless/ath/ath10k/mac.c | 4 +- drivers/net/wireless/ath/ath10k/wmi.c | 2 +- drivers/net/wireless/ath/ath11k/wmi.c | 4 +- drivers/net/wireless/ath/ath9k/beacon.c | 2 +- .../net/wireless/ath/ath9k/htc_drv_beacon.c | 2 +- .../net/wireless/intel/iwlwifi/mvm/mac-ctxt.c | 6 +- .../wireless/intel/iwlwifi/mvm/time-event.c | 2 +- drivers/net/wireless/mac80211_hwsim.c | 2 +- drivers/net/wireless/mediatek/mt76/mac80211.c | 4 +- .../net/wireless/mediatek/mt76/mt7615/mcu.c | 10 +-- .../net/wireless/mediatek/mt76/mt7915/mcu.c | 8 +- include/net/mac80211.h | 35 +++++---- net/mac80211/cfg.c | 14 ++-- net/mac80211/ibss.c | 4 +- net/mac80211/ieee80211_i.h | 6 +- net/mac80211/main.c | 2 +- net/mac80211/mesh.c | 4 +- net/mac80211/offchannel.c | 2 +- net/mac80211/tx.c | 73 ++++++++++--------- 19 files changed, 93 insertions(+), 93 deletions(-)
drivers/net/wireless/ath/ath10k/mac.c +2 -2
@@ -2019,8 +2019,8 @@ static void ath10k_mac_vif_ap_csa_count_down(struct ath10k_vif *arvif)if (!arvif->is_up)return ; -if (!ieee80211_csa_is_complete (vif)) { -ieee80211_csa_update_counter (vif); +if (!ieee80211_beacon_cntdwn_is_complete (vif)) { +ieee80211_beacon_update_cntdwn (vif); ret =ath10k_mac_setup_bcn_tmpl (arvif);if (ret)
drivers/net/wireless/ath/ath10k/wmi.c +1 -1
@@ -3878,7 +3878,7 @@ void ath10k_wmi_event_host_swba(struct ath10k *ar, struct sk_buff *skb)* actual channel switch is done */ if (arvif->vif->csa_active && -ieee80211_csa_is_complete (arvif->vif)) { +ieee80211_beacon_cntdwn_is_complete (arvif->vif)) {ieee80211_csa_finish (arvif->vif);continue ; }
drivers/net/wireless/ath/ath11k/wmi.c +2 -2
@@ -1593,8 +1593,8 @@ int ath11k_wmi_bcn_tmpl(struct ath11k *ar, u32 vdev_id,FIELD_PREP (WMI_TLV_LEN ,sizeof (*cmd) -TLV_HDR_SIZE ); cmd->vdev_id = vdev_id; cmd->tim_ie_offset = offs->tim_offset; - cmd->csa_switch_count_offset = offs->csa_counter_offs[0 ]; - cmd->ext_csa_switch_count_offset = offs->csa_counter_offs[1 ]; + cmd->csa_switch_count_offset = offs->cntdwn_counter_offs[0 ]; + cmd->ext_csa_switch_count_offset = offs->cntdwn_counter_offs[1 ]; cmd->buf_len = bcn->len; ptr = skb->data +sizeof (*cmd);
drivers/net/wireless/ath/ath9k/beacon.c +1 -1
@@ -365,7 +365,7 @@ bool ath9k_csa_is_finished(struct ath_softc *sc, struct ieee80211_vif *vif)if (!vif || !vif->csa_active)return false; -if (!ieee80211_csa_is_complete (vif)) +if (!ieee80211_beacon_cntdwn_is_complete (vif))return false;ieee80211_csa_finish (vif);
drivers/net/wireless/ath/ath9k/htc_drv_beacon.c +1 -1
@@ -514,7 +514,7 @@ bool ath9k_htc_csa_is_finished(struct ath9k_htc_priv *priv)if (!vif || !vif->csa_active)return false; -if (!ieee80211_csa_is_complete (vif)) +if (!ieee80211_beacon_cntdwn_is_complete (vif))return false;ieee80211_csa_finish (vif);
drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c +3 -3
@@ -1300,8 +1300,8 @@ static void iwl_mvm_csa_count_down(struct iwl_mvm *mvm, mvmvif->csa_countdown = true; -if (!ieee80211_csa_is_complete (csa_vif)) { -int c =ieee80211_csa_update_counter (csa_vif); +if (!ieee80211_beacon_cntdwn_is_complete (csa_vif)) { +int c =ieee80211_beacon_update_cntdwn (csa_vif);iwl_mvm_mac_ctxt_beacon_changed (mvm, csa_vif); if (csa_vif->p2p &&
@@ -1543,7 +1543,7 @@ void iwl_mvm_probe_resp_data_notif(struct iwl_mvm *mvm,if (notif->csa_counter !=IWL_PROBE_RESP_DATA_NO_CSA && notif->csa_counter >=1 ) -ieee80211_csa_set_counter (vif, notif->csa_counter); +ieee80211_beacon_set_cntdwn (vif, notif->csa_counter); } void iwl_mvm_channel_switch_noa_notif(struct iwl_mvm *mvm,
drivers/net/wireless/intel/iwlwifi/mvm/time-event.c +1 -1
@@ -172,7 +172,7 @@ static void iwl_mvm_csa_noa_start(struct iwl_mvm *mvm)* So we just do nothing here and the switch * will be performed on the last TBTT. */ -if (!ieee80211_csa_is_complete (csa_vif)) { +if (!ieee80211_beacon_cntdwn_is_complete (csa_vif)) {IWL_WARN (mvm,"CSA NOA started too early\n" ); goto out_unlock; }
drivers/net/wireless/mac80211_hwsim.c +1 -1
@@ -1699,7 +1699,7 @@ static void mac80211_hwsim_beacon_tx(void *arg, u8 *mac, rcu_dereference(vif->chanctx_conf)->def.chan); } -if (vif->csa_active &&ieee80211_csa_is_complete (vif)) +if (vif->csa_active &&ieee80211_beacon_cntdwn_is_complete (vif))ieee80211_csa_finish (vif); }
drivers/net/wireless/mediatek/mt76/mac80211.c +2 -2
@@ -1095,7 +1095,7 @@ EXPORT_SYMBOL_GPL(mt76_get_txpower);static void __mt76_csa_finish (void *priv,u8 *mac,struct ieee80211_vif *vif) { -if (vif->csa_active &&ieee80211_csa_is_complete (vif)) +if (vif->csa_active &&ieee80211_beacon_cntdwn_is_complete (vif))ieee80211_csa_finish (vif); }
@@ -1120,7 +1120,7 @@ __mt76_csa_check(void *priv, u8 *mac, struct ieee80211_vif *vif)if (!vif->csa_active)return ; - dev->csa_complete |=ieee80211_csa_is_complete (vif); + dev->csa_complete |=ieee80211_beacon_cntdwn_is_complete (vif); }void mt76_csa_check (struct mt76_dev *dev)
drivers/net/wireless/mediatek/mt76/mt7615/mcu.c +5 -5
@@ -650,12 +650,12 @@ mt7615_mcu_add_beacon_offload(struct mt7615_dev *dev,memcpy (req.pkt +MT_TXD_SIZE , skb->data, skb->len); req.pkt_len =cpu_to_le16 (MT_TXD_SIZE + skb->len); req.tim_ie_pos =cpu_to_le16 (MT_TXD_SIZE + offs.tim_offset); -if (offs.csa_counter_offs[0 ]) { +if (offs.cntdwn_counter_offs[0 ]) {u16 csa_offs; - csa_offs =MT_TXD_SIZE + offs.csa_counter_offs[0 ] -4 ; + csa_offs =MT_TXD_SIZE + offs.cntdwn_counter_offs[0 ] -4 ; req.csa_ie_pos =cpu_to_le16 (csa_offs); - req.csa_cnt = skb->data[offs.csa_counter_offs[0 ]]; + req.csa_cnt = skb->data[offs.cntdwn_counter_offs[0 ]]; }dev_kfree_skb (skb);
@@ -1713,10 +1713,10 @@ mt7615_mcu_uni_add_beacon_offload(struct mt7615_dev *dev, req.beacon_tlv.pkt_len =cpu_to_le16 (MT_TXD_SIZE + skb->len); req.beacon_tlv.tim_ie_pos =cpu_to_le16 (MT_TXD_SIZE + offs.tim_offset); -if (offs.csa_counter_offs[0 ]) { +if (offs.cntdwn_counter_offs[0 ]) {u16 csa_offs; - csa_offs =MT_TXD_SIZE + offs.csa_counter_offs[0 ] -4 ; + csa_offs =MT_TXD_SIZE + offs.cntdwn_counter_offs[0 ] -4 ; req.beacon_tlv.csa_ie_pos =cpu_to_le16 (csa_offs); }dev_kfree_skb (skb);
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c +4 -4
@@ -2282,7 +2282,7 @@ mt7915_mcu_beacon_csa(struct sk_buff *rskb, struct sk_buff *skb, struct bss_info_bcn *bcn, struct ieee80211_mutable_offsets *offs) { -if (offs->csa_counter_offs[0 ]) { +if (offs->cntdwn_counter_offs[0 ]) {struct tlv *tlv;struct bss_info_bcn_csa *csa;
@@ -2290,7 +2290,7 @@ mt7915_mcu_beacon_csa(struct sk_buff *rskb, struct sk_buff *skb,sizeof (*csa), &bcn->sub_ntlv, &bcn->len); csa = (struct bss_info_bcn_csa *)tlv; - csa->cnt = skb->data[offs->csa_counter_offs[0 ]]; + csa->cnt = skb->data[offs->cntdwn_counter_offs[0 ]]; } }
@@ -2312,8 +2312,8 @@ mt7915_mcu_beacon_cont(struct mt7915_dev *dev, struct sk_buff *rskb, cont->pkt_len =cpu_to_le16 (MT_TXD_SIZE + skb->len); cont->tim_ofs =cpu_to_le16 (offs->tim_offset); -if (offs->csa_counter_offs[0 ]) - cont->csa_ofs =cpu_to_le16 (offs->csa_counter_offs[0 ] -4 ); +if (offs->cntdwn_counter_offs[0 ]) + cont->csa_ofs =cpu_to_le16 (offs->cntdwn_counter_offs[0 ] -4 ); buf = (u8 *)tlv +sizeof (*cont); mt7915_mac_write_txwi(dev, (__le32 *)buf, skb, wcid, NULL,
include/net/mac80211.h +17 -18
@@ -3736,7 +3736,7 @@ enum ieee80211_reconfig_type {* decremented, and when they reach 1 the driver must call * ieee80211_csa_finish(). Drivers which use ieee80211_beacon_get() * get the csa counter decremented by mac80211, but must check if it is -* 1 using ieee80211_csa_is_complete() after the beacon has been +* 1 using ieee80211_beacon_counter_is_complete() after the beacon has been * transmitted and then call ieee80211_csa_finish(). * If the CSA count starts as zero or 1, this function will not be called, * since there won't be any time to beacon before the switch anyway.
@@ -4763,21 +4763,21 @@ void ieee80211_tx_status_8023(struct ieee80211_hw *hw,*/ void ieee80211_report_low_ack (struct ieee80211_sta *sta,u32 num_packets); -#define IEEE80211_MAX_CSA_COUNTERS_NUM 2 +#define IEEE80211_MAX_CNTDWN_COUNTERS_NUM 2/** * struct ieee80211_mutable_offsets - mutable beacon offsets * @tim_offset: position of TIM element * @tim_length: size of TIM element -* @csa_counter_offs: array of IEEE80211_MAX_CSA_COUNTERS_NUM offsets -* to CSA counters. This array can contain zero values which +* @cntdwn_counter_offs: array of IEEE80211_MAX_CNTDWN_COUNTERS_NUM offsets +* to countdown counters. This array can contain zero values which * should be ignored. */ struct ieee80211_mutable_offsets {u16 tim_offset;u16 tim_length; -u16 csa_counter_offs[IEEE80211_MAX_CSA_COUNTERS_NUM ]; +u16 cntdwn_counter_offs[IEEE80211_MAX_CNTDWN_COUNTERS_NUM ]; };/**
@@ -4846,31 +4846,31 @@ static inline struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw, }/** -* ieee80211_csa_update_counter - request mac80211 to decrement the csa counter +* ieee80211_beacon_update_cntdwn - request mac80211 to decrement the beacon countdown * @vif: &struct ieee80211_vif pointer from the add_interface callback. * -* The csa counter should be updated after each beacon transmission. +* The beacon counter should be updated after each beacon transmission. * This function is called implicitly when * ieee80211_beacon_get/ieee80211_beacon_get_tim are called, however if the * beacon frames are generated by the device, the driver should call this -* function after each beacon transmission to sync mac80211's csa counters. +* function after each beacon transmission to sync mac80211's beacon countdown. * -* Return: new csa counter value +* Return: new countdown value */ -u8 ieee80211_csa_update_counter (struct ieee80211_vif *vif); +u8 ieee80211_beacon_update_cntdwn (struct ieee80211_vif *vif);/** -* ieee80211_csa_set_counter - request mac80211 to set csa counter +* ieee80211_beacon_set_cntdwn - request mac80211 to set beacon countdown * @vif: &struct ieee80211_vif pointer from the add_interface callback. * @counter: the new value for the counter * -* The csa counter can be changed by the device, this API should be +* The beacon countdown can be changed by the device, this API should be * used by the device driver to update csa counter in mac80211. * -* It should never be used together with ieee80211_csa_update_counter(), +* It should never be used together with ieee80211_beacon_update_cntdwn(), * as it will cause a race condition around the counter value. */ -void ieee80211_csa_set_counter (struct ieee80211_vif *vif,u8 counter); +void ieee80211_beacon_set_cntdwn (struct ieee80211_vif *vif,u8 counter);/** * ieee80211_csa_finish - notify mac80211 about channel switch
@@ -4883,13 +4883,12 @@ void ieee80211_csa_set_counter(struct ieee80211_vif *vif, u8 counter);void ieee80211_csa_finish (struct ieee80211_vif *vif);/** -* ieee80211_csa_is_complete - find out if counters reached 1 +* ieee80211_beacon_cntdwn_is_complete - find out if countdown reached 1 * @vif: &struct ieee80211_vif pointer from the add_interface callback. * -* This function returns whether the channel switch counters reached zero. +* This function returns whether the countdown reached zero. */ -bool ieee80211_csa_is_complete (struct ieee80211_vif *vif); - +bool ieee80211_beacon_cntdwn_is_complete (struct ieee80211_vif *vif);/** * ieee80211_proberesp_get - retrieve a Probe Response template
net/mac80211/cfg.c +7 -7
@@ -826,9 +826,9 @@ static int ieee80211_set_probe_resp(struct ieee80211_sub_if_data *sdata,memcpy (new->data, resp, resp_len);if (csa) -memcpy (new->csa_counter_offsets, csa->counter_offsets_presp, +memcpy (new->cntdwn_counter_offsets, csa->counter_offsets_presp, csa->n_counter_offsets_presp * -sizeof (new->csa_counter_offsets[0 ])); +sizeof (new->cntdwn_counter_offsets[0 ]));rcu_assign_pointer (sdata->u.ap.probe_resp, new);if (old)
@@ -926,10 +926,10 @@ static int ieee80211_assign_beacon(struct ieee80211_sub_if_data *sdata, new->tail_len = new_tail_len;if (csa) { - new->csa_current_counter = csa->count; -memcpy (new->csa_counter_offsets, csa->counter_offsets_beacon, + new->cntdwn_current_counter = csa->count; +memcpy (new->cntdwn_counter_offsets, csa->counter_offsets_beacon, csa->n_counter_offsets_beacon * -sizeof (new->csa_counter_offsets[0 ])); +sizeof (new->cntdwn_counter_offsets[0 ])); }/* copy in head */
@@ -3186,9 +3186,9 @@ static int ieee80211_set_csa_beacon(struct ieee80211_sub_if_data *sdata,break ;if ((params->n_counter_offsets_beacon > -IEEE80211_MAX_CSA_COUNTERS_NUM ) || +IEEE80211_MAX_CNTDWN_COUNTERS_NUM ) || (params->n_counter_offsets_presp > -IEEE80211_MAX_CSA_COUNTERS_NUM )) +IEEE80211_MAX_CNTDWN_COUNTERS_NUM ))return -EINVAL ; csa.counter_offsets_beacon = params->counter_offsets_beacon;
net/mac80211/ibss.c +2 -2
@@ -145,9 +145,9 @@ ieee80211_ibss_build_presp(struct ieee80211_sub_if_data *sdata, *pos++ = csa_settings->block_tx ?1 :0 ; *pos++ =ieee80211_frequency_to_channel ( csa_settings->chandef.chan->center_freq); - presp->csa_counter_offsets[0 ] = (pos - presp->head); + presp->cntdwn_counter_offsets[0 ] = (pos - presp->head); *pos++ = csa_settings->count; - presp->csa_current_counter = csa_settings->count; + presp->cntdwn_current_counter = csa_settings->count; }/* put the remaining rates in WLAN_EID_EXT_SUPP_RATES */
net/mac80211/ieee80211_i.h +3 -3
@@ -259,15 +259,15 @@ struct beacon_data {u8 *head, *tail;int head_len, tail_len;struct ieee80211_meshconf_ie *meshconf; -u16 csa_counter_offsets[IEEE80211_MAX_CSA_COUNTERS_NUM ]; -u8 csa_current_counter; +u16 cntdwn_counter_offsets[IEEE80211_MAX_CNTDWN_COUNTERS_NUM ]; +u8 cntdwn_current_counter;struct rcu_head rcu_head; };struct probe_resp {struct rcu_head rcu_head;int len; -u16 csa_counter_offsets[IEEE80211_MAX_CSA_COUNTERS_NUM ]; +u16 cntdwn_counter_offsets[IEEE80211_MAX_CNTDWN_COUNTERS_NUM ];u8 data[]; };
net/mac80211/main.c +1 -1
@@ -1168,7 +1168,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)WLAN_EXT_CAPA3_MULTI_BSSID_SUPPORT ; } - local->hw.wiphy->max_num_csa_counters =IEEE80211_MAX_CSA_COUNTERS_NUM ; + local->hw.wiphy->max_num_csa_counters =IEEE80211_MAX_CNTDWN_COUNTERS_NUM ;/* * We use the number of queues for feature tests (QoS, HT) internally
net/mac80211/mesh.c +2 -2
@@ -864,8 +864,8 @@ ieee80211_mesh_build_beacon(struct ieee80211_if_mesh *ifmsh) *pos++ =0x0 ; *pos++ =ieee80211_frequency_to_channel ( csa->settings.chandef.chan->center_freq); - bcn->csa_current_counter = csa->settings.count; - bcn->csa_counter_offsets[0 ] = hdr_len +6 ; + bcn->cntdwn_current_counter = csa->settings.count; + bcn->cntdwn_counter_offsets[0 ] = hdr_len +6 ; *pos++ = csa->settings.count; *pos++ =WLAN_EID_CHAN_SWITCH_PARAM ; *pos++ =6 ;
net/mac80211/offchannel.c +1 -1
@@ -916,7 +916,7 @@ int ieee80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,if (beacon)for (i =0 ; i < params->n_csa_offsets; i++) data[params->csa_offsets[i]] = - beacon->csa_current_counter; + beacon->cntdwn_current_counter;rcu_read_unlock (); }
net/mac80211/tx.c +37 -36
188 lines not on this page · raw message
Signature · 7 lines
2.25.1 -- ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH v4 3/5 nl80211: add support for BSS coloring
In reply to John CrispinThis patch adds support for BSS color collisions to the wireless subsystem. Add the required functionality to nl80211 that will notify about color collisions, triggering the color change and notifying when it is completed.
--- include/net/cfg80211.h | 65 ++++++++++++++ include/uapi/linux/nl80211.h | 42 +++++++++ net/wireless/nl80211.c | 162 +++++++++++++++++++++++++++++++++++ net/wireless/rdev-ops.h | 12 +++ net/wireless/trace.h | 60 +++++++++++++ 5 files changed, 341 insertions(+)
include/net/cfg80211.h +65 -0
@@ -1172,6 +1172,27 @@ struct cfg80211_csa_settings {u8 count; }; +/** +* struct cfg80211_color_change_settings - color change settings +* +* Used for color change +* +* @beacon_cca: beacon data while performing the change +* @counter_offsets_beacon: offsets of the counters within the beacon (tail) +* @counter_offsets_presp: offsets of the counters within the probe response +* @beacon_after: beacon data to be used after the change +* @count: number of beacons until the change +* @color: the color that we will have after the change +*/ +struct cfg80211_color_change_settings { +struct cfg80211_beacon_data beacon_cca; +u16 counter_offset_beacon; +u16 counter_offset_presp; +struct cfg80211_beacon_data beacon_after; +u8 count; +u8 color; +}; +#define CFG80211_MAX_NUM_DIFFERENT_CHANNELS 10/**
@@ -3822,6 +3843,7 @@ struct mgmt_frame_regs {* This callback may sleep. * @reset_tid_config: Reset TID specific configuration for the peer, for the * given TIDs. This callback may sleep. +* @color_change: initiate a color change (with CCA). */ struct cfg80211_ops {int (*suspend)(struct wiphy *wiphy,struct cfg80211_wowlan *wow);
@@ -4150,6 +4172,9 @@ struct cfg80211_ops { struct cfg80211_tid_config *tid_conf);int (*reset_tid_config)(struct wiphy *wiphy,struct net_device *dev,const u8 *peer,u8 tids); +int (*color_change)(struct wiphy *wiphy, +struct net_device *dev, +struct cfg80211_color_change_settings *params); };/*
@@ -4199,6 +4224,7 @@ struct cfg80211_ops {* @WIPHY_FLAG_HAS_STATIC_WEP: The device supports static WEP key installation * before connection. * @WIPHY_FLAG_SUPPORTS_EXT_KEK_KCK: The device supports bigger kek and kck keys +* @WIPHY_FLAG_SUPPORTS_BSS_COLOR: Device supports BSS coloring */ enum wiphy_flags {WIPHY_FLAG_SUPPORTS_EXT_KEK_KCK =BIT (0 ),
@@ -4225,6 +4251,7 @@ enum wiphy_flags {WIPHY_FLAG_SUPPORTS_5_10_MHZ =BIT (22 ),WIPHY_FLAG_HAS_CHANNEL_SWITCH =BIT (23 ),WIPHY_FLAG_HAS_STATIC_WEP =BIT (24 ), + WIPHY_FLAG_SUPPORTS_BSS_COLOR = BIT(25), };/**
@@ -7915,4 +7942,42 @@ void cfg80211_update_owe_info_event(struct net_device *netdev,*/ void cfg80211_bss_flush (struct wiphy *wiphy); + +/* +* cfg80211_obss_color_collision_notify - notify about bss color collisions +* @dev: network device +* @color_bitmap: representations of the colors that the local BSS is aware of +*/ +void cfg80211_obss_color_collision_notify (struct net_device *dev, +u64 color_bitmap); + +/* +* cfg80211_color_change_started_notify - notify color change start +* @dev: the device on which the color is switched +* @count: the number of TBTTs until the color change happens +* +* Inform the userspace about the color change that has just +* started. +*/ +void cfg80211_color_change_started_notify (struct net_device *dev, +u8 count); + +/* +* cfg80211_color_change_aborted_notify - notify color change abort +* @dev: the device on which the color is switched +* +* Inform the userspace about the color change that has just +* started. +*/ +void cfg80211_color_change_aborted_notify (struct net_device *dev); + +/* +* cfg80211_color_change_notify - notify color change completion +* @dev: the device on which the color was switched +* +* Inform the userspace about the color change that has just +* completed. +*/ +void cfg80211_color_change_notify (struct net_device *dev); +#endif /* __NET_CFG80211_H */
include/uapi/linux/nl80211.h +42 -0
66 lines not on this page · raw message
net/wireless/nl80211.c +162 -0
186 lines not on this page · raw message
net/wireless/rdev-ops.h +12 -0
@@ -1356,4 +1356,16 @@ static inline int rdev_reset_tid_config(struct cfg80211_registered_device *rdev, return ret; } +static inline int rdev_color_change (struct cfg80211_registered_device *rdev, +struct net_device *dev, +struct cfg80211_color_change_settings *params) +{ +int ret; + +trace_rdev_color_change (&rdev->wiphy, dev, params); + ret = rdev->ops->color_change (&rdev->wiphy, dev, params); +trace_rdev_return_int (&rdev->wiphy, ret); +return ret; +} +#endif /* __CFG80211_RDEV_OPS */
net/wireless/trace.h +60 -0
66 lines not on this page · raw message
Signature · 7 lines
2.25.1 -- ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH v4 4/5 mac80211: add support for BSS coloring
In reply to John CrispinThe CCA (color change announcement) is very similar to how CSA works where we have an IE that includes a counter. When the counter hits 0, the new color is applied via an updated beacon.
This patch makes the CSA counter functionality reusable, rather than implementing it again. This also allows for future reuse incase support for other counter IEs gets added.
--- include/net/mac80211.h | 28 +++++ net/mac80211/cfg.c | 227 +++++++++++++++++++++++++++++++++++-- net/mac80211/ieee80211_i.h | 12 ++ net/mac80211/iface.c | 3 + net/mac80211/tx.c | 24 ++-- 5 files changed, 276 insertions(+), 18 deletions(-)
include/net/mac80211.h +28 -0
@@ -1645,6 +1645,10 @@ enum ieee80211_vif_flags {* @txq: the multicast data TX queue (if driver uses the TXQ abstraction) * @txqs_stopped: per AC flag to indicate that intermediate TXQs are stopped, * protected by fq->lock. +* @cca_active: marks whether a color change is going on. Internally it is +* write-protected by sdata_lock and local->mtx so holding either is fine +* for read access. +* @cca_color: the color that we will have after the change. */ struct ieee80211_vif {enum nl80211_iftype type;
@@ -1672,6 +1676,9 @@ struct ieee80211_vif {bool txqs_stopped[IEEE80211_NUM_ACS ]; +bool cca_active; +u8 cca_color; +/* must be last */ u8 drv_priv[]__aligned(sizeof(void *)) ; };
@@ -4890,6 +4897,16 @@ void ieee80211_csa_finish(struct ieee80211_vif *vif);*/ bool ieee80211_beacon_cntdwn_is_complete (struct ieee80211_vif *vif); +/** +* ieee80211_cca_finish - notify mac80211 about color change +* @vif: &struct ieee80211_vif pointer from the add_interface callback. +* +* After a color change announcement was scheduled and the counter in this +* announcement hits 1, this function must be called by the driver to +* notify mac80211 that the color can be changed +*/ +void ieee80211_cca_finish (struct ieee80211_vif *vif); +/** * ieee80211_proberesp_get - retrieve a Probe Response template * @hw: pointer obtained from ieee80211_alloc_hw().
@@ -6593,4 +6610,15 @@ u32 ieee80211_calc_tx_airtime(struct ieee80211_hw *hw,*/ bool ieee80211_set_hw_80211_encap (struct ieee80211_vif *vif,bool enable); +/** +* ieeee80211_obss_color_collision_notify notify userland about a BSS color +* collision. +* +* @vif: &struct ieee80211_vif pointer from the add_interface callback. +* @color_bitmap: a 64 bit bitmap representing the colors that the local BSS is +* aware of. +*/ +void +ieeee80211_obss_color_collision_notify (struct ieee80211_vif *vif, +u64 color_bitmap);#endif /* MAC80211_H */
net/mac80211/cfg.c +218 -9
311 lines not on this page · raw message
net/mac80211/ieee80211_i.h +12 -0
@@ -255,6 +255,13 @@ struct ieee80211_csa_settings {u8 count; }; +struct ieee80211_cca_settings { +u16 counter_offset_beacon; +u16 counter_offset_presp; + +u8 count; +}; +struct beacon_data {u8 *head, *tail;int head_len, tail_len;
@@ -923,6 +930,8 @@ struct ieee80211_sub_if_data {bool csa_block_tx;/* write-protected by sdata_lock and local->mtx */ struct cfg80211_chan_def csa_chandef; +struct work_struct cca_finalize_work; +struct list_head assigned_chanctx_list;/* protected by chanctx_mtx */ struct list_head reserved_chanctx_list;/* protected by chanctx_mtx */
@@ -1737,6 +1746,9 @@ void ieee80211_csa_finalize_work(struct work_struct *work);int ieee80211_channel_switch (struct wiphy *wiphy,struct net_device *dev,struct cfg80211_csa_settings *params); +/* color change handling */ +void ieee80211_cca_finalize_work (struct work_struct *work); +/* interface handling */ #define MAC80211_SUPPORTED_FEATURES_TX (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | \ NETIF_F_HW_CSUM | NETIF_F_SG | \
net/mac80211/iface.c +3 -0
@@ -912,6 +912,8 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, GFP_KERNEL); } +cancel_work_sync (&sdata->cca_finalize_work); +/* APs need special treatment */ if (sdata->vif.type ==NL80211_IFTYPE_AP ) {struct ieee80211_sub_if_data *vlan, *tmpsdata;
@@ -1496,6 +1498,7 @@ static void ieee80211_setup_sdata(struct ieee80211_sub_if_data *sdata,INIT_WORK (&sdata->work, ieee80211_iface_work);INIT_WORK (&sdata->recalc_smps, ieee80211_recalc_smps_work);INIT_WORK (&sdata->csa_finalize_work, ieee80211_csa_finalize_work); +INIT_WORK (&sdata->cca_finalize_work, ieee80211_cca_finalize_work);INIT_LIST_HEAD (&sdata->assigned_chanctx_list);INIT_LIST_HEAD (&sdata->reserved_chanctx_list);
net/mac80211/tx.c +15 -9
@@ -4541,11 +4541,12 @@ static int ieee80211_beacon_add_tim(struct ieee80211_sub_if_data *sdata,static void ieee80211_set_beacon_cntdwn (struct ieee80211_sub_if_data *sdata,struct beacon_data *beacon) { +u16 *bcn_offsets, *resp_offsets;struct probe_resp *resp;u8 *beacon_data;size_t beacon_data_len;int i; -u8 count = beacon->cntdwn_current_counter; +u8 count, max_count =1 ;switch (sdata->vif.type) {case NL80211_IFTYPE_AP :
@@ -4565,21 +4566,25 @@ static void ieee80211_set_beacon_cntdwn(struct ieee80211_sub_if_data *sdata, }rcu_read_lock (); -for (i =0 ; i <IEEE80211_MAX_CNTDWN_COUNTERS_NUM ; ++i) { - resp =rcu_dereference (sdata->u.ap.probe_resp); + resp =rcu_dereference (sdata->u.ap.probe_resp); -if (beacon->cntdwn_counter_offsets[i]) { -if (WARN_ON_ONCE (beacon->cntdwn_counter_offsets[i] >= - beacon_data_len)) { + bcn_offsets = beacon->cntdwn_counter_offsets; + resp_offsets = resp->cntdwn_counter_offsets; + count = beacon->cntdwn_current_counter; +if (sdata->vif.csa_active) + max_count =IEEE80211_MAX_CNTDWN_COUNTERS_NUM ; + +for (i =0 ; i < max_count; ++i) { +if (bcn_offsets[i]) { +if (WARN_ON_ONCE (bcn_offsets[i] >= beacon_data_len)) {rcu_read_unlock ();return ; } - - beacon_data[beacon->cntdwn_counter_offsets[i]] = count; + beacon_data[bcn_offsets[i]] = count; }if (sdata->vif.type ==NL80211_IFTYPE_AP && resp) - resp->data[resp->cntdwn_counter_offsets[i]] = count; + resp->data[resp_offsets[i]] = count; }rcu_read_unlock (); }
@@ -4789,6 +4794,7 @@ __ieee80211_beacon_get(struct ieee80211_hw *hw,if (offs) { offs->tim_offset = beacon->head_len; offs->tim_length = skb->len - beacon->head_len; + offs->cntdwn_counter_offs[0 ] = beacon->cntdwn_counter_offsets[0 ];/* for AP the csa offsets are from tail */ csa_off_base = skb->len;
Signature · 7 lines
2.25.1 -- ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
Re: [PATCH V4 4/5] mac80211: add support for BSS coloring
Quoted 16 lines
The CCA (color change announcement) is very similar to how CSA works where we have an IE that includes a counter. When the counter hits 0, the new color is applied via an updated beacon.
This patch makes the CSA counter functionality reusable, rather than implementing it again. This also allows for future reuse incase support for other counter IEs gets added.
Signed-off-by John Crispin <[email protected]>--- include/net/mac80211.h | 28 +++++ net/mac80211/cfg.c | 227 +++++++++++++++++++++++++++++++++++-- net/mac80211/ieee80211_i.h | 12 ++ net/mac80211/iface.c | 3 + net/mac80211/tx.c | 24 ++-- 5 files changed, 276 insertions(+), 18 deletions(-)
...
Quoted 12 lines
net/mac80211/cfg.c +11
-0+static int ieee80211_cca_finalize (struct ieee80211_sub_if_data *sdata) +{ +struct ieee80211_local *local = sdata->local; +u32 changed =0 ; +int err; + +sdata_assert_lock (sdata); +lockdep_assert_held (&local->mtx); + + sdata->vif.cca_active = false; +
net/mac80211/cfg.c static int ieee80211_reset_tid_config(struct wiphy *wiphy, · line 4097
Quoted 10 lines
net/mac80211/cfg.c +10
-0+ err =ieee80211_set_after_cca_beacon (sdata, &changed); +if (err) { +cfg80211_color_change_aborted_notify (sdata->dev); +return err; + } + + sdata->vif.bss_conf.he_bss_color.color = sdata->vif.cca_color; + sdata->vif.bss_conf.he_bss_color.enabled =1 ; + changed |=BSS_CHANGED_HE_BSS_COLOR ; +
Why we are not updating the bss color information in he_oper.params.
IMHO remove the redundant information of bss color in the "struct ieee80211_bss_conf" by removing the he_bss_color since he_oper.params holds more information in u32 itself.
What do you think?
Quoted 74 lines
net/mac80211/cfg.c +66
-0+ieee80211_bss_info_change_notify (sdata, changed); + +cfg80211_color_change_notify (sdata->dev); + +return 0 ; +} + +void ieee80211_cca_finalize_work (struct work_struct *work) +{ +struct ieee80211_sub_if_data *sdata = + container_of(work, struct ieee80211_sub_if_data, + cca_finalize_work); +struct ieee80211_local *local = sdata->local; + +sdata_lock (sdata); +mutex_lock (&local->mtx); + +/* AP might have been stopped while waiting for the lock. */ +if (!sdata->vif.cca_active) + goto unlock; + +if (!ieee80211_sdata_running (sdata)) + goto unlock; + +ieee80211_cca_finalize (sdata); + +unlock: +mutex_unlock (&local->mtx); +sdata_unlock (sdata); +} + +void ieee80211_cca_finish (struct ieee80211_vif *vif) +{ +struct ieee80211_sub_if_data *sdata =vif_to_sdata (vif); + +ieee80211_queue_work (&sdata->local->hw, + &sdata->cca_finalize_work); +} +EXPORT_SYMBOL_GPL (ieee80211_cca_finish); + +void +ieeee80211_obss_color_collision_notify (struct ieee80211_vif *vif, +u64 color_bitmap) +{ +struct ieee80211_sub_if_data *sdata =vif_to_sdata (vif); + +if (sdata->vif.cca_active || sdata->vif.csa_active) +return ; + +cfg80211_obss_color_collision_notify (sdata->dev, color_bitmap); +} +EXPORT_SYMBOL_GPL (ieeee80211_obss_color_collision_notify); + +static int +__ieee80211_color_change (struct wiphy *wiphy,struct net_device *dev, +struct cfg80211_color_change_settings *params) +{ +struct ieee80211_sub_if_data *sdata =IEEE80211_DEV_TO_SUB_IF (dev); +struct ieee80211_local *local = sdata->local; +u32 changed =0 ; +int err; + +sdata_assert_lock (sdata); +lockdep_assert_held (&local->mtx); + +/* don't allow another color change if one is already active or if csa
net/mac80211/cfg.c +7
-0+* is active +*/ +if (sdata->vif.cca_active || sdata->vif.csa_active) +return -EBUSY ; + + err =ieee80211_set_cca_beacon (sdata, params, &changed); +if (err)
net/mac80211/cfg.c static int ieee80211_reset_tid_config(struct wiphy *wiphy, · line 4180
Quoted 10 lines
net/mac80211/cfg.c +10
-0+return err; + + sdata->vif.cca_active = true; + sdata->vif.cca_color = params->color; + +cfg80211_color_change_started_notify (sdata->dev, params->count); + +if (changed) { + sdata->vif.bss_conf.he_bss_color.enabled =0 ; + changed |=BSS_CHANGED_HE_BSS_COLOR ;
same here
net/mac80211/cfg.c static int ieee80211_reset_tid_config(struct wiphy *wiphy, · line 4188
Quoted 8 lines
net/mac80211/cfg.c +8
-0+ieee80211_bss_info_change_notify (sdata, changed); + }else { +/* if the beacon didn't change, we can finalize immediately */ +ieee80211_cca_finalize (sdata); + } + +return 0 ; +}
Thanks
Karthikeyan P
Signature · 3 lines
ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
Re: [PATCH V4 4/5] mac80211: add support for BSS coloring
Quoted 36 lines · Karthikeyan periyasamy
Quoted 16 lines
The CCA (color change announcement) is very similar to how CSA works where we have an IE that includes a counter. When the counter hits 0, the new color is applied via an updated beacon.
This patch makes the CSA counter functionality reusable, rather than implementing it again. This also allows for future reuse incase support for other counter IEs gets added.
Signed-off-by John Crispin <[email protected]>---
include/net/mac80211.h | 28 +++++
net/mac80211/cfg.c | 227 +++++++++++++++++++++++++++++++++++--net/mac80211/ieee80211_i.h| 12 ++
net/mac80211/iface.c | 3 +
net/mac80211/tx.c | 24 ++--5 files changed, 276 insertions(+), 18 deletions(-)...
Quoted 19 lines
net/mac80211/cfg.c +18
-0+static int ieee80211_cca_finalize (struct ieee80211_sub_if_data *sdata) +{ + struct ieee80211_local *local = sdata->local; + u32 changed = 0; + int err; + + sdata_assert_lock(sdata); + lockdep_assert_held(&local->mtx); + + sdata->vif.cca_active = false; + + err = ieee80211_set_after_cca_beacon(sdata, &changed); + if (err) { + cfg80211_color_change_aborted_notify(sdata->dev); + return err; + } + + sdata->vif.bss_conf.he_bss_color.color = sdata->vif.cca_color;
Quoted 9 lines
Quoted 3 lines
+
sdata->vif.bss_conf.he_bss_color.enabled= 1; + changed |=BSS_CHANGED_HE_BSS_COLOR; +Why we are not updating the bss color information in he_oper.params.
IMHO remove the redundant information of bss color in the "structieee80211_bss_conf" by removing thehe_bss_colorsince he_oper.params holds more information in u32 itself.
What do you think?
the he_oper field is const, so we cannot easily update it. In an AP setup the color value will only be used once during start_ap() and updated via dedicated bss_color/bss_config change notification.
in STA morde the value is derived from the remote beacon rx event (which is why we treat it as const.
generally the bss_config change is only related to the color and hence should not do a cross layer thing with the he_oper mode.
John
Quoted 98 lines
Quoted 74 lines
+
ieee80211_bss_info_change_notify(sdata, changed);net/mac80211/cfg.c +65
-0+ + cfg80211_color_change_notify(sdata->dev); + + return 0; +} + +void ieee80211_cca_finalize_work (struct work_struct *work) +{ + struct ieee80211_sub_if_data *sdata = + container_of(work, struct ieee80211_sub_if_data, + cca_finalize_work); + struct ieee80211_local *local = sdata->local; + + sdata_lock(sdata); + mutex_lock(&local->mtx); + + /* AP might have been stopped while waiting for the lock. */ + if (!sdata->vif.cca_active) + goto unlock; + + if (!ieee80211_sdata_running(sdata)) + goto unlock; + + ieee80211_cca_finalize(sdata); + +unlock: + mutex_unlock(&local->mtx); + sdata_unlock(sdata); +} + +void ieee80211_cca_finish (struct ieee80211_vif *vif) +{ + struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif); + + ieee80211_queue_work(&sdata->local->hw, + &sdata->cca_finalize_work); +} +EXPORT_SYMBOL_GPL (ieee80211_cca_finish); + +void +ieeee80211_obss_color_collision_notify (struct ieee80211_vif *vif, + u64 color_bitmap) +{ + struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif); + + if (sdata->vif.cca_active || sdata->vif.csa_active) + return; + + cfg80211_obss_color_collision_notify(sdata->dev, color_bitmap); +} +EXPORT_SYMBOL_GPL (ieeee80211_obss_color_collision_notify); + +static int +__ieee80211_color_change (struct wiphy *wiphy,struct net_device *dev, + struct cfg80211_color_change_settings *params) +{ + struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); + struct ieee80211_local *local = sdata->local; + u32 changed = 0; + int err; + + sdata_assert_lock(sdata); + lockdep_assert_held(&local->mtx); + + /* don't allow another color change if one is already active orif csa
+ * is active
+ */
+ if (sdata->vif.cca_active||sdata->vif.csa_active) + return-EBUSY;net/mac80211/cfg.c +3
-0+ + err = ieee80211_set_cca_beacon(sdata, params, &changed); + if (err)net/mac80211/cfg.c static int ieee80211_reset_tid_config(struct wiphy *wiphy, · line 4180
Quoted 10 lines
net/mac80211/cfg.c +10
-0+ return err; + + sdata->vif.cca_active = true; + sdata->vif.cca_color = params->color; + + cfg80211_color_change_started_notify(sdata->dev, params->count); + + if (changed) { + sdata->vif.bss_conf.he_bss_color.enabled = 0; + changed |= BSS_CHANGED_HE_BSS_COLOR;same here
net/mac80211/cfg.c static int ieee80211_reset_tid_config(struct wiphy *wiphy, · line 4039
Quoted 8 lines
+
ieee80211_bss_info_change_notify(sdata, changed);
+ } else {
+ /* if the beacon didn't change, we can finalize immediately */ +ieee80211_cca_finalize(sdata);
+ }net/mac80211/cfg.c +3
-0+ + return 0; +}Thanks
Karthikeyan P
Signature · 3 lines
ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH v4 5/5 ath11k: add support for BSS coloring
In reply to John CrispinWhenever the MAC detects a color collision or any of its associated station detects one the FW will send out an event. Add the code to parse and handle this event. and pass the data up to mac80211.
The FW does not provide an offload feature such as the one used for CSA. The CCA process is hence triggered via the beacon offload tx completion events sent out by the FW.
--- drivers/net/wireless/ath/ath11k/mac.c | 36 +++++++++++++++++ drivers/net/wireless/ath/ath11k/mac.h | 1 + drivers/net/wireless/ath/ath11k/wmi.c | 57 +++++++++++++++++++++++++++ drivers/net/wireless/ath/ath11k/wmi.h | 14 +++++++ 4 files changed, 108 insertions(+)
drivers/net/wireless/ath/ath11k/mac.c +36 -0
@@ -815,6 +815,22 @@ static int ath11k_mac_setup_bcn_tmpl(struct ath11k_vif *arvif)return ret; } +void ath11k_mac_bcn_tx_event (struct ath11k_vif *arvif) +{ +struct ieee80211_vif *vif = arvif->vif; + +if (!vif->cca_active) +return ; + +if (ieee80211_beacon_cntdwn_is_complete (vif)) { +ieee80211_cca_finish (vif); +return ; + } + +ieee80211_beacon_update_cntdwn (vif); +ath11k_mac_setup_bcn_tmpl (arvif); +} +static void ath11k_control_beaconing (struct ath11k_vif *arvif,struct ieee80211_bss_conf *info) {
@@ -2076,6 +2092,24 @@ static void ath11k_mac_op_bss_info_changed(struct ieee80211_hw *hw,if (ret)ath11k_warn (ar->ab,"failed to set bss color collision on vdev %i: %d\n" , arvif->vdev_id, ret); + + param_id =WMI_VDEV_PARAM_BSS_COLOR ; +if (info->he_bss_color.enabled) + param_value = info->he_bss_color.color << +IEEE80211_HE_OPERATION_BSS_COLOR_OFFSET ; +else + param_value =IEEE80211_HE_OPERATION_BSS_COLOR_DISABLED ; + + ret =ath11k_wmi_vdev_set_param_cmd (ar, arvif->vdev_id, + param_id, + param_value); +if (ret) +ath11k_warn (ar->ab, +"failed to set bss color param on vdev %i: %d\n" , + arvif->vdev_id, ret); + +ath11k_info (ar->ab,"bss color param 0x%x set on vdev %i\n" , + param_value, arvif->vdev_id); }else if (vif->type ==NL80211_IFTYPE_STATION ) { ret = ath11k_wmi_send_bss_color_change_enable_cmd(ar, arvif->vdev_id,
@@ -6065,6 +6099,8 @@ static int __ath11k_mac_register(struct ath11k *ar) ar->hw->wiphy->features |=NL80211_FEATURE_AP_MODE_CHAN_WIDTH_CHANGE |NL80211_FEATURE_AP_SCAN ; + ar->hw->wiphy->flags |=WIPHY_FLAG_SUPPORTS_BSS_COLOR ; + ar->max_num_stations =TARGET_NUM_STATIONS ; ar->max_num_peers =TARGET_NUM_PEERS_PDEV ;
drivers/net/wireless/ath/ath11k/mac.h +1 -0
@@ -146,4 +146,5 @@ int ath11k_mac_tx_mgmt_pending_free(int buf_id, void *skb, void *ctx);u8 ath11k_mac_bw_to_mac80211_bw (u8 bw);enum ath11k_supported_bw ath11k_mac_mac80211_bw_to_ath11k_bw (enum rate_info_bw bw);enum hal_encrypt_type ath11k_dp_tx_get_encrypt_type (u32 cipher); +void ath11k_mac_bcn_tx_event (struct ath11k_vif *arvif);#endif
drivers/net/wireless/ath/ath11k/wmi.c +57 -0
87 lines not on this page · raw message
drivers/net/wireless/ath/ath11k/wmi.h +14 -0
@@ -740,6 +740,7 @@ enum wmi_tlv_event_id {WMI_MDNS_STATS_EVENTID =WMI_TLV_CMD (WMI_GRP_MDNS_OFL ),WMI_SAP_OFL_ADD_STA_EVENTID =WMI_TLV_CMD (WMI_GRP_SAP_OFL ),WMI_SAP_OFL_DEL_STA_EVENTID , +WMI_OBSS_COLOR_COLLISION_DETECTION_EVENTID =WMI_EVT_GRP_START_ID (WMI_GRP_OBSS_OFL ),WMI_OCB_SET_CONFIG_RESP_EVENTID =WMI_TLV_CMD (WMI_GRP_OCB ),WMI_OCB_GET_TSF_TIMER_RESP_EVENTID , WMI_DCC_GET_STATS_RESP_EVENTID,
@@ -4768,6 +4769,13 @@ struct wmi_obss_spatial_reuse_params_cmd {#define ATH11K_BSS_COLOR_COLLISION_DETECTION_STA_PERIOD_MS 10000#define ATH11K_BSS_COLOR_COLLISION_DETECTION_AP_PERIOD_MS 5000 +enum wmi_bss_color_collision { +WMI_BSS_COLOR_COLLISION_DISABLE =0 , +WMI_BSS_COLOR_COLLISION_DETECTION , +WMI_BSS_COLOR_FREE_SLOT_TIMER_EXPIRY , +WMI_BSS_COLOR_FREE_SLOT_AVAILABLE , +}; +struct wmi_obss_color_collision_cfg_params_cmd {u32 tlv_header;u32 vdev_id;
@@ -4785,6 +4793,12 @@ struct wmi_bss_color_change_enable_params_cmd {u32 enable; } __packed; +struct wmi_obss_color_collision_event { +u32 vdev_id; +u32 evt_type; +u64 obss_color_bitmap; +} __packed; +#define ATH11K_IPV4_TH_SEED_SIZE 5#define ATH11K_IPV6_TH_SEED_SIZE 11
Signature · 7 lines
2.25.1 -- ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k