Skip to content

Commit

Permalink
Merge tag 'mac80211-next-for-net-next-2019-10-11' of git://git.kernel…
Browse files Browse the repository at this point in the history
….org/pub/scm/linux/kernel/git/jberg/mac80211-next

Johannes Berg says:

====================
A few more small things, nothing really stands out:
 * minstrel improvements from Felix
 * a TX aggregation simplification
 * some additional capabilities for hwsim
 * minor cleanups & docs updates
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Oct 13, 2019
2 parents cb0ce18 + 7dfd8ac commit 7e0d15e
Show file tree
Hide file tree
Showing 30 changed files with 212 additions and 130 deletions.
2 changes: 1 addition & 1 deletion drivers/net/wireless/ath/ath9k/htc_drv_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1674,7 +1674,7 @@ static int ath9k_htc_ampdu_action(struct ieee80211_hw *hw,
case IEEE80211_AMPDU_TX_START:
ret = ath9k_htc_tx_aggr_oper(priv, vif, sta, action, tid);
if (!ret)
ieee80211_start_tx_ba_cb_irqsafe(vif, sta->addr, tid);
ret = IEEE80211_AMPDU_TX_START_IMMEDIATE;
break;
case IEEE80211_AMPDU_TX_STOP_CONT:
case IEEE80211_AMPDU_TX_STOP_FLUSH:
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/ath/ath9k/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1921,7 +1921,7 @@ static int ath9k_ampdu_action(struct ieee80211_hw *hw,
ath9k_ps_wakeup(sc);
ret = ath_tx_aggr_start(sc, sta, tid, ssn);
if (!ret)
ieee80211_start_tx_ba_cb_irqsafe(vif, sta->addr, tid);
ret = IEEE80211_AMPDU_TX_START_IMMEDIATE;
ath9k_ps_restore(sc);
break;
case IEEE80211_AMPDU_TX_STOP_FLUSH:
Expand Down
3 changes: 1 addition & 2 deletions drivers/net/wireless/ath/carl9170/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1449,8 +1449,7 @@ static int carl9170_op_ampdu_action(struct ieee80211_hw *hw,
rcu_assign_pointer(sta_info->agg[tid], tid_info);
spin_unlock_bh(&ar->tx_ampdu_list_lock);

ieee80211_start_tx_ba_cb_irqsafe(vif, sta->addr, tid);
break;
return IEEE80211_AMPDU_TX_START_IMMEDIATE;

case IEEE80211_AMPDU_TX_STOP_CONT:
case IEEE80211_AMPDU_TX_STOP_FLUSH:
Expand Down
5 changes: 3 additions & 2 deletions drivers/net/wireless/ath/wcn36xx/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1084,6 +1084,7 @@ static int wcn36xx_ampdu_action(struct ieee80211_hw *hw,
enum ieee80211_ampdu_mlme_action action = params->action;
u16 tid = params->tid;
u16 *ssn = &params->ssn;
int ret = 0;

wcn36xx_dbg(WCN36XX_DBG_MAC, "mac ampdu action action %d tid %d\n",
action, tid);
Expand All @@ -1106,7 +1107,7 @@ static int wcn36xx_ampdu_action(struct ieee80211_hw *hw,
sta_priv->ampdu_state[tid] = WCN36XX_AMPDU_START;
spin_unlock_bh(&sta_priv->ampdu_lock);

ieee80211_start_tx_ba_cb_irqsafe(vif, sta->addr, tid);
ret = IEEE80211_AMPDU_TX_START_IMMEDIATE;
break;
case IEEE80211_AMPDU_TX_OPERATIONAL:
spin_lock_bh(&sta_priv->ampdu_lock);
Expand All @@ -1131,7 +1132,7 @@ static int wcn36xx_ampdu_action(struct ieee80211_hw *hw,

mutex_unlock(&wcn->conf_mutex);

return 0;
return ret;
}

static const struct ieee80211_ops wcn36xx_ops = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -850,8 +850,7 @@ brcms_ops_ampdu_action(struct ieee80211_hw *hw,
"START: tid %d is not agg\'able\n", tid);
return -EINVAL;
}
ieee80211_start_tx_ba_cb_irqsafe(vif, sta->addr, tid);
break;
return IEEE80211_AMPDU_TX_START_IMMEDIATE;

case IEEE80211_AMPDU_TX_STOP_CONT:
case IEEE80211_AMPDU_TX_STOP_FLUSH:
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/intel/iwlegacy/4965-mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -2265,7 +2265,7 @@ il4965_tx_agg_start(struct il_priv *il, struct ieee80211_vif *vif,
if (tid_data->tfds_in_queue == 0) {
D_HT("HW queue is empty\n");
tid_data->agg.state = IL_AGG_ON;
ieee80211_start_tx_ba_cb_irqsafe(vif, sta->addr, tid);
ret = IEEE80211_AMPDU_TX_START_IMMEDIATE;
} else {
D_HT("HW queue is NOT empty: %d packets in HW queue\n",
tid_data->tfds_in_queue);
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/intel/iwlwifi/dvm/tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ int iwlagn_tx_agg_start(struct iwl_priv *priv, struct ieee80211_vif *vif,
IWL_DEBUG_TX_QUEUES(priv, "Can proceed: ssn = next_recl = %d\n",
tid_data->agg.ssn);
tid_data->agg.state = IWL_AGG_STARTING;
ieee80211_start_tx_ba_cb_irqsafe(vif, sta->addr, tid);
ret = IEEE80211_AMPDU_TX_START_IMMEDIATE;
} else {
IWL_DEBUG_TX_QUEUES(priv, "Can't proceed: ssn %d, "
"next_reclaimed = %d\n",
Expand Down
5 changes: 2 additions & 3 deletions drivers/net/wireless/intel/iwlwifi/mvm/sta.c
Original file line number Diff line number Diff line change
Expand Up @@ -2818,13 +2818,12 @@ int iwl_mvm_sta_tx_agg_start(struct iwl_mvm *mvm, struct ieee80211_vif *vif,

if (normalized_ssn == tid_data->next_reclaimed) {
tid_data->state = IWL_AGG_STARTING;
ieee80211_start_tx_ba_cb_irqsafe(vif, sta->addr, tid);
ret = IEEE80211_AMPDU_TX_START_IMMEDIATE;
} else {
tid_data->state = IWL_EMPTYING_HW_QUEUE_ADDBA;
ret = 0;
}

ret = 0;

out:
spin_unlock_bh(&mvmsta->lock);

Expand Down
37 changes: 31 additions & 6 deletions drivers/net/wireless/mac80211_hwsim.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,23 +148,25 @@ static const char *hwsim_alpha2s[] = {
};

static const struct ieee80211_regdomain hwsim_world_regdom_custom_01 = {
.n_reg_rules = 4,
.n_reg_rules = 5,
.alpha2 = "99",
.reg_rules = {
REG_RULE(2412-10, 2462+10, 40, 0, 20, 0),
REG_RULE(2484-10, 2484+10, 40, 0, 20, 0),
REG_RULE(5150-10, 5240+10, 40, 0, 30, 0),
REG_RULE(5745-10, 5825+10, 40, 0, 30, 0),
REG_RULE(5855-10, 5925+10, 40, 0, 33, 0),
}
};

static const struct ieee80211_regdomain hwsim_world_regdom_custom_02 = {
.n_reg_rules = 2,
.n_reg_rules = 3,
.alpha2 = "99",
.reg_rules = {
REG_RULE(2412-10, 2462+10, 40, 0, 20, 0),
REG_RULE(5725-10, 5850+10, 40, 0, 30,
NL80211_RRF_NO_IR),
REG_RULE(5855-10, 5925+10, 40, 0, 33, 0),
}
};

Expand Down Expand Up @@ -354,6 +356,24 @@ static const struct ieee80211_channel hwsim_channels_5ghz[] = {
CHAN5G(5805), /* Channel 161 */
CHAN5G(5825), /* Channel 165 */
CHAN5G(5845), /* Channel 169 */

CHAN5G(5855), /* Channel 171 */
CHAN5G(5860), /* Channel 172 */
CHAN5G(5865), /* Channel 173 */
CHAN5G(5870), /* Channel 174 */

CHAN5G(5875), /* Channel 175 */
CHAN5G(5880), /* Channel 176 */
CHAN5G(5885), /* Channel 177 */
CHAN5G(5890), /* Channel 178 */
CHAN5G(5895), /* Channel 179 */
CHAN5G(5900), /* Channel 180 */
CHAN5G(5905), /* Channel 181 */

CHAN5G(5910), /* Channel 182 */
CHAN5G(5915), /* Channel 183 */
CHAN5G(5920), /* Channel 184 */
CHAN5G(5925), /* Channel 185 */
};

static const struct ieee80211_rate hwsim_rates[] = {
Expand Down Expand Up @@ -1550,7 +1570,8 @@ static void mac80211_hwsim_beacon_tx(void *arg, u8 *mac,

if (vif->type != NL80211_IFTYPE_AP &&
vif->type != NL80211_IFTYPE_MESH_POINT &&
vif->type != NL80211_IFTYPE_ADHOC)
vif->type != NL80211_IFTYPE_ADHOC &&
vif->type != NL80211_IFTYPE_OCB)
return;

skb = ieee80211_beacon_get(hw, vif);
Expand Down Expand Up @@ -1604,6 +1625,8 @@ mac80211_hwsim_beacon(struct hrtimer *timer)
}

static const char * const hwsim_chanwidths[] = {
[NL80211_CHAN_WIDTH_5] = "ht5",
[NL80211_CHAN_WIDTH_10] = "ht10",
[NL80211_CHAN_WIDTH_20_NOHT] = "noht",
[NL80211_CHAN_WIDTH_20] = "ht20",
[NL80211_CHAN_WIDTH_40] = "ht40",
Expand Down Expand Up @@ -1979,8 +2002,7 @@ static int mac80211_hwsim_ampdu_action(struct ieee80211_hw *hw,

switch (action) {
case IEEE80211_AMPDU_TX_START:
ieee80211_start_tx_ba_cb_irqsafe(vif, sta->addr, tid);
break;
return IEEE80211_AMPDU_TX_START_IMMEDIATE;
case IEEE80211_AMPDU_TX_STOP_CONT:
case IEEE80211_AMPDU_TX_STOP_FLUSH:
case IEEE80211_AMPDU_TX_STOP_FLUSH_CONT:
Expand Down Expand Up @@ -2723,7 +2745,8 @@ static void mac80211_hwsim_he_capab(struct ieee80211_supported_band *sband)
BIT(NL80211_IFTYPE_P2P_CLIENT) | \
BIT(NL80211_IFTYPE_P2P_GO) | \
BIT(NL80211_IFTYPE_ADHOC) | \
BIT(NL80211_IFTYPE_MESH_POINT))
BIT(NL80211_IFTYPE_MESH_POINT) | \
BIT(NL80211_IFTYPE_OCB))

static int mac80211_hwsim_new_radio(struct genl_info *info,
struct hwsim_new_radio_params *param)
Expand Down Expand Up @@ -2847,6 +2870,8 @@ static int mac80211_hwsim_new_radio(struct genl_info *info,
} else {
data->if_combination.num_different_channels = 1;
data->if_combination.radar_detect_widths =
BIT(NL80211_CHAN_WIDTH_5) |
BIT(NL80211_CHAN_WIDTH_10) |
BIT(NL80211_CHAN_WIDTH_20_NOHT) |
BIT(NL80211_CHAN_WIDTH_20) |
BIT(NL80211_CHAN_WIDTH_40) |
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/marvell/mwl8k.c
Original file line number Diff line number Diff line change
Expand Up @@ -5520,7 +5520,7 @@ mwl8k_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
rc = -EBUSY;
break;
}
ieee80211_start_tx_ba_cb_irqsafe(vif, addr, tid);
rc = IEEE80211_AMPDU_TX_START_IMMEDIATE;
break;
case IEEE80211_AMPDU_TX_STOP_CONT:
case IEEE80211_AMPDU_TX_STOP_FLUSH:
Expand Down
3 changes: 1 addition & 2 deletions drivers/net/wireless/mediatek/mt76/mt7603/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -582,8 +582,7 @@ mt7603_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
break;
case IEEE80211_AMPDU_TX_START:
mtxq->agg_ssn = IEEE80211_SN_TO_SEQ(ssn);
ieee80211_start_tx_ba_cb_irqsafe(vif, sta->addr, tid);
break;
return IEEE80211_AMPDU_TX_START_IMMEDIATE;
case IEEE80211_AMPDU_TX_STOP_CONT:
mtxq->aggr = false;
mt7603_mac_tx_ba_reset(dev, msta->wcid.idx, tid, -1);
Expand Down
3 changes: 1 addition & 2 deletions drivers/net/wireless/mediatek/mt76/mt7615/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -477,8 +477,7 @@ mt7615_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
break;
case IEEE80211_AMPDU_TX_START:
mtxq->agg_ssn = IEEE80211_SN_TO_SEQ(ssn);
ieee80211_start_tx_ba_cb_irqsafe(vif, sta->addr, tid);
break;
return IEEE80211_AMPDU_TX_START_IMMEDIATE;
case IEEE80211_AMPDU_TX_STOP_CONT:
mtxq->aggr = false;
mt7615_mcu_set_tx_ba(dev, params, 0);
Expand Down
3 changes: 1 addition & 2 deletions drivers/net/wireless/mediatek/mt76/mt76x02_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,7 @@ int mt76x02_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
break;
case IEEE80211_AMPDU_TX_START:
mtxq->agg_ssn = IEEE80211_SN_TO_SEQ(ssn);
ieee80211_start_tx_ba_cb_irqsafe(vif, sta->addr, tid);
break;
return IEEE80211_AMPDU_TX_START_IMMEDIATE;
case IEEE80211_AMPDU_TX_STOP_CONT:
mtxq->aggr = false;
ieee80211_stop_tx_ba_cb_irqsafe(vif, sta->addr, tid);
Expand Down
3 changes: 1 addition & 2 deletions drivers/net/wireless/mediatek/mt7601u/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,7 @@ mt76_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
break;
case IEEE80211_AMPDU_TX_START:
msta->agg_ssn[tid] = ssn << 4;
ieee80211_start_tx_ba_cb_irqsafe(vif, sta->addr, tid);
break;
return IEEE80211_AMPDU_TX_START_IMMEDIATE;
case IEEE80211_AMPDU_TX_STOP_CONT:
ieee80211_stop_tx_ba_cb_irqsafe(vif, sta->addr, tid);
break;
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/wireless/ralink/rt2x00/rt2800lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -10476,7 +10476,7 @@ int rt2800_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
* when the hw reorders frames due to aggregation.
*/
if (sta_priv->wcid > WCID_END)
return 1;
return -ENOSPC;

switch (action) {
case IEEE80211_AMPDU_RX_START:
Expand All @@ -10489,7 +10489,7 @@ int rt2800_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
*/
break;
case IEEE80211_AMPDU_TX_START:
ieee80211_start_tx_ba_cb_irqsafe(vif, sta->addr, tid);
ret = IEEE80211_AMPDU_TX_START_IMMEDIATE;
break;
case IEEE80211_AMPDU_TX_STOP_CONT:
case IEEE80211_AMPDU_TX_STOP_FLUSH:
Expand Down
3 changes: 1 addition & 2 deletions drivers/net/wireless/realtek/rtlwifi/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -1776,8 +1776,7 @@ int rtl_tx_agg_start(struct ieee80211_hw *hw, struct ieee80211_vif *vif,

tid_data->agg.agg_state = RTL_AGG_START;

ieee80211_start_tx_ba_cb_irqsafe(vif, sta->addr, tid);
return 0;
return IEEE80211_AMPDU_TX_START_IMMEDIATE;
}

int rtl_tx_agg_stop(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
Expand Down
3 changes: 1 addition & 2 deletions drivers/net/wireless/realtek/rtw88/mac80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -437,8 +437,7 @@ static int rtw_ops_ampdu_action(struct ieee80211_hw *hw,

switch (params->action) {
case IEEE80211_AMPDU_TX_START:
ieee80211_start_tx_ba_cb_irqsafe(vif, sta->addr, tid);
break;
return IEEE80211_AMPDU_TX_START_IMMEDIATE;
case IEEE80211_AMPDU_TX_STOP_CONT:
case IEEE80211_AMPDU_TX_STOP_FLUSH:
case IEEE80211_AMPDU_TX_STOP_FLUSH_CONT:
Expand Down
3 changes: 1 addition & 2 deletions drivers/net/wireless/rsi/rsi_91x_mac80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -1140,8 +1140,7 @@ static int rsi_mac80211_ampdu_action(struct ieee80211_hw *hw,
else if ((vif->type == NL80211_IFTYPE_AP) ||
(vif->type == NL80211_IFTYPE_P2P_GO))
rsta->seq_start[tid] = seq_no;
ieee80211_start_tx_ba_cb_irqsafe(vif, sta->addr, tid);
status = 0;
status = IEEE80211_AMPDU_TX_START_IMMEDIATE;
break;

case IEEE80211_AMPDU_TX_STOP_CONT:
Expand Down
11 changes: 9 additions & 2 deletions include/net/mac80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -3095,7 +3095,9 @@ enum ieee80211_filter_flags {
*
* @IEEE80211_AMPDU_RX_START: start RX aggregation
* @IEEE80211_AMPDU_RX_STOP: stop RX aggregation
* @IEEE80211_AMPDU_TX_START: start TX aggregation
* @IEEE80211_AMPDU_TX_START: start TX aggregation, the driver must either
* call ieee80211_start_tx_ba_cb_irqsafe() or return the special
* status %IEEE80211_AMPDU_TX_START_IMMEDIATE.
* @IEEE80211_AMPDU_TX_OPERATIONAL: TX aggregation has become operational
* @IEEE80211_AMPDU_TX_STOP_CONT: stop TX aggregation but continue transmitting
* queued packets, now unaggregated. After all packets are transmitted the
Expand All @@ -3119,6 +3121,8 @@ enum ieee80211_ampdu_mlme_action {
IEEE80211_AMPDU_TX_OPERATIONAL,
};

#define IEEE80211_AMPDU_TX_START_IMMEDIATE 1

/**
* struct ieee80211_ampdu_params - AMPDU action parameters
*
Expand Down Expand Up @@ -3896,7 +3900,10 @@ struct ieee80211_ops {
*
* Even ``189`` would be wrong since 1 could be lost again.
*
* Returns a negative error code on failure.
* Returns a negative error code on failure. The driver may return
* %IEEE80211_AMPDU_TX_START_IMMEDIATE for %IEEE80211_AMPDU_TX_START
* if the session can start immediately.
*
* The callback can sleep.
*/
int (*ampdu_action)(struct ieee80211_hw *hw,
Expand Down
8 changes: 8 additions & 0 deletions include/uapi/linux/nl80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,14 @@
* set of BSSID,frequency parameters is used (i.e., either the enforcing
* %NL80211_ATTR_MAC,%NL80211_ATTR_WIPHY_FREQ or the less strict
* %NL80211_ATTR_MAC_HINT and %NL80211_ATTR_WIPHY_FREQ_HINT).
* Driver shall not modify the IEs specified through %NL80211_ATTR_IE if
* %NL80211_ATTR_MAC is included. However, if %NL80211_ATTR_MAC_HINT is
* included, these IEs through %NL80211_ATTR_IE are specified by the user
* space based on the best possible BSS selected. Thus, if the driver ends
* up selecting a different BSS, it can modify these IEs accordingly (e.g.
* userspace asks the driver to perform PMKSA caching with BSS1 and the
* driver ends up selecting BSS2 with different PMKSA cache entry; RSNIE
* has to get updated with the apt PMKID).
* %NL80211_ATTR_PREV_BSSID can be used to request a reassociation within
* the ESS in case the device is already associated and an association with
* a different BSS is desired.
Expand Down
9 changes: 8 additions & 1 deletion net/mac80211/agg-tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,14 @@ void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid)

params.ssn = sta->tid_seq[tid] >> 4;
ret = drv_ampdu_action(local, sdata, &params);
if (ret) {
if (ret == IEEE80211_AMPDU_TX_START_IMMEDIATE) {
/*
* We didn't send the request yet, so don't need to check
* here if we already got a response, just mark as driver
* ready immediately.
*/
set_bit(HT_AGG_STATE_DRV_READY, &tid_tx->state);
} else if (ret) {
ht_dbg(sdata,
"BA request denied - HW unavailable for %pM tid %d\n",
sta->sta.addr, tid);
Expand Down
9 changes: 1 addition & 8 deletions net/mac80211/ibss.c
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,6 @@ int ieee80211_ibss_finish_csa(struct ieee80211_sub_if_data *sdata)
{
struct ieee80211_if_ibss *ifibss = &sdata->u.ibss;
struct cfg80211_bss *cbss;
int err, changed = 0;

sdata_assert_lock(sdata);

Expand All @@ -560,13 +559,7 @@ int ieee80211_ibss_finish_csa(struct ieee80211_sub_if_data *sdata)
ifibss->chandef = sdata->csa_chandef;

/* generate the beacon */
err = ieee80211_ibss_csa_beacon(sdata, NULL);
if (err < 0)
return err;

changed |= err;

return changed;
return ieee80211_ibss_csa_beacon(sdata, NULL);
}

void ieee80211_ibss_stop(struct ieee80211_sub_if_data *sdata)
Expand Down
Loading

0 comments on commit 7e0d15e

Please sign in to comment.