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

Commit

Permalink
drivers: staging: Upgrade Wi-Fi stack (LA.UM.6.2.r1-07700-sdm660.0)
Browse files Browse the repository at this point in the history
Changes in qcacld-3.0: (5 commits)
        qcacld-3.0: Add vdev_id sanity check in wma_vdev_stop_resp_handler
        qcacld-3.0: Validate NUD stats commands for FTM mode
        qcacld-3.0: Fix integer underflow and buffer over-read in fwlog
        qcacld-3.0: Stop connection in progress STA when SAP comes up
        qcacld-3.0: Flush scan results on interface down

Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
  • Loading branch information
nathanchance committed Apr 5, 2018
1 parent 71e3807 commit 0821dcd
Show file tree
Hide file tree
Showing 8 changed files with 152 additions and 14 deletions.
11 changes: 10 additions & 1 deletion drivers/staging/qcacld-3.0/core/hdd/inc/wlan_hdd_assoc.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013-2017 The Linux Foundation. All rights reserved.
* Copyright (c) 2013-2018 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
Expand Down Expand Up @@ -240,6 +240,15 @@ bool hdd_conn_is_connected(hdd_station_ctx_t *pHddStaCtx);
*/
eCsrBand hdd_conn_get_connected_band(hdd_station_ctx_t *pHddStaCtx);

/**
* hdd_get_sta_connection_in_progress() - get STA for which connection
* is in progress
* @hdd_ctx: hdd context
*
* Return: hdd adpater for which connection is in progress
*/
hdd_adapter_t *hdd_get_sta_connection_in_progress(hdd_context_t *hdd_ctx);

/**
* hdd_sme_roam_callback() - hdd sme roam callback
* @pContext: pointer to adapter context
Expand Down
9 changes: 9 additions & 0 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 @@ -2911,4 +2911,13 @@ hdd_station_info_t *hdd_get_stainfo(hdd_station_info_t *aStaInfo,
int hdd_driver_memdump_init(void);
void hdd_driver_memdump_deinit(void);

/**
* hdd_is_cli_iface_up() - check if there is any cli iface up
* @hdd_ctx: HDD context
*
* Return: return true if there is any cli iface(STA/P2P_CLI) is up
* else return false
*/
bool hdd_is_cli_iface_up(hdd_context_t *hdd_ctx);

#endif /* end #if !defined(WLAN_HDD_MAIN_H) */
42 changes: 42 additions & 0 deletions drivers/staging/qcacld-3.0/core/hdd/src/wlan_hdd_assoc.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,48 @@ hdd_conn_get_connected_cipher_algo(hdd_station_ctx_t *pHddStaCtx,
return fConnected;
}

hdd_adapter_t *hdd_get_sta_connection_in_progress(hdd_context_t *hdd_ctx)
{
hdd_adapter_list_node_t *adapter_node = NULL, *next = NULL;
hdd_adapter_t *adapter = NULL;
QDF_STATUS status;
hdd_station_ctx_t *hdd_sta_ctx;

if (!hdd_ctx) {
hdd_err("HDD context is NULL");
return NULL;
}

status = hdd_get_front_adapter(hdd_ctx, &adapter_node);
while (NULL != adapter_node && QDF_STATUS_SUCCESS == status) {
adapter = adapter_node->pAdapter;
if (!adapter)
goto end;

hdd_sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
if ((QDF_STA_MODE == adapter->device_mode) ||
(QDF_P2P_CLIENT_MODE == adapter->device_mode) ||
(QDF_P2P_DEVICE_MODE == adapter->device_mode)) {
if (eConnectionState_Connecting ==
hdd_sta_ctx->conn_info.connState) {
hdd_debug("session_id %d: Connection is in progress",
adapter->sessionId);
return adapter;
} else if ((eConnectionState_Associated ==
hdd_sta_ctx->conn_info.connState) &&
!hdd_sta_ctx->conn_info.uIsAuthenticated) {
hdd_debug("session_id %d: Key exchange is in progress",
adapter->sessionId);
return adapter;
}
}
end:
status = hdd_get_next_adapter(hdd_ctx, adapter_node, &next);
adapter_node = next;
}
return NULL;
}

