mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-15 01:01:56 -04:00
qcacmn: Add supporting functions for extended capabilities IE
Add structures and supporting function get bit field value of extended capabilities IE bit field. Change-Id: Iff915320d71473310e2cbc0188508061b14a40f1 CRs-Fixed: 2296592
This commit is contained in:
parent
7235d9b33d
commit
a76abc45d7
3 changed files with 60 additions and 0 deletions
|
|
@ -1088,6 +1088,18 @@ struct wlan_esp_ie {
|
|||
struct wlan_esp_info esp_info_AC_VO;
|
||||
} qdf_packed;
|
||||
|
||||
/**
|
||||
* struct wlan_ext_cap_ie - struct for extended capabilities information
|
||||
* @ext_cap_id: Extended capabilities id
|
||||
* @ext_cap_len: Extended capabilities IE len
|
||||
* @ext_caps: Variable length extended capabilities information
|
||||
*/
|
||||
struct wlan_ext_cap_ie {
|
||||
uint8_t ext_cap_id;
|
||||
uint8_t ext_cap_len;
|
||||
uint8_t ext_caps[];
|
||||
} qdf_packed;
|
||||
|
||||
/**
|
||||
* struct oce_reduced_wan_metrics: struct for oce wan metrics
|
||||
* @downlink_av_cap: Download available capacity
|
||||
|
|
|
|||
|
|
@ -1376,4 +1376,16 @@ enum scan_config {
|
|||
SCAN_CFG_DISABLE_SCAN_COMMAND_TIMEOUT,
|
||||
SCAN_CFG_DROP_BCN_ON_CHANNEL_MISMATCH,
|
||||
};
|
||||
|
||||
/**
|
||||
* enum ext_cap_bit_field - Extended capabilities bit field
|
||||
* @BSS_2040_COEX_MGMT_SUPPORT: 20/40 BSS Coexistence Management Support field
|
||||
* @OBSS_NARROW_BW_RU_IN_ULOFDMA_TOLERENT_SUPPORT: OBSS Narrow Bandwidth RU
|
||||
* in UL OFDMA Tolerance Support
|
||||
*/
|
||||
enum ext_cap_bit_field {
|
||||
BSS_2040_COEX_MGMT_SUPPORT = 0,
|
||||
OBSS_NARROW_BW_RU_IN_ULOFDMA_TOLERENT_SUPPORT = 79,
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1308,6 +1308,42 @@ util_scan_entry_extcaps(struct scan_cache_entry *scan_entry)
|
|||
return scan_entry->ie_list.extcaps;
|
||||
}
|
||||
|
||||
/**
|
||||
* util_scan_entry_get_extcap() - function to read extended capability field ie
|
||||
* @scan_entry: scan entry
|
||||
* @extcap_bit_field: extended capability bit field
|
||||
* @extcap_value: pointer to fill extended capability field value
|
||||
*
|
||||
* API, function to read extended capability field
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS if extended capability field is found
|
||||
* QDF_STATUS_E_NOMEM if extended capability field is not found
|
||||
*/
|
||||
static inline QDF_STATUS
|
||||
util_scan_entry_get_extcap(struct scan_cache_entry *scan_entry,
|
||||
enum ext_cap_bit_field extcap_bit_field,
|
||||
uint8_t *extcap_value)
|
||||
{
|
||||
struct wlan_ext_cap_ie *ext_cap =
|
||||
(struct wlan_ext_cap_ie *)util_scan_entry_extcaps(scan_entry);
|
||||
|
||||
uint8_t ext_caps_byte = (extcap_bit_field >> 3);
|
||||
uint8_t ext_caps_bit_pos = extcap_bit_field & 0x7;
|
||||
|
||||
*extcap_value = 0;
|
||||
|
||||
if (!ext_cap)
|
||||
return QDF_STATUS_E_NULL_VALUE;
|
||||
|
||||
if (ext_cap->ext_cap_len < ext_caps_byte)
|
||||
return QDF_STATUS_E_NULL_VALUE;
|
||||
|
||||
*extcap_value =
|
||||
((ext_cap->ext_caps[ext_caps_byte] >> ext_caps_bit_pos) & 0x1);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* util_scan_entry_athcaps() - function to read ath caps vendor ie
|
||||
* @scan_entry: scan entry
|
||||
|
|
|
|||
Loading…
Reference in a new issue