diff options
| author | Atul Mittal <atulmt@qti.qualcomm.com> | 2014-10-01 14:44:25 +0530 |
|---|---|---|
| committer | AnjaneeDevi Kapparapu <c_akappa@qti.qualcomm.com> | 2014-10-15 18:43:58 +0530 |
| commit | 7abff417ef3d222557e8190ec6c45f07c1078688 (patch) | |
| tree | 53e73cb4e91fbe56437b38a555bc902b8db815b1 | |
| parent | 59ece792b32ec85112c1dd48d4330cb91dec7b75 (diff) | |
qcacld: TDLS: Driver ioctl for off channel commands
TDLS Off Channel ioctl support host side implementation.
This ioctl will provide the parameters to f/w for switching
to target channel as needed by certification test.
(part 2 WMA)
Change-Id: I0adf90755c69e09d5cb812d6c5637583e04d99a5
CRs-fixed: 719234
| -rw-r--r-- | CORE/SERVICES/WMA/wma.c | 72 | ||||
| -rw-r--r-- | CORE/WDA/inc/legacy/halMsgApi.h | 11 | ||||
| -rw-r--r-- | CORE/WDA/inc/wlan_qct_wda.h | 7 |
3 files changed, 90 insertions, 0 deletions
diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c index 0c67398cb2c8..fa2a9133ceac 100644 --- a/CORE/SERVICES/WMA/wma.c +++ b/CORE/SERVICES/WMA/wma.c @@ -289,6 +289,8 @@ static eHalStatus wma_set_mimops(tp_wma_handle wma_handle, static int wma_update_fw_tdls_state(WMA_HANDLE handle, void *pwmaTdlsparams); static int wma_update_tdls_peer_state(WMA_HANDLE handle, tTdlsPeerStateParams *peerStateParams); +static int wma_set_tdls_offchan_mode(WMA_HANDLE wma_handle, + tTdlsChanSwitchParams *pChanSwitchParams); #endif static eHalStatus wma_set_smps_params(tp_wma_handle wma_handle, @@ -22366,6 +22368,10 @@ VOS_STATUS wma_mc_process_msg(v_VOID_t *vos_context, vos_msg_t *msg) wma_update_tdls_peer_state(wma_handle, (tTdlsPeerStateParams *)msg->bodyptr); break; + case WDA_TDLS_SET_OFFCHAN_MODE: + wma_set_tdls_offchan_mode(wma_handle, + (tTdlsChanSwitchParams*)msg->bodyptr); + break; #endif /* FEATURE_WLAN_TDLS */ #ifdef FEATURE_WLAN_BATCH_SCAN case WDA_SET_BATCH_SCAN_REQ: @@ -26284,6 +26290,72 @@ pkt_pwr_save_config: } #ifdef FEATURE_WLAN_TDLS +static int wma_set_tdls_offchan_mode(WMA_HANDLE handle, + tTdlsChanSwitchParams* pChanSwitchParams) +{ + tp_wma_handle wma_handle = (tp_wma_handle) handle; + wmi_tdls_set_offchan_mode_cmd_fixed_param* cmd; + wmi_buf_t wmi_buf; + u_int16_t len = sizeof(wmi_tdls_set_offchan_mode_cmd_fixed_param); + int ret = 0; + + if (!wma_handle || !wma_handle->wmi_handle) { + WMA_LOGE("%s: WMA is closed, can not issue tdls off channel cmd", + __func__); + ret = -EINVAL; + goto end; + } + wmi_buf = wmi_buf_alloc(wma_handle->wmi_handle, len); + if (!wmi_buf) { + WMA_LOGE("%s: wmai_buf_alloc failed", __func__); + ret = -ENOMEM; + goto end; + } + cmd = (wmi_tdls_set_offchan_mode_cmd_fixed_param*)wmi_buf_data(wmi_buf); + WMITLV_SET_HDR(&cmd->tlv_header, + WMITLV_TAG_STRUC_wmi_tdls_set_offchan_mode_cmd_fixed_param, + WMITLV_GET_STRUCT_TLVLEN(wmi_tdls_set_offchan_mode_cmd_fixed_param)); + + WMI_CHAR_ARRAY_TO_MAC_ADDR(pChanSwitchParams->peerMacAddr, + &cmd->peer_macaddr); + cmd->vdev_id = pChanSwitchParams->vdevId; + cmd->offchan_mode = pChanSwitchParams->tdlsSwMode; + cmd->is_peer_responder = pChanSwitchParams->is_responder; + cmd->offchan_num = pChanSwitchParams->tdlsOffCh; + cmd->offchan_bw_bitmap = pChanSwitchParams->tdlsOffChBwOffset; + cmd->offchan_oper_class = pChanSwitchParams->operClass; + + WMA_LOGD("%s: Peer MAC Addr mac_addr31to0: 0x%x, " + "mac_addr47to32: 0x%x", + __func__, cmd->peer_macaddr.mac_addr31to0, + cmd->peer_macaddr.mac_addr47to32); + + WMA_LOGD("%s: vdev_id: %d, " + "off channel mode: %d, " + "off channel Num: %d, " + "off channel offset: 0x%x, " + "is_peer_responder: %d, " + "operating class: %d, ", + __func__, cmd->vdev_id, + cmd->offchan_mode, + cmd->offchan_num, + cmd->offchan_bw_bitmap, + cmd->is_peer_responder, + cmd->offchan_oper_class); + + if (wmi_unified_cmd_send(wma_handle->wmi_handle, wmi_buf, len, + WMI_TDLS_SET_OFFCHAN_MODE_CMDID)) { + WMA_LOGP("%s: failed to send tdls off chan command", __func__); + adf_nbuf_free(wmi_buf); + ret = -EIO; + } + +end: + if (pChanSwitchParams) + vos_mem_free(pChanSwitchParams); + return ret; +} + /* wmi tdls command sent to firmware to enable/disable tdls for a vdev */ static int wma_update_fw_tdls_state(WMA_HANDLE handle, void *pwmaTdlsparams) { diff --git a/CORE/WDA/inc/legacy/halMsgApi.h b/CORE/WDA/inc/legacy/halMsgApi.h index 963da5e9ffed..3f60751440fa 100644 --- a/CORE/WDA/inc/legacy/halMsgApi.h +++ b/CORE/WDA/inc/legacy/halMsgApi.h @@ -1443,6 +1443,17 @@ typedef struct sTdlsPeerStateParams tANI_U32 peerState; tTdlsPeerCapParams peerCap; }tTdlsPeerStateParams; + +typedef struct sTdlsChanSwitchParams +{ + tANI_U32 vdevId; + tSirMacAddr peerMacAddr; + tANI_U16 tdlsOffChBwOffset;/* Target Off Channel Bandwidth offset */ + tANI_U8 tdlsOffCh; /* Target Off Channel */ + tANI_U8 tdlsSwMode; /* TDLS Off Channel Mode */ + tANI_U8 operClass; /* Operating class corresponding to target channel */ + tANI_U8 is_responder;/* responder or initiator */ +}tTdlsChanSwitchParams; #endif /* FEATURE_WLAN_TDLS */ typedef struct sAbortScanParams diff --git a/CORE/WDA/inc/wlan_qct_wda.h b/CORE/WDA/inc/wlan_qct_wda.h index bacf00613863..6bb36962885e 100644 --- a/CORE/WDA/inc/wlan_qct_wda.h +++ b/CORE/WDA/inc/wlan_qct_wda.h @@ -136,6 +136,12 @@ typedef enum WDA_TDLS_PEER_STATE_CONNECTED, WDA_TDLS_PEER_STATE_TEARDOWN, } WDA_TdlsPeerState; +/* WMI_TDLS_SET_OFFCHAN_MODE_CMDID */ +typedef enum +{ + WDA_TDLS_ENABLE_OFFCHANNEL, + WDA_TDLS_DISABLE_OFFCHANNEL +}WDA_TdlsOffchanMode; #endif /* FEATURE_WLAN_TDLS */ /*-------------------------------------------------------------------------- @@ -925,6 +931,7 @@ tSirRetStatus uMacPostCtrlMsg(void* pSirGlobal, tSirMbMsg* pMb); #define WDA_TDLS_SHOULD_DISCOVER SIR_HAL_TDLS_SHOULD_DISCOVER #define WDA_TDLS_SHOULD_TEARDOWN SIR_HAL_TDLS_SHOULD_TEARDOWN #define WDA_TDLS_PEER_DISCONNECTED SIR_HAL_TDLS_PEER_DISCONNECTED +#define WDA_TDLS_SET_OFFCHAN_MODE SIR_HAL_TDLS_SET_OFFCHAN_MODE #endif #define WDA_SET_SAP_INTRABSS_DIS SIR_HAL_SET_SAP_INTRABSS_DIS |