/**
* hdd_remove_beacon_filter() - remove beacon filter
* @adapter: Pointer to the hdd adapter
Expand Down
21 changes: 11 additions & 10 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 @@ -10882,6 +10882,11 @@ static int __wlan_hdd_cfg80211_set_nud_stats(struct wiphy *wiphy,

ENTER();

if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
hdd_err("Command not allowed in FTM mode");
return -EINVAL;
}

err = wlan_hdd_validate_context(hdd_ctx);
if (0 != err)
return err;
Expand Down Expand Up @@ -11469,6 +11474,11 @@ static int __wlan_hdd_cfg80211_get_nud_stats(struct wiphy *wiphy,

ENTER();

if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
hdd_err("Command not allowed in FTM mode");
return -EINVAL;
}

err = wlan_hdd_validate_context(hdd_ctx);
if (0 != err)
return err;
Expand Down Expand Up @@ -17650,16 +17660,7 @@ static int wlan_hdd_cfg80211_connect(struct wiphy *wiphy,
return ret;
}

/**
* wlan_hdd_disconnect() - hdd disconnect api
* @pAdapter: Pointer to adapter
* @reason: Disconnect reason code
*
* This function is used to issue a disconnect request to SME
*
* Return: 0 for success, non-zero for failure
*/
static int wlan_hdd_disconnect(hdd_adapter_t *pAdapter, u16 reason)
int wlan_hdd_disconnect(hdd_adapter_t *pAdapter, u16 reason)
{
int status, result = 0;
unsigned long rc;
Expand Down
11 changes: 11 additions & 0 deletions drivers/staging/qcacld-3.0/core/hdd/src/wlan_hdd_cfg80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,17 @@ void hdd_process_defer_disconnect(hdd_adapter_t *adapter);
*/
int wlan_hdd_try_disconnect(hdd_adapter_t *adapter);

/**
* wlan_hdd_disconnect() - hdd disconnect api
* @pAdapter: Pointer to adapter
* @reason: Disconnect reason code
*
* This function is used to issue a disconnect request to SME
*
* Return: 0 for success, non-zero for failure
*/
int wlan_hdd_disconnect(hdd_adapter_t *pAdapter, u16 reason);

/**
* hdd_bt_activity_cb() - callback function to receive bt activity
* @context: HDD context
Expand Down
29 changes: 29 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 @@ -405,6 +405,10 @@ static int __hdd_hostapd_stop(struct net_device *dev)
hdd_stop_adapter(hdd_ctx, adapter, true);

clear_bit(DEVICE_IFACE_OPENED, &adapter->event_flags);

if (!hdd_is_cli_iface_up(hdd_ctx))
sme_scan_flush_result(hdd_ctx->hHal);

/* Stop all tx queues */
hdd_info("Disabling queues");
wlan_hdd_netif_queue_control(adapter,
Expand Down Expand Up @@ -7841,6 +7845,7 @@ int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter,
enum dfs_mode mode;
bool disable_fw_tdls_state = false;
uint8_t ignore_cac = 0;
hdd_adapter_t *sta_adapter;

ENTER();

Expand All @@ -7857,6 +7862,30 @@ int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter,
}
}

/*
* For STA+SAP concurrency support from GUI, first STA connection gets
* triggered and while it is in progress, SAP start also comes up.
* Once STA association is successful, STA connect event is sent to
* kernel which gets queued in kernel workqueue and supplicant won't
* process M1 received from AP and send M2 until this NL80211_CONNECT
* event is received. Workqueue is not scheduled as RTNL lock is already
* taken by hostapd thread which has issued start_bss command to driver.
* Driver cannot complete start_bss as the pending command at the head
* of the SME command pending list is hw_mode_update for STA session
* which cannot be processed as SME is in WAITforKey state for STA
* interface. The start_bss command for SAP interface is queued behind
* the hw_mode_update command and so it cannot be processed until
* hw_mode_update command is processed. This is causing a deadlock so
* disconnect the STA interface first if connection or key exchange is
* in progress and then start SAP interface.
*/
sta_adapter = hdd_get_sta_connection_in_progress(pHddCtx);
if (sta_adapter) {
hdd_debug("Disconnecting STA with session id: %d",
sta_adapter->sessionId);
wlan_hdd_disconnect(sta_adapter, eCSR_DISCONNECT_REASON_DEAUTH);
}

sme_config = qdf_mem_malloc(sizeof(tSmeConfigParams));
if (!sme_config) {
hdd_err("failed to allocate memory");
Expand Down
29 changes: 29 additions & 0 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 @@ -2373,6 +2373,13 @@ static int __hdd_stop(struct net_device *dev)
/* Make sure the interface is marked as closed */
clear_bit(DEVICE_IFACE_OPENED, &adapter->event_flags);

/*
* Upon wifi turn off, DUT has to flush the scan results so if
* this is the last cli iface, flush the scan database.
*/
if (!hdd_is_cli_iface_up(hdd_ctx))
sme_scan_flush_result(hdd_ctx->hHal);

/*
* Find if any iface is up. If any iface is up then can't put device to
* sleep/power save mode
Expand Down Expand Up @@ -12122,6 +12129,28 @@ void hdd_pld_ipa_uc_shutdown_pipes(void)
hdd_ipa_uc_force_pipe_shutdown(hdd_ctx);
}

bool hdd_is_cli_iface_up(hdd_context_t *hdd_ctx)
{
hdd_adapter_list_node_t *adapter_node = NULL, *next = NULL;
hdd_adapter_t *adapter;
QDF_STATUS status;

status = hdd_get_front_adapter(hdd_ctx, &adapter_node);
while (NULL != adapter_node && QDF_STATUS_SUCCESS == status) {
adapter = adapter_node->pAdapter;
if ((adapter->device_mode == QDF_STA_MODE ||
adapter->device_mode == QDF_P2P_CLIENT_MODE) &&
qdf_atomic_test_bit(DEVICE_IFACE_OPENED,
&adapter->event_flags)){
return true;
}
status = hdd_get_next_adapter(hdd_ctx, adapter_node, &next);
adapter_node = next;
}

return false;
}

/* Register the module init/exit functions */
#ifdef MODULE
module_init(hdd_module_init);
Expand Down
14 changes: 11 additions & 3 deletions drivers/staging/qcacld-3.0/core/utils/fwlog/dbglog_host.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013-2017 The Linux Foundation. All rights reserved.
* Copyright (c) 2013-2018 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
Expand Down Expand Up @@ -1480,7 +1480,7 @@ static int dbglog_print_raw_data(A_UINT32 *buffer, A_UINT32 length)
char parseArgsString[DBGLOG_PARSE_ARGS_STRING_LENGTH];
char *dbgidString;

while (count < length) {
while ((count + 1) < length) {

debugid = DBGLOG_GET_DBGID(buffer[count + 1]);
moduleid = DBGLOG_GET_MODULEID(buffer[count + 1]);
Expand All @@ -1493,6 +1493,9 @@ static int dbglog_print_raw_data(A_UINT32 *buffer, A_UINT32 length)
OS_MEMZERO(parseArgsString, sizeof(parseArgsString));
totalWriteLen = 0;

if (!numargs || (count + numargs + 2 > length))
goto skip_args_processing;

for (curArgs = 0; curArgs < numargs; curArgs++) {
/*
* Using sprintf_s instead of sprintf,
Expand All @@ -1505,7 +1508,7 @@ static int dbglog_print_raw_data(A_UINT32 *buffer, A_UINT32 length)
buffer[count + 2 + curArgs]);
totalWriteLen += writeLen;
}

skip_args_processing:
if (debugid < MAX_DBG_MSGS) {
dbgidString = DBG_MSG_ARR[moduleid][debugid];
if (dbgidString != NULL) {
Expand Down Expand Up @@ -1997,6 +2000,11 @@ int dbglog_parse_debug_logs(ol_scn_t scn, uint8_t *data, uint32_t datalen)
len = param_buf->num_bufp;
}

if (len < sizeof(dropped)) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Invalid length\n"));
return A_ERROR;
}

dropped = *((A_UINT32 *) datap);
if (dropped > 0) {
AR_DEBUG_PRINTF(ATH_DEBUG_TRC,
Expand Down

0 comments on commit 0821dcd

Please sign in to comment.