Skip to content

Commit

Permalink
Merge tag 'mac80211-next-for-davem-2020-08-28' of git://git.kernel.or…
Browse files Browse the repository at this point in the history
…g/pub/scm/linux/kernel/git/jberg/mac80211-next

Johannes Berg says:

====================
This time we have:
 * some code to support SAE (WPA3) offload in AP mode
 * many documentation (wording) fixes/updates
 * netlink policy updates, including the use of NLA_RANGE
   with binary attributes
 * regulatory improvements for adjacent frequency bands
 * and a few other small additions/refactorings/cleanups
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Aug 28, 2020
2 parents 50aba46 + 2831a63 commit ae9a138
Show file tree
Hide file tree
Showing 31 changed files with 561 additions and 275 deletions.
4 changes: 2 additions & 2 deletions drivers/net/wireless/ath/ath10k/mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/ath/ath10k/wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/wireless/ath/ath11k/wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/ath/ath9k/beacon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/ath/ath9k/htc_drv_beacon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/intel/iwlwifi/mvm/time-event.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/mac80211_hwsim.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
4 changes: 2 additions & 2 deletions drivers/net/wireless/mediatek/mt76/mac80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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)
Expand Down
10 changes: 5 additions & 5 deletions drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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);
Expand Down
8 changes: 4 additions & 4 deletions drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
Original file line number Diff line number Diff line change
Expand Up @@ -2282,15 +2282,15 @@ 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;

tlv = mt7915_mcu_add_nested_subtlv(rskb, BSS_INFO_BCN_CSA,
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]];
}
}

Expand All @@ -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,
Expand Down
3 changes: 3 additions & 0 deletions include/net/cfg80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,10 @@ struct cfg80211_bitrate_mask {
u32 legacy;
u8 ht_mcs[IEEE80211_HT_MCS_MASK_LEN];
u16 vht_mcs[NL80211_VHT_NSS_MAX];
u16 he_mcs[NL80211_HE_NSS_MAX];
enum nl80211_txrate_gi gi;
enum nl80211_he_gi he_gi;
enum nl80211_he_ltf he_ltf;
} control[NUM_NL80211_BANDS];
};

Expand Down
35 changes: 17 additions & 18 deletions include/net/mac80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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];
};

/**
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
Loading

0 comments on commit ae9a138

Please sign in to comment.