summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeela Venkata Kiran Kumar Reddy Chirala <kchirala@qca.qualcomm.com>2014-10-28 19:33:56 -0700
committerAnjaneeDevi Kapparapu <c_akappa@qti.qualcomm.com>2014-10-29 15:02:01 +0530
commit9c8a4b2d0b0edcdf501b3f928efc31a556edda8f (patch)
treefc218343f2413dfff9a640c893ef89f012e49673
parentde034f19a4d3277c33c9c389608675ec9366e570 (diff)
WLAN:Force Roaming to given Bssid
For 11r certification STA needs to roam to the given bssid. Add support in the host driver to force roam to given bssid. Change-Id: Ie78747184fe8d6bdaa58a0b1818c09ce07970642 CRs-fixed: 747293
-rwxr-xr-xCORE/HDD/src/wlan_hdd_main.c37
-rw-r--r--CORE/MAC/src/include/sirParams.h1
-rw-r--r--CORE/SERVICES/WMA/wma.c63
-rw-r--r--CORE/SERVICES/WMA/wma.h7
4 files changed, 107 insertions, 1 deletions
diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c
index 0b737f40e339..9f9875385c60 100755
--- a/CORE/HDD/src/wlan_hdd_main.c
+++ b/CORE/HDD/src/wlan_hdd_main.c
@@ -295,6 +295,10 @@ extern int hdd_ftm_stop(hdd_context_t *pHddCtx);
#ifdef FEATURE_WLAN_AUTO_SHUTDOWN
v_VOID_t wlan_hdd_auto_shutdown_cb(v_VOID_t);
#endif
+#ifdef WLAN_FEATURE_ROAM_OFFLOAD
+static void wma_send_fastreassoc_cmd(int sessionId, tSirMacAddr bssId,
+ int channel);
+#endif
/* Store WLAN driver version info in a global variable such that crash debugger
can extract it from driver debug symbol and crashdump for post processing */
@@ -5204,7 +5208,13 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter,
"%s: Invalid Channel [%d] \n", __func__, channel);
return -EINVAL;
}
-
+#ifdef WLAN_FEATURE_ROAM_OFFLOAD
+ if (pHddCtx->cfg_ini->isRoamOffloadEnabled) {
+ wma_send_fastreassoc_cmd(pAdapter->sessionId, targetApBssid,
+ channel);
+ goto exit;
+ }
+#endif
/* Proceed with reassoc */
#ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD
handoffInfo.channel = channel;
@@ -14095,6 +14105,31 @@ void wlan_hdd_check_sta_ap_concurrent_ch_intf(void *data)
#endif
+#ifdef WLAN_FEATURE_ROAM_OFFLOAD
+void wma_send_fastreassoc_cmd(int sessionId, tSirMacAddr bssId, int channel)
+{
+ t_wma_roam_invoke_cmd *fastReassoc;
+ vos_msg_t msg = {0};
+
+ fastReassoc = vos_mem_malloc(sizeof(*fastReassoc));
+ if (NULL == fastReassoc) {
+ hddLog(LOGE, FL("vos_mem_alloc failed for fastReassoc"));
+ }
+ fastReassoc->vdev_id = sessionId;
+ fastReassoc->channel = channel;
+ vos_mem_copy(fastReassoc->bssId, bssId, sizeof( tSirMacAddr ));
+
+ msg.type = SIR_HAL_ROAM_INVOKE;
+ msg.reserved = 0;
+ msg.bodyptr = fastReassoc;
+ if (VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA,
+ &msg)) {
+ vos_mem_free(fastReassoc);
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
+ FL("Not able to post ROAM_INVOKE_CMD message to WDA"));
+ }
+}
+#endif
//Register the module init/exit functions
module_init(hdd_module_init);
module_exit(hdd_module_exit);
diff --git a/CORE/MAC/src/include/sirParams.h b/CORE/MAC/src/include/sirParams.h
index 7da0f18f60b6..9366d2bc3ed0 100644
--- a/CORE/MAC/src/include/sirParams.h
+++ b/CORE/MAC/src/include/sirParams.h
@@ -671,6 +671,7 @@ typedef struct sSirMbMsgP2p
#ifdef WLAN_FEATURE_ROAM_OFFLOAD
#define SIR_HAL_ROAM_OFFLOAD_SYNCH_FAIL (SIR_HAL_ITC_MSG_TYPES_BEGIN + 296)
+#define SIR_HAL_ROAM_INVOKE (SIR_HAL_ITC_MSG_TYPES_BEGIN + 297)
#endif
#define SIR_HAL_MSG_TYPES_END (SIR_HAL_MSG_TYPES_BEGIN + 0x1FF)
diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c
index f8556aed0ffe..0225c953e6bd 100644
--- a/CORE/SERVICES/WMA/wma.c
+++ b/CORE/SERVICES/WMA/wma.c
@@ -337,6 +337,8 @@ void wma_process_roam_synch_complete(WMA_HANDLE handle,
tSirSmeRoamOffloadSynchCnf *synchcnf);
void wma_process_roam_synch_fail(WMA_HANDLE handle,
tSirRoamOffloadSynchFail *synchfail);
+void wma_process_roam_invoke(WMA_HANDLE handle,
+ t_wma_roam_invoke_cmd *roaminvoke);
#endif
/* Configure the regulatory domain for DFS radar filter initialization*/
void wma_set_dfs_regdomain(tp_wma_handle wma);
@@ -22649,6 +22651,11 @@ VOS_STATUS wma_mc_process_msg(v_VOID_t *vos_context, vos_msg_t *msg)
(tSirRoamOffloadSynchFail *)msg->bodyptr);
vos_mem_free(msg->bodyptr);
break;
+ case SIR_HAL_ROAM_INVOKE:
+ wma_process_roam_invoke(wma_handle,
+ (t_wma_roam_invoke_cmd *)msg->bodyptr);
+ vos_mem_free(msg->bodyptr);
+ break;
#endif
#ifdef WLAN_FEATURE_NAN
case WDA_NAN_REQUEST:
@@ -27441,4 +27448,60 @@ void wma_process_roam_synch_fail(WMA_HANDLE handle,
VOS_FALSE;
adf_os_spin_unlock_bh(&wma_handle->roam_synch_lock);
}
+void wma_process_roam_invoke(WMA_HANDLE handle,
+ t_wma_roam_invoke_cmd *roaminvoke)
+{
+ tp_wma_handle wma_handle = (tp_wma_handle) handle;
+ wmi_roam_invoke_cmd_fixed_param* cmd;
+ wmi_buf_t wmi_buf;
+ u_int8_t *buf_ptr;
+ u_int16_t len, args_tlv_len;
+ A_UINT32 *channel_list;
+ wmi_mac_addr *bssid_list;
+
+ if (!wma_handle || !wma_handle->wmi_handle) {
+ WMA_LOGE("%s: WMA is closed, can not send roam invoke",
+ __func__);
+ return;
+ }
+ /* Host sends only one channel and one bssid */
+ args_tlv_len = 2 * WMI_TLV_HDR_SIZE + sizeof(A_UINT32) +
+ sizeof(wmi_mac_addr);
+ len = sizeof(wmi_roam_invoke_cmd_fixed_param) + args_tlv_len;
+ wmi_buf = wmi_buf_alloc(wma_handle->wmi_handle, len);
+ if (!wmi_buf) {
+ WMA_LOGE("%s: wmai_buf_alloc failed", __func__);
+ return;
+ }
+
+ cmd = (wmi_roam_invoke_cmd_fixed_param *)wmi_buf_data(wmi_buf);
+ buf_ptr = (u_int8_t *) cmd;
+ WMITLV_SET_HDR(&cmd->tlv_header,
+ WMITLV_TAG_STRUC_wmi_roam_invoke_cmd_fixed_param,
+ WMITLV_GET_STRUCT_TLVLEN(wmi_roam_invoke_cmd_fixed_param));
+ cmd->vdev_id = roaminvoke->vdev_id;
+ cmd->flags = 0;
+ cmd->roam_scan_mode = 0;
+ cmd->roam_ap_sel_mode = 0;
+ cmd->roam_delay = 0;
+ cmd->num_chan = 1;
+ cmd->num_bssid = 1;
+ buf_ptr += sizeof(wmi_roam_invoke_cmd_fixed_param);
+ WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_UINT32,
+ (sizeof(u_int32_t)));
+ channel_list = (A_UINT32 *)(buf_ptr + WMI_TLV_HDR_SIZE);
+ *channel_list = (A_UINT32)roaminvoke->channel;
+ buf_ptr += sizeof(A_UINT32) + WMI_TLV_HDR_SIZE;
+ WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_FIXED_STRUC,
+ (sizeof(wmi_mac_addr)));
+ bssid_list = (wmi_mac_addr *)(buf_ptr + WMI_TLV_HDR_SIZE);
+ WMI_CHAR_ARRAY_TO_MAC_ADDR(roaminvoke->bssId, bssid_list);
+ if (wmi_unified_cmd_send(wma_handle->wmi_handle, wmi_buf, len,
+ WMI_ROAM_INVOKE_CMDID)) {
+ WMA_LOGP("%s: failed to send roam invoke command", __func__);
+ adf_nbuf_free(wmi_buf);
+ return;
+ }
+ return;
+}
#endif
diff --git a/CORE/SERVICES/WMA/wma.h b/CORE/SERVICES/WMA/wma.h
index 1138129ab186..5c3232aab9c0 100644
--- a/CORE/SERVICES/WMA/wma.h
+++ b/CORE/SERVICES/WMA/wma.h
@@ -1539,4 +1539,11 @@ typedef struct wma_unit_test_cmd
v_U32_t num_args;
v_U32_t args[WMA_MAX_NUM_ARGS];
}t_wma_unit_test_cmd;
+
+typedef struct wma_roam_invoke_cmd
+{
+ v_UINT_t vdev_id;
+ u_int8_t bssId[6];
+ v_U32_t channel;
+}t_wma_roam_invoke_cmd;
#endif