Merge commit 'c1e140bf79d817d4a7aa9932eb98b0359c87af33' from mac80211-next
[cascardo/linux.git] / drivers / net / wireless / ath / wil6210 / wmi.c
index 70b055c..b2b0fe1 100644 (file)
@@ -23,7 +23,7 @@
 #include "wmi.h"
 #include "trace.h"
 
-static uint max_assoc_sta = 1;
+static uint max_assoc_sta = WIL6210_MAX_CID;
 module_param(max_assoc_sta, uint, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(max_assoc_sta, " Max number of stations associated to the AP");
 
@@ -202,7 +202,7 @@ static int __wmi_send(struct wil6210_priv *wil, u16 cmdid, void *buf, u16 len)
 
        might_sleep();
 
-       if (!test_bit(wil_status_fwready, &wil->status)) {
+       if (!test_bit(wil_status_fwready, wil->status)) {
                wil_err(wil, "WMI: cannot send command while FW not ready\n");
                return -EAGAIN;
        }
@@ -305,7 +305,7 @@ static void wmi_evt_fw_ready(struct wil6210_priv *wil, int id, void *d,
        wil_dbg_wmi(wil, "WMI: got FW ready event\n");
 
        wil_set_recovery_state(wil, fw_recovery_idle);
-       set_bit(wil_status_fwready, &wil->status);
+       set_bit(wil_status_fwready, wil->status);
        /* let the reset sequence continue */
        complete(&wil->wmi_ready);
 }
@@ -443,7 +443,7 @@ static void wmi_evt_connect(struct wil6210_priv *wil, int id, void *d, int len)
 
        if ((wdev->iftype == NL80211_IFTYPE_STATION) ||
            (wdev->iftype == NL80211_IFTYPE_P2P_CLIENT)) {
-               if (!test_bit(wil_status_fwconnecting, &wil->status)) {
+               if (!test_bit(wil_status_fwconnecting, wil->status)) {
                        wil_err(wil, "Not in connecting state\n");
                        return;
                }
@@ -462,13 +462,12 @@ static void wmi_evt_connect(struct wil6210_priv *wil, int id, void *d, int len)
                if (assoc_req_ie) {
                        sinfo.assoc_req_ies = assoc_req_ie;
                        sinfo.assoc_req_ies_len = assoc_req_ielen;
-                       sinfo.filled |= STATION_INFO_ASSOC_REQ_IES;
                }
 
                cfg80211_new_sta(ndev, evt->bssid, &sinfo, GFP_KERNEL);
        }
-       clear_bit(wil_status_fwconnecting, &wil->status);
-       set_bit(wil_status_fwconnected, &wil->status);
+       clear_bit(wil_status_fwconnecting, wil->status);
+       set_bit(wil_status_fwconnected, wil->status);
 
        /* FIXME FW can transmit only ucast frames to peer */
        /* FIXME real ring_id instead of hard coded 0 */
@@ -644,14 +643,15 @@ static void wmi_evt_addba_rx_req(struct wil6210_priv *wil, int id, void *d,
 }
 
 static void wmi_evt_delba(struct wil6210_priv *wil, int id, void *d, int len)
+__acquires(&sta->tid_rx_lock) __releases(&sta->tid_rx_lock)
 {
        struct wmi_delba_event *evt = d;
        u8 cid, tid;
        u16 reason = __le16_to_cpu(evt->reason);
        struct wil_sta_info *sta;
        struct wil_tid_ampdu_rx *r;
-       unsigned long flags;
 
+       might_sleep();
        parse_cidxtid(evt->cidxtid, &cid, &tid);
        wil_dbg_wmi(wil, "DELBA CID %d TID %d from %s reason %d\n",
                    cid, tid,
@@ -681,13 +681,13 @@ static void wmi_evt_delba(struct wil6210_priv *wil, int id, void *d, int len)
 
        sta = &wil->sta[cid];
 
-       spin_lock_irqsave(&sta->tid_rx_lock, flags);
+       spin_lock_bh(&sta->tid_rx_lock);
 
        r = sta->tid_rx[tid];
        sta->tid_rx[tid] = NULL;
        wil_tid_ampdu_rx_free(wil, r);
 
-       spin_unlock_irqrestore(&sta->tid_rx_lock, flags);
+       spin_unlock_bh(&sta->tid_rx_lock);
 }
 
 static const struct {
@@ -726,7 +726,7 @@ void wmi_recv_cmd(struct wil6210_priv *wil)
        ulong flags;
        unsigned n;
 
-       if (!test_bit(wil_status_reset_done, &wil->status)) {
+       if (!test_bit(wil_status_reset_done, wil->status)) {
                wil_err(wil, "Reset in progress. Cannot handle WMI event\n");
                return;
        }
@@ -1090,6 +1090,7 @@ int wmi_rx_chain_add(struct wil6210_priv *wil, struct vring *vring)
                .mid = 0, /* TODO - what is it? */
                .decap_trans_type = WMI_DECAP_TYPE_802_3,
                .reorder_type = WMI_RX_SW_REORDER,
+               .host_thrsh = cpu_to_le16(rx_ring_overflow_thrsh),
        };
        struct {
                struct wil6210_mbox_hdr_wmi wmi;