Commit Graph

205 Commits

Author SHA1 Message Date
Vignesh Mohan
862db46074 qcacmn: Add preference to HT40+ over HT40- in 2G channels till 8
In reg_set_channel_params for 2G, if the input mode is HT40,
the primary channel is <= channel 8 (2447) and the secondary frequency
is not provided, add an API to fetch the secondary frequency,
giving preference to HT40+ over HT40- mode.

Change-Id: If1538e14f9ab427c9f9a12ee2eb0d9e28bbf8b86
CRs-Fixed: 3050678
2021-10-18 09:43:19 -07:00
Shiva Krishna Pittala
697dce6937 qcacmn: Add an API to check if a given channel width is supported
Add an API to check if a given channel width is supported on a given pdev
by looking at its wireless modes.

CRs-Fixed: 3042932
Change-Id: I7194412b147147eba00dbe860875e46dac602b5b
2021-09-27 22:22:28 -07:00
Shiva Krishna Pittala
29817dce94 qcacmn: Move REGDMN and wireless modes to reg_services_public_struct.h
There is a requirement to use REGDMN and wireless modes in UMAC layer of
the cmndev component. As the WMI_HOST_REGDMN modes currently are defined in
WMI layer, we can't use them directly in the UMAC layer. Hence move them
to the reg_services_public_struct.h and rename them as HOST_REGDMN modes.
Replace all WMI_HOST_REGDMN instances with HOST_REGDMN. Wireless modes are
currently defined in WIN component, use them to cmndev component.

CRs-Fixed: 3044590
Change-Id: Iee5fa1745a1a44b834334746b10bdbb6f6563a0a
2021-09-27 22:22:23 -07:00
Hariharan Basuthkar
033605a031 qcacmn: Add a dispatcher API to read the ini AFC config
Add a regulatory dispatcher API to fetch the value of AFC action
from the ini config.

Change-Id: I053262f98991a656d1919817ce37227202a46bc3
CRs-Fixed: 2997899
2021-09-01 21:38:11 -07:00
Hariharan Basuthkar
258d7f4c16 qcacmn: Implement the 6G AFC power event processing
Add regulatory functions to handle the WMI_AFC_EVENTID. This
includes processing the AFC power information received from the FW,
and constructing the AFC channel list in the regulatory component.

Change-Id: I5da8fc7faae847476f88ff35b20e6444115af7f1
CRs-Fixed: 3023789
2021-08-31 14:44:50 -07:00
Abhijit Pradhan
575da29354 qcacmn: Find the frequency ranges for AFC request
The regulatory rules contain the frequency ranges that are supported
by the current regulatory domain. Also every radio has a chip range
which indicates the range of frequencies supported by the radio. To
find the list of frequencies for the AFC request, add each regulatory
frequency range that are within the chip range to the AFC list of
frequency ranges. If a regulatory range has a partial overlap with the
chip range add only the overlapping part of the range to the AFC list
of frequency ranges.

Change-Id: Ida3e2217783db82fef2825c6a6603e79ef65951b
CRs-Fixed: 3019336
2021-08-27 08:08:48 -07:00
Hariharan Basuthkar
0b8e97ac32 qcacmn: Add dispatcher APIs for AFC in the regulatory
1) Add an ucfg dispatcher for reg_afc_start.
2) Add an API wlan_reg_get_afc_req_id, to fetch AFC request id.
3) Add an API wlan_reg_is_afc_expiry_event_received, to check if the AFC
   expiry event is received from the target.

Change-Id: I45841706c500e74632b60546d945cde4d634a5d2
CRs-Fixed: 3011675
2021-08-27 05:44:45 -07:00
Liangwei Dong
71ba53089e qcacmn: Add API wlan_reg_get_next_lower_bandwidth
Export regulatory API wlan_reg_get_next_lower_bandwidth to
get next lower bandwidth of given channel bandwidth.

Change-Id: Id86d83c1bf738061d325b23d3f46b77d45eaeca5
CRs-Fixed: 3021976
2021-08-26 20:56:17 -07:00
Hariharan Basuthkar
d2ef66d69a qcacmn: Get AFC mas_chan_list and check if AFC power event is received
Add an API wlan_reg_is_afc_power_event_received, to check if AFC power
event is received.

Add an API wlan_reg_get_6g_afc_mas_chan_list. to get the AFC master
channel list.

Export wlan_reg_get_6g_afc_chan_list so that it can be used by
APIs outside the UMAC module.

Change-Id: I09338a41f38e4db03f00ef2c15e9a0b7805f649e
CRs-Fixed: 2991293
2021-08-21 17:28:20 -07:00
Hariharan Basuthkar
ea19d1eaca qcacmn: Create afc regulatory structure and variables
Create a new struct afc_regulatory_info to store the parameters
received in the WMI_AFC_EVENTID.

Also add the following members to the wlan_regulatory_pdev_priv_obj:

1) bool is_6g_afc_power_event_received
2) bool is_6g_afc_expiry_event_received
3) struct regulatory_channel afc_chan_list[NUM_6GHZ_CHANNELS]
4) struct regulatory_channel mas_chan_list_6g_afc[NUM_6GHZ_CHANNELS]

Change-Id: I27ae8545e28bc2ca1c7004d2d2adcc539dc9a8f9
CRs-Fixed: 3017210
2021-08-20 17:30:49 -07:00
Lin Bai
858a29eec9 qcacmn: Move unsafe info to regulator msg
If two channel avoid event reported by FW back to back, flag
psoc_priv_obj->ch_avoid_ind of 2nd event set by
reg_process_ch_avoid_event may be modified when processing
1st event in reg_call_chan_change_cbks, from
scheduler_thread context.

Copy chan avoid info to message post to scheduler to avoid
such timing issue.

Change-Id: I8fd5e7e8f2d9b2117a5c6a54fd8b64659e10f7d6
CRs-Fixed: 3012331
2021-08-17 18:03:27 -07:00
Abhijit Pradhan
53df6c1211 qcacmn: Refactor the opclass tables to optimize memory
Instead of using a fixed sized array of cfis for every operating class row,
which occupies a large amount of unused memory for many operating class
rows, use a pointer to an array and the length of the array so that each
row uses only the right amount of the memory required.

Change-Id: Ifc9974b7dc7c71b2e51b2a93a8d5c08f4fa89dfc
CRs-Fixed: 3009346
2021-08-10 23:24:43 -07:00
Abhijit Pradhan
a6e6827a7a qcacmn: Remove the unnecessary spaces from a commit
Change Ia0676c03cef9c7b010762326e535477beefe36ac added a few extra space.
Remove them.

Change-Id: I5780e3a377c0f4272d6b377015ec80449cfc4f5a
CRs-Fixed: 3005569
2021-08-04 18:04:37 -07:00
Abhijit Pradhan
5ee593e754 qcacmn: Create AFC partial request information in Regulatory
The AFC server sends an AFC response after processing the AFC request.
The AFC Request has a set of request objects: Location,Request ID,
Frequency ranges, Global operating classes, Minimum desired power etc.

The Request ID is generated by FW/target and is sent to HOST
regulatory via the AFC START/RENEW WMI event. On receiving the event,
the HOST creates a partial AFC request by filling frequency ranges,
Global operating classes and minimum desired power. The partial
request is then sent to MLME and finally to AFC application.
The request is called partial because the Device Description and
Location Information are not known to regulatory and not filled in by
the regulatory. They are filled in to create the final AFC request by
the AFC application.

Change-Id: Ia0676c03cef9c7b010762326e535477beefe36ac
CRs-Fixed: 2997956
2021-07-26 11:35:35 -07:00
Abhijit Pradhan
0e0afa5c4c qcacmn: Convert psd to EIRP for a given bandwidth
Convert PSD+BW to EIRP using the following formula
EIRP = PSD + 10 * log10(BW)

Since all the variables are integers, there are some
roundoff/truncation errors.

Change-Id: Ia98b97f4cfe47dcd94bfa54f3dd7be13c8696532
CRs-Fixed: 2995322
2021-07-21 17:15:05 -07:00
Abhijit Pradhan
987106e191 qcacmn: Get ap master and afc chan list
For various channel power calculations and comparisons,
the AP masters channels and afc channellists are needed.
Add APIs to get them.

Change-Id: Iff89c8aa402e786f5a1502c0e5b0b948e9a5d33c
CRs-Fixed: 2995322
2021-07-21 17:15:01 -07:00
Hariharan Basuthkar
82ee5ef227 qcacmn: Add regulatory support to send AFC cmd to the FW
Add core regulatory APIs to send the WMI_AFC_CMDID to the FW.

Change-Id: I1e2b7d936583a199d1be032895802740ee9f19a1
CRs-Fixed: 2975227
2021-07-14 10:32:56 -07:00
Utkarsh Bhatnagar
32647bf109 qcacmn: Cleanup reg_cache_channel_state
Cleanup reg_cache_channel_state and the
related code with it.
Also, changed the logic so as to compare
channel freq instead of channel number in
reg_modify_chan_list_for_cached_channels()

Change-Id: I424b6886ed18f73bae0d2b36e36a9ddc1819688b
CRs-Fixed: 2908016
2021-07-10 19:37:32 -07:00
Chaoli Zhou
6f15f8170e qcacmn: Support extended avoid frequency list updating
Add regulatory API to support updating extended avoid
frequency list from HDD to regulatory component. Then
populate the new final current channel list and secondary
channel list.

Change-Id: Icda683c30bd7f8e51a5fd930712658ce35eff418
CRs-Fixed: 2975136
2021-07-09 14:58:04 -07:00
Gururaj Pandurangi
ea4286f808 qcacmn: Add new API to update ap power type for 6G roam
Add a new API reg_get_6g_power_type_for_ctry to update ap
power type when STA roams in/out of 6GHz channel. It is
invoked during initial connection and sch beacon process
during roaming.

Change-Id: I994d912da79597cf71477fc632c8e678008271a5
CRs-Fixed: 2968243
2021-06-29 21:39:22 -07:00
Hariharan Basuthkar
2234d80a72 qcacmn: Make 6G edge channel APIs common
Currently the 6G edge channel feature is MCC specific.
Make the 6G edge channel feature common for WIN and MCC.

Change-Id: I723b6db1d74dca5a911eede4ec6e6167f6b3e6bc
CRs-Fixed: 2976871
2021-06-25 07:20:05 -07:00
Ashish Kumar Dhanotiya
433c6f024a qcacmn: Cleanup code under CONFIG_CHAN_NUM_API feature flag
As part of regulatory cleanup, Cleanup code under
CONFIG_CHAN_NUM_API feature flag.

Change-Id: I3add81605ea939b3631396154ed3f07f59493f24
CRs-Fixed: 2953646
2021-06-22 03:54:03 -07:00
Vignesh Mohan
767f8e8c65 qcacmn: Add ht40 intolerance flags to reg chan
Add HT40 intolerance flags to regulatory channel structure.

Change-Id: I1e72ea9d27b4531877bc8727f1bc57cd29a60faa
2021-06-17 07:19:39 -07:00
sheenam monga
9738504384 qcacmn: populate bw value from chan_params
Currently, host sends bw value to upper layer in response
of GET_USABLE_CHAN command. but upper layer requires bw
value in form of nl80211_chan_width enum and considering
bw value as invalid and resulting into 0 bw.

Fix is to populate bw value from ch_params.ch_width instead
of populating from curr channel list and then convert to
nl80211_chan_width from phy_ch_width in hdd.

Change-Id: I1937ac2b3282224861a200a5d956a6e92109328e
CRs-Fixed: 2957055
2021-06-03 03:44:41 -07:00
sheenam monga
ef4a346a73 qcacmn: Add support to get usable channels for NAN
Fetch usable channels for NAN iface mode from policy manager
or reg current channel list based on filter mask and
Update res msg channel list.

Change-Id: Ifa4ad4c7c8479f4a0ecc7dbe101f6507ff1525dc
CRs-Fixed: 2949340
2021-05-31 05:36:38 -07:00
sheenam monga
09bb1c3ad0 qcacmn: Fetch usable channels for particular band and dev mode
Add support to get usable channels for particular band and
dev mode.

Change-Id: I891e041d777ba37686fbc35b3c14cc964e5db159
CRs-Fixed: 2947182
2021-05-31 05:36:32 -07:00
Gururaj Pandurangi
312cb2ceb1 qcacmn: Add new API to get chan list with band mask for SAP
Add new API reg_get_band_from_cur_chan_list to build a chan
list based on either primary/secondary current channel list
as per requirement.
The legacy API reg_get_band_channel_list uses primary
current chan list to build a channel list. SAP needs to use
a secondary current channel list. Add a new API for SAP,
reg_get_secondary_band_channel_list for the same. Both these
APIs will call new API reg_get_band_from_cur_chan_list
by passing primary/secondary current chan list respectively.

Change-Id: I1e5573ac9371fc3ce5dc2c387fbd1d47696a161a
CRs-Fixed: 2947516
2021-05-20 00:56:01 -07:00
Lincoln Tran
edd2ccb240 qcacmn: Add second current channel list
For some concurrency scenarios, there is a need to have each session
operate in independent power modes. To achieve this, add a second
current channel list to store info for the secondary power mode.
Also add the APIs to read from the secondary channel list.

Change-Id: Ib1bd712645de05786ea6d4bbfe6163c385bdfeaa
CRs-fixed: 2944483
2021-05-14 10:46:27 -07:00
Lincoln Tran
32780dcf1c qcacmn: Add helper API to set AP power type
Add an API to set the AP power type and then recompute the current
channel list.

Change-Id: Iacd4d3244f601836f3ed0eae725eaa6375a3584c
CRs-fixed: 2934625
2021-05-03 12:53:10 -07:00
Gururaj Pandurangi
57e7a0bcc7 qcacmn: Add country code check for ETSI dmn
Add country code check for ETSI domain, in other words
UK, since only UK supports 6G in EU as of today. The
TPC power calculation API calls this function to check
if programmed ctry is GB to allow STA to use VLP mode.
As and when more EU countries support 6G, the checks
will be appended to this API.

Change-Id: If985f3f64fc806cf1875f798ff3a86667a0861b8
CRs-Fixed: 2933678
2021-04-30 23:51:23 -07:00
Hariharan Basuthkar
bc95e4ed45 qcacmn: Fix compilation errors in Host regdb
Fix the compilation errors observed in the Host regdb when the macro
WLAN_FEATURE_DSRC is enabled.

Change-Id: I2db0aee021db0233cad1c094df9095c25804871d
CRs-Fixed: 2894344
2021-04-20 01:32:16 -07:00
Gururaj Pandurangi
74827187ce qcacmn: Remove all wlan_reg_chan_has_dfs_attribute instances
Use wlan_reg_chan_has_dfs_attribute_for_freq API to check DFS
attribute flag instead of unused wlan_reg_chan_has_dfs_attribute
API as part of regulatory cleanup effort.

Change-Id: I201e88f346da0ed84d330985783d93a95f608546
CRs-Fixed: 2908161
2021-04-13 18:54:04 -07:00
Vijay Krishnan
e4831f5794 qcacmn: Modify 11BE Opclass changes
New Opclass for 11BE mode is introduced. The new opclass for 11BE is
included in global opclass according to 802.11_2016-SPEC.

Another change is modify the type of chan_spacing variable in
struct reg_dmn_op_class_map_t from uint8_t to uint16_t. The places
where the chan_spacing variable used is also modified with the updated
data type.

CRs-Fixed: 2897863
Change-Id: I11f0fc03a8e1bbd188968b7f0cfc4a3b4a3784be
2021-04-12 20:10:49 -07:00
Priyadarshnee Srinivasan
6a6557ab2a qcacmn: 802.11BE Regulatory Support
Build regulatory channel list for 802.11BE wireless mode and for the
new channel width 240/320 MHZ. Following is the summary of the changes:
1. Add a new channel width CH_WIDTH_320MHZ.
2. Enumerate a list of 320 bonded channel frequencies.
3. Increase the maximum supported bandwidth to 320/240 in the channel map
4. Introduce reg_channel_list structure which holds an array of
channel params and also a bitmap to indicate the regulatory
puncturing pattern.
4. Build 320 and 240MHZ (punctured 320) regulatory channel list.

CRs-Fixed: 2901260
Change-Id: Ide6a070e0121fbdabf77820a552ca743ca38732a
2021-04-12 05:43:03 -07:00
Priyadarshnee Srinivasan
2b51168ba8 qcacmn: Add 11BE wireless mode and NO11BE phybitmap
Extract the 11BE flags advertised by FW in WMI_SERVICE_READY_EXT2_EVENTID
and update the regulatory pdev wireless modes. The wireless mode is
currently represented as 'uint32_t' and all the 32 bits are exhausted.
To accommodate the new 11BE flags, change the data type of wireless_modes
from 'uint32_t' to 'uint64_t'.

Add a regulatory phymode 'REG_PHYMODE_11BE' in enum reg_phymode.

If the chip does not support 11BE phymode, FW advertises it via
WMI_REGULATORY_PHYBITMAP enum with a value of REGULATORY_PHYMODE_NO11BE.
Extract the phybitmap and store it in the regualtory
as 'REGULATORY_PHYMODE_NO11BE' bitmap.

CRs-Fixed: 2901260
Change-Id: I4ed3fc7c907b1f76e59efb347c747acea2a163b0
2021-04-12 05:42:52 -07:00
Tushnim Bhattacharyya
7d8f444b48 qcacmn: Remove all WLAN_REG_IS_SAME_BAND_CHANNELS instances
Use WLAN_REG_IS_SAME_BAND_FREQS API to check if 2 channel
frequencies are on same band instead of the deprecated
WLAN_REG_IS_SAME_BAND_CHANNELS API as part of regulatory
cleanup effort.

Change-Id: I71318847c7993b4ec44625e9f759b522a553ee4b
CRs-Fixed: 2898310
2021-04-06 23:12:38 -07:00
Tushnim Bhattacharyya
ca2545b8a1 qcacmn: Remove all WLAN_REG_CHAN_TO_BAND instances
Use wlan_reg_freq_to_band API to get band instead of
the deprecated WLAN_REG_CHAN_TO_BAND API as part of
regulatory cleanup effort.

Change-Id: I782c2e270e695fdfe1b88d05928cf063dadc859d
CRs-Fixed: 2898232
2021-04-06 05:28:43 -07:00
Venkateswara Swamy Bandaru
bb3a53e3dd qcacmn: Add 320Mhz bandwidth support
Expand bandwidth related fields to support 320MHz.

Change-Id: I4d80625607d0f507373decd70006d55d79b3629a
CRs-Fixed: 2881992
2021-04-04 00:15:30 -07:00
Gururaj Pandurangi
6d6ae3f176 qcacmn: Add dispatcher to reg_get_cur_6g_ap_pwr_type
Add dispatcher API wlan_reg_get_cur_6g_ap_pwr_type to call
reg_get_cur_6g_ap_pwr_type from legacy TPC power calculation
API to obtain AP power type for SAP.

Change-Id: I7b135561af6f1cfaa14bbb724eb984e972a4a19a
CRs-Fixed: 2912227
2021-04-02 20:32:29 -07:00
Jianmin Zhu
4294dd6bff qcacmn: Clean up wlan_reg_get_channel_reg_power
Clean up channel id api wlan_reg_get_channel_reg_power.

Change-Id: Ib0b9584029a310eed494a4bd00d5f2500468a76f
CRs-Fixed: 2905088
2021-03-26 18:36:10 -07:00
sheenam monga
3d7e6fb7c1 qcacmn: Remove unused api to find channel is dsrc or not
Remove unused api reg_is_dsrc_chan and wlan_reg_is_dsrc_chan.

Change-Id: I5f4d8aef6aee2c65fd6d0847fac88c1059e53490
CRs-Fixed: 2903007
2021-03-24 06:44:19 -07:00
Gururaj Pandurangi
08148f21fa qcacmn: Enable/Disable 6G edge channels ch2 and ch233
Enable lower 6G edge channel ch2 (5935MHz) for APL2 6G regdmn
using a service bit WMI_SERVICE_ENABLE_LOWER_6G_EDGE_CH_SUPP,
which is not enabled by default.
Also, disable upper 6G edge channel (7115MHz) using another
service bit WMI_SERVICE_DISABLE_UPPER_6G_EDGE_CH_SUPP, that
is enabled by default.

Change-Id: Ia7cb7f7d3165375178adbe70adb19b8671496b6d
CRs-Fixed: 2885623
2021-03-12 02:52:25 -08:00
Amruta Kulkarni
7fe3773331 qcacmn: Remove wlan_reg_set_channel_params
- Remove wlan_reg_set_channel_params and the callers
 associated code.
- Clean up part of CONFIG_CHAN_NUM_API functions.

Change-Id: If9583e674752d6f47de8d7d6bc946909509957b5
CRs-Fixed: 2883773
2021-03-11 19:42:48 +05:30
Gururaj Pandurangi
c4377e8d3d qcacmn: Remove the wlan_reg_get_chan_enum instances
As chan num may be same for different bands, getting chan enum
from channel number can provide incorrect results.
Use wlan_reg_get_chan_enum_for_freq API to get chan enum instead
of the wlan_reg_get_chan_enum.

Change-Id: Ibf08bba31e3778cb4857612d2c95813558be5bc9
CRs-Fixed: 2885860
2021-03-11 19:40:22 +05:30
sheenam monga
fe43d91ba9 qcacmn: Remove unused function wlan_reg_get_channel_state
Remove unused function wlan_reg_get_channel_state

Change-Id: I6f1a0366bae0eff5acbc3dd902f730fd554aee17
CRs-Fixed: 2869902
2021-03-01 09:09:36 -08:00
Jianmin Zhu
0eb2a50ed8 qcacmn: Remove WLAN_REG_IS_24GHZ_CH in wlan_reg_get_bonded_channel_state
Remove WLAN_REG_IS_24GHZ_CH in wlan_reg_get_bonded_channel_state.
Remove definition of following:
WLAN_REG_IS_24GHZ_CH
wlan_reg_is_24ghz_ch
WLAN_REG_IS_5GHZ_CH
wlan_reg_is_5ghz_ch

Change-Id: I7bea616f0bb8e0b98bfe03e9fd66ef24588f59e3
CRs-Fixed: 2883685
2021-03-01 09:09:32 -08:00
Lincoln Tran
6118d488dd qcacmn: Expose freq validation API
Create a wrapper for the reg_is_freq_present_in_cur_chan_list API so
other modules can invoke it.

Change-Id: I0e21b15f1e08bb4301329b6b1a3c3c40edc09060
CRs-fixed: 2884768
2021-02-24 23:33:17 -08:00
Linux Build Service Account
92f26e1300 Merge "qcacmn: Add wrapper API for indoor channel check" 2021-02-17 14:39:29 -08:00
Lincoln Tran
a410298d7b qcacmn: Add wrapper API for indoor channel check
Add the wrapper for the reg_is_freq_indoor API so other modules can
invoke it.

Change-Id: I8e5ec63b117b49a8bdd99d2afdee80b080694a4f
CRs-fixed: 2876035
2021-02-17 14:01:10 -08:00
Gururaj Pandurangi
ae259a4256 qcacmn: Add service bit to support backward compatibility
The host will send TPC power to FW via the new WMI cmd
WMI_VDEV_SET_TPC_POWER_CMDID going forward instead of
WMI_VDEV_PARAM_TX_PWRLIMIT to accommodate 6GHz channels.
But, to support backward compatibility for New Host+old FW
the TPC power will be sent to FW via legacy WMI cmds
WMI_VDEV_SET_PARAM_CMDID (during initial connection) or
WMI_VDEV_PARAM_TX_PWRLIMIT (power value change during RRM
req/bcn processing from connected AP) with the help of a
service bit WMI_SERVICE_EXT_TPC_REG_SUPPORT.

Change-Id: I727fd5a055e4e400ebc174cfb504d60e3335c3c4
CRs-Fixed: 2872244
2021-02-16 23:52:00 -08:00