Skip to content
This repository has been archived by the owner on Dec 28, 2020. It is now read-only.

Commit

Permalink
qcacld-3.0: Merge branch 'android-msm-crosshatch-4.9-q-preview-3' of h…
Browse files Browse the repository at this point in the history
…ttps://android.googlesource.com/kernel/msm-modules/qcacld into neutrino-msm-fajita-4.9

* android-msm-crosshatch-4.9-q-preview-3: (16 commits)
  qcacld-3.0: Possible OOB access in wlan_hdd_cfg80211_start_bss()
  qcacld-3.0: check the data length when downloading firmware
  qcacld-3.0: Fix possible integer underflow in cfg80211_rx_mgmt
  qcacld-3.0: Update connect_timeout correctly in case of scan for ssid
  qcacld-3.0: Check channel_count in DCC_GET_STATS command
  qcacld-3.0: Do rx inorder replenish for fragmented packets
  qcacld-3.0: Do not add MME for bcast non RMF action frames
  qcacld-3.0: Clear PMK cache from driver
  qcacld-3.0: Clear PTK, GTK and IGTK keys on sta disconnection
  qcacld-3.0: Clear Key information from driver memory after disconnect
  qcacld-3.0: Update last_scan_reject_timestamp with proper value
  qcacld-3.0: Fix false alarm scan reject issue
  qcacld-3.0: Fix false alarm scan reject issue
  qcacld-3.0: Cleanup blocked scan requests
  qcacld-3.0: Fix assert when netdev is going down
  qcacld-3.0: Send frames with GCMP MIC LEN if encryption is GCMP

Signed-off-by: Adam W. Willis <return.of.octobot@gmail.com>
  • Loading branch information
0ctobot committed May 19, 2019
2 parents 890771e + 83e593b commit 5ed08ff
Show file tree
Hide file tree
Showing 33 changed files with 458 additions and 85 deletions.
16 changes: 10 additions & 6 deletions drivers/staging/qcacld-3.0/core/bmi/src/ol_fw.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014-2017 The Linux Foundation. All rights reserved.
* Copyright (c) 2014-2018 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
Expand Down Expand Up @@ -376,18 +376,22 @@ __ol_transfer_bin_file(struct ol_context *ol_ctx, enum ATH_BIN_FILE file,
|| chip_id == AR6320_REV1_3_VERSION
|| chip_id == AR6320_REV2_1_VERSION)) {

bin_off = sizeof(SIGN_HEADER_T);
status = bmi_sign_stream_start(address,
(uint8_t *)fw_entry->data,
sizeof(SIGN_HEADER_T), ol_ctx);
bin_off, ol_ctx);
if (status != EOK) {
BMI_ERR("unable to start sign stream");
status = -EINVAL;
goto end;
}

bin_off = sizeof(SIGN_HEADER_T);
bin_len = sign_header->rampatch_len
- sizeof(SIGN_HEADER_T);
bin_len = sign_header->rampatch_len - bin_off;
if (bin_len <= 0 || bin_len > fw_entry_size - bin_off) {
BMI_ERR("Invalid sign header");
status = -EINVAL;
goto end;
}
} else {
bin_sign = false;
bin_off = 0;
Expand Down Expand Up @@ -418,7 +422,7 @@ __ol_transfer_bin_file(struct ol_context *ol_ctx, enum ATH_BIN_FILE file,
bin_off += bin_len;
bin_len = sign_header->total_len - sign_header->rampatch_len;

if (bin_len > 0) {
if (bin_len > 0 && bin_len <= fw_entry_size - bin_off) {
status = bmi_sign_stream_start(0,
(uint8_t *)fw_entry->data +
bin_off, bin_len, ol_ctx);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011,2014-2015, 2017 The Linux Foundation. All rights reserved.
* Copyright (c) 2011,2014-2018 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
Expand Down Expand Up @@ -1815,6 +1815,8 @@ enum {

#define IEEE80211_CCMP_HEADERLEN 8
#define IEEE80211_CCMP_MICLEN 8
#define WLAN_IEEE80211_GCMP_HEADERLEN 8
#define WLAN_IEEE80211_GCMP_MICLEN 16

/*
* 802.11w defines a MMIE chunk to be attached at the end of
Expand Down
6 changes: 6 additions & 0 deletions drivers/staging/qcacld-3.0/core/dp/ol/inc/ol_htt_rx_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,12 @@ void htt_rx_msdu_buff_replenish(htt_pdev_handle pdev);
* Return: number of buffers actually replenished
*/
int htt_rx_msdu_buff_in_order_replenish(htt_pdev_handle pdev, uint32_t num);
#else
static inline
int htt_rx_msdu_buff_in_order_replenish(htt_pdev_handle pdev, uint32_t num)
{
return 0;
}
#endif

/**
Expand Down
29 changes: 28 additions & 1 deletion drivers/staging/qcacld-3.0/core/dp/txrx/ol_rx_defrag.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,26 @@ void ol_rx_frag_send_pktlog_event(struct ol_txrx_pdev_t *pdev,

#endif

#ifndef CONFIG_HL_SUPPORT
static int ol_rx_frag_get_inord_msdu_cnt(qdf_nbuf_t rx_ind_msg)
{
uint32_t *msg_word;
uint8_t *rx_ind_data;
uint32_t msdu_cnt;

rx_ind_data = qdf_nbuf_data(rx_ind_msg);
msg_word = (uint32_t *)rx_ind_data;
msdu_cnt = HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(*(msg_word + 1));

return msdu_cnt;
}
#else
static int ol_rx_frag_get_inord_msdu_cnt(qdf_nbuf_t rx_ind_msg)
{
return 0;
}
#endif

/*
* Process incoming fragments
*/
Expand Down Expand Up @@ -353,7 +373,10 @@ ol_rx_frag_indication_handler(ol_txrx_pdev_handle pdev,
* separate from normal frames
*/
ol_rx_reorder_flush_frag(htt_pdev, peer, tid, seq_num_start);
} else {
msdu_count = ol_rx_frag_get_inord_msdu_cnt(rx_frag_ind_msg);
}

pktlog_bit =
(htt_rx_amsdu_rx_in_order_get_pktlog(rx_frag_ind_msg) == 0x01);
ret = htt_rx_frag_pop(htt_pdev, rx_frag_ind_msg, &head_msdu,
Expand Down Expand Up @@ -389,7 +412,11 @@ ol_rx_frag_indication_handler(ol_txrx_pdev_handle pdev,
htt_rx_desc_frame_free(htt_pdev, head_msdu);
}
/* request HTT to provide new rx MSDU buffers for the target to fill. */
htt_rx_msdu_buff_replenish(htt_pdev);
if (ol_cfg_is_full_reorder_offload(pdev->ctrl_pdev) &&
!pdev->cfg.is_high_latency)
htt_rx_msdu_buff_in_order_replenish(htt_pdev, msdu_count);
else
htt_rx_msdu_buff_replenish(htt_pdev);
}

/*
Expand Down
4 changes: 2 additions & 2 deletions drivers/staging/qcacld-3.0/core/hdd/inc/wlan_hdd_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -1368,8 +1368,6 @@ struct hdd_adapter_s {

/* TODO Move this to sta Ctx */
struct wireless_dev wdev;
struct cfg80211_scan_request *request;
struct cfg80211_scan_request *vendor_request;

/** ops checks if Opportunistic Power Save is Enable or Not
* ctw stores ctWindow value once we receive Opps command from
Expand Down Expand Up @@ -1526,6 +1524,8 @@ struct hdd_adapter_s {
struct delayed_work acs_pending_work;

struct work_struct scan_block_work;
qdf_list_t blocked_scan_request_q;
qdf_mutex_t blocked_scan_request_q_lock;
#ifdef MSM_PLATFORM
unsigned long prev_rx_packets;
unsigned long prev_tx_packets;
Expand Down
21 changes: 19 additions & 2 deletions drivers/staging/qcacld-3.0/core/hdd/src/wlan_hdd_assoc.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012-2018 The Linux Foundation. All rights reserved.
* Copyright (c) 2012-2019 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
Expand Down Expand Up @@ -62,6 +62,7 @@
#include "wlan_hdd_napi.h"
#include <wlan_logging_sock_svc.h>
#include "wlan_hdd_tsf.h"
#include "wlan_hdd_scan.h"

/* These are needed to recognize WPA and RSN suite types */
#define HDD_WPA_OUI_SIZE 4
Expand Down Expand Up @@ -949,6 +950,8 @@ static void hdd_save_bss_info(hdd_adapter_t *adapter,
} else {
hdd_sta_ctx->conn_info.conn_flag.vht_op_present = false;
}
qdf_mem_zero(&hdd_sta_ctx->ibss_enc_key,
sizeof(hdd_sta_ctx->ibss_enc_key));
}

/**
Expand Down Expand Up @@ -1754,6 +1757,7 @@ static QDF_STATUS hdd_dis_connect_handler(hdd_adapter_t *pAdapter,

hdd_wmm_adapter_clear(pAdapter);
sme_ft_reset(WLAN_HDD_GET_HAL_CTX(pAdapter), pAdapter->sessionId);
sme_reset_key(WLAN_HDD_GET_HAL_CTX(pAdapter), pAdapter->sessionId);
if (hdd_remove_beacon_filter(pAdapter) != 0)
hdd_err("hdd_remove_beacon_filter() failed");

Expand Down Expand Up @@ -1934,6 +1938,9 @@ QDF_STATUS hdd_change_peer_state(hdd_adapter_t *pAdapter,
#endif

if (sta_state == OL_TXRX_PEER_STATE_AUTH) {
/* Reset scan reject params on successful set key */
hdd_debug("Reset scan reject params");
hdd_init_scan_reject_params(pAdapter->pHddCtx);
#ifdef QCA_LL_LEGACY_TX_FLOW_CONTROL
/* make sure event is reset */
INIT_COMPLETION(pAdapter->sta_authorized_event);
Expand Down Expand Up @@ -2605,6 +2612,12 @@ static QDF_STATUS hdd_association_completion_handler(hdd_adapter_t *pAdapter,
return QDF_STATUS_E_NULL_VALUE;
}

/*
* reset scan reject params if connection is success or we received
* final failure from CSR after trying with all APs.
*/
hdd_reset_scan_reject_params(pHddCtx, roamStatus, roamResult);

/*
* Enable roaming on other STA iface except this one.
* Firmware dosent support connection on one STA iface while
Expand Down Expand Up @@ -3158,7 +3171,9 @@ static QDF_STATUS hdd_association_completion_handler(hdd_adapter_t *pAdapter,
pRoamInfo ?
pRoamInfo->bssid.bytes :
pWextState->req_bssId.bytes);
connect_timeout = true;
if (roamResult !=
eCSR_ROAM_RESULT_SCAN_FOR_SSID_FAILURE)
connect_timeout = true;
}

/*
Expand Down Expand Up @@ -3232,6 +3247,8 @@ static QDF_STATUS hdd_association_completion_handler(hdd_adapter_t *pAdapter,
timeout_reason);
}
hdd_clear_roam_profile_ie(pAdapter);
sme_reset_key(WLAN_HDD_GET_HAL_CTX(pAdapter),
pAdapter->sessionId);
} else if ((eCSR_ROAM_CANCELLED == roamStatus
&& !hddDisconInProgress)) {
hdd_connect_result(dev,
Expand Down
15 changes: 15 additions & 0 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 @@ -4930,6 +4930,8 @@ static int __wlan_hdd_cfg80211_keymgmt_set_key(struct wiphy *wiphy,
qdf_mem_copy(local_pmk, data, data_len);
sme_roam_set_psk_pmk(WLAN_HDD_GET_HAL_CTX(hdd_adapter_ptr),
hdd_adapter_ptr->sessionId, local_pmk, data_len);
qdf_mem_zero(&local_pmk, SIR_ROAM_SCAN_PSK_SIZE);

return 0;
}

Expand Down Expand Up @@ -15411,6 +15413,7 @@ static int __wlan_hdd_cfg80211_add_key(struct wiphy *wiphy,

default:
hdd_err("Unsupported cipher type: %u", params->cipher);
qdf_mem_zero(&setKey, sizeof(tCsrRoamSetKey));
return -EOPNOTSUPP;
}

Expand All @@ -15431,6 +15434,7 @@ static int __wlan_hdd_cfg80211_add_key(struct wiphy *wiphy,
/* if a key is already installed, block all subsequent ones */
if (pAdapter->sessionCtx.station.ibss_enc_key_installed) {
hdd_debug("IBSS key installed already");
qdf_mem_zero(&setKey, sizeof(tCsrRoamSetKey));
return 0;
}

Expand All @@ -15441,6 +15445,7 @@ static int __wlan_hdd_cfg80211_add_key(struct wiphy *wiphy,

if (0 != status) {
hdd_err("sme_roam_set_key failed, status: %d", status);
qdf_mem_zero(&setKey, sizeof(tCsrRoamSetKey));
return -EINVAL;
}
/*Save the keys here and call sme_roam_set_key for setting
Expand All @@ -15449,6 +15454,7 @@ static int __wlan_hdd_cfg80211_add_key(struct wiphy *wiphy,
&setKey, sizeof(tCsrRoamSetKey));

pAdapter->sessionCtx.station.ibss_enc_key_installed = 1;
qdf_mem_zero(&setKey, sizeof(tCsrRoamSetKey));
return status;
}
if ((pAdapter->device_mode == QDF_SAP_MODE) ||
Expand Down Expand Up @@ -15511,9 +15517,11 @@ static int __wlan_hdd_cfg80211_add_key(struct wiphy *wiphy,
pAdapter->sessionId, &setKey);
if (qdf_ret_status == QDF_STATUS_FT_PREAUTH_KEY_SUCCESS) {
hdd_debug("Update PreAuth Key success");
qdf_mem_zero(&setKey, sizeof(tCsrRoamSetKey));
return 0;
} else if (qdf_ret_status == QDF_STATUS_FT_PREAUTH_KEY_FAILED) {
hdd_err("Update PreAuth Key failed");
qdf_mem_zero(&setKey, sizeof(tCsrRoamSetKey));
return -EINVAL;
}

Expand All @@ -15525,6 +15533,7 @@ static int __wlan_hdd_cfg80211_add_key(struct wiphy *wiphy,
hdd_err("sme_roam_set_key failed, status: %d", status);
pHddStaCtx->roam_info.roamingState =
HDD_ROAM_STATE_NONE;
qdf_mem_zero(&setKey, sizeof(tCsrRoamSetKey));
return -EINVAL;
}

Expand Down Expand Up @@ -15558,10 +15567,12 @@ static int __wlan_hdd_cfg80211_add_key(struct wiphy *wiphy,
hdd_err("sme_roam_set_key failed for group key (IBSS), returned %d", status);
pHddStaCtx->roam_info.roamingState =
HDD_ROAM_STATE_NONE;
qdf_mem_zero(&setKey, sizeof(tCsrRoamSetKey));
return -EINVAL;
}
}
}
qdf_mem_zero(&setKey, sizeof(tCsrRoamSetKey));
EXIT();
return 0;
}
Expand Down Expand Up @@ -20005,6 +20016,8 @@ static int __wlan_hdd_cfg80211_set_pmksa(struct wiphy *wiphy,
sme_set_del_pmkid_cache(halHandle, pAdapter->sessionId,
&pmk_cache, true);

qdf_mem_zero(&pmk_cache, sizeof(pmk_cache));

EXIT();
return QDF_IS_STATUS_SUCCESS(result) ? 0 : -EINVAL;
}
Expand Down Expand Up @@ -20095,6 +20108,8 @@ static int __wlan_hdd_cfg80211_del_pmksa(struct wiphy *wiphy,

sme_set_del_pmkid_cache(halHandle, pAdapter->sessionId, &pmk_cache,
false);
qdf_mem_zero(&pmk_cache, sizeof(pmk_cache));

EXIT();
return status;
}
Expand Down
12 changes: 12 additions & 0 deletions drivers/staging/qcacld-3.0/core/hdd/src/wlan_hdd_hostapd.c
Original file line number Diff line number Diff line change
Expand Up @@ -8420,6 +8420,12 @@ int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter,

if (pIe != NULL) {
pIe++;
if (pIe[0] > SIR_MAC_RATESET_EID_MAX) {
hdd_err("Invalid supported rates %d",
pIe[0]);
ret = -EINVAL;
goto error;
}
pConfig->supported_rates.numRates = pIe[0];
pIe++;
for (i = 0;
Expand All @@ -8436,6 +8442,12 @@ int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter,
WLAN_EID_EXT_SUPP_RATES);
if (pIe != NULL) {
pIe++;
if (pIe[0] > SIR_MAC_RATESET_EID_MAX) {
hdd_err("Invalid supported rates %d",
pIe[0]);
ret = -EINVAL;
goto error;
}
pConfig->extended_rates.numRates = pIe[0];
pIe++;
for (i = 0; i < pConfig->extended_rates.numRates; i++) {
Expand Down
Loading

0 comments on commit 5ed08ff

Please sign in to comment.