Commit Graph

3148 Commits

Author SHA1 Message Date
Vinay Adella
dbf8b39a83 qcacmn: Remove excessive logging in console
Move to qdf_debug API to avoid excessive logging.
As these logs can come in interrupt context, it can cause
latencies to other threads.

Change-Id: Ibcada15235a74e9534588ae08d21bf97f4d61393
CRs-Fixed: 3120558
2022-02-28 09:10:17 -08:00
Manoj Ekbote
e78a527ac1 qcacmn: TWT componentization changes
Include relevant header for MAX_SESSIONS and use
the correct build flag to retrieve session params.

CRs-Fixed: 3136148
Change-Id: I28ef98a67cbe479c5d8be93c49f9ae6ce63ba982
2022-02-28 09:10:11 -08:00
Krishna Rao
30b0de6998 qcacmn: Add support for ML IE defragmentation
Add support for Multi-Link element defragmentation in the common
handler for generating link specific (re)association request/response,
as well as in the API for getting per-STA partner link information.

CRs-Fixed: 3116412
Change-Id: I237c593b44ec3a7c3347ccb95633cec362ba5411
2022-02-28 09:10:04 -08:00
Jyoti Kumari
6ff68674b9 qcacmn: Handle TWT disable reason code
When host sends TWT disable command to firmware, send reason code
also as part of it. So that firmware will check and take the
following action:
a. If host sends disable due SCC/MCC concurrency then firmware
will teardown the existing TWT session and send the teardown
reason code as concurrency to host.
b. If it's for other reason then it will take action based on
that.

Change-Id: I5b4584a964f142d17aef5629adeb12e686fd983c
CRs-Fixed: 3098862
2022-02-28 07:53:44 -08:00
Bapiraju Alla
c0267fdbb4 qcacmn: Initialize total_weight while initializing BSS score config
Currently, total_weight is not initialized before calculating
default ML BSS weightage with INI configuration. This may result in
unexpected behavior.

To resolve this, calculate ML bss weight after calculating non-ML
BSS score weight.

Change-Id: I4b9455e0ce69dec5c837f92acad60ac83cdd2502
CRs-Fixed: 3127454
2022-02-25 01:46:00 -08:00
nakul kachhwaha
6c2a986833 qcacmn: Export objmgr APIs and add lmac_if registration APIs
Export objmgr APIs to be used by SON module to register
and unregister create/destroy handler.
Also add lmac_if API to register lmac_if ops from SON
module.

Change-Id: Id4c19807792b9f7b46387ae907f853151e4e28c6
CRs-Fixed: 3118986
2022-02-24 04:25:26 -08:00
Lincoln Tran
badb6230e2 qcacmn: Back to back connect changes
Currently, the code does not handle an MLO connect when in
non-init state. Add logic to clean up any existing connection
before going ahead with the latest request.

Change-Id: Ia5a10bcc1e0d2c8e82d6ea0d82d1a5bf0604a1e5
CRs-fixed: 3116687
2022-02-23 20:49:08 -08:00
Bapiraju Alla
6bb2ad7c5b qcacmn: Get partner vdev using vdev ID instead of link ID
While notifying the ML connection status to the supplicant, partner vdev
information will be filled in the connect response. This partner vdev info
is populated using partner link IDs. This may cause issues since it is
not guaranteed that link id information in the partner vdev is valid while
notifying the connection status to the supplicant.

To address this, get partner vdev information using vdev ID instead of
link ID.

Change-Id: I5e45b038b1fe5b6ab9c6bbb514eefb0ad4c39e66
CRs-Fixed: 3117702
2022-02-23 11:10:35 -08:00
Sai Pavan Akhil Remella
bc1866e129 qcacmn: Use global OC table for lookup while updating RNR db
Operating class field used in RNR IE is of global operating
class. When getting frequency from RNR IE region specific
operating class is used for lookup instead of global.

Added changes to search operating class from global OC
table.

