Commit Graph

230 Commits

Author SHA1 Message Date
Amar Singhal
26b5bc9c18 qcacmn: Do not return pointer to the regulatory rules
Regulatory rules can change a lot of times depending on conditions.
By returning pointer, the rules can change before rules are accessed
using the pointer. Therefore always copy the rules.

Change-Id: Ic0a8b5f515cb07279a8d8f204043e5d6aaac98f2
CRs-Fixed: 2319788
2018-09-28 14:29:30 -07:00
Liangwei Dong
36462d50b8 qcacmn: add 11d periodic scan in host
Add periodic 11d scan in host for non-11d scan
offload hw. Periodic interval is controlled
by INI scan_11d_interval, default 1 hr.

Change-Id: I66d1e76a1c147fc52f0e18b6601d3be4b4973210
CRs-Fixed: 2314830
2018-09-28 10:41:34 -07:00
bings
747b176c98 qcacmn: Replace wlan_phy_ch_width with phy_ch_width
Delete enum wlan_phy_ch_width. Move phy_ch_width definition
from reg_services_public_struct.h to wlan_cmn.h.

Change-Id: I9f2b3ade1b023b9728274ce4edd3b90f562ae02e
CRs-Fixed: 2318356
2018-09-24 17:16:16 -07:00
Amar Singhal
cdaca1af95 qcacmn: Put debug log when channel number is out of range
Channel number being out of range is not expected for a pdev. Put debug
log for the same.

Change-Id: Iaccec084e2bc22a3955915ad48a55d16963b49a5
CRs-Fixed: 2316097
2018-09-18 01:03:09 -07:00
gaurank kathpalia
6ec44e61ba qcacmn: Add src, and dst id support in REGULATORY
In the scheduler_post_message, src_id is now added to
know the source module of the msg. The present scheduler
doesn't know about the same which is scheduler_post_msg.

Replace the scheduler_post_msg with scheduler_post_message.

Change-Id: Ia8c9355528b430bda9231c24c07a648f1931e0eb
CRs-Fixed: 2306018
2018-09-17 02:58:13 -07:00
Priyadarshnee S
1e838726f1 qcacmn: Address NULL pointer reference in scm_11d_handle_country_info()
When a 2G AP vap is brought up on a "WORLD" regdomain (say 0x30),
reg_is_world_alpha2() returns true. Also "enable_11d_in_world_mode" is set
true by default during reg psoc creation. When a regdomain is set, process
master channel list is invoked during which "enable_11d_supp" is set to
true as regdomain is "WORLD" and "enable_11d_in_world_mode" is also set to
true.

As "reg_11d" is enabled, during beacon and probe processing, country
update is done and scm_11d_handle_country_info() is called. 11d feature is
specific to MCL and hence on WIN code base, it causes invalid memory
access and it panics.

"enable_11d_in_world_mode" is MCL specific feature and is disabled for WIN
to avoid any call to scm_11d_handle_country_info for WIN codebase.

CRs-Fixed: 2310809
Change-Id: I7bcac4052c96917120adc59e9e2eaa0e3da8dff1
2018-09-15 07:40:13 -07:00
Amar Singhal
76c44ef010 qcacmn: Change default WORLD mode
WORLD_60 is default WORLD mode. Remove channel 12 from WORLD mode. Also
fix TX power in WORLD mode for channels 12/13.

Change-Id: I030f7d07355031e9b791aec3a1edc6a3fb44651a
CRs-Fixed: 2302910
2018-09-03 12:59:59 -07:00
Amar Singhal
2193286e32 qcacmn: Correct alpha2 for Argentina
The correct alpha2 value for Argentina is AR and not AR1.
Fix it. Also add FCC5_FCCA regdomain to the regdomain table.

