summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2016-07-16 23:31:11 -0600
committerLinux Build Service Account <lnxbuild@localhost>2016-07-16 23:31:11 -0600
commit99c5c5e679344e6bc4a3c1136bea504c936a5e8a (patch)
tree3860352ecf590b58ee28f2f4229b9cc8f65388d5
parenta9dd0be6e01a10ae422600519943f5c6a00183d6 (diff)
parentd942ae5ad692ea2f80ab47e7b70473c451d3e660 (diff)
Promotion of wlan-cld3.driver.lnx.1.1-00059.
CRs Change ID Subject -------------------------------------------------------------------------------------------------------------- 937644 If07608bc7280ab7acd018a547f424d3f3fd6d629 qcacld-3.0: Convert wlan_hdd_cfg80211.c to unified loggi 1037396 Id741f86d2e514c5dc5bfa8164ff37f56cd1ca630 qcacld-3.0: Fix compilation error on disabling MCC to SC 1028205 I66f0e5d147af93100a7780b14636ba6438330584 qcacld-3.0: Remove TDLS wider bandwidth support from VHT 968225 I5775776af376db0d4502df631ccb92e802354c11 qcacld-3.0: Reject TDLS management frames during nss swi 1026370 I4a8dca19ce32944769e85ba5beeae93bb49b29a9 qcacld-3.0: Vote performance qos for high throughput use 962367 I731b520fde226c351464d94033a1ced2888a4d18 qcacld-3.0: Add NDP reason codes in deferred rsp sent fo 962367 I287ad77cbdca4b816f38bea436173b88e6eafc93 qcacld-3.0: Free up ndp sme command resources at sme clo 1037816 I250668c93920a63c9278aefe93491cb5aaa91ca7 qcacld-3.0: Fix chain mask & nss in policy manager conne 1034255 I299b87f6144d0b6452d49ebc9d8ed28ff417723c qcacld-3.0: Fix NULL pointer dereference in __lim_proces 962367 I10bf88d3fff27e1f842b720a598c923983c06c90 qcacld-3.0: Add support for NDP data initiator request 865207 If5855fb1f1bc2a85fd27a34575a009b9f6b1e008 qcacld-3.0: CL 1528698 - update fw common interface file 688141 I0286ed7be3f9b420fc0beaa98fafc537a2033c17 Release 5.1.0.20 1018553 I7c743f32fd1455fc253a00d69bfc9abb7f6743da qcacld-3.0: Refactor WLAN_FEATURE_LPSS 1034255 Ic3ef01d79135effe718cbeec29894f6000de7f07 qcacld-3.0: Fix Null pointer dereference in rrm_process_ 688141 I86ea662a598263979f62f5b9882e8e95269b2b98 Release 5.1.0.18 865207 I74f0948061bee593dc15a0ceaab0a25633bb6dd4 qcacld-3.0: CL 1532157 - update fw common interface file 962367 I1d54c79da127b1dac7ea8c8e0e855e043571ad77 qcacld-3.0: Fix __hdd_hard_start_xmit API for NAN Data I 962367 Ie2230e55ca15f03d76b4b8fc441370335743f87e qcacld-3.0: Un/Register NAN data path WMI event handlers 1034158 I2f9b35449e2a39d381f29df1c280e1301526f1c6 qcacld-3.0: Fix NULL pointer dereferencing in wlan_hdd_S 1034255 I9bf83a2641a4523713b9180679648202ea9c9eef qcacld-3.0: Add for NULL pointer check in sme/csr functi 962367 I12a1d0cf37db22ff0bcb8165cb3f6b3847f8bf5b qcacld-3.0: Add interface changes for supporting NAN dat 1034255 Ieb153e4d263fbc1455b41bec71ec78b7c49558fc qcacld-3.0: Fix out of bound access in convert_qos_mapse 1034748 I42398c9473690a0a8f70f35cc7d5aac87c4ec7e7 qcacld-3.0: Move NULL check before dereferencing pdev 1030380 Icea6228c6491d8b7d0588a699fe7f16d0dd0d3f1 qcacld-3.0: Add check for NDI role in __lim_fresh_scan_r 962367 I1f42c8dab17b3a300db61756c29fc02d3d3bc504 qcacld-3.0: Add messaging interface to support NAN datap 1034255 Ife4e8c907f835f766d6d44815418158cfd305343 qcacld-3.0: Fix out of bound access in wma_process_gtk_o 1019762 Icc96c54aca9fc986c231ac3173f54cf7c7f253aa qcacld-3.0: IPA WDI TX buffer allocation on coherent mem 1034255 I61f681dfd4ff3c7fd2e443f54f6b1713db088250 qcacld-3.0: Fix NULL pointer dereference in csr_is_p2p_s 1018553 Ie12e11b09a143eeca0a0a2d332506d14322217fe qcacld-3.0: Add kernel-doc to wlan_hdd_lpass.c 688141 I2e8b08920704cb243886aefd8a8029823783232b Release 5.1.0.19 1034743 I7a49467c3fdbe85c7255fcce7f135e53658eef63 qcacld-3.0: Fix NULL pointer dereferencing in p2p TX MGM 1039559 Ic50205e84890e6a3bda603ad0f54bebfb2a727ea qcacld-3.0: Remove IBSS from MAX_IBSS_PEERS macro 937644 If41d51bc011d0887b6f73511ac0509bff1722d4a qcacld-3.0: Convert wlan_hdd_cfg80211.c to unified loggi 962367 I304fcc70c0e83d890ae95d2d4ff1b7ce691374e2 qcacld-3.0: Add INI items to enable NAN datapath feature 962367 I84e9ac5ccfe8faaa00dfc448defb81fb792263d5 qcacld-3.0: Add support for NDP vendor commands and NDI 1008872 Ic16020d9e4fce4db71b265b88703f7cef7b8a275 qcacld-3.0: Refactor WMA data commands to fix WIN compil 1037977 Ib3dda42ab46d07fab1847e2590d815c851524960 qcacld-3.0: ipa data path bug fix 1040150 I63ad3268e56aa143818ca691634d0edae45ae61f qcacld-3.0: Fix vendor ID for P2P listen offload 962367 I6ad281d9b3dce66db7bbfd198296d0d086ccf4fb qcacld-3.0: Enable ipv4/ipv6 address notification for ND 1018553 I2ec2c37c48442653619a1e5a2a6c47de944bd9dc qcacld-3.0: Fix camelCase in wlan_hdd_lpass 962367 I93e2c14c59d4cbdfaadcd31e73fe0e3681843ce3 qcacld-3.0: Make ndp_ctx part of station context 937644 Ic990eccfa1e58980aed321352d9a2aca92f736a6 qcacld-3.0: Convert wlan_hdd_cfg80211.c to unified loggi 1034255 I6e2db08703b3beff23f9398d9d1c88e1c6bcb229 qcacld-3.0: Fix NULL pointer dereference in sme_register 937644 I31e5ea914ed1f5aa807ff0ce1c67b6ed64620dee qcacld-3.0: Convert wlan_hdd_cfg80211.c to unified loggi 1012542 Id4585fbbfaeba186075ecc54b35024315d6e0b68 qcacld-3.0: update FW common interface files 1023225 Ib34ada0b2a07b9d428e9b29ad13ce5fe0302d461 qcacld-3.0: Remove unused macros from Kbuild 688141 Iff8c85f2aaf8702c1a02c8e0d177d304ea47de91 Release 5.1.0.16 962367 I1d610696cded1f91b646712e3f8c27659bbae6af qcacld-3.0: Support for NDP Responder Request for Accept 962367 I325843ce7fb8198466cb66ce66710cef999d4581 qcacld-3.0: Process NDP data end indication 937686 I10d5dea38970c8927e95e7b9c300bb2c0fdcfcf0 qcacld-3.0: Convert wlan_hdd_scan.c to unified logging 1034600 I18b19978d89346dc09f72bec7323de1212460dd2 qcacld-3.0: Add skb NULL check in error scenario 1032877 Iedd990427afe22842faecc7b29e4f38220c75684 qcacld-3.0: Implement P2P listen offload feature 1035414 I912194184ae65229ddd7243afa58c56f4579959a qcacld-3.0: Check inputs during vdev register 1032912 I384d4412e5790aaf34175f78163ec98b73588fea qcacld-3.0: Disallow STA+SAP+P2P concurrency scenarios 962367 Ia99bb6b0e1637d052945ed6f4878237b3612bb20 qcacld-3.0: Enable Wake On Wireless events for NAN datap 962367 I94328ef69a3ee4ae6e7af2978bfad5a7ddcb385d qcacld-3.0: Register PE NDP event handler callback with 1035656 I793bd056b32924b484ce7cb264b22c74c8c4cca4 qcacld-3.0: Add validation to avoid buffer overflow 1012542 I194c25045ca978634027a94bc74f22253b1afc86 qcacld-3.0: Correct fw common references in dp layer 1023078 I25bd26ae1292c0a829c1b1634df3ab975ab562c1 qcacld-3.0: Set initial dense status in case of dense ro 951596 Ie0b141fbebe0bfa8a173503fc0ec375095240237 qcacld-3.0: Dynamic antenna switch in TDLS operation 962367 I9d3ff7166fb437f8af79e5bd915022d452b16a35 qcacld-3.0: Delete NAN data peer on confirm with reject 688141 Ic28705b8d3f8cce1cd18a55ddcf873f86291ff2f Release 5.1.0.15 865207 Icc1553c69ab5cf11e499c02922a5b8b28b948055 qcacld-3.0: CL 1525577 - update fw common interface file 1026370 I85591d3c74973c40388a04353b1d32e009a46ec1 qcacld-3.0: wlan rx thread set affinity when need high b 865207 I896b4b53f596df96ec7f023b9301f6a695cd325a qcacld-3.0: CL 1535058 - update fw common interface file 961949 If29c102e59ba0f9df528e988e9d5e517a9849c55 qcacld-3.0: Enhance TDLS antenna switch operation 1036474 I0f2596633084ea97e64fb2c7d9975052d1ac98fb qcacld-3.0: Enable early stop scan by default 688141 I90f4c0c00d4ca85d890bfc01b5bdb3571c235aba Release 5.1.0.21 1034255 I3c46ffe19e98146a5e96781a88295af88274a74f qcacld-3.0: Fix NULL pointer de-reference in wma functio 1018555 I34c145c43507ff882e371d05cb59c7ec73f366e5 qcacld-3.0: Convert wlan_hdd_lpass.c to unified logging 1034746 If7e06e2e46436f96a18d6c6b9ad6fc6afd7a4d8b qcacld-3.0: Add NULL check before dereferencing pdev 1039946 I5f3dbe00f64df123d6947e29bb62b0f8f1524080 qcacld-3.0: Set CT window size while enabling P2P opport 1007598 I77ad747843cae31de1705b7ce8fa80e18c9ca53e qcacld-3.0: Add support for WMI_PDEV_WAL_POWER_DEBUG_CMD 1029145 Idf5c4358ab67983778a56e2fe3a2f21d1adc19e1 qcacld-3.0: Cleanup HT capability global configurations 861917 I437dc3e07737bb653e969406b64cd9dad56fbbcd qcacld-3.0: Handle peer kickout event for STA role 1036390 I9998d4aeb983dc101121a71d791d7ec626e3f5d4 qcacld-3.0: Add NULL checks before dereferencing 962367 Ib0b44168aca24802d8bd86b0665a1060ba3a1bf5 qcacld-3.0: Add NAN datapath enabled flag to HDD context 962367 I2ced33cfa0faf487d8e31275493e8d85251e8c59 qcacld-3.0: Add support for NDP Responder Request 962367 Iddd22a83b0763dab2e7398f4d2cf5b9ada58225a qcacld-3.0: Add support for NAN Data End Request 865207 I19d96379a93e2d860cce249704834f06f271efb0 qcacld-3.0: CL 1534810 - update fw common interface file 1034774 I367d8f93b736c988da3746e0acdd57a6ce2c6a46 qcacld-3.0: Add array boundary check while splitting cha 937690 I4fff38875f9591a6782d0d898b653a56ff7d7946 qcacld-3.0: Convert wlan_hdd_wext.c to unified logging 865207 I2baf13e0ab8f669153b0fb66f2b286c40f1fcc20 qcacld-3.0: CL 1530684 - update fw common interface file 962367 I83f2511a9df569fde791a0da110ac873fb0381dd qcacld-3.0: Delete NDI netdev if start bss fails 969334 I4d886090773a9b19d27a9f68115774b87299d84d qcacld-3.0: Add hif-sdio support (Part 8: - HIF SDIO) 962367 I3efef6adf6c7a974d3e344a7609f8517cd1aa752 qcacld-3.0: Handle request to delete NAN Data Interface 1038414 I17b6a7e266e41b1f9135bb81bf4329c1ae460862 qcacld-3.0: Add NULL check for ol_ctx in bmi_download_fi 865207 I97ca72f102faecfc3d20409b0d4819a09968417c qcacld-3.0: CL 1527207 - update fw common interface file 928394 I4bc01ac8991c593ffcaf6ee532f4594cb8beba16 qcacld-3.0: Fix to avoid acquiring mutex in atomic conte 967907 Ib8b92ac11444b63a0d8002edff35cd9238bb2573 qcacld-3.0: Destroy sap_dfs_cac_timer properly 937644 I54e01d92eafffc2a0c5d966158072f3b2dd101a4 qcacld-3.0: Convert wlan_hdd_cfg80211.c to unified loggi 865207 Ib90306a871febe43a076ae8b104442bbc3a4960c qcacld-3.0: CL 1529540 - update fw common interface file 1028201 I5c640164b3c747a55bde3efc553d2861057ebf42 qcacld-3.0: Fix the incorrect PHY mode problem in TDLS 688141 I8b5c9595128030e430d5d8fbf1130c3f760e9689 Release 5.1.0.22 851524 I4980e047aa158c5de0f4f2a557c83f4555bca840 qcacld-3.0: Revert [qca-cld]Fix for UDP-UL data-stall on 1012542 I28dcdabb5b141d00ad0ce482fec74775b22ace85 qcacld-3.0: update fw common interface files(part-2) 1028694 Icf4a238620c6501a9648cccc05424fa1c617ed13 qcacld-3.0: Update log level in wma_mgmt_rx_process 962367 I99eac7ae3ae495347208e3849e2383e999dcc125 qcacld-3.0: Enable NAN datapath based on target capabili 1036494 I9e1e60a0019e90deab36df5d8ba7822dfa4dcae0 qcacld-3.0: Use interval field provided by DRIVER comman 1034888 Iaf722afb4a450c66f976ad1a3ae4b697657216ef qcacld-3.0: Fix cds_complete_action API from going in in 962367 I585cd89702a2c412783ae93fb1558ed5bfe31fd9 qcacld-3.0: Implement NAN datapath interface create 865207 I9662d4cfee0910706486ae1709749aacd938fa3c qcacld-3.0: CL 1536911 - update fw common interface file 970601 I4dfc8697fd5248d8a16ad5a248d5f06e86a105d0 qcacld-3.0: Fix memory leak in del bss response 968106 I4098e3c5e3a03c4de6ae40c837a5616613623979 qcacld-3.0: Support NSS configuration for TDLS from user 939255 Ia45a8c4acd6a54ff3e56b192c11cea0df97eadaf qcacld-3.0: Fix the invalid SNR value in Host 1012542 I487a18185c406da5c2fb07e2a95cafe4793578aa qcacld-3.0: Add host changes for latest fw common change 962367 Ic9a9dbe393a9a7582a31aa613fb812034819a821 qcacld-3.0: Use hdd_err and hdd_info instead of legacy h 865207 Ib1ba4b9b4ae60ee6e8095d6cfe754bbf2a1c69b2 qcacld-3.0: CL 1527757 - update fw common interface file 962367 I545662de41d4a22a3f1a9f5e037eeaa4050b9d42 qcacld-3.0: Update NAN HDD APIs as per vendor definition 688141 I3b342d728cc280e434833a07b6d8ed6d1d19b98d Release 5.1.0.17 865207 I31ad0432a0d5f49eed55603ae7d9eeedbdd19876 qcacld-3.0: CL 1524945 - update fw common interface file 1022820 I27166f542889e0d5071ae8c558e0227c51064c5f qcacld-3.0: Update log level related to PNO 975657 I3ad523ab21d1383df189d3856f6e0759b1a2bb6a qcacld-3.0: Skip DSRC channels in TDLS operation 968206 I04aa00e1cecfae86570aa89d1743b54d55b2dc84 qcacld-3.0: Skip 2GHz off channels when TDLS base channe 1034888 I57822f47325c03e940b2802fb02900c64d3587e1 qcacld-3.0: Remove deprecated gPolicyManagerEnable INI i 1017437 I397733ca9c46274f9b5c0026f032e3345100a98d qcacld-3.0: Add per CPU interrupt statistics 1029145 1034888 Iccfd1dd2935634d2552f4eaa5cd9d3ab59a7596a qcacld-3.0: Remove deprecated gEnableM2MLimiation INI it 865207 Ia483de75c1ea7caa6526aaddd15886fe6a4404bd qcacld-3.0: CL 1535819 - update fw common interface file 962367 I17fe580661f836d45a518a330a63d2c6de8bcf28 qcacld-3.0: Update NAN HDD APIs as per vendor definition 937644 Ifcd456d13509fcb861a2d8c2f4c3b5d31266ce41 qcacld-3.0: Convert wlan_hdd_cfg80211.c to unified loggi 962367 Ic968e441411033c3eeb9ec39aff4fc308b80bce8 qcacld-3.0: Fix null pointer dereference in wlan_hdd_nan Change-Id: I7205c3e6fdfa05436598191661a0a37261debee1 CRs-Fixed: 961949, 1034774, 1008872, 970601, 1007598, 865207, 968206, 1023225, 1012542, 1040150, 968225, 1023078, 928394, 1037816, 1038414, 851524, 1039559, 1037977, 1036494, 1032877, 1022820, 861917, 937686, 968106, 1029145, 967907, 1034748, 1034158, 1017437, 1034743, 1032912, 1034746, 937644, 1036390, 688141, 1034255, 962367, 1026370, 1036474, 969334, 1030380, 1034600, 1037396, 939255, 1035656, 1028694, 1039946, 975657, 1034888, 1028205, 1035414, 951596, 1028201, 1018553, 1019762, 1018555, 937690
-rw-r--r--Kbuild117
-rw-r--r--core/bmi/inc/ol_fw.h6
-rw-r--r--core/bmi/src/bmi.c19
-rw-r--r--core/cds/inc/cds_api.h13
-rw-r--r--core/cds/inc/cds_concurrency.h19
-rw-r--r--core/cds/inc/cds_reg_service.h1
-rw-r--r--core/cds/inc/cds_sched.h24
-rw-r--r--core/cds/src/cds_api.c3
-rw-r--r--core/cds/src/cds_concurrency.c899
-rw-r--r--core/cds/src/cds_sched.c298
-rw-r--r--core/dp/htt/htt.c3
-rw-r--r--core/dp/htt/htt_fw_stats.c26
-rw-r--r--core/dp/htt/htt_h2t.c57
-rw-r--r--core/dp/htt/htt_rx.c6
-rw-r--r--core/dp/htt/htt_tx.c98
-rw-r--r--core/dp/htt/htt_types.h3
-rw-r--r--core/dp/ol/inc/ol_txrx_ctrl_api.h1
-rw-r--r--core/dp/txrx/ol_txrx.c10
-rw-r--r--core/dp/txrx/ol_txrx_flow_control.c10
-rw-r--r--core/hdd/inc/wlan_hdd_assoc.h31
-rw-r--r--core/hdd/inc/wlan_hdd_cfg.h54
-rw-r--r--core/hdd/inc/wlan_hdd_main.h54
-rw-r--r--core/hdd/inc/wlan_hdd_p2p.h1
-rw-r--r--core/hdd/inc/wlan_hdd_tdls.h23
-rw-r--r--core/hdd/inc/wlan_hdd_tx_rx.h8
-rw-r--r--core/hdd/src/wlan_hdd_assoc.c88
-rw-r--r--core/hdd/src/wlan_hdd_cfg.c76
-rw-r--r--core/hdd/src/wlan_hdd_cfg80211.c1528
-rw-r--r--core/hdd/src/wlan_hdd_cfg80211.h66
-rw-r--r--core/hdd/src/wlan_hdd_conc_ut.c16
-rw-r--r--core/hdd/src/wlan_hdd_hostapd.c58
-rw-r--r--core/hdd/src/wlan_hdd_ioctl.c27
-rw-r--r--core/hdd/src/wlan_hdd_ipa.c12
-rw-r--r--core/hdd/src/wlan_hdd_lpass.c247
-rw-r--r--core/hdd/src/wlan_hdd_lpass.h59
-rw-r--r--core/hdd/src/wlan_hdd_main.c300
-rw-r--r--core/hdd/src/wlan_hdd_nan_datapath.c1933
-rw-r--r--core/hdd/src/wlan_hdd_nan_datapath.h208
-rw-r--r--core/hdd/src/wlan_hdd_p2p.c150
-rw-r--r--core/hdd/src/wlan_hdd_power.c36
-rw-r--r--core/hdd/src/wlan_hdd_scan.c223
-rw-r--r--core/hdd/src/wlan_hdd_softap_tx_rx.c9
-rw-r--r--core/hdd/src/wlan_hdd_stats.c31
-rw-r--r--core/hdd/src/wlan_hdd_stats.h6
-rw-r--r--core/hdd/src/wlan_hdd_tdls.c154
-rw-r--r--core/hdd/src/wlan_hdd_tx_rx.c93
-rw-r--r--core/hdd/src/wlan_hdd_wext.c1129
-rw-r--r--core/mac/inc/ani_global.h2
-rw-r--r--core/mac/inc/qwlan_version.h4
-rw-r--r--core/mac/inc/sir_api.h511
-rw-r--r--core/mac/inc/wni_api.h11
-rw-r--r--core/mac/inc/wni_cfg.h5
-rw-r--r--core/mac/src/cfg/cfg_api.c3
-rw-r--r--core/mac/src/cfg/cfg_proc_msg.c30
-rw-r--r--core/mac/src/include/sir_params.h18
-rw-r--r--core/mac/src/pe/include/lim_api.h2
-rw-r--r--core/mac/src/pe/include/lim_global.h3
-rw-r--r--core/mac/src/pe/lim/lim_api.c47
-rw-r--r--core/mac/src/pe/lim/lim_assoc_utils.c148
-rw-r--r--core/mac/src/pe/lim/lim_link_monitoring_algo.c28
-rw-r--r--core/mac/src/pe/lim/lim_process_assoc_req_frame.c18
-rw-r--r--core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c36
-rw-r--r--core/mac/src/pe/lim/lim_process_cfg_updates.c143
-rw-r--r--core/mac/src/pe/lim/lim_process_message_queue.c7
-rw-r--r--core/mac/src/pe/lim/lim_process_mlm_req_messages.c7
-rw-r--r--core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c15
-rw-r--r--core/mac/src/pe/lim/lim_process_sme_req_messages.c175
-rw-r--r--core/mac/src/pe/lim/lim_process_tdls.c85
-rw-r--r--core/mac/src/pe/lim/lim_send_sme_rsp_messages.c12
-rw-r--r--core/mac/src/pe/lim/lim_sme_req_utils.c2
-rw-r--r--core/mac/src/pe/lim/lim_utils.c53
-rw-r--r--core/mac/src/pe/nan/nan_datapath.c889
-rw-r--r--core/mac/src/pe/nan/nan_datapath.h130
-rw-r--r--core/mac/src/pe/rrm/rrm_api.c3
-rw-r--r--core/mac/src/sys/legacy/src/utils/src/parser_api.c12
-rw-r--r--core/mac/src/sys/legacy/src/utils/src/utils_parser.c9
-rw-r--r--core/sap/src/sap_api_link_cntl.c2
-rw-r--r--core/sap/src/sap_fsm.c17
-rw-r--r--core/sme/inc/csr_api.h63
-rw-r--r--core/sme/inc/sme_api.h12
-rw-r--r--core/sme/inc/sme_inside.h8
-rw-r--r--core/sme/inc/sme_internal.h6
-rw-r--r--core/sme/inc/sme_nan_datapath.h158
-rw-r--r--core/sme/src/common/sme_api.c222
-rw-r--r--core/sme/src/csr/csr_api_roam.c196
-rw-r--r--core/sme/src/csr/csr_api_scan.c43
-rw-r--r--core/sme/src/csr/csr_inside_api.h20
-rw-r--r--core/sme/src/csr/csr_util.c35
-rw-r--r--core/sme/src/nan/nan_datapath_api.c782
-rw-r--r--core/utils/epping/src/epping_main.c6
-rw-r--r--core/utils/fwlog/dbglog_host.h43
-rw-r--r--core/wma/inc/wma.h22
-rw-r--r--core/wma/inc/wma_api.h18
-rw-r--r--core/wma/inc/wma_if.h4
-rw-r--r--core/wma/inc/wma_internal.h11
-rw-r--r--core/wma/inc/wma_tgt_cfg.h4
-rw-r--r--core/wma/src/wma_data.c25
-rw-r--r--core/wma/src/wma_dev_if.c33
-rw-r--r--core/wma/src/wma_features.c243
-rw-r--r--core/wma/src/wma_main.c77
-rw-r--r--core/wma/src/wma_mgmt.c32
-rw-r--r--core/wma/src/wma_nan_datapath.c1245
-rw-r--r--core/wma/src/wma_nan_datapath.h83
-rw-r--r--core/wma/src/wma_ocb.c4
-rw-r--r--core/wma/src/wma_scan_roam.c20
-rw-r--r--core/wma/src/wma_utils.c57
-rw-r--r--target/inc/bmi_msg.h40
-rw-r--r--target/inc/cepci.h6
-rw-r--r--target/inc/dbglog.h57
-rw-r--r--target/inc/dbglog_id.h46
-rw-r--r--target/inc/enet.h5
-rw-r--r--target/inc/htc.h32
-rw-r--r--target/inc/htc_services.h15
-rw-r--r--target/inc/htt_isoc.h246
-rw-r--r--target/inc/ol_fw_tx_dbg.h40
-rw-r--r--target/inc/targaddrs.h101
-rw-r--r--target/inc/wal_rx_desc.h143
-rw-r--r--target/inc/wlan_defs.h36
-rw-r--r--target/inc/wmi_services.h18
-rw-r--r--target/inc/wmi_tlv_defs.h69
-rw-r--r--target/inc/wmi_unified.h244
-rw-r--r--target/inc/wmi_version.h2
-rw-r--r--uapi/linux/osapi_linux.h6
123 files changed, 11690 insertions, 3548 deletions
diff --git a/Kbuild b/Kbuild
index cf509b13a66d..36c5673575d9 100644
--- a/Kbuild
+++ b/Kbuild
@@ -6,6 +6,14 @@ else
KERNEL_BUILD := 0
endif
+ifeq ($(CONFIG_CLD_HL_SDIO_CORE), y)
+ CONFIG_QCA_WIFI_SDIO := 1
+endif
+
+ifeq ($(CONFIG_QCA_WIFI_SDIO), 1)
+ CONFIG_ROME_IF = sdio
+endif
+
ifdef CONFIG_ICNSS
CONFIG_ROME_IF = snoc
endif
@@ -141,6 +149,7 @@ ifeq ($(KERNEL_BUILD), 0)
#enable TSF get feature
CONFIG_WLAN_SYNC_TSF := y
+ifneq ($(CONFIG_ROME_IF),sdio)
#Flag to enable memdump feature
CONFIG_WLAN_FEATURE_MEMDUMP := n
@@ -166,6 +175,7 @@ ifeq ($(KERNEL_BUILD), 0)
CONFIG_WLAN_LRO := n
endif
endif
+endif
ifeq ($(CONFIG_ROME_IF), snoc)
CONFIG_WLAN_TX_FLOW_CONTROL_V2 := y
@@ -349,6 +359,10 @@ HDD_OBJS := $(HDD_SRC_DIR)/wlan_hdd_assoc.o \
$(HDD_SRC_DIR)/wlan_hdd_wowl.o
+ifeq ($(CONFIG_WLAN_FEATURE_LPSS),y)
+HDD_OBJS += $(HDD_SRC_DIR)/wlan_hdd_lpass.o
+endif
+
ifeq ($(CONFIG_WLAN_LRO), y)
HDD_OBJS += $(HDD_SRC_DIR)/wlan_hdd_lro.o
endif
@@ -737,7 +751,9 @@ TXRX_OBJS := $(TXRX_DIR)/ol_txrx.o \
$(TXRX_DIR)/ol_txrx_peer_find.o \
$(TXRX_DIR)/ol_txrx_event.o \
$(TXRX_DIR)/ol_txrx_encap.o \
- $(TXRX_DIR)/ol_tx_send.o
+ $(TXRX_DIR)/ol_tx_send.o \
+ $(TXRX_DIR)/ol_tx_sched.o \
+ $(TXRX_DIR)/ol_tx_classify.o
ifeq ($(CONFIG_WLAN_TX_FLOW_CONTROL_V2), y)
TXRX_OBJS += $(TXRX_DIR)/ol_txrx_flow_control.o
@@ -790,6 +806,11 @@ HIF_DISPATCHER_DIR := $(HIF_DIR)/src/dispatcher
HIF_PCIE_DIR := $(HIF_DIR)/src/pcie
HIF_SNOC_DIR := $(HIF_DIR)/src/snoc
+HIF_SDIO_DIR := $(HIF_DIR)/src/sdio
+
+HIF_SDIO_NATIVE_DIR := $(HIF_SDIO_DIR)/native_sdio
+HIF_SDIO_NATIVE_INC_DIR := $(HIF_SDIO_NATIVE_DIR)/include
+HIF_SDIO_NATIVE_SRC_DIR := $(HIF_SDIO_NATIVE_DIR)/src
HIF_INC := -I$(WLAN_COMMON_INC)/$(HIF_DIR)/inc \
-I$(WLAN_COMMON_INC)/$(HIF_DIR)/src \
@@ -807,15 +828,33 @@ HIF_INC += -I$(WLAN_COMMON_INC)/$(HIF_DISPATCHER_DIR)
HIF_INC += -I$(WLAN_COMMON_INC)/$(HIF_SNOC_DIR)
endif
-HIF_OBJS := $(WLAN_COMMON_ROOT)/$(HIF_DIR)/src/ath_procfs.o \
- $(WLAN_COMMON_ROOT)/$(HIF_CE_DIR)/ce_bmi.o \
- $(WLAN_COMMON_ROOT)/$(HIF_CE_DIR)/ce_diag.o \
- $(WLAN_COMMON_ROOT)/$(HIF_CE_DIR)/ce_main.o \
- $(WLAN_COMMON_ROOT)/$(HIF_CE_DIR)/ce_service.o \
- $(WLAN_COMMON_ROOT)/$(HIF_CE_DIR)/ce_tasklet.o \
- $(WLAN_COMMON_ROOT)/$(HIF_DIR)/src/hif_main.o \
- $(WLAN_COMMON_ROOT)/$(HIF_DIR)/src/mp_dev.o \
- $(WLAN_COMMON_ROOT)/$(HIF_DIR)/src/regtable.o
+ifeq ($(CONFIG_HIF_SDIO), 1)
+HIF_INC += -I$(WLAN_COMMON_INC)/$(HIF_DISPATCHER_DIR)
+HIF_INC += -I$(WLAN_COMMON_INC)/$(HIF_SDIO_DIR)
+HIF_INC += -I$(WLAN_COMMON_INC)/$(HIF_SDIO_NATIVE_INC_DIR)
+endif
+
+HIF_COMMON_OBJS := $(WLAN_COMMON_ROOT)/$(HIF_DIR)/src/ath_procfs.o \
+ $(WLAN_COMMON_ROOT)/$(HIF_DIR)/src/hif_main.o \
+ $(WLAN_COMMON_ROOT)/$(HIF_DIR)/src/mp_dev.o
+
+HIF_CE_OBJS := $(WLAN_COMMON_ROOT)/$(HIF_CE_DIR)/ce_bmi.o \
+ $(WLAN_COMMON_ROOT)/$(HIF_CE_DIR)/ce_diag.o \
+ $(WLAN_COMMON_ROOT)/$(HIF_CE_DIR)/ce_main.o \
+ $(WLAN_COMMON_ROOT)/$(HIF_CE_DIR)/ce_service.o \
+ $(WLAN_COMMON_ROOT)/$(HIF_CE_DIR)/ce_tasklet.o \
+ $(WLAN_COMMON_ROOT)/$(HIF_DIR)/src/regtable.o
+
+HIF_SDIO_OBJS := $(WLAN_COMMON_ROOT)/$(HIF_SDIO_DIR)/hif_sdio_send.o \
+ $(WLAN_COMMON_ROOT)/$(HIF_SDIO_DIR)/hif_bmi_reg_access.o \
+ $(WLAN_COMMON_ROOT)/$(HIF_SDIO_DIR)/hif_diag_reg_access.o \
+ $(WLAN_COMMON_ROOT)/$(HIF_SDIO_DIR)/hif_sdio_dev.o \
+ $(WLAN_COMMON_ROOT)/$(HIF_SDIO_DIR)/hif_sdio.o \
+ $(WLAN_COMMON_ROOT)/$(HIF_SDIO_DIR)/hif_sdio_recv.o \
+ $(WLAN_COMMON_ROOT)/$(HIF_SDIO_DIR)/regtable_sdio.o
+
+HIF_SDIO_NATIVE_OBJS := $(WLAN_COMMON_ROOT)/$(HIF_SDIO_NATIVE_SRC_DIR)/hif.o \
+ $(WLAN_COMMON_ROOT)/$(HIF_SDIO_NATIVE_SRC_DIR)/hif_scatter.o
ifneq ($(CONFIG_ICNSS), y)
HIF_OBJS += $(WLAN_COMMON_ROOT)/$(HIF_CNSS_STUB_DIR)/icnss_stub.o
@@ -827,20 +866,32 @@ endif
HIF_PCIE_OBJS := $(WLAN_COMMON_ROOT)/$(HIF_PCIE_DIR)/if_pci.o
HIF_SNOC_OBJS := $(WLAN_COMMON_ROOT)/$(HIF_SNOC_DIR)/if_snoc.o
+HIF_SDIO_OBJS += $(WLAN_COMMON_ROOT)/$(HIF_SDIO_DIR)/if_sdio.o
HIF_OBJS += $(WLAN_COMMON_ROOT)/$(HIF_DISPATCHER_DIR)/multibus.o
HIF_OBJS += $(WLAN_COMMON_ROOT)/$(HIF_DISPATCHER_DIR)/dummy.o
ifeq ($(CONFIG_HIF_PCI), 1)
HIF_OBJS += $(HIF_PCIE_OBJS)
+HIF_OBJS += $(HIF_COMMON_OBJS)
+HIF_OBJS += $(HIF_CE_OBJS)
HIF_OBJS += $(WLAN_COMMON_ROOT)/$(HIF_DISPATCHER_DIR)/multibus_pci.o
endif
ifeq ($(CONFIG_HIF_SNOC), 1)
HIF_OBJS += $(HIF_SNOC_OBJS)
+HIF_OBJS += $(HIF_COMMON_OBJS)
+HIF_OBJS += $(HIF_CE_OBJS)
HIF_OBJS += $(WLAN_COMMON_ROOT)/$(HIF_DISPATCHER_DIR)/multibus_snoc.o
endif
+ifeq ($(CONFIG_HIF_SDIO), 1)
+HIF_OBJS += $(HIF_SDIO_OBJS)
+HIF_OBJS += $(HIF_SDIO_NATIVE_OBJS)
+HIF_OBJS += $(HIF_COMMON_OBJS)
+HIF_OBJS += $(WLAN_COMMON_ROOT)/$(HIF_DISPATCHER_DIR)/multibus_sdio.o
+endif
+
############ WMA ############
WMA_DIR := core/wma
@@ -887,6 +938,9 @@ endif
ifeq ($(CONFIG_ICNSS),y)
PLD_OBJS += $(PLD_SRC_DIR)/pld_snoc.o
endif
+ifeq ($(CONFIG_CNSS_SDIO),y)
+PLD_OBJS += $(PLD_SRC_DIR)/pld_sdio.o
+endif
TARGET_INC := -I$(WLAN_ROOT)/target/inc
@@ -975,11 +1029,9 @@ EXTRA_CFLAGS += $(INCS)
CDEFINES := -DANI_LITTLE_BYTE_ENDIAN \
-DANI_LITTLE_BIT_ENDIAN \
- -DQC_WLAN_CHIPSET_QCA_CLD \
-DDOT11F_LITTLE_ENDIAN_HOST \
-DANI_COMPILER_TYPE_GCC \
-DANI_OS_TYPE_ANDROID=6 \
- -DWLAN_PERF \
-DPTT_SOCK_SVC_ENABLE \
-Wall\
-Werror\
@@ -1001,8 +1053,6 @@ CDEFINES := -DANI_LITTLE_BYTE_ENDIAN \
-DFEATURE_WLAN_RA_FILTERING\
-DWLAN_NL80211_TESTMODE \
-DFEATURE_WLAN_LPHB \
- -DFEATURE_WLAN_PAL_TIMER_DISABLE \
- -DFEATURE_WLAN_PAL_MEM_DISABLE \
-DQCA_SUPPORT_TX_THROTTLE \
-DWMI_INTERFACE_EVENT_LOGGING \
-DATH_SUPPORT_WAPI \
@@ -1119,10 +1169,6 @@ ifeq ($(CONFIG_PRIMA_WLAN_OKC),y)
CDEFINES += -DFEATURE_WLAN_OKC
endif
-ifeq ($(CONFIG_PRIMA_WLAN_11AC_HIGH_TP),y)
-CDEFINES += -DWLAN_FEATURE_11AC_HIGH_TP
-endif
-
ifeq ($(BUILD_DIAG_VERSION),1)
CDEFINES += -DFEATURE_WLAN_DIAG_SUPPORT
CDEFINES += -DFEATURE_WLAN_DIAG_SUPPORT_CSR
@@ -1139,9 +1185,6 @@ CDEFINES += -DCONFIG_ATH_PCIE_MAX_PERF=0 -DCONFIG_ATH_PCIE_AWAKE_WHILE_DRIVER_LO
CDEFINES += -DQCA_TX_HTT2_SUPPORT
endif
-# enable the MAC Address auto-generation feature
-CDEFINES += -DWLAN_AUTOGEN_MACADDR_FEATURE
-
ifeq ($(CONFIG_WLAN_FEATURE_11W),y)
CDEFINES += -DWLAN_FEATURE_11W
endif
@@ -1213,6 +1256,24 @@ ifeq ($(CONFIG_HIF_SNOC), 1)
CDEFINES += -DHIF_SNOC
endif
+#Enable High Latency related Flags
+ifeq ($(CONFIG_QCA_WIFI_SDIO), 1)
+CDEFINES += -DCONFIG_HL_SUPPORT \
+ -DCONFIG_AR6320_SUPPORT \
+ -DSDIO_3_0 \
+ -DHIF_SDIO \
+ -DCONFIG_DISABLE_CDC_MAX_PERF_WAR=0 \
+ -DCONFIG_ATH_PROCFS_DIAG_SUPPORT \
+ -DFEATURE_HL_GROUP_CREDIT_FLOW_CONTROL \
+ -DHIF_MBOX_SLEEP_WAR \
+ -DDEBUG_HL_LOGGING \
+ -DQCA_BAD_PEER_TX_FLOW_CL \
+ -DCONFIG_TX_DESC_HI_PRIO_RESERVE \
+ -DCONFIG_PER_VDEV_TX_DESC_POOL \
+ -DCONFIG_SDIO \
+ -DFEATURE_WLAN_FORCE_SAP_SCC
+endif
+
#Enable USB specific APIS
ifeq ($(CONFIG_HIF_USB), 1)
CDEFINES += -DHIF_USB
@@ -1332,9 +1393,6 @@ CDEFINES += -DFEATURE_WLAN_STA_AP_MODE_DFS_DISABLE
#Enable OBSS feature
CDEFINES += -DQCA_HT_2040_COEX
-#Disable HT40 in 2.4GHZ STA mode
-CDEFINES += -DQCA_HT_20_24G_STA_ONLY
-
else #CONFIG_MOBILE_ROUTER
#Open P2P device interface only for non-Mobile router use cases
@@ -1388,17 +1446,6 @@ ifeq ($(CONFIG_ATH_PCIE_ACCESS_DEBUG), 1)
CDEFINES += -DCONFIG_ATH_PCIE_ACCESS_DEBUG
endif
-# Some kernel include files are being moved. Check to see if
-# the old version of the files are present
-
-ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/mach-msm/include/mach/msm_smd.h),)
-CDEFINES += -DEXISTS_MSM_SMD
-endif
-
-ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/mach-msm/include/mach/msm_smsm.h),)
-CDEFINES += -DEXISTS_MSM_SMSM
-endif
-
# Enable feature support fo Linux version QCMBR
ifeq ($(CONFIG_LINUX_QCMBR),y)
CDEFINES += -DLINUX_QCMBR
diff --git a/core/bmi/inc/ol_fw.h b/core/bmi/inc/ol_fw.h
index 07a8e9c0222a..5243228970cf 100644
--- a/core/bmi/inc/ol_fw.h
+++ b/core/bmi/inc/ol_fw.h
@@ -38,6 +38,12 @@
#define AR6320_REV2_VERSION AR6320_REV1_1_VERSION
#define AR6320_REV4_VERSION AR6320_REV2_1_VERSION
#define SIGN_HEADER_MAGIC 0x454D4F52
+#define HI_ACS_FLAGS_SDIO_SWAP_MAILBOX_SET (1 << 0)
+#define HI_ACS_FLAGS_SDIO_REDUCE_TX_COMPL_SET (1 << 1)
+#define HI_ACS_FLAGS_ALT_DATA_CREDIT_SIZE (1 << 2)
+
+#define HI_ACS_FLAGS_SDIO_SWAP_MAILBOX_FW_ACK (1 << 16)
+#define HI_ACS_FLAGS_SDIO_REDUCE_TX_COMPL_FW_ACK (1 << 17)
void ol_target_failure(void *instance, QDF_STATUS status);
diff --git a/core/bmi/src/bmi.c b/core/bmi/src/bmi.c
index ea5577835cf9..de021a760ae8 100644
--- a/core/bmi/src/bmi.c
+++ b/core/bmi/src/bmi.c
@@ -216,10 +216,20 @@ bmi_get_target_info(struct bmi_target_info *targ_info,
QDF_STATUS bmi_download_firmware(struct ol_context *ol_ctx)
{
- struct hif_opaque_softc *scn = ol_ctx->scn;
+ struct hif_opaque_softc *scn;
- if (NO_BMI || !hif_needs_bmi(scn))
- return QDF_STATUS_SUCCESS;
+ if (!ol_ctx) {
+ if (NO_BMI) {
+ /* ol_ctx is not allocated in NO_BMI case */
+ return QDF_STATUS_SUCCESS;
+ } else {
+ BMI_ERR("ol_ctx is NULL");
+ bmi_assert(0);
+ return QDF_STATUS_NOT_INITIALIZED;
+ }
+ }
+
+ scn = ol_ctx->scn;
if (!scn) {
BMI_ERR("Invalid scn context");
@@ -227,6 +237,9 @@ QDF_STATUS bmi_download_firmware(struct ol_context *ol_ctx)
return QDF_STATUS_NOT_INITIALIZED;
}
+ if (!hif_needs_bmi(scn))
+ return QDF_STATUS_SUCCESS;
+
return bmi_firmware_download(ol_ctx);
}
diff --git a/core/cds/inc/cds_api.h b/core/cds/inc/cds_api.h
index 6e6ffac71dd2..9e9774fe99a1 100644
--- a/core/cds/inc/cds_api.h
+++ b/core/cds/inc/cds_api.h
@@ -73,6 +73,19 @@ enum cds_driver_state {
#define __CDS_IS_DRIVER_STATE(_state, _mask) (((_state) & (_mask)) == (_mask))
+/**
+ * struct cds_sme_cbacks - list of sme functions registered with
+ * CDS
+ * @sme_get_valid_channels: gets the valid channel list for
+ * current reg domain
+ * @sme_get_nss_for_vdev: gets the nss allowed for the vdev type
+ */
+struct cds_sme_cbacks {
+ QDF_STATUS (*sme_get_valid_channels)(void*, uint8_t *, uint32_t *);
+ void (*sme_get_nss_for_vdev)(void*, enum tQDF_ADAPTER_MODE,
+ uint8_t *, uint8_t *);
+};
+
void cds_set_driver_state(enum cds_driver_state);
void cds_clear_driver_state(enum cds_driver_state);
enum cds_driver_state cds_get_driver_state(void);
diff --git a/core/cds/inc/cds_concurrency.h b/core/cds/inc/cds_concurrency.h
index ae2fb200467f..558014a49396 100644
--- a/core/cds/inc/cds_concurrency.h
+++ b/core/cds/inc/cds_concurrency.h
@@ -532,8 +532,7 @@ enum cds_band {
* @chan: channel of the connection
* @bw: channel bandwidth used for the connection
* @mac: The HW mac it is running
- * @tx_spatial_stream: Tx spatial stream used by the connection
- * @rx_spatial_stream: Tx spatial stream used by the connection
+ * @chain_mask: The original capability advertised by HW
* @original_nss: nss negotiated at connection time
* @vdev_id: vdev id of the connection
* @in_use: if the table entry is active
@@ -544,8 +543,6 @@ struct cds_conc_connection_info {
enum hw_mode_bandwidth bw;
uint8_t mac;
enum cds_chain_mode chain_mask;
- uint8_t tx_spatial_stream;
- uint8_t rx_spatial_stream;
uint32_t original_nss;
uint32_t vdev_id;
bool in_use;
@@ -614,8 +611,17 @@ QDF_STATUS cds_change_mcc_go_beacon_interval(hdd_adapter_t *pHostapdAdapter);
int cds_go_set_mcc_p2p_quota(hdd_adapter_t *hostapd_adapter,
uint32_t set_value);
void cds_set_mcc_latency(hdd_adapter_t *adapter, int set_value);
+#if defined(FEATURE_WLAN_MCC_TO_SCC_SWITCH)
void cds_change_sap_channel_with_csa(hdd_adapter_t *adapter,
hdd_ap_ctx_t *hdd_ap_ctx);
+#else
+static inline void cds_change_sap_channel_with_csa(hdd_adapter_t *adapter,
+ hdd_ap_ctx_t *hdd_ap_ctx)
+{
+
+}
+#endif
+
#if defined(FEATURE_WLAN_MCC_TO_SCC_SWITCH) || \
defined(FEATURE_WLAN_STA_AP_MODE_DFS_DISABLE)
void cds_restart_sap(hdd_adapter_t *ap_adapter);
@@ -642,8 +648,7 @@ void cds_decr_active_session(enum tQDF_ADAPTER_MODE mode,
uint8_t sessionId);
void cds_decr_session_set_pcl(enum tQDF_ADAPTER_MODE mode,
uint8_t session_id);
-QDF_STATUS cds_init_policy_mgr(
- QDF_STATUS (*sme_get_valid_chans)(void*, uint8_t *, uint32_t *));
+QDF_STATUS cds_init_policy_mgr(struct cds_sme_cbacks *sme_cbacks);
QDF_STATUS cds_deinit_policy_mgr(void);
QDF_STATUS cds_get_pcl(enum cds_con_mode mode,
uint8_t *pcl_channels, uint32_t *len,
@@ -759,6 +764,8 @@ QDF_STATUS cds_update_and_wait_for_connection_update(uint8_t session_id,
bool cds_is_sap_mandatory_channel_set(void);
bool cds_list_has_24GHz_channel(uint8_t *channel_list, uint32_t list_len);
QDF_STATUS cds_get_valid_chans(uint8_t *chan_list, uint32_t *list_len);
+QDF_STATUS cds_get_nss_for_vdev(enum cds_con_mode mode,
+ uint8_t *nss_2g, uint8_t *nss_5g);
QDF_STATUS cds_get_sap_mandatory_channel(uint32_t *chan);
QDF_STATUS cds_set_sap_mandatory_channels(uint8_t *channels, uint32_t len);
QDF_STATUS cds_reset_sap_mandatory_channels(void);
diff --git a/core/cds/inc/cds_reg_service.h b/core/cds/inc/cds_reg_service.h
index c91e2d2119ef..7a87e942fa83 100644
--- a/core/cds/inc/cds_reg_service.h
+++ b/core/cds/inc/cds_reg_service.h
@@ -374,5 +374,6 @@ void cds_set_channel_params(uint16_t oper_ch, uint16_t ht_offset_2g,
QDF_STATUS cds_set_reg_domain(void *client_ctxt, v_REGDOMAIN_t reg_domain);
QDF_STATUS cds_put_default_country(uint8_t *def_country);
uint16_t cds_bw_value(enum phy_ch_width bw);
+uint8_t cds_skip_dfs_and_2g(uint32_t rf_channel);
#endif /* __CDS_REG_SERVICE_H */
diff --git a/core/cds/inc/cds_sched.h b/core/cds/inc/cds_sched.h
index bd45ab153914..6dfc00ded6af 100644
--- a/core/cds/inc/cds_sched.h
+++ b/core/cds/inc/cds_sched.h
@@ -200,6 +200,15 @@ typedef struct _cds_sched_context {
/* cpu hotplug notifier */
struct notifier_block *cpu_hot_plug_notifier;
+
+ /* affinity lock */
+ spinlock_t affinity_lock;
+
+ /* rx thread affinity cpu */
+ unsigned long rx_thread_cpu;
+
+ /* high throughput required */
+ bool high_throughput_required;
#endif
} cds_sched_context, *p_cds_sched_context;
@@ -296,7 +305,10 @@ typedef struct _cds_context_type {
#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
void (*sap_restart_chan_switch_cb)(void *, uint32_t, uint32_t);
#endif
- QDF_STATUS (*sme_get_valid_chans)(void*, uint8_t *, uint32_t *);
+ QDF_STATUS (*sme_get_valid_channels)(void*, uint8_t *, uint32_t *);
+ void (*sme_get_nss_for_vdev)(void*, enum tQDF_ADAPTER_MODE,
+ uint8_t *, uint8_t *);
+
/* This list is not sessionized. This mandatory channel list would be
* as per OEMs preference as per the regulatory/other considerations.
* So, this would remain same for all the interfaces.
@@ -311,6 +323,9 @@ typedef struct _cds_context_type {
Function declarations and documenation
---------------------------------------------------------------------------*/
#ifdef QCA_CONFIG_SMP
+int cds_sched_handle_cpu_hot_plug(void);
+int cds_sched_handle_throughput_req(bool high_tput_required);
+
/*---------------------------------------------------------------------------
\brief cds_drop_rxpkt_by_staid() - API to drop pending Rx packets for a sta
The \a cds_drop_rxpkt_by_staid() drops queued packets for a station, to drop
@@ -434,6 +449,13 @@ static inline
void cds_free_ol_rx_pkt_freeq(p_cds_sched_context pSchedContext)
{
}
+
+static inline int cds_sched_handle_throughput_req(
+ bool high_tput_required)
+{
+ return 0;
+}
+
#endif
/*---------------------------------------------------------------------------
diff --git a/core/cds/src/cds_api.c b/core/cds/src/cds_api.c
index 116936fe83cd..d50f781aa8a3 100644
--- a/core/cds/src/cds_api.c
+++ b/core/cds/src/cds_api.c
@@ -1591,6 +1591,9 @@ QDF_STATUS cds_get_vdev_types(enum tQDF_ADAPTER_MODE mode, uint32_t *type,
case QDF_MONITOR_MODE:
*type = WMI_VDEV_TYPE_MONITOR;
break;
+ case QDF_NDI_MODE:
+ *type = WMI_VDEV_TYPE_NDI;
+ break;
default:
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"Invalid device mode %d", mode);
diff --git a/core/cds/src/cds_concurrency.c b/core/cds/src/cds_concurrency.c
index 72604bb412cd..da72c7eb015c 100644
--- a/core/cds/src/cds_concurrency.c
+++ b/core/cds/src/cds_concurrency.c
@@ -469,32 +469,40 @@ third_connection_pcl_dbs_table[CDS_MAX_TWO_CONNECTION_MODE]
[CDS_STA_SAP_SCC_24_1x1] = {
[CDS_STA_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
[CDS_SAP_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
- [CDS_P2P_CLIENT_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
- [CDS_P2P_GO_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
+ [CDS_P2P_CLIENT_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
+ [CDS_P2P_GO_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_IBSS_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
[CDS_STA_SAP_SCC_24_2x2] = {
[CDS_STA_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
[CDS_SAP_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
- [CDS_P2P_CLIENT_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
- [CDS_P2P_GO_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
+ [CDS_P2P_CLIENT_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
+ [CDS_P2P_GO_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_IBSS_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
[CDS_STA_SAP_MCC_24_1x1] = {
[CDS_STA_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
[CDS_SAP_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
- [CDS_P2P_CLIENT_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
- [CDS_P2P_GO_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
+ [CDS_P2P_CLIENT_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
+ [CDS_P2P_GO_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_IBSS_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
[CDS_STA_SAP_MCC_24_2x2] = {
[CDS_STA_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
[CDS_SAP_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
- [CDS_P2P_CLIENT_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
- [CDS_P2P_GO_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
+ [CDS_P2P_CLIENT_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
+ [CDS_P2P_GO_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_IBSS_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
@@ -502,8 +510,9 @@ third_connection_pcl_dbs_table[CDS_MAX_TWO_CONNECTION_MODE]
[CDS_STA_MODE] = {CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
[CDS_SAP_MODE] = {CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
[CDS_P2P_CLIENT_MODE] = {
- CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
- [CDS_P2P_GO_MODE] = {CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
+ [CDS_P2P_GO_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_IBSS_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
@@ -511,70 +520,68 @@ third_connection_pcl_dbs_table[CDS_MAX_TWO_CONNECTION_MODE]
[CDS_STA_MODE] = {CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
[CDS_SAP_MODE] = {CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
[CDS_P2P_CLIENT_MODE] = {
- CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
- [CDS_P2P_GO_MODE] = {CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
+ [CDS_P2P_GO_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_IBSS_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
[CDS_STA_SAP_MCC_5_1x1] = {
[CDS_STA_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
[CDS_SAP_MODE] = {CDS_24G, CDS_24G, CDS_24G},
- [CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
- [CDS_P2P_GO_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
+ [CDS_P2P_CLIENT_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
+ [CDS_P2P_GO_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_IBSS_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
[CDS_STA_SAP_MCC_5_2x2] = {
[CDS_STA_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
[CDS_SAP_MODE] = {CDS_24G, CDS_24G, CDS_24G},
- [CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
- [CDS_P2P_GO_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
+ [CDS_P2P_CLIENT_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
+ [CDS_P2P_GO_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_IBSS_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
[CDS_STA_SAP_MCC_24_5_1x1] = {
[CDS_STA_MODE] = {CDS_MCC_CH_5G, CDS_5G, CDS_5G},
[CDS_SAP_MODE] = {CDS_24G, CDS_24G, CDS_24G},
- [CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
- [CDS_P2P_GO_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
+ [CDS_P2P_CLIENT_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
+ [CDS_P2P_GO_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_IBSS_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
[CDS_STA_SAP_MCC_24_5_2x2] = {
[CDS_STA_MODE] = {CDS_MCC_CH_5G, CDS_5G, CDS_5G},
[CDS_SAP_MODE] = {CDS_24G, CDS_24G, CDS_24G},
- [CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
- [CDS_P2P_GO_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
- [CDS_IBSS_MODE] = {
- CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-#ifndef QCA_WIFI_3_0_EMU
- [CDS_STA_SAP_DBS_1x1] = {
- [CDS_STA_MODE] = {
- CDS_SCC_ON_5_SCC_ON_24_5G, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
- [CDS_SAP_MODE] = {
- CDS_SCC_ON_5_SCC_ON_24_5G, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
[CDS_P2P_CLIENT_MODE] = {
- CDS_SCC_ON_5_SCC_ON_24_5G, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_GO_MODE] = {
- CDS_SCC_ON_5_SCC_ON_24_5G, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_IBSS_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-#else
+
[CDS_STA_SAP_DBS_1x1] = {
[CDS_STA_MODE] = {
- CDS_SCC_ON_5_SCC_ON_24, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
+ CDS_SCC_ON_5_SCC_ON_24_5G, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
[CDS_SAP_MODE] = {
- CDS_SCC_ON_5_SCC_ON_24, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
+ CDS_SCC_ON_5_SCC_ON_24_5G, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
[CDS_P2P_CLIENT_MODE] = {
- CDS_SCC_ON_5_SCC_ON_24, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_GO_MODE] = {
- CDS_SCC_ON_5_SCC_ON_24, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_IBSS_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-#endif
+
[CDS_STA_P2P_GO_SCC_24_1x1] = {
[CDS_STA_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
- [CDS_SAP_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
+ [CDS_SAP_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
[CDS_P2P_GO_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
[CDS_IBSS_MODE] = {
@@ -582,7 +589,8 @@ third_connection_pcl_dbs_table[CDS_MAX_TWO_CONNECTION_MODE]
[CDS_STA_P2P_GO_SCC_24_2x2] = {
[CDS_STA_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
- [CDS_SAP_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
+ [CDS_SAP_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
[CDS_P2P_GO_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
[CDS_IBSS_MODE] = {
@@ -590,7 +598,8 @@ third_connection_pcl_dbs_table[CDS_MAX_TWO_CONNECTION_MODE]
[CDS_STA_P2P_GO_MCC_24_1x1] = {
[CDS_STA_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
- [CDS_SAP_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
+ [CDS_SAP_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
[CDS_P2P_GO_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
[CDS_IBSS_MODE] = {
@@ -598,7 +607,8 @@ third_connection_pcl_dbs_table[CDS_MAX_TWO_CONNECTION_MODE]
[CDS_STA_P2P_GO_MCC_24_2x2] = {
[CDS_STA_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
- [CDS_SAP_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
+ [CDS_SAP_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
[CDS_P2P_GO_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
[CDS_IBSS_MODE] = {
@@ -606,7 +616,8 @@ third_connection_pcl_dbs_table[CDS_MAX_TWO_CONNECTION_MODE]
[CDS_STA_P2P_GO_SCC_5_1x1] = {
[CDS_STA_MODE] = {CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
- [CDS_SAP_MODE] = {CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
+ [CDS_SAP_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {
CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
[CDS_P2P_GO_MODE] = {CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
@@ -615,7 +626,8 @@ third_connection_pcl_dbs_table[CDS_MAX_TWO_CONNECTION_MODE]
[CDS_STA_P2P_GO_SCC_5_2x2] = {
[CDS_STA_MODE] = {CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
- [CDS_SAP_MODE] = {CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
+ [CDS_SAP_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {
CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
[CDS_P2P_GO_MODE] = {CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
@@ -624,7 +636,8 @@ third_connection_pcl_dbs_table[CDS_MAX_TWO_CONNECTION_MODE]
[CDS_STA_P2P_GO_MCC_5_1x1] = {
[CDS_STA_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
- [CDS_SAP_MODE] = {CDS_24G, CDS_24G, CDS_24G},
+ [CDS_SAP_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
[CDS_P2P_GO_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
[CDS_IBSS_MODE] = {
@@ -632,7 +645,8 @@ third_connection_pcl_dbs_table[CDS_MAX_TWO_CONNECTION_MODE]
[CDS_STA_P2P_GO_MCC_5_2x2] = {
[CDS_STA_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
- [CDS_SAP_MODE] = {CDS_24G, CDS_24G, CDS_24G},
+ [CDS_SAP_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
[CDS_P2P_GO_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
[CDS_IBSS_MODE] = {
@@ -640,7 +654,8 @@ third_connection_pcl_dbs_table[CDS_MAX_TWO_CONNECTION_MODE]
[CDS_STA_P2P_GO_MCC_24_5_1x1] = {
[CDS_STA_MODE] = {CDS_MCC_CH_5G, CDS_5G, CDS_5G},
- [CDS_SAP_MODE] = {CDS_24G, CDS_24G, CDS_24G},
+ [CDS_SAP_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
[CDS_P2P_GO_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
[CDS_IBSS_MODE] = {
@@ -648,40 +663,30 @@ third_connection_pcl_dbs_table[CDS_MAX_TWO_CONNECTION_MODE]
[CDS_STA_P2P_GO_MCC_24_5_2x2] = {
[CDS_STA_MODE] = {CDS_MCC_CH_5G, CDS_5G, CDS_5G},
- [CDS_SAP_MODE] = {CDS_24G, CDS_24G, CDS_24G},
+ [CDS_SAP_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
[CDS_P2P_GO_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
[CDS_IBSS_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-#ifndef QCA_WIFI_3_0_EMU
+
[CDS_STA_P2P_GO_DBS_1x1] = {
[CDS_STA_MODE] = {
CDS_SCC_ON_5_SCC_ON_24_5G, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
[CDS_SAP_MODE] = {
- CDS_SCC_ON_5_SCC_ON_24_5G, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {
CDS_SCC_ON_5_SCC_ON_24_5G, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
[CDS_P2P_GO_MODE] = {
CDS_SCC_ON_5_SCC_ON_24_5G, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
[CDS_IBSS_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-#else
- [CDS_STA_P2P_GO_DBS_1x1] = {
- [CDS_STA_MODE] = {
- CDS_SCC_ON_5_SCC_ON_24, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
- [CDS_SAP_MODE] = {
- CDS_SCC_ON_5_SCC_ON_24, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
- [CDS_P2P_CLIENT_MODE] = {
- CDS_SCC_ON_5_SCC_ON_24, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
- [CDS_P2P_GO_MODE] = {
- CDS_SCC_ON_5_SCC_ON_24, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
- [CDS_IBSS_MODE] = {
- CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-#endif
+
[CDS_STA_P2P_CLI_SCC_24_1x1] = {
[CDS_STA_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
- [CDS_SAP_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
+ [CDS_SAP_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
[CDS_P2P_GO_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
[CDS_IBSS_MODE] = {
@@ -690,7 +695,8 @@ third_connection_pcl_dbs_table[CDS_MAX_TWO_CONNECTION_MODE]
[CDS_STA_P2P_CLI_SCC_24_2x2] = {
[CDS_STA_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
- [CDS_SAP_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
+ [CDS_SAP_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
[CDS_P2P_GO_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
[CDS_IBSS_MODE] = {
@@ -699,7 +705,8 @@ third_connection_pcl_dbs_table[CDS_MAX_TWO_CONNECTION_MODE]
[CDS_STA_P2P_CLI_MCC_24_1x1] = {
[CDS_STA_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
- [CDS_SAP_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
+ [CDS_SAP_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
[CDS_P2P_GO_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
[CDS_IBSS_MODE] = {
@@ -708,7 +715,8 @@ third_connection_pcl_dbs_table[CDS_MAX_TWO_CONNECTION_MODE]
[CDS_STA_P2P_CLI_MCC_24_2x2] = {
[CDS_STA_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
- [CDS_SAP_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
+ [CDS_SAP_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
[CDS_P2P_GO_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
[CDS_IBSS_MODE] = {
@@ -717,7 +725,8 @@ third_connection_pcl_dbs_table[CDS_MAX_TWO_CONNECTION_MODE]
[CDS_STA_P2P_CLI_SCC_5_1x1] = {
[CDS_STA_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
- [CDS_SAP_MODE] = {CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
+ [CDS_SAP_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {
CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
[CDS_P2P_GO_MODE] = {CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
@@ -727,7 +736,8 @@ third_connection_pcl_dbs_table[CDS_MAX_TWO_CONNECTION_MODE]
[CDS_STA_P2P_CLI_SCC_5_2x2] = {
[CDS_STA_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
- [CDS_SAP_MODE] = {CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
+ [CDS_SAP_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {
CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
[CDS_P2P_GO_MODE] = {CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
@@ -737,7 +747,8 @@ third_connection_pcl_dbs_table[CDS_MAX_TWO_CONNECTION_MODE]
[CDS_STA_P2P_CLI_MCC_5_1x1] = {
[CDS_STA_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
- [CDS_SAP_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_MCC_CH_24G},
+ [CDS_SAP_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_MCC_CH_24G},
[CDS_P2P_GO_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_MCC_CH_24G},
[CDS_IBSS_MODE] = {
@@ -746,7 +757,8 @@ third_connection_pcl_dbs_table[CDS_MAX_TWO_CONNECTION_MODE]
[CDS_STA_P2P_CLI_MCC_5_2x2] = {
[CDS_STA_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
- [CDS_SAP_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_MCC_CH_24G},
+ [CDS_SAP_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_MCC_CH_24G},
[CDS_P2P_GO_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_MCC_CH_24G},
[CDS_IBSS_MODE] = {CDS_NONE, CDS_NONE, CDS_NONE} },
@@ -754,7 +766,8 @@ third_connection_pcl_dbs_table[CDS_MAX_TWO_CONNECTION_MODE]
[CDS_STA_P2P_CLI_MCC_24_5_1x1] = {
[CDS_STA_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
- [CDS_SAP_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_MCC_CH_24G},
+ [CDS_SAP_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_MCC_CH_24G},
[CDS_P2P_GO_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_MCC_CH_24G},
[CDS_IBSS_MODE] = {
@@ -763,36 +776,25 @@ third_connection_pcl_dbs_table[CDS_MAX_TWO_CONNECTION_MODE]
[CDS_STA_P2P_CLI_MCC_24_5_2x2] = {
[CDS_STA_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
- [CDS_SAP_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_MCC_CH_24G},
+ [CDS_SAP_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_MCC_CH_24G},
[CDS_P2P_GO_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_MCC_CH_24G},
[CDS_IBSS_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-#ifndef QCA_WIFI_3_0_EMU
+
[CDS_STA_P2P_CLI_DBS_1x1] = {
[CDS_STA_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_SAP_MODE] = {
- CDS_SCC_ON_5_SCC_ON_24_5G, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {
CDS_SCC_ON_5_SCC_ON_24_5G, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
[CDS_P2P_GO_MODE] = {
CDS_SCC_ON_5_SCC_ON_24_5G, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
[CDS_IBSS_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-#else
- [CDS_STA_P2P_CLI_DBS_1x1] = {
- [CDS_STA_MODE] = {
- CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
- [CDS_SAP_MODE] = {
- CDS_SCC_ON_5_SCC_ON_24, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
- [CDS_P2P_CLIENT_MODE] = {
- CDS_SCC_ON_5_SCC_ON_24, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
- [CDS_P2P_GO_MODE] = {
- CDS_SCC_ON_5_SCC_ON_24, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
- [CDS_IBSS_MODE] = {
- CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-#endif
+
[CDS_P2P_GO_P2P_CLI_SCC_24_1x1] = {
[CDS_STA_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
[CDS_SAP_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
@@ -874,7 +876,7 @@ third_connection_pcl_dbs_table[CDS_MAX_TWO_CONNECTION_MODE]
[CDS_P2P_GO_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
[CDS_IBSS_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-#ifndef QCA_WIFI_3_0_EMU
+
[CDS_P2P_GO_P2P_CLI_DBS_1x1] = {
[CDS_STA_MODE] = {
CDS_SCC_ON_5_SCC_ON_24_5G, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
@@ -886,21 +888,10 @@ third_connection_pcl_dbs_table[CDS_MAX_TWO_CONNECTION_MODE]
CDS_SCC_ON_5_SCC_ON_24_5G, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
[CDS_IBSS_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-#else
- [CDS_P2P_GO_P2P_CLI_DBS_1x1] = {
- [CDS_STA_MODE] = {
- CDS_SCC_ON_5_SCC_ON_24, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
- [CDS_SAP_MODE] = {
- CDS_SCC_ON_5_SCC_ON_24, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
- [CDS_P2P_CLIENT_MODE] = {
- CDS_SCC_ON_5_SCC_ON_24, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
- [CDS_P2P_GO_MODE] = {
- CDS_SCC_ON_5_SCC_ON_24, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
- [CDS_IBSS_MODE] = {
- CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-#endif
+
[CDS_P2P_GO_SAP_SCC_24_1x1] = {
- [CDS_STA_MODE] = {CDS_5G, CDS_5G, CDS_5G},
+ [CDS_STA_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_SAP_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {
@@ -911,7 +902,8 @@ third_connection_pcl_dbs_table[CDS_MAX_TWO_CONNECTION_MODE]
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
[CDS_P2P_GO_SAP_SCC_24_2x2] = {
- [CDS_STA_MODE] = {CDS_5G, CDS_5G, CDS_5G},
+ [CDS_STA_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_SAP_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {
@@ -922,7 +914,8 @@ third_connection_pcl_dbs_table[CDS_MAX_TWO_CONNECTION_MODE]
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
[CDS_P2P_GO_SAP_MCC_24_1x1] = {
- [CDS_STA_MODE] = {CDS_5G, CDS_5G, CDS_5G},
+ [CDS_STA_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_SAP_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {
@@ -933,7 +926,8 @@ third_connection_pcl_dbs_table[CDS_MAX_TWO_CONNECTION_MODE]
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
[CDS_P2P_GO_SAP_MCC_24_2x2] = {
- [CDS_STA_MODE] = {CDS_5G, CDS_5G, CDS_5G},
+ [CDS_STA_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_SAP_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {
@@ -944,7 +938,8 @@ third_connection_pcl_dbs_table[CDS_MAX_TWO_CONNECTION_MODE]
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
[CDS_P2P_GO_SAP_SCC_5_1x1] = {
- [CDS_STA_MODE] = {CDS_SCC_CH_24G, CDS_24G, CDS_24G},
+ [CDS_STA_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_SAP_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {
@@ -955,7 +950,8 @@ third_connection_pcl_dbs_table[CDS_MAX_TWO_CONNECTION_MODE]
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
[CDS_P2P_GO_SAP_SCC_5_2x2] = {
- [CDS_STA_MODE] = {CDS_SCC_CH_24G, CDS_24G, CDS_24G},
+ [CDS_STA_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_SAP_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {
@@ -966,7 +962,8 @@ third_connection_pcl_dbs_table[CDS_MAX_TWO_CONNECTION_MODE]
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
[CDS_P2P_GO_SAP_MCC_5_1x1] = {
- [CDS_STA_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
+ [CDS_STA_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_SAP_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {
@@ -977,7 +974,8 @@ third_connection_pcl_dbs_table[CDS_MAX_TWO_CONNECTION_MODE]
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
[CDS_P2P_GO_SAP_MCC_5_2x2] = {
- [CDS_STA_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
+ [CDS_STA_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_SAP_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {
@@ -988,7 +986,8 @@ third_connection_pcl_dbs_table[CDS_MAX_TWO_CONNECTION_MODE]
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
[CDS_P2P_GO_SAP_MCC_24_5_1x1] = {
- [CDS_STA_MODE] = {CDS_MCC_CH_5G, CDS_5G, CDS_5G},
+ [CDS_STA_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_SAP_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {
@@ -999,19 +998,8 @@ third_connection_pcl_dbs_table[CDS_MAX_TWO_CONNECTION_MODE]
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
[CDS_P2P_GO_SAP_MCC_24_5_2x2] = {
- [CDS_STA_MODE] = {CDS_MCC_CH_5G, CDS_5G, CDS_5G},
- [CDS_SAP_MODE] = {
- CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
- [CDS_P2P_CLIENT_MODE] = {
- CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
- [CDS_P2P_GO_MODE] = {
- CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
- [CDS_IBSS_MODE] = {
- CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-#ifndef QCA_WIFI_3_0_EMU
- [CDS_P2P_GO_SAP_DBS_1x1] = {
- [CDS_STA_MODE] = {CDS_SCC_ON_5_SCC_ON_24_5G,
- CDS_SCC_ON_5_SCC_ON_24_5G, CDS_SCC_ON_5_SCC_ON_24_5G},
+ [CDS_STA_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_SAP_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {
@@ -1020,10 +1008,10 @@ third_connection_pcl_dbs_table[CDS_MAX_TWO_CONNECTION_MODE]
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_IBSS_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-#else
+
[CDS_P2P_GO_SAP_DBS_1x1] = {
- [CDS_STA_MODE] = {CDS_SCC_ON_5_SCC_ON_24,
- CDS_SCC_ON_5_SCC_ON_24, CDS_SCC_ON_5_SCC_ON_24},
+ [CDS_STA_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_SAP_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {
@@ -1032,9 +1020,10 @@ third_connection_pcl_dbs_table[CDS_MAX_TWO_CONNECTION_MODE]
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_IBSS_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-#endif
+
[CDS_P2P_CLI_SAP_SCC_24_1x1] = {
- [CDS_STA_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
+ [CDS_STA_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_SAP_MODE] = {CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
@@ -1044,7 +1033,8 @@ third_connection_pcl_dbs_table[CDS_MAX_TWO_CONNECTION_MODE]
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
[CDS_P2P_CLI_SAP_SCC_24_2x2] = {
- [CDS_STA_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
+ [CDS_STA_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_SAP_MODE] = {CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
@@ -1054,7 +1044,8 @@ third_connection_pcl_dbs_table[CDS_MAX_TWO_CONNECTION_MODE]
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
[CDS_P2P_CLI_SAP_MCC_24_1x1] = {
- [CDS_STA_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
+ [CDS_STA_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_SAP_MODE] = {CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
@@ -1064,7 +1055,8 @@ third_connection_pcl_dbs_table[CDS_MAX_TWO_CONNECTION_MODE]
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
[CDS_P2P_CLI_SAP_MCC_24_2x2] = {
- [CDS_STA_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
+ [CDS_STA_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_SAP_MODE] = {CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
@@ -1074,7 +1066,8 @@ third_connection_pcl_dbs_table[CDS_MAX_TWO_CONNECTION_MODE]
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
[CDS_P2P_CLI_SAP_SCC_5_1x1] = {
- [CDS_STA_MODE] = {CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
+ [CDS_STA_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_SAP_MODE] = {CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
@@ -1084,7 +1077,8 @@ third_connection_pcl_dbs_table[CDS_MAX_TWO_CONNECTION_MODE]
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
[CDS_P2P_CLI_SAP_SCC_5_2x2] = {
- [CDS_STA_MODE] = {CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
+ [CDS_STA_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_SAP_MODE] = {CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
@@ -1094,7 +1088,8 @@ third_connection_pcl_dbs_table[CDS_MAX_TWO_CONNECTION_MODE]
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
[CDS_P2P_CLI_SAP_MCC_5_1x1] = {
- [CDS_STA_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
+ [CDS_STA_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_SAP_MODE] = {CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
@@ -1104,7 +1099,8 @@ third_connection_pcl_dbs_table[CDS_MAX_TWO_CONNECTION_MODE]
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
[CDS_P2P_CLI_SAP_MCC_5_2x2] = {
- [CDS_STA_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
+ [CDS_STA_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_SAP_MODE] = {CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
@@ -1114,7 +1110,8 @@ third_connection_pcl_dbs_table[CDS_MAX_TWO_CONNECTION_MODE]
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
[CDS_P2P_CLI_SAP_MCC_24_5_1x1] = {
- [CDS_STA_MODE] = {CDS_MCC_CH_5G, CDS_5G, CDS_5G},
+ [CDS_STA_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_SAP_MODE] = {CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
@@ -1124,7 +1121,8 @@ third_connection_pcl_dbs_table[CDS_MAX_TWO_CONNECTION_MODE]
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
[CDS_P2P_CLI_SAP_MCC_24_5_2x2] = {
- [CDS_STA_MODE] = {CDS_MCC_CH_5G, CDS_5G, CDS_5G},
+ [CDS_STA_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_SAP_MODE] = {CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
@@ -1132,22 +1130,10 @@ third_connection_pcl_dbs_table[CDS_MAX_TWO_CONNECTION_MODE]
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_IBSS_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-#ifndef QCA_WIFI_3_0_EMU
+
[CDS_P2P_CLI_SAP_DBS_1x1] = {
[CDS_STA_MODE] = {
- CDS_SCC_ON_5_SCC_ON_24_5G, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
- [CDS_SAP_MODE] = {
- CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
- [CDS_P2P_CLIENT_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
- [CDS_P2P_GO_MODE] = {
- CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
- [CDS_IBSS_MODE] = {
- CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-#else
- [CDS_P2P_CLI_SAP_DBS_1x1] = {
- [CDS_STA_MODE] = {
- CDS_SCC_ON_5_SCC_ON_24, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
[CDS_SAP_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {
@@ -1156,7 +1142,6 @@ third_connection_pcl_dbs_table[CDS_MAX_TWO_CONNECTION_MODE]
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_IBSS_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-#endif
};
@@ -1171,16 +1156,20 @@ third_connection_pcl_nodbs_table[CDS_MAX_TWO_CONNECTION_MODE]
[CDS_STA_SAP_SCC_24_1x1] = {
[CDS_STA_MODE] = {CDS_5G, CDS_SCC_CH, CDS_SCC_CH},
[CDS_SAP_MODE] = {CDS_SCC_CH_5G, CDS_SCC_CH, CDS_SCC_CH},
- [CDS_P2P_CLIENT_MODE] = {CDS_5G, CDS_SCC_CH, CDS_SCC_CH},
- [CDS_P2P_GO_MODE] = {CDS_5G_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
+ [CDS_P2P_CLIENT_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
+ [CDS_P2P_GO_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_IBSS_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
[CDS_STA_SAP_SCC_24_2x2] = {
[CDS_STA_MODE] = {CDS_5G, CDS_SCC_CH, CDS_SCC_CH},
[CDS_SAP_MODE] = {CDS_SCC_CH_5G, CDS_SCC_CH, CDS_SCC_CH},
- [CDS_P2P_CLIENT_MODE] = {CDS_5G, CDS_SCC_CH, CDS_SCC_CH},
- [CDS_P2P_GO_MODE] = {CDS_5G_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
+ [CDS_P2P_CLIENT_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
+ [CDS_P2P_GO_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_IBSS_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
@@ -1188,9 +1177,9 @@ third_connection_pcl_nodbs_table[CDS_MAX_TWO_CONNECTION_MODE]
[CDS_STA_MODE] = {CDS_5G_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
[CDS_SAP_MODE] = {CDS_5G_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
[CDS_P2P_CLIENT_MODE] = {
- CDS_5G_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_GO_MODE] = {
- CDS_5G_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_IBSS_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
@@ -1198,57 +1187,69 @@ third_connection_pcl_nodbs_table[CDS_MAX_TWO_CONNECTION_MODE]
[CDS_STA_MODE] = {CDS_5G_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
[CDS_SAP_MODE] = {CDS_5G_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
[CDS_P2P_CLIENT_MODE] = {
- CDS_5G_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_GO_MODE] = {
- CDS_5G_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_IBSS_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
[CDS_STA_SAP_SCC_5_1x1] = {
[CDS_STA_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
[CDS_SAP_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
- [CDS_P2P_CLIENT_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
- [CDS_P2P_GO_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
+ [CDS_P2P_CLIENT_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
+ [CDS_P2P_GO_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_IBSS_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
[CDS_STA_SAP_SCC_5_2x2] = {
[CDS_STA_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
[CDS_SAP_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
- [CDS_P2P_CLIENT_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
- [CDS_P2P_GO_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
+ [CDS_P2P_CLIENT_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
+ [CDS_P2P_GO_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_IBSS_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
[CDS_STA_SAP_MCC_5_1x1] = {
[CDS_STA_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
[CDS_SAP_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
- [CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
- [CDS_P2P_GO_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
+ [CDS_P2P_CLIENT_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
+ [CDS_P2P_GO_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_IBSS_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
[CDS_STA_SAP_MCC_5_2x2] = {
[CDS_STA_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
[CDS_SAP_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
- [CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
- [CDS_P2P_GO_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
+ [CDS_P2P_CLIENT_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
+ [CDS_P2P_GO_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_IBSS_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
[CDS_STA_SAP_MCC_24_5_1x1] = {
[CDS_STA_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
[CDS_SAP_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
- [CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
- [CDS_P2P_GO_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
+ [CDS_P2P_CLIENT_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
+ [CDS_P2P_GO_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_IBSS_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
[CDS_STA_SAP_MCC_24_5_2x2] = {
[CDS_STA_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
[CDS_SAP_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
- [CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
- [CDS_P2P_GO_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
+ [CDS_P2P_CLIENT_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
+ [CDS_P2P_GO_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_IBSS_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
@@ -1266,7 +1267,8 @@ third_connection_pcl_nodbs_table[CDS_MAX_TWO_CONNECTION_MODE]
[CDS_STA_P2P_GO_SCC_24_1x1] = {
[CDS_STA_MODE] = {CDS_5G, CDS_SCC_CH, CDS_SCC_CH},
- [CDS_SAP_MODE] = {CDS_SCC_CH_5G, CDS_SCC_CH, CDS_SCC_CH},
+ [CDS_SAP_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {CDS_5G, CDS_SCC_CH, CDS_SCC_CH},
[CDS_P2P_GO_MODE] = {CDS_5G_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
[CDS_IBSS_MODE] = {
@@ -1274,7 +1276,8 @@ third_connection_pcl_nodbs_table[CDS_MAX_TWO_CONNECTION_MODE]
[CDS_STA_P2P_GO_SCC_24_2x2] = {
[CDS_STA_MODE] = {CDS_5G, CDS_SCC_CH, CDS_SCC_CH},
- [CDS_SAP_MODE] = {CDS_SCC_CH_5G, CDS_SCC_CH, CDS_SCC_CH},
+ [CDS_SAP_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {CDS_5G, CDS_SCC_CH, CDS_SCC_CH},
[CDS_P2P_GO_MODE] = {CDS_5G_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
[CDS_IBSS_MODE] = {
@@ -1282,7 +1285,8 @@ third_connection_pcl_nodbs_table[CDS_MAX_TWO_CONNECTION_MODE]
[CDS_STA_P2P_GO_MCC_24_1x1] = {
[CDS_STA_MODE] = {CDS_5G_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
- [CDS_SAP_MODE] = {CDS_5G_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
+ [CDS_SAP_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {
CDS_5G_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
[CDS_P2P_GO_MODE] = {
@@ -1292,7 +1296,8 @@ third_connection_pcl_nodbs_table[CDS_MAX_TWO_CONNECTION_MODE]
[CDS_STA_P2P_GO_MCC_24_2x2] = {
[CDS_STA_MODE] = {CDS_5G_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
- [CDS_SAP_MODE] = {CDS_5G_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
+ [CDS_SAP_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {
CDS_5G_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
[CDS_P2P_GO_MODE] = {
@@ -1302,7 +1307,8 @@ third_connection_pcl_nodbs_table[CDS_MAX_TWO_CONNECTION_MODE]
[CDS_STA_P2P_GO_SCC_5_1x1] = {
[CDS_STA_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
- [CDS_SAP_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
+ [CDS_SAP_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
[CDS_P2P_GO_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
[CDS_IBSS_MODE] = {
@@ -1310,7 +1316,8 @@ third_connection_pcl_nodbs_table[CDS_MAX_TWO_CONNECTION_MODE]
[CDS_STA_P2P_GO_SCC_5_2x2] = {
[CDS_STA_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
- [CDS_SAP_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
+ [CDS_SAP_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
[CDS_P2P_GO_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
[CDS_IBSS_MODE] = {
@@ -1318,7 +1325,8 @@ third_connection_pcl_nodbs_table[CDS_MAX_TWO_CONNECTION_MODE]
[CDS_STA_P2P_GO_MCC_5_1x1] = {
[CDS_STA_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
- [CDS_SAP_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
+ [CDS_SAP_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
[CDS_P2P_GO_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
[CDS_IBSS_MODE] = {
@@ -1326,7 +1334,8 @@ third_connection_pcl_nodbs_table[CDS_MAX_TWO_CONNECTION_MODE]
[CDS_STA_P2P_GO_MCC_5_2x2] = {
[CDS_STA_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
- [CDS_SAP_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
+ [CDS_SAP_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
[CDS_P2P_GO_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
[CDS_IBSS_MODE] = {
@@ -1334,7 +1343,8 @@ third_connection_pcl_nodbs_table[CDS_MAX_TWO_CONNECTION_MODE]
[CDS_STA_P2P_GO_MCC_24_5_1x1] = {
[CDS_STA_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
- [CDS_SAP_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
+ [CDS_SAP_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
[CDS_P2P_GO_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
[CDS_IBSS_MODE] = {
@@ -1342,7 +1352,8 @@ third_connection_pcl_nodbs_table[CDS_MAX_TWO_CONNECTION_MODE]
[CDS_STA_P2P_GO_MCC_24_5_2x2] = {
[CDS_STA_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
- [CDS_SAP_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
+ [CDS_SAP_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
[CDS_P2P_GO_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
[CDS_IBSS_MODE] = {
@@ -1363,7 +1374,8 @@ third_connection_pcl_nodbs_table[CDS_MAX_TWO_CONNECTION_MODE]
[CDS_STA_P2P_CLI_SCC_24_1x1] = {
[CDS_STA_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
- [CDS_SAP_MODE] = {CDS_SCC_CH_5G, CDS_SCC_CH, CDS_SCC_CH},
+ [CDS_SAP_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {CDS_5G_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
[CDS_P2P_GO_MODE] = {CDS_5G_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
[CDS_IBSS_MODE] = {
@@ -1372,7 +1384,8 @@ third_connection_pcl_nodbs_table[CDS_MAX_TWO_CONNECTION_MODE]
[CDS_STA_P2P_CLI_SCC_24_2x2] = {
[CDS_STA_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
- [CDS_SAP_MODE] = {CDS_SCC_CH_5G, CDS_SCC_CH, CDS_SCC_CH},
+ [CDS_SAP_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {CDS_5G_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
[CDS_P2P_GO_MODE] = {CDS_5G_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
[CDS_IBSS_MODE] = {
@@ -1381,7 +1394,8 @@ third_connection_pcl_nodbs_table[CDS_MAX_TWO_CONNECTION_MODE]
[CDS_STA_P2P_CLI_MCC_24_1x1] = {
[CDS_STA_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
- [CDS_SAP_MODE] = {CDS_MCC_CH_5G, CDS_MCC_CH, CDS_MCC_CH},
+ [CDS_SAP_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {CDS_5G_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
[CDS_P2P_GO_MODE] = {CDS_5G_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
[CDS_IBSS_MODE] = {
@@ -1390,7 +1404,8 @@ third_connection_pcl_nodbs_table[CDS_MAX_TWO_CONNECTION_MODE]
[CDS_STA_P2P_CLI_MCC_24_2x2] = {
[CDS_STA_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
- [CDS_SAP_MODE] = {CDS_MCC_CH_5G, CDS_MCC_CH, CDS_MCC_CH},
+ [CDS_SAP_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {CDS_5G_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
[CDS_P2P_GO_MODE] = {CDS_5G_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
[CDS_IBSS_MODE] = {
@@ -1399,7 +1414,8 @@ third_connection_pcl_nodbs_table[CDS_MAX_TWO_CONNECTION_MODE]
[CDS_STA_P2P_CLI_SCC_5_1x1] = {
[CDS_STA_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
- [CDS_SAP_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
+ [CDS_SAP_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
[CDS_P2P_GO_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
[CDS_IBSS_MODE] = {
@@ -1408,7 +1424,8 @@ third_connection_pcl_nodbs_table[CDS_MAX_TWO_CONNECTION_MODE]
[CDS_STA_P2P_CLI_SCC_5_2x2] = {
[CDS_STA_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
- [CDS_SAP_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
+ [CDS_SAP_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
[CDS_P2P_GO_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
[CDS_IBSS_MODE] = {
@@ -1417,7 +1434,8 @@ third_connection_pcl_nodbs_table[CDS_MAX_TWO_CONNECTION_MODE]
[CDS_STA_P2P_CLI_MCC_5_1x1] = {
[CDS_STA_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
- [CDS_SAP_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
+ [CDS_SAP_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
[CDS_P2P_GO_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
[CDS_IBSS_MODE] = {
@@ -1426,7 +1444,8 @@ third_connection_pcl_nodbs_table[CDS_MAX_TWO_CONNECTION_MODE]
[CDS_STA_P2P_CLI_MCC_5_2x2] = {
[CDS_STA_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
- [CDS_SAP_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
+ [CDS_SAP_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
[CDS_P2P_GO_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
[CDS_IBSS_MODE] = {
@@ -1435,7 +1454,8 @@ third_connection_pcl_nodbs_table[CDS_MAX_TWO_CONNECTION_MODE]
[CDS_STA_P2P_CLI_MCC_24_5_1x1] = {
[CDS_STA_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
- [CDS_SAP_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
+ [CDS_SAP_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
[CDS_P2P_GO_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
[CDS_IBSS_MODE] = {
@@ -1444,7 +1464,8 @@ third_connection_pcl_nodbs_table[CDS_MAX_TWO_CONNECTION_MODE]
[CDS_STA_P2P_CLI_MCC_24_5_2x2] = {
[CDS_STA_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
- [CDS_SAP_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
+ [CDS_SAP_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
[CDS_P2P_GO_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
[CDS_IBSS_MODE] = {
@@ -1559,7 +1580,8 @@ third_connection_pcl_nodbs_table[CDS_MAX_TWO_CONNECTION_MODE]
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
[CDS_P2P_GO_SAP_SCC_24_1x1] = {
- [CDS_STA_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
+ [CDS_STA_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_SAP_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {
@@ -1570,7 +1592,8 @@ third_connection_pcl_nodbs_table[CDS_MAX_TWO_CONNECTION_MODE]
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
[CDS_P2P_GO_SAP_SCC_24_2x2] = {
- [CDS_STA_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
+ [CDS_STA_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_SAP_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {
@@ -1581,7 +1604,8 @@ third_connection_pcl_nodbs_table[CDS_MAX_TWO_CONNECTION_MODE]
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
[CDS_P2P_GO_SAP_MCC_24_1x1] = {
- [CDS_STA_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
+ [CDS_STA_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_SAP_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {
@@ -1592,7 +1616,8 @@ third_connection_pcl_nodbs_table[CDS_MAX_TWO_CONNECTION_MODE]
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
[CDS_P2P_GO_SAP_MCC_24_2x2] = {
- [CDS_STA_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
+ [CDS_STA_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_SAP_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {
@@ -1603,7 +1628,8 @@ third_connection_pcl_nodbs_table[CDS_MAX_TWO_CONNECTION_MODE]
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
[CDS_P2P_GO_SAP_SCC_5_1x1] = {
- [CDS_STA_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
+ [CDS_STA_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_SAP_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {
@@ -1614,7 +1640,8 @@ third_connection_pcl_nodbs_table[CDS_MAX_TWO_CONNECTION_MODE]
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
[CDS_P2P_GO_SAP_SCC_5_2x2] = {
- [CDS_STA_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
+ [CDS_STA_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_SAP_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {
@@ -1625,7 +1652,8 @@ third_connection_pcl_nodbs_table[CDS_MAX_TWO_CONNECTION_MODE]
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
[CDS_P2P_GO_SAP_MCC_5_1x1] = {
- [CDS_STA_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
+ [CDS_STA_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_SAP_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {
@@ -1636,7 +1664,8 @@ third_connection_pcl_nodbs_table[CDS_MAX_TWO_CONNECTION_MODE]
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
[CDS_P2P_GO_SAP_MCC_5_2x2] = {
- [CDS_STA_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
+ [CDS_STA_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_SAP_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {
@@ -1647,7 +1676,8 @@ third_connection_pcl_nodbs_table[CDS_MAX_TWO_CONNECTION_MODE]
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
[CDS_P2P_GO_SAP_MCC_24_5_1x1] = {
- [CDS_STA_MODE] = {CDS_MCC_CH_5G, CDS_5G, CDS_5G},
+ [CDS_STA_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_SAP_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {
@@ -1658,7 +1688,8 @@ third_connection_pcl_nodbs_table[CDS_MAX_TWO_CONNECTION_MODE]
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
[CDS_P2P_GO_SAP_MCC_24_5_2x2] = {
- [CDS_STA_MODE] = {CDS_MCC_CH_5G, CDS_5G, CDS_5G},
+ [CDS_STA_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_SAP_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {
@@ -1682,7 +1713,8 @@ third_connection_pcl_nodbs_table[CDS_MAX_TWO_CONNECTION_MODE]
[CDS_P2P_CLI_SAP_SCC_24_1x1] = {
- [CDS_STA_MODE] = {CDS_5G, CDS_SCC_CH, CDS_SCC_CH},
+ [CDS_STA_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_SAP_MODE] = {CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
@@ -1692,7 +1724,8 @@ third_connection_pcl_nodbs_table[CDS_MAX_TWO_CONNECTION_MODE]
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
[CDS_P2P_CLI_SAP_SCC_24_2x2] = {
- [CDS_STA_MODE] = {CDS_5G, CDS_SCC_CH, CDS_SCC_CH},
+ [CDS_STA_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_SAP_MODE] = {CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
@@ -1702,7 +1735,8 @@ third_connection_pcl_nodbs_table[CDS_MAX_TWO_CONNECTION_MODE]
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
[CDS_P2P_CLI_SAP_MCC_24_1x1] = {
- [CDS_STA_MODE] = {CDS_5G_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
+ [CDS_STA_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_SAP_MODE] = {CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
@@ -1712,7 +1746,8 @@ third_connection_pcl_nodbs_table[CDS_MAX_TWO_CONNECTION_MODE]
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
[CDS_P2P_CLI_SAP_MCC_24_2x2] = {
- [CDS_STA_MODE] = {CDS_5G_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
+ [CDS_STA_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_SAP_MODE] = {CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
@@ -1722,7 +1757,8 @@ third_connection_pcl_nodbs_table[CDS_MAX_TWO_CONNECTION_MODE]
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
[CDS_P2P_CLI_SAP_SCC_5_1x1] = {
- [CDS_STA_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
+ [CDS_STA_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_SAP_MODE] = {CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
@@ -1732,7 +1768,8 @@ third_connection_pcl_nodbs_table[CDS_MAX_TWO_CONNECTION_MODE]
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
[CDS_P2P_CLI_SAP_SCC_5_2x2] = {
- [CDS_STA_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
+ [CDS_STA_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_SAP_MODE] = {CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
@@ -1742,7 +1779,8 @@ third_connection_pcl_nodbs_table[CDS_MAX_TWO_CONNECTION_MODE]
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
[CDS_P2P_CLI_SAP_MCC_5_1x1] = {
- [CDS_STA_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
+ [CDS_STA_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_SAP_MODE] = {CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
@@ -1752,7 +1790,8 @@ third_connection_pcl_nodbs_table[CDS_MAX_TWO_CONNECTION_MODE]
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
[CDS_P2P_CLI_SAP_MCC_5_2x2] = {
- [CDS_STA_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
+ [CDS_STA_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_SAP_MODE] = {CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
@@ -1762,7 +1801,8 @@ third_connection_pcl_nodbs_table[CDS_MAX_TWO_CONNECTION_MODE]
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
[CDS_P2P_CLI_SAP_MCC_24_5_1x1] = {
- [CDS_STA_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
+ [CDS_STA_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_SAP_MODE] = {CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
@@ -1772,7 +1812,8 @@ third_connection_pcl_nodbs_table[CDS_MAX_TWO_CONNECTION_MODE]
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
[CDS_P2P_CLI_SAP_MCC_24_5_2x2] = {
- [CDS_STA_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
+ [CDS_STA_MODE] = {
+ CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_SAP_MODE] = {CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
[CDS_P2P_CLIENT_MODE] = {
CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
@@ -2050,8 +2091,6 @@ bool cds_set_connection_in_progress(bool value)
* @bw: Bandwidth
* @mac: Mac id
* @chain_mask: Chain mask
- * @tx_spatial_stream: Tx spatial stream
- * @rx_spatial_stream: Rx spatial stream
* @vdev_id: vdev id
* @in_use: Flag to indicate if the index is in use or not
*
@@ -2065,8 +2104,6 @@ static void cds_update_conc_list(uint32_t conn_index,
enum hw_mode_bandwidth bw,
uint8_t mac,
enum cds_chain_mode chain_mask,
- uint8_t tx_spatial_stream,
- uint8_t rx_spatial_stream,
uint32_t original_nss,
uint32_t vdev_id,
bool in_use)
@@ -2081,8 +2118,6 @@ static void cds_update_conc_list(uint32_t conn_index,
conc_connection_list[conn_index].bw = bw;
conc_connection_list[conn_index].mac = mac;
conc_connection_list[conn_index].chain_mask = chain_mask;
- conc_connection_list[conn_index].tx_spatial_stream = tx_spatial_stream;
- conc_connection_list[conn_index].rx_spatial_stream = rx_spatial_stream;
conc_connection_list[conn_index].original_nss = original_nss;
conc_connection_list[conn_index].vdev_id = vdev_id;
conc_connection_list[conn_index].in_use = in_use;
@@ -2224,22 +2259,9 @@ static void cds_update_hw_mode_conn_info(uint32_t num_vdev_mac_entries,
if (found) {
conc_connection_list[conn_index].mac =
vdev_mac_map[i].mac_id;
- if (vdev_mac_map[i].mac_id == 0) {
- conc_connection_list[conn_index].
- tx_spatial_stream = hw_mode.mac0_tx_ss;
- conc_connection_list[conn_index].
- rx_spatial_stream = hw_mode.mac0_rx_ss;
- } else {
- conc_connection_list[conn_index].
- tx_spatial_stream = hw_mode.mac1_tx_ss;
- conc_connection_list[conn_index].
- rx_spatial_stream = hw_mode.mac1_rx_ss;
- }
- cds_info("vdev:%d, mac:%d, tx ss:%d, rx ss;%d",
+ cds_info("vdev:%d, mac:%d",
conc_connection_list[conn_index].vdev_id,
- conc_connection_list[conn_index].mac,
- conc_connection_list[conn_index].tx_spatial_stream,
- conc_connection_list[conn_index].rx_spatial_stream);
+ conc_connection_list[conn_index].mac);
}
}
cds_dump_connection_status_info();
@@ -2988,95 +3010,6 @@ static bool cds_current_concurrency_is_scc(void)
}
/**
- * cds_dump_legacy_concurrency() - To dump the current
- * concurrency combination
- * @sta_channel: Channel STA connection has come up
- * @ap_channel: Channel SAP connection has come up
- * @p2p_channel: Channel P2P connection has come up
- * @sta_bssid: BSSID to which STA is connected to
- * @p2p_bssid: BSSID to which P2P is connected to
- * @ap_bssid: BSSID of the AP
- * @p2p_mode: P2P Client or GO
- *
- * This routine is called to dump the concurrency info
- *
- * Return: None
- */
-static void cds_dump_legacy_concurrency(
- uint8_t sta_channel, uint8_t ap_channel, uint8_t p2p_channel,
- struct qdf_mac_addr sta_bssid, struct qdf_mac_addr p2p_bssid,
- struct qdf_mac_addr ap_bssid, const char *p2p_mode)
-{
- const char *cc_mode = "Standalone";
- hdd_context_t *hdd_ctx;
-
- hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
- if (!hdd_ctx) {
- cds_err("HDD context is NULL");
- return;
- }
-
- if ((sta_channel == 0) && (ap_channel == 0) && (p2p_channel == 0)) {
- cds_err("IBSS standalone");
- hdd_ctx->mcc_mode = 0;
- return;
- }
- if (sta_channel > 0) {
- if (ap_channel > 0) {
- if (p2p_channel > 0) {
- /* STA + AP + P2P */
- if (p2p_channel == sta_channel
- && ap_channel == sta_channel) {
- cc_mode = "STA+AP+P2P SCC";
- } else {
- if (p2p_channel == sta_channel)
- cc_mode =
- "STA+P2P SCC, SAP MCC";
- else if (ap_channel == sta_channel)
- cc_mode =
- "STA+SAP SCC, P2P MCC";
- else if (ap_channel == p2p_channel)
- cc_mode =
- "P2P+SAP SCC, STA MCC";
- }
- } else {
- /* STA + AP */
- cc_mode = (ap_channel == sta_channel) ?
- "SCC" : "MCC";
- }
- } else {
- if (p2p_channel > 0) {
- /* STA + P2P */
- cc_mode = (p2p_channel == sta_channel) ?
- "SCC" : "MCC";
- }
- }
- } else {
- if (ap_channel > 0) {
- if (p2p_channel > 0) {
- /* AP + P2P */
- cc_mode = (p2p_channel == ap_channel) ?
- "SCC" : "MCC";
- }
- }
- }
- if (sta_channel > 0)
- cds_err("wlan(%d) " MAC_ADDRESS_STR " %s",
- sta_channel, MAC_ADDR_ARRAY(sta_bssid.bytes), cc_mode);
-
- if (p2p_channel > 0)
- cds_err("p2p-%s(%d) " MAC_ADDRESS_STR " %s",
- p2p_mode, p2p_channel, MAC_ADDR_ARRAY(p2p_bssid.bytes),
- cc_mode);
-
- if (ap_channel > 0)
- cds_err("AP(%d) " MAC_ADDRESS_STR " %s",
- ap_channel, MAC_ADDR_ARRAY(ap_bssid.bytes), cc_mode);
-
- hdd_ctx->mcc_mode = strcmp(cc_mode, "SCC");
-}
-
-/**
* cds_dump_concurrency_info() - To dump concurrency info
*
* This routine is called to dump the concurrency info
@@ -3358,17 +3291,8 @@ void cds_dump_concurrency_info(void)
status = hdd_get_next_adapter(hdd_ctx, adapterNode, &pNext);
adapterNode = pNext;
}
- if (hdd_ctx->config->policy_manager_enabled) {
- cds_dump_current_concurrency();
- hdd_ctx->mcc_mode = !cds_current_concurrency_is_scc();
- } else {
- /* hdd_ctx->mcc_mode gets updated inside below function, which
- * gets used by IPA
- */
- cds_dump_legacy_concurrency(
- staChannel, apChannel, p2pChannel,
- staBssid, p2pBssid, apBssid, p2pMode);
- }
+ cds_dump_current_concurrency();
+ hdd_ctx->mcc_mode = !cds_current_concurrency_is_scc();
}
/**
@@ -3628,15 +3552,7 @@ enum cds_conc_next_action cds_need_opportunistic_upgrade(void)
uint32_t conn_index;
enum cds_conc_next_action upgrade = CDS_NOP;
uint8_t mac = 0;
-#ifdef QCA_WIFI_3_0_EMU
- hdd_context_t *hdd_ctx;
- hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
- if (!hdd_ctx) {
- cds_err("HDD context is NULL");
- return upgrade;
- }
-#endif
if (wma_is_hw_dbs_capable() == false) {
cds_err("driver isn't dbs capable, no further action needed");
return upgrade;
@@ -3663,14 +3579,6 @@ enum cds_conc_next_action cds_need_opportunistic_upgrade(void)
goto done;
}
}
-#ifdef QCA_WIFI_3_0_EMU
- /* For M2M emulation only: if we have a connection on 2.4, stay in DBS */
- if (hdd_ctx->config->enable_m2m_limitation &&
- CDS_IS_CHANNEL_24GHZ(conc_connection_list[0].chan)) {
- cds_debug("emulation only: conn on 2.4, stay in DBS");
- goto done;
- }
-#endif
/* Let's request for single MAC mode */
upgrade = CDS_SINGLE_MAC;
/* Is there any connection had an initial connection with 2x2 */
@@ -3959,7 +3867,8 @@ QDF_STATUS cds_deinit_policy_mgr(void)
return QDF_STATUS_E_FAILURE;
}
- cds_ctx->sme_get_valid_chans = NULL;
+ cds_ctx->sme_get_valid_channels = NULL;
+ cds_ctx->sme_get_nss_for_vdev = NULL;
if (QDF_IS_STATUS_ERROR(cds_reset_sap_mandatory_channels())) {
cds_err("failed to reset sap mandatory channels");
@@ -3977,8 +3886,7 @@ QDF_STATUS cds_deinit_policy_mgr(void)
*
* Return: Success if the policy manager is initialized completely
*/
-QDF_STATUS cds_init_policy_mgr(
- QDF_STATUS (*sme_get_valid_chans)(void*, uint8_t *, uint32_t *))
+QDF_STATUS cds_init_policy_mgr(struct cds_sme_cbacks *sme_cbacks)
{
QDF_STATUS status;
hdd_context_t *hdd_ctx;
@@ -4026,7 +3934,8 @@ QDF_STATUS cds_init_policy_mgr(
}
cds_ctx->do_hw_mode_change = false;
- cds_ctx->sme_get_valid_chans = sme_get_valid_chans;
+ cds_ctx->sme_get_valid_channels = sme_cbacks->sme_get_valid_channels;
+ cds_ctx->sme_get_nss_for_vdev = sme_cbacks->sme_get_nss_for_vdev;
status = cds_reset_sap_mandatory_channels();
if (QDF_IS_STATUS_ERROR(status)) {
@@ -4190,6 +4099,11 @@ QDF_STATUS cds_incr_connection_count(uint32_t vdev_id)
struct wma_txrx_node *wma_conn_table_entry;
hdd_context_t *hdd_ctx;
cds_context_type *cds_ctx;
+ enum cds_chain_mode chain_mask = CDS_ONE_ONE;
+ uint8_t nss_2g, nss_5g;
+ enum cds_con_mode mode;
+ uint8_t chan;
+ uint32_t nss = 0;
hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
if (!hdd_ctx) {
@@ -4216,23 +4130,32 @@ QDF_STATUS cds_incr_connection_count(uint32_t vdev_id)
cds_err("can't find vdev_id %d in WMA table", vdev_id);
return status;
}
+ mode = cds_get_mode(wma_conn_table_entry->type,
+ wma_conn_table_entry->sub_type);
+ chan = cds_freq_to_chan(wma_conn_table_entry->mhz);
+ status = cds_get_nss_for_vdev(mode, &nss_2g, &nss_5g);
+ if (QDF_IS_STATUS_SUCCESS(status)) {
+ if ((CDS_IS_CHANNEL_24GHZ(chan) && (nss_2g > 1)) ||
+ (CDS_IS_CHANNEL_5GHZ(chan) && (nss_5g > 1)))
+ chain_mask = CDS_TWO_TWO;
+ else
+ chain_mask = CDS_ONE_ONE;
+ nss = (CDS_IS_CHANNEL_24GHZ(chan)) ? nss_2g : nss_5g;
+ } else {
+ cds_err("Error in getting nss");
+ }
+
/* add the entry */
cds_update_conc_list(conn_index,
- cds_get_mode(wma_conn_table_entry->type,
- wma_conn_table_entry->sub_type),
- cds_freq_to_chan(wma_conn_table_entry->mhz),
+ mode,
+ chan,
cds_get_bw(wma_conn_table_entry->chan_width),
wma_conn_table_entry->mac_id,
- wma_conn_table_entry->chain_mask,
- wma_conn_table_entry->tx_streams,
- wma_conn_table_entry->rx_streams,
- wma_conn_table_entry->nss, vdev_id, true);
- cds_info("Add at idx:%d vdev %d tx ss=%d rx ss=%d chainmask=%d mac=%d",
+ chain_mask,
+ nss, vdev_id, true);
+ cds_info("Add at idx:%d vdev %d mac=%d",
conn_index, vdev_id,
- wma_conn_table_entry->tx_streams,
- wma_conn_table_entry->rx_streams,
- wma_conn_table_entry->chain_mask,
wma_conn_table_entry->mac_id);
return QDF_STATUS_SUCCESS;
@@ -4256,6 +4179,11 @@ QDF_STATUS cds_update_connection_info(uint32_t vdev_id)
bool found = false;
struct wma_txrx_node *wma_conn_table_entry;
cds_context_type *cds_ctx;
+ enum cds_chain_mode chain_mask = CDS_ONE_ONE;
+ uint8_t nss_2g, nss_5g;
+ enum cds_con_mode mode;
+ uint8_t chan;
+ uint32_t nss = 0;
cds_ctx = cds_get_context(QDF_MODULE_ID_QDF);
if (!cds_ctx) {
@@ -4288,20 +4216,31 @@ QDF_STATUS cds_update_connection_info(uint32_t vdev_id)
cds_err("can't find vdev_id %d in WMA table", vdev_id);
return status;
}
+ mode = cds_get_mode(wma_conn_table_entry->type,
+ wma_conn_table_entry->sub_type);
+ chan = cds_freq_to_chan(wma_conn_table_entry->mhz);
+ status = cds_get_nss_for_vdev(mode, &nss_2g, &nss_5g);
+ if (QDF_IS_STATUS_SUCCESS(status)) {
+ if ((CDS_IS_CHANNEL_24GHZ(chan) && (nss_2g > 1)) ||
+ (CDS_IS_CHANNEL_5GHZ(chan) && (nss_5g > 1)))
+ chain_mask = CDS_TWO_TWO;
+ else
+ chain_mask = CDS_ONE_ONE;
+ nss = (CDS_IS_CHANNEL_24GHZ(chan)) ? nss_2g : nss_5g;
+ } else {
+ cds_err("Error in getting nss");
+ }
cds_debug("update PM connection table for vdev:%d", vdev_id);
/* add the entry */
cds_update_conc_list(conn_index,
- cds_get_mode(wma_conn_table_entry->type,
- wma_conn_table_entry->sub_type),
- cds_freq_to_chan(wma_conn_table_entry->mhz),
+ mode,
+ chan,
cds_get_bw(wma_conn_table_entry->chan_width),
wma_conn_table_entry->mac_id,
- wma_conn_table_entry->chain_mask,
- wma_conn_table_entry->tx_streams,
- wma_conn_table_entry->rx_streams,
- wma_conn_table_entry->nss, vdev_id, true);
+ chain_mask,
+ nss, vdev_id, true);
qdf_mutex_release(&cds_ctx->qdf_conc_list_lock);
return QDF_STATUS_SUCCESS;
}
@@ -4340,10 +4279,6 @@ QDF_STATUS cds_decr_connection_count(uint32_t vdev_id)
while (CONC_CONNECTION_LIST_VALID_INDEX(next_conn_index)) {
conc_connection_list[conn_index].vdev_id =
conc_connection_list[next_conn_index].vdev_id;
- conc_connection_list[conn_index].tx_spatial_stream =
- conc_connection_list[next_conn_index].tx_spatial_stream;
- conc_connection_list[conn_index].rx_spatial_stream =
- conc_connection_list[next_conn_index].rx_spatial_stream;
conc_connection_list[conn_index].mode =
conc_connection_list[next_conn_index].mode;
conc_connection_list[conn_index].mac =
@@ -4651,15 +4586,22 @@ QDF_STATUS cds_get_channel_list(enum cds_pcl_type pcl,
}
/* Let's divide the list in 2.4 & 5 Ghz lists */
- while ((channel_list[chan_index] <= 11) &&
+ while ((chan_index < QDF_MAX_NUM_CHAN) &&
+ (channel_list[chan_index] <= 11) &&
(chan_index_24 < QDF_MAX_NUM_CHAN))
channel_list_24[chan_index_24++] = channel_list[chan_index++];
- if (channel_list[chan_index] == 12) {
+ if ((chan_index < QDF_MAX_NUM_CHAN) &&
+ (channel_list[chan_index] == 12) &&
+ (chan_index_24 < QDF_MAX_NUM_CHAN)) {
channel_list_24[chan_index_24++] = channel_list[chan_index++];
- if (channel_list[chan_index] == 13) {
+ if ((chan_index < QDF_MAX_NUM_CHAN) &&
+ (channel_list[chan_index] == 13) &&
+ (chan_index_24 < QDF_MAX_NUM_CHAN)) {
channel_list_24[chan_index_24++] =
channel_list[chan_index++];
- if (channel_list[chan_index] == 14)
+ if ((chan_index < QDF_MAX_NUM_CHAN) &&
+ (channel_list[chan_index] == 14) &&
+ (chan_index_24 < QDF_MAX_NUM_CHAN))
channel_list_24[chan_index_24++] =
channel_list[chan_index++];
}
@@ -5114,15 +5056,6 @@ bool cds_disallow_mcc(uint8_t channel)
bool cds_allow_new_home_channel(uint8_t channel, uint32_t num_connections)
{
bool status = true;
-#ifdef QCA_WIFI_3_0_EMU
- hdd_context_t *hdd_ctx;
-
- hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
- if (!hdd_ctx) {
- cds_err("HDD context is NULL");
- return false;
- }
-#endif
if ((num_connections == 2) &&
(conc_connection_list[0].chan != conc_connection_list[1].chan)
@@ -5147,23 +5080,7 @@ bool cds_allow_new_home_channel(uint8_t channel, uint32_t num_connections)
cds_err("don't allow 3rd home channel on same MAC");
status = false;
}
-#ifndef QCA_WIFI_3_0_EMU
- }
-#else
- } else if (hdd_ctx->config->enable_m2m_limitation &&
- (num_connections == 1) &&
- (conc_connection_list[0].chan != channel)) {
- if (((CDS_IS_CHANNEL_24GHZ(channel)) &&
- (CDS_IS_CHANNEL_24GHZ
- (conc_connection_list[0].chan))) ||
- ((CDS_IS_CHANNEL_5GHZ(channel)) &&
- (CDS_IS_CHANNEL_5GHZ
- (conc_connection_list[0].chan)))) {
- cds_err("don't allow 2nd home channel on same MAC");
- status = false;
- }
}
-#endif
return status;
}
@@ -5252,6 +5169,8 @@ bool cds_allow_concurrency(enum cds_con_mode mode,
uint32_t list[MAX_NUMBER_OF_CONC_CONNECTIONS];
hdd_context_t *hdd_ctx;
cds_context_type *cds_ctx;
+ QDF_STATUS ret;
+ struct sir_pcl_list pcl;
hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
if (!hdd_ctx) {
@@ -5266,6 +5185,15 @@ bool cds_allow_concurrency(enum cds_con_mode mode,
}
qdf_mutex_acquire(&cds_ctx->qdf_conc_list_lock);
+
+ qdf_mem_zero(&pcl, sizeof(pcl));
+ ret = cds_get_pcl(mode, pcl.pcl_list, &pcl.pcl_len,
+ pcl.weight_list, QDF_ARRAY_SIZE(pcl.weight_list));
+ if (QDF_IS_STATUS_ERROR(ret)) {
+ cds_err("disallow connection:%d", ret);
+ goto done;
+ }
+
/* find the current connection state from conc_connection_list*/
num_connections = cds_get_connection_count();
@@ -5293,22 +5221,7 @@ bool cds_allow_concurrency(enum cds_con_mode mode,
list);
if ((count > 0) && CDS_IS_DFS_CH(channel)) {
cds_err("STA active, don't allow DFS channel for 2nd connection");
-#ifndef QCA_WIFI_3_0_EMU
- /*
- * REMOVE THIS COMMENT ONCE QCA_WIFI_3_0_EMU
- * FLAG GETS REMOVED
- * ==================================================
- * As on emulation we can support only 2 nodes max, if
- * we don't allow STA DFS (ch.100) + SAP DFS (ch.100)
- * then we can't test the mechanism on other device
- * where corresponding SAP DFS(ch.100) + STA DFS(
- * STA is trying to come up and as a result it will push
- * SAP on this device to non-dfs through CSA IE)
- * will trigger CSA.
- * =================================================
- */
goto done;
-#endif
}
/*
@@ -5376,18 +5289,10 @@ bool cds_allow_concurrency(enum cds_con_mode mode,
cds_err("No IBSS, we have concurrent connections already");
goto done;
}
-#ifndef QCA_WIFI_3_0_EMU
if (CDS_STA_MODE != conc_connection_list[0].mode) {
cds_err("No IBSS, we've a non-STA connection");
goto done;
}
-#else
- if (CDS_STA_MODE != conc_connection_list[0].mode &&
- CDS_SAP_MODE != conc_connection_list[0].mode) {
- cds_err("No IBSS, we've a non-STA/SAP conn");
- goto done;
- }
-#endif
/*
* This logic protects STA and IBSS to come up on same
* band. If requirement changes then this condition
@@ -6032,14 +5937,6 @@ QDF_STATUS cds_current_connections_update(uint32_t session_id,
switch (num_connections) {
case 0:
next_action = CDS_NOP;
-#ifdef QCA_WIFI_3_0_EMU
- /* For M2M emulation only: if it is a connection on 2.4,
- * request DBS
- */
- if (hdd_ctx->config->enable_m2m_limitation &&
- CDS_IS_CHANNEL_24GHZ(channel))
- next_action = CDS_DBS;
-#endif
break;
case 1:
second_index =
@@ -6104,11 +6001,9 @@ bool cds_wait_for_nss_update(uint8_t action)
conn_index < MAX_NUMBER_OF_CONC_CONNECTIONS;
conn_index++) {
if ((conc_connection_list
- [conn_index].original_nss == 1) &&
- (conc_connection_list
- [conn_index].tx_spatial_stream == 2) &&
+ [conn_index].original_nss == 2) &&
(conc_connection_list
- [conn_index].rx_spatial_stream == 2) &&
+ [conn_index].chain_mask == CDS_TWO_TWO) &&
conc_connection_list[conn_index].in_use &&
((conc_connection_list[conn_index].mode ==
CDS_P2P_GO_MODE) ||
@@ -6123,11 +6018,9 @@ bool cds_wait_for_nss_update(uint8_t action)
conn_index < MAX_NUMBER_OF_CONC_CONNECTIONS;
conn_index++) {
if ((conc_connection_list
- [conn_index].original_nss == 1) &&
+ [conn_index].original_nss == 2) &&
(conc_connection_list
- [conn_index].tx_spatial_stream == 1) &&
- (conc_connection_list
- [conn_index].rx_spatial_stream == 1) &&
+ [conn_index].chain_mask == CDS_TWO_TWO) &&
conc_connection_list[conn_index].in_use &&
((conc_connection_list[conn_index].mode ==
CDS_P2P_GO_MODE) ||
@@ -6188,13 +6081,9 @@ void cds_nss_update_cb(void *context, uint8_t tx_status, uint8_t vdev_id,
}
switch (next_action) {
case CDS_DBS:
- conc_connection_list[conn_index].tx_spatial_stream = 1;
- conc_connection_list[conn_index].rx_spatial_stream = 1;
wait = cds_wait_for_nss_update(next_action);
break;
case CDS_SINGLE_MAC:
- conc_connection_list[conn_index].tx_spatial_stream = 2;
- conc_connection_list[conn_index].rx_spatial_stream = 2;
wait = cds_wait_for_nss_update(next_action);
break;
default:
@@ -6233,7 +6122,7 @@ QDF_STATUS cds_complete_action(uint8_t new_nss, uint8_t next_action,
uint32_t session_id)
{
QDF_STATUS status = QDF_STATUS_E_FAILURE;
- uint32_t index = 0, count = 0;
+ uint32_t index, count;
uint32_t list[MAX_NUMBER_OF_CONC_CONNECTIONS];
uint32_t conn_index = 0;
hdd_context_t *hdd_ctx;
@@ -6256,7 +6145,7 @@ QDF_STATUS cds_complete_action(uint8_t new_nss, uint8_t next_action,
*/
count = cds_mode_specific_connection_count(
CDS_P2P_GO_MODE, list);
- while (index < count) {
+ for (index = 0; index < count; index++) {
conn_index = cds_get_connection_for_vdev_id(
conc_connection_list[list[index]].vdev_id);
if (MAX_NUMBER_OF_CONC_CONNECTIONS == conn_index) {
@@ -6276,13 +6165,18 @@ QDF_STATUS cds_complete_action(uint8_t new_nss, uint8_t next_action,
conc_connection_list[list[index]].vdev_id);
}
}
- index++;
}
- index = 0;
count = cds_mode_specific_connection_count(
CDS_SAP_MODE, list);
- while (index < count) {
+ for (index = 0; index < count; index++) {
+ conn_index = cds_get_connection_for_vdev_id(
+ conc_connection_list[list[index]].vdev_id);
+ if (MAX_NUMBER_OF_CONC_CONNECTIONS == conn_index) {
+ cds_err("connection not found for vdev %d",
+ conc_connection_list[list[index]].vdev_id);
+ continue;
+ }
if (1 == conc_connection_list[list[index]].original_nss) {
status = sme_nss_update_request(hdd_ctx->hHal,
conc_connection_list
@@ -6294,7 +6188,6 @@ QDF_STATUS cds_complete_action(uint8_t new_nss, uint8_t next_action,
conc_connection_list[list[index]].vdev_id);
}
}
- index++;
}
if (!QDF_IS_STATUS_SUCCESS(status))
status = cds_next_actions(session_id,
@@ -7623,6 +7516,7 @@ void cds_set_mcc_latency(hdd_adapter_t *adapter, int set_value)
}
}
+#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
/**
* cds_change_sap_channel_with_csa() - Move SAP channel using (E)CSA
* @adapter: AP adapter
@@ -7650,6 +7544,7 @@ void cds_change_sap_channel_with_csa(hdd_adapter_t *adapter,
hdd_ap_ctx->sapConfig.ch_params.ch_width);
}
}
+#endif
#if defined(FEATURE_WLAN_MCC_TO_SCC_SWITCH) || \
defined(FEATURE_WLAN_STA_AP_MODE_DFS_DISABLE)
@@ -7813,8 +7708,7 @@ QDF_STATUS cds_update_connection_info_utfw(
cds_update_conc_list(conn_index,
cds_get_mode(type, sub_type),
channelid, HW_MODE_20_MHZ,
- mac_id, chain_mask, tx_streams,
- rx_streams, 0, vdev_id, true);
+ mac_id, chain_mask, 0, vdev_id, true);
qdf_mutex_release(&cds_ctx->qdf_conc_list_lock);
return QDF_STATUS_SUCCESS;
@@ -7856,8 +7750,7 @@ QDF_STATUS cds_incr_connection_count_utfw(
cds_update_conc_list(conn_index,
cds_get_mode(type, sub_type),
channelid, HW_MODE_20_MHZ,
- mac_id, chain_mask, tx_streams,
- rx_streams, 0, vdev_id, true);
+ mac_id, chain_mask, 0, vdev_id, true);
qdf_mutex_release(&cds_ctx->qdf_conc_list_lock);
return QDF_STATUS_SUCCESS;
@@ -7868,6 +7761,7 @@ QDF_STATUS cds_decr_connection_count_utfw(uint32_t del_all,
{
QDF_STATUS status;
cds_context_type *cds_ctx;
+ struct cds_sme_cbacks sme_cbacks;
cds_ctx = cds_get_context(QDF_MODULE_ID_QDF);
if (!cds_ctx) {
@@ -7875,8 +7769,10 @@ QDF_STATUS cds_decr_connection_count_utfw(uint32_t del_all,
return QDF_STATUS_E_FAILURE;
}
+ sme_cbacks.sme_get_valid_channels = sme_get_cfg_valid_channels;
+ sme_cbacks.sme_get_nss_for_vdev = sme_get_vdev_type_nss;
if (del_all) {
- status = cds_init_policy_mgr(sme_get_cfg_valid_channels);
+ status = cds_init_policy_mgr(&sme_cbacks);
if (!QDF_IS_STATUS_SUCCESS(status)) {
cds_err("Policy manager initialization failed");
return QDF_STATUS_E_FAILURE;
@@ -8278,14 +8174,6 @@ enum cds_conc_next_action cds_get_current_pref_hw_mode(void)
*/
switch (num_connections) {
case 1:
-#ifdef QCA_WIFI_3_0_EMU
- /* For M2M emulation only: if it is a connection on 2.4,
- * request DBS
- */
- if (hdd_ctx->config->enable_m2m_limitation &&
- CDS_IS_CHANNEL_24GHZ(conc_connection_list[0].chan))
- return CDS_DBS_DOWNGRADE;
-#endif
/* The driver would already be in the required hw mode */
return CDS_NOP;
case 2:
@@ -8431,16 +8319,6 @@ cds_get_nondfs_preferred_channel(enum cds_con_mode mode,
}
for (i = 0; i < pcl_len; i++) {
-#ifdef QCA_WIFI_3_0_EMU
- /*
- * for Emulation platform MCC is not allowed.
- * so better don't return 5G channel as this API mostly
- * called when one more persona wants to come up on 5G band
- */
- if (CDS_IS_CHANNEL_5GHZ(pcl_channels[i])) {
- continue;
- }
-#endif
if (CDS_IS_DFS_CH(pcl_channels[i])) {
continue;
} else {
@@ -8514,13 +8392,13 @@ QDF_STATUS cds_get_valid_chans(uint8_t *chan_list, uint32_t *list_len)
return QDF_STATUS_E_FAILURE;
}
- if (!cds_ctx->sme_get_valid_chans) {
+ if (!cds_ctx->sme_get_valid_channels) {
cds_err("sme_get_valid_chans callback is NULL");
return QDF_STATUS_E_FAILURE;
}
*list_len = QDF_MAX_NUM_CHAN;
- status = cds_ctx->sme_get_valid_chans(hdd_ctx->hHal,
+ status = cds_ctx->sme_get_valid_channels(hdd_ctx->hHal,
chan_list, list_len);
if (QDF_IS_STATUS_ERROR(status)) {
cds_err("Error in getting valid channels");
@@ -8532,6 +8410,68 @@ QDF_STATUS cds_get_valid_chans(uint8_t *chan_list, uint32_t *list_len)
}
/**
+ * cds_get_nss_for_vdev() - Get the allowed nss value for the
+ * vdev
+ * @dev_mode: connection type.
+ * @nss2g: Pointer to the 2G Nss parameter.
+ * @nss5g: Pointer to the 5G Nss parameter.
+ *
+ * Fills the 2G and 5G Nss values based on connection type.
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS cds_get_nss_for_vdev(enum cds_con_mode mode,
+ uint8_t *nss_2g, uint8_t *nss_5g)
+{
+ hdd_context_t *hdd_ctx;
+ cds_context_type *cds_ctx;
+ enum tQDF_ADAPTER_MODE dev_mode;
+
+ switch (mode) {
+ case CDS_STA_MODE:
+ dev_mode = QDF_STA_MODE;
+ break;
+ case CDS_SAP_MODE:
+ dev_mode = QDF_SAP_MODE;
+ break;
+ case CDS_P2P_CLIENT_MODE:
+ dev_mode = QDF_P2P_CLIENT_MODE;
+ break;
+ case CDS_P2P_GO_MODE:
+ dev_mode = QDF_P2P_GO_MODE;
+ break;
+ case CDS_IBSS_MODE:
+ dev_mode = QDF_IBSS_MODE;
+ break;
+ default:
+ cds_err("Invalid mode to get allowed NSS value");
+ return QDF_STATUS_E_FAILURE;
+ };
+
+ hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
+ if (!hdd_ctx) {
+ cds_err("HDD context is NULL");
+ return QDF_STATUS_E_FAILURE;
+ }
+
+ cds_ctx = cds_get_context(QDF_MODULE_ID_QDF);
+ if (!cds_ctx) {
+ cds_err("Invalid CDS Context");
+ return QDF_STATUS_E_FAILURE;
+ }
+
+ if (!cds_ctx->sme_get_nss_for_vdev) {
+ cds_err("sme_get_nss_for_vdev callback is NULL");
+ return QDF_STATUS_E_FAILURE;
+ }
+
+ cds_ctx->sme_get_nss_for_vdev(hdd_ctx->hHal,
+ dev_mode, nss_2g, nss_5g);
+
+ return QDF_STATUS_SUCCESS;
+}
+
+/**
* cds_list_has_24GHz_channel() - Check if list contains 2.4GHz channels
* @channel_list: Channel list
* @list_len: Length of the channel list
@@ -8824,8 +8764,7 @@ QDF_STATUS cds_set_hw_mode_on_channel_switch(uint8_t session_id)
return status;
}
- if (!(hdd_ctx->config->policy_manager_enabled &&
- wma_is_hw_dbs_capable())) {
+ if (!wma_is_hw_dbs_capable()) {
cds_err("PM/DBS is disabled");
return status;
}
@@ -8898,11 +8837,9 @@ void cds_dump_connection_status_info(void)
}
for (i = 0; i < MAX_NUMBER_OF_CONC_CONNECTIONS; i++) {
- cds_debug("%d: use:%d vdev:%d tx:%d rx:%d mode:%d mac:%d chan:%d chainmask:%d orig nss:%d bw:%d",
+ cds_debug("%d: use:%d vdev:%d mode:%d mac:%d chan:%d orig chainmask:%d orig nss:%d bw:%d",
i, conc_connection_list[i].in_use,
conc_connection_list[i].vdev_id,
- conc_connection_list[i].tx_spatial_stream,
- conc_connection_list[i].rx_spatial_stream,
conc_connection_list[i].mode,
conc_connection_list[i].mac,
conc_connection_list[i].chan,
diff --git a/core/cds/src/cds_sched.c b/core/cds/src/cds_sched.c
index 6dcd4b471995..dadfbcdda4d8 100644
--- a/core/cds/src/cds_sched.c
+++ b/core/cds/src/cds_sched.c
@@ -84,11 +84,242 @@ static QDF_STATUS cds_alloc_ol_rx_pkt_freeq(p_cds_sched_context pSchedContext);
#ifdef QCA_CONFIG_SMP
#define CDS_CORE_PER_CLUSTER (4)
-static int cds_set_cpus_allowed_ptr(struct task_struct *task, unsigned long cpu)
+/*Maximum 2 clusters supported*/
+#define CDS_MAX_CPU_CLUSTERS 2
+
+#define CDS_CPU_CLUSTER_TYPE_LITTLE 0
+#define CDS_CPU_CLUSTER_TYPE_PERF 1
+
+static inline
+int cds_set_cpus_allowed_ptr(struct task_struct *task, unsigned long cpu)
{
return set_cpus_allowed_ptr(task, cpumask_of(cpu));
}
+
+/**
+ * cds_sched_find_attach_cpu - find available cores and attach to required core
+ * @pSchedContext: wlan scheduler context
+ * @high_throughput: high throughput is required or not
+ *
+ * Find current online cores.
+ * high troughput required and PERF core online, then attach to last PERF core
+ * low throughput required or only little cores online, the attach any little
+ * core
+ *
+ * Return: 0 success
+ * 1 fail
+ */
+static int cds_sched_find_attach_cpu(p_cds_sched_context pSchedContext,
+ bool high_throughput)
+{
+ unsigned long *online_perf_cpu = NULL;
+ unsigned long *online_litl_cpu = NULL;
+ unsigned char perf_core_count = 0;
+ unsigned char litl_core_count = 0;
+ int cds_max_cluster_id = 0;
+#ifdef WLAN_OPEN_SOURCE
+ struct cpumask litl_mask;
+ unsigned long cpus;
+ int i;
+#endif
+
+ QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_INFO_LOW,
+ "%s: num possible cpu %d",
+ __func__, num_possible_cpus());
+
+ online_perf_cpu = qdf_mem_malloc(
+ num_possible_cpus() * sizeof(unsigned long));
+ if (!online_perf_cpu) {
+ QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
+ "%s: perf cpu cache alloc fail", __func__);
+ return 1;
+ }
+
+ online_litl_cpu = qdf_mem_malloc(
+ num_possible_cpus() * sizeof(unsigned long));
+ if (!online_litl_cpu) {
+ QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
+ "%s: lttl cpu cache alloc fail", __func__);
+ qdf_mem_free(online_perf_cpu);
+ return 1;
+ }
+
+ /* Get Online perf CPU count */
+#if defined(WLAN_OPEN_SOURCE) && \
+ (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0))
+ for_each_online_cpu(cpus) {
+ if (topology_physical_package_id(cpus) > CDS_MAX_CPU_CLUSTERS) {
+ QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
+ "%s: can handle max %d clusters, returning...",
+ __func__, CDS_MAX_CPU_CLUSTERS);
+ goto err;
+ }
+
+ if (topology_physical_package_id(cpus) ==
+ CDS_CPU_CLUSTER_TYPE_PERF) {
+ online_perf_cpu[perf_core_count] = cpus;
+ perf_core_count++;
+ } else {
+ online_litl_cpu[litl_core_count] = cpus;
+ litl_core_count++;
+ }
+ cds_max_cluster_id = topology_physical_package_id(cpus);
+ }
+#else
+ cds_max_cluster_id = 0;
+#endif
+
+ /* Single cluster system, not need to handle this */
+ if (0 == cds_max_cluster_id) {
+ QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_INFO_LOW,
+ "%s: single cluster system. returning", __func__);
+ goto success;
+ }
+
+ if ((!litl_core_count) && (!perf_core_count)) {
+ QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
+ "%s: Both Cluster off, do nothing", __func__);
+ goto success;
+ }
+
+ if ((high_throughput && perf_core_count) || (!litl_core_count)) {
+ /* Attach RX thread to PERF CPU */
+ if (pSchedContext->rx_thread_cpu !=
+ online_perf_cpu[perf_core_count - 1]) {
+ if (cds_set_cpus_allowed_ptr(
+ pSchedContext->ol_rx_thread,
+ online_perf_cpu[perf_core_count - 1])) {
+ QDF_TRACE(QDF_MODULE_ID_QDF,
+ QDF_TRACE_LEVEL_ERROR,
+ "%s: rx thread perf core set fail",
+ __func__);
+ goto err;
+ }
+ pSchedContext->rx_thread_cpu =
+ online_perf_cpu[perf_core_count - 1];
+ }
+ } else {
+#if defined(WLAN_OPEN_SOURCE) && \
+ (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0))
+ /* Attach to any little core
+ * Final decision should made by scheduler */
+
+ cpumask_clear(&litl_mask);
+ for (i = 0; i < litl_core_count; i++)
+ cpumask_set_cpu(online_litl_cpu[i], &litl_mask);
+
+ set_cpus_allowed_ptr(pSchedContext->ol_rx_thread, &litl_mask);
+ pSchedContext->rx_thread_cpu = 0;
+#else
+
+ /* Attach RX thread to last little core CPU */
+ if (pSchedContext->rx_thread_cpu !=
+ online_perf_cpu[litl_core_count - 1]) {
+ if (cds_set_cpus_allowed_ptr(
+ pSchedContext->ol_rx_thread,
+ online_perf_cpu[litl_core_count - 1])) {
+ QDF_TRACE(QDF_MODULE_ID_QDF,
+ QDF_TRACE_LEVEL_ERROR,
+ "%s: rx thread litl core set fail",
+ __func__);
+ goto err;
+ }
+ pSchedContext->rx_thread_cpu =
+ online_perf_cpu[litl_core_count - 1];
+ }
+#endif /* WLAN_OPEN_SOURCE */
+ }
+
+ QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_INFO_LOW,
+ "%s: NUM PERF CORE %d, HIGH TPUTR REQ %d, RX THRE CPU %lu",
+ __func__, perf_core_count,
+ (int)pSchedContext->high_throughput_required,
+ pSchedContext->rx_thread_cpu);
+
+success:
+ qdf_mem_free(online_perf_cpu);
+ qdf_mem_free(online_litl_cpu);
+ return 0;
+
+err:
+ qdf_mem_free(online_perf_cpu);
+ qdf_mem_free(online_litl_cpu);
+ return 1;
+}
+
+/**
+ * cds_sched_handle_cpu_hot_plug - cpu hotplug event handler
+ *
+ * cpu hotplug indication handler
+ * will find online cores and will assign proper core based on perf requirement
+ *
+ * Return: 0 success
+ * 1 fail
+ */
+int cds_sched_handle_cpu_hot_plug(void)
+{
+ p_cds_sched_context pSchedContext = get_cds_sched_ctxt();
+
+ if (!pSchedContext) {
+ QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
+ "%s: invalid context", __func__);
+ return 1;
+ }
+
+ if (cds_is_load_or_unload_in_progress())
+ return 0;
+
+ spin_lock_bh(&pSchedContext->affinity_lock);
+ if (cds_sched_find_attach_cpu(pSchedContext,
+ pSchedContext->high_throughput_required)) {
+ QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
+ "%s: handle hot plug fail", __func__);
+ spin_unlock_bh(&pSchedContext->affinity_lock);
+ return 1;
+ }
+ spin_unlock_bh(&pSchedContext->affinity_lock);
+ return 0;
+}
+
+/**
+ * cds_sched_handle_throughput_req - cpu throughput requirement handler
+ * @high_tput_required: high throughput is required or not
+ *
+ * high or low throughput indication ahndler
+ * will find online cores and will assign proper core based on perf requirement
+ *
+ * Return: 0 success
+ * 1 fail
+ */
+int cds_sched_handle_throughput_req(bool high_tput_required)
+{
+ p_cds_sched_context pSchedContext = get_cds_sched_ctxt();
+
+ if (!pSchedContext) {
+ QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
+ "%s: invalid context", __func__);
+ return 1;
+ }
+
+ if (cds_is_load_or_unload_in_progress()) {
+ QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
+ "%s: load or unload in progress", __func__);
+ return 0;
+ }
+
+ spin_lock_bh(&pSchedContext->affinity_lock);
+ pSchedContext->high_throughput_required = high_tput_required;
+ if (cds_sched_find_attach_cpu(pSchedContext, high_tput_required)) {
+ QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
+ "%s: handle throughput req fail", __func__);
+ spin_unlock_bh(&pSchedContext->affinity_lock);
+ return 1;
+ }
+ spin_unlock_bh(&pSchedContext->affinity_lock);
+ return 0;
+}
+
/**
* cds_cpu_hotplug_notify() - hot plug notify
* @block: Pointer to block
@@ -98,7 +329,7 @@ static int cds_set_cpus_allowed_ptr(struct task_struct *task, unsigned long cpu)
* Return: NOTIFY_OK
*/
static int
-cds_cpu_hotplug_notify(struct notifier_block *block,
+__cds_cpu_hotplug_notify(struct notifier_block *block,
unsigned long state, void *hcpu)
{
unsigned long cpu = (unsigned long)hcpu;
@@ -107,6 +338,11 @@ cds_cpu_hotplug_notify(struct notifier_block *block,
int i;
unsigned int multi_cluster;
unsigned int num_cpus;
+#if defined(WLAN_OPEN_SOURCE) && \
+ (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0))
+ int cpus;
+#endif
+
if ((NULL == pSchedContext) || (NULL == pSchedContext->ol_rx_thread))
return NOTIFY_OK;
@@ -118,19 +354,32 @@ cds_cpu_hotplug_notify(struct notifier_block *block,
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_INFO_LOW,
"%s: RX CORE %d, STATE %d, NUM CPUS %d",
__func__, (int)affine_cpu, (int)state, num_cpus);
- multi_cluster = (num_cpus > CDS_CORE_PER_CLUSTER) ? 1 : 0;
+ multi_cluster = 0;
+
+#if defined(WLAN_OPEN_SOURCE) && \
+ (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0))
+
+ for_each_online_cpu(cpus) {
+ multi_cluster = topology_physical_package_id(cpus);
+ }
+#endif
+
+ if ((multi_cluster) &&
+ ((CPU_ONLINE == state) || (CPU_DEAD == state))) {
+ cds_sched_handle_cpu_hot_plug();
+ return NOTIFY_OK;
+ }
switch (state) {
case CPU_ONLINE:
- if ((!multi_cluster) && (affine_cpu != 0))
+ if (affine_cpu != 0)
return NOTIFY_OK;
for_each_online_cpu(i) {
if (i == 0)
continue;
pref_cpu = i;
- if (!multi_cluster)
- break;
+ break;
}
break;
case CPU_DEAD:
@@ -142,8 +391,7 @@ cds_cpu_hotplug_notify(struct notifier_block *block,
if (i == 0)
continue;
pref_cpu = i;
- if (!multi_cluster)
- break;
+ break;
}
}
@@ -156,6 +404,32 @@ cds_cpu_hotplug_notify(struct notifier_block *block,
return NOTIFY_OK;
}
+/**
+ * vos_cpu_hotplug_notify - cpu core on-off notification handler wrapper
+ * @block: notifier block
+ * @state: state of core
+ * @hcpu: target cpu core
+ *
+ * pre-registered core status change notify callback function
+ * will handle only ONLINE, OFFLINE notification
+ * based on cpu architecture, rx thread affinity will be different
+ * wrapper function
+ *
+ * Return: 0 success
+ * 1 fail
+ */
+static int cds_cpu_hotplug_notify(struct notifier_block *block,
+ unsigned long state, void *hcpu)
+{
+ int ret;
+
+ cds_ssr_protect(__func__);
+ ret = __cds_cpu_hotplug_notify(block, state, hcpu);
+ cds_ssr_unprotect(__func__);
+
+ return ret;
+}
+
static struct notifier_block cds_cpu_hotplug_notifier = {
.notifier_call = cds_cpu_hotplug_notify,
};
@@ -236,6 +510,8 @@ QDF_STATUS cds_sched_open(void *p_cds_context,
}
register_hotcpu_notifier(&cds_cpu_hotplug_notifier);
pSchedContext->cpu_hot_plug_notifier = &cds_cpu_hotplug_notifier;
+ spin_lock_init(&pSchedContext->affinity_lock);
+ pSchedContext->high_throughput_required = false;
#endif
gp_cds_sched_context = pSchedContext;
@@ -772,24 +1048,24 @@ static int cds_ol_rx_thread(void *arg)
unsigned long pref_cpu = 0;
bool shutdown = false;
int status, i;
- unsigned int num_cpus;
set_user_nice(current, -1);
#ifdef MSM_PLATFORM
set_wake_up_idle(true);
#endif
- num_cpus = num_possible_cpus();
/* Find the available cpu core other than cpu 0 and
* bind the thread
*/
+ /* Find the available cpu core other than cpu 0 and
+ * bind the thread */
for_each_online_cpu(i) {
if (i == 0)
continue;
pref_cpu = i;
- if (num_cpus <= CDS_CORE_PER_CLUSTER)
break;
}
+
if (pref_cpu != 0 && (!cds_set_cpus_allowed_ptr(current, pref_cpu)))
affine_cpu = pref_cpu;
diff --git a/core/dp/htt/htt.c b/core/dp/htt/htt.c
index 0bb7b6122b5c..56f4df39aeb8 100644
--- a/core/dp/htt/htt.c
+++ b/core/dp/htt/htt.c
@@ -703,8 +703,7 @@ int htt_ipa_uc_attach(struct htt_pdev_t *pdev)
/* RX resource attach */
error = htt_rx_ipa_uc_attach(
- pdev,
- ol_cfg_ipa_uc_rx_ind_ring_size(pdev->ctrl_pdev));
+ pdev, qdf_get_pwr2(pdev->rx_ring.fill_level));
if (error) {
qdf_print("HTT IPA UC RX attach fail code %d\n", error);
htt_tx_ipa_uc_detach(pdev);
diff --git a/core/dp/htt/htt_fw_stats.c b/core/dp/htt/htt_fw_stats.c
index ea54e1efd003..be43ea689bb4 100644
--- a/core/dp/htt/htt_fw_stats.c
+++ b/core/dp/htt/htt_fw_stats.c
@@ -855,11 +855,11 @@ htt_t2h_tx_ppdu_log_print(struct ol_fw_tx_dbg_ppdu_msg_hdr *hdr,
/* fields used for both concise and complete printouts */
start_seq_num =
- ((*(msg_word + OL_FW_TX_DBG_PPDU_START_SEQ_NUM_16)) &
+ ((*(msg_word + OL_FW_TX_DBG_PPDU_START_SEQ_NUM_WORD)) &
OL_FW_TX_DBG_PPDU_START_SEQ_NUM_M) >>
OL_FW_TX_DBG_PPDU_START_SEQ_NUM_S;
complete =
- ((*(msg_word + OL_FW_TX_DBG_PPDU_COMPLETE_16)) &
+ ((*(msg_word + OL_FW_TX_DBG_PPDU_COMPLETE_WORD)) &
OL_FW_TX_DBG_PPDU_COMPLETE_M) >>
OL_FW_TX_DBG_PPDU_COMPLETE_S;
@@ -878,31 +878,31 @@ htt_t2h_tx_ppdu_log_print(struct ol_fw_tx_dbg_ppdu_msg_hdr *hdr,
start_pn_lsbs =
((*
(msg_word +
- OL_FW_TX_DBG_PPDU_START_PN_LSBS_16)) &
+ OL_FW_TX_DBG_PPDU_START_PN_LSBS_WORD)) &
OL_FW_TX_DBG_PPDU_START_PN_LSBS_M) >>
OL_FW_TX_DBG_PPDU_START_PN_LSBS_S;
num_mpdus =
- ((*(msg_word + OL_FW_TX_DBG_PPDU_NUM_MPDUS_16))&
+ ((*(msg_word + OL_FW_TX_DBG_PPDU_NUM_MPDUS_WORD))&
OL_FW_TX_DBG_PPDU_NUM_MPDUS_M) >>
OL_FW_TX_DBG_PPDU_NUM_MPDUS_S;
peer_id =
- ((*(msg_word + OL_FW_TX_DBG_PPDU_PEER_ID_16)) &
+ ((*(msg_word + OL_FW_TX_DBG_PPDU_PEER_ID_WORD)) &
OL_FW_TX_DBG_PPDU_PEER_ID_M) >>
OL_FW_TX_DBG_PPDU_PEER_ID_S;
ext_tid =
- ((*(msg_word + OL_FW_TX_DBG_PPDU_EXT_TID_16)) &
+ ((*(msg_word + OL_FW_TX_DBG_PPDU_EXT_TID_WORD)) &
OL_FW_TX_DBG_PPDU_EXT_TID_M) >>
OL_FW_TX_DBG_PPDU_EXT_TID_S;
rate_code =
- ((*(msg_word + OL_FW_TX_DBG_PPDU_RATE_CODE_16))&
+ ((*(msg_word + OL_FW_TX_DBG_PPDU_RATE_CODE_WORD))&
OL_FW_TX_DBG_PPDU_RATE_CODE_M) >>
OL_FW_TX_DBG_PPDU_RATE_CODE_S;
rate_flags =
- ((*(msg_word + OL_FW_TX_DBG_PPDU_RATEFLAGS_16))&
+ ((*(msg_word + OL_FW_TX_DBG_PPDU_RATE_FLAGS_WORD))&
OL_FW_TX_DBG_PPDU_RATE_FLAGS_M) >>
OL_FW_TX_DBG_PPDU_RATE_FLAGS_S;
tries =
- ((*(msg_word + OL_FW_TX_DBG_PPDU_TRIES_16)) &
+ ((*(msg_word + OL_FW_TX_DBG_PPDU_TRIES_WORD)) &
OL_FW_TX_DBG_PPDU_TRIES_M) >>
OL_FW_TX_DBG_PPDU_TRIES_S;
@@ -929,9 +929,9 @@ htt_t2h_tx_ppdu_log_print(struct ol_fw_tx_dbg_ppdu_msg_hdr *hdr,
qdf_print
(" enqueued and acked MPDU bitmaps:");
htt_t2h_tx_ppdu_bitmaps_pr(msg_word +
- OL_FW_TX_DBG_PPDU_ENQUEUED_LSBS_16,
+ OL_FW_TX_DBG_PPDU_ENQUEUED_LSBS_WORD,
msg_word +
- OL_FW_TX_DBG_PPDU_BLOCK_ACK_LSBS_16);
+ OL_FW_TX_DBG_PPDU_BLOCK_ACK_LSBS_WORD);
} else {
qdf_print
(" enqueued: %d us, not yet completed",
@@ -968,9 +968,9 @@ htt_t2h_tx_ppdu_log_print(struct ol_fw_tx_dbg_ppdu_msg_hdr *hdr,
qdf_print("enqueued and acked MPDU bitmaps:");
if (complete) {
htt_t2h_tx_ppdu_bitmaps_pr(msg_word +
- OL_FW_TX_DBG_PPDU_ENQUEUED_LSBS_16,
+ OL_FW_TX_DBG_PPDU_ENQUEUED_LSBS_WORD,
msg_word +
- OL_FW_TX_DBG_PPDU_BLOCK_ACK_LSBS_16);
+ OL_FW_TX_DBG_PPDU_BLOCK_ACK_LSBS_WORD);
} else {
qdf_print("(not completed)");
}
diff --git a/core/dp/htt/htt_h2t.c b/core/dp/htt/htt_h2t.c
index f52c06403fdc..b9bff6cf8cff 100644
--- a/core/dp/htt/htt_h2t.c
+++ b/core/dp/htt/htt_h2t.c
@@ -61,6 +61,17 @@
((type *)((char *)(ptr) - (char *)(&((type *)0)->member)))
#endif
+#ifdef ATH_11AC_TXCOMPACT
+#define HTT_SEND_HTC_PKT(pdev, pkt) \
+do { \
+ if (htc_send_pkt(pdev->htc_pdev, &pkt->htc_pkt) == A_OK) \
+ htt_htc_misc_pkt_list_add(pdev, pkt); \
+} while (0)
+#else
+#define HTT_SEND_HTC_PKT(pdev, ppkt) htc_send_pkt(pdev->htc_pdev, &pkt->htc_pkt);
+#endif
+
+
static void
htt_h2t_send_complete_free_netbuf(void *pdev, A_STATUS status,
qdf_nbuf_t netbuf, uint16_t msdu_id)
@@ -272,13 +283,7 @@ A_STATUS htt_h2t_ver_req_msg(struct htt_pdev_t *pdev)
1); /* tag - not relevant here */
SET_HTC_PACKET_NET_BUF_CONTEXT(&pkt->htc_pkt, msg);
-
-#ifdef ATH_11AC_TXCOMPACT
- if (htc_send_pkt(pdev->htc_pdev, &pkt->htc_pkt) == A_OK)
- htt_htc_misc_pkt_list_add(pdev, pkt);
-#else
- htc_send_pkt(pdev->htc_pdev, &pkt->htc_pkt);
-#endif
+ HTT_SEND_HTC_PKT(pdev, pkt);
if ((pdev->cfg.is_high_latency) &&
(!pdev->cfg.default_tx_comp_req))
@@ -473,13 +478,7 @@ QDF_STATUS htt_h2t_rx_ring_cfg_msg_ll(struct htt_pdev_t *pdev)
HTC_TX_PACKET_TAG_RUNTIME_PUT);
SET_HTC_PACKET_NET_BUF_CONTEXT(&pkt->htc_pkt, msg);
-
-#ifdef ATH_11AC_TXCOMPACT
- if (htc_send_pkt(pdev->htc_pdev, &pkt->htc_pkt) == A_OK)
- htt_htc_misc_pkt_list_add(pdev, pkt);
-#else
- htc_send_pkt(pdev->htc_pdev, &pkt->htc_pkt);
-#endif
+ HTT_SEND_HTC_PKT(pdev, pkt);
return A_OK;
}
@@ -765,13 +764,7 @@ A_STATUS htt_h2t_sync_msg(struct htt_pdev_t *pdev, uint8_t sync_cnt)
HTC_TX_PACKET_TAG_RUNTIME_PUT);
SET_HTC_PACKET_NET_BUF_CONTEXT(&pkt->htc_pkt, msg);
-
-#ifdef ATH_11AC_TXCOMPACT
- if (htc_send_pkt(pdev->htc_pdev, &pkt->htc_pkt) == A_OK)
- htt_htc_misc_pkt_list_add(pdev, pkt);
-#else
- htc_send_pkt(pdev->htc_pdev, &pkt->htc_pkt);
-#endif
+ HTT_SEND_HTC_PKT(pdev, pkt);
if ((pdev->cfg.is_high_latency) &&
(!pdev->cfg.default_tx_comp_req))
@@ -938,7 +931,7 @@ int htt_h2t_ipa_uc_rsc_cfg_msg(struct htt_pdev_t *pdev)
msg_word++;
*msg_word = 0;
HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(*msg_word,
- (unsigned int)ol_cfg_ipa_uc_rx_ind_ring_size(pdev->ctrl_pdev));
+ (unsigned int)qdf_get_pwr2(pdev->rx_ring.fill_level));
msg_word++;
*msg_word = 0;
@@ -970,7 +963,7 @@ int htt_h2t_ipa_uc_rsc_cfg_msg(struct htt_pdev_t *pdev)
msg_word++;
*msg_word = 0;
HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(*msg_word,
- (unsigned int)ol_cfg_ipa_uc_rx_ind_ring_size(pdev->ctrl_pdev));
+ (unsigned int)qdf_get_pwr2(pdev->rx_ring.fill_level));
msg_word++;
*msg_word = 0;
@@ -998,9 +991,7 @@ int htt_h2t_ipa_uc_rsc_cfg_msg(struct htt_pdev_t *pdev)
HTC_TX_PACKET_TAG_RUNTIME_PUT);
SET_HTC_PACKET_NET_BUF_CONTEXT(&pkt->htc_pkt, msg);
-
- htc_send_pkt(pdev->htc_pdev, &pkt->htc_pkt);
-
+ HTT_SEND_HTC_PKT(pdev, pkt);
return A_OK;
}
#else
@@ -1072,7 +1063,7 @@ int htt_h2t_ipa_uc_rsc_cfg_msg(struct htt_pdev_t *pdev)
msg_word++;
*msg_word = 0;
HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(*msg_word,
- (unsigned int)ol_cfg_ipa_uc_rx_ind_ring_size(pdev->ctrl_pdev));
+ (unsigned int)qdf_get_pwr2(pdev->rx_ring.fill_level));
msg_word++;
*msg_word = 0;
@@ -1092,9 +1083,7 @@ int htt_h2t_ipa_uc_rsc_cfg_msg(struct htt_pdev_t *pdev)
HTC_TX_PACKET_TAG_RUNTIME_PUT);
SET_HTC_PACKET_NET_BUF_CONTEXT(&pkt->htc_pkt, msg);
-
- htc_send_pkt(pdev->htc_pdev, &pkt->htc_pkt);
-
+ HTT_SEND_HTC_PKT(pdev, pkt);
return A_OK;
}
#endif
@@ -1165,9 +1154,7 @@ int htt_h2t_ipa_uc_set_active(struct htt_pdev_t *pdev,
1); /* tag - not relevant here */
SET_HTC_PACKET_NET_BUF_CONTEXT(&pkt->htc_pkt, msg);
-
- htc_send_pkt(pdev->htc_pdev, &pkt->htc_pkt);
-
+ HTT_SEND_HTC_PKT(pdev, pkt);
return A_OK;
}
@@ -1225,9 +1212,7 @@ int htt_h2t_ipa_uc_get_stats(struct htt_pdev_t *pdev)
1); /* tag - not relevant here */
SET_HTC_PACKET_NET_BUF_CONTEXT(&pkt->htc_pkt, msg);
-
- htc_send_pkt(pdev->htc_pdev, &pkt->htc_pkt);
-
+ HTT_SEND_HTC_PKT(pdev, pkt);
return A_OK;
}
#endif /* IPA_OFFLOAD */
diff --git a/core/dp/htt/htt_rx.c b/core/dp/htt/htt_rx.c
index 641e2c09a65c..dceafca40e33 100644
--- a/core/dp/htt/htt_rx.c
+++ b/core/dp/htt/htt_rx.c
@@ -2029,7 +2029,7 @@ htt_rx_amsdu_rx_in_order_pop_ll(htt_pdev_handle pdev,
msdu_count--;
if (qdf_unlikely((*((u_int8_t *) &rx_desc->fw_desc.u.val)) &
- FW_RX_DESC_MIC_ERR_M)) {
+ FW_RX_DESC_ANY_ERR_M)) {
uint8_t tid =
HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(
*(u_int32_t *)rx_ind_data);
@@ -3420,10 +3420,10 @@ void htt_rx_ipa_uc_free_wdi2_rsc(struct htt_pdev_t *pdev)
pdev->osdev, pdev->osdev->dev,
4,
pdev->ipa_uc_rx_rsc.
- rx_ipa_prc_done_idx.vaddr,
+ rx2_ipa_prc_done_idx.vaddr,
pdev->ipa_uc_rx_rsc.rx2_ipa_prc_done_idx.paddr,
qdf_get_dma_mem_context((&pdev->ipa_uc_rx_rsc.
- rx_ipa_prc_done_idx),
+ rx2_ipa_prc_done_idx),
memctx));
}
}
diff --git a/core/dp/htt/htt_tx.c b/core/dp/htt/htt_tx.c
index 2131d7bda430..95a42dc16ec5 100644
--- a/core/dp/htt/htt_tx.c
+++ b/core/dp/htt/htt_tx.c
@@ -66,6 +66,17 @@
*/
#define HTT_IPA_UC_OFFLOAD_TX_HEADER_DEFAULT 0x07C04001
+#ifdef QCA_WIFI_3_0
+#define IPA_UC_TX_BUF_FRAG_DESC_OFFSET 20
+#define IPA_UC_TX_BUF_FRAG_HDR_OFFSET 64
+#define IPA_UC_TX_BUF_TSO_HDR_SIZE 6
+#define IPA_UC_TX_BUF_PADDR_HI_MASK 0x0000001F
+#define IPA_UC_TX_BUF_PADDR_HI_OFFSET 32
+#else
+#define IPA_UC_TX_BUF_FRAG_DESC_OFFSET 16
+#define IPA_UC_TX_BUF_FRAG_HDR_OFFSET 32
+#endif /* QCA_WIFI_3_0 */
+
#if HTT_PADDR64
#define HTT_TX_DESC_FRAG_FIELD_HI_UPDATE(frag_filed_ptr) \
do { \
@@ -1057,29 +1068,25 @@ int htt_tx_ipa_uc_wdi_tx_buf_alloc(struct htt_pdev_t *pdev,
unsigned int uc_tx_partition_base)
{
unsigned int tx_buffer_count;
- qdf_nbuf_t buffer_vaddr;
+ void *buffer_vaddr;
qdf_dma_addr_t buffer_paddr;
uint32_t *header_ptr;
- uint32_t *ring_vaddr;
-#define IPA_UC_TX_BUF_FRAG_DESC_OFFSET 20
-#define IPA_UC_TX_BUF_FRAG_HDR_OFFSET 64
-#define IPA_UC_TX_BUF_TSO_HDR_SIZE 6
+ qdf_dma_addr_t *ring_vaddr;
- ring_vaddr = pdev->ipa_uc_tx_rsc.tx_comp_base.vaddr;
+ ring_vaddr = (qdf_dma_addr_t *)pdev->ipa_uc_tx_rsc.tx_comp_base.vaddr;
/* Allocate TX buffers as many as possible */
for (tx_buffer_count = 0;
tx_buffer_count < (uc_tx_buf_cnt - 1); tx_buffer_count++) {
- buffer_vaddr = qdf_nbuf_alloc(pdev->osdev,
- uc_tx_buf_sz, 0, 4, false);
+
+ buffer_vaddr = qdf_mem_alloc_consistent(pdev->osdev,
+ pdev->osdev->dev, uc_tx_buf_sz, &buffer_paddr);
if (!buffer_vaddr) {
- qdf_print("%s: TX BUF alloc fail, loop index: %d",
- __func__, tx_buffer_count);
+ qdf_print("IPA WDI TX buffer alloc fail %d allocated\n",
+ tx_buffer_count);
return tx_buffer_count;
}
- /* Init buffer */
- qdf_mem_zero(qdf_nbuf_data(buffer_vaddr), uc_tx_buf_sz);
- header_ptr = (uint32_t *) qdf_nbuf_data(buffer_vaddr);
+ header_ptr = buffer_vaddr;
/* HTT control header */
*header_ptr = HTT_IPA_UC_OFFLOAD_TX_HEADER_DEFAULT;
@@ -1089,8 +1096,6 @@ int htt_tx_ipa_uc_wdi_tx_buf_alloc(struct htt_pdev_t *pdev,
*header_ptr |= ((uint16_t) uc_tx_partition_base +
tx_buffer_count) << 16;
- qdf_nbuf_map(pdev->osdev, buffer_vaddr, QDF_DMA_BIDIRECTIONAL);
- buffer_paddr = qdf_nbuf_get_frag_paddr(buffer_vaddr, 0);
header_ptr++;
/* Frag Desc Pointer */
@@ -1100,7 +1105,8 @@ int htt_tx_ipa_uc_wdi_tx_buf_alloc(struct htt_pdev_t *pdev,
header_ptr++;
/* 64bits descriptor, high 32bits */
- *header_ptr = 0;
+ *header_ptr = (buffer_paddr >> IPA_UC_TX_BUF_PADDR_HI_OFFSET) &
+ IPA_UC_TX_BUF_PADDR_HI_MASK;
header_ptr++;
/* chanreq, peerid */
@@ -1115,9 +1121,11 @@ int htt_tx_ipa_uc_wdi_tx_buf_alloc(struct htt_pdev_t *pdev,
*ring_vaddr = buffer_paddr;
pdev->ipa_uc_tx_rsc.tx_buf_pool_vaddr_strg[tx_buffer_count] =
buffer_vaddr;
+ pdev->ipa_uc_tx_rsc.paddr_strg[tx_buffer_count] =
+ buffer_paddr;
/* Memory barrier to ensure actual value updated */
- ring_vaddr += 2;
+ ring_vaddr++;
}
return tx_buffer_count;
}
@@ -1132,8 +1140,6 @@ int htt_tx_ipa_uc_wdi_tx_buf_alloc(struct htt_pdev_t *pdev,
qdf_dma_addr_t buffer_paddr;
uint32_t *header_ptr;
uint32_t *ring_vaddr;
-#define IPA_UC_TX_BUF_FRAG_DESC_OFFSET 16
-#define IPA_UC_TX_BUF_FRAG_HDR_OFFSET 32
ring_vaddr = pdev->ipa_uc_tx_rsc.tx_comp_base.vaddr;
/* Allocate TX buffers as many as possible */
@@ -1211,7 +1217,7 @@ int htt_tx_ipa_uc_attach(struct htt_pdev_t *pdev,
}
/* Allocate TX COMP Ring */
- tx_comp_ring_size = uc_tx_buf_cnt * sizeof(qdf_nbuf_t);
+ tx_comp_ring_size = uc_tx_buf_cnt * sizeof(qdf_dma_addr_t);
pdev->ipa_uc_tx_rsc.tx_comp_base.vaddr =
qdf_mem_alloc_consistent(
pdev->osdev, pdev->osdev->dev,
@@ -1227,15 +1233,28 @@ int htt_tx_ipa_uc_attach(struct htt_pdev_t *pdev,
/* Allocate TX BUF vAddress Storage */
pdev->ipa_uc_tx_rsc.tx_buf_pool_vaddr_strg =
- (qdf_nbuf_t *) qdf_mem_malloc(uc_tx_buf_cnt *
- sizeof(qdf_nbuf_t));
+ qdf_mem_malloc(uc_tx_buf_cnt *
+ sizeof(*pdev->ipa_uc_tx_rsc.tx_buf_pool_vaddr_strg));
if (!pdev->ipa_uc_tx_rsc.tx_buf_pool_vaddr_strg) {
qdf_print("%s: TX BUF POOL vaddr storage alloc fail", __func__);
return_code = -ENOBUFS;
goto free_tx_comp_base;
}
qdf_mem_zero(pdev->ipa_uc_tx_rsc.tx_buf_pool_vaddr_strg,
- uc_tx_buf_cnt * sizeof(qdf_nbuf_t));
+ uc_tx_buf_cnt *
+ sizeof(*pdev->ipa_uc_tx_rsc.tx_buf_pool_vaddr_strg));
+
+ pdev->ipa_uc_tx_rsc.paddr_strg =
+ qdf_mem_malloc(uc_tx_buf_cnt *
+ sizeof(pdev->ipa_uc_tx_rsc.paddr_strg));
+ if (!pdev->ipa_uc_tx_rsc.paddr_strg) {
+ qdf_print("%s: TX BUF POOL paddr storage alloc fail", __func__);
+ return_code = -ENOBUFS;
+ goto free_tx_comp_base;
+ }
+ qdf_mem_zero(pdev->ipa_uc_tx_rsc.paddr_strg,
+ uc_tx_buf_cnt *
+ sizeof(*pdev->ipa_uc_tx_rsc.paddr_strg));
pdev->ipa_uc_tx_rsc.alloc_tx_buf_cnt = htt_tx_ipa_uc_wdi_tx_buf_alloc(
pdev, uc_tx_buf_sz, uc_tx_buf_cnt, uc_tx_partition_base);
@@ -1264,6 +1283,15 @@ free_tx_ce_idx:
return return_code;
}
+/**
+ * htt_tx_ipa_uc_detach() - Free WDI TX resources
+ * @pdev: htt context
+ *
+ * Remove IPA WDI TX resources during device detach
+ * Free all of allocated resources
+ *
+ * Return: 0 success
+ */
int htt_tx_ipa_uc_detach(struct htt_pdev_t *pdev)
{
uint16_t idx;
@@ -1294,17 +1322,17 @@ int htt_tx_ipa_uc_detach(struct htt_pdev_t *pdev)
/* Free each single buffer */
for (idx = 0; idx < pdev->ipa_uc_tx_rsc.alloc_tx_buf_cnt; idx++) {
if (pdev->ipa_uc_tx_rsc.tx_buf_pool_vaddr_strg[idx]) {
- qdf_nbuf_unmap(pdev->osdev,
- pdev->ipa_uc_tx_rsc.
- tx_buf_pool_vaddr_strg[idx],
- QDF_DMA_FROM_DEVICE);
- qdf_nbuf_free(pdev->ipa_uc_tx_rsc.
- tx_buf_pool_vaddr_strg[idx]);
+ qdf_mem_free_consistent(
+ pdev->osdev, pdev->osdev->dev,
+ ol_cfg_ipa_uc_tx_buf_size(pdev->ctrl_pdev),
+ pdev->ipa_uc_tx_rsc.tx_buf_pool_vaddr_strg[idx],
+ pdev->ipa_uc_tx_rsc.paddr_strg[idx], 0);
}
}
/* Free storage */
qdf_mem_free(pdev->ipa_uc_tx_rsc.tx_buf_pool_vaddr_strg);
+ qdf_mem_free(pdev->ipa_uc_tx_rsc.paddr_strg);
return 0;
}
@@ -1451,6 +1479,12 @@ void htt_fill_wisa_ext_header(qdf_nbuf_t msdu,
void *qdf_ctx = cds_get_context(QDF_MODULE_ID_QDF_DEVICE);
QDF_STATUS status;
+ if (!qdf_ctx) {
+ QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
+ "%s: qdf_ctx is NULL", __func__);
+ return;
+ }
+
local_desc_ext->valid_mcs_mask = 1;
if (WISA_MODE_EXT_HEADER_6MBPS == type)
local_desc_ext->mcs_mask = htt_ofdm_datarate_6_mbps;
@@ -1565,6 +1599,12 @@ htt_tx_desc_init(htt_pdev_handle pdev,
void *qdf_ctx = cds_get_context(QDF_MODULE_ID_QDF_DEVICE);
QDF_STATUS status;
+ if (!qdf_ctx) {
+ QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
+ "%s: qdf_ctx is NULL", __func__);
+ return;
+ }
+
word0 = (uint32_t *) htt_tx_desc;
word1 = word0 + 1;
/*
diff --git a/core/dp/htt/htt_types.h b/core/dp/htt/htt_types.h
index 6d2af7ad80af..38eaaecdb32a 100644
--- a/core/dp/htt/htt_types.h
+++ b/core/dp/htt/htt_types.h
@@ -130,7 +130,8 @@ struct htt_ipa_uc_tx_resource_t {
struct uc_shared_mem_t tx_comp_base;
uint32_t tx_comp_idx_paddr;
- qdf_nbuf_t *tx_buf_pool_vaddr_strg;
+ void **tx_buf_pool_vaddr_strg;
+ qdf_dma_addr_t *paddr_strg;
uint32_t alloc_tx_buf_cnt;
};
diff --git a/core/dp/ol/inc/ol_txrx_ctrl_api.h b/core/dp/ol/inc/ol_txrx_ctrl_api.h
index e0a3a1735b4c..602d31a7b82c 100644
--- a/core/dp/ol/inc/ol_txrx_ctrl_api.h
+++ b/core/dp/ol/inc/ol_txrx_ctrl_api.h
@@ -68,6 +68,7 @@
#define WLAN_HDD_NETIF_OPER_HISTORY 4
#define WLAN_DUMP_TX_FLOW_POOL_INFO 5
#define WLAN_TXRX_DESC_STATS 6
+#define WLAN_HIF_STATS 7
#define WLAN_SCHEDULER_STATS 21
#define WLAN_TX_QUEUE_STATS 22
#define WLAN_BUNDLE_STATS 23
diff --git a/core/dp/txrx/ol_txrx.c b/core/dp/txrx/ol_txrx.c
index fcd1831a99ec..b713a4b8af10 100644
--- a/core/dp/txrx/ol_txrx.c
+++ b/core/dp/txrx/ol_txrx.c
@@ -80,6 +80,7 @@
#endif
#include <cds_concurrency.h>
#include "epping_main.h"
+#include <a_types.h>
#ifdef CONFIG_HL_SUPPORT
@@ -1822,8 +1823,13 @@ void ol_txrx_vdev_register(ol_txrx_vdev_handle vdev,
void *osif_vdev,
struct ol_txrx_ops *txrx_ops)
{
- vdev->osif_dev = osif_vdev;
+ if (qdf_unlikely(!vdev) || qdf_unlikely(!txrx_ops)) {
+ qdf_print("%s: vdev/txrx_ops is NULL!\n", __func__);
+ qdf_assert(0);
+ return;
+ }
+ vdev->osif_dev = osif_vdev;
vdev->rx = txrx_ops->rx.rx;
txrx_ops->tx.tx = ol_tx_data;
}
@@ -2368,7 +2374,7 @@ ol_txrx_update_ibss_add_peer_num_of_vdev(ol_txrx_vdev_handle vdev,
int16_t new_peer_num;
new_peer_num = vdev->ibss_peer_num + peer_num_delta;
- if (new_peer_num > MAX_IBSS_PEERS || new_peer_num < 0)
+ if (new_peer_num > MAX_PEERS || new_peer_num < 0)
return OL_TXRX_INVALID_NUM_PEERS;
vdev->ibss_peer_num = new_peer_num;
diff --git a/core/dp/txrx/ol_txrx_flow_control.c b/core/dp/txrx/ol_txrx_flow_control.c
index fff6b114bfb1..ab4af41bcc09 100644
--- a/core/dp/txrx/ol_txrx_flow_control.c
+++ b/core/dp/txrx/ol_txrx_flow_control.c
@@ -336,17 +336,17 @@ struct ol_tx_flow_pool_t *ol_tx_create_flow_pool(uint8_t flow_pool_id,
uint16_t size = 0, i;
struct ol_tx_desc_t *tx_desc;
union ol_tx_desc_list_elem_t *temp_list = NULL;
- uint32_t stop_threshold =
- ol_cfg_get_tx_flow_stop_queue_th(pdev->ctrl_pdev);
- uint32_t start_threshold = stop_threshold +
- ol_cfg_get_tx_flow_start_queue_offset(pdev->ctrl_pdev);
+ uint32_t stop_threshold;
+ uint32_t start_threshold;
if (!pdev) {
TXRX_PRINT(TXRX_PRINT_LEVEL_ERR,
"%s: pdev is NULL\n", __func__);
return NULL;
}
-
+ stop_threshold = ol_cfg_get_tx_flow_stop_queue_th(pdev->ctrl_pdev);
+ start_threshold = stop_threshold +
+ ol_cfg_get_tx_flow_start_queue_offset(pdev->ctrl_pdev);
pool = qdf_mem_malloc(sizeof(*pool));
if (!pool) {
TXRX_PRINT(TXRX_PRINT_LEVEL_ERR,
diff --git a/core/hdd/inc/wlan_hdd_assoc.h b/core/hdd/inc/wlan_hdd_assoc.h
index 0081155c14c3..78f9005f1d93 100644
--- a/core/hdd/inc/wlan_hdd_assoc.h
+++ b/core/hdd/inc/wlan_hdd_assoc.h
@@ -55,10 +55,11 @@
/* Timeout in ms for peer info request commpletion */
#define IBSS_PEER_INFO_REQ_TIMOEUT 1000
-/* Type Declarations */
+#define INVALID_PEER_IDX -1
+
/**
- * typedef eConnectionState - Connection states
- * @eConnectionState_NotConnected: Not associated in Infra or participating
+ * enum eConnectionState - connection state values at HDD
+ * @eConnectionState_NotConnected: Not associated in Infra or participating in
* in an IBSS / Ad-hoc network
* @eConnectionState_Connecting: While connection in progress
* @eConnectionState_Associated: Associated in an Infrastructure network
@@ -66,7 +67,9 @@
* disconnected (no partner stations in the IBSS)
* @eConnectionState_IbssConnected: Participating in an IBSS network with
* partner stations also present
- * eConnectionState_Disconnecting: Disconnecting in an Infrastructure network
+ * @eConnectionState_Disconnecting: Disconnecting in an Infrastructure network.
+ * @eConnectionState_NdiDisconnected: NDI in disconnected state - no peers
+ * @eConnectionState_NdiConnected: NDI in connected state - at least one peer
*/
typedef enum {
eConnectionState_NotConnected,
@@ -74,7 +77,9 @@ typedef enum {
eConnectionState_Associated,
eConnectionState_IbssDisconnected,
eConnectionState_IbssConnected,
- eConnectionState_Disconnecting
+ eConnectionState_Disconnecting,
+ eConnectionState_NdiDisconnected,
+ eConnectionState_NdiConnected,
} eConnectionState;
/**
@@ -116,8 +121,8 @@ typedef struct connection_info_s {
eMib_dot11DesiredBssType connDot11DesiredBssType;
struct qdf_mac_addr bssId;
tCsrSSIDInfo SSID;
- uint8_t staId[MAX_IBSS_PEERS];
- struct qdf_mac_addr peerMacAddress[MAX_IBSS_PEERS];
+ uint8_t staId[MAX_PEERS];
+ struct qdf_mac_addr peerMacAddress[MAX_PEERS];
eCsrAuthType authType;
eCsrEncryptionType ucEncryptionType;
eCsrEncryptionType mcEncryptionType;
@@ -265,4 +270,16 @@ static inline bool hdd_is_roam_sync_in_progress(tCsrRoamInfo *roaminfo)
}
#endif
+QDF_STATUS hdd_roam_register_sta(struct hdd_adapter_s *adapter,
+ struct tagCsrRoamInfo *roam_info,
+ uint8_t sta_id,
+ struct qdf_mac_addr *peer_mac_addr,
+ struct sSirBssDescription *bss_desc);
+
+bool hdd_save_peer(hdd_station_ctx_t *sta_ctx, uint8_t sta_id,
+ struct qdf_mac_addr *peer_mac_addr);
+void hdd_delete_peer(hdd_station_ctx_t *sta_ctx, uint8_t sta_id);
+int hdd_get_peer_idx(hdd_station_ctx_t *sta_ctx, struct qdf_mac_addr *addr);
+QDF_STATUS hdd_roam_deregister_sta(hdd_adapter_t *adapter, uint8_t sta_id);
+
#endif
diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h
index d9924984d4cf..6df864c8b0f6 100644
--- a/core/hdd/inc/wlan_hdd_cfg.h
+++ b/core/hdd/inc/wlan_hdd_cfg.h
@@ -43,6 +43,7 @@
#include <qdf_types.h>
#include <csr_api.h>
#include <sap_api.h>
+#include "osapi_linux.h"
#include <wmi_unified.h>
#define FW_MODULE_LOG_LEVEL_STRING_LENGTH (255)
@@ -2775,11 +2776,6 @@ typedef enum {
#define CFG_CONC_SYSTEM_PREF_MAX (2)
#define CFG_CONC_SYSTEM_PREF_DEFAULT (0)
-#define CFG_POLICY_MNGR_ENABLE "gPolicyManagerEnable"
-#define CFG_POLICY_MNGR_ENABLE_MIN (0)
-#define CFG_POLICY_MNGR_ENABLE_MAX (1)
-#define CFG_POLICY_MNGR_ENABLE_DEFAULT (1)
-
#define CFG_TSO_ENABLED_NAME "TSOEnable"
#define CFG_TSO_ENABLED_MIN (0)
#define CFG_TSO_ENABLED_MAX (1)
@@ -3025,7 +3021,7 @@ enum dot11p_mode {
#define CFG_EARLY_STOP_SCAN_ENABLE "gEnableEarlyStopScan"
#define CFG_EARLY_STOP_SCAN_ENABLE_MIN (0)
#define CFG_EARLY_STOP_SCAN_ENABLE_MAX (1)
-#define CFG_EARLY_STOP_SCAN_ENABLE_DEFAULT (0)
+#define CFG_EARLY_STOP_SCAN_ENABLE_DEFAULT (1)
/*
* Early stop scan minimum threshold is the minimum threshold
* to be considered for stopping the scan. The algorithm starts
@@ -3037,7 +3033,7 @@ enum dot11p_mode {
#define CFG_EARLY_STOP_SCAN_MIN_THRESHOLD "gEarlyStopScanMinThreshold"
#define CFG_EARLY_STOP_SCAN_MIN_THRESHOLD_MIN (-80)
#define CFG_EARLY_STOP_SCAN_MIN_THRESHOLD_MAX (-70)
-#define CFG_EARLY_STOP_SCAN_MIN_THRESHOLD_DEFAULT (-78)
+#define CFG_EARLY_STOP_SCAN_MIN_THRESHOLD_DEFAULT (-73)
/*
* Early stop scan maximum threshold is the maximum threshold
* at which the candidate AP should be to be qualified as a
@@ -3046,7 +3042,7 @@ enum dot11p_mode {
#define CFG_EARLY_STOP_SCAN_MAX_THRESHOLD "gEarlyStopScanMaxThreshold"
#define CFG_EARLY_STOP_SCAN_MAX_THRESHOLD_MIN (-60)
#define CFG_EARLY_STOP_SCAN_MAX_THRESHOLD_MAX (-40)
-#define CFG_EARLY_STOP_SCAN_MAX_THRESHOLD_DEFAULT (-45)
+#define CFG_EARLY_STOP_SCAN_MAX_THRESHOLD_DEFAULT (-43)
/*
* This parameter will configure the first scan bucket
@@ -3113,20 +3109,6 @@ enum dot11p_mode {
#define CFG_OBSS_HT40_SCAN_WIDTH_TRIGGER_INTERVAL_MAX (900)
#define CFG_OBSS_HT40_SCAN_WIDTH_TRIGGER_INTERVAL_DEFAULT (200)
-#ifdef QCA_WIFI_3_0_EMU
-/*
- * On M2M emulation platform we have a fixed mapping between macs, hence
- * vdev transition & MCC support is not possible on this platform. But MPR
- * platform doesn't have these limitations. This config allows at runtime
- * enable/disable vdev transition & MCC support depending on the platform
- * it is running on
- */
-#define CFG_ENABLE_M2M_LIMITATION "gEnableM2MLimitation"
-#define CFG_ENABLE_M2M_LIMITATION_MIN (0)
-#define CFG_ENABLE_M2M_LIMITATION_MAX (1)
-#define CFG_ENABLE_M2M_LIMITATION_DEFAULT (0)
-#endif /* QCA_WIFI_3_0_EMU */
-
/*
* Dense traffic threshold
* traffic threshold required for dense roam scan
@@ -3157,6 +3139,26 @@ enum dot11p_mode {
#define CFG_IGNORE_PEER_HT_MODE_MAX (1)
#define CFG_IGNORE_PEER_HT_MODE_DEFAULT (0)
+#ifdef WLAN_FEATURE_NAN_DATAPATH
+/*
+ * Enable NaN data path feature. NaN data path enables
+ * NaN supported devices to exchange data over traditional
+ * TCP/UDP network stack.
+ */
+#define CFG_ENABLE_NAN_DATAPATH_NAME "genable_nan_datapath"
+#define CFG_ENABLE_NAN_DATAPATH_MIN (0)
+#define CFG_ENABLE_NAN_DATAPATH_MAX (1)
+#define CFG_ENABLE_NAN_DATAPATH_DEFAULT (0)
+
+/*
+ * NAN channel on which NAN data interface to start
+ */
+#define CFG_ENABLE_NAN_NDI_CHANNEL_NAME "gnan_datapath_ndi_channel"
+#define CFG_ENABLE_NAN_NDI_CHANNEL_MIN (6)
+#define CFG_ENABLE_NAN_NDI_CHANNEL_MAX (149)
+#define CFG_ENABLE_NAN_NDI_CHANNEL_DEFAULT (6)
+#endif
+
/*
* Dense Roam Min APs
* minimum number of AP required for dense roam
@@ -3968,7 +3970,6 @@ struct hdd_config {
uint8_t multicast_host_fw_msgs;
uint8_t conc_system_pref;
bool sendDeauthBeforeCon;
- bool policy_manager_enabled;
bool tso_enable;
bool lro_enable;
bool active_mode_offload;
@@ -4013,9 +4014,6 @@ struct hdd_config {
#ifdef WLAN_FEATURE_TSF
uint32_t tsf_gpio_pin;
#endif
-#ifdef QCA_WIFI_3_0_EMU
- bool enable_m2m_limitation;
-#endif
uint32_t roam_dense_traffic_thresh;
uint32_t roam_dense_rssi_thresh_offset;
bool ignore_peer_ht_opmode;
@@ -4045,6 +4043,10 @@ struct hdd_config {
uint8_t adapt_dwell_lpf_weight;
uint8_t adapt_dwell_passive_mon_intval;
uint8_t adapt_dwell_wifi_act_threshold;
+#ifdef WLAN_FEATURE_NAN_DATAPATH
+ bool enable_nan_datapath;
+ uint8_t nan_datapath_ndi_channel;
+#endif
};
#define VAR_OFFSET(_Struct, _Var) (offsetof(_Struct, _Var))
diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h
index c4df74ab4d6a..7730006e6441 100644
--- a/core/hdd/inc/wlan_hdd_main.h
+++ b/core/hdd/inc/wlan_hdd_main.h
@@ -68,6 +68,7 @@
#include <wlan_hdd_lro.h>
#include "cdp_txrx_flow_ctrl_legacy.h"
#include <cdp_txrx_peer_ops.h>
+#include "wlan_hdd_nan_datapath.h"
/*---------------------------------------------------------------------------
Preprocessor definitions and constants
@@ -669,6 +670,9 @@ struct hdd_station_ctx {
uint8_t broadcast_ibss_staid;
struct hdd_mon_set_ch_info ch_info;
+#ifdef WLAN_FEATURE_NAN_DATAPATH
+ struct nan_datapath_ctx ndp_ctx;
+#endif
};
#define BSS_STOP 0
@@ -1074,6 +1078,19 @@ struct hdd_adapter_s {
(tdlsCtx_t *)(pAdapter)->sessionCtx.station.pHddTdlsCtx : NULL)
#endif
+#ifdef WLAN_FEATURE_NAN_DATAPATH
+#define WLAN_HDD_GET_NDP_CTX_PTR(adapter) \
+ (&(adapter)->sessionCtx.station.ndp_ctx)
+#define WLAN_HDD_IS_NDP_ENABLED(hdd_ctx) ((hdd_ctx)->nan_datapath_enabled)
+#else
+/* WLAN_HDD_GET_NDP_CTX_PTR and WLAN_HDD_GET_NDP_WEXT_STATE_PTR are not defined
+ * intentionally so that all references to these must be within NDP code.
+ * non-NDP code can call WLAN_HDD_IS_NDP_ENABLED(), and when it is enabled,
+ * invoke NDP code to do all work.
+ */
+#define WLAN_HDD_IS_NDP_ENABLED(hdd_ctx) (false)
+#endif
+
/* Set mac address locally administered bit */
#define WLAN_HDD_RESET_LOCALLY_ADMINISTERED_BIT(macaddr) (macaddr[0] &= 0xFD)
@@ -1259,6 +1276,8 @@ struct hdd_context_s {
int32_t tdls_fw_off_chan_mode;
bool enable_tdls_connection_tracker;
uint8_t tdls_external_peer_count;
+ bool tdls_nss_switch_in_progress;
+ int32_t tdls_teardown_peers_cnt;
#endif
void *hdd_ipa;
@@ -1401,7 +1420,7 @@ struct hdd_context_s {
* radar found indication and application triggered channel
* switch.
*/
- struct mutex dfs_lock;
+ qdf_spinlock_t dfs_lock;
/*
* place to store FTM capab of target. This allows changing of FTM capab
* at runtime and intersecting it with target capab before updating.
@@ -1415,6 +1434,10 @@ struct hdd_context_s {
/* the radio index assigned by cnss_logger */
int radio_index;
+ bool hbw_requested;
+#ifdef WLAN_FEATURE_NAN_DATAPATH
+ bool nan_datapath_enabled;
+#endif
};
/*---------------------------------------------------------------------------
@@ -1527,32 +1550,6 @@ int hdd_wlan_set_ht2040_mode(hdd_adapter_t *pAdapter, uint16_t staId,
struct qdf_mac_addr macAddrSTA, int width);
#endif
-#ifdef WLAN_FEATURE_LPSS
-void wlan_hdd_send_status_pkg(hdd_adapter_t *pAdapter,
- hdd_station_ctx_t *pHddStaCtx,
- uint8_t is_on, uint8_t is_connected);
-void wlan_hdd_send_version_pkg(uint32_t fw_version,
- uint32_t chip_id, const char *chip_name);
-void wlan_hdd_send_all_scan_intf_info(hdd_context_t *pHddCtx);
-#else
-static inline void wlan_hdd_send_status_pkg(hdd_adapter_t *pAdapter,
- hdd_station_ctx_t *pHddStaCtx,
- uint8_t is_on, uint8_t is_connected)
-{
- return;
-}
-
-static inline void wlan_hdd_send_version_pkg(uint32_t fw_version, uint32_t
- chip_id, const char *chip_name)
-{
- return;
-}
-
-static inline void wlan_hdd_send_all_scan_intf_info(hdd_context_t *pHddCtx)
-{
- return;
-}
-#endif
void wlan_hdd_send_svc_nlink_msg(int type, void *data, int len);
#ifdef FEATURE_WLAN_AUTO_SHUTDOWN
void wlan_hdd_auto_shutdown_enable(hdd_context_t *hdd_ctx, bool enable);
@@ -1644,6 +1641,7 @@ void hdd_update_config(hdd_context_t *hdd_ctx);
QDF_STATUS hdd_chan_change_notify(hdd_adapter_t *adapter,
struct net_device *dev,
struct hdd_chan_change_params chan_change);
+
#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
QDF_STATUS hdd_register_for_sap_restart_with_channel_switch(void);
#else
@@ -1742,4 +1740,6 @@ static inline int wlan_hdd_nl_init(hdd_context_t *hdd_ctx)
return nl_srv_init(hdd_ctx->wiphy);
}
#endif
+QDF_STATUS hdd_sme_close_session_callback(void *pContext);
+
#endif /* end #if !defined(WLAN_HDD_MAIN_H) */
diff --git a/core/hdd/inc/wlan_hdd_p2p.h b/core/hdd/inc/wlan_hdd_p2p.h
index 9fcf9ecc2fed..68afc8ccd76d 100644
--- a/core/hdd/inc/wlan_hdd_p2p.h
+++ b/core/hdd/inc/wlan_hdd_p2p.h
@@ -149,6 +149,7 @@ struct wireless_dev *wlan_hdd_add_virtual_intf(struct wiphy *wiphy,
#endif
int wlan_hdd_del_virtual_intf(struct wiphy *wiphy, struct wireless_dev *wdev);
+int __wlan_hdd_del_virtual_intf(struct wiphy *wiphy, struct wireless_dev *wdev);
void wlan_hdd_cleanup_remain_on_channel_ctx(hdd_adapter_t *pAdapter);
diff --git a/core/hdd/inc/wlan_hdd_tdls.h b/core/hdd/inc/wlan_hdd_tdls.h
index 7b770ac9e37a..f17857d3e42d 100644
--- a/core/hdd/inc/wlan_hdd_tdls.h
+++ b/core/hdd/inc/wlan_hdd_tdls.h
@@ -135,6 +135,16 @@ typedef enum {
} eTDLSSupportMode;
/**
+ * enum tdls_spatial_streams - TDLS spatial streams
+ * @TDLS_NSS_1x1_MODE: TDLS tx/rx spatial streams = 1
+ * @TDLS_NSS_2x2_MODE: TDLS tx/rx spatial streams = 2
+ */
+enum tdls_spatial_streams {
+ TDLS_NSS_1x1_MODE = 0,
+ TDLS_NSS_2x2_MODE = 0xff,
+};
+
+/**
* enum tTDLSCapType - tdls capability type
*
* @eTDLS_CAP_NOT_SUPPORTED: tdls not supported
@@ -369,6 +379,7 @@ typedef struct {
* @op_class_for_pref_off_chan_is_set: op class for preferred off channel set
* @peer_idle_timer: time to check idle traffic in tdls peers
* @is_peer_idle_timer_initialised: Flag to check idle timer init
+ * @spatial_streams: Number of TX/RX spatial streams for TDLS
* @reason: reason
* @state_change_notification: state change notification
*/
@@ -400,6 +411,7 @@ typedef struct _hddTdlsPeer_t {
uint8_t op_class_for_pref_off_chan_is_set;
qdf_mc_timer_t peer_idle_timer;
bool is_peer_idle_timer_initialised;
+ uint8_t spatial_streams;
tTDLSLinkReason reason;
cfg80211_exttdls_callback state_change_notification;
} hddTdlsPeer_t;
@@ -669,6 +681,10 @@ void wlan_hdd_tdls_update_rx_pkt_cnt(hdd_adapter_t *adapter,
int hdd_set_tdls_scan_type(hdd_context_t *hdd_ctx, int val);
void hdd_tdls_context_init(hdd_context_t *hdd_ctx);
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);
+
#else
static inline void hdd_tdls_notify_mode_change(hdd_adapter_t *adapter,
hdd_context_t *hddctx)
@@ -691,6 +707,13 @@ static inline void wlan_hdd_tdls_update_rx_pkt_cnt(hdd_adapter_t *adapter,
}
static inline void hdd_tdls_context_init(hdd_context_t *hdd_ctx) { }
static inline void hdd_tdls_context_destroy(hdd_context_t *hdd_ctx) { }
+
+static inline int wlan_hdd_tdls_antenna_switch(hdd_context_t *hdd_ctx,
+ hdd_adapter_t *adapter,
+ uint32_t mode)
+{
+ return 0;
+}
#endif /* End of FEATURE_WLAN_TDLS */
#ifdef FEATURE_WLAN_DIAG_SUPPORT
diff --git a/core/hdd/inc/wlan_hdd_tx_rx.h b/core/hdd/inc/wlan_hdd_tx_rx.h
index d2fd6b5d9c95..5d193cee68af 100644
--- a/core/hdd/inc/wlan_hdd_tx_rx.h
+++ b/core/hdd/inc/wlan_hdd_tx_rx.h
@@ -66,9 +66,9 @@ QDF_STATUS hdd_rx_mul_packet_cbk(void *cds_context,
qdf_nbuf_t rx_buf_list, uint8_t staId);
#endif /* IPA_OFFLOAD */
-QDF_STATUS hdd_ibss_get_sta_id(hdd_station_ctx_t *pHddStaCtx,
- struct qdf_mac_addr *pMacAddress,
- uint8_t *staId);
+QDF_STATUS hdd_get_peer_sta_id(hdd_station_ctx_t *sta_ctx,
+ struct qdf_mac_addr *peer_mac_addr,
+ uint8_t *sta_id);
#ifdef QCA_LL_LEGACY_TX_FLOW_CONTROL
void hdd_tx_resume_cb(void *adapter_context, bool tx_resume);
@@ -106,6 +106,8 @@ static inline void hdd_get_tx_resource(hdd_adapter_t *adapter,
}
#endif /* QCA_LL_LEGACY_TX_FLOW_CONTROL */
+int hdd_get_peer_idx(hdd_station_ctx_t *sta_ctx, struct qdf_mac_addr *addr);
+
const char *hdd_reason_type_to_string(enum netif_reason_type reason);
const char *hdd_action_type_to_string(enum netif_action_type action);
void wlan_hdd_netif_queue_control(hdd_adapter_t *adapter,
diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c
index f0bd3a3f6c73..06cd0c488df3 100644
--- a/core/hdd/src/wlan_hdd_assoc.c
+++ b/core/hdd/src/wlan_hdd_assoc.c
@@ -50,6 +50,7 @@
#include "sme_api.h"
#include "wlan_hdd_hostapd.h"
#include <wlan_hdd_ipa.h>
+#include "wlan_hdd_lpass.h"
#include <cds_sched.h>
#include "cds_concurrency.h"
#include "sme_power_save_api.h"
@@ -990,8 +991,7 @@ static void hdd_conn_remove_connect_info(hdd_station_ctx_t *pHddStaCtx)
*
* Return: QDF_STATUS enumeration
*/
-static QDF_STATUS
-hdd_roam_deregister_sta(hdd_adapter_t *pAdapter, uint8_t staId)
+QDF_STATUS hdd_roam_deregister_sta(hdd_adapter_t *pAdapter, uint8_t staId)
{
QDF_STATUS qdf_status;
hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
@@ -1160,7 +1160,7 @@ static QDF_STATUS hdd_dis_connect_handler(hdd_adapter_t *pAdapter,
}
pHddCtx->sta_to_adapter[sta_id] = NULL;
/* Clear all the peer sta register with TL. */
- for (i = 0; i < MAX_IBSS_PEERS; i++) {
+ for (i = 0; i < MAX_PEERS; i++) {
if (0 == pHddStaCtx->conn_info.staId[i])
continue;
sta_id = pHddStaCtx->conn_info.staId[i];
@@ -1337,7 +1337,7 @@ QDF_STATUS hdd_change_peer_state(hdd_adapter_t *pAdapter,
*
* Return: QDF_STATUS enumeration
*/
-static QDF_STATUS hdd_roam_register_sta(hdd_adapter_t *pAdapter,
+QDF_STATUS hdd_roam_register_sta(hdd_adapter_t *pAdapter,
tCsrRoamInfo *pRoamInfo,
uint8_t staId,
struct qdf_mac_addr *pPeerMacAddress,
@@ -1667,7 +1667,7 @@ static QDF_STATUS hdd_roam_set_key_complete_handler(hdd_adapter_t *pAdapter,
pHddStaCtx->roam_info.roamingState =
HDD_ROAM_STATE_NONE;
} else {
- qdf_status = hdd_ibss_get_sta_id(
+ qdf_status = hdd_get_peer_sta_id(
pHddStaCtx,
&pRoamInfo->peerMac,
&staId);
@@ -2550,37 +2550,54 @@ static void hdd_roam_ibss_indication_handler(hdd_adapter_t *pAdapter,
}
/**
- * roam_save_ibss_station() - Save the IBSS peer MAC address in the adapter
- * @pHddStaCtx: pointer to global HDD station context
- * @staId: station id
- * @peerMacAddress: pointer to peer MAC address
+ * hdd_save_peer() - Save peer MAC address in adapter peer table.
+ * @sta_ctx: pointer to hdd station context
+ * @sta_id: station ID
+ * @peer_mac_addr: mac address of new peer
*
* This information is passed to iwconfig later. The peer that joined
* last is passed as information to iwconfig.
- *
- * Return:
- * true if we add MAX_IBSS_PEERS or less STA
- * false otherwise.
+
+ * Return: true if success, false otherwise
*/
-static bool roam_save_ibss_station(hdd_station_ctx_t *pHddStaCtx, uint8_t staId,
- struct qdf_mac_addr *peerMacAddress)
+bool hdd_save_peer(hdd_station_ctx_t *sta_ctx, uint8_t sta_id,
+ struct qdf_mac_addr *peer_mac_addr)
{
- bool fSuccess = false;
- int idx = 0;
-
- for (idx = 0; idx < MAX_IBSS_PEERS; idx++) {
- if (0 == pHddStaCtx->conn_info.staId[idx]) {
- pHddStaCtx->conn_info.staId[idx] = staId;
+ int idx;
+
+ for (idx = 0; idx < SIR_MAX_NUM_STA_IN_IBSS; idx++) {
+ if (0 == sta_ctx->conn_info.staId[idx]) {
+ hddLog(LOG1, FL("adding peer: %pM, sta_id: %d, at idx: %d"),
+ peer_mac_addr, sta_id, idx);
+ sta_ctx->conn_info.staId[idx] = sta_id;
+ qdf_copy_macaddr(
+ &sta_ctx->conn_info.peerMacAddress[idx],
+ peer_mac_addr);
+ return true;
+ }
+ }
+ return false;
+}
- qdf_copy_macaddr(&pHddStaCtx->conn_info.
- peerMacAddress[idx], peerMacAddress);
+/**
+ * hdd_delete_peer() - removes peer from hdd station context peer table
+ * @sta_ctx: pointer to hdd station context
+ * @sta_id: station ID
+ *
+ * Return: None
+ */
+void hdd_delete_peer(hdd_station_ctx_t *sta_ctx, uint8_t sta_id)
+{
+ int i;
- fSuccess = true;
- break;
+ for (i = 0; i < SIR_MAX_NUM_STA_IN_IBSS; i++) {
+ if (sta_id == sta_ctx->conn_info.staId[i]) {
+ sta_ctx->conn_info.staId[i] = 0;
+ return;
}
}
- return fSuccess;
+ hdd_err(FL("sta_id %d is not present in peer table"), sta_id);
}
/**
@@ -2589,7 +2606,7 @@ static bool roam_save_ibss_station(hdd_station_ctx_t *pHddStaCtx, uint8_t staId,
* @staId: station id
*
* Return:
- * true if we remove MAX_IBSS_PEERS or less STA
+ * true if we remove MAX_PEERS or less STA
* false otherwise.
*/
static bool roam_remove_ibss_station(hdd_adapter_t *pAdapter, uint8_t staId)
@@ -2601,7 +2618,7 @@ static bool roam_remove_ibss_station(hdd_adapter_t *pAdapter, uint8_t staId)
uint8_t empty_slots = 0;
hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
- for (idx = 0; idx < MAX_IBSS_PEERS; idx++) {
+ for (idx = 0; idx < MAX_PEERS; idx++) {
if (staId == pHddStaCtx->conn_info.staId[idx]) {
pHddStaCtx->conn_info.staId[idx] = 0;
@@ -2627,7 +2644,7 @@ static bool roam_remove_ibss_station(hdd_adapter_t *pAdapter, uint8_t staId)
}
}
- if (MAX_IBSS_PEERS == empty_slots) {
+ if (MAX_PEERS == empty_slots) {
/* Last peer departed, set the IBSS state appropriately */
pHddStaCtx->conn_info.connState =
eConnectionState_IbssDisconnected;
@@ -2789,7 +2806,7 @@ roam_roam_connect_status_update_handler(hdd_adapter_t *pAdapter,
MAC_ADDR_ARRAY(pHddStaCtx->conn_info.bssId.bytes),
pRoamInfo->staId);
- if (!roam_save_ibss_station
+ if (!hdd_save_peer
(WLAN_HDD_GET_STATION_CTX_PTR(pAdapter),
pRoamInfo->staId,
&pRoamInfo->peerMac)) {
@@ -3366,6 +3383,12 @@ hdd_roam_tdls_status_update_handler(hdd_adapter_t *pAdapter,
break;
}
+ if (pHddCtx->tdls_nss_switch_in_progress) {
+ hdd_err("TDLS antenna switch is in progress, ignore SHOULD_DISCOVER");
+ status = QDF_STATUS_SUCCESS;
+ break;
+ }
+
curr_peer =
wlan_hdd_tdls_get_peer(pAdapter,
pRoamInfo->peerMac.bytes,
@@ -4393,6 +4416,10 @@ hdd_sme_roam_callback(void *pContext, tCsrRoamInfo *pRoamInfo, uint32_t roamId,
if (QDF_IS_STATUS_ERROR(status))
hdd_info("set hw mode change not done");
break;
+ case eCSR_ROAM_NDP_STATUS_UPDATE:
+ hdd_ndp_event_handler(pAdapter, pRoamInfo, roamId, roamStatus,
+ roamResult);
+ break;
default:
break;
}
@@ -5444,7 +5471,6 @@ int iw_set_auth(struct net_device *dev, struct iw_request_info *info,
return ret;
}
-
/**
* __iw_get_auth() -
* This function returns the auth type to the wpa_supplicant
diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c
index af43bf1f7df7..0df166a95454 100644
--- a/core/hdd/src/wlan_hdd_cfg.c
+++ b/core/hdd/src/wlan_hdd_cfg.c
@@ -3518,13 +3518,6 @@ REG_TABLE_ENTRY g_registry_table[] = {
CFG_CONC_SYSTEM_PREF_MIN,
CFG_CONC_SYSTEM_PREF_MAX),
- REG_VARIABLE(CFG_POLICY_MNGR_ENABLE, WLAN_PARAM_Integer,
- struct hdd_config, policy_manager_enabled,
- VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
- CFG_POLICY_MNGR_ENABLE_DEFAULT,
- CFG_POLICY_MNGR_ENABLE_MIN,
- CFG_POLICY_MNGR_ENABLE_MAX),
-
REG_VARIABLE(CFG_TSO_ENABLED_NAME, WLAN_PARAM_Integer,
struct hdd_config, tso_enable,
VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
@@ -3770,15 +3763,6 @@ REG_TABLE_ENTRY g_registry_table[] = {
CFG_SET_TSF_GPIO_PIN_MAX),
#endif
-#ifdef QCA_WIFI_3_0_EMU
- REG_VARIABLE(CFG_ENABLE_M2M_LIMITATION, WLAN_PARAM_Integer,
- struct hdd_config, enable_m2m_limitation,
- VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
- CFG_ENABLE_M2M_LIMITATION_DEFAULT,
- CFG_ENABLE_M2M_LIMITATION_MIN,
- CFG_ENABLE_M2M_LIMITATION_MAX),
-#endif
-
REG_VARIABLE(CFG_ROAM_DENSE_TRAFFIC_THRESHOLD, WLAN_PARAM_Integer,
struct hdd_config, roam_dense_traffic_thresh,
VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
@@ -3919,6 +3903,21 @@ REG_TABLE_ENTRY g_registry_table[] = {
CFG_EDCA_BE_AIFS_VALUE_DEFAULT,
CFG_EDCA_BE_AIFS_VALUE_MIN,
CFG_EDCA_BE_AIFS_VALUE_MAX),
+#ifdef WLAN_FEATURE_NAN_DATAPATH
+ REG_VARIABLE(CFG_ENABLE_NAN_DATAPATH_NAME, WLAN_PARAM_Integer,
+ struct hdd_config, enable_nan_datapath,
+ VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
+ CFG_ENABLE_NAN_DATAPATH_DEFAULT,
+ CFG_ENABLE_NAN_DATAPATH_MIN,
+ CFG_ENABLE_NAN_DATAPATH_MAX),
+
+ REG_VARIABLE(CFG_ENABLE_NAN_NDI_CHANNEL_NAME, WLAN_PARAM_Integer,
+ struct hdd_config, nan_datapath_ndi_channel,
+ VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
+ CFG_ENABLE_NAN_NDI_CHANNEL_DEFAULT,
+ CFG_ENABLE_NAN_NDI_CHANNEL_MIN,
+ CFG_ENABLE_NAN_NDI_CHANNEL_MAX),
+#endif
REG_VARIABLE(CFG_ENABLE_DP_TRACE, WLAN_PARAM_Integer,
struct hdd_config, enable_dp_trace,
@@ -5489,9 +5488,6 @@ void hdd_cfg_print(hdd_context_t *pHddCtx)
"Name = [is_ps_enabled] value = [%d]",
pHddCtx->config->is_ps_enabled);
QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR,
- "Name = [policy_manager_enabled] value = [%d]",
- pHddCtx->config->policy_manager_enabled);
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR,
"Name = [tso_enable] value = [%d]",
pHddCtx->config->tso_enable);
QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR,
@@ -5657,6 +5653,7 @@ void hdd_cfg_print(hdd_context_t *pHddCtx)
hdd_info("Name = [%s] Value = [%u]",
CFG_ADAPT_DWELL_WIFI_THRESH_NAME,
pHddCtx->config->adapt_dwell_wifi_act_threshold);
+ hdd_ndp_print_ini_config(pHddCtx);
}
@@ -6113,11 +6110,31 @@ bool hdd_update_config_dat(hdd_context_t *pHddCtx)
struct hdd_config *pConfig = pHddCtx->config;
tSirMacHTCapabilityInfo *phtCapInfo;
- if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_SHORT_GI_20MHZ,
- pConfig->ShortGI20MhzEnable) ==
+ /*
+ * During the initialization both 2G and 5G capabilities should be same.
+ * So read 5G HT capablity and update 2G and 5G capablities.
+ */
+ if (sme_cfg_get_int(pHddCtx->hHal, WNI_CFG_HT_CAP_INFO,
+ &val) ==
+ QDF_STATUS_E_FAILURE) {
+ fStatus = false;
+ hdd_err("Could not pass on WNI_CFG_HT_CAP_INFO to CFG");
+ }
+ if (pConfig->ShortGI20MhzEnable)
+ val |= HT_CAPS_SHORT_GI20;
+ else
+ val &= ~(HT_CAPS_SHORT_GI20);
+
+ if (pConfig->ShortGI40MhzEnable)
+ val |= HT_CAPS_SHORT_GI40;
+ else
+ val &= ~(HT_CAPS_SHORT_GI40);
+
+ if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_HT_CAP_INFO,
+ val) ==
QDF_STATUS_E_FAILURE) {
fStatus = false;
- hddLog(LOGE, "Could not pass on WNI_CFG_SHORT_GI_20MHZ to CFG");
+ hdd_err("Could not pass on WNI_CFG_HT_CAP_INFO to CFG");
}
if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_FIXED_RATE, pConfig->TxRate)
@@ -6470,13 +6487,6 @@ bool hdd_update_config_dat(hdd_context_t *pHddCtx)
"Could not pass on WNI_CFG_TX_PWR_CTRL_ENABLE to CFG");
}
- if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_SHORT_GI_40MHZ,
- pConfig->ShortGI40MhzEnable) ==
- QDF_STATUS_E_FAILURE) {
- fStatus = false;
- hddLog(LOGE, "Could not pass on WNI_CFG_SHORT_GI_40MHZ to CFG");
- }
-
if (sme_cfg_set_int
(pHddCtx->hHal, WNI_CFG_ENABLE_MC_ADDR_LIST,
pConfig->fEnableMCAddrList) == QDF_STATUS_E_FAILURE) {
@@ -6552,12 +6562,6 @@ bool hdd_update_config_dat(hdd_context_t *pHddCtx)
}
}
- if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_HT_RX_STBC,
- pConfig->enableRxSTBC) == QDF_STATUS_E_FAILURE) {
- fStatus = false;
- hddLog(LOGE, "Could not pass on WNI_CFG_HT_RX_STBC to CFG");
- }
-
sme_cfg_get_int(pHddCtx->hHal, WNI_CFG_HT_CAP_INFO, &val);
val16 = (uint16_t) val;
phtCapInfo = (tSirMacHTCapabilityInfo *) &val16;
@@ -7091,8 +7095,6 @@ QDF_STATUS hdd_set_sme_config(hdd_context_t *pHddCtx)
smeConfig->csrConfig.sendDeauthBeforeCon = pConfig->sendDeauthBeforeCon;
- smeConfig->csrConfig.policy_manager_enabled =
- pHddCtx->config->policy_manager_enabled;
smeConfig->csrConfig.max_scan_count =
pHddCtx->config->max_scan_count;
diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c
index 00a35209161f..e27a1a3b803f 100644
--- a/core/hdd/src/wlan_hdd_cfg80211.c
+++ b/core/hdd/src/wlan_hdd_cfg80211.c
@@ -32,6 +32,9 @@
*
*/
+/* denote that this file does not allow legacy hddLog */
+#define HDD_DISALLOW_LEGACY_HDDLOG 1
+
#include <linux/version.h>
#include <linux/module.h>
#include <linux/kernel.h>
@@ -88,7 +91,8 @@
#include "wlan_hdd_subnet_detect.h"
#include <wlan_hdd_regulatory.h>
-
+#include "wlan_hdd_lpass.h"
+#include "wlan_hdd_nan_datapath.h"
#define g_mode_rates_size (12)
#define a_mode_rates_size (8)
@@ -344,7 +348,6 @@ static const struct ieee80211_iface_limit
},
};
-#ifndef QCA_WIFI_3_0_EMU
/* ADHOC (IBSS) limit */
static const struct ieee80211_iface_limit
wlan_hdd_adhoc_iface_limit[] = {
@@ -357,20 +360,6 @@ static const struct ieee80211_iface_limit
.types = BIT(NL80211_IFTYPE_ADHOC),
},
};
-#else
-/* ADHOC (IBSS) limit */
-static const struct ieee80211_iface_limit
- wlan_hdd_adhoc_iface_limit[] = {
- {
- .max = 1,
- .types = BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_AP),
- },
- {
- .max = 1,
- .types = BIT(NL80211_IFTYPE_ADHOC),
- },
-};
-#endif
/* AP ( + AP ) combination */
static const struct ieee80211_iface_limit
@@ -682,16 +671,15 @@ static int __wlan_hdd_cfg80211_get_tdls_capabilities(struct wiphy *wiphy,
skb = cfg80211_vendor_cmd_alloc_reply_skb(wiphy, (2 * sizeof(u32)) +
NLMSG_HDRLEN);
if (!skb) {
- hddLog(LOGE, FL("cfg80211_vendor_cmd_alloc_reply_skb failed"));
+ hdd_err("cfg80211_vendor_cmd_alloc_reply_skb failed");
goto fail;
}
if (false == hdd_ctx->config->fEnableTDLSSupport) {
- hddLog(LOGE,
- FL("TDLS feature not Enabled or Not supported in FW"));
+ hdd_err("TDLS feature not Enabled or Not supported in FW");
if (nla_put_u32(skb, PARAM_MAX_TDLS_SESSION, 0) ||
nla_put_u32(skb, PARAM_TDLS_FEATURE_SUPPORT, 0)) {
- hddLog(LOGE, FL("nla put fail"));
+ hdd_err("nla put fail");
goto fail;
}
} else {
@@ -700,12 +688,12 @@ static int __wlan_hdd_cfg80211_get_tdls_capabilities(struct wiphy *wiphy,
WIFI_TDLS_EXTERNAL_CONTROL_SUPPORT : 0);
set = set | (hdd_ctx->config->fEnableTDLSOffChannel ?
WIIF_TDLS_OFFCHANNEL_SUPPORT : 0);
- hddLog(LOG1, FL("TDLS Feature supported value %x"), set);
+ hdd_notice("TDLS Feature supported value %x", set);
if (nla_put_u32(skb, PARAM_MAX_TDLS_SESSION,
hdd_ctx->max_num_tdls_sta) ||
nla_put_u32(skb, PARAM_TDLS_FEATURE_SUPPORT,
set)) {
- hddLog(LOGE, FL("nla put fail"));
+ hdd_err("nla put fail");
goto fail;
}
}
@@ -762,12 +750,12 @@ int wlan_hdd_send_avoid_freq_event(hdd_context_t *pHddCtx,
ENTER();
if (!pHddCtx) {
- hddLog(LOGE, FL("HDD context is null"));
+ hdd_err("HDD context is null");
return -EINVAL;
}
if (!pAvoidFreqList) {
- hddLog(LOGE, FL("pAvoidFreqList is null"));
+ hdd_err("pAvoidFreqList is null");
return -EINVAL;
}
@@ -777,7 +765,7 @@ int wlan_hdd_send_avoid_freq_event(hdd_context_t *pHddCtx,
QCA_NL80211_VENDOR_SUBCMD_AVOID_FREQUENCY_INDEX,
GFP_KERNEL);
if (!vendor_event) {
- hddLog(LOGE, FL("cfg80211_vendor_event_alloc failed"));
+ hdd_err("cfg80211_vendor_event_alloc failed");
return -EINVAL;
}
@@ -1081,6 +1069,18 @@ static const struct nl80211_vendor_cmd_info wlan_hdd_cfg80211_vendor_events[] =
.subcmd = QCA_NL80211_VENDOR_SUBCMD_GW_PARAM_CONFIG
},
#endif /*FEATURE_LFR_SUBNET_DETECTION */
+
+#ifdef WLAN_FEATURE_NAN_DATAPATH
+ [QCA_NL80211_VENDOR_SUBCMD_NDP_INDEX] = {
+ .vendor_id = QCA_NL80211_VENDOR_ID,
+ .subcmd = QCA_NL80211_VENDOR_SUBCMD_NDP
+ },
+#endif /* WLAN_FEATURE_NAN_DATAPATH */
+
+ [QCA_NL80211_VENDOR_SUBCMD_P2P_LO_EVENT_INDEX] = {
+ .vendor_id = QCA_NL80211_VENDOR_ID,
+ .subcmd = QCA_NL80211_VENDOR_SUBCMD_P2P_LISTEN_OFFLOAD_STOP
+ },
};
/**
@@ -1125,7 +1125,7 @@ static int __is_driver_dfs_capable(struct wiphy *wiphy,
ret_val = nla_put_u32(temp_skbuff, QCA_WLAN_VENDOR_ATTR_DFS,
dfs_capability);
if (ret_val) {
- hddLog(LOGE, FL("QCA_WLAN_VENDOR_ATTR_DFS put fail"));
+ hdd_err("QCA_WLAN_VENDOR_ATTR_DFS put fail");
kfree_skb(temp_skbuff);
return ret_val;
@@ -1134,7 +1134,7 @@ static int __is_driver_dfs_capable(struct wiphy *wiphy,
return cfg80211_vendor_cmd_reply(temp_skbuff);
}
- hddLog(LOGE, FL("dfs capability: buffer alloc fail"));
+ hdd_err("dfs capability: buffer alloc fail");
return -ENOMEM;
}
@@ -1202,16 +1202,16 @@ int wlan_hdd_sap_cfg_dfs_override(hdd_adapter_t *adapter)
if (!CDS_IS_DFS_CH(con_ch))
return 0;
- hddLog(LOGE, FL("Only SCC AP-AP DFS Permitted (ch=%d, con_ch=%d)"),
+ hdd_err("Only SCC AP-AP DFS Permitted (ch=%d, con_ch=%d)",
sap_config->channel, con_ch);
- hddLog(LOG1, FL("Overriding guest AP's channel"));
+ hdd_notice("Overriding guest AP's channel");
sap_config->channel = con_ch;
if (con_sap_config->acs_cfg.acs_mode == true) {
if (con_ch != con_sap_config->acs_cfg.pri_ch &&
con_ch != con_sap_config->acs_cfg.ht_sec_ch) {
- hddLog(LOGE, FL("Primary AP channel config error"));
- hddLog(LOGE, FL("Operating ch: %d ACS ch: %d %d"),
+ hdd_err("Primary AP channel config error");
+ hdd_err("Operating ch: %d ACS ch: %d %d",
con_ch, con_sap_config->acs_cfg.pri_ch,
con_sap_config->acs_cfg.ht_sec_ch);
return -EINVAL;
@@ -1230,7 +1230,7 @@ int wlan_hdd_sap_cfg_dfs_override(hdd_adapter_t *adapter)
sizeof(uint8_t) *
con_sap_config->acs_cfg.ch_list_count);
if (!sap_config->acs_cfg.ch_list) {
- hddLog(LOGE, FL("ACS config alloc fail"));
+ hdd_err("ACS config alloc fail");
return -ENOMEM;
}
@@ -1344,7 +1344,7 @@ static int wlan_hdd_cfg80211_start_acs(hdd_adapter_t *adapter)
}
status = wlan_hdd_config_acs(hdd_ctx, adapter);
if (status) {
- hddLog(LOGE, FL("ACS config failed"));
+ hdd_err("ACS config failed");
return -EINVAL;
}
@@ -1352,7 +1352,7 @@ static int wlan_hdd_cfg80211_start_acs(hdd_adapter_t *adapter)
qdf_mem_copy(sap_config->self_macaddr.bytes,
adapter->macAddressCurrent.bytes, sizeof(struct qdf_mac_addr));
- hddLog(LOG1, FL("ACS Started for wlan%d"), adapter->dev->ifindex);
+ hdd_notice("ACS Started for wlan%d", adapter->dev->ifindex);
status = wlansap_acs_chselect(
#ifdef WLAN_FEATURE_MBSSID
WLAN_HDD_GET_SAP_CTX_PTR(adapter),
@@ -1363,7 +1363,7 @@ static int wlan_hdd_cfg80211_start_acs(hdd_adapter_t *adapter)
if (status) {
- hddLog(LOGE, FL("ACS channel select failed"));
+ hdd_err("ACS channel select failed");
return -EINVAL;
}
sap_config->acs_cfg.acs_mode = true;
@@ -1427,7 +1427,7 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy,
}
if (hdd_ctx->config->force_sap_acs) {
- hddLog(LOGE, FL("Hostapd ACS rejected as Driver ACS enabled"));
+ hdd_err("Hostapd ACS rejected as Driver ACS enabled");
return -EPERM;
}
@@ -1441,12 +1441,12 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy,
status = nla_parse(tb, QCA_WLAN_VENDOR_ATTR_ACS_MAX, data, data_len,
NULL);
if (status) {
- hddLog(QDF_TRACE_LEVEL_ERROR, FL("Invalid ATTR"));
+ hdd_err("Invalid ATTR");
goto out;
}
if (!tb[QCA_WLAN_VENDOR_ATTR_ACS_HW_MODE]) {
- hddLog(QDF_TRACE_LEVEL_ERROR, FL("Attr hw_mode failed"));
+ hdd_err("Attr hw_mode failed");
goto out;
}
sap_config->acs_cfg.hw_mode = nla_get_u8(
@@ -1518,7 +1518,7 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy,
sap_config->acs_cfg.ch_list = qdf_mem_malloc(
sap_config->acs_cfg.ch_list_count);
if (sap_config->acs_cfg.ch_list == NULL) {
- hddLog(LOGE, FL("ACS config alloc fail"));
+ hdd_err("ACS config alloc fail");
status = -ENOMEM;
goto out;
}
@@ -1538,11 +1538,11 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy,
&sap_config->acs_cfg.pcl_ch_count,
weight_list, QDF_ARRAY_SIZE(weight_list));
if (QDF_STATUS_SUCCESS != status)
- hddLog(LOGE, FL("Get PCL failed"));
+ hdd_err("Get PCL failed");
/* ACS override for android */
if (hdd_ctx->config->sap_p2p_11ac_override && ht_enabled) {
- hddLog(LOG1, FL("ACS Config override for 11AC"));
+ hdd_notice("ACS Config override for 11AC");
vht_enabled = 1;
sap_config->acs_cfg.hw_mode = eCSR_DOT11_MODE_11ac;
sap_config->acs_cfg.ch_width =
@@ -1555,29 +1555,29 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy,
wlan_hdd_set_acs_ch_range(sap_config, ht_enabled, vht_enabled);
- hddLog(LOG1, FL("ACS Config for wlan%d: HW_MODE: %d ACS_BW: %d HT: %d VHT: %d START_CH: %d END_CH: %d"),
+ hdd_notice("ACS Config for wlan%d: HW_MODE: %d ACS_BW: %d HT: %d VHT: %d START_CH: %d END_CH: %d",
adapter->dev->ifindex, sap_config->acs_cfg.hw_mode,
ch_width, ht_enabled, vht_enabled,
sap_config->acs_cfg.start_ch, sap_config->acs_cfg.end_ch);
if (sap_config->acs_cfg.ch_list_count) {
- hddLog(LOG1, FL("ACS channel list: len: %d"),
+ hdd_notice("ACS channel list: len: %d",
sap_config->acs_cfg.ch_list_count);
for (i = 0; i < sap_config->acs_cfg.ch_list_count; i++)
- hddLog(LOG1, "%d ", sap_config->acs_cfg.ch_list[i]);
+ hdd_notice("%d ", sap_config->acs_cfg.ch_list[i]);
}
sap_config->acs_cfg.acs_mode = true;
if (test_bit(ACS_IN_PROGRESS, &hdd_ctx->g_event_flags)) {
- /* ***Note*** Completion variable usage is not allowed here since
- * ACS scan operation may take max 2.2 sec for 5G band.
- * 9 Active channel X 40 ms active scan time +
- * 16 Passive channel X 110ms passive scan time
+ /* ***Note*** Completion variable usage is not allowed
+ * here since ACS scan operation may take max 2.2 sec
+ * for 5G band:
+ * 9 Active channel X 40 ms active scan time +
+ * 16 Passive channel X 110ms passive scan time
* Since this CFG80211 call lock rtnl mutex, we cannot hold on
* for this long. So we split up the scanning part.
*/
set_bit(ACS_PENDING, &adapter->event_flags);
- hddLog(LOG1, FL("ACS Pending for wlan%d"),
- adapter->dev->ifindex);
+ hdd_notice("ACS Pending for wlan%d", adapter->dev->ifindex);
status = 0;
} else {
status = wlan_hdd_cfg80211_start_acs(adapter);
@@ -1667,7 +1667,7 @@ void wlan_hdd_cfg80211_acs_ch_select_evt(hdd_adapter_t *adapter)
GFP_KERNEL);
if (!vendor_event) {
- hddLog(LOGE, FL("cfg80211_vendor_event_alloc failed"));
+ hdd_err("cfg80211_vendor_event_alloc failed");
return;
}
@@ -1675,8 +1675,7 @@ void wlan_hdd_cfg80211_acs_ch_select_evt(hdd_adapter_t *adapter)
QCA_WLAN_VENDOR_ATTR_ACS_PRIMARY_CHANNEL,
sap_cfg->acs_cfg.pri_ch);
if (ret_val) {
- hddLog(LOGE,
- FL("QCA_WLAN_VENDOR_ATTR_ACS_PRIMARY_CHANNEL put fail"));
+ hdd_err("QCA_WLAN_VENDOR_ATTR_ACS_PRIMARY_CHANNEL put fail");
kfree_skb(vendor_event);
return;
}
@@ -1685,9 +1684,7 @@ void wlan_hdd_cfg80211_acs_ch_select_evt(hdd_adapter_t *adapter)
QCA_WLAN_VENDOR_ATTR_ACS_SECONDARY_CHANNEL,
sap_cfg->acs_cfg.ht_sec_ch);
if (ret_val) {
- hddLog(LOGE,
- FL(
- "QCA_WLAN_VENDOR_ATTR_ACS_SECONDARY_CHANNEL put fail"));
+ hdd_err("QCA_WLAN_VENDOR_ATTR_ACS_SECONDARY_CHANNEL put fail");
kfree_skb(vendor_event);
return;
}
@@ -1696,9 +1693,7 @@ void wlan_hdd_cfg80211_acs_ch_select_evt(hdd_adapter_t *adapter)
QCA_WLAN_VENDOR_ATTR_ACS_VHT_SEG0_CENTER_CHANNEL,
sap_cfg->acs_cfg.vht_seg0_center_ch);
if (ret_val) {
- hddLog(LOGE,
- FL(
- "QCA_WLAN_VENDOR_ATTR_ACS_VHT_SEG0_CENTER_CHANNEL put fail"));
+ hdd_err("QCA_WLAN_VENDOR_ATTR_ACS_VHT_SEG0_CENTER_CHANNEL put fail");
kfree_skb(vendor_event);
return;
}
@@ -1707,9 +1702,7 @@ void wlan_hdd_cfg80211_acs_ch_select_evt(hdd_adapter_t *adapter)
QCA_WLAN_VENDOR_ATTR_ACS_VHT_SEG1_CENTER_CHANNEL,
sap_cfg->acs_cfg.vht_seg1_center_ch);
if (ret_val) {
- hddLog(LOGE,
- FL(
- "QCA_WLAN_VENDOR_ATTR_ACS_VHT_SEG1_CENTER_CHANNEL put fail"));
+ hdd_err("QCA_WLAN_VENDOR_ATTR_ACS_VHT_SEG1_CENTER_CHANNEL put fail");
kfree_skb(vendor_event);
return;
}
@@ -1725,9 +1718,7 @@ void wlan_hdd_cfg80211_acs_ch_select_evt(hdd_adapter_t *adapter)
QCA_WLAN_VENDOR_ATTR_ACS_CHWIDTH,
ch_width);
if (ret_val) {
- hddLog(LOGE,
- FL(
- "QCA_WLAN_VENDOR_ATTR_ACS_CHWIDTH put fail"));
+ hdd_err("QCA_WLAN_VENDOR_ATTR_ACS_CHWIDTH put fail");
kfree_skb(vendor_event);
return;
}
@@ -1741,15 +1732,12 @@ void wlan_hdd_cfg80211_acs_ch_select_evt(hdd_adapter_t *adapter)
QCA_ACS_MODE_IEEE80211G);
if (ret_val) {
- hddLog(LOGE,
- FL(
- "QCA_WLAN_VENDOR_ATTR_ACS_HW_MODE put fail"));
+ hdd_err("QCA_WLAN_VENDOR_ATTR_ACS_HW_MODE put fail");
kfree_skb(vendor_event);
return;
}
- hddLog(LOG1,
- FL("ACS result for wlan%d: PRI_CH: %d SEC_CH: %d VHT_SEG0: %d VHT_SEG1: %d ACS_BW: %d"),
+ hdd_notice("ACS result for wlan%d: PRI_CH: %d SEC_CH: %d VHT_SEG0: %d VHT_SEG1: %d ACS_BW: %d",
adapter->dev->ifindex, sap_cfg->acs_cfg.pri_ch,
sap_cfg->acs_cfg.ht_sec_ch, sap_cfg->acs_cfg.vht_seg0_center_ch,
sap_cfg->acs_cfg.vht_seg1_center_ch, ch_width);
@@ -1808,17 +1796,17 @@ __wlan_hdd_cfg80211_get_supported_features(struct wiphy *wiphy,
return ret;
if (wiphy->interface_modes & BIT(NL80211_IFTYPE_STATION)) {
- hddLog(LOG1, FL("Infra Station mode is supported by driver"));
+ hdd_notice("Infra Station mode is supported by driver");
fset |= WIFI_FEATURE_INFRA;
}
if (true == hdd_is_5g_supported(pHddCtx)) {
- hddLog(LOG1, FL("INFRA_5G is supported by firmware"));
+ hdd_notice("INFRA_5G is supported by firmware");
fset |= WIFI_FEATURE_INFRA_5G;
}
#ifdef WLAN_FEATURE_P2P
if ((wiphy->interface_modes & BIT(NL80211_IFTYPE_P2P_CLIENT)) &&
(wiphy->interface_modes & BIT(NL80211_IFTYPE_P2P_GO))) {
- hddLog(LOG1, FL("WiFi-Direct is supported by driver"));
+ hdd_notice("WiFi-Direct is supported by driver");
fset |= WIFI_FEATURE_P2P;
}
#endif
@@ -1829,23 +1817,23 @@ __wlan_hdd_cfg80211_get_supported_features(struct wiphy *wiphy,
#ifdef FEATURE_WLAN_EXTSCAN
if (sme_is_feature_supported_by_fw(EXTENDED_SCAN)) {
- hddLog(LOG1, FL("EXTScan is supported by firmware"));
+ hdd_notice("EXTScan is supported by firmware");
fset |= WIFI_FEATURE_EXTSCAN | WIFI_FEATURE_HAL_EPNO;
}
#endif
if (wlan_hdd_nan_is_supported()) {
- hddLog(LOG1, FL("NAN is supported by firmware"));
+ hdd_notice("NAN is supported by firmware");
fset |= WIFI_FEATURE_NAN;
}
if (sme_is_feature_supported_by_fw(RTT)) {
- hddLog(LOG1, FL("RTT is supported by firmware"));
+ hdd_notice("RTT is supported by firmware");
fset |= WIFI_FEATURE_D2D_RTT;
fset |= WIFI_FEATURE_D2AP_RTT;
}
#ifdef FEATURE_WLAN_SCAN_PNO
if (pHddCtx->config->configPNOScanSupport &&
sme_is_feature_supported_by_fw(PNO)) {
- hddLog(LOG1, FL("PNO is supported by firmware"));
+ hdd_notice("PNO is supported by firmware");
fset |= WIFI_FEATURE_PNO;
}
#endif
@@ -1853,13 +1841,13 @@ __wlan_hdd_cfg80211_get_supported_features(struct wiphy *wiphy,
#ifdef FEATURE_WLAN_TDLS
if ((true == pHddCtx->config->fEnableTDLSSupport) &&
sme_is_feature_supported_by_fw(TDLS)) {
- hddLog(LOG1, FL("TDLS is supported by firmware"));
+ hdd_notice("TDLS is supported by firmware");
fset |= WIFI_FEATURE_TDLS;
}
if (sme_is_feature_supported_by_fw(TDLS) &&
(true == pHddCtx->config->fEnableTDLSOffChannel) &&
sme_is_feature_supported_by_fw(TDLS_OFF_CHANNEL)) {
- hddLog(LOG1, FL("TDLS off-channel is supported by firmware"));
+ hdd_notice("TDLS off-channel is supported by firmware");
fset |= WIFI_FEATURE_TDLS_OFFCHANNEL;
}
#endif
@@ -1874,12 +1862,12 @@ __wlan_hdd_cfg80211_get_supported_features(struct wiphy *wiphy,
skb = cfg80211_vendor_cmd_alloc_reply_skb(wiphy, sizeof(fset) +
NLMSG_HDRLEN);
if (!skb) {
- hddLog(LOGE, FL("cfg80211_vendor_cmd_alloc_reply_skb failed"));
+ hdd_err("cfg80211_vendor_cmd_alloc_reply_skb failed");
return -EINVAL;
}
- hddLog(LOG1, FL("Supported Features : 0x%x"), fset);
+ hdd_notice("Supported Features : 0x%x", fset);
if (nla_put_u32(skb, QCA_WLAN_VENDOR_ATTR_FEATURE_SET, fset)) {
- hddLog(LOGE, FL("nla put fail"));
+ hdd_err("nla put fail");
goto nla_put_failure;
}
ret = cfg80211_vendor_cmd_reply(skb);
@@ -1949,33 +1937,32 @@ __wlan_hdd_cfg80211_set_scanning_mac_oui(struct wiphy *wiphy,
return ret;
if (false == pHddCtx->config->enable_mac_spoofing) {
- hddLog(LOGW, FL("MAC address spoofing is not enabled"));
+ hdd_warn("MAC address spoofing is not enabled");
return -ENOTSUPP;
}
if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_SET_SCANNING_MAC_OUI_MAX,
data, data_len, NULL)) {
- hddLog(LOGE, FL("Invalid ATTR"));
+ hdd_err("Invalid ATTR");
return -EINVAL;
}
pReqMsg = qdf_mem_malloc(sizeof(*pReqMsg));
if (!pReqMsg) {
- hddLog(LOGE, FL("qdf_mem_malloc failed"));
+ hdd_err("qdf_mem_malloc failed");
return -ENOMEM;
}
if (!tb[QCA_WLAN_VENDOR_ATTR_SET_SCANNING_MAC_OUI]) {
- hddLog(LOGE, FL("attr mac oui failed"));
+ hdd_err("attr mac oui failed");
goto fail;
}
nla_memcpy(&pReqMsg->oui[0],
tb[QCA_WLAN_VENDOR_ATTR_SET_SCANNING_MAC_OUI],
sizeof(pReqMsg->oui));
- hddLog(LOG1, FL("Oui (%02x:%02x:%02x)"), pReqMsg->oui[0],
+ hdd_notice("Oui (%02x:%02x:%02x)", pReqMsg->oui[0],
pReqMsg->oui[1], pReqMsg->oui[2]);
status = sme_set_scanning_mac_oui(pHddCtx->hHal, pReqMsg);
if (!QDF_IS_STATUS_SUCCESS(status)) {
- hddLog(QDF_TRACE_LEVEL_ERROR,
- FL("sme_set_scanning_mac_oui failed(err=%d)"), status);
+ hdd_err("sme_set_scanning_mac_oui failed(err=%d)", status);
goto fail;
}
return 0;
@@ -2181,7 +2168,7 @@ __wlan_hdd_cfg80211_get_features(struct wiphy *wiphy,
}
if (roaming_offload_enabled(hdd_ctx_ptr)) {
- hddLog(LOG1, FL("Key Mgmt Offload is supported"));
+ hdd_notice("Key Mgmt Offload is supported");
wlan_hdd_cfg80211_set_feature(feature_flags,
QCA_WLAN_VENDOR_FEATURE_KEY_MGMT_OFFLOAD);
}
@@ -2191,11 +2178,16 @@ __wlan_hdd_cfg80211_get_features(struct wiphy *wiphy,
if (wma_is_scan_simultaneous_capable())
wlan_hdd_cfg80211_set_feature(feature_flags,
QCA_WLAN_VENDOR_FEATURE_OFFCHANNEL_SIMULTANEOUS);
+
+ if (wma_is_p2p_lo_capable())
+ wlan_hdd_cfg80211_set_feature(feature_flags,
+ QCA_WLAN_VENDOR_FEATURE_P2P_LISTEN_OFFLOAD);
+
skb = cfg80211_vendor_cmd_alloc_reply_skb(wiphy, sizeof(feature_flags) +
NLMSG_HDRLEN);
if (!skb) {
- hddLog(LOGE, FL("cfg80211_vendor_cmd_alloc_reply_skb failed"));
+ hdd_err("cfg80211_vendor_cmd_alloc_reply_skb failed");
return -ENOMEM;
}
@@ -2308,25 +2300,25 @@ __wlan_hdd_cfg80211_set_ext_roam_params(struct wiphy *wiphy,
if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_MAX,
data, data_len,
NULL)) {
- hddLog(LOGE, FL("Invalid ATTR"));
+ hdd_err("Invalid ATTR");
return -EINVAL;
}
/* Parse and fetch Command Type*/
if (!tb[QCA_WLAN_VENDOR_ATTR_ROAMING_SUBCMD]) {
- hddLog(LOGE, FL("roam cmd type failed"));
+ hdd_err("roam cmd type failed");
goto fail;
}
session_id = pAdapter->sessionId;
qdf_mem_set(&roam_params, sizeof(roam_params), 0);
cmd_type = nla_get_u32(tb[QCA_WLAN_VENDOR_ATTR_ROAMING_SUBCMD]);
if (!tb[QCA_WLAN_VENDOR_ATTR_ROAMING_REQ_ID]) {
- hddLog(LOGE, FL("attr request id failed"));
+ hdd_err("attr request id failed");
goto fail;
}
req_id = nla_get_u32(
tb[QCA_WLAN_VENDOR_ATTR_ROAMING_REQ_ID]);
- hddLog(QDF_TRACE_LEVEL_DEBUG, FL("Req Id (%d)"), req_id);
- hddLog(QDF_TRACE_LEVEL_DEBUG, FL("Cmd Type (%d)"), cmd_type);
+ hdd_debug("Req Id (%d)", req_id);
+ hdd_debug("Cmd Type (%d)", cmd_type);
switch (cmd_type) {
case QCA_WLAN_VENDOR_ATTR_ROAM_SUBCMD_SSID_WHITE_LIST:
i = 0;
@@ -2337,13 +2329,12 @@ __wlan_hdd_cfg80211_set_ext_roam_params(struct wiphy *wiphy,
QCA_WLAN_VENDOR_ATTR_ROAM_SUBCMD_MAX,
nla_data(curr_attr), nla_len(curr_attr),
NULL)) {
- hddLog(LOGE,
- FL("nla_parse failed"));
+ hdd_err("nla_parse failed");
goto fail;
}
/* Parse and Fetch allowed SSID list*/
if (!tb2[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_WHITE_LIST_SSID]) {
- hddLog(LOGE, FL("attr allowed ssid failed"));
+ hdd_err("attr allowed ssid failed");
goto fail;
}
buf_len = nla_len(tb2[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_WHITE_LIST_SSID]);
@@ -2361,18 +2352,17 @@ __wlan_hdd_cfg80211_set_ext_roam_params(struct wiphy *wiphy,
buf_len - 1);
roam_params.ssid_allowed_list[i].length =
buf_len - 1;
- hddLog(QDF_TRACE_LEVEL_DEBUG,
- FL("SSID[%d]: %.*s,length = %d"), i,
+ hdd_debug("SSID[%d]: %.*s,length = %d", i,
roam_params.ssid_allowed_list[i].length,
roam_params.ssid_allowed_list[i].ssId,
roam_params.ssid_allowed_list[i].length);
i++;
} else {
- hddLog(LOGE, FL("Invalid buffer length"));
+ hdd_err("Invalid buffer length");
}
}
roam_params.num_ssid_allowed_list = i;
- hddLog(QDF_TRACE_LEVEL_DEBUG, FL("Num of Allowed SSID %d"),
+ hdd_debug("Num of Allowed SSID %d",
roam_params.num_ssid_allowed_list);
sme_update_roam_params(pHddCtx->hHal, session_id,
roam_params, REASON_ROAM_SET_SSID_ALLOWED);
@@ -2380,66 +2370,66 @@ __wlan_hdd_cfg80211_set_ext_roam_params(struct wiphy *wiphy,
case QCA_WLAN_VENDOR_ATTR_ROAM_SUBCMD_SET_EXTSCAN_ROAM_PARAMS:
/* Parse and fetch 5G Boost Threshold */
if (!tb[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_A_BAND_BOOST_THRESHOLD]) {
- hddLog(LOGE, FL("5G boost threshold failed"));
+ hdd_err("5G boost threshold failed");
goto fail;
}
roam_params.raise_rssi_thresh_5g = nla_get_s32(
tb[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_A_BAND_BOOST_THRESHOLD]);
- hddLog(QDF_TRACE_LEVEL_DEBUG, FL("5G Boost Threshold (%d)"),
+ hdd_debug("5G Boost Threshold (%d)",
roam_params.raise_rssi_thresh_5g);
/* Parse and fetch 5G Penalty Threshold */
if (!tb[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_A_BAND_PENALTY_THRESHOLD]) {
- hddLog(LOGE, FL("5G penalty threshold failed"));
+ hdd_err("5G penalty threshold failed");
goto fail;
}
roam_params.drop_rssi_thresh_5g = nla_get_s32(
tb[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_A_BAND_PENALTY_THRESHOLD]);
- hddLog(QDF_TRACE_LEVEL_DEBUG, FL("5G Penalty Threshold (%d)"),
+ hdd_debug("5G Penalty Threshold (%d)",
roam_params.drop_rssi_thresh_5g);
/* Parse and fetch 5G Boost Factor */
if (!tb[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_A_BAND_BOOST_FACTOR]) {
- hddLog(LOGE, FL("5G boost Factor failed"));
+ hdd_err("5G boost Factor failed");
goto fail;
}
roam_params.raise_factor_5g = nla_get_u32(
tb[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_A_BAND_BOOST_FACTOR]);
- hddLog(QDF_TRACE_LEVEL_DEBUG, FL("5G Boost Factor (%d)"),
+ hdd_debug("5G Boost Factor (%d)",
roam_params.raise_factor_5g);
/* Parse and fetch 5G Penalty factor */
if (!tb[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_A_BAND_PENALTY_FACTOR]) {
- hddLog(LOGE, FL("5G Penalty Factor failed"));
+ hdd_err("5G Penalty Factor failed");
goto fail;
}
roam_params.drop_factor_5g = nla_get_u32(
tb[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_A_BAND_PENALTY_FACTOR]);
- hddLog(QDF_TRACE_LEVEL_DEBUG, FL("5G Penalty factor (%d)"),
+ hdd_debug("5G Penalty factor (%d)",
roam_params.drop_factor_5g);
/* Parse and fetch 5G Max Boost */
if (!tb[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_A_BAND_MAX_BOOST]) {
- hddLog(LOGE, FL("5G Max Boost failed"));
+ hdd_err("5G Max Boost failed");
goto fail;
}
roam_params.max_raise_rssi_5g = nla_get_u32(
tb[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_A_BAND_MAX_BOOST]);
- hddLog(QDF_TRACE_LEVEL_DEBUG, FL("5G Max Boost (%d)"),
+ hdd_debug("5G Max Boost (%d)",
roam_params.max_raise_rssi_5g);
/* Parse and fetch Rssi Diff */
if (!tb[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_LAZY_ROAM_HISTERESYS]) {
- hddLog(LOGE, FL("Rssi Diff failed"));
+ hdd_err("Rssi Diff failed");
goto fail;
}
roam_params.rssi_diff = nla_get_s32(
tb[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_LAZY_ROAM_HISTERESYS]);
- hddLog(QDF_TRACE_LEVEL_DEBUG, FL("RSSI Diff (%d)"),
+ hdd_debug("RSSI Diff (%d)",
roam_params.rssi_diff);
/* Parse and fetch Alert Rssi Threshold */
if (!tb[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_ALERT_ROAM_RSSI_TRIGGER]) {
- hddLog(LOGE, FL("Alert Rssi Threshold failed"));
+ hdd_err("Alert Rssi Threshold failed");
goto fail;
}
roam_params.alert_rssi_threshold = nla_get_u32(
tb[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_ALERT_ROAM_RSSI_TRIGGER]);
- hddLog(QDF_TRACE_LEVEL_DEBUG, FL("Alert RSSI Threshold (%d)"),
+ hdd_debug("Alert RSSI Threshold (%d)",
roam_params.alert_rssi_threshold);
sme_update_roam_params(pHddCtx->hHal, session_id,
roam_params,
@@ -2448,12 +2438,12 @@ __wlan_hdd_cfg80211_set_ext_roam_params(struct wiphy *wiphy,
case QCA_WLAN_VENDOR_ATTR_ROAM_SUBCMD_SET_LAZY_ROAM:
/* Parse and fetch Activate Good Rssi Roam */
if (!tb[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_LAZY_ROAM_ENABLE]) {
- hddLog(LOGE, FL("Activate Good Rssi Roam failed"));
+ hdd_err("Activate Good Rssi Roam failed");
goto fail;
}
roam_params.good_rssi_roam = nla_get_s32(
tb[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_LAZY_ROAM_ENABLE]);
- hddLog(QDF_TRACE_LEVEL_DEBUG, FL("Activate Good Rssi Roam (%d)"),
+ hdd_debug("Activate Good Rssi Roam (%d)",
roam_params.good_rssi_roam);
sme_update_roam_params(pHddCtx->hHal, session_id,
roam_params, REASON_ROAM_GOOD_RSSI_CHANGED);
@@ -2461,12 +2451,12 @@ __wlan_hdd_cfg80211_set_ext_roam_params(struct wiphy *wiphy,
case QCA_WLAN_VENDOR_ATTR_ROAM_SUBCMD_SET_BSSID_PREFS:
/* Parse and fetch number of preferred BSSID */
if (!tb[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_LAZY_ROAM_NUM_BSSID]) {
- hddLog(LOGE, FL("attr num of preferred bssid failed"));
+ hdd_err("attr num of preferred bssid failed");
goto fail;
}
roam_params.num_bssid_favored = nla_get_u32(
tb[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_LAZY_ROAM_NUM_BSSID]);
- hddLog(QDF_TRACE_LEVEL_DEBUG, FL("Num of Preferred BSSID (%d)"),
+ hdd_debug("Num of Preferred BSSID (%d)",
roam_params.num_bssid_favored);
i = 0;
nla_for_each_nested(curr_attr,
@@ -2476,12 +2466,12 @@ __wlan_hdd_cfg80211_set_ext_roam_params(struct wiphy *wiphy,
QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_MAX,
nla_data(curr_attr), nla_len(curr_attr),
NULL)) {
- hddLog(LOGE, FL("nla_parse failed"));
+ hdd_err("nla_parse failed");
goto fail;
}
/* Parse and fetch MAC address */
if (!tb2[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_LAZY_ROAM_BSSID]) {
- hddLog(LOGE, FL("attr mac address failed"));
+ hdd_err("attr mac address failed");
goto fail;
}
nla_memcpy(roam_params.bssid_favored[i].bytes,
@@ -2491,12 +2481,12 @@ __wlan_hdd_cfg80211_set_ext_roam_params(struct wiphy *wiphy,
MAC_ADDR_ARRAY(roam_params.bssid_favored[i].bytes));
/* Parse and fetch preference factor*/
if (!tb2[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_LAZY_ROAM_RSSI_MODIFIER]) {
- hddLog(LOGE, FL("BSSID Preference score failed"));
+ hdd_err("BSSID Preference score failed");
goto fail;
}
roam_params.bssid_favored_factor[i] = nla_get_u32(
tb2[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_LAZY_ROAM_RSSI_MODIFIER]);
- hddLog(QDF_TRACE_LEVEL_DEBUG, FL("BSSID Preference score (%d)"),
+ hdd_debug("BSSID Preference score (%d)",
roam_params.bssid_favored_factor[i]);
i++;
}
@@ -2506,12 +2496,12 @@ __wlan_hdd_cfg80211_set_ext_roam_params(struct wiphy *wiphy,
case QCA_WLAN_VENDOR_ATTR_ROAM_SUBCMD_SET_BLACKLIST_BSSID:
/* Parse and fetch number of blacklist BSSID */
if (!tb[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_BSSID_PARAMS_NUM_BSSID]) {
- hddLog(LOGE, FL("attr num of blacklist bssid failed"));
+ hdd_err("attr num of blacklist bssid failed");
goto fail;
}
roam_params.num_bssid_avoid_list = nla_get_u32(
tb[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_BSSID_PARAMS_NUM_BSSID]);
- hddLog(QDF_TRACE_LEVEL_DEBUG, FL("Num of blacklist BSSID (%d)"),
+ hdd_debug("Num of blacklist BSSID (%d)",
roam_params.num_bssid_avoid_list);
i = 0;
nla_for_each_nested(curr_attr,
@@ -2521,12 +2511,12 @@ __wlan_hdd_cfg80211_set_ext_roam_params(struct wiphy *wiphy,
QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_MAX,
nla_data(curr_attr), nla_len(curr_attr),
NULL)) {
- hddLog(LOGE, FL("nla_parse failed"));
+ hdd_err("nla_parse failed");
goto fail;
}
/* Parse and fetch MAC address */
if (!tb2[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_BSSID_PARAMS_BSSID]) {
- hddLog(LOGE, FL("attr blacklist addr failed"));
+ hdd_err("attr blacklist addr failed");
goto fail;
}
nla_memcpy(roam_params.bssid_avoid_list[i].bytes,
@@ -2614,8 +2604,7 @@ static bool wlan_hdd_check_dfs_channel_for_adapter(hdd_context_t *hdd_ctx,
if (CHANNEL_STATE_DFS ==
cds_get_channel_state(
ap_ctx->operatingChannel)) {
- hddLog(QDF_TRACE_LEVEL_ERROR,
- FL("SAP running on DFS channel"));
+ hdd_err("SAP running on DFS channel");
return true;
}
}
@@ -2633,8 +2622,7 @@ static bool wlan_hdd_check_dfs_channel_for_adapter(hdd_context_t *hdd_ctx,
(CHANNEL_STATE_DFS ==
cds_get_channel_state(
sta_ctx->conn_info.operationChannel))) {
- hddLog(LOGE,
- FL("client connected on DFS channel"));
+ hdd_err("client connected on DFS channel");
return true;
}
}
@@ -2710,8 +2698,7 @@ int wlan_hdd_disable_dfs_chan_scan(hdd_context_t *hdd_ctx,
}
} else {
- hddLog(QDF_TRACE_LEVEL_INFO,
- FL(" the DFS flag has not changed"));
+ hdd_notice(" the DFS flag has not changed");
ret_val = 0;
}
return ret_val;
@@ -2758,10 +2745,10 @@ static int __wlan_hdd_cfg80211_disable_dfs_chan_scan(struct wiphy *wiphy,
no_dfs_flag = nla_get_u32(
tb[QCA_WLAN_VENDOR_ATTR_SET_NO_DFS_FLAG]);
- hddLog(LOG1, FL(" DFS flag = %d"), no_dfs_flag);
+ hdd_notice(" DFS flag = %d", no_dfs_flag);
if (no_dfs_flag > 1) {
- hddLog(LOGE, FL("invalid value of dfs flag"));
+ hdd_err("invalid value of dfs flag");
return -EINVAL;
}
@@ -2925,13 +2912,13 @@ static int __wlan_hdd_cfg80211_keymgmt_set_key(struct wiphy *wiphy,
if ((data == NULL) || (data_len == 0) ||
(data_len > SIR_ROAM_SCAN_PSK_SIZE)) {
- hddLog(LOGE, FL("Invalid data"));
+ hdd_err("Invalid data");
return -EINVAL;
}
hdd_ctx_ptr = WLAN_HDD_GET_CTX(hdd_adapter_ptr);
if (!hdd_ctx_ptr) {
- hddLog(LOGE, FL("HDD context is null"));
+ hdd_err("HDD context is null");
return -EINVAL;
}
@@ -3154,14 +3141,14 @@ __wlan_hdd_cfg80211_get_logger_supp_feature(struct wiphy *wiphy,
reply_skb = cfg80211_vendor_cmd_alloc_reply_skb(wiphy,
sizeof(uint32_t) + NLA_HDRLEN + NLMSG_HDRLEN);
if (!reply_skb) {
- hddLog(LOGE, FL("cfg80211_vendor_cmd_alloc_reply_skb failed"));
+ hdd_err("cfg80211_vendor_cmd_alloc_reply_skb failed");
return -ENOMEM;
}
- hddLog(LOG1, FL("Supported logger features: 0x%0x"), features);
+ hdd_notice("Supported logger features: 0x%0x", features);
if (nla_put_u32(reply_skb, QCA_WLAN_VENDOR_ATTR_LOGGER_SUPPORTED,
features)) {
- hddLog(LOGE, FL("nla put fail"));
+ hdd_err("nla put fail");
kfree_skb(reply_skb);
return -EINVAL;
}
@@ -3248,8 +3235,7 @@ int wlan_hdd_send_roam_auth_event(hdd_context_t *hdd_ctx_ptr, uint8_t *bssid,
GFP_KERNEL);
if (!skb) {
- hddLog(QDF_TRACE_LEVEL_ERROR,
- FL("cfg80211_vendor_event_alloc failed"));
+ hdd_err("cfg80211_vendor_event_alloc failed");
return -EINVAL;
}
@@ -3259,14 +3245,13 @@ int wlan_hdd_send_roam_auth_event(hdd_context_t *hdd_ctx_ptr, uint8_t *bssid,
req_rsn_len, req_rsn_ie) ||
nla_put(skb, QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_RESP_IE,
rsp_rsn_len, rsp_rsn_ie)) {
- hddLog(QDF_TRACE_LEVEL_ERROR, FL("nla put fail"));
+ hdd_err("nla put fail");
goto nla_put_failure;
}
- hddLog(QDF_TRACE_LEVEL_DEBUG, FL("Auth Status = %d"),
- roam_info_ptr->synchAuthStatus);
+ hdd_debug("Auth Status = %d", roam_info_ptr->synchAuthStatus);
if (roam_info_ptr->synchAuthStatus ==
CSR_ROAM_AUTH_STATUS_AUTHENTICATED) {
- hddLog(QDF_TRACE_LEVEL_DEBUG, FL("Include Auth Params TLV's"));
+ hdd_debug("Include Auth Params TLV's");
if (nla_put_u8(skb,
QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_AUTHORIZED, true)) {
hdd_err("nla put fail");
@@ -3296,15 +3281,15 @@ int wlan_hdd_send_roam_auth_event(hdd_context_t *hdd_ctx_ptr, uint8_t *bssid,
goto nla_put_failure;
}
} else {
- hddLog(QDF_TRACE_LEVEL_DEBUG, FL("No Auth Params TLV's"));
+ hdd_debug("No Auth Params TLV's");
if (nla_put_u8(skb, QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_AUTHORIZED,
false)) {
- hddLog(QDF_TRACE_LEVEL_ERROR, FL("nla put fail"));
+ hdd_err("nla put fail");
goto nla_put_failure;
}
}
- hddLog(QDF_TRACE_LEVEL_DEBUG, FL("Subnet Change Status = %d"),
+ hdd_debug("Subnet Change Status = %d",
roam_info_ptr->subnet_change_status);
/*
@@ -3317,7 +3302,7 @@ int wlan_hdd_send_roam_auth_event(hdd_context_t *hdd_ctx_ptr, uint8_t *bssid,
if (nla_put_u8(skb,
QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_SUBNET_STATUS,
roam_info_ptr->subnet_change_status)) {
- hddLog(QDF_TRACE_LEVEL_ERROR, FL("nla put fail"));
+ hdd_err("nla put fail");
goto nla_put_failure;
}
}
@@ -3384,7 +3369,7 @@ __wlan_hdd_cfg80211_wifi_configuration_set(struct wiphy *wiphy,
if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_CONFIG_MAX,
data, data_len,
wlan_hdd_wifi_config_policy)) {
- hddLog(LOGE, FL("invalid attr"));
+ hdd_err("invalid attr");
return -EINVAL;
}
@@ -3516,13 +3501,13 @@ static int __wlan_hdd_cfg80211_wifi_logger_start(struct wiphy *wiphy,
if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_START_MAX,
data, data_len,
qca_wlan_vendor_wifi_logger_start_policy)) {
- hddLog(LOGE, FL("Invalid attribute"));
+ hdd_err("Invalid attribute");
return -EINVAL;
}
/* Parse and fetch ring id */
if (!tb[QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_RING_ID]) {
- hddLog(LOGE, FL("attr ATTR failed"));
+ hdd_err("attr ATTR failed");
return -EINVAL;
}
start_log.ring_id = nla_get_u32(
@@ -3531,7 +3516,7 @@ static int __wlan_hdd_cfg80211_wifi_logger_start(struct wiphy *wiphy,
/* Parse and fetch verbose level */
if (!tb[QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_VERBOSE_LEVEL]) {
- hddLog(LOGE, FL("attr verbose_level failed"));
+ hdd_err("attr verbose_level failed");
return -EINVAL;
}
start_log.verbose_level = nla_get_u32(
@@ -3540,7 +3525,7 @@ static int __wlan_hdd_cfg80211_wifi_logger_start(struct wiphy *wiphy,
/* Parse and fetch flag */
if (!tb[QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_FLAGS]) {
- hddLog(LOGE, FL("attr flag failed"));
+ hdd_err("attr flag failed");
return -EINVAL;
}
start_log.flag = nla_get_u32(
@@ -3560,7 +3545,7 @@ static int __wlan_hdd_cfg80211_wifi_logger_start(struct wiphy *wiphy,
status = sme_wifi_start_logger(hdd_ctx->hHal, start_log);
if (!QDF_IS_STATUS_SUCCESS(status)) {
- hddLog(LOGE, FL("sme_wifi_start_logger failed(err=%d)"),
+ hdd_err("sme_wifi_start_logger failed(err=%d)",
status);
return -EINVAL;
}
@@ -3640,13 +3625,13 @@ static int __wlan_hdd_cfg80211_wifi_logger_get_ring_data(struct wiphy *wiphy,
if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_GET_RING_DATA_MAX,
data, data_len,
qca_wlan_vendor_wifi_logger_get_ring_data_policy)) {
- hddLog(LOGE, FL("Invalid attribute"));
+ hdd_err("Invalid attribute");
return -EINVAL;
}
/* Parse and fetch ring id */
if (!tb[QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_GET_RING_DATA_ID]) {
- hddLog(LOGE, FL("attr ATTR failed"));
+ hdd_err("attr ATTR failed");
return -EINVAL;
}
@@ -3655,17 +3640,17 @@ static int __wlan_hdd_cfg80211_wifi_logger_get_ring_data(struct wiphy *wiphy,
if (ring_id == RING_ID_PER_PACKET_STATS) {
wlan_logging_set_per_pkt_stats();
- hddLog(LOG1, FL("Flushing/Retrieving packet stats"));
+ hdd_notice("Flushing/Retrieving packet stats");
}
- hddLog(LOG1, FL("Bug report triggered by framework"));
+ hdd_notice("Bug report triggered by framework");
status = cds_flush_logs(WLAN_LOG_TYPE_NON_FATAL,
WLAN_LOG_INDICATOR_FRAMEWORK,
WLAN_LOG_REASON_CODE_UNUSED,
true, false);
if (QDF_STATUS_SUCCESS != status) {
- hddLog(LOGE, FL("Failed to trigger bug report"));
+ hdd_err("Failed to trigger bug report");
return -EINVAL;
}
@@ -3807,47 +3792,47 @@ wlan_hdd_add_tx_ptrn(hdd_adapter_t *adapter, hdd_context_t *hdd_ctx,
uint16_t eth_type = htons(ETH_P_IP);
if (!hdd_conn_is_connected(WLAN_HDD_GET_STATION_CTX_PTR(adapter))) {
- hddLog(LOGE, FL("Not in Connected state!"));
+ hdd_err("Not in Connected state!");
return -ENOTSUPP;
}
add_req = qdf_mem_malloc(sizeof(*add_req));
if (!add_req) {
- hddLog(LOGE, FL("memory allocation failed"));
+ hdd_err("memory allocation failed");
return -ENOMEM;
}
/* Parse and fetch request Id */
if (!tb[PARAM_REQUEST_ID]) {
- hddLog(LOGE, FL("attr request id failed"));
+ hdd_err("attr request id failed");
goto fail;
}
request_id = nla_get_u32(tb[PARAM_REQUEST_ID]);
if (request_id == MAX_REQUEST_ID) {
- hddLog(LOGE, FL("request_id cannot be MAX"));
+ hdd_err("request_id cannot be MAX");
return -EINVAL;
}
- hddLog(LOG1, FL("Request Id: %u"), request_id);
+ hdd_notice("Request Id: %u", request_id);
if (!tb[PARAM_PERIOD]) {
- hddLog(LOGE, FL("attr period failed"));
+ hdd_err("attr period failed");
goto fail;
}
add_req->usPtrnIntervalMs = nla_get_u32(tb[PARAM_PERIOD]);
- hddLog(LOG1, FL("Period: %u ms"), add_req->usPtrnIntervalMs);
+ hdd_notice("Period: %u ms", add_req->usPtrnIntervalMs);
if (add_req->usPtrnIntervalMs == 0) {
- hddLog(LOGE, FL("Invalid interval zero, return failure"));
+ hdd_err("Invalid interval zero, return failure");
goto fail;
}
if (!tb[PARAM_SRC_MAC_ADDR]) {
- hddLog(LOGE, FL("attr source mac address failed"));
+ hdd_err("attr source mac address failed");
goto fail;
}
nla_memcpy(add_req->mac_address.bytes, tb[PARAM_SRC_MAC_ADDR],
QDF_MAC_ADDR_SIZE);
- hddLog(LOG1, "input src mac address: "MAC_ADDRESS_STR,
+ hdd_notice("input src mac address: "MAC_ADDRESS_STR,
MAC_ADDR_ARRAY(add_req->mac_address.bytes));
if (!qdf_is_macaddr_equal(&add_req->mac_address,
@@ -3857,24 +3842,24 @@ wlan_hdd_add_tx_ptrn(hdd_adapter_t *adapter, hdd_context_t *hdd_ctx,
}
if (!tb[PARAM_DST_MAC_ADDR]) {
- hddLog(LOGE, FL("attr dst mac address failed"));
+ hdd_err("attr dst mac address failed");
goto fail;
}
nla_memcpy(dst_addr.bytes, tb[PARAM_DST_MAC_ADDR], QDF_MAC_ADDR_SIZE);
- hddLog(LOG1, "input dst mac address: "MAC_ADDRESS_STR,
+ hdd_notice("input dst mac address: "MAC_ADDRESS_STR,
MAC_ADDR_ARRAY(dst_addr.bytes));
if (!tb[PARAM_IP_PACKET]) {
- hddLog(LOGE, FL("attr ip packet failed"));
+ hdd_err("attr ip packet failed");
goto fail;
}
add_req->ucPtrnSize = nla_len(tb[PARAM_IP_PACKET]);
- hddLog(LOG1, FL("IP packet len: %u"), add_req->ucPtrnSize);
+ hdd_notice("IP packet len: %u", add_req->ucPtrnSize);
if (add_req->ucPtrnSize < 0 ||
add_req->ucPtrnSize > (PERIODIC_TX_PTRN_MAX_SIZE -
ETH_HLEN)) {
- hddLog(LOGE, FL("Invalid IP packet len: %d"),
+ hdd_err("Invalid IP packet len: %d",
add_req->ucPtrnSize);
goto fail;
}
@@ -3901,16 +3886,15 @@ wlan_hdd_add_tx_ptrn(hdd_adapter_t *adapter, hdd_context_t *hdd_ctx,
ret = hdd_map_req_id_to_pattern_id(hdd_ctx, request_id, &pattern_id);
if (ret) {
- hddLog(LOGW, FL("req id to pattern id failed (ret=%d)"), ret);
+ hdd_warn("req id to pattern id failed (ret=%d)", ret);
goto fail;
}
add_req->ucPtrnId = pattern_id;
- hddLog(LOG1, FL("pattern id: %d"), add_req->ucPtrnId);
+ hdd_notice("pattern id: %d", add_req->ucPtrnId);
status = sme_add_periodic_tx_ptrn(hdd_ctx->hHal, add_req);
if (!QDF_IS_STATUS_SUCCESS(status)) {
- hddLog(LOGE,
- FL("sme_add_periodic_tx_ptrn failed (err=%d)"), status);
+ hdd_err("sme_add_periodic_tx_ptrn failed (err=%d)", status);
goto fail;
}
@@ -3944,37 +3928,36 @@ wlan_hdd_del_tx_ptrn(hdd_adapter_t *adapter, hdd_context_t *hdd_ctx,
/* Parse and fetch request Id */
if (!tb[PARAM_REQUEST_ID]) {
- hddLog(LOGE, FL("attr request id failed"));
+ hdd_err("attr request id failed");
return -EINVAL;
}
request_id = nla_get_u32(tb[PARAM_REQUEST_ID]);
if (request_id == MAX_REQUEST_ID) {
- hddLog(LOGE, FL("request_id cannot be MAX"));
+ hdd_err("request_id cannot be MAX");
return -EINVAL;
}
ret = hdd_unmap_req_id_to_pattern_id(hdd_ctx, request_id, &pattern_id);
if (ret) {
- hddLog(LOGW, FL("req id to pattern id failed (ret=%d)"), ret);
+ hdd_warn("req id to pattern id failed (ret=%d)", ret);
return -EINVAL;
}
del_req = qdf_mem_malloc(sizeof(*del_req));
if (!del_req) {
- hddLog(LOGE, FL("memory allocation failed"));
+ hdd_err("memory allocation failed");
return -ENOMEM;
}
qdf_copy_macaddr(&del_req->mac_address, &adapter->macAddressCurrent);
hdd_info(MAC_ADDRESS_STR, MAC_ADDR_ARRAY(del_req->mac_address.bytes));
del_req->ucPtrnId = pattern_id;
- hddLog(LOG1, FL("Request Id: %u Pattern id: %d"),
+ hdd_notice("Request Id: %u Pattern id: %d",
request_id, del_req->ucPtrnId);
status = sme_del_periodic_tx_ptrn(hdd_ctx->hHal, del_req);
if (!QDF_IS_STATUS_SUCCESS(status)) {
- hddLog(LOGE,
- FL("sme_del_periodic_tx_ptrn failed (err=%d)"), status);
+ hdd_err("sme_del_periodic_tx_ptrn failed (err=%d)", status);
goto fail;
}
@@ -4031,29 +4014,28 @@ __wlan_hdd_cfg80211_offloaded_packets(struct wiphy *wiphy,
return ret;
if (!sme_is_feature_supported_by_fw(WLAN_PERIODIC_TX_PTRN)) {
- hddLog(LOGE,
- FL("Periodic Tx Pattern Offload feature is not supported in FW!"));
+ hdd_err("Periodic Tx Pattern Offload feature is not supported in FW!");
return -ENOTSUPP;
}
if (nla_parse(tb, PARAM_MAX, data, data_len, policy)) {
- hddLog(LOGE, FL("Invalid ATTR"));
+ hdd_err("Invalid ATTR");
return -EINVAL;
}
if (!tb[PARAM_CONTROL]) {
- hddLog(LOGE, FL("attr control failed"));
+ hdd_err("attr control failed");
return -EINVAL;
}
control = nla_get_u32(tb[PARAM_CONTROL]);
- hddLog(LOG1, FL("Control: %d"), control);
+ hdd_notice("Control: %d", control);
if (control == WLAN_START_OFFLOADED_PACKETS)
return wlan_hdd_add_tx_ptrn(adapter, hdd_ctx, tb);
else if (control == WLAN_STOP_OFFLOADED_PACKETS)
return wlan_hdd_del_tx_ptrn(adapter, hdd_ctx, tb);
else {
- hddLog(LOGE, FL("Invalid control: %d"), control);
+ hdd_err("Invalid control: %d", control);
return -EINVAL;
}
}
@@ -4142,22 +4124,22 @@ __wlan_hdd_cfg80211_monitor_rssi(struct wiphy *wiphy,
return ret;
if (!hdd_conn_is_connected(WLAN_HDD_GET_STATION_CTX_PTR(adapter))) {
- hddLog(LOGE, FL("Not in Connected state!"));
+ hdd_err("Not in Connected state!");
return -ENOTSUPP;
}
if (nla_parse(tb, PARAM_MAX, data, data_len, policy)) {
- hddLog(LOGE, FL("Invalid ATTR"));
+ hdd_err("Invalid ATTR");
return -EINVAL;
}
if (!tb[PARAM_REQUEST_ID]) {
- hddLog(LOGE, FL("attr request id failed"));
+ hdd_err("attr request id failed");
return -EINVAL;
}
if (!tb[PARAM_CONTROL]) {
- hddLog(LOGE, FL("attr control failed"));
+ hdd_err("attr control failed");
return -EINVAL;
}
@@ -4168,12 +4150,12 @@ __wlan_hdd_cfg80211_monitor_rssi(struct wiphy *wiphy,
if (control == QCA_WLAN_RSSI_MONITORING_START) {
req.control = true;
if (!tb[PARAM_MIN_RSSI]) {
- hddLog(LOGE, FL("attr min rssi failed"));
+ hdd_err("attr min rssi failed");
return -EINVAL;
}
if (!tb[PARAM_MAX_RSSI]) {
- hddLog(LOGE, FL("attr max rssi failed"));
+ hdd_err("attr max rssi failed");
return -EINVAL;
}
@@ -4181,26 +4163,25 @@ __wlan_hdd_cfg80211_monitor_rssi(struct wiphy *wiphy,
req.max_rssi = nla_get_s8(tb[PARAM_MAX_RSSI]);
if (!(req.min_rssi < req.max_rssi)) {
- hddLog(LOGW, FL("min_rssi: %d must be less than max_rssi: %d"),
+ hdd_warn("min_rssi: %d must be less than max_rssi: %d",
req.min_rssi, req.max_rssi);
return -EINVAL;
}
- hddLog(LOG1, FL("Min_rssi: %d Max_rssi: %d"),
+ hdd_notice("Min_rssi: %d Max_rssi: %d",
req.min_rssi, req.max_rssi);
} else if (control == QCA_WLAN_RSSI_MONITORING_STOP)
req.control = false;
else {
- hddLog(LOGE, FL("Invalid control cmd: %d"), control);
+ hdd_err("Invalid control cmd: %d", control);
return -EINVAL;
}
- hddLog(LOG1, FL("Request Id: %u Session_id: %d Control: %d"),
+ hdd_notice("Request Id: %u Session_id: %d Control: %d",
req.request_id, req.session_id, req.control);
status = sme_set_rssi_monitoring(hdd_ctx->hHal, &req);
if (!QDF_IS_STATUS_SUCCESS(status)) {
- hddLog(LOGE,
- FL("sme_set_rssi_monitoring failed(err=%d)"), status);
+ hdd_err("sme_set_rssi_monitoring failed(err=%d)", status);
return -EINVAL;
}
@@ -4260,7 +4241,7 @@ void hdd_rssi_threshold_breached(void *hddctx,
if (wlan_hdd_validate_context(hdd_ctx))
return;
if (!data) {
- hddLog(LOGE, FL("data is null"));
+ hdd_err("data is null");
return;
}
@@ -4271,13 +4252,13 @@ void hdd_rssi_threshold_breached(void *hddctx,
GFP_KERNEL);
if (!skb) {
- hddLog(LOGE, FL("cfg80211_vendor_event_alloc failed"));
+ hdd_err("cfg80211_vendor_event_alloc failed");
return;
}
- hddLog(LOG1, "Req Id: %u Current rssi: %d",
+ hdd_notice("Req Id: %u Current rssi: %d",
data->request_id, data->curr_rssi);
- hddLog(LOG1, "Current BSSID: "MAC_ADDRESS_STR,
+ hdd_notice("Current BSSID: "MAC_ADDRESS_STR,
MAC_ADDR_ARRAY(data->curr_bssid.bytes));
if (nla_put_u32(skb, QCA_WLAN_VENDOR_ATTR_RSSI_MONITORING_REQUEST_ID,
@@ -4286,7 +4267,7 @@ void hdd_rssi_threshold_breached(void *hddctx,
sizeof(data->curr_bssid), data->curr_bssid.bytes) ||
nla_put_s8(skb, QCA_WLAN_VENDOR_ATTR_RSSI_MONITORING_CUR_RSSI,
data->curr_rssi)) {
- hddLog(LOGE, FL("nla put fail"));
+ hdd_err("nla put fail");
goto fail;
}
@@ -4487,34 +4468,32 @@ static int __wlan_hdd_cfg80211_set_probable_oper_channel(struct wiphy *wiphy,
if (0 != wlan_hdd_check_remain_on_channel(adapter))
hdd_warn("Remain On Channel Pending");
- if (hdd_ctx->config->policy_manager_enabled) {
- ret = qdf_reset_connection_update();
- if (!QDF_IS_STATUS_SUCCESS(ret))
- hdd_err("clearing event failed");
-
- ret = cds_current_connections_update(adapter->sessionId,
- channel_hint,
- SIR_UPDATE_REASON_SET_OPER_CHAN);
- if (QDF_STATUS_E_FAILURE == ret) {
- /* return in the failure case */
- hdd_err("ERROR: connections update failed!!");
- return -EINVAL;
- }
+ ret = qdf_reset_connection_update();
+ if (!QDF_IS_STATUS_SUCCESS(ret))
+ hdd_err("clearing event failed");
- if (QDF_STATUS_SUCCESS == ret) {
- /*
- * Success is the only case for which we expect hw mode
- * change to take place, hence we need to wait.
- * For any other return value it should be a pass
- * through
- */
- ret = qdf_wait_for_connection_update();
- if (!QDF_IS_STATUS_SUCCESS(ret)) {
- hdd_err("ERROR: qdf wait for event failed!!");
- return -EINVAL;
- }
+ ret = cds_current_connections_update(adapter->sessionId,
+ channel_hint,
+ SIR_UPDATE_REASON_SET_OPER_CHAN);
+ if (QDF_STATUS_E_FAILURE == ret) {
+ /* return in the failure case */
+ hdd_err("ERROR: connections update failed!!");
+ return -EINVAL;
+ }
+ if (QDF_STATUS_SUCCESS == ret) {
+ /*
+ * Success is the only case for which we expect hw mode
+ * change to take place, hence we need to wait.
+ * For any other return value it should be a pass
+ * through
+ */
+ ret = qdf_wait_for_connection_update();
+ if (!QDF_IS_STATUS_SUCCESS(ret)) {
+ hdd_err("ERROR: qdf wait for event failed!!");
+ return -EINVAL;
}
+
}
return 0;
@@ -4592,21 +4571,19 @@ static int __wlan_hdd_cfg80211_get_link_properties(struct wiphy *wiphy,
if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_MAX, data, data_len,
qca_wlan_vendor_attr_policy)) {
- hddLog(QDF_TRACE_LEVEL_ERROR, FL("Invalid attribute"));
+ hdd_err("Invalid attribute");
return -EINVAL;
}
if (!tb[QCA_WLAN_VENDOR_ATTR_MAC_ADDR]) {
- hddLog(QDF_TRACE_LEVEL_ERROR,
- FL("Attribute peerMac not provided for mode=%d"),
+ hdd_err("Attribute peerMac not provided for mode=%d",
adapter->device_mode);
return -EINVAL;
}
qdf_mem_copy(peer_mac, nla_data(tb[QCA_WLAN_VENDOR_ATTR_MAC_ADDR]),
QDF_MAC_ADDR_SIZE);
- hddLog(QDF_TRACE_LEVEL_INFO,
- FL("peerMac="MAC_ADDRESS_STR" for device_mode:%d"),
+ hdd_notice("peerMac="MAC_ADDRESS_STR" for device_mode:%d",
MAC_ADDR_ARRAY(peer_mac), adapter->device_mode);
if (adapter->device_mode == QDF_STA_MODE ||
@@ -4616,8 +4593,7 @@ static int __wlan_hdd_cfg80211_get_link_properties(struct wiphy *wiphy,
eConnectionState_Associated) ||
qdf_mem_cmp(hdd_sta_ctx->conn_info.bssId.bytes,
peer_mac, QDF_MAC_ADDR_SIZE)) {
- hddLog(QDF_TRACE_LEVEL_ERROR,
- FL("Not Associated to mac "MAC_ADDRESS_STR),
+ hdd_err("Not Associated to mac "MAC_ADDRESS_STR,
MAC_ADDR_ARRAY(peer_mac));
return -EINVAL;
}
@@ -4640,8 +4616,7 @@ static int __wlan_hdd_cfg80211_get_link_properties(struct wiphy *wiphy,
}
if (WLAN_MAX_STA_COUNT == sta_id) {
- hddLog(QDF_TRACE_LEVEL_ERROR,
- FL("No active peer with mac="MAC_ADDRESS_STR),
+ hdd_err("No active peer with mac="MAC_ADDRESS_STR,
MAC_ADDR_ARRAY(peer_mac));
return -EINVAL;
}
@@ -4651,8 +4626,7 @@ static int __wlan_hdd_cfg80211_get_link_properties(struct wiphy *wiphy,
(WLAN_HDD_GET_AP_CTX_PTR(adapter))->operatingChannel);
rate_flags = adapter->aStaInfo[sta_id].rate_flags;
} else {
- hddLog(QDF_TRACE_LEVEL_ERROR,
- FL("Not Associated! with mac "MAC_ADDRESS_STR),
+ hdd_err("Not Associated! with mac "MAC_ADDRESS_STR,
MAC_ADDR_ARRAY(peer_mac));
return -EINVAL;
}
@@ -4691,8 +4665,7 @@ static int __wlan_hdd_cfg80211_get_link_properties(struct wiphy *wiphy,
sizeof(u8) + sizeof(u8) + sizeof(u32) + NLMSG_HDRLEN);
if (NULL == reply_skb) {
- hddLog(QDF_TRACE_LEVEL_ERROR,
- FL("getLinkProperties: skb alloc failed"));
+ hdd_err("getLinkProperties: skb alloc failed");
return -EINVAL;
}
@@ -4705,7 +4678,7 @@ static int __wlan_hdd_cfg80211_get_link_properties(struct wiphy *wiphy,
nla_put_u32(reply_skb,
QCA_WLAN_VENDOR_ATTR_LINK_PROPERTIES_FREQ,
freq)) {
- hddLog(QDF_TRACE_LEVEL_ERROR, FL("nla_put failed"));
+ hdd_err("nla_put failed");
kfree_skb(reply_skb);
return -EINVAL;
}
@@ -5019,6 +4992,247 @@ static int wlan_hdd_cfg80211_txpower_scale_decr_db(struct wiphy *wiphy,
return ret;
}
+
+/**
+ * __wlan_hdd_cfg80211_p2p_lo_start () - start P2P Listen Offload
+ * @wiphy: Pointer to wireless phy
+ * @wdev: Pointer to wireless device
+ * @data: Pointer to data
+ * @data_len: Data length
+ *
+ * This function is to process the p2p listen offload start vendor
+ * command. It parses the input parameters and invoke WMA API to
+ * send the command to firmware.
+ *
+ * Return: 0 on success, negative errno on failure
+ */
+static int __wlan_hdd_cfg80211_p2p_lo_start(struct wiphy *wiphy,
+ struct wireless_dev *wdev,
+ const void *data,
+ int data_len)
+{
+ int ret;
+ hdd_context_t *hdd_ctx = wiphy_priv(wiphy);
+ struct net_device *dev = wdev->netdev;
+ hdd_adapter_t *adapter;
+ struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_MAX + 1];
+ struct sir_p2p_lo_start params;
+ QDF_STATUS status;
+
+ ENTER_DEV(dev);
+
+ ret = wlan_hdd_validate_context(hdd_ctx);
+ if (ret)
+ return ret;
+
+ if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
+ hdd_err("Command not allowed in FTM mode");
+ return -EPERM;
+ }
+
+ adapter = WLAN_HDD_GET_PRIV_PTR(dev);
+ if ((adapter->device_mode != QDF_P2P_DEVICE_MODE) &&
+ (adapter->device_mode != QDF_P2P_CLIENT_MODE) &&
+ (adapter->device_mode != QDF_P2P_GO_MODE)) {
+ hdd_err("Invalid device mode %d", adapter->device_mode);
+ return -EINVAL;
+ }
+
+ if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_MAX,
+ data, data_len, NULL)) {
+ hdd_err("Invalid ATTR");
+ return -EINVAL;
+ }
+
+ memset(&params, 0, sizeof(params));
+
+ if (!tb[QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_CTRL_FLAG])
+ params.ctl_flags = 1; /* set to default value */
+ else
+ params.ctl_flags = nla_get_u32(tb
+ [QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_CTRL_FLAG]);
+
+ if (!tb[QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_CHANNEL] ||
+ !tb[QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_PERIOD] ||
+ !tb[QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_INTERVAL] ||
+ !tb[QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_COUNT] ||
+ !tb[QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_DEVICE_TYPES] ||
+ !tb[QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_VENDOR_IE]) {
+ hdd_err("Attribute parsing failed");
+ return -EINVAL;
+ }
+
+ params.vdev_id = adapter->sessionId;
+ params.freq = nla_get_u32(tb
+ [QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_CHANNEL]);
+ if ((params.freq != 2412) && (params.freq != 2437) &&
+ (params.freq != 2462)) {
+ hdd_err("Invalid listening channel: %d", params.freq);
+ return -EINVAL;
+ }
+
+ params.period = nla_get_u32(tb
+ [QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_PERIOD]);
+ if (!((params.period > 0) && (params.period < UINT_MAX))) {
+ hdd_err("Invalid period: %d", params.period);
+ return -EINVAL;
+ }
+
+ params.interval = nla_get_u32(tb
+ [QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_INTERVAL]);
+ if (!((params.interval > 0) && (params.interval < UINT_MAX))) {
+ hdd_err("Invalid interval: %d", params.interval);
+ return -EINVAL;
+ }
+
+ params.count = nla_get_u32(tb
+ [QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_COUNT]);
+ if (!((params.count > 0) && (params.count < UINT_MAX))) {
+ hdd_err("Invalid count: %d", params.count);
+ return -EINVAL;
+ }
+
+ params.device_types = nla_data(tb
+ [QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_DEVICE_TYPES]);
+ if (params.device_types == NULL) {
+ hdd_err("Invalid device types");
+ return -EINVAL;
+ }
+
+ params.dev_types_len = nla_len(tb
+ [QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_DEVICE_TYPES]);
+ if (params.dev_types_len < 8) {
+ hdd_err("Invalid device type length: %d", params.dev_types_len);
+ return -EINVAL;
+ }
+
+ params.probe_resp_tmplt = nla_data(tb
+ [QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_VENDOR_IE]);
+ if (params.probe_resp_tmplt == NULL) {
+ hdd_err("Invalid probe response template");
+ return -EINVAL;
+ }
+
+ params.probe_resp_len = nla_len(tb
+ [QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_VENDOR_IE]);
+ if (params.probe_resp_len == 0) {
+ hdd_err("Invalid probe resp template length: %d",
+ params.probe_resp_len);
+ return -EINVAL;
+ }
+
+ hdd_debug("P2P LO params: freq=%d, period=%d, interval=%d, count=%d",
+ params.freq, params.period, params.interval, params.count);
+
+ status = wma_p2p_lo_start(&params);
+
+ if (!QDF_IS_STATUS_SUCCESS(status)) {
+ hdd_err("P2P LO start failed");
+ return -EINVAL;
+ }
+
+ return 0;
+}
+
+
+/**
+ * wlan_hdd_cfg80211_p2p_lo_start () - start P2P Listen Offload
+ * @wiphy: Pointer to wireless phy
+ * @wdev: Pointer to wireless device
+ * @data: Pointer to data
+ * @data_len: Data length
+ *
+ * This function inovkes internal __wlan_hdd_cfg80211_p2p_lo_start()
+ * to process p2p listen offload start vendor command.
+ *
+ * Return: 0 on success, negative errno on failure
+ */
+static int wlan_hdd_cfg80211_p2p_lo_start(struct wiphy *wiphy,
+ struct wireless_dev *wdev,
+ const void *data,
+ int data_len)
+{
+ int ret = 0;
+
+ cds_ssr_protect(__func__);
+ ret = __wlan_hdd_cfg80211_p2p_lo_start(wiphy, wdev,
+ data, data_len);
+ cds_ssr_unprotect(__func__);
+
+ return ret;
+}
+
+/**
+ * __wlan_hdd_cfg80211_p2p_lo_stop () - stop P2P Listen Offload
+ * @wiphy: Pointer to wireless phy
+ * @wdev: Pointer to wireless device
+ * @data: Pointer to data
+ * @data_len: Data length
+ *
+ * This function is to process the p2p listen offload stop vendor
+ * command. It invokes WMA API to send command to firmware.
+ *
+ * Return: 0 on success, negative errno on failure
+ */
+static int __wlan_hdd_cfg80211_p2p_lo_stop(struct wiphy *wiphy,
+ struct wireless_dev *wdev,
+ const void *data,
+ int data_len)
+{
+ QDF_STATUS status;
+ hdd_adapter_t *adapter;
+ struct net_device *dev = wdev->netdev;
+
+ if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
+ hdd_err("Command not allowed in FTM mode");
+ return -EPERM;
+ }
+
+ adapter = WLAN_HDD_GET_PRIV_PTR(dev);
+ if ((adapter->device_mode != QDF_P2P_DEVICE_MODE) &&
+ (adapter->device_mode != QDF_P2P_CLIENT_MODE) &&
+ (adapter->device_mode != QDF_P2P_GO_MODE)) {
+ hdd_err("Invalid device mode");
+ return -EINVAL;
+ }
+
+ status = wma_p2p_lo_stop(adapter->sessionId);
+
+ if (!QDF_IS_STATUS_SUCCESS(status)) {
+ hdd_err("P2P LO stop failed");
+ return -EINVAL;
+ }
+
+ return 0;
+}
+
+/**
+ * wlan_hdd_cfg80211_p2p_lo_stop () - stop P2P Listen Offload
+ * @wiphy: Pointer to wireless phy
+ * @wdev: Pointer to wireless device
+ * @data: Pointer to data
+ * @data_len: Data length
+ *
+ * This function inovkes internal __wlan_hdd_cfg80211_p2p_lo_stop()
+ * to process p2p listen offload stop vendor command.
+ *
+ * Return: 0 on success, negative errno on failure
+ */
+static int wlan_hdd_cfg80211_p2p_lo_stop(struct wiphy *wiphy,
+ struct wireless_dev *wdev,
+ const void *data,
+ int data_len)
+{
+ int ret = 0;
+
+ cds_ssr_protect(__func__);
+ ret = __wlan_hdd_cfg80211_p2p_lo_stop(wiphy, wdev,
+ data, data_len);
+ cds_ssr_unprotect(__func__);
+
+ return ret;
+}
+
/*
* define short names for the global vendor params
* used by __wlan_hdd_cfg80211_bpf_offload()
@@ -5070,7 +5284,7 @@ void hdd_get_bpf_offload_cb(void *hdd_context,
ENTER();
if (wlan_hdd_validate_context(hdd_ctx) || !data) {
- hddLog(LOGE, FL("HDD context is invalid or data(%p) is null"),
+ hdd_err("HDD context is invalid or data(%p) is null",
data);
return;
}
@@ -5118,18 +5332,18 @@ static int hdd_post_get_bpf_capabilities_rsp(hdd_context_t *hdd_ctx,
skb = cfg80211_vendor_cmd_alloc_reply_skb(hdd_ctx->wiphy, nl_buf_len);
if (!skb) {
- hddLog(LOGE, FL("cfg80211_vendor_cmd_alloc_reply_skb failed"));
+ hdd_err("cfg80211_vendor_cmd_alloc_reply_skb failed");
return -ENOMEM;
}
- hddLog(LOG1, "BPF Version: %u BPF max bytes: %u",
+ hdd_notice("BPF Version: %u BPF max bytes: %u",
bpf_get_offload->bpf_version,
bpf_get_offload->max_bytes_for_bpf_inst);
if (nla_put_u32(skb, BPF_PACKET_SIZE,
bpf_get_offload->max_bytes_for_bpf_inst) ||
nla_put_u32(skb, BPF_VERSION, bpf_get_offload->bpf_version)) {
- hddLog(LOGE, FL("nla put failure"));
+ hdd_err("nla put failure");
goto nla_put_failure;
}
@@ -5165,14 +5379,14 @@ static int hdd_get_bpf_offload(hdd_context_t *hdd_ctx)
status = sme_get_bpf_offload_capabilities(hdd_ctx->hHal);
if (!QDF_IS_STATUS_SUCCESS(status)) {
- hddLog(LOGE, FL("Unable to retrieve BPF caps"));
+ hdd_err("Unable to retrieve BPF caps");
return -EINVAL;
}
/* request was sent -- wait for the response */
rc = wait_for_completion_timeout(&context->completion,
msecs_to_jiffies(WLAN_WAIT_TIME_BPF));
if (!rc) {
- hddLog(LOGE, FL("Target response timed out"));
+ hdd_err("Target response timed out");
spin_lock(&hdd_context_lock);
context->magic = 0;
spin_unlock(&hdd_context_lock);
@@ -5182,7 +5396,7 @@ static int hdd_get_bpf_offload(hdd_context_t *hdd_ctx)
ret = hdd_post_get_bpf_capabilities_rsp(hdd_ctx,
&bpf_context.capability_response);
if (ret)
- hddLog(LOGE, FL("Failed to post get bpf capabilities"));
+ hdd_err("Failed to post get bpf capabilities");
EXIT();
return ret;
@@ -5208,26 +5422,26 @@ static int hdd_set_reset_bpf_offload(hdd_context_t *hdd_ctx,
bpf_set_offload = qdf_mem_malloc(sizeof(*bpf_set_offload));
if (bpf_set_offload == NULL) {
- hddLog(LOGE, FL("qdf_mem_malloc failed for bpf_set_offload"));
+ hdd_err("qdf_mem_malloc failed for bpf_set_offload");
return -ENOMEM;
}
qdf_mem_zero(bpf_set_offload, sizeof(*bpf_set_offload));
/* Parse and fetch bpf packet size */
if (!tb[BPF_PACKET_SIZE]) {
- hddLog(LOGE, FL("attr bpf packet size failed"));
+ hdd_err("attr bpf packet size failed");
goto fail;
}
bpf_set_offload->total_length = nla_get_u32(tb[BPF_PACKET_SIZE]);
if (!bpf_set_offload->total_length) {
- hddLog(LOG1, FL("BPF reset packet filter received"));
+ hdd_notice("BPF reset packet filter received");
goto post_sme;
}
/* Parse and fetch bpf program */
if (!tb[BPF_PROGRAM]) {
- hddLog(LOGE, FL("attr bpf program failed"));
+ hdd_err("attr bpf program failed");
goto fail;
}
@@ -5239,20 +5453,20 @@ static int hdd_set_reset_bpf_offload(hdd_context_t *hdd_ctx,
/* Parse and fetch filter Id */
if (!tb[BPF_FILTER_ID]) {
- hddLog(LOGE, FL("attr filter id failed"));
+ hdd_err("attr filter id failed");
goto fail;
}
bpf_set_offload->filter_id = nla_get_u32(tb[BPF_FILTER_ID]);
/* Parse and fetch current offset */
if (!tb[BPF_CURRENT_OFFSET]) {
- hddLog(LOGE, FL("attr current offset failed"));
+ hdd_err("attr current offset failed");
goto fail;
}
bpf_set_offload->current_offset = nla_get_u32(tb[BPF_CURRENT_OFFSET]);
post_sme:
- hddLog(LOG1, FL("Posting BPF SET/RESET to SME, session_id: %d Bpf Version: %d filter ID: %d total_length: %d current_length: %d current offset: %d"),
+ hdd_notice("Posting BPF SET/RESET to SME, session_id: %d Bpf Version: %d filter ID: %d total_length: %d current_length: %d current offset: %d",
bpf_set_offload->session_id,
bpf_set_offload->version,
bpf_set_offload->filter_id,
@@ -5262,8 +5476,7 @@ post_sme:
status = sme_set_bpf_instructions(hdd_ctx->hHal, bpf_set_offload);
if (!QDF_IS_STATUS_SUCCESS(status)) {
- hddLog(LOGE,
- FL("sme_set_bpf_instructions failed(err=%d)"), status);
+ hdd_err("sme_set_bpf_instructions failed(err=%d)", status);
goto fail;
}
EXIT();
@@ -5306,23 +5519,23 @@ __wlan_hdd_cfg80211_bpf_offload(struct wiphy *wiphy,
return ret_val;
if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
- hddLog(LOGE, FL("Command not allowed in FTM mode"));
+ hdd_err("Command not allowed in FTM mode");
return -EINVAL;
}
if (!hdd_ctx->bpf_enabled) {
- hddLog(LOGE, FL("BPF offload is not supported by firmware"));
+ hdd_err("BPF offload is not supported by firmware");
return -ENOTSUPP;
}
if (nla_parse(tb, BPF_MAX, data, data_len,
wlan_hdd_bpf_offload_policy)) {
- hddLog(LOGE, FL("Invalid ATTR"));
+ hdd_err("Invalid ATTR");
return -EINVAL;
}
if (!tb[BPF_SET_RESET]) {
- hddLog(LOGE, FL("attr bpf set reset failed"));
+ hdd_err("attr bpf set reset failed");
return -EINVAL;
}
@@ -5405,7 +5618,7 @@ __wlan_hdd_cfg80211_sap_configuration_set(struct wiphy *wiphy,
ENTER();
if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
- hddLog(LOGE, FL("Command not allowed in FTM mode"));
+ hdd_err("Command not allowed in FTM mode");
return -EINVAL;
}
@@ -5416,7 +5629,7 @@ __wlan_hdd_cfg80211_sap_configuration_set(struct wiphy *wiphy,
if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_SAP_CONFIG_MAX,
data, data_len,
wlan_hdd_sap_config_policy)) {
- hddLog(LOGE, FL("invalid attr"));
+ hdd_err("invalid attr");
return -EINVAL;
}
@@ -6005,7 +6218,34 @@ const struct wiphy_vendor_command hdd_wiphy_vendor_commands[] = {
WIPHY_VENDOR_CMD_NEED_RUNNING,
.doit = wlan_hdd_cfg80211_sap_configuration_set
},
+ {
+ .info.subcmd =
+ QCA_NL80211_VENDOR_SUBCMD_P2P_LISTEN_OFFLOAD_START,
+ .flags = WIPHY_VENDOR_CMD_NEED_WDEV |
+ WIPHY_VENDOR_CMD_NEED_NETDEV |
+ WIPHY_VENDOR_CMD_NEED_RUNNING,
+ .doit = wlan_hdd_cfg80211_p2p_lo_start
+ },
+ {
+ .info.vendor_id = QCA_NL80211_VENDOR_ID,
+ .info.subcmd =
+ QCA_NL80211_VENDOR_SUBCMD_P2P_LISTEN_OFFLOAD_STOP,
+ .flags = WIPHY_VENDOR_CMD_NEED_WDEV |
+ WIPHY_VENDOR_CMD_NEED_NETDEV |
+ WIPHY_VENDOR_CMD_NEED_RUNNING,
+ .doit = wlan_hdd_cfg80211_p2p_lo_stop
+ },
+#ifdef WLAN_FEATURE_NAN_DATAPATH
+ {
+ .info.vendor_id = QCA_NL80211_VENDOR_ID,
+ .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_NDP,
+ .flags = WIPHY_VENDOR_CMD_NEED_WDEV |
+ WIPHY_VENDOR_CMD_NEED_NETDEV |
+ WIPHY_VENDOR_CMD_NEED_RUNNING,
+ .doit = wlan_hdd_cfg80211_process_ndp_cmd
+ },
+#endif
};
/**
@@ -6372,8 +6612,7 @@ int wlan_hdd_cfg80211_register(struct wiphy *wiphy)
/* Register our wiphy dev with cfg80211 */
if (0 > wiphy_register(wiphy)) {
/* print error */
- hddLog(QDF_TRACE_LEVEL_ERROR, "%s: wiphy register failed",
- __func__);
+ hdd_err("wiphy register failed");
return -EIO;
}
@@ -6526,7 +6765,7 @@ void wlan_hdd_cfg80211_set_key_wapi(hdd_adapter_t *pAdapter, uint8_t key_index,
uint8_t *pKeyPtr = NULL;
int n = 0;
- hddLog(LOG1, "Device_mode %s(%d)",
+ hdd_notice("Device_mode %s(%d)",
hdd_device_mode_to_string(pAdapter->device_mode),
pAdapter->device_mode);
@@ -6544,11 +6783,10 @@ void wlan_hdd_cfg80211_set_key_wapi(hdd_adapter_t *pAdapter, uint8_t key_index,
pKeyPtr = setKey.Key;
memcpy(pKeyPtr, key, key_Len);
- hddLog(QDF_TRACE_LEVEL_INFO, "%s: WAPI KEY LENGTH:0x%04x",
- __func__, key_Len);
+ hdd_notice("WAPI KEY LENGTH:0x%04x", key_Len);
for (n = 0; n < key_Len; n++)
- hddLog(QDF_TRACE_LEVEL_INFO, "%s WAPI KEY Data[%d]:%02x ",
- __func__, n, setKey.Key[n]);
+ hdd_notice("WAPI KEY Data[%d]:%02x ",
+ n, setKey.Key[n]);
pHddStaCtx->roam_info.roamingState = HDD_ROAM_STATE_SETTING_KEY;
if (isConnected) {
@@ -6556,9 +6794,8 @@ void wlan_hdd_cfg80211_set_key_wapi(hdd_adapter_t *pAdapter, uint8_t key_index,
pAdapter->sessionId, &setKey, &roamId);
}
if (status != 0) {
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR,
- "[%4d] sme_roam_set_key returned ERROR status= %d",
- __LINE__, status);
+ hdd_err("sme_roam_set_key returned ERROR status= %d",
+ status);
pHddStaCtx->roam_info.roamingState = HDD_ROAM_STATE_NONE;
}
}
@@ -6576,8 +6813,7 @@ uint8_t *wlan_hdd_cfg80211_get_ie_ptr(const uint8_t *ies_ptr, int length,
elem_len = ptr[1];
left -= 2;
if (elem_len > left) {
- hddLog(QDF_TRACE_LEVEL_FATAL,
- FL("Invalid IEs eid = %d elem_len=%d left=%d"),
+ hdd_alert("Invalid IEs eid = %d elem_len=%d left=%d",
eid, elem_len, left);
return NULL;
}
@@ -6620,16 +6856,13 @@ QDF_STATUS wlan_hdd_validate_operation_channel(hdd_adapter_t *pAdapter,
}
}
if (fValidChannel != true) {
- hddLog(QDF_TRACE_LEVEL_ERROR,
- "%s: Invalid Channel [%d]", __func__, channel);
+ hdd_err("Invalid Channel [%d]", channel);
return QDF_STATUS_E_FAILURE;
}
} else {
if (0 != sme_cfg_get_str(hHal, WNI_CFG_VALID_CHANNEL_LIST,
valid_ch, &num_ch)) {
- hddLog(QDF_TRACE_LEVEL_ERROR,
- "%s: failed to get valid channel list",
- __func__);
+ hdd_err("failed to get valid channel list");
return QDF_STATUS_E_FAILURE;
}
for (indx = 0; indx < num_ch; indx++) {
@@ -6639,8 +6872,7 @@ QDF_STATUS wlan_hdd_validate_operation_channel(hdd_adapter_t *pAdapter,
}
if (indx >= num_ch) {
- hddLog(QDF_TRACE_LEVEL_ERROR,
- "%s: Invalid Channel [%d]", __func__, channel);
+ hdd_err("Invalid Channel [%d]", channel);
return QDF_STATUS_E_FAILURE;
}
}
@@ -6659,8 +6891,7 @@ static void wlan_hdd_set_dhcp_server_offload(hdd_adapter_t *pHostapdAdapter)
uint32_t temp;
pDhcpSrvInfo = qdf_mem_malloc(sizeof(*pDhcpSrvInfo));
if (NULL == pDhcpSrvInfo) {
- hddLog(QDF_TRACE_LEVEL_ERROR,
- "%s: could not allocate tDhcpSrvOffloadInfo!", __func__);
+ hdd_err("could not allocate tDhcpSrvOffloadInfo!");
return;
}
qdf_mem_zero(pDhcpSrvInfo, sizeof(*pDhcpSrvInfo));
@@ -6670,21 +6901,15 @@ static void wlan_hdd_set_dhcp_server_offload(hdd_adapter_t *pHostapdAdapter)
hdd_string_to_u8_array(pHddCtx->config->dhcpServerIP,
srv_ip, &numEntries, IPADDR_NUM_ENTRIES);
if (numEntries != IPADDR_NUM_ENTRIES) {
- hddLog(QDF_TRACE_LEVEL_ERROR,
- "%s: incorrect IP address (%s) assigned for DHCP server!",
- __func__, pHddCtx->config->dhcpServerIP);
+ hdd_err("incorrect IP address (%s) assigned for DHCP server!", pHddCtx->config->dhcpServerIP);
goto end;
}
if ((srv_ip[0] >= 224) && (srv_ip[0] <= 239)) {
- hddLog(QDF_TRACE_LEVEL_ERROR,
- "%s: invalid IP address (%s)! It could NOT be multicast IP address!",
- __func__, pHddCtx->config->dhcpServerIP);
+ hdd_err("invalid IP address (%s)! It could NOT be multicast IP address!", pHddCtx->config->dhcpServerIP);
goto end;
}
if (srv_ip[IPADDR_NUM_ENTRIES - 1] >= 100) {
- hddLog(QDF_TRACE_LEVEL_ERROR,
- "%s: invalid IP address (%s)! The last field must be less than 100!",
- __func__, pHddCtx->config->dhcpServerIP);
+ hdd_err("invalid IP address (%s)! The last field must be less than 100!", pHddCtx->config->dhcpServerIP);
goto end;
}
for (num = 0; num < numEntries; num++) {
@@ -6693,12 +6918,10 @@ static void wlan_hdd_set_dhcp_server_offload(hdd_adapter_t *pHostapdAdapter)
}
if (QDF_STATUS_SUCCESS !=
sme_set_dhcp_srv_offload(pHddCtx->hHal, pDhcpSrvInfo)) {
- hddLog(QDF_TRACE_LEVEL_ERROR,
- "%s: sme_setDHCPSrvOffload fail!", __func__);
+ hdd_err("sme_setDHCPSrvOffload fail!");
goto end;
}
- hddLog(QDF_TRACE_LEVEL_INFO_HIGH,
- "%s: enable DHCP Server offload successfully!", __func__);
+ hdd_info("enable DHCP Server offload successfully!");
end:
qdf_mem_free(pDhcpSrvInfo);
return;
@@ -6717,14 +6940,14 @@ static int __wlan_hdd_cfg80211_change_bss(struct wiphy *wiphy,
ENTER();
if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
- hddLog(LOGE, FL("Command not allowed in FTM mode"));
+ hdd_err("Command not allowed in FTM mode");
return -EINVAL;
}
MTRACE(qdf_trace(QDF_MODULE_ID_HDD,
TRACE_CODE_HDD_CFG80211_CHANGE_BSS,
pAdapter->sessionId, params->ap_isolate));
- hddLog(LOG1, FL("Device_mode %s(%d), ap_isolate = %d"),
+ hdd_notice("Device_mode %s(%d), ap_isolate = %d",
hdd_device_mode_to_string(pAdapter->device_mode),
pAdapter->device_mode, params->ap_isolate);
@@ -6781,7 +7004,7 @@ static int wlan_hdd_change_client_iface_to_new_mode(struct net_device *ndev,
ENTER();
if (test_bit(ACS_IN_PROGRESS, &hdd_ctx->g_event_flags)) {
- hddLog(LOG1, FL("ACS is in progress, don't change iface!"));
+ hdd_notice("ACS is in progress, don't change iface!");
return 0;
}
@@ -6868,7 +7091,7 @@ static int __wlan_hdd_cfg80211_change_iface(struct wiphy *wiphy,
ENTER();
if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
- hddLog(LOGE, FL("Command not allowed in FTM mode"));
+ hdd_err("Command not allowed in FTM mode");
return -EINVAL;
}
@@ -6881,14 +7104,13 @@ static int __wlan_hdd_cfg80211_change_iface(struct wiphy *wiphy,
TRACE_CODE_HDD_CFG80211_CHANGE_IFACE,
pAdapter->sessionId, type));
- hddLog(QDF_TRACE_LEVEL_INFO, FL("Device_mode = %d, IFTYPE = 0x%x"),
+ hdd_notice("Device_mode = %d, IFTYPE = 0x%x",
pAdapter->device_mode, type);
if (!cds_allow_concurrency(
wlan_hdd_convert_nl_iftype_to_hdd_type(type),
0, HW_MODE_20_MHZ)) {
- hddLog(QDF_TRACE_LEVEL_DEBUG,
- FL("This concurrency combination is not allowed"));
+ hdd_debug("This concurrency combination is not allowed");
return -EINVAL;
}
@@ -6917,8 +7139,7 @@ static int __wlan_hdd_cfg80211_change_iface(struct wiphy *wiphy,
if (type == NL80211_IFTYPE_ADHOC) {
wlan_hdd_tdls_exit(pAdapter);
hdd_deregister_tx_flow_control(pAdapter);
- hddLog(LOG1,
- FL("Setting interface Type to ADHOC"));
+ hdd_notice("Setting interface Type to ADHOC");
}
vstatus = wlan_hdd_change_client_iface_to_new_mode(ndev,
type);
@@ -6938,8 +7159,7 @@ static int __wlan_hdd_cfg80211_change_iface(struct wiphy *wiphy,
case NL80211_IFTYPE_AP:
case NL80211_IFTYPE_P2P_GO:
{
- hddLog(QDF_TRACE_LEVEL_INFO_HIGH,
- FL("Setting interface Type to %s"),
+ hdd_info("Setting interface Type to %s",
(type ==
NL80211_IFTYPE_AP) ? "SoftAP" :
"P2pGo");
@@ -6985,9 +7205,7 @@ static int __wlan_hdd_cfg80211_change_iface(struct wiphy *wiphy,
vstatus = hdd_init_ap_mode(pAdapter);
if (vstatus != QDF_STATUS_SUCCESS) {
- hddLog(LOGP,
- FL
- ("Error initializing the ap mode"));
+ hdd_alert("Error initializing the ap mode");
return -EINVAL;
}
@@ -6999,15 +7217,14 @@ static int __wlan_hdd_cfg80211_change_iface(struct wiphy *wiphy,
if (wdev) {
wdev->iftype = type;
} else {
- hddLog(LOGE,
- FL("Wireless dev is NULL"));
+ hdd_err("Wireless dev is NULL");
return -EINVAL;
}
goto done;
}
default:
- hddLog(LOGE, FL("Unsupported interface type (%d)"),
+ hdd_err("Unsupported interface type (%d)",
type);
return -EOPNOTSUPP;
}
@@ -7043,12 +7260,12 @@ static int __wlan_hdd_cfg80211_change_iface(struct wiphy *wiphy,
goto done;
default:
- hddLog(LOGE, FL("Unsupported interface type(%d)"),
+ hdd_err("Unsupported interface type(%d)",
type);
return -EOPNOTSUPP;
}
} else {
- hddLog(LOGE, FL("Unsupported device mode(%d)"),
+ hdd_err("Unsupported device mode(%d)",
pAdapter->device_mode);
return -EOPNOTSUPP;
}
@@ -7056,9 +7273,7 @@ done:
/* Set bitmask based on updated value */
cds_set_concurrency_mode(pAdapter->device_mode);
-#ifdef WLAN_FEATURE_LPSS
wlan_hdd_send_all_scan_intf_info(pHddCtx);
-#endif
EXIT();
return 0;
@@ -7139,7 +7354,7 @@ static int __wlan_hdd_change_station(struct wiphy *wiphy,
ENTER();
if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
- hddLog(LOGE, FL("Command not allowed in FTM mode"));
+ hdd_err("Command not allowed in FTM mode");
return -EINVAL;
}
@@ -7165,9 +7380,7 @@ static int __wlan_hdd_change_station(struct wiphy *wiphy,
OL_TXRX_PEER_STATE_AUTH);
if (status != QDF_STATUS_SUCCESS) {
- hddLog(QDF_TRACE_LEVEL_INFO,
- FL
- ("Not able to change TL state to AUTHENTICATED"));
+ hdd_notice("Not able to change TL state to AUTHENTICATED");
return -EINVAL;
}
}
@@ -7185,9 +7398,7 @@ static int __wlan_hdd_change_station(struct wiphy *wiphy,
* are an incremental of 1 else an incremental of 4 till the number
* of channels.
*/
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO,
- "%s: params->supported_channels_len: %d",
- __func__, params->supported_channels_len);
+ hdd_notice("params->supported_channels_len: %d", params->supported_channels_len);
if (0 != params->supported_channels_len) {
int i = 0, j = 0, k = 0, no_of_channels = 0;
int num_unique_channels;
@@ -7212,10 +7423,7 @@ static int __wlan_hdd_change_station(struct wiphy *wiphy,
no_of_channels =
params->supported_channels[i + 1];
- QDF_TRACE(QDF_MODULE_ID_HDD,
- QDF_TRACE_LEVEL_INFO,
- "%s: i: %d, j: %d, k: %d, StaParams.supported_channels[%d]: %d, wifi_chan_index: %d, no_of_channels: %d",
- __func__, i, j, k, j,
+ hdd_notice("i: %d, j: %d, k: %d, StaParams.supported_channels[%d]: %d, wifi_chan_index: %d, no_of_channels: %d", i, j, k, j,
StaParams.
supported_channels[j],
wifi_chan_index,
@@ -7236,10 +7444,7 @@ static int __wlan_hdd_change_station(struct wiphy *wiphy,
} else {
continue;
}
- QDF_TRACE(QDF_MODULE_ID_HDD,
- QDF_TRACE_LEVEL_INFO,
- "%s: i: %d, j: %d, k: %d, StaParams.supported_channels[%d]: %d",
- __func__, i, j, k,
+ hdd_notice("i: %d, j: %d, k: %d, StaParams.supported_channels[%d]: %d", i, j, k,
j + 1,
StaParams.
supported_channels[j +
@@ -7248,14 +7453,9 @@ static int __wlan_hdd_change_station(struct wiphy *wiphy,
}
}
num_unique_channels = j + 1;
- QDF_TRACE(QDF_MODULE_ID_HDD,
- QDF_TRACE_LEVEL_INFO,
- "%s: Unique Channel List", __func__);
+ hdd_notice("Unique Channel List");
for (i = 0; i < num_unique_channels; i++) {
- QDF_TRACE(QDF_MODULE_ID_HDD,
- QDF_TRACE_LEVEL_INFO,
- "%s: StaParams.supported_channels[%d]: %d,",
- __func__, i,
+ hdd_notice("StaParams.supported_channels[%d]: %d,", i,
StaParams.
supported_channels[i]);
}
@@ -7263,10 +7463,7 @@ static int __wlan_hdd_change_station(struct wiphy *wiphy,
num_unique_channels = MAX_CHANNEL;
StaParams.supported_channels_len =
num_unique_channels;
- QDF_TRACE(QDF_MODULE_ID_HDD,
- QDF_TRACE_LEVEL_INFO,
- "%s: After removing duplcates StaParams.supported_channels_len: %d",
- __func__,
+ hdd_notice("After removing duplcates StaParams.supported_channels_len: %d",
StaParams.supported_channels_len);
}
qdf_mem_copy(StaParams.supported_oper_classes,
@@ -7307,15 +7504,11 @@ static int __wlan_hdd_change_station(struct wiphy *wiphy,
qdf_mem_copy(StaParams.supported_rates,
params->supported_rates,
StaParams.supported_rates_len);
- QDF_TRACE(QDF_MODULE_ID_HDD,
- QDF_TRACE_LEVEL_INFO,
- "Supported Rates with Length %d",
+ hdd_notice("Supported Rates with Length %d",
StaParams.supported_rates_len);
for (i = 0; i < StaParams.supported_rates_len;
i++)
- QDF_TRACE(QDF_MODULE_ID_HDD,
- QDF_TRACE_LEVEL_INFO,
- "[%d]: %0x", i,
+ hdd_notice("[%d]: %0x", i,
StaParams.supported_rates[i]);
}
@@ -7342,9 +7535,7 @@ static int __wlan_hdd_change_station(struct wiphy *wiphy,
isBufSta,
isOffChannelSupported);
if (QDF_STATUS_SUCCESS != status) {
- hddLog(QDF_TRACE_LEVEL_ERROR,
- FL
- ("wlan_hdd_tdls_set_peer_caps failed!"));
+ hdd_err("wlan_hdd_tdls_set_peer_caps failed!");
return -EINVAL;
}
@@ -7352,8 +7543,7 @@ static int __wlan_hdd_change_station(struct wiphy *wiphy,
wlan_hdd_tdls_add_station(wiphy, dev, mac, 1,
&StaParams);
if (QDF_STATUS_SUCCESS != status) {
- hddLog(QDF_TRACE_LEVEL_ERROR,
- FL("wlan_hdd_tdls_add_station failed!"));
+ hdd_err("wlan_hdd_tdls_add_station failed!");
return -EINVAL;
}
}
@@ -7422,7 +7612,7 @@ static int __wlan_hdd_cfg80211_add_key(struct wiphy *wiphy,
ENTER();
if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
- hddLog(LOGE, FL("Command not allowed in FTM mode"));
+ hdd_err("Command not allowed in FTM mode");
return -EINVAL;
}
@@ -7435,27 +7625,23 @@ static int __wlan_hdd_cfg80211_add_key(struct wiphy *wiphy,
if (0 != status)
return status;
- hddLog(LOG1, FL("Device_mode %s(%d)"),
+ hdd_notice("Device_mode %s(%d)",
hdd_device_mode_to_string(pAdapter->device_mode),
pAdapter->device_mode);
if (CSR_MAX_NUM_KEY <= key_index) {
- hddLog(QDF_TRACE_LEVEL_ERROR, "%s: Invalid key index %d",
- __func__, key_index);
+ hdd_err("Invalid key index %d", key_index);
return -EINVAL;
}
if (CSR_MAX_KEY_LEN < params->key_len) {
- hddLog(QDF_TRACE_LEVEL_ERROR, "%s: Invalid key length %d",
- __func__, params->key_len);
+ hdd_err("Invalid key length %d", params->key_len);
return -EINVAL;
}
- hddLog(QDF_TRACE_LEVEL_INFO,
- "%s: called with key index = %d & key length %d",
- __func__, key_index, params->key_len);
+ hdd_notice("called with key index = %d & key length %d", key_index, params->key_len);
/*extract key idx, key len and key */
qdf_mem_zero(&setKey, sizeof(tCsrRoamSetKey));
@@ -7539,32 +7725,27 @@ static int __wlan_hdd_cfg80211_add_key(struct wiphy *wiphy,
#endif
default:
- hddLog(QDF_TRACE_LEVEL_ERROR, "%s: unsupported cipher type %u",
- __func__, params->cipher);
+ hdd_err("unsupported cipher type %u", params->cipher);
return -EOPNOTSUPP;
}
- hddLog(QDF_TRACE_LEVEL_INFO_MED, "%s: encryption type %d",
- __func__, setKey.encType);
+ hdd_info("encryption type %d", setKey.encType);
if (!pairwise) {
/* set group key */
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO,
- "%s- %d: setting Broadcast key", __func__, __LINE__);
+ hdd_notice("%s- %d: setting Broadcast key", __func__, __LINE__);
setKey.keyDirection = eSIR_RX_ONLY;
qdf_set_macaddr_broadcast(&setKey.peerMac);
} else {
/* set pairwise key */
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO,
- "%s- %d: setting pairwise key", __func__, __LINE__);
+ hdd_notice("%s- %d: setting pairwise key", __func__, __LINE__);
setKey.keyDirection = eSIR_TX_RX;
qdf_mem_copy(setKey.peerMac.bytes, mac_addr, QDF_MAC_ADDR_SIZE);
}
if ((QDF_IBSS_MODE == pAdapter->device_mode) && !pairwise) {
/* if a key is already installed, block all subsequent ones */
if (pAdapter->sessionCtx.station.ibss_enc_key_installed) {
- hddLog(QDF_TRACE_LEVEL_INFO_MED,
- "%s: IBSS key installed already", __func__);
+ hdd_info("IBSS key installed already");
return 0;
}
@@ -7574,9 +7755,7 @@ static int __wlan_hdd_cfg80211_add_key(struct wiphy *wiphy,
pAdapter->sessionId, &setKey, &roamId);
if (0 != status) {
- hddLog(QDF_TRACE_LEVEL_ERROR,
- "%s: sme_roam_set_key failed, returned %d",
- __func__, status);
+ hdd_err("sme_roam_set_key failed, returned %d", status);
return -EINVAL;
}
/*Save the keys here and call sme_roam_set_key for setting
@@ -7599,9 +7778,7 @@ static int __wlan_hdd_cfg80211_add_key(struct wiphy *wiphy,
status = wlansap_set_key_sta(p_cds_context, &setKey);
#endif
if (status != QDF_STATUS_SUCCESS) {
- QDF_TRACE(QDF_MODULE_ID_HDD,
- QDF_TRACE_LEVEL_ERROR,
- "[%4d] wlansap_set_key_sta returned ERROR status= %d",
+ hdd_err("[%4d] wlansap_set_key_sta returned ERROR status= %d",
__LINE__, status);
}
}
@@ -7626,9 +7803,7 @@ static int __wlan_hdd_cfg80211_add_key(struct wiphy *wiphy,
if (!pairwise) {
/* set group key */
if (pHddStaCtx->roam_info.deferKeyComplete) {
- QDF_TRACE(QDF_MODULE_ID_HDD,
- QDF_TRACE_LEVEL_INFO,
- "%s- %d: Perform Set key Complete",
+ hdd_notice("%s- %d: Perform Set key Complete",
__func__, __LINE__);
hdd_perform_roam_set_key_complete(pAdapter);
}
@@ -7645,8 +7820,7 @@ static int __wlan_hdd_cfg80211_add_key(struct wiphy *wiphy,
pHddStaCtx->roam_info.roamingState = HDD_ROAM_STATE_SETTING_KEY;
- hddLog(LOG2,
- FL("Set key for peerMac "MAC_ADDRESS_STR" direction %d"),
+ hdd_info("Set key for peerMac "MAC_ADDRESS_STR" direction %d",
MAC_ADDR_ARRAY(setKey.peerMac.bytes),
setKey.keyDirection);
@@ -7656,12 +7830,10 @@ static int __wlan_hdd_cfg80211_add_key(struct wiphy *wiphy,
qdf_ret_status = sme_ft_update_key(WLAN_HDD_GET_HAL_CTX(pAdapter),
pAdapter->sessionId, &setKey);
if (qdf_ret_status == QDF_STATUS_FT_PREAUTH_KEY_SUCCESS) {
- hddLog(QDF_TRACE_LEVEL_INFO_MED,
- "%s: Update PreAuth Key success", __func__);
+ hdd_info("Update PreAuth Key success");
return 0;
} else if (qdf_ret_status == QDF_STATUS_FT_PREAUTH_KEY_FAILED) {
- hddLog(QDF_TRACE_LEVEL_ERROR,
- "%s: Update PreAuth Key failed", __func__);
+ hdd_err("Update PreAuth Key failed");
return -EINVAL;
}
@@ -7670,9 +7842,7 @@ static int __wlan_hdd_cfg80211_add_key(struct wiphy *wiphy,
pAdapter->sessionId, &setKey, &roamId);
if (0 != status) {
- hddLog(QDF_TRACE_LEVEL_ERROR,
- "%s: sme_roam_set_key failed, returned %d",
- __func__, status);
+ hdd_err("sme_roam_set_key failed, returned %d", status);
pHddStaCtx->roam_info.roamingState =
HDD_ROAM_STATE_NONE;
return -EINVAL;
@@ -7696,8 +7866,7 @@ static int __wlan_hdd_cfg80211_add_key(struct wiphy *wiphy,
setKey.keyDirection = eSIR_RX_ONLY;
qdf_set_macaddr_broadcast(&setKey.peerMac);
- hddLog(LOG2,
- FL("Set key peerMac "MAC_ADDRESS_STR" direction %d"),
+ hdd_info("Set key peerMac "MAC_ADDRESS_STR" direction %d",
MAC_ADDR_ARRAY(setKey.peerMac.bytes),
setKey.keyDirection);
@@ -7706,9 +7875,7 @@ static int __wlan_hdd_cfg80211_add_key(struct wiphy *wiphy,
&roamId);
if (0 != status) {
- hddLog(QDF_TRACE_LEVEL_ERROR,
- "%s: sme_roam_set_key failed for group key (IBSS), returned %d",
- __func__, status);
+ hdd_err("sme_roam_set_key failed for group key (IBSS), returned %d", status);
pHddStaCtx->roam_info.roamingState =
HDD_ROAM_STATE_NONE;
return -EINVAL;
@@ -7754,18 +7921,18 @@ static int __wlan_hdd_cfg80211_get_key(struct wiphy *wiphy,
ENTER();
if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
- hddLog(LOGE, FL("Command not allowed in FTM mode"));
+ hdd_err("Command not allowed in FTM mode");
return -EINVAL;
}
- hddLog(LOG1, FL("Device_mode %s(%d)"),
+ hdd_notice("Device_mode %s(%d)",
hdd_device_mode_to_string(pAdapter->device_mode),
pAdapter->device_mode);
memset(&params, 0, sizeof(params));
if (CSR_MAX_NUM_KEY <= key_index) {
- hddLog(QDF_TRACE_LEVEL_ERROR, FL("invalid key index %d"),
+ hdd_err("invalid key index %d",
key_index);
return -EINVAL;
}
@@ -7906,7 +8073,7 @@ static int __wlan_hdd_cfg80211_set_default_key(struct wiphy *wiphy,
ENTER();
if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
- hddLog(LOGE, FL("Command not allowed in FTM mode"));
+ hdd_err("Command not allowed in FTM mode");
return -EINVAL;
}
@@ -7914,12 +8081,12 @@ static int __wlan_hdd_cfg80211_set_default_key(struct wiphy *wiphy,
TRACE_CODE_HDD_CFG80211_SET_DEFAULT_KEY,
pAdapter->sessionId, key_index));
- hddLog(LOG1, FL("Device_mode %s(%d) key_index = %d"),
+ hdd_notice("Device_mode %s(%d) key_index = %d",
hdd_device_mode_to_string(pAdapter->device_mode),
pAdapter->device_mode, key_index);
if (CSR_MAX_NUM_KEY <= key_index) {
- hddLog(LOGE, FL("Invalid key index %d"), key_index);
+ hdd_err("Invalid key index %d", key_index);
return -EINVAL;
}
@@ -7942,7 +8109,7 @@ static int __wlan_hdd_cfg80211_set_default_key(struct wiphy *wiphy,
uint32_t roamId = 0xFF;
tCsrKeys *Keys = &pWextState->roamProfile.Keys;
- hddLog(LOG2, FL("Default tx key index %d"), key_index);
+ hdd_info("Default tx key index %d", key_index);
Keys->defaultIndex = (u8) key_index;
qdf_mem_zero(&setKey, sizeof(tCsrRoamSetKey));
@@ -7982,8 +8149,7 @@ static int __wlan_hdd_cfg80211_set_default_key(struct wiphy *wiphy,
&roamId);
if (0 != status) {
- hddLog(LOGE,
- FL("sme_roam_set_key failed, returned %d"),
+ hdd_err("sme_roam_set_key failed, returned %d",
status);
return -EINVAL;
}
@@ -8044,12 +8210,12 @@ struct cfg80211_bss *wlan_hdd_cfg80211_update_bss_list(hdd_adapter_t *pAdapter,
ENTER();
if (NULL == pBssDesc) {
- hddLog(LOGE, FL("pBssDesc is NULL"));
+ hdd_err("pBssDesc is NULL");
return bss;
}
if (NULL == pRoamInfo->pProfile) {
- hddLog(LOGE, FL("Roam profile is NULL"));
+ hdd_err("Roam profile is NULL");
return bss;
}
@@ -8068,7 +8234,7 @@ struct cfg80211_bss *wlan_hdd_cfg80211_update_bss_list(hdd_adapter_t *pAdapter,
chan = __ieee80211_get_channel(wiphy, freq);
if (!chan) {
- hddLog(LOGE, FL("chan pointer is NULL"));
+ hdd_err("chan pointer is NULL");
return NULL;
}
@@ -8082,10 +8248,10 @@ struct cfg80211_bss *wlan_hdd_cfg80211_update_bss_list(hdd_adapter_t *pAdapter,
IEEE80211_BSS_TYPE_ESS, IEEE80211_PRIVACY_ANY);
#endif
if (bss == NULL) {
- hddLog(LOGE, FL("BSS not present"));
+ hdd_err("BSS not present");
} else {
- hddLog(LOG1, FL("cfg80211_unlink_bss called for BSSID "
- MAC_ADDRESS_STR),
+ hdd_notice("cfg80211_unlink_bss called for BSSID "
+ MAC_ADDRESS_STR,
MAC_ADDR_ARRAY(pBssDesc->bssId));
cfg80211_unlink_bss(wiphy, bss);
}
@@ -8146,7 +8312,7 @@ wlan_hdd_cfg80211_inform_bss_frame(hdd_adapter_t *pAdapter,
cfg_param = pHddCtx->config;
mgmt = kzalloc((sizeof(struct ieee80211_mgmt) + ie_length), GFP_KERNEL);
if (!mgmt) {
- hddLog(LOGE, FL("memory allocation failed"));
+ hdd_err("memory allocation failed");
return NULL;
}
@@ -8199,7 +8365,7 @@ wlan_hdd_cfg80211_inform_bss_frame(hdd_adapter_t *pAdapter,
ieee80211_channel_to_frequency(chan_no,
IEEE80211_BAND_5GHZ);
} else {
- hddLog(LOGE, FL("Invalid chan_no %d"), chan_no);
+ hdd_err("Invalid chan_no %d", chan_no);
kfree(mgmt);
return NULL;
}
@@ -8227,7 +8393,7 @@ wlan_hdd_cfg80211_inform_bss_frame(hdd_adapter_t *pAdapter,
* So drop the bss and continue to next bss.
*/
if (chan == NULL) {
- hddLog(LOGE, FL("chan pointer is NULL"));
+ hdd_err("chan pointer is NULL");
kfree(mgmt);
return NULL;
}
@@ -8242,7 +8408,7 @@ wlan_hdd_cfg80211_inform_bss_frame(hdd_adapter_t *pAdapter,
/* Supplicant takes the signal strength in terms of mBm(100*dBm) */
rssi = QDF_MIN(rssi, 0) * 100;
- hddLog(LOG1, FL("BSSID: " MAC_ADDRESS_STR " Channel:%d RSSI:%d TSF %u"),
+ hdd_notice("BSSID: " MAC_ADDRESS_STR " Channel:%d RSSI:%d TSF %u",
MAC_ADDR_ARRAY(mgmt->bssid), chan->center_freq,
(int)(rssi / 100),
bss_desc->timeStamp[0]);
@@ -8278,12 +8444,11 @@ struct cfg80211_bss *wlan_hdd_cfg80211_update_bss_db(hdd_adapter_t *pAdapter,
roamProfile.pBssDesc);
if (NULL == bss)
- hddLog(LOG1,
- FL("wlan_hdd_cfg80211_inform_bss_frame returned NULL"));
+ hdd_notice("wlan_hdd_cfg80211_inform_bss_frame returned NULL");
sme_roam_free_connect_profile(&roamProfile);
} else {
- hddLog(LOGE, FL("roamProfile.pBssDesc is NULL"));
+ hdd_err("roamProfile.pBssDesc is NULL");
}
return bss;
}
@@ -8323,7 +8488,7 @@ int wlan_hdd_cfg80211_update_bss(struct wiphy *wiphy,
/* no scan results */
if (NULL == pResult) {
- hddLog(LOGE, FL("No scan result Status %d"), status);
+ hdd_err("No scan result Status %d", status);
return status;
}
@@ -8401,15 +8566,15 @@ int wlan_hdd_cfg80211_pmksa_candidate_notify(hdd_adapter_t *pAdapter,
hdd_context_t *pHddCtx = (hdd_context_t *) pAdapter->pHddCtx;
ENTER();
- hddLog(LOG1, FL("is going to notify supplicant of:"));
+ hdd_notice("is going to notify supplicant of:");
if (NULL == pRoamInfo) {
- hddLog(LOGP, FL("pRoamInfo is NULL"));
+ hdd_alert("pRoamInfo is NULL");
return -EINVAL;
}
if (true == hdd_is_okc_mode_enabled(pHddCtx)) {
- hddLog(LOG1, MAC_ADDRESS_STR,
+ hdd_notice(MAC_ADDRESS_STR,
MAC_ADDR_ARRAY(pRoamInfo->bssid.bytes));
cfg80211_pmksa_candidate_notify(dev, index,
pRoamInfo->bssid.bytes,
@@ -8439,7 +8604,7 @@ QDF_STATUS wlan_hdd_cfg80211_roam_metrics_preauth(hdd_adapter_t *pAdapter,
ENTER();
if (NULL == pAdapter) {
- hddLog(LOGE, FL("pAdapter is NULL!"));
+ hdd_err("pAdapter is NULL!");
return QDF_STATUS_E_FAILURE;
}
@@ -8482,7 +8647,7 @@ wlan_hdd_cfg80211_roam_metrics_preauth_status(hdd_adapter_t *pAdapter,
ENTER();
if (NULL == pAdapter) {
- hddLog(LOGE, FL("pAdapter is NULL!"));
+ hdd_err("pAdapter is NULL!");
return QDF_STATUS_E_FAILURE;
}
@@ -8530,7 +8695,7 @@ QDF_STATUS wlan_hdd_cfg80211_roam_metrics_handover(hdd_adapter_t *pAdapter,
ENTER();
if (NULL == pAdapter) {
- hddLog(LOGE, FL("pAdapter is NULL!"));
+ hdd_err("pAdapter is NULL!");
return QDF_STATUS_E_FAILURE;
}
@@ -8573,7 +8738,7 @@ void hdd_select_cbmode(hdd_adapter_t *pAdapter, uint8_t operationChannel)
ch_params.ch_width =
(WLAN_HDD_GET_CTX(pAdapter))->config->vhtChannelWidth;
- hddLog(LOG1, FL("Channel Bonding Mode Selected is %u"), iniDot11Mode);
+ hdd_notice("Channel Bonding Mode Selected is %u", iniDot11Mode);
switch (iniDot11Mode) {
case eHDD_DOT11_MODE_AUTO:
case eHDD_DOT11_MODE_11ac:
@@ -8755,7 +8920,7 @@ int wlan_hdd_cfg80211_connect_start(hdd_adapter_t *pAdapter,
return status;
if (SIR_MAC_MAX_SSID_LENGTH < ssid_len) {
- hddLog(LOGE, FL("wrong SSID len"));
+ hdd_err("wrong SSID len");
return -EINVAL;
}
@@ -8803,14 +8968,14 @@ int wlan_hdd_cfg80211_connect_start(hdd_adapter_t *pAdapter,
*/
qdf_mem_copy((void *)(pWextState->req_bssId.bytes),
bssid_hint, QDF_MAC_ADDR_SIZE);
- hddLog(LOGW, FL(" bssid_hint "MAC_ADDRESS_STR),
+ hdd_warn(" bssid_hint "MAC_ADDRESS_STR,
MAC_ADDR_ARRAY(bssid_hint));
} else {
qdf_mem_zero((void *)(pRoamProfile->BSSIDs.bssid),
QDF_MAC_ADDR_SIZE);
}
- hddLog(LOG1, FL("Connect to SSID: %.*s operating Channel: %u"),
+ hdd_notice("Connect to SSID: %.*s operating Channel: %u",
pRoamProfile->SSIDs.SSIDList->SSID.length,
pRoamProfile->SSIDs.SSIDList->SSID.ssId,
operatingChannel);
@@ -8824,13 +8989,11 @@ int wlan_hdd_cfg80211_connect_start(hdd_adapter_t *pAdapter,
}
#ifdef FEATURE_WLAN_WAPI
if (pAdapter->wapi_info.nWapiMode) {
- hddLog(LOG1,
- FL("Setting WAPI AUTH Type and Encryption Mode values"));
+ hdd_notice("Setting WAPI AUTH Type and Encryption Mode values");
switch (pAdapter->wapi_info.wapiAuthMode) {
case WAPI_AUTH_MODE_PSK:
{
- hddLog(LOG1,
- FL("WAPI AUTH TYPE: PSK: %d"),
+ hdd_notice("WAPI AUTH TYPE: PSK: %d",
pAdapter->wapi_info.wapiAuthMode);
pRoamProfile->AuthType.authType[0] =
eCSR_AUTH_TYPE_WAPI_WAI_PSK;
@@ -8838,8 +9001,7 @@ int wlan_hdd_cfg80211_connect_start(hdd_adapter_t *pAdapter,
}
case WAPI_AUTH_MODE_CERT:
{
- hddLog(LOG1,
- FL("WAPI AUTH TYPE: CERT: %d"),
+ hdd_notice("WAPI AUTH TYPE: CERT: %d",
pAdapter->wapi_info.wapiAuthMode);
pRoamProfile->AuthType.authType[0] =
eCSR_AUTH_TYPE_WAPI_WAI_CERTIFICATE;
@@ -8850,8 +9012,7 @@ int wlan_hdd_cfg80211_connect_start(hdd_adapter_t *pAdapter,
WAPI_AUTH_MODE_PSK
|| pAdapter->wapi_info.wapiAuthMode ==
WAPI_AUTH_MODE_CERT) {
- hddLog(LOG1,
- FL("WAPI PAIRWISE/GROUP ENCRYPTION: WPI"));
+ hdd_notice("WAPI PAIRWISE/GROUP ENCRYPTION: WPI");
pRoamProfile->AuthType.numEntries = 1;
pRoamProfile->EncryptionType.numEntries = 1;
pRoamProfile->EncryptionType.encryptionType[0] =
@@ -8893,15 +9054,13 @@ int wlan_hdd_cfg80211_connect_start(hdd_adapter_t *pAdapter,
status = hdd_set_ibss_power_save_params(pAdapter);
if (QDF_STATUS_SUCCESS != status) {
- hddLog(LOGE,
- FL("Set IBSS Power Save Params Failed"));
+ hdd_err("Set IBSS Power Save Params Failed");
return -EINVAL;
}
hdd_select_cbmode(pAdapter, operatingChannel);
}
- if (pHddCtx->config->policy_manager_enabled &&
- (true == cds_is_connection_in_progress())) {
+ if (true == cds_is_connection_in_progress()) {
hdd_err("Connection refused: conn in progress");
return -EINVAL;
}
@@ -8925,14 +9084,14 @@ int wlan_hdd_cfg80211_connect_start(hdd_adapter_t *pAdapter,
* When policy manager is enabled from ini file, we shouldn't
* check for other concurrency rules.
*/
- if (!pHddCtx->config->policy_manager_enabled) {
+ if (wma_is_hw_dbs_capable() == false) {
cds_handle_conc_rule1(pAdapter, pRoamProfile);
if (true != cds_handle_conc_rule2(
pAdapter, pRoamProfile, &roamId))
return 0;
}
- if (pHddCtx->config->policy_manager_enabled &&
+ if ((wma_is_hw_dbs_capable() == true) &&
(false == wlan_hdd_handle_sap_sta_dfs_conc(pAdapter,
pRoamProfile))) {
hdd_err("sap-sta conc will fail, can't allow sta");
@@ -8993,9 +9152,8 @@ int wlan_hdd_cfg80211_connect_start(hdd_adapter_t *pAdapter,
if ((QDF_STATUS_SUCCESS != status) &&
(QDF_STA_MODE == pAdapter->device_mode ||
QDF_P2P_CLIENT_MODE == pAdapter->device_mode)) {
- hddLog(LOGE,
- FL("sme_roam_connect (session %d) failed with "
- "status %d. -> NotConnected"),
+ hdd_err("sme_roam_connect (session %d) failed with "
+ "status %d. -> NotConnected",
pAdapter->sessionId, status);
/* change back to NotAssociated */
hdd_conn_set_connection_state(pAdapter,
@@ -9006,7 +9164,7 @@ int wlan_hdd_cfg80211_connect_start(hdd_adapter_t *pAdapter,
pRoamProfile->ChannelInfo.numOfChannels = 0;
} else {
- hddLog(LOGE, FL("No valid Roam profile"));
+ hdd_err("No valid Roam profile");
return -EINVAL;
}
EXIT();
@@ -9031,34 +9189,29 @@ static int wlan_hdd_cfg80211_set_auth_type(hdd_adapter_t *pAdapter,
/*set authentication type */
switch (auth_type) {
case NL80211_AUTHTYPE_AUTOMATIC:
- hddLog(LOG1,
- FL("set authentication type to AUTOSWITCH"));
+ hdd_notice("set authentication type to AUTOSWITCH");
pHddStaCtx->conn_info.authType = eCSR_AUTH_TYPE_AUTOSWITCH;
break;
case NL80211_AUTHTYPE_OPEN_SYSTEM:
case NL80211_AUTHTYPE_FT:
- hddLog(LOG1,
- FL("set authentication type to OPEN"));
+ hdd_notice("set authentication type to OPEN");
pHddStaCtx->conn_info.authType = eCSR_AUTH_TYPE_OPEN_SYSTEM;
break;
case NL80211_AUTHTYPE_SHARED_KEY:
- hddLog(LOG1,
- FL("set authentication type to SHARED"));
+ hdd_notice("set authentication type to SHARED");
pHddStaCtx->conn_info.authType = eCSR_AUTH_TYPE_SHARED_KEY;
break;
#ifdef FEATURE_WLAN_ESE
case NL80211_AUTHTYPE_NETWORK_EAP:
- hddLog(LOG1,
- FL("set authentication type to CCKM WPA"));
+ hdd_notice("set authentication type to CCKM WPA");
pHddStaCtx->conn_info.authType = eCSR_AUTH_TYPE_CCKM_WPA;
break;
#endif
default:
- hddLog(LOGE,
- FL("Unsupported authentication type %d"), auth_type);
+ hdd_err("Unsupported authentication type %d", auth_type);
pHddStaCtx->conn_info.authType = eCSR_AUTH_TYPE_UNKNOWN;
return -EINVAL;
}
@@ -9088,23 +9241,21 @@ static int wlan_hdd_set_akm_suite(hdd_adapter_t *pAdapter, u32 key_mgmt)
case WLAN_AKM_SUITE_PSK:
case WLAN_AKM_SUITE_PSK_SHA256:
case WLAN_AKM_SUITE_FT_PSK:
- hddLog(LOG1, FL("setting key mgmt type to PSK"));
+ hdd_notice("setting key mgmt type to PSK");
pWextState->authKeyMgmt |= IW_AUTH_KEY_MGMT_PSK;
break;
case WLAN_AKM_SUITE_8021X_SHA256:
case WLAN_AKM_SUITE_8021X:
case WLAN_AKM_SUITE_FT_8021X:
- hddLog(LOG1,
- FL("setting key mgmt type to 8021x"));
+ hdd_notice("setting key mgmt type to 8021x");
pWextState->authKeyMgmt |= IW_AUTH_KEY_MGMT_802_1X;
break;
#ifdef FEATURE_WLAN_ESE
#define WLAN_AKM_SUITE_CCKM 0x00409600 /* Should be in ieee802_11_defs.h */
#define IW_AUTH_KEY_MGMT_CCKM 8 /* Should be in linux/wireless.h */
case WLAN_AKM_SUITE_CCKM:
- hddLog(LOG1,
- FL("setting key mgmt type to CCKM"));
+ hdd_notice("setting key mgmt type to CCKM");
pWextState->authKeyMgmt |= IW_AUTH_KEY_MGMT_CCKM;
break;
#endif
@@ -9112,14 +9263,12 @@ static int wlan_hdd_set_akm_suite(hdd_adapter_t *pAdapter, u32 key_mgmt)
#define WLAN_AKM_SUITE_OSEN 0x506f9a01 /* Should be in ieee802_11_defs.h */
#endif
case WLAN_AKM_SUITE_OSEN:
- hddLog(LOG1,
- FL("setting key mgmt type to OSEN"));
+ hdd_notice("setting key mgmt type to OSEN");
pWextState->authKeyMgmt |= IW_AUTH_KEY_MGMT_802_1X;
break;
default:
- hddLog(LOGE,
- FL("Unsupported key mgmt type %d"), key_mgmt);
+ hdd_err("Unsupported key mgmt type %d", key_mgmt);
return -EINVAL;
}
@@ -9187,22 +9336,19 @@ static int wlan_hdd_cfg80211_set_cipher(hdd_adapter_t *pAdapter,
#endif
#endif
default:
- hddLog(LOGE,
- FL("Unsupported cipher type %d"), cipher);
+ hdd_err("Unsupported cipher type %d", cipher);
return -EOPNOTSUPP;
}
}
if (ucast) {
- hddLog(LOG1,
- FL("setting unicast cipher type to %d"), encryptionType);
+ hdd_notice("setting unicast cipher type to %d", encryptionType);
pHddStaCtx->conn_info.ucEncryptionType = encryptionType;
pWextState->roamProfile.EncryptionType.numEntries = 1;
pWextState->roamProfile.EncryptionType.encryptionType[0] =
encryptionType;
} else {
- hddLog(LOG1,
- FL("setting mcast cipher type to %d"), encryptionType);
+ hdd_notice("setting mcast cipher type to %d", encryptionType);
pHddStaCtx->conn_info.mcEncryptionType = encryptionType;
pWextState->roamProfile.mcEncryptionType.numEntries = 1;
pWextState->roamProfile.mcEncryptionType.encryptionType[0] =
@@ -9245,24 +9391,22 @@ int wlan_hdd_cfg80211_set_ie(hdd_adapter_t *pAdapter, const uint8_t *ie,
eLen = *genie++;
remLen -= 2;
- hddLog(LOG1, FL("IE[0x%X], LEN[%d]"), elementId, eLen);
+ hdd_notice("IE[0x%X], LEN[%d]", elementId, eLen);
switch (elementId) {
case DOT11F_EID_WPA:
if (4 > eLen) { /* should have at least OUI which is 4 bytes so extra 2 bytes not needed */
- hddLog(LOGE, FL("Invalid WPA IE"));
+ hdd_err("Invalid WPA IE");
return -EINVAL;
} else if (0 ==
memcmp(&genie[0], "\x00\x50\xf2\x04", 4)) {
uint16_t curAddIELen =
pWextState->assocAddIE.length;
- hddLog(LOG1,
- FL("Set WPS IE(len %d)"), eLen + 2);
+ hdd_notice("Set WPS IE(len %d)", eLen + 2);
if (SIR_MAC_MAX_ADD_IE_LENGTH <
(pWextState->assocAddIE.length + eLen)) {
- hddLog(LOGE,
- FL("Cannot accommodate assocAddIE. Need bigger buffer space"));
+ hdd_err("Cannot accommodate assocAddIE. Need bigger buffer space");
QDF_ASSERT(0);
return -ENOMEM;
}
@@ -9277,8 +9421,7 @@ int wlan_hdd_cfg80211_set_ie(hdd_adapter_t *pAdapter, const uint8_t *ie,
pWextState->roamProfile.nAddIEAssocLength =
pWextState->assocAddIE.length;
} else if (0 == memcmp(&genie[0], "\x00\x50\xf2", 3)) {
- hddLog(LOG1,
- FL("Set WPA IE (len %d)"), eLen + 2);
+ hdd_notice("Set WPA IE (len %d)", eLen + 2);
memset(pWextState->WPARSNIE, 0,
MAX_WPA_RSN_IE_LEN);
memcpy(pWextState->WPARSNIE, genie - 2,
@@ -9290,13 +9433,11 @@ int wlan_hdd_cfg80211_set_ie(hdd_adapter_t *pAdapter, const uint8_t *ie,
P2P_OUI_TYPE_SIZE))) {
uint16_t curAddIELen =
pWextState->assocAddIE.length;
- hddLog(LOG1,
- FL("Set P2P IE(len %d)"), eLen + 2);
+ hdd_notice("Set P2P IE(len %d)", eLen + 2);
if (SIR_MAC_MAX_ADD_IE_LENGTH <
(pWextState->assocAddIE.length + eLen)) {
- hddLog(LOGE,
- FL("Cannot accommodate assocAddIE Need bigger buffer space"));
+ hdd_err("Cannot accommodate assocAddIE Need bigger buffer space");
QDF_ASSERT(0);
return -ENOMEM;
}
@@ -9318,13 +9459,11 @@ int wlan_hdd_cfg80211_set_ie(hdd_adapter_t *pAdapter, const uint8_t *ie,
pAdapter->device_mode)) {
uint16_t curAddIELen =
pWextState->assocAddIE.length;
- hddLog(LOG1,
- FL("Set WFD IE(len %d)"), eLen + 2);
+ hdd_notice("Set WFD IE(len %d)", eLen + 2);
if (SIR_MAC_MAX_ADD_IE_LENGTH <
(pWextState->assocAddIE.length + eLen)) {
- hddLog(LOGE,
- FL("Cannot accommodate assocAddIE Need bigger buffer space"));
+ hdd_err("Cannot accommodate assocAddIE Need bigger buffer space");
QDF_ASSERT(0);
return -ENOMEM;
}
@@ -9346,13 +9485,11 @@ int wlan_hdd_cfg80211_set_ie(hdd_adapter_t *pAdapter, const uint8_t *ie,
HS20_OUI_TYPE_SIZE))) {
uint16_t curAddIELen =
pWextState->assocAddIE.length;
- hddLog(LOG1,
- FL("Set HS20 IE(len %d)"), eLen + 2);
+ hdd_notice("Set HS20 IE(len %d)", eLen + 2);
if (SIR_MAC_MAX_ADD_IE_LENGTH <
(pWextState->assocAddIE.length + eLen)) {
- hddLog(LOGE,
- FL("Cannot accommodate assocAddIE Need bigger buffer space"));
+ hdd_err("Cannot accommodate assocAddIE Need bigger buffer space");
QDF_ASSERT(0);
return -ENOMEM;
}
@@ -9370,13 +9507,11 @@ int wlan_hdd_cfg80211_set_ie(hdd_adapter_t *pAdapter, const uint8_t *ie,
OSEN_OUI_TYPE_SIZE))) {
uint16_t curAddIELen =
pWextState->assocAddIE.length;
- hddLog(LOG1,
- FL("Set OSEN IE(len %d)"), eLen + 2);
+ hdd_notice("Set OSEN IE(len %d)", eLen + 2);
if (SIR_MAC_MAX_ADD_IE_LENGTH <
(pWextState->assocAddIE.length + eLen)) {
- hddLog(LOGE,
- FL("Cannot accommodate assocAddIE Need bigger buffer space"));
+ hdd_err("Cannot accommodate assocAddIE Need bigger buffer space");
QDF_ASSERT(0);
return -ENOMEM;
}
@@ -9413,7 +9548,7 @@ int wlan_hdd_cfg80211_set_ie(hdd_adapter_t *pAdapter, const uint8_t *ie,
}
break;
case DOT11F_EID_RSN:
- hddLog(LOG1, FL("Set RSN IE(len %d)"), eLen + 2);
+ hdd_notice("Set RSN IE(len %d)", eLen + 2);
memset(pWextState->WPARSNIE, 0, MAX_WPA_RSN_IE_LEN);
memcpy(pWextState->WPARSNIE, genie - 2,
(eLen + 2));
@@ -9436,12 +9571,11 @@ int wlan_hdd_cfg80211_set_ie(hdd_adapter_t *pAdapter, const uint8_t *ie,
{
uint16_t curAddIELen =
pWextState->assocAddIE.length;
- hddLog(LOG1,
- FL("Set Extended CAPS IE(len %d)"), eLen + 2);
+ hdd_notice("Set Extended CAPS IE(len %d)", eLen + 2);
if (SIR_MAC_MAX_ADD_IE_LENGTH <
(pWextState->assocAddIE.length + eLen)) {
- hddLog(LOGE, FL("Cannot accommodate assocAddIE Need bigger buffer space"));
+ hdd_err("Cannot accommodate assocAddIE Need bigger buffer space");
QDF_ASSERT(0);
return -ENOMEM;
}
@@ -9459,8 +9593,7 @@ int wlan_hdd_cfg80211_set_ie(hdd_adapter_t *pAdapter, const uint8_t *ie,
case WLAN_EID_WAPI:
/* Setting WAPI Mode to ON=1 */
pAdapter->wapi_info.nWapiMode = 1;
- hddLog(LOG1,
- FL("WAPI MODE IS %u"), pAdapter->wapi_info.nWapiMode);
+ hdd_notice("WAPI MODE IS %u", pAdapter->wapi_info.nWapiMode);
tmp = (u16 *) ie;
tmp = tmp + 2; /* Skip element Id and Len, Version */
akmsuiteCount = WPA_GET_LE16(tmp);
@@ -9469,29 +9602,25 @@ int wlan_hdd_cfg80211_set_ie(hdd_adapter_t *pAdapter, const uint8_t *ie,
if (akmsuiteCount <= MAX_NUM_AKM_SUITES) {
memcpy(akmsuite, akmlist, (4 * akmsuiteCount));
} else {
- hddLog(LOGE,
- FL("Invalid akmSuite count"));
+ hdd_err("Invalid akmSuite count");
QDF_ASSERT(0);
return -EINVAL;
}
if (WAPI_PSK_AKM_SUITE == akmsuite[0]) {
- hddLog(LOG1,
- FL("WAPI AUTH MODE SET TO PSK"));
+ hdd_notice("WAPI AUTH MODE SET TO PSK");
pAdapter->wapi_info.wapiAuthMode =
WAPI_AUTH_MODE_PSK;
}
if (WAPI_CERT_AKM_SUITE == akmsuite[0]) {
- hddLog(LOG1,
- FL("WAPI AUTH MODE SET TO CERTIFICATE"));
+ hdd_notice("WAPI AUTH MODE SET TO CERTIFICATE");
pAdapter->wapi_info.wapiAuthMode =
WAPI_AUTH_MODE_CERT;
}
break;
#endif
default:
- hddLog(LOGE,
- FL("Set UNKNOWN IE %X"), elementId);
+ hdd_err("Set UNKNOWN IE %X", elementId);
/* when Unknown IE is received we should break and continue
* to the next IE in the buffer instead we were returning
* so changing this to break */
@@ -9523,8 +9652,7 @@ static bool hdd_is_wpaie_present(const uint8_t *ie, uint8_t ie_len)
eLen = *ie++;
remLen -= 2;
if (eLen > remLen) {
- hddLog(QDF_TRACE_LEVEL_ERROR,
- "%s: IE length is wrong %d", __func__, eLen);
+ hdd_err("IE length is wrong %d", eLen);
return false;
}
if ((elementId == DOT11F_EID_WPA) && (remLen > 5)) {
@@ -9566,13 +9694,13 @@ int wlan_hdd_cfg80211_set_privacy(hdd_adapter_t *pAdapter,
}
}
- hddLog(LOG1, FL("set wpa version to %d"), pWextState->wpaVersion);
+ hdd_notice("set wpa version to %d", pWextState->wpaVersion);
/*set authentication type */
status = wlan_hdd_cfg80211_set_auth_type(pAdapter, req->auth_type);
if (0 > status) {
- hddLog(LOGE, FL("failed to set authentication type "));
+ hdd_err("failed to set authentication type ");
return status;
}
@@ -9581,7 +9709,7 @@ int wlan_hdd_cfg80211_set_privacy(hdd_adapter_t *pAdapter,
status =
wlan_hdd_set_akm_suite(pAdapter, req->crypto.akm_suites[0]);
if (0 > status) {
- hddLog(LOGE, FL("failed to set akm suite"));
+ hdd_err("failed to set akm suite");
return status;
}
}
@@ -9593,14 +9721,14 @@ int wlan_hdd_cfg80211_set_privacy(hdd_adapter_t *pAdapter,
ciphers_pairwise[0],
true);
if (0 > status) {
- hddLog(LOGE, FL("failed to set unicast cipher type"));
+ hdd_err("failed to set unicast cipher type");
return status;
}
} else {
/*Reset previous cipher suite to none */
status = wlan_hdd_cfg80211_set_cipher(pAdapter, 0, true);
if (0 > status) {
- hddLog(LOGE, FL("failed to set unicast cipher type"));
+ hdd_err("failed to set unicast cipher type");
return status;
}
}
@@ -9611,7 +9739,7 @@ int wlan_hdd_cfg80211_set_privacy(hdd_adapter_t *pAdapter,
false);
if (0 > status) {
- hddLog(LOGE, FL("failed to set mcast cipher type"));
+ hdd_err("failed to set mcast cipher type");
return status;
}
#ifdef WLAN_FEATURE_11W
@@ -9623,7 +9751,7 @@ int wlan_hdd_cfg80211_set_privacy(hdd_adapter_t *pAdapter,
status =
wlan_hdd_cfg80211_set_ie(pAdapter, req->ie, req->ie_len);
if (0 > status) {
- hddLog(LOGE, FL("failed to parse the WPA/RSN IE"));
+ hdd_err("failed to parse the WPA/RSN IE");
return status;
}
}
@@ -9638,8 +9766,7 @@ int wlan_hdd_cfg80211_set_privacy(hdd_adapter_t *pAdapter,
==
(pWextState->
authKeyMgmt & IW_AUTH_KEY_MGMT_802_1X)) {
- hddLog(LOGE,
- FL("Dynamic WEP not supported"));
+ hdd_err("Dynamic WEP not supported");
return -EOPNOTSUPP;
} else {
u8 key_len = req->key_len;
@@ -9649,8 +9776,7 @@ int wlan_hdd_cfg80211_set_privacy(hdd_adapter_t *pAdapter,
key_len)
&& (CSR_MAX_NUM_KEY > key_idx)
) {
- hddLog(LOG1,
- FL("setting default wep key, key_idx = %hu key_len %hu"),
+ hdd_notice("setting default wep key, key_idx = %hu key_len %hu",
key_idx, key_len);
qdf_mem_copy(&pWextState->roamProfile.
Keys.
@@ -9765,20 +9891,20 @@ static int __wlan_hdd_cfg80211_connect(struct wiphy *wiphy,
ENTER();
if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
- hddLog(LOGE, FL("Command not allowed in FTM mode"));
+ hdd_err("Command not allowed in FTM mode");
return -EINVAL;
}
MTRACE(qdf_trace(QDF_MODULE_ID_HDD,
TRACE_CODE_HDD_CFG80211_CONNECT,
pAdapter->sessionId, pAdapter->device_mode));
- hddLog(LOG1, FL("Device_mode %s(%d)"),
+ hdd_notice("Device_mode %s(%d)",
hdd_device_mode_to_string(pAdapter->device_mode),
pAdapter->device_mode);
if (pAdapter->device_mode != QDF_STA_MODE &&
pAdapter->device_mode != QDF_P2P_CLIENT_MODE) {
- hddLog(LOGE, FL("Device_mode %s(%d) is not supported"),
+ hdd_err("Device_mode %s(%d) is not supported",
hdd_device_mode_to_string(pAdapter->device_mode),
pAdapter->device_mode);
return -EINVAL;
@@ -9786,7 +9912,7 @@ static int __wlan_hdd_cfg80211_connect(struct wiphy *wiphy,
pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
if (!pHddCtx) {
- hddLog(LOGE, FL("HDD context is null"));
+ hdd_err("HDD context is null");
return -EINVAL;
}
@@ -9814,8 +9940,7 @@ static int __wlan_hdd_cfg80211_connect(struct wiphy *wiphy,
/*Try disconnecting if already in connected state */
status = wlan_hdd_try_disconnect(pAdapter);
if (0 > status) {
- hddLog(LOGE,
- FL("Failed to disconnect the existing connection"));
+ hdd_err("Failed to disconnect the existing connection");
return -EALREADY;
}
@@ -9823,8 +9948,7 @@ static int __wlan_hdd_cfg80211_connect(struct wiphy *wiphy,
status = wlan_hdd_cfg80211_set_privacy(pAdapter, req);
if (0 > status) {
- hddLog(LOGE,
- FL("failed to set security params"));
+ hdd_err("failed to set security params");
return status;
}
@@ -9836,7 +9960,7 @@ static int __wlan_hdd_cfg80211_connect(struct wiphy *wiphy,
req->ssid_len, req->bssid,
bssid_hint, channel);
if (0 > status) {
- hddLog(LOGE, FL("connect failed"));
+ hdd_err("connect failed");
return status;
}
EXIT();
@@ -9887,11 +10011,10 @@ int wlan_hdd_disconnect(hdd_adapter_t *pAdapter, u16 reason)
return status;
/*stop tx queues */
- hddLog(LOG1, FL("Disabling queues"));
+ hdd_notice("Disabling queues");
wlan_hdd_netif_queue_control(pAdapter, WLAN_NETIF_TX_DISABLE_N_CARRIER,
WLAN_CONTROL_PATH);
- hddLog(LOG1,
- FL("Set HDD connState to eConnectionState_Disconnecting"));
+ hdd_notice("Set HDD connState to eConnectionState_Disconnecting");
pHddStaCtx->conn_info.connState = eConnectionState_Disconnecting;
INIT_COMPLETION(pAdapter->disconnect_comp_var);
@@ -9908,8 +10031,7 @@ int wlan_hdd_disconnect(hdd_adapter_t *pAdapter, u16 reason)
if (QDF_STATUS_CMD_NOT_QUEUED == status) {
hdd_info("Already disconnected or connect was in sme/roam pending list and removed by disconnect");
} else if (0 != status) {
- hddLog(LOGE,
- FL("csr_roam_disconnect failure, returned %d"),
+ hdd_err("csr_roam_disconnect failure, returned %d",
(int)status);
pHddStaCtx->staDebugState = status;
result = -EINVAL;
@@ -9920,8 +10042,7 @@ int wlan_hdd_disconnect(hdd_adapter_t *pAdapter, u16 reason)
(WLAN_WAIT_TIME_DISCONNECT));
if (!rc && (QDF_STATUS_CMD_NOT_QUEUED != status)) {
- hddLog(LOGE,
- FL("Failed to disconnect, timed out"));
+ hdd_err("Failed to disconnect, timed out");
result = -ETIMEDOUT;
}
disconnected:
@@ -9930,7 +10051,7 @@ disconnected:
/* Sending disconnect event to userspace for kernel version < 3.11
* is handled by __cfg80211_disconnect call to __cfg80211_disconnected
*/
- hddLog(LOG1, FL("Send disconnected event to userspace"));
+ hdd_notice("Send disconnected event to userspace");
wlan_hdd_cfg80211_indicate_disconnect(pAdapter->dev, true,
WLAN_REASON_UNSPECIFIED);
#endif
@@ -10026,14 +10147,14 @@ static int __wlan_hdd_cfg80211_disconnect(struct wiphy *wiphy,
ENTER();
if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
- hddLog(LOGE, FL("Command not allowed in FTM mode"));
+ hdd_err("Command not allowed in FTM mode");
return -EINVAL;
}
MTRACE(qdf_trace(QDF_MODULE_ID_HDD,
TRACE_CODE_HDD_CFG80211_DISCONNECT,
pAdapter->sessionId, reason));
- hddLog(LOG1, FL("Device_mode %s(%d) reason code(%d)"),
+ hdd_notice("Device_mode %s(%d) reason code(%d)",
hdd_device_mode_to_string(pAdapter->device_mode),
pAdapter->device_mode, reason);
@@ -10079,13 +10200,11 @@ static int __wlan_hdd_cfg80211_disconnect(struct wiphy *wiphy,
reasonCode = eCSR_DISCONNECT_REASON_UNSPECIFIED;
break;
}
- hddLog(LOG1,
- FL("convert to internal reason %d to reasonCode %d"),
+ hdd_notice("convert to internal reason %d to reasonCode %d",
reason, reasonCode);
pScanInfo = &pAdapter->scan_info;
if (pScanInfo->mScanPending) {
- hddLog(LOG1,
- FL("Disconnect is in progress, Aborting Scan"));
+ hdd_notice("Disconnect is in progress, Aborting Scan");
hdd_abort_mac_scan(pHddCtx, pAdapter->sessionId,
eCSR_SCAN_ABORT_DEFAULT);
}
@@ -10098,9 +10217,8 @@ static int __wlan_hdd_cfg80211_disconnect(struct wiphy *wiphy,
uint8_t *mac;
mac =
pHddCtx->tdlsConnInfo[staIdx].peerMac.bytes;
- hddLog(LOG1,
- "%s: call sme_delete_tdls_peer_sta staId %d sessionId %d "
- MAC_ADDRESS_STR, __func__,
+ hdd_notice("call sme_delete_tdls_peer_sta staId %d sessionId %d "
+ MAC_ADDRESS_STR,
pHddCtx->tdlsConnInfo[staIdx].staId,
pAdapter->sessionId,
MAC_ADDR_ARRAY(mac));
@@ -10110,19 +10228,17 @@ static int __wlan_hdd_cfg80211_disconnect(struct wiphy *wiphy,
}
}
#endif
- hddLog(LOG1, FL("Disconnecting with reasoncode:%u"),
+ hdd_notice("Disconnecting with reasoncode:%u",
reasonCode);
hdd_info("Disconnect request from user space with reason: %s",
hdd_ieee80211_reason_code_to_str(reason));
status = wlan_hdd_disconnect(pAdapter, reasonCode);
if (0 != status) {
- hddLog(LOGE,
- FL("failure, returned %d"), status);
+ hdd_err("failure, returned %d", status);
return -EINVAL;
}
} else {
- hddLog(LOGE,
- FL("unexpected cfg disconnect called while in state (%d)"),
+ hdd_err("unexpected cfg disconnect called while in state (%d)",
pHddStaCtx->conn_info.connState);
}
@@ -10207,7 +10323,7 @@ static int wlan_hdd_cfg80211_set_privacy_ibss(hdd_adapter_t *pAdapter,
params->ie_len);
if (0 > status) {
- hddLog(LOGE, FL("failed to parse WPA/RSN IE"));
+ hdd_err("failed to parse WPA/RSN IE");
return status;
}
}
@@ -10226,7 +10342,7 @@ static int wlan_hdd_cfg80211_set_privacy_ibss(hdd_adapter_t *pAdapter,
encryptionType = eCSR_ENCRYPT_TYPE_WEP40_STATICKEY;
}
- hddLog(LOG2, FL("encryptionType=%d"), encryptionType);
+ hdd_info("encryptionType=%d", encryptionType);
pHddStaCtx->conn_info.ucEncryptionType = encryptionType;
pWextState->roamProfile.EncryptionType.numEntries = 1;
pWextState->roamProfile.EncryptionType.encryptionType[0] =
@@ -10260,14 +10376,14 @@ static int __wlan_hdd_cfg80211_join_ibss(struct wiphy *wiphy,
ENTER();
if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
- hddLog(LOGE, FL("Command not allowed in FTM mode"));
+ hdd_err("Command not allowed in FTM mode");
return -EINVAL;
}
MTRACE(qdf_trace(QDF_MODULE_ID_HDD,
TRACE_CODE_HDD_CFG80211_JOIN_IBSS,
pAdapter->sessionId, pAdapter->device_mode));
- hddLog(LOG1, FL("Device_mode %s(%d)"),
+ hdd_notice("Device_mode %s(%d)",
hdd_device_mode_to_string(pAdapter->device_mode),
pAdapter->device_mode);
@@ -10292,7 +10408,7 @@ static int __wlan_hdd_cfg80211_join_ibss(struct wiphy *wiphy,
if (0 != sme_cfg_get_str(hHal, WNI_CFG_VALID_CHANNEL_LIST,
validChan, &numChans)) {
- hddLog(LOGE, FL("No valid channel list"));
+ hdd_err("No valid channel list");
return -EOPNOTSUPP;
}
@@ -10302,8 +10418,7 @@ static int __wlan_hdd_cfg80211_join_ibss(struct wiphy *wiphy,
}
}
if (indx >= numChans) {
- hddLog(LOGE,
- FL("Not valid Channel %d"), channelNum);
+ hdd_err("Not valid Channel %d", channelNum);
return -EINVAL;
}
}
@@ -10313,41 +10428,38 @@ static int __wlan_hdd_cfg80211_join_ibss(struct wiphy *wiphy,
hdd_err("This concurrency combination is not allowed");
return -ECONNREFUSED;
}
- if (pHddCtx->config->policy_manager_enabled) {
- status = qdf_reset_connection_update();
- if (!QDF_IS_STATUS_SUCCESS(status))
- hdd_err("ERR: clear event failed");
- status = cds_current_connections_update(pAdapter->sessionId,
- channelNum,
- SIR_UPDATE_REASON_JOIN_IBSS);
- if (QDF_STATUS_E_FAILURE == status) {
- hdd_err("ERROR: connections update failed!!");
- return -EINVAL;
- }
+ status = qdf_reset_connection_update();
+ if (!QDF_IS_STATUS_SUCCESS(status))
+ hdd_err("ERR: clear event failed");
- if (QDF_STATUS_SUCCESS == status) {
- status = qdf_wait_for_connection_update();
- if (!QDF_IS_STATUS_SUCCESS(status)) {
- hdd_err("ERROR: qdf wait for event failed!!");
- return -EINVAL;
- }
+ status = cds_current_connections_update(pAdapter->sessionId,
+ channelNum,
+ SIR_UPDATE_REASON_JOIN_IBSS);
+ if (QDF_STATUS_E_FAILURE == status) {
+ hdd_err("ERROR: connections update failed!!");
+ return -EINVAL;
+ }
+
+ if (QDF_STATUS_SUCCESS == status) {
+ status = qdf_wait_for_connection_update();
+ if (!QDF_IS_STATUS_SUCCESS(status)) {
+ hdd_err("ERROR: qdf wait for event failed!!");
+ return -EINVAL;
}
}
/*Try disconnecting if already in connected state */
status = wlan_hdd_try_disconnect(pAdapter);
if (0 > status) {
- hddLog(LOGE,
- FL("Failed to disconnect the existing IBSS connection"));
+ hdd_err("Failed to disconnect the existing IBSS connection");
return -EALREADY;
}
pRoamProfile = &pWextState->roamProfile;
if (eCSR_BSS_TYPE_START_IBSS != pRoamProfile->BSSType) {
- hddLog(LOGE,
- FL("Interface type is not set to IBSS"));
+ hdd_err("Interface type is not set to IBSS");
return -EINVAL;
}
@@ -10358,24 +10470,21 @@ static int __wlan_hdd_cfg80211_join_ibss(struct wiphy *wiphy,
WNI_CFG_IBSS_ATIM_WIN_SIZE,
pHddCtx->config->
ibssATIMWinSize)) {
- hddLog(LOGE,
- FL("Could not pass on WNI_CFG_IBSS_ATIM_WIN_SIZE to CCM"));
+ hdd_err("Could not pass on WNI_CFG_IBSS_ATIM_WIN_SIZE to CCM");
}
/* BSSID is provided by upper layers hence no need to AUTO generate */
if (NULL != params->bssid) {
if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_IBSS_AUTO_BSSID, 0)
== QDF_STATUS_E_FAILURE) {
- hddLog(LOGE,
- FL("ccmCfgStInt failed for WNI_CFG_IBSS_AUTO_BSSID"));
+ hdd_err("ccmCfgStInt failed for WNI_CFG_IBSS_AUTO_BSSID");
return -EIO;
}
qdf_mem_copy(bssid.bytes, params->bssid, QDF_MAC_ADDR_SIZE);
} else if (pHddCtx->config->isCoalesingInIBSSAllowed == 0) {
if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_IBSS_AUTO_BSSID, 0)
== QDF_STATUS_E_FAILURE) {
- hddLog(LOGE,
- FL("ccmCfgStInt failed for WNI_CFG_IBSS_AUTO_BSSID"));
+ hdd_err("ccmCfgStInt failed for WNI_CFG_IBSS_AUTO_BSSID");
return -EIO;
}
qdf_copy_macaddr(&bssid, &pHddCtx->config->IbssBssid);
@@ -10385,15 +10494,14 @@ static int __wlan_hdd_cfg80211_join_ibss(struct wiphy *wiphy,
pRoamProfile->beaconInterval = params->beacon_interval;
else {
pRoamProfile->beaconInterval = CFG_BEACON_INTERVAL_DEFAULT;
- hddLog(LOG2,
- FL("input beacon interval %d TU is invalid, use default %d TU"),
+ hdd_info("input beacon interval %d TU is invalid, use default %d TU",
params->beacon_interval, pRoamProfile->beaconInterval);
}
/* Set Channel */
if (channelNum) {
/* Set the Operational Channel */
- hddLog(LOG2, FL("set channel %d"), channelNum);
+ hdd_info("set channel %d", channelNum);
pRoamProfile->ChannelInfo.numOfChannels = 1;
pHddStaCtx->conn_info.operationChannel = channelNum;
pRoamProfile->ChannelInfo.ChannelList =
@@ -10403,8 +10511,7 @@ static int __wlan_hdd_cfg80211_join_ibss(struct wiphy *wiphy,
/* Initialize security parameters */
status = wlan_hdd_cfg80211_set_privacy_ibss(pAdapter, params);
if (status < 0) {
- hddLog(LOGE,
- FL("failed to set security parameters"));
+ hdd_err("failed to set security parameters");
return status;
}
@@ -10417,7 +10524,7 @@ static int __wlan_hdd_cfg80211_join_ibss(struct wiphy *wiphy,
operationChannel);
if (0 > status) {
- hddLog(LOGE, FL("connect failed"));
+ hdd_err("connect failed");
return status;
}
EXIT();
@@ -10471,7 +10578,7 @@ static int __wlan_hdd_cfg80211_leave_ibss(struct wiphy *wiphy,
ENTER();
if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
- hddLog(LOGE, FL("Command not allowed in FTM mode"));
+ hdd_err("Command not allowed in FTM mode");
return -EINVAL;
}
@@ -10483,11 +10590,11 @@ static int __wlan_hdd_cfg80211_leave_ibss(struct wiphy *wiphy,
if (0 != status)
return status;
- hddLog(LOG1, FL("Device_mode %s(%d)"),
+ hdd_notice("Device_mode %s(%d)",
hdd_device_mode_to_string(pAdapter->device_mode),
pAdapter->device_mode);
if (NULL == pWextState) {
- hddLog(LOGE, FL("Data Storage Corruption"));
+ hdd_err("Data Storage Corruption");
return -EIO;
}
@@ -10495,8 +10602,7 @@ static int __wlan_hdd_cfg80211_leave_ibss(struct wiphy *wiphy,
/* Issue disconnect only if interface type is set to IBSS */
if (eCSR_BSS_TYPE_START_IBSS != pRoamProfile->BSSType) {
- hddLog(LOGE,
- FL("BSS Type is not set to IBSS"));
+ hdd_err("BSS Type is not set to IBSS");
return -EINVAL;
}
/* Clearing add IE of beacon */
@@ -10510,7 +10616,7 @@ static int __wlan_hdd_cfg80211_leave_ibss(struct wiphy *wiphy,
if (sme_update_add_ie(WLAN_HDD_GET_HAL_CTX(pAdapter),
&updateIE,
eUPDATE_IE_PROBE_BCN) == QDF_STATUS_E_FAILURE) {
- hddLog(LOGE, FL("Could not pass on PROBE_RSP_BCN data to PE"));
+ hdd_err("Could not pass on PROBE_RSP_BCN data to PE");
}
/* Reset WNI_CFG_PROBE_RSP Flags */
@@ -10522,8 +10628,7 @@ static int __wlan_hdd_cfg80211_leave_ibss(struct wiphy *wiphy,
pAdapter->sessionId,
eCSR_DISCONNECT_REASON_IBSS_LEAVE);
if (!QDF_IS_STATUS_SUCCESS(hal_status)) {
- hddLog(LOGE,
- FL("sme_roam_disconnect failed hal_status(%d)"),
+ hdd_err("sme_roam_disconnect failed hal_status(%d)",
hal_status);
return -EAGAIN;
}
@@ -10584,7 +10689,7 @@ static int __wlan_hdd_cfg80211_set_wiphy_params(struct wiphy *wiphy,
ENTER();
if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
- hddLog(LOGE, FL("Command not allowed in FTM mode"));
+ hdd_err("Command not allowed in FTM mode");
return -EINVAL;
}
@@ -10602,21 +10707,19 @@ static int __wlan_hdd_cfg80211_set_wiphy_params(struct wiphy *wiphy,
if ((WNI_CFG_RTS_THRESHOLD_STAMIN > rts_threshold) ||
(WNI_CFG_RTS_THRESHOLD_STAMAX < rts_threshold)) {
- hddLog(LOGE,
- FL("Invalid RTS Threshold value %u"),
+ hdd_err("Invalid RTS Threshold value %u",
rts_threshold);
return -EINVAL;
}
if (0 != sme_cfg_set_int(hHal, WNI_CFG_RTS_THRESHOLD,
rts_threshold)) {
- hddLog(LOGE,
- FL("sme_cfg_set_int failed for rts_threshold value %u"),
+ hdd_err("sme_cfg_set_int failed for rts_threshold value %u",
rts_threshold);
return -EIO;
}
- hddLog(LOG2, FL("set rts threshold %u"), rts_threshold);
+ hdd_info("set rts threshold %u", rts_threshold);
}
if (changed & WIPHY_PARAM_FRAG_THRESHOLD) {
@@ -10626,21 +10729,19 @@ static int __wlan_hdd_cfg80211_set_wiphy_params(struct wiphy *wiphy,
if ((WNI_CFG_FRAGMENTATION_THRESHOLD_STAMIN > frag_threshold) ||
(WNI_CFG_FRAGMENTATION_THRESHOLD_STAMAX < frag_threshold)) {
- hddLog(LOGE,
- FL("Invalid frag_threshold value %hu"),
+ hdd_err("Invalid frag_threshold value %hu",
frag_threshold);
return -EINVAL;
}
if (0 != sme_cfg_set_int(hHal, WNI_CFG_FRAGMENTATION_THRESHOLD,
frag_threshold)) {
- hddLog(LOGE,
- FL("sme_cfg_set_int failed for frag_threshold value %hu"),
+ hdd_err("sme_cfg_set_int failed for frag_threshold value %hu",
frag_threshold);
return -EIO;
}
- hddLog(LOG2, FL("set frag threshold %hu"), frag_threshold);
+ hdd_info("set frag threshold %hu", frag_threshold);
}
if ((changed & WIPHY_PARAM_RETRY_SHORT)
@@ -10650,8 +10751,7 @@ static int __wlan_hdd_cfg80211_set_wiphy_params(struct wiphy *wiphy,
if ((WNI_CFG_LONG_RETRY_LIMIT_STAMIN > retry_value) ||
(WNI_CFG_LONG_RETRY_LIMIT_STAMAX < retry_value)) {
- hddLog(LOGE,
- FL("Invalid Retry count %hu"), retry_value);
+ hdd_err("Invalid Retry count %hu", retry_value);
return -EINVAL;
}
@@ -10659,24 +10759,20 @@ static int __wlan_hdd_cfg80211_set_wiphy_params(struct wiphy *wiphy,
if (0 != sme_cfg_set_int(hHal,
WNI_CFG_LONG_RETRY_LIMIT,
retry_value)) {
- hddLog(LOGE,
- FL("sme_cfg_set_int failed for long retry count %hu"),
+ hdd_err("sme_cfg_set_int failed for long retry count %hu",
retry_value);
return -EIO;
}
- hddLog(LOG2,
- FL("set long retry count %hu"), retry_value);
+ hdd_info("set long retry count %hu", retry_value);
} else if (changed & WIPHY_PARAM_RETRY_SHORT) {
if (0 != sme_cfg_set_int(hHal,
WNI_CFG_SHORT_RETRY_LIMIT,
retry_value)) {
- hddLog(LOGE,
- FL("sme_cfg_set_int failed for short retry count %hu"),
+ hdd_err("sme_cfg_set_int failed for short retry count %hu",
retry_value);
return -EIO;
}
- hddLog(LOG2,
- FL("set short retry count %hu"), retry_value);
+ hdd_info("set short retry count %hu", retry_value);
}
}
EXIT();
@@ -10800,7 +10896,7 @@ int __wlan_hdd_cfg80211_del_station(struct wiphy *wiphy,
ENTER();
if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
- hddLog(LOGE, FL("Command not allowed in FTM mode"));
+ hdd_err("Command not allowed in FTM mode");
return -EINVAL;
}
@@ -10821,7 +10917,7 @@ int __wlan_hdd_cfg80211_del_station(struct wiphy *wiphy,
hapd_state = WLAN_HDD_GET_HOSTAP_STATE_PTR(pAdapter);
if (!hapd_state) {
- hddLog(LOGE, "%s: Hostapd State is Null", __func__);
+ hdd_err("Hostapd State is Null");
return 0;
}
@@ -10844,9 +10940,8 @@ int __wlan_hdd_cfg80211_del_station(struct wiphy *wiphy,
WLAN_CLIENT_DISCONNECT,
mac);
}
- hddLog(LOG1,
- FL("Delete STA with MAC::"
- MAC_ADDRESS_STR),
+ hdd_notice("Delete STA with MAC::"
+ MAC_ADDRESS_STR,
MAC_ADDR_ARRAY(mac));
if (pHddCtx->dev_dfs_cac_status ==
@@ -10868,9 +10963,7 @@ int __wlan_hdd_cfg80211_del_station(struct wiphy *wiphy,
1000);
if (!QDF_IS_STATUS_SUCCESS(
qdf_status))
- hddLog(LOGE,
- "%s: Deauth wait time expired",
- __func__);
+ hdd_err("Deauth wait time expired");
}
}
}
@@ -10880,9 +10973,8 @@ int __wlan_hdd_cfg80211_del_station(struct wiphy *wiphy,
(struct qdf_mac_addr *) mac,
&staId);
if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
- hddLog(LOG1,
- FL("Skip DEL STA as this is not used::"
- MAC_ADDRESS_STR),
+ hdd_notice("Skip DEL STA as this is not used::"
+ MAC_ADDRESS_STR,
MAC_ADDR_ARRAY(mac));
return -ENOENT;
}
@@ -10894,17 +10986,15 @@ int __wlan_hdd_cfg80211_del_station(struct wiphy *wiphy,
if (pAdapter->aStaInfo[staId].isDeauthInProgress ==
true) {
- hddLog(LOG1,
- FL("Skip DEL STA as deauth is in progress::"
- MAC_ADDRESS_STR),
+ hdd_notice("Skip DEL STA as deauth is in progress::"
+ MAC_ADDRESS_STR,
MAC_ADDR_ARRAY(mac));
return -ENOENT;
}
pAdapter->aStaInfo[staId].isDeauthInProgress = true;
- hddLog(LOG1,
- FL("Delete STA with MAC::" MAC_ADDRESS_STR),
+ hdd_notice("Delete STA with MAC::" MAC_ADDRESS_STR,
MAC_ADDR_ARRAY(mac));
/* Case: SAP in ACS selected DFS ch and client connected
@@ -10924,9 +11014,8 @@ int __wlan_hdd_cfg80211_del_station(struct wiphy *wiphy,
if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
pAdapter->aStaInfo[staId].isDeauthInProgress =
false;
- hddLog(LOG1,
- FL("STA removal failed for ::"
- MAC_ADDRESS_STR),
+ hdd_notice("STA removal failed for ::"
+ MAC_ADDRESS_STR,
MAC_ADDR_ARRAY(mac));
return -ENOENT;
} else {
@@ -10934,9 +11023,7 @@ int __wlan_hdd_cfg80211_del_station(struct wiphy *wiphy,
&hapd_state->qdf_event,
1000);
if (!QDF_IS_STATUS_SUCCESS(qdf_status))
- hddLog(LOGE,
- "%s: Deauth wait time expired",
- __func__);
+ hdd_err("Deauth wait time expired");
}
}
}
@@ -11044,7 +11131,7 @@ static int __wlan_hdd_cfg80211_add_station(struct wiphy *wiphy,
ENTER();
if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
- hddLog(LOGE, FL("Command not allowed in FTM mode"));
+ hdd_err("Command not allowed in FTM mode");
return -EINVAL;
}
@@ -11059,7 +11146,7 @@ static int __wlan_hdd_cfg80211_add_station(struct wiphy *wiphy,
set = params->sta_flags_set;
- hddLog(LOG1, FL("mask 0x%x set 0x%x " MAC_ADDRESS_STR), mask, set,
+ hdd_notice("mask 0x%x set 0x%x " MAC_ADDRESS_STR, mask, set,
MAC_ADDR_ARRAY(mac));
if (mask & BIT(NL80211_STA_FLAG_TDLS_PEER)) {
@@ -11123,22 +11210,22 @@ static int __wlan_hdd_cfg80211_set_pmksa(struct wiphy *wiphy,
ENTER();
if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
- hddLog(LOGE, FL("Command not allowed in FTM mode"));
+ hdd_err("Command not allowed in FTM mode");
return -EINVAL;
}
if (!pmksa) {
- hddLog(LOGE, FL("pmksa is NULL"));
+ hdd_err("pmksa is NULL");
return -EINVAL;
}
if (!pmksa->bssid || !pmksa->pmkid) {
- hddLog(LOGE, FL("pmksa->bssid(%p) or pmksa->pmkid(%p) is NULL"),
+ hdd_err("pmksa->bssid(%p) or pmksa->pmkid(%p) is NULL",
pmksa->bssid, pmksa->pmkid);
return -EINVAL;
}
- hddLog(LOGW, FL("set PMKSA for " MAC_ADDRESS_STR),
+ hdd_warn("set PMKSA for " MAC_ADDRESS_STR,
MAC_ADDR_ARRAY(pmksa->bssid));
status = wlan_hdd_validate_context(pHddCtx);
@@ -11204,21 +11291,21 @@ static int __wlan_hdd_cfg80211_del_pmksa(struct wiphy *wiphy,
ENTER();
if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
- hddLog(LOGE, FL("Command not allowed in FTM mode"));
+ hdd_err("Command not allowed in FTM mode");
return -EINVAL;
}
if (!pmksa) {
- hddLog(LOGE, FL("pmksa is NULL"));
+ hdd_err("pmksa is NULL");
return -EINVAL;
}
if (!pmksa->bssid) {
- hddLog(LOGE, FL("pmksa->bssid is NULL"));
+ hdd_err("pmksa->bssid is NULL");
return -EINVAL;
}
- hddLog(QDF_TRACE_LEVEL_DEBUG, FL("Deleting PMKSA for " MAC_ADDRESS_STR),
+ hdd_debug("Deleting PMKSA for " MAC_ADDRESS_STR,
MAC_ADDR_ARRAY(pmksa->bssid));
status = wlan_hdd_validate_context(pHddCtx);
@@ -11236,7 +11323,7 @@ static int __wlan_hdd_cfg80211_del_pmksa(struct wiphy *wiphy,
sme_roam_del_pmkid_from_cache(halHandle,
pAdapter->sessionId, pmksa->bssid,
false)) {
- hddLog(LOGE, FL("Failed to delete PMKSA for " MAC_ADDRESS_STR),
+ hdd_err("Failed to delete PMKSA for " MAC_ADDRESS_STR,
MAC_ADDR_ARRAY(pmksa->bssid));
status = -EINVAL;
}
@@ -11284,11 +11371,11 @@ static int __wlan_hdd_cfg80211_flush_pmksa(struct wiphy *wiphy,
ENTER();
if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
- hddLog(LOGE, FL("Command not allowed in FTM mode"));
+ hdd_err("Command not allowed in FTM mode");
return -EINVAL;
}
- hddLog(LOGW, FL("Flushing PMKSA"));
+ hdd_warn("Flushing PMKSA");
pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
status = wlan_hdd_validate_context(pHddCtx);
@@ -11303,7 +11390,7 @@ static int __wlan_hdd_cfg80211_flush_pmksa(struct wiphy *wiphy,
if (QDF_STATUS_SUCCESS !=
sme_roam_del_pmkid_from_cache(halHandle, pAdapter->sessionId, NULL,
true)) {
- hddLog(LOGE, FL("Cannot flush PMKIDCache"));
+ hdd_err("Cannot flush PMKIDCache");
status = -EINVAL;
}
EXIT();
@@ -11355,7 +11442,7 @@ __wlan_hdd_cfg80211_update_ft_ies(struct wiphy *wiphy,
return status;
if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
- hddLog(LOGE, FL("Command not allowed in FTM mode"));
+ hdd_err("Command not allowed in FTM mode");
return -EINVAL;
}
@@ -11364,12 +11451,11 @@ __wlan_hdd_cfg80211_update_ft_ies(struct wiphy *wiphy,
pAdapter->sessionId, pHddStaCtx->conn_info.connState));
/* Added for debug on reception of Re-assoc Req. */
if (eConnectionState_Associated != pHddStaCtx->conn_info.connState) {
- hddLog(LOGE,
- FL("Called with Ie of length = %zu when not associated"),
+ hdd_err("Called with Ie of length = %zu when not associated",
ftie->ie_len);
- hddLog(LOGE, FL("Should be Re-assoc Req IEs"));
+ hdd_err("Should be Re-assoc Req IEs");
}
- hddLog(LOG1, FL("%s called with Ie of length = %zu"), __func__,
+ hdd_notice("%s called with Ie of length = %zu", __func__,
ftie->ie_len);
/* Pass the received FT IEs to SME */
@@ -11423,17 +11509,17 @@ void wlan_hdd_cfg80211_update_replay_counter_callback(void *callbackContext,
ENTER();
if (NULL == pAdapter) {
- hddLog(LOGE, FL("HDD adapter is Null"));
+ hdd_err("HDD adapter is Null");
return;
}
if (NULL == pGtkOffloadGetInfoRsp) {
- hddLog(LOGE, FL("pGtkOffloadGetInfoRsp is Null"));
+ hdd_err("pGtkOffloadGetInfoRsp is Null");
return;
}
if (QDF_STATUS_SUCCESS != pGtkOffloadGetInfoRsp->ulStatus) {
- hddLog(LOGE, FL("wlan Failed to get replay counter value"));
+ hdd_err("wlan Failed to get replay counter value");
return;
}
@@ -11486,7 +11572,7 @@ int __wlan_hdd_cfg80211_set_rekey_data(struct wiphy *wiphy,
ENTER();
if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
- hddLog(LOGE, FL("Command not allowed in FTM mode"));
+ hdd_err("Command not allowed in FTM mode");
return -EINVAL;
}
@@ -11502,7 +11588,7 @@ int __wlan_hdd_cfg80211_set_rekey_data(struct wiphy *wiphy,
pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
hHal = WLAN_HDD_GET_HAL_CTX(pAdapter);
if (NULL == hHal) {
- hddLog(LOGE, FL("HAL context is Null!!!"));
+ hdd_err("HAL context is Null!!!");
return -EAGAIN;
}
@@ -11537,14 +11623,13 @@ int __wlan_hdd_cfg80211_set_rekey_data(struct wiphy *wiphy,
pAdapter->sessionId);
if (QDF_STATUS_SUCCESS != status) {
- hddLog(LOGE, FL("sme_set_gtk_offload failed, status(%d)"),
+ hdd_err("sme_set_gtk_offload failed, status(%d)",
status);
return -EINVAL;
}
- hddLog(LOG1, FL("sme_set_gtk_offload successful"));
+ hdd_notice("sme_set_gtk_offload successful");
} else {
- hddLog(LOG1,
- FL("wlan not suspended GTKOffload request is stored"));
+ hdd_notice("wlan not suspended GTKOffload request is stored");
}
EXIT();
return result;
@@ -11598,12 +11683,12 @@ static int __wlan_hdd_cfg80211_set_mac_acl(struct wiphy *wiphy,
ENTER();
if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
- hddLog(LOGE, FL("Command not allowed in FTM mode"));
+ hdd_err("Command not allowed in FTM mode");
return -EINVAL;
}
if (NULL == params) {
- hddLog(LOGE, FL("params is Null"));
+ hdd_err("params is Null");
return -EINVAL;
}
@@ -11617,11 +11702,11 @@ static int __wlan_hdd_cfg80211_set_mac_acl(struct wiphy *wiphy,
pHostapdState = WLAN_HDD_GET_HOSTAP_STATE_PTR(pAdapter);
if (NULL == pHostapdState) {
- hddLog(LOGE, FL("pHostapdState is Null"));
+ hdd_err("pHostapdState is Null");
return -EINVAL;
}
- hddLog(LOGE, "acl policy: = %d no acl entries = %d", params->acl_policy,
+ hdd_err("acl policy: = %d no acl entries = %d", params->acl_policy,
params->n_acl_entries);
MTRACE(qdf_trace(QDF_MODULE_ID_HDD,
@@ -11647,7 +11732,7 @@ static int __wlan_hdd_cfg80211_set_mac_acl(struct wiphy *wiphy,
params->acl_policy) {
pConfig->SapMacaddr_acl = eSAP_ACCEPT_UNLESS_DENIED;
} else {
- hddLog(LOGE, FL("Acl Policy : %d is not supported"),
+ hdd_err("Acl Policy : %d is not supported",
params->acl_policy);
return -ENOTSUPP;
}
@@ -11655,9 +11740,8 @@ static int __wlan_hdd_cfg80211_set_mac_acl(struct wiphy *wiphy,
if (eSAP_DENY_UNLESS_ACCEPTED == pConfig->SapMacaddr_acl) {
pConfig->num_accept_mac = params->n_acl_entries;
for (i = 0; i < params->n_acl_entries; i++) {
- hddLog(LOG1,
- FL("** Add ACL MAC entry %i in WhiletList :"
- MAC_ADDRESS_STR), i,
+ hdd_notice("** Add ACL MAC entry %i in WhiletList :"
+ MAC_ADDRESS_STR, i,
MAC_ADDR_ARRAY(
params->mac_addrs[i].addr));
@@ -11668,9 +11752,8 @@ static int __wlan_hdd_cfg80211_set_mac_acl(struct wiphy *wiphy,
} else if (eSAP_ACCEPT_UNLESS_DENIED == pConfig->SapMacaddr_acl) {
pConfig->num_deny_mac = params->n_acl_entries;
for (i = 0; i < params->n_acl_entries; i++) {
- hddLog(LOG1,
- FL("** Add ACL MAC entry %i in BlackList :"
- MAC_ADDRESS_STR), i,
+ hdd_notice("** Add ACL MAC entry %i in BlackList :"
+ MAC_ADDRESS_STR, i,
MAC_ADDR_ARRAY(
params->mac_addrs[i].addr));
@@ -11687,11 +11770,11 @@ static int __wlan_hdd_cfg80211_set_mac_acl(struct wiphy *wiphy,
qdf_status = wlansap_set_mac_acl(p_cds_context, pConfig);
#endif
if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
- hddLog(LOGE, FL("SAP Set Mac Acl fail"));
+ hdd_err("SAP Set Mac Acl fail");
return -EINVAL;
}
} else {
- hddLog(LOG1, FL("Invalid device_mode %s(%d)"),
+ hdd_notice("Invalid device_mode %s(%d)",
hdd_device_mode_to_string(pAdapter->device_mode),
pAdapter->device_mode);
return -EINVAL;
@@ -11736,13 +11819,13 @@ void wlan_hdd_cfg80211_lphb_ind_handler(void *pHddCtx, tSirLPHBInd *lphbInd)
{
struct sk_buff *skb;
- hddLog(LOGE, FL("LPHB indication arrived"));
+ hdd_err("LPHB indication arrived");
if (0 != wlan_hdd_validate_context((hdd_context_t *) pHddCtx))
return;
if (NULL == lphbInd) {
- hddLog(LOGE, FL("invalid argument lphbInd"));
+ hdd_err("invalid argument lphbInd");
return;
}
@@ -11750,27 +11833,27 @@ void wlan_hdd_cfg80211_lphb_ind_handler(void *pHddCtx, tSirLPHBInd *lphbInd)
wiphy, sizeof(tSirLPHBInd),
GFP_ATOMIC);
if (!skb) {
- hddLog(LOGE, FL("LPHB timeout, NL buffer alloc fail"));
+ hdd_err("LPHB timeout, NL buffer alloc fail");
return;
}
if (nla_put_u32(skb, WLAN_HDD_TM_ATTR_CMD, WLAN_HDD_TM_CMD_WLAN_HB)) {
- hddLog(LOGE, FL("WLAN_HDD_TM_ATTR_CMD put fail"));
+ hdd_err("WLAN_HDD_TM_ATTR_CMD put fail");
goto nla_put_failure;
}
if (nla_put_u32(skb, WLAN_HDD_TM_ATTR_TYPE, lphbInd->protocolType)) {
- hddLog(LOGE, FL("WLAN_HDD_TM_ATTR_TYPE put fail"));
+ hdd_err("WLAN_HDD_TM_ATTR_TYPE put fail");
goto nla_put_failure;
}
if (nla_put(skb, WLAN_HDD_TM_ATTR_DATA, sizeof(tSirLPHBInd), lphbInd)) {
- hddLog(LOGE, FL("WLAN_HDD_TM_ATTR_DATA put fail"));
+ hdd_err("WLAN_HDD_TM_ATTR_DATA put fail");
goto nla_put_failure;
}
cfg80211_testmode_event(skb, GFP_ATOMIC);
return;
nla_put_failure:
- hddLog(LOGE, FL("NLA Put fail"));
+ hdd_err("NLA Put fail");
kfree_skb(skb);
return;
@@ -11801,12 +11884,12 @@ static int __wlan_hdd_cfg80211_testmode(struct wiphy *wiphy,
err = nla_parse(tb, WLAN_HDD_TM_ATTR_MAX, data,
len, wlan_hdd_tm_policy);
if (err) {
- hddLog(LOGE, FL("Testmode INV ATTR"));
+ hdd_err("Testmode INV ATTR");
return err;
}
if (!tb[WLAN_HDD_TM_ATTR_CMD]) {
- hddLog(LOGE, FL("Testmode INV CMD"));
+ hdd_err("Testmode INV CMD");
return -EINVAL;
}
@@ -11825,7 +11908,7 @@ static int __wlan_hdd_cfg80211_testmode(struct wiphy *wiphy,
QDF_STATUS smeStatus;
if (!tb[WLAN_HDD_TM_ATTR_DATA]) {
- hddLog(LOGE, FL("Testmode INV DATA"));
+ hdd_err("Testmode INV DATA");
return -EINVAL;
}
@@ -11841,7 +11924,7 @@ static int __wlan_hdd_cfg80211_testmode(struct wiphy *wiphy,
hb_params =
(tSirLPHBReq *) qdf_mem_malloc(sizeof(tSirLPHBReq));
if (NULL == hb_params) {
- hddLog(LOGE, FL("Request Buffer Alloc Fail"));
+ hdd_err("Request Buffer Alloc Fail");
return -ENOMEM;
}
@@ -11851,7 +11934,7 @@ static int __wlan_hdd_cfg80211_testmode(struct wiphy *wiphy,
hb_params,
wlan_hdd_cfg80211_lphb_ind_handler);
if (QDF_STATUS_SUCCESS != smeStatus) {
- hddLog(LOGE, "LPHB Config Fail, disable");
+ hdd_err("LPHB Config Fail, disable");
qdf_mem_free(hb_params);
}
return 0;
@@ -11883,7 +11966,7 @@ static int __wlan_hdd_cfg80211_testmode(struct wiphy *wiphy,
#endif
default:
- hddLog(LOGE, FL("command %d not supported"),
+ hdd_err("command %d not supported",
nla_get_u32(tb[WLAN_HDD_TM_ATTR_CMD]));
return -EOPNOTSUPP;
}
@@ -11929,24 +12012,20 @@ void wlan_hdd_testmode_rx_event(void *buf, size_t buf_len)
hdd_context_t *hdd_ctx;
if (!buf || !buf_len) {
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR,
- "%s: buf or buf_len invalid, buf = %p buf_len = %zu",
- __func__, buf, buf_len);
+ hdd_err("buf or buf_len invalid, buf = %p buf_len = %zu", buf, buf_len);
return;
}
hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
if (!hdd_ctx) {
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR,
- "%s: hdd context invalid", __func__);
+ hdd_err("hdd context invalid");
return;
}
skb = cfg80211_testmode_alloc_event_skb(hdd_ctx->wiphy,
buf_len, GFP_KERNEL);
if (!skb) {
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR,
- "%s: failed to allocate testmode rx skb!", __func__);
+ hdd_err("failed to allocate testmode rx skb!");
return;
}
@@ -11961,8 +12040,7 @@ void wlan_hdd_testmode_rx_event(void *buf, size_t buf_len)
nla_put_failure:
kfree_skb(skb);
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR,
- "%s: nla_put failed on testmode rx skb!", __func__);
+ hdd_err("nla_put failed on testmode rx skb!");
}
#endif
#endif /* CONFIG_NL80211_TESTMODE */
@@ -11988,7 +12066,7 @@ __wlan_hdd_cfg80211_set_ap_channel_width(struct wiphy *wiphy,
bool cbModeChange;
if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
- hddLog(LOGE, FL("Command not allowed in FTM mode"));
+ hdd_err("Command not allowed in FTM mode");
return -EINVAL;
}
@@ -12026,7 +12104,7 @@ __wlan_hdd_cfg80211_set_ap_channel_width(struct wiphy *wiphy,
break;
default:
- hddLog(LOGE, FL("Error!!! Invalid HT20/40 mode !"));
+ hdd_err("Error!!! Invalid HT20/40 mode !");
return -EINVAL;
}
@@ -12036,14 +12114,14 @@ __wlan_hdd_cfg80211_set_ap_channel_width(struct wiphy *wiphy,
if (QDF_SAP_MODE != pAdapter->device_mode)
return 0;
- hddLog(LOG1, FL("Channel bonding changed to %d"),
+ hdd_notice("Channel bonding changed to %d",
sme_config.csrConfig.channelBondingMode24GHz);
/* Change SAP ht2040 mode */
status = hdd_set_sap_ht2040_mode(pAdapter,
cfg80211_get_chandef_type(chandef));
if (status != QDF_STATUS_SUCCESS) {
- hddLog(LOGE, FL("Error!!! Cannot set SAP HT20/40 mode!"));
+ hdd_err("Error!!! Cannot set SAP HT20/40 mode!");
return -EINVAL;
}
@@ -12096,7 +12174,7 @@ static int __wlan_hdd_cfg80211_channel_switch(struct wiphy *wiphy,
int ret;
enum phy_ch_width ch_width;
- hddLog(LOG1, FL("Set Freq %d"),
+ hdd_notice("Set Freq %d",
csa_params->chandef.chan->center_freq);
hdd_ctx = WLAN_HDD_GET_CTX(adapter);
@@ -12173,7 +12251,7 @@ enum cds_con_mode wlan_hdd_convert_nl_iftype_to_hdd_type(
mode = CDS_IBSS_MODE;
break;
default:
- hddLog(LOGE, FL("Unsupported interface type (%d)"),
+ hdd_err("Unsupported interface type (%d)",
type);
}
return mode;
diff --git a/core/hdd/src/wlan_hdd_cfg80211.h b/core/hdd/src/wlan_hdd_cfg80211.h
index 57b25e495416..d99cd9cc59c4 100644
--- a/core/hdd/src/wlan_hdd_cfg80211.h
+++ b/core/hdd/src/wlan_hdd_cfg80211.h
@@ -261,6 +261,14 @@ typedef enum {
* @QCA_NL80211_VENDOR_SUBCMD_SET_SAP_CONFIG: SAP configuration
* @QCA_NL80211_VENDOR_SUBCMD_TSF: TSF operations command
* @QCA_NL80211_VENDOR_SUBCMD_WISA: WISA mode configuration
+ * @QCA_NL80211_VENDOR_SUBCMD_P2P_LISTEN_OFFLOAD_START: Command used to
+ * start the P2P Listen Offload function in device and pass the listen
+ * channel, period, interval, count, number of device types, device
+ * types and vendor information elements to device driver and firmware.
+ * @QCA_NL80211_VENDOR_SUBCMD_P2P_LISTEN_OFFLOAD_STOP: Command/event used to
+ * indicate stop request/response of the P2P Listen Offload function in
+ * device. As an event, it indicates either the feature stopped after it
+ * was already running or feature has actually failed to start.
*/
enum qca_nl80211_vendor_subcmds {
@@ -348,6 +356,7 @@ enum qca_nl80211_vendor_subcmds {
QCA_NL80211_VENDOR_SUBCMD_TDLS_GET_CAPABILITIES = 78,
QCA_NL80211_VENDOR_SUBCMD_OFFLOADED_PACKETS = 79,
QCA_NL80211_VENDOR_SUBCMD_MONITOR_RSSI = 80,
+ QCA_NL80211_VENDOR_SUBCMD_NDP = 81,
QCA_NL80211_VENDOR_SUBCMD_PACKET_FILTER = 83,
/* OCB commands */
@@ -383,6 +392,8 @@ enum qca_nl80211_vendor_subcmds {
QCA_NL80211_VENDOR_SUBCMD_SET_SAP_CONFIG = 118,
QCA_NL80211_VENDOR_SUBCMD_TSF = 119,
QCA_NL80211_VENDOR_SUBCMD_WISA = 120,
+ QCA_NL80211_VENDOR_SUBCMD_P2P_LISTEN_OFFLOAD_START = 122,
+ QCA_NL80211_VENDOR_SUBCMD_P2P_LISTEN_OFFLOAD_STOP = 123,
};
/**
@@ -444,6 +455,8 @@ enum qca_nl80211_vendor_subcmds {
* @QCA_NL80211_VENDOR_SUBCMD_GW_PARAM_CONFIG_INDEX:
* update gateway parameters index
* @QCA_NL80211_VENDOR_SUBCMD_TSF_INDEX: TSF response events index
+ * @QCA_NL80211_VENDOR_SUBCMD_P2P_LO_EVENT_INDEX:
+ * P2P listen offload index
*/
enum qca_nl80211_vendor_subcmds_index {
@@ -516,6 +529,10 @@ enum qca_nl80211_vendor_subcmds_index {
#ifdef WLAN_FEATURE_TSF
QCA_NL80211_VENDOR_SUBCMD_TSF_INDEX,
#endif
+#ifdef WLAN_FEATURE_NAN_DATAPATH
+ QCA_NL80211_VENDOR_SUBCMD_NDP_INDEX,
+#endif /* WLAN_FEATURE_NAN_DATAPATH */
+ QCA_NL80211_VENDOR_SUBCMD_P2P_LO_EVENT_INDEX,
};
/**
@@ -1896,11 +1913,19 @@ enum qca_wlan_vendor_attr_link_properties {
* after roaming, rather than having the supplicant do it.
* @QCA_WLAN_VENDOR_FEATURE_OFFCHANNEL_SIMULTANEOUS: Device supports
* simultaneous off-channel operations.
+ * @QQCA_WLAN_VENDOR_FEATURE_P2P_LISTEN_OFFLOAD: Device supports P2P
+ * Listen offload; a mechanism where the station's firmware
+ * takes care of responding to incoming Probe Request frames received
+ * from other P2P devices whilst in Listen state, rather than having the
+ * user space wpa_supplicant do it. Information from received P2P
+ * Requests are forwarded from firmware to host whenever the APPS
+ * processor exits power collapse state.
*/
enum qca_wlan_vendor_features {
QCA_WLAN_VENDOR_FEATURE_KEY_MGMT_OFFLOAD = 0,
QCA_WLAN_VENDOR_FEATURE_SUPPORT_HW_MODE_ANY = 1,
QCA_WLAN_VENDOR_FEATURE_OFFCHANNEL_SIMULTANEOUS = 2,
+ QCA_WLAN_VENDOR_FEATURE_P2P_LISTEN_OFFLOAD = 3,
/* Additional features need to be added above this */
NUM_QCA_WLAN_VENDOR_FEATURES
};
@@ -2381,6 +2406,47 @@ enum qca_wlan_vendor_attr_sap_config {
QCA_WLAN_VENDOR_ATTR_SAP_CONFIG_AFTER_LAST - 1,
};
+/**
+ * enum qca_wlan_vendor_attr_p2p_listen_offload - vendor sub commands index
+ * @QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_INVALID: invalid value
+ * @QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_CHANNEL:
+ * A 32-bit unsigned value; the P2P listen frequency (MHz); must be one
+ * of the social channels.
+ * @QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_PERIOD: listen offload period
+ * A 32-bit unsigned value; the P2P listen offload period (ms).
+ * @QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_INTERVAL:
+ * A 32-bit unsigned value; the P2P listen interval duration (ms).
+ * @QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_COUNT:
+ * A 32-bit unsigned value; number of interval times the Firmware needs
+ * to run the offloaded P2P listen operation before it stops.
+ * @QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_DEVICE_TYPES: device types
+ * An array of unsigned 8-bit characters; vendor information elements.
+ * @QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_VENDOR_IE: vendor IEs
+ * @QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_CTRL_FLAG: control flag for FW
+ * A 32-bit unsigned value; a control flag to indicate whether listen
+ * results need to be flushed to wpa_supplicant.
+ * @QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_STOP_REASON: offload stop reason
+ * A 8-bit unsigned value; reason code for P2P listen offload stop
+ * event.
+ * @QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_AFTER_LAST: last value
+ * @QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_MAX: max value
+ */
+enum qca_wlan_vendor_attr_p2p_listen_offload {
+ QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_INVALID = 0,
+ QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_CHANNEL,
+ QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_PERIOD,
+ QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_INTERVAL,
+ QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_COUNT,
+ QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_DEVICE_TYPES,
+ QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_VENDOR_IE,
+ QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_CTRL_FLAG,
+ QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_STOP_REASON,
+ /* keep last */
+ QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_AFTER_LAST,
+ QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_MAX =
+ QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_AFTER_LAST - 1
+};
+
struct cfg80211_bss *wlan_hdd_cfg80211_update_bss_db(hdd_adapter_t *pAdapter,
tCsrRoamInfo *pRoamInfo);
diff --git a/core/hdd/src/wlan_hdd_conc_ut.c b/core/hdd/src/wlan_hdd_conc_ut.c
index bd1c7e4726e5..2d44f65e0a51 100644
--- a/core/hdd/src/wlan_hdd_conc_ut.c
+++ b/core/hdd/src/wlan_hdd_conc_ut.c
@@ -632,9 +632,12 @@ void wlan_hdd_one_connection_scenario(hdd_context_t *hdd_ctx)
enum cds_pcl_type pcl_type;
char reason[20] = {0};
QDF_STATUS ret;
+ struct cds_sme_cbacks sme_cbacks;
+ sme_cbacks.sme_get_valid_channels = sme_get_cfg_valid_channels;
+ sme_cbacks.sme_get_nss_for_vdev = sme_get_vdev_type_nss;
/* flush the entire table first */
- ret = cds_init_policy_mgr(sme_get_cfg_valid_channels);
+ ret = cds_init_policy_mgr(&sme_cbacks);
if (!QDF_IS_STATUS_SUCCESS(ret)) {
hdd_err("Policy manager initialization failed");
return;
@@ -685,13 +688,16 @@ void wlan_hdd_two_connections_scenario(hdd_context_t *hdd_ctx,
char reason[20] = {0};
bool status = false;
QDF_STATUS ret;
+ struct cds_sme_cbacks sme_cbacks;
for (sub_type = CDS_STA_MODE;
sub_type < CDS_MAX_NUM_OF_MODE; sub_type++) {
type = wlan_hdd_valid_type_of_persona(sub_type);
+ sme_cbacks.sme_get_valid_channels = sme_get_cfg_valid_channels;
+ sme_cbacks.sme_get_nss_for_vdev = sme_get_vdev_type_nss;
/* flush the entire table first */
- ret = cds_init_policy_mgr(sme_get_cfg_valid_channels);
+ ret = cds_init_policy_mgr(&sme_cbacks);
if (!QDF_IS_STATUS_SUCCESS(ret)) {
hdd_err("Policy manager initialization failed");
return;
@@ -766,6 +772,7 @@ void wlan_hdd_three_connections_scenario(hdd_context_t *hdd_ctx,
char reason[20] = {0};
bool status = false;
QDF_STATUS ret;
+ struct cds_sme_cbacks sme_cbacks;
/* let's set the chain_mask, mac_ids*/
if (chain_mask == CDS_TWO_TWO) {
@@ -789,8 +796,11 @@ void wlan_hdd_three_connections_scenario(hdd_context_t *hdd_ctx,
sub_type_1 < CDS_MAX_NUM_OF_MODE; sub_type_1++) {
type_1 = wlan_hdd_valid_type_of_persona(sub_type_1);
+
+ sme_cbacks.sme_get_valid_channels = sme_get_cfg_valid_channels;
+ sme_cbacks.sme_get_nss_for_vdev = sme_get_vdev_type_nss;
/* flush the entire table first */
- ret = cds_init_policy_mgr(sme_get_cfg_valid_channels);
+ ret = cds_init_policy_mgr(&sme_cbacks);
if (!QDF_IS_STATUS_SUCCESS(ret)) {
hdd_err("Policy manager initialization failed");
return;
diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c
index 9f2db15a95ac..bca4d0000e59 100644
--- a/core/hdd/src/wlan_hdd_hostapd.c
+++ b/core/hdd/src/wlan_hdd_hostapd.c
@@ -116,7 +116,7 @@ int hdd_sap_context_init(hdd_context_t *hdd_ctx)
qdf_wake_lock_create(&hdd_ctx->sap_wake_lock, "qcom_sap_wakelock");
qdf_spinlock_create(&hdd_ctx->sap_update_info_lock);
- mutex_init(&hdd_ctx->dfs_lock);
+ qdf_spinlock_create(&hdd_ctx->dfs_lock);
return 0;
}
@@ -217,7 +217,7 @@ void hdd_sap_context_destroy(hdd_context_t *hdd_ctx)
mutex_destroy(&hdd_ctx->sap_lock);
qdf_wake_lock_destroy(&hdd_ctx->sap_wake_lock);
- mutex_destroy(&hdd_ctx->dfs_lock);
+ qdf_spinlock_destroy(&hdd_ctx->dfs_lock);
qdf_spinlock_destroy(&hdd_ctx->sap_update_info_lock);
@@ -991,9 +991,9 @@ QDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent,
}
}
- mutex_lock(&pHddCtx->dfs_lock);
+ qdf_spin_lock_bh(&pHddCtx->dfs_lock);
pHddCtx->dfs_radar_found = false;
- mutex_unlock(&pHddCtx->dfs_lock);
+ qdf_spin_unlock_bh(&pHddCtx->dfs_lock);
wlansap_get_dfs_ignore_cac(pHddCtx->hHal, &ignoreCAC);
@@ -1111,9 +1111,9 @@ QDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent,
hdd_info("Sent CAC start to user space");
}
- mutex_lock(&pHddCtx->dfs_lock);
+ qdf_spin_lock_bh(&pHddCtx->dfs_lock);
pHddCtx->dfs_radar_found = false;
- mutex_unlock(&pHddCtx->dfs_lock);
+ qdf_spin_unlock_bh(&pHddCtx->dfs_lock);
break;
case eSAP_DFS_CAC_INTERRUPTED:
/*
@@ -1999,9 +1999,9 @@ int hdd_softap_set_channel_change(struct net_device *dev, int target_channel,
}
}
- mutex_lock(&pHddCtx->dfs_lock);
+ qdf_spin_lock_bh(&pHddCtx->dfs_lock);
if (pHddCtx->dfs_radar_found == true) {
- mutex_unlock(&pHddCtx->dfs_lock);
+ qdf_spin_unlock_bh(&pHddCtx->dfs_lock);
hddLog(LOGE, FL("Channel switch in progress!!"));
return -EBUSY;
}
@@ -2015,7 +2015,7 @@ int hdd_softap_set_channel_change(struct net_device *dev, int target_channel,
* post eSAP_START_BSS_EVENT success event to HDD.
*/
pHddCtx->dfs_radar_found = true;
- mutex_unlock(&pHddCtx->dfs_lock);
+ qdf_spin_unlock_bh(&pHddCtx->dfs_lock);
/*
* Post the Channel Change request to SAP.
*/
@@ -2039,9 +2039,9 @@ int hdd_softap_set_channel_change(struct net_device *dev, int target_channel,
* radar found flag and also restart the netif
* queues.
*/
- mutex_lock(&pHddCtx->dfs_lock);
+ qdf_spin_lock_bh(&pHddCtx->dfs_lock);
pHddCtx->dfs_radar_found = false;
- mutex_unlock(&pHddCtx->dfs_lock);
+ qdf_spin_unlock_bh(&pHddCtx->dfs_lock);
ret = -EINVAL;
}
@@ -2935,6 +2935,9 @@ static __iw_softap_setparam(struct net_device *dev,
case WLAN_HDD_NETIF_OPER_HISTORY:
wlan_hdd_clear_netif_queue_history(hdd_ctx);
break;
+ case WLAN_HIF_STATS:
+ hdd_clear_hif_stats();
+ break;
default:
ol_txrx_clear_stats(set_value);
}
@@ -8265,25 +8268,24 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy,
hdd_err("Connection failed due to concurrency check failure");
return -EINVAL;
}
- if (pHddCtx->config->policy_manager_enabled) {
- status = qdf_reset_connection_update();
- if (!QDF_IS_STATUS_SUCCESS(status))
- hdd_err("ERR: clear event failed");
- status = cds_current_connections_update(pAdapter->sessionId,
- channel,
- SIR_UPDATE_REASON_START_AP);
- if (QDF_STATUS_E_FAILURE == status) {
- hdd_err("ERROR: connections update failed!!");
- return -EINVAL;
- }
+ status = qdf_reset_connection_update();
+ if (!QDF_IS_STATUS_SUCCESS(status))
+ hdd_err("ERR: clear event failed");
- if (QDF_STATUS_SUCCESS == status) {
- status = qdf_wait_for_connection_update();
- if (!QDF_IS_STATUS_SUCCESS(status)) {
- hdd_err("ERROR: qdf wait for event failed!!");
- return -EINVAL;
- }
+ status = cds_current_connections_update(pAdapter->sessionId,
+ channel,
+ SIR_UPDATE_REASON_START_AP);
+ if (QDF_STATUS_E_FAILURE == status) {
+ hdd_err("ERROR: connections update failed!!");
+ return -EINVAL;
+ }
+
+ if (QDF_STATUS_SUCCESS == status) {
+ status = qdf_wait_for_connection_update();
+ if (!QDF_IS_STATUS_SUCCESS(status)) {
+ hdd_err("ERROR: qdf wait for event failed!!");
+ return -EINVAL;
}
}
diff --git a/core/hdd/src/wlan_hdd_ioctl.c b/core/hdd/src/wlan_hdd_ioctl.c
index 0d6320ef665b..c7bbcda6f172 100644
--- a/core/hdd/src/wlan_hdd_ioctl.c
+++ b/core/hdd/src/wlan_hdd_ioctl.c
@@ -5150,9 +5150,9 @@ static int drv_cmd_get_ibss_peer_info(hdd_adapter_t *adapter,
}
/* Get station index for the peer mac address and sanitize it */
- hdd_ibss_get_sta_id(pHddStaCtx, &peerMacAddr, &staIdx);
+ hdd_get_peer_sta_id(pHddStaCtx, &peerMacAddr, &staIdx);
- if (staIdx > MAX_IBSS_PEERS) {
+ if (staIdx > MAX_PEERS) {
hdd_err("Invalid StaIdx %d returned", staIdx);
ret = -EINVAL;
goto exit;
@@ -6611,6 +6611,16 @@ static int drv_cmd_set_antenna_mode(hdd_adapter_t *adapter,
goto exit;
}
+ /* 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)) {
+ ret = wlan_hdd_tdls_antenna_switch(hdd_ctx, adapter,
+ mode);
+ if (0 != ret)
+ goto exit;
+ }
+
params.set_antenna_mode_resp =
(void *)wlan_hdd_soc_set_antenna_mode_cb;
hdd_info("Set antenna mode rx chains: %d tx chains: %d",
@@ -6655,10 +6665,19 @@ static int drv_cmd_set_antenna_mode(hdd_adapter_t *adapter,
goto exit;
}
- hdd_info("Successfully switched to mode: %d x %d", mode, mode);
- ret = 0;
hdd_ctx->current_antenna_mode = mode;
+ /* Update the user requested nss in the mac context.
+ * This will be used in tdls protocol engine to form tdls
+ * Management frames.
+ */
+ sme_update_user_configured_nss(
+ hdd_ctx->hHal,
+ hdd_ctx->current_antenna_mode);
+ hdd_info("Successfully switched to mode: %d x %d",
+ hdd_ctx->current_antenna_mode,
+ hdd_ctx->current_antenna_mode);
+ ret = 0;
exit:
hdd_info("Set antenna status: %d current mode: %d",
ret, hdd_ctx->current_antenna_mode);
diff --git a/core/hdd/src/wlan_hdd_ipa.c b/core/hdd/src/wlan_hdd_ipa.c
index 1c0b99ba3602..5f9f30ab14f2 100644
--- a/core/hdd/src/wlan_hdd_ipa.c
+++ b/core/hdd/src/wlan_hdd_ipa.c
@@ -62,7 +62,6 @@
#define HDD_IPA_IPV6_NAME_EXT "_ipv6"
#define HDD_IPA_RX_INACTIVITY_MSEC_DELAY 1000
-#define HDD_IPA_UC_WLAN_HDR_DES_MAC_OFFSET 12
#define HDD_IPA_UC_WLAN_8023_HDR_SIZE 14
/* WDI TX and RX PIPE */
#define HDD_IPA_UC_NUM_WDI_PIPE 2
@@ -179,9 +178,6 @@ struct hdd_ipa_uc_tx_hdr {
struct ethhdr eth;
} __packed;
-#define HDD_IPA_WLAN_FRAG_HEADER sizeof(struct frag_header)
-#define HDD_IPA_WLAN_IPA_HEADER sizeof(struct frag_header)
-
/**
* struct hdd_ipa_cld_hdr - IPA CLD Header
* @reserved: reserved fields
@@ -474,12 +470,17 @@ uint32_t wlan_hdd_stub_addr_to_priv(void *ptr)
BUG_ON(ptr == NULL);
return ipa_priv;
}
+
+#define HDD_IPA_WLAN_FRAG_HEADER sizeof(struct frag_header)
+#define HDD_IPA_WLAN_IPA_HEADER sizeof(struct ipa_header)
#define HDD_IPA_WLAN_CLD_HDR_LEN sizeof(struct hdd_ipa_cld_hdr)
#define HDD_IPA_UC_WLAN_CLD_HDR_LEN 0
#define HDD_IPA_WLAN_TX_HDR_LEN sizeof(struct hdd_ipa_tx_hdr)
#define HDD_IPA_UC_WLAN_TX_HDR_LEN sizeof(struct hdd_ipa_uc_tx_hdr)
#define HDD_IPA_WLAN_RX_HDR_LEN sizeof(struct hdd_ipa_rx_hdr)
#define HDD_IPA_UC_WLAN_RX_HDR_LEN sizeof(struct hdd_ipa_uc_rx_hdr)
+#define HDD_IPA_UC_WLAN_HDR_DES_MAC_OFFSET \
+ (HDD_IPA_WLAN_FRAG_HEADER + HDD_IPA_WLAN_IPA_HEADER)
#define HDD_IPA_FW_RX_DESC_DISCARD_M 0x1
#define HDD_IPA_FW_RX_DESC_FORWARD_M 0x2
@@ -1987,7 +1988,8 @@ struct sk_buff *hdd_ipa_tx_packet_ipa(hdd_context_t *hdd_ctx,
if (HDD_IPA_UC_NUM_WDI_PIPE != hdd_ipa->activated_fw_pipe)
return skb;
- if (skb_headroom(skb) < sizeof(struct ipa_header))
+ if (skb_headroom(skb) <
+ (sizeof(struct ipa_header) + sizeof(struct frag_header)))
return skb;
ipa_header = (struct ipa_header *) skb_push(skb,
diff --git a/core/hdd/src/wlan_hdd_lpass.c b/core/hdd/src/wlan_hdd_lpass.c
new file mode 100644
index 000000000000..34f97eb862cc
--- /dev/null
+++ b/core/hdd/src/wlan_hdd_lpass.c
@@ -0,0 +1,247 @@
+/*
+ * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved.
+ *
+ * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
+ *
+ *
+ * Permission to use, copy, modify, and/or distribute this software for
+ * any purpose with or without fee is hereby granted, provided that the
+ * above copyright notice and this permission notice appear in all
+ * copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
+ * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * This file was originally distributed by Qualcomm Atheros, Inc.
+ * under proprietary terms before Copyright ownership was assigned
+ * to the Linux Foundation.
+ */
+
+/**
+ * DOC: wlan_hdd_lpass.c
+ *
+ * WLAN Host Device Driver LPASS feature implementation
+ *
+ */
+
+/* denote that this file does not allow legacy hddLog */
+#define HDD_DISALLOW_LEGACY_HDDLOG 1
+
+/* Include Files */
+#include "wlan_hdd_main.h"
+#include "wlan_hdd_lpass.h"
+#include <cds_utils.h>
+#include "qwlan_version.h"
+
+/**
+ * wlan_hdd_gen_wlan_status_pack() - Create lpass adapter status package
+ * @data: Status data record to be created
+ * @adapter: Adapter whose status is to being packaged
+ * @sta_ctx: Station-specific context of @adapter
+ * @is_on: Is wlan driver loaded?
+ * @is_connected: Is @adapater connected to an AP?
+ *
+ * Generate a wlan vdev status package. The status info includes wlan
+ * on/off status, vdev ID, vdev mode, supported channels, etc.
+ *
+ * Return: 0 if package was created, otherwise a negative errno
+ */
+static int wlan_hdd_gen_wlan_status_pack(struct wlan_status_data *data,
+ hdd_adapter_t *adapter,
+ hdd_station_ctx_t *sta_ctx,
+ uint8_t is_on, uint8_t is_connected)
+{
+ hdd_context_t *hdd_ctx = NULL;
+ uint8_t buflen = WLAN_SVC_COUNTRY_CODE_LEN;
+
+ if (!data) {
+ hdd_err("invalid data pointer");
+ return -EINVAL;
+ }
+ if (!adapter) {
+ if (is_on) {
+ /* no active interface */
+ data->lpss_support = 0;
+ data->is_on = is_on;
+ return 0;
+ }
+ hdd_err("invalid adapter pointer");
+ return -EINVAL;
+ }
+
+ hdd_ctx = WLAN_HDD_GET_CTX(adapter);
+ if (hdd_ctx->lpss_support && hdd_ctx->config->enable_lpass_support)
+ data->lpss_support = 1;
+ else
+ data->lpss_support = 0;
+ data->numChannels = WLAN_SVC_MAX_NUM_CHAN;
+ sme_get_cfg_valid_channels(hdd_ctx->hHal, data->channel_list,
+ &data->numChannels);
+ sme_get_country_code(hdd_ctx->hHal, data->country_code, &buflen);
+ data->is_on = is_on;
+ data->vdev_id = adapter->sessionId;
+ data->vdev_mode = adapter->device_mode;
+ if (sta_ctx) {
+ data->is_connected = is_connected;
+ data->rssi = adapter->rssi;
+ data->freq =
+ cds_chan_to_freq(sta_ctx->conn_info.operationChannel);
+ if (WLAN_SVC_MAX_SSID_LEN >=
+ sta_ctx->conn_info.SSID.SSID.length) {
+ data->ssid_len = sta_ctx->conn_info.SSID.SSID.length;
+ memcpy(data->ssid,
+ sta_ctx->conn_info.SSID.SSID.ssId,
+ sta_ctx->conn_info.SSID.SSID.length);
+ }
+ if (QDF_MAC_ADDR_SIZE >= sizeof(sta_ctx->conn_info.bssId))
+ memcpy(data->bssid, sta_ctx->conn_info.bssId.bytes,
+ QDF_MAC_ADDR_SIZE);
+ }
+ return 0;
+}
+
+/**
+ * wlan_hdd_gen_wlan_version_pack() - Create lpass version package
+ * @data: Version data record to be created
+ * @fw_version: Version code from firmware
+ * @chip_id: WLAN chip ID
+ * @chip_name: WLAN chip name
+ *
+ * Generate a wlan software/hw version info package. The version info
+ * includes wlan host driver version, wlan fw driver version, wlan hw
+ * chip id & wlan hw chip name.
+ *
+ * Return: 0 if package was created, otherwise a negative errno
+ */
+static int wlan_hdd_gen_wlan_version_pack(struct wlan_version_data *data,
+ uint32_t fw_version,
+ uint32_t chip_id,
+ const char *chip_name)
+{
+ if (!data) {
+ hdd_err("invalid data pointer");
+ return -EINVAL;
+ }
+
+ data->chip_id = chip_id;
+ strlcpy(data->chip_name, chip_name, WLAN_SVC_MAX_STR_LEN);
+ if (strncmp(chip_name, "Unknown", 7))
+ strlcpy(data->chip_from, "Qualcomm", WLAN_SVC_MAX_STR_LEN);
+ else
+ strlcpy(data->chip_from, "Unknown", WLAN_SVC_MAX_STR_LEN);
+ strlcpy(data->host_version, QWLAN_VERSIONSTR, WLAN_SVC_MAX_STR_LEN);
+ scnprintf(data->fw_version, WLAN_SVC_MAX_STR_LEN, "%d.%d.%d.%d",
+ (fw_version & 0xf0000000) >> 28,
+ (fw_version & 0xf000000) >> 24,
+ (fw_version & 0xf00000) >> 20, (fw_version & 0x7fff));
+ return 0;
+}
+
+/**
+ * wlan_hdd_send_status_pkg() - Send adapter status to lpass
+ * @adapter: Adapter whose status is to be sent to lpass
+ * @sta_ctx: Station-specific context of @adapter
+ * @is_on: Is @adapter enabled
+ * @is_connected: Is @adapater connected
+ *
+ * Generate wlan vdev status pacakge and send it to a user space
+ * daemon through netlink.
+ *
+ * Return: none
+ */
+void wlan_hdd_send_status_pkg(hdd_adapter_t *adapter,
+ hdd_station_ctx_t *sta_ctx,
+ uint8_t is_on, uint8_t is_connected)
+{
+ int ret = 0;
+ struct wlan_status_data data;
+
+ if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam())
+ return;
+
+ memset(&data, 0, sizeof(struct wlan_status_data));
+ if (is_on)
+ ret = wlan_hdd_gen_wlan_status_pack(&data, adapter, sta_ctx,
+ is_on, is_connected);
+ if (!ret)
+ wlan_hdd_send_svc_nlink_msg(WLAN_SVC_WLAN_STATUS_IND,
+ &data, sizeof(data));
+}
+
+/**
+ * wlan_hdd_send_version_pkg() - report version information to lpass
+ * @fw_version: Version code from firmware
+ * @chip_id: WLAN chip ID
+ * @chip_name: WLAN chip name
+ *
+ * Generate a wlan sw/hw version info package and send it to a user
+ * space daemon through netlink.
+ *
+ * Return: none
+ */
+void wlan_hdd_send_version_pkg(uint32_t fw_version,
+ uint32_t chip_id, const char *chip_name)
+{
+ int ret = 0;
+ struct wlan_version_data data;
+
+ if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam())
+ return;
+
+ memset(&data, 0, sizeof(struct wlan_version_data));
+ ret = wlan_hdd_gen_wlan_version_pack(&data, fw_version, chip_id,
+ chip_name);
+ if (!ret)
+ wlan_hdd_send_svc_nlink_msg(WLAN_SVC_WLAN_VERSION_IND,
+ &data, sizeof(data));
+}
+
+/**
+ * wlan_hdd_send_all_scan_intf_info() - report scan interfaces to lpass
+ * @hdd_ctx: The global HDD context
+ *
+ * This function iterates through all of the interfaces registered
+ * with HDD and indicates to lpass all that support scanning.
+ * If no interfaces support scanning then that fact is also indicated.
+ *
+ * Return: none
+ */
+void wlan_hdd_send_all_scan_intf_info(hdd_context_t *hdd_ctx)
+{
+ hdd_adapter_t *adapter = NULL;
+ hdd_adapter_list_node_t *node = NULL, *next = NULL;
+ bool scan_intf_found = false;
+ QDF_STATUS status;
+
+ if (!hdd_ctx) {
+ hdd_err("NULL pointer for hdd_ctx");
+ return;
+ }
+
+ status = hdd_get_front_adapter(hdd_ctx, &node);
+ while (NULL != node && QDF_STATUS_SUCCESS == status) {
+ adapter = node->pAdapter;
+ if (adapter) {
+ if (adapter->device_mode == QDF_STA_MODE
+ || adapter->device_mode == QDF_P2P_CLIENT_MODE
+ || adapter->device_mode ==
+ QDF_P2P_DEVICE_MODE) {
+ scan_intf_found = true;
+ wlan_hdd_send_status_pkg(adapter, NULL, 1, 0);
+ }
+ }
+ status = hdd_get_next_adapter(hdd_ctx, node, &next);
+ node = next;
+ }
+
+ if (!scan_intf_found)
+ wlan_hdd_send_status_pkg(adapter, NULL, 1, 0);
+}
diff --git a/core/hdd/src/wlan_hdd_lpass.h b/core/hdd/src/wlan_hdd_lpass.h
new file mode 100644
index 000000000000..2fb5d70c7792
--- /dev/null
+++ b/core/hdd/src/wlan_hdd_lpass.h
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved.
+ *
+ * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
+ *
+ *
+ * Permission to use, copy, modify, and/or distribute this software for
+ * any purpose with or without fee is hereby granted, provided that the
+ * above copyright notice and this permission notice appear in all
+ * copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
+ * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * This file was originally distributed by Qualcomm Atheros, Inc.
+ * under proprietary terms before Copyright ownership was assigned
+ * to the Linux Foundation.
+ */
+
+#if !defined(WLAN_HDD_LPASS_H)
+#define WLAN_HDD_LPASS_H
+
+#ifdef WLAN_FEATURE_LPSS
+void wlan_hdd_send_status_pkg(hdd_adapter_t *adapter,
+ hdd_station_ctx_t *sta_ctx,
+ uint8_t is_on, uint8_t is_connected);
+void wlan_hdd_send_version_pkg(uint32_t fw_version,
+ uint32_t chip_id, const char *chip_name);
+void wlan_hdd_send_all_scan_intf_info(hdd_context_t *hdd_ctx);
+#else
+static inline void wlan_hdd_send_status_pkg(hdd_adapter_t *adapter,
+ hdd_station_ctx_t *sta_ctx,
+ uint8_t is_on, uint8_t is_connected)
+{
+ return;
+}
+
+static inline void wlan_hdd_send_version_pkg(uint32_t fw_version,
+ uint32_t chip_id,
+ const char *chip_name)
+{
+ return;
+}
+
+static inline void wlan_hdd_send_all_scan_intf_info(hdd_context_t *hdd_ctx)
+{
+ return;
+}
+#endif
+
+#endif /* WLAN_HDD_LPASS_H */
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c
index 59031a396309..411982e2177f 100644
--- a/core/hdd/src/wlan_hdd_main.c
+++ b/core/hdd/src/wlan_hdd_main.c
@@ -103,6 +103,7 @@
#include "bmi.h"
#include <wlan_hdd_regulatory.h>
#include "ol_rx_fwd.h"
+#include "wlan_hdd_lpass.h"
#ifdef MODULE
#define WLAN_MODULE_NAME module_name(THIS_MODULE)
@@ -227,6 +228,7 @@ const char *hdd_device_mode_to_string(uint8_t device_mode)
CASE_RETURN_STRING(QDF_IBSS_MODE);
CASE_RETURN_STRING(QDF_P2P_DEVICE_MODE);
CASE_RETURN_STRING(QDF_OCB_MODE);
+ CASE_RETURN_STRING(QDF_NDI_MODE);
default:
return "Unknown";
}
@@ -1374,11 +1376,12 @@ void hdd_update_tgt_cfg(void *context, void *param)
hdd_ctx->ap_arpns_support = cfg->ap_arpns_support;
hdd_update_tgt_services(hdd_ctx, &cfg->services);
- hdd_update_vdev_nss(hdd_ctx);
-
hdd_update_tgt_ht_cap(hdd_ctx, &cfg->ht_cap);
hdd_update_tgt_vht_cap(hdd_ctx, &cfg->vht_cap);
+
+ hdd_update_vdev_nss(hdd_ctx);
+
hdd_ctx->config->fine_time_meas_cap &= cfg->fine_time_measurement_cap;
hdd_ctx->fine_time_meas_cap_target = cfg->fine_time_measurement_cap;
hdd_info(FL("fine_time_meas_cap: 0x%x"),
@@ -1391,6 +1394,8 @@ void hdd_update_tgt_cfg(void *context, void *param)
hdd_ctx->current_antenna_mode);
hdd_ctx->bpf_enabled = cfg->bpf_enabled;
+ /* Configure NAN datapath features */
+ hdd_nan_datapath_target_config(hdd_ctx, cfg);
}
/**
@@ -1398,9 +1403,9 @@ void hdd_update_tgt_cfg(void *context, void *param)
* @context: HDD context pointer
* @param: HDD radar indication pointer
*
- * This function is invoked when a radar in found on the
- * SAP current operating channel and Data Tx from netif
- * has to be stopped to honor the DFS regulations.
+ * This function is invoked in atomic context when a radar
+ * is found on the SAP current operating channel and Data Tx
+ * from netif has to be stopped to honor the DFS regulations.
* Actions: Stop the netif Tx queues,Indicate Radar present
* in HDD context for future usage.
*
@@ -1420,18 +1425,18 @@ bool hdd_dfs_indicate_radar(void *context, void *param)
return true;
if (true == hdd_radar_event->dfs_radar_status) {
- mutex_lock(&hdd_ctx->dfs_lock);
+ qdf_spin_lock_bh(&hdd_ctx->dfs_lock);
if (hdd_ctx->dfs_radar_found) {
/*
* Application already triggered channel switch
* on current channel, so return here.
*/
- mutex_unlock(&hdd_ctx->dfs_lock);
+ qdf_spin_unlock_bh(&hdd_ctx->dfs_lock);
return false;
}
hdd_ctx->dfs_radar_found = true;
- mutex_unlock(&hdd_ctx->dfs_lock);
+ qdf_spin_unlock_bh(&hdd_ctx->dfs_lock);
status = hdd_get_front_adapter(hdd_ctx, &adapterNode);
while (NULL != adapterNode && QDF_STATUS_SUCCESS == status) {
@@ -2150,7 +2155,7 @@ QDF_STATUS hdd_register_interface(hdd_adapter_t *adapter,
return QDF_STATUS_SUCCESS;
}
-static QDF_STATUS hdd_sme_close_session_callback(void *pContext)
+QDF_STATUS hdd_sme_close_session_callback(void *pContext)
{
hdd_adapter_t *adapter = pContext;
@@ -2164,6 +2169,12 @@ static QDF_STATUS hdd_sme_close_session_callback(void *pContext)
return QDF_STATUS_NOT_INITIALIZED;
}
+ /*
+ * For NAN Data interface, the close session results in the final
+ * indication to the userspace
+ */
+ hdd_ndp_session_end_handler(adapter);
+
clear_bit(SME_SESSION_OPENED, &adapter->event_flags);
/*
@@ -2545,6 +2556,7 @@ hdd_adapter_t *hdd_open_adapter(hdd_context_t *hdd_ctx, uint8_t session_type,
case QDF_P2P_DEVICE_MODE:
case QDF_OCB_MODE:
case QDF_MONITOR_MODE:
+ case QDF_NDI_MODE:
{
adapter = hdd_alloc_station_adapter(hdd_ctx, macAddr,
name_assign_type,
@@ -2568,7 +2580,11 @@ hdd_adapter_t *hdd_open_adapter(hdd_context_t *hdd_ctx, uint8_t session_type,
adapter->device_mode = session_type;
- status = hdd_init_station_mode(adapter);
+ if (QDF_NDI_MODE == session_type)
+ status = hdd_init_nan_data_mode(adapter);
+ else
+ status = hdd_init_station_mode(adapter);
+
if (QDF_STATUS_SUCCESS != status)
goto err_free_netdev;
@@ -3045,21 +3061,33 @@ QDF_STATUS hdd_stop_adapter(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter,
case QDF_P2P_CLIENT_MODE:
case QDF_IBSS_MODE:
case QDF_P2P_DEVICE_MODE:
- if (hdd_conn_is_connected(
+ case QDF_NDI_MODE:
+ if ((QDF_NDI_MODE == adapter->device_mode) ||
+ hdd_conn_is_connected(
WLAN_HDD_GET_STATION_CTX_PTR(adapter)) ||
hdd_is_connecting(
WLAN_HDD_GET_STATION_CTX_PTR(adapter))) {
- if (pWextState->roamProfile.BSSType ==
- eCSR_BSS_TYPE_START_IBSS)
- qdf_ret_status =
- sme_roam_disconnect(hdd_ctx->hHal,
- adapter->sessionId,
- eCSR_DISCONNECT_REASON_IBSS_LEAVE);
+ INIT_COMPLETION(adapter->disconnect_comp_var);
+ /*
+ * For NDI do not use pWextState from sta_ctx, if needed
+ * extract from ndi_ctx.
+ */
+ if (QDF_NDI_MODE == adapter->device_mode)
+ qdf_ret_status = sme_roam_disconnect(
+ hdd_ctx->hHal,
+ adapter->sessionId,
+ eCSR_DISCONNECT_REASON_NDI_DELETE);
+ else if (pWextState->roamProfile.BSSType ==
+ eCSR_BSS_TYPE_START_IBSS)
+ qdf_ret_status = sme_roam_disconnect(
+ hdd_ctx->hHal,
+ adapter->sessionId,
+ eCSR_DISCONNECT_REASON_IBSS_LEAVE);
else
- qdf_ret_status =
- sme_roam_disconnect(hdd_ctx->hHal,
- adapter->sessionId,
- eCSR_DISCONNECT_REASON_UNSPECIFIED);
+ qdf_ret_status = sme_roam_disconnect(
+ hdd_ctx->hHal,
+ adapter->sessionId,
+ eCSR_DISCONNECT_REASON_UNSPECIFIED);
/* success implies disconnect command got queued up successfully */
if (qdf_ret_status == QDF_STATUS_SUCCESS) {
rc = wait_for_completion_timeout(
@@ -4651,6 +4679,24 @@ void hdd_pld_request_bus_bandwidth(hdd_context_t *hdd_ctx,
next_vote_level, tx_packets, rx_packets);
hdd_ctx->cur_vote_level = next_vote_level;
pld_request_bus_bandwidth(hdd_ctx->parent_dev, next_vote_level);
+ if (next_vote_level == PLD_BUS_WIDTH_LOW) {
+ if (hdd_ctx->hbw_requested) {
+ pld_remove_pm_qos(hdd_ctx->parent_dev);
+ hdd_ctx->hbw_requested = false;
+ }
+ if (cds_sched_handle_throughput_req(false))
+ hdd_log(LOGE,
+ FL("low bandwidth set rx affinity fail"));
+ } else {
+ if (!hdd_ctx->hbw_requested) {
+ pld_request_pm_qos(hdd_ctx->parent_dev, 1);
+ hdd_ctx->hbw_requested = true;
+ }
+
+ if (cds_sched_handle_throughput_req(true))
+ hdd_log(LOGE,
+ FL("high bandwidth set rx affinity fail"));
+ }
}
/* fine-tuning parameters for RX Flows */
@@ -6416,6 +6462,52 @@ out:
}
/**
+ * wlan_hdd_p2p_lo_event_callback - P2P listen offload stop event handler
+ * @context_ptr - hdd context pointer
+ * @event_ptr - event structure pointer
+ *
+ * This is the p2p listen offload stop event handler, it sends vendor
+ * event back to supplicant to notify the stop reason.
+ *
+ * Return: None
+ */
+static void wlan_hdd_p2p_lo_event_callback(void *context_ptr,
+ void *event_ptr)
+{
+ hdd_context_t *hdd_ctx = (hdd_context_t *)context_ptr;
+ struct sir_p2p_lo_event *evt = event_ptr;
+ struct sk_buff *vendor_event;
+
+ ENTER();
+
+ if (hdd_ctx == NULL) {
+ hdd_err("Invalid HDD context pointer");
+ return;
+ }
+
+ vendor_event =
+ cfg80211_vendor_event_alloc(hdd_ctx->wiphy,
+ NULL, sizeof(uint32_t) + NLMSG_HDRLEN,
+ QCA_NL80211_VENDOR_SUBCMD_P2P_LO_EVENT_INDEX,
+ GFP_KERNEL);
+
+ if (!vendor_event) {
+ hdd_err("cfg80211_vendor_event_alloc failed");
+ return;
+ }
+
+ if (nla_put_u32(vendor_event,
+ QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_STOP_REASON,
+ evt->reason_code)) {
+ hdd_err("nla put failed");
+ kfree_skb(vendor_event);
+ return;
+ }
+
+ cfg80211_vendor_event(vendor_event, GFP_KERNEL);
+}
+
+/**
* hdd_adaptive_dwelltime_init() - initialization for adaptive dwell time config
* @hdd_ctx: HDD context
*
@@ -6467,6 +6559,8 @@ int hdd_wlan_startup(struct device *dev, void *hif_sc)
int ret;
tSirTxPowerLimit hddtxlimit;
bool rtnl_held;
+ /* structure of function pointers to be used by CDS */
+ struct cds_sme_cbacks sme_cbacks;
ENTER();
@@ -6619,7 +6713,9 @@ int hdd_wlan_startup(struct device *dev, void *hif_sc)
#endif
wlan_hdd_nan_init(hdd_ctx);
- status = cds_init_policy_mgr(sme_get_cfg_valid_channels);
+ sme_cbacks.sme_get_valid_channels = sme_get_cfg_valid_channels;
+ sme_cbacks.sme_get_nss_for_vdev = sme_get_vdev_type_nss;
+ status = cds_init_policy_mgr(&sme_cbacks);
if (!QDF_IS_STATUS_SUCCESS(status)) {
hdd_err("Policy manager initialization failed");
goto err_debugfs_exit;
@@ -6686,6 +6782,11 @@ int hdd_wlan_startup(struct device *dev, void *hif_sc)
}
}
+ /* register P2P Listen Offload event callback */
+ if (wma_is_p2p_lo_capable())
+ sme_register_p2p_lo_event(hdd_ctx->hHal, hdd_ctx,
+ wlan_hdd_p2p_lo_event_callback);
+
ret = hdd_register_notifiers(hdd_ctx);
if (ret)
goto err_debugfs_exit;
@@ -6847,86 +6948,6 @@ QDF_STATUS hdd_issta_p2p_clientconnected(hdd_context_t *hdd_ctx)
return sme_is_sta_p2p_client_connected(hdd_ctx->hHal);
}
-#ifdef WLAN_FEATURE_LPSS
-int wlan_hdd_gen_wlan_status_pack(struct wlan_status_data *data,
- hdd_adapter_t *adapter,
- hdd_station_ctx_t *pHddStaCtx,
- uint8_t is_on, uint8_t is_connected)
-{
- hdd_context_t *hdd_ctx = NULL;
- uint8_t buflen = WLAN_SVC_COUNTRY_CODE_LEN;
-
- if (!data) {
- hddLog(LOGE, FL("invalid data pointer"));
- return -EINVAL;
- }
- if (!adapter) {
- if (is_on) {
- /* no active interface */
- data->lpss_support = 0;
- data->is_on = is_on;
- return 0;
- }
- hddLog(LOGE, FL("invalid adapter pointer"));
- return -EINVAL;
- }
-
- hdd_ctx = WLAN_HDD_GET_CTX(adapter);
- if (hdd_ctx->lpss_support && hdd_ctx->config->enable_lpass_support)
- data->lpss_support = 1;
- else
- data->lpss_support = 0;
- data->numChannels = WLAN_SVC_MAX_NUM_CHAN;
- sme_get_cfg_valid_channels(hdd_ctx->hHal, data->channel_list,
- &data->numChannels);
- sme_get_country_code(hdd_ctx->hHal, data->country_code, &buflen);
- data->is_on = is_on;
- data->vdev_id = adapter->sessionId;
- data->vdev_mode = adapter->device_mode;
- if (pHddStaCtx) {
- data->is_connected = is_connected;
- data->rssi = adapter->rssi;
- data->freq =
- cds_chan_to_freq(pHddStaCtx->conn_info.operationChannel);
- if (WLAN_SVC_MAX_SSID_LEN >=
- pHddStaCtx->conn_info.SSID.SSID.length) {
- data->ssid_len = pHddStaCtx->conn_info.SSID.SSID.length;
- memcpy(data->ssid,
- pHddStaCtx->conn_info.SSID.SSID.ssId,
- pHddStaCtx->conn_info.SSID.SSID.length);
- }
- if (QDF_MAC_ADDR_SIZE >=
- sizeof(pHddStaCtx->conn_info.bssId))
- memcpy(data->bssid, pHddStaCtx->conn_info.bssId.bytes,
- QDF_MAC_ADDR_SIZE);
- }
- return 0;
-}
-
-int wlan_hdd_gen_wlan_version_pack(struct wlan_version_data *data,
- uint32_t fw_version,
- uint32_t chip_id, const char *chip_name)
-{
- if (!data) {
- hddLog(LOGE, FL("invalid data pointer"));
- return -EINVAL;
- }
-
- data->chip_id = chip_id;
- strlcpy(data->chip_name, chip_name, WLAN_SVC_MAX_STR_LEN);
- if (strncmp(chip_name, "Unknown", 7))
- strlcpy(data->chip_from, "Qualcomm", WLAN_SVC_MAX_STR_LEN);
- else
- strlcpy(data->chip_from, "Unknown", WLAN_SVC_MAX_STR_LEN);
- strlcpy(data->host_version, QWLAN_VERSIONSTR, WLAN_SVC_MAX_STR_LEN);
- scnprintf(data->fw_version, WLAN_SVC_MAX_STR_LEN, "%d.%d.%d.%d",
- (fw_version & 0xf0000000) >> 28,
- (fw_version & 0xf000000) >> 24,
- (fw_version & 0xf00000) >> 20, (fw_version & 0x7fff));
- return 0;
-}
-#endif
-
/**
* wlan_hdd_disable_roaming() - disable roaming on all STAs except the input one
* @adapter: HDD adapter pointer
@@ -7097,81 +7118,6 @@ void wlan_hdd_send_svc_nlink_msg(int type, void *data, int len)
return;
}
-#ifdef WLAN_FEATURE_LPSS
-void wlan_hdd_send_status_pkg(hdd_adapter_t *adapter,
- hdd_station_ctx_t *pHddStaCtx,
- uint8_t is_on, uint8_t is_connected)
-{
- int ret = 0;
- struct wlan_status_data data;
-
- if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam())
- return;
-
- memset(&data, 0, sizeof(struct wlan_status_data));
- if (is_on)
- ret = wlan_hdd_gen_wlan_status_pack(&data, adapter, pHddStaCtx,
- is_on, is_connected);
- if (!ret)
- wlan_hdd_send_svc_nlink_msg(WLAN_SVC_WLAN_STATUS_IND,
- &data,
- sizeof(struct wlan_status_data));
-}
-
-void wlan_hdd_send_version_pkg(uint32_t fw_version,
- uint32_t chip_id, const char *chip_name)
-{
- int ret = 0;
- struct wlan_version_data data;
-
- if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam())
- return;
-
- memset(&data, 0, sizeof(struct wlan_version_data));
- ret =
- wlan_hdd_gen_wlan_version_pack(&data, fw_version, chip_id,
- chip_name);
- if (!ret)
- wlan_hdd_send_svc_nlink_msg(WLAN_SVC_WLAN_VERSION_IND,
- &data,
- sizeof(struct wlan_version_data));
-}
-
-void wlan_hdd_send_all_scan_intf_info(hdd_context_t *hdd_ctx)
-{
- hdd_adapter_t *pDataAdapter = NULL;
- hdd_adapter_list_node_t *adapterNode = NULL, *pNext = NULL;
- bool scan_intf_found = false;
- QDF_STATUS status;
-
- if (!hdd_ctx) {
- hddLog(QDF_TRACE_LEVEL_ERROR,
- FL("NULL pointer for hdd_ctx"));
- return;
- }
-
- status = hdd_get_front_adapter(hdd_ctx, &adapterNode);
- while (NULL != adapterNode && QDF_STATUS_SUCCESS == status) {
- pDataAdapter = adapterNode->pAdapter;
- if (pDataAdapter) {
- if (pDataAdapter->device_mode == QDF_STA_MODE
- || pDataAdapter->device_mode == QDF_P2P_CLIENT_MODE
- || pDataAdapter->device_mode ==
- QDF_P2P_DEVICE_MODE) {
- scan_intf_found = true;
- wlan_hdd_send_status_pkg(pDataAdapter, NULL, 1,
- 0);
- }
- }
- status = hdd_get_next_adapter(hdd_ctx, adapterNode, &pNext);
- adapterNode = pNext;
- }
-
- if (!scan_intf_found)
- wlan_hdd_send_status_pkg(pDataAdapter, NULL, 1, 0);
-}
-#endif
-
#ifdef FEATURE_WLAN_AUTO_SHUTDOWN
void wlan_hdd_auto_shutdown_cb(void)
{
diff --git a/core/hdd/src/wlan_hdd_nan_datapath.c b/core/hdd/src/wlan_hdd_nan_datapath.c
index 3c955f33ae3e..5405559088d0 100644
--- a/core/hdd/src/wlan_hdd_nan_datapath.c
+++ b/core/hdd/src/wlan_hdd_nan_datapath.c
@@ -23,4 +23,1935 @@
*
* WLAN Host Device Driver nan datapath API implementation
*/
-#include "wlan_hdd_nan_datapath.h"
+#include <wlan_hdd_includes.h>
+#include <linux/if.h>
+#include <linux/netdevice.h>
+#include <linux/skbuff.h>
+#include <linux/etherdevice.h>
+#include "wlan_hdd_includes.h"
+#include "wlan_hdd_p2p.h"
+#include "wma_api.h"
+#include "wlan_hdd_assoc.h"
+#include "sme_nan_datapath.h"
+
+/* NLA policy */
+static const struct nla_policy
+qca_wlan_vendor_ndp_policy[QCA_WLAN_VENDOR_ATTR_NDP_PARAMS_MAX + 1] = {
+ [QCA_WLAN_VENDOR_ATTR_NDP_SUBCMD] = { .type = NLA_U32 },
+ [QCA_WLAN_VENDOR_ATTR_NDP_TRANSACTION_ID] = { .type = NLA_U16 },
+ [QCA_WLAN_VENDOR_ATTR_NDP_IFACE_STR] = { .type = NLA_STRING,
+ .len = IFNAMSIZ },
+ [QCA_WLAN_VENDOR_ATTR_NDP_SERVICE_INSTANCE_ID] = { .type = NLA_U16 },
+ [QCA_WLAN_VENDOR_ATTR_NDP_CHANNEL] = { .type = NLA_U32 },
+ [QCA_WLAN_VENDOR_ATTR_NDP_PEER_DISCOVERY_MAC_ADDR] = {
+ .type = NLA_BINARY,
+ .len = QDF_MAC_ADDR_SIZE },
+ [QCA_WLAN_VENDOR_ATTR_NDP_CONFIG_SECURITY] = { .type = NLA_U16 },
+ [QCA_WLAN_VENDOR_ATTR_NDP_CONFIG_QOS] = { .type = NLA_BINARY,
+ .len = NDP_QOS_INFO_LEN },
+ [QCA_WLAN_VENDOR_ATTR_NDP_APP_INFO] = { .type = NLA_BINARY,
+ .len = NDP_APP_INFO_LEN },
+ [QCA_WLAN_VENDOR_ATTR_NDP_INSTANCE_ID] = { .type = NLA_U32 },
+ [QCA_WLAN_VENDOR_ATTR_NDP_RESPONSE_CODE] = { .type = NLA_U16 },
+ [QCA_WLAN_VENDOR_ATTR_NDP_NDI_MAC_ADDR] = { .type = NLA_BINARY,
+ .len = QDF_MAC_ADDR_SIZE },
+ [QCA_WLAN_VENDOR_ATTR_NDP_INSTANCE_ID_ARRAY] = { .type = NLA_BINARY,
+ .len = NDP_NUM_INSTANCE_ID },
+};
+
+/**
+ * hdd_ndp_print_ini_config()- Print nan datapath specific INI configuration
+ * @hdd_ctx: handle to hdd context
+ *
+ * Return: None
+ */
+void hdd_ndp_print_ini_config(hdd_context_t *hdd_ctx)
+{
+ hdd_info("Name = [%s] Value = [%u]", CFG_ENABLE_NAN_DATAPATH_NAME,
+ hdd_ctx->config->enable_nan_datapath);
+ hdd_info("Name = [%s] Value = [%u]", CFG_ENABLE_NAN_NDI_CHANNEL_NAME,
+ hdd_ctx->config->nan_datapath_ndi_channel);
+}
+
+/**
+ * hdd_nan_datapath_target_config() - Configure NAN datapath features
+ * @hdd_ctx: Pointer to HDD context
+ * @cfg: Pointer to target device capability information
+ *
+ * NAN datapath functionality is enabled if it is enabled in
+ * .ini file and also supported on target device.
+ *
+ * Return: None
+ */
+void hdd_nan_datapath_target_config(hdd_context_t *hdd_ctx,
+ struct wma_tgt_cfg *cfg)
+{
+ hdd_ctx->nan_datapath_enabled =
+ hdd_ctx->config->enable_nan_datapath &&
+ cfg->nan_datapath_enabled;
+ hdd_info("enable_nan_datapath: %d", hdd_ctx->nan_datapath_enabled);
+}
+
+/**
+ * hdd_close_ndi() - close NAN Data interface
+ * @adapter: adapter context
+ *
+ * Close the adapter if start BSS fails
+ *
+ * Returns: 0 on success, negative error code otherwise
+ */
+static int hdd_close_ndi(hdd_adapter_t *adapter)
+{
+ int rc;
+ hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
+ uint32_t timeout = WLAN_WAIT_TIME_SESSIONOPENCLOSE;
+
+ ENTER();
+
+ /* check if the adapter is in NAN Data mode */
+ if (QDF_NDI_MODE != adapter->device_mode) {
+ hdd_err("Interface is not in NDI mode");
+ return -EINVAL;
+ }
+ wlan_hdd_netif_queue_control(adapter,
+ WLAN_NETIF_TX_DISABLE_N_CARRIER,
+ WLAN_CONTROL_PATH);
+
+#ifdef WLAN_OPEN_SOURCE
+ cancel_work_sync(&adapter->ipv4NotifierWorkQueue);
+#endif
+ hdd_deregister_tx_flow_control(adapter);
+
+#ifdef WLAN_NS_OFFLOAD
+#ifdef WLAN_OPEN_SOURCE
+ cancel_work_sync(&adapter->ipv6NotifierWorkQueue);
+#endif
+#endif
+ /* check if the session is open */
+ if (test_bit(SME_SESSION_OPENED, &adapter->event_flags)) {
+ INIT_COMPLETION(adapter->session_close_comp_var);
+ if (QDF_STATUS_SUCCESS == sme_close_session(hdd_ctx->hHal,
+ adapter->sessionId,
+ hdd_sme_close_session_callback, adapter)) {
+ /* Block on a timed completion variable */
+ rc = wait_for_completion_timeout(
+ &adapter->session_close_comp_var,
+ msecs_to_jiffies(timeout));
+ if (!rc)
+ hdd_err("session close timeout");
+ }
+ }
+
+ /* We are good to close the adapter */
+ hdd_close_adapter(hdd_ctx, adapter, true);
+
+ EXIT();
+ return 0;
+}
+
+/**
+ * hdd_is_ndp_allowed() - Indicates if NDP is allowed
+ * @hdd_ctx: hdd context
+ *
+ * NDP is not allowed with any other role active except STA.
+ *
+ * Return: true if allowed, false otherwise
+ */
+static bool hdd_is_ndp_allowed(hdd_context_t *hdd_ctx)
+{
+ hdd_adapter_t *adapter;
+ hdd_station_ctx_t *sta_ctx;
+ QDF_STATUS status;
+ hdd_adapter_list_node_t *curr = NULL, *next = NULL;
+
+ status = hdd_get_front_adapter(hdd_ctx, &curr);
+ while (QDF_STATUS_SUCCESS == status) {
+ adapter = curr->pAdapter;
+ if (!adapter)
+ goto next_adapter;
+
+ switch (adapter->device_mode) {
+ case QDF_P2P_GO_MODE:
+ case QDF_SAP_MODE:
+ if (test_bit(SOFTAP_BSS_STARTED,
+ &adapter->event_flags))
+ return false;
+ break;
+ case QDF_P2P_CLIENT_MODE:
+ case QDF_IBSS_MODE:
+ sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
+ if (hdd_conn_is_connected(sta_ctx) ||
+ hdd_is_connecting(sta_ctx))
+ return false;
+ break;
+ default:
+ break;
+ }
+next_adapter:
+ status = hdd_get_next_adapter(hdd_ctx, curr, &next);
+ curr = next;
+ }
+
+ return true;
+}
+
+/**
+ * hdd_ndi_start_bss() - Start BSS on NAN data interface
+ * @adapter: adapter context
+ * @operating_channel: channel on which the BSS to be started
+ *
+ * Return: 0 on success, error value on failure
+ */
+static int hdd_ndi_start_bss(hdd_adapter_t *adapter,
+ uint8_t operating_channel)
+{
+ int ret;
+ uint32_t roam_id;
+ hdd_wext_state_t *wext_state =
+ WLAN_HDD_GET_WEXT_STATE_PTR(adapter);
+ tCsrRoamProfile *roam_profile = &wext_state->roamProfile;
+
+ ENTER();
+
+ if (!roam_profile) {
+ hdd_err("No valid roam profile");
+ return -EINVAL;
+ }
+
+ if (HDD_WMM_USER_MODE_NO_QOS ==
+ (WLAN_HDD_GET_CTX(adapter))->config->WmmMode) {
+ /* QoS not enabled in cfg file*/
+ roam_profile->uapsd_mask = 0;
+ } else {
+ /* QoS enabled, update uapsd mask from cfg file*/
+ roam_profile->uapsd_mask =
+ (WLAN_HDD_GET_CTX(adapter))->config->UapsdMask;
+ }
+
+ roam_profile->csrPersona = adapter->device_mode;
+
+ roam_profile->ChannelInfo.numOfChannels = 1;
+ if (operating_channel) {
+ roam_profile->ChannelInfo.ChannelList = &operating_channel;
+ } else {
+ roam_profile->ChannelInfo.ChannelList[0] =
+ NAN_SOCIAL_CHANNEL_2_4GHZ;
+ }
+ hdd_select_cbmode(adapter, operating_channel);
+
+ roam_profile->SSIDs.numOfSSIDs = 1;
+ roam_profile->SSIDs.SSIDList->SSID.length = 0;
+
+ roam_profile->phyMode = eCSR_DOT11_MODE_11ac;
+ roam_profile->BSSType = eCSR_BSS_TYPE_NDI;
+ roam_profile->BSSIDs.numOfBSSIDs = 1;
+ qdf_mem_copy((void *)(roam_profile->BSSIDs.bssid),
+ &adapter->macAddressCurrent.bytes[0],
+ QDF_MAC_ADDR_SIZE);
+
+ roam_profile->AuthType.numEntries = 1;
+ roam_profile->AuthType.authType[0] = eCSR_AUTH_TYPE_OPEN_SYSTEM;
+ roam_profile->EncryptionType.numEntries = 1;
+ roam_profile->EncryptionType.encryptionType[0] = eCSR_ENCRYPT_TYPE_NONE;
+
+ ret = sme_roam_connect(WLAN_HDD_GET_HAL_CTX(adapter),
+ adapter->sessionId, roam_profile, &roam_id);
+ if (QDF_STATUS_SUCCESS != ret) {
+ hdd_err("NDI sme_RoamConnect session %d failed with status %d -> NotConnected",
+ adapter->sessionId, ret);
+ /* change back to NotConnected */
+ hdd_conn_set_connection_state(adapter,
+ eConnectionState_NotConnected);
+ } else {
+ hdd_info("sme_RoamConnect issued successfully for NDI");
+ }
+
+ roam_profile->ChannelInfo.ChannelList = NULL;
+ roam_profile->ChannelInfo.numOfChannels = 0;
+
+ EXIT();
+
+ return ret;
+}
+
+
+/**
+ * hdd_ndi_create_req_handler() - NDI create request handler
+ * @hdd_ctx: hdd context
+ * @tb: parsed NL attribute list
+ *
+ * Return: 0 on success or error code on failure
+ */
+static int hdd_ndi_create_req_handler(hdd_context_t *hdd_ctx,
+ struct nlattr **tb)
+{
+ hdd_adapter_t *adapter;
+ char *iface_name;
+ uint16_t transaction_id;
+ int ret;
+ struct nan_datapath_ctx *ndp_ctx;
+ uint8_t op_channel =
+ hdd_ctx->config->nan_datapath_ndi_channel;
+
+ ENTER();
+
+ if (!tb[QCA_WLAN_VENDOR_ATTR_NDP_IFACE_STR]) {
+ hdd_err("Interface name string is unavailable");
+ return -EINVAL;
+ }
+ iface_name = nla_data(tb[QCA_WLAN_VENDOR_ATTR_NDP_IFACE_STR]);
+
+ if (!tb[QCA_WLAN_VENDOR_ATTR_NDP_TRANSACTION_ID]) {
+ hdd_err("transaction id is unavailable");
+ return -EINVAL;
+ }
+ transaction_id =
+ nla_get_u16(tb[QCA_WLAN_VENDOR_ATTR_NDP_TRANSACTION_ID]);
+
+ /* Check for an existing interface of NDI type */
+ adapter = hdd_get_adapter(hdd_ctx, QDF_NDI_MODE);
+ if (adapter) {
+ hdd_err("Cannot support more than one NDI");
+ return -EEXIST;
+ }
+
+ adapter = hdd_open_adapter(hdd_ctx, QDF_NDI_MODE, iface_name,
+ wlan_hdd_get_intf_addr(hdd_ctx), NET_NAME_UNKNOWN,
+ true);
+ if (!adapter) {
+ hdd_err("hdd_open_adapter failed");
+ return -ENOMEM;
+ }
+
+ /*
+ * Create transaction id is required to be saved since the firmware
+ * does not honor the transaction id for create request
+ */
+ ndp_ctx = WLAN_HDD_GET_NDP_CTX_PTR(adapter);
+ ndp_ctx->ndp_create_transaction_id = transaction_id;
+ ndp_ctx->state = NAN_DATA_NDI_CREATING_STATE;
+
+ /*
+ * The NAN data interface has been created at this point.
+ * Unlike traditional device modes, where the higher application
+ * layer initiates connect / join / start, the NAN data interface
+ * does not have any such formal requests. The NDI create request
+ * is responsible for starting the BSS as well.
+ */
+ if (op_channel != NAN_SOCIAL_CHANNEL_2_4GHZ ||
+ op_channel != NAN_SOCIAL_CHANNEL_5GHZ_LOWER_BAND ||
+ op_channel != NAN_SOCIAL_CHANNEL_5GHZ_UPPER_BAND) {
+ /* start NDI on the default 2.4 GHz social channel */
+ op_channel = NAN_SOCIAL_CHANNEL_2_4GHZ;
+ }
+ ret = hdd_ndi_start_bss(adapter, op_channel);
+ if (0 > ret) {
+ hdd_err("NDI start bss failed");
+ /* Start BSS failed, delete the interface */
+ hdd_close_ndi(adapter);
+ }
+
+ EXIT();
+ return ret;
+}
+
+/**
+ * hdd_ndi_delete_req_handler() - NDI delete request handler
+ * @hdd_ctx: hdd context
+ * @tb: parsed NL attribute list
+ *
+ * Return: 0 on success or error code on failure
+ */
+static int hdd_ndi_delete_req_handler(hdd_context_t *hdd_ctx,
+ struct nlattr **tb)
+{
+ hdd_adapter_t *adapter;
+ char *iface_name;
+ uint16_t transaction_id;
+ struct nan_datapath_ctx *ndp_ctx;
+ int ret;
+
+ ENTER();
+
+ if (!tb[QCA_WLAN_VENDOR_ATTR_NDP_IFACE_STR]) {
+ hdd_err("Interface name string is unavailable");
+ return -EINVAL;
+ }
+
+ iface_name = nla_data(tb[QCA_WLAN_VENDOR_ATTR_NDP_IFACE_STR]);
+
+ if (!tb[QCA_WLAN_VENDOR_ATTR_NDP_TRANSACTION_ID]) {
+ hdd_err("Transaction id is unavailable");
+ return -EINVAL;
+ }
+
+ transaction_id =
+ nla_get_u16(tb[QCA_WLAN_VENDOR_ATTR_NDP_TRANSACTION_ID]);
+
+ /* Check if there is already an existing inteface with the same name */
+ adapter = hdd_get_adapter(hdd_ctx, QDF_NDI_MODE);
+ if (!adapter) {
+ hdd_err("NAN data interface %s is not available", iface_name);
+ return -EINVAL;
+ }
+
+ /* check if adapter is in NDI mode */
+ if (QDF_NDI_MODE != adapter->device_mode) {
+ hdd_err("Interface %s is not in NDI mode", iface_name);
+ return -EINVAL;
+ }
+
+ ndp_ctx = WLAN_HDD_GET_NDP_CTX_PTR(adapter);
+ if (!ndp_ctx) {
+ hdd_err("ndp_ctx is NULL");
+ return -EINVAL;
+ }
+
+ /* check if there are active peers on the adapter */
+ if (ndp_ctx->active_ndp_peers > 0) {
+ hdd_err("NDP peers active: %d, cannot delete NDI",
+ ndp_ctx->active_ndp_peers);
+ return -EINVAL;
+ }
+
+ ndp_ctx->ndp_delete_transaction_id = transaction_id;
+ ndp_ctx->state = NAN_DATA_NDI_DELETING_STATE;
+
+ /* Delete the interface */
+ ret = __wlan_hdd_del_virtual_intf(hdd_ctx->wiphy, &adapter->wdev);
+ if (ret < 0)
+ hdd_err("NDI delete request failed");
+ else
+ hdd_err("NDI delete request successfully issued");
+
+ return ret;
+}
+
+/**
+ * hdd_ndp_initiator_req_handler() - NDP initiator request handler
+ * @hdd_ctx: hdd context
+ * @tb: parsed NL attribute list
+ *
+ * Return: 0 on success or error code on failure
+ */
+static int hdd_ndp_initiator_req_handler(hdd_context_t *hdd_ctx,
+ struct nlattr **tb)
+{
+ hdd_adapter_t *adapter;
+ char *iface_name;
+ struct ndp_initiator_req req = {0};
+ QDF_STATUS status;
+ uint32_t ndp_qos_cfg;
+ tHalHandle hal = hdd_ctx->hHal;
+ struct nan_datapath_ctx *ndp_ctx;
+
+ ENTER();
+
+ if (!tb[QCA_WLAN_VENDOR_ATTR_NDP_IFACE_STR]) {
+ hdd_err("Interface name string is unavailable");
+ return -EINVAL;
+ }
+
+ iface_name = nla_data(tb[QCA_WLAN_VENDOR_ATTR_NDP_IFACE_STR]);
+ /* Check for interface in NDI mode */
+ adapter = hdd_get_adapter(hdd_ctx, QDF_NDI_MODE);
+ if (!adapter) {
+ hdd_err("NAN data interface %s not available", iface_name);
+ return -EINVAL;
+ }
+
+ /* NAN data path coexists only with STA interface */
+ if (false == hdd_is_ndp_allowed(hdd_ctx)) {
+ hdd_err("Unsupported concurrency for NAN datapath");
+ return -EPERM;
+ }
+
+ ndp_ctx = WLAN_HDD_GET_NDP_CTX_PTR(adapter);
+
+ if (ndp_ctx->state == NAN_DATA_NDI_DELETED_STATE ||
+ ndp_ctx->state == NAN_DATA_NDI_DELETING_STATE ||
+ ndp_ctx->state == NAN_DATA_NDI_CREATING_STATE) {
+ hdd_err("Data request not allowed in NDI current state: %d",
+ ndp_ctx->state);
+ return -EINVAL;
+ }
+
+ req.vdev_id = adapter->sessionId;
+
+ if (!tb[QCA_WLAN_VENDOR_ATTR_NDP_TRANSACTION_ID]) {
+ hdd_err("Transaction ID is unavailable");
+ return -EINVAL;
+ }
+ req.transaction_id =
+ nla_get_u16(tb[QCA_WLAN_VENDOR_ATTR_NDP_TRANSACTION_ID]);
+
+ if (!tb[QCA_WLAN_VENDOR_ATTR_NDP_CHANNEL]) {
+ hdd_err("NDP channel is unavailable");
+ return -EINVAL;
+ }
+ req.channel =
+ nla_get_u16(tb[QCA_WLAN_VENDOR_ATTR_NDP_CHANNEL]);
+
+ if (!tb[QCA_WLAN_VENDOR_ATTR_NDP_SERVICE_INSTANCE_ID]) {
+ hdd_err("NDP service instance ID is unavailable");
+ return -EINVAL;
+ }
+ req.service_instance_id =
+ nla_get_u16(tb[QCA_WLAN_VENDOR_ATTR_NDP_SERVICE_INSTANCE_ID]);
+
+ qdf_mem_copy(req.self_ndi_mac_addr.bytes,
+ adapter->macAddressCurrent.bytes, QDF_MAC_ADDR_SIZE);
+
+ if (!tb[QCA_WLAN_VENDOR_ATTR_NDP_PEER_DISCOVERY_MAC_ADDR]) {
+ hdd_err("NDI peer discovery mac addr is unavailable");
+ return -EINVAL;
+ }
+ qdf_mem_copy(req.peer_discovery_mac_addr.bytes,
+ nla_data(tb[QCA_WLAN_VENDOR_ATTR_NDP_PEER_DISCOVERY_MAC_ADDR]),
+ QDF_MAC_ADDR_SIZE);
+
+ if (tb[QCA_WLAN_VENDOR_ATTR_NDP_APP_INFO]) {
+ req.ndp_info.ndp_app_info_len =
+ nla_len(tb[QCA_WLAN_VENDOR_ATTR_NDP_APP_INFO]);
+ req.ndp_info.ndp_app_info =
+ nla_data(tb[QCA_WLAN_VENDOR_ATTR_NDP_APP_INFO]);
+ }
+
+ if (tb[QCA_WLAN_VENDOR_ATTR_NDP_CONFIG_QOS]) {
+ /* at present ndp config stores 4 bytes QOS info only */
+ req.ndp_config.ndp_cfg_len = 4;
+ req.ndp_config.ndp_cfg = (uint8_t *)&ndp_qos_cfg;
+ ndp_qos_cfg =
+ nla_get_u32(tb[QCA_WLAN_VENDOR_ATTR_NDP_CONFIG_QOS]);
+ }
+
+ hdd_info("vdev_id: %d, transaction_id: %d, channel: %d, service_instance_id: %d, ndp_app_info_len: %d, peer_discovery_mac_addr: %pM",
+ req.vdev_id, req.transaction_id, req.channel,
+ req.service_instance_id, req.ndp_info.ndp_app_info_len,
+ req.peer_discovery_mac_addr.bytes);
+ status = sme_ndp_initiator_req_handler(hal, &req);
+ if (status != QDF_STATUS_SUCCESS) {
+ hdd_err("sme_ndp_initiator_req_handler failed, status: %d",
+ status);
+ return -ECOMM;
+ }
+ EXIT();
+ return 0;
+}
+
+/**
+ * hdd_ndp_responder_req_handler() - NDP responder request handler
+ * @hdd_ctx: hdd context
+ * @tb: parsed NL attribute list
+ *
+ * Return: 0 on success or error code on failure
+ */
+static int hdd_ndp_responder_req_handler(hdd_context_t *hdd_ctx,
+ struct nlattr **tb)
+{
+ hdd_adapter_t *adapter;
+ char *iface_name;
+ struct ndp_responder_req req = {0};
+ QDF_STATUS status;
+ int ret = 0;
+ struct nan_datapath_ctx *ndp_ctx;
+ uint32_t ndp_qos_cfg;
+
+ ENTER();
+
+ if (!tb[QCA_WLAN_VENDOR_ATTR_NDP_IFACE_STR]) {
+ hdd_err("Interface name string is unavailable");
+ return -EINVAL;
+ }
+
+ iface_name = nla_data(tb[QCA_WLAN_VENDOR_ATTR_NDP_IFACE_STR]);
+ /* Check if there is already an existing NAN interface */
+ adapter = hdd_get_adapter(hdd_ctx, QDF_NDI_MODE);
+ if (!adapter) {
+ hdd_err("NAN data interface %s not available", iface_name);
+ return -EINVAL;
+ }
+
+ if (QDF_NDI_MODE != adapter->device_mode) {
+ hdd_err("Interface %s not in NDI mode", iface_name);
+ return -EINVAL;
+ }
+
+ /* NAN data path coexists only with STA interface */
+ if (!hdd_is_ndp_allowed(hdd_ctx)) {
+ hdd_err("Unsupported concurrency for NAN datapath");
+ return -EINVAL;
+ }
+
+ ndp_ctx = WLAN_HDD_GET_NDP_CTX_PTR(adapter);
+
+ if (ndp_ctx->state == NAN_DATA_NDI_DELETED_STATE ||
+ ndp_ctx->state == NAN_DATA_NDI_DELETING_STATE ||
+ ndp_ctx->state == NAN_DATA_NDI_CREATING_STATE) {
+ hdd_err("Data request not allowed in current NDI state: %d",
+ ndp_ctx->state);
+ return -EAGAIN;
+ }
+
+ req.vdev_id = adapter->sessionId;
+
+ if (!tb[QCA_WLAN_VENDOR_ATTR_NDP_TRANSACTION_ID]) {
+ hdd_err("Transaction ID is unavailable");
+ return -EINVAL;
+ }
+ req.transaction_id =
+ nla_get_u16(tb[QCA_WLAN_VENDOR_ATTR_NDP_TRANSACTION_ID]);
+
+ if (!tb[QCA_WLAN_VENDOR_ATTR_NDP_INSTANCE_ID]) {
+ hdd_err("Instance ID is unavailable");
+ return -EINVAL;
+ }
+ req.ndp_instance_id =
+ nla_get_u32(tb[QCA_WLAN_VENDOR_ATTR_NDP_INSTANCE_ID]);
+
+ if (!tb[QCA_WLAN_VENDOR_ATTR_NDP_RESPONSE_CODE]) {
+ hdd_err("ndp_rsp is unavailable");
+ return -EINVAL;
+ }
+ req.ndp_rsp = nla_get_u32(tb[QCA_WLAN_VENDOR_ATTR_NDP_RESPONSE_CODE]);
+
+ if (tb[QCA_WLAN_VENDOR_ATTR_NDP_APP_INFO]) {
+ req.ndp_info.ndp_app_info_len =
+ nla_len(tb[QCA_WLAN_VENDOR_ATTR_NDP_APP_INFO]);
+ if (req.ndp_info.ndp_app_info_len) {
+ req.ndp_info.ndp_app_info =
+ nla_data(tb[QCA_WLAN_VENDOR_ATTR_NDP_APP_INFO]);
+ }
+ } else {
+ hdd_info("NDP app info is unavailable");
+ }
+ if (tb[QCA_WLAN_VENDOR_ATTR_NDP_CONFIG_QOS]) {
+ /* at present ndp config stores 4 bytes QOS info only */
+ req.ndp_config.ndp_cfg_len = 4;
+ ndp_qos_cfg =
+ nla_get_u32(tb[QCA_WLAN_VENDOR_ATTR_NDP_CONFIG_QOS]);
+ req.ndp_config.ndp_cfg = (uint8_t *)&ndp_qos_cfg;
+ } else {
+ hdd_info("NDP config data is unavailable");
+ }
+
+ hdd_info("vdev_id: %d, transaction_id: %d, ndp_rsp %d, ndp_instance_id: %d, ndp_app_info_len: %d",
+ req.vdev_id, req.transaction_id, req.ndp_rsp,
+ req.ndp_instance_id, req.ndp_info.ndp_app_info_len);
+
+ status = sme_ndp_responder_req_handler(hdd_ctx->hHal, &req);
+ if (status != QDF_STATUS_SUCCESS) {
+ hdd_err("sme_ndp_initiator_req_handler failed, status: %d",
+ status);
+ ret = -EINVAL;
+ }
+
+ EXIT();
+ return ret;
+}
+
+/**
+ * hdd_ndp_end_req_handler() - NDP end request handler
+ * @hdd_ctx: hdd context
+ * @tb: parsed NL attribute list
+ *
+ * Return: 0 on success or error code on failure
+ */
+static int hdd_ndp_end_req_handler(hdd_context_t *hdd_ctx, struct nlattr **tb)
+{
+ struct ndp_end_req req = {0};
+ QDF_STATUS status;
+ tHalHandle hal = hdd_ctx->hHal;
+
+ ENTER();
+
+ /* NAN data path coexists only with STA interface */
+ if (!hdd_is_ndp_allowed(hdd_ctx)) {
+ hdd_err("Unsupported concurrency for NAN datapath");
+ return -EINVAL;
+ }
+
+ if (!tb[QCA_WLAN_VENDOR_ATTR_NDP_TRANSACTION_ID]) {
+ hdd_err("Transaction ID is unavailable");
+ return -EINVAL;
+ }
+ req.transaction_id =
+ nla_get_u16(tb[QCA_WLAN_VENDOR_ATTR_NDP_TRANSACTION_ID]);
+
+ if (!tb[QCA_WLAN_VENDOR_ATTR_NDP_INSTANCE_ID_ARRAY]) {
+ hdd_err("NDP instance ID array is unavailable");
+ return -EINVAL;
+ }
+
+ req.num_ndp_instances =
+ nla_len(tb[QCA_WLAN_VENDOR_ATTR_NDP_INSTANCE_ID_ARRAY]) /
+ sizeof(uint32_t);
+ if (0 >= req.num_ndp_instances) {
+ hdd_err("Num NDP instances is 0");
+ return -EINVAL;
+ }
+ req.ndp_ids = nla_data(tb[QCA_WLAN_VENDOR_ATTR_NDP_INSTANCE_ID_ARRAY]);
+
+ hdd_info("sending ndp_end_req to SME, transaction_id: %d",
+ req.transaction_id);
+
+ status = sme_ndp_end_req_handler(hal, &req);
+ if (status != QDF_STATUS_SUCCESS) {
+ hdd_err("sme_ndp_end_req_handler failed, status: %d",
+ status);
+ return -ECOMM;
+ }
+ EXIT();
+ return 0;
+}
+
+/**
+ * hdd_ndp_iface_create_rsp_handler() - NDP iface create response handler
+ * @adapter: pointer to adapter context
+ * @rsp_params: response parameters
+ *
+ * The function is expected to send a response back to the user space
+ * even if the creation of BSS has failed
+ *
+ * Following vendor event is sent to cfg80211:
+ * QCA_WLAN_VENDOR_ATTR_NDP_SUBCMD =
+ * QCA_WLAN_VENDOR_ATTR_NDP_INTERFACE_CREATE (4 bytes)
+ * QCA_WLAN_VENDOR_ATTR_NDP_TRANSACTION_ID (2 bytes)
+ * QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_TYPE (4 bytes)
+ * QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_VALUE
+ *
+ * Return: none
+ */
+static void hdd_ndp_iface_create_rsp_handler(hdd_adapter_t *adapter,
+ void *rsp_params)
+{
+ struct sk_buff *vendor_event;
+ hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
+ struct ndi_create_rsp *ndi_rsp = (struct ndi_create_rsp *)rsp_params;
+ uint32_t data_len = (3 * sizeof(uint32_t)) + sizeof(uint16_t) +
+ NLMSG_HDRLEN + (4 * NLA_HDRLEN);
+ struct nan_datapath_ctx *ndp_ctx = WLAN_HDD_GET_NDP_CTX_PTR(adapter);
+ bool create_fail = false;
+ uint8_t create_transaction_id = 0;
+ uint32_t create_status = NDP_RSP_STATUS_ERROR;
+ uint32_t create_reason = NDP_NAN_DATA_IFACE_CREATE_FAILED;
+
+ ENTER();
+
+ if (wlan_hdd_validate_context(hdd_ctx))
+ /* No way the driver can send response back to user space */
+ return;
+
+ if (ndi_rsp) {
+ create_status = ndi_rsp->status;
+ create_reason = ndi_rsp->reason;
+ } else {
+ hdd_err("Invalid ndi create response");
+ create_fail = true;
+ }
+
+ if (ndp_ctx) {
+ create_transaction_id = ndp_ctx->ndp_create_transaction_id;
+ } else {
+ hdd_err("ndp_ctx is NULL");
+ create_fail = true;
+ }
+
+ /* notify response to the upper layer */
+ vendor_event = cfg80211_vendor_event_alloc(hdd_ctx->wiphy,
+ NULL,
+ data_len,
+ QCA_NL80211_VENDOR_SUBCMD_NDP_INDEX,
+ cds_get_gfp_flags());
+
+ if (!vendor_event) {
+ hdd_err("cfg80211_vendor_event_alloc failed");
+ create_fail = true;
+ goto close_ndi;
+ }
+
+ /* Sub vendor command */
+ if (nla_put_u32(vendor_event, QCA_WLAN_VENDOR_ATTR_NDP_SUBCMD,
+ QCA_WLAN_VENDOR_ATTR_NDP_INTERFACE_CREATE)) {
+ hdd_err("QCA_WLAN_VENDOR_ATTR_NDP_SUBCMD put fail");
+ goto nla_put_failure;
+ }
+
+ /* Transaction id */
+ if (nla_put_u16(vendor_event, QCA_WLAN_VENDOR_ATTR_NDP_TRANSACTION_ID,
+ create_transaction_id)) {
+ hdd_err("VENDOR_ATTR_NDP_TRANSACTION_ID put fail");
+ goto nla_put_failure;
+ }
+
+ /* Status code */
+ if (nla_put_u32(vendor_event, QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_TYPE,
+ create_status)) {
+ hdd_err("VENDOR_ATTR_NDP_DRV_RETURN_TYPE put fail");
+ goto nla_put_failure;
+ }
+
+ /* Status return value */
+ if (nla_put_u32(vendor_event,
+ QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_VALUE,
+ create_reason)) {
+ hdd_err("VENDOR_ATTR_NDP_DRV_RETURN_VALUE put fail");
+ goto nla_put_failure;
+ }
+
+ hdd_info("sub command: %d, value: %d",
+ QCA_NL80211_VENDOR_SUBCMD_NDP_INDEX,
+ QCA_WLAN_VENDOR_ATTR_NDP_INTERFACE_CREATE);
+ hdd_info("create transaction id: %d, value: %d",
+ QCA_WLAN_VENDOR_ATTR_NDP_TRANSACTION_ID, create_transaction_id);
+ hdd_info("status code: %d, value: %d",
+ QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_TYPE, create_status);
+ hdd_info("Return value: %d, value: %d",
+ QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_VALUE, create_reason);
+
+ cfg80211_vendor_event(vendor_event, GFP_KERNEL);
+
+ if (!create_fail && ndi_rsp->status == QDF_STATUS_SUCCESS) {
+ hdd_err("NDI interface successfully created");
+ ndp_ctx->ndp_create_transaction_id = 0;
+ ndp_ctx->state = NAN_DATA_NDI_CREATED_STATE;
+ wlan_hdd_netif_queue_control(adapter,
+ WLAN_START_ALL_NETIF_QUEUE_N_CARRIER,
+ WLAN_CONTROL_PATH);
+ } else {
+ hdd_err("NDI interface creation failed with reason %d",
+ create_reason);
+ }
+
+ /* Something went wrong while starting the BSS */
+ if (create_fail)
+ goto close_ndi;
+
+ EXIT();
+ return;
+
+nla_put_failure:
+ kfree_skb(vendor_event);
+close_ndi:
+ hdd_close_ndi(adapter);
+ return;
+}
+
+/**
+ * hdd_ndp_iface_delete_rsp_handler() - NDP iface delete response handler
+ * @adapter: pointer to adapter context
+ * @rsp_params: response parameters
+ *
+ * Return: none
+ */
+static void hdd_ndp_iface_delete_rsp_handler(hdd_adapter_t *adapter,
+ void *rsp_params)
+{
+ hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
+ struct ndi_delete_rsp *ndi_rsp = rsp_params;
+ struct nan_datapath_ctx *ndp_ctx;
+
+ if (wlan_hdd_validate_context(hdd_ctx))
+ return;
+
+ if (!ndi_rsp) {
+ hdd_err("Invalid ndi delete response");
+ return;
+ }
+
+ if (ndi_rsp->status == NDP_RSP_STATUS_SUCCESS)
+ hdd_err("NDI BSS successfully stopped");
+ else
+ hdd_err("NDI BSS stop failed with reason %d", ndi_rsp->reason);
+
+ ndp_ctx = WLAN_HDD_GET_NDP_CTX_PTR(adapter);
+ ndp_ctx->ndi_delete_rsp_reason = ndi_rsp->reason;
+ ndp_ctx->ndi_delete_rsp_status = ndi_rsp->status;
+ wlan_hdd_netif_queue_control(adapter,
+ WLAN_STOP_ALL_NETIF_QUEUE_N_CARRIER,
+ WLAN_CONTROL_PATH);
+
+ complete(&adapter->disconnect_comp_var);
+ return;
+}
+
+/**
+ * hdd_ndp_session_end_handler() - NDI session termination handler
+ * @adapter: pointer to adapter context
+ *
+ * Following vendor event is sent to cfg80211:
+ * QCA_WLAN_VENDOR_ATTR_NDP_SUBCMD =
+ * QCA_WLAN_VENDOR_ATTR_NDP_INTERFACE_DELETE (4 bytes)
+ * QCA_WLAN_VENDOR_ATTR_NDP_TRANSACTION_ID (2 bytes)
+ * QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_TYPE (4 bytes)
+ * QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_VALUE (4 bytes)
+ *
+ * Return: none
+ */
+void hdd_ndp_session_end_handler(hdd_adapter_t *adapter)
+{
+ hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
+ struct sk_buff *vendor_event;
+ struct nan_datapath_ctx *ndp_ctx;
+ uint32_t data_len = sizeof(uint32_t) * (3 + sizeof(uint16_t)) +
+ (NLA_HDRLEN * 4) + NLMSG_HDRLEN;
+
+ ENTER();
+
+ if (wlan_hdd_validate_context(hdd_ctx))
+ return;
+
+ /* Handle only if adapter is in NDI mode */
+ if (QDF_NDI_MODE != adapter->device_mode) {
+ hdd_err("Adapter is not in NDI mode");
+ return;
+ }
+
+ ndp_ctx = WLAN_HDD_GET_NDP_CTX_PTR(adapter);
+ if (!ndp_ctx) {
+ hdd_err("ndp context is NULL");
+ return;
+ }
+
+ /*
+ * The virtual adapters are stopped and closed even during
+ * driver unload or stop, the service layer is not required
+ * to be informed in that case (response is not expected)
+ */
+ if (NAN_DATA_NDI_DELETING_STATE != ndp_ctx->state) {
+ hdd_err("NDI interface %s deleted", adapter->dev->name);
+ return;
+ }
+
+ /* notify response to the upper layer */
+ vendor_event = cfg80211_vendor_event_alloc(hdd_ctx->wiphy,
+ NULL,
+ data_len,
+ QCA_NL80211_VENDOR_SUBCMD_NDP_INDEX,
+ GFP_KERNEL);
+
+ if (!vendor_event) {
+ hdd_err("cfg80211_vendor_event_alloc failed");
+ return;
+ }
+
+ /* Sub vendor command goes first */
+ if (nla_put_u32(vendor_event, QCA_WLAN_VENDOR_ATTR_NDP_SUBCMD,
+ QCA_WLAN_VENDOR_ATTR_NDP_INTERFACE_DELETE)) {
+ hdd_err("VENDOR_ATTR_NDP_SUBCMD put fail");
+ goto failure;
+ }
+
+ /* Transaction id */
+ if (nla_put_u16(vendor_event, QCA_WLAN_VENDOR_ATTR_NDP_TRANSACTION_ID,
+ ndp_ctx->ndp_delete_transaction_id)) {
+ hdd_err("VENDOR_ATTR_NDP_TRANSACTION_ID put fail");
+ goto failure;
+ }
+
+ /* Status code */
+ if (nla_put_u32(vendor_event,
+ QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_TYPE,
+ ndp_ctx->ndi_delete_rsp_status)) {
+ hdd_err("VENDOR_ATTR_NDP_DRV_RETURN_TYPE put fail");
+ goto failure;
+ }
+
+ /* Status return value */
+ if (nla_put_u32(vendor_event,
+ QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_VALUE,
+ ndp_ctx->ndi_delete_rsp_reason)) {
+ hdd_err("VENDOR_ATTR_NDP_DRV_RETURN_VALUE put fail");
+ goto failure;
+ }
+
+ hdd_info("sub command: %d, value: %d", QCA_WLAN_VENDOR_ATTR_NDP_SUBCMD,
+ QCA_WLAN_VENDOR_ATTR_NDP_INTERFACE_DELETE);
+ hdd_info("delete transaction id: %d, value: %d",
+ QCA_WLAN_VENDOR_ATTR_NDP_TRANSACTION_ID,
+ ndp_ctx->ndp_delete_transaction_id);
+ hdd_info("status code: %d, value: %d",
+ QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_TYPE,
+ ndp_ctx->ndi_delete_rsp_status);
+ hdd_info("Return value: %d, value: %d",
+ QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_VALUE,
+ ndp_ctx->ndi_delete_rsp_reason);
+
+ ndp_ctx->ndp_delete_transaction_id = 0;
+ ndp_ctx->state = NAN_DATA_NDI_DELETED_STATE;
+
+ cfg80211_vendor_event(vendor_event, GFP_KERNEL);
+
+ EXIT();
+ return;
+
+failure:
+ kfree_skb(vendor_event);
+}
+
+
+/**
+ * hdd_ndp_initiator_rsp_handler() - NDP initiator response handler
+ * @adapter: pointer to adapter context
+ * @rsp_params: response parameters
+ *
+ * Following vendor event is sent to cfg80211:
+ * QCA_WLAN_VENDOR_ATTR_NDP_SUBCMD =
+ * QCA_WLAN_VENDOR_ATTR_NDP_INITIATOR_RESPONSE (4 bytes)
+ * QCA_WLAN_VENDOR_ATTR_NDP_TRANSACTION_ID (2 bytes)
+ * QCA_WLAN_VENDOR_ATTR_NDP_INSTANCE_ID (4 bytes)
+ * QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_TYPE (4 bytes)
+ * QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_VALUE (4 bytes)
+ *
+ * Return: none
+ */
+static void hdd_ndp_initiator_rsp_handler(hdd_adapter_t *adapter,
+ void *rsp_params)
+{
+ struct sk_buff *vendor_event;
+ hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
+ struct ndp_initiator_rsp *rsp = rsp_params;
+ uint32_t data_len = (4 * sizeof(uint32_t)) + (1 * sizeof(uint16_t)) +
+ NLMSG_HDRLEN + (5 * NLA_HDRLEN);
+
+ ENTER();
+
+ if (!rsp) {
+ hdd_err("Invalid NDP Initator response");
+ return;
+ }
+
+ if (0 != wlan_hdd_validate_context(hdd_ctx))
+ return;
+
+ vendor_event = cfg80211_vendor_event_alloc(hdd_ctx->wiphy, NULL,
+ data_len, QCA_NL80211_VENDOR_SUBCMD_NDP_INDEX,
+ GFP_KERNEL);
+ if (!vendor_event) {
+ hdd_err("cfg80211_vendor_event_alloc failed");
+ return;
+ }
+
+ if (nla_put_u32(vendor_event, QCA_WLAN_VENDOR_ATTR_NDP_SUBCMD,
+ QCA_WLAN_VENDOR_ATTR_NDP_INITIATOR_RESPONSE))
+ goto ndp_initiator_rsp_nla_failed;
+
+ if (nla_put_u16(vendor_event, QCA_WLAN_VENDOR_ATTR_NDP_TRANSACTION_ID,
+ rsp->transaction_id))
+ goto ndp_initiator_rsp_nla_failed;
+
+ if (nla_put_u32(vendor_event,
+ QCA_WLAN_VENDOR_ATTR_NDP_INSTANCE_ID,
+ rsp->ndp_instance_id))
+ goto ndp_initiator_rsp_nla_failed;
+
+ if (nla_put_u32(vendor_event, QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_TYPE,
+ rsp->status))
+ goto ndp_initiator_rsp_nla_failed;
+
+ if (nla_put_u32(vendor_event, QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_VALUE,
+ rsp->reason))
+ goto ndp_initiator_rsp_nla_failed;
+
+ hdd_info("NDP Initiator rsp sent, tid:%d, instance id:%d, status:%d, reason: %d",
+ rsp->transaction_id, rsp->ndp_instance_id, rsp->status,
+ rsp->reason);
+ cfg80211_vendor_event(vendor_event, GFP_KERNEL);
+ EXIT();
+ return;
+ndp_initiator_rsp_nla_failed:
+ hdd_err("nla_put api failed");
+ kfree_skb(vendor_event);
+ EXIT();
+}
+
+/**
+ * hdd_ndp_new_peer_ind_handler() - NDP new peer indication handler
+ * @adapter: pointer to adapter context
+ * @ind_params: indication parameters
+ *
+ * Return: none
+ */
+static void hdd_ndp_new_peer_ind_handler(hdd_adapter_t *adapter,
+ void *ind_params)
+{
+ struct sme_ndp_peer_ind *new_peer_ind = ind_params;
+ hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
+ tSirBssDescription tmp_bss_descp = {0};
+ tCsrRoamInfo roam_info = {0};
+ struct nan_datapath_ctx *ndp_ctx = WLAN_HDD_GET_NDP_CTX_PTR(adapter);
+ hdd_station_ctx_t *sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
+ struct qdf_mac_addr bc_mac_addr = QDF_MAC_ADDR_BROADCAST_INITIALIZER;
+
+ ENTER();
+
+ if (NULL == ind_params) {
+ hdd_err("Invalid new NDP peer params");
+ return;
+ }
+ hdd_info("session_id: %d, peer_mac: %pM, sta_id: %d",
+ new_peer_ind->session_id, new_peer_ind->peer_mac_addr.bytes,
+ new_peer_ind->sta_id);
+
+ /* save peer in ndp ctx */
+ if (false == hdd_save_peer(sta_ctx, new_peer_ind->sta_id,
+ &new_peer_ind->peer_mac_addr)) {
+ hdd_err("Ndp peer table full. cannot save new peer");
+ return;
+ }
+
+ /* this function is called for each new peer */
+ ndp_ctx->active_ndp_peers++;
+ hdd_info("vdev_id: %d, num_peers: %d", adapter->sessionId,
+ ndp_ctx->active_ndp_peers);
+
+ hdd_roam_register_sta(adapter, &roam_info, new_peer_ind->sta_id,
+ &new_peer_ind->peer_mac_addr, &tmp_bss_descp);
+ hdd_ctx->sta_to_adapter[new_peer_ind->sta_id] = adapter;
+ /* perform following steps for first new peer ind */
+ if (ndp_ctx->active_ndp_peers == 1) {
+ hdd_ctx->sta_to_adapter[NDP_BROADCAST_STAID] = adapter;
+ hdd_save_peer(sta_ctx, NDP_BROADCAST_STAID, &bc_mac_addr);
+ hdd_roam_register_sta(adapter, &roam_info, NDP_BROADCAST_STAID,
+ &bc_mac_addr, &tmp_bss_descp);
+ hdd_info("Set ctx connection state to connected");
+ sta_ctx->conn_info.connState = eConnectionState_NdiConnected;
+ hdd_wmm_connect(adapter, &roam_info, eCSR_BSS_TYPE_NDI);
+ wlan_hdd_netif_queue_control(adapter,
+ WLAN_WAKE_ALL_NETIF_QUEUE, WLAN_CONTROL_PATH);
+ }
+ EXIT();
+}
+
+/**
+ * hdd_ndp_peer_departed_ind_handler() - Handle NDP peer departed indication
+ * @adapter: pointer to adapter context
+ * @ind_params: indication parameters
+ *
+ * Return: none
+ */
+static void hdd_ndp_peer_departed_ind_handler(hdd_adapter_t *adapter,
+ void *ind_params)
+{
+ hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
+ struct sme_ndp_peer_ind *peer_ind = ind_params;
+ struct nan_datapath_ctx *ndp_ctx = WLAN_HDD_GET_NDP_CTX_PTR(adapter);
+ hdd_station_ctx_t *sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
+
+ hdd_roam_deregister_sta(adapter, peer_ind->sta_id);
+ hdd_delete_peer(sta_ctx, peer_ind->sta_id);
+ hdd_ctx->sta_to_adapter[peer_ind->sta_id] = 0;
+
+ if (--ndp_ctx->active_ndp_peers == 0) {
+ hdd_info("No more ndp peers.");
+ sta_ctx->conn_info.connState = eConnectionState_NdiDisconnected;
+ hdd_conn_set_connection_state(adapter,
+ eConnectionState_NdiDisconnected);
+ hdd_info("Stop netif tx queues.");
+ wlan_hdd_netif_queue_control(adapter, WLAN_STOP_ALL_NETIF_QUEUE,
+ WLAN_CONTROL_PATH);
+ }
+}
+
+/**
+ * hdd_ndp_confirm_ind_handler() - NDP confirm indication handler
+ * @adapter: pointer to adapter context
+ * @ind_params: indication parameters
+ *
+ * Following vendor event is sent to cfg80211:
+ * QCA_WLAN_VENDOR_ATTR_NDP_SUBCMD =
+ * QCA_WLAN_VENDOR_ATTR_NDP_CONFIRM_IND (4 bytes)
+ * QCA_WLAN_VENDOR_ATTR_NDP_INSTANCE_ID (4 bytes)
+ * QCA_WLAN_VENDOR_ATTR_NDP_NDI_MAC_ADDR (6 bytes)
+ * QCA_WLAN_VENDOR_ATTR_NDP_IFACE_STR (IFNAMSIZ)
+ * QCA_WLAN_VENDOR_ATTR_NDP_APP_INFO (ndp_app_info_len size)
+ * QCA_WLAN_VENDOR_ATTR_NDP_RESPONSE_CODE (4 bytes)
+ * QCA_WLAN_VENDOR_ATTR_NDP_RETURN_VALUE (4 bytes)
+ *
+ * Return: none
+ */
+static void hdd_ndp_confirm_ind_handler(hdd_adapter_t *adapter,
+ void *ind_params)
+{
+ int idx;
+ uint32_t ndp_qos_config = 0;
+ struct ndp_confirm_event *ndp_confirm = ind_params;
+ struct sk_buff *vendor_event;
+ hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
+ struct nan_datapath_ctx *ndp_ctx = WLAN_HDD_GET_NDP_CTX_PTR(adapter);
+ hdd_station_ctx_t *sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
+ uint32_t data_len;
+
+ ENTER();
+ if (!ndp_confirm) {
+ hdd_err("Invalid NDP Initator response");
+ return;
+ }
+
+ if (0 != wlan_hdd_validate_context(hdd_ctx))
+ return;
+
+ /* ndp_confirm is called each time user generated ndp req succeeds */
+ idx = hdd_get_peer_idx(sta_ctx, &ndp_confirm->peer_ndi_mac_addr);
+ if (idx == INVALID_PEER_IDX)
+ hdd_err("can't find addr: %pM in vdev_id: %d, peer table.",
+ &ndp_confirm->peer_ndi_mac_addr, adapter->sessionId);
+ else if (ndp_confirm->rsp_code == NDP_RESPONSE_ACCEPT)
+ ndp_ctx->active_ndp_sessions[idx]++;
+
+ data_len = (4 * sizeof(uint32_t)) + QDF_MAC_ADDR_SIZE + IFNAMSIZ +
+ + NLMSG_HDRLEN + (7 * NLA_HDRLEN) +
+ ndp_confirm->ndp_info.ndp_app_info_len;
+
+ if (ndp_confirm->ndp_info.ndp_app_info_len)
+ data_len += NLA_HDRLEN + ndp_confirm->ndp_info.ndp_app_info_len;
+
+ vendor_event = cfg80211_vendor_event_alloc(hdd_ctx->wiphy, NULL,
+ data_len, QCA_NL80211_VENDOR_SUBCMD_NDP_INDEX,
+ GFP_KERNEL);
+ if (!vendor_event) {
+ hdd_err("cfg80211_vendor_event_alloc failed");
+ return;
+ }
+
+ if (nla_put_u32(vendor_event, QCA_WLAN_VENDOR_ATTR_NDP_SUBCMD,
+ QCA_WLAN_VENDOR_ATTR_NDP_CONFIRM_IND))
+ goto ndp_confirm_nla_failed;
+
+ if (nla_put_u32(vendor_event, QCA_WLAN_VENDOR_ATTR_NDP_INSTANCE_ID,
+ ndp_confirm->ndp_instance_id))
+ goto ndp_confirm_nla_failed;
+
+ if (nla_put(vendor_event, QCA_WLAN_VENDOR_ATTR_NDP_NDI_MAC_ADDR,
+ QDF_MAC_ADDR_SIZE, ndp_confirm->peer_ndi_mac_addr.bytes))
+ goto ndp_confirm_nla_failed;
+
+ if (nla_put(vendor_event, QCA_WLAN_VENDOR_ATTR_NDP_IFACE_STR,
+ IFNAMSIZ, adapter->dev->name))
+ goto ndp_confirm_nla_failed;
+
+ if (ndp_confirm->ndp_info.ndp_app_info_len && nla_put(vendor_event,
+ QCA_WLAN_VENDOR_ATTR_NDP_APP_INFO,
+ ndp_confirm->ndp_info.ndp_app_info_len,
+ ndp_confirm->ndp_info.ndp_app_info))
+ goto ndp_confirm_nla_failed;
+
+ if (nla_put_u32(vendor_event,
+ QCA_WLAN_VENDOR_ATTR_NDP_RESPONSE_CODE,
+ ndp_confirm->rsp_code))
+ goto ndp_confirm_nla_failed;
+
+ if (nla_put_u32(vendor_event,
+ QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_VALUE,
+ ndp_confirm->reason_code))
+ goto ndp_confirm_nla_failed;
+
+ cfg80211_vendor_event(vendor_event, GFP_KERNEL);
+ hdd_info("NDP confim sent, ndp instance id: %d, peer addr: %pM, ndp_cfg: %d, rsp_code: %d, reason_code: %d",
+ ndp_confirm->ndp_instance_id,
+ ndp_confirm->peer_ndi_mac_addr.bytes,
+ ndp_qos_config, ndp_confirm->rsp_code,
+ ndp_confirm->reason_code);
+
+ hdd_info("NDP confim, ndp app info dump");
+ QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_DEBUG,
+ ndp_confirm->ndp_info.ndp_app_info,
+ ndp_confirm->ndp_info.ndp_app_info_len);
+ EXIT();
+ return;
+ndp_confirm_nla_failed:
+ hdd_err("nla_put api failed");
+ kfree_skb(vendor_event);
+ EXIT();
+}
+
+/**
+ * hdd_ndp_indication_handler() - NDP indication handler
+ * @adapter: pointer to adapter context
+ * @ind_params: indication parameters
+ *
+ * Following vendor event is sent to cfg80211:
+ * QCA_WLAN_VENDOR_ATTR_NDP_SUBCMD =
+ * QCA_WLAN_VENDOR_ATTR_NDP_REQUEST_IND (4 bytes)
+ * QCA_WLAN_VENDOR_ATTR_NDP_IFACE_STR (IFNAMSIZ)
+ * QCA_WLAN_VENDOR_ATTR_NDP_SERVICE_INSTANCE_ID (2 bytes)
+ * QCA_WLAN_VENDOR_ATTR_NDP_NDI_MAC_ADDR (6 bytes)
+ * QCA_WLAN_VENDOR_ATTR_NDP_PEER_DISCOVERY_MAC_ADDR (6 bytes)
+ * QCA_WLAN_VENDOR_ATTR_NDP_INSTANCE_ID (4 bytes)
+ * QCA_WLAN_VENDOR_ATTR_NDP_APP_INFO (ndp_app_info_len size)
+ * QCA_WLAN_VENDOR_ATTR_NDP_CONFIG_QOS (4 bytes)
+ *
+ * Return: none
+ */
+static void hdd_ndp_indication_handler(hdd_adapter_t *adapter,
+ void *ind_params)
+{
+ struct sk_buff *vendor_event;
+ hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
+ struct ndp_indication_event *event = ind_params;
+ uint32_t ndp_qos_config;
+ struct nan_datapath_ctx *ndp_ctx;
+ uint16_t data_len;
+
+ ENTER();
+ if (!ind_params) {
+ hdd_err("Invalid NDP Indication");
+ return;
+ }
+
+ if (0 != wlan_hdd_validate_context(hdd_ctx))
+ return;
+
+ /* Handle only if adapter is in NDI mode */
+ if (QDF_NDI_MODE != adapter->device_mode) {
+ hdd_err("Adapter is not in NDI mode");
+ return;
+ }
+
+ hdd_info("NDP Indication, policy: %d", event->policy);
+
+ /* Policy check */
+ if (!WLAN_HDD_IS_NDP_ENABLED(hdd_ctx)) {
+ hdd_err("NAN datapath is not suported");
+ return;
+ }
+
+ /* NAN data path coexists only with STA interface */
+ if (!hdd_is_ndp_allowed(hdd_ctx)) {
+ hdd_err("Unsupported concurrency for NAN datapath");
+ return;
+ }
+
+ ndp_ctx = WLAN_HDD_GET_NDP_CTX_PTR(adapter);
+
+ /* check if we are in middle of deleting/creating the interface */
+ if (ndp_ctx->state == NAN_DATA_NDI_DELETED_STATE ||
+ ndp_ctx->state == NAN_DATA_NDI_DELETING_STATE ||
+ ndp_ctx->state == NAN_DATA_NDI_CREATING_STATE) {
+ hdd_err("Data request not allowed in current NDI state: %d",
+ ndp_ctx->state);
+ return;
+ }
+
+ data_len = 3 * sizeof(uint32_t) + sizeof(uint16_t) +
+ 2 * QDF_MAC_ADDR_SIZE + IFNAMSIZ +
+ event->ndp_info.ndp_app_info_len + 8 * NLA_HDRLEN +
+ NLMSG_HDRLEN;
+
+ /* notify response to the upper layer */
+ vendor_event = cfg80211_vendor_event_alloc(hdd_ctx->wiphy,
+ NULL, data_len,
+ QCA_NL80211_VENDOR_SUBCMD_NDP_INDEX,
+ GFP_KERNEL);
+ if (!vendor_event) {
+ hdd_err("cfg80211_vendor_event_alloc failed");
+ return;
+ }
+
+ if (nla_put_u32(vendor_event, QCA_WLAN_VENDOR_ATTR_NDP_SUBCMD,
+ QCA_WLAN_VENDOR_ATTR_NDP_REQUEST_IND))
+ goto ndp_indication_nla_failed;
+
+ if (nla_put(vendor_event, QCA_WLAN_VENDOR_ATTR_NDP_IFACE_STR,
+ IFNAMSIZ, adapter->dev->name))
+ goto ndp_indication_nla_failed;
+
+ if (nla_put_u16(vendor_event,
+ QCA_WLAN_VENDOR_ATTR_NDP_SERVICE_INSTANCE_ID,
+ event->service_instance_id))
+ goto ndp_indication_nla_failed;
+
+ if (nla_put(vendor_event,
+ QCA_WLAN_VENDOR_ATTR_NDP_NDI_MAC_ADDR,
+ QDF_MAC_ADDR_SIZE, event->peer_mac_addr.bytes))
+ goto ndp_indication_nla_failed;
+
+ if (nla_put(vendor_event,
+ QCA_WLAN_VENDOR_ATTR_NDP_PEER_DISCOVERY_MAC_ADDR ,
+ QDF_MAC_ADDR_SIZE, event->peer_discovery_mac_addr.bytes))
+ goto ndp_indication_nla_failed;
+
+ if (nla_put_u32(vendor_event, QCA_WLAN_VENDOR_ATTR_NDP_INSTANCE_ID,
+ event->ndp_instance_id))
+ goto ndp_indication_nla_failed;
+
+ if (event->ndp_info.ndp_app_info_len)
+ if (nla_put(vendor_event, QCA_WLAN_VENDOR_ATTR_NDP_APP_INFO,
+ event->ndp_info.ndp_app_info_len,
+ event->ndp_info.ndp_app_info))
+ goto ndp_indication_nla_failed;
+
+ if (event->ndp_config.ndp_cfg_len) {
+ ndp_qos_config = *((uint32_t *)event->ndp_config.ndp_cfg);
+ /* at present ndp config stores 4 bytes QOS info only */
+ if (nla_put_u32(vendor_event,
+ QCA_WLAN_VENDOR_ATTR_NDP_CONFIG_QOS,
+ ndp_qos_config))
+ goto ndp_indication_nla_failed;
+ }
+
+ cfg80211_vendor_event(vendor_event, GFP_KERNEL);
+ EXIT();
+ return;
+ndp_indication_nla_failed:
+ hdd_err("nla_put api failed");
+ kfree_skb(vendor_event);
+ EXIT();
+}
+
+/**
+ * hdd_ndp_responder_rsp_handler() - NDP responder response handler
+ * @adapter: pointer to adapter context
+ * @rsp_params: response parameters
+ *
+ * Following vendor event is sent to cfg80211:
+ * QCA_WLAN_VENDOR_ATTR_NDP_SUBCMD =
+ * QCA_WLAN_VENDOR_ATTR_NDP_RESPONDER_RESPONSE (4 bytes)
+ * QCA_WLAN_VENDOR_ATTR_NDP_TRANSACTION_ID (2 bytes)
+ * QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_TYPE (4 bytes)
+ * QCA_WLAN_VENDOR_ATTR_NDP_RESPONSE_CODE (4 bytes)
+ *
+ * Return: none
+ */
+static void hdd_ndp_responder_rsp_handler(hdd_adapter_t *adapter,
+ void *rsp_params)
+{
+ struct sk_buff *vendor_event;
+ hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
+ struct ndp_responder_rsp_event *rsp = rsp_params;
+ uint16_t data_len;
+
+ ENTER();
+ if (!rsp) {
+ hdd_err("Invalid NDP Responder response");
+ return;
+ }
+
+ if (0 != wlan_hdd_validate_context(hdd_ctx))
+ return;
+
+ hdd_info("NDP Responder,vdev id %d transaction_id %d status code: %d reason %d",
+ rsp->vdev_id, rsp->transaction_id,
+ rsp->status, rsp->reason);
+
+ data_len = 3 * sizeof(uint32_t) + sizeof(uint16_t) +
+ 4 * NLA_HDRLEN + NLMSG_HDRLEN;
+ /* notify response to the upper layer */
+ vendor_event = cfg80211_vendor_event_alloc(hdd_ctx->wiphy,
+ NULL, data_len,
+ QCA_NL80211_VENDOR_SUBCMD_NDP_INDEX,
+ GFP_KERNEL);
+ if (!vendor_event) {
+ hdd_err("cfg80211_vendor_event_alloc failed");
+ return;
+ }
+
+ if (nla_put_u32(vendor_event, QCA_WLAN_VENDOR_ATTR_NDP_SUBCMD,
+ QCA_WLAN_VENDOR_ATTR_NDP_RESPONDER_RESPONSE))
+ goto ndp_responder_rsp_nla_failed;
+
+ if (nla_put_u16(vendor_event, QCA_WLAN_VENDOR_ATTR_NDP_TRANSACTION_ID,
+ rsp->transaction_id))
+ goto ndp_responder_rsp_nla_failed;
+
+ if (nla_put_u32(vendor_event, QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_TYPE,
+ rsp->status))
+ goto ndp_responder_rsp_nla_failed;
+
+ if (nla_put_u32(vendor_event,
+ QCA_WLAN_VENDOR_ATTR_NDP_RESPONSE_CODE,
+ rsp->reason))
+ goto ndp_responder_rsp_nla_failed;
+
+ cfg80211_vendor_event(vendor_event, GFP_KERNEL);
+ EXIT();
+ return;
+ndp_responder_rsp_nla_failed:
+ hdd_err("nla_put api failed");
+ kfree_skb(vendor_event);
+ EXIT();
+}
+
+/**
+ * hdd_ndp_end_rsp_handler() - NDP end response handler
+ * @adapter: pointer to adapter context
+ * @rsp_params: response parameters
+ *
+ * Following vendor event is sent to cfg80211:
+ * QCA_WLAN_VENDOR_ATTR_NDP_SUBCMD =
+ * QCA_WLAN_VENDOR_ATTR_NDP_END_RESPONSE(4 bytest)
+ * QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_TYPE (4 bytes)
+ * QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_VALUE (4 bytes)
+ * QCA_WLAN_VENDOR_ATTR_NDP_TRANSACTION_ID (2 bytes)
+ *
+ * Return: none
+ */
+static void hdd_ndp_end_rsp_handler(hdd_adapter_t *adapter, void *rsp_params)
+{
+ struct sk_buff *vendor_event;
+ hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
+ struct ndp_end_rsp_event *rsp = rsp_params;
+ struct nan_datapath_ctx *ndp_ctx;
+ uint32_t data_len, i;
+ int idx;
+ hdd_station_ctx_t *sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
+
+ ENTER();
+
+ if (!rsp) {
+ hdd_err("Invalid ndp end response");
+ return;
+ }
+
+ if (0 != wlan_hdd_validate_context(hdd_ctx))
+ return;
+
+ /* adjust active ndp instances per peer */
+ if (rsp->status == NDP_CMD_RSP_STATUS_SUCCESS) {
+ for (i = 0; i < rsp->num_peers; i++) {
+ adapter = hdd_get_adapter_by_vdev(hdd_ctx,
+ rsp->ndp_map[i].vdev_id);
+ if (NULL == adapter) {
+ hdd_err("adapter for vdev_id: %d not found",
+ rsp->ndp_map[i].vdev_id);
+ continue;
+ }
+ sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
+ ndp_ctx = WLAN_HDD_GET_NDP_CTX_PTR(adapter);
+ idx = hdd_get_peer_idx(sta_ctx,
+ &rsp->ndp_map[i].peer_ndi_mac_addr);
+ if (idx == INVALID_PEER_IDX)
+ hdd_err("can't find addr: %pM in vdev_id: %d, peer table.",
+ &rsp->ndp_map[i].peer_ndi_mac_addr,
+ rsp->ndp_map[i].vdev_id);
+ else
+ ndp_ctx->active_ndp_sessions[idx] =
+ rsp->ndp_map[i].num_active_ndp_sessions;
+ }
+ }
+
+ data_len = NLMSG_HDRLEN + (4 * NLA_HDRLEN) + (3 * sizeof(uint32_t)) +
+ sizeof(uint16_t);
+
+ vendor_event = cfg80211_vendor_event_alloc(hdd_ctx->wiphy, NULL,
+ data_len, QCA_NL80211_VENDOR_SUBCMD_NDP_INDEX,
+ GFP_KERNEL);
+ if (!vendor_event) {
+ hdd_err("cfg80211_vendor_event_alloc failed");
+ return;
+ }
+
+ if (nla_put_u32(vendor_event, QCA_WLAN_VENDOR_ATTR_NDP_SUBCMD,
+ QCA_WLAN_VENDOR_ATTR_NDP_END_RESPONSE))
+ goto ndp_end_rsp_nla_failed;
+
+ if (nla_put_u32(vendor_event, QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_TYPE,
+ rsp->status))
+ goto ndp_end_rsp_nla_failed;
+
+ if (nla_put_u32(vendor_event, QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_VALUE,
+ rsp->reason))
+ goto ndp_end_rsp_nla_failed;
+
+ if (nla_put_u16(vendor_event, QCA_WLAN_VENDOR_ATTR_NDP_TRANSACTION_ID,
+ rsp->transaction_id))
+ goto ndp_end_rsp_nla_failed;
+
+ hdd_info("NDP End rsp sent, transaction id: %d, status: %d, reason: %d",
+ rsp->transaction_id, rsp->status, rsp->reason);
+ cfg80211_vendor_event(vendor_event, GFP_KERNEL);
+ EXIT();
+ return;
+
+ndp_end_rsp_nla_failed:
+ hdd_err("nla_put api failed");
+ kfree_skb(vendor_event);
+ EXIT();
+}
+
+/**
+ * hdd_ndp_end_ind_handler() - NDP end indication handler
+ * @adapter: pointer to adapter context
+ * @ind_params: indication parameters
+ *
+ * Following vendor event is sent to cfg80211:
+ * QCA_WLAN_VENDOR_ATTR_NDP_SUBCMD =
+ * QCA_WLAN_VENDOR_ATTR_NDP_END_IND (4 bytes)
+ * QCA_WLAN_VENDOR_ATTR_NDP_INSTANCE_ID_ARRAY (4 * num of NDP Instances)
+ *
+ * Return: none
+ */
+static void hdd_ndp_end_ind_handler(hdd_adapter_t *adapter,
+ void *ind_params)
+{
+ struct sk_buff *vendor_event;
+ hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
+ struct ndp_end_indication_event *end_ind = ind_params;
+ uint32_t data_len, i;
+ struct nan_datapath_ctx *ndp_ctx = WLAN_HDD_GET_NDP_CTX_PTR(adapter);
+ hdd_station_ctx_t *sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
+ uint32_t *ndp_instance_array;
+ hdd_adapter_t *ndi_adapter;
+
+ ENTER();
+
+ if (!end_ind) {
+ hdd_err("Invalid ndp end indication");
+ return;
+ }
+
+ if (0 != wlan_hdd_validate_context(hdd_ctx))
+ return;
+
+ ndp_instance_array = qdf_mem_malloc(end_ind->num_ndp_ids *
+ sizeof(*ndp_instance_array));
+ if (!ndp_instance_array) {
+ hdd_err("Failed to allocate ndp_instance_array");
+ return;
+ }
+ for (i = 0; i < end_ind->num_ndp_ids; i++) {
+ int idx;
+
+ ndp_instance_array[i] = end_ind->ndp_map[i].ndp_instance_id;
+ ndi_adapter = hdd_get_adapter_by_vdev(hdd_ctx,
+ end_ind->ndp_map[i].vdev_id);
+ if (ndi_adapter == NULL) {
+ hdd_err("Adapter not found for vdev_id: %d",
+ end_ind->ndp_map[i].vdev_id);
+ continue;
+ }
+ ndp_ctx = WLAN_HDD_GET_NDP_CTX_PTR(ndi_adapter);
+ idx = hdd_get_peer_idx(sta_ctx,
+ &end_ind->ndp_map[i].peer_ndi_mac_addr);
+ if (idx == INVALID_PEER_IDX) {
+ hdd_err("can't find addr: %pM in sta_ctx.",
+ &end_ind->ndp_map[i].peer_ndi_mac_addr);
+ continue;
+ }
+ /* save the value of active sessions on each peer */
+ ndp_ctx->active_ndp_sessions[idx] =
+ end_ind->ndp_map[i].num_active_ndp_sessions;
+ }
+
+ data_len = (sizeof(uint32_t)) + NLMSG_HDRLEN + (2 * NLA_HDRLEN) +
+ end_ind->num_ndp_ids * sizeof(*ndp_instance_array);
+
+ vendor_event = cfg80211_vendor_event_alloc(hdd_ctx->wiphy, NULL,
+ data_len, QCA_NL80211_VENDOR_SUBCMD_NDP_INDEX,
+ GFP_KERNEL);
+ if (!vendor_event) {
+ hdd_err("cfg80211_vendor_event_alloc failed");
+ return;
+ }
+
+ if (nla_put_u32(vendor_event, QCA_WLAN_VENDOR_ATTR_NDP_SUBCMD,
+ QCA_WLAN_VENDOR_ATTR_NDP_END_IND))
+ goto ndp_end_ind_nla_failed;
+
+ if (nla_put(vendor_event, QCA_WLAN_VENDOR_ATTR_NDP_INSTANCE_ID_ARRAY,
+ end_ind->num_ndp_ids * sizeof(*ndp_instance_array),
+ ndp_instance_array))
+ goto ndp_end_ind_nla_failed;
+
+ cfg80211_vendor_event(vendor_event, GFP_KERNEL);
+ qdf_mem_free(ndp_instance_array);
+ EXIT();
+ return;
+
+ndp_end_ind_nla_failed:
+ hdd_err("nla_put api failed");
+ kfree_skb(vendor_event);
+ qdf_mem_free(ndp_instance_array);
+ EXIT();
+}
+
+/**
+ * hdd_ndp_event_handler() - ndp response and indication handler
+ * @adapter: adapter context
+ * @roam_info: pointer to roam_info structure
+ * @roam_id: roam id as indicated by SME
+ * @roam_status: roam status
+ * @roam_result: roam result
+ *
+ * Return: none
+ */
+void hdd_ndp_event_handler(hdd_adapter_t *adapter,
+ tCsrRoamInfo *roam_info, uint32_t roam_id, eRoamCmdStatus roam_status,
+ eCsrRoamResult roam_result)
+{
+ if (roam_status == eCSR_ROAM_NDP_STATUS_UPDATE) {
+ switch (roam_result) {
+ case eCSR_ROAM_RESULT_NDI_CREATE_RSP:
+ hdd_ndp_iface_create_rsp_handler(adapter,
+ &roam_info->ndp.ndi_create_params);
+ break;
+ case eCSR_ROAM_RESULT_NDI_DELETE_RSP:
+ hdd_ndp_iface_delete_rsp_handler(adapter,
+ &roam_info->ndp.ndi_delete_params);
+ break;
+ case eCSR_ROAM_RESULT_NDP_INITIATOR_RSP:
+ hdd_ndp_initiator_rsp_handler(adapter,
+ &roam_info->ndp.ndp_init_rsp_params);
+ break;
+ case eCSR_ROAM_RESULT_NDP_NEW_PEER_IND:
+ hdd_ndp_new_peer_ind_handler(adapter,
+ &roam_info->ndp.ndp_peer_ind_params);
+ break;
+ case eCSR_ROAM_RESULT_NDP_CONFIRM_IND:
+ hdd_ndp_confirm_ind_handler(adapter,
+ &roam_info->ndp.ndp_confirm_params);
+ break;
+ case eCSR_ROAM_RESULT_NDP_INDICATION:
+ hdd_ndp_indication_handler(adapter,
+ &roam_info->ndp.ndp_indication_params);
+ break;
+ case eCSR_ROAM_RESULT_NDP_RESPONDER_RSP:
+ hdd_ndp_responder_rsp_handler(adapter,
+ &roam_info->ndp.ndp_responder_rsp_params);
+ break;
+ case eCSR_ROAM_RESULT_NDP_END_RSP:
+ hdd_ndp_end_rsp_handler(adapter,
+ roam_info->ndp.ndp_end_rsp_params);
+ break;
+ case eCSR_ROAM_RESULT_NDP_PEER_DEPARTED_IND:
+ hdd_ndp_peer_departed_ind_handler(adapter,
+ &roam_info->ndp.ndp_peer_ind_params);
+ break;
+ case eCSR_ROAM_RESULT_NDP_END_IND:
+ hdd_ndp_end_ind_handler(adapter,
+ roam_info->ndp.ndp_end_ind_params);
+ break;
+ default:
+ hdd_err("Unknown NDP response event from SME %d",
+ roam_result);
+ break;
+ }
+ }
+}
+
+/**
+ * __wlan_hdd_cfg80211_process_ndp_cmds() - handle NDP request
+ * @wiphy: pointer to wireless wiphy structure.
+ * @wdev: pointer to wireless_dev structure.
+ * @data: Pointer to the data to be passed via vendor interface
+ * @data_len:Length of the data to be passed
+ *
+ * This function is invoked to handle vendor command
+ *
+ * Return: 0 on success, negative errno on failure
+ */
+static int __wlan_hdd_cfg80211_process_ndp_cmd(struct wiphy *wiphy,
+ struct wireless_dev *wdev, const void *data, int data_len)
+{
+ uint32_t ndp_cmd_type;
+ uint16_t transaction_id;
+ int ret_val;
+ hdd_context_t *hdd_ctx = wiphy_priv(wiphy);
+ struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_NDP_PARAMS_MAX + 1];
+ char *iface_name;
+
+ ENTER();
+
+ ret_val = wlan_hdd_validate_context(hdd_ctx);
+ if (ret_val)
+ return ret_val;
+
+ if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
+ hdd_err("Command not allowed in FTM mode");
+ return -EPERM;
+ }
+ if (!WLAN_HDD_IS_NDP_ENABLED(hdd_ctx)) {
+ hdd_err("NAN datapath is not enabled");
+ return -EPERM;
+ }
+ if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_NDP_PARAMS_MAX,
+ data, data_len,
+ qca_wlan_vendor_ndp_policy)) {
+ hdd_err("Invalid NDP vendor command attributes");
+ return -EINVAL;
+ }
+
+ /* Parse and fetch NDP Command Type*/
+ if (!tb[QCA_WLAN_VENDOR_ATTR_NDP_SUBCMD]) {
+ hdd_err("NAN datapath cmd type failed");
+ return -EINVAL;
+ }
+ ndp_cmd_type = nla_get_u32(tb[QCA_WLAN_VENDOR_ATTR_NDP_SUBCMD]);
+
+ if (!tb[QCA_WLAN_VENDOR_ATTR_NDP_TRANSACTION_ID]) {
+ hdd_err("attr transaction id failed");
+ return -EINVAL;
+ }
+ transaction_id = nla_get_u16(
+ tb[QCA_WLAN_VENDOR_ATTR_NDP_TRANSACTION_ID]);
+
+ if (tb[QCA_WLAN_VENDOR_ATTR_NDP_IFACE_STR]) {
+ iface_name = nla_data(tb[QCA_WLAN_VENDOR_ATTR_NDP_IFACE_STR]);
+ hdd_err("Transaction Id: %d NDP Cmd: %d iface_name: %s",
+ transaction_id, ndp_cmd_type, iface_name);
+ } else {
+ hdd_err("Transaction Id: %d NDP Cmd: %d iface_name: unspecified",
+ transaction_id, ndp_cmd_type);
+ }
+
+ switch (ndp_cmd_type) {
+ case QCA_WLAN_VENDOR_ATTR_NDP_INTERFACE_CREATE:
+ ret_val = hdd_ndi_create_req_handler(hdd_ctx, tb);
+ break;
+ case QCA_WLAN_VENDOR_ATTR_NDP_INTERFACE_DELETE:
+ ret_val = hdd_ndi_delete_req_handler(hdd_ctx, tb);
+ break;
+ case QCA_WLAN_VENDOR_ATTR_NDP_INITIATOR_REQUEST:
+ ret_val = hdd_ndp_initiator_req_handler(hdd_ctx, tb);
+ break;
+ case QCA_WLAN_VENDOR_ATTR_NDP_RESPONDER_REQUEST:
+ ret_val = hdd_ndp_responder_req_handler(hdd_ctx, tb);
+ break;
+ case QCA_WLAN_VENDOR_ATTR_NDP_END_REQUEST:
+ ret_val = hdd_ndp_end_req_handler(hdd_ctx, tb);
+ break;
+ default:
+ hdd_err("Unrecognized NDP vendor cmd %d", ndp_cmd_type);
+ ret_val = -EINVAL;
+ break;
+ }
+
+ return ret_val;
+}
+
+/**
+ * wlan_hdd_cfg80211_process_ndp_cmd() - handle NDP request
+ * @wiphy: pointer to wireless wiphy structure.
+ * @wdev: pointer to wireless_dev structure.
+ * @data: Pointer to the data to be passed via vendor interface
+ * @data_len:Length of the data to be passed
+ *
+ * This function is called to send a NAN request to
+ * firmware. This is an SSR-protected wrapper function.
+ *
+ * Return: 0 on success, negative errno on failure
+ */
+int wlan_hdd_cfg80211_process_ndp_cmd(struct wiphy *wiphy,
+ struct wireless_dev *wdev, const void *data, int data_len)
+{
+ int ret;
+
+ cds_ssr_protect(__func__);
+ ret = __wlan_hdd_cfg80211_process_ndp_cmd(wiphy, wdev, data, data_len);
+ cds_ssr_unprotect(__func__);
+
+ return ret;
+}
+
+/**
+ * hdd_init_nan_data_mode() - initialize nan data mode
+ * @adapter: adapter context
+ *
+ * Returns: 0 on success negative error code on error
+ */
+int hdd_init_nan_data_mode(struct hdd_adapter_s *adapter)
+{
+ struct net_device *wlan_dev = adapter->dev;
+ struct nan_datapath_ctx *ndp_ctx = WLAN_HDD_GET_NDP_CTX_PTR(adapter);
+ hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
+ QDF_STATUS status;
+ uint32_t type, sub_type;
+ int32_t ret_val = 0;
+ unsigned long rc;
+ uint32_t timeout = WLAN_WAIT_TIME_SESSIONOPENCLOSE;
+
+ INIT_COMPLETION(adapter->session_open_comp_var);
+ sme_set_curr_device_mode(hdd_ctx->hHal, adapter->device_mode);
+ status = cds_get_vdev_types(adapter->device_mode, &type, &sub_type);
+ if (QDF_STATUS_SUCCESS != status) {
+ hdd_err("failed to get vdev type");
+ goto error_sme_open;
+ }
+
+ /* open sme session for future use */
+ status = sme_open_session(hdd_ctx->hHal, hdd_sme_roam_callback,
+ adapter, (uint8_t *)&adapter->macAddressCurrent,
+ &adapter->sessionId, type, sub_type);
+ if (QDF_STATUS_SUCCESS == status) {
+ hdd_err("sme_open_session() failed with status code %d",
+ status);
+ ret_val = -EAGAIN;
+ goto error_sme_open;
+ }
+
+ /* Block on a completion variable. Can't wait forever though */
+ rc = wait_for_completion_timeout(
+ &adapter->session_open_comp_var,
+ msecs_to_jiffies(timeout));
+ if (!rc) {
+ hdd_err("Failed to open session, timeout code: %ld", rc);
+ ret_val = -ETIMEDOUT;
+ goto error_sme_open;
+ }
+
+ /* Register wireless extensions */
+ ret_val = hdd_register_wext(wlan_dev);
+ if (0 > ret_val) {
+ hdd_err("Wext registration failed with status code %d",
+ ret_val);
+ ret_val = -EAGAIN;
+ goto error_register_wext;
+ }
+
+ status = hdd_init_tx_rx(adapter);
+ if (QDF_STATUS_SUCCESS != status) {
+ hdd_err("hdd_init_tx_rx() init failed, status %d", status);
+ ret_val = -EAGAIN;
+ goto error_init_txrx;
+ }
+
+ set_bit(INIT_TX_RX_SUCCESS, &adapter->event_flags);
+
+ status = hdd_wmm_adapter_init(adapter);
+ if (QDF_STATUS_SUCCESS != status) {
+ hdd_err("hdd_wmm_adapter_init() failed, status %d", status);
+ ret_val = -EAGAIN;
+ goto error_wmm_init;
+ }
+
+ set_bit(WMM_INIT_DONE, &adapter->event_flags);
+
+ ret_val = wma_cli_set_command((int)adapter->sessionId,
+ (int)WMI_PDEV_PARAM_BURST_ENABLE,
+ (int)hdd_ctx->config->enableSifsBurst,
+ PDEV_CMD);
+ if (0 != ret_val) {
+ hdd_err("WMI_PDEV_PARAM_BURST_ENABLE set failed %d", ret_val);
+ }
+
+ ndp_ctx->state = NAN_DATA_NDI_CREATING_STATE;
+ return ret_val;
+
+error_wmm_init:
+ clear_bit(INIT_TX_RX_SUCCESS, &adapter->event_flags);
+ hdd_deinit_tx_rx(adapter);
+
+error_init_txrx:
+ hdd_unregister_wext(wlan_dev);
+
+error_register_wext:
+ if (test_bit(SME_SESSION_OPENED, &adapter->event_flags)) {
+ INIT_COMPLETION(adapter->session_close_comp_var);
+ if (QDF_STATUS_SUCCESS ==
+ sme_close_session(hdd_ctx->hHal,
+ adapter->sessionId,
+ hdd_sme_close_session_callback,
+ adapter)) {
+ rc = wait_for_completion_timeout(
+ &adapter->session_close_comp_var,
+ msecs_to_jiffies(timeout));
+ if (rc <= 0) {
+ hdd_err("Session close failed status %ld", rc);
+ ret_val = -ETIMEDOUT;
+ }
+ }
+ }
+
+error_sme_open:
+ return ret_val;
+}
diff --git a/core/hdd/src/wlan_hdd_nan_datapath.h b/core/hdd/src/wlan_hdd_nan_datapath.h
index c9295cb2577a..7113243d6c2d 100644
--- a/core/hdd/src/wlan_hdd_nan_datapath.h
+++ b/core/hdd/src/wlan_hdd_nan_datapath.h
@@ -23,9 +23,213 @@
*
* WLAN Host Device Driver nan datapath API specification
*/
-
#ifndef __WLAN_HDD_NAN_DATAPATH_H
#define __WLAN_HDD_NAN_DATAPATH_H
-#endif /* __WLAN_HDD_NAN_DATAPATH_H */
+struct hdd_context_s;
+struct hdd_tgt_cfg;
+struct hdd_config;
+struct hdd_adapter_s;
+struct wireless_dev;
+
+/* NAN Social channels */
+#define NAN_SOCIAL_CHANNEL_2_4GHZ 6
+#define NAN_SOCIAL_CHANNEL_5GHZ_LOWER_BAND 44
+#define NAN_SOCIAL_CHANNEL_5GHZ_UPPER_BAND 149
+
+#define NDP_APP_INFO_LEN 255
+#define NDP_QOS_INFO_LEN 255
+#define NDP_NUM_INSTANCE_ID 255
+
+#define NDP_BROADCAST_STAID (0)
+
+#ifdef WLAN_FEATURE_NAN_DATAPATH
+#define WLAN_HDD_IS_NDI(adapter) ((adapter)->device_mode == QDF_NDI_MODE)
+
+#define WLAN_HDD_IS_NDI_CONNECTED(adapter) ( \
+ eConnectionState_NdiConnected ==\
+ (adapter)->sessionCtx.station.conn_info.connState)
+#else
+#define WLAN_HDD_IS_NDI(adapter) (false)
+#define WLAN_HDD_IS_NDI_CONNECTED(adapter) (false)
+#endif /* WLAN_FEATURE_NAN_DATAPATH */
+
+/**
+ * enum qca_wlan_vendor_attr_ndp_params - vendor attribute parameters
+ * @QCA_WLAN_VENDOR_ATTR_NDP_SUBCMD: NDP Sub command
+ * @QCA_WLAN_VENDOR_ATTR_NDP_TRANSACTION_ID: Transaction id reference
+ * @QCA_WLAN_VENDOR_ATTR_NDP_STATUS_ID: NDP status id
+ * @QCA_WLAN_VENDOR_ATTR_NDP_SERVICE_INSTANCE_ID: Service instance id
+ * @QCA_WLAN_VENDOR_ATTR_NDP_CHANNEL: Requested channel
+ * @QCA_WLAN_VENDOR_ATTR_NDP_PEER_DISCOVERY_MAC_ADDR: Peer discovery mac addr
+ * @QCA_WLAN_VENDOR_ATTR_NDP_IFACE_STR: Iface name
+ * @QCA_WLAN_VENDOR_ATTR_NDP_CONFIG_SECURITY: Security configuration
+ * @QCA_WLAN_VENDOR_ATTR_NDP_CONFIG_QOS: Qos configuration
+ * @QCA_WLAN_VENDOR_ATTR_NDP_APP_INFO: Application info
+ * @QCA_WLAN_VENDOR_ATTR_NDP_INSTANCE_ID: NDP instance id
+ * @QCA_WLAN_VENDOR_ATTR_NDP_INSTANCE_ID_ARRAY: NDP instance id array
+ * @QCA_WLAN_VENDOR_ATTR_NDP_RESPONSE_CODE: Schedule response
+ * @QCA_WLAN_VENDOR_ATTR_NDP_NDI_MAC_ADDR: NDI mac address
+ * @QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_TYPE: Driver return status
+ * @QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_VALUE: Driver return value
+ */
+enum qca_wlan_vendor_attr_ndp_params {
+ QCA_WLAN_VENDOR_ATTR_NDP_PARAM_INVALID = 0,
+ QCA_WLAN_VENDOR_ATTR_NDP_SUBCMD,
+ QCA_WLAN_VENDOR_ATTR_NDP_TRANSACTION_ID,
+ QCA_WLAN_VENDOR_ATTR_NDP_SERVICE_INSTANCE_ID,
+ QCA_WLAN_VENDOR_ATTR_NDP_CHANNEL,
+ QCA_WLAN_VENDOR_ATTR_NDP_PEER_DISCOVERY_MAC_ADDR,
+ QCA_WLAN_VENDOR_ATTR_NDP_IFACE_STR,
+ QCA_WLAN_VENDOR_ATTR_NDP_CONFIG_SECURITY,
+ QCA_WLAN_VENDOR_ATTR_NDP_CONFIG_QOS,
+ QCA_WLAN_VENDOR_ATTR_NDP_APP_INFO,
+ QCA_WLAN_VENDOR_ATTR_NDP_INSTANCE_ID,
+ QCA_WLAN_VENDOR_ATTR_NDP_INSTANCE_ID_ARRAY,
+ QCA_WLAN_VENDOR_ATTR_NDP_RESPONSE_CODE,
+ QCA_WLAN_VENDOR_ATTR_NDP_NDI_MAC_ADDR,
+ QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_TYPE,
+ QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_VALUE,
+
+ QCA_WLAN_VENDOR_ATTR_NDP_PARAMS_AFTER_LAST,
+ QCA_WLAN_VENDOR_ATTR_NDP_PARAMS_MAX =
+ QCA_WLAN_VENDOR_ATTR_NDP_PARAMS_AFTER_LAST - 1,
+};
+
+/**
+ * enum qca_wlan_vendor_attr_ndp_cfg_security - vendor security attribute
+ * @QCA_WLAN_VENDOR_ATTR_NDP_SECURITY_ENABLE: Security enabled
+ */
+enum qca_wlan_vendor_attr_ndp_cfg_security {
+ QCA_WLAN_VENDOR_ATTR_NDP_SECURITY_ENABLE = 1,
+};
+/**
+ * enum qca_wlan_vendor_attr_ndp_qos - vendor qos attribute
+ * @QCA_WLAN_VENDOR_ATTR_NDP_QOS_CONFIG: NDP QoS configuration
+ */
+enum qca_wlan_vendor_attr_ndp_qos {
+ QCA_WLAN_VENDOR_ATTR_NDP_QOS_CONFIG = 1,
+};
+
+/**
+ * enum qca_wlan_vendor_attr_ndp_sub_cmd_value - NDP subcmd value
+ * @QCA_WLAN_VENDOR_ATTR_NDP_INVALID: Unused subcmd value
+ * @QCA_WLAN_VENDOR_ATTR_NDP_INTERFACE_CREATE: iface create
+ * @QCA_WLAN_VENDOR_ATTR_NDP_INTERFACE_DELETE: iface delete
+ * @QCA_WLAN_VENDOR_ATTR_NDP_INITIATOR_REQUEST: NDP initiator request
+ * @QCA_WLAN_VENDOR_ATTR_NDP_INITIATOR_RESPONSE: NDP initiator response
+ * @QCA_WLAN_VENDOR_ATTR_NDP_RESPONDER_REQUEST: NDP responder request
+ * @QCA_WLAN_VENDOR_ATTR_NDP_RESPONDER_RESPONSE: NDP responder response
+ * @QCA_WLAN_VENDOR_ATTR_NDP_END_REQUEST: NDP end request
+ * @QCA_WLAN_VENDOR_ATTR_NDP_END_RESPONSE: NDP end response
+ * @QCA_WLAN_VENDOR_ATTR_NDP_REQUEST_IND: NDP request indication
+ * @QCA_WLAN_VENDOR_ATTR_NDP_CONFIRM_IND: NDP confirm indication
+ * @QCA_WLAN_VENDOR_ATTR_NDP_END_IND: NDP End indication
+ */
+enum qca_wlan_vendor_attr_ndp_sub_cmd_value {
+ QCA_WLAN_VENDOR_ATTR_NDP_INVALID = 0,
+ QCA_WLAN_VENDOR_ATTR_NDP_INTERFACE_CREATE = 1,
+ QCA_WLAN_VENDOR_ATTR_NDP_INTERFACE_DELETE = 2,
+ QCA_WLAN_VENDOR_ATTR_NDP_INITIATOR_REQUEST = 3,
+ QCA_WLAN_VENDOR_ATTR_NDP_INITIATOR_RESPONSE = 4,
+ QCA_WLAN_VENDOR_ATTR_NDP_RESPONDER_REQUEST = 5,
+ QCA_WLAN_VENDOR_ATTR_NDP_RESPONDER_RESPONSE = 6,
+ QCA_WLAN_VENDOR_ATTR_NDP_END_REQUEST = 7,
+ QCA_WLAN_VENDOR_ATTR_NDP_END_RESPONSE = 8,
+ QCA_WLAN_VENDOR_ATTR_NDP_REQUEST_IND = 9,
+ QCA_WLAN_VENDOR_ATTR_NDP_CONFIRM_IND = 10,
+ QCA_WLAN_VENDOR_ATTR_NDP_END_IND = 11
+};
+
+/** enum nan_datapath_state - NAN datapath states
+ * @NAN_DATA_NDI_CREATING_STATE: NDI create is in progress
+ * @NAN_DATA_NDI_CREATED_STATE: NDI successfully crated
+ * @NAN_DATA_NDI_DELETING_STATE: NDI delete is in progress
+ * @NAN_DATA_NDI_DELETED_STATE: NDI delete is in progress
+ * @NAN_DATA_PEER_CREATE_STATE: Peer create is in progress
+ * @NAN_DATA_PEER_DELETE_STATE: Peer delete is in progrss
+ * @NAN_DATA_CONNECTING_STATE: Data connection in progress
+ * @NAN_DATA_CONNECTED_STATE: Data connection successful
+ * @NAN_DATA_END_STATE: NDP end is in progress
+ * @NAN_DATA_DISCONNECTED_STATE: NDP is in disconnected state
+ */
+enum nan_datapath_state {
+ NAN_DATA_NDI_CREATING_STATE = 0,
+ NAN_DATA_NDI_CREATED_STATE = 1,
+ NAN_DATA_NDI_DELETING_STATE = 2,
+ NAN_DATA_NDI_DELETED_STATE = 3,
+ NAN_DATA_PEER_CREATE_STATE = 4,
+ NAN_DATA_PEER_DELETE_STATE = 5,
+ NAN_DATA_CONNECTING_STATE = 6,
+ NAN_DATA_CONNECTED_STATE = 7,
+ NAN_DATA_END_STATE = 8,
+ NAN_DATA_DISCONNECTED_STATE = 9,
+};
+
+/**
+ * struct nan_datapath_ctx - context for nan data path
+ * @state: Current state of NDP
+ * @active_ndp_sessions: active ndp sessions per adapter
+ * @active_ndp_peers: number of active ndp peers
+ * @ndp_create_transaction_id: transaction id for create req
+ * @ndp_delete_transaction_id: transaction id for delete req
+ * @ndp_key_installed: NDP security key installed
+ * @ndp_enc_key: NDP encryption key info
+ * @ndp_debug_state: debug state info
+ * @ndi_delete_rsp_reason: reason code for ndi_delete rsp
+ * @ndi_delete_rsp_status: status for ndi_delete rsp
+ */
+struct nan_datapath_ctx {
+ enum nan_datapath_state state;
+ /* idx in following array should follow conn_info.peerMacAddress */
+ uint32_t active_ndp_sessions[MAX_PEERS];
+ uint32_t active_ndp_peers;
+ uint16_t ndp_create_transaction_id;
+ uint16_t ndp_delete_transaction_id;
+ bool ndp_key_installed;
+ tCsrRoamSetKey ndp_enc_key;
+ uint32_t ndp_debug_state;
+ uint32_t ndi_delete_rsp_reason;
+ uint32_t ndi_delete_rsp_status;
+};
+
+#ifdef WLAN_FEATURE_NAN_DATAPATH
+void hdd_ndp_print_ini_config(struct hdd_context_s *hdd_ctx);
+void hdd_nan_datapath_target_config(struct hdd_context_s *hdd_ctx,
+ struct wma_tgt_cfg *cfg);
+void hdd_ndp_event_handler(struct hdd_adapter_s *adapter,
+ tCsrRoamInfo *roam_info, uint32_t roam_id, eRoamCmdStatus roam_status,
+ eCsrRoamResult roam_result);
+int wlan_hdd_cfg80211_process_ndp_cmd(struct wiphy *wiphy,
+ struct wireless_dev *wdev, const void *data, int data_len);
+int hdd_init_nan_data_mode(struct hdd_adapter_s *adapter);
+void hdd_ndp_session_end_handler(hdd_adapter_t *adapter);
+#else
+static inline void hdd_ndp_print_ini_config(struct hdd_context_s *hdd_ctx)
+{
+}
+static inline void hdd_nan_datapath_target_config(struct hdd_context_s *hdd_ctx,
+ struct wma_tgt_cfg *cfg)
+{
+}
+static inline void hdd_ndp_event_handler(struct hdd_adapter_s *adapter,
+ tCsrRoamInfo *roam_info, uint32_t roam_id, eRoamCmdStatus roam_status,
+ eCsrRoamResult roam_result)
+{
+}
+static inline int wlan_hdd_cfg80211_process_ndp_cmd(struct wiphy *wiphy,
+ struct wireless_dev *wdev, const void *data, int data_len)
+{
+ return 0;
+}
+static inline int hdd_init_nan_data_mode(struct hdd_adapter_s *adapter)
+{
+ return 0;
+}
+static inline void hdd_ndp_session_end_handler(hdd_adapter_t *adapter)
+{
+}
+#endif /* WLAN_FEATURE_NAN_DATAPATH */
+
+#endif /* __WLAN_HDD_NAN_DATAPATH_H */
diff --git a/core/hdd/src/wlan_hdd_p2p.c b/core/hdd/src/wlan_hdd_p2p.c
index e7bd3315b86a..58c790f3b34d 100644
--- a/core/hdd/src/wlan_hdd_p2p.c
+++ b/core/hdd/src/wlan_hdd_p2p.c
@@ -53,8 +53,8 @@
#include "cds_sched.h"
#include "cds_concurrency.h"
-/* Ms to Micro Sec */
-#define MS_TO_MUS(x) ((x) * 1000)
+/* Ms to Time Unit Micro Sec */
+#define MS_TO_TU_MUS(x) ((x) * 1024)
static uint8_t *hdd_get_action_string(uint16_t MsgType)
{
@@ -1411,7 +1411,9 @@ int __wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
home_ch = goAdapter->sessionCtx.ap.operatingChannel;
}
- if (ieee80211_frequency_to_channel(chan->center_freq) == home_ch) {
+ if (chan &&
+ (ieee80211_frequency_to_channel(chan->center_freq) ==
+ home_ch)) {
/* if adapter is already on requested ch, no need for ROC */
wait = 0;
hddLog(LOG1,
@@ -1419,7 +1421,7 @@ int __wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
goto send_frame;
}
- if (offchan && wait) {
+ if (offchan && wait && chan) {
int status;
rem_on_channel_request_type_t req_type = OFF_CHANNEL_ACTION_TX;
/* In case of P2P Client mode if we are already */
@@ -1732,7 +1734,7 @@ int hdd_set_p2p_noa(struct net_device *dev, uint8_t *command)
hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter);
tP2pPsConfig NoA;
- int count, duration, start_time;
+ int count, duration, interval;
char *param;
int ret;
@@ -1743,7 +1745,7 @@ int hdd_set_p2p_noa(struct net_device *dev, uint8_t *command)
return -EINVAL;
}
param++;
- ret = sscanf(param, "%d %d %d", &count, &start_time, &duration);
+ ret = sscanf(param, "%d %d %d", &count, &interval, &duration);
if (ret != 3) {
QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR,
"%s: P2P_SET GO NoA: fail to read params, ret=%d",
@@ -1751,9 +1753,9 @@ int hdd_set_p2p_noa(struct net_device *dev, uint8_t *command)
return -EINVAL;
}
QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO,
- "%s: P2P_SET GO NoA: count=%d start_time=%d duration=%d",
- __func__, count, start_time, duration);
- duration = MS_TO_MUS(duration);
+ "%s: P2P_SET GO NoA: count=%d interval=%d duration=%d",
+ __func__, count, interval, duration);
+ duration = MS_TO_TU_MUS(duration);
/* PS Selection
* Periodic NoA (2)
* Single NOA (4)
@@ -1769,7 +1771,7 @@ int hdd_set_p2p_noa(struct net_device *dev, uint8_t *command)
NoA.single_noa_duration = 0;
NoA.psSelection = P2P_POWER_SAVE_TYPE_PERIODIC_NOA;
}
- NoA.interval = MS_TO_MUS(100);
+ NoA.interval = MS_TO_TU_MUS(interval);
NoA.count = count;
NoA.sessionid = pAdapter->sessionId;
@@ -1807,30 +1809,45 @@ int hdd_set_p2p_noa(struct net_device *dev, uint8_t *command)
int hdd_set_p2p_opps(struct net_device *dev, uint8_t *command)
{
- hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
- tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter);
- tP2pPsConfig NoA;
+ hdd_adapter_t *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
+ tHalHandle handle = WLAN_HDD_GET_HAL_CTX(adapter);
+ tP2pPsConfig noa;
char *param;
int legacy_ps, opp_ps, ctwindow;
int ret;
param = strnchr(command, strlen(command), ' ');
if (param == NULL) {
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR,
- "%s: strnchr failed to find delimiter", __func__);
+ hdd_err("strnchr failed to find delimiter");
return -EINVAL;
}
param++;
ret = sscanf(param, "%d %d %d", &legacy_ps, &opp_ps, &ctwindow);
if (ret != 3) {
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR,
- "%s: P2P_SET GO PS: fail to read params, ret=%d",
- __func__, ret);
+ hdd_err("P2P_SET GO PS: fail to read params, ret=%d", ret);
+ return -EINVAL;
+ }
+
+ if ((opp_ps != -1) && (opp_ps != 0) && (opp_ps != 1)) {
+ hdd_err("Invalid opp_ps value:%d", opp_ps);
return -EINVAL;
}
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO,
- "%s: P2P_SET GO PS: legacy_ps=%d opp_ps=%d ctwindow=%d",
- __func__, legacy_ps, opp_ps, ctwindow);
+
+ /* P2P spec: 3.3.2 Power Management and discovery:
+ * CTWindow should be at least 10 TU.
+ * P2P spec: Table 27 - CTWindow and OppPS Parameters field format:
+ * CTWindow and OppPS Parameters together is 8 bits.
+ * CTWindow uses 7 bits (0-6, Bit 7 is for OppPS)
+ * 0 indicates that there shall be no CTWindow
+ */
+ if ((ctwindow != -1) && (ctwindow != 0) &&
+ (!((ctwindow >= 10) && (ctwindow <= 127)))) {
+ hdd_err("Invalid CT window value:%d", ctwindow);
+ return -EINVAL;
+ }
+
+ hdd_info("P2P_SET GO PS: legacy_ps=%d opp_ps=%d ctwindow=%d",
+ legacy_ps, opp_ps, ctwindow);
/* PS Selection
* Opportunistic Power Save (1)
@@ -1843,67 +1860,44 @@ int hdd_set_p2p_opps(struct net_device *dev, uint8_t *command)
* P2P_SET ctwindow 30
* Command Received at hdd_hostapd_ioctl is as below:
* P2P_SET_PS -1 -1 30 (legacy_ps = -1, opp_ps = -1, ctwindow = 30)
+ *
+ * e.g., 1: P2P_SET_PS 1 1 30
+ * Driver sets the Opps and CTwindow as 30 and send it to FW.
+ * e.g., 2: P2P_SET_PS 1 -1 15
+ * Driver caches the CTwindow value but not send the command to FW.
+ * e.g., 3: P2P_SET_PS 1 1 -1
+ * Driver sends the command to FW with Opps enabled and CT window as
+ * 15 (last cached CTWindow value).
+ * (or) : P2P_SET_PS 1 1 20
+ * Driver sends the command to FW with opps enabled and CT window
+ * as 20.
+ *
+ * legacy_ps param remains unused until required in the future.
*/
- if (ctwindow != -1) {
-
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO,
- "Opportunistic Power Save is %s",
- (true == pAdapter->ops) ? "Enable" : "Disable");
-
- if (ctwindow != pAdapter->ctw) {
- pAdapter->ctw = ctwindow;
-
- if (pAdapter->ops) {
- NoA.opp_ps = pAdapter->ops;
- NoA.ctWindow = pAdapter->ctw;
- NoA.duration = 0;
- NoA.single_noa_duration = 0;
- NoA.interval = 0;
- NoA.count = 0;
- NoA.psSelection =
- P2P_POWER_SAVE_TYPE_OPPORTUNISTIC;
- NoA.sessionid = pAdapter->sessionId;
-
- QDF_TRACE(QDF_MODULE_ID_HDD,
- QDF_TRACE_LEVEL_INFO,
- "%s: P2P_PS_ATTR:oppPS %d ctWindow %d duration %d "
- "interval %d count %d single noa duration %d "
- "PsSelection %x", __func__,
- NoA.opp_ps, NoA.ctWindow,
- NoA.duration, NoA.interval, NoA.count,
- NoA.single_noa_duration,
- NoA.psSelection);
-
- sme_p2p_set_ps(hHal, &NoA);
- }
- return 0;
- }
- }
+ if (ctwindow != -1)
+ adapter->ctw = ctwindow;
+ /* Send command to FW when OppPS is either enabled(1)/disbaled(0) */
if (opp_ps != -1) {
- pAdapter->ops = opp_ps;
-
- if ((opp_ps != -1) && (pAdapter->ctw)) {
- NoA.opp_ps = opp_ps;
- NoA.ctWindow = pAdapter->ctw;
- NoA.duration = 0;
- NoA.single_noa_duration = 0;
- NoA.interval = 0;
- NoA.count = 0;
- NoA.psSelection = P2P_POWER_SAVE_TYPE_OPPORTUNISTIC;
- NoA.sessionid = pAdapter->sessionId;
-
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO,
- "%s: P2P_PS_ATTR:oppPS %d ctWindow %d duration %d "
- "interval %d count %d single noa duration %d "
- "PsSelection %x", __func__, NoA.opp_ps,
- NoA.ctWindow, NoA.duration, NoA.interval,
- NoA.count, NoA.single_noa_duration,
- NoA.psSelection);
-
- sme_p2p_set_ps(hHal, &NoA);
- }
+ adapter->ops = opp_ps;
+ noa.opp_ps = adapter->ops;
+ noa.ctWindow = adapter->ctw;
+ noa.duration = 0;
+ noa.single_noa_duration = 0;
+ noa.interval = 0;
+ noa.count = 0;
+ noa.psSelection = P2P_POWER_SAVE_TYPE_OPPORTUNISTIC;
+ noa.sessionid = adapter->sessionId;
+
+ hdd_debug("P2P_PS_ATTR: oppPS %d ctWindow %d duration %d interval %d count %d single noa duration %d PsSelection %x",
+ noa.opp_ps, noa.ctWindow,
+ noa.duration, noa.interval, noa.count,
+ noa.single_noa_duration,
+ noa.psSelection);
+
+ sme_p2p_set_ps(handle, &noa);
}
+
return 0;
}
diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c
index dc7c45dd9e7d..7412c3201e6b 100644
--- a/core/hdd/src/wlan_hdd_power.c
+++ b/core/hdd/src/wlan_hdd_power.c
@@ -65,6 +65,7 @@
#include <wlan_hdd_cfg80211.h>
#include <net/addrconf.h>
#include <wlan_hdd_ipa.h>
+#include <wlan_hdd_lpass.h>
#include <wma_types.h>
#include "hif.h"
@@ -265,7 +266,8 @@ static int __wlan_hdd_ipv6_changed(struct notifier_block *nb,
if ((pAdapter->dev == ndev) &&
(pAdapter->device_mode == QDF_STA_MODE ||
- pAdapter->device_mode == QDF_P2P_CLIENT_MODE)) {
+ pAdapter->device_mode == QDF_P2P_CLIENT_MODE ||
+ pAdapter->device_mode == QDF_NDI_MODE)) {
pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
status = wlan_hdd_validate_context(pHddCtx);
if (0 != status)
@@ -481,6 +483,7 @@ void __hdd_ipv6_notifier_work_queue(struct work_struct *work)
container_of(work, hdd_adapter_t, ipv6NotifierWorkQueue);
hdd_context_t *pHddCtx;
int status;
+ bool ndi_connected = false;
ENTER();
@@ -500,8 +503,13 @@ void __hdd_ipv6_notifier_work_queue(struct work_struct *work)
pHddCtx->sus_res_mcastbcast_filter_valid = true;
}
- if ((eConnectionState_Associated ==
- (WLAN_HDD_GET_STATION_CTX_PTR(pAdapter))->conn_info.connState))
+ /* check if the device is in NAN data mode */
+ if (WLAN_HDD_IS_NDI(pAdapter))
+ ndi_connected = WLAN_HDD_IS_NDI_CONNECTED(pAdapter);
+
+ if (eConnectionState_Associated ==
+ (WLAN_HDD_GET_STATION_CTX_PTR(pAdapter))->conn_info.connState ||
+ ndi_connected)
if (pHddCtx->config->fhostNSOffload)
hdd_conf_ns_offload(pAdapter, true);
EXIT();
@@ -592,6 +600,7 @@ void __hdd_ipv4_notifier_work_queue(struct work_struct *work)
container_of(work, hdd_adapter_t, ipv4NotifierWorkQueue);
hdd_context_t *pHddCtx;
int status;
+ bool ndi_connected = false;
hdd_info("Configuring ARP Offload");
pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
@@ -610,8 +619,18 @@ void __hdd_ipv4_notifier_work_queue(struct work_struct *work)
pHddCtx->sus_res_mcastbcast_filter_valid = true;
}
- if ((eConnectionState_Associated ==
- (WLAN_HDD_GET_STATION_CTX_PTR(pAdapter))->conn_info.connState))
+ /* check if the device is in NAN data mode */
+ if (WLAN_HDD_IS_NDI(pAdapter))
+ ndi_connected = WLAN_HDD_IS_NDI_CONNECTED(pAdapter);
+
+ if (eConnectionState_Associated ==
+ (WLAN_HDD_GET_STATION_CTX_PTR(pAdapter))->conn_info.connState ||
+ ndi_connected)
+ /*
+ * This invocation being part of the IPv4 registration callback,
+ * we are passing second parameter as 2 to avoid registration
+ * of IPv4 notifier again.
+ */
hdd_conf_arp_offload(pAdapter, true);
}
@@ -662,7 +681,8 @@ static int __wlan_hdd_ipv4_changed(struct notifier_block *nb,
if ((pAdapter && pAdapter->dev == ndev) &&
(pAdapter->device_mode == QDF_STA_MODE ||
- pAdapter->device_mode == QDF_P2P_CLIENT_MODE)) {
+ pAdapter->device_mode == QDF_P2P_CLIENT_MODE ||
+ pAdapter->device_mode == QDF_NDI_MODE)) {
pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
status = wlan_hdd_validate_context(pHddCtx);
@@ -1326,9 +1346,7 @@ QDF_STATUS hdd_wlan_shutdown(void)
hddLog(QDF_TRACE_LEVEL_FATAL, "%s: WLAN driver shutting down!",
__func__);
-#ifdef WLAN_FEATURE_LPSS
wlan_hdd_send_status_pkg(NULL, NULL, 0, 0);
-#endif
/* If SSR never completes, then do kernel panic. */
hdd_ssr_timer_init();
@@ -1660,12 +1678,10 @@ QDF_STATUS hdd_wlan_re_init(void *hif_sc)
sme_set_rssi_threshold_breached_cb(pHddCtx->hHal, hdd_rssi_threshold_breached);
-#ifdef WLAN_FEATURE_LPSS
wlan_hdd_send_all_scan_intf_info(pHddCtx);
wlan_hdd_send_version_pkg(pHddCtx->target_fw_version,
pHddCtx->target_hw_version,
pHddCtx->target_hw_name);
-#endif
qdf_status = wlansap_global_init();
if (QDF_IS_STATUS_ERROR(qdf_status))
goto err_cds_disable;
diff --git a/core/hdd/src/wlan_hdd_scan.c b/core/hdd/src/wlan_hdd_scan.c
index 484a78c562b6..577a069090e2 100644
--- a/core/hdd/src/wlan_hdd_scan.c
+++ b/core/hdd/src/wlan_hdd_scan.c
@@ -31,6 +31,9 @@
* WLAN Host Device Driver scan implementation
*/
+/* denote that this file does not allow legacy hddLog */
+#define HDD_DISALLOW_LEGACY_HDDLOG 1
+
#include <linux/wireless.h>
#include <net/cfg80211.h>
@@ -122,7 +125,7 @@ static int hdd_add_iw_stream_event(int cmd, int length, char *data,
if (*last_event == *current_event) {
/* no space to add event */
- hddLog(LOGE, "%s: no space left to add event", __func__);
+ hdd_err("no space left to add event");
return -E2BIG; /* Error code, may be E2BIG */
}
@@ -214,8 +217,7 @@ static int hdd_indicate_scan_result(hdd_scan_info_t *scanInfo,
char custom[MAX_CUSTOM_LEN];
char *p;
- hddLog(LOG1, "hdd_indicate_scan_result " MAC_ADDRESS_STR,
- MAC_ADDR_ARRAY(descriptor->bssId));
+ hdd_notice(MAC_ADDRESS_STR, MAC_ADDR_ARRAY(descriptor->bssId));
error = 0;
last_event = current_event;
@@ -232,7 +234,7 @@ static int hdd_indicate_scan_result(hdd_scan_info_t *scanInfo,
if (last_event == current_event) {
/* no space to add event */
/* Error code may be E2BIG */
- hddLog(LOGE, "hdd_indicate_scan_result: no space for SIOCGIWAP ");
+ hdd_err("no space for SIOCGIWAP");
return -E2BIG;
}
@@ -256,8 +258,7 @@ static int hdd_indicate_scan_result(hdd_scan_info_t *scanInfo,
modestr = "n";
break;
default:
- hddLog(LOGW, "%s: Unknown network type [%d]",
- __func__, descriptor->nwType);
+ hdd_warn("Unknown network type [%d]", descriptor->nwType);
modestr = "?";
break;
}
@@ -266,8 +267,7 @@ static int hdd_indicate_scan_result(hdd_scan_info_t *scanInfo,
&event, IW_EV_CHAR_LEN);
if (last_event == current_event) { /* no space to add event */
- hddLog(LOGE,
- "hdd_indicate_scan_result: no space for SIOCGIWNAME");
+ hdd_err("no space for SIOCGIWNAME");
/* Error code, may be E2BIG */
return -E2BIG;
}
@@ -285,8 +285,7 @@ static int hdd_indicate_scan_result(hdd_scan_info_t *scanInfo,
&event, IW_EV_FREQ_LEN);
if (last_event == current_event) { /* no space to add event */
- hddLog(LOGE,
- "hdd_indicate_scan_result: no space for SIOCGIWFREQ");
+ hdd_err("no space for SIOCGIWFREQ");
return -E2BIG;
}
@@ -311,8 +310,7 @@ static int hdd_indicate_scan_result(hdd_scan_info_t *scanInfo,
&event, IW_EV_UINT_LEN);
if (last_event == current_event) { /* no space to add event */
- hddLog(LOGE,
- "hdd_indicate_scan_result: no space for SIOCGIWMODE");
+ hdd_err("no space for SIOCGIWMODE");
return -E2BIG;
}
/* To extract SSID */
@@ -353,8 +351,7 @@ static int hdd_indicate_scan_result(hdd_scan_info_t *scanInfo,
ssId);
if (last_event == current_event) { /* no space to add event */
- hddLog(LOGE,
- "hdd_indicate_scan_result: no space for SIOCGIWESSID");
+ hdd_err("no space for SIOCGIWESSID");
return -E2BIG;
}
}
@@ -362,8 +359,7 @@ static int hdd_indicate_scan_result(hdd_scan_info_t *scanInfo,
if (hdd_get_wparsn_ies
((uint8_t *) descriptor->ieFields, ie_length, &last_event,
&current_event, scanInfo) < 0) {
- hddLog(LOGE,
- "hdd_indicate_scan_result: no space for SIOCGIWESSID");
+ hdd_err("no space for SIOCGIWESSID");
return -E2BIG;
}
@@ -412,8 +408,7 @@ static int hdd_indicate_scan_result(hdd_scan_info_t *scanInfo,
if ((maxNumRates - numBasicRates) > MAX_RATES) {
no_of_rates = MAX_RATES;
- hddLog(LOGW,
- "Accessing array out of bound that array is pDot11ExtSuppRates->rates ");
+ hdd_warn("Accessing array out of bound that array is pDot11ExtSuppRates->rates ");
} else {
no_of_rates = maxNumRates - numBasicRates;
}
@@ -437,8 +432,7 @@ static int hdd_indicate_scan_result(hdd_scan_info_t *scanInfo,
current_event = current_pad;
} else {
if (last_event == current_event) { /* no space to add event */
- hddLog(LOGE,
- "hdd_indicate_scan_result: no space for SIOCGIWRATE");
+ hdd_err("no space for SIOCGIWRATE");
return -E2BIG;
}
}
@@ -460,8 +454,7 @@ static int hdd_indicate_scan_result(hdd_scan_info_t *scanInfo,
iwe_stream_add_point(scanInfo->info, current_event, end,
&event, (char *)pDot11SSID->ssid);
if (last_event == current_event) {
- hddLog(LOGE,
- "hdd_indicate_scan_result: no space for SIOCGIWENCODE");
+ hdd_err("no space for SIOCGIWENCODE");
return -E2BIG;
}
}
@@ -481,7 +474,7 @@ static int hdd_indicate_scan_result(hdd_scan_info_t *scanInfo,
end, &event, IW_EV_QUAL_LEN);
if (last_event == current_event) { /* no space to add event */
- hddLog(LOGE, "hdd_indicate_scan_result: no space for IWEVQUAL");
+ hdd_err("no space for IWEVQUAL");
return -E2BIG;
}
@@ -495,8 +488,7 @@ static int hdd_indicate_scan_result(hdd_scan_info_t *scanInfo,
current_event = iwe_stream_add_point(scanInfo->info, current_event, end,
&event, custom);
if (last_event == current_event) { /* no space to add event */
- hddLog(LOGE,
- "hdd_indicate_scan_result: no space for IWEVCUSTOM (age)");
+ hdd_err("no space for IWEVCUSTOM (age)");
return -E2BIG;
}
@@ -570,7 +562,7 @@ static int wlan_hdd_scan_request_enqueue(hdd_adapter_t *adapter,
ENTER();
hdd_scan_req = qdf_mem_malloc(sizeof(*hdd_scan_req));
if (NULL == hdd_scan_req) {
- hddLog(LOGP, FL("malloc failed for Scan req"));
+ hdd_alert("malloc failed for Scan req");
return -ENOMEM;
}
@@ -614,7 +606,7 @@ QDF_STATUS wlan_hdd_scan_request_dequeue(hdd_context_t *hdd_ctx,
hdd_info("Dequeue Scan id: %d", scan_id);
- if ((source == NULL) && (timestamp == NULL) && (req == NULL))
+ if ((source == NULL) || (timestamp == NULL) || (req == NULL))
return QDF_STATUS_E_NULL_VALUE;
qdf_spin_lock(&hdd_ctx->hdd_scan_req_q_lock);
@@ -691,10 +683,8 @@ hdd_scan_request_callback(tHalHandle halHandle, void *pContext,
uint32_t timestamp;
ENTER();
- hddLog(LOGW,
- "%s called with halHandle = %p, pContext = %p, scanID = %d,"
- " returned status = %d", __func__, halHandle, pContext,
- (int)scanId, (int)status);
+ hdd_warn("called with halHandle = %p, pContext = %p, scanID = %d, returned status = %d",
+ halHandle, pContext, (int)scanId, (int)status);
/* if there is a scan request pending when the wlan driver is unloaded
* we may be invoked as SME flushes its pending queue. If that is the
@@ -702,8 +692,7 @@ hdd_scan_request_callback(tHalHandle halHandle, void *pContext,
* do some quick sanity before proceeding
*/
if (pAdapter->dev != dev) {
- hddLog(LOGW, "%s: device mismatch %p vs %p",
- __func__, pAdapter->dev, dev);
+ hdd_warn("device mismatch %p vs %p", pAdapter->dev, dev);
return QDF_STATUS_SUCCESS;
}
@@ -767,7 +756,7 @@ static int __iw_set_scan(struct net_device *dev, struct iw_request_info *info,
con_dfs_ch = con_sap_adapter->sessionCtx.ap.operatingChannel;
if (CDS_IS_DFS_CH(con_dfs_ch)) {
- hddLog(LOGW, FL("##In DFS Master mode. Scan aborted"));
+ hdd_warn("##In DFS Master mode. Scan aborted");
return -EOPNOTSUPP;
}
}
@@ -804,10 +793,7 @@ static int __iw_set_scan(struct net_device *dev, struct iw_request_info *info,
scanReq->essid_len);
} else {
scanRequest.SSIDs.numOfSSIDs = 0;
- QDF_TRACE(QDF_MODULE_ID_HDD,
- QDF_TRACE_LEVEL_ERROR,
- "%s: Unable to allocate memory",
- __func__);
+ hdd_err("Unable to allocate memory");
QDF_ASSERT(0);
}
}
@@ -871,8 +857,7 @@ static int __iw_set_scan(struct net_device *dev, struct iw_request_info *info,
pAdapter->sessionId, &scanRequest,
&hdd_scan_request_callback, dev);
if (!QDF_IS_STATUS_SUCCESS(status)) {
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_FATAL,
- "%s:sme_scan_request fail %d!!!", __func__, status);
+ hdd_alert("sme_scan_request fail %d!!!", status);
goto error;
}
@@ -942,13 +927,11 @@ static int __iw_get_scan(struct net_device *dev,
if (0 != ret)
return ret;
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO,
- "%s: enter buffer length %d!!!", __func__,
+ hdd_notice("enter buffer length %d!!!",
(wrqu->data.length) ? wrqu->data.length : IW_SCAN_MAX_DATA);
if (true == pAdapter->scan_info.mScanPending) {
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_FATAL,
- "%s:mScanPending is true !!!", __func__);
+ hdd_alert("mScanPending is true !!!");
return -EAGAIN;
}
@@ -966,7 +949,7 @@ static int __iw_get_scan(struct net_device *dev,
if (NULL == pResult) {
/* no scan results */
- hddLog(LOG1, "iw_get_scan: NULL Scan Result ");
+ hdd_notice("iw_get_scan: NULL Scan Result ");
return 0;
}
@@ -983,8 +966,7 @@ static int __iw_get_scan(struct net_device *dev,
sme_scan_result_purge(hHal, pResult);
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO,
- "%s: exit total %d BSS reported !!!", __func__, i);
+ hdd_notice("exit total %d BSS reported !!!", i);
EXIT();
return status;
}
@@ -1145,9 +1127,8 @@ static QDF_STATUS hdd_cfg80211_scan_done_callback(tHalHandle halHandle,
if (0 != ret)
return QDF_STATUS_E_INVAL;
- hddLog(QDF_TRACE_LEVEL_INFO,
- "%s called with hal = %p, pContext = %p, ID = %d, status = %d",
- __func__, halHandle, pContext, (int)scanId, (int)status);
+ hdd_notice("called with hal = %p, pContext = %p, ID = %d, status = %d",
+ halHandle, pContext, (int)scanId, (int)status);
pScanInfo->mScanPendingCounter = 0;
@@ -1166,7 +1147,7 @@ static QDF_STATUS hdd_cfg80211_scan_done_callback(tHalHandle halHandle,
ret = wlan_hdd_cfg80211_update_bss((WLAN_HDD_GET_CTX(pAdapter))->wiphy,
pAdapter, scan_time);
if (0 > ret)
- hddLog(QDF_TRACE_LEVEL_INFO, "%s: NO SCAN result", __func__);
+ hdd_notice("NO SCAN result");
/*
* cfg80211_scan_done informing NL80211 about completion
@@ -1236,8 +1217,7 @@ static void wlan_hdd_cfg80211_scan_block_cb(struct work_struct *work)
hdd_adapter_t, scan_block_work);
struct cfg80211_scan_request *request;
if (WLAN_HDD_ADAPTER_MAGIC != adapter->magic) {
- hddLog(LOGE,
- "%s: HDD adapter context is invalid", __func__);
+ hdd_err("HDD adapter context is invalid");
return;
}
@@ -1246,8 +1226,7 @@ static void wlan_hdd_cfg80211_scan_block_cb(struct work_struct *work)
request->n_ssids = 0;
request->n_channels = 0;
- hddLog(LOGE,
- FL("##In DFS Master mode. Scan aborted. Null result sent"));
+ hdd_err("##In DFS Master mode. Scan aborted. Null result sent");
cfg80211_scan_done(request, true);
adapter->request = NULL;
}
@@ -1285,7 +1264,7 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
ENTER();
if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
- hddLog(LOGE, FL("Command not allowed in FTM mode"));
+ hdd_err("Command not allowed in FTM mode");
return -EINVAL;
}
@@ -1296,7 +1275,7 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
if (!sme_is_session_id_valid(pHddCtx->hHal, pAdapter->sessionId))
return -EINVAL;
- hddLog(LOG1, FL("Device_mode %s(%d)"),
+ hdd_notice("Device_mode %s(%d)",
hdd_device_mode_to_string(pAdapter->device_mode),
pAdapter->device_mode);
@@ -1341,7 +1320,7 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
if (true == pScanInfo->mScanPending) {
if (MAX_PENDING_LOG >
pScanInfo->mScanPendingCounter++) {
- hddLog(LOGE, FL("mScanPending is true"));
+ hdd_err("mScanPending is true");
}
return -EBUSY;
}
@@ -1352,7 +1331,7 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
* If no action frame pending
*/
if (0 != wlan_hdd_check_remain_on_channel(pAdapter)) {
- hddLog(LOGE, FL("Remain On Channel Pending"));
+ hdd_err("Remain On Channel Pending");
return -EBUSY;
}
}
@@ -1367,11 +1346,10 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
request);
if (status <= 0) {
if (!status)
- hddLog(LOGE,
- FL("TDLS in progress.scan rejected %d"),
+ hdd_err("TDLS in progress.scan rejected %d",
status);
else
- hddLog(LOGE, FL("TDLS teardown is ongoing %d"),
+ hdd_err("TDLS teardown is ongoing %d",
status);
hdd_wlan_block_scan_by_tdls_event();
return status;
@@ -1380,7 +1358,7 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
/* Check if scan is allowed at this point of time */
if (cds_is_connection_in_progress()) {
- hddLog(LOGE, FL("Scan not allowed"));
+ hdd_err("Scan not allowed");
return -EBUSY;
}
@@ -1406,7 +1384,7 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
qdf_mem_malloc(request->n_ssids * sizeof(tCsrSSIDInfo));
if (NULL == scan_req.SSIDs.SSIDList) {
- hddLog(LOGE, FL("memory alloc failed SSIDInfo buffer"));
+ hdd_err("memory alloc failed SSIDInfo buffer");
return -ENOMEM;
}
@@ -1418,7 +1396,7 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
&request->ssids[j].ssid[0],
SsidInfo->SSID.length);
SsidInfo->SSID.ssId[SsidInfo->SSID.length] = '\0';
- hddLog(LOG1, FL("SSID number %d: %s"), j,
+ hdd_notice("SSID number %d: %s", j,
SsidInfo->SSID.ssId);
}
/* set the scan type to active */
@@ -1443,20 +1421,19 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
scan_req.BSSType = eCSR_BSS_TYPE_ANY;
if (MAX_CHANNEL < request->n_channels) {
- hddLog(LOGW, FL("No of Scan Channels exceeded limit: %d"),
+ hdd_warn("No of Scan Channels exceeded limit: %d",
request->n_channels);
request->n_channels = MAX_CHANNEL;
}
- hddLog(LOG1, FL("No of Scan Channels: %d"), request->n_channels);
+ hdd_notice("No of Scan Channels: %d", request->n_channels);
if (request->n_channels) {
char chList[(request->n_channels * 5) + 1];
int len;
channelList = qdf_mem_malloc(request->n_channels);
if (NULL == channelList) {
- hddLog(LOGE,
- FL("channelList malloc failed channelList"));
+ hdd_err("channelList malloc failed channelList");
status = -ENOMEM;
goto free_mem;
}
@@ -1465,7 +1442,7 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
len += snprintf(chList + len, 5, "%d ", channelList[i]);
}
- hddLog(LOG1, FL("Channel-List: %s"), chList);
+ hdd_notice("Channel-List: %s", chList);
}
scan_req.ChannelInfo.numOfChannels = request->n_channels;
@@ -1487,7 +1464,7 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
*/
if (request->n_channels != WLAN_HDD_P2P_SINGLE_CHANNEL_SCAN) {
- hddLog(QDF_TRACE_LEVEL_DEBUG, "Flushing P2P Results");
+ hdd_debug("Flushing P2P Results");
sme_scan_flush_p2p_result(WLAN_HDD_GET_HAL_CTX(pAdapter),
pAdapter->sessionId);
}
@@ -1522,10 +1499,8 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
&& (QDF_P2P_CLIENT_MODE == pAdapter->device_mode)) {
global_p2p_connection_status =
P2P_CLIENT_CONNECTING_STATE_1;
- hddLog(LOGE,
- FL("[P2P State] Changing state from Go nego completed to Connection is started"));
- hddLog(LOGE,
- FL("[P2P]P2P Scanning is started for 8way Handshake"));
+ hdd_err("[P2P State] Changing state from Go nego completed to Connection is started");
+ hdd_err("[P2P]P2P Scanning is started for 8way Handshake");
} else
if ((global_p2p_connection_status ==
P2P_CLIENT_DISCONNECTED_STATE)
@@ -1533,17 +1508,14 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
pAdapter->device_mode)) {
global_p2p_connection_status =
P2P_CLIENT_CONNECTING_STATE_2;
- hddLog(LOGE,
- FL("[P2P State] Changing state from Disconnected state to Connection is started"));
- hddLog(LOGE,
- FL("[P2P]P2P Scanning is started for 4way Handshake"));
+ hdd_err("[P2P State] Changing state from Disconnected state to Connection is started");
+ hdd_err("[P2P]P2P Scanning is started for 4way Handshake");
}
#endif
/* no_cck will be set during p2p find to disable 11b rates */
if (request->no_cck) {
- hddLog(QDF_TRACE_LEVEL_INFO,
- "%s: This is a P2P Search", __func__);
+ hdd_notice("This is a P2P Search");
scan_req.p2pSearch = 1;
if (request->n_channels ==
@@ -1578,8 +1550,7 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
hdd_prevent_suspend_timeout(HDD_WAKE_LOCK_SCAN_DURATION,
WIFI_POWER_EVENT_WAKELOCK_SCAN);
- hddLog(LOG2,
- FL("requestType %d, scanType %d, minChnTime %d, maxChnTime %d,p2pSearch %d, skipDfsChnlIn P2pSearch %d"),
+ hdd_info("requestType %d, scanType %d, minChnTime %d, maxChnTime %d,p2pSearch %d, skipDfsChnlIn P2pSearch %d",
scan_req.requestType, scan_req.scanType,
scan_req.minChnTime, scan_req.maxChnTime,
scan_req.p2pSearch, scan_req.skipDfsChnlInP2pSearch);
@@ -1592,10 +1563,9 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
&hdd_cfg80211_scan_done_callback, dev);
if (QDF_STATUS_SUCCESS != status) {
- hddLog(LOGE, FL("sme_scan_request returned error %d"), status);
+ hdd_err("sme_scan_request returned error %d", status);
if (QDF_STATUS_E_RESOURCES == status) {
- hddLog(LOGE,
- FL("HO is in progress.So defer the scan by informing busy"));
+ hdd_err("HO is in progress.So defer the scan by informing busy");
status = -EBUSY;
} else {
status = -EIO;
@@ -1691,12 +1661,12 @@ static int wlan_hdd_send_scan_start_event(struct wiphy *wiphy,
skb = cfg80211_vendor_cmd_alloc_reply_skb(wiphy, sizeof(u64) +
NLA_HDRLEN + NLMSG_HDRLEN);
if (!skb) {
- hddLog(LOGE, FL(" reply skb alloc failed"));
+ hdd_err(" reply skb alloc failed");
return -ENOMEM;
}
if (nla_put_u64(skb, QCA_WLAN_VENDOR_ATTR_SCAN_COOKIE, cookie)) {
- hddLog(LOGE, FL("nla put fail"));
+ hdd_err("nla put fail");
kfree_skb(skb);
return -EINVAL;
}
@@ -1708,7 +1678,7 @@ static int wlan_hdd_send_scan_start_event(struct wiphy *wiphy,
sizeof(u64) + 4 + NLMSG_HDRLEN,
QCA_NL80211_VENDOR_SUBCMD_SCAN_INDEX, GFP_KERNEL);
if (!skb) {
- hddLog(LOGE, FL("skb alloc failed"));
+ hdd_err("skb alloc failed");
return -ENOMEM;
}
@@ -1877,7 +1847,7 @@ static int __wlan_hdd_cfg80211_vendor_scan(struct wiphy *wiphy,
nla_get_u32(tb[QCA_WLAN_VENDOR_ATTR_SCAN_FLAGS]);
if ((request->flags & NL80211_SCAN_FLAG_LOW_PRIORITY) &&
!(wiphy->features & NL80211_FEATURE_LOW_PRIORITY_SCAN)) {
- hddLog(LOGE, FL("LOW PRIORITY SCAN not supported"));
+ hdd_err("LOW PRIORITY SCAN not supported");
goto error;
}
}
@@ -1947,8 +1917,7 @@ int wlan_hdd_scan_abort(hdd_adapter_t *pAdapter)
&pScanInfo->abortscan_event_var,
msecs_to_jiffies(5000));
if (!rc) {
- hddLog(LOGE,
- FL("Timeout occurred while waiting for abort scan"));
+ hdd_err("Timeout occurred while waiting for abort scan");
return -ETIME;
}
}
@@ -1977,13 +1946,13 @@ hdd_sched_scan_callback(void *callbackContext,
ENTER();
if (NULL == pAdapter) {
- hddLog(LOGE, FL("HDD adapter is Null"));
+ hdd_err("HDD adapter is Null");
return;
}
pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
if (NULL == pHddCtx) {
- hddLog(LOGE, FL("HDD context is Null!!!"));
+ hdd_err("HDD context is Null!!!");
return;
}
@@ -1991,8 +1960,7 @@ hdd_sched_scan_callback(void *callbackContext,
if (true == pHddCtx->isWiphySuspended) {
pHddCtx->isSchedScanUpdatePending = true;
qdf_spin_unlock(&pHddCtx->sched_scan_lock);
- hddLog(LOG1,
- FL("Update cfg80211 scan database after it resume"));
+ hdd_notice("Update cfg80211 scan database after it resume");
return;
}
qdf_spin_unlock(&pHddCtx->sched_scan_lock);
@@ -2000,11 +1968,10 @@ hdd_sched_scan_callback(void *callbackContext,
ret = wlan_hdd_cfg80211_update_bss(pHddCtx->wiphy, pAdapter, 0);
if (0 > ret)
- hddLog(LOG1, FL("NO SCAN result"));
+ hdd_notice("NO SCAN result");
cfg80211_sched_scan_results(pHddCtx->wiphy);
- hddLog(LOG1,
- FL("cfg80211 scan result database updated"));
+ hdd_notice("cfg80211 scan result database updated");
}
/**
@@ -2019,8 +1986,7 @@ hdd_sched_scan_callback(void *callbackContext,
*/
static QDF_STATUS wlan_hdd_is_pno_allowed(hdd_adapter_t *adapter)
{
- hddLog(LOG1,
- FL("dev_mode=%d, conn_state=%d, session ID=%d"),
+ hdd_notice("dev_mode=%d, conn_state=%d, session ID=%d",
adapter->device_mode,
adapter->sessionCtx.station.conn_info.connState,
adapter->sessionId);
@@ -2064,7 +2030,7 @@ static int __wlan_hdd_cfg80211_sched_scan_start(struct wiphy *wiphy,
ENTER();
if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
- hddLog(LOGE, FL("Command not allowed in FTM mode"));
+ hdd_err("Command not allowed in FTM mode");
return -EINVAL;
}
@@ -2077,15 +2043,14 @@ static int __wlan_hdd_cfg80211_sched_scan_start(struct wiphy *wiphy,
config = pHddCtx->config;
hHal = WLAN_HDD_GET_HAL_CTX(pAdapter);
if (NULL == hHal) {
- hddLog(LOGE, FL("HAL context is Null!!!"));
+ hdd_err("HAL context is Null!!!");
return -EINVAL;
}
if ((QDF_STA_MODE == pAdapter->device_mode) &&
(eConnectionState_Connecting ==
(WLAN_HDD_GET_STATION_CTX_PTR(pAdapter))->conn_info.connState)) {
- hddLog(LOGE,
- FL("%p(%d) Connection in progress: sched_scan_start denied (EBUSY)"),
+ hdd_err("%p(%d) Connection in progress: sched_scan_start denied (EBUSY)",
WLAN_HDD_GET_STATION_CTX_PTR(pAdapter),
pAdapter->sessionId);
return -EBUSY;
@@ -2105,20 +2070,19 @@ static int __wlan_hdd_cfg80211_sched_scan_start(struct wiphy *wiphy,
if (true == pScanInfo->mScanPending) {
ret = wlan_hdd_scan_abort(pAdapter);
if (ret < 0) {
- hddLog(LOGE,
- FL("aborting the existing scan is unsuccessful"));
+ hdd_err("aborting the existing scan is unsuccessful");
return -EBUSY;
}
}
if (QDF_STATUS_E_FAILURE == wlan_hdd_is_pno_allowed(pAdapter)) {
- hddLog(LOGE, FL("pno is not allowed"));
+ hdd_err("pno is not allowed");
return -ENOTSUPP;
}
pPnoRequest = (tpSirPNOScanReq) qdf_mem_malloc(sizeof(tSirPNOScanReq));
if (NULL == pPnoRequest) {
- hddLog(LOGE, FL("qdf_mem_malloc failed"));
+ hdd_err("qdf_mem_malloc failed");
return -ENOMEM;
}
@@ -2128,14 +2092,14 @@ static int __wlan_hdd_cfg80211_sched_scan_start(struct wiphy *wiphy,
if ((!pPnoRequest->ucNetworksCount) ||
(pPnoRequest->ucNetworksCount > SIR_PNO_MAX_SUPP_NETWORKS)) {
- hddLog(LOGE, FL("Network input is not correct %d"),
+ hdd_err("Network input is not correct %d",
pPnoRequest->ucNetworksCount);
ret = -EINVAL;
goto error;
}
if (SIR_PNO_MAX_NETW_CHANNELS_EX < request->n_channels) {
- hddLog(LOGE, FL("Incorrect number of channels %d"),
+ hdd_err("Incorrect number of channels %d",
request->n_channels);
ret = -EINVAL;
goto error;
@@ -2145,8 +2109,7 @@ static int __wlan_hdd_cfg80211_sched_scan_start(struct wiphy *wiphy,
* common for all saved profile */
if (0 != sme_cfg_get_str(hHal, WNI_CFG_VALID_CHANNEL_LIST,
channels_allowed, &num_channels_allowed)) {
- hddLog(LOGE,
- FL("failed to get valid channel list"));
+ hdd_err("failed to get valid channel list");
ret = -EINVAL;
goto error;
}
@@ -2164,11 +2127,8 @@ static int __wlan_hdd_cfg80211_sched_scan_start(struct wiphy *wiphy,
&& (CHANNEL_STATE_DFS ==
cds_get_channel_state(
channels_allowed[indx]))) {
- QDF_TRACE(QDF_MODULE_ID_HDD,
- QDF_TRACE_LEVEL_INFO,
- "%s : Dropping DFS channel : %d",
- __func__,
- channels_allowed[indx]);
+ hdd_notice("Dropping DFS channel : %d",
+ channels_allowed[indx]);
num_ignore_dfs_ch++;
break;
}
@@ -2183,15 +2143,13 @@ static int __wlan_hdd_cfg80211_sched_scan_start(struct wiphy *wiphy,
}
}
}
- hddLog(LOG1, FL("Channel-List: %s "), chList);
+ hdd_notice("Channel-List: %s ", chList);
/* If all channels are DFS and dropped,
* then ignore the PNO request
*/
if (num_ignore_dfs_ch == request->n_channels) {
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO,
- "%s : All requested channels are DFS channels",
- __func__);
+ hdd_notice("All requested channels are DFS channels");
ret = -EINVAL;
goto error;
}
@@ -2204,8 +2162,7 @@ static int __wlan_hdd_cfg80211_sched_scan_start(struct wiphy *wiphy,
if ((0 == pPnoRequest->aNetworks[i].ssId.length) ||
(pPnoRequest->aNetworks[i].ssId.length > 32)) {
- hddLog(LOGE,
- FL(" SSID Len %d is not correct for network %d"),
+ hdd_err(" SSID Len %d is not correct for network %d",
pPnoRequest->aNetworks[i].ssId.length, i);
ret = -EINVAL;
goto error;
@@ -2241,7 +2198,7 @@ static int __wlan_hdd_cfg80211_sched_scan_start(struct wiphy *wiphy,
j++;
}
}
- hddLog(LOG1, FL("Number of hidden networks being Configured = %d"),
+ hdd_notice("Number of hidden networks being Configured = %d",
request->n_ssids);
/*
@@ -2298,12 +2255,12 @@ static int __wlan_hdd_cfg80211_sched_scan_start(struct wiphy *wiphy,
hdd_sched_scan_callback,
pAdapter);
if (QDF_STATUS_SUCCESS != status) {
- hddLog(LOGE, FL("Failed to enable PNO"));
+ hdd_err("Failed to enable PNO");
ret = -EINVAL;
goto error;
}
- hddLog(LOG1, FL("PNO scanRequest offloaded"));
+ hdd_notice("PNO scanRequest offloaded");
error:
qdf_mem_free(pPnoRequest);
@@ -2353,14 +2310,14 @@ static int __wlan_hdd_cfg80211_sched_scan_stop(struct wiphy *wiphy,
ENTER();
if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
- hddLog(LOGE, FL("Command not allowed in FTM mode"));
+ hdd_err("Command not allowed in FTM mode");
return -EINVAL;
}
pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
if (NULL == pHddCtx) {
- hddLog(LOGE, FL("HDD context is Null"));
+ hdd_err("HDD context is Null");
return -ENODEV;
}
@@ -2387,13 +2344,13 @@ static int __wlan_hdd_cfg80211_sched_scan_stop(struct wiphy *wiphy,
hHal = WLAN_HDD_GET_HAL_CTX(pAdapter);
if (NULL == hHal) {
- hddLog(LOGE, FL(" HAL context is Null!!!"));
+ hdd_err(" HAL context is Null!!!");
return -EINVAL;
}
pPnoRequest = (tpSirPNOScanReq) qdf_mem_malloc(sizeof(tSirPNOScanReq));
if (NULL == pPnoRequest) {
- hddLog(LOGE, FL("qdf_mem_malloc failed"));
+ hdd_err("qdf_mem_malloc failed");
return -ENOMEM;
}
@@ -2408,11 +2365,11 @@ static int __wlan_hdd_cfg80211_sched_scan_stop(struct wiphy *wiphy,
pAdapter->sessionId,
NULL, pAdapter);
if (QDF_STATUS_SUCCESS != status) {
- hddLog(LOGE, FL("Failed to disabled PNO"));
+ hdd_err("Failed to disabled PNO");
ret = -EINVAL;
}
- hddLog(LOG1, FL("PNO scan disabled"));
+ hdd_notice("PNO scan disabled");
qdf_mem_free(pPnoRequest);
diff --git a/core/hdd/src/wlan_hdd_softap_tx_rx.c b/core/hdd/src/wlan_hdd_softap_tx_rx.c
index a0dbea356d3b..be1edf2fac2f 100644
--- a/core/hdd/src/wlan_hdd_softap_tx_rx.c
+++ b/core/hdd/src/wlan_hdd_softap_tx_rx.c
@@ -317,15 +317,6 @@ int hdd_softap_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
skb = skb_unshare(skb, GFP_ATOMIC);
if (!skb)
goto drop_pkt_accounting;
-
- if (skb_headroom(skb) < dev->hard_header_len) {
- struct sk_buff *tmp;
- tmp = skb;
- skb = skb_realloc_headroom(tmp, dev->hard_header_len);
- dev_kfree_skb(tmp);
- if (!skb)
- goto drop_pkt_accounting;
- }
#if defined (IPA_OFFLOAD)
}
#endif
diff --git a/core/hdd/src/wlan_hdd_stats.c b/core/hdd/src/wlan_hdd_stats.c
index 89c0791bc64d..52643ccb58ba 100644
--- a/core/hdd/src/wlan_hdd_stats.c
+++ b/core/hdd/src/wlan_hdd_stats.c
@@ -30,6 +30,8 @@
#include "sme_api.h"
#include "cds_sched.h"
#include "wlan_hdd_trace.h"
+#include "wlan_hdd_lpass.h"
+#include "hif.h"
#ifdef WLAN_FEATURE_LINK_LAYER_STATS
@@ -2320,3 +2322,32 @@ inline void hdd_init_ll_stats_ctx(void)
return;
}
+
+/**
+ * hdd_display_hif_stats() - display hif stats
+ *
+ * Return: none
+ *
+ */
+void hdd_display_hif_stats(void)
+{
+ void *hif_ctx = cds_get_context(QDF_MODULE_ID_HIF);
+
+ if (!hif_ctx)
+ return;
+ hif_display_stats(hif_ctx);
+}
+
+/**
+ * hdd_clear_hif_stats() - clear hif stats
+ *
+ * Return: none
+ */
+void hdd_clear_hif_stats(void)
+{
+ void *hif_ctx = cds_get_context(QDF_MODULE_ID_HIF);
+
+ if (!hif_ctx)
+ return;
+ hif_clear_stats(hif_ctx);
+}
diff --git a/core/hdd/src/wlan_hdd_stats.h b/core/hdd/src/wlan_hdd_stats.h
index 38e48f2b4e03..8055f15e56e5 100644
--- a/core/hdd/src/wlan_hdd_stats.h
+++ b/core/hdd/src/wlan_hdd_stats.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -203,5 +203,9 @@ struct net_device_stats *hdd_get_stats(struct net_device *dev);
int wlan_hdd_cfg80211_dump_survey(struct wiphy *wiphy,
struct net_device *dev,
int idx, struct survey_info *survey);
+
+void hdd_display_hif_stats(void);
+void hdd_clear_hif_stats(void);
+
#endif /* end #if !defined(WLAN_HDD_STATS_H) */
diff --git a/core/hdd/src/wlan_hdd_tdls.c b/core/hdd/src/wlan_hdd_tdls.c
index e1bb1e3dd9a1..299b9e4f4666 100644
--- a/core/hdd/src/wlan_hdd_tdls.c
+++ b/core/hdd/src/wlan_hdd_tdls.c
@@ -32,6 +32,7 @@
*/
#include <wlan_hdd_includes.h>
+#include <ani_global.h>
#include <wlan_hdd_hostapd.h>
#include <wlan_hdd_trace.h>
#include <net/cfg80211.h>
@@ -743,6 +744,8 @@ int wlan_hdd_tdls_init(hdd_adapter_t *pAdapter)
/* initialize TDLS global context */
pHddCtx->connected_peer_count = 0;
+ pHddCtx->tdls_nss_switch_in_progress = false;
+ pHddCtx->tdls_teardown_peers_cnt = 0;
sme_set_tdls_power_save_prohibited(WLAN_HDD_GET_HAL_CTX(pAdapter),
pAdapter->sessionId, 0);
@@ -3772,6 +3775,16 @@ int wlan_hdd_tdls_add_station(struct wiphy *wiphy,
INIT_COMPLETION(pAdapter->tdls_add_station_comp);
+ /* Update the number of stream for each peer */
+ if ((NULL != StaParams) && (StaParams->htcap_present)) {
+ hddTdlsPeer_t *tdls_peer;
+
+ tdls_peer = wlan_hdd_tdls_find_peer(pAdapter, mac, true);
+ if (NULL != tdls_peer)
+ tdls_peer->spatial_streams =
+ StaParams->HTCap.suppMcsSet[1];
+ }
+
if (!update) {
status = sme_add_tdls_peer_sta(WLAN_HDD_GET_HAL_CTX(pAdapter),
pAdapter->sessionId, mac);
@@ -3942,6 +3955,10 @@ static int __wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy,
" TDLS mode is disabled. action %d declined.",
__func__, MAC_ADDR_ARRAY(peer), action_code);
return -ENOTSUPP;
+ } else if (pHddCtx->tdls_nss_switch_in_progress) {
+ hdd_err("TDLS antenna switch in progress, action %d declined for "
+ MAC_ADDRESS_STR, action_code, MAC_ADDR_ARRAY(peer));
+ return -EAGAIN;
}
}
@@ -4068,6 +4085,17 @@ static int __wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy,
return -EINVAL;
}
+ if (SIR_MAC_TDLS_TEARDOWN == action_code &&
+ pHddCtx->tdls_nss_switch_in_progress) {
+ mutex_lock(&pHddCtx->tdls_lock);
+ if (pHddCtx->tdls_teardown_peers_cnt != 0)
+ pHddCtx->tdls_teardown_peers_cnt--;
+ if (pHddCtx->tdls_teardown_peers_cnt == 0)
+ pHddCtx->tdls_nss_switch_in_progress = false;
+ mutex_unlock(&pHddCtx->tdls_lock);
+ }
+
+
if ((SIR_MAC_TDLS_DIS_REQ == action_code) ||
(SIR_MAC_TDLS_DIS_RSP == action_code)) {
/* for DIS_REQ/DIS_RSP, supplicant does not consider the return
@@ -5744,3 +5772,129 @@ int hdd_set_tdls_scan_type(hdd_context_t *hdd_ctx, int val)
return 0;
}
}
+
+/**
+ * wlan_hdd_tdls_teardown_links() - teardown tdls links
+ * @hddCtx : pointer to hdd context
+ *
+ * Return: 0 if success else non zero
+ */
+static int wlan_hdd_tdls_teardown_links(hdd_context_t *hddctx,
+ uint32_t mode)
+{
+ uint16_t connected_tdls_peers = 0;
+ uint8_t staidx;
+ hddTdlsPeer_t *curr_peer;
+ hdd_adapter_t *adapter;
+ int ret = 0;
+
+ if (eTDLS_SUPPORT_NOT_ENABLED == hddctx->tdls_mode) {
+ hdd_info("TDLS mode is disabled OR not enabled in FW");
+ return 0;
+ }
+
+ adapter = hdd_get_adapter(hddctx, QDF_STA_MODE);
+
+ if (adapter == NULL) {
+ hdd_info("Station Adapter Not Found");
+ return 0;
+ }
+
+ connected_tdls_peers = wlan_hdd_tdls_connected_peers(adapter);
+
+ if (!connected_tdls_peers)
+ return 0;
+
+ for (staidx = 0; staidx < hddctx->max_num_tdls_sta;
+ staidx++) {
+ if (!hddctx->tdlsConnInfo[staidx].staId)
+ continue;
+
+ curr_peer = wlan_hdd_tdls_find_all_peer(hddctx,
+ hddctx->tdlsConnInfo[staidx].peerMac.bytes);
+
+ if (!curr_peer)
+ continue;
+
+ /* Check if connected peer supports more than one stream */
+ if (curr_peer->spatial_streams == TDLS_NSS_1x1_MODE)
+ continue;
+
+ hdd_info("Indicate TDLS teardown (staId %d)",
+ curr_peer->staId);
+
+ wlan_hdd_tdls_indicate_teardown(
+ curr_peer->pHddTdlsCtx->pAdapter,
+ curr_peer,
+ eSIR_MAC_TDLS_TEARDOWN_UNSPEC_REASON);
+ mutex_lock(&hddctx->tdls_lock);
+ hddctx->tdls_teardown_peers_cnt++;
+ mutex_unlock(&hddctx->tdls_lock);
+ }
+ mutex_lock(&hddctx->tdls_lock);
+ if (hddctx->tdls_teardown_peers_cnt >= 1) {
+ hddctx->tdls_nss_switch_in_progress = true;
+ hdd_info("TDLS peers to be torn down = %d",
+ hddctx->tdls_teardown_peers_cnt);
+ /* Antenna switch 2x2 to 1x1 */
+ if (mode == HDD_ANTENNA_MODE_1X1)
+ ret = -EAGAIN;
+ else
+ /* Antenna switch 1x1 to 2x2 */
+ ret = 0;
+ hdd_info("TDLS teardown for antenna switch operation starts");
+ }
+ mutex_unlock(&hddctx->tdls_lock);
+ return ret;
+}
+
+/**
+ * wlan_hdd_tdls_antenna_switch() - Dynamic TDLS antenna switch 1x1 <-> 2x2
+ * antenna mode in standalone station
+ * @hdd_ctx: Pointer to hdd contex
+ * @adapter: Pointer to hdd adapter
+ *
+ * Return: 0 if success else non zero
+ */
+int wlan_hdd_tdls_antenna_switch(hdd_context_t *hdd_ctx,
+ hdd_adapter_t *adapter, uint32_t mode)
+{
+ uint8_t tdls_peer_cnt;
+ uint32_t vdev_nss;
+ hdd_station_ctx_t *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) {
+ hdd_err("TDLS antenna switch is in progress");
+ return -EAGAIN;
+ }
+
+ /* Check whether TDLS is connected or not */
+ mutex_lock(&hdd_ctx->tdls_lock);
+ tdls_peer_cnt = hdd_ctx->connected_peer_count;
+ mutex_unlock(&hdd_ctx->tdls_lock);
+ if (tdls_peer_cnt <= 0) {
+ hdd_info("No TDLS connection established");
+ goto tdls_ant_sw_done;
+ }
+
+ /* Check the supported nss for TDLS */
+ if (IS_5G_CH(sta_ctx->conn_info.operationChannel))
+ vdev_nss = CFG_TDLS_NSS(
+ hdd_ctx->config->vdev_type_nss_5g);
+ else
+ vdev_nss = CFG_TDLS_NSS(
+ hdd_ctx->config->vdev_type_nss_2g);
+
+ if (vdev_nss == HDD_ANTENNA_MODE_1X1) {
+ hdd_info("Supported NSS is 1X1, no need to teardown TDLS links");
+ goto tdls_ant_sw_done;
+ }
+
+ /* teardown all the tdls connections */
+ return wlan_hdd_tdls_teardown_links(hdd_ctx, mode);
+
+tdls_ant_sw_done:
+ return 0;
+}
diff --git a/core/hdd/src/wlan_hdd_tx_rx.c b/core/hdd/src/wlan_hdd_tx_rx.c
index d8649a29b630..7ff10a37da92 100644
--- a/core/hdd/src/wlan_hdd_tx_rx.c
+++ b/core/hdd/src/wlan_hdd_tx_rx.c
@@ -57,6 +57,8 @@
#include "cdp_txrx_peer_ops.h"
#include "ol_txrx.h"
+#include "wlan_hdd_nan_datapath.h"
+
const uint8_t hdd_wmm_ac_to_highest_up[] = {
SME_QOS_WMM_UP_RESV,
SME_QOS_WMM_UP_EE,
@@ -331,10 +333,7 @@ int hdd_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
if (cds_is_driver_recovering()) {
QDF_TRACE(QDF_MODULE_ID_HDD_DATA, QDF_TRACE_LEVEL_WARN,
"Recovery in progress, dropping the packet");
- ++pAdapter->stats.tx_dropped;
- ++pAdapter->hdd_stats.hddTxRxStats.txXmitDropped;
- kfree_skb(skb);
- return NETDEV_TX_OK;
+ goto drop_pkt;
}
if (QDF_IBSS_MODE == pAdapter->device_mode) {
@@ -342,8 +341,8 @@ int hdd_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
(struct qdf_mac_addr *) skb->data;
if (QDF_STATUS_SUCCESS !=
- hdd_ibss_get_sta_id(&pAdapter->sessionCtx.station,
- pDestMacAddress, &STAId))
+ hdd_get_peer_sta_id(&pAdapter->sessionCtx.station,
+ pDestMacAddress, &STAId))
STAId = HDD_WLAN_INVALID_STA_ID;
if ((STAId == HDD_WLAN_INVALID_STA_ID) &&
@@ -357,6 +356,17 @@ int hdd_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
QDF_TRACE(QDF_MODULE_ID_HDD_DATA, QDF_TRACE_LEVEL_WARN,
"%s: Received Unicast frame with invalid staID",
__func__);
+ goto drop_pkt;
+ }
+ } else if (QDF_NDI_MODE == pAdapter->device_mode) {
+ struct qdf_mac_addr *dest_mac_addr =
+ (struct qdf_mac_addr *)skb->data;
+ if (hdd_get_peer_sta_id(&pAdapter->sessionCtx.station,
+ dest_mac_addr, &STAId) !=
+ QDF_STATUS_SUCCESS) {
+ QDF_TRACE(QDF_MODULE_ID_HDD_DATA, QDF_TRACE_LEVEL_WARN,
+ FL("Can't find peer: %pM, dropping packet"),
+ dest_mac_addr);
++pAdapter->stats.tx_dropped;
++pAdapter->hdd_stats.hddTxRxStats.txXmitDropped;
kfree_skb(skb);
@@ -369,10 +379,7 @@ int hdd_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
QDF_TRACE(QDF_MODULE_ID_HDD_DATA, QDF_TRACE_LEVEL_INFO,
FL("Tx frame in not associated state in %d context"),
pAdapter->device_mode);
- ++pAdapter->stats.tx_dropped;
- ++pAdapter->hdd_stats.hddTxRxStats.txXmitDropped;
- kfree_skb(skb);
- return NETDEV_TX_OK;
+ goto drop_pkt;
}
STAId = pHddStaCtx->conn_info.staId[0];
}
@@ -388,16 +395,7 @@ int hdd_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
/* Check if the buffer has enough header room */
skb = skb_unshare(skb, GFP_ATOMIC);
if (!skb)
- goto drop_pkt;
-
- if (skb_headroom(skb) < dev->hard_header_len) {
- struct sk_buff *tmp;
- tmp = skb;
- skb = skb_realloc_headroom(tmp, dev->hard_header_len);
- dev_kfree_skb(tmp);
- if (!skb)
- goto drop_pkt;
- }
+ goto drop_pkt_accounting;
}
/* user priority from IP header, which is already extracted and set from
@@ -515,7 +513,8 @@ int hdd_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
QDF_TRACE_LEVEL_WARN,
"%s: station is not connected..dropping pkt",
__func__);
- goto drop_pkt;
+ ++pAdapter->hdd_stats.hddTxRxStats.txXmitDroppedAC[ac];
+ goto drop_pkt;
}
/*
@@ -525,6 +524,7 @@ int hdd_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
QDF_TRACE(QDF_MODULE_ID_HDD_SAP_DATA, QDF_TRACE_LEVEL_INFO_HIGH,
"%s: TX function not registered by the data path",
__func__);
+ ++pAdapter->hdd_stats.hddTxRxStats.txXmitDroppedAC[ac];
goto drop_pkt;
}
@@ -533,6 +533,7 @@ int hdd_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
QDF_TRACE(QDF_MODULE_ID_HDD_DATA, QDF_TRACE_LEVEL_WARN,
"%s: Failed to send packet to txrx for staid:%d",
__func__, STAId);
+ ++pAdapter->hdd_stats.hddTxRxStats.txXmitDroppedAC[ac];
goto drop_pkt;
}
dev->trans_start = jiffies;
@@ -541,22 +542,29 @@ int hdd_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
drop_pkt:
- DPTRACE(qdf_dp_trace(skb, QDF_DP_TRACE_DROP_PACKET_RECORD,
- (uint8_t *)skb->data, qdf_nbuf_len(skb), QDF_TX));
- if (qdf_nbuf_len(skb) > QDF_DP_TRACE_RECORD_SIZE)
+ if (skb) {
DPTRACE(qdf_dp_trace(skb, QDF_DP_TRACE_DROP_PACKET_RECORD,
- (uint8_t *)&skb->data[QDF_DP_TRACE_RECORD_SIZE],
- (qdf_nbuf_len(skb)-QDF_DP_TRACE_RECORD_SIZE), QDF_TX));
+ (uint8_t *)skb->data, qdf_nbuf_len(skb), QDF_TX));
+ if (qdf_nbuf_len(skb) > QDF_DP_TRACE_RECORD_SIZE)
+ DPTRACE(qdf_dp_trace(skb,
+ QDF_DP_TRACE_DROP_PACKET_RECORD,
+ (uint8_t *)&skb->data[QDF_DP_TRACE_RECORD_SIZE],
+ (qdf_nbuf_len(skb)-QDF_DP_TRACE_RECORD_SIZE),
+ QDF_TX));
+
+ kfree_skb(skb);
+ }
+
+drop_pkt_accounting:
++pAdapter->stats.tx_dropped;
++pAdapter->hdd_stats.hddTxRxStats.txXmitDropped;
- ++pAdapter->hdd_stats.hddTxRxStats.txXmitDroppedAC[ac];
- kfree_skb(skb);
+
return NETDEV_TX_OK;
}
/**
- * hdd_ibss_get_sta_id() - Get the StationID using the Peer Mac address
+ * hdd_get_peer_sta_id() - Get the StationID using the Peer Mac address
* @pHddStaCtx: pointer to HDD Station Context
* @pMacAddress: pointer to Peer Mac address
* @staID: pointer to returned Station Index
@@ -564,12 +572,12 @@ drop_pkt:
* Return: QDF_STATUS_SUCCESS/QDF_STATUS_E_FAILURE
*/
-QDF_STATUS hdd_ibss_get_sta_id(hdd_station_ctx_t *pHddStaCtx,
+QDF_STATUS hdd_get_peer_sta_id(hdd_station_ctx_t *pHddStaCtx,
struct qdf_mac_addr *pMacAddress, uint8_t *staId)
{
uint8_t idx;
- for (idx = 0; idx < MAX_IBSS_PEERS; idx++) {
+ for (idx = 0; idx < MAX_PEERS; idx++) {
if (!qdf_mem_cmp(&pHddStaCtx->conn_info.peerMacAddress[idx],
pMacAddress, QDF_MAC_ADDR_SIZE)) {
*staId = pHddStaCtx->conn_info.staId[idx];
@@ -762,6 +770,29 @@ static QDF_STATUS hdd_mon_rx_packet_cbk(void *context, qdf_nbuf_t rxbuf)
}
/**
+ * hdd_get_peer_idx() - Get the idx for given address in peer table
+ * @sta_ctx: pointer to HDD Station Context
+ * @addr: pointer to Peer Mac address
+ *
+ * Return: index when success else INVALID_PEER_IDX
+ */
+int hdd_get_peer_idx(hdd_station_ctx_t *sta_ctx, struct qdf_mac_addr *addr)
+{
+ uint8_t idx;
+
+ for (idx = 0; idx < MAX_PEERS; idx++) {
+ if (sta_ctx->conn_info.staId[idx] == 0)
+ continue;
+ if (qdf_mem_cmp(&sta_ctx->conn_info.peerMacAddress[idx],
+ addr, sizeof(struct qdf_mac_addr)))
+ continue;
+ return idx;
+ }
+
+ return INVALID_PEER_IDX;
+}
+
+/**
* hdd_rx_packet_cbk() - Receive packet handler
* @context: pointer to HDD context
* @rxBuf: pointer to rx qdf_nbuf
diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c
index e6d9ae421e1c..7bfb224c61a6 100644
--- a/core/hdd/src/wlan_hdd_wext.c
+++ b/core/hdd/src/wlan_hdd_wext.c
@@ -31,6 +31,9 @@
* Linux Wireless Extensions Implementation
*/
+/* denote that this file does not allow legacy hddLog */
+#define HDD_DISALLOW_LEGACY_HDDLOG 1
+
#include <linux/version.h>
#include <linux/module.h>
#include <linux/kernel.h>
@@ -84,6 +87,8 @@
#include "wlan_hdd_ocb.h"
#include "wlan_hdd_napi.h"
#include "cdp_txrx_flow_ctrl_legacy.h"
+#include "wlan_hdd_nan_datapath.h"
+#include "wlan_hdd_stats.h"
#define HDD_FINISH_ULA_TIME_OUT 800
#define HDD_SET_MCBC_FILTERS_TO_FW 1
@@ -334,8 +339,9 @@ static const hdd_freq_chan_map_t freq_chan_map[] = {
#define WLAN_PRIV_SET_VAR_INT_GET_NONE (SIOCIWFIRSTPRIV + 7)
#define WE_P2P_NOA_CMD 2
+/* subcommands 3 is unused */
-/* subcommands 3 and 4 are unused */
+#define WE_MAC_PWR_DEBUG_CMD 4
#ifdef FEATURE_WLAN_TDLS
#define WE_TDLS_CONFIG_PARAMS 5
@@ -468,7 +474,7 @@ static const hdd_freq_chan_map_t freq_chan_map[] = {
__p += __size; \
__tlen += __size + 2; \
} else { \
- hddLog(QDF_TRACE_LEVEL_ERROR, "FILL_TLV Failed!!!"); \
+ hdd_err("FILL_TLV Failed!!!"); \
} \
} while (0)
@@ -507,21 +513,18 @@ void *mem_alloc_copy_from_user_helper(const __user void *wrqu_data, size_t len)
* (4096 bytes). So we use 4096 as the upper boundary for now.
*/
if (len > MAX_USER_COMMAND_SIZE) {
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR,
- "Invalid length");
+ hdd_err("Invalid length");
return NULL;
}
ptr = kmalloc(len + 1, GFP_KERNEL);
if (NULL == ptr) {
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR,
- "unable to allocate memory");
+ hdd_err("unable to allocate memory");
return NULL;
}
if (copy_from_user(ptr, wrqu_data, len)) {
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR,
- "%s: failed to copy data to user buffer", __func__);
+ hdd_err("failed to copy data to user buffer");
kfree(ptr);
return NULL;
}
@@ -704,6 +707,9 @@ void hdd_wlan_dump_stats(hdd_adapter_t *adapter, int value)
case WLAN_HDD_NETIF_OPER_HISTORY:
wlan_hdd_display_netif_queue_history(hdd_ctx);
break;
+ case WLAN_HIF_STATS:
+ hdd_display_hif_stats();
+ break;
default:
ol_txrx_display_stats(value);
break;
@@ -735,8 +741,7 @@ void hdd_wlan_get_version(hdd_adapter_t *pAdapter, union iwreq_data *wrqu,
pHddContext = WLAN_HDD_GET_CTX(pAdapter);
if (!pHddContext) {
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR,
- "%s:Invalid context, HDD context is null", __func__);
+ hdd_err("Invalid context, HDD context is null");
goto error;
}
@@ -781,7 +786,7 @@ hdd_wlan_get_ibss_mac_addr_from_staid(hdd_adapter_t *pAdapter,
uint8_t idx;
hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
- for (idx = 0; idx < MAX_IBSS_PEERS; idx++) {
+ for (idx = 0; idx < MAX_PEERS; idx++) {
if (0 != pHddStaCtx->conn_info.staId[idx] &&
staIdx == pHddStaCtx->conn_info.staId[idx]) {
return &pHddStaCtx->conn_info.peerMacAddress[idx];
@@ -817,8 +822,7 @@ QDF_STATUS hdd_wlan_get_ibss_peer_info(hdd_adapter_t *pAdapter, uint8_t staIdx)
(&pAdapter->ibss_peer_info_comp,
msecs_to_jiffies(IBSS_PEER_INFO_REQ_TIMOEUT));
if (!rc) {
- hddLog(QDF_TRACE_LEVEL_ERROR,
- FL("failed wait on ibss_peer_info_comp"));
+ hdd_err("failed wait on ibss_peer_info_comp");
return QDF_STATUS_E_FAILURE;
}
@@ -835,9 +839,7 @@ QDF_STATUS hdd_wlan_get_ibss_peer_info(hdd_adapter_t *pAdapter, uint8_t staIdx)
(int)pPeerInfo->peerInfoParams[0].rssi);
}
} else {
- hddLog(QDF_TRACE_LEVEL_WARN,
- "%s: Warning: sme_request_ibss_peer_info Request failed",
- __func__);
+ hdd_warn("Warning: sme_request_ibss_peer_info Request failed");
}
return status;
@@ -869,8 +871,7 @@ QDF_STATUS hdd_wlan_get_ibss_peer_info_all(hdd_adapter_t *pAdapter)
(&pAdapter->ibss_peer_info_comp,
msecs_to_jiffies(IBSS_PEER_INFO_REQ_TIMOEUT));
if (!rc) {
- hddLog(QDF_TRACE_LEVEL_ERROR,
- FL("failed wait on ibss_peer_info_comp"));
+ hdd_err("failed wait on ibss_peer_info_comp");
return QDF_STATUS_E_FAILURE;
}
@@ -891,9 +892,7 @@ QDF_STATUS hdd_wlan_get_ibss_peer_info_all(hdd_adapter_t *pAdapter)
(int)pPeerInfo->peerInfoParams[i].rssi);
}
} else {
- hddLog(QDF_TRACE_LEVEL_WARN,
- "%s: Warning: sme_request_ibss_peer_info Request failed",
- __func__);
+ hdd_warn("Warning: sme_request_ibss_peer_info Request failed");
}
return status;
@@ -919,8 +918,7 @@ int hdd_wlan_get_rts_threshold(hdd_adapter_t *pAdapter, union iwreq_data *wrqu)
ENTER();
if (NULL == pAdapter) {
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR,
- "%s: Adapter is NULL", __func__);
+ hdd_err("Adapter is NULL");
return -EINVAL;
}
@@ -931,15 +929,12 @@ int hdd_wlan_get_rts_threshold(hdd_adapter_t *pAdapter, union iwreq_data *wrqu)
if (QDF_STATUS_SUCCESS !=
sme_cfg_get_int(hHal, WNI_CFG_RTS_THRESHOLD, &threshold)) {
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_WARN,
- FL
- ("failed to get ini parameter, WNI_CFG_RTS_THRESHOLD"));
+ hdd_warn("failed to get ini parameter, WNI_CFG_RTS_THRESHOLD");
return -EIO;
}
wrqu->rts.value = threshold;
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO,
- ("Rts-Threshold=%d!!"), wrqu->rts.value);
+ hdd_notice("Rts-Threshold=%d!!", wrqu->rts.value);
EXIT();
@@ -966,8 +961,7 @@ int hdd_wlan_get_frag_threshold(hdd_adapter_t *pAdapter,
ENTER();
if (NULL == pAdapter) {
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR,
- "%s: Adapter is NULL", __func__);
+ hdd_err("Adapter is NULL");
return -EINVAL;
}
@@ -978,15 +972,12 @@ int hdd_wlan_get_frag_threshold(hdd_adapter_t *pAdapter,
if (sme_cfg_get_int(hHal, WNI_CFG_FRAGMENTATION_THRESHOLD, &threshold)
!= QDF_STATUS_SUCCESS) {
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_WARN,
- FL
- ("failed to get ini parameter, WNI_CFG_FRAGMENTATION_THRESHOLD"));
+ hdd_warn("failed to get ini parameter, WNI_CFG_FRAGMENTATION_THRESHOLD");
return -EIO;
}
wrqu->frag.value = threshold;
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO,
- ("Frag-Threshold=%d!!"), wrqu->frag.value);
+ hdd_notice("Frag-Threshold=%d!!", wrqu->frag.value);
EXIT();
@@ -1011,8 +1002,7 @@ int hdd_wlan_get_freq(uint32_t channel, uint32_t *pfreq)
}
}
}
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO,
- ("Invalid channel no=%d!!"), channel);
+ hdd_notice("Invalid channel no=%d!!", channel);
return -EINVAL;
}
@@ -1069,12 +1059,12 @@ static bool hdd_is_auth_type_rsn(eCsrAuthType authType)
rsnType = false;
break;
default:
- hddLog(LOGE, FL("unknown authType %d, treat as open"),
+ hdd_err("unknown authType %d, treat as open",
authType);
rsnType = false;
break;
}
- hddLog(LOG1, FL("called with authType: %d, returned: %d"),
+ hdd_notice("called with authType: %d, returned: %d",
authType, rsnType);
return rsnType;
}
@@ -1099,8 +1089,7 @@ static void hdd_get_rssi_cb(int8_t rssi, uint32_t staId, void *pContext)
}
if (NULL == pContext) {
- hddLog(QDF_TRACE_LEVEL_ERROR,
- "%s: Bad param, pContext [%p]", __func__, pContext);
+ hdd_err("Bad param");
return;
}
@@ -1120,9 +1109,8 @@ static void hdd_get_rssi_cb(int8_t rssi, uint32_t staId, void *pContext)
* we can do
*/
spin_unlock(&hdd_context_lock);
- hddLog(QDF_TRACE_LEVEL_WARN,
- "%s: Invalid context, pAdapter [%p] magic [%08x]",
- __func__, pAdapter, pStatsContext->magic);
+ hdd_warn("Invalid context, pAdapter [%p] magic [%08x]",
+ pAdapter, pStatsContext->magic);
if (ioctl_debug) {
pr_info("%s: Invalid context, pAdapter [%p] magic [%08x]\n",
__func__, pAdapter, pStatsContext->magic);
@@ -1168,8 +1156,7 @@ static void hdd_get_snr_cb(int8_t snr, uint32_t staId, void *pContext)
}
if (NULL == pContext) {
- hddLog(QDF_TRACE_LEVEL_ERROR,
- "%s: Bad param, pContext [%p]", __func__, pContext);
+ hdd_err("Bad param");
return;
}
@@ -1188,9 +1175,8 @@ static void hdd_get_snr_cb(int8_t snr, uint32_t staId, void *pContext)
* we can do
*/
spin_unlock(&hdd_context_lock);
- hddLog(QDF_TRACE_LEVEL_WARN,
- "%s: Invalid context, pAdapter [%p] magic [%08x]",
- __func__, pAdapter, pStatsContext->magic);
+ hdd_warn("Invalid context, pAdapter [%p] magic [%08x]",
+ pAdapter, pStatsContext->magic);
if (ioctl_debug) {
pr_info("%s: Invalid context, pAdapter [%p] magic [%08x]\n",
__func__, pAdapter, pStatsContext->magic);
@@ -1229,8 +1215,7 @@ QDF_STATUS wlan_hdd_get_rssi(hdd_adapter_t *pAdapter, int8_t *rssi_value)
unsigned long rc;
if (NULL == pAdapter) {
- hddLog(QDF_TRACE_LEVEL_WARN,
- "%s: Invalid context, pAdapter", __func__);
+ hdd_warn("Invalid context, pAdapter");
return QDF_STATUS_E_FAULT;
}
if (cds_is_driver_recovering()) {
@@ -1265,8 +1250,7 @@ QDF_STATUS wlan_hdd_get_rssi(hdd_adapter_t *pAdapter, int8_t *rssi_value)
pHddStaCtx->conn_info.bssId, pAdapter->rssi,
&context, pHddCtx->pcds_context);
if (QDF_STATUS_SUCCESS != hstatus) {
- hddLog(QDF_TRACE_LEVEL_ERROR, "%s: Unable to retrieve RSSI",
- __func__);
+ hdd_err("Unable to retrieve RSSI");
/* we'll returned a cached value below */
} else {
/* request was sent -- wait for the response */
@@ -1274,8 +1258,7 @@ QDF_STATUS wlan_hdd_get_rssi(hdd_adapter_t *pAdapter, int8_t *rssi_value)
msecs_to_jiffies
(WLAN_WAIT_TIME_STATS));
if (!rc) {
- hddLog(QDF_TRACE_LEVEL_ERROR,
- FL("SME timed out while retrieving RSSI"));
+ hdd_err("SME timed out while retrieving RSSI");
/* we'll now returned a cached value below */
}
}
@@ -1321,8 +1304,7 @@ QDF_STATUS wlan_hdd_get_snr(hdd_adapter_t *pAdapter, int8_t *snr)
ENTER();
if (NULL == pAdapter) {
- hddLog(QDF_TRACE_LEVEL_ERROR,
- "%s: Invalid context, pAdapter", __func__);
+ hdd_err("Invalid context, pAdapter");
return QDF_STATUS_E_FAULT;
}
@@ -1342,8 +1324,7 @@ QDF_STATUS wlan_hdd_get_snr(hdd_adapter_t *pAdapter, int8_t *snr)
pHddStaCtx->conn_info.staId[0],
pHddStaCtx->conn_info.bssId, &context);
if (QDF_STATUS_SUCCESS != hstatus) {
- hddLog(QDF_TRACE_LEVEL_ERROR, "%s: Unable to retrieve RSSI",
- __func__);
+ hdd_err("Unable to retrieve RSSI");
/* we'll returned a cached value below */
} else {
/* request was sent -- wait for the response */
@@ -1351,8 +1332,7 @@ QDF_STATUS wlan_hdd_get_snr(hdd_adapter_t *pAdapter, int8_t *snr)
msecs_to_jiffies
(WLAN_WAIT_TIME_STATS));
if (!rc) {
- hddLog(QDF_TRACE_LEVEL_ERROR,
- FL("SME timed out while retrieving SNR"));
+ hdd_err("SME timed out while retrieving SNR");
/* we'll now returned a cached value below */
}
}
@@ -1402,9 +1382,8 @@ hdd_get_link_speed_cb(tSirLinkSpeedInfo *pLinkSpeed, void *pContext)
hdd_adapter_t *pAdapter;
if ((NULL == pLinkSpeed) || (NULL == pContext)) {
- hddLog(QDF_TRACE_LEVEL_ERROR,
- "%s: Bad param, pLinkSpeed [%p] pContext [%p]",
- __func__, pLinkSpeed, pContext);
+ hdd_err("Bad param, pLinkSpeed [%p] pContext [%p]",
+ pLinkSpeed, pContext);
return;
}
spin_lock(&hdd_context_lock);
@@ -1423,9 +1402,8 @@ hdd_get_link_speed_cb(tSirLinkSpeedInfo *pLinkSpeed, void *pContext)
* we can do
*/
spin_unlock(&hdd_context_lock);
- hddLog(QDF_TRACE_LEVEL_WARN,
- "%s: Invalid context, pAdapter [%p] magic [%08x]",
- __func__, pAdapter, pLinkSpeedContext->magic);
+ hdd_warn("Invalid context, pAdapter [%p] magic [%08x]",
+ pAdapter, pLinkSpeedContext->magic);
if (ioctl_debug) {
pr_info("%s: Invalid context, pAdapter [%p] magic [%08x]\n",
__func__, pAdapter, pLinkSpeedContext->magic);
@@ -1467,13 +1445,12 @@ QDF_STATUS wlan_hdd_get_linkspeed_for_peermac(hdd_adapter_t *pAdapter,
tSirLinkSpeedInfo *linkspeed_req;
if (NULL == pAdapter) {
- hddLog(QDF_TRACE_LEVEL_ERROR, "%s: pAdapter is NULL", __func__);
+ hdd_err("pAdapter is NULL");
return QDF_STATUS_E_FAULT;
}
linkspeed_req = qdf_mem_malloc(sizeof(*linkspeed_req));
if (NULL == linkspeed_req) {
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR,
- "%s Request Buffer Alloc Fail", __func__);
+ hdd_err("Request Buffer Alloc Fail");
return QDF_STATUS_E_NOMEM;
}
init_completion(&context.completion);
@@ -1485,18 +1462,14 @@ QDF_STATUS wlan_hdd_get_linkspeed_for_peermac(hdd_adapter_t *pAdapter,
linkspeed_req,
&context, hdd_get_link_speed_cb);
if (QDF_STATUS_SUCCESS != status) {
- hddLog(QDF_TRACE_LEVEL_ERROR,
- "%s: Unable to retrieve statistics for link speed",
- __func__);
+ hdd_err("Unable to retrieve statistics for link speed");
qdf_mem_free(linkspeed_req);
} else {
rc = wait_for_completion_timeout
(&context.completion,
msecs_to_jiffies(WLAN_WAIT_TIME_STATS));
if (!rc) {
- hddLog(QDF_TRACE_LEVEL_ERROR,
- "%s: SME timed out while retrieving link speed",
- __func__);
+ hdd_err("SME timed out while retrieving link speed");
}
}
@@ -1552,7 +1525,7 @@ int wlan_hdd_get_link_speed(hdd_adapter_t *sta_adapter, uint32_t *link_speed)
status = wlan_hdd_get_linkspeed_for_peermac(sta_adapter, bssid);
if (!QDF_IS_STATUS_SUCCESS(status)) {
- hddLog(LOGE, FL("Unable to retrieve SME linkspeed"));
+ hdd_err("Unable to retrieve SME linkspeed");
return -EINVAL;
}
*link_speed = sta_adapter->ls_stats.estLinkSpeed;
@@ -1616,7 +1589,7 @@ void hdd_statistics_cb(void *pStats, void *pContext)
pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter);
qdf_status = qdf_event_set(&pWextState->hdd_qdf_event);
if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
- hddLog(LOGE, FL("qdf_event_set failed"));
+ hdd_err("qdf_event_set failed");
return;
}
}
@@ -1633,6 +1606,8 @@ void hdd_clear_roam_profile_ie(hdd_adapter_t *pAdapter)
int i = 0;
hdd_wext_state_t *pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter);
+ ENTER();
+
/* clear WPA/RSN/WSC IE information in the profile */
pWextState->roamProfile.nWPAReqIELength = 0;
pWextState->roamProfile.pWPAReqIE = (uint8_t *) NULL;
@@ -1682,7 +1657,7 @@ void hdd_clear_roam_profile_ie(hdd_adapter_t *pAdapter)
#endif
qdf_zero_macaddr(&pWextState->req_bssId);
-
+ EXIT();
}
/**
@@ -1713,9 +1688,7 @@ uint8_t *wlan_hdd_get_vendor_oui_ie_ptr(uint8_t *oui, uint8_t oui_size,
elem_len = ptr[1];
left -= 2;
if (elem_len > left) {
- hddLog(QDF_TRACE_LEVEL_FATAL,
- FL
- ("****Invalid IEs eid = %d elem_len=%d left=%d*****"),
+ hdd_alert("****Invalid IEs eid = %d elem_len=%d left=%d*****",
eid, elem_len, left);
return NULL;
}
@@ -1865,11 +1838,11 @@ static int __iw_set_mode(struct net_device *dev,
pRoamProfile = &pWextState->roamProfile;
LastBSSType = pRoamProfile->BSSType;
- hddLog(LOG1, "%s Old Bss type = %d", __func__, LastBSSType);
+ hdd_notice("Old Bss type = %d", LastBSSType);
switch (wrqu->mode) {
case IW_MODE_ADHOC:
- hddLog(LOG1, "%s Setting AP Mode as IW_MODE_ADHOC", __func__);
+ hdd_notice("Setting AP Mode as IW_MODE_ADHOC");
pRoamProfile->BSSType = eCSR_BSS_TYPE_START_IBSS;
/* Set the phymode correctly for IBSS. */
pConfig = (WLAN_HDD_GET_CTX(pAdapter))->config;
@@ -1879,17 +1852,16 @@ static int __iw_set_mode(struct net_device *dev,
wdev->iftype = NL80211_IFTYPE_ADHOC;
break;
case IW_MODE_INFRA:
- hddLog(LOG1, "%s Setting AP Mode as IW_MODE_INFRA", __func__);
+ hdd_notice("Setting AP Mode as IW_MODE_INFRA");
pRoamProfile->BSSType = eCSR_BSS_TYPE_INFRASTRUCTURE;
wdev->iftype = NL80211_IFTYPE_STATION;
break;
case IW_MODE_AUTO:
- hddLog(LOG1, "%s Setting AP Mode as IW_MODE_AUTO", __func__);
+ hdd_notice("Setting AP Mode as IW_MODE_AUTO");
pRoamProfile->BSSType = eCSR_BSS_TYPE_ANY;
break;
default:
- hddLog(LOGE, "%s Unknown AP Mode value %d ", __func__,
- wrqu->mode);
+ hdd_err("Unknown AP Mode value %d", wrqu->mode);
return -EOPNOTSUPP;
}
@@ -1914,9 +1886,7 @@ static int __iw_set_mode(struct net_device *dev,
msecs_to_jiffies
(WLAN_WAIT_TIME_DISCONNECT));
if (!rc)
- hddLog(QDF_TRACE_LEVEL_ERROR,
- FL
- ("failed wait on disconnect_comp_var"));
+ hdd_err("failed wait on disconnect_comp_var");
}
}
}
@@ -1975,17 +1945,17 @@ __iw_get_mode(struct net_device *dev, struct iw_request_info *info,
switch (pWextState->roamProfile.BSSType) {
case eCSR_BSS_TYPE_INFRASTRUCTURE:
- hddLog(LOG1, FL("returns IW_MODE_INFRA"));
+ hdd_notice("returns IW_MODE_INFRA");
wrqu->mode = IW_MODE_INFRA;
break;
case eCSR_BSS_TYPE_IBSS:
case eCSR_BSS_TYPE_START_IBSS:
- hddLog(LOG1, FL("returns IW_MODE_ADHOC"));
+ hdd_notice("returns IW_MODE_ADHOC");
wrqu->mode = IW_MODE_ADHOC;
break;
case eCSR_BSS_TYPE_ANY:
default:
- hddLog(LOG1, FL("returns IW_MODE_AUTO"));
+ hdd_notice("returns IW_MODE_AUTO");
wrqu->mode = IW_MODE_AUTO;
break;
}
@@ -2049,12 +2019,12 @@ static int __iw_set_freq(struct net_device *dev, struct iw_request_info *info,
pRoamProfile = &pWextState->roamProfile;
- hddLog(LOG1, "setCHANNEL ioctl");
+ hdd_notice("setCHANNEL ioctl");
/* Link is up then return cant set channel */
if (eConnectionState_IbssConnected == pHddStaCtx->conn_info.connState ||
eConnectionState_Associated == pHddStaCtx->conn_info.connState) {
- hddLog(LOGE, "IBSS Associated");
+ hdd_err("IBSS Associated");
return -EOPNOTSUPP;
}
@@ -2077,11 +2047,10 @@ static int __iw_set_freq(struct net_device *dev, struct iw_request_info *info,
if (wrqu->freq.e == 0) {
if ((wrqu->freq.m < WNI_CFG_CURRENT_CHANNEL_STAMIN) ||
(wrqu->freq.m > WNI_CFG_CURRENT_CHANNEL_STAMAX)) {
- hddLog(LOG1,
- "%s: Channel [%d] is outside valid range from %d to %d",
- __func__, wrqu->freq.m,
- WNI_CFG_CURRENT_CHANNEL_STAMIN,
- WNI_CFG_CURRENT_CHANNEL_STAMAX);
+ hdd_notice("Channel %d is outside valid range from %d to %d",
+ wrqu->freq.m,
+ WNI_CFG_CURRENT_CHANNEL_STAMIN,
+ WNI_CFG_CURRENT_CHANNEL_STAMAX);
return -EINVAL;
}
@@ -2090,8 +2059,7 @@ static int __iw_set_freq(struct net_device *dev, struct iw_request_info *info,
if (sme_cfg_get_str(hHal, WNI_CFG_VALID_CHANNEL_LIST,
validChan, &numChans) !=
QDF_STATUS_SUCCESS) {
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_WARN, FL
- ("failed to get ini parameter, WNI_CFG_VALID_CHANNEL_LIST"));
+ hdd_warn("failed to get ini parameter, WNI_CFG_VALID_CHANNEL_LIST");
return -EIO;
}
@@ -2115,7 +2083,7 @@ static int __iw_set_freq(struct net_device *dev, struct iw_request_info *info,
pRoamProfile->ChannelInfo.ChannelList =
&pHddStaCtx->conn_info.operationChannel;
- hddLog(LOG1, "pRoamProfile->operationChannel = %d", wrqu->freq.m);
+ hdd_notice("pRoamProfile->operationChannel = %d", wrqu->freq.m);
EXIT();
@@ -2179,8 +2147,7 @@ static int __iw_get_freq(struct net_device *dev, struct iw_request_info *info,
if (pHddStaCtx->conn_info.connState == eConnectionState_Associated) {
if (sme_get_operation_channel(hHal, &channel, pAdapter->sessionId)
!= QDF_STATUS_SUCCESS) {
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR,
- FL("failed to get operating channel %u"),
+ hdd_err("failed to get operating channel %u",
pAdapter->sessionId);
return -EIO;
} else {
@@ -2312,8 +2279,7 @@ static int __iw_set_tx_power(struct net_device *dev,
if (sme_cfg_set_int(hHal, WNI_CFG_CURRENT_TX_POWER_LEVEL,
wrqu->txpower.value) != QDF_STATUS_SUCCESS) {
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, FL
- ("failed to set ini parameter, WNI_CFG_CURRENT_TX_POWER_LEVEL"));
+ hdd_err("failed to set ini parameter, WNI_CFG_CURRENT_TX_POWER_LEVEL");
return -EIO;
}
@@ -2396,8 +2362,7 @@ static int __iw_get_bitrate(struct net_device *dev,
pAdapter, pAdapter->sessionId);
if (QDF_STATUS_SUCCESS != status) {
- hddLog(QDF_TRACE_LEVEL_ERROR,
- "%s: Unable to retrieve statistics", __func__);
+ hdd_err("Unable to retrieve statistics");
return status;
}
@@ -2408,9 +2373,7 @@ static int __iw_get_bitrate(struct net_device *dev,
WLAN_WAIT_TIME_STATS);
if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
- hddLog(QDF_TRACE_LEVEL_ERROR,
- "%s: SME timeout while retrieving statistics",
- __func__);
+ hdd_err("SME timeout while retrieving statistics");
return QDF_STATUS_E_FAILURE;
}
@@ -2520,8 +2483,7 @@ static int __iw_set_bitrate(struct net_device *dev,
}
if (sme_cfg_set_int(WLAN_HDD_GET_HAL_CTX(pAdapter),
WNI_CFG_FIXED_RATE, rate) != QDF_STATUS_SUCCESS) {
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, FL
- ("failed to set ini parameter, WNI_CFG_FIXED_RATE"));
+ hdd_err("failed to set ini parameter, WNI_CFG_FIXED_RATE");
return -EIO;
}
return 0;
@@ -2586,8 +2548,7 @@ static int __iw_set_genie(struct net_device *dev,
base_genie = mem_alloc_copy_from_user_helper(wrqu->data.pointer,
wrqu->data.length);
if (NULL == base_genie) {
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR,
- "mem_alloc_copy_from_user_helper fail");
+ hdd_err("mem_alloc_copy_from_user_helper fail");
return -ENOMEM;
}
@@ -2595,7 +2556,7 @@ static int __iw_set_genie(struct net_device *dev,
remLen = wrqu->data.length;
- hddLog(LOG1, "iw_set_genie ioctl IE[0x%X], LEN[%d]", genie[0],
+ hdd_notice("iw_set_genie ioctl IE[0x%X], LEN[%d]", genie[0],
genie[1]);
/* clear any previous genIE before this call */
@@ -2608,8 +2569,7 @@ static int __iw_set_genie(struct net_device *dev,
eLen = *genie++;
remLen -= 2;
- hddLog(QDF_TRACE_LEVEL_INFO, "%s: IE[0x%X], LEN[%d]",
- __func__, elementId, eLen);
+ hdd_notice("IE[0x%X], LEN[%d]", elementId, eLen);
switch (elementId) {
case IE_EID_VENDOR:
@@ -2620,16 +2580,13 @@ static int __iw_set_genie(struct net_device *dev,
if (0 == memcmp(&genie[0], "\x00\x50\xf2\x04", 4)) {
uint16_t curGenIELen = pWextState->genIE.length;
- hddLog(QDF_TRACE_LEVEL_INFO,
- "%s Set WPS OUI(%02x %02x %02x %02x) IE(len %d)",
- __func__, genie[0], genie[1], genie[2],
- genie[3], eLen + 2);
+ hdd_notice("Set WPS OUI(%02x %02x %02x %02x) IE(len %d)",
+ genie[0], genie[1], genie[2],
+ genie[3], eLen + 2);
if (SIR_MAC_MAX_IE_LENGTH <
(pWextState->genIE.length + eLen)) {
- hddLog(QDF_TRACE_LEVEL_FATAL,
- "Cannot accommodate genIE. "
- "Need bigger buffer space");
+ hdd_alert("Cannot accommodate genIE. Need bigger buffer space");
QDF_ASSERT(0);
ret = -ENOMEM;
goto exit;
@@ -2639,9 +2596,7 @@ static int __iw_set_genie(struct net_device *dev,
curGenIELen, genie - 2, eLen + 2);
pWextState->genIE.length += eLen + 2;
} else if (0 == memcmp(&genie[0], "\x00\x50\xf2", 3)) {
- hddLog(QDF_TRACE_LEVEL_INFO,
- "%s Set WPA IE (len %d)", __func__,
- eLen + 2);
+ hdd_notice("Set WPA IE (len %d)", eLen + 2);
if ((eLen + 2) > (sizeof(pWextState->WPARSNIE))) {
hdd_warn("Cannot accommodate genIE, Need bigger buffer space");
ret = -EINVAL;
@@ -2659,16 +2614,13 @@ static int __iw_set_genie(struct net_device *dev,
} else { /* any vendorId except WPA IE should be accumulated to genIE */
uint16_t curGenIELen = pWextState->genIE.length;
- hddLog(QDF_TRACE_LEVEL_INFO,
- "%s Set OUI(%02x %02x %02x %02x) IE(len %d)",
- __func__, genie[0], genie[1], genie[2],
- genie[3], eLen + 2);
+ hdd_notice("Set OUI(%02x %02x %02x %02x) IE(len %d)",
+ genie[0], genie[1], genie[2],
+ genie[3], eLen + 2);
if (SIR_MAC_MAX_IE_LENGTH <
(pWextState->genIE.length + eLen)) {
- hddLog(QDF_TRACE_LEVEL_FATAL,
- "Cannot accommodate genIE. "
- "Need bigger buffer space");
+ hdd_alert("Cannot accommodate genIE. Need bigger buffer space");
QDF_ASSERT(0);
ret = -ENOMEM;
goto exit;
@@ -2680,8 +2632,7 @@ static int __iw_set_genie(struct net_device *dev,
}
break;
case DOT11F_EID_RSN:
- hddLog(LOG1, "%s Set RSN IE (len %d)", __func__,
- eLen + 2);
+ hdd_notice("Set RSN IE (len %d)", eLen + 2);
if ((eLen + 2) > (sizeof(pWextState->WPARSNIE))) {
hdd_warn("Cannot accommodate genIE, Need bigger buffer space");
ret = -EINVAL;
@@ -2696,8 +2647,7 @@ static int __iw_set_genie(struct net_device *dev,
break;
default:
- hddLog(LOGE, "%s Set UNKNOWN IE %X", __func__,
- elementId);
+ hdd_err("Set UNKNOWN IE %X", elementId);
goto exit;
}
genie += eLen;
@@ -2760,7 +2710,7 @@ static int __iw_get_genie(struct net_device *dev,
if (0 != ret)
return ret;
- hddLog(LOG1, "getGEN_IE ioctl");
+ hdd_notice("getGEN_IE ioctl");
pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter);
@@ -2783,14 +2733,13 @@ static int __iw_get_genie(struct net_device *dev,
&length, genIeBytes);
length = QDF_MIN((uint16_t) length, DOT11F_IE_RSN_MAX_LEN);
if (wrqu->data.length < length) {
- hddLog(LOG1, "%s: failed to copy data to user buffer",
- __func__);
+ hdd_notice("failed to copy data to user buffer");
return -EFAULT;
}
qdf_mem_copy(extra, (void *)genIeBytes, length);
wrqu->data.length = length;
- hddLog(LOG1, "%s: RSN IE of %d bytes returned", __func__,
+ hdd_notice("RSN IE of %d bytes returned",
wrqu->data.length);
EXIT();
@@ -2852,7 +2801,7 @@ static int __iw_get_encode(struct net_device *dev,
keyId = pRoamProfile->Keys.defaultIndex;
if (keyId < 0 || keyId >= MAX_WEP_KEYS) {
- hddLog(LOG1, "%s: Invalid keyId : %d", __func__, keyId);
+ hdd_notice("Invalid keyId : %d", keyId);
return -EINVAL;
}
@@ -2969,8 +2918,7 @@ static int __iw_set_rts_threshold(struct net_device *dev,
if (sme_cfg_set_int(hHal, WNI_CFG_RTS_THRESHOLD, wrqu->rts.value) !=
QDF_STATUS_SUCCESS) {
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, FL
- ("failed to set ini parameter, WNI_CFG_RTS_THRESHOLD"));
+ hdd_err("failed to set ini parameter, WNI_CFG_RTS_THRESHOLD");
return -EIO;
}
@@ -3101,8 +3049,7 @@ static int __iw_set_frag_threshold(struct net_device *dev,
if (sme_cfg_set_int
(hHal, WNI_CFG_FRAGMENTATION_THRESHOLD, wrqu->frag.value)
!= QDF_STATUS_SUCCESS) {
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, FL
- ("failed to set ini parameter, WNI_CFG_FRAGMENTATION_THRESHOLD"));
+ hdd_err("failed to set ini parameter, WNI_CFG_FRAGMENTATION_THRESHOLD");
return -EIO;
}
@@ -3275,8 +3222,7 @@ static int __iw_get_range(struct net_device *dev, struct iw_request_info *info,
if (sme_cfg_get_int(hHal,
WNI_CFG_DOT11_MODE,
&active_phy_mode) == QDF_STATUS_SUCCESS) {
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO,
- "active_phy_mode = %d", active_phy_mode);
+ hdd_notice("active_phy_mode = %d", active_phy_mode);
if (active_phy_mode == WNI_CFG_DOT11_MODE_11A
|| active_phy_mode == WNI_CFG_DOT11_MODE_11G) {
@@ -3337,9 +3283,7 @@ static int __iw_get_range(struct net_device *dev, struct iw_request_info *info,
if (sme_cfg_get_str
((hHal), WNI_CFG_VALID_CHANNEL_LIST, channels,
&num_channels) != QDF_STATUS_SUCCESS) {
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_WARN,
- FL
- ("failed to get ini parameter, WNI_CFG_VALID_CHANNEL_LIST"));
+ hdd_warn("failed to get ini parameter, WNI_CFG_VALID_CHANNEL_LIST");
return -EIO;
}
if (num_channels > IW_MAX_FREQUENCIES) {
@@ -3427,9 +3371,8 @@ static void hdd_get_class_a_statistics_cb(void *pStats, void *pContext)
}
if ((NULL == pStats) || (NULL == pContext)) {
- hddLog(QDF_TRACE_LEVEL_ERROR,
- "%s: Bad param, pStats [%p] pContext [%p]",
- __func__, pStats, pContext);
+ hdd_err("Bad param, pStats [%p] pContext [%p]",
+ pStats, pContext);
return;
}
@@ -3450,9 +3393,8 @@ static void hdd_get_class_a_statistics_cb(void *pStats, void *pContext)
* we can do
*/
spin_unlock(&hdd_context_lock);
- hddLog(QDF_TRACE_LEVEL_WARN,
- "%s: Invalid context, pAdapter [%p] magic [%08x]",
- __func__, pAdapter, pStatsContext->magic);
+ hdd_warn("Invalid context, pAdapter [%p] magic [%08x]",
+ pAdapter, pStatsContext->magic);
if (ioctl_debug) {
pr_info("%s: Invalid context, pAdapter [%p] magic [%08x]\n",
__func__, pAdapter, pStatsContext->magic);
@@ -3489,7 +3431,7 @@ QDF_STATUS wlan_hdd_get_class_astats(hdd_adapter_t *pAdapter)
struct statsContext context;
if (NULL == pAdapter) {
- hddLog(QDF_TRACE_LEVEL_ERROR, "%s: pAdapter is NULL", __func__);
+ hdd_err("pAdapter is NULL");
return QDF_STATUS_E_FAULT;
}
if (cds_is_driver_recovering()) {
@@ -3511,8 +3453,7 @@ QDF_STATUS wlan_hdd_get_class_astats(hdd_adapter_t *pAdapter)
pHddStaCtx->conn_info.staId[0],
&context, pAdapter->sessionId);
if (QDF_STATUS_SUCCESS != hstatus) {
- hddLog(QDF_TRACE_LEVEL_ERROR,
- "%s: Unable to retrieve Class A statistics", __func__);
+ hdd_err("Unable to retrieve Class A statistics");
/* we'll returned a cached value below */
} else {
/* request was sent -- wait for the response */
@@ -3520,8 +3461,7 @@ QDF_STATUS wlan_hdd_get_class_astats(hdd_adapter_t *pAdapter)
(&context.completion,
msecs_to_jiffies(WLAN_WAIT_TIME_STATS));
if (!rc) {
- hddLog(QDF_TRACE_LEVEL_ERROR,
- FL("SME timed out while retrieving Class A statistics"));
+ hdd_err("SME timed out while retrieving Class A statistics");
}
}
@@ -3566,9 +3506,8 @@ static void hdd_get_station_statistics_cb(void *pStats, void *pContext)
}
if ((NULL == pStats) || (NULL == pContext)) {
- hddLog(QDF_TRACE_LEVEL_ERROR,
- "%s: Bad param, pStats [%p] pContext [%p]",
- __func__, pStats, pContext);
+ hdd_err("Bad param, pStats [%p] pContext [%p]",
+ pStats, pContext);
return;
}
@@ -3589,9 +3528,8 @@ static void hdd_get_station_statistics_cb(void *pStats, void *pContext)
* we can do
*/
spin_unlock(&hdd_context_lock);
- hddLog(QDF_TRACE_LEVEL_WARN,
- "%s: Invalid context, pAdapter [%p] magic [%08x]",
- __func__, pAdapter, pStatsContext->magic);
+ hdd_warn("Invalid context, pAdapter [%p] magic [%08x]",
+ pAdapter, pStatsContext->magic);
if (ioctl_debug) {
pr_info("%s: Invalid context, pAdapter [%p] magic [%08x]\n",
__func__, pAdapter, pStatsContext->magic);
@@ -3629,7 +3567,7 @@ QDF_STATUS wlan_hdd_get_station_stats(hdd_adapter_t *pAdapter)
struct statsContext context;
if (NULL == pAdapter) {
- hddLog(QDF_TRACE_LEVEL_ERROR, "%s: pAdapter is NULL", __func__);
+ hdd_err("pAdapter is NULL");
return QDF_STATUS_SUCCESS;
}
@@ -3649,8 +3587,7 @@ QDF_STATUS wlan_hdd_get_station_stats(hdd_adapter_t *pAdapter)
pHddStaCtx->conn_info.staId[0],
&context, pAdapter->sessionId);
if (QDF_STATUS_SUCCESS != hstatus) {
- hddLog(QDF_TRACE_LEVEL_ERROR,
- "%s: Unable to retrieve statistics", __func__);
+ hdd_err("Unable to retrieve statistics");
/* we'll return with cached values */
} else {
/* request was sent -- wait for the response */
@@ -3659,8 +3596,7 @@ QDF_STATUS wlan_hdd_get_station_stats(hdd_adapter_t *pAdapter)
msecs_to_jiffies(WLAN_WAIT_TIME_STATS));
if (!rc) {
- hddLog(QDF_TRACE_LEVEL_ERROR,
- FL("SME timed out while retrieving statistics"));
+ hdd_err("SME timed out while retrieving statistics");
}
}
@@ -3722,8 +3658,7 @@ static int __iw_get_linkspeed(struct net_device *dev,
rc = snprintf(pLinkSpeed, len, "%u", link_speed);
if ((rc < 0) || (rc >= len)) {
/* encoding or length error? */
- hddLog(QDF_TRACE_LEVEL_ERROR,
- FL("Unable to encode link speed"));
+ hdd_err("Unable to encode link speed");
return -EIO;
}
@@ -3917,8 +3852,7 @@ static int __iw_set_encode(struct net_device *dev, struct iw_request_info *info,
}
if (wrqu->data.flags & IW_ENCODE_DISABLED) {
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO,
- "****iwconfig wlan0 key off*****");
+ hdd_notice("****iwconfig wlan0 key off*****");
if (!fKeyPresent) {
for (i = 0; i < CSR_MAX_NUM_KEY; i++) {
@@ -3952,9 +3886,7 @@ static int __iw_set_encode(struct net_device *dev, struct iw_request_info *info,
msecs_to_jiffies
(WLAN_WAIT_TIME_DISCONNECT));
if (!rc)
- hddLog(QDF_TRACE_LEVEL_ERROR,
- FL
- ("failed wait on disconnect_comp_var"));
+ hdd_err("failed wait on disconnect_comp_var");
}
}
@@ -3963,7 +3895,7 @@ static int __iw_set_encode(struct net_device *dev, struct iw_request_info *info,
}
if (wrqu->data.flags & (IW_ENCODE_OPEN | IW_ENCODE_RESTRICTED)) {
- hddLog(QDF_TRACE_LEVEL_INFO, "iwconfig wlan0 key on");
+ hdd_notice("iwconfig wlan0 key on");
pHddStaCtx->conn_info.authType =
(encoderq->
@@ -3973,16 +3905,14 @@ static int __iw_set_encode(struct net_device *dev, struct iw_request_info *info,
}
if (wrqu->data.length > 0) {
- hddLog(QDF_TRACE_LEVEL_INFO, "%s : wrqu->data.length : %d",
- __func__, wrqu->data.length);
+ hdd_notice("wrqu->data.length : %d", wrqu->data.length);
key_length = wrqu->data.length;
/* IW_ENCODING_TOKEN_MAX is the value that is set for wrqu->data.length by iwconfig.c when 'iwconfig wlan0 key on' is issued. */
if (5 == key_length) {
- hddLog(QDF_TRACE_LEVEL_INFO,
- "%s: Call with WEP40,key_len=%d", __func__,
+ hdd_notice("Call with WEP40,key_len=%d",
key_length);
if ((IW_AUTH_KEY_MGMT_802_1X == pWextState->authKeyMgmt)
@@ -3994,8 +3924,7 @@ static int __iw_set_encode(struct net_device *dev, struct iw_request_info *info,
eCSR_ENCRYPT_TYPE_WEP40_STATICKEY;
}
} else if (13 == key_length) {
- hddLog(QDF_TRACE_LEVEL_INFO,
- "%s:Call with WEP104,key_len:%d", __func__,
+ hdd_notice("Call with WEP104,key_len:%d",
key_length);
if ((IW_AUTH_KEY_MGMT_802_1X == pWextState->authKeyMgmt)
@@ -4007,8 +3936,7 @@ static int __iw_set_encode(struct net_device *dev, struct iw_request_info *info,
eCSR_ENCRYPT_TYPE_WEP104_STATICKEY;
}
} else {
- hddLog(QDF_TRACE_LEVEL_WARN,
- "%s: Invalid WEP key length :%d", __func__,
+ hdd_warn("Invalid WEP key length :%d",
key_length);
return -EINVAL;
}
@@ -4098,7 +4026,7 @@ static int __iw_get_encodeext(struct net_device *dev,
keyId = pRoamProfile->Keys.defaultIndex;
if (keyId < 0 || keyId >= MAX_WEP_KEYS) {
- hddLog(LOG1, "%s: Invalid keyId : %d", __func__, keyId);
+ hdd_notice("Invalid keyId : %d", keyId);
return -EINVAL;
}
@@ -4217,8 +4145,7 @@ static int __iw_set_encodeext(struct net_device *dev,
(IW_ENCODE_ALG_WEP == ext->alg)) {
if (IW_AUTH_KEY_MGMT_802_1X == pWextState->authKeyMgmt) {
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR,
- ("Invalid Configuration:%s"), __func__);
+ hdd_err("Invalid Configuration");
return -EINVAL;
} else {
/*Static wep, update the roam profile with the keys */
@@ -4325,9 +4252,8 @@ static int __iw_set_encodeext(struct net_device *dev,
break;
}
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO,
- ("%s:cipher_alg:%d key_len[%d] *pEncryptionType :%d"),
- __func__, (int)ext->alg, (int)ext->key_len, setKey.encType);
+ hdd_notice("cipher_alg:%d key_len:%d EncryptionType:%d",
+ (int)ext->alg, (int)ext->key_len, setKey.encType);
/* The supplicant may attempt to set the PTK once
* pre-authentication is done. Save the key in the UMAC and
@@ -4336,12 +4262,10 @@ static int __iw_set_encodeext(struct net_device *dev,
qdf_ret_status = sme_ft_update_key(WLAN_HDD_GET_HAL_CTX(pAdapter),
pAdapter->sessionId, &setKey);
if (qdf_ret_status == QDF_STATUS_FT_PREAUTH_KEY_SUCCESS) {
- hddLog(QDF_TRACE_LEVEL_INFO_MED,
- "%s: Update PreAuth Key success", __func__);
+ hdd_info("Update PreAuth Key success");
return 0;
} else if (qdf_ret_status == QDF_STATUS_FT_PREAUTH_KEY_FAILED) {
- hddLog(QDF_TRACE_LEVEL_ERROR,
- "%s: Update PreAuth Key failed", __func__);
+ hdd_err("Update PreAuth Key failed");
return -EINVAL;
}
@@ -4352,8 +4276,7 @@ static int __iw_set_encodeext(struct net_device *dev,
&setKey, &roamId);
if (qdf_ret_status != QDF_STATUS_SUCCESS) {
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR,
- "[%4d] sme_roam_set_key returned ERROR status= %d",
+ hdd_err("[%4d] sme_roam_set_key returned ERROR status= %d",
__LINE__, qdf_ret_status);
pHddStaCtx->roam_info.roamingState = HDD_ROAM_STATE_NONE;
@@ -4411,8 +4334,7 @@ static int __iw_set_retry(struct net_device *dev, struct iw_request_info *info,
if (wrqu->retry.value < WNI_CFG_LONG_RETRY_LIMIT_STAMIN ||
wrqu->retry.value > WNI_CFG_LONG_RETRY_LIMIT_STAMAX) {
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR,
- ("Invalid Retry-Limit=%d!!"), wrqu->retry.value);
+ hdd_err("Invalid Retry-Limit=%d!!", wrqu->retry.value);
return -EINVAL;
}
@@ -4423,18 +4345,14 @@ static int __iw_set_retry(struct net_device *dev, struct iw_request_info *info,
if (sme_cfg_set_int (hHal, WNI_CFG_LONG_RETRY_LIMIT,
wrqu->retry.value) !=
QDF_STATUS_SUCCESS) {
- QDF_TRACE(QDF_MODULE_ID_HDD,
- QDF_TRACE_LEVEL_ERROR, FL
- ("failed to set ini parameter, WNI_CFG_LONG_RETRY_LIMIT"));
+ hdd_err("failed to set ini parameter, WNI_CFG_LONG_RETRY_LIMIT");
return -EIO;
}
} else if ((wrqu->retry.flags & IW_RETRY_SHORT)) {
if (sme_cfg_set_int (hHal, WNI_CFG_SHORT_RETRY_LIMIT,
wrqu->retry.value) !=
QDF_STATUS_SUCCESS) {
- QDF_TRACE(QDF_MODULE_ID_HDD,
- QDF_TRACE_LEVEL_ERROR, FL
- ("failed to set ini parameter, WNI_CFG_LONG_RETRY_LIMIT"));
+ hdd_err("failed to set ini parameter, WNI_CFG_LONG_RETRY_LIMIT");
return -EIO;
}
}
@@ -4442,8 +4360,7 @@ static int __iw_set_retry(struct net_device *dev, struct iw_request_info *info,
return -EOPNOTSUPP;
}
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO,
- ("Set Retry-Limit=%d!!"), wrqu->retry.value);
+ hdd_notice("Set Retry-Limit=%d!!", wrqu->retry.value);
EXIT();
@@ -4502,9 +4419,7 @@ static int __iw_get_retry(struct net_device *dev, struct iw_request_info *info,
if (sme_cfg_get_int(hHal, WNI_CFG_LONG_RETRY_LIMIT, &retry) !=
QDF_STATUS_SUCCESS) {
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_WARN,
- FL
- ("failed to get ini parameter, WNI_CFG_LONG_RETRY_LIMIT"));
+ hdd_warn("failed to get ini parameter, WNI_CFG_LONG_RETRY_LIMIT");
return -EIO;
}
@@ -4514,9 +4429,7 @@ static int __iw_get_retry(struct net_device *dev, struct iw_request_info *info,
if (sme_cfg_get_int(hHal, WNI_CFG_SHORT_RETRY_LIMIT, &retry) !=
QDF_STATUS_SUCCESS) {
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_WARN,
- FL
- ("failed to get ini parameter, WNI_CFG_LONG_RETRY_LIMIT"));
+ hdd_warn("failed to get ini parameter, WNI_CFG_LONG_RETRY_LIMIT");
return -EIO;
}
@@ -4525,8 +4438,7 @@ static int __iw_get_retry(struct net_device *dev, struct iw_request_info *info,
return -EOPNOTSUPP;
}
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, ("Retry-Limit=%d!!"),
- retry);
+ hdd_notice("Retry-Limit=%d!!", retry);
EXIT();
@@ -4608,33 +4520,28 @@ static int __iw_set_mlme(struct net_device *dev,
msecs_to_jiffies
(WLAN_WAIT_TIME_DISCONNECT));
if (!rc)
- hddLog(QDF_TRACE_LEVEL_ERROR,
- FL
- ("failed wait on disconnect_comp_var"));
+ hdd_err("failed wait on disconnect_comp_var");
} else
- hddLog(LOGE,
- "%s %d Command Disassociate/Deauthenticate : csr_roam_disconnect failure returned %d",
- __func__, (int)mlme->cmd, (int)status);
+ hdd_err("%d Command Disassociate/Deauthenticate : csr_roam_disconnect failure returned %d",
+ (int)mlme->cmd, (int)status);
/* Resetting authKeyMgmt */
(WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter))->authKeyMgmt =
0;
- hddLog(LOG1, FL("Disabling queues"));
+ hdd_notice("Disabling queues");
wlan_hdd_netif_queue_control(pAdapter,
WLAN_NETIF_TX_DISABLE_N_CARRIER,
WLAN_CONTROL_PATH);
} else {
- hddLog(LOGE,
- "%s %d Command Disassociate/Deauthenticate called but station is not in associated state",
- __func__, (int)mlme->cmd);
+ hdd_err("%d Command Disassociate/Deauthenticate called but station is not in associated state",
+ (int)mlme->cmd);
}
break;
default:
- hddLog(LOGE,
- "%s %d Command should be Disassociate/Deauthenticate",
- __func__, (int)mlme->cmd);
+ hdd_err("%d Command should be Disassociate/Deauthenticate",
+ (int)mlme->cmd);
return -EINVAL;
} /* end of switch */
@@ -4717,8 +4624,7 @@ int wlan_hdd_update_phymode(struct net_device *net, tHalHandle hal,
}
vhtchanwidth = phddctx->config->vhtChannelWidth;
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_WARN, ("ch_bond24=%d "
- "ch_bond5g=%d band_24=%d band_5g=%d VHT_ch_width=%u"),
+ hdd_warn("ch_bond24=%d ch_bond5g=%d band_24=%d band_5g=%d VHT_ch_width=%u",
ch_bond24, ch_bond5g, band_24, band_5g, vhtchanwidth);
switch (new_phymode) {
@@ -4905,7 +4811,7 @@ int wlan_hdd_update_phymode(struct net_device *net, tHalHandle hal,
pAdapter->sessionId,
eHT_CHAN_HT20, false);
if (halStatus == QDF_STATUS_E_FAILURE) {
- hddLog(LOGE, FL("Failed to disable OBSS"));
+ hdd_err("Failed to disable OBSS");
return -EIO;
}
} else if (phymode == eCSR_DOT11_MODE_11n &&
@@ -4915,7 +4821,7 @@ int wlan_hdd_update_phymode(struct net_device *net, tHalHandle hal,
pAdapter->sessionId,
eHT_CHAN_HT20, true);
if (halStatus == QDF_STATUS_E_FAILURE) {
- hddLog(LOGE, FL("Failed to enable OBSS"));
+ hdd_err("Failed to enable OBSS");
return -EIO;
}
}
@@ -4946,8 +4852,7 @@ int wlan_hdd_update_phymode(struct net_device *net, tHalHandle hal,
smeconfig.csrConfig.channelBondingMode5GHz;
phddctx->config->vhtChannelWidth = vhtchanwidth;
if (hdd_update_config_dat(phddctx) == false) {
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR,
- "%s: could not update config_dat", __func__);
+ hdd_err("could not update config_dat");
return -EIO;
}
if (phddctx->config->nChannelBondingMode5GHz)
@@ -4957,8 +4862,7 @@ int wlan_hdd_update_phymode(struct net_device *net, tHalHandle hal,
phddctx->wiphy->bands[IEEE80211_BAND_5GHZ]->ht_cap.cap
&= ~IEEE80211_HT_CAP_SUP_WIDTH_20_40;
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_WARN,
- "New_Phymode= %d ch_bonding=%d band=%d VHT_ch_width=%u",
+ hdd_warn("New_Phymode= %d ch_bonding=%d band=%d VHT_ch_width=%u",
phymode, chwidth, curr_band, vhtchanwidth);
}
@@ -4982,7 +4886,7 @@ static void hdd_get_temperature_cb(int temperature, void *pContext)
hdd_adapter_t *pAdapter;
ENTER();
if (NULL == pContext) {
- hddLog(QDF_TRACE_LEVEL_ERROR, FL("pContext is NULL"));
+ hdd_err("pContext is NULL");
return;
}
pTempContext = pContext;
@@ -4990,8 +4894,7 @@ static void hdd_get_temperature_cb(int temperature, void *pContext)
spin_lock(&hdd_context_lock);
if ((NULL == pAdapter) || (TEMP_CONTEXT_MAGIC != pTempContext->magic)) {
spin_unlock(&hdd_context_lock);
- hddLog(QDF_TRACE_LEVEL_WARN,
- FL("Invalid context, pAdapter [%p] magic [%08x]"),
+ hdd_warn("Invalid context, pAdapter [%p] magic [%08x]",
pAdapter, pTempContext->magic);
return;
}
@@ -5020,7 +4923,7 @@ int wlan_hdd_get_temperature(hdd_adapter_t *pAdapter, int *temperature)
ENTER();
if (NULL == pAdapter) {
- hddLog(QDF_TRACE_LEVEL_ERROR, FL("pAdapter is NULL"));
+ hdd_err("pAdapter is NULL");
return -EPERM;
}
init_completion(&tempContext.completion);
@@ -5029,16 +4932,13 @@ int wlan_hdd_get_temperature(hdd_adapter_t *pAdapter, int *temperature)
status = sme_get_temperature(WLAN_HDD_GET_HAL_CTX(pAdapter),
&tempContext, hdd_get_temperature_cb);
if (QDF_STATUS_SUCCESS != status) {
- hddLog(QDF_TRACE_LEVEL_ERROR,
- FL("Unable to retrieve temperature"));
+ hdd_err("Unable to retrieve temperature");
} else {
rc = wait_for_completion_timeout(&tempContext.completion,
msecs_to_jiffies
(WLAN_WAIT_TIME_STATS));
if (!rc) {
- hddLog(QDF_TRACE_LEVEL_ERROR,
- FL
- ("SME timed out while retrieving temperature"));
+ hdd_err("SME timed out while retrieving temperature");
}
}
spin_lock(&hdd_context_lock);
@@ -5095,9 +4995,7 @@ static int __iw_setint_getnone(struct net_device *dev,
smeConfig.csrConfig.Is11dSupportEnabled =
(bool) set_value;
- QDF_TRACE(QDF_MODULE_ID_HDD,
- QDF_TRACE_LEVEL_INFO,
- ("11D state=%d!!"),
+ hdd_notice("11D state=%d!!",
smeConfig.csrConfig.
Is11dSupportEnabled);
@@ -5119,14 +5017,13 @@ static int __iw_setint_getnone(struct net_device *dev,
case 0x03:
enable_mp = (set_value & 0x01) ? 1 : 0;
enable_pbm = (set_value & 0x02) ? 1 : 0;
- hddLog(LOGE,
- "magic packet ? = %s pattern byte matching ? = %s",
+ hdd_err("magic packet ? = %s pattern byte matching ? = %s",
(enable_mp ? "YES" : "NO"),
(enable_pbm ? "YES" : "NO"));
hdd_enter_wowl(pAdapter, enable_mp, enable_pbm);
break;
default:
- hddLog(LOGE, "Invalid arg %d in WE_WOWL IOCTL",
+ hdd_err("Invalid arg %d in WE_WOWL IOCTL",
set_value);
ret = -EINVAL;
break;
@@ -5154,8 +5051,7 @@ static int __iw_setint_getnone(struct net_device *dev,
sme_ps_uapsd_disable(hHal, pAdapter->sessionId);
break;
default:
- hddLog(LOGE,
- "Invalid arg %d in WE_SET_POWER IOCTL",
+ hdd_err("Invalid arg %d in WE_SET_POWER IOCTL",
set_value);
ret = -EINVAL;
break;
@@ -5171,9 +5067,7 @@ static int __iw_setint_getnone(struct net_device *dev,
} else if (sme_cfg_set_int(hHal, WNI_CFG_ASSOC_STA_LIMIT,
set_value)
!= QDF_STATUS_SUCCESS) {
- QDF_TRACE(QDF_MODULE_ID_HDD,
- QDF_TRACE_LEVEL_ERROR, FL
- ("failed to set ini parameter, WNI_CFG_ASSOC_STA_LIMIT"));
+ hdd_err("failed to set ini parameter, WNI_CFG_ASSOC_STA_LIMIT");
ret = -EIO;
}
break;
@@ -5188,19 +5082,15 @@ static int __iw_setint_getnone(struct net_device *dev,
break;
case WE_SET_DATA_INACTIVITY_TO:
- {
if ((set_value < CFG_DATA_INACTIVITY_TIMEOUT_MIN) ||
(set_value > CFG_DATA_INACTIVITY_TIMEOUT_MAX) ||
(sme_cfg_set_int((WLAN_HDD_GET_CTX(pAdapter))->hHal,
WNI_CFG_PS_DATA_INACTIVITY_TIMEOUT,
set_value) == QDF_STATUS_E_FAILURE)) {
- hddLog(LOGE, "Failure: Could not pass on "
- "WNI_CFG_PS_DATA_INACTIVITY_TIMEOUT configuration info "
- "to CCM");
+ hdd_err("Failure: Could not pass on WNI_CFG_PS_DATA_INACTIVITY_TIMEOUT configuration info to SME");
ret = -EINVAL;
}
break;
- }
case WE_SET_MC_RATE:
{
ret = wlan_hdd_set_mc_rate(pAdapter, set_value);
@@ -5215,8 +5105,7 @@ static int __iw_setint_getnone(struct net_device *dev,
(hHal, pAdapter->sessionId, bssid,
pAdapter->device_mode,
set_value) != QDF_STATUS_SUCCESS) {
- hddLog(QDF_TRACE_LEVEL_ERROR,
- "%s: Setting tx power failed", __func__);
+ hdd_err("Setting tx power failed");
return -EIO;
}
break;
@@ -5226,17 +5115,14 @@ static int __iw_setint_getnone(struct net_device *dev,
struct qdf_mac_addr bssid;
struct qdf_mac_addr selfMac;
- hddLog(QDF_TRACE_LEVEL_INFO,
- "%s: Setting maximum tx power %d dBm", __func__,
+ hdd_notice("Setting maximum tx power %d dBm",
set_value);
qdf_copy_macaddr(&bssid, &pHddStaCtx->conn_info.bssId);
qdf_copy_macaddr(&selfMac, &pHddStaCtx->conn_info.bssId);
if (sme_set_max_tx_power(hHal, bssid, selfMac, set_value)
!= QDF_STATUS_SUCCESS) {
- hddLog(QDF_TRACE_LEVEL_ERROR,
- "%s: Setting maximum tx power failed",
- __func__);
+ hdd_err("Setting maximum tx power failed");
return -EIO;
}
@@ -5244,14 +5130,11 @@ static int __iw_setint_getnone(struct net_device *dev,
}
case WE_SET_MAX_TX_POWER_2_4:
{
- hddLog(QDF_TRACE_LEVEL_INFO,
- "%s: Setting maximum tx power %d dBm for 2.4 GHz band",
- __func__, set_value);
+ hdd_notice("Setting maximum tx power %d dBm for 2.4 GHz band",
+ set_value);
if (sme_set_max_tx_power_per_band(eCSR_BAND_24, set_value) !=
QDF_STATUS_SUCCESS) {
- hddLog(QDF_TRACE_LEVEL_ERROR,
- "%s: Setting maximum tx power failed for 2.4 GHz band",
- __func__);
+ hdd_err("Setting maximum tx power failed for 2.4 GHz band");
return -EIO;
}
@@ -5259,14 +5142,11 @@ static int __iw_setint_getnone(struct net_device *dev,
}
case WE_SET_MAX_TX_POWER_5_0:
{
- hddLog(QDF_TRACE_LEVEL_INFO,
- "%s: Setting maximum tx power %d dBm for 5.0 GHz band",
- __func__, set_value);
+ hdd_notice("Setting maximum tx power %d dBm for 5.0 GHz band",
+ set_value);
if (sme_set_max_tx_power_per_band(eCSR_BAND_5G, set_value) !=
QDF_STATUS_SUCCESS) {
- hddLog(QDF_TRACE_LEVEL_ERROR,
- "%s: Setting maximum tx power failed for 5.0 GHz band",
- __func__);
+ hdd_err("Setting maximum tx power failed for 5.0 GHz band");
return -EIO;
}
@@ -5275,16 +5155,14 @@ static int __iw_setint_getnone(struct net_device *dev,
case WE_SET_HIGHER_DTIM_TRANSITION:
{
if (!((set_value == false) || (set_value == true))) {
- hddLog(LOGE, "Dynamic DTIM Incorrect data:%d",
+ hdd_err("Dynamic DTIM Incorrect data:%d",
set_value);
ret = -EINVAL;
} else {
if (pAdapter->higherDtimTransition != set_value) {
pAdapter->higherDtimTransition =
set_value;
- hddLog(LOG1,
- "%s: higherDtimTransition set to :%d",
- __func__,
+ hdd_notice("higherDtimTransition set to :%d",
pAdapter->higherDtimTransition);
}
}
@@ -5294,8 +5172,7 @@ static int __iw_setint_getnone(struct net_device *dev,
case WE_SET_TM_LEVEL:
{
- hddLog(QDF_TRACE_LEVEL_INFO,
- "Set Thermal Mitigation Level %d", set_value);
+ hdd_notice("Set Thermal Mitigation Level %d", set_value);
(void)sme_set_thermal_level(hHal, set_value);
break;
}
@@ -5312,9 +5189,9 @@ static int __iw_setint_getnone(struct net_device *dev,
case WE_SET_NSS:
{
- hddLog(LOG1, "Set NSS = %d", set_value);
+ hdd_notice("Set NSS = %d", set_value);
if ((set_value > 2) || (set_value <= 0)) {
- hddLog(LOGE, "NSS greater than 2 not supported");
+ hdd_err("NSS greater than 2 not supported");
ret = -EINVAL;
} else {
if (QDF_STATUS_SUCCESS !=
@@ -5327,7 +5204,7 @@ static int __iw_setint_getnone(struct net_device *dev,
case WE_SET_GTX_HT_MCS:
{
- hddLog(LOG1, "WMI_VDEV_PARAM_GTX_HT_MCS %d", set_value);
+ hdd_notice("WMI_VDEV_PARAM_GTX_HT_MCS %d", set_value);
ret = wma_cli_set_command(pAdapter->sessionId,
WMI_VDEV_PARAM_GTX_HT_MCS,
set_value, GTX_CMD);
@@ -5336,7 +5213,7 @@ static int __iw_setint_getnone(struct net_device *dev,
case WE_SET_GTX_VHT_MCS:
{
- hddLog(LOG1, "WMI_VDEV_PARAM_GTX_VHT_MCS %d",
+ hdd_notice("WMI_VDEV_PARAM_GTX_VHT_MCS %d",
set_value);
ret = wma_cli_set_command(pAdapter->sessionId,
WMI_VDEV_PARAM_GTX_VHT_MCS,
@@ -5346,7 +5223,7 @@ static int __iw_setint_getnone(struct net_device *dev,
case WE_SET_GTX_USRCFG:
{
- hddLog(LOG1, "WMI_VDEV_PARAM_GTX_USR_CFG %d",
+ hdd_notice("WMI_VDEV_PARAM_GTX_USR_CFG %d",
set_value);
ret = wma_cli_set_command(pAdapter->sessionId,
WMI_VDEV_PARAM_GTX_USR_CFG,
@@ -5356,7 +5233,7 @@ static int __iw_setint_getnone(struct net_device *dev,
case WE_SET_GTX_THRE:
{
- hddLog(LOG1, "WMI_VDEV_PARAM_GTX_THRE %d", set_value);
+ hdd_notice("WMI_VDEV_PARAM_GTX_THRE %d", set_value);
ret = wma_cli_set_command(pAdapter->sessionId,
WMI_VDEV_PARAM_GTX_THRE,
set_value, GTX_CMD);
@@ -5365,7 +5242,7 @@ static int __iw_setint_getnone(struct net_device *dev,
case WE_SET_GTX_MARGIN:
{
- hddLog(LOG1, "WMI_VDEV_PARAM_GTX_MARGIN %d", set_value);
+ hdd_notice("WMI_VDEV_PARAM_GTX_MARGIN %d", set_value);
ret = wma_cli_set_command(pAdapter->sessionId,
WMI_VDEV_PARAM_GTX_MARGIN,
set_value, GTX_CMD);
@@ -5374,7 +5251,7 @@ static int __iw_setint_getnone(struct net_device *dev,
case WE_SET_GTX_STEP:
{
- hddLog(LOG1, "WMI_VDEV_PARAM_GTX_STEP %d", set_value);
+ hdd_notice("WMI_VDEV_PARAM_GTX_STEP %d", set_value);
ret = wma_cli_set_command(pAdapter->sessionId,
WMI_VDEV_PARAM_GTX_STEP,
set_value, GTX_CMD);
@@ -5383,7 +5260,7 @@ static int __iw_setint_getnone(struct net_device *dev,
case WE_SET_GTX_MINTPC:
{
- hddLog(LOG1, "WMI_VDEV_PARAM_GTX_MINTPC %d", set_value);
+ hdd_notice("WMI_VDEV_PARAM_GTX_MINTPC %d", set_value);
ret = wma_cli_set_command(pAdapter->sessionId,
WMI_VDEV_PARAM_GTX_MINTPC,
set_value, GTX_CMD);
@@ -5392,7 +5269,7 @@ static int __iw_setint_getnone(struct net_device *dev,
case WE_SET_GTX_BWMASK:
{
- hddLog(LOG1, "WMI_VDEV_PARAM_GTX_BWMASK %d", set_value);
+ hdd_notice("WMI_VDEV_PARAM_GTX_BWMASK %d", set_value);
ret = wma_cli_set_command(pAdapter->sessionId,
WMI_VDEV_PARAM_GTX_BW_MASK,
set_value, GTX_CMD);
@@ -5407,14 +5284,11 @@ static int __iw_setint_getnone(struct net_device *dev,
tSirMacHTCapabilityInfo htCapInfo;
} uHTCapabilityInfo;
- hddLog(LOG1, "LDPC val %d", set_value);
+ hdd_notice("LDPC val %d", set_value);
/* get the HT capability info */
ret = sme_cfg_get_int(hHal, WNI_CFG_HT_CAP_INFO, &value);
if (QDF_STATUS_SUCCESS != ret) {
- QDF_TRACE(QDF_MODULE_ID_HDD,
- QDF_TRACE_LEVEL_ERROR,
- "%s: could not get HT capability info",
- __func__);
+ hdd_err("could not get HT capability info");
return -EIO;
}
@@ -5430,9 +5304,7 @@ static int __iw_setint_getnone(struct net_device *dev,
}
if (ret)
- QDF_TRACE(QDF_MODULE_ID_HDD,
- QDF_TRACE_LEVEL_ERROR,
- "Failed to set LDPC value");
+ hdd_err("Failed to set LDPC value");
break;
}
@@ -5445,14 +5317,11 @@ static int __iw_setint_getnone(struct net_device *dev,
tSirMacHTCapabilityInfo htCapInfo;
} uHTCapabilityInfo;
- hddLog(LOG1, "TX_STBC val %d", set_value);
+ hdd_notice("TX_STBC val %d", set_value);
/* get the HT capability info */
ret = sme_cfg_get_int(hHal, WNI_CFG_HT_CAP_INFO, &value);
if (QDF_STATUS_SUCCESS != ret) {
- QDF_TRACE(QDF_MODULE_ID_HDD,
- QDF_TRACE_LEVEL_ERROR,
- "%s: could not get HT capability info",
- __func__);
+ hdd_err("could not get HT capability info");
return -EIO;
}
@@ -5467,9 +5336,7 @@ static int __iw_setint_getnone(struct net_device *dev,
}
if (ret)
- QDF_TRACE(QDF_MODULE_ID_HDD,
- QDF_TRACE_LEVEL_ERROR,
- "Failed to set TX STBC value");
+ hdd_err("Failed to set TX STBC value");
break;
}
@@ -5482,15 +5349,12 @@ static int __iw_setint_getnone(struct net_device *dev,
tSirMacHTCapabilityInfo htCapInfo;
} uHTCapabilityInfo;
- hddLog(LOG1, "WMI_VDEV_PARAM_RX_STBC val %d",
+ hdd_notice("WMI_VDEV_PARAM_RX_STBC val %d",
set_value);
/* get the HT capability info */
ret = sme_cfg_get_int(hHal, WNI_CFG_HT_CAP_INFO, &value);
if (QDF_STATUS_SUCCESS != ret) {
- QDF_TRACE(QDF_MODULE_ID_QDF,
- QDF_TRACE_LEVEL_ERROR,
- "%s: could not get HT capability info",
- __func__);
+ hdd_err("could not get HT capability info");
return -EIO;
}
@@ -5507,22 +5371,18 @@ static int __iw_setint_getnone(struct net_device *dev,
}
if (ret)
- QDF_TRACE(QDF_MODULE_ID_HDD,
- QDF_TRACE_LEVEL_ERROR,
- "Failed to set RX STBC value");
+ hdd_err("Failed to set RX STBC value");
break;
}
case WE_SET_SHORT_GI:
{
- hddLog(LOG1, "WMI_VDEV_PARAM_SGI val %d", set_value);
+ hdd_notice("WMI_VDEV_PARAM_SGI val %d", set_value);
ret = sme_update_ht_config(hHal, pAdapter->sessionId,
WNI_CFG_HT_CAP_INFO_SHORT_GI_20MHZ,
set_value);
if (ret)
- QDF_TRACE(QDF_MODULE_ID_HDD,
- QDF_TRACE_LEVEL_ERROR,
- "Failed to set ShortGI value");
+ hdd_err("Failed to set ShortGI value");
break;
}
@@ -5530,7 +5390,7 @@ static int __iw_setint_getnone(struct net_device *dev,
{
uint32_t value;
- hddLog(LOG1, "WMI_VDEV_PARAM_ENABLE_RTSCTS val 0x%x",
+ hdd_notice("WMI_VDEV_PARAM_ENABLE_RTSCTS val 0x%x",
set_value);
if ((set_value & HDD_RTSCTS_EN_MASK) ==
@@ -5552,7 +5412,7 @@ static int __iw_setint_getnone(struct net_device *dev,
if (sme_cfg_set_int
(hHal, WNI_CFG_RTS_THRESHOLD, value) !=
QDF_STATUS_SUCCESS) {
- hddLog(LOGE, "FAILED TO SET RTSCTS");
+ hdd_err("FAILED TO SET RTSCTS");
return -EIO;
}
}
@@ -5565,11 +5425,10 @@ static int __iw_setint_getnone(struct net_device *dev,
bool chwidth = false;
hdd_context_t *phddctx = WLAN_HDD_GET_CTX(pAdapter);
/*updating channel bonding only on 5Ghz */
- hddLog(LOG1, "WMI_VDEV_PARAM_CHWIDTH val %d",
+ hdd_notice("WMI_VDEV_PARAM_CHWIDTH val %d",
set_value);
if (set_value > eHT_CHANNEL_WIDTH_80MHZ) {
- hddLog(LOGE,
- "Invalid channel width 0->20 1->40 2->80");
+ hdd_err("Invalid channel width 0->20 1->40 2->80");
return -EINVAL;
}
@@ -5620,7 +5479,7 @@ static int __iw_setint_getnone(struct net_device *dev,
case WE_SET_ANI_EN_DIS:
{
- hddLog(LOG1, "WMI_PDEV_PARAM_ANI_ENABLE val %d",
+ hdd_notice("WMI_PDEV_PARAM_ANI_ENABLE val %d",
set_value);
ret = wma_cli_set_command(pAdapter->sessionId,
WMI_PDEV_PARAM_ANI_ENABLE,
@@ -5630,7 +5489,7 @@ static int __iw_setint_getnone(struct net_device *dev,
case WE_SET_ANI_POLL_PERIOD:
{
- hddLog(LOG1, "WMI_PDEV_PARAM_ANI_POLL_PERIOD val %d",
+ hdd_notice("WMI_PDEV_PARAM_ANI_POLL_PERIOD val %d",
set_value);
ret = wma_cli_set_command(pAdapter->sessionId,
WMI_PDEV_PARAM_ANI_POLL_PERIOD,
@@ -5640,7 +5499,7 @@ static int __iw_setint_getnone(struct net_device *dev,
case WE_SET_ANI_LISTEN_PERIOD:
{
- hddLog(LOG1, "WMI_PDEV_PARAM_ANI_LISTEN_PERIOD val %d",
+ hdd_notice("WMI_PDEV_PARAM_ANI_LISTEN_PERIOD val %d",
set_value);
ret = wma_cli_set_command(pAdapter->sessionId,
WMI_PDEV_PARAM_ANI_LISTEN_PERIOD,
@@ -5650,7 +5509,7 @@ static int __iw_setint_getnone(struct net_device *dev,
case WE_SET_ANI_OFDM_LEVEL:
{
- hddLog(LOG1, "WMI_PDEV_PARAM_ANI_OFDM_LEVEL val %d",
+ hdd_notice("WMI_PDEV_PARAM_ANI_OFDM_LEVEL val %d",
set_value);
ret = wma_cli_set_command(pAdapter->sessionId,
WMI_PDEV_PARAM_ANI_OFDM_LEVEL,
@@ -5660,7 +5519,7 @@ static int __iw_setint_getnone(struct net_device *dev,
case WE_SET_ANI_CCK_LEVEL:
{
- hddLog(LOG1, "WMI_PDEV_PARAM_ANI_CCK_LEVEL val %d",
+ hdd_notice("WMI_PDEV_PARAM_ANI_CCK_LEVEL val %d",
set_value);
ret = wma_cli_set_command(pAdapter->sessionId,
WMI_PDEV_PARAM_ANI_CCK_LEVEL,
@@ -5670,7 +5529,7 @@ static int __iw_setint_getnone(struct net_device *dev,
case WE_SET_DYNAMIC_BW:
{
- hddLog(LOG1, "WMI_PDEV_PARAM_DYNAMIC_BW val %d",
+ hdd_notice("WMI_PDEV_PARAM_DYNAMIC_BW val %d",
set_value);
ret = wma_cli_set_command(pAdapter->sessionId,
WMI_PDEV_PARAM_DYNAMIC_BW,
@@ -5680,7 +5539,7 @@ static int __iw_setint_getnone(struct net_device *dev,
case WE_SET_CTS_CBW:
{
- hddLog(LOG1, "WE_SET_CTS_CBW val %d", set_value);
+ hdd_notice("WE_SET_CTS_CBW val %d", set_value);
ret = wma_cli_set_command(pAdapter->sessionId,
WMI_PDEV_PARAM_CTS_CBW,
set_value, PDEV_CMD);
@@ -5690,7 +5549,7 @@ static int __iw_setint_getnone(struct net_device *dev,
case WE_SET_11N_RATE:
{
uint8_t preamble = 0, nss = 0, rix = 0;
- hddLog(LOG1, "WMI_VDEV_PARAM_FIXED_RATE val %d",
+ hdd_notice("WMI_VDEV_PARAM_FIXED_RATE val %d",
set_value);
if (set_value != 0xff) {
@@ -5747,7 +5606,7 @@ static int __iw_setint_getnone(struct net_device *dev,
case WE_SET_AMPDU:
{
- hddLog(LOG1, "SET AMPDU val %d", set_value);
+ hdd_notice("SET AMPDU val %d", set_value);
ret = wma_cli_set_command(pAdapter->sessionId,
GEN_VDEV_PARAM_AMPDU,
set_value, GEN_CMD);
@@ -5756,7 +5615,7 @@ static int __iw_setint_getnone(struct net_device *dev,
case WE_SET_AMSDU:
{
- hddLog(LOG1, "SET AMSDU val %d", set_value);
+ hdd_notice("SET AMSDU val %d", set_value);
ret = wma_cli_set_command(pAdapter->sessionId,
GEN_VDEV_PARAM_AMSDU,
set_value, GEN_CMD);
@@ -5765,7 +5624,7 @@ static int __iw_setint_getnone(struct net_device *dev,
case WE_SET_BURST_ENABLE:
{
- hddLog(LOG1, "SET Burst enable val %d", set_value);
+ hdd_notice("SET Burst enable val %d", set_value);
if ((set_value == 0) || (set_value == 1)) {
ret = wma_cli_set_command(pAdapter->sessionId,
WMI_PDEV_PARAM_BURST_ENABLE,
@@ -5776,7 +5635,7 @@ static int __iw_setint_getnone(struct net_device *dev,
}
case WE_SET_BURST_DUR:
{
- hddLog(LOG1, "SET Burst duration val %d", set_value);
+ hdd_notice("SET Burst duration val %d", set_value);
if ((set_value > 0) && (set_value <= 8192))
ret = wma_cli_set_command(pAdapter->sessionId,
WMI_PDEV_PARAM_BURST_DUR,
@@ -5788,7 +5647,7 @@ static int __iw_setint_getnone(struct net_device *dev,
case WE_SET_TX_CHAINMASK:
{
- hddLog(LOG1, "WMI_PDEV_PARAM_TX_CHAIN_MASK val %d",
+ hdd_notice("WMI_PDEV_PARAM_TX_CHAIN_MASK val %d",
set_value);
ret = wma_cli_set_command(pAdapter->sessionId,
WMI_PDEV_PARAM_TX_CHAIN_MASK,
@@ -5798,7 +5657,7 @@ static int __iw_setint_getnone(struct net_device *dev,
case WE_SET_RX_CHAINMASK:
{
- hddLog(LOG1, "WMI_PDEV_PARAM_RX_CHAIN_MASK val %d",
+ hdd_notice("WMI_PDEV_PARAM_RX_CHAIN_MASK val %d",
set_value);
ret = wma_cli_set_command(pAdapter->sessionId,
WMI_PDEV_PARAM_RX_CHAIN_MASK,
@@ -5808,7 +5667,7 @@ static int __iw_setint_getnone(struct net_device *dev,
case WE_SET_TXPOW_2G:
{
- hddLog(LOG1, "WMI_PDEV_PARAM_TXPOWER_LIMIT2G val %d",
+ hdd_notice("WMI_PDEV_PARAM_TXPOWER_LIMIT2G val %d",
set_value);
ret = wma_cli_set_command(pAdapter->sessionId,
WMI_PDEV_PARAM_TXPOWER_LIMIT2G,
@@ -5818,7 +5677,7 @@ static int __iw_setint_getnone(struct net_device *dev,
case WE_SET_TXPOW_5G:
{
- hddLog(LOG1, "WMI_PDEV_PARAM_TXPOWER_LIMIT5G val %d",
+ hdd_notice("WMI_PDEV_PARAM_TXPOWER_LIMIT5G val %d",
set_value);
ret = wma_cli_set_command(pAdapter->sessionId,
WMI_PDEV_PARAM_TXPOWER_LIMIT5G,
@@ -5829,7 +5688,7 @@ static int __iw_setint_getnone(struct net_device *dev,
/* Firmware debug log */
case WE_DBGLOG_LOG_LEVEL:
{
- hddLog(LOG1, "WE_DBGLOG_LOG_LEVEL val %d", set_value);
+ hdd_notice("WE_DBGLOG_LOG_LEVEL val %d", set_value);
hdd_ctx->fw_log_settings.dl_loglevel = set_value;
ret = wma_cli_set_command(pAdapter->sessionId,
WMI_DBGLOG_LOG_LEVEL,
@@ -5839,7 +5698,7 @@ static int __iw_setint_getnone(struct net_device *dev,
case WE_DBGLOG_VAP_ENABLE:
{
- hddLog(LOG1, "WE_DBGLOG_VAP_ENABLE val %d", set_value);
+ hdd_notice("WE_DBGLOG_VAP_ENABLE val %d", set_value);
ret = wma_cli_set_command(pAdapter->sessionId,
WMI_DBGLOG_VAP_ENABLE,
set_value, DBG_CMD);
@@ -5848,7 +5707,7 @@ static int __iw_setint_getnone(struct net_device *dev,
case WE_DBGLOG_VAP_DISABLE:
{
- hddLog(LOG1, "WE_DBGLOG_VAP_DISABLE val %d", set_value);
+ hdd_notice("WE_DBGLOG_VAP_DISABLE val %d", set_value);
ret = wma_cli_set_command(pAdapter->sessionId,
WMI_DBGLOG_VAP_DISABLE,
set_value, DBG_CMD);
@@ -5857,7 +5716,7 @@ static int __iw_setint_getnone(struct net_device *dev,
case WE_DBGLOG_MODULE_ENABLE:
{
- hddLog(LOG1, "WE_DBGLOG_MODULE_ENABLE val %d",
+ hdd_notice("WE_DBGLOG_MODULE_ENABLE val %d",
set_value);
hdd_ctx->fw_log_settings.enable = set_value;
ret = wma_cli_set_command(pAdapter->sessionId,
@@ -5868,7 +5727,7 @@ static int __iw_setint_getnone(struct net_device *dev,
case WE_DBGLOG_MODULE_DISABLE:
{
- hddLog(LOG1, "WE_DBGLOG_MODULE_DISABLE val %d",
+ hdd_notice("WE_DBGLOG_MODULE_DISABLE val %d",
set_value);
hdd_ctx->fw_log_settings.enable = set_value;
ret = wma_cli_set_command(pAdapter->sessionId,
@@ -5878,7 +5737,7 @@ static int __iw_setint_getnone(struct net_device *dev,
}
case WE_DBGLOG_MOD_LOG_LEVEL:
{
- hddLog(LOG1, "WE_DBGLOG_MOD_LOG_LEVEL val %d",
+ hdd_notice("WE_DBGLOG_MOD_LOG_LEVEL val %d",
set_value);
if (hdd_ctx->fw_log_settings.index >= MAX_MOD_LOGLEVEL)
@@ -5897,7 +5756,7 @@ static int __iw_setint_getnone(struct net_device *dev,
case WE_DBGLOG_TYPE:
{
- hddLog(LOG1, "WE_DBGLOG_TYPE val %d", set_value);
+ hdd_notice("WE_DBGLOG_TYPE val %d", set_value);
hdd_ctx->fw_log_settings.dl_type = set_value;
ret = wma_cli_set_command(pAdapter->sessionId,
WMI_DBGLOG_TYPE,
@@ -5906,7 +5765,7 @@ static int __iw_setint_getnone(struct net_device *dev,
}
case WE_DBGLOG_REPORT_ENABLE:
{
- hddLog(LOG1, "WE_DBGLOG_REPORT_ENABLE val %d",
+ hdd_notice("WE_DBGLOG_REPORT_ENABLE val %d",
set_value);
hdd_ctx->fw_log_settings.dl_report = set_value;
ret = wma_cli_set_command(pAdapter->sessionId,
@@ -5917,7 +5776,7 @@ static int __iw_setint_getnone(struct net_device *dev,
case WE_SET_TXRX_FWSTATS:
{
- hddLog(LOG1, "WE_SET_TXRX_FWSTATS val %d", set_value);
+ hdd_notice("WE_SET_TXRX_FWSTATS val %d", set_value);
ret = wma_cli_set_command(pAdapter->sessionId,
WMA_VDEV_TXRX_FWSTATS_ENABLE_CMDID,
set_value, VDEV_CMD);
@@ -5926,7 +5785,7 @@ static int __iw_setint_getnone(struct net_device *dev,
case WE_TXRX_FWSTATS_RESET:
{
- hddLog(LOG1, "WE_TXRX_FWSTATS_RESET val %d", set_value);
+ hdd_notice("WE_TXRX_FWSTATS_RESET val %d", set_value);
ret = wma_cli_set_command(pAdapter->sessionId,
WMA_VDEV_TXRX_FWSTATS_RESET_CMDID,
set_value, VDEV_CMD);
@@ -5935,14 +5794,14 @@ static int __iw_setint_getnone(struct net_device *dev,
case WE_DUMP_STATS:
{
- hddLog(LOG1, "WE_DUMP_STATS val %d", set_value);
+ hdd_notice("WE_DUMP_STATS val %d", set_value);
hdd_wlan_dump_stats(pAdapter, set_value);
break;
}
case WE_CLEAR_STATS:
{
- hddLog(LOG1, "WE_CLEAR_STATS val %d", set_value);
+ hdd_notice("WE_CLEAR_STATS val %d", set_value);
switch (set_value) {
case WLAN_HDD_STATS:
memset(&pAdapter->stats, 0, sizeof(pAdapter->stats));
@@ -5955,6 +5814,9 @@ static int __iw_setint_getnone(struct net_device *dev,
case WLAN_HDD_NETIF_OPER_HISTORY:
wlan_hdd_clear_netif_queue_history(hdd_ctx);
break;
+ case WLAN_HIF_STATS:
+ hdd_clear_hif_stats();
+ break;
default:
ol_txrx_clear_stats(set_value);
}
@@ -5966,7 +5828,7 @@ static int __iw_setint_getnone(struct net_device *dev,
if (pAdapter->device_mode != QDF_STA_MODE)
return EINVAL;
- hddLog(LOG1, "WMI_VDEV_PPS_PAID_MATCH val %d ",
+ hdd_notice("WMI_VDEV_PPS_PAID_MATCH val %d ",
set_value);
ret = wma_cli_set_command(pAdapter->sessionId,
WMI_VDEV_PPS_PAID_MATCH,
@@ -5978,7 +5840,7 @@ static int __iw_setint_getnone(struct net_device *dev,
{
if (pAdapter->device_mode != QDF_STA_MODE)
return EINVAL;
- hddLog(LOG1, "WMI_VDEV_PPS_GID_MATCH val %d ",
+ hdd_notice("WMI_VDEV_PPS_GID_MATCH val %d ",
set_value);
ret = wma_cli_set_command(pAdapter->sessionId,
WMI_VDEV_PPS_GID_MATCH,
@@ -5990,7 +5852,7 @@ static int __iw_setint_getnone(struct net_device *dev,
{
if (pAdapter->device_mode != QDF_STA_MODE)
return EINVAL;
- hddLog(LOG1, " WMI_VDEV_PPS_EARLY_TIM_CLEAR val %d ",
+ hdd_notice(" WMI_VDEV_PPS_EARLY_TIM_CLEAR val %d ",
set_value);
ret = wma_cli_set_command(pAdapter->sessionId,
WMI_VDEV_PPS_EARLY_TIM_CLEAR,
@@ -6002,7 +5864,7 @@ static int __iw_setint_getnone(struct net_device *dev,
{
if (pAdapter->device_mode != QDF_STA_MODE)
return EINVAL;
- hddLog(LOG1, "WMI_VDEV_PPS_EARLY_DTIM_CLEAR val %d",
+ hdd_notice("WMI_VDEV_PPS_EARLY_DTIM_CLEAR val %d",
set_value);
ret = wma_cli_set_command(pAdapter->sessionId,
WMI_VDEV_PPS_EARLY_DTIM_CLEAR,
@@ -6014,7 +5876,7 @@ static int __iw_setint_getnone(struct net_device *dev,
{
if (pAdapter->device_mode != QDF_STA_MODE)
return EINVAL;
- hddLog(LOG1, "WMI_VDEV_PPS_EOF_PAD_DELIM val %d ",
+ hdd_notice("WMI_VDEV_PPS_EOF_PAD_DELIM val %d ",
set_value);
ret = wma_cli_set_command(pAdapter->sessionId,
WMI_VDEV_PPS_EOF_PAD_DELIM,
@@ -6026,7 +5888,7 @@ static int __iw_setint_getnone(struct net_device *dev,
{
if (pAdapter->device_mode != QDF_STA_MODE)
return EINVAL;
- hddLog(LOG1, "WMI_VDEV_PPS_MACADDR_MISMATCH val %d ",
+ hdd_notice("WMI_VDEV_PPS_MACADDR_MISMATCH val %d ",
set_value);
ret = wma_cli_set_command(pAdapter->sessionId,
WMI_VDEV_PPS_MACADDR_MISMATCH,
@@ -6038,7 +5900,7 @@ static int __iw_setint_getnone(struct net_device *dev,
{
if (pAdapter->device_mode != QDF_STA_MODE)
return EINVAL;
- hddLog(LOG1, "WMI_VDEV_PPS_DELIM_CRC_FAIL val %d ",
+ hdd_notice("WMI_VDEV_PPS_DELIM_CRC_FAIL val %d ",
set_value);
ret = wma_cli_set_command(pAdapter->sessionId,
WMI_VDEV_PPS_DELIM_CRC_FAIL,
@@ -6050,7 +5912,7 @@ static int __iw_setint_getnone(struct net_device *dev,
{
if (pAdapter->device_mode != QDF_STA_MODE)
return EINVAL;
- hddLog(LOG1, "WMI_VDEV_PPS_GID_NSTS_ZERO val %d ",
+ hdd_notice("WMI_VDEV_PPS_GID_NSTS_ZERO val %d ",
set_value);
ret = wma_cli_set_command(pAdapter->sessionId,
WMI_VDEV_PPS_GID_NSTS_ZERO,
@@ -6062,7 +5924,7 @@ static int __iw_setint_getnone(struct net_device *dev,
{
if (pAdapter->device_mode != QDF_STA_MODE)
return EINVAL;
- hddLog(LOG1, "WMI_VDEV_PPS_RSSI_CHECK val %d ",
+ hdd_notice("WMI_VDEV_PPS_RSSI_CHECK val %d ",
set_value);
ret = wma_cli_set_command(pAdapter->sessionId,
WMI_VDEV_PPS_RSSI_CHECK,
@@ -6075,7 +5937,7 @@ static int __iw_setint_getnone(struct net_device *dev,
if (pAdapter->device_mode != QDF_STA_MODE)
return -EINVAL;
- hddLog(LOG1, "WMI_VDEV_PPS_5G_EBT val %d", set_value);
+ hdd_notice("WMI_VDEV_PPS_5G_EBT val %d", set_value);
ret = wma_cli_set_command(pAdapter->sessionId,
WMI_VDEV_PPS_5G_EBT,
set_value, PPS_CMD);
@@ -6084,7 +5946,7 @@ static int __iw_setint_getnone(struct net_device *dev,
case WE_SET_HTSMPS:
{
- hddLog(LOG1, "WE_SET_HTSMPS val %d", set_value);
+ hdd_notice("WE_SET_HTSMPS val %d", set_value);
ret = wma_cli_set_command(pAdapter->sessionId,
WMI_STA_SMPS_FORCE_MODE_CMDID,
set_value, VDEV_CMD);
@@ -6093,7 +5955,7 @@ static int __iw_setint_getnone(struct net_device *dev,
case WE_SET_QPOWER_MAX_PSPOLL_COUNT:
{
- hddLog(LOG1, "WE_SET_QPOWER_MAX_PSPOLL_COUNT val %d",
+ hdd_notice("WE_SET_QPOWER_MAX_PSPOLL_COUNT val %d",
set_value);
ret = wma_cli_set_command(pAdapter->sessionId,
WMI_STA_PS_PARAM_QPOWER_PSPOLL_COUNT,
@@ -6103,7 +5965,7 @@ static int __iw_setint_getnone(struct net_device *dev,
case WE_SET_QPOWER_MAX_TX_BEFORE_WAKE:
{
- hddLog(LOG1, "WE_SET_QPOWER_MAX_TX_BEFORE_WAKE val %d",
+ hdd_notice("WE_SET_QPOWER_MAX_TX_BEFORE_WAKE val %d",
set_value);
ret = wma_cli_set_command(
pAdapter->sessionId,
@@ -6114,8 +5976,7 @@ static int __iw_setint_getnone(struct net_device *dev,
case WE_SET_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL:
{
- hddLog(LOG1,
- "WE_SET_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL val %d",
+ hdd_notice("WE_SET_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL val %d",
set_value);
ret = wma_cli_set_command(
pAdapter->sessionId,
@@ -6126,8 +5987,7 @@ static int __iw_setint_getnone(struct net_device *dev,
case WE_SET_QPOWER_SPEC_MAX_SPEC_NODATA_PSPOLL:
{
- hddLog(LOG1,
- "WE_SET_QPOWER_SPEC_MAX_SPEC_NODATA_PSPOLL val %d",
+ hdd_notice("WE_SET_QPOWER_SPEC_MAX_SPEC_NODATA_PSPOLL val %d",
set_value);
ret = wma_cli_set_command(
pAdapter->sessionId,
@@ -6144,7 +6004,7 @@ static int __iw_setint_getnone(struct net_device *dev,
case WE_MCC_CONFIG_QUOTA:
{
- hddLog(LOG1, "iwpriv cmd to set MCC quota with val %dms",
+ hdd_notice("iwpriv cmd to set MCC quota with val %dms",
set_value);
ret = cds_set_mcc_p2p_quota(pAdapter, set_value);
break;
@@ -6159,7 +6019,7 @@ static int __iw_setint_getnone(struct net_device *dev,
}
case WE_SET_EARLY_RX_ADJUST_ENABLE:
{
- hddLog(LOG1, "SET early_rx enable val %d", set_value);
+ hdd_notice("SET early_rx enable val %d", set_value);
if ((set_value == 0) || (set_value == 1))
ret = wma_cli_set_command(
pAdapter->sessionId,
@@ -6171,7 +6031,7 @@ static int __iw_setint_getnone(struct net_device *dev,
}
case WE_SET_EARLY_RX_TGT_BMISS_NUM:
{
- hddLog(LOG1, "SET early_rx bmiss val %d", set_value);
+ hdd_notice("SET early_rx bmiss val %d", set_value);
ret = wma_cli_set_command(pAdapter->sessionId,
WMI_VDEV_PARAM_EARLY_RX_TGT_BMISS_NUM,
set_value, VDEV_CMD);
@@ -6179,7 +6039,7 @@ static int __iw_setint_getnone(struct net_device *dev,
}
case WE_SET_EARLY_RX_BMISS_SAMPLE_CYCLE:
{
- hddLog(LOG1, "SET early_rx bmiss sample cycle %d",
+ hdd_notice("SET early_rx bmiss sample cycle %d",
set_value);
ret = wma_cli_set_command(
pAdapter->sessionId,
@@ -6189,7 +6049,7 @@ static int __iw_setint_getnone(struct net_device *dev,
}
case WE_SET_EARLY_RX_SLOP_STEP:
{
- hddLog(LOG1, "SET early_rx bmiss slop step val %d",
+ hdd_notice("SET early_rx bmiss slop step val %d",
set_value);
ret = wma_cli_set_command(pAdapter->sessionId,
WMI_VDEV_PARAM_EARLY_RX_SLOP_STEP,
@@ -6198,7 +6058,7 @@ static int __iw_setint_getnone(struct net_device *dev,
}
case WE_SET_EARLY_RX_INIT_SLOP:
{
- hddLog(LOG1, "SET early_rx init slop step val %d",
+ hdd_notice("SET early_rx init slop step val %d",
set_value);
ret = wma_cli_set_command(pAdapter->sessionId,
WMI_VDEV_PARAM_EARLY_RX_INIT_SLOP,
@@ -6207,7 +6067,7 @@ static int __iw_setint_getnone(struct net_device *dev,
}
case WE_SET_EARLY_RX_ADJUST_PAUSE:
{
- hddLog(LOG1, "SET early_rx adjust pause %d", set_value);
+ hdd_notice("SET early_rx adjust pause %d", set_value);
if ((set_value == 0) || (set_value == 1))
ret = wma_cli_set_command(
pAdapter->sessionId,
@@ -6219,7 +6079,7 @@ static int __iw_setint_getnone(struct net_device *dev,
}
case WE_SET_EARLY_RX_DRIFT_SAMPLE:
{
- hddLog(LOG1, "SET early_rx drift sample %d", set_value);
+ hdd_notice("SET early_rx drift sample %d", set_value);
ret = wma_cli_set_command(pAdapter->sessionId,
WMI_VDEV_PARAM_EARLY_RX_DRIFT_SAMPLE,
set_value, VDEV_CMD);
@@ -6227,13 +6087,13 @@ static int __iw_setint_getnone(struct net_device *dev,
}
case WE_SET_SCAN_DISABLE:
{
- hddLog(LOG1, "SET SCAN DISABLE %d", set_value);
+ hdd_notice("SET SCAN DISABLE %d", set_value);
sme_set_scan_disable(WLAN_HDD_GET_HAL_CTX(pAdapter), set_value);
break;
}
case WE_START_FW_PROFILE:
{
- hddLog(LOG1, "WE_START_FW_PROFILE %d", set_value);
+ hdd_notice("WE_START_FW_PROFILE %d", set_value);
ret = wma_cli_set_command(pAdapter->sessionId,
WMI_WLAN_PROFILE_TRIGGER_CMDID,
set_value, DBG_CMD);
@@ -6241,7 +6101,7 @@ static int __iw_setint_getnone(struct net_device *dev,
}
case WE_SET_CHANNEL:
{
- hddLog(LOG1, "Set Channel %d Session ID %d mode %d", set_value,
+ hdd_notice("Set Channel %d Session ID %d mode %d", set_value,
pAdapter->sessionId, pAdapter->device_mode);
if ((QDF_STA_MODE == pAdapter->device_mode) ||
@@ -6250,14 +6110,12 @@ static int __iw_setint_getnone(struct net_device *dev,
status = sme_ext_change_channel(hHal,
set_value, pAdapter->sessionId);
if (status != QDF_STATUS_SUCCESS) {
- hddLog(LOGE,
- FL("Error in change channel status %d"),
+ hdd_err("Error in change channel status %d",
status);
ret = -EINVAL;
}
} else {
- hddLog(LOGE,
- FL("change channel not supported for device mode %d"),
+ hdd_err("change channel not supported for device mode %d",
pAdapter->device_mode);
ret = -EINVAL;
}
@@ -6278,7 +6136,7 @@ static int __iw_setint_getnone(struct net_device *dev,
}
default:
{
- hddLog(LOGE, "%s: Invalid sub command %d", __func__,
+ hdd_err("Invalid sub command %d",
sub_cmd);
ret = -EINVAL;
break;
@@ -6326,7 +6184,7 @@ static int __iw_setnone_get_threeint(struct net_device *dev,
if (0 != ret)
return ret;
- hdd_info(FL("param = %d"), value[0]);
+ hdd_info("param = %d", value[0]);
switch (value[0]) {
case WE_GET_TSF:
ret = hdd_indicate_tsf(adapter, value, 3);
@@ -6386,8 +6244,7 @@ static int __iw_setchar_getnone(struct net_device *dev,
ENTER_DEV(dev);
if (!capable(CAP_NET_ADMIN)) {
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR,
- FL("permission check failed"));
+ hdd_err("permission check failed");
return -EPERM;
}
@@ -6411,23 +6268,20 @@ static int __iw_setchar_getnone(struct net_device *dev,
pBuffer = mem_alloc_copy_from_user_helper(s_priv_data.pointer,
s_priv_data.length);
if (NULL == pBuffer) {
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR,
- "mem_alloc_copy_from_user_helper fail");
+ hdd_err("mem_alloc_copy_from_user_helper fail");
return -ENOMEM;
}
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO,
- "%s: Received length %d", __func__, s_priv_data.length);
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO,
- "%s: Received data %s", __func__, pBuffer);
+ hdd_notice("Received length %d", s_priv_data.length);
+ hdd_notice("Received data %s", pBuffer);
switch (sub_cmd) {
case WE_WOWL_ADD_PTRN:
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, "ADD_PTRN");
+ hdd_notice("ADD_PTRN");
hdd_add_wowl_ptrn(pAdapter, pBuffer);
break;
case WE_WOWL_DEL_PTRN:
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, "DEL_PTRN");
+ hdd_notice("DEL_PTRN");
hdd_del_wowl_ptrn(pAdapter, pBuffer);
break;
case WE_NEIGHBOR_REPORT_REQUEST:
@@ -6436,9 +6290,7 @@ static int __iw_setchar_getnone(struct net_device *dev,
tRrmNeighborRspCallbackInfo callbackInfo;
if (pConfig->fRrmEnable) {
- QDF_TRACE(QDF_MODULE_ID_HDD,
- QDF_TRACE_LEVEL_INFO,
- "Neighbor Request");
+ hdd_notice("Neighbor Request");
neighborReq.no_ssid =
(s_priv_data.length - 1) ? false : true;
if (!neighborReq.no_ssid) {
@@ -6459,15 +6311,13 @@ static int __iw_setchar_getnone(struct net_device *dev,
&neighborReq,
&callbackInfo);
} else {
- hddLog(LOGE,
- "%s: Ignoring neighbor request as RRM is not enabled",
- __func__);
+ hdd_err("Ignoring neighbor request as RRM is not enabled");
ret = -EINVAL;
}
}
break;
case WE_SET_AP_WPS_IE:
- hddLog(LOGE, "Received WE_SET_AP_WPS_IE");
+ hdd_err("Received WE_SET_AP_WPS_IE");
sme_update_p2p_ie(WLAN_HDD_GET_HAL_CTX(pAdapter), pBuffer,
s_priv_data.length);
break;
@@ -6479,7 +6329,7 @@ static int __iw_setchar_getnone(struct net_device *dev,
break;
default:
{
- hddLog(LOGE, "%s: Invalid sub command %d", __func__,
+ hdd_err("Invalid sub command %d",
sub_cmd);
ret = -EINVAL;
break;
@@ -6537,15 +6387,13 @@ static int __iw_setnone_getint(struct net_device *dev,
*value = smeConfig.csrConfig.Is11dSupportEnabled;
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO,
- ("11D state=%d!!"), *value);
+ hdd_notice("11D state=%d!!", *value);
break;
}
case WE_IBSS_STATUS:
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO,
- "****Return IBSS Status*****");
+ hdd_notice("****Return IBSS Status*****");
break;
case WE_GET_WLAN_DBG:
@@ -6559,9 +6407,7 @@ static int __iw_setnone_getint(struct net_device *dev,
if (sme_cfg_get_int
(hHal, WNI_CFG_ASSOC_STA_LIMIT,
(uint32_t *) value) != QDF_STATUS_SUCCESS) {
- QDF_TRACE(QDF_MODULE_ID_HDD,
- QDF_TRACE_LEVEL_WARN, FL
- ("failed to get ini parameter, WNI_CFG_ASSOC_STA_LIMIT"));
+ hdd_warn("failed to get ini parameter, WNI_CFG_ASSOC_STA_LIMIT");
ret = -EIO;
}
break;
@@ -6575,8 +6421,7 @@ static int __iw_setnone_getint(struct net_device *dev,
{
*value = cds_get_concurrency_mode();
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO,
- ("concurrency mode=%d"), *value);
+ hdd_notice("concurrency mode=%d", *value);
break;
}
@@ -6584,13 +6429,13 @@ static int __iw_setnone_getint(struct net_device *dev,
{
sme_get_config_param(hHal, &smeConfig);
*value = (smeConfig.csrConfig.enable2x2 == 0) ? 1 : 2;
- hddLog(LOG1, "GET_NSS: Current NSS:%d", *value);
+ hdd_notice("GET_NSS: Current NSS:%d", *value);
break;
}
case WE_GET_GTX_HT_MCS:
{
- hddLog(LOG1, "GET WMI_VDEV_PARAM_GTX_HT_MCS");
+ hdd_notice("GET WMI_VDEV_PARAM_GTX_HT_MCS");
*value = wma_cli_get_command(pAdapter->sessionId,
WMI_VDEV_PARAM_GTX_HT_MCS,
GTX_CMD);
@@ -6599,7 +6444,7 @@ static int __iw_setnone_getint(struct net_device *dev,
case WE_GET_GTX_VHT_MCS:
{
- hddLog(LOG1, "GET WMI_VDEV_PARAM_GTX_VHT_MCS");
+ hdd_notice("GET WMI_VDEV_PARAM_GTX_VHT_MCS");
*value = wma_cli_get_command(pAdapter->sessionId,
WMI_VDEV_PARAM_GTX_VHT_MCS,
GTX_CMD);
@@ -6608,7 +6453,7 @@ static int __iw_setnone_getint(struct net_device *dev,
case WE_GET_GTX_USRCFG:
{
- hddLog(LOG1, "GET WMI_VDEV_PARAM_GTX_USR_CFG");
+ hdd_notice("GET WMI_VDEV_PARAM_GTX_USR_CFG");
*value = wma_cli_get_command(pAdapter->sessionId,
WMI_VDEV_PARAM_GTX_USR_CFG,
GTX_CMD);
@@ -6617,7 +6462,7 @@ static int __iw_setnone_getint(struct net_device *dev,
case WE_GET_GTX_THRE:
{
- hddLog(LOG1, "GET WMI_VDEV_PARAM_GTX_THRE");
+ hdd_notice("GET WMI_VDEV_PARAM_GTX_THRE");
*value = wma_cli_get_command(pAdapter->sessionId,
WMI_VDEV_PARAM_GTX_THRE,
GTX_CMD);
@@ -6626,7 +6471,7 @@ static int __iw_setnone_getint(struct net_device *dev,
case WE_GET_GTX_MARGIN:
{
- hddLog(LOG1, "GET WMI_VDEV_PARAM_GTX_MARGIN");
+ hdd_notice("GET WMI_VDEV_PARAM_GTX_MARGIN");
*value = wma_cli_get_command(pAdapter->sessionId,
WMI_VDEV_PARAM_GTX_MARGIN,
GTX_CMD);
@@ -6635,7 +6480,7 @@ static int __iw_setnone_getint(struct net_device *dev,
case WE_GET_GTX_STEP:
{
- hddLog(LOG1, "GET WMI_VDEV_PARAM_GTX_STEP");
+ hdd_notice("GET WMI_VDEV_PARAM_GTX_STEP");
*value = wma_cli_get_command(pAdapter->sessionId,
WMI_VDEV_PARAM_GTX_STEP,
GTX_CMD);
@@ -6644,7 +6489,7 @@ static int __iw_setnone_getint(struct net_device *dev,
case WE_GET_GTX_MINTPC:
{
- hddLog(LOG1, "GET WMI_VDEV_PARAM_GTX_MINTPC");
+ hdd_notice("GET WMI_VDEV_PARAM_GTX_MINTPC");
*value = wma_cli_get_command(pAdapter->sessionId,
WMI_VDEV_PARAM_GTX_MINTPC,
GTX_CMD);
@@ -6653,7 +6498,7 @@ static int __iw_setnone_getint(struct net_device *dev,
case WE_GET_GTX_BWMASK:
{
- hddLog(LOG1, "GET WMI_VDEV_PARAM_GTX_BW_MASK");
+ hdd_notice("GET WMI_VDEV_PARAM_GTX_BW_MASK");
*value = wma_cli_get_command(pAdapter->sessionId,
WMI_VDEV_PARAM_GTX_BW_MASK,
GTX_CMD);
@@ -6662,7 +6507,7 @@ static int __iw_setnone_getint(struct net_device *dev,
case WE_GET_LDPC:
{
- hddLog(LOG1, "GET WMI_VDEV_PARAM_LDPC");
+ hdd_notice("GET WMI_VDEV_PARAM_LDPC");
*value = sme_get_ht_config(hHal, pAdapter->sessionId,
WNI_CFG_HT_CAP_INFO_ADVANCE_CODING);
break;
@@ -6670,7 +6515,7 @@ static int __iw_setnone_getint(struct net_device *dev,
case WE_GET_TX_STBC:
{
- hddLog(LOG1, "GET WMI_VDEV_PARAM_TX_STBC");
+ hdd_notice("GET WMI_VDEV_PARAM_TX_STBC");
*value = sme_get_ht_config(hHal, pAdapter->sessionId,
WNI_CFG_HT_CAP_INFO_TX_STBC);
break;
@@ -6678,7 +6523,7 @@ static int __iw_setnone_getint(struct net_device *dev,
case WE_GET_RX_STBC:
{
- hddLog(LOG1, "GET WMI_VDEV_PARAM_RX_STBC");
+ hdd_notice("GET WMI_VDEV_PARAM_RX_STBC");
*value = sme_get_ht_config(hHal, pAdapter->sessionId,
WNI_CFG_HT_CAP_INFO_RX_STBC);
break;
@@ -6686,7 +6531,7 @@ static int __iw_setnone_getint(struct net_device *dev,
case WE_GET_SHORT_GI:
{
- hddLog(LOG1, "GET WMI_VDEV_PARAM_SGI");
+ hdd_notice("GET WMI_VDEV_PARAM_SGI");
*value = sme_get_ht_config(hHal, pAdapter->sessionId,
WNI_CFG_HT_CAP_INFO_SHORT_GI_20MHZ);
break;
@@ -6694,7 +6539,7 @@ static int __iw_setnone_getint(struct net_device *dev,
case WE_GET_RTSCTS:
{
- hddLog(LOG1, "GET WMI_VDEV_PARAM_ENABLE_RTSCTS");
+ hdd_notice("GET WMI_VDEV_PARAM_ENABLE_RTSCTS");
*value = wma_cli_get_command(pAdapter->sessionId,
WMI_VDEV_PARAM_ENABLE_RTSCTS,
VDEV_CMD);
@@ -6703,7 +6548,7 @@ static int __iw_setnone_getint(struct net_device *dev,
case WE_GET_CHWIDTH:
{
- hddLog(LOG1, "GET WMI_VDEV_PARAM_CHWIDTH");
+ hdd_notice("GET WMI_VDEV_PARAM_CHWIDTH");
*value = wma_cli_get_command(pAdapter->sessionId,
WMI_VDEV_PARAM_CHWIDTH,
VDEV_CMD);
@@ -6712,7 +6557,7 @@ static int __iw_setnone_getint(struct net_device *dev,
case WE_GET_ANI_EN_DIS:
{
- hddLog(LOG1, "GET WMI_PDEV_PARAM_ANI_ENABLE");
+ hdd_notice("GET WMI_PDEV_PARAM_ANI_ENABLE");
*value = wma_cli_get_command(pAdapter->sessionId,
WMI_PDEV_PARAM_ANI_ENABLE,
PDEV_CMD);
@@ -6721,7 +6566,7 @@ static int __iw_setnone_getint(struct net_device *dev,
case WE_GET_ANI_POLL_PERIOD:
{
- hddLog(LOG1, "GET WMI_PDEV_PARAM_ANI_POLL_PERIOD");
+ hdd_notice("GET WMI_PDEV_PARAM_ANI_POLL_PERIOD");
*value = wma_cli_get_command(pAdapter->sessionId,
WMI_PDEV_PARAM_ANI_POLL_PERIOD,
PDEV_CMD);
@@ -6730,7 +6575,7 @@ static int __iw_setnone_getint(struct net_device *dev,
case WE_GET_ANI_LISTEN_PERIOD:
{
- hddLog(LOG1, "GET WMI_PDEV_PARAM_ANI_LISTEN_PERIOD");
+ hdd_notice("GET WMI_PDEV_PARAM_ANI_LISTEN_PERIOD");
*value = wma_cli_get_command(pAdapter->sessionId,
WMI_PDEV_PARAM_ANI_LISTEN_PERIOD,
PDEV_CMD);
@@ -6739,7 +6584,7 @@ static int __iw_setnone_getint(struct net_device *dev,
case WE_GET_ANI_OFDM_LEVEL:
{
- hddLog(LOG1, "GET WMI_PDEV_PARAM_ANI_OFDM_LEVEL");
+ hdd_notice("GET WMI_PDEV_PARAM_ANI_OFDM_LEVEL");
*value = wma_cli_get_command(pAdapter->sessionId,
WMI_PDEV_PARAM_ANI_OFDM_LEVEL,
PDEV_CMD);
@@ -6748,7 +6593,7 @@ static int __iw_setnone_getint(struct net_device *dev,
case WE_GET_ANI_CCK_LEVEL:
{
- hddLog(LOG1, "GET WMI_PDEV_PARAM_ANI_CCK_LEVEL");
+ hdd_notice("GET WMI_PDEV_PARAM_ANI_CCK_LEVEL");
*value = wma_cli_get_command(pAdapter->sessionId,
WMI_PDEV_PARAM_ANI_CCK_LEVEL,
PDEV_CMD);
@@ -6757,7 +6602,7 @@ static int __iw_setnone_getint(struct net_device *dev,
case WE_GET_DYNAMIC_BW:
{
- hddLog(LOG1, "GET WMI_PDEV_PARAM_ANI_CCK_LEVEL");
+ hdd_notice("GET WMI_PDEV_PARAM_ANI_CCK_LEVEL");
*value = wma_cli_get_command(pAdapter->sessionId,
WMI_PDEV_PARAM_DYNAMIC_BW,
PDEV_CMD);
@@ -6766,7 +6611,7 @@ static int __iw_setnone_getint(struct net_device *dev,
case WE_GET_11N_RATE:
{
- hddLog(LOG1, "GET WMI_VDEV_PARAM_FIXED_RATE");
+ hdd_notice("GET WMI_VDEV_PARAM_FIXED_RATE");
*value = wma_cli_get_command(pAdapter->sessionId,
WMI_VDEV_PARAM_FIXED_RATE,
VDEV_CMD);
@@ -6775,7 +6620,7 @@ static int __iw_setnone_getint(struct net_device *dev,
case WE_GET_AMPDU:
{
- hddLog(LOG1, "GET AMPDU");
+ hdd_notice("GET AMPDU");
*value = wma_cli_get_command(pAdapter->sessionId,
GEN_VDEV_PARAM_AMPDU,
GEN_CMD);
@@ -6784,7 +6629,7 @@ static int __iw_setnone_getint(struct net_device *dev,
case WE_GET_AMSDU:
{
- hddLog(LOG1, "GET AMSDU");
+ hdd_notice("GET AMSDU");
*value = wma_cli_get_command(pAdapter->sessionId,
GEN_VDEV_PARAM_AMSDU,
GEN_CMD);
@@ -6793,7 +6638,7 @@ static int __iw_setnone_getint(struct net_device *dev,
case WE_GET_ROAM_SYNCH_DELAY:
{
- hddLog(LOG1, "GET ROAM SYNCH DELAY");
+ hdd_notice("GET ROAM SYNCH DELAY");
*value = wma_cli_get_command(pAdapter->sessionId,
GEN_VDEV_ROAM_SYNCH_DELAY,
GEN_CMD);
@@ -6802,7 +6647,7 @@ static int __iw_setnone_getint(struct net_device *dev,
case WE_GET_BURST_ENABLE:
{
- hddLog(LOG1, "GET Burst enable value");
+ hdd_notice("GET Burst enable value");
*value = wma_cli_get_command(pAdapter->sessionId,
WMI_PDEV_PARAM_BURST_ENABLE,
PDEV_CMD);
@@ -6810,7 +6655,7 @@ static int __iw_setnone_getint(struct net_device *dev,
}
case WE_GET_BURST_DUR:
{
- hddLog(LOG1, "GET Burst Duration value");
+ hdd_notice("GET Burst Duration value");
*value = wma_cli_get_command(pAdapter->sessionId,
WMI_PDEV_PARAM_BURST_DUR,
PDEV_CMD);
@@ -6819,7 +6664,7 @@ static int __iw_setnone_getint(struct net_device *dev,
case WE_GET_TX_CHAINMASK:
{
- hddLog(LOG1, "GET WMI_PDEV_PARAM_TX_CHAIN_MASK");
+ hdd_notice("GET WMI_PDEV_PARAM_TX_CHAIN_MASK");
*value = wma_cli_get_command(pAdapter->sessionId,
WMI_PDEV_PARAM_TX_CHAIN_MASK,
PDEV_CMD);
@@ -6828,7 +6673,7 @@ static int __iw_setnone_getint(struct net_device *dev,
case WE_GET_RX_CHAINMASK:
{
- hddLog(LOG1, "GET WMI_PDEV_PARAM_RX_CHAIN_MASK");
+ hdd_notice("GET WMI_PDEV_PARAM_RX_CHAIN_MASK");
*value = wma_cli_get_command(pAdapter->sessionId,
WMI_PDEV_PARAM_RX_CHAIN_MASK,
PDEV_CMD);
@@ -6839,7 +6684,7 @@ static int __iw_setnone_getint(struct net_device *dev,
{
uint32_t txpow2g = 0;
tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter);
- hddLog(LOG1, "GET WMI_PDEV_PARAM_TXPOWER_LIMIT2G");
+ hdd_notice("GET WMI_PDEV_PARAM_TXPOWER_LIMIT2G");
*value = wma_cli_get_command(pAdapter->sessionId,
WMI_PDEV_PARAM_TXPOWER_LIMIT2G,
PDEV_CMD);
@@ -6848,7 +6693,7 @@ static int __iw_setnone_getint(struct net_device *dev,
&txpow2g)) {
return -EIO;
}
- hddLog(LOG1, "2G tx_power %d", txpow2g);
+ hdd_notice("2G tx_power %d", txpow2g);
break;
}
@@ -6856,7 +6701,7 @@ static int __iw_setnone_getint(struct net_device *dev,
{
uint32_t txpow5g = 0;
tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter);
- hddLog(LOG1, "GET WMI_PDEV_PARAM_TXPOWER_LIMIT5G");
+ hdd_notice("GET WMI_PDEV_PARAM_TXPOWER_LIMIT5G");
*value = wma_cli_get_command(pAdapter->sessionId,
WMI_PDEV_PARAM_TXPOWER_LIMIT5G,
PDEV_CMD);
@@ -6865,13 +6710,13 @@ static int __iw_setnone_getint(struct net_device *dev,
&txpow5g)) {
return -EIO;
}
- hddLog(LOG1, "5G tx_power %d", txpow5g);
+ hdd_notice("5G tx_power %d", txpow5g);
break;
}
case WE_GET_PPS_PAID_MATCH:
{
- hddLog(LOG1, "GET WMI_VDEV_PPS_PAID_MATCH");
+ hdd_notice("GET WMI_VDEV_PPS_PAID_MATCH");
*value = wma_cli_get_command(pAdapter->sessionId,
WMI_VDEV_PPS_PAID_MATCH,
PPS_CMD);
@@ -6880,7 +6725,7 @@ static int __iw_setnone_getint(struct net_device *dev,
case WE_GET_PPS_GID_MATCH:
{
- hddLog(LOG1, "GET WMI_VDEV_PPS_GID_MATCH");
+ hdd_notice("GET WMI_VDEV_PPS_GID_MATCH");
*value = wma_cli_get_command(pAdapter->sessionId,
WMI_VDEV_PPS_GID_MATCH,
PPS_CMD);
@@ -6889,7 +6734,7 @@ static int __iw_setnone_getint(struct net_device *dev,
case WE_GET_PPS_EARLY_TIM_CLEAR:
{
- hddLog(LOG1, "GET WMI_VDEV_PPS_EARLY_TIM_CLEAR");
+ hdd_notice("GET WMI_VDEV_PPS_EARLY_TIM_CLEAR");
*value = wma_cli_get_command(pAdapter->sessionId,
WMI_VDEV_PPS_EARLY_TIM_CLEAR,
PPS_CMD);
@@ -6898,7 +6743,7 @@ static int __iw_setnone_getint(struct net_device *dev,
case WE_GET_PPS_EARLY_DTIM_CLEAR:
{
- hddLog(LOG1, "GET WMI_VDEV_PPS_EARLY_DTIM_CLEAR");
+ hdd_notice("GET WMI_VDEV_PPS_EARLY_DTIM_CLEAR");
*value = wma_cli_get_command(pAdapter->sessionId,
WMI_VDEV_PPS_EARLY_DTIM_CLEAR,
PPS_CMD);
@@ -6907,7 +6752,7 @@ static int __iw_setnone_getint(struct net_device *dev,
case WE_GET_PPS_EOF_PAD_DELIM:
{
- hddLog(LOG1, "GET WMI_VDEV_PPS_EOF_PAD_DELIM");
+ hdd_notice("GET WMI_VDEV_PPS_EOF_PAD_DELIM");
*value = wma_cli_get_command(pAdapter->sessionId,
WMI_VDEV_PPS_EOF_PAD_DELIM,
PPS_CMD);
@@ -6916,7 +6761,7 @@ static int __iw_setnone_getint(struct net_device *dev,
case WE_GET_PPS_MACADDR_MISMATCH:
{
- hddLog(LOG1, "GET WMI_VDEV_PPS_MACADDR_MISMATCH");
+ hdd_notice("GET WMI_VDEV_PPS_MACADDR_MISMATCH");
*value = wma_cli_get_command(pAdapter->sessionId,
WMI_VDEV_PPS_MACADDR_MISMATCH,
PPS_CMD);
@@ -6925,7 +6770,7 @@ static int __iw_setnone_getint(struct net_device *dev,
case WE_GET_PPS_DELIM_CRC_FAIL:
{
- hddLog(LOG1, "GET WMI_VDEV_PPS_DELIM_CRC_FAIL");
+ hdd_notice("GET WMI_VDEV_PPS_DELIM_CRC_FAIL");
*value = wma_cli_get_command(pAdapter->sessionId,
WMI_VDEV_PPS_DELIM_CRC_FAIL,
PPS_CMD);
@@ -6934,7 +6779,7 @@ static int __iw_setnone_getint(struct net_device *dev,
case WE_GET_PPS_GID_NSTS_ZERO:
{
- hddLog(LOG1, "GET WMI_VDEV_PPS_GID_NSTS_ZERO");
+ hdd_notice("GET WMI_VDEV_PPS_GID_NSTS_ZERO");
*value = wma_cli_get_command(pAdapter->sessionId,
WMI_VDEV_PPS_GID_NSTS_ZERO,
PPS_CMD);
@@ -6944,7 +6789,7 @@ static int __iw_setnone_getint(struct net_device *dev,
case WE_GET_PPS_RSSI_CHECK:
{
- hddLog(LOG1, "GET WMI_VDEV_PPS_RSSI_CHECK");
+ hdd_notice("GET WMI_VDEV_PPS_RSSI_CHECK");
*value = wma_cli_get_command(pAdapter->sessionId,
WMI_VDEV_PPS_RSSI_CHECK,
PPS_CMD);
@@ -6953,7 +6798,7 @@ static int __iw_setnone_getint(struct net_device *dev,
case WE_GET_QPOWER_MAX_PSPOLL_COUNT:
{
- hddLog(LOG1, "WE_GET_QPOWER_MAX_PSPOLL_COUNT");
+ hdd_notice("WE_GET_QPOWER_MAX_PSPOLL_COUNT");
*value = wma_cli_get_command(pAdapter->sessionId,
WMI_STA_PS_PARAM_QPOWER_PSPOLL_COUNT,
QPOWER_CMD);
@@ -6962,7 +6807,7 @@ static int __iw_setnone_getint(struct net_device *dev,
case WE_GET_QPOWER_MAX_TX_BEFORE_WAKE:
{
- hddLog(LOG1, "WE_GET_QPOWER_MAX_TX_BEFORE_WAKE");
+ hdd_notice("WE_GET_QPOWER_MAX_TX_BEFORE_WAKE");
*value = wma_cli_get_command(pAdapter->sessionId,
WMI_STA_PS_PARAM_QPOWER_MAX_TX_BEFORE_WAKE,
QPOWER_CMD);
@@ -6971,7 +6816,7 @@ static int __iw_setnone_getint(struct net_device *dev,
case WE_GET_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL:
{
- hddLog(LOG1, "WE_GET_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL");
+ hdd_notice("WE_GET_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL");
*value = wma_cli_get_command(pAdapter->sessionId,
WMI_STA_PS_PARAM_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL,
QPOWER_CMD);
@@ -6980,7 +6825,7 @@ static int __iw_setnone_getint(struct net_device *dev,
case WE_GET_QPOWER_SPEC_MAX_SPEC_NODATA_PSPOLL:
{
- hddLog(LOG1, "WE_GET_QPOWER_MAX_PSPOLL_COUNT");
+ hdd_notice("WE_GET_QPOWER_MAX_PSPOLL_COUNT");
*value = wma_cli_get_command(pAdapter->sessionId,
WMI_STA_PS_PARAM_QPOWER_SPEC_MAX_SPEC_NODATA_PSPOLL,
QPOWER_CMD);
@@ -6991,13 +6836,13 @@ static int __iw_setnone_getint(struct net_device *dev,
break;
case WE_GET_TEMPERATURE:
{
- hddLog(QDF_TRACE_LEVEL_INFO, "WE_GET_TEMPERATURE");
+ hdd_notice("WE_GET_TEMPERATURE");
ret = wlan_hdd_get_temperature(pAdapter, value);
break;
}
default:
{
- hddLog(LOGE, "Invalid IOCTL get_value command %d",
+ hdd_err("Invalid IOCTL get_value command %d",
value[0]);
break;
}
@@ -7041,7 +6886,7 @@ static int __iw_set_three_ints_getnone(struct net_device *dev,
ENTER_DEV(dev);
if (!capable(CAP_NET_ADMIN)) {
- hddLog(LOGE, FL("permission check failed"));
+ hdd_err("permission check failed");
return -EPERM;
}
@@ -7083,7 +6928,7 @@ static int __iw_set_three_ints_getnone(struct net_device *dev,
cds_set_dual_mac_scan_config(value[1], value[2], value[3]);
break;
default:
- hddLog(LOGE, "%s: Invalid IOCTL command %d", __func__, sub_cmd);
+ hdd_err("Invalid IOCTL command %d", sub_cmd);
break;
}
@@ -7331,9 +7176,7 @@ static int __iw_get_char_setnone(struct net_device *dev,
case WE_GET_CFG:
{
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO,
- "%s: Printing CLD global INI Config",
- __func__);
+ hdd_notice("Printing CLD global INI Config");
hdd_cfg_get_global_config(WLAN_HDD_GET_CTX(pAdapter),
extra,
QCSAP_IOCTL_MAX_STR_LEN);
@@ -7413,7 +7256,7 @@ static int __iw_get_char_setnone(struct net_device *dev,
iw_softap_get_channel_list(dev, info, wrqu,
(char *)&channel_list);
if (!QDF_IS_STATUS_SUCCESS(status)) {
- hddLog(LOGE, FL("GetChannelList Failed!!!"));
+ hdd_err("GetChannelList Failed!!!");
return -EINVAL;
}
buf = extra;
@@ -7425,8 +7268,7 @@ static int __iw_get_char_setnone(struct net_device *dev,
*/
if (WE_MAX_STR_LEN <
(5 * WNI_CFG_VALID_CHANNEL_LIST_LEN)) {
- hddLog(LOGE,
- FL("Insufficient Buffer to populate channel list"));
+ hdd_err("Insufficient Buffer to populate channel list");
return -EINVAL;
}
len = scnprintf(buf, WE_MAX_STR_LEN, "%u ",
@@ -7460,7 +7302,7 @@ static int __iw_get_char_setnone(struct net_device *dev,
#ifdef WLAN_FEATURE_11W
case WE_GET_11W_INFO:
{
- hddLog(LOGE, "WE_GET_11W_ENABLED = %d",
+ hdd_err("WE_GET_11W_ENABLED = %d",
pWextState->roamProfile.MFPEnabled);
snprintf(extra, WE_MAX_STR_LEN,
@@ -7490,7 +7332,7 @@ static int __iw_get_char_setnone(struct net_device *dev,
int idx = 0;
int length = 0, buf = 0;
- for (idx = 0; idx < MAX_IBSS_PEERS; idx++) {
+ for (idx = 0; idx < MAX_PEERS; idx++) {
if (0 != pHddStaCtx->conn_info.staId[idx]) {
buf = snprintf
((extra + length),
@@ -7537,10 +7379,7 @@ static int __iw_get_char_setnone(struct net_device *dev,
phymode = sme_get_phy_mode(hal);
if ((QDF_STATUS_SUCCESS !=
sme_get_freq_band(hal, &currBand))) {
- QDF_TRACE(QDF_MODULE_ID_HDD,
- QDF_TRACE_LEVEL_INFO,
- "%s: Failed to get current band config",
- __func__);
+ hdd_notice("Failed to get current band config");
return -EIO;
}
@@ -7628,9 +7467,7 @@ static int __iw_get_char_setnone(struct net_device *dev,
if (0 == pHddCtx->config->fEnableSNRMonitoring ||
eConnectionState_Associated !=
pHddStaCtx->conn_info.connState) {
- hddLog(LOGE,
- "%s: getSNR failed: Enable SNR Monitoring-%d,"
- " ConnectionState-%d", __func__,
+ hdd_err("getSNR failed: Enable SNR Monitoring-%d, ConnectionState-%d",
pHddCtx->config->fEnableSNRMonitoring,
pHddStaCtx->conn_info.connState);
return -ENONET;
@@ -7642,7 +7479,7 @@ static int __iw_get_char_setnone(struct net_device *dev,
}
default:
{
- hddLog(LOGE, "%s: Invalid IOCTL command %d", __func__,
+ hdd_err("Invalid IOCTL command %d",
sub_cmd);
break;
}
@@ -7741,8 +7578,7 @@ static int __iw_setnone_getnone(struct net_device *dev,
/* Reassoc to same AP, only supported for Open Security*/
if ((hdd_sta_ctx->conn_info.ucEncryptionType ||
hdd_sta_ctx->conn_info.mcEncryptionType)) {
- hddLog(LOGE,
- FL("Reassoc to same AP, only supported for Open Security"));
+ hdd_err("Reassoc to same AP, only supported for Open Security");
return -ENOTSUPP;
}
@@ -7755,7 +7591,7 @@ static int __iw_setnone_getnone(struct net_device *dev,
case WE_DUMP_AGC_START:
{
- hddLog(LOG1, "WE_DUMP_AGC_START");
+ hdd_notice("WE_DUMP_AGC_START");
ret = wma_cli_set_command(adapter->sessionId,
GEN_PARAM_DUMP_AGC_START,
0, GEN_CMD);
@@ -7763,7 +7599,7 @@ static int __iw_setnone_getnone(struct net_device *dev,
}
case WE_DUMP_AGC:
{
- hddLog(LOG1, "WE_DUMP_AGC");
+ hdd_notice("WE_DUMP_AGC");
ret = wma_cli_set_command(adapter->sessionId,
GEN_PARAM_DUMP_AGC,
0, GEN_CMD);
@@ -7772,7 +7608,7 @@ static int __iw_setnone_getnone(struct net_device *dev,
case WE_DUMP_CHANINFO_START:
{
- hddLog(LOG1, "WE_DUMP_CHANINFO_START");
+ hdd_notice("WE_DUMP_CHANINFO_START");
ret = wma_cli_set_command(adapter->sessionId,
GEN_PARAM_DUMP_CHANINFO_START,
0, GEN_CMD);
@@ -7780,7 +7616,7 @@ static int __iw_setnone_getnone(struct net_device *dev,
}
case WE_DUMP_CHANINFO:
{
- hddLog(LOG1, "WE_DUMP_CHANINFO_START");
+ hdd_notice("WE_DUMP_CHANINFO_START");
ret = wma_cli_set_command(adapter->sessionId,
GEN_PARAM_DUMP_CHANINFO,
0, GEN_CMD);
@@ -7788,7 +7624,7 @@ static int __iw_setnone_getnone(struct net_device *dev,
}
case WE_DUMP_WATCHDOG:
{
- hddLog(LOG1, "WE_DUMP_WATCHDOG");
+ hdd_notice("WE_DUMP_WATCHDOG");
ret = wma_cli_set_command(adapter->sessionId,
GEN_PARAM_DUMP_WATCHDOG,
0, GEN_CMD);
@@ -7797,7 +7633,7 @@ static int __iw_setnone_getnone(struct net_device *dev,
#ifdef CONFIG_ATH_PCIE_ACCESS_DEBUG
case WE_DUMP_PCIE_LOG:
{
- hddLog(LOGE, "WE_DUMP_PCIE_LOG");
+ hdd_err("WE_DUMP_PCIE_LOG");
ret = wma_cli_set_command(adapter->sessionId,
GEN_PARAM_DUMP_PCIE_ACCESS_LOG,
0, GEN_CMD);
@@ -7823,7 +7659,7 @@ static int __iw_setnone_getnone(struct net_device *dev,
break;
default:
{
- hddLog(LOGE, "%s: unknown ioctl %d", __func__, sub_cmd);
+ hdd_err("unknown ioctl %d", sub_cmd);
break;
}
}
@@ -7877,14 +7713,14 @@ static int __iw_set_var_ints_getnone(struct net_device *dev,
return ret;
if (extra == NULL) {
- hddLog(LOGE, FL("NULL extra buffer pointer"));
+ hdd_err("NULL extra buffer pointer");
return -EINVAL;
}
sub_cmd = wrqu->data.flags;
num_args = wrqu->data.length;
- hddLog(LOG1, FL("Received length %d"), wrqu->data.length);
+ hdd_notice("Received length %d", wrqu->data.length);
switch (sub_cmd) {
case WE_IBSS_GET_PEER_INFO:
@@ -7914,12 +7750,10 @@ static int __iw_set_var_ints_getnone(struct net_device *dev,
p2pNoA.single_noa_duration = apps_args[5];
p2pNoA.psSelection = apps_args[6];
- hddLog(LOG1,
- "%s: P2P_NOA_ATTR:oppPS %d ctWindow %d duration %d "
- "interval %d count %d single noa duration %d PsSelection %x",
- __func__, apps_args[0], apps_args[1],
- apps_args[2], apps_args[3], apps_args[4],
- apps_args[5], apps_args[6]);
+ hdd_notice("P2P_NOA_ATTR:oppPS %d ctWindow %d duration %d interval %d count %d single noa duration %d PsSelection %x",
+ apps_args[0], apps_args[1], apps_args[2],
+ apps_args[3], apps_args[4],
+ apps_args[5], apps_args[6]);
hdd_set_p2p_ps(dev, &p2pNoA);
@@ -7928,18 +7762,17 @@ static int __iw_set_var_ints_getnone(struct net_device *dev,
case WE_MTRACE_SELECTIVE_MODULE_LOG_ENABLE_CMD:
{
- hddLog(LOG1, "%s: SELECTIVE_MODULE_LOG %d arg1 %d arg2",
- __func__, apps_args[0], apps_args[1]);
+ hdd_notice("SELECTIVE_MODULE_LOG %d arg1 %d arg2",
+ apps_args[0], apps_args[1]);
qdf_trace_enable(apps_args[0], apps_args[1]);
}
break;
case WE_MTRACE_DUMP_CMD:
{
- hddLog(LOG1,
- "%s: MTRACE_DUMP code %d session %d count %d "
- "bitmask_of_module %d ", __func__, apps_args[0],
- apps_args[1], apps_args[2], apps_args[3]);
+ hdd_notice("MTRACE_DUMP code %d session %d count %d bitmask_of_module %d ",
+ apps_args[0], apps_args[1],
+ apps_args[2], apps_args[3]);
qdf_trace_dump_all((void *)hHal, apps_args[0],
apps_args[1], apps_args[2],
apps_args[3]);
@@ -7949,8 +7782,7 @@ static int __iw_set_var_ints_getnone(struct net_device *dev,
case WE_POLICY_MANAGER_CLIST_CMD:
{
- hddLog(LOGE,
- FL("<iwpriv wlan0 pm_clist> is called\n"));
+ hdd_err("<iwpriv wlan0 pm_clist> is called");
cds_incr_connection_count_utfw(apps_args[0],
apps_args[1], apps_args[2], apps_args[3],
apps_args[4], apps_args[5], apps_args[6],
@@ -7960,8 +7792,7 @@ static int __iw_set_var_ints_getnone(struct net_device *dev,
case WE_POLICY_MANAGER_DLIST_CMD:
{
- hddLog(LOGE,
- FL("<iwpriv wlan0 pm_dlist> is called\n"));
+ hdd_err("<iwpriv wlan0 pm_dlist> is called");
cds_decr_connection_count_utfw(apps_args[0],
apps_args[1]);
}
@@ -7969,8 +7800,7 @@ static int __iw_set_var_ints_getnone(struct net_device *dev,
case WE_POLICY_MANAGER_ULIST_CMD:
{
- hddLog(LOGE,
- FL("<iwpriv wlan0 pm_ulist> is called\n"));
+ hdd_err("<iwpriv wlan0 pm_ulist> is called");
cds_update_connection_info_utfw(apps_args[0],
apps_args[1], apps_args[2], apps_args[3],
apps_args[4], apps_args[5], apps_args[6],
@@ -7980,8 +7810,7 @@ static int __iw_set_var_ints_getnone(struct net_device *dev,
case WE_POLICY_MANAGER_DBS_CMD:
{
- hddLog(LOGE,
- FL("<iwpriv wlan0 pm_dbs> is called\n"));
+ hdd_err("<iwpriv wlan0 pm_dbs> is called");
if (apps_args[0] == 0)
wma_set_dbs_capability_ut(0);
else
@@ -8001,8 +7830,7 @@ static int __iw_set_var_ints_getnone(struct net_device *dev,
uint8_t weight_list[QDF_MAX_NUM_CHAN] = {0};
uint32_t pcl_len = 0, i = 0;
- hddLog(LOGE,
- FL("<iwpriv wlan0 pm_pcl> is called\n"));
+ hdd_err("<iwpriv wlan0 pm_pcl> is called");
cds_get_pcl(apps_args[0],
pcl, &pcl_len,
@@ -8019,19 +7847,12 @@ static int __iw_set_var_ints_getnone(struct net_device *dev,
struct cds_conc_connection_info *conn_info;
uint32_t i = 0, len = 0;
- hddLog(LOGE,
- FL("<iwpriv wlan0 pm_cinfo> is called\n"));
+ hdd_err("<iwpriv wlan0 pm_cinfo> is called");
conn_info = cds_get_conn_info(&len);
pr_info("+-----------------------------+\n");
for (i = 0; i < len; i++) {
pr_info("|table_index[%d]\t\t|\n", i);
pr_info("|\t|vdev_id - %d\t\t|\n", conn_info->vdev_id);
- pr_info("|\t|tx_spatial_stream - %d\t|\n",
- conn_info->tx_spatial_stream);
- pr_info("|\t|rx_spatial_stream - %d\t|\n",
- conn_info->rx_spatial_stream);
- pr_info("|\t|chain_mask - %d\t\t|\n",
- conn_info->chain_mask);
pr_info("|\t|chan - %d\t\t|\n", conn_info->chan);
pr_info("|\t|bw - %d\t\t|\n", conn_info->bw);
pr_info("|\t|mode - %d\t\t|\n", conn_info->mode);
@@ -8046,8 +7867,7 @@ static int __iw_set_var_ints_getnone(struct net_device *dev,
case WE_POLICY_SET_HW_MODE_CMD:
{
if (apps_args[0] == 0) {
- hddLog(LOGE,
- FL("set hw mode for single mac\n"));
+ hdd_err("set hw mode for single mac");
cds_pdev_set_hw_mode(
pAdapter->sessionId,
HW_MODE_SS_2x2,
@@ -8057,8 +7877,7 @@ static int __iw_set_var_ints_getnone(struct net_device *dev,
HW_MODE_AGILE_DFS_NONE,
SIR_UPDATE_REASON_UT);
} else if (apps_args[0] == 1) {
- hddLog(LOGE,
- FL("set hw mode for dual mac\n"));
+ hdd_err("set hw mode for dual mac");
cds_pdev_set_hw_mode(
pAdapter->sessionId,
HW_MODE_SS_1x1,
@@ -8074,8 +7893,7 @@ static int __iw_set_var_ints_getnone(struct net_device *dev,
case WE_POLICY_MANAGER_QUERY_ACTION_CMD:
{
enum cds_conc_next_action action;
- hddLog(LOGE,
- FL("<iwpriv wlan0 pm_query_action> is called\n"));
+ hdd_err("<iwpriv wlan0 pm_query_action> is called");
action = cds_current_connections_update(pAdapter->sessionId,
apps_args[0],
SIR_UPDATE_REASON_UT);
@@ -8085,8 +7903,7 @@ static int __iw_set_var_ints_getnone(struct net_device *dev,
case WE_POLICY_MANAGER_QUERY_ALLOW_CMD:
{
bool allow;
- hddLog(LOGE,
- FL("<iwpriv wlan0 pm_query_allow> is called\n"));
+ hdd_err("<iwpriv wlan0 pm_query_allow> is called");
allow = cds_allow_concurrency(
apps_args[0], apps_args[1], apps_args[2]);
pr_info("allow %d {0 = don't allow, 1 = allow}", allow);
@@ -8165,19 +7982,18 @@ static int __iw_set_var_ints_getnone(struct net_device *dev,
int i, j;
if ((apps_args[0] < WLAN_MODULE_ID_MIN) ||
(apps_args[0] >= WLAN_MODULE_ID_MAX)) {
- hddLog(LOGE, FL("Invalid MODULE ID %d"),
+ hdd_err("Invalid MODULE ID %d",
apps_args[0]);
return -EINVAL;
}
if (apps_args[1] > (WMA_MAX_NUM_ARGS)) {
- hddLog(LOGE, FL("Too Many args %d"),
+ hdd_err("Too Many args %d",
apps_args[1]);
return -EINVAL;
}
unitTestArgs = qdf_mem_malloc(sizeof(*unitTestArgs));
if (NULL == unitTestArgs) {
- hddLog(LOGE,
- FL("qdf_mem_malloc failed for unitTestArgs"));
+ hdd_err("qdf_mem_malloc failed for unitTestArgs");
return -ENOMEM;
}
unitTestArgs->vdev_id = (int)pAdapter->sessionId;
@@ -8192,10 +8008,7 @@ static int __iw_set_var_ints_getnone(struct net_device *dev,
if (QDF_STATUS_SUCCESS !=
cds_mq_post_message(QDF_MODULE_ID_WMA, &msg)) {
qdf_mem_free(unitTestArgs);
- QDF_TRACE(QDF_MODULE_ID_HDD,
- QDF_TRACE_LEVEL_ERROR,
- FL
- ("Not able to post UNIT_TEST_CMD message to WMA"));
+ hdd_err("Not able to post UNIT_TEST_CMD message to WMA");
return -EINVAL;
}
}
@@ -8205,14 +8018,12 @@ static int __iw_set_var_ints_getnone(struct net_device *dev,
{
int i;
if (num_args != 4) {
- hddLog(LOGE,
- FL("gpio_control: 4 parameters are required"));
+ hdd_err("gpio_control: 4 parameters are required");
return -EINVAL;
}
for (i = 0; i < num_args; i++) {
if (apps_args[i] >= 0x7fffffff) {
- hddLog(LOGE,
- FL("gpio_control: parameter should be less than 0x7fffffff"));
+ hdd_err("gpio_control: parameter should be less than 0x7fffffff");
return -EINVAL;
}
}
@@ -8223,9 +8034,49 @@ static int __iw_set_var_ints_getnone(struct net_device *dev,
}
break;
#endif
+ case WE_MAC_PWR_DEBUG_CMD:
+ {
+ struct sir_mac_pwr_dbg_cmd mac_pwr_dbg_args;
+ tHalHandle hal = WLAN_HDD_GET_HAL_CTX(pAdapter);
+ int i, j;
+
+ if (num_args < 3) {
+ hdd_err("number of arguments can't be null %d",
+ num_args);
+ return -EINVAL;
+ }
+ if (num_args - 3 != apps_args[2]) {
+ hdd_err("arg list of size %d doesn't match num_args %d",
+ num_args-3, apps_args[2]);
+ return -EINVAL;
+ }
+ if ((apps_args[1] < WLAN_MODULE_ID_MIN) ||
+ (apps_args[1] >= WLAN_MODULE_ID_MAX)) {
+ hdd_err("Invalid MODULE ID %d", apps_args[1]);
+ return -EINVAL;
+ }
+ if (apps_args[2] > (MAX_POWER_DBG_ARGS_SUPPORTED)) {
+ hdd_err("Too Many args %d", apps_args[2]);
+ return -EINVAL;
+ }
+ mac_pwr_dbg_args.pdev_id = apps_args[0];
+ mac_pwr_dbg_args.module_id = apps_args[1];
+ mac_pwr_dbg_args.num_args = apps_args[2];
+
+ for (i = 0, j = 3; i < mac_pwr_dbg_args.num_args; i++, j++)
+ mac_pwr_dbg_args.args[i] = apps_args[j];
+
+ if (QDF_STATUS_SUCCESS !=
+ sme_process_mac_pwr_dbg_cmd(hal, pAdapter->sessionId,
+ &mac_pwr_dbg_args)) {
+ return -EINVAL;
+ }
+ }
+ break;
+
default:
{
- hddLog(LOGE, FL("Invalid IOCTL command %d"), sub_cmd);
+ hdd_err("Invalid IOCTL command %d", sub_cmd);
}
break;
}
@@ -8252,8 +8103,7 @@ static int iw_hdd_set_var_ints_getnone(struct net_device *dev,
int ret, num_args;
if (!capable(CAP_NET_ADMIN)) {
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR,
- FL("permission check failed"));
+ hdd_err("permission check failed");
return -EPERM;
}
@@ -8262,7 +8112,7 @@ static int iw_hdd_set_var_ints_getnone(struct net_device *dev,
return -EINVAL;
if (NULL == u_priv_wrqu.data.pointer) {
- hddLog(LOGE, FL("NULL data pointer"));
+ hdd_err("NULL data pointer");
return -EINVAL;
}
@@ -8272,7 +8122,7 @@ static int iw_hdd_set_var_ints_getnone(struct net_device *dev,
if (copy_from_user(apps_args, u_priv_wrqu.data.pointer,
(sizeof(int)) * num_args)) {
- hddLog(LOGE, FL("failed to copy data from user buffer"));
+ hdd_err("failed to copy data from user buffer");
return -EFAULT;
}
@@ -8419,12 +8269,11 @@ static int __iw_add_tspec(struct net_device *dev, struct iw_request_info *info,
}
tSpec.ts_info.up = params[HDD_WLAN_WMM_PARAM_USER_PRIORITY];
if (0 > tSpec.ts_info.up || SME_QOS_WMM_UP_MAX < tSpec.ts_info.up) {
- hddLog(QDF_TRACE_LEVEL_ERROR, "***ts_info.up out of bounds***");
+ hdd_err("***ts_info.up out of bounds***");
return 0;
}
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO_HIGH,
- "%s:TS_INFO PSB %d UP %d !!!", __func__,
+ hdd_info("TS_INFO PSB %d UP %d !!!",
tSpec.ts_info.psb, tSpec.ts_info.up);
tSpec.nominal_msdu_size = params[HDD_WLAN_WMM_PARAM_NOMINAL_MSDU_SIZE];
@@ -8632,22 +8481,20 @@ static int __iw_set_fties(struct net_device *dev, struct iw_request_info *info,
return ret;
if (!wrqu->data.length) {
- hddLog(LOGE, FL("called with 0 length IEs"));
+ hdd_err("called with 0 length IEs");
return -EINVAL;
}
if (wrqu->data.pointer == NULL) {
- hddLog(LOGE, FL("called with NULL IE"));
+ hdd_err("called with NULL IE");
return -EINVAL;
}
/* Added for debug on reception of Re-assoc Req. */
if (eConnectionState_Associated != pHddStaCtx->conn_info.connState) {
- hddLog(LOGE,
- FL("Called with Ie of length = %d when not associated"),
+ hdd_err("Called with Ie of length = %d when not associated",
wrqu->data.length);
- hddLog(LOGE, FL("Should be Re-assoc Req IEs"));
+ hdd_err("Should be Re-assoc Req IEs");
}
- hddLog(LOG1, FL("%s called with Ie of length = %d"), __func__,
- wrqu->data.length);
+ hdd_notice("called with Ie of length = %d", wrqu->data.length);
/* Pass the received FT IEs to SME */
sme_set_ft_ies(WLAN_HDD_GET_HAL_CTX(pAdapter), pAdapter->sessionId,
@@ -8696,27 +8543,23 @@ static int __iw_set_host_offload(struct net_device *dev,
return ret;
if (!hdd_conn_is_connected(WLAN_HDD_GET_STATION_CTX_PTR(pAdapter))) {
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_FATAL,
- "%s:LOGP dev is not in CONNECTED state, ignore!!!",
- __func__);
+ hdd_err("dev is not in CONNECTED state, ignore!!!");
return -EINVAL;
}
/* Debug display of request components. */
switch (pRequest->offloadType) {
case WLAN_IPV4_ARP_REPLY_OFFLOAD:
- hddLog(QDF_TRACE_LEVEL_WARN,
- "%s: Host offload request: ARP reply", __func__);
+ hdd_warn("Host offload request: ARP reply");
switch (pRequest->enableOrDisable) {
case WLAN_OFFLOAD_DISABLE:
- hddLog(QDF_TRACE_LEVEL_WARN, " disable");
+ hdd_warn(" disable");
break;
case WLAN_OFFLOAD_ARP_AND_BC_FILTER_ENABLE:
- hddLog(QDF_TRACE_LEVEL_WARN, " BC Filtering enable");
+ hdd_warn(" BC Filtering enable");
case WLAN_OFFLOAD_ENABLE:
- hddLog(QDF_TRACE_LEVEL_WARN, " ARP offload enable");
- hddLog(QDF_TRACE_LEVEL_WARN,
- " IP address: %d.%d.%d.%d",
+ hdd_warn(" ARP offload enable");
+ hdd_warn(" IP address: %d.%d.%d.%d",
pRequest->params.hostIpv4Addr[0],
pRequest->params.hostIpv4Addr[1],
pRequest->params.hostIpv4Addr[2],
@@ -8725,17 +8568,14 @@ static int __iw_set_host_offload(struct net_device *dev,
break;
case WLAN_IPV6_NEIGHBOR_DISCOVERY_OFFLOAD:
- hddLog(QDF_TRACE_LEVEL_INFO_HIGH,
- "%s: Host offload request: neighbor discovery",
- __func__);
+ hdd_info("Host offload request: neighbor discovery");
switch (pRequest->enableOrDisable) {
case WLAN_OFFLOAD_DISABLE:
- hddLog(QDF_TRACE_LEVEL_INFO_HIGH, " disable");
+ hdd_info(" disable");
break;
case WLAN_OFFLOAD_ENABLE:
- hddLog(QDF_TRACE_LEVEL_INFO_HIGH, " enable");
- hddLog(QDF_TRACE_LEVEL_INFO_HIGH,
- " IP address: %x:%x:%x:%x:%x:%x:%x:%x",
+ hdd_info(" enable");
+ hdd_info(" IP address: %x:%x:%x:%x:%x:%x:%x:%x",
*(uint16_t *) (pRequest->params.hostIpv6Addr),
*(uint16_t *) (pRequest->params.hostIpv6Addr +
2),
@@ -8764,8 +8604,7 @@ static int __iw_set_host_offload(struct net_device *dev,
if (QDF_STATUS_SUCCESS !=
sme_set_host_offload(WLAN_HDD_GET_HAL_CTX(pAdapter),
pAdapter->sessionId, &offloadRequest)) {
- hddLog(QDF_TRACE_LEVEL_ERROR,
- "%s: Failure to execute host offload request", __func__);
+ hdd_err("Failure to execute host offload request");
return -EINVAL;
}
EXIT();
@@ -9023,8 +8862,7 @@ static int __iw_set_packet_filter_params(struct net_device *dev,
struct pkt_filter_cfg *request = NULL;
if (!capable(CAP_NET_ADMIN)) {
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR,
- FL("permission check failed"));
+ hdd_err("permission check failed");
return -EPERM;
}
@@ -9126,9 +8964,7 @@ static int __iw_get_statistics(struct net_device *dev,
pAdapter, pAdapter->sessionId);
if (QDF_STATUS_SUCCESS != status) {
- hddLog(QDF_TRACE_LEVEL_ERROR,
- "%s: Unable to retrieve SME statistics",
- __func__);
+ hdd_err("Unable to retrieve SME statistics");
return -EINVAL;
}
@@ -9138,9 +8974,7 @@ static int __iw_get_statistics(struct net_device *dev,
qdf_wait_single_event(&pWextState->hdd_qdf_event,
WLAN_WAIT_TIME_STATS);
if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
- hddLog(QDF_TRACE_LEVEL_ERROR,
- "%s: SME timeout while retrieving statistics",
- __func__);
+ hdd_err("SME timeout while retrieving statistics");
/*Remove the SME statistics list by passing NULL in callback argument */
status = sme_get_statistics(hdd_ctx->hHal, eCSR_HDD,
SME_SUMMARY_STATS |
@@ -9270,8 +9104,7 @@ void found_pref_network_cb(void *callbackContext,
union iwreq_data wrqu;
char buf[MAX_PNO_NOTIFY_LEN + 1];
- hddLog(QDF_TRACE_LEVEL_WARN,
- "A preferred network was found: %s with rssi: -%d",
+ hdd_warn("A preferred network was found: %s with rssi: -%d",
pPrefNetworkFoundInd->ssId.ssId, pPrefNetworkFoundInd->rssi);
/* create the event */
@@ -9560,34 +9393,29 @@ int hdd_set_band(struct net_device *dev, u8 ui_band)
band = eCSR_BAND_MAX;
}
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO,
- "%s: change band to %u", __func__, band);
+ hdd_notice("change band to %u", band);
if (band == eCSR_BAND_MAX) {
/* Received change band request with invalid band value */
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR,
- "%s: Invalid band value %u", __func__, ui_band);
+ hdd_err("Invalid band value %u", ui_band);
return -EINVAL;
}
if ((band == eCSR_BAND_24 && pHddCtx->config->nBandCapability == 2) ||
(band == eCSR_BAND_5G && pHddCtx->config->nBandCapability == 1)) {
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR,
- "%s: band value %u violate INI settings %u", __func__,
+ hdd_err("band value %u violate INI settings %u",
band, pHddCtx->config->nBandCapability);
return -EIO;
}
if (band == eCSR_BAND_ALL) {
- hddLog(LOG1,
- FL("Auto band received. Setting band same as ini value %d"),
+ hdd_notice("Auto band received. Setting band same as ini value %d",
pHddCtx->config->nBandCapability);
band = pHddCtx->config->nBandCapability;
}
if (QDF_STATUS_SUCCESS != sme_get_freq_band(hHal, &currBand)) {
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO,
- "%s: Failed to get current band config", __func__);
+ hdd_notice("Failed to get current band config");
return -EIO;
}
@@ -9596,9 +9424,8 @@ int hdd_set_band(struct net_device *dev, u8 ui_band)
* Abort pending scan requests, flush the existing scan results,
* and change the band capability
*/
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO,
- "%s: Current band value = %u, new setting %u ",
- __func__, currBand, band);
+ hdd_notice("Current band value = %u, new setting %u ",
+ currBand, band);
status = hdd_get_front_adapter(pHddCtx, &pAdapterNode);
while (NULL != pAdapterNode && QDF_STATUS_SUCCESS == status) {
@@ -9624,8 +9451,7 @@ int hdd_set_band(struct net_device *dev, u8 ui_band)
/* STA already connected on current band, So issue disconnect
* first, then change the band*/
- hddLog(LOG1,
- FL("STA (Device mode %s(%d)) connected in band %u, Changing band to %u, Issuing Disconnect"),
+ hdd_notice("STA (Device mode %s(%d)) connected in band %u, Changing band to %u, Issuing Disconnect",
hdd_device_mode_to_string(pAdapter->device_mode),
pAdapter->device_mode, currBand, band);
INIT_COMPLETION(pAdapter->disconnect_comp_var);
@@ -9637,9 +9463,8 @@ int hdd_set_band(struct net_device *dev, u8 ui_band)
eCSR_DISCONNECT_REASON_UNSPECIFIED);
if (QDF_STATUS_SUCCESS != status) {
- hddLog(QDF_TRACE_LEVEL_ERROR,
- "%s csr_roam_disconnect failure, returned %d",
- __func__, (int)status);
+ hdd_err("csr_roam_disconnect failure, returned %d",
+ (int)status);
return -EINVAL;
}
@@ -9650,9 +9475,7 @@ int hdd_set_band(struct net_device *dev, u8 ui_band)
(WLAN_WAIT_TIME_DISCONNECT));
if (lrc == 0) {
- hddLog(QDF_TRACE_LEVEL_ERROR,
- "%s:Timeout while waiting for csr_roam_disconnect",
- __func__);
+ hdd_err("Timeout while waiting for csr_roam_disconnect");
return -ETIMEDOUT;
}
}
@@ -9666,8 +9489,7 @@ int hdd_set_band(struct net_device *dev, u8 ui_band)
if (QDF_STATUS_SUCCESS !=
sme_set_freq_band(hHal, pAdapter->sessionId, band)) {
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_FATAL,
- FL("Failed to set the band value to %u"),
+ hdd_alert("Failed to set the band value to %u",
band);
return -EINVAL;
}
@@ -9685,7 +9507,7 @@ int hdd_set_band_helper(struct net_device *dev, const char *command)
command += WLAN_HDD_UI_SET_BAND_VALUE_OFFSET;
ret = kstrtou8(command, 10, &band);
if (ret < 0) {
- hddLog(LOGE, FL("kstrtou8 failed"));
+ hdd_err("kstrtou8 failed");
return -EINVAL;
}
@@ -9701,8 +9523,7 @@ static int __iw_set_band_config(struct net_device *dev,
ENTER_DEV(dev);
if (!capable(CAP_NET_ADMIN)) {
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR,
- FL("permission check failed"));
+ hdd_err("permission check failed");
return -EPERM;
}
@@ -9787,7 +9608,7 @@ static int __iw_set_two_ints_getnone(struct net_device *dev,
switch (sub_cmd) {
case WE_SET_SMPS_PARAM:
- hddLog(LOG1, "WE_SET_SMPS_PARAM val %d %d", value[1], value[2]);
+ hdd_notice("WE_SET_SMPS_PARAM val %d %d", value[1], value[2]);
ret = wma_cli_set_command(pAdapter->sessionId,
WMI_STA_SMPS_PARAM_CMDID,
value[1] << WMA_SMPS_PARAM_VALUE_S
@@ -9796,7 +9617,7 @@ static int __iw_set_two_ints_getnone(struct net_device *dev,
break;
#ifdef DEBUG
case WE_SET_FW_CRASH_INJECT:
- hddLog(LOGE, "WE_SET_FW_CRASH_INJECT: %d %d",
+ hdd_err("WE_SET_FW_CRASH_INJECT: %d %d",
value[1], value[2]);
pr_err("SSR is triggered by iwpriv CRASH_INJECT: %d %d\n",
value[1], value[2]);
@@ -9806,14 +9627,14 @@ static int __iw_set_two_ints_getnone(struct net_device *dev,
break;
#endif
case WE_ENABLE_FW_PROFILE:
- hddLog(LOGE, "WE_ENABLE_FW_PROFILE: %d %d",
+ hdd_err("WE_ENABLE_FW_PROFILE: %d %d",
value[1], value[2]);
ret = wma_cli_set2_command(pAdapter->sessionId,
WMI_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID,
value[1], value[2], DBG_CMD);
break;
case WE_SET_FW_PROFILE_HIST_INTVL:
- hddLog(LOGE, "WE_SET_FW_PROFILE_HIST_INTVL: %d %d",
+ hdd_err("WE_SET_FW_PROFILE_HIST_INTVL: %d %d",
value[1], value[2]);
ret = wma_cli_set2_command(pAdapter->sessionId,
WMI_WLAN_PROFILE_SET_HIST_INTVL_CMDID,
@@ -9842,7 +9663,7 @@ static int __iw_set_two_ints_getnone(struct net_device *dev,
ret = wlan_hdd_set_mon_chan(pAdapter, value[1], value[2]);
break;
default:
- hddLog(LOGE, "%s: Invalid IOCTL command %d", __func__, sub_cmd);
+ hdd_err("Invalid IOCTL command %d", sub_cmd);
break;
}
@@ -10944,6 +10765,12 @@ static const struct iw_priv_args we_private_args[] = {
0,
"setUnitTestCmd"
},
+ {
+ WE_MAC_PWR_DEBUG_CMD,
+ IW_PRIV_TYPE_INT | MAX_VAR_ARGS,
+ 0,
+ "halPwrDebug"
+ },
#ifdef WLAN_FEATURE_GPIO_LED_FLASHING
{WE_LED_FLASHING_PARAM,
@@ -11086,12 +10913,27 @@ const struct iw_handler_def we_handler_def = {
.get_wireless_stats = NULL,
};
+/* hdd_set_wext() - configures bss parameters
+ * @pAdapter: handle to adapter context
+ *
+ * Returns: none
+ */
int hdd_set_wext(hdd_adapter_t *pAdapter)
{
- hdd_wext_state_t *pwextBuf;
+ hdd_wext_state_t *pwextBuf = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter);
hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
- pwextBuf = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter);
+ ENTER();
+
+ if (!pwextBuf) {
+ hdd_err("ERROR: pwextBuf is NULL");
+ return QDF_STATUS_E_FAILURE;
+ }
+
+ if (!pHddStaCtx) {
+ hdd_err("ERROR: pHddStaCtx is NULL");
+ return QDF_STATUS_E_FAILURE;
+ }
/* Now configure the roaming profile links. To SSID and bssid. */
pwextBuf->roamProfile.SSIDs.numOfSSIDs = 0;
@@ -11127,10 +10969,19 @@ int hdd_set_wext(hdd_adapter_t *pAdapter)
hdd_clear_roam_profile_ie(pAdapter);
+ EXIT();
return QDF_STATUS_SUCCESS;
}
+/**
+ * hdd_register_wext() - register wext context
+ * @dev: net device handle
+ *
+ * Registers wext interface context for a given net device
+ *
+ * Returns: 0 on success, errno on failure
+ */
int hdd_register_wext(struct net_device *dev)
{
hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
@@ -11139,7 +10990,12 @@ int hdd_register_wext(struct net_device *dev)
ENTER();
- /* Zero the memory. This zeros the profile structure. */
+ if (!pwextBuf) {
+ hdd_err(FL("ERROR: pwextBuf is NULL"));
+ return QDF_STATUS_E_FAILURE;
+ }
+
+ /* Zero the memory. This zeros the profile structure */
memset(pwextBuf, 0, sizeof(hdd_wext_state_t));
init_completion(&(WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter))->
@@ -11149,20 +11005,17 @@ int hdd_register_wext(struct net_device *dev)
if (!QDF_IS_STATUS_SUCCESS(status)) {
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR,
- ("ERROR: hdd_set_wext failed!!"));
+ hdd_err("ERROR: hdd_set_wext failed!!");
return QDF_STATUS_E_FAILURE;
}
if (!QDF_IS_STATUS_SUCCESS(qdf_event_create(&pwextBuf->hdd_qdf_event))) {
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR,
- ("ERROR: HDD qdf event init failed!!"));
+ hdd_err("ERROR: HDD qdf event init failed!!");
return QDF_STATUS_E_FAILURE;
}
if (!QDF_IS_STATUS_SUCCESS(qdf_event_create(&pwextBuf->scanevent))) {
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR,
- ("ERROR: HDD scan event init failed!!"));
+ hdd_err("ERROR: HDD scan event init failed!!");
return QDF_STATUS_E_FAILURE;
}
/* Register as a wireless device */
@@ -11174,7 +11027,7 @@ int hdd_register_wext(struct net_device *dev)
int hdd_unregister_wext(struct net_device *dev)
{
- hddLog(LOG1, FL("dev(%p)"), dev);
+ hdd_notice("dev(%p)", dev);
if (dev != NULL) {
rtnl_lock();
diff --git a/core/mac/inc/ani_global.h b/core/mac/inc/ani_global.h
index ec52065e6b7d..8807263bf80d 100644
--- a/core/mac/inc/ani_global.h
+++ b/core/mac/inc/ani_global.h
@@ -1069,7 +1069,6 @@ typedef struct sAniSirGlobal {
uint32_t f_sta_miracast_mcc_rest_time_val;
uint8_t f_prefer_non_dfs_on_radar;
hdd_ftm_msg_processor ftm_msg_processor_callback;
- bool policy_manager_enabled;
uint32_t fine_time_meas_cap;
/* per band chain mask support */
bool per_band_chainmask_supp;
@@ -1084,6 +1083,7 @@ typedef struct sAniSirGlobal {
bool first_scan_done;
int8_t first_scan_bucket_threshold;
enum auth_tx_ack_status auth_ack_status;
+ uint8_t user_configured_nss;
} tAniSirGlobal;
typedef enum {
diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h
index 7867b1a0c7db..4909fc5993e3 100644
--- a/core/mac/inc/qwlan_version.h
+++ b/core/mac/inc/qwlan_version.h
@@ -42,8 +42,8 @@
#define QWLAN_VERSION_MINOR 1
#define QWLAN_VERSION_PATCH 0
#define QWLAN_VERSION_EXTRA ""
-#define QWLAN_VERSION_BUILD 14
+#define QWLAN_VERSION_BUILD 22
-#define QWLAN_VERSIONSTR "5.1.0.14"
+#define QWLAN_VERSIONSTR "5.1.0.22"
#endif /* QWLAN_VERSION_H */
diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h
index c24ec17fcb3f..fdf1f8763daa 100644
--- a/core/mac/inc/sir_api.h
+++ b/core/mac/inc/sir_api.h
@@ -99,6 +99,8 @@ typedef uint8_t tSirVersionString[SIR_VERSION_STRING_LEN];
/* This should not be greater than MAX_NUMBER_OF_CONC_CONNECTIONS */
#define MAX_VDEV_SUPPORTED 4
+#define MAX_POWER_DBG_ARGS_SUPPORTED 8
+
/**
* enum sir_conn_update_reason: Reason for conc connection update
* @SIR_UPDATE_REASON_SET_OPER_CHAN: Set probable operating channel
@@ -489,13 +491,23 @@ struct sir_set_antenna_mode {
struct sir_antenna_mode_param set_antenna_mode;
};
-/* / BSS type enum used in while scanning/joining etc */
+/**
+ * enum tSirBssType - Enum for BSS type used in scanning/joining etc.
+ *
+ * @eSIR_INFRASTRUCTURE_MODE: Infrastructure station
+ * @eSIR_INFRA_AP_MODE: softAP mode
+ * @eSIR_IBSS_MODE: IBSS mode
+ * @eSIR_AUTO_MODE: Auto role
+ * @eSIR_MONITOR_MODE: Monitor mode
+ * @eSIR_NDI_MODE: NAN datapath mode
+ */
typedef enum eSirBssType {
eSIR_INFRASTRUCTURE_MODE,
- eSIR_INFRA_AP_MODE, /* Added for softAP support */
+ eSIR_INFRA_AP_MODE,
eSIR_IBSS_MODE,
eSIR_AUTO_MODE,
eSIR_MONITOR_MODE,
+ eSIR_NDI_MODE,
eSIR_DONOT_USE_BSS_TYPE = SIR_MAX_ENUM_SIZE
} tSirBssType;
@@ -535,7 +547,8 @@ typedef struct sSirHtConfig {
/* Enable/Disable RX STBC */
uint32_t ht_rx_stbc:2;
/* Enable/Disable SGI */
- uint32_t ht_sgi:1;
+ uint32_t ht_sgi20:1;
+ uint32_t ht_sgi40:1;
uint32_t unused:27;
} qdf_packed tSirHTConfig, *tpSirHTConfig;
@@ -4776,6 +4789,7 @@ typedef enum {
WIFI_INTERFACE_P2P_GO = 4,
WIFI_INTERFACE_NAN = 5,
WIFI_INTERFACE_MESH = 6,
+ WIFI_INTERFACE_NDI = 7,
} tSirWifiInterfaceMode;
/* set for QOS association */
@@ -5843,4 +5857,495 @@ struct sir_bpf_get_offload {
uint32_t remaining_bytes_for_bpf_inst;
};
+/**
+ * enum ht_capability_fields - HT Capabilities bit fields
+ * @HT_CAPS_LDPC: ldpc coding capability bit field
+ * @HT_CAPS_SUPPORTED_CHANNEL_SET: channel width set bit field
+ * @HT_CAPS_SM_PWR_SAVE: SM power save bit field
+ * @HT_CAPS_GREENFIELD: greenfield capability bit field
+ * @HT_CAPS_SHORT_GI20: short GI 20 bit field
+ * @HT_CAPS_SHORT_GI40: short GI 40 bit field
+ * @HT_CAPS_TX_STBC: Tx STBC bit field
+ * @HT_CAPS_RX_STBC: Rx STBC bit fields
+ */
+enum ht_capability_fields {
+ HT_CAPS_LDPC = 0x0001,
+ HT_CAPS_SUPPORTED_CHANNEL_SET = 0x0002,
+ HT_CAPS_SM_PWR_SAVE = 0x000c,
+ HT_CAPS_GREENFIELD = 0x0010,
+ HT_CAPS_SHORT_GI20 = 0x0020,
+ HT_CAPS_SHORT_GI40 = 0x0040,
+ HT_CAPS_TX_STBC = 0x0080,
+ HT_CAPS_RX_STBC = 0x0300
+};
+
+#ifdef WLAN_FEATURE_NAN_DATAPATH
+
+#define IFACE_NAME_SIZE 64
+
+/**
+ * enum ndp_accept_policy - nan data path accept policy
+ * @NDP_ACCEPT_POLICY_NONE: the framework will decide the policy
+ * @NDP_ACCEPT_POLICY_ALL: accept policy offloaded to fw
+ *
+ */
+enum ndp_accept_policy {
+ NDP_ACCEPT_POLICY_NONE = 0,
+ NDP_ACCEPT_POLICY_ALL = 1,
+};
+
+/**
+ * enum ndp_self_role - nan data path role
+ * @NDP_ROLE_INITIATOR: initiator of nan data path request
+ * @NDP_ROLE_RESPONDER: responder to nan data path request
+ *
+ */
+enum ndp_self_role {
+ NDP_ROLE_INITIATOR = 0,
+ NDP_ROLE_RESPONDER = 1,
+};
+
+/**
+ * enum ndp_response_code - responder's response code to nan data path request
+ * @NDP_RESPONSE_ACCEPT: ndp request accepted
+ * @NDP_RESPONSE_REJECT: ndp request rejected
+ * @NDP_RESPONSE_DEFER: ndp request deferred until later (response to follow
+ * any time later)
+ *
+ */
+enum ndp_response_code {
+ NDP_RESPONSE_ACCEPT = 0,
+ NDP_RESPONSE_REJECT = 1,
+ NDP_RESPONSE_DEFER = 2,
+};
+
+/**
+ * enum ndp_end_type - NDP end type
+ * @NDP_END_TYPE_UNSPECIFIED: type is unspecified
+ * @NDP_END_TYPE_PEER_UNAVAILABLE: type is peer unavailable
+ * @NDP_END_TYPE_OTA_FRAME: NDP end frame received from peer
+ *
+ */
+enum ndp_end_type {
+ NDP_END_TYPE_UNSPECIFIED = 0x00,
+ NDP_END_TYPE_PEER_UNAVAILABLE = 0x01,
+ NDP_END_TYPE_OTA_FRAME = 0x02,
+};
+
+/**
+ * enum ndp_end_reason_code - NDP end reason code
+ * @NDP_END_REASON_UNSPECIFIED: reason is unspecified
+ * @NDP_END_REASON_INACTIVITY: reason is peer inactivity
+ * @NDP_END_REASON_PEER_DATA_END: data end indication received from peer
+ *
+ */
+enum ndp_end_reason_code {
+ NDP_END_REASON_UNSPECIFIED = 0x00,
+ NDP_END_REASON_INACTIVITY = 0x01,
+ NDP_END_REASON_PEER_DATA_END = 0x02,
+};
+
+/**
+ * enum nan_status_type - NDP status type
+ * @NDP_RSP_STATUS_SUCCESS: request was successful
+ * @NDP_RSP_STATUS_ERROR: request failed
+ */
+enum nan_status_type {
+ NDP_RSP_STATUS_SUCCESS = 0x00,
+ NDP_RSP_STATUS_ERROR = 0x01,
+};
+
+/**
+ * enum nan_reason_code - NDP command rsp reason code value
+ * @NDP_UNSUPPORTED_CONCURRENCY: Will be used in unsupported concurrency cases
+ * @NDP_NAN_DATA_IFACE_CREATE_FAILED: ndi create failed
+ * @NDP_NAN_DATA_IFACE_DELETE_FAILED: ndi delete failed
+ * @NDP_DATA_INITIATOR_REQ_FAILED: data initiator request failed
+ * @NDP_DATA_RESPONDER_REQ_FAILED: data responder request failed
+ * @NDP_INVALID_SERVICE_INSTANCE_ID: invalid service instance id
+ * @NDP_INVALID_NDP_INSTANCE_ID: invalid ndp instance id
+ * @NDP_INVALID_RSP_CODE: invalid response code in ndp responder request
+ * @NDP_INVALID_APP_INFO_LEN: invalid app info length
+ * @NDP_NMF_REQ_FAIL: OTA nan mgmt frame failure for data request
+ * @NDP_NMF_RSP_FAIL: OTA nan mgmt frame failure for data response
+ * @NDP_NMF_CNF_FAIL: OTA nan mgmt frame failure for confirm
+ * @NDP_END_FAILED: ndp end failed
+ * @NDP_NMF_END_REQ_FAIL: OTA nan mgmt frame failure for data end
+ * @NDP_VENDOR_SPECIFIC_ERROR: other vendor specific failures
+ */
+enum nan_reason_code {
+ NDP_UNSUPPORTED_CONCURRENCY = 9000,
+ NDP_NAN_DATA_IFACE_CREATE_FAILED = 9001,
+ NDP_NAN_DATA_IFACE_DELETE_FAILED = 9002,
+ NDP_DATA_INITIATOR_REQ_FAILED = 9003,
+ NDP_DATA_RESPONDER_REQ_FAILED = 9004,
+ NDP_INVALID_SERVICE_INSTANCE_ID = 9005,
+ NDP_INVALID_NDP_INSTANCE_ID = 9006,
+ NDP_INVALID_RSP_CODE = 9007,
+ NDP_INVALID_APP_INFO_LEN = 9008,
+ NDP_NMF_REQ_FAIL = 9009,
+ NDP_NMF_RSP_FAIL = 9010,
+ NDP_NMF_CNF_FAIL = 9011,
+ NDP_END_FAILED = 9012,
+ NDP_NMF_END_REQ_FAIL = 9013,
+ /* 9500 onwards vendor specific error codes */
+ NDP_VENDOR_SPECIFIC_ERROR = 9500,
+};
+
+/**
+ * struct ndp_cfg - ndp configuration
+ * @tag: unique identifier
+ * @ndp_cfg_len: ndp configuration length
+ * @ndp_cfg: variable length ndp configuration
+ *
+ */
+struct ndp_cfg {
+ uint32_t tag;
+ uint32_t ndp_cfg_len;
+ uint8_t *ndp_cfg;
+};
+
+/**
+ * struct ndp_qos_cfg - ndp qos configuration
+ * @tag: unique identifier
+ * @ndp_qos_cfg_len: ndp qos configuration length
+ * @ndp_qos_cfg: variable length ndp qos configuration
+ *
+ */
+struct ndp_qos_cfg {
+ uint32_t tag;
+ uint32_t ndp_qos_cfg_len;
+ uint8_t ndp_qos_cfg[];
+};
+
+/**
+ * struct ndp_app_info - application info shared during ndp setup
+ * @tag: unique identifier
+ * @ndp_app_info_len: ndp app info length
+ * @ndp_app_info: variable length application information
+ *
+ */
+struct ndp_app_info {
+ uint32_t tag;
+ uint32_t ndp_app_info_len;
+ uint8_t *ndp_app_info;
+};
+
+/**
+ * struct ndi_create_req - ndi create request params
+ * @transaction_id: unique identifier
+ * @iface_name: interface name
+ *
+ */
+struct ndi_create_req {
+ uint32_t transaction_id;
+ char iface_name[IFACE_NAME_SIZE];
+};
+
+/**
+ * struct ndi_create_rsp - ndi create response params
+ * @status: request status
+ * @reason: reason if any
+ *
+ */
+struct ndi_create_rsp {
+ uint32_t status;
+ uint32_t reason;
+};
+
+/**
+ * struct ndi_delete_rsp - ndi delete response params
+ * @status: request status
+ * @reason: reason if any
+ *
+ */
+struct ndi_delete_rsp {
+ uint32_t status;
+ uint32_t reason;
+};
+
+/**
+ * struct ndp_initiator_req - ndp initiator request params
+ * @transaction_id: unique identifier
+ * @vdev_id: session id of the interface over which ndp is being created
+ * @channel: suggested channel for ndp creation
+ * @service_instance_id: Service identifier
+ * @peer_discovery_mac_addr: Peer's discovery mac address
+ * @self_ndi_mac_addr: self NDI mac address
+ * @ndp_config: ndp configuration params
+ * @ndp_info: ndp application info
+ *
+ */
+struct ndp_initiator_req {
+ uint32_t transaction_id;
+ uint32_t vdev_id;
+ uint32_t channel;
+ uint32_t service_instance_id;
+ struct qdf_mac_addr peer_discovery_mac_addr;
+ struct qdf_mac_addr self_ndi_mac_addr;
+ struct ndp_cfg ndp_config;
+ struct ndp_app_info ndp_info;
+};
+
+/**
+ * struct ndp_initiator_rsp - response event from FW
+ * @transaction_id: unique identifier
+ * @vdev_id: session id of the interface over which ndp is being created
+ * @ndp_instance_id: locally created NDP instance ID
+ * @status: status of the ndp request
+ * @reason: reason for failure if any
+ *
+ */
+struct ndp_initiator_rsp {
+ uint32_t transaction_id;
+ uint32_t vdev_id;
+ uint32_t ndp_instance_id;
+ uint32_t status;
+ uint32_t reason;
+};
+
+/**
+ * struct ndp_indication_event - create ndp indication on the responder
+ * @vdev_id: session id of the interface over which ndp is being created
+ * @service_instance_id: Service identifier
+ * @peer_discovery_mac_addr: Peer's discovery mac address
+ * @peer_mac_addr: Peer's NDI mac address
+ * @ndp_initiator_mac_addr: NDI mac address of the peer initiating NDP
+ * @ndp_instance_id: locally created NDP instance ID
+ * @role: self role for NDP
+ * @ndp_accept_policy: accept policy configured by the upper layer
+ * @ndp_config: ndp configuration params
+ * @ndp_info: ndp application info
+ *
+ */
+struct ndp_indication_event {
+ uint32_t vdev_id;
+ uint32_t service_instance_id;
+ struct qdf_mac_addr peer_discovery_mac_addr;
+ struct qdf_mac_addr peer_mac_addr;
+ uint32_t ndp_instance_id;
+ enum ndp_self_role role;
+ enum ndp_accept_policy policy;
+ struct ndp_cfg ndp_config;
+ struct ndp_app_info ndp_info;
+};
+
+/**
+ * struct ndp_responder_req - responder's response to ndp create request
+ * @transaction_id: unique identifier
+ * @vdev_id: session id of the interface over which ndp is being created
+ * @ndp_instance_id: locally created NDP instance ID
+ * @ndp_rsp: response to the ndp create request
+ * @ndp_config: ndp configuration params
+ * @ndp_info: ndp application info
+ *
+ */
+struct ndp_responder_req {
+ uint32_t transaction_id;
+ uint32_t vdev_id;
+ uint32_t ndp_instance_id;
+ enum ndp_response_code ndp_rsp;
+ struct ndp_cfg ndp_config;
+ struct ndp_app_info ndp_info;
+};
+
+/**
+ * struct ndp_responder_rsp_event - response to responder's request
+ * @transaction_id: unique identifier
+ * @vdev_id: session id of the interface over which ndp is being created
+ * @status: command status
+ * @reason: reason for failure if any
+ * @peer_mac_addr: Peer's mac address
+ *
+ */
+struct ndp_responder_rsp_event {
+ uint32_t transaction_id;
+ uint32_t vdev_id;
+ uint32_t status;
+ uint32_t reason;
+ struct qdf_mac_addr peer_mac_addr;
+};
+
+/**
+ * struct ndp_confirm_event - ndp confirmation event from FW
+ * @vdev_id: session id of the interface over which ndp is being created
+ * @ndp_instance_id: ndp instance id for which confirm is being generated
+ * @reason_code : reason code(opaque to driver)
+ * @num_active_ndps_on_peer: number of ndp instances on peer
+ * @peer_ndi_mac_addr: peer NDI mac address
+ * @rsp_code: ndp response code
+ * @ndp_info: ndp application info
+ *
+ */
+struct ndp_confirm_event {
+ uint32_t vdev_id;
+ uint32_t ndp_instance_id;
+ uint32_t reason_code;
+ uint32_t num_active_ndps_on_peer;
+ struct qdf_mac_addr peer_ndi_mac_addr;
+ enum ndp_response_code rsp_code;
+ struct ndp_app_info ndp_info;
+};
+
+/**
+ * struct ndp_end_req - ndp end request
+ * @transaction_id: unique transaction identifier
+ * @num_ndp_instances: number of ndp instances to be terminated
+ * @ndp_ids: pointer to array of ndp_instance_id to be terminated
+ *
+ */
+struct ndp_end_req {
+ uint32_t transaction_id;
+ uint32_t num_ndp_instances;
+ uint32_t *ndp_ids;
+};
+
+/**
+ * struct peer_ndp_map - mapping of NDP instances to peer to VDEV
+ * @vdev_id: session id of the interface over which ndp is being created
+ * @peer_ndi_mac_addr: peer NDI mac address
+ * @num_active_ndp_sessions: number of active NDP sessions on the peer
+ * @type: NDP end indication type
+ * @reason_code: NDP end indication reason code
+ * @ndp_instance_id: NDP instance ID
+ *
+ */
+struct peer_ndp_map {
+ uint32_t vdev_id;
+ struct qdf_mac_addr peer_ndi_mac_addr;
+ uint32_t num_active_ndp_sessions;
+ enum ndp_end_type type;
+ enum ndp_end_reason_code reason_code;
+ uint32_t ndp_instance_id;
+};
+
+/**
+ * struct ndp_end_rsp_event - firmware response to ndp end request
+ * @transaction_id: unique identifier for the request
+ * @status: status of operation
+ * @reason: reason(opaque to host driver)
+ * @num_ndp_terminated: if successful, number of ndp instances terminated
+ * @num_peers: number of peers in ndp_map
+ * @ndp_map: mapping of NDP instances to peer to VDEV
+ *
+ */
+struct ndp_end_rsp_event {
+ uint32_t transaction_id;
+ uint32_t status;
+ uint32_t reason;
+ uint32_t num_ndp_terminated;
+ uint32_t num_peers;
+ struct peer_ndp_map ndp_map[];
+};
+
+/**
+ * struct ndp_end_indication_event - ndp termination notification from FW
+ * @num_ndp_ids: number of NDP ids
+ * @ndp_map: mapping of NDP instances to peer and vdev
+ *
+ */
+struct ndp_end_indication_event {
+ uint32_t num_ndp_ids;
+ struct peer_ndp_map ndp_map[];
+};
+
+/**
+ * struct ndp_schedule_update_req - ndp schedule update request
+ * @transaction_id: unique identifier
+ * @vdev_id: session id of the interface over which ndp is being created
+ * @ndp_instance_id: ndp instance id for which schedule update is requested
+ * @ndp_qos: new set of qos parameters
+ *
+ */
+struct ndp_schedule_update_req {
+ uint32_t transaction_id;
+ uint32_t vdev_id;
+ uint32_t ndp_instance_id;
+ struct ndp_qos_cfg ndp_qos;
+};
+
+/**
+ * struct ndp_schedule_update_rsp - ndp schedule update response
+ * @transaction_id: unique identifier
+ * @vdev_id: session id of the interface over which ndp is being created
+ * @status: status of the request
+ * @reason: reason code for failure if any
+ *
+ */
+struct ndp_schedule_update_rsp {
+ uint32_t transaction_id;
+ uint32_t vdev_id;
+ uint32_t status;
+ uint32_t reason;
+};
+
+/**
+ * struct sme_ndp_peer_ind - ndp peer indication
+ * @msg_type: message id
+ * @msg_len: message length
+ * @session_id: session id
+ * @peer_mac_addr: peer mac address
+ * @sta_id: station id
+ *
+ */
+struct sme_ndp_peer_ind {
+ uint16_t msg_type;
+ uint16_t msg_len;
+ uint8_t session_id;
+ struct qdf_mac_addr peer_mac_addr;
+ uint16_t sta_id;
+};
+
+#endif /* WLAN_FEATURE_NAN_DATAPATH */
+
+/**
+ * struct sir_p2p_lo_start - p2p listen offload start
+ * @vdev_id: vdev identifier
+ * @ctl_flags: control flag
+ * @freq: p2p listen frequency
+ * @period: listen offload period
+ * @interval: listen offload interval
+ * @count: number listen offload intervals
+ * @device_types: device types
+ * @dev_types_len: device types length
+ * @probe_resp_tmplt: probe response template
+ * @probe_resp_len: probe response template length
+ */
+struct sir_p2p_lo_start {
+ uint32_t vdev_id;
+ uint32_t ctl_flags;
+ uint32_t freq;
+ uint32_t period;
+ uint32_t interval;
+ uint32_t count;
+ uint8_t *device_types;
+ uint32_t dev_types_len;
+ uint8_t *probe_resp_tmplt;
+ uint32_t probe_resp_len;
+};
+
+/**
+ * struct sir_p2p_lo_event - P2P listen offload stop event
+ * @vdev_id: vdev identifier
+ * @reason_code: P2P listen offload stop reason
+ */
+struct sir_p2p_lo_event {
+ uint32_t vdev_id;
+ uint32_t reason_code;
+};
+
+/**
+ * struct sir_hal_pwr_dbg_cmd - unit test command parameters
+ * @pdev_id: pdev id
+ * @module_id: module id
+ * @num_args: number of arguments
+ * @args: arguments
+ */
+struct sir_mac_pwr_dbg_cmd {
+ uint32_t pdev_id;
+ uint32_t module_id;
+ uint32_t num_args;
+ uint32_t args[MAX_POWER_DBG_ARGS_SUPPORTED];
+};
+
#endif /* __SIR_API_H */
diff --git a/core/mac/inc/wni_api.h b/core/mac/inc/wni_api.h
index 76eb1c21bddc..c8e5cf1ae3ec 100644
--- a/core/mac/inc/wni_api.h
+++ b/core/mac/inc/wni_api.h
@@ -252,6 +252,17 @@ enum eWniMsgTypes {
eWNI_SME_TSF_EVENT,
eWNI_SME_MON_INIT_SESSION,
eWNI_SME_PDEV_SET_HT_VHT_IE,
+ eWNI_SME_NDP_INITIATOR_REQ,
+ eWNI_SME_NDP_INITIATOR_RSP,
+ eWNI_SME_NDP_NEW_PEER_IND,
+ eWNI_SME_NDP_CONFIRM_IND,
+ eWNI_SME_NDP_INDICATION,
+ eWNI_SME_NDP_RESPONDER_REQ,
+ eWNI_SME_NDP_RESPONDER_RSP,
+ eWNI_SME_NDP_END_REQ,
+ eWNI_SME_NDP_END_RSP,
+ eWNI_SME_NDP_PEER_DEPARTED_IND,
+ eWNI_SME_NDP_END_IND,
eWNI_SME_MSG_TYPES_END
};
diff --git a/core/mac/inc/wni_cfg.h b/core/mac/inc/wni_cfg.h
index db3abb294002..f57eb2e089ea 100644
--- a/core/mac/inc/wni_cfg.h
+++ b/core/mac/inc/wni_cfg.h
@@ -141,7 +141,6 @@ enum {
WNI_CFG_DYNAMIC_THRESHOLD_TWO,
WNI_CFG_SCAN_CONTROL_LIST,
WNI_CFG_BLOCK_ACK_ENABLED,
- WNI_CFG_HT_RX_STBC,
WNI_CFG_HT_CAP_INFO,
WNI_CFG_HT_AMPDU_PARAMS,
WNI_CFG_SUPPORTED_MCS_SET,
@@ -153,7 +152,6 @@ enum {
WNI_CFG_HT_INFO_FIELD3,
WNI_CFG_BASIC_MCS_SET,
WNI_CFG_CURRENT_MCS_SET,
- WNI_CFG_GREENFIELD_CAPABILITY,
WNI_CFG_VHT_MAX_MPDU_LENGTH,
WNI_CFG_VHT_SUPPORTED_CHAN_WIDTH_SET,
WNI_CFG_VHT_LDPC_CODING_CAP,
@@ -183,11 +181,8 @@ enum {
WNI_CFG_VHT_40MHZ_UTILIZATION,
WNI_CFG_VHT_80MHZ_UTILIZATION,
WNI_CFG_VHT_160MHZ_UTILIZATION,
- WNI_CFG_MAX_AMSDU_LENGTH,
WNI_CFG_MPDU_DENSITY,
WNI_CFG_MAX_RX_AMPDU_FACTOR,
- WNI_CFG_SHORT_GI_20MHZ,
- WNI_CFG_SHORT_GI_40MHZ,
WNI_CFG_MAX_PS_POLL,
WNI_CFG_RSSI_FILTER_PERIOD,
WNI_CFG_SCAN_IN_POWERSAVE,
diff --git a/core/mac/src/cfg/cfg_api.c b/core/mac/src/cfg/cfg_api.c
index 18c7afe7b8eb..c351063cff4c 100644
--- a/core/mac/src/cfg/cfg_api.c
+++ b/core/mac/src/cfg/cfg_api.c
@@ -727,7 +727,8 @@ tSirRetStatus cfg_get_capability_info(tpAniSirGlobal pMac, uint16_t *pCap,
else if (LIM_IS_AP_ROLE(sessionEntry) ||
LIM_IS_STA_ROLE(sessionEntry))
pCapInfo->ess = 1; /* ESS bit */
- else if (LIM_IS_P2P_DEVICE_ROLE(sessionEntry)) {
+ else if (LIM_IS_P2P_DEVICE_ROLE(sessionEntry) ||
+ LIM_IS_NDI_ROLE(sessionEntry)) {
pCapInfo->ess = 0;
pCapInfo->ibss = 0;
} else
diff --git a/core/mac/src/cfg/cfg_proc_msg.c b/core/mac/src/cfg/cfg_proc_msg.c
index 6fae32353106..987569e74f48 100644
--- a/core/mac/src/cfg/cfg_proc_msg.c
+++ b/core/mac/src/cfg/cfg_proc_msg.c
@@ -549,12 +549,6 @@ cgstatic cfg_static[CFG_PARAM_MAX_NUM] = {
WNI_CFG_BLOCK_ACK_ENABLED_STAMIN,
WNI_CFG_BLOCK_ACK_ENABLED_STAMAX,
WNI_CFG_BLOCK_ACK_ENABLED_STADEF},
- {WNI_CFG_HT_RX_STBC,
- CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT |
- CFG_CTL_RESTART | CFG_CTL_NTF_LIM,
- WNI_CFG_HT_RX_STBC_STAMIN,
- WNI_CFG_HT_RX_STBC_STAMAX,
- WNI_CFG_HT_RX_STBC_STADEF},
{WNI_CFG_HT_CAP_INFO,
CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT |
CFG_CTL_RESTART | CFG_CTL_NTF_LIM,
@@ -615,12 +609,6 @@ cgstatic cfg_static[CFG_PARAM_MAX_NUM] = {
CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_SAVE |
CFG_CTL_RESTART | CFG_CTL_NTF_LIM,
0, 0, 0},
- {WNI_CFG_GREENFIELD_CAPABILITY,
- CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART |
- CFG_CTL_NTF_LIM,
- WNI_CFG_GREENFIELD_CAPABILITY_STAMIN,
- WNI_CFG_GREENFIELD_CAPABILITY_STAMAX,
- WNI_CFG_GREENFIELD_CAPABILITY_STADEF},
{WNI_CFG_VHT_MAX_MPDU_LENGTH,
CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT |
CFG_CTL_NTF_LIM,
@@ -795,12 +783,6 @@ cgstatic cfg_static[CFG_PARAM_MAX_NUM] = {
WNI_CFG_VHT_80MHZ_UTILIZATION_STADEF,
WNI_CFG_VHT_160MHZ_UTILIZATION_STAMAX,
WNI_CFG_VHT_160MHZ_UTILIZATION_STADEF},
- {WNI_CFG_MAX_AMSDU_LENGTH,
- CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT |
- CFG_CTL_RESTART | CFG_CTL_NTF_LIM,
- WNI_CFG_MAX_AMSDU_LENGTH_STAMIN,
- WNI_CFG_MAX_AMSDU_LENGTH_STAMAX,
- WNI_CFG_MAX_AMSDU_LENGTH_STADEF},
{WNI_CFG_MPDU_DENSITY,
CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT |
CFG_CTL_RESTART | CFG_CTL_NTF_LIM,
@@ -813,18 +795,6 @@ cgstatic cfg_static[CFG_PARAM_MAX_NUM] = {
WNI_CFG_MAX_RX_AMPDU_FACTOR_STAMIN,
WNI_CFG_MAX_RX_AMPDU_FACTOR_STAMAX,
WNI_CFG_MAX_RX_AMPDU_FACTOR_STAMAX},
- {WNI_CFG_SHORT_GI_20MHZ,
- CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT |
- CFG_CTL_RESTART | CFG_CTL_NTF_LIM,
- WNI_CFG_SHORT_GI_20MHZ_STAMIN,
- WNI_CFG_SHORT_GI_20MHZ_STAMAX,
- WNI_CFG_SHORT_GI_20MHZ_STADEF},
- {WNI_CFG_SHORT_GI_40MHZ,
- CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT |
- CFG_CTL_RESTART | CFG_CTL_NTF_LIM,
- WNI_CFG_SHORT_GI_40MHZ_STAMIN,
- WNI_CFG_SHORT_GI_40MHZ_STAMAX,
- WNI_CFG_SHORT_GI_40MHZ_STADEF},
{WNI_CFG_MAX_PS_POLL,
CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT |
CFG_CTL_NTF_LIM,
diff --git a/core/mac/src/include/sir_params.h b/core/mac/src/include/sir_params.h
index a871bc618357..cde2bd73a830 100644
--- a/core/mac/src/include/sir_params.h
+++ b/core/mac/src/include/sir_params.h
@@ -606,7 +606,7 @@ typedef struct sSirMbMsgP2p {
#define SIR_HAL_ADD_BCN_FILTER_CMDID (SIR_HAL_ITC_MSG_TYPES_BEGIN + 339)
#define SIR_HAL_REMOVE_BCN_FILTER_CMDID (SIR_HAL_ITC_MSG_TYPES_BEGIN + 340)
-#define SIR_HAL_BPF_GET_CAPABILITIES_REQ (SIR_HAL_ITC_MSG_TYPES_BEGIN + 341)
+#define SIR_HAL_BPF_GET_CAPABILITIES_REQ (SIR_HAL_ITC_MSG_TYPES_BEGIN + 341)
#define SIR_HAL_BPF_SET_INSTRUCTIONS_REQ (SIR_HAL_ITC_MSG_TYPES_BEGIN + 342)
#define SIR_HAL_SET_WISA_PARAMS (SIR_HAL_ITC_MSG_TYPES_BEGIN + 343)
@@ -617,6 +617,20 @@ typedef struct sSirMbMsgP2p {
#define SIR_HAL_TDLS_CONNECTION_TRACKER_NOTIFICATION (SIR_HAL_ITC_MSG_TYPES_BEGIN + 346)
#endif
+#define SIR_HAL_NDP_GET_CAP_REQ (SIR_HAL_ITC_MSG_TYPES_BEGIN + 347)
+#define SIR_HAL_NDP_INITIATOR_REQ (SIR_HAL_ITC_MSG_TYPES_BEGIN + 348)
+#define SIR_HAL_NDP_RESPONDER_REQ (SIR_HAL_ITC_MSG_TYPES_BEGIN + 349)
+#define SIR_HAL_NDP_END_REQ (SIR_HAL_ITC_MSG_TYPES_BEGIN + 350)
+#define SIR_HAL_NDI_CAP_RSP (SIR_HAL_ITC_MSG_TYPES_BEGIN + 351)
+#define SIR_HAL_NDP_INITIATOR_RSP (SIR_HAL_ITC_MSG_TYPES_BEGIN + 352)
+#define SIR_HAL_NDP_RESPONDER_RSP (SIR_HAL_ITC_MSG_TYPES_BEGIN + 353)
+#define SIR_HAL_NDP_END_RSP (SIR_HAL_ITC_MSG_TYPES_BEGIN + 354)
+#define SIR_HAL_NDP_INDICATION (SIR_HAL_ITC_MSG_TYPES_BEGIN + 355)
+#define SIR_HAL_NDP_CONFIRM (SIR_HAL_ITC_MSG_TYPES_BEGIN + 356)
+#define SIR_HAL_NDP_END_IND (SIR_HAL_ITC_MSG_TYPES_BEGIN + 357)
+
+#define SIR_HAL_POWER_DBG_CMD (SIR_HAL_ITC_MSG_TYPES_BEGIN + 347)
+
#define SIR_HAL_MSG_TYPES_END (SIR_HAL_MSG_TYPES_BEGIN + 0x1FF)
/* CFG message types */
@@ -736,8 +750,6 @@ typedef struct sSirMbMsgP2p {
#define SIR_TST_XMIT_MSG_QS_EMPTY_EVT 0x00000080
-/* added for OBSS */
-
/* Param Change Bitmap sent to HAL */
#define PARAM_BCN_INTERVAL_CHANGED (1 << 0)
#define PARAM_SHORT_PREAMBLE_CHANGED (1 << 1)
diff --git a/core/mac/src/pe/include/lim_api.h b/core/mac/src/pe/include/lim_api.h
index dabb6b4d76e5..82f9a2cff61a 100644
--- a/core/mac/src/pe/include/lim_api.h
+++ b/core/mac/src/pe/include/lim_api.h
@@ -62,6 +62,8 @@
#define LIM_IS_UNKNOWN_ROLE(psessionEntry) (GET_LIM_SYSTEM_ROLE(psessionEntry) == eLIM_UNKNOWN_ROLE)
#define LIM_IS_P2P_DEVICE_ROLE(psessionEntry) (GET_LIM_SYSTEM_ROLE(psessionEntry) == eLIM_P2P_DEVICE_ROLE)
#define LIM_IS_P2P_DEVICE_GO(psessionEntry) (GET_LIM_SYSTEM_ROLE(psessionEntry) == eLIM_P2P_DEVICE_GO)
+#define LIM_IS_NDI_ROLE(psessionEntry) \
+ (GET_LIM_SYSTEM_ROLE(psessionEntry) == eLIM_NDI_ROLE)
/* gLimSmeState */
#define GET_LIM_SME_STATE(pMac) (pMac->lim.gLimSmeState)
#define SET_LIM_SME_STATE(pMac, state) (pMac->lim.gLimSmeState = state)
diff --git a/core/mac/src/pe/include/lim_global.h b/core/mac/src/pe/include/lim_global.h
index 5529f6bbc70f..4ee0f0b113af 100644
--- a/core/mac/src/pe/include/lim_global.h
+++ b/core/mac/src/pe/include/lim_global.h
@@ -83,7 +83,8 @@ typedef enum eLimSystemRole {
eLIM_STA_ROLE,
eLIM_P2P_DEVICE_ROLE,
eLIM_P2P_DEVICE_GO,
- eLIM_P2P_DEVICE_CLIENT
+ eLIM_P2P_DEVICE_CLIENT,
+ eLIM_NDI_ROLE
} tLimSystemRole;
/*
diff --git a/core/mac/src/pe/lim/lim_api.c b/core/mac/src/pe/lim/lim_api.c
index b98a5f0cfb93..941a893bf000 100644
--- a/core/mac/src/pe/lim/lim_api.c
+++ b/core/mac/src/pe/lim/lim_api.c
@@ -69,6 +69,7 @@
#include "cds_utils.h"
#include "sys_startup.h"
#include "cds_concurrency.h"
+#include "nan_datapath.h"
static void __lim_init_scan_vars(tpAniSirGlobal pMac)
{
@@ -408,39 +409,6 @@ static tSirRetStatus __lim_init_config(tpAniSirGlobal pMac)
pMac->sys.gSysEnableLinkMonitorMode = 1;
}
- /* WNI_CFG_SHORT_GI_20MHZ */
-
- if (wlan_cfg_get_int(pMac, WNI_CFG_HT_CAP_INFO, &val1) != eSIR_SUCCESS) {
- PELOGE(lim_log(pMac, LOGE, FL("could not retrieve HT Cap CFG"));)
- return eSIR_FAILURE;
- }
- if (wlan_cfg_get_int(pMac, WNI_CFG_SHORT_GI_20MHZ, &val2) != eSIR_SUCCESS) {
- PELOGE(lim_log
- (pMac, LOGE, FL("could not retrieve shortGI 20Mhz CFG"));
- )
- return eSIR_FAILURE;
- }
- if (wlan_cfg_get_int(pMac, WNI_CFG_SHORT_GI_40MHZ, &val3) != eSIR_SUCCESS) {
- PELOGE(lim_log
- (pMac, LOGE, FL("could not retrieve shortGI 40Mhz CFG"));
- )
- return eSIR_FAILURE;
- }
-
- val16 = (uint16_t) val1;
- pHTCapabilityInfo = (tSirMacHTCapabilityInfo *) &val16;
- pHTCapabilityInfo->shortGI20MHz = (uint16_t) val2;
- pHTCapabilityInfo->shortGI40MHz = (uint16_t) val3;
-
- if (cfg_set_int
- (pMac, WNI_CFG_HT_CAP_INFO,
- *(uint16_t *) pHTCapabilityInfo) != eSIR_SUCCESS) {
- PELOGE(lim_log
- (pMac, LOGE, FL("could not update HT Cap Info CFG"));
- )
- return eSIR_FAILURE;
- }
-
/* WNI_CFG_MAX_RX_AMPDU_FACTOR */
if (wlan_cfg_get_int(pMac, WNI_CFG_HT_AMPDU_PARAMS, &val1) !=
@@ -1065,13 +1033,15 @@ QDF_STATUS pe_handle_mgmt_frame(void *p_cds_gctx, void *cds_buff)
}
/**
- * pe_register_wma_handle() - register management frame handler to WMA
+ * pe_register_callbacks_with_wma() - register SME and PE callback functions to
+ * WMA.
* @pMac: mac global ctx
- * @ready_req: Ready request parameters
+ * @ready_req: Ready request parameters, containing callback pointers
*
* Return: None
*/
-void pe_register_wma_handle(tpAniSirGlobal pMac, tSirSmeReadyReq *ready_req)
+void pe_register_callbacks_with_wma(tpAniSirGlobal pMac,
+ tSirSmeReadyReq *ready_req)
{
void *p_cds_gctx;
QDF_STATUS retStatus;
@@ -1090,6 +1060,11 @@ void pe_register_wma_handle(tpAniSirGlobal pMac, tSirSmeReadyReq *ready_req)
if (retStatus != QDF_STATUS_SUCCESS)
lim_log(pMac, LOGP,
FL("Registering roaming callbacks with WMA failed"));
+
+ retStatus = wma_register_ndp_cb(lim_handle_ndp_event_message);
+ if (retStatus != QDF_STATUS_SUCCESS)
+ lim_log(pMac, LOGE,
+ FL("Registering NDP callbacks with WMA failed"));
}
/**
diff --git a/core/mac/src/pe/lim/lim_assoc_utils.c b/core/mac/src/pe/lim/lim_assoc_utils.c
index ff2b233f2a80..d2716344806b 100644
--- a/core/mac/src/pe/lim/lim_assoc_utils.c
+++ b/core/mac/src/pe/lim/lim_assoc_utils.c
@@ -2657,8 +2657,6 @@ lim_add_sta_self(tpAniSirGlobal pMac, uint16_t staIdx, uint8_t updateSta,
tSirRetStatus retCode = eSIR_SUCCESS;
tSirMacAddr staMac;
uint32_t listenInterval = WNI_CFG_LISTEN_INTERVAL_STADEF;
- uint32_t shortGi20MhzSupport;
- uint32_t shortGi40MhzSupport;
uint32_t ampduLenExponent = 0;
/*This self Sta dot 11 mode comes from the cfg and the expectation here is
* that cfg carries the systemwide capability that device under
@@ -2762,51 +2760,10 @@ lim_add_sta_self(tpAniSirGlobal pMac, uint16_t staIdx, uint8_t updateSta,
pAddStaParams->fDsssCckMode40Mhz =
lim_get_ht_capability(pMac, eHT_DSSS_CCK_MODE_40MHZ,
psessionEntry);
- /*
- * We will read the gShortGI20Mhz from ini file, and if it is set
- * to 1 then we will tell Peer that we support 40Mhz short GI
- */
- if (IS_SIR_STATUS_SUCCESS(wlan_cfg_get_int
- (pMac, WNI_CFG_SHORT_GI_20MHZ,
- &shortGi20MhzSupport))) {
- if (true == shortGi20MhzSupport) {
- pAddStaParams->fShortGI20Mhz =
- WNI_CFG_SHORT_GI_20MHZ_STAMAX;
- } else {
- pAddStaParams->fShortGI20Mhz = false;
- }
- } else {
- PELOGE(lim_log
- (pMac, LOGE,
- FL("could not retrieve shortGI 20Mhz"
- "CFG,setting value to default"));
- )
- pAddStaParams->fShortGI20Mhz =
- WNI_CFG_SHORT_GI_20MHZ_STADEF;
- }
-
- /*
- * We will read the gShortGI40Mhz from ini file, and if it is set
- * to 1 then we will tell Peer that we support 40Mhz short GI
- */
- if (IS_SIR_STATUS_SUCCESS(wlan_cfg_get_int
- (pMac, WNI_CFG_SHORT_GI_40MHZ,
- &shortGi40MhzSupport))) {
- if (true == shortGi40MhzSupport) {
- pAddStaParams->fShortGI40Mhz =
- WNI_CFG_SHORT_GI_40MHZ_STAMAX;
- } else {
- pAddStaParams->fShortGI40Mhz = false;
- }
- } else {
- PELOGE(lim_log
- (pMac, LOGE,
- FL("could not retrieve shortGI 40Mhz"
- "CFG,setting value to default"));
- )
- pAddStaParams->fShortGI40Mhz =
- WNI_CFG_SHORT_GI_40MHZ_STADEF;
- }
+ pAddStaParams->fShortGI20Mhz =
+ psessionEntry->htConfig.ht_sgi20;
+ pAddStaParams->fShortGI40Mhz =
+ psessionEntry->htConfig.ht_sgi40;
lim_log(pMac, LOG2,
FL(" greenFieldCapable: %d maxAmpduDensity = %d "
"maxAmpduSize = %d"),
@@ -3543,8 +3500,6 @@ tSirRetStatus lim_sta_send_add_bss(tpAniSirGlobal pMac, tpSirAssocRsp pAssocRsp,
uint32_t retCode;
tpDphHashNode pStaDs = NULL;
uint8_t chanWidthSupp = 0;
- uint32_t shortGi20MhzSupport;
- uint32_t shortGi40MhzSupport;
uint32_t enableTxBF20MHz;
tDot11fIEVHTCaps *vht_caps = NULL;
tDot11fIEVHTOperation *vht_oper = NULL;
@@ -3853,47 +3808,23 @@ tSirRetStatus lim_sta_send_add_bss(tpAniSirGlobal pMac, tpSirAssocRsp pAssocRsp,
(uint8_t) pAssocRsp->HTCaps.dsssCckMode40MHz;
/*
* We will check gShortGI20Mhz and gShortGI40Mhz from
- * ini file. if they are set then we will use what ever
+ * session entry if they are set then we will use what ever
* Assoc response coming from AP supports. If these
- * values are set as 0 in ini file then we will
+ * values are set as 0 in session entry then we will
* hardcode this values to 0.
*/
- if (IS_SIR_STATUS_SUCCESS(wlan_cfg_get_int
- (pMac, WNI_CFG_SHORT_GI_20MHZ,
- &shortGi20MhzSupport))) {
- if (true == shortGi20MhzSupport) {
- pAddBssParams->staContext.
- fShortGI20Mhz =
- (uint8_t) pAssocRsp->HTCaps.
- shortGI20MHz;
- } else {
- pAddBssParams->staContext.
- fShortGI20Mhz = false;
- }
- } else {
- lim_log(pMac, LOGE, FL(
- "failed to get shortGI 20Mhz, set default"));
+ if (psessionEntry->htConfig.ht_sgi20) {
pAddBssParams->staContext.fShortGI20Mhz =
- WNI_CFG_SHORT_GI_20MHZ_STADEF;
- }
-
- if (IS_SIR_STATUS_SUCCESS(wlan_cfg_get_int
- (pMac, WNI_CFG_SHORT_GI_40MHZ,
- &shortGi40MhzSupport))) {
- if (true == shortGi40MhzSupport) {
- pAddBssParams->staContext.
- fShortGI40Mhz =
- (uint8_t) pAssocRsp->HTCaps.
- shortGI40MHz;
+ (uint8_t)pAssocRsp->HTCaps.shortGI20MHz;
} else {
- pAddBssParams->staContext.
- fShortGI40Mhz = false;
+ pAddBssParams->staContext.fShortGI20Mhz = false;
}
+
+ if (psessionEntry->htConfig.ht_sgi40) {
+ pAddBssParams->staContext.fShortGI40Mhz =
+ (uint8_t) pAssocRsp->HTCaps.shortGI40MHz;
} else {
- lim_log(pMac, LOGE, FL(
- "failed to get shortGI 40Mhz, set default"));
- pAddBssParams->staContext.fShortGI40Mhz =
- WNI_CFG_SHORT_GI_40MHZ_STADEF;
+ pAddBssParams->staContext.fShortGI40Mhz = false;
}
if (!pAddBssParams->staContext.vhtCapable)
@@ -4091,8 +4022,6 @@ tSirRetStatus lim_sta_send_add_bss_pre_assoc(tpAniSirGlobal pMac, uint8_t update
uint32_t retCode;
tSchBeaconStruct *pBeaconStruct;
uint8_t chanWidthSupp = 0;
- uint32_t shortGi20MhzSupport;
- uint32_t shortGi40MhzSupport;
tDot11fIEVHTOperation *vht_oper = NULL;
tDot11fIEVHTCaps *vht_caps = NULL;
@@ -4374,12 +4303,11 @@ tSirRetStatus lim_sta_send_add_bss_pre_assoc(tpAniSirGlobal pMac, uint8_t update
vht_oper->chanWidth)
pAddBssParams->staContext.ch_width =
vht_oper->chanWidth + 1;
- lim_log(pMac, LOG2, FL(
- "StaCtx: vhtCap %d ch_bw %d TxBF %d"),
- pAddBssParams->staContext.vhtCapable,
- pAddBssParams->staContext.ch_width,
- pAddBssParams->staContext.
- vhtTxBFCapable);
+ lim_log(pMac, LOG2,
+ FL("StaCtx: vhtCap %d ch_bw %d TxBF %d"),
+ pAddBssParams->staContext.vhtCapable,
+ pAddBssParams->staContext.ch_width,
+ pAddBssParams->staContext.vhtTxBFCapable);
} else {
pAddBssParams->staContext.ch_width =
CH_WIDTH_20MHZ;
@@ -4399,40 +4327,18 @@ tSirRetStatus lim_sta_send_add_bss_pre_assoc(tpAniSirGlobal pMac, uint8_t update
* from AP supports. If these values are set as 0 in ini file
* then we will hardcode this values to 0.
*/
- if (IS_SIR_STATUS_SUCCESS(wlan_cfg_get_int
- (pMac, WNI_CFG_SHORT_GI_20MHZ,
- &shortGi20MhzSupport))) {
- if (true == shortGi20MhzSupport)
- pAddBssParams->staContext.fShortGI20Mhz =
+ if (true == psessionEntry->htConfig.ht_sgi20)
+ pAddBssParams->staContext.fShortGI20Mhz =
(uint8_t)pBeaconStruct->HTCaps.shortGI20MHz;
- else
+ else
pAddBssParams->staContext.fShortGI20Mhz =
false;
- } else {
- lim_log(pMac, LOGE, FL(
- "get shortGI 20Mhz failed, set default"));
- pAddBssParams->staContext.fShortGI20Mhz =
- WNI_CFG_SHORT_GI_20MHZ_STADEF;
- }
- if (IS_SIR_STATUS_SUCCESS(wlan_cfg_get_int
- (pMac, WNI_CFG_SHORT_GI_40MHZ,
- &shortGi40MhzSupport))) {
- if (true == shortGi40MhzSupport) {
- pAddBssParams->staContext.
- fShortGI40Mhz =
- (uint8_t) pBeaconStruct->HTCaps.
- shortGI40MHz;
- } else {
- pAddBssParams->staContext.
- fShortGI40Mhz = false;
- }
- } else {
- lim_log(pMac, LOGE, FL(
- "get shortGI 40Mhz failed, set default"));
- pAddBssParams->staContext.fShortGI40Mhz =
- WNI_CFG_SHORT_GI_40MHZ_STADEF;
- }
+ if (true == psessionEntry->htConfig.ht_sgi40)
+ pAddBssParams->staContext.fShortGI40Mhz =
+ (uint8_t) pBeaconStruct->HTCaps.shortGI40MHz;
+ else
+ pAddBssParams->staContext.fShortGI40Mhz = false;
pAddBssParams->staContext.maxAmpduSize =
pBeaconStruct->HTCaps.maxRxAMPDUFactor;
diff --git a/core/mac/src/pe/lim/lim_link_monitoring_algo.c b/core/mac/src/pe/lim/lim_link_monitoring_algo.c
index 8809210ac503..908ff896c06f 100644
--- a/core/mac/src/pe/lim/lim_link_monitoring_algo.c
+++ b/core/mac/src/pe/lim/lim_link_monitoring_algo.c
@@ -216,23 +216,41 @@ void lim_delete_sta_context(tpAniSirGlobal mac_ctx, tpSirMsgQ lim_msg)
{
tpDeleteStaContext msg = (tpDeleteStaContext) lim_msg->bodyptr;
tpPESession session_entry;
- uint8_t session_id;
+ tpDphHashNode sta_ds;
if (NULL == msg) {
lim_log(mac_ctx, LOGE, FL("Invalid body pointer in message"));
return;
}
- session_entry = pe_find_session_by_bssid(mac_ctx, msg->bssId,
- &session_id);
+ session_entry = pe_find_session_by_sme_session_id(mac_ctx, msg->vdev_id);
if (NULL == session_entry) {
- lim_log(mac_ctx, LOGE, FL("session does not exist"));
+ lim_log(mac_ctx, LOGE,
+ FL("session not found for given sme session"));
qdf_mem_free(msg);
return;
}
switch (msg->reasonCode) {
case HAL_DEL_STA_REASON_CODE_KEEP_ALIVE:
- case HAL_DEL_STA_REASON_CODE_TIM_BASED:
+ if (LIM_IS_STA_ROLE(session_entry) && !msg->is_tdls) {
+ sta_ds = dph_get_hash_entry(mac_ctx,
+ DPH_STA_HASH_INDEX_PEER,
+ &session_entry->dph.dphHashTable);
+ if (NULL == sta_ds) {
+ lim_log(mac_ctx, LOGE,
+ FL("Dph entry not found."));
+ qdf_mem_free(msg);
+ return;
+ }
+ lim_send_deauth_mgmt_frame(mac_ctx,
+ eSIR_MAC_DISASSOC_DUE_TO_INACTIVITY_REASON,
+ msg->addr2, session_entry, false);
+ lim_tear_down_link_with_ap(mac_ctx,
+ session_entry->peSessionId,
+ eSIR_MAC_UNSPEC_FAILURE_REASON);
+ /* only break for STA role (non TDLS) */
+ break;
+ }
lim_delete_sta_util(mac_ctx, msg, session_entry);
break;
diff --git a/core/mac/src/pe/lim/lim_process_assoc_req_frame.c b/core/mac/src/pe/lim/lim_process_assoc_req_frame.c
index 8fae7d389749..3df3481d79e5 100644
--- a/core/mac/src/pe/lim/lim_process_assoc_req_frame.c
+++ b/core/mac/src/pe/lim/lim_process_assoc_req_frame.c
@@ -1211,7 +1211,6 @@ static bool lim_update_sta_ds(tpAniSirGlobal mac_ctx, tpSirMacMgmtHdr hdr,
bool *assoc_req_copied, uint16_t peer_idx,
tHalBitVal qos_mode, bool pmf_connection)
{
- uint32_t cfg_short_gi_20, cfg_short_gi_40;
tHalBitVal wme_mode, wsm_mode;
uint8_t *ht_cap_ie = NULL;
#ifdef WLAN_FEATURE_11W
@@ -1296,14 +1295,7 @@ static bool lim_update_sta_ds(tpAniSirGlobal mac_ctx, tpSirMacMgmtHdr hdr,
/* assoc_req will be copied to session->parsedAssocReq later */
ht_cap_ie = ((uint8_t *) &assoc_req->HTCaps) + 1;
- /* check whether AP is enabled with shortGI */
- if (wlan_cfg_get_int(mac_ctx, WNI_CFG_SHORT_GI_20MHZ,
- &cfg_short_gi_20) != eSIR_SUCCESS) {
- PELOGE(lim_log(mac_ctx, LOGE,
- FL("could not retrieve shortGI 20Mhz CFG"));)
- return false;
- }
- if (cfg_short_gi_20) {
+ if (session->htConfig.ht_sgi20) {
sta_ds->htShortGI20Mhz =
(uint8_t)assoc_req->HTCaps.shortGI20MHz;
} else {
@@ -1312,13 +1304,7 @@ static bool lim_update_sta_ds(tpAniSirGlobal mac_ctx, tpSirMacMgmtHdr hdr,
sta_ds->htShortGI20Mhz = 0;
}
- if (wlan_cfg_get_int(mac_ctx, WNI_CFG_SHORT_GI_40MHZ,
- &cfg_short_gi_40) != eSIR_SUCCESS) {
- PELOGE(lim_log(mac_ctx, LOGE,
- FL("could not retrieve shortGI 40Mhz CFG"));)
- return false;
- }
- if (cfg_short_gi_40) {
+ if (session->htConfig.ht_sgi40) {
sta_ds->htShortGI40Mhz =
(uint8_t)assoc_req->HTCaps.shortGI40MHz;
} else {
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 9d121546a064..c6d9d70a9a25 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
@@ -75,8 +75,6 @@ static void lim_update_stads_htcap(tpAniSirGlobal mac_ctx,
{
uint16_t highest_rxrate = 0;
tDot11fIEHTCaps *ht_caps;
- uint32_t shortgi_20mhz_support;
- uint32_t shortgi_40mhz_support;
ht_caps = &assoc_rsp->HTCaps;
sta_ds->mlmStaContext.htCapability = assoc_rsp->HTCaps.present;
@@ -123,35 +121,17 @@ static void lim_update_stads_htcap(tpAniSirGlobal mac_ctx,
/* Check if we have support for gShortGI20Mhz and
* gShortGI40Mhz from ini file
*/
- if (eSIR_SUCCESS == wlan_cfg_get_int(mac_ctx,
- WNI_CFG_SHORT_GI_20MHZ,
- &shortgi_20mhz_support)) {
- if (true == shortgi_20mhz_support)
- sta_ds->htShortGI20Mhz =
- (uint8_t)assoc_rsp->HTCaps.shortGI20MHz;
- else
- sta_ds->htShortGI20Mhz = false;
- } else {
- lim_log(mac_ctx, LOGE,
- FL("could not retrieve shortGI 20Mhz CFG, setting value to default"));
+ if (session_entry->htConfig.ht_sgi20)
sta_ds->htShortGI20Mhz =
- WNI_CFG_SHORT_GI_20MHZ_STADEF;
- }
+ (uint8_t)assoc_rsp->HTCaps.shortGI20MHz;
+ else
+ sta_ds->htShortGI20Mhz = false;
- if (eSIR_SUCCESS == wlan_cfg_get_int(mac_ctx,
- WNI_CFG_SHORT_GI_40MHZ,
- &shortgi_40mhz_support)) {
- if (true == shortgi_40mhz_support)
- sta_ds->htShortGI40Mhz =
- (uint8_t)assoc_rsp->HTCaps.shortGI40MHz;
- else
- sta_ds->htShortGI40Mhz = false;
- } else {
- lim_log(mac_ctx, LOGE,
- FL("could not retrieve shortGI 40Mhz CFG,setting value to default"));
+ if (session_entry->htConfig.ht_sgi40)
sta_ds->htShortGI40Mhz =
- WNI_CFG_SHORT_GI_40MHZ_STADEF;
- }
+ (uint8_t)assoc_rsp->HTCaps.shortGI40MHz;
+ else
+ sta_ds->htShortGI40Mhz = false;
}
}
diff --git a/core/mac/src/pe/lim/lim_process_cfg_updates.c b/core/mac/src/pe/lim/lim_process_cfg_updates.c
index d8f8dad24c6d..7f4c16e2ac6f 100644
--- a/core/mac/src/pe/lim/lim_process_cfg_updates.c
+++ b/core/mac/src/pe/lim/lim_process_cfg_updates.c
@@ -206,7 +206,6 @@ void lim_handle_cf_gparam_update(tpAniSirGlobal pMac, uint32_t cfgId)
{
uint32_t val1, val2;
uint16_t val16;
- tSirMacHTCapabilityInfo *pHTCapabilityInfo;
tSirMacHTParametersInfo *pAmpduParamInfo;
PELOG3(lim_log
@@ -262,149 +261,7 @@ void lim_handle_cf_gparam_update(tpAniSirGlobal pMac, uint32_t cfgId)
)
break;
}
- case WNI_CFG_GREENFIELD_CAPABILITY:
- if (wlan_cfg_get_int(pMac, WNI_CFG_HT_CAP_INFO, &val1) !=
- eSIR_SUCCESS) {
- PELOGE(lim_log
- (pMac, LOGE,
- FL("could not retrieve HT Cap Info CFG"));
- )
- break;
- }
- if (wlan_cfg_get_int(pMac, WNI_CFG_GREENFIELD_CAPABILITY, &val2)
- != eSIR_SUCCESS) {
- PELOGE(lim_log
- (pMac, LOGE,
- FL("could not retrieve GreenField CFG"));
- )
- break;
- }
- val16 = (uint16_t) val1;
- pHTCapabilityInfo = (tSirMacHTCapabilityInfo *) &val16;
- pHTCapabilityInfo->greenField = (uint16_t) val2;
- if (cfg_set_int
- (pMac, WNI_CFG_HT_CAP_INFO,
- *(uint16_t *) pHTCapabilityInfo) != eSIR_SUCCESS)
- PELOGE(lim_log
- (pMac, LOGE,
- FL("could not update HT Cap Info CFG"));
- )
- break;
-
- case WNI_CFG_HT_RX_STBC:
- if (wlan_cfg_get_int(pMac, WNI_CFG_HT_CAP_INFO, &val1) !=
- eSIR_SUCCESS) {
- PELOGE(lim_log
- (pMac, LOGE,
- FL("could not retrieve WNI_CFG_HT_CAP_INFO "));
- )
- break;
- }
- if (wlan_cfg_get_int(pMac, WNI_CFG_HT_RX_STBC, &val2) !=
- eSIR_SUCCESS) {
- PELOGE(lim_log
- (pMac, LOGE,
- FL("could not retrieve WNI_CFG_HT_RX_STBC"));
- )
- break;
- }
- val16 = (uint16_t) val1;
- pHTCapabilityInfo = (tSirMacHTCapabilityInfo *) &val16;
- pHTCapabilityInfo->rxSTBC = (uint16_t) val2;
- if (cfg_set_int
- (pMac, WNI_CFG_HT_CAP_INFO,
- *(uint16_t *) pHTCapabilityInfo) != eSIR_SUCCESS)
- PELOGE(lim_log
- (pMac, LOGE,
- FL("could not update HT Cap Info CFG"));
- )
- break;
-
- case WNI_CFG_MAX_AMSDU_LENGTH:
- if (wlan_cfg_get_int(pMac, WNI_CFG_HT_CAP_INFO, &val1) !=
- eSIR_SUCCESS) {
- PELOGE(lim_log
- (pMac, LOGE,
- FL("could not retrieve HT Cap Info CFG"));
- )
- break;
- }
- if (wlan_cfg_get_int(pMac, WNI_CFG_MAX_AMSDU_LENGTH, &val2) !=
- eSIR_SUCCESS) {
- PELOGE(lim_log
- (pMac, LOGE,
- FL("could not retrieve Max AMSDU Length CFG"));
- )
- break;
- }
- val16 = (uint16_t) val1;
- pHTCapabilityInfo = (tSirMacHTCapabilityInfo *) &val16;
- pHTCapabilityInfo->maximalAMSDUsize = (uint16_t) val2;
- if (cfg_set_int
- (pMac, WNI_CFG_HT_CAP_INFO,
- *(uint16_t *) pHTCapabilityInfo) != eSIR_SUCCESS)
- PELOGE(lim_log
- (pMac, LOGE,
- FL("could not update HT Cap Info CFG"));
- )
- break;
- case WNI_CFG_SHORT_GI_20MHZ:
- if (wlan_cfg_get_int(pMac, WNI_CFG_HT_CAP_INFO, &val1) !=
- eSIR_SUCCESS) {
- PELOGE(lim_log
- (pMac, LOGE,
- FL("could not retrieve HT Cap CFG"));
- )
- break;
- }
- if (wlan_cfg_get_int(pMac, WNI_CFG_SHORT_GI_20MHZ, &val2) !=
- eSIR_SUCCESS) {
- PELOGE(lim_log
- (pMac, LOGE,
- FL("could not retrieve shortGI 20Mhz CFG"));
- )
- break;
- }
- val16 = (uint16_t) val1;
- pHTCapabilityInfo = (tSirMacHTCapabilityInfo *) &val16;
- pHTCapabilityInfo->shortGI20MHz = (uint16_t) val2;
- if (cfg_set_int
- (pMac, WNI_CFG_HT_CAP_INFO,
- *(uint16_t *) pHTCapabilityInfo) != eSIR_SUCCESS)
- PELOGE(lim_log
- (pMac, LOGE,
- FL("could not update HT Cap Info CFG"));
- )
- break;
- case WNI_CFG_SHORT_GI_40MHZ:
- if (wlan_cfg_get_int(pMac, WNI_CFG_HT_CAP_INFO, &val1) !=
- eSIR_SUCCESS) {
- PELOGE(lim_log
- (pMac, LOGE,
- FL("could not retrieve HT Cap CFG"));
- )
- break;
- }
- if (wlan_cfg_get_int(pMac, WNI_CFG_SHORT_GI_40MHZ, &val2) !=
- eSIR_SUCCESS) {
- PELOGE(lim_log
- (pMac, LOGE,
- FL("could not retrieve shortGI 40Mhz CFG"));
- )
- break;
- }
- val16 = (uint16_t) val1;
- pHTCapabilityInfo = (tSirMacHTCapabilityInfo *) &val16;
- pHTCapabilityInfo->shortGI40MHz = (uint16_t) val2;
- if (cfg_set_int
- (pMac, WNI_CFG_HT_CAP_INFO,
- *(uint16_t *) pHTCapabilityInfo) != eSIR_SUCCESS)
- PELOGE(lim_log
- (pMac, LOGE,
- FL("could not update HT Cap Info CFG"));
- )
- break;
case WNI_CFG_MPDU_DENSITY:
if (wlan_cfg_get_int(pMac, WNI_CFG_HT_AMPDU_PARAMS, &val1) !=
eSIR_SUCCESS) {
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 d8031c2c5bfa..5aa94b0df17e 100644
--- a/core/mac/src/pe/lim/lim_process_message_queue.c
+++ b/core/mac/src/pe/lim/lim_process_message_queue.c
@@ -63,6 +63,7 @@
#include "cds_packet.h"
#include "qdf_mem.h"
#include "cds_concurrency.h"
+#include "nan_datapath.h"
void lim_log_session_states(tpAniSirGlobal pMac);
static void lim_process_normal_hdd_msg(tpAniSirGlobal mac_ctx,
@@ -1451,7 +1452,10 @@ void lim_process_messages(tpAniSirGlobal mac_ctx, tpSirMsgQ msg)
#endif /* FEATURE_WLAN_ESE */
case eWNI_SME_REGISTER_MGMT_FRAME_CB:
case eWNI_SME_EXT_CHANGE_CHANNEL:
- /* These messages are from HDD.No need to respond to HDD */
+ case eWNI_SME_NDP_INITIATOR_REQ:
+ case eWNI_SME_NDP_RESPONDER_REQ:
+ case eWNI_SME_NDP_END_REQ:
+ /* These messages are from HDD.No need to respond to HDD */
lim_process_normal_hdd_msg(mac_ctx, msg, false);
break;
@@ -1928,7 +1932,6 @@ void lim_process_messages(tpAniSirGlobal mac_ctx, tpSirMsgQ msg)
qdf_mem_free((void *)msg->bodyptr);
msg->bodyptr = NULL;
/* Unwanted messages */
- /* Log error */
lim_log(mac_ctx, LOGE,
FL("Discarding unexpected message received %X"),
msg->type);
diff --git a/core/mac/src/pe/lim/lim_process_mlm_req_messages.c b/core/mac/src/pe/lim/lim_process_mlm_req_messages.c
index e3a1c2688039..c7519c6fe245 100644
--- a/core/mac/src/pe/lim/lim_process_mlm_req_messages.c
+++ b/core/mac/src/pe/lim/lim_process_mlm_req_messages.c
@@ -603,11 +603,12 @@ lim_mlm_add_bss(tpAniSirGlobal mac_ctx,
session->selfMacAddr, sizeof(tSirMacAddr));
addbss_param->bssType = mlm_start_req->bssType;
- if ((mlm_start_req->bssType == eSIR_IBSS_MODE)) {
+ if (mlm_start_req->bssType == eSIR_IBSS_MODE)
addbss_param->operMode = BSS_OPERATIONAL_MODE_STA;
- } else if (mlm_start_req->bssType == eSIR_INFRA_AP_MODE) {
+ else if (mlm_start_req->bssType == eSIR_INFRA_AP_MODE)
addbss_param->operMode = BSS_OPERATIONAL_MODE_AP;
- }
+ else if (mlm_start_req->bssType == eSIR_NDI_MODE)
+ addbss_param->operMode = BSS_OPERATIONAL_MODE_NDI;
addbss_param->shortSlotTimeSupported = session->shortSlotTimeSupported;
addbss_param->beaconInterval = mlm_start_req->beaconPeriod;
diff --git a/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c b/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c
index 99fc67e544d1..5637496c2519 100644
--- a/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c
+++ b/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c
@@ -49,6 +49,7 @@
#include "cds_utils.h"
#include "lim_types.h"
#include "cds_concurrency.h"
+#include "nan_datapath.h"
#define MAX_SUPPORTED_PEERS_WEP 16
@@ -254,12 +255,14 @@ void lim_process_mlm_start_cnf(tpAniSirGlobal pMac, uint32_t *pMsgBuf)
MTRACE(mac_trace
(pMac, TRACE_CODE_SME_STATE, psessionEntry->peSessionId,
psessionEntry->limSmeState));
- if (psessionEntry->bssType == eSIR_INFRA_AP_MODE) {
+ if (psessionEntry->bssType == eSIR_INFRA_AP_MODE)
lim_log(pMac, LOG1,
FL("*** Started BSS in INFRA AP SIDE***"));
- } else {
+ else if (psessionEntry->bssType == eSIR_NDI_MODE)
+ lim_log(pMac, LOG1,
+ FL("*** Started BSS in NDI mode ***"));
+ else
lim_log(pMac, LOG1, FL("*** Started BSS ***"));
- }
} else {
/* Start BSS is a failure */
pe_delete_session(pMac, psessionEntry);
@@ -1846,6 +1849,10 @@ void lim_process_mlm_del_sta_rsp(tpAniSirGlobal mac_ctx,
session_entry);
return;
}
+ if (LIM_IS_NDI_ROLE(session_entry)) {
+ lim_process_ndi_del_sta_rsp(mac_ctx, msg, session_entry);
+ return;
+ }
lim_process_sta_mlm_del_sta_rsp(mac_ctx, msg, session_entry);
}
@@ -2672,6 +2679,8 @@ void lim_process_mlm_add_bss_rsp(tpAniSirGlobal mac_ctx,
mlm_start_cnf.sessionId = session_entry->peSessionId;
if (eSIR_IBSS_MODE == bss_type) {
lim_process_ibss_mlm_add_bss_rsp(mac_ctx, msg, session_entry);
+ } else if (eSIR_NDI_MODE == session_entry->bssType) {
+ lim_process_ndi_mlm_add_bss_rsp(mac_ctx, msg, session_entry);
} else {
if (eLIM_SME_WT_START_BSS_STATE == session_entry->limSmeState) {
if (eLIM_MLM_WT_ADD_BSS_RSP_STATE !=
diff --git a/core/mac/src/pe/lim/lim_process_sme_req_messages.c b/core/mac/src/pe/lim/lim_process_sme_req_messages.c
index ff4fd61f8263..fdbdcc059636 100644
--- a/core/mac/src/pe/lim/lim_process_sme_req_messages.c
+++ b/core/mac/src/pe/lim/lim_process_sme_req_messages.c
@@ -57,6 +57,7 @@
#include "wmm_apsd.h"
#include "sir_mac_prot_def.h"
#include "rrm_api.h"
+#include "nan_datapath.h"
#include "sap_api.h"
@@ -114,7 +115,7 @@ static void lim_process_modify_add_ies(tpAniSirGlobal pMac, uint32_t *pMsg);
static void lim_process_update_add_ies(tpAniSirGlobal pMac, uint32_t *pMsg);
-extern void pe_register_wma_handle(tpAniSirGlobal pMac,
+extern void pe_register_callbacks_with_wma(tpAniSirGlobal pMac,
tSirSmeReadyReq *ready_req);
static void lim_process_ext_change_channel(tpAniSirGlobal mac_ctx,
uint32_t *msg);
@@ -170,7 +171,7 @@ static QDF_STATUS lim_process_set_hw_mode(tpAniSirGlobal mac, uint32_t *msg)
status = cds_mq_post_message(CDS_MQ_ID_WMA, &cds_message);
if (!QDF_IS_STATUS_SUCCESS(status)) {
lim_log(mac, LOGE,
- FL("vos_mq_post_message failed!(err=%d)"),
+ FL("cds_mq_post_message failed!(err=%d)"),
status);
qdf_mem_free(req_msg);
goto fail;
@@ -245,7 +246,7 @@ static QDF_STATUS lim_process_set_dual_mac_cfg_req(tpAniSirGlobal mac,
status = cds_mq_post_message(CDS_MQ_ID_WMA, &cds_message);
if (!QDF_IS_STATUS_SUCCESS(status)) {
lim_log(mac, LOGE,
- FL("vos_mq_post_message failed!(err=%d)"),
+ FL("cds_mq_post_message failed!(err=%d)"),
status);
qdf_mem_free(req_msg);
goto fail;
@@ -311,7 +312,7 @@ static QDF_STATUS lim_process_set_antenna_mode_req(tpAniSirGlobal mac,
status = cds_mq_post_message(CDS_MQ_ID_WMA, &cds_message);
if (!QDF_IS_STATUS_SUCCESS(status)) {
lim_log(mac, LOGE,
- FL("vos_mq_post_message failed!(err=%d)"),
+ FL("cds_mq_post_message failed!(err=%d)"),
status);
qdf_mem_free(req_msg);
goto fail;
@@ -359,32 +360,44 @@ __lim_fresh_scan_reqd(tpAniSirGlobal mac_ctx, uint8_t return_fresh_results)
}
for (i = 0; i < mac_ctx->lim.maxBssId; i++) {
+
+ if (mac_ctx->lim.gpSession[i].valid == false)
+ continue;
+
lim_log(mac_ctx, LOG1,
FL("session %d, bsstype %d, limSystemRole %d, limSmeState %d"),
i, mac_ctx->lim.gpSession[i].bssType,
mac_ctx->lim.gpSession[i].limSystemRole,
mac_ctx->lim.gpSession[i].limSmeState);
- if (mac_ctx->lim.gpSession[i].valid == true) {
- if (!((((mac_ctx->lim.gpSession[i].bssType ==
- eSIR_INFRASTRUCTURE_MODE)) &&
- (mac_ctx->lim.gpSession[i].limSmeState ==
- eLIM_SME_LINK_EST_STATE)) ||
- (((mac_ctx->lim.gpSession[i].bssType ==
- eSIR_IBSS_MODE)) &&
- (mac_ctx->lim.gpSession[i].limSmeState ==
- eLIM_SME_NORMAL_STATE)) ||
- ((((mac_ctx->lim.gpSession[i].bssType ==
- eSIR_INFRA_AP_MODE) &&
- (mac_ctx->lim.gpSession[i].pePersona ==
- QDF_P2P_GO_MODE)) ||
- (mac_ctx->lim.gpSession[i].limSystemRole ==
- eLIM_AP_ROLE)) &&
- (mac_ctx->lim.gpSession[i].limSmeState ==
- eLIM_SME_NORMAL_STATE)))) {
- valid_state = false;
- break;
- }
- }
+
+ if (mac_ctx->lim.gpSession[i].bssType == eSIR_NDI_MODE)
+ continue;
+
+ if (mac_ctx->lim.gpSession[i].bssType ==
+ eSIR_INFRASTRUCTURE_MODE &&
+ mac_ctx->lim.gpSession[i].limSmeState ==
+ eLIM_SME_LINK_EST_STATE)
+ continue;
+
+ if (mac_ctx->lim.gpSession[i].bssType == eSIR_IBSS_MODE &&
+ mac_ctx->lim.gpSession[i].limSmeState ==
+ eLIM_SME_NORMAL_STATE)
+ continue;
+
+ if (mac_ctx->lim.gpSession[i].bssType == eSIR_INFRA_AP_MODE &&
+ mac_ctx->lim.gpSession[i].pePersona ==
+ QDF_P2P_GO_MODE &&
+ mac_ctx->lim.gpSession[i].limSmeState ==
+ eLIM_SME_NORMAL_STATE)
+ continue;
+
+ if (mac_ctx->lim.gpSession[i].limSystemRole == eLIM_AP_ROLE &&
+ mac_ctx->lim.gpSession[i].limSmeState ==
+ eLIM_SME_NORMAL_STATE)
+ continue;
+
+ valid_state = false;
+ break;
}
lim_log(mac_ctx, LOG1, FL("valid_state: %d"), valid_state);
@@ -545,7 +558,7 @@ static bool __lim_process_sme_sys_ready_ind(tpAniSirGlobal pMac, uint32_t *pMsgB
if (ANI_DRIVER_TYPE(pMac) != eDRIVER_TYPE_MFG) {
ready_req->pe_roam_synch_cb = pe_roam_synch_callback;
- pe_register_wma_handle(pMac, ready_req);
+ pe_register_callbacks_with_wma(pMac, ready_req);
pMac->lim.add_bssdescr_callback = ready_req->add_bssdescr_cb;
}
PELOGW(lim_log(pMac, LOGW, FL("sending WMA_SYS_READY_IND msg to HAL"));)
@@ -698,27 +711,34 @@ __lim_handle_sme_start_bss_request(tpAniSirGlobal mac_ctx, uint32_t *msg_buf)
}
}
- /* Probe resp add ie */
- lim_start_bss_update_add_ie_buffer(mac_ctx,
- &session->addIeParams.probeRespData_buff,
- &session->addIeParams.probeRespDataLen,
- sme_start_bss_req->addIeParams.probeRespData_buff,
- sme_start_bss_req->addIeParams.probeRespDataLen);
-
- /* Probe Beacon add ie */
- lim_start_bss_update_add_ie_buffer(mac_ctx,
- &session->addIeParams.probeRespBCNData_buff,
- &session->addIeParams.probeRespBCNDataLen,
- sme_start_bss_req->addIeParams.probeRespBCNData_buff,
- sme_start_bss_req->addIeParams.probeRespBCNDataLen);
-
- /* Assoc resp IE */
- lim_start_bss_update_add_ie_buffer(mac_ctx,
- &session->addIeParams.assocRespData_buff,
- &session->addIeParams.assocRespDataLen,
- sme_start_bss_req->addIeParams.assocRespData_buff,
- sme_start_bss_req->addIeParams.assocRespDataLen);
-
+ if (QDF_NDI_MODE != sme_start_bss_req->bssPersona) {
+ /* Probe resp add ie */
+ lim_start_bss_update_add_ie_buffer(mac_ctx,
+ &session->addIeParams.probeRespData_buff,
+ &session->addIeParams.probeRespDataLen,
+ sme_start_bss_req->addIeParams.
+ probeRespData_buff,
+ sme_start_bss_req->addIeParams.
+ probeRespDataLen);
+
+ /* Probe Beacon add ie */
+ lim_start_bss_update_add_ie_buffer(mac_ctx,
+ &session->addIeParams.probeRespBCNData_buff,
+ &session->addIeParams.probeRespBCNDataLen,
+ sme_start_bss_req->addIeParams.
+ probeRespBCNData_buff,
+ sme_start_bss_req->addIeParams.
+ probeRespBCNDataLen);
+
+ /* Assoc resp IE */
+ lim_start_bss_update_add_ie_buffer(mac_ctx,
+ &session->addIeParams.assocRespData_buff,
+ &session->addIeParams.assocRespDataLen,
+ sme_start_bss_req->addIeParams.
+ assocRespData_buff,
+ sme_start_bss_req->addIeParams.
+ assocRespDataLen);
+ }
/* Store the session related params in newly created session */
session->pLimStartBssReq = sme_start_bss_req;
@@ -826,6 +846,10 @@ __lim_handle_sme_start_bss_request(tpAniSirGlobal mac_ctx, uint32_t *msg_buf)
session->vdev_nss = vdev_type_nss->ibss;
break;
+ case eSIR_NDI_MODE:
+ session->limSystemRole = eLIM_NDI_ROLE;
+ break;
+
/*
* There is one more mode called auto mode.
@@ -861,7 +885,8 @@ __lim_handle_sme_start_bss_request(tpAniSirGlobal mac_ctx, uint32_t *msg_buf)
sizeof(tpSirAssocReq)), 0);
}
- if (!sme_start_bss_req->channelId) {
+ if (!sme_start_bss_req->channelId &&
+ sme_start_bss_req->bssType != eSIR_NDI_MODE) {
lim_log(mac_ctx, LOGE,
FL("Received invalid eWNI_SME_START_BSS_REQ"));
ret_code = eSIR_SME_INVALID_PARAMETERS;
@@ -924,7 +949,9 @@ __lim_handle_sme_start_bss_request(tpAniSirGlobal mac_ctx, uint32_t *msg_buf)
lim_set_rs_nie_wp_aiefrom_sme_start_bss_req_message(mac_ctx,
&sme_start_bss_req->rsnIE, session);
- if (LIM_IS_AP_ROLE(session) || LIM_IS_IBSS_ROLE(session)) {
+ if (LIM_IS_AP_ROLE(session) ||
+ LIM_IS_IBSS_ROLE(session) ||
+ LIM_IS_NDI_ROLE(session)) {
session->gLimProtectionControl =
sme_start_bss_req->protEnabled;
/*
@@ -962,7 +989,8 @@ __lim_handle_sme_start_bss_request(tpAniSirGlobal mac_ctx, uint32_t *msg_buf)
/* Fill PE session Id from the session Table */
mlm_start_req->sessionId = session->peSessionId;
- if (mlm_start_req->bssType == eSIR_INFRA_AP_MODE) {
+ if (mlm_start_req->bssType == eSIR_INFRA_AP_MODE ||
+ mlm_start_req->bssType == eSIR_NDI_MODE) {
/*
* Copy the BSSId from sessionTable to
* mlmStartReq struct
@@ -2051,8 +2079,8 @@ __lim_process_sme_join_req(tpAniSirGlobal mac_ctx, uint32_t *msg_buf)
}
end:
- sme_session_id = sme_join_req->sessionId;
- sme_transaction_id = sme_join_req->transactionId;
+ sme_session_id = ((tpSirSmeJoinReq)msg_buf)->sessionId;
+ sme_transaction_id = ((tpSirSmeJoinReq)msg_buf)->transactionId;
if (sme_join_req) {
qdf_mem_free(sme_join_req);
@@ -3420,34 +3448,39 @@ __lim_handle_sme_stop_bss_request(tpAniSirGlobal pMac, uint32_t *pMsgBuf)
psessionEntry->smeSessionId = smesessionId;
psessionEntry->transactionId = smetransactionId;
- /* BTAMP_STA and STA_IN_IBSS should NOT send Disassoc frame */
- if (!LIM_IS_IBSS_ROLE(psessionEntry)) {
+ /* STA_IN_IBSS and NDI should NOT send Disassoc frame */
+ if (!LIM_IS_IBSS_ROLE(psessionEntry) &&
+ !LIM_IS_NDI_ROLE(psessionEntry)) {
tSirMacAddr bcAddr = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
if (stopBssReq.reasonCode == eSIR_SME_MIC_COUNTER_MEASURES)
/* Send disassoc all stations associated thru TKIP */
__lim_counter_measures(pMac, psessionEntry);
else
lim_send_disassoc_mgmt_frame(pMac,
- eSIR_MAC_DEAUTH_LEAVING_BSS_REASON,
- bcAddr, psessionEntry, false);
+ eSIR_MAC_DEAUTH_LEAVING_BSS_REASON,
+ bcAddr, psessionEntry, false);
}
- /* Free the buffer allocated in START_BSS_REQ */
- qdf_mem_free(psessionEntry->addIeParams.probeRespData_buff);
- psessionEntry->addIeParams.probeRespDataLen = 0;
- psessionEntry->addIeParams.probeRespData_buff = NULL;
-
- qdf_mem_free(psessionEntry->addIeParams.assocRespData_buff);
- psessionEntry->addIeParams.assocRespDataLen = 0;
- psessionEntry->addIeParams.assocRespData_buff = NULL;
+ if (!LIM_IS_NDI_ROLE(psessionEntry)) {
+ /* Free the buffer allocated in START_BSS_REQ */
+ qdf_mem_free(psessionEntry->addIeParams.probeRespData_buff);
+ psessionEntry->addIeParams.probeRespDataLen = 0;
+ psessionEntry->addIeParams.probeRespData_buff = NULL;
- qdf_mem_free(psessionEntry->addIeParams.probeRespBCNData_buff);
- psessionEntry->addIeParams.probeRespBCNDataLen = 0;
- psessionEntry->addIeParams.probeRespBCNData_buff = NULL;
+ qdf_mem_free(psessionEntry->addIeParams.assocRespData_buff);
+ psessionEntry->addIeParams.assocRespDataLen = 0;
+ psessionEntry->addIeParams.assocRespData_buff = NULL;
- /* lim_del_bss is also called as part of coalescing, when we send DEL BSS followed by Add Bss msg. */
- pMac->lim.gLimIbssCoalescingHappened = false;
+ qdf_mem_free(psessionEntry->addIeParams.probeRespBCNData_buff);
+ psessionEntry->addIeParams.probeRespBCNDataLen = 0;
+ psessionEntry->addIeParams.probeRespBCNData_buff = NULL;
+ /*
+ * lim_del_bss is also called as part of coalescing,
+ * when we send DEL BSS followed by Add Bss msg.
+ */
+ pMac->lim.gLimIbssCoalescingHappened = false;
+ }
for (i = 1; i < pMac->lim.gLimAssocStaLimit; i++) {
pStaDs =
dph_get_hash_entry(pMac, i, &psessionEntry->dph.dphHashTable);
@@ -5149,6 +5182,10 @@ bool lim_process_sme_req_messages(tpAniSirGlobal pMac, tpSirMsgQ pMsg)
break;
case eWNI_SME_PDEV_SET_HT_VHT_IE:
lim_process_set_pdev_IEs(pMac, pMsgBuf);
+ case eWNI_SME_NDP_END_REQ:
+ case eWNI_SME_NDP_INITIATOR_REQ:
+ case eWNI_SME_NDP_RESPONDER_REQ:
+ lim_handle_ndp_request_message(pMac, pMsg);
break;
default:
qdf_mem_free((void *)pMsg->bodyptr);
diff --git a/core/mac/src/pe/lim/lim_process_tdls.c b/core/mac/src/pe/lim/lim_process_tdls.c
index 95651285d9f1..ed5420a4ff1e 100644
--- a/core/mac/src/pe/lim/lim_process_tdls.c
+++ b/core/mac/src/pe/lim/lim_process_tdls.c
@@ -76,6 +76,7 @@
#include "dph_hash_table.h"
#include "wma_types.h"
#include "cds_regdomain.h"
+#include "cds_utils.h"
/* define NO_PAD_TDLS_MIN_8023_SIZE to NOT padding: See CR#447630
There was IOT issue with cisco 1252 open mode, where it pads
@@ -548,6 +549,7 @@ static void populate_dot11f_tdls_ht_vht_cap(tpAniSirGlobal pMac,
else
nss = pMac->vdev_type_nss_2g.tdls;
+ nss = QDF_MIN(nss, pMac->user_configured_nss);
if (IS_DOT11_MODE_HT(selfDot11Mode)) {
/* Include HT Capability IE */
populate_dot11f_ht_caps(pMac, NULL, htCap);
@@ -585,6 +587,17 @@ static void populate_dot11f_tdls_ht_vht_cap(tpAniSirGlobal pMac,
IS_FEATURE_SUPPORTED_BY_FW(DOT11AC)) {
/* Include VHT Capability IE */
populate_dot11f_vht_caps(pMac, psessionEntry, vhtCap);
+
+ /*
+ * Set to 0 if the TDLS STA does not support either 160
+ * or 80+80 MHz.
+ * Set to 1 if the TDLS STA supports 160 MHz.
+ * Set to 2 if the TDLS STA supports 160 MHz and
+ * 80+80 MHz.
+ * The value 3 is reserved
+ */
+ vhtCap->supportedChannelWidthSet = 0;
+
vhtCap->suBeamformeeCap = 0;
vhtCap->suBeamFormerCap = 0;
vhtCap->muBeamformeeCap = 0;
@@ -2266,6 +2279,9 @@ lim_tdls_populate_matching_rate_set(tpAniSirGlobal mac_ctx, tpDphHashNode stads,
nss = mac_ctx->vdev_type_nss_5g.tdls;
else
nss = mac_ctx->vdev_type_nss_2g.tdls;
+
+ nss = QDF_MIN(nss, mac_ctx->user_configured_nss);
+
/* compute the matching MCS rate set, if peer is 11n capable and self mode is 11n */
#ifdef FEATURE_WLAN_TDLS
if (stads->mlmStaContext.htCapability)
@@ -2366,29 +2382,16 @@ static void lim_tdls_update_hash_node_info(tpAniSirGlobal pMac,
if (pVhtCaps->present) {
pStaDs->mlmStaContext.vhtCapability = 1;
- if (psessionEntry->currentOperChannel <= SIR_11B_CHANNEL_END) {
- /*
- * if the channel is 2G then update the min channel
- * widthset in pStaDs. These values are used when
- * sending a AddSta request to firmware
- * 11.21.1 General: The channel width of the TDLS direct
- * link on the base channel shall not exceed the channel
- * width of the BSS to which the TDLS peer STAs are
- * associated.
- */
- pStaDs->vhtSupportedChannelWidthSet =
- WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ;
- pStaDs->htSupportedChannelWidthSet =
- eHT_CHANNEL_WIDTH_20MHZ;
- lim_log(pMac, LOG1, FL("vhtSupportedChannelWidthSet = %hu, htSupportedChannelWidthSet %hu"),
- pStaDs->htSupportedChannelWidthSet,
- pStaDs->htSupportedChannelWidthSet);
- } else {
- pStaDs->vhtSupportedChannelWidthSet =
- WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ;
- pStaDs->htSupportedChannelWidthSet =
- eHT_CHANNEL_WIDTH_40MHZ;
- }
+ /*
+ * 11.21.1 General: The channel width of the TDLS direct
+ * link on the base channel shall not exceed the channel
+ * width of the BSS to which the TDLS peer STAs are
+ * associated.
+ */
+ pStaDs->vhtSupportedChannelWidthSet = psessionEntry->ch_width;
+ lim_log(pMac, LOG1, FL("vhtSupportedChannelWidthSet = %hu, htSupportedChannelWidthSet %hu"),
+ pStaDs->htSupportedChannelWidthSet,
+ pStaDs->htSupportedChannelWidthSet);
pStaDs->vhtLdpcCapable = pVhtCaps->ldpcCodingCap;
pStaDs->vhtBeamFormerCapable = 0;
@@ -2643,6 +2646,10 @@ void populate_dot11f_tdls_offchannel_params(tpAniSirGlobal pMac,
uint8_t op_class;
uint8_t numClasses;
uint8_t classes[CDS_MAX_SUPP_OPER_CLASSES];
+ uint32_t band;
+ uint8_t nss_2g;
+ uint8_t nss_5g;
+
if (wlan_cfg_get_str(pMac, WNI_CFG_VALID_CHANNEL_LIST,
validChan, &numChans) != eSIR_SUCCESS) {
/**
@@ -2654,16 +2661,34 @@ void populate_dot11f_tdls_offchannel_params(tpAniSirGlobal pMac,
return;
}
- /* validating the channel list for DFS channels */
+ if (IS_5G_CH(psessionEntry->currentOperChannel))
+ band = eCSR_BAND_5G;
+ else
+ band = eCSR_BAND_24;
+
+ nss_5g = QDF_MIN(pMac->vdev_type_nss_5g.tdls,
+ pMac->user_configured_nss);
+ nss_2g = QDF_MIN(pMac->vdev_type_nss_2g.tdls,
+ pMac->user_configured_nss);
+
+ /* validating the channel list for DFS and 2G channels */
for (i = 0U; i < numChans; i++) {
- if (CHANNEL_STATE_DFS ==
- cds_get_channel_state(validChan[i])) {
+ if ((band == eCSR_BAND_5G) &&
+ (NSS_2x2_MODE == nss_5g) &&
+ (NSS_1x1_MODE == nss_2g) &&
+ (true == CDS_IS_DFS_CH(validChan[i]))) {
lim_log(pMac, LOG1,
- FL(
- "skipping DFS channel %d from the valid channel list"
- ),
- validChan[i]);
+ FL("skipping channel %d, nss_5g: %d, nss_2g: %d"),
+ validChan[i], nss_5g, nss_2g);
continue;
+ } else {
+ if (true == cds_is_dsrc_channel(
+ cds_chan_to_freq(validChan[i]))) {
+ lim_log(pMac, LOG1,
+ FL("skipping channel %d from the valid channel list"),
+ validChan[i]);
+ continue;
+ }
}
if (valid_count >= ARRAY_SIZE(suppChannels->bands))
diff --git a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c
index f5f7f5f4c183..eab94390b401 100644
--- a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c
+++ b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c
@@ -57,6 +57,7 @@
#include "sir_api.h"
#include "cds_regdomain.h"
#include "lim_send_messages.h"
+#include "nan_datapath.h"
static void lim_handle_join_rsp_status(tpAniSirGlobal mac_ctx,
tpPESession session_entry, tSirResultCodes result_code,
@@ -612,6 +613,7 @@ lim_send_sme_start_bss_rsp(tpAniSirGlobal pMac,
pSirSmeRsp->bssDescription.channelId =
psessionEntry->currentOperChannel;
+ if (!LIM_IS_NDI_ROLE(psessionEntry)) {
curLen = psessionEntry->schBeaconOffsetBegin - ieOffset;
qdf_mem_copy((uint8_t *) &pSirSmeRsp->bssDescription.
ieFields,
@@ -630,6 +632,7 @@ lim_send_sme_start_bss_rsp(tpAniSirGlobal pMac,
sizeof(uint32_t) + ieLen;
/* This is the size of the message, subtracting the size of the pointer to ieFields */
size += ieLen - sizeof(uint32_t);
+ }
#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
if (psessionEntry->cc_switch_mode
!= QDF_MCC_TO_SCC_SWITCH_DISABLE) {
@@ -2245,14 +2248,15 @@ void lim_handle_delete_bss_rsp(tpAniSirGlobal pMac, tpSirMsgQ MsgQ)
lim_log(pMac, LOGE,
FL("Session Does not exist for given sessionID %d"),
pDelBss->sessionId);
+ qdf_mem_free(MsgQ->bodyptr);
return;
}
- if (LIM_IS_IBSS_ROLE(psessionEntry)) {
+ if (LIM_IS_IBSS_ROLE(psessionEntry))
lim_ibss_del_bss_rsp(pMac, MsgQ->bodyptr, psessionEntry);
- } else if (LIM_IS_UNKNOWN_ROLE(psessionEntry)) {
+ else if (LIM_IS_UNKNOWN_ROLE(psessionEntry))
lim_process_sme_del_bss_rsp(pMac, MsgQ->bodyval, psessionEntry);
- }
-
+ else if (LIM_IS_NDI_ROLE(psessionEntry))
+ lim_ndi_del_bss_rsp(pMac, MsgQ->bodyptr, psessionEntry);
else
lim_process_mlm_del_bss_rsp(pMac, MsgQ, psessionEntry);
diff --git a/core/mac/src/pe/lim/lim_sme_req_utils.c b/core/mac/src/pe/lim/lim_sme_req_utils.c
index a4ae8933167f..327009f7f073 100644
--- a/core/mac/src/pe/lim/lim_sme_req_utils.c
+++ b/core/mac/src/pe/lim/lim_sme_req_utils.c
@@ -409,6 +409,8 @@ lim_is_sme_start_bss_req_valid(tpAniSirGlobal mac_ctx,
break;
case eSIR_INFRA_AP_MODE:
break;
+ case eSIR_NDI_MODE:
+ break;
default:
/**
* Should not have received start BSS req with bssType
diff --git a/core/mac/src/pe/lim/lim_utils.c b/core/mac/src/pe/lim/lim_utils.c
index 403f19de4a79..49009b8ca2f8 100644
--- a/core/mac/src/pe/lim/lim_utils.c
+++ b/core/mac/src/pe/lim/lim_utils.c
@@ -56,6 +56,7 @@
#include "lim_ft_defs.h"
#include "lim_session.h"
#include "cds_reg_service.h"
+#include "nan_datapath.h"
#ifdef WLAN_FEATURE_11W
#include "wni_cfg.h"
@@ -2947,15 +2948,13 @@ uint8_t lim_get_ht_capability(tpAniSirGlobal pMac,
break;
case eHT_SHORT_GI_40MHZ:
- retVal = (uint8_t)
- (psessionEntry->htConfig.ht_sgi) ? macHTCapabilityInfo.
- shortGI40MHz : 0;
+ retVal = (uint8_t) (psessionEntry->htConfig.ht_sgi40) ?
+ macHTCapabilityInfo.shortGI40MHz : 0;
break;
case eHT_SHORT_GI_20MHZ:
- retVal = (uint8_t)
- (psessionEntry->htConfig.ht_sgi) ? macHTCapabilityInfo.
- shortGI20MHz : 0;
+ retVal = (uint8_t) (psessionEntry->htConfig.ht_sgi20) ?
+ macHTCapabilityInfo.shortGI20MHz : 0;
break;
case eHT_GREENFIELD:
@@ -5593,32 +5592,41 @@ uint8_t lim_get_current_operating_channel(tpAniSirGlobal pMac)
return 0;
}
-void lim_process_add_sta_rsp(tpAniSirGlobal pMac, tpSirMsgQ limMsgQ)
+/**
+ * lim_process_add_sta_rsp() - process WDA_ADD_STA_RSP from WMA
+ * @mac_ctx: Pointer to Global MAC structure
+ * @msg: msg from WMA
+ *
+ * @Return: void
+ */
+void lim_process_add_sta_rsp(tpAniSirGlobal mac_ctx, tpSirMsgQ msg)
{
- tpPESession psessionEntry;
- tpAddStaParams pAddStaParams;
+ tpPESession session;
+ tpAddStaParams add_sta_params;
- pAddStaParams = (tpAddStaParams) limMsgQ->bodyptr;
+ add_sta_params = (tpAddStaParams) msg->bodyptr;
- psessionEntry = pe_find_session_by_session_id(pMac,
- pAddStaParams->sessionId);
- if (psessionEntry == NULL) {
- lim_log(pMac, LOGP,
+ session = pe_find_session_by_session_id(mac_ctx,
+ add_sta_params->sessionId);
+ if (session == NULL) {
+ lim_log(mac_ctx, LOGP,
FL("Session Does not exist for given sessionID"));
- qdf_mem_free(pAddStaParams);
+ qdf_mem_free(add_sta_params);
return;
}
- psessionEntry->csaOffloadEnable = pAddStaParams->csaOffloadEnable;
- if (LIM_IS_IBSS_ROLE(psessionEntry))
- (void)lim_ibss_add_sta_rsp(pMac, limMsgQ->bodyptr, psessionEntry);
+ session->csaOffloadEnable = add_sta_params->csaOffloadEnable;
+ if (LIM_IS_IBSS_ROLE(session))
+ (void)lim_ibss_add_sta_rsp(mac_ctx, msg->bodyptr, session);
+ else if (LIM_IS_NDI_ROLE(session))
+ lim_ndp_add_sta_rsp(mac_ctx, session, msg->bodyptr);
#ifdef FEATURE_WLAN_TDLS
- else if (pMac->lim.gLimAddStaTdls) {
- lim_process_tdls_add_sta_rsp(pMac, limMsgQ->bodyptr, psessionEntry);
- pMac->lim.gLimAddStaTdls = false;
+ else if (mac_ctx->lim.gLimAddStaTdls) {
+ lim_process_tdls_add_sta_rsp(mac_ctx, msg->bodyptr, session);
+ mac_ctx->lim.gLimAddStaTdls = false;
}
#endif
else
- lim_process_mlm_add_sta_rsp(pMac, limMsgQ, psessionEntry);
+ lim_process_mlm_add_sta_rsp(mac_ctx, msg, session);
}
@@ -6751,6 +6759,7 @@ const char *lim_bss_type_to_string(const uint16_t bss_type)
CASE_RETURN_STRING(eSIR_INFRA_AP_MODE);
CASE_RETURN_STRING(eSIR_IBSS_MODE);
CASE_RETURN_STRING(eSIR_AUTO_MODE);
+ CASE_RETURN_STRING(eSIR_NDI_MODE);
default:
return "Unknown bss_type";
}
diff --git a/core/mac/src/pe/nan/nan_datapath.c b/core/mac/src/pe/nan/nan_datapath.c
index d9f6a5f26bd2..dfdcac0164b1 100644
--- a/core/mac/src/pe/nan/nan_datapath.c
+++ b/core/mac/src/pe/nan/nan_datapath.c
@@ -24,5 +24,894 @@
* MAC NAN Data path API implementation
*/
+#include "lim_utils.h"
+#include "lim_api.h"
+#include "lim_assoc_utils.h"
#include "nan_datapath.h"
+#include "lim_types.h"
+#include "lim_send_messages.h"
+#include "wma_nan_datapath.h"
+/**
+ * lim_send_ndp_event_to_sme() - generic function to prepare and send NDP
+ * message to SME.
+ * @mac_ctx: handle to mac context structure
+ * @msg_type: sme message type to send
+ * @body_ptr: buffer
+ * @len: buffer length
+ * @body_val: value
+ *
+ * Return: None
+ */
+static void lim_send_ndp_event_to_sme(tpAniSirGlobal mac_ctx, uint32_t msg_type,
+ void *body_ptr, uint32_t len, uint32_t body_val)
+{
+ tSirMsgQ mmh_msg = {0};
+
+ mmh_msg.type = msg_type;
+ if (len && body_ptr) {
+ mmh_msg.bodyptr = qdf_mem_malloc(len);
+ if (NULL == mmh_msg.bodyptr) {
+ lim_log(mac_ctx, LOGE, FL("Malloc failed"));
+ return;
+ }
+ qdf_mem_copy(mmh_msg.bodyptr, body_ptr, len);
+ } else {
+ mmh_msg.bodyval = body_val;
+ }
+ lim_sys_process_mmh_msg_api(mac_ctx, &mmh_msg, ePROT);
+}
+
+/**
+ * lim_add_ndi_peer() - Function to add ndi peer
+ * @mac_ctx: handle to mac structure
+ * @vdev_id: vdev id on which peer is added
+ * @peer_mac_addr: peer to be added
+ *
+ * Return: QDF_STATUS_SUCCESS on success; error number otherwise
+ */
+static QDF_STATUS lim_add_ndi_peer(tpAniSirGlobal mac_ctx,
+ uint32_t vdev_id, struct qdf_mac_addr peer_mac_addr)
+{
+ tpPESession session;
+ tpDphHashNode sta_ds;
+ uint16_t assoc_id, peer_idx;
+ tSirRetStatus status;
+
+ session = pe_find_session_by_sme_session_id(mac_ctx,
+ vdev_id);
+ if (session == NULL) {
+ /* couldn't find session */
+ return QDF_STATUS_E_FAILURE;
+ }
+ sta_ds = dph_lookup_hash_entry(mac_ctx,
+ peer_mac_addr.bytes,
+ &assoc_id, &session->dph.dphHashTable);
+ /* peer exists, don't do anything */
+ if (sta_ds != NULL) {
+ lim_log(mac_ctx, LOGE, FL("NDI Peer already exists!!"));
+ return QDF_STATUS_SUCCESS;
+ }
+ lim_log(mac_ctx, LOG1,
+ FL("Need to create NDI Peer :" MAC_ADDRESS_STR),
+ MAC_ADDR_ARRAY(peer_mac_addr.bytes));
+ peer_idx = lim_assign_peer_idx(mac_ctx, session);
+ sta_ds = dph_add_hash_entry(mac_ctx, peer_mac_addr.bytes, peer_idx,
+ &session->dph.dphHashTable);
+ if (sta_ds == NULL) {
+ lim_log(mac_ctx, LOGE,
+ FL("Couldn't add dph entry"));
+ /* couldn't add dph entry */
+ return QDF_STATUS_E_FAILURE;
+ }
+ /* wma decides NDI mode from wma->inferface struct */
+ sta_ds->staType = STA_ENTRY_NDI_PEER;
+ status = lim_add_sta(mac_ctx, sta_ds, false, session);
+ if (eSIR_SUCCESS != status) {
+ /* couldn't add peer */
+ lim_log(mac_ctx, LOGE,
+ FL("limAddSta failed status: %d"),
+ status);
+ return QDF_STATUS_E_FAILURE;
+ }
+ return QDF_STATUS_SUCCESS;
+}
+
+/**
+ * lim_handle_ndp_indication_event() - Function to handle SIR_HAL_NDP_INDICATION
+ * event from WMA
+ * @mac_ctx: handle to mac structure
+ * @ndp_ind: ndp indication event params
+ *
+ * Return: QDF_STATUS_SUCCESS on success; error number otherwise
+ */
+static QDF_STATUS lim_handle_ndp_indication_event(tpAniSirGlobal mac_ctx,
+ struct ndp_indication_event *ndp_ind)
+{
+ QDF_STATUS status;
+
+ lim_log(mac_ctx, LOG1,
+ FL("role: %d, vdev: %d, peer_mac_addr "MAC_ADDRESS_STR),
+ ndp_ind->role, ndp_ind->vdev_id,
+ MAC_ADDR_ARRAY(ndp_ind->peer_mac_addr.bytes));
+
+ if ((ndp_ind->role == NDP_ROLE_INITIATOR) ||
+ ((NDP_ROLE_RESPONDER == ndp_ind->role) &&
+ (NDP_ACCEPT_POLICY_ALL == ndp_ind->policy))) {
+ /* Free config only for INITIATOR role */
+ qdf_mem_free(ndp_ind->ndp_config.ndp_cfg);
+ qdf_mem_free(ndp_ind->ndp_info.ndp_app_info);
+
+ status = lim_add_ndi_peer(mac_ctx, ndp_ind->vdev_id,
+ ndp_ind->peer_mac_addr);
+ if (QDF_STATUS_SUCCESS != status) {
+ lim_log(mac_ctx, LOGE,
+ FL("Couldn't add ndi peer, ndp_role: %d"),
+ ndp_ind->role);
+ goto ndp_indication_failed;
+ }
+ }
+ if (NDP_ROLE_RESPONDER == ndp_ind->role)
+ lim_send_ndp_event_to_sme(mac_ctx, eWNI_SME_NDP_INDICATION,
+ ndp_ind, sizeof(*ndp_ind), 0);
+ /*
+ * With NDP indication if peer does not exists already add_sta is
+ * executed resulting in new peer else no action is taken. Note that
+ * new_peer event is not necessary event and should not be sent if case
+ * anything fails in this function. Rather eWNI_SME_NDP_CONFIRM_IND is
+ * used to indicate success of final operation and abscence of it can be
+ * used by service layer to identify failure.
+ */
+ndp_indication_failed:
+ /*
+ * Free config if failure or for NDP_ROLE_INITIATOR role
+ * As for success responder case this info is sent till HDD
+ * and will be freed in sme.
+ */
+ if ((status != QDF_STATUS_SUCCESS) ||
+ (NDP_ROLE_INITIATOR == ndp_ind->role)) {
+ qdf_mem_free(ndp_ind->ndp_config.ndp_cfg);
+ qdf_mem_free(ndp_ind->ndp_info.ndp_app_info);
+ }
+ return status;
+}
+
+/**
+ * lim_ndp_responder_rsp_handler() - Handler for NDP responder rsp
+ * @mac_ctx: handle to mac structure
+ * @ndp_rsp: pointer to rsp message
+ * @bodyval: value
+ *
+ * Return: QDF_STATUS_SUCCESS on success; error number otherwise
+ */
+static QDF_STATUS lim_ndp_responder_rsp_handler(tpAniSirGlobal mac_ctx,
+ struct ndp_responder_rsp_event *rsp_ind, uint32_t bodyval)
+{
+ QDF_STATUS ret_val = QDF_STATUS_SUCCESS;
+
+ if ((NULL == rsp_ind) || bodyval) {
+ lim_log(mac_ctx, LOGE,
+ FL("rsp_ind is NULL or bodyval %d"), bodyval);
+ /* msg to unblock SME, but not send rsp to HDD */
+ bodyval = true;
+ ret_val = QDF_STATUS_E_INVAL;
+ goto responder_rsp;
+ }
+
+ if (QDF_STATUS_SUCCESS == rsp_ind->status) {
+ ret_val = lim_add_ndi_peer(mac_ctx, rsp_ind->vdev_id,
+ rsp_ind->peer_mac_addr);
+ if (QDF_STATUS_SUCCESS != ret_val) {
+ lim_log(mac_ctx, LOGE,
+ FL("Couldn't add ndi peer"));
+ rsp_ind->status = QDF_STATUS_E_FAILURE;
+ }
+ }
+
+responder_rsp:
+ /* send eWNI_SME_NDP_RESPONDER_RSP */
+ lim_send_ndp_event_to_sme(mac_ctx, eWNI_SME_NDP_RESPONDER_RSP,
+ bodyval ? NULL : rsp_ind,
+ bodyval ? 0 : sizeof(*rsp_ind), bodyval);
+ return ret_val;
+}
+
+/**
+ * lim_ndp_delete_peer_by_addr() - Delete NAN data peer, given addr and vdev_id
+ * @mac_ctx: handle to mac context
+ * @vdev_id: vdev_id on which peer was added
+ * @peer_ndi_mac_addr: mac addr of peer
+ * This function deletes a peer if there was NDP_Confirm with REJECT
+ *
+ * Return: None
+ */
+void lim_ndp_delete_peer_by_addr(tpAniSirGlobal mac_ctx, uint8_t vdev_id,
+ struct qdf_mac_addr peer_ndi_mac_addr)
+{
+ tpPESession session;
+ tpDphHashNode sta_ds;
+ uint16_t peer_idx;
+
+ lim_log(mac_ctx, LOG1,
+ FL("deleting peer: "MAC_ADDRESS_STR" confirm rejected"),
+ MAC_ADDR_ARRAY(peer_ndi_mac_addr.bytes));
+
+ session = pe_find_session_by_sme_session_id(mac_ctx, vdev_id);
+ if (!session || (session->bssType != eSIR_NDI_MODE)) {
+ lim_log(mac_ctx, LOGE,
+ FL("PE session is NULL or non-NDI for sme session %d"),
+ vdev_id);
+ return;
+ }
+
+ sta_ds = dph_lookup_hash_entry(mac_ctx, peer_ndi_mac_addr.bytes,
+ &peer_idx, &session->dph.dphHashTable);
+ if (!sta_ds) {
+ lim_log(mac_ctx, LOGE, FL("Unknown NDI Peer"));
+ return;
+ }
+ if (sta_ds->staType != STA_ENTRY_NDI_PEER) {
+ lim_log(mac_ctx, LOGE, FL("Non-NDI Peer ignored"));
+ return;
+ }
+ /*
+ * Call lim_del_sta() with response required set true. Hence
+ * DphHashEntry will be deleted after receiving that response.
+ */
+
+ lim_del_sta(mac_ctx, sta_ds, true, session);
+}
+
+/**
+ * lim_ndp_delete_peers() - Delete NAN data peers
+ * @mac_ctx: handle to mac context
+ * @ndp_map: NDP instance/peer map
+ * @num_peers: number of peers entries in peer_map
+ * This function deletes a peer if there are no active NDPs left with that peer
+ *
+ * Return: None
+ */
+static void lim_ndp_delete_peers(tpAniSirGlobal mac_ctx,
+ struct peer_ndp_map *ndp_map, uint8_t num_peers)
+{
+ tpDphHashNode sta_ds = NULL;
+ uint16_t deleted_num = 0;
+ int i, j;
+ tpPESession session;
+ struct qdf_mac_addr *deleted_peers;
+ uint16_t peer_idx;
+ bool found;
+
+ deleted_peers = qdf_mem_malloc(num_peers * sizeof(*deleted_peers));
+ if (!deleted_peers) {
+ lim_log(mac_ctx, LOGE, FL("Memory allocation failed"));
+ return;
+ }
+
+ qdf_mem_zero(deleted_peers, num_peers * sizeof(*deleted_peers));
+ for (i = 0; i < num_peers; i++) {
+ lim_log(mac_ctx, LOG1,
+ FL("ndp_map[%d]: MAC: " MAC_ADDRESS_STR " num_active %d"),
+ i,
+ MAC_ADDR_ARRAY(ndp_map[i].peer_ndi_mac_addr.bytes),
+ ndp_map[i].num_active_ndp_sessions);
+
+ /* Do not delete a peer with active NDPs */
+ if (ndp_map[i].num_active_ndp_sessions > 0)
+ continue;
+
+ session = pe_find_session_by_sme_session_id(mac_ctx,
+ ndp_map[i].vdev_id);
+ if (!session || (session->bssType != eSIR_NDI_MODE)) {
+ lim_log(mac_ctx, LOGE,
+ FL("PE session is NULL or non-NDI for sme session %d"),
+ ndp_map[i].vdev_id);
+ continue;
+ }
+
+ /* Check if this peer is already in the deleted list */
+ found = false;
+ for (j = 0; j < deleted_num && !found; j++) {
+ if (qdf_mem_cmp(
+ &deleted_peers[j].bytes,
+ &ndp_map[i].peer_ndi_mac_addr.bytes,
+ QDF_MAC_ADDR_SIZE)) {
+ found = true;
+ break;
+ }
+ }
+ if (found)
+ continue;
+
+ sta_ds = dph_lookup_hash_entry(mac_ctx,
+ ndp_map[i].peer_ndi_mac_addr.bytes,
+ &peer_idx, &session->dph.dphHashTable);
+ if (!sta_ds) {
+ lim_log(mac_ctx, LOGE, FL("Unknown NDI Peer"));
+ continue;
+ }
+ if (sta_ds->staType != STA_ENTRY_NDI_PEER) {
+ lim_log(mac_ctx, LOGE,
+ FL("Non-NDI Peer ignored"));
+ continue;
+ }
+ /*
+ * Call lim_del_sta() with response required set true.
+ * Hence DphHashEntry will be deleted after receiving
+ * that response.
+ */
+ lim_del_sta(mac_ctx, sta_ds, true, session);
+ qdf_copy_macaddr(&deleted_peers[deleted_num++],
+ &ndp_map[i].peer_ndi_mac_addr);
+ }
+ qdf_mem_free(deleted_peers);
+}
+
+/**
+ * lim_ndp_end_indication_handler() - Handler for NDP end indication
+ * @mac_ctx: handle to mac context
+ * @ind_buf: pointer to indication buffer
+ *
+ * It deletes peers from ndp_map. Response of that operation goes
+ * to LIM and HDD. But peer information does not go to service layer.
+ * ndp_id_list is sent to service layer; it is not interpreted by the
+ * driver.
+ *
+ * Return: QDF_STATUS_SUCCESS on success; error number otherwise
+ */
+static QDF_STATUS lim_ndp_end_indication_handler(tpAniSirGlobal mac_ctx,
+ uint32_t *ind_buf)
+{
+
+ struct ndp_end_indication_event *ndp_event_buf =
+ (struct ndp_end_indication_event *)ind_buf;
+ int buf_size;
+
+ if (!ind_buf) {
+ lim_log(mac_ctx, LOGE, FL("NDP end indication buffer is NULL"));
+ return QDF_STATUS_E_INVAL;
+ }
+ lim_ndp_delete_peers(mac_ctx, ndp_event_buf->ndp_map,
+ ndp_event_buf->num_ndp_ids);
+
+ buf_size = sizeof(*ndp_event_buf) + ndp_event_buf->num_ndp_ids *
+ sizeof(ndp_event_buf->ndp_map[0]);
+ lim_send_ndp_event_to_sme(mac_ctx, eWNI_SME_NDP_END_IND,
+ ndp_event_buf, buf_size, false);
+
+ return QDF_STATUS_SUCCESS;
+}
+
+/**
+ * lim_process_ndi_del_sta_rsp() - Handle WDA_DELETE_STA_RSP in eLIM_NDI_ROLE
+ * @mac_ctx: Global MAC context
+ * @lim_msg: LIM message
+ * @pe_session: PE session
+ *
+ * Return: None
+ */
+void lim_process_ndi_del_sta_rsp(tpAniSirGlobal mac_ctx, tpSirMsgQ lim_msg,
+ tpPESession pe_session)
+{
+ tpDeleteStaParams del_sta_params = (tpDeleteStaParams) lim_msg->bodyptr;
+ tpDphHashNode sta_ds;
+ tSirResultCodes status = eSIR_SME_SUCCESS;
+ struct sme_ndp_peer_ind peer_ind;
+
+ if (!del_sta_params) {
+ lim_log(mac_ctx, LOGE,
+ FL("del_sta_params is NULL"));
+ return;
+ }
+ if (!LIM_IS_NDI_ROLE(pe_session)) {
+ lim_log(mac_ctx, LOGE,
+ FL("Session %d is not NDI role"), del_sta_params->assocId);
+ status = eSIR_SME_REFUSED;
+ goto skip_event;
+ }
+
+ sta_ds = dph_get_hash_entry(mac_ctx, del_sta_params->assocId,
+ &pe_session->dph.dphHashTable);
+ if (!sta_ds) {
+ lim_log(mac_ctx, LOGE,
+ FL("DPH Entry for STA %X is missing."),
+ del_sta_params->assocId);
+ status = eSIR_SME_REFUSED;
+ goto skip_event;
+ }
+
+ if (QDF_STATUS_SUCCESS != del_sta_params->status) {
+ lim_log(mac_ctx, LOGE, FL("DEL STA failed!"));
+ status = eSIR_SME_REFUSED;
+ goto skip_event;
+ }
+ lim_log(mac_ctx, LOG1,
+ FL("Deleted STA AssocID %d staId %d MAC " MAC_ADDRESS_STR),
+ sta_ds->assocId, sta_ds->staIndex,
+ MAC_ADDR_ARRAY(sta_ds->staAddr));
+
+ /*
+ * Copy peer info in del peer indication before
+ * lim_delete_dph_hash_entry is called as this will be lost.
+ */
+ peer_ind.msg_len = sizeof(peer_ind);
+ peer_ind.msg_type = eWNI_SME_NDP_PEER_DEPARTED_IND;
+ peer_ind.session_id = pe_session->smeSessionId;
+ peer_ind.sta_id = sta_ds->staIndex;
+ qdf_mem_copy(&peer_ind.peer_mac_addr.bytes,
+ sta_ds->staAddr, sizeof(tSirMacAddr));
+
+ lim_release_peer_idx(mac_ctx, sta_ds->assocId, pe_session);
+ lim_delete_dph_hash_entry(mac_ctx, sta_ds->staAddr, sta_ds->assocId,
+ pe_session);
+ pe_session->limMlmState = eLIM_MLM_IDLE_STATE;
+
+ lim_send_ndp_event_to_sme(mac_ctx, eWNI_SME_NDP_PEER_DEPARTED_IND,
+ &peer_ind, sizeof(peer_ind), false);
+
+skip_event:
+ qdf_mem_free(del_sta_params);
+ lim_msg->bodyptr = NULL;
+}
+
+/**
+ * lim_handle_ndp_event_message() - Handler for NDP events/RSP from WMA
+ * @mac_ctx: handle to mac structure
+ * @msg: pointer to message
+ *
+ * Return: QDF_STATUS_SUCCESS on success; error number otherwise
+ */
+QDF_STATUS lim_handle_ndp_event_message(tpAniSirGlobal mac_ctx, cds_msg_t *msg)
+{
+ QDF_STATUS status = QDF_STATUS_SUCCESS;
+
+ switch (msg->type) {
+ case SIR_HAL_NDP_CONFIRM: {
+ struct ndp_confirm_event *ndp_confirm = msg->bodyptr;
+ if (ndp_confirm->rsp_code != NDP_RESPONSE_ACCEPT &&
+ ndp_confirm->num_active_ndps_on_peer == 0) {
+ /*
+ * This peer was created at ndp_indication but
+ * ndp_confirm failed, so it needs to be deleted
+ */
+ lim_log(mac_ctx, LOGE,
+ FL("NDP confirm with reject and no active ndp sessions. deleting peer: "MAC_ADDRESS_STR" on vdev_id: %d"),
+ MAC_ADDR_ARRAY(
+ ndp_confirm->peer_ndi_mac_addr.bytes),
+ ndp_confirm->vdev_id);
+ lim_ndp_delete_peer_by_addr(mac_ctx,
+ ndp_confirm->vdev_id,
+ ndp_confirm->peer_ndi_mac_addr);
+ }
+ lim_send_ndp_event_to_sme(mac_ctx, eWNI_SME_NDP_CONFIRM_IND,
+ msg->bodyptr, sizeof(*ndp_confirm),
+ msg->bodyval);
+ break;
+ }
+ case SIR_HAL_NDP_INITIATOR_RSP:
+ lim_send_ndp_event_to_sme(mac_ctx, eWNI_SME_NDP_INITIATOR_RSP,
+ msg->bodyptr, sizeof(struct ndp_initiator_rsp),
+ msg->bodyval);
+ break;
+ case SIR_HAL_NDP_INDICATION: {
+ struct ndp_indication_event *ndp_ind = msg->bodyptr;
+ status = lim_handle_ndp_indication_event(mac_ctx, ndp_ind);
+ qdf_mem_free(ndp_ind->ndp_config.ndp_cfg);
+ qdf_mem_free(ndp_ind->ndp_info.ndp_app_info);
+ break;
+ }
+ case SIR_HAL_NDP_RESPONDER_RSP:
+ status = lim_ndp_responder_rsp_handler(mac_ctx, msg->bodyptr,
+ msg->bodyval);
+ break;
+ case SIR_HAL_NDP_END_RSP: {
+ struct ndp_end_rsp_event *ndp_end_rsp = msg->bodyptr;
+ uint32_t rsp_len = sizeof(*ndp_end_rsp);
+
+ if (ndp_end_rsp && ndp_end_rsp->ndp_map) {
+ lim_ndp_delete_peers(mac_ctx, ndp_end_rsp->ndp_map,
+ ndp_end_rsp->num_peers);
+ rsp_len += (ndp_end_rsp->num_peers *
+ sizeof(struct peer_ndp_map));
+ }
+ lim_send_ndp_event_to_sme(mac_ctx, eWNI_SME_NDP_END_RSP,
+ msg->bodyptr, rsp_len, msg->bodyval);
+ break;
+ }
+ case SIR_HAL_NDP_END_IND:
+ status = lim_ndp_end_indication_handler(mac_ctx, msg->bodyptr);
+ break;
+ default:
+ lim_log(mac_ctx, LOGE,
+ FL("Unhandled NDP event: %d"), msg->type);
+ status = QDF_STATUS_E_NOSUPPORT;
+ break;
+ }
+ /*
+ * No need to free body pointer, since the function is serving purpose
+ * of callback and bodyptr if allocated is freed by caller itself
+ */
+ return status;
+}
+
+/**
+ * lim_process_sme_ndp_initiator_req() - Handler for eWNI_SME_NDP_INITIATOR_REQ
+ * from SME.
+ * @mac_ctx: handle to mac structure
+ * @ndp_msg: ndp initiator request msg
+ *
+ * Return: Status of operation
+ */
+QDF_STATUS lim_process_sme_ndp_initiator_req(tpAniSirGlobal mac_ctx,
+ void *ndp_msg)
+{
+ tSirMsgQ msg;
+ QDF_STATUS status;
+
+ struct sir_sme_ndp_initiator_req *sme_req =
+ (struct sir_sme_ndp_initiator_req *)ndp_msg;
+ struct ndp_initiator_req *wma_req;
+
+ if (NULL == ndp_msg) {
+ lim_log(mac_ctx, LOGE, FL("invalid ndp_req"));
+ status = QDF_STATUS_E_INVAL;
+ goto send_initiator_rsp;
+ }
+ wma_req = qdf_mem_malloc(sizeof(*wma_req));
+ if (wma_req == NULL) {
+ lim_log(mac_ctx, LOGE, FL("malloc failed"));
+ status = QDF_STATUS_E_NOMEM;
+ goto send_initiator_rsp;
+ }
+
+ qdf_mem_copy(wma_req, &sme_req->req, sizeof(*wma_req));
+ msg.type = SIR_HAL_NDP_INITIATOR_REQ;
+ msg.reserved = 0;
+ msg.bodyptr = wma_req;
+ msg.bodyval = 0;
+
+ lim_log(mac_ctx, LOG1, FL("sending WDA_NDP_INITIATOR_REQ to WMA"));
+ MTRACE(mac_trace_msg_tx(mac_ctx, NO_SESSION, msg.type));
+
+ if (eSIR_SUCCESS != wma_post_ctrl_msg(mac_ctx, &msg))
+ lim_log(mac_ctx, LOGP, FL("wma_post_ctrl_msg failed"));
+
+ return QDF_STATUS_SUCCESS;
+send_initiator_rsp:
+ /* msg to unblock SME, but not send rsp to HDD */
+ lim_send_ndp_event_to_sme(mac_ctx, eWNI_SME_NDP_INITIATOR_RSP,
+ NULL, 0, true);
+ return status;
+}
+
+/**
+ * lim_process_sme_ndp_responder_req() - Handler for NDP responder req
+ * @mac_ctx: handle to mac structure
+ * @ndp_msg: pointer to message
+ *
+ * Return: QDF_STATUS_SUCCESS on success or failure code in case of failure
+ */
+static QDF_STATUS lim_process_sme_ndp_responder_req(tpAniSirGlobal mac_ctx,
+ struct sir_sme_ndp_responder_req *lim_msg)
+{
+ tSirMsgQ msg;
+ QDF_STATUS status = QDF_STATUS_SUCCESS;
+ struct ndp_responder_req *responder_req;
+
+ if (NULL == lim_msg) {
+ lim_log(mac_ctx, LOGE, FL("ndp_msg is NULL"));
+ status = QDF_STATUS_E_INVAL;
+ goto send_failure_rsp;
+ }
+ responder_req = qdf_mem_malloc(sizeof(*responder_req));
+ if (NULL == responder_req) {
+ lim_log(mac_ctx, LOGE,
+ FL("Unable to allocate memory for responder_req"));
+ status = QDF_STATUS_E_NOMEM;
+ goto send_failure_rsp;
+ }
+ qdf_mem_copy(responder_req, &lim_msg->req, sizeof(*responder_req));
+ msg.type = SIR_HAL_NDP_RESPONDER_REQ;
+ msg.reserved = 0;
+ msg.bodyptr = responder_req;
+ msg.bodyval = 0;
+
+ lim_log(mac_ctx, LOG1, FL("sending SIR_HAL_NDP_RESPONDER_REQ to WMA"));
+ MTRACE(mac_trace_msg_tx(mac_ctx, NO_SESSION, msg.type));
+
+ if (eSIR_SUCCESS != wma_post_ctrl_msg(mac_ctx, &msg)) {
+ lim_log(mac_ctx, LOGP, FL("wma_post_ctrl_msg failed"));
+ status = QDF_STATUS_E_FAILURE;
+ qdf_mem_free(responder_req);
+ goto send_failure_rsp;
+ }
+ return status;
+send_failure_rsp:
+ /* msg to unblock SME, but not send rsp to HDD */
+ lim_send_ndp_event_to_sme(mac_ctx, eWNI_SME_NDP_RESPONDER_RSP,
+ NULL, 0, true);
+ return status;
+}
+
+/**
+ * lim_process_sme_ndp_data_end_req() - Handler for eWNI_SME_NDP_END_REQ
+ * from SME.
+ * @mac_ctx: handle to mac context
+ * @sme_msg: ndp data end request msg
+ *
+ * Return: Status of operation
+ */
+QDF_STATUS lim_process_sme_ndp_data_end_req(tpAniSirGlobal mac_ctx,
+ struct sir_sme_ndp_end_req *sme_msg)
+{
+ tSirMsgQ msg;
+ uint32_t len;
+ QDF_STATUS status = QDF_STATUS_SUCCESS;
+
+ if (NULL == sme_msg) {
+ lim_log(mac_ctx, LOGE, FL("invalid ndp_req"));
+ /* msg to unblock SME, but not send rsp to HDD */
+ lim_send_ndp_event_to_sme(mac_ctx, eWNI_SME_NDP_END_RSP, NULL,
+ 0, true);
+ return QDF_STATUS_E_INVAL;
+ }
+
+ msg.type = SIR_HAL_NDP_END_REQ;
+ msg.reserved = 0;
+ len = sizeof(*sme_msg->req) + (sme_msg->req->num_ndp_instances *
+ sizeof(uint32_t));
+ msg.bodyptr = qdf_mem_malloc(len);
+ if (NULL == msg.bodyptr) {
+ /* msg to unblock SME, but not send rsp to HDD */
+ lim_send_ndp_event_to_sme(mac_ctx, eWNI_SME_NDP_END_RSP, NULL,
+ 0, true);
+ return QDF_STATUS_E_NOMEM;
+ }
+ qdf_mem_copy(msg.bodyptr, sme_msg->req, len);
+ msg.bodyval = 0;
+
+ lim_log(mac_ctx, LOG1, FL("sending SIR_HAL_NDP_END_REQ to WMA"));
+ MTRACE(mac_trace_msg_tx(mac_ctx, NO_SESSION, msg.type));
+
+ if (eSIR_SUCCESS != wma_post_ctrl_msg(mac_ctx, &msg)) {
+ lim_log(mac_ctx, LOGP, FL("wma_post_ctrl_msg failed"));
+ status = QDF_STATUS_E_FAILURE;
+ }
+
+ return status;
+}
+
+/**
+ * lim_handle_ndp_request_message() - Handler for NDP req from SME
+ * @mac_ctx: handle to mac structure
+ * @msg: pointer to message
+ *
+ * Return: QDF_STATUS_SUCCESS on success; error number otherwise
+ */
+QDF_STATUS lim_handle_ndp_request_message(tpAniSirGlobal mac_ctx,
+ tpSirMsgQ msg)
+{
+ QDF_STATUS status;
+
+ switch (msg->type) {
+ case eWNI_SME_NDP_END_REQ:
+ status = lim_process_sme_ndp_data_end_req(mac_ctx,
+ msg->bodyptr);
+ break;
+ case eWNI_SME_NDP_INITIATOR_REQ:
+ status = lim_process_sme_ndp_initiator_req(mac_ctx,
+ msg->bodyptr);
+ break;
+ case eWNI_SME_NDP_RESPONDER_REQ:
+ status = lim_process_sme_ndp_responder_req(mac_ctx,
+ msg->bodyptr);
+ break;
+ default:
+ lim_log(mac_ctx, LOGE, FL("Unhandled NDP request: %d"),
+ msg->type);
+ status = QDF_STATUS_E_NOSUPPORT;
+ break;
+ }
+ return status;
+}
+
+/**
+ * lim_process_ndi_mlm_add_bss_rsp() - Process ADD_BSS response for NDI
+ * @mac_ctx: Pointer to Global MAC structure
+ * @lim_msgq: The MsgQ header, which contains the response buffer
+ * @session_entry: PE session
+ *
+ * Return: None
+ */
+void lim_process_ndi_mlm_add_bss_rsp(tpAniSirGlobal mac_ctx, tpSirMsgQ lim_msgq,
+ tpPESession session_entry)
+{
+ tLimMlmStartCnf mlm_start_cnf;
+ tpAddBssParams add_bss_params = (tpAddBssParams) lim_msgq->bodyptr;
+
+ lim_log(mac_ctx, LOG1, FL("Status %d"), add_bss_params->status);
+ if (NULL == add_bss_params) {
+ lim_log(mac_ctx, LOGE, FL("Invalid body pointer in message"));
+ goto end;
+ }
+ if (QDF_STATUS_SUCCESS == add_bss_params->status) {
+ lim_log(mac_ctx, LOG1,
+ FL("WDA_ADD_BSS_RSP returned QDF_STATUS_SUCCESS"));
+ session_entry->limMlmState = eLIM_MLM_BSS_STARTED_STATE;
+ MTRACE(mac_trace(mac_ctx, TRACE_CODE_MLM_STATE,
+ session_entry->peSessionId,
+ session_entry->limMlmState));
+ session_entry->bssIdx = (uint8_t) add_bss_params->bssIdx;
+ session_entry->limSystemRole = eLIM_NDI_ROLE;
+ session_entry->statypeForBss = STA_ENTRY_SELF;
+ /* Apply previously set configuration at HW */
+ lim_apply_configuration(mac_ctx, session_entry);
+ mlm_start_cnf.resultCode = eSIR_SME_SUCCESS;
+ } else {
+ lim_log(mac_ctx, LOGE,
+ FL("WDA_ADD_BSS_REQ failed with status %d"),
+ add_bss_params->status);
+ mlm_start_cnf.resultCode = eSIR_SME_HAL_SEND_MESSAGE_FAIL;
+ }
+ mlm_start_cnf.sessionId = session_entry->peSessionId;
+ lim_post_sme_message(mac_ctx, LIM_MLM_START_CNF,
+ (uint32_t *) &mlm_start_cnf);
+end:
+ qdf_mem_free(lim_msgq->bodyptr);
+ lim_msgq->bodyptr = NULL;
+}
+
+/**
+ * lim_ndi_del_bss_rsp() - Handler for DEL BSS resp for NDI interface
+ * @mac_ctx: handle to mac structure
+ * @msg: pointer to message
+ * @session_entry: session entry
+ *
+ * Return: None
+ */
+void lim_ndi_del_bss_rsp(tpAniSirGlobal mac_ctx,
+ void *msg, tpPESession session_entry)
+{
+ tSirResultCodes rc = eSIR_SME_SUCCESS;
+ tpDeleteBssParams del_bss = (tpDeleteBssParams) msg;
+
+ SET_LIM_PROCESS_DEFD_MESGS(mac_ctx, true);
+ if (del_bss == NULL) {
+ lim_log(mac_ctx, LOGE,
+ FL("NDI: DEL_BSS_RSP with no body!"));
+ rc = eSIR_SME_STOP_BSS_FAILURE;
+ goto end;
+ }
+ session_entry =
+ pe_find_session_by_session_id(mac_ctx, del_bss->sessionId);
+ if (!session_entry) {
+ lim_log(mac_ctx, LOGE,
+ FL("Session Does not exist for given sessionID"));
+ goto end;
+ }
+
+ if (del_bss->status != QDF_STATUS_SUCCESS) {
+ lim_log(mac_ctx, LOGE,
+ FL("NDI: DEL_BSS_RSP error (%x) Bss %d "),
+ del_bss->status, del_bss->bssIdx);
+ rc = eSIR_SME_STOP_BSS_FAILURE;
+ goto end;
+ }
+
+ if (lim_set_link_state(mac_ctx, eSIR_LINK_IDLE_STATE,
+ session_entry->selfMacAddr,
+ session_entry->selfMacAddr, NULL, NULL)
+ != eSIR_SUCCESS) {
+ lim_log(mac_ctx, LOGE,
+ FL("NDI: DEL_BSS_RSP setLinkState failed"));
+ goto end;
+ }
+
+ session_entry->limMlmState = eLIM_MLM_IDLE_STATE;
+
+end:
+ if (del_bss)
+ qdf_mem_free(del_bss);
+ /* Delete PE session once BSS is deleted */
+ if (NULL != session_entry) {
+ lim_send_sme_rsp(mac_ctx, eWNI_SME_STOP_BSS_RSP,
+ rc, session_entry->smeSessionId,
+ session_entry->transactionId);
+ pe_delete_session(mac_ctx, session_entry);
+ session_entry = NULL;
+ }
+}
+
+/**
+ * lim_send_sme_ndp_add_sta_rsp() - prepares and send new peer ind to SME
+ * @mac_ctx: handle to mac structure
+ * @session: session pointer
+ * @add_sta_rsp: add sta response struct
+ *
+ * Return: status of operation
+ */
+static QDF_STATUS lim_send_sme_ndp_add_sta_rsp(tpAniSirGlobal mac_ctx,
+ tpPESession session,
+ tAddStaParams *add_sta_rsp)
+{
+ tSirMsgQ mmh_msg = {0};
+ struct sme_ndp_peer_ind *new_peer_ind;
+
+ mmh_msg.type = eWNI_SME_NDP_NEW_PEER_IND;
+
+ if (NULL == add_sta_rsp) {
+ lim_log(mac_ctx, LOGE, FL("Invalid add_sta_rsp"));
+ return QDF_STATUS_E_INVAL;
+ }
+
+ new_peer_ind = qdf_mem_malloc(sizeof(*new_peer_ind));
+ if (NULL == new_peer_ind) {
+ lim_log(mac_ctx, LOGE, FL("Failed to allocate memory"));
+ return QDF_STATUS_E_NOMEM;
+ }
+
+ /* this message is going to HDD, fill in sme session id */
+ new_peer_ind->session_id = add_sta_rsp->smesessionId;
+ new_peer_ind->msg_len = sizeof(struct sme_ndp_peer_ind);
+ new_peer_ind->msg_type = eWNI_SME_NDP_NEW_PEER_IND;
+ qdf_mem_copy(new_peer_ind->peer_mac_addr.bytes, add_sta_rsp->staMac,
+ sizeof(tSirMacAddr));
+ new_peer_ind->sta_id = add_sta_rsp->staIdx;
+
+ mmh_msg.bodyptr = new_peer_ind;
+ mmh_msg.bodyval = 0;
+ lim_sys_process_mmh_msg_api(mac_ctx, &mmh_msg, ePROT);
+ return QDF_STATUS_SUCCESS;
+}
+
+/**
+ * lim_ndp_add_sta_rsp() - handles add sta rsp for NDP from WMA
+ * @mac_ctx: handle to mac structure
+ * @session: session pointer
+ * @add_sta_rsp: add sta response struct
+ *
+ * Return: None
+ */
+void lim_ndp_add_sta_rsp(tpAniSirGlobal mac_ctx, tpPESession session,
+ tAddStaParams *add_sta_rsp)
+{
+ tpDphHashNode sta_ds;
+ uint16_t peer_idx;
+
+ if (NULL == add_sta_rsp) {
+ lim_log(mac_ctx, LOGE, FL("Invalid add_sta_rsp"));
+ qdf_mem_free(add_sta_rsp);
+ return;
+ }
+
+ SET_LIM_PROCESS_DEFD_MESGS(mac_ctx, true);
+ sta_ds = dph_lookup_hash_entry(mac_ctx, add_sta_rsp->staMac, &peer_idx,
+ &session->dph.dphHashTable);
+ if (sta_ds == NULL) {
+ lim_log(mac_ctx, LOGE,
+ FL("NAN: ADD_STA_RSP for unknown MAC addr "
+ MAC_ADDRESS_STR),
+ MAC_ADDR_ARRAY(add_sta_rsp->staMac));
+ qdf_mem_free(add_sta_rsp);
+ return;
+ }
+
+ if (add_sta_rsp->status != QDF_STATUS_SUCCESS) {
+ lim_log(mac_ctx, LOGE,
+ FL("NAN: ADD_STA_RSP error %x for MAC addr: %pM"),
+ add_sta_rsp->status, add_sta_rsp->staMac);
+ /* delete the sta_ds allocated during ADD STA */
+ lim_delete_dph_hash_entry(mac_ctx, add_sta_rsp->staMac,
+ peer_idx, session);
+ qdf_mem_free(add_sta_rsp);
+ return;
+ }
+ sta_ds->bssId = add_sta_rsp->bssIdx;
+ sta_ds->staIndex = add_sta_rsp->staIdx;
+ sta_ds->ucUcastSig = add_sta_rsp->ucUcastSig;
+ sta_ds->ucBcastSig = add_sta_rsp->ucBcastSig;
+ sta_ds->valid = 1;
+ sta_ds->mlmStaContext.mlmState = eLIM_MLM_LINK_ESTABLISHED_STATE;
+ lim_send_sme_ndp_add_sta_rsp(mac_ctx, session, add_sta_rsp);
+ qdf_mem_free(add_sta_rsp);
+}
diff --git a/core/mac/src/pe/nan/nan_datapath.h b/core/mac/src/pe/nan/nan_datapath.h
index d4f23984c105..360a3e90dece 100644
--- a/core/mac/src/pe/nan/nan_datapath.h
+++ b/core/mac/src/pe/nan/nan_datapath.h
@@ -27,5 +27,135 @@
#ifndef __MAC_NAN_DATAPATH_H
#define __MAC_NAN_DATAPATH_H
+#ifdef WLAN_FEATURE_NAN_DATAPATH
+
+#include "sir_common.h"
+#include "ani_global.h"
+#include "sir_params.h"
+
+/**
+ * struct ndp_peer_node - structure for holding per-peer context
+ * @next: pointer to the next peer
+ * @peer_mac_addr: peer mac address
+ * @ext_rates_present: extended rates supported
+ * @edca_present: edca supported
+ * @wme_edca_present: WME EDCA supported
+ * @wme_info_present: WME info supported
+ * @ht_capable: HT capable
+ * @vht_capable: VHT capabale
+ * @ht_sec_chan_offset: HT secondary channel offset
+ * @capability_info: Generic capability info
+ * @supported_rates: Supported rates
+ * @extended_rates: Supported extended rates
+ * @supported_mcs_rate: Supported MCS rates
+ * @edca_params: EDCA parameters
+ * @erp_ie_present: ERP IE supported
+ * @ht_green_field: HT green field supported
+ * @ht_shortGI_40Mhz; 40 MHZ short GI support
+ * @ht_shortGI_20Mhz; 20 MHZ short GI support
+ * @ht_mimo_ps_state: MIMO power state
+ * @ht_ampdu_density: AMPDU density
+ * @ht_max_rxampdu_factor: receieve AMPDU factor
+ * @ht_max_amsdu_len: Max AMSDU lengh supported
+ * @ht_supp_chan_widthset: Supported channel widthset
+ * @ht_ldpc_capable: LDPC capable
+ * @heartbeat_failure: heart beat failure indication flag
+ * @vht_caps: VHT capability
+ * @vht_supp_chanwidth_set: VHT supported channel width
+ * @vht_beamformer_capable: Beam former capable
+ */
+struct ndp_peer_node {
+ struct ndp_peer_node *next;
+ struct qdf_mac_addr peer_mac_addr;
+ uint8_t ext_rates_present;
+ uint8_t edca_present;
+ uint8_t wme_edca_present;
+ uint8_t wme_info_present;
+ uint8_t ht_capable;
+ uint8_t vht_capable;
+ uint8_t ht_sec_chan_offset;
+ tSirMacCapabilityInfo capability_info;
+ tSirMacRateSet supported_rates;
+ tSirMacRateSet extended_rates;
+ uint8_t supported_mcs_rate[SIZE_OF_SUPPORTED_MCS_SET];
+ tSirMacEdcaParamSetIE edca_params;
+ uint8_t erp_ie_present;
+ uint8_t ht_green_field;
+ uint8_t ht_shortGI_40Mhz;
+ uint8_t ht_shortGI_20Mhz;
+ /* MIMO Power Save */
+ tSirMacHTMIMOPowerSaveState ht_mimo_ps_state;
+ uint8_t ht_ampdu_density;
+ /* Maximum Rx A-MPDU factor */
+ uint8_t ht_max_rxampdu_factor;
+ uint8_t ht_max_amsdu_len;
+ uint8_t ht_supp_chan_widthset;
+ uint8_t ht_ldpc_capable;
+ uint8_t heartbeat_failure;
+
+#ifdef WLAN_FEATURE_11AC
+ tDot11fIEVHTCaps vht_caps;
+ uint8_t vht_supp_chanwidth_set;
+ uint8_t vht_beamformer_capable;
+#endif
+};
+
+/* Function to process NDP requests */
+QDF_STATUS lim_handle_ndp_request_message(tpAniSirGlobal mac_ctx,
+ tpSirMsgQ msg);
+/* Function to process NDP events */
+QDF_STATUS lim_handle_ndp_event_message(tpAniSirGlobal mac_ctx, cds_msg_t *msg);
+void lim_process_ndi_mlm_add_bss_rsp(tpAniSirGlobal mac_ctx,
+ tpSirMsgQ lim_msg_q,
+ tpPESession session_entry);
+/* Handler for DEL BSS resp for NDI interface */
+void lim_ndi_del_bss_rsp(tpAniSirGlobal mac_ctx,
+ void *msg, tpPESession session_entry);
+
+void lim_ndp_add_sta_rsp(tpAniSirGlobal mac_ctx, tpPESession session_entry,
+ tAddStaParams *add_sta_rsp);
+
+void lim_process_ndi_del_sta_rsp(tpAniSirGlobal mac_ctx, tpSirMsgQ lim_msg,
+ tpPESession pe_session);
+
+#else
+
+/* Function to process NDP requests */
+static inline QDF_STATUS lim_handle_ndp_request_message(tpAniSirGlobal mac_ctx,
+ tpSirMsgQ msg)
+{
+ return QDF_STATUS_SUCCESS;
+}
+
+/* Function to process NDP events */
+static inline QDF_STATUS lim_handle_ndp_event_message(tpAniSirGlobal mac_ctx,
+ cds_msg_t *msg)
+{
+ return QDF_STATUS_SUCCESS;
+}
+
+/* Function to process NDP events */
+static inline void lim_process_ndi_mlm_add_bss_rsp(tpAniSirGlobal mac_ctx,
+ tpSirMsgQ lim_msg_q,
+ tpPESession session_entry)
+{
+}
+static inline void lim_ndi_del_bss_rsp(tpAniSirGlobal mac_ctx,
+ void *msg, tpPESession session_entry)
+{
+}
+static inline void lim_process_ndi_del_sta_rsp(tpAniSirGlobal mac_ctx,
+ tpSirMsgQ lim_msg, tpPESession pe_session)
+{
+}
+
+static inline void lim_ndp_add_sta_rsp(tpAniSirGlobal mac_ctx,
+ tpPESession session_entry,
+ tAddStaParams *add_sta_rsp)
+{
+}
+
+#endif /* WLAN_FEATURE_NAN_DATAPATH */
+
#endif /* __MAC_NAN_DATAPATH_H */
diff --git a/core/mac/src/pe/rrm/rrm_api.c b/core/mac/src/pe/rrm/rrm_api.c
index 2ddc38bd7571..3e9d4abdb169 100644
--- a/core/mac/src/pe/rrm/rrm_api.c
+++ b/core/mac/src/pe/rrm/rrm_api.c
@@ -800,7 +800,7 @@ rrm_process_beacon_report_xmit(tpAniSirGlobal mac_ctx,
tpRRMReq curr_req = mac_ctx->rrm.rrmPEContext.pCurrentReq;
tpPESession session_entry;
uint8_t session_id;
- bool flag_bss_present = false, bss_desc_count = 0;
+ bool flag_bss_present, bss_desc_count = 0;
lim_log(mac_ctx, LOG1, FL("Received beacon report xmit indication"));
@@ -845,6 +845,7 @@ rrm_process_beacon_report_xmit(tpAniSirGlobal mac_ctx,
report[bss_desc_count].report.beaconReport;
bss_desc = beacon_xmit_ind->
pBssDescription[bss_desc_count];
+ flag_bss_present = false;
/* Prepare the beacon report and send it to the peer.*/
report[bss_desc_count].token =
beacon_xmit_ind->uDialogToken;
diff --git a/core/mac/src/sys/legacy/src/utils/src/parser_api.c b/core/mac/src/sys/legacy/src/utils/src/parser_api.c
index 1537eefe5b29..3bbb6dc88bfd 100644
--- a/core/mac/src/sys/legacy/src/utils/src/parser_api.c
+++ b/core/mac/src/sys/legacy/src/utils/src/parser_api.c
@@ -733,12 +733,8 @@ populate_dot11f_ht_caps(tpAniSirGlobal pMac,
psessionEntry->htSupportedChannelWidthSet;
pDot11f->txSTBC = psessionEntry->htConfig.ht_tx_stbc;
pDot11f->rxSTBC = psessionEntry->htConfig.ht_rx_stbc;
- if (psessionEntry->htConfig.ht_sgi) {
- pDot11f->shortGI20MHz =
- uHTCapabilityInfo.htCapInfo.shortGI20MHz;
- pDot11f->shortGI40MHz =
- uHTCapabilityInfo.htCapInfo.shortGI40MHz;
- }
+ pDot11f->shortGI20MHz = psessionEntry->htConfig.ht_sgi20;
+ pDot11f->shortGI40MHz = psessionEntry->htConfig.ht_sgi40;
}
/* Ensure that shortGI40MHz is Disabled if supportedChannelWidthSet is
@@ -972,7 +968,7 @@ populate_dot11f_vht_caps(tpAniSirGlobal pMac,
pDot11f->shortGI80MHz = 0;
} else {
nCfgValue = 0;
- if (psessionEntry->htConfig.ht_sgi)
+ if (psessionEntry->htConfig.ht_sgi20)
CFG_GET_INT(nStatus, pMac,
WNI_CFG_VHT_SHORT_GI_80MHZ,
nCfgValue);
@@ -983,7 +979,7 @@ populate_dot11f_vht_caps(tpAniSirGlobal pMac,
pDot11f->shortGI160and80plus80MHz = 0;
} else {
nCfgValue = 0;
- if (psessionEntry->htConfig.ht_sgi)
+ if (psessionEntry->htConfig.ht_sgi20)
CFG_GET_INT(nStatus, pMac,
WNI_CFG_VHT_SHORT_GI_160_AND_80_PLUS_80MHZ,
nCfgValue);
diff --git a/core/mac/src/sys/legacy/src/utils/src/utils_parser.c b/core/mac/src/sys/legacy/src/utils/src/utils_parser.c
index 093e40430ff0..e300de33aee2 100644
--- a/core/mac/src/sys/legacy/src/utils/src/utils_parser.c
+++ b/core/mac/src/sys/legacy/src/utils/src/utils_parser.c
@@ -708,8 +708,15 @@ void convert_qos_mapset_frame(tpAniSirGlobal pMac, tSirQosMapSet *Qos,
tDot11fIEQosMapSet *dot11fIE)
{
uint8_t i, j = 0;
+ uint8_t qos_dscp_sz, dot11_dscp_sz;
+
+ qos_dscp_sz = (sizeof(Qos->dscp_exceptions)/2);
+ dot11_dscp_sz = sizeof(dot11fIE->dscp_exceptions);
Qos->num_dscp_exceptions = (dot11fIE->num_dscp_exceptions - 16) / 2;
- for (i = 0; i < Qos->num_dscp_exceptions; i++) {
+ for (i = 0;
+ i < Qos->num_dscp_exceptions &&
+ i < qos_dscp_sz && j < dot11_dscp_sz;
+ i++) {
Qos->dscp_exceptions[i][0] = dot11fIE->dscp_exceptions[j];
j++;
Qos->dscp_exceptions[i][1] = dot11fIE->dscp_exceptions[j];
diff --git a/core/sap/src/sap_api_link_cntl.c b/core/sap/src/sap_api_link_cntl.c
index d0b3a00582c0..4f7f7f7660f6 100644
--- a/core/sap/src/sap_api_link_cntl.c
+++ b/core/sap/src/sap_api_link_cntl.c
@@ -675,6 +675,7 @@ wlansap_roam_process_dfs_radar_found(tpAniSirGlobal mac_ctx,
*/
qdf_mc_timer_stop(&mac_ctx->sap.SapDfsInfo.sap_dfs_cac_timer);
qdf_mc_timer_destroy(&mac_ctx->sap.SapDfsInfo.sap_dfs_cac_timer);
+ mac_ctx->sap.SapDfsInfo.is_dfs_cac_timer_running = false;
/*
* User space is already indicated the CAC start and if
@@ -692,7 +693,6 @@ wlansap_roam_process_dfs_radar_found(tpAniSirGlobal mac_ctx,
*/
}
- mac_ctx->sap.SapDfsInfo.is_dfs_cac_timer_running = 0;
sap_event.event = eSAP_DFS_CHANNEL_CAC_RADAR_FOUND;
sap_event.params = 0;
sap_event.u1 = 0;
diff --git a/core/sap/src/sap_fsm.c b/core/sap/src/sap_fsm.c
index dd439e790da3..f36c35633551 100644
--- a/core/sap/src/sap_fsm.c
+++ b/core/sap/src/sap_fsm.c
@@ -2341,8 +2341,7 @@ QDF_STATUS sap_goto_channel_sel(ptSapContext sap_context,
FL("for configured channel, Ch= %d"),
sap_context->channel);
- if (mac_ctx->policy_manager_enabled &&
- check_for_connection_update) {
+ if (check_for_connection_update) {
/* This wait happens in the hostapd context. The event
* is set in the MC thread context.
*/
@@ -4655,11 +4654,18 @@ void sap_dfs_cac_timer_callback(void *data)
return;
}
- /* Check to ensure that SAP is in DFS WAIT state */
- if (sapContext->sapsMachine == eSAP_DFS_CAC_WAIT) {
+ /*
+ * SAP may not be in CAC wait state, when the timer runs out.
+ * if following flag is set, then timer is in initialized state,
+ * destroy timer here.
+ */
+ if (pMac->sap.SapDfsInfo.is_dfs_cac_timer_running == true) {
qdf_mc_timer_destroy(&pMac->sap.SapDfsInfo.sap_dfs_cac_timer);
pMac->sap.SapDfsInfo.is_dfs_cac_timer_running = false;
+ }
+ /* Check to ensure that SAP is in DFS WAIT state */
+ if (sapContext->sapsMachine == eSAP_DFS_CAC_WAIT) {
/*
* CAC Complete, post eSAP_DFS_CHANNEL_CAC_END to sap_fsm
*/
@@ -4703,6 +4709,7 @@ static int sap_stop_dfs_cac_timer(ptSapContext sapContext)
qdf_mc_timer_stop(&pMac->sap.SapDfsInfo.sap_dfs_cac_timer);
pMac->sap.SapDfsInfo.is_dfs_cac_timer_running = 0;
+ qdf_mc_timer_destroy(&pMac->sap.SapDfsInfo.sap_dfs_cac_timer);
return 0;
}
@@ -4783,6 +4790,8 @@ int sap_start_dfs_cac_timer(ptSapContext sapContext)
pMac->sap.SapDfsInfo.is_dfs_cac_timer_running = true;
return 1;
} else {
+ pMac->sap.SapDfsInfo.is_dfs_cac_timer_running = false;
+ qdf_mc_timer_destroy(&pMac->sap.SapDfsInfo.sap_dfs_cac_timer);
return 0;
}
}
diff --git a/core/sme/inc/csr_api.h b/core/sme/inc/csr_api.h
index 2c3b8068d73a..de7d011d7a98 100644
--- a/core/sme/inc/csr_api.h
+++ b/core/sme/inc/csr_api.h
@@ -141,12 +141,22 @@ typedef enum {
eCSR_NUM_PHY_MODE = 16,
} eCsrPhyMode;
+/**
+ * enum eCsrRoamBssType - BSS type in CSR operations
+ * @eCSR_BSS_TYPE_INFRASTRUCTURE: Infrastructure station
+ * @eCSR_BSS_TYPE_INFRA_AP: SoftAP
+ * @eCSR_BSS_TYPE_IBSS: IBSS network we'll not start
+ * @eCSR_BSS_TYPE_START_IBSS: IBSS network we'll start if no partners found
+ * @eCSR_BSS_TYPE_NDI: NAN datapath interface
+ * @eCSR_BSS_TYPE_ANY: any BSS type (IBSS or Infrastructure)
+ */
typedef enum {
eCSR_BSS_TYPE_INFRASTRUCTURE,
- eCSR_BSS_TYPE_INFRA_AP, /* SoftAP AP */
- eCSR_BSS_TYPE_IBSS, /* IBSS network we'll NOT start */
- eCSR_BSS_TYPE_START_IBSS, /* IBSS network we'll start if no partners */
- eCSR_BSS_TYPE_ANY, /* any BSS type (IBSS or Infrastructure).*/
+ eCSR_BSS_TYPE_INFRA_AP,
+ eCSR_BSS_TYPE_IBSS,
+ eCSR_BSS_TYPE_START_IBSS,
+ eCSR_BSS_TYPE_NDI,
+ eCSR_BSS_TYPE_ANY,
} eCsrRoamBssType;
typedef enum {
@@ -501,6 +511,7 @@ typedef enum {
eCSR_ROAM_DISABLE_QUEUES,
eCSR_ROAM_ENABLE_QUEUES,
eCSR_ROAM_STA_CHANNEL_SWITCH,
+ eCSR_ROAM_NDP_STATUS_UPDATE,
} eRoamCmdStatus;
/* comment inside indicates what roaming callback gets */
@@ -598,6 +609,18 @@ typedef enum {
eCSR_ROAM_RESULT_CHANNEL_CHANGE_FAILURE,
eCSR_ROAM_RESULT_DFS_CHANSW_UPDATE_SUCCESS,
eCSR_ROAM_EXT_CHG_CHNL_UPDATE_IND,
+
+ eCSR_ROAM_RESULT_NDI_CREATE_RSP,
+ eCSR_ROAM_RESULT_NDI_DELETE_RSP,
+ eCSR_ROAM_RESULT_NDP_INITIATOR_RSP,
+ eCSR_ROAM_RESULT_NDP_NEW_PEER_IND,
+ eCSR_ROAM_RESULT_NDP_CONFIRM_IND,
+ eCSR_ROAM_RESULT_NDP_INDICATION,
+ eCSR_ROAM_RESULT_NDP_SCHED_UPDATE_RSP,
+ eCSR_ROAM_RESULT_NDP_RESPONDER_RSP,
+ eCSR_ROAM_RESULT_NDP_END_RSP,
+ eCSR_ROAM_RESULT_NDP_PEER_DEPARTED_IND,
+ eCSR_ROAM_RESULT_NDP_END_IND,
} eCsrRoamResult;
/*----------------------------------------------------------------------------
@@ -623,6 +646,7 @@ typedef enum {
eCSR_DISCONNECT_REASON_IBSS_JOIN_FAILURE,
eCSR_DISCONNECT_REASON_IBSS_LEAVE,
eCSR_DISCONNECT_REASON_STA_HAS_LEFT,
+ eCSR_DISCONNECT_REASON_NDI_DELETE,
} eCsrRoamDisconnectReason;
typedef enum {
@@ -644,6 +668,10 @@ typedef enum {
eCSR_ASSOC_STATE_TYPE_INFRA_CONNECTED,
/* Disconnecting with AP or stop connecting process */
eCSR_ASSOC_STATE_TYPE_INFRA_DISCONNECTING,
+ /* NAN Data interface not started */
+ eCSR_CONNECT_STATE_TYPE_NDI_NOT_STARTED,
+ /* NAN Data inteface started */
+ eCSR_CONNECT_STATE_TYPE_NDI_STARTED,
} eCsrConnectState;
@@ -1223,7 +1251,6 @@ typedef struct tagCsrConfigParam {
#endif /* FEATURE_AP_MCC_CH_AVOIDANCE */
uint8_t f_prefer_non_dfs_on_radar;
bool is_ps_enabled;
- bool policy_manager_enabled;
uint32_t fine_time_meas_cap;
uint32_t dual_mac_feature_disable;
uint32_t roam_dense_traffic_thresh;
@@ -1351,6 +1378,21 @@ typedef struct tagCsrRoamInfo {
#endif
tSirSmeChanInfo chan_info;
uint8_t target_channel;
+
+#ifdef WLAN_FEATURE_NAN_DATAPATH
+ union {
+ struct sme_ndp_peer_ind ndp_peer_ind_params;
+ struct ndp_schedule_update_rsp ndp_sched_upd_rsp_params;
+ struct ndp_end_indication_event *ndp_end_ind_params;
+ struct ndp_end_rsp_event *ndp_end_rsp_params;
+ struct ndp_confirm_event ndp_confirm_params;
+ struct ndp_responder_rsp_event ndp_responder_rsp_params;
+ struct ndp_indication_event ndp_indication_params;
+ struct ndp_initiator_rsp ndp_init_rsp_params;
+ struct ndi_create_rsp ndi_create_params;
+ struct ndi_delete_rsp ndi_delete_params;
+ } ndp;
+#endif
} tCsrRoamInfo;
typedef struct tagCsrFreqScanInfo {
@@ -1578,8 +1620,19 @@ typedef QDF_STATUS (*csr_roamSessionCloseCallback)(void *pContext);
(pProfile)->BSSType)
#define CSR_IS_INFRA_AP(pProfile) (eCSR_BSS_TYPE_INFRA_AP == \
(pProfile)->BSSType)
+#ifdef WLAN_FEATURE_NAN_DATAPATH
+#define CSR_IS_NDI(profile) (eCSR_BSS_TYPE_NDI == (profile)->BSSType)
+#else
+#define CSR_IS_NDI(profile) (false)
+#endif
#define CSR_IS_CONN_INFRA_AP(pProfile) (eCSR_BSS_TYPE_INFRA_AP == \
(pProfile)->BSSType)
+#ifdef WLAN_FEATURE_NAN_DATAPATH
+#define CSR_IS_CONN_NDI(profile) (eCSR_BSS_TYPE_NDI == (profile)->BSSType)
+#else
+#define CSR_IS_CONN_NDI(profile) (false)
+#endif
+
#define CSR_IS_CLOSE_SESSION_COMMAND(pCommand) \
((pCommand)->command == eSmeCommandDelStaSession)
diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h
index 11557c7b237f..015d1ca1f940 100644
--- a/core/sme/inc/sme_api.h
+++ b/core/sme/inc/sme_api.h
@@ -914,7 +914,7 @@ QDF_STATUS sme_set_scanning_mac_oui(tHalHandle hHal,
\param hHal - The handle returned by macOpen.
\param sessionId - Session Identifier
\param pRequest - Pointer to the offload request.
- \return eHalStatus
+ \return QDF_STATUS
---------------------------------------------------------------------------*/
QDF_STATUS sme_ipa_offload_enable_disable(tHalHandle hal,
uint8_t session_id,
@@ -978,6 +978,7 @@ QDF_STATUS sme_register_mgmt_frame_ind_callback(tHalHandle hal,
sir_mgmt_frame_ind_callback callback);
QDF_STATUS sme_update_nss(tHalHandle h_hal, uint8_t nss);
+void sme_update_user_configured_nss(tHalHandle hal, uint8_t nss);
bool sme_is_any_session_in_connected_state(tHalHandle h_hal);
@@ -1128,4 +1129,13 @@ void sme_set_pdev_ht_vht_ies(tHalHandle hHal, bool enable2x2);
void sme_update_vdev_type_nss(tHalHandle hal, uint8_t max_supp_nss,
uint32_t vdev_type_nss, eCsrBand band);
+void sme_register_p2p_lo_event(tHalHandle hHal, void *context,
+ p2p_lo_callback callback);
+
+QDF_STATUS sme_process_mac_pwr_dbg_cmd(tHalHandle hal, uint32_t session_id,
+ struct sir_mac_pwr_dbg_cmd*
+ dbg_args);
+
+void sme_get_vdev_type_nss(tHalHandle hal, enum tQDF_ADAPTER_MODE dev_mode,
+ uint8_t *nss_2g, uint8_t *nss_5g);
#endif /* #if !defined( __SME_API_H ) */
diff --git a/core/sme/inc/sme_inside.h b/core/sme/inc/sme_inside.h
index 5a6600a7d983..cc859ed379ee 100644
--- a/core/sme/inc/sme_inside.h
+++ b/core/sme/inc/sme_inside.h
@@ -192,6 +192,11 @@ typedef struct tagSmeCmd {
struct s_nss_update_cmd nss_update_cmd;
struct sir_dual_mac_config set_dual_mac_cmd;
struct sir_antenna_mode_param set_antenna_mode_cmd;
+#ifdef WLAN_FEATURE_NAN_DATAPATH
+ struct ndp_initiator_req initiator_req;
+ struct ndp_responder_req responder_req;
+ struct ndp_end_req *data_end_req;
+#endif
} u;
} tSmeCmd;
@@ -230,9 +235,6 @@ QDF_STATUS oem_data_process_oem_data_req_command(tpAniSirGlobal pMac,
tSmeCmd *pCommand);
#endif
-void csr_get_vdev_type_nss(tpAniSirGlobal mac_ctx,
- enum tQDF_ADAPTER_MODE dev_mode,
- uint8_t *nss_2g, uint8_t *nss_5g);
QDF_STATUS csr_process_add_sta_session_command(tpAniSirGlobal pMac,
tSmeCmd *pCommand);
QDF_STATUS csr_process_add_sta_session_rsp(tpAniSirGlobal pMac, uint8_t *pMsg);
diff --git a/core/sme/inc/sme_internal.h b/core/sme/inc/sme_internal.h
index 6414ae8a243e..4da807a26947 100644
--- a/core/sme/inc/sme_internal.h
+++ b/core/sme/inc/sme_internal.h
@@ -93,6 +93,9 @@ typedef enum eSmeCommandType {
e_sme_command_nss_update,
e_sme_command_set_dual_mac_config,
e_sme_command_set_antenna_mode,
+ eSmeCommandNdpInitiatorRequest,
+ eSmeCommandNdpResponderRequest,
+ eSmeCommandNdpDataEndInitiatorRequest,
} eSmeCommandType;
typedef enum eSmeState {
@@ -149,6 +152,7 @@ typedef void (*preferred_network_found_ind_cb)(void *callback_context,
typedef void (*ocb_callback)(void *context, void *response);
typedef void (*sme_set_thermal_level_callback)(void *context, u_int8_t level);
+typedef void (*p2p_lo_callback)(void *context, void *event);
typedef struct tagSmeStruct {
eSmeState state;
@@ -236,6 +240,8 @@ typedef struct tagSmeStruct {
void *saved_scan_cmd;
void (*pbpf_get_offload_cb)(void *context,
struct sir_bpf_get_offload *);
+ p2p_lo_callback p2p_lo_event_callback;
+ void *p2p_lo_event_context;
} tSmeStruct, *tpSmeStruct;
#endif /* #if !defined( __SMEINTERNAL_H ) */
diff --git a/core/sme/inc/sme_nan_datapath.h b/core/sme/inc/sme_nan_datapath.h
index 9b91f0a70f77..e47554ee7aea 100644
--- a/core/sme/inc/sme_nan_datapath.h
+++ b/core/sme/inc/sme_nan_datapath.h
@@ -27,6 +27,162 @@
#ifndef __SME_NAN_DATAPATH_H
#define __SME_NAN_DATAPATH_H
-#endif /* __SME_NAN_DATAPATH_H */
+#include "csr_inside_api.h"
+
+#ifdef WLAN_FEATURE_NAN_DATAPATH
+#include "qdf_types.h"
+#include "sir_api.h"
+#include "ani_global.h"
+#include "sme_inside.h"
+
+/**
+ * struct sir_sme_ndp_initiator_req - sme request struct for ndp initiator req
+ * @mesgType: SME msg type(eWNI_SME_NDP_INITIATOR_REQ)
+ * @mesgLen: lenght of message
+ * @req: actual ndp initiator request
+ *
+ */
+struct sir_sme_ndp_initiator_req {
+ uint16_t msg_type;
+ uint16_t msg_len;
+ struct ndp_initiator_req req;
+};
+
+/**
+ * struct sir_sme_ndp_responder_req - Wraper of responder's response
+ * to ndp create request
+ * @msg_type: SME msg type
+ * @msg_len: Length of msg
+ * @req: responder's response to ndp create request
+ *
+ */
+struct sir_sme_ndp_responder_req {
+ uint16_t msg_type;
+ uint16_t msg_len;
+ struct ndp_responder_req req;
+};
+
+/*
+ * struct sir_sme_ndp_end_req - sme request struct for ndp end req
+ * @msg_type: SME msg type(sir_sme_ndp_initiator_req)
+ * @msg_len: lenght of message
+ * @req: actual ndp initiator request
+ *
+ */
+struct sir_sme_ndp_end_req {
+ uint16_t msg_type;
+ uint16_t msg_len;
+ struct ndp_end_req *req;
+};
+
+/* NaN initiator request handler */
+QDF_STATUS sme_ndp_initiator_req_handler(tHalHandle hal,
+ struct ndp_initiator_req *req_params);
+
+/* NaN responder request handler */
+QDF_STATUS sme_ndp_responder_req_handler(tHalHandle hal,
+ struct ndp_responder_req *req_params);
+
+/* NAN indication response handler */
+QDF_STATUS sme_ndp_end_req_handler(tHalHandle hal, struct ndp_end_req *req);
+
+/* NAN schedule update request handler */
+QDF_STATUS sme_ndp_sched_req_handler(uint32_t session_id,
+ struct ndp_schedule_update_req *req_params);
+/* Function to handle NDP messages from lower layers */
+void sme_ndp_message_processor(tpAniSirGlobal mac_ctx, uint16_t msg_type,
+ void *msg);
+/* Start NDI BSS */
+QDF_STATUS csr_roam_start_ndi(tpAniSirGlobal mac_ctx, uint32_t session_id,
+ tCsrRoamProfile *profile);
+
+void csr_roam_save_ndi_connected_info(tpAniSirGlobal mac_ctx,
+ uint32_t session_id,
+ tCsrRoamProfile *roam_profile,
+ tSirBssDescription *bss_desc);
+
+void csr_roam_update_ndp_return_params(tpAniSirGlobal mac_ctx,
+ uint32_t result,
+ uint32_t *roam_status,
+ uint32_t *roam_result,
+ struct tagCsrRoamInfo *roam_info);
+QDF_STATUS csr_process_ndp_initiator_request(tpAniSirGlobal mac_ctx,
+ tSmeCmd *cmd);
+QDF_STATUS csr_process_ndp_data_end_request(tpAniSirGlobal mac_ctx,
+ tSmeCmd *cmd);
+
+void sme_ndp_msg_processor(tpAniSirGlobal mac_ctx, cds_msg_t *msg);
+
+QDF_STATUS csr_process_ndp_responder_request(tpAniSirGlobal mac_ctx,
+ tSmeCmd *cmd);
+
+void csr_release_ndp_initiator_req(tpAniSirGlobal mac_ctx, tSmeCmd *cmd);
+void csr_release_ndp_responder_req(tpAniSirGlobal mac_ctx, tSmeCmd *cmd);
+void csr_release_ndp_data_end_req(tpAniSirGlobal mac_ctx, tSmeCmd *cmd);
+
+#else
+
+/* Start NDI BSS */
+static inline QDF_STATUS csr_roam_start_ndi(tpAniSirGlobal mac_ctx,
+ uint32_t session_id,
+ tCsrRoamProfile *profile)
+{
+ return QDF_STATUS_SUCCESS;
+}
+
+static inline void csr_roam_save_ndi_connected_info(tpAniSirGlobal mac_ctx,
+ uint32_t session_id,
+ tCsrRoamProfile *roam_profile,
+ tSirBssDescription *bss_desc)
+{
+}
+
+static inline void csr_roam_update_ndp_return_params(tpAniSirGlobal mac_ctx,
+ uint32_t result,
+ uint32_t *roam_status,
+ uint32_t *roam_result,
+ struct tagCsrRoamInfo *roam_info)
+{
+}
+
+/* NaN indication response handler */
+QDF_STATUS sme_ndp_end_req_handler(uint32_t session_id,
+ struct ndp_end_req *req_params);
+
+/* NaN schedule update request handler */
+QDF_STATUS sme_ndp_sched_req_handler(uint32_t session_id,
+ struct ndp_schedule_update_req *req_params);
+
+static inline QDF_STATUS csr_process_ndp_initiator_request(
+ tpAniSirGlobal mac_ctx, tSmeCmd *cmd)
+{
+ return QDF_STATUS_SUCCESS;
+}
+
+static inline void sme_ndp_msg_processor(tpAniSirGlobal mac_ctx, cds_msg_t *msg)
+{
+}
+
+static inline QDF_STATUS csr_process_ndp_responder_request(
+ tpAniSirGlobal mac_ctx, tSmeCmd *cmd)
+{
+ return QDF_STATUS_SUCCESS;
+}
+
+static inline QDF_STATUS csr_process_ndp_data_end_request(
+ tpAniSirGlobal mac_ctx, tSmeCmd *cmd)
+{
+ return QDF_STATUS_SUCCESS;
+}
+
+static inline void csr_release_ndp_initiator_req(tpAniSirGlobal mac_ctx,
+ tSmeCmd *cmd) {}
+static inline void csr_release_ndp_responder_req(tpAniSirGlobal mac_ctx,
+ tSmeCmd *cmd) {}
+static inline void csr_release_ndp_data_end_req(tpAniSirGlobal mac_ctx,
+ tSmeCmd *cmd) {}
+
+#endif /* WLAN_FEATURE_NAN_DATAPATH */
+#endif /* __SME_NAN_DATAPATH_H */
diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c
index e8abaa9ed318..3674fb1f62de 100644
--- a/core/sme/src/common/sme_api.c
+++ b/core/sme/src/common/sme_api.c
@@ -59,6 +59,7 @@
#include "sme_power_save_api.h"
#include "wma.h"
#include "sch_api.h"
+#include "sme_nan_datapath.h"
extern tSirRetStatus u_mac_post_ctrl_msg(void *pSirGlobal, tSirMbMsg *pMb);
@@ -956,6 +957,33 @@ sme_process_cmd:
csr_ll_unlock(&pMac->sme.smeCmdActiveList);
csr_process_add_sta_session_command(pMac, pCommand);
break;
+ case eSmeCommandNdpInitiatorRequest:
+ csr_ll_unlock(&pMac->sme.smeCmdActiveList);
+ if (csr_process_ndp_initiator_request(pMac, pCommand) !=
+ QDF_STATUS_SUCCESS)
+ if (csr_ll_remove_entry(
+ &pMac->sme.smeCmdActiveList,
+ &pCommand->Link, LL_ACCESS_LOCK))
+ csr_release_command(pMac, pCommand);
+ break;
+ case eSmeCommandNdpResponderRequest:
+ csr_ll_unlock(&pMac->sme.smeCmdActiveList);
+ status = csr_process_ndp_responder_request(pMac, pCommand);
+ if (status != QDF_STATUS_SUCCESS) {
+ if (csr_ll_remove_entry(&pMac->sme.smeCmdActiveList,
+ &pCommand->Link, LL_ACCESS_LOCK))
+ csr_release_command(pMac, pCommand);
+ }
+ break;
+ case eSmeCommandNdpDataEndInitiatorRequest:
+ csr_ll_unlock(&pMac->sme.smeCmdActiveList);
+ status = csr_process_ndp_data_end_request(pMac, pCommand);
+ if (status != QDF_STATUS_SUCCESS) {
+ if (csr_ll_remove_entry(&pMac->sme.smeCmdActiveList,
+ &pCommand->Link, LL_ACCESS_LOCK))
+ csr_release_command(pMac, pCommand);
+ }
+ break;
case eSmeCommandDelStaSession:
csr_ll_unlock(&pMac->sme.smeCmdActiveList);
csr_process_del_sta_session_command(pMac, pCommand);
@@ -2985,6 +3013,16 @@ QDF_STATUS sme_process_msg(tHalHandle hHal, cds_msg_t *pMsg)
pMsg->type);
}
break;
+ case eWNI_SME_NDP_CONFIRM_IND:
+ case eWNI_SME_NDP_NEW_PEER_IND:
+ case eWNI_SME_NDP_INITIATOR_RSP:
+ case eWNI_SME_NDP_INDICATION:
+ case eWNI_SME_NDP_RESPONDER_RSP:
+ case eWNI_SME_NDP_END_RSP:
+ case eWNI_SME_NDP_END_IND:
+ case eWNI_SME_NDP_PEER_DEPARTED_IND:
+ sme_ndp_msg_processor(pMac, pMsg);
+ break;
default:
if ((pMsg->type >= eWNI_SME_MSG_TYPES_BEGIN)
@@ -4785,9 +4823,11 @@ void sme_register_ftm_msg_processor(tHalHandle hal,
tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal);
if (mac_ctx == NULL) {
- sms_log(mac_ctx, LOGE, FL("mac_ctx is NULL"));
+ QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
+ FL("mac ctx is NULL"));
return;
}
+
mac_ctx->ftm_msg_processor_callback = callback;
return;
}
@@ -10055,6 +10095,7 @@ QDF_STATUS sme_update_tdls_peer_state(tHalHandle hHal,
tTdlsPeerCapParams *peer_cap = NULL;
cds_msg_t cds_message;
uint8_t num;
+ uint8_t peer_chan_len;
uint8_t chanId;
uint8_t i;
@@ -10103,9 +10144,7 @@ QDF_STATUS sme_update_tdls_peer_state(tHalHandle hHal,
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
FL("invalid peer state param (%d)"),
peerStateParams->peerState);
- qdf_mem_free(pTdlsPeerStateParams);
- sme_release_global_lock(&pMac->sme);
- return QDF_STATUS_E_FAILURE;
+ goto error_return;
}
peer_cap = &(pTdlsPeerStateParams->peerCap);
peer_cap->isPeerResponder =
@@ -10124,22 +10163,30 @@ QDF_STATUS sme_update_tdls_peer_state(tHalHandle hHal,
peerStateParams->peerCap.selfCurrOperClass;
num = 0;
- for (i = 0; i < peerStateParams->peerCap.peerChanLen; i++) {
- chanId = peerStateParams->peerCap.peerChan[i];
- if (!csr_roam_is_channel_valid(pMac, chanId))
- continue;
- peer_cap->peerChan[num].chanId = chanId;
- peer_cap->peerChan[num].pwr =
+ peer_chan_len = peerStateParams->peerCap.peerChanLen;
+
+ if (peer_chan_len >= 0 &&
+ peer_chan_len <= SME_TDLS_MAX_SUPP_CHANNELS) {
+ for (i = 0; i < peerStateParams->peerCap.peerChanLen; i++) {
+ chanId = peerStateParams->peerCap.peerChan[i];
+ if (csr_roam_is_channel_valid(pMac, chanId) &&
+ !(cds_get_channel_state(chanId) ==
+ CHANNEL_STATE_DFS) &&
+ !cds_is_dsrc_channel(cds_chan_to_freq(chanId))) {
+ peer_cap->peerChan[num].chanId = chanId;
+ peer_cap->peerChan[num].pwr =
csr_get_cfg_max_tx_power(pMac, chanId);
-
- if (cds_get_channel_state(chanId) == CHANNEL_STATE_DFS)
- peer_cap->peerChan[num].dfsSet =
- true;
- else
- peer_cap->peerChan[num].dfsSet =
- false;
- num++;
+ peer_cap->peerChan[num].dfsSet = false;
+ num++;
+ }
+ }
+ } else {
+ QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
+ FL("invalid peer channel len (%d)"),
+ peer_chan_len);
+ goto error_return;
}
+
peer_cap->peerChanLen = num;
peer_cap->peerOperClassLen =
peerStateParams->peerCap.peerOperClassLen;
@@ -10161,9 +10208,17 @@ QDF_STATUS sme_update_tdls_peer_state(tHalHandle hHal,
qdf_status = cds_mq_post_message(CDS_MQ_ID_WMA, &cds_message);
if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
- qdf_mem_free(pTdlsPeerStateParams);
- status = QDF_STATUS_E_FAILURE;
+ QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
+ FL("cds_mq_post_message failed "));
+ goto error_return;
+ } else {
+ goto success_return;
}
+
+error_return:
+ status = QDF_STATUS_E_FAILURE;
+ qdf_mem_free(pTdlsPeerStateParams);
+success_return:
sme_release_global_lock(&pMac->sme);
return status;
}
@@ -11697,8 +11752,9 @@ int16_t sme_get_ht_config(tHalHandle hHal, uint8_t session_id, uint16_t ht_capab
case WNI_CFG_HT_CAP_INFO_RX_STBC:
return pSession->htConfig.ht_rx_stbc;
case WNI_CFG_HT_CAP_INFO_SHORT_GI_20MHZ:
+ return pSession->htConfig.ht_sgi20;
case WNI_CFG_HT_CAP_INFO_SHORT_GI_40MHZ:
- return pSession->htConfig.ht_sgi;
+ return pSession->htConfig.ht_sgi40;
default:
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
"invalid ht capability");
@@ -11735,8 +11791,10 @@ int sme_update_ht_config(tHalHandle hHal, uint8_t sessionId, uint16_t htCapab,
pSession->htConfig.ht_rx_stbc = value;
break;
case WNI_CFG_HT_CAP_INFO_SHORT_GI_20MHZ:
+ pSession->htConfig.ht_sgi20 = value;
+ break;
case WNI_CFG_HT_CAP_INFO_SHORT_GI_40MHZ:
- pSession->htConfig.ht_sgi = value;
+ pSession->htConfig.ht_sgi40 = value;
break;
}
@@ -13176,13 +13234,13 @@ QDF_STATUS sme_get_cached_results(tHalHandle hHal,
/**
* sme_set_epno_list() - set epno network list
- * @hHal: global hal handle
+ * @hal: global hal handle
* @input: request message
*
* This function constructs the cds message and fill in message type,
* bodyptr with %input and posts it to WDA queue.
*
- * Return: eHalStatus enumeration
+ * Return: QDF_STATUS enumeration
*/
QDF_STATUS sme_set_epno_list(tHalHandle hal,
struct wifi_epno_params *input)
@@ -13251,7 +13309,7 @@ QDF_STATUS sme_set_epno_list(tHalHandle hal,
* This function constructs the cds message and fill in message type,
* bodyptr with @input and posts it to WDA queue.
*
- * Return: eHalStatus enumeration
+ * Return: QDF_STATUS enumeration
*/
QDF_STATUS sme_set_passpoint_list(tHalHandle hal,
struct wifi_passpoint_req *input)
@@ -13318,7 +13376,7 @@ QDF_STATUS sme_set_passpoint_list(tHalHandle hal,
* @hHal: global hal handle
* @input: request message
*
- * Return: eHalStatus enumeration
+ * Return: QDF_STATUS enumeration
*/
QDF_STATUS sme_reset_passpoint_list(tHalHandle hal,
struct wifi_passpoint_req *input)
@@ -13368,7 +13426,7 @@ QDF_STATUS sme_reset_passpoint_list(tHalHandle hal,
* @hal: SME handle
* @request: set ssid hotlist request
*
- * Return: eHalStatus
+ * Return: QDF_STATUS
*/
QDF_STATUS
sme_set_ssid_hotlist(tHalHandle hal,
@@ -14260,7 +14318,7 @@ bool sme_neighbor_middle_of_roaming(tHalHandle hHal, uint8_t sessionId)
* This function is used to send the command that will
* be used to flush the logs in the firmware
*
- * Return: eHalStatus
+ * Return: QDF_STATUS
*/
QDF_STATUS sme_send_flush_logs_cmd_to_fw(tpAniSirGlobal mac)
{
@@ -14457,6 +14515,20 @@ QDF_STATUS sme_update_nss(tHalHandle h_hal, uint8_t nss)
}
/**
+ * sme_update_user_configured_nss() - sets the nss based on user request
+ * @hal: Pointer to HAL
+ * @nss: number of streams
+ *
+ * Return: None
+ */
+void sme_update_user_configured_nss(tHalHandle hal, uint8_t nss)
+{
+ tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal);
+
+ mac_ctx->user_configured_nss = nss;
+}
+
+/**
* sme_set_rssi_threshold_breached_cb() - set rssi threshold breached callback
* @hal: global hal handle
* @cb: callback function pointer
@@ -14675,8 +14747,8 @@ QDF_STATUS sme_pdev_set_pcl(tHalHandle hal,
status = sme_acquire_global_lock(&mac->sme);
if (status != QDF_STATUS_SUCCESS) {
sms_log(mac, LOGE,
- FL("sme_AcquireGlobalLock failed!(status=%d)"),
- status);
+ FL("sme_acquire_global_lock failed!(status=%d)"),
+ status);
qdf_mem_free(req_msg);
return status;
}
@@ -14687,7 +14759,7 @@ QDF_STATUS sme_pdev_set_pcl(tHalHandle hal,
status = cds_mq_post_message(CDS_MQ_ID_WMA, &cds_message);
if (!QDF_IS_STATUS_SUCCESS(status)) {
sms_log(mac, LOGE,
- FL("vos_mq_post_message failed!(err=%d)"),
+ FL("cds_mq_post_message failed!(err=%d)"),
status);
qdf_mem_free(req_msg);
status = QDF_STATUS_E_FAILURE;
@@ -15723,3 +15795,91 @@ void sme_update_vdev_type_nss(tHalHandle hal, uint8_t max_supp_nss,
vdev_nss->p2p_go, vdev_nss->p2p_dev, vdev_nss->ibss,
vdev_nss->tdls, vdev_nss->ocb);
}
+
+/**
+ * sme_register_p2p_lo_event() - Register for the p2p lo event
+ * @hHal: reference to the HAL
+ * @context: the context of the call
+ * @callback: the callback to hdd
+ *
+ * This function registers the callback function for P2P listen
+ * offload stop event.
+ *
+ * Return: none
+ */
+void sme_register_p2p_lo_event(tHalHandle hHal, void *context,
+ p2p_lo_callback callback)
+{
+ tpAniSirGlobal pMac = PMAC_STRUCT(hHal);
+ QDF_STATUS status = QDF_STATUS_E_FAILURE;
+
+ status = sme_acquire_global_lock(&pMac->sme);
+ pMac->sme.p2p_lo_event_callback = callback;
+ pMac->sme.p2p_lo_event_context = context;
+ sme_release_global_lock(&pMac->sme);
+}
+
+/**
+ * sme_process_mac_pwr_dbg_cmd() - enable mac pwr debugging
+ * @hal: The handle returned by macOpen
+ * @session_id: session id
+ * @dbg_args: args for mac pwr debug command
+ * Return: Return QDF_STATUS, otherwise appropriate failure code
+ */
+QDF_STATUS sme_process_mac_pwr_dbg_cmd(tHalHandle hal, uint32_t session_id,
+ struct sir_mac_pwr_dbg_cmd*
+ dbg_args)
+{
+ cds_msg_t message;
+ tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal);
+ struct sir_mac_pwr_dbg_cmd *req;
+ int i;
+
+ if (!CSR_IS_SESSION_VALID(mac_ctx, session_id)) {
+ sms_log(mac_ctx, LOGE,
+ "CSR session not valid: %d",
+ session_id);
+ return QDF_STATUS_E_FAILURE;
+ }
+
+ req = qdf_mem_malloc(sizeof(*req));
+ if (NULL == req) {
+ QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
+ "%s: fail to alloc mac_pwr_dbg_args", __func__);
+ return QDF_STATUS_E_FAILURE;
+ }
+ req->module_id = dbg_args->module_id;
+ req->pdev_id = dbg_args->pdev_id;
+ req->num_args = dbg_args->num_args;
+ for (i = 0; i < req->num_args; i++)
+ req->args[i] = dbg_args->args[i];
+
+ message.type = SIR_HAL_POWER_DBG_CMD;
+ message.bodyptr = req;
+
+ if (!QDF_IS_STATUS_SUCCESS(cds_mq_post_message
+ (QDF_MODULE_ID_WMA, &message))) {
+ QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
+ "%s: Not able to post msg to WDA!",
+ __func__);
+ qdf_mem_free(req);
+ }
+ return QDF_STATUS_SUCCESS;
+}
+/**
+ * sme_get_vdev_type_nss() - gets the nss per vdev type
+ * @hal: Pointer to HAL
+ * @dev_mode: connection type.
+ * @nss2g: Pointer to the 2G Nss parameter.
+ * @nss5g: Pointer to the 5G Nss parameter.
+ *
+ * Fills the 2G and 5G Nss values based on connection type.
+ *
+ * Return: None
+ */
+void sme_get_vdev_type_nss(tHalHandle hal, enum tQDF_ADAPTER_MODE dev_mode,
+ uint8_t *nss_2g, uint8_t *nss_5g)
+{
+ tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal);
+ csr_get_vdev_type_nss(mac_ctx, dev_mode, nss_2g, nss_5g);
+}
diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c
index 4de79eb91df9..ae83a030c6b0 100644
--- a/core/sme/src/csr/csr_api_roam.c
+++ b/core/sme/src/csr/csr_api_roam.c
@@ -54,6 +54,7 @@
#include "sme_power_save_api.h"
#include "wma.h"
#include "cds_concurrency.h"
+#include "sme_nan_datapath.h"
#define MAX_PWR_FCC_CHAN_12 8
#define MAX_PWR_FCC_CHAN_13 2
@@ -177,11 +178,6 @@ static void csr_roam_update_connected_profile_from_new_bss(tpAniSirGlobal pMac,
uint32_t sessionId,
tSirSmeNewBssInfo *
pNewBss);
-static void csr_roam_prepare_bss_params(tpAniSirGlobal pMac, uint32_t sessionId,
- tCsrRoamProfile *pProfile,
- tSirBssDescription *pBssDesc,
- tBssConfigParam *pBssConfig,
- tDot11fBeaconIEs *pIes);
static ePhyChanBondState csr_get_cb_mode_from_ies(tpAniSirGlobal pMac,
uint8_t primaryChn,
tDot11fBeaconIEs *pIes);
@@ -1212,6 +1208,18 @@ void csr_abort_command(tpAniSirGlobal pMac, tSmeCmd *pCommand, bool fStopping)
csr_release_command_set_key(pMac, pCommand);
break;
+ case eSmeCommandNdpInitiatorRequest:
+ csr_release_ndp_initiator_req(pMac, pCommand);
+ break;
+
+ case eSmeCommandNdpResponderRequest:
+ csr_release_ndp_responder_req(pMac, pCommand);
+ break;
+
+ case eSmeCommandNdpDataEndInitiatorRequest:
+ csr_release_ndp_data_end_req(pMac, pCommand);
+ break;
+
default:
sms_log(pMac, LOGW, " CSR abort standard command %d",
pCommand->command);
@@ -2386,7 +2394,6 @@ QDF_STATUS csr_change_default_config_param(tpAniSirGlobal pMac,
pParam->is_ps_enabled;
pMac->roam.configParam.ignore_peer_ht_opmode =
pParam->ignore_peer_ht_opmode;
- pMac->policy_manager_enabled = pParam->policy_manager_enabled;
pMac->fine_time_meas_cap = pParam->fine_time_meas_cap;
pMac->dual_mac_feature_disable =
pParam->dual_mac_feature_disable;
@@ -2578,7 +2585,6 @@ QDF_STATUS csr_get_config_param(tpAniSirGlobal pMac, tCsrConfigParam *pParam)
pParam->pnoOffload = pMac->pnoOffload;
pParam->f_prefer_non_dfs_on_radar =
pMac->f_prefer_non_dfs_on_radar;
- pParam->policy_manager_enabled = pMac->policy_manager_enabled;
pParam->fine_time_meas_cap = pMac->fine_time_meas_cap;
pParam->dual_mac_feature_disable =
pMac->dual_mac_feature_disable;
@@ -3862,7 +3868,7 @@ QDF_STATUS csr_roam_prepare_bss_config(tpAniSirGlobal pMac,
return QDF_STATUS_SUCCESS;
}
-static QDF_STATUS csr_roam_prepare_bss_config_from_profile(tpAniSirGlobal pMac,
+QDF_STATUS csr_roam_prepare_bss_config_from_profile(tpAniSirGlobal pMac,
tCsrRoamProfile *pProfile,
tBssConfigParam *
pBssConfig,
@@ -5023,15 +5029,22 @@ static void csr_roam_join_handle_profile(tpAniSirGlobal mac_ctx,
uint8_t acm_mask = 0;
#endif
QDF_STATUS status;
- tCsrRoamSession *session = CSR_GET_SESSION(mac_ctx, session_id);
+ tCsrRoamSession *session;
tCsrRoamProfile *profile = &cmd->u.roamCmd.roamProfile;
tDot11fBeaconIEs *ies_local = NULL;
+
+ if (!CSR_IS_SESSION_VALID(mac_ctx, session_id)) {
+ sms_log(mac_ctx, LOGE, FL("Invalid session id %d"), session_id);
+ return;
+ }
+ session = CSR_GET_SESSION(mac_ctx, session_id);
+
/*
* We have something to roam, tell HDD when it is infra.
* For IBSS, the indication goes back to HDD via eCSR_ROAM_IBSS_IND
*/
- if (CSR_IS_INFRASTRUCTURE(profile)) {
- if (roam_info_ptr && session->bRefAssocStartCnt) {
+ if (CSR_IS_INFRASTRUCTURE(profile) && roam_info_ptr) {
+ if (session->bRefAssocStartCnt) {
session->bRefAssocStartCnt--;
roam_info_ptr->pProfile = profile;
/*
@@ -5162,6 +5175,13 @@ static void csr_roam_join_handle_profile(tpAniSirGlobal mac_ctx,
*roam_state = eCsrContinueRoaming;
else
*roam_state = eCsrStopRoaming;
+ } else if (CSR_IS_NDI(profile)) {
+ csr_roam_assign_default_param(mac_ctx, cmd);
+ status = csr_roam_start_ndi(mac_ctx, session_id, profile);
+ if (QDF_IS_STATUS_SUCCESS(status))
+ *roam_state = eCsrContinueRoaming;
+ else
+ *roam_state = eCsrStopRoaming;
} else {
/* Nothing we can do */
sms_log(mac_ctx, LOGW, FL("cannot continue without BSS list"));
@@ -6049,10 +6069,16 @@ static void csr_roam_process_results_default(tpAniSirGlobal mac_ctx,
tSmeCmd *cmd, void *context, eCsrRoamCompleteResult res)
{
uint32_t session_id = cmd->sessionId;
- tCsrRoamSession *session = CSR_GET_SESSION(mac_ctx, session_id);
+ tCsrRoamSession *session;
tCsrRoamInfo roam_info;
QDF_STATUS status;
+ if (!CSR_IS_SESSION_VALID(mac_ctx, session_id)) {
+ sms_log(mac_ctx, LOGE, FL("Invalid session id %d"), session_id);
+ return;
+ }
+ session = CSR_GET_SESSION(mac_ctx, session_id);
+
sms_log(mac_ctx, LOGW, FL("receives no association indication"));
sms_log(mac_ctx, LOG1, FL("Assoc ref count %d"),
session->bRefAssocStartCnt);
@@ -6249,7 +6275,7 @@ static void csr_roam_process_start_bss_success(tpAniSirGlobal mac_ctx,
{
uint32_t session_id = cmd->sessionId;
tCsrRoamProfile *profile = &cmd->u.roamCmd.roamProfile;
- tCsrRoamSession *session = CSR_GET_SESSION(mac_ctx, session_id);
+ tCsrRoamSession *session;
tSirBssDescription *bss_desc = NULL;
tCsrRoamInfo roam_info;
tSirSmeStartBssRsp *start_bss_rsp = NULL;
@@ -6266,6 +6292,12 @@ static void csr_roam_process_start_bss_success(tpAniSirGlobal mac_ctx,
tCsrRoamHTProfile *dst_profile = NULL;
#endif
+ if (!CSR_IS_SESSION_VALID(mac_ctx, session_id)) {
+ sms_log(mac_ctx, LOGE, FL("Invalid session id %d"), session_id);
+ return;
+ }
+ session = CSR_GET_SESSION(mac_ctx, session_id);
+
/*
* on the StartBss Response, LIM is returning the Bss Description that
* we are beaconing. Add this Bss Description to our scan results and
@@ -6284,11 +6316,23 @@ static void csr_roam_process_start_bss_success(tpAniSirGlobal mac_ctx,
else if (CSR_IS_INFRA_AP(profile))
session->connectState =
eCSR_ASSOC_STATE_TYPE_INFRA_DISCONNECTED;
+ else if (CSR_IS_NDI(profile))
+ session->connectState = eCSR_CONNECT_STATE_TYPE_NDI_STARTED;
else
session->connectState = eCSR_ASSOC_STATE_TYPE_WDS_DISCONNECTED;
+
+ bss_desc = &start_bss_rsp->bssDescription;
+ if (CSR_IS_NDI(profile)) {
+ csr_roam_state_change(mac_ctx, eCSR_ROAMING_STATE_JOINED,
+ session_id);
+ csr_roam_save_ndi_connected_info(mac_ctx, session_id, profile,
+ bss_desc);
+ roam_info.u.pConnectedProfile = &session->connectedProfile;
+ qdf_mem_copy(&roam_info.bssid, &bss_desc->bssId,
+ sizeof(struct qdf_mac_addr));
+ }
csr_roam_state_change(mac_ctx, eCSR_ROAMING_STATE_JOINED,
session_id);
- bss_desc = &start_bss_rsp->bssDescription;
if (!QDF_IS_STATUS_SUCCESS
(csr_get_parsed_bss_description_ies(mac_ctx, bss_desc,
&ies_ptr))) {
@@ -6308,12 +6352,10 @@ static void csr_roam_process_start_bss_success(tpAniSirGlobal mac_ctx,
csr_roam_save_connected_bss_desc(mac_ctx, session_id, bss_desc);
csr_roam_free_connect_profile(&session->connectedProfile);
csr_roam_free_connected_info(mac_ctx, &session->connectedInfo);
- if (bss_desc) {
- csr_roam_save_connected_infomation(mac_ctx, session_id,
- profile, bss_desc, ies_ptr);
- qdf_mem_copy(&roam_info.bssid, &bss_desc->bssId,
+ csr_roam_save_connected_infomation(mac_ctx, session_id,
+ profile, bss_desc, ies_ptr);
+ qdf_mem_copy(&roam_info.bssid, &bss_desc->bssId,
sizeof(struct qdf_mac_addr));
- }
/* We are done with the IEs so free it */
qdf_mem_free(ies_ptr);
#ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR
@@ -6383,19 +6425,26 @@ static void csr_roam_process_start_bss_success(tpAniSirGlobal mac_ctx,
roam_status = eCSR_ROAM_INFRA_IND;
roam_result = eCSR_ROAM_RESULT_INFRA_STARTED;
}
+ if (CSR_IS_NDI(profile)) {
+ csr_roam_update_ndp_return_params(mac_ctx,
+ eCsrStartBssSuccess,
+ &roam_status,
+ &roam_result,
+ &roam_info);
+ }
/*
* Only tell upper layer is we start the BSS because Vista
* doesn't like multiple connection indications. If we don't
* start the BSS ourself, handler of eSIR_SME_JOINED_NEW_BSS
* will trigger the connection start indication in Vista
*/
- qdf_mem_set(&roam_info, sizeof(tCsrRoamInfo), 0);
roam_info.statusCode = session->joinFailStatusCode.statusCode;
roam_info.reasonCode = session->joinFailStatusCode.reasonCode;
/* We start the IBSS (didn't find any matched IBSS out there) */
roam_info.pBssDesc = bss_desc;
roam_info.staId = (uint8_t) start_bss_rsp->staId;
- qdf_mem_copy(roam_info.bssid.bytes, bss_desc->bssId,
+ if (bss_desc)
+ qdf_mem_copy(roam_info.bssid.bytes, bss_desc->bssId,
sizeof(struct qdf_mac_addr));
if (!IS_FEATURE_SUPPORTED_BY_FW(SLM_SESSIONIZATION) &&
(csr_is_concurrent_session_running(mac_ctx))) {
@@ -6435,7 +6484,7 @@ static void csr_roam_process_join_res(tpAniSirGlobal mac_ctx,
uint8_t acm_mask = 0; /* HDD needs ACM mask in assoc rsp callback */
uint32_t session_id = cmd->sessionId;
tCsrRoamProfile *profile = &cmd->u.roamCmd.roamProfile;
- tCsrRoamSession *session = CSR_GET_SESSION(mac_ctx, session_id);
+ tCsrRoamSession *session;
tSirBssDescription *bss_desc = NULL;
tCsrScanResult *scan_res = NULL;
sme_qos_csr_event_indType ind_qos;
@@ -6450,6 +6499,12 @@ static void csr_roam_process_join_res(tpAniSirGlobal mac_ctx,
tSirSmeJoinRsp *join_rsp = (tSirSmeJoinRsp *) context;
uint32_t len;
+ if (!CSR_IS_SESSION_VALID(mac_ctx, session_id)) {
+ sms_log(mac_ctx, LOGE, FL("Invalid session id %d"), session_id);
+ return;
+ }
+ session = CSR_GET_SESSION(mac_ctx, session_id);
+
conn_profile = &session->connectedProfile;
if (eCsrReassocSuccess == res)
ind_qos = SME_QOS_CSR_REASSOC_COMPLETE;
@@ -6823,6 +6878,7 @@ static bool csr_roam_process_results(tpAniSirGlobal mac_ctx, tSmeCmd *cmd,
eRoamCmdStatus roam_status;
eCsrRoamResult roam_result;
host_log_ibss_pkt_type *ibss_log;
+ tSirSmeStartBssRsp *start_bss_rsp = NULL;
if (!session) {
sms_log(mac_ctx, LOGE, FL("session %d not found "), session_id);
@@ -6846,18 +6902,25 @@ static bool csr_roam_process_results(tpAniSirGlobal mac_ctx, tSmeCmd *cmd,
WLAN_HOST_DIAG_LOG_REPORT(ibss_log);
}
#endif
+ start_bss_rsp = (tSirSmeStartBssRsp *)context;
+ qdf_mem_set(&roam_info, sizeof(roam_info), 0);
roam_status = eCSR_ROAM_IBSS_IND;
roam_result = eCSR_ROAM_RESULT_IBSS_STARTED;
if (CSR_IS_INFRA_AP(profile)) {
roam_status = eCSR_ROAM_INFRA_IND;
roam_result = eCSR_ROAM_RESULT_INFRA_START_FAILED;
}
+ if (CSR_IS_NDI(profile)) {
+ csr_roam_update_ndp_return_params(mac_ctx,
+ eCsrStartBssFailure,
+ &roam_status, &roam_result, &roam_info);
+ }
+
if (context) {
bss_desc = (tSirBssDescription *) context;
} else {
bss_desc = NULL;
}
- qdf_mem_set(&roam_info, sizeof(tCsrRoamInfo), 0);
roam_info.pBssDesc = bss_desc;
csr_roam_call_callback(mac_ctx, session_id, &roam_info,
cmd->u.roamCmd.roamId, roam_status,
@@ -6938,6 +7001,24 @@ static bool csr_roam_process_results(tpAniSirGlobal mac_ctx, tSmeCmd *cmd,
SME_QOS_CSR_REASSOC_FAILURE, NULL);
#endif
break;
+ case eCsrStopBssSuccess:
+ if (CSR_IS_NDI(profile)) {
+ csr_roam_update_ndp_return_params(mac_ctx, res,
+ &roam_status, &roam_result, &roam_info);
+ csr_roam_call_callback(mac_ctx, session_id, &roam_info,
+ cmd->u.roamCmd.roamId,
+ roam_status, roam_result);
+ }
+ break;
+ case eCsrStopBssFailure:
+ if (CSR_IS_NDI(profile)) {
+ csr_roam_update_ndp_return_params(mac_ctx, res,
+ &roam_status, &roam_result, &roam_info);
+ csr_roam_call_callback(mac_ctx, session_id, &roam_info,
+ cmd->u.roamCmd.roamId,
+ roam_status, roam_result);
+ }
+ break;
case eCsrJoinFailure:
case eCsrNothingToJoin:
case eCsrJoinFailureDueToConcurrency:
@@ -7504,9 +7585,8 @@ QDF_STATUS csr_roam_connect(tpAniSirGlobal pMac, uint32_t sessionId,
FL("******* csr_scan_get_result Status ****** %d"), status);
if (QDF_IS_STATUS_SUCCESS(status)) {
/* check if set hw mode needs to be done */
- if ((pMac->policy_manager_enabled) &&
- ((pScanFilter->csrPersona == QDF_STA_MODE) ||
- (pScanFilter->csrPersona == QDF_P2P_CLIENT_MODE))) {
+ if ((pScanFilter->csrPersona == QDF_STA_MODE) ||
+ (pScanFilter->csrPersona == QDF_P2P_CLIENT_MODE)) {
csr_get_bssdescr_from_scan_handle(hBSSList,
&first_ap_profile);
status = cds_handle_conc_multiport(sessionId,
@@ -7537,13 +7617,14 @@ QDF_STATUS csr_roam_connect(tpAniSirGlobal pMac, uint32_t sessionId,
}
} else if (NULL != pProfile) {
/* Check whether it is for start ibss */
- if (CSR_IS_START_IBSS(pProfile)) {
+ if (CSR_IS_START_IBSS(pProfile) ||
+ CSR_IS_NDI(pProfile)) {
status = csr_roam_issue_connect(pMac, sessionId,
pProfile, NULL, eCsrHddIssued,
roamId, false, false);
if (!QDF_IS_STATUS_SUCCESS(status)) {
sms_log(pMac, LOGE,
- FL("CSR failed to issue startIBSS cmd with status = 0x%08X"),
+ FL("Failed with status = 0x%08X"),
status);
fCallCallback = true;
}
@@ -7949,9 +8030,12 @@ QDF_STATUS csr_roam_issue_disassociate_cmd(tpAniSirGlobal pMac, uint32_t session
pCommand->u.roamCmd.reason =
eSIR_MAC_DISASSOC_LEAVING_BSS_REASON;
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_INFO,
- FL
- ("SME convert to internal reason code eCsrStaHasLeft"));
+ FL("SME convert to internal reason code eCsrStaHasLeft"));
break;
+ case eCSR_DISCONNECT_REASON_NDI_DELETE:
+ pCommand->u.roamCmd.roamReason = eCsrStopBss;
+ pCommand->u.roamCmd.roamProfile.BSSType =
+ eCSR_BSS_TYPE_NDI;
default:
break;
}
@@ -8013,7 +8097,8 @@ QDF_STATUS csr_roam_disconnect_internal(tpAniSirGlobal pMac, uint32_t sessionId,
/* Only issue disconnect when necessary */
if (csr_is_conn_state_connected(pMac, sessionId)
|| csr_is_bss_type_ibss(pSession->connectedProfile.BSSType)
- || csr_is_roam_command_waiting_for_session(pMac, sessionId)) {
+ || csr_is_roam_command_waiting_for_session(pMac, sessionId)
+ || CSR_IS_CONN_NDI(&pSession->connectedProfile)) {
sms_log(pMac, LOG2, FL("called"));
status = csr_roam_issue_disassociate_cmd(pMac, sessionId,
reason);
@@ -8604,7 +8689,8 @@ csr_roaming_state_config_cnf_processor(tpAniSirGlobal mac_ctx,
bss_desc = &scan_result->Result.BssDescriptor;
}
if (csr_is_bss_type_ibss(cmd->u.roamCmd.roamProfile.BSSType)
- || CSR_IS_INFRA_AP(&cmd->u.roamCmd.roamProfile)) {
+ || CSR_IS_INFRA_AP(&cmd->u.roamCmd.roamProfile)
+ || CSR_IS_NDI(&cmd->u.roamCmd.roamProfile)) {
if (!QDF_IS_STATUS_SUCCESS(csr_roam_issue_start_bss(mac_ctx,
session_id, &session->bssParams,
&cmd->u.roamCmd.roamProfile,
@@ -8809,6 +8895,8 @@ static void csr_roam_roaming_state_reassoc_rsp_processor(tpAniSirGlobal pMac,
static void csr_roam_roaming_state_stop_bss_rsp_processor(tpAniSirGlobal pMac,
tSirSmeRsp *pSmeRsp)
{
+ eCsrRoamCompleteResult result_code = eCsrNothingToJoin;
+
#ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR
{
host_log_ibss_pkt_type *pIbssLog;
@@ -8826,7 +8914,13 @@ static void csr_roam_roaming_state_stop_bss_rsp_processor(tpAniSirGlobal pMac,
pMac->roam.roamSession[pSmeRsp->sessionId].connectState =
eCSR_ASSOC_STATE_TYPE_NOT_CONNECTED;
if (CSR_IS_ROAM_SUBSTATE_STOP_BSS_REQ(pMac, pSmeRsp->sessionId)) {
- csr_roam_complete(pMac, eCsrNothingToJoin, NULL);
+ if (CSR_IS_CONN_NDI(pMac->roam.roamSession[pSmeRsp->sessionId].
+ pCurRoamProfile)) {
+ result_code = eCsrStopBssSuccess;
+ if (pSmeRsp->statusCode != eSIR_SME_SUCCESS)
+ result_code = eCsrStopBssFailure;
+ }
+ csr_roam_complete(pMac, result_code, NULL);
} else
if (CSR_IS_ROAM_SUBSTATE_DISCONNECT_CONTINUE
(pMac, pSmeRsp->sessionId)) {
@@ -12743,7 +12837,7 @@ QDF_STATUS csr_roam_issue_start_bss(tpAniSirGlobal pMac, uint32_t sessionId,
return status;
}
-static void csr_roam_prepare_bss_params(tpAniSirGlobal pMac, uint32_t sessionId,
+void csr_roam_prepare_bss_params(tpAniSirGlobal pMac, uint32_t sessionId,
tCsrRoamProfile *pProfile,
tSirBssDescription *pBssDesc,
tBssConfigParam *pBssConfig,
@@ -12760,7 +12854,11 @@ static void csr_roam_prepare_bss_params(tpAniSirGlobal pMac, uint32_t sessionId,
if (pBssDesc) {
csr_roam_get_bss_start_parms_from_bss_desc(pMac, pBssDesc, pIes,
- &pSession->bssParams);
+ &pSession->bssParams);
+ if (CSR_IS_NDI(pProfile)) {
+ qdf_copy_macaddr(&pSession->bssParams.bssid,
+ &pSession->selfMacAddr);
+ }
} else {
csr_roam_get_bss_start_parms(pMac, pProfile, &pSession->bssParams);
/* Use the first SSID */
@@ -15081,7 +15179,10 @@ QDF_STATUS csr_roam_open_session(tpAniSirGlobal pMac,
uHTCapabilityInfo.htCapInfo.txSTBC;
pSession->htConfig.ht_rx_stbc =
uHTCapabilityInfo.htCapInfo.rxSTBC;
- pSession->htConfig.ht_sgi = true;
+ pSession->htConfig.ht_sgi20 =
+ uHTCapabilityInfo.htCapInfo.shortGI20MHz;
+ pSession->htConfig.ht_sgi40 =
+ uHTCapabilityInfo.htCapInfo.shortGI40MHz;
status =
csr_issue_add_sta_for_session_req(pMac, i, pSelfMacAddr,
type, subType);
@@ -17051,6 +17152,11 @@ csr_roam_offload_scan(tpAniSirGlobal mac_ctx, uint8_t session_id,
roam_params_dst->dense_min_aps_cnt,
roam_params_dst->traffic_threshold);
+ /* Set initial dense roam status */
+ if (req_buf->ConnectedNetwork.ChannelCount >
+ roam_params_dst->dense_min_aps_cnt)
+ roam_params_dst->initial_dense_status = true;
+
for (i = 0; i < roam_params_dst->num_bssid_avoid_list; i++) {
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG,
"Blacklist Bssid: ("MAC_ADDRESS_STR")",
@@ -18666,19 +18772,19 @@ void csr_process_nss_update_req(tpAniSirGlobal mac, tSmeCmd *command)
QDF_STATUS status;
tSirMsgQ msg_return;
struct sir_beacon_tx_complete_rsp *param;
-
- tCsrRoamSession *session =
- CSR_GET_SESSION(mac, command->sessionId);
-
- if (!session) {
- sms_log(mac, LOGE, FL("Session not found"));
- goto fail;
- }
+ tCsrRoamSession *session;
if (!command) {
sms_log(mac, LOGE, FL("nss update param is NULL"));
- goto fail;
+ return;
+ }
+
+ if (!CSR_IS_SESSION_VALID(mac, command->sessionId)) {
+ sms_log(mac, LOGE, FL("Invalid session id %d"),
+ command->sessionId);
+ return;
}
+ session = CSR_GET_SESSION(mac, command->sessionId);
len = sizeof(*msg);
msg = qdf_mem_malloc(len);
diff --git a/core/sme/src/csr/csr_api_scan.c b/core/sme/src/csr/csr_api_scan.c
index a4cd74f89e7d..99d024d36247 100644
--- a/core/sme/src/csr/csr_api_scan.c
+++ b/core/sme/src/csr/csr_api_scan.c
@@ -1963,8 +1963,7 @@ static QDF_STATUS csr_calc_pref_val_by_pcl(tpAniSirGlobal mac_ctx,
if (NULL == mac_ctx || NULL == bss_descr)
return QDF_STATUS_E_FAILURE;
- if (mac_ctx->policy_manager_enabled &&
- is_channel_found_in_pcl(mac_ctx,
+ if (is_channel_found_in_pcl(mac_ctx,
bss_descr->Result.BssDescriptor.channelId, filter) &&
(bss_descr->Result.BssDescriptor.rssi > PCL_RSSI_THRESHOLD)) {
orig_pref_val = csr_derive_prefer_value_from_rssi(mac_ctx,
@@ -3718,34 +3717,24 @@ eCsrScanCompleteNextCommand csr_scan_get_next_command_state(tpAniSirGlobal pMac,
eCsrNextLostLinkScan3Failed;
break;
case eCsrScanForSsid:
- /* When policy manager is disabled:
- * success: csr_scan_handle_search_for_ssid
- * failure: csr_scan_handle_search_for_ssid_failure
- *
- * When policy manager is enabled:
- * success:
+ /* success:
* set hw_mode success -> csr_scan_handle_search_for_ssid
* set hw_mode fail -> csr_scan_handle_search_for_ssid_failure
* failure: csr_scan_handle_search_for_ssid_failure
*/
- if (pMac->policy_manager_enabled) {
- sms_log(pMac, LOG1, FL("Resp for eCsrScanForSsid"));
- channel = cds_search_and_check_for_session_conc(
- pCommand->sessionId,
- pCommand->u.scanCmd.pToRoamProfile);
- if ((!channel) || !fSuccess) {
- NextCommand = eCsrNexteScanForSsidFailure;
- sms_log(pMac, LOG1,
- FL("next ScanForSsidFailure %d %d"),
- channel, fSuccess);
- } else {
- NextCommand = eCsrNextCheckAllowConc;
- *chan = channel;
- sms_log(pMac, LOG1, FL("next CheckAllowConc"));
- }
- } else {
- NextCommand = (fSuccess) ? eCsrNexteScanForSsidSuccess :
- eCsrNexteScanForSsidFailure;
+ sms_log(pMac, LOG1, FL("Resp for eCsrScanForSsid"));
+ channel = cds_search_and_check_for_session_conc(
+ pCommand->sessionId,
+ pCommand->u.scanCmd.pToRoamProfile);
+ if ((!channel) || !fSuccess) {
+ NextCommand = eCsrNexteScanForSsidFailure;
+ sms_log(pMac, LOG1,
+ FL("next ScanForSsidFailure %d %d"),
+ channel, fSuccess);
+ } else {
+ NextCommand = eCsrNextCheckAllowConc;
+ *chan = channel;
+ sms_log(pMac, LOG1, FL("next CheckAllowConc"));
}
break;
default:
@@ -4663,7 +4652,7 @@ QDF_STATUS csr_scan_sme_scan_response(tpAniSirGlobal pMac,
error_handling:
#ifdef FEATURE_WLAN_SCAN_PNO
if (pMac->pnoOffload && pScanRsp->statusCode == eSIR_PNO_SCAN_SUCCESS) {
- sms_log(pMac, LOGE, FL("PNO Scan completion called."));
+ sms_log(pMac, LOG1, FL("PNO Scan completion called"));
csr_save_scan_results(pMac, eCsrScanCandidateFound,
pScanRsp->sessionId);
return QDF_STATUS_SUCCESS;
diff --git a/core/sme/src/csr/csr_inside_api.h b/core/sme/src/csr/csr_inside_api.h
index d2bb54b191eb..f339c1134b39 100644
--- a/core/sme/src/csr/csr_inside_api.h
+++ b/core/sme/src/csr/csr_inside_api.h
@@ -140,7 +140,8 @@ typedef enum {
eCsrSilentlyStopRoaming,
eCsrSilentlyStopRoamingSaveState,
eCsrJoinFailureDueToConcurrency,
-
+ eCsrStopBssSuccess,
+ eCsrStopBssFailure,
} eCsrRoamCompleteResult;
typedef struct tagScanReqParam {
@@ -612,6 +613,10 @@ QDF_STATUS csr_get_active_scan_entry(tpAniSirGlobal mac, uint32_t scan_id,
bool csr_is_profile_wapi(tCsrRoamProfile *pProfile);
#endif /* FEATURE_WLAN_WAPI */
+void csr_get_vdev_type_nss(tpAniSirGlobal mac_ctx,
+ enum tQDF_ADAPTER_MODE dev_mode,
+ uint8_t *nss_2g, uint8_t *nss_5g);
+
#ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR
/* Security */
@@ -1070,3 +1075,16 @@ bool is_disconnect_pending(tpAniSirGlobal mac_ctx,
void csr_scan_active_list_timeout_handle(void *userData);
QDF_STATUS csr_prepare_disconnect_command(tpAniSirGlobal mac,
uint32_t session_id, tSmeCmd **sme_cmd);
+QDF_STATUS csr_roam_prepare_bss_config_from_profile(tpAniSirGlobal mac_ctx,
+ tCsrRoamProfile *profile, tBssConfigParam *bss_cfg,
+ tSirBssDescription *bss_desc);
+void csr_roam_prepare_bss_params(tpAniSirGlobal mac_ctx, uint32_t session_id,
+ tCsrRoamProfile *profile, tSirBssDescription *bss_desc,
+ tBssConfigParam *bss_cfg, tDot11fBeaconIEs *ies);
+
+QDF_STATUS csr_roam_set_bss_config_cfg(tpAniSirGlobal mac_ctx,
+ uint32_t session_id,
+ tCsrRoamProfile *profile, tSirBssDescription *bss_desc,
+ tBssConfigParam *bss_cfg, tDot11fBeaconIEs *ies,
+ bool reset_country);
+
diff --git a/core/sme/src/csr/csr_util.c b/core/sme/src/csr/csr_util.c
index a3aad92af9d7..08ea7cd6326a 100644
--- a/core/sme/src/csr/csr_util.c
+++ b/core/sme/src/csr/csr_util.c
@@ -893,16 +893,20 @@ bool csr_is_p2p_session_connected(tpAniSirGlobal pMac)
enum tQDF_ADAPTER_MODE persona;
for (i = 0; i < CSR_ROAM_SESSION_MAX; i++) {
- if (CSR_IS_SESSION_VALID(pMac, i)
- && !csr_is_conn_state_disconnected(pMac, i)) {
- pSession = CSR_GET_SESSION(pMac, i);
- persona = pSession->pCurRoamProfile->csrPersona;
- if ((NULL != pSession->pCurRoamProfile) &&
- ((QDF_P2P_CLIENT_MODE == persona) ||
- (QDF_P2P_GO_MODE == persona))) {
- return true;
- }
- }
+ if (!CSR_IS_SESSION_VALID(pMac, i))
+ continue;
+
+ if (csr_is_conn_state_disconnected(pMac, i))
+ continue;
+
+ pSession = CSR_GET_SESSION(pMac, i);
+ if (pSession->pCurRoamProfile == NULL)
+ continue;
+
+ persona = pSession->pCurRoamProfile->csrPersona;
+ if (QDF_P2P_CLIENT_MODE == persona ||
+ QDF_P2P_GO_MODE == persona)
+ return true;
}
return false;
@@ -1961,6 +1965,14 @@ csr_isconcurrentsession_valid(tpAniSirGlobal mac_ctx, uint32_t cur_sessionid,
QDF_TRACE_LEVEL_INFO,
FL("**P2P-Client session**"));
return QDF_STATUS_SUCCESS;
+ case QDF_NDI_MODE:
+ if (bss_persona != QDF_STA_MODE) {
+ QDF_TRACE(QDF_MODULE_ID_SME,
+ QDF_TRACE_LEVEL_ERROR,
+ FL("***NDI mode can co-exist only with STA ***"));
+ return QDF_STATUS_E_FAILURE;
+ }
+ break;
default:
QDF_TRACE(QDF_MODULE_ID_SME,
QDF_TRACE_LEVEL_ERROR,
@@ -5339,6 +5351,9 @@ tSirBssType csr_translate_bsstype_to_mac_type(eCsrRoamBssType csrtype)
case eCSR_BSS_TYPE_INFRA_AP:
ret = eSIR_INFRA_AP_MODE;
break;
+ case eCSR_BSS_TYPE_NDI:
+ ret = eSIR_NDI_MODE;
+ break;
case eCSR_BSS_TYPE_ANY:
default:
ret = eSIR_AUTO_MODE;
diff --git a/core/sme/src/nan/nan_datapath_api.c b/core/sme/src/nan/nan_datapath_api.c
index 56a8a99f6ac8..070b25513f60 100644
--- a/core/sme/src/nan/nan_datapath_api.c
+++ b/core/sme/src/nan/nan_datapath_api.c
@@ -23,4 +23,786 @@
*
* SME NAN Data path API implementation
*/
+#include "sms_debug.h"
+#include "sme_api.h"
+#include "sme_inside.h"
+#include "csr_internal.h"
#include "sme_nan_datapath.h"
+
+/**
+ * sme_ndp_initiator_req_handler() - ndp initiator req handler
+ * @hal: hal handle
+ * @req_params: request parameters
+ *
+ * Return: QDF_STATUS_SUCCESS on success; error number otherwise
+ */
+QDF_STATUS sme_ndp_initiator_req_handler(tHalHandle hal,
+ struct ndp_initiator_req *req_params)
+{
+ QDF_STATUS status = QDF_STATUS_SUCCESS;
+ tSmeCmd *cmd;
+ tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal);
+
+ if (NULL == req_params) {
+ sms_log(mac_ctx, LOGE, FL("Invalid req_params"));
+ return QDF_STATUS_E_INVAL;
+ }
+
+ status = sme_acquire_global_lock(&mac_ctx->sme);
+ if (QDF_STATUS_SUCCESS != status) {
+ sms_log(mac_ctx, LOGE,
+ FL("SME lock failed, status:%d"), status);
+ return status;
+ }
+ cmd = csr_get_command_buffer(mac_ctx);
+ if (NULL == cmd) {
+ sme_release_global_lock(&mac_ctx->sme);
+ return QDF_STATUS_E_RESOURCES;
+ }
+
+ cmd->command = eSmeCommandNdpInitiatorRequest;
+ cmd->sessionId = (uint8_t)req_params->vdev_id;
+ qdf_mem_copy(&cmd->u.initiator_req, req_params,
+ sizeof(struct ndp_initiator_req));
+ /* pointers copied as part of above operation are to be overwritten */
+ cmd->u.initiator_req.ndp_info.ndp_app_info = NULL;
+ cmd->u.initiator_req.ndp_config.ndp_cfg = NULL;
+
+ if (req_params->ndp_info.ndp_app_info_len) {
+ cmd->u.initiator_req.ndp_info.ndp_app_info =
+ qdf_mem_malloc(req_params->ndp_info.ndp_app_info_len);
+ if (NULL == cmd->u.initiator_req.ndp_info.ndp_app_info) {
+ csr_release_command_roam(mac_ctx, cmd);
+ sme_release_global_lock(&mac_ctx->sme);
+ return QDF_STATUS_E_NOMEM;
+ }
+ qdf_mem_copy(cmd->u.initiator_req.ndp_info.ndp_app_info,
+ req_params->ndp_info.ndp_app_info,
+ req_params->ndp_info.ndp_app_info_len);
+ }
+
+ if (req_params->ndp_config.ndp_cfg_len) {
+ cmd->u.initiator_req.ndp_config.ndp_cfg =
+ qdf_mem_malloc(req_params->ndp_config.ndp_cfg_len);
+ if (NULL == cmd->u.initiator_req.ndp_config.ndp_cfg) {
+ csr_release_command_roam(mac_ctx, cmd);
+ sme_release_global_lock(&mac_ctx->sme);
+ qdf_mem_free(
+ cmd->u.initiator_req.ndp_info.ndp_app_info);
+ cmd->u.initiator_req.ndp_info.ndp_app_info_len = 0;
+ return QDF_STATUS_E_NOMEM;
+ }
+ qdf_mem_copy(cmd->u.initiator_req.ndp_config.ndp_cfg,
+ req_params->ndp_config.ndp_cfg,
+ req_params->ndp_config.ndp_cfg_len);
+ }
+
+ status = csr_queue_sme_command(mac_ctx, cmd, true);
+ if (QDF_STATUS_SUCCESS != status) {
+ sms_log(mac_ctx, LOGE, FL("SME enqueue failed, status:%d"),
+ status);
+ csr_release_ndp_initiator_req(mac_ctx, cmd);
+ }
+
+ sme_release_global_lock(&mac_ctx->sme);
+ return status;
+}
+/**
+ * sme_ndp_responder_req_handler() - ndp responder request handler
+ * @hal: hal handle
+ * @req_params: request parameters
+ *
+ * Return: QDF_STATUS_SUCCESS on success; error number otherwise
+ */
+QDF_STATUS sme_ndp_responder_req_handler(tHalHandle hal,
+ struct ndp_responder_req *req_params)
+{
+ QDF_STATUS status;
+ tSmeCmd *cmd;
+ tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal);
+
+ if (NULL == req_params) {
+ sms_log(mac_ctx, LOGE, FL("Invalid req_params"));
+ return QDF_STATUS_E_INVAL;
+ }
+
+ status = sme_acquire_global_lock(&mac_ctx->sme);
+ if (QDF_STATUS_SUCCESS != status) {
+ sms_log(mac_ctx, LOGE,
+ FL("SME lock failed, status:%d"), status);
+ return status;
+ }
+ cmd = csr_get_command_buffer(mac_ctx);
+ if (NULL == cmd) {
+ sme_release_global_lock(&mac_ctx->sme);
+ return QDF_STATUS_E_RESOURCES;
+ }
+
+ cmd->command = eSmeCommandNdpResponderRequest;
+ cmd->sessionId = (uint8_t)req_params->vdev_id;
+ qdf_mem_copy(&cmd->u.responder_req, req_params,
+ sizeof(*req_params));
+
+ /*
+ * Pointers copied as part of above operation are
+ * to be overwritten
+ */
+ cmd->u.responder_req.ndp_info.ndp_app_info = NULL;
+ cmd->u.responder_req.ndp_config.ndp_cfg = NULL;
+
+ if (req_params->ndp_info.ndp_app_info_len) {
+ cmd->u.responder_req.ndp_info.ndp_app_info =
+ qdf_mem_malloc(req_params->ndp_info.ndp_app_info_len);
+ if (NULL == cmd->u.responder_req.ndp_info.ndp_app_info) {
+ sme_release_global_lock(&mac_ctx->sme);
+ return QDF_STATUS_E_NOMEM;
+ }
+ qdf_mem_copy(cmd->u.responder_req.ndp_info.ndp_app_info,
+ req_params->ndp_info.ndp_app_info,
+ req_params->ndp_info.ndp_app_info_len);
+ }
+
+ if (req_params->ndp_config.ndp_cfg_len) {
+ cmd->u.responder_req.ndp_config.ndp_cfg =
+ qdf_mem_malloc(req_params->ndp_config.ndp_cfg_len);
+ if (NULL == cmd->u.responder_req.ndp_config.ndp_cfg) {
+ sme_release_global_lock(&mac_ctx->sme);
+ qdf_mem_free(
+ cmd->u.responder_req.ndp_info.ndp_app_info);
+ cmd->u.responder_req.ndp_info.ndp_app_info_len = 0;
+ return QDF_STATUS_E_NOMEM;
+ }
+ qdf_mem_copy(cmd->u.responder_req.ndp_config.ndp_cfg,
+ req_params->ndp_config.ndp_cfg,
+ req_params->ndp_config.ndp_cfg_len);
+ }
+
+ status = csr_queue_sme_command(mac_ctx, cmd, true);
+ if (QDF_STATUS_SUCCESS != status) {
+ sms_log(mac_ctx, LOGE,
+ FL("SME enqueue failed, status:%d"), status);
+ csr_release_ndp_responder_req(mac_ctx, cmd);
+ }
+ sme_release_global_lock(&mac_ctx->sme);
+ return status;
+}
+
+/**
+ * sme_ndp_end_req_handler() - ndp end request handler
+ * @hal: hal handle
+ * @req: ndp end request parameters
+ *
+ * Return: QDF_STATUS_SUCCESS on success; error number otherwise
+ */
+QDF_STATUS sme_ndp_end_req_handler(tHalHandle hal, struct ndp_end_req *req)
+{
+ tSmeCmd *cmd;
+ QDF_STATUS ret = QDF_STATUS_SUCCESS;
+ QDF_STATUS status = QDF_STATUS_SUCCESS;
+ tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal);
+
+ if (NULL == req) {
+ sms_log(mac_ctx, LOGE, FL("Invalid ndp end req"));
+ return QDF_STATUS_E_INVAL;
+ }
+
+ status = sme_acquire_global_lock(&mac_ctx->sme);
+ if (QDF_STATUS_SUCCESS != status) {
+ sms_log(mac_ctx, LOGE,
+ FL("SME lock failed, status:%d"), status);
+ return QDF_STATUS_E_RESOURCES;
+ }
+ cmd = csr_get_command_buffer(mac_ctx);
+ if (NULL == cmd) {
+ sme_release_global_lock(&mac_ctx->sme);
+ return QDF_STATUS_E_RESOURCES;
+ }
+
+ cmd->command = eSmeCommandNdpDataEndInitiatorRequest;
+ cmd->u.data_end_req = qdf_mem_malloc(sizeof(*req) +
+ (req->num_ndp_instances * sizeof(uint32_t)));
+ if (NULL == cmd->u.data_end_req) {
+ csr_release_command_roam(mac_ctx, cmd);
+ sme_release_global_lock(&mac_ctx->sme);
+ return QDF_STATUS_E_NOMEM;
+ }
+
+ qdf_mem_copy(cmd->u.data_end_req, req, sizeof(*req));
+ cmd->u.data_end_req->ndp_ids =
+ (uint32_t *)((uint8_t *)&cmd->u.data_end_req[1]);
+ qdf_mem_copy(cmd->u.data_end_req->ndp_ids, req->ndp_ids,
+ sizeof(uint32_t) * req->num_ndp_instances);
+
+ status = csr_queue_sme_command(mac_ctx, cmd, true);
+ if (QDF_STATUS_SUCCESS != status) {
+ sms_log(mac_ctx, LOGE, FL("SME enqueue failed, status:%d"),
+ status);
+ ret = QDF_STATUS_E_FAILURE;
+ csr_release_ndp_data_end_req(mac_ctx, cmd);
+ }
+
+ sme_release_global_lock(&mac_ctx->sme);
+ return ret;
+}
+
+/**
+ * sme_ndp_sched_req_handler() - ndp schedule request handler
+ * @session_id: session id over which the ndp is being created
+ * @req_params: request parameters
+ *
+ * Return: QDF_STATUS_SUCCESS on success; error number otherwise
+ */
+QDF_STATUS sme_ndp_sched_req_handler(uint32_t session_id,
+ struct ndp_schedule_update_req *req_params)
+{
+ return QDF_STATUS_SUCCESS;
+}
+
+/**
+ * csr_roam_start_ndi() - Start connection for NAN datapath
+ * @mac_ctx: Global MAC context
+ * @session: SME session ID
+ * @profile: Configuration profile
+ *
+ * Return: Success or failure code
+ */
+QDF_STATUS csr_roam_start_ndi(tpAniSirGlobal mac_ctx, uint32_t session,
+ tCsrRoamProfile *profile)
+{
+ QDF_STATUS status;
+ tBssConfigParam bss_cfg = {0};
+
+ /* Build BSS configuration from profile */
+ status = csr_roam_prepare_bss_config_from_profile(mac_ctx, profile,
+ &bss_cfg, NULL);
+ if (QDF_IS_STATUS_SUCCESS(status)) {
+ mac_ctx->roam.roamSession[session].bssParams.uCfgDot11Mode
+ = bss_cfg.uCfgDot11Mode;
+ /* Copy profile parameters to PE session */
+ csr_roam_prepare_bss_params(mac_ctx, session, profile, NULL,
+ &bss_cfg, NULL);
+ /*
+ * Following routine will eventually call
+ * csrRoamIssueStartBss through csrRoamCcmCfgSetCallback
+ */
+ status = csr_roam_set_bss_config_cfg(mac_ctx, session, profile,
+ NULL, &bss_cfg, NULL, false);
+ }
+
+ if (QDF_IS_STATUS_SUCCESS(status))
+ sms_log(mac_ctx, LOG1, FL("Profile config is valid"));
+ else
+ sms_log(mac_ctx, LOGE,
+ FL("Profile config is invalid. status = 0x%x"), status);
+
+ return status;
+}
+
+/**
+ * csr_roam_save_ndi_connected_info() - Save connected profile parameters
+ * @mac_ctx: Global MAC context
+ * @session_id: Session ID
+ * @roam_profile: Profile given for starting BSS
+ * @bssdesc: BSS description from tSirSmeStartBssRsp response
+ *
+ * Saves NDI profile parameters into session's connected profile.
+ *
+ * Return: None
+ */
+void csr_roam_save_ndi_connected_info(tpAniSirGlobal mac_ctx,
+ uint32_t session_id,
+ tCsrRoamProfile *roam_profile,
+ tSirBssDescription *bssdesc)
+{
+ tCsrRoamSession *roam_session = NULL;
+ tCsrRoamConnectedProfile *connect_profile = NULL;
+
+ roam_session = CSR_GET_SESSION(mac_ctx, session_id);
+ if (NULL == roam_session) {
+ QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
+ FL("session %d not found"), session_id);
+ return;
+ }
+
+ connect_profile = &roam_session->connectedProfile;
+ qdf_mem_set(&roam_session->connectedProfile,
+ sizeof(connect_profile), 0);
+ connect_profile->AuthType = roam_profile->negotiatedAuthType;
+ connect_profile->AuthInfo = roam_profile->AuthType;
+ connect_profile->CBMode = roam_profile->CBMode;
+ connect_profile->EncryptionType =
+ roam_profile->negotiatedUCEncryptionType;
+ connect_profile->EncryptionInfo = roam_profile->EncryptionType;
+ connect_profile->mcEncryptionType =
+ roam_profile->negotiatedMCEncryptionType;
+ connect_profile->mcEncryptionInfo =
+ roam_profile->mcEncryptionType;
+ connect_profile->BSSType = roam_profile->BSSType;
+ connect_profile->modifyProfileFields.uapsd_mask =
+ roam_profile->uapsd_mask;
+ connect_profile->operationChannel = bssdesc->channelId;
+ connect_profile->beaconInterval = 0;
+ qdf_mem_copy(&connect_profile->Keys, &roam_profile->Keys,
+ sizeof(roam_profile->Keys));
+ csr_get_bss_id_bss_desc(mac_ctx, bssdesc, &connect_profile->bssid);
+ connect_profile->SSID.length = 0;
+ csr_free_connect_bss_desc(mac_ctx, session_id);
+ connect_profile->qap = false;
+ connect_profile->qosConnection = false;
+}
+
+/**
+ * csr_roam_update_ndp_return_params() - updates ndp return parameters
+ * @mac_ctx: MAC context handle
+ * @result: result of the roaming command
+ * @roam_status: roam status returned to the roam command initiator
+ * @roam_result: roam result returned to the roam command initiator
+ * @roam_info: Roam info data structure to be updated
+ *
+ * Results: None
+ */
+void csr_roam_update_ndp_return_params(tpAniSirGlobal mac_ctx,
+ uint32_t result,
+ uint32_t *roam_status,
+ uint32_t *roam_result,
+ tCsrRoamInfo *roam_info)
+{
+
+ switch (result) {
+ case eCsrStartBssSuccess:
+ roam_info->ndp.ndi_create_params.reason = 0;
+ roam_info->ndp.ndi_create_params.status =
+ NDP_RSP_STATUS_SUCCESS;
+ *roam_status = eCSR_ROAM_NDP_STATUS_UPDATE;
+ *roam_result = eCSR_ROAM_RESULT_NDI_CREATE_RSP;
+ break;
+ case eCsrStartBssFailure:
+ roam_info->ndp.ndi_create_params.status = NDP_RSP_STATUS_ERROR;
+ roam_info->ndp.ndi_create_params.reason =
+ NDP_NAN_DATA_IFACE_CREATE_FAILED;
+ *roam_status = eCSR_ROAM_NDP_STATUS_UPDATE;
+ *roam_result = eCSR_ROAM_RESULT_NDI_CREATE_RSP;
+ break;
+ case eCsrStopBssSuccess:
+ roam_info->ndp.ndi_delete_params.reason = 0;
+ roam_info->ndp.ndi_delete_params.status =
+ NDP_RSP_STATUS_SUCCESS;
+ *roam_status = eCSR_ROAM_NDP_STATUS_UPDATE;
+ *roam_result = eCSR_ROAM_RESULT_NDI_DELETE_RSP;
+ break;
+ case eCsrStopBssFailure:
+ roam_info->ndp.ndi_delete_params.status = NDP_RSP_STATUS_ERROR;
+ roam_info->ndp.ndi_delete_params.reason =
+ NDP_NAN_DATA_IFACE_DELETE_FAILED;
+ *roam_status = eCSR_ROAM_NDP_STATUS_UPDATE;
+ *roam_result = eCSR_ROAM_RESULT_NDI_DELETE_RSP;
+ break;
+ default:
+ sms_log(mac_ctx, LOGE,
+ FL("Invalid CSR Roam result code: %d"), result);
+ break;
+ }
+}
+
+/**
+ * csr_process_ndp_initiator_request() - process ndp initiator request
+ * @mac_ctx: Global MAC context
+ * @cmd: ndp initiator sme cmd
+ *
+ * Return: status of operation
+ */
+QDF_STATUS csr_process_ndp_initiator_request(tpAniSirGlobal mac_ctx,
+ tSmeCmd *cmd)
+{
+ QDF_STATUS status;
+ struct sir_sme_ndp_initiator_req *lim_msg;
+ uint16_t msg_len;
+ uint8_t *self_mac_addr = NULL;
+ struct ndp_initiator_req *req;
+
+ if (NULL == cmd) {
+ sms_log(mac_ctx, LOGE, FL("Invalid req_params"));
+ return QDF_STATUS_E_INVAL;
+ }
+ req = &cmd->u.initiator_req;
+
+ msg_len = sizeof(*lim_msg);
+ lim_msg = qdf_mem_malloc(msg_len);
+ if (NULL == lim_msg)
+ return QDF_STATUS_E_NOMEM;
+
+ qdf_mem_set(lim_msg, msg_len, 0);
+ lim_msg->msg_type = eWNI_SME_NDP_INITIATOR_REQ;
+ lim_msg->msg_len = msg_len;
+ /*
+ * following is being copied from p_cmd->u.initiator_req,
+ * no need to perform deep copy, as we are going to use memory
+ * allocated at SME in p_cmd->u.initiator_req and pass it all the way
+ * to WMA.
+ */
+ qdf_mem_copy(&lim_msg->req, req, sizeof(struct ndp_initiator_req));
+
+ self_mac_addr = lim_msg->req.self_ndi_mac_addr.bytes;
+ sms_log(mac_ctx, LOG1, FL("selfMac = "MAC_ADDRESS_STR),
+ MAC_ADDR_ARRAY(self_mac_addr));
+
+ status = cds_send_mb_message_to_mac(lim_msg);
+ if (status != QDF_STATUS_SUCCESS) {
+ /*
+ * If fail, free up the ndp_cfg and ndp_app_info
+ * allocated in sme.
+ */
+ qdf_mem_free(cmd->u.initiator_req.ndp_info.ndp_app_info);
+ qdf_mem_free(cmd->u.initiator_req.ndp_config.ndp_cfg);
+ cmd->u.initiator_req.ndp_info.ndp_app_info_len = 0;
+ cmd->u.initiator_req.ndp_config.ndp_cfg_len = 0;
+ cmd->u.initiator_req.ndp_config.ndp_cfg = NULL;
+ cmd->u.initiator_req.ndp_info.ndp_app_info = NULL;
+ }
+ return status;
+}
+
+/**
+ * csr_process_ndp_responder_request() - ndp responder req
+ * @mac_ctx: Global MAC context
+ * @cmd: Cmd sent to SME
+ *
+ * Return: Success or failure code
+ */
+QDF_STATUS csr_process_ndp_responder_request(tpAniSirGlobal mac_ctx,
+ tSmeCmd *cmd)
+{
+ struct sir_sme_ndp_responder_req *lim_msg;
+ uint16_t msg_len;
+ QDF_STATUS status;
+
+ if (!cmd) {
+ sms_log(mac_ctx, LOGE, FL("Invalid req_params"));
+ return QDF_STATUS_E_INVAL;
+ }
+
+ msg_len = sizeof(*lim_msg);
+ lim_msg = qdf_mem_malloc(msg_len);
+
+ if (!lim_msg) {
+ sms_log(mac_ctx, LOGE, FL("Mem alloc fail"));
+ status = QDF_STATUS_E_NOMEM;
+ goto free_config;
+ }
+
+ qdf_mem_set(lim_msg, msg_len, 0);
+ lim_msg->msg_type = eWNI_SME_NDP_RESPONDER_REQ;
+ lim_msg->msg_len = msg_len;
+ /*
+ * following is being copied from p_cmd->u.initiator_req,
+ * no need to perform deep copy, as we are going to use memory
+ * allocated at SME in p_cmd->u.initiator_req and pass it all the way
+ * to WMA.
+ */
+ qdf_mem_copy(&lim_msg->req, &cmd->u.responder_req,
+ sizeof(struct ndp_responder_req));
+
+ sms_log(mac_ctx, LOG1,
+ FL("vdev_id %d ndp_rsp = %d Instance id %d"),
+ lim_msg->req.vdev_id,
+ lim_msg->req.ndp_rsp,
+ lim_msg->req.ndp_instance_id);
+
+ status = cds_send_mb_message_to_mac(lim_msg);
+
+free_config:
+ if (status != QDF_STATUS_SUCCESS) {
+ /*
+ * If fail, free up the ndp_cfg and ndp_app_info
+ * allocated in sme.
+ */
+ qdf_mem_free(cmd->u.responder_req.ndp_info.ndp_app_info);
+ qdf_mem_free(cmd->u.responder_req.ndp_config.ndp_cfg);
+ cmd->u.responder_req.ndp_info.ndp_app_info_len = 0;
+ cmd->u.responder_req.ndp_config.ndp_cfg_len = 0;
+ cmd->u.responder_req.ndp_config.ndp_cfg = NULL;
+ cmd->u.responder_req.ndp_info.ndp_app_info = NULL;
+ }
+ return status;
+}
+
+/*
+ * csr_process_ndp_data_end_request() - process ndp data end request
+ * @mac_ctx: Global MAC context
+ * @cmd: sme command containing ndp initiator request
+ *
+ * Return: status of operation
+ */
+QDF_STATUS csr_process_ndp_data_end_request(tpAniSirGlobal mac_ctx,
+ tSmeCmd *cmd)
+{
+ QDF_STATUS status;
+ struct sir_sme_ndp_end_req *lim_msg;
+ uint16_t msg_len;
+
+ if (NULL == cmd) {
+ sms_log(mac_ctx, LOGE, FL("NULL sme cmd"));
+ return QDF_STATUS_E_INVAL;
+ }
+
+ msg_len = sizeof(*lim_msg);
+ lim_msg = qdf_mem_malloc(msg_len);
+ if (NULL == lim_msg) {
+ sms_log(mac_ctx, LOGE, FL("Malloc failed"));
+ qdf_mem_free(cmd->u.data_end_req);
+ cmd->u.data_end_req = NULL;
+ return QDF_STATUS_E_NOMEM;
+ }
+
+ lim_msg->msg_type = (uint16_t)eWNI_SME_NDP_END_REQ;
+ lim_msg->msg_len = msg_len;
+ lim_msg->req = cmd->u.data_end_req;
+
+ status = cds_send_mb_message_to_mac(lim_msg);
+ if (status != QDF_STATUS_SUCCESS) {
+ qdf_mem_free(cmd->u.data_end_req);
+ cmd->u.data_end_req = NULL;
+ }
+ return status;
+}
+
+/**
+ * sme_ndp_msg_processor() - message processor for ndp/ndi north-bound SME msg.
+ * @mac_ctx: Global MAC context
+ * @msg: ndp/ndi SME message
+ *
+ * This function will further call csrRoamCallCallback with appropriate
+ * roam_status and roam_result thus allowing hdd to correctly identify NDP/NDI
+ * response.
+ *
+ * Return: nothing
+ */
+void sme_ndp_msg_processor(tpAniSirGlobal mac_ctx, cds_msg_t *msg)
+{
+ tCsrRoamInfo roam_info = {0};
+ eCsrRoamResult result;
+ uint32_t session_id;
+ tListElem *entry = NULL;
+ tSmeCmd *cmd = NULL;
+ bool release_active_cmd = false;
+ eSmeCommandType cmd_to_rel = eSmeNoCommand;
+ bool send_to_user = true;
+
+ entry = csr_ll_peek_head(&mac_ctx->sme.smeCmdActiveList,
+ LL_ACCESS_LOCK);
+ if (entry != NULL)
+ cmd = GET_BASE_ADDR(entry, tSmeCmd, Link);
+
+ switch (msg->type) {
+ case eWNI_SME_NDP_CONFIRM_IND: {
+ result = eCSR_ROAM_RESULT_NDP_CONFIRM_IND;
+ /* copy msg from msg body to roam info passed to callback */
+ qdf_mem_copy(&roam_info.ndp.ndp_confirm_params, msg->bodyptr,
+ sizeof(roam_info.ndp.ndp_confirm_params));
+ session_id = roam_info.ndp.ndp_confirm_params.vdev_id;
+ break;
+ }
+ case eWNI_SME_NDP_INITIATOR_RSP: {
+ if (true == msg->bodyval) {
+ /* rsp was locally generated, do not send to HDD */
+ send_to_user = false;
+ } else {
+ result = eCSR_ROAM_RESULT_NDP_INITIATOR_RSP;
+ qdf_mem_copy(&roam_info.ndp.ndp_init_rsp_params,
+ msg->bodyptr,
+ sizeof(roam_info.ndp.ndp_init_rsp_params));
+ session_id = roam_info.ndp.ndp_init_rsp_params.vdev_id;
+ }
+ release_active_cmd = true;
+ cmd_to_rel = eSmeCommandNdpInitiatorRequest;
+ break;
+ }
+ case eWNI_SME_NDP_NEW_PEER_IND: {
+ result = eCSR_ROAM_RESULT_NDP_NEW_PEER_IND;
+ /* copy msg from msg body to roam info passed to callback */
+ qdf_mem_copy(&roam_info.ndp.ndp_peer_ind_params,
+ msg->bodyptr,
+ sizeof(roam_info.ndp.ndp_peer_ind_params));
+ session_id = roam_info.ndp.ndp_peer_ind_params.session_id;
+ break;
+ }
+ case eWNI_SME_NDP_INDICATION:
+ result = eCSR_ROAM_RESULT_NDP_INDICATION;
+ /* copy msg from msg body to roam info passed to callback */
+ qdf_mem_copy(&roam_info.ndp.ndp_indication_params,
+ msg->bodyptr, sizeof(struct ndp_indication_event));
+ session_id = roam_info.ndp.ndp_indication_params.vdev_id;
+ break;
+ case eWNI_SME_NDP_RESPONDER_RSP:
+ if (true == msg->bodyval) {
+ /* rsp was locally generated, do not send to HDD */
+ send_to_user = false;
+ } else {
+ result = eCSR_ROAM_RESULT_NDP_RESPONDER_RSP;
+ /*
+ * Copy msg from msg body to roam info passed to
+ * callback
+ */
+ qdf_mem_copy(&roam_info.ndp.ndp_responder_rsp_params,
+ msg->bodyptr,
+ sizeof(struct ndp_responder_rsp_event));
+ session_id =
+ roam_info.ndp.ndp_responder_rsp_params.vdev_id;
+ }
+ release_active_cmd = true;
+ cmd_to_rel = eSmeCommandNdpResponderRequest;
+ break;
+ case eWNI_SME_NDP_END_RSP: {
+ if (true == msg->bodyval) {
+ /* rsp was locally generated, do not send to HDD */
+ send_to_user = false;
+ } else {
+ result = eCSR_ROAM_RESULT_NDP_END_RSP;
+ roam_info.ndp.ndp_end_rsp_params = msg->bodyptr;
+ /*
+ * NDP_END_IND is independent of session, but session_id
+ * is needed for csrRoamCallCallback(). Set it to 0
+ * which is a valid session.
+ */
+ session_id = 0;
+ }
+ release_active_cmd = true;
+ cmd_to_rel = eSmeCommandNdpDataEndInitiatorRequest;
+ /*
+ * get num of ndp requested to terminated from sme command
+ * being released
+ */
+ if (cmd != NULL && cmd_to_rel == cmd->command)
+ roam_info.ndp.ndp_end_rsp_params->num_ndp_terminated =
+ cmd->u.data_end_req->num_ndp_instances;
+ break;
+ }
+ case eWNI_SME_NDP_END_IND:
+ result = eCSR_ROAM_RESULT_NDP_END_IND;
+ roam_info.ndp.ndp_end_ind_params = msg->bodyptr;
+ /*
+ * NDP_END_IND is independent of session, but session_id is
+ * needed for csr_roam_call_callback(). Set it to vdev_id of
+ * first entry which is a valid session. vdev_id is likely to
+ * be same for all.
+ */
+ session_id =
+ roam_info.ndp.ndp_end_ind_params->ndp_map[0].vdev_id;
+ break;
+ case eWNI_SME_NDP_PEER_DEPARTED_IND:
+ result = eCSR_ROAM_RESULT_NDP_PEER_DEPARTED_IND;
+ /* copy msg from msg body to roam info passed to callback */
+ qdf_mem_copy(&roam_info.ndp.ndp_peer_ind_params,
+ msg->bodyptr,
+ sizeof(roam_info.ndp.ndp_peer_ind_params));
+ session_id =
+ ((struct sme_ndp_peer_ind *)msg->bodyptr)->session_id;
+ break;
+ default:
+ sms_log(mac_ctx, LOGE, FL("Unhandled NDP rsp"));
+ qdf_mem_free(msg->bodyptr);
+ return;
+ }
+
+ if (true == send_to_user)
+ csr_roam_call_callback(mac_ctx, session_id, &roam_info, 0,
+ eCSR_ROAM_NDP_STATUS_UPDATE, result);
+
+ /*
+ * free ndp_cfg and ndp_app_info if required
+ * For some commands this info may be needed in HDD
+ * so free them after roam callback.
+ */
+ switch (msg->type) {
+ case eWNI_SME_NDP_INITIATOR_RSP:
+ if (cmd && eSmeCommandNdpInitiatorRequest == cmd->command) {
+ qdf_mem_free(cmd->u.initiator_req.ndp_config.ndp_cfg);
+ qdf_mem_free(
+ cmd->u.initiator_req.ndp_info.ndp_app_info);
+ }
+ break;
+ case eWNI_SME_NDP_INDICATION:
+ qdf_mem_free(
+ roam_info.ndp.ndp_indication_params.ndp_config.ndp_cfg);
+ qdf_mem_free(
+ roam_info.ndp.ndp_indication_params.
+ ndp_info.ndp_app_info);
+ break;
+ case eWNI_SME_NDP_END_RSP:
+ if (cmd &&
+ eSmeCommandNdpDataEndInitiatorRequest == cmd->command) {
+ qdf_mem_free(cmd->u.data_end_req);
+ cmd->u.data_end_req = NULL;
+ }
+ break;
+ case eWNI_SME_NDP_END_IND:
+ break;
+ default:
+ break;
+ }
+ qdf_mem_free(msg->bodyptr);
+ msg->bodyptr = NULL;
+
+ if (release_active_cmd && cmd && cmd_to_rel == cmd->command) {
+ /* Now put this cmd back on the avilable command list */
+ if (csr_ll_remove_entry(&mac_ctx->sme.smeCmdActiveList,
+ entry, LL_ACCESS_LOCK))
+ sme_release_command(mac_ctx, cmd);
+ sme_process_pending_queue(mac_ctx);
+ }
+}
+
+/**
+ * csr_release_ndp_initiator_req() - free resouces from sme command for ndp
+ * initiator request
+ * @mac_ctx: Global MAC context
+ * @cmd: sme command msg
+ *
+ * Return: None
+ */
+void csr_release_ndp_initiator_req(tpAniSirGlobal mac_ctx, tSmeCmd *cmd)
+{
+ qdf_mem_free(cmd->u.initiator_req.ndp_config.ndp_cfg);
+ cmd->u.initiator_req.ndp_config.ndp_cfg = NULL;
+ cmd->u.initiator_req.ndp_config.ndp_cfg_len = 0;
+ qdf_mem_free(cmd->u.initiator_req.ndp_info.ndp_app_info);
+ cmd->u.initiator_req.ndp_info.ndp_app_info = NULL;
+ cmd->u.initiator_req.ndp_info.ndp_app_info_len = 0;
+ sme_release_command(mac_ctx, cmd);
+}
+
+
+/**
+ * csr_release_ndp_responder_req() - free resouces from sme command for ndp
+ * responder request
+ * @mac_ctx: Global MAC context
+ * @cmd: sme command msg
+ *
+ * Return: None
+ */
+void csr_release_ndp_responder_req(tpAniSirGlobal mac_ctx, tSmeCmd *cmd)
+{
+ qdf_mem_free(cmd->u.responder_req.ndp_config.ndp_cfg);
+ cmd->u.responder_req.ndp_config.ndp_cfg = NULL;
+ cmd->u.responder_req.ndp_config.ndp_cfg_len = 0;
+ qdf_mem_free(cmd->u.responder_req.ndp_info.ndp_app_info);
+ cmd->u.responder_req.ndp_info.ndp_app_info = NULL;
+ cmd->u.responder_req.ndp_info.ndp_app_info_len = 0;
+ sme_release_command(mac_ctx, cmd);
+}
+
+
+/**
+ * csr_release_ndp_data_end_req() - free resouces from sme command for ndp
+ * data end request
+ * @mac_ctx: Global MAC context
+ * @cmd: sme command msg
+ *
+ * Return: None
+ */
+void csr_release_ndp_data_end_req(tpAniSirGlobal mac_ctx, tSmeCmd *cmd)
+{
+ qdf_mem_free(cmd->u.data_end_req);
+ cmd->u.data_end_req = NULL;
+ sme_release_command(mac_ctx, cmd);
+}
diff --git a/core/utils/epping/src/epping_main.c b/core/utils/epping/src/epping_main.c
index e7b6c6771492..a248966af6f4 100644
--- a/core/utils/epping/src/epping_main.c
+++ b/core/utils/epping/src/epping_main.c
@@ -262,6 +262,12 @@ int epping_enable(struct device *parent_dev)
pEpping_ctx->target_type = tgt_info->target_type;
ol_ctx = cds_get_context(QDF_MODULE_ID_BMI);
+ if (!ol_ctx) {
+ QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL,
+ "%s: ol_ctx is NULL", __func__);
+ return A_ERROR;
+ }
+
epping_update_ol_config();
#ifndef FEATURE_BMI_2
/* Initialize BMI and Download firmware */
diff --git a/core/utils/fwlog/dbglog_host.h b/core/utils/fwlog/dbglog_host.h
index bbcf50a10b3c..cefeed6c656e 100644
--- a/core/utils/fwlog/dbglog_host.h
+++ b/core/utils/fwlog/dbglog_host.h
@@ -35,6 +35,49 @@ extern "C" {
#include "dbglog_common.h"
#include "ol_defines.h"
+#define DIAG_FWID_OFFSET 24
+#define DIAG_FWID_MASK 0xFF000000 /* Bit 24-31 */
+
+#define DIAG_TIMESTAMP_OFFSET 0
+#define DIAG_TIMESTAMP_MASK 0x00FFFFFF /* Bit 0-23 */
+
+#define DIAG_ID_OFFSET 16
+#define DIAG_ID_MASK 0xFFFF0000 /* Bit 16-31 */
+
+#define DIAG_VDEVID_OFFSET 11
+#define DIAG_VDEVID_MASK 0x0000F800 /* Bit 11-15 */
+#define DIAG_VDEVID_NUM_MAX 16
+
+#define DIAG_VDEVLEVEL_OFFSET 8
+#define DIAG_VDEVLEVEL_MASK 0x00000700 /* Bit 8-10 */
+
+#define DIAG_PAYLEN_OFFSET 0
+#define DIAG_PAYLEN_MASK 0x000000FF /* Bit 0-7 */
+
+#define DIAG_PAYLEN_OFFSET16 0
+#define DIAG_PAYLEN_MASK16 0x0000FFFF /* Bit 0-16 */
+
+#define DIAG_GET_TYPE(arg) \
+ ((arg & DIAG_FWID_MASK) >> DIAG_FWID_OFFSET)
+
+#define DIAG_GET_TIME_STAMP(arg) \
+ ((arg & DIAG_TIMESTAMP_MASK) >> DIAG_TIMESTAMP_OFFSET)
+
+#define DIAG_GET_ID(arg) \
+ ((arg & DIAG_ID_MASK) >> DIAG_ID_OFFSET)
+
+#define DIAG_GET_VDEVID(arg) \
+ ((arg & DIAG_VDEVID_MASK) >> DIAG_VDEVID_OFFSET)
+
+#define DIAG_GET_VDEVLEVEL(arg) \
+ ((arg & DIAG_VDEVLEVEL_MASK) >> DIAG_VDEVLEVEL_OFFSET)
+
+#define DIAG_GET_PAYLEN(arg) \
+ ((arg & DIAG_PAYLEN_MASK) >> DIAG_PAYLEN_OFFSET)
+
+#define DIAG_GET_PAYLEN16(arg) \
+ ((arg & DIAG_PAYLEN_MASK16) >> DIAG_PAYLEN_OFFSET16)
+
/*
* set the dbglog parser type
*/int
diff --git a/core/wma/inc/wma.h b/core/wma/inc/wma.h
index 0850c946a6c8..323b8a384da4 100644
--- a/core/wma/inc/wma.h
+++ b/core/wma/inc/wma.h
@@ -48,6 +48,8 @@
#include "lim_types.h"
#include "wmi_unified_api.h"
#include "cdp_txrx_cmn.h"
+#include "ol_defines.h"
+#include "dbglog.h"
/* Platform specific configuration for max. no. of fragments */
#define QCA_OL_11AC_TX_MAX_FRAGS 2
@@ -230,7 +232,7 @@
#define WMA_VDEV_START_REQUEST_TIMEOUT (3000) /* 3 seconds */
#define WMA_VDEV_STOP_REQUEST_TIMEOUT (3000) /* 3 seconds */
-#define WMA_TGT_INVALID_SNR (-1)
+#define WMA_TGT_INVALID_SNR 0x127
#define WMA_TX_Q_RECHECK_TIMER_WAIT 2 /* 2 ms */
#define WMA_TX_Q_RECHECK_TIMER_MAX_WAIT 20 /* 20 ms */
@@ -937,6 +939,7 @@ struct wma_txrx_node {
int32_t roam_synch_delay;
uint8_t nss_2g;
uint8_t nss_5g;
+ bool p2p_lo_in_progress;
};
#if defined(QCA_WIFI_FTM)
@@ -1429,6 +1432,10 @@ typedef struct {
uint32_t fine_time_measurement_cap;
struct wma_ini_config ini_config;
struct wma_valid_channels saved_chan;
+ /* NAN datapath support enabled in firmware */
+ bool nan_datapath_enabled;
+ QDF_STATUS (*pe_ndp_event_handler)(tpAniSirGlobal mac_ctx,
+ cds_msg_t *msg);
} t_wma_handle, *tp_wma_handle;
/**
@@ -2119,6 +2126,19 @@ void wma_process_set_pdev_ht_ie_req(tp_wma_handle wma,
struct set_ie_param *ie_params);
void wma_process_set_pdev_vht_ie_req(tp_wma_handle wma,
struct set_ie_param *ie_params);
+void wma_remove_peer(tp_wma_handle wma, u_int8_t *bssid,
+ u_int8_t vdev_id, ol_txrx_peer_handle peer,
+ bool roam_synch_in_progress);
+
+QDF_STATUS wma_add_wow_wakeup_event(tp_wma_handle wma,
+ uint32_t vdev_id,
+ uint32_t bitmap,
+ bool enable);
+QDF_STATUS wma_create_peer(tp_wma_handle wma, ol_txrx_pdev_handle pdev,
+ ol_txrx_vdev_handle vdev, u8 peer_addr[6],
+ u_int32_t peer_type, u_int8_t vdev_id,
+ bool roam_synch_in_progress);
+
#endif
struct wma_ini_config *wma_get_ini_handle(tp_wma_handle wma_handle);
WLAN_PHY_MODE wma_chan_phy_mode(u8 chan, enum phy_ch_width chan_width,
diff --git a/core/wma/inc/wma_api.h b/core/wma/inc/wma_api.h
index 6bd86bdc34e5..00b64767a203 100644
--- a/core/wma/inc/wma_api.h
+++ b/core/wma/inc/wma_api.h
@@ -32,6 +32,7 @@
#include "cds_mq.h"
#include "ani_global.h"
#include "a_types.h"
+#include "osapi_linux.h"
#include "wmi_unified.h"
#ifdef NOT_YET
#include "htc_api.h"
@@ -250,4 +251,21 @@ static inline QDF_STATUS wma_send_egap_conf_params(WMA_HANDLE handle,
#endif
QDF_STATUS wma_set_tx_power_scale(uint8_t vdev_id, int value);
QDF_STATUS wma_set_tx_power_scale_decr_db(uint8_t vdev_id, int value);
+
+#ifdef WLAN_FEATURE_NAN_DATAPATH
+QDF_STATUS wma_register_ndp_cb(QDF_STATUS (*pe_ndp_event_handler)
+ (tpAniSirGlobal mac_ctx,
+ cds_msg_t *msg));
+#else
+static inline QDF_STATUS wma_register_ndp_cb(QDF_STATUS (*pe_ndp_event_handler)
+ (tpAniSirGlobal mac_ctx,
+ cds_msg_t *msg))
+{
+ return QDF_STATUS_SUCCESS;
+}
+#endif
+
+bool wma_is_p2p_lo_capable(void);
+QDF_STATUS wma_p2p_lo_start(struct sir_p2p_lo_start *params);
+QDF_STATUS wma_p2p_lo_stop(u_int32_t vdev_id);
#endif
diff --git a/core/wma/inc/wma_if.h b/core/wma/inc/wma_if.h
index 1d3cb68d4468..58b0dac039bd 100644
--- a/core/wma/inc/wma_if.h
+++ b/core/wma/inc/wma_if.h
@@ -72,6 +72,7 @@
#define BSS_OPERATIONAL_MODE_AP 0
#define BSS_OPERATIONAL_MODE_STA 1
#define BSS_OPERATIONAL_MODE_IBSS 2
+#define BSS_OPERATIONAL_MODE_NDI 3
/* STA entry type in add sta message */
#define STA_ENTRY_SELF 0
@@ -83,6 +84,7 @@
#ifdef FEATURE_WLAN_TDLS
#define STA_ENTRY_TDLS_PEER 4
#endif /* FEATURE_WLAN_TDLS */
+#define STA_ENTRY_NDI_PEER 5
#define STA_INVALID_IDX 0xFF
@@ -594,6 +596,8 @@ typedef enum eSmpsModeValue {
* @rssi: rssi value during disconnection
*/
typedef struct {
+ bool is_tdls;
+ uint8_t vdev_id;
uint16_t assocId;
uint16_t staId;
tSirMacAddr bssId;
diff --git a/core/wma/inc/wma_internal.h b/core/wma/inc/wma_internal.h
index a62a99cf6127..9c4cff42ed9a 100644
--- a/core/wma/inc/wma_internal.h
+++ b/core/wma/inc/wma_internal.h
@@ -28,6 +28,10 @@
#ifndef WMA_INTERNAL_H
#define WMA_INTERNAL_H
+#if !defined(REMOVE_PKT_LOG)
+#include "pktlog_ac.h"
+#endif
+
/* ################### defines ################### */
/*
* TODO: Following constant should be shared by firwmare in
@@ -1210,4 +1214,11 @@ int wma_peer_delete_handler(void *handle, uint8_t *cmd_param_info,
uint32_t len);
void wma_remove_req(tp_wma_handle wma, uint8_t vdev_id,
uint8_t type);
+int wma_p2p_lo_event_handler(void *handle, uint8_t *event_buf,
+ uint32_t len);
+
+QDF_STATUS wma_process_hal_pwr_dbg_cmd(WMA_HANDLE handle,
+ struct sir_mac_pwr_dbg_cmd *
+ sir_pwr_dbg_params);
+
#endif
diff --git a/core/wma/inc/wma_tgt_cfg.h b/core/wma/inc/wma_tgt_cfg.h
index 0afcf52de27b..6e9113896733 100644
--- a/core/wma/inc/wma_tgt_cfg.h
+++ b/core/wma/inc/wma_tgt_cfg.h
@@ -148,6 +148,7 @@ struct wma_dfs_radar_ind {
* @max_intf_count: max interface count
* @lpss_support: lpass support
* @egap_support: enhanced green ap support
+ * @nan_datapath_enabled: nan data path support
*/
struct wma_tgt_cfg {
uint32_t target_fw_version;
@@ -168,5 +169,8 @@ struct wma_tgt_cfg {
#endif
uint32_t fine_time_measurement_cap;
bool bpf_enabled;
+#ifdef WLAN_FEATURE_NAN_DATAPATH
+ bool nan_datapath_enabled;
+#endif
};
#endif /* WMA_TGT_CFG_H */
diff --git a/core/wma/src/wma_data.c b/core/wma/src/wma_data.c
index 3f7aa65f05ca..10ddf1dae559 100644
--- a/core/wma/src/wma_data.c
+++ b/core/wma/src/wma_data.c
@@ -2503,6 +2503,7 @@ QDF_STATUS wma_tx_packet(void *wma_context, void *tx_frame, uint16_t frmLen,
tpAniSirGlobal pMac;
tpSirMacMgmtHdr mHdr;
struct wmi_mgmt_params mgmt_param = {0};
+ struct wmi_desc_t *wmi_desc = NULL;
ol_pdev_handle ctrl_pdev;
if (NULL == wma_handle) {
@@ -2825,21 +2826,25 @@ QDF_STATUS wma_tx_packet(void *wma_context, void *tx_frame, uint16_t frmLen,
mgmt_param.tx_frame = tx_frame;
mgmt_param.frm_len = frmLen;
mgmt_param.vdev_id = vdev_id;
- mgmt_param.tx_complete_cb = tx_frm_download_comp_cb;
- mgmt_param.tx_ota_post_proc_cb = tx_frm_ota_comp_cb;
- mgmt_param.chanfreq = chanfreq;
mgmt_param.pdata = pData;
+ mgmt_param.chanfreq = chanfreq;
mgmt_param.qdf_ctx = cds_get_context(QDF_MODULE_ID_QDF_DEVICE);
- mgmt_param.wmi_desc = wmi_desc_get(wma_handle);
- if (NULL == mgmt_param.wmi_desc) {
- WMA_LOGE(FL("Failed to get wmi descriptor"));
+ wmi_desc = wmi_desc_get(wma_handle);
+ if (!wmi_desc) {
+ WMA_LOGE("%s: Failed to get wmi_desc", __func__);
status = QDF_STATUS_E_FAILURE;
} else {
+ mgmt_param.desc_id = wmi_desc->desc_id;
status = wmi_mgmt_unified_cmd_send(
- wma_handle->wmi_handle,
- &mgmt_param);
- if (status)
- wmi_desc_put(wma_handle, mgmt_param.wmi_desc);
+ wma_handle->wmi_handle,
+ &mgmt_param);
+ if (status) {
+ wmi_desc_put(wma_handle, wmi_desc);
+ } else {
+ wmi_desc->nbuf = tx_frame;
+ wmi_desc->tx_cmpl_cb = tx_frm_download_comp_cb;
+ wmi_desc->ota_post_proc_cb = tx_frm_ota_comp_cb;
+ }
}
} else {
/* Hand over the Tx Mgmt frame to TxRx */
diff --git a/core/wma/src/wma_dev_if.c b/core/wma/src/wma_dev_if.c
index a588abab4837..f43ead6a6b5e 100644
--- a/core/wma/src/wma_dev_if.c
+++ b/core/wma/src/wma_dev_if.c
@@ -76,6 +76,7 @@
#include "cds_concurrency.h"
+#include "wma_nan_datapath.h"
/**
* wma_find_vdev_by_addr() - find vdev_id from mac address
@@ -210,6 +211,9 @@ enum wlan_op_mode wma_get_txrx_vdev_type(uint32_t type)
case WMI_VDEV_TYPE_MONITOR:
vdev_type = wlan_op_mode_monitor;
break;
+ case WMI_VDEV_TYPE_NDI:
+ vdev_type = wlan_op_mode_ndi;
+ break;
default:
WMA_LOGE("Invalid vdev type %u", type);
vdev_type = wlan_op_mode_unknown;
@@ -1374,7 +1378,11 @@ int wma_vdev_stop_resp_handler(void *handle, uint8_t *cmd_param_info,
}
if (wma_is_vdev_in_ibss_mode(wma, resp_event->vdev_id))
wma_delete_all_ibss_peers(wma, resp_event->vdev_id);
- else {
+ else if (WMA_IS_VDEV_IN_NDI_MODE(wma->interfaces,
+ resp_event->vdev_id)) {
+ wma_delete_all_nan_remote_peers(wma,
+ resp_event->vdev_id);
+ } else {
if (wma_is_vdev_in_ap_mode(wma, resp_event->vdev_id)) {
wma_delete_all_ap_remote_peers(wma,
resp_event->vdev_id);
@@ -1584,7 +1592,8 @@ ol_txrx_vdev_handle wma_vdev_attach(tp_wma_handle wma_handle,
if (((self_sta_req->type == WMI_VDEV_TYPE_AP) &&
(self_sta_req->sub_type == WMI_UNIFIED_VDEV_SUBTYPE_P2P_DEVICE)) ||
(self_sta_req->type == WMI_VDEV_TYPE_OCB) ||
- (self_sta_req->type == WMI_VDEV_TYPE_MONITOR)) {
+ (self_sta_req->type == WMI_VDEV_TYPE_MONITOR) ||
+ (self_sta_req->type == WMI_VDEV_TYPE_NDI)) {
WMA_LOGA("Creating self peer %pM, vdev_id %hu",
self_sta_req->self_mac_addr, self_sta_req->session_id);
status = wma_create_peer(wma_handle, txrx_pdev,
@@ -3286,6 +3295,10 @@ void wma_add_bss(tp_wma_handle wma, tpAddBssParams params)
break;
#endif
+ case QDF_NDI_MODE:
+ wma_add_bss_ndi_mode(wma, params);
+ break;
+
default:
wma_add_bss_sta_mode(wma, params);
break;
@@ -4054,6 +4067,8 @@ void wma_add_sta(tp_wma_handle wma, tpAddStaParams add_sta)
else if (wma_is_vdev_in_ibss_mode(wma, add_sta->smesessionId))
oper_mode = BSS_OPERATIONAL_MODE_IBSS;
+ if (WMA_IS_VDEV_IN_NDI_MODE(wma->interfaces, add_sta->smesessionId))
+ oper_mode = BSS_OPERATIONAL_MODE_NDI;
switch (oper_mode) {
case BSS_OPERATIONAL_MODE_STA:
wma_add_sta_req_sta_mode(wma, add_sta);
@@ -4065,6 +4080,9 @@ void wma_add_sta(tp_wma_handle wma, tpAddStaParams add_sta)
htc_vote_link_down(wma->htc_handle);
wma_add_sta_req_ap_mode(wma, add_sta);
break;
+ case BSS_OPERATIONAL_MODE_NDI:
+ wma_add_sta_ndi_mode(wma, add_sta);
+ break;
}
#ifdef QCA_IBSS_SUPPORT
@@ -4094,6 +4112,8 @@ void wma_delete_sta(tp_wma_handle wma, tpDeleteStaParams del_sta)
oper_mode = BSS_OPERATIONAL_MODE_IBSS;
WMA_LOGD("%s: to delete sta for IBSS mode", __func__);
}
+ if (del_sta->staType == STA_ENTRY_NDI_PEER)
+ oper_mode = BSS_OPERATIONAL_MODE_NDI;
switch (oper_mode) {
case BSS_OPERATIONAL_MODE_STA:
@@ -4120,6 +4140,9 @@ void wma_delete_sta(tp_wma_handle wma, tpDeleteStaParams del_sta)
qdf_mem_free(del_sta);
}
break;
+ case BSS_OPERATIONAL_MODE_NDI:
+ wma_delete_sta_req_ndi_mode(wma, del_sta);
+ break;
}
#ifdef QCA_IBSS_SUPPORT
@@ -4160,6 +4183,12 @@ void wma_delete_bss(tp_wma_handle wma, tpDeleteBssParams params)
peer = ol_txrx_find_peer_by_addr(pdev,
wma->interfaces[params->smesessionId].addr,
&peer_id);
+ else if (WMA_IS_VDEV_IN_NDI_MODE(wma->interfaces,
+ params->smesessionId))
+ /* In ndi case, self mac is used to create the self peer */
+ peer = ol_txrx_find_peer_by_addr(pdev,
+ wma->interfaces[params->smesessionId].addr,
+ &peer_id);
else
peer = ol_txrx_find_peer_by_addr(pdev, params->bssid, &peer_id);
diff --git a/core/wma/src/wma_features.c b/core/wma/src/wma_features.c
index 32d64857daf0..8b92c7826877 100644
--- a/core/wma/src/wma_features.c
+++ b/core/wma/src/wma_features.c
@@ -70,6 +70,7 @@
#include "radar_filters.h"
#include "wma_internal.h"
#include "ol_txrx.h"
+#include "wma_nan_datapath.h"
#ifndef ARRAY_LENGTH
#define ARRAY_LENGTH(a) (sizeof(a) / sizeof((a)[0]))
@@ -2987,6 +2988,23 @@ int wma_wow_wakeup_host_event(void *handle, uint8_t *event,
(uint8_t *)param_buf->wow_packet_buffer,
sizeof(WMI_NAN_EVENTID_param_tlvs));
break;
+ case WOW_REASON_NAN_DATA:
+ WMA_LOGD(FL("Host woken up for NAN data path event from FW"));
+ if (param_buf->wow_packet_buffer) {
+ wow_buf_pkt_len =
+ *(uint32_t *)param_buf->wow_packet_buffer;
+ WMA_LOGD(FL("wow_packet_buffer dump"));
+ qdf_trace_hex_dump(QDF_MODULE_ID_WMA,
+ QDF_TRACE_LEVEL_DEBUG,
+ param_buf->wow_packet_buffer,
+ wow_buf_pkt_len);
+ wma_ndp_wow_event_callback(handle,
+ (param_buf->wow_packet_buffer + 4),
+ wow_buf_pkt_len);
+ } else {
+ WMA_LOGE(FL("wow_packet_buffer is empty"));
+ }
+ break;
default:
break;
}
@@ -3043,7 +3061,7 @@ static inline void wma_set_wow_bus_suspend(tp_wma_handle wma, int val)
*
* Return: QDF status
*/
-static QDF_STATUS wma_add_wow_wakeup_event(tp_wma_handle wma,
+QDF_STATUS wma_add_wow_wakeup_event(tp_wma_handle wma,
uint32_t vdev_id,
uint32_t bitmap,
bool enable)
@@ -3385,6 +3403,13 @@ void wma_register_wow_wakeup_events(WMA_HANDLE handle,
event_bitmap = WMA_WOW_SAP_WAKE_UP_EVENTS;
WMA_LOGI("SAP specific default wake up event 0x%x vdev id %d",
event_bitmap, vdev_id);
+ } else if (WMI_VDEV_TYPE_NDI == vdev_type) {
+ /*
+ * Configure NAN data path specific default wake up events.
+ * Following routine sends the command to firmware.
+ */
+ wma_ndp_add_wow_wakeup_event(wma, vdev_id);
+ return;
} else {
WMA_LOGE("unknown type %d subtype %d", vdev_type, vdev_subtype);
return;
@@ -3937,6 +3962,23 @@ bool wma_is_extscan_in_progress(tp_wma_handle wma, int vdev_id)
#endif
/**
+ * wma_is_p2plo_in_progress(): check if P2P listen offload is in progress
+ * @wma: wma handle
+ * @vdev_id: vdev_id
+ *
+ * This function is to check if p2p listen offload is in progress,
+ * true: p2p listen offload in progress
+ * false: otherwise
+ *
+ * Return: TRUE/FALSE
+ */
+static inline
+bool wma_is_p2plo_in_progress(tp_wma_handle wma, int vdev_id)
+{
+ return wma->interfaces[vdev_id].p2p_lo_in_progress;
+}
+
+/**
* wma_is_wow_applicable(): should enable wow
* @wma: wma handle
*
@@ -3945,6 +3987,10 @@ bool wma_is_extscan_in_progress(tp_wma_handle wma, int vdev_id)
* 2) Is any one of vdev in connected state (in STA mode) ?
* 3) Is PNO in progress in any one of vdev ?
* 4) Is Extscan in progress in any one of vdev ?
+ * 5) Is P2P listen offload in any one of vdev?
+ * 6) Is any vdev in NAN data mode? BSS is already started at the
+ * the time of device creation. It is ready to accept data
+ * requests.
* If none of above conditions is true then return false
*
* Return: true if wma needs to configure wow false otherwise.
@@ -3967,6 +4013,14 @@ bool wma_is_wow_applicable(tp_wma_handle wma)
} else if (wma_is_extscan_in_progress(wma, vdev_id)) {
WMA_LOGD("EXT is in progress, enabling wow");
return true;
+ } else if (wma_is_p2plo_in_progress(wma, vdev_id)) {
+ WMA_LOGD("P2P LO is in progress, enabling wow");
+ return true;
+ }
+ if (WMA_IS_VDEV_IN_NDI_MODE(wma->interfaces, vdev_id)) {
+ WMA_LOGD("vdev %d is in NAN data mode, enabling wow",
+ vdev_id);
+ return true;
}
}
@@ -4810,7 +4864,7 @@ QDF_STATUS wma_process_gtk_offload_req(tp_wma_handle wma,
}
/* Validate vdev id */
- if (vdev_id >= wma->max_bssid) {
+ if (vdev_id >= WMA_MAX_SUPPORTED_BSS) {
WMA_LOGE("invalid vdev_id %d for %pM", vdev_id,
params->bssid.bytes);
status = QDF_STATUS_E_INVAL;
@@ -6481,6 +6535,12 @@ int wma_update_tdls_peer_state(WMA_HANDLE handle,
ch_mhz = qdf_mem_malloc(sizeof(uint32_t) *
peerStateParams->peerCap.peerChanLen);
+ if (ch_mhz == NULL) {
+ WMA_LOGE("%s: memory allocation failed", __func__);
+ ret = -ENOMEM;
+ goto end_tdls_peer_state;
+ }
+
for (i = 0; i < peerStateParams->peerCap.peerChanLen; ++i) {
ch_mhz[i] =
cds_chan_to_freq(peerStateParams->peerCap.peerChan[i].
@@ -7310,3 +7370,182 @@ QDF_STATUS wma_set_bpf_instructions(tp_wma_handle wma,
}
return QDF_STATUS_SUCCESS;
}
+
+/**
+ * wma_p2p_lo_start() - P2P listen offload start
+ * @params: p2p listen offload parameters
+ *
+ * This function sends WMI command to start P2P listen offload.
+ *
+ * Return: QDF_STATUS enumeration
+ */
+QDF_STATUS wma_p2p_lo_start(struct sir_p2p_lo_start *params)
+{
+ wmi_buf_t buf;
+ wmi_p2p_lo_start_cmd_fixed_param *cmd;
+ int32_t len = sizeof(*cmd);
+ tp_wma_handle wma = cds_get_context(QDF_MODULE_ID_WMA);
+ uint8_t *buf_ptr;
+ int ret;
+
+ if (NULL == wma) {
+ WMA_LOGE("%s: wma context is NULL", __func__);
+ return QDF_STATUS_E_INVAL;
+ }
+
+ len += 2 * WMI_TLV_HDR_SIZE +
+ qdf_roundup(params->dev_types_len, sizeof(A_UINT32)) +
+ qdf_roundup(params->probe_resp_len, sizeof(A_UINT32));
+
+ buf = wmi_buf_alloc(wma->wmi_handle, len);
+ if (!buf) {
+ WMA_LOGP("%s: failed to allocate memory for p2p lo start",
+ __func__);
+ return QDF_STATUS_E_NOMEM;
+ }
+
+ cmd = (wmi_p2p_lo_start_cmd_fixed_param *)wmi_buf_data(buf);
+ buf_ptr = (uint8_t *) wmi_buf_data(buf);
+
+ WMITLV_SET_HDR(&cmd->tlv_header,
+ WMITLV_TAG_STRUC_wmi_p2p_lo_start_cmd_fixed_param,
+ WMITLV_GET_STRUCT_TLVLEN(
+ wmi_p2p_lo_start_cmd_fixed_param));
+
+ cmd->vdev_id = params->vdev_id;
+ cmd->ctl_flags = params->ctl_flags;
+ cmd->channel = params->freq;
+ cmd->period = params->period;
+ cmd->interval = params->interval;
+ cmd->count = params->count;
+
+ buf_ptr += sizeof(wmi_p2p_lo_start_cmd_fixed_param);
+ WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_BYTE,
+ qdf_roundup(params->dev_types_len, sizeof(A_UINT32)));
+ buf_ptr += WMI_TLV_HDR_SIZE;
+ qdf_mem_copy(buf_ptr, params->device_types, params->dev_types_len);
+
+ buf_ptr += qdf_roundup(params->dev_types_len, sizeof(A_UINT32));
+ WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_BYTE,
+ qdf_roundup(params->probe_resp_len, sizeof(A_UINT32)));
+ buf_ptr += WMI_TLV_HDR_SIZE;
+ qdf_mem_copy(buf_ptr, params->probe_resp_tmplt, params->probe_resp_len);
+
+ WMA_LOGI("%s: Sending WMI_P2P_LO_START command, channel=%d, period=%d, interval=%d, count=%d",
+ __func__, cmd->channel, cmd->period,
+ cmd->interval, cmd->count);
+
+ ret = wmi_unified_cmd_send(wma->wmi_handle,
+ buf, len,
+ WMI_P2P_LISTEN_OFFLOAD_START_CMDID);
+ if (ret) {
+ WMA_LOGE("Failed to send p2p lo start: %d", ret);
+ wmi_buf_free(buf);
+ }
+
+ WMA_LOGI("%s: Successfully sent WMI_P2P_LO_START", __func__);
+ wma->interfaces[params->vdev_id].p2p_lo_in_progress = true;
+
+ return ret;
+}
+
+/**
+ * wma_p2p_lo_stop() - P2P listen offload stop
+ * @vdev_id: vdev identifier
+ *
+ * This function sends WMI command to stop P2P listen offload.
+ *
+ * Return: QDF_STATUS enumeration
+ */
+QDF_STATUS wma_p2p_lo_stop(u_int32_t vdev_id)
+{
+ wmi_buf_t buf;
+ wmi_p2p_lo_stop_cmd_fixed_param *cmd;
+ int32_t len;
+ tp_wma_handle wma = cds_get_context(QDF_MODULE_ID_WMA);
+ int ret;
+
+ if (NULL == wma) {
+ WMA_LOGE("%s: wma context is NULL", __func__);
+ return QDF_STATUS_E_INVAL;
+ }
+
+ len = sizeof(*cmd);
+ buf = wmi_buf_alloc(wma->wmi_handle, len);
+ if (!buf) {
+ WMA_LOGP("%s: failed to allocate memory for p2p lo stop",
+ __func__);
+ return QDF_STATUS_E_NOMEM;
+ }
+ cmd = (wmi_p2p_lo_stop_cmd_fixed_param *)wmi_buf_data(buf);
+
+ WMITLV_SET_HDR(&cmd->tlv_header,
+ WMITLV_TAG_STRUC_wmi_p2p_lo_stop_cmd_fixed_param,
+ WMITLV_GET_STRUCT_TLVLEN(
+ wmi_p2p_lo_stop_cmd_fixed_param));
+
+ cmd->vdev_id = vdev_id;
+
+ WMA_LOGI("%s: Sending WMI_P2P_LO_STOP command", __func__);
+
+ ret = wmi_unified_cmd_send(wma->wmi_handle,
+ buf, len,
+ WMI_P2P_LISTEN_OFFLOAD_STOP_CMDID);
+ if (ret) {
+ WMA_LOGE("Failed to send p2p lo stop: %d", ret);
+ wmi_buf_free(buf);
+ }
+
+ WMA_LOGI("%s: Successfully sent WMI_P2P_LO_STOP", __func__);
+ wma->interfaces[vdev_id].p2p_lo_in_progress = false;
+
+ return ret;
+}
+
+/**
+ * wma_p2p_lo_event_handler() - p2p lo event
+ * @handle: the WMA handle
+ * @event_buf: buffer with the event parameters
+ * @len: length of the buffer
+ *
+ * This function receives P2P listen offload stop event from FW and
+ * pass the event information to upper layer.
+ *
+ * Return: 0 on success
+ */
+int wma_p2p_lo_event_handler(void *handle, uint8_t *event_buf,
+ uint32_t len)
+{
+ tp_wma_handle wma = cds_get_context(QDF_MODULE_ID_WMA);
+ struct sir_p2p_lo_event *event;
+ WMI_P2P_LISTEN_OFFLOAD_STOPPED_EVENTID_param_tlvs *param_tlvs;
+ wmi_p2p_lo_stopped_event_fixed_param *fix_param;
+ tpAniSirGlobal p_mac = cds_get_context(QDF_MODULE_ID_PE);
+
+ if (!p_mac) {
+ WMA_LOGE("%s: Invalid p_mac", __func__);
+ return -EINVAL;
+ }
+
+ if (!p_mac->sme.p2p_lo_event_callback) {
+ WMA_LOGE("%s: Callback not registered", __func__);
+ return -EINVAL;
+ }
+
+ param_tlvs = (WMI_P2P_LISTEN_OFFLOAD_STOPPED_EVENTID_param_tlvs *)
+ event_buf;
+ fix_param = param_tlvs->fixed_param;
+ event = qdf_mem_malloc(sizeof(*event));
+ if (event == NULL) {
+ WMA_LOGE("Event allocation failed");
+ return -ENOMEM;
+ }
+ event->vdev_id = fix_param->vdev_id;
+ event->reason_code = fix_param->reason;
+
+ p_mac->sme.p2p_lo_event_callback(p_mac->hHdd, event);
+
+ wma->interfaces[event->vdev_id].p2p_lo_in_progress = false;
+
+ return 0;
+}
diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c
index a62af7827aa0..a0d9e9439805 100644
--- a/core/wma/src/wma_main.c
+++ b/core/wma/src/wma_main.c
@@ -78,6 +78,7 @@
#include "cdp_txrx_flow_ctrl_legacy.h"
#include "cdp_txrx_flow_ctrl_v2.h"
#include "cdp_txrx_ipa.h"
+#include "wma_nan_datapath.h"
#define WMA_LOG_COMPLETION_TIMER 10000 /* 10 seconds */
@@ -1469,6 +1470,41 @@ static int wma_process_fw_event_tasklet_ctx(void *ctx, void *ev)
}
/**
+ * wma_process_hal_pwr_dbg_cmd() - send hal pwr dbg cmd to fw.
+ * @handle: wma handle
+ * @sir_pwr_dbg_params: unit test command
+ *
+ * This function send unit test command to fw.
+ *
+ * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
+ */
+QDF_STATUS wma_process_hal_pwr_dbg_cmd(WMA_HANDLE handle,
+ struct sir_mac_pwr_dbg_cmd *
+ sir_pwr_dbg_params)
+{
+ tp_wma_handle wma_handle = (tp_wma_handle)handle;
+ int i;
+ struct wmi_power_dbg_params wmi_pwr_dbg_params;
+ QDF_STATUS status;
+
+ if (!sir_pwr_dbg_params) {
+ WMA_LOGE("%s: sir_pwr_dbg_params is null", __func__);
+ return QDF_STATUS_E_INVAL;
+ }
+ wmi_pwr_dbg_params.module_id = sir_pwr_dbg_params->module_id;
+ wmi_pwr_dbg_params.pdev_id = sir_pwr_dbg_params->pdev_id;
+ wmi_pwr_dbg_params.num_args = sir_pwr_dbg_params->num_args;
+
+ for (i = 0; i < wmi_pwr_dbg_params.num_args; i++)
+ wmi_pwr_dbg_params.args[i] = sir_pwr_dbg_params->args[i];
+
+ status = wmi_unified_send_power_dbg_cmd(wma_handle->wmi_handle,
+ &wmi_pwr_dbg_params);
+
+ return status;
+}
+
+/**
* wma_process_fw_event_handler() - common event handler to serialize
* event processing through mc_thread
* @ctx: wmi context
@@ -1591,6 +1627,11 @@ static void wma_init_max_no_of_peers(tp_wma_handle wma_handle,
{
struct wma_ini_config *cfg = wma_get_ini_handle(wma_handle);
+ if (cfg == NULL) {
+ WMA_LOGE("%s: NULL WMA ini handle", __func__);
+ return;
+ }
+
cfg->max_no_of_peers = max_peers;
}
@@ -2076,6 +2117,7 @@ QDF_STATUS wma_open(void *cds_context,
WMI_BPF_CAPABILIY_INFO_EVENTID,
wma_get_bpf_caps_event_handler,
WMA_RX_SERIALIZER_CTX);
+ wma_ndp_register_all_event_handlers(wma_handle);
return QDF_STATUS_SUCCESS;
err_dbglog_init:
@@ -2851,6 +2893,17 @@ QDF_STATUS wma_start(void *cds_ctx)
goto end;
}
+ /* Initialize the P2P Listen Offload event handler */
+ status = wmi_unified_register_event_handler(wma_handle->wmi_handle,
+ WMI_P2P_LISTEN_OFFLOAD_STOPPED_EVENTID,
+ wma_p2p_lo_event_handler,
+ WMA_RX_SERIALIZER_CTX);
+ if (!QDF_IS_STATUS_SUCCESS(status)) {
+ WMA_LOGE("Failed to register p2p lo event cb");
+ qdf_status = QDF_STATUS_E_FAILURE;
+ goto end;
+ }
+
end:
WMA_LOGD("%s: Exit", __func__);
return qdf_status;
@@ -3245,6 +3298,9 @@ QDF_STATUS wma_close(void *cds_ctx)
qdf_mem_free(wma_handle->pGetRssiReq);
wma_handle->pGetRssiReq = NULL;
}
+
+ wma_ndp_unregister_all_event_handlers(wma_handle);
+
if (WMI_SERVICE_IS_ENABLED(wma_handle->wmi_service_bitmap,
WMI_SERVICE_MGMT_TX_WMI)) {
wmi_desc_pool_deinit(wma_handle);
@@ -3912,6 +3968,7 @@ static void wma_update_hdd_cfg(tp_wma_handle wma_handle)
wma_setup_egap_support(&tgt_cfg, wma_handle);
wma_handle->tgt_cfg_update_cb(hdd_ctx, &tgt_cfg);
+ wma_update_hdd_cfg_ndp(wma_handle, &tgt_cfg);
}
/**
@@ -4324,6 +4381,9 @@ int wma_rx_service_ready_event(void *handle, uint8_t *cmd_param_info,
return -EINVAL;
}
+ wma_handle->nan_datapath_enabled =
+ WMI_SERVICE_IS_ENABLED(wma_handle->wmi_service_bitmap,
+ WMI_SERVICE_NAN_DATA);
qdf_mem_copy(target_cap.wmi_service_bitmap,
param_buf->wmi_service_bitmap,
sizeof(wma_handle->wmi_service_bitmap));
@@ -5921,7 +5981,24 @@ QDF_STATUS wma_mc_process_msg(void *cds_context, cds_msg_t *msg)
wma_set_bpf_instructions(wma_handle, msg->bodyptr);
qdf_mem_free(msg->bodyptr);
break;
+ case SIR_HAL_NDP_INITIATOR_REQ:
+ wma_handle_ndp_initiator_req(wma_handle, msg->bodyptr);
+ qdf_mem_free(msg->bodyptr);
+ break;
+
+ case SIR_HAL_NDP_RESPONDER_REQ:
+ wma_handle_ndp_responder_req(wma_handle, msg->bodyptr);
+ break;
+ case SIR_HAL_NDP_END_REQ:
+ wma_handle_ndp_end_req(wma_handle, msg->bodyptr);
+ qdf_mem_free(msg->bodyptr);
+ break;
+ case SIR_HAL_POWER_DBG_CMD:
+ wma_process_hal_pwr_dbg_cmd(wma_handle,
+ msg->bodyptr);
+ qdf_mem_free(msg->bodyptr);
+ break;
default:
WMA_LOGD("unknow msg type %x", msg->type);
/* Do Nothing? MSG Body should be freed at here */
diff --git a/core/wma/src/wma_mgmt.c b/core/wma/src/wma_mgmt.c
index 240fa73e1f81..5d037b8b668e 100644
--- a/core/wma/src/wma_mgmt.c
+++ b/core/wma/src/wma_mgmt.c
@@ -346,6 +346,8 @@ int wma_peer_sta_kickout_event_handler(void *handle, u8 *event, u32 len)
return -ENOMEM;
}
+ del_sta_ctx->is_tdls = true;
+ del_sta_ctx->vdev_id = vdev_id;
del_sta_ctx->staId = peer_id;
qdf_mem_copy(del_sta_ctx->addr2, macaddr, IEEE80211_ADDR_LEN);
qdf_mem_copy(del_sta_ctx->bssId, wma->interfaces[vdev_id].bssid,
@@ -407,7 +409,10 @@ int wma_peer_sta_kickout_event_handler(void *handle, u8 *event, u32 len)
break;
case WMI_PEER_STA_KICKOUT_REASON_INACTIVITY:
- /* Handle SA query kickout is same as inactivity kickout */
+ /*
+ * Handle SA query kickout is same as inactivity kickout.
+ * This could be for STA or SAP role
+ */
case WMI_PEER_STA_KICKOUT_REASON_SA_QUERY_TIMEOUT:
default:
break;
@@ -423,6 +428,8 @@ int wma_peer_sta_kickout_event_handler(void *handle, u8 *event, u32 len)
return -ENOMEM;
}
+ del_sta_ctx->is_tdls = false;
+ del_sta_ctx->vdev_id = vdev_id;
del_sta_ctx->staId = peer_id;
qdf_mem_copy(del_sta_ctx->addr2, macaddr, IEEE80211_ADDR_LEN);
qdf_mem_copy(del_sta_ctx->bssId, wma->interfaces[vdev_id].addr,
@@ -662,6 +669,12 @@ void wma_set_sta_keep_alive(tp_wma_handle wma, uint8_t vdev_id,
return;
}
+ if (timeperiod > WNI_CFG_INFRA_STA_KEEP_ALIVE_PERIOD_STAMAX) {
+ WMI_LOGE("Invalid period %d Max limit %d", timeperiod,
+ WNI_CFG_INFRA_STA_KEEP_ALIVE_PERIOD_STAMAX);
+ return;
+ }
+
params.vdev_id = vdev_id;
params.method = method;
params.timeperiod = timeperiod;
@@ -1623,14 +1636,14 @@ static uint16_t wma_calc_ibss_heart_beat_timer(int16_t peer_num)
/* entry index : (the number of currently connected peers) - 1
entry value : the heart time threshold value in seconds for
detecting ibss peer departure */
- static const uint16_t heart_beat_timer[MAX_IBSS_PEERS] = {
+ static const uint16_t heart_beat_timer[MAX_PEERS] = {
4, 4, 4, 4, 4, 4, 4, 4,
8, 8, 8, 8, 8, 8, 8, 8,
12, 12, 12, 12, 12, 12, 12, 12,
16, 16, 16, 16, 16, 16, 16, 16
};
- if (peer_num < 1 || peer_num > MAX_IBSS_PEERS)
+ if (peer_num < 1 || peer_num > MAX_PEERS)
return 0;
return heart_beat_timer[peer_num - 1];
@@ -2456,10 +2469,19 @@ int wma_mgmt_tx_completion_handler(void *handle, uint8_t *cmpl_event_params,
struct wmi_desc_t *wmi_desc;
ol_txrx_pdev_handle pdev = cds_get_context(QDF_MODULE_ID_TXRX);
+ if (!pdev) {
+ WMA_LOGE("%s: txrx pdev is NULL", __func__);
+ return -EINVAL;
+ }
+
+ if (pdev == NULL) {
+ WMA_LOGE("%s: NULL pdev pointer", __func__);
+ return -EINVAL;
+ }
param_buf = (WMI_MGMT_TX_COMPLETION_EVENTID_param_tlvs *)
cmpl_event_params;
- if (!param_buf && !wma_handle) {
+ if (!param_buf || !wma_handle) {
WMA_LOGE("%s: Invalid mgmt Tx completion event", __func__);
return -EINVAL;
}
@@ -3039,7 +3061,7 @@ static int wma_mgmt_rx_process(void *handle, uint8_t *data,
}
if (cds_is_load_or_unload_in_progress()) {
- WMA_LOGE("Load/Unload in progress");
+ WMA_LOGW(FL("Load/Unload in progress"));
return -EINVAL;
}
diff --git a/core/wma/src/wma_nan_datapath.c b/core/wma/src/wma_nan_datapath.c
index 6deebb293239..60b26384d7dd 100644
--- a/core/wma/src/wma_nan_datapath.c
+++ b/core/wma/src/wma_nan_datapath.c
@@ -24,5 +24,1250 @@
* WMA NAN Data path API implementation
*/
+#include "wma.h"
+#include "wma_api.h"
+#include "wmi_unified_api.h"
+#include "wmi_unified.h"
#include "wma_nan_datapath.h"
+#include "wma_internal.h"
+#include "cds_utils.h"
+
+/**
+ * wma_handle_ndp_initiator_req() - NDP initiator request handler
+ * @wma_handle: wma handle
+ * @req: request parameters
+ *
+ * Return: QDF_STATUS_SUCCESS on success; error number otherwise
+ */
+QDF_STATUS wma_handle_ndp_initiator_req(tp_wma_handle wma_handle, void *req)
+{
+ QDF_STATUS status;
+ int ret;
+ uint16_t len;
+ uint32_t vdev_id, ndp_cfg_len, ndp_app_info_len;
+ struct ndp_initiator_rsp ndp_rsp = {0};
+ uint8_t *cfg_info, *app_info;
+ ol_txrx_vdev_handle vdev;
+ wmi_buf_t buf;
+ wmi_ndp_initiator_req_fixed_param *cmd;
+ cds_msg_t pe_msg = {0};
+ struct ndp_initiator_req *ndp_req = req;
+ wmi_channel *ch_tlv;
+
+ if (NULL == ndp_req) {
+ WMA_LOGE(FL("Invalid ndp_req."));
+ goto send_ndp_initiator_fail;
+ }
+ vdev_id = ndp_req->vdev_id;
+ vdev = wma_find_vdev_by_id(wma_handle, vdev_id);
+ if (!vdev) {
+ WMA_LOGE(FL("vdev not found for vdev id %d."), vdev_id);
+ goto send_ndp_initiator_fail;
+ }
+
+ if (!WMA_IS_VDEV_IN_NDI_MODE(wma_handle->interfaces, vdev_id)) {
+ WMA_LOGE(FL("vdev :%d, not in NDI mode"), vdev_id);
+ goto send_ndp_initiator_fail;
+ }
+
+ /*
+ * WMI command expects 4 byte alligned len:
+ * round up ndp_cfg_len and ndp_app_info_len to 4 bytes
+ */
+ ndp_cfg_len = qdf_roundup(ndp_req->ndp_config.ndp_cfg_len, 4);
+ ndp_app_info_len = qdf_roundup(ndp_req->ndp_info.ndp_app_info_len, 4);
+ /* allocated memory for fixed params as well as variable size data */
+ len = sizeof(*cmd) + ndp_cfg_len + ndp_app_info_len +
+ (2 * WMI_TLV_HDR_SIZE) + sizeof(*ch_tlv);
+ buf = wmi_buf_alloc(wma_handle->wmi_handle, len);
+ if (!buf) {
+ WMA_LOGE(FL("wmi_buf_alloc failed"));
+ goto send_ndp_initiator_fail;
+ }
+ cmd = (wmi_ndp_initiator_req_fixed_param *) wmi_buf_data(buf);
+ WMITLV_SET_HDR(&cmd->tlv_header,
+ WMITLV_TAG_STRUC_wmi_ndp_initiator_req_fixed_param,
+ WMITLV_GET_STRUCT_TLVLEN(
+ wmi_ndp_initiator_req_fixed_param));
+ cmd->vdev_id = ndp_req->vdev_id;
+ cmd->transaction_id = ndp_req->transaction_id;
+ cmd->service_instance_id = ndp_req->service_instance_id;
+ WMI_CHAR_ARRAY_TO_MAC_ADDR(ndp_req->peer_discovery_mac_addr.bytes,
+ &cmd->peer_discovery_mac_addr);
+
+ cmd->ndp_cfg_len = ndp_req->ndp_config.ndp_cfg_len;
+ cmd->ndp_app_info_len = ndp_req->ndp_info.ndp_app_info_len;
+
+ ch_tlv = (wmi_channel *)&cmd[1];
+ WMITLV_SET_HDR(ch_tlv, WMITLV_TAG_STRUC_wmi_channel,
+ WMITLV_GET_STRUCT_TLVLEN(wmi_channel));
+ ch_tlv->mhz = ndp_req->channel;
+ ch_tlv->band_center_freq1 =
+ cds_chan_to_freq(cds_freq_to_chan(ndp_req->channel));
+
+ cfg_info = (uint8_t *)&ch_tlv[1];
+ WMITLV_SET_HDR(cfg_info, WMITLV_TAG_ARRAY_BYTE, ndp_cfg_len);
+ qdf_mem_copy(&cfg_info[WMI_TLV_HDR_SIZE], ndp_req->ndp_config.ndp_cfg,
+ cmd->ndp_cfg_len);
+
+ app_info = &cfg_info[WMI_TLV_HDR_SIZE + ndp_cfg_len];
+ WMITLV_SET_HDR(app_info, WMITLV_TAG_ARRAY_BYTE, ndp_app_info_len);
+ qdf_mem_copy(&app_info[WMI_TLV_HDR_SIZE],
+ ndp_req->ndp_info.ndp_app_info,
+ cmd->ndp_app_info_len);
+
+ WMA_LOGE(FL("vdev_id = %d, transaction_id: %d, service_instance_id, %d channel: %d"),
+ cmd->vdev_id, cmd->transaction_id, cmd->service_instance_id,
+ ch_tlv->mhz);
+ WMA_LOGE(FL("peer mac addr: mac_addr31to0: 0x%x, mac_addr47to32: 0x%x"),
+ cmd->peer_discovery_mac_addr.mac_addr31to0,
+ cmd->peer_discovery_mac_addr.mac_addr47to32);
+
+ WMA_LOGE(FL("ndp_config len: %d"), cmd->ndp_cfg_len);
+ QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_DEBUG,
+ ndp_req->ndp_config.ndp_cfg,
+ ndp_req->ndp_config.ndp_cfg_len);
+
+ WMA_LOGE(FL("ndp_app_info len: %d"), cmd->ndp_app_info_len);
+ QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_DEBUG,
+ ndp_req->ndp_info.ndp_app_info,
+ ndp_req->ndp_info.ndp_app_info_len);
+
+ WMA_LOGE(FL("sending WMI_NDP_INITIATOR_REQ_CMDID(0x%X)"),
+ WMI_NDP_INITIATOR_REQ_CMDID);
+ ret = wmi_unified_cmd_send(wma_handle->wmi_handle, buf, len,
+ WMI_NDP_INITIATOR_REQ_CMDID);
+ if (ret < 0) {
+ WMA_LOGE(FL("WMI_NDP_INITIATOR_REQ_CMDID failed, ret: %d"),
+ ret);
+ wmi_buf_free(buf);
+ goto send_ndp_initiator_fail;
+ }
+
+ return QDF_STATUS_SUCCESS;
+
+send_ndp_initiator_fail:
+ status = QDF_STATUS_E_FAILURE;
+ if (ndp_req) {
+ ndp_rsp.vdev_id = ndp_req->vdev_id;
+ ndp_rsp.transaction_id = ndp_req->transaction_id;
+ ndp_rsp.ndp_instance_id = ndp_req->service_instance_id;
+ ndp_rsp.status = NDP_DATA_INITIATOR_REQ_FAILED;
+ } else {
+ /* unblock SME queue, but do not send rsp to HDD */
+ pe_msg.bodyval = true;
+ }
+
+ pe_msg.type = SIR_HAL_NDP_INITIATOR_RSP;
+ pe_msg.bodyptr = &ndp_rsp;
+ return wma_handle->pe_ndp_event_handler(wma_handle->mac_context,
+ &pe_msg);
+}
+
+/**
+ * wma_handle_ndp_responder_req() - NDP responder request handler
+ * @wma_handle: wma handle
+ * @req_params: request parameters
+ *
+ * Return: QDF_STATUS_SUCCESS on success; error number otherwise
+ */
+QDF_STATUS wma_handle_ndp_responder_req(tp_wma_handle wma_handle,
+ struct ndp_responder_req *req_params)
+{
+ wmi_buf_t buf;
+ ol_txrx_vdev_handle vdev;
+ uint32_t vdev_id = 0, ndp_cfg_len, ndp_app_info_len;
+ uint8_t *cfg_info, *app_info;
+ int ret;
+ wmi_ndp_responder_req_fixed_param *cmd;
+ uint16_t len;
+ struct ndp_responder_rsp_event rsp = {0};
+ cds_msg_t pe_msg = {0};
+
+ if (NULL == req_params) {
+ WMA_LOGE(FL("Invalid req_params."));
+ return QDF_STATUS_E_INVAL;
+ }
+
+ vdev_id = req_params->vdev_id;
+ WMA_LOGD(FL("vdev_id: %d, transaction_id: %d, ndp_rsp %d, ndp_instance_id: %d, ndp_app_info_len: %d"),
+ req_params->vdev_id, req_params->transaction_id,
+ req_params->ndp_rsp,
+ req_params->ndp_instance_id,
+ req_params->ndp_info.ndp_app_info_len);
+ vdev = wma_find_vdev_by_id(wma_handle, vdev_id);
+ if (!vdev) {
+ WMA_LOGE(FL("vdev not found for vdev id %d."), vdev_id);
+ goto send_ndp_responder_fail;
+ }
+
+ if (!WMA_IS_VDEV_IN_NDI_MODE(wma_handle->interfaces, vdev_id)) {
+ WMA_LOGE(FL("vdev :$%d, not in NDI mode"), vdev_id);
+ goto send_ndp_responder_fail;
+ }
+
+ /*
+ * WMI command expects 4 byte alligned len:
+ * round up ndp_cfg_len and ndp_app_info_len to 4 bytes
+ */
+ ndp_cfg_len = qdf_roundup(req_params->ndp_config.ndp_cfg_len, 4);
+ ndp_app_info_len =
+ qdf_roundup(req_params->ndp_info.ndp_app_info_len, 4);
+ /* allocated memory for fixed params as well as variable size data */
+ len = sizeof(*cmd) + ndp_cfg_len + ndp_app_info_len +
+ (2 * WMI_TLV_HDR_SIZE);
+ buf = wmi_buf_alloc(wma_handle->wmi_handle, len);
+ if (!buf) {
+ WMA_LOGE(FL("wmi_buf_alloc failed"));
+ goto send_ndp_responder_fail;
+ }
+ cmd = (wmi_ndp_responder_req_fixed_param *) wmi_buf_data(buf);
+ WMITLV_SET_HDR(&cmd->tlv_header,
+ WMITLV_TAG_STRUC_wmi_ndp_responder_req_fixed_param,
+ WMITLV_GET_STRUCT_TLVLEN(
+ wmi_ndp_responder_req_fixed_param));
+ cmd->vdev_id = req_params->vdev_id;
+ cmd->transaction_id = req_params->transaction_id;
+ cmd->ndp_instance_id = req_params->ndp_instance_id;
+ cmd->rsp_code = req_params->ndp_rsp;
+
+ cmd->ndp_cfg_len = req_params->ndp_config.ndp_cfg_len;
+ cmd->ndp_app_info_len = req_params->ndp_info.ndp_app_info_len;
+
+ cfg_info = (uint8_t *)&cmd[1];
+ /* WMI command expects 4 byte alligned len */
+ WMITLV_SET_HDR(cfg_info, WMITLV_TAG_ARRAY_BYTE, ndp_cfg_len);
+ qdf_mem_copy(&cfg_info[WMI_TLV_HDR_SIZE],
+ req_params->ndp_config.ndp_cfg, cmd->ndp_cfg_len);
+
+ app_info = &cfg_info[WMI_TLV_HDR_SIZE + ndp_cfg_len];
+ /* WMI command expects 4 byte alligned len */
+ WMITLV_SET_HDR(app_info, WMITLV_TAG_ARRAY_BYTE, ndp_app_info_len);
+ qdf_mem_copy(&app_info[WMI_TLV_HDR_SIZE],
+ req_params->ndp_info.ndp_app_info,
+ req_params->ndp_info.ndp_app_info_len);
+
+ WMA_LOGD(FL("ndp_config len: %d"),
+ req_params->ndp_config.ndp_cfg_len);
+ QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_DEBUG,
+ req_params->ndp_config.ndp_cfg,
+ req_params->ndp_config.ndp_cfg_len);
+
+ WMA_LOGD(FL("ndp_app_info len: %d"),
+ req_params->ndp_info.ndp_app_info_len);
+ QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_DEBUG,
+ req_params->ndp_info.ndp_app_info,
+ req_params->ndp_info.ndp_app_info_len);
+
+ ret = wmi_unified_cmd_send(wma_handle->wmi_handle, buf, len,
+ WMI_NDP_RESPONDER_REQ_CMDID);
+ if (ret < 0) {
+ WMA_LOGE(FL("WMI_NDP_RESPONDER_REQ_CMDID failed, ret: %d"),
+ ret);
+ wmi_buf_free(buf);
+ goto send_ndp_responder_fail;
+ }
+ return QDF_STATUS_SUCCESS;
+send_ndp_responder_fail:
+ qdf_mem_zero(&rsp, sizeof(rsp));
+ rsp.vdev_id = req_params->vdev_id;
+ rsp.transaction_id = req_params->transaction_id;
+ rsp.status = NDP_RSP_STATUS_ERROR;
+ rsp.reason = NDP_DATA_RESPONDER_REQ_FAILED;
+
+ pe_msg.bodyptr = &rsp;
+ pe_msg.type = SIR_HAL_NDP_RESPONDER_RSP;
+ return wma_handle->pe_ndp_event_handler(wma_handle->mac_context,
+ &pe_msg);
+}
+
+/**
+ * wma_handle_ndp_end_req() - NDP end request handler
+ * @wma_handle: wma handle
+ * @ptr: request parameters
+ *
+ * Return: QDF_STATUS_SUCCESS on success; error number otherwise
+ */
+QDF_STATUS wma_handle_ndp_end_req(tp_wma_handle wma_handle, void *ptr)
+{
+ int ret;
+ uint16_t len;
+ uint32_t ndp_end_req_len, i;
+ wmi_ndp_end_req *ndp_end_req_lst;
+ wmi_buf_t buf;
+ cds_msg_t pe_msg = {0};
+ wmi_ndp_end_req_fixed_param *cmd;
+ struct ndp_end_rsp_event end_rsp = {0};
+ struct ndp_end_req *req = ptr;
+
+ if (NULL == req) {
+ WMA_LOGE(FL("Invalid ndp_end_req"));
+ goto send_ndp_end_fail;
+ }
+
+ /* len of tlv following fixed param */
+ ndp_end_req_len = sizeof(wmi_ndp_end_req) * req->num_ndp_instances;
+ /* above comes out to 4 byte alligned already, no need of padding */
+ len = sizeof(*cmd) + ndp_end_req_len + WMI_TLV_HDR_SIZE;
+ buf = wmi_buf_alloc(wma_handle->wmi_handle, len);
+ if (!buf) {
+ WMA_LOGE(FL("Malloc failed"));
+ return QDF_STATUS_E_NOMEM;
+ }
+ cmd = (wmi_ndp_end_req_fixed_param *) wmi_buf_data(buf);
+
+ WMITLV_SET_HDR(&cmd->tlv_header,
+ WMITLV_TAG_STRUC_wmi_ndp_end_req_fixed_param,
+ WMITLV_GET_STRUCT_TLVLEN(wmi_ndp_end_req_fixed_param));
+
+ cmd->transaction_id = req->transaction_id;
+
+ /* set tlv pointer to end of fixed param */
+ WMITLV_SET_HDR((uint8_t *)&cmd[1], WMITLV_TAG_ARRAY_STRUC,
+ ndp_end_req_len);
+
+ ndp_end_req_lst = (wmi_ndp_end_req *)((uint8_t *)&cmd[1] +
+ WMI_TLV_HDR_SIZE);
+ for (i = 0; i < req->num_ndp_instances; i++) {
+ WMITLV_SET_HDR(&ndp_end_req_lst[i],
+ WMITLV_TAG_ARRAY_FIXED_STRUC,
+ (sizeof(*ndp_end_req_lst) - WMI_TLV_HDR_SIZE));
+
+ ndp_end_req_lst[i].ndp_instance_id = req->ndp_ids[i];
+ }
+
+ WMA_LOGD(FL("Sending WMI_NDP_END_REQ_CMDID to FW"));
+ ret = wmi_unified_cmd_send(wma_handle->wmi_handle, buf, len,
+ WMI_NDP_END_REQ_CMDID);
+ if (ret < 0) {
+ WMA_LOGE(FL("WMI_NDP_END_REQ_CMDID failed, ret: %d"), ret);
+ wmi_buf_free(buf);
+ goto send_ndp_end_fail;
+ }
+ return QDF_STATUS_SUCCESS;
+
+send_ndp_end_fail:
+ pe_msg.type = SIR_HAL_NDP_END_RSP;
+ if (req) {
+ end_rsp.status = NDP_RSP_STATUS_ERROR;
+ end_rsp.reason = NDP_END_FAILED;
+ end_rsp.transaction_id = req->transaction_id;
+ pe_msg.bodyptr = &end_rsp;
+ } else {
+ pe_msg.bodyval = true;
+ }
+
+ wma_handle->pe_ndp_event_handler(wma_handle->mac_context, &pe_msg);
+ return QDF_STATUS_E_FAILURE;
+}
+
+/**
+ * wma_handle_ndp_sched_update_req() - NDP schedule update request handler
+ * @wma_handle: wma handle
+ * @req_params: request parameters
+ *
+ * Return: QDF_STATUS_SUCCESS on success; error number otherwise
+ */
+QDF_STATUS wma_handle_ndp_sched_update_req(tp_wma_handle wma_handle,
+ struct ndp_end_req *req_params)
+{
+ return QDF_STATUS_SUCCESS;
+}
+
+/**
+ * wma_ndp_indication_event_handler() - NDP indication event handler
+ * @handle: wma handle
+ * @event_info: event handler data
+ * @len: length of event_info
+ *
+ * Handler for WMI_NDP_INDICATION_EVENTID
+ * Return: 0 on success, negative errno on failure
+ */
+static int wma_ndp_indication_event_handler(void *handle, uint8_t *event_info,
+ uint32_t len)
+{
+ cds_msg_t pe_msg = {0};
+ WMI_NDP_INDICATION_EVENTID_param_tlvs *event;
+ wmi_ndp_indication_event_fixed_param *fixed_params;
+ struct ndp_indication_event ind_event = {0};
+ tp_wma_handle wma_handle = handle;
+
+ event = (WMI_NDP_INDICATION_EVENTID_param_tlvs *)event_info;
+ fixed_params =
+ (wmi_ndp_indication_event_fixed_param *)event->fixed_param;
+
+ ind_event.vdev_id = fixed_params->vdev_id;
+ ind_event.service_instance_id = fixed_params->service_instance_id;
+ ind_event.ndp_instance_id = fixed_params->ndp_instance_id;
+ ind_event.role = fixed_params->self_ndp_role;
+ ind_event.policy = fixed_params->accept_policy;
+
+ WMI_MAC_ADDR_TO_CHAR_ARRAY(&fixed_params->peer_ndi_mac_addr,
+ ind_event.peer_mac_addr.bytes);
+ WMI_MAC_ADDR_TO_CHAR_ARRAY(&fixed_params->peer_discovery_mac_addr,
+ ind_event.peer_discovery_mac_addr.bytes);
+
+ WMA_LOGD(FL("WMI_NDP_INDICATION_EVENTID(0x%X) received. vdev %d, service_instance %d, ndp_instance %d, role %d, policy %d, peer_mac_addr: %pM, peer_disc_mac_addr: %pM"),
+ WMI_NDP_INDICATION_EVENTID, fixed_params->vdev_id,
+ fixed_params->service_instance_id,
+ fixed_params->ndp_instance_id, fixed_params->self_ndp_role,
+ fixed_params->accept_policy,
+ ind_event.peer_mac_addr.bytes,
+ ind_event.peer_discovery_mac_addr.bytes);
+
+ WMA_LOGD(FL("ndp_cfg - %d bytes"), fixed_params->ndp_cfg_len);
+ QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_DEBUG,
+ &event->ndp_cfg, fixed_params->ndp_cfg_len);
+
+ WMA_LOGD(FL("ndp_app_info - %d bytes"), fixed_params->ndp_app_info_len);
+ QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_DEBUG,
+ &event->ndp_app_info, fixed_params->ndp_app_info_len);
+
+ ind_event.ndp_config.ndp_cfg_len = fixed_params->ndp_cfg_len;
+ ind_event.ndp_info.ndp_app_info_len = fixed_params->ndp_app_info_len;
+
+ if (ind_event.ndp_config.ndp_cfg_len) {
+ ind_event.ndp_config.ndp_cfg =
+ qdf_mem_malloc(fixed_params->ndp_cfg_len);
+ if (NULL == ind_event.ndp_config.ndp_cfg) {
+ WMA_LOGE(FL("malloc failed"));
+ return QDF_STATUS_E_NOMEM;
+ }
+ qdf_mem_copy(ind_event.ndp_config.ndp_cfg, event->ndp_cfg,
+ ind_event.ndp_config.ndp_cfg_len);
+ }
+
+ if (ind_event.ndp_info.ndp_app_info_len) {
+ ind_event.ndp_info.ndp_app_info =
+ qdf_mem_malloc(ind_event.ndp_info.ndp_app_info_len);
+ if (NULL == ind_event.ndp_info.ndp_app_info) {
+ WMA_LOGE(FL("malloc failed"));
+ qdf_mem_free(ind_event.ndp_config.ndp_cfg);
+ return QDF_STATUS_E_NOMEM;
+ }
+ qdf_mem_copy(ind_event.ndp_info.ndp_app_info,
+ event->ndp_app_info,
+ ind_event.ndp_info.ndp_app_info_len);
+ }
+
+ pe_msg.type = SIR_HAL_NDP_INDICATION;
+ pe_msg.bodyptr = &ind_event;
+ return wma_handle->pe_ndp_event_handler(wma_handle->mac_context,
+ &pe_msg);
+}
+
+/**
+ * wma_ndp_responder_rsp_event_handler() - NDP responder response event handler
+ * @handle: wma handle
+ * @event_info: event handler data
+ * @len: length of event_info
+ *
+ * Handler for WMI_NDP_RESPONDER_RSP_EVENTID
+ * Return: 0 on success, negative errno on failure
+ */
+static int wma_ndp_responder_rsp_event_handler(void *handle,
+ uint8_t *event_info, uint32_t len)
+{
+ cds_msg_t pe_msg = {0};
+ tp_wma_handle wma_handle = handle;
+ WMI_NDP_RESPONDER_RSP_EVENTID_param_tlvs *event;
+ wmi_ndp_responder_rsp_event_fixed_param *fixed_params;
+ struct ndp_responder_rsp_event rsp = {0};
+
+ event = (WMI_NDP_RESPONDER_RSP_EVENTID_param_tlvs *)event_info;
+ fixed_params = event->fixed_param;
+
+ rsp.vdev_id = fixed_params->vdev_id;
+ rsp.transaction_id = fixed_params->transaction_id;
+ rsp.reason = fixed_params->reason_code;
+ rsp.status = fixed_params->rsp_status;
+ WMI_MAC_ADDR_TO_CHAR_ARRAY(&fixed_params->peer_ndi_mac_addr,
+ rsp.peer_mac_addr.bytes);
+ pe_msg.bodyptr = &rsp;
+ pe_msg.type = SIR_HAL_NDP_RESPONDER_RSP;
+ return wma_handle->pe_ndp_event_handler(wma_handle->mac_context,
+ &pe_msg);
+}
+
+/**
+ * wma_ndp_confirm_event_handler() - NDP confirm event handler
+ * @handle: wma handle
+ * @event_info: event handler data
+ * @len: length of event_info
+ *
+ * Handler for WMI_NDP_CONFIRM_EVENTID
+ * Return: 0 on success, negative errno on failure
+ */
+static int wma_ndp_confirm_event_handler(void *handle, uint8_t *event_info,
+ uint32_t len)
+{
+ struct ndp_confirm_event ndp_confirm = {0};
+ cds_msg_t msg = {0};
+ WMI_NDP_CONFIRM_EVENTID_param_tlvs *event;
+ wmi_ndp_confirm_event_fixed_param *fixed_params;
+ tp_wma_handle wma_handle = handle;
+
+ event = (WMI_NDP_CONFIRM_EVENTID_param_tlvs *) event_info;
+ fixed_params = (wmi_ndp_confirm_event_fixed_param *)event->fixed_param;
+ WMA_LOGE(FL("WMI_NDP_CONFIRM_EVENTID(0x%X) recieved. vdev %d, ndp_instance %d, rsp_code %d, reason_code: %d, num_active_ndps_on_peer: %d"),
+ WMI_NDP_CONFIRM_EVENTID, fixed_params->vdev_id,
+ fixed_params->ndp_instance_id, fixed_params->rsp_code,
+ fixed_params->reason_code,
+ fixed_params->num_active_ndps_on_peer);
+
+ WMA_LOGE(FL("ndp_cfg - %d bytes"), fixed_params->ndp_cfg_len);
+ QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_DEBUG,
+ &event->ndp_cfg, fixed_params->ndp_cfg_len);
+
+ WMA_LOGE(FL("ndp_app_info - %d bytes"), fixed_params->ndp_app_info_len);
+ QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_DEBUG,
+ &event->ndp_app_info, fixed_params->ndp_app_info_len);
+
+ ndp_confirm.vdev_id = fixed_params->vdev_id;
+ ndp_confirm.ndp_instance_id = fixed_params->ndp_instance_id;
+ ndp_confirm.rsp_code = fixed_params->rsp_code;
+ ndp_confirm.reason_code = fixed_params->reason_code;
+ ndp_confirm.num_active_ndps_on_peer =
+ fixed_params->num_active_ndps_on_peer;
+
+ WMI_MAC_ADDR_TO_CHAR_ARRAY(&fixed_params->peer_ndi_mac_addr,
+ ndp_confirm.peer_ndi_mac_addr.bytes);
+
+ ndp_confirm.ndp_info.ndp_app_info_len = fixed_params->ndp_app_info_len;
+
+ if (ndp_confirm.ndp_info.ndp_app_info_len) {
+ ndp_confirm.ndp_info.ndp_app_info =
+ qdf_mem_malloc(fixed_params->ndp_app_info_len);
+ if (NULL == ndp_confirm.ndp_info.ndp_app_info) {
+ WMA_LOGE(FL("malloc failed"));
+ return QDF_STATUS_E_NOMEM;
+ }
+ qdf_mem_copy(&ndp_confirm.ndp_info.ndp_app_info,
+ event->ndp_app_info,
+ ndp_confirm.ndp_info.ndp_app_info_len);
+ }
+ msg.type = SIR_HAL_NDP_CONFIRM;
+ msg.bodyptr = &ndp_confirm;
+ return wma_handle->pe_ndp_event_handler(wma_handle->mac_context, &msg);
+}
+
+/**
+ * wma_ndp_end_response_event_handler() - NDP end response event handler
+ * @handle: wma handle
+ * @event_info: event handler data
+ * @len: length of event_info
+ *
+ * Handler for WMI_NDP_END_RSP_EVENTID
+ * Return: 0 on success, negative errno on failure
+ */
+static int wma_ndp_end_response_event_handler(void *handle,
+ uint8_t *event_info, uint32_t len)
+{
+ int ret = 0;
+ QDF_STATUS status;
+ cds_msg_t pe_msg = {0};
+ struct ndp_end_rsp_event *end_rsp;
+ WMI_NDP_END_RSP_EVENTID_param_tlvs *event;
+ wmi_ndp_end_rsp_event_fixed_param *fixed_params = NULL;
+ wmi_ndp_end_rsp_per_ndi *end_rsp_tlv;
+ uint32_t i;
+ uint32_t len_end_rsp;
+ tp_wma_handle wma_handle = handle;
+
+ event = (WMI_NDP_END_RSP_EVENTID_param_tlvs *) event_info;
+ fixed_params = (wmi_ndp_end_rsp_event_fixed_param *)event->fixed_param;
+ WMA_LOGD(FL("WMI_NDP_END_RSP_EVENTID(0x%X) recieved. transaction_id: %d, rsp_status: %d, reason_code: %d"),
+ WMI_NDP_END_RSP_EVENTID, fixed_params->transaction_id,
+ fixed_params->rsp_status, fixed_params->reason_code);
+
+ len_end_rsp = sizeof(*end_rsp) + (event->num_ndp_end_rsp_per_ndi_list *
+ sizeof(struct peer_ndp_map));
+ end_rsp = qdf_mem_malloc(len_end_rsp);
+ if (NULL == end_rsp) {
+ WMA_LOGE("malloc failed");
+ pe_msg.bodyval = true;
+ ret = -ENOMEM;
+ goto send_ndp_end_rsp;
+ }
+ pe_msg.bodyptr = end_rsp;
+ qdf_mem_zero(end_rsp, len_end_rsp);
+
+ end_rsp->transaction_id = fixed_params->transaction_id;
+ end_rsp->reason = fixed_params->reason_code;
+ end_rsp->status = fixed_params->rsp_status;
+
+ if (end_rsp->status == NDP_CMD_RSP_STATUS_SUCCESS) {
+ WMA_LOGD(FL("NDP end rsp, num_peers: %d"),
+ event->num_ndp_end_rsp_per_ndi_list);
+ end_rsp->num_peers = event->num_ndp_end_rsp_per_ndi_list;
+ if (end_rsp->num_peers == 0) {
+ WMA_LOGE(FL("num_peers in NDP rsp should not be 0."));
+ end_rsp->status = NDP_CMD_RSP_STATUS_ERROR;
+ end_rsp->reason = NDP_END_FAILED;
+ goto send_ndp_end_rsp;
+ }
+ /* copy per peer response to return path buffer */
+ end_rsp_tlv = event->ndp_end_rsp_per_ndi_list;
+ for (i = 0; i < end_rsp->num_peers; i++) {
+ end_rsp->ndp_map[i].vdev_id = end_rsp_tlv[i].vdev_id;
+ WMI_MAC_ADDR_TO_CHAR_ARRAY(
+ &end_rsp_tlv[i].peer_mac_addr,
+ end_rsp->ndp_map[i].peer_ndi_mac_addr.bytes);
+ end_rsp->ndp_map[i].num_active_ndp_sessions =
+ end_rsp_tlv[i].num_active_ndps_on_ndi;
+ WMA_LOGD(FL("vdev_id: %d, peer_addr: %pM, active_ndp_left: %d"),
+ end_rsp->ndp_map[i].vdev_id,
+ &end_rsp->ndp_map[i].peer_ndi_mac_addr,
+ end_rsp->ndp_map[i].num_active_ndp_sessions);
+ }
+ }
+
+send_ndp_end_rsp:
+ pe_msg.type = SIR_HAL_NDP_END_RSP;
+ status = wma_handle->pe_ndp_event_handler(wma_handle->mac_context,
+ &pe_msg);
+ if (!QDF_IS_STATUS_SUCCESS(status))
+ ret = -EINVAL;
+
+ qdf_mem_free(end_rsp);
+ return ret;
+}
+
+/**
+ * wma_ndp_end_indication_event_handler() - NDP end indication event handler
+ * @handle: wma handle
+ * @event_info: event handler data
+ * @len: length of event_info
+ *
+ * Handler for WMI_NDP_END_INDICATION_EVENTID
+ * Return: 0 on success, negative errno on failure
+ */
+static int wma_ndp_end_indication_event_handler(void *handle,
+ uint8_t *event_info, uint32_t len)
+{
+ tp_wma_handle wma_handle = handle;
+ WMI_NDP_END_INDICATION_EVENTID_param_tlvs *event;
+ wmi_ndp_end_indication *ind;
+ cds_msg_t pe_msg;
+ struct ndp_end_indication_event *ndp_event_buf;
+ int i, ret, buf_size;
+ struct qdf_mac_addr peer_addr;
+
+ event = (WMI_NDP_END_INDICATION_EVENTID_param_tlvs *) event_info;
+
+ if (event->num_ndp_end_indication_list == 0) {
+ WMA_LOGE(
+ FL("Error: Event ignored, 0 ndp instances"));
+ return -EINVAL;
+ }
+
+ WMA_LOGD(FL("number of ndp instances = %d"),
+ event->num_ndp_end_indication_list);
+
+ buf_size = sizeof(*ndp_event_buf) + event->num_ndp_end_indication_list *
+ sizeof(ndp_event_buf->ndp_map[0]);
+ ndp_event_buf = qdf_mem_malloc(buf_size);
+ if (!ndp_event_buf) {
+ WMA_LOGP(FL("Failed to allocate memory"));
+ return -ENOMEM;
+ }
+ qdf_mem_zero(ndp_event_buf, buf_size);
+ ndp_event_buf->num_ndp_ids = event->num_ndp_end_indication_list;
+
+ ind = event->ndp_end_indication_list;
+ for (i = 0; i < ndp_event_buf->num_ndp_ids; i++) {
+ WMI_MAC_ADDR_TO_CHAR_ARRAY(
+ &ind[i].peer_ndi_mac_addr,
+ peer_addr.bytes);
+ WMA_LOGD(
+ FL("ind[%d]: type %d, reason_code %d, instance_id %d num_active %d MAC: " MAC_ADDRESS_STR),
+ i,
+ ind[i].type,
+ ind[i].reason_code,
+ ind[i].ndp_instance_id,
+ ind[i].num_active_ndps_on_peer,
+ MAC_ADDR_ARRAY(peer_addr.bytes));
+
+ /* Add each instance entry to the list */
+ ndp_event_buf->ndp_map[i].ndp_instance_id =
+ ind[i].ndp_instance_id;
+ ndp_event_buf->ndp_map[i].vdev_id = ind[i].vdev_id;
+ WMI_MAC_ADDR_TO_CHAR_ARRAY(&ind[i].peer_ndi_mac_addr,
+ ndp_event_buf->ndp_map[i].peer_ndi_mac_addr.bytes);
+ ndp_event_buf->ndp_map[i].num_active_ndp_sessions =
+ ind[i].num_active_ndps_on_peer;
+ ndp_event_buf->ndp_map[i].type = ind[i].type;
+ ndp_event_buf->ndp_map[i].reason_code =
+ ind[i].reason_code;
+ }
+
+ pe_msg.type = SIR_HAL_NDP_END_IND;
+ pe_msg.bodyptr = ndp_event_buf;
+ pe_msg.bodyval = 0;
+ ret = wma_handle->pe_ndp_event_handler(wma_handle->mac_context,
+ &pe_msg);
+ qdf_mem_free(ndp_event_buf);
+ return ret;
+}
+
+/**
+ * wma_ndp_initiator_rsp_event_handler() -NDP initiator rsp event handler
+ * @handle: wma handle
+ * @event_info: event handler data
+ * @len: length of event_info
+ *
+ * Handler for WMI_NDP_INITIATOR_RSP_EVENTID
+ * Return: 0 on success, negative errno on failure
+ */
+static int wma_ndp_initiator_rsp_event_handler(void *handle,
+ uint8_t *event_info, uint32_t len)
+{
+ cds_msg_t pe_msg = {0};
+ WMI_NDP_INITIATOR_RSP_EVENTID_param_tlvs *event;
+ wmi_ndp_initiator_rsp_event_fixed_param *fixed_params;
+ struct ndp_initiator_rsp ndp_rsp = {0};
+ tp_wma_handle wma_handle = handle;
+
+ event = (WMI_NDP_INITIATOR_RSP_EVENTID_param_tlvs *)event_info;
+ fixed_params = event->fixed_param;
+
+ ndp_rsp.vdev_id = fixed_params->vdev_id;
+ ndp_rsp.transaction_id = fixed_params->transaction_id;
+ ndp_rsp.ndp_instance_id = fixed_params->ndp_instance_id;
+ ndp_rsp.status = fixed_params->rsp_status;
+ ndp_rsp.reason = fixed_params->reason_code;
+
+ pe_msg.type = SIR_HAL_NDP_INITIATOR_RSP;
+ pe_msg.bodyptr = &ndp_rsp;
+ return wma_handle->pe_ndp_event_handler(wma_handle->mac_context,
+ &pe_msg);
+}
+
+/**
+ * wma_ndp_register_all_event_handlers() - Register all NDP event handlers
+ * @wma_handle: WMA context
+ *
+ * Register the handlers for NAN datapath events from firmware.
+ *
+ * Return: None
+ */
+void wma_ndp_register_all_event_handlers(tp_wma_handle wma_handle)
+{
+ WMA_LOGD(FL("Register WMI_NDP_INITIATOR_RSP_EVENTID"));
+ wmi_unified_register_event_handler(wma_handle->wmi_handle,
+ WMI_NDP_INITIATOR_RSP_EVENTID,
+ wma_ndp_initiator_rsp_event_handler,
+ WMA_RX_SERIALIZER_CTX);
+
+ WMA_LOGD(FL("Register WMI_NDP_RESPONDER_RSP_EVENTID"));
+ wmi_unified_register_event_handler(wma_handle->wmi_handle,
+ WMI_NDP_RESPONDER_RSP_EVENTID,
+ wma_ndp_responder_rsp_event_handler,
+ WMA_RX_SERIALIZER_CTX);
+
+ WMA_LOGD(FL("Register WMI_NDP_END_RSP_EVENTID"));
+ wmi_unified_register_event_handler(wma_handle->wmi_handle,
+ WMI_NDP_END_RSP_EVENTID,
+ wma_ndp_end_response_event_handler,
+ WMA_RX_SERIALIZER_CTX);
+
+ WMA_LOGD(FL("Register WMI_NDP_INDICATION_EVENTID"));
+ wmi_unified_register_event_handler(wma_handle->wmi_handle,
+ WMI_NDP_INDICATION_EVENTID,
+ wma_ndp_indication_event_handler,
+ WMA_RX_SERIALIZER_CTX);
+
+ WMA_LOGD(FL("Register WMI_NDP_CONFIRM_EVENTID"));
+ wmi_unified_register_event_handler(wma_handle->wmi_handle,
+ WMI_NDP_CONFIRM_EVENTID,
+ wma_ndp_confirm_event_handler,
+ WMA_RX_SERIALIZER_CTX);
+
+ WMA_LOGD(FL("Register WMI_NDP_END_INDICATION_EVENTID"));
+ wmi_unified_register_event_handler(wma_handle->wmi_handle,
+ WMI_NDP_END_INDICATION_EVENTID,
+ wma_ndp_end_indication_event_handler,
+ WMA_RX_SERIALIZER_CTX);
+}
+
+/**
+ * wma_ndp_unregister_all_event_handlers() - Unregister all NDP event handlers
+ * @wma_handle: WMA context
+ *
+ * Register the handlers for NAN datapath events from firmware.
+ *
+ * Return: None
+ */
+void wma_ndp_unregister_all_event_handlers(tp_wma_handle wma_handle)
+{
+ WMA_LOGD(FL("Unregister WMI_NDP_INITIATOR_RSP_EVENTID"));
+ wmi_unified_unregister_event_handler(wma_handle->wmi_handle,
+ WMI_NDP_INITIATOR_RSP_EVENTID);
+
+ WMA_LOGD(FL("Unregister WMI_NDP_RESPONDER_RSP_EVENTID"));
+ wmi_unified_unregister_event_handler(wma_handle->wmi_handle,
+ WMI_NDP_RESPONDER_RSP_EVENTID);
+
+ WMA_LOGD(FL("Unregister WMI_NDP_END_RSP_EVENTID"));
+ wmi_unified_unregister_event_handler(wma_handle->wmi_handle,
+ WMI_NDP_END_RSP_EVENTID);
+
+ WMA_LOGD(FL("Unregister WMI_NDP_INDICATION_EVENTID"));
+ wmi_unified_unregister_event_handler(wma_handle->wmi_handle,
+ WMI_NDP_INDICATION_EVENTID);
+
+ WMA_LOGD(FL("Unregister WMI_NDP_CONFIRM_EVENTID"));
+ wmi_unified_unregister_event_handler(wma_handle->wmi_handle,
+ WMI_NDP_CONFIRM_EVENTID);
+
+ WMA_LOGD(FL("Unregister WMI_NDP_END_INDICATION_EVENTID"));
+ wmi_unified_unregister_event_handler(wma_handle->wmi_handle,
+ WMI_NDP_END_INDICATION_EVENTID);
+}
+
+/**
+ * wma_ndp_add_wow_wakeup_event() - Add Wake on Wireless event for NDP
+ * @wma_handle: WMA context
+ * @vdev_id: vdev id
+ *
+ * Enables the firmware to wake up the host on NAN data path event.
+ * All NDP events such as NDP_INDICATION, NDP_CONFIRM, etc. use the
+ * same event. They can be distinguished using their TLV tags.
+ *
+ * Return: none
+ */
+void wma_ndp_add_wow_wakeup_event(tp_wma_handle wma_handle,
+ uint8_t vdev_id)
+{
+ uint32_t event_bitmap;
+ event_bitmap = (1 << WOW_NAN_DATA_EVENT);
+ WMA_LOGI("NDI specific default wake up event 0x%x vdev id %d",
+ event_bitmap, vdev_id);
+ wma_add_wow_wakeup_event(wma_handle, vdev_id, event_bitmap, true);
+}
+
+/**
+ * wma_ndp_get_eventid_from_tlvtag() - map tlv tag to event id
+ * @tag: WMI TLV tag
+ *
+ * map the tag to known NDP event fixed_param tags and return the
+ * corresponding NDP event id.
+ *
+ * Return: 0 if TLV tag is invalid
+ * else return corresponding WMI event id
+ */
+static int wma_ndp_get_eventid_from_tlvtag(uint32_t tag)
+{
+ uint32_t event_id;
+
+ switch (tag) {
+ case WMITLV_TAG_STRUC_wmi_ndp_initiator_rsp_event_fixed_param:
+ event_id = WMI_NDP_INITIATOR_RSP_EVENTID;
+ break;
+
+ case WMITLV_TAG_STRUC_wmi_ndp_responder_rsp_event_fixed_param:
+ event_id = WMI_NDP_RESPONDER_RSP_EVENTID;
+ break;
+
+ case WMITLV_TAG_STRUC_wmi_ndp_end_rsp_event_fixed_param:
+ event_id = WMI_NDP_END_RSP_EVENTID;
+ break;
+
+ case WMITLV_TAG_STRUC_wmi_ndp_indication_event_fixed_param:
+ event_id = WMI_NDP_INDICATION_EVENTID;
+ break;
+
+ case WMITLV_TAG_STRUC_wmi_ndp_confirm_event_fixed_param:
+ event_id = WMI_NDP_CONFIRM_EVENTID;
+ break;
+
+ case WMITLV_TAG_STRUC_wmi_ndp_end_indication_event_fixed_param:
+ event_id = WMI_NDP_END_INDICATION_EVENTID;
+ break;
+
+ default:
+ event_id = 0;
+ WMA_LOGE(FL("Unknown tag: %d"), tag);
+ break;
+ }
+
+ WMA_LOGI(FL("For tag %d WMI event 0x%x"), tag, event_id);
+ return event_id;
+}
+
+/**
+ * wma_ndp_wow_event_callback() - NAN data path wow event callback
+ * @handle: WMA handle
+ * @event: event buffer
+ * @len: length of @event buffer
+ *
+ * The wow event WOW_REASON_NAN_DATA is followed by the payload of the event
+ * which generated the wow event.
+ * Payload is 4 bytes of length followed by event buffer. First 4 bytes
+ * of event buffer is common tlv header, which is a combination
+ * of tag (higher 2 bytes) and length (lower 2 bytes). The tag is used to
+ * identify the event which triggered wow event.
+ *
+ * Return: none
+ */
+void wma_ndp_wow_event_callback(void *handle, void *event,
+ uint32_t len)
+{
+ uint32_t id;
+ int tlv_ok_status = 0;
+ void *wmi_cmd_struct_ptr = NULL;
+ uint32_t tag = WMITLV_GET_TLVTAG(WMITLV_GET_HDR(event));
+
+ /* Reverse map fixed params tag to EVENT_ID */
+ id = wma_ndp_get_eventid_from_tlvtag(tag);
+ if (!id) {
+ WMA_LOGE(FL("Invalid Tag: %d"), tag);
+ return;
+ }
+
+ tlv_ok_status = wmitlv_check_and_pad_event_tlvs(handle, event, len,
+ id,
+ &wmi_cmd_struct_ptr);
+ if (tlv_ok_status != 0) {
+ WMA_LOGE(FL("Invalid Tag: %d could not check and pad tlvs"),
+ tag);
+ return;
+ }
+
+ switch (id) {
+ case WMI_NDP_INITIATOR_RSP_EVENTID:
+ wma_ndp_initiator_rsp_event_handler(handle,
+ wmi_cmd_struct_ptr, len);
+ break;
+
+ case WMI_NDP_RESPONDER_RSP_EVENTID:
+ wma_ndp_responder_rsp_event_handler(handle,
+ wmi_cmd_struct_ptr, len);
+ break;
+
+ case WMI_NDP_END_RSP_EVENTID:
+ wma_ndp_end_response_event_handler(handle,
+ wmi_cmd_struct_ptr, len);
+ break;
+
+ case WMI_NDP_INDICATION_EVENTID:
+ wma_ndp_indication_event_handler(handle,
+ wmi_cmd_struct_ptr, len);
+ break;
+
+ case WMI_NDP_CONFIRM_EVENTID:
+ wma_ndp_confirm_event_handler(handle,
+ wmi_cmd_struct_ptr, len);
+ break;
+
+ case WMI_NDP_END_INDICATION_EVENTID:
+ wma_ndp_end_indication_event_handler(handle,
+ wmi_cmd_struct_ptr, len);
+ break;
+
+ default:
+ WMA_LOGE(FL("Unknown tag: %d"), tag);
+ break;
+ }
+ wmitlv_free_allocated_event_tlvs(id, &wmi_cmd_struct_ptr);
+}
+
+/**
+ * wma_add_bss_ndi_mode() - Process BSS creation request while adding NaN
+ * Data interface
+ * @wma: wma handle
+ * @add_bss: Parameters for ADD_BSS command
+ *
+ * Sends VDEV_START command to firmware
+ * Return: None
+ */
+void wma_add_bss_ndi_mode(tp_wma_handle wma, tpAddBssParams add_bss)
+{
+ ol_txrx_pdev_handle pdev;
+ struct wma_vdev_start_req req;
+ ol_txrx_peer_handle peer = NULL;
+ struct wma_target_req *msg;
+ uint8_t vdev_id, peer_id;
+ QDF_STATUS status;
+ struct vdev_set_params param = {0};
+
+ WMA_LOGI("%s: enter", __func__);
+ if (NULL == wma_find_vdev_by_addr(wma, add_bss->bssId, &vdev_id)) {
+ WMA_LOGE("%s: Failed to find vdev", __func__);
+ goto send_fail_resp;
+ }
+ pdev = cds_get_context(QDF_MODULE_ID_TXRX);
+
+ if (pdev) {
+ WMA_LOGE("%s: Failed to get pdev", __func__);
+ goto send_fail_resp;
+ }
+
+ wma_set_bss_rate_flags(&wma->interfaces[vdev_id], add_bss);
+
+ peer = ol_txrx_find_peer_by_addr(pdev, add_bss->selfMacAddr, &peer_id);
+ if (!peer) {
+ WMA_LOGE("%s Failed to find peer %pM", __func__,
+ add_bss->selfMacAddr);
+ goto send_fail_resp;
+ }
+
+ msg = wma_fill_vdev_req(wma, vdev_id, WMA_ADD_BSS_REQ,
+ WMA_TARGET_REQ_TYPE_VDEV_START, add_bss,
+ WMA_VDEV_START_REQUEST_TIMEOUT);
+ if (!msg) {
+ WMA_LOGE("%s Failed to allocate vdev request vdev_id %d",
+ __func__, vdev_id);
+ goto send_fail_resp;
+ }
+
+ add_bss->staContext.staIdx = ol_txrx_local_peer_id(peer);
+
+ /*
+ * beacon_intval, dtim_period, hidden_ssid, is_dfs, ssid
+ * will be ignored for NDI device.
+ */
+ qdf_mem_zero(&req, sizeof(req));
+ req.vdev_id = vdev_id;
+ req.chan = add_bss->currentOperChannel;
+ req.ch_center_freq_seg0 = add_bss->ch_center_freq_seg0;
+ req.ch_center_freq_seg1 = add_bss->ch_center_freq_seg1;
+ req.vht_capable = add_bss->vhtCapable;
+ req.max_txpow = add_bss->maxTxPower;
+ req.oper_mode = add_bss->operMode;
+
+ status = wma_vdev_start(wma, &req, false);
+ if (status != QDF_STATUS_SUCCESS) {
+ wma_remove_vdev_req(wma, vdev_id,
+ WMA_TARGET_REQ_TYPE_VDEV_START);
+ goto send_fail_resp;
+ }
+ WMA_LOGI("%s: vdev start request for NDI sent to target", __func__);
+
+ /* Initialize protection mode to no protection */
+ param.if_id = vdev_id;
+ param.param_id = WMI_VDEV_PARAM_PROTECTION_MODE;
+ param.param_value = WMI_VDEV_PARAM_PROTECTION_MODE;
+ if (wmi_unified_vdev_set_param_send(wma->wmi_handle, &param))
+ WMA_LOGE("Failed to initialize protection mode");
+
+
+ return;
+send_fail_resp:
+ add_bss->status = QDF_STATUS_E_FAILURE;
+ wma_send_msg(wma, WMA_ADD_BSS_RSP, (void *)add_bss, 0);
+}
+
+/**
+ * wma_delete_all_nan_remote_peers() - Delete all nan peers
+ * @wma: wma handle
+ * @vdev_id: vdev id
+ *
+ * Return: None
+ */
+void wma_delete_all_nan_remote_peers(tp_wma_handle wma, uint32_t vdev_id)
+{
+ ol_txrx_vdev_handle vdev;
+ ol_txrx_peer_handle peer, temp;
+
+ if (vdev_id > wma->max_bssid) {
+ WMA_LOGE("%s: invalid vdev_id = %d", __func__, vdev_id);
+ return;
+ }
+
+ vdev = wma->interfaces[vdev_id].handle;
+ if (!vdev) {
+ WMA_LOGE("%s: vdev is NULL for vdev_id = %d",
+ __func__, vdev_id);
+ return;
+ }
+
+ /* remove all remote peers of ndi */
+ qdf_spin_lock_bh(&vdev->pdev->peer_ref_mutex);
+
+ temp = NULL;
+ TAILQ_FOREACH_REVERSE(peer, &vdev->peer_list,
+ peer_list_t, peer_list_elem) {
+ if (temp) {
+ qdf_spin_unlock_bh(&vdev->pdev->peer_ref_mutex);
+ if (qdf_atomic_read(
+ &temp->delete_in_progress) == 0)
+ wma_remove_peer(wma, temp->mac_addr.raw,
+ vdev_id, temp, false);
+ qdf_spin_lock_bh(&vdev->pdev->peer_ref_mutex);
+ }
+ /* self peer is deleted last */
+ if (peer == TAILQ_FIRST(&vdev->peer_list)) {
+ WMA_LOGE("%s: self peer removed", __func__);
+ break;
+ } else
+ temp = peer;
+ }
+ qdf_spin_unlock_bh(&vdev->pdev->peer_ref_mutex);
+
+ /* remove ndi self peer last */
+ peer = TAILQ_FIRST(&vdev->peer_list);
+ wma_remove_peer(wma, peer->mac_addr.raw, vdev_id, peer,
+ false);
+}
+
+/**
+ * wma_register_ndp_cb() - Register NDP callbacks
+ * @pe_ndp_event_handler: PE NDP callback routine pointer
+ *
+ * Register the PE callback NDP routines with WMA for
+ * handling NDP events
+ *
+ * Return: Success or Failure Status
+ */
+QDF_STATUS wma_register_ndp_cb(QDF_STATUS (*pe_ndp_event_handler)
+ (tpAniSirGlobal mac_ctx, cds_msg_t *msg))
+{
+
+ tp_wma_handle wma = cds_get_context(QDF_MODULE_ID_WMA);
+
+ if (!wma) {
+ WMA_LOGE("%s: Failed to get WMA context", __func__);
+ return QDF_STATUS_E_FAILURE;
+ }
+ wma->pe_ndp_event_handler = pe_ndp_event_handler;
+ WMA_LOGD("Registered NDP callbacks with WMA successfully");
+ return QDF_STATUS_SUCCESS;
+}
+
+/**
+ * wma_add_sta_ndi_mode() - Process ADD_STA for NaN Data path
+ * @wma: wma handle
+ * @add_sta: Parameters of ADD_STA command
+ *
+ * Sends CREATE_PEER command to firmware
+ * Return: void
+ */
+void wma_add_sta_ndi_mode(tp_wma_handle wma, tpAddStaParams add_sta)
+{
+ enum ol_txrx_peer_state state = OL_TXRX_PEER_STATE_CONN;
+ ol_txrx_pdev_handle pdev;
+ ol_txrx_vdev_handle vdev;
+ ol_txrx_peer_handle peer;
+ u_int8_t peer_id;
+ QDF_STATUS status;
+ struct wma_txrx_node *iface;
+
+ pdev = cds_get_context(QDF_MODULE_ID_TXRX);
+
+ if (NULL == pdev) {
+ WMA_LOGE(FL("Failed to find pdev"));
+ add_sta->status = QDF_STATUS_E_FAILURE;
+ goto send_rsp;
+ }
+
+ vdev = wma_find_vdev_by_id(wma, add_sta->smesessionId);
+ if (!vdev) {
+ WMA_LOGE(FL("Failed to find vdev"));
+ add_sta->status = QDF_STATUS_E_FAILURE;
+ goto send_rsp;
+ }
+
+ iface = &wma->interfaces[vdev->vdev_id];
+ WMA_LOGD(FL("vdev: %d, peer_mac_addr: "MAC_ADDRESS_STR),
+ add_sta->smesessionId, MAC_ADDR_ARRAY(add_sta->staMac));
+
+ peer = ol_txrx_find_peer_by_addr_and_vdev(pdev, vdev, add_sta->staMac,
+ &peer_id);
+ if (peer) {
+ WMA_LOGE(FL("NDI peer already exists, peer_addr %pM"),
+ add_sta->staMac);
+ add_sta->status = QDF_STATUS_E_EXISTS;
+ goto send_rsp;
+ }
+
+ /*
+ * The code above only checks the peer existence on its own vdev.
+ * Need to check whether the peer exists on other vDevs because firmware
+ * can't create the peer if the peer with same MAC address already
+ * exists on the pDev. As this peer belongs to other vDevs, just return
+ * here.
+ */
+ peer = ol_txrx_find_peer_by_addr(pdev, add_sta->staMac, &peer_id);
+ if (peer) {
+ WMA_LOGE(FL("vdev:%d, peer exists on other vdev with peer_addr %pM and peer_id %d"),
+ vdev->vdev_id, add_sta->staMac, peer_id);
+ add_sta->status = QDF_STATUS_E_EXISTS;
+ goto send_rsp;
+ }
+
+ status = wma_create_peer(wma, pdev, vdev, add_sta->staMac,
+ WMI_PEER_TYPE_NAN_DATA, add_sta->smesessionId,
+ false);
+ if (status != QDF_STATUS_SUCCESS) {
+ WMA_LOGE(FL("Failed to create peer for %pM"), add_sta->staMac);
+ add_sta->status = status;
+ goto send_rsp;
+ }
+
+ peer = ol_txrx_find_peer_by_addr_and_vdev(pdev, vdev, add_sta->staMac,
+ &peer_id);
+ if (!peer) {
+ WMA_LOGE(FL("Failed to find peer handle using peer mac %pM"),
+ add_sta->staMac);
+ add_sta->status = QDF_STATUS_E_FAILURE;
+ wma_remove_peer(wma, add_sta->staMac, add_sta->smesessionId,
+ peer, false);
+ goto send_rsp;
+ }
+
+ WMA_LOGD(FL("Moving peer %pM to state %d"), add_sta->staMac, state);
+ ol_txrx_peer_state_update(pdev, add_sta->staMac, state);
+
+ add_sta->staIdx = ol_txrx_local_peer_id(peer);
+ add_sta->nss = iface->nss;
+ add_sta->status = QDF_STATUS_SUCCESS;
+send_rsp:
+ WMA_LOGD(FL("Sending add sta rsp to umac (mac:%pM, status:%d)"),
+ add_sta->staMac, add_sta->status);
+ wma_send_msg(wma, WMA_ADD_STA_RSP, (void *)add_sta, 0);
+}
+
+/**
+ * wma_delete_sta_req_ndi_mode() - Process DEL_STA request for NDI data peer
+ * @wma: WMA context
+ * @del_sta: DEL_STA parameters from LIM
+ *
+ * Removes wma/txrx peer entry for the NDI STA
+ *
+ * Return: None
+ */
+void wma_delete_sta_req_ndi_mode(tp_wma_handle wma,
+ tpDeleteStaParams del_sta)
+{
+ ol_txrx_pdev_handle pdev;
+ struct ol_txrx_peer_t *peer;
+
+ pdev = cds_get_context(QDF_MODULE_ID_TXRX);
+
+ if (!pdev) {
+ WMA_LOGE(FL("Failed to get pdev"));
+ del_sta->status = QDF_STATUS_E_FAILURE;
+ goto send_del_rsp;
+ }
+
+ peer = ol_txrx_peer_find_by_local_id(pdev, del_sta->staIdx);
+ if (!peer) {
+ WMA_LOGE(FL("Failed to get peer handle using peer id %d"),
+ del_sta->staIdx);
+ del_sta->status = QDF_STATUS_E_FAILURE;
+ goto send_del_rsp;
+ }
+
+ wma_remove_peer(wma, peer->mac_addr.raw, del_sta->smesessionId, peer,
+ false);
+ del_sta->status = QDF_STATUS_SUCCESS;
+
+send_del_rsp:
+ if (del_sta->respReqd) {
+ WMA_LOGD(FL("Sending del rsp to umac (status: %d)"),
+ del_sta->status);
+ wma_send_msg(wma, WMA_DELETE_STA_RSP, del_sta, 0);
+ }
+}
diff --git a/core/wma/src/wma_nan_datapath.h b/core/wma/src/wma_nan_datapath.h
index b07810b6468a..ace8e31bd80b 100644
--- a/core/wma/src/wma_nan_datapath.h
+++ b/core/wma/src/wma_nan_datapath.h
@@ -27,4 +27,87 @@
#ifndef __WMA_NAN_DATAPATH_H
#define __WMA_NAN_DATAPATH_H
+#include "wma.h"
+#include "sir_api.h"
+#include "sme_nan_datapath.h"
+
+#ifdef WLAN_FEATURE_NAN_DATAPATH
+#define WMA_IS_VDEV_IN_NDI_MODE(intf, vdev_id) \
+ (WMI_VDEV_TYPE_NDI == intf[vdev_id].type)
+/**
+ * wma_update_hdd_cfg_ndp() - Update target device NAN datapath capability
+ * @wma_handle: pointer to WMA context
+ * @tgt_cfg: Pointer to target configuration data structure
+ *
+ * Return: none
+ */
+static inline void wma_update_hdd_cfg_ndp(tp_wma_handle wma_handle,
+ struct wma_tgt_cfg *tgt_cfg)
+{
+ tgt_cfg->nan_datapath_enabled = wma_handle->nan_datapath_enabled;
+}
+QDF_STATUS wma_handle_ndp_responder_req(tp_wma_handle wma_handle,
+ struct ndp_responder_req *req_params);
+void wma_delete_all_nan_remote_peers(tp_wma_handle wma,
+ uint32_t vdev_id);
+
+void wma_ndp_register_all_event_handlers(tp_wma_handle wma_handle);
+void wma_ndp_unregister_all_event_handlers(tp_wma_handle wma_handle);
+void wma_ndp_add_wow_wakeup_event(tp_wma_handle wma_handle,
+ uint8_t vdev_id);
+void wma_ndp_wow_event_callback(void *handle, void *event, uint32_t len);
+void wma_add_bss_ndi_mode(tp_wma_handle wma, tpAddBssParams add_bss);
+void wma_add_sta_ndi_mode(tp_wma_handle wma, tpAddStaParams add_sta);
+QDF_STATUS wma_handle_ndp_initiator_req(tp_wma_handle wma_handle, void *req);
+QDF_STATUS wma_handle_ndp_end_req(tp_wma_handle wma_handle, void *req);
+void wma_delete_sta_req_ndi_mode(tp_wma_handle wma,
+ tpDeleteStaParams del_sta);
+#else
+#define WMA_IS_VDEV_IN_NDI_MODE(intf, vdev_id) (false)
+static inline void wma_update_hdd_cfg_ndp(tp_wma_handle wma_handle,
+ struct wma_tgt_cfg *tgt_cfg)
+{
+ return;
+}
+static inline void wma_add_bss_ndi_mode(tp_wma_handle wma,
+ tpAddBssParams add_bss)
+{
+ return;
+}
+static inline void wma_delete_all_nan_remote_peers(tp_wma_handle wma,
+ uint32_t vdev_id)
+{
+}
+static inline void wma_ndp_register_all_event_handlers(
+ tp_wma_handle wma_handle) {}
+static inline void wma_ndp_unregister_all_event_handlers(
+ tp_wma_handle wma_handle) {}
+static inline void wma_ndp_add_wow_wakeup_event(tp_wma_handle wma_handle,
+ uint8_t vdev_id) {}
+static inline void wma_ndp_wow_event_callback(void *handle, void *event,
+ uint32_t len) {}
+static inline void wma_add_sta_ndi_mode(tp_wma_handle wma,
+ tpAddStaParams add_sta) {}
+static inline QDF_STATUS wma_handle_ndp_initiator_req(tp_wma_handle wma_handle,
+ void *req)
+{
+ return QDF_STATUS_SUCCESS;
+}
+static inline QDF_STATUS wma_handle_ndp_responder_req(tp_wma_handle wma_handle,
+ void *req_params)
+{
+ return QDF_STATUS_SUCCESS;
+}
+
+static inline QDF_STATUS wma_handle_ndp_end_req(tp_wma_handle wma_handle,
+ void *req)
+{
+ return QDF_STATUS_SUCCESS;
+}
+static inline void wma_delete_sta_req_ndi_mode(tp_wma_handle wma,
+ tpDeleteStaParams del_sta)
+{
+}
+
+#endif /* WLAN_FEATURE_NAN_DATAPATH */
#endif /* __WMA_NAN_DATAPATH_H */
diff --git a/core/wma/src/wma_ocb.c b/core/wma/src/wma_ocb.c
index 8cfde6e8614f..2485c6648ed3 100644
--- a/core/wma/src/wma_ocb.c
+++ b/core/wma/src/wma_ocb.c
@@ -252,6 +252,10 @@ int wma_ocb_set_config(tp_wma_handle wma_handle, struct sir_ocb_config *config)
tconfig.dcc_ndl_active_state_list_len = config->dcc_ndl_active_state_list_len;
tconfig.dcc_ndl_active_state_list = config->dcc_ndl_active_state_list;
ch_mhz = qdf_mem_malloc(sizeof(uint32_t)*config->channel_count);
+ if (ch_mhz == NULL) {
+ WMA_LOGE(FL("Memory allocation failed"));
+ return -ENOMEM;
+ }
for (i = 0; i < config->channel_count; i++)
ch_mhz[i] = wma_ocb_freq_to_mode(config->channels[i].chan_freq);
diff --git a/core/wma/src/wma_scan_roam.c b/core/wma/src/wma_scan_roam.c
index b581f2fd8cf5..28f198c84a66 100644
--- a/core/wma/src/wma_scan_roam.c
+++ b/core/wma/src/wma_scan_roam.c
@@ -981,6 +981,11 @@ QDF_STATUS wma_roam_scan_offload_chan_list(tp_wma_handle wma_handle,
return QDF_STATUS_E_EMPTY;
}
chan_list_hz = qdf_mem_malloc(chan_count * sizeof(uint8_t));
+ if (chan_list_hz == NULL) {
+ WMA_LOGE("%s : Memory allocation failed", __func__);
+ return QDF_STATUS_E_NOMEM;
+ }
+
for (i = 0; ((i < chan_count) &&
(i < SIR_ROAM_MAX_CHANNELS)); i++) {
chan_list_hz[i] = cds_chan_to_freq(chan_list[i]);
@@ -1530,6 +1535,11 @@ QDF_STATUS wma_roam_scan_filter(tp_wma_handle wma_handle,
struct roam_scan_filter_params *params;
params = qdf_mem_malloc(sizeof(struct roam_scan_filter_params));
+ if (params == NULL) {
+ WMA_LOGE("%s : Memory allocation failed", __func__);
+ return QDF_STATUS_E_NOMEM;
+ }
+
roam_params = &roam_req->roam_params;
if (roam_req->Command != ROAM_SCAN_OFFLOAD_STOP) {
switch (roam_req->reason) {
@@ -1558,7 +1568,6 @@ QDF_STATUS wma_roam_scan_filter(tp_wma_handle wma_handle,
default:
WMA_LOGD("%s : Roam Filter need not be sent", __func__);
return QDF_STATUS_SUCCESS;
- break;
}
} else {
/* In case of STOP command, reset all the variables
@@ -2921,6 +2930,10 @@ QDF_STATUS wma_pno_start(tp_wma_handle wma, tpSirPNOScanReq pno)
}
params = qdf_mem_malloc(sizeof(struct pno_scan_req_params));
+ if (params == NULL) {
+ WMA_LOGE("%s : Memory allocation failed", __func__);
+ return QDF_STATUS_E_NOMEM;
+ }
params->enable = pno->enable;
params->modePNO = (enum pno_mode) pno->modePNO;
@@ -3474,7 +3487,6 @@ int wma_nlo_scan_cmp_evt_handler(void *handle, uint8_t *event,
if (scan_event) {
/* Posting scan completion msg would take scan cache result
* from LIM module and update in scan cache maintained in SME.*/
- WMA_LOGE("Posting PNO Scan completion to umac");
qdf_wake_lock_timeout_acquire(&wma->pno_wake_lock,
WMA_PNO_SCAN_COMPLETE_WAKE_LOCK_TIMEOUT,
WIFI_POWER_EVENT_WAKELOCK_PNO);
@@ -4790,6 +4802,10 @@ QDF_STATUS wma_start_extscan(tp_wma_handle wma,
}
params = qdf_mem_malloc(sizeof(struct wifi_scan_cmd_req_params));
+ if (params == NULL) {
+ WMA_LOGE("%s : Memory allocation failed", __func__);
+ return QDF_STATUS_E_NOMEM;
+ }
params->basePeriod = pstart->basePeriod;
params->maxAPperScan = pstart->maxAPperScan;
diff --git a/core/wma/src/wma_utils.c b/core/wma/src/wma_utils.c
index 0e607ecb06d9..8ca54776ab76 100644
--- a/core/wma/src/wma_utils.c
+++ b/core/wma/src/wma_utils.c
@@ -1112,6 +1112,7 @@ static void wma_update_vdev_stats(tp_wma_handle wma,
QDF_STATUS qdf_status;
tAniGetRssiReq *pGetRssiReq = (tAniGetRssiReq *) wma->pGetRssiReq;
cds_msg_t sme_msg = { 0 };
+ int8_t bcn_snr, dat_snr;
node = &wma->interfaces[vdev_stats->vdev_id];
stats_rsp_params = node->stats_rsp;
@@ -1140,14 +1141,15 @@ static void wma_update_vdev_stats(tp_wma_handle wma,
summary_stats->rts_fail_cnt = vdev_stats->rts_fail_cnt;
}
}
+ bcn_snr = vdev_stats->vdev_snr.bcn_snr;
+ dat_snr = vdev_stats->vdev_snr.dat_snr;
- WMA_LOGD("vdev id %d beacon snr %d data snr %d",
- vdev_stats->vdev_id,
- vdev_stats->vdev_snr.bcn_snr, vdev_stats->vdev_snr.dat_snr);
+ WMA_LOGD("vdev id %d beancon snr %d data snr %d",
+ vdev_stats->vdev_id, bcn_snr, dat_snr);
if (pGetRssiReq && pGetRssiReq->sessionId == vdev_stats->vdev_id) {
- if ((vdev_stats->vdev_snr.bcn_snr == WMA_TGT_INVALID_SNR) &&
- (vdev_stats->vdev_snr.dat_snr == WMA_TGT_INVALID_SNR)) {
+ if ((bcn_snr == WMA_TGT_INVALID_SNR) &&
+ (dat_snr == WMA_TGT_INVALID_SNR)) {
/*
* Firmware sends invalid snr till it sees
* Beacon/Data after connection since after
@@ -1158,11 +1160,10 @@ static void wma_update_vdev_stats(tp_wma_handle wma,
WMA_LOGE("Invalid SNR from firmware");
} else {
- if (vdev_stats->vdev_snr.bcn_snr != WMA_TGT_INVALID_SNR) {
- rssi = vdev_stats->vdev_snr.bcn_snr;
- } else if (vdev_stats->vdev_snr.dat_snr !=
- WMA_TGT_INVALID_SNR) {
- rssi = vdev_stats->vdev_snr.dat_snr;
+ if (bcn_snr != WMA_TGT_INVALID_SNR) {
+ rssi = bcn_snr;
+ } else if (dat_snr != WMA_TGT_INVALID_SNR) {
+ rssi = dat_snr;
}
/*
@@ -1189,12 +1190,12 @@ static void wma_update_vdev_stats(tp_wma_handle wma,
if (node->psnr_req) {
tAniGetSnrReq *p_snr_req = node->psnr_req;
- if (vdev_stats->vdev_snr.bcn_snr != WMA_TGT_INVALID_SNR)
- p_snr_req->snr = vdev_stats->vdev_snr.bcn_snr;
- else if (vdev_stats->vdev_snr.dat_snr != WMA_TGT_INVALID_SNR)
- p_snr_req->snr = vdev_stats->vdev_snr.dat_snr;
+ if (bcn_snr != WMA_TGT_INVALID_SNR)
+ p_snr_req->snr = bcn_snr;
+ else if (dat_snr != WMA_TGT_INVALID_SNR)
+ p_snr_req->snr = dat_snr;
else
- p_snr_req->snr = WMA_TGT_INVALID_SNR;
+ p_snr_req->snr = (int8_t)WMA_TGT_INVALID_SNR;
sme_msg.type = eWNI_SME_SNR_IND;
sme_msg.bodyptr = p_snr_req;
@@ -3424,3 +3425,29 @@ wma_config_debug_module_cmd(wmi_unified_t wmi_handle, A_UINT32 param,
return wmi_unified_dbglog_cmd_send(wmi_handle, &dbg_param);
}
+
+/**
+ * wma_is_p2p_lo_capable() - if driver is capable of p2p listen offload
+ *
+ * This function checks if driver is capable of p2p listen offload
+ * true: capable of p2p offload
+ * false: not capable
+ *
+ * Return: true - capable, false - not capable
+ */
+bool wma_is_p2p_lo_capable(void)
+{
+ tp_wma_handle wma;
+
+ wma = cds_get_context(QDF_MODULE_ID_WMA);
+ if (!wma) {
+ WMA_LOGE("%s: Invalid WMA handle", __func__);
+ return false;
+ }
+
+ if (WMI_SERVICE_IS_ENABLED(wma->wmi_service_bitmap,
+ WMI_SERVICE_P2P_LISTEN_OFFLOAD_SUPPORT))
+ return true;
+
+ return false;
+}
diff --git a/target/inc/bmi_msg.h b/target/inc/bmi_msg.h
index 11982cfabe48..d1aa1ee102ef 100644
--- a/target/inc/bmi_msg.h
+++ b/target/inc/bmi_msg.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2014, 2016 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -232,23 +232,41 @@ struct bmi_segmented_metadata {
* Response format3 (newest firmware)
* struct bmi_target_info;
*/
-#ifdef FEATURE_BMI_2
PREPACK struct bmi_target_info {
/* size of this structure */
A_UINT32 target_info_byte_count;
A_UINT32 target_ver;
A_UINT32 target_type;
- A_UINT32 flags;
} POSTPACK;
-#else
-PREPACK struct bmi_target_info {
- /* size of this structure */
- A_UINT32 target_info_byte_count;
- A_UINT32 target_ver;
- A_UINT32 target_type;
-} POSTPACK;
-#endif
+
#define TARGET_VERSION_SENTINAL 0xffffffff
+#define TARGET_TYPE_UNKNOWN 0
+#define TARGET_TYPE_AR6001 1
+#define TARGET_TYPE_AR6002 2
+#define TARGET_TYPE_AR6003 3
+#define TARGET_TYPE_AR6004 5
+#define TARGET_TYPE_AR6006 6
+#define TARGET_TYPE_AR9888 7
+#define TARGET_TYPE_AR6320 8
+#define TARGET_TYPE_AR900B 9
+#define TARGET_TYPE_QCA9984 10
+#define TARGET_TYPE_IPQ4019 11
+#define TARGET_TYPE_QCA9888 12
+/* For attach Peregrine 2.0 board target_reg_tbl only */
+#define TARGET_TYPE_AR9888V2 13
+/* For attach Rome1.0 target_reg_tbl only*/
+#define TARGET_TYPE_AR6320V1 14
+/* For Rome2.0/2.1 target_reg_tbl ID*/
+#define TARGET_TYPE_AR6320V2 15
+/* For Rome3.0 target_reg_tbl ID*/
+#define TARGET_TYPE_AR6320V3 16
+/* For Tufello1.0 target_reg_tbl ID*/
+#define TARGET_TYPE_QCA9377V1 17
+/* For Adrastea target */
+#define TARGET_TYPE_ADRASTEA 19
+
+extern void target_register_tbl_attach(A_UINT32 target_type);
+
#define BMI_ROMPATCH_INSTALL 9
/*
* Semantics: Install a ROM Patch.
diff --git a/target/inc/cepci.h b/target/inc/cepci.h
index 919e5ae486c9..5c2247eafd56 100644
--- a/target/inc/cepci.h
+++ b/target/inc/cepci.h
@@ -83,9 +83,15 @@ struct pcie_state_s {
/*
* PCIE_CONFIG_FLAG definitions
*/
+#if defined(AR900B)
+#define CE_PKTLOG_PIPE 8 /* used by both host and target side */
+#endif
+
#define PCIE_CONFIG_FLAG_ENABLE_L1 0x0000001
+#define PCIE_CONFIG_FLAG_CLK_GATING_L1 0x0000001
#define PCIE_CONFIG_FLAG_CLK_SWITCH_WAIT 0x0000002
#define PCIE_CONFIG_FLAG_AXI_CLK_GATE 0x0000004
+#define PCIE_CONFIG_FLAG_CLK_REQ_L1 0x0000008
#define PIPE_TO_CE_MAP_CNT 32 /* simple implementation constant */
diff --git a/target/inc/dbglog.h b/target/inc/dbglog.h
index 94cf15430c7b..5514ca22f9cb 100644
--- a/target/inc/dbglog.h
+++ b/target/inc/dbglog.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2015 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012, 2016 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -77,48 +77,6 @@ extern "C" {
#define DBGLOG_GET_TIME_STAMP(arg) \
((arg & DBGLOG_TIMESTAMP_MASK) >> DBGLOG_TIMESTAMP_OFFSET)
-#define DIAG_FWID_OFFSET 24
-#define DIAG_FWID_MASK 0xFF000000 /* Bit 24-31 */
-
-#define DIAG_TIMESTAMP_OFFSET 0
-#define DIAG_TIMESTAMP_MASK 0x00FFFFFF /* Bit 0-23 */
-
-#define DIAG_ID_OFFSET 16
-#define DIAG_ID_MASK 0xFFFF0000 /* Bit 16-31 */
-
-#define DIAG_VDEVID_OFFSET 11
-#define DIAG_VDEVID_MASK 0x0000F800 /* Bit 11-15 */
-#define DIAG_VDEVID_NUM_MAX 16
-
-#define DIAG_VDEVLEVEL_OFFSET 8
-#define DIAG_VDEVLEVEL_MASK 0x00000700 /* Bit 8-10 */
-
-#define DIAG_PAYLEN_OFFSET 0
-#define DIAG_PAYLEN_MASK 0x000000FF /* Bit 0-7 */
-
-#define DIAG_PAYLEN_OFFSET16 0
-#define DIAG_PAYLEN_MASK16 0x0000FFFF /* Bit 0-16 */
-
-#define DIAG_GET_TYPE(arg) \
- ((arg & DIAG_FWID_MASK) >> DIAG_FWID_OFFSET)
-
-#define DIAG_GET_TIME_STAMP(arg) \
- ((arg & DIAG_TIMESTAMP_MASK) >> DIAG_TIMESTAMP_OFFSET)
-
-#define DIAG_GET_ID(arg) \
- ((arg & DIAG_ID_MASK) >> DIAG_ID_OFFSET)
-
-#define DIAG_GET_VDEVID(arg) \
- ((arg & DIAG_VDEVID_MASK) >> DIAG_VDEVID_OFFSET)
-
-#define DIAG_GET_VDEVLEVEL(arg) \
- ((arg & DIAG_VDEVLEVEL_MASK) >> DIAG_VDEVLEVEL_OFFSET)
-
-#define DIAG_GET_PAYLEN(arg) \
- ((arg & DIAG_PAYLEN_MASK) >> DIAG_PAYLEN_OFFSET)
-
-#define DIAG_GET_PAYLEN16(arg) \
- ((arg & DIAG_PAYLEN_MASK16) >> DIAG_PAYLEN_OFFSET16)
/* Debug Log levels*/
@@ -146,19 +104,6 @@ PREPACK struct dbglog_hdr_s {
A_UINT32 dropped;
} POSTPACK;
-PREPACK struct dbglog_buf_host {
- A_UINT32 next;
- A_UINT32 buffer;
- A_UINT32 bufsize;
- A_UINT32 length;
- A_UINT32 count;
- A_UINT32 free;
-} POSTPACK;
-
-PREPACK struct dbglog_hdr_host {
- A_UINT32 dbuf;
- A_UINT32 dropped;
-} POSTPACK;
#define DBGLOG_MAX_VDEVID 15 /* 0-15 */
diff --git a/target/inc/dbglog_id.h b/target/inc/dbglog_id.h
index 65784369c0a9..139b5ad8ab94 100644
--- a/target/inc/dbglog_id.h
+++ b/target/inc/dbglog_id.h
@@ -574,11 +574,11 @@ extern "C" {
#define SCAN_ENGINE_CANCEL_COMMAND 4
#define SCAN_ENGINE_STOP_DUE_TO_TIMEOUT 5
#define SCAN_EVENT_SEND_TO_HOST 6
-#define SCAN_FWLOG_EVENT_ADD 7
-#define SCAN_FWLOG_EVENT_REM 8
-#define SCAN_FWLOG_EVENT_PREEMPTED 9
-#define SCAN_FWLOG_EVENT_RESTARTED 10
-#define SCAN_FWLOG_EVENT_COMPLETED 11
+#define SCAN_EVENT_ADD 7
+#define SCAN_EVENT_REM 8
+#define SCAN_EVENT_PREEMPTED 9
+#define SCAN_EVENT_RESTARTED 10
+#define SCAN_EVENT_COMPLETED 11
#define SCAN_SM_REQ_NEXT_CH 12
#define SCAN_ENG_START 13
#define SCAN_ENG_CANCEL 14
@@ -1031,7 +1031,8 @@ extern "C" {
#define ROAM_SCAN_HIRSSI_CHECK 83
#define ROAM_SCAN_HIRSSI_TIMER_EXPIRED 84
#define ROAM_SCAN_EXTSCAN_CHECK 85
-#define ROAM_DBGID_DEFINITION_END 86
+#define ROAM_STA_KICKOUT_RECV 86
+#define ROAM_DBGID_DEFINITION_END 87
/* DATA_TXRX module DBGIDs*/
#define DATA_TXRX_DBGID_DEFINITION_START 0
@@ -1197,22 +1198,23 @@ extern "C" {
/* RMC DBGIDs */
#define RMC_DBGID_DEFINITION_START 0
-#define RMC_SM_INIT_ERR 1
-#define RMC_VDEV_ALLOC_ERR 2
-#define RMC_CREATE_INSTANCE 3
-#define RMC_DELETE_INSTANCE 4
-#define RMC_NEW_PRI_LEADER 5
-#define RMC_NEW_SEC_LEADER 6
-#define RMC_NO_LDR_CHANGE 7
-#define RMC_LDR_INFORM_SENT 8
-#define RMC_PEER_ADD 9
-#define RMC_PEER_DELETE 10
-#define RMC_PEER_UNKNOWN 11
-#define RMC_PRI_LDR_RSSI_UPDATE 12
-#define RMC_SEC_LDR_RSSI_UPDATE 13
-#define RMC_SET_MODE 14
-#define RMC_SET_ACTION_PERIOD 15
-#define RMC_DBGID_DEFINITION_END 16
+#define RMC_CREATE_INSTANCE 1
+#define RMC_DELETE_INSTANCE 2
+#define RMC_LDR_SEL 3
+#define RMC_NO_LDR 4
+#define RMC_LDR_NOT_SEL 5
+#define RMC_LDR_INF_SENT 6
+#define RMC_PEER_ADD 7
+#define RMC_PEER_DELETE 8
+#define RMC_PEER_UNKNOWN 9
+#define RMC_SET_MODE 10
+#define RMC_SET_ACTION_PERIOD 11
+#define RMC_ACTION_FRAME_RX 12
+#define RMC_WAL_EVENT_HANDLER 13
+#define RMC_BLACKLIST_PEER 14
+#define RMC_WHITELIST_PEER 15
+#define RMC_PEER_BCN_INFO 16
+#define RMC_DBGID_DEFINITION_END 17
/* UNIT_TEST module DBGIDs */
#define UNIT_TEST_GEN 0
diff --git a/target/inc/enet.h b/target/inc/enet.h
index c3f0cd68fccf..3e66c676afa1 100644
--- a/target/inc/enet.h
+++ b/target/inc/enet.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2014 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012, 2014, 2016 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -48,7 +48,8 @@ struct ethernet_hdr_t {
#define ETHERNET_CRC_LEN 4 /* bytes - length of the Ethernet CRC */
#define ETHERNET_MAX_LEN 1518 /* bytes */
-#define ETHERNET_MTU (ETHERNET_MAX_LEN - (ETHERNET_HDR_LEN + ETHER_CRC_LEN))
+#define ETHERNET_MTU (ETHERNET_MAX_LEN - (ETHERNET_HDR_LEN + ETHERNET_CRC_LEN))
+
struct llc_snap_hdr_t {
A_UINT8 dsap;
diff --git a/target/inc/htc.h b/target/inc/htc.h
index 9b081bfd4753..c99a8578e036 100644
--- a/target/inc/htc.h
+++ b/target/inc/htc.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2014, 2016 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -31,6 +31,9 @@
#ifndef ATH_TARGET
#include "athstartpack.h"
#endif
+#ifdef ATHR_WIN_NWF
+#pragma warning(disable:4214)
+#endif
#undef MS
#define MS(_v, _f) (((_v) & _f ## _MASK) >> _f ## _LSB)
#undef SM
@@ -114,15 +117,26 @@ typedef PREPACK struct _HTC_FRAME_HDR {
#define HTC_FLAGS_NEED_CREDIT_UPDATE (1 << 0)
#define HTC_FLAGS_SEND_BUNDLE (1 << 1) /* start or part of bundle */
#define HTC_FLAGS_SEQ_CHECK (1 << 2) /* seq check on rx side */
-#define HTC_FLAGS_CRC CHECK (1 << 3) /* CRC check on rx side */
-
+#define HTC_FLAGS_CRC_CHECK (1 << 3) /* CRC check on rx side */
/* receive direction */
-#define HTC_FLAGS_RECV_UNUSED_0 (1 << 0) /* bit 0 unused */
-#define HTC_FLAGS_RECV_TRAILER (1 << 1) /* bit 1 trailer data present */
-#define HTC_FLAGS_RECV_UNUSED_2 (1 << 0) /* bit 2 unused */
-#define HTC_FLAGS_RECV_UNUSED_3 (1 << 0) /* bit 3 unused */
-#define HTC_FLAGS_RECV_BUNDLE_CNT_MASK (0xF0) /* bits 7..4 */
-#define HTC_FLAGS_RECV_BUNDLE_CNT_SHIFT 4
+#define HTC_FLAGS_RECV_1MORE_BLOCK (1 << 0) /* bit 0 bundle trailer present */
+#define HTC_FLAGS_RECV_TRAILER (1 << 1) /* bit 1 trailer data present */
+#define HTC_FLAGS_RECV_BUNDLE_CNT_MASK (0xFC) /* bits 7..2 */
+#define HTC_FLAGS_RECV_BUNDLE_CNT_SHIFT 2
+/*
+ * To be compatible with an older definition of a smaller (4-bit)
+ * bundle count field, the bundle count is stored in a segmented
+ * format - the 4 LSbs of the bundle count value are stored in bits 5:2
+ * of the BUNDLE_CNT field, which is bits 7:4 of the HTC_FLAGS word;
+ * the next 2 bits of the bundle count value are stored in bits 1:0 of
+ * the BUNDLE_CNT field, which is bits 3:2 of the HTC_FLAGS word.
+ */
+#define HTC_FLAGS_RECV_BUNDLE_CNT_SET(x) \
+ ((((x) << 2) | ((x) >> 4)) << HTC_FLAGS_RECV_BUNDLE_CNT_SHIFT)
+#define HTC_FLAGS_RECV_BUNDLE_CNT_GET(x) \
+ ((((x) & HTC_FLAGS_RECV_BUNDLE_CNT_MASK) >> \
+ (HTC_FLAGS_RECV_BUNDLE_CNT_SHIFT + 2)) | \
+ ((((x) >> HTC_FLAGS_RECV_BUNDLE_CNT_SHIFT) & 0x3) << 4))
#define HTC_HDR_LENGTH (sizeof(HTC_FRAME_HDR))
#define HTC_HDR_ALIGNMENT_PADDING \
diff --git a/target/inc/htc_services.h b/target/inc/htc_services.h
index f94b0218a22d..8021af245777 100644
--- a/target/inc/htc_services.h
+++ b/target/inc/htc_services.h
@@ -61,14 +61,14 @@ typedef enum {
#define HTT_DATA2_MSG_SVC MAKE_SERVICE_ID(HTT_SERVICE_GROUP,1)
#define HTT_DATA3_MSG_SVC MAKE_SERVICE_ID(HTT_SERVICE_GROUP, 2)
-#define PACKET_LOG_SVC MAKE_SERVICE_ID(PACKET_LOG_SERVICE_GROUP, 0)
-
/* raw stream service (i.e. flash, tcmd, calibration apps) */
#define HTC_RAW_STREAMS_SVC MAKE_SERVICE_ID(HTC_TEST_GROUP,0)
#define CFG_NV_SVC MAKE_SERVICE_ID(CFG_NV_SERVICE_GROUP,0)
#define WDI_IPA_TX_SVC MAKE_SERVICE_ID(WDI_IPA_SERVICE_GROUP,0)
+#define PACKET_LOG_SVC MAKE_SERVICE_ID(PACKET_LOG_SERVICE_GROUP, 0)
+
/*
* Directions for interconnect pipe configuration.
* These definitions may be used during configuration and are shared
@@ -82,11 +82,12 @@ typedef enum {
* over the interconnect.
*/
typedef A_UINT32 PIPEDIR;
-#define PIPEDIR_NONE 0
-#define PIPEDIR_IN 1 /* Target-->Host, WiFi Rx direction */
-#define PIPEDIR_OUT 2 /* Host->Target, WiFi Tx direction */
-#define PIPEDIR_INOUT 3 /* bidirectional - target to target */
-#define PIPEDIR_INOUT_H2H 4 /* bidirectional - host to host */
+#define PIPEDIR_NONE 0
+#define PIPEDIR_IN 1 /* Target-->Host, WiFi Rx direction */
+#define PIPEDIR_OUT 2 /* Host->Target, WiFi Tx direction */
+#define PIPEDIR_INOUT 3 /* bidirectional, target to target */
+#define PIPEDIR_INOUT_T2T PIPEDIR_INOUT
+#define PIPEDIR_INOUT_H2H 4 /* bidirectional, host to host */
#define PIPEDIR_MATCH(d1, d2) (((PIPEDIR)(d1) & (PIPEDIR)(d2)) != 0)
/* Establish a mapping between a service/direction and a pipe. */
diff --git a/target/inc/htt_isoc.h b/target/inc/htt_isoc.h
index cfd259c6fbc7..e0bca712e322 100644
--- a/target/inc/htt_isoc.h
+++ b/target/inc/htt_isoc.h
@@ -37,7 +37,8 @@
#ifndef _HTT_ISOC_H_
#define _HTT_ISOC_H_
-#include <a_types.h> /* A_UINT32, A_UINT8 */
+#include <a_types.h> /* A_UINT32, A_UINT8 */
+#include <a_osapi.h> /* A_COMPILE_TIME_ASSERT */
#ifdef ATHR_WIN_NWF
#pragma warning(disable:4214) /* bit field types other than int */
@@ -74,6 +75,11 @@ typedef enum htt_isoc_t2h_msg_type {
/* RX_ERR - notification that an rx frame was discarded due to errors */
HTT_ISOC_T2H_MSG_TYPE_RX_ERR = 0x8,
+ /* NLO_MATCH - notification that target found NLO match */
+ HTT_ISOC_T2H_MSG_TYPE_NLO_MATCH = 0x9,
+
+ /* NLO_SCAN_END - notification that target NLO SCAN END 1:1 map with NLO_MATCH */
+ HTT_ISOC_T2H_MSG_TYPE_NLO_SCAN_END = 0xA,
/* keep this last */
HTT_ISOC_T2H_NUM_MSGS
} htt_isoc_t2h_msg_type;
@@ -90,16 +96,24 @@ typedef enum htt_isoc_t2h_msg_type {
#define HTT_ISOC_T2H_MSG_TYPE_GET(msg_addr) \
(*((A_UINT8 *) msg_addr))
-#ifndef inline
+#ifndef INLINE
+#ifdef QCA_SUPPORT_INTEGRATED_SOC
+/* host SW */
+#define INLINE inline
+#else
/* target FW */
-#define inline __inline
+#define INLINE __inline
+#endif
#define HTT_ISOC_INLINE_DEF
-#endif /* inline */
-
-static inline void
-htt_isoc_t2h_field_set(A_UINT32 *msg_addr32,
- unsigned offset32,
- unsigned mask, unsigned shift, unsigned value)
+#endif /* INLINE */
+
+static INLINE void
+htt_isoc_t2h_field_set(
+ A_UINT32 *msg_addr32,
+ unsigned offset32,
+ unsigned mask,
+ unsigned shift,
+ unsigned value)
{
/* sanity check: make sure the value fits within the field */
/* qdf_assert(value << shift == (value << shift) | mask); */
@@ -113,7 +127,7 @@ htt_isoc_t2h_field_set(A_UINT32 *msg_addr32,
#ifdef HTT_ISOC_INLINE_DEF
#undef HTT_ISOC_INLINE_DEF
-#undef inline
+#undef INLINE
#endif
#define HTT_ISOC_T2H_FIELD_GET(msg_addr32, offset32, mask, shift) \
@@ -332,30 +346,42 @@ typedef struct htt_isoc_t2h_peer_info_s {
#define HTT_ISOC_T2H_PEER_INFO_DPU_IDX_GET(msg_addr) \
HTT_ISOC_T2H_PEER_INFO_FIELD_GET(DPU_IDX, msg_addr)
+A_COMPILE_TIME_ASSERT(HTT_ISOC_T2H_PEER_INFO_BCAST_DPU_IDX_M_Size_Check,
+ (HTT_ISOC_T2H_PEER_INFO_BCAST_DPU_IDX_M >> HTT_ISOC_T2H_PEER_INFO_BCAST_DPU_IDX_S) \
+ <= ((A_UINT8)~((A_UINT8)0)));
#define HTT_ISOC_T2H_PEER_INFO_BCAST_DPU_IDX_SET(msg_addr, value) \
HTT_ISOC_T2H_PEER_INFO_FIELD_SET(BCAST_DPU_IDX, msg_addr, value)
#define HTT_ISOC_T2H_PEER_INFO_BCAST_DPU_IDX_GET(msg_addr) \
- HTT_ISOC_T2H_PEER_INFO_FIELD_GET(BCAST_DPU_IDX, msg_addr)
+ (A_UINT8)(HTT_ISOC_T2H_PEER_INFO_FIELD_GET(BCAST_DPU_IDX, msg_addr))
+A_COMPILE_TIME_ASSERT(HTT_ISOC_T2H_PEER_INFO_MGMT_DPU_IDX_M_Size_Check,
+ (HTT_ISOC_T2H_PEER_INFO_MGMT_DPU_IDX_M >> HTT_ISOC_T2H_PEER_INFO_MGMT_DPU_IDX_S) \
+ <= ((A_UINT8)~((A_UINT8)0)));
#define HTT_ISOC_T2H_PEER_INFO_MGMT_DPU_IDX_SET(msg_addr, value) \
HTT_ISOC_T2H_PEER_INFO_FIELD_SET(MGMT_DPU_IDX, msg_addr, value)
#define HTT_ISOC_T2H_PEER_INFO_MGMT_DPU_IDX_GET(msg_addr) \
- HTT_ISOC_T2H_PEER_INFO_FIELD_GET(MGMT_DPU_IDX, msg_addr)
+ (A_UINT8)(HTT_ISOC_T2H_PEER_INFO_FIELD_GET(MGMT_DPU_IDX, msg_addr))
#define HTT_ISOC_T2H_PEER_INFO_PEER_ID_SET(msg_addr, value) \
HTT_ISOC_T2H_PEER_INFO_FIELD_SET(PEER_ID, msg_addr, value)
#define HTT_ISOC_T2H_PEER_INFO_PEER_ID_GET(msg_addr) \
HTT_ISOC_T2H_PEER_INFO_FIELD_GET(PEER_ID, msg_addr)
+A_COMPILE_TIME_ASSERT(HTT_ISOC_T2H_PEER_INFO_DPU_SIG_M_Size_Check,
+ (HTT_ISOC_T2H_PEER_INFO_DPU_SIG_M >> HTT_ISOC_T2H_PEER_INFO_DPU_SIG_S)\
+ <= ((A_UINT8)~((A_UINT8)0)));
#define HTT_ISOC_T2H_PEER_INFO_DPU_SIG_SET(msg_addr, value) \
HTT_ISOC_T2H_PEER_INFO_FIELD_SET(DPU_SIG, msg_addr, value)
#define HTT_ISOC_T2H_PEER_INFO_DPU_SIG_GET(msg_addr) \
- HTT_ISOC_T2H_PEER_INFO_FIELD_GET(DPU_SIG, msg_addr)
+ (A_UINT8)(HTT_ISOC_T2H_PEER_INFO_FIELD_GET(DPU_SIG, msg_addr))
+A_COMPILE_TIME_ASSERT(HTT_ISOC_T2H_PEER_INFO_BCAST_DPU_SIG_M_Size_Check,
+ (HTT_ISOC_T2H_PEER_INFO_BCAST_DPU_SIG_M >> HTT_ISOC_T2H_PEER_INFO_BCAST_DPU_SIG_S)\
+ <= ((A_UINT8)~((A_UINT8)0)));
#define HTT_ISOC_T2H_PEER_INFO_BCAST_DPU_SIG_SET(msg_addr, value) \
HTT_ISOC_T2H_PEER_INFO_FIELD_SET(BCAST_DPU_SIG, msg_addr, value)
#define HTT_ISOC_T2H_PEER_INFO_BCAST_DPU_SIG_GET(msg_addr) \
- HTT_ISOC_T2H_PEER_INFO_FIELD_GET(BCAST_DPU_SIG, msg_addr)
+ (A_UINT8)(HTT_ISOC_T2H_PEER_INFO_FIELD_GET(BCAST_DPU_SIG, msg_addr))
#define HTT_ISOC_T2H_PEER_INFO_MGMT_DPU_SIG_SET(msg_addr, value) \
HTT_ISOC_T2H_PEER_INFO_FIELD_SET(MGMT_DPU_SIG, msg_addr, value)
@@ -450,10 +476,13 @@ typedef struct htt_isoc_t2h_peer_unmap_s {
/* access macros for specific fields */
+A_COMPILE_TIME_ASSERT(HTT_ISOC_T2H_PEER_UNMAP_PEER_ID_M_Size_Check,
+ (HTT_ISOC_T2H_PEER_UNMAP_PEER_ID_M >> HTT_ISOC_T2H_PEER_UNMAP_PEER_ID_S) \
+ < ((A_UINT16)~((A_UINT16)0)));
#define HTT_ISOC_T2H_PEER_UNMAP_PEER_ID_SET(msg_addr, value) \
HTT_ISOC_T2H_PEER_UNMAP_FIELD_SET(PEER_ID, msg_addr, value)
#define HTT_ISOC_T2H_PEER_UNMAP_PEER_ID_GET(msg_addr) \
- HTT_ISOC_T2H_PEER_UNMAP_FIELD_GET(PEER_ID, msg_addr)
+ (A_UINT16)(HTT_ISOC_T2H_PEER_UNMAP_FIELD_GET(PEER_ID, msg_addr))
/*=== ADDBA message ===*/
enum {
@@ -563,10 +592,13 @@ typedef struct htt_isoc_t2h_addba_s {
#define HTT_ISOC_T2H_ADDBA_WIN_SIZE_GET(msg_addr) \
HTT_ISOC_T2H_ADDBA_FIELD_GET(WIN_SIZE, msg_addr)
+A_COMPILE_TIME_ASSERT(HTT_ISOC_T2H_ADDBA_TID_M_Size_Check,
+ (HTT_ISOC_T2H_ADDBA_TID_M >> HTT_ISOC_T2H_ADDBA_TID_S) \
+ < ((A_UINT8)~((A_UINT8)0)));
#define HTT_ISOC_T2H_ADDBA_TID_SET(msg_addr, value) \
HTT_ISOC_T2H_ADDBA_FIELD_SET(TID, msg_addr, value)
#define HTT_ISOC_T2H_ADDBA_TID_GET(msg_addr) \
- HTT_ISOC_T2H_ADDBA_FIELD_GET(TID, msg_addr)
+ (A_UINT8)(HTT_ISOC_T2H_ADDBA_FIELD_GET(TID, msg_addr))
#define HTT_ISOC_T2H_ADDBA_PEER_ID_SET(msg_addr, value) \
HTT_ISOC_T2H_ADDBA_FIELD_SET(PEER_ID, msg_addr, value)
@@ -659,10 +691,13 @@ typedef struct htt_isoc_t2h_delba_s {
/* access macros for specific fields */
+A_COMPILE_TIME_ASSERT(HTT_ISOC_T2H_DELBA_TID_M_Size_Check,
+ (HTT_ISOC_T2H_DELBA_TID_M >> HTT_ISOC_T2H_DELBA_TID_S) \
+ < ((A_UINT8)~((A_UINT8)0)));
#define HTT_ISOC_T2H_DELBA_TID_SET(msg_addr, value) \
HTT_ISOC_T2H_DELBA_FIELD_SET(TID, msg_addr, value)
#define HTT_ISOC_T2H_DELBA_TID_GET(msg_addr) \
- HTT_ISOC_T2H_DELBA_FIELD_GET(TID, msg_addr)
+ (A_UINT8)HTT_ISOC_T2H_DELBA_FIELD_GET(TID, msg_addr)
#define HTT_ISOC_T2H_DELBA_PEER_ID_SET(msg_addr, value) \
HTT_ISOC_T2H_DELBA_FIELD_SET(PEER_ID, msg_addr, value)
@@ -858,10 +893,15 @@ typedef struct htt_isoc_t2h_peer_tx_ready_s {
/* access macros for specific fields */
-#define HTT_ISOC_T2H_PEER_TX_READY_PEER_ID_SET(msg_addr, value) \
+A_COMPILE_TIME_ASSERT(HTT_ISOC_T2H_PEER_TX_READY_PEER_ID_M_Size_Check,
+ (HTT_ISOC_T2H_PEER_TX_READY_PEER_ID_M >> \
+ HTT_ISOC_T2H_PEER_TX_READY_PEER_ID_S) < ((A_UINT16)~((A_UINT16)0)));
+
+#define HTT_ISOC_T2H_PEER_TX_READY_PEER_ID_SET(msg_addr, value) \
HTT_ISOC_T2H_PEER_TX_READY_FIELD_SET(PEER_ID, msg_addr, value)
#define HTT_ISOC_T2H_PEER_TX_READY_PEER_ID_GET(msg_addr) \
- HTT_ISOC_T2H_PEER_TX_READY_FIELD_GET(PEER_ID, msg_addr)
+ ((A_UINT16)(HTT_ISOC_T2H_PEER_TX_READY_FIELD_GET(PEER_ID, msg_addr)))
+
/*=== RX_ERR message ===*/
@@ -962,6 +1002,11 @@ typedef struct htt_isoc_t2h_rx_err_s {
/* words M - N: security header */
} htt_isoc_t2h_rx_err_t;
+/* This needs to be exact bytes for structure htt_isoc_t2h_rx_err_t
+ * * Since it is shared between host and FW, sizeof may not be used.
+ * * */
+#define HTT_ISOC_T2H_RX_ERR_BASE_BYTES 20
+
/* word 0 */
#define HTT_ISOC_T2H_RX_ERR_TYPE_OFFSET32 0
#define HTT_ISOC_T2H_RX_ERR_TYPE_M 0x0000ff00
@@ -974,27 +1019,28 @@ typedef struct htt_isoc_t2h_rx_err_s {
/* word 1 */
#define HTT_ISOC_T2H_RX_ERR_EXT_TID_OFFSET32 1
#define HTT_ISOC_T2H_RX_ERR_EXT_TID_M 0x0000001f
-#define HTT_ISOC_T2H_RX_ERR_EXT_TID_ID_S 0
+#define HTT_ISOC_T2H_RX_ERR_EXT_TID_S 0
#define HTT_ISOC_T2H_RX_ERR_MCAST_OFFSET32 1
#define HTT_ISOC_T2H_RX_ERR_MCAST_M 0x00000040
-#define HTT_ISOC_T2H_RX_ERR_MCAST_ID_S 6
+#define HTT_ISOC_T2H_RX_ERR_MCAST_S 6
#define HTT_ISOC_T2H_RX_ERR_L2_HDR_IS_80211_OFFSET32 1
#define HTT_ISOC_T2H_RX_ERR_L2_HDR_IS_80211_M 0x00000080
-#define HTT_ISOC_T2H_RX_ERR_L2_HDR_IS_80211_ID_S 7
+#define HTT_ISOC_T2H_RX_ERR_L2_HDR_IS_80211_S 7
-#define HTT_ISOC_T2H_RX_L2_HDR_BYTES_OFFSET32 1
-#define HTT_ISOC_T2H_RX_L2_HDR_BYTES_M 0x0000ff00
-#define HTT_ISOC_T2H_RX_L2_HDR_BYTES_ID_S 8
+#define HTT_ISOC_T2H_RX_ERR_L2_HDR_BYTES_OFFSET32 1
+#define HTT_ISOC_T2H_RX_ERR_L2_HDR_BYTES_M 0x0000ff00
+#define HTT_ISOC_T2H_RX_ERR_L2_HDR_BYTES_S 8
-#define HTT_ISOC_T2H_RX_SEC_HDR_BYTES_OFFSET32 1
-#define HTT_ISOC_T2H_RX_SEC_HDR_BYTES_M 0x00ff0000
-#define HTT_ISOC_T2H_RX_SEC_HDR_BYTES_ID_S 16
+#define HTT_ISOC_T2H_RX_ERR_SEC_HDR_BYTES_OFFSET32 1
+#define HTT_ISOC_T2H_RX_ERR_SEC_HDR_BYTES_M 0x00ff0000
+#define HTT_ISOC_T2H_RX_ERR_SEC_HDR_BYTES_S 16
#define HTT_ISOC_T2H_RX_ERR_CNT_OFFSET32 1
#define HTT_ISOC_T2H_RX_ERR_CNT_M 0xff000000
-#define HTT_ISOC_T2H_RX_ERR_CNT_ID_S 24
+#define HTT_ISOC_T2H_RX_ERR_CNT_S 24
+
/* general field access macros */
@@ -1020,10 +1066,13 @@ typedef struct htt_isoc_t2h_rx_err_s {
#define HTT_ISOC_T2H_RX_ERR_TYPE_GET(msg_addr) \
HTT_ISOC_T2H_RX_ERR_FIELD_GET(TYPE, msg_addr)
+A_COMPILE_TIME_ASSERT(HTT_ISOC_T2H_RX_ERR_PEER_ID_M_Size_Check,
+ (HTT_ISOC_T2H_RX_ERR_PEER_ID_M >> HTT_ISOC_T2H_RX_ERR_PEER_ID_S) \
+ <= ((A_UINT16)~((A_UINT16)0)));
#define HTT_ISOC_T2H_RX_ERR_PEER_ID_SET(msg_addr, value) \
HTT_ISOC_T2H_RX_ERR_FIELD_SET(PEER_ID, msg_addr, value)
#define HTT_ISOC_T2H_RX_ERR_PEER_ID_GET(msg_addr) \
- HTT_ISOC_T2H_RX_ERR_FIELD_GET(PEER_ID, msg_addr)
+ ((A_UINT16)HTT_ISOC_T2H_RX_ERR_FIELD_GET(PEER_ID, msg_addr))
#define HTT_ISOC_T2H_RX_ERR_EXT_TID_SET(msg_addr, value) \
HTT_ISOC_T2H_RX_ERR_FIELD_SET(EXT_TID, msg_addr, value)
@@ -1055,4 +1104,141 @@ typedef struct htt_isoc_t2h_rx_err_s {
#define HTT_ISOC_T2H_RX_ERR_CNT_GET(msg_addr) \
HTT_ISOC_T2H_RX_ERR_FIELD_GET(CNT, msg_addr)
+/*=== TX OTA complete indication message ===*/
+
+/**
+ * @brief target -> tx complete indicate message
+ *
+ * @details
+ * The following diagram shows the format of the tx complete indication message sent
+ * from the target to the host. This layout assumes the target operates
+ * as little-endian.
+ *
+ * |31 19|18 8|7 0|
+ * |-----------------------------------------------------------------------|
+ * | reserved | status | msg type |
+ * |-----------------------------------------------------------------------|
+ *
+ *
+ * The following field definitions describe the format of the peer info
+ * message sent from the target to the host.
+ *
+ * WORD 0:
+ * - MSG_TYPE
+ * Bits 7:0
+ * Purpose: identifies this as tx complete indication message
+ * Value: 0x7
+ * - status
+ * Bits 18:8
+ * Purpose: TX completion status
+ */
+typedef struct htt_isoc_t2h_tx_compl_s {
+ /* word 0 */
+ A_UINT32
+ /* HTT_ISOC_T2H_MSG_TYPE_TX_COMPL_IND */
+ qmsg_type:8,
+ status:11,
+ reserved0:13;
+} htt_isoc_t2h_tx_compl_t;
+
+/* word 0 */
+#define HTT_ISOC_T2H_TX_COMPL_IND_STATUS_OFFSET32 0
+#define HTT_ISOC_T2H_TX_COMPL_IND_STATUS_M 0x0007ff00
+#define HTT_ISOC_T2H_TX_COMPL_IND_STATUS_S 8
+
+
+/* general field access macros */
+
+#define HTT_ISOC_T2H_TX_COMPL_IND_FIELD_SET(field, msg_addr, value) \
+ htt_isoc_t2h_field_set( \
+ ((A_UINT32 *) msg_addr), \
+ HTT_ISOC_T2H_TX_COMPL_IND_ ## field ## _OFFSET32, \
+ HTT_ISOC_T2H_TX_COMPL_IND_ ## field ## _M, \
+ HTT_ISOC_T2H_TX_COMPL_IND_ ## field ## _S, \
+ value)
+
+#define HTT_ISOC_T2H_TX_COMPL_IND_FIELD_GET(field, msg_addr) \
+ HTT_ISOC_T2H_FIELD_GET( \
+ ((A_UINT32 *) msg_addr), \
+ HTT_ISOC_T2H_TX_COMPL_IND_ ## field ## _OFFSET32, \
+ HTT_ISOC_T2H_TX_COMPL_IND_ ## field ## _M, \
+ HTT_ISOC_T2H_TX_COMPL_IND_ ## field ## _S)
+
+/* access macros for specific fields */
+
+#define HTT_ISOC_T2H_TX_COMPL_IND_STATUS_SET(msg_addr, value) \
+ HTT_ISOC_T2H_TX_COMPL_IND_FIELD_SET(STATUS, msg_addr, value)
+#define HTT_ISOC_T2H_TX_COMPL_IND_STATUS_GET(msg_addr) \
+ HTT_ISOC_T2H_TX_COMPL_IND_FIELD_GET(STATUS, msg_addr)
+
+#define HTT_TX_COMPL_IND_STAT_OK 0
+#define HTT_TX_COMPL_IND_STAT_DISCARD 1
+#define HTT_TX_COMPL_IND_STAT_NO_ACK 2
+#define HTT_TX_COMPL_IND_STAT_POSTPONE 3
+
+/*=== NLO indication message ===*/
+
+/**
+* @brief target -> NLO indicate message
+*
+* @details
+* The following diagram shows the format of the NLO indication message sent
+* from the target to the host. This layout assumes the target operates
+* as little-endian.
+*
+* |31 8|7 0|
+* |-----------------------------------------------------------------------|
+* | reserved | msg type |
+* |-----------------------------------------------------------------------|
+*
+*
+* The following field definitions describe the format of NLO MATCH indication
+* message sent from the target to the host.
+*
+* WORD 0:
+* - MSG_TYPE
+* Bits 7:0
+* Purpose: identifies this as NLO indication message
+* Value: 0x9 - HTT_ISOC_T2H_MSG_TYPE_NLO_MATCH
+* Value: 0xA - HTT_ISOC_T2H_MSG_TYPE_NLO_SCAN_END
+*/
+typedef struct htt_isoc_t2h_nlo_ind_s {
+ /* word 0 */
+ A_UINT32
+ msg_type:8,
+ vdev_id:8,
+ reserved0:16;
+} htt_isoc_t2h_nlo_ind_t;
+
+/* word 0 */
+#define HTT_ISOC_T2H_NLO_IND_VDEVID_OFFSET32 0
+#define HTT_ISOC_T2H_NLO_IND_VDEVID_M 0x0000ff00
+#define HTT_ISOC_T2H_NLO_IND_VDEVID_S 8
+
+
+/* general field access macros */
+
+#define HTT_ISOC_T2H_NLO_IND_FIELD_SET(field, msg_addr, value) \
+ htt_isoc_t2h_field_set( \
+ ((A_UINT32 *) msg_addr), \
+ HTT_ISOC_T2H_NLO_IND_ ## field ## _OFFSET32, \
+ HTT_ISOC_T2H_NLO_IND_ ## field ## _M, \
+ HTT_ISOC_T2H_NLO_IND_ ## field ## _S, \
+ value)
+
+#define HTT_ISOC_T2H_NLO_IND_FIELD_GET(field, msg_addr) \
+ HTT_ISOC_T2H_FIELD_GET( \
+ ((A_UINT32 *) msg_addr), \
+ HTT_ISOC_T2H_NLO_IND_ ## field ## _OFFSET32, \
+ HTT_ISOC_T2H_NLO_IND_ ## field ## _M, \
+ HTT_ISOC_T2H_NLO_IND_ ## field ## _S)
+
+/* access macros for specific fields */
+
+#define HTT_ISOC_T2H_NLO_IND_VDEVID_SET(msg_addr, value) \
+ HTT_ISOC_T2H_NLO_IND_FIELD_SET(VDEVID, msg_addr, value)
+#define HTT_ISOC_T2H_NLO_IND_VDEVID_GET(msg_addr) \
+ HTT_ISOC_T2H_NLO_IND_FIELD_GET(VDEVID, msg_addr)
+
+
#endif /* _HTT_ISOC_H_ */
diff --git a/target/inc/ol_fw_tx_dbg.h b/target/inc/ol_fw_tx_dbg.h
index 35303b7ac390..254e94a6c1d5 100644
--- a/target/inc/ol_fw_tx_dbg.h
+++ b/target/inc/ol_fw_tx_dbg.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2014-2015 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012, 2014-2016 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -49,8 +49,8 @@
#if defined(ATH_TARGET)
#include <osapi.h> /* A_UINT32 */
#else
-#include <a_types.h> /* A_UINT32 */
-#include <osdep.h> /* PREPACK, POSTPACK */
+#include <a_types.h> /* A_UINT32 */
+#include <a_osapi.h> /* PREPACK, POSTPACK */
#endif
enum ol_fw_tx_dbg_log_mode {
@@ -92,90 +92,90 @@ struct ol_fw_tx_dbg_ppdu_msg_hdr {
*/
struct ol_fw_tx_dbg_ppdu_base {
/* word 0 - filled in during tx enqueue */
-#define OL_FW_TX_DBG_PPDU_START_SEQ_NUM_16 0
+#define OL_FW_TX_DBG_PPDU_START_SEQ_NUM_WORD 0
#define OL_FW_TX_DBG_PPDU_START_SEQ_NUM_S 0
#define OL_FW_TX_DBG_PPDU_START_SEQ_NUM_M 0x0000ffff
A_UINT16 start_seq_num;
-#define OL_FW_TX_DBG_PPDU_START_PN_LSBS_16 0
+#define OL_FW_TX_DBG_PPDU_START_PN_LSBS_WORD 0
#define OL_FW_TX_DBG_PPDU_START_PN_LSBS_S 16
#define OL_FW_TX_DBG_PPDU_START_PN_LSBS_M 0xffff0000
A_UINT16 start_pn_lsbs;
/* word 1 - filled in during tx enqueue */
-#define OL_FW_TX_DBG_PPDU_NUM_BYTES_16 1
+#define OL_FW_TX_DBG_PPDU_NUM_BYTES_WORD 1
#define OL_FW_TX_DBG_PPDU_NUM_BYTES_S 0
#define OL_FW_TX_DBG_PPDU_NUM_BYTES_M 0xffffffff
A_UINT32 num_bytes;
/* word 2 - filled in during tx enqueue */
-#define OL_FW_TX_DBG_PPDU_NUM_MSDUS_16 2
+#define OL_FW_TX_DBG_PPDU_NUM_MSDUS_WORD 2
#define OL_FW_TX_DBG_PPDU_NUM_MSDUS_S 0
#define OL_FW_TX_DBG_PPDU_NUM_MSDUS_M 0x000000ff
A_UINT8 num_msdus;
-#define OL_FW_TX_DBG_PPDU_NUM_MPDUS_16 2
+#define OL_FW_TX_DBG_PPDU_NUM_MPDUS_WORD 2
#define OL_FW_TX_DBG_PPDU_NUM_MPDUS_S 8
#define OL_FW_TX_DBG_PPDU_NUM_MPDUS_M 0x0000ff00
A_UINT8 num_mpdus;
A_UINT16
-#define OL_FW_TX_DBG_PPDU_EXT_TID_16 2
+#define OL_FW_TX_DBG_PPDU_EXT_TID_WORD 2
#define OL_FW_TX_DBG_PPDU_EXT_TID_S 16
#define OL_FW_TX_DBG_PPDU_EXT_TID_M 0x001f0000
ext_tid : 5,
-#define OL_FW_TX_DBG_PPDU_PEER_ID_16 2
+#define OL_FW_TX_DBG_PPDU_PEER_ID_WORD 2
#define OL_FW_TX_DBG_PPDU_PEER_ID_S 21
#define OL_FW_TX_DBG_PPDU_PEER_ID_M 0xffe00000
peer_id : 11;
/* word 3 - filled in during tx enqueue */
-#define OL_FW_TX_DBG_PPDU_TIME_ENQUEUE_16 3
+#define OL_FW_TX_DBG_PPDU_TIME_ENQUEUE_WORD 3
#define OL_FW_TX_DBG_PPDU_TIME_ENQUEUE_S 0
#define OL_FW_TX_DBG_PPDU_TIME_ENQUEUE_M 0xffffffff
A_UINT32 timestamp_enqueue;
/* word 4 - filled in during tx completion */
-#define OL_FW_TX_DBG_PPDU_TIME_COMPL_16 4
+#define OL_FW_TX_DBG_PPDU_TIME_COMPL_WORD 4
#define OL_FW_TX_DBG_PPDU_TIME_COMPL_S 0
#define OL_FW_TX_DBG_PPDU_TIME_COMPL_M 0xffffffff
A_UINT32 timestamp_completion;
/* word 5 - filled in during tx completion */
-#define OL_FW_TX_DBG_PPDU_BLOCK_ACK_LSBS_16 5
+#define OL_FW_TX_DBG_PPDU_BLOCK_ACK_LSBS_WORD 5
#define OL_FW_TX_DBG_PPDU_BLOCK_ACK_LSBS_S 0
#define OL_FW_TX_DBG_PPDU_BLOCK_ACK_LSBS_M 0xffffffff
A_UINT32 block_ack_bitmap_lsbs;
/* word 6 - filled in during tx completion */
-#define OL_FW_TX_DBG_PPDU_BLOCK_ACK_MSBS_16 6
+#define OL_FW_TX_DBG_PPDU_BLOCK_ACK_MSBS_WORD 6
#define OL_FW_TX_DBG_PPDU_BLOCK_ACK_MSBS_S 0
#define OL_FW_TX_DBG_PPDU_BLOCK_ACK_MSBS_M 0xffffffff
A_UINT32 block_ack_bitmap_msbs;
/* word 7 - filled in during tx completion (enqueue would work too) */
-#define OL_FW_TX_DBG_PPDU_ENQUEUED_LSBS_16 7
+#define OL_FW_TX_DBG_PPDU_ENQUEUED_LSBS_WORD 7
#define OL_FW_TX_DBG_PPDU_ENQUEUED_LSBS_S 0
#define OL_FW_TX_DBG_PPDU_ENQUEUED_LSBS_M 0xffffffff
A_UINT32 enqueued_bitmap_lsbs;
/* word 8 - filled in during tx completion (enqueue would work too) */
-#define OL_FW_TX_DBG_PPDU_ENQUEUED_MSBS_16 8
+#define OL_FW_TX_DBG_PPDU_ENQUEUED_MSBS_WORD 8
#define OL_FW_TX_DBG_PPDU_ENQUEUED_MSBS_S 0
#define OL_FW_TX_DBG_PPDU_ENQUEUED_MSBS_M 0xffffffff
A_UINT32 enqueued_bitmap_msbs;
/* word 9 - filled in during tx completion */
-#define OL_FW_TX_DBG_PPDU_RATE_CODE_16 9
+#define OL_FW_TX_DBG_PPDU_RATE_CODE_WORD 9
#define OL_FW_TX_DBG_PPDU_RATE_CODE_S 0
#define OL_FW_TX_DBG_PPDU_RATE_CODE_M 0x000000ff
A_UINT8 rate_code;
-#define OL_FW_TX_DBG_PPDU_RATEFLAGS_16 9
+#define OL_FW_TX_DBG_PPDU_RATE_FLAGS_WORD 9
#define OL_FW_TX_DBG_PPDU_RATE_FLAGS_S 8
#define OL_FW_TX_DBG_PPDU_RATE_FLAGS_M 0x0000ff00
A_UINT8 rate_flags; /* includes dynamic bandwidth info */
-#define OL_FW_TX_DBG_PPDU_TRIES_16 9
+#define OL_FW_TX_DBG_PPDU_TRIES_WORD 9
#define OL_FW_TX_DBG_PPDU_TRIES_S 16
#define OL_FW_TX_DBG_PPDU_TRIES_M 0x00ff0000
A_UINT8 tries;
-#define OL_FW_TX_DBG_PPDU_COMPLETE_16 9
+#define OL_FW_TX_DBG_PPDU_COMPLETE_WORD 9
#define OL_FW_TX_DBG_PPDU_COMPLETE_S 24
#define OL_FW_TX_DBG_PPDU_COMPLETE_M 0xff000000
A_UINT8 complete;
diff --git a/target/inc/targaddrs.h b/target/inc/targaddrs.h
index 30a8931a4c56..13e1a7136d71 100644
--- a/target/inc/targaddrs.h
+++ b/target/inc/targaddrs.h
@@ -70,7 +70,7 @@
#define AR9888_HOST_INTEREST_ADDRESS 0x00400800
#define AR900B_HOST_INTEREST_ADDRESS 0x00400800
#define AR6320_HOST_INTEREST_ADDRESS 0x00400800
-#define QCA6180_HOST_INTEREST_ADDRESS 0x005d96a0
+#define QCA9377_HOST_INTEREST_ADDRESS 0x00400800
#define AR6004_SOC_RESET_ADDRESS 0X00004000
#define AR6004_SOC_RESET_CPU_INIT_RESET_MASK 0X00000800
#if defined(AR6006_MEMORY_NEW_ARCH)
@@ -114,11 +114,11 @@ PREPACK64 struct host_interest_s {
/* Save SW ROM version */
A_UINT32 hi_sw_rom_version; /* 0x0c */
- /*
- * General-purpose flag bits, similar to SOC_OPTION_* flags.
- * Can be used by application rather than by OS.
- */
- A_UINT32 hi_option_flag; /* 0x10 */
+ /*
+ * General-purpose flag bits, similar to SOC_OPTION_* flags.
+ * Can be used by application rather than by OS.
+ */
+ volatile A_UINT32 hi_option_flag; /* 0x10 */
/*
* Boolean that determines whether or not to
@@ -212,7 +212,7 @@ PREPACK64 struct host_interest_s {
A_UINT32 hi_acs_flags; /* 0xc0 */
A_UINT32 hi_console_flags; /* 0xc4 */
A_UINT32 hi_nvram_state; /* 0xc8 */
- A_UINT32 hi_option_flag2; /* 0xcc */
+ volatile A_UINT32 hi_option_flag2; /* 0xcc */
/* If non-zero, override values sent to Host in WMI_READY event. */
A_UINT32 hi_sw_version_override; /* 0xd0 */
@@ -229,8 +229,8 @@ PREPACK64 struct host_interest_s {
/* location of CAL data */
A_UINT32 hi_cal_data; /* 0xe4 */
- /* Number of packet log buffers */
- A_UINT32 hi_pktlog_num_buffers; /* 0xe8 */
+ /* Number of packet log buffers */
+ volatile A_UINT32 hi_pktlog_num_buffers; /* 0xe8 */
/* wow extension configuration */
A_UINT32 hi_wow_ext_config; /* 0xec */
@@ -351,13 +351,21 @@ PREPACK64 struct host_interest_s {
#define HI_OPTION_RF_KILL_SHIFT 0x2
#define HI_OPTION_RF_KILL_MASK 0x1
+#define HI_OPTION_HTT_TGT_DEBUG_TX_COMPL_IDX 0x20
+
+#define HTT_TGT_DEBUG_TX_COMPL_IDX_VALUE() \
+ ((HOST_INTEREST->hi_option_flag2 & HI_OPTION_HTT_TGT_DEBUG_TX_COMPL_IDX))
+
/* AR9888 1.0 only. Enable/disable CDC max perf support from host */
#define HI_OPTION_DISABLE_CDC_MAX_PERF_WAR 0x20
#define CDC_MAX_PERF_WAR_ENABLED() \
(!(HOST_INTEREST->hi_option_flag2 & HI_OPTION_DISABLE_CDC_MAX_PERF_WAR))
-
-#define HI_OPTION_USE_EXT_LDO 0x40 /* use LDO27 for 1.1V instead of PMU */
-#define HI_OPTION_DBUART_SUPPORT 0x80 /* Enable uart debug support */
+#define HI_OPTION_USE_EXT_LDO 0x40 /* use LDO27 for 1.1V instead of PMU. */
+#define HI_OPTION_DBUART_SUPPORT 0x80 /* Enable uart debug support */
+/* This bit is to enable BE low latency for some customers.
+ * The side effect is TCP DL will be 8Mbps decreased (673Mbps -> 665Mbps).
+ */
+#define HI_OPTION_BE_LATENCY_OPTIMIZE 0x100
#define HT_OPTION_GPIO_WAKEUP_SUPPORT 0x200 /* GPIO wake up support */
#define GPIO_WAKEUP_ENABLED() \
(HOST_INTEREST->hi_option_flag2 & HT_OPTION_GPIO_WAKEUP_SUPPORT)
@@ -406,20 +414,38 @@ PREPACK64 struct host_interest_s {
#define HOST_ON_BE_CPU() \
(HOST_INTEREST->hi_be)
-/* AP nart no swap descriptor flag. Decsriptors are created on the target processor. */
+/* AP nart no swap descriptor flag. Decsriptors are created
+ * on the target processor.
+ */
#define DESC_IN_FW() \
(HOST_INTEREST->hi_fw_swap & HI_DESC_IN_FW_BIT)
-#define HI_ACS_FLAGS_ENABLED (1 << 0) /* ACS is enabled */
-#define HI_ACS_FLAGS_USE_WWAN (1 << 1) /* Use physical WWAN device */
-#define HI_ACS_FLAGS_TEST_VAP (1 << 2) /* Use test VAP */
-#define HI_ACS_FLAGS_SDIO_SWAP_MAILBOX_SET (1 << 0)
-#define HI_ACS_FLAGS_SDIO_REDUCE_TX_COMPL_SET (1 << 1)
-#define HI_ACS_FLAGS_ALT_DATA_CREDIT_SIZE (1 << 2)
-
-#define HI_ACS_FLAGS_SDIO_SWAP_MAILBOX_FW_ACK (1 << 16)
-#define HI_ACS_FLAGS_SDIO_REDUCE_TX_COMPL_FW_ACK (1 << 17)
+/* redefine for hi_acs_flags since no product ever use it
+ * NOTE:
+ * This flag was only used in AR6004 for a customer project that has
+ * been canceled, we are reusing it to avoid extending the Host interest
+ * area.
+ * BIT Range Meaning
+ * --------- ----------------------------------
+ * 0 HOST wants to swap MBOX usage
+ * 1 HOST supports HTT reduced tx completion
+ * 2 HOST supports HTT alternate credit size for data frames
+ * 15..3 reserved for HOST
+ * 16 FW set it before sending HTC_Ready to indicate MBOX swap is done
+ * 17 same as above but to indicate HTT reduced tx completion capability
+ * 31..18 reserved for FW
+ */
+/* HOST require to swap MBOX */
+#define HI_ACS_FLAGS_HOST_SWAP_MBOX (1 << 0)
+/* HOST supports HTT reduced tx completion */
+#define HI_ACS_FLAGS_HOST_REDUCE_TX_COMPL (1 << 1)
+/* HOST supports alternate credit size for data frames */
+#define HI_ACS_FLAGS_ALT_DATA_CREDIT_SIZE (1 << 2)
+/* FW swapped MBOX */
+#define HI_ACS_FLAGS_FW_SWAPPED_MBOX (1 << 16)
+/* FW support HTT reduced tx completion */
+#define HI_ACS_FLAGS_FW_REDUCE_TX_COMPL (1 << 17)
/* CONSOLE FLAGS
*
@@ -554,25 +580,25 @@ PREPACK64 struct host_interest_s {
(A_UINT32)((size_t)&((((struct host_interest_s *)(AR900B_HOST_INTEREST_ADDRESS))->item)))
#define HOST_INTEREST_DBGLOG_IS_ENABLED() \
- (!((volatile A_UINT32)HOST_INTEREST->hi_option_flag & HI_OPTION_DISABLE_DBGLOG))
+ (!(HOST_INTEREST->hi_option_flag & HI_OPTION_DISABLE_DBGLOG))
#define HOST_INTEREST_PKTLOG_IS_ENABLED() \
- (((volatile A_UINT32)HOST_INTEREST->hi_pktlog_num_buffers))
+ ((HOST_INTEREST->hi_pktlog_num_buffers))
#define HOST_INTEREST_PROFILE_IS_ENABLED() \
- ((volatile A_UINT32)HOST_INTEREST->hi_option_flag & HI_OPTION_ENABLE_PROFILE)
+ (HOST_INTEREST->hi_option_flag & HI_OPTION_ENABLE_PROFILE)
#define LF_TIMER_STABILIZATION_IS_ENABLED() \
- (!((volatile A_UINT32)HOST_INTEREST->hi_option_flag & HI_OPTION_NO_LFT_STBL))
+ (!(HOST_INTEREST->hi_option_flag & HI_OPTION_NO_LFT_STBL))
#define IS_AMSDU_OFFLAOD_ENABLED() \
- (((volatile A_UINT32)HOST_INTEREST->hi_option_flag2 & HI_OPTION_OFFLOAD_AMSDU))
+ ((HOST_INTEREST->hi_option_flag2 & HI_OPTION_OFFLOAD_AMSDU))
#define HOST_INTEREST_DFS_IS_ENABLED() \
- (((volatile A_UINT32)HOST_INTEREST->hi_option_flag2 & HI_OPTION_DFS_SUPPORT))
+ ((HOST_INTEREST->hi_option_flag2 & HI_OPTION_DFS_SUPPORT))
#define HOST_INTEREST_EARLY_CFG_DONE() \
- (((volatile A_UINT32)HOST_INTEREST->hi_option_flag2 & HI_OPTION_EARLY_CFG_DONE))
+ ((HOST_INTEREST->hi_option_flag2 & HI_OPTION_EARLY_CFG_DONE))
/*power save flag bit definitions*/
#define HI_PWR_SAVE_LPL_ENABLED 0x1
@@ -615,14 +641,13 @@ PREPACK64 struct host_interest_s {
#define HOST_INTEREST_ITEM_ADDRESS(TargetType, item) \
(((TargetType) == TARGET_TYPE_AR6002) ? AR6002_HOST_INTEREST_ITEM_ADDRESS(item) : \
- (((TargetType) == TARGET_TYPE_AR6003) ? AR6003_HOST_INTEREST_ITEM_ADDRESS(item) : \
- (((TargetType) == TARGET_TYPE_AR6004) ? AR6004_HOST_INTEREST_ITEM_ADDRESS(item) : \
- (((TargetType) == TARGET_TYPE_AR6006) ? AR6006_HOST_INTEREST_ITEM_ADDRESS(item) : \
- (((TargetType) == TARGET_TYPE_AR9888) ? AR9888_HOST_INTEREST_ITEM_ADDRESS(item) : \
- (((TargetType) == TARGET_TYPE_AR6320) ? AR6320_HOST_INTEREST_ITEM_ADDRESS(item) : \
- (((TargetType) == TARGET_TYPE_AR6320V2) ? AR6320_HOST_INTEREST_ITEM_ADDRESS(item) : \
- (((TargetType) == TARGET_TYPE_AR900B) ? AR900B_HOST_INTEREST_ITEM_ADDRESS(item) : \
- 0))))))))
+ (((TargetType) == TARGET_TYPE_AR6003) ? AR6003_HOST_INTEREST_ITEM_ADDRESS(item) : \
+ (((TargetType) == TARGET_TYPE_AR6004) ? AR6004_HOST_INTEREST_ITEM_ADDRESS(item) : \
+ (((TargetType) == TARGET_TYPE_AR6006) ? AR6006_HOST_INTEREST_ITEM_ADDRESS(item) : \
+ (((TargetType) == TARGET_TYPE_AR9888) ? AR9888_HOST_INTEREST_ITEM_ADDRESS(item) : \
+ (((TargetType) == TARGET_TYPE_AR6320) ? AR6320_HOST_INTEREST_ITEM_ADDRESS(item) : \
+ (((TargetType) == TARGET_TYPE_AR900B) ? AR900B_HOST_INTEREST_ITEM_ADDRESS(item) : \
+ 0)))))))
#define AR6002_BOARD_DATA_SZ 768
#define AR6002_BOARD_EXT_DATA_SZ 0
@@ -639,6 +664,8 @@ PREPACK64 struct host_interest_s {
#define AR9888_BOARD_EXT_DATA_SZ 0
#define AR6320_BOARD_DATA_SZ 8192
#define AR6320_BOARD_EXT_DATA_SZ 0
+#define QCA9377_BOARD_DATA_SZ 8192
+#define QCA9377_BOARD_EXT_DATA_SZ 0
#define AR900B_BOARD_DATA_SZ 7168
#define AR900B_BOARD_EXT_DATA_SZ 0
diff --git a/target/inc/wal_rx_desc.h b/target/inc/wal_rx_desc.h
index 04cd50dda82d..408075567354 100644
--- a/target/inc/wal_rx_desc.h
+++ b/target/inc/wal_rx_desc.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2012, 2014 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2012, 2014, 2016 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -41,15 +41,31 @@
*
*/
#if !defined(ATH_PERF_PWR_OFFLOAD)
+#if defined(CONFIG_AR900B_SUPPORT) || defined(AR900B)
+#include <hw/interface/rx_location_info.h>
+#include <hw/interface/rx_pkt_end.h>
+#include <hw/interface/rx_phy_ppdu_end.h>
+#include <hw/interface/rx_timing_offset.h>
+#include <hw/interface/rx_location_info.h>
+#include <hw/tlv/rx_attention.h>
+#include <hw/tlv/rx_frag_info.h>
+#include <hw/tlv/rx_msdu_start.h>
+#include <hw/tlv/rx_msdu_end.h>
+#include <hw/tlv/rx_mpdu_start.h>
+#include <hw/tlv/rx_mpdu_end.h>
+#include <hw/tlv/rx_ppdu_start.h>
+#include <hw/tlv/rx_ppdu_end.h>
+#else
/* HW rx descriptor definitions */
-#include <hw/mac_descriptors/rx_attention.h>
-#include <hw/mac_descriptors/rx_frag_info.h>
-#include <hw/mac_descriptors/rx_msdu_start.h>
-#include <hw/mac_descriptors/rx_msdu_end.h>
-#include <hw/mac_descriptors/rx_mpdu_start.h>
-#include <hw/mac_descriptors/rx_mpdu_end.h>
-#include <hw/mac_descriptors/rx_ppdu_start.h>
-#include <hw/mac_descriptors/rx_ppdu_end.h>
+#include <mac_descriptors/rx_attention.h>
+#include <mac_descriptors/rx_frag_info.h>
+#include <mac_descriptors/rx_msdu_start.h>
+#include <mac_descriptors/rx_msdu_end.h>
+#include <mac_descriptors/rx_mpdu_start.h>
+#include <mac_descriptors/rx_mpdu_end.h>
+#include <mac_descriptors/rx_ppdu_start.h>
+#include <mac_descriptors/rx_ppdu_end.h>
+#endif
/*
* This struct defines the basic descriptor information, which is
* written by the 11ac HW MAC into the WAL's rx status descriptor
@@ -73,10 +89,13 @@ struct hw_rx_desc_base {
struct fw_rx_desc_base {
union {
struct {
- A_UINT8 discard : 1,
- forward : 1,
- any_err : 1,
- dup_err : 1, reserved : 1, inspect : 1, extension : 2;
+ A_UINT8 discard:1,
+ forward:1,
+ any_err:1,
+ dup_err:1,
+ ipa_ind:1,
+ inspect:1,
+ extension:2;
} bits;
A_UINT8 val;
} u;
@@ -86,8 +105,8 @@ struct fw_rx_desc_base {
#define FW_RX_DESC_DISCARD_S 0
#define FW_RX_DESC_FORWARD_M 0x2
#define FW_RX_DESC_FORWARD_S 1
-#define FW_RX_DESC_MIC_ERR_M 0x4
-#define FW_RX_DESC_MIC_ERR_S 2
+#define FW_RX_DESC_ANY_ERR_M 0x4
+#define FW_RX_DESC_ANY_ERR_S 2
#define FW_RX_DESC_DUP_ERR_M 0x8
#define FW_RX_DESC_DUP_ERR_S 3
#define FW_RX_DESC_INSPECT_M 0x20
@@ -124,4 +143,98 @@ enum {
#define FW_RX_DESC_EXT_SET(_var, _val) \
((_var) |= ((_val) << FW_RX_DESC_EXT_S))
+/*
+ * This struct defines TCP_CHKSUM_OFFLOAD bit fields which are needed by host.
+ */
+struct fw_rx_msdu_info {
+ union {
+ /*
+ * The "bits" struct defines the flags in fw_rx_msdu_info used
+ * during regular operation.
+ */
+ struct {
+ A_UINT8 tcp_udp_chksum_fail:1, /* for tcp checksum offload use */
+ ip_chksum_fail:1,
+ ipv6_proto:1,
+ tcp_proto:1,
+ udp_proto:1,
+ ip_frag:1,
+ first_wakeup:1,
+ reserved:1;
+ } bits;
+ /*
+ * The "mon" struct defines the flags in fw_rx_msdu_info used
+ * during monitor mode.
+ */
+ struct {
+ A_UINT8 last_frag:1,
+ reserved:7;
+ } mon;
+ A_UINT8 val;
+ } u;
+};
+
+/* regular operation flags */
+
+#define FW_RX_MSDU_INFO_TCP_UDP_CHKSUM_FAIL_M 0x1
+#define FW_RX_MSDU_INFO_TCP_UDP_CHKSUM_FAIL_S 0
+#define FW_RX_MSDU_INFO_IP_CHKSUM_FAIL_M 0x2
+#define FW_RX_MSDU_INFO_IP_CHKSUM_FAIL_S 1
+#define FW_RX_MSDU_INFO_IPV6_PROTO_M 0x4
+#define FW_RX_MSDU_INFO_IPV6_PROTO_S 2
+#define FW_RX_MSDU_INFO_TCP_PROTO_M 0x8
+#define FW_RX_MSDU_INFO_TCP_PROTO_S 3
+#define FW_RX_MSDU_INFO_UDP_PROTO_M 0x10
+#define FW_RX_MSDU_INFO_UDP_PROTO_S 4
+#define FW_RX_MSDU_INFO_IP_FRAG_M 0x20
+#define FW_RX_MSDU_INFO_IP_FRAG_S 5
+#define FW_RX_MSDU_INFO_FIRST_WAKEUP_M 0x40
+#define FW_RX_MSDU_INFO_FIRST_WAKEUP_S 6
+
+#define FW_RX_MSDU_INFO_TCP_UDP_CHKSUM_FAIL_GET(_var) \
+ (((_var) & FW_RX_MSDU_INFO_TCP_UDP_CHKSUM_FAIL_M) >> FW_RX_MSDU_INFO_TCP_UDP_CHKSUM_FAIL_S)
+#define FW_RX_MSDU_INFO_TCP_UDP_CHKSUM_FAIL_SET(_var, _val) \
+ ((_var) |= ((_val) << FW_RX_MSDU_INFO_TCP_UDP_CHKSUM_FAIL_S))
+
+#define FW_RX_MSDU_INFO_IP_CHKSUM_FAIL_GET(_var) \
+ (((_var) & FW_RX_MSDU_INFO_IP_CHKSUM_FAIL_M) >> FW_RX_MSDU_INFO_IP_CHKSUM_FAIL_S)
+#define FW_RX_MSDU_INFO_IP_CHKSUM_FAIL_SET(_var, _val) \
+ ((_var) |= ((_val) << FW_RX_MSDU_INFO_IP_CHKSUM_FAIL_S))
+
+#define FW_RX_MSDU_INFO_IPV6_PROTO_GET(_var) \
+ (((_var) & FW_RX_MSDU_INFO_IPV6_PROTO_M) >> FW_RX_MSDU_INFO_IPV6_PROTO_S)
+#define FW_RX_MSDU_INFO_IPV6_PROTO_SET(_var, _val) \
+ ((_var) |= ((_val) << FW_RX_MSDU_INFO_IPV6_PROTO_S))
+
+#define FW_RX_MSDU_INFO_TCP_PROTO_GET(_var) \
+ (((_var) & FW_RX_MSDU_INFO_TCP_PROTO_M) >> FW_RX_MSDU_INFO_TCP_PROTO_S)
+#define FW_RX_MSDU_INFO_TCP_PROTO_SET(_var, _val) \
+ ((_var) |= ((_val) << FW_RX_MSDU_INFO_TCP_PROTO_S))
+
+#define FW_RX_MSDU_INFO_UDP_PROTO_GET(_var) \
+ (((_var) & FW_RX_MSDU_INFO_UDP_PROTO_M) >> FW_RX_MSDU_INFO_UDP_PROTO_S)
+#define FW_RX_MSDU_INFO_UDP_PROTO_SET(_var, _val) \
+ ((_var) |= ((_val) << FW_RX_MSDU_INFO_UDP_PROTO_S))
+
+#define FW_RX_MSDU_INFO_IP_FRAG_GET(_var) \
+ (((_var) & FW_RX_MSDU_INFO_IP_FRAG_M) >> FW_RX_MSDU_INFO_IP_FRAG_S)
+#define FW_RX_MSDU_INFO_IP_FRAG_SET(_var, _val) \
+ ((_var) |= ((_val) << FW_RX_MSDU_INFO_IP_FRAG_S))
+
+#define FW_RX_MSDU_INFO_FIRST_WAKEUP_GET(_var) \
+ (((_var) & FW_RX_MSDU_INFO_FIRST_WAKEUP_M) >> FW_RX_MSDU_INFO_FIRST_WAKEUP_S)
+#define FW_RX_MSDU_INFO_FIRST_WAKEUP_SET(_var, _val) \
+ ((_var) |= ((_val) << FW_RX_MSDU_INFO_FIRST_WAKEUP_S))
+
+
+/* monitor mode flags */
+
+#define FW_RX_MSDU_INFO_MON_LAST_FRAG_M 0x1
+#define FW_RX_MSDU_INFO_MON_LAST_FRAG_S 0
+
+
+#define FW_RX_MSDU_INFO_MON_LAST_FRAG_GET(_var) \
+ (((_var) & FW_RX_MSDU_INFO_MON_LAST_FRAG_M) >> FW_RX_MSDU_INFO_MON_LAST_FRAG_S)
+#define FW_RX_MSDU_INFO_MON_LAST_FRAG_SET(_var, _val) \
+ ((_var) |= ((_val) << FW_RX_MSDU_INFO_MON_LAST_FRAG_S))
#endif /* _WAL_RX_DESC__H_ */
diff --git a/target/inc/wlan_defs.h b/target/inc/wlan_defs.h
index d28b4c25d2c8..252ad131a9a4 100644
--- a/target/inc/wlan_defs.h
+++ b/target/inc/wlan_defs.h
@@ -25,12 +25,11 @@
* to the Linux Foundation.
*/
-#ifndef __WLANDEFS_H__
-#define __WLANDEFS_H__
+#ifndef __WLAN_DEFS_H__
+#define __WLAN_DEFS_H__
/* A_COMPILE_TIME_ASSERT */
#include <a_osapi.h>
-#include <osdep.h>
/*
* This file contains WLAN definitions that may be used across both
@@ -41,6 +40,7 @@
* but for now provide a default value here in case it's not defined
* in the fwconfig_xxx.h file.
*/
+#define NUM_SPATIAL_STREAM 2
#ifndef MAX_SPATIAL_STREAM
#define MAX_SPATIAL_STREAM 3
#endif
@@ -74,7 +74,7 @@ typedef enum {
MODE_11AC_VHT20_2G = 11,
MODE_11AC_VHT40_2G = 12,
MODE_11AC_VHT80_2G = 13,
-#if CONFIG_160MHZ_SUPPORT != 0
+#if CONFIG_160MHZ_SUPPORT
MODE_11AC_VHT80_80 = 14,
MODE_11AC_VHT160 = 15,
#endif
@@ -102,9 +102,15 @@ typedef enum {
/* MODE_UNKNOWN_11AX_SUPPORT = 24,*/ /* not needed? */
MODE_UNKNOWN_160MHZ_SUPPORT = MODE_UNKNOWN, /* not needed? */
+#ifdef ATHR_WIN_NWF
+ PHY_MODE_MAX = MODE_UNKNOWN,
+ PHY_MODE_MAX_NO_160_MHZ_SUPPORT = MODE_UNKNOWN_NO_160MHZ_SUPPORT,
+ PHY_MODE_MAX_160_MHZ_SUPPORT = MODE_UNKNOWN_160MHZ_SUPPORT,
+#else
MODE_MAX = MODE_UNKNOWN,
MODE_MAX_NO_160_MHZ_SUPPORT = MODE_UNKNOWN_NO_160MHZ_SUPPORT,
MODE_MAX_160_MHZ_SUPPORT = MODE_UNKNOWN_160MHZ_SUPPORT,
+#endif
} WLAN_PHY_MODE;
#if CONFIG_160MHZ_SUPPORT == 0
@@ -131,7 +137,7 @@ typedef enum {
WLAN_11AG_CAPABILITY = 3,
} WLAN_CAPABILITY;
-#if defined(CONFIG_AR900B_SUPPORT) || defined(AR900B)
+#if (NUM_SPATIAL_STREAM > 3)
#define A_RATEMASK A_UINT64
#else
#define A_RATEMASK A_UINT32
@@ -262,15 +268,6 @@ typedef struct {
A_UINT32 high_5ghz_chan;
} HAL_REG_CAPABILITIES;
-typedef enum {
- WHAL_REG_EXT_FCC_MIDBAND = 0,
- WHAL_REG_EXT_JAPAN_MIDBAND = 1,
- WHAL_REG_EXT_FCC_DFS_HT40 = 2,
- WHAL_REG_EXT_JAPAN_NONDFS_HT40 = 3,
- WHAL_REG_EXT_JAPAN_DFS_HT40 = 4,
- WHAL_REG_EXT_FCC_CH_144 = 5,
-} WHAL_REG_EXT_BITMAP;
-
/*
* Used to update rate-control logic with the status of the tx-completion.
* In host-based implementation of the rate-control feature, this struture is used to
@@ -342,7 +339,7 @@ typedef A_UINT8 A_RATE;
#error "Extend rate table module first"
#endif
-#define MAX_IBSS_PEERS 32
+#define MAX_PEERS 32
#if defined(CONFIG_AR900B_SUPPORT) || defined(AR900B)
typedef struct {
@@ -839,4 +836,13 @@ struct wlan_dbg_tidq_stats {
struct wlan_dbg_txq_stats txq_st;
};
+typedef enum {
+ WHAL_REG_EXT_FCC_MIDBAND = 0,
+ WHAL_REG_EXT_JAPAN_MIDBAND = 1,
+ WHAL_REG_EXT_FCC_DFS_HT40 = 2,
+ WHAL_REG_EXT_JAPAN_NONDFS_HT40 = 3,
+ WHAL_REG_EXT_JAPAN_DFS_HT40 = 4,
+ WHAL_REG_EXT_FCC_CH_144 = 5,
+} WHAL_REG_EXT_BITMAP;
+
#endif /* __WLANDEFS_H__ */
diff --git a/target/inc/wmi_services.h b/target/inc/wmi_services.h
index 3e31c74b9610..7d89b6308e42 100644
--- a/target/inc/wmi_services.h
+++ b/target/inc/wmi_services.h
@@ -181,6 +181,24 @@ typedef enum {
* the host from suspend
*/
WMI_SERVICE_MARK_FIRST_WAKEUP_PACKET,
+ /* FW supports command that can add/delete multiple mcast filters */
+ WMI_SERVICE_MULTIPLE_MCAST_FILTER_SET,
+ /* WMI_SERVICE_HOST_MANAGED_RX_REORDER -
+ * FW supports host-managed RX reorder.
+ * Host managed RX reorder involves RX BA state machine handling
+ * on peer/TID basis, REO configuration for HW based reordering/PN
+ * check and processing reorder exceptions generated by HW.
+ */
+ WMI_SERVICE_HOST_MANAGED_RX_REORDER,
+ /* Specify whether the target supports the following WMI messages
+ * for reading / writing its flash memory:
+ * WMI_READ_DATA_FROM_FLASH_CMDID,
+ * WMI_READ_DATA_FROM_FLASH_EVENTID,
+ * WMI_TRANSFER_DATA_TO_FLASH_CMDID,
+ * WMI_TRANSFER_DATA_TO_FLASH_COMPLETE_EVENTID,
+ */
+ WMI_SERVICE_FLASH_RDWR_SUPPORT,
+
WMI_MAX_SERVICE = 128 /* max service */
} WMI_SERVICE;
diff --git a/target/inc/wmi_tlv_defs.h b/target/inc/wmi_tlv_defs.h
index 6d59985cb899..bf35bacd3c3b 100644
--- a/target/inc/wmi_tlv_defs.h
+++ b/target/inc/wmi_tlv_defs.h
@@ -714,6 +714,14 @@ typedef enum {
WMITLV_TAG_STRUC_wmi_p2p_lo_start_cmd_fixed_param,
WMITLV_TAG_STRUC_wmi_p2p_lo_stop_cmd_fixed_param,
WMITLV_TAG_STRUC_wmi_p2p_lo_stopped_event_fixed_param,
+ WMITLV_TAG_STRUC_wmi_peer_reorder_queue_setup_cmd_fixed_param,
+ WMITLV_TAG_STRUC_wmi_peer_reorder_queue_remove_cmd_fixed_param,
+ WMITLV_TAG_STRUC_wmi_set_multiple_mcast_filter_cmd_fixed_param,
+ WMITLV_TAG_STRUC_wmi_mgmt_tx_compl_bundle_event_fixed_param,
+ WMITLV_TAG_STRUC_wmi_read_data_from_flash_cmd_fixed_param,
+ WMITLV_TAG_STRUC_wmi_read_data_from_flash_event_fixed_param,
+ WMITLV_TAG_STRUC_wmi_pdev_set_reorder_timeout_val_cmd_fixed_param,
+ WMITLV_TAG_STRUC_wmi_peer_set_rx_blocksize_cmd_fixed_param,
} WMITLV_TAG_ID;
/*
@@ -1003,6 +1011,12 @@ typedef enum {
OP(WMI_DBGLOG_TIME_STAMP_SYNC_CMDID) \
OP(WMI_P2P_LISTEN_OFFLOAD_START_CMDID) \
OP(WMI_P2P_LISTEN_OFFLOAD_STOP_CMDID) \
+ OP(WMI_PEER_REORDER_QUEUE_SETUP_CMDID) \
+ OP(WMI_PEER_REORDER_QUEUE_REMOVE_CMDID) \
+ OP(WMI_SET_MULTIPLE_MCAST_FILTER_CMDID) \
+ OP(WMI_READ_DATA_FROM_FLASH_CMDID) \
+ OP(WMI_PDEV_SET_REORDER_TIMEOUT_VAL_CMDID) \
+ OP(WMI_PEER_SET_RX_BLOCKSIZE_CMDID) \
/* add new CMD_LIST elements above this line */
/*
@@ -1154,6 +1168,8 @@ typedef enum {
OP(WMI_PDEV_SET_MAC_CONFIG_RESP_EVENTID) \
OP(WMI_RADIO_TX_POWER_LEVEL_STATS_EVENTID) \
OP(WMI_P2P_LISTEN_OFFLOAD_STOPPED_EVENTID) \
+ OP(WMI_MGMT_TX_BUNDLE_COMPLETION_EVENTID) \
+ OP(WMI_READ_DATA_FROM_FLASH_EVENTID) \
/* add new EVT_LIST elements above this line */
/* TLV definitions of WMI commands */
@@ -1162,7 +1178,8 @@ typedef enum {
#define WMITLV_TABLE_WMI_INIT_CMDID(id,op,buf,len) \
WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_init_cmd_fixed_param, wmi_init_cmd_fixed_param, fixed_param, WMITLV_SIZE_FIX) \
WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_resource_config, wmi_resource_config, resource_config, WMITLV_SIZE_FIX) \
- WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_STRUC, wlan_host_memory_chunk, host_mem_chunks, WMITLV_SIZE_VAR)
+ WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_ARRAY_STRUC, wlan_host_memory_chunk, host_mem_chunks, WMITLV_SIZE_VAR) \
+ WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_pdev_set_hw_mode_cmd_fixed_param, wmi_pdev_set_hw_mode_cmd_fixed_param, hw_mode, WMITLV_SIZE_FIX)
WMITLV_CREATE_PARAM_STRUC(WMI_INIT_CMDID);
@@ -1651,13 +1668,13 @@ WMITLV_CREATE_PARAM_STRUC(WMI_RTT_MEASREQ_CMDID);
WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_BYTE, A_UINT8, data, WMITLV_SIZE_VAR)
WMITLV_CREATE_PARAM_STRUC(WMI_RTT_TSF_CMDID);
-/*RTT OEM req Cmd - DEPRECATED */
+/* RTT OEM req Cmd */
#define WMITLV_TABLE_WMI_OEM_REQ_CMDID(id,op,buf,len) \
WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_BYTE, A_UINT8, data, WMITLV_SIZE_VAR)
WMITLV_CREATE_PARAM_STRUC(WMI_OEM_REQ_CMDID);
-/* RTT OEM request Cmd */
+/* RTT OEM request Cmd - DEPRECATED */
#define WMITLV_TABLE_WMI_OEM_REQUEST_CMDID(id, op, buf, len) \
WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_ARRAY_BYTE, A_UINT8, data, WMITLV_SIZE_VAR)
WMITLV_CREATE_PARAM_STRUC(WMI_OEM_REQUEST_CMDID);
@@ -1797,6 +1814,12 @@ WMITLV_CREATE_PARAM_STRUC(WMI_FORCE_FW_HANG_CMDID);
WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_WMI_SET_MCASTBCAST_FILTER_CMD_fixed_param, WMI_SET_MCASTBCAST_FILTER_CMD_fixed_param, fixed_param, WMITLV_SIZE_FIX)
WMITLV_CREATE_PARAM_STRUC(WMI_SET_MCASTBCAST_FILTER_CMDID);
+/* Enhanced Mcast add/delete filter list cmd */
+#define WMITLV_TABLE_WMI_SET_MULTIPLE_MCAST_FILTER_CMDID(id, op, buf, len) \
+ WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_set_multiple_mcast_filter_cmd_fixed_param, WMI_SET_MULTIPLE_MCAST_FILTER_CMD_fixed_param, fixed_param, WMITLV_SIZE_FIX) \
+ WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_ARRAY_FIXED_STRUC, wmi_mac_addr, mcast_list, WMITLV_SIZE_VAR)
+WMITLV_CREATE_PARAM_STRUC(WMI_SET_MULTIPLE_MCAST_FILTER_CMDID);
+
/* Set dbglog time stamp sync cmd */
#define WMITLV_TABLE_WMI_DBGLOG_TIME_STAMP_SYNC_CMDID(id, op, buf, len) \
WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_dbglog_time_stamp_sync_cmd_fixed_param, WMI_DBGLOG_TIME_STAMP_SYNC_CMD_fixed_param, fixed_param, WMITLV_SIZE_FIX)
@@ -2514,6 +2537,10 @@ WMITLV_CREATE_PARAM_STRUC(WMI_LRO_CONFIG_CMDID);
WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_ARRAY_BYTE, A_UINT8, data, WMITLV_SIZE_VAR)
WMITLV_CREATE_PARAM_STRUC(WMI_TRANSFER_DATA_TO_FLASH_CMDID);
+#define WMITLV_TABLE_WMI_READ_DATA_FROM_FLASH_CMDID(id, op, buf, len) \
+ WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_read_data_from_flash_cmd_fixed_param, wmi_read_data_from_flash_cmd_fixed_param, fixed_param, WMITLV_SIZE_FIX)
+WMITLV_CREATE_PARAM_STRUC(WMI_READ_DATA_FROM_FLASH_CMDID);
+
#define WMITLV_TABLE_WMI_CONFIG_ENHANCED_MCAST_FILTER_CMDID(id, op, buf, len) \
WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_config_enhanced_mcast_filter_fixed_param, wmi_config_enhanced_mcast_filter_cmd_fixed_param, fixed_param, WMITLV_SIZE_FIX)
WMITLV_CREATE_PARAM_STRUC(WMI_CONFIG_ENHANCED_MCAST_FILTER_CMDID);
@@ -2871,12 +2898,32 @@ WMITLV_CREATE_PARAM_STRUC(WMI_SET_PERIODIC_CHANNEL_STATS_CONFIG_CMDID);
WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_ARRAY_UINT32, A_UINT32, args, WMITLV_SIZE_VAR)
WMITLV_CREATE_PARAM_STRUC(WMI_PDEV_WAL_POWER_DEBUG_CMDID);
+/* pdev set reorder timeout val */
+#define WMITLV_TABLE_WMI_PDEV_SET_REORDER_TIMEOUT_VAL_CMDID(id, op, buf, len) \
+ WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_pdev_set_reorder_timeout_val_cmd_fixed_param, wmi_pdev_set_reorder_timeout_val_cmd_fixed_param, fixed_param, WMITLV_SIZE_FIX)
+WMITLV_CREATE_PARAM_STRUC(WMI_PDEV_SET_REORDER_TIMEOUT_VAL_CMDID);
+
+/* peer set rx blocksize cmd */
+#define WMITLV_TABLE_WMI_PEER_SET_RX_BLOCKSIZE_CMDID(id, op, buf, len) \
+ WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_peer_set_rx_blocksize_cmd_fixed_param, wmi_peer_set_rx_blocksize_cmd_fixed_param, fixed_param, WMITLV_SIZE_FIX)
+WMITLV_CREATE_PARAM_STRUC(WMI_PEER_SET_RX_BLOCKSIZE_CMDID);
+
/* Bandwidth Fairness (BWF) peer configure commands */
#define WMITLV_TABLE_WMI_PEER_BWF_REQUEST_CMDID(id, op, buf, len) \
WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_peer_bwf_request_fixed_param, wmi_peer_bwf_request_fixed_param, fixed_param, WMITLV_SIZE_FIX) \
WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_ARRAY_STRUC, wmi_bwf_peer_info, peer_info, WMITLV_SIZE_VAR)
WMITLV_CREATE_PARAM_STRUC(WMI_PEER_BWF_REQUEST_CMDID);
+/* peer reorder queue setup cmd */
+#define WMITLV_TABLE_WMI_PEER_REORDER_QUEUE_SETUP_CMDID(id, op, buf, len) \
+ WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_peer_reorder_queue_setup_cmd_fixed_param, wmi_peer_reorder_queue_setup_cmd_fixed_param, fixed_param, WMITLV_SIZE_FIX)
+WMITLV_CREATE_PARAM_STRUC(WMI_PEER_REORDER_QUEUE_SETUP_CMDID);
+
+/* peer reorder queue remove cmd */
+#define WMITLV_TABLE_WMI_PEER_REORDER_QUEUE_REMOVE_CMDID(id, op, buf, len) \
+ WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_peer_reorder_queue_remove_cmd_fixed_param, wmi_peer_reorder_queue_remove_cmd_fixed_param, fixed_param, WMITLV_SIZE_FIX)
+WMITLV_CREATE_PARAM_STRUC(WMI_PEER_REORDER_QUEUE_REMOVE_CMDID);
+
/************************** TLV definitions of WMI events *******************************/
@@ -2999,6 +3046,13 @@ WMITLV_CREATE_PARAM_STRUC(WMI_TX_PAUSE_EVENTID);
WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_mgmt_tx_compl_event_fixed_param, wmi_mgmt_tx_compl_event_fixed_param, fixed_param, WMITLV_SIZE_FIX)
WMITLV_CREATE_PARAM_STRUC(WMI_MGMT_TX_COMPLETION_EVENTID);
+/* Bundled Mgmt TX completion event */
+#define WMITLV_TABLE_WMI_MGMT_TX_BUNDLE_COMPLETION_EVENTID(id, op, buf, len) \
+ WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_mgmt_tx_compl_bundle_event_fixed_param, wmi_mgmt_tx_compl_bundle_event_fixed_param, fixed_param, WMITLV_SIZE_FIX) \
+ WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_ARRAY_UINT32, A_UINT32, desc_ids, WMITLV_SIZE_VAR) \
+ WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_ARRAY_UINT32, A_UINT32, status, WMITLV_SIZE_VAR)
+WMITLV_CREATE_PARAM_STRUC(WMI_MGMT_TX_BUNDLE_COMPLETION_EVENTID);
+
/* VDEV Start response Event */
#define WMITLV_TABLE_WMI_VDEV_START_RESP_EVENTID(id,op,buf,len) \
WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_vdev_start_response_event_fixed_param, wmi_vdev_start_response_event_fixed_param, fixed_param, WMITLV_SIZE_FIX)
@@ -3071,7 +3125,9 @@ WMITLV_CREATE_PARAM_STRUC(WMI_ROAM_EVENTID);
WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_channel, wmi_channel, chan, WMITLV_SIZE_FIX) \
WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_ARRAY_STRUC, wmi_key_material, key, WMITLV_SIZE_VAR) \
WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_ARRAY_UINT32, A_UINT32, status, WMITLV_SIZE_VAR) \
- WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_ARRAY_BYTE, A_UINT8, reassoc_req_frame, WMITLV_SIZE_VAR)
+ WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_ARRAY_BYTE, A_UINT8, reassoc_req_frame, WMITLV_SIZE_VAR) \
+ WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_ARRAY_STRUC, wmi_pdev_hw_mode_transition_event_fixed_param, hw_mode_transition_fixed_param, WMITLV_SIZE_VAR) \
+ WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_ARRAY_STRUC, wmi_pdev_set_hw_mode_response_vdev_mac_entry, wmi_pdev_set_hw_mode_response_vdev_mac_mapping, WMITLV_SIZE_VAR)
WMITLV_CREATE_PARAM_STRUC(WMI_ROAM_SYNCH_EVENTID);
/* WOW Wakeup Host Event */
@@ -3144,6 +3200,11 @@ WMITLV_CREATE_PARAM_STRUC(WMI_RSSI_BREACH_EVENTID);
WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_transfer_data_to_flash_complete_event_fixed_param, wmi_transfer_data_to_flash_complete_event_fixed_param, fixed_param, WMITLV_SIZE_FIX)
WMITLV_CREATE_PARAM_STRUC(WMI_TRANSFER_DATA_TO_FLASH_COMPLETE_EVENTID);
+#define WMITLV_TABLE_WMI_READ_DATA_FROM_FLASH_EVENTID(id, op, buf, len) \
+ WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_read_data_from_flash_event_fixed_param, wmi_read_data_from_flash_event_fixed_param, fixed_param, WMITLV_SIZE_FIX) \
+ WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_ARRAY_BYTE, A_UINT8, data, WMITLV_SIZE_VAR)
+WMITLV_CREATE_PARAM_STRUC(WMI_READ_DATA_FROM_FLASH_EVENTID);
+
/* Diagnostics Event */
#define WMITLV_TABLE_WMI_DIAG_EVENTID(id,op,buf,len) \
WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_BYTE, A_UINT8, bufp, WMITLV_SIZE_VAR)
diff --git a/target/inc/wmi_unified.h b/target/inc/wmi_unified.h
index a89ca17317e4..85537be7add0 100644
--- a/target/inc/wmi_unified.h
+++ b/target/inc/wmi_unified.h
@@ -122,7 +122,7 @@ extern "C" {
(((num_entries) / (32 / (bits_per_entry))) + \
(((num_entries) % (32 / (bits_per_entry))) ? 1 : 0))
-static inline A_UINT32 wmi_packed_arr_get_bits(A_UINT32 *arr,
+static INLINE A_UINT32 wmi_packed_arr_get_bits(A_UINT32 *arr,
A_UINT32 entry_index, A_UINT32 bits_per_entry)
{
A_UINT32 entries_per_uint = (32 / bits_per_entry);
@@ -134,7 +134,7 @@ static inline A_UINT32 wmi_packed_arr_get_bits(A_UINT32 *arr,
((1 << bits_per_entry) - 1);
}
-static inline void wmi_packed_arr_set_bits(A_UINT32 *arr, A_UINT32 entry_index,
+static INLINE void wmi_packed_arr_set_bits(A_UINT32 *arr, A_UINT32 entry_index,
A_UINT32 bits_per_entry, A_UINT32 val)
{
A_UINT32 entries_per_uint = (32 / bits_per_entry);
@@ -345,8 +345,10 @@ typedef enum {
WMI_SET_PERIODIC_CHANNEL_STATS_CONFIG_CMDID,
/** WMI command for power debug framework */
WMI_PDEV_WAL_POWER_DEBUG_CMDID,
+ /** set per-AC rx reorder timeouts */
+ WMI_PDEV_SET_REORDER_TIMEOUT_VAL_CMDID,
- /* VDEV(virtual device) specific commands */
+ /* VDEV (virtual device) specific commands */
/** vdev create */
WMI_VDEV_CREATE_CMDID = WMI_CMD_GRP_START_ID(WMI_GRP_VDEV),
/** vdev delete */
@@ -443,6 +445,13 @@ typedef enum {
WMI_PEER_ATF_REQUEST_CMDID,
/** bandwidth fairness (BWF) peer configuration request command */
WMI_PEER_BWF_REQUEST_CMDID,
+ /** rx reorder queue setup for peer/tid */
+ WMI_PEER_REORDER_QUEUE_SETUP_CMDID,
+ /** rx reorder queue remove for peer/tid */
+ WMI_PEER_REORDER_QUEUE_REMOVE_CMDID,
+ /** specify a limit for rx A-MPDU block size */
+ WMI_PEER_SET_RX_BLOCKSIZE_CMDID,
+
/* beacon/management specific commands */
@@ -791,6 +800,10 @@ typedef enum {
WMI_VDEV_WISA_CMDID,
/** set debug log time stamp sync up with host */
WMI_DBGLOG_TIME_STAMP_SYNC_CMDID,
+ /** Command for host to set/delete multiple mcast filters */
+ WMI_SET_MULTIPLE_MCAST_FILTER_CMDID,
+ /** upload a requested section of data from firmware flash to host */
+ WMI_READ_DATA_FROM_FLASH_CMDID,
/* GPIO Configuration */
WMI_GPIO_CONFIG_CMDID = WMI_CMD_GRP_START_ID(WMI_GRP_GPIO),
@@ -1117,6 +1130,9 @@ typedef enum {
WMI_OFFLOAD_PROB_RESP_TX_STATUS_EVENTID,
/** Event for Mgmt TX completion event */
WMI_MGMT_TX_COMPLETION_EVENTID,
+ /** Event for Mgmt TX bundle completion event */
+ WMI_MGMT_TX_BUNDLE_COMPLETION_EVENTID,
+
/*ADDBA Related WMI Events */
/** Indication the completion of the prior
@@ -1279,6 +1295,9 @@ typedef enum {
/** event to report SCPC calibrated data to host */
WMI_PDEV_UTF_SCPC_EVENTID,
+ /** event to provide requested data from the target's flash memory */
+ WMI_READ_DATA_FROM_FLASH_EVENTID,
+
/* GPIO Event */
WMI_GPIO_INPUT_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_GPIO),
/** upload H_CV info WMI event
@@ -2293,6 +2312,9 @@ typedef struct {
#define WMI_RSRC_CFG_FLAG_QWRAP_MODE_ENABLE_S 8
#define WMI_RSRC_CFG_FLAG_QWRAP_MODE_ENABLE_M 0x100
+ #define WMI_RSRC_CFG_FLAG_MGMT_COMP_EVT_BUNDLE_SUPPORT_S 9
+ #define WMI_RSRC_CFG_FLAG_MGMT_COMP_EVT_BUNDLE_SUPPORT_M 0x200
+
A_UINT32 flag1;
/** @brief smart_ant_cap - Smart Antenna capabilities information
@@ -2399,6 +2421,11 @@ typedef struct {
#define WMI_RSRC_CFG_FLAG_QWRAP_MODE_ENABLE_GET(word32) \
WMI_RSRC_CFG_FLAG_GET((word32), QWRAP_MODE_ENABLE)
+#define WMI_RSRC_CFG_FLAG_MGMT_COMP_EVT_BUNDLE_SUPPORT_SET(word32, value) \
+ WMI_RSRC_CFG_FLAG_SET((word32), MGMT_COMP_EVT_BUNDLE_SUPPORT, (value))
+#define WMI_RSRC_CFG_FLAG_MGMT_COMP_EVT_BUNDLE_SUPPORT_GET(word32) \
+ WMI_RSRC_CFG_FLAG_GET((word32), MGMT_COMP_EVT_BUNDLE_SUPPORT)
+
typedef struct {
A_UINT32 tlv_header; /* TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_init_cmd_fixed_param */
@@ -2410,9 +2437,16 @@ typedef struct {
A_UINT32 num_host_mem_chunks;
/** size of array host_mem_chunks[] */
- /* The TLVs for resource_config and host_mem_chunks[] will follow.
+ /* The TLVs for resource_config, host_mem_chunks[], and
+ * hw_mode_config will follow.
* wmi_resource_config resource_config;
* wlan_host_memory_chunk host_mem_chunks[];
+ * wmi_pdev_set_hw_mode_cmd_fixed_param hw_mode_config;
+ * Note that the hw_mode_config, in spite of its "pdev" name,
+ * applies to the entire target rather than for a single pdev
+ * within the target.
+ * To avoid specifying a HW mode for the target, the host should
+ * fill hw_mode_config's fields with 0x0.
*/
} wmi_init_cmd_fixed_param;
@@ -2583,6 +2617,11 @@ typedef struct {
#define WMI_SCAN_CAPTURE_PHY_ERROR 0x8000
/** always do passive scan on passive channels */
#define WMI_SCAN_FLAG_STRICT_PASSIVE_ON_PCHN 0x1000
+/** set HALF (10MHz) rate support */
+#define WMI_SCAN_FLAG_HALF_RATE_SUPPORT 0x20000
+/** set Quarter (5MHz) rate support */
+#define WMI_SCAN_FLAG_QUARTER_RATE_SUPPORT 0x40000
+
/** for adaptive scan mode using 3 bits (21 - 23 bits) */
#define WMI_SCAN_DWELL_MODE_MASK 0x00E00000
#define WMI_SCAN_DWELL_MODE_SHIFT 21
@@ -3686,6 +3725,17 @@ typedef enum {
WMI_PDEV_PARAM_CUST_TXPOWER_SCALE,
/** ATF enabe/disabe dynamically */
WMI_PDEV_PARAM_ATF_DYNAMIC_ENABLE,
+ /** Set tx retry limit for control frames. 0 = disable, 31 = max */
+ WMI_PDEV_PARAM_CTRL_RETRY_LIMIT,
+ /** Set propagation delay for 2G / 5G band.
+ * The propagation delay is fundamentally a per-peer property, but
+ * the target may not support per-peer settings for ack timeouts.
+ * This pdev parameter allows the MAC-level ack timeout to be set to
+ * a value suitable for the worst-case propagation delay of any peer
+ * within that pdev.
+ * Units are microseconds.
+ */
+ WMI_PDEV_PARAM_PROPAGATION_DELAY,
} WMI_PDEV_PARAM;
@@ -3905,6 +3955,15 @@ typedef struct {
A_UINT32 status; /* WMI_MGMT_TX_COMP_STATUS_TYPE */
} wmi_mgmt_tx_compl_event_fixed_param;
+typedef struct {
+ A_UINT32 tlv_header;
+ A_UINT32 num_reports;
+ /* tlv for completion
+ * A_UINT32 desc_ids[num_reports]; <- from tx_send_cmd
+ * A_UINT32 status[num_reports]; <- WMI_MGMT_TX_COMP_STATUS_TYPE
+ */
+} wmi_mgmt_tx_compl_bundle_event_fixed_param;
+
#define WMI_TPC_RATE_MAX 160
/* WMI_TPC_TX_NUM_CHAIN macro can't be changed without breaking the WMI compatibility */
#define WMI_TPC_TX_NUM_CHAIN 4
@@ -6534,6 +6593,24 @@ typedef struct {
} wmi_peer_delete_cmd_fixed_param;
typedef struct {
+ /**
+ * TLV tag and len; tag equals
+ * WMITLV_TAG_STRUC_wmi_peer_set_rx_blocksize_cmd_fixed_param
+ */
+ A_UINT32 tlv_header;
+ /** unique id identifying the VDEV, generated by the caller */
+ A_UINT32 vdev_id;
+ /** peer MAC address */
+ wmi_mac_addr peer_macaddr;
+ /**
+ * maximum block ack window size to use during a rx block ack
+ * negotiation, i.e. the maximum number of MPDUs per A-MPDU
+ * that will be received
+ */
+ A_UINT32 rx_block_ack_win_limit;
+} wmi_peer_set_rx_blocksize_cmd_fixed_param;
+
+typedef struct {
A_UINT32 tlv_header; /** TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_peer_flush_tids_cmd_fixed_param */
/** unique id identifying the VDEV, generated by the caller */
A_UINT32 vdev_id;
@@ -6775,6 +6852,14 @@ typedef struct {
#define WMI_PEER_SET_MAX_TX_RATE 0x11
/** Set peer minimal tx rate (MCS) in adaptive rate ctrl */
#define WMI_PEER_SET_MIN_TX_RATE 0x12
+/**
+ * default ring routing for peer data packets,
+ * param_value = bit 0 for hash based routing enabled or not
+ * (value 1 is enabled, value 0 is disabled)
+ * bits 1:5 are for ring 32 (i.e. ring id value
+ * selected from 0 to 31 values)
+ */
+#define WMI_PEER_SET_DEFAULT_ROUTING 0x13
/** mimo ps values for the parameter WMI_PEER_MIMO_PS_STATE */
#define WMI_PEER_MIMO_PS_NONE 0x0
@@ -7798,7 +7883,9 @@ typedef struct {
#define WMI_ROAM_INVOKE_FLAG_ADD_CH_TO_CACHE 0
/* indicate to host of failure if WMI_ROAM_INVOKE_CMDID. */
#define WMI_ROAM_INVOKE_FLAG_REPORT_FAILURE 1
-/* from bit 2 to bit 31 are reserved */
+/* during host-invoked roaming, don't send null data frame to AP */
+#define WMI_ROAM_INVOKE_FLAG_NO_NULL_FRAME_TO_AP 2
+/* from bit 3 to bit 31 are reserved */
#define WMI_SET_ROAM_INVOKE_ADD_CH_TO_CACHE(flag) do { \
(flag) |= (1 << WMI_SET_ROAM_INVOKE_ADD_CH_TO_CACHE); \
@@ -9686,8 +9773,12 @@ typedef struct {
A_UINT32 type; /*0:unused 1: ASSERT, 2: not respond detect command,3: simulate ep-full(),4:... */
A_UINT32 delay_time_ms; /*0xffffffff means the simulate will delay for random time (0 ~0xffffffff ms) */
} WMI_FORCE_FW_HANG_CMD_fixed_param;
-#define WMI_MCAST_FILTER_SET 1
-#define WMI_MCAST_FILTER_DELETE 2
+
+typedef enum {
+ WMI_MCAST_FILTER_SET = 1,
+ WMI_MCAST_FILTER_DELETE
+} WMI_SET_SINGLE_MCAST_FILTER_OP;
+
typedef struct {
A_UINT32 tlv_header;
A_UINT32 vdev_id;
@@ -9696,6 +9787,28 @@ typedef struct {
wmi_mac_addr mcastbdcastaddr;
} WMI_SET_MCASTBCAST_FILTER_CMD_fixed_param;
+typedef enum {
+ WMI_MULTIPLE_MCAST_FILTER_CLEAR = 1, /* clear all previous mc list */
+ /* clear all previous mc list, and set new list */
+ WMI_MULTIPLE_MCAST_FILTER_SET,
+ WMI_MULTIPLE_MCAST_FILTER_DELETE, /* delete one/multiple mc list */
+ WMI_MULTIPLE_MCAST_FILTER_ADD /* add one/multiple mc list */
+} WMI_MULTIPLE_MCAST_FILTER_OP;
+
+typedef struct {
+ A_UINT32 tlv_header;
+ A_UINT32 vdev_id;
+ A_UINT32 operation; /* refer WMI_MULTIPLE_MCAST_FILTER_OP */
+ /* number of elements in the subsequent mcast addr list */
+ A_UINT32 num_mcastaddrs;
+ /**
+ * TLV (tag length value) parameters follow the
+ * structure. The TLV's are:
+ * wmi_mac_addr mcastaddr_list[num_mcastaddrs];
+ */
+} WMI_SET_MULTIPLE_MCAST_FILTER_CMD_fixed_param;
+
+
/* WMI_DBGLOG_TIME_STAMP_SYNC_CMDID */
typedef enum {
WMI_TIME_STAMP_SYNC_MODE_MS, /* millisecond units */
@@ -10241,6 +10354,16 @@ enum wmi_tdls_peer_reason {
WMI_TDLS_ENTER_BT_BUSY_MODE,
/** BT exited busy mode, TDLS connection tracker needs to handle this */
WMI_TDLS_EXIT_BT_BUSY_MODE,
+ /*
+ * TDLS module received a scan start event, TDLS connection tracker
+ * needs to handle this
+ */
+ WMI_TDLS_SCAN_STARTED_EVENT,
+ /*
+ * TDLS module received a scan complete event, TDLS connection tracker
+ * needs to handle this
+ */
+ WMI_TDLS_SCAN_COMPLETED_EVENT,
};
/* WMI_TDLS_PEER_EVENTID */
@@ -14376,6 +14499,64 @@ typedef struct {
*/
} wmi_pdev_hw_mode_transition_event_fixed_param;
+/**
+ * This command is sent from WLAN host driver to firmware for
+ * plugging in reorder queue desc to lithium hw.
+ *
+ * Example: plug-in queue desc for TID 5
+ * host->target: WMI_PEER_REORDER_QUEUE_SETUP_CMDID,
+ * (vdev_id = PEER vdev id,
+ * peer_macaddr = PEER mac addr,
+ * tid = 5,
+ * queue_ptr_lo = queue desc addr lower 32 bits,
+ * queue_ptr_hi = queue desc addr higher 32 bits,
+ * queue_no = 16-bit number assigned by host for queue,
+ * stored in bits 15:0 of queue_no field)
+ */
+typedef struct {
+ /* TLV tag and len; tag equals
+ * WMITLV_TAG_STRUC_wmi_peer_reorder_queue_setup_cmd_fixed_param
+ */
+ A_UINT32 tlv_header;
+ A_UINT32 vdev_id;
+ /* peer mac address */
+ wmi_mac_addr peer_macaddr;
+ /* 0 to 15 = QoS TIDs, 16 = non-qos TID */
+ A_UINT32 tid;
+ /* lower 32 bits of queue desc adddress */
+ A_UINT32 queue_ptr_lo;
+ /* upper 32 bits of queue desc adddress */
+ A_UINT32 queue_ptr_hi;
+ /* 16-bit number assigned by host for queue,
+ * stored in bits 15:0 of queue_no field
+ */
+ A_UINT32 queue_no;
+} wmi_peer_reorder_queue_setup_cmd_fixed_param;
+
+/**
+ * This command is sent from WLAN host driver to firmware for
+ * removing one or more reorder queue desc to lithium hw.
+ *
+ * Example: remove queue desc for all TIDs
+ * host->target: WMI_PEER_REORDER_REMOVE_CMDID,
+ * (vdev_id = PEER vdev id,
+ * peer_macaddr = PEER mac addr,
+ * tid = 0x1FFFF,
+ */
+typedef struct {
+ /* TLV tag and len;
+ * tag equals
+ * WMITLV_TAG_STRUC_wmi_peer_reorder_queue_remove_cmd_fixed_param
+ */
+ A_UINT32 tlv_header;
+ A_UINT32 vdev_id;
+ /* peer mac address */
+ wmi_mac_addr peer_macaddr;
+ /* bits 0 to 15 = QoS TIDs, bit 16 = non-qos TID */
+ A_UINT32 tid_mask;
+} wmi_peer_reorder_queue_remove_cmd_fixed_param;
+
+
/* DEPRECATED - use wmi_pdev_set_mac_config_response_event_fixed_param
* instead
*/
@@ -14819,10 +15000,6 @@ typedef struct {
A_UINT32 toeplitz_hash_ipv6_40;
} wmi_lro_info_cmd_fixed_param;
-/*
- * This structure is used to set the pattern for WOW host wakeup pin pulse
- * pattern confirguration.
- */
typedef struct {
/*
* TLV tag and len; tag equals
@@ -14845,6 +15022,27 @@ typedef struct {
A_UINT32 status;
} wmi_transfer_data_to_flash_complete_event_fixed_param;
+typedef struct {
+ /*
+ * TLV tag and len; tag equals
+ * WMITLV_TAG_STRUC_wmi_read_data_from_flash_cmd_fixed_param
+ */
+ A_UINT32 tlv_header;
+ A_UINT32 offset; /* flash offset to read, starting from 0 */
+ A_UINT32 length; /* data length to read, unit: byte */
+} wmi_read_data_from_flash_cmd_fixed_param;
+
+typedef struct {
+ /*
+ * TLV tag and len; tag equals
+ * WMITLV_TAG_STRUC_wmi_read_data_from_flash_event_fixed_param
+ */
+ A_UINT32 tlv_header;
+ A_UINT32 status; /* Return status. 0 for success, non-zero otherwise */
+ A_UINT32 offset; /* flash offset reading from, starting from 0 */
+ A_UINT32 length; /* length of data being reported, unit: byte */
+} wmi_read_data_from_flash_event_fixed_param;
+
typedef enum {
ENHANCED_MCAST_FILTER_DISABLED,
ENHANCED_MCAST_FILTER_ENABLED
@@ -15680,6 +15878,30 @@ typedef struct {
**/
} wmi_pdev_wal_power_debug_cmd_fixed_param;
+typedef struct {
+ /*
+ * TLV tag and len; tag equals
+ * WMITLV_TAG_STRUC_wmi_pdev_set_reorder_timeout_val_cmd_fixed_param
+ */
+ A_UINT32 tlv_header;
+ /**
+ * @brief rx_timeout_pri - what rx reorder timeout (ms) to use
+ * for the AC
+ * @details
+ * Each WMM access category (voice, video, best-effort,
+ * background) will have its own timeout value to dictate
+ * how long to wait for missing rx MPDUs to arrive before
+ * releasing subsequent MPDUs that have already been
+ * received.
+ * This parameter specifies the timeout in milliseconds
+ * for each access category.
+ * The array elements are indexed by the WMI_AC enum to
+ * identify which array element corresponds to which AC /
+ * traffic type.
+ */
+ A_UINT32 rx_timeout_pri[WMI_AC_MAX];
+} wmi_pdev_set_reorder_timeout_val_cmd_fixed_param;
+
typedef enum {
WLAN_2G_CAPABILITY = 0x1,
WLAN_5G_CAPABILITY = 0x2,
diff --git a/target/inc/wmi_version.h b/target/inc/wmi_version.h
index 039ae77ffc5e..9bda8c027465 100644
--- a/target/inc/wmi_version.h
+++ b/target/inc/wmi_version.h
@@ -36,7 +36,7 @@
#define __WMI_VER_MINOR_ 0
/** WMI revision number has to be incremented when there is a
* change that may or may not break compatibility */
-#define __WMI_REVISION_ 260
+#define __WMI_REVISION_ 271
/** The Version Namespace should not be normally changed. Only
* host and firmware of the same WMI namespace will work
diff --git a/uapi/linux/osapi_linux.h b/uapi/linux/osapi_linux.h
index 221c1a4b0d4f..77de5272aac2 100644
--- a/uapi/linux/osapi_linux.h
+++ b/uapi/linux/osapi_linux.h
@@ -57,10 +57,16 @@
#define __ATTRIB_PACK __attribute__ ((packed))
#define __ATTRIB_PRINTF __attribute__ ((format (printf, 1, 2)))
#define __ATTRIB_NORETURN __attribute__ ((noreturn))
+#ifndef INLINE
+#define INLINE __inline__
+#endif
#else /* Not GCC */
#define __ATTRIB_PACK
#define __ATTRIB_PRINTF
#define __ATTRIB_NORETURN
+#ifndef INLINE
+#define INLINE __inline
+#endif
#endif /* End __GNUC__ */
#define PREPACK