diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2016-10-13 11:59:08 -0600 |
|---|---|---|
| committer | Linux Build Service Account <lnxbuild@localhost> | 2016-10-13 11:59:08 -0600 |
| commit | 75ac7490a2e601343288b789323cd379997f809c (patch) | |
| tree | 92f7040208d0e44e5a38db154bd46b3900373a2e | |
| parent | f62c9c5ddd1fe2f7525eb7ef6c217098bdf90bd0 (diff) | |
| parent | 327d4b3fc880ce6580e830788a759c20b59bb6a8 (diff) | |
Promotion of wlan-cld3.driver.lnx.1.1-00106.
CRs Change ID Subject
--------------------------------------------------------------------------------------------------------------
1074336 Ie789cc0c00ab6553ad4ca1a12968d50078afe763 qcacld-3.0: Fix -Wmissing-prototypes in wlan_hdd_ipa
1074336 I6a941cd82af543d433427b5ce3aad80f7e1c8e57 qcacld-3.0: Fix -Wmissing-prototypes in wlan_hdd_driver_
688141 I67fb71a0708ceb0de1bdde815a3d364971d7537b Release 5.1.0.30E
1075090 I28ac7560d042f4d81560d3bbeea8ac18beb5e453 qcacld-3.0: Fix -Wmissing-prototypes in lim_assoc_utils
1075544 I03308f6fd7802acf7e80c01f15f42c99bb77ce7e qcacld-3.0: Remove unused functions from cds_regdomain.c
987047 Ie178cdb8c01294ef103baebfd7805d80e4c3c3be qcacld-3.0: Update get_concurrency_matrix to advertise S
688141 I372c04ea7e873dc5216225c827d02757a998cb08 Release 5.1.0.29V
1063177 I9b20f28f17dea1647a213b9f36060109264addf0 qcacld-3.0: Fix peer unmap/map handling during roaming
688141 I973a03e4d88ed9841e81f0609f840f5a6d59d105 Release 5.1.0.30F
1075090 I9513060929343a61c329e55e15f7e6ec18d1e166 qcacld-3.0: Fix -Wmissing-prototypes in dph_hash_table
688141 I6136df1242c6f94a3a95129cd58d118a25bf9c15 Release 5.1.0.30I
688141 I4f0f44bc22903fb4403c4794bd1b73109d9f6493 Release 5.1.0.30H
1074336 I26dd53307454d2c4dd887345eb77a9d362b5fdf2 qcacld-3.0: Fix -Wmissing-prototypes in wlan_hdd_softap_
993561 Ie53cfec7872ab69530bbb8932f9f9e85fb319f92 qcacld-3.0: Fix buffer overwrite problem in CCXBEACONREQ
688141 I524c0c9896eedb0e9907efb739d4e8392440de2e Release 5.1.0.30B
688141 I3f16e78cf03ed587ec6c7482c76164f61431640b Release 5.1.0.30L
1074336 I89f3273ff3d2bf3f68d1e8c39dd967e07637b265 qcacld-3.0: Fix -Wmissing-prototypes in wlan_hdd_assoc
688141 I7625c975d6f1be9198fb080426b46a3b781fd976 Release 5.1.0.29X
1065451 I735fe12230b6558123f73d68f09fd126bf0406d6 qcacld-3.0: Fix improper use of qdf_event_create
1074336 I35f793352b7a166018945f9a9ac8457bf58ee809 qcacld-3.0: Fix -Wmissing-prototypes in wlan_hdd_wext
688141 Ia7f974a488976d3a1d88332a9fee0d6525b6289a Release 5.1.0.29U
1075090 I399108d2e880631f60afec51d2c6472d623f907d qcacld-3.0: Fix -Wmissing-prototypes in lim_ibss_peer_mg
688141 I04084060c44f6f732c49533ed074a805606f160e Release 5.1.0.30
1075815 I67d62a358141c470176667429f982053d162c4f8 qcacld-3.0: Add support to configure the 80MHz preferenc
688141 I9de09b7de2a7f9751428a08d3a3fea5cd1201abf Release 5.1.0.30N
1075098 I48e4417998d75a7a42d6e55106896709016ac61c qcacld-3.0: Fix uninitialized variable use in cds_set_5g
1074146 I70b7576e7bf49fa66a8c88de49dad9a1643cc7cb qcacld-3.0: Null-check 5GHz band before configuration
1074336 Ie9252966d9b4bbb49d934516bae16ecc6a03f0f4 qcacld-3.0: Fix -Wmissing-prototypes in wlan_hdd_regulat
1075582 Id84eb7cf579a29da30f3366edef24821fcd5be55 qcacld-3.0: Cleanup qpower vendor command
688141 I82211cf75cc0b990207306bffbeb5d2836308d8c Release 5.1.0.30M
1074336 Ie23da29a1515249c04185ad4e146d8c9f4256c0f qcacld-3.0: Fix -Wmissing-prototypes in wlan_hdd_cfg
1075090 Ic2ff63f07d59d7242f0c37917201f239b00dfe37 qcacld-3.0: Fix -Wmissing-prototypes in lim_admit_contro
688141 I480aa1260718be59210d13be56d5d28a9df18a2c Release 5.1.0.30D
1076422 I2a2ba92ffb5b73c3ba4f54482d8f2b37f6e2dad6 qcacld-3.0: Fix potential reference of uninitialized roa
1073824 Ie1fb700577aee5f1b3a0d29277b81299a13dbde3 qcacld-3.0: Log suspend failure reasons
1074336 I27b2be04166a61579d0013766094c660cff304e2 qcacld-3.0: Fix -Wmissing-prototypes in wlan_hdd_tdls
1074336 Ifea057311a2fc0ec45d2137c2264311f8c9b2a3b qcacld-3.0: Fix -Wmissing-prototypes in wlan_hdd_p2p
1072885 I0155f29e879e1c2a46a8b9efbcaf160353bf9c05 qcacld-3.0: Detect duplicate session open request
1076096 Ib318d3821e7da0fb7b2887d935ec5f5c706e6263 qcacld-3.0: Parse timer params in setpno iwpriv command
1017278 If433aae949326af6a20df2190dd7356f211c4103 qcacld-3.0: Add ini to raise bug on SSR re-init failure
1074111 Ib8a6a8e8a8af842064f6500b4bb62266eae7c1f8 qcacld-3.0: Invalidate session ID after successful sessi
1074336 Ic1eaf337ff339e979c3f78e667be9539eb47f5dc qcacld-3.0: Fix -Wmissing-prototypes in wlan_hdd_tx_rx
688141 I6abc5adbedf2b7184c7d3544f855acd09842a4e2 Release 5.1.0.29Y
1033836 1074565 Icc0f5b576ff71776dc448a673b6e12defe0c514e qcacld-3.0: Fix mgmtFrameSessionId in lim_send_p2p_actio
688141 I6de44b9fb375325101161ec8a9587591047c5d1a Release 5.1.0.30K
688141 I3af91053db071b62137116ecd62c782fa9d05b7c Release 5.1.0.29W
1072839 Iffa57d592af7ac6af7f67d80b85a276aa8faee4e qcacld-3.0: Add range check for P2P NOA request paramete
688141 I403a76b07b94278931713de0018e437f2dd920d8 Release 5.1.0.30C
1071312 I30c5b388814de5fc02fd0352ef41c324216af705 qcacld-3.0: Make lim_process* messages static functions
1073756 I889d4e12a7c00b5fc6cb409bc077466019442456 qcacld-3.0: Cleanup code related to unit-test framework
1074336 I3b15af337185c28b2066e9d28e9e174cfc5ab76a qcacld-3.0: Fix -Wmissing-prototypes in wlan_hdd_hostapd
688141 Ib38370edae55460eeedd78ec3cbbc6c69c687061 Release 5.1.0.30A
1074336 I5f640761078b877732d00b7eddabbd21996bbc71 qcacld-3.0: Fix -Wmissing-prototypes in wlan_hdd_lro
1072234 I8b8c966b0130964c8e7de7967766629c955209d3 qcacld-3.0: Add SBS support in hw_mode_list
688141 Ie55bb1f87e160cc458b6052bcf2b4acf5f534600 Release 5.1.0.30O
688141 I7be14ba7785a0207fef21c2d4461c6c364c10e3d Release 5.1.0.29Z
940886 Id2a9d64e626288920e0d0a73badca9f9e241decb qcacld-3.0: Add ini to configure RTS profiles to FW
1071366 I5c88cb2544f74cb8c5e05b9178071ddbfaf2de23 qcacld-3.0: Remove unused message types
1075533 I701a9620ad93b41b5bcfd79d0c048f62e8151a18 qcacld-3.0: Fix -Wmissing-prototypes in BMI
1025185 Ie64a642abdd7923e91801186aa5743094a739fc9 qcacld-3.0: Validate CCXBEACONREQ IE fields
1075544 I40141f7a9e7394e0071b84b32a2d2b95cfa3a09b qcacld-3.0: Fix -Wmissing-prototypes in CDS
1074336 I37e98814da218d9322a8d3ac05a0e19523859281 qcacld-3.0: Fix -Wmissing-prototypes in wlan_hdd_tsf
688141 I6ac966108bfd0d8ba9d1c19d37dbfdab113f6a81 Release 5.1.0.30P
1074336 I8ebc518eed2c56764eb18ef6881e1fb344b2f0d4 qcacld-3.0: Fix -Wmissing-prototypes in wlan_hdd_power
1066077 I78114474d9ebe65e76840cb581389535f3486e4f qcacld-3.0: Clean up and refactor tdls module
688141 Ife2c057c1421e36ca09ae2cb14912e25a1cadf2d Release 5.1.0.30J
1074043 Ic526507d8adf87e580bd5c23ad2e68e2154c38a8 qcacld-3.0: Remove the processing for depreciated pktlog
1075090 I6c282c78da047a9979b90c52fdcfd7b1b7b3b46e qcacld-3.0: Fix -Wmissing-prototypes in cfg_api
950762 I5bdaab2e93d221ca15179d8b35e9a86619e9b489 qcacld-3.0: Add back these ese functions
688141 I94e9f3abe6498420711e832526d003ff2f443bc0 Release 5.1.0.29T
958534 I0d46a198f2abb87b4a4350b454deb98c5e3b8211 qcacld-3.0: Fix consecutive TDLS connection failure afte
688141 I566ee17f2d1f05bebb3ddb47c8e30c1a8a8aad6a Release 5.1.0.30G
1074336 Ib96b87acf019bc602adddb36f54792b872e2ad6e qcacld-3.0: Fix -Wmissing-prototypes in wlan_hdd_main
1074336 I6ebadd731e4d92a63025567ef75bc939faa0e546 qcacld-3.0: Fix -Wmissing-prototypes in wlan_hdd_debugfs
1075090 I232343baf74227d525f1004ab2d57fd3d68702d4 qcacld-3.0: Fix -Wmissing-prototypes in lim_process_asso
1075166 Ie666fd0881969a503e6b3635cdc5bb7f223776ec qcacld-3.0: Panic when wait for WMI_SERVICE_READY_EXT_EV
970761 I87ea8806a47730b553055e47bb3e7bdf0266b48f qcacld-3.0: Fix to send TDLS frames on peer sta index
1075102 Ib9163ca5dd89a7594c2e02b5f8c099ddbb5b3fc6 qcacld-3.0: Change RA Filtering to Enabled by Default
1074336 I877d7e7b7be30a9195daad63d09999bb87f4add4 qcacld-3.0: Fix -Wmissing-prototypes in wlan_hdd_scan
1074336 I749b17dfc313fa72da49116a5452a5c63102f718 qcacld-3.0: Fix -Wmissing-prototypes in wlan_hdd_cfg8021
1074336 I29c7ba3ef4e9eaa8a28268161a10f3b25249601d qcacld-3.0: Fix -Wmissing-prototypes in wlan_hdd_ext_sca
1075289 Iad32be5e11c345a542b8f8f6660987a4aff837c7 qcacld-3.0: Clean up obsolete WMA power API wma_set_qpow
Change-Id: I40422689abad992468448dd2a012afb78c08ec18
CRs-Fixed: 1073824, 1033836, 970761, 1071366, 1074565, 1075098, 1066077, 1075090, 1076096, 1075582, 1063177, 1075544, 958534, 1072234, 1075815, 1074336, 1074146, 940886, 1071312, 1073756, 1065451, 688141, 1076422, 1072885, 987047, 1075533, 1075289, 1072839, 1017278, 950762, 1074111, 1075166, 1075102, 1074043, 1025185, 993561
73 files changed, 1520 insertions, 868 deletions
diff --git a/core/bmi/src/bmi.c b/core/bmi/src/bmi.c index 4b88469782a3..33f5986cca0d 100644 --- a/core/bmi/src/bmi.c +++ b/core/bmi/src/bmi.c @@ -333,7 +333,7 @@ QDF_STATUS bmi_write_soc_register(uint32_t address, uint32_t param, return QDF_STATUS_SUCCESS; } -QDF_STATUS +static QDF_STATUS bmilz_data(uint8_t *buffer, uint32_t length, struct ol_context *ol_ctx) { uint32_t cid; @@ -455,7 +455,7 @@ QDF_STATUS bmi_sign_stream_start(uint32_t address, uint8_t *buffer, return QDF_STATUS_SUCCESS; } -QDF_STATUS +static QDF_STATUS bmilz_stream_start(uint32_t address, struct ol_context *ol_ctx) { uint32_t cid; diff --git a/core/bmi/src/ol_fw.c b/core/bmi/src/ol_fw.c index e6178a43d3ee..a5fbb0222b62 100644 --- a/core/bmi/src/ol_fw.c +++ b/core/bmi/src/ol_fw.c @@ -848,8 +848,8 @@ ol_check_dataset_patch(struct hif_opaque_softc *scn, uint32_t *address) } -QDF_STATUS ol_fw_populate_clk_settings(A_refclk_speed_t refclk, - struct cmnos_clock_s *clock_s) +static QDF_STATUS ol_fw_populate_clk_settings(A_refclk_speed_t refclk, + struct cmnos_clock_s *clock_s) { if (!clock_s) return QDF_STATUS_E_FAILURE; @@ -913,7 +913,7 @@ QDF_STATUS ol_fw_populate_clk_settings(A_refclk_speed_t refclk, return QDF_STATUS_SUCCESS; } -QDF_STATUS ol_patch_pll_switch(struct ol_context *ol_ctx) +static QDF_STATUS ol_patch_pll_switch(struct ol_context *ol_ctx) { struct hif_opaque_softc *hif = ol_ctx->scn; QDF_STATUS status = QDF_STATUS_SUCCESS; @@ -1207,7 +1207,7 @@ end: /* AXI Start Address */ #define TARGET_ADDR (0xa0000) -void ol_transfer_codeswap_struct(struct ol_context *ol_ctx) +static void ol_transfer_codeswap_struct(struct ol_context *ol_ctx) { struct pld_codeswap_codeseg_info wlan_codeswap; QDF_STATUS rv; @@ -1411,8 +1411,8 @@ QDF_STATUS ol_download_firmware(struct ol_context *ol_ctx) return status; } -int ol_diag_read(struct hif_opaque_softc *scn, uint8_t *buffer, - uint32_t pos, size_t count) +static int ol_diag_read(struct hif_opaque_softc *scn, uint8_t *buffer, + uint32_t pos, size_t count) { int result = 0; @@ -1549,6 +1549,7 @@ out: return result; } +static void ol_dump_target_memory(struct hif_opaque_softc *scn, void *memory_block) { char *buffer_loc = memory_block; diff --git a/core/cds/inc/cds_concurrency.h b/core/cds/inc/cds_concurrency.h index efe9f70622e0..951abffa6b0b 100644 --- a/core/cds/inc/cds_concurrency.h +++ b/core/cds/inc/cds_concurrency.h @@ -90,7 +90,7 @@ enum hw_mode_ss_config { /** * enum hw_mode_dbs_capab - DBS HW mode capability * @HW_MODE_DBS_NONE: Non DBS capable - * @HW_MODE_DBS: DFS capable + * @HW_MODE_DBS: DBS capable */ enum hw_mode_dbs_capab { HW_MODE_DBS_NONE, @@ -108,6 +108,16 @@ enum hw_mode_agile_dfs_capab { }; /** + * enum hw_mode_sbs_capab - SBS HW mode capability + * @HW_MODE_SBS_NONE: Non SBS capable + * @HW_MODE_SBS: SBS capable + */ +enum hw_mode_sbs_capab { + HW_MODE_SBS_NONE, + HW_MODE_SBS, +}; + +/** * enum cds_pcl_group_id - Identifies the pcl groups to be used * @CDS_PCL_GROUP_ID1_ID2: Use weights of group1 and group2 * @CDS_PCL_GROUP_ID2_ID2: Use weights of group2 and group3 @@ -592,8 +602,22 @@ struct cds_conc_connection_info { bool cds_is_connection_in_progress(void); void cds_dump_concurrency_info(void); + +#ifdef FEATURE_WLAN_TDLS bool cds_check_is_tdls_allowed(enum tQDF_ADAPTER_MODE device_mode); void cds_set_tdls_ct_mode(hdd_context_t *hdd_ctx); +#else +static inline bool cds_check_is_tdls_allowed(enum tQDF_ADAPTER_MODE device_mode) +{ + return false; +} + +static inline void cds_set_tdls_ct_mode(hdd_context_t *hdd_ctx) +{ + +} +#endif + void cds_set_concurrency_mode(enum tQDF_ADAPTER_MODE mode); void cds_clear_concurrency_mode(enum tQDF_ADAPTER_MODE mode); uint32_t cds_get_connection_count(void); @@ -766,6 +790,7 @@ QDF_STATUS cds_pdev_set_hw_mode(uint32_t session_id, enum hw_mode_bandwidth mac1_bw, enum hw_mode_dbs_capab dbs, enum hw_mode_agile_dfs_capab dfs, + enum hw_mode_sbs_capab sbs, enum sir_conn_update_reason reason); enum cds_conc_next_action cds_need_opportunistic_upgrade(void); QDF_STATUS cds_next_actions(uint32_t session_id, diff --git a/core/cds/src/cds_api.c b/core/cds/src/cds_api.c index 43a8ea336611..1cfb12871f5b 100644 --- a/core/cds/src/cds_api.c +++ b/core/cds/src/cds_api.c @@ -519,8 +519,8 @@ QDF_STATUS cds_pre_enable(v_CONTEXT_t cds_context) if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL, "Failed to get ready event from target firmware"); + QDF_BUG(0); htc_stop(gp_cds_context->htc_ctx); - QDF_ASSERT(0); return QDF_STATUS_E_FAILURE; } diff --git a/core/cds/src/cds_concurrency.c b/core/cds/src/cds_concurrency.c index 25155c2c18d5..d0034479540a 100644 --- a/core/cds/src/cds_concurrency.c +++ b/core/cds/src/cds_concurrency.c @@ -2485,8 +2485,8 @@ static void cds_pdev_set_hw_mode_cb(uint32_t status, hw_mode.mac0_tx_ss, hw_mode.mac0_rx_ss, hw_mode.mac0_bw); cds_info("MAC1: TxSS:%d, RxSS:%d, Bw:%d", hw_mode.mac1_tx_ss, hw_mode.mac1_rx_ss, hw_mode.mac1_bw); - cds_info("DBS:%d, Agile DFS:%d", - hw_mode.dbs_cap, hw_mode.agile_dfs_cap); + cds_info("DBS:%d, Agile DFS:%d, SBS:%d", + hw_mode.dbs_cap, hw_mode.agile_dfs_cap, hw_mode.sbs_cap); /* update conc_connection_list */ cds_update_hw_mode_conn_info(num_vdev_mac_entries, @@ -2544,8 +2544,8 @@ void cds_hw_mode_transition_cb(uint32_t old_hw_mode_index, hw_mode.mac0_tx_ss, hw_mode.mac0_rx_ss, hw_mode.mac0_bw); cds_info("MAC1: TxSS:%d, RxSS:%d, Bw:%d", hw_mode.mac1_tx_ss, hw_mode.mac1_rx_ss, hw_mode.mac1_bw); - cds_info("DBS:%d, Agile DFS:%d", - hw_mode.dbs_cap, hw_mode.agile_dfs_cap); + cds_info("DBS:%d, Agile DFS:%d, SBS:%d", + hw_mode.dbs_cap, hw_mode.agile_dfs_cap, hw_mode.sbs_cap); /* update conc_connection_list */ cds_update_hw_mode_conn_info(num_vdev_mac_entries, @@ -2564,6 +2564,7 @@ void cds_hw_mode_transition_cb(uint32_t old_hw_mode_index, * @mac1_bw: MAC1 bandwidth configuration * @dbs: HW DBS capability * @dfs: HW Agile DFS capability + * @sbs: HW SBS capability * @reason: Reason for connection update * * Sends the set hw mode to the SME module which will pass on @@ -2572,15 +2573,18 @@ void cds_hw_mode_transition_cb(uint32_t old_hw_mode_index, * e.g.: To configure 2x2_80 * mac0_ss = HW_MODE_SS_2x2, mac0_bw = HW_MODE_80_MHZ * mac1_ss = HW_MODE_SS_0x0, mac1_bw = HW_MODE_BW_NONE - * dbs = HW_MODE_DBS_NONE, dfs = HW_MODE_AGILE_DFS_NONE + * dbs = HW_MODE_DBS_NONE, dfs = HW_MODE_AGILE_DFS_NONE, + * sbs = HW_MODE_SBS_NONE * e.g.: To configure 1x1_80_1x1_40 (DBS) * mac0_ss = HW_MODE_SS_1x1, mac0_bw = HW_MODE_80_MHZ * mac1_ss = HW_MODE_SS_1x1, mac1_bw = HW_MODE_40_MHZ - * dbs = HW_MODE_DBS, dfs = HW_MODE_AGILE_DFS_NONE + * dbs = HW_MODE_DBS, dfs = HW_MODE_AGILE_DFS_NONE, + * sbs = HW_MODE_SBS_NONE * e.g.: To configure 1x1_80_1x1_40 (Agile DFS) * mac0_ss = HW_MODE_SS_1x1, mac0_bw = HW_MODE_80_MHZ * mac1_ss = HW_MODE_SS_1x1, mac1_bw = HW_MODE_40_MHZ - * dbs = HW_MODE_DBS, dfs = HW_MODE_AGILE_DFS + * dbs = HW_MODE_DBS, dfs = HW_MODE_AGILE_DFS, + * sbs = HW_MODE_SBS_NONE * * Return: Success if the message made it down to the next layer */ @@ -2591,6 +2595,7 @@ QDF_STATUS cds_pdev_set_hw_mode(uint32_t session_id, enum hw_mode_bandwidth mac1_bw, enum hw_mode_dbs_capab dbs, enum hw_mode_agile_dfs_capab dfs, + enum hw_mode_sbs_capab sbs, enum sir_conn_update_reason reason) { int8_t hw_mode_index; @@ -2618,7 +2623,7 @@ QDF_STATUS cds_pdev_set_hw_mode(uint32_t session_id, } hw_mode_index = wma_get_hw_mode_idx_from_dbs_hw_list(mac0_ss, - mac0_bw, mac1_ss, mac1_bw, dbs, dfs); + mac0_bw, mac1_ss, mac1_bw, dbs, dfs, sbs); if (hw_mode_index < 0) { cds_err("Invalid HW mode index obtained"); return QDF_STATUS_E_FAILURE; @@ -3340,6 +3345,7 @@ void cds_dump_concurrency_info(void) hdd_ctx->mcc_mode = !cds_current_concurrency_is_scc(); } +#ifdef FEATURE_WLAN_TDLS /* * cds_check_is_tdls_allowed() - check is tdls allowed or not * @adapter: pointer to adapter @@ -3419,6 +3425,7 @@ set_state: cds_info("enable_tdls_connection_tracker %d", hdd_ctx->enable_tdls_connection_tracker); } +#endif /** * cds_set_concurrency_mode() - To set concurrency mode @@ -3898,7 +3905,7 @@ void cds_decr_active_session(enum tQDF_ADAPTER_MODE mode, * * Return: None */ -void cds_dbs_opportunistic_timer_handler(void *data) +static void cds_dbs_opportunistic_timer_handler(void *data) { enum cds_conc_next_action action = CDS_NOP; cds_context_type *cds_ctx = (cds_context_type *)data; @@ -4056,7 +4063,7 @@ QDF_STATUS cds_init_policy_mgr(struct cds_sme_cbacks *sme_cbacks) * * Return: index in the connection table */ -uint32_t cds_get_connection_for_vdev_id(uint32_t vdev_id) +static uint32_t cds_get_connection_for_vdev_id(uint32_t vdev_id) { uint32_t conn_index = 0; for (conn_index = 0; conn_index < MAX_NUMBER_OF_CONC_CONNECTIONS; @@ -4401,6 +4408,7 @@ QDF_STATUS cds_decr_connection_count(uint32_t vdev_id) * * Return: QDF_STATUS */ +static QDF_STATUS cds_get_connection_channels(uint8_t *channels, uint32_t *len, enum cds_pcl_channel_order order, bool skip_dfs_channel, @@ -4612,10 +4620,11 @@ void cds_update_with_safe_channel_list(uint8_t *pcl_channels, uint32_t *len, * * Return: Channel List */ -QDF_STATUS cds_get_channel_list(enum cds_pcl_type pcl, - uint8_t *pcl_channels, uint32_t *len, - enum cds_con_mode mode, - uint8_t *pcl_weights, uint32_t weight_len) +static QDF_STATUS cds_get_channel_list(enum cds_pcl_type pcl, + uint8_t *pcl_channels, uint32_t *len, + enum cds_con_mode mode, + uint8_t *pcl_weights, + uint32_t weight_len) { QDF_STATUS status = QDF_STATUS_E_FAILURE; uint32_t num_channels = WNI_CFG_VALID_CHANNEL_LIST_LEN; @@ -5129,7 +5138,7 @@ QDF_STATUS cds_get_pcl(enum cds_con_mode mode, * * Return: True/False */ -bool cds_disallow_mcc(uint8_t channel) +static bool cds_disallow_mcc(uint8_t channel) { uint32_t index = 0; bool match = false; @@ -5164,7 +5173,8 @@ bool cds_disallow_mcc(uint8_t channel) * * Return: True/False */ -bool cds_allow_new_home_channel(uint8_t channel, uint32_t num_connections) +static bool cds_allow_new_home_channel(uint8_t channel, + uint32_t num_connections) { bool status = true; @@ -5239,7 +5249,7 @@ bool cds_is_ibss_conn_exist(uint8_t *ibss_channel) * * Return: true if vht160 connection exist else false */ -bool cds_vht160_conn_exist(void) +static bool cds_vht160_conn_exist(void) { uint32_t conn_index; bool status = false; @@ -6116,9 +6126,9 @@ done: * * Return: None */ -void cds_nss_update_cb(void *context, uint8_t tx_status, uint8_t vdev_id, - uint8_t next_action, - enum sir_conn_update_reason reason) +static void cds_nss_update_cb(void *context, uint8_t tx_status, uint8_t vdev_id, + uint8_t next_action, + enum sir_conn_update_reason reason) { cds_context_type *cds_ctx; uint32_t conn_index = 0; @@ -6165,9 +6175,9 @@ void cds_nss_update_cb(void *context, uint8_t tx_status, uint8_t vdev_id, * * Return: QDF_STATUS enum */ -QDF_STATUS cds_complete_action(uint8_t new_nss, uint8_t next_action, - enum sir_conn_update_reason reason, - uint32_t session_id) +static QDF_STATUS cds_complete_action(uint8_t new_nss, uint8_t next_action, + enum sir_conn_update_reason reason, + uint32_t session_id) { QDF_STATUS status = QDF_STATUS_E_FAILURE; uint32_t index, count; @@ -6304,6 +6314,7 @@ QDF_STATUS cds_next_actions(uint32_t session_id, HW_MODE_SS_1x1, HW_MODE_40_MHZ, HW_MODE_DBS, HW_MODE_AGILE_DFS_NONE, + HW_MODE_SBS_NONE, reason); break; case CDS_SINGLE_MAC_UPGRADE: @@ -6316,6 +6327,7 @@ QDF_STATUS cds_next_actions(uint32_t session_id, HW_MODE_SS_0x0, HW_MODE_BW_NONE, HW_MODE_DBS_NONE, HW_MODE_AGILE_DFS_NONE, + HW_MODE_SBS_NONE, reason); /* * check if we have a beaconing entity that advertised 2x2 @@ -6332,6 +6344,7 @@ QDF_STATUS cds_next_actions(uint32_t session_id, HW_MODE_SS_0x0, HW_MODE_BW_NONE, HW_MODE_DBS_NONE, HW_MODE_AGILE_DFS_NONE, + HW_MODE_SBS_NONE, reason); break; default: @@ -8136,7 +8149,7 @@ QDF_STATUS qdf_init_connection_update(void) * Return: No change (CDS_NOP), MCC (CDS_SINGLE_MAC_UPGRADE), * DBS (CDS_DBS_DOWNGRADE) */ -enum cds_conc_next_action cds_get_current_pref_hw_mode(void) +static enum cds_conc_next_action cds_get_current_pref_hw_mode(void) { uint32_t num_connections; uint8_t band1, band2, band3; diff --git a/core/cds/src/cds_reg_service.c b/core/cds/src/cds_reg_service.c index 32cfc719d767..302c670c0aca 100644 --- a/core/cds/src/cds_reg_service.c +++ b/core/cds/src/cds_reg_service.c @@ -449,8 +449,8 @@ static void cds_set_5g_channel_params(uint16_t oper_ch, { enum channel_state chan_state = CHANNEL_STATE_ENABLE; enum channel_state chan_state2 = CHANNEL_STATE_ENABLE; - const struct bonded_chan *bonded_chan_ptr; - const struct bonded_chan *bonded_chan_ptr2; + const struct bonded_chan *bonded_chan_ptr = NULL; + const struct bonded_chan *bonded_chan_ptr2 = NULL; if (CH_WIDTH_MAX <= ch_params->ch_width) ch_params->ch_width = CH_WIDTH_80P80MHZ; @@ -481,16 +481,19 @@ static void cds_set_5g_channel_params(uint16_t oper_ch, bonded_chan_40mhz_array, QDF_ARRAY_SIZE(bonded_chan_40mhz_array), &bonded_chan_ptr2); - if (oper_ch == bonded_chan_ptr2->start_ch) - ch_params->sec_ch_offset = + if (bonded_chan_ptr && bonded_chan_ptr2) { + if (oper_ch == + bonded_chan_ptr2->start_ch) + ch_params->sec_ch_offset = PHY_DOUBLE_CHANNEL_LOW_PRIMARY; - else - ch_params->sec_ch_offset = + else + ch_params->sec_ch_offset = PHY_DOUBLE_CHANNEL_HIGH_PRIMARY; - ch_params->center_freq_seg0 = - (bonded_chan_ptr->start_ch + - bonded_chan_ptr->end_ch)/2; + ch_params->center_freq_seg0 = + (bonded_chan_ptr->start_ch + + bonded_chan_ptr->end_ch)/2; + } } break; } @@ -501,8 +504,10 @@ static void cds_set_5g_channel_params(uint16_t oper_ch, chan_state = cds_search_5g_bonded_channel(oper_ch, CH_WIDTH_80MHZ, &bonded_chan_ptr); - ch_params->center_freq_seg0 = (bonded_chan_ptr->start_ch + - bonded_chan_ptr->end_ch)/2; + if (bonded_chan_ptr) + ch_params->center_freq_seg0 = + (bonded_chan_ptr->start_ch + + bonded_chan_ptr->end_ch)/2; } QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_INFO, "ch %d ch_wd %d freq0 %d freq1 %d", oper_ch, diff --git a/core/cds/src/cds_regdomain.c b/core/cds/src/cds_regdomain.c index e798389a5dd7..d8b90e47eb6c 100644 --- a/core/cds/src/cds_regdomain.c +++ b/core/cds/src/cds_regdomain.c @@ -692,25 +692,6 @@ int32_t cds_fill_some_regulatory_info(struct regulatory *reg) } /** - * get_reg_dmn_for_country() - get regulatory domain for country - * @alpha2: country alpha2 - * - * Return: regulatory domain - */ -int32_t get_reg_dmn_for_country(uint8_t *alpha2) -{ - uint8_t i; - - for (i = 0; i < g_reg_dmn_tbl.all_countries_cnt; i++) { - if ((g_reg_dmn_tbl.all_countries[i].alpha2[0] == alpha2[0]) && - (g_reg_dmn_tbl.all_countries[i].alpha2[1] == alpha2[1])) - return g_reg_dmn_tbl.all_countries[i].reg_dmn_pair; - } - - return -1; -} - -/** * cds_fill_and_send_ctl_to_fw() - fill and send ctl to firmware * @reg: the regulatory handle * @@ -779,28 +760,6 @@ void cds_set_wma_dfs_region(uint8_t dfs_region) } /** - * cds_get_reg_dmn_5g() - get the 5G reg-domain - * @reg_dmn: the complete reg domain - * - * Return: 5 G reg domain - */ -uint16_t cds_get_reg_dmn_5g(uint32_t reg_dmn) -{ - uint16_t i; - - for (i = 0; i < g_reg_dmn_tbl.reg_dmn_pairs_cnt; i++) { - if (g_reg_dmn_tbl.reg_dmn_pairs[i].reg_dmn_pair == reg_dmn) - return g_reg_dmn_tbl.reg_dmn_pairs[i].reg_dmn_5ghz; - } - - QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR, - "invalid regulatory domain/country code 0x%x", - reg_dmn); - - return 0; -} - -/** * cds_reg_dmn_get_chanwidth_from_opclass() - return chan width based on opclass * @country: country name * @channel: operating channel diff --git a/core/cds/src/cds_utils.c b/core/cds/src/cds_utils.c index 67d6d3f2494f..5ae79e495d9e 100644 --- a/core/cds/src/cds_utils.c +++ b/core/cds/src/cds_utils.c @@ -607,7 +607,7 @@ static void hmac_sha1_complete(struct crypto_async_request *req, int err) complete(&r->completion); } -int +static int hmac_sha1(uint8_t *key, uint8_t ksize, char *plaintext, uint8_t psize, uint8_t *output, uint8_t outlen) { @@ -768,7 +768,7 @@ static void hmac_md5_complete(struct crypto_async_request *req, int err) complete(&r->completion); } -int +static int hmac_md5(uint8_t *key, uint8_t ksize, char *plaintext, uint8_t psize, uint8_t *output, uint8_t outlen) { diff --git a/core/dp/txrx/ol_txrx.c b/core/dp/txrx/ol_txrx.c index 82c2b116b580..8f1a565cba35 100644 --- a/core/dp/txrx/ol_txrx.c +++ b/core/dp/txrx/ol_txrx.c @@ -1224,12 +1224,6 @@ ol_txrx_pdev_post_attach(ol_txrx_pdev_handle pdev) c_element->tx_desc.htt_frag_desc = htt_frag_desc; c_element->tx_desc.htt_frag_desc_paddr = frag_paddr; } - QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_INFO_LOW, - "%s:%d - %d FRAG VA 0x%p FRAG PA 0x%llx", - __func__, __LINE__, i, - c_element->tx_desc.htt_frag_desc, - (long long unsigned int) - c_element->tx_desc.htt_frag_desc_paddr); #ifdef QCA_SUPPORT_TXDESC_SANITY_CHECKS c_element->tx_desc.pkt_type = 0xff; #ifdef QCA_COMPUTE_TX_DELAY @@ -1750,6 +1744,7 @@ ol_txrx_vdev_attach(ol_txrx_pdev_handle pdev, uint8_t vdev_id, enum wlan_op_mode op_mode) { struct ol_txrx_vdev_t *vdev; + QDF_STATUS qdf_status; /* preconditions */ TXRX_ASSERT2(pdev); @@ -1809,6 +1804,7 @@ ol_txrx_vdev_attach(ol_txrx_pdev_handle pdev, /* Default MAX Q depth for every VDEV */ vdev->ll_pause.max_q_depth = ol_tx_cfg_max_tx_queue_depth_ll(vdev->pdev->ctrl_pdev); + qdf_status = qdf_event_create(&vdev->wait_delete_comp); /* add this vdev into the pdev's list */ TAILQ_INSERT_TAIL(&pdev->vdev_list, vdev, vdev_list_elem); @@ -1986,6 +1982,7 @@ ol_txrx_vdev_detach(ol_txrx_vdev_handle vdev, return; } qdf_spin_unlock_bh(&pdev->peer_ref_mutex); + qdf_event_destroy(&vdev->wait_delete_comp); TXRX_PRINT(TXRX_PRINT_LEVEL_INFO1, "%s: deleting vdev obj %p (%02x:%02x:%02x:%02x:%02x:%02x)\n", @@ -2111,7 +2108,7 @@ ol_txrx_peer_attach(ol_txrx_vdev_handle vdev, uint8_t *peer_mac_addr) peer_mac_addr[4], peer_mac_addr[5]); if (qdf_atomic_read(&temp_peer->delete_in_progress)) { vdev->wait_on_peer_id = temp_peer->local_id; - qdf_event_create(&vdev->wait_delete_comp); + qdf_event_reset(&vdev->wait_delete_comp); wait_on_deletion = true; } else { qdf_spin_unlock_bh(&pdev->peer_ref_mutex); @@ -2125,10 +2122,10 @@ ol_txrx_peer_attach(ol_txrx_vdev_handle vdev, uint8_t *peer_mac_addr) /* wait for peer deletion */ rc = qdf_wait_single_event(&vdev->wait_delete_comp, PEER_DELETION_TIMEOUT); - if (!rc) { + if (QDF_STATUS_SUCCESS != rc) { TXRX_PRINT(TXRX_PRINT_LEVEL_ERR, - "timedout waiting for peer(%d) deletion\n", - vdev->wait_on_peer_id); + "error waiting for peer(%d) deletion, status %d\n", + vdev->wait_on_peer_id, (int) rc); vdev->wait_on_peer_id = OL_TXRX_INVALID_LOCAL_PEER_ID; return NULL; } @@ -2787,15 +2784,15 @@ void ol_txrx_peer_unref_delete(ol_txrx_peer_handle peer) * concurrently with the empty check. */ qdf_spin_lock_bh(&pdev->peer_ref_mutex); + if (qdf_atomic_dec_and_test(&peer->ref_cnt)) { u_int16_t peer_id; TXRX_PRINT(TXRX_PRINT_LEVEL_ERR, - "Deleting peer %p (%02x:%02x:%02x:%02x:%02x:%02x)", + "Deleting peer %p (%pM) ref_cnt %d\n", peer, - peer->mac_addr.raw[0], peer->mac_addr.raw[1], - peer->mac_addr.raw[2], peer->mac_addr.raw[3], - peer->mac_addr.raw[4], peer->mac_addr.raw[5]); + peer->mac_addr.raw, + qdf_atomic_read(&peer->ref_cnt)); peer_id = peer->local_id; /* remove the reference to the peer from the hash table */ @@ -2946,14 +2943,15 @@ QDF_STATUS ol_txrx_clear_peer(uint8_t sta_id) } /** - * ol_txrx_peer_detach - Delete a peer's data object. - * @data_peer - the object to delete + * ol_txrx_peer_detach() - Delete a peer's data object. + * @peer - the object to detach * * When the host's control SW disassociates a peer, it calls - * this function to delete the peer's data object. The reference + * this function to detach and delete the peer. The reference * stored in the control peer object to the data peer * object (set up by a call to ol_peer_store()) is provided. * + * Return: None */ void ol_txrx_peer_detach(ol_txrx_peer_handle peer) { @@ -2989,9 +2987,12 @@ void ol_txrx_peer_detach(ol_txrx_peer_handle peer) qdf_spinlock_destroy(&peer->peer_info_lock); qdf_spinlock_destroy(&peer->bufq_lock); - /* set delete_in_progress to identify that wma - * is waiting for unmap massage for this peer */ + /* + * set delete_in_progress to identify that wma + * is waiting for unmap massage for this peer + */ qdf_atomic_set(&peer->delete_in_progress, 1); + /* * Remove the reference added during peer_attach. * The peer will still be left allocated until the @@ -3001,6 +3002,40 @@ void ol_txrx_peer_detach(ol_txrx_peer_handle peer) ol_txrx_peer_unref_delete(peer); } +/** + * ol_txrx_peer_detach_force_delete() - Detach and delete a peer's data object + * @peer - the object to detach + * + * Detach a peer and force the peer object to be removed. It is called during + * roaming scenario when the firmware has already deleted a peer. + * Peer object is freed immediately to avoid duplicate peers during roam sync + * indication processing. + * + * Return: None + */ +void ol_txrx_peer_detach_force_delete(ol_txrx_peer_handle peer) +{ + ol_txrx_pdev_handle pdev = peer->vdev->pdev; + + TXRX_PRINT(TXRX_PRINT_LEVEL_ERR, "%s peer %p, peer->ref_cnt %d", + __func__, peer, qdf_atomic_read(&peer->ref_cnt)); + + /* Clear the peer_id_to_obj map entries */ + qdf_spin_lock_bh(&pdev->peer_map_unmap_lock); + ol_txrx_peer_remove_obj_map_entries(pdev, peer); + qdf_spin_unlock_bh(&pdev->peer_map_unmap_lock); + + /* + * Set ref_cnt = 1 so that ol_txrx_peer_unref_delete() called by + * ol_txrx_peer_detach() will actually delete this peer entry properly. + */ + qdf_spin_lock_bh(&pdev->peer_ref_mutex); + qdf_atomic_set(&peer->ref_cnt, 1); + qdf_spin_unlock_bh(&pdev->peer_ref_mutex); + + ol_txrx_peer_detach(peer); +} + ol_txrx_peer_handle ol_txrx_peer_find_by_addr(struct ol_txrx_pdev_t *pdev, uint8_t *peer_mac_addr) { diff --git a/core/dp/txrx/ol_txrx.h b/core/dp/txrx/ol_txrx.h index e4d463db0e9c..daa4f0fde410 100644 --- a/core/dp/txrx/ol_txrx.h +++ b/core/dp/txrx/ol_txrx.h @@ -134,4 +134,5 @@ void htt_pkt_log_init(struct ol_txrx_pdev_t *handle, void *scn); QDF_STATUS ol_txrx_set_wisa_mode(ol_txrx_vdev_handle vdev, bool enable); void ol_txrx_update_mac_id(uint8_t vdev_id, uint8_t mac_id); +void ol_txrx_peer_detach_force_delete(ol_txrx_peer_handle peer); #endif /* _OL_TXRX__H_ */ diff --git a/core/dp/txrx/ol_txrx_peer_find.c b/core/dp/txrx/ol_txrx_peer_find.c index 37acb70c3aa8..f43670155242 100644 --- a/core/dp/txrx/ol_txrx_peer_find.c +++ b/core/dp/txrx/ol_txrx_peer_find.c @@ -327,14 +327,27 @@ static void ol_txrx_peer_find_map_detach(struct ol_txrx_pdev_t *pdev) qdf_mem_free(pdev->peer_id_to_obj_map); } -static inline void -ol_txrx_peer_find_add_id(struct ol_txrx_pdev_t *pdev, - uint8_t *peer_mac_addr, uint16_t peer_id) +/* + * ol_txrx_peer_find_add_id() - Add peer_id entry to peer + * + * @pdev: Handle to pdev object + * @peer_mac_addr: MAC address of peer provided by firmware + * @peer_id: peer_id provided by firmware + * + * Search for peer object for the MAC address, add the peer_id to + * its array of peer_id's and update the peer_id_to_obj map entry + * for that peer_id. Increment corresponding reference counts. + * + * Return: None + */ +static inline void ol_txrx_peer_find_add_id(struct ol_txrx_pdev_t *pdev, + uint8_t *peer_mac_addr, uint16_t peer_id) { struct ol_txrx_peer_t *peer; int status; int del_peer_ref = 0; int i; + bool found = false; /* check if there's already a peer object with this MAC address */ peer = @@ -366,10 +379,18 @@ ol_txrx_peer_find_add_id(struct ol_txrx_pdev_t *pdev, qdf_atomic_inc (&pdev->peer_id_to_obj_map[peer_id].peer_id_ref_cnt); - if (peer->peer_ids[0] == HTT_INVALID_PEER) + /* Check if entire peer_id array is empty */ + for (i = 0; i < MAX_NUM_PEER_ID_PER_PEER; i++) { + if (peer->peer_ids[i] != HTT_INVALID_PEER) { + found = true; + break; + } + } + if (!found) del_peer_ref = 1; - status = 1; + + /* find a place in peer_id array and insert peer_id */ for (i = 0; i < MAX_NUM_PEER_ID_PER_PEER; i++) { if (peer->peer_ids[i] == HTT_INVALID_PEER) { peer->peer_ids[i] = peer_id; @@ -506,7 +527,20 @@ void ol_txrx_peer_tx_ready_handler(ol_txrx_pdev_handle pdev, uint16_t peer_id) #endif - +/* + * ol_rx_peer_unmap_handler() - Handle peer unmap event from firmware + * + * @pdev: Handle to pdev pbject + * @peer_id: peer_id unmapped by firmware + * + * Decrement reference count for the peer_id in peer_id_to_obj_map, + * decrement reference count in corresponding peer object and clear the entry + * in peer's peer_ids array. + * In case of unmap events for a peer that is already deleted, just decrement + * del_peer_id_ref_cnt. + * + * Return: None + */ void ol_rx_peer_unmap_handler(ol_txrx_pdev_handle pdev, uint16_t peer_id) { struct ol_txrx_peer_t *peer; @@ -518,24 +552,39 @@ void ol_rx_peer_unmap_handler(ol_txrx_pdev_handle pdev, uint16_t peer_id) return; } - qdf_spin_lock(&pdev->peer_map_unmap_lock); + qdf_spin_lock_bh(&pdev->peer_map_unmap_lock); + if (qdf_atomic_read( + &pdev->peer_id_to_obj_map[peer_id].del_peer_id_ref_cnt)) { + /* This peer_id belongs to a peer already deleted */ + qdf_atomic_dec(&pdev->peer_id_to_obj_map[peer_id]. + del_peer_id_ref_cnt); + TXRX_PRINT(TXRX_PRINT_LEVEL_ERR, + "%s: Remove the ID %d reference to deleted peer. del_peer_id_ref_cnt %d", + __func__, peer_id, + qdf_atomic_read(&pdev->peer_id_to_obj_map[peer_id]. + del_peer_id_ref_cnt)); + qdf_spin_unlock_bh(&pdev->peer_map_unmap_lock); + return; + } peer = pdev->peer_id_to_obj_map[peer_id].peer; if (peer == NULL) { - /* - * Currently peer IDs are assigned for vdevs as well as peers. - * If the peer ID is for a vdev, then the peer pointer stored - * in peer_id_to_obj_map will be NULL. - */ - qdf_spin_unlock(&pdev->peer_map_unmap_lock); + /* + * Currently peer IDs are assigned for vdevs as well as peers. + * If the peer ID is for a vdev, then the peer pointer stored + * in peer_id_to_obj_map will be NULL. + */ + TXRX_PRINT(TXRX_PRINT_LEVEL_ERR, + "%s: peer not found for peer_id %d", + __func__, peer_id); + qdf_spin_unlock_bh(&pdev->peer_map_unmap_lock); return; } if (qdf_atomic_dec_and_test (&pdev->peer_id_to_obj_map[peer_id].peer_id_ref_cnt)) { pdev->peer_id_to_obj_map[peer_id].peer = NULL; - for (i = 0; i < MAX_NUM_PEER_ID_PER_PEER; i++) { if (peer->peer_ids[i] == peer_id) { peer->peer_ids[i] = HTT_INVALID_PEER; @@ -543,9 +592,6 @@ void ol_rx_peer_unmap_handler(ol_txrx_pdev_handle pdev, uint16_t peer_id) } } } - - qdf_spin_unlock(&pdev->peer_map_unmap_lock); - TXRX_PRINT(TXRX_PRINT_LEVEL_ERR, "%s: Remove the ID %d reference to peer %p peer_id_ref_cnt %d", __func__, peer_id, peer, @@ -557,6 +603,59 @@ void ol_rx_peer_unmap_handler(ol_txrx_pdev_handle pdev, uint16_t peer_id) * If there are no more references, delete the peer object. */ ol_txrx_peer_unref_delete(peer); + + qdf_spin_unlock_bh(&pdev->peer_map_unmap_lock); +} + +/** + * ol_txrx_peer_remove_obj_map_entries() - Remove matching pdev peer map entries + * @pdev: pdev handle + * @peer: peer to be removed + * + * Return: None + */ +void ol_txrx_peer_remove_obj_map_entries(ol_txrx_pdev_handle pdev, + struct ol_txrx_peer_t *peer) +{ + int i; + uint16_t peer_id; + int32_t peer_id_ref_cnt; + + for (i = 0; i < MAX_NUM_PEER_ID_PER_PEER; i++) { + peer_id = peer->peer_ids[i]; + if (peer_id == HTT_INVALID_PEER || + pdev->peer_id_to_obj_map[peer_id].peer == NULL) { + /* unused peer_id, or object is already dereferenced */ + continue; + } + if (pdev->peer_id_to_obj_map[peer_id].peer != peer) { + QDF_TRACE(QDF_MODULE_ID_TXRX, + QDF_TRACE_LEVEL_ERROR, + FL("peer pointer mismatch in peer_id_to_obj")); + continue; + } + peer_id_ref_cnt = qdf_atomic_read( + &pdev->peer_id_to_obj_map[peer_id]. + peer_id_ref_cnt); + QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_INFO_LOW, + FL("peer_id = %d, peer_id_ref_cnt = %d, index = %d"), + peer_id, peer_id_ref_cnt, i); + /* + * Transfer peer_id_ref_cnt into del_peer_id_ref_cnt so that + * ol_txrx_peer_unref_delete will decrement del_peer_id_ref_cnt + * and any map events will increment peer_id_ref_cnt. Otherwise + * accounting will be messed up. + * + * Add operation will ensure that back to back roaming in the + * middle of unmap/map event sequence will be accounted for. + */ + qdf_atomic_add(peer_id_ref_cnt, + &pdev->peer_id_to_obj_map[peer_id].del_peer_id_ref_cnt); + qdf_atomic_init(&pdev->peer_id_to_obj_map[peer_id]. + peer_id_ref_cnt); + pdev->peer_id_to_obj_map[peer_id].peer = NULL; + peer->peer_ids[i] = HTT_INVALID_PEER; + } } struct ol_txrx_peer_t *ol_txrx_assoc_peer_find(struct ol_txrx_vdev_t *vdev) @@ -623,4 +722,5 @@ void ol_txrx_peer_find_display(ol_txrx_pdev_handle pdev, int indent) } } } + #endif /* if TXRX_DEBUG_LEVEL */ diff --git a/core/dp/txrx/ol_txrx_peer_find.h b/core/dp/txrx/ol_txrx_peer_find.h index 43c2f141aac1..389c1764a3f5 100644 --- a/core/dp/txrx/ol_txrx_peer_find.h +++ b/core/dp/txrx/ol_txrx_peer_find.h @@ -107,6 +107,9 @@ void ol_txrx_peer_find_hash_erase(struct ol_txrx_pdev_t *pdev); struct ol_txrx_peer_t *ol_txrx_assoc_peer_find(struct ol_txrx_vdev_t *vdev); +void ol_txrx_peer_remove_obj_map_entries(ol_txrx_pdev_handle pdev, + struct ol_txrx_peer_t *peer); + #if defined(TXRX_DEBUG_LEVEL) && TXRX_DEBUG_LEVEL > 5 void ol_txrx_peer_find_display(ol_txrx_pdev_handle pdev, int indent); #else diff --git a/core/dp/txrx/ol_txrx_types.h b/core/dp/txrx/ol_txrx_types.h index 26ecfbafe83b..ee1bfb309a37 100644 --- a/core/dp/txrx/ol_txrx_types.h +++ b/core/dp/txrx/ol_txrx_types.h @@ -58,7 +58,7 @@ * multicast key the peer uses, and another ID to represent the * unicast key the peer uses. */ -#define MAX_NUM_PEER_ID_PER_PEER 8 +#define MAX_NUM_PEER_ID_PER_PEER 16 #define OL_TXRX_INVALID_NUM_PEERS (-1) @@ -484,9 +484,19 @@ struct ol_tx_flow_pool_t { #endif +/* + * struct ol_txrx_peer_id_map - Map of firmware peer_ids to peers on host + * @peer: Pointer to peer object + * @peer_id_ref_cnt: No. of firmware references to the peer_id + * @del_peer_id_ref_cnt: No. of outstanding unmap events for peer_id + * after the peer object is deleted on the host. + * + * peer_id is used as an index into the array of ol_txrx_peer_id_map. + */ struct ol_txrx_peer_id_map { struct ol_txrx_peer_t *peer; qdf_atomic_t peer_id_ref_cnt; + qdf_atomic_t del_peer_id_ref_cnt; }; /* diff --git a/core/hdd/inc/wlan_hdd_assoc.h b/core/hdd/inc/wlan_hdd_assoc.h index f49cb125ed54..bf87fcf37fb1 100644 --- a/core/hdd/inc/wlan_hdd_assoc.h +++ b/core/hdd/inc/wlan_hdd_assoc.h @@ -272,6 +272,7 @@ int hdd_set_genie_to_csr(hdd_adapter_t *pAdapter, eCsrAuthType *RSNAuthType); */ int hdd_set_csr_auth_type(hdd_adapter_t *pAdapter, eCsrAuthType RSNAuthType); +#ifdef FEATURE_WLAN_TDLS /** * hdd_roam_register_tdlssta() - register new TDLS station * @pAdapter: pointer to adapter @@ -287,6 +288,7 @@ int hdd_set_csr_auth_type(hdd_adapter_t *pAdapter, eCsrAuthType RSNAuthType); QDF_STATUS hdd_roam_register_tdlssta(hdd_adapter_t *pAdapter, const uint8_t *peerMac, uint16_t staId, uint8_t ucastSig, uint8_t qos); +#endif /** * hdd_perform_roam_set_key_complete() - perform set key complete diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index 7bbc547e51c0..9f3e1e44dc10 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -1098,6 +1098,14 @@ typedef enum { #define CFG_VHT_ENABLE_2x2_CAP_FEATURE_MAX (1) #define CFG_VHT_ENABLE_2x2_CAP_FEATURE_DEFAULT (0) +/* 0 - Connects in 160MHz 1x1 when AP is 160MHz 2x2 + * 1 - Connects in 80MHz 2x2 when AP is 160MHz 2x2 + */ +#define CFG_STA_PREFER_80MHZ_OVER_160MHZ "gStaPrefer80MHzOver160MHz" +#define CFG_STA_PREFER_80MHZ_OVER_160MHZ_MIN (0) +#define CFG_STA_PREFER_80MHZ_OVER_160MHZ_MAX (1) +#define CFG_STA_PREFER_80MHZ_OVER_160MHZ_DEFAULT (1) + /* * NSS cfg bit definition. * STA BIT[0:1] @@ -1279,6 +1287,21 @@ typedef enum { #define CFG_ENABLE_FW_MODULE_LOG_LEVEL "gFwDebugModuleLoglevel" #define CFG_ENABLE_FW_MODULE_LOG_DEFAULT "" +/* + * gEnableRTSProfiles for configuring different RTS profiles + * to firmware. + * Following are the valid values for the rtsprofile: + * RTSCTS_DISABLED 0 + * RTSCTS_ENABLED_4_SECOND_RATESERIES 17 + * CTS2SELF_ENABLED_4_SECOND_RATESERIES 18 + * RTSCTS_ENABLED_4_SWRETRIES 33 + * CTS2SELF_ENABLED_4_SWRETRIES 34 + */ +#define CFG_ENABLE_FW_RTS_PROFILE "gEnableRTSProfiles" +#define CFG_ENABLE_FW_RTS_PROFILE_MIN (0) +#define CFG_ENABLE_FW_RTS_PROFILE_MAX (34) +#define CFG_ENABLE_FW_RTS_PROFILE_DEFAULT (33) + #ifdef FEATURE_GREEN_AP #define CFG_ENABLE_GREEN_AP_FEATURE "gEnableGreenAp" #define CFG_ENABLE_GREEN_AP_FEATURE_MIN (0) @@ -2370,7 +2393,7 @@ typedef enum { #define CFG_RA_FILTER_ENABLE_NAME "gRAFilterEnable" #define CFG_RA_FILTER_ENABLE_MIN (0) #define CFG_RA_FILTER_ENABLE_MAX (1) -#define CFG_RA_FILTER_ENABLE_DEFAULT (0) +#define CFG_RA_FILTER_ENABLE_DEFAULT (1) #define CFG_RA_RATE_LIMIT_INTERVAL_NAME "gRArateLimitInterval" #define CFG_RA_RATE_LIMIT_INTERVAL_MIN (60) @@ -3406,6 +3429,18 @@ enum dot11p_mode { #define CFG_ADAPTIVE_EXTSCAN_DWELL_MODE_DEFAULT (0) /* + * This parameter will help to debug ssr reinit failure issues + * by raising vos bug so dumps can be collected. If OEM + * wants to avoid this crash, just disable this parameter. + * wlan driver will only recover after driver unload and load. + * Default: Enable + */ +#define CFG_BUG_ON_REINIT_FAILURE_NAME "g_bug_on_reinit_failure" +#define CFG_BUG_ON_REINIT_FAILURE_MIN (0) +#define CFG_BUG_ON_REINIT_FAILURE_MAX (1) +#define CFG_BUG_ON_REINIT_FAILURE_DEFAULT (1) + +/* * This parameter will set the algo used in dwell time optimization during * pno scan. see enum wmi_dwelltime_adaptive_mode. * Acceptable values for this: @@ -4012,6 +4047,9 @@ struct hdd_config { uint32_t enableFwLogLevel; uint8_t enableFwModuleLogLevel[FW_MODULE_LOG_LEVEL_STRING_LENGTH]; + /* RTS profile parameter */ + uint32_t rts_profile; + #ifdef WLAN_FEATURE_11W uint32_t pmfSaQueryMaxRetries; uint32_t pmfSaQueryRetryInterval; @@ -4178,6 +4216,7 @@ struct hdd_config { uint8_t adapt_dwell_passive_mon_intval; uint8_t adapt_dwell_wifi_act_threshold; bool bug_report_for_no_scan_results; + bool bug_on_reinit_failure; #ifdef WLAN_FEATURE_NAN_DATAPATH bool enable_nan_datapath; uint8_t nan_datapath_ndi_channel; @@ -4194,6 +4233,7 @@ struct hdd_config { bool enable_go_cts2self_for_sta; uint32_t tx_aggregation_size; uint32_t rx_aggregation_size; + bool sta_prefer_80MHz_over_160MHz; }; #define VAR_OFFSET(_Struct, _Var) (offsetof(_Struct, _Var)) diff --git a/core/hdd/inc/wlan_hdd_driver_ops.h b/core/hdd/inc/wlan_hdd_driver_ops.h index f919e8decf1c..34c8c118c014 100644 --- a/core/hdd/inc/wlan_hdd_driver_ops.h +++ b/core/hdd/inc/wlan_hdd_driver_ops.h @@ -37,9 +37,50 @@ */ int wlan_hdd_register_driver(void); void wlan_hdd_unregister_driver(void); + +/** + * wlan_hdd_bus_suspend() - suspend the wlan bus + * + * This function is called by the platform driver to suspend the + * wlan bus + * + * @state: state + * + * Return: QDF_STATUS + */ int wlan_hdd_bus_suspend(pm_message_t state); + +/** + * wlan_hdd_bus_suspend_noirq() - handle .suspend_noirq callback + * + * This function is called by the platform driver to complete the + * bus suspend callback when device interrupts are disabled by kernel. + * Call HIF and WMA suspend_noirq callbacks to make sure there is no + * wake up pending from FW before allowing suspend. + * + * Return: 0 for success and -EBUSY if FW is requesting wake up + */ int wlan_hdd_bus_suspend_noirq(void); + +/** + * wlan_hdd_bus_resume(): wake up the bus + * + * This function is called by the platform driver to resume wlan + * bus + * + * Return: void + */ int wlan_hdd_bus_resume(void); + +/** + * wlan_hdd_bus_resume_noirq(): handle bus resume no irq + * + * This function is called by the platform driver to do bus + * resume no IRQ before calling resume callback. Call WMA and HIF + * layers to complete the resume_noirq. + * + * Return: 0 for success and negative error code for failure + */ int wlan_hdd_bus_resume_noirq(void); void hdd_hif_close(void *hif_ctx); int hdd_hif_open(struct device *dev, void *bdev, const hif_bus_id *bid, diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 6f263d2b1b64..284cb7bce939 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -54,9 +54,7 @@ #include <linux/wakelock.h> #endif #include <wlan_hdd_ftm.h> -#ifdef FEATURE_WLAN_TDLS #include "wlan_hdd_tdls.h" -#endif #include "wlan_hdd_tsf.h" #include "wlan_hdd_cfg80211.h" #include <qdf_defer.h> @@ -1237,8 +1235,25 @@ struct acs_dfs_policy { uint8_t acs_channel; }; -/** Adapter structure definition */ +/** + * enum suspend_fail_reason: Reasons a WLAN suspend might fail + * SUSPEND_FAIL_IPA: IPA in progress + * SUSPEND_FAIL_RADAR: radar scan in progress + * SUSPEND_FAIL_ROAM: roaming in progress + * SUSPEND_FAIL_SCAN: scan in progress + * SUSPEND_FAIL_INITIAL_WAKEUP: received initial wakeup from firmware + * SUSPEND_FAIL_MAX_COUNT: the number of wakeup reasons, always at the end + */ +enum suspend_fail_reason { + SUSPEND_FAIL_IPA, + SUSPEND_FAIL_RADAR, + SUSPEND_FAIL_ROAM, + SUSPEND_FAIL_SCAN, + SUSPEND_FAIL_INITIAL_WAKEUP, + SUSPEND_FAIL_MAX_COUNT +}; +/** Adapter structure definition */ struct hdd_context_s { /** Global CDS context */ v_CONTEXT_t pcds_context; @@ -1512,6 +1527,9 @@ struct hdd_context_s { bool update_mac_addr_to_fw; struct acs_dfs_policy acs_policy; uint16_t wmi_max_len; + + /* counters for failed suspend reasons */ + uint32_t suspend_fail_stats[SUSPEND_FAIL_MAX_COUNT]; }; /*--------------------------------------------------------------------------- diff --git a/core/hdd/inc/wlan_hdd_power.h b/core/hdd/inc/wlan_hdd_power.h index 61f4d6d490c9..abb69bd56e66 100644 --- a/core/hdd/inc/wlan_hdd_power.h +++ b/core/hdd/inc/wlan_hdd_power.h @@ -199,6 +199,20 @@ static inline void hdd_wlan_suspend_resume_event(uint8_t state) {} #endif /* FEATURE_WLAN_DIAG_SUPPORT */ +/** + * wlan_hdd_inc_suspend_stats() - Prints, then increments, then prints suspend + * failed statistics. + * @hdd_ctx: The HDD context to operate on + * @reason: The suspend failed reason to increment + * + * This function prints all of the suspend failed statistics, increments the + * specified suspend fail reason statistic, and prints the them all again. This + * is for easily keeping track of the most common reasons suspend fails. + * + * Return: none + */ +void wlan_hdd_inc_suspend_stats(hdd_context_t *hdd_ctx, + enum suspend_fail_reason reason); /* * Unit-test suspend/resume is a testing feature that allows putting firmware @@ -208,7 +222,20 @@ void hdd_wlan_suspend_resume_event(uint8_t state) {} * enabling/disabling appropriate copy engine irqs. */ #ifdef WLAN_SUSPEND_RESUME_TEST +/** + * hdd_wlan_fake_apps_resume() - Resume from unit-test triggered suspend + * @wiphy: wiphy struct from a validated hdd context + * + * Return: Zero on success, calls QDF_BUG() on failure + */ int hdd_wlan_fake_apps_resume(struct wiphy *wiphy); + +/** + * hdd_wlan_fake_apps_suspend() - Initiate a unit-test triggered suspend + * @wiphy: wiphy struct from a validated hdd context + * + * Return: Zero on success, suspend related non-zero error code on failure + */ int hdd_wlan_fake_apps_suspend(struct wiphy *wiphy); #else static inline int hdd_wlan_fake_apps_resume(struct wiphy *wiphy) diff --git a/core/hdd/inc/wlan_hdd_tdls.h b/core/hdd/inc/wlan_hdd_tdls.h index 37e6243d572a..ca4d30cdb2c7 100644 --- a/core/hdd/inc/wlan_hdd_tdls.h +++ b/core/hdd/inc/wlan_hdd_tdls.h @@ -567,7 +567,7 @@ void wlan_hdd_tdls_disconnection_callback(hdd_adapter_t *pAdapter); void wlan_hdd_tdls_mgmt_completion_callback(hdd_adapter_t *pAdapter, uint32_t statusCode); -void wlan_hdd_tdls_tncrement_peer_count(hdd_adapter_t *pAdapter); +void wlan_hdd_tdls_increment_peer_count(hdd_adapter_t *pAdapter); void wlan_hdd_tdls_decrement_peer_count(hdd_adapter_t *pAdapter); @@ -710,8 +710,33 @@ void hdd_tdls_context_destroy(hdd_context_t *hdd_ctx); int wlan_hdd_tdls_antenna_switch(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter, uint32_t mode); -hdd_adapter_t *wlan_hdd_tdls_check_and_enable(hdd_context_t *hdd_ctx); +/** + * wlan_hdd_tdls_notify_connect() - Update tdls state for every + * connect event. + * @adapter: hdd adapter + * @csr_roam_info: csr information + * + * After every connect event in the system, check whether TDLS + * can be enabled in the system. If TDLS can be enabled, update the + * TDLS state as needed. + * + * Return: None + */ +void wlan_hdd_tdls_notify_connect(hdd_adapter_t *adapter, + tCsrRoamInfo *csr_roam_info); +/** + * wlan_hdd_tdls_notify_disconnect() - Update tdls state for every + * disconnect event. + * @adapter: hdd adapter + * + * After every disconnect event in the system, check whether TDLS + * can be disabled/enabled in the system and update the + * TDLS state as needed. + * + * Return: None + */ +void wlan_hdd_tdls_notify_disconnect(hdd_adapter_t *adapter); #else static inline void hdd_tdls_notify_mode_change(hdd_adapter_t *adapter, @@ -742,19 +767,18 @@ static inline int wlan_hdd_tdls_antenna_switch(hdd_context_t *hdd_ctx, { return 0; } - -static inline hdd_adapter_t *wlan_hdd_tdls_check_and_enable( - hdd_context_t *hdd_ctx) -{ - return NULL; -} - static inline void wlan_hdd_update_tdls_info(hdd_adapter_t *adapter, bool tdls_prohibited, bool tdls_chan_swit_prohibited) { } - +static inline void wlan_hdd_tdls_notify_connect(hdd_adapter_t *adapter, + tCsrRoamInfo *csr_roam_info) +{ +} +static inline void wlan_hdd_tdls_notify_disconnect(hdd_adapter_t *adapter) +{ +} #endif /* End of FEATURE_WLAN_TDLS */ #ifdef FEATURE_WLAN_DIAG_SUPPORT diff --git a/core/hdd/inc/wlan_hdd_tsf.h b/core/hdd/inc/wlan_hdd_tsf.h index d53741ef1825..45e25223a505 100644 --- a/core/hdd/inc/wlan_hdd_tsf.h +++ b/core/hdd/inc/wlan_hdd_tsf.h @@ -61,6 +61,7 @@ enum hdd_tsf_capture_state { }; #ifdef WLAN_FEATURE_TSF +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, diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c index e008534fb224..d8f35f4ecd79 100644 --- a/core/hdd/src/wlan_hdd_assoc.c +++ b/core/hdd/src/wlan_hdd_assoc.c @@ -47,9 +47,7 @@ #include "wlan_hdd_cfg80211.h" #include "csr_inside_api.h" #include "wlan_hdd_p2p.h" -#ifdef FEATURE_WLAN_TDLS #include "wlan_hdd_tdls.h" -#endif #include "sme_api.h" #include "wlan_hdd_hostapd.h" #include <wlan_hdd_ipa.h> @@ -1191,7 +1189,6 @@ static void hdd_send_association_event(struct net_device *dev, int we_event; char *msg; struct qdf_mac_addr peerMacAddr; - hdd_adapter_t *tdls_adapter; /* Added to find the auth type on the fly at run time */ /* rather than with cfg to see if FT is enabled */ @@ -1282,14 +1279,8 @@ static void hdd_send_association_event(struct net_device *dev, pAdapter->sessionId, &chan_info, pAdapter->device_mode); - - hdd_info("Assoc: Check and enable or disable TDLS state "); - if ((pAdapter->device_mode == QDF_STA_MODE || - pAdapter->device_mode == QDF_P2P_CLIENT_MODE) && - !pHddCtx->concurrency_marked) - wlan_hdd_update_tdls_info(pAdapter, - pCsrRoamInfo->tdls_prohibited, - pCsrRoamInfo->tdls_chan_swit_prohibited); + /* Update tdls module about connection event */ + wlan_hdd_tdls_notify_connect(pAdapter, pCsrRoamInfo); #ifdef MSM_PLATFORM #if defined(CONFIG_ICNSS) || defined(CONFIG_CNSS) @@ -1335,24 +1326,9 @@ static void hdd_send_association_event(struct net_device *dev, pAdapter->device_mode); } hdd_lpass_notify_disconnect(pAdapter); -#ifdef FEATURE_WLAN_TDLS - hdd_info("Disassoc: Check and enable or disable TDLS state "); - if ((pAdapter->device_mode == QDF_STA_MODE || - pAdapter->device_mode == QDF_P2P_CLIENT_MODE) && - !pHddCtx->concurrency_marked) { - wlan_hdd_update_tdls_info(pAdapter, - true, - true); - } - if (!pHddCtx->concurrency_marked) { - tdls_adapter = wlan_hdd_tdls_check_and_enable( - pHddCtx); - if (NULL != tdls_adapter) - wlan_hdd_update_tdls_info(tdls_adapter, - false, - false); - } -#endif + /* Update tdls module about the disconnection event */ + wlan_hdd_tdls_notify_disconnect(pAdapter); + #ifdef MSM_PLATFORM /* stop timer in sta/p2p_cli */ spin_lock_bh(&pHddCtx->bus_bw_lock); @@ -1449,7 +1425,7 @@ QDF_STATUS hdd_roam_deregister_sta(hdd_adapter_t *pAdapter, uint8_t staId) * * Return: None */ -void hdd_print_bss_info(hdd_station_ctx_t *hdd_sta_ctx) +static void hdd_print_bss_info(hdd_station_ctx_t *hdd_sta_ctx) { uint32_t *cap_info; @@ -1709,7 +1685,7 @@ static QDF_STATUS hdd_dis_connect_handler(hdd_adapter_t *pAdapter, * * Return: None */ -void hdd_set_peer_authorized_event(uint32_t vdev_id) +static void hdd_set_peer_authorized_event(uint32_t vdev_id) { hdd_context_t *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); hdd_adapter_t *adapter = NULL; @@ -1924,6 +1900,8 @@ static void hdd_send_re_assoc_event(struct net_device *dev, tCsrRoamConnectedProfile roam_profile; tHalHandle hal_handle = WLAN_HDD_GET_HAL_CTX(pAdapter); + qdf_mem_zero(&roam_profile, sizeof(roam_profile)); + if (!rspRsnIe) { hdd_err("Unable to allocate RSN IE"); goto done; @@ -1975,7 +1953,6 @@ static void hdd_send_re_assoc_event(struct net_device *dev, chan = ieee80211_get_channel(pAdapter->wdev.wiphy, (int)pCsrRoamInfo->pBssDesc->channelId); - qdf_mem_zero(&roam_profile, sizeof(tCsrRoamConnectedProfile)); sme_roam_get_connect_profile(hal_handle, pAdapter->sessionId, &roam_profile); bss = cfg80211_get_bss(pAdapter->wdev.wiphy, chan, @@ -3634,6 +3611,8 @@ hdd_roam_tdls_status_update_handler(hdd_adapter_t *pAdapter, if (eSIR_SME_SUCCESS != pRoamInfo->statusCode) { hdd_err("Add Sta failed. status code(=%d)", pRoamInfo->statusCode); + pAdapter->tdlsAddStaStatus = QDF_STATUS_E_FAILURE; + } else { /* * Check if there is available index for this new TDLS @@ -4035,6 +4014,23 @@ hdd_roam_tdls_status_update_handler(hdd_adapter_t *pAdapter, return status; } +#else + +static inline QDF_STATUS hdd_roam_deregister_tdlssta(hdd_adapter_t *pAdapter, + uint8_t staId) +{ + return QDF_STATUS_SUCCESS; +} + +static inline QDF_STATUS +hdd_roam_tdls_status_update_handler(hdd_adapter_t *pAdapter, + tCsrRoamInfo *pRoamInfo, + uint32_t roamId, + eRoamCmdStatus roamStatus, + eCsrRoamResult roamResult) +{ + return QDF_STATUS_SUCCESS; +} #endif #ifdef WLAN_FEATURE_11W diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index 27b227ec7751..1b99f3c6ae1b 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -2029,6 +2029,13 @@ REG_TABLE_ENTRY g_registry_table[] = { CFG_VDEV_TYPE_NSS_2G_MIN, CFG_VDEV_TYPE_NSS_2G_MAX), + REG_VARIABLE(CFG_STA_PREFER_80MHZ_OVER_160MHZ, WLAN_PARAM_Integer, + struct hdd_config, sta_prefer_80MHz_over_160MHz, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_STA_PREFER_80MHZ_OVER_160MHZ_DEFAULT, + CFG_STA_PREFER_80MHZ_OVER_160MHZ_MIN, + CFG_STA_PREFER_80MHZ_OVER_160MHZ_MAX), + REG_VARIABLE(CFG_VDEV_TYPE_NSS_5G, WLAN_PARAM_Integer, struct hdd_config, vdev_type_nss_5g, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, @@ -3052,6 +3059,13 @@ REG_TABLE_ENTRY g_registry_table[] = { CFG_ENABLE_FW_DEBUG_LOG_LEVEL_MIN, CFG_ENABLE_FW_DEBUG_LOG_LEVEL_MAX), + REG_VARIABLE(CFG_ENABLE_FW_RTS_PROFILE, WLAN_PARAM_Integer, + struct hdd_config, rts_profile, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_ENABLE_FW_RTS_PROFILE_DEFAULT, + CFG_ENABLE_FW_RTS_PROFILE_MIN, + CFG_ENABLE_FW_RTS_PROFILE_MAX), + REG_VARIABLE_STRING(CFG_ENABLE_FW_MODULE_LOG_LEVEL, WLAN_PARAM_String, struct hdd_config, enableFwModuleLogLevel, VAR_FLAGS_OPTIONAL, @@ -3965,6 +3979,14 @@ REG_TABLE_ENTRY g_registry_table[] = { CFG_INDOOR_CHANNEL_SUPPORT_MIN, CFG_INDOOR_CHANNEL_SUPPORT_MAX), + REG_VARIABLE(CFG_BUG_ON_REINIT_FAILURE_NAME, WLAN_PARAM_Integer, + struct hdd_config, bug_on_reinit_failure, + VAR_FLAGS_OPTIONAL | + VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_BUG_ON_REINIT_FAILURE_DEFAULT, + CFG_BUG_ON_REINIT_FAILURE_MIN, + CFG_BUG_ON_REINIT_FAILURE_MAX), + REG_VARIABLE(CFG_INTERFACE_CHANGE_WAIT_NAME, WLAN_PARAM_Integer, struct hdd_config, iface_change_wait_time, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK, @@ -5590,6 +5612,9 @@ void hdd_cfg_print(hdd_context_t *pHddCtx) hdd_info("Name = [%s] Value = [%u]", CFG_IDLE_TIME_NAME, pHddCtx->config->idle_time_conc); + hdd_info("Name = [%s] Value = [%d]", + CFG_BUG_ON_REINIT_FAILURE_NAME, + pHddCtx->config->bug_on_reinit_failure); hdd_info("Name = [%s] Value = [%u]", CFG_INTERFACE_CHANGE_WAIT_NAME, pHddCtx->config->iface_change_wait_time); @@ -5857,7 +5882,7 @@ static void hdd_override_all_ps(hdd_context_t *hdd_ctx) * * Return: none */ -void hdd_set_rx_mode_value(hdd_context_t *hdd_ctx) +static void hdd_set_rx_mode_value(hdd_context_t *hdd_ctx) { if (hdd_ctx->config->rx_mode & CFG_ENABLE_RX_THREAD && hdd_ctx->config->rx_mode & CFG_ENABLE_RPS) { @@ -6125,8 +6150,9 @@ static QDF_STATUS hdd_convert_string_to_array(char *str, uint8_t *array, * * Return: QDF_STATUS */ -QDF_STATUS hdd_hex_string_to_u8_array(char *str, uint8_t *hex_array, - uint8_t *len, uint8_t array_max_len) +static QDF_STATUS hdd_hex_string_to_u8_array(char *str, uint8_t *hex_array, + uint8_t *len, + uint8_t array_max_len) { return hdd_convert_string_to_array(str, hex_array, len, array_max_len, true); diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 1d40f77e2804..8e18bcd66c0b 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -2068,11 +2068,13 @@ static int __wlan_hdd_cfg80211_get_concurrency_matrix(struct wiphy *wiphy, /* Fill feature combination matrix */ feature_sets = 0; feature_set_matrix[feature_sets++] = WIFI_FEATURE_INFRA | - WIFI_FEATURE_P2P; + WIFI_FEATURE_P2P; + feature_set_matrix[feature_sets++] = WIFI_FEATURE_INFRA | + WIFI_FEATURE_NAN; /* Add more feature combinations here */ feature_sets = QDF_MIN(feature_sets, max_feature_sets); - hdd_info("Number of feature sets:%d", feature_sets); + hdd_info("Number of feature sets: %d", feature_sets); hdd_info("Feature set matrix"); for (i = 0; i < feature_sets; i++) hdd_info("[%d] 0x%02X", i, feature_set_matrix[i]); @@ -2135,7 +2137,8 @@ wlan_hdd_cfg80211_get_concurrency_matrix(struct wiphy *wiphy, * This is called to turn ON or SET the feature flag for the requested feature. **/ #define NUM_BITS_IN_BYTE 8 -void wlan_hdd_cfg80211_set_feature(uint8_t *feature_flags, uint8_t feature) +static void wlan_hdd_cfg80211_set_feature(uint8_t *feature_flags, + uint8_t feature) { uint32_t index; uint8_t bit_mask; @@ -3932,7 +3935,7 @@ __wlan_hdd_cfg80211_wifi_configuration_set(struct wiphy *wiphy, u32 guard_time; uint8_t set_value; u32 ftm_capab; - uint8_t qpower; + u8 qpower; QDF_STATUS status; int attr_len; int access_policy = 0; @@ -6607,10 +6610,10 @@ static int wlan_hdd_sap_get_nol(hdd_adapter_t *ap_adapter, uint8_t *nol, * * Return: Zero on success and non zero value on error */ -int wlan_hdd_validate_and_get_pre_cac_ch(hdd_context_t *hdd_ctx, - hdd_adapter_t *ap_adapter, - uint8_t channel, - uint8_t *pre_cac_chan) +static int wlan_hdd_validate_and_get_pre_cac_ch(hdd_context_t *hdd_ctx, + hdd_adapter_t *ap_adapter, + uint8_t channel, + uint8_t *pre_cac_chan) { uint32_t i, j; QDF_STATUS status; @@ -10423,6 +10426,7 @@ static int wlan_hdd_cfg80211_set_default_key(struct wiphy *wiphy, * Return: bss found in kernel cache */ #if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 1, 0)) && !defined(WITH_BACKPORTS) +static struct cfg80211_bss *wlan_hdd_cfg80211_get_bss(struct wiphy *wiphy, struct ieee80211_channel *channel, const u8 *bssid, const u8 *ssid, size_t ssid_len) @@ -10434,6 +10438,7 @@ struct cfg80211_bss *wlan_hdd_cfg80211_get_bss(struct wiphy *wiphy, WLAN_CAPABILITY_ESS); } #else +static struct cfg80211_bss *wlan_hdd_cfg80211_get_bss(struct wiphy *wiphy, struct ieee80211_channel *channel, const u8 *bssid, const u8 *ssid, size_t ssid_len) @@ -11664,7 +11669,7 @@ static int wlan_hdd_add_assoc_ie(hdd_wext_state_t *wext_state, * * Return: 0 for success, non-zero for failure */ -int wlan_hdd_cfg80211_set_ie(hdd_adapter_t *pAdapter, const uint8_t *ie, +static int wlan_hdd_cfg80211_set_ie(hdd_adapter_t *pAdapter, const uint8_t *ie, size_t ie_len) { hdd_wext_state_t *pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); @@ -11991,8 +11996,8 @@ static bool hdd_is_wpaie_present(const uint8_t *ie, uint8_t ie_len) * * Return: 0 for success, non-zero for failure */ -int wlan_hdd_cfg80211_set_privacy(hdd_adapter_t *pAdapter, - struct cfg80211_connect_params *req) +static int wlan_hdd_cfg80211_set_privacy(hdd_adapter_t *pAdapter, + struct cfg80211_connect_params *req) { int status = 0; hdd_wext_state_t *pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); @@ -12364,7 +12369,7 @@ static int wlan_hdd_cfg80211_connect(struct wiphy *wiphy, * * Return: 0 for success, non-zero for failure */ -int wlan_hdd_disconnect(hdd_adapter_t *pAdapter, u16 reason) +static int wlan_hdd_disconnect(hdd_adapter_t *pAdapter, u16 reason) { int status, result = 0; unsigned long rc; @@ -13929,6 +13934,7 @@ void wlan_hdd_cfg80211_update_replay_counter_callback(void *callbackContext, * * Return: 0 for success, non-zero for failure */ +static int __wlan_hdd_cfg80211_set_rekey_data(struct wiphy *wiphy, struct net_device *dev, struct cfg80211_gtk_rekey_data *data) @@ -14017,6 +14023,7 @@ int __wlan_hdd_cfg80211_set_rekey_data(struct wiphy *wiphy, * * Return: 0 for success, non-zero for failure */ +static int wlan_hdd_cfg80211_set_rekey_data(struct wiphy *wiphy, struct net_device *dev, struct cfg80211_gtk_rekey_data *data) @@ -14182,7 +14189,8 @@ wlan_hdd_cfg80211_set_mac_acl(struct wiphy *wiphy, * * Return: none */ -void wlan_hdd_cfg80211_lphb_ind_handler(void *pHddCtx, tSirLPHBInd *lphbInd) +static void wlan_hdd_cfg80211_lphb_ind_handler(void *pHddCtx, + tSirLPHBInd *lphbInd) { struct sk_buff *skb; diff --git a/core/hdd/src/wlan_hdd_debugfs.c b/core/hdd/src/wlan_hdd_debugfs.c index cb1155f8e161..e5652b4f1c53 100644 --- a/core/hdd/src/wlan_hdd_debugfs.c +++ b/core/hdd/src/wlan_hdd_debugfs.c @@ -39,6 +39,7 @@ #define HDD_DISALLOW_LEGACY_HDDLOG 1 #include <wlan_hdd_includes.h> +#include <wlan_hdd_debugfs.h> #include <wlan_hdd_wowl.h> #include <cds_sched.h> diff --git a/core/hdd/src/wlan_hdd_driver_ops.c b/core/hdd/src/wlan_hdd_driver_ops.c index a20fcb7b7836..57b1ce695434 100644 --- a/core/hdd/src/wlan_hdd_driver_ops.c +++ b/core/hdd/src/wlan_hdd_driver_ops.c @@ -48,6 +48,7 @@ #include "bmi.h" #include "cdp_txrx_bus.h" #include "pld_common.h" +#include "wlan_hdd_driver_ops.h" #ifdef MODULE #define WLAN_MODULE_NAME module_name(THIS_MODULE) @@ -302,8 +303,9 @@ void hdd_hif_close(void *hif_ctx) * * Return: void */ -void hdd_init_qdf_ctx(struct device *dev, void *bdev, - enum qdf_bus_type bus_type, const struct hif_bus_id *bid) +static void hdd_init_qdf_ctx(struct device *dev, void *bdev, + enum qdf_bus_type bus_type, + const struct hif_bus_id *bid) { qdf_device_t qdf_dev = cds_get_context(QDF_MODULE_ID_QDF_DEVICE); @@ -470,7 +472,7 @@ static void wlan_hdd_shutdown(void) * * Return: void */ -void wlan_hdd_crash_shutdown(void) +static void wlan_hdd_crash_shutdown(void) { hif_crash_shutdown(cds_get_context(QDF_MODULE_ID_HIF)); } @@ -485,7 +487,7 @@ void wlan_hdd_crash_shutdown(void) * * Return: void */ -void wlan_hdd_notify_handler(int state) +static void wlan_hdd_notify_handler(int state) { if (!QDF_IS_EPPING_ENABLED(cds_get_conparam())) { int ret = 0; @@ -558,16 +560,6 @@ done: return err; } -/** - * wlan_hdd_bus_suspend() - suspend the wlan bus - * - * This function is called by the platform driver to suspend the - * wlan bus - * - * @state: state - * - * Return: QDF_STATUS - */ int wlan_hdd_bus_suspend(pm_message_t state) { int ret; @@ -589,7 +581,7 @@ int wlan_hdd_bus_suspend(pm_message_t state) * * Return: 0 for success and -EBUSY if FW is requesting wake up */ -int __wlan_hdd_bus_suspend_noirq(void) +static int __wlan_hdd_bus_suspend_noirq(void) { hdd_context_t *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); void *hif_ctx; @@ -628,23 +620,17 @@ resume_hif_noirq: status = hif_bus_resume_noirq(hif_ctx); QDF_BUG(!status); done: - if (err == -EAGAIN) + if (err == -EAGAIN) { hdd_err("Firmware attempting wakeup, try again"); - else + wlan_hdd_inc_suspend_stats(hdd_ctx, + SUSPEND_FAIL_INITIAL_WAKEUP); + } else { hdd_err("suspend_noirq failed, status = %d", err); + } + return err; } -/** - * wlan_hdd_bus_suspend_noirq() - handle .suspend_noirq callback - * - * This function is called by the platform driver to complete the - * bus suspend callback when device interrupts are disabled by kernel. - * Call HIF and WMA suspend_noirq callbacks to make sure there is no - * wake up pending from FW before allowing suspend. - * - * Return: 0 for success and -EBUSY if FW is requesting wake up - */ int wlan_hdd_bus_suspend_noirq(void) { int ret; @@ -700,14 +686,6 @@ static int __wlan_hdd_bus_resume(void) return status; } -/** - * wlan_hdd_bus_resume(): wake up the bus - * - * This function is called by the platform driver to resume wlan - * bus - * - * Return: void - */ int wlan_hdd_bus_resume(void) { int ret; @@ -728,7 +706,7 @@ int wlan_hdd_bus_resume(void) * * Return: 0 for success and negative error code for failure */ -int __wlan_hdd_bus_resume_noirq(void) +static int __wlan_hdd_bus_resume_noirq(void) { hdd_context_t *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); void *hif_ctx; @@ -758,15 +736,6 @@ int __wlan_hdd_bus_resume_noirq(void) return status; } -/** - * wlan_hdd_bus_resume_noirq(): handle bus resume no irq - * - * This function is called by the platform driver to do bus - * resume no IRQ before calling resume callback. Call WMA and HIF - * layers to complete the resume_noirq. - * - * Return: 0 for success and negative error code for failure - */ int wlan_hdd_bus_resume_noirq(void) { int ret; diff --git a/core/hdd/src/wlan_hdd_ext_scan.c b/core/hdd/src/wlan_hdd_ext_scan.c index 0a172685416e..92241e2687e5 100644 --- a/core/hdd/src/wlan_hdd_ext_scan.c +++ b/core/hdd/src/wlan_hdd_ext_scan.c @@ -2435,8 +2435,8 @@ int wlan_hdd_cfg80211_extscan_set_significant_change(struct wiphy *wiphy, * * Return: none */ -void hdd_remove_dsrc_channels(struct wiphy *wiphy, uint32_t *chan_list, - uint8_t *num_channels) +static void hdd_remove_dsrc_channels(struct wiphy *wiphy, uint32_t *chan_list, + uint8_t *num_channels) { uint8_t num_chan_temp = 0; int i; @@ -2460,8 +2460,8 @@ void hdd_remove_dsrc_channels(struct wiphy *wiphy, uint32_t *chan_list, * Return: none */ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)) -void hdd_remove_indoor_channels(struct wiphy *wiphy, uint32_t *chan_list, - uint8_t *num_channels) +static void hdd_remove_indoor_channels(struct wiphy *wiphy, uint32_t *chan_list, + uint8_t *num_channels) { uint8_t num_chan_temp = 0; int i, j, k; @@ -2485,8 +2485,8 @@ void hdd_remove_indoor_channels(struct wiphy *wiphy, uint32_t *chan_list, *num_channels = num_chan_temp; } #else -void hdd_remove_indoor_channels(struct wiphy *wiphy, uint32_t *chan_list, - uint8_t *num_channels) +static void hdd_remove_indoor_channels(struct wiphy *wiphy, uint32_t *chan_list, + uint8_t *num_channels) { *num_channels = 0; } diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 5ca394f7fcb3..bf299934952b 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -133,8 +133,8 @@ int hdd_sap_context_init(hdd_context_t *hdd_ctx) * * Return: None */ -void hdd_hostapd_channel_allow_suspend(hdd_adapter_t *pAdapter, - uint8_t channel) +static void hdd_hostapd_channel_allow_suspend(hdd_adapter_t *pAdapter, + uint8_t channel) { hdd_context_t *pHddCtx = (hdd_context_t *) (pAdapter->pHddCtx); @@ -169,8 +169,8 @@ void hdd_hostapd_channel_allow_suspend(hdd_adapter_t *pAdapter, * * Return - None */ -void hdd_hostapd_channel_prevent_suspend(hdd_adapter_t *pAdapter, - uint8_t channel) +static void hdd_hostapd_channel_prevent_suspend(hdd_adapter_t *pAdapter, + uint8_t channel) { hdd_context_t *pHddCtx = (hdd_context_t *) (pAdapter->pHddCtx); hdd_hostapd_state_t *pHostapdState = @@ -473,9 +473,20 @@ static int hdd_hostapd_set_mac_address(struct net_device *dev, void *addr) return ret; } -void hdd_hostapd_inactivity_timer_cb(void *usrDataForCallback) +/** + * hdd_hostapd_inactivity_timer_cb() - Inactivity timeout handler + * @context: Context registered with qdf_mc_timer_init() + * + * This is the callback function registered with qdf_mc_timer_init() + * to handle the AP inactivity timer. The @context registered is the + * struct net_device associated with the interface. When this + * function is called it means the AP inactivity timer has fired, and + * this function in turn indicates the timeout to userspace. + */ + +static void hdd_hostapd_inactivity_timer_cb(void *context) { - struct net_device *dev = (struct net_device *)usrDataForCallback; + struct net_device *dev = (struct net_device *)context; uint8_t we_custom_event[64]; union iwreq_data wrqu; #ifdef DISABLE_CONCURRENCY_AUTOSAVE @@ -533,8 +544,8 @@ void hdd_hostapd_inactivity_timer_cb(void *usrDataForCallback) EXIT(); } -void hdd_clear_all_sta(hdd_adapter_t *pHostapdAdapter, - void *usrDataForCallback) +static void hdd_clear_all_sta(hdd_adapter_t *pHostapdAdapter, + void *usrDataForCallback) { uint8_t staId = 0; struct net_device *dev; @@ -729,10 +740,10 @@ QDF_STATUS hdd_chan_change_notify(hdd_adapter_t *adapter, * Return: Success on sending notifying userspace * */ -QDF_STATUS hdd_send_radar_event(hdd_context_t *hdd_context, - eSapHddEvent event, - struct wlan_dfs_info dfs_info, - struct wireless_dev *wdev) +static QDF_STATUS hdd_send_radar_event(hdd_context_t *hdd_context, + eSapHddEvent event, + struct wlan_dfs_info dfs_info, + struct wireless_dev *wdev) { struct sk_buff *vendor_event; @@ -6309,10 +6320,11 @@ static void wlan_hdd_add_extra_ie(hdd_adapter_t *pHostapdAdapter, * * Return: 0 for success non-zero for failure */ -int wlan_hdd_cfg80211_alloc_new_beacon(hdd_adapter_t *pAdapter, - beacon_data_t **ppBeacon, - struct cfg80211_beacon_data *params, - int dtim_period) +static int +wlan_hdd_cfg80211_alloc_new_beacon(hdd_adapter_t *pAdapter, + beacon_data_t **ppBeacon, + struct cfg80211_beacon_data *params, + int dtim_period) { int size; beacon_data_t *beacon = NULL; @@ -6761,7 +6773,7 @@ QDF_STATUS wlan_hdd_config_acs(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter) * * Return: 0 for Success or Negative error codes. */ -int wlan_hdd_setup_driver_overrides(hdd_adapter_t *ap_adapter) +static int wlan_hdd_setup_driver_overrides(hdd_adapter_t *ap_adapter) { tsap_Config_t *sap_cfg = &ap_adapter->sessionCtx.ap.sapConfig; hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(ap_adapter); @@ -7662,6 +7674,7 @@ static int __wlan_hdd_cfg80211_stop_ap(struct wiphy *wiphy, global_p2p_connection_status = P2P_NOT_ACTIVE; } #endif + pAdapter->sessionId = HDD_SESSION_ID_INVALID; EXIT(); return ret; } diff --git a/core/hdd/src/wlan_hdd_ioctl.c b/core/hdd/src/wlan_hdd_ioctl.c index fcc2f5e0e7b6..fd4def55ed73 100644 --- a/core/hdd/src/wlan_hdd_ioctl.c +++ b/core/hdd/src/wlan_hdd_ioctl.c @@ -2620,7 +2620,8 @@ static int hdd_parse_ese_beacon_req(uint8_t *pValue, tCsrEseBeaconReq *pEseBcnReq) { uint8_t *inPtr = pValue; - int tempInt = 0; + uint8_t input = 0; + uint32_t tempInt = 0; int j = 0, i = 0, v = 0; char buf[32]; @@ -2642,19 +2643,19 @@ static int hdd_parse_ese_beacon_req(uint8_t *pValue, if ('\0' == *inPtr) return -EINVAL; - /* get the first argument ie measurement token */ + /* Getting the first argument ie Number of IE fields */ v = sscanf(inPtr, "%31s ", buf); if (1 != v) return -EINVAL; - v = kstrtos32(buf, 10, &tempInt); + v = kstrtou8(buf, 10, &input); if (v < 0) return -EINVAL; - pEseBcnReq->numBcnReqIe = tempInt; + input = QDF_MIN(input, SIR_ESE_MAX_MEAS_IE_REQS); + pEseBcnReq->numBcnReqIe = input; - hdd_info("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++) { @@ -2683,14 +2684,14 @@ static int hdd_parse_ese_beacon_req(uint8_t *pValue, if (1 != v) return -EINVAL; - v = kstrtos32(buf, 10, &tempInt); + v = kstrtou32(buf, 10, &tempInt); if (v < 0) return -EINVAL; switch (i) { case 0: /* Measurement token */ - if (tempInt <= 0) { - hdd_err("Invalid Measurement Token(%d)", + if (!tempInt) { + hdd_err("Invalid Measurement Token: %u", tempInt); return -EINVAL; } @@ -2699,10 +2700,10 @@ static int hdd_parse_ese_beacon_req(uint8_t *pValue, break; case 1: /* Channel number */ - if ((tempInt <= 0) || + if (!tempInt || (tempInt > WNI_CFG_CURRENT_CHANNEL_STAMAX)) { - hdd_err("Invalid Channel Number(%d)", + hdd_err("Invalid Channel Number: %u", tempInt); return -EINVAL; } @@ -2712,7 +2713,7 @@ static int hdd_parse_ese_beacon_req(uint8_t *pValue, case 2: /* Scan mode */ if ((tempInt < eSIR_PASSIVE_SCAN) || (tempInt > eSIR_BEACON_TABLE)) { - hdd_err("Invalid Scan Mode(%d) Expected{0|1|2}", + hdd_err("Invalid Scan Mode: %u Expected{0|1|2}", tempInt); return -EINVAL; } @@ -2720,13 +2721,12 @@ static int hdd_parse_ese_beacon_req(uint8_t *pValue, break; case 3: /* Measurement duration */ - if (((tempInt <= 0) + if ((!tempInt && (pEseBcnReq->bcnReq[j].scanMode != eSIR_BEACON_TABLE)) || - ((tempInt < 0) && - (pEseBcnReq->bcnReq[j].scanMode == - eSIR_BEACON_TABLE))) { - hdd_err("Invalid Measurement Duration(%d)", + (pEseBcnReq->bcnReq[j].scanMode == + eSIR_BEACON_TABLE)) { + hdd_err("Invalid Measurement Duration: %u", tempInt); return -EINVAL; } @@ -2738,7 +2738,7 @@ static int hdd_parse_ese_beacon_req(uint8_t *pValue, } for (j = 0; j < pEseBcnReq->numBcnReqIe; j++) { - hdd_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, @@ -5551,6 +5551,127 @@ static int drv_cmd_ccx_beacon_req(hdd_adapter_t *adapter, exit: return ret; } + +/** + * drv_cmd_ccx_plm_req() - Set ESE PLM request + * @adapter: Pointer to the HDD adapter + * @hdd_ctx: Pointer to the HDD context + * @command: Driver command string + * @command_len: Driver command string length + * @priv_data: Private data coming with the driver command. Unused here + * + * This function handles driver command that sets the ESE PLM request + * + * Return: 0 on success; negative errno otherwise + */ +static int drv_cmd_ccx_plm_req(hdd_adapter_t *adapter, + hdd_context_t *hdd_ctx, + uint8_t *command, + uint8_t command_len, + hdd_priv_data_t *priv_data) +{ + int ret = 0; + uint8_t *value = command; + QDF_STATUS status = QDF_STATUS_SUCCESS; + tpSirPlmReq pPlmRequest = NULL; + + pPlmRequest = qdf_mem_malloc(sizeof(tSirPlmReq)); + if (NULL == pPlmRequest) { + ret = -ENOMEM; + goto exit; + } + + status = hdd_parse_plm_cmd(value, pPlmRequest); + if (QDF_STATUS_SUCCESS != status) { + qdf_mem_free(pPlmRequest); + pPlmRequest = NULL; + ret = -EINVAL; + goto exit; + } + pPlmRequest->sessionId = adapter->sessionId; + + status = sme_set_plm_request(hdd_ctx->hHal, pPlmRequest); + if (QDF_STATUS_SUCCESS != status) { + qdf_mem_free(pPlmRequest); + pPlmRequest = NULL; + ret = -EINVAL; + goto exit; + } + +exit: + return ret; +} + +/** + * drv_cmd_set_ccx_mode() - Set ESE mode + * @adapter: Pointer to the HDD adapter + * @hdd_ctx: Pointer to the HDD context + * @command: Driver command string + * @command_len: Driver command string length + * @priv_data: Private data coming with the driver command. Unused here + * + * This function handles driver command that sets ESE mode + * + * Return: 0 on success; negative errno otherwise + */ +static int drv_cmd_set_ccx_mode(hdd_adapter_t *adapter, + hdd_context_t *hdd_ctx, + uint8_t *command, + uint8_t command_len, + hdd_priv_data_t *priv_data) +{ + int ret = 0; + uint8_t *value = command; + uint8_t eseMode = CFG_ESE_FEATURE_ENABLED_DEFAULT; + + /* + * Check if the features OKC/ESE/11R are supported simultaneously, + * then this operation is not permitted (return FAILURE) + */ + 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)) { + hdd_warn("OKC/ESE/11R are supported simultaneously hence this operation is not permitted!"); + ret = -EPERM; + goto exit; + } + + /* Move pointer to ahead of SETCCXMODE<delimiter> */ + value = value + command_len + 1; + + /* Convert the value from ascii to integer */ + ret = kstrtou8(value, 10, &eseMode); + if (ret < 0) { + /* + * If the input value is greater than max value of datatype, + * then also kstrtou8 fails + */ + hdd_err("kstrtou8 failed range [%d - %d]", + CFG_ESE_FEATURE_ENABLED_MIN, + CFG_ESE_FEATURE_ENABLED_MAX); + ret = -EINVAL; + goto exit; + } + + if ((eseMode < CFG_ESE_FEATURE_ENABLED_MIN) || + (eseMode > CFG_ESE_FEATURE_ENABLED_MAX)) { + hdd_err("Ese mode value %d is out of range (Min: %d Max: %d)", + eseMode, + CFG_ESE_FEATURE_ENABLED_MIN, + CFG_ESE_FEATURE_ENABLED_MAX); + ret = -EINVAL; + goto exit; + } + hdd_info("Received Command to change ese mode = %d", eseMode); + + hdd_ctx->config->isEseIniFeatureEnabled = eseMode; + sme_update_is_ese_feature_enabled(hdd_ctx->hHal, + adapter->sessionId, + eseMode); + +exit: + return ret; +} #endif /* FEATURE_WLAN_ESE */ static int drv_cmd_set_mc_rate(hdd_adapter_t *adapter, @@ -6639,8 +6760,7 @@ static int drv_cmd_set_antenna_mode(hdd_adapter_t *adapter, /* Check TDLS status and update antenna mode */ if ((QDF_STA_MODE == adapter->device_mode) && - cds_is_sta_active_connection_exists() && - (hdd_ctx->connected_peer_count > 0)) { + cds_is_sta_active_connection_exists()) { ret = wlan_hdd_tdls_antenna_switch(hdd_ctx, adapter, mode); if (0 != ret) @@ -7037,7 +7157,9 @@ static const hdd_drv_cmd_t hdd_drv_cmds[] = { {"SETCCXROAMSCANCHANNELS", drv_cmd_set_ccx_roam_scan_channels}, {"GETTSMSTATS", drv_cmd_get_tsm_stats}, {"SETCCKMIE", drv_cmd_set_cckm_ie}, - {"CCXBEACONREQ", drv_cmd_ccx_beacon_req}, + {"CCXBEACONREQ", drv_cmd_ccx_beacon_req}, + {"CCXPLMREQ", drv_cmd_ccx_plm_req}, + {"SETCCXMODE", drv_cmd_set_ccx_mode}, #endif /* FEATURE_WLAN_ESE */ {"SETMCRATE", drv_cmd_set_mc_rate}, {"MAXTXPOWER", drv_cmd_max_tx_power}, diff --git a/core/hdd/src/wlan_hdd_ipa.c b/core/hdd/src/wlan_hdd_ipa.c index 0fa36477eed6..bb06854696c7 100644 --- a/core/hdd/src/wlan_hdd_ipa.c +++ b/core/hdd/src/wlan_hdd_ipa.c @@ -454,7 +454,7 @@ struct hdd_ipa_priv { * is broken. * This should be OK and IPA is not enabled yet */ -void *wlan_hdd_stub_priv_to_addr(uint32_t priv) +static void *wlan_hdd_stub_priv_to_addr(uint32_t priv) { void *vaddr; uint32_t ipa_priv = priv; @@ -464,7 +464,7 @@ void *wlan_hdd_stub_priv_to_addr(uint32_t priv) return vaddr; } -uint32_t wlan_hdd_stub_addr_to_priv(void *ptr) +static uint32_t wlan_hdd_stub_addr_to_priv(void *ptr) { uint32_t ipa_priv = 0; @@ -838,7 +838,7 @@ static void hdd_ipa_uc_rt_debug_handler(void *ctext) * * Return: none */ -void hdd_ipa_uc_rt_debug_destructor(struct sk_buff *skb) +static void hdd_ipa_uc_rt_debug_destructor(struct sk_buff *skb) { if (!ghdd_ipa) { HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, @@ -4163,7 +4163,7 @@ fail_return: * * Return: none */ -void hdd_ipa_cleanup_pending_event(struct hdd_ipa_priv *hdd_ipa) +static void hdd_ipa_cleanup_pending_event(struct hdd_ipa_priv *hdd_ipa) { struct ipa_uc_pending_event *pending_event = NULL; diff --git a/core/hdd/src/wlan_hdd_lro.c b/core/hdd/src/wlan_hdd_lro.c index 35902f28fee5..a312b8c548be 100644 --- a/core/hdd/src/wlan_hdd_lro.c +++ b/core/hdd/src/wlan_hdd_lro.c @@ -412,8 +412,9 @@ static void hdd_lro_desc_free(struct net_lro_desc *desc, * * Return: none */ -void hdd_lro_flush_pkt(struct net_lro_mgr *lro_mgr, - struct iphdr *iph, struct tcphdr *tcph, hdd_adapter_t *adapter) +static void hdd_lro_flush_pkt(struct net_lro_mgr *lro_mgr, + struct iphdr *iph, struct tcphdr *tcph, + hdd_adapter_t *adapter) { struct net_lro_desc *lro_desc; @@ -434,7 +435,7 @@ void hdd_lro_flush_pkt(struct net_lro_mgr *lro_mgr, * * Return: none */ -void hdd_lro_flush(void *data) +static void hdd_lro_flush(void *data) { hdd_adapter_t *adapter = (hdd_adapter_t *)data; struct hdd_lro_s *hdd_lro; diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index fda3035e02ab..fdd639078983 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -206,7 +206,7 @@ void wlan_hdd_auto_shutdown_cb(void); * * Return: none */ -void hdd_set_rps_cpu_mask(hdd_context_t *hdd_ctx) +static void hdd_set_rps_cpu_mask(hdd_context_t *hdd_ctx) { hdd_adapter_t *adapter; hdd_adapter_list_node_t *adapter_node, *next; @@ -1001,6 +1001,11 @@ static void hdd_update_tgt_vht_cap(hdd_context_t *hdd_ctx, wiphy->bands[IEEE80211_BAND_5GHZ]; uint32_t temp = 0; + if (!band_5g) { + hdd_info("5GHz band disabled, skipping capability population"); + return; + } + /* Get the current MPDU length */ status = sme_cfg_get_int(hdd_ctx->hHal, WNI_CFG_VHT_MAX_MPDU_LENGTH, @@ -1631,7 +1636,7 @@ static int __hdd_mon_open(struct net_device *dev) * * Return: 0 for success; non-zero for failure */ -int hdd_mon_open(struct net_device *dev) +static int hdd_mon_open(struct net_device *dev) { int ret; @@ -1968,7 +1973,7 @@ static int __hdd_open(struct net_device *dev) * * Return: 0 for success; non-zero for failure */ -int hdd_open(struct net_device *dev) +static int hdd_open(struct net_device *dev) { int ret; @@ -2075,7 +2080,7 @@ static int __hdd_stop(struct net_device *dev) * * Return: 0 for success and error number for failure */ -int hdd_stop(struct net_device *dev) +static int hdd_stop(struct net_device *dev) { int ret; @@ -2524,13 +2529,10 @@ static hdd_adapter_t *hdd_alloc_station_adapter(hdd_context_t *hdd_ctx, return adapter; } -QDF_STATUS hdd_register_interface(hdd_adapter_t *adapter, - bool rtnl_held) +static QDF_STATUS hdd_register_interface(hdd_adapter_t *adapter, + bool rtnl_held) { struct net_device *pWlanDev = adapter->dev; - /* hdd_station_ctx_t *pHddStaCtx = &adapter->sessionCtx.station; */ - /* hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX( adapter ); */ - /* QDF_STATUS qdf_ret_status = QDF_STATUS_SUCCESS; */ if (rtnl_held) { if (strnchr(pWlanDev->name, strlen(pWlanDev->name), '%')) { @@ -2780,14 +2782,16 @@ void hdd_cleanup_actionframe(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter) * hdd_station_adapter_deinit() - De-initialize the station adapter * @hdd_ctx: global hdd context * @adapter: HDD adapter + * @rtnl_held: Used to indicate whether or not the caller is holding + * the kernel rtnl_mutex * * This function De-initializes the STA/P2P/OCB adapter. * * Return: None. */ -void hdd_station_adapter_deinit(hdd_context_t *hdd_ctx, - hdd_adapter_t *adapter, - bool rtnl_held) +static void hdd_station_adapter_deinit(hdd_context_t *hdd_ctx, + hdd_adapter_t *adapter, + bool rtnl_held) { ENTER_DEV(adapter->dev); @@ -2826,8 +2830,9 @@ void hdd_station_adapter_deinit(hdd_context_t *hdd_ctx, * * Return: None. */ -void hdd_ap_adapter_deinit(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter, - bool rtnl_held) +static void hdd_ap_adapter_deinit(hdd_context_t *hdd_ctx, + hdd_adapter_t *adapter, + bool rtnl_held) { ENTER_DEV(adapter->dev); @@ -2872,8 +2877,8 @@ void hdd_deinit_adapter(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter, EXIT(); } -void hdd_cleanup_adapter(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter, - bool rtnl_held) +static void hdd_cleanup_adapter(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter, + bool rtnl_held) { struct net_device *pWlanDev = NULL; @@ -2915,8 +2920,8 @@ void hdd_cleanup_adapter(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter, } } -QDF_STATUS hdd_check_for_existing_macaddr(hdd_context_t *hdd_ctx, - tSirMacAddr macAddr) +static QDF_STATUS hdd_check_for_existing_macaddr(hdd_context_t *hdd_ctx, + tSirMacAddr macAddr) { hdd_adapter_list_node_t *adapterNode = NULL, *pNext = NULL; hdd_adapter_t *adapter; @@ -3109,6 +3114,15 @@ int hdd_set_fw_params(hdd_adapter_t *adapter) hdd_set_fw_log_params(hdd_ctx, adapter); + ret = wma_cli_set_command(adapter->sessionId, + WMI_VDEV_PARAM_ENABLE_RTSCTS, + hdd_ctx->config->rts_profile, + VDEV_CMD); + if (ret) { + hdd_err("FAILED TO SET RTSCTS Profile ret:%d", ret); + goto error; + } + EXIT(); return 0; @@ -3458,7 +3472,6 @@ static void hdd_wait_for_sme_close_sesion(hdd_context_t *hdd_ctx, sme_close_session(hdd_ctx->hHal, adapter->sessionId, hdd_sme_close_session_callback, adapter)) { - adapter->sessionId = HDD_SESSION_ID_INVALID; /* * Block on a completion variable. Can't wait * forever though. @@ -3472,7 +3485,9 @@ static void hdd_wait_for_sme_close_sesion(hdd_context_t *hdd_ctx, if (adapter->device_mode == QDF_NDI_MODE) hdd_ndp_session_end_handler(adapter); clear_bit(SME_SESSION_OPENED, &adapter->event_flags); + return; } + adapter->sessionId = HDD_SESSION_ID_INVALID; } } @@ -3766,6 +3781,7 @@ static bool hdd_is_interface_up(hdd_adapter_t *adapter) #if defined CFG80211_CONNECT_BSS #if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 1, 0)) \ && !defined(WITH_BACKPORTS) && !defined(IEEE80211_PRIVACY) +static struct cfg80211_bss *hdd_cfg80211_get_bss(struct wiphy *wiphy, struct ieee80211_channel *channel, const u8 *bssid, const u8 *ssid, @@ -3777,6 +3793,7 @@ struct cfg80211_bss *hdd_cfg80211_get_bss(struct wiphy *wiphy, WLAN_CAPABILITY_ESS); } #else +static struct cfg80211_bss *hdd_cfg80211_get_bss(struct wiphy *wiphy, struct ieee80211_channel *channel, const u8 *bssid, const u8 *ssid, @@ -4654,7 +4671,7 @@ static void hdd_context_destroy(hdd_context_t *hdd_ctx) * * Return: None */ -void hdd_wlan_exit(hdd_context_t *hdd_ctx) +static void hdd_wlan_exit(hdd_context_t *hdd_ctx) { v_CONTEXT_t p_cds_context = hdd_ctx->pcds_context; QDF_STATUS qdf_status; @@ -5134,8 +5151,9 @@ static int hdd_wiphy_init(hdd_context_t *hdd_ctx) * Returns: None */ #ifdef MSM_PLATFORM -void hdd_pld_request_bus_bandwidth(hdd_context_t *hdd_ctx, - const uint64_t tx_packets, const uint64_t rx_packets) +static void hdd_pld_request_bus_bandwidth(hdd_context_t *hdd_ctx, + const uint64_t tx_packets, + const uint64_t rx_packets) { uint64_t total = tx_packets + rx_packets; uint64_t temp_rx = 0; @@ -5768,7 +5786,7 @@ static uint8_t hdd_get_safe_channel_from_pcl_and_acs_range( * * Return: None */ -void hdd_restart_sap(hdd_adapter_t *adapter, uint8_t channel) +static void hdd_restart_sap(hdd_adapter_t *adapter, uint8_t channel) { hdd_ap_ctx_t *hdd_ap_ctx; tHalHandle *hal_handle; @@ -6339,7 +6357,7 @@ list_destroy: * * Return: HDD context on success and ERR_PTR on failure */ -hdd_context_t *hdd_context_create(struct device *dev) +static hdd_context_t *hdd_context_create(struct device *dev) { QDF_STATUS status; int ret = 0; @@ -6748,7 +6766,7 @@ inline void hdd_ra_populate_cds_config(struct cds_config_info *cds_cfg, * * Return: 0 for Success, errno on failure */ -int hdd_update_cds_config(hdd_context_t *hdd_ctx) +static int hdd_update_cds_config(hdd_context_t *hdd_ctx) { struct cds_config_info *cds_cfg; @@ -7440,6 +7458,8 @@ static int hdd_features_init(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter) /* FW capabilities received, Set the Dot11 mode */ sme_setdef_dot11mode(hdd_ctx->hHal); + sme_set_prefer_80MHz_over_160MHz(hdd_ctx->hHal, + hdd_ctx->config->sta_prefer_80MHz_over_160MHz); if (hdd_ctx->config->fIsImpsEnabled) @@ -7568,7 +7588,7 @@ out: * * Return: 0 on success and errno on failure. */ -int hdd_deconfigure_cds(hdd_context_t *hdd_ctx) +static int hdd_deconfigure_cds(hdd_context_t *hdd_ctx) { QDF_STATUS qdf_status; diff --git a/core/hdd/src/wlan_hdd_p2p.c b/core/hdd/src/wlan_hdd_p2p.c index ea3df68c7a47..1587d02fbb46 100644 --- a/core/hdd/src/wlan_hdd_p2p.c +++ b/core/hdd/src/wlan_hdd_p2p.c @@ -55,6 +55,7 @@ /* Ms to Time Unit Micro Sec */ #define MS_TO_TU_MUS(x) ((x) * 1024) +#define MAX_MUS_VAL (INT_MAX / 1024) static uint8_t *hdd_get_action_string(uint16_t MsgType) { @@ -374,7 +375,7 @@ int wlan_hdd_check_remain_on_channel(hdd_adapter_t *pAdapter) * * Return: None */ -void wlan_hdd_cancel_pending_roc(hdd_adapter_t *adapter) +static void wlan_hdd_cancel_pending_roc(hdd_adapter_t *adapter) { hdd_remain_on_chan_ctx_t *roc_ctx; unsigned long rc; @@ -462,7 +463,7 @@ void wlan_hdd_cleanup_remain_on_channel_ctx(hdd_adapter_t *pAdapter) } -void wlan_hdd_remain_on_chan_timeout(void *data) +static void wlan_hdd_remain_on_chan_timeout(void *data) { hdd_adapter_t *pAdapter = (hdd_adapter_t *) data; hdd_remain_on_chan_ctx_t *pRemainChanCtx; @@ -706,8 +707,8 @@ static int wlan_hdd_roc_request_enqueue(hdd_adapter_t *adapter, * * Return: None */ -void wlan_hdd_indicate_roc_drop(hdd_adapter_t *adapter, - hdd_remain_on_chan_ctx_t *ctx) +static void wlan_hdd_indicate_roc_drop(hdd_adapter_t *adapter, + hdd_remain_on_chan_ctx_t *ctx) { hdd_debug("indicate roc drop to userspace"); cfg80211_ready_on_channel( @@ -885,10 +886,11 @@ static int wlan_hdd_request_remain_on_channel(struct wiphy *wiphy, return 0; } -int __wlan_hdd_cfg80211_remain_on_channel(struct wiphy *wiphy, - struct wireless_dev *wdev, - struct ieee80211_channel *chan, - unsigned int duration, u64 *cookie) +static int __wlan_hdd_cfg80211_remain_on_channel(struct wiphy *wiphy, + struct wireless_dev *wdev, + struct ieee80211_channel *chan, + unsigned int duration, + u64 *cookie) { struct net_device *dev = wdev->netdev; hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); @@ -1026,9 +1028,10 @@ void hdd_remain_chan_ready_handler(hdd_adapter_t *pAdapter, return; } -int __wlan_hdd_cfg80211_cancel_remain_on_channel(struct wiphy *wiphy, - struct wireless_dev *wdev, - u64 cookie) +static int +__wlan_hdd_cfg80211_cancel_remain_on_channel(struct wiphy *wiphy, + struct wireless_dev *wdev, + u64 cookie) { struct net_device *dev = wdev->netdev; hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); @@ -1171,11 +1174,11 @@ int wlan_hdd_cfg80211_cancel_remain_on_channel(struct wiphy *wiphy, return ret; } -int __wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, - struct ieee80211_channel *chan, bool offchan, - unsigned int wait, - const u8 *buf, size_t len, bool no_cck, - bool dont_wait_for_ack, u64 *cookie) +static int __wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, + struct ieee80211_channel *chan, bool offchan, + unsigned int wait, + const u8 *buf, size_t len, bool no_cck, + bool dont_wait_for_ack, u64 *cookie) { struct net_device *dev = wdev->netdev; hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); @@ -1601,9 +1604,9 @@ int wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, return ret; } -int __wlan_hdd_cfg80211_mgmt_tx_cancel_wait(struct wiphy *wiphy, - struct wireless_dev *wdev, - u64 cookie) +static int __wlan_hdd_cfg80211_mgmt_tx_cancel_wait(struct wiphy *wiphy, + struct wireless_dev *wdev, + u64 cookie) { return wlan_hdd_cfg80211_cancel_remain_on_channel(wiphy, wdev, cookie); } @@ -1741,6 +1744,11 @@ int hdd_set_p2p_noa(struct net_device *dev, uint8_t *command) ret); return -EINVAL; } + if (count < 0 || interval < 0 || duration < 0 || + interval > MAX_MUS_VAL || duration > MAX_MUS_VAL) { + hdd_err("Invalid NOA parameters"); + return -EINVAL; + } hdd_info("P2P_SET GO NoA: count=%d interval=%d duration=%d", count, interval, duration); duration = MS_TO_TU_MUS(duration); @@ -1936,6 +1944,7 @@ static uint8_t wlan_hdd_get_session_type(enum nl80211_iftype type) * * Return: the pointer of wireless dev, otherwise ERR_PTR. */ +static struct wireless_dev *__wlan_hdd_add_virtual_intf(struct wiphy *wiphy, const char *name, unsigned char name_assign_type, diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c index 26e5f6641987..55caa12744d3 100644 --- a/core/hdd/src/wlan_hdd_power.c +++ b/core/hdd/src/wlan_hdd_power.c @@ -52,6 +52,7 @@ #include <wlan_nlink_srv.h> #include <wlan_hdd_misc.h> #include <wlan_hdd_power.h> +#include <wlan_hdd_host_offload.h> #include <dbglog_host.h> #include <wlan_hdd_trace.h> #include <wlan_hdd_p2p.h> @@ -544,7 +545,7 @@ void hdd_conf_ns_offload(hdd_adapter_t *adapter, bool fenable) * * Return: None */ -void __hdd_ipv6_notifier_work_queue(struct work_struct *work) +static void __hdd_ipv6_notifier_work_queue(struct work_struct *work) { hdd_adapter_t *pAdapter = container_of(work, hdd_adapter_t, ipv6NotifierWorkQueue); @@ -663,7 +664,7 @@ void hdd_conf_hostoffload(hdd_adapter_t *pAdapter, bool fenable) * * Return: None */ -void __hdd_ipv4_notifier_work_queue(struct work_struct *work) +static void __hdd_ipv4_notifier_work_queue(struct work_struct *work) { hdd_adapter_t *pAdapter = container_of(work, hdd_adapter_t, ipv4NotifierWorkQueue); @@ -1495,6 +1496,7 @@ QDF_STATUS hdd_wlan_re_init(void) hdd_adapter_t *pAdapter; QDF_STATUS qdf_status; int ret; + bool bug_on_reinit_failure = CFG_BUG_ON_REINIT_FAILURE_DEFAULT; hdd_prevent_suspend(WIFI_POWER_EVENT_WAKELOCK_DRIVER_REINIT); @@ -1511,6 +1513,7 @@ QDF_STATUS hdd_wlan_re_init(void) hdd_alert("HDD context is Null"); goto err_re_init; } + bug_on_reinit_failure = pHddCtx->config->bug_on_reinit_failure; /* The driver should always be initialized in STA mode after SSR */ hdd_set_conparam(0); @@ -1591,7 +1594,8 @@ err_wiphy_unregister: err_re_init: /* Allow the phone to go to sleep */ hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_DRIVER_REINIT); - QDF_BUG(0); + if (bug_on_reinit_failure) + QDF_BUG(0); return -EPERM; success: @@ -1664,6 +1668,24 @@ static int wlan_hdd_set_powersave(hdd_adapter_t *adapter, return 0; } +static void wlan_hdd_print_suspend_fail_stats(hdd_context_t *hdd_ctx) +{ + hdd_err("ipa:%d, radar:%d, roam:%d, scan:%d, initial_wakeup:%d", + hdd_ctx->suspend_fail_stats[SUSPEND_FAIL_IPA], + hdd_ctx->suspend_fail_stats[SUSPEND_FAIL_RADAR], + hdd_ctx->suspend_fail_stats[SUSPEND_FAIL_ROAM], + hdd_ctx->suspend_fail_stats[SUSPEND_FAIL_SCAN], + hdd_ctx->suspend_fail_stats[SUSPEND_FAIL_INITIAL_WAKEUP]); +} + +void wlan_hdd_inc_suspend_stats(hdd_context_t *hdd_ctx, + enum suspend_fail_reason reason) +{ + wlan_hdd_print_suspend_fail_stats(hdd_ctx); + hdd_ctx->suspend_fail_stats[reason]++; + wlan_hdd_print_suspend_fail_stats(hdd_ctx); +} + /** * __wlan_hdd_cfg80211_resume_wlan() - cfg80211 resume callback * @wiphy: Pointer to wiphy @@ -1856,6 +1878,8 @@ static int __wlan_hdd_cfg80211_suspend_wlan(struct wiphy *wiphy, WLAN_HDD_GET_AP_CTX_PTR(pAdapter)-> dfs_cac_block_tx) { hdd_err("RADAR detection in progress, do not allow suspend"); + wlan_hdd_inc_suspend_stats(pHddCtx, + SUSPEND_FAIL_RADAR); return -EAGAIN; } else if (!pHddCtx->config->enableSapSuspend) { /* return -EOPNOTSUPP if SAP does not support @@ -1888,6 +1912,8 @@ static int __wlan_hdd_cfg80211_suspend_wlan(struct wiphy *wiphy, if (sme_sta_in_middle_of_roaming (pHddCtx->hHal, pAdapter->sessionId)) { hdd_err("Roaming in progress, do not allow suspend"); + wlan_hdd_inc_suspend_stats(pHddCtx, + SUSPEND_FAIL_ROAM); return -EAGAIN; } @@ -1902,6 +1928,8 @@ static int __wlan_hdd_cfg80211_suspend_wlan(struct wiphy *wiphy, msecs_to_jiffies(WLAN_WAIT_TIME_ABORTSCAN)); if (!status) { hdd_err("Timeout occurred while waiting for abort scan"); + wlan_hdd_inc_suspend_stats(pHddCtx, + SUSPEND_FAIL_SCAN); return -ETIME; } } @@ -1915,6 +1943,7 @@ static int __wlan_hdd_cfg80211_suspend_wlan(struct wiphy *wiphy, */ if (hdd_ipa_suspend(pHddCtx)) { hdd_err("IPA not ready to suspend!"); + wlan_hdd_inc_suspend_stats(pHddCtx, SUSPEND_FAIL_IPA); return -EAGAIN; } @@ -2314,46 +2343,33 @@ int wlan_hdd_cfg80211_get_txpower(struct wiphy *wiphy, * Return: 0 on success; Errno on failure */ int hdd_set_qpower_config(hdd_context_t *hddctx, hdd_adapter_t *adapter, - uint8_t qpower) + u8 qpower) { - QDF_STATUS qdf_status; - int status; - bool is_timer_running; + QDF_STATUS status; if (!hddctx->config->enablePowersaveOffload) { hdd_err("qpower is disabled in configuration"); return -EINVAL; } + if (qpower > PS_DUTY_CYCLING_QPOWER || qpower < PS_LEGACY_NODEEPSLEEP) { - hdd_err("invalid qpower value=%d", qpower); + hdd_err("invalid qpower value: %d", qpower); return -EINVAL; } - hdd_info("updating qpower value=%d to wma", qpower); - qdf_status = wma_set_powersave_config(qpower); - if (qdf_status != QDF_STATUS_SUCCESS) { - hdd_err("failed to update qpower %d", - qdf_status); + + status = wma_set_qpower_config(adapter->sessionId, qpower); + if (status != QDF_STATUS_SUCCESS) { + hdd_err("failed to configure qpower: %d", status); return -EINVAL; } - is_timer_running = sme_is_auto_ps_timer_running( - WLAN_HDD_GET_HAL_CTX(adapter), - adapter->sessionId); - if (!is_timer_running) { - status = wlan_hdd_set_powersave(adapter, true, 0); - if (status != 0) { - hdd_err("failed to put device in power save mode %d", - status); - return -EINVAL; - } - } return 0; } #ifdef WLAN_SUSPEND_RESUME_TEST /* - * On Rome/iHelium there are 12 CE irqs and #2 is the wake irq. This may not be + * On iHelium there are 12 CE irqs and #2 is the wake irq. This may not be * a valid assumption on future platforms. */ #define CE_IRQ_COUNT 12 @@ -2363,7 +2379,41 @@ static struct wiphy *g_wiphy; #define HDD_FA_SUSPENDED_BIT (0) static unsigned long fake_apps_state; -static int __hdd_wlan_fake_apps_resume(struct wiphy *wiphy); +/** + * __hdd_wlan_fake_apps_resume() - The core logic for + * hdd_wlan_fake_apps_resume() skipping the call to hif_fake_apps_resume(), + * which is only need for non-irq resume + * @wiphy: wiphy struct from a validated hdd context + * + * Return: Zero on success, calls QDF_BUG() on failure + */ +static void __hdd_wlan_fake_apps_resume(struct wiphy *wiphy) +{ + qdf_device_t qdf_dev = cds_get_context(QDF_MODULE_ID_QDF_DEVICE); + int i, resume_err; + + hdd_info("Unit-test resume WLAN"); + if (!test_and_clear_bit(HDD_FA_SUSPENDED_BIT, &fake_apps_state)) { + hdd_info("Not unit-test suspended; Nothing to do"); + return; + } + + /* disable wake irq */ + pld_disable_irq(qdf_dev->dev, CE_WAKE_IRQ); + + resume_err = wlan_hdd_bus_resume_noirq(); + QDF_BUG(resume_err == 0); + + /* simulate kernel enable irqs */ + for (i = 0; i < CE_IRQ_COUNT; i++) + pld_enable_irq(qdf_dev->dev, i); + + resume_err = wlan_hdd_bus_resume(); + QDF_BUG(resume_err == 0); + + resume_err = wlan_hdd_cfg80211_resume_wlan(wiphy); + QDF_BUG(resume_err == 0); +} /** * hdd_wlan_fake_apps_resume_irq_callback() - Irq callback function for resuming @@ -2383,12 +2433,6 @@ static void hdd_wlan_fake_apps_resume_irq_callback(uint32_t val) g_wiphy = NULL; } -/** - * hdd_wlan_fake_apps_suspend() - Initiate a unit-test triggered suspend - * @wiphy: wiphy struct from a validated hdd context - * - * Return: Zero on success, suspend related non-zero error code on failure - */ int hdd_wlan_fake_apps_suspend(struct wiphy *wiphy) { qdf_device_t qdf_dev = cds_get_context(QDF_MODULE_ID_QDF_DEVICE); @@ -2446,62 +2490,12 @@ resume_done: return suspend_err; } -/** - * hdd_wlan_fake_apps_resume() - Resume from unit-test triggered suspend - * @wiphy: wiphy struct from a validated hdd context - * - * Return: Zero on success, calls QDF_BUG() on failure - */ int hdd_wlan_fake_apps_resume(struct wiphy *wiphy) { struct hif_opaque_softc *hif_ctx = cds_get_context(QDF_MODULE_ID_HIF); - int err; hif_fake_apps_resume(hif_ctx); - err = __hdd_wlan_fake_apps_resume(wiphy); - if (err) { - hif_fake_apps_suspend(hif_ctx, - hdd_wlan_fake_apps_resume_irq_callback); - return err; - } - - return 0; -} - -/** - * __hdd_wlan_fake_apps_resume() - The core logic for - * hdd_wlan_fake_apps_resume() skipping the call to hif_fake_apps_resume(), - * which is only need for non-irq resume - * @wiphy: wiphy struct from a validated hdd context - * - * Return: Zero on success, calls QDF_BUG() on failure - */ -static int __hdd_wlan_fake_apps_resume(struct wiphy *wiphy) -{ - qdf_device_t qdf_dev = cds_get_context(QDF_MODULE_ID_QDF_DEVICE); - int i, resume_err; - - hdd_info("Unit-test resume WLAN"); - if (!test_and_clear_bit(HDD_FA_SUSPENDED_BIT, &fake_apps_state)) { - hdd_info("Not unit-test suspended; Nothing to do"); - return 0; - } - - /* disable wake irq */ - pld_disable_irq(qdf_dev->dev, CE_WAKE_IRQ); - - resume_err = wlan_hdd_bus_resume_noirq(); - QDF_BUG(resume_err == 0); - - /* simulate kernel enable irqs */ - for (i = 0; i < CE_IRQ_COUNT; i++) - pld_enable_irq(qdf_dev->dev, i); - - resume_err = wlan_hdd_bus_resume(); - QDF_BUG(resume_err == 0); - - resume_err = wlan_hdd_cfg80211_resume_wlan(wiphy); - QDF_BUG(resume_err == 0); + __hdd_wlan_fake_apps_resume(wiphy); return 0; } diff --git a/core/hdd/src/wlan_hdd_regulatory.c b/core/hdd/src/wlan_hdd_regulatory.c index bda6e48d4b6d..4487d5dd2500 100644 --- a/core/hdd/src/wlan_hdd_regulatory.c +++ b/core/hdd/src/wlan_hdd_regulatory.c @@ -173,7 +173,7 @@ struct regulatory *reg) * * Return: bool */ -bool hdd_is_world_regdomain(uint32_t reg_domain) +static bool hdd_is_world_regdomain(uint32_t reg_domain) { uint32_t temp_regd = reg_domain & ~WORLDWIDE_ROAMING_FLAG; diff --git a/core/hdd/src/wlan_hdd_scan.c b/core/hdd/src/wlan_hdd_scan.c index 20c53b3c3c97..5feed800683e 100644 --- a/core/hdd/src/wlan_hdd_scan.c +++ b/core/hdd/src/wlan_hdd_scan.c @@ -598,7 +598,7 @@ static int wlan_hdd_scan_request_enqueue(hdd_adapter_t *adapter, * * Return: QDF_STATUS */ -QDF_STATUS wlan_hdd_scan_request_dequeue(hdd_context_t *hdd_ctx, +static QDF_STATUS wlan_hdd_scan_request_dequeue(hdd_context_t *hdd_ctx, uint32_t scan_id, struct cfg80211_scan_request **req, uint8_t *source, uint32_t *timestamp) { diff --git a/core/hdd/src/wlan_hdd_softap_tx_rx.c b/core/hdd/src/wlan_hdd_softap_tx_rx.c index 8ff10be73848..ab6357535162 100644 --- a/core/hdd/src/wlan_hdd_softap_tx_rx.c +++ b/core/hdd/src/wlan_hdd_softap_tx_rx.c @@ -211,7 +211,8 @@ void hdd_softap_tx_resume_cb(void *adapter_context, bool tx_resume) * * Return: Always returns NETDEV_TX_OK */ -int __hdd_softap_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) +static int __hdd_softap_hard_start_xmit(struct sk_buff *skb, + struct net_device *dev) { sme_ac_enum_type ac = SME_AC_BE; hdd_adapter_t *pAdapter = (hdd_adapter_t *) netdev_priv(dev); diff --git a/core/hdd/src/wlan_hdd_tdls.c b/core/hdd/src/wlan_hdd_tdls.c index 6204e72aee8b..a433ab503abf 100644 --- a/core/hdd/src/wlan_hdd_tdls.c +++ b/core/hdd/src/wlan_hdd_tdls.c @@ -1621,8 +1621,8 @@ static void wlan_hdd_tdls_implicit_enable(tdlsCtx_t *pHddTdlsCtx) * * Return: Void */ -void wlan_hdd_tdls_set_mode(hdd_context_t *pHddCtx, - eTDLSSupportMode tdls_mode, bool bUpdateLast) +static void wlan_hdd_tdls_set_mode(hdd_context_t *pHddCtx, + eTDLSSupportMode tdls_mode, bool bUpdateLast) { hdd_adapter_list_node_t *pAdapterNode = NULL, *pNext = NULL; QDF_STATUS status; @@ -1768,16 +1768,15 @@ int wlan_hdd_tdls_set_params(struct net_device *dev, } /** - * wlan_hdd_tdls_check_and_enable() - check system state and enable tdls + * wlan_hdd_tdls_get_adapter() - check system state and return hdd adapter * @hdd_ctx: hdd context * - * After every disassociation in the system, check whether TDLS - * can be enabled in the system. If TDLS possible return the - * corresponding hdd adapter to enable TDLS. + * If TDLS possible, return the corresponding hdd adapter + * to enable TDLS in the system. * * Return: hdd adapter pointer or NULL. */ -hdd_adapter_t *wlan_hdd_tdls_check_and_enable(hdd_context_t *hdd_ctx) +static hdd_adapter_t *wlan_hdd_tdls_get_adapter(hdd_context_t *hdd_ctx) { if (cds_get_connection_count() > 1) return NULL; @@ -1952,6 +1951,74 @@ void wlan_hdd_update_tdls_info(hdd_adapter_t *adapter, bool tdls_prohibited, } /** + * wlan_hdd_tdls_notify_connect() - Update tdls state for every + * connect event. + * @adapter: hdd adapter + * @csr_roam_info: csr information + * + * After every connect event in the system, check whether TDLS + * can be enabled in the system. If TDLS can be enabled, update the + * TDLS state as needed. + * + * Return: None + */ +void wlan_hdd_tdls_notify_connect(hdd_adapter_t *adapter, + tCsrRoamInfo *csr_roam_info) +{ + hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter); + + hdd_info("Check and update TDLS state"); + + /* Association event */ + if ((adapter->device_mode == QDF_STA_MODE || + adapter->device_mode == QDF_P2P_CLIENT_MODE) && + !hdd_ctx->concurrency_marked) { + wlan_hdd_update_tdls_info(adapter, + csr_roam_info->tdls_prohibited, + csr_roam_info->tdls_chan_swit_prohibited); + } +} + +/** + * wlan_hdd_tdls_notify_disconnect() - Update tdls state for every + * disconnect event. + * @adapter: hdd adapter + * + * After every disconnect event in the system, check whether TDLS + * can be disabled/enabled in the system and update the + * TDLS state as needed. + * + * Return: None + */ +void wlan_hdd_tdls_notify_disconnect(hdd_adapter_t *adapter) +{ + hdd_adapter_t *temp_adapter; + hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter); + + hdd_info("Check and update TDLS state"); + + /* Disassociation event */ + if ((adapter->device_mode == QDF_STA_MODE || + adapter->device_mode == QDF_P2P_CLIENT_MODE) && + !hdd_ctx->concurrency_marked) { + wlan_hdd_update_tdls_info(adapter, true, true); + } + + /* If concurrency is not marked, then we have to + * check, whether TDLS could be enabled in the + * system after this disassoc event. + */ + if (!hdd_ctx->concurrency_marked) { + temp_adapter = wlan_hdd_tdls_get_adapter( + hdd_ctx); + if (NULL != temp_adapter) + wlan_hdd_update_tdls_info(temp_adapter, + false, + false); + } +} + +/** * wlan_hdd_tdls_set_sta_id() - set station ID on a tdls peer * @pAdapter: HDD adapter * @mac: MAC address of a tdls peer @@ -2483,7 +2550,7 @@ void wlan_hdd_tdls_decrement_peer_count(hdd_adapter_t *pAdapter) hdd_err("TDLS set state is not cleared correctly !!!"); pHddCtx->concurrency_marked = false; } - tdls_adapter = wlan_hdd_tdls_check_and_enable(pHddCtx); + tdls_adapter = wlan_hdd_tdls_get_adapter(pHddCtx); if (tdls_adapter) wlan_hdd_update_tdls_info(tdls_adapter, false, false); } @@ -3624,7 +3691,7 @@ int wlan_hdd_tdls_add_station(struct wiphy *wiphy, hddTdlsPeer_t *pTdlsPeer; uint16_t numCurrTdlsPeers; unsigned long rc; - long ret; + int ret; int rate_idx; ENTER(); @@ -3763,16 +3830,15 @@ int wlan_hdd_tdls_add_station(struct wiphy *wiphy, (WAIT_TIME_TDLS_ADD_STA)); if (!rc) { - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, - "%s: timeout waiting for tdls add station indication", - __func__); - return -EPERM; + hdd_err("timeout waiting for tdls add station indication %ld peer link status %u", + rc, pTdlsPeer->link_status); + goto error; } if (QDF_STATUS_SUCCESS != pAdapter->tdlsAddStaStatus) { QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, "%s: Add Station is unsuccessful", __func__); - return -EPERM; + goto error; } return 0; @@ -5135,6 +5201,11 @@ void wlan_hdd_tdls_update_rx_pkt_cnt(hdd_adapter_t *adapter, uint8_t valid_mac_entries; struct qdf_mac_addr *mac_addr; + hdd_ctx = WLAN_HDD_GET_CTX(adapter); + + if (!hdd_ctx->enable_tdls_connection_tracker) + return; + mac_addr = (struct qdf_mac_addr *)(skb->data+QDF_MAC_ADDR_SIZE); if (qdf_is_macaddr_group(mac_addr)) return; @@ -5144,7 +5215,6 @@ void wlan_hdd_tdls_update_rx_pkt_cnt(hdd_adapter_t *adapter, mac_addr, QDF_MAC_ADDR_SIZE) == 0) return; - hdd_ctx = WLAN_HDD_GET_CTX(adapter); tdls_ctx = adapter->sessionCtx.station.pHddTdlsCtx; qdf_spin_lock_bh(&hdd_ctx->tdls_ct_spinlock); @@ -5198,6 +5268,11 @@ void wlan_hdd_tdls_update_tx_pkt_cnt(hdd_adapter_t *adapter, uint8_t valid_mac_entries; struct qdf_mac_addr *mac_addr; + hdd_ctx = WLAN_HDD_GET_CTX(adapter); + + if (!hdd_ctx->enable_tdls_connection_tracker) + return; + mac_addr = (struct qdf_mac_addr *)skb->data; if (qdf_is_macaddr_group(mac_addr)) return; @@ -5207,7 +5282,6 @@ void wlan_hdd_tdls_update_tx_pkt_cnt(hdd_adapter_t *adapter, QDF_MAC_ADDR_SIZE) == 0) return; - hdd_ctx = WLAN_HDD_GET_CTX(adapter); tdls_ctx = adapter->sessionCtx.station.pHddTdlsCtx; qdf_spin_lock_bh(&hdd_ctx->tdls_ct_spinlock); @@ -5817,9 +5891,12 @@ int wlan_hdd_tdls_antenna_switch(hdd_context_t *hdd_ctx, { uint8_t tdls_peer_cnt; uint32_t vdev_nss; - hdd_station_ctx_t *sta_ctx = - WLAN_HDD_GET_STATION_CTX_PTR(adapter); + hdd_station_ctx_t *sta_ctx; + + if (hdd_ctx->connected_peer_count == 0) + return 0; + sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); /* Check whether TDLS antenna switch is in progress */ if (hdd_ctx->tdls_nss_switch_in_progress) { if (hdd_ctx->tdls_nss_teardown_complete == false) { diff --git a/core/hdd/src/wlan_hdd_tsf.c b/core/hdd/src/wlan_hdd_tsf.c index e230925a7cd7..00ba66a82c59 100644 --- a/core/hdd/src/wlan_hdd_tsf.c +++ b/core/hdd/src/wlan_hdd_tsf.c @@ -30,6 +30,7 @@ */ #include "wlan_hdd_main.h" +#include "wlan_hdd_tsf.h" #include "wma_api.h" static struct completion tsf_sync_get_completion_evt; @@ -110,13 +111,13 @@ int hdd_capture_tsf(struct hdd_adapter_s *adapter, uint32_t *buf, int len) * 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) +static 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) +static int hdd_tsf_reset_gpio(struct hdd_adapter_s *adapter) { int ret; ret = wma_cli_set_command((int)adapter->sessionId, diff --git a/core/hdd/src/wlan_hdd_tx_rx.c b/core/hdd/src/wlan_hdd_tx_rx.c index 918973a91cee..56056938c6d8 100644 --- a/core/hdd/src/wlan_hdd_tx_rx.c +++ b/core/hdd/src/wlan_hdd_tx_rx.c @@ -47,18 +47,12 @@ #include <net/ieee80211_radiotap.h> #include "sap_api.h" #include "wlan_hdd_wmm.h" - -#ifdef FEATURE_WLAN_TDLS #include "wlan_hdd_tdls.h" -#endif #include <wlan_hdd_ipa.h> - #include "wlan_hdd_ocb.h" #include "wlan_hdd_lro.h" - #include "cdp_txrx_peer_ops.h" #include "ol_txrx.h" - #include "wlan_hdd_nan_datapath.h" #include "pld_common.h" @@ -408,7 +402,7 @@ static void hdd_get_transmit_sta_id(hdd_adapter_t *adapter, * * Return: Always returns NETDEV_TX_OK */ -int __hdd_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) +static int __hdd_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) { QDF_STATUS status; sme_ac_enum_type ac; @@ -419,8 +413,8 @@ int __hdd_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) hdd_station_ctx_t *pHddStaCtx = &pAdapter->sessionCtx.station; #ifdef QCA_PKT_PROTO_TRACE uint8_t proto_type = 0; -#endif /* QCA_PKT_PROTO_TRACE */ hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(pAdapter); +#endif /* QCA_PKT_PROTO_TRACE */ #ifdef QCA_WIFI_FTM if (hdd_get_conparam() == QDF_GLOBAL_FTM_MODE) { @@ -551,8 +545,7 @@ int __hdd_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) pAdapter->stats.tx_bytes += skb->len; - if (hdd_ctx->enable_tdls_connection_tracker) - wlan_hdd_tdls_update_tx_pkt_cnt(pAdapter, skb); + wlan_hdd_tdls_update_tx_pkt_cnt(pAdapter, skb); ++pAdapter->stats.tx_packets; @@ -965,8 +958,7 @@ QDF_STATUS hdd_rx_packet_cbk(void *context, qdf_nbuf_t rxBuf) qdf_nbuf_data_addr(rxBuf), sizeof(qdf_nbuf_data(rxBuf)), QDF_RX)); - if (pHddCtx->enable_tdls_connection_tracker) - wlan_hdd_tdls_update_rx_pkt_cnt(pAdapter, skb); + wlan_hdd_tdls_update_rx_pkt_cnt(pAdapter, skb); skb->dev = pAdapter->dev; skb->protocol = eth_type_trans(skb, skb->dev); @@ -1107,7 +1099,7 @@ static void wlan_hdd_update_queue_oper_stats(hdd_adapter_t *adapter, * * Return: none */ -void wlan_hdd_update_txq_timestamp(struct net_device *dev) +static void wlan_hdd_update_txq_timestamp(struct net_device *dev) { struct netdev_queue *txq; int i; diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c index 397bdcd2d019..445000efdb33 100644 --- a/core/hdd/src/wlan_hdd_wext.c +++ b/core/hdd/src/wlan_hdd_wext.c @@ -810,7 +810,8 @@ hdd_wlan_get_ibss_mac_addr_from_staid(hdd_adapter_t *pAdapter, * Return: QDF_STATUS_STATUS if the peer was found and displayed, * otherwise an appropriate QDF_STATUS_E_* failure code. */ -QDF_STATUS hdd_wlan_get_ibss_peer_info(hdd_adapter_t *pAdapter, uint8_t staIdx) +static QDF_STATUS hdd_wlan_get_ibss_peer_info(hdd_adapter_t *pAdapter, + uint8_t staIdx) { QDF_STATUS status = QDF_STATUS_E_FAILURE; tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter); @@ -859,7 +860,7 @@ QDF_STATUS hdd_wlan_get_ibss_peer_info(hdd_adapter_t *pAdapter, uint8_t staIdx) * Return: QDF_STATUS_STATUS if the peer information was retrieved and * displayed, otherwise an appropriate QDF_STATUS_E_* failure code. */ -QDF_STATUS hdd_wlan_get_ibss_peer_info_all(hdd_adapter_t *pAdapter) +static QDF_STATUS hdd_wlan_get_ibss_peer_info_all(hdd_adapter_t *pAdapter) { QDF_STATUS status = QDF_STATUS_E_FAILURE; tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter); @@ -1558,7 +1559,7 @@ int wlan_hdd_get_link_speed(hdd_adapter_t *sta_adapter, uint32_t *link_speed) * * Return: None */ -void hdd_statistics_cb(void *pStats, void *pContext) +static void hdd_statistics_cb(void *pStats, void *pContext) { hdd_adapter_t *pAdapter = (hdd_adapter_t *) pContext; hdd_stats_t *pStatsCache = NULL; @@ -1956,7 +1957,7 @@ static int __iw_set_commit(struct net_device *dev, struct iw_request_info *info, * * Return: 0 on success, error number otherwise */ -int iw_set_commit(struct net_device *dev, struct iw_request_info *info, +static int iw_set_commit(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { int ret; @@ -3308,8 +3309,8 @@ static int iw_set_frag_threshold(struct net_device *dev, * Return: 0 on success, non-zero on error */ static int __iw_get_power_mode(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) { hdd_adapter_t *adapter; hdd_context_t *hdd_ctx; @@ -3335,9 +3336,9 @@ static int __iw_get_power_mode(struct net_device *dev, * * Return: 0 on success, error number otherwise */ -int iw_get_power_mode(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) +static int iw_get_power_mode(struct net_device *dev, + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) { int ret; @@ -3358,8 +3359,8 @@ int iw_get_power_mode(struct net_device *dev, * Return: 0 on success, non-zero on error */ static int __iw_set_power_mode(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) { hdd_adapter_t *adapter; hdd_context_t *hdd_ctx; @@ -3385,9 +3386,9 @@ static int __iw_set_power_mode(struct net_device *dev, * * Return: 0 on success, error number otherwise */ -int iw_set_power_mode(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) +static int iw_set_power_mode(struct net_device *dev, + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) { int ret; @@ -8067,6 +8068,7 @@ static int __iw_set_var_ints_getnone(struct net_device *dev, HW_MODE_SS_0x0, HW_MODE_BW_NONE, HW_MODE_DBS_NONE, HW_MODE_AGILE_DFS_NONE, + HW_MODE_SBS_NONE, SIR_UPDATE_REASON_UT); } else if (apps_args[0] == 1) { hdd_err("set hw mode for dual mac"); @@ -8077,6 +8079,7 @@ static int __iw_set_var_ints_getnone(struct net_device *dev, HW_MODE_SS_1x1, HW_MODE_40_MHZ, HW_MODE_DBS, HW_MODE_AGILE_DFS_NONE, + HW_MODE_SBS_NONE, SIR_UPDATE_REASON_UT); } } @@ -9289,8 +9292,8 @@ static int iw_get_statistics(struct net_device *dev, /*Max Len for PNO notification*/ #define MAX_PNO_NOTIFY_LEN 100 -void found_pref_network_cb(void *callbackContext, - tSirPrefNetworkFoundInd *pPrefNetworkFoundInd) +static void found_pref_network_cb(void *callbackContext, + tSirPrefNetworkFoundInd *pPrefNetworkFoundInd) { hdd_adapter_t *pAdapter = (hdd_adapter_t *) callbackContext; union iwreq_data wrqu; @@ -9333,13 +9336,12 @@ void found_pref_network_cb(void *callbackContext, * for each network: * <ssid_len> <ssid> <authentication> <encryption> * <ch_num> <channel_list optional> <bcast_type> <rssi_threshold> - * <number of scan timers> - * for each timer: - * <scan_time> <scan_repeat> + * <scan_time (seconds)> + * <scan_repeat_count (0 means indefinite)> * <suspend mode> * * e.g: - * 1 2 4 test 0 0 3 1 6 11 2 40 5 test2 4 4 6 1 2 3 4 5 6 1 0 2 5 2 300 0 1 + * 1 2 4 test 0 0 3 1 6 11 2 40 5 test2 4 4 6 1 2 3 4 5 6 1 0 5 2 1 * * this translates into: * ----------------------------- @@ -9355,10 +9357,8 @@ void found_pref_network_cb(void *callbackContext, * search on 6 channels 1, 2, 3, 4, 5 and 6 * bcast type is non-bcast (directed probe will be sent) * and must not meet any RSSI threshold - * 2 scan timers: * scan every 5 seconds 2 times - * then scan every 300 seconds until stopped - * enable on suspend + * enable on suspend */ static int __iw_set_pno(struct net_device *dev, struct iw_request_info *info, @@ -9524,6 +9524,17 @@ static int __iw_set_pno(struct net_device *dev, ptr += offset; } /* For ucNetworkCount */ + request.fast_scan_period = 0; + if (sscanf(ptr, "%u %n", &(request.fast_scan_period), &offset) > 0) { + request.fast_scan_period *= MSEC_PER_SEC; + ptr += offset; + } + + request.fast_scan_max_cycles = 0; + if (sscanf(ptr, "%hhu %n", &(request.fast_scan_max_cycles), + &offset) > 0) + ptr += offset; + params = sscanf(ptr, "%hhu %n", &(mode), &offset); request.modePNO = mode; @@ -11136,7 +11147,7 @@ const struct iw_handler_def we_handler_def = { * * Returns: none */ -int hdd_set_wext(hdd_adapter_t *pAdapter) +static int hdd_set_wext(hdd_adapter_t *pAdapter) { hdd_wext_state_t *pwextBuf = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); diff --git a/core/mac/inc/ani_global.h b/core/mac/inc/ani_global.h index b4bb8fb0b8da..83d9cbd4067d 100644 --- a/core/mac/inc/ani_global.h +++ b/core/mac/inc/ani_global.h @@ -978,6 +978,7 @@ typedef struct sAniSirGlobal { int8_t first_scan_bucket_threshold; enum auth_tx_ack_status auth_ack_status; uint8_t user_configured_nss; + bool sta_prefer_80MHz_over_160MHz; } tAniSirGlobal; typedef enum { diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index d4785941ed5e..825fdb196df9 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "S" -#define QWLAN_VERSION_BUILD 29 +#define QWLAN_VERSION_EXTRA "P" +#define QWLAN_VERSION_BUILD 30 -#define QWLAN_VERSIONSTR "5.1.0.29S" +#define QWLAN_VERSIONSTR "5.1.0.30P" #endif /* QWLAN_VERSION_H */ diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index 58d0cd20635c..9610a2274c47 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -3333,6 +3333,7 @@ struct sir_hw_mode_params { uint8_t mac1_bw; uint8_t dbs_cap; uint8_t agile_dfs_cap; + uint8_t sbs_cap; }; /** diff --git a/core/mac/inc/wni_api.h b/core/mac/inc/wni_api.h index 09f6cdb9a044..d55945efa3c1 100644 --- a/core/mac/inc/wni_api.h +++ b/core/mac/inc/wni_api.h @@ -108,11 +108,6 @@ enum eWniMsgTypes { eWNI_SME_UPDATE_NOA, eWNI_SME_CLEAR_DFS_CHANNEL_LIST, eWNI_SME_GET_SNR_REQ, - /* General Power Save Messages */ - eWNI_PMC_MSG_TYPES_BEGIN, - - /* WOWL Messages */ - eWNI_PMC_SMPS_STATE_IND, eWNI_SME_RRM_MSG_TYPE_BEGIN, diff --git a/core/mac/src/cfg/cfg_api.c b/core/mac/src/cfg/cfg_api.c index c351063cff4c..8b15ba20a42f 100644 --- a/core/mac/src/cfg/cfg_api.c +++ b/core/mac/src/cfg/cfg_api.c @@ -71,7 +71,7 @@ uint32_t cfg_need_restart(tpAniSirGlobal pMac, uint16_t cfgId) return !!(pMac->cfg.gCfgEntry[cfgId].control & CFG_CTL_RESTART); } -void cfg_get_strindex(tpAniSirGlobal pMac, uint16_t cfgId) +static void cfg_get_strindex(tpAniSirGlobal pMac, uint16_t cfgId) { uint16_t i = 0; diff --git a/core/mac/src/dph/dph_hash_table.c b/core/mac/src/dph/dph_hash_table.c index 6ff817c03b5d..ae22dd7973fb 100644 --- a/core/mac/src/dph/dph_hash_table.c +++ b/core/mac/src/dph/dph_hash_table.c @@ -96,7 +96,8 @@ void dph_hash_table_class_init(tpAniSirGlobal pMac, * @return None */ -uint16_t hash_function(tpAniSirGlobal pMac, uint8_t staAddr[], uint16_t numSta) +static uint16_t hash_function(tpAniSirGlobal pMac, uint8_t staAddr[], + uint16_t numSta) { int i; uint16_t sum = 0; diff --git a/core/mac/src/pe/include/lim_api.h b/core/mac/src/pe/include/lim_api.h index 9e77bcc44fce..dc78c170d79e 100644 --- a/core/mac/src/pe/include/lim_api.h +++ b/core/mac/src/pe/include/lim_api.h @@ -136,7 +136,6 @@ uint32_t lim_post_msg_high_priority(tpAniSirGlobal mac, tSirMsgQ *msg); * and dispatch to various sub modules within LIM module. */ extern void lim_message_processor(tpAniSirGlobal, tpSirMsgQ); -extern void lim_process_messages(tpAniSirGlobal, tpSirMsgQ); /* DT test alt deferred 2 */ /** * Function to check the LIM state if system is in Scan/Learn state. */ @@ -165,6 +164,23 @@ extern void lim_trigger_sta_deletion(tpAniSirGlobal pMac, tpDphHashNode pStaDs, extern void lim_send_sme_tdls_del_sta_ind(tpAniSirGlobal pMac, tpDphHashNode pStaDs, tpPESession psessionEntry, uint16_t reasonCode); +/** + * lim_set_tdls_flags() - update tdls flags based on newer STA connection + * information + * @roam_sync_ind_ptr: pointer to roam offload structure + * @ft_session_ptr: pointer to PE session + * + * Set TDLS flags as per new STA connection capabilities. + * + * Return: None + */ +void lim_set_tdls_flags(roam_offload_synch_ind *roam_sync_ind_ptr, + tpPESession ft_session_ptr); +#else +static inline void lim_set_tdls_flags(roam_offload_synch_ind *roam_sync_ind_ptr, + tpPESession ft_session_ptr) +{ +} #endif /* / Function that checks for change in AP's capabilties on STA */ diff --git a/core/mac/src/pe/include/lim_session.h b/core/mac/src/pe/include/lim_session.h index b8b34a98fb79..4b36c7ee704c 100644 --- a/core/mac/src/pe/include/lim_session.h +++ b/core/mac/src/pe/include/lim_session.h @@ -344,6 +344,10 @@ typedef struct sPESession /* Added to Support BT-AMP */ uint8_t freePeerIdxTail; uint16_t gLimNumOfCurrentSTAs; #ifdef FEATURE_WLAN_TDLS + /* TDLS parameters to check whether TDLS + * and TDLS channel switch is allowed in the + * AP network + */ uint32_t peerAIDBitmap[2]; bool tdls_prohibited; bool tdls_chan_swit_prohibited; diff --git a/core/mac/src/pe/lim/lim_admit_control.c b/core/mac/src/pe/lim/lim_admit_control.c index a0644c3938c0..2ed47a0ab019 100644 --- a/core/mac/src/pe/lim/lim_admit_control.c +++ b/core/mac/src/pe/lim/lim_admit_control.c @@ -43,6 +43,7 @@ #include "lim_trace.h" #include "lim_send_sme_rsp_messages.h" #include "lim_types.h" +#include "lim_admit_control.h" #define ADMIT_CONTROL_LOGLEVEL LOG1 #define ADMIT_CONTROL_POLICY_LOGLEVEL LOG1 @@ -348,8 +349,9 @@ lim_admit_policy_oversubscription(tpAniSirGlobal mac_ctx, \return eSirRetStatus - status -------------------------------------------------------------*/ -tSirRetStatus lim_admit_policy(tpAniSirGlobal pMac, - tSirMacTspecIE *pTspec, tpPESession psessionEntry) +static tSirRetStatus lim_admit_policy(tpAniSirGlobal pMac, + tSirMacTspecIE *pTspec, + tpPESession psessionEntry) { tSirRetStatus retval = eSIR_FAILURE; tpLimAdmitPolicyInfo pAdmitPolicy = &pMac->lim.admitPolicyInfo; @@ -395,7 +397,7 @@ tSirRetStatus lim_admit_policy(tpAniSirGlobal pMac, /* ----------------------------------------------------------------------------- */ /* delete the specified tspec */ -void lim_tspec_delete(tpAniSirGlobal pMac, tpLimTspecInfo pInfo) +static void lim_tspec_delete(tpAniSirGlobal pMac, tpLimTspecInfo pInfo) { if (pInfo == NULL) return; @@ -500,7 +502,7 @@ lim_tspec_find_by_assoc_id(tpAniSirGlobal pMac, \return eSirRetStatus - status of the comparison -------------------------------------------------------------*/ -tSirRetStatus +static tSirRetStatus lim_find_tspec(tpAniSirGlobal pMac, uint16_t assocId, tSirMacTSInfo *pTsInfo, diff --git a/core/mac/src/pe/lim/lim_api.c b/core/mac/src/pe/lim/lim_api.c index 2700e9ad55b7..136d0e920579 100644 --- a/core/mac/src/pe/lim/lim_api.c +++ b/core/mac/src/pe/lim/lim_api.c @@ -2070,10 +2070,7 @@ QDF_STATUS pe_roam_synch_callback(tpAniSirGlobal mac_ctx, roam_sync_ind_ptr->join_rsp->nss = curr_sta_ds->nss; roam_sync_ind_ptr->join_rsp->max_rate_flags = lim_get_max_rate_flags(mac_ctx, curr_sta_ds); - roam_sync_ind_ptr->join_rsp->tdls_prohibited = - ft_session_ptr->tdls_prohibited; - roam_sync_ind_ptr->join_rsp->tdls_chan_swit_prohibited = - ft_session_ptr->tdls_chan_swit_prohibited; + lim_set_tdls_flags(roam_sync_ind_ptr, ft_session_ptr); roam_sync_ind_ptr->join_rsp->aid = ft_session_ptr->limAID; lim_fill_join_rsp_ht_caps(ft_session_ptr, roam_sync_ind_ptr->join_rsp); ft_session_ptr->limPrevSmeState = ft_session_ptr->limSmeState; diff --git a/core/mac/src/pe/lim/lim_assoc_utils.c b/core/mac/src/pe/lim/lim_assoc_utils.c index 4aae611d0787..6fef5dca4475 100644 --- a/core/mac/src/pe/lim/lim_assoc_utils.c +++ b/core/mac/src/pe/lim/lim_assoc_utils.c @@ -1214,10 +1214,10 @@ lim_decide_ap_protection_on_delete(tpAniSirGlobal mac_ctx, * * Return: None */ -void lim_decide_short_preamble(tpAniSirGlobal mac_ctx, - tpDphHashNode sta_ds, - tpUpdateBeaconParams beacon_params, - tpPESession session_entry) +static void lim_decide_short_preamble(tpAniSirGlobal mac_ctx, + tpDphHashNode sta_ds, + tpUpdateBeaconParams beacon_params, + tpPESession session_entry) { uint32_t i; @@ -1270,7 +1270,7 @@ void lim_decide_short_preamble(tpAniSirGlobal mac_ctx, * the BSS. * Return: None */ -void +static void lim_decide_short_slot(tpAniSirGlobal mac_ctx, tpDphHashNode sta_ds, tpUpdateBeaconParams beacon_params, tpPESession session_entry) @@ -3403,7 +3403,7 @@ lim_del_bss(tpAniSirGlobal pMac, tpDphHashNode pStaDs, uint16_t bssIdx, * * Return : void */ -void lim_update_vhtcaps_assoc_resp(tpAniSirGlobal mac_ctx, +static void lim_update_vhtcaps_assoc_resp(tpAniSirGlobal mac_ctx, tpAddBssParams pAddBssParams, tDot11fIEVHTCaps *vht_caps, tpPESession psessionEntry) { @@ -3466,7 +3466,7 @@ void lim_update_vhtcaps_assoc_resp(tpAniSirGlobal mac_ctx, * * Return : void */ -void lim_update_vht_oper_assoc_resp(tpAniSirGlobal mac_ctx, +static void lim_update_vht_oper_assoc_resp(tpAniSirGlobal mac_ctx, tpAddBssParams pAddBssParams, tDot11fIEVHTOperation *vht_oper, tpPESession psessionEntry) { diff --git a/core/mac/src/pe/lim/lim_assoc_utils.h b/core/mac/src/pe/lim/lim_assoc_utils.h index 9e605f16dfa6..80f12be984a0 100644 --- a/core/mac/src/pe/lim/lim_assoc_utils.h +++ b/core/mac/src/pe/lim/lim_assoc_utils.h @@ -219,4 +219,10 @@ static inline void lim_send_sme_tsm_ie_ind(tpAniSirGlobal pMac, {} #endif /* FEATURE_WLAN_ESE */ +tSirRetStatus lim_populate_vht_mcs_set(tpAniSirGlobal pMac, + tpSirSupportedRates pRates, + tDot11fIEVHTCaps *pPeerVHTCaps, + tpPESession psessionEntry, + uint8_t nss); + #endif /* __LIM_ASSOC_UTILS_H */ diff --git a/core/mac/src/pe/lim/lim_ibss_peer_mgmt.c b/core/mac/src/pe/lim/lim_ibss_peer_mgmt.c index c6a14ad1df4e..fe04d3f6b952 100644 --- a/core/mac/src/pe/lim/lim_ibss_peer_mgmt.c +++ b/core/mac/src/pe/lim/lim_ibss_peer_mgmt.c @@ -668,7 +668,8 @@ void lim_ibss_init(tpAniSirGlobal pMac) * @return None */ -void lim_ibss_delete_all_peers(tpAniSirGlobal pMac, tpPESession psessionEntry) +static void lim_ibss_delete_all_peers(tpAniSirGlobal pMac, + tpPESession psessionEntry) { tLimIbssPeerNode *pCurrNode, *pTempNode; tpDphHashNode pStaDs; diff --git a/core/mac/src/pe/lim/lim_p2p.c b/core/mac/src/pe/lim/lim_p2p.c index 9485f127d6e1..096f78a16581 100644 --- a/core/mac/src/pe/lim/lim_p2p.c +++ b/core/mac/src/pe/lim/lim_p2p.c @@ -468,6 +468,7 @@ static void lim_tx_action_frame(tpAniSirGlobal mac_ctx, * need to go at OFDM rates. And BD rate2 we configured at 6Mbps. */ tx_flag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; + mac_ctx->lim.mgmtFrameSessionId = sme_session_id; if ((SIR_MAC_MGMT_PROBE_RSP == fc->subType) || (mb_msg->noack)) { @@ -483,7 +484,6 @@ static void lim_tx_action_frame(tpAniSirGlobal mac_ctx, true : false); mac_ctx->lim.mgmtFrameSessionId = 0xff; } else { - mac_ctx->lim.mgmtFrameSessionId = mb_msg->sessionId; qdf_status = wma_tx_frameWithTxComplete(mac_ctx, packet, (uint16_t) msg_len, @@ -550,7 +550,9 @@ void lim_send_p2p_action_frame(tpAniSirGlobal mac_ctx, if ((!mac_ctx->lim.gpLimRemainOnChanReq) && (0 != mb_msg->wait)) { lim_log(mac_ctx, LOGE, FL("RemainOnChannel is not running")); + mac_ctx->lim.mgmtFrameSessionId = mb_msg->sessionId; lim_p2p_action_cnf(mac_ctx, false); + mac_ctx->lim.mgmtFrameSessionId = 0xff; return; } sme_session_id = mb_msg->sessionId; diff --git a/core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c b/core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c index 81f8714bfab8..359991de6e14 100644 --- a/core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c +++ b/core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c @@ -473,7 +473,7 @@ static void lim_update_stads_ext_cap(tpAniSirGlobal mac_ctx, * * Return: None */ -void lim_stop_reassoc_retry_timer(tpAniSirGlobal mac_ctx) +static void lim_stop_reassoc_retry_timer(tpAniSirGlobal mac_ctx) { mac_ctx->lim.reAssocRetryAttempt = 0; if ((NULL != mac_ctx->lim.pSessionEntry) diff --git a/core/mac/src/pe/lim/lim_process_message_queue.c b/core/mac/src/pe/lim/lim_process_message_queue.c index 37b326b6e863..2229f7f9bae7 100644 --- a/core/mac/src/pe/lim/lim_process_message_queue.c +++ b/core/mac/src/pe/lim/lim_process_message_queue.c @@ -1256,34 +1256,6 @@ void lim_process_abort_scan_ind(tpAniSirGlobal mac_ctx, return; } -/** - * lim_message_processor() - Process messages from LIM. - * - * @mac_ctx: Pointer to the Global Mac Context. - * @msg: Received LIM message. - * - * Wrapper function for lim_process_messages when handling messages received by - * LIM.Could either defer messages or process them. - * - * Return: None. - */ -void lim_message_processor(tpAniSirGlobal mac_ctx, tpSirMsgQ msg) -{ - if (eLIM_MLM_OFFLINE_STATE == mac_ctx->lim.gLimMlmState) { - pe_free_msg(mac_ctx, msg); - return; - } - - if (!def_msg_decision(mac_ctx, msg)) { - lim_process_messages(mac_ctx, msg); - /* process deferred message queue if allowed */ - if ((!(mac_ctx->lim.gLimAddtsSent)) && - (!(lim_is_system_in_scan_state(mac_ctx))) && - (true == GET_LIM_PROCESS_DEFD_MESGS(mac_ctx))) - lim_process_deferred_message_queue(mac_ctx); - } -} - static void lim_process_sme_obss_scan_ind(tpAniSirGlobal mac_ctx, struct sSirMsgQ *msg) { @@ -1319,12 +1291,12 @@ static void lim_process_sme_obss_scan_ind(tpAniSirGlobal mac_ctx, /** * lim_process_messages() - Process messages from upper layers. * - * @mac_ctx: Pointer to the Global Mac Context. - * @msg: Received message. + * @mac_ctx: Pointer to the Global Mac Context. + * @msg: Received message. * * Return: None. */ -void lim_process_messages(tpAniSirGlobal mac_ctx, tpSirMsgQ msg) +static void lim_process_messages(tpAniSirGlobal mac_ctx, tpSirMsgQ msg) { #ifdef FEATURE_AP_MCC_CH_AVOIDANCE uint8_t vdev_id = 0; @@ -1552,13 +1524,6 @@ void lim_process_messages(tpAniSirGlobal mac_ctx, tpSirMsgQ msg) /* These messages are from HDD.No need to respond to HDD */ lim_process_normal_hdd_msg(mac_ctx, msg, false); break; - - case eWNI_PMC_SMPS_STATE_IND: - if (msg->bodyptr) { - qdf_mem_free(msg->bodyptr); - msg->bodyptr = NULL; - } - break; case eWNI_SME_SEND_ACTION_FRAME_IND: lim_send_p2p_action_frame(mac_ctx, msg); qdf_mem_free(msg->bodyptr); @@ -2043,26 +2008,17 @@ void lim_process_messages(tpAniSirGlobal mac_ctx, tpSirMsgQ msg) } /*** end lim_process_messages() ***/ /** - * lim_process_deferred_message_queue + * lim_process_deferred_message_queue() * - ***FUNCTION: * This function is called by LIM while exiting from Learn * mode. This function fetches messages posted to the LIM * deferred message queue limDeferredMsgQ. * - ***LOGIC: - * - ***ASSUMPTIONS: - * NA - * - ***NOTE: - * NA - * - * @param pMac - Pointer to Global MAC structure + * @pMac: Pointer to Global MAC structure * @return None */ -void lim_process_deferred_message_queue(tpAniSirGlobal pMac) +static void lim_process_deferred_message_queue(tpAniSirGlobal pMac) { tSirMsgQ limMsg = { 0, 0, 0 }; @@ -2090,6 +2046,33 @@ void lim_process_deferred_message_queue(tpAniSirGlobal pMac) } /*** end lim_process_deferred_message_queue() ***/ /** + * lim_message_processor() - Process messages from LIM. + * @mac_ctx: Pointer to the Global Mac Context. + * @msg: Received LIM message. + * + * Wrapper function for lim_process_messages when handling messages received by + * LIM. Could either defer messages or process them. + * + * Return: None. + */ +void lim_message_processor(tpAniSirGlobal mac_ctx, tpSirMsgQ msg) +{ + if (eLIM_MLM_OFFLINE_STATE == mac_ctx->lim.gLimMlmState) { + pe_free_msg(mac_ctx, msg); + return; + } + + if (!def_msg_decision(mac_ctx, msg)) { + lim_process_messages(mac_ctx, msg); + /* process deferred message queue if allowed */ + if ((!(mac_ctx->lim.gLimAddtsSent)) && + (!(lim_is_system_in_scan_state(mac_ctx))) && + (true == GET_LIM_PROCESS_DEFD_MESGS(mac_ctx))) + lim_process_deferred_message_queue(mac_ctx); + } +} + +/** * lim_process_normal_hdd_msg() - Process the message and defer if needed * @mac_ctx : Pointer to Global MAC structure * @msg : The message need to be processed diff --git a/core/mac/src/pe/lim/lim_process_tdls.c b/core/mac/src/pe/lim/lim_process_tdls.c index 58a0addfb16e..b2e15757fba5 100644 --- a/core/mac/src/pe/lim/lim_process_tdls.c +++ b/core/mac/src/pe/lim/lim_process_tdls.c @@ -520,14 +520,16 @@ tSirRetStatus lim_send_tdls_dis_req_frame(tpAniSirGlobal pMac, MAC_ADDR_ARRAY(peer_mac.bytes)); pMac->lim.tdls_frm_session_id = psessionEntry->peSessionId; - qdf_status = wma_tx_frameWithTxComplete(pMac, pPacket, (uint16_t) nBytes, - TXRX_FRM_802_11_DATA, - ANI_TXDIR_TODS, - TID_AC_VI, - lim_tx_complete, pFrame, - lim_mgmt_tdls_tx_complete, - HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME, - smeSessionId, false, 0); + qdf_status = wma_tx_frameWithTxComplete(pMac, pPacket, + (uint16_t) nBytes, + TXRX_FRM_802_11_DATA, + ANI_TXDIR_TODS, + TID_AC_VI, + lim_tx_complete, pFrame, + lim_mgmt_tdls_tx_complete, + HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME | + HAL_USE_PEER_STA_REQUESTED_MASK, + smeSessionId, false, 0); if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { pMac->lim.tdls_frm_session_id = NO_SESSION; lim_log(pMac, LOGE, @@ -935,7 +937,8 @@ wma_tx_frame_with_tx_complete_send(tpAniSirGlobal pMac, void *pPacket, tid, lim_tx_complete, pFrame, lim_mgmt_tdls_tx_complete, - HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME, + HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME + | HAL_USE_PEER_STA_REQUESTED_MASK, smeSessionId, flag, 0); } #else @@ -954,11 +957,21 @@ wma_tx_frame_with_tx_complete_send(tpAniSirGlobal pMac, void *pPacket, tid, lim_tx_complete, pFrame, lim_mgmt_tdls_tx_complete, - HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME, + HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME + | HAL_USE_PEER_STA_REQUESTED_MASK, smeSessionId, false, 0); } #endif +void lim_set_tdls_flags(roam_offload_synch_ind *roam_sync_ind_ptr, + tpPESession ft_session_ptr) +{ + roam_sync_ind_ptr->join_rsp->tdls_prohibited = + ft_session_ptr->tdls_prohibited; + roam_sync_ind_ptr->join_rsp->tdls_chan_swit_prohibited = + ft_session_ptr->tdls_chan_swit_prohibited; +} + /* * TDLS setup Request frame on AP link */ diff --git a/core/mac/src/pe/lim/lim_prop_exts_utils.c b/core/mac/src/pe/lim/lim_prop_exts_utils.c index 1f367b75a469..c263b366d36e 100644 --- a/core/mac/src/pe/lim/lim_prop_exts_utils.c +++ b/core/mac/src/pe/lim/lim_prop_exts_utils.c @@ -224,7 +224,8 @@ lim_extract_ap_capability(tpAniSirGlobal mac_ctx, uint8_t *p_ie, * AP supports Nss > 1 in 160MHz mode then connect the STA * in 2x2 80MHz mode instead of connecting in 160MHz mode. */ - if (vht_ch_wd > WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ) { + if ((vht_ch_wd > WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ) && + mac_ctx->sta_prefer_80MHz_over_160MHz) { if (!(IS_VHT_NSS_1x1(beacon_struct->VHTCaps.txMCSMap)) && (!IS_VHT_NSS_1x1(beacon_struct->VHTCaps.rxMCSMap))) diff --git a/core/mac/src/pe/lim/lim_types.h b/core/mac/src/pe/lim/lim_types.h index 571579dc4d87..5b6ec4673827 100644 --- a/core/mac/src/pe/lim/lim_types.h +++ b/core/mac/src/pe/lim/lim_types.h @@ -539,6 +539,11 @@ static inline tSirRetStatus lim_delete_tdls_peers(tpAniSirGlobal mac_ctx, { return eSIR_SUCCESS; } +static inline void lim_init_tdls_data(tpAniSirGlobal pMac, + tpPESession pSessionEntry) +{ + +} #endif /* Algorithms & Link Monitoring related functions */ @@ -551,9 +556,6 @@ void lim_tear_down_link_with_ap(tpAniSirGlobal, uint8_t, tSirMacReasonCodes); /* / Function that processes Max retries interrupt from TFP */ void limHandleMaxRetriesInterrupt(uint32_t); -/* / Function that processes messages deferred during Learn mode */ -void lim_process_deferred_message_queue(tpAniSirGlobal); - /* / Function that defers the messages received */ uint32_t lim_defer_msg(tpAniSirGlobal, tSirMsgQ *); 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 064b17423e52..a76e2b49b6e9 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 @@ -286,10 +286,6 @@ uint8_t *mac_trace_get_sme_msg_string(uint16_t sme_msg) CASE_RETURN_STRING(eWNI_SME_CLEAR_DFS_CHANNEL_LIST); CASE_RETURN_STRING(eWNI_SME_GET_SNR_REQ); CASE_RETURN_STRING(eWNI_SME_LINK_STATUS_IND); - - CASE_RETURN_STRING(eWNI_PMC_MSG_TYPES_BEGIN); - - CASE_RETURN_STRING(eWNI_PMC_SMPS_STATE_IND); CASE_RETURN_STRING(eWNI_SME_RRM_MSG_TYPE_BEGIN); CASE_RETURN_STRING(eWNI_SME_NEIGHBOR_REPORT_REQ_IND); CASE_RETURN_STRING(eWNI_SME_NEIGHBOR_REPORT_IND); diff --git a/core/pld/inc/pld_common.h b/core/pld/inc/pld_common.h index 4bb77b27cb94..bcf647b0b1a4 100644 --- a/core/pld/inc/pld_common.h +++ b/core/pld/inc/pld_common.h @@ -379,7 +379,4 @@ void *pld_smmu_get_mapping(struct device *dev); int pld_smmu_map(struct device *dev, phys_addr_t paddr, uint32_t *iova_addr, size_t size); unsigned int pld_socinfo_get_serial_number(struct device *dev); - -void pld_enable_irq(struct device *dev, unsigned int ce_id); -void pld_disable_irq(struct device *dev, unsigned int ce_id); #endif diff --git a/core/sme/inc/csr_api.h b/core/sme/inc/csr_api.h index 517a01185aab..f36805226cb5 100644 --- a/core/sme/inc/csr_api.h +++ b/core/sme/inc/csr_api.h @@ -476,10 +476,12 @@ typedef enum { eCSR_ROAM_PREAUTH_STATUS_SUCCESS, eCSR_ROAM_PREAUTH_STATUS_FAILURE, eCSR_ROAM_HANDOVER_SUCCESS, -#ifdef FEATURE_WLAN_TDLS + /* + * TDLS callback events + */ eCSR_ROAM_TDLS_STATUS_UPDATE, eCSR_ROAM_RESULT_MGMT_TX_COMPLETE_IND, -#endif + /* Disaconnect all the clients */ eCSR_ROAM_DISCONNECT_ALL_P2P_CLIENTS, /* Stopbss triggered from SME due to different */ @@ -587,7 +589,7 @@ typedef enum { eCSR_ROAM_RESULT_MAX_ASSOC_EXCEEDED, /* Assoc rejected due to concurrent session running on a diff channel */ eCSR_ROAM_RESULT_ASSOC_FAIL_CON_CHANNEL, -#ifdef FEATURE_WLAN_TDLS + /* TDLS events */ eCSR_ROAM_RESULT_ADD_TDLS_PEER, eCSR_ROAM_RESULT_UPDATE_TDLS_PEER, eCSR_ROAM_RESULT_DELETE_TDLS_PEER, @@ -598,7 +600,6 @@ typedef enum { eCSR_ROAM_RESULT_TDLS_SHOULD_TEARDOWN, eCSR_ROAM_RESULT_TDLS_SHOULD_PEER_DISCONNECTED, eCSR_ROAM_RESULT_TDLS_CONNECTION_TRACKER_NOTIFICATION, -#endif eCSR_ROAM_RESULT_IBSS_PEER_INFO_SUCCESS, eCSR_ROAM_RESULT_IBSS_PEER_INFO_FAILED, @@ -1386,6 +1387,11 @@ typedef struct tagCsrRoamInfo { uint32_t roc_scan_id; uint32_t rxChan; #ifdef FEATURE_WLAN_TDLS + /* + * TDLS parameters to check whether TDLS + * and TDLS channel switch is allowed in the + * AP network + */ uint8_t staType; bool tdls_prohibited; /* per ExtCap in Assoc/Reassoc resp */ bool tdls_chan_swit_prohibited; /* per ExtCap in Assoc/Reassoc resp */ @@ -1740,10 +1746,11 @@ QDF_STATUS csr_roam_issue_ft_roam_offload_synch(tHalHandle hHal, #endif typedef void (*tCsrLinkStatusCallback)(uint8_t status, void *pContext); #ifdef FEATURE_WLAN_TDLS -void csr_roam_fill_tdls_info(tCsrRoamInfo *roam_info, tpSirSmeJoinRsp join_rsp); +void csr_roam_fill_tdls_info(tpAniSirGlobal mac_ctx, tCsrRoamInfo *roam_info, + tpSirSmeJoinRsp join_rsp); #else -static inline void csr_roam_fill_tdls_info(tCsrRoamInfo *roam_info, - tpSirSmeJoinRsp join_rsp) +static inline void csr_roam_fill_tdls_info(tpAniSirGlobal mac_ctx, tCsrRoamInfo *roam_info, + tpSirSmeJoinRsp join_rsp) {} #endif diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h index cfbbe22ec405..ce4bdac75066 100644 --- a/core/sme/inc/sme_api.h +++ b/core/sme/inc/sme_api.h @@ -1323,4 +1323,6 @@ QDF_STATUS sme_encrypt_decrypt_msg(tHalHandle hal, * Return: QDF_STATUS */ QDF_STATUS sme_set_cts2self_for_p2p_go(tHalHandle hal); +void sme_set_prefer_80MHz_over_160MHz(tHalHandle hal, + bool sta_prefer_80MHz_over_160MHz); #endif /* #if !defined( __SME_API_H ) */ diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index 7bfe3c9ff9a4..fe98f63d4264 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -2594,8 +2594,6 @@ QDF_STATUS sme_process_msg(tHalHandle hHal, cds_msg_t *pMsg) qdf_mem_free(pMsg->bodyptr); break; #endif - case eWNI_PMC_SMPS_STATE_IND: - break; case WNI_CFG_SET_CNF: case WNI_CFG_DNLD_CNF: case WNI_CFG_GET_RSP: @@ -11214,6 +11212,18 @@ void sme_get_command_q_status(tHalHandle hHal) return; } +/** + * sme_set_prefer_80MHz_over_160MHz() - API to set sta_prefer_80MHz_over_160MHz + * @hal: The handle returned by macOpen + * @sta_prefer_80MHz_over_160MHz: sta_prefer_80MHz_over_160MHz config param + */ +void sme_set_prefer_80MHz_over_160MHz(tHalHandle hal, + bool sta_prefer_80MHz_over_160MHz) +{ + tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal); + mac_ctx->sta_prefer_80MHz_over_160MHz = sta_prefer_80MHz_over_160MHz; +} + #ifdef WLAN_FEATURE_DSRC /** * sme_set_dot11p_config() - API to set the 802.11p config diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 300ce13d1556..896fa91b593d 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -15340,59 +15340,67 @@ QDF_STATUS csr_process_add_sta_session_command(tpAniSirGlobal pMac, return status; } -QDF_STATUS csr_roam_open_session(tpAniSirGlobal pMac, +QDF_STATUS csr_roam_open_session(tpAniSirGlobal mac_ctx, csr_roam_completeCallback callback, void *pContext, uint8_t *pSelfMacAddr, uint8_t *pbSessionId, uint32_t type, uint32_t subType) { QDF_STATUS status = QDF_STATUS_SUCCESS; - uint32_t i, value = 0; + uint32_t i, value = 0, session_id; union { uint16_t nCfgValue16; tSirMacHTCapabilityInfo htCapInfo; } uHTCapabilityInfo; uint32_t nCfgValue = 0; - tCsrRoamSession *pSession; + tCsrRoamSession *session; *pbSessionId = CSR_SESSION_ID_INVALID; - for (i = 0; i < pMac->sme.max_intf_count; i++) { - sms_log(pMac, LOG1, FL("session:%d active:%d"), i, - pMac->roam.roamSession[i].sessionActive); - if (!CSR_IS_SESSION_VALID(pMac, i)) { - pSession = CSR_GET_SESSION(pMac, i); - if (!pSession) { - sms_log(pMac, LOGE, - FL - ("Session does not exist for interface %d"), + if (QDF_STATUS_SUCCESS == csr_roam_get_session_id_from_bssid(mac_ctx, + (struct qdf_mac_addr *)pSelfMacAddr, + &session_id)) { + sms_log(mac_ctx, LOGE, + FL("Session %d exists with mac address" + MAC_ADDRESS_STR), + session_id, MAC_ADDR_ARRAY(pSelfMacAddr)); + return QDF_STATUS_E_FAILURE; + } + + for (i = 0; i < mac_ctx->sme.max_intf_count; i++) { + sms_log(mac_ctx, LOG1, FL("session:%d active:%d"), i, + mac_ctx->roam.roamSession[i].sessionActive); + if (!CSR_IS_SESSION_VALID(mac_ctx, i)) { + session = CSR_GET_SESSION(mac_ctx, i); + if (!session) { + sms_log(mac_ctx, LOGE, + FL("Session does not exist for interface %d"), i); break; } status = QDF_STATUS_SUCCESS; - pSession->sessionActive = true; - pSession->sessionId = (uint8_t) i; + session->sessionActive = true; + session->sessionId = (uint8_t) i; /* Initialize FT related data structures only in STA mode */ - sme_ft_open(pMac, pSession->sessionId); + sme_ft_open(mac_ctx, session->sessionId); - pSession->callback = callback; - pSession->pContext = pContext; - qdf_mem_copy(&pSession->selfMacAddr, pSelfMacAddr, + session->callback = callback; + session->pContext = pContext; + qdf_mem_copy(&session->selfMacAddr, pSelfMacAddr, sizeof(struct qdf_mac_addr)); *pbSessionId = (uint8_t) i; status = - qdf_mc_timer_init(&pSession->hTimerRoaming, + qdf_mc_timer_init(&session->hTimerRoaming, QDF_TIMER_TYPE_SW, csr_roam_roaming_timer_handler, - &pSession->roamingTimerInfo); + &session->roamingTimerInfo); if (!QDF_IS_STATUS_SUCCESS(status)) { - sms_log(pMac, LOGE, - FL - ("cannot allocate memory for Roaming timer")); + sms_log(mac_ctx, LOGE, + FL("cannot allocate memory for Roaming timer")); break; } /* get the HT capability info */ - if (wlan_cfg_get_int(pMac, WNI_CFG_HT_CAP_INFO, &value) + if (wlan_cfg_get_int(mac_ctx, WNI_CFG_HT_CAP_INFO, &value) != eSIR_SUCCESS) { QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR, @@ -15401,134 +15409,137 @@ QDF_STATUS csr_roam_open_session(tpAniSirGlobal pMac, break; } #ifdef FEATURE_WLAN_BTAMP_UT_RF - status = qdf_mc_timer_init(&pSession->hTimerJoinRetry, + status = qdf_mc_timer_init(&session->hTimerJoinRetry, QDF_TIMER_TYPE_SW, csr_roam_join_retry_timer_handler, - &pSession-> + &session-> joinRetryTimerInfo); if (!QDF_IS_STATUS_SUCCESS(status)) { - sms_log(pMac, LOGE, + sms_log(mac_ctx, LOGE, FL ("cannot allocate memory for join retry timer")); break; } #endif uHTCapabilityInfo.nCfgValue16 = 0xFFFF & value; - pSession->htConfig.ht_rx_ldpc = + session->htConfig.ht_rx_ldpc = uHTCapabilityInfo.htCapInfo.advCodingCap; - pSession->htConfig.ht_tx_stbc = + session->htConfig.ht_tx_stbc = uHTCapabilityInfo.htCapInfo.txSTBC; - pSession->htConfig.ht_rx_stbc = + session->htConfig.ht_rx_stbc = uHTCapabilityInfo.htCapInfo.rxSTBC; - pSession->htConfig.ht_sgi20 = + session->htConfig.ht_sgi20 = uHTCapabilityInfo.htCapInfo.shortGI20MHz; - pSession->htConfig.ht_sgi40 = + session->htConfig.ht_sgi40 = uHTCapabilityInfo.htCapInfo.shortGI40MHz; - wlan_cfg_get_int(pMac, WNI_CFG_VHT_MAX_MPDU_LENGTH, + wlan_cfg_get_int(mac_ctx, WNI_CFG_VHT_MAX_MPDU_LENGTH, &nCfgValue); - pSession->vht_config.max_mpdu_len = nCfgValue; + session->vht_config.max_mpdu_len = nCfgValue; nCfgValue = 0; - wlan_cfg_get_int(pMac, + wlan_cfg_get_int(mac_ctx, WNI_CFG_VHT_SUPPORTED_CHAN_WIDTH_SET, &nCfgValue); - pSession->vht_config.supported_channel_widthset = + session->vht_config.supported_channel_widthset = nCfgValue; nCfgValue = 0; - wlan_cfg_get_int(pMac, WNI_CFG_VHT_LDPC_CODING_CAP, + wlan_cfg_get_int(mac_ctx, WNI_CFG_VHT_LDPC_CODING_CAP, &nCfgValue); - pSession->vht_config.ldpc_coding = nCfgValue; + session->vht_config.ldpc_coding = nCfgValue; nCfgValue = 0; - wlan_cfg_get_int(pMac, WNI_CFG_VHT_SHORT_GI_80MHZ, + wlan_cfg_get_int(mac_ctx, WNI_CFG_VHT_SHORT_GI_80MHZ, &nCfgValue); - pSession->vht_config.shortgi80 = nCfgValue; + session->vht_config.shortgi80 = nCfgValue; nCfgValue = 0; - wlan_cfg_get_int(pMac, + wlan_cfg_get_int(mac_ctx, WNI_CFG_VHT_SHORT_GI_160_AND_80_PLUS_80MHZ, &nCfgValue); - pSession->vht_config.shortgi160and80plus80 = nCfgValue; + session->vht_config.shortgi160and80plus80 = nCfgValue; nCfgValue = 0; - wlan_cfg_get_int(pMac, WNI_CFG_VHT_TXSTBC, &nCfgValue); - pSession->vht_config.tx_stbc = nCfgValue; + wlan_cfg_get_int(mac_ctx, WNI_CFG_VHT_TXSTBC, + &nCfgValue); + session->vht_config.tx_stbc = nCfgValue; nCfgValue = 0; - wlan_cfg_get_int(pMac, WNI_CFG_VHT_RXSTBC, &nCfgValue); - pSession->vht_config.rx_stbc = nCfgValue; + wlan_cfg_get_int(mac_ctx, WNI_CFG_VHT_RXSTBC, + &nCfgValue); + session->vht_config.rx_stbc = nCfgValue; nCfgValue = 0; - wlan_cfg_get_int(pMac, WNI_CFG_VHT_SU_BEAMFORMER_CAP, + wlan_cfg_get_int(mac_ctx, WNI_CFG_VHT_SU_BEAMFORMER_CAP, &nCfgValue); - pSession->vht_config.su_beam_former = nCfgValue; + session->vht_config.su_beam_former = nCfgValue; nCfgValue = 0; - wlan_cfg_get_int(pMac, WNI_CFG_VHT_SU_BEAMFORMEE_CAP, + wlan_cfg_get_int(mac_ctx, WNI_CFG_VHT_SU_BEAMFORMEE_CAP, &nCfgValue); - pSession->vht_config.su_beam_formee = nCfgValue; + session->vht_config.su_beam_formee = nCfgValue; nCfgValue = 0; - wlan_cfg_get_int(pMac, + wlan_cfg_get_int(mac_ctx, WNI_CFG_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED, &nCfgValue); - pSession->vht_config.csnof_beamformer_antSup = + session->vht_config.csnof_beamformer_antSup = nCfgValue; nCfgValue = 0; - wlan_cfg_get_int(pMac, + wlan_cfg_get_int(mac_ctx, WNI_CFG_VHT_NUM_SOUNDING_DIMENSIONS, &nCfgValue); - pSession->vht_config.num_soundingdim = nCfgValue; + session->vht_config.num_soundingdim = nCfgValue; nCfgValue = 0; - wlan_cfg_get_int(pMac, WNI_CFG_VHT_MU_BEAMFORMER_CAP, + wlan_cfg_get_int(mac_ctx, WNI_CFG_VHT_MU_BEAMFORMER_CAP, &nCfgValue); - pSession->vht_config.mu_beam_former = nCfgValue; + session->vht_config.mu_beam_former = nCfgValue; nCfgValue = 0; - wlan_cfg_get_int(pMac, WNI_CFG_VHT_MU_BEAMFORMEE_CAP, + wlan_cfg_get_int(mac_ctx, WNI_CFG_VHT_MU_BEAMFORMEE_CAP, &nCfgValue); - pSession->vht_config.mu_beam_formee = nCfgValue; + session->vht_config.mu_beam_formee = nCfgValue; nCfgValue = 0; - wlan_cfg_get_int(pMac, WNI_CFG_VHT_TXOP_PS, + wlan_cfg_get_int(mac_ctx, WNI_CFG_VHT_TXOP_PS, &nCfgValue); - pSession->vht_config.vht_txops = nCfgValue; + session->vht_config.vht_txops = nCfgValue; nCfgValue = 0; - wlan_cfg_get_int(pMac, WNI_CFG_VHT_HTC_VHTC_CAP, + wlan_cfg_get_int(mac_ctx, WNI_CFG_VHT_HTC_VHTC_CAP, &nCfgValue); - pSession->vht_config.htc_vhtcap = nCfgValue; + session->vht_config.htc_vhtcap = nCfgValue; nCfgValue = 0; - wlan_cfg_get_int(pMac, WNI_CFG_VHT_RX_ANT_PATTERN, + wlan_cfg_get_int(mac_ctx, WNI_CFG_VHT_RX_ANT_PATTERN, &nCfgValue); - pSession->vht_config.rx_antpattern = nCfgValue; + session->vht_config.rx_antpattern = nCfgValue; nCfgValue = 0; - wlan_cfg_get_int(pMac, WNI_CFG_VHT_TX_ANT_PATTERN, + wlan_cfg_get_int(mac_ctx, WNI_CFG_VHT_TX_ANT_PATTERN, &nCfgValue); - pSession->vht_config.tx_antpattern = nCfgValue; + session->vht_config.tx_antpattern = nCfgValue; nCfgValue = 0; - wlan_cfg_get_int(pMac, WNI_CFG_VHT_AMPDU_LEN_EXPONENT, + wlan_cfg_get_int(mac_ctx, + WNI_CFG_VHT_AMPDU_LEN_EXPONENT, &nCfgValue); - pSession->vht_config.max_ampdu_lenexp = nCfgValue; + session->vht_config.max_ampdu_lenexp = nCfgValue; - status = csr_issue_add_sta_for_session_req(pMac, i, + status = csr_issue_add_sta_for_session_req(mac_ctx, i, pSelfMacAddr, type, subType); break; } } - if (pMac->sme.max_intf_count == i) { + if (mac_ctx->sme.max_intf_count == i) { /* No session is available */ - sms_log(pMac, LOGE, + sms_log(mac_ctx, LOGE, "%s: Reached max interfaces: %d! Session creation will fail", - __func__, pMac->sme.max_intf_count); + __func__, mac_ctx->sme.max_intf_count); status = QDF_STATUS_E_RESOURCES; } return status; @@ -19457,11 +19468,16 @@ fail: * * Return: None */ -void csr_roam_fill_tdls_info(tCsrRoamInfo *roam_info, tpSirSmeJoinRsp join_rsp) +void csr_roam_fill_tdls_info(tpAniSirGlobal mac_ctx, tCsrRoamInfo *roam_info, + tpSirSmeJoinRsp join_rsp) { roam_info->tdls_prohibited = join_rsp->tdls_prohibited; roam_info->tdls_chan_swit_prohibited = join_rsp->tdls_chan_swit_prohibited; + sms_log(mac_ctx, LOG1, + FL("tdls:prohibit: %d, chan_swit_prohibit: %d"), + roam_info->tdls_prohibited, + roam_info->tdls_chan_swit_prohibited); } #endif @@ -19706,11 +19722,7 @@ void csr_roam_synch_callback(tpAniSirGlobal mac_ctx, roam_info->chan_info.nss = roam_synch_data->join_rsp->nss; roam_info->chan_info.rate_flags = roam_synch_data->join_rsp->max_rate_flags; - csr_roam_fill_tdls_info(roam_info, roam_synch_data->join_rsp); - sms_log(mac_ctx, LOG1, - FL("tdls:prohibit: %d, chan_swit_prohibit: %d"), - roam_info->tdls_prohibited, - roam_info->tdls_chan_swit_prohibited); + csr_roam_fill_tdls_info(mac_ctx, roam_info, roam_synch_data->join_rsp); #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH src_profile = &roam_synch_data->join_rsp->HTProfile; dst_profile = &conn_profile->HTProfile; diff --git a/core/utils/pktlog/pktlog_internal.c b/core/utils/pktlog/pktlog_internal.c index 4de2086be650..27549c7cfb05 100644 --- a/core/utils/pktlog/pktlog_internal.c +++ b/core/utils/pktlog/pktlog_internal.c @@ -220,6 +220,7 @@ char *pktlog_getbuf(struct ol_pktlog_dev_t *pl_dev, static struct txctl_frm_hdr frm_hdr; +#ifndef HELIUMPLUS static void process_ieee_hdr(void *data) { uint8_t dir; @@ -367,7 +368,9 @@ fill_ieee80211_hdr_data(struct ol_txrx_pdev_t *txrx_pdev, } } +#endif +#ifdef HELIUMPLUS A_STATUS process_tx_info(struct ol_txrx_pdev_t *txrx_pdev, void *data) { /* @@ -398,25 +401,86 @@ A_STATUS process_tx_info(struct ol_txrx_pdev_t *txrx_pdev, void *data) pl_hdr.missed_cnt = (*(pl_tgt_hdr + ATH_PKTLOG_HDR_MISSED_CNT_OFFSET) & ATH_PKTLOG_HDR_MISSED_CNT_MASK) >> ATH_PKTLOG_HDR_MISSED_CNT_SHIFT; -#ifdef HELIUMPLUS pl_hdr.log_type = (*(pl_tgt_hdr + ATH_PKTLOG_HDR_LOG_TYPE_OFFSET) & ATH_PKTLOG_HDR_LOG_TYPE_MASK) >> ATH_PKTLOG_HDR_LOG_TYPE_SHIFT; pl_hdr.macId = (*(pl_tgt_hdr + ATH_PKTLOG_HDR_MAC_ID_OFFSET) & ATH_PKTLOG_HDR_MAC_ID_MASK) >> ATH_PKTLOG_HDR_MAC_ID_SHIFT; + pl_hdr.size = (*(pl_tgt_hdr + ATH_PKTLOG_HDR_SIZE_OFFSET) & + ATH_PKTLOG_HDR_SIZE_MASK) >> ATH_PKTLOG_HDR_SIZE_SHIFT; + pl_hdr.timestamp = *(pl_tgt_hdr + ATH_PKTLOG_HDR_TIMESTAMP_OFFSET); + pl_hdr.type_specific_data = + *(pl_tgt_hdr + ATH_PKTLOG_HDR_TYPE_SPECIFIC_DATA_OFFSET); + pl_info = pl_dev->pl_info; + + if (pl_hdr.log_type == PKTLOG_TYPE_TX_CTRL) { + size_t log_size = sizeof(frm_hdr) + pl_hdr.size; + void *txdesc_hdr_ctl = (void *) + pktlog_getbuf(pl_dev, pl_info, log_size, &pl_hdr); + qdf_assert(txdesc_hdr_ctl); + qdf_assert(pl_hdr.size < (370 * sizeof(u_int32_t))); + + qdf_mem_copy(txdesc_hdr_ctl, &frm_hdr, sizeof(frm_hdr)); + qdf_mem_copy((char *)txdesc_hdr_ctl + sizeof(frm_hdr), + ((void *)data + + sizeof(struct ath_pktlog_hdr)), + pl_hdr.size); + } + + if (pl_hdr.log_type == PKTLOG_TYPE_TX_STAT) { + struct ath_pktlog_tx_status txstat_log; + size_t log_size = pl_hdr.size; + + txstat_log.ds_status = (void *) + pktlog_getbuf(pl_dev, pl_info, + log_size, &pl_hdr); + qdf_assert(txstat_log.ds_status); + qdf_mem_copy(txstat_log.ds_status, + ((void *)data + sizeof(struct ath_pktlog_hdr)), + pl_hdr.size); + } + return A_OK; +} + #else +A_STATUS process_tx_info(struct ol_txrx_pdev_t *txrx_pdev, void *data) +{ + /* + * Must include to process different types + * TX_CTL, TX_STATUS, TX_MSDU_ID, TX_FRM_HDR + */ + struct ol_pktlog_dev_t *pl_dev; + struct ath_pktlog_hdr pl_hdr; + struct ath_pktlog_info *pl_info; + uint32_t *pl_tgt_hdr; + + if (!txrx_pdev) { + qdf_print("Invalid pdev in %s\n", __func__); + return A_ERROR; + } + qdf_assert(txrx_pdev->pl_dev); + qdf_assert(data); + pl_dev = txrx_pdev->pl_dev; + + pl_tgt_hdr = (uint32_t *) data; + /* + * Makes the short words (16 bits) portable b/w little endian + * and big endian + */ + pl_hdr.flags = (*(pl_tgt_hdr + ATH_PKTLOG_HDR_FLAGS_OFFSET) & + ATH_PKTLOG_HDR_FLAGS_MASK) >> + ATH_PKTLOG_HDR_FLAGS_SHIFT; + pl_hdr.missed_cnt = (*(pl_tgt_hdr + ATH_PKTLOG_HDR_MISSED_CNT_OFFSET) & + ATH_PKTLOG_HDR_MISSED_CNT_MASK) >> + ATH_PKTLOG_HDR_MISSED_CNT_SHIFT; pl_hdr.log_type = (*(pl_tgt_hdr + ATH_PKTLOG_HDR_LOG_TYPE_OFFSET) & ATH_PKTLOG_HDR_LOG_TYPE_MASK) >> ATH_PKTLOG_HDR_LOG_TYPE_SHIFT; -#endif pl_hdr.size = (*(pl_tgt_hdr + ATH_PKTLOG_HDR_SIZE_OFFSET) & ATH_PKTLOG_HDR_SIZE_MASK) >> ATH_PKTLOG_HDR_SIZE_SHIFT; pl_hdr.timestamp = *(pl_tgt_hdr + ATH_PKTLOG_HDR_TIMESTAMP_OFFSET); -#ifdef HELIUMPLUS - pl_hdr.type_specific_data = - *(pl_tgt_hdr + ATH_PKTLOG_HDR_TYPE_SPECIFIC_DATA_OFFSET); -#endif + pl_info = pl_dev->pl_info; if (pl_hdr.log_type == PKTLOG_TYPE_TX_FRM_HDR) { @@ -454,7 +518,6 @@ A_STATUS process_tx_info(struct ol_txrx_pdev_t *txrx_pdev, void *data) } if (pl_hdr.log_type == PKTLOG_TYPE_TX_CTRL) { -#if !defined(HELIUMPLUS) struct ath_pktlog_txctl txctl_log; size_t log_size = sizeof(txctl_log.priv); @@ -482,18 +545,6 @@ A_STATUS process_tx_info(struct ol_txrx_pdev_t *txrx_pdev, void *data) qdf_mem_copy(txctl_log.txdesc_hdr_ctl, &txctl_log.priv, sizeof(txctl_log.priv)); /* Add Protocol information and HT specific information */ -#else - size_t log_size = sizeof(frm_hdr) + pl_hdr.size; - void *txdesc_hdr_ctl = (void *) - pktlog_getbuf(pl_dev, pl_info, log_size, &pl_hdr); - qdf_assert(txdesc_hdr_ctl); - qdf_assert(pl_hdr.size < (370 * sizeof(u_int32_t))); - - qdf_mem_copy(txdesc_hdr_ctl, &frm_hdr, sizeof(frm_hdr)); - qdf_mem_copy((char *)txdesc_hdr_ctl + sizeof(frm_hdr), - ((void *)data + sizeof(struct ath_pktlog_hdr)), - pl_hdr.size); -#endif /* !defined(HELIUMPLUS) */ } if (pl_hdr.log_type == PKTLOG_TYPE_TX_STAT) { @@ -528,6 +579,7 @@ A_STATUS process_tx_info(struct ol_txrx_pdev_t *txrx_pdev, void *data) } return A_OK; } +#endif A_STATUS process_rx_info_remote(void *pdev, void *data) { diff --git a/core/wma/inc/wma.h b/core/wma/inc/wma.h index d2f86a0838ac..91857844c36c 100644 --- a/core/wma/inc/wma.h +++ b/core/wma/inc/wma.h @@ -390,6 +390,94 @@ enum ds_mode { #define WMA_DEFAULT_HW_MODE_INDEX 0xFFFF /** + * WMA hardware mode list bit-mask definitions. + * Bits 4:0, 31:29 are unused. + * + * The below definitions are added corresponding to WMI DBS HW mode + * list to make it independent of firmware changes for WMI definitions. + * Currently these definitions have dependency with BIT positions of + * the existing WMI macros. Thus, if the BIT positions are changed for + * WMI macros, then these macros' BIT definitions are also need to be + * changed. + */ +#define WMA_HW_MODE_MAC0_TX_STREAMS_BITPOS (28) +#define WMA_HW_MODE_MAC0_RX_STREAMS_BITPOS (24) +#define WMA_HW_MODE_MAC1_TX_STREAMS_BITPOS (20) +#define WMA_HW_MODE_MAC1_RX_STREAMS_BITPOS (16) +#define WMA_HW_MODE_MAC0_BANDWIDTH_BITPOS (12) +#define WMA_HW_MODE_MAC1_BANDWIDTH_BITPOS (8) +#define WMA_HW_MODE_DBS_MODE_BITPOS (7) +#define WMA_HW_MODE_AGILE_DFS_MODE_BITPOS (6) +#define WMA_HW_MODE_SBS_MODE_BITPOS (5) + +#define WMA_HW_MODE_MAC0_TX_STREAMS_MASK \ + (0xf << WMA_HW_MODE_MAC0_TX_STREAMS_BITPOS) +#define WMA_HW_MODE_MAC0_RX_STREAMS_MASK \ + (0xf << WMA_HW_MODE_MAC0_RX_STREAMS_BITPOS) +#define WMA_HW_MODE_MAC1_TX_STREAMS_MASK \ + (0xf << WMA_HW_MODE_MAC1_TX_STREAMS_BITPOS) +#define WMA_HW_MODE_MAC1_RX_STREAMS_MASK \ + (0xf << WMA_HW_MODE_MAC1_RX_STREAMS_BITPOS) +#define WMA_HW_MODE_MAC0_BANDWIDTH_MASK \ + (0xf << WMA_HW_MODE_MAC0_BANDWIDTH_BITPOS) +#define WMA_HW_MODE_MAC1_BANDWIDTH_MASK \ + (0xf << WMA_HW_MODE_MAC1_BANDWIDTH_BITPOS) +#define WMA_HW_MODE_DBS_MODE_MASK \ + (0x1 << WMA_HW_MODE_DBS_MODE_BITPOS) +#define WMA_HW_MODE_AGILE_DFS_MODE_MASK \ + (0x1 << WMA_HW_MODE_AGILE_DFS_MODE_BITPOS) +#define WMA_HW_MODE_SBS_MODE_MASK \ + (0x1 << WMA_HW_MODE_SBS_MODE_BITPOS) + +#define WMA_HW_MODE_MAC0_TX_STREAMS_SET(hw_mode, value) \ + WMI_SET_BITS(hw_mode, WMA_HW_MODE_MAC0_TX_STREAMS_BITPOS, 4, value) +#define WMA_HW_MODE_MAC0_RX_STREAMS_SET(hw_mode, value) \ + WMI_SET_BITS(hw_mode, WMA_HW_MODE_MAC0_RX_STREAMS_BITPOS, 4, value) +#define WMA_HW_MODE_MAC1_TX_STREAMS_SET(hw_mode, value) \ + WMI_SET_BITS(hw_mode, WMA_HW_MODE_MAC1_TX_STREAMS_BITPOS, 4, value) +#define WMA_HW_MODE_MAC1_RX_STREAMS_SET(hw_mode, value) \ + WMI_SET_BITS(hw_mode, WMA_HW_MODE_MAC1_RX_STREAMS_BITPOS, 4, value) +#define WMA_HW_MODE_MAC0_BANDWIDTH_SET(hw_mode, value) \ + WMI_SET_BITS(hw_mode, WMA_HW_MODE_MAC0_BANDWIDTH_BITPOS, 4, value) +#define WMA_HW_MODE_MAC1_BANDWIDTH_SET(hw_mode, value) \ + WMI_SET_BITS(hw_mode, WMA_HW_MODE_MAC1_BANDWIDTH_BITPOS, 4, value) +#define WMA_HW_MODE_DBS_MODE_SET(hw_mode, value) \ + WMI_SET_BITS(hw_mode, WMA_HW_MODE_DBS_MODE_BITPOS, 1, value) +#define WMA_HW_MODE_AGILE_DFS_SET(hw_mode, value) \ + WMI_SET_BITS(hw_mode, WMA_HW_MODE_AGILE_DFS_MODE_BITPOS, 1, value) +#define WMA_HW_MODE_SBS_MODE_SET(hw_mode, value) \ + WMI_SET_BITS(hw_mode, WMA_HW_MODE_SBS_MODE_BITPOS, 1, value) + +#define WMA_HW_MODE_MAC0_TX_STREAMS_GET(hw_mode) \ + ((hw_mode & WMA_HW_MODE_MAC0_TX_STREAMS_MASK) >> \ + WMA_HW_MODE_MAC0_TX_STREAMS_BITPOS) +#define WMA_HW_MODE_MAC0_RX_STREAMS_GET(hw_mode) \ + ((hw_mode & WMA_HW_MODE_MAC0_RX_STREAMS_MASK) >> \ + WMA_HW_MODE_MAC0_RX_STREAMS_BITPOS) +#define WMA_HW_MODE_MAC1_TX_STREAMS_GET(hw_mode) \ + ((hw_mode & WMA_HW_MODE_MAC1_TX_STREAMS_MASK) >> \ + WMA_HW_MODE_MAC1_TX_STREAMS_BITPOS) +#define WMA_HW_MODE_MAC1_RX_STREAMS_GET(hw_mode) \ + ((hw_mode & WMA_HW_MODE_MAC1_RX_STREAMS_MASK) >> \ + WMA_HW_MODE_MAC1_RX_STREAMS_BITPOS) +#define WMA_HW_MODE_MAC0_BANDWIDTH_GET(hw_mode) \ + ((hw_mode & WMA_HW_MODE_MAC0_BANDWIDTH_MASK) >> \ + WMA_HW_MODE_MAC0_BANDWIDTH_BITPOS) +#define WMA_HW_MODE_MAC1_BANDWIDTH_GET(hw_mode) \ + ((hw_mode & WMA_HW_MODE_MAC1_BANDWIDTH_MASK) >> \ + WMA_HW_MODE_MAC1_BANDWIDTH_BITPOS) +#define WMA_HW_MODE_DBS_MODE_GET(hw_mode) \ + ((hw_mode & WMA_HW_MODE_DBS_MODE_MASK) >> \ + WMA_HW_MODE_DBS_MODE_BITPOS) +#define WMA_HW_MODE_AGILE_DFS_GET(hw_mode) \ + ((hw_mode & WMA_HW_MODE_AGILE_DFS_MODE_MASK) >> \ + WMA_HW_MODE_AGILE_DFS_MODE_BITPOS) +#define WMA_HW_MODE_SBS_MODE_GET(hw_mode) \ + ((hw_mode & WMA_HW_MODE_SBS_MODE_MASK) >> \ + WMA_HW_MODE_SBS_MODE_BITPOS) + + +/** * struct probeTime_dwellTime - probe time, dwell time map * @dwell_time: dwell time * @probe_time: repeat probe time diff --git a/core/wma/inc/wma_api.h b/core/wma/inc/wma_api.h index 295973ba2bc7..58d34ec38724 100644 --- a/core/wma/inc/wma_api.h +++ b/core/wma/inc/wma_api.h @@ -187,7 +187,8 @@ int8_t wma_get_hw_mode_idx_from_dbs_hw_list(enum hw_mode_ss_config mac0_ss, enum hw_mode_ss_config mac1_ss, enum hw_mode_bandwidth mac1_bw, enum hw_mode_dbs_capab dbs, - enum hw_mode_agile_dfs_capab dfs); + enum hw_mode_agile_dfs_capab dfs, + enum hw_mode_sbs_capab sbs); QDF_STATUS wma_get_hw_mode_from_idx(uint32_t idx, struct sir_hw_mode_params *hw_mode); int8_t wma_get_num_dbs_hw_modes(void); @@ -298,7 +299,6 @@ void wma_process_pdev_hw_mode_trans_ind(void *wma, wmi_pdev_hw_mode_transition_event_fixed_param *fixed_param, wmi_pdev_set_hw_mode_response_vdev_mac_entry *vdev_mac_entry, struct sir_hw_mode_trans_ind *hw_mode_trans_ind); -QDF_STATUS wma_set_powersave_config(uint8_t val); QDF_STATUS wma_encrypt_decrypt_msg(WMA_HANDLE wma, struct encrypt_decrypt_req_params *encrypt_decrypt_params); @@ -316,4 +316,13 @@ QDF_STATUS wma_set_cts2self_for_p2p_go(void *wma_handle, uint32_t cts2self_for_p2p_go); QDF_STATUS wma_set_tx_rx_aggregation_size (struct sir_set_tx_rx_aggregation_size *tx_rx_aggregation_size); + +/** + * wma_set_qpower_config() - update qpower config in wma + * @vdev_id: the Id of the vdev to configure + * @qpower: new qpower value + * + * Return: QDF_STATUS_SUCCESS on success, error number otherwise + */ +QDF_STATUS wma_set_qpower_config(uint8_t vdev_id, uint8_t qpower); #endif diff --git a/core/wma/src/wma_dev_if.c b/core/wma/src/wma_dev_if.c index 6a7d2084b79c..49a7a0993cfa 100644 --- a/core/wma/src/wma_dev_if.c +++ b/core/wma/src/wma_dev_if.c @@ -1079,9 +1079,13 @@ void wma_remove_peer(tp_wma_handle wma, uint8_t *bssid, wma->interfaces[vdev_id].peer_count); return; } - if (peer) - ol_txrx_peer_detach(peer); + if (peer) { + if (roam_synch_in_progress) + ol_txrx_peer_detach_force_delete(peer); + else + ol_txrx_peer_detach(peer); + } peer_mac_addr = ol_txrx_peer_get_peer_mac_addr(peer); if (peer_mac_addr == NULL) { WMA_LOGE("%s: peer mac addr is NULL, Can't remove peer with peer_addr %pM vdevid %d peer_count %d", @@ -1146,8 +1150,8 @@ QDF_STATUS wma_create_peer(tp_wma_handle wma, ol_txrx_pdev_handle pdev, WMA_LOGE("%s : Unable to attach peer %pM", __func__, peer_addr); goto err; } - if (roam_synch_in_progress) { + if (roam_synch_in_progress) { WMA_LOGE("%s: LFR3: Created peer %p with peer_addr %pM vdev_id %d," "peer_count - %d", __func__, peer, peer_addr, vdev_id, diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index 3b5f543c30ac..bc2b52d0b308 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -121,8 +121,8 @@ static void wma_service_ready_ext_evt_timeout(void *data) } end: - /* Panic so that we can debug why FW is not responding */ - QDF_BUG(0); + /* Assert here. Panic is being called in insmod thread */ + QDF_ASSERT(0); } /** @@ -4298,16 +4298,17 @@ void wma_dump_dbs_hw_mode(tp_wma_handle wma_handle) param = wma_handle->hw_mode.hw_mode_list[i]; WMA_LOGA("%s:[%d]-MAC0: tx_ss:%d rx_ss:%d bw_idx:%d", __func__, i, - WMI_DBS_HW_MODE_MAC0_TX_STREAMS_GET(param), - WMI_DBS_HW_MODE_MAC0_RX_STREAMS_GET(param), - WMI_DBS_HW_MODE_MAC0_BANDWIDTH_GET(param)); + WMA_HW_MODE_MAC0_TX_STREAMS_GET(param), + WMA_HW_MODE_MAC0_RX_STREAMS_GET(param), + WMA_HW_MODE_MAC0_BANDWIDTH_GET(param)); WMA_LOGA("%s:[%d]-MAC1: tx_ss:%d rx_ss:%d bw_idx:%d", __func__, i, - WMI_DBS_HW_MODE_MAC1_TX_STREAMS_GET(param), - WMI_DBS_HW_MODE_MAC1_RX_STREAMS_GET(param), - WMI_DBS_HW_MODE_MAC1_BANDWIDTH_GET(param)); - WMA_LOGA("%s:[%d] DBS:%d", __func__, i, - WMI_DBS_HW_MODE_DBS_MODE_GET(param)); + WMA_HW_MODE_MAC1_TX_STREAMS_GET(param), + WMA_HW_MODE_MAC1_RX_STREAMS_GET(param), + WMA_HW_MODE_MAC1_BANDWIDTH_GET(param)); + WMA_LOGA("%s:[%d] DBS:%d SBS:%d", __func__, i, + WMA_HW_MODE_DBS_MODE_GET(param), + WMA_HW_MODE_SBS_MODE_GET(param)); } } @@ -5018,6 +5019,7 @@ static void wma_get_hw_mode_params(WMI_MAC_PHY_CAPABILITIES *caps, * @mac1_ss_bw_info: TX-RX streams, BW for MAC1 * @pos: refers to hw_mode_index * @dbs_mode: dbs_mode for the dbs_hw_mode + * @sbs_mode: sbs_mode for the sbs_hw_mode * * This function sets TX-RX stream, bandwidth and DBS mode in * hw_mode_list. @@ -5027,32 +5029,36 @@ static void wma_get_hw_mode_params(WMI_MAC_PHY_CAPABILITIES *caps, static void wma_set_hw_mode_params(t_wma_handle *wma_handle, struct mac_ss_bw_info mac0_ss_bw_info, struct mac_ss_bw_info mac1_ss_bw_info, - uint32_t pos, uint32_t dbs_mode) + uint32_t pos, uint32_t dbs_mode, + uint32_t sbs_mode) { - WMI_DBS_HW_MODE_MAC0_TX_STREAMS_SET( + WMA_HW_MODE_MAC0_TX_STREAMS_SET( wma_handle->hw_mode.hw_mode_list[pos], mac0_ss_bw_info.mac_tx_stream); - WMI_DBS_HW_MODE_MAC0_RX_STREAMS_SET( + WMA_HW_MODE_MAC0_RX_STREAMS_SET( wma_handle->hw_mode.hw_mode_list[pos], mac0_ss_bw_info.mac_rx_stream); - WMI_DBS_HW_MODE_MAC0_BANDWIDTH_SET( + WMA_HW_MODE_MAC0_BANDWIDTH_SET( wma_handle->hw_mode.hw_mode_list[pos], mac0_ss_bw_info.mac_bw); - WMI_DBS_HW_MODE_MAC1_TX_STREAMS_SET( + WMA_HW_MODE_MAC1_TX_STREAMS_SET( wma_handle->hw_mode.hw_mode_list[pos], mac1_ss_bw_info.mac_tx_stream); - WMI_DBS_HW_MODE_MAC1_RX_STREAMS_SET( + WMA_HW_MODE_MAC1_RX_STREAMS_SET( wma_handle->hw_mode.hw_mode_list[pos], mac1_ss_bw_info.mac_rx_stream); - WMI_DBS_HW_MODE_MAC1_BANDWIDTH_SET( + WMA_HW_MODE_MAC1_BANDWIDTH_SET( wma_handle->hw_mode.hw_mode_list[pos], mac1_ss_bw_info.mac_bw); - WMI_DBS_HW_MODE_DBS_MODE_SET( + WMA_HW_MODE_DBS_MODE_SET( wma_handle->hw_mode.hw_mode_list[pos], dbs_mode); - WMI_DBS_HW_MODE_AGILE_DFS_SET( + WMA_HW_MODE_AGILE_DFS_SET( wma_handle->hw_mode.hw_mode_list[pos], - 0); + HW_MODE_AGILE_DFS_NONE); + WMA_HW_MODE_SBS_MODE_SET( + wma_handle->hw_mode.hw_mode_list[pos], + sbs_mode); } /** @@ -5068,7 +5074,8 @@ static QDF_STATUS wma_update_hw_mode_list(t_wma_handle *wma_handle) { struct extended_caps *phy_caps; WMI_MAC_PHY_CAPABILITIES *tmp; - uint32_t i, dbs_mode, hw_config_type, j = 0; + uint32_t i, hw_config_type, j = 0; + uint32_t dbs_mode, sbs_mode; struct mac_ss_bw_info mac0_ss_bw_info = {0}; struct mac_ss_bw_info mac1_ss_bw_info = {0}; @@ -5117,7 +5124,8 @@ static QDF_STATUS wma_update_hw_mode_list(t_wma_handle *wma_handle) wma_get_hw_mode_params(tmp, &mac0_ss_bw_info); hw_config_type = phy_caps->each_hw_mode_cap[i].hw_mode_config_type; - dbs_mode = 0; + dbs_mode = HW_MODE_DBS_NONE; + sbs_mode = HW_MODE_SBS_NONE; mac1_ss_bw_info.mac_tx_stream = 0; mac1_ss_bw_info.mac_rx_stream = 0; mac1_ss_bw_info.mac_bw = 0; @@ -5129,12 +5137,17 @@ static QDF_STATUS wma_update_hw_mode_list(t_wma_handle *wma_handle) /* Update for MAC1 */ tmp = &phy_caps->each_phy_cap_per_hwmode[j++]; wma_get_hw_mode_params(tmp, &mac1_ss_bw_info); - dbs_mode = 1; + if (hw_config_type == WMI_HW_MODE_DBS) + dbs_mode = HW_MODE_DBS; + if ((hw_config_type == WMI_HW_MODE_SBS_PASSIVE) || + (hw_config_type == WMI_HW_MODE_SBS)) + sbs_mode = HW_MODE_SBS; } /* Updating HW mode list */ wma_set_hw_mode_params(wma_handle, mac0_ss_bw_info, - mac1_ss_bw_info, i, dbs_mode); + mac1_ss_bw_info, i, dbs_mode, + sbs_mode); } wma_dump_dbs_hw_mode(wma_handle); return QDF_STATUS_SUCCESS; diff --git a/core/wma/src/wma_power.c b/core/wma/src/wma_power.c index db0ba9243088..e939c5267597 100644 --- a/core/wma/src/wma_power.c +++ b/core/wma/src/wma_power.c @@ -716,119 +716,6 @@ static QDF_STATUS wma_set_force_sleep(tp_wma_handle wma, } /** - * wma_set_qpower_force_sleep() - set qpower params in fw - * @wma: wma handle - * @vdev_id: vdev id - * @enable: value - * - * Return: QDF_STATUS_SUCCESS for success or error code - */ -QDF_STATUS wma_set_qpower_force_sleep(tp_wma_handle wma, uint32_t vdev_id, - uint8_t enable) -{ - QDF_STATUS ret; - uint32_t cfg_data_val = 0; - /* get mac to acess CFG data base */ - struct sAniSirGlobal *mac = cds_get_context(QDF_MODULE_ID_PE); - uint32_t pspoll_count = WMA_DEFAULT_MAX_PSPOLL_BEFORE_WAKE; - - WMA_LOGE("Set QPower Force(1)/Normal(0) Sleep vdevId %d val %d", - vdev_id, enable); - - if (NULL == mac) { - WMA_LOGE("%s: Unable to get PE context", __func__); - return QDF_STATUS_E_NOMEM; - } - - /* Get Configured Ps Poll Count */ - if (wlan_cfg_get_int(mac, WNI_CFG_MAX_PS_POLL, - &cfg_data_val) != eSIR_SUCCESS) { - QDF_TRACE(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_ERROR, - "Failed to get value for WNI_CFG_MAX_PS_POLL"); - } - if (cfg_data_val) { - pspoll_count = (uint32_t) cfg_data_val; - } - - /* Enable QPower */ - ret = wma_unified_set_sta_ps_param(wma->wmi_handle, vdev_id, - WMI_STA_PS_ENABLE_QPOWER, 1); - - if (QDF_IS_STATUS_ERROR(ret)) { - WMA_LOGE("Enable QPower Failed vdevId %d", vdev_id); - return ret; - } - WMA_LOGD("QPower Enabled vdevId %d", vdev_id); - - /* Set the Wake Policy to WMI_STA_PS_RX_WAKE_POLICY_POLL_UAPSD */ - ret = wma_unified_set_sta_ps_param(wma->wmi_handle, vdev_id, - WMI_STA_PS_PARAM_RX_WAKE_POLICY, - WMI_STA_PS_RX_WAKE_POLICY_POLL_UAPSD); - - if (QDF_IS_STATUS_ERROR(ret)) { - WMA_LOGE("Setting wake policy to pspoll/uapsd Failed vdevId %d", - vdev_id); - return ret; - } - WMA_LOGD("Wake policy set to to pspoll/uapsd vdevId %d", vdev_id); - - if (enable) { - /* Set the Tx Wake Threshold */ - ret = wma_unified_set_sta_ps_param(wma->wmi_handle, vdev_id, - WMI_STA_PS_PARAM_TX_WAKE_THRESHOLD, - WMI_STA_PS_TX_WAKE_THRESHOLD_NEVER); - - if (QDF_IS_STATUS_ERROR(ret)) { - WMA_LOGE("Setting TxWake Threshold vdevId %d", vdev_id); - return ret; - } - WMA_LOGD("TxWake Threshold set to TX_WAKE_THRESHOLD_NEVER %d", - vdev_id); - } - - /* Set the QPower Ps Poll Count */ - ret = wma_unified_set_sta_ps_param(wma->wmi_handle, vdev_id, - WMI_STA_PS_PARAM_QPOWER_PSPOLL_COUNT, - pspoll_count); - - if (QDF_IS_STATUS_ERROR(ret)) { - WMA_LOGE("Set QPower Ps Poll Count Failed vdevId %d ps poll cnt %d", - vdev_id, pspoll_count); - return ret; - } - WMA_LOGD("Set QPower Ps Poll Count vdevId %d ps poll cnt %d", - vdev_id, pspoll_count); - - /* Enable Sta Mode Power save */ - ret = wmi_unified_set_sta_ps(wma->wmi_handle, vdev_id, true); - - if (QDF_IS_STATUS_ERROR(ret)) { - WMA_LOGE("Enable Sta Mode Ps Failed vdevId %d", vdev_id); - return ret; - } - - /* Set Listen Interval */ - if (wlan_cfg_get_int(mac, WNI_CFG_LISTEN_INTERVAL, - &cfg_data_val) != eSIR_SUCCESS) { - QDF_TRACE(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_ERROR, - "Failed to get value for WNI_CFG_LISTEN_INTERVAL"); - cfg_data_val = POWERSAVE_DEFAULT_LISTEN_INTERVAL; - } - - ret = wma_vdev_set_param(wma->wmi_handle, vdev_id, - WMI_VDEV_PARAM_LISTEN_INTERVAL, - cfg_data_val); - if (QDF_IS_STATUS_ERROR(ret)) { - /* Even it fails continue Fw will take default LI */ - WMA_LOGE("Failed to Set Listen Interval vdevId %d", vdev_id); - } - WMA_LOGD("Set Listen Interval vdevId %d Listen Intv %d", - vdev_id, cfg_data_val); - - return QDF_STATUS_SUCCESS; -} - -/** * wma_get_qpower_config() - get qpower configuration * @wma: WMA handle * @@ -969,27 +856,21 @@ void wma_disable_sta_ps_mode(tp_wma_handle wma, tpDisablePsParams ps_req) } } -/** - * wma_set_powersave_config() - update power save config in wma - * @val: new power save value - * - * This function update qpower value in wma layer - * - * Return: QDF_STATUS_SUCCESS on success, error number otherwise - */ -QDF_STATUS wma_set_powersave_config(uint8_t val) +QDF_STATUS wma_set_qpower_config(uint8_t vdev_id, uint8_t qpower) { - tp_wma_handle wma_handle; + tp_wma_handle wma = cds_get_context(QDF_MODULE_ID_WMA); - wma_handle = cds_get_context(QDF_MODULE_ID_WMA); - - if (!wma_handle) { + if (!wma) { WMA_LOGE("%s: WMA context is invald!", __func__); return QDF_STATUS_E_INVAL; } - wma_handle->powersave_mode = val; - return QDF_STATUS_SUCCESS; + WMA_LOGI("configuring qpower: %d", qpower); + wma->powersave_mode = qpower; + return wma_unified_set_sta_ps_param(wma->wmi_handle, + vdev_id, + WMI_STA_PS_ENABLE_QPOWER, + wma_get_qpower_config(wma)); } /** diff --git a/core/wma/src/wma_utils.c b/core/wma/src/wma_utils.c index b4aab11b8e34..fd9254d98a7f 100644 --- a/core/wma/src/wma_utils.c +++ b/core/wma/src/wma_utils.c @@ -2534,6 +2534,7 @@ void wma_get_tx_rx_ss_from_config(enum hw_mode_ss_config mac_ss, * @mac1_bw: Bandwidth of MAC1 of type 'hw_mode_bandwidth' * @dbs: DBS capability of type 'hw_mode_dbs_capab' * @dfs: Agile DFS capability of type 'hw_mode_agile_dfs_capab' + * @sbs: SBS capability of type 'hw_mode_sbs_capab' * * Fetches the HW mode index corresponding to the HW mode provided * @@ -2546,12 +2547,13 @@ static int8_t wma_get_matching_hw_mode_index(tp_wma_handle wma, uint32_t mac1_tx_ss, uint32_t mac1_rx_ss, enum hw_mode_bandwidth mac1_bw, enum hw_mode_dbs_capab dbs, - enum hw_mode_agile_dfs_capab dfs) + enum hw_mode_agile_dfs_capab dfs, + enum hw_mode_sbs_capab sbs) { uint32_t i; uint32_t t_mac0_tx_ss, t_mac0_rx_ss, t_mac0_bw; uint32_t t_mac1_tx_ss, t_mac1_rx_ss, t_mac1_bw; - uint32_t dbs_mode, agile_dfs_mode; + uint32_t dbs_mode, agile_dfs_mode, sbs_mode; int8_t found = -EINVAL; if (!wma) { @@ -2560,17 +2562,17 @@ static int8_t wma_get_matching_hw_mode_index(tp_wma_handle wma, } for (i = 0; i < wma->num_dbs_hw_modes; i++) { - t_mac0_tx_ss = WMI_DBS_HW_MODE_MAC0_TX_STREAMS_GET( + t_mac0_tx_ss = WMA_HW_MODE_MAC0_TX_STREAMS_GET( wma->hw_mode.hw_mode_list[i]); if (t_mac0_tx_ss != mac0_tx_ss) continue; - t_mac0_rx_ss = WMI_DBS_HW_MODE_MAC0_RX_STREAMS_GET( + t_mac0_rx_ss = WMA_HW_MODE_MAC0_RX_STREAMS_GET( wma->hw_mode.hw_mode_list[i]); if (t_mac0_rx_ss != mac0_rx_ss) continue; - t_mac0_bw = WMI_DBS_HW_MODE_MAC0_BANDWIDTH_GET( + t_mac0_bw = WMA_HW_MODE_MAC0_BANDWIDTH_GET( wma->hw_mode.hw_mode_list[i]); /* * Firmware advertises max bw capability as CBW 80+80 @@ -2580,31 +2582,36 @@ static int8_t wma_get_matching_hw_mode_index(tp_wma_handle wma, if (t_mac0_bw < mac0_bw) continue; - t_mac1_tx_ss = WMI_DBS_HW_MODE_MAC1_TX_STREAMS_GET( + t_mac1_tx_ss = WMA_HW_MODE_MAC1_TX_STREAMS_GET( wma->hw_mode.hw_mode_list[i]); if (t_mac1_tx_ss != mac1_tx_ss) continue; - t_mac1_rx_ss = WMI_DBS_HW_MODE_MAC1_RX_STREAMS_GET( + t_mac1_rx_ss = WMA_HW_MODE_MAC1_RX_STREAMS_GET( wma->hw_mode.hw_mode_list[i]); if (t_mac1_rx_ss != mac1_rx_ss) continue; - t_mac1_bw = WMI_DBS_HW_MODE_MAC1_BANDWIDTH_GET( + t_mac1_bw = WMA_HW_MODE_MAC1_BANDWIDTH_GET( wma->hw_mode.hw_mode_list[i]); if (t_mac1_bw < mac1_bw) continue; - dbs_mode = WMI_DBS_HW_MODE_DBS_MODE_GET( + dbs_mode = WMA_HW_MODE_DBS_MODE_GET( wma->hw_mode.hw_mode_list[i]); if (dbs_mode != dbs) continue; - agile_dfs_mode = WMI_DBS_HW_MODE_AGILE_DFS_GET( + agile_dfs_mode = WMA_HW_MODE_AGILE_DFS_GET( wma->hw_mode.hw_mode_list[i]); if (agile_dfs_mode != dfs) continue; + sbs_mode = WMA_HW_MODE_SBS_MODE_GET( + wma->hw_mode.hw_mode_list[i]); + if (sbs_mode != sbs) + continue; + found = i; WMA_LOGI("%s: hw_mode index %d found", __func__, i); @@ -2621,9 +2628,10 @@ static int8_t wma_get_matching_hw_mode_index(tp_wma_handle wma, * @mac1_bw: MAC1 bandwidth configuration * @dbs: HW DBS capability * @dfs: HW Agile DFS capability + * @sbs: HW SBS capability * * Get the HW mode index corresponding to the HW modes spatial stream, - * bandwidth, DBS and Agile DFS capability + * bandwidth, DBS, Agile DFS and SBS capability * * Return: Index number if a match is found or -negative value if not found */ @@ -2632,7 +2640,8 @@ int8_t wma_get_hw_mode_idx_from_dbs_hw_list(enum hw_mode_ss_config mac0_ss, enum hw_mode_ss_config mac1_ss, enum hw_mode_bandwidth mac1_bw, enum hw_mode_dbs_capab dbs, - enum hw_mode_agile_dfs_capab dfs) + enum hw_mode_agile_dfs_capab dfs, + enum hw_mode_sbs_capab sbs) { tp_wma_handle wma; uint32_t mac0_tx_ss, mac0_rx_ss; @@ -2651,14 +2660,14 @@ int8_t wma_get_hw_mode_idx_from_dbs_hw_list(enum hw_mode_ss_config mac0_ss, __func__, mac0_tx_ss, mac0_rx_ss, mac0_bw); WMA_LOGI("%s: MAC1: TxSS=%d, RxSS=%d, BW=%d", __func__, mac1_tx_ss, mac1_rx_ss, mac1_bw); - WMA_LOGI("%s: DBS capab=%d, Agile DFS capab=%d", - __func__, dbs, dfs); + WMA_LOGI("%s: DBS=%d, Agile DFS=%d, SBS=%d", + __func__, dbs, dfs, sbs); return wma_get_matching_hw_mode_index(wma, mac0_tx_ss, mac0_rx_ss, mac0_bw, mac1_tx_ss, mac1_rx_ss, mac1_bw, - dbs, dfs); + dbs, dfs, sbs); } /** @@ -2694,14 +2703,15 @@ QDF_STATUS wma_get_hw_mode_from_idx(uint32_t idx, param = wma->hw_mode.hw_mode_list[idx]; - hw_mode->mac0_tx_ss = WMI_DBS_HW_MODE_MAC0_TX_STREAMS_GET(param); - hw_mode->mac0_rx_ss = WMI_DBS_HW_MODE_MAC0_RX_STREAMS_GET(param); - hw_mode->mac0_bw = WMI_DBS_HW_MODE_MAC0_BANDWIDTH_GET(param); - hw_mode->mac1_tx_ss = WMI_DBS_HW_MODE_MAC1_TX_STREAMS_GET(param); - hw_mode->mac1_rx_ss = WMI_DBS_HW_MODE_MAC1_RX_STREAMS_GET(param); - hw_mode->mac1_bw = WMI_DBS_HW_MODE_MAC1_BANDWIDTH_GET(param); - hw_mode->dbs_cap = WMI_DBS_HW_MODE_DBS_MODE_GET(param); - hw_mode->agile_dfs_cap = WMI_DBS_HW_MODE_AGILE_DFS_GET(param); + hw_mode->mac0_tx_ss = WMA_HW_MODE_MAC0_TX_STREAMS_GET(param); + hw_mode->mac0_rx_ss = WMA_HW_MODE_MAC0_RX_STREAMS_GET(param); + hw_mode->mac0_bw = WMA_HW_MODE_MAC0_BANDWIDTH_GET(param); + hw_mode->mac1_tx_ss = WMA_HW_MODE_MAC1_TX_STREAMS_GET(param); + hw_mode->mac1_rx_ss = WMA_HW_MODE_MAC1_RX_STREAMS_GET(param); + hw_mode->mac1_bw = WMA_HW_MODE_MAC1_BANDWIDTH_GET(param); + hw_mode->dbs_cap = WMA_HW_MODE_DBS_MODE_GET(param); + hw_mode->agile_dfs_cap = WMA_HW_MODE_AGILE_DFS_GET(param); + hw_mode->sbs_cap = WMA_HW_MODE_SBS_MODE_GET(param); return QDF_STATUS_SUCCESS; } @@ -2763,7 +2773,7 @@ bool wma_is_hw_dbs_capable(void) for (i = 0; i < wma->num_dbs_hw_modes; i++) { param = wma->hw_mode.hw_mode_list[i]; WMA_LOGI("%s: HW param: %x", __func__, param); - if (WMI_DBS_HW_MODE_DBS_MODE_GET(param)) { + if (WMA_HW_MODE_DBS_MODE_GET(param)) { WMA_LOGI("%s: HW (%d) is DBS capable", __func__, i); found = 1; break; @@ -2866,14 +2876,14 @@ void wma_update_intf_hw_mode_params(uint32_t vdev_id, uint32_t mac_id, wma->interfaces[vdev_id].mac_id = mac_id; if (mac_id == 0) { wma->interfaces[vdev_id].tx_streams = - WMI_DBS_HW_MODE_MAC0_TX_STREAMS_GET(param); + WMA_HW_MODE_MAC0_TX_STREAMS_GET(param); wma->interfaces[vdev_id].rx_streams = - WMI_DBS_HW_MODE_MAC0_RX_STREAMS_GET(param); + WMA_HW_MODE_MAC0_RX_STREAMS_GET(param); } else { wma->interfaces[vdev_id].tx_streams = - WMI_DBS_HW_MODE_MAC1_TX_STREAMS_GET(param); + WMA_HW_MODE_MAC1_TX_STREAMS_GET(param); wma->interfaces[vdev_id].rx_streams = - WMI_DBS_HW_MODE_MAC1_RX_STREAMS_GET(param); + WMA_HW_MODE_MAC1_RX_STREAMS_GET(param); } } @@ -2929,15 +2939,15 @@ QDF_STATUS wma_get_dbs_hw_modes(bool *one_by_one_dbs, bool *two_by_two_dbs) uint32_t t_conf1_tx_ss, t_conf1_rx_ss; uint32_t dbs_mode; - t_conf0_tx_ss = WMI_DBS_HW_MODE_MAC0_TX_STREAMS_GET( + t_conf0_tx_ss = WMA_HW_MODE_MAC0_TX_STREAMS_GET( wma->hw_mode.hw_mode_list[i]); - t_conf0_rx_ss = WMI_DBS_HW_MODE_MAC0_RX_STREAMS_GET( + t_conf0_rx_ss = WMA_HW_MODE_MAC0_RX_STREAMS_GET( wma->hw_mode.hw_mode_list[i]); - t_conf1_tx_ss = WMI_DBS_HW_MODE_MAC1_TX_STREAMS_GET( + t_conf1_tx_ss = WMA_HW_MODE_MAC1_TX_STREAMS_GET( wma->hw_mode.hw_mode_list[i]); - t_conf1_rx_ss = WMI_DBS_HW_MODE_MAC1_RX_STREAMS_GET( + t_conf1_rx_ss = WMA_HW_MODE_MAC1_RX_STREAMS_GET( wma->hw_mode.hw_mode_list[i]); - dbs_mode = WMI_DBS_HW_MODE_DBS_MODE_GET( + dbs_mode = WMA_HW_MODE_DBS_MODE_GET( wma->hw_mode.hw_mode_list[i]); if (((((t_conf0_tx_ss == conf1_tx_ss) && diff --git a/core/wma/src/wma_utils_ut.c b/core/wma/src/wma_utils_ut.c index 45db586d9f9f..8eb5e3d302e8 100644 --- a/core/wma/src/wma_utils_ut.c +++ b/core/wma/src/wma_utils_ut.c @@ -73,7 +73,7 @@ void wma_set_dbs_capability_ut(uint32_t dbs) } for (i = 0; i < wma->num_dbs_hw_modes; i++) { - WMI_DBS_HW_MODE_DBS_MODE_SET(wma->hw_mode.hw_mode_list[i], + WMA_HW_MODE_DBS_MODE_SET(wma->hw_mode.hw_mode_list[i], dbs); } |
