qcacmn: copy the right Vendor IE for reported STA
If Vendor IE also presents in STA profile, it only needs to copy the vendor IE from STA profile for link specific frame and reported BSSID. Change-Id: I48ed4e88f097fe6570b3f3df764cd707c4b758d3 CRs-Fixed: 3136382
This commit is contained in:

committed by
Madan Koyyalamudi

parent
ee27003447
commit
648757b8ca
@@ -1849,67 +1849,14 @@ QDF_STATUS util_gen_link_assoc_reqrsp_cmn(uint8_t *frame, qdf_size_t frame_len,
|
|||||||
|
|
||||||
if ((reportingsta_ie[ID_POS] == WLAN_ELEMID_VENDOR) &&
|
if ((reportingsta_ie[ID_POS] == WLAN_ELEMID_VENDOR) &&
|
||||||
(sta_prof_iesection_remlen >= MIN_VENDOR_TAG_LEN)) {
|
(sta_prof_iesection_remlen >= MIN_VENDOR_TAG_LEN)) {
|
||||||
if (!qdf_mem_cmp(reportingsta_ie +
|
/* If Vendor IE also presents in STA profile,
|
||||||
PAYLOAD_START_POS,
|
* then ignore the Vendor IE which is for
|
||||||
sta_prof_ie +
|
* reporting STA. It only needs to copy Vendor
|
||||||
PAYLOAD_START_POS,
|
* IE from STA profile to link specific frame.
|
||||||
OUI_LEN)) {
|
* The copy happens when going through the
|
||||||
/* Same vendor IE, copy from STA profile
|
* remaining IEs.
|
||||||
*/
|
*/
|
||||||
if ((link_frame_currpos +
|
;
|
||||||
sta_prof_ie_size) <=
|
|
||||||
(link_frame +
|
|
||||||
link_frame_maxsize)) {
|
|
||||||
qdf_mem_copy(link_frame_currpos,
|
|
||||||
sta_prof_ie,
|
|
||||||
sta_prof_ie_size);
|
|
||||||
|
|
||||||
link_frame_currpos +=
|
|
||||||
sta_prof_ie_size;
|
|
||||||
link_frame_currlen +=
|
|
||||||
sta_prof_ie_size;
|
|
||||||
|
|
||||||
mlo_debug("Vendor IE (%zu octets) for reporting STA also present in STA profile. Copied IE from STA profile to link specific frame",
|
|
||||||
sta_prof_ie_size);
|
|
||||||
|
|
||||||
sta_prof_ie[0] = 0;
|
|
||||||
} else {
|
|
||||||
mlo_err_rl("Insufficent space in link specific frame for IE with element ID : %u. Required: %zu octets, available: %zu octets",
|
|
||||||
sta_prof_ie[ID_POS],
|
|
||||||
sta_prof_ie_size,
|
|
||||||
link_frame_maxsize -
|
|
||||||
link_frame_currlen);
|
|
||||||
|
|
||||||
qdf_mem_free(mlieseqpayload_copy);
|
|
||||||
return QDF_STATUS_E_NOMEM;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if ((link_frame_currpos +
|
|
||||||
reportingsta_ie_size) <=
|
|
||||||
(link_frame +
|
|
||||||
link_frame_maxsize)) {
|
|
||||||
qdf_mem_copy(link_frame_currpos,
|
|
||||||
reportingsta_ie,
|
|
||||||
reportingsta_ie_size);
|
|
||||||
|
|
||||||
link_frame_currpos +=
|
|
||||||
reportingsta_ie_size;
|
|
||||||
link_frame_currlen +=
|
|
||||||
reportingsta_ie_size;
|
|
||||||
|
|
||||||
mlo_debug("Vendor IE (%zu octets) present for reporting STA but not present in STA profile. Copied IE from reporting frame to link specific frame",
|
|
||||||
reportingsta_ie_size);
|
|
||||||
} else {
|
|
||||||
mlo_err_rl("Insufficent space in link specific frame for IE with element ID : %u. Required: %zu octets, available: %zu octets",
|
|
||||||
reportingsta_ie[ID_POS],
|
|
||||||
reportingsta_ie_size,
|
|
||||||
link_frame_maxsize -
|
|
||||||
link_frame_currlen);
|
|
||||||
|
|
||||||
qdf_mem_free(mlieseqpayload_copy);
|
|
||||||
return QDF_STATUS_E_NOMEM;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
/* Copy IE from STA profile into link specific
|
/* Copy IE from STA profile into link specific
|
||||||
* frame.
|
* frame.
|
||||||
|
@@ -2373,16 +2373,6 @@ static void util_parse_noninheritance_list(uint8_t *extn_elem,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static size_t util_oui_header_len(uint8_t *ie)
|
|
||||||
{
|
|
||||||
/* Cisco Vendor Specific IEs doesn't have subtype in
|
|
||||||
* their VSIE header, therefore skip subtype
|
|
||||||
*/
|
|
||||||
if (ie[0] == 0x00 && ie[1] == 0x40 && ie[2] == 0x96)
|
|
||||||
return OUI_LEN - 1;
|
|
||||||
return OUI_LEN;
|
|
||||||
}
|
|
||||||
|
|
||||||
static uint32_t util_gen_new_ie(uint8_t *ie, uint32_t ielen,
|
static uint32_t util_gen_new_ie(uint8_t *ie, uint32_t ielen,
|
||||||
uint8_t *subelement,
|
uint8_t *subelement,
|
||||||
size_t subie_len, uint8_t *new_ie)
|
size_t subie_len, uint8_t *new_ie)
|
||||||
@@ -2480,32 +2470,14 @@ static uint32_t util_gen_new_ie(uint8_t *ie, uint32_t ielen,
|
|||||||
tmp_rem_len = subie_len - (tmp - sub_copy);
|
tmp_rem_len = subie_len - (tmp - sub_copy);
|
||||||
if (tmp_old[0] == WLAN_ELEMID_VENDOR &&
|
if (tmp_old[0] == WLAN_ELEMID_VENDOR &&
|
||||||
tmp_rem_len >= MIN_VENDOR_TAG_LEN) {
|
tmp_rem_len >= MIN_VENDOR_TAG_LEN) {
|
||||||
if (!qdf_mem_cmp(tmp_old + PAYLOAD_START_POS,
|
/* If Vendor IE also presents in STA profile,
|
||||||
tmp + PAYLOAD_START_POS,
|
* then ignore the Vendor IE which is for
|
||||||
util_oui_header_len(tmp +
|
* reporting STA. It only needs to copy Vendor
|
||||||
PAYLOAD_START_POS))) {
|
* IE from STA profile for reported BSSID.
|
||||||
/* same vendor ie, copy from
|
* The copy happens when going through the
|
||||||
* subelement
|
* remaining IEs.
|
||||||
*/
|
*/
|
||||||
if ((pos + tmp[1] + MIN_IE_LEN) <=
|
;
|
||||||
(new_ie + ielen)) {
|
|
||||||
qdf_mem_copy(pos, tmp,
|
|
||||||
tmp[1] +
|
|
||||||
MIN_IE_LEN);
|
|
||||||
pos += tmp[1] + MIN_IE_LEN;
|
|
||||||
tmp[0] = 0;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if ((pos + tmp_old[1] +
|
|
||||||
MIN_IE_LEN) <=
|
|
||||||
(new_ie + ielen)) {
|
|
||||||
qdf_mem_copy(pos, tmp_old,
|
|
||||||
tmp_old[1] +
|
|
||||||
MIN_IE_LEN);
|
|
||||||
pos += tmp_old[1] +
|
|
||||||
MIN_IE_LEN;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (tmp_old[0] == WLAN_ELEMID_EXTN_ELEM) {
|
} else if (tmp_old[0] == WLAN_ELEMID_EXTN_ELEM) {
|
||||||
if (tmp_old[PAYLOAD_START_POS] ==
|
if (tmp_old[PAYLOAD_START_POS] ==
|
||||||
tmp[PAYLOAD_START_POS]) {
|
tmp[PAYLOAD_START_POS]) {
|
||||||
|
Reference in New Issue
Block a user