Change-Id: I200ab46187fed91cc66cd954b062c8d8ac44f631
CRs-Fixed: 3131600
2022-02-21 04:55:54 -08:00
Krishna Rao
3f38db23d4 qcacmn: Add APIs to defragment elem/subelem fragment sequence
Add APIs to defragment a sequence of 802.11 element/subelement
fragments. Add an inline mode to carry out the defragmentation within
the source buffer in order to reduce buffer requirements and to
eliminate memory copies/moves for the lead element/sublement.
Conversely, add a non-inline mode to copy the defragmented payload to
a separate buffer.

Add common helper functionality shared between these APIs.

CRs-Fixed: 3124132
Change-Id: Ia68584e918ddcf626b748f2b0c3a5da6492b40b6
2022-02-19 10:54:58 -08:00
Lincoln Tran
94df448341 qcacmn: Return from function if pointers are NULL
In some MLO functions, there are NULL pointer checks, but the logic
continues even if it is NULL. Return from the function in this case so
there is no potential NULL pointer dereference. This also addresses
a static analysis issue.

Change-Id: I22c4a47d724d8576a2ce78059dec219cbc3de91e
CRs-fixed: 3127461
2022-02-19 06:25:14 -08:00
Srinivas Dasari
f8921a74b9 qcacmn: Wait for RSO stop response from firmware
Firmware doesn't expect any vdev commands from host while RSO stop
is happening. It sends a response to the RSO_STOP command once
it's done with cleanup. Host needs to run a timer and wait for a
maximum of 6 seconds for the response. Host can stop the timer and
allow the commands to firmware in the below cases,
1. RSO_STOP response with success status
2. RSO_STOP response with HO_FAIL status followed by
   HO_FAIL event: Host needs to wait till HO_FAIL event is
   received

If firmware doesn't send any response in the 6 seconds wait, issue
a recovery to help to check the firmware state.

Change-Id: I4577f9b0aac71c0c86bd32b59e69d9527bf107b9
CRs-Fixed: 3106032
2022-02-18 23:21:21 -08:00
Srinivas Pitla
e8ea09fe28 qcacmn: Fix static analysis issue in ML AID free
This change handles the scenario,if the caller passes invalid
link ix during AID free

Change-Id: I494cb55573ea5d8ecd351aac454d3395710273c1
CRs-Fixed: 3127458
2022-02-18 16:39:23 -08:00
Sajini R
1ec23ade38 qcacmn: Increase max number of socs to 5
For Quad-band IPQ9574 + 3 QCN9000 RDP, max number of SOCs
needs to be increased to 4 and another IPQ9574 RDP with QCN9224
might mostly have upto 4 PCI devices, hence increase the number
of max SOCs to 5.

Change-Id: Ie8a121c630bc41f084ca772a84503c816ed86514
2022-02-18 05:56:22 -08:00
Krishna Rao
8b712ebbaf qcacmn: Add APIs to get info about elem/subelem fragment sequence
Add an API to get the following information for a first 802.11 element
present in the beginning of a given buffer, and a series of elements
after it in the given buffer: a) Whether a contiguous subset of these
elements starting with the first element form an element fragment
sequence. b) If they form an element fragment sequence, then the total
length of this sequence inclusive of headers and payloads of all the
elements in the sequence. c) If they form an element fragment
sequence, then the total size of the payloads of all the elements in
the sequence (not including the element ID extension of the lead
element, if applicable).

Similarly, add an API to get the following information for a first
802.11 subelement present in the beginning of a given buffer, and a
series of subelements after it in the given buffer: a) Whether a
contiguous subset of these subelements starting with the first
subelement form a subelement fragment sequence. b) If they form a
subelement fragment sequence, then the total length of this sequence
inclusive of headers and payloads of all the subelements in the
sequence. c) If they form a subelement fragment sequence, then the
total size of the payloads of all the subelements in the sequence.

Add common helper functionality shared between these APIs.

CRs-Fixed: 3124120
Change-Id: I26d2d75670dbb99c927517181d58f4d816ae754b
2022-02-18 04:53:12 -08:00
Hariharan Basuthkar
9ae0959d63 qcacmn: Rectify compilation error when CONFIG_BAND_6GHZ is disabled
When CONFIG_BAND_6GHZ is disabled, compilation error is observed
due to the absence of the declaration of reg_convert_enum_to_6g_idx
and reg_get_reg_maschan_lst_frm_6g_pwr_mode.

