Skip to content
This repository has been archived by the owner on Jul 3, 2019. It is now read-only.

Commit

Permalink
staging: qcacld-3.0: Merge tag 'LA.UM.6.2.r1-09300-sdm660.0' into 8.1…
Browse files Browse the repository at this point in the history
….0-unified

Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
  • Loading branch information
nathanchance committed Jul 3, 2018
2 parents e25cda9 + c325b5f commit 11240a6
Show file tree
Hide file tree
Showing 26 changed files with 315 additions and 104 deletions.
3 changes: 3 additions & 0 deletions drivers/staging/qcacld-3.0/core/cds/inc/cds_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,16 @@ enum cds_band_type {
* off the async scan
* ENABLE_DBS_CXN_AND_ENABLE_SCAN_WITH_ASYNC_SCAN_OFF: enable dbs support for
* connection and scan but switch off the async scan
* ENABLE_DBS_CXN_AND_DISABLE_DBS_SCAN: Enable DBS support for connection and
* disable DBS support for scan
*/
enum dbs_support {
ENABLE_DBS_CXN_AND_SCAN,
DISABLE_DBS_CXN_AND_SCAN,
DISABLE_DBS_CXN_AND_ENABLE_DBS_SCAN,
DISABLE_DBS_CXN_AND_ENABLE_DBS_SCAN_WITH_ASYNC_SCAN_OFF,
ENABLE_DBS_CXN_AND_ENABLE_SCAN_WITH_ASYNC_SCAN_OFF,
ENABLE_DBS_CXN_AND_DISABLE_DBS_SCAN,
};

/*-------------------------------------------------------------------------
Expand Down
3 changes: 2 additions & 1 deletion drivers/staging/qcacld-3.0/core/hdd/inc/wlan_hdd_cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -8853,6 +8853,7 @@ enum dot11p_mode {
* scan policy disabled.
* 4 - enable DBS for connection as well as for scan with async
* scan policy disabled.
* 5 - enable DBS for connection but disable dbs for scan.
*
* Note: INI item value should match 'enum dbs_support'
*
Expand All @@ -8866,7 +8867,7 @@ enum dot11p_mode {
*/
#define CFG_DUAL_MAC_FEATURE_DISABLE "gDualMacFeatureDisable"
#define CFG_DUAL_MAC_FEATURE_DISABLE_MIN (0)
#define CFG_DUAL_MAC_FEATURE_DISABLE_MAX (4)
#define CFG_DUAL_MAC_FEATURE_DISABLE_MAX (5)
#define CFG_DUAL_MAC_FEATURE_DISABLE_DEFAULT (0)

/*
Expand Down
30 changes: 18 additions & 12 deletions drivers/staging/qcacld-3.0/core/hdd/src/wlan_hdd_cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -18943,13 +18943,15 @@ static inline bool wlan_hdd_is_pmksa_valid(struct cfg80211_pmksa *pmksa)

/*
* hdd_fill_pmksa_info: API to update tPmkidCacheInfo from cfg80211_pmksa
* @pmk_cache: pmksa from supplicant
* @pmk_cache: pmk needs to be updated
*
* @adapter: Pointer to hdd adapter
* @pmk_cache: pmk that needs to be udated
* @pmksa: pmk from supplicant
* @is_delete: Bool to decide set or delete PMK
* Return: None
*/
static void hdd_fill_pmksa_info(tPmkidCacheInfo *pmk_cache,
struct cfg80211_pmksa *pmksa, bool is_delete)
static void hdd_fill_pmksa_info(hdd_adapter_t *adapter,
tPmkidCacheInfo *pmk_cache,
struct cfg80211_pmksa *pmksa, bool is_delete)
{
if (pmksa->bssid) {
hdd_debug("%s PMKSA for " MAC_ADDRESS_STR,
Expand Down Expand Up @@ -18997,22 +18999,26 @@ static inline bool wlan_hdd_is_pmksa_valid(struct cfg80211_pmksa *pmksa)

/*
* hdd_fill_pmksa_info: API to update tPmkidCacheInfo from cfg80211_pmksa
* @pmk_cache: pmksa from supplicant
* @pmk_cache: pmk needs to be updated
* @adapter: Pointer to hdd adapter
* @pmk_cache: pmk which needs to be updated
* @pmksa: pmk from supplicant
* @is_delete: Bool to decide whether to set or delete PMK
*
* Return: None
*/
static void hdd_fill_pmksa_info(tPmkidCacheInfo *pmk_cache,
struct cfg80211_pmksa *pmksa, bool is_delete)
static void hdd_fill_pmksa_info(hdd_adapter_t *adapter,
tPmkidCacheInfo *pmk_cache,
struct cfg80211_pmksa *pmksa, bool is_delete)
{
tHalHandle hal = WLAN_HDD_GET_HAL_CTX(adapter);
hdd_debug("%s PMKSA for " MAC_ADDRESS_STR, is_delete ? "Delete" : "Set",
MAC_ADDR_ARRAY(pmksa->bssid));
qdf_mem_copy(pmk_cache->BSSID.bytes,
pmksa->bssid, QDF_MAC_ADDR_SIZE);

if (is_delete)
return;

sme_get_pmk_info(hal, adapter->sessionId, pmk_cache);
qdf_mem_copy(pmk_cache->PMKID, pmksa->pmkid, CSR_RSN_PMKID_SIZE);
}
#endif
Expand Down Expand Up @@ -19071,7 +19077,7 @@ static int __wlan_hdd_cfg80211_set_pmksa(struct wiphy *wiphy,

qdf_mem_zero(&pmk_cache, sizeof(pmk_cache));

hdd_fill_pmksa_info(&pmk_cache, pmksa, false);
hdd_fill_pmksa_info(pAdapter, &pmk_cache, pmksa, false);

/*
* Add to the PMKSA Cache in CSR
Expand Down Expand Up @@ -19166,7 +19172,7 @@ static int __wlan_hdd_cfg80211_del_pmksa(struct wiphy *wiphy,

qdf_mem_zero(&pmk_cache, sizeof(pmk_cache));

hdd_fill_pmksa_info(&pmk_cache, pmksa, true);
hdd_fill_pmksa_info(pAdapter, &pmk_cache, pmksa, true);

/* Delete the PMKID CSR cache */
if (QDF_STATUS_SUCCESS !=
Expand Down
11 changes: 8 additions & 3 deletions drivers/staging/qcacld-3.0/core/hdd/src/wlan_hdd_ioctl.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012-2017 The Linux Foundation. All rights reserved.
* Copyright (c) 2012-2018 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
Expand Down Expand Up @@ -7276,14 +7276,19 @@ static int hdd_drv_cmd_process(hdd_adapter_t *adapter,
const int cmd_num_total = ARRAY_SIZE(hdd_drv_cmds);
uint8_t *cmd_i = NULL;
hdd_drv_cmd_handler_t handler = NULL;
int len = 0;
int len = 0, cmd_len = 0;
uint8_t *ptr;
bool args;

if (!adapter || !cmd || !priv_data) {
hdd_err("at least 1 param is NULL");
return -EINVAL;
}

/* Calculate length of the first word */
ptr = strchrnul(cmd, ' ');
cmd_len = ptr - cmd;

hdd_ctx = (hdd_context_t *)adapter->pHddCtx;

for (i = 0; i < cmd_num_total; i++) {
Expand All @@ -7298,7 +7303,7 @@ static int hdd_drv_cmd_process(hdd_adapter_t *adapter,
return -EINVAL;
}

if (strncasecmp(cmd, cmd_i, len) == 0) {
if (len == cmd_len && strncasecmp(cmd, cmd_i, len) == 0) {
if (args && drv_cmd_validate(cmd, len))
return -EINVAL;

Expand Down
6 changes: 4 additions & 2 deletions drivers/staging/qcacld-3.0/core/hdd/src/wlan_hdd_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -9146,8 +9146,10 @@ int hdd_dbs_scan_selection_init(hdd_context_t *hdd_ctx)
hdd_ctx->is_dbs_scan_duty_cycle_enabled = false;

/* check if DBS is enabled or supported */
if (hdd_ctx->config->dual_mac_feature_disable ==
DISABLE_DBS_CXN_AND_SCAN)
if ((hdd_ctx->config->dual_mac_feature_disable ==
DISABLE_DBS_CXN_AND_SCAN) ||
(hdd_ctx->config->dual_mac_feature_disable ==
ENABLE_DBS_CXN_AND_DISABLE_DBS_SCAN))
return -EINVAL;

hdd_string_to_u8_array(hdd_ctx->config->dbs_scan_selection,
Expand Down
19 changes: 13 additions & 6 deletions drivers/staging/qcacld-3.0/core/hdd/src/wlan_hdd_scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -630,8 +630,10 @@ static void hdd_update_dbs_scan_ctrl_ext_flag(hdd_context_t *hdd_ctx,
goto end;
}

if (hdd_ctx->config->dual_mac_feature_disable ==
DISABLE_DBS_CXN_AND_SCAN) {
if ((hdd_ctx->config->dual_mac_feature_disable ==
DISABLE_DBS_CXN_AND_SCAN) ||
(hdd_ctx->config->dual_mac_feature_disable ==
ENABLE_DBS_CXN_AND_DISABLE_DBS_SCAN)) {
hdd_debug("DBS is disabled");
goto end;
}
Expand Down Expand Up @@ -1999,8 +2001,10 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
return 0;
}
}
if (pHddCtx->config->dual_mac_feature_disable ==
DISABLE_DBS_CXN_AND_SCAN) {
if ((pHddCtx->config->dual_mac_feature_disable ==
DISABLE_DBS_CXN_AND_SCAN) ||
(pHddCtx->config->dual_mac_feature_disable ==
ENABLE_DBS_CXN_AND_DISABLE_DBS_SCAN)) {
if (true == pScanInfo->mScanPending) {
scan_ebusy_cnt++;
if (MAX_PENDING_LOG >
Expand Down Expand Up @@ -2356,7 +2360,9 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
&hdd_cfg80211_scan_done_callback, dev);

if (QDF_STATUS_SUCCESS != status) {
hdd_err("sme_scan_request returned error %d", status);
hdd_err_ratelimited(HDD_SCAN_REJECT_RATE_LIMIT,
"sme_scan_request returned error %d",
status);
if (QDF_STATUS_E_RESOURCES == status) {
scan_ebusy_cnt++;
hdd_err("HO is in progress. Defer scan scan_ebusy_cnt: %d",
Expand Down Expand Up @@ -2807,7 +2813,8 @@ static int __wlan_hdd_cfg80211_vendor_scan(struct wiphy *wiphy,

ret = __wlan_hdd_cfg80211_scan(wiphy, request, VENDOR_SCAN);
if (0 != ret) {
hdd_err("Scan Failed. Ret = %d", ret);
hdd_err_ratelimited(HDD_SCAN_REJECT_RATE_LIMIT,
"Scan Failed. Ret = %d", ret);
qdf_mem_free(request);
return ret;
}
Expand Down
4 changes: 2 additions & 2 deletions drivers/staging/qcacld-3.0/core/hdd/src/wlan_hdd_wext.c
Original file line number Diff line number Diff line change
Expand Up @@ -11818,8 +11818,6 @@ static int __iw_set_pno(struct net_device *dev,
if (ret)
return ret;

hdd_debug("PNO data len %d data %s", wrqu->data.length, extra);

/* making sure argument string ends with '\0' */
len = (wrqu->data.length + 1);
data = qdf_mem_malloc(len);
Expand All @@ -11831,6 +11829,8 @@ static int __iw_set_pno(struct net_device *dev,
qdf_mem_copy(data, extra, (len-1));
ptr = data;

hdd_debug("PNO data len %d data %s", wrqu->data.length, data);

request.enable = 0;
request.ucNetworksCount = 0;

Expand Down
12 changes: 12 additions & 0 deletions drivers/staging/qcacld-3.0/core/mac/inc/sir_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,17 @@ typedef enum eSirScanType {
eSIR_BEACON_TABLE,
} tSirScanType;

/* Rsn Capabilities structure */
struct rsn_caps {
uint16_t PreAuthSupported:1;
uint16_t NoPairwise:1;
uint16_t PTKSAReplayCounter:2;
uint16_t GTKSAReplayCounter:2;
uint16_t MFPRequired:1;
uint16_t MFPCapable:1;
uint16_t Reserved:8;
};

/* / Result codes Firmware return to Host SW */
typedef enum eSirResultCodes {
eSIR_SME_SUCCESS,
Expand Down Expand Up @@ -3510,6 +3521,7 @@ typedef struct sSirRoamOffloadScanReq {
uint8_t OpportunisticScanThresholdDiff;
uint8_t RoamRescanRssiDiff;
uint8_t RoamRssiDiff;
struct rsn_caps rsn_caps;
int32_t rssi_abs_thresh;
uint8_t ChannelCacheType;
uint8_t Command;
Expand Down
33 changes: 32 additions & 1 deletion drivers/staging/qcacld-3.0/core/mac/src/cfg/cfg_api.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011-2017 The Linux Foundation. All rights reserved.
* Copyright (c) 2011-2018 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
Expand Down Expand Up @@ -945,3 +945,34 @@ uint8_t *cfg_get_vendor_ie_ptr_from_oui(tpAniSirGlobal mac_ctx,
return NULL;
}

uint8_t *wlan_cfg_get_ie_ptr(uint8_t *p_ie, int length, uint8_t eid,
enum size_of_len_field size_of_len_field)
{
int left = length;
uint8_t *ptr = p_ie;
uint8_t elem_id;
uint16_t elem_len;

while (left >= (size_of_len_field + 1)) {
elem_id = ptr[0];
if (size_of_len_field == TWO_BYTE)
elem_len = ((uint16_t)ptr[1]) | (ptr[2] << 8);
else
elem_len = ptr[1];

left -= (size_of_len_field + 1);
if (elem_len > left) {
pe_err("Invalid IEs eid: %d elem_len: %d left: %d",
eid, elem_len, left);
return NULL;
}

if (elem_id == eid)
return ptr;

left -= elem_len;
ptr += (elem_len + (size_of_len_field + 1));
}
return NULL;
}

18 changes: 17 additions & 1 deletion drivers/staging/qcacld-3.0/core/mac/src/include/cfg_api.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011-2012, 2015-2017 The Linux Foundation. All rights reserved.
* Copyright (c) 2011-2012, 2015-2018 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
Expand Down Expand Up @@ -128,4 +128,20 @@ uint8_t *cfg_get_vendor_ie_ptr_from_oui(tpAniSirGlobal mac_ctx,
uint8_t *ie,
uint16_t ie_len);

/**
* wlan_cfg_get_ie_ptr() - to get IE ptr corresponding
* to a particular eid
* @p_ie: ptr to complete IE of beacon/probe response
* @length: complete IE length
* @eid: IE id
* @size_of_len_field: ONE_BYTE/TWO_BYTE
*
* This function is called to get IE ptr corresponding
* to a particular eid
*
* @Return: ptr to IE
*/
uint8_t *wlan_cfg_get_ie_ptr(uint8_t *p_ie, int length, uint8_t eid,
enum size_of_len_field size_of_len_field);

#endif /* __CFGAPI_H */
12 changes: 11 additions & 1 deletion drivers/staging/qcacld-3.0/core/mac/src/include/cfg_global.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011-2015 The Linux Foundation. All rights reserved.
* Copyright (c) 2011-2015, 2018 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
Expand Down Expand Up @@ -93,4 +93,14 @@ typedef struct sAniSirCfg {
uint32_t *gParamList;
} tAniSirCfg, *tpAniSirCfg;

/**
* enum size_of_len_field: IE length size
* @ONE_BYTE: one byte IE length
* @TWO_BYTE: two byte IE length
*/
enum size_of_len_field {
ONE_BYTE = 1,
TWO_BYTE = 2
};

#endif
2 changes: 1 addition & 1 deletion drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_p2p.c
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ void lim_send_p2p_action_frame(tpAniSirGlobal mac_ctx,
if (NULL != p2p_ie) {
/* extract the presence of NoA attribute inside
* P2P IE */
presence_noa_attr = lim_get_ie_ptr_new(mac_ctx,
presence_noa_attr = wlan_cfg_get_ie_ptr(
p2p_ie + SIR_P2P_IE_HEADER_LEN,
p2p_ie[1], SIR_P2P_NOA_ATTR, TWO_BYTE);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4782,9 +4782,9 @@ static void lim_set_pdev_ht_ie(tpAniSirGlobal mac_ctx, uint8_t pdev_id,
ie_params->ie_len);

if (NSS_1x1_MODE == i) {
p_ie = lim_get_ie_ptr_new(mac_ctx, ie_params->ie_ptr,
ie_params->ie_len,
DOT11F_EID_HTCAPS, ONE_BYTE);
p_ie = wlan_cfg_get_ie_ptr(ie_params->ie_ptr,
ie_params->ie_len,
DOT11F_EID_HTCAPS, ONE_BYTE);
if (NULL == p_ie) {
qdf_mem_free(ie_params->ie_ptr);
qdf_mem_free(ie_params);
Expand Down Expand Up @@ -4856,9 +4856,10 @@ static void lim_set_pdev_vht_ie(tpAniSirGlobal mac_ctx, uint8_t pdev_id,
ie_params->ie_len);

if (NSS_1x1_MODE == i) {
p_ie = lim_get_ie_ptr_new(mac_ctx, ie_params->ie_ptr,
ie_params->ie_len,
DOT11F_EID_VHTCAPS, ONE_BYTE);
p_ie = wlan_cfg_get_ie_ptr(ie_params->ie_ptr,
ie_params->ie_len,
DOT11F_EID_VHTCAPS,
ONE_BYTE);
if (NULL == p_ie) {
qdf_mem_free(ie_params->ie_ptr);
qdf_mem_free(ie_params);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1892,8 +1892,7 @@ lim_send_assoc_req_mgmt_frame(tpAniSirGlobal mac_ctx,
if (pe_session->beacon && pe_session->bcnLen > ie_offset) {
bcn_ie = pe_session->beacon + ie_offset;
bcn_ie_len = pe_session->bcnLen - ie_offset;
p_ext_cap = lim_get_ie_ptr_new(mac_ctx,
bcn_ie,
p_ext_cap = wlan_cfg_get_ie_ptr(bcn_ie,
bcn_ie_len,
DOT11F_EID_EXTCAP,
ONE_BYTE);
Expand Down
Loading

0 comments on commit 11240a6

Please sign in to comment.