|
@@ -997,6 +997,50 @@ static inline uint8_t *wmi_add_fils_tlv(wmi_unified_t wmi_handle,
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
+#ifdef WLAN_FEATURE_ROAM_OFFLOAD
|
|
|
+/**
|
|
|
+ * fill_roam_offload_11r_params() - Fill roam scan params to send it to fw
|
|
|
+ * @auth_mode: Authentication mode
|
|
|
+ * @roam_offload_11r: TLV to be filled with 11r params
|
|
|
+ * @roam_req: roam request param
|
|
|
+ */
|
|
|
+static void
|
|
|
+fill_roam_offload_11r_params(uint32_t auth_mode,
|
|
|
+ wmi_roam_11r_offload_tlv_param *roam_offload_11r,
|
|
|
+ struct roam_offload_scan_params *roam_req)
|
|
|
+{
|
|
|
+ uint8_t *psk_msk, len;
|
|
|
+
|
|
|
+ if (auth_mode == WMI_AUTH_FT_RSNA_FILS_SHA256 ||
|
|
|
+ auth_mode == WMI_AUTH_FT_RSNA_FILS_SHA384) {
|
|
|
+ psk_msk = roam_req->roam_fils_params.fils_ft;
|
|
|
+ len = roam_req->roam_fils_params.fils_ft_len;
|
|
|
+ } else {
|
|
|
+ psk_msk = roam_req->psk_pmk;
|
|
|
+ len = roam_req->pmk_len;
|
|
|
+ }
|
|
|
+
|
|
|
+ /*
|
|
|
+ * For SHA384 based akm, the pmk length is 48 bytes. So fill
|
|
|
+ * first 32 bytes in roam_offload_11r->psk_msk and the remaining
|
|
|
+ * bytes in roam_offload_11r->psk_msk_ext buffer
|
|
|
+ */
|
|
|
+ roam_offload_11r->psk_msk_len = len > ROAM_OFFLOAD_PSK_MSK_BYTES ?
|
|
|
+ ROAM_OFFLOAD_PSK_MSK_BYTES : len;
|
|
|
+ qdf_mem_copy(roam_offload_11r->psk_msk, psk_msk,
|
|
|
+ roam_offload_11r->psk_msk_len);
|
|
|
+ roam_offload_11r->psk_msk_ext_len = 0;
|
|
|
+
|
|
|
+ if (len > ROAM_OFFLOAD_PSK_MSK_BYTES) {
|
|
|
+ roam_offload_11r->psk_msk_ext_len =
|
|
|
+ len - roam_offload_11r->psk_msk_len;
|
|
|
+ qdf_mem_copy(roam_offload_11r->psk_msk_ext,
|
|
|
+ &psk_msk[roam_offload_11r->psk_msk_len],
|
|
|
+ roam_offload_11r->psk_msk_ext_len);
|
|
|
+ }
|
|
|
+}
|
|
|
+#endif
|
|
|
+
|
|
|
/**
|
|
|
* send_roam_scan_offload_mode_cmd_tlv() - send roam scan mode request to fw
|
|
|
* @wmi_handle: wmi handle
|
|
@@ -1008,10 +1052,10 @@ static inline uint8_t *wmi_add_fils_tlv(wmi_unified_t wmi_handle,
|
|
|
*
|
|
|
* Return: QDF status
|
|
|
*/
|
|
|
-static QDF_STATUS send_roam_scan_offload_mode_cmd_tlv(wmi_unified_t wmi_handle,
|
|
|
- wmi_start_scan_cmd_fixed_param *
|
|
|
- scan_cmd_fp,
|
|
|
- struct roam_offload_scan_params *roam_req)
|
|
|
+static QDF_STATUS
|
|
|
+send_roam_scan_offload_mode_cmd_tlv(wmi_unified_t wmi_handle,
|
|
|
+ wmi_start_scan_cmd_fixed_param *scan_cmd_fp,
|
|
|
+ struct roam_offload_scan_params *roam_req)
|
|
|
{
|
|
|
wmi_buf_t buf = NULL;
|
|
|
QDF_STATUS status;
|
|
@@ -1039,74 +1083,72 @@ static QDF_STATUS send_roam_scan_offload_mode_cmd_tlv(wmi_unified_t wmi_handle,
|
|
|
sizeof(wmi_start_scan_cmd_fixed_param);
|
|
|
#ifdef WLAN_FEATURE_ROAM_OFFLOAD
|
|
|
WMI_LOGD("auth_mode = %d", auth_mode);
|
|
|
- if (roam_req->is_roam_req_valid &&
|
|
|
- roam_req->roam_offload_enabled) {
|
|
|
- len += sizeof(wmi_roam_offload_tlv_param);
|
|
|
+ if (roam_req->is_roam_req_valid &&
|
|
|
+ roam_req->roam_offload_enabled) {
|
|
|
+ len += sizeof(wmi_roam_offload_tlv_param);
|
|
|
+ len += WMI_TLV_HDR_SIZE;
|
|
|
+ if ((auth_mode != WMI_AUTH_NONE) &&
|
|
|
+ ((auth_mode != WMI_AUTH_OPEN) ||
|
|
|
+ (auth_mode == WMI_AUTH_OPEN &&
|
|
|
+ roam_req->mdid.mdie_present &&
|
|
|
+ roam_req->is_11r_assoc) ||
|
|
|
+ roam_req->is_ese_assoc)) {
|
|
|
len += WMI_TLV_HDR_SIZE;
|
|
|
- if ((auth_mode != WMI_AUTH_NONE) &&
|
|
|
- ((auth_mode != WMI_AUTH_OPEN) ||
|
|
|
+ if (roam_req->is_ese_assoc)
|
|
|
+ len += sizeof(wmi_roam_ese_offload_tlv_param);
|
|
|
+ else if ((auth_mode == WMI_AUTH_FT_RSNA) ||
|
|
|
+ (auth_mode == WMI_AUTH_FT_RSNA_PSK) ||
|
|
|
+ (auth_mode == WMI_AUTH_FT_RSNA_SAE) ||
|
|
|
+ (auth_mode ==
|
|
|
+ WMI_AUTH_FT_RSNA_SUITE_B_8021X_SHA384) ||
|
|
|
+ (auth_mode ==
|
|
|
+ WMI_AUTH_FT_RSNA_FILS_SHA256) ||
|
|
|
+ (auth_mode ==
|
|
|
+ WMI_AUTH_FT_RSNA_FILS_SHA384) ||
|
|
|
(auth_mode == WMI_AUTH_OPEN &&
|
|
|
roam_req->mdid.mdie_present &&
|
|
|
- roam_req->is_11r_assoc) ||
|
|
|
- roam_req->is_ese_assoc)) {
|
|
|
- len += WMI_TLV_HDR_SIZE;
|
|
|
- if (roam_req->is_ese_assoc)
|
|
|
- len +=
|
|
|
- sizeof(wmi_roam_ese_offload_tlv_param);
|
|
|
- else if (auth_mode == WMI_AUTH_FT_RSNA ||
|
|
|
- auth_mode == WMI_AUTH_FT_RSNA_PSK ||
|
|
|
- (auth_mode == WMI_AUTH_OPEN &&
|
|
|
- roam_req->mdid.mdie_present &&
|
|
|
- roam_req->is_11r_assoc))
|
|
|
- len +=
|
|
|
- sizeof(wmi_roam_11r_offload_tlv_param);
|
|
|
- else
|
|
|
- len +=
|
|
|
- sizeof(wmi_roam_11i_offload_tlv_param);
|
|
|
- } else {
|
|
|
- len += WMI_TLV_HDR_SIZE;
|
|
|
- }
|
|
|
-
|
|
|
- len += (sizeof(*assoc_ies) + (2*WMI_TLV_HDR_SIZE)
|
|
|
- + roundup(roam_req->assoc_ie_length,
|
|
|
- sizeof(uint32_t)));
|
|
|
-
|
|
|
- if (roam_req->add_fils_tlv) {
|
|
|
- fils_tlv_len = sizeof(
|
|
|
- wmi_roam_fils_offload_tlv_param);
|
|
|
- len += WMI_TLV_HDR_SIZE + fils_tlv_len;
|
|
|
- }
|
|
|
- } else {
|
|
|
- if (roam_req->is_roam_req_valid)
|
|
|
- WMI_LOGD("%s : roam offload = %d",
|
|
|
- __func__,
|
|
|
- roam_req->roam_offload_enabled);
|
|
|
+ roam_req->is_11r_assoc))
|
|
|
+ len += sizeof(wmi_roam_11r_offload_tlv_param);
|
|
|
else
|
|
|
- WMI_LOGD("%s : roam_req is NULL", __func__);
|
|
|
- len += (4 * WMI_TLV_HDR_SIZE);
|
|
|
+ len += sizeof(wmi_roam_11i_offload_tlv_param);
|
|
|
+ } else {
|
|
|
+ len += WMI_TLV_HDR_SIZE;
|
|
|
}
|
|
|
- if (roam_req->is_roam_req_valid &&
|
|
|
- roam_req->roam_offload_enabled) {
|
|
|
- roam_req->mode = roam_req->mode |
|
|
|
- WMI_ROAM_SCAN_MODE_ROAMOFFLOAD;
|
|
|
+
|
|
|
+ len += (sizeof(*assoc_ies) + (2*WMI_TLV_HDR_SIZE)
|
|
|
+ + roundup(roam_req->assoc_ie_length, sizeof(uint32_t)));
|
|
|
+
|
|
|
+ if (roam_req->add_fils_tlv) {
|
|
|
+ fils_tlv_len = sizeof(wmi_roam_fils_offload_tlv_param);
|
|
|
+ len += WMI_TLV_HDR_SIZE + fils_tlv_len;
|
|
|
}
|
|
|
+ } else {
|
|
|
+ if (roam_req->is_roam_req_valid)
|
|
|
+ WMI_LOGD("%s : roam offload = %d", __func__,
|
|
|
+ roam_req->roam_offload_enabled);
|
|
|
+ else
|
|
|
+ WMI_LOGD("%s : roam_req is NULL", __func__);
|
|
|
+
|
|
|
+ len += (4 * WMI_TLV_HDR_SIZE);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (roam_req->is_roam_req_valid && roam_req->roam_offload_enabled)
|
|
|
+ roam_req->mode |= WMI_ROAM_SCAN_MODE_ROAMOFFLOAD;
|
|
|
#endif /* WLAN_FEATURE_ROAM_OFFLOAD */
|
|
|
|
|
|
- if (roam_req->mode == (WMI_ROAM_SCAN_MODE_NONE
|
|
|
- |WMI_ROAM_SCAN_MODE_ROAMOFFLOAD))
|
|
|
+ if (roam_req->mode ==
|
|
|
+ (WMI_ROAM_SCAN_MODE_NONE | WMI_ROAM_SCAN_MODE_ROAMOFFLOAD))
|
|
|
len = sizeof(wmi_roam_scan_mode_fixed_param);
|
|
|
|
|
|
buf = wmi_buf_alloc(wmi_handle, len);
|
|
|
- if (!buf) {
|
|
|
+ if (!buf)
|
|
|
return QDF_STATUS_E_NOMEM;
|
|
|
- }
|
|
|
|
|
|
buf_ptr = (uint8_t *) wmi_buf_data(buf);
|
|
|
roam_scan_mode_fp = (wmi_roam_scan_mode_fixed_param *) buf_ptr;
|
|
|
WMITLV_SET_HDR(&roam_scan_mode_fp->tlv_header,
|
|
|
WMITLV_TAG_STRUC_wmi_roam_scan_mode_fixed_param,
|
|
|
- WMITLV_GET_STRUCT_TLVLEN
|
|
|
- (wmi_roam_scan_mode_fixed_param));
|
|
|
+ WMITLV_GET_STRUCT_TLVLEN(wmi_roam_scan_mode_fixed_param));
|
|
|
|
|
|
roam_scan_mode_fp->min_delay_roam_trigger_reason_bitmask =
|
|
|
roam_req->roam_trigger_reason_bitmask;
|
|
@@ -1114,8 +1156,8 @@ static QDF_STATUS send_roam_scan_offload_mode_cmd_tlv(wmi_unified_t wmi_handle,
|
|
|
WMI_SEC_TO_MSEC(roam_req->min_delay_btw_roam_scans);
|
|
|
roam_scan_mode_fp->roam_scan_mode = roam_req->mode;
|
|
|
roam_scan_mode_fp->vdev_id = roam_req->vdev_id;
|
|
|
- if (roam_req->mode == (WMI_ROAM_SCAN_MODE_NONE |
|
|
|
- WMI_ROAM_SCAN_MODE_ROAMOFFLOAD)) {
|
|
|
+ if (roam_req->mode ==
|
|
|
+ (WMI_ROAM_SCAN_MODE_NONE | WMI_ROAM_SCAN_MODE_ROAMOFFLOAD)) {
|
|
|
roam_scan_mode_fp->flags |=
|
|
|
WMI_ROAM_SCAN_MODE_FLAG_REPORT_STATUS;
|
|
|
goto send_roam_scan_mode_cmd;
|
|
@@ -1130,8 +1172,7 @@ static QDF_STATUS send_roam_scan_offload_mode_cmd_tlv(wmi_unified_t wmi_handle,
|
|
|
scan_cmd_fp->ie_len = 0;
|
|
|
WMITLV_SET_HDR(buf_ptr,
|
|
|
WMITLV_TAG_STRUC_wmi_start_scan_cmd_fixed_param,
|
|
|
- WMITLV_GET_STRUCT_TLVLEN
|
|
|
- (wmi_start_scan_cmd_fixed_param));
|
|
|
+ WMITLV_GET_STRUCT_TLVLEN(wmi_start_scan_cmd_fixed_param));
|
|
|
#ifdef WLAN_FEATURE_ROAM_OFFLOAD
|
|
|
buf_ptr += sizeof(wmi_start_scan_cmd_fixed_param);
|
|
|
if (roam_req->is_roam_req_valid && roam_req->roam_offload_enabled) {
|
|
@@ -1212,11 +1253,18 @@ static QDF_STATUS send_roam_scan_offload_mode_cmd_tlv(wmi_unified_t wmi_handle,
|
|
|
(wmi_roam_ese_offload_tlv_param));
|
|
|
buf_ptr +=
|
|
|
sizeof(wmi_roam_ese_offload_tlv_param);
|
|
|
- } else if (auth_mode == WMI_AUTH_FT_RSNA
|
|
|
- || auth_mode == WMI_AUTH_FT_RSNA_PSK
|
|
|
- || (auth_mode == WMI_AUTH_OPEN
|
|
|
- && roam_req->mdid.mdie_present &&
|
|
|
- roam_req->is_11r_assoc)) {
|
|
|
+ } else if (auth_mode == WMI_AUTH_FT_RSNA ||
|
|
|
+ auth_mode == WMI_AUTH_FT_RSNA_PSK ||
|
|
|
+ auth_mode == WMI_AUTH_FT_RSNA_SAE ||
|
|
|
+ (auth_mode ==
|
|
|
+ WMI_AUTH_FT_RSNA_SUITE_B_8021X_SHA384) ||
|
|
|
+ (auth_mode ==
|
|
|
+ WMI_AUTH_FT_RSNA_FILS_SHA256) ||
|
|
|
+ (auth_mode ==
|
|
|
+ WMI_AUTH_FT_RSNA_FILS_SHA384) ||
|
|
|
+ (auth_mode == WMI_AUTH_OPEN
|
|
|
+ && roam_req->mdid.mdie_present &&
|
|
|
+ roam_req->is_11r_assoc)) {
|
|
|
WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC,
|
|
|
0);
|
|
|
buf_ptr += WMI_TLV_HDR_SIZE;
|
|
@@ -1230,11 +1278,9 @@ static QDF_STATUS send_roam_scan_offload_mode_cmd_tlv(wmi_unified_t wmi_handle,
|
|
|
qdf_mem_copy(roam_offload_11r->r0kh_id,
|
|
|
roam_req->rokh_id,
|
|
|
roam_offload_11r->r0kh_id_len);
|
|
|
- qdf_mem_copy(roam_offload_11r->psk_msk,
|
|
|
- roam_req->psk_pmk,
|
|
|
- sizeof(roam_req->psk_pmk));
|
|
|
- roam_offload_11r->psk_msk_len =
|
|
|
- roam_req->pmk_len;
|
|
|
+ fill_roam_offload_11r_params(auth_mode,
|
|
|
+ roam_offload_11r,
|
|
|
+ roam_req);
|
|
|
roam_offload_11r->mdie_present =
|
|
|
roam_req->mdid.mdie_present;
|
|
|
roam_offload_11r->mdid =
|
|
@@ -1254,8 +1300,9 @@ static QDF_STATUS send_roam_scan_offload_mode_cmd_tlv(wmi_unified_t wmi_handle,
|
|
|
WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC,
|
|
|
WMITLV_GET_STRUCT_TLVLEN(0));
|
|
|
buf_ptr += WMI_TLV_HDR_SIZE;
|
|
|
- WMI_LOGD("psk_msk_len = %d",
|
|
|
- roam_offload_11r->psk_msk_len);
|
|
|
+ WMI_LOGD("psk_msk_len = %d psk_msk_ext:%d",
|
|
|
+ roam_offload_11r->psk_msk_len,
|
|
|
+ roam_offload_11r->psk_msk_ext_len);
|
|
|
if (roam_offload_11r->psk_msk_len)
|
|
|
QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMI,
|
|
|
QDF_TRACE_LEVEL_DEBUG,
|
|
@@ -1373,12 +1420,8 @@ send_roam_scan_mode_cmd:
|
|
|
wmi_mtrace(WMI_ROAM_SCAN_MODE, NO_SESSION, 0);
|
|
|
status = wmi_unified_cmd_send(wmi_handle, buf,
|
|
|
len, WMI_ROAM_SCAN_MODE);
|
|
|
- if (QDF_IS_STATUS_ERROR(status)) {
|
|
|
- WMI_LOGE(
|
|
|
- "wmi_unified_cmd_send WMI_ROAM_SCAN_MODE returned Error %d",
|
|
|
- status);
|
|
|
+ if (QDF_IS_STATUS_ERROR(status))
|
|
|
wmi_buf_free(buf);
|
|
|
- }
|
|
|
|
|
|
return status;
|
|
|
}
|