To fix this issue, add static declarations for
reg_convert_enum_to_6g_idx and reg_get_reg_maschan_lst_frm_6g_pwr_mode
when CONFIG_BAND_6GHZ is disabled.

Change-Id: I616de6cd2630be1897da6cd87a29569e51bf058e
CRs-Fixed: 3131119
2022-02-17 05:03:35 -08:00
Balaji Pothunoori
37411ce595 qcacmn: disable reg channels based on ini check
Disable ini channels based on coex_unsafe_chan_reg_disable
ini configuration.

Change-Id: Ia3acbc133cab4865d8ad69992e893be91439f837
CRs-Fixed: 3129049
2022-02-16 22:27:07 -08:00
Krishna Rao
b76c403d0e qcacmn: Add APIs to create elem/sublem fragment sequence
Add an API to create a sequence of 802.11 element fragments, and
similarly, add an API to create a sequence of 802.11 subelement
fragments. Add an inline mode for both these APIs to carry out the
fragmentation within the source buffer in order to reduce buffer
requirements and to eliminate memory copies/moves for the lead
element/subelement. Conversely, add a non-inline mode to create the
fragment sequence in a separate buffer.

Add common helper functionality shared between these APIs.

CRs-Fixed: 3124099
Change-Id: I48ef6e529360ea40d58320327a50884bc1638689
2022-02-16 15:11:43 -08:00
Krishna Rao
046cd79da6 qcacmn: Add APIs to get elem/subelem frag generation requirements
Add an API to get information on requirements related to generation of
802.11 element fragment sequence. Currently this includes an
indication of whether fragmentation is required or not for the given
element ID and payload length, and if fragmentation is appplicable,
the minimum required size of the buffer where the element fragment
sequence created would be written.

Similarly, add an API to get information on requirements related to
generation of 802.11 subelement fragment sequence. Currently this
includes an indication of whether fragmentation is required or not for
the given payload length, and if fragmentation is appplicable, the
minimum required size of the buffer where the subelement fragment
sequence created would be written.

Create common helper functionality shared between the above APIs.

CRs-Fixed: 3124090
Change-Id: I7047e2117aae1a8856ee49c460f333914aa19a8b
2022-02-16 15:11:37 -08:00
Vignesh Mohan
43f535bce4 qcacmn: Update pdev freq ranges after every country set
During mode switch no new service ready happens. However,
a mode switch function re-inits the regulatory channel list
with appropriate chip ranges.
After driver insmod and during device creation the chip
ranges (2g+5g) are initialized. However, if a sequence of wifi down
and ini mode change and wifi up happens, the chip ranges for pdev
are not updated (as it happens for dynamic mode switch command)
and we continue to use the old device object and the old chip ranges.
Since the mode has changed we also need to change the ranges in
the device object. Since the country code event comes for every
wifi up and down, Update the 2G and 5G frequency ranges supported by
the pdev in the regulatory pdev private object from the service
ready values for every country set to make sure that changes in
HW mode are also handled during wifi down and up.

Change-Id: Id1f486e73d792f77c591e39e216556e512a8b59f
CRs-Fixed: 3088128
2022-02-15 17:28:29 -08:00
Ananya Barat
6ee7701aab qcacmn: Add APIs to query min and max chanwidth supported by channel
1. Add reg_get_min_chwidth to return the max chanwidth supported by
regulatory given the primary frequency and the pdev.

2. Add reg_get_max_chwidth to return the max chanwidth supported by
regulatory given the primary frequency and the pdev.

3. Add dispatcher functions for both

