summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKapil Gupta <kapgupta@codeaurora.org>2016-08-09 14:01:36 +0530
committerqcabuildsw <qcabuildsw@localhost>2016-09-02 17:23:31 -0700
commitc03eb072d7b6997f5dd2ac7a595d5febca496052 (patch)
treeb86adf40714720382b176bdeb8b378969db91157
parent76ed25e536f2c501d653d12252d244fc8a7f9301 (diff)
qcacld-3.0: Correct ext IE in Probe req and Assoc req
qcacld-2.0 to qcacld-3.0 propagation Curretly driver doesn't add ext IE in unicast probe request which it gets from supplicant. Add the changes to add ext IEs in unicast probe request and assoc request. CRs-Fixed: 977188 Change-Id: Idacfa287d17a2409f054421229d04ff087aa28d8
-rw-r--r--core/mac/src/pe/lim/lim_send_management_frames.c45
-rw-r--r--core/mac/src/pe/lim/lim_utils.c21
-rw-r--r--core/mac/src/pe/lim/lim_utils.h1
3 files changed, 49 insertions, 18 deletions
diff --git a/core/mac/src/pe/lim/lim_send_management_frames.c b/core/mac/src/pe/lim/lim_send_management_frames.c
index dfde5ffce65e..6bbddbd5df60 100644
--- a/core/mac/src/pe/lim/lim_send_management_frames.c
+++ b/core/mac/src/pe/lim/lim_send_management_frames.c
@@ -213,7 +213,7 @@ lim_send_probe_req_mgmt_frame(tpAniSirGlobal mac_ctx,
uint32_t status, bytes, payload;
uint8_t *frame;
void *packet;
- QDF_STATUS qdf_status, extcap_status;
+ QDF_STATUS qdf_status;
tpPESession pesession;
uint8_t sessionid;
uint8_t *p2pie = NULL;
@@ -222,6 +222,9 @@ lim_send_probe_req_mgmt_frame(tpAniSirGlobal mac_ctx,
bool is_vht_enabled = false;
uint8_t txPower;
uint16_t addn_ielen = additional_ielen;
+ bool extracted_ext_cap_flag = false;
+ tDot11fIEExtCap extracted_ext_cap;
+ tSirRetStatus sir_status;
/* The probe req should not send 11ac capabilieties if band is 2.4GHz,
* unless enableVhtFor24GHz is enabled in INI. So if enableVhtFor24GHz
@@ -353,13 +356,25 @@ lim_send_probe_req_mgmt_frame(tpAniSirGlobal mac_ctx,
FL("There were warnings while calculating the packed size for a Probe Request (0x%08x)."), status);
}
- /* Strip extended capability IE (if present). FW will add that IE */
if (addn_ielen) {
- extcap_status = lim_strip_extcap_ie(mac_ctx, additional_ie,
- &addn_ielen, NULL);
- if (QDF_STATUS_SUCCESS != extcap_status)
- lim_log(mac_ctx, LOGE,
- FL("Error:%d stripping extcap IE"), extcap_status);
+ qdf_mem_zero((uint8_t *)&extracted_ext_cap,
+ sizeof(tDot11fIEExtCap));
+ sir_status = lim_strip_extcap_update_struct(mac_ctx,
+ additional_ie,
+ &addn_ielen,
+ &extracted_ext_cap);
+ if (eSIR_SUCCESS != sir_status) {
+ lim_log(mac_ctx, LOG1,
+ FL("Unable to Stripoff ExtCap IE from Probe Req"));
+ } else {
+ struct s_ext_cap *p_ext_cap =
+ (struct s_ext_cap *)
+ extracted_ext_cap.bytes;
+ if (p_ext_cap->interworking_service)
+ p_ext_cap->qos_map = 1;
+ extracted_ext_cap_flag =
+ lim_is_ext_cap_ie_present(p_ext_cap);
+ }
}
bytes = payload + sizeof(tSirMacMgmtHdr) + addn_ielen;
@@ -378,6 +393,10 @@ lim_send_probe_req_mgmt_frame(tpAniSirGlobal mac_ctx,
lim_populate_mac_header(mac_ctx, frame, SIR_MAC_MGMT_FRAME,
SIR_MAC_MGMT_PROBE_REQ, bssid, self_macaddr);
+ /* merge the ExtCap struct*/
+ if (extracted_ext_cap_flag)
+ lim_merge_extcap_struct(&pr.ExtCap, &extracted_ext_cap);
+
/* That done, pack the Probe Request: */
status = dot11f_pack_probe_request(mac_ctx, &pr, frame +
sizeof(tSirMacMgmtHdr),
@@ -1640,17 +1659,7 @@ lim_send_assoc_req_mgmt_frame(tpAniSirGlobal mac_ctx,
if (p_ext_cap->interworking_service)
p_ext_cap->qos_map = 1;
- else {
- /*
- * No need to merge the EXT Cap from Supplicant
- * if interworkingService is not set, as currently
- * driver is only interested in interworkingService
- * capability from supplicant. if in future any other
- * EXT Cap info is required from supplicant
- * it needs to be handled here.
- */
- extr_ext_flag = false;
- }
+ extr_ext_flag = lim_is_ext_cap_ie_present(p_ext_cap);
}
} else {
lim_log(mac_ctx, LOG1,
diff --git a/core/mac/src/pe/lim/lim_utils.c b/core/mac/src/pe/lim/lim_utils.c
index 70814111a981..57e7c24a2b2d 100644
--- a/core/mac/src/pe/lim/lim_utils.c
+++ b/core/mac/src/pe/lim/lim_utils.c
@@ -6940,3 +6940,24 @@ bool lim_is_robust_mgmt_action_frame(uint8_t action_category)
}
return false;
}
+
+/**
+ * lim_is_ext_cap_ie_present - checks if ext ie is present
+ * @ext_cap: extended IEs structure
+ *
+ * Return: true if ext IEs are present else false
+ */
+bool lim_is_ext_cap_ie_present (struct s_ext_cap *ext_cap)
+{
+ int i, size;
+ uint8_t *tmp_buf;
+
+ tmp_buf = (uint8_t *) ext_cap;
+ size = sizeof(*ext_cap);
+
+ for (i = 0; i < size; i++)
+ if (tmp_buf[i])
+ return true;
+
+ return false;
+}
diff --git a/core/mac/src/pe/lim/lim_utils.h b/core/mac/src/pe/lim/lim_utils.h
index 1f0ffbbc23e1..1754aeb33771 100644
--- a/core/mac/src/pe/lim/lim_utils.h
+++ b/core/mac/src/pe/lim/lim_utils.h
@@ -600,4 +600,5 @@ static inline void lim_deactivate_and_change_timer_host_roam(
#endif
bool lim_is_robust_mgmt_action_frame(uint8_t action_category);
+bool lim_is_ext_cap_ie_present (struct s_ext_cap *ext_cap);
#endif /* __LIM_UTILS_H */