Commit Graph

230 Commits

Author SHA1 Message Date
Paul Zhang
c5a417e285 qcacmn: Set the right cc_src for reg country
Currently, if the country code which is going to be set is the
same as the country currently being used, it will be ignored.
It does not consider its country code source. This causes the
working of 11d logic unexpected.

To fix this issue, check the country source when trying to set
the same country code.

CRs-Fixed: 2583172
Change-Id: I9c574a62d11676bc0305510f1da9848cc044f874
2020-01-18 06:28:47 -08:00
Linux Build Service Account
2105b28e4c Merge "qcacmn: Reduce excessive console logging" 2020-01-12 19:35:57 -08:00
Daniel Kim
8e63ff7840 qcacmn: Use correct phy id in the reg services
To support dynamic mode switch (phase 2), correct phy_id
should be used. Instead of pdev_id, target phy_id should
be used to retrieve correct channel range sent in target
capabilities (mac_phy_caps).

Change-Id: If0e2503cc99636b775721ecb3628290d19e5575c
2020-01-12 00:12:47 -08:00
Ashish Kumar Dhanotiya
ef9d824e14 qcacmn: Fill center frequency also in channel list with power
Currently get channel list with power api fills only
channel number and tx power, fill center frequency also
in the response with this api.

Change-Id: Ib4487e20d7da0c59d6b4a041deac4d4ecc8dd8c1
CRs-Fixed: 2597550
2020-01-10 20:12:11 -08:00
Hariharan Basuthkar
8e28cdda42 qcacmn: Add an API wlan_reg_get_opclass_details
Add an API wlan_reg_get_opclass_details, to get the operating class
table details from the regulatory component. Also, add a new structure
regdmn_ap_cap_opclass_t in the regulatory component, to fill members
of the mapapcap_t structure.

Change-Id: I8b6a3867a766038663c10ce2f01a8b7d310c7375
CRs-Fixed: 2580505
2020-01-08 13:13:00 -08:00
Yu Ouyang
78100a4cfe qcacmn: Fix function parameter type conflict issue
Parameter freq type has a conflict in reg_is_dsrc_freq(qdf_freq_t freq)
and reg_is_dsrc_freq(uint16_t freq) functions.

Change the type to qdf_freq_t in these functions.

Change-Id: I4c348778a7cb2fd588799332241701357de90422
CRs-Fixed: 2595642
2020-01-04 04:25:52 -08:00
Ananya Barat
763f8beda2 qcacmn: Reverting type of channel number variables in ch_params
The variables center_freq_seg0 and center_freq_seg1 in struct
ch_params are used to represent channel numbers. Their types
were wrongly changed to qdf_freq_t in change ID
e205befb82f643808973286ae578d7add7738eec. Change their type
back to uint8_t.

Change-Id: I13c629850bf207c6088b44c8695167e96dc33476
2020-01-03 09:04:39 -08:00
Hariharan Basuthkar
f8f30ced97 qcacmn: Get opclass from freq and width given a country code
Add the API wlan_reg_get_opclass_from_freq_width, to give country_iso,
channel frequency, channel width and behaviour limit as input, and get
the operating class as output.

Change-Id: I96c39119ab855d10965b2603e8b15c21699daa68
CRs-Fixed: 2583789
2020-01-01 07:27:58 -08:00
Yu Ouyang
efa9f5d2a9 qcacmn: Add FCC10_FCCA into arry g_reg_dmn_pairs[]
When enalbe DSRC feature, member reg_dmn_pair_id of struct
country_code_to_reg_domain g_all_countries[] may equal FCC10_FCCA.
However, FCC10_FCCA can't be found in array g_reg_dmn_pairs[].

So, add FCC10_FCCA into arry g_reg_dmn_pairs[].
And, fix one compile issue.

Change-Id: I6069c43505e15312d8bd9be48495998c31f1f8eb
CRs-Fixed: 2590094
2019-12-30 02:43:25 -08:00
Hariharan Basuthkar
da52df55d0 qcacmn: Add the operating classes 129 and 130
Add the operating classes 129 and 130 to the US, Europe, Japan,
and Global operating class tables in the regulatory component.

Change-Id: I930019c2b14451de57a92c069a77c27fb56d273b
CRs-Fixed: 2587094
2019-12-26 13:21:43 -08:00
Ashish Kumar Dhanotiya
89029e4d9e qcacmn: Send CTL info to firmware
In regulatory non-offloads feature, send conformance_test_limit_2G,
conformance_test_limit_5G, reg_domain, reg_domain_2G and reg_domain_5G
information to firmware using WMI_PDEV_SET_REGDOMAIN_CMDID.

If all these attributes are not populated then CTL power limit is
not applied by the firmware.

Change-Id: I1523ab447aec64ec0af42da32318136f90fd17ca
CRs-Fixed: 2518246
2019-12-26 11:38:36 -08:00
Ashish Kumar Dhanotiya
d02ac5aeb9 qcacmn: Add legacy code CTRY_JAPAN15 to regdb
Currently CTRY_JAPAN15 is not there in host regulatory
database and it is still in use. If CTRY_JAPAN15 is set
from BDF, driver load will fail as this country is not
present in host driver database.

To address this issue add CTRY_JAPAN15 to regdb.

Change-Id: I031b766ac34d57193ded4856b1396306cd5bb76d
CRs-Fixed: 2590635
2019-12-24 08:25:00 -08:00
Hangtian Zhu
7788a89ccd qcacmn: Fix compile issues when some features are disabled
Fix compile issues when some features are disabled, the features are:
BUILD_DEBUG_VERSION
CONFIG_CP_STATS
CONFIG_HOST_OPCLASS
CONFIG_FEATURE_ROAM_DEBUG
There are some other features depends on each other, so enabled features to
qcs40x.snoc.perf_defconfig, the features are:
CONFIG_WLAN_FEATURE_FILS
CONFIG_WMI_ROAM_SUPPORT
CONFIG_WMI_STA_SUPPORT
CONFIG_REG_CLIENT
CONFIG_WLAN_FEATURE_DP_BUS_BANDWIDTH
CONFIG_WMI_CONCURRENCY_SUPPORT
CONFIG_LL_DP_SUPPORT

Change-Id: I6fa1eacb79576a955e593dbb9ac52083742275e3
CRs-Fixed: 2584839
2019-12-18 23:55:00 -08:00
Abhijit Pradhan
2c1420a617 qcacmn: Control the size of the freq and chan_num (Regulatory)
Depending on the requirement, a bigger size or a smaller size for
the frequency variable can be chosen. The advantages of each size
are described below:

Advantage of a bigger size:
When two technologies (e.g. 802.11AX and 802.11AD) are controlled
by the same driver software, the frequency range may be very large
and a bigger size (e.g. 32bit integer) is more appropriate.

Advantage of a smaller size:
When the frequency range is not very large, a smaller size (e.g.
16bit integer) can be used. It saves a large amount of space especially
when many large arrays containing elements of this type/size are
defined in the driver.

Also, change the size of the IEEE channel variables to unsigned
8-bit integer.

Change-Id: Ie205befb82f643808973286ae578d7add7738eec
CRs-Fixed: 2586071
2019-12-17 00:12:55 -08:00
Hariharan Basuthkar
c41566955e qcacmn: Add regulatory 6G changes for Update 30
Update the regulatory database with the following changes:

1) Add full reg domain FCC15_FCCA, FCC16_FCCA and FCC17_FCCA.
2) Add associated 5G reg rules and channel bands for the new regdomains.

Change-Id: I2b6038d0f106555adf650c12ca48efcaacc69071
CRs-Fixed: 2582502
2019-12-13 01:59:38 -08:00
Linux Build Service Account
bf21ef2e02 Merge "qcacmn: Remove unused API in the regulatory component" 2019-12-12 20:30:29 -08:00
Vignesh U
8fd74a017d qcacmn: Add a new DFS domain for Japan (MKKN)
Introduce a new DFS domain MKKN that supports new w53 Japan RADAR
pattern only.
Initialize a new empty RADAR table dfs_mkkn_radars for MKKN DFS domain.
Map The 5G regdamain MKK17 to the new DFS domain MKKN to make sure that
the new w53 Radar pulses should be detected only by JP country or
MKK17 5G regdomain.

Change-Id: Ib0f6a7e98353c9930e90703ead2342b932e491e3
CRs-Fixed: 2575347
2019-12-12 18:19:38 +05:30
Hariharan Basuthkar
45ac9f5bf7 qcacmn: Remove unused API in the regulatory component
Remove the unused API wlan_reg_get_5g_bonded_channel_and_state in the
regulatory component

Change-Id: I45c9b083dfb6faf6c97293d54200ed4f15a7d289
CRs-Fixed: 2574154
2019-12-11 06:28:48 -08:00
Priyadarshnee S
fe5117b731 qcacmn: Map JAPAN15 to MKK17_MKKC
Map JAPAN15 to MKK17_MKKC to be in consistent with FW mapping.

CRs-Fixed: 2578832
Change-Id: I74c38333bd3c31990647329a909c04c848b14a51
2019-12-10 00:51:13 -08:00
Hariharan Basuthkar
379ebfe4e3 qcacmn: Use channel frequency instead of channel number
1) Add the API wlan_reg_get_5g_bonded_channel_and_state_for_freq
   that returns  the state for a 5G or 6G channel frequency,
   based on the channel width and and state of the bonded channels.

2) In the API target_if_calculate_center_freq, remove the instances
of IEEE channel number, and provide regulatory support, with the
channel frequency based structure - bonded_channel_freq and the API -
wlan_reg_get_5g_bonded_channel_and_state_for_freq.

3) Remove the usage of band_info and replace it with reg_wifi_band within
the target_if of the spectral module.

Change-Id: If5108b55097208d33fafb48968ea8b6dc83011fa
CRs-Fixed: 2571906
2019-12-09 20:38:52 -08:00
Jianmin Zhu
6aded3fc94 qcacmn: Redefine channel frequency MACRO as public
Move MACRO definition of TWOG_CHAN_6_IN_MHZ out of
ifdef CONFIG_CHAN_FREQ_API, move to public header file,
then other components can use it.

Change-Id: Ieb4b2b167c664246d39949ad4f8d53eda6b9d7de
CRs-Fixed: 2580207
2019-12-08 22:58:02 -08:00
Liangwei Dong
7ce41f14c1 qcacmn: Fix channel_map NULL
Initialize channel_map to "us" at regulatory init.
Use NUM_6GHZ_CHANNELS to get 6Ghz channel numbers
instead of MAX_6GHZ_CHANNEL.

Change-Id: Ifed996c1a528c8a3c0a29d3959f17dff6d298193
CRs-Fixed: 2949971
2019-12-01 19:16:45 -08:00
Hariharan Basuthkar
4050a850ac qcacmn: Rectify the API wlan_reg_is_6ghz_psc_chan_freq
While checking if a channel frequency is 6Ghz PSC frequency within
wlan_reg_is_6ghz_psc_chan_freq, check the remainder of the expression,
instead of quotient.

Change-Id: Ia40d7cd8485f9f8eb90222f9a3454d46e681681b
CRs-Fixed: 2572914
2019-12-01 17:43:32 -08:00
Priyadarshnee S
399ef175ce qcacmn: Add regulatory APIs to retrieve "unii_5g_bitmap" mask
Add regulatory APIs reg_get_unii_5g_bitmap and ucfg_reg_get_unii_5g_bitmap
to retrieve the value of "unii_5g_bitmap" stored in regulatory pdev
private object.

CRs-Fixed: 2574642
Change-Id: Iffb004b7fc9d9fbcf1972eb6f527529024e49c70
2019-12-01 17:42:58 -08:00
Hariharan Basuthkar
52ccb5e615 qcacmn: Disable coex channels in the current_chan_list
The 5G cellular RF band and wifi frequency band of UNII-1
(IEEE channels 36, 40, 44, 48) and UNII-2A band (52, 56,
60, 64) can coexist.

UNII-1 and UNII-2A are represented by bits 0x1 and 0x2 respectively in
this implementation. The user space command should set the bits by
applying the following algorithm:

1) To disable only the UNII-1 band channels, set the value as 0x1.
2) To disable only the UNII-2A band channels, set the value as 0x2.
3) To disable both the UNII-1 and UNII-2A band channels, set the
   value as 0x3.
4) To restore both the UNII-1 and UNII-2A band channels, set the
   value as 0x0.

Change-Id: I8ff747e53b079ee9e0dc762980aee0eea32b23a5
CRs-Fixed: 2571546
2019-12-01 17:41:36 -08:00
Amar Singhal
7defbc9a07 qcacmn: Call channel change callback in regulatory_pdev_open
During pdev create callback, pdev reference cannot be taken. Hence,
channel change callbacks cannot be called during pdev create. So
call the callbacks during regulatory_pdev_open. Also dont check
if regulatory_pdev_open fails.

Change-Id: I9d444f952418be983e4ac2182581d03bba02b198
CRs-Fixed: 2572487
2019-11-25 02:34:04 -08:00
Amar Singhal
8e992e56f0 qcacmn: Add check for regulatory channel list
Regulatory module calls registered callbacks when channel list is changed.
But channel list may not have been received when path for callbacks is
reached. So keep a track if channel list has been received. If not, do
not call the callbacks.

Change-Id: I2e1a6e442b0d5c79e786806e00b1c50c9491dae0
CRs-Fixed: 2563759
2019-11-19 22:33:26 -08:00
Ashish Kumar Dhanotiya
b5cc4988ce qcacmn: Update regdb based on database version 30
Update regdb with QCA regulatory database version 30 with following
changes:

1. Change APL11 and APL19 RD defs to FCC Radar Patterns.
2. Change 2g reg domain for Argentina to ETSIC
3. Change 5g reg domain for Argentina to APL16 for WIN and
APL17 for MCL and DSRC.
4. Change 2g reg domain for Indonesia to ETSID
5. Change APL2 power to 20.
6. Change Radar detection pattern for APL11 to FCC
7. Change CTL for APL14 to MKK
8. Change Radar detection pattern for APL19 to FCC
9. Add new reg domain APL24
10. Change ETSID power to 20.
11. Add full reg domain APL2_ETSID
12. Add full reg domain APL16_ETSIC
13. Add full reg domain APL17_ETSIC
14. Add full reg domain APL24_ETSIC

Change-Id: I8ce9696caefee89a9ab5606667c1619634e248c5
CRs-Fixed: 2548580
2019-11-18 16:05:37 -08:00
Hariharan Basuthkar
853a2cda71 qcacmn: Add an API wlan_reg_chan_opclass_to_freq
Add an API wlan_reg_chan_opclass_to_freq, that takes IEEE Channel
number and opclass as input and gives the channel center frequency
as output.

Change-Id: I09733d9dc27beb8f16037aa8653acededf32b715
CRs-Fixed: 2555042
2019-11-12 10:37:50 -08:00
Vignesh U
4cd49ad814 qcacmn: Intermittent regulatory update for Japan in Win&computing
As a part of the intermittent regulatory update, implement the following
changes,
- The country Japan should map to MKK17_MKKC regulatory domain.
- For regulatory domain MKK17_MKKC, channel 144 should be disabled by
default.

Change-Id: Ic920456fa885d9ed2b8d0419c6a261707eb10b4d
CRs-Fixed: 2560339
2019-11-11 12:10:32 -08:00
Amar Singhal
5fbd62d6e3 qcacmn: Add 6ghz support functions
Add API to know whether 6ghz is supported. Also add API to know
whether an operating class is 6ghz operating class.

Change-Id: I75747502c0033e31d119e58a2254b220646bba10
CRs-Fixed: 2556998
2019-11-09 22:08:12 -08:00
Amar Singhal
499d20b63b qcacmn: Re-implement IEEE80211 operating classes
Add starting frequency to each operating class. Further add behavior
limit to each operating class, if any. Behaviour limit is used for
80p80, 40 mhz low primary, etc operating class identification. Also
add 6-ghz operating classes 131-135 to the global operating class.
Also add APIs that are based on frequency instead of channel number.

Change-Id: Ic8756aada6c31ed2164f767ff1ae584b8bf055d2
CRs-Fixed: 2533419
2019-11-09 22:08:08 -08:00
Amar Singhal
cfec8138ad qcacmn: Check 4.9 GHz channel correctly
4.9 GHz channels cannot be checked using channel number since channel
number can conflict with 2.4 GHz and 6 Ghz channels. So use frequency to
check if channel is 4.9 Ghz.

Change-Id: Ie201d2722edbc7f20ee4faa115910d92afaa3414
CRs-Fixed: 2552810
2019-11-09 22:08:03 -08:00
Amar Singhal
ddcd9fbf2e qcacmn: Initialize channel_map at time of regulatory init
A component can register callback with regulatory component before channel
list is available.Therefore initialize channel map at time of regulatory
init. Also, call callback when pdev current channel list
is computed, at time of nol channel update.

Change-Id: I551e0ea3391710538f694c50fa7dc6f795f3196c
CRs-Fixed: 2555403
2019-11-09 22:07:59 -08:00
Hariharan Basuthkar
6f59c89126 qcacmn: Fix channel conversion APIs in the regulatory component
Update the APIs mentioned below, to handle invalid channel number and
freq value of less than or equal to 0:

1) wlan_reg_chan_band_to_freq
2) wlan_reg_freq_to_chan
3) wlan_reg_chan_to_freq
4) wlan_reg_legacy_chan_to_freq

Change-Id: I122658c974c550ff16bcfe1b664799a609c7ffcf
CRs-Fixed: 2550286
2019-11-07 05:21:36 -08:00
bings
f2f11dbf06 qcacmn: Add REG_BAND_MASK_ALL
Define a bandmask for all the modes

Change-Id: I8ad6fc2676c2306043aa9415eefb2b89d8c49a4d
CRs-Fixed: 2555045
2019-11-05 02:12:49 -08:00
Hariharan Basuthkar
3d4c345f51 qcacmn: Introduce reg_err_rl to avoid print flood
Print floods are observed in the APIs below:

1) reg_get_curr_regdomain
2) reg_is_etsi13_regdmn
3) reg_freq_to_chan

Add a new macro reg_err_rl and assign QDF_TRACE_ERROR_RL. Use reg_err_rl
instead of reg_err, to avoid print flood.

Change-Id: I5c1da71febd61449bfbff508797c60bb88849122
CRs-Fixed: 2552008
2019-10-28 23:36:57 -07:00
Tushnim Bhattacharyya
23990a2d01 qcacmn: Replace channel with frequency in struct unsafe_ch_list
Replace channel ID with frequency in struct unsafe_ch_list.

Change-Id: I0a9426f985edb65387f2613519b487d701cf344d
CRs-Fixed: 2540583
2019-10-28 18:03:02 -07:00
Gururaj Pandurangi
42a72318f0 qcacmn: Fix possible out of bound access
In reg_set_5g_channel_params if the input channel bandwidth
is 5MHz then while getting the next lower bandwidth out of
bound access occurs.
Fix out of bound access in getting next lower bandwidth value.

Change-Id: I309909661f0357d482387e92353024400a042295
CRs-Fixed: 2525496
2019-10-22 10:57:37 -07:00
Tushnim Bhattacharyya
d0221258e5 qcacmn: Reduce log level in 6Ghz regulatory API
Reduce log level in reg_is_6ghz_psc_chan_freq.

Change-Id: If451c702cbbf7ef559bd486ac8dbd6095a74ea58
CRs-Fixed: 2544230
2019-10-14 15:56:22 -07:00
Rajeev Kumar Sirasanagandla
816b503c44 qcacmn: Ignore regulatory offload indication from FW
Based on the ini "ignore_fw_reg_offload_ind" ignore regulatory
offload indicatin from fw.

Change-Id: Ia95b5bdda6ee1fcc2b07f28f997a7c80afcbc32b
CRs-Fixed: 2533001
2019-10-12 19:03:56 -07:00
Amar Singhal
db7271fbd4 qcacmn: Remove default pdev id from regulatory component
Default pdev id is redundant now. Therefore remove def_pdev_id from
the regulatory component.

Change-Id: I383f904e373df0e7d02fb0e2d00141fcacebe82a
CRs-Fixed: 2505161
2019-10-07 14:02:23 -07:00
Amar Singhal
28374e3ff1 qcacmn: Mark SRD channels conditionally passive
--Treat SRD channels as PASSIVE if INI enable_srd_chan_in_master_mode
is 0. Add API reg_modify_chan_list_for_srd_channels for this purpose.
Mark channels as PASSIVE in both driver and kernel. Do not add this API
for WIN use-cases.
--Make default value of enable_srd_chan_in_master_mode as 1. WIN needs
default value as 1. MCC can over-ride with INI.
--When pdev is added, compute pdev current channel list only after pdev
private object is attached to the pdev. Computation of current channel
list accesses the private object via the pdev.
--When a pdev is added and deleted, set and reset def_pdev_id
correctly. Currently reset is not being done when pdev is destroyed.
--When programming current country to the firmware, do not use
def_pdev_id, since def_pdev_id can be -1. Ask for response for all phys.
Program pending reply for every phy, since the reg-domain for all phys
need to be re-programmed.
--Remove reg_reset_reg_rules when pdev is processed, after addition of
master channel list. The psoc copy of master reg rules need not be
cleaned up.

Change-Id: I5eaa457b8819d7a22d2e592d1b79fff15b364f40
CRs-Fixed: 2491045
2019-10-07 12:37:18 -07:00
Edayilliam Jayadev
454c6d7be3 qcacmn: Restrict Agile Spectral start scan in SBS mode
Ensure that at a time only one Agile Spectral scan is
happening across all the 5G pdevs in SBS mode.

CRs-Fixed: 2517522
Change-Id: If31a4451b82ce1d7d8a46bc604ca91bf4b6dac29
2019-10-06 23:54:53 -07:00
Hariharan Basuthkar
868bcbec0c qcacmn: Rectify APIs within the Regulatory component
Rectify three issues in the Regulatory APIs as follows:

1) Within the API reg_update_nol_ch_for_freq, replace the call of
reg_get_chan_enum with reg_get_chan_enum_for_freq, as
reg_update_nol_ch_for_freq is a frequency based API.

2) Change the return type of wlan_reg_get_channel_reg_power_for_freq
to uint8_t and change the datatype of its parameter, freq, from uint32_t
to uint16_t.

3) Place the API wlan_reg_chan_to_freq, under the macro
CONFIG_CHAN_NUM_API, as it uses IEEE channel number as a parameter.

Change-Id: I1bc1d767d34cd97ca971bd7e12b685a55fb9a494
CRs-Fixed: 2531183
2019-10-05 19:10:52 -07:00
Amar Singhal
0c46139fee qcacmn: Add new min and max freq APIs
Add new APIs that return minimum and maximum channel frequency,
supported by regulatory domain.

Change-Id: I878bd6f4ff8fdbe28661769033c37a000aebf582
CRs-Fixed: 2538143
2019-10-05 12:44:58 -07:00
Hariharan Basuthkar
06cb75e445 qcacmn: Make band related changes in the regulatory component
Make band related changes given below:

1. Add the API wlan_reg_chan_band_to_freq, that takes IEEE Channel Number
   and bands as input and returns the Channel center frequency.
2. Add the API wlan_reg_freq_to_band, that takes frequency as input and
   returns the corresponding band.

Change-Id: I8554f6a9c24e7508e8a551c5f318b643741f13c8
CRs-Fixed: 2523257
2019-10-03 19:23:22 -07:00
Amar Singhal
6698513b8d qcacmn: Make freq to chan and vice versa conversion more generic
Add conversion from frequency to channel, for frequency falling
within two consecutive supported channels. Use the master
channel list of the pdev for the same. Add new API
wlan_reg_legacy_chan_to_freq to convert legacy 2G and 5G channel
number to frequency. Existing API wlan_reg_chan_to_freq would be
slowly deprecated.

Change-Id: Id7e1939b9e05b78c17751d13bb0b02a891f999ad
CRs-Fixed: 2526886
2019-10-03 19:23:18 -07:00
Edayilliam Jayadev
b38cb7a8f0 qcacmn: validate user given agile center frequency
Validate user provided agile center frequency and throw
an error if it is invalid.

CRs-Fixed: 2529280
Change-Id: Ibb43dda98d29d8bc8360d1a204c67b64ca987ca6
2019-10-03 12:34:44 -07:00
Hariharan Basuthkar
0056730131 qcacmn: Add an API to get the channel list for bands
Add the API wlan_reg_get_band_channel_list, to get the channel list from
the current channel list based on the input bandmask provided.
The bandmask may have more than one bands as input.

Change-Id: I082a5dd6a9ddb449d64d13e636f42ad58d2de16b
CRs-Fixed: 2523254
2019-09-25 01:09:13 -07:00