Change-Id: Ia21198fe778d32b1673e5dd30c8cd621cded2c45
CRs-Fixed: 3098311
2022-02-15 17:27:45 -08:00
Hariharan Basuthkar
8d8e72cf71 qcacmn: Compute freq for channels in other 6G power type
The API reg_compute_chan_to_freq() computes frequencies only for channels
present in master channel list. A 6G channel may not belong to the current
(current power type's) master channel but be present in different 6g power
type's master channel list.

So if a 6G channel is not found in the current (current power type's)
master channel list, then search for the channel in all the 6g power's
master channel list to compute the frequency.

Change-Id: I7ccdaeb1f9de8d9baabe59ad673d445ed36a6a2d
2022-02-14 14:47:25 -08:00
Naveen S
8b6625530d qcacmn: Removal of pre lithium wlan driver support in 12.x Software
Code related to IPQ4019 is removed

Change-Id: I64ef452cafe64840576f40a8f35bc617b9978c96
2022-02-14 07:12:47 -08:00
Balaji Pothunoori
76b13083fb qcacmn: update chan avoid ind for wmi_wlan_freq_avoid_event_id
If coex_unsafe_chan_nb_user_prefer ini is not set then
avoid_freq_ind becoming NULL for "wmi_wlan_freq_avoid_event_id"
which results in sending regulatory update event to user space
and reduces PNO scan timeline.

This change is to update ch_avoid_ind for
wmi_wlan_freq_avoid_event_id.

Fixes regression : 7192d90810 ("qcacmn: update unsafe channel
list for SAP for freq extcmd")

Change-Id: I57ff334e9cf47468c30bc6884a9ead0a65a92b23
CRs-Fixed: 3119140
2022-02-11 07:36:42 -08:00
Bing Sun
bdbcc9ddf0 qcacmn: Handle CSA in MLO sta partner link before it is up
Before MLO sta partner link is up, FW can't indicate CSA event to host.
For this case, host need save csa parameters and process it when MLO
sta partner link is up.

Change-Id: Id1803f32787002e020c6899ec72e428feb765b7f
CRs-Fixed: 3082438
2022-02-11 02:57:46 -08:00
Bing Sun
7ee4663048 qcacmn: Save quiet status to sta context of MLO mgr
Save quiet status of indicated link to sta contect of MLO mgr. Any link
should check quiet status of MLO connection, then decide whether it
can trigger inactivity to FW or not.

Change-Id: Ic294bbe6452030b6cae495ca0dd3e504416e2c9e
CRs-Fixed: 3117825
2022-02-11 02:57:40 -08:00
Srinivas Girigowda
f048242a78 qcacmn: Add support for twt get_status cp_stats changes
Add support for twt get_status cp_stats changes

Change-Id: Iac1039876d6bb50504af6fec2f976253e3a1ead3
CRs-Fixed: 3085698
2022-02-11 00:25:56 -08:00
Srinivas Girigowda
75335f0708 qcacmn: Add support for WMI_TWT_SESSION_STATS_EVENT
Add support for WMI_TWT_SESSION_STATS_EVENT.

Change-Id: I7bee07360824ca599c82d9dc3f1709acb00466d8
CRs-Fixed: 3085541
2022-02-11 00:25:41 -08:00
Srinivas Girigowda
2040cc94c8 qcacmn: Add support for TWT get capabilities
Add support for TWT get capabilities.

Change-Id: Ib52401f1ef57b0ffab4fb32aa45a2e9435612fc4
CRs-Fixed: 3085389
2022-02-11 00:25:34 -08:00
Srinivas Girigowda
fd35443a0a qcacmn: Add support for TWT disable operation
Add support for TWT disable operation.

Change-Id: I302ac6a3898f53ea25030d9a15d8d14988287b27
CRs-Fixed: 3085373
2022-02-11 00:25:20 -08:00
Srinivas Girigowda
2d0aea5c1d qcacmn: Add support for TWT enable operation
Add support for TWT enable operation.

Change-Id: I638a4a78bf33d7185d8eab1f6735c3db0abfcd53
CRs-Fixed: 3085373
2022-02-11 00:25:12 -08:00
Srinivas Girigowda
724bbb16c1 qcacmn: TWT init and register WMI events
Initialize TWT tx/rx ops and register WMI events.

Change-Id: Iaf10d5870be89360c74a829dbfdb461d3ee67b8c
CRs-Fixed: 3085369
2022-02-11 00:25:06 -08:00
Srinivas Girigowda
fb22b66fd2 qcacmn: Populate TWT target capabilities
Read TWT target capabilities and update the TWT object manager
data structure.

Change-Id: I03a4b8f367ccc749443139cbedb3c76e4ef8cd39
CRs-Fixed: 3085366
2022-02-11 00:25:00 -08:00
Srinivas Girigowda
415b9134bf qcacmn: TWT obj mgr initialization
Initialize TWT object manager.

Change-Id: Ic38fe24d4d6ada0597dabbc2df70d9b32737014a
CRs-Fixed: 3085360
2022-02-11 00:24:54 -08:00
Srinivas Girigowda
b6ef4fe306 qcacmn: umac: Add TWT componentization structs and skeleton code
Add TWT componentization structs and skeleton code.

Change-Id: I1c99c15b94cc39c6e5c7a32eea0d8095cf72555c
CRs-Fixed: 3085344
2022-02-11 00:24:42 -08:00
Santosh Anbu
7260cc5d95 qcacmn: Add pdev check when creating MLD vdevs
MLD can be formed only between APs of different pdev.
Add check to avoid creation of MLD between vdevs of same pdev.

Change-Id: I00f53de7016050b120db4b90b2e7662ea81612af
CRs-Fixed: 3104153
2022-02-10 12:49:48 -08:00
Santosh Anbu
94f1c1c7ed qcacmn: Add opmode check when creating vdevs with MLD
MLD can be formed only b/w AP vdevs or STA vdevs.
MLDs cannot contain vdevs of different opmode.

Add change to check for opmode of MLD VDEVs

Change-Id: I21112ba111bcadc48adf582b7ca9e7b936bd8e91
CRs-Fixed: 3104152
2022-02-10 04:25:41 -08:00
Srinivas Girigowda
9630b58469 qcacmn: connection_mgr: Add API ucfg_cm_get_connected_band()
Implement an API to get connected band information.

Change-Id: I682a749d293afd06a4fe12acf985cc5d44d11db8
CRs-Fixed: 3104394
2022-02-08 18:25:29 -08:00
Vignesh U
809a5a3602 qcacmn: Address compilation error in non-6G PFs
The structure members of regulatory pdev private object,
is_6g_channel_list_populated and super_chan_list are 6G specific but are
used outside the 6G macro 'CONFIG_BAND_6GHZ'. It is used in get channel
list API reg_get_pwrmode_chan_list(), that is commonly called for all the
bands.

Move the 6G portion of get channel list API to a separate API
reg_get_6g_pwrmode_chan_list() that is empty for non-6G platforms.

Change-Id: If9aeedbf157536d10912f4ee1d92f42146b19759
2022-02-08 15:05:34 -08:00
Shashikala Prabhu
4905072179 qcacmn: Use the correct datatype for wireless modes
Wireless mode is of datatype uint64_t but in some places, it is used
as uint32_t.

In this change, replaced 'uint32_t wireless_modes' with
'uint64_t wireless_modes'.

Change-Id: I13b5781ddb14fc0131668e1710df19ae75eb1e34
CRs-Fixed: 3119562
2022-02-08 07:44:41 -08:00
Amith A
bf6d8b4a64 qcacmn: Remove duplicate copyright
Remove duplicate copyrights

Change-Id: I7115db15f82df17cc972c76d013008cbaf57b9ae
2022-02-08 02:05:17 -08:00
Bing Sun
fd0ac6014b qcacmn: Refine 5g bonded channel state with static puncturing
Refine reg_get_5g_bonded_channel_state_for_freq with static puncturing.
Update channel state as CHANNEL_STATE_DFS or CHANNEL_STATE_ENABLE if
its puncture bitmap is valid with given bandwidth.

Change-Id: I3503c8bcf6094b9c98056809f1c304747ba97667
CRs-Fixed: 3106240
2022-02-07 20:22:11 -08:00
Vignesh U
2806fac2c3 qcacmn: Add reg_get_pwrmode_chan_list API
Add reg_get_pwrmode_chan_list() which will take an input 6G power mode
and will use super channel list to build the 6G power mode based channel
list.

The 2G and 5G portion of this channel list will be same as the current
channel list and if the input power mode is REG_CURRENT_PWR_MODE, then
also the current channel list is copied to the given buffer.

If the input 6G power mode is REG_BEST_PWR_MODE then all the 6G frequencies
supported by the current country will be present and will indicate the
power values of the best power mode possible for that entry.

For other 6G power types only the 6G portion of the channel list is
modified as per the input 6g power mode.

Change-Id: Ib22399ac950af87ee64ecdb78089bb2ff5221f69
2022-02-07 16:41:35 -08:00
Rahul Gusain
949beb6cad qcacmn: Send fils discovery template to wmi layer
Add support to send Fils discovery template via target if

Add func to compute shortssid with the help of shortssid table

Change-Id: I78fa50641ee5ae0c338719c4cec91573a212f396
CRs-Fixed: 3114903
2022-02-07 12:27:04 -08:00
Vignesh U
2b442113ee qcacmn: Address compilation issues
The API reg_get_superchan_entry() is defined under macro CONFIG_BAND_6GHZ,
but used outside it in the API reg_is_freq_idx_enabled_on_given_pwr_mode().

Place reg_is_freq_idx_enabled_on_given_pwr_mode() under the macro
CONFIG_BAND_6GHZ since it is applicable only for 6G and call the API
reg_is_freq_idx_enabled_on_cur_chan_list() for non-6G.

Change-Id: Ieb3efd946f19515dab3fc0c8086e1c508c9f75ad
2022-02-04 03:31:31 -08:00
Srinivas Dasari
c49f8063e7 qcacmn: Move MLO link vdev to UP state upon legacy to MLO roaming
Host driver creates two vdev as part of initial connection.
If the connected AP supports MLO, both(sta and link) of the vdevs
would be moved to UP state. Otherwise, link vdev would be in INIT
state and not moved to UP state.
Firmware sends roam sync indication to host when it roams to a
new AP. The event carries new AP info and the new AP could be
MLO AP. If the current AP is non-MLO and new(roamed) AP is MLO AP,
move the link vdev state to UP as it's in INIT state.

Change-Id: Ib5dd216074d68b0001755024153263ba9654edbe
CRs-Fixed: 3106059
2022-02-03 16:46:15 -08:00
Srinivas Pitla
6d7ae524a3 qcacmn: Implement primary UMAC selection based on RSSI
This implements RSSI Primary UMAC selection algorithm for MLO

Change-Id: Ia1901e91e2b6184a5895c4d784425f387cd9474d
CRs-Fixed: 3105927
2022-02-02 13:15:37 -08:00
Vivek
aa6ee918d6 qcacmn: Rename the MLO multicast macro
There is a difference in the macro used in the
MLO multicast macro used in control path and DP

Changing the macro to be the same as DP code.
Also fixed minor issue in the MLO mcast WMI
identified while testing with the macro enabled.

Change-Id: I0c24a69628336f74d627863dd4bd4c4bef685b6c
CRs-Fixed: 3102733
2022-02-02 12:06:40 -08:00
Pooventhiran G
886ce189d0 qcacmn: Track PN failures with relevant stats
When validating MMIE, if PN error is found, track it using relevant
statistics. Defined WMI_HOST_RXERR_PN to flag such PN errors.

Change-Id: Icb1fe9a653f67611539b5cb463adfceadedae38e
2022-02-02 03:16:24 -08:00
Vignesh U
dcec4534a1 qcacmn: Based on input 6g power mode find if freq is enabled or not
Add the new sets of APIs that checks if given freq is enabled on given
power mode's channel list.

Also, remove reg_is_chan_disabled() and replace the callers with
reg_is_chan_disabled_and_not_nol().

Change-Id: I65ee6b8dde629b0e31b050b478300a8ba5ae5b4a
2022-02-01 23:36:04 -08:00