]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
authorKalle Valo <kvalo@codeaurora.org>
Wed, 23 May 2018 07:42:08 +0000 (10:42 +0300)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 23 May 2018 07:42:08 +0000 (10:42 +0300)
ath.git patches for 4.18. Major changes:

ath10k

* add quiet mode support for QCA6174/QCA9377

wil6210

* disable WIL6210_TRACING kconfig option by default

1  2 
drivers/net/wireless/ath/wil6210/debugfs.c
drivers/net/wireless/ath/wil6210/wmi.c

index 11e46e44381e457c4763daf72b318a13895846e9,524a7d6898335ee0f805af7eb7d20dc1151d8874..ebfdff4d328cbc66217222d1c1df8329e2586b52
@@@ -1078,6 -1078,8 +1078,8 @@@ static int wil_bf_debugfs_show(struct s
                struct wmi_notify_req_done_event evt;
        } __packed reply;
  
+       memset(&reply, 0, sizeof(reply));
        for (i = 0; i < ARRAY_SIZE(wil->sta); i++) {
                u32 status;
  
@@@ -1200,12 -1202,8 +1202,12 @@@ static const struct file_operations fop
  static int wil_link_debugfs_show(struct seq_file *s, void *data)
  {
        struct wil6210_priv *wil = s->private;
 -      struct station_info sinfo;
 -      int i, rc;
 +      struct station_info *sinfo;
 +      int i, rc = 0;
 +
 +      sinfo = kzalloc(sizeof(*sinfo), GFP_KERNEL);
 +      if (!sinfo)
 +              return -ENOMEM;
  
        for (i = 0; i < ARRAY_SIZE(wil->sta); i++) {
                struct wil_sta_info *p = &wil->sta[i];
  
                vif = (mid < wil->max_vifs) ? wil->vifs[mid] : NULL;
                if (vif) {
 -                      rc = wil_cid_fill_sinfo(vif, i, &sinfo);
 +                      rc = wil_cid_fill_sinfo(vif, i, sinfo);
                        if (rc)
 -                              return rc;
 +                              goto out;
  
 -                      seq_printf(s, "  Tx_mcs = %d\n", sinfo.txrate.mcs);
 -                      seq_printf(s, "  Rx_mcs = %d\n", sinfo.rxrate.mcs);
 -                      seq_printf(s, "  SQ     = %d\n", sinfo.signal);
 +                      seq_printf(s, "  Tx_mcs = %d\n", sinfo->txrate.mcs);
 +                      seq_printf(s, "  Rx_mcs = %d\n", sinfo->rxrate.mcs);
 +                      seq_printf(s, "  SQ     = %d\n", sinfo->signal);
                } else {
                        seq_puts(s, "  INVALID MID\n");
                }
        }
  
 -      return 0;
 +out:
 +      kfree(sinfo);
 +      return rc;
  }
  
  static int wil_link_seq_open(struct inode *inode, struct file *file)
@@@ -1383,8 -1379,7 +1385,7 @@@ static void wil_print_rxtid(struct seq_
        u16 index = ((r->head_seq_num - r->ssn) & 0xfff) % r->buf_size;
        unsigned long long drop_dup = r->drop_dup, drop_old = r->drop_old;
  
-       seq_printf(s, "([%2d] %3d TU) 0x%03x [", r->buf_size, r->timeout,
-                  r->head_seq_num);
+       seq_printf(s, "([%2d]) 0x%03x [", r->buf_size, r->head_seq_num);
        for (i = 0; i < r->buf_size; i++) {
                if (i == index)
                        seq_printf(s, "%c", r->reorder_buf[i] ? 'O' : '|');
index 90de9a9162411e5ff76b3ac85ee382738a50d9d0,8a9bbd6bcea83b084e96e5bd5581ead6f277ade1..5d991243cdb59c341d5637dc20a82cbbc9f9f389
@@@ -824,7 -824,7 +824,7 @@@ static void wmi_evt_connect(struct wil6
        struct wireless_dev *wdev = vif_to_wdev(vif);
        struct wmi_connect_event *evt = d;
        int ch; /* channel number */
 -      struct station_info sinfo;
 +      struct station_info *sinfo;
        u8 *assoc_req_ie, *assoc_resp_ie;
        size_t assoc_req_ielen, assoc_resp_ielen;
        /* capinfo(u16) + listen_interval(u16) + IEs */
                vif->bss = NULL;
        } else if ((wdev->iftype == NL80211_IFTYPE_AP) ||
                   (wdev->iftype == NL80211_IFTYPE_P2P_GO)) {
 +
                if (rc) {
                        if (disable_ap_sme)
                                /* notify new_sta has failed */
                        goto out;
                }
  
 -              memset(&sinfo, 0, sizeof(sinfo));
 +              sinfo = kzalloc(sizeof(*sinfo), GFP_KERNEL);
 +              if (!sinfo) {
 +                      rc = -ENOMEM;
 +                      goto out;
 +              }
  
 -              sinfo.generation = wil->sinfo_gen++;
 +              sinfo->generation = wil->sinfo_gen++;
  
                if (assoc_req_ie) {
 -                      sinfo.assoc_req_ies = assoc_req_ie;
 -                      sinfo.assoc_req_ies_len = assoc_req_ielen;
 +                      sinfo->assoc_req_ies = assoc_req_ie;
 +                      sinfo->assoc_req_ies_len = assoc_req_ielen;
                }
  
 -              cfg80211_new_sta(ndev, evt->bssid, &sinfo, GFP_KERNEL);
 +              cfg80211_new_sta(ndev, evt->bssid, sinfo, GFP_KERNEL);
 +
 +              kfree(sinfo);
        } else {
                wil_err(wil, "unhandled iftype %d for CID %d\n", wdev->iftype,
                        evt->cid);
@@@ -1423,7 -1416,7 +1423,7 @@@ void wmi_recv_cmd(struct wil6210_priv *
  }
  
  int wmi_call(struct wil6210_priv *wil, u16 cmdid, u8 mid, void *buf, u16 len,
-            u16 reply_id, void *reply, u8 reply_size, int to_msec)
+            u16 reply_id, void *reply, u16 reply_size, int to_msec)
  {
        int rc;
        unsigned long remain;
@@@ -1516,7 -1509,9 +1516,9 @@@ int wmi_led_cfg(struct wil6210_priv *wi
        struct {
                struct wmi_cmd_hdr wmi;
                struct wmi_led_cfg_done_event evt;
-       } __packed reply;
+       } __packed reply = {
+               .evt = {.status = cpu_to_le32(WMI_FW_STATUS_FAILURE)},
+       };
  
        if (led_id == WIL_LED_INVALID_ID)
                goto out;
@@@ -1561,13 -1556,17 +1563,17 @@@ int wmi_pcp_start(struct wil6210_vif *v
                .pcp_max_assoc_sta = max_assoc_sta,
                .hidden_ssid = hidden_ssid,
                .is_go = is_go,
-               .disable_ap_sme = disable_ap_sme,
+               .ap_sme_offload_mode = disable_ap_sme ?
+                                      WMI_AP_SME_OFFLOAD_PARTIAL :
+                                      WMI_AP_SME_OFFLOAD_FULL,
                .abft_len = wil->abft_len,
        };
        struct {
                struct wmi_cmd_hdr wmi;
                struct wmi_pcp_started_event evt;
-       } __packed reply;
+       } __packed reply = {
+               .evt = {.status = WMI_FW_STATUS_FAILURE},
+       };
  
        if (!vif->privacy)
                cmd.disable_sec = 1;
        }
  
        if (disable_ap_sme &&
-           !test_bit(WMI_FW_CAPABILITY_DISABLE_AP_SME,
+           !test_bit(WMI_FW_CAPABILITY_AP_SME_OFFLOAD_PARTIAL,
                      wil->fw_capabilities)) {
                wil_err(wil, "disable_ap_sme not supported by FW\n");
                return -EOPNOTSUPP;
@@@ -1644,6 -1643,8 +1650,8 @@@ int wmi_get_ssid(struct wil6210_vif *vi
        } __packed reply;
        int len; /* reply.cmd.ssid_len in CPU order */
  
+       memset(&reply, 0, sizeof(reply));
        rc = wmi_call(wil, WMI_GET_SSID_CMDID, vif->mid, NULL, 0,
                      WMI_GET_SSID_EVENTID, &reply, sizeof(reply), 20);
        if (rc)
@@@ -1679,6 -1680,8 +1687,8 @@@ int wmi_get_channel(struct wil6210_pri
                struct wmi_set_pcp_channel_cmd cmd;
        } __packed reply;
  
+       memset(&reply, 0, sizeof(reply));
        rc = wmi_call(wil, WMI_GET_PCP_CHANNEL_CMDID, vif->mid, NULL, 0,
                      WMI_GET_PCP_CHANNEL_EVENTID, &reply, sizeof(reply), 20);
        if (rc)
@@@ -1704,7 -1707,9 +1714,9 @@@ int wmi_p2p_cfg(struct wil6210_vif *vif
        struct {
                struct wmi_cmd_hdr wmi;
                struct wmi_p2p_cfg_done_event evt;
-       } __packed reply;
+       } __packed reply = {
+               .evt = {.status = WMI_FW_STATUS_FAILURE},
+       };
  
        wil_dbg_wmi(wil, "sending WMI_P2P_CFG_CMDID\n");
  
@@@ -1725,7 -1730,9 +1737,9 @@@ int wmi_start_listen(struct wil6210_vi
        struct {
                struct wmi_cmd_hdr wmi;
                struct wmi_listen_started_event evt;
-       } __packed reply;
+       } __packed reply = {
+               .evt = {.status = WMI_FW_STATUS_FAILURE},
+       };
  
        wil_dbg_wmi(wil, "sending WMI_START_LISTEN_CMDID\n");
  
@@@ -1747,7 -1754,9 +1761,9 @@@ int wmi_start_search(struct wil6210_vi
        struct {
                struct wmi_cmd_hdr wmi;
                struct wmi_search_started_event evt;
-       } __packed reply;
+       } __packed reply = {
+               .evt = {.status = WMI_FW_STATUS_FAILURE},
+       };
  
        wil_dbg_wmi(wil, "sending WMI_START_SEARCH_CMDID\n");
  
@@@ -1873,7 -1882,9 +1889,9 @@@ int wmi_rxon(struct wil6210_priv *wil, 
        struct {
                struct wmi_cmd_hdr wmi;
                struct wmi_listen_started_event evt;
-       } __packed reply;
+       } __packed reply = {
+               .evt = {.status = WMI_FW_STATUS_FAILURE},
+       };
  
        wil_info(wil, "(%s)\n", on ? "on" : "off");
  
@@@ -1915,6 -1926,8 +1933,8 @@@ int wmi_rx_chain_add(struct wil6210_pri
        } __packed evt;
        int rc;
  
+       memset(&evt, 0, sizeof(evt));
        if (wdev->iftype == NL80211_IFTYPE_MONITOR) {
                struct ieee80211_channel *ch = wil->monitor_chandef.chan;
  
        if (rc)
                return rc;
  
+       if (le32_to_cpu(evt.evt.status) != WMI_CFG_RX_CHAIN_SUCCESS)
+               rc = -EINVAL;
        vring->hwtail = le32_to_cpu(evt.evt.rx_ring_tail_ptr);
  
        wil_dbg_misc(wil, "Rx init: status %d tail 0x%08x\n",
                     le32_to_cpu(evt.evt.status), vring->hwtail);
  
-       if (le32_to_cpu(evt.evt.status) != WMI_CFG_RX_CHAIN_SUCCESS)
-               rc = -EINVAL;
        return rc;
  }
  
@@@ -1969,6 -1982,8 +1989,8 @@@ int wmi_get_temperature(struct wil6210_
                struct wmi_temp_sense_done_event evt;
        } __packed reply;
  
+       memset(&reply, 0, sizeof(reply));
        rc = wmi_call(wil, WMI_TEMP_SENSE_CMDID, vif->mid, &cmd, sizeof(cmd),
                      WMI_TEMP_SENSE_DONE_EVENTID, &reply, sizeof(reply), 100);
        if (rc)
@@@ -2001,6 -2016,7 +2023,7 @@@ int wmi_disconnect_sta(struct wil6210_v
  
        wil_dbg_wmi(wil, "disconnect_sta: (%pM, reason %d)\n", mac, reason);
  
+       memset(&reply, 0, sizeof(reply));
        vif->locally_generated_disc = true;
        if (del_sta) {
                ether_addr_copy(del_sta_cmd.dst_mac, mac);
@@@ -2099,7 -2115,9 +2122,9 @@@ int wmi_addba_rx_resp(struct wil6210_pr
        struct {
                struct wmi_cmd_hdr wmi;
                struct wmi_rcp_addba_resp_sent_event evt;
-       } __packed reply;
+       } __packed reply = {
+               .evt = {.status = cpu_to_le16(WMI_FW_STATUS_FAILURE)},
+       };
  
        wil_dbg_wmi(wil,
                    "ADDBA response for MID %d CID %d TID %d size %d timeout %d status %d AMSDU%s\n",
@@@ -2132,13 -2150,13 +2157,13 @@@ int wmi_ps_dev_profile_cfg(struct wil62
        struct {
                struct wmi_cmd_hdr wmi;
                struct wmi_ps_dev_profile_cfg_event evt;
-       } __packed reply;
+       } __packed reply = {
+               .evt = {.status = cpu_to_le32(WMI_PS_CFG_CMD_STATUS_ERROR)},
+       };
        u32 status;
  
        wil_dbg_wmi(wil, "Setting ps dev profile %d\n", ps_profile);
  
-       reply.evt.status = cpu_to_le32(WMI_PS_CFG_CMD_STATUS_ERROR);
        rc = wmi_call(wil, WMI_PS_DEV_PROFILE_CFG_CMDID, vif->mid,
                      &cmd, sizeof(cmd),
                      WMI_PS_DEV_PROFILE_CFG_EVENTID, &reply, sizeof(reply),
@@@ -2167,15 -2185,15 +2192,15 @@@ int wmi_set_mgmt_retry(struct wil6210_p
        struct {
                struct wmi_cmd_hdr wmi;
                struct wmi_set_mgmt_retry_limit_event evt;
-       } __packed reply;
+       } __packed reply = {
+               .evt = {.status = WMI_FW_STATUS_FAILURE},
+       };
  
        wil_dbg_wmi(wil, "Setting mgmt retry short %d\n", retry_short);
  
        if (!test_bit(WMI_FW_CAPABILITY_MGMT_RETRY_LIMIT, wil->fw_capabilities))
                return -ENOTSUPP;
  
-       reply.evt.status = WMI_FW_STATUS_FAILURE;
        rc = wmi_call(wil, WMI_SET_MGMT_RETRY_LIMIT_CMDID, vif->mid,
                      &cmd, sizeof(cmd),
                      WMI_SET_MGMT_RETRY_LIMIT_EVENTID, &reply, sizeof(reply),
@@@ -2206,7 -2224,7 +2231,7 @@@ int wmi_get_mgmt_retry(struct wil6210_p
        if (!test_bit(WMI_FW_CAPABILITY_MGMT_RETRY_LIMIT, wil->fw_capabilities))
                return -ENOTSUPP;
  
-       reply.evt.mgmt_retry_limit = 0;
+       memset(&reply, 0, sizeof(reply));
        rc = wmi_call(wil, WMI_GET_MGMT_RETRY_LIMIT_CMDID, vif->mid, NULL, 0,
                      WMI_GET_MGMT_RETRY_LIMIT_EVENTID, &reply, sizeof(reply),
                      100);
@@@ -2289,14 -2307,15 +2314,15 @@@ int wmi_suspend(struct wil6210_priv *wi
        struct {
                struct wmi_cmd_hdr wmi;
                struct wmi_traffic_suspend_event evt;
-       } __packed reply;
+       } __packed reply = {
+               .evt = {.status = WMI_TRAFFIC_SUSPEND_REJECTED_LINK_NOT_IDLE},
+       };
        u32 suspend_to = WIL_WAIT_FOR_SUSPEND_RESUME_COMP;
  
        wil->suspend_resp_rcvd = false;
        wil->suspend_resp_comp = false;
  
-       reply.evt.status = WMI_TRAFFIC_SUSPEND_REJECTED_LINK_NOT_IDLE;
        rc = wmi_call(wil, WMI_TRAFFIC_SUSPEND_CMDID, vif->mid,
                      &cmd, sizeof(cmd),
                      WMI_TRAFFIC_SUSPEND_EVENTID, &reply, sizeof(reply),
@@@ -2372,10 -2391,11 +2398,11 @@@ int wmi_resume(struct wil6210_priv *wil
        struct {
                struct wmi_cmd_hdr wmi;
                struct wmi_traffic_resume_event evt;
-       } __packed reply;
-       reply.evt.status = WMI_TRAFFIC_RESUME_FAILED;
-       reply.evt.resume_triggers = WMI_RESUME_TRIGGER_UNKNOWN;
+       } __packed reply = {
+               .evt = {.status = WMI_TRAFFIC_RESUME_FAILED,
+                       .resume_triggers =
+                               cpu_to_le32(WMI_RESUME_TRIGGER_UNKNOWN)},
+       };
  
        rc = wmi_call(wil, WMI_TRAFFIC_RESUME_CMDID, vif->mid, NULL, 0,
                      WMI_TRAFFIC_RESUME_EVENTID, &reply, sizeof(reply),
@@@ -2401,7 -2421,9 +2428,9 @@@ int wmi_port_allocate(struct wil6210_pr
        struct {
                struct wmi_cmd_hdr wmi;
                struct wmi_port_allocated_event evt;
-       } __packed reply;
+       } __packed reply = {
+               .evt = {.status = WMI_FW_STATUS_FAILURE},
+       };
  
        wil_dbg_misc(wil, "port allocate, mid %d iftype %d, mac %pM\n",
                     mid, iftype, mac);
                return -EINVAL;
        }
  
-       reply.evt.status = WMI_FW_STATUS_FAILURE;
        rc = wmi_call(wil, WMI_PORT_ALLOCATE_CMDID, mid,
                      &cmd, sizeof(cmd),
                      WMI_PORT_ALLOCATED_EVENTID, &reply,
@@@ -2454,12 -2474,12 +2481,12 @@@ int wmi_port_delete(struct wil6210_pri
        struct {
                struct wmi_cmd_hdr wmi;
                struct wmi_port_deleted_event evt;
-       } __packed reply;
+       } __packed reply = {
+               .evt = {.status = WMI_FW_STATUS_FAILURE},
+       };
  
        wil_dbg_misc(wil, "port delete, mid %d\n", mid);
  
-       reply.evt.status = WMI_FW_STATUS_FAILURE;
        rc = wmi_call(wil, WMI_PORT_DELETE_CMDID, mid,
                      &cmd, sizeof(cmd),
                      WMI_PORT_DELETED_EVENTID, &reply,
@@@ -2716,7 -2736,9 +2743,9 @@@ int wmi_start_sched_scan(struct wil6210
        struct {
                struct wmi_cmd_hdr wmi;
                struct wmi_start_sched_scan_event evt;
-       } __packed reply;
+       } __packed reply = {
+               .evt = {.result = WMI_PNO_REJECT},
+       };
  
        if (!test_bit(WMI_FW_CAPABILITY_PNO, wil->fw_capabilities))
                return -ENOTSUPP;
        wmi_sched_scan_set_plans(wil, &cmd,
                                 request->scan_plans, request->n_scan_plans);
  
-       reply.evt.result = WMI_PNO_REJECT;
        rc = wmi_call(wil, WMI_START_SCHED_SCAN_CMDID, vif->mid,
                      &cmd, sizeof(cmd),
                      WMI_START_SCHED_SCAN_EVENTID, &reply, sizeof(reply),
@@@ -2757,13 -2777,13 +2784,13 @@@ int wmi_stop_sched_scan(struct wil6210_
        struct {
                struct wmi_cmd_hdr wmi;
                struct wmi_stop_sched_scan_event evt;
-       } __packed reply;
+       } __packed reply = {
+               .evt = {.result = WMI_PNO_REJECT},
+       };
  
        if (!test_bit(WMI_FW_CAPABILITY_PNO, wil->fw_capabilities))
                return -ENOTSUPP;
  
-       reply.evt.result = WMI_PNO_REJECT;
        rc = wmi_call(wil, WMI_STOP_SCHED_SCAN_CMDID, vif->mid, NULL, 0,
                      WMI_STOP_SCHED_SCAN_EVENTID, &reply, sizeof(reply),
                      WIL_WMI_CALL_GENERAL_TO_MS);
  
        return 0;
  }
+ int wmi_mgmt_tx(struct wil6210_vif *vif, const u8 *buf, size_t len)
+ {
+       size_t total;
+       struct wil6210_priv *wil = vif_to_wil(vif);
+       struct ieee80211_mgmt *mgmt_frame = (void *)buf;
+       struct wmi_sw_tx_req_cmd *cmd;
+       struct {
+               struct wmi_cmd_hdr wmi;
+               struct wmi_sw_tx_complete_event evt;
+       } __packed evt = {
+               .evt = {.status = WMI_FW_STATUS_FAILURE},
+       };
+       int rc;
+       wil_dbg_misc(wil, "mgmt_tx mid %d\n", vif->mid);
+       wil_hex_dump_misc("mgmt tx frame ", DUMP_PREFIX_OFFSET, 16, 1, buf,
+                         len, true);
+       if (len < sizeof(struct ieee80211_hdr_3addr))
+               return -EINVAL;
+       total = sizeof(*cmd) + len;
+       if (total < len) {
+               wil_err(wil, "mgmt_tx invalid len %zu\n", len);
+               return -EINVAL;
+       }
+       cmd = kmalloc(total, GFP_KERNEL);
+       if (!cmd)
+               return -ENOMEM;
+       memcpy(cmd->dst_mac, mgmt_frame->da, WMI_MAC_LEN);
+       cmd->len = cpu_to_le16(len);
+       memcpy(cmd->payload, buf, len);
+       rc = wmi_call(wil, WMI_SW_TX_REQ_CMDID, vif->mid, cmd, total,
+                     WMI_SW_TX_COMPLETE_EVENTID, &evt, sizeof(evt), 2000);
+       if (!rc && evt.evt.status != WMI_FW_STATUS_SUCCESS) {
+               wil_err(wil, "mgmt_tx failed with status %d\n", evt.evt.status);
+               rc = -EINVAL;
+       }
+       kfree(cmd);
+       return rc;
+ }