Skip to content

Commit 8c77124

Browse files
Felix Fietkaulinvjw
authored andcommitted
mac80211: make ieee80211_send_bar available for drivers
To properly maintain the peer's block ack window, the driver needs to be able to control the new starting sequence number that is sent along with the BlockAckReq frame. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
1 parent d7549cb commit 8c77124

4 files changed

Lines changed: 18 additions & 4 deletions

File tree

‎include/net/mac80211.h‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3225,6 +3225,19 @@ void ieee80211_remain_on_channel_expired(struct ieee80211_hw *hw);
32253225
void ieee80211_stop_rx_ba_session(struct ieee80211_vif *vif, u16 ba_rx_bitmap,
32263226
const u8 *addr);
32273227

3228+
/**
3229+
* ieee80211_send_bar - send a BlockAckReq frame
3230+
*
3231+
* can be used to flush pending frames from the peer's aggregation reorder
3232+
* buffer.
3233+
*
3234+
* @vif: &struct ieee80211_vif pointer from the add_interface callback.
3235+
* @ra: the peer's destination address
3236+
* @tid: the TID of the aggregation session
3237+
* @ssn: the new starting sequence number for the receiver
3238+
*/
3239+
void ieee80211_send_bar(struct ieee80211_vif *vif, u8 *ra, u16 tid, u16 ssn);
3240+
32283241
/* Rate control API */
32293242

32303243
/**

‎net/mac80211/agg-tx.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,9 @@ static void ieee80211_send_addba_request(struct ieee80211_sub_if_data *sdata,
104104
ieee80211_tx_skb(sdata, skb);
105105
}
106106

107-
void ieee80211_send_bar(struct ieee80211_sub_if_data *sdata, u8 *ra, u16 tid, u16 ssn)
107+
void ieee80211_send_bar(struct ieee80211_vif *vif, u8 *ra, u16 tid, u16 ssn)
108108
{
109+
struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif);
109110
struct ieee80211_local *local = sdata->local;
110111
struct sk_buff *skb;
111112
struct ieee80211_bar *bar;
@@ -131,6 +132,7 @@ void ieee80211_send_bar(struct ieee80211_sub_if_data *sdata, u8 *ra, u16 tid, u1
131132
IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT;
132133
ieee80211_tx_skb(sdata, skb);
133134
}
135+
EXPORT_SYMBOL(ieee80211_send_bar);
134136

135137
void ieee80211_assign_tid_tx(struct sta_info *sta, int tid,
136138
struct tid_ampdu_tx *tid_tx)

‎net/mac80211/ieee80211_i.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1186,7 +1186,6 @@ struct ieee80211_tx_status_rtap_hdr {
11861186
void ieee80211_ht_cap_ie_to_sta_ht_cap(struct ieee80211_supported_band *sband,
11871187
struct ieee80211_ht_cap *ht_cap_ie,
11881188
struct ieee80211_sta_ht_cap *ht_cap);
1189-
void ieee80211_send_bar(struct ieee80211_sub_if_data *sdata, u8 *ra, u16 tid, u16 ssn);
11901189
void ieee80211_send_delba(struct ieee80211_sub_if_data *sdata,
11911190
const u8 *da, u16 tid,
11921191
u16 initiator, u16 reason_code);

‎net/mac80211/status.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ static void ieee80211_check_pending_bar(struct sta_info *sta, u8 *addr, u8 tid)
136136
return;
137137

138138
tid_tx->bar_pending = false;
139-
ieee80211_send_bar(sta->sdata, addr, tid, tid_tx->failed_bar_ssn);
139+
ieee80211_send_bar(&sta->sdata->vif, addr, tid, tid_tx->failed_bar_ssn);
140140
}
141141

142142
static void ieee80211_frame_acked(struct sta_info *sta, struct sk_buff *skb)
@@ -273,7 +273,7 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
273273
tid = qc[0] & 0xf;
274274
ssn = ((le16_to_cpu(hdr->seq_ctrl) + 0x10)
275275
& IEEE80211_SCTL_SEQ);
276-
ieee80211_send_bar(sta->sdata, hdr->addr1,
276+
ieee80211_send_bar(&sta->sdata->vif, hdr->addr1,
277277
tid, ssn);
278278
}
279279

0 commit comments

Comments
 (0)