From 7d6e1fd7aa904466207c56d2a220203b2d447308 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Fri, 18 Jul 2014 13:00:45 -0700 Subject: wlan: hdd: Remove obsolete ISOC and WIFI_2_0 conditions The qcacld driver contains a large amount of conditional compilation that was initially added to allow the driver to support both integrated and discrete wlan solutions. However it has been decided that the integrated solutions will only be supported by the prima driver, so remove from HDD all of the conditional compilation that is now obsolete. - Code that is conditional upon QCA_WIFI_ISOC being defined is removed. - Code that is conditional upon QCA_WIFI_ISOC not being defined is retained without conditional compilation. - Code that is conditional upon QCA_WIFI_2_0 being defined is retained without conditional compilation. - Code that is conditional upon QCA_WIFI_2_0 not being defined is removed. Change-Id: I5d11c5d7c4bb5d45ca98c491633a26d1be69e29a CRs-fixed: 698342 --- CORE/HDD/inc/qc_sap_ioctl.h | 2 - CORE/HDD/inc/wlan_hdd_assoc.h | 9 - CORE/HDD/inc/wlan_hdd_cfg.h | 32 -- CORE/HDD/inc/wlan_hdd_cfg80211.h | 5 +- CORE/HDD/inc/wlan_hdd_dev_pwr.h | 46 --- CORE/HDD/inc/wlan_hdd_ftm.h | 5 +- CORE/HDD/inc/wlan_hdd_main.h | 15 - CORE/HDD/inc/wlan_hdd_oemdata.h | 10 - CORE/HDD/inc/wlan_hdd_softap_tx_rx.h | 21 -- CORE/HDD/inc/wlan_hdd_tdls.h | 12 - CORE/HDD/inc/wlan_hdd_tx_rx.h | 20 -- CORE/HDD/inc/wlan_hdd_wowl.h | 6 - CORE/HDD/src/wlan_hdd_assoc.c | 23 -- CORE/HDD/src/wlan_hdd_cfg.c | 23 +- CORE/HDD/src/wlan_hdd_cfg80211.c | 121 +------- CORE/HDD/src/wlan_hdd_dev_pwr.c | 405 +------------------------ CORE/HDD/src/wlan_hdd_early_suspend.c | 109 +------ CORE/HDD/src/wlan_hdd_ftm.c | 120 +------- CORE/HDD/src/wlan_hdd_hostapd.c | 74 ----- CORE/HDD/src/wlan_hdd_main.c | 321 +------------------- CORE/HDD/src/wlan_hdd_oemdata.c | 4 - CORE/HDD/src/wlan_hdd_p2p.c | 2 - CORE/HDD/src/wlan_hdd_softap_tx_rx.c | 421 -------------------------- CORE/HDD/src/wlan_hdd_tdls.c | 328 -------------------- CORE/HDD/src/wlan_hdd_tx_rx.c | 548 ---------------------------------- CORE/HDD/src/wlan_hdd_wext.c | 74 ----- CORE/HDD/src/wlan_hdd_wmm.c | 86 ------ 27 files changed, 34 insertions(+), 2808 deletions(-) diff --git a/CORE/HDD/inc/qc_sap_ioctl.h b/CORE/HDD/inc/qc_sap_ioctl.h index e5d693a90575..b6584721d3e7 100644 --- a/CORE/HDD/inc/qc_sap_ioctl.h +++ b/CORE/HDD/inc/qc_sap_ioctl.h @@ -179,7 +179,6 @@ typedef struct #define QCSAP_IOCTL_MAX_STR_LEN 1024 -#ifdef QCA_WIFI_2_0 #define RC_2_RATE_IDX(_rc) ((_rc) & 0x7) #define HT_RC_2_STREAMS(_rc) ((((_rc) & 0x78) >> 3) + 1) @@ -187,7 +186,6 @@ typedef struct #define RC_2_RATE_IDX_11AC(_rc) ((_rc) & 0xf) #define HT_RC_2_STREAMS_11AC(_rc) ((((_rc) & 0x30) >> 4) + 1) -#endif /* QCA_WIFI_2_0 */ enum { QCSAP_PARAM_MAX_ASSOC = 1, diff --git a/CORE/HDD/inc/wlan_hdd_assoc.h b/CORE/HDD/inc/wlan_hdd_assoc.h index 9c53f4b28f0e..4abef31bffaa 100644 --- a/CORE/HDD/inc/wlan_hdd_assoc.h +++ b/CORE/HDD/inc/wlan_hdd_assoc.h @@ -32,13 +32,8 @@ #ifdef FEATURE_WLAN_TDLS #define HDD_MAX_NUM_TDLS_STA ( 8 ) #define HDD_MAX_NUM_TDLS_STA_P_UAPSD ( 1 ) -#ifdef QCA_WIFI_2_0 #define TDLS_STA_INDEX_VALID(staId) \ (((staId) >= 1) && ((staId) < 0xFF)) -#else -#define TDLS_STA_INDEX_VALID(staId) \ - (((staId) >= 4) && ((staId) < 0xFF)) -#endif #endif #define TKIP_COUNTER_MEASURE_STARTED 1 #define TKIP_COUNTER_MEASURE_STOPED 0 @@ -127,13 +122,11 @@ typedef struct hdd_station_ctx hdd_station_ctx_t; typedef struct hdd_ap_ctx_s hdd_ap_ctx_t; typedef struct hdd_mon_ctx_s hdd_mon_ctx_t; -#ifdef QCA_WIFI_2_0 typedef enum { ePeerConnected = 1, ePeerDisconnected }ePeerStatus; -#endif /* QCA_WIFI_2_0 */ extern v_BOOL_t hdd_connIsConnected( hdd_station_ctx_t *pHddStaCtx ); eCsrBand hdd_connGetConnectedBand( hdd_station_ctx_t *pHddStaCtx ); @@ -152,13 +145,11 @@ VOS_STATUS hdd_roamRegisterTDLSSTA( hdd_adapter_t *pAdapter, tANI_U8 *peerMac, tANI_U16 staId, tANI_U8 ucastSig); void hdd_PerformRoamSetKeyComplete(hdd_adapter_t *pAdapter); -#ifdef QCA_WIFI_2_0 void hdd_SendPeerStatusIndToOemApp(v_MACADDR_t *peerMac, tANI_U8 peerStatus, tANI_U8 peerTimingMeasCap, tANI_U8 sessionId, tANI_U8 chanId); -#endif /* QCA_WIFI_2_0 */ #if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD) void hdd_indicateEseBcnReportNoResults(const hdd_adapter_t *pAdapter, const tANI_U16 measurementToken, diff --git a/CORE/HDD/inc/wlan_hdd_cfg.h b/CORE/HDD/inc/wlan_hdd_cfg.h index c1cb4076f41c..261228246fa0 100644 --- a/CORE/HDD/inc/wlan_hdd_cfg.h +++ b/CORE/HDD/inc/wlan_hdd_cfg.h @@ -45,14 +45,9 @@ #include #include #include -#if defined (QCA_WIFI_2_0) && \ - !defined (QCA_WIFI_ISOC) #include -#endif -#ifdef QCA_WIFI_2_0 #define FW_MODULE_LOG_LEVEL_STRING_LENGTH (255) -#endif //Number of items that can be configured #define MAX_CFG_INI_ITEMS 512 @@ -1600,7 +1595,6 @@ typedef enum #define CFG_ENABLE_PACKET_LOG_MAX ( 1 ) #define CFG_ENABLE_PACKET_LOG_DEFAULT ( 0 ) -#ifdef QCA_WIFI_2_0 #define CFG_ENABLE_FW_LOG_TYPE "gFwDebugLogType" #define CFG_ENABLE_FW_LOG_TYPE_MIN ( 0 ) #define CFG_ENABLE_FW_LOG_TYPE_MAX ( 255 ) @@ -1615,7 +1609,6 @@ typedef enum #define CFG_ENABLE_FW_MODULE_LOG_LEVEL "gFwDebugModuleLoglevel" #define CFG_ENABLE_FW_MODULE_LOG_DEFAULT "" -#endif #ifdef FEATURE_GREEN_AP #define CFG_ENABLE_GREEN_AP_FEATURE "gEnableGreenAp" @@ -1839,7 +1832,6 @@ typedef enum #define CFG_THERMAL_MIGRATION_ENABLE_DEFAULT ( 0 ) -#ifndef QCA_WIFI_ISOC #define CFG_THROTTLE_PERIOD_NAME "gThrottlePeriod" #define CFG_THROTTLE_PERIOD_MIN ( 10 ) @@ -1886,7 +1878,6 @@ typedef enum #define CFG_THERMAL_TEMP_MAX_LEVEL3_MAX ( 1000 ) #define CFG_THERMAL_TEMP_MAX_LEVEL3_DEFAULT ( 0 ) -#endif /*#ifndef QCA_WIFI_ISOC*/ /* * Enable/Disable Modulated DTIM feature @@ -2002,12 +1993,10 @@ typedef enum #define CFG_TDLS_RSSI_TEARDOWN_THRESHOLD_MAX ( 0 ) #define CFG_TDLS_RSSI_TEARDOWN_THRESHOLD_DEFAULT ( -75 ) -#ifdef QCA_WIFI_2_0 #define CFG_TDLS_RSSI_DELTA "gTDLSRSSIDelta" #define CFG_TDLS_RSSI_DELTA_MIN ( -30 ) #define CFG_TDLS_RSSI_DELTA_MAX ( 0 ) #define CFG_TDLS_RSSI_DELTA_DEFAULT ( -20 ) -#endif #define CFG_TDLS_QOS_WMM_UAPSD_MASK_NAME "gTDLSUapsdMask" // ACs to setup U-APSD for TDLS Sta #define CFG_TDLS_QOS_WMM_UAPSD_MASK_MIN (0) @@ -2018,11 +2007,7 @@ typedef enum #define CFG_TDLS_BUFFER_STA_SUPPORT_ENABLE_MIN (0) #define CFG_TDLS_BUFFER_STA_SUPPORT_ENABLE_MAX (1) /* Buffer STA is not enabled in CLD 2.0 yet */ -#ifdef QCA_WIFI_2_0 #define CFG_TDLS_BUFFER_STA_SUPPORT_ENABLE_DEFAULT (0) -#else -#define CFG_TDLS_BUFFER_STA_SUPPORT_ENABLE_DEFAULT (1) -#endif #define CFG_TDLS_PUAPSD_INACTIVITY_TIME "gTDLSPuapsdInactivityTime" #define CFG_TDLS_PUAPSD_INACTIVITY_TIME_MIN (0) @@ -2560,7 +2545,6 @@ This feature requires the dependent cfg.ini "gRoamPrefer5GHz" set to 1 */ #define CFG_ENABLE_STRICT_REGULATORY_FOR_FCC_MAX ( 1 ) #define CFG_ENABLE_STRICT_REGULATORY_FOR_FCC_DEFAULT ( 0 ) -#ifdef QCA_WIFI_2_0 #define CFG_SAP_MAX_OFFLOAD_PEERS "gMaxOffloadPeers" #define CFG_SAP_MAX_OFFLOAD_PEERS_MIN (2) #define CFG_SAP_MAX_OFFLOAD_PEERS_MAX (5) @@ -2570,7 +2554,6 @@ This feature requires the dependent cfg.ini "gRoamPrefer5GHz" set to 1 */ #define CFG_SAP_MAX_OFFLOAD_REORDER_BUFFS_MIN (0) #define CFG_SAP_MAX_OFFLOAD_REORDER_BUFFS_MAX (3) #define CFG_SAP_MAX_OFFLOAD_REORDER_BUFFS_DEFAULT (2) -#endif #ifdef FEATURE_WLAN_RA_FILTERING #define CFG_RA_FILTER_ENABLE_NAME "gRAFilterEnable" @@ -2668,12 +2651,10 @@ This feature requires the dependent cfg.ini "gRoamPrefer5GHz" set to 1 */ #define CFG_DFS_RADAR_PRI_MULTIPLIER_DEFAULT ( 4 ) #define CFG_DFS_RADAR_PRI_MULTIPLIER_MIN ( 0 ) #define CFG_DFS_RADAR_PRI_MULTIPLIER_MAX ( 10 ) -#if !defined(QCA_WIFI_ISOC) #define CFG_REORDER_OFFLOAD_SUPPORT_NAME "gReorderOffloadSupported" #define CFG_REORDER_OFFLOAD_SUPPORT_MIN ( 0 ) #define CFG_REORDER_OFFLOAD_SUPPORT_MAX ( 1 ) #define CFG_REORDER_OFFLOAD_SUPPORT_DEFAULT ( 0 ) -#endif #ifdef WLAN_FEATURE_ROAM_OFFLOAD #define CFG_ROAMING_OFFLOAD_NAME "gRoamOffloadEnabled" @@ -3086,9 +3067,7 @@ typedef struct v_U8_t allowMCCGODiffBI; v_BOOL_t isP2pDeviceAddrAdministrated; v_U8_t thermalMitigationEnable; -#ifndef QCA_WIFI_ISOC v_U32_t throttlePeriod; -#endif #ifdef WLAN_FEATURE_11AC v_U8_t vhtChannelWidth; v_U8_t vhtRxMCS; @@ -3130,9 +3109,7 @@ typedef struct v_U32_t fTDLSRSSIHysteresis; v_S31_t fTDLSRSSITriggerThreshold; v_S31_t fTDLSRSSITeardownThreshold; -#ifdef QCA_WIFI_2_0 v_S31_t fTDLSRSSIDelta; -#endif v_U32_t fTDLSUapsdMask; // what ACs to setup U-APSD for TDLS v_U32_t fEnableTDLSBufferSta; v_U32_t fEnableTDLSSleepSta; @@ -3233,7 +3210,6 @@ typedef struct v_U8_t maxNumberOfPeers; v_U8_t disableDFSChSwitch; v_U8_t enableDFSMasterCap; -#ifndef QCA_WIFI_ISOC v_U16_t thermalTempMinLevel0; v_U16_t thermalTempMaxLevel0; v_U16_t thermalTempMinLevel1; @@ -3244,7 +3220,6 @@ typedef struct v_U16_t thermalTempMaxLevel3; v_U32_t TxPower2g; v_U32_t TxPower5g; -#endif v_U32_t gEnableDebugLog; v_U8_t enableRxThread; v_BOOL_t fDfsPhyerrFilterOffload; @@ -3287,12 +3262,10 @@ typedef struct v_U32_t busBandwidthComputeInterval; #endif /* MSM_PLATFORM */ -#ifdef QCA_WIFI_2_0 /* FW debug log parameters */ v_U32_t enableFwLogType; v_U32_t enableFwLogLevel; v_U8_t enableFwModuleLogLevel[FW_MODULE_LOG_LEVEL_STRING_LENGTH]; -#endif #ifdef WLAN_FEATURE_11W v_U32_t pmfSaQueryMaxRetries; @@ -3312,9 +3285,7 @@ typedef struct #endif v_S31_t dfsRadarPriMultiplier; -#if !defined(QCA_WIFI_ISOC) v_U8_t reorderOffloadSupport; -#endif #ifdef WLAN_FEATURE_ROAM_OFFLOAD v_BOOL_t isRoamOffloadEnabled; @@ -3476,11 +3447,8 @@ VOS_STATUS hdd_execute_sap_dyn_config_command(hdd_adapter_t *pAdapter, tANI_BOOLEAN hdd_is_okc_mode_enabled(hdd_context_t *pHddCtx); VOS_STATUS hdd_set_idle_ps_config(hdd_context_t *pHddCtx, v_U32_t val); -#if defined (QCA_WIFI_2_0) && \ - !defined (QCA_WIFI_ISOC) void hdd_update_tgt_cfg(void *context, void *param); void hdd_dfs_indicate_radar(void *context, void *param); -#endif /* QCA_WIFI_2_0 && !QCA_WIFI_ISOC */ VOS_STATUS hdd_string_to_u8_array( char *str, tANI_U8 *intArray, tANI_U8 *len, tANI_U8 intArrayMaxLen ); diff --git a/CORE/HDD/inc/wlan_hdd_cfg80211.h b/CORE/HDD/inc/wlan_hdd_cfg80211.h index c3fd9da4a316..e23eb8bbea07 100644 --- a/CORE/HDD/inc/wlan_hdd_cfg80211.h +++ b/CORE/HDD/inc/wlan_hdd_cfg80211.h @@ -825,16 +825,13 @@ v_U8_t* wlan_hdd_cfg80211_get_ie_ptr(v_U8_t *pIes, int length, v_U8_t eid); int wlan_hdd_cfg80211_del_station(struct wiphy *wiphy, struct net_device *dev, u8 *mac); -#if defined(QCA_WIFI_2_0) && defined(QCA_WIFI_FTM) \ - && !defined(QCA_WIFI_ISOC) && defined(CONFIG_NL80211_TESTMODE) +#if defined(QCA_WIFI_FTM) && defined(CONFIG_NL80211_TESTMODE) void wlan_hdd_testmode_rx_event(void *buf, size_t buf_len); #endif -#ifdef QCA_WIFI_2_0 void hdd_suspend_wlan(void (*callback)(void *callbackContext, boolean suspended), void *callbackContext); void hdd_resume_wlan(void); -#endif #ifdef FEATURE_WLAN_CH_AVOID int wlan_hdd_send_avoid_freq_event(hdd_context_t *pHddCtx, diff --git a/CORE/HDD/inc/wlan_hdd_dev_pwr.h b/CORE/HDD/inc/wlan_hdd_dev_pwr.h index ae7ab7899490..c17b1b0a6031 100644 --- a/CORE/HDD/inc/wlan_hdd_dev_pwr.h +++ b/CORE/HDD/inc/wlan_hdd_dev_pwr.h @@ -33,51 +33,6 @@ #include #include -#ifdef QCA_WIFI_ISOC -/*---------------------------------------------------------------------------- - - @brief Registration function. - Register suspend, resume callback functions with platform driver. - - @param hdd_context_t pHddCtx - Global hdd context - - @return General status code - VOS_STATUS_SUCCESS Registration Success - VOS_STATUS_E_FAILURE Registration Fail - -----------------------------------------------------------------------------*/ -VOS_STATUS hddRegisterPmOps(hdd_context_t *pHddCtx); - -/*---------------------------------------------------------------------------- - - @brief De-registration function. - Deregister the suspend, resume callback functions with platform driver - - @param hdd_context_t pHddCtx - Global hdd context - - @return General status code - VOS_STATUS_SUCCESS De-Registration Success - VOS_STATUS_E_FAILURE De-Registration Fail - -----------------------------------------------------------------------------*/ -VOS_STATUS hddDeregisterPmOps(hdd_context_t *pHddCtx); - -/*---------------------------------------------------------------------------- - - @brief TM Level Change handler - Received Tm Level changed notification - - @param dev : Device context - changedTmLevel : Changed new TM level - - @return - -----------------------------------------------------------------------------*/ -void hddDevTmLevelChangedHandler(struct device *dev, int changedTmLevel); - -#else /*---------------------------------------------------------------------------- @@ -131,7 +86,6 @@ static inline void hddDevTmLevelChangedHandler(struct device *dev, { return; } -#endif /*QCA_WIFI_ISOC*/ /*---------------------------------------------------------------------------- diff --git a/CORE/HDD/inc/wlan_hdd_ftm.h b/CORE/HDD/inc/wlan_hdd_ftm.h index b1758be7e28a..97217240af40 100644 --- a/CORE/HDD/inc/wlan_hdd_ftm.h +++ b/CORE/HDD/inc/wlan_hdd_ftm.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2014 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -212,8 +212,7 @@ int wlan_hdd_ftm_open(hdd_context_t *pHddCtx); void wlan_hdd_process_ftm_cmd (hdd_context_t *pHddCtx,tAniNlHdr *wnl); int wlan_hdd_ftm_close(hdd_context_t *pHddCtx); -#if defined(QCA_WIFI_2_0) && defined(QCA_WIFI_FTM) \ - && !defined(QCA_WIFI_ISOC) +#if defined(QCA_WIFI_FTM) VOS_STATUS wlan_hdd_ftm_testmode_cmd(void *data, int len); int wlan_hdd_qcmbr_unified_ioctl(hdd_adapter_t *pAdapter, struct ifreq *ifr); #endif diff --git a/CORE/HDD/inc/wlan_hdd_main.h b/CORE/HDD/inc/wlan_hdd_main.h index 570823d02c0b..87a540c3d6e9 100644 --- a/CORE/HDD/inc/wlan_hdd_main.h +++ b/CORE/HDD/inc/wlan_hdd_main.h @@ -108,7 +108,6 @@ #define WLAN_WAIT_TIME_SESSIONOPENCLOSE 15000 #define WLAN_WAIT_TIME_ABORTSCAN 2000 -#ifdef QCA_WIFI_2_0 /** Maximum time(ms) to wait for mc thread suspend **/ #define WLAN_WAIT_TIME_MCTHREAD_SUSPEND 1200 @@ -116,7 +115,6 @@ /** Maximum time(ms) to wait for target to be ready for suspend **/ #define WLAN_WAIT_TIME_READY_TO_SUSPEND 2000 -#endif /** Maximum time(ms) to wait for tdls add sta to complete **/ #define WAIT_TIME_TDLS_ADD_STA 1500 @@ -204,15 +202,11 @@ #define HDD_MOD_EXIT_SSR_MAX_RETRIES 30 /* Maximum number of interfaces allowed(STA, P2P Device, P2P Interfaces) */ -#ifndef QCA_WIFI_2_0 -#define WLAN_MAX_INTERFACES 3 -#else #ifndef WLAN_OPEN_P2P_INTERFACE #define WLAN_MAX_INTERFACES 3 #else #define WLAN_MAX_INTERFACES 4 #endif -#endif #ifdef WLAN_FEATURE_GTK_OFFLOAD #define GTK_OFFLOAD_ENABLE 0 @@ -300,9 +294,6 @@ extern spinlock_t hdd_context_lock; #define HDD_GET_BATCH_SCAN_RSP_TIME_OUT (15000) /*Batch scan req timeout in ms*/ #define HDD_BATCH_SCAN_AP_META_INFO_SIZE (150) /*AP meta info size in string*/ -#ifndef QCA_WIFI_2_0 -#define MIN(a, b) (a > b ? b : a) -#endif #endif #ifdef QCA_LL_TX_FLOW_CT @@ -1346,13 +1337,11 @@ struct hdd_context_s #endif /* WLAN_KD_READY_NOTIFIER */ #ifdef FEATURE_OEM_DATA_SUPPORT -#ifdef QCA_WIFI_2_0 /* OEM App registered or not */ v_BOOL_t oem_app_registered; /* OEM App Process ID */ v_SINT_t oem_pid; -#endif #endif v_U8_t change_iface; @@ -1477,7 +1466,6 @@ struct hdd_context_s v_BOOL_t isVHT80Allowed; struct completion ready_to_suspend; -#ifdef QCA_WIFI_2_0 /* defining the solution type */ v_U32_t target_type; @@ -1491,7 +1479,6 @@ struct hdd_context_s v_U32_t target_hw_revision; /* chip/rom name */ const char *target_hw_name; -#endif struct regulatory reg; #ifdef FEATURE_WLAN_CH_AVOID v_U16_t unsafe_channel_count; @@ -1600,9 +1587,7 @@ void hdd_set_ssr_required(e_hdd_ssr_required value); VOS_STATUS hdd_enable_bmps_imps(hdd_context_t *pHddCtx); VOS_STATUS hdd_disable_bmps_imps(hdd_context_t *pHddCtx, tANI_U8 session_type); -#ifdef QCA_WIFI_2_0 void wlan_hdd_cfg80211_update_wiphy_caps(struct wiphy *wiphy); -#endif VOS_STATUS hdd_setIbssPowerSaveParams(hdd_adapter_t *pAdapter); void wlan_hdd_cfg80211_update_reg_info(struct wiphy *wiphy); VOS_STATUS wlan_hdd_restart_driver(hdd_context_t *pHddCtx); diff --git a/CORE/HDD/inc/wlan_hdd_oemdata.h b/CORE/HDD/inc/wlan_hdd_oemdata.h index 955f49b9698b..e4b232cc68cb 100644 --- a/CORE/HDD/inc/wlan_hdd_oemdata.h +++ b/CORE/HDD/inc/wlan_hdd_oemdata.h @@ -40,22 +40,13 @@ #define __WLAN_HDD_OEM_DATA_H__ #ifndef OEM_DATA_REQ_SIZE -#ifdef QCA_WIFI_2_0 #define OEM_DATA_REQ_SIZE 280 -#else -#define OEM_DATA_REQ_SIZE 134 -#endif #endif #ifndef OEM_DATA_RSP_SIZE -#ifdef QCA_WIFI_2_0 #define OEM_DATA_RSP_SIZE 1724 -#else -#define OEM_DATA_RSP_SIZE 1968 -#endif #endif -#ifdef QCA_WIFI_2_0 #define OEM_APP_SIGNATURE_LEN 16 #define OEM_APP_SIGNATURE_STR "QUALCOMM-OEM-APP" @@ -161,7 +152,6 @@ typedef PACKED_PRE struct PACKED_POST /* channel info on which peer is connected */ tHddChannelInfo peer_chan_info; } tPeerStatusInfo; -#endif /* QCA_WIFI_2_0 */ struct iw_oem_data_req { diff --git a/CORE/HDD/inc/wlan_hdd_softap_tx_rx.h b/CORE/HDD/inc/wlan_hdd_softap_tx_rx.h index b78ec1c13be8..c5fddd676a51 100644 --- a/CORE/HDD/inc/wlan_hdd_softap_tx_rx.h +++ b/CORE/HDD/inc/wlan_hdd_softap_tx_rx.h @@ -200,26 +200,6 @@ extern VOS_STATUS hdd_softap_tx_fetch_packet_cbk( v_VOID_t *vosContext, extern VOS_STATUS hdd_softap_tx_low_resource_cbk( vos_pkt_t *pVosPacket, v_VOID_t *userData ); -#ifndef QCA_WIFI_2_0 -/**============================================================================ - @brief hdd_softap_rx_packet_cbk() - Receive callback registered with TL. - TL will call this to notify the HDD when a packet was received - for a registered STA. - - @param vosContext : [in] pointer to VOS context - @param pVosPacket : [in] pointer to VOS packet (conatining sk_buff) - @param staId : [in] Station Id - @param pRxMetaInfo : [in] pointer to meta info for the received pkt(s) - - @return : VOS_STATUS_E_FAILURE if any errors encountered, - : VOS_STATUS_SUCCESS otherwise - ===========================================================================*/ -extern VOS_STATUS hdd_softap_rx_packet_cbk( v_VOID_t *vosContext, - vos_pkt_t *pVosPacket, - v_U8_t staId, - WLANTL_RxMetaInfoType* pRxMetaInfo ); - -#else /**============================================================================ @brief hdd_softap_rx_packet_cbk() - Receive callback registered with TL. TL will call this to notify the HDD when a packet was received @@ -251,7 +231,6 @@ extern VOS_STATUS hdd_softap_rx_packet_cbk(v_VOID_t *vosContext, VOS_STATUS hdd_softap_rx_mul_packet_cbk(v_VOID_t *vosContext, adf_nbuf_t rx_buf_list, v_U8_t staId); #endif /* IPA_OFFLOAD */ -#endif /**============================================================================ @brief hdd_softap_DeregisterSTA - Deregister a station from TL block diff --git a/CORE/HDD/inc/wlan_hdd_tdls.h b/CORE/HDD/inc/wlan_hdd_tdls.h index 47243a217d31..8ffb12d0a9ff 100644 --- a/CORE/HDD/inc/wlan_hdd_tdls.h +++ b/CORE/HDD/inc/wlan_hdd_tdls.h @@ -82,9 +82,7 @@ typedef struct tANI_U32 rssi_hysteresis; tANI_S32 rssi_trigger_threshold; tANI_S32 rssi_teardown_threshold; -#ifdef QCA_WIFI_2_0 tANI_S32 rssi_delta; -#endif } tdls_config_params_t; typedef struct @@ -147,9 +145,6 @@ typedef struct { hdd_adapter_t *pAdapter; #ifdef TDLS_USE_SEPARATE_DISCOVERY_TIMER vos_timer_t peerDiscoverTimer; -#endif -#ifndef QCA_WIFI_2_0 - vos_timer_t peerUpdateTimer; #endif vos_timer_t peerDiscoveryTimeoutTimer; tdls_config_params_t threshold_config; @@ -183,9 +178,6 @@ typedef struct _hddTdlsPeer_t { tANI_U8 supported_channels[SIR_MAC_MAX_SUPP_CHANNELS]; tANI_U8 supported_oper_classes_len; tANI_U8 supported_oper_classes[SIR_MAC_MAX_SUPP_OPER_CLASSES]; -#ifndef QCA_WIFI_2_0 - vos_timer_t peerIdleTimer; -#endif vos_timer_t initiatorWaitTimeoutTimer; tANI_BOOLEAN isForcedPeer; } hddTdlsPeer_t; @@ -199,7 +191,6 @@ typedef struct { v_MACADDR_t peerMac; } tdlsConnInfo_t; -#ifdef QCA_WIFI_2_0 typedef struct { tANI_U32 vdev_id; tANI_U32 tdls_state; @@ -215,7 +206,6 @@ typedef struct { tANI_U32 puapsd_inactivity_time; tANI_U32 puapsd_rx_frame_threshold; } tdlsInfo_t; -#endif int wlan_hdd_tdls_init(hdd_adapter_t *pAdapter); @@ -316,12 +306,10 @@ void wlan_hdd_tdls_indicate_teardown(hdd_adapter_t *pAdapter, hddTdlsPeer_t *curr_peer, tANI_U16 reason); -#ifdef QCA_WIFI_2_0 #ifdef CONFIG_TDLS_IMPLICIT void wlan_hdd_tdls_pre_setup_init_work(tdlsCtx_t *pHddTdlsCtx, hddTdlsPeer_t *curr_candidate); #endif -#endif int wlan_hdd_tdls_set_force_peer(hdd_adapter_t *pAdapter, u8 *mac, tANI_BOOLEAN forcePeer); diff --git a/CORE/HDD/inc/wlan_hdd_tx_rx.h b/CORE/HDD/inc/wlan_hdd_tx_rx.h index 0925e7894192..d970bb4e105a 100644 --- a/CORE/HDD/inc/wlan_hdd_tx_rx.h +++ b/CORE/HDD/inc/wlan_hdd_tx_rx.h @@ -197,25 +197,6 @@ extern VOS_STATUS hdd_tx_fetch_packet_cbk( v_VOID_t *vosContext, extern VOS_STATUS hdd_tx_low_resource_cbk( vos_pkt_t *pVosPacket, v_VOID_t *userData ); -#ifndef QCA_WIFI_2_0 -/**============================================================================ - @brief hdd_rx_packet_cbk() - Receive callback registered with TL. - TL will call this to notify the HDD when a packet was received - for a registered STA. - - @param vosContext : [in] pointer to VOS context - @param pVosPacket : [in] pointer to VOS packet (conatining sk_buff) - @param staId : [in] Station Id - @param pRxMetaInfo : [in] pointer to meta info for the received pkt(s) - - @return : VOS_STATUS_E_FAILURE if any errors encountered, - : VOS_STATUS_SUCCESS otherwise - ===========================================================================*/ -extern VOS_STATUS hdd_rx_packet_cbk( v_VOID_t *vosContext, - vos_pkt_t *pVosPacket, - v_U8_t staId, - WLANTL_RxMetaInfoType* pRxMetaInfo ); -#else /**============================================================================ @brief hdd_rx_packet_cbk() - Receive callback registered with TL. TL will call this to notify the HDD when a packet was received @@ -247,7 +228,6 @@ extern VOS_STATUS hdd_rx_packet_cbk(v_VOID_t *vosContext, adf_nbuf_t rxBufChain, VOS_STATUS hdd_rx_mul_packet_cbk(v_VOID_t *vosContext, adf_nbuf_t rx_buf_list, v_U8_t staId); #endif /* IPA_OFFLOAD */ -#endif /**============================================================================ @brief hdd_IsEAPOLPacket() - Checks the packet is EAPOL or not. diff --git a/CORE/HDD/inc/wlan_hdd_wowl.h b/CORE/HDD/inc/wlan_hdd_wowl.h index d6eab9ff18d9..96b9ea639a5b 100644 --- a/CORE/HDD/inc/wlan_hdd_wowl.h +++ b/CORE/HDD/inc/wlan_hdd_wowl.h @@ -107,15 +107,9 @@ /*---------------------------------------------------------------------------- * Preprocessor Definitions and Constants * -------------------------------------------------------------------------*/ -#ifdef QCA_WIFI_2_0 #define WOWL_PTRN_MAX_SIZE 146 #define WOWL_PTRN_MASK_MAX_SIZE 19 #define WOWL_MAX_PTRNS_ALLOWED 22 -#else -#define WOWL_PTRN_MAX_SIZE 128 -#define WOWL_PTRN_MASK_MAX_SIZE 16 -#define WOWL_MAX_PTRNS_ALLOWED 16 -#endif /*---------------------------------------------------------------------------- * Type Declarations diff --git a/CORE/HDD/src/wlan_hdd_assoc.c b/CORE/HDD/src/wlan_hdd_assoc.c index 01d7a160f55f..0e0cdaba3f2e 100644 --- a/CORE/HDD/src/wlan_hdd_assoc.c +++ b/CORE/HDD/src/wlan_hdd_assoc.c @@ -635,9 +635,7 @@ static void hdd_SendAssociationEvent(struct net_device *dev,tCsrRoamInfo *pCsrRo #ifdef MSM_PLATFORM unsigned long flags; #endif -#ifdef QCA_WIFI_2_0 v_MACADDR_t peerMacAddr; -#endif #if defined (WLAN_FEATURE_VOWIFI_11R) // Added to find the auth type on the fly at run time @@ -710,7 +708,6 @@ static void hdd_SendAssociationEvent(struct net_device *dev,tCsrRoamInfo *pCsrRo hdd_SendFTAssocResponse(dev, pAdapter, pCsrRoamInfo); } #endif -#ifdef QCA_WIFI_2_0 if (pAdapter->device_mode == WLAN_HDD_P2P_CLIENT) { vos_mem_copy(peerMacAddr.bytes, pHddStaCtx->conn_info.bssId, @@ -722,7 +719,6 @@ static void hdd_SendAssociationEvent(struct net_device *dev,tCsrRoamInfo *pCsrRo pAdapter->sessionId, pHddStaCtx->conn_info.operationChannel); } -#endif #ifdef WLAN_FEATURE_LPSS wlan_hdd_send_status_pkg(pAdapter, pHddStaCtx, 1, 1); @@ -766,7 +762,6 @@ static void hdd_SendAssociationEvent(struct net_device *dev,tCsrRoamInfo *pCsrRo wlan_hdd_auto_shutdown_enable(pHddCtx, VOS_TRUE); #endif -#ifdef QCA_WIFI_2_0 if (pAdapter->device_mode == WLAN_HDD_P2P_CLIENT) { vos_mem_copy(peerMacAddr.bytes, pHddStaCtx->conn_info.bssId, @@ -777,7 +772,6 @@ static void hdd_SendAssociationEvent(struct net_device *dev,tCsrRoamInfo *pCsrRo 0, pAdapter->sessionId, pHddStaCtx->conn_info.operationChannel); } -#endif #ifdef WLAN_FEATURE_LPSS wlan_hdd_send_status_pkg(pAdapter, pHddStaCtx, 1, 0); @@ -2584,12 +2578,10 @@ eHalStatus hdd_RoamTdlsStatusUpdateHandler(hdd_adapter_t *pAdapter, eCsrRoamResult roamResult) { hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); -#ifdef QCA_WIFI_2_0 #ifdef CONFIG_TDLS_IMPLICIT tdlsCtx_t *pHddTdlsCtx = WLAN_HDD_GET_TDLS_CTX_PTR(pAdapter); #endif tSmeTdlsPeerStateParams smeTdlsPeerStateParams; -#endif eHalStatus status = eHAL_STATUS_FAILURE ; tANI_U8 staIdx; @@ -2602,17 +2594,14 @@ eHalStatus hdd_RoamTdlsStatusUpdateHandler(hdd_adapter_t *pAdapter, roamResult == eCSR_ROAM_RESULT_DELETE_ALL_TDLS_PEER_IND? "DEL_ALL_TDLS_PEER_IND" : roamResult == eCSR_ROAM_RESULT_UPDATE_TDLS_PEER? "UPDATE_TDLS_PEER" : roamResult == eCSR_ROAM_RESULT_LINK_ESTABLISH_REQ_RSP? "LINK_ESTABLISH_REQ_RSP" : -#ifdef QCA_WIFI_2_0 roamResult == eCSR_ROAM_RESULT_TDLS_SHOULD_DISCOVER? "TDLS_SHOULD_DISCOVER" : roamResult == eCSR_ROAM_RESULT_TDLS_SHOULD_TEARDOWN? "TDLS_SHOULD_TEARDOWN" : roamResult == eCSR_ROAM_RESULT_TDLS_SHOULD_PEER_DISCONNECTED? "TDLS_SHOULD_PEER_DISCONNECTED" : -#endif "UNKNOWN", pRoamInfo->staId, MAC_ADDR_ARRAY(pRoamInfo->peerMac)) ; #endif -#ifdef QCA_WIFI_2_0 #ifdef CONFIG_TDLS_IMPLICIT if (!pHddTdlsCtx) { @@ -2621,7 +2610,6 @@ eHalStatus hdd_RoamTdlsStatusUpdateHandler(hdd_adapter_t *pAdapter, __func__, roamResult); return status; } -#endif #endif switch( roamResult ) @@ -2668,13 +2656,6 @@ eHalStatus hdd_RoamTdlsStatusUpdateHandler(hdd_adapter_t *pAdapter, /* store the ucast signature , if required for further reference. */ wlan_hdd_tdls_set_signature( pAdapter, pRoamInfo->peerMac, pRoamInfo->ucastSig ); -#ifndef QCA_WIFI_2_0 - /* start TDLS client registration with TL */ - status = hdd_roamRegisterTDLSSTA( pAdapter, - pRoamInfo->peerMac, - pRoamInfo->staId, - pRoamInfo->ucastSig); -#endif /* QCA_WIFI_2_0 */ } else { @@ -2771,7 +2752,6 @@ eHalStatus hdd_RoamTdlsStatusUpdateHandler(hdd_adapter_t *pAdapter, MAC_ADDR_ARRAY(pHddCtx->tdlsConnInfo[staIdx].peerMac.bytes)); wlan_hdd_tdls_reset_peer(pAdapter, pHddCtx->tdlsConnInfo[staIdx].peerMac.bytes); hdd_roamDeregisterTDLSSTA ( pAdapter, pHddCtx->tdlsConnInfo[staIdx].staId ); -#ifdef QCA_WIFI_2_0 vos_mem_zero(&smeTdlsPeerStateParams, sizeof(smeTdlsPeerStateParams)); smeTdlsPeerStateParams.vdevId = @@ -2795,7 +2775,6 @@ eHalStatus hdd_RoamTdlsStatusUpdateHandler(hdd_adapter_t *pAdapter, MAC_ADDRESS_STR, __func__, MAC_ADDR_ARRAY(pHddCtx->tdlsConnInfo[staIdx].peerMac.bytes)); } -#endif wlan_hdd_tdls_decrement_peer_count(pAdapter); (WLAN_HDD_GET_CTX(pAdapter))->sta_to_adapter[staIdx] = NULL; @@ -2810,7 +2789,6 @@ eHalStatus hdd_RoamTdlsStatusUpdateHandler(hdd_adapter_t *pAdapter, wlan_hdd_tdls_check_bmps(pAdapter); break ; } -#ifdef QCA_WIFI_2_0 case eCSR_ROAM_RESULT_TDLS_SHOULD_DISCOVER: { #ifdef CONFIG_TDLS_IMPLICIT @@ -2936,7 +2914,6 @@ eHalStatus hdd_RoamTdlsStatusUpdateHandler(hdd_adapter_t *pAdapter, #endif break ; } -#endif /* QCA_WIFI_2_0 */ default: { break ; diff --git a/CORE/HDD/src/wlan_hdd_cfg.c b/CORE/HDD/src/wlan_hdd_cfg.c index 0bf3ec332fd9..3651cd7b6731 100644 --- a/CORE/HDD/src/wlan_hdd_cfg.c +++ b/CORE/HDD/src/wlan_hdd_cfg.c @@ -2537,14 +2537,12 @@ REG_TABLE_ENTRY g_registry_table[] = CFG_THERMAL_MIGRATION_ENABLE_MIN, CFG_THERMAL_MIGRATION_ENABLE_MAX ), -#ifndef QCA_WIFI_ISOC REG_VARIABLE( CFG_THROTTLE_PERIOD_NAME, WLAN_PARAM_Integer, hdd_config_t, throttlePeriod, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, CFG_THROTTLE_PERIOD_DEFAULT, CFG_THROTTLE_PERIOD_MIN, CFG_THROTTLE_PERIOD_MAX ), -#endif REG_VARIABLE( CFG_ENABLE_MODULATED_DTIM_NAME, WLAN_PARAM_Integer, hdd_config_t, enableModulatedDTIM, @@ -2815,14 +2813,12 @@ REG_TABLE_ENTRY g_registry_table[] = CFG_TDLS_RSSI_TEARDOWN_THRESHOLD_MIN, CFG_TDLS_RSSI_TEARDOWN_THRESHOLD_MAX ), -#ifdef QCA_WIFI_2_0 REG_VARIABLE( CFG_TDLS_RSSI_DELTA, WLAN_PARAM_SignedInteger, hdd_config_t, fTDLSRSSIDelta, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, CFG_TDLS_RSSI_DELTA_DEFAULT, CFG_TDLS_RSSI_DELTA_MIN, CFG_TDLS_RSSI_DELTA_MAX ), -#endif REG_VARIABLE( CFG_TDLS_QOS_WMM_UAPSD_MASK_NAME , WLAN_PARAM_HexInteger, hdd_config_t, fTDLSUapsdMask, @@ -3328,7 +3324,6 @@ REG_TABLE_ENTRY g_registry_table[] = CFG_IBSS_PS_1RX_CHAIN_IN_ATIM_WINDOW_MIN, CFG_IBSS_PS_1RX_CHAIN_IN_ATIM_WINDOW_MAX ), -#ifndef QCA_WIFI_ISOC REG_VARIABLE( CFG_THERMAL_TEMP_MIN_LEVEL0_NAME, WLAN_PARAM_Integer, hdd_config_t, thermalTempMinLevel0, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, @@ -3398,7 +3393,6 @@ REG_TABLE_ENTRY g_registry_table[] = CFG_SET_TXPOWER_LIMIT5G_DEFAULT, CFG_SET_TXPOWER_LIMIT5G_MIN, CFG_SET_TXPOWER_LIMIT5G_MAX ), -#endif /*#ifndef QCA_WIFI_ISOC*/ REG_VARIABLE( CFG_ENABLE_DEBUG_CONNECT_ISSUE, WLAN_PARAM_Integer, hdd_config_t, gEnableDebugLog, @@ -3629,7 +3623,6 @@ REG_TABLE_ENTRY g_registry_table[] = CFG_BUS_BANDWIDTH_COMPUTE_INTERVAL_MAX), #endif -#ifdef QCA_WIFI_2_0 REG_VARIABLE( CFG_ENABLE_FW_LOG_TYPE , WLAN_PARAM_Integer, hdd_config_t, enableFwLogType, @@ -3650,7 +3643,6 @@ REG_TABLE_ENTRY g_registry_table[] = VAR_FLAGS_OPTIONAL, (void *) CFG_ENABLE_FW_MODULE_LOG_DEFAULT), -#endif #ifdef WLAN_FEATURE_11W @@ -3714,14 +3706,12 @@ REG_TABLE_ENTRY g_registry_table[] = CFG_DFS_RADAR_PRI_MULTIPLIER_MIN, CFG_DFS_RADAR_PRI_MULTIPLIER_MAX), -#if !defined(QCA_WIFI_ISOC) REG_VARIABLE( CFG_REORDER_OFFLOAD_SUPPORT_NAME, WLAN_PARAM_Integer, hdd_config_t, reorderOffloadSupport, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, CFG_REORDER_OFFLOAD_SUPPORT_DEFAULT, CFG_REORDER_OFFLOAD_SUPPORT_MIN, CFG_REORDER_OFFLOAD_SUPPORT_MAX ), -#endif #ifdef IPA_UC_OFFLOAD REG_VARIABLE( CFG_IPA_UC_OFFLOAD_ENABLED_NAME, WLAN_PARAM_Integer, hdd_config_t, IpaUcOffloadEnabled, @@ -4847,12 +4837,9 @@ static VOS_STATUS hdd_apply_cfg_ini( hdd_context_t *pHddCtx, tCfgIniEntry* iniTa } } - // Keep qcacld-2.0 specific ini params disabled for non-qcacld-2.0 -#ifndef QCA_WIFI_2_0 - pHddCtx->cfg_ini->enablePowersaveOffload = 0; -#endif + print_hdd_cfg(pHddCtx); - return( ret_status ); + return( ret_status ); } #ifdef WLAN_FEATURE_MBSSID @@ -5697,11 +5684,7 @@ v_BOOL_t hdd_update_config_dat( hdd_context_t *pHddCtx ) } else { -#ifndef QCA_WIFI_2_0 - val = WNI_CFG_ASSOC_STA_LIMIT_STADEF; -#else val = pConfig->maxNumberOfPeers; -#endif } if(ccmCfgSetInt(pHddCtx->hHal, WNI_CFG_ASSOC_STA_LIMIT, val, @@ -6114,12 +6097,10 @@ VOS_STATUS hdd_set_sme_config( hdd_context_t *pHddCtx ) /* Update the Directed scan offload setting */ smeConfig->fScanOffload = pHddCtx->cfg_ini->fScanOffload; -#ifdef QCA_WIFI_2_0 /* Update the p2p listen offload setting */ smeConfig->fP2pListenOffload = pHddCtx->cfg_ini->fP2pListenOffload; smeConfig->csrConfig.scanBandPreference = pHddCtx->cfg_ini->acsScanBandPreference; -#endif #ifdef FEATURE_WLAN_SCAN_PNO /* Update PNO offoad status */ diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c index 4fbee8408945..f8874db31282 100644 --- a/CORE/HDD/src/wlan_hdd_cfg80211.c +++ b/CORE/HDD/src/wlan_hdd_cfg80211.c @@ -332,7 +332,6 @@ static struct ieee80211_supported_band wlan_hdd_band_2_4_GHZ = .ht_cap.mcs.rx_mask = { 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, .ht_cap.mcs.rx_highest = cpu_to_le16( 72 ), .ht_cap.mcs.tx_params = IEEE80211_HT_MCS_TX_DEFINED, -#ifdef QCA_WIFI_2_0 .vht_cap.cap = IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454 | IEEE80211_VHT_CAP_SHORT_GI_80 | IEEE80211_VHT_CAP_TXSTBC @@ -342,7 +341,6 @@ static struct ieee80211_supported_band wlan_hdd_band_2_4_GHZ = | IEEE80211_VHT_CAP_RXSTBC_2)) #endif | IEEE80211_VHT_CAP_RXLDPC, -#endif }; static struct ieee80211_supported_band wlan_hdd_band_p2p_2_4_GHZ = @@ -3567,7 +3565,7 @@ int wlan_hdd_cfg80211_init(struct device *dev, } #endif/*FEATURE_WLAN_SCAN_PNO*/ -#if defined(QCA_WIFI_2_0) && defined (QCA_WIFI_FTM) && !defined(QCA_WIFI_ISOC) +#if defined QCA_WIFI_FTM if (vos_get_conparam() != VOS_FTM_MODE) { #endif @@ -3583,7 +3581,7 @@ int wlan_hdd_cfg80211_init(struct device *dev, wiphy->reg_notifier = wlan_hdd_crda_reg_notifier; #endif -#if defined(QCA_WIFI_2_0) && defined (QCA_WIFI_FTM) && !defined(QCA_WIFI_ISOC) +#if defined QCA_WIFI_FTM } #endif @@ -3746,7 +3744,6 @@ int wlan_hdd_cfg80211_register(struct wiphy *wiphy) return 0; } -#ifdef QCA_WIFI_2_0 /* HDD function to update wiphy capability based on target offload status. @@ -3774,7 +3771,6 @@ void wlan_hdd_cfg80211_update_wiphy_caps(struct wiphy *wiphy) } #endif } -#endif /* In this function we are updating channel list when, regulatory domain is FCC and country code is US. @@ -5989,51 +5985,6 @@ static int __wlan_hdd_cfg80211_change_iface(struct wiphy *wiphy, { case NL80211_IFTYPE_STATION: case NL80211_IFTYPE_P2P_CLIENT: -#ifndef QCA_WIFI_2_0 - hddLog(VOS_TRACE_LEVEL_INFO, - "%s: setting interface Type to INFRASTRUCTURE", __func__); - pRoamProfile->BSSType = eCSR_BSS_TYPE_INFRASTRUCTURE; -#ifdef WLAN_FEATURE_11AC - if(pConfig->dot11Mode == eHDD_DOT11_MODE_AUTO) - { - pConfig->dot11Mode = eHDD_DOT11_MODE_11ac; - } -#endif - pRoamProfile->phyMode = - hdd_cfg_xlate_to_csr_phy_mode(pConfig->dot11Mode); - wdev->iftype = type; - //Check for sub-string p2p to confirm its a p2p interface - if (NULL != strstr(ndev->name,"p2p")) - { - pAdapter->device_mode = (type == NL80211_IFTYPE_STATION) ? - WLAN_HDD_P2P_DEVICE : WLAN_HDD_P2P_CLIENT; - } - else - { - pAdapter->device_mode = (type == NL80211_IFTYPE_STATION) ? - WLAN_HDD_INFRA_STATION: WLAN_HDD_P2P_CLIENT; - } -#ifdef FEATURE_WLAN_TDLS - /* The open adapter for the p2p shall skip initializations in - * tdls_init if the device mode is WLAN_HDD_P2P_DEVICE, for - * TDLS is supported only on WLAN_HDD_P2P_CLIENT. Hence invoke - * tdls_init when the change_iface sets the device mode to - * WLAN_HDD_P2P_CLIENT. - */ - - if ( pAdapter->device_mode == WLAN_HDD_P2P_CLIENT) - { - if (0 != wlan_hdd_tdls_init (pAdapter)) - { - hddLog(VOS_TRACE_LEVEL_ERROR, - "%s: tdls initialization failed", __func__); - return -EINVAL; - } - } - break; -#endif - -#else vstatus = wlan_hdd_change_iface_to_sta_mode(ndev, type); if (vstatus != VOS_STATUS_SUCCESS) return -EINVAL; @@ -6049,7 +6000,6 @@ static int __wlan_hdd_cfg80211_change_iface(struct wiphy *wiphy, (void *)pAdapter); #endif /* QCA_LL_TX_FLOW_CT */ -#endif goto done; case NL80211_IFTYPE_ADHOC: @@ -6742,9 +6692,6 @@ static int __wlan_hdd_cfg80211_add_key( struct wiphy *wiphy, v_CONTEXT_t pVosContext = (WLAN_HDD_GET_CTX(pAdapter))->pvosContext; #endif hdd_hostapd_state_t *pHostapdState; -#ifndef QCA_WIFI_2_0 - VOS_STATUS vos_status; -#endif eHalStatus halStatus; hdd_context_t *pHddCtx; @@ -6919,9 +6866,7 @@ static int __wlan_hdd_cfg80211_add_key( struct wiphy *wiphy, vos_mem_copy(&pAdapter->sessionCtx.station.ibss_enc_key, &setKey, sizeof(tCsrRoamSetKey)); -#if defined (QCA_WIFI_2_0) && !defined (QCA_WIFI_ISOC) pAdapter->sessionCtx.station.ibss_enc_key_installed = 1; -#endif return status; } if ((pAdapter->device_mode == WLAN_HDD_SOFTAP) || @@ -6995,21 +6940,6 @@ static int __wlan_hdd_cfg80211_add_key( struct wiphy *wiphy, setKey.peerMac[4], setKey.peerMac[5], setKey.keyDirection); -#ifndef QCA_WIFI_2_0 - vos_status = wlan_hdd_check_ula_done(pAdapter); - - if ( vos_status != VOS_STATUS_SUCCESS ) - { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "[%4d] wlan_hdd_check_ula_done returned ERROR status= %d", - __LINE__, vos_status ); - - pHddStaCtx->roam_info.roamingState = HDD_ROAM_STATE_NONE; - - return -EINVAL; - - } -#endif #ifdef WLAN_FEATURE_VOWIFI_11R /* The supplicant may attempt to set the PTK once pre-authentication @@ -10666,7 +10596,6 @@ static int wlan_hdd_cfg80211_get_txpower(struct wiphy *wiphy, EXIT(); return 0; } -#ifdef QCA_WIFI_2_0 static tANI_U8 wlan_hdd_get_mcs_idx(tANI_U16 maxRate, tANI_U8 rate_flags, tANI_U8 nss) { @@ -10744,7 +10673,6 @@ static tANI_U8 wlan_hdd_get_mcs_idx(tANI_U16 maxRate, tANI_U8 rate_flags, return (curIdx ? (curIdx - 1) : curIdx); } -#endif static int __wlan_hdd_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev, u8* mac, struct station_info *sinfo) @@ -10815,7 +10743,6 @@ static int __wlan_hdd_cfg80211_get_station(struct wiphy *wiphy, //convert to the UI units of 100kbps myRate = pAdapter->hdd_stats.ClassA_stat.tx_rate * 5; -#ifdef QCA_WIFI_2_0 if (!(rate_flags & eHAL_TX_RATE_LEGACY)) { nss = pAdapter->hdd_stats.ClassA_stat.rx_frag_cnt; @@ -10829,7 +10756,6 @@ static int __wlan_hdd_cfg80211_get_station(struct wiphy *wiphy, myRate); } } -#endif #ifdef LINKSPEED_DEBUG_ENABLED pr_info("RSSI %d, RLMS %u, rate %d, rssi high %d, rssi mid %d, rssi low %d, rate_flags 0x%x, MCS %d\n", sinfo->signal, @@ -12109,7 +12035,7 @@ static int __wlan_hdd_cfg80211_sched_scan_start(struct wiphy *wiphy, /*Copying list of valid channel into request */ memcpy(pPnoRequest->aNetworks[i].aChannels, valid_ch, num_ch); pPnoRequest->aNetworks[i].ucChannelCount = num_ch; -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)) && defined (QCA_WIFI_2_0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) pPnoRequest->aNetworks[i].rssiThreshold = request->match_sets[i].rssi_thold; #else @@ -12573,10 +12499,8 @@ static int __wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy, hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); hdd_context_t *pHddCtx = wiphy_priv(wiphy); int status; -#ifdef QCA_WIFI_2_0 tSmeTdlsPeerStateParams smeTdlsPeerStateParams; eHalStatus halStatus = eHAL_STATUS_FAILURE; -#endif hddTdlsPeer_t *pTdlsPeer; MTRACE(vos_trace(VOS_MODULE_ID_HDD, @@ -12602,11 +12526,7 @@ static int __wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy, /* QCA 2.0 Discrete ANDs feature capability in cfg_ini with that * received from target, so cfg_ini gives combined intersected result */ - if ((FALSE == pHddCtx->cfg_ini->fEnableTDLSSupport) -#ifndef QCA_WIFI_2_0 - || (FALSE == sme_IsFeatureSupportedByFW(TDLS)) -#endif - ) + if (FALSE == pHddCtx->cfg_ini->fEnableTDLSSupport) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "TDLS Disabled in INI OR not enabled in FW. " @@ -12672,15 +12592,8 @@ static int __wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy, } } wlan_hdd_tdls_set_peer_link_status(pTdlsPeer, eTDLS_LINK_CONNECTED); -#ifdef QCA_WIFI_2_0 /* start TDLS client registration with TL */ status = hdd_roamRegisterTDLSSTA( pAdapter, peer, pTdlsPeer->staId, pTdlsPeer->signature); -#else - /* Mark TDLS client Authenticated .*/ - status = WLANTL_ChangeSTAState( pHddCtx->pvosContext, - pTdlsPeer->staId, - WLANTL_STA_AUTHENTICATED); -#endif /* QCA_WIFI_2_0 */ if (VOS_STATUS_SUCCESS == status) { tANI_U8 i; @@ -12697,7 +12610,6 @@ static int __wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy, WLANTL_SuspendDataTx( (WLAN_HDD_GET_CTX(pAdapter))->pvosContext, &staId, NULL); } -#ifdef QCA_WIFI_2_0 vos_mem_zero(&smeTdlsPeerStateParams, sizeof(tSmeTdlsPeerStateParams)); @@ -12766,7 +12678,6 @@ static int __wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy, __func__, MAC_ADDR_ARRAY(peer)); return -EPERM; } -#endif wlan_hdd_tdls_increment_peer_count(pAdapter); } wlan_hdd_tdls_check_bmps(pAdapter); @@ -12786,13 +12697,9 @@ static int __wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy, status = WLANTL_EnableUAPSDForAC( (WLAN_HDD_GET_CTX(pAdapter))->pvosContext, pTdlsPeer->staId, ucAc[ac], tlTid[ac], tlTid[ac], 0, 0, -#ifdef QCA_WIFI_2_0 WLANTL_BI_DIR, 1, pAdapter->sessionId ); -#else - WLANTL_BI_DIR ); -#endif } } } @@ -13368,8 +13275,7 @@ static int __wlan_hdd_cfg80211_testmode(struct wiphy *wiphy, } #endif /* FEATURE_WLAN_LPHB */ -#if defined(QCA_WIFI_2_0) && !defined(QCA_WIFI_ISOC) \ - && defined(QCA_WIFI_FTM) +#if defined(QCA_WIFI_FTM) case WLAN_HDD_TM_CMD_WLAN_FTM: { int buf_len; @@ -13412,8 +13318,7 @@ static int wlan_hdd_cfg80211_testmode(struct wiphy *wiphy, void *data, int len) return ret; } -#if defined(QCA_WIFI_2_0) && !defined(QCA_WIFI_ISOC) \ - && defined(QCA_WIFI_FTM) +#if defined(QCA_WIFI_FTM) void wlan_hdd_testmode_rx_event(void *buf, size_t buf_len) { struct sk_buff *skb; @@ -13592,9 +13497,7 @@ int __wlan_hdd_cfg80211_resume_wlan(struct wiphy *wiphy) hdd_adapter_list_node_t *pAdapterNode, *pNext; VOS_STATUS status = VOS_STATUS_SUCCESS; int result; -#ifdef QCA_WIFI_2_0 pVosSchedContext vosSchedContext = get_vos_sched_ctxt(); -#endif ENTER(); @@ -13620,7 +13523,6 @@ int __wlan_hdd_cfg80211_resume_wlan(struct wiphy *wiphy) cnss_request_bus_bandwidth(CNSS_BUS_WIDTH_MEDIUM); #endif -#ifdef QCA_WIFI_2_0 /* Resume MC thread */ if (pHddCtx->isMcThreadSuspended) { complete(&vosSchedContext->ResumeMcEvent); @@ -13636,7 +13538,6 @@ int __wlan_hdd_cfg80211_resume_wlan(struct wiphy *wiphy) #endif hdd_resume_wlan(); -#endif spin_lock(&pHddCtx->schedScan_lock); pHddCtx->isWiphySuspended = FALSE; @@ -13680,14 +13581,12 @@ int __wlan_hdd_cfg80211_resume_wlan(struct wiphy *wiphy) return result; } -#ifdef QCA_WIFI_2_0 void wlan_hdd_cfg80211_ready_to_suspend(void *callbackContext, boolean suspended) { hdd_context_t *pHddCtx = (hdd_context_t *)callbackContext; pHddCtx->suspended = suspended; complete(&pHddCtx->ready_to_suspend); } -#endif int wlan_hdd_cfg80211_resume_wlan(struct wiphy *wiphy) { @@ -13711,13 +13610,11 @@ int __wlan_hdd_cfg80211_suspend_wlan(struct wiphy *wiphy, #define RX_TLSHIM_SUSPEND_TIMEOUT 200 /* msecs */ #endif hdd_context_t *pHddCtx = wiphy_priv(wiphy); -#ifdef QCA_WIFI_2_0 pVosSchedContext vosSchedContext = get_vos_sched_ctxt(); hdd_adapter_list_node_t *pAdapterNode = NULL, *pNext = NULL; hdd_adapter_t *pAdapter; hdd_scaninfo_t *pScanInfo; VOS_STATUS status; -#endif int rc; ENTER(); @@ -13753,7 +13650,6 @@ int __wlan_hdd_cfg80211_suspend_wlan(struct wiphy *wiphy, pAdapterNode = pNext; } -#ifdef QCA_WIFI_2_0 /* Stop ongoing scan on each interface */ status = hdd_get_front_adapter ( pHddCtx, &pAdapterNode ); while ( NULL != pAdapterNode && VOS_STATUS_SUCCESS == status ) @@ -13823,7 +13719,6 @@ int __wlan_hdd_cfg80211_suspend_wlan(struct wiphy *wiphy, } pHddCtx->isMcThreadSuspended = TRUE; -#endif #ifdef QCA_CONFIG_SMP /* Suspend tlshim rx thread */ @@ -13853,18 +13748,14 @@ int __wlan_hdd_cfg80211_suspend_wlan(struct wiphy *wiphy, #ifdef QCA_CONFIG_SMP resume_all: -#ifdef QCA_WIFI_2_0 complete(&vosSchedContext->ResumeMcEvent); pHddCtx->isMcThreadSuspended = FALSE; #endif -#endif -#ifdef QCA_WIFI_2_0 resume_tx: hdd_resume_wlan(); return -ETIME; -#endif } diff --git a/CORE/HDD/src/wlan_hdd_dev_pwr.c b/CORE/HDD/src/wlan_hdd_dev_pwr.c index bd09d3213b0e..395fd0e137ff 100644 --- a/CORE/HDD/src/wlan_hdd_dev_pwr.c +++ b/CORE/HDD/src/wlan_hdd_dev_pwr.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -88,409 +88,6 @@ static const hdd_tmLevelAction_t thermalMigrationAction[WLAN_HDD_TM_LEVEL_MAX] = static bool suspend_notify_sent; #endif -#ifdef QCA_WIFI_ISOC -/*---------------------------------------------------------------------------- - - @brief Function to suspend the wlan driver. - - @param hdd_context_t pHddCtx - Global hdd context - - - @return None - -----------------------------------------------------------------------------*/ -static int wlan_suspend(hdd_context_t* pHddCtx) -{ - unsigned long rc; - - pVosSchedContext vosSchedContext = NULL; - - /* Get the global VOSS context */ - vosSchedContext = get_vos_sched_ctxt(); - - if(!vosSchedContext) { - VOS_TRACE(VOS_MODULE_ID_HDD,VOS_TRACE_LEVEL_FATAL,"%s: Global VOS_SCHED context is Null",__func__); - return 0; - } - if(!vos_is_apps_power_collapse_allowed(pHddCtx)) - { - /* Fail this suspend */ - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: Fail wlan suspend: not in IMPS/BMPS", __func__); - return -EPERM; - } - - /* - Suspending MC Thread, Rx Thread and Tx Thread as the platform driver is going to Suspend. - */ - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: Suspending Mc, Rx and Tx Threads",__func__); - - INIT_COMPLETION(pHddCtx->tx_sus_event_var); - - /* Indicate Tx Thread to Suspend */ - set_bit(TX_SUSPEND_EVENT_MASK, &vosSchedContext->txEventFlag); - - wake_up_interruptible(&vosSchedContext->txWaitQueue); - - /* Wait for Suspend Confirmation from Tx Thread */ - rc = wait_for_completion_timeout(&pHddCtx->tx_sus_event_var, - msecs_to_jiffies(200)); - - if (!rc) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, - "%s: Not able to suspend TX thread timeout happened", __func__); - clear_bit(TX_SUSPEND_EVENT_MASK, &vosSchedContext->txEventFlag); - - return -ETIME; - } - /* Set the Tx Thread as Suspended */ - pHddCtx->isTxThreadSuspended = TRUE; - - INIT_COMPLETION(pHddCtx->rx_sus_event_var); - - /* Indicate Rx Thread to Suspend */ - set_bit(RX_SUSPEND_EVENT_MASK, &vosSchedContext->rxEventFlag); - - wake_up_interruptible(&vosSchedContext->rxWaitQueue); - - /* Wait for Suspend Confirmation from Rx Thread */ - rc = wait_for_completion_timeout(&pHddCtx->rx_sus_event_var, - msecs_to_jiffies(200)); - - if (!rc) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, - "%s: Not able to suspend Rx thread timeout happened", __func__); - - clear_bit(RX_SUSPEND_EVENT_MASK, &vosSchedContext->rxEventFlag); - - /* Indicate Tx Thread to Resume */ - complete(&vosSchedContext->ResumeTxEvent); - - /* Set the Tx Thread as Resumed */ - pHddCtx->isTxThreadSuspended = FALSE; - - return -ETIME; - } - - /* Set the Rx Thread as Suspended */ - pHddCtx->isRxThreadSuspended = TRUE; - - INIT_COMPLETION(pHddCtx->mc_sus_event_var); - - /* Indicate MC Thread to Suspend */ - set_bit(MC_SUSPEND_EVENT_MASK, &vosSchedContext->mcEventFlag); - - wake_up_interruptible(&vosSchedContext->mcWaitQueue); - - /* Wait for Suspend Confirmation from MC Thread */ - rc = wait_for_completion_timeout(&pHddCtx->mc_sus_event_var, - msecs_to_jiffies(200)); - - if (!rc) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, - "%s: Not able to suspend MC thread timeout happened %ld", - __func__, rc); - - clear_bit(MC_SUSPEND_EVENT_MASK, &vosSchedContext->mcEventFlag); - - /* Indicate Rx Thread to Resume */ - complete(&vosSchedContext->ResumeRxEvent); - - /* Set the Rx Thread as Resumed */ - pHddCtx->isRxThreadSuspended = FALSE; - - /* Indicate Tx Thread to Resume */ - complete(&vosSchedContext->ResumeTxEvent); - - /* Set the Tx Thread as Resumed */ - pHddCtx->isTxThreadSuspended = FALSE; - - return -ETIME; - } - - /* Set the Mc Thread as Suspended */ - pHddCtx->isMcThreadSuspended = TRUE; - - /* Set the Station state as Suspended */ - pHddCtx->isWlanSuspended = TRUE; - - return 0; -} - -/*---------------------------------------------------------------------------- - - @brief Function to resume the wlan driver. - - @param hdd_context_t pHddCtx - Global hdd context - - - @return None - -----------------------------------------------------------------------------*/ -static void wlan_resume(hdd_context_t* pHddCtx) -{ - pVosSchedContext vosSchedContext = NULL; - - //Get the global VOSS context. - vosSchedContext = get_vos_sched_ctxt(); - - if(!vosSchedContext) { - VOS_TRACE(VOS_MODULE_ID_HDD,VOS_TRACE_LEVEL_FATAL,"%s: Global VOS_SCHED context is Null",__func__); - return; - } - - /* - Resuming Mc, Rx and Tx Thread as platform Driver is resuming. - */ - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: Resuming Mc, Rx and Tx Thread",__func__); - - /* Indicate MC Thread to Resume */ - complete(&vosSchedContext->ResumeMcEvent); - - /* Set the Mc Thread as Resumed */ - pHddCtx->isMcThreadSuspended = FALSE; - - /* Indicate Rx Thread to Resume */ - complete(&vosSchedContext->ResumeRxEvent); - - /* Set the Rx Thread as Resumed */ - pHddCtx->isRxThreadSuspended = FALSE; - - /* Indicate Tx Thread to Resume */ - complete(&vosSchedContext->ResumeTxEvent); - - /* Set the Tx Thread as Resumed */ - pHddCtx->isTxThreadSuspended = FALSE; - - /* Set the Station state as Suspended */ - pHddCtx->isWlanSuspended = FALSE; -} - -/*---------------------------------------------------------------------------- - - @brief Function to suspend the wlan driver. - This function will get called by platform driver Suspend on System Suspend - - @param dev platform_func_device - - - @return None - -----------------------------------------------------------------------------*/ -int hddDevSuspendHdlr(struct device *dev) -{ - int ret = 0; - hdd_context_t* pHddCtx = NULL; - - pHddCtx = (hdd_context_t*)wcnss_wlan_get_drvdata(dev); - - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: WLAN suspended by platform driver",__func__); - - /* Get the HDD context */ - if(!pHddCtx) { - VOS_TRACE(VOS_MODULE_ID_HDD,VOS_TRACE_LEVEL_FATAL,"%s: HDD context is Null",__func__); - return 0; - } - - if(pHddCtx->isWlanSuspended == TRUE) - { - VOS_TRACE(VOS_MODULE_ID_HDD,VOS_TRACE_LEVEL_FATAL,"%s: WLAN is already in suspended state",__func__); - return 0; - } - - /* Suspend the wlan driver */ - ret = wlan_suspend(pHddCtx); - if(ret != 0) - { - VOS_TRACE(VOS_MODULE_ID_HDD,VOS_TRACE_LEVEL_FATAL,"%s: Not able to suspend wlan",__func__); - return ret; - } - -#ifdef HAVE_WCNSS_SUSPEND_RESUME_NOTIFY - if(hdd_is_suspend_notify_allowed(pHddCtx)) - { - wcnss_suspend_notify(); - suspend_notify_sent = true; - } -#endif - return 0; -} - -/*---------------------------------------------------------------------------- - - @brief Function to resume the wlan driver. - This function will get called by platform driver Resume on System Resume - - @param dev platform_func_device - - - @return None - -----------------------------------------------------------------------------*/ -int hddDevResumeHdlr(struct device *dev) -{ - hdd_context_t* pHddCtx = NULL; - - pHddCtx = (hdd_context_t*)wcnss_wlan_get_drvdata(dev); - - VOS_TRACE(VOS_MODULE_ID_HDD,VOS_TRACE_LEVEL_INFO, "%s: WLAN being resumed by Android OS",__func__); - - if(pHddCtx->isWlanSuspended != TRUE) - { - VOS_TRACE(VOS_MODULE_ID_HDD,VOS_TRACE_LEVEL_FATAL,"%s: WLAN is already in resumed state",__func__); - return 0; - } - - /* Resume the wlan driver */ - wlan_resume(pHddCtx); -#ifdef HAVE_WCNSS_SUSPEND_RESUME_NOTIFY - if(suspend_notify_sent == true) - { - wcnss_resume_notify(); - suspend_notify_sent = false; - } -#endif - - return 0; -} - -static const struct dev_pm_ops pm_ops = { - .suspend = hddDevSuspendHdlr, - .resume = hddDevResumeHdlr, -}; - -/*---------------------------------------------------------------------------- - * - - @brief Registration function. - Register suspend, resume callback functions with platform driver. - - @param hdd_context_t pHddCtx - Global hdd context - - @return General status code - VOS_STATUS_SUCCESS Registration Success - VOS_STATUS_E_FAILURE Registration Fail - -----------------------------------------------------------------------------*/ -VOS_STATUS hddRegisterPmOps(hdd_context_t *pHddCtx) -{ - wcnss_wlan_set_drvdata(pHddCtx->parent_dev, pHddCtx); -#ifndef FEATURE_R33D - wcnss_wlan_register_pm_ops(pHddCtx->parent_dev, &pm_ops); -#endif /* FEATURE_R33D */ - return VOS_STATUS_SUCCESS; -} - -/*---------------------------------------------------------------------------- - - @brief De-registration function. - Deregister the suspend, resume callback functions with platform driver - - @param hdd_context_t pHddCtx - Global hdd context - - @return General status code - VOS_STATUS_SUCCESS De-Registration Success - VOS_STATUS_E_FAILURE De-Registration Fail - -----------------------------------------------------------------------------*/ -VOS_STATUS hddDeregisterPmOps(hdd_context_t *pHddCtx) -{ -#ifndef FEATURE_R33D - wcnss_wlan_unregister_pm_ops(pHddCtx->parent_dev, &pm_ops); -#endif /* FEATURE_R33D */ - return VOS_STATUS_SUCCESS; -} - -/*---------------------------------------------------------------------------- - - @brief TM Level Change handler - Received Tm Level changed notification - - @param dev : Device context - changedTmLevel : Changed new TM level - - @return - -----------------------------------------------------------------------------*/ -void hddDevTmLevelChangedHandler(struct device *dev, int changedTmLevel) -{ - hdd_context_t *pHddCtx = NULL; - WLAN_TmLevelEnumType newTmLevel = changedTmLevel; - hdd_adapter_t *staAdapater; - - pHddCtx = (hdd_context_t*)wcnss_wlan_get_drvdata(dev); - - if ((pHddCtx->tmInfo.currentTmLevel == newTmLevel) || - (!pHddCtx->cfg_ini->thermalMitigationEnable)) - { - VOS_TRACE(VOS_MODULE_ID_HDD,VOS_TRACE_LEVEL_WARN, - "%s: TM Not enabled %d or Level does not changed %d", - __func__, pHddCtx->cfg_ini->thermalMitigationEnable, newTmLevel); - /* TM Level does not changed, - * Or feature does not enabled - * do nothing */ - return; - } - - /* Only STA mode support TM now - * all other mode, TM feature should be disabled */ - if (~VOS_STA & pHddCtx->concurrency_mode) - { - VOS_TRACE(VOS_MODULE_ID_HDD,VOS_TRACE_LEVEL_ERROR, - "%s: CMODE 0x%x, TM disable", - __func__, pHddCtx->concurrency_mode); - newTmLevel = WLAN_HDD_TM_LEVEL_0; - } - - if ((newTmLevel < WLAN_HDD_TM_LEVEL_0) || - (newTmLevel >= WLAN_HDD_TM_LEVEL_MAX)) - { - VOS_TRACE(VOS_MODULE_ID_HDD,VOS_TRACE_LEVEL_ERROR, - "%s: TM level %d out of range", - __func__, newTmLevel); - return; - } - - if (newTmLevel != WLAN_HDD_TM_LEVEL_4) - sme_SetTmLevel(pHddCtx->hHal, newTmLevel, 0); - - if (mutex_lock_interruptible(&pHddCtx->tmInfo.tmOperationLock)) - { - VOS_TRACE(VOS_MODULE_ID_HDD,VOS_TRACE_LEVEL_ERROR, - "%s: Acquire lock fail", __func__); - return; - } - - pHddCtx->tmInfo.currentTmLevel = newTmLevel; - pHddCtx->tmInfo.txFrameCount = 0; - vos_mem_copy(&pHddCtx->tmInfo.tmAction, - &thermalMigrationAction[newTmLevel], - sizeof(hdd_tmLevelAction_t)); - - - if (pHddCtx->tmInfo.tmAction.enterImps) - { - staAdapater = hdd_get_adapter(pHddCtx, WLAN_HDD_INFRA_STATION); - if (staAdapater) - { - if (hdd_connIsConnected(WLAN_HDD_GET_STATION_CTX_PTR(staAdapater))) - { - sme_RoamDisconnect(pHddCtx->hHal, - staAdapater->sessionId, - eCSR_DISCONNECT_REASON_UNSPECIFIED); - } - } - } - - mutex_unlock(&pHddCtx->tmInfo.tmOperationLock); - - return; -} - -#endif/*QCA_WIFI_ISOC*/ /*---------------------------------------------------------------------------- diff --git a/CORE/HDD/src/wlan_hdd_early_suspend.c b/CORE/HDD/src/wlan_hdd_early_suspend.c index a8c28da34ba4..ae4fe6a84db2 100644 --- a/CORE/HDD/src/wlan_hdd_early_suspend.c +++ b/CORE/HDD/src/wlan_hdd_early_suspend.c @@ -93,7 +93,6 @@ #include "wlan_hdd_power.h" #include "wlan_hdd_packet_filtering.h" -#if defined(QCA_WIFI_2_0) && !defined(QCA_WIFI_ISOC) #include #if defined(HIF_PCI) #include "if_pci.h" @@ -102,7 +101,6 @@ #elif defined(HIF_SDIO) #include "if_ath_sdio.h" #endif -#endif #define HDD_SSR_BRING_UP_TIME 10000 static eHalStatus g_full_pwr_status; @@ -1199,30 +1197,9 @@ static void hdd_conf_resume_ind(hdd_adapter_t *pAdapter) hdd_context_t* pHddCtx = WLAN_HDD_GET_CTX(pAdapter); eHalStatus halStatus = eHAL_STATUS_FAILURE; -#ifndef QCA_WIFI_2_0 - - tpSirWlanResumeParam wlanResumeParam; - - wlanResumeParam = vos_mem_malloc(sizeof(tSirWlanResumeParam)); - - if (NULL == wlanResumeParam) - { - hddLog(VOS_TRACE_LEVEL_FATAL, - "%s: memory allocation failed for wlanResumeParam ", __func__); - return; - } - - wlanResumeParam->configuredMcstBcstFilterSetting = - pHddCtx->configuredMcastBcastFilter; - -#endif halStatus = sme_ConfigureResumeReq(pHddCtx->hHal, -#ifndef QCA_WIFI_2_0 - wlanResumeParam -#else NULL -#endif ); if (eHAL_STATUS_SUCCESS != halStatus) @@ -1230,9 +1207,6 @@ static void hdd_conf_resume_ind(hdd_adapter_t *pAdapter) hddLog(VOS_TRACE_LEVEL_ERROR, "%s: sme_ConfigureResumeReq return failure %d", __func__, halStatus); -#ifndef QCA_WIFI_2_0 - vos_mem_free(wlanResumeParam); -#endif } @@ -1307,14 +1281,7 @@ void hdd_suspend_wlan(void (*callback)(void *callbackContext, boolean suspended) && (WLAN_HDD_P2P_CLIENT != pAdapter->device_mode) ) { -#ifndef QCA_WIFI_2_0 - // we skip this registration for modes other than STA, SAP and P2P client modes. - status = hdd_get_next_adapter ( pHddCtx, pAdapterNode, &pNext ); - pAdapterNode = pNext; - continue; -#else goto send_suspend_ind; -#endif } /* Avoid multiple enter/exit BMPS in this while loop using * hdd_enter_bmps flag @@ -1347,7 +1314,6 @@ void hdd_suspend_wlan(void (*callback)(void *callbackContext, boolean suspended) } #endif -#ifdef QCA_WIFI_2_0 send_suspend_ind: //stop all TX queues before suspend netif_tx_disable(pAdapter->dev); @@ -1355,7 +1321,6 @@ send_suspend_ind: /* Keep this suspend indication at the end (before processing next adaptor) * for discrete. This indication is considered as trigger point to start * WOW (if wow is enabled). */ -#endif /*Suspend notification sent down to driver*/ hdd_conf_suspend_ind(pHddCtx, pAdapter, callback, callbackContext); @@ -1625,14 +1590,7 @@ void hdd_resume_wlan(void) && (WLAN_HDD_SOFTAP != pAdapter->device_mode) && (WLAN_HDD_P2P_CLIENT != pAdapter->device_mode) ) { -#ifndef QCA_WIFI_2_0 - // we skip this registration for modes other than STA, SAP and P2P client modes. - status = hdd_get_next_adapter ( pHddCtx, pAdapterNode, &pNext ); - pAdapterNode = pNext; - continue; -#else goto send_resume_ind; -#endif } @@ -1679,11 +1637,9 @@ void hdd_resume_wlan(void) } } -#ifdef QCA_WIFI_2_0 send_resume_ind: //wake the tx queues netif_tx_wake_all_queues(pAdapter->dev); -#endif hdd_conf_resume_ind(pAdapter); @@ -1802,10 +1758,8 @@ VOS_STATUS hdd_wlan_shutdown(void) return VOS_STATUS_E_FAILURE; } -#if defined(QCA_WIFI_2_0) && !defined(QCA_WIFI_ISOC) pHddCtx->isLogpInProgress = TRUE; vos_set_logp_in_progress(VOS_MODULE_ID_VOSS, TRUE); -#endif vos_clear_concurrent_session_count(); //Stop the traffic monitor timer @@ -1817,14 +1771,6 @@ VOS_STATUS hdd_wlan_shutdown(void) hdd_reset_all_adapters(pHddCtx); -#ifdef QCA_WIFI_ISOC - /* DeRegister with platform driver as client for Suspend/Resume */ - vosStatus = hddDeregisterPmOps(pHddCtx); - if ( !VOS_IS_STATUS_SUCCESS( vosStatus ) ) - { - hddLog(VOS_TRACE_LEVEL_FATAL,"%s: hddDeregisterPmOps failed",__func__); - } -#endif vosStatus = hddDevTmUnregisterNotifyCallback(pHddCtx); if ( !VOS_IS_STATUS_SUCCESS( vosStatus ) ) { @@ -1911,7 +1857,6 @@ VOS_STATUS hdd_wlan_shutdown(void) } #endif //WLAN_BTAMP_FEATURE -#if defined(QCA_WIFI_2_0) && !defined(QCA_WIFI_ISOC) hddLog(VOS_TRACE_LEVEL_FATAL, "%s: Doing WDA STOP", __func__); vosStatus = WDA_stop(pVosContext, HAL_STOP_TYPE_RF_KILL); @@ -1922,15 +1867,6 @@ VOS_STATUS hdd_wlan_shutdown(void) VOS_ASSERT(VOS_IS_STATUS_SUCCESS(vosStatus)); WDA_setNeedShutdown(pVosContext); } -#else - vosStatus = vos_wda_shutdown(pVosContext); - if (!VOS_IS_STATUS_SUCCESS(vosStatus)) - { - VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, - "%s: Failed to stop wda %d", __func__, vosStatus); - VOS_ASSERT(0); - } -#endif hddLog(VOS_TRACE_LEVEL_FATAL, "%s: Doing SME STOP",__func__); /* Stop SME - Cannot invoke vos_stop as vos_stop relies @@ -1964,9 +1900,7 @@ VOS_STATUS hdd_wlan_shutdown(void) VOS_ASSERT(0); } -#ifndef QCA_WIFI_ISOC hif_disable_isr(((VosContextType*)pVosContext)->pHIFContext); -#endif hdd_unregister_mcast_bcast_filter(pHddCtx); @@ -2016,25 +1950,11 @@ VOS_STATUS hdd_wlan_re_init(void *hif_sc) WLANBAP_ConfigType btAmpConfig; #endif -#if defined(QCA_WIFI_2_0) && !defined(QCA_WIFI_ISOC) adf_os_device_t adf_ctx; hdd_adapter_t *pAdapter; -#endif int i; hdd_prevent_suspend(); -#ifdef QCA_WIFI_ISOC -#ifdef HAVE_WCNSS_CAL_DOWNLOAD - /* wait until WCNSS driver downloads NV */ - while (!wcnss_device_ready() && 10 >= ++max_retries) { - msleep(1000); - } - if (max_retries >= 10) { - hddLog(VOS_TRACE_LEVEL_FATAL,"%s: WCNSS driver not ready", __func__); - goto err_re_init; - } -#endif -#endif vos_set_reinit_in_progress(VOS_MODULE_ID_VOSS, TRUE); @@ -2055,7 +1975,6 @@ VOS_STATUS hdd_wlan_re_init(void *hif_sc) goto err_re_init; } -#if defined(QCA_WIFI_2_0) && !defined(QCA_WIFI_ISOC) if (!hif_sc) { hddLog(VOS_TRACE_LEVEL_FATAL, "%s: hif_sc is NULL", __func__); goto err_re_init; @@ -2073,20 +1992,10 @@ VOS_STATUS hdd_wlan_re_init(void *hif_sc) hif_init_adf_ctx(adf_ctx, hif_sc); ((VosContextType*)pVosContext)->pHIFContext = hif_sc; ((VosContextType*)(pVosContext))->adf_ctx = adf_ctx; -#endif /* The driver should always be initialized in STA mode after SSR */ hdd_set_conparam(0); -#ifdef QCA_WIFI_ISOC - vosStatus = vos_init_wiphy_from_nv_bin(); - if (!VOS_IS_STATUS_SUCCESS(vosStatus)) - { - /* NV module cannot be initialized */ - hddLog(VOS_TRACE_LEVEL_FATAL, "%s: vos_init_wiphy failed", __func__); - goto err_re_init; - } -#endif /* Try to get an adapter from mode ID */ pAdapter = hdd_get_adapter(pHddCtx, WLAN_HDD_INFRA_STATION); @@ -2112,7 +2021,7 @@ VOS_STATUS hdd_wlan_re_init(void *hif_sc) goto err_re_init; } -#if defined(QCA_WIFI_2_0) && !defined(QCA_WIFI_ISOC) && !defined(REMOVE_PKT_LOG) +#if !defined(REMOVE_PKT_LOG) hif_init_pdev_txrx_handle(hif_sc, vos_get_context(VOS_MODULE_ID_TXRX, pVosContext)); #endif @@ -2141,7 +2050,6 @@ VOS_STATUS hdd_wlan_re_init(void *hif_sc) } #ifdef CONFIG_ENABLE_LINUX_REG -#ifndef QCA_WIFI_ISOC /* initialize the NV module. This is required so that we can initialize the channel information in wiphy from the NV.bin data. The channel information in @@ -2155,7 +2063,6 @@ VOS_STATUS hdd_wlan_re_init(void *hif_sc) "%s: vos_init_wiphy_from_eeprom failed", __func__); goto err_vosclose; } -#endif #endif vosStatus = hdd_set_sme_chan_list(pHddCtx); @@ -2273,15 +2180,6 @@ VOS_STATUS hdd_wlan_re_init(void *hif_sc) hdd_register_mcast_bcast_filter(pHddCtx); hdd_ssr_timer_del(); -#ifdef QCA_WIFI_ISOC - /* Register with platform driver as client for Suspend/Resume */ - vosStatus = hddRegisterPmOps(pHddCtx); - if ( !VOS_IS_STATUS_SUCCESS( vosStatus ) ) - { - hddLog(VOS_TRACE_LEVEL_FATAL,"%s: hddRegisterPmOps failed",__func__); - goto err_bap_stop; - } -#endif wlan_hdd_send_svc_nlink_msg(WLAN_SVC_FW_CRASHED_IND, NULL, 0); @@ -2305,11 +2203,6 @@ VOS_STATUS hdd_wlan_re_init(void *hif_sc) goto success; err_unregister_pmops: -#ifdef QCA_WIFI_ISOC - hddDeregisterPmOps(pHddCtx); - -err_bap_stop: -#endif #ifdef CONFIG_HAS_EARLYSUSPEND hdd_unregister_mcast_bcast_filter(pHddCtx); #endif diff --git a/CORE/HDD/src/wlan_hdd_ftm.c b/CORE/HDD/src/wlan_hdd_ftm.c index 824f4f2d462f..870fb7402aa4 100644 --- a/CORE/HDD/src/wlan_hdd_ftm.c +++ b/CORE/HDD/src/wlan_hdd_ftm.c @@ -75,7 +75,7 @@ #include "pttMsgApi.h" #include "wlan_qct_pal_device.h" -#if defined(QCA_WIFI_2_0) && defined(QCA_WIFI_FTM) +#if defined(QCA_WIFI_FTM) #include "bmi.h" #include "ol_fw.h" #include "testmode.h" @@ -521,7 +521,7 @@ static FTM_STATUS ftm_status; //tpAniSirGlobal pMac; static tPttMsgbuffer *pMsgBuf; -#if defined(QCA_WIFI_2_0) && !defined(QCA_WIFI_ISOC) && defined(QCA_WIFI_FTM) +#if defined(QCA_WIFI_FTM) #if defined(LINUX_QCMBR) #define ATH_XIOCTL_UNIFIED_UTF_CMD 0x1000 #define ATH_XIOCTL_UNIFIED_UTF_RSP 0x1001 @@ -662,13 +662,11 @@ static VOS_STATUS wlan_ftm_vos_open( v_CONTEXT_t pVosContext, v_SIZE_t hddContex tSirRetStatus sirStatus = eSIR_SUCCESS; tMacOpenParameters macOpenParms; pVosContextType gpVosContext = (pVosContextType)pVosContext; -#if defined(QCA_WIFI_2_0) && defined(QCA_WIFI_FTM) +#if defined(QCA_WIFI_FTM) adf_os_device_t adf_ctx; HTC_INIT_INFO htcInfo; -#ifndef QCA_WIFI_ISOC v_PVOID_t pHifContext = NULL; v_PVOID_t pHtcContext = NULL; -#endif #endif hdd_context_t *pHddCtx; @@ -735,8 +733,7 @@ static VOS_STATUS wlan_ftm_vos_open( v_CONTEXT_t pVosContext, v_SIZE_t hddContex goto err_msg_queue; } -#if defined(QCA_WIFI_2_0) && defined(QCA_WIFI_FTM) -#ifndef QCA_WIFI_ISOC +#if defined(QCA_WIFI_FTM) /* Initialize BMI and Download firmware */ pHifContext = vos_get_context(VOS_MODULE_ID_HIF, gpVosContext); if (!pHifContext) @@ -754,7 +751,6 @@ static VOS_STATUS wlan_ftm_vos_open( v_CONTEXT_t pVosContext, v_SIZE_t hddContex htcInfo.pContext = gpVosContext->pHIFContext; htcInfo.TargetFailure = ol_target_failure; htcInfo.TargetSendSuspendComplete = wma_target_suspend_acknowledge; -#endif adf_ctx = vos_get_context(VOS_MODULE_ID_ADF, gpVosContext); /* Create HTC */ @@ -762,19 +758,15 @@ static VOS_STATUS wlan_ftm_vos_open( v_CONTEXT_t pVosContext, v_SIZE_t hddContex if (!gpVosContext->htc_ctx) { VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_FATAL, "%s: Failed to Create HTC", __func__); -#ifndef QCA_WIFI_ISOC goto err_bmi_close; -#endif goto err_sched_close; } -#ifndef QCA_WIFI_ISOC if (bmi_done(pHifContext)) { VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_FATAL, "%s: Failed to complete BMI phase", __func__); goto err_htc_close; } -#endif #endif /* QCA_WIFI_2_0 && QCA_WIFI_FTM */ /* Open the SYS module */ @@ -806,14 +798,9 @@ static VOS_STATUS wlan_ftm_vos_open( v_CONTEXT_t pVosContext, v_SIZE_t hddContex macOpenParms.powersaveOffloadEnabled = pHddCtx->cfg_ini->enablePowersaveOffload; -#ifndef QCA_WIFI_ISOC vStatus = WDA_open(gpVosContext, gpVosContext->pHDDContext, wlan_hdd_ftm_update_tgt_cfg, NULL, &macOpenParms); -#else - vStatus = WDA_open(gpVosContext, gpVosContext->pHDDContext, - NULL, &macOpenParms); -#endif if (!VOS_IS_STATUS_SUCCESS(vStatus)) { /* Critical Error ... Cannot proceed further */ @@ -823,8 +810,7 @@ static VOS_STATUS wlan_ftm_vos_open( v_CONTEXT_t pVosContext, v_SIZE_t hddContex goto err_sys_close; } -#if defined (QCA_WIFI_2_0) && defined(QCA_WIFI_FTM) \ - && !defined (QCA_WIFI_ISOC) +#if defined(QCA_WIFI_FTM) pHtcContext = vos_get_context(VOS_MODULE_ID_HTC, gpVosContext); if (!pHtcContext) { @@ -919,17 +905,15 @@ err_wda_close: err_sys_close: sysClose(gpVosContext); -#if defined(QCA_WIFI_2_0) && defined(QCA_WIFI_FTM) +#if defined(QCA_WIFI_FTM) err_htc_close: if (gpVosContext->htc_ctx) { HTCDestroy(gpVosContext->htc_ctx); gpVosContext->htc_ctx = NULL; } -#ifndef QCA_WIFI_ISOC err_bmi_close: BMICleanup(pHifContext); -#endif /* #ifndef QCA_WIFI_ISOC */ #endif /* #QCA_WIFI_2_0 && QCA_WIFI_FTM */ err_sched_close: @@ -1011,7 +995,7 @@ static VOS_STATUS wlan_ftm_vos_close( v_CONTEXT_t vosContext ) VOS_ASSERT( VOS_IS_STATUS_SUCCESS( vosStatus ) ); } -#if defined(QCA_WIFI_2_0) && defined(QCA_WIFI_FTM) && !defined(QCA_WIFI_ISOC) +#if defined(QCA_WIFI_FTM) if (gpVosContext->htc_ctx) { HTCStop(gpVosContext->htc_ctx); @@ -1382,7 +1366,7 @@ VOS_STATUS vos_ftm_preStart( v_CONTEXT_t vosContext ) { VOS_STATUS vStatus = VOS_STATUS_SUCCESS; pVosContextType pVosContext = (pVosContextType)vosContext; -#if defined(QCA_WIFI_2_0) && defined(QCA_WIFI_FTM) +#if defined(QCA_WIFI_FTM) pVosContextType gpVosContext = vos_get_global_context(VOS_MODULE_ID_VOSS, NULL); #endif @@ -1419,9 +1403,6 @@ VOS_STATUS vos_ftm_preStart( v_CONTEXT_t vosContext ) { VOS_TRACE(VOS_MODULE_ID_SYS, VOS_TRACE_LEVEL_ERROR, "Failed to WDA prestart "); -#ifdef QCA_WIFI_ISOC - macStop(pVosContext->pMACContext, HAL_STOP_TYPE_SYS_DEEP_SLEEP); -#endif ccmStop(pVosContext->pMACContext); VOS_ASSERT(0); return VOS_STATUS_E_FAILURE; @@ -1445,22 +1426,17 @@ VOS_STATUS vos_ftm_preStart( v_CONTEXT_t vosContext ) return VOS_STATUS_E_FAILURE; } -#if defined(QCA_WIFI_2_0) && defined(QCA_WIFI_FTM) +#if defined(QCA_WIFI_FTM) vStatus = HTCStart(gpVosContext->htc_ctx); if (!VOS_IS_STATUS_SUCCESS(vStatus)) { VOS_TRACE(VOS_MODULE_ID_SYS, VOS_TRACE_LEVEL_FATAL, "Failed to Start HTC"); -#ifdef QCA_WIFI_ISOC - macStop(gpVosContext->pMACContext, HAL_STOP_TYPE_SYS_DEEP_SLEEP); -#endif ccmStop(gpVosContext->pMACContext); VOS_ASSERT( 0 ); return VOS_STATUS_E_FAILURE; } -#ifndef QCA_WIFI_ISOC wma_wait_for_ready_event(gpVosContext->pWDAContext); -#endif #endif /* QCA_WIFI_2_0 && QCA_WIFI_FTM */ return VOS_STATUS_SUCCESS; @@ -1746,10 +1722,6 @@ static VOS_STATUS wlan_ftm_send_response(hdd_context_t *pHddCtx){ static int wlan_hdd_ftm_start(hdd_context_t *pHddCtx) { VOS_STATUS vStatus = VOS_STATUS_SUCCESS; -#ifdef QCA_WIFI_ISOC - tSirRetStatus sirStatus = eSIR_SUCCESS; - tHalMacStartParameters halStartParams; -#endif pVosContextType pVosContext = (pVosContextType)(pHddCtx->pvosContext); if (WLAN_FTM_STARTED == pHddCtx->ftm.ftm_state) @@ -1788,34 +1760,6 @@ static int wlan_hdd_ftm_start(hdd_context_t *pHddCtx) } -#ifdef QCA_WIFI_ISOC - vStatus = WDA_NVDownload_Start(pVosContext); - - if ( vStatus != VOS_STATUS_SUCCESS ) - { - VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, - "%s: Failed to start NV Download",__func__); - return VOS_STATUS_E_FAILURE; - } - - vStatus = vos_wait_single_event(&(pVosContext->wdaCompleteEvent), 1000); - - if ( vStatus != VOS_STATUS_SUCCESS ) - { - if ( vStatus == VOS_STATUS_E_TIMEOUT ) - { - VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, - "%s: Timeout occurred before WDA_NVDownload_Start complete", __func__); - } - else - { - VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, - "%s: WDA_NVDownload_Start reporting other error", __func__); - } - VOS_ASSERT(0); - goto err_status_failure; - } -#endif /* #ifdef QCA_WIFI_ISOC */ vStatus = WDA_start(pVosContext); if (vStatus != VOS_STATUS_SUCCESS) @@ -1825,25 +1769,6 @@ static int wlan_hdd_ftm_start(hdd_context_t *pHddCtx) goto err_status_failure; } -#ifdef QCA_WIFI_ISOC - /* Start the MAC */ - vos_mem_zero((v_PVOID_t)&halStartParams, sizeof(tHalMacStartParameters)); - - - halStartParams.driverType = eDRIVER_TYPE_MFG; - - /* Start the MAC */ - sirStatus = macStart(pVosContext->pMACContext,(v_PVOID_t)&halStartParams); - - - if (eSIR_SUCCESS != sirStatus) - { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: Failed to start MAC", __func__); - - goto err_wda_stop; - } -#endif /* #ifdef QCA_WIFI_ISOC */ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: MAC correctly started",__func__); @@ -1861,27 +1786,6 @@ static int wlan_hdd_ftm_start(hdd_context_t *pHddCtx) err_ftm_service_reg: wlan_hdd_ftm_close(pHddCtx); -#ifdef QCA_WIFI_ISOC -err_wda_stop: - vos_event_reset(&(pVosContext->wdaCompleteEvent)); - WDA_stop(pVosContext, HAL_STOP_TYPE_RF_KILL); - vStatus = vos_wait_single_event(&(pVosContext->wdaCompleteEvent), 1000); - if(vStatus != VOS_STATUS_SUCCESS) - { - if(vStatus == VOS_STATUS_E_TIMEOUT) - { - VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, - "%s: Timeout occurred before WDA_stop complete", __func__); - - } - else - { - VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, - "%s: WDA_stop reporting other error", __func__); - } - VOS_ASSERT(0); - } -#endif /* #ifdef QCA_WIFI_ISOC */ err_status_failure: @@ -1889,7 +1793,7 @@ err_status_failure: } -#if defined(QCA_WIFI_2_0) && defined(QCA_WIFI_FTM) +#if defined(QCA_WIFI_FTM) int hdd_ftm_start(hdd_context_t *pHddCtx) { return wlan_hdd_ftm_start(pHddCtx); @@ -1927,7 +1831,7 @@ static int wlan_ftm_stop(hdd_context_t *pHddCtx) return WLAN_FTM_SUCCESS; } -#if defined(QCA_WIFI_2_0) && defined(QCA_WIFI_FTM) +#if defined(QCA_WIFI_FTM) int hdd_ftm_stop(hdd_context_t *pHddCtx) { return wlan_ftm_stop(pHddCtx); @@ -5531,7 +5435,7 @@ static int wlan_ftm_register_wext(hdd_adapter_t *pAdapter) return 0; } -#if defined(QCA_WIFI_2_0) && !defined(QCA_WIFI_ISOC) && defined(QCA_WIFI_FTM) +#if defined(QCA_WIFI_FTM) #if defined(LINUX_QCMBR) int wlan_hdd_qcmbr_command(hdd_adapter_t *pAdapter, qcmbr_data_t *pqcmbr_data) { diff --git a/CORE/HDD/src/wlan_hdd_hostapd.c b/CORE/HDD/src/wlan_hdd_hostapd.c index d1352660b89e..f607465a697c 100644 --- a/CORE/HDD/src/wlan_hdd_hostapd.c +++ b/CORE/HDD/src/wlan_hdd_hostapd.c @@ -85,14 +85,12 @@ #include #endif -#ifdef QCA_WIFI_2_0 #include "wma.h" #ifdef DEBUG #include "wma_api.h" #endif extern int process_wma_set_command(int sessid, int paramid, int sval, int vpdev); -#endif /* QCA_WIFI_2_0 */ #include "wlan_hdd_trace.h" #include "vos_types.h" #include "vos_trace.h" @@ -1070,7 +1068,6 @@ VOS_STATUS hdd_hostapd_SAPEventCB( tpSap_Event pSapEvent, v_PVOID_t usrDataForCa hdd_abort_mac_scan(pHddCtx, pHostapdAdapter->sessionId, eCSR_SCAN_ABORT_DEFAULT); } -#ifdef QCA_WIFI_2_0 if (pHostapdAdapter->device_mode == WLAN_HDD_P2P_GO) { /* send peer status indication to oem app */ @@ -1080,7 +1077,6 @@ VOS_STATUS hdd_hostapd_SAPEventCB( tpSap_Event pSapEvent, v_PVOID_t usrDataForCa pSapEvent->sapevt.sapStationAssocReassocCompleteEvent.timingMeasCap, pHostapdAdapter->sessionId, pHddApCtx->operatingChannel); } -#endif #ifdef FEATURE_GREEN_AP hdd_wlan_green_ap_mc(pHddCtx, GREEN_AP_ADD_STA_EVENT); @@ -1166,7 +1162,6 @@ VOS_STATUS hdd_hostapd_SAPEventCB( tpSap_Event pSapEvent, v_PVOID_t usrDataForCa hddLog(LOGE, "%s: failed to update Beacon interval %d", __func__, vos_status); } -#ifdef QCA_WIFI_2_0 if (pHostapdAdapter->device_mode == WLAN_HDD_P2P_GO) { /* send peer status indication to oem app */ @@ -1175,7 +1170,6 @@ VOS_STATUS hdd_hostapd_SAPEventCB( tpSap_Event pSapEvent, v_PVOID_t usrDataForCa ePeerDisconnected, 0, pHostapdAdapter->sessionId, pHddApCtx->operatingChannel); } -#endif #ifdef MSM_PLATFORM /*stop timer in sap/p2p_go */ @@ -1920,7 +1914,6 @@ static iw_softap_setparam(struct net_device *dev, break; } -#ifdef QCA_WIFI_2_0 case QCSAP_PARAM_SET_TXRX_FW_STATS: { hddLog(LOG1, "QCSAP_PARAM_SET_TXRX_FW_STATS val %d", set_value); @@ -2407,11 +2400,7 @@ static iw_softap_setparam(struct net_device *dev, { hddLog(VOS_TRACE_LEVEL_INFO, "Set Thermal Mitigation Level %d", set_value); -#ifdef QCA_WIFI_ISOC - hddLog(VOS_TRACE_LEVEL_ERROR, " 'setTmLevel' Command Not supported for this mode"); -#else (void)sme_SetThermalLevel(hHal, set_value); -#endif break; } @@ -2440,7 +2429,6 @@ static iw_softap_setparam(struct net_device *dev, break; } -#endif /* QCA_WIFI_2_0 */ case QCASAP_SET_DFS_NOL: WLANSAP_Set_DfsNol( @@ -4091,66 +4079,6 @@ static int iw_set_ap_genie(struct net_device *dev, EXIT(); return halStatus; } -#ifdef QCA_WIFI_ISOC -static VOS_STATUS wlan_hdd_get_classAstats_for_station(hdd_adapter_t *pAdapter, u8 staid) -{ - eHalStatus hstatus; - unsigned long rc; - struct statsContext context; - - if (NULL == pAdapter) - { - hddLog(VOS_TRACE_LEVEL_ERROR,"%s: pAdapter is NULL", __func__); - return VOS_STATUS_E_FAULT; - } - - init_completion(&context.completion); - context.pAdapter = pAdapter; - context.magic = STATS_CONTEXT_MAGIC; - hstatus = sme_GetStatistics( WLAN_HDD_GET_HAL_CTX(pAdapter), - eCSR_HDD, - SME_GLOBAL_CLASSA_STATS, - hdd_GetClassA_statisticsCB, - 0, // not periodic - FALSE, //non-cached results - staid, - &context, - pAdapter->sessionId ); - if (eHAL_STATUS_SUCCESS != hstatus) - { - hddLog(VOS_TRACE_LEVEL_ERROR, - "%s: Unable to retrieve statistics for link speed", - __func__); - } - else - { - rc = wait_for_completion_timeout(&context.completion, - msecs_to_jiffies(WLAN_WAIT_TIME_STATS)); - if (!rc) { - hddLog(VOS_TRACE_LEVEL_ERROR, - "%s: SME timed out while retrieving link speed", - __func__); - } - } - - /* either we never sent a request, we sent a request and received a - response or we sent a request and timed out. if we never sent a - request or if we sent a request and got a response, we want to - clear the magic out of paranoia. if we timed out there is a - race condition such that the callback function could be - executing at the same time we are. of primary concern is if the - callback function had already verified the "magic" but had not - yet set the completion variable when a timeout occurred. we - serialize these activities by invalidating the magic while - holding a shared spinlock which will cause us to block if the - callback is currently executing */ - spin_lock(&hdd_context_lock); - context.magic = 0; - spin_unlock(&hdd_context_lock); - - return VOS_STATUS_SUCCESS; -} -#endif VOS_STATUS wlan_hdd_get_linkspeed_for_peermac(hdd_adapter_t *pAdapter, tSirMacAddr macAddress) @@ -4399,7 +4327,6 @@ static const struct iw_priv_args hostapd_private_args[] = { { QCSAP_PARAM_SET_CHANNEL_CHANGE, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "setChanChange" }, -#ifdef QCA_WIFI_2_0 /* Sub-cmds DBGLOG specific commands */ { QCSAP_DBGLOG_LOG_LEVEL , IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, @@ -4561,7 +4488,6 @@ static const struct iw_priv_args hostapd_private_args[] = { 0, "setRadar" }, -#endif /* QCA_WIFI_2_0 */ { QCSAP_IOCTL_GETPARAM, 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "getparam" }, diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c index e506bffb583e..50ea5d51dd0d 100755 --- a/CORE/HDD/src/wlan_hdd_main.c +++ b/CORE/HDD/src/wlan_hdd_main.c @@ -135,7 +135,6 @@ void hdd_ch_avoid_cb(void *hdd_context,void *indi_param); #ifdef IPA_OFFLOAD #include #endif -#if defined(QCA_WIFI_2_0) && !defined(QCA_WIFI_ISOC) #if defined(HIF_PCI) #include "if_pci.h" #elif defined(HIF_USB) @@ -144,7 +143,6 @@ void hdd_ch_avoid_cb(void *hdd_context,void *indi_param); #include "if_ath_sdio.h" #endif #include "wma.h" -#endif #if defined(LINUX_QCMBR) #define SIOCIOCTLTX99 (SIOCDEVPRIVATE+13) @@ -284,14 +282,11 @@ static int hdd_parse_reassoc_command_v1_data(const tANI_U8 *pValue, tANI_U8 *pChannel); #endif -#if defined (QCA_WIFI_2_0) && \ - !defined (QCA_WIFI_ISOC) struct completion wlan_start_comp; #ifdef QCA_WIFI_FTM extern int hdd_ftm_start(hdd_context_t *pHddCtx); extern int hdd_ftm_stop(hdd_context_t *pHddCtx); #endif -#endif #ifdef FEATURE_WLAN_AUTO_SHUTDOWN v_VOID_t wlan_hdd_auto_shutdown_cb(v_VOID_t); #endif @@ -2468,9 +2463,7 @@ hdd_reassoc(hdd_adapter_t *pAdapter, const tANI_U8 *bssid, const tANI_U8 channel hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); handoffInfo.channel = channel; -#ifndef QCA_WIFI_ISOC handoffInfo.src = REASSOC; -#endif memcpy(handoffInfo.bssid, bssid, sizeof(tSirMacAddr)); sme_HandoffRequest(pHddCtx->hHal, pAdapter->sessionId, &handoffInfo); } @@ -3819,16 +3812,6 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, } else if (strncmp(command, "SETSUSPENDMODE", 14) == 0) { -#ifndef QCA_WIFI_2_0 - int suspend = 0; - tANI_U8 *ptr = (tANI_U8*)command + 15; - - suspend = *ptr - '0'; - MTRACE(vos_trace(VOS_MODULE_ID_HDD, - TRACE_CODE_HDD_SETSUSPENDMODE_IOCTL, - pAdapter->sessionId, suspend)); - hdd_set_wlan_suspend_mode(suspend); -#endif } #ifdef WLAN_FEATURE_NEIGHBOR_ROAMING else if (strncmp(command, "SETROAMTRIGGER", 14) == 0) @@ -4925,7 +4908,6 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, else if (strncmp(command, "FASTREASSOC", 11) == 0) { -#ifndef QCA_WIFI_ISOC tANI_U8 *value = command; tANI_U8 channel = 0; tSirMacAddr targetApBssid; @@ -4977,48 +4959,6 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, handoffInfo.src = FASTREASSOC; vos_mem_copy(handoffInfo.bssid, targetApBssid, sizeof(tSirMacAddr)); sme_HandoffRequest(pHddCtx->hHal, pAdapter->sessionId, &handoffInfo); -#endif -#else - tANI_U8 *value = command; - tSirMacAddr targetApBssid; - tANI_U8 trigger = 0; - hdd_station_ctx_t *pHddStaCtx = NULL; - pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); - - /* if not associated, no need to proceed with reassoc */ - if (eConnectionState_Associated != pHddStaCtx->conn_info.connState) - { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s:Not associated!",__func__); - ret = -EINVAL; - goto exit; - } - - ret = hdd_parse_reassoc_command_v1_data(value, targetApBssid, - &trigger); - if (ret) - { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: Failed to parse reassoc command data", __func__); - goto exit; - } - - /* if the target bssid is same as currently associated AP, - then no need to proceed with reassoc */ - if (VOS_TRUE == vos_mem_compare(targetApBssid, - pHddStaCtx->conn_info.bssId, sizeof(tSirMacAddr))) - { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, - "%s:11r Reassoc BSSID is same as currently associated AP bssid", - __func__); - ret = -EINVAL; - goto exit; - } - - /* Proceed with scan/roam */ - smeIssueFastRoamNeighborAPEvent(WLAN_HDD_GET_HAL_CTX(pAdapter), - &targetApBssid[0], - (tSmeFastRoamTrigger)(trigger), - pAdapter->sessionId); #endif } #endif @@ -5816,7 +5756,7 @@ int hdd_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) goto exit; } -#if defined(QCA_WIFI_2_0) && !defined(QCA_WIFI_ISOC) && defined(QCA_WIFI_FTM) && defined(LINUX_QCMBR) +#if defined(QCA_WIFI_FTM) && defined(LINUX_QCMBR) if (VOS_FTM_MODE == hdd_get_conparam()) { if (SIOCIOCTLTX99 == cmd) { ret = wlan_hdd_qcmbr_unified_ioctl(pAdapter, ifr); @@ -6157,7 +6097,6 @@ void hdd_getBand_helper(hdd_context_t *pHddCtx, int *pBand) } } -#if defined (QCA_WIFI_2_0) && !defined (QCA_WIFI_ISOC) /* * Mac address for multiple virtual interface is found as following * i) The mac address of the first interface is just the actual hw mac address. @@ -6808,7 +6747,6 @@ void hdd_dfs_indicate_radar(void *context, void *param) } } } -#endif /* QCA_WIFI_2_0 && !QCA_WIFI_ISOC */ /**--------------------------------------------------------------------------- @@ -7938,9 +7876,7 @@ static hdd_adapter_t* hdd_alloc_station_adapter( hdd_context_t *pHddCtx, tSirMac init_completion(&pHddCtx->mc_sus_event_var); init_completion(&pHddCtx->tx_sus_event_var); init_completion(&pHddCtx->rx_sus_event_var); -#ifdef QCA_WIFI_2_0 init_completion(&pHddCtx->ready_to_suspend); -#endif init_completion(&pAdapter->ula_complete); init_completion(&pAdapter->change_country_code); @@ -7970,15 +7906,11 @@ static hdd_adapter_t* hdd_alloc_station_adapter( hdd_context_t *pHddCtx, tSirMac pWlanDev->watchdog_timeo = HDD_TX_TIMEOUT; pWlanDev->hard_header_len += LIBRA_HW_NEEDED_HEADROOM; -#ifdef QCA_WIFI_2_0 if (pHddCtx->cfg_ini->enableIPChecksumOffload) pWlanDev->features |= NETIF_F_HW_CSUM; else if (pHddCtx->cfg_ini->enableTCPChkSumOffld) pWlanDev->features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM; -#ifndef QCA_WIFI_ISOC pWlanDev->features |= NETIF_F_RXCSUM; -#endif -#endif hdd_set_station_ops( pAdapter->dev ); pWlanDev->destructor = free_netdev; @@ -8884,7 +8816,6 @@ hdd_adapter_t* hdd_open_adapter( hdd_context_t *pHddCtx, tANI_U8 session_type, #endif } -#ifdef QCA_WIFI_2_0 if ((vos_get_conparam() != VOS_FTM_MODE) && (!pHddCtx->cfg_ini->enable2x2)) { #define HDD_DTIM_1CHAIN_RX_ID 0x5 @@ -8942,7 +8873,6 @@ hdd_adapter_t* hdd_open_adapter( hdd_context_t *pHddCtx, tANI_U8 session_type, } } -#endif #ifdef CONFIG_FW_LOGS_BASED_ON_INI @@ -10432,10 +10362,6 @@ void hdd_wlan_exit(hdd_context_t *pHddCtx) struct wiphy *wiphy = pHddCtx->wiphy; struct statsContext powerContext; unsigned long rc; -#if defined (QCA_WIFI_2_0) && \ - defined (QCA_WIFI_ISOC) - adf_os_device_t adf_ctx; -#endif hdd_config_t *pConfig = pHddCtx->cfg_ini; ENTER(); @@ -10451,7 +10377,7 @@ void hdd_wlan_exit(hdd_context_t *pHddCtx) if (VOS_FTM_MODE == hdd_get_conparam()) { hddLog(VOS_TRACE_LEVEL_INFO, "%s: FTM MODE", __func__); -#if defined(QCA_WIFI_2_0) && !defined(QCA_WIFI_ISOC) && defined(QCA_WIFI_FTM) +#if defined(QCA_WIFI_FTM) if (hdd_ftm_stop(pHddCtx)) { hddLog(VOS_TRACE_LEVEL_FATAL,"%s: hdd_ftm_stop Failed",__func__); @@ -10682,15 +10608,6 @@ void hdd_wlan_exit(hdd_context_t *pHddCtx) kfree(pHddCtx->cfg_ini); pHddCtx->cfg_ini= NULL; -#if defined (QCA_WIFI_2_0) && \ - defined (QCA_WIFI_ISOC) - /* - * Free ADF context here only for ISOC case. For discrete - * it should be freed after PCI remove - */ - adf_ctx = vos_get_context(VOS_MODULE_ID_ADF, pVosContext); - vos_mem_free(adf_ctx); -#endif /* free the power on lock from platform driver */ if (free_riva_power_on_lock("wlan")) @@ -10720,8 +10637,6 @@ free_hdd_ctx: hdd_set_ssr_required (VOS_FALSE); } -#if defined (QCA_WIFI_2_0) && \ - !defined (QCA_WIFI_ISOC) void __hdd_wlan_exit(void) { hdd_context_t *pHddCtx = NULL; @@ -10789,7 +10704,6 @@ void __hdd_wlan_exit(void) EXIT(); } -#endif /* QCA_WIFI_2_0 && !QCA_WIFI_ISOC */ #ifdef QCA_HT_2040_COEX /**-------------------------------------------------------------------------- @@ -11153,30 +11067,14 @@ boolean hdd_is_5g_supported(hdd_context_t * pHddCtx) /* If wcnss_wlan_iris_xo_mode() returns WCNSS_XO_48MHZ(1); * then hardware support 5Ghz. */ -#ifdef QCA_WIFI_ISOC - if (WCNSS_XO_48MHZ == wcnss_wlan_iris_xo_mode()) - { - hddLog(VOS_TRACE_LEVEL_ERROR, "%s: Hardware supports 5Ghz", __func__); - return true; - } - else - { - hddLog(VOS_TRACE_LEVEL_ERROR, "%s: Hardware doesn't supports 5Ghz", - __func__); - return false; - } -#else return true; -#endif } #ifdef CONFIG_ENABLE_LINUX_REG -#ifdef QCA_WIFI_2_0 #define WOW_MAX_FILTER_LISTS 1 #define WOW_MAX_FILTERS_PER_LIST 4 #define WOW_MIN_PATTERN_SIZE 6 #define WOW_MAX_PATTERN_SIZE 64 -#endif static VOS_STATUS wlan_hdd_reg_init(hdd_context_t *hdd_ctx) { @@ -11190,7 +11088,6 @@ static VOS_STATUS wlan_hdd_reg_init(hdd_context_t *hdd_ctx) from the NV.bin data. The channel information in wiphy needs to be initialized before wiphy registration */ -#ifndef QCA_WIFI_ISOC status = vos_init_wiphy_from_eeprom(); if (!VOS_IS_STATUS_SUCCESS(status)) { @@ -11199,9 +11096,7 @@ static VOS_STATUS wlan_hdd_reg_init(hdd_context_t *hdd_ctx) "%s: vos_init_wiphy failed", __func__); return status; } -#endif -#ifdef QCA_WIFI_2_0 wiphy->wowlan.flags = WIPHY_WOWLAN_ANY | WIPHY_WOWLAN_MAGIC_PKT | WIPHY_WOWLAN_DISCONNECT | @@ -11215,7 +11110,6 @@ static VOS_STATUS wlan_hdd_reg_init(hdd_context_t *hdd_ctx) WOW_MAX_FILTERS_PER_LIST); wiphy->wowlan.pattern_min_len = WOW_MIN_PATTERN_SIZE; wiphy->wowlan.pattern_max_len = WOW_MAX_PATTERN_SIZE; -#endif /* registration of wiphy dev with cfg80211 */ if (0 > wlan_hdd_cfg80211_register(wiphy)) @@ -11318,69 +11212,6 @@ static void hdd_bus_bw_compute_cbk(void *priv) } #endif -#if defined(WLAN_AUTOGEN_MACADDR_FEATURE) && defined (QCA_WIFI_ISOC) -/**--------------------------------------------------------------------------- - - \brief hdd_generate_iface_mac_addr_auto() - HDD Mac Interface Auto - generate function - - This is generate the random mac address for WLAN interface - - \param - pHddCtx - Pointer to HDD context - idx - Start interface index to get auto - generated mac addr. - mac_addr - Mac address - - \return - 0 for success, < 0 for failure - - --------------------------------------------------------------------------*/ - -static int hdd_generate_iface_mac_addr_auto(hdd_context_t *pHddCtx, - int idx, v_MACADDR_t mac_addr) -{ - int i; - unsigned int serialno; - serialno = wcnss_get_serial_number(); - - if (0 != serialno) - { - /* MAC address has 3 bytes of OUI so we have a maximum of 3 - bytes of the serial number that can be used to generate - the other 3 bytes of the MAC address. Mask off all but - the lower 3 bytes (this will also make sure we don't - overflow in the next step) */ - serialno &= 0x00FFFFFF; - - /* we need a unique address for each session */ - serialno *= VOS_MAX_CONCURRENCY_PERSONA; - - /* autogen other Mac addresses */ - for (i = idx; i < VOS_MAX_CONCURRENCY_PERSONA; i++) - { - /* start with the entire default address */ - pHddCtx->cfg_ini->intfMacAddr[i] = mac_addr; - /* then replace the lower 3 bytes */ - pHddCtx->cfg_ini->intfMacAddr[i].bytes[3] = (serialno >> 16) & 0xFF; - pHddCtx->cfg_ini->intfMacAddr[i].bytes[4] = (serialno >> 8) & 0xFF; - pHddCtx->cfg_ini->intfMacAddr[i].bytes[5] = serialno & 0xFF; - - serialno++; - hddLog(VOS_TRACE_LEVEL_ERROR, - "%s: Derived Mac Addr: " - MAC_ADDRESS_STR, __func__, - MAC_ADDR_ARRAY(pHddCtx->cfg_ini->intfMacAddr[i].bytes)); - } - - } - else - { - hddLog(LOGE, FL("Failed to Get Serial NO")); - return -1; - } - - return 0; -} -#endif // WLAN_AUTOGEN_MACADDR_FEATURE && QCA_WIFI_ISOC /**--------------------------------------------------------------------------- \brief hdd_11d_scan_done - callback to be executed when 11d scan is @@ -11439,16 +11270,9 @@ int hdd_wlan_startup(struct device *dev, v_VOID_t *hif_sc) int i; struct wiphy *wiphy; unsigned long rc; -#ifdef QCA_WIFI_2_0 adf_os_device_t adf_ctx; -#endif -#ifndef QCA_WIFI_ISOC tSmeThermalParams thermalParam; tSirTxPowerLimit *hddtxlimit; -#endif -#if defined(WLAN_AUTOGEN_MACADDR_FEATURE) && defined (QCA_WIFI_ISOC) - v_MACADDR_t mac_addr; -#endif ENTER(); @@ -11521,7 +11345,6 @@ int hdd_wlan_startup(struct device *dev, v_VOID_t *hif_sc) mutex_init(&pHddCtx->tdls_lock); #endif -#ifdef QCA_WIFI_2_0 /* Initialize the adf_ctx handle */ adf_ctx = vos_mem_malloc(sizeof(*adf_ctx)); @@ -11530,17 +11353,12 @@ int hdd_wlan_startup(struct device *dev, v_VOID_t *hif_sc) goto err_free_hdd_context; } vos_mem_zero(adf_ctx, sizeof(*adf_ctx)); -#ifdef QCA_WIFI_ISOC - adf_ctx->dev = dev; -#else hif_init_adf_ctx(adf_ctx, hif_sc); ((VosContextType*)pVosContext)->pHIFContext = hif_sc; /* store target type and target version info in hdd ctx */ pHddCtx->target_type = ((struct ol_softc *)hif_sc)->target_type; -#endif ((VosContextType*)(pVosContext))->adf_ctx = adf_ctx; -#endif /* QCA_WIFI_2_0 */ // Load all config first as TL config is needed during vos_open pHddCtx->cfg_ini = (hdd_config_t*) kmalloc(sizeof(hdd_config_t), GFP_KERNEL); @@ -11572,9 +11390,6 @@ int hdd_wlan_startup(struct device *dev, v_VOID_t *hif_sc) pHddCtx->current_intf_count=0; pHddCtx->max_intf_count = CSR_ROAM_SESSION_MAX; -#ifndef QCA_WIFI_2_0 - pHddCtx->cfg_ini->maxWoWFilters = WOWL_MAX_PTRNS_ALLOWED; -#endif /* INI has been read, initialise the configuredMcastBcastFilter with * INI value as this will serve as the default value */ @@ -11699,16 +11514,6 @@ int hdd_wlan_startup(struct device *dev, v_VOID_t *hif_sc) goto err_wdclose; } -#ifdef QCA_WIFI_ISOC - status = vos_init_wiphy_from_nv_bin(); - if (!VOS_IS_STATUS_SUCCESS(status)) - { - /* NV module cannot be initialized */ - hddLog( VOS_TRACE_LEVEL_FATAL, - "%s: vos_init_wiphy failed", __func__); - goto err_vos_nv_close; - } -#endif #endif status = vos_open( &pVosContext, 0); @@ -11720,8 +11525,7 @@ int hdd_wlan_startup(struct device *dev, v_VOID_t *hif_sc) wlan_hdd_update_wiphy(wiphy, pHddCtx->cfg_ini); -#if defined(QCA_WIFI_2_0) && !defined(QCA_WIFI_ISOC) && \ - !defined(REMOVE_PKT_LOG) +#if !defined(REMOVE_PKT_LOG) hif_init_pdev_txrx_handle(hif_sc, vos_get_context(VOS_MODULE_ID_TXRX, pVosContext)); #endif @@ -11793,71 +11597,10 @@ int hdd_wlan_startup(struct device *dev, v_VOID_t *hif_sc) } // Get mac addr from platform driver -#if defined(WLAN_AUTOGEN_MACADDR_FEATURE) && defined (QCA_WIFI_ISOC) - ret = wcnss_get_wlan_mac_address((char*)&mac_addr.bytes); - - if ((0 == ret) && (!vos_is_macaddr_zero(&mac_addr))) - { - /* Store the mac addr for first interface */ - pHddCtx->cfg_ini->intfMacAddr[0] = mac_addr; - - hddLog(VOS_TRACE_LEVEL_ERROR, - "%s: WLAN Mac Addr: " - MAC_ADDRESS_STR, __func__, - MAC_ADDR_ARRAY(pHddCtx->cfg_ini->intfMacAddr[0].bytes)); - - /* Here, passing Arg2 as 1 because we do not want to change the - last 3 bytes (means non OUI bytes) of first interface mac - addr. - */ - if (0 != hdd_generate_iface_mac_addr_auto(pHddCtx, 1, mac_addr)) - { - hddLog(VOS_TRACE_LEVEL_ERROR, - "%s: Failed to generate wlan interface mac addr " - "using MAC from ini file ", __func__); - } - } - else -#endif // WLAN_AUTOGEN_MACADDR_FEATURE && QCA_WIFI_ISOC if (VOS_STATUS_SUCCESS != hdd_update_config_from_nv(pHddCtx)) { // Apply the NV to cfg.dat /* Prima Update MAC address only at here */ -#if defined(WLAN_AUTOGEN_MACADDR_FEATURE) && defined (QCA_WIFI_ISOC) - /* There was not a valid set of MAC Addresses in NV. See if the - default addresses were modified by the cfg.ini settings. If so, - we'll use them, but if not, we'll autogenerate a set of MAC - addresses based upon the device serial number */ - - static const v_MACADDR_t default_address = - {{0x00, 0x0A, 0xF5, 0x89, 0x89, 0xFF}}; - - if (0 == memcmp(&default_address, &pHddCtx->cfg_ini->intfMacAddr[0], - sizeof(default_address))) - { - /* cfg.ini has the default address, invoke autogen logic */ - - /* Here, passing Arg2 as 0 because we want to change the - last 3 bytes (means non OUI bytes) of all the interfaces - mac addr. - */ - if (0 != hdd_generate_iface_mac_addr_auto(pHddCtx, 0, - default_address)) - { - hddLog(VOS_TRACE_LEVEL_ERROR, - "%s: Failed to generate wlan interface mac addr " - "using MAC from ini file " MAC_ADDRESS_STR, __func__, - MAC_ADDR_ARRAY(pHddCtx->cfg_ini->intfMacAddr[0].bytes)); - } - } - else - { - hddLog(VOS_TRACE_LEVEL_ERROR, - "%s: Invalid MAC address in NV, using MAC from ini file " - MAC_ADDRESS_STR, __func__, - MAC_ADDR_ARRAY(pHddCtx->cfg_ini->intfMacAddr[0].bytes)); - } -#endif //WLAN_AUTOGEN_MACADDR_FEATURE && QCA_WIFI_ISOC } if ( VOS_STATUS_SUCCESS != hdd_update_mac_config( pHddCtx ) ) @@ -11918,9 +11661,7 @@ int hdd_wlan_startup(struct device *dev, v_VOID_t *hif_sc) #ifndef CONFIG_ENABLE_LINUX_REG wlan_hdd_cfg80211_update_reg_info( wiphy ); -#ifdef QCA_WIFI_2_0 wlan_hdd_cfg80211_update_wiphy_caps( wiphy ); -#endif /* registration of wiphy dev with cfg80211 */ if (0 > wlan_hdd_cfg80211_register(wiphy)) @@ -11942,7 +11683,7 @@ int hdd_wlan_startup(struct device *dev, v_VOID_t *hif_sc) hddLog(VOS_TRACE_LEVEL_FATAL,"%s: wlan_hdd_ftm_open Failed",__func__); goto err_free_adf_context; } -#if defined(QCA_WIFI_2_0) && !defined(QCA_WIFI_ISOC) && defined(QCA_WIFI_FTM) +#if defined(QCA_WIFI_FTM) if (hdd_ftm_start(pHddCtx)) { hddLog(VOS_TRACE_LEVEL_FATAL,"%s: hdd_ftm_start Failed",__func__); @@ -11951,9 +11692,7 @@ int hdd_wlan_startup(struct device *dev, v_VOID_t *hif_sc) #endif vos_set_load_unload_in_progress(VOS_MODULE_ID_VOSS, FALSE); hddLog(VOS_TRACE_LEVEL_FATAL,"%s: FTM driver loaded", __func__); -#if defined(QCA_WIFI_2_0) && !defined(QCA_WIFI_ISOC) complete(&wlan_start_comp); -#endif return VOS_STATUS_SUCCESS; } @@ -12018,7 +11757,6 @@ int hdd_wlan_startup(struct device *dev, v_VOID_t *hif_sc) goto err_close_adapter; } -#ifdef QCA_WIFI_2_0 /* target hw version/revision would only be retrieved after firmware donwload */ hif_get_hw_info(hif_sc, &pHddCtx->target_hw_version, @@ -12029,10 +11767,6 @@ int hdd_wlan_startup(struct device *dev, v_VOID_t *hif_sc) /* pass target_fw_version to HIF layer */ hif_set_fw_info(hif_sc, pHddCtx->target_fw_version); -#else - /* Exchange capability info between Host and FW and also get versioning info from FW */ - hdd_exchange_version_and_caps(pHddCtx); -#endif if (country_code) { @@ -12173,7 +11907,6 @@ int hdd_wlan_startup(struct device *dev, v_VOID_t *hif_sc) } #ifdef FEATURE_OEM_DATA_SUPPORT -#ifdef QCA_WIFI_2_0 //Initialize the OEM service if (oem_activate_service(pHddCtx) != 0) { @@ -12182,7 +11915,6 @@ int hdd_wlan_startup(struct device *dev, v_VOID_t *hif_sc) goto err_nl_srv; } #endif -#endif #ifdef PTT_SOCK_SVC_ENABLE //Initialize the PTT service @@ -12279,7 +12011,6 @@ int hdd_wlan_startup(struct device *dev, v_VOID_t *hif_sc) wlan_hdd_cfg80211_nan_init(pHddCtx); #endif -#ifndef QCA_WIFI_ISOC /* Thermal Mitigation */ thermalParam.smeThermalMgmtEnabled = pHddCtx->cfg_ini->thermalMitigationEnable; @@ -12325,7 +12056,6 @@ int hdd_wlan_startup(struct device *dev, v_VOID_t *hif_sc) hddLog(VOS_TRACE_LEVEL_ERROR, "%s: Error setting txlimit in sme", __func__); } -#endif /*#ifndef QCA_WIFI_ISOC*/ #ifdef MSM_PLATFORM spin_lock_init(&pHddCtx->bus_bw_lock); @@ -12353,9 +12083,7 @@ int hdd_wlan_startup(struct device *dev, v_VOID_t *hif_sc) pHddCtx->target_hw_name); #endif -#if defined(QCA_WIFI_2_0) && !defined(QCA_WIFI_ISOC) complete(&wlan_start_comp); -#endif goto success; err_nl_srv: @@ -12423,7 +12151,7 @@ err_wdclose: if (VOS_FTM_MODE == hdd_get_conparam()) { -#if defined(QCA_WIFI_2_0) && !defined(QCA_WIFI_ISOC) && defined(QCA_WIFI_FTM) +#if defined(QCA_WIFI_FTM) err_free_ftm_open: wlan_hdd_ftm_close(pHddCtx); #endif @@ -12434,10 +12162,8 @@ err_config: pHddCtx->cfg_ini= NULL; err_free_adf_context: -#ifdef QCA_WIFI_2_0 vos_mem_free(adf_ctx); hif_deinit_adf_ctx(hif_sc); -#endif err_free_hdd_context: hdd_allow_suspend(); @@ -12482,8 +12208,7 @@ static int hdd_driver_init( void) { VOS_STATUS status; v_CONTEXT_t pVosContext = NULL; -#if defined (QCA_WIFI_ISOC) || \ - defined (ANI_BUS_TYPE_PCI) +#if defined (ANI_BUS_TYPE_PCI) struct device *dev = NULL; #endif int ret_status = 0; @@ -12535,13 +12260,6 @@ static int hdd_driver_init( void) do { -#ifdef QCA_WIFI_ISOC - if (NULL == dev) { - hddLog(VOS_TRACE_LEVEL_FATAL, "%s: WLAN device not found!!",__func__); - ret_status = -1; - break; - } -#endif #ifndef MODULE if (WLAN_IS_EPPING_ENABLED(con_mode)) { @@ -12581,8 +12299,6 @@ static int hdd_driver_init( void) hdd_set_conparam((v_UINT_t)con_mode); #endif -#if defined(QCA_WIFI_2_0) && \ - !defined(QCA_WIFI_ISOC) #ifdef HIF_SDIO #define WLAN_WAIT_TIME_WLANSTART 10000 #else @@ -12616,19 +12332,7 @@ static int hdd_driver_init( void) pr_info("%s: driver loaded\n", WLAN_MODULE_NAME); return 0; } -#endif -#ifdef QCA_WIFI_ISOC - // Call our main init function - if (hdd_wlan_startup(dev, NULL)) - { - hddLog(VOS_TRACE_LEVEL_FATAL,"%s: WLAN Driver Initialization failed", - __func__); - vos_preClose( &pVosContext ); - ret_status = -1; - break; - } -#endif } while (0); @@ -12702,9 +12406,7 @@ static void hdd_driver_exit(void) { hdd_context_t *pHddCtx = NULL; int retry = 0; -#ifndef QCA_WIFI_ISOC adf_os_device_t adf_ctx; -#endif v_CONTEXT_t pVosContext = NULL; pr_info("%s: unloading driver v%s\n", WLAN_MODULE_NAME, QWLAN_VERSIONSTR); @@ -12754,10 +12456,6 @@ static void hdd_driver_exit(void) vos_wait_for_work_thread_completion(__func__); -#ifdef QCA_WIFI_ISOC - //Do all the cleanup before deregistering the driver - hdd_wlan_exit(pHddCtx); -#else hif_unregister_driver(); /* @@ -12766,7 +12464,6 @@ static void hdd_driver_exit(void) */ adf_ctx = vos_get_context(VOS_MODULE_ID_ADF, pVosContext); vos_mem_free(adf_ctx); -#endif vos_preClose( &pVosContext ); @@ -12809,7 +12506,7 @@ static int fwpath_changed_handler(const char *kmessage, return param_set_copystring(kmessage, kp); } -#if !(defined(QCA_WIFI_2_0) && defined(QCA_WIFI_FTM) && !defined(QCA_WIFI_ISOC)) +#if ! defined(QCA_WIFI_FTM) static int con_mode_handler(const char *kmessage, struct kernel_param *kp) { @@ -12869,7 +12566,7 @@ static int fwpath_changed_handler(const char *kmessage, return ret; } -#if !(defined(QCA_WIFI_2_0) && defined(QCA_WIFI_FTM) && !defined(QCA_WIFI_ISOC)) +#if ! defined(QCA_WIFI_FTM) /**--------------------------------------------------------------------------- \brief con_mode_handler() - @@ -14107,7 +13804,7 @@ MODULE_LICENSE("Dual BSD/GPL"); MODULE_AUTHOR("Qualcomm Atheros, Inc."); MODULE_DESCRIPTION("WLAN HOST DEVICE DRIVER"); -#if defined(QCA_WIFI_2_0) && defined(QCA_WIFI_FTM) && !defined(QCA_WIFI_ISOC) +#if defined(QCA_WIFI_FTM) module_param(con_mode, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); #else module_param_call(con_mode, con_mode_handler, param_get_int, &con_mode, diff --git a/CORE/HDD/src/wlan_hdd_oemdata.c b/CORE/HDD/src/wlan_hdd_oemdata.c index 04ca34ac388a..71aa9adbf5fc 100644 --- a/CORE/HDD/src/wlan_hdd_oemdata.c +++ b/CORE/HDD/src/wlan_hdd_oemdata.c @@ -45,9 +45,7 @@ #include #include "qwlan_version.h" -#ifdef QCA_WIFI_2_0 static struct hdd_context_s *pHddCtx; -#endif /* QCA_WIFI_2_0 */ /*--------------------------------------------------------------------------------------------- @@ -249,7 +247,6 @@ int iw_set_oem_data_req( return rc; } -#ifdef QCA_WIFI_2_0 /* Forward declaration */ static int oem_msg_callback(struct sk_buff *skb); @@ -1053,5 +1050,4 @@ int oem_msg_callback(struct sk_buff *skb) return 0; } -#endif /* QCA_WIFI_2_0 */ #endif diff --git a/CORE/HDD/src/wlan_hdd_p2p.c b/CORE/HDD/src/wlan_hdd_p2p.c index db0e6c822325..556983f693a5 100644 --- a/CORE/HDD/src/wlan_hdd_p2p.c +++ b/CORE/HDD/src/wlan_hdd_p2p.c @@ -1821,13 +1821,11 @@ struct net_device* __wlan_hdd_add_virtual_intf( /*Allow addition multiple interface for WLAN_HDD_P2P_CLIENT and WLAN_HDD_SOFTAP session type*/ if ((hdd_get_adapter(pHddCtx, wlan_hdd_get_session_type(type)) != NULL) -#ifdef QCA_WIFI_2_0 #ifdef WLAN_FEATURE_MBSSID && WLAN_HDD_SOFTAP != wlan_hdd_get_session_type(type) #endif && WLAN_HDD_P2P_CLIENT != wlan_hdd_get_session_type(type) && WLAN_HDD_INFRA_STATION != wlan_hdd_get_session_type(type) -#endif ) { hddLog(VOS_TRACE_LEVEL_ERROR,"%s: Interface type %d already exists. " diff --git a/CORE/HDD/src/wlan_hdd_softap_tx_rx.c b/CORE/HDD/src/wlan_hdd_softap_tx_rx.c index 19f8f1f464bd..85925a430634 100644 --- a/CORE/HDD/src/wlan_hdd_softap_tx_rx.c +++ b/CORE/HDD/src/wlan_hdd_softap_tx_rx.c @@ -253,215 +253,6 @@ static VOS_STATUS hdd_softap_flush_tx_queues( hdd_adapter_t *pAdapter ) return status; } -#ifndef QCA_WIFI_2_0 -/**============================================================================ - @brief hdd_softap_hard_start_xmit() - Function registered with the Linux OS for - transmitting packets. There are 2 versions of this function. One that uses - locked queue and other that uses lockless queues. Both have been retained to - do some performance testing - - @param skb : [in] pointer to OS packet (sk_buff) - @param dev : [in] pointer to Libra network device - - @return : NET_XMIT_DROP if packets are dropped - : NET_XMIT_SUCCESS if packet is enqueued succesfully - ===========================================================================*/ -int hdd_softap_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) -{ - VOS_STATUS status; - WLANTL_ACEnumType ac = WLANTL_AC_BE; - sme_QosWmmUpType up = SME_QOS_WMM_UP_BE; - skb_list_node_t *pktNode = NULL; - v_SIZE_t pktListSize = 0; - v_BOOL_t txSuspended = VOS_FALSE; - hdd_adapter_t *pAdapter = (hdd_adapter_t *)netdev_priv(dev); - hdd_ap_ctx_t *pHddApCtx = WLAN_HDD_GET_AP_CTX_PTR(pAdapter); - vos_list_node_t *anchor = NULL; - v_U8_t STAId = WLAN_MAX_STA_COUNT; - //Extract the destination address from ethernet frame - v_MACADDR_t *pDestMacAddress = (v_MACADDR_t*)skb->data; - int os_status = NETDEV_TX_OK; - - pDestMacAddress = (v_MACADDR_t*)skb->data; - - ++pAdapter->hdd_stats.hddTxRxStats.txXmitCalled; - - VOS_TRACE( VOS_MODULE_ID_HDD_SAP_DATA, VOS_TRACE_LEVEL_INFO, - "%s: enter", __func__); - - spin_lock_bh( &pAdapter->staInfo_lock ); - if (vos_is_macaddr_broadcast( pDestMacAddress ) || vos_is_macaddr_group(pDestMacAddress)) - { - //The BC/MC station ID is assigned during BSS starting phase. SAP will return the station - //ID used for BC/MC traffic. The station id is registered to TL as well. - STAId = pHddApCtx->uBCStaId; - - /* Setting priority for broadcast packets which doesn't go to select_queue function */ - skb->priority = SME_QOS_WMM_UP_BE; - skb->queue_mapping = HDD_LINUX_AC_BE; - - VOS_TRACE( VOS_MODULE_ID_HDD_SAP_DATA, VOS_TRACE_LEVEL_INFO_LOW, - "%s: BC/MC packet", __func__); - } - else - { - STAId = *(v_U8_t *)(((v_U8_t *)(skb->data)) - 1); - if (STAId == HDD_WLAN_INVALID_STA_ID) - { - VOS_TRACE( VOS_MODULE_ID_HDD_SAP_DATA, VOS_TRACE_LEVEL_WARN, - "%s: Failed to find right station", __func__); - ++pAdapter->stats.tx_dropped; - ++pAdapter->hdd_stats.hddTxRxStats.txXmitDropped; - kfree_skb(skb); - goto xmit_done; - } - else if (FALSE == pAdapter->aStaInfo[STAId].isUsed ) - { - VOS_TRACE( VOS_MODULE_ID_HDD_SAP_DATA, VOS_TRACE_LEVEL_WARN, - "%s: STA %d is unregistered", __func__, STAId); - ++pAdapter->stats.tx_dropped; - ++pAdapter->hdd_stats.hddTxRxStats.txXmitDropped; - kfree_skb(skb); - goto xmit_done; - } - - if ( (WLANTL_STA_CONNECTED != pAdapter->aStaInfo[STAId].tlSTAState) && - (WLANTL_STA_AUTHENTICATED != pAdapter->aStaInfo[STAId].tlSTAState) ) - { - VOS_TRACE( VOS_MODULE_ID_HDD_SAP_DATA, VOS_TRACE_LEVEL_WARN, - "%s: Station not connected yet", __func__); - ++pAdapter->stats.tx_dropped; - ++pAdapter->hdd_stats.hddTxRxStats.txXmitDropped; - kfree_skb(skb); - goto xmit_done; - } - else if(WLANTL_STA_CONNECTED == pAdapter->aStaInfo[STAId].tlSTAState) - { - if(ntohs(skb->protocol) != HDD_ETHERTYPE_802_1_X) - { - VOS_TRACE( VOS_MODULE_ID_HDD_SAP_DATA, VOS_TRACE_LEVEL_WARN, - "%s: NON-EAPOL packet in non-Authenticated state", __func__); - ++pAdapter->stats.tx_dropped; - ++pAdapter->hdd_stats.hddTxRxStats.txXmitDropped; - kfree_skb(skb); - goto xmit_done; - } - } - } - - //Get TL AC corresponding to Qdisc queue index/AC. - ac = hdd_QdiscAcToTlAC[skb->queue_mapping]; - //user priority from IP header, which is already extracted and set from - //select_queue call back function - up = skb->priority; - ++pAdapter->hdd_stats.hddTxRxStats.txXmitClassifiedAC[ac]; - - VOS_TRACE( VOS_MODULE_ID_HDD_SAP_DATA, VOS_TRACE_LEVEL_INFO, - "%s: Classified as ac %d up %d", __func__, ac, up); - - // If the memory differentiation mode is enabled, the memory limit of each queue will be - // checked. Over-limit packets will be dropped. - spin_lock_bh(&pAdapter->aStaInfo[STAId].wmm_tx_queue[ac].lock); - hdd_list_size(&pAdapter->aStaInfo[STAId].wmm_tx_queue[ac], &pktListSize); - if(pktListSize >= pAdapter->aTxQueueLimit[ac]) - { - VOS_TRACE( VOS_MODULE_ID_HDD_SAP_DATA, VOS_TRACE_LEVEL_WARN, - "%s: station %d ac %d queue over limit %d", __func__, STAId, ac, pktListSize); - pAdapter->aStaInfo[STAId].txSuspended[ac] = VOS_TRUE; - netif_stop_subqueue(dev, skb_get_queue_mapping(skb)); - txSuspended = VOS_TRUE; - } - - /* If 3/4th of the max queue size is used then enable the flag. - * This flag indicates to place the DHCP packets in VOICE AC queue.*/ - if (WLANTL_AC_BE == ac) - { - if (pAdapter->aStaInfo[STAId].wmm_tx_queue[ac].count >= HDD_TX_QUEUE_LOW_WATER_MARK) - { - VOS_TRACE( VOS_MODULE_ID_HDD_SAP_DATA, VOS_TRACE_LEVEL_WARN, - "%s: TX queue for Best Effort AC is 3/4th full", __func__); - pAdapter->aStaInfo[STAId].vosLowResource = VOS_TRUE; - } - else - { - pAdapter->aStaInfo[STAId].vosLowResource = VOS_FALSE; - } - } - spin_unlock_bh(&pAdapter->aStaInfo[STAId].wmm_tx_queue[ac].lock); - - if (VOS_TRUE == txSuspended) - { - VOS_TRACE( VOS_MODULE_ID_HDD_SAP_DATA, VOS_TRACE_LEVEL_WARN, - "%s: TX queue full for AC=%d Disable OS TX queue", - __func__, ac ); - os_status = NETDEV_TX_BUSY; - goto xmit_done; - } - - //Use the skb->cb field to hold the list node information - pktNode = (skb_list_node_t *)&skb->cb; - - //Stick the OS packet inside this node. - pktNode->skb = skb; - - //Stick the User Priority inside this node - pktNode->userPriority = up; - - INIT_LIST_HEAD(&pktNode->anchor); - - spin_lock_bh(&pAdapter->aStaInfo[STAId].wmm_tx_queue[ac].lock); - status = hdd_list_insert_back_size(&pAdapter->aStaInfo[STAId].wmm_tx_queue[ac], &pktNode->anchor, &pktListSize ); - spin_unlock_bh(&pAdapter->aStaInfo[STAId].wmm_tx_queue[ac].lock); - - if ( !VOS_IS_STATUS_SUCCESS( status ) ) - { - VOS_TRACE( VOS_MODULE_ID_HDD_SAP_DATA, VOS_TRACE_LEVEL_WARN, - "%s:Insert Tx queue failed. Pkt dropped", __func__); - ++pAdapter->hdd_stats.hddTxRxStats.txXmitDropped; - ++pAdapter->hdd_stats.hddTxRxStats.txXmitDroppedAC[ac]; - ++pAdapter->stats.tx_dropped; - kfree_skb(skb); - goto xmit_done; - } - - ++pAdapter->hdd_stats.hddTxRxStats.txXmitQueued; - ++pAdapter->hdd_stats.hddTxRxStats.txXmitQueuedAC[ac]; - ++pAdapter->hdd_stats.hddTxRxStats.pkt_tx_count; - - if (1 == pktListSize) - { - //Let TL know we have a packet to send for this AC - status = WLANTL_STAPktPending( (WLAN_HDD_GET_CTX(pAdapter))->pvosContext, STAId, ac ); - - if ( !VOS_IS_STATUS_SUCCESS( status ) ) - { - VOS_TRACE( VOS_MODULE_ID_HDD_SAP_DATA, VOS_TRACE_LEVEL_WARN, - "%s: Failed to signal TL for AC=%d STAId =%d", - __func__, ac, STAId ); - - //Remove the packet from queue. It must be at the back of the queue, as TX thread cannot preempt us in the middle - //as we are in a soft irq context. Also it must be the same packet that we just allocated. - spin_lock_bh(&pAdapter->aStaInfo[STAId].wmm_tx_queue[ac].lock); - status = hdd_list_remove_back( &pAdapter->aStaInfo[STAId].wmm_tx_queue[ac], &anchor); - spin_unlock_bh(&pAdapter->aStaInfo[STAId].wmm_tx_queue[ac].lock); - ++pAdapter->stats.tx_dropped; - ++pAdapter->hdd_stats.hddTxRxStats.txXmitDropped; - ++pAdapter->hdd_stats.hddTxRxStats.txXmitDroppedAC[ac]; - kfree_skb(skb); - goto xmit_done; - } - } - dev->trans_start = jiffies; - - VOS_TRACE( VOS_MODULE_ID_HDD_SAP_DATA, VOS_TRACE_LEVEL_INFO_LOW, - "%s: exit", __func__); - -xmit_done: - spin_unlock_bh( &pAdapter->staInfo_lock ); - return os_status; -} - -#else #ifdef QCA_LL_TX_FLOW_CT /**============================================================================ @@ -726,7 +517,6 @@ drop_pkt: return NETDEV_TX_OK; } -#endif /**============================================================================ @brief hdd_softap_sta_2_sta_xmit This function for Transmitting the frames when the traffic is between two stations. @@ -1540,202 +1330,6 @@ VOS_STATUS hdd_softap_tx_low_resource_cbk( vos_pkt_t *pVosPacket, } -#ifndef QCA_WIFI_2_0 -/**============================================================================ - @brief hdd_softap_rx_packet_cbk() - Receive callback registered with TL. - TL will call this to notify the HDD when one or more packets were - received for a registered STA. - - @param vosContext : [in] pointer to VOS context - @param pVosPacketChain : [in] pointer to VOS packet chain - @param staId : [in] Station Id (Adress 1 Index) - @param pRxMetaInfo : [in] pointer to meta info for the received pkt(s). - - @return : VOS_STATUS_E_FAILURE if any errors encountered, - : VOS_STATUS_SUCCESS otherwise - ===========================================================================*/ -VOS_STATUS hdd_softap_rx_packet_cbk( v_VOID_t *vosContext, - vos_pkt_t *pVosPacketChain, - v_U8_t staId, - WLANTL_RxMetaInfoType* pRxMetaInfo ) -{ - hdd_adapter_t *pAdapter = NULL; - VOS_STATUS status = VOS_STATUS_E_FAILURE; - int rxstat; - struct sk_buff *skb = NULL; - vos_pkt_t* pVosPacket; - vos_pkt_t* pNextVosPacket; - hdd_context_t *pHddCtx = NULL; - hdd_ap_ctx_t *pHddApCtx; - - //Sanity check on inputs - if ( ( NULL == vosContext ) || - ( NULL == pVosPacketChain ) || - ( NULL == pRxMetaInfo ) ) - { - VOS_TRACE( VOS_MODULE_ID_HDD_SAP_DATA, VOS_TRACE_LEVEL_ERROR, - "%s: Null params being passed", __func__); - return VOS_STATUS_E_FAILURE; - } - - pHddCtx = (hdd_context_t *)vos_get_context( VOS_MODULE_ID_HDD, vosContext ); - if ( NULL == pHddCtx ) - { - VOS_TRACE( VOS_MODULE_ID_HDD_SAP_DATA, VOS_TRACE_LEVEL_ERROR, - "%s: HDD adapter context is Null", __func__); - return VOS_STATUS_E_FAILURE; - } - - pAdapter = pHddCtx->sta_to_adapter[staId]; - if( NULL == pAdapter ) - { - VOS_ASSERT(0); - return VOS_STATUS_E_FAILURE; - } - - /* Monitor traffic */ - if ( pHddCtx->cfg_ini->enableTrafficMonitor ) - { - pHddCtx->traffic_monitor.lastFrameTs = vos_timer_get_system_time(); - if ( !atomic_read(&pHddCtx->traffic_monitor.isActiveMode) ) - { - vos_lock_acquire(&pHddCtx->traffic_monitor.trafficLock); - /* It was IDLE mode, - * this is new state, then switch mode from suspend to resume */ - if ( !atomic_read(&pHddCtx->traffic_monitor.isActiveMode) ) - { - hdd_set_wlan_suspend_mode(0); - vos_timer_start(&pHddCtx->traffic_monitor.trafficTimer, - pHddCtx->cfg_ini->trafficIdleTimeout); - atomic_set(&pHddCtx->traffic_monitor.isActiveMode, 1); - } - vos_lock_release(&pHddCtx->traffic_monitor.trafficLock); - } - } - - ++pAdapter->hdd_stats.hddTxRxStats.rxChains; - - // walk the chain until all are processed - pVosPacket = pVosPacketChain; - do - { - // get the pointer to the next packet in the chain - // (but don't unlink the packet since we free the entire chain later) - status = vos_pkt_walk_packet_chain( pVosPacket, &pNextVosPacket, VOS_FALSE); - - // both "success" and "empty" are acceptable results - if (!((status == VOS_STATUS_SUCCESS) || (status == VOS_STATUS_E_EMPTY))) - { - ++pAdapter->hdd_stats.hddTxRxStats.rxDropped; - VOS_TRACE( VOS_MODULE_ID_HDD_SAP_DATA, VOS_TRACE_LEVEL_ERROR, - "%s: Failure walking packet chain", __func__); - return VOS_STATUS_E_FAILURE; - } - - // Extract the OS packet (skb). - // Tell VOS to detach the OS packet from the VOS packet - status = vos_pkt_get_os_packet( pVosPacket, (v_VOID_t **)&skb, VOS_TRUE ); - if(!VOS_IS_STATUS_SUCCESS( status )) - { - ++pAdapter->hdd_stats.hddTxRxStats.rxDropped; - VOS_TRACE( VOS_MODULE_ID_HDD_SAP_DATA, VOS_TRACE_LEVEL_ERROR, - "%s: Failure extracting skb from vos pkt", __func__); - return VOS_STATUS_E_FAILURE; - } - - //hdd_softap_dump_sk_buff(skb); - - skb->dev = pAdapter->dev; - - if(skb->dev == NULL) { - - VOS_TRACE( VOS_MODULE_ID_HDD_SAP_DATA, VOS_TRACE_LEVEL_FATAL, - "ERROR!!Invalid netdevice"); - return VOS_STATUS_E_FAILURE; - } - ++pAdapter->hdd_stats.hddTxRxStats.rxPackets; - ++pAdapter->stats.rx_packets; - pAdapter->stats.rx_bytes += skb->len; - - pHddApCtx = WLAN_HDD_GET_AP_CTX_PTR(pAdapter); - - if (WLAN_RX_BCMC_STA_ID == pRxMetaInfo->ucDesSTAId) - { - //MC/BC packets. Duplicate a copy of packet - struct sk_buff *pSkbCopy; - - if (!(pHddApCtx->apDisableIntraBssFwd)) - { - pSkbCopy = skb_copy(skb, GFP_ATOMIC); - if (pSkbCopy) - { - hdd_softap_sta_2_sta_xmit(pSkbCopy, pSkbCopy->dev, - pHddApCtx->uBCStaId, (pRxMetaInfo->ucUP)); - } - else - { - VOS_TRACE(VOS_MODULE_ID_HDD_SAP_DATA, VOS_TRACE_LEVEL_ERROR, - "%s: skb allocation fails", __func__); - } - } - - } //(WLAN_RX_BCMC_STA_ID == staId) - - if ((WLAN_RX_BCMC_STA_ID == pRxMetaInfo->ucDesSTAId) || -#ifdef WLAN_FEATURE_MBSSID - (pHddApCtx->uBCStaId == pRxMetaInfo->ucDesSTAId)) -#else - (WLAN_RX_SAP_SELF_STA_ID == pRxMetaInfo->ucDesSTAId)) -#endif - { - VOS_TRACE( VOS_MODULE_ID_HDD_SAP_DATA, VOS_TRACE_LEVEL_INFO_LOW, - "%s: send one packet to kernel", __func__); - - skb->protocol = eth_type_trans(skb, skb->dev); - skb->ip_summed = CHECKSUM_NONE; -#ifdef WLAN_FEATURE_HOLD_RX_WAKELOCK - vos_wake_lock_timeout_acquire(&pHddCtx->rx_wake_lock, - HDD_WAKE_LOCK_DURATION); -#endif - rxstat = netif_rx_ni(skb); - if (NET_RX_SUCCESS == rxstat) - { - ++pAdapter->hdd_stats.hddTxRxStats.rxDelivered; - ++pAdapter->hdd_stats.hddTxRxStats.pkt_rx_count; - } - else - { - ++pAdapter->hdd_stats.hddTxRxStats.rxRefused; - } - } - else if ((WLAN_HDD_GET_AP_CTX_PTR(pAdapter))->apDisableIntraBssFwd) - { - kfree_skb(skb); - } - else - { - //loopback traffic - status = hdd_softap_sta_2_sta_xmit(skb, skb->dev, - pRxMetaInfo->ucDesSTAId, (pRxMetaInfo->ucUP)); - } - - // now process the next packet in the chain - pVosPacket = pNextVosPacket; - - } while (pVosPacket); - - //Return the entire VOS packet chain to the resource pool - status = vos_pkt_return_packet( pVosPacketChain ); - if(!VOS_IS_STATUS_SUCCESS( status )) - { - VOS_TRACE( VOS_MODULE_ID_HDD_SAP_DATA, VOS_TRACE_LEVEL_ERROR,"%s: Failure returning vos pkt", __func__); - } - - pAdapter->dev->last_rx = jiffies; - - return status; -} -#else /**============================================================================ @brief hdd_softap_rx_packet_cbk() - Receive callback registered with TL. @@ -1875,15 +1469,12 @@ VOS_STATUS hdd_softap_rx_mul_packet_cbk(v_VOID_t *vosContext, return VOS_STATUS_SUCCESS; } #endif /* IPA_OFFLOAD */ -#endif VOS_STATUS hdd_softap_DeregisterSTA( hdd_adapter_t *pAdapter, tANI_U8 staId ) { VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; hdd_context_t *pHddCtx; -#ifdef QCA_WIFI_2_0 v_U8_t i; -#endif if (NULL == pAdapter) { @@ -1911,7 +1502,6 @@ VOS_STATUS hdd_softap_DeregisterSTA( hdd_adapter_t *pAdapter, tANI_U8 staId ) staId, vosStatus, vosStatus ); } -#ifdef QCA_WIFI_2_0 if (pAdapter->aStaInfo[staId].isUsed) { spin_lock_bh( &pAdapter->staInfo_lock ); vos_mem_zero(&pAdapter->aStaInfo[staId], sizeof(hdd_station_info_t)); @@ -1926,17 +1516,6 @@ VOS_STATUS hdd_softap_DeregisterSTA( hdd_adapter_t *pAdapter, tANI_U8 staId ) } spin_unlock_bh( &pAdapter->staInfo_lock ); } -#else - vosStatus = hdd_softap_deinit_tx_rx_sta ( pAdapter, staId ); - if( VOS_STATUS_E_FAILURE == vosStatus ) - { - VOS_TRACE ( VOS_MODULE_ID_HDD_SAP_DATA, VOS_TRACE_LEVEL_ERROR, - "hdd_softap_deinit_tx_rx_sta() failed for staID %d. " - "Status = %d [0x%08X]", - staId, vosStatus, vosStatus ); - return( vosStatus ); - } -#endif pHddCtx->sta_to_adapter[staId] = NULL; return( vosStatus ); diff --git a/CORE/HDD/src/wlan_hdd_tdls.c b/CORE/HDD/src/wlan_hdd_tdls.c index 85fe6488e5c3..c19fee624f3d 100644 --- a/CORE/HDD/src/wlan_hdd_tdls.c +++ b/CORE/HDD/src/wlan_hdd_tdls.c @@ -88,7 +88,6 @@ void wlan_hdd_tdls_pre_setup_init_work(tdlsCtx_t * pHddTdlsCtx, if (TDLS_CTX_MAGIC != pHddTdlsCtx->magic) { -#ifdef QCA_WIFI_2_0 /* When TDLS discovery attempt for a peer reaches to max configured * threshold then tdls support for that peer would be disabled and * in that case, ignore discovery trigger from FW for that peer. @@ -101,7 +100,6 @@ void wlan_hdd_tdls_pre_setup_init_work(tdlsCtx_t * pHddTdlsCtx, __func__, MAC_ADDR_ARRAY(curr_candidate->peerMac)); return; } -#endif /* QCA_WIFI_2_0 */ pHddTdlsCtx->curr_candidate = curr_candidate; pHddTdlsCtx->magic = TDLS_CTX_MAGIC; @@ -278,246 +276,7 @@ done: } #endif /* TDLS_USE_SEPARATE_DISCOVERY_TIMER */ -#ifndef QCA_WIFI_2_0 -static v_VOID_t wlan_hdd_tdls_update_peer_cb( v_PVOID_t userData ) -{ - int i; - struct list_head *head; - struct list_head *pos; - hddTdlsPeer_t *curr_peer; - tdlsCtx_t *pHddTdlsCtx = (tdlsCtx_t *)userData; - hdd_context_t *pHddCtx; - - if ((NULL == pHddTdlsCtx) || (NULL == pHddTdlsCtx->pAdapter)) - { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - FL("pHddTdlsCtx or pAdapter points to NULL")); - return; - } - - pHddCtx = WLAN_HDD_GET_CTX( pHddTdlsCtx->pAdapter ); - if (0 != (wlan_hdd_validate_context(pHddCtx))) - { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - FL("pHddCtx is not valid")); - return; - } - - if (NULL == pHddCtx) - return; - - mutex_lock(&pHddCtx->tdls_lock); - - for (i = 0; i < 256; i++) { - head = &pHddTdlsCtx->peer_list[i]; - - list_for_each (pos, head) { - curr_peer = list_entry (pos, hddTdlsPeer_t, node); - - VOS_TRACE( VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, - "%s: " MAC_ADDRESS_STR " link_status %d" - " tdls_support %d", __func__, MAC_ADDR_ARRAY(curr_peer->peerMac), - curr_peer->link_status, curr_peer->tdls_support); - - if (eTDLS_CAP_SUPPORTED == curr_peer->tdls_support) { - VOS_TRACE( VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, - "tx %d, rx %d (thr.pkt %d/idle %d), rssi %d (thr.trig %d/hys %d/tear %d)", - curr_peer->tx_pkt, curr_peer->rx_pkt, - pHddTdlsCtx->threshold_config.tx_packet_n, - pHddTdlsCtx->threshold_config.idle_packet_n, - curr_peer->rssi, - pHddTdlsCtx->threshold_config.rssi_trigger_threshold, - pHddTdlsCtx->threshold_config.rssi_hysteresis, - pHddTdlsCtx->threshold_config.rssi_teardown_threshold); - - if ((eTDLS_LINK_IDLE == curr_peer->link_status) || - (eTDLS_LINK_DISCOVERING == curr_peer->link_status)){ - - if (pHddCtx->cfg_ini->fTDLSExternalControl && - (FALSE == curr_peer->isForcedPeer)) { - continue; - } - - if (curr_peer->tx_pkt >= - pHddTdlsCtx->threshold_config.tx_packet_n) { - - if (pHddCtx->max_num_tdls_sta > wlan_hdd_tdlsConnectedPeers(pHddTdlsCtx->pAdapter)) - { - - VOS_TRACE( VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, "Tput trigger TDLS pre-setup"); -#ifdef CONFIG_TDLS_IMPLICIT - wlan_hdd_tdls_pre_setup_init_work(pHddTdlsCtx, curr_peer); -#endif - } - else - { - VOS_TRACE( VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, - "%s: Maximum peer connected already! %d", - __func__, wlan_hdd_tdlsConnectedPeers(pHddTdlsCtx->pAdapter) ); - } - goto next_peer; - } - } - else if (eTDLS_LINK_CONNECTED == curr_peer->link_status) { - if ((tANI_S32)curr_peer->rssi < - (tANI_S32)pHddTdlsCtx->threshold_config.rssi_teardown_threshold) { - - VOS_TRACE( VOS_MODULE_ID_HDD, - VOS_TRACE_LEVEL_WARN, - "Tear down - low RSSI: " MAC_ADDRESS_STR "!", - MAC_ADDR_ARRAY(curr_peer->peerMac)); -#ifdef CONFIG_TDLS_IMPLICIT - wlan_hdd_tdls_indicate_teardown(pHddTdlsCtx->pAdapter, - curr_peer, - eSIR_MAC_TDLS_TEARDOWN_UNSPEC_REASON); -#endif - goto next_peer; - } - - /* Only teardown based on non zero idle packet threshold, to address a use - * case where this threshold does not get consider for TEAR DOWN. - */ - - if (( 0 != pHddTdlsCtx->threshold_config.idle_packet_n ) && - ((curr_peer->tx_pkt < - pHddTdlsCtx->threshold_config.idle_packet_n) && - (curr_peer->rx_pkt < - pHddTdlsCtx->threshold_config.idle_packet_n))) { - if (VOS_TIMER_STATE_RUNNING != - vos_timer_getCurrentState(&curr_peer->peerIdleTimer)) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_WARN, - "Tx/Rx Idle timer start: " MAC_ADDRESS_STR "!", - MAC_ADDR_ARRAY(curr_peer->peerMac)); - wlan_hdd_tdls_timer_restart(pHddTdlsCtx->pAdapter, - &curr_peer->peerIdleTimer, - pHddTdlsCtx->threshold_config.idle_timeout_t); - } - } else { - if (VOS_TIMER_STATE_RUNNING == - vos_timer_getCurrentState(&curr_peer->peerIdleTimer)) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_WARN, - "Tx/Rx Idle timer stop: " MAC_ADDRESS_STR "!", - MAC_ADDR_ARRAY(curr_peer->peerMac)); - vos_timer_stop( &curr_peer->peerIdleTimer); - } - } - -// if (curr_peer->rssi < -// (pHddTdlsCtx->threshold_config.rssi_hysteresis + -// pHddTdlsCtx->ap_rssi)) { -// -//#ifdef CONFIG_TDLS_IMPLICIT -// cfg80211_tdls_oper_request(pHddTdlsCtx->dev, -// curr_peer->peerMac, -// NL80211_TDLS_TEARDOWN, FALSE, -// GFP_KERNEL); -//#endif -// } - } - } else if (eTDLS_CAP_UNKNOWN == curr_peer->tdls_support) { - - if (pHddCtx->cfg_ini->fTDLSExternalControl && - (FALSE == curr_peer->isForcedPeer)) { - continue; - } - if (!TDLS_IS_CONNECTED(curr_peer)) { - if (curr_peer->tx_pkt >= - pHddTdlsCtx->threshold_config.tx_packet_n) { - - if (curr_peer->discovery_attempt++ < - pHddTdlsCtx->threshold_config.discovery_tries_n) { - VOS_TRACE( VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, "TDLS UNKNOWN discover "); -#ifdef CONFIG_TDLS_IMPLICIT - wlan_hdd_tdls_pre_setup_init_work(pHddTdlsCtx, curr_peer); -#endif - } - else - { - curr_peer->tdls_support = eTDLS_CAP_NOT_SUPPORTED; - curr_peer->link_status = eTDLS_LINK_IDLE; - } - } - } - } - -next_peer: - curr_peer->tx_pkt = 0; - curr_peer->rx_pkt = 0; - } - } - - wlan_hdd_tdls_timer_restart(pHddTdlsCtx->pAdapter, - &pHddTdlsCtx->peerUpdateTimer, - pHddTdlsCtx->threshold_config.tx_period_t); - mutex_unlock(&pHddCtx->tdls_lock); -} -#endif - -#ifndef QCA_WIFI_2_0 -static v_VOID_t wlan_hdd_tdls_idle_cb( v_PVOID_t userData ) -{ -#ifdef CONFIG_TDLS_IMPLICIT - hddTdlsPeer_t *curr_peer = (hddTdlsPeer_t *)userData; - tdlsCtx_t *pHddTdlsCtx; - hdd_context_t *pHddCtx; - - if (NULL == curr_peer) - { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - FL("Invalid tdls idle timer expired")); - return; - } - - pHddTdlsCtx = curr_peer->pHddTdlsCtx; - if ((NULL == pHddTdlsCtx) || (NULL == pHddTdlsCtx->pAdapter) ) - { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - FL("pHddTdlsCtx or pAdapter points to NULL")); - return; - } - - pHddCtx = WLAN_HDD_GET_CTX( pHddTdlsCtx->pAdapter ); - if (0 != (wlan_hdd_validate_context(pHddCtx))) - { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - FL("pHddCtx is not valid")); - return; - } - VOS_TRACE(VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, - "%s: Tx/Rx Idle " MAC_ADDRESS_STR " tx_pkt: %d, rx_pkt: %d, idle_packet_n: %d", - __func__, MAC_ADDR_ARRAY(curr_peer->peerMac), - curr_peer->tx_pkt, - curr_peer->rx_pkt, - curr_peer->pHddTdlsCtx->threshold_config.idle_packet_n); - - mutex_lock(&pHddCtx->tdls_lock); - - /* Check tx/rx statistics on this tdls link for recent activities and - * then decide whether to tear down the link or keep it. - */ - if ((curr_peer->tx_pkt >= curr_peer->pHddTdlsCtx->threshold_config.idle_packet_n) || (curr_peer->rx_pkt >= curr_peer->pHddTdlsCtx->threshold_config.idle_packet_n)) - { - /* this tdls link got back to normal, so keep it */ - VOS_TRACE(VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, - "%s: tdls link to " MAC_ADDRESS_STR " back to normal, will stay", - __func__, MAC_ADDR_ARRAY(curr_peer->peerMac)); - } - else - { - /* this tdls link needs to get torn down */ - VOS_TRACE(VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, - "%s: trigger tdls link to " MAC_ADDRESS_STR " down", - __func__, MAC_ADDR_ARRAY(curr_peer->peerMac)); - - wlan_hdd_tdls_indicate_teardown(curr_peer->pHddTdlsCtx->pAdapter, - curr_peer, - eSIR_MAC_TDLS_TEARDOWN_UNSPEC_REASON); - } - mutex_unlock(&pHddCtx->tdls_lock); -#endif -} -#endif /* QCA_WIFI_2_0 */ static v_VOID_t wlan_hdd_tdls_discovery_timeout_peer_cb(v_PVOID_t userData) { @@ -654,10 +413,8 @@ int wlan_hdd_tdls_init(hdd_adapter_t *pAdapter) tdlsCtx_t *pHddTdlsCtx; int i; v_U8_t staIdx; -#ifdef QCA_WIFI_2_0 tdlsInfo_t *tInfo; eHalStatus halStatus = eHAL_STATUS_FAILURE; -#endif if (NULL == pHddCtx) return -1; @@ -668,23 +425,13 @@ int wlan_hdd_tdls_init(hdd_adapter_t *pAdapter) * received from target, so cfg_ini gives combined intersected result */ if ((FALSE == pHddCtx->cfg_ini->fEnableTDLSSupport) -#ifndef QCA_WIFI_2_0 - || (FALSE == sme_IsFeatureSupportedByFW(TDLS)) -#endif ) { pHddCtx->tdls_mode = eTDLS_SUPPORT_NOT_ENABLED; pAdapter->sessionCtx.station.pHddTdlsCtx = NULL; -#ifndef QCA_WIFI_2_0 - hddLog(VOS_TRACE_LEVEL_ERROR, - "%s TDLS not enabled (%d) or FW doesn't support (%d)", - __func__, pHddCtx->cfg_ini->fEnableTDLSSupport, - sme_IsFeatureSupportedByFW(TDLS)); -#else hddLog(VOS_TRACE_LEVEL_ERROR, "%s TDLS not enabled (%d) or FW doesn't support", __func__, pHddCtx->cfg_ini->fEnableTDLSSupport); -#endif mutex_unlock(&pHddCtx->tdls_lock); return 0; } @@ -728,12 +475,6 @@ int wlan_hdd_tdls_init(hdd_adapter_t *pAdapter) pHddTdlsCtx); #endif -#ifndef QCA_WIFI_2_0 - vos_timer_init(&pHddTdlsCtx->peerUpdateTimer, - VOS_TIMER_TYPE_SW, - wlan_hdd_tdls_update_peer_cb, - pHddTdlsCtx); -#endif vos_timer_init(&pHddTdlsCtx->peerDiscoveryTimeoutTimer, VOS_TIMER_TYPE_SW, wlan_hdd_tdls_discovery_timeout_peer_cb, @@ -784,9 +525,7 @@ int wlan_hdd_tdls_init(hdd_adapter_t *pAdapter) pHddTdlsCtx->threshold_config.rssi_hysteresis = pHddCtx->cfg_ini->fTDLSRSSIHysteresis; pHddTdlsCtx->threshold_config.rssi_trigger_threshold = pHddCtx->cfg_ini->fTDLSRSSITriggerThreshold; pHddTdlsCtx->threshold_config.rssi_teardown_threshold = pHddCtx->cfg_ini->fTDLSRSSITeardownThreshold; -#ifdef QCA_WIFI_2_0 pHddTdlsCtx->threshold_config.rssi_delta = pHddCtx->cfg_ini->fTDLSRSSIDelta; -#endif if (FALSE == pHddCtx->cfg_ini->fEnableTDLSImplicitTrigger) { @@ -807,16 +546,12 @@ int wlan_hdd_tdls_init(hdd_adapter_t *pAdapter) * which would try to acquire sme lock. */ mutex_unlock(&pHddCtx->tdls_lock); -#ifdef QCA_WIFI_2_0 tInfo = vos_mem_malloc(sizeof(tdlsInfo_t)); if (NULL == tInfo) { hddLog(VOS_TRACE_LEVEL_ERROR, "%s: vos_mem_alloc failed for tInfo", __func__); vos_timer_destroy(&pHddTdlsCtx->peerDiscoveryTimeoutTimer); -#ifndef QCA_WIFI_2_0 - vos_timer_destroy(&pHddTdlsCtx->peerUpdateTimer); -#endif #ifdef TDLS_USE_SEPARATE_DISCOVERY_TIMER vos_timer_destroy(&pHddTdlsCtx->peerDiscoverTimer); #endif @@ -885,16 +620,12 @@ int wlan_hdd_tdls_init(hdd_adapter_t *pAdapter) { vos_mem_free(tInfo); vos_timer_destroy(&pHddTdlsCtx->peerDiscoveryTimeoutTimer); -#ifndef QCA_WIFI_2_0 - vos_timer_destroy(&pHddTdlsCtx->peerUpdateTimer); -#endif #ifdef TDLS_USE_SEPARATE_DISCOVERY_TIMER vos_timer_destroy(&pHddTdlsCtx->peerDiscoverTimer); #endif vos_mem_free(pHddTdlsCtx); return -1; } -#endif return 0; } @@ -903,10 +634,8 @@ void wlan_hdd_tdls_exit(hdd_adapter_t *pAdapter) { tdlsCtx_t *pHddTdlsCtx; hdd_context_t *pHddCtx; -#ifdef QCA_WIFI_2_0 tdlsInfo_t *tInfo; eHalStatus halStatus = eHAL_STATUS_FAILURE; -#endif pHddCtx = WLAN_HDD_GET_CTX( pAdapter ); if (!pHddCtx) @@ -942,7 +671,6 @@ void wlan_hdd_tdls_exit(hdd_adapter_t *pAdapter) wlan_hdd_tdls_free_scan_request(&pHddCtx->tdls_scan_ctxt); -#ifdef QCA_WIFI_2_0 tInfo = vos_mem_malloc(sizeof(tdlsInfo_t)); if (NULL != tInfo) { @@ -1015,7 +743,6 @@ void wlan_hdd_tdls_exit(hdd_adapter_t *pAdapter) hddLog(VOS_TRACE_LEVEL_ERROR, "%s: vos_mem_alloc failed for tInfo", __func__); } -#endif vos_mem_free(pHddTdlsCtx); pAdapter->sessionCtx.station.pHddTdlsCtx = NULL; @@ -1027,9 +754,6 @@ static void wlan_hdd_tdls_monitor_timers_stop(tdlsCtx_t *pHddTdlsCtx) { #ifdef TDLS_USE_SEPARATE_DISCOVERY_TIMER vos_timer_stop(&pHddTdlsCtx->peerDiscoverTimer); -#endif -#ifndef QCA_WIFI_2_0 - vos_timer_stop(&pHddTdlsCtx->peerUpdateTimer); #endif vos_timer_stop(&pHddTdlsCtx->peerDiscoveryTimeoutTimer); } @@ -1046,13 +770,6 @@ static void wlan_hdd_tdls_peer_timers_stop(tdlsCtx_t *pHddTdlsCtx) head = &pHddTdlsCtx->peer_list[i]; list_for_each (pos, head) { curr_peer = list_entry (pos, hddTdlsPeer_t, node); -#ifndef QCA_WIFI_2_0 - VOS_TRACE( VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, - "%s: " MAC_ADDRESS_STR " -> stop idle timer", - __func__, - MAC_ADDR_ARRAY(curr_peer->peerMac)); - vos_timer_stop ( &curr_peer->peerIdleTimer ); -#endif vos_timer_stop( &curr_peer->initiatorWaitTimeoutTimer ); } } @@ -1070,10 +787,6 @@ static void wlan_hdd_tdls_monitor_timers_destroy(tdlsCtx_t *pHddTdlsCtx) #ifdef TDLS_USE_SEPARATE_DISCOVERY_TIMER vos_timer_stop(&pHddTdlsCtx->peerDiscoverTimer); vos_timer_destroy(&pHddTdlsCtx->peerDiscoverTimer); -#endif -#ifndef QCA_WIFI_2_0 - vos_timer_stop(&pHddTdlsCtx->peerUpdateTimer); - vos_timer_destroy(&pHddTdlsCtx->peerUpdateTimer); #endif vos_timer_stop(&pHddTdlsCtx->peerDiscoveryTimeoutTimer); vos_timer_destroy(&pHddTdlsCtx->peerDiscoveryTimeoutTimer); @@ -1092,14 +805,6 @@ static void wlan_hdd_tdls_peer_timers_destroy(tdlsCtx_t *pHddTdlsCtx) list_for_each (pos, head) { curr_peer = list_entry (pos, hddTdlsPeer_t, node); -#ifndef QCA_WIFI_2_0 - VOS_TRACE( VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, - "%s: " MAC_ADDRESS_STR " -> destroy idle timer", - __func__, - MAC_ADDR_ARRAY(curr_peer->peerMac)); - vos_timer_stop ( &curr_peer->peerIdleTimer ); - vos_timer_destroy ( &curr_peer->peerIdleTimer ); -#endif vos_timer_stop(&curr_peer->initiatorWaitTimeoutTimer); vos_timer_destroy(&curr_peer->initiatorWaitTimeoutTimer); } @@ -1167,12 +872,6 @@ hddTdlsPeer_t *wlan_hdd_tdls_get_peer(hdd_adapter_t *pAdapter, u8 *mac) vos_mem_copy(peer->peerMac, mac, sizeof(peer->peerMac)); peer->pHddTdlsCtx = pHddTdlsCtx; -#ifndef QCA_WIFI_2_0 - vos_timer_init(&peer->peerIdleTimer, - VOS_TIMER_TYPE_SW, - wlan_hdd_tdls_idle_cb, - peer); -#endif vos_timer_init(&peer->initiatorWaitTimeoutTimer, VOS_TIMER_TYPE_SW, @@ -1218,7 +917,6 @@ void wlan_hdd_tdls_set_peer_link_status(hddTdlsPeer_t *curr_peer, tTDLSLinkStatu curr_peer->link_status = status; -#ifdef QCA_WIFI_2_0 /* If TDLS link status is already passed the discovery state * then clear discovery attempt count */ @@ -1226,7 +924,6 @@ void wlan_hdd_tdls_set_peer_link_status(hddTdlsPeer_t *curr_peer, tTDLSLinkStatu { curr_peer->discovery_attempt = 0; } -#endif /* QCA_WIFI_2_0 */ return; } @@ -1247,7 +944,6 @@ void wlan_hdd_tdls_set_link_status(hdd_adapter_t *pAdapter, curr_peer->link_status= linkStatus; -#ifdef QCA_WIFI_2_0 /* If TDLS link status is already passed the discovery state * then clear discovery attempt count */ @@ -1255,7 +951,6 @@ void wlan_hdd_tdls_set_link_status(hdd_adapter_t *pAdapter, { curr_peer->discovery_attempt = 0; } -#endif /* QCA_WIFI_2_0 */ return; } @@ -1601,10 +1296,8 @@ int wlan_hdd_tdls_set_params(struct net_device *dev, tdls_config_params_t *confi hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX( pAdapter ); tdlsCtx_t *pHddTdlsCtx = WLAN_HDD_GET_TDLS_CTX_PTR(pAdapter); eTDLSSupportMode req_tdls_mode; -#ifdef QCA_WIFI_2_0 tdlsInfo_t *tdlsParams; eHalStatus halStatus = eHAL_STATUS_FAILURE; -#endif if (NULL == pHddTdlsCtx) { @@ -1646,7 +1339,6 @@ int wlan_hdd_tdls_set_params(struct net_device *dev, tdls_config_params_t *confi wlan_hdd_tdls_set_mode(pHddCtx, req_tdls_mode, TRUE); -#ifdef QCA_WIFI_2_0 tdlsParams = vos_mem_malloc(sizeof(tdlsInfo_t)); if (NULL == tdlsParams) { @@ -1717,7 +1409,6 @@ int wlan_hdd_tdls_set_params(struct net_device *dev, tdls_config_params_t *confi vos_mem_free(tdlsParams); return -1; } -#endif return 0; } @@ -1864,11 +1555,6 @@ int wlan_hdd_tdls_reset_peer(hdd_adapter_t *pAdapter, u8 *mac) curr_peer->link_status = eTDLS_LINK_IDLE; curr_peer->staId = 0; -#ifndef QCA_WIFI_2_0 - if(eTDLS_SUPPORT_ENABLED == pHddCtx->tdls_mode) { - vos_timer_stop( &curr_peer->peerIdleTimer ); - } -#endif return 0; } @@ -2041,11 +1727,6 @@ void wlan_hdd_tdls_connection_callback(hdd_adapter_t *pAdapter) wlan_hdd_tdls_timer_restart(pHddTdlsCtx->pAdapter, &pHddTdlsCtx->peerDiscoverTimer, pHddTdlsCtx->threshold_config.discovery_period_t); -#endif -#ifndef QCA_WIFI_2_0 - wlan_hdd_tdls_timer_restart(pHddTdlsCtx->pAdapter, - &pHddTdlsCtx->peerUpdateTimer, - pHddTdlsCtx->threshold_config.tx_period_t); #endif } mutex_unlock(&pHddCtx->tdls_lock); @@ -2324,11 +2005,6 @@ static void wlan_hdd_tdls_implicit_enable(tdlsCtx_t *pHddTdlsCtx) &pHddTdlsCtx->peerDiscoverTimer, pHddTdlsCtx->threshold_config.discovery_period_t); #endif -#ifndef QCA_WIFI_2_0 - wlan_hdd_tdls_timer_restart(pHddTdlsCtx->pAdapter, - &pHddTdlsCtx->peerUpdateTimer, - pHddTdlsCtx->threshold_config.tx_period_t); -#endif } void wlan_hdd_tdls_set_mode(hdd_context_t *pHddCtx, @@ -2454,7 +2130,6 @@ static void __wlan_hdd_tdls_pre_setup(struct work_struct *work) if (eTDLS_CAP_UNKNOWN != curr_peer->tdls_support) curr_peer->link_status = eTDLS_LINK_DISCOVERING; -#ifdef QCA_WIFI_2_0 if (curr_peer->discovery_attempt >= pHddTdlsCtx->threshold_config.discovery_tries_n) { @@ -2468,7 +2143,6 @@ static void __wlan_hdd_tdls_pre_setup(struct work_struct *work) goto done; } curr_peer->link_status = eTDLS_LINK_DISCOVERING; -#endif status = wlan_hdd_cfg80211_send_tdls_discover_req(pHddTdlsCtx->pAdapter->wdev.wiphy, pHddTdlsCtx->pAdapter->dev, @@ -2485,9 +2159,7 @@ static void __wlan_hdd_tdls_pre_setup(struct work_struct *work) pHddTdlsCtx->discovery_sent_cnt++; -#ifdef QCA_WIFI_2_0 curr_peer->discovery_attempt++; -#endif /* QCA_WIFI_2_0 */ mutex_lock(&pHddCtx->tdls_lock); diff --git a/CORE/HDD/src/wlan_hdd_tx_rx.c b/CORE/HDD/src/wlan_hdd_tx_rx.c index 967c671d4b39..18195a7996f2 100644 --- a/CORE/HDD/src/wlan_hdd_tx_rx.c +++ b/CORE/HDD/src/wlan_hdd_tx_rx.c @@ -614,237 +614,6 @@ fail: return NETDEV_TX_OK; } -#ifndef QCA_WIFI_2_0 -/**============================================================================ - @brief hdd_hard_start_xmit() - Function registered with the Linux OS for - transmitting packets. There are 2 versions of this function. One that uses - locked queue and other that uses lockless queues. Both have been retained to - do some performance testing - - @param skb : [in] pointer to OS packet (sk_buff) - @param dev : [in] pointer to Libra network device - - @return : NET_XMIT_DROP if packets are dropped - : NET_XMIT_SUCCESS if packet is enqueued succesfully - ===========================================================================*/ -int hdd_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) -{ - VOS_STATUS status; - WLANTL_ACEnumType ac; - sme_QosWmmUpType up; - skb_list_node_t *pktNode = NULL; - hdd_list_node_t *anchor = NULL; - v_SIZE_t pktListSize = 0; - hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); - v_BOOL_t granted; - v_U8_t STAId = WLAN_MAX_STA_COUNT; - hdd_station_ctx_t *pHddStaCtx = &pAdapter->sessionCtx.station; - v_BOOL_t txSuspended = VOS_FALSE; - - ++pAdapter->hdd_stats.hddTxRxStats.txXmitCalled; - - if (unlikely(netif_subqueue_stopped(dev, skb))) { - VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR, - "%s is called when netif TX %d is disabled", - __func__, skb->queue_mapping); - return NETDEV_TX_BUSY; - } - - //Get TL AC corresponding to Qdisc queue index/AC. - ac = hdd_QdiscAcToTlAC[skb->queue_mapping]; - - if (WLAN_HDD_IBSS == pAdapter->device_mode) - { - v_MACADDR_t *pDestMacAddress = (v_MACADDR_t*)skb->data; - - if (eConnectionState_IbssDisconnected == pHddStaCtx->conn_info.connState) - { - VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_INFO, - "%s: Tx frame in disconnected state in IBSS mode", __func__); - ++pAdapter->stats.tx_dropped; - ++pAdapter->hdd_stats.hddTxRxStats.txXmitDropped; - ++pAdapter->hdd_stats.hddTxRxStats.txXmitDroppedAC[ac]; - kfree_skb(skb); - return NETDEV_TX_OK; - } - - STAId = *(v_U8_t *)(((v_U8_t *)(skb->data)) - 1); - - if ((STAId == HDD_WLAN_INVALID_STA_ID) && - (vos_is_macaddr_broadcast( pDestMacAddress ) || - vos_is_macaddr_group(pDestMacAddress))) - { - STAId = IBSS_BROADCAST_STAID; - VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_INFO_LOW, - "%s: BC/MC packet", __func__); - } - else if (STAId == HDD_WLAN_INVALID_STA_ID) - { - VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_INFO, - "%s: Received Unicast frame with invalid staID", __func__); - ++pAdapter->stats.tx_dropped; - ++pAdapter->hdd_stats.hddTxRxStats.txXmitDropped; - ++pAdapter->hdd_stats.hddTxRxStats.txXmitDroppedAC[ac]; - kfree_skb(skb); - return NETDEV_TX_OK; - } - } - else - { - STAId = pHddStaCtx->conn_info.staId[0]; - } - - //user priority from IP header, which is already extracted and set from - //select_queue call back function - up = skb->priority; - - ++pAdapter->hdd_stats.hddTxRxStats.txXmitClassifiedAC[ac]; - -#ifdef HDD_WMM_DEBUG - VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_FATAL, - "%s: Classified as ac %d up %d", __func__, ac, up); -#endif // HDD_WMM_DEBUG - - spin_lock(&pAdapter->wmm_tx_queue[ac].lock); - /*CR 463598,384996*/ - /*For every increment of 10 pkts in the queue, we inform TL about pending pkts. - *We check for +1 in the logic,to take care of Zero count which - *occurs very frequently in low traffic cases */ - if((pAdapter->wmm_tx_queue[ac].count + 1) % 10 == 0) - { - /* Use the following debug statement during Engineering Debugging.There are chance that this will lead to a Watchdog Bark - * if it is in the mainline code and if the log level is enabled by someone for debugging - VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_INFO,"%s:Queue is Filling up.Inform TL again about pending packets", __func__);*/ - - status = WLANTL_STAPktPending( (WLAN_HDD_GET_CTX(pAdapter))->pvosContext, - STAId, ac - ); - if ( !VOS_IS_STATUS_SUCCESS( status ) ) - { - VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR, - "%s: WLANTL_STAPktPending() returned error code %d", - __func__, status); - ++pAdapter->stats.tx_dropped; - ++pAdapter->hdd_stats.hddTxRxStats.txXmitDropped; - ++pAdapter->hdd_stats.hddTxRxStats.txXmitDroppedAC[ac]; - kfree_skb(skb); - spin_unlock(&pAdapter->wmm_tx_queue[ac].lock); - return NETDEV_TX_OK; - } - } - //If we have already reached the max queue size, disable the TX queue - if ( pAdapter->wmm_tx_queue[ac].count == pAdapter->wmm_tx_queue[ac].max_size) - { - ++pAdapter->hdd_stats.hddTxRxStats.txXmitBackPressured; - ++pAdapter->hdd_stats.hddTxRxStats.txXmitBackPressuredAC[ac]; - netif_tx_stop_queue(netdev_get_tx_queue(dev, skb_get_queue_mapping(skb))); - pAdapter->isTxSuspended[ac] = VOS_TRUE; - txSuspended = VOS_TRUE; - } - - /* If 3/4th of the max queue size is used then enable the flag. - * This flag indicates to place the DHCP packets in VOICE AC queue.*/ - if (WLANTL_AC_BE == ac) - { - if (pAdapter->wmm_tx_queue[ac].count >= HDD_TX_QUEUE_LOW_WATER_MARK) - { - pAdapter->isVosLowResource = VOS_TRUE; - } - else - { - pAdapter->isVosLowResource = VOS_FALSE; - } - } - - spin_unlock(&pAdapter->wmm_tx_queue[ac].lock); - if (VOS_TRUE == txSuspended) - { - VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_INFO, - "%s: TX queue full for AC=%d Disable OS TX queue", - __func__, ac ); - return NETDEV_TX_BUSY; - } - - //Use the skb->cb field to hold the list node information - pktNode = (skb_list_node_t *)&skb->cb; - - //Stick the OS packet inside this node. - pktNode->skb = skb; - - //Stick the User Priority inside this node - pktNode->userPriority = up; - - - INIT_LIST_HEAD(&pktNode->anchor); - - //Insert the OS packet into the appropriate AC queue - spin_lock(&pAdapter->wmm_tx_queue[ac].lock); - status = hdd_list_insert_back_size( &pAdapter->wmm_tx_queue[ac], &pktNode->anchor, &pktListSize ); - spin_unlock(&pAdapter->wmm_tx_queue[ac].lock); - - if ( !VOS_IS_STATUS_SUCCESS( status ) ) - { - VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_WARN,"%s:Insert Tx queue failed. Pkt dropped", __func__); - ++pAdapter->hdd_stats.hddTxRxStats.txXmitDropped; - ++pAdapter->hdd_stats.hddTxRxStats.txXmitDroppedAC[ac]; - ++pAdapter->stats.tx_dropped; - kfree_skb(skb); - return NETDEV_TX_OK; - } - - ++pAdapter->hdd_stats.hddTxRxStats.txXmitQueued; - ++pAdapter->hdd_stats.hddTxRxStats.txXmitQueuedAC[ac]; - ++pAdapter->hdd_stats.hddTxRxStats.pkt_tx_count; - - if (HDD_PSB_CHANGED == pAdapter->psbChanged) - { - /* Function which will determine acquire admittance for a - * WMM AC is required or not based on psb configuration done - * in the framework - */ - hdd_wmm_acquire_access_required(pAdapter, ac); - } - - //Make sure we have access to this access category - if (((pAdapter->psbChanged & (1 << ac)) && likely(pAdapter->hddWmmStatus.wmmAcStatus[ac].wmmAcAccessAllowed)) || - (pHddStaCtx->conn_info.uIsAuthenticated == VOS_FALSE)) - { - granted = VOS_TRUE; - } - else - { - status = hdd_wmm_acquire_access( pAdapter, ac, &granted ); - pAdapter->psbChanged |= (1 << ac); - } - if ( granted && ( pktListSize == 1 )) - { - //Let TL know we have a packet to send for this AC - //VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR,"%s:Indicating Packet to TL", __func__); - status = WLANTL_STAPktPending( - (WLAN_HDD_GET_CTX(pAdapter))->pvosContext, - STAId, ac ); - if ( !VOS_IS_STATUS_SUCCESS( status ) ) - { - VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_WARN, "%s: Failed to signal TL for AC=%d", __func__, ac ); - - //Remove the packet from queue. It must be at the back of the queue, as TX thread cannot preempt us in the middle - //as we are in a soft irq context. Also it must be the same packet that we just allocated. - spin_lock(&pAdapter->wmm_tx_queue[ac].lock); - status = hdd_list_remove_back( &pAdapter->wmm_tx_queue[ac], &anchor ); - spin_unlock(&pAdapter->wmm_tx_queue[ac].lock); - ++pAdapter->stats.tx_dropped; - ++pAdapter->hdd_stats.hddTxRxStats.txXmitDropped; - ++pAdapter->hdd_stats.hddTxRxStats.txXmitDroppedAC[ac]; - kfree_skb(skb); - return NETDEV_TX_OK; - } - } - - dev->trans_start = jiffies; - - return NETDEV_TX_OK; -} -#else #ifdef QCA_LL_TX_FLOW_CT /**============================================================================ @brief hdd_tx_resume_timer_expired_handler() - Resume OS TX Q timer expired @@ -1136,7 +905,6 @@ drop_pkt: kfree_skb(skb); return NETDEV_TX_OK; } -#endif /* QCA_WIFI_2_0 */ /**============================================================================ @brief hdd_Ibss_GetStaId() - Get the StationID using the Peer Mac address @@ -1858,292 +1626,6 @@ VOS_STATUS hdd_tx_low_resource_cbk( vos_pkt_t *pVosPacket, } -#ifndef QCA_WIFI_2_0 -/**============================================================================ - @brief hdd_rx_packet_cbk() - Receive callback registered with TL. - TL will call this to notify the HDD when one or more packets were - received for a registered STA. - - @param vosContext : [in] pointer to VOS context - @param pVosPacketChain : [in] pointer to VOS packet chain - @param staId : [in] Station Id - @param pRxMetaInfo : [in] pointer to meta info for the received pkt(s) - - @return : VOS_STATUS_E_FAILURE if any errors encountered, - : VOS_STATUS_SUCCESS otherwise - ===========================================================================*/ -VOS_STATUS hdd_rx_packet_cbk( v_VOID_t *vosContext, - vos_pkt_t *pVosPacketChain, - v_U8_t staId, - WLANTL_RxMetaInfoType* pRxMetaInfo ) -{ - hdd_adapter_t *pAdapter = NULL; - hdd_context_t *pHddCtx = NULL; - VOS_STATUS status = VOS_STATUS_E_FAILURE; - int rxstat; - struct sk_buff *skb = NULL; - vos_pkt_t* pVosPacket; - vos_pkt_t* pNextVosPacket; - - //Sanity check on inputs - if ( ( NULL == vosContext ) || - ( NULL == pVosPacketChain ) || - ( NULL == pRxMetaInfo ) ) - { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: Null params being passed", __func__); - return VOS_STATUS_E_FAILURE; - } - - pHddCtx = (hdd_context_t *)vos_get_context( VOS_MODULE_ID_HDD, vosContext ); - if ( NULL == pHddCtx ) - { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: HDD adapter context is Null", __func__); - return VOS_STATUS_E_FAILURE; - } - - pAdapter = pHddCtx->sta_to_adapter[staId]; - if( NULL == pAdapter ) - { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: pAdapter is Null for staId %u", - __func__, staId); - return VOS_STATUS_E_FAILURE; - } - - ++pAdapter->hdd_stats.hddTxRxStats.rxChains; - - // walk the chain until all are processed - pVosPacket = pVosPacketChain; - do - { - // get the pointer to the next packet in the chain - // (but don't unlink the packet since we free the entire chain later) - status = vos_pkt_walk_packet_chain( pVosPacket, &pNextVosPacket, VOS_FALSE); - - // both "success" and "empty" are acceptable results - if (!((status == VOS_STATUS_SUCCESS) || (status == VOS_STATUS_E_EMPTY))) - { - ++pAdapter->hdd_stats.hddTxRxStats.rxDropped; - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: Failure walking packet chain", __func__); - return VOS_STATUS_E_FAILURE; - } - - // Extract the OS packet (skb). - // Tell VOS to detach the OS packet from the VOS packet - status = vos_pkt_get_os_packet( pVosPacket, (v_VOID_t **)&skb, VOS_TRUE ); - if(!VOS_IS_STATUS_SUCCESS( status )) - { - ++pAdapter->hdd_stats.hddTxRxStats.rxDropped; - VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR, - "%s: Failure extracting skb from vos pkt", __func__); - return VOS_STATUS_E_FAILURE; - } - - if (WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic) - { - VOS_TRACE(VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_FATAL, - "Magic cookie(%x) for adapter sanity verification is invalid", pAdapter->magic); - return eHAL_STATUS_FAILURE; - } - -#ifdef FEATURE_WLAN_TDLS - if ((eTDLS_SUPPORT_ENABLED == pHddCtx->tdls_mode) && - 0 != pHddCtx->connected_peer_count) - { - hdd_station_ctx_t *pHddStaCtx = &pAdapter->sessionCtx.station; - u8 mac[6]; - - wlan_hdd_tdls_extract_sa(skb, mac); - - if (vos_is_macaddr_group((v_MACADDR_t *)mac)) { - VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_INFO_MED, - "rx broadcast packet, not adding to peer list"); - } else if (memcmp(pHddStaCtx->conn_info.bssId, - mac, 6) != 0) { - hddTdlsPeer_t *curr_peer; - VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_INFO_MED, - "rx extract mac:" MAC_ADDRESS_STR, - MAC_ADDR_ARRAY(mac) ); - curr_peer = wlan_hdd_tdls_find_peer(pAdapter, mac, TRUE); - if ((NULL != curr_peer) && (eTDLS_LINK_CONNECTED == curr_peer->link_status) - && (TRUE == pRxMetaInfo->isStaTdls)) - { - wlan_hdd_tdls_increment_pkt_count(pAdapter, mac, 0); - VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_INFO,"rssi is %d", pRxMetaInfo->rssiAvg); - wlan_hdd_tdls_set_rssi (pAdapter, mac, pRxMetaInfo->rssiAvg); - } - } else { - VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_INFO_MED, - "rx packet sa is bssid, not adding to peer list"); - } - } -#endif - - skb->dev = pAdapter->dev; - skb->protocol = eth_type_trans(skb, skb->dev); - skb->ip_summed = CHECKSUM_NONE; - ++pAdapter->hdd_stats.hddTxRxStats.rxPackets; - ++pAdapter->stats.rx_packets; - pAdapter->stats.rx_bytes += skb->len; -#ifdef WLAN_FEATURE_HOLD_RX_WAKELOCK - vos_wake_lock_timeout_acquire(&pHddCtx->rx_wake_lock, - HDD_WAKE_LOCK_DURATION); -#endif - rxstat = netif_rx_ni(skb); - if (NET_RX_SUCCESS == rxstat) - { - ++pAdapter->hdd_stats.hddTxRxStats.rxDelivered; - ++pAdapter->hdd_stats.hddTxRxStats.pkt_rx_count; - } - else - { - ++pAdapter->hdd_stats.hddTxRxStats.rxRefused; - } - // now process the next packet in the chain - pVosPacket = pNextVosPacket; - - } while (pVosPacket); - - //Return the entire VOS packet chain to the resource pool - status = vos_pkt_return_packet( pVosPacketChain ); - if(!VOS_IS_STATUS_SUCCESS( status )) - { - VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR,"%s: Failure returning vos pkt", __func__); - } - - pAdapter->dev->last_rx = jiffies; - - return status; -} -/**============================================================================ - @brief hdd_tx_rx_pkt_cnt_stat_timer_handler() - - Enable/Disable split scan based on TX and RX traffic. - @param HddContext : [in] pointer to Hdd context - @return : None - ===========================================================================*/ -void hdd_tx_rx_pkt_cnt_stat_timer_handler( void *phddctx) -{ - hdd_adapter_list_node_t *pAdapterNode = NULL, *pNext = NULL; - hdd_adapter_t *pAdapter = NULL; - hdd_station_ctx_t *pHddStaCtx = NULL; - hdd_context_t *pHddCtx = (hdd_context_t *)phddctx; - hdd_config_t *cfg_param = pHddCtx->cfg_ini; - tpAniSirGlobal pMac = PMAC_STRUCT(phddctx->hHal); - VOS_STATUS status; - v_U8_t staId = 0; - v_U8_t fconnected = 0; - - if (NULL == phddctx) - { - VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR, - FL("phddctx is NULL")); - VOS_ASSERT(0); - return; - } - - if (!cfg_param->dynSplitscan) - { - VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_INFO, - "%s: Error : Dynamic split scan is not Enabled : %d", - __func__, pHddCtx->cfg_ini->dynSplitscan); - return; - } - - status = hdd_get_front_adapter ( pHddCtx, &pAdapterNode ); - while ( NULL != pAdapterNode && VOS_STATUS_SUCCESS == status ) - { - pAdapter = pAdapterNode->pAdapter; - - if ( pAdapter ) - { - VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_INFO, - "%s: Adapter with device mode %d exists", - __func__, pAdapter->device_mode); - - if ((WLAN_HDD_INFRA_STATION == pAdapter->device_mode) || - (WLAN_HDD_P2P_CLIENT == pAdapter->device_mode)) - { - pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); - if ((eConnectionState_Associated == - pHddStaCtx->conn_info.connState) && - (VOS_TRUE == pHddStaCtx->conn_info.uIsAuthenticated)) - { - fconnected = TRUE; - } - } - else if ((WLAN_HDD_SOFTAP == pAdapter->device_mode) || - (WLAN_HDD_P2P_GO == pAdapter->device_mode)) - { - for (staId = 0; staId < WLAN_MAX_STA_COUNT; staId++) - { - if ((pAdapter->aStaInfo[staId].isUsed) && - (WLANTL_STA_AUTHENTICATED == - pAdapter->aStaInfo[staId].tlSTAState)) - { - fconnected = TRUE; - } - } - } - if ( fconnected ) - { - VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_INFO, - "%s: One of the interface is connected check for scan", - __func__); - VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_INFO, - "%s: pkt_tx_count: %d, pkt_rx_count: %d", __func__, - pAdapter->hdd_stats.hddTxRxStats.pkt_tx_count, - pAdapter->hdd_stats.hddTxRxStats.pkt_rx_count); - - vos_timer_start(&pHddCtx->tx_rx_trafficTmr, - cfg_param->trafficMntrTmrForSplitScan); - //Check for the previous statistics count - if ((pAdapter->hdd_stats.hddTxRxStats.pkt_tx_count > - cfg_param->txRxThresholdForSplitScan) || - (pAdapter->hdd_stats.hddTxRxStats.pkt_rx_count > - cfg_param->txRxThresholdForSplitScan) || - pMac->fMiracastSessionPresent) - { - pAdapter->hdd_stats.hddTxRxStats.pkt_tx_count = 0; - pAdapter->hdd_stats.hddTxRxStats.pkt_rx_count = 0; - - if (!pHddCtx->issplitscan_enabled) - { - pHddCtx->issplitscan_enabled = TRUE; - sme_enable_disable_split_scan( - WLAN_HDD_GET_HAL_CTX(pAdapter), - cfg_param->nNumStaChanCombinedConc, - cfg_param->nNumP2PChanCombinedConc); - } - return; - } - else - { - pAdapter->hdd_stats.hddTxRxStats.pkt_tx_count = 0; - pAdapter->hdd_stats.hddTxRxStats.pkt_rx_count = 0; - } - fconnected = FALSE; - } - } - status = hdd_get_next_adapter( pHddCtx, pAdapterNode, &pNext); - pAdapterNode = pNext; - } - - if (pHddCtx->issplitscan_enabled) - { - VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR, - "%s: Disable split scan", __func__); - pHddCtx->issplitscan_enabled = FALSE; - sme_enable_disable_split_scan( - pHddCtx->hHal, - SME_DISABLE_SPLIT_SCAN, - SME_DISABLE_SPLIT_SCAN); - } - return; -} -#else /**============================================================================ @brief hdd_rx_packet_cbk() - Receive callback registered with TL. @@ -2212,35 +1694,6 @@ VOS_STATUS hdd_rx_packet_cbk(v_VOID_t *vosContext, } #ifdef FEATURE_WLAN_TDLS -#ifndef QCA_WIFI_2_0 - if ((eTDLS_SUPPORT_ENABLED == pHddCtx->tdls_mode) && - 0 != pHddCtx->connected_peer_count) - { - u8 mac[6]; - - wlan_hdd_tdls_extract_sa(skb, mac); - - if (vos_is_macaddr_group((v_MACADDR_t *)mac)) { - VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_INFO_MED, - "rx broadcast packet, not adding to peer list"); - } else if (memcmp(pHddStaCtx->conn_info.bssId, - mac, 6) != 0) { - hddTdlsPeer_t *curr_peer; - VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_INFO_MED, - "rx extract mac:" MAC_ADDRESS_STR, - MAC_ADDR_ARRAY(mac) ); - curr_peer = wlan_hdd_tdls_find_peer(pAdapter, mac, TRUE); - if ((NULL != curr_peer) && (eTDLS_LINK_CONNECTED == curr_peer->link_status)) - { - wlan_hdd_tdls_increment_pkt_count(pAdapter, mac, 0); - /* TODO: Update the rssi by using wlan_hdd_tdls_set_rssi() */ - } - } else { - VOS_TRACE( VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_INFO_MED, - "rx packet sa is bssid, not adding to peer list"); - } - } -#endif /* QCA_WIFI_2_0 */ #endif #ifdef QCA_PKT_PROTO_TRACE @@ -2332,4 +1785,3 @@ VOS_STATUS hdd_rx_mul_packet_cbk(v_VOID_t *vosContext, } #endif /* IPA_OFFLOAD */ -#endif /* QCA_WIFI_2_0 */ diff --git a/CORE/HDD/src/wlan_hdd_wext.c b/CORE/HDD/src/wlan_hdd_wext.c index 5ca5ef149964..e8972182c8b0 100644 --- a/CORE/HDD/src/wlan_hdd_wext.c +++ b/CORE/HDD/src/wlan_hdd_wext.c @@ -73,12 +73,10 @@ #include "wlan_hdd_tdls.h" #endif -#ifdef QCA_WIFI_2_0 #include "ieee80211_common.h" #include "ol_if_athvar.h" #include "dbglog_host.h" #include "wma.h" -#endif #ifdef CONFIG_HAS_EARLYSUSPEND #include @@ -255,7 +253,6 @@ static const hdd_freq_chan_map_t freq_chan_map[] = { {2412, 1}, {2417, 2}, #define WE_GET_WDI_DBG 7 #define WE_GET_SAP_AUTO_CHANNEL_SELECTION 8 #define WE_GET_CONCURRENCY_MODE 9 -#ifdef QCA_WIFI_2_0 #define WE_GET_NSS 11 #define WE_GET_LDPC 12 #define WE_GET_TX_STBC 13 @@ -303,7 +300,6 @@ static const hdd_freq_chan_map_t freq_chan_map[] = { {2412, 1}, {2417, 2}, #define WE_GET_GTX_MINTPC 53 #define WE_GET_GTX_BWMASK 54 #define WE_GET_SCAN_BAND_PREFERENCE 55 -#endif /* Private ioctls and their sub-ioctls */ #define WLAN_PRIV_SET_INT_GET_INT (SIOCIWFIRSTPRIV + 2) @@ -342,12 +338,10 @@ static const hdd_freq_chan_map_t freq_chan_map[] = { {2412, 1}, {2417, 2}, #define WE_GET_11W_INFO 9 #endif #define WE_GET_STATES 10 -#ifdef QCA_WIFI_2_0 #define WE_GET_PHYMODE 12 #ifdef FEATURE_OEM_DATA_SUPPORT #define WE_GET_OEM_DATA_CAP 13 #endif -#endif /* Private ioctls and their sub-ioctls */ #define WLAN_PRIV_SET_NONE_GET_NONE (SIOCIWFIRSTPRIV + 6) @@ -362,7 +356,6 @@ static const hdd_freq_chan_map_t freq_chan_map[] = { {2412, 1}, {2417, 2}, #define WE_DISPLAY_DXE_SNAP_SHOT 7 #define WE_SET_REASSOC_TRIGGER 8 #define WE_DISPLAY_DATAPATH_SNAP_SHOT 9 -#ifdef QCA_WIFI_2_0 #define WE_DUMP_AGC_START 11 #define WE_DUMP_AGC 12 #define WE_DUMP_CHANINFO_START 13 @@ -371,7 +364,6 @@ static const hdd_freq_chan_map_t freq_chan_map[] = { {2412, 1}, {2417, 2}, #ifdef CONFIG_ATH_PCIE_ACCESS_DEBUG #define WE_DUMP_PCIE_LOG 16 #endif -#endif #define WE_GET_RECOVERY_STAT 17 /* Private ioctls and their sub-ioctls */ @@ -392,12 +384,8 @@ static const hdd_freq_chan_map_t freq_chan_map[] = { {2412, 1}, {2417, 2}, #ifdef FEATURE_WLAN_TDLS #undef MAX_VAR_ARGS -#ifdef QCA_WIFI_2_0 #define MAX_VAR_ARGS 11 #else -#define MAX_VAR_ARGS 10 -#endif -#else #define MAX_VAR_ARGS 7 #endif @@ -674,13 +662,7 @@ void hdd_wlan_get_version(hdd_adapter_t *pAdapter, union iwreq_data *wrqu, const char *pSWversion; const char *pHWversion; v_U32_t MSPId = 0, mSPId = 0, SIId = 0, CRMId = 0; -#ifndef QCA_WIFI_2_0 - VOS_STATUS status; - tSirVersionString wcnss_HW_version; - tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter); -#endif -#ifdef QCA_WIFI_2_0 hdd_context_t *pHddContext; int i = 0; @@ -710,29 +692,6 @@ void hdd_wlan_get_version(hdd_adapter_t *pAdapter, union iwreq_data *wrqu, if (i == ARRAY_SIZE(qwlan_hw_list)) pHWversion = "Unknown"; -#else - status = sme_GetWcnssSoftwareVersion(hHal, wcnss_SW_version, - sizeof(wcnss_SW_version)); - if (VOS_IS_STATUS_SUCCESS(status)) - { - pSWversion = wcnss_SW_version; - } - else - { - pSWversion = "Unknown"; - } - - status = sme_GetWcnssHardwareVersion(hHal, wcnss_HW_version, - sizeof(wcnss_HW_version)); - if (VOS_IS_STATUS_SUCCESS(status)) - { - pHWversion = wcnss_HW_version; - } - else - { - pHWversion = "Unknown"; - } -#endif pHddContext->target_hw_name = pHWversion; if (wrqu) { @@ -4335,7 +4294,6 @@ static int iw_set_mlme(struct net_device *dev, } -#ifdef QCA_WIFI_2_0 int process_wma_set_command(int sessid, int paramid, int sval, int vpdev) { @@ -4366,9 +4324,7 @@ int process_wma_set_command(int sessid, int paramid, } return ret; } -#endif -#ifdef QCA_WIFI_2_0 static int wlan_hdd_update_phymode(struct net_device *net, tHalHandle hal, int new_phymode, hdd_context_t *phddctx) @@ -4555,7 +4511,6 @@ static int wlan_hdd_update_phymode(struct net_device *net, tHalHandle hal, return 0; } -#endif /* set param sub-ioctls */ static int iw_setint_getnone(struct net_device *dev, struct iw_request_info *info, @@ -4927,16 +4882,10 @@ static int iw_setint_getnone(struct net_device *dev, struct iw_request_info *inf { hddLog(VOS_TRACE_LEVEL_INFO, "Set Thermal Mitigation Level %d", set_value); -#ifdef QCA_WIFI_ISOC - hdd_context_t *hddCtxt = WLAN_HDD_GET_CTX(pAdapter); - hddDevTmLevelChangedHandler(hddCtxt->parent_dev, set_value); -#else (void)sme_SetThermalLevel(hHal, set_value); -#endif break; } -#ifdef QCA_WIFI_2_0 case WE_SET_PHYMODE: { hdd_context_t *phddctx = WLAN_HDD_GET_CTX(pAdapter); @@ -5941,7 +5890,6 @@ static int iw_setint_getnone(struct net_device *dev, struct iw_request_info *inf set_value, GEN_CMD); break; } -#endif #endif default: { @@ -6083,10 +6031,8 @@ static int iw_setnone_getint(struct net_device *dev, struct iw_request_info *inf tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter); int *value = (int *)extra; int ret = 0; /* success */ -#ifdef QCA_WIFI_2_0 hdd_context_t *wmahddCtxt = WLAN_HDD_GET_CTX(pAdapter); void *wmapvosContext = wmahddCtxt->pvosContext; -#endif tSmeConfigParams smeConfig; if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress) @@ -6160,7 +6106,6 @@ static int iw_setnone_getint(struct net_device *dev, struct iw_request_info *inf break; } -#ifdef QCA_WIFI_2_0 case WE_GET_NSS: { hddLog(LOG1, "GET WMI_VDEV_PARAM_NSS"); @@ -6618,7 +6563,6 @@ static int iw_setnone_getint(struct net_device *dev, struct iw_request_info *inf "scanBandPreference = %d", *value); break; } -#endif default: { @@ -7091,7 +7035,6 @@ static int iw_get_char_setnone(struct net_device *dev, struct iw_request_info *i break; } #endif -#ifdef QCA_WIFI_2_0 case WE_GET_PHYMODE: { v_BOOL_t ch_bond24 = VOS_FALSE, ch_bond5g = VOS_FALSE; @@ -7188,7 +7131,6 @@ static int iw_get_char_setnone(struct net_device *dev, struct iw_request_info *i return iw_get_oem_data_cap(dev, info, wrqu, extra); } #endif /* FEATURE_OEM_DATA_SUPPORT */ -#endif default: { hddLog(LOGE, "%s: Invalid IOCTL command %d", __func__, sub_cmd ); @@ -7381,7 +7323,6 @@ static int iw_setnone_getnone(struct net_device *dev, struct iw_request_info *in return 0; } -#ifdef QCA_WIFI_2_0 case WE_DUMP_AGC_START: { hddLog(LOG1, "WE_DUMP_AGC_START"); @@ -7432,7 +7373,6 @@ static int iw_setnone_getnone(struct net_device *dev, struct iw_request_info *in 0, GEN_CMD); break; } -#endif #endif default: { @@ -7647,9 +7587,7 @@ static int __iw_set_var_ints_getnone(struct net_device *dev, tdlsParams.rssi_hysteresis = apps_args[7]; tdlsParams.rssi_trigger_threshold = apps_args[8]; tdlsParams.rssi_teardown_threshold = apps_args[9]; -#ifdef QCA_WIFI_2_0 tdlsParams.rssi_delta = apps_args[10]; -#endif wlan_hdd_tdls_set_params(dev, &tdlsParams); } @@ -8617,7 +8555,6 @@ void wlan_hdd_set_mc_addr_list(hdd_adapter_t *pAdapter, v_U8_t set) */ if (pAdapter->mc_addr_list.isFilterApplied) { -#ifdef QCA_WIFI_2_0 pMulticastAddrs->ulMulticastAddrCnt = pAdapter->mc_addr_list.mc_cnt; for (i = 0; i < pAdapter->mc_addr_list.mc_cnt; i++) { @@ -8625,9 +8562,6 @@ void wlan_hdd_set_mc_addr_list(hdd_adapter_t *pAdapter, v_U8_t set) pAdapter->mc_addr_list.addr[i], sizeof(pAdapter->mc_addr_list.addr[i])); } -#else - pMulticastAddrs->ulMulticastAddrCnt = 0; -#endif sme_8023MulticastList(hHal, pAdapter->sessionId, pMulticastAddrs); } @@ -9794,7 +9728,6 @@ static const struct iw_priv_args we_private_args[] = { 0, "setTmLevel" }, -#ifdef QCA_WIFI_2_0 { WE_SET_PHYMODE, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, @@ -10127,7 +10060,6 @@ static const struct iw_priv_args we_private_args[] = { { WE_SET_FW_CRASH_INJECT, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "crash_inject" }, -#endif #endif { WLAN_PRIV_SET_NONE_GET_INT, @@ -10176,7 +10108,6 @@ static const struct iw_priv_args we_private_args[] = { IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "getconcurrency" }, -#ifdef QCA_WIFI_2_0 { WE_GET_NSS, 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, @@ -10409,7 +10340,6 @@ static const struct iw_priv_args we_private_args[] = { 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_scan_pref"}, -#endif /* handlers for main ioctl */ { WLAN_PRIV_SET_CHAR_GET_NONE, @@ -10525,7 +10455,6 @@ static const struct iw_priv_args we_private_args[] = { IW_PRIV_TYPE_CHAR| WE_MAX_STR_LEN, "getPMFInfo" }, #endif -#ifdef QCA_WIFI_2_0 { WE_GET_PHYMODE, 0, IW_PRIV_TYPE_CHAR| WE_MAX_STR_LEN, @@ -10536,7 +10465,6 @@ static const struct iw_priv_args we_private_args[] = { IW_PRIV_TYPE_CHAR| WE_MAX_STR_LEN, "getOemDataCap" }, #endif /* FEATURE_OEM_DATA_SUPPORT */ -#endif /* handlers for main ioctl */ { WLAN_PRIV_SET_NONE_GET_NONE, @@ -10588,7 +10516,6 @@ static const struct iw_priv_args we_private_args[] = { 0, 0, "reassoc" }, -#ifdef QCA_WIFI_2_0 { WE_DUMP_AGC_START, 0, 0, @@ -10618,7 +10545,6 @@ static const struct iw_priv_args we_private_args[] = { 0, 0, "dump_pcie_log" }, -#endif #endif /* handlers for main ioctl */ { WLAN_PRIV_SET_VAR_INT_GET_NONE, diff --git a/CORE/HDD/src/wlan_hdd_wmm.c b/CORE/HDD/src/wlan_hdd_wmm.c index 9ca53a7d3aa5..728d2e0c8308 100644 --- a/CORE/HDD/src/wlan_hdd_wmm.c +++ b/CORE/HDD/src/wlan_hdd_wmm.c @@ -210,13 +210,9 @@ static void hdd_wmm_enable_tl_uapsd (hdd_wmm_qos_context_t* pQosContext) pAc->wmmAcTspecInfo.ts_info.up, service_interval, suspension_interval, -#ifdef QCA_WIFI_2_0 direction, psb, pAdapter->sessionId); -#else - direction); -#endif if ( !VOS_IS_STATUS_SUCCESS( status ) ) { @@ -266,12 +262,8 @@ static void hdd_wmm_disable_tl_uapsd (hdd_wmm_qos_context_t* pQosContext) { status = WLANTL_DisableUAPSDForAC((WLAN_HDD_GET_CTX(pAdapter))->pvosContext, (WLAN_HDD_GET_STATION_CTX_PTR(pAdapter))->conn_info.staId[0], -#ifdef QCA_WIFI_2_0 acType, pAdapter->sessionId); -#else - acType); -#endif if ( !VOS_IS_STATUS_SUCCESS( status ) ) { @@ -388,60 +380,6 @@ static void hdd_wmm_notify_app (hdd_wmm_qos_context_t* pQosContext) } -#ifndef QCA_WIFI_2_0 -/** - @brief hdd_wmm_is_access_allowed() - function which determines if access - is allowed for the given AC. this is designed to be called during SME - callback processing since that is when access can be granted or removed - - @param pAdapter : [in] pointer to adapter context - @param pAc : [in] pointer to the per-AC status - - @return : VOS_TRUE - access is allowed - : VOS_FALSE - access is not allowed - None -*/ -static v_BOOL_t hdd_wmm_is_access_allowed(hdd_adapter_t* pAdapter, - hdd_wmm_ac_status_t* pAc) -{ - // if we don't want QoS or the AP doesn't support QoS - // or we don't want to do implicit QoS - // or if AP doesn't require admission for this AC - // then we have access - if (!hdd_wmm_is_active(pAdapter) || - !(WLAN_HDD_GET_CTX(pAdapter))->cfg_ini->bImplicitQosEnabled || - !pAc->wmmAcAccessRequired) - { - return VOS_TRUE; - } - - // if implicit QoS has already completed, successfully or not, - // then access is allowed - if (pAc->wmmAcAccessGranted || pAc->wmmAcAccessFailed) - { - return VOS_TRUE; - } - - // admission is required and implicit QoS hasn't completed - // however explicit QoS may have completed and we'll have - // a Tspec - // if we don't have a Tspec then access is not allowed - if (!pAc->wmmAcTspecValid) - { - return VOS_FALSE; - } - - // we have a Tspec -- does it allow upstream or bidirectional traffic? - // if it only allows downstream traffic then access is not allowed - if (pAc->wmmAcTspecInfo.ts_info.direction == SME_QOS_WMM_TS_DIR_DOWNLINK) - { - return VOS_FALSE; - } - - // we meet all of the criteria for access - return VOS_TRUE; -} -#endif /* QCA_WIFI_2_0 */ #ifdef FEATURE_WLAN_ESE /** @@ -1219,13 +1157,6 @@ static eHalStatus hdd_wmm_sme_callback (tHalHandle hHal, VOS_ASSERT(0); } -#ifndef QCA_WIFI_2_0 - // our access to the particular access category may have changed. - // some of the implicit QoS cases above may have already set this - // prior to invoking TL (so that we will properly service the - // Tx queues) but let's consistently handle all cases here - pAc->wmmAcAccessAllowed = hdd_wmm_is_access_allowed(pAdapter, pAc); -#else // if Tspec only allows downstream traffic then access is not allowed if (pAc->wmmAcTspecValid && (pAc->wmmAcTspecInfo.ts_info.direction == SME_QOS_WMM_TS_DIR_DOWNLINK)) { @@ -1238,7 +1169,6 @@ static eHalStatus hdd_wmm_sme_callback (tHalHandle hHal, !pAc->wmmAcAccessRequired) { pAc->wmmAcAccessAllowed = VOS_TRUE; } -#endif VOS_TRACE(VOS_MODULE_ID_HDD, WMM_TRACE_LEVEL_INFO, "%s: complete, access for TL AC %d is%sallowed", @@ -2191,13 +2121,9 @@ VOS_STATUS hdd_wmm_assoc( hdd_adapter_t* pAdapter, 7, (WLAN_HDD_GET_CTX(pAdapter))->cfg_ini->InfraUapsdVoSrvIntv, (WLAN_HDD_GET_CTX(pAdapter))->cfg_ini->InfraUapsdVoSuspIntv, -#ifdef QCA_WIFI_2_0 WLANTL_BI_DIR, 1, pAdapter->sessionId); -#else - WLANTL_BI_DIR); -#endif VOS_ASSERT( VOS_IS_STATUS_SUCCESS( status )); } @@ -2211,13 +2137,9 @@ VOS_STATUS hdd_wmm_assoc( hdd_adapter_t* pAdapter, 5, (WLAN_HDD_GET_CTX(pAdapter))->cfg_ini->InfraUapsdViSrvIntv, (WLAN_HDD_GET_CTX(pAdapter))->cfg_ini->InfraUapsdViSuspIntv, -#ifdef QCA_WIFI_2_0 WLANTL_BI_DIR, 1, pAdapter->sessionId); -#else - WLANTL_BI_DIR); -#endif VOS_ASSERT( VOS_IS_STATUS_SUCCESS( status )); } @@ -2231,13 +2153,9 @@ VOS_STATUS hdd_wmm_assoc( hdd_adapter_t* pAdapter, 2, (WLAN_HDD_GET_CTX(pAdapter))->cfg_ini->InfraUapsdBkSrvIntv, (WLAN_HDD_GET_CTX(pAdapter))->cfg_ini->InfraUapsdBkSuspIntv, -#ifdef QCA_WIFI_2_0 WLANTL_BI_DIR, 1, pAdapter->sessionId); -#else - WLANTL_BI_DIR); -#endif VOS_ASSERT( VOS_IS_STATUS_SUCCESS( status )); } @@ -2251,13 +2169,9 @@ VOS_STATUS hdd_wmm_assoc( hdd_adapter_t* pAdapter, 3, (WLAN_HDD_GET_CTX(pAdapter))->cfg_ini->InfraUapsdBeSrvIntv, (WLAN_HDD_GET_CTX(pAdapter))->cfg_ini->InfraUapsdBeSuspIntv, -#ifdef QCA_WIFI_2_0 WLANTL_BI_DIR, 1, pAdapter->sessionId); -#else - WLANTL_BI_DIR); -#endif VOS_ASSERT( VOS_IS_STATUS_SUCCESS( status )); } -- cgit v1.2.3 From 90ba82f2784530a944c3cc84d494c349107c5730 Mon Sep 17 00:00:00 2001 From: Naveen Rawat Date: Fri, 25 Jul 2014 06:48:52 -0700 Subject: qcacld: Fix for continuous Found 0 BSS results Continuous Found 0 BSS is due to following two reasons: 1) Race condition between scan timeout in host vs timeout in firmware. If host timesout first, it clears scan info and then when firmware sends scan completion event (with or without timeout status), it might end up clearing up next scan event which was enqueued. 2) Too much roaming scans can sometime leads to frequent scan timeout. For race condition, host should send a abort command for timed out scan and cleanup the scan info in FW's response to abort scan command. Even in case of timeout host can still return results from lim scan cache. So return success for scan completion event with timed out status. Change-Id: I39deda0c5708b50ac00afa71abbaf49bfc0938e1 CRs-Fixed: 698471 --- CORE/SERVICES/WMA/wma.c | 43 +++++++++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c index ae3a2e60a028..ac3bbb576e2e 100644 --- a/CORE/SERVICES/WMA/wma.c +++ b/CORE/SERVICES/WMA/wma.c @@ -21171,7 +21171,8 @@ static int wma_scan_event_callback(WMA_HANDLE handle, u_int8_t *data, wma_handle->interfaces[vdev_id].scan_info.p2p_scan_type; scan_event->sessionId = vdev_id; - if (wmi_event->reason == WMI_SCAN_REASON_COMPLETED) + if (wmi_event->reason == WMI_SCAN_REASON_COMPLETED || + wmi_event->reason == WMI_SCAN_REASON_TIMEDOUT) scan_event->reasonCode = eSIR_SME_SUCCESS; else scan_event->reasonCode = eSIR_SME_SCAN_FAILED; @@ -21199,23 +21200,26 @@ static int wma_scan_event_callback(WMA_HANDLE handle, u_int8_t *data, break; } - if (wmi_event->event & WMI_SCAN_FINISH_EVENTS) { - if (wmi_event->scan_id == scan_id) - wma_reset_scan_info(wma_handle, vdev_id); - else - WMA_LOGE("Scan id not matched for SCAN COMPLETE event"); - } - /* Stop the scan completion timeout if the event is WMI_SCAN_EVENT_COMPLETED */ if (scan_event->event == (tSirScanEventType)WMI_SCAN_EVENT_COMPLETED) { WMA_LOGE(" scan complete - scan_id %x, vdev_id %x", wmi_event->scan_id, vdev_id); - vos_status = vos_timer_stop(&wma_handle->wma_scan_comp_timer); + /* + * first stop the timer then reset scan info, else there is a + * race condition between, timeout handler in host and reset + * operation here. because of that, sometime timeout handler + * triggers and scan ID mismatch messages is printed. + */ + vos_status = vos_timer_stop(&wma_handle->wma_scan_comp_timer); if (vos_status != VOS_STATUS_SUCCESS) { WMA_LOGE("Failed to stop the scan completion timeout"); vos_mem_free(scan_event); return -EPERM; } + if (wmi_event->scan_id == scan_id) + wma_reset_scan_info(wma_handle, vdev_id); + else + WMA_LOGE("Scan id not matched for SCAN COMPLETE event"); } wma_send_msg(wma_handle, WDA_RX_SCAN_EVENT, (void *) scan_event, 0) ; @@ -22221,16 +22225,19 @@ void wma_scan_completion_timeout(void *data) return; } - scan_event->event = WMI_SCAN_EVENT_COMPLETED; - scan_event->reasonCode = eSIR_SME_SCAN_FAILED; - scan_event->scanId = wma_handle->wma_scan_timer_info.scan_id; - scan_event->p2pScanType = wma_handle->interfaces[vdev_id].scan_info.p2p_scan_type; - scan_event->sessionId = vdev_id; - - /* Reset scan info in interfaces table */ - wma_reset_scan_info(wma_handle, vdev_id); + /* + * To avoid race condition between scan timeout in host and in firmware + * here we should just send abort scan to firmware and do cleanup after + * receiving event from firmware. Since at this moment there will be no + * outstanding scans, aborting should not cause any problem in firmware. + */ + if (wma_handle->interfaces[vdev_id].scan_info.scan_id != 0) { + tAbortScanParams abortScan; + abortScan.SessionId = vdev_id; + WMA_LOGW("%s: Sending abort for timed out scan", __func__); + wma_stop_scan(wma_handle, &abortScan); + } - wma_send_msg(wma_handle, WDA_RX_SCAN_EVENT, (void *) scan_event, 0) ; return; } -- cgit v1.2.3 From 64d4e6f4fc4670e84d576c3c99d73200d281147c Mon Sep 17 00:00:00 2001 From: Srinivas Girigowda Date: Wed, 23 Jul 2014 10:44:20 -0700 Subject: qcacld: Sessionize and fix LFR3.0 compile errors This change is to sessionize and fix the LFR3.0 compile errors Change-Id: Ib0365545bc9633b82640fb7915a4aafbf2af4bf4 CRs-Fixed: 698753 --- CORE/HDD/src/wlan_hdd_cfg.c | 2 +- CORE/HDD/src/wlan_hdd_main.c | 3 ++- CORE/MAC/src/pe/include/limFTDefs.h | 1 + CORE/MAC/src/pe/lim/limFT.c | 23 +++-------------------- CORE/SME/inc/csrNeighborRoam.h | 5 +++-- CORE/SME/inc/smeRrmInternal.h | 1 + CORE/SME/inc/sme_Api.h | 5 ++--- CORE/SME/src/csr/csrApiRoam.c | 6 +++--- CORE/SME/src/csr/csrApiScan.c | 3 ++- CORE/SME/src/csr/csrNeighborRoam.c | 23 ++++++++++++++--------- CORE/SME/src/sme_common/sme_Api.c | 3 ++- 11 files changed, 34 insertions(+), 41 deletions(-) diff --git a/CORE/HDD/src/wlan_hdd_cfg.c b/CORE/HDD/src/wlan_hdd_cfg.c index 3651cd7b6731..51f8808b7a0a 100644 --- a/CORE/HDD/src/wlan_hdd_cfg.c +++ b/CORE/HDD/src/wlan_hdd_cfg.c @@ -158,7 +158,7 @@ cbNotifySetEseFeatureEnabled(hdd_context_t *pHddCtx, unsigned long NotifyId) { /* At the point this routine is called, the value in the cfg_ini table has already been updated */ - sme_UpdateIsEseFeatureEnabled(pHddCtx->hHal, + sme_UpdateIsEseFeatureEnabled(pHddCtx->hHal, 0, pHddCtx->cfg_ini->isEseIniFeatureEnabled ); } #endif diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c index 50ea5d51dd0d..baf7c8f48c29 100755 --- a/CORE/HDD/src/wlan_hdd_main.c +++ b/CORE/HDD/src/wlan_hdd_main.c @@ -5043,7 +5043,8 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, "%s: Received Command to change ese mode = %d", __func__, eseMode); pHddCtx->cfg_ini->isEseIniFeatureEnabled = eseMode; - sme_UpdateIsEseFeatureEnabled(pHddCtx->hHal, eseMode); + sme_UpdateIsEseFeatureEnabled(pHddCtx->hHal, pAdapter->sessionId, + eseMode); } #endif else if (strncmp(command, "SETROAMSCANCONTROL", 18) == 0) diff --git a/CORE/MAC/src/pe/include/limFTDefs.h b/CORE/MAC/src/pe/include/limFTDefs.h index 98a9f1d2a1ee..ba238f3a3297 100644 --- a/CORE/MAC/src/pe/include/limFTDefs.h +++ b/CORE/MAC/src/pe/include/limFTDefs.h @@ -150,6 +150,7 @@ typedef struct sSirFTRoamOffloadSynchRsp { tANI_U16 messageType; /* eWNI_SME_FT_ROAM_OFFLOAD_SYNCH_RSP */ tANI_U16 length; + tANI_U8 sessionId; tpSirBssDescription pbssDescription; } tSirFTRoamOffloadSynchRsp, *tpSirFTRoamOffloadSynchRsp; #endif diff --git a/CORE/MAC/src/pe/lim/limFT.c b/CORE/MAC/src/pe/lim/limFT.c index e3fc7131d362..b9cee3f4a1b8 100644 --- a/CORE/MAC/src/pe/lim/limFT.c +++ b/CORE/MAC/src/pe/lim/limFT.c @@ -1997,7 +1997,6 @@ void limProcessFTRoamOffloadSynchInd(tpAniSirGlobal pMac, tpSirMsgQ pMsg) } pftSessionEntry->limPrevSmeState = pftSessionEntry->limSmeState; pftSessionEntry->limSmeState = eLIM_SME_WT_REASSOC_STATE; - pMac->ft.ftPEContext.pftSessionEntry = pftSessionEntry; VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_DEBUG, "LFR3:%s:created session (%p) with id = %d", __func__, pftSessionEntry, pftSessionEntry->peSessionId); @@ -2006,26 +2005,9 @@ void limProcessFTRoamOffloadSynchInd(tpAniSirGlobal pMac, tpSirMsgQ pMsg) limPrintMacAddr(pMac, psessionEntry->limReAssocbssId, LOG2); // Prepare the session right now with as much as possible. - pftSessionEntry = limFillFTSession(pMac, pbssDescription, psessionEntry); + limFillFTSession(pMac, pbssDescription, pftSessionEntry, psessionEntry); - if (pftSessionEntry) - { - pftSessionEntry->is11Rconnection = psessionEntry->is11Rconnection; -#ifdef FEATURE_WLAN_ESE - pftSessionEntry->isESEconnection = psessionEntry->isESEconnection; -#endif -#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_ESE || defined(FEATURE_WLAN_LFR) - pftSessionEntry->isFastTransitionEnabled = - psessionEntry->isFastTransitionEnabled; -#endif - -#ifdef FEATURE_WLAN_LFR - pftSessionEntry->isFastRoamIniFeatureEnabled = - psessionEntry->isFastRoamIniFeatureEnabled; -#endif - limFTPrepareAddBssReq( pMac, FALSE, pftSessionEntry, pbssDescription ); - pMac->ft.ftPEContext.pftSessionEntry = pftSessionEntry; - } + limFTPrepareAddBssReq( pMac, FALSE, pftSessionEntry, pbssDescription ); pFTRoamOffloadSynchRsp = vos_mem_malloc(rspLen); if (NULL == pFTRoamOffloadSynchRsp) @@ -2038,6 +2020,7 @@ void limProcessFTRoamOffloadSynchInd(tpAniSirGlobal pMac, tpSirMsgQ pMsg) pFTRoamOffloadSynchRsp->messageType = eWNI_SME_FT_ROAM_OFFLOAD_SYNCH_RSP; pFTRoamOffloadSynchRsp->length = (tANI_U16) rspLen; + pFTRoamOffloadSynchRsp->sessionId = psessionEntry->smeSessionId; pFTRoamOffloadSynchRsp->pbssDescription = pbssDescription; mmhMsg.type = pFTRoamOffloadSynchRsp->messageType; diff --git a/CORE/SME/inc/csrNeighborRoam.h b/CORE/SME/inc/csrNeighborRoam.h index c1023eb12ef2..8658e71cba59 100644 --- a/CORE/SME/inc/csrNeighborRoam.h +++ b/CORE/SME/inc/csrNeighborRoam.h @@ -275,7 +275,7 @@ VOS_STATUS csrNeighborRoamUpdateFastRoamingEnabled(tpAniSirGlobal pMac, tANI_U8 sessionId, const v_BOOL_t fastRoamEnabled); VOS_STATUS csrNeighborRoamUpdateEseModeEnabled(tpAniSirGlobal pMac, - tANI_U32 sessionId, + tANI_U8 sessionId, const v_BOOL_t eseMode); VOS_STATUS csrNeighborRoamChannelsFilterByCurrentBand( tpAniSirGlobal pMac, @@ -348,7 +348,8 @@ VOS_STATUS csrRoamReadTSF(tpAniSirGlobal pMac, tANI_U8 *pTimestamp, #endif /*FEATURE_WLAN_ESE && FEATURE_WLAN_ESE_UPLOAD */ #ifdef WLAN_FEATURE_ROAM_OFFLOAD eHalStatus csrNeighborRoamOffloadSynchRspHandler(tpAniSirGlobal pMac, - tpSirFTRoamOffloadSynchRsp pFTRoamOffloadSynchRsp); + tpSirFTRoamOffloadSynchRsp pFTRoamOffloadSynchRsp, + tANI_U8 sessionId); #endif #endif /* WLAN_FEATURE_NEIGHBOR_ROAMING */ diff --git a/CORE/SME/inc/smeRrmInternal.h b/CORE/SME/inc/smeRrmInternal.h index da95229d9dac..e0a1e0fa00f0 100644 --- a/CORE/SME/inc/smeRrmInternal.h +++ b/CORE/SME/inc/smeRrmInternal.h @@ -63,6 +63,7 @@ typedef struct sRrmNeighborReportDesc tListElem List; tSirNeighborBssDescription *pNeighborBssDescription; tANI_U32 roamScore; + tANI_U8 sessionId; } tRrmNeighborReportDesc, *tpRrmNeighborReportDesc; diff --git a/CORE/SME/inc/sme_Api.h b/CORE/SME/inc/sme_Api.h index 28c6641a151b..6140d07a867a 100644 --- a/CORE/SME/inc/sme_Api.h +++ b/CORE/SME/inc/sme_Api.h @@ -2834,9 +2834,8 @@ eHalStatus sme_UpdateEnableFastRoamInConcurrency(tHalHandle hHal, Other status means SME is failed to update isEseIniFeatureEnabled. \sa --------------------------------------------------------------------------*/ - -eHalStatus sme_UpdateIsEseFeatureEnabled(tHalHandle hHal, - const v_BOOL_t isEseIniFeatureEnabled); +eHalStatus sme_UpdateIsEseFeatureEnabled(tHalHandle hHal, tANI_U8 sessionId, + const v_BOOL_t isEseIniFeatureEnabled); #endif /* FEATURE_WLAN_ESE */ diff --git a/CORE/SME/src/csr/csrApiRoam.c b/CORE/SME/src/csr/csrApiRoam.c index df1734178aab..86eab361d9d3 100644 --- a/CORE/SME/src/csr/csrApiRoam.c +++ b/CORE/SME/src/csr/csrApiRoam.c @@ -17882,7 +17882,7 @@ void csrRoamFTPreAuthRspProcessor( tHalHandle hHal, tpSirFTPreAuthRsp pFTPreAuth eCSR_ROAM_FT_RESPONSE, eCSR_ROAM_RESULT_NONE); #if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD) - if (csrRoamIsESEAssoc(pMac)) + if (csrRoamIsESEAssoc(pMac, pFTPreAuthRsp->smeSessionId)) { /* read TSF */ csrRoamReadTSF(pMac, (tANI_U8 *)roamInfo.timestamp, @@ -18711,7 +18711,7 @@ void csrRoamFTRoamOffloadSynchRspProcessor( tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); if (eHAL_STATUS_SUCCESS != csrNeighborRoamOffloadSynchRspHandler( - pMac, pFTRoamOffloadSynchRsp)) { + pMac, pFTRoamOffloadSynchRsp, pFTRoamOffloadSynchRsp->sessionId)) { /* * Bail out if Roam Offload Synch Response was not even handled. */ @@ -18719,7 +18719,7 @@ void csrRoamFTRoamOffloadSynchRspProcessor( "was not processed")); goto err_synch_rsp; } - csrNeighborRoamRequestHandoff(pMac); + csrNeighborRoamRequestHandoff(pMac, pFTRoamOffloadSynchRsp->sessionId); csrRoamDequeueRoamOffloadSynch(pMac); err_synch_rsp: diff --git a/CORE/SME/src/csr/csrApiScan.c b/CORE/SME/src/csr/csrApiScan.c index 6accc7be3ef3..de2ae2484535 100644 --- a/CORE/SME/src/csr/csrApiScan.c +++ b/CORE/SME/src/csr/csrApiScan.c @@ -8765,6 +8765,7 @@ eHalStatus csrScanSaveRoamOffloadApToScanCache(tpAniSirGlobal pMac, v_TIME_t timer=0; tpSirMacMgmtHdr macHeader; tANI_U8 *pBeaconProbeResp; + tANI_U8 sessionId = pRoamOffloadSynchInd->roamedVdevId; pBeaconProbeResp = (tANI_U8 *)pRoamOffloadSynchInd + pRoamOffloadSynchInd->beaconProbeRespOffset; @@ -8936,7 +8937,7 @@ eHalStatus csrScanSaveRoamOffloadApToScanCache(tpAniSirGlobal pMac, vos_mem_free(pParsedFrame); return eHAL_STATUS_RESOURCES; } - csrScanAddResult(pMac, pScanResult, pIesLocal); + csrScanAddResult(pMac, pScanResult, pIesLocal, sessionId); vos_mem_free(pParsedFrame); diff --git a/CORE/SME/src/csr/csrNeighborRoam.c b/CORE/SME/src/csr/csrNeighborRoam.c index 1d1cfac5298a..91fb2e3a29bc 100644 --- a/CORE/SME/src/csr/csrNeighborRoam.c +++ b/CORE/SME/src/csr/csrNeighborRoam.c @@ -441,6 +441,7 @@ VOS_STATUS csrNeighborRoamUpdateEseModeEnabled(tpAniSirGlobal pMac, tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo[sessionId]; VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; + tpFTRoamCallbackUsrCtx pUsrCtx; if (eCSR_NEIGHBOR_ROAM_STATE_CONNECTED == pNeighborRoamInfo->neighborRoamState) { @@ -1689,14 +1690,18 @@ DEQ_PREAUTH: * \fn csrNeighborRoamOffloadSynchRspHandler * \brief This function handle the RoamOffloadSynch from PE * \param pMac - The handle returned by macOpen. - * \return eHAL_STATUS_SUCCESS on success , + * \param pFTRoamOffloadSynchRsp - Roam offload sync response + * \param sessionId - Session identifier + * \return eHAL_STATUS_SUCCESS on success, * eHAL_STATUS_FAILURE otherwise * --------------------------------------------------------------------------*/ -eHalStatus csrNeighborRoamOffloadSynchRspHandler( - tpAniSirGlobal pMac, tpSirFTRoamOffloadSynchRsp pFTRoamOffloadSynchRsp) +eHalStatus +csrNeighborRoamOffloadSynchRspHandler(tpAniSirGlobal pMac, + tpSirFTRoamOffloadSynchRsp pFTRoamOffloadSynchRsp, + tANI_U8 sessionId) { tpCsrNeighborRoamControlInfo pNeighborRoamInfo = - &pMac->roam.neighborRoamInfo; + &pMac->roam.neighborRoamInfo[sessionId]; tpCsrNeighborRoamBSSInfo pBssInfo; tANI_U16 bssDescLen; tpSirFTPreAuthReq pftPreAuthReq; @@ -1748,9 +1753,9 @@ eHalStatus csrNeighborRoamOffloadSynchRspHandler( vos_mem_copy(&pftPreAuthReq->preAuthbssId, pFTRoamOffloadSynchRsp->pbssDescription->bssId, sizeof(tSirMacAddr)); - pMac->ft.ftPEContext.pFTPreAuthReq = pftPreAuthReq; - CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_PREAUTH_DONE) + CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_PREAUTH_DONE, + sessionId) pNeighborRoamInfo->FTRoamInfo.numPreAuthRetries = 0; VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, "LFR3:Entry added to Auth Done List"); @@ -5074,9 +5079,9 @@ eHalStatus csrNeighborRoamIndicateConnect(tpAniSirGlobal pMac, pSession->roamOffloadSynchParams.bRoamSynchInProgress = VOS_FALSE; if (eSIR_ROAM_AUTH_STATUS_CONNECTED == - pSession->roamOffloadSynchParams.authStatus) - { - csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_START, + pSession->roamOffloadSynchParams.authStatus) { + csrRoamOffloadScan(pMac, sessionId, + ROAM_SCAN_OFFLOAD_START, REASON_CONNECT); } } else diff --git a/CORE/SME/src/sme_common/sme_Api.c b/CORE/SME/src/sme_common/sme_Api.c index 2065459f3251..cd83dded76c4 100644 --- a/CORE/SME/src/sme_common/sme_Api.c +++ b/CORE/SME/src/sme_common/sme_Api.c @@ -9735,7 +9735,8 @@ eHalStatus sme_UpdateIsEseFeatureEnabled pMac->roam.configParam.isEseIniFeatureEnabled, isEseIniFeatureEnabled); pMac->roam.configParam.isEseIniFeatureEnabled = isEseIniFeatureEnabled; - csrNeighborRoamUpdateEseModeEnabled(pMac, isEseIniFeatureEnabled); + csrNeighborRoamUpdateEseModeEnabled(pMac, sessionId, + isEseIniFeatureEnabled); if (TRUE == isEseIniFeatureEnabled) { -- cgit v1.2.3 From cbf8591e34d9a98350a5f7a340022f0cf00811d8 Mon Sep 17 00:00:00 2001 From: Peng Xu Date: Mon, 28 Jul 2014 10:34:04 -0700 Subject: qca-cld:lim: Set channel number in beacon structure The channel number is not set in beacon structure in function limCollectBssDescription. When AP is in hidden SSID and 5G WEP mode, channel number may not be present in probe response message, this will cause the channel number becomes 0 and lead to wrong state. CRs-fixed: 700786 Change-Id: Ib701526c04830bfa5584e02108e3c80cd9881210 --- CORE/MAC/src/pe/lim/limScanResultUtils.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CORE/MAC/src/pe/lim/limScanResultUtils.c b/CORE/MAC/src/pe/lim/limScanResultUtils.c index f8d884da4701..7a7435cd7c50 100644 --- a/CORE/MAC/src/pe/lim/limScanResultUtils.c +++ b/CORE/MAC/src/pe/lim/limScanResultUtils.c @@ -293,6 +293,9 @@ limCollectBssDescription(tpAniSirGlobal pMac, pBody + SIR_MAC_B_PR_SSID_OFFSET, ieLen); + /*set channel number in beacon in case it is not present*/ + pBPR->channelNumber = pBssDescr->channelId; + //sirDumpBuf( pMac, SIR_LIM_MODULE_ID, LOGW, (tANI_U8 *) pBssDescr, pBssDescr->length + 2 ); limLog( pMac, LOG3, FL("Collected BSS Description for Channel(%1d), length(%u), aniIndicator(%d), IE Fields(%u)"), -- cgit v1.2.3 From eeb914c9ec9c2f38a95c06635022464d1dff2caa Mon Sep 17 00:00:00 2001 From: Ganesh Babu Kumaravel Date: Mon, 28 Jul 2014 11:02:10 +0530 Subject: qcacld:add dummy handler for lookahead events Add dummy handler for lookahaed events as Firmware is sending these events which results in unwanted error prints. Change-Id: Ie863818ad7895a05deb300b1288f006f9603c8ed CRs-Fixed: 700574 --- CORE/SERVICES/HTC/htc_recv.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CORE/SERVICES/HTC/htc_recv.c b/CORE/SERVICES/HTC/htc_recv.c index 03d61842bbdd..a8eeaa02fc90 100644 --- a/CORE/SERVICES/HTC/htc_recv.c +++ b/CORE/SERVICES/HTC/htc_recv.c @@ -659,6 +659,16 @@ static A_STATUS HTCProcessTrailer(HTC_TARGET *target, htc_rec_len / (sizeof(HTC_CREDIT_REPORT)), FromEndpoint); break; + +#ifdef HIF_SDIO + case HTC_RECORD_LOOKAHEAD: + /* Process in HIF layer */ + break; + + case HTC_RECORD_LOOKAHEAD_BUNDLE: + /* Process in HIF layer */ + break; +#endif default: AR_DEBUG_PRINTF(ATH_DEBUG_ERR, (" unhandled record: id:%d length:%d \n", htc_rec_id, htc_rec_len)); -- cgit v1.2.3 From 7a49220d5aa5e1c2bb2dc1cc1bb893e93e2c7c8e Mon Sep 17 00:00:00 2001 From: Krishna Kumaar Natarajan Date: Fri, 25 Jul 2014 15:05:26 -0700 Subject: wlan: qcacld: Fix to remove dropping of consecutive Deauth frame In order to prevent rogue AP from pumping DEAUTH into STA, throttling mechanism have been added to throttle the number of DEAUTHs allowed in a given time. Since SA query process is used in case of PMF connection, this check can be avoided. This change set provides fix for skipping the DEAUTH count check for PMF connection. CRs-Fixed: 700276 Change-Id: I82e213d0c7b48500f4ae273ff185f153854b9ceb --- CORE/SYS/legacy/src/system/src/sysEntryFunc.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/CORE/SYS/legacy/src/system/src/sysEntryFunc.c b/CORE/SYS/legacy/src/system/src/sysEntryFunc.c index f478a00d1eec..5f46c879764e 100644 --- a/CORE/SYS/legacy/src/system/src/sysEntryFunc.c +++ b/CORE/SYS/legacy/src/system/src/sysEntryFunc.c @@ -121,6 +121,12 @@ sysBbtProcessMessageCore(tpAniSirGlobal pMac, tpSirMsgQ pMsg, tANI_U32 type, vos_pkt_t *pVosPkt = (vos_pkt_t *)pMsg->bodyptr; VOS_STATUS vosStatus = WDA_DS_PeekRxPacketInfo( pVosPkt, (v_PVOID_t *)&pBd, VOS_FALSE ); +#ifdef WLAN_FEATURE_11W + tANI_U8 sessionId; + tpPESession psessionEntry; + tpSirMacMgmtHdr pMacHdr; +#endif /* WLAN_FEATURE_11W */ + pMac->sys.gSysBbtReceived++; if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) @@ -141,8 +147,21 @@ sysBbtProcessMessageCore(tpAniSirGlobal pMac, tpSirMsgQ pMsg, tANI_U32 type, tANI_U32 timeNow = adf_os_ticks(); tANI_U32 timeGap = adf_os_ticks_to_msecs(timeNow - lastDeauthPacketTime); - if (timeGap < 1000) - goto fail; + if (timeGap < 1000) { +#ifdef WLAN_FEATURE_11W + pMacHdr = WDA_GET_RX_MAC_HEADER(pBd); + psessionEntry = peFindSessionByPeerSta(pMac, + pMacHdr->sa, &sessionId); + if(!psessionEntry) { + PELOGE(sysLog(pMac, LOGE, + FL("session does not exist for given STA [%pM]"), + pMacHdr->sa);); + goto fail; + } + if (!psessionEntry->limRmfEnabled) +#endif /* WLAN_FEATURE_11W */ + goto fail; + } } if (subType == SIR_MAC_MGMT_DEAUTH) -- cgit v1.2.3 From 37fe48af6ad4ffa9b1c5d5c96762db55cb39eb76 Mon Sep 17 00:00:00 2001 From: Amar Singhal Date: Fri, 25 Jul 2014 11:53:50 -0700 Subject: wlan: Add fragmentation support for link layer stats Add fragmentation support for peer and radio stats. CRs-Fixed: 700263 Change-Id: I3e63d7b9ad8c758b6481b3d203672e151218e358 --- CORE/HDD/src/wlan_hdd_cfg80211.c | 166 ++++++++++++++++++++++----------------- 1 file changed, 93 insertions(+), 73 deletions(-) diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c index f8874db31282..e18a927459a5 100644 --- a/CORE/HDD/src/wlan_hdd_cfg80211.c +++ b/CORE/HDD/src/wlan_hdd_cfg80211.c @@ -2368,6 +2368,7 @@ static bool hdd_get_interface_info(hdd_adapter_t *pAdapter, * layers. */ static void hdd_link_layer_process_peer_stats(hdd_adapter_t *pAdapter, + u32 more_data, tpSirWifiPeerStat pData) { hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); @@ -2390,60 +2391,60 @@ static void hdd_link_layer_process_peer_stats(hdd_adapter_t *pAdapter, } hddLog(VOS_TRACE_LEVEL_INFO, - "LL_STATS_PEER_ALL : numPeers %u", - pWifiPeerStat->numPeers); + "LL_STATS_PEER_ALL : numPeers %u, more data = %u", + pWifiPeerStat->numPeers, + more_data); + + for (i = 0; i < pWifiPeerStat->numPeers; i++) { - for (i = 0; i < pWifiPeerStat->numPeers; i++) - { - pWifiPeerInfo = (tpSirWifiPeerInfo) - ((uint8 *)pWifiPeerStat->peerInfo + - ( i * sizeof(tSirWifiPeerInfo))); + pWifiPeerInfo = (tpSirWifiPeerInfo) + ((uint8 *)pWifiPeerStat->peerInfo + + ( i * sizeof(tSirWifiPeerInfo))); - hddLog(VOS_TRACE_LEVEL_INFO, - " %d) LL_STATS Channel Stats " - " Peer Type %u " - " peerMacAddress %pM " - " capabilities 0x%x " - " numRate %u ", - i, - pWifiPeerInfo->type, - pWifiPeerInfo->peerMacAddress, - pWifiPeerInfo->capabilities, - pWifiPeerInfo->numRate); + hddLog(VOS_TRACE_LEVEL_INFO, + " %d) LL_STATS Channel Stats " + " Peer Type %u " + " peerMacAddress %pM " + " capabilities 0x%x " + " numRate %u ", + i, + pWifiPeerInfo->type, + pWifiPeerInfo->peerMacAddress, + pWifiPeerInfo->capabilities, + pWifiPeerInfo->numRate); + { + for (j = 0; j < pWifiPeerInfo->numRate; j++) { - for (j = 0; j < pWifiPeerInfo->numRate; j++) - { - pWifiRateStat = (tpSirWifiRateStat) - ((tANI_U8 *) pWifiPeerInfo->rateStats + - ( j * sizeof(tSirWifiRateStat))); + pWifiRateStat = (tpSirWifiRateStat) + ((tANI_U8 *) pWifiPeerInfo->rateStats + + ( j * sizeof(tSirWifiRateStat))); - hddLog(VOS_TRACE_LEVEL_INFO, - " peer Rate Stats " - " preamble %u " - " nss %u " - " bw %u " - " rateMcsIdx %u " - " reserved %u " - " bitrate %u " - " txMpdu %u " - " rxMpdu %u " - " mpduLost %u " - " retries %u " - " retriesShort %u " - " retriesLong %u", - pWifiRateStat->rate.preamble, - pWifiRateStat->rate.nss, - pWifiRateStat->rate.bw, - pWifiRateStat->rate.rateMcsIdx, - pWifiRateStat->rate.reserved, - pWifiRateStat->rate.bitrate, - pWifiRateStat->txMpdu, - pWifiRateStat->rxMpdu, - pWifiRateStat->mpduLost, - pWifiRateStat->retries, - pWifiRateStat->retriesShort, - pWifiRateStat->retriesLong); - } + hddLog(VOS_TRACE_LEVEL_INFO, + " peer Rate Stats " + " preamble %u " + " nss %u " + " bw %u " + " rateMcsIdx %u " + " reserved %u " + " bitrate %u " + " txMpdu %u " + " rxMpdu %u " + " mpduLost %u " + " retries %u " + " retriesShort %u " + " retriesLong %u", + pWifiRateStat->rate.preamble, + pWifiRateStat->rate.nss, + pWifiRateStat->rate.bw, + pWifiRateStat->rate.rateMcsIdx, + pWifiRateStat->rate.reserved, + pWifiRateStat->rate.bitrate, + pWifiRateStat->txMpdu, + pWifiRateStat->rxMpdu, + pWifiRateStat->mpduLost, + pWifiRateStat->retries, + pWifiRateStat->retriesShort, + pWifiRateStat->retriesLong); } } } @@ -2457,10 +2458,10 @@ static void hdd_link_layer_process_peer_stats(hdd_adapter_t *pAdapter, * the sizeof (tSirWifiRateStat) being 32. */ vendor_event = cfg80211_vendor_event_alloc(pHddCtx->wiphy, - LL_STATS_EVENT_BUF_SIZE + - NLMSG_HDRLEN, - QCA_NL80211_VENDOR_SUBCMD_LL_PEER_INFO_STATS_INDEX, - GFP_KERNEL); + LL_STATS_EVENT_BUF_SIZE + + NLMSG_HDRLEN, + QCA_NL80211_VENDOR_SUBCMD_LL_PEER_INFO_STATS_INDEX, + GFP_KERNEL); if (!vendor_event) { @@ -2471,6 +2472,9 @@ static void hdd_link_layer_process_peer_stats(hdd_adapter_t *pAdapter, } if (nla_put_u32(vendor_event, + QCA_WLAN_VENDOR_ATTR_LL_STATS_RESULTS_MORE_DATA, + more_data) || + nla_put_u32(vendor_event, QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_NUM_PEERS, pWifiPeerStat->numPeers)) { @@ -2481,6 +2485,7 @@ static void hdd_link_layer_process_peer_stats(hdd_adapter_t *pAdapter, return; } + pWifiPeerInfo = (tpSirWifiPeerInfo) ((uint8 *) pWifiPeerStat->peerInfo); @@ -2679,7 +2684,9 @@ static void hdd_link_layer_process_iface_stats(hdd_adapter_t *pAdapter, * layers. */ static void hdd_link_layer_process_radio_stats(hdd_adapter_t *pAdapter, - tpSirWifiRadioStat pData) + u32 more_data, + tpSirWifiRadioStat pData, + u32 num_radio) { int status, i; tpSirWifiRadioStat pWifiRadioStat; @@ -2688,23 +2695,24 @@ static void hdd_link_layer_process_radio_stats(hdd_adapter_t *pAdapter, hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); pWifiRadioStat = pData; - status = wlan_hdd_validate_context(pHddCtx); if (0 != status) { hddLog(VOS_TRACE_LEVEL_ERROR, - FL("HDD context is not valid") ); + FL("HDD context is not valid")); return; } hddLog(VOS_TRACE_LEVEL_INFO, "LL_STATS_RADIO" - " radio is %d onTime is %u " - " txTime is %u rxTime is %u " - " onTimeScan is %u onTimeNbd is %u " - " onTimeGscan is %u onTimeRoamScan is %u " - " onTimePnoScan is %u onTimeHs20 is %u " + " number of radios = %u" + " radio is %d onTime is %u" + " txTime is %u rxTime is %u" + " onTimeScan is %u onTimeNbd is %u" + " onTimeGscan is %u onTimeRoamScan is %u" + " onTimePnoScan is %u onTimeHs20 is %u" " numChannels is %u", + num_radio, pWifiRadioStat->radio, pWifiRadioStat->onTime, pWifiRadioStat->txTime, @@ -2739,6 +2747,12 @@ static void hdd_link_layer_process_radio_stats(hdd_adapter_t *pAdapter, } if (nla_put_u32(vendor_event, + QCA_WLAN_VENDOR_ATTR_LL_STATS_RESULTS_MORE_DATA, + more_data) || + nla_put_u32(vendor_event, + QCA_WLAN_VENDOR_ATTR_LL_STATS_NUM_RADIOS, + num_radio) || + nla_put_u32(vendor_event, QCA_WLAN_VENDOR_ATTR_LL_STATS_RADIO_ID, pWifiRadioStat->radio) || nla_put_u32(vendor_event, @@ -2905,30 +2919,36 @@ static void wlan_hdd_cfg80211_link_layer_stats_callback(void *ctx, "LL_STATS RESULTS RESPONSE respId = %u", linkLayerStatsResults->rspId); hddLog(VOS_TRACE_LEVEL_INFO, - "LL_STATS RESULTS RESPONSE moreResultToFollow = %u", - linkLayerStatsResults->moreResultToFollow); + "LL_STATS RESULTS RESPONSE more data = %u", + linkLayerStatsResults->moreResultToFollow); + hddLog(VOS_TRACE_LEVEL_INFO, + "LL_STATS RESULTS RESPONSE num radio = %u", + linkLayerStatsResults->num_radio); hddLog(VOS_TRACE_LEVEL_INFO, - "LL_STATS RESULTS RESPONSE result = %p", - linkLayerStatsResults->results); + "LL_STATS RESULTS RESPONSE result = %p", + linkLayerStatsResults->results); if (linkLayerStatsResults->paramId & WMI_LINK_STATS_RADIO ) { hdd_link_layer_process_radio_stats(pAdapter, - (tpSirWifiRadioStat) - linkLayerStatsResults->results); + linkLayerStatsResults->moreResultToFollow, + (tpSirWifiRadioStat) + linkLayerStatsResults->results, + linkLayerStatsResults->num_radio); } else if (linkLayerStatsResults->paramId & WMI_LINK_STATS_IFACE ) { hdd_link_layer_process_iface_stats(pAdapter, - (tpSirWifiIfaceStat) - linkLayerStatsResults->results, - linkLayerStatsResults->num_peers); + (tpSirWifiIfaceStat) + linkLayerStatsResults->results, + linkLayerStatsResults->num_peers); } else if (linkLayerStatsResults->paramId & WMI_LINK_STATS_ALL_PEER ) { hdd_link_layer_process_peer_stats(pAdapter, - (tpSirWifiPeerStat) - linkLayerStatsResults->results); + linkLayerStatsResults->moreResultToFollow, + (tpSirWifiPeerStat) + linkLayerStatsResults->results); } else { -- cgit v1.2.3 From d0e161b039c5e4d506ad785117639af85d6b4f23 Mon Sep 17 00:00:00 2001 From: Srinivas Girigowda Date: Mon, 21 Jul 2014 15:11:22 -0700 Subject: qcacld: HDD: Fix issues reported by static analysis tool Fix issues reported by static analysis tool Change-Id: I5574c3ea4688fa28ebe10fa835be4bab1ee3231a CRs-Fixed: 697530 --- CORE/HDD/src/wlan_hdd_main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c index baf7c8f48c29..661bb685e9f2 100755 --- a/CORE/HDD/src/wlan_hdd_main.c +++ b/CORE/HDD/src/wlan_hdd_main.c @@ -10421,7 +10421,7 @@ void hdd_wlan_exit(hdd_context_t *pHddCtx) hdd_abort_mac_scan_all_adapters(pHddCtx); /* Stop the traffic monitor timer */ - if ((NULL != pHddCtx->cfg_ini) && (pHddCtx->cfg_ini->dynSplitscan)) { + if ((NULL != pConfig) && (pConfig->dynSplitscan)) { if (VOS_TIMER_STATE_RUNNING == vos_timer_getCurrentState(&pHddCtx->tx_rx_trafficTmr)) { vos_timer_stop(&pHddCtx->tx_rx_trafficTmr); @@ -10449,7 +10449,7 @@ void hdd_wlan_exit(hdd_context_t *pHddCtx) } #endif - if(!pConfig->enablePowersaveOffload) + if (pConfig && !pConfig->enablePowersaveOffload) { //Disable IMPS/BMPS as we do not want the device to enter any power //save mode during shutdown @@ -10581,7 +10581,7 @@ void hdd_wlan_exit(hdd_context_t *pHddCtx) #endif //Close Watchdog - if(pHddCtx->cfg_ini->fIsLogpEnabled) + if (pConfig && pConfig->fIsLogpEnabled) vos_watchdog_close(pVosContext); //Clean up HDD Nlink Service @@ -10595,7 +10595,7 @@ void hdd_wlan_exit(hdd_context_t *pHddCtx) #ifdef WLAN_LOGGING_SOCK_SVC_ENABLE - if (pHddCtx->cfg_ini->wlanLoggingEnable) { + if (pConfig && pConfig->wlanLoggingEnable) { wlan_logging_sock_deactivate_svc(); } #endif -- cgit v1.2.3 From 41a69c0b562da2bd2650f98cab657d8f460eae97 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Thu, 24 Jul 2014 13:54:44 -0700 Subject: wlan: qcacld: Remove pronto support from Android.mk It has been decided that the qcacld driver will no longer support the pronto wlan core, so we want to remove all conditional compilation that exists to support this target. Start by removing the conditional logic that is used to pass WLAN_ISOC_SELECT from Android.mk to Kbuild. Change-Id: I35991068424d7c10be2e42c2af458c75955c5207 CRs-fixed: 699601 --- Android.mk | 3 --- Kbuild | 6 ++++++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Android.mk b/Android.mk index d44ca6d5d208..784b4fcf9d61 100644 --- a/Android.mk +++ b/Android.mk @@ -7,8 +7,6 @@ WLAN_CHIPSET := ifeq ($(call is-board-platform-in-list, apq8084 mpq8092 msm8960 msm8994),true) WLAN_CHIPSET := qca_cld WLAN_SELECT := CONFIG_QCA_CLD_WLAN=m - WLAN_ISOC_SELECT := CONFIG_QCA_WIFI_ISOC=0 - WLAN_ISOC_SELECT += CONFIG_QCA_WIFI_2_0=1 endif # Build/Package only in case of supported target @@ -59,7 +57,6 @@ KBUILD_OPTIONS := WLAN_ROOT=../$(WLAN_BLD_DIR)/qcacld-2.0 KBUILD_OPTIONS += MODNAME=wlan KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM) KBUILD_OPTIONS += $(WLAN_SELECT) -KBUILD_OPTIONS += $(WLAN_ISOC_SELECT) KBUILD_OPTIONS += WLAN_OPEN_SOURCE=$(WLAN_OPEN_SOURCE) include $(CLEAR_VARS) diff --git a/Kbuild b/Kbuild index 5f3c9946148b..1d8db3822063 100644 --- a/Kbuild +++ b/Kbuild @@ -6,6 +6,12 @@ else KERNEL_BUILD := 0 endif +# This driver does not support integrated SOC +CONFIG_QCA_WIFI_ISOC=0 + +# This driver supports the QCACLD 2.0 software architecture +CONFIG_QCA_WIFI_2_0=1 + ifeq ($(CONFIG_CLD_HL_SDIO_CORE), y) CONFIG_QCA_WIFI_SDIO := 1 endif -- cgit v1.2.3 From c5e74d49cc579b1e37257d13c46868a641333f84 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Fri, 25 Jul 2014 10:28:46 -0700 Subject: wlan: Remove obsolete WPAL abstraction layer The WPAL platform abstraction exists to support the WMI interface applicable to the Wi-Fi 1.0 integrated architecture. The qcacld driver was initially designed to support both the Wi-Fi 1.0 integrated solution and the Wi-Fi 2.0 discrete solution. However it has been decided that the integrated solution will only be supported by the prima driver, so remove from qcacld all of the WPAL abstraction code that is now obsolete. Note that some references to wlan_qct_pal_trace.c still exist in qcacld, so this file is retained for now. In addition there are still many references to WPAL header files, so these are also all retained for now. Change-Id: I4f9304563bea94bb1fa2e956296adcb9f844e2ee CRs-fixed: 700100 --- CORE/WDI/WPAL/src/wlan_qct_pal_api.c | 448 ---------------- CORE/WDI/WPAL/src/wlan_qct_pal_device.c | 786 --------------------------- CORE/WDI/WPAL/src/wlan_qct_pal_msg.c | 154 ------ CORE/WDI/WPAL/src/wlan_qct_pal_packet.c | 916 -------------------------------- CORE/WDI/WPAL/src/wlan_qct_pal_sync.c | 245 --------- CORE/WDI/WPAL/src/wlan_qct_pal_timer.c | 232 -------- Kbuild | 9 - 7 files changed, 2790 deletions(-) delete mode 100644 CORE/WDI/WPAL/src/wlan_qct_pal_api.c delete mode 100644 CORE/WDI/WPAL/src/wlan_qct_pal_device.c delete mode 100644 CORE/WDI/WPAL/src/wlan_qct_pal_msg.c delete mode 100644 CORE/WDI/WPAL/src/wlan_qct_pal_packet.c delete mode 100644 CORE/WDI/WPAL/src/wlan_qct_pal_sync.c delete mode 100644 CORE/WDI/WPAL/src/wlan_qct_pal_timer.c diff --git a/CORE/WDI/WPAL/src/wlan_qct_pal_api.c b/CORE/WDI/WPAL/src/wlan_qct_pal_api.c deleted file mode 100644 index 0a9423ef20a9..000000000000 --- a/CORE/WDI/WPAL/src/wlan_qct_pal_api.c +++ /dev/null @@ -1,448 +0,0 @@ -/* - * Copyright (c) 2012, 2014 The Linux Foundation. All rights reserved. - * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all - * copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL - * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/**========================================================================= - - \file wlan_qct_pal_api.c - - \brief Implementation general APIs PAL exports. - wpt = (Wlan Pal Type) wpal = (Wlan PAL) - - Definitions for platform Windows. - - ========================================================================*/ - -#include "wlan_qct_pal_api.h" -#include "wlan_qct_pal_trace.h" -#include "wlan_qct_pal_device.h" -#include "vos_trace.h" -#ifndef MEMORY_DEBUG -#include "vos_memory.h" -#endif /* MEMORY_DEBUG */ -#include "vos_api.h" - -#include "dma-mapping.h" -#include -#include - -typedef struct sPalStruct -{ - /*?must check the data type*/ - void* devHandle; -} tPalContext; - -#define WPAL_GET_NDIS_HANDLE(p) ( ((tPalContext *)(p))->devHandle ) - -tPalContext gContext; - -//This structure need to be 4-byte aligned. No packing. -typedef struct -{ - wpt_uint32 length; - //The offset from beginning of the buffer where it is allocated - wpt_uint32 offset; - wpt_uint32 phyAddr; -} tPalDmaMemInfo; - -/*=========================================================================== - - FUNCTIONS - -===========================================================================*/ - -/** - * @brief Initialize PAL - * In case of QNP, this does nothing. - * @param ppPalContext pointer to a caller allocated pointer. It - * is opaque to caller. - * Caller save the returned pointer for future use when - * calling PAL APIs. - * @param pOSContext Pointer to a context that is OS specific. This is NULL is a - particular PAL doesn't use it for that OS. - * - * @return wpt_status eWLAN_PAL_STATUS_SUCCESS - success. Otherwise fail. - */ -wpt_status wpalOpen(void **ppPalContext, void *pOSContext) -{ - wpt_status status; - - gContext.devHandle = pOSContext; - - status = wpalDeviceInit(pOSContext); - if (!WLAN_PAL_IS_STATUS_SUCCESS(status)) - { - WPAL_TRACE(eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_FATAL, - "%s: wpalDeviceInit failed with status %u", - __func__, status); - } - - return status; -} - -/** - * @brief wpalClose - Release PAL - * In case of QNP, this does nothing. - * @param pPalContext pointer returned from wpalOpen. - * - * @return wpt_status eWLAN_PAL_STATUS_SUCCESS - success. Otherwise fail. - */ -wpt_status wpalClose(void *pPalContext) -{ - wpalDeviceClose(gContext.devHandle); - gContext.devHandle = NULL; - - return eWLAN_PAL_STATUS_SUCCESS; -} - -#ifndef MEMORY_DEBUG -/** - * @brief wpalMemoryAllocate - Allocate memory - * @param size number of bytes to allocate - * - * @return void* A pointer to the allocated memory. - * NULL - fail to allocate memory - */ -void *wpalMemoryAllocate(wpt_uint32 size) -{ - return vos_mem_malloc( size ); -} - -/** - * @brief wpalMemoryFree - Free allocated memory - * @param pv pointer to buffer to be freed - */ -void wpalMemoryFree(void *pv) -{ - vos_mem_free( pv ); -} -#endif /* MEMORY_DEBUG */ -/** - * @brief wpalMemoryCopy - copy memory - * @param dest address which data is copied to - * @param src address which data is copied from - * @param size number of bytes to copy - * - * @return wpt_status - * eWLAN_PAL_STATUS_SUCCESS - * eWLAN_PAL_STATUS_INVALID_PARAM - */ -wpt_status wpalMemoryCopy(void * dest, void * src, wpt_uint32 size) -{ - vos_mem_copy( dest, src, size ); - - return eWLAN_PAL_STATUS_SUCCESS; -} - -/** - * @brief wpalMemoryCompare - compare memory - * @param buf1 address of buffer1 - * @param buf2 address of buffer2 - * @param size number of bytes to compare - * - * @return wpt_boolean - * eWLAN_PAL_TRUE - if two buffers have same content - * eWLAN_PAL_FALSE - not match - */ -wpt_boolean wpalMemoryCompare(void * buf1, void * buf2, wpt_uint32 size) -{ - return (wpt_boolean)vos_mem_compare( buf1, buf2, size ); -} - - -/*--------------------------------------------------------------------------- - wpalMemoryZero - Zero memory - Param: - buf - address of buffer to be zero - size - number of bytes to zero - Return: - None ----------------------------------------------------------------------------*/ -void wpalMemoryZero(void *buf, wpt_uint32 size) -{ - vos_mem_zero( buf, size ); -} - -/** - * @brief wpalMemoryFill - Fill memory with one pattern - * @param buf address of buffer to be filled - * @param size number of bytes to fill - * @param bFill one byte of data to fill in (size) bytes from the start of the - * buffer - */ -void wpalMemoryFill(void *buf, wpt_uint32 size, wpt_byte bFill) -{ - vos_mem_set( buf, size, bFill ); -} - -/** - * @brief wpalDmaMemoryAllocate - Allocate memory ready for DMA. Aligned at 4-byte - * @param size number of bytes to allocate - * @param ppPhysicalAddr Physical address of the buffer if allocation succeeds - * - * @return void* A pointer to the allocated memory (virtual address). - * NULL - fail to allocate memory - */ -void *wpalDmaMemoryAllocate(wpt_uint32 size, void **ppPhysicalAddr) -{ - void *pv = NULL; - dma_addr_t PhyAddr; - wpt_uint32 uAllocLen = size + sizeof(tPalDmaMemInfo); - - pv = dma_alloc_coherent(NULL, uAllocLen, &PhyAddr, GFP_KERNEL); - if ( NULL == pv ) - { - WPAL_TRACE(eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_ERROR, - "%s Unable to allocate DMA buffer", __func__); - return NULL; - } - - - ((tPalDmaMemInfo *)pv)->length = uAllocLen; - ((tPalDmaMemInfo *)pv)->phyAddr = PhyAddr; - ((tPalDmaMemInfo *)pv)->offset = sizeof(tPalDmaMemInfo); - pv = (wpt_byte *)pv + sizeof(tPalDmaMemInfo); - *ppPhysicalAddr = (void*)PhyAddr + sizeof(tPalDmaMemInfo); - - - return (pv); -}/*wpalDmaMemoryAllocate*/ - - -/** - * @brief wpalDmaMemoryFree - Free memory ready for DMA - * @param pv address for the buffer to be freed - */ -void wpalDmaMemoryFree(void *pv) -{ - tPalDmaMemInfo *pMemInfo = (tPalDmaMemInfo *)(((wpt_byte *)pv) - - sizeof(tPalDmaMemInfo)); - if(pv) - { - pv = (wpt_byte *)pv - pMemInfo->offset; - dma_free_coherent(NULL, pMemInfo->length, pv, pMemInfo->phyAddr); - } - -}/*wpalDmaMemoryFree*/ - -/** - * @brief wpalDbgReadRegister - Read register from the WiFi BB - chip - * @param regAddr - register address - * @param pregValue - return value from register if success - * @return - eWLAN_PAL_STATUS_SUCCESS - when everything is OK - */ -wpt_status wpalDbgReadRegister(wpt_uint32 regAddr, wpt_uint32 *pregValue) -{ - if (NULL == pregValue) - { - return eWLAN_PAL_STATUS_E_INVAL; - } - - return wpalReadRegister(regAddr, pregValue); -} - -/** - * @brief wpalDbgWriteRegister - Write a value to the register - * in the WiFi BB chip Param: - * @param regAddr - register address - * @param regValue - value to be written - * @return - eWLAN_PAL_STATUS_SUCCESS - when everything is OK -*/ -wpt_status wpalDbgWriteRegister(wpt_uint32 regAddr, wpt_uint32 regValue) -{ - return wpalWriteRegister(regAddr, regValue); -} - -/** - * @brief - wpalDbgReadMemory - Read memory from WiFi BB chip space - * @param memAddr - address of memory - * @param buf - output - * @param len - length to be read - * @return - eWLAN_PAL_STATUS_SUCCESS - when everything is OK -*/ -wpt_status wpalDbgReadMemory(wpt_uint32 memAddr, wpt_uint8 *buf, wpt_uint32 len) -{ - return wpalReadDeviceMemory(memAddr, buf, len); -} - -/** - * @brief - wpalDbgWriteMemory - Write a value to the memory in the WiFi BB chip space - * @param memAddr - memory address - * @param buf - vlaue to be written - * @param len - length of buf - * @return - eWLAN_PAL_STATUS_SUCCESS - when everything is OK -*/ -wpt_status wpalDbgWriteMemory(wpt_uint32 memAddr, wpt_uint8 *buf, wpt_uint32 len) -{ - return wpalWriteDeviceMemory(memAddr, buf, len); -} - -/*--------------------------------------------------------------------------- - wpalDriverShutdown - Shutdown WLAN driver - - This API is requied by SSR, call in to 'VOS shutdown' to shutdown WLAN - driver when Riva crashes. - - Param: - None - Return: - eWLAN_PAL_STATUS_SUCCESS - when everything is OK ----------------------------------------------------------------------------*/ -wpt_status wpalDriverShutdown(void) -{ - VOS_STATUS vosStatus; - vosStatus = vos_wlanShutdown(); - - if (VOS_STATUS_SUCCESS == vosStatus) { - return eWLAN_PAL_STATUS_SUCCESS; - } - return eWLAN_PAL_STATUS_E_FAILURE; -} - -/*--------------------------------------------------------------------------- - wpalDriverShutdown - Re-init WLAN driver - - This API is requied by SSR, call in to 'VOS re-init' to re-init WLAN - driver. - - Param: - None - Return: - eWLAN_PAL_STATUS_SUCCESS - when everything is OK ----------------------------------------------------------------------------*/ -wpt_status wpalDriverReInit(void) -{ - VOS_STATUS vosStatus; - - vosStatus = vos_wlanReInit(); - if (VOS_STATUS_SUCCESS == vosStatus) { - return eWLAN_PAL_STATUS_SUCCESS; - } - return eWLAN_PAL_STATUS_E_FAILURE; -} - -/*--------------------------------------------------------------------------- - wpalRivaSubystemRestart - Initiate Riva SSR - - This API is called by WLAN driver to initiate Riva SSR - - Param: - None - Return: - eWLAN_PAL_STATUS_SUCCESS - when everything is OK ----------------------------------------------------------------------------*/ -wpt_status wpalRivaSubystemRestart(void) -{ - /* call SSR only if driver is not in load/unload process. - * A WDI timeout during load/unload cannot be fixed thru - * SSR */ - if (vos_is_load_unload_in_progress(VOS_MODULE_ID_WDI, NULL)) - { - WPAL_TRACE(eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_FATAL, - "%s: loading/unloading in progress," - " SSR will be done at the end of unload", __func__); - return eWLAN_PAL_STATUS_E_FAILURE; - } - if (0 == subsystem_restart("wcnss")) - { - return eWLAN_PAL_STATUS_SUCCESS; - } - return eWLAN_PAL_STATUS_E_FAILURE; -} - -/*--------------------------------------------------------------------------- - wpalWlanReload - Initiate WLAN Driver reload - - Param: - None - Return: - NONE ----------------------------------------------------------------------------*/ -void wpalWlanReload(void) -{ - vos_wlanRestart(); - return; -} - -/*--------------------------------------------------------------------------- - wpalWcnssResetIntr - Trigger the reset FIQ to Riva - - Param: - None - Return: - NONE ----------------------------------------------------------------------------*/ -void wpalWcnssResetIntr(void) -{ -#ifdef HAVE_WCNSS_RESET_INTR - wcnss_reset_intr(); -#endif - return; -} - - -/*--------------------------------------------------------------------------- - wpalFwDumpReq - Trigger the dump commands to Firmware - - Param: - cmd - Command No. to execute - arg1 - argument 1 to cmd - arg2 - argument 2 to cmd - arg3 - argument 3 to cmd - arg4 - argument 4 to cmd - Return: - NONE ----------------------------------------------------------------------------*/ -void wpalFwDumpReq(wpt_uint32 cmd, wpt_uint32 arg1, wpt_uint32 arg2, - wpt_uint32 arg3, wpt_uint32 arg4) -{ - vos_fwDumpReq(cmd, arg1, arg2, arg3, arg4); - return; -} - -/*--------------------------------------------------------------------------- - wpalDevicePanic - Trigger Device Panic - Trigger device panic to help debug - - Param: - NONE - - Return: - NONE ----------------------------------------------------------------------------*/ -void wpalDevicePanic(void) -{ - BUG_ON(0); - return; -} - diff --git a/CORE/WDI/WPAL/src/wlan_qct_pal_device.c b/CORE/WDI/WPAL/src/wlan_qct_pal_device.c deleted file mode 100644 index 134da07a36b2..000000000000 --- a/CORE/WDI/WPAL/src/wlan_qct_pal_device.c +++ /dev/null @@ -1,786 +0,0 @@ -/* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. - * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all - * copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL - * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/**========================================================================= - - @file wlan_qct_pal_device.c - - @brief - - This file implements the device specific HW access interface - required by the WLAN Platform Abstraction Layer (WPAL) -========================================================================*/ - -/*=========================================================================== - - EDIT HISTORY FOR FILE - - - This section contains comments describing changes made to the module. - Notice that changes are listed in reverse chronological order. - - - $Header:$ $DateTime: $ $Author: $ - - - when who what, where, why - ---------- --- ----------------------------------------------------------- - 2011-03-01 jtj Initial version for Linux/Android with Wcnss - -===========================================================================*/ - -/*---------------------------------------------------------------------------- - * Include Files - * -------------------------------------------------------------------------*/ -#include -#include -#include -#ifdef EXISTS_MSM_SMSM -#include -#else -#include -#endif -#include "wlan_qct_pal_api.h" -#include "wlan_qct_pal_device.h" -#include "wlan_hdd_main.h" -#include "linux/wcnss_wlan.h" - -/*---------------------------------------------------------------------------- - * Preprocessor Definitions and Constants - * -------------------------------------------------------------------------*/ - -// address in the Host physical memory map -#ifdef WCN_PRONTO -#define WCNSS_BASE_ADDRESS 0xFB000000 -#else -#define WCNSS_BASE_ADDRESS 0x03000000 -#endif -/*---------------------------------------------------------------------------- - * Type Declarations - * -------------------------------------------------------------------------*/ - -/*---------------------------------------------------------------------------- - * Global Data Definitions - * -------------------------------------------------------------------------*/ - -/*---------------------------------------------------------------------------- - * Static Variable Definitions - * -------------------------------------------------------------------------*/ - -typedef struct { - struct resource *wcnss_memory; - void __iomem *mmio; - int tx_irq; - wpalIsrType tx_isr; - void *tx_context; - int rx_irq; - wpalIsrType rx_isr; - void *rx_context; - int rx_registered; - int tx_registered; -} wcnss_env; - -static wcnss_env gEnv; -static wcnss_env *gpEnv = NULL; - -/*---------------------------------------------------------------------------- - * Static Function Declarations and Definitions - * -------------------------------------------------------------------------*/ - -/** - @brief wpalTxIsr is the interrupt service routine which handles - the DXE TX Complete interrupt - - wpalTxIsr is registered with the Operating System to handle the - DXE TX Complete interrupt during system initialization. When a DXE - TX Complete interrupt occurs, it is dispatched to the handler which - had previously been registered via wpalRegisterInterrupt. - - @param irq: Enumeration of the interrupt that occurred - @param dev_id: User-supplied data passed back via the ISR - - @see wpalRegisterInterrupt - - @return IRQ_HANDLED since it is a dedicated interrupt -*/ -static irqreturn_t wpalTxIsr -( - int irq, - void *dev_id -) -{ - if ((NULL != gpEnv) && (NULL != gpEnv->tx_isr)) { - gpEnv->tx_isr(gpEnv->tx_context); - } - return IRQ_HANDLED; -} - - -/** - @brief wpalRxIsr is the interrupt service routine which handles - the DXE RX Available interrupt - - wpalRxIsr is registered with the Operating System to handle the - DXE RX Available interrupt during system initalization. When a DXE - RX Available interrupt occurs, it is dispatched to the handler which - had previously been registered via wpalRegisterInterrupt. - - @param irq: Enumeration of the interrupt that occurred - @param dev_id: User-supplied data passed back via the ISR - - @see wpalRegisterInterrupt - - @return IRQ_HANDLED since it is a dedicated interrupt -*/ -static irqreturn_t wpalRxIsr -( - int irq, - void *dev_id -) -{ - if ((NULL != gpEnv) && (NULL != gpEnv->rx_isr)) { - gpEnv->rx_isr(gpEnv->rx_context); - } - return IRQ_HANDLED; -} - -/*---------------------------------------------------------------------------- - * Externalized Function Definitions - * -------------------------------------------------------------------------*/ - - -/** - @brief wpalRegisterInterrupt provides a mechansim for client - to register support for a given interrupt - - The DXE interface supports two interrupts, TX Complete and RX - Available. This interface provides the mechanism whereby a client - can register to support one of these. It is expected that the core - DXE implementation will invoke this API twice, once for each interrupt. - - @param intType: Enumeration of the interrupt type (TX or RX) - @param callbackFunction: ISR function pointer - @param usrCtxt: User context passed back whenever the - callbackFunction is invoked - - @return SUCCESS if the registration was successful -*/ - -wpt_status wpalRegisterInterrupt -( - wpt_uint32 intType, - wpalIsrType callbackFunction, - void *usrCtxt -) -{ - if (NULL == gpEnv) { - WPAL_TRACE(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "%s: invoked before subsystem initialized", - __func__); - return eWLAN_PAL_STATUS_E_INVAL; - } - - if (NULL == callbackFunction) { - WPAL_TRACE(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "%s: invoked with NULL callback", - __func__); - return eWLAN_PAL_STATUS_E_INVAL; - } - - switch (intType) { - - case DXE_INTERRUPT_TX_COMPLE: - if (NULL != gpEnv->tx_isr) { - /* TX complete handler already registered */ - WPAL_TRACE(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_WARN, - "%s: TX interrupt handler already registered", - __func__); - /* fall though and accept the new values */ - } - gpEnv->tx_isr = callbackFunction; - gpEnv->tx_context = usrCtxt; - break; - - case DXE_INTERRUPT_RX_READY: - if (NULL != gpEnv->rx_isr) { - /* RX complete handler already registered */ - WPAL_TRACE(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_WARN, - "%s: RX interrupt handler already registered", - __func__); - /* fall though and accept the new values */ - } - gpEnv->rx_isr = callbackFunction; - gpEnv->rx_context = usrCtxt; - break; - - default: - WPAL_TRACE(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "%s: Unknown interrupt type [%u]", - __func__, intType); - return eWLAN_PAL_STATUS_E_INVAL; - } - - return eWLAN_PAL_STATUS_SUCCESS; -} - -/** - @brief wpalUnRegisterInterrupt provides a mechansim for client - to un-register for a given interrupt - - When DXE stop, remove registered information from PAL - - @param intType: Enumeration of the interrupt type (TX or RX) - - @return NONE -*/ - -void wpalUnRegisterInterrupt -( - wpt_uint32 intType -) -{ - if (NULL == gpEnv) { - WPAL_TRACE(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "%s: invoked before subsystem initialized", - __func__); - return; - } - - switch (intType) { - - case DXE_INTERRUPT_TX_COMPLE: - disable_irq_nosync(gpEnv->tx_irq); - if (gpEnv->tx_registered) - { - free_irq(gpEnv->tx_irq, gpEnv); - gpEnv->tx_registered = 0; - } - gpEnv->tx_isr = NULL; - gpEnv->tx_context = NULL; - break; - - case DXE_INTERRUPT_RX_READY: - disable_irq_nosync(gpEnv->rx_irq); - if (gpEnv->rx_registered) - { - free_irq(gpEnv->rx_irq, gpEnv); - gpEnv->rx_registered = 0; - } - gpEnv->rx_isr = NULL; - gpEnv->rx_context = NULL; - break; - - default: - WPAL_TRACE(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "%s: Unknown interrupt type [%u]", - __func__, intType); - return; - } - - return; -} - -/** - @brief wpalEnableInterrupt provides a mechansim for a client - to request that a given interrupt be enabled - - The DXE interface supports two interrupts, TX Complete and RX - Available. This interface provides the mechanism whereby a client - can request that the platform-specific adaptation layer allows a - given interrupt to occur. The expectation is that if a given - interrupt is not enabled, if the interrupt occurs then the APPS CPU - will not be interrupted. - - @param intType: Enumeration of the interrupt type (TX or RX) - - @return SUCCESS if the interrupt was enabled -*/ -wpt_status wpalEnableInterrupt -( - wpt_uint32 intType -) -{ - int ret; - - switch (intType) - { - case DXE_INTERRUPT_RX_READY: - if (!gpEnv->rx_registered) - { - gpEnv->rx_registered = 1; - ret = request_irq(gpEnv->rx_irq, wpalRxIsr, IRQF_TRIGGER_HIGH, - "wcnss_wlan", gpEnv); - if (ret) { - WPAL_TRACE(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "%s: RX IRQ request failure", - __func__); - break; - } - - - ret = enable_irq_wake(gpEnv->rx_irq); - if (ret) { - WPAL_TRACE(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "%s: enable_irq_wake failed for RX IRQ", - __func__); - /* not fatal -- keep on going */ - } - } - else - { - enable_irq(gpEnv->rx_irq); - } - break; - case DXE_INTERRUPT_TX_COMPLE: - if (!gpEnv->tx_registered) - { - gpEnv->tx_registered = 1; - ret = request_irq(gpEnv->tx_irq, wpalTxIsr, IRQF_TRIGGER_HIGH, - "wcnss_wlan", gpEnv); - if (ret) { - WPAL_TRACE(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "%s: TX IRQ request failure", - __func__); - break; - } - - - ret = enable_irq_wake(gpEnv->tx_irq); - if (ret) { - WPAL_TRACE(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "%s: enable_irq_wake failed for TX IRQ", - __func__); - /* not fatal -- keep on going */ - } - } - else - { - enable_irq(gpEnv->tx_irq); - } - break; - default: - WPAL_TRACE(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "%s: unknown interrupt: %d", - __func__, (int)intType); - break; - } - /* on the integrated platform there is no platform-specific - interrupt control */ - return eWLAN_PAL_STATUS_SUCCESS; -} - -/** - @brief wpalDisableInterrupt provides a mechansim for a client - to request that a given interrupt be disabled - - The DXE interface supports two interrupts, TX Complete and RX - Available. This interface provides the mechanism whereby a client - can request that the platform-specific adaptation layer not allow a - given interrupt to occur. The expectation is that if a given - interrupt is not enabled, if the interrupt occurs then the APPS CPU - will not be interrupted. - - @param intType: Enumeration of the interrupt type (TX or RX) - - @return SUCCESS if the interrupt was disabled -*/ -wpt_status wpalDisableInterrupt -( - wpt_uint32 intType -) -{ - switch (intType) - { - case DXE_INTERRUPT_RX_READY: - disable_irq_nosync(gpEnv->rx_irq); - break; - case DXE_INTERRUPT_TX_COMPLE: - disable_irq_nosync(gpEnv->tx_irq); - break; - default: - WPAL_TRACE(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "%s: unknown interrupt: %d", - __func__, (int)intType); - break; - } - - /* on the integrated platform there is no platform-specific - interrupt control */ - return eWLAN_PAL_STATUS_SUCCESS; -} - -/** - @brief wpalWriteRegister provides a mechansim for a client - to write data into a hardware data register - - @param address: Physical memory address of the register - @param data: Data value to be written - - @return SUCCESS if the data was successfully written -*/ -wpt_status wpalWriteRegister -( - wpt_uint32 address, - wpt_uint32 data -) -{ - /* if SSR is in progress, and WCNSS is not out of reset (re-init - * not invoked), then do not access WCNSS registers */ - if (NULL == gpEnv || - (vos_is_logp_in_progress(VOS_MODULE_ID_WDI, NULL) && - !vos_is_reinit_in_progress(VOS_MODULE_ID_WDI, NULL))) { - WPAL_TRACE(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "%s: invoked before subsystem initialized", - __func__); - return eWLAN_PAL_STATUS_E_INVAL; - } - - if ((address < gpEnv->wcnss_memory->start) || - (address > gpEnv->wcnss_memory->end)) { - WPAL_TRACE(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "%s: Register address 0x%0x out of range 0x%0x - 0x%0x", - __func__, address, - (u32) gpEnv->wcnss_memory->start, - (u32) gpEnv->wcnss_memory->end); - return eWLAN_PAL_STATUS_E_INVAL; - } - - if (0 != (address & 0x3)) { - WPAL_TRACE(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "%s: Register address 0x%0x is not word aligned", - __func__, address); - return eWLAN_PAL_STATUS_E_INVAL; - } - - wmb(); - writel_relaxed(data, gpEnv->mmio + (address - WCNSS_BASE_ADDRESS)); - - return eWLAN_PAL_STATUS_SUCCESS; -} - -/** - @brief wpalReadRegister provides a mechansim for a client - to read data from a hardware data register - - @param address: Physical memory address of the register - @param data: Return location for value that is read - - @return SUCCESS if the data was successfully read -*/ -wpt_status wpalReadRegister -( - wpt_uint32 address, - wpt_uint32 *data -) -{ - /* if SSR is in progress, and WCNSS is not out of reset (re-init - * not invoked), then do not access WCNSS registers */ - if (NULL == gpEnv || - (vos_is_logp_in_progress(VOS_MODULE_ID_WDI, NULL) && - !vos_is_reinit_in_progress(VOS_MODULE_ID_WDI, NULL))) { - WPAL_TRACE(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "%s: invoked before subsystem initialized", - __func__); - return eWLAN_PAL_STATUS_E_INVAL; - } - - if ((address < gpEnv->wcnss_memory->start) || - (address > gpEnv->wcnss_memory->end)) { - WPAL_TRACE(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "%s: Register address 0x%0x out of range 0x%0x - 0x%0x", - __func__, address, - (u32) gpEnv->wcnss_memory->start, - (u32) gpEnv->wcnss_memory->end); - return eWLAN_PAL_STATUS_E_INVAL; - } - - if (0 != (address & 0x3)) { - WPAL_TRACE(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "%s: Register address 0x%0x is not word aligned", - __func__, address); - return eWLAN_PAL_STATUS_E_INVAL; - } - - *data = readl_relaxed(gpEnv->mmio + (address - WCNSS_BASE_ADDRESS)); - rmb(); - - return eWLAN_PAL_STATUS_SUCCESS; -} - -/** - @brief wpalWriteDeviceMemory provides a mechansim for a client - to write data into the hardware address space - - @param address: Start address of physical memory to be written - @param s_buffer: Virtual source address from which the data will - be read - @param len: Number of bytes of data to be written - - @return SUCCESS if the data was successfully written -*/ -wpt_status wpalWriteDeviceMemory -( - wpt_uint32 address, - wpt_uint8* s_buffer, - wpt_uint32 len -) -{ - /* if SSR is in progress, and WCNSS is not out of reset (re-init - * not invoked), then do not access WCNSS registers */ - if (NULL == gpEnv || - (vos_is_logp_in_progress(VOS_MODULE_ID_WDI, NULL) && - !vos_is_reinit_in_progress(VOS_MODULE_ID_WDI, NULL))) { - WPAL_TRACE(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "%s: invoked before subsystem initialized", - __func__); - return eWLAN_PAL_STATUS_E_INVAL; - } - - if ((address < gpEnv->wcnss_memory->start) || - ((address + len) > gpEnv->wcnss_memory->end)) { - WPAL_TRACE(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "%s: Memory address 0x%0x len %d out of range 0x%0x - 0x%0x", - __func__, address, len, - (u32) gpEnv->wcnss_memory->start, - (u32) gpEnv->wcnss_memory->end); - return eWLAN_PAL_STATUS_E_INVAL; - } - - vos_mem_copy(gpEnv->mmio + (address - WCNSS_BASE_ADDRESS), s_buffer, len); - wmb(); - - return eWLAN_PAL_STATUS_SUCCESS; -} - -/** - @brief wpalReadDeviceMemory provides a mechansim for a client - to read data from the hardware address space - - @param address: Start address of physical memory to be read - @param d_buffer: Virtual destination address to which the - data will be written - @param len: Number of bytes of data to be read - - @return SUCCESS if the data was successfully read -*/ -wpt_status wpalReadDeviceMemory -( - wpt_uint32 address, - wpt_uint8* d_buffer, - wpt_uint32 len -) -{ - /* if SSR is in progress, and WCNSS is not out of reset (re-init - * not invoked), then do not access WCNSS registers */ - if (NULL == gpEnv || - (vos_is_logp_in_progress(VOS_MODULE_ID_WDI, NULL) && - !vos_is_reinit_in_progress(VOS_MODULE_ID_WDI, NULL))) { - WPAL_TRACE(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "%s: invoked before subsystem initialized", - __func__); - return eWLAN_PAL_STATUS_E_INVAL; - } - - if ((address < gpEnv->wcnss_memory->start) || - ((address + len) > gpEnv->wcnss_memory->end)) { - WPAL_TRACE(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "%s: Memory address 0x%0x len %d out of range 0x%0x - 0x%0x", - __func__, address, len, - (u32) gpEnv->wcnss_memory->start, - (u32) gpEnv->wcnss_memory->end); - return eWLAN_PAL_STATUS_E_INVAL; - } - - vos_mem_copy(d_buffer, gpEnv->mmio + (address - WCNSS_BASE_ADDRESS), len); - rmb(); - - return eWLAN_PAL_STATUS_SUCCESS; -} - -/** - @brief wpalDeviceInit provides a mechanism to initialize the DXE - platform adaptation - - @param deviceCB: Implementation-specific device control block - - @see wpalDeviceClose - - @return SUCCESS if the DXE abstraction was opened -*/ -wpt_status wpalDeviceInit -( - void * deviceCB -) -{ - hdd_context_t *pHddCtx = (hdd_context_t *)deviceCB; - struct device *wcnss_device = pHddCtx->parent_dev; - struct resource *wcnss_memory; - int tx_irq; - int rx_irq; - - if (NULL != gpEnv) { - WPAL_TRACE(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "%s: invoked after subsystem initialized", - __func__); - return eWLAN_PAL_STATUS_E_INVAL; - } - - if (NULL == wcnss_device) { - WPAL_TRACE(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "%s: invalid device", - __func__); - return eWLAN_PAL_STATUS_E_INVAL; - } - - wcnss_memory = wcnss_wlan_get_memory_map(wcnss_device); - if (NULL == wcnss_memory) { - WPAL_TRACE(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "%s: WCNSS memory map unavailable", - __func__); - return eWLAN_PAL_STATUS_E_FAILURE; - } - - tx_irq = wcnss_wlan_get_dxe_tx_irq(wcnss_device); - if (0 > tx_irq) { - WPAL_TRACE(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "%s: WCNSS TX IRQ unavailable", - __func__); - return eWLAN_PAL_STATUS_E_FAILURE; - } - - rx_irq = wcnss_wlan_get_dxe_rx_irq(wcnss_device); - if (0 > rx_irq) { - WPAL_TRACE(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "%s: WCNSS RX IRQ unavailable", - __func__); - return eWLAN_PAL_STATUS_E_FAILURE; - } - - gpEnv = &gEnv; - if (NULL == gpEnv) { - WPAL_TRACE(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "%s: memory allocation failure", - __func__); - return eWLAN_PAL_STATUS_E_NOMEM; - } - - memset(gpEnv, 0, sizeof(*gpEnv)); - - gpEnv->wcnss_memory = wcnss_memory; - gpEnv->tx_irq = tx_irq; - gpEnv->rx_irq = rx_irq; - - /* note the we don't invoke request_mem_region(). - the memory described by wcnss_memory encompases the entire - register space (including BT and FM) and we do not want - exclusive access to that memory */ - - gpEnv->mmio = ioremap(wcnss_memory->start, resource_size(wcnss_memory)); - if (NULL == gpEnv->mmio) { - WPAL_TRACE(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "%s: memory remap failure", - __func__); - goto err_ioremap; - } - - gpEnv->tx_registered = 0; - gpEnv->rx_registered = 0; - - /* successfully allocated environment, memory and IRQs */ - return eWLAN_PAL_STATUS_SUCCESS; - - err_ioremap: - gpEnv = NULL; - - return eWLAN_PAL_STATUS_E_FAILURE; - -} - - -/** - @brief wpalDeviceClose provides a mechanism to deinitialize the DXE - platform adaptation - - @param deviceCB: Implementation-specific device control block - - @see wpalDeviceOpen - - @return SUCCESS if the DXE abstraction was closed -*/ -wpt_status wpalDeviceClose -( - void * deviceCB - ) -{ - if (NULL == gpEnv) { - WPAL_TRACE(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "%s: invoked before subsystem initialized", - __func__); - return eWLAN_PAL_STATUS_E_INVAL; - } - - if (gpEnv->rx_registered) - { - free_irq(gpEnv->rx_irq, gpEnv); - } - if (gpEnv->tx_registered) - { - free_irq(gpEnv->tx_irq, gpEnv); - } - iounmap(gpEnv->mmio); - gpEnv = NULL; - - return eWLAN_PAL_STATUS_SUCCESS; -} - -/** - @brief wpalNotifySmsm provides a mechansim for a client to - notify SMSM to start DXE engine and/or condition of Tx - ring buffer - - @param clrSt: bit(s) to be cleared on the MASK - @param setSt: bit(s) to be set on the MASK - - @return SUCCESS if the operation is successful -*/ -wpt_status wpalNotifySmsm -( - wpt_uint32 clrSt, - wpt_uint32 setSt -) -{ - int rc; - rc = smsm_change_state(SMSM_APPS_STATE, clrSt, setSt); - if(0 != rc) - { - WPAL_TRACE(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR, - "%s: smsm_change_state failed", - __func__); - return eWLAN_PAL_STATUS_E_FAILURE; - } - return eWLAN_PAL_STATUS_SUCCESS; -} diff --git a/CORE/WDI/WPAL/src/wlan_qct_pal_msg.c b/CORE/WDI/WPAL/src/wlan_qct_pal_msg.c deleted file mode 100644 index a093584a78ee..000000000000 --- a/CORE/WDI/WPAL/src/wlan_qct_pal_msg.c +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Copyright (c) 2012 The Linux Foundation. All rights reserved. - * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all - * copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL - * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/**========================================================================= - - \file wlan_qct_pal_msg.c - - \brief Implementation message APIs PAL exports. wpt = (Wlan Pal Type) wpal = (Wlan PAL) - - Definitions for platform with legacy UMAC support. - - ========================================================================*/ - -#include "wlan_qct_pal_msg.h" -#include "wlan_qct_pal_api.h" -#include "wlan_qct_pal_trace.h" -#include "vos_mq.h" - - - -/*--------------------------------------------------------------------------- - wpalPostCtrlMsg - Post a message to control context so it can be processed in that context. - Param: - pPalContext - A PAL context - pMsg - a pointer to called allocated opaque object; ----------------------------------------------------------------------------*/ -wpt_status wpalPostCtrlMsg(void *pPalContext, wpt_msg *pMsg) -{ - wpt_status status = eWLAN_PAL_STATUS_E_FAILURE; - vos_msg_t msg; - - if (NULL == pMsg) - { - WPAL_TRACE(eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_ERROR, - "%s: NULL message pointer", __func__); - WPAL_ASSERT(0); - return status; - } - - msg.type = 0; //This field is not used because VOSS doesn't check it. - msg.reserved = 0; - msg.bodyval = 0; - msg.bodyptr = pMsg; - if(VOS_IS_STATUS_SUCCESS(vos_mq_post_message(VOS_MQ_ID_WDI, &msg))) - { - status = eWLAN_PAL_STATUS_SUCCESS; - } - else - { - WPAL_TRACE(eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_ERROR, "%s fail to post msg %d", - __func__, pMsg->type); - } - - return status; -} - - - -/*--------------------------------------------------------------------------- - wpalPostTxMsg - Post a message to TX context so it can be processed in that context. - Param: - pPalContext - A PAL context PAL - pMsg - a pointer to called allocated opaque object; ----------------------------------------------------------------------------*/ -wpt_status wpalPostTxMsg(void *pPalContext, wpt_msg *pMsg) -{ - wpt_status status = eWLAN_PAL_STATUS_E_FAILURE; - vos_msg_t msg; - - if (NULL == pMsg) - { - WPAL_TRACE(eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_ERROR, - "%s: NULL message pointer", __func__); - WPAL_ASSERT(0); - return status; - } - - msg.type = 0; //This field is not used because VOSS doesn't check it. - msg.reserved = 0; - msg.bodyval = 0; - msg.bodyptr = pMsg; - if(VOS_IS_STATUS_SUCCESS(vos_tx_mq_serialize(VOS_MQ_ID_WDI, &msg))) - { - status = eWLAN_PAL_STATUS_SUCCESS; - } - else - { - WPAL_TRACE(eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_ERROR, "%s fail to post msg %d", - __func__, pMsg->type); - } - - return status; -} - - -/*--------------------------------------------------------------------------- - wpalPostRxMsg - Post a message to RX context so it can be processed in that context. - Param: - pPalContext - A PAL context - pMsg - a pointer to called allocated opaque object; ----------------------------------------------------------------------------*/ -wpt_status wpalPostRxMsg(void *pPalContext, wpt_msg *pMsg) -{ - wpt_status status = eWLAN_PAL_STATUS_E_FAILURE; - vos_msg_t msg; - - if (NULL == pMsg) - { - WPAL_TRACE(eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_ERROR, - "%s: NULL message pointer", __func__); - WPAL_ASSERT(0); - return status; - } - - msg.type = 0; //This field is not used because VOSS doesn't check it. - msg.reserved = 0; - msg.bodyval = 0; - msg.bodyptr = pMsg; - if(VOS_IS_STATUS_SUCCESS(vos_rx_mq_serialize(VOS_MQ_ID_WDI, &msg))) - { - status = eWLAN_PAL_STATUS_SUCCESS; - } - else - { - WPAL_TRACE(eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_ERROR, "%s fail to post msg %d", - __func__, pMsg->type); - } - - return status; -} diff --git a/CORE/WDI/WPAL/src/wlan_qct_pal_packet.c b/CORE/WDI/WPAL/src/wlan_qct_pal_packet.c deleted file mode 100644 index ea219d56d8c4..000000000000 --- a/CORE/WDI/WPAL/src/wlan_qct_pal_packet.c +++ /dev/null @@ -1,916 +0,0 @@ -/* - * Copyright (c) 2014 The Linux Foundation. All rights reserved. - * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all - * copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL - * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - - - -/**========================================================================= - - \file wlan_qct_pal_packet.c - - \brief Implementation for PAL packet. wpt = (Wlan Pal Type) wpal = (Wlan PAL) - - Definitions for platform with VOSS packet support and LA. - - ========================================================================*/ - -#include "wlan_qct_pal_packet.h" -#include "wlan_qct_pal_api.h" -#include "wlan_qct_pal_trace.h" -#include "vos_packet.h" -#include "vos_trace.h" -#include "vos_list.h" - -#include -#include "dma-mapping.h" - -/*Per spec definition*/ -#define WPAL_ETHERNET_PAKCET_HEADER_SIZE 14 - -/*Per spec definition - not including QOS field*/ -#define WPAL_802_11_PACKET_HEADER_SIZE 24 - -/*p is a pointer to wpt_packet*/ -#define WPAL_TO_VOS_PKT(p) ((vos_pkt_t *)(p)) - - -typedef struct -{ - void* pPhyAddr; - wpt_uint32 uLen; -}wpt_iterator_info; - -/* Storage for DXE CB function pointer */ -static wpalPacketLowPacketCB wpalPacketAvailableCB; - -/* Temp storage for transport channel DIAG/LOG information - * Each channel will update information with different context - * Before send stored date to DIAG, - * temporary it should be stored */ -static wpt_log_data_stall_type wpalTrasportStallInfo; - -/* - wpalPacketInit is no-op for VOSS-support wpt_packet -*/ -wpt_status wpalPacketInit(void *pPalContext) -{ - return eWLAN_PAL_STATUS_SUCCESS; -} - - -/* - wpalPacketClose is no-op for VOSS-support wpt_packet -*/ -wpt_status wpalPacketClose(void *pPalContext) -{ - return eWLAN_PAL_STATUS_SUCCESS; -} - -/*--------------------------------------------------------------------------- - wpalPacketRXLowResourceCB – RX RAW packer CB function - Param: - pPacket – Available RX packet - userData - PAL Client Context, DXE - Return: - Status ----------------------------------------------------------------------------*/ -VOS_STATUS wpalPacketRXLowResourceCB(vos_pkt_t *pPacket, v_VOID_t *userData) -{ - VOS_STATUS vosStatus = VOS_STATUS_E_FAILURE; - void* pData = NULL; - - if (NULL == pPacket) - { - WPAL_TRACE(eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_ERROR, - "Get new RX PAL packet fail"); - return VOS_STATUS_E_FAILURE; - } - vosStatus = vos_pkt_reserve_head_fast( pPacket, &pData, - VPKT_SIZE_BUFFER ); - if(VOS_STATUS_SUCCESS != vosStatus) - { - WPAL_TRACE(eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_ERROR, - "Prepare RX packet for DXE fail"); - return VOS_STATUS_E_FAILURE; - } - - if((NULL == wpalPacketAvailableCB) || (NULL == userData)) - { - WPAL_TRACE(eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_ERROR, - "Invalid ARG for new RX packet"); - return VOS_STATUS_E_FAILURE; - } - - wpalPacketAvailableCB( (wpt_packet *)pPacket, userData ); - - return VOS_STATUS_SUCCESS; -} - -/*--------------------------------------------------------------------------- - wpalPacketAlloc – Allocate a wpt_packet from PAL. - Param: - pktType – specify the type of wpt_packet to allocate - nPktSize - packet size - Return: - A pointer to the wpt_packet. NULL means fail. ----------------------------------------------------------------------------*/ -wpt_packet * wpalPacketAlloc(wpt_packet_type pktType, wpt_uint32 nPktSize, - wpalPacketLowPacketCB rxLowCB, void *usrData) -{ - VOS_STATUS vosStatus = VOS_STATUS_E_FAILURE; - wpt_packet* pPkt = NULL; - vos_pkt_t* pVosPkt = NULL; - void* pData = NULL; - v_U16_t allocLen; - /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ - - switch (pktType) - { - case eWLAN_PAL_PKT_TYPE_TX_802_11_MGMT: - vosStatus = vos_pkt_get_packet(&pVosPkt, VOS_PKT_TYPE_TX_802_11_MGMT, - nPktSize, 1, VOS_FALSE, - NULL, NULL /*no callback*/); - break; - - case eWLAN_PAL_PKT_TYPE_RX_RAW: - /* Set the wpalPacketAvailableCB before we try to get a VOS - * packet from the 'free list' and reset it if vos_pkt_get_packet() - * returns a valid packet. This order is required to avoid the - * race condition: - * 1. The below call to vos_pkt_get_packet() in RX_Thread determines - * that no more packets are available in the 'free list' and sets - * the low resource callbacks. - * 2. in parallel vos_pkt_return_packet() is called in MC_Thread for a - * Management frame before wpalPacketAlloc() gets a chance to set - * wpalPacketAvailableCB and since the 'low resource callbacks' - * are set the callback function - wpalPacketRXLowResourceCB is - * executed,but since wpalPacketAvailableCB is still NULL the low - * resource recovery fails. - */ - wpalPacketAvailableCB = rxLowCB; - - vosStatus = vos_pkt_get_packet(&pVosPkt, VOS_PKT_TYPE_RX_RAW, - nPktSize, 1, VOS_FALSE, - wpalPacketRXLowResourceCB, usrData); - -#ifndef FEATURE_R33D - /* Reserve the entire raw rx buffer for DXE */ - if( vosStatus == VOS_STATUS_SUCCESS ) - { - wpalPacketAvailableCB = NULL; - vosStatus = vos_pkt_reserve_head_fast( pVosPkt, &pData, nPktSize ); - } -#endif /* FEATURE_R33D */ - if((NULL != pVosPkt) && (VOS_STATUS_E_RESOURCES != vosStatus)) - { - vos_pkt_get_packet_length(pVosPkt, &allocLen); - if (nPktSize != allocLen) - { - WPAL_TRACE(eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_ERROR, - "RX packet alloc has problem, discard this frame, Len %d", allocLen); - vos_pkt_return_packet(pVosPkt); - return NULL; - } - } - break; - - default: - WPAL_TRACE(eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_ERROR, - " try to allocate unsupported packet type (%d)", pktType); - break; - } - - if(VOS_IS_STATUS_SUCCESS(vosStatus)) - { - pPkt = (wpt_packet *)pVosPkt; - } - - - return pPkt; -}/*wpalPacketAlloc*/ - - - -/*--------------------------------------------------------------------------- - wpalPacketFree – Free a wpt_packet chain for one particular type. - For our legacy UMAC, it is not needed because vos_packet contains pal_packet. - Param: - pPkt – pointer to a wpt_packet - Return: - eWLAN_PAL_STATUS_SUCCESS - success ----------------------------------------------------------------------------*/ -wpt_status wpalPacketFree(wpt_packet *pPkt) -{ - VOS_STATUS vosStatus; - - if(NULL != pPkt->pInternalData) - { - wpalMemoryFree(pPkt->pInternalData); - } - vosStatus = vos_pkt_return_packet(WPAL_TO_VOS_PKT(pPkt)); - - //With VOSS support, we can cast between wpt_status and VOS_STATUS - return (wpt_status)vosStatus; -}/*wpalPacketFree*/ - - -/*--------------------------------------------------------------------------- - wpalPacketGetLength – Get number of bytes in a wpt_packet. It include the - bytes in a BD if it exist. - Param: - pPkt - pointer to a packet to be freed. - Return: - Length of the data include layer-2 headers. For example, if the frame - is 802.3, the length includes the ethernet header. ----------------------------------------------------------------------------*/ -wpt_uint32 wpalPacketGetLength(wpt_packet *pPkt) -{ - v_U16_t len = 0, pktLen = 0; - - // Validate the parameter pointers - if (unlikely(NULL == pPkt)) - { - WPAL_TRACE(eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_ERROR, - "%s : NULL packet pointer", __func__); - return eWLAN_PAL_STATUS_E_INVAL; - } - - - if( WPAL_PACKET_GET_BD_POINTER(pPkt) ) - { - len = WPAL_PACKET_GET_BD_LENGTH(pPkt); - } - if( VOS_IS_STATUS_SUCCESS(vos_pkt_get_packet_length(WPAL_TO_VOS_PKT(pPkt), &pktLen)) ) - { - len += pktLen; - } - else - { - WPAL_TRACE(eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_ERROR, "%s failed", - __func__); - } - - return ((wpt_uint32)len); -}/*wpalPacketGetLength*/ - - -/*--------------------------------------------------------------------------- - wpalPacketRawTrimHead – Move the starting offset and return the head pointer - before the moving. The function can only be used with raw packets, - whose buffer is one piece and allocated by WLAN driver. This also - reduce the length of the packet. - Param: - pPkt - pointer to a wpt_packet. - size – number of bytes to take off the head. - Return: - A pointer to the original buffer head before the trimming. ----------------------------------------------------------------------------*/ -wpt_status wpalPacketRawTrimHead(wpt_packet *pPkt, wpt_uint32 size) -{ - wpt_status status = eWLAN_PAL_STATUS_SUCCESS; - - // Validate the parameter pointers - if (unlikely(NULL == pPkt)) - { - WPAL_TRACE(eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_ERROR, - "%s : NULL packet pointer", __func__); - return eWLAN_PAL_STATUS_E_INVAL; - } - - if (!((eWLAN_PAL_PKT_TYPE_TX_802_11_MGMT == WPAL_PACKET_GET_TYPE(pPkt)) || - (eWLAN_PAL_PKT_TYPE_RX_RAW == WPAL_PACKET_GET_TYPE(pPkt)))) - { - WPAL_TRACE(eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_ERROR, - "%s : neither 80211 managment packet nor RAW packet", __func__); - VOS_ASSERT(0); - return eWLAN_PAL_STATUS_E_INVAL; - } - if( !VOS_IS_STATUS_SUCCESS(vos_pkt_trim_head(WPAL_TO_VOS_PKT(pPkt), (v_SIZE_t)size)) ) - { - WPAL_TRACE(eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_ERROR, "%s Invalid trim(%d)", - __func__, size); - status = eWLAN_PAL_STATUS_E_INVAL; - } - - return status; -}/*wpalPacketRawTrimHead*/ - -/*--------------------------------------------------------------------------- - wpalPacketRawTrimTail – reduce the length of the packet. - Param: - pPkt - pointer to a wpt_packet. - size – number of bytes to take of the packet length - Return: - eWLAN_PAL_STATUS_SUCCESS – success. Otherwise fail. ----------------------------------------------------------------------------*/ -wpt_status wpalPacketRawTrimTail(wpt_packet *pPkt, wpt_uint32 size) -{ - wpt_status status = eWLAN_PAL_STATUS_SUCCESS; - - // Validate the parameter pointers - if (unlikely(NULL == pPkt)) - { - WPAL_TRACE(eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_ERROR, - "%s : NULL packet pointer", __func__); - return eWLAN_PAL_STATUS_E_INVAL; - } - - if (!((eWLAN_PAL_PKT_TYPE_TX_802_11_MGMT == WPAL_PACKET_GET_TYPE(pPkt)) || - (eWLAN_PAL_PKT_TYPE_RX_RAW == WPAL_PACKET_GET_TYPE(pPkt)))) - { - WPAL_TRACE(eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_ERROR, - "%s : neither 80211 managment packet nor RAW packet", __func__); - VOS_ASSERT(0); - return eWLAN_PAL_STATUS_E_INVAL; - } - - if( !VOS_IS_STATUS_SUCCESS(vos_pkt_trim_tail(WPAL_TO_VOS_PKT(pPkt), (v_SIZE_t)size)) ) - { - WPAL_TRACE(eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_ERROR, "%s Invalid trim(%d)", - __func__, size); - status = eWLAN_PAL_STATUS_E_INVAL; - } - - return status; -}/*wpalPacketRawTrimTail*/ - - -/*--------------------------------------------------------------------------- - wpalPacketGetRawBuf – Return the starting buffer virtual address for the RAW flat buffer - It is inline in hope of faster implementation for certain platform. For Winxp, it - will be slow. - Param: - pPkt - pointer to a wpt_packet. - Return: - NULL - fail. - Otherwise the address of the starting of the buffer ----------------------------------------------------------------------------*/ -wpt_uint8 *wpalPacketGetRawBuf(wpt_packet *pPkt) -{ - wpt_uint8 *pRet = NULL; - - // Validate the parameter pointers - if (unlikely(NULL == pPkt)) - { - WPAL_TRACE(eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_ERROR, - "%s : NULL packet pointer", __func__); - return NULL; - } - - //Since it is a flat buffer, all we need is to get one byte of offset 0 - if( (eWLAN_PAL_PKT_TYPE_RX_RAW == WPAL_PACKET_GET_TYPE(pPkt)) || - (eWLAN_PAL_PKT_TYPE_TX_802_11_MGMT == WPAL_PACKET_GET_TYPE(pPkt)) ) - { - vos_pkt_peek_data(WPAL_TO_VOS_PKT(pPkt), 0, (v_VOID_t**)&pRet, 1); - WPAL_ASSERT(NULL != pRet); - } - - return pRet; -}/*wpalPacketGetRawBuf*/ - - -/*--------------------------------------------------------------------------- - wpalPacketSetRxLength – Set the valid data length on a RX packet. This function must - be called once per RX packet per receiving. It indicates the available data length from - the start of the buffer. - Param: - pPkt - pointer to a wpt_packet. - Return: - NULL - fail. - Otherwise the address of the starting of the buffer ----------------------------------------------------------------------------*/ -wpt_status wpalPacketSetRxLength(wpt_packet *pPkt, wpt_uint32 len) -{ - // Validate the parameter pointers - if (unlikely(NULL == pPkt)) - { - WPAL_TRACE(eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_ERROR, - "%s : NULL packet pointer", __func__); - return eWLAN_PAL_STATUS_E_INVAL; - } - - /*Only allowed for RX Raw packets */ - if( (eWLAN_PAL_PKT_TYPE_RX_RAW != WPAL_PACKET_GET_TYPE(pPkt))) - { - WPAL_TRACE(eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_ERROR, - "%s Invalid packet type(%d)", __func__, - WPAL_PACKET_GET_TYPE(pPkt)); - return eWLAN_PAL_STATUS_E_INVAL; - } - - if(VOS_IS_STATUS_SUCCESS(vos_pkt_set_rx_length(WPAL_TO_VOS_PKT(pPkt), len))) - { - return eWLAN_PAL_STATUS_SUCCESS; - } - else - { - return eWLAN_PAL_STATUS_E_INVAL; - } -}/*wpalPacketSetRxLength*/ - -/* - Set of helper functions that will prepare packet for DMA transfer, - based on the type of transfer : - to and from the device - - following these calls the packet will be locked for DMA only, - CPU will not be able to modify it => the packet must be explicitly returned to - the CPU once the DMA transfer is complete -*/ -WPT_STATIC WPT_INLINE void* itGetOSPktAddrForDevice( wpt_packet *pPacket ) -{ - struct sk_buff *skb; - /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ - if ( VOS_STATUS_SUCCESS != - vos_pkt_get_os_packet(WPAL_TO_VOS_PKT(pPacket), (void**)&skb, VOS_FALSE )) - { - return NULL; - } - else - { - /*Map skb data into dma-able memory - (changes will be commited from cache) */ - return (void*)dma_map_single( NULL, skb->data, skb->len, DMA_TO_DEVICE ); - } -}/*itGetOSPktAddrForDevice*/ - -WPT_STATIC WPT_INLINE void* itGetOSPktAddrFromDevice( wpt_packet *pPacket ) -{ - - struct sk_buff *skb; - /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ - if ( VOS_STATUS_SUCCESS != - vos_pkt_get_os_packet(WPAL_TO_VOS_PKT(pPacket), (void**)&skb, VOS_FALSE )) - { - return NULL; - } - else - { - /*Map skb data into dma-able memory - (changes will be commited from cache) */ - return (void*)dma_map_single( NULL, skb->data, skb->len, DMA_FROM_DEVICE ); - } -}/*itGetOSPktAddrFromDevice*/ - -/* - Set of helper functions that will return a DMA-ed packet to the CPU, - based on the type of transfer : - to and from the device -*/ -WPT_STATIC WPT_INLINE void itReturnOSPktAddrForDevice( wpt_packet *pPacket, void* addr, wpt_uint32 size ) -{ - - dma_unmap_single( NULL, (dma_addr_t)addr, size, DMA_TO_DEVICE ); -} - -WPT_STATIC WPT_INLINE void itReturnOSPktAddrFromDevice( wpt_packet *pPacket, void* addr, wpt_uint32 size ) -{ - - dma_unmap_single( NULL, (dma_addr_t)addr, size, DMA_FROM_DEVICE ); -} - - -/*--------------------------------------------------------------------------- - wpalIteratorInit – Initialize an interator by updating pCur to first item. - Param: - pIter – pointer to a caller allocated wpt_iterator - pPacket – pointer to a wpt_packet - Return: - eWLAN_PAL_STATUS_SUCCESS - success ----------------------------------------------------------------------------*/ -wpt_status wpalIteratorInit(wpt_iterator *pIter, wpt_packet *pPacket) -{ - wpt_status status = eWLAN_PAL_STATUS_SUCCESS; - wpt_iterator_info* pCurInfo = NULL; - wpt_iterator_info* pNextInfo = NULL; - wpt_iterator_info* pPktInfo = NULL; - - // Validate the parameter pointers - if (unlikely((NULL == pPacket)||(NULL==pIter))) - { - WPAL_TRACE(eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_ERROR, - "%s : NULL input pointers %p %p", __func__, pPacket, pIter); - return eWLAN_PAL_STATUS_E_INVAL; - } - - pPktInfo = (wpt_iterator_info*)pPacket->pInternalData; - if (unlikely(NULL == pPktInfo)) - { - WPAL_TRACE(eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_ERROR, - "%s : Invalid Packet Info", __func__); - return eWLAN_PAL_STATUS_E_INVAL; - } - - // if there is NO BD on this frame, then initialize the next pointer to - // point the first fragment. - if ( NULL == WPAL_PACKET_GET_BD_PHYS(pPacket) ) - { - pCurInfo = pPktInfo; - pNextInfo = NULL; - } - else - { - /*Allocate memory for the current info*/ - pCurInfo = wpalMemoryAllocate( sizeof(wpt_iterator_info) ); - - // Validate the memory allocation - if (unlikely(NULL == pCurInfo)) - { - WPAL_TRACE(eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_ERROR, - "%s : Failed to allocate memory ", __func__); - return eWLAN_PAL_STATUS_E_INVAL; - } - - pCurInfo->pPhyAddr = WPAL_PACKET_GET_BD_PHYS(pPacket); - pCurInfo->uLen = WPAL_PACKET_GET_BD_LENGTH(pPacket); - - pNextInfo = pPktInfo; - } - - pIter->pCur = (void*)pCurInfo; - pIter->pNext = (void*)pNextInfo; - pIter->pContext = NULL; - - return status; -}/*wpalIteratorInit*/ - -/*--------------------------------------------------------------------------- - wpalIteratorNext – Get the address for the next item - Param: - pIter – pointer to a caller allocated wpt_iterator - pPacket – pointer to a wpt_packet - ppAddr – Caller allocated pointer to return the address of the item. - For DMA-able devices, this is the physical address of the item. - pLen – To return the number of bytes in the item. - Return: - eWLAN_PAL_STATUS_SUCCESS - success ----------------------------------------------------------------------------*/ -wpt_status wpalIteratorNext(wpt_iterator *pIter, wpt_packet *pPacket, void **ppAddr, wpt_uint32 *pLen) -{ - wpt_iterator_info* pCurInfo = NULL; - /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ - - /*------------------------------------------------------------------------- - Sanity check - -------------------------------------------------------------------------*/ - if (unlikely(( NULL == pIter )||( NULL == pPacket ) || - ( NULL == ppAddr ) || ( NULL == pLen ))) - { - WPAL_TRACE(eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_ERROR, - "%s Invalid input parameters", __func__ ); - return eWLAN_PAL_STATUS_E_INVAL; - } - - pCurInfo = (wpt_iterator_info*)pIter->pCur; - /*------------------------------------------------------------------------- - If current pointer is NULL - there is no data in the packet - return - -------------------------------------------------------------------------*/ - if( pIter->pCur == NULL ) - { - *ppAddr = NULL; - *pLen = 0; - return eWLAN_PAL_STATUS_SUCCESS; - } - - /*Address and length are kept in the current field*/ - *ppAddr = pCurInfo->pPhyAddr; - *pLen = pCurInfo->uLen; - - if( NULL == pIter->pNext ) - { - /*Save the iterator for cleanup*/ - pPacket->pInternalData = pIter->pCur; - pIter->pCur = NULL; - } - else - { - /*Release the memory saved for storing the BD information*/ - wpalMemoryFree(pCurInfo); - - /*For LA - the packet is represented by maximum 2 fields of data - - BD and actual data from sk buff */ - pIter->pCur = pIter->pNext; - pIter->pNext = NULL; - } - - return eWLAN_PAL_STATUS_SUCCESS; -} - -/*--------------------------------------------------------------------------- - wpalLockPacketForTransfer – Map the data buffer from dma so that the - data is commited from cache and the cpu relinquishes - ownership of the buffer - - Param: - pPacket – pointer to a wpt_packet - - Return: - eWLAN_PAL_STATUS_SUCCESS - success ----------------------------------------------------------------------------*/ -wpt_status wpalLockPacketForTransfer( wpt_packet *pPacket) -{ - void* pPhyData = NULL; - wpt_iterator_info* pInfo = NULL; - v_U16_t uLenData = 0; - - // Validate the parameter pointers - if (unlikely(NULL == pPacket)) - { - WPAL_TRACE(eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_ERROR, - "%s : NULL input pointer", __func__); - return eWLAN_PAL_STATUS_E_INVAL; - } - - switch(WPAL_PACKET_GET_TYPE(pPacket)) - { - /* For management frames, BD is allocated by WDI, header is in raw buffer, - rest of the frame is also in raw buffer */ - case eWLAN_PAL_PKT_TYPE_TX_802_11_MGMT: - { - /*TX Packets need to be DMA-ed to the device, perform DMA mapping - accordingly */ - pPhyData = (void*)itGetOSPktAddrForDevice( pPacket ); - } - break; - /* Data packets - BD (allocated by WDI), header (in VOSS header), - rest of the packet (DSM items) */ - case eWLAN_PAL_PKT_TYPE_TX_802_11_DATA: - case eWLAN_PAL_PKT_TYPE_TX_802_3_DATA: - { - /*TX Packets need to be DMA-ed to the device, perform DMA mapping - accordingly */ - pPhyData = (void*)itGetOSPktAddrForDevice( pPacket ); - } - break; - - /* For Raw RX, BD + header + rest of the packet is all contained in the raw - buffer */ - case eWLAN_PAL_PKT_TYPE_RX_RAW: - { - /*RX Packets need to be DMA-ed from the device, perform DMA mapping - accordingly */ - pPhyData = (void*)itGetOSPktAddrFromDevice( pPacket ); - } - break; - - default: - { - WPAL_TRACE(eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_ERROR, - " WLAN_PAL: %s: Invalid packet type %d!", __func__, - WPAL_PACKET_GET_TYPE(pPacket) ); - WPAL_ASSERT(0); - return eWLAN_PAL_STATUS_E_FAILURE; - } - } - - /*Get packet length*/ - vos_pkt_get_packet_length(WPAL_TO_VOS_PKT(pPacket),&uLenData); - - /*Allocate memory for the current info*/ - pInfo = wpalMemoryAllocate( sizeof(wpt_iterator_info) ); - - // Validate the memory allocation - if (unlikely(NULL == pInfo)) - { - WPAL_TRACE(eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_ERROR, - "%s : Failed to allocate memory ", __func__); - return eWLAN_PAL_STATUS_E_INVAL; - } - - pInfo->pPhyAddr = pPhyData; - pInfo->uLen = uLenData; - - pPacket->pInternalData = pInfo; - return eWLAN_PAL_STATUS_SUCCESS; -}/*wpalLockPacketForTransfer*/ - -/*--------------------------------------------------------------------------- - wpalUnlockPacket – Unmap the data buffer from dma so that cpu can regain - ownership on it - Param: - pPacket – pointer to a wpt_packet - - Return: - eWLAN_PAL_STATUS_SUCCESS - success ----------------------------------------------------------------------------*/ -wpt_status wpalUnlockPacket( wpt_packet *pPacket) -{ - - wpt_iterator_info* pInfo; - - // Validate the parameter pointers - if (unlikely(NULL == pPacket)) - { - WPAL_TRACE(eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_ERROR, - "%s : NULL input pointer pPacket", __func__); - return eWLAN_PAL_STATUS_E_INVAL; - } - - pInfo = (wpt_iterator_info*)pPacket->pInternalData; - - // Validate pInfo - if (unlikely(NULL == pInfo)) - { - WPAL_TRACE(eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_FATAL, - "%s : NULL input pointer pInfo", __func__); - return eWLAN_PAL_STATUS_E_INVAL; - } - - switch(WPAL_PACKET_GET_TYPE(pPacket)) - { - /* For management frames, BD is allocated by WDI, header is in raw buffer, - rest of the frame is also in raw buffer */ - case eWLAN_PAL_PKT_TYPE_TX_802_11_MGMT: - { - /*TX Packets need to be DMA-ed to the device, perform DMA mapping - accordingly */ - itReturnOSPktAddrForDevice(pPacket, pInfo->pPhyAddr, pInfo->uLen); - } - break; - /* Data packets - BD (allocated by WDI), header (in VOSS header), - rest of the packet (DSM items) */ - case eWLAN_PAL_PKT_TYPE_TX_802_11_DATA: - case eWLAN_PAL_PKT_TYPE_TX_802_3_DATA: - { - /*TX Packets need to be DMA-ed to the device, perform DMA mapping - accordingly */ - itReturnOSPktAddrForDevice(pPacket, pInfo->pPhyAddr, pInfo->uLen); - } - break; - - /* For Raw RX, BD + header + rest of the packet is all contained in the raw - buffer */ - case eWLAN_PAL_PKT_TYPE_RX_RAW: - { - /*RX Packets need to be DMA-ed from the device, perform DMA mapping - accordingly */ - if(NULL == pInfo->pPhyAddr) - { - WPAL_TRACE(eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_ERROR, - " WLAN_PAL: %s: RX frame was not locked properly", __func__); - } - else - { - itReturnOSPktAddrFromDevice(pPacket, pInfo->pPhyAddr, pInfo->uLen); - } - } - break; - - default: - { - WPAL_TRACE(eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_ERROR, - " WLAN_PAL: %s: Invalid packet type %d!", __func__, - WPAL_PACKET_GET_TYPE(pPacket) ); - WPAL_ASSERT(0); - return eWLAN_PAL_STATUS_E_FAILURE; - } - } - - wpalMemoryFree(pInfo); - pPacket->pInternalData = NULL; - return eWLAN_PAL_STATUS_SUCCESS; -}/*wpalUnlockPacket*/ - -/*--------------------------------------------------------------------------- - wpalIsPacketLocked – Check whether the Packet is locked for DMA. - Param: - pPacket – pointer to a wpt_packet - - Return: - eWLAN_PAL_STATUS_SUCCESS - eWLAN_PAL_STATUS_E_FAILURE - eWLAN_PAL_STATUS_E_INVAL ----------------------------------------------------------------------------*/ -wpt_status wpalIsPacketLocked( wpt_packet *pPacket) -{ - - wpt_iterator_info* pInfo; - - /* Validate the parameter pointers */ - if (NULL == pPacket) - { - WPAL_TRACE(eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_WARN, - "%s : NULL input pointer", __func__); - return eWLAN_PAL_STATUS_E_INVAL; - } - - /* Validate pInternalData */ - pInfo = (wpt_iterator_info*)pPacket->pInternalData; - return (NULL == pInfo)? eWLAN_PAL_STATUS_E_FAILURE : - eWLAN_PAL_STATUS_SUCCESS; -}/*wpalIsPacketLocked*/ - -/*--------------------------------------------------------------------------- - wpalGetNumRxRawPacket Query available RX RAW total buffer count - param: - numRxResource pointer of queried value - - return: - eWLAN_PAL_STATUS_SUCCESS ----------------------------------------------------------------------------*/ -wpt_status wpalGetNumRxRawPacket(wpt_uint32 *numRxResource) -{ - *numRxResource = (wpt_uint32)vos_pkt_get_num_of_rx_raw_pkts(); - - return eWLAN_PAL_STATUS_SUCCESS; -} - -/*--------------------------------------------------------------------------- - wpalPacketStallUpdateInfo – Update each channel information when stall - detected, also power state and free resource count - - Param: - powerState ? WLAN system power state when stall detected - numFreeBd ? Number of free resource count in HW - channelInfo ? Each channel specific information when stall happen - channelNum ? Channel number update information - - Return: - NONE - ----------------------------------------------------------------------------*/ -void wpalPacketStallUpdateInfo -( - v_U32_t *powerState, - v_U32_t *numFreeBd, - wpt_log_data_stall_channel_type *channelInfo, - v_U8_t channelNum -) -{ - /* Update power state when stall detected */ - if(NULL != powerState) - { - wpalTrasportStallInfo.PowerState = *powerState; - } - - /* Update HW free resource count */ - if(NULL != numFreeBd) - { - wpalTrasportStallInfo.numFreeBd = *numFreeBd; - } - - /* Update channel information */ - if(NULL != channelInfo) - { - wpalMemoryCopy(&wpalTrasportStallInfo.dxeChannelInfo[channelNum], - channelInfo, - sizeof(wpt_log_data_stall_channel_type)); - } - - return; -} - -#ifdef FEATURE_WLAN_DIAG_SUPPORT -/*--------------------------------------------------------------------------- - wpalPacketStallDumpLog – Trigger to send log packet to DIAG - Updated transport system information will be sent to DIAG - - Param: - NONE - - Return: - NONE - ----------------------------------------------------------------------------*/ -void wpalPacketStallDumpLog -( - void -) -{ - vos_log_data_stall_type *log_ptr = NULL; - - WLAN_VOS_DIAG_LOG_ALLOC(log_ptr, vos_log_data_stall_type, LOG_TRSP_DATA_STALL_C); - if(log_ptr) - { - log_ptr->PowerState = wpalTrasportStallInfo.PowerState; - log_ptr->numFreeBd = wpalTrasportStallInfo.numFreeBd; - wpalMemoryCopy(&log_ptr->dxeChannelInfo[0], - &wpalTrasportStallInfo.dxeChannelInfo[0], - WPT_NUM_TRPT_CHANNEL * sizeof(vos_log_data_stall_channel_type)); - pr_info("Stall log dump"); - WLAN_VOS_DIAG_LOG_REPORT(log_ptr); - } - - return; -} -#endif /* FEATURE_WLAN_DIAG_SUPPORT */ diff --git a/CORE/WDI/WPAL/src/wlan_qct_pal_sync.c b/CORE/WDI/WPAL/src/wlan_qct_pal_sync.c deleted file mode 100644 index 0615d49a0e8d..000000000000 --- a/CORE/WDI/WPAL/src/wlan_qct_pal_sync.c +++ /dev/null @@ -1,245 +0,0 @@ -/* - * Copyright (c) 2014 The Linux Foundation. All rights reserved. - * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all - * copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL - * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - - - -/**========================================================================= - - \file wlan_qct_pal_sync.c - - \brief Implementation trace/logging APIs PAL exports. wpt = (Wlan Pal Type) wpal = (Wlan PAL) - - Definitions for platform Windows and with legacy UMAC. - - ========================================================================*/ - -#include "wlan_qct_pal_sync.h" -#include "wlan_qct_pal_trace.h" - -#include "wlan_qct_os_status.h" - -/** -wpalMutexInit() - -@brief - This function initializes a mutex object - -@param pMutex: a pointer to caller allocated object of wpt_mutex - -@return eWLAN_PAL_STATUS_SUCCESS if success. Fail otherwise. - -*/ -wpt_status wpalMutexInit(wpt_mutex *pMutex) -{ - /* Not doing sanity checks since VOS does them anyways */ - - if( vos_lock_init( (vos_lock_t*)pMutex ) != VOS_STATUS_SUCCESS ) - { - WPAL_TRACE(eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_ERROR, - " mutex init fail"); - return eWLAN_PAL_STATUS_E_FAILURE; - } - - return eWLAN_PAL_STATUS_SUCCESS; -} - -/*--------------------------------------------------------------------------- - @brief Invalidate a mutex object - - \param pMutex - a pointer to caller allocated object of wpt_mutex - - \return eWLAN_PAL_STATUS_SUCCESS if success. Fail otherwise. ----------------------------------------------------------------------------*/ -wpt_status wpalMutexDelete(wpt_mutex *pMutex) -{ - /* Not doing sanity checks since VOS does them anyways */ - - if( vos_lock_destroy( (vos_lock_t*)pMutex ) != VOS_STATUS_SUCCESS ) - { - WPAL_TRACE(eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_ERROR, - " mutex delete fail"); - return eWLAN_PAL_STATUS_E_FAILURE; - } - - return eWLAN_PAL_STATUS_SUCCESS; -} - -/*--------------------------------------------------------------------------- - @brief Acquire a mutex object. It is blocked until the object is acquired. - - \param pMutex - a pointer to caller allocated object of wpt_mutex - - \return eWLAN_PAL_STATUS_SUCCESS if success. Fail otherwise. ----------------------------------------------------------------------------*/ -wpt_status wpalMutexAcquire(wpt_mutex *pMutex) -{ - /* Not doing sanity checks since VOS does them anyways */ - - if( vos_lock_acquire( (vos_lock_t*)pMutex ) != VOS_STATUS_SUCCESS ) - { - WPAL_TRACE(eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_ERROR, - " mutex acquire fail"); - return eWLAN_PAL_STATUS_E_FAILURE; - } - - return eWLAN_PAL_STATUS_SUCCESS; -} - -/*--------------------------------------------------------------------------- - @brief Release a held mutex object - - \param pMutex - a pointer to caller allocated object of wpt_mutex - - \return eWLAN_PAL_STATUS_SUCCESS if success. Fail otherwise. ----------------------------------------------------------------------------*/ -wpt_status wpalMutexRelease(wpt_mutex *pMutex) -{ - /* Not doing sanity checks since VOS does them anyways */ - - if( vos_lock_release( (vos_lock_t*)pMutex ) != VOS_STATUS_SUCCESS ) - { - WPAL_TRACE(eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_ERROR, - " mutex release"); - return eWLAN_PAL_STATUS_E_FAILURE; - } - - return eWLAN_PAL_STATUS_SUCCESS; -} - -/*--------------------------------------------------------------------------- - @brief Initialize an event object - - \param pEvent – a pointer to caller allocated object of wpt_event - - \return eWLAN_PAL_STATUS_SUCCESS if success. Fail otherwise. -------------------------------------------------------------------------*/ -wpt_status wpalEventInit(wpt_event *pEvent) -{ - /* Not doing sanity checks since VOS does them anyways */ - - if( vos_event_init( (vos_event_t*)pEvent ) != VOS_STATUS_SUCCESS ) - { - WPAL_TRACE(eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_ERROR, - " create event fail"); - return eWLAN_PAL_STATUS_E_FAILURE; - } - - return eWLAN_PAL_STATUS_SUCCESS; -} - -/*--------------------------------------------------------------------------- - @brief Invalidate an event object - - \param pEvent – a pointer to caller allocated object of wpt_event - - \return eWLAN_PAL_STATUS_SUCCESS if success. Fail otherwise. -------------------------------------------------------------------------*/ - -wpt_status wpalEventDelete(wpt_event *pEvent) -{ - /* Not doing sanity checks since VOS does them anyways */ - - if( vos_event_destroy( (vos_event_t*)pEvent ) != VOS_STATUS_SUCCESS ) - { - WPAL_TRACE(eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_ERROR, - " delete event fail"); - return eWLAN_PAL_STATUS_E_FAILURE; - } - - return eWLAN_PAL_STATUS_SUCCESS; -} - -/*--------------------------------------------------------------------------- - @brief wpalEventWait – Wait on an event object - - \param - pEvent – a pointer to caller allocated object of wpt_event - timeout - timeout value at unit of milli-seconds. - 0xffffffff means infinite wait - - \return eWLAN_PAL_STATUS_SUCCESS - the wait was satisifed by one of the events - in the event array being set. The index into the event arry - that satisfied the wait can be found at *pEventIndex. - - eWLAN_PALSTATUS_E_TIMEOUT - the timeout interval elapsed before any of - the events were set. - - eWLAN_PAL_STATUS_E_INVAL - At least one of the values specified in - the event array refers to an uninitialized event object. The - invalid event is identified by the index in *pEventIndex. Note - that only the first uninitialized event is detected when this error - is returned. - - eWLAN_PAL_STATUS_E_EMPTY - the events array is empty. This condition - is detected by numEvents being 0 on input. - - eWLAN_PAL_STATUS_E_FAULT - event or pEventIndex is an invalid pointer. ----------------------------------------------------------------------------*/ -wpt_status wpalEventWait(wpt_event *pEvent, wpt_uint32 timeout) -{ - /* Not doing sanity checks since VOS does them anyways */ - - wpt_status status = eWLAN_PAL_STATUS_E_FAILURE; - VOS_STATUS vos_status = VOS_STATUS_E_FAILURE; - - /* In VOS timeout = 0 corresponds to infinite wait */ - timeout = ( timeout == WLAN_PAL_WAIT_INFINITE ? 0 : timeout ); - - vos_status = vos_wait_single_event( (vos_event_t*)pEvent, timeout ); - - status = WPAL_VOS_TO_WPAL_STATUS( vos_status ); - - return status; -} - -/*--------------------------------------------------------------------------- - wpalEventSet – Set an event object to signaled state - Param: - pEvent – a pointer to caller allocated object of wpt_event - Return: - eWLAN_PAL_STATUS_SUCCESS – success. Fail otherwise. ----------------------------------------------------------------------------*/ -wpt_status wpalEventSet(wpt_event *pEvent) -{ - /* Not doing sanity checks since VOS does them anyways */ - - return ( WPAL_VOS_TO_WPAL_STATUS(vos_event_set( (vos_event_t*)pEvent )) ); -} - -/*--------------------------------------------------------------------------- - wpalEventReset – Set an event object to non-signaled state - Param: - pEvent – a pointer to caller allocated object of wpt_event - Return: - eWLAN_PAL_STATUS_SUCCESS – success. Fail otherwise. ----------------------------------------------------------------------------*/ -wpt_status wpalEventReset(wpt_event *pEvent) -{ - /* Not doing sanity checks since VOS does them anyways */ - - return ( WPAL_VOS_TO_WPAL_STATUS(vos_event_reset( (vos_event_t*)pEvent )) ); -} diff --git a/CORE/WDI/WPAL/src/wlan_qct_pal_timer.c b/CORE/WDI/WPAL/src/wlan_qct_pal_timer.c deleted file mode 100644 index 503d41a504a5..000000000000 --- a/CORE/WDI/WPAL/src/wlan_qct_pal_timer.c +++ /dev/null @@ -1,232 +0,0 @@ -/* - * Copyright (c) 2013 The Linux Foundation. All rights reserved. - * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all - * copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL - * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/**========================================================================= - - \file wlan_qct_pal_timer.c - - \brief Implementation trace/logging APIs PAL exports. wpt = (Wlan Pal Type) wpal = (Wlan PAL) - - Definitions for platform Windows. - - ========================================================================*/ - -#include "wlan_qct_pal_timer.h" -#include "wlan_qct_pal_trace.h" -#include "wlan_qct_os_status.h" -#include "vos_threads.h" - -#include - -/*--------------------------------------------------------------------------- - \brief wpalTimerCback - VOS timer callback function - - \param pUserdata - A cookie to data passed back in the callback function ----------------------------------------------------------------------------*/ -static void wpalTimerCback( void * userData ) -{ - wpt_timer *pTimer = (wpt_timer *)userData; - - if(NULL != pTimer->callback) - { - pTimer->callback(pTimer->pUserData); - } - else - { - WPAL_TRACE( eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_WARN, - " %s pTimer(%p) callback after deleted", - __func__, pTimer ); - } -}/*wpalTimerCback*/ - -/*--------------------------------------------------------------------------- - \brief wpalTimerInit - initialize a wpt_timer object - - \param pTimer - a pointer to caller allocated wpt_timer object - \param callback - A callback function - \param pUserData - A cookie to data passed back in the callback function - - \return wpt_status eWLAN_PAL_STATUS_SUCCESS - success. Fail otherwise. ----------------------------------------------------------------------------*/ -wpt_status wpalTimerInit(wpt_timer * pTimer, wpal_timer_callback callback, void *pUserData) -{ - /* Sanity Checks */ - if( pTimer == NULL || callback == NULL ) - { - WPAL_TRACE( eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_ERROR, - " %s Wrong param pTimer(%p) callback(%p)", - __func__, pTimer, callback ); - return eWLAN_PAL_STATUS_E_INVAL; - } - - if ( vos_timer_init( &pTimer->timer.timerObj, VOS_TIMER_TYPE_SW, - wpalTimerCback, (void*)pTimer ) == VOS_STATUS_SUCCESS ) - { - pTimer->callback = callback; - pTimer->pUserData = pUserData; - return eWLAN_PAL_STATUS_SUCCESS; - } - - return eWLAN_PAL_STATUS_E_FAILURE; -}/*wpalTimerInit*/ - - -/*--------------------------------------------------------------------------- - \brief wpalTimerDelete - invalidate a wpt_timer object - - \param pTimer a pointer to caller allocated wpt_timer object - - \return eWLAN_PAL_STATUS_SUCCESS ?? success. Fail otherwise. ----------------------------------------------------------------------------*/ -wpt_status wpalTimerDelete(wpt_timer *pTimer) -{ - wpt_status status; - - /* Sanity Checks */ - if( pTimer == NULL ) - { - WPAL_TRACE( eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_ERROR, - " %s Wrong param pTimer(%p)", - __func__, pTimer ); - return eWLAN_PAL_STATUS_E_INVAL; - } - - status = WPAL_VOS_TO_WPAL_STATUS( vos_timer_destroy(&pTimer->timer.timerObj)); - - if( status == eWLAN_PAL_STATUS_SUCCESS ) - { - pTimer->callback = NULL; - pTimer->pUserData = NULL; - } - - return status; -}/*wpalTimerDelete*/ - - -/*--------------------------------------------------------------------------- - wpalTimerStart - start a wpt_timer object with a timeout value - - \param pTimer - a pointer to caller allocated wpt_timer object - \param timeout - timeout value of the timer. In unit of milli-seconds - - \return - eWLAN_PAL_STATUS_SUCCESS - success. Fail otherwise. ----------------------------------------------------------------------------*/ -wpt_status wpalTimerStart(wpt_timer * pTimer, wpt_uint32 timeout) -{ - /* Sanity Checks */ - if( pTimer == NULL ) - { - WPAL_TRACE( eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_ERROR, - " %s Wrong param pTimer(%p)", - __func__, pTimer ); - return eWLAN_PAL_STATUS_E_INVAL; - } - return ( WPAL_VOS_TO_WPAL_STATUS( vos_timer_start( &pTimer->timer.timerObj, - timeout ) ) ); -}/*wpalTimerStart*/ - - -/*--------------------------------------------------------------------------- - \brief wpalTimerStop - stop a wpt_timer object. Stop doesn't guarantee the - timer handler is not called if it is already timeout. - - \param pTimer - a pointer to caller allocated wpt_timer object - - \return - eWLAN_PAL_STATUS_SUCCESS - success. Fail otherwise. ----------------------------------------------------------------------------*/ -wpt_status wpalTimerStop(wpt_timer * pTimer) -{ - /* Sanity Checks */ - if( pTimer == NULL ) - { - WPAL_TRACE( eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_ERROR, - " %s Wrong param pTimer(%p)", - __func__, pTimer ); - return eWLAN_PAL_STATUS_E_INVAL; - } - return (WPAL_VOS_TO_WPAL_STATUS( vos_timer_stop( &pTimer->timer.timerObj ))); -}/*wpalTimerStop*/ - -/*--------------------------------------------------------------------------- - \brief wpalTimerGetCurStatus - Get the current status of timer - - \param pTimer - a pointer to caller allocated wpt_timer object - - \return - VOS_TIMER_STATE ----------------------------------------------------------------------------*/ -WPAL_TIMER_STATE wpalTimerGetCurStatus(wpt_timer * pTimer) -{ - /* Sanity Checks */ - if( pTimer == NULL ) - { - WPAL_TRACE( eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_ERROR, - " %s Wrong param pTimer(%p)", - __func__, pTimer ); - return eWLAN_PAL_STATUS_E_INVAL; - } - return vos_timer_getCurrentState( &pTimer->timer.timerObj ); -}/*wpalTimerGetCurStatus*/ - -/*--------------------------------------------------------------------------- - \brief wpalGetSystemTime - Get the system time in milliseconds - - \return - current time in milliseconds ----------------------------------------------------------------------------*/ -wpt_uint32 wpalGetSystemTime(void) -{ - return vos_timer_get_system_time(); -}/*wpalGetSystemTime*/ - -/*--------------------------------------------------------------------------- - wpalSleep - sleep for a specified interval - Param: - timeout - amount of time to sleep. In unit of milli-seconds. - Return: - eWLAN_PAL_STATUS_SUCCESS - success. Fail otherwise. ----------------------------------------------------------------------------*/ -wpt_status wpalSleep(wpt_uint32 timeout) -{ - vos_sleep( timeout ); - return eWLAN_PAL_STATUS_SUCCESS; -} - -/*--------------------------------------------------------------------------- - wpalBusyWait - Thread busy wait with specified usec - Param: - usecDelay - amount of time to wait. In unit of micro-seconds. - Return: - NONE ----------------------------------------------------------------------------*/ -void wpalBusyWait(wpt_uint32 usecDelay) -{ - vos_busy_wait(usecDelay); - return; -} diff --git a/Kbuild b/Kbuild index 1d8db3822063..28e50d5fd876 100644 --- a/Kbuild +++ b/Kbuild @@ -869,15 +869,6 @@ WDI_WPAL_INC := -I$(WLAN_ROOT)/$(WDI_DIR)/WPAL/inc WDI_WPAL_SRC_DIR := $(WDI_DIR)/WPAL/src WDI_WPAL_OBJS := $(WDI_WPAL_SRC_DIR)/wlan_qct_pal_trace.o -ifeq ($(CONFIG_QCA_WIFI_2_0), 0) -WDI_WPAL_OBJS += $(WDI_WPAL_SRC_DIR)/wlan_qct_pal_api.o \ - $(WDI_WPAL_SRC_DIR)/wlan_qct_pal_device.o \ - $(WDI_WPAL_SRC_DIR)/wlan_qct_pal_msg.o \ - $(WDI_WPAL_SRC_DIR)/wlan_qct_pal_packet.o \ - $(WDI_WPAL_SRC_DIR)/wlan_qct_pal_sync.o \ - $(WDI_WPAL_SRC_DIR)/wlan_qct_pal_timer.o -endif - WDI_INC := $(WDI_CP_INC) \ $(WDI_DP_INC) \ $(WDI_TRP_INC) \ -- cgit v1.2.3 From 0169ac2b62fe22510a969801260850fa9885dd18 Mon Sep 17 00:00:00 2001 From: Nirav Shah Date: Wed, 16 Jul 2014 23:54:36 +0530 Subject: qcacld: Do not remove peer again if it is in progress for LL Before removing peer in wma_delete_all_ap_remote_peers check that wma already removed peer. This logic already in place for HL path. Extending it for LL path. Change-Id: I3844f407fa593e16b2f971811ff34ed2e164ee1a CRs-FIXED: 699998 --- CORE/SERVICES/WMA/wma.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c index ac3bbb576e2e..74f3f0385d84 100644 --- a/CORE/SERVICES/WMA/wma.c +++ b/CORE/SERVICES/WMA/wma.c @@ -1243,7 +1243,6 @@ static void wma_delete_all_ap_remote_peers(tp_wma_handle wma, A_UINT32 vdev_id) { ol_txrx_vdev_handle vdev; ol_txrx_peer_handle peer, temp; - int32_t is_high_latency; if (!wma || vdev_id > wma->max_bssid) return; @@ -1252,8 +1251,6 @@ static void wma_delete_all_ap_remote_peers(tp_wma_handle wma, A_UINT32 vdev_id) if (!vdev) return; - is_high_latency = wdi_out_cfg_is_high_latency( - vdev->pdev->ctrl_pdev); WMA_LOGE("%s: vdev_id - %d", __func__, vdev_id); /* remove all remote peers of SAP */ adf_os_spin_lock_bh(&vdev->pdev->peer_ref_mutex); @@ -1262,8 +1259,7 @@ static void wma_delete_all_ap_remote_peers(tp_wma_handle wma, A_UINT32 vdev_id) TAILQ_FOREACH_REVERSE(peer, &vdev->peer_list, peer_list_t, peer_list_elem) { if (temp) { adf_os_spin_unlock_bh(&vdev->pdev->peer_ref_mutex); - if ((!is_high_latency) - || adf_os_atomic_read(&temp->delete_in_progress) == 0){ + if (adf_os_atomic_read(&temp->delete_in_progress) == 0){ adf_os_atomic_init(&temp->ref_cnt); adf_os_atomic_inc(&temp->ref_cnt); wma_remove_peer(wma, temp->mac_addr.raw, -- cgit v1.2.3 From d3fe36e780dc79a35708cf8d41157f09747c4942 Mon Sep 17 00:00:00 2001 From: Rajesh Chauhan Date: Sat, 26 Jul 2014 15:47:14 -0700 Subject: qcalcd: Ignore Max TDLS Discovery attempts when External Control is enabled When TDLS External Control is enabled then do not disable TDLS Discovery towards externally configured peer MAC on reaching max discovery attempts and rather continue sending Discovery Request to that peer. Also, in case of implicit trigger without external control, if Discovery Response from peer does not meet RSSI threshold then do not count that attempt against max discovery attempts and continue sending Discovery Request. Change-Id: I4efe398d60c8ed6dc9afa3517c707f1f9dd83a6d CRs-Fixed: 700461 --- CORE/HDD/src/wlan_hdd_tdls.c | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/CORE/HDD/src/wlan_hdd_tdls.c b/CORE/HDD/src/wlan_hdd_tdls.c index c19fee624f3d..43875a95af4a 100644 --- a/CORE/HDD/src/wlan_hdd_tdls.c +++ b/CORE/HDD/src/wlan_hdd_tdls.c @@ -1023,6 +1023,12 @@ int wlan_hdd_tdls_recv_discovery_resp(hdd_adapter_t *pAdapter, u8 *mac) MAC_ADDR_ARRAY(curr_peer->peerMac), curr_peer->rssi, pHddTdlsCtx->threshold_config.rssi_trigger_threshold); curr_peer->link_status = eTDLS_LINK_IDLE; + + /* if RSSI threshold is not met then allow further discovery + * attempts by decrementing count for the last attempt + */ + if (curr_peer->discovery_attempt) + curr_peer->discovery_attempt--; } } else @@ -2130,17 +2136,24 @@ static void __wlan_hdd_tdls_pre_setup(struct work_struct *work) if (eTDLS_CAP_UNKNOWN != curr_peer->tdls_support) curr_peer->link_status = eTDLS_LINK_DISCOVERING; - if (curr_peer->discovery_attempt >= - pHddTdlsCtx->threshold_config.discovery_tries_n) + /* Ignore discovery attempt if External Control is enabled, that + * is, peer is forced. In that case, continue discovery attempt + * regardless attempt count + */ + if (FALSE == curr_peer->isForcedPeer) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: discovery attempt (%d) reached max (%d) for peer " - MAC_ADDRESS_STR ", ignore discovery trigger from fw", - __func__, curr_peer->discovery_attempt, - pHddTdlsCtx->threshold_config.discovery_tries_n, - MAC_ADDR_ARRAY(curr_peer->peerMac)); - curr_peer->tdls_support = eTDLS_CAP_NOT_SUPPORTED; - goto done; + if (curr_peer->discovery_attempt >= + pHddTdlsCtx->threshold_config.discovery_tries_n) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: discovery attempt (%d) reached max (%d) for peer " + MAC_ADDRESS_STR ", ignore discovery trigger from fw", + __func__, curr_peer->discovery_attempt, + pHddTdlsCtx->threshold_config.discovery_tries_n, + MAC_ADDR_ARRAY(curr_peer->peerMac)); + curr_peer->tdls_support = eTDLS_CAP_NOT_SUPPORTED; + goto done; + } } curr_peer->link_status = eTDLS_LINK_DISCOVERING; -- cgit v1.2.3 From 612191745f675c1026ede760c7eafa97e88a64e5 Mon Sep 17 00:00:00 2001 From: "Kanchanapally, Vidyullatha" Date: Fri, 25 Jul 2014 18:52:01 +0530 Subject: qcacld: Increase the size of PMKID cache Increase the size of PMKID cache in hdd and csr. Also this value is set to 32 to make it equal to the size in supplicant. Change-Id: Icd3f58f3f7278fa910c3db88a3337f2d6514cc31 CRs-Fixed: 701254 --- CORE/HDD/inc/wlan_hdd_main.h | 5 +---- CORE/HDD/src/wlan_hdd_cfg80211.c | 6 +++--- CORE/SME/inc/csrApi.h | 2 +- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/CORE/HDD/inc/wlan_hdd_main.h b/CORE/HDD/inc/wlan_hdd_main.h index 87a540c3d6e9..dfce710187a8 100644 --- a/CORE/HDD/inc/wlan_hdd_main.h +++ b/CORE/HDD/inc/wlan_hdd_main.h @@ -304,9 +304,6 @@ extern spinlock_t hdd_context_lock; #define WLAN_HDD_TX_FLOW_CONTROL_MAX_24BAND_CH 14 #endif /* QCA_LL_TX_FLOW_CT */ -/* Max PMKSAIDS available in cache */ -#define MAX_PMKSAIDS_IN_CACHE 8 - #define HDD_VHT_RX_HIGHEST_SUPPORTED_DATA_RATE_1_1 390 #define HDD_VHT_TX_HIGHEST_SUPPORTED_DATA_RATE_1_1 390 @@ -688,7 +685,7 @@ struct hdd_station_ctx v_BOOL_t hdd_ReassocScenario; /* PMKID Cache */ - tPmkidCacheInfo PMKIDCache[MAX_PMKSAIDS_IN_CACHE]; + tPmkidCacheInfo PMKIDCache[CSR_MAX_PMKID_ALLOWED]; tANI_U32 PMKIDCacheIndex; /* STA ctx debug variables */ diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c index e18a927459a5..15782f467e23 100644 --- a/CORE/HDD/src/wlan_hdd_cfg80211.c +++ b/CORE/HDD/src/wlan_hdd_cfg80211.c @@ -11510,7 +11510,7 @@ static int __wlan_hdd_cfg80211_set_pmksa(struct wiphy *wiphy, struct net_device } /* Check we compared all entries,if then take the first slot now */ - if (j == MAX_PMKSAIDS_IN_CACHE) pHddStaCtx->PMKIDCacheIndex = 0; + if (j == CSR_MAX_PMKID_ALLOWED) pHddStaCtx->PMKIDCacheIndex = 0; if (!BSSIDMatched) { /* Now, we DON'T have a BSSID match, so take a new entry in the cache */ @@ -11525,7 +11525,7 @@ static int __wlan_hdd_cfg80211_set_pmksa(struct wiphy *wiphy, struct net_device MAC_ADDR_ARRAY(pmksa->bssid)); dump_pmkid(halHandle, pmksa->pmkid); /* Increment the HDD Local Cache index */ - if (pHddStaCtx->PMKIDCacheIndex <= (MAX_PMKSAIDS_IN_CACHE - 1)) + if (pHddStaCtx->PMKIDCacheIndex <= (CSR_MAX_PMKID_ALLOWED - 1)) pHddStaCtx->PMKIDCacheIndex++; else pHddStaCtx->PMKIDCacheIndex = 0; @@ -11649,7 +11649,7 @@ static int __wlan_hdd_cfg80211_del_pmksa(struct wiphy *wiphy, struct net_device } /* We compare all entries, but cannot find matching entry */ - if (j == MAX_PMKSAIDS_IN_CACHE && !BSSIDMatched) { + if (j == CSR_MAX_PMKID_ALLOWED && !BSSIDMatched) { hddLog(VOS_TRACE_LEVEL_DEBUG, FL("No such PMKSA entry exists "MAC_ADDRESS_STR), MAC_ADDR_ARRAY(pmksa->bssid)); diff --git a/CORE/SME/inc/csrApi.h b/CORE/SME/inc/csrApi.h index bbd68f35bb73..43e4deddba57 100644 --- a/CORE/SME/inc/csrApi.h +++ b/CORE/SME/inc/csrApi.h @@ -229,7 +229,7 @@ typedef enum #define CSR_SCAN_TIME_DEFAULT 0 #define CSR_VALUE_IGNORED 0xFFFFFFFF #define CSR_RSN_PMKID_SIZE 16 -#define CSR_MAX_PMKID_ALLOWED 16 +#define CSR_MAX_PMKID_ALLOWED 32 #define CSR_WEP40_KEY_LEN 5 #define CSR_WEP104_KEY_LEN 13 #define CSR_TKIP_KEY_LEN 32 -- cgit v1.2.3 From df012585bcbdfa1351e7c70adc98218e24d4b6a9 Mon Sep 17 00:00:00 2001 From: Akash Patel Date: Tue, 29 Jul 2014 10:44:25 -0700 Subject: Cafstaging Release 1.0.0.157 Cafstaging Release 1.0.0.157 Change-Id: I0028eb8a9c67b21cd0cac1ebbedc3d67df4be421 CRs-Fixed: 688141 --- CORE/MAC/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CORE/MAC/inc/qwlan_version.h b/CORE/MAC/inc/qwlan_version.h index 1c75e7372c2a..6b82cd015510 100644 --- a/CORE/MAC/inc/qwlan_version.h +++ b/CORE/MAC/inc/qwlan_version.h @@ -42,9 +42,9 @@ BRIEF DESCRIPTION: #define QWLAN_VERSION_MINOR 0 #define QWLAN_VERSION_PATCH 0 #define QWLAN_VERSION_EXTRA "" -#define QWLAN_VERSION_BUILD 156 +#define QWLAN_VERSION_BUILD 157 -#define QWLAN_VERSIONSTR "1.0.0.156" +#define QWLAN_VERSIONSTR "1.0.0.157" #ifdef QCA_WIFI_2_0 -- cgit v1.2.3