Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / ti / wlcore / cmd.c
index 56d248a0acc18ea40d02eabcc0df47e01ada84e4..c9e060795d13760befc72a9190b008b65b6f1b41 100644 (file)
@@ -366,7 +366,9 @@ void wl12xx_free_link(struct wl1271 *wl, struct wl12xx_vif *wlvif, u8 *hlid)
        wl1271_tx_reset_link_queues(wl, *hlid);
        wl->links[*hlid].wlvif = NULL;
 
-       if (wlvif->bss_type != BSS_TYPE_AP_BSS) {
+       if (wlvif->bss_type == BSS_TYPE_STA_BSS ||
+           (wlvif->bss_type == BSS_TYPE_AP_BSS &&
+            *hlid == wlvif->ap.bcast_hlid)) {
                /*
                 * save the total freed packets in the wlvif, in case this is
                 * recovery or suspend
@@ -635,6 +637,10 @@ int wl12xx_cmd_role_start_ap(struct wl1271 *wl, struct wl12xx_vif *wlvif)
        if (ret < 0)
                goto out_free_global;
 
+       /* use the previous security seq, if this is a recovery/resume */
+       wl->links[wlvif->ap.bcast_hlid].total_freed_pkts =
+                                               wlvif->total_freed_pkts;
+
        cmd->role_id = wlvif->role_id;
        cmd->ap.aging_period = cpu_to_le16(wl->conf.tx.ap_aging_period);
        cmd->ap.bss_index = WL1271_AP_BSS_INDEX;