diff options
| author | Padma, Santhosh Kumar <skpadma@codeaurora.org> | 2017-03-21 19:09:35 +0530 |
|---|---|---|
| committer | Padma, Santhosh Kumar <skpadma@codeaurora.org> | 2017-05-02 12:28:00 +0530 |
| commit | df24d8b83eae4d3bcf8b362df41dc91e82b57109 (patch) | |
| tree | ee2f6b0c26d085293b22989367a10479ebc1601c | |
| parent | e38e083ddbba8d9931fe1d39efb7d0facc318a3c (diff) | |
qcacmn: Get CCA from firmware
Requirement is to get CCA from frmware when connection fails due to
assoc/auth/probe response timeout. These are common changes to get
CCA from firmware.
Change-Id: I062343ed065d7b0c38b9e3b24ecfa9851b9b1537
CRs-Fixed: 2031843
| -rw-r--r-- | wmi/inc/wmi_unified_api.h | 10 | ||||
| -rw-r--r-- | wmi/inc/wmi_unified_priv.h | 3 | ||||
| -rw-r--r-- | wmi/inc/wmi_unified_tlv.h | 10 | ||||
| -rw-r--r-- | wmi/src/wmi_unified_api.c | 19 | ||||
| -rw-r--r-- | wmi/src/wmi_unified_tlv.c | 46 |
5 files changed, 88 insertions, 0 deletions
diff --git a/wmi/inc/wmi_unified_api.h b/wmi/inc/wmi_unified_api.h index 36213899eb62..62e06ab6bd05 100644 --- a/wmi/inc/wmi_unified_api.h +++ b/wmi/inc/wmi_unified_api.h @@ -631,6 +631,16 @@ QDF_STATUS wmi_unified_get_stats_cmd(void *wmi_hdl, struct pe_stats_req *get_stats_param, uint8_t addr[IEEE80211_ADDR_LEN]); +/** + * wmi_unified_congestion_request_cmd() - send request to fw to get CCA + * @wmi_hdl: wma handle + * @vdev_id: vdev id + * + * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure + */ +QDF_STATUS wmi_unified_congestion_request_cmd(void *wmi_hdl, + uint8_t vdev_id); + QDF_STATUS wmi_unified_snr_request_cmd(void *wmi_hdl); QDF_STATUS wmi_unified_snr_cmd(void *wmi_hdl, uint8_t vdev_id); diff --git a/wmi/inc/wmi_unified_priv.h b/wmi/inc/wmi_unified_priv.h index 433960bb9e21..24cfb6975cb4 100644 --- a/wmi/inc/wmi_unified_priv.h +++ b/wmi/inc/wmi_unified_priv.h @@ -467,6 +467,9 @@ QDF_STATUS (*send_get_stats_cmd)(wmi_unified_t wmi_handle, struct pe_stats_req *get_stats_param, uint8_t addr[IEEE80211_ADDR_LEN]); +QDF_STATUS (*send_congestion_cmd)(wmi_unified_t wmi_handle, + A_UINT8 vdev_id); + QDF_STATUS (*send_snr_request_cmd)(wmi_unified_t wmi_handle); QDF_STATUS (*send_snr_cmd)(wmi_unified_t wmi_handle, uint8_t vdev_id); diff --git a/wmi/inc/wmi_unified_tlv.h b/wmi/inc/wmi_unified_tlv.h index 0d54f81bcd65..51f616193549 100644 --- a/wmi/inc/wmi_unified_tlv.h +++ b/wmi/inc/wmi_unified_tlv.h @@ -324,6 +324,16 @@ QDF_STATUS send_get_stats_cmd_tlv(wmi_unified_t wmi_handle, struct pe_stats_req *get_stats_param, uint8_t addr[IEEE80211_ADDR_LEN]); +/** + * send_congestion_cmd_tlv() - send request to fw to get CCA + * @wmi_handle: wmi handle + * @vdev_id: vdev id + * + * Return: CDF status + */ +QDF_STATUS send_congestion_cmd_tlv(wmi_unified_t wmi_handle, + A_UINT8 vdev_id); + QDF_STATUS send_snr_request_cmd_tlv(wmi_unified_t wmi_handle); QDF_STATUS send_snr_cmd_tlv(wmi_unified_t wmi_handle, uint8_t vdev_id); diff --git a/wmi/src/wmi_unified_api.c b/wmi/src/wmi_unified_api.c index c48920b4ddc0..e9c085c8c268 100644 --- a/wmi/src/wmi_unified_api.c +++ b/wmi/src/wmi_unified_api.c @@ -1940,6 +1940,25 @@ QDF_STATUS wmi_unified_get_stats_cmd(void *wmi_hdl, } /** + * wmi_unified_congestion_request_cmd() - send request to fw to get CCA + * @wmi_hdl: wma handle + * @vdev_id: vdev id + * + * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure + */ +QDF_STATUS wmi_unified_congestion_request_cmd(void *wmi_hdl, + uint8_t vdev_id) +{ + wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; + + if (wmi_handle->ops->send_congestion_cmd) + return wmi_handle->ops->send_congestion_cmd(wmi_handle, + vdev_id); + + return QDF_STATUS_E_FAILURE; +} + +/** * wmi_unified_process_ll_stats_set_cmd() - link layer stats set request * @wmi_handle: wmi handle * @set_req: ll stats set request command params diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c index 0ad31cf2d21a..f6f4184f5d75 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/wmi/src/wmi_unified_tlv.c @@ -6674,6 +6674,51 @@ QDF_STATUS send_get_stats_cmd_tlv(wmi_unified_t wmi_handle, } /** + * send_congestion_cmd_tlv() - send request to fw to get CCA + * @wmi_handle: wmi handle + * @vdev_id: vdev id + * + * Return: CDF status + */ +QDF_STATUS send_congestion_cmd_tlv(wmi_unified_t wmi_handle, + A_UINT8 vdev_id) +{ + wmi_buf_t buf; + wmi_request_stats_cmd_fixed_param *cmd; + uint8_t len; + uint8_t *buf_ptr; + + len = sizeof(*cmd); + buf = wmi_buf_alloc(wmi_handle, len); + if (!buf) { + WMI_LOGE("%s: Failed to allocate wmi buffer", __func__); + return QDF_STATUS_E_FAILURE; + } + + buf_ptr = wmi_buf_data(buf); + cmd = (wmi_request_stats_cmd_fixed_param *)buf_ptr; + WMITLV_SET_HDR(&cmd->tlv_header, + WMITLV_TAG_STRUC_wmi_request_stats_cmd_fixed_param, + WMITLV_GET_STRUCT_TLVLEN + (wmi_request_stats_cmd_fixed_param)); + + cmd->stats_id = WMI_REQUEST_CONGESTION_STAT; + cmd->vdev_id = vdev_id; + WMI_LOGD("STATS REQ VDEV_ID:%d stats_id %d -->", + cmd->vdev_id, cmd->stats_id); + + if (wmi_unified_cmd_send(wmi_handle, buf, len, + WMI_REQUEST_STATS_CMDID)) { + WMI_LOGE("%s: Failed to send WMI_REQUEST_STATS_CMDID", + __func__); + wmi_buf_free(buf); + return QDF_STATUS_E_FAILURE; + } + + return QDF_STATUS_SUCCESS; +} + +/** * send_snr_request_cmd_tlv() - send request to fw to get RSSI stats * @wmi_handle: wmi handle * @rssi_req: get RSSI request @@ -13182,6 +13227,7 @@ struct wmi_ops tlv_ops = { .send_process_ll_stats_set_cmd = send_process_ll_stats_set_cmd_tlv, .send_process_ll_stats_get_cmd = send_process_ll_stats_get_cmd_tlv, .send_get_stats_cmd = send_get_stats_cmd_tlv, + .send_congestion_cmd = send_congestion_cmd_tlv, .send_snr_request_cmd = send_snr_request_cmd_tlv, .send_snr_cmd = send_snr_cmd_tlv, .send_link_status_req_cmd = send_link_status_req_cmd_tlv, |