Change-Id: If06ca577b32602620d30ab3c5b9182ae7ab2c44a
CRs-Fixed: 2304785
2018-09-03 12:59:56 -07:00
Amar Singhal
f318f04a83 qcacmn: Enable 11d in WORLD mode
In WORLD mode, there can be urgency to discover the current country since
WORLD mode restricts the channel and TX power availability. Therefore,
enhance 11d state machine to enable 11d in world mode. Use INI
configuration parameter enable_11d_in_world_mode to decide whether to
enable 11d in world mode automatically.

CRs-Fixed: 2289358
Change-Id: I8a4e1f6c74acb5ac1faec8f98840bf66c3d9a3f7
2018-08-31 11:17:28 -07:00
Shashikala Prabhu
7e4a175385 qcacmn: Resolve dfs region namespace conflict
Resolve the namespace conflict between the host and firmware wmi common
header files by changing the dfs region enum name in the host regdb
component.

Change-Id: I8f0bbd60063fecd9d78338984e91117a23bc423b
CRs-Fixed: 2300356
2018-08-22 06:08:53 -07:00
Nirav Shah
1b9674e21e qcacmn: umac: Add logging macros without function/line info
Add per module logging macros without function/line info
to avoid adding function/line info where it is not required.

Change-Id: I34ba6f6485f9b506264daf4e116052d2858bed40
CRs-Fixed: 2278876
2018-08-14 21:44:21 -07:00
Shashikala Prabhu
fe4a65a733 qcacmn: Fix channel list validation failure
Add frequency range CHAN_5735_5835_8 which has dfs flag set. For ETSI12
regdomain use this freq range instead of CHAN_5735_5835_1.

Change-Id: I40f659c2a92b902e26bd71fc713e00b57a13418d
CRs-Fixed: 2290773
2018-08-14 16:50:22 -07:00
Liangwei Dong
6ca6f83556 qcacmn: Fix 11d non offload issue
If target only support regdb offload but not
support 11d scan offload, the set country code
wmi command needs to be sent to firmware.

Change-Id: Ide69c3f08a14560789f6e53a6013861843b5e974
CRs-Fixed: 2280170
2018-08-14 05:01:13 -07:00
Shashikala Prabhu
00ffeaf6be qcacmn: Fix channel list validation failure
Mark channels from 5745 through 5865 as DFS channels.

Change-Id: Idd99819e322aa80c376fb098745c3bd39ded743e
CRs-Fixed: 2286686
2018-07-31 00:46:50 -07:00
Ashish Kumar Dhanotiya
4b47f374dc qcacmn: Add support to disable channel list
Propagation from prima to qcacmn

Add support to disable channel list received with command
"SET_DISABLE_CHANNEL_LIST".
As part of this command, number of channels and list
of that many channels should be given. When SAP comes up, disable
the channels received in the command. If any of the interface
is up on any of the channel from the list, first disconnect
the interface and start the interface on the new channel.

Change-Id: I3c7810bfde78878a3e60570a13bf2741e1da599b
CRs-Fixed: 2225865
2018-07-25 06:06:00 -07:00
Amar Singhal
937ba5df0c qcacmn: Define DSRC regdomains
ETSI10 and FCC10 regdomains are DSRC regdomains. FCC10 is used by US
and ETSI10 is used by many european countries. Add full country mapping
table for DSRC regdomains. Also separate out channel definitions based on
DSRC.

Change-Id: I0c4c44e7189e88e397c21b2ceada325ce06a88f7
CRs-Fixed: 2271736
2018-07-24 22:18:43 -07:00
Nirav Shah
a175314c51 qcacmn: Map all module logs to per-level log APIs
Map all module level log APIs to per-level log APIs
to compile out specific log level if required.

Change-Id: I4072b6740cb43200fd95c40943b66e1d5f8f1847
CRs-Fixed: 2266719
2018-07-13 10:36:22 -07:00
Shashikala Prabhu
7650ed9900 qcacmn: Assign an enum value to an undefined dfs region
Assign an enum value to an undefined dfs region.

Change-Id: Ia078b3853db38e54d2340e07f7bbd2b636e16bc2
CRs-Fixed: 2274203
2018-07-11 14:29:32 -07:00
Kiran Kumar Lokere
b49263bc0b qcacmn: Add support for SRD channels in ETSI domain
Add support for Short Range Devices 25 mW max power
channels in ETSI regulatory domain.

Add Short Range Devices 25 mW max power channels only
if DSRC feature is disabled.
Provide service apis to check SRD and DSRC channels.

Change-Id: Ib2a1d7cf191d07319cb29038ad60130f5cbe7f16
CRs-Fixed: 2264790
2018-07-05 20:49:34 -07:00
Kiran Kumar Lokere
76da7996ae qcacmn: Add support to send regulatory sync event
Add support to send regulatory rules info in regulatory sync
event to user space for self managed regulatory when regulatory
info is updated.

Change-Id: Iac8704598fd181e47cb023405dfe592c4c93f51b
CRs-Fixed: 2242701
2018-06-13 21:00:54 -07:00
Amar Singhal
6cc647211d qcacmn: Add legacy code CTRY_JAPAN15 to regdb
Legacy code CTRY_JAPAN15 is still being used. Add that to
regdb as well.

Change-Id: Ibf455b31b11bf909cfba85f487c9c40816eb8959
CRs-Fixed: 2255527
2018-06-08 22:59:44 -07:00
Wu Gao
9402d50fd6 qcacmn: Indicate ch avoid event even channel list is NULL
LTE coex works fine, then LTE signal disappear and no unsafe channel,
no channel avoid event indicate to up layer.

Change-Id: I3a3e65b849722408a3844437c75e73a7e62be83a
CRs-Fixed: 2240473
2018-05-29 00:08:09 -07:00
Jeff Johnson
da0a82610b qcacmn: umac: Remove legacy markings
Per current guidance remove legacy markings.

Change-Id: I34c7acfad802a3878ffa373489b7f6a4194abb62
CRs-Fixed: 2230684
2018-05-18 02:17:46 -07:00
Amar Singhal
c8d0614f8d qcacmn: Update Japan regulatory domains
Change Tx Power for 2G regdomains MKKA and MKKC to 23 dBm.
Also change TX power for 5G regdomain sub-bands for MKK5 and
MKK11.

Change-Id: I32337fea35f350b2171b6d0a242934f0668d4f5e
CRs-Fixed: 2229597
2018-05-03 18:33:16 -07:00
Paul Zhang
41bd701ee7 qcacmn: Correct the alpha2 for Netherlands
Netherlands country code is NL.

Change-Id: I4e71a96c4f46798f0473effeb52681276d79557a
CRs-Fixed: 2207119
2018-05-03 03:36:09 -07:00
Abhijit Pradhan
2415cf38c2 qcacmn: Add regulatory update-26 to reg db
Add Regdomain: ETSI14.
Add Regdomain pair: ETSI14_WORLD.
Change regdomain of Qatar to ETSI14_WORLD.
Change Japan ISO country code.
Remove Non-ISO JAPAN countries.
Remove Ch.144 and related straddle channels in APL9.
Increase 5.25-5.35 power in APL9.
Increase MKK5, MKK11, MKK16 powers.
Add channels and increase power for ETSI9.
Add 5GHz mid channels and increased power for FCC14.
Change regdomain of Mauritius to ETSI1_WORLD and ETSI13_WORLD.
Change Egypt Country Flags to allow VHT80, VHT160.

Change-Id: I10abf9f2edcb2d3f9a941ffc6b9188002d83973a
CRs-Fixed: 2216647
2018-04-14 21:55:51 -07:00
Shashikala Prabhu
f667999f9a qcacmn: Add compile time macro for scheduler queues in regdb
WIN does not use scheduler queue in regdb. Hence, do not compile
scheduler queue in regdb.

Change-Id: I9694a1780cd65ac2360044152cf7d13748fbe8cc
CRs-Fixed: 2223207
2018-04-14 07:37:52 -07:00
Shashikala Prabhu
7edbb05f11 qcacmn: Temporary WAR to bypass beacon channel mismatch check
For 4.9GHz, firmware converts the frequency to old regulatory channel
numbers and sends it to host. But host uses new regulatory channel numbers.
Since the received fw channel and beacon channel number is different,
host drops the received beacon and scan entry doesnot get updated.

As a temporary fix, bypass the beacon mismatch check in host.

Change-Id: Ib3e6b7b39ef2feaa1bcf0e0b16a702caccbf6744
2018-04-13 14:51:34 -07:00
Shashikala Prabhu
48ecda84bf qcacmn: Fix 4.9GHz cfg80211 issues
Send correct channel list to Firmware. When cfg80211 is enabled, STA
is scanning in a set of wrong channels. When scan callback happens
from cfg80211 module the cfg80211 module gives us the channel numbers.
There are some channel numbers which are same in both 5GHz and in
2.4Ghz bands. For example, channel number 1 maps to frequency 4942MHz
in 5GHz band, but in 2.4GHz band channel number 1 maps to frequency
2412MHz. So cfg80211 may give us a wrong channel number. Since we have
the exact frequency of the channel we should use that instead of the
one given by cfg80211.
The channel object given to the driver by cfg80211 during scan callback
is the same as the one registered to cfg80211 by the driver. So we can
use the channel frequency inside the channel object for scan which is
not changed by the cfg80211 module.

Use regdb function to convert channel number to frequency while receiving
scan entries from FW. Use pdev band (5/2.4GHz) information to map to
correct 2.4Ghz/5Ghz channel frequency.

Half/Quarter rate flags in the scan_ctrl_flags are not set. Set
Half/Quarter rate flags in scan_ctrl_flags.

Change-Id: I9df8f0e90938f86f6987574f8259a5cf66b672aa
CRs-Fixed: 2180273
2018-04-13 14:51:30 -07:00
Paul Zhang
2db395377a qcacmn: Add reg domain FCC2_FCCA
The defination is missing for reg domain FCC2_FCCA
which is used by country "DM" and "DO".

Change-Id: I4ad1cde55b54ba16eb6f1c6a2b96c73c17a932b9
CRs-Fixed: 2215875
2018-04-05 01:30:03 -07:00
Yuanyuan Liu
80bfeb949d qcacmn: Fix LLVM compiling issues
Remove typedef redefinition, use correct enum type, remove extra
parentheses and correct header guard.

CRs-Fixed: 2214003
Change-Id: I0a75c70cd530590a16f6bfa884955ebc26906de0
2018-04-02 16:41:52 -07:00
Will Huang
fb82d53055 qcacmn: Add pdev NULL check in reg_set_country
reg_set_country may be called by hdd_reg_notifier, which is running
in a context of worker create outside driver, it may be scheduled to
run during driver unloading process which set hdd_ctx->hdd_pdev to 0.

Change-Id: Ie51d772294302ad6b04117847c28a556694e9bca
CRs-Fixed: 2208085
2018-03-28 14:44:39 -07:00
Paul Zhang
b10508a903 qcacmn: Add regulatory update-25 to reg db
Add Regdomains: ETSI12, ETSI13, FCC5
Add Regdomain pairs: ETSI12_WORLD, ETSI13_WORLD
Change all Europe countries to ETSI13_World in the
LA country-to-RD mapping.

Change-Id: I4fb31fbd852994c6bcda5e6379de2f3df5aa8d4e
CRs-Fixed: 2182451
2018-03-26 22:10:43 -07:00
Paul Zhang
1ac430d086 qcacmn: Reset the master_list[].chan_flags
Currently, the chan_flags in master_list does not reset.
So when changing the country code, the previous counry
code's chan flag will pollute the current country code's.

Change-Id: Idb7bbb2a216a8d756ddcfd2edb090807f098fadf
CRs-Fixed: 2199920
2018-03-12 17:16:47 -07:00
Mukul Sharma
c42f0c13b7 qcacmn: Disable indoor channel on sap start
There are scenario where indoor channel operations
(like  active / passive scan/connect/roam etc)
are not desired / permitted specially in sap case.
Hence add support of disabling indoor channel
on sap start and revert it on sap stop.

Change-Id: Id6e01534532e3076a3e662e6a4f71e8be924165a
CRs-fixed: 2161319
2018-03-05 22:33:53 -08:00
Amar Singhal
876a6931e3 qcacmn: Modify maximum BW only conditionally
The maximum BW for edge channels may fall outside the low limit or
high limit of channel range for a given pdev. But reduce the maximum
BW only if it is less than or equal to 20 MHz. Higher bandwidths are
realized using channel bonding and the channel itself may not be center
channel.

Change-Id: Ifc6bbadf91759fedaf432d162763577ea56bb7b7
CRs-Fixed: 2184724
2018-02-23 12:54:41 -08:00
Shashikala Prabhu
1b50fdc451 qcacmn: Add a local variable to dereference frequency range
To make the code look neater, add a local variable to dereference the
frequency range.

Change-Id: I419aa913304c3b7e7d553a1419b92f9ee46ac754
CRs-Fixed: 2182461
2018-02-15 03:12:50 -08:00
Amar Singhal
40126d4847 qcacmn: Check world mode when setting country code
When setting country code dynamically, world mode is
variable. Multiple world modes are supported depending
on the BDF configuration. Currently, it does not check
the world mode when setting country code and not take
appropriate action.

Change-Id: Ibd087825dbdba58d3d52d0c208edf183e3088731
CRs-Fixed: 2182129
2018-02-10 00:52:18 -08:00
Liangwei Dong
bc9c485826 qcacmn: Keep unsafe chan enabled in curr_chan_list
Station mode needs the full chan list including unsafe chan.
And HDD and policy mgr has local copy the unsafe chan list
for chan avoidance checking for SAP mode.

Keep unsafe chan in curr_chan_list and add unit test ucfg API
for chan avoidance internal test.

Change-Id: I23e040048a6dc1cc604cc2be91ac74916eb74f23
CRs-Fixed: 2182400
2018-02-10 00:00:35 -08:00
Paul Zhang
ca6152167b qcacmn: Support 11d for non-offload platform
Support 11d for non-offload platform by maintaining
count of beacons encountered for each country code
and choosing country code with max votes as device's
country code.

Change-Id: I83b66e980854eded17e254386561fa32b1f8c4ac
CRs-Fixed: 2154048
2018-02-08 21:37:37 -08:00
Vignesh U
1f3bcf604a qcacmn: Regulatory 24 updates
1. Remove below country codes:
	ARGENTINA (5003)
	AUSTRALIA (5000)
	CANADA (5001)
	KOREA ROC 3 (412)
	UNITED STATES (841)
	UNITED STATES (842)
	UNITED STATES (843)
	BELGIUM2 (4101)
	INDIA2 (5006)

2. Update regdomain
	ARGENTINA from FCC3_WORLD to APL16_WORLD
	BELIZE from FCC3_ETSIC to ETSI8_WORLD
	CANADA from FCC3_FCCA to FCC6_FCCA
	CHILE from APL6_WORLD to APL23_WORLD
	JAMAICA from FCC3_WORLD to FCC13_WORLD
	NAMIBIA from APL9_WORLD to APL20_WORLD
	NEPAL from APL6_WORLD to APL23_WORLD
	SENEGAL from FCC3_WORLD to FCC13_WORLD
	UNITED STATES from FCC3_FCCA to FCC8_FCCA

3. Add IRAQ country code

4. MCL country Lookup table

Change-Id: I4b0468d9256ac919a2684d1980f8b017a8107248
CRs-Fixed: 2180713
2018-02-06 07:44:54 -08:00
Srinivas Pitla
3dcdf9e7a8 qcacmn: Move regulatory capabilities
Move regulatory capabilities from object manager to regulatory

Change-Id: I3e785d2c03b5f1c944827d57bc9b546c6cdcc65b
CRs-Fixed: 2177109
2018-02-03 15:11:00 -08:00
Paul Zhang
36b80ed9bf qcacmn: use driver database for reg no-offload
For reg no-offload case, it needs to call the
reg_program_chan_list() function directory to apply
the right channel info.

Change-Id: Ieb7acf9f96973a6e56146e2763f455ef92838c4a
CRs-Fixed: 2174286
2018-02-02 01:53:59 -08:00
Paul Zhang
48884688c3 qcacmn: Add api to get the current country code
Add new api to provide the current country code
is using.

Change-Id: I84682e132fd1e150d7c4f86b04bbfc8c45e2d841
CRs-Fixed: 2175022
2018-01-30 23:55:23 -08:00
bings
6c40b760d5 qcacmn: set center freq segment0 for channel params in 2g HT20 mode
In the routine sap_ch_params_to_bonding_channels, the channels is set
invalid value 0 if center freq segment0 for channel params is 0.

ch_params->center_freq_seg0 should be set for 2g HT20 mode.

Change-Id: I063f1341da5a4934c97dec4bcda9367101de7cc5
CRs-Fixed: 2179368
2018-01-30 21:29:00 -08:00
Shashikala Prabhu
af18e70b24 qcacmn: Fix pdev refcount issue in regulatory component
Regulatory component takes pdev reference count in pdev create handler by
invoking reg_send_scheduler_msg_sb() to call registered callback functions
to notify current channel change. We cannot take ref count in creation
handler of that pdev object since the object creation is not completed and
ref count initialization might be incomplete in some cases. For example,
if any component releases ref count, it will lead to object deletion.
If any component object fails to create, it requires complete object to be
cleaned up. That leads to leaking the object due to object reference
is held by another component.

Define dispatcher_pdev_open() and call it after creating the PDEV object.
Invoke reg_send_scheduler_msg_sb() from dispatcher_pdev_open() instead of
calling it from pdev create handler.

Change-Id: I0b000f5bbd56045abef3706182c208f63dea69aa
CRs-Fixed: 2168027
2018-01-23 22:29:19 -08:00
Will Huang
e6da44ea06 qcacmn: Call ch avoid register/unregister callbacks
tx_ops->register_ch_avoid_event_handler and
tx_ops->unregister_ch_avoid_event_handler are set but never called.
Call register_ch_avoid_event_handler when regulatory_psoc_open, call
unregister_ch_avoid_event_handler when regulatory_psoc_close.

Change-Id: I663f3020b78773560d6991dc70da9dcdd6c218a9
CRs-Fixed: 2163619
2018-01-21 19:21:00 -08:00
Kiran Kumar Lokere
3550d5a7f6 qcacmn: Fix possible buffer overflow in regulatory api
Check for channel list size before accessing it to avoid
possible buffer overflow

Change-Id: I2cf36adb2651a40d6e186deaef58330d1c0105ca
CRs-Fixed: 2160756
2018-01-16 17:41:00 -08:00
Shashikala Prabhu
a7db8ce9a1 qcacmn: Add function pointers to get regdb information
Add function pointers to set/get chan 144 support, program
country code and get current regdomain information from
regdb component. These information is used by WIN offload and
lmac layers.

Change-Id: I6344260a7761e958eeee9e5d7faf091812ed4ed2
CRs-Fixed: 2160593
2018-01-15 15:39:16 -08:00
Varun Reddy Yeturu
e0883edf1d qcacmn: Define BAND_UNKNOWN in enum band_info
Define BAND_UNKNOWN in enum band_info

Change-Id: Icae4576b5c511fb8d74fd2bcef95642b416a56e4
CRs-Fixed: 2154595
2017-12-07 23:19:04 -08:00