Commit 70559a06 authored by Shahar Levi's avatar Shahar Levi Committed by John W. Linville

wl12xx: Stop BA session event from device

Adding new event that close RX BA session in case of periodic BT activity
limiting WLAN activity.
Signed-off-by: default avatarShahar Levi <shahar_levi@ti.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent f41ccd71
...@@ -485,7 +485,8 @@ static int wl1271_boot_run_firmware(struct wl1271 *wl) ...@@ -485,7 +485,8 @@ static int wl1271_boot_run_firmware(struct wl1271 *wl)
if (wl->bss_type == BSS_TYPE_AP_BSS) if (wl->bss_type == BSS_TYPE_AP_BSS)
wl->event_mask |= STA_REMOVE_COMPLETE_EVENT_ID; wl->event_mask |= STA_REMOVE_COMPLETE_EVENT_ID;
else else
wl->event_mask |= DUMMY_PACKET_EVENT_ID; wl->event_mask |= DUMMY_PACKET_EVENT_ID |
BA_SESSION_RX_CONSTRAINT_EVENT_ID;
ret = wl1271_event_unmask(wl); ret = wl1271_event_unmask(wl);
if (ret < 0) { if (ret < 0) {
......
...@@ -168,6 +168,21 @@ static void wl1271_event_rssi_trigger(struct wl1271 *wl, ...@@ -168,6 +168,21 @@ static void wl1271_event_rssi_trigger(struct wl1271 *wl,
wl->last_rssi_event = event; wl->last_rssi_event = event;
} }
static void wl1271_stop_ba_event(struct wl1271 *wl, u8 ba_allowed)
{
/* Convert the value to bool */
wl->ba_allowed = !!ba_allowed;
/*
* Return in case:
* there are not BA open or the event indication is to allowed BA
*/
if ((!wl->ba_rx_bitmap) || (wl->ba_allowed))
return;
ieee80211_stop_rx_ba_session(wl->vif, wl->ba_rx_bitmap, wl->bssid);
}
static void wl1271_event_mbox_dump(struct event_mailbox *mbox) static void wl1271_event_mbox_dump(struct event_mailbox *mbox)
{ {
wl1271_debug(DEBUG_EVENT, "MBOX DUMP:"); wl1271_debug(DEBUG_EVENT, "MBOX DUMP:");
...@@ -252,6 +267,14 @@ static int wl1271_event_process(struct wl1271 *wl, struct event_mailbox *mbox) ...@@ -252,6 +267,14 @@ static int wl1271_event_process(struct wl1271 *wl, struct event_mailbox *mbox)
wl1271_event_rssi_trigger(wl, mbox); wl1271_event_rssi_trigger(wl, mbox);
} }
if ((vector & BA_SESSION_RX_CONSTRAINT_EVENT_ID) && !is_ap) {
wl1271_debug(DEBUG_EVENT, "BA_SESSION_RX_CONSTRAINT_EVENT_ID. "
"ba_allowed = 0x%x", mbox->ba_allowed);
if (wl->vif)
wl1271_stop_ba_event(wl, mbox->ba_allowed);
}
if ((vector & DUMMY_PACKET_EVENT_ID) && !is_ap) { if ((vector & DUMMY_PACKET_EVENT_ID) && !is_ap) {
wl1271_debug(DEBUG_EVENT, "DUMMY_PACKET_ID_EVENT_ID"); wl1271_debug(DEBUG_EVENT, "DUMMY_PACKET_ID_EVENT_ID");
if (wl->vif) if (wl->vif)
......
...@@ -71,7 +71,7 @@ enum { ...@@ -71,7 +71,7 @@ enum {
HEALTH_CHECK_REPLY_EVENT_ID = BIT(27), HEALTH_CHECK_REPLY_EVENT_ID = BIT(27),
PERIODIC_SCAN_COMPLETE_EVENT_ID = BIT(28), PERIODIC_SCAN_COMPLETE_EVENT_ID = BIT(28),
PERIODIC_SCAN_REPORT_EVENT_ID = BIT(29), PERIODIC_SCAN_REPORT_EVENT_ID = BIT(29),
BA_SESSION_TEAR_DOWN_EVENT_ID = BIT(30), BA_SESSION_RX_CONSTRAINT_EVENT_ID = BIT(30),
EVENT_MBOX_ALL_EVENT_ID = 0x7fffffff, EVENT_MBOX_ALL_EVENT_ID = 0x7fffffff,
}; };
...@@ -122,7 +122,20 @@ struct event_mailbox { ...@@ -122,7 +122,20 @@ struct event_mailbox {
__le16 sta_aging_status; __le16 sta_aging_status;
__le16 sta_tx_retry_exceeded; __le16 sta_tx_retry_exceeded;
u8 reserved_5[24]; /*
* Bitmap, Each bit set represents the Role ID for which this constraint
* is set. Range: 0 - FF, FF means ANY role
*/
u8 ba_role_id;
/*
* Bitmap, Each bit set represents the Link ID for which this constraint
* is set. Not applicable if ba_role_id is set to ANY role (FF).
* Range: 0 - FFFF, FFFF means ANY link in that role
*/
u8 ba_link_id;
u8 ba_allowed;
u8 reserved_5[21];
} __packed; } __packed;
int wl1271_event_unmask(struct wl1271 *wl); int wl1271_event_unmask(struct wl1271 *wl);
......
...@@ -541,6 +541,7 @@ static int wl1271_set_ba_policies(struct wl1271 *wl) ...@@ -541,6 +541,7 @@ static int wl1271_set_ba_policies(struct wl1271 *wl)
/* Reset the BA RX indicators */ /* Reset the BA RX indicators */
wl->ba_rx_bitmap = 0; wl->ba_rx_bitmap = 0;
wl->ba_allowed = true;
/* validate that FW support BA */ /* validate that FW support BA */
wl1271_check_ba_support(wl); wl1271_check_ba_support(wl);
......
...@@ -3354,9 +3354,12 @@ static int wl1271_op_ampdu_action(struct ieee80211_hw *hw, ...@@ -3354,9 +3354,12 @@ static int wl1271_op_ampdu_action(struct ieee80211_hw *hw,
if (ret < 0) if (ret < 0)
goto out; goto out;
wl1271_debug(DEBUG_MAC80211, "mac80211 ampdu: Rx tid %d action %d",
tid, action);
switch (action) { switch (action) {
case IEEE80211_AMPDU_RX_START: case IEEE80211_AMPDU_RX_START:
if (wl->ba_support) { if ((wl->ba_support) && (wl->ba_allowed)) {
ret = wl1271_acx_set_ba_receiver_session(wl, tid, *ssn, ret = wl1271_acx_set_ba_receiver_session(wl, tid, *ssn,
true); true);
if (!ret) if (!ret)
......
...@@ -564,6 +564,7 @@ struct wl1271 { ...@@ -564,6 +564,7 @@ struct wl1271 {
/* RX BA constraint value */ /* RX BA constraint value */
bool ba_support; bool ba_support;
u8 ba_rx_bitmap; u8 ba_rx_bitmap;
bool ba_allowed;
int tcxo_clock; int tcxo_clock;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment