wlcore: Add RX_BA_WIN_SIZE_CHANGE_EVENT event
authorMaxim Altshul <maxim.altshul@ti.com>
Sun, 21 Aug 2016 11:24:25 +0000 (14:24 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 20 May 2017 12:27:03 +0000 (14:27 +0200)
commit e7ee74b56f23ba447d3124f2eccc32033cca501d upstream.

This event is used by the Firmware to limit the RX BA win size
for a specific link.

The event handler updates the new size in the mac's sta->sta struct.

BA sessions opened for that link will use the new restricted
win_size. This limitation remains until a new update is received or
until the link is closed.

Signed-off-by: Maxim Altshul <maxim.altshul@ti.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
[AmitP: Minor refactoring for linux-4.4.y]
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/wireless/ti/wl18xx/event.c
drivers/net/wireless/ti/wl18xx/event.h
drivers/net/wireless/ti/wl18xx/main.c

index 09c7e098f4607bd6cb6d0b0f89654f63bcf6de74..085ef5c8726286b57125a6d05b2adea871acfbeb 100644 (file)
@@ -206,5 +206,33 @@ int wl18xx_process_mailbox_events(struct wl1271 *wl)
                                                 mbox->sc_pwd_len,
                                                 mbox->sc_pwd);
 
+       if (vector & RX_BA_WIN_SIZE_CHANGE_EVENT_ID) {
+               struct wl12xx_vif *wlvif;
+               struct ieee80211_vif *vif;
+               struct ieee80211_sta *sta;
+               u8 link_id = mbox->rx_ba_link_id;
+               u8 win_size = mbox->rx_ba_win_size;
+               const u8 *addr;
+
+               wlvif = wl->links[link_id].wlvif;
+               vif = wl12xx_wlvif_to_vif(wlvif);
+
+               /* Update RX aggregation window size and call
+                * MAC routine to stop active RX aggregations for this link
+                */
+               if (wlvif->bss_type != BSS_TYPE_AP_BSS)
+                       addr = vif->bss_conf.bssid;
+               else
+                       addr = wl->links[link_id].addr;
+
+               sta = ieee80211_find_sta(vif, addr);
+               if (sta) {
+                       sta->max_rx_aggregation_subframes = win_size;
+                       ieee80211_stop_rx_ba_session(vif,
+                                               wl->links[link_id].ba_bitmap,
+                                               addr);
+               }
+       }
+
        return 0;
 }
index f3d4f13379cb0dcd1846119d27941c8301167dac..9495fadc80934d0e5e650fd09db9eb2373c2afbb 100644 (file)
@@ -38,6 +38,7 @@ enum {
        REMAIN_ON_CHANNEL_COMPLETE_EVENT_ID      = BIT(18),
        DFS_CHANNELS_CONFIG_COMPLETE_EVENT       = BIT(19),
        PERIODIC_SCAN_REPORT_EVENT_ID            = BIT(20),
+       RX_BA_WIN_SIZE_CHANGE_EVENT_ID           = BIT(21),
        SMART_CONFIG_SYNC_EVENT_ID               = BIT(22),
        SMART_CONFIG_DECODE_EVENT_ID             = BIT(23),
        TIME_SYNC_EVENT_ID                       = BIT(24),
index 50cce42089a5eb0358620a46d46d0990af47e6e7..47f355e92193f31ec5a7b59f7a67fc226e237e87 100644 (file)
@@ -1029,7 +1029,8 @@ static int wl18xx_boot(struct wl1271 *wl)
                DFS_CHANNELS_CONFIG_COMPLETE_EVENT |
                SMART_CONFIG_SYNC_EVENT_ID |
                SMART_CONFIG_DECODE_EVENT_ID |
-               TIME_SYNC_EVENT_ID;
+               TIME_SYNC_EVENT_ID |
+               RX_BA_WIN_SIZE_CHANGE_EVENT_ID;
 
        wl->ap_event_mask = MAX_TX_FAILURE_EVENT_ID;