diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2016-05-24 00:26:48 -0700 |
|---|---|---|
| committer | Linux Build Service Account <lnxbuild@localhost> | 2016-05-24 00:26:48 -0700 |
| commit | c247dc65f08665f1b2530afbbac1fc4138ccf556 (patch) | |
| tree | 9ed7176dceea2c357648e383806d042cf811f1ab | |
| parent | ea0a20e27e2336badc357fc38e47b0223ea388ee (diff) | |
| parent | 7f17ee751515d7d71607ba7c80c390361d8f5351 (diff) | |
Promotion of wlan-cld3.driver.lnx.1.1-00013.
CRs Change ID Subject
--------------------------------------------------------------------------------------------------------------
865207 I6109a2e5f347c88f7696dadfe85a8ca4364cb0d7 qcacld-3.0: CL 1496762 - update fw common interface file
999861 I825b10837d999384a91ca3c2271e472a71fd8863 qcacld-3.0: Add logic to log pause/unpause time
865207 Ic14b1c3c3538f5e1a62b69535c27108152f7076d qcacld-3.0: CL 1491974 - update fw common interface file
1012345 I11c36ecf54b04cf1e3671a86594822b39b8ccaaf qcacld-3.0: Remove extra ticks-to-msec conversion
1007810 I2b9f82f64d2cd038abd61a0087886724daa19424 qcacld-3.0: Remove csr_get_current_ap_rssi
989856 If46be64fda0edb97881f8ea1bfe919a0a55a250f qcacld-3.0: Fix enum values in cds_ieee80211_common
865207 I85b034967b9dc5b140472d864de3ec5aea83eda7 qcacld-3.0: CL 1501516 - update fw common interface file
865207 I3bf01c32d6423326fbb25db42d527ac7854f23d8 qcacld-3.0: CL 1489600 - update fw common interface file
865207 I284e6044c713c48dd3887852e1d1f6e8f85439a7 qcacld-3.0: CL 1494723 - update fw common interface file
997798 Ief105310fb71779b1a8c1d580408a489cad9977e qcacld-3.0: Add WISA feature handling
1014428 I5b88a297134dcc1d7a6a68dd2a9879dfd1553a7e qcacld-3.0: Fix lro dereg crash on driver unload
1007810 I072f08b179c87d3c182ae6577ac17e74b3862fce qcacld-3.0: Remove csr_neighbor_roam_prepare_non_occupie
1003001 I73e0e3f675728aa653c2c4f5d2291c260b339987 qcacld-3.0: Free body of message in deferred queue durin
997799 I89abf14b9b7d8ee8fe1c12f7684c87e4dee9bfb0 qcacld-3.0: Add vendor command for TSF operations
998427 I483696d1fa1a731e9afd0a4ea134900d81be7b43 qcacld-3.0: Fix incorrect handling of additional IE in a
954302 I2aa7239be924b63c87f1044a74176a101d952108 qcacld-3.0: Do not allocate large chunk of memory for rx
865207 I6edaff37931db83d057e1ddb1e9952e2b0dc87aa qcacld-3.0: CL 1501755 - update fw common interface file
1010581 Ic86dafc5baa80ae634c5267794f3add0e06d076f qcacld-3.0: Fix crash on WMA path
1012346 I358e74b47165fa08cb5d37f095b44bff3f83fdfc qcacld-3.0: Shrink ol_txrx_stats_tso_info
998544 I6c1638801dba2b53cbcb5b1ebc925d6f4e035582 qcacld-3.0: Pass original beacon TSF to user space
929428 I10413ed4b5b76e16211aa0cbb9012cfb8f26cae0 qcacld-3.0: Add logic in host to detect msdu_id duplicat
937233 Iae93657d473e81f27b4c491869a60daf83911f14 Fix HDD logging API in wlan_hdd_ioctl
1007810 Icc8ef8a882813d980f05314cf07a379e607323ad qcacld-3.0: Remove csr_neighbor_roam_offload_update_prea
1012681 Id0aab4b1f03ed24dfb55e09fa1a115edfdfcce84 qcacld-3.0: Fix race condition between tx traffic and pe
865207 Ibdd1bdd607b3acac5d55312ee2595c32892c89b5 qcacld-3.0: CL 1492713 - update fw common interface file
865207 Icbf9ad7cac93dd75ddb976a0f781e20b60201896 qcacld-3.0: CL 1498085 - update fw common interface file
1009993 I62b23d68743fedf205bb3859c0de50568ca09b7a qcacld-3.0: Add target bus type field in qdf context
865207 I01d96c423b6241248242aa2feae6887d8f202691 qcacld-3.0: CL 1488100 - update fw common interface file
865207 I127bb10c989c0d7ee8a0f9cc9c57e2c824017165 qcacld-3.0: CL 1490576 - update fw common interface file
688141 I4b7992267b8fc832bf42ea3d10bd18c6d028b371 Release 5.1.0.8
1007810 I8c876bdb696f70452354f5f84b504b4a6564c479 qcacld-3.0: Remove unused code of sending probe req temp
1001128 Icc51386bde58d3882e36ab09cd31a527b140a937 qcacld-3.0: Send Auto shutdown cancel event
688141 I41569dd88864ae943b6b3c777be582c698440cdd Release 5.1.0.9
1012824 Ic869aefb0949eb03b9b359f35810e1ba43a19d80 qcacld-3.0: Use hif_hw_version for chip versions
999861 Ia861f6cd3d6a91f01a07f9bc4e2bc3afcf62c8f2 qcacld-3.0: Add histogram for MSDUs per RX indication
865207 I7ce118d5e9c4d762ef900dc4b9b0137a76e66091 qcacld-3.0: CL 1485676 - update fw common interface file
950790 I04dd8f3cdb7f401fb761262bd34b0a2177f6097f qcacld-3.0: Dynamically allocate hdd_txrx_hist
1011762 Ifd8688c61bfdd132a4727d377cfc2e975e5c5b13 qcacld-3.0: De-serialize FW diag log events from MC thre
1012891 Ibbfb8d17e68dcd84ca645ec3bccf25fd84acaa18 qcacld-3.0: LFR3: Store the last roam synch delay
Change-Id: I22b001e50ea8c2d6c65ec7771f0a4d68cf63aa01
CRs-Fixed: 929428, 1012891, 1007810, 997799, 997798, 865207, 1012346, 1012345, 1003001, 989856, 1009993, 1014428, 999861, 1001128, 998544, 998427, 688141, 1011762, 950790, 1012824, 954302, 1012681, 937233, 1010581
55 files changed, 2183 insertions, 1769 deletions
@@ -134,6 +134,9 @@ ifeq ($(KERNEL_BUILD), 0) #Flag to enable offload packets feature CONFIG_WLAN_OFFLOAD_PACKETS := y + #enable TSF get feature + CONFIG_WLAN_SYNC_TSF := y + #Flag to enable memdump feature CONFIG_WLAN_FEATURE_MEMDUMP := y @@ -1114,6 +1117,10 @@ ifeq ($(CONFIG_WLAN_FEATURE_LPSS),y) CDEFINES += -DWLAN_FEATURE_LPSS endif +ifneq ($(TARGET_BUILD_VARIANT),user) +CDEFINES += -DDESC_DUP_DETECT_DEBUG +endif + ifeq ($(PANIC_ON_BUG),1) CDEFINES += -DPANIC_ON_BUG endif diff --git a/core/bmi/inc/ol_fw.h b/core/bmi/inc/ol_fw.h index 963cacc6b727..0fe47f3fbaa8 100644 --- a/core/bmi/inc/ol_fw.h +++ b/core/bmi/inc/ol_fw.h @@ -32,20 +32,10 @@ #include "qdf_types.h" #endif #include "hif.h" +#include "hif_hw_version.h" -#define AR6004_VERSION_REV1_3 0x31c8088a - -#define AR9888_REV2_VERSION 0x4100016c -#define AR6320_REV1_VERSION 0x5000000 -#define AR6320_REV1_1_VERSION 0x5000001 -#define AR6320_REV1_VERSION_1 AR6320_REV1_1_VERSION -#define AR6320_REV1_3_VERSION 0x5000003 #define AR6320_REV2_VERSION AR6320_REV1_1_VERSION -#define AR6320_REV2_1_VERSION 0x5010000 -#define AR6320_REV3_VERSION 0x5020000 -#define AR6320_REV3_2_VERSION 0x5030000 #define AR6320_REV4_VERSION AR6320_REV2_1_VERSION -#define AR6320_DEV_VERSION 0x1000000 void ol_target_failure(void *instance, QDF_STATUS status); #endif /* _OL_FW_H_ */ diff --git a/core/cds/src/cds_ieee80211_common_i.h b/core/cds/src/cds_ieee80211_common_i.h index e1ee02cd6e2c..cccbdeb1b379 100644 --- a/core/cds/src/cds_ieee80211_common_i.h +++ b/core/cds/src/cds_ieee80211_common_i.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2015 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -28,50 +28,78 @@ #ifndef CDS_COMMON__IEEE80211_I_H_ #define CDS_COMMON__IEEE80211_I_H_ -/* XXX not really a mode; there are really multiple PHY's */ +/** + * enum ieee80211_phymode - not really a mode; there are really multiple PHY's + * @IEEE80211_MODE_AUTO - autoselect + * @IEEE80211_MODE_11A - 5GHz, OFDM + * @IEEE80211_MODE_11B - 2GHz, CCK + * @IEEE80211_MODE_11G - 2GHz, OFDM + * @IEEE80211_MODE_FH - 2GHz, GFSK + * @IEEE80211_MODE_TURBO_A - 5GHz, OFDM, 2x clock dynamic turbo + * @IEEE80211_MODE_TURBO_G - 2GHz, OFDM, 2x clock dynamic turbo + * @IEEE80211_MODE_11NA_HT20 - 5Ghz, HT20 + * @IEEE80211_MODE_11NG_HT20 - 2Ghz, HT20 + * @IEEE80211_MODE_11NA_HT40PLUS - 5Ghz, HT40 (ext ch +1) + * @IEEE80211_MODE_11NA_HT40MINUS - 5Ghz, HT40 (ext ch -1) + * @IEEE80211_MODE_11NG_HT40PLUS - 2Ghz, HT40 (ext ch +1) + * @IEEE80211_MODE_11NG_HT40MINUS - 2Ghz, HT40 (ext ch -1) + * @IEEE80211_MODE_11NG_HT40 - 2Ghz, Auto HT40 + * @IEEE80211_MODE_11NA_HT40 - 2Ghz, Auto HT40 + * @IEEE80211_MODE_11AC_VHT20 - 5Ghz, VHT20 + * @IEEE80211_MODE_11AC_VHT40PLUS - 5Ghz, VHT40 (Ext ch +1) + * @IEEE80211_MODE_11AC_VHT40MINUS - 5Ghz VHT40 (Ext ch -1) + * @IEEE80211_MODE_11AC_VHT40 - 5Ghz, VHT40 + * @IEEE80211_MODE_11AC_VHT80 - 5Ghz, VHT80 + * @IEEE80211_MODE_2G_AUTO - 2G 11 b/g/n autoselect + * @IEEE80211_MODE_5G_AUTO - 5G 11 a/n/ac autoselect + * @IEEE80211_MODE_11AGN - Support 11N in both 2G and 5G + * @IEEE80211_MODE_MAX - Maximum possible value + */ enum ieee80211_phymode { - IEEE80211_MODE_AUTO = 0, /* autoselect */ - IEEE80211_MODE_11A = 1, /* 5GHz, OFDM */ - IEEE80211_MODE_11B = 2, /* 2GHz, CCK */ - IEEE80211_MODE_11G = 3, /* 2GHz, OFDM */ - IEEE80211_MODE_FH = 4, /* 2GHz, GFSK */ - IEEE80211_MODE_TURBO_A = 5, /* 5GHz, OFDM, 2x clock dynamic turbo */ - IEEE80211_MODE_TURBO_G = 6, /* 2GHz, OFDM, 2x clock dynamic turbo */ - IEEE80211_MODE_11NA_HT20 = 7, /* 5Ghz, HT20 */ - IEEE80211_MODE_11NG_HT20 = 8, /* 2Ghz, HT20 */ - IEEE80211_MODE_11NA_HT40PLUS = 9, /* 5Ghz, HT40 (ext ch +1) */ - IEEE80211_MODE_11NA_HT40MINUS = 10, /* 5Ghz, HT40 (ext ch -1) */ - IEEE80211_MODE_11NG_HT40PLUS = 11, /* 2Ghz, HT40 (ext ch +1) */ - IEEE80211_MODE_11NG_HT40MINUS = 12, /* 2Ghz, HT40 (ext ch -1) */ - IEEE80211_MODE_11NG_HT40 = 13, /* 2Ghz, Auto HT40 */ - IEEE80211_MODE_11NA_HT40 = 14, /* 2Ghz, Auto HT40 */ - IEEE80211_MODE_11AC_VHT20 = 15, /* 5Ghz, VHT20 */ - IEEE80211_MODE_11AC_VHT40PLUS = 16, /* 5Ghz, VHT40 (Ext ch +1) */ - IEEE80211_MODE_11AC_VHT40MINUS = 17, /* 5Ghz VHT40 (Ext ch -1) */ - IEEE80211_MODE_11AC_VHT40 = 18, /* 5Ghz, VHT40 */ - IEEE80211_MODE_11AC_VHT80 = 19, /* 5Ghz, VHT80 */ - IEEE80211_MODE_2G_AUTO = 20, /* 2G 11 b/g/n autoselect */ - IEEE80211_MODE_5G_AUTO = 21, /* 5G 11 a/n/ac autoselect */ - IEEE80211_MODE_11AGN = 22, /* Support 11N in both 2G and 5G */ + IEEE80211_MODE_AUTO = 0, + IEEE80211_MODE_11A = 1, + IEEE80211_MODE_11B = 2, + IEEE80211_MODE_11G = 3, + IEEE80211_MODE_FH = 4, + IEEE80211_MODE_TURBO_A = 5, + IEEE80211_MODE_TURBO_G = 6, + IEEE80211_MODE_11NA_HT20 = 7, + IEEE80211_MODE_11NG_HT20 = 8, + IEEE80211_MODE_11NA_HT40PLUS = 9, + IEEE80211_MODE_11NA_HT40MINUS = 10, + IEEE80211_MODE_11NG_HT40PLUS = 11, + IEEE80211_MODE_11NG_HT40MINUS = 12, + IEEE80211_MODE_11NG_HT40 = 13, + IEEE80211_MODE_11NA_HT40 = 14, + IEEE80211_MODE_11AC_VHT20 = 15, + IEEE80211_MODE_11AC_VHT40PLUS = 16, + IEEE80211_MODE_11AC_VHT40MINUS = 17, + IEEE80211_MODE_11AC_VHT40 = 18, + IEEE80211_MODE_11AC_VHT80 = 19, + IEEE80211_MODE_2G_AUTO = 20, + IEEE80211_MODE_5G_AUTO = 21, + IEEE80211_MODE_11AGN = 22, + + /* Do not add after this line */ + IEEE80211_MODE_MAX = IEEE80211_MODE_11AGN, }; -#define IEEE80211_MODE_MAX (IEEE80211_MODE_11AC_VHT80 + 1) +/** + * enum ieee80211_opmode - operating mode + * @IEEE80211_M_IBSS - IBSS (adhoc) station + * @IEEE80211_M_HOSTAP - Software Access Point + * @IEEE80211_OPMODE_MAX = Highest numbered opmode in the list + * @IEEE80211_M_ANY - Any of the above; used by NDIS 6.x + * +*/ enum ieee80211_opmode { - IEEE80211_M_STA = 1, /* infrastructure station */ - IEEE80211_M_IBSS = 0, /* IBSS (adhoc) station */ - IEEE80211_M_AHDEMO = 3, /* Old lucent compatible adhoc demo */ - IEEE80211_M_HOSTAP = 6, /* Software Access Point */ - IEEE80211_M_MONITOR = 8, /* Monitor mode */ - IEEE80211_M_WDS = 2, /* WDS link */ - IEEE80211_M_BTAMP = 9, /* VAP for BT AMP */ - - IEEE80211_M_P2P_GO = 33, /* P2P GO */ - IEEE80211_M_P2P_CLIENT = 34, /* P2P Client */ - IEEE80211_M_P2P_DEVICE = 35, /* P2P Device */ + IEEE80211_M_IBSS = 0, + IEEE80211_M_HOSTAP = 6, - IEEE80211_OPMODE_MAX = IEEE80211_M_BTAMP, /* Highest numbered opmode in the list */ + /* Do not add after this line */ + IEEE80211_OPMODE_MAX = IEEE80211_M_HOSTAP, - IEEE80211_M_ANY = 0xFF /* Any of the above; used by NDIS 6.x */ + IEEE80211_M_ANY = 0xFF, }; /* diff --git a/core/dp/htt/htt_rx.c b/core/dp/htt/htt_rx.c index b5d8667c5f3a..3f80d690ca66 100644 --- a/core/dp/htt/htt_rx.c +++ b/core/dp/htt/htt_rx.c @@ -129,8 +129,8 @@ void htt_rx_hash_deinit(struct htt_pdev_t *pdev) return; for (i = 0; i < RX_NUM_HASH_BUCKETS; i++) { /* Free the hash entries in hash bucket i */ - list_iter = pdev->rx_ring.hash_table[i].listhead.next; - while (list_iter != &pdev->rx_ring.hash_table[i].listhead) { + list_iter = pdev->rx_ring.hash_table[i]->listhead.next; + while (list_iter != &pdev->rx_ring.hash_table[i]->listhead) { hash_entry = (struct htt_rx_hash_entry *)((char *)list_iter - pdev->rx_ring. @@ -152,7 +152,7 @@ void htt_rx_hash_deinit(struct htt_pdev_t *pdev) qdf_mem_free(hash_entry); } - qdf_mem_free(pdev->rx_ring.hash_table[i].entries); + qdf_mem_free(pdev->rx_ring.hash_table[i]); } qdf_mem_free(pdev->rx_ring.hash_table); @@ -1654,6 +1654,7 @@ htt_rx_amsdu_rx_in_order_pop_ll(htt_pdev_handle pdev, /* Get the total number of MSDUs */ msdu_count = HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(*(msg_word + 1)); HTT_RX_CHECK_MSDU_COUNT(msdu_count); + ol_rx_update_histogram_stats(msdu_count); msg_word = (uint32_t *) (rx_ind_data + HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES); @@ -2387,15 +2388,15 @@ static inline void htt_list_remove(struct htt_list_node *node) /* Hash count related macros */ #define HTT_RX_HASH_COUNT_INCR(hash_bucket) \ - ((hash_bucket).count++) + ((hash_bucket)->count++) #define HTT_RX_HASH_COUNT_DECR(hash_bucket) \ - ((hash_bucket).count--) + ((hash_bucket)->count--) -#define HTT_RX_HASH_COUNT_RESET(hash_bucket) ((hash_bucket).count = 0) +#define HTT_RX_HASH_COUNT_RESET(hash_bucket) ((hash_bucket)->count = 0) #define HTT_RX_HASH_COUNT_PRINT(hash_bucket) \ - RX_HASH_LOG(qdf_print(" count %d\n", (hash_bucket).count)) + RX_HASH_LOG(qdf_print(" count %d\n", (hash_bucket)->count)) #else /* RX_HASH_DEBUG */ /* Hash cookie related macros */ #define HTT_RX_HASH_COOKIE_SET(hash_element) /* no-op */ @@ -2426,20 +2427,20 @@ htt_rx_hash_list_insert(struct htt_pdev_t *pdev, uint32_t paddr, i = RX_HASH_FUNCTION(paddr); /* Check if there are any entries in the pre-allocated free list */ - if (pdev->rx_ring.hash_table[i].freepool.next != - &pdev->rx_ring.hash_table[i].freepool) { + if (pdev->rx_ring.hash_table[i]->freepool.next != + &pdev->rx_ring.hash_table[i]->freepool) { hash_element = (struct htt_rx_hash_entry *)( (char *) - pdev->rx_ring.hash_table[i].freepool.next - + pdev->rx_ring.hash_table[i]->freepool.next - pdev->rx_ring.listnode_offset); if (qdf_unlikely(NULL == hash_element)) { HTT_ASSERT_ALWAYS(0); return 1; } - htt_list_remove(pdev->rx_ring.hash_table[i].freepool.next); + htt_list_remove(pdev->rx_ring.hash_table[i]->freepool.next); } else { hash_element = qdf_mem_malloc(sizeof(struct htt_rx_hash_entry)); if (qdf_unlikely(NULL == hash_element)) { @@ -2453,7 +2454,7 @@ htt_rx_hash_list_insert(struct htt_pdev_t *pdev, uint32_t paddr, hash_element->paddr = paddr; HTT_RX_HASH_COOKIE_SET(hash_element); - htt_list_add_tail(&pdev->rx_ring.hash_table[i].listhead, + htt_list_add_tail(&pdev->rx_ring.hash_table[i]->listhead, &hash_element->listnode); RX_HASH_LOG(qdf_print("rx hash: %s: paddr 0x%x netbuf %p bucket %d\n", @@ -2477,7 +2478,7 @@ qdf_nbuf_t htt_rx_hash_list_lookup(struct htt_pdev_t *pdev, uint32_t paddr) i = RX_HASH_FUNCTION(paddr); - HTT_LIST_ITER_FWD(list_iter, &pdev->rx_ring.hash_table[i].listhead) { + HTT_LIST_ITER_FWD(list_iter, &pdev->rx_ring.hash_table[i]->listhead) { hash_entry = (struct htt_rx_hash_entry *) ((char *)list_iter - pdev->rx_ring.listnode_offset); @@ -2492,8 +2493,7 @@ qdf_nbuf_t htt_rx_hash_list_lookup(struct htt_pdev_t *pdev, uint32_t paddr) /* if the rx entry is from the pre-allocated list, return it */ if (hash_entry->fromlist) - htt_list_add_tail(&pdev->rx_ring.hash_table[i]. - freepool, + htt_list_add_tail(&pdev->rx_ring.hash_table[i]->freepool, &hash_entry->listnode); else qdf_mem_free(hash_entry); @@ -2525,9 +2525,10 @@ int htt_rx_hash_init(struct htt_pdev_t *pdev) HTT_ASSERT2(QDF_IS_PWR2(RX_NUM_HASH_BUCKETS)); + /* hash table is array of bucket pointers */ pdev->rx_ring.hash_table = qdf_mem_malloc(RX_NUM_HASH_BUCKETS * - sizeof(struct htt_rx_hash_bucket)); + sizeof(struct htt_rx_hash_bucket *)); if (NULL == pdev->rx_ring.hash_table) { qdf_print("rx hash table allocation failed!\n"); @@ -2535,26 +2536,32 @@ int htt_rx_hash_init(struct htt_pdev_t *pdev) } for (i = 0; i < RX_NUM_HASH_BUCKETS; i++) { + + /* pre-allocate bucket and pool of entries for this bucket */ + pdev->rx_ring.hash_table[i] = qdf_mem_malloc( + (sizeof(struct htt_rx_hash_bucket) + + (RX_ENTRIES_SIZE * sizeof(struct htt_rx_hash_entry)))); + HTT_RX_HASH_COUNT_RESET(pdev->rx_ring.hash_table[i]); /* initialize the hash table buckets */ - htt_list_init(&pdev->rx_ring.hash_table[i].listhead); + htt_list_init(&pdev->rx_ring.hash_table[i]->listhead); /* initialize the hash table free pool per bucket */ - htt_list_init(&pdev->rx_ring.hash_table[i].freepool); + htt_list_init(&pdev->rx_ring.hash_table[i]->freepool); /* pre-allocate a pool of entries for this bucket */ - pdev->rx_ring.hash_table[i].entries = - qdf_mem_malloc(RX_ENTRIES_SIZE * - sizeof(struct htt_rx_hash_entry)); + pdev->rx_ring.hash_table[i]->entries = + (struct htt_rx_hash_entry *) + ((uint8_t *)pdev->rx_ring.hash_table[i] + + sizeof(struct htt_rx_hash_bucket)); - if (NULL == pdev->rx_ring.hash_table[i].entries) { + if (NULL == pdev->rx_ring.hash_table[i]->entries) { qdf_print("rx hash bucket %d entries alloc failed\n", (int)i); while (i) { i--; - qdf_mem_free(pdev->rx_ring.hash_table[i]. - entries); + qdf_mem_free(pdev->rx_ring.hash_table[i]); } qdf_mem_free(pdev->rx_ring.hash_table); pdev->rx_ring.hash_table = NULL; @@ -2563,9 +2570,9 @@ int htt_rx_hash_init(struct htt_pdev_t *pdev) /* initialize the free list with pre-allocated entries */ for (j = 0; j < RX_ENTRIES_SIZE; j++) { - pdev->rx_ring.hash_table[i].entries[j].fromlist = 1; - htt_list_add_tail(&pdev->rx_ring.hash_table[i].freepool, - &pdev->rx_ring.hash_table[i]. + pdev->rx_ring.hash_table[i]->entries[j].fromlist = 1; + htt_list_add_tail(&pdev->rx_ring.hash_table[i]->freepool, + &pdev->rx_ring.hash_table[i]-> entries[j].listnode); } } @@ -2584,7 +2591,7 @@ void htt_rx_hash_dump_table(struct htt_pdev_t *pdev) for (i = 0; i < RX_NUM_HASH_BUCKETS; i++) { HTT_LIST_ITER_FWD(list_iter, - &pdev->rx_ring.hash_table[i].listhead) { + &pdev->rx_ring.hash_table[i]->listhead) { hash_entry = (struct htt_rx_hash_entry *)((char *)list_iter - pdev->rx_ring. diff --git a/core/dp/htt/htt_types.h b/core/dp/htt/htt_types.h index 7900d1c6f9e2..6b21de364d71 100644 --- a/core/dp/htt/htt_types.h +++ b/core/dp/htt/htt_types.h @@ -351,7 +351,7 @@ struct htt_pdev_t { int rx_reset; uint8_t htt_rx_restore; #endif - struct htt_rx_hash_bucket *hash_table; + struct htt_rx_hash_bucket **hash_table; uint32_t listnode_offset; } rx_ring; long rx_fw_desc_offset; diff --git a/core/dp/ol/inc/ol_txrx_stats.h b/core/dp/ol/inc/ol_txrx_stats.h index 4a98a832818f..27a49ef03c09 100644 --- a/core/dp/ol/inc/ol_txrx_stats.h +++ b/core/dp/ol/inc/ol_txrx_stats.h @@ -43,16 +43,16 @@ struct ol_txrx_stats_elem { uint64_t bytes; }; -#define NUM_MAX_TSO_SEGS 8 +#define NUM_MAX_TSO_SEGS 4 #define NUM_MAX_TSO_SEGS_MASK (NUM_MAX_TSO_SEGS - 1) -#define NUM_MAX_TSO_MSDUS 128 +#define NUM_MAX_TSO_MSDUS 32 #define NUM_MAX_TSO_MSDUS_MASK (NUM_MAX_TSO_MSDUS - 1) struct ol_txrx_stats_tso_msdu { struct qdf_tso_seg_t tso_segs[NUM_MAX_TSO_SEGS]; - uint32_t num_seg; - uint32_t tso_seg_idx; + uint8_t num_seg; + uint8_t tso_seg_idx; }; struct ol_txrx_stats_tso_info { @@ -62,56 +62,87 @@ struct ol_txrx_stats_tso_info { /** * @brief data stats published by the host txrx layer + * + * ------------------------- + * + * TX + * */ -struct ol_txrx_stats { - struct { - /* MSDUs given to the txrx layer by the management stack */ - struct ol_txrx_stats_elem mgmt; - /* MSDUs successfully sent across the WLAN */ - struct ol_txrx_stats_elem delivered; - struct { - /* MSDUs that the host did not accept */ - struct ol_txrx_stats_elem host_reject; - /* MSDUs which could not be downloaded to the target */ - struct ol_txrx_stats_elem download_fail; - /* MSDUs which the target discarded - (lack of memory or old age) */ - struct ol_txrx_stats_elem target_discard; - /* MSDUs which the target sent but - couldn't get an ack for */ - struct ol_txrx_stats_elem no_ack; - } dropped; - /* contains information of packets recevied per tx completion*/ - struct { - uint32_t pkts_1; - uint32_t pkts_2_10; - uint32_t pkts_11_20; - uint32_t pkts_21_30; - uint32_t pkts_31_40; - uint32_t pkts_41_50; - uint32_t pkts_51_60; - uint32_t pkts_61_plus; - } comp_histogram; - /* TSO (TCP segmentation offload) information */ - struct { - struct ol_txrx_stats_elem tso_pkts; +struct ol_txrx_stats_tx_dropped { + /* MSDUs that the host did not accept */ + struct ol_txrx_stats_elem host_reject; + /* MSDUs which could not be downloaded to the target */ + struct ol_txrx_stats_elem download_fail; + /* MSDUs which the target discarded + (lack of memory or old age) */ + struct ol_txrx_stats_elem target_discard; + /* MSDUs which the target sent but + couldn't get an ack for */ + struct ol_txrx_stats_elem no_ack; +}; + +struct ol_txrx_stats_tx_histogram { + uint32_t pkts_1; + uint32_t pkts_2_10; + uint32_t pkts_11_20; + uint32_t pkts_21_30; + uint32_t pkts_31_40; + uint32_t pkts_41_50; + uint32_t pkts_51_60; + uint32_t pkts_61_plus; +}; +struct ol_txrx_stats_tx_tso { + struct ol_txrx_stats_elem tso_pkts; #if defined(FEATURE_TSO) - struct ol_txrx_stats_tso_info tso_info; + struct ol_txrx_stats_tso_info tso_info; #endif - } tso; - } tx; - struct { - /* MSDUs given to the OS shim */ - struct ol_txrx_stats_elem delivered; - struct { - /* MSDUs forwarded to network stack */ - u_int32_t packets_stack; - /* MSDUs forwarded from the rx path to the tx path */ - u_int32_t packets_fwd; - /* MSDUs forwarded to stack and tx path */ - u_int32_t packets_stack_n_fwd; - } intra_bss_fwd; - } rx; +}; + +struct ol_txrx_stats_tx { + /* MSDUs given to the txrx layer by the management stack */ + struct ol_txrx_stats_elem mgmt; + /* MSDUs successfully sent across the WLAN */ + struct ol_txrx_stats_elem delivered; + struct ol_txrx_stats_tx_dropped dropped; + /* contains information of packets recevied per tx completion*/ + struct ol_txrx_stats_tx_histogram comp_histogram; + /* TSO (TCP segmentation offload) information */ + struct ol_txrx_stats_tx_tso tso; +}; + +/* + * RX + */ +struct ol_txrx_stats_rx_histogram { + uint32_t pkts_1; + uint32_t pkts_2_10; + uint32_t pkts_11_20; + uint32_t pkts_21_30; + uint32_t pkts_31_40; + uint32_t pkts_41_50; + uint32_t pkts_51_60; + uint32_t pkts_61_plus; +}; +struct ol_txrx_stats_rx_ibss_fwd { + /* MSDUs forwarded to network stack */ + u_int32_t packets_stack; + /* MSDUs forwarded from the rx path to the tx path */ + u_int32_t packets_fwd; + /* MSDUs forwarded to stack and tx path */ + u_int32_t packets_stack_n_fwd; +}; +struct ol_txrx_stats_rx { + /* MSDUs given to the OS shim */ + struct ol_txrx_stats_elem delivered; + struct ol_txrx_stats_elem dropped_err; + struct ol_txrx_stats_elem dropped_mic_err; + struct ol_txrx_stats_elem dropped_peer_invalid; + struct ol_txrx_stats_rx_ibss_fwd intra_bss_fwd; + struct ol_txrx_stats_rx_histogram rx_ind_histogram; +}; +struct ol_txrx_stats { + struct ol_txrx_stats_tx tx; + struct ol_txrx_stats_rx rx; }; /* diff --git a/core/dp/txrx/ol_rx.c b/core/dp/txrx/ol_rx.c index eea89ab5570a..9f2f65a15b34 100644 --- a/core/dp/txrx/ol_rx.c +++ b/core/dp/txrx/ol_rx.c @@ -103,6 +103,41 @@ void ol_rx_trigger_restore(htt_pdev_handle htt_pdev, qdf_nbuf_t head_msdu, } #endif +/** + * ol_rx_update_histogram_stats() - update rx histogram statistics + * @msdu_count: msdu count + * + * Return: none + */ +void ol_rx_update_histogram_stats(uint32_t msdu_count) +{ + struct ol_txrx_pdev_t *pdev = cds_get_context(QDF_MODULE_ID_TXRX); + + if (!pdev) { + TXRX_PRINT(TXRX_PRINT_LEVEL_ERR, + "%s pdev is NULL\n", __func__); + return; + } + + if (msdu_count > 60) { + TXRX_STATS_ADD(pdev, pub.rx.rx_ind_histogram.pkts_61_plus, 1); + } else if (msdu_count > 50) { + TXRX_STATS_ADD(pdev, pub.rx.rx_ind_histogram.pkts_51_60, 1); + } else if (msdu_count > 40) { + TXRX_STATS_ADD(pdev, pub.rx.rx_ind_histogram.pkts_41_50, 1); + } else if (msdu_count > 30) { + TXRX_STATS_ADD(pdev, pub.rx.rx_ind_histogram.pkts_31_40, 1); + } else if (msdu_count > 20) { + TXRX_STATS_ADD(pdev, pub.rx.rx_ind_histogram.pkts_21_30, 1); + } else if (msdu_count > 10) { + TXRX_STATS_ADD(pdev, pub.rx.rx_ind_histogram.pkts_11_20, 1); + } else if (msdu_count > 1) { + TXRX_STATS_ADD(pdev, pub.rx.rx_ind_histogram.pkts_2_10, 1); + } else if (msdu_count == 1) { + TXRX_STATS_ADD(pdev, pub.rx.rx_ind_histogram.pkts_1, 1); + } +} + static void ol_rx_process_inv_peer(ol_txrx_pdev_handle pdev, void *rx_mpdu_desc, qdf_nbuf_t msdu) { @@ -808,6 +843,7 @@ ol_rx_mic_error_handler( struct ol_txrx_vdev_t *vdev = NULL; if (pdev) { + TXRX_STATS_MSDU_INCR(pdev, rx.dropped_mic_err, msdu); peer = ol_txrx_peer_find_by_id(pdev, peer_id); if (peer) { vdev = peer->vdev; @@ -1298,6 +1334,8 @@ ol_rx_in_order_indication_handler(ol_txrx_pdev_handle pdev, while (head_msdu) { qdf_nbuf_t msdu = head_msdu; head_msdu = qdf_nbuf_next(head_msdu); + TXRX_STATS_MSDU_INCR(pdev, + rx.dropped_peer_invalid, msdu); htt_rx_desc_frame_free(htt_pdev, msdu); } return; diff --git a/core/dp/txrx/ol_rx.h b/core/dp/txrx/ol_rx.h index 536a6d888f82..58a7114838e9 100644 --- a/core/dp/txrx/ol_rx.h +++ b/core/dp/txrx/ol_rx.h @@ -56,6 +56,7 @@ void ol_rx_offload_paddr_deliver_ind_handler(htt_pdev_handle htt_pdev, uint32_t msdu_count, uint32_t *msg_word); +void ol_rx_update_histogram_stats(uint32_t msdu_count); void ol_rx_mic_error_handler( diff --git a/core/dp/txrx/ol_tx.c b/core/dp/txrx/ol_tx.c index e8b5e9b7d2c0..5a9db2d89aa3 100644 --- a/core/dp/txrx/ol_tx.c +++ b/core/dp/txrx/ol_tx.c @@ -142,10 +142,18 @@ static inline uint8_t ol_tx_prepare_tso(ol_txrx_vdev_handle vdev, qdf_nbuf_t ol_tx_data(ol_txrx_vdev_handle vdev, qdf_nbuf_t skb) { void *qdf_ctx = cds_get_context(QDF_MODULE_ID_QDF_DEVICE); - struct ol_txrx_pdev_t *pdev = vdev->pdev; + struct ol_txrx_pdev_t *pdev; qdf_nbuf_t ret; QDF_STATUS status; + if (qdf_unlikely(!vdev)) { + QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_WARN, + "%s:vdev is null", __func__); + return skb; + } else { + pdev = vdev->pdev; + } + if (qdf_unlikely(!pdev)) { QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_WARN, "%s:pdev is null", __func__); @@ -384,10 +392,10 @@ ol_tx_prepare_ll_fast(struct ol_txrx_pdev_t *pdev, tx_desc->netbuf = msdu; if (msdu_info->tso_info.is_tso) { tx_desc->tso_desc = msdu_info->tso_info.curr_seg; - tx_desc->pkt_type = ol_tx_frm_tso; + tx_desc->pkt_type = OL_TX_FRM_TSO; TXRX_STATS_MSDU_INCR(pdev, tx.tso.tso_pkts, msdu); } else { - tx_desc->pkt_type = ol_tx_frm_std; + tx_desc->pkt_type = OL_TX_FRM_STD; } htt_tx_desc = tx_desc->htt_tx_desc; @@ -1049,9 +1057,9 @@ ol_tx_non_std_ll(ol_txrx_vdev_handle vdev, if (tx_spec != OL_TX_SPEC_STD) { if (tx_spec & OL_TX_SPEC_NO_FREE) { - tx_desc->pkt_type = OL_TX_SPEC_NO_FREE; + tx_desc->pkt_type = OL_TX_FRM_NO_FREE; } else if (tx_spec & OL_TX_SPEC_TSO) { - tx_desc->pkt_type = OL_TX_SPEC_TSO; + tx_desc->pkt_type = OL_TX_FRM_TSO; } else if (tx_spec & OL_TX_SPEC_NWIFI_NO_ENCRYPT) { uint8_t sub_type = ol_txrx_tx_raw_subtype(tx_spec); diff --git a/core/dp/txrx/ol_tx_desc.c b/core/dp/txrx/ol_tx_desc.c index cfba71b28dc5..152beec4467b 100644 --- a/core/dp/txrx/ol_tx_desc.c +++ b/core/dp/txrx/ol_tx_desc.c @@ -122,6 +122,7 @@ struct ol_tx_desc_t *ol_tx_desc_alloc(struct ol_txrx_pdev_t *pdev, qdf_spin_lock_bh(&pdev->tx_mutex); if (pdev->tx_desc.freelist) { tx_desc = ol_tx_get_desc_global_pool(pdev); + ol_tx_desc_dup_detect_set(pdev, tx_desc); ol_tx_desc_sanity_checks(pdev, tx_desc); ol_tx_desc_compute_delay(tx_desc); } @@ -165,6 +166,7 @@ struct ol_tx_desc_t *ol_tx_desc_alloc(struct ol_txrx_pdev_t *pdev, qdf_spin_lock_bh(&pool->flow_pool_lock); if (pool->avail_desc) { tx_desc = ol_tx_get_desc_flow_pool(pool); + ol_tx_desc_dup_detect_set(pdev, tx_desc); if (qdf_unlikely(pool->avail_desc < pool->stop_th)) { pool->status = FLOW_POOL_ACTIVE_PAUSED; qdf_spin_unlock_bh(&pool->flow_pool_lock); @@ -230,7 +232,7 @@ void ol_tx_desc_free(struct ol_txrx_pdev_t *pdev, struct ol_tx_desc_t *tx_desc) { qdf_spin_lock_bh(&pdev->tx_mutex); - if (tx_desc->pkt_type == ol_tx_frm_tso) { + if (tx_desc->pkt_type == OL_TX_FRM_TSO) { if (qdf_unlikely(tx_desc->tso_desc == NULL)) { qdf_print("%s %d TSO desc is NULL!\n", __func__, __LINE__); @@ -239,6 +241,7 @@ void ol_tx_desc_free(struct ol_txrx_pdev_t *pdev, struct ol_tx_desc_t *tx_desc) ol_tso_free_segment(pdev, tx_desc->tso_desc); } } + ol_tx_desc_dup_detect_reset(pdev, tx_desc); ol_tx_desc_reset_pkt_type(tx_desc); ol_tx_desc_reset_timestamp(tx_desc); @@ -259,7 +262,7 @@ void ol_tx_desc_free(struct ol_txrx_pdev_t *pdev, struct ol_tx_desc_t *tx_desc) struct ol_tx_flow_pool_t *pool = tx_desc->pool; #if defined(FEATURE_TSO) - if (tx_desc->pkt_type == ol_tx_frm_tso) { + if (tx_desc->pkt_type == OL_TX_FRM_TSO) { if (qdf_unlikely(tx_desc->tso_desc == NULL)) qdf_print("%s %d TSO desc is NULL!\n", __func__, __LINE__); @@ -271,6 +274,7 @@ void ol_tx_desc_free(struct ol_txrx_pdev_t *pdev, struct ol_tx_desc_t *tx_desc) ol_tx_desc_reset_timestamp(tx_desc); qdf_spin_lock_bh(&pool->flow_pool_lock); + ol_tx_desc_dup_detect_reset(pdev, tx_desc); ol_tx_put_desc_flow_pool(pool, tx_desc); switch (pool->status) { case FLOW_POOL_ACTIVE_PAUSED: @@ -359,14 +363,13 @@ struct ol_tx_desc_t *ol_tx_desc_ll(struct ol_txrx_pdev_t *pdev, if (msdu_info->tso_info.is_tso) { tx_desc->tso_desc = msdu_info->tso_info.curr_seg; - tx_desc->pkt_type = ol_tx_frm_tso; + tx_desc->pkt_type = OL_TX_FRM_TSO; TXRX_STATS_MSDU_INCR(pdev, tx.tso.tso_pkts, netbuf); } else { - tx_desc->pkt_type = ol_tx_frm_std; + tx_desc->pkt_type = OL_TX_FRM_STD; } /* initialize the HW tx descriptor */ - htt_tx_desc_init(pdev->htt_pdev, tx_desc->htt_tx_desc, tx_desc->htt_tx_desc_paddr, ol_tx_desc_id(pdev, tx_desc), netbuf, &msdu_info->htt, @@ -472,7 +475,7 @@ void ol_tx_desc_frame_free_nonstd(struct ol_txrx_pdev_t *pdev, #endif trace_str = (had_error) ? "OT:C:F:" : "OT:C:S:"; qdf_nbuf_trace_update(tx_desc->netbuf, trace_str); - if (tx_desc->pkt_type == ol_tx_frm_no_free) { + if (tx_desc->pkt_type == OL_TX_FRM_NO_FREE) { /* free the tx desc but don't unmap or free the frame */ if (pdev->tx_data_callback.func) { qdf_nbuf_set_next(tx_desc->netbuf, NULL); diff --git a/core/dp/txrx/ol_tx_desc.h b/core/dp/txrx/ol_tx_desc.h index 9b0cf42ee135..ed726503ae6d 100644 --- a/core/dp/txrx/ol_tx_desc.h +++ b/core/dp/txrx/ol_tx_desc.h @@ -37,6 +37,11 @@ #include <cdp_txrx_cmn.h> /* ol_txrx_vdev_t, etc. */ #include <ol_txrx_internal.h> /*TXRX_ASSERT2 */ +#define DIV_BY_8 3 +#define DIV_BY_32 5 +#define MOD_BY_8 0x7 +#define MOD_BY_32 0x1F + struct ol_tx_desc_t * ol_tx_desc_alloc_wrapper(struct ol_txrx_pdev_t *pdev, struct ol_txrx_vdev_t *vdev, @@ -253,4 +258,120 @@ static inline int ol_tx_free_invalid_flow_pool(void *pool) } #endif +#ifdef DESC_DUP_DETECT_DEBUG +/** + * ol_tx_desc_dup_detect_init() - initialize descriptor duplication logic + * @pdev: pdev handle + * @pool_size: global pool size + * + * Return: none + */ +static inline +void ol_tx_desc_dup_detect_init(struct ol_txrx_pdev_t *pdev, uint16_t pool_size) +{ + uint16_t size = (pool_size >> DIV_BY_8) + + ((pool_size & MOD_BY_8) ? 1 : 0); + pdev->tx_desc.free_list_bitmap = qdf_mem_malloc(size); + if (!pdev->tx_desc.free_list_bitmap) + qdf_print("%s: malloc failed", __func__); +} + +/** + * ol_tx_desc_dup_detect_deinit() - deinit descriptor duplication logic + * @pdev: pdev handle + * + * Return: none + */ +static inline +void ol_tx_desc_dup_detect_deinit(struct ol_txrx_pdev_t *pdev) +{ + qdf_print("%s: pool_size %d num_free %d\n", __func__, + pdev->tx_desc.pool_size, pdev->tx_desc.num_free); + if (pdev->tx_desc.free_list_bitmap) + qdf_mem_free(pdev->tx_desc.free_list_bitmap); +} + +/** + * ol_tx_desc_dup_detect_set() - set bit for msdu_id + * @pdev: pdev handle + * @tx_desc: tx descriptor + * + * Return: none + */ +static inline +void ol_tx_desc_dup_detect_set(struct ol_txrx_pdev_t *pdev, + struct ol_tx_desc_t *tx_desc) +{ + uint16_t msdu_id = ol_tx_desc_id(pdev, tx_desc); + uint16_t index = msdu_id >> DIV_BY_32; + uint8_t pos = msdu_id & MOD_BY_32; + + if (!pdev->tx_desc.free_list_bitmap) + return; + + if (qdf_unlikely(pdev->tx_desc.free_list_bitmap[index] & (1 << pos))) { + uint16_t size = (pdev->tx_desc.pool_size >> DIV_BY_8) + + ((pdev->tx_desc.pool_size & MOD_BY_8) ? 1 : 0); + qdf_print("duplicate msdu_id %d detected !!\n", msdu_id); + qdf_trace_hex_dump(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR, + (void *)pdev->tx_desc.free_list_bitmap, size); + QDF_BUG(0); + } + pdev->tx_desc.free_list_bitmap[index] |= (1 << pos); +} + +/** + * ol_tx_desc_dup_detect_reset() - reset bit for msdu_id + * @pdev: pdev handle + * @tx_desc: tx descriptor + * + * Return: none + */ +static inline +void ol_tx_desc_dup_detect_reset(struct ol_txrx_pdev_t *pdev, + struct ol_tx_desc_t *tx_desc) +{ + uint16_t msdu_id = ol_tx_desc_id(pdev, tx_desc); + uint16_t index = msdu_id >> DIV_BY_32; + uint8_t pos = msdu_id & MOD_BY_32; + + if (!pdev->tx_desc.free_list_bitmap) + return; + + if (qdf_unlikely(! + (pdev->tx_desc.free_list_bitmap[index] & (1 << pos)))) { + uint16_t size = (pdev->tx_desc.pool_size >> DIV_BY_8) + + ((pdev->tx_desc.pool_size & MOD_BY_8) ? 1 : 0); + qdf_print("duplicate free msg received for msdu_id %d!!\n", + msdu_id); + qdf_trace_hex_dump(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR, + (void *)pdev->tx_desc.free_list_bitmap, size); + QDF_BUG(0); + } + pdev->tx_desc.free_list_bitmap[index] &= ~(1 << pos); +} +#else +static inline +void ol_tx_desc_dup_detect_init(struct ol_txrx_pdev_t *pdev, uint16_t size) +{ +} + +static inline +void ol_tx_desc_dup_detect_deinit(struct ol_txrx_pdev_t *pdev) +{ +} + +static inline +void ol_tx_desc_dup_detect_set(struct ol_txrx_pdev_t *pdev, + struct ol_tx_desc_t *tx_desc) +{ +} + +static inline +void ol_tx_desc_dup_detect_reset(struct ol_txrx_pdev_t *pdev, + struct ol_tx_desc_t *tx_desc) +{ +} +#endif + #endif /* _OL_TX_DESC__H_ */ diff --git a/core/dp/txrx/ol_tx_send.c b/core/dp/txrx/ol_tx_send.c index c09d1091022a..a67a57097e1c 100644 --- a/core/dp/txrx/ol_tx_send.c +++ b/core/dp/txrx/ol_tx_send.c @@ -311,7 +311,7 @@ ol_tx_download_done_hl_free(void *txrx_pdev, ol_tx_download_done_base(pdev, status, msdu, msdu_id); - if ((tx_desc->pkt_type != ol_tx_frm_no_free) && + if ((tx_desc->pkt_type != OL_TX_FRM_NO_FREE) && (tx_desc->pkt_type < OL_TXRX_MGMT_TYPE_BASE)) { qdf_atomic_add(1, &pdev->tx_queue.rsrc_cnt); ol_tx_desc_frame_free_nonstd(pdev, tx_desc, status != A_OK); @@ -406,7 +406,7 @@ ol_tx_delay_compute(struct ol_txrx_pdev_t *pdev, _netbuf, _lcl_freelist, \ _tx_desc_last, _status) \ do { \ - if (qdf_likely((_tx_desc)->pkt_type == ol_tx_frm_std)) { \ + if (qdf_likely((_tx_desc)->pkt_type == OL_TX_FRM_STD)) { \ ol_tx_msdu_complete_single((_pdev), (_tx_desc),\ (_netbuf), (_lcl_freelist), \ (_tx_desc_last)); \ @@ -428,7 +428,7 @@ ol_tx_delay_compute(struct ol_txrx_pdev_t *pdev, _netbuf, _lcl_freelist, \ _tx_desc_last, _status) \ do { \ - if (qdf_likely((_tx_desc)->pkt_type == ol_tx_frm_std)) { \ + if (qdf_likely((_tx_desc)->pkt_type == OL_TX_FRM_STD)) { \ ol_tx_msdu_complete_batch((_pdev), (_tx_desc), \ (_tx_descs), (_status)); \ } else { \ diff --git a/core/dp/txrx/ol_txrx.c b/core/dp/txrx/ol_txrx.c index c2b2490960dc..a3bd7be66fbc 100644 --- a/core/dp/txrx/ol_txrx.c +++ b/core/dp/txrx/ol_txrx.c @@ -548,6 +548,8 @@ ol_txrx_pdev_post_attach(ol_txrx_pdev_handle pdev) desc_pool_size = ol_tx_get_desc_global_pool_size(pdev); + ol_tx_desc_dup_detect_init(pdev, desc_pool_size); + setup_fastpath_ce_handles(osc, pdev); ret = htt_attach(pdev->htt_pdev, desc_pool_size); @@ -1081,6 +1083,8 @@ void ol_txrx_pdev_detach(ol_txrx_pdev_handle pdev, int force) htt_detach(pdev->htt_pdev); htt_pdev_free(pdev->htt_pdev); + ol_tx_desc_dup_detect_deinit(pdev); + ol_txrx_peer_find_detach(pdev); qdf_spinlock_destroy(&pdev->tx_mutex); @@ -1485,7 +1489,7 @@ ol_txrx_peer_attach(ol_txrx_vdev_handle vdev, uint8_t *peer_mac_addr) if (wait_on_deletion) { /* wait for peer deletion */ rc = qdf_wait_single_event(&vdev->wait_delete_comp, - qdf_system_msecs_to_ticks(PEER_DELETION_TIMEOUT)); + PEER_DELETION_TIMEOUT); if (!rc) { TXRX_PRINT(TXRX_PRINT_LEVEL_ERR, "timedout waiting for peer(%d) deletion\n", @@ -2995,10 +2999,10 @@ ol_txrx_stats(uint8_t vdev_id, char *buffer, unsigned buf_len) void ol_txrx_stats_display(ol_txrx_pdev_handle pdev) { - QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR, "txrx stats:"); QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR, - " tx: sent %lld msdus (%lld B), " - " rejected %lld (%lld B), dropped %lld (%lld B)", + "TX PATH Statistics:"); + QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR, + "sent %lld msdus (%lld B), rejected %lld (%lld B), dropped %lld (%lld B)", pdev->stats.pub.tx.delivered.pkts, pdev->stats.pub.tx.delivered.bytes, pdev->stats.pub.tx.dropped.host_reject.pkts, @@ -3038,18 +3042,46 @@ void ol_txrx_stats_display(ol_txrx_pdev_handle pdev) pdev->stats.pub.tx.comp_histogram.pkts_51_60, pdev->stats.pub.tx.comp_histogram.pkts_61_plus); QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR, - " rx: %lld ppdus, %lld mpdus, %lld msdus, %lld bytes, %lld errs", + "RX PATH Statistics:"); + QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR, + "%lld ppdus, %lld mpdus, %lld msdus, %lld bytes\n" + "dropped: err %lld (%lld B), peer_invalid %lld (%lld B), mic_err %lld (%lld B)", pdev->stats.priv.rx.normal.ppdus, pdev->stats.priv.rx.normal.mpdus, pdev->stats.pub.rx.delivered.pkts, pdev->stats.pub.rx.delivered.bytes, - pdev->stats.priv.rx.err.mpdu_bad); + pdev->stats.pub.rx.dropped_err.pkts, + pdev->stats.pub.rx.dropped_err.bytes, + pdev->stats.pub.rx.dropped_peer_invalid.pkts, + pdev->stats.pub.rx.dropped_peer_invalid.bytes, + pdev->stats.pub.rx.dropped_mic_err.pkts, + pdev->stats.pub.rx.dropped_mic_err.bytes); + QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR, " fwd to stack %d, fwd to fw %d, fwd to stack & fw %d\n", pdev->stats.pub.rx.intra_bss_fwd.packets_stack, pdev->stats.pub.rx.intra_bss_fwd.packets_fwd, pdev->stats.pub.rx.intra_bss_fwd.packets_stack_n_fwd); + + QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR, + "rx packets per HTT indication:\n" + "Single Packet %d\n" + " 2-10 Packets %d\n" + "11-20 Packets %d\n" + "21-30 Packets %d\n" + "31-40 Packets %d\n" + "41-50 Packets %d\n" + "51-60 Packets %d\n" + " 60+ Packets %d\n", + pdev->stats.pub.rx.rx_ind_histogram.pkts_1, + pdev->stats.pub.rx.rx_ind_histogram.pkts_2_10, + pdev->stats.pub.rx.rx_ind_histogram.pkts_11_20, + pdev->stats.pub.rx.rx_ind_histogram.pkts_21_30, + pdev->stats.pub.rx.rx_ind_histogram.pkts_31_40, + pdev->stats.pub.rx.rx_ind_histogram.pkts_41_50, + pdev->stats.pub.rx.rx_ind_histogram.pkts_51_60, + pdev->stats.pub.rx.rx_ind_histogram.pkts_61_plus); } void ol_txrx_stats_clear(ol_txrx_pdev_handle pdev) @@ -3563,6 +3595,8 @@ static void ol_rx_data_cb(struct ol_txrx_pdev_t *pdev, ret = data_rx(osif_dev, buf); if (ret != QDF_STATUS_SUCCESS) { TXRX_PRINT(TXRX_PRINT_LEVEL_ERR, "Frame Rx to HDD failed"); + if (pdev) + TXRX_STATS_MSDU_INCR(pdev, rx.dropped_err, buf); qdf_nbuf_free(buf); } buf = next_buf; @@ -3574,6 +3608,9 @@ free_buf: buf = buf_list; while (buf) { next_buf = qdf_nbuf_queue_next(buf); + if (pdev) + TXRX_STATS_MSDU_INCR(pdev, + rx.dropped_peer_invalid, buf); qdf_nbuf_free(buf); buf = next_buf; } @@ -3675,6 +3712,9 @@ drop_rx_buf: buf = rx_buf_list; while (buf) { next_buf = qdf_nbuf_queue_next(buf); + if (pdev) + TXRX_STATS_MSDU_INCR(pdev, + rx.dropped_peer_invalid, buf); qdf_nbuf_free(buf); buf = next_buf; } @@ -3919,8 +3959,11 @@ void ol_register_lro_flush_cb(void (handler)(void *), void *data) (struct hif_opaque_softc *)cds_get_context(QDF_MODULE_ID_HIF); struct ol_txrx_pdev_t *pdev = cds_get_context(QDF_MODULE_ID_TXRX); - pdev->lro_info.lro_flush_cb = handler; - pdev->lro_info.lro_data = data; + if (pdev != NULL) { + pdev->lro_info.lro_flush_cb = handler; + pdev->lro_info.lro_data = data; + } else + TXRX_PRINT(TXRX_PRINT_LEVEL_ERR, "%s: pdev NULL!", __func__); hif_lro_flush_cb_register(hif_device, ol_txrx_lro_flush, pdev); } @@ -3942,8 +3985,11 @@ void ol_deregister_lro_flush_cb(void) hif_lro_flush_cb_deregister(hif_device); - pdev->lro_info.lro_flush_cb = NULL; - pdev->lro_info.lro_data = NULL; + if (pdev != NULL) { + pdev->lro_info.lro_flush_cb = NULL; + pdev->lro_info.lro_data = NULL; + } else + TXRX_PRINT(TXRX_PRINT_LEVEL_ERR, "%s: pdev NULL!", __func__); } #endif /* FEATURE_LRO */ diff --git a/core/dp/txrx/ol_txrx_types.h b/core/dp/txrx/ol_txrx_types.h index 42d7b368427b..ff36e192ae6b 100644 --- a/core/dp/txrx/ol_txrx_types.h +++ b/core/dp/txrx/ol_txrx_types.h @@ -117,10 +117,10 @@ struct privacy_exemption { }; enum ol_tx_frm_type { - ol_tx_frm_std = 0, /* regular frame - no added header fragments */ - ol_tx_frm_tso, /* TSO segment, with a modified IP header added */ - ol_tx_frm_audio, /* audio frames, with a custom LLC/SNAP hdr added */ - ol_tx_frm_no_free, /* frame requires special tx completion callback */ + OL_TX_FRM_STD = 0, /* regular frame - no added header fragments */ + OL_TX_FRM_TSO, /* TSO segment, with a modified IP header added */ + OL_TX_FRM_AUDIO, /* audio frames, with a custom LLC/SNAP hdr added */ + OL_TX_FRM_NO_FREE, /* frame requires special tx completion callback */ }; struct ol_tx_desc_t { @@ -564,6 +564,9 @@ struct ol_txrx_pdev_t { uint8_t page_divider; uint32_t offset_filter; struct qdf_mem_multi_page_t desc_pages; +#ifdef DESC_DUP_DETECT_DEBUG + uint32_t *free_list_bitmap; +#endif } tx_desc; uint8_t is_mgmt_over_wmi_enabled; diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index cdd77891d7e1..5d5e66fa440c 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -960,6 +960,7 @@ struct hdd_adapter_s { uint32_t tsf_high; /* TSF capture state */ enum hdd_tsf_capture_state tsf_state; + uint64_t tsf_sync_soc_timer; #endif hdd_cfg80211_state_t cfg80211State; @@ -1034,7 +1035,10 @@ struct hdd_adapter_s { /* BITMAP indicating pause reason */ uint32_t pause_map; spinlock_t pause_map_lock; - + qdf_time_t start_time; + qdf_time_t last_time; + qdf_time_t total_pause_time; + qdf_time_t total_unpause_time; uint8_t history_index; struct hdd_netif_queue_history queue_oper_history[WLAN_HDD_MAX_HISTORY_ENTRY]; @@ -1382,7 +1386,7 @@ struct hdd_context_s { qdf_spinlock_t connection_status_lock; uint16_t hdd_txrx_hist_idx; - struct hdd_tx_rx_histogram hdd_txrx_hist[NUM_TX_RX_HISTOGRAM]; + struct hdd_tx_rx_histogram *hdd_txrx_hist; /* * Dfs lock used to syncronize on sap channel switch during * radar found indication and application triggered channel @@ -1610,6 +1614,8 @@ void wlan_hdd_txrx_pause_cb(uint8_t vdev_id, enum netif_action_type action, enum netif_reason_type reason); void hdd_wlan_dump_stats(hdd_adapter_t *adapter, int value); +int wlan_hdd_init_tx_rx_histogram(hdd_context_t *hdd_ctx); +void wlan_hdd_deinit_tx_rx_histogram(hdd_context_t *hdd_ctx); void wlan_hdd_display_tx_rx_histogram(hdd_context_t *pHddCtx); void wlan_hdd_clear_tx_rx_histogram(hdd_context_t *pHddCtx); void wlan_hdd_display_netif_queue_history(hdd_context_t *hdd_ctx); diff --git a/core/hdd/inc/wlan_hdd_tsf.h b/core/hdd/inc/wlan_hdd_tsf.h index f251327d7f06..6d7ba787acee 100644 --- a/core/hdd/inc/wlan_hdd_tsf.h +++ b/core/hdd/inc/wlan_hdd_tsf.h @@ -64,6 +64,10 @@ enum hdd_tsf_capture_state { void wlan_hdd_tsf_init(struct hdd_context_s *hdd_ctx); int hdd_capture_tsf(struct hdd_adapter_s *adapter, uint32_t *buf, int len); int hdd_indicate_tsf(struct hdd_adapter_s *adapter, uint32_t *buf, int len); +int wlan_hdd_cfg80211_handle_tsf_cmd(struct wiphy *wiphy, + struct wireless_dev *wdev, + const void *data, + int data_len); #else static inline void wlan_hdd_tsf_init(struct hdd_context_s *hdd_ctx) { @@ -81,6 +85,14 @@ hdd_capture_tsf(struct hdd_adapter_s *adapter, uint32_t *buf, int len) { return -ENOTSUPP; } + +static inline int wlan_hdd_cfg80211_handle_tsf_cmd(struct wiphy *wiphy, + struct wireless_dev *wdev, + const void *data, + int data_len) +{ + return -ENOTSUPP; +} #endif #endif diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 79cc8b41943a..0b88eada7ab2 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -83,6 +83,7 @@ #include "wlan_hdd_memdump.h" #include "wlan_hdd_ocb.h" +#include "wlan_hdd_tsf.h" #include "wlan_hdd_subnet_detect.h" @@ -1052,6 +1053,12 @@ static const struct nl80211_vendor_cmd_info wlan_hdd_cfg80211_vendor_events[] = .subcmd = QCA_NL80211_VENDOR_SUBCMD_WIFI_LOGGER_MEMORY_DUMP }, #endif /* WLAN_FEATURE_MEMDUMP */ +#ifdef WLAN_FEATURE_TSF + [QCA_NL80211_VENDOR_SUBCMD_TSF_INDEX] = { + .vendor_id = QCA_NL80211_VENDOR_ID, + .subcmd = QCA_NL80211_VENDOR_SUBCMD_TSF + }, +#endif [QCA_NL80211_VENDOR_SUBCMD_SCAN_DONE_INDEX] = { .vendor_id = QCA_NL80211_VENDOR_ID, .subcmd = QCA_NL80211_VENDOR_SUBCMD_SCAN_DONE @@ -2773,7 +2780,7 @@ static int __wlan_hdd_cfg80211_disable_dfs_chan_scan(struct wiphy *wiphy, * * @wiphy: wiphy device pointer * @wdev: wireless device pointer - * @data: Vendof command data buffer + * @data: Vendor command data buffer * @data_len: Buffer length * * Handles QCA_WLAN_VENDOR_ATTR_SET_NO_DFS_FLAG_MAX. Validate it and @@ -2797,6 +2804,95 @@ static int wlan_hdd_cfg80211_disable_dfs_chan_scan(struct wiphy *wiphy, return ret; } +static const struct nla_policy +wlan_hdd_wisa_cmd_policy[QCA_WLAN_VENDOR_ATTR_WISA_MAX + 1] = { + [QCA_WLAN_VENDOR_ATTR_WISA_MODE] = {.type = NLA_U32 }, +}; + +/** + * __wlan_hdd_cfg80211_handle_wisa_cmd() - Handle WISA vendor cmd + * @wiphy: wiphy device pointer + * @wdev: wireless device pointer + * @data: Vendor command data buffer + * @data_len: Buffer length + * + * Handles QCA_WLAN_VENDOR_SUBCMD_WISA. Validate cmd attributes and + * setup WISA Mode features. + * + * Return: Success(0) or reason code for failure + */ +static int __wlan_hdd_cfg80211_handle_wisa_cmd(struct wiphy *wiphy, + struct wireless_dev *wdev, const void *data, int data_len) +{ + struct net_device *dev = wdev->netdev; + hdd_adapter_t *adapter = WLAN_HDD_GET_PRIV_PTR(dev); + hdd_context_t *hdd_ctx = wiphy_priv(wiphy); + struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_WISA_MAX + 1]; + struct sir_wisa_params wisa; + int ret_val; + QDF_STATUS status; + bool wisa_mode; + + ENTER_DEV(dev); + ret_val = wlan_hdd_validate_context(hdd_ctx); + if (ret_val) + goto err; + + if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { + hdd_err("Command not allowed in FTM mode"); + return -EPERM; + } + + if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_WISA_MAX, data, data_len, + wlan_hdd_wisa_cmd_policy)) { + hdd_err("Invalid WISA cmd attributes"); + ret_val = -EINVAL; + goto err; + } + if (!tb[QCA_WLAN_VENDOR_ATTR_WISA_MODE]) { + hdd_err("Invalid WISA mode"); + ret_val = -EINVAL; + goto err; + } + + wisa_mode = !!nla_get_u32(tb[QCA_WLAN_VENDOR_ATTR_WISA_MODE]); + hdd_info("WISA Mode: %d", wisa_mode); + wisa.mode = wisa_mode; + wisa.vdev_id = adapter->sessionId; + status = sme_set_wisa_params(hdd_ctx->hHal, &wisa); + if (!QDF_IS_STATUS_SUCCESS(status)) + ret_val = -EINVAL; +err: + EXIT(); + return ret_val; +} + +/** + * wlan_hdd_cfg80211_handle_wisa_cmd() - Handle WISA vendor cmd + * @wiphy: corestack handler + * @wdev: wireless device + * @data: data + * @data_len: data length + * + * Handles QCA_WLAN_VENDOR_SUBCMD_WISA. Validate cmd attributes and + * setup WISA mode features. + * + * Return: Success(0) or reason code for failure + */ +static int wlan_hdd_cfg80211_handle_wisa_cmd(struct wiphy *wiphy, + struct wireless_dev *wdev, + const void *data, + int data_len) +{ + int ret; + + cds_ssr_protect(__func__); + ret = __wlan_hdd_cfg80211_handle_wisa_cmd(wiphy, wdev, data, data_len); + cds_ssr_unprotect(__func__); + + return ret; +} + #ifdef WLAN_FEATURE_ROAM_OFFLOAD /** * __wlan_hdd_cfg80211_keymgmt_set_key() - Store the Keys in the driver session @@ -5435,7 +5531,13 @@ const struct wiphy_vendor_command hdd_wiphy_vendor_commands[] = { WIPHY_VENDOR_CMD_NEED_NETDEV, .doit = wlan_hdd_cfg80211_disable_dfs_chan_scan }, - + { + .info.vendor_id = QCA_NL80211_VENDOR_ID, + .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_WISA, + .flags = WIPHY_VENDOR_CMD_NEED_WDEV | + WIPHY_VENDOR_CMD_NEED_NETDEV, + .doit = wlan_hdd_cfg80211_handle_wisa_cmd + }, { .info.vendor_id = QCA_NL80211_VENDOR_ID, .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_DO_ACS, @@ -5550,6 +5652,16 @@ const struct wiphy_vendor_command hdd_wiphy_vendor_commands[] = { WIPHY_VENDOR_CMD_NEED_RUNNING, .doit = wlan_hdd_cfg80211_set_probable_oper_channel }, +#ifdef WLAN_FEATURE_TSF + { + .info.vendor_id = QCA_NL80211_VENDOR_ID, + .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_TSF, + .flags = WIPHY_VENDOR_CMD_NEED_WDEV | + WIPHY_VENDOR_CMD_NEED_NETDEV | + WIPHY_VENDOR_CMD_NEED_RUNNING, + .doit = wlan_hdd_cfg80211_handle_tsf_cmd + }, +#endif #ifdef FEATURE_WLAN_TDLS { .info.vendor_id = QCA_NL80211_VENDOR_ID, @@ -7835,6 +7947,8 @@ wlan_hdd_cfg80211_inform_bss_frame(hdd_adapter_t *pAdapter, qie_age->age = qdf_mc_timer_get_system_ticks() - bss_desc->nReceivedTime; qie_age->tsf_delta = bss_desc->tsf_delta; + memcpy(&qie_age->beacon_tsf, bss_desc->timeStamp, + sizeof(qie_age->beacon_tsf)); #endif memcpy(mgmt->u.probe_resp.variable, ie, ie_length); diff --git a/core/hdd/src/wlan_hdd_cfg80211.h b/core/hdd/src/wlan_hdd_cfg80211.h index 1a185b0e30fd..2ff4032b00dc 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.h +++ b/core/hdd/src/wlan_hdd_cfg80211.h @@ -121,6 +121,7 @@ * @type: Type * @age: Age * @tsf_delta: tsf delta from FW + * @beacon_tsf: original beacon TSF */ typedef struct { u8 element_id; @@ -131,6 +132,7 @@ typedef struct { u32 type; u32 age; u32 tsf_delta; + u64 beacon_tsf; } __attribute__ ((packed)) qcom_ie_age; #endif @@ -256,6 +258,8 @@ typedef enum { * @QCA_NL80211_VENDOR_SUBCMD_GW_PARAM_CONFIG: set gateway parameters * @QCA_NL80211_VENDOR_SUBCMD_SET_TXPOWER_SCALE: set tx power by percentage * @QCA_NL80211_VENDOR_SUBCMD_SET_TXPOWER_SCALE_DECR_DB: reduce tx power by DB + * @QCA_NL80211_VENDOR_SUBCMD_TSF: TSF operations command + * @QCA_NL80211_VENDOR_SUBCMD_WISA: WISA mode configuration */ enum qca_nl80211_vendor_subcmds { @@ -375,7 +379,8 @@ enum qca_nl80211_vendor_subcmds { QCA_NL80211_VENDOR_SUBCMD_SET_TXPOWER_SCALE = 109, /* Tx power scaling in db subcommands */ QCA_NL80211_VENDOR_SUBCMD_SET_TXPOWER_SCALE_DECR_DB = 115, - + QCA_NL80211_VENDOR_SUBCMD_TSF = 119, + QCA_NL80211_VENDOR_SUBCMD_WISA = 120, }; /** @@ -436,6 +441,7 @@ enum qca_nl80211_vendor_subcmds { * vendor scan complete event index * @QCA_NL80211_VENDOR_SUBCMD_GW_PARAM_CONFIG_INDEX: * update gateway parameters index + * @QCA_NL80211_VENDOR_SUBCMD_TSF_INDEX: TSF response events index */ enum qca_nl80211_vendor_subcmds_index { @@ -505,6 +511,9 @@ enum qca_nl80211_vendor_subcmds_index { QCA_NL80211_VENDOR_SUBCMD_SCAN_INDEX, QCA_NL80211_VENDOR_SUBCMD_SCAN_DONE_INDEX, QCA_NL80211_VENDOR_SUBCMD_GW_PARAM_CONFIG_INDEX, +#ifdef WLAN_FEATURE_TSF + QCA_NL80211_VENDOR_SUBCMD_TSF_INDEX, +#endif }; /** @@ -1555,6 +1564,21 @@ enum qca_wlan_vendor_attr_set_no_dfs_flag { QCA_WLAN_VENDOR_ATTR_SET_NO_DFS_FLAG_AFTER_LAST - 1, }; +/** + * enum qca_vendor_attr_wisa_cmd + * @QCA_WLAN_VENDOR_ATTR_WISA_INVALID: Invalid attr + * @QCA_WLAN_VENDOR_ATTR_WISA_MODE: WISA mode value attr (u32) + * @QCA_WLAN_VENDOR_ATTR_WISA_AFTER_LAST: After last + * @QCA_WLAN_VENDOR_ATTR_WISA_MAX: Max Value + * WISA setup vendor commands + */ +enum qca_vendor_attr_wisa_cmd { + QCA_WLAN_VENDOR_ATTR_WISA_INVALID = 0, + QCA_WLAN_VENDOR_ATTR_WISA_MODE, + QCA_WLAN_VENDOR_ATTR_WISA_AFTER_LAST, + QCA_WLAN_VENDOR_ATTR_WISA_MAX = + QCA_WLAN_VENDOR_ATTR_WISA_AFTER_LAST - 1 +}; /** * enum qca_wlan_vendor_attr_roam_auth - vendor event for roaming @@ -2174,6 +2198,38 @@ enum qca_wlan_vendor_attr_packet_filter { }; /** + * enum qca_vendor_attr_get_tsf: Vendor attributes for TSF capture + * @QCA_WLAN_VENDOR_ATTR_TSF_INVALID: Invalid attribute value + * @QCA_WLAN_VENDOR_ATTR_TSF_CMD: enum qca_tsf_operation (u32) + * @QCA_WLAN_VENDOR_ATTR_TSF_TIMER_VALUE: Unsigned 64 bit TSF timer value + * @QCA_WLAN_VENDOR_ATTR_TSF_SOC_TIMER_VALUE: Unsigned 64 bit Synchronized + * SOC timer value at TSF capture + * @QCA_WLAN_VENDOR_ATTR_TSF_AFTER_LAST: after last + * @QCA_WLAN_VENDOR_ATTR_TSF_MAX: Max value + */ +enum qca_vendor_attr_tsf_cmd { + QCA_WLAN_VENDOR_ATTR_TSF_INVALID = 0, + QCA_WLAN_VENDOR_ATTR_TSF_CMD, + QCA_WLAN_VENDOR_ATTR_TSF_TIMER_VALUE, + QCA_WLAN_VENDOR_ATTR_TSF_SOC_TIMER_VALUE, + QCA_WLAN_VENDOR_ATTR_TSF_AFTER_LAST, + QCA_WLAN_VENDOR_ATTR_TSF_MAX = + QCA_WLAN_VENDOR_ATTR_TSF_AFTER_LAST - 1 +}; + +/** + * enum qca_tsf_operation: TSF driver commands + * @QCA_TSF_CAPTURE: Initiate TSF Capture + * @QCA_TSF_GET: Get TSF capture value + * @QCA_TSF_SYNC_GET: Initiate TSF capture and return with captured value + */ +enum qca_tsf_cmd { + QCA_TSF_CAPTURE, + QCA_TSF_GET, + QCA_TSF_SYNC_GET, +}; + +/** * enum qca_vendor_attr_get_preferred_freq_list - get preferred channel list * @QCA_WLAN_VENDOR_ATTR_GET_PREFERRED_FREQ_LIST_INVALID: invalid value * @QCA_WLAN_VENDOR_ATTR_GET_PREFERRED_FREQ_LIST_IFACE_TYPE: interface type diff --git a/core/hdd/src/wlan_hdd_driver_ops.c b/core/hdd/src/wlan_hdd_driver_ops.c index c5fc181def9b..0bccd0c76559 100644 --- a/core/hdd/src/wlan_hdd_driver_ops.c +++ b/core/hdd/src/wlan_hdd_driver_ops.c @@ -303,12 +303,14 @@ static void hdd_hif_close(void *hif_ctx) * * Return: void */ -void hdd_init_qdf_ctx(struct device *dev, void *bdev) +void hdd_init_qdf_ctx(struct device *dev, void *bdev, + enum qdf_bus_type bus_type) { qdf_device_t qdf_dev = cds_get_context(QDF_MODULE_ID_QDF_DEVICE); qdf_dev->dev = dev; qdf_dev->drv_hdl = bdev; + qdf_dev->bus_type = bus_type; } /** @@ -362,7 +364,7 @@ static int wlan_hdd_probe(struct device *dev, void *bdev, const hif_bus_id *bid, goto err_hdd_deinit; } - hdd_init_qdf_ctx(dev, bdev); + hdd_init_qdf_ctx(dev, bdev, bus_type); ret = hdd_hif_open(dev, bdev, bid, bus_type, reinit); diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index bf0cb5c310ba..bf4133562d48 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -6409,6 +6409,8 @@ hdd_adapter_t *hdd_wlan_create_ap_dev(hdd_context_t *pHddCtx, SET_NETDEV_DEV(pWlanHostapdDev, pHddCtx->parent_dev); spin_lock_init(&pHostapdAdapter->pause_map_lock); + pHostapdAdapter->start_time = + pHostapdAdapter->last_time = qdf_system_ticks(); } return pHostapdAdapter; } diff --git a/core/hdd/src/wlan_hdd_ioctl.c b/core/hdd/src/wlan_hdd_ioctl.c index fc3f3d1d6ff0..ded6f9bc1fc2 100644 --- a/core/hdd/src/wlan_hdd_ioctl.c +++ b/core/hdd/src/wlan_hdd_ioctl.c @@ -27,6 +27,9 @@ /* Include Files */ +/* denote that this file does not allow legacy hddLog */ +#define HDD_DISALLOW_LEGACY_HDDLOG 1 + #include <wlan_hdd_includes.h> #include <wlan_hdd_wowl.h> #include "wlan_hdd_trace.h" @@ -136,8 +139,7 @@ static void hdd_get_tsm_stats_cb(tAniTrafStrmMetrics tsm_metrics, hdd_adapter_t *adapter = NULL; if (NULL == context) { - hddLog(QDF_TRACE_LEVEL_ERROR, - "%s: Bad param, context [%p]", __func__, context); + hdd_err("Bad param, context [%p]", context); return; } @@ -158,9 +160,8 @@ static void hdd_get_tsm_stats_cb(tAniTrafStrmMetrics tsm_metrics, * nothing we can do */ spin_unlock(&hdd_context_lock); - hddLog(QDF_TRACE_LEVEL_WARN, - "%s: Invalid context, adapter [%p] magic [%08x]", - __func__, adapter, stats_context->magic); + hdd_warn("Invalid context, adapter [%p] magic [%08x]", + adapter, stats_context->magic); return; } @@ -201,8 +202,7 @@ QDF_STATUS hdd_get_tsm_stats(hdd_adapter_t *adapter, hdd_context_t *hdd_ctx = NULL; if (NULL == adapter) { - hddLog(QDF_TRACE_LEVEL_ERROR, - "%s: adapter is NULL", __func__); + hdd_err("adapter is NULL"); return QDF_STATUS_E_FAULT; } @@ -220,17 +220,14 @@ QDF_STATUS hdd_get_tsm_stats(hdd_adapter_t *adapter, hdd_sta_ctx->conn_info.bssId, &context, hdd_ctx->pcds_context, tid); if (QDF_STATUS_SUCCESS != hstatus) { - hddLog(QDF_TRACE_LEVEL_ERROR, - "%s: Unable to retrieve statistics", __func__); + hdd_err("Unable to retrieve statistics"); vstatus = QDF_STATUS_E_FAULT; } else { /* request was sent -- wait for the response */ rc = wait_for_completion_timeout(&context.completion, msecs_to_jiffies(WLAN_WAIT_TIME_STATS)); if (!rc) { - hddLog(QDF_TRACE_LEVEL_ERROR, - "%s: SME timed out while retrieving statistics", - __func__); + hdd_err("SME timed out while retrieving statistics"); vstatus = QDF_STATUS_E_TIMEOUT; } } @@ -305,7 +302,7 @@ static int hdd_parse_setrmcenable_command(uint8_t *pValue, *pRmcEnable = tempInt; - hddLog(LOG1, FL("ucRmcEnable: %d"), *pRmcEnable); + hdd_info("ucRmcEnable: %d", *pRmcEnable); return 0; } @@ -350,7 +347,7 @@ static int hdd_parse_setrmcactionperiod_command(uint8_t *pValue, *pActionPeriod = tempInt; - hddLog(LOG1, FL("uActionPeriod: %d"), *pActionPeriod); + hdd_info("uActionPeriod: %d", *pActionPeriod); return 0; } @@ -392,8 +389,7 @@ static int hdd_parse_setrmcrate_command(uint8_t *pValue, switch (tempInt) { default: - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_WARN, - "Unsupported rate: %d", tempInt); + hdd_warn("Unsupported rate: %d", tempInt); return -EINVAL; case 0: case 6: @@ -417,7 +413,7 @@ static int hdd_parse_setrmcrate_command(uint8_t *pValue, break; } - hddLog(LOG1, FL("Rate: %d"), *pRate); + hdd_info("Rate: %d", *pRate); return 0; } @@ -443,8 +439,7 @@ hdd_get_ibss_peer_info_cb(void *pUserData, /* Sanity check */ if ((NULL == adapter) || (WLAN_HDD_ADAPTER_MAGIC != adapter->magic)) { - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_FATAL, - "invalid adapter or adapter has invalid magic"); + hdd_alert("invalid adapter or adapter has invalid magic"); return; } @@ -465,7 +460,7 @@ hdd_get_ibss_peer_info_cb(void *pUserData, pPeerInfo->numPeers, SIR_MAX_NUM_STA_IN_IBSS); } } else { - hddLog(LOG1, FL("peerInfo returned is NULL")); + hdd_info("peerInfo returned is NULL"); } complete(&adapter->ibss_peer_info_comp); @@ -499,16 +494,12 @@ QDF_STATUS hdd_cfg80211_get_ibss_peer_info_all(hdd_adapter_t *adapter) /* status will be 0 if timed out */ if (!rc) { - hddLog(QDF_TRACE_LEVEL_WARN, - "%s: Warning: IBSS_PEER_INFO_TIMEOUT", - __func__); + hdd_warn("Warning: IBSS_PEER_INFO_TIMEOUT"); retStatus = QDF_STATUS_E_FAILURE; return retStatus; } } else { - hddLog(QDF_TRACE_LEVEL_WARN, - "%s: Warning: sme_request_ibss_peer_info Request failed", - __func__); + hdd_warn("Warning: sme_request_ibss_peer_info Request failed"); } return retStatus; @@ -543,16 +534,12 @@ hdd_cfg80211_get_ibss_peer_info(hdd_adapter_t *adapter, uint8_t staIdx) /* status = 0 on timeout */ if (!rc) { - hddLog(QDF_TRACE_LEVEL_WARN, - "%s: Warning: IBSS_PEER_INFO_TIMEOUT", - __func__); + hdd_warn("Warning: IBSS_PEER_INFO_TIMEOUT"); retStatus = QDF_STATUS_E_FAILURE; return retStatus; } } else { - hddLog(QDF_TRACE_LEVEL_WARN, - "%s: Warning: sme_request_ibss_peer_info Request failed", - __func__); + hdd_warn("Warning: sme_request_ibss_peer_info Request failed"); } return retStatus; @@ -613,8 +600,7 @@ static void hdd_get_band_helper(hdd_context_t *hdd_ctx, int *pBand) break; default: - hddLog(QDF_TRACE_LEVEL_WARN, "%s: Invalid Band %d", __func__, - band); + hdd_warn("Invalid Band %d", band); *pBand = -1; break; } @@ -663,11 +649,8 @@ static int _hdd_parse_bssid_and_chan(const uint8_t **data, v = sscanf(in_ptr, "%17s", mac_addr); if (!((1 == v) && hdd_is_valid_mac_address(mac_addr))) { - hddLog(LOGE, - FL( - "Invalid MAC address or All hex inputs are not read (%d)" - ), - v); + hdd_err("Invalid MAC address or All hex inputs are not read (%d)", + v); goto error; } @@ -808,7 +791,7 @@ hdd_parse_send_action_frame_v1_data(const uint8_t *pValue, */ *pBuf = qdf_mem_malloc((*pBufLen + 1) / 2); if (NULL == *pBuf) { - hddLog(LOGE, FL("qdf_mem_malloc failed")); + hdd_err("qdf_mem_malloc failed"); return -ENOMEM; } @@ -882,7 +865,7 @@ hdd_reassoc(hdd_adapter_t *adapter, const uint8_t *bssid, /* if not associated, no need to proceed with reassoc */ if (eConnectionState_Associated != pHddStaCtx->conn_info.connState) { - hddLog(QDF_TRACE_LEVEL_INFO, "%s: Not associated", __func__); + hdd_info("Not associated"); ret = -EINVAL; goto exit; } @@ -893,8 +876,7 @@ hdd_reassoc(hdd_adapter_t *adapter, const uint8_t *bssid, */ if (!memcmp(bssid, pHddStaCtx->conn_info.bssId.bytes, QDF_MAC_ADDR_SIZE)) { - hddLog(LOG1, - FL("Reassoc BSSID is same as currently associated AP bssid")); + hdd_info("Reassoc BSSID is same as currently associated AP bssid"); ret = -EINVAL; goto exit; } @@ -902,8 +884,7 @@ hdd_reassoc(hdd_adapter_t *adapter, const uint8_t *bssid, /* Check channel number is a valid channel number */ if (QDF_STATUS_SUCCESS != wlan_hdd_validate_operation_channel(adapter, channel)) { - hddLog(QDF_TRACE_LEVEL_ERROR, "%s: Invalid Channel %d", - __func__, channel); + hdd_err("Invalid Channel %d", channel); ret = -EINVAL; goto exit; } @@ -948,8 +929,7 @@ static int hdd_parse_reassoc_v1(hdd_adapter_t *adapter, const char *command) ret = hdd_parse_reassoc_command_v1_data(command, bssid, &channel); if (ret) { - hddLog(QDF_TRACE_LEVEL_ERROR, - "%s: Failed to parse reassoc command data", __func__); + hdd_err("Failed to parse reassoc command data"); } else { ret = hdd_reassoc(adapter, bssid, channel); } @@ -978,7 +958,7 @@ static int hdd_parse_reassoc_v2(hdd_adapter_t *adapter, const char *command) memcpy(¶ms, command + 8, sizeof(params)); if (!mac_pton(params.bssid, (u8 *) &bssid)) { - hddLog(LOGE, "%s: MAC address parsing failed", __func__); + hdd_err("MAC address parsing failed"); ret = -EINVAL; } else { ret = hdd_reassoc(adapter, bssid, params.channel); @@ -1070,7 +1050,7 @@ hdd_sendactionframe(hdd_adapter_t *adapter, const uint8_t *bssid, /* if not associated, no need to send action frame */ if (eConnectionState_Associated != pHddStaCtx->conn_info.connState) { - hddLog(QDF_TRACE_LEVEL_INFO, "%s: Not associated", __func__); + hdd_info("Not associated"); ret = -EINVAL; goto exit; } @@ -1081,7 +1061,7 @@ hdd_sendactionframe(hdd_adapter_t *adapter, const uint8_t *bssid, */ if (memcmp(bssid, pHddStaCtx->conn_info.bssId.bytes, QDF_MAC_ADDR_SIZE)) { - hddLog(LOG1, FL("STA is not associated to this AP")); + hdd_info("STA is not associated to this AP"); ret = -EINVAL; goto exit; } @@ -1099,11 +1079,10 @@ hdd_sendactionframe(hdd_adapter_t *adapter, const uint8_t *bssid, if (channel != 0) { if (channel != pHddStaCtx->conn_info.operationChannel) { - hddLog(QDF_TRACE_LEVEL_INFO, - "%s: channel(%d) is different from operating channel(%d)", - __func__, channel, - pHddStaCtx->conn_info. - operationChannel); + hdd_info("channel(%d) is different from operating channel(%d)", + channel, + pHddStaCtx->conn_info. + operationChannel); ret = -EINVAL; goto exit; } @@ -1129,8 +1108,7 @@ hdd_sendactionframe(hdd_adapter_t *adapter, const uint8_t *bssid, } } if (chan.center_freq == 0) { - hddLog(QDF_TRACE_LEVEL_ERROR, "%s:invalid channel number %d", - __func__, channel); + hdd_err("Invalid channel number %d", channel); ret = -EINVAL; goto exit; } @@ -1138,7 +1116,7 @@ hdd_sendactionframe(hdd_adapter_t *adapter, const uint8_t *bssid, frame_len = payload_len + 24; frame = qdf_mem_malloc(frame_len); if (!frame) { - hddLog(LOGE, FL("memory allocation failed")); + hdd_err("memory allocation failed"); ret = -ENOMEM; goto exit; } @@ -1208,8 +1186,7 @@ hdd_parse_sendactionframe_v1(hdd_adapter_t *adapter, const char *command) &dwell_time, &payload, &payload_len); if (ret) { - hddLog(QDF_TRACE_LEVEL_ERROR, - "%s: Failed to parse send action frame data", __func__); + hdd_err("Failed to parse send action frame data"); } else { ret = hdd_sendactionframe(adapter, bssid, channel, dwell_time, payload_len, payload); @@ -1248,7 +1225,7 @@ hdd_parse_sendactionframe_v2(hdd_adapter_t *adapter, const char *command) memcpy(params, command + 16, sizeof(*params)); if (!mac_pton(params->bssid, (u8 *) &bssid)) { - hddLog(LOGE, "%s: MAC address parsing failed", __func__); + hdd_err("MAC address parsing failed"); ret = -EINVAL; } else { ret = hdd_sendactionframe(adapter, bssid, params->channel, @@ -1362,8 +1339,7 @@ hdd_parse_channellist(const uint8_t *pValue, uint8_t *pChannelList, *pNumChannels = tempInt; - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO_HIGH, - "Number of channels are: %d", *pNumChannels); + hdd_info("Number of channels are: %d", *pNumChannels); for (j = 0; j < (*pNumChannels); j++) { /* @@ -1410,8 +1386,7 @@ hdd_parse_channellist(const uint8_t *pValue, uint8_t *pChannelList, } pChannelList[j] = tempInt; - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO_HIGH, - "Channel %d added to preferred channel list", + hdd_info("Channel %d added to preferred channel list", pChannelList[j]); } @@ -1447,9 +1422,7 @@ hdd_parse_set_roam_scan_channels_v1(hdd_adapter_t *adapter, ret = hdd_parse_channellist(command, channel_list, &num_chan); if (ret) { - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, - "%s: Failed to parse channel list information", - __func__); + hdd_err("Failed to parse channel list information"); goto exit; } @@ -1458,9 +1431,8 @@ hdd_parse_set_roam_scan_channels_v1(hdd_adapter_t *adapter, adapter->sessionId, num_chan)); if (num_chan > WNI_CFG_VALID_CHANNEL_LIST_LEN) { - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, - "%s: number of channels (%d) supported exceeded max (%d)", - __func__, num_chan, WNI_CFG_VALID_CHANNEL_LIST_LEN); + hdd_err("number of channels (%d) supported exceeded max (%d)", + num_chan, WNI_CFG_VALID_CHANNEL_LIST_LEN); ret = -EINVAL; goto exit; } @@ -1470,9 +1442,7 @@ hdd_parse_set_roam_scan_channels_v1(hdd_adapter_t *adapter, adapter->sessionId, channel_list, num_chan); if (QDF_STATUS_SUCCESS != status) { - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, - "%s: Failed to update channel list information", - __func__); + hdd_err("Failed to update channel list information"); ret = -EINVAL; goto exit; } @@ -1516,9 +1486,8 @@ hdd_parse_set_roam_scan_channels_v2(hdd_adapter_t *adapter, num_chan = *value++; if (num_chan > WNI_CFG_VALID_CHANNEL_LIST_LEN) { - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, - "%s: number of channels (%d) supported exceeded max (%d)", - __func__, num_chan, WNI_CFG_VALID_CHANNEL_LIST_LEN); + hdd_err("number of channels (%d) supported exceeded max (%d)", + num_chan, WNI_CFG_VALID_CHANNEL_LIST_LEN); ret = -EINVAL; goto exit; } @@ -1530,8 +1499,7 @@ hdd_parse_set_roam_scan_channels_v2(hdd_adapter_t *adapter, for (i = 0; i < num_chan; i++) { channel = *value++; if (channel > WNI_CFG_CURRENT_CHANNEL_STAMAX) { - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, - "%s: index %d invalid channel %d", __func__, + hdd_err("index %d invalid channel %d", i, channel); ret = -EINVAL; goto exit; @@ -1543,9 +1511,7 @@ hdd_parse_set_roam_scan_channels_v2(hdd_adapter_t *adapter, adapter->sessionId, channel_list, num_chan); if (QDF_STATUS_SUCCESS != status) { - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, - "%s: Failed to update channel list information", - __func__); + hdd_err("Failed to update channel list information"); ret = -EINVAL; goto exit; } @@ -1660,8 +1626,7 @@ QDF_STATUS hdd_parse_plm_cmd(uint8_t *pValue, tSirPlmReq *pPlmRequest) return QDF_STATUS_E_FAILURE; pPlmRequest->diag_token = content; - hddLog(QDF_TRACE_LEVEL_DEBUG, "diag token %d", - pPlmRequest->diag_token); + hdd_debug("diag token %d", pPlmRequest->diag_token); cmdPtr = strpbrk(cmdPtr, " "); if (NULL == cmdPtr) @@ -1681,11 +1646,9 @@ QDF_STATUS hdd_parse_plm_cmd(uint8_t *pValue, tSirPlmReq *pPlmRequest) return QDF_STATUS_E_FAILURE; pPlmRequest->meas_token = content; - hddLog(QDF_TRACE_LEVEL_DEBUG, "meas token %d", - pPlmRequest->meas_token); + hdd_debug("meas token %d", pPlmRequest->meas_token); - hddLog(QDF_TRACE_LEVEL_ERROR, - "PLM req %s", pPlmRequest->enable ? "START" : "STOP"); + hdd_err("PLM req %s", pPlmRequest->enable ? "START" : "STOP"); if (pPlmRequest->enable) { cmdPtr = strpbrk(cmdPtr, " "); @@ -1710,8 +1673,7 @@ QDF_STATUS hdd_parse_plm_cmd(uint8_t *pValue, tSirPlmReq *pPlmRequest) return QDF_STATUS_E_FAILURE; pPlmRequest->numBursts = content; - hddLog(QDF_TRACE_LEVEL_DEBUG, "num burst %d", - pPlmRequest->numBursts); + hdd_debug("num burst %d", pPlmRequest->numBursts); cmdPtr = strpbrk(cmdPtr, " "); if (NULL == cmdPtr) @@ -1734,8 +1696,7 @@ QDF_STATUS hdd_parse_plm_cmd(uint8_t *pValue, tSirPlmReq *pPlmRequest) return QDF_STATUS_E_FAILURE; pPlmRequest->burstInt = content; - hddLog(QDF_TRACE_LEVEL_DEBUG, "burst Int %d", - pPlmRequest->burstInt); + hdd_debug("burst Int %d", pPlmRequest->burstInt); cmdPtr = strpbrk(cmdPtr, " "); if (NULL == cmdPtr) @@ -1758,8 +1719,7 @@ QDF_STATUS hdd_parse_plm_cmd(uint8_t *pValue, tSirPlmReq *pPlmRequest) return QDF_STATUS_E_FAILURE; pPlmRequest->measDuration = content; - hddLog(QDF_TRACE_LEVEL_DEBUG, "measDur %d", - pPlmRequest->measDuration); + hdd_debug("measDur %d", pPlmRequest->measDuration); cmdPtr = strpbrk(cmdPtr, " "); if (NULL == cmdPtr) @@ -1782,8 +1742,7 @@ QDF_STATUS hdd_parse_plm_cmd(uint8_t *pValue, tSirPlmReq *pPlmRequest) return QDF_STATUS_E_FAILURE; pPlmRequest->burstLen = content; - hddLog(QDF_TRACE_LEVEL_DEBUG, "burstLen %d", - pPlmRequest->burstLen); + hdd_debug("burstLen %d", pPlmRequest->burstLen); cmdPtr = strpbrk(cmdPtr, " "); if (NULL == cmdPtr) @@ -1806,8 +1765,8 @@ QDF_STATUS hdd_parse_plm_cmd(uint8_t *pValue, tSirPlmReq *pPlmRequest) return QDF_STATUS_E_FAILURE; pPlmRequest->desiredTxPwr = content; - hddLog(QDF_TRACE_LEVEL_DEBUG, - "desiredTxPwr %d", pPlmRequest->desiredTxPwr); + hdd_debug("desiredTxPwr %d", + pPlmRequest->desiredTxPwr); for (count = 0; count < QDF_MAC_ADDR_SIZE; count++) { cmdPtr = strpbrk(cmdPtr, " "); @@ -1856,8 +1815,7 @@ QDF_STATUS hdd_parse_plm_cmd(uint8_t *pValue, tSirPlmReq *pPlmRequest) return QDF_STATUS_E_FAILURE; pPlmRequest->plmNumCh = content; - hddLog(QDF_TRACE_LEVEL_DEBUG, "numch %d", - pPlmRequest->plmNumCh); + hdd_debug("numch %d", pPlmRequest->plmNumCh); /* Channel numbers */ for (count = 0; count < pPlmRequest->plmNumCh; count++) { @@ -1883,8 +1841,7 @@ QDF_STATUS hdd_parse_plm_cmd(uint8_t *pValue, tSirPlmReq *pPlmRequest) return QDF_STATUS_E_FAILURE; pPlmRequest->plmChList[count] = content; - hddLog(QDF_TRACE_LEVEL_DEBUG, " ch- %d", - pPlmRequest->plmChList[count]); + hdd_debug(" ch- %d", pPlmRequest->plmChList[count]); } } /* If PLM START */ @@ -1900,7 +1857,7 @@ static void wlan_hdd_ready_to_extwow(void *callbackContext, bool is_success) rc = wlan_hdd_validate_context(hdd_ctx); if (0 != rc) { - hddLog(QDF_TRACE_LEVEL_ERROR, FL("HDD context is not valid")); + hdd_err("HDD context is not valid"); return; } hdd_ctx->ext_wow_should_suspend = is_success; @@ -1924,17 +1881,15 @@ static int hdd_enable_ext_wow(hdd_adapter_t *adapter, &wlan_hdd_ready_to_extwow, hdd_ctx); if (QDF_STATUS_SUCCESS != qdf_ret_status) { - hddLog(QDF_TRACE_LEVEL_ERROR, - FL("sme_configure_ext_wow returned failure %d"), - qdf_ret_status); + hdd_err("sme_configure_ext_wow returned failure %d", + qdf_ret_status); return -EPERM; } rc = wait_for_completion_timeout(&hdd_ctx->ready_to_extwow, msecs_to_jiffies(WLAN_WAIT_TIME_READY_TO_EXTWOW)); if (!rc) { - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, - "%s: Failed to get ready to extwow", __func__); + hdd_err("Failed to get ready to extwow"); return -EPERM; } @@ -1943,29 +1898,24 @@ static int hdd_enable_ext_wow(hdd_adapter_t *adapter, pm_message_t state; state.event = PM_EVENT_SUSPEND; - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, - "%s: Received ready to ExtWoW. Going to suspend", - __func__); + hdd_info("Received ready to ExtWoW. Going to suspend"); rc = wlan_hdd_cfg80211_suspend_wlan(hdd_ctx->wiphy, NULL); if (rc < 0) { - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, - "%s: wlan_hdd_cfg80211_suspend_wlan failed, error = %d", - __func__, rc); + hdd_err("wlan_hdd_cfg80211_suspend_wlan failed, error = %d", + rc); return rc; } qdf_ret_status = wlan_hdd_bus_suspend(state); if (qdf_ret_status != QDF_STATUS_SUCCESS) { - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, - "%s: wlan_hdd_suspend failed, status = %d", - __func__, qdf_ret_status); + hdd_err("wlan_hdd_suspend failed, status = %d", + qdf_ret_status); wlan_hdd_cfg80211_resume_wlan(hdd_ctx->wiphy); return -EPERM; } } } else { - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, - "%s: Received ready to ExtWoW failure", __func__); + hdd_err("Received ready to ExtWoW failure"); return -EPERM; } @@ -1981,13 +1931,13 @@ static int hdd_enable_ext_wow_parser(hdd_adapter_t *adapter, int vdev_id, rc = wlan_hdd_validate_context(hdd_ctx); if (0 != rc) { - hddLog(QDF_TRACE_LEVEL_ERROR, FL("HDD context is not valid")); + hdd_err("HDD context is not valid"); return -EINVAL; } if (value < EXT_WOW_TYPE_APP_TYPE1 || value > EXT_WOW_TYPE_APP_TYPE1_2) { - hddLog(QDF_TRACE_LEVEL_ERROR, FL("Invalid type")); + hdd_err("Invalid type"); return -EINVAL; } @@ -2002,8 +1952,8 @@ static int hdd_enable_ext_wow_parser(hdd_adapter_t *adapter, int vdev_id, hdd_ctx->is_extwow_app_type2_param_set) params.type = value; else { - hddLog(QDF_TRACE_LEVEL_ERROR, - FL("Set app params before enable it value %d"), value); + hdd_err("Set app params before enable it value %d", + value); return -EINVAL; } @@ -2025,9 +1975,8 @@ static int hdd_set_app_type1_params(tHalHandle hHal, qdf_ret_status = sme_configure_app_type1_params(hHal, ¶ms); if (QDF_STATUS_SUCCESS != qdf_ret_status) { - hddLog(QDF_TRACE_LEVEL_ERROR, - FL("sme_configure_app_type1_params returned failure %d"), - qdf_ret_status); + hdd_err("sme_configure_app_type1_params returned failure %d", + qdf_ret_status); return -EPERM; } @@ -2045,13 +1994,12 @@ static int hdd_set_app_type1_parser(hdd_adapter_t *adapter, rc = wlan_hdd_validate_context(hdd_ctx); if (0 != rc) { - hddLog(QDF_TRACE_LEVEL_ERROR, FL("HDD context is not valid")); + hdd_err("HDD context is not valid"); return -EINVAL; } if (2 != sscanf(arg, "%8s %16s", id, password)) { - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, - FL("Invalid Number of arguments")); + hdd_err("Invalid Number of arguments"); return -EINVAL; } @@ -2064,9 +2012,8 @@ static int hdd_set_app_type1_parser(hdd_adapter_t *adapter, params.pass_length = strlen(password); qdf_mem_copy(params.password, password, params.pass_length); - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, - "%s: %d %pM %.8s %u %.16s %u", - __func__, params.vdev_id, params.wakee_mac_addr.bytes, + hdd_info("%d %pM %.8s %u %.16s %u", + params.vdev_id, params.wakee_mac_addr.bytes, params.identification_id, params.id_length, params.password, params.pass_length); @@ -2083,9 +2030,8 @@ static int hdd_set_app_type2_params(tHalHandle hHal, qdf_ret_status = sme_configure_app_type2_params(hHal, ¶ms); if (QDF_STATUS_SUCCESS != qdf_ret_status) { - hddLog(QDF_TRACE_LEVEL_ERROR, - FL("sme_configure_app_type2_params returned failure %d"), - qdf_ret_status); + hdd_err("sme_configure_app_type2_params returned failure %d", + qdf_ret_status); return -EPERM; } @@ -2104,7 +2050,7 @@ static int hdd_set_app_type2_parser(hdd_adapter_t *adapter, ret = wlan_hdd_validate_context(hdd_ctx); if (0 != ret) { - hddLog(QDF_TRACE_LEVEL_ERROR, FL("HDD context is not valid")); + hdd_err("HDD context is not valid"); return -EINVAL; } @@ -2126,8 +2072,7 @@ static int hdd_set_app_type2_parser(hdd_adapter_t *adapter, (unsigned int *)¶ms.tcp_rx_timeout_val); if (ret != 15 && ret != 7) { - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, - "Invalid Number of arguments"); + hdd_err("Invalid Number of arguments"); return -EINVAL; } @@ -2135,15 +2080,13 @@ static int hdd_set_app_type2_parser(hdd_adapter_t *adapter, sscanf(mac_addr, "%02x:%02x:%02x:%02x:%02x:%02x", &gateway_mac[0], &gateway_mac[1], &gateway_mac[2], &gateway_mac[3], &gateway_mac[4], &gateway_mac[5])) { - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, - "Invalid MacAddress Input %s", mac_addr); + hdd_err("Invalid MacAddress Input %s", mac_addr); return -EINVAL; } if (params.tcp_src_port > WLAN_HDD_MAX_TCP_PORT || params.tcp_dst_port > WLAN_HDD_MAX_TCP_PORT) { - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, - "Invalid TCP Port Number"); + hdd_err("Invalid TCP Port Number"); return -EINVAL; } @@ -2182,9 +2125,8 @@ static int hdd_set_app_type2_parser(hdd_adapter_t *adapter, params.tcp_rx_timeout_val : hdd_ctx->config->extWowApp2TcpRxTimeout; - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, - "%s: %pM %.16s %u %u %u %u %u %u %u %u %u %u %u %u %u", - __func__, gateway_mac, rc4_key, params.ip_id, + hdd_info("%pM %.16s %u %u %u %u %u %u %u %u %u %u %u %u %u", + gateway_mac, rc4_key, params.ip_id, params.ip_device_ip, params.ip_server_ip, params.tcp_seq, params.tcp_ack_seq, params.tcp_src_port, params.tcp_dst_port, params.keepalive_init, params.keepalive_min, @@ -2245,8 +2187,7 @@ static int hdd_parse_setmaxtxpower_command(uint8_t *pValue, int *pTxPower) *pTxPower = tempInt; - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, - "SETMAXTXPOWER: %d", *pTxPower); + hdd_info("SETMAXTXPOWER: %d", *pTxPower); return 0; } /* End of hdd_parse_setmaxtxpower_command */ @@ -2257,9 +2198,7 @@ static int hdd_get_dwell_time(struct hdd_config *pCfg, uint8_t *command, int ret = 0; if (!pCfg || !command || !extra || !len) { - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, - "%s: argument passed for GETDWELLTIME is incorrect", - __func__); + hdd_err("argument passed for GETDWELLTIME is incorrect"); ret = -EINVAL; return ret; } @@ -2302,8 +2241,7 @@ static int hdd_set_dwell_time(hdd_adapter_t *adapter, uint8_t *command) pCfg = (WLAN_HDD_GET_CTX(adapter))->config; hHal = WLAN_HDD_GET_HAL_CTX(adapter); if (!pCfg || !hHal) { - hddLog(LOGE, - FL("argument passed for SETDWELLTIME is incorrect")); + hdd_err("argument passed for SETDWELLTIME is incorrect"); return -EINVAL; } @@ -2315,8 +2253,7 @@ static int hdd_set_dwell_time(hdd_adapter_t *adapter, uint8_t *command) temp = kstrtou32(value, 10, &val); if (temp != 0 || val < CFG_ACTIVE_MAX_CHANNEL_TIME_MIN || val > CFG_ACTIVE_MAX_CHANNEL_TIME_MAX) { - hddLog(LOGE, - FL("argument passed for SETDWELLTIME ACTIVE MAX is incorrect")); + hdd_err("argument passed for SETDWELLTIME ACTIVE MAX is incorrect"); return -EFAULT; } pCfg->nActiveMaxChnTime = val; @@ -2327,8 +2264,7 @@ static int hdd_set_dwell_time(hdd_adapter_t *adapter, uint8_t *command) temp = kstrtou32(value, 10, &val); if (temp != 0 || val < CFG_ACTIVE_MIN_CHANNEL_TIME_MIN || val > CFG_ACTIVE_MIN_CHANNEL_TIME_MAX) { - hddLog(LOGE, - FL("argument passed for SETDWELLTIME ACTIVE MIN is incorrect")); + hdd_err("argument passed for SETDWELLTIME ACTIVE MIN is incorrect"); return -EFAULT; } pCfg->nActiveMinChnTime = val; @@ -2339,8 +2275,7 @@ static int hdd_set_dwell_time(hdd_adapter_t *adapter, uint8_t *command) temp = kstrtou32(value, 10, &val); if (temp != 0 || val < CFG_PASSIVE_MAX_CHANNEL_TIME_MIN || val > CFG_PASSIVE_MAX_CHANNEL_TIME_MAX) { - hddLog(LOGE, - FL("argument passed for SETDWELLTIME PASSIVE MAX is incorrect")); + hdd_err("argument passed for SETDWELLTIME PASSIVE MAX is incorrect"); return -EFAULT; } pCfg->nPassiveMaxChnTime = val; @@ -2351,8 +2286,7 @@ static int hdd_set_dwell_time(hdd_adapter_t *adapter, uint8_t *command) temp = kstrtou32(value, 10, &val); if (temp != 0 || val < CFG_PASSIVE_MIN_CHANNEL_TIME_MIN || val > CFG_PASSIVE_MIN_CHANNEL_TIME_MAX) { - hddLog(LOGE, - FL("argument passed for SETDWELLTIME PASSIVE MIN is incorrect")); + hdd_err("argument passed for SETDWELLTIME PASSIVE MIN is incorrect"); return -EFAULT; } pCfg->nPassiveMinChnTime = val; @@ -2363,8 +2297,7 @@ static int hdd_set_dwell_time(hdd_adapter_t *adapter, uint8_t *command) temp = kstrtou32(value, 10, &val); if (temp != 0 || val < CFG_ACTIVE_MAX_CHANNEL_TIME_MIN || val > CFG_ACTIVE_MAX_CHANNEL_TIME_MAX) { - hddLog(LOGE, - FL("argument passed for SETDWELLTIME is incorrect")); + hdd_err("argument passed for SETDWELLTIME is incorrect"); return -EFAULT; } pCfg->nActiveMaxChnTime = val; @@ -2383,8 +2316,7 @@ static void hdd_get_link_status_cb(uint8_t status, void *context) hdd_adapter_t *adapter; if (NULL == context) { - hddLog(QDF_TRACE_LEVEL_ERROR, "%s: Bad context [%p]", - __func__, context); + hdd_err("Bad context [%p]", context); return; } @@ -2400,9 +2332,8 @@ static void hdd_get_link_status_cb(uint8_t status, void *context) * nothing we can do */ spin_unlock(&hdd_context_lock); - hddLog(QDF_TRACE_LEVEL_WARN, - "%s: Invalid context, adapter [%p] magic [%08x]", - __func__, adapter, pLinkContext->magic); + hdd_warn("Invalid context, adapter [%p] magic [%08x]", + adapter, pLinkContext->magic); return; } @@ -2461,7 +2392,7 @@ static int wlan_hdd_get_link_status(hdd_adapter_t *adapter) /* If not associated, then expected link status return * value is 0 */ - hddLog(LOG1, FL("Not associated!")); + hdd_info("Not associated!"); return 0; } @@ -2472,16 +2403,14 @@ static int wlan_hdd_get_link_status(hdd_adapter_t *adapter) hdd_get_link_status_cb, &context, adapter->sessionId); if (QDF_STATUS_SUCCESS != hstatus) { - hddLog(QDF_TRACE_LEVEL_ERROR, - "%s: Unable to retrieve link status", __func__); + hdd_err("Unable to retrieve link status"); /* return a cached value */ } else { /* request is sent -- wait for the response */ rc = wait_for_completion_timeout(&context.completion, msecs_to_jiffies(WLAN_WAIT_TIME_LINK_STATUS)); if (!rc) - hddLog(QDF_TRACE_LEVEL_ERROR, - FL("SME timed out while retrieving link status")); + hdd_err("SME timed out while retrieving link status"); } spin_lock(&hdd_context_lock); @@ -2502,25 +2431,22 @@ static void hdd_tx_fail_ind_callback(uint8_t *MacAddr, uint8_t seqNo) payload_len = ETH_ALEN; if (0 == cesium_pid) { - hddLog(QDF_TRACE_LEVEL_ERROR, - "%s: cesium process not registered", __func__); + hdd_err("cesium process not registered"); return; } skb = nlmsg_new(payload_len, GFP_ATOMIC); if (skb == NULL) { - hddLog(LOGE, - FL("nlmsg_new() failed for msg size[%d]"), - NLMSG_SPACE(payload_len)); + hdd_err("nlmsg_new() failed for msg size[%d]", + NLMSG_SPACE(payload_len)); return; } nlh = nlmsg_put(skb, cesium_pid, seqNo, 0, payload_len, NLM_F_REQUEST); if (NULL == nlh) { - hddLog(QDF_TRACE_LEVEL_ERROR, - "%s: nlmsg_put() failed for msg size[%d]", - __func__, NLMSG_SPACE(payload_len)); + hdd_err("nlmsg_put() failed for msg size[%d]", + NLMSG_SPACE(payload_len)); kfree_skb(skb); return; @@ -2530,9 +2456,8 @@ static void hdd_tx_fail_ind_callback(uint8_t *MacAddr, uint8_t seqNo) memcpy(data, MacAddr, ETH_ALEN); if (nlmsg_unicast(cesium_nl_srv_sock, skb, cesium_pid) < 0) { - hddLog(QDF_TRACE_LEVEL_ERROR, - "%s: nlmsg_unicast() failed for msg size[%d]", - __func__, NLMSG_SPACE(payload_len)); + hdd_err("nlmsg_unicast() failed for msg size[%d]", + NLMSG_SPACE(payload_len)); } return; @@ -2687,8 +2612,8 @@ static int hdd_parse_ese_beacon_req(uint8_t *pValue, pEseBcnReq->numBcnReqIe = tempInt; - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO_HIGH, - "Number of Bcn Req Ie fields(%d)", pEseBcnReq->numBcnReqIe); + hdd_info("Number of Bcn Req Ie fields(%d)", + pEseBcnReq->numBcnReqIe); for (j = 0; j < (pEseBcnReq->numBcnReqIe); j++) { for (i = 0; i < 4; i++) { @@ -2724,9 +2649,7 @@ static int hdd_parse_ese_beacon_req(uint8_t *pValue, switch (i) { case 0: /* Measurement token */ if (tempInt <= 0) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "Invalid Measurement Token(%d)", + hdd_err("Invalid Measurement Token(%d)", tempInt); return -EINVAL; } @@ -2738,9 +2661,7 @@ static int hdd_parse_ese_beacon_req(uint8_t *pValue, if ((tempInt <= 0) || (tempInt > WNI_CFG_CURRENT_CHANNEL_STAMAX)) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "Invalid Channel Number(%d)", + hdd_err("Invalid Channel Number(%d)", tempInt); return -EINVAL; } @@ -2750,9 +2671,7 @@ static int hdd_parse_ese_beacon_req(uint8_t *pValue, case 2: /* Scan mode */ if ((tempInt < eSIR_PASSIVE_SCAN) || (tempInt > eSIR_BEACON_TABLE)) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "Invalid Scan Mode(%d) Expected{0|1|2}", + hdd_err("Invalid Scan Mode(%d) Expected{0|1|2}", tempInt); return -EINVAL; } @@ -2766,9 +2685,7 @@ static int hdd_parse_ese_beacon_req(uint8_t *pValue, ((tempInt < 0) && (pEseBcnReq->bcnReq[j].scanMode == eSIR_BEACON_TABLE))) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "Invalid Measurement Duration(%d)", + hdd_err("Invalid Measurement Duration(%d)", tempInt); return -EINVAL; } @@ -2780,8 +2697,7 @@ static int hdd_parse_ese_beacon_req(uint8_t *pValue, } for (j = 0; j < pEseBcnReq->numBcnReqIe; j++) { - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, - "Index(%d) Measurement Token(%u) Channel(%u) Scan Mode(%u) Measurement Duration(%u)", + hdd_info("Index(%d) Measurement Token(%u) Channel(%u) Scan Mode(%u) Measurement Duration(%u)", j, pEseBcnReq->bcnReq[j].measurementToken, pEseBcnReq->bcnReq[j].channel, @@ -2846,7 +2762,7 @@ static int hdd_parse_get_cckm_ie(uint8_t *pValue, uint8_t **pCckmIe, */ *pCckmIe = qdf_mem_malloc((*pCckmIeLen + 1) / 2); if (NULL == *pCckmIe) { - hddLog(LOGE, FL("qdf_mem_malloc failed")); + hdd_err("qdf_mem_malloc failed"); return -ENOMEM; } qdf_mem_zero(*pCckmIe, (*pCckmIeLen + 1) / 2); @@ -2874,19 +2790,16 @@ int wlan_hdd_set_mc_rate(hdd_adapter_t *pAdapter, int targetRate) struct hdd_config *pConfig = NULL; if (pHddCtx == NULL) { - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, - "%s: HDD context is null", __func__); + hdd_err("HDD context is null"); return -EINVAL; } if ((QDF_IBSS_MODE != pAdapter->device_mode) && (QDF_SAP_MODE != pAdapter->device_mode) && (QDF_STA_MODE != pAdapter->device_mode)) { - hddLog(LOGE, - FL("Received SETMCRATE cmd in invalid mode %s(%d)"), - hdd_device_mode_to_string(pAdapter->device_mode), - pAdapter->device_mode); - hddLog(LOGE, - FL("SETMCRATE cmd is allowed only in STA, IBSS or SOFTAP mode")); + hdd_err("Received SETMCRATE cmd in invalid mode %s(%d)", + hdd_device_mode_to_string(pAdapter->device_mode), + pAdapter->device_mode); + hdd_err("SETMCRATE cmd is allowed only in STA, IBSS or SOFTAP mode"); return -EINVAL; } pConfig = pHddCtx->config; @@ -2897,15 +2810,13 @@ int wlan_hdd_set_mc_rate(hdd_adapter_t *pAdapter, int targetRate) rateUpdate.mcastDataRate5GHz = targetRate; rateUpdate.bcastDataRate = -1; qdf_copy_macaddr(&rateUpdate.bssid, &pAdapter->macAddressCurrent); - hddLog(LOG1, - FL("MC Target rate %d, mac = %pM, dev_mode %s(%d)"), - rateUpdate.mcastDataRate24GHz, rateUpdate.bssid.bytes, - hdd_device_mode_to_string(pAdapter->device_mode), - pAdapter->device_mode); + hdd_info("MC Target rate %d, mac = %pM, dev_mode %s(%d)", + rateUpdate.mcastDataRate24GHz, rateUpdate.bssid.bytes, + hdd_device_mode_to_string(pAdapter->device_mode), + pAdapter->device_mode); status = sme_send_rate_update_ind(pHddCtx->hHal, &rateUpdate); if (QDF_STATUS_SUCCESS != status) { - hddLog(QDF_TRACE_LEVEL_ERROR, "%s: SETMCRATE failed", - __func__); + hdd_err("SETMCRATE failed"); return -EFAULT; } return 0; @@ -2931,9 +2842,7 @@ static int drv_cmd_p2p_dev_addr(hdd_adapter_t *adapter, if (copy_to_user(priv_data->buf, hdd_ctx->p2pDeviceAddress.bytes, sizeof(tSirMacAddr))) { - hddLog(QDF_TRACE_LEVEL_ERROR, - "%s: failed to copy data to user buffer", - __func__); + hdd_err("failed to copy data to user buffer"); ret = -EFAULT; } @@ -3000,10 +2909,9 @@ static int drv_cmd_set_band(hdd_adapter_t *adapter, * First 8 bytes will have "SETBAND " and * 9 byte will have band setting value */ - hddLog(QDF_TRACE_LEVEL_INFO, - "%s: SetBandCommand Info comm %s UL %d, TL %d", - __func__, command, priv_data->used_len, - priv_data->total_len); + hdd_info("SetBandCommand Info comm %s UL %d, TL %d", + command, priv_data->used_len, + priv_data->total_len); /* Change band request received */ ret = hdd_set_band_helper(adapter->dev, ptr); @@ -3047,13 +2955,10 @@ static int drv_cmd_country(hdd_adapter_t *adapter, &adapter->change_country_code, msecs_to_jiffies(WLAN_WAIT_TIME_COUNTRY)); if (!rc) - hddLog(QDF_TRACE_LEVEL_ERROR, - "%s: SME while setting country code timed out", - __func__); + hdd_err("SME while setting country code timed out"); } else { - hddLog(QDF_TRACE_LEVEL_ERROR, - "%s: SME Change Country code fail, status=%d", - __func__, status); + hdd_err("SME Change Country code fail, status %d", + status); ret = -EINVAL; } @@ -3082,12 +2987,9 @@ static int drv_cmd_set_roam_trigger(hdd_adapter_t *adapter, * If the input value is greater than max value of datatype, * then also kstrtou8 fails */ - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: kstrtou8 failed Input value may be out of range[%d - %d]", - __func__, - CFG_NEIGHBOR_LOOKUP_RSSI_THRESHOLD_MIN, - CFG_NEIGHBOR_LOOKUP_RSSI_THRESHOLD_MAX); + hdd_err("kstrtou8 failed Input value may be out of range[%d - %d]", + CFG_NEIGHBOR_LOOKUP_RSSI_THRESHOLD_MIN, + CFG_NEIGHBOR_LOOKUP_RSSI_THRESHOLD_MAX); ret = -EINVAL; goto exit; } @@ -3096,9 +2998,7 @@ static int drv_cmd_set_roam_trigger(hdd_adapter_t *adapter, if ((lookUpThreshold < CFG_NEIGHBOR_LOOKUP_RSSI_THRESHOLD_MIN) || (lookUpThreshold > CFG_NEIGHBOR_LOOKUP_RSSI_THRESHOLD_MAX)) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "Neighbor lookup threshold value %d is out of range (Min: %d Max: %d)", + hdd_err("Neighbor lookup threshold value %d is out of range (Min: %d Max: %d)", lookUpThreshold, CFG_NEIGHBOR_LOOKUP_RSSI_THRESHOLD_MIN, CFG_NEIGHBOR_LOOKUP_RSSI_THRESHOLD_MAX); @@ -3109,9 +3009,7 @@ static int drv_cmd_set_roam_trigger(hdd_adapter_t *adapter, MTRACE(qdf_trace(QDF_MODULE_ID_HDD, TRACE_CODE_HDD_SETROAMTRIGGER_IOCTL, adapter->sessionId, lookUpThreshold)); - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, - "%s: Received Command to Set Roam trigger (Neighbor lookup threshold) = %d", - __func__, + hdd_info("Received Command to Set Roam trigger (Neighbor lookup threshold) = %d", lookUpThreshold); hdd_ctx->config->nNeighborLookupRssiThreshold = lookUpThreshold; @@ -3119,10 +3017,7 @@ static int drv_cmd_set_roam_trigger(hdd_adapter_t *adapter, adapter->sessionId, lookUpThreshold); if (QDF_STATUS_SUCCESS != status) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: Failed to set roam trigger, try again", - __func__); + hdd_err("Failed to set roam trigger, try again"); ret = -EPERM; goto exit; } @@ -3151,10 +3046,7 @@ static int drv_cmd_get_roam_trigger(hdd_adapter_t *adapter, len = scnprintf(extra, sizeof(extra), "%s %d", command, rssi); len = QDF_MIN(priv_data->total_len, len + 1); if (copy_to_user(priv_data->buf, &extra, len)) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: failed to copy data to user buffer", - __func__); + hdd_err("failed to copy data to user buffer"); ret = -EFAULT; } @@ -3185,24 +3077,19 @@ static int drv_cmd_set_roam_scan_period(hdd_adapter_t *adapter, * If the input value is greater than max value of datatype, * then also kstrtou8 fails */ - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: kstrtou8 failed Input value may be out of range[%d - %d]", - __func__, - (CFG_EMPTY_SCAN_REFRESH_PERIOD_MIN / 1000), - (CFG_EMPTY_SCAN_REFRESH_PERIOD_MAX / 1000)); + hdd_err("kstrtou8 failed Input value may be out of range[%d - %d]", + (CFG_EMPTY_SCAN_REFRESH_PERIOD_MIN / 1000), + (CFG_EMPTY_SCAN_REFRESH_PERIOD_MAX / 1000)); ret = -EINVAL; goto exit; } if ((roamScanPeriod < (CFG_EMPTY_SCAN_REFRESH_PERIOD_MIN / 1000)) || (roamScanPeriod > (CFG_EMPTY_SCAN_REFRESH_PERIOD_MAX / 1000))) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "Roam scan period value %d is out of range (Min: %d Max: %d)", - roamScanPeriod, - (CFG_EMPTY_SCAN_REFRESH_PERIOD_MIN / 1000), - (CFG_EMPTY_SCAN_REFRESH_PERIOD_MAX / 1000)); + hdd_err("Roam scan period value %d is out of range (Min: %d Max: %d)", + roamScanPeriod, + (CFG_EMPTY_SCAN_REFRESH_PERIOD_MIN / 1000), + (CFG_EMPTY_SCAN_REFRESH_PERIOD_MAX / 1000)); ret = -EINVAL; goto exit; } @@ -3211,9 +3098,7 @@ static int drv_cmd_set_roam_scan_period(hdd_adapter_t *adapter, adapter->sessionId, roamScanPeriod)); neighborEmptyScanRefreshPeriod = roamScanPeriod * 1000; - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, - "%s: Received Command to Set roam scan period (Empty Scan refresh period) = %d", - __func__, + hdd_info("Received Command to Set roam scan period (Empty Scan refresh period) = %d", roamScanPeriod); hdd_ctx->config->nEmptyScanRefreshPeriod = @@ -3248,8 +3133,7 @@ static int drv_cmd_get_roam_scan_period(hdd_adapter_t *adapter, /* Returned value is in units of seconds */ len = QDF_MIN(priv_data->total_len, len + 1); if (copy_to_user(priv_data->buf, &extra, len)) { - hddLog(LOGE, - FL("failed to copy data to user buffer")); + hdd_err("failed to copy data to user buffer"); ret = -EFAULT; } @@ -3279,12 +3163,9 @@ static int drv_cmd_set_roam_scan_refresh_period(hdd_adapter_t *adapter, * If the input value is greater than max value of datatype, * then also kstrtou8 fails */ - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: kstrtou8 failed Input value may be out of range[%d - %d]", - __func__, - CFG_NEIGHBOR_SCAN_RESULTS_REFRESH_PERIOD_MIN / 1000, - CFG_NEIGHBOR_SCAN_RESULTS_REFRESH_PERIOD_MAX / 1000); + hdd_err("kstrtou8 failed Input value may be out of range[%d - %d]", + CFG_NEIGHBOR_SCAN_RESULTS_REFRESH_PERIOD_MIN / 1000, + CFG_NEIGHBOR_SCAN_RESULTS_REFRESH_PERIOD_MAX / 1000); ret = -EINVAL; goto exit; } @@ -3293,22 +3174,18 @@ static int drv_cmd_set_roam_scan_refresh_period(hdd_adapter_t *adapter, (CFG_NEIGHBOR_SCAN_RESULTS_REFRESH_PERIOD_MIN / 1000)) || (roamScanRefreshPeriod > (CFG_NEIGHBOR_SCAN_RESULTS_REFRESH_PERIOD_MAX / 1000))) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "Neighbor scan results refresh period value %d is out of range (Min: %d Max: %d)", - roamScanRefreshPeriod, - (CFG_NEIGHBOR_SCAN_RESULTS_REFRESH_PERIOD_MIN - / 1000), - (CFG_NEIGHBOR_SCAN_RESULTS_REFRESH_PERIOD_MAX - / 1000)); + hdd_err("Neighbor scan results refresh period value %d is out of range (Min: %d Max: %d)", + roamScanRefreshPeriod, + (CFG_NEIGHBOR_SCAN_RESULTS_REFRESH_PERIOD_MIN + / 1000), + (CFG_NEIGHBOR_SCAN_RESULTS_REFRESH_PERIOD_MAX + / 1000)); ret = -EINVAL; goto exit; } neighborScanRefreshPeriod = roamScanRefreshPeriod * 1000; - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, - "%s: Received Command to Set roam scan refresh period (Scan refresh period) = %d", - __func__, + hdd_info("Received Command to Set roam scan refresh period (Scan refresh period) = %d", roamScanRefreshPeriod); hdd_ctx->config->nNeighborResultsRefreshPeriod = @@ -3339,10 +3216,7 @@ static int drv_cmd_get_roam_scan_refresh_period(hdd_adapter_t *adapter, /* Returned value is in units of seconds */ len = QDF_MIN(priv_data->total_len, len + 1); if (copy_to_user(priv_data->buf, &extra, len)) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: failed to copy data to user buffer", - __func__); + hdd_err("failed to copy data to user buffer"); ret = -EFAULT; } @@ -3369,29 +3243,24 @@ static int drv_cmd_set_roam_mode(hdd_adapter_t *adapter, * If the input value is greater than max value of datatype, * then also kstrtou8 fails */ - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: kstrtou8 failed range [%d - %d]", - __func__, CFG_LFR_FEATURE_ENABLED_MIN, - CFG_LFR_FEATURE_ENABLED_MAX); + hdd_err("kstrtou8 failed range [%d - %d]", + CFG_LFR_FEATURE_ENABLED_MIN, + CFG_LFR_FEATURE_ENABLED_MAX); ret = -EINVAL; goto exit; } if ((roamMode < CFG_LFR_FEATURE_ENABLED_MIN) || (roamMode > CFG_LFR_FEATURE_ENABLED_MAX)) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "Roam Mode value %d is out of range (Min: %d Max: %d)", - roamMode, - CFG_LFR_FEATURE_ENABLED_MIN, - CFG_LFR_FEATURE_ENABLED_MAX); + hdd_err("Roam Mode value %d is out of range (Min: %d Max: %d)", + roamMode, + CFG_LFR_FEATURE_ENABLED_MIN, + CFG_LFR_FEATURE_ENABLED_MAX); ret = -EINVAL; goto exit; } - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_DEBUG, - "%s: Received Command to Set Roam Mode = %d", - __func__, roamMode); + hdd_debug("Received Command to Set Roam Mode = %d", + roamMode); /* * Note that * SETROAMMODE 0 is to enable LFR while @@ -3453,10 +3322,7 @@ static int drv_cmd_get_roam_mode(hdd_adapter_t *adapter, len = scnprintf(extra, sizeof(extra), "%s %d", command, roamMode); len = QDF_MIN(priv_data->total_len, len + 1); if (copy_to_user(priv_data->buf, &extra, len)) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: failed to copy data to user buffer", - __func__); + hdd_err("failed to copy data to user buffer"); ret = -EFAULT; } @@ -3483,30 +3349,25 @@ static int drv_cmd_set_roam_delta(hdd_adapter_t *adapter, * If the input value is greater than max value of datatype, * then also kstrtou8 fails */ - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: kstrtou8 failed range [%d - %d]", - __func__, CFG_ROAM_RSSI_DIFF_MIN, - CFG_ROAM_RSSI_DIFF_MAX); + hdd_err("kstrtou8 failed range [%d - %d]", + CFG_ROAM_RSSI_DIFF_MIN, + CFG_ROAM_RSSI_DIFF_MAX); ret = -EINVAL; goto exit; } if ((roamRssiDiff < CFG_ROAM_RSSI_DIFF_MIN) || (roamRssiDiff > CFG_ROAM_RSSI_DIFF_MAX)) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "Roam rssi diff value %d is out of range (Min: %d Max: %d)", - roamRssiDiff, - CFG_ROAM_RSSI_DIFF_MIN, - CFG_ROAM_RSSI_DIFF_MAX); + hdd_err("Roam rssi diff value %d is out of range (Min: %d Max: %d)", + roamRssiDiff, + CFG_ROAM_RSSI_DIFF_MIN, + CFG_ROAM_RSSI_DIFF_MAX); ret = -EINVAL; goto exit; } - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, - "%s: Received Command to Set roam rssi diff = %d", - __func__, roamRssiDiff); + hdd_info("Received Command to Set roam rssi diff = %d", + roamRssiDiff); hdd_ctx->config->RoamRssiDiff = roamRssiDiff; sme_update_roam_rssi_diff(hdd_ctx->hHal, @@ -3538,10 +3399,7 @@ static int drv_cmd_get_roam_delta(hdd_adapter_t *adapter, len = QDF_MIN(priv_data->total_len, len + 1); if (copy_to_user(priv_data->buf, &extra, len)) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: failed to copy data to user buffer", - __func__); + hdd_err("failed to copy data to user buffer"); ret = -EFAULT; } @@ -3569,10 +3427,7 @@ static int drv_cmd_get_band(hdd_adapter_t *adapter, len = QDF_MIN(priv_data->total_len, len + 1); if (copy_to_user(priv_data->buf, &extra, len)) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: failed to copy data to user buffer", - __func__); + hdd_err("failed to copy data to user buffer"); ret = -EFAULT; } @@ -3606,10 +3461,7 @@ static int drv_cmd_get_roam_scan_channels(hdd_adapter_t *adapter, ChannelList, &numChannels, adapter->sessionId)) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_FATAL, - "%s: failed to get roam scan channel list", - __func__); + hdd_alert("failed to get roam scan channel list"); ret = -EFAULT; goto exit; } @@ -3630,10 +3482,7 @@ static int drv_cmd_get_roam_scan_channels(hdd_adapter_t *adapter, len = QDF_MIN(priv_data->total_len, len + 1); if (copy_to_user(priv_data->buf, &extra, len)) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: failed to copy data to user buffer", - __func__); + hdd_err("failed to copy data to user buffer"); ret = -EFAULT; goto exit; } @@ -3660,10 +3509,7 @@ static int drv_cmd_get_ccx_mode(hdd_adapter_t *adapter, if (eseMode && hdd_is_okc_mode_enabled(hdd_ctx) && sme_get_is_ft_feature_enabled(hdd_ctx->hHal)) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_WARN, - "%s: OKC/ESE/11R are supported simultaneously hence this operation is not permitted!", - __func__); + hdd_warn("OKC/ESE/11R are supported simultaneously hence this operation is not permitted!"); ret = -EPERM; goto exit; } @@ -3672,10 +3518,7 @@ static int drv_cmd_get_ccx_mode(hdd_adapter_t *adapter, "GETCCXMODE", eseMode); len = QDF_MIN(priv_data->total_len, len + 1); if (copy_to_user(priv_data->buf, &extra, len)) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: failed to copy data to user buffer", - __func__); + hdd_err("failed to copy data to user buffer"); ret = -EFAULT; goto exit; } @@ -3702,10 +3545,7 @@ static int drv_cmd_get_okc_mode(hdd_adapter_t *adapter, if (okcMode && sme_get_is_ese_feature_enabled(hdd_ctx->hHal) && sme_get_is_ft_feature_enabled(hdd_ctx->hHal)) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_WARN, - "%s: OKC/ESE/11R are supported simultaneously hence this operation is not permitted!", - __func__); + hdd_warn("OKC/ESE/11R are supported simultaneously hence this operation is not permitted!"); ret = -EPERM; goto exit; } @@ -3715,10 +3555,7 @@ static int drv_cmd_get_okc_mode(hdd_adapter_t *adapter, len = QDF_MIN(priv_data->total_len, len + 1); if (copy_to_user(priv_data->buf, &extra, len)) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: failed to copy data to user buffer", - __func__); + hdd_err("failed to copy data to user buffer"); ret = -EFAULT; goto exit; } @@ -3743,10 +3580,7 @@ static int drv_cmd_get_fast_roam(hdd_adapter_t *adapter, len = QDF_MIN(priv_data->total_len, len + 1); if (copy_to_user(priv_data->buf, &extra, len)) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: failed to copy data to user buffer", - __func__); + hdd_err("failed to copy data to user buffer"); ret = -EFAULT; } @@ -3769,10 +3603,7 @@ static int drv_cmd_get_fast_transition(hdd_adapter_t *adapter, len = QDF_MIN(priv_data->total_len, len + 1); if (copy_to_user(priv_data->buf, &extra, len)) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: failed to copy data to user buffer", - __func__); + hdd_err("failed to copy data to user buffer"); ret = -EFAULT; } @@ -3799,24 +3630,19 @@ static int drv_cmd_set_roam_scan_channel_min_time(hdd_adapter_t *adapter, * If the input value is greater than max value of datatype, * then also kstrtou8 fails */ - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: kstrtou8 failed range [%d - %d]", - __func__, - CFG_NEIGHBOR_SCAN_MIN_CHAN_TIME_MIN, - CFG_NEIGHBOR_SCAN_MIN_CHAN_TIME_MAX); + hdd_err("kstrtou8 failed range [%d - %d]", + CFG_NEIGHBOR_SCAN_MIN_CHAN_TIME_MIN, + CFG_NEIGHBOR_SCAN_MIN_CHAN_TIME_MAX); ret = -EINVAL; goto exit; } if ((minTime < CFG_NEIGHBOR_SCAN_MIN_CHAN_TIME_MIN) || (minTime > CFG_NEIGHBOR_SCAN_MIN_CHAN_TIME_MAX)) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "scan min channel time value %d is out of range (Min: %d Max: %d)", - minTime, - CFG_NEIGHBOR_SCAN_MIN_CHAN_TIME_MIN, - CFG_NEIGHBOR_SCAN_MIN_CHAN_TIME_MAX); + hdd_err("scan min channel time value %d is out of range (Min: %d Max: %d)", + minTime, + CFG_NEIGHBOR_SCAN_MIN_CHAN_TIME_MIN, + CFG_NEIGHBOR_SCAN_MIN_CHAN_TIME_MAX); ret = -EINVAL; goto exit; } @@ -3824,9 +3650,8 @@ static int drv_cmd_set_roam_scan_channel_min_time(hdd_adapter_t *adapter, MTRACE(qdf_trace(QDF_MODULE_ID_HDD, TRACE_CODE_HDD_SETROAMSCANCHANNELMINTIME_IOCTL, adapter->sessionId, minTime)); - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, - "%s: Received Command to change channel min time = %d", - __func__, minTime); + hdd_info("Received Command to change channel min time = %d", + minTime); hdd_ctx->config->nNeighborScanMinChanTime = minTime; sme_set_neighbor_scan_min_chan_time(hdd_ctx->hHal, @@ -3868,10 +3693,7 @@ static int drv_cmd_get_roam_scan_channel_min_time(hdd_adapter_t *adapter, adapter->sessionId, val)); if (copy_to_user(priv_data->buf, &extra, len)) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: failed to copy data to user buffer", - __func__); + hdd_err("failed to copy data to user buffer"); ret = -EFAULT; } @@ -3898,31 +3720,25 @@ static int drv_cmd_set_scan_channel_time(hdd_adapter_t *adapter, * If the input value is greater than max value of datatype, * then also kstrtou8 fails */ - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: kstrtou16 failed range [%d - %d]", - __func__, - CFG_NEIGHBOR_SCAN_MAX_CHAN_TIME_MIN, - CFG_NEIGHBOR_SCAN_MAX_CHAN_TIME_MAX); + hdd_err("kstrtou16 failed range [%d - %d]", + CFG_NEIGHBOR_SCAN_MAX_CHAN_TIME_MIN, + CFG_NEIGHBOR_SCAN_MAX_CHAN_TIME_MAX); ret = -EINVAL; goto exit; } if ((maxTime < CFG_NEIGHBOR_SCAN_MAX_CHAN_TIME_MIN) || (maxTime > CFG_NEIGHBOR_SCAN_MAX_CHAN_TIME_MAX)) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "lfr mode value %d is out of range (Min: %d Max: %d)", - maxTime, - CFG_NEIGHBOR_SCAN_MAX_CHAN_TIME_MIN, - CFG_NEIGHBOR_SCAN_MAX_CHAN_TIME_MAX); + hdd_err("lfr mode value %d is out of range (Min: %d Max: %d)", + maxTime, + CFG_NEIGHBOR_SCAN_MAX_CHAN_TIME_MIN, + CFG_NEIGHBOR_SCAN_MAX_CHAN_TIME_MAX); ret = -EINVAL; goto exit; } - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, - "%s: Received Command to change channel max time = %d", - __func__, maxTime); + hdd_info("Received Command to change channel max time = %d", + maxTime); hdd_ctx->config->nNeighborScanMaxChanTime = maxTime; sme_set_neighbor_scan_max_chan_time(hdd_ctx->hHal, @@ -3951,10 +3767,7 @@ static int drv_cmd_get_scan_channel_time(hdd_adapter_t *adapter, len = QDF_MIN(priv_data->total_len, len + 1); if (copy_to_user(priv_data->buf, &extra, len)) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: failed to copy data to user buffer", - __func__); + hdd_err("failed to copy data to user buffer"); ret = -EFAULT; } @@ -3981,31 +3794,25 @@ static int drv_cmd_set_scan_home_time(hdd_adapter_t *adapter, * If the input value is greater than max value of datatype, * then also kstrtou8 fails */ - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: kstrtou16 failed range [%d - %d]", - __func__, - CFG_NEIGHBOR_SCAN_TIMER_PERIOD_MIN, - CFG_NEIGHBOR_SCAN_TIMER_PERIOD_MAX); + hdd_err("kstrtou16 failed range [%d - %d]", + CFG_NEIGHBOR_SCAN_TIMER_PERIOD_MIN, + CFG_NEIGHBOR_SCAN_TIMER_PERIOD_MAX); ret = -EINVAL; goto exit; } if ((val < CFG_NEIGHBOR_SCAN_TIMER_PERIOD_MIN) || (val > CFG_NEIGHBOR_SCAN_TIMER_PERIOD_MAX)) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "scan home time value %d is out of range (Min: %d Max: %d)", - val, - CFG_NEIGHBOR_SCAN_TIMER_PERIOD_MIN, - CFG_NEIGHBOR_SCAN_TIMER_PERIOD_MAX); + hdd_err("scan home time value %d is out of range (Min: %d Max: %d)", + val, + CFG_NEIGHBOR_SCAN_TIMER_PERIOD_MIN, + CFG_NEIGHBOR_SCAN_TIMER_PERIOD_MAX); ret = -EINVAL; goto exit; } - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, - "%s: Received Command to change scan home time = %d", - __func__, val); + hdd_info("Received Command to change scan home time = %d", + val); hdd_ctx->config->nNeighborScanPeriod = val; sme_set_neighbor_scan_period(hdd_ctx->hHal, @@ -4034,10 +3841,7 @@ static int drv_cmd_get_scan_home_time(hdd_adapter_t *adapter, len = QDF_MIN(priv_data->total_len, len + 1); if (copy_to_user(priv_data->buf, &extra, len)) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: failed to copy data to user buffer", - __func__); + hdd_err("failed to copy data to user buffer"); ret = -EFAULT; } @@ -4064,29 +3868,24 @@ static int drv_cmd_set_roam_intra_band(hdd_adapter_t *adapter, * If the input value is greater than max value of datatype, * then also kstrtou8 fails */ - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: kstrtou8 failed range [%d - %d]", - __func__, CFG_ROAM_INTRA_BAND_MIN, - CFG_ROAM_INTRA_BAND_MAX); + hdd_err("kstrtou8 failed range [%d - %d]", + CFG_ROAM_INTRA_BAND_MIN, + CFG_ROAM_INTRA_BAND_MAX); ret = -EINVAL; goto exit; } if ((val < CFG_ROAM_INTRA_BAND_MIN) || (val > CFG_ROAM_INTRA_BAND_MAX)) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "intra band mode value %d is out of range (Min: %d Max: %d)", - val, - CFG_ROAM_INTRA_BAND_MIN, - CFG_ROAM_INTRA_BAND_MAX); + hdd_err("intra band mode value %d is out of range (Min: %d Max: %d)", + val, + CFG_ROAM_INTRA_BAND_MIN, + CFG_ROAM_INTRA_BAND_MAX); ret = -EINVAL; goto exit; } - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, - "%s: Received Command to change intra band = %d", - __func__, val); + hdd_info("Received Command to change intra band = %d", + val); hdd_ctx->config->nRoamIntraBand = val; sme_set_roam_intra_band(hdd_ctx->hHal, val); @@ -4111,10 +3910,7 @@ static int drv_cmd_get_roam_intra_band(hdd_adapter_t *adapter, "GETROAMINTRABAND", val); len = QDF_MIN(priv_data->total_len, len + 1); if (copy_to_user(priv_data->buf, &extra, len)) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: failed to copy data to user buffer", - __func__); + hdd_err("failed to copy data to user buffer"); ret = -EFAULT; } @@ -4141,30 +3937,25 @@ static int drv_cmd_set_scan_n_probes(hdd_adapter_t *adapter, * If the input value is greater than max value of datatype, * then also kstrtou8 fails */ - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: kstrtou8 failed range [%d - %d]", - __func__, CFG_ROAM_SCAN_N_PROBES_MIN, - CFG_ROAM_SCAN_N_PROBES_MAX); + hdd_err("kstrtou8 failed range [%d - %d]", + CFG_ROAM_SCAN_N_PROBES_MIN, + CFG_ROAM_SCAN_N_PROBES_MAX); ret = -EINVAL; goto exit; } if ((nProbes < CFG_ROAM_SCAN_N_PROBES_MIN) || (nProbes > CFG_ROAM_SCAN_N_PROBES_MAX)) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "NProbes value %d is out of range (Min: %d Max: %d)", - nProbes, - CFG_ROAM_SCAN_N_PROBES_MIN, - CFG_ROAM_SCAN_N_PROBES_MAX); + hdd_err("NProbes value %d is out of range (Min: %d Max: %d)", + nProbes, + CFG_ROAM_SCAN_N_PROBES_MIN, + CFG_ROAM_SCAN_N_PROBES_MAX); ret = -EINVAL; goto exit; } - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, - "%s: Received Command to Set nProbes = %d", - __func__, nProbes); + hdd_info("Received Command to Set nProbes = %d", + nProbes); hdd_ctx->config->nProbes = nProbes; sme_update_roam_scan_n_probes(hdd_ctx->hHal, @@ -4188,10 +3979,7 @@ static int drv_cmd_get_scan_n_probes(hdd_adapter_t *adapter, len = scnprintf(extra, sizeof(extra), "%s %d", command, val); len = QDF_MIN(priv_data->total_len, len + 1); if (copy_to_user(priv_data->buf, &extra, len)) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: failed to copy data to user buffer", - __func__); + hdd_err("failed to copy data to user buffer"); ret = -EFAULT; } @@ -4220,21 +4008,16 @@ static int drv_cmd_set_scan_home_away_time(hdd_adapter_t *adapter, * If the input value is greater than max value of datatype, * then also kstrtou8 fails */ - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: kstrtou8 failed range [%d - %d]", - __func__, - CFG_ROAM_SCAN_HOME_AWAY_TIME_MIN, - CFG_ROAM_SCAN_HOME_AWAY_TIME_MAX); + hdd_err("kstrtou8 failed range [%d - %d]", + CFG_ROAM_SCAN_HOME_AWAY_TIME_MIN, + CFG_ROAM_SCAN_HOME_AWAY_TIME_MAX); ret = -EINVAL; goto exit; } if ((homeAwayTime < CFG_ROAM_SCAN_HOME_AWAY_TIME_MIN) || (homeAwayTime > CFG_ROAM_SCAN_HOME_AWAY_TIME_MAX)) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "homeAwayTime value %d is out of range (Min: %d Max: %d)", + hdd_err("homeAwayTime value %d is out of range (Min: %d Max: %d)", homeAwayTime, CFG_ROAM_SCAN_HOME_AWAY_TIME_MIN, CFG_ROAM_SCAN_HOME_AWAY_TIME_MAX); @@ -4242,9 +4025,8 @@ static int drv_cmd_set_scan_home_away_time(hdd_adapter_t *adapter, goto exit; } - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, - "%s: Received Command to Set scan away time = %d", - __func__, homeAwayTime); + hdd_info("Received Command to Set scan away time = %d", + homeAwayTime); if (hdd_ctx->config->nRoamScanHomeAwayTime != homeAwayTime) { @@ -4274,10 +4056,7 @@ static int drv_cmd_get_scan_home_away_time(hdd_adapter_t *adapter, len = QDF_MIN(priv_data->total_len, len + 1); if (copy_to_user(priv_data->buf, &extra, len)) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: failed to copy data to user buffer", - __func__); + hdd_err("failed to copy data to user buffer"); ret = -EFAULT; } @@ -4313,10 +4092,7 @@ static int drv_cmd_set_wes_mode(hdd_adapter_t *adapter, * If the input value is greater than max value of datatype, * then also kstrtou8 fails */ - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: kstrtou8 failed range [%d - %d]", - __func__, + hdd_err("kstrtou8 failed range [%d - %d]", CFG_ENABLE_WES_MODE_NAME_MIN, CFG_ENABLE_WES_MODE_NAME_MAX); ret = -EINVAL; @@ -4325,9 +4101,7 @@ static int drv_cmd_set_wes_mode(hdd_adapter_t *adapter, if ((wesMode < CFG_ENABLE_WES_MODE_NAME_MIN) || (wesMode > CFG_ENABLE_WES_MODE_NAME_MAX)) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "WES Mode value %d is out of range (Min: %d Max: %d)", + hdd_err("WES Mode value %d is out of range (Min: %d Max: %d)", wesMode, CFG_ENABLE_WES_MODE_NAME_MIN, CFG_ENABLE_WES_MODE_NAME_MAX); @@ -4335,9 +4109,8 @@ static int drv_cmd_set_wes_mode(hdd_adapter_t *adapter, goto exit; } - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, - "%s: Received Command to Set WES Mode rssi diff = %d", - __func__, wesMode); + hdd_info("Received Command to Set WES Mode rssi diff = %d", + wesMode); hdd_ctx->config->isWESModeEnabled = wesMode; sme_update_wes_mode(hdd_ctx->hHal, wesMode, adapter->sessionId); @@ -4360,10 +4133,7 @@ static int drv_cmd_get_wes_mode(hdd_adapter_t *adapter, len = scnprintf(extra, sizeof(extra), "%s %d", command, wesMode); len = QDF_MIN(priv_data->total_len, len + 1); if (copy_to_user(priv_data->buf, &extra, len)) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: failed to copy data to user buffer", - __func__); + hdd_err("failed to copy data to user buffer"); ret = -EFAULT; } @@ -4391,16 +4161,13 @@ static int drv_cmd_set_opportunistic_rssi_diff(hdd_adapter_t *adapter, * If the input value is greater than max value of datatype, * then also kstrtou8 fails */ - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: kstrtou8 failed.", __func__); + hdd_err("kstrtou8 failed."); ret = -EINVAL; goto exit; } - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, - "%s: Received Command to Set Opportunistic Threshold diff = %d", - __func__, nOpportunisticThresholdDiff); + hdd_info("Received Command to Set Opportunistic Threshold diff = %d", + nOpportunisticThresholdDiff); sme_set_roam_opportunistic_scan_threshold_diff(hdd_ctx->hHal, adapter->sessionId, @@ -4425,10 +4192,7 @@ static int drv_cmd_get_opportunistic_rssi_diff(hdd_adapter_t *adapter, len = scnprintf(extra, sizeof(extra), "%s %d", command, val); len = QDF_MIN(priv_data->total_len, len + 1); if (copy_to_user(priv_data->buf, &extra, len)) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: failed to copy data to user buffer", - __func__); + hdd_err("failed to copy data to user buffer"); ret = -EFAULT; } @@ -4455,16 +4219,13 @@ static int drv_cmd_set_roam_rescan_rssi_diff(hdd_adapter_t *adapter, * If the input value is greater than max value of datatype, * then also kstrtou8 fails */ - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: kstrtou8 failed.", __func__); + hdd_err("kstrtou8 failed."); ret = -EINVAL; goto exit; } - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, - "%s: Received Command to Set Roam Rescan RSSI Diff = %d", - __func__, nRoamRescanRssiDiff); + hdd_info("Received Command to Set Roam Rescan RSSI Diff = %d", + nRoamRescanRssiDiff); sme_set_roam_rescan_rssi_diff(hdd_ctx->hHal, adapter->sessionId, @@ -4488,10 +4249,7 @@ static int drv_cmd_get_roam_rescan_rssi_diff(hdd_adapter_t *adapter, len = scnprintf(extra, sizeof(extra), "%s %d", command, val); len = QDF_MIN(priv_data->total_len, len + 1); if (copy_to_user(priv_data->buf, &extra, len)) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: failed to copy data to user buffer", - __func__); + hdd_err("failed to copy data to user buffer"); ret = -EFAULT; } @@ -4518,10 +4276,8 @@ static int drv_cmd_set_fast_roam(hdd_adapter_t *adapter, * If the input value is greater than max value of datatype, * then also kstrtou8 fails */ - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: kstrtou8 failed range [%d - %d]", - __func__, CFG_LFR_FEATURE_ENABLED_MIN, + hdd_err("kstrtou8 failed range [%d - %d]", + CFG_LFR_FEATURE_ENABLED_MIN, CFG_LFR_FEATURE_ENABLED_MAX); ret = -EINVAL; goto exit; @@ -4529,9 +4285,7 @@ static int drv_cmd_set_fast_roam(hdd_adapter_t *adapter, if ((lfrMode < CFG_LFR_FEATURE_ENABLED_MIN) || (lfrMode > CFG_LFR_FEATURE_ENABLED_MAX)) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "lfr mode value %d is out of range (Min: %d Max: %d)", + hdd_err("lfr mode value %d is out of range (Min: %d Max: %d)", lfrMode, CFG_LFR_FEATURE_ENABLED_MIN, CFG_LFR_FEATURE_ENABLED_MAX); @@ -4539,9 +4293,8 @@ static int drv_cmd_set_fast_roam(hdd_adapter_t *adapter, goto exit; } - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, - "%s: Received Command to change lfr mode = %d", - __func__, lfrMode); + hdd_info("Received Command to change lfr mode = %d", + lfrMode); hdd_ctx->config->isFastRoamIniFeatureEnabled = lfrMode; sme_update_is_fast_roam_ini_feature_enabled(hdd_ctx->hHal, @@ -4573,10 +4326,7 @@ static int drv_cmd_set_fast_transition(hdd_adapter_t *adapter, * If the input value is greater than max value of datatype, * then also kstrtou8 fails */ - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: kstrtou8 failed range [%d - %d]", - __func__, + hdd_err("kstrtou8 failed range [%d - %d]", CFG_FAST_TRANSITION_ENABLED_NAME_MIN, CFG_FAST_TRANSITION_ENABLED_NAME_MAX); ret = -EINVAL; @@ -4585,9 +4335,7 @@ static int drv_cmd_set_fast_transition(hdd_adapter_t *adapter, if ((ft < CFG_FAST_TRANSITION_ENABLED_NAME_MIN) || (ft > CFG_FAST_TRANSITION_ENABLED_NAME_MAX)) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "ft mode value %d is out of range (Min: %d Max: %d)", + hdd_err("ft mode value %d is out of range (Min: %d Max: %d)", ft, CFG_FAST_TRANSITION_ENABLED_NAME_MIN, CFG_FAST_TRANSITION_ENABLED_NAME_MAX); @@ -4595,9 +4343,7 @@ static int drv_cmd_set_fast_transition(hdd_adapter_t *adapter, goto exit; } - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, - "%s: Received Command to change ft mode = %d", - __func__, ft); + hdd_info("Received Command to change ft mode = %d", ft); hdd_ctx->config->isFastTransitionEnabled = ft; sme_update_fast_transition_enabled(hdd_ctx->hHal, ft); @@ -4615,7 +4361,7 @@ static void hdd_wma_send_fastreassoc_cmd(int sessionId, tSirMacAddr bssid, fastreassoc = qdf_mem_malloc(sizeof(*fastreassoc)); if (NULL == fastreassoc) { - hddLog(LOGE, FL("qdf_mem_malloc failed for fastreassoc")); + hdd_err("qdf_mem_malloc failed for fastreassoc"); return; } fastreassoc->vdev_id = sessionId; @@ -4633,8 +4379,7 @@ static void hdd_wma_send_fastreassoc_cmd(int sessionId, tSirMacAddr bssid, if (QDF_STATUS_SUCCESS != cds_mq_post_message(QDF_MODULE_ID_WMA, &msg)) { qdf_mem_free(fastreassoc); - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, - FL("Not able to post ROAM_INVOKE_CMD message to WMA")); + hdd_err("Not able to post ROAM_INVOKE_CMD message to WMA"); } } #else @@ -4668,9 +4413,7 @@ static int drv_cmd_fast_reassoc(hdd_adapter_t *adapter, /* if not associated, no need to proceed with reassoc */ if (eConnectionState_Associated != pHddStaCtx->conn_info.connState) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_INFO, - "%s:Not associated!", __func__); + hdd_info("Not associated!"); ret = -EINVAL; goto exit; } @@ -4678,10 +4421,7 @@ static int drv_cmd_fast_reassoc(hdd_adapter_t *adapter, ret = hdd_parse_reassoc_command_v1_data(value, targetApBssid, &channel); if (ret) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: Failed to parse reassoc command data", - __func__); + hdd_err("Failed to parse reassoc command data"); goto exit; } @@ -4695,12 +4435,10 @@ static int drv_cmd_fast_reassoc(hdd_adapter_t *adapter, /* Reassoc to same AP, only supported for Open Security*/ if ((pHddStaCtx->conn_info.ucEncryptionType || pHddStaCtx->conn_info.mcEncryptionType)) { - hddLog(LOGE, - FL("Reassoc to same AP, only supported for Open Security")); + hdd_err("Reassoc to same AP, only supported for Open Security"); return -ENOTSUPP; } - hddLog(LOG1, - FL("Reassoc BSSID is same as currently associated AP bssid")); + hdd_info("Reassoc BSSID is same as currently associated AP bssid"); sme_get_modify_profile_fields(hdd_ctx->hHal, adapter->sessionId, &modProfileFields); sme_roam_reassoc(hdd_ctx->hHal, adapter->sessionId, @@ -4711,7 +4449,7 @@ static int drv_cmd_fast_reassoc(hdd_adapter_t *adapter, /* Check channel number is a valid channel number */ if (QDF_STATUS_SUCCESS != wlan_hdd_validate_operation_channel(adapter, channel)) { - hddLog(LOGE, FL("Invalid Channel [%d]"), channel); + hdd_err("Invalid Channel [%d]", channel); return -EINVAL; } if (roaming_offload_enabled(hdd_ctx)) { @@ -4750,16 +4488,13 @@ static int drv_cmd_set_roam_scan_control(hdd_adapter_t *adapter, * If the input value is greater than max value of datatype, * then also kstrtou8 fails */ - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: kstrtou8 failed ", __func__); + hdd_err("kstrtou8 failed "); ret = -EINVAL; goto exit; } - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, - "%s: Received Command to Set roam scan control = %d", - __func__, roamScanControl); + hdd_info("Received Command to Set roam scan control = %d", + roamScanControl); if (0 != roamScanControl) { ret = 0; /* return success but ignore param value "true" */ @@ -4791,10 +4526,7 @@ static int drv_cmd_set_okc_mode(hdd_adapter_t *adapter, if (sme_get_is_ese_feature_enabled(hdd_ctx->hHal) && hdd_is_okc_mode_enabled(hdd_ctx) && sme_get_is_ft_feature_enabled(hdd_ctx->hHal)) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_WARN, - "%s: OKC/ESE/11R are supported simultaneously hence this operation is not permitted!", - __func__); + hdd_warn("OKC/ESE/11R are supported simultaneously hence this operation is not permitted!"); ret = -EPERM; goto exit; } @@ -4809,10 +4541,8 @@ static int drv_cmd_set_okc_mode(hdd_adapter_t *adapter, * If the input value is greater than max value of datatype, * then also kstrtou8 fails */ - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: kstrtou8 failed range [%d - %d]", - __func__, CFG_OKC_FEATURE_ENABLED_MIN, + hdd_err("kstrtou8 failed range [%d - %d]", + CFG_OKC_FEATURE_ENABLED_MIN, CFG_OKC_FEATURE_ENABLED_MAX); ret = -EINVAL; goto exit; @@ -4820,18 +4550,15 @@ static int drv_cmd_set_okc_mode(hdd_adapter_t *adapter, if ((okcMode < CFG_OKC_FEATURE_ENABLED_MIN) || (okcMode > CFG_OKC_FEATURE_ENABLED_MAX)) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "Okc mode value %d is out of range (Min: %d Max: %d)", + hdd_err("Okc mode value %d is out of range (Min: %d Max: %d)", okcMode, CFG_OKC_FEATURE_ENABLED_MIN, CFG_OKC_FEATURE_ENABLED_MAX); ret = -EINVAL; goto exit; } - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, - "%s: Received Command to change okc mode = %d", - __func__, okcMode); + hdd_info("Received Command to change okc mode = %d", + okcMode); hdd_ctx->config->isOkcIniFeatureEnabled = okcMode; @@ -4854,10 +4581,7 @@ static int drv_cmd_get_roam_scan_control(hdd_adapter_t *adapter, command, roamScanControl); len = QDF_MIN(priv_data->total_len, len + 1); if (copy_to_user(priv_data->buf, &extra, len)) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: failed to copy data to user buffer", - __func__); + hdd_err("failed to copy data to user buffer"); ret = -EFAULT; } @@ -4875,19 +4599,15 @@ static int drv_cmd_bt_coex_mode(hdd_adapter_t *adapter, bcMode = command + 11; if ('1' == *bcMode) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_DEBUG, - FL("BTCOEXMODE %d"), *bcMode); + hdd_debug("BTCOEXMODE %d", *bcMode); hdd_ctx->btCoexModeSet = true; ret = wlan_hdd_scan_abort(adapter); if (ret < 0) { - hddLog(LOGE, - FL("Failed to abort existing scan status:%d"), ret); + hdd_err("Failed to abort existing scan status: %d", + ret); } } else if ('2' == *bcMode) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_DEBUG, - FL("BTCOEXMODE %d"), *bcMode); + hdd_debug("BTCOEXMODE %d", *bcMode); hdd_ctx->btCoexModeSet = false; } @@ -4930,10 +4650,7 @@ static int drv_cmd_get_dwell_time(hdd_adapter_t *adapter, ret = hdd_get_dwell_time(pCfg, command, extra, sizeof(extra), &len); len = QDF_MIN(priv_data->total_len, len + 1); if (ret != 0 || copy_to_user(priv_data->buf, &extra, len)) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: failed to copy data to user buffer", - __func__); + hdd_err("failed to copy data to user buffer"); ret = -EFAULT; goto exit; } @@ -4966,9 +4683,7 @@ static int drv_cmd_miracast(hdd_adapter_t *adapter, pHddCtx = WLAN_HDD_GET_CTX(adapter); if (0 != wlan_hdd_validate_context(pHddCtx)) { - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, - "%s pHddCtx is not valid, Unable to set miracast mode", - __func__); + hdd_err("pHddCtx is not valid, Unable to set miracast mode"); return -EINVAL; } @@ -4982,20 +4697,14 @@ static int drv_cmd_miracast(hdd_adapter_t *adapter, * If the input value is greater than max value of datatype, * then also kstrtou8 fails */ - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: kstrtou8 failed range ", - __func__); + hdd_err("kstrtou8 failed range "); ret = -EINVAL; goto exit; } if ((filterType < WLAN_HDD_DRIVER_MIRACAST_CFG_MIN_VAL) || (filterType > WLAN_HDD_DRIVER_MIRACAST_CFG_MAX_VAL)) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: Accepted Values are 0 to 2. 0-Disabled, 1-Source, 2-Sink ", - __func__); + hdd_err("Accepted Values are 0 to 2. 0-Disabled, 1-Source, 2-Sink "); ret = -EINVAL; goto exit; } @@ -5004,7 +4713,7 @@ static int drv_cmd_miracast(hdd_adapter_t *adapter, ret_status = sme_set_miracast(hHal, filterType); if (QDF_STATUS_SUCCESS != ret_status) { - hddLog(LOGE, "Failed to set miracast"); + hdd_err("Failed to set miracast"); return -EBUSY; } @@ -5088,24 +4797,21 @@ static int drv_cmd_set_ibss_beacon_oui_data(hdd_adapter_t *adapter, if (QDF_IBSS_MODE != adapter->device_mode) { - hddLog(LOG1, FL("Device_mode %s(%d) not IBSS"), - hdd_device_mode_to_string(adapter->device_mode), - adapter->device_mode); + hdd_info("Device_mode %s(%d) not IBSS", + hdd_device_mode_to_string(adapter->device_mode), + adapter->device_mode); return ret; } pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(adapter); - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, - "%s: received command %s", __func__, - ((char *)value)); + hdd_info("received command %s", ((char *)value)); /* validate argument of command */ if (strlen(value) <= command_len) { - hddLog(LOGE, - FL("No arguements in command length %zu"), - strlen(value)); + hdd_err("No arguments in command length %zu", + strlen(value)); ret = -EFAULT; goto exit; } @@ -5116,18 +4822,16 @@ static int drv_cmd_set_ibss_beacon_oui_data(hdd_adapter_t *adapter, /* oui_data can't be less than 3 bytes */ if (command_len < (2 * WLAN_HDD_IBSS_MIN_OUI_DATA_LENGTH)) { - hddLog(LOGE, - FL("Invalid SETIBSSBEACONOUIDATA command length %d"), - command_len); + hdd_err("Invalid SETIBSSBEACONOUIDATA command length %d", + command_len); ret = -EFAULT; goto exit; } ibss_ie = qdf_mem_malloc(command_len); if (!ibss_ie) { - hddLog(LOGE, - FL("Could not allocate memory for command length %d"), - command_len); + hdd_err("Could not allocate memory for command length %d", + command_len); ret = -ENOMEM; goto exit; } @@ -5137,8 +4841,8 @@ static int drv_cmd_set_ibss_beacon_oui_data(hdd_adapter_t *adapter, &oui_length, command_len); if (ibss_ie_length <= (2 * WLAN_HDD_IBSS_MIN_OUI_DATA_LENGTH)) { - hddLog(LOGE, FL("Could not parse command %s return length %d"), - value, ibss_ie_length); + hdd_err("Could not parse command %s return length %d", + value, ibss_ie_length); ret = -EFAULT; qdf_mem_free(ibss_ie); goto exit; @@ -5157,10 +4861,10 @@ static int drv_cmd_set_ibss_beacon_oui_data(hdd_adapter_t *adapter, ibssModifyIE.pIEBuffer = ibss_ie; ibssModifyIE.oui_length = oui_length; - hddLog(LOGW, FL("ibss_ie length %d oui_length %d ibss_ie:"), - ibss_ie_length, oui_length); + hdd_warn("ibss_ie length %d oui_length %d ibss_ie:", + ibss_ie_length, oui_length); while (i < ibssModifyIE.ieBufferlength) - hddLog(LOGW, FL("0x%x"), ibss_ie[i++]); + hdd_warn("0x%x", ibss_ie[i++]); /* Probe Bcn modification */ sme_modify_add_ie(WLAN_HDD_GET_HAL_CTX(adapter), @@ -5175,9 +4879,7 @@ static int drv_cmd_set_ibss_beacon_oui_data(hdd_adapter_t *adapter, status = sme_send_cesium_enable_ind((tHalHandle)(hdd_ctx->hHal), adapter->sessionId); if (QDF_STATUS_SUCCESS != status) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "Could not send cesium enable indication %d", + hdd_err("Could not send cesium enable indication %d", status); ret = -EINVAL; goto exit; @@ -5200,27 +4902,22 @@ static int drv_cmd_set_rmc_enable(hdd_adapter_t *adapter, if ((QDF_IBSS_MODE != adapter->device_mode) && (QDF_SAP_MODE != adapter->device_mode)) { - hddLog(LOGE, - "Received SETRMCENABLE cmd in invalid mode %s(%d)", - hdd_device_mode_to_string(adapter->device_mode), - adapter->device_mode); - hddLog(LOGE, - "SETRMCENABLE cmd is allowed only in IBSS/SOFTAP mode"); + hdd_err("Received SETRMCENABLE cmd in invalid mode %s(%d)", + hdd_device_mode_to_string(adapter->device_mode), + adapter->device_mode); + hdd_err("SETRMCENABLE cmd is allowed only in IBSS/SOFTAP mode"); ret = -EINVAL; goto exit; } status = hdd_parse_setrmcenable_command(value, &ucRmcEnable); if (status) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "Invalid SETRMCENABLE command "); + hdd_err("Invalid SETRMCENABLE command "); ret = -EINVAL; goto exit; } - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, - "%s: ucRmcEnable %d ", __func__, ucRmcEnable); + hdd_info("ucRmcEnable %d ", ucRmcEnable); if (true == ucRmcEnable) { status = sme_enable_rmc((tHalHandle) @@ -5231,19 +4928,15 @@ static int drv_cmd_set_rmc_enable(hdd_adapter_t *adapter, (hdd_ctx->hHal), adapter->sessionId); } else { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "Invalid SETRMCENABLE command %d", - ucRmcEnable); + hdd_err("Invalid SETRMCENABLE command %d", + ucRmcEnable); ret = -EINVAL; goto exit; } if (QDF_STATUS_SUCCESS != status) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: SETRMC %d failed status %d", - __func__, ucRmcEnable, status); + hdd_err("SETRMC %d failed status %d", + ucRmcEnable, status); ret = -EINVAL; goto exit; } @@ -5265,35 +4958,29 @@ static int drv_cmd_set_rmc_action_period(hdd_adapter_t *adapter, if ((QDF_IBSS_MODE != adapter->device_mode) && (QDF_SAP_MODE != adapter->device_mode)) { - hddLog(LOGE, "Received SETRMC cmd in invalid mode %s(%d)", + hdd_err("Received SETRMC cmd in invalid mode %s(%d)", hdd_device_mode_to_string(adapter->device_mode), adapter->device_mode); - hddLog(LOGE, - "SETRMC cmd is allowed only in IBSS/SOFTAP mode"); + hdd_err("SETRMC cmd is allowed only in IBSS/SOFTAP mode"); ret = -EINVAL; goto exit; } status = hdd_parse_setrmcactionperiod_command(value, &uActionPeriod); if (status) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "Invalid SETRMCACTIONPERIOD command "); + hdd_err("Invalid SETRMCACTIONPERIOD command "); ret = -EINVAL; goto exit; } - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, - "%s: uActionPeriod %d ", __func__, + hdd_info("uActionPeriod %d ", uActionPeriod); if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_RMC_ACTION_PERIOD_FREQUENCY, uActionPeriod)) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: Could not set SETRMCACTIONPERIOD %d", - __func__, uActionPeriod); + hdd_err("Could not set SETRMCACTIONPERIOD %d", + uActionPeriod); ret = -EINVAL; goto exit; } @@ -5301,9 +4988,7 @@ static int drv_cmd_set_rmc_action_period(hdd_adapter_t *adapter, status = sme_send_rmc_action_period((tHalHandle)(hdd_ctx->hHal), adapter->sessionId); if (QDF_STATUS_SUCCESS != status) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "Could not send cesium enable indication %d", + hdd_err("Could not send cesium enable indication %d", status); ret = -EINVAL; goto exit; @@ -5336,9 +5021,7 @@ static int drv_cmd_get_ibss_peer_info_all(hdd_adapter_t *adapter, } pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, - "%s: Received GETIBSSPEERINFOALL Command", - __func__); + hdd_info("Received GETIBSSPEERINFOALL Command"); /* Handle the command */ status = hdd_cfg80211_get_ibss_peer_info_all(adapter); @@ -5352,10 +5035,7 @@ static int drv_cmd_get_ibss_peer_info_all(hdd_adapter_t *adapter, extra = kmalloc(WLAN_MAX_BUF_SIZE, GFP_KERNEL); if (NULL == extra) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s:kmalloc failed", - __func__); + hdd_err("kmalloc failed"); ret = -EINVAL; goto exit; } @@ -5401,45 +5081,32 @@ static int drv_cmd_get_ibss_peer_info_all(hdd_adapter_t *adapter, * it in two shots */ if (copy_to_user(priv_data->buf, extra, numOfBytestoPrint)) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: Copy into user data buffer failed ", - __func__); + hdd_err("Copy into user data buffer failed "); ret = -EFAULT; goto exit; } priv_data->buf[numOfBytestoPrint] = '\0'; - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_INFO_MED, "%s", - priv_data->buf); + hdd_debug("%s", priv_data->buf); if (length > numOfBytestoPrint) { if (copy_to_user (priv_data->buf + numOfBytestoPrint, extra + numOfBytestoPrint, length - numOfBytestoPrint + 1)) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: Copy into user data buffer failed ", - __func__); + hdd_err("Copy into user data buffer failed "); ret = -EFAULT; goto exit; } - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_INFO_MED, - "%s", - &priv_data->buf[numOfBytestoPrint]); + hdd_debug("%s", &priv_data->buf[numOfBytestoPrint]); } /* Free temporary buffer */ kfree(extra); } else { /* Command failed, log error */ - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: GETIBSSPEERINFOALL command failed with status code %d", - __func__, status); + hdd_err("GETIBSSPEERINFOALL command failed with status code %d", + status); ret = -EINVAL; goto exit; } @@ -5474,17 +5141,12 @@ static int drv_cmd_get_ibss_peer_info(hdd_adapter_t *adapter, pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, - "%s: Received GETIBSSPEERINFO Command", - __func__); + hdd_info("Received GETIBSSPEERINFO Command"); /* if there are no peers, no need to continue with the command */ if (eConnectionState_IbssConnected != pHddStaCtx->conn_info.connState) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_INFO, - "%s:No IBSS Peers coalesced", - __func__); + hdd_info("No IBSS Peers coalesced"); ret = -EINVAL; goto exit; } @@ -5492,10 +5154,7 @@ static int drv_cmd_get_ibss_peer_info(hdd_adapter_t *adapter, /* Parse the incoming command buffer */ status = hdd_parse_get_ibss_peer_info(value, &peerMacAddr); if (QDF_STATUS_SUCCESS != status) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: Invalid GETIBSSPEERINFO command", - __func__); + hdd_err("Invalid GETIBSSPEERINFO command"); ret = -EINVAL; goto exit; } @@ -5504,10 +5163,7 @@ static int drv_cmd_get_ibss_peer_info(hdd_adapter_t *adapter, hdd_ibss_get_sta_id(pHddStaCtx, &peerMacAddr, &staIdx); if (staIdx > MAX_IBSS_PEERS) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: Invalid StaIdx %d returned", - __func__, staIdx); + hdd_err("Invalid StaIdx %d returned", staIdx); ret = -EINVAL; goto exit; } @@ -5525,26 +5181,20 @@ static int drv_cmd_get_ibss_peer_info(hdd_adapter_t *adapter, /* Copy the data back into buffer */ if (copy_to_user(priv_data->buf, &extra, length + 1)) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: copy data to user buffer failed GETIBSSPEERINFO command", - __func__); + hdd_err("copy data to user buffer failed GETIBSSPEERINFO command"); ret = -EFAULT; goto exit; } } else { /* Command failed, log error */ - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: GETIBSSPEERINFO command failed with status code %d", - __func__, status); + hdd_err("GETIBSSPEERINFO command failed with status code %d", + status); ret = -EINVAL; goto exit; } /* Success ! */ - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO_MED, - "%s", priv_data->buf); + hdd_debug("%s", priv_data->buf); ret = 0; exit: @@ -5567,26 +5217,21 @@ static int drv_cmd_set_rmc_tx_rate(hdd_adapter_t *adapter, if ((QDF_IBSS_MODE != adapter->device_mode) && (QDF_SAP_MODE != adapter->device_mode)) { - hddLog(LOGE, - "Received SETRMCTXRATE cmd in invalid mode %s(%d)", - hdd_device_mode_to_string(adapter->device_mode), - adapter->device_mode); - hddLog(LOGE, - "SETRMCTXRATE cmd is allowed only in IBSS/SOFTAP mode"); + hdd_err("Received SETRMCTXRATE cmd in invalid mode %s(%d)", + hdd_device_mode_to_string(adapter->device_mode), + adapter->device_mode); + hdd_err("SETRMCTXRATE cmd is allowed only in IBSS/SOFTAP mode"); ret = -EINVAL; goto exit; } status = hdd_parse_setrmcrate_command(value, &uRate, &txFlags); if (status) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "Invalid SETRMCTXRATE command "); + hdd_err("Invalid SETRMCTXRATE command "); ret = -EINVAL; goto exit; } - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, - "%s: uRate %d ", __func__, uRate); + hdd_info("uRate %d ", uRate); /* -1 implies ignore this param */ rateUpdateParams.ucastDataRate = -1; @@ -5625,15 +5270,11 @@ static int drv_cmd_set_ibss_tx_fail_event(hdd_adapter_t *adapter, ret = hdd_parse_ibsstx_fail_event_params(value, &tx_fail_count, &pid); if (0 != ret) { - hddLog(QDF_TRACE_LEVEL_INFO, - "%s: Failed to parse SETIBSSTXFAILEVENT arguments", - __func__); + hdd_info("Failed to parse SETIBSSTXFAILEVENT arguments"); goto exit; } - hddLog(QDF_TRACE_LEVEL_INFO, - "%s: tx_fail_cnt=%hhu, pid=%hu", __func__, - tx_fail_count, pid); + hdd_info("tx_fail_cnt=%hhu, pid=%hu", tx_fail_count, pid); if (0 == tx_fail_count) { /* Disable TX Fail Indication */ @@ -5643,10 +5284,7 @@ static int drv_cmd_set_ibss_tx_fail_event(hdd_adapter_t *adapter, NULL)) { cesium_pid = 0; } else { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: failed to disable TX Fail Event ", - __func__); + hdd_err("failed to disable TX Fail Event "); ret = -EINVAL; } } else { @@ -5655,15 +5293,10 @@ static int drv_cmd_set_ibss_tx_fail_event(hdd_adapter_t *adapter, tx_fail_count, (void *)hdd_tx_fail_ind_callback)) { cesium_pid = pid; - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_INFO, - "%s: Registered Cesium pid %u", - __func__, cesium_pid); + hdd_info("Registered Cesium pid %u", + cesium_pid); } else { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: Failed to enable TX Fail Monitoring", - __func__); + hdd_err("Failed to enable TX Fail Monitoring"); ret = -EINVAL; } } @@ -5687,17 +5320,11 @@ static int drv_cmd_set_ccx_roam_scan_channels(hdd_adapter_t *adapter, ret = hdd_parse_channellist(value, ChannelList, &numChannels); if (ret) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: Failed to parse channel list information", - __func__); + hdd_err("Failed to parse channel list information"); goto exit; } if (numChannels > WNI_CFG_VALID_CHANNEL_LIST_LEN) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: number of channels (%d) supported exceeded max (%d)", - __func__, + hdd_err("number of channels (%d) supported exceeded max (%d)", numChannels, WNI_CFG_VALID_CHANNEL_LIST_LEN); ret = -EINVAL; @@ -5708,10 +5335,7 @@ static int drv_cmd_set_ccx_roam_scan_channels(hdd_adapter_t *adapter, ChannelList, numChannels); if (QDF_STATUS_SUCCESS != status) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: Failed to update channel list information", - __func__); + hdd_err("Failed to update channel list information"); ret = -EINVAL; goto exit; } @@ -5746,9 +5370,7 @@ static int drv_cmd_get_tsm_stats(hdd_adapter_t *adapter, /* if not associated, return error */ if (eConnectionState_Associated != pHddStaCtx->conn_info.connState) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s:Not associated!", __func__); + hdd_err("Not associated!"); ret = -EINVAL; goto exit; } @@ -5763,38 +5385,28 @@ static int drv_cmd_get_tsm_stats(hdd_adapter_t *adapter, * If the input value is greater than max value of datatype, * then also kstrtou8 fails */ - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: kstrtou8 failed range [%d - %d]", - __func__, TID_MIN_VALUE, + hdd_err("kstrtou8 failed range [%d - %d]", + TID_MIN_VALUE, TID_MAX_VALUE); ret = -EINVAL; goto exit; } if ((tid < TID_MIN_VALUE) || (tid > TID_MAX_VALUE)) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "tid value %d is out of range (Min: %d Max: %d)", + hdd_err("tid value %d is out of range (Min: %d Max: %d)", tid, TID_MIN_VALUE, TID_MAX_VALUE); ret = -EINVAL; goto exit; } - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_INFO, - "%s: Received Command to get tsm stats tid = %d", - __func__, tid); + hdd_info("Received Command to get tsm stats tid = %d", + tid); if (QDF_STATUS_SUCCESS != hdd_get_tsm_stats(adapter, tid, &tsm_metrics)) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: failed to get tsm stats", - __func__); + hdd_err("failed to get tsm stats"); ret = -EFAULT; goto exit; } - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_INFO, - "UplinkPktQueueDly(%d) UplinkPktQueueDlyHist[0](%d) UplinkPktQueueDlyHist[1](%d) UplinkPktQueueDlyHist[2](%d) UplinkPktQueueDlyHist[3](%d) UplinkPktTxDly(%u) UplinkPktLoss(%d) UplinkPktCount(%d) RoamingCount(%d) RoamingDly(%d)", + hdd_info( + "UplinkPktQueueDly(%d) UplinkPktQueueDlyHist[0](%d) UplinkPktQueueDlyHist[1](%d) UplinkPktQueueDlyHist[2](%d) UplinkPktQueueDlyHist[3](%d) UplinkPktTxDly(%u) UplinkPktLoss(%d) UplinkPktCount(%d) RoamingCount(%d) RoamingDly(%d)", tsm_metrics.UplinkPktQueueDly, tsm_metrics.UplinkPktQueueDlyHist[0], tsm_metrics.UplinkPktQueueDlyHist[1], @@ -5827,10 +5439,7 @@ static int drv_cmd_get_tsm_stats(hdd_adapter_t *adapter, tsm_metrics.RoamingDly); len = QDF_MIN(priv_data->total_len, len + 1); if (copy_to_user(priv_data->buf, &extra, len)) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: failed to copy data to user buffer", - __func__); + hdd_err("failed to copy data to user buffer"); ret = -EFAULT; goto exit; } @@ -5852,18 +5461,13 @@ static int drv_cmd_set_cckm_ie(hdd_adapter_t *adapter, ret = hdd_parse_get_cckm_ie(value, &cckmIe, &cckmIeLen); if (ret) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: Failed to parse cckm ie data", - __func__); + hdd_err("Failed to parse cckm ie data"); goto exit; } if (cckmIeLen > DOT11F_IE_RSN_MAX_LEN) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: CCKM Ie input length is more than max[%d]", - __func__, DOT11F_IE_RSN_MAX_LEN); + hdd_err("CCKM Ie input length is more than max[%d]", + DOT11F_IE_RSN_MAX_LEN); if (NULL != cckmIe) { qdf_mem_free(cckmIe); cckmIe = NULL; @@ -5903,15 +5507,12 @@ static int drv_cmd_ccx_beacon_req(hdd_adapter_t *adapter, ret = hdd_parse_ese_beacon_req(value, &eseBcnReq); if (ret) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: Failed to parse ese beacon req", - __func__); + hdd_err("Failed to parse ese beacon req"); goto exit; } if (!hdd_conn_is_connected(WLAN_HDD_GET_STATION_CTX_PTR(adapter))) { - hddLog(QDF_TRACE_LEVEL_INFO, FL("Not associated")); + hdd_info("Not associated"); hdd_indicate_ese_bcn_report_no_results(adapter, eseBcnReq.bcnReq[0].measurementToken, 0x02, /* BIT(1) set for measurement done */ @@ -5924,16 +5525,13 @@ static int drv_cmd_ccx_beacon_req(hdd_adapter_t *adapter, &eseBcnReq); if (QDF_STATUS_E_RESOURCES == status) { - hddLog(QDF_TRACE_LEVEL_INFO, - FL("sme_set_ese_beacon_request failed (%d), a request already in progress"), - status); + hdd_info("sme_set_ese_beacon_request failed (%d), a request already in progress", + status); ret = -EBUSY; goto exit; } else if (QDF_STATUS_SUCCESS != status) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: sme_set_ese_beacon_request failed (%d)", - __func__, status); + hdd_err("sme_set_ese_beacon_request failed (%d)", + status); ret = -EINVAL; goto exit; } @@ -5984,9 +5582,7 @@ static int drv_cmd_max_tx_power(hdd_adapter_t *adapter, status = hdd_parse_setmaxtxpower_command(value, &txPower); if (status) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "Invalid MAXTXPOWER command "); + hdd_err("Invalid MAXTXPOWER command "); ret = -EINVAL; goto exit; } @@ -6001,8 +5597,8 @@ static int drv_cmd_max_tx_power(hdd_adapter_t *adapter, qdf_copy_macaddr(&selfMac, &adapter->macAddressCurrent); - hddLog(QDF_TRACE_LEVEL_INFO, - "Device mode %d max tx power %d selfMac: " MAC_ADDRESS_STR " bssId: " MAC_ADDRESS_STR " ", + hdd_info("Device mode %d max tx power %d selfMac: " + MAC_ADDRESS_STR " bssId: " MAC_ADDRESS_STR " ", adapter->device_mode, txPower, MAC_ADDR_ARRAY(selfMac.bytes), MAC_ADDR_ARRAY(bssid.bytes)); @@ -6010,15 +5606,11 @@ static int drv_cmd_max_tx_power(hdd_adapter_t *adapter, smeStatus = sme_set_max_tx_power(hdd_ctx->hHal, bssid, selfMac, txPower); if (QDF_STATUS_SUCCESS != status) { - hddLog(QDF_TRACE_LEVEL_ERROR, - "%s:Set max tx power failed", - __func__); + hdd_err("Set max tx power failed"); ret = -EINVAL; goto exit; } - hddLog(QDF_TRACE_LEVEL_INFO, - "%s: Set max tx power success", - __func__); + hdd_info("Set max tx power success"); qdf_status = hdd_get_next_adapter(hdd_ctx, pAdapterNode, &pNext); pAdapterNode = pNext; @@ -6048,10 +5640,8 @@ static int drv_cmd_set_dfs_scan_mode(hdd_adapter_t *adapter, * If the input value is greater than max value of datatype, * then also kstrtou8 fails */ - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: kstrtou8 failed range [%d - %d]", - __func__, CFG_ROAMING_DFS_CHANNEL_MIN, + hdd_err("kstrtou8 failed range [%d - %d]", + CFG_ROAMING_DFS_CHANNEL_MIN, CFG_ROAMING_DFS_CHANNEL_MAX); ret = -EINVAL; goto exit; @@ -6059,9 +5649,7 @@ static int drv_cmd_set_dfs_scan_mode(hdd_adapter_t *adapter, if ((dfsScanMode < CFG_ROAMING_DFS_CHANNEL_MIN) || (dfsScanMode > CFG_ROAMING_DFS_CHANNEL_MAX)) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "dfsScanMode value %d is out of range (Min: %d Max: %d)", + hdd_err("dfsScanMode value %d is out of range (Min: %d Max: %d)", dfsScanMode, CFG_ROAMING_DFS_CHANNEL_MIN, CFG_ROAMING_DFS_CHANNEL_MAX); @@ -6069,9 +5657,8 @@ static int drv_cmd_set_dfs_scan_mode(hdd_adapter_t *adapter, goto exit; } - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, - "%s: Received Command to Set DFS Scan Mode = %d", - __func__, dfsScanMode); + hdd_info("Received Command to Set DFS Scan Mode = %d", + dfsScanMode); /* When DFS scanning is disabled, the DFS channels need to be * removed from the operation of device. @@ -6080,8 +5667,7 @@ static int drv_cmd_set_dfs_scan_mode(hdd_adapter_t *adapter, (dfsScanMode == CFG_ROAMING_DFS_CHANNEL_DISABLED)); if (ret < 0) { /* Some conditions prevented it from disabling DFS channels */ - hddLog(LOGE, - FL("disable/enable DFS channel request was denied")); + hdd_err("disable/enable DFS channel request was denied"); goto exit; } @@ -6107,10 +5693,7 @@ static int drv_cmd_get_dfs_scan_mode(hdd_adapter_t *adapter, len = scnprintf(extra, sizeof(extra), "%s %d", command, dfsScanMode); len = QDF_MIN(priv_data->total_len, len + 1); if (copy_to_user(priv_data->buf, &extra, len)) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: failed to copy data to user buffer", - __func__); + hdd_err("failed to copy data to user buffer"); ret = -EFAULT; } @@ -6131,10 +5714,7 @@ static int drv_cmd_get_link_status(hdd_adapter_t *adapter, len = scnprintf(extra, sizeof(extra), "%s %d", command, value); len = QDF_MIN(priv_data->total_len, len + 1); if (copy_to_user(priv_data->buf, &extra, len)) { - QDF_TRACE(QDF_MODULE_ID_HDD, - QDF_TRACE_LEVEL_ERROR, - "%s: failed to copy data to user buffer", - __func__); + hdd_err("failed to copy data to user buffer"); ret = -EFAULT; } @@ -6232,7 +5812,7 @@ static int drv_cmd_tdls_secondary_channel_offset(hdd_adapter_t *adapter, if (ret != 1) return -EINVAL; - hddLog(LOG1, FL("Tdls offchannel offset:%d"), set_value); + hdd_info("Tdls offchannel offset:%d", set_value); ret = hdd_set_tdls_secoffchanneloffset(hdd_ctx, set_value); @@ -6268,7 +5848,7 @@ static int drv_cmd_tdls_off_channel_mode(hdd_adapter_t *adapter, if (ret != 1) return -EINVAL; - hddLog(LOG1, FL("Tdls offchannel mode:%d"), set_value); + hdd_info("Tdls offchannel mode:%d", set_value); ret = hdd_set_tdls_offchannelmode(adapter, set_value); @@ -6310,7 +5890,7 @@ static int drv_cmd_tdls_off_channel(hdd_adapter_t *adapter, return -EINVAL; } - hddLog(LOG1, FL("Tdls offchannel num: %d"), set_value); + hdd_info("Tdls offchannel num: %d", set_value); ret = hdd_set_tdls_offchannel(hdd_ctx, set_value); @@ -6346,7 +5926,7 @@ static int drv_cmd_tdls_scan(hdd_adapter_t *adapter, if (ret != 1) return -EINVAL; - hddLog(LOG1, FL("Tdls scan type val: %d"), set_value); + hdd_info("Tdls scan type val: %d", set_value); ret = hdd_set_tdls_scan_type(hdd_ctx, set_value); @@ -6372,7 +5952,7 @@ static int drv_cmd_get_rssi(hdd_adapter_t *adapter, len = QDF_MIN(priv_data->total_len, len + 1); if (copy_to_user(priv_data->buf, &extra, len)) { - hddLog(LOGE, FL("Failed to copy data to user buffer")); + hdd_err("Failed to copy data to user buffer"); ret = -EFAULT; } @@ -6397,7 +5977,7 @@ static int drv_cmd_get_linkspeed(hdd_adapter_t *adapter, len = scnprintf(extra, sizeof(extra), "%s %d", command, link_speed); len = QDF_MIN(priv_data->total_len, len + 1); if (copy_to_user(priv_data->buf, &extra, len)) { - hddLog(LOGE, FL("Failed to copy data to user buffer")); + hdd_err("Failed to copy data to user buffer"); ret = -EFAULT; } @@ -6895,13 +6475,13 @@ static int hdd_parse_setantennamode_command(const uint8_t *value) /* no argument after the command */ if (NULL == in_ptr) { - hddLog(LOGE, FL("No argument after the command")); + hdd_err("No argument after the command"); return -EINVAL; } /* no space after the command */ if (SPACE_ASCII_VALUE != *in_ptr) { - hddLog(LOGE, FL("No space after the command")); + hdd_err("No space after the command"); return -EINVAL; } @@ -6911,20 +6491,20 @@ static int hdd_parse_setantennamode_command(const uint8_t *value) /* no argument followed by spaces */ if ('\0' == *in_ptr) { - hddLog(LOGE, FL("No argument followed by spaces")); + hdd_err("No argument followed by spaces"); return -EINVAL; } /* get the argument i.e. antenna mode */ v = sscanf(in_ptr, "%31s ", arg1); if (1 != v) { - hddLog(LOGE, FL("argument retrieval from cmd string failed")); + hdd_err("argument retrieval from cmd string failed"); return -EINVAL; } v = kstrtos32(arg1, 10, &tmp); if (v < 0) { - hddLog(LOGE, FL("argument string to int conversion failed")); + hdd_err("argument string to int conversion failed"); return -EINVAL; } @@ -7465,8 +7045,7 @@ static int hdd_drv_cmd_process(hdd_adapter_t *adapter, int len = 0; if (!adapter || !cmd || !priv_data) { - hddLog(QDF_TRACE_LEVEL_ERROR, - "%s: at least 1 param is NULL", __func__); + hdd_err("at least 1 param is NULL"); return -EINVAL; } @@ -7479,8 +7058,7 @@ static int hdd_drv_cmd_process(hdd_adapter_t *adapter, len = strlen(cmd_i); if (!handler) { - hddLog(QDF_TRACE_LEVEL_ERROR, - "%s: no. %d handler is NULL", __func__, i); + hdd_err("no. %d handler is NULL", i); return -EINVAL; } @@ -7511,7 +7089,7 @@ static int hdd_driver_command(hdd_adapter_t *adapter, ENTER(); if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { - hddLog(LOGE, FL("Command not allowed in FTM mode")); + hdd_err("Command not allowed in FTM mode"); return -EINVAL; } @@ -7522,9 +7100,8 @@ static int hdd_driver_command(hdd_adapter_t *adapter, /* copy to local struct to avoid numerous changes to legacy code */ if (priv_data->total_len <= 0 || priv_data->total_len > WLAN_PRIV_DATA_MAX_LEN) { - hddLog(QDF_TRACE_LEVEL_WARN, - "%s:invalid priv_data.total_len(%d)!!!", __func__, - priv_data->total_len); + hdd_warn("Invalid priv_data.total_len(%d)!!!", + priv_data->total_len); ret = -EINVAL; goto exit; } @@ -7532,8 +7109,7 @@ static int hdd_driver_command(hdd_adapter_t *adapter, /* Allocate +1 for '\0' */ command = kmalloc(priv_data->total_len + 1, GFP_KERNEL); if (!command) { - hddLog(QDF_TRACE_LEVEL_ERROR, - "%s: failed to allocate memory", __func__); + hdd_err("failed to allocate memory"); ret = -ENOMEM; goto exit; } @@ -7635,15 +7211,13 @@ static int __hdd_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) ENTER_DEV(dev); if (dev != adapter->dev) { - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_FATAL, - "%s: HDD adapter/dev inconsistency", __func__); + hdd_alert("HDD adapter/dev inconsistency"); ret = -ENODEV; goto exit; } if ((!ifr) || (!ifr->ifr_data)) { - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, - "%s: invalid data", __func__); + hdd_err("invalid data"); ret = -EINVAL; goto exit; } @@ -7669,8 +7243,7 @@ static int __hdd_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) ret = hdd_driver_ioctl(adapter, ifr); break; default: - hddLog(QDF_TRACE_LEVEL_ERROR, "%s: unknown ioctl %d", - __func__, cmd); + hdd_err("unknown ioctl %d", cmd); ret = -EINVAL; break; } diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index eb70039025e4..4525c5cfa501 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -2060,6 +2060,7 @@ static hdd_adapter_t *hdd_alloc_station_adapter(hdd_context_t *hdd_ctx, SET_NETDEV_DEV(pWlanDev, hdd_ctx->parent_dev); hdd_wmm_init(adapter); spin_lock_init(&adapter->pause_map_lock); + adapter->start_time = adapter->last_time = qdf_system_ticks(); } return adapter; @@ -4212,6 +4213,7 @@ void hdd_wlan_exit(hdd_context_t *hdd_ctx) free_hdd_ctx: + wlan_hdd_deinit_tx_rx_histogram(hdd_ctx); wiphy_unregister(wiphy); hdd_context_destroy(hdd_ctx); @@ -4754,6 +4756,38 @@ static void hdd_bus_bw_compute_cbk(void *priv) #endif /** + * wlan_hdd_init_tx_rx_histogram() - init tx/rx histogram stats + * @hdd_ctx: hdd context + * + * Return: 0 for success or error code + */ +int wlan_hdd_init_tx_rx_histogram(hdd_context_t *hdd_ctx) +{ + hdd_ctx->hdd_txrx_hist = qdf_mem_malloc( + (sizeof(struct hdd_tx_rx_histogram) * NUM_TX_RX_HISTOGRAM)); + if (hdd_ctx->hdd_txrx_hist == NULL) { + hdd_err("%s: Failed malloc for hdd_txrx_hist", __func__); + return -ENOMEM; + } + return 0; +} + +/** + * wlan_hdd_deinit_tx_rx_histogram() - deinit tx/rx histogram stats + * @hdd_ctx: hdd context + * + * Return: none + */ +void wlan_hdd_deinit_tx_rx_histogram(hdd_context_t *hdd_ctx) +{ + if (hdd_ctx->hdd_txrx_hist) { + qdf_mem_free(hdd_ctx->hdd_txrx_hist); + hdd_ctx->hdd_txrx_hist = NULL; + } +} + + +/** * wlan_hdd_display_tx_rx_histogram() - display tx rx histogram * @hdd_ctx: hdd context * @@ -4803,7 +4837,8 @@ void wlan_hdd_display_tx_rx_histogram(hdd_context_t *hdd_ctx) void wlan_hdd_clear_tx_rx_histogram(hdd_context_t *hdd_ctx) { hdd_ctx->hdd_txrx_hist_idx = 0; - qdf_mem_zero(hdd_ctx->hdd_txrx_hist, sizeof(hdd_ctx->hdd_txrx_hist)); + qdf_mem_zero(hdd_ctx->hdd_txrx_hist, + (sizeof(struct hdd_tx_rx_histogram) * NUM_TX_RX_HISTOGRAM)); } /** @@ -4819,24 +4854,40 @@ void wlan_hdd_display_netif_queue_history(hdd_context_t *hdd_ctx) hdd_adapter_list_node_t *adapter_node = NULL, *next = NULL; QDF_STATUS status; int i; + qdf_time_t total, pause, unpause, curr_time; status = hdd_get_front_adapter(hdd_ctx, &adapter_node); while (NULL != adapter_node && QDF_STATUS_SUCCESS == status) { adapter = adapter_node->pAdapter; hddLog(QDF_TRACE_LEVEL_ERROR, - "Session_id %d device mode %d current index %d", - adapter->sessionId, adapter->device_mode, - adapter->history_index); + "Session_id %d device mode %d", + adapter->sessionId, adapter->device_mode); hddLog(QDF_TRACE_LEVEL_ERROR, "Netif queue operation statistics:"); hddLog(QDF_TRACE_LEVEL_ERROR, "Current pause_map value %x", adapter->pause_map); + curr_time = qdf_system_ticks(); + total = curr_time - adapter->start_time; + if (adapter->pause_map) { + pause = adapter->total_pause_time + + curr_time - adapter->last_time; + unpause = adapter->total_unpause_time; + } else { + unpause = adapter->total_unpause_time + + curr_time - adapter->last_time; + pause = adapter->total_pause_time; + } hddLog(QDF_TRACE_LEVEL_ERROR, - " reason_type: pause_cnt: unpause_cnt"); + "Total: %ums Pause: %ums Unpause: %ums", + qdf_system_ticks_to_msecs(total), + qdf_system_ticks_to_msecs(pause), + qdf_system_ticks_to_msecs(unpause)); + hddLog(QDF_TRACE_LEVEL_ERROR, + "reason_type: pause_cnt: unpause_cnt"); - for (i = 0; i < WLAN_REASON_TYPE_MAX; i++) { + for (i = 1; i < WLAN_REASON_TYPE_MAX; i++) { hddLog(QDF_TRACE_LEVEL_ERROR, "%s: %d: %d", hdd_reason_type_to_string(i), @@ -4845,7 +4896,8 @@ void wlan_hdd_display_netif_queue_history(hdd_context_t *hdd_ctx) } hddLog(QDF_TRACE_LEVEL_ERROR, - "Netif queue operation history:"); + "Netif queue operation history: current index %d", + adapter->history_index); hddLog(QDF_TRACE_LEVEL_ERROR, "index: time: action_type: reason_type: pause_map"); @@ -4888,7 +4940,10 @@ void wlan_hdd_clear_netif_queue_history(hdd_context_t *hdd_ctx) sizeof(adapter->queue_oper_stats)); qdf_mem_zero(adapter->queue_oper_history, sizeof(adapter->queue_oper_history)); - + adapter->history_index = 0; + adapter->start_time = adapter->last_time = qdf_system_ticks(); + adapter->total_pause_time = 0; + adapter->total_unpause_time = 0; status = hdd_get_next_adapter(hdd_ctx, adapter_node, &next); adapter_node = next; } @@ -5622,9 +5677,14 @@ hdd_context_t *hdd_context_create(struct device *dev, void *hif_sc) cds_set_multicast_logging(hdd_ctx->config->multicast_host_fw_msgs); + status = wlan_hdd_init_tx_rx_histogram(hdd_ctx); + if (status) + goto err_free_config; + ret = hdd_logging_sock_activate_svc(hdd_ctx); if (ret) - goto err_free_config; + goto err_free_histogram; + /* * Update QDF trace levels based upon the code. The multicast @@ -5639,6 +5699,9 @@ skip_multicast_logging: return hdd_ctx; +err_free_histogram: + wlan_hdd_deinit_tx_rx_histogram(hdd_ctx); + err_free_config: qdf_mem_free(hdd_ctx->config); @@ -6652,9 +6715,8 @@ void wlan_hdd_send_svc_nlink_msg(int type, void *data, int len) switch (type) { case WLAN_SVC_FW_CRASHED_IND: case WLAN_SVC_LTE_COEX_IND: -#ifdef FEATURE_WLAN_AUTO_SHUTDOWN case WLAN_SVC_WLAN_AUTO_SHUTDOWN_IND: -#endif + case WLAN_SVC_WLAN_AUTO_SHUTDOWN_CANCEL_IND: ani_hdr->length = 0; nlh->nlmsg_len = NLMSG_LENGTH((sizeof(tAniMsgHdr))); skb_put(skb, NLMSG_SPACE(sizeof(tAniMsgHdr))); @@ -6803,6 +6865,8 @@ void wlan_hdd_auto_shutdown_enable(hdd_context_t *hdd_ctx, bool enable) hddLog(LOGE, FL("Failed to stop wlan auto shutdown timer")); } + wlan_hdd_send_svc_nlink_msg( + WLAN_SVC_WLAN_AUTO_SHUTDOWN_CANCEL_IND, NULL, 0); return; } diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c index 7346aa087605..762d3262315f 100644 --- a/core/hdd/src/wlan_hdd_power.c +++ b/core/hdd/src/wlan_hdd_power.c @@ -1684,7 +1684,7 @@ err_cds_close: /* Free up dynamically allocated members inside HDD Adapter */ kfree(pHddCtx->config); pHddCtx->config = NULL; - + wlan_hdd_deinit_tx_rx_histogram(pHddCtx); wiphy_unregister(pHddCtx->wiphy); wiphy_free(pHddCtx->wiphy); diff --git a/core/hdd/src/wlan_hdd_scan.c b/core/hdd/src/wlan_hdd_scan.c index b2c367d03288..97abe664c558 100644 --- a/core/hdd/src/wlan_hdd_scan.c +++ b/core/hdd/src/wlan_hdd_scan.c @@ -2243,17 +2243,6 @@ static int __wlan_hdd_cfg80211_sched_scan_start(struct wiphy *wiphy, hddLog(LOG1, FL("Number of hidden networks being Configured = %d"), request->n_ssids); - hddLog(LOG1, FL("request->ie_len = %zu"), request->ie_len); - if ((0 < request->ie_len) && (NULL != request->ie)) { - pPnoRequest->us24GProbeTemplateLen = request->ie_len; - memcpy(&pPnoRequest->p24GProbeTemplate, request->ie, - pPnoRequest->us24GProbeTemplateLen); - - pPnoRequest->us5GProbeTemplateLen = request->ie_len; - memcpy(&pPnoRequest->p5GProbeTemplate, request->ie, - pPnoRequest->us5GProbeTemplateLen); - } - /* * Before Kernel 4.4 * Driver gets only one time interval which is hard coded in diff --git a/core/hdd/src/wlan_hdd_tsf.c b/core/hdd/src/wlan_hdd_tsf.c index 2563a94bddbd..e98759ae22f1 100644 --- a/core/hdd/src/wlan_hdd_tsf.c +++ b/core/hdd/src/wlan_hdd_tsf.c @@ -32,6 +32,8 @@ #include "wlan_hdd_main.h" #include "wma_api.h" +static struct completion tsf_sync_get_completion_evt; +#define WLAN_TSF_SYNC_GET_TIMEOUT 2000 /** * hdd_capture_tsf() - capture tsf * @adapter: pointer to adapter @@ -48,7 +50,7 @@ int hdd_capture_tsf(struct hdd_adapter_s *adapter, uint32_t *buf, int len) hdd_station_ctx_t *hdd_sta_ctx; if (adapter == NULL || buf == NULL) { - hdd_err(FL("invalid pointer")); + hdd_err("invalid pointer"); return -EINVAL; } if (len != 1) @@ -57,14 +59,14 @@ int hdd_capture_tsf(struct hdd_adapter_s *adapter, uint32_t *buf, int len) /* Reset TSF value for new capture */ adapter->tsf_high = 0; adapter->tsf_low = 0; + adapter->tsf_sync_soc_timer = 0; if (adapter->device_mode == QDF_STA_MODE || adapter->device_mode == QDF_P2P_CLIENT_MODE) { hdd_sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); if (hdd_sta_ctx->conn_info.connState != - eConnectionState_Associated) { - - hdd_err(FL("failed to cap tsf, not connect with ap")); + eConnectionState_Associated) { + hdd_err("failed to cap tsf, not connect with ap"); buf[0] = TSF_STA_NOT_CONNECTED_NO_TSF; return ret; } @@ -72,24 +74,25 @@ int hdd_capture_tsf(struct hdd_adapter_s *adapter, uint32_t *buf, int len) if ((adapter->device_mode == QDF_SAP_MODE || adapter->device_mode == QDF_P2P_GO_MODE) && !(test_bit(SOFTAP_BSS_STARTED, &adapter->event_flags))) { - hdd_err(FL("Soft AP / P2p GO not beaconing")); + hdd_err("Soft AP / P2p GO not beaconing"); buf[0] = TSF_SAP_NOT_STARTED_NO_TSF; return ret; } if (adapter->tsf_state == TSF_CAP_STATE) { - hdd_err(FL("current in capture state, pls reset")); - buf[0] = TSF_CURRENT_IN_CAP_STATE; + hdd_err("current in capture state, pls reset"); + buf[0] = TSF_CURRENT_IN_CAP_STATE; } else { - hdd_info(FL("Send TSF capture to FW")); + hdd_info("Send TSF capture to FW"); buf[0] = TSF_RETURN; adapter->tsf_state = TSF_CAP_STATE; + init_completion(&tsf_sync_get_completion_evt); ret = wma_cli_set_command((int)adapter->sessionId, (int)GEN_PARAM_CAPTURE_TSF, adapter->sessionId, GEN_CMD); if (ret != QDF_STATUS_SUCCESS) { - hdd_err(FL("capture fail")); + hdd_err("capture fail"); buf[0] = TSF_CAPTURE_FAIL; adapter->tsf_state = TSF_IDLE; } @@ -98,6 +101,39 @@ int hdd_capture_tsf(struct hdd_adapter_s *adapter, uint32_t *buf, int len) } /** + * hdd_tsf_reset_gpio() - Reset TSF GPIO used for host timer sync + * @adapter: pointer to adapter + * + * This function send WMI command to reset GPIO configured in FW after + * TSF get operation. + * + * Return: TSF_RETURN on Success, TSF_RESET_GPIO_FAIL on failure + */ +#ifdef QCA_WIFI_3_0 +int hdd_tsf_reset_gpio(struct hdd_adapter_s *adapter) +{ + /* No GPIO Host timer sync for integrated WIFI Device */ + return TSF_RETURN; +} +#else +int hdd_tsf_reset_gpio(struct hdd_adapter_s *adapter) +{ + int ret; + ret = wma_cli_set_command((int)adapter->sessionId, + (int)GEN_PARAM_RESET_TSF_GPIO, adapter->sessionId, + GEN_CMD); + + if (ret != 0) { + hdd_err("tsf reset GPIO fail "); + ret = TSF_RESET_GPIO_FAIL; + } else { + ret = TSF_RETURN; + } + return ret; +} +#endif + +/** * hdd_indicate_tsf() - return tsf to uplayer * @adapter: pointer to adapter * @buf: pointer to uplayer buf @@ -109,11 +145,10 @@ int hdd_capture_tsf(struct hdd_adapter_s *adapter, uint32_t *buf, int len) */ int hdd_indicate_tsf(struct hdd_adapter_s *adapter, uint32_t *buf, int len) { - int ret = 0; hdd_station_ctx_t *hdd_sta_ctx; if (adapter == NULL || buf == NULL) { - hdd_err(FL("invalid pointer")); + hdd_err("invalid pointer"); return -EINVAL; } @@ -126,42 +161,32 @@ int hdd_indicate_tsf(struct hdd_adapter_s *adapter, uint32_t *buf, int len) adapter->device_mode == QDF_P2P_CLIENT_MODE) { hdd_sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); if (hdd_sta_ctx->conn_info.connState != - eConnectionState_Associated) { - - hdd_info(FL("fail to get tsf, sta in disconnected")); + eConnectionState_Associated) { + hdd_info("fail to get tsf, sta in disconnected"); buf[0] = TSF_STA_NOT_CONNECTED_NO_TSF; - return ret; + return 0; } } if ((adapter->device_mode == QDF_SAP_MODE || - adapter->device_mode == QDF_P2P_GO_MODE) && - !(test_bit(SOFTAP_BSS_STARTED, &adapter->event_flags))) { - hdd_err(FL("Soft AP / P2p GO not beaconing")); + adapter->device_mode == QDF_P2P_GO_MODE) && + !(test_bit(SOFTAP_BSS_STARTED, + &adapter->event_flags))) { + hdd_err("Soft AP / P2p GO not beaconing"); buf[0] = TSF_SAP_NOT_STARTED_NO_TSF; - return ret; + return 0; } if (adapter->tsf_high == 0 && adapter->tsf_low == 0) { - hdd_info(FL("TSF value not received")); + hdd_info("TSF value not received"); buf[0] = TSF_NOT_RETURNED_BY_FW; } else { - buf[0] = TSF_RETURN; + buf[0] = hdd_tsf_reset_gpio(adapter); buf[1] = adapter->tsf_low; buf[2] = adapter->tsf_high; adapter->tsf_state = TSF_IDLE; - - ret = wma_cli_set_command((int)adapter->sessionId, - (int)GEN_PARAM_RESET_TSF_GPIO, - adapter->sessionId, - GEN_CMD); - - if (0 != ret) { - hdd_err(FL("tsf get fail ")); - buf[0] = TSF_RESET_GPIO_FAIL; - } - hdd_info(FL("get tsf cmd,status=%u, tsf_low=%u, tsf_high=%u"), + hdd_info("get tsf cmd,status=%u, tsf_low=%u, tsf_high=%u", buf[0], buf[1], buf[2]); } - return ret; + return 0; } /** @@ -183,36 +208,184 @@ static int hdd_get_tsf_cb(void *pcb_cxt, struct stsf *ptsf) int status; if (pcb_cxt == NULL || ptsf == NULL) { - hdd_err(FL("HDD context is not valid")); + hdd_err("HDD context is not valid"); return -EINVAL; } hddctx = (struct hdd_context_s *)pcb_cxt; status = wlan_hdd_validate_context(hddctx); if (0 != status) { - hdd_err(FL("hdd context is not valid")); return -EINVAL; } adapter = hdd_get_adapter_by_vdev(hddctx, ptsf->vdev_id); if (NULL == adapter) { - hdd_err(FL("failed to find adapter")); + hdd_err("failed to find adapter"); return -EINVAL; } - - hdd_info(FL("tsf cb handle event, device_mode is %d"), + hdd_info("tsf cb handle event, device_mode is %d", adapter->device_mode); adapter->tsf_low = ptsf->tsf_low; adapter->tsf_high = ptsf->tsf_high; + adapter->tsf_sync_soc_timer = ((uint64_t) ptsf->soc_timer_high << 32 | + ptsf->soc_timer_low); - hdd_info(FL("hdd_get_tsf_cb sta=%u, tsf_low=%u, tsf_high=%u"), - ptsf->vdev_id, ptsf->tsf_low, ptsf->tsf_high); + complete(&tsf_sync_get_completion_evt); + hdd_info("Vdev=%u, tsf_low=%u, tsf_high=%u soc_timer=%llu", + ptsf->vdev_id, ptsf->tsf_low, ptsf->tsf_high, + adapter->tsf_sync_soc_timer); return 0; } /** + * __wlan_hdd_cfg80211_handle_tsf_cmd(): Setup TSF operations + * @wiphy: Pointer to wireless phy + * @wdev: Pointer to wireless device + * @data: Pointer to data + * @data_len: Data length + * + * Handle TSF SET / GET operation from userspace + * + * Return: 0 on success, negative errno on failure + */ +static int __wlan_hdd_cfg80211_handle_tsf_cmd(struct wiphy *wiphy, + struct wireless_dev *wdev, + const void *data, + int data_len) +{ + struct net_device *dev = wdev->netdev; + hdd_adapter_t *adapter = WLAN_HDD_GET_PRIV_PTR(dev); + hdd_context_t *hdd_ctx = wiphy_priv(wiphy); + struct nlattr *tb_vendor[QCA_WLAN_VENDOR_ATTR_TSF_MAX + 1]; + int status, ret; + struct sk_buff *reply_skb; + uint32_t tsf_op_resp[3], tsf_cmd; + + ENTER_DEV(wdev->netdev); + + status = wlan_hdd_validate_context(hdd_ctx); + if (0 != status) + return -EINVAL; + + if (nla_parse(tb_vendor, QCA_WLAN_VENDOR_ATTR_TSF_MAX, data, + data_len, NULL)) { + hdd_err("Invalid TSF cmd"); + return -EINVAL; + } + + if (!tb_vendor[QCA_WLAN_VENDOR_ATTR_TSF_CMD]) { + hdd_err("Invalid TSF cmd"); + return -EINVAL; + } + tsf_cmd = nla_get_u32(tb_vendor[QCA_WLAN_VENDOR_ATTR_TSF_CMD]); + + if (tsf_cmd == QCA_TSF_CAPTURE || tsf_cmd == QCA_TSF_SYNC_GET) { + hdd_capture_tsf(adapter, tsf_op_resp, 1); + switch (tsf_op_resp[0]) { + case TSF_RETURN: + status = 0; + break; + case TSF_CURRENT_IN_CAP_STATE: + status = -EALREADY; + break; + case TSF_STA_NOT_CONNECTED_NO_TSF: + case TSF_SAP_NOT_STARTED_NO_TSF: + status = -EPERM; + break; + default: + case TSF_CAPTURE_FAIL: + status = -EINVAL; + break; + } + } + if (status < 0) + goto end; + + if (tsf_cmd == QCA_TSF_SYNC_GET) { + ret = wait_for_completion_timeout(&tsf_sync_get_completion_evt, + msecs_to_jiffies(WLAN_TSF_SYNC_GET_TIMEOUT)); + if (ret == 0) { + status = -ETIMEDOUT; + goto end; + } + } + + if (tsf_cmd == QCA_TSF_GET || tsf_cmd == QCA_TSF_SYNC_GET) { + hdd_indicate_tsf(adapter, tsf_op_resp, 3); + switch (tsf_op_resp[0]) { + case TSF_RETURN: + status = 0; + break; + case TSF_NOT_RETURNED_BY_FW: + status = -EINPROGRESS; + break; + case TSF_STA_NOT_CONNECTED_NO_TSF: + case TSF_SAP_NOT_STARTED_NO_TSF: + status = -EPERM; + break; + default: + status = -EINVAL; + break; + } + if (status != 0) + goto end; + + reply_skb = cfg80211_vendor_event_alloc(hdd_ctx->wiphy, NULL, + sizeof(uint64_t) * 2 + NLMSG_HDRLEN, + QCA_NL80211_VENDOR_SUBCMD_TSF_INDEX, + GFP_KERNEL); + if (!reply_skb) { + hdd_err("cfg80211_vendor_cmd_alloc_reply_skb failed"); + status = -ENOMEM; + goto end; + } + if (nla_put_u64(reply_skb, QCA_WLAN_VENDOR_ATTR_TSF_TIMER_VALUE, + ((uint64_t) adapter->tsf_high << 32 | + adapter->tsf_low)) || + nla_put_u64(reply_skb, + QCA_WLAN_VENDOR_ATTR_TSF_SOC_TIMER_VALUE, + adapter->tsf_sync_soc_timer)){ + hdd_err("nla put fail"); + kfree_skb(reply_skb); + status = -EINVAL; + goto end; + } + status = cfg80211_vendor_cmd_reply(reply_skb); + } + +end: + hdd_info("TSF operation %d Status: %d", tsf_cmd, status); + return status; +} + +/** + * wlan_hdd_cfg80211_handle_tsf_cmd(): Setup TSF operations + * @wiphy: Pointer to wireless phy + * @wdev: Pointer to wireless device + * @data: Pointer to data + * @data_len: Data length + * + * Handle TSF SET / GET operation from userspace + * + * Return: 0 on success, negative errno on failure + */ +int wlan_hdd_cfg80211_handle_tsf_cmd(struct wiphy *wiphy, + struct wireless_dev *wdev, + const void *data, + int data_len) +{ + int ret; + + cds_ssr_protect(__func__); + ret = __wlan_hdd_cfg80211_handle_tsf_cmd(wiphy, wdev, data, data_len); + cds_ssr_unprotect(__func__); + + return ret; +} + +/** * wlan_hdd_tsf_init() - set callback to handle tsf value. * @hdd_ctx: pointer to the struct hdd_context_s * diff --git a/core/hdd/src/wlan_hdd_tx_rx.c b/core/hdd/src/wlan_hdd_tx_rx.c index 2e390476d5ef..ab40b1f65a1e 100644 --- a/core/hdd/src/wlan_hdd_tx_rx.c +++ b/core/hdd/src/wlan_hdd_tx_rx.c @@ -983,7 +983,7 @@ const char *hdd_reason_type_to_string(enum netif_reason_type reason) CASE_RETURN_STRING(WLAN_PEER_UNAUTHORISED); CASE_RETURN_STRING(WLAN_THERMAL_MITIGATION); default: - return "Unknown"; + return "Invalid"; } } @@ -1010,7 +1010,7 @@ const char *hdd_action_type_to_string(enum netif_action_type action) CASE_RETURN_STRING(WLAN_NETIF_CARRIER_ON); CASE_RETURN_STRING(WLAN_NETIF_CARRIER_OFF); default: - return "Unknown"; + return "Invalid"; } } @@ -1064,6 +1064,34 @@ void wlan_hdd_update_txq_timestamp(struct net_device *dev) } /** + * wlan_hdd_update_unpause_time() - update unpause time + * @adapter: adapter handle + * + * Return: none + */ +static void wlan_hdd_update_unpause_time(hdd_adapter_t *adapter) +{ + qdf_time_t curr_time = qdf_system_ticks(); + + adapter->total_unpause_time += curr_time - adapter->last_time; + adapter->last_time = curr_time; +} + +/** + * wlan_hdd_update_pause_time() - update pause time + * @adapter: adapter handle + * + * Return: none + */ +static void wlan_hdd_update_pause_time(hdd_adapter_t *adapter) +{ + qdf_time_t curr_time = qdf_system_ticks(); + + adapter->total_pause_time += curr_time - adapter->last_time; + adapter->last_time = curr_time; +} + +/** * wlan_hdd_netif_queue_control() - Use for netif_queue related actions * @adapter: adapter handle * @action: action type @@ -1100,6 +1128,7 @@ void wlan_hdd_netif_queue_control(hdd_adapter_t *adapter, if (!adapter->pause_map) { netif_tx_stop_all_queues(adapter->dev); wlan_hdd_update_txq_timestamp(adapter->dev); + wlan_hdd_update_unpause_time(adapter); } adapter->pause_map |= (1 << reason); spin_unlock_bh(&adapter->pause_map_lock); @@ -1108,16 +1137,20 @@ void wlan_hdd_netif_queue_control(hdd_adapter_t *adapter, case WLAN_START_ALL_NETIF_QUEUE: spin_lock_bh(&adapter->pause_map_lock); adapter->pause_map &= ~(1 << reason); - if (!adapter->pause_map) + if (!adapter->pause_map) { netif_tx_start_all_queues(adapter->dev); + wlan_hdd_update_pause_time(adapter); + } spin_unlock_bh(&adapter->pause_map_lock); break; case WLAN_WAKE_ALL_NETIF_QUEUE: spin_lock_bh(&adapter->pause_map_lock); adapter->pause_map &= ~(1 << reason); - if (!adapter->pause_map) + if (!adapter->pause_map) { netif_tx_wake_all_queues(adapter->dev); + wlan_hdd_update_pause_time(adapter); + } spin_unlock_bh(&adapter->pause_map_lock); break; @@ -1126,6 +1159,7 @@ void wlan_hdd_netif_queue_control(hdd_adapter_t *adapter, if (!adapter->pause_map) { netif_tx_stop_all_queues(adapter->dev); wlan_hdd_update_txq_timestamp(adapter->dev); + wlan_hdd_update_unpause_time(adapter); } adapter->pause_map |= (1 << reason); netif_carrier_off(adapter->dev); @@ -1136,8 +1170,10 @@ void wlan_hdd_netif_queue_control(hdd_adapter_t *adapter, spin_lock_bh(&adapter->pause_map_lock); netif_carrier_on(adapter->dev); adapter->pause_map &= ~(1 << reason); - if (!adapter->pause_map) + if (!adapter->pause_map) { netif_tx_start_all_queues(adapter->dev); + wlan_hdd_update_pause_time(adapter); + } spin_unlock_bh(&adapter->pause_map_lock); break; @@ -1146,6 +1182,7 @@ void wlan_hdd_netif_queue_control(hdd_adapter_t *adapter, if (!adapter->pause_map) { netif_tx_disable(adapter->dev); wlan_hdd_update_txq_timestamp(adapter->dev); + wlan_hdd_update_unpause_time(adapter); } adapter->pause_map |= (1 << reason); spin_unlock_bh(&adapter->pause_map_lock); @@ -1156,6 +1193,7 @@ void wlan_hdd_netif_queue_control(hdd_adapter_t *adapter, if (!adapter->pause_map) { netif_tx_disable(adapter->dev); wlan_hdd_update_txq_timestamp(adapter->dev); + wlan_hdd_update_unpause_time(adapter); } adapter->pause_map |= (1 << reason); netif_carrier_off(adapter->dev); diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c index 28a9522582cc..69af49913683 100644 --- a/core/hdd/src/wlan_hdd_wext.c +++ b/core/hdd/src/wlan_hdd_wext.c @@ -276,6 +276,7 @@ static const hdd_freq_chan_map_t freq_chan_map[] = { #define WE_GET_GTX_BWMASK 54 #define WE_GET_TEMPERATURE 56 #define WE_CAP_TSF 58 +#define WE_GET_ROAM_SYNCH_DELAY 59 /* Private ioctls and their sub-ioctls */ #define WLAN_PRIV_SET_INT_GET_INT (SIOCIWFIRSTPRIV + 2) @@ -6804,6 +6805,15 @@ static int __iw_setnone_getint(struct net_device *dev, break; } + case WE_GET_ROAM_SYNCH_DELAY: + { + hddLog(LOG1, "GET ROAM SYNCH DELAY"); + *value = wma_cli_get_command(pAdapter->sessionId, + GEN_VDEV_ROAM_SYNCH_DELAY, + GEN_CMD); + break; + } + case WE_GET_BURST_ENABLE: { hddLog(LOG1, "GET Burst enable value"); @@ -11069,6 +11079,12 @@ static const struct iw_priv_args we_private_args[] = { IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, 0, "setMonChan"} , + + {WE_GET_ROAM_SYNCH_DELAY, + 0, + IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, + "hostroamdelay"} + , }; const struct iw_handler_def we_handler_def = { diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index b225c7fecf54..1b1fe87325d3 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "A" -#define QWLAN_VERSION_BUILD 7 +#define QWLAN_VERSION_EXTRA "" +#define QWLAN_VERSION_BUILD 9 -#define QWLAN_VERSIONSTR "5.1.0.7A" +#define QWLAN_VERSIONSTR "5.1.0.9" #endif /* QWLAN_VERSION_H */ diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index 7cb2188783c3..34e4ac7d364a 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -2771,10 +2771,6 @@ typedef struct sSirPNOScanReq { uint32_t passive_min_time; uint32_t passive_max_time; - uint16_t us24GProbeTemplateLen; - uint8_t p24GProbeTemplate[SIR_PNO_MAX_PB_REQ_SIZE]; - uint16_t us5GProbeTemplateLen; - uint8_t p5GProbeTemplate[SIR_PNO_MAX_PB_REQ_SIZE]; #ifdef FEATURE_WLAN_SCAN_PNO bool pno_channel_prediction; uint8_t top_k_num_of_channels; @@ -2920,20 +2916,6 @@ typedef struct sSirRoamOffloadScanReq { uint8_t ValidChannelCount; uint8_t ValidChannelList[SIR_ROAM_MAX_CHANNELS]; bool IsESEAssoc; - uint16_t us24GProbeTemplateLen; - uint8_t p24GProbeTemplate[SIR_ROAM_SCAN_MAX_PB_REQ_SIZE]; - uint16_t us5GProbeTemplateLen; - uint8_t p5GProbeTemplate[SIR_ROAM_SCAN_MAX_PB_REQ_SIZE]; - uint8_t ReservedBytes[SIR_ROAM_SCAN_RESERVED_BYTES]; - /*ReservedBytes is to add any further params in future - without changing the interface params on Host - and firmware.The firmware right now checks - if the size of this structure matches and then - proceeds with the processing of the command. - So, in future, if there is any need to add - more params, pick the memory from reserved - bytes and keep deducting the reserved bytes - by the amount of bytes picked. */ uint8_t nProbes; uint16_t HomeAwayTime; tSirRoamNetworkType ConnectedNetwork; @@ -4082,7 +4064,6 @@ typedef struct sSirSmeRoamOffloadSynchInd { void *add_bss_params; tpSirSmeJoinRsp join_rsp; uint16_t aid; - tpSirBssDescription bss_desc_ptr; } roam_offload_synch_ind; #ifdef WLAN_FEATURE_ROAM_OFFLOAD @@ -4481,6 +4462,15 @@ typedef struct { *tpSirExtScanResetBssidHotlistReqParams; /** + * struct sir_wisa_params - WISA Mode Parameters + * @mode: WISA mode + * @session_id: Session ID of vdev + */ +struct sir_wisa_params { + bool mode; + uint8_t vdev_id; +}; +/** * struct sir_ssid_hotlist_param - param for SSID Hotlist * @ssid: SSID which is being hotlisted * @band: Band in which the given SSID should be scanned @@ -5589,6 +5579,8 @@ struct sir_sme_ext_cng_chan_ind { * @vdev_id: vdev id * @tsf_low: low 32bits of tsf * @tsf_high: high 32bits of tsf + * @soc_timer_low: low 32bits of synced SOC timer value + * @soc_timer_high: high 32bits of synced SOC timer value * * driver use this struct to store the tsf info */ @@ -5596,6 +5588,8 @@ struct stsf { uint32_t vdev_id; uint32_t tsf_low; uint32_t tsf_high; + uint32_t soc_timer_low; + uint32_t soc_timer_high; }; /** diff --git a/core/mac/src/include/sir_params.h b/core/mac/src/include/sir_params.h index 9959dda2df43..acedd40e31f0 100644 --- a/core/mac/src/include/sir_params.h +++ b/core/mac/src/include/sir_params.h @@ -607,6 +607,7 @@ typedef struct sSirMbMsgP2p { #define SIR_HAL_BPF_GET_CAPABILITIES_REQ (SIR_HAL_ITC_MSG_TYPES_BEGIN + 341) #define SIR_HAL_BPF_SET_INSTRUCTIONS_REQ (SIR_HAL_ITC_MSG_TYPES_BEGIN + 342) +#define SIR_HAL_SET_WISA_PARAMS (SIR_HAL_ITC_MSG_TYPES_BEGIN + 343) #define SIR_HAL_MSG_TYPES_END (SIR_HAL_MSG_TYPES_BEGIN + 0x1FF) /* CFG message types */ diff --git a/core/mac/src/pe/lim/lim_send_management_frames.c b/core/mac/src/pe/lim/lim_send_management_frames.c index ef138b90b7d6..daa44fd0b6ee 100644 --- a/core/mac/src/pe/lim/lim_send_management_frames.c +++ b/core/mac/src/pe/lim/lim_send_management_frames.c @@ -1296,11 +1296,12 @@ lim_send_assoc_rsp_mgmt_frame(tpAniSirGlobal mac_ctx, bytes = sizeof(tSirMacMgmtHdr) + payload; if (assoc_req != NULL) { - addn_ie_len = (pe_session->addIeParams.assocRespDataLen != 0); + addn_ie_len = pe_session->addIeParams.assocRespDataLen; /* Nonzero length indicates Assoc rsp IE available */ - if (addn_ie_len <= WNI_CFG_ASSOC_RSP_ADDNIE_DATA_LEN - && (bytes + addn_ie_len) <= SIR_MAX_PACKET_SIZE) { + if (addn_ie_len > 0 && + addn_ie_len <= WNI_CFG_ASSOC_RSP_ADDNIE_DATA_LEN && + (bytes + addn_ie_len) <= SIR_MAX_PACKET_SIZE) { qdf_mem_copy(add_ie, pe_session->addIeParams.assocRespData_buff, pe_session->addIeParams.assocRespDataLen); diff --git a/core/mac/src/pe/lim/lim_utils.c b/core/mac/src/pe/lim/lim_utils.c index 3dbf1ff563e0..350bffc604d4 100644 --- a/core/mac/src/pe/lim/lim_utils.c +++ b/core/mac/src/pe/lim/lim_utils.c @@ -832,6 +832,14 @@ void lim_print_mac_addr(tpAniSirGlobal pMac, tSirMacAddr macAddr, uint8_t logLev void lim_reset_deferred_msg_q(tpAniSirGlobal pMac) { + tSirMsgQ *read_msg; + + if (pMac->lim.gLimDeferredMsgQ.size > 0) { + while ((read_msg = lim_read_deferred_msg_q(pMac)) != NULL) { + pe_free_msg(pMac, read_msg); + } + } + pMac->lim.gLimDeferredMsgQ.size = pMac->lim.gLimDeferredMsgQ.write = pMac->lim.gLimDeferredMsgQ.read = 0; diff --git a/core/mac/src/sys/legacy/src/utils/src/mac_trace.c b/core/mac/src/sys/legacy/src/utils/src/mac_trace.c index 99ee02af2fd1..b533658acd50 100644 --- a/core/mac/src/sys/legacy/src/utils/src/mac_trace.c +++ b/core/mac/src/sys/legacy/src/utils/src/mac_trace.c @@ -601,6 +601,7 @@ uint8_t *mac_trace_get_wma_msg_string(uint16_t wma_msg) #endif /* FEATURE_AP_MCC_CH_AVOIDANCE */ CASE_RETURN_STRING(WMA_SET_RSSI_MONITOR_REQ); CASE_RETURN_STRING(WMA_FW_MEM_DUMP_REQ); + CASE_RETURN_STRING(WMA_SET_WISA_PARAMS); default: return (uint8_t *) "UNKNOWN"; break; diff --git a/core/sme/inc/csr_neighbor_roam.h b/core/sme/inc/csr_neighbor_roam.h index b8b8e875a18f..b63d5a176a80 100644 --- a/core/sme/inc/csr_neighbor_roam.h +++ b/core/sme/inc/csr_neighbor_roam.h @@ -360,8 +360,6 @@ QDF_STATUS csr_roam_read_tsf(tpAniSirGlobal pMac, uint8_t *pTimestamp, const uint8_t sessionId); #endif /* FEATURE_WLAN_ESE */ #ifdef WLAN_FEATURE_ROAM_OFFLOAD -QDF_STATUS csr_neighbor_roam_offload_update_preauth_list(tpAniSirGlobal pMac, - roam_offload_synch_ind *roam_synch_ind_ptr, uint8_t sessionId); void csr_roam_synch_callback(tpAniSirGlobal mac, roam_offload_synch_ind *roam_synch_data, tpSirBssDescription bss_desc_ptr, enum sir_roam_op_code reason); @@ -395,8 +393,6 @@ static inline void csr_neighbor_roam_send_lfr_metric_event( {} #endif QDF_STATUS csr_roam_stop_wait_for_key_timer(tpAniSirGlobal pMac); -uint32_t csr_get_current_ap_rssi(tpAniSirGlobal pMac, - tScanResultHandle *pScanResultList, uint8_t sessionId); QDF_STATUS csr_roam_copy_connected_profile(tpAniSirGlobal pMac, uint32_t sessionId, tCsrRoamProfile *pDstProfile); diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h index 7b74226e7fde..f59be7b4fd77 100644 --- a/core/sme/inc/sme_api.h +++ b/core/sme/inc/sme_api.h @@ -891,7 +891,8 @@ QDF_STATUS sme_fw_mem_dump_register_cb(tHalHandle hHal, void (*callback_routine)(void *cb_context, struct fw_dump_rsp *rsp)); QDF_STATUS sme_fw_mem_dump_unregister_cb(tHalHandle hHal); - +QDF_STATUS sme_set_wisa_params(tHalHandle hal, + struct sir_wisa_params *wisa_params); #ifdef WLAN_FEATURE_ROAM_OFFLOAD QDF_STATUS sme_update_roam_offload_enabled(tHalHandle hHal, bool nRoamOffloadEnabled); diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index 03a9ee6bcad4..a0407e3ff3f3 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -13304,6 +13304,39 @@ QDF_STATUS sme_reset_bss_hotlist(tHalHandle hHal, return status; } +/** + * sme_send_wisa_params(): Pass WISA mode to WMA + * @hal: HAL context + * @wisa_params: pointer to WISA params struct + * @sessionId: SME session id + * + * Pass WISA params to WMA + * + * Return: QDF_STATUS + */ +QDF_STATUS sme_set_wisa_params(tHalHandle hal, + struct sir_wisa_params *wisa_params) +{ + QDF_STATUS status = QDF_STATUS_SUCCESS; + tpAniSirGlobal mac = PMAC_STRUCT(hal); + cds_msg_t cds_message; + struct sir_wisa_params *cds_msg_wisa_params; + + cds_msg_wisa_params = qdf_mem_malloc(sizeof(struct sir_wisa_params)); + if (!cds_msg_wisa_params) + return QDF_STATUS_E_NOMEM; + + *cds_msg_wisa_params = *wisa_params; + status = sme_acquire_global_lock(&mac->sme); + if (QDF_IS_STATUS_SUCCESS(status)) { + cds_message.bodyptr = cds_msg_wisa_params; + cds_message.type = WMA_SET_WISA_PARAMS; + status = cds_mq_post_message(CDS_MQ_ID_WMA, &cds_message); + sme_release_global_lock(&mac->sme); + } + return status; +} + /* --------------------------------------------------------------------------- \fn sme_set_significant_change \brief SME API to set significant change diff --git a/core/sme/src/common/sme_power_save.c b/core/sme/src/common/sme_power_save.c index 3e7546b7ff82..9495600ab1fb 100644 --- a/core/sme/src/common/sme_power_save.c +++ b/core/sme/src/common/sme_power_save.c @@ -689,121 +689,6 @@ QDF_STATUS sme_ps_start_uapsd(tHalHandle hal_ctx, uint32_t session_id, } #ifdef FEATURE_WLAN_SCAN_PNO -static tSirRetStatus -sme_populate_mac_header(tpAniSirGlobal mac_ctx, - uint8_t *bd, - uint8_t type, - uint8_t sub_type, - tSirMacAddr peer_addr, tSirMacAddr self_mac_addr) -{ - tSirRetStatus status_code = eSIR_SUCCESS; - tpSirMacMgmtHdr mac_hdr; - - /* / Prepare MAC management header */ - mac_hdr = (tpSirMacMgmtHdr) (bd); - - /* Prepare FC */ - mac_hdr->fc.protVer = SIR_MAC_PROTOCOL_VERSION; - mac_hdr->fc.type = type; - mac_hdr->fc.subType = sub_type; - - /* Prepare Address 1 */ - qdf_mem_copy((uint8_t *) mac_hdr->da, (uint8_t *) peer_addr, - sizeof(tSirMacAddr)); - - sir_copy_mac_addr(mac_hdr->sa, self_mac_addr); - - /* Prepare Address 3 */ - qdf_mem_copy((uint8_t *) mac_hdr->bssId, (uint8_t *) peer_addr, - sizeof(tSirMacAddr)); - return status_code; -} /*** sme_populate_mac_header() ***/ - -static tSirRetStatus -sme_prepare_probe_req_template(tpAniSirGlobal mac_ctx, - uint8_t channel_num, - uint32_t dot11mode, - tSirMacAddr self_mac_addr, - uint8_t *frame, - uint16_t *pus_len, tCsrRoamSession *psession) -{ - tDot11fProbeRequest pr; - uint32_t status, bytes, payload; - tSirRetStatus sir_status; - /*Bcast tx */ - tSirMacAddr bss_id = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; - /** - * The scheme here is to fill out a 'tDot11fProbeRequest' structure - * and then hand it off to 'dot11f_pack_probe_request' (for - * serialization). We start by zero-initializing the structure: - */ - qdf_mem_set((uint8_t *) &pr, sizeof(pr), 0); - - populate_dot11f_supp_rates(mac_ctx, channel_num, &pr.SuppRates, NULL); - - if (WNI_CFG_DOT11_MODE_11B != dot11mode) { - populate_dot11f_ext_supp_rates1(mac_ctx, channel_num, - &pr.ExtSuppRates); - } - - if (IS_DOT11_MODE_HT(dot11mode)) { - populate_dot11f_ht_caps(mac_ctx, NULL, &pr.HTCaps); - pr.HTCaps.advCodingCap = psession->htConfig.ht_rx_ldpc; - pr.HTCaps.txSTBC = psession->htConfig.ht_tx_stbc; - pr.HTCaps.rxSTBC = psession->htConfig.ht_rx_stbc; - if (!psession->htConfig.ht_sgi) - pr.HTCaps.shortGI20MHz = pr.HTCaps.shortGI40MHz = 0; - } - /** - * That's it-- now we pack it. First, how much space are we going to - * need? - */ - status = dot11f_get_packed_probe_request_size(mac_ctx, &pr, &payload); - if (DOT11F_FAILED(status)) { - QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, - FL("Failed to calculate the packed size for a Probe Request (0x%08x)."), - status); - - /* We'll fall back on the worst case scenario: */ - payload = sizeof(tDot11fProbeRequest); - } else if (DOT11F_WARNED(status)) { - QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, - FL("There were warnings while calculating the packed size for a Probe Request (0x%08x)."), - status); - } - - bytes = payload + sizeof(tSirMacMgmtHdr); - - /* Prepare outgoing frame */ - qdf_mem_set(frame, bytes, 0); - - /* Next, we fill out the buffer descriptor: */ - sir_status = sme_populate_mac_header(mac_ctx, frame, SIR_MAC_MGMT_FRAME, - SIR_MAC_MGMT_PROBE_REQ, bss_id, - self_mac_addr); - - if (eSIR_SUCCESS != sir_status) { - QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, - FL("Failed to populate the buffer descriptor for a Probe Request (%d)."), - sir_status); - return sir_status; /* allocated! */ - } - /* That done, pack the Probe Request: */ - status = dot11f_pack_probe_request(mac_ctx, &pr, frame + - sizeof(tSirMacMgmtHdr), - payload, &payload); - if (DOT11F_FAILED(status)) { - QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, - "Failed to pack a Probe Request (0x%08x).", status); - return eSIR_FAILURE; /* allocated! */ - } else if (DOT11F_WARNED(status)) { - QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, - "There were warnings while packing a Probe Request"); - } - - *pus_len = payload + sizeof(tSirMacMgmtHdr); - return eSIR_SUCCESS; -} /* End sme_prepare_probe_req_template. */ /** * sme_set_pno_channel_prediction() - Prepare PNO buffer * @request_buf: Buffer to be filled up to send to WMA @@ -893,70 +778,6 @@ QDF_STATUS sme_set_ps_preferred_network_list(tHalHandle hal_ctx, configParam. phyMode)); - /*Prepare a probe request for 2.4GHz band and one for 5GHz band */ - if (eSIR_SUCCESS == - sme_prepare_probe_req_template(mac_ctx, - SIR_PNO_24G_DEFAULT_CH, - uc_dot11_mode, session->selfMacAddr.bytes, - request_buf->p24GProbeTemplate, - &request_buf->us24GProbeTemplateLen, - session)) { - /* Append IE passed by supplicant(if any) - * to probe request - */ - if ((0 < request->us24GProbeTemplateLen) && - ((request_buf->us24GProbeTemplateLen + - request->us24GProbeTemplateLen) < - SIR_PNO_MAX_PB_REQ_SIZE)) { - qdf_mem_copy((uint8_t *) &request_buf-> - p24GProbeTemplate + - request_buf->us24GProbeTemplateLen, - (uint8_t *) &request->p24GProbeTemplate, - request->us24GProbeTemplateLen); - request_buf->us24GProbeTemplateLen += - request->us24GProbeTemplateLen; - QDF_TRACE(QDF_MODULE_ID_SME, - QDF_TRACE_LEVEL_INFO, - FL("request->us24GProbeTemplateLen = %d"), - request->us24GProbeTemplateLen); - } else { - QDF_TRACE(QDF_MODULE_ID_SME, - QDF_TRACE_LEVEL_INFO, - FL("Extra ie discarded on 2.4G, IE len = %d"), - request->us24GProbeTemplateLen); - } - } - - if (eSIR_SUCCESS == - sme_prepare_probe_req_template(mac_ctx, - SIR_PNO_5G_DEFAULT_CH, uc_dot11_mode, - session->selfMacAddr.bytes, - request_buf->p5GProbeTemplate, - &request_buf->us5GProbeTemplateLen, - session)) { - /* Append IE passed by supplicant(if any) - * to probe request - */ - if ((0 < request->us5GProbeTemplateLen) && - ((request_buf->us5GProbeTemplateLen + - request->us5GProbeTemplateLen) < - SIR_PNO_MAX_PB_REQ_SIZE)) { - qdf_mem_copy((uint8_t *) &request_buf-> - p5GProbeTemplate + - request_buf->us5GProbeTemplateLen, - (uint8_t *) &request->p5GProbeTemplate, - request->us5GProbeTemplateLen); - request_buf->us5GProbeTemplateLen += - request->us5GProbeTemplateLen; - QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_INFO, - FL("request_buf->us5GProbeTemplateLen = %d"), - request->us5GProbeTemplateLen); - } else { - QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_INFO, - FL("Extra IE discarded on 5G, IE length = %d"), - request->us5GProbeTemplateLen); - } - } if (mac_ctx->pnoOffload) { if (request_buf->enable) diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 0326f313a30c..aafc83dc0c0d 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -16227,122 +16227,6 @@ csr_update_roam_scan_offload_request(tpAniSirGlobal mac_ctx, #endif /* WLAN_FEATURE_ROAM_OFFLOAD */ #if defined(WLAN_FEATURE_HOST_ROAM) || defined(WLAN_FEATURE_ROAM_OFFLOAD) -static tSirRetStatus -csr_roam_scan_offload_populate_mac_header(tpAniSirGlobal pMac, - uint8_t *pBD, - uint8_t type, - uint8_t subType, - tSirMacAddr peerAddr, - tSirMacAddr selfMacAddr) -{ - tSirRetStatus statusCode = eSIR_SUCCESS; - tpSirMacMgmtHdr pMacHdr; - - /* Prepare MAC management header */ - pMacHdr = (tpSirMacMgmtHdr) (pBD); - - /* Prepare FC */ - pMacHdr->fc.protVer = SIR_MAC_PROTOCOL_VERSION; - pMacHdr->fc.type = type; - pMacHdr->fc.subType = subType; - - /* Prepare Address 1 */ - qdf_mem_copy((uint8_t *) pMacHdr->da, (uint8_t *) peerAddr, - sizeof(tSirMacAddr)); - - sir_copy_mac_addr(pMacHdr->sa, selfMacAddr); - - /* Prepare Address 3 */ - qdf_mem_copy((uint8_t *) pMacHdr->bssId, (uint8_t *) peerAddr, - sizeof(tSirMacAddr)); - return statusCode; -} /*** csr_roam_scan_offload_populate_mac_header() ***/ - -static tSirRetStatus -csr_roam_scan_offload_prepare_probe_req_template(tpAniSirGlobal pMac, - uint8_t nChannelNum, - uint32_t dot11mode, - tSirMacAddr selfMacAddr, - uint8_t *pFrame, - uint16_t *pusLen, - tCsrRoamSession *psession) -{ - tDot11fProbeRequest pr; - uint32_t nStatus, nBytes, nPayload; - tSirRetStatus nSirStatus; - /*Bcast tx */ - tSirMacAddr bssId = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; - /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ - - qdf_mem_set((uint8_t *) &pr, sizeof(pr), 0); - - populate_dot11f_supp_rates(pMac, nChannelNum, &pr.SuppRates, NULL); - - if (WNI_CFG_DOT11_MODE_11B != dot11mode) { - populate_dot11f_ext_supp_rates1(pMac, nChannelNum, - &pr.ExtSuppRates); - } - - if (IS_DOT11_MODE_HT(dot11mode)) { - populate_dot11f_ht_caps(pMac, NULL, &pr.HTCaps); - pr.HTCaps.advCodingCap = psession->htConfig.ht_rx_ldpc; - pr.HTCaps.txSTBC = psession->htConfig.ht_tx_stbc; - pr.HTCaps.rxSTBC = psession->htConfig.ht_rx_stbc; - if (!psession->htConfig.ht_sgi) { - pr.HTCaps.shortGI20MHz = pr.HTCaps.shortGI40MHz = 0; - } - } - - nStatus = dot11f_get_packed_probe_request_size(pMac, &pr, &nPayload); - if (DOT11F_FAILED(nStatus)) { - QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, - "Failed to calculate the packed size f" - "or a Probe Request (0x%08x).\n", nStatus); - - nPayload = sizeof(tDot11fProbeRequest); - } else if (DOT11F_WARNED(nStatus)) { - QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, - "There were warnings while calculating" - "the packed size for a Probe Request (" - "0x%08x).\n", nStatus); - } - - nBytes = nPayload + sizeof(tSirMacMgmtHdr); - - /* Prepare outgoing frame */ - qdf_mem_set(pFrame, nBytes, 0); - - nSirStatus = - csr_roam_scan_offload_populate_mac_header(pMac, pFrame, - SIR_MAC_MGMT_FRAME, - SIR_MAC_MGMT_PROBE_REQ, bssId, - selfMacAddr); - - if (eSIR_SUCCESS != nSirStatus) { - QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, - "Failed to populate the buffer descriptor for a Probe Request (%d).\n", - nSirStatus); - return nSirStatus; - } - - nStatus = dot11f_pack_probe_request(pMac, &pr, pFrame + - sizeof(tSirMacMgmtHdr), - nPayload, &nPayload); - if (DOT11F_FAILED(nStatus)) { - QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, - "Failed to pack a Probe Request (0x%08x).\n", - nStatus); - return eSIR_FAILURE; - } else if (DOT11F_WARNED(nStatus)) { - QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, - "There were warnings while packing a Probe Request (0x%08x).\n", - nStatus); - } - - *pusLen = nPayload + sizeof(tSirMacMgmtHdr); - return eSIR_SUCCESS; -} - /** * csr_check_band_channel_match() - check if passed band and channel match * paramters @@ -16722,16 +16606,6 @@ csr_create_roam_scan_offload_request(tpAniSirGlobal mac_ctx, dot11_mode = (uint8_t) csr_translate_to_wni_cfg_dot11_mode(mac_ctx, csr_find_best_phy_mode(mac_ctx, mac_ctx->roam.configParam.phyMode)); - csr_roam_scan_offload_prepare_probe_req_template(mac_ctx, - SIR_ROAM_SCAN_24G_DEFAULT_CH, dot11_mode, - session->selfMacAddr.bytes, req_buf->p24GProbeTemplate, - &req_buf->us24GProbeTemplateLen, session); - - csr_roam_scan_offload_prepare_probe_req_template(mac_ctx, - SIR_ROAM_SCAN_5G_DEFAULT_CH, dot11_mode, - session->selfMacAddr.bytes, - req_buf->p5GProbeTemplate, &req_buf->us5GProbeTemplateLen, - session); req_buf->allowDFSChannelRoam = mac_ctx->roam.configParam.allowDFSChannelRoam; req_buf->early_stop_scan_enable = diff --git a/core/sme/src/csr/csr_host_scan_roam.c b/core/sme/src/csr/csr_host_scan_roam.c index fb29ee10db7f..4e8db71aecc4 100644 --- a/core/sme/src/csr/csr_host_scan_roam.c +++ b/core/sme/src/csr/csr_host_scan_roam.c @@ -151,7 +151,6 @@ csr_neighbor_roam_process_scan_results(tpAniSirGlobal mac_ctx, tpCsrNeighborRoamControlInfo n_roam_info = &mac_ctx->roam.neighborRoamInfo[sessionid]; tpCsrNeighborRoamBSSInfo bss_info; - uint32_t cur_ap_rssi; uint32_t age_ticks = 0; uint32_t limit_ticks = qdf_system_msecs_to_ticks(ROAM_AP_AGE_LIMIT_MS); @@ -168,15 +167,6 @@ csr_neighbor_roam_process_scan_results(tpAniSirGlobal mac_ctx, bool voadmitted; #endif /* - * Find out the Current AP RSSI and keep it handy to check if - * it is better than the RSSI of the AP which we are - * going to roam.If so, we are going to continue with the - * current AP. - */ - cur_ap_rssi = csr_get_current_ap_rssi(mac_ctx, scan_results_list, - sessionid); - - /* * Expecting the scan result already to be in the sorted order based on * RSSI. Based on the previous state we need to check whether the list * should be sorted again taking neighbor score into consideration. If diff --git a/core/sme/src/csr/csr_neighbor_roam.c b/core/sme/src/csr/csr_neighbor_roam.c index e285f5394a84..672dfd33e62b 100644 --- a/core/sme/src/csr/csr_neighbor_roam.c +++ b/core/sme/src/csr/csr_neighbor_roam.c @@ -566,68 +566,6 @@ void csr_neighbor_roam_reset_init_state_control_info(tpAniSirGlobal pMac, csr_neighbor_roam_reset_report_scan_state_control_info(pMac, sessionId); } -#ifdef WLAN_FEATURE_ROAM_OFFLOAD -/** - * csr_neighbor_roam_offload_update_preauth_list() - * - * @mac_ctx: Pointer to Global MAC structure - * @session_id: Session ID - * @roam_sync_ind_ptr: Roam offload sync Ind Info - * - * This function handles the RoamOffloadSynch and adds the - * roamed AP to the preauth done list - * - * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_FAILURE otherwise - */ -QDF_STATUS -csr_neighbor_roam_offload_update_preauth_list(tpAniSirGlobal pMac, - roam_offload_synch_ind *roam_sync_ind_ptr, uint8_t session_id) -{ - tpCsrNeighborRoamControlInfo neighbor_roam_info_ptr = - &pMac->roam.neighborRoamInfo[session_id]; - tpCsrNeighborRoamBSSInfo bss_info_ptr; - uint16_t bss_desc_len; - - if (neighbor_roam_info_ptr->neighborRoamState != - eCSR_NEIGHBOR_ROAM_STATE_CONNECTED) { - NEIGHBOR_ROAM_DEBUG(pMac, LOGW, - FL("LFR3:Roam Offload Synch Ind received in state %d"), - neighbor_roam_info_ptr->neighborRoamState); - return QDF_STATUS_E_FAILURE; - } - - bss_info_ptr = qdf_mem_malloc(sizeof(tCsrNeighborRoamBSSInfo)); - if (NULL == bss_info_ptr) { - sms_log(pMac, LOGE, - FL("LFR3:Memory allocation for Neighbor Roam BSS Info failed")); - return QDF_STATUS_E_NOMEM; - } - bss_desc_len = roam_sync_ind_ptr->bss_desc_ptr->length + - sizeof(roam_sync_ind_ptr->bss_desc_ptr->length); - bss_info_ptr->pBssDescription = qdf_mem_malloc(bss_desc_len); - if (bss_info_ptr->pBssDescription != NULL) { - qdf_mem_copy(bss_info_ptr->pBssDescription, - roam_sync_ind_ptr->bss_desc_ptr, - bss_desc_len); - } else { - sms_log(pMac, LOGE, - FL("LFR3:Mem alloc for Neighbor Roam BSS Descriptor failed")); - qdf_mem_free(bss_info_ptr); - return QDF_STATUS_E_NOMEM; - - } - csr_ll_insert_tail(&neighbor_roam_info_ptr->FTRoamInfo.preAuthDoneList, - &bss_info_ptr->List, LL_ACCESS_LOCK); - - csr_neighbor_roam_state_transition(pMac, - eCSR_NEIGHBOR_ROAM_STATE_PREAUTH_DONE, session_id); - neighbor_roam_info_ptr->FTRoamInfo.numPreAuthRetries = 0; - QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG, - "LFR3:Entry added to Auth Done List"); - - return QDF_STATUS_SUCCESS; -} -#endif /** * csr_neighbor_roam_prepare_scan_profile_filter() * @@ -790,42 +728,6 @@ csr_neighbor_roam_prepare_scan_profile_filter(tpAniSirGlobal pMac, return QDF_STATUS_SUCCESS; } -uint32_t csr_get_current_ap_rssi(tpAniSirGlobal pMac, - tScanResultHandle *pScanResultList, - uint8_t sessionId) -{ - tCsrScanResultInfo *pScanResult; - tpCsrNeighborRoamControlInfo nbr_roam_info = - &pMac->roam.neighborRoamInfo[sessionId]; - /* We are setting this as default value to make sure we return this value, - when we do not see this AP in the scan result for some reason.However,it is - less likely that we are associated to an AP and do not see it in the scan list */ - uint32_t CurrAPRssi = -125; - - while (NULL != - (pScanResult = csr_scan_result_get_next(pMac, *pScanResultList))) { - if (true != - qdf_mem_cmp(pScanResult->BssDescriptor.bssId, - nbr_roam_info->currAPbssid.bytes, - sizeof(tSirMacAddr))) { - /* We got a match with the currently associated AP. - * Capture the RSSI value and complete the while loop. - * The while loop is completed in order to make the current entry go back to NULL, - * and in the next while loop, it properly starts searching from the head of the list. - * TODO: Can also try setting the current entry directly to NULL as soon as we find the new AP*/ - - CurrAPRssi = - (int)pScanResult->BssDescriptor.rssi * (-1); - - } else { - continue; - } - } - - return CurrAPRssi; - -} - /** * csr_neighbor_roam_channels_filter_by_current_band() * @@ -1112,63 +1014,6 @@ bool csr_neighbor_roam_connected_profile_match(tpAniSirGlobal pMac, } /** - * csr_neighbor_roam_prepare_non_occupied_channel_list() - prepare non-occup CL - * @pMac: The handle returned by mac_open - * @pInputChannelList: The default channels list - * @numOfChannels: The number of channels in the default channels list - * @pOutputChannelList: The place to put the non-occupied channel list - * @pOutputNumOfChannels: Number of channels in the non-occupied channel list - * - * This function is used to prepare a channel list that is derived from - * the list of valid channels and does not include those in the occupied list - * - * Return QDF_STATUS - */ -QDF_STATUS -csr_neighbor_roam_prepare_non_occupied_channel_list(tpAniSirGlobal pMac, - uint8_t sessionId, uint8_t *pInputChannelList, - uint8_t numOfChannels, uint8_t *pOutputChannelList, - uint8_t *pOutputNumOfChannels) -{ - uint8_t i = 0; - uint8_t outputNumOfChannels = 0; - uint8_t numOccupiedChannels = - pMac->scan.occupiedChannels[sessionId].numChannels; - uint8_t *pOccupiedChannelList = - pMac->scan.occupiedChannels[sessionId].channelList; - - for (i = 0; i < numOfChannels; i++) { - if (csr_is_channel_present_in_list - (pOccupiedChannelList, numOccupiedChannels, - pInputChannelList[i])) - continue; - /* - * DFS channel will be added in the list only when the - * DFS Roaming scan flag is enabled - */ - if (CDS_IS_DFS_CH(pInputChannelList[i])) { - if (CSR_ROAMING_DFS_CHANNEL_DISABLED != - pMac->roam.configParam.allowDFSChannelRoam) { - pOutputChannelList[outputNumOfChannels++] = - pInputChannelList[i]; - } - } else { - pOutputChannelList[outputNumOfChannels++] = - pInputChannelList[i]; - } - } - - sms_log(pMac, LOG2, - FL("Number of channels in the valid channel list=%d; " - "Number of channels in the non-occupied list list=%d"), - numOfChannels, outputNumOfChannels); - - /* Return the number of channels */ - *pOutputNumOfChannels = outputNumOfChannels; - return QDF_STATUS_SUCCESS; -} - -/** * csr_roam_reset_roam_params - API to reset the roaming parameters * @mac_ctx: Pointer to the global MAC structure * diff --git a/core/utils/fwlog/dbglog_host.c b/core/utils/fwlog/dbglog_host.c index b233dc8f5d4a..6601b007b7fa 100644 --- a/core/utils/fwlog/dbglog_host.c +++ b/core/utils/fwlog/dbglog_host.c @@ -4354,14 +4354,14 @@ int dbglog_init(wmi_unified_t wmi_handle) res = wmi_unified_register_event_handler(wmi_handle, WMI_DIAG_DATA_CONTAINER_EVENTID, fw_diag_data_event_handler, - WMA_RX_SERIALIZER_CTX); + WMA_RX_WORK_CTX); if (res != 0) return res; /* Register handler for new FW diag Event, LOG, MSG combined */ res = wmi_unified_register_event_handler(wmi_handle, WMI_DIAG_EVENTID, diag_fw_handler, - WMA_RX_SERIALIZER_CTX); + WMA_RX_WORK_CTX); if (res != 0) return res; diff --git a/core/utils/nlink/inc/wlan_nlink_common.h b/core/utils/nlink/inc/wlan_nlink_common.h index 399de6e2ccd5..1120016d7a97 100644 --- a/core/utils/nlink/inc/wlan_nlink_common.h +++ b/core/utils/nlink/inc/wlan_nlink_common.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015 The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -80,6 +80,7 @@ #define WLAN_SVC_DFS_ALL_CHANNEL_UNAVAIL_IND 0x108 #define WLAN_SVC_WLAN_TP_IND 0x109 #define WLAN_SVC_WLAN_TP_TX_IND 0x10B +#define WLAN_SVC_WLAN_AUTO_SHUTDOWN_CANCEL_IND 0x10C #define WLAN_SVC_MAX_SSID_LEN 32 #define WLAN_SVC_MAX_BSSID_LEN 6 #define WLAN_SVC_MAX_STR_LEN 16 diff --git a/core/wma/inc/wma.h b/core/wma/inc/wma.h index 3f1ac3b5fac4..9feb2e06451d 100644 --- a/core/wma/inc/wma.h +++ b/core/wma/inc/wma.h @@ -912,6 +912,7 @@ struct wma_txrx_node { uint32_t chain_mask; uint32_t mac_id; bool roaming_in_progress; + int32_t roam_synch_delay; }; #if defined(QCA_WIFI_FTM) diff --git a/core/wma/inc/wma_api.h b/core/wma/inc/wma_api.h index 039202571f2a..0b72c211c025 100644 --- a/core/wma/inc/wma_api.h +++ b/core/wma/inc/wma_api.h @@ -67,6 +67,7 @@ typedef enum { GEN_PARAM_MODULATED_DTIM, GEN_PARAM_CAPTURE_TSF, GEN_PARAM_RESET_TSF_GPIO, + GEN_VDEV_ROAM_SYNCH_DELAY, } GEN_PARAM; #define VDEV_CMD 1 diff --git a/core/wma/inc/wma_internal.h b/core/wma/inc/wma_internal.h index 2f47901d9143..7cdcd9c1c7a9 100644 --- a/core/wma/inc/wma_internal.h +++ b/core/wma/inc/wma_internal.h @@ -1101,11 +1101,9 @@ static inline QDF_STATUS wma_set_tsf_gpio_pin(WMA_HANDLE handle, uint32_t pin) return QDF_STATUS_E_INVAL; } #endif - - +QDF_STATUS wma_set_wisa_params(tp_wma_handle wma, struct sir_wisa_params *wisa); #ifdef WLAN_FEATURE_NAN - QDF_STATUS wma_nan_req(void *wma_ptr, tpNanRequest nan_req); #endif diff --git a/core/wma/inc/wma_types.h b/core/wma/inc/wma_types.h index 252d271220f0..521d50b87e44 100644 --- a/core/wma/inc/wma_types.h +++ b/core/wma/inc/wma_types.h @@ -399,6 +399,7 @@ #define WMA_IPA_OFFLOAD_ENABLE_DISABLE SIR_HAL_IPA_OFFLOAD_ENABLE_DISABLE #define WMA_GET_TEMPERATURE_REQ SIR_HAL_GET_TEMPERATURE_REQ +#define WMA_SET_WISA_PARAMS SIR_HAL_SET_WISA_PARAMS #ifdef FEATURE_WLAN_EXTSCAN #define WMA_EXTSCAN_GET_CAPABILITIES_REQ SIR_HAL_EXTSCAN_GET_CAPABILITIES_REQ diff --git a/core/wma/src/wma_features.c b/core/wma/src/wma_features.c index 00c2df030d6f..c0c98d53e3d2 100644 --- a/core/wma/src/wma_features.c +++ b/core/wma/src/wma_features.c @@ -299,6 +299,8 @@ int wma_vdev_tsf_handler(void *handle, uint8_t *data, uint32_t data_len) ptsf->vdev_id = tsf_event->vdev_id; ptsf->tsf_low = tsf_event->tsf_low; ptsf->tsf_high = tsf_event->tsf_high; + ptsf->soc_timer_low = tsf_event->qtimer_low; + ptsf->soc_timer_high = tsf_event->qtimer_high; WMA_LOGD("%s: receive WMI_VDEV_TSF_REPORT_EVENTID ", __func__); WMA_LOGD("%s: vdev_id = %u,tsf_low =%u, tsf_high = %u", __func__, @@ -318,6 +320,11 @@ int wma_vdev_tsf_handler(void *handle, uint8_t *data, uint32_t data_len) return 0; } +#ifdef QCA_WIFI_3_0 +#define TSF_FW_ACTION_CMD TSF_TSTAMP_QTIMER_CAPTURE_REQ +#else +#define TSF_FW_ACTION_CMD TSF_TSTAMP_CAPTURE_REQ +#endif /** * wma_capture_tsf() - send wmi to fw to capture tsf * @wma_handle: wma handler @@ -342,10 +349,9 @@ QDF_STATUS wma_capture_tsf(tp_wma_handle wma_handle, uint32_t vdev_id) cmd = (wmi_vdev_tsf_tstamp_action_cmd_fixed_param *) wmi_buf_data(buf); cmd->vdev_id = vdev_id; - cmd->tsf_action = TSF_TSTAMP_CAPTURE_REQ; - - WMA_LOGD("%s :vdev_id %u, TSF_TSTAMP_CAPTURE_REQ", __func__, - cmd->vdev_id); + cmd->tsf_action = TSF_FW_ACTION_CMD; + WMA_LOGD("%s :vdev_id %u, tsf_cmd: %d", __func__, cmd->vdev_id, + cmd->tsf_action); WMITLV_SET_HDR(&cmd->tlv_header, WMITLV_TAG_STRUC_wmi_vdev_tsf_tstamp_action_cmd_fixed_param, @@ -453,6 +459,51 @@ QDF_STATUS wma_set_tsf_gpio_pin(WMA_HANDLE handle, uint32_t pin) } #endif +/** + * wma_set_wisa_params(): Set WISA features related params in FW + * @wma_handle: WMA handle + * @wisa: Pointer to WISA param struct + * + * Return: CDF status + */ +QDF_STATUS wma_set_wisa_params(tp_wma_handle wma_handle, + struct sir_wisa_params *wisa) +{ + QDF_STATUS status = QDF_STATUS_SUCCESS; + wmi_buf_t buf; + wmi_vdev_wisa_cmd_fixed_param *cmd; + int ret, len = sizeof(*cmd); + + buf = wmi_buf_alloc(wma_handle->wmi_handle, len); + if (!buf) { + WMA_LOGP("%s: failed to allocate memory for WISA params", + __func__); + return QDF_STATUS_E_NOMEM; + } + + cmd = (wmi_vdev_wisa_cmd_fixed_param *) wmi_buf_data(buf); + cmd->wisa_mode = wisa->mode; + cmd->vdev_id = wisa->vdev_id; + + WMITLV_SET_HDR(&cmd->tlv_header, + WMITLV_TAG_STRUC_wmi_vdev_wisa_cmd_fixed_param, + WMITLV_GET_STRUCT_TLVLEN( + wmi_vdev_wisa_cmd_fixed_param)); + + ret = wmi_unified_cmd_send(wma_handle->wmi_handle, buf, len, + WMI_VDEV_WISA_CMDID); + if (ret != EOK) { + WMA_LOGE("wmi_unified_cmd_send returned Error %d", status); + status = QDF_STATUS_E_FAILURE; + goto error; + } + return QDF_STATUS_SUCCESS; + +error: + wmi_buf_free(buf); + return status; +} + #ifdef FEATURE_WLAN_LPHB /** * wma_lphb_conf_hbenable() - enable command of LPHB configuration requests diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index 347c745c95d8..603c7f5c26f3 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -387,6 +387,9 @@ int wma_cli_get_command(int vdev_id, int param_id, int vpdev) case GEN_VDEV_PARAM_AMSDU: ret = intr[vdev_id].config.amsdu; break; + case GEN_VDEV_ROAM_SYNCH_DELAY: + ret = intr[vdev_id].roam_synch_delay; + break; default: WMA_LOGE("Invalid generic vdev command/Not" " yet implemented 0x%x", param_id); @@ -5269,6 +5272,11 @@ QDF_STATUS wma_mc_process_msg(void *cds_context, cds_msg_t *msg) (struct sir_ocb_get_tsf_timer *)msg->bodyptr); qdf_mem_free(msg->bodyptr); break; + case WMA_SET_WISA_PARAMS: + wma_set_wisa_params(wma_handle, + (struct sir_wisa_params *)msg->bodyptr); + qdf_mem_free(msg->bodyptr); + break; case WMA_DCC_GET_STATS_CMD: wma_dcc_get_stats(wma_handle, (struct sir_dcc_get_stats *)msg->bodyptr); diff --git a/core/wma/src/wma_scan_roam.c b/core/wma/src/wma_scan_roam.c index 841b04e8acb8..39bc2196bb3d 100644 --- a/core/wma/src/wma_scan_roam.c +++ b/core/wma/src/wma_scan_roam.c @@ -2031,6 +2031,7 @@ int wma_roam_synch_event_handler(void *handle, uint8_t *event, tpSirBssDescription bss_desc_ptr = NULL; uint16_t ie_len = 0; int status = -EINVAL; + qdf_time_t roam_synch_received = qdf_get_system_timestamp(); WMA_LOGD("LFR3:%s", __func__); if (!event) { @@ -2095,6 +2096,10 @@ int wma_roam_synch_event_handler(void *handle, uint8_t *event, wma->csr_roam_synch_cb((tpAniSirGlobal)wma->mac_context, roam_synch_ind_ptr, bss_desc_ptr, SIR_ROAM_SYNCH_PROPAGATION); wma_process_roam_synch_complete(wma, synch_event->vdev_id); + wma->interfaces[synch_event->vdev_id].roam_synch_delay = + qdf_get_system_timestamp() - roam_synch_received; + WMA_LOGD("LFR3: roam_synch_delay:%d", + wma->interfaces[synch_event->vdev_id].roam_synch_delay); cleanup_label: if (roam_synch_ind_ptr->join_rsp) qdf_mem_free(roam_synch_ind_ptr->join_rsp); @@ -2744,12 +2749,6 @@ QDF_STATUS wma_pno_start(tp_wma_handle wma, tpSirPNOScanReq pno) params->active_max_time = pno->active_max_time; params->passive_min_time = pno->passive_min_time; params->passive_max_time = pno->passive_max_time; - params->us24GProbeTemplateLen = pno->us24GProbeTemplateLen; - qdf_mem_copy(params->p24GProbeTemplate, pno->p24GProbeTemplate, - WMI_PNO_MAX_PB_REQ_SIZE); - params->us5GProbeTemplateLen = pno->us5GProbeTemplateLen; - qdf_mem_copy(params->p5GProbeTemplate, pno->p5GProbeTemplate, - WMI_PNO_MAX_PB_REQ_SIZE); #ifdef FEATURE_WLAN_SCAN_PNO params->pno_channel_prediction = pno->pno_channel_prediction; params->top_k_num_of_channels = pno->top_k_num_of_channels; diff --git a/target/inc/dbglog_id.h b/target/inc/dbglog_id.h index 03bd4b6a8795..917452931c58 100644 --- a/target/inc/dbglog_id.h +++ b/target/inc/dbglog_id.h @@ -1487,8 +1487,59 @@ extern "C" { #define NAN_DBGID_NAN_NOT_ALLOWED (NAN_DBGID_OTA_PKT_LAST + 14) #define NAN_DBGID_NAN_TX_FOLLOWUP_REQ_TR_ID (NAN_DBGID_OTA_PKT_LAST + 15) #define NAN_DBGID_NAN_TX_FOLLOWUP_RESP_TR_ID (NAN_DBGID_OTA_PKT_LAST + 16) - -#define NAN_DBGID_END (NAN_DBGID_NAN_TX_FOLLOWUP_RESP_TR_ID + 1) +#define NAN_DBGID_PUBSUB_TERM_IND_DISABLE_FLAG (NAN_DBGID_OTA_PKT_LAST + 17) +#define NAN_DBGID_UNMATCH_IND_DISABLE_FLAG (NAN_DBGID_OTA_PKT_LAST + 18) +#define NAN_DBGID_FOLLOWUP_RX_IND_DISABLE_FLAG (NAN_DBGID_OTA_PKT_LAST + 19) +#define NAN_DBGID_BEACON_RX_LAST (NAN_DBGID_OTA_PKT_LAST + 20) + +/* NaN Datapath Timekeeper debug IDs */ +/* 116 + 20 = 136 */ +#define NAN_DBGID_TMKR_BASE NAN_DBGID_BEACON_RX_LAST +/* 136 */ +#define NAN_DBGID_TMKR_INIT (NAN_DBGID_TMKR_BASE + 0) +#define NAN_DBGID_TMKR_OPEN (NAN_DBGID_TMKR_BASE + 1) +#define NAN_DBGID_TMKR_CLOSE (NAN_DBGID_TMKR_BASE + 2) +#define NAN_DBGID_TMKR_NEGOTIATE (NAN_DBGID_TMKR_BASE + 3) +#define NAN_DBGID_TMKR_TMR_HNDLR (NAN_DBGID_TMKR_BASE + 4) +#define NAN_DBGID_TMKR_UNITTEST (NAN_DBGID_TMKR_BASE + 5) +#define NAN_DBGID_TMKR_LF_TMR_HNDLR (NAN_DBGID_TMKR_BASE + 6) +#define NAN_DBGID_TMKR_DEINIT (NAN_DBGID_TMKR_BASE + 7) +#define NAN_DBGID_TMKR_SLOTBITMAP (NAN_DBGID_TMKR_BASE + 8) +#define NAN_DBGID_TMKR_CANCEL_SLOTBITMAP (NAN_DBGID_TMKR_BASE + 9) +#define NAN_DBGID_TMKR_CONFIRM_SLOTBITMAP (NAN_DBGID_TMKR_BASE + 10) +#define NAN_DBGID_TMKR_RESOLVE_SLOTBITMAP (NAN_DBGID_TMKR_BASE + 11) +#define NAN_DBGID_TMKR_ADD_CHAN_ELEMENT (NAN_DBGID_TMKR_BASE + 12) +#define NAN_DBGID_TMKR_REMOVE_CHAN_ELEMENT (NAN_DBGID_TMKR_BASE + 13) +/* 150 */ +#define NAN_DBGID_TMKR_FIND_CHAN_ELEMENT (NAN_DBGID_TMKR_BASE + 14) +#define NAN_DBGID_TMKR_QUERY_COMMITTED_SLOTBITMAP (NAN_DBGID_TMKR_BASE + 15) +#define NAN_DBGID_TMKR_ENCODE_SLOTBITMAP (NAN_DBGID_TMKR_BASE + 16) +#define NAN_DBGID_TMKR_SLOT_ARRAY_DBG (NAN_DBGID_TMKR_BASE + 17) +#define NAN_DBGID_TMKR_POPULATE_MASTER (NAN_DBGID_TMKR_BASE + 18) +#define NAN_DBGID_TMKR_ALLOCATE_SLOTS (NAN_DBGID_TMKR_BASE + 19) +#define NAN_DBGID_TMKR_RELEASE_SLOTS (NAN_DBGID_TMKR_BASE + 20) +#define NAN_DBGID_TMKR_ENABLE (NAN_DBGID_TMKR_BASE + 21) +#define NAN_DBGID_TMKR_DISABLE (NAN_DBGID_TMKR_BASE + 22) +#define NAN_DBGID_TMKR_GET_NEXT_SLOTWINDOW (NAN_DBGID_TMKR_BASE + 23) +#define NAN_DBGID_TMKR_RESUME_TIMEKEEPING (NAN_DBGID_TMKR_BASE + 24) +#define NAN_DBGID_TMKR_RESYNC_TO_DISCOVERY_WINDOW (NAN_DBGID_TMKR_BASE + 25) +/* 162 */ +#define NAN_DBGID_TMKR_SUSPEND_TIMEKEEPING (NAN_DBGID_TMKR_BASE + 26) +#define NAN_DBGID_TMKR_SYNC_TO_DISCOVERY_WINDOW (NAN_DBGID_TMKR_BASE + 27) +#define NAN_DBGID_TMKR_GET_NEXT_TSFTIME (NAN_DBGID_TMKR_BASE + 28) +#define NAN_DBGID_TMKR_SETUP_NEXT_INTERVAL (NAN_DBGID_TMKR_BASE + 29) +#define NAN_DBGID_TMKR_SCHEDULE_EVENT (NAN_DBGID_TMKR_BASE + 30) +#define NAN_DBGID_TMKR_ENABLE_TIMEKEEPING_EVENT (NAN_DBGID_TMKR_BASE + 31) +#define NAN_DBGID_TMKR_DISABLE_TIMEKEEPING_EVENT (NAN_DBGID_TMKR_BASE + 32) +#define NAN_DBGID_TMKR_SYNC_WITH_DW_EVENT (NAN_DBGID_TMKR_BASE + 33) +#define NAN_DBGID_TMKR_INTERVAL_EXPIRED_EVENT (NAN_DBGID_TMKR_BASE + 34) +#define NAN_DBGID_TMKR_PAUSE_TIMEKEEPING_EVENT (NAN_DBGID_TMKR_BASE + 35) +/* 172 */ +#define NAN_DBGID_TMKR_RESUME_TIMEKEEPING_EVENT (NAN_DBGID_TMKR_BASE + 36) +#define NAN_DBGID_TMKR_RESYNC_TO_DW_EVENT (NAN_DBGID_TMKR_BASE + 37) +#define NAN_DBGID_TMKR_LAST (NAN_DBGID_TMKR_BASE + 38) + +#define NAN_DBGID_END (NAN_DBGID_TMKR_LAST) /* IBSS PS module DBGIDs*/ #define IBSS_PS_DBGID_DEFINITION_START 0 diff --git a/target/inc/wlan_defs.h b/target/inc/wlan_defs.h index fda5eb0e9b81..d28b4c25d2c8 100644 --- a/target/inc/wlan_defs.h +++ b/target/inc/wlan_defs.h @@ -725,6 +725,7 @@ typedef struct wlan_dbg_txbf_snd_stats { A_UINT32 cbf_40[4]; A_UINT32 cbf_80[4]; A_UINT32 sounding[9]; + A_UINT32 cbf_160[4]; } wlan_dbg_txbf_snd_stats_t; typedef struct wlan_dbg_wifi2_error_stats { diff --git a/target/inc/wmi_services.h b/target/inc/wmi_services.h index df9bb8d053a1..281e232f0e31 100644 --- a/target/inc/wmi_services.h +++ b/target/inc/wmi_services.h @@ -165,7 +165,11 @@ typedef enum { /* periodic channel stats service */ WMI_SERVICE_PERIODIC_CHAN_STAT_SUPPORT, WMI_SERVICE_MESH_11S, /* 11s mesh service support */ - + /* + * FW+HW supports 10 MHz(half rate) and 5 MHz(quarter rate) channel + * bandwidth + */ + WMI_SERVICE_HALF_RATE_QUARTER_RATE_SUPPORT, WMI_MAX_SERVICE = 128 /* max service */ } WMI_SERVICE; diff --git a/target/inc/wmi_tlv_defs.h b/target/inc/wmi_tlv_defs.h index 9b5a559ce298..469a0132b945 100644 --- a/target/inc/wmi_tlv_defs.h +++ b/target/inc/wmi_tlv_defs.h @@ -693,6 +693,17 @@ typedef enum { WMITLV_TAG_STRUC_wmi_set_periodic_channel_stats_config_fixed_param, WMITLV_TAG_STRUC_wmi_vdev_set_custom_aggr_size_cmd_fixed_param, WMITLV_TAG_STRUC_wmi_pdev_wal_power_debug_cmd_fixed_param, + WMITLV_TAG_STRUC_WMI_MAC_PHY_CAPABILITIES, + WMITLV_TAG_STRUC_WMI_HW_MODE_CAPABILITIES, + WMITLV_TAG_STRUC_WMI_SOC_MAC_PHY_HW_MODE_CAPS, + WMITLV_TAG_STRUC_WMI_HAL_REG_CAPABILITIES_EXT, + WMITLV_TAG_STRUC_WMI_SOC_HAL_REG_CAPABILITIES, + WMITLV_TAG_STRUC_wmi_vdev_wisa_cmd_fixed_param, + WMITLV_TAG_STRUC_wmi_tx_power_level_stats_evt_fixed_param, + WMITLV_TAG_STRUC_wmi_scan_adaptive_dwell_parameters_tlv, + WMITLV_TAG_STRUC_wmi_scan_adaptive_dwell_config_fixed_param, + WMITLV_TAG_STRUC_wmi_wow_set_action_wake_up_cmd_fixed_param, + WMITLV_TAG_STRUC_wmi_ndp_end_rsp_per_ndi, } WMITLV_TAG_ID; /* @@ -974,7 +985,10 @@ typedef enum { OP(WMI_CHAN_AVOID_RPT_ALLOW_CMDID) \ OP(WMI_SET_PERIODIC_CHANNEL_STATS_CONFIG_CMDID) \ OP(WMI_VDEV_SET_CUSTOM_AGGR_SIZE_CMDID) \ - OP(WMI_PDEV_WAL_POWER_DEBUG_CMDID) + OP(WMI_PDEV_WAL_POWER_DEBUG_CMDID) \ + OP(WMI_VDEV_WISA_CMDID) \ + OP(WMI_SCAN_ADAPTIVE_DWELL_CONFIG_CMDID) \ + OP(WMI_WOW_SET_ACTION_WAKE_UP_CMDID) /* * IMPORTANT: Please add _ALL_ WMI Events Here. @@ -1122,7 +1136,8 @@ typedef enum { OP(WMI_NDP_END_INDICATION_EVENTID) \ OP(WMI_PDEV_SET_HW_MODE_RESP_EVENTID) \ OP(WMI_PDEV_HW_MODE_TRANSITION_EVENTID) \ - OP(WMI_PDEV_SET_MAC_CONFIG_RESP_EVENTID) + OP(WMI_PDEV_SET_MAC_CONFIG_RESP_EVENTID) \ + OP(WMI_RADIO_TX_POWER_LEVEL_STATS_EVENTID) /* TLV definitions of WMI commands */ @@ -1308,6 +1323,13 @@ WMITLV_CREATE_PARAM_STRUC(WMI_VDEV_PLMREQ_STOP_CMDID); WMITLV_CREATE_PARAM_STRUC(WMI_START_SCAN_CMDID); +/* Scan adaptive dwell mode configuration */ +#define WMITLV_TABLE_WMI_SCAN_ADAPTIVE_DWELL_CONFIG_CMDID(id, op, buf, len) \ + WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_scan_adaptive_dwell_config_fixed_param, wmi_scan_adaptive_dwell_config_fixed_param, fixed_param, WMITLV_SIZE_FIX) \ + WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_ARRAY_STRUC, wmi_scan_adaptive_dwell_parameters_tlv, param, WMITLV_SIZE_VAR) + +WMITLV_CREATE_PARAM_STRUC(WMI_SCAN_ADAPTIVE_DWELL_CONFIG_CMDID); + /* Start ExtScan Cmd */ #define WMITLV_TABLE_WMI_EXTSCAN_START_CMDID(id,op,buf,len) \ WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_extscan_start_cmd_fixed_param, wmi_extscan_start_cmd_fixed_param, fixed_param, WMITLV_SIZE_FIX) \ @@ -1575,6 +1597,10 @@ WMITLV_CREATE_PARAM_STRUC(WMI_WOW_UDP_SVC_OFLD_CMDID); WMITLV_SIZE_FIX) WMITLV_CREATE_PARAM_STRUC(WMI_WOW_HOSTWAKEUP_GPIO_PIN_PATTERN_CONFIG_CMDID); +#define WMITLV_TABLE_WMI_WOW_SET_ACTION_WAKE_UP_CMDID(id, op, buf, len) \ + WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_wow_set_action_wake_up_cmd_fixed_param, WMI_WOW_SET_ACTION_WAKE_UP_CMD_fixed_param, fixed_param, WMITLV_SIZE_FIX) +WMITLV_CREATE_PARAM_STRUC(WMI_WOW_SET_ACTION_WAKE_UP_CMDID); + /* Wow enable/disable wake up Cmd */ #define WMITLV_TABLE_WMI_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID(id,op,buf,len) \ WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_WMI_WOW_ADD_DEL_EVT_CMD_fixed_param, WMI_WOW_ADD_DEL_EVT_CMD_fixed_param, fixed_param, WMITLV_SIZE_FIX) @@ -2326,7 +2352,7 @@ WMITLV_CREATE_PARAM_STRUC(WMI_NAN_CMDID); /* NAN Data Get Capabilities Cmd */ #define WMITLV_TABLE_WMI_NDI_GET_CAP_REQ_CMDID(id, op, buf, len) \ - WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_ndi_get_cap_req_fixed_param, wmi_ndi_get_cap_req_fixed_param, fixed_param, WMITLV_SIZE_FIX) + WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_ndi_get_cap_req_fixed_param, wmi_ndi_get_cap_req_fixed_param_PROTOTYPE, fixed_param, WMITLV_SIZE_FIX) WMITLV_CREATE_PARAM_STRUC(WMI_NDI_GET_CAP_REQ_CMDID); /* @@ -2334,11 +2360,13 @@ WMITLV_CREATE_PARAM_STRUC(WMI_NDI_GET_CAP_REQ_CMDID); * * TLV (tag length value ) parameters follow the ndp_initiator_req * structure. The TLV's are: - * wmi_ndp_cfg ndp_cfg[]; - * wmi_ndp_app_info ndp_app_info[]; + * wmi_channel channel; + * A_UINT8 ndp_cfg[]; + * A_UINT8 ndp_app_info[]; */ #define WMITLV_TABLE_WMI_NDP_INITIATOR_REQ_CMDID(id, op, buf, len) \ - WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_ndp_initiator_req_fixed_param, wmi_ndp_initiator_req_fixed_param, fixed_param, WMITLV_SIZE_FIX) \ + WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_ndp_initiator_req_fixed_param, wmi_ndp_initiator_req_fixed_param_PROTOTYPE, fixed_param, WMITLV_SIZE_FIX) \ + WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_channel, wmi_channel, channel, WMITLV_SIZE_FIX) \ WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_ARRAY_BYTE, A_UINT8, ndp_cfg, WMITLV_SIZE_VAR) \ WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_ARRAY_BYTE, A_UINT8, ndp_app_info, WMITLV_SIZE_VAR) WMITLV_CREATE_PARAM_STRUC(WMI_NDP_INITIATOR_REQ_CMDID); @@ -2347,8 +2375,8 @@ WMITLV_CREATE_PARAM_STRUC(WMI_NDP_INITIATOR_REQ_CMDID); * NAN Data Responder Request Cmd * TLV (tag length value ) parameters follow the ndp_responder_req * structure. The TLV's are: - * wmi_ndp_cfg ndp_cfg[]; - * wmi_ndp_app_info ndp_app_info[]; + * A_UINT8 ndp_cfg[]; + * A_UINT8 ndp_app_info[]; */ #define WMITLV_TABLE_WMI_NDP_RESPONDER_REQ_CMDID(id, op, buf, len) \ WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_ndp_responder_rsp_event_fixed_param, wmi_ndp_responder_req_fixed_param, fixed_param, WMITLV_SIZE_FIX) \ @@ -2364,8 +2392,8 @@ WMITLV_CREATE_PARAM_STRUC(WMI_NDP_RESPONDER_REQ_CMDID); * wmi_ndp_end_req wmi_ndp_end_req_list[]; */ #define WMITLV_TABLE_WMI_NDP_END_REQ_CMDID(id, op, buf, len) \ - WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_ndp_end_req_fixed_param, wmi_ndp_end_req_fixed_param, fixed_param, WMITLV_SIZE_FIX) \ - WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_ARRAY_FIXED_STRUC, wmi_ndp_end_req, ndp_end_req_list, WMITLV_SIZE_VAR) + WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_ndp_end_req_fixed_param, wmi_ndp_end_req_fixed_param_PROTOTYPE, fixed_param, WMITLV_SIZE_FIX) \ + WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_ARRAY_STRUC, wmi_ndp_end_req_PROTOTYPE, ndp_end_req_list, WMITLV_SIZE_VAR) WMITLV_CREATE_PARAM_STRUC(WMI_NDP_END_REQ_CMDID); /* Modem power state cmd */ @@ -2451,6 +2479,10 @@ WMITLV_CREATE_PARAM_STRUC(WMI_TRANSFER_DATA_TO_FLASH_CMDID); WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_config_enhanced_mcast_filter_fixed_param, wmi_config_enhanced_mcast_filter_cmd_fixed_param, fixed_param, WMITLV_SIZE_FIX) WMITLV_CREATE_PARAM_STRUC(WMI_CONFIG_ENHANCED_MCAST_FILTER_CMDID); +#define WMITLV_TABLE_WMI_VDEV_WISA_CMDID(id, op, buf, len) \ + WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_vdev_wisa_cmd_fixed_param, wmi_vdev_wisa_cmd_fixed_param, fixed_param, WMITLV_SIZE_FIX) +WMITLV_CREATE_PARAM_STRUC(WMI_VDEV_WISA_CMDID); + /* MAWC sensor report indication cmd */ #define WMITLV_TABLE_WMI_MAWC_SENSOR_REPORT_IND_CMDID(id, op, buf, len) \ WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_mawc_sensor_report_ind_cmd_fixed_param, wmi_mawc_sensor_report_ind_cmd_fixed_param, fixed_param, WMITLV_SIZE_FIX) @@ -2814,7 +2846,12 @@ WMITLV_CREATE_PARAM_STRUC(WMI_SERVICE_READY_EVENTID); /* Service Ready Extension event */ #define WMITLV_TABLE_WMI_SERVICE_READY_EXT_EVENTID(id, op, buf, len) \ - WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_service_ready_ext_event_fixed_param, wmi_service_ready_ext_event_fixed_param, fixed_param, WMITLV_SIZE_FIX) + WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_service_ready_ext_event_fixed_param, wmi_service_ready_ext_event_fixed_param, fixed_param, WMITLV_SIZE_FIX) \ + WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_WMI_SOC_MAC_PHY_HW_MODE_CAPS, WMI_SOC_MAC_PHY_HW_MODE_CAPS, soc_hw_mode_caps, WMITLV_SIZE_FIX) \ + WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_ARRAY_STRUC, WMI_HW_MODE_CAPABILITIES, hw_mode_caps, WMITLV_SIZE_VAR) \ + WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_ARRAY_STRUC, WMI_MAC_PHY_CAPABILITIES, mac_phy_caps, WMITLV_SIZE_VAR) \ + WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_WMI_SOC_HAL_REG_CAPABILITIES, WMI_SOC_HAL_REG_CAPABILITIES, soc_hal_reg_caps, WMITLV_SIZE_FIX) \ + WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_ARRAY_STRUC, WMI_HAL_REG_CAPABILITIES_EXT, hal_reg_caps, WMITLV_SIZE_VAR) WMITLV_CREATE_PARAM_STRUC(WMI_SERVICE_READY_EXT_EVENTID); /* Ready event */ @@ -3180,7 +3217,7 @@ WMITLV_CREATE_PARAM_STRUC(WMI_PEER_LINK_STATS_EVENTID); #define WMITLV_TABLE_WMI_RADIO_LINK_STATS_EVENTID(id,op,buf,len) \ WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_radio_link_stats_event_fixed_param, wmi_radio_link_stats_event_fixed_param, fixed_param, WMITLV_SIZE_FIX) \ WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_STRUC, wmi_radio_link_stats, radio_stats, WMITLV_SIZE_VAR) \ - WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_STRUC, wmi_channel_stats, channel_stats, WMITLV_SIZE_VAR) + WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_ARRAY_STRUC, wmi_channel_stats, channel_stats, WMITLV_SIZE_VAR) WMITLV_CREATE_PARAM_STRUC(WMI_RADIO_LINK_STATS_EVENTID); @@ -3304,37 +3341,37 @@ WMITLV_CREATE_PARAM_STRUC(WMI_NAN_EVENTID); /* NAN discovery interface created event */ #define WMITLV_TABLE_WMI_NAN_DISC_IFACE_CREATED_EVENTID(id, op, buf, len) \ - WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_nan_disc_iface_created_event_fixed_param, wmi_nan_disc_iface_created_event_fixed_param, fixed_param, WMITLV_SIZE_FIX) + WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_nan_disc_iface_created_event_fixed_param, wmi_nan_disc_iface_created_event_fixed_param_PROTOTYPE, fixed_param, WMITLV_SIZE_FIX) WMITLV_CREATE_PARAM_STRUC(WMI_NAN_DISC_IFACE_CREATED_EVENTID); /* NAN discovery interface deleted event */ #define WMITLV_TABLE_WMI_NAN_DISC_IFACE_DELETED_EVENTID(id, op, buf, len) \ - WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_nan_disc_iface_deleted_event_fixed_param, wmi_nan_disc_iface_deleted_event_fixed_param, fixed_param, WMITLV_SIZE_FIX) + WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_nan_disc_iface_deleted_event_fixed_param, wmi_nan_disc_iface_deleted_event_fixed_param_PROTOTYPE, fixed_param, WMITLV_SIZE_FIX) WMITLV_CREATE_PARAM_STRUC(WMI_NAN_DISC_IFACE_DELETED_EVENTID); /* NAN device started new cluster event */ #define WMITLV_TABLE_WMI_NAN_STARTED_CLUSTER_EVENTID(id, op, buf, len) \ - WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_nan_started_cluster_event_fixed_param, wmi_nan_started_cluster_event_fixed_param, fixed_param, WMITLV_SIZE_FIX) + WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_nan_started_cluster_event_fixed_param, wmi_nan_started_cluster_event_fixed_param_PROTOTYPE, fixed_param, WMITLV_SIZE_FIX) WMITLV_CREATE_PARAM_STRUC(WMI_NAN_STARTED_CLUSTER_EVENTID); /* NAN device joined to cluster event */ #define WMITLV_TABLE_WMI_NAN_JOINED_CLUSTER_EVENTID(id, op, buf, len) \ - WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_nan_joined_cluster_event_fixed_param, wmi_nan_joined_cluster_event_fixed_param, fixed_param, WMITLV_SIZE_FIX) + WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_nan_joined_cluster_event_fixed_param, wmi_nan_joined_cluster_event_fixed_param_PROTOTYPE, fixed_param, WMITLV_SIZE_FIX) WMITLV_CREATE_PARAM_STRUC(WMI_NAN_JOINED_CLUSTER_EVENTID); /* NDP capabilities response event */ #define WMITLV_TABLE_WMI_NDI_CAP_RSP_EVENTID(id, op, buf, len) \ - WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_ndi_cap_rsp_event_fixed_param, wmi_ndi_cap_rsp_event_fixed_param, fixed_param, WMITLV_SIZE_FIX) + WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_ndi_cap_rsp_event_fixed_param, wmi_ndi_cap_rsp_event_fixed_param_PROTOTYPE, fixed_param, WMITLV_SIZE_FIX) WMITLV_CREATE_PARAM_STRUC(WMI_NDI_CAP_RSP_EVENTID); /* NDP initiator response event */ #define WMITLV_TABLE_WMI_NDP_INITIATOR_RSP_EVENTID(id, op, buf, len) \ - WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_ndp_initiator_rsp_event_fixed_param, wmi_ndp_initiator_rsp_event_fixed_param, fixed_param, WMITLV_SIZE_FIX) + WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_ndp_initiator_rsp_event_fixed_param, wmi_ndp_initiator_rsp_event_fixed_param_PROTOTYPE, fixed_param, WMITLV_SIZE_FIX) WMITLV_CREATE_PARAM_STRUC(WMI_NDP_INITIATOR_RSP_EVENTID); /* NDP responder response event */ #define WMITLV_TABLE_WMI_NDP_RESPONDER_RSP_EVENTID(id, op, buf, len) \ - WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_ndp_responder_rsp_event_fixed_param, wmi_ndp_responder_rsp_event_fixed_param, fixed_param, WMITLV_SIZE_FIX) + WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_ndp_responder_rsp_event_fixed_param, wmi_ndp_responder_rsp_event_fixed_param_PROTOTYPE, fixed_param, WMITLV_SIZE_FIX) WMITLV_CREATE_PARAM_STRUC(WMI_NDP_RESPONDER_RSP_EVENTID); /** @@ -3343,10 +3380,12 @@ WMITLV_CREATE_PARAM_STRUC(WMI_NDP_RESPONDER_RSP_EVENTID); * TLV (tag length value ) parameters follow the ndp_end_rsp * structure. The TLV's are: * wmi_ndp_end_rsp_per_ndi ndp_end_rsp_per_ndi_list[]; + * wmi_active_ndp_instance_id active_ndp_instances_id[]; */ #define WMITLV_TABLE_WMI_NDP_END_RSP_EVENTID(id, op, buf, len) \ - WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_ndp_end_rsp_event_fixed_param, wmi_ndp_end_rsp_event_fixed_param, fixed_param, WMITLV_SIZE_FIX) \ - WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_ARRAY_STRUC, wmi_ndp_end_rsp_per_ndi, ndp_end_rsp_per_ndi_list, WMITLV_SIZE_VAR) + WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_ndp_end_rsp_event_fixed_param, wmi_ndp_end_rsp_event_fixed_param_PROTOTYPE, fixed_param, WMITLV_SIZE_FIX) \ + WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_ARRAY_STRUC, wmi_ndp_end_rsp_per_ndi_PROTOTYPE, ndp_end_rsp_per_ndi_list, WMITLV_SIZE_VAR) \ + WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_ARRAY_STRUC, wmi_active_ndp_instance_id_PROTOTYPE, active_ndp_instances_id, WMITLV_SIZE_VAR) WMITLV_CREATE_PARAM_STRUC(WMI_NDP_END_RSP_EVENTID); /** @@ -3354,11 +3393,11 @@ WMITLV_CREATE_PARAM_STRUC(WMI_NDP_END_RSP_EVENTID); * * TLV (tag length value ) parameters follow the ndp_indication * structure. The TLV's are: - * wmi_ndp_cfg ndp_cfg[]; - * wmi_ndp_app_info ndp_app_info[]; + * A_UINT8 ndp_cfg[]; + * A_UINT8 ndp_app_info[]; */ #define WMITLV_TABLE_WMI_NDP_INDICATION_EVENTID(id, op, buf, len) \ - WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_ndp_indication_event_fixed_param, wmi_ndp_indication_event_fixed_param, fixed_param, WMITLV_SIZE_FIX) \ + WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_ndp_indication_event_fixed_param, wmi_ndp_indication_event_fixed_param_PROTOTYPE, fixed_param, WMITLV_SIZE_FIX) \ WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_ARRAY_BYTE, A_UINT8, ndp_cfg, WMITLV_SIZE_VAR) \ WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_ARRAY_BYTE, A_UINT8, ndp_app_info, WMITLV_SIZE_VAR) WMITLV_CREATE_PARAM_STRUC(WMI_NDP_INDICATION_EVENTID); @@ -3367,11 +3406,11 @@ WMITLV_CREATE_PARAM_STRUC(WMI_NDP_INDICATION_EVENTID); * NDP confirm event * TLV (tag length value ) parameters follow the ndp_confirm * structure. The TLV's are: - * wmi_ndp_cfg ndp_cfg[]; - * wmi_ndp_app_info ndp_app_info[]; + * A_UINT8 ndp_cfg[]; + * A_UINT8 ndp_app_info[]; */ #define WMITLV_TABLE_WMI_NDP_CONFIRM_EVENTID(id, op, buf, len) \ - WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_ndp_confirm_event_fixed_param, wmi_ndp_confirm_event_fixed_param, fixed_param, WMITLV_SIZE_FIX) \ + WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_ndp_confirm_event_fixed_param, wmi_ndp_confirm_event_fixed_param_PROTOTYPE, fixed_param, WMITLV_SIZE_FIX) \ WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_ARRAY_BYTE, A_UINT8, ndp_cfg, WMITLV_SIZE_VAR) \ WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_ARRAY_BYTE, A_UINT8, ndp_app_info, WMITLV_SIZE_VAR) WMITLV_CREATE_PARAM_STRUC(WMI_NDP_CONFIRM_EVENTID); @@ -3384,8 +3423,7 @@ WMITLV_CREATE_PARAM_STRUC(WMI_NDP_CONFIRM_EVENTID); * wmi_ndp_end_indication ndp_end_indication_list[]; */ #define WMITLV_TABLE_WMI_NDP_END_INDICATION_EVENTID(id, op, buf, len) \ - WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_ndp_end_indication_event_fixed_param, wmi_ndp_end_indication_event_fixed_param, fixed_param, WMITLV_SIZE_FIX) \ - WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_ARRAY_STRUC, wmi_ndp_end_indication, ndp_end_indication_list, WMITLV_SIZE_VAR) + WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_ARRAY_STRUC, wmi_ndp_end_indication_PROTOTYPE, ndp_end_indication_list, WMITLV_SIZE_VAR) WMITLV_CREATE_PARAM_STRUC(WMI_NDP_END_INDICATION_EVENTID); /* L1SS track Event */ @@ -3617,6 +3655,12 @@ WMITLV_CREATE_PARAM_STRUC(WMI_PEER_STA_PS_STATECHG_EVENTID); WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_inst_rssi_stats_resp_fixed_param, wmi_inst_rssi_stats_resp_fixed_param, fixed_param, WMITLV_SIZE_FIX) WMITLV_CREATE_PARAM_STRUC(WMI_INST_RSSI_STATS_EVENTID); +#define WMITLV_TABLE_WMI_RADIO_TX_POWER_LEVEL_STATS_EVENTID(id, op, buf, len) \ + WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_tx_power_level_stats_evt_fixed_param, wmi_tx_power_level_stats_evt_fixed_param, fixed_param, WMITLV_SIZE_FIX) \ + WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_ARRAY_UINT32, A_UINT32, tx_time_per_power_level, WMITLV_SIZE_VAR) +WMITLV_CREATE_PARAM_STRUC(WMI_RADIO_TX_POWER_LEVEL_STATS_EVENTID) + + #ifdef __cplusplus } #endif diff --git a/target/inc/wmi_unified.h b/target/inc/wmi_unified.h index d2c5ea6be6cc..08372ac40467 100644 --- a/target/inc/wmi_unified.h +++ b/target/inc/wmi_unified.h @@ -233,6 +233,7 @@ typedef enum { WMI_GRP_PMF_OFFLOAD, WMI_GRP_BPF_OFFLOAD, /* Berkeley Packet Filter */ WMI_GRP_NAN_DATA, + WMI_GRP_PROTOTYPE, } WMI_GRP_ID; #define WMI_CMD_GRP_START_ID(grp_id) (((grp_id) << 12) | 0x1) @@ -262,6 +263,8 @@ typedef enum { /** set OUI to be used in probe request if enabled */ WMI_SCAN_PROB_REQ_OUI_CMDID, + /** config adaptive dwell scan */ + WMI_SCAN_ADAPTIVE_DWELL_CONFIG_CMDID, /* PDEV(physical device) specific commands */ /** set regulatorty ctl id used by FW to determine the exact ctl power limits */ @@ -630,6 +633,9 @@ typedef enum { /* configure WOW host wakeup PIN pattern */ WMI_WOW_HOSTWAKEUP_GPIO_PIN_PATTERN_CONFIG_CMDID, + /* Set which action category should wake the host from suspend */ + WMI_WOW_SET_ACTION_WAKE_UP_CMDID, + /* RTT measurement related cmd */ /** request to make an RTT measurement */ WMI_RTT_MEASREQ_CMDID = WMI_CMD_GRP_START_ID(WMI_GRP_RTT), @@ -774,6 +780,9 @@ typedef enum { WMI_TRANSFER_DATA_TO_FLASH_CMDID, /** Command to enable/disable filtering of multicast IP with unicast mac */ WMI_CONFIG_ENHANCED_MCAST_FILTER_CMDID, + /** Command to control WISA mode */ + WMI_VDEV_WISA_CMDID, + /* GPIO Configuration */ WMI_GPIO_CONFIG_CMDID = WMI_CMD_GRP_START_ID(WMI_GRP_GPIO), WMI_GPIO_OUTPUT_CMDID, @@ -956,7 +965,8 @@ typedef enum { * NDI - NAN Data Interface * NDP - NAN Data Path */ - WMI_NDI_GET_CAP_REQ_CMDID = WMI_CMD_GRP_START_ID(WMI_GRP_NAN_DATA), + /* Commands in prototyping phase */ + WMI_NDI_GET_CAP_REQ_CMDID = WMI_CMD_GRP_START_ID(WMI_GRP_PROTOTYPE), WMI_NDP_INITIATOR_REQ_CMDID, WMI_NDP_RESPONDER_REQ_CMDID, WMI_NDP_END_REQ_CMDID, @@ -1163,9 +1173,12 @@ typedef enum { /** Event indicating the DIAG logs/events supported by FW */ WMI_DIAG_EVENT_LOG_SUPPORTED_EVENTID, - /* Instantaneous RSSI event */ + /** Instantaneous RSSI event */ WMI_INST_RSSI_STATS_EVENTID, + /** FW update tx power levels event */ + WMI_RADIO_TX_POWER_LEVEL_STATS_EVENTID, + /** NLO specific events */ /** NLO match event after the first match */ WMI_NLO_MATCH_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_NLO_OFL), @@ -1335,12 +1348,11 @@ typedef enum { WMI_MAWC_ENABLE_SENSOR_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_MAWC), /** pkt filter (BPF) offload relevant events */ - WMI_BPF_CAPABILIY_INFO_EVENTID = - WMI_EVT_GRP_START_ID(WMI_GRP_BPF_OFFLOAD), + WMI_BPF_CAPABILIY_INFO_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_BPF_OFFLOAD), WMI_BPF_VDEV_STATS_INFO_EVENTID, - /** NAN Data Events */ - WMI_NDI_CAP_RSP_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_NAN_DATA), + /* Events in Prototyping phase */ + WMI_NDI_CAP_RSP_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_PROTOTYPE), WMI_NDP_INITIATOR_RSP_EVENTID, WMI_NDP_RESPONDER_RSP_EVENTID, WMI_NDP_END_RSP_EVENTID, @@ -1370,12 +1382,6 @@ typedef enum { #define WMI_SSID_LIST_TAG 0x2 #define WMI_BSSID_LIST_TAG 0x3 #define WMI_IE_TAG 0x4 -#define WMI_NDP_CFG_TAG 0x5 -#define WMI_NDP_QOS_CFG_TAG 0x6 -#define WMI_NDP_APP_INFO_TAG 0x7 -#define WMI_NDP_END_REQ_LIST_TAG 0x8 -#define WMI_NDP_END_RSP_PER_NDI_LIST_TAG 0x9 -#define WMI_NDP_END_INDICATION_LIST_TAG 0xA typedef struct { A_UINT32 tlv_header; /* TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_channel */ @@ -1477,6 +1483,8 @@ typedef enum { #define WMI_HT_CAP_MPDU_DENSITY 0x0700 /* MPDU Density */ #define WMI_HT_CAP_MPDU_DENSITY_MASK_SHIFT 8 #define WMI_HT_CAP_HT40_SGI 0x0800 +#define WMI_HT_CAP_RX_LDPC 0x1000 /* LDPC RX support */ +#define WMI_HT_CAP_TX_LDPC 0x2000 /* LDPC TX support */ /* These macros should be used when we wish to advertise STBC support for * only 1SS or 2SS or 3SS. */ @@ -1489,7 +1497,9 @@ typedef enum { WMI_HT_CAP_HT40_SGI | \ WMI_HT_CAP_TX_STBC | \ WMI_HT_CAP_RX_STBC | \ - WMI_HT_CAP_LDPC) + WMI_HT_CAP_LDPC | \ + WMI_HT_CAP_TX_LDPC | \ + WMI_HT_CAP_RX_LDPC) /* WMI_VHT_CAP_* these maps to ieee 802.11ac vht capability information field. The fields not defined here are not supported, or reserved. @@ -1521,6 +1531,7 @@ typedef enum { #define WMI_VHT_CAP_MAX_AMPDU_LEN_EXP_SHIFT 23 #define WMI_VHT_CAP_RX_FIXED_ANT 0x10000000 #define WMI_VHT_CAP_TX_FIXED_ANT 0x20000000 +#define WMI_VHT_CAP_TX_LDPC 0x40000000 /* TEMPORARY: * Preserve the incorrect old name as an alias for the correct new name @@ -1547,6 +1558,7 @@ typedef enum { WMI_VHT_CAP_TX_STBC | \ WMI_VHT_CAP_RX_STBC_MASK | \ WMI_VHT_CAP_RX_LDPC | \ + WMI_VHT_CAP_TX_LDPC | \ WMI_VHT_CAP_MAX_AMPDU_LEN_EXP | \ WMI_VHT_CAP_RX_FIXED_ANT | \ WMI_VHT_CAP_TX_FIXED_ANT) @@ -2560,6 +2572,27 @@ typedef struct { #define WMI_SCAN_CAPTURE_PHY_ERROR 0x8000 /** always do passive scan on passive channels */ #define WMI_SCAN_FLAG_STRICT_PASSIVE_ON_PCHN 0x1000 +/** for adaptive scan mode using 3 bits (21 - 23 bits) */ +#define WMI_SCAN_DWELL_MODE_MASK 0x00E00000 +#define WMI_SCAN_DWELL_MODE_SHIFT 21 + +typedef enum { + WMI_SCAN_DWELL_MODE_DEFAULT = 0, + WMI_SCAN_DWELL_MODE_CONSERVATIVE = 1, + WMI_SCAN_DWELL_MODE_MODERATE = 2, + WMI_SCAN_DWELL_MODE_AGGRESSIVE = 3, + WMI_SCAN_DWELL_MODE_STATIC = 4, +} WMI_SCAN_DWELL_MODE; + +#define WMI_SCAN_SET_DWELL_MODE(flag, mode) \ + do { \ + (flag) |= (((mode) << WMI_SCAN_DWELL_MODE_SHIFT) & \ + WMI_SCAN_DWELL_MODE_MASK); \ + } while (0) + +#define WMI_SCAN_GET_DWELL_MODE(flag) \ + (((flag) & WMI_SCAN_DWELL_MODE_MASK) >> WMI_SCAN_DWELL_MODE_SHIFT) + /** WMI_SCAN_CLASS_MASK must be the same value as IEEE80211_SCAN_CLASS_MASK */ #define WMI_SCAN_CLASS_MASK 0xFF000000 @@ -4420,10 +4453,50 @@ typedef struct { A_UINT32 on_time_hs20; /** number of channels */ A_UINT32 num_channels; - /** tx time (in milliseconds) per TPC level (0.5 dBm) */ + /* + * tx time per TPC level - DEPRECATED + * This field is deprecated. + * It is superseded by the WMI_RADIO_TX_POWER_LEVEL_STATS_EVENTID + * message. + */ A_UINT32 tx_time_per_tpc[MAX_TPC_LEVELS]; } wmi_radio_link_stats; +/** tx time per power level statistics */ +typedef struct { + /* + * TLV tag and len; tag equals + * WMITLV_TAG_STRUC_wmi_tx_power_level_stats_evt_fixed_param + */ + A_UINT32 tlv_header; + /* total number of tx power levels */ + A_UINT32 total_num_tx_power_levels; + /* number of tx power levels that are carried in this event */ + A_UINT32 num_tx_power_levels; + /* + * offset of current stats + * If ((num_tx_power_levels + power_level_offset)) == + * total_num_tx_power_levels) + * this message completes the report of tx time per power levels. + * Otherwise, additional WMI_RADIO_TX_POWER_LEVEL_STATS_EVENTID + * messages will be sent by the target to deliver the remainder of the + * tx time per power level stats. + */ + A_UINT32 power_level_offset; + /* + * This TLV will be followed by a TLV containing a variable-length + * array of A_UINT32 with tx time per power level data + * A_UINT32 tx_time_per_power_level[num_tx_power_levels] + * The tx time is in units of milliseconds. + * The power levels are board-specific values; a board-specific + * translation has to be applied to determine what actual power + * corresponds to each power level. + * Just as the host has a BDF file available, the host should also have + * a data file available that provides the power level to power + * translations. + */ +} wmi_tx_power_level_stats_evt_fixed_param; + /** Radio statistics (once started) do not stop or get reset unless wifi_clear_link_stats is invoked */ typedef struct { A_UINT32 tlv_header; /* TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_stats_event_fixed_param */ @@ -6756,8 +6829,8 @@ typedef struct { /** total number of negotiated ht rate set. Also the sizeof * peer_ht_rates[] */ A_UINT32 num_peer_ht_rates; - /** - * Bitmap providing QCA proprietary mapping of bandwidths to max Rx NSS + /* + * Bitmap providing customized mapping of bandwidths to max Rx NSS * for this peer. * This is required since 802.11 standard currently facilitates peer to * be able to advertise only a single max Rx NSS value across all @@ -8034,6 +8107,7 @@ typedef enum event_type_e { WOW_NAN_DATA_EVENT, WOW_NAN_RTT_EVENT, WOW_TDLS_CONN_TRACKER_EVENT, + WOW_CRITICAL_LOG_EVENT, } WOW_WAKE_EVENT_TYPE; typedef enum wake_reason_e { @@ -8081,6 +8155,7 @@ typedef enum wake_reason_e { WOW_REASON_NAN_DATA, WOW_REASON_NAN_RTT, WOW_REASON_TDLS_CONN_TRACKER_EVENT, + WOW_REASON_CRITICAL_LOG, WOW_REASON_DEBUG_TEST = 0xFF, } WOW_WAKE_REASON_TYPE; @@ -8349,6 +8424,32 @@ typedef struct { A_UINT32 repeat_cnt; } WMI_WOW_HOSTWAKEUP_GPIO_PIN_PATTERN_CONFIG_CMD_fixed_param; +#define MAX_SUPPORTED_ACTION_CATEGORY 256 +#define MAX_SUPPORTED_ACTION_CATEGORY_ELE_LIST (MAX_SUPPORTED_ACTION_CATEGORY/32) + +typedef enum { + WOW_ACTION_WAKEUP_OPERATION_RESET = 0, + WOW_ACTION_WAKEUP_OPERATION_SET, + WOW_ACTION_WAKEUP_OPERATION_ADD_SET, + WOW_ACTION_WAKEUP_OPERATION_DELETE_SET, +} WOW_ACTION_WAKEUP_OPERATION; + +typedef struct { + /* + * TLV tag and len; tag equals + * WMITLV_TAG_STRUC_WMI_WOW_SET_ACTION_WAKE_UP_CMD_fixed_param + */ + A_UINT32 tlv_header; + A_UINT32 vdev_id; + /* + * 0 reset to fw default, 1 set the bits, 2 add the setting bits, + * 3 delete the setting bits + */ + A_UINT32 operation; + A_UINT32 action_category_map[MAX_SUPPORTED_ACTION_CATEGORY_ELE_LIST]; +} WMI_WOW_SET_ACTION_WAKE_UP_CMD_fixed_param; + + typedef struct wow_event_info_s { A_UINT32 tlv_header; /* TLV tag and len; tag equals WMITLV_TAG_STRUC_WOW_EVENT_INFO_fixed_param */ A_UINT32 vdev_id; @@ -10970,7 +11071,9 @@ typedef struct { A_UINT32 vdev_id; /** NAN interface MAC address */ wmi_mac_addr nan_interface_macaddr; -} wmi_nan_disc_iface_created_event_fixed_param; +} wmi_nan_disc_iface_created_event_fixed_param_PROTOTYPE; + +#define wmi_nan_disc_iface_created_event_fixed_param wmi_nan_disc_iface_created_event_fixed_param_PROTOTYPE /** * Event to indicate NAN discovery interface deleted @@ -10983,7 +11086,9 @@ typedef struct { A_UINT32 tlv_header; /** Unique id identifying the VDEV */ A_UINT32 vdev_id; -} wmi_nan_disc_iface_deleted_event_fixed_param; +} wmi_nan_disc_iface_deleted_event_fixed_param_PROTOTYPE; + +#define wmi_nan_disc_iface_deleted_event_fixed_param wmi_nan_disc_iface_deleted_event_fixed_param_PROTOTYPE /** * Event to indicate NAN device started new cluster @@ -10998,7 +11103,9 @@ typedef struct { A_UINT32 vdev_id; /** NAN Cluster ID */ A_UINT32 nan_cluster_id; -} wmi_nan_started_cluster_event_fixed_param; +} wmi_nan_started_cluster_event_fixed_param_PROTOTYPE; + +#define wmi_nan_started_cluster_event_fixed_param wmi_nan_started_cluster_event_fixed_param_PROTOTYPE /** * Event to indicate NAN device joined to cluster @@ -11013,7 +11120,9 @@ typedef struct { A_UINT32 vdev_id; /** NAN Cluster ID */ A_UINT32 nan_cluster_id; -} wmi_nan_joined_cluster_event_fixed_param; +} wmi_nan_joined_cluster_event_fixed_param_PROTOTYPE; + +#define wmi_nan_joined_cluster_event_fixed_param wmi_nan_joined_cluster_event_fixed_param_PROTOTYPE /** NAN DATA CMD's */ @@ -11028,34 +11137,9 @@ typedef struct { A_UINT32 tlv_header; /** unique id generated in upper layer for the transaction */ A_UINT32 transaction_id; -} wmi_ndi_get_cap_req_fixed_param; - -/** - * NDP configuration (Security and/or QOS) - */ -typedef struct { - A_UINT32 tag; /** WMI_NDP_CFG_TAG */ - A_UINT32 ndp_cfg_len; /** ndp_cfg length in byte */ - A_UINT32 ndp_cfg[1]; /** Security/QoS configuration */ -} wmi_ndp_cfg; - -/** - * NDP QOS configuration - */ -typedef struct { - A_UINT32 tag; /** WMI_NDP_QOS_CFG_TAG */ - A_UINT32 ndp_qos_cfg_len; /** ndp_qos_cfg length in byte */ - A_UINT32 ndp_qos_cfg[1]; /** QoS configuration */ -} wmi_ndp_qos_cfg; +} wmi_ndi_get_cap_req_fixed_param_PROTOTYPE; -/** - * NDP application information - */ -typedef struct { - A_UINT32 tag; /** WMI_NDP_APP_INFO_TAG */ - A_UINT32 ndp_app_info_len; /** ndp_app_info length in byte */ - A_UINT32 ndp_app_info[1]; /** App/Service information */ -} wmi_ndp_app_info; +#define wmi_ndi_get_cap_req_fixed_param wmi_ndi_get_cap_req_fixed_param_PROTOTYPE /** * NDP Response code @@ -11064,7 +11148,9 @@ typedef enum { NDP_RSP_CODE_REQUEST_ACCEPT = 0x00, NDP_RSP_CODE_REQUEST_REJECT = 0x01, NDP_RSP_CODE_REQUEST_DEFER = 0x02, -} wmi_ndp_rsp_code; +} wmi_ndp_rsp_code_PROTOTYPE; + +#define wmi_ndp_rsp_code wmi_ndp_rsp_code_PROTOTYPE /** * NDP Initiator requesting a data session @@ -11083,17 +11169,20 @@ typedef struct { A_UINT32 service_instance_id; /** Discovery MAC addr of the publisher/peer */ wmi_mac_addr peer_discovery_mac_addr; - /** Number of bytes in TLV wmi_ndp_cfg */ + /* Actual number of bytes in TLV ndp_cfg */ A_UINT32 ndp_cfg_len; - /** Number of bytes in TLV wmi_ndp_app_info */ + /* Actual number of bytes in TLV ndp_app_info */ A_UINT32 ndp_app_info_len; /** * TLV (tag length value ) parameters follow the ndp_initiator_req * structure. The TLV's are: - * wmi_ndp_cfg ndp_cfg[]; - * wmi_ndp_app_info ndp_app_info[]; + * wmi_channel channel; + * A_UINT8 ndp_cfg[]; + * A_UINT8 ndp_app_info[]; */ -} wmi_ndp_initiator_req_fixed_param; +} wmi_ndp_initiator_req_fixed_param_PROTOTYPE; + +#define wmi_ndp_initiator_req_fixed_param wmi_ndp_initiator_req_fixed_param_PROTOTYPE /** * Initiate a data response on the responder side @@ -11116,54 +11205,53 @@ typedef struct { A_UINT32 ndp_instance_id; /** Response Code defined in wmi_ndp_rsp_code */ A_UINT32 rsp_code; - /** Number of bytes in TLV wmi_ndp_cfg */ + /** Number of bytes in TLV ndp_cfg */ A_UINT32 ndp_cfg_len; - /** Number of bytes in TLV wmi_ndp_app_info */ + /** Number of bytes in TLV ndp_app_info */ A_UINT32 ndp_app_info_len; /** * TLV (tag length value ) parameters follow the ndp_responder_req * structure. The TLV's are: - * wmi_ndp_cfg ndp_cfg[]; - * wmi_ndp_app_info ndp_app_info[]; + * A_UINT8 ndp_cfg[]; + * A_UINT8 ndp_app_info[]; */ -} wmi_ndp_responder_req_fixed_param; +} wmi_ndp_responder_req_fixed_param_PROTOTYPE; + +#define wmi_ndp_responder_req_fixed_param wmi_ndp_responder_req_fixed_param_PROTOTYPE /** * NDP end type */ typedef enum { - NDP_END_TYPE_UNSPECIFIED = 0x00, - NDP_END_TYPE_PEER_UNAVAILABLE = 0x01, - NDP_END_TYPE_OTA_FRAME = 0x02, -} wmi_ndp_end_type; + WMI_NDP_END_TYPE_UNSPECIFIED = 0x00, + WMI_NDP_END_TYPE_PEER_UNAVAILABLE = 0x01, + WMI_NDP_END_TYPE_OTA_FRAME = 0x02, +} wmi_ndp_end_type_PROTOTYPE; + +#define wmi_ndp_end_type wmi_ndp_end_type_PROTOTYPE /** * NDP end reason code */ typedef enum { - NDP_END_REASON_UNSPECIFIED = 0x00, - NDP_END_REASON_INACTIVITY = 0x01, - NDP_END_REASON_PEER_DATA_END = 0x02, -} wmi_ndp_end_reason_code; + WMI_NDP_END_REASON_UNSPECIFIED = 0x00, + WMI_NDP_END_REASON_INACTIVITY = 0x01, + WMI_NDP_END_REASON_PEER_DATA_END = 0x02, +} wmi_ndp_end_reason_code_PROTOTYPE; + +#define wmi_ndp_end_reason_code wmi_ndp_end_reason_code_PROTOTYPE /** * NDP end request */ typedef struct { - /** reason_code defined in wmi_ndp_end_reason_code */ - A_UINT32 reason_code; + /* TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_ndp_end_req */ + A_UINT32 tlv_header; /** NDP instance id */ A_UINT32 ndp_instance_id; -} wmi_ndp_end_req; +} wmi_ndp_end_req_PROTOTYPE; -/** - * NDP end request list - */ -typedef struct { - A_UINT32 tag;/** WMI_NDP_END_REQ_LIST_TAG */ - A_UINT32 num_ndp_end_reqs; /** number of wmi_ndp_end_req */ - wmi_ndp_end_req ndp_end_reqs[1]; -} wmi_ndp_end_req_list; +#define wmi_ndp_end_req wmi_ndp_end_req_PROTOTYPE /** * NDP End request @@ -11176,16 +11264,14 @@ typedef struct { A_UINT32 tlv_header; /** unique id generated in upper layer for the transaction */ A_UINT32 transaction_id; - /** Number of ndp instances in wmi_ndp_end_req_list */ - A_UINT32 num_ndp_instances; - /** Number of bytes in TLV wmi_ndp_end_req_list */ - A_UINT32 ndp_end_req_len; /** * TLV (tag length value ) parameters follow the ndp_end_req * structure. The TLV's are: - * wmi_ndp_end_req wmi_ndp_end_req_list[]; + * wmi_ndp_end_req ndp_end_req_list[]; */ -} wmi_ndp_end_req_fixed_param; +} wmi_ndp_end_req_fixed_param_PROTOTYPE; + +#define wmi_ndp_end_req_fixed_param wmi_ndp_end_req_fixed_param_PROTOTYPE /* NAN DATA RSP EVENTS */ @@ -11202,11 +11288,13 @@ typedef struct { A_UINT32 transaction_id; /** Max ndi interface support */ A_UINT32 max_ndi_interfaces; - /** Max ndp per ndi support */ - A_UINT32 max_ndp_per_ndi; + /** Max ndp sessions can support */ + A_UINT32 max_ndp_sessions; /** Max number of peer's per ndi */ A_UINT32 max_peers_per_ndi; -} wmi_ndi_cap_rsp_event_fixed_param; +} wmi_ndi_cap_rsp_event_fixed_param_PROTOTYPE; + +#define wmi_ndi_cap_rsp_event_fixed_param wmi_ndi_cap_rsp_event_fixed_param_PROTOTYPE /** * NDP command response code @@ -11214,7 +11302,9 @@ typedef struct { typedef enum { NDP_CMD_RSP_STATUS_SUCCESS = 0x00, NDP_CMD_RSP_STATUS_ERROR = 0x01, -} wmi_ndp_cmd_rsp_status; +} wmi_ndp_cmd_rsp_status_PROTOTYPE; + +#define wmi_ndp_cmd_rsp_status wmi_ndp_cmd_rsp_status_PROTOTYPE /** * NDP command reason code @@ -11228,7 +11318,17 @@ typedef enum { NDP_INVALID_APP_INFO_LEN_PARAM = 0x05, NDP_INVALID_NDP_INSTANCE_ID_PARAM = 0x06, NDP_INVALID_RSP_CODE_PARAM = 0x07, -} wmi_ndp_cmd_reason_code; + NDP_INVALID_CHANNEL_PARAM = 0x08, + NDP_INVALID_APP_INFO = 0x09, + NDP_INVALID_NDP_CFG = 0x0A, + NDP_INVALID_NDP_CFG_LEN_PARAM = 0x0B, + NDP_INVALID_NUM_NDP_INSTANCES_PARAM = 0x0C, + NDP_INVALID_NDP_END_REQ_LEN_PARAM = 0x0D, + NDP_INVALID_NDP_END_REQ = 0x0E, + NDP_REACHED_MAX_NDP_INSTANCES = 0x0F, +} wmi_ndp_cmd_reason_code_PROTOTYPE; + +#define wmi_ndp_cmd_reason_code wmi_ndp_cmd_reason_code_PROTOTYPE /** * Event response for wmi_ndp_initiator_req @@ -11247,7 +11347,14 @@ typedef struct { A_UINT32 rsp_status; /** Reason code defined in wmi_ndp_cmd_reason_code */ A_UINT32 reason_code; -} wmi_ndp_initiator_rsp_event_fixed_param; + /* + * Unique token Id generated on the initiator/responder + * side used for a NDP session between two NAN devices + */ + A_UINT32 ndp_instance_id; +} wmi_ndp_initiator_rsp_event_fixed_param_PROTOTYPE; + +#define wmi_ndp_initiator_rsp_event_fixed_param wmi_ndp_initiator_rsp_event_fixed_param_PROTOTYPE /** * Event response for wmi_ndp_responder_req cmd @@ -11266,30 +11373,49 @@ typedef struct { A_UINT32 rsp_status; /** Reason code defined in wmi_ndp_cmd_reason_code */ A_UINT32 reason_code; -} wmi_ndp_responder_rsp_event_fixed_param; + /* + * Unique token Id generated on the initiator/responder + * side used for a NDP session between two NAN devices + */ + A_UINT32 ndp_instance_id; + /* NDI mac address of the peer */ + wmi_mac_addr peer_ndi_mac_addr; +} wmi_ndp_responder_rsp_event_fixed_param_PROTOTYPE; + +#define wmi_ndp_responder_rsp_event_fixed_param wmi_ndp_responder_rsp_event_fixed_param_PROTOTYPE +/** + * Active ndp instance id + */ +typedef struct { + /* + * TLV tag and len; tag equals + * WMITLV_TAG_STRUC_wmi_active_ndp_instance_id + */ + A_UINT32 tlv_header; + /* NDP instance id */ + A_UINT32 ndp_instance_id; +} wmi_active_ndp_instance_id_PROTOTYPE; + +#define wmi_active_ndp_instance_id wmi_active_ndp_instance_id_PROTOTYPE /** * NDP end response per ndi */ typedef struct { + /* + * TLV tag and len; tag equals + * WMITLV_TAG_STRUC_wmi_ndp_end_rsp_per_ndi + */ + A_UINT32 tlv_header; /** Unique id identifying the VDEV */ A_UINT32 vdev_id; /** Peer MAC addr */ wmi_mac_addr peer_mac_addr; /** Number of active ndps on this ndi */ A_UINT32 num_active_ndps_on_ndi; -} wmi_ndp_end_rsp_per_ndi; +} wmi_ndp_end_rsp_per_ndi_PROTOTYPE; -/** - * NDP end response per ndi list - */ -typedef struct { - /** WMI_NDP_END_RSP_PER_NDI_LIST_TAG */ - A_UINT32 tag; - /** Number of ndp_end_rsp_per_ndi */ - A_UINT32 num_ndp_end_rsp_per_ndis; - wmi_ndp_end_rsp_per_ndi ndp_end_rsp_per_ndis[1]; -} wmi_ndp_end_rsp_per_ndi_list; +#define wmi_ndp_end_rsp_per_ndi wmi_ndp_end_rsp_per_ndi_PROTOTYPE /** * Event response for wmi_ndp_end_req cmd @@ -11306,14 +11432,15 @@ typedef struct { A_UINT32 rsp_status; /** Reason code defined in wmi_ndp_cmd_reason_code */ A_UINT32 reason_code; - /** Number of bytes in TLV wmi_ndp_end_rsp_per_ndi */ - A_UINT32 data_end_req_rsp_len; /** * TLV (tag length value ) parameters follow the ndp_end_rsp * structure. The TLV's are: * wmi_ndp_end_rsp_per_ndi ndp_end_rsp_per_ndis[]; + * wmi_active_ndp_instance_id active_ndp_instances_id[]; */ -} wmi_ndp_end_rsp_event_fixed_param; +} wmi_ndp_end_rsp_event_fixed_param_PROTOTYPE; + +#define wmi_ndp_end_rsp_event_fixed_param wmi_ndp_end_rsp_event_fixed_param_PROTOTYPE /** NAN DATA EVENTS */ @@ -11323,7 +11450,9 @@ typedef struct { typedef enum { WMI_NDP_INITIATOR_ROLE, WMI_NDP_RESPONDER_ROLE, -} wmi_ndp_self_role; +} wmi_ndp_self_role_PROTOTYPE; + +#define wmi_ndp_self_role wmi_ndp_self_role_PROTOTYPE /** * NDP accept policy @@ -11331,7 +11460,9 @@ typedef enum { typedef enum { WMI_NDP_ACCEPT_POLICY_NONE, WMI_NDP_ACCEPT_POLICY_ALL, -} wmi_ndp_accept_policy; +} wmi_ndp_accept_policy_PROTOTYPE; + +#define wmi_ndp_accept_policy wmi_ndp_accept_policy_PROTOTYPE /** * Event indication received on the responder side when a NDP Initiator request/ @@ -11357,7 +11488,9 @@ typedef struct { /** Unique Instance Id corresponding to a service/session. */ A_UINT32 service_instance_id; /** Discovery MAC addr of the peer/initiator */ - wmi_mac_addr peer_disc_mac_addr; + wmi_mac_addr peer_discovery_mac_addr; + /* NDI mac address of the peer */ + wmi_mac_addr peer_ndi_mac_addr; /** * Unique token Id generated on the initiator/responder * side used for a NDP session between two NAN devices @@ -11370,10 +11503,12 @@ typedef struct { /** * TLV (tag length value ) parameters follow the ndp_indication * structure. The TLV's are: - * wmi_ndp_cfg ndp_cfg[]; - * wmi_ndp_app_info ndp_app_info[]; + * A_UINT8 ndp_cfg[]; + * A_UINT8 ndp_app_info[]; */ -} wmi_ndp_indication_event_fixed_param; +} wmi_ndp_indication_event_fixed_param_PROTOTYPE; + +#define wmi_ndp_indication_event_fixed_param wmi_ndp_indication_event_fixed_param_PROTOTYPE /** * Event indication of data confirm is received on both @@ -11403,59 +11538,44 @@ typedef struct { A_UINT32 ndp_cfg_len; /** Number of bytes in TLV wmi_ndp_app_info */ A_UINT32 ndp_app_info_len; + /** Reason Code */ + A_UINT32 reason_code; + /** Number of active ndps on this peer */ + A_UINT32 num_active_ndps_on_peer; /** * TLV (tag length value ) parameters follow the ndp_confirm * structure. The TLV's are: - * wmi_ndp_cfg ndp_cfg[]; - * wmi_ndp_app_info ndp_app_info[]; + * A_UINT8 ndp_cfg[]; + * A_UINT8 ndp_app_info[]; */ -} wmi_ndp_confirm_event_fixed_param; +} wmi_ndp_confirm_event_fixed_param_PROTOTYPE; + +#define wmi_ndp_confirm_event_fixed_param wmi_ndp_confirm_event_fixed_param_PROTOTYPE /** - * NDP end indication + * Event indication received on the initiator/responder side terminating a NDP session */ typedef struct { + /* + * TLV tag and len; tag equals + * WMITLV_TAG_STRUC_wmi_ndp_end_indication + */ + A_UINT32 tlv_header; /** type defined in wmi_ndp_end_type */ A_UINT32 type; + /* Unique id identifying the VDEV */ + A_UINT32 vdev_id; /** reason_code defined in wmi_ndp_end_reason_code */ A_UINT32 reason_code; /** NDP instance id */ A_UINT32 ndp_instance_id; -} wmi_ndp_end_indication; + /* NDI MAC addr of the peer */ + wmi_mac_addr peer_ndi_mac_addr; + /* Number of active ndps on this peer */ + A_UINT32 num_active_ndps_on_peer; +} wmi_ndp_end_indication_PROTOTYPE; -/** - * NDP end indication list - */ -typedef struct { - /** WMI_NDP_END_INDICATION_LIST_TAG */ - A_UINT32 tag; - /** Number of ndp_end_rsp_per_ndi */ - A_UINT32 num_ndp_end_indications; - wmi_ndp_end_indication ndp_end_indications[1]; -} wmi_ndp_end_indication_list; - -/** - * Event indication received on the initiator/responder side - * terminating a NDP session - */ -typedef struct { - /* - * TLV tag and len; tag equals - * WMITLV_TAG_STRUC_wmi_ndp_end_indication_event_fixed_param - */ - A_UINT32 tlv_header; - /** Unique id identifying the VDEV */ - A_UINT32 vdev_id; - /** Number of ndp instances in wmi_ndp_end_indication */ - A_UINT32 num_ndp_instances; - /** Number of bytes in TLV wmi_ndp_end_indication */ - A_UINT32 data_end_event_len; - /** - * TLV (tag length value ) parameters follow the ndp_end_indication - * structure. The TLV's are: - * wmi_ndp_end_indication ndp_end_indications[]; - */ -} wmi_ndp_end_indication_event_fixed_param; +#define wmi_ndp_end_indication wmi_ndp_end_indication_PROTOTYPE typedef struct { A_UINT32 tlv_header; @@ -12325,9 +12445,9 @@ typedef enum { typedef struct { A_UINT32 tlv_header; /* TLV tag and len; tag equals WMITLV_TAG_ARRAY_STRUC */ - /**RSSI */ + /** RSSI */ A_UINT32 rssi; - /**time stamp in milliseconds */ + /** time stamp in milliseconds */ A_UINT32 tstamp; /** Extscan cycle during which this entry was scanned */ A_UINT32 scan_cycle_id; @@ -12336,6 +12456,8 @@ typedef struct { * interrupted (aborted/large time gap preempted) scan */ A_UINT32 flags; + /** Bitmask of buckets (i.e. sets of channels) scanned */ + A_UINT32 buckets_scanned; } wmi_extscan_rssi_info; typedef struct { @@ -14515,6 +14637,18 @@ typedef struct { A_UINT32 enable; } wmi_config_enhanced_mcast_filter_cmd_fixed_param; +typedef struct { + /* + * TLV tag and len; tag equals + * WMITLV_TAG_STRUC_wmi_vdev_wisa_cmd_fixed_param + */ + A_UINT32 tlv_header; + /* unique id identifying the VDEV, generated by the caller */ + A_UINT32 vdev_id; + /* WISA enable / disable mode */ + A_UINT32 wisa_mode; +} wmi_vdev_wisa_cmd_fixed_param; + /* * This structure is used to report SMPS force mode set complete to host. */ @@ -15280,6 +15414,233 @@ typedef struct { **/ } wmi_pdev_wal_power_debug_cmd_fixed_param; +typedef enum { + WLAN_2G_CAPABILITY = 0x1, + WLAN_5G_CAPABILITY = 0x2, +} WLAN_BAND_CAPABILITY; + +#define WMI_SUPPORT_11B_GET(flags) WMI_GET_BITS(flags, 0, 1) +#define WMI_SUPPORT_11B_SET(flags, value) WMI_SET_BITS(flags, 0, 1, value) + +#define WMI_SUPPORT_11G_GET(flags) WMI_GET_BITS(flags, 1, 1) +#define WMI_SUPPORT_11G_SET(flags, value) WMI_SET_BITS(flags, 1, 1, value) + +#define WMI_SUPPORT_11A_GET(flags) WMI_GET_BITS(flags, 2, 1) +#define WMI_SUPPORT_11A_SET(flags, value) WMI_SET_BITS(flags, 2, 1, value) + +#define WMI_SUPPORT_11N_GET(flags) WMI_GET_BITS(flags, 3, 1) +#define WMI_SUPPORT_11N_SET(flags, value) WMI_SET_BITS(flags, 3, 1, value) + +#define WMI_SUPPORT_11AC_GET(flags) WMI_GET_BITS(flags, 4, 1) +#define WMI_SUPPORT_11AC_SET(flags, value) WMI_SET_BITS(flags, 4, 1, value) + +#define WMI_SUPPORT_11AX_GET(flags) WMI_GET_BITS(flags, 5, 1) +#define WMI_SUPPORT_11AX_SET(flags, value) WMI_SET_BITS(flags, 5, 1, value) + +typedef struct { + /* + * TLV tag and len; tag equals + * WMITLV_TAG_STRUC_WMI_MAC_PHY_CAPABILITIES + */ + A_UINT32 tlv_header; + /* + * hw_mode_id - identify a particular set of HW characteristics, as + * specified by the subsequent fields. WMI_MAC_PHY_CAPABILITIES element + * must be mapped to its parent WMI_HW_MODE_CAPABILITIES element using + * hw_mode_id. No particular ordering of WMI_MAC_PHY_CAPABILITIES + * elements should be assumed, though in practice the elements may + * always be ordered by hw_mode_id + */ + A_UINT32 hw_mode_id; + /* + * pdev_id starts with 1. pdev_id 1 => phy_id 0, + * pdev_id 2 => phy_id 1 + */ + A_UINT32 pdev_id; + /* phy id. Starts with 0 */ + A_UINT32 phy_id; + /* supported modulations */ + union { + A_UINT32 supports_11b:1, + supports_11g:1, + supports_11a:1, + supports_11n:1, + supports_11ac:1, + supports_11ax:1; + A_UINT32 supported_flags; + }; + /* supported bands, enum WLAN_BAND_CAPABILITY */ + A_UINT32 supported_bands; + /* + * ampdu density 0 for no restriction, 1 for 1/4 us, 2 for 1/2 us, + * 3 for 1 us,4 for 2 us, 5 for 4 us, 6 for 8 us,7 for 16 us + */ + A_UINT32 ampdu_density; + /* max bw supported 2G, enum wmi_channel_width */ + A_UINT32 max_bw_supported_2G; + /* WMI HT Capability, WMI_HT_CAP defines */ + A_UINT32 ht_cap_info_2G; + /* VHT capability info field of 802.11ac, WMI_VHT_CAP defines */ + A_UINT32 vht_cap_info_2G; + /* + * VHT Supported MCS Set field Rx/Tx same + * The max VHT-MCS for n SS subfield (where n = 1,...,8) is encoded as + * follows + * - 0 indicates support for VHT-MCS 0-7 for n spatial streams + * - 1 indicates support for VHT-MCS 0-8 for n spatial streams + * - 2 indicates support for VHT-MCS 0-9 for n spatial streams + * - 3 indicates that n spatial streams is not supported + */ + A_UINT32 vht_supp_mcs_2G; + /* HE capability info field of 802.11ax, WMI_HE_CAP defines */ + A_UINT32 he_cap_info_2G; + /* HE Supported MCS Set field Rx/Tx same */ + A_UINT32 he_supp_mcs_2G; + /* Valid Transmit chain mask */ + A_UINT32 tx_chain_mask_2G; + /* Valid Receive chain mask */ + A_UINT32 rx_chain_mask_2G; + /* max bw supported 5G, enum wmi_channel_width */ + A_UINT32 max_bw_supported_5G; + /* WMI HT Capability, WMI_HT_CAP defines */ + A_UINT32 ht_cap_info_5G; + /* VHT capability info field of 802.11ac, WMI_VHT_CAP defines */ + A_UINT32 vht_cap_info_5G; + /* + * VHT Supported MCS Set field Rx/Tx same + * The max VHT-MCS for n SS subfield (where n = 1,...,8) is encoded as + * follows + * - 0 indicates support for VHT-MCS 0-7 for n spatial streams + * - 1 indicates support for VHT-MCS 0-8 for n spatial streams + * - 2 indicates support for VHT-MCS 0-9 for n spatial streams + * - 3 indicates that n spatial streams is not supported + */ + A_UINT32 vht_supp_mcs_5G; + /* HE capability info field of 802.11ax, WMI_HE_CAP defines */ + A_UINT32 he_cap_info_5G; + /* HE Supported MCS Set field Rx/Tx same */ + A_UINT32 he_supp_mcs_5G; + /* Valid Transmit chain mask */ + A_UINT32 tx_chain_mask_5G; + /* Valid Receive chain mask */ + A_UINT32 rx_chain_mask_5G; +} WMI_MAC_PHY_CAPABILITIES; + +typedef struct { + /* + * TLV tag and len; tag equal + * WMITLV_TAG_STRUC_WMI_HW_MODE_CAPABILITIES + */ + A_UINT32 tlv_header; + /* + * hw_mode_id - identify a particular set of HW characteristics, + * as specified by the subsequent fields + */ + A_UINT32 hw_mode_id; + /* BIT0 represents phy_id 0, BIT1 represent phy_id 1 and so on */ + A_UINT32 phy_id_map; + /* + * number of bits set in phy_id_map represents number of + * WMI_MAC_PHY_CAPABILITIES TLV's + * one for each active PHY for current HW mode + * identified by hw_mode_id. For example for + * DBS/SBS mode there will be 2 + * WMI_MAC_PHY_CAPABILITIES TLVs and for + * single MAC modes it + * will be 1 WMI_MAC_PHY_CAPABILITIES + * TLVs + */ +} WMI_HW_MODE_CAPABILITIES; + +typedef struct { + /* + * TLV tag and len; tag equals + * WMITLV_TAG_STRUC_WMI_SOC_MAC_PHY_HW_MODE_CAPS + */ + A_UINT32 tlv_header; + /* num HW modes */ + A_UINT32 num_hw_modes; + /* num_hw_modes WMI_HW_MODE_CAPABILITIES TLV's */ +} WMI_SOC_MAC_PHY_HW_MODE_CAPS; + +/*Below are Reg caps per PHY. Please note PHY ID starts with 0.*/ +typedef struct { + /* + * TLV tag and len; tag equals + * WMITLV_TAG_STRUC_WMI_HAL_REG_CAPABILITIES_EXT + */ + A_UINT32 tlv_header; + /* phy id */ + A_UINT32 phy_id; + /* regdomain value specified in EEPROM */ + A_UINT32 eeprom_reg_domain; + /* regdomain */ + A_UINT32 eeprom_reg_domain_ext; + /* + * CAP1 capabilities bit map, see REGDMN_CAP1_ + * defines + */ + A_UINT32 regcap1; + /* + * REGDMN EEPROM CAP, see + * REGDMN_EEPROM_EEREGCAP_ defines + */ + A_UINT32 regcap2; + /* REGDMN MODE, see REGDMN_MODE_ enum */ + A_UINT32 wireless_modes; + A_UINT32 low_2ghz_chan; + A_UINT32 high_2ghz_chan; + A_UINT32 low_5ghz_chan; + A_UINT32 high_5ghz_chan; +} WMI_HAL_REG_CAPABILITIES_EXT; + +typedef struct { + /* + * TLV tag and len; tag equals + * WMITLV_TAG_STRUC_WMI_SOC_HAL_REG_CAPABILITIES + */ + A_UINT32 tlv_header; + /* num_phy WMI_HAL_REG_CAPABILITIES_EXT TLV's */ + A_UINT32 num_phy; +} WMI_SOC_HAL_REG_CAPABILITIES; + +typedef struct { + /* + * TLV tag and len; tag equals + * WMITLV_TAG_STRUC_wmi_scan_adaptive_dwell_parameters_tlv + */ + A_UINT32 tlv_header; + /* + * global default adaptive dwell mode, + * used when WMI_SCAN_DWELL_MODE_DEFAULT + */ + A_UINT32 default_adaptive_dwell_mode; + /* + * the weight to calculate the average low pass filter for + * channel congestion. 0-100 + */ + A_UINT32 adapative_lpf_weight; + /* interval to monitor passive scan in msec */ + A_UINT32 passive_monitor_interval_ms; + /* % of wifi activity to switch from passive to active 0-100 */ + A_UINT32 wifi_activity_threshold_pct; +} wmi_scan_adaptive_dwell_parameters_tlv; + +typedef struct { + /* + * TLV tag and len; tag equals + * WMITLV_TAG_STRUC_wmi_scan_adaptive_dwell_config_fixed_param + */ + A_UINT32 tlv_header; + /* globally enable/disable adaptive dwell */ + A_UINT32 enable; + /* + * followed by TLV (tag length value) parameters array + * The TLV's are: + * wmi_scan_adaptive_dwell_parameters_tlv param[]; (0 or 1 elements) + */ +} wmi_scan_adaptive_dwell_config_fixed_param; + /* ADD NEW DEFS HERE */ /***************************************************************************** diff --git a/target/inc/wmi_version.h b/target/inc/wmi_version.h index 4d127a8e6679..9aedc072c3d8 100644 --- a/target/inc/wmi_version.h +++ b/target/inc/wmi_version.h @@ -36,7 +36,7 @@ #define __WMI_VER_MINOR_ 0 /** WMI revision number has to be incremented when there is a * change that may or may not break compatibility */ -#define __WMI_REVISION_ 230 +#define __WMI_REVISION_ 241 /** The Version Namespace should not be normally changed. Only * host and firmware of the same WMI namespace will work |
