Merge ~canonical-hwe-team/ubuntu/+source/backport-iwlwifi-dkms/+git/backport-iwlwifi-dkms:for-hwe/merge-debian-7858 into ~canonical-hwe-team/ubuntu/+source/backport-iwlwifi-dkms/+git/backport-iwlwifi-dkms:ubuntu/master
- Git
- lp:~canonical-hwe-team/ubuntu/+source/backport-iwlwifi-dkms/+git/backport-iwlwifi-dkms
- for-hwe/merge-debian-7858
- Merge into ubuntu/master
Proposed by
You-Sheng Yang
Status: | Merged |
---|---|
Approved by: | You-Sheng Yang |
Approved revision: | 92d6afda0f493ac467b041eeea9afe1a9af45478 |
Merged at revision: | 92d6afda0f493ac467b041eeea9afe1a9af45478 |
Proposed branch: | ~canonical-hwe-team/ubuntu/+source/backport-iwlwifi-dkms/+git/backport-iwlwifi-dkms:for-hwe/merge-debian-7858 |
Merge into: | ~canonical-hwe-team/ubuntu/+source/backport-iwlwifi-dkms/+git/backport-iwlwifi-dkms:ubuntu/master |
Diff against target: |
5396 lines (+313/-2227) 44 files modified
debian/changelog (+6/-0) defconfigs/iwlwifi-galileo (+0/-2) defconfigs/iwlwifi-public (+0/-2) defconfigs/iwlwifi-public-android (+0/-3) defconfigs/prune-public (+0/-2) defconfigs/soc_ip_hfpga (+0/-2) dev/null (+0/-796) drivers/net/wireless/intel/iwlwifi/Kconfig.noupstream (+0/-26) drivers/net/wireless/intel/iwlwifi/fw/api/coex.h (+2/-122) drivers/net/wireless/intel/iwlwifi/fw/api/commands.h (+2/-31) drivers/net/wireless/intel/iwlwifi/fw/api/rs.h (+13/-5) drivers/net/wireless/intel/iwlwifi/fw/api/scan.h (+47/-8) drivers/net/wireless/intel/iwlwifi/fw/file.h (+1/-3) drivers/net/wireless/intel/iwlwifi/iwl-dbg-cfg.h (+1/-6) drivers/net/wireless/intel/iwlwifi/iwl-drv.c (+0/-8) drivers/net/wireless/intel/iwlwifi/iwl-modparams.h (+2/-7) drivers/net/wireless/intel/iwlwifi/iwl-op-mode.h (+0/-23) drivers/net/wireless/intel/iwlwifi/iwl-trans.c (+0/-14) drivers/net/wireless/intel/iwlwifi/iwl-trans.h (+29/-73) drivers/net/wireless/intel/iwlwifi/mvm/Makefile (+0/-2) drivers/net/wireless/intel/iwlwifi/mvm/coex.c (+2/-158) drivers/net/wireless/intel/iwlwifi/mvm/d3.c (+9/-0) drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c (+2/-15) drivers/net/wireless/intel/iwlwifi/mvm/fw.c (+3/-19) drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c (+25/-1) drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c (+10/-72) drivers/net/wireless/intel/iwlwifi/mvm/mvm.h (+7/-69) drivers/net/wireless/intel/iwlwifi/mvm/ops.c (+0/-19) drivers/net/wireless/intel/iwlwifi/mvm/phy-ctxt.c (+3/-7) drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c (+21/-8) drivers/net/wireless/intel/iwlwifi/mvm/scan.c (+63/-24) drivers/net/wireless/intel/iwlwifi/mvm/vendor-cmd.c (+0/-405) drivers/net/wireless/intel/iwlwifi/pcie/drv.c (+0/-99) drivers/net/wireless/intel/iwlwifi/pcie/internal.h (+3/-8) drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c (+3/-3) drivers/net/wireless/intel/iwlwifi/pcie/trans.c (+10/-61) drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c (+2/-40) drivers/net/wireless/intel/iwlwifi/pcie/tx.c (+25/-65) drivers/net/wireless/intel/iwlwifi/xvt/fw.c (+3/-6) drivers/net/wireless/intel/iwlwifi/xvt/user-infc.c (+6/-5) drivers/net/wireless/intel/iwlwifi/xvt/xvt.h (+3/-3) local-symbols (+0/-3) net/mac80211/vht.c (+9/-1) versions (+1/-1) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
You-Sheng Yang | Approve | ||
Review via email: mp+369139@code.launchpad.net |
Commit message
Sync with Debian version 7858.
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | diff --git a/debian/changelog b/debian/changelog | |||
2 | index bfbb1fa..f6dc7d4 100644 | |||
3 | --- a/debian/changelog | |||
4 | +++ b/debian/changelog | |||
5 | @@ -1,3 +1,9 @@ | |||
6 | 1 | backport-iwlwifi-dkms (7858-ubuntu1) UNRELEASED; urgency=low | ||
7 | 2 | |||
8 | 3 | * sync with debian 7858. | ||
9 | 4 | |||
10 | 5 | -- You-Sheng Yang <vicamo@gmail.com> Fri, 21 Jun 2019 15:27:31 +0800 | ||
11 | 6 | |||
12 | 1 | backport-iwlwifi-dkms (7841-ubuntu2) UNRELEASED; urgency=low | 7 | backport-iwlwifi-dkms (7841-ubuntu2) UNRELEASED; urgency=low |
13 | 2 | 8 | ||
14 | 3 | * add modalias support. | 9 | * add modalias support. |
15 | diff --git a/defconfigs/iwlwifi-galileo b/defconfigs/iwlwifi-galileo | |||
16 | index 812014f..14e0b45 100644 | |||
17 | --- a/defconfigs/iwlwifi-galileo | |||
18 | +++ b/defconfigs/iwlwifi-galileo | |||
19 | @@ -21,8 +21,6 @@ CPTCFG_IWLWIFI_DEVICE_TESTMODE=y | |||
20 | 21 | # CPTCFG_MAC80211_HWSIM is not set | 21 | # CPTCFG_MAC80211_HWSIM is not set |
21 | 22 | CPTCFG_IWLXVT=m | 22 | CPTCFG_IWLXVT=m |
22 | 23 | CPTCFG_IWLWIFI_SUPPORT_DEBUG_OVERRIDES=y | 23 | CPTCFG_IWLWIFI_SUPPORT_DEBUG_OVERRIDES=y |
23 | 24 | # CPTCFG_IWLWIFI_FRQ_MGR_TEST is not set | ||
24 | 25 | # CPTCFG_IWLWIFI_FORCE_OFDM_RATE is not set | 24 | # CPTCFG_IWLWIFI_FORCE_OFDM_RATE is not set |
25 | 26 | # CPTCFG_IWLWIFI_LTE_COEX is not set | ||
26 | 27 | # CPTCFG_IWLMVM_P2P_UAPSD_STANDALONE is not set | 25 | # CPTCFG_IWLMVM_P2P_UAPSD_STANDALONE is not set |
27 | 28 | CPTCFG_IWLWIFI_NUM_CHANNELS=1 | 26 | CPTCFG_IWLWIFI_NUM_CHANNELS=1 |
28 | diff --git a/defconfigs/iwlwifi-public b/defconfigs/iwlwifi-public | |||
29 | index ef43e35..c457087 100644 | |||
30 | --- a/defconfigs/iwlwifi-public | |||
31 | +++ b/defconfigs/iwlwifi-public | |||
32 | @@ -19,6 +19,4 @@ CPTCFG_IWLWIFI_DEVICE_TRACING=y | |||
33 | 19 | CPTCFG_IWLWIFI_DEVICE_TESTMODE=y | 19 | CPTCFG_IWLWIFI_DEVICE_TESTMODE=y |
34 | 20 | # CPTCFG_MAC80211_HWSIM is not set | 20 | # CPTCFG_MAC80211_HWSIM is not set |
35 | 21 | CPTCFG_IWLXVT=m | 21 | CPTCFG_IWLXVT=m |
36 | 22 | CPTCFG_IWLWIFI_FRQ_MGR_TEST=y | ||
37 | 23 | CPTCFG_IWLWIFI_OPMODE_MODULAR=y | 22 | CPTCFG_IWLWIFI_OPMODE_MODULAR=y |
38 | 24 | CPTCFG_IWLWIFI_LTE_COEX=y | ||
39 | diff --git a/defconfigs/iwlwifi-public-android b/defconfigs/iwlwifi-public-android | |||
40 | index f430328..16114af 100644 | |||
41 | --- a/defconfigs/iwlwifi-public-android | |||
42 | +++ b/defconfigs/iwlwifi-public-android | |||
43 | @@ -19,9 +19,6 @@ CPTCFG_IWLWIFI_DEVICE_TRACING=y | |||
44 | 19 | CPTCFG_IWLWIFI_DEVICE_TESTMODE=y | 19 | CPTCFG_IWLWIFI_DEVICE_TESTMODE=y |
45 | 20 | # CPTCFG_MAC80211_HWSIM is not set | 20 | # CPTCFG_MAC80211_HWSIM is not set |
46 | 21 | # CPTCFG_IWLXVT is not set | 21 | # CPTCFG_IWLXVT is not set |
47 | 22 | # CPTCFG_IWLWIFI_FRQ_MGR_TEST is not set | ||
48 | 23 | # CPTCFG_IWLWIFI_FRQ_MGR is not set | ||
49 | 24 | CPTCFG_IWLWIFI_OPMODE_MODULAR=y | 22 | CPTCFG_IWLWIFI_OPMODE_MODULAR=y |
50 | 25 | CPTCFG_IWLWIFI_LTE_COEX=y | ||
51 | 26 | CPTCFG_IWLWIFI_BCAST_FILTERING=y | 23 | CPTCFG_IWLWIFI_BCAST_FILTERING=y |
52 | 27 | # CPTCFG_IWLMVM_AX_SUPPORT is not set | 24 | # CPTCFG_IWLMVM_AX_SUPPORT is not set |
53 | diff --git a/defconfigs/prune-public b/defconfigs/prune-public | |||
54 | index 4076f6d..52e509d 100644 | |||
55 | --- a/defconfigs/prune-public | |||
56 | +++ b/defconfigs/prune-public | |||
57 | @@ -17,6 +17,4 @@ CPTCFG_IWLWIFI_DEBUGFS=y | |||
58 | 17 | CPTCFG_IWLWIFI_DEVICE_TRACING=y | 17 | CPTCFG_IWLWIFI_DEVICE_TRACING=y |
59 | 18 | CPTCFG_IWLWIFI_DEVICE_TESTMODE=y | 18 | CPTCFG_IWLWIFI_DEVICE_TESTMODE=y |
60 | 19 | CPTCFG_IWLXVT=m | 19 | CPTCFG_IWLXVT=m |
61 | 20 | CPTCFG_IWLWIFI_FRQ_MGR_TEST=y | ||
62 | 21 | CPTCFG_IWLWIFI_OPMODE_MODULAR=y | 20 | CPTCFG_IWLWIFI_OPMODE_MODULAR=y |
63 | 22 | CPTCFG_IWLWIFI_LTE_COEX=y | ||
64 | diff --git a/defconfigs/soc_ip_hfpga b/defconfigs/soc_ip_hfpga | |||
65 | index 57aba4d..4485fbf 100644 | |||
66 | --- a/defconfigs/soc_ip_hfpga | |||
67 | +++ b/defconfigs/soc_ip_hfpga | |||
68 | @@ -19,6 +19,4 @@ CPTCFG_IWLWIFI_DEVICE_TRACING=y | |||
69 | 19 | CPTCFG_IWLWIFI_DEVICE_TESTMODE=y | 19 | CPTCFG_IWLWIFI_DEVICE_TESTMODE=y |
70 | 20 | CPTCFG_IWLXVT=m | 20 | CPTCFG_IWLXVT=m |
71 | 21 | CPTCFG_IWLWIFI_SUPPORT_DEBUG_OVERRIDES=y | 21 | CPTCFG_IWLWIFI_SUPPORT_DEBUG_OVERRIDES=y |
72 | 22 | # CPTCFG_IWLWIFI_FRQ_MGR_TEST is not set | ||
73 | 23 | # CPTCFG_IWLWIFI_FORCE_OFDM_RATE is not set | 22 | # CPTCFG_IWLWIFI_FORCE_OFDM_RATE is not set |
74 | 24 | # CPTCFG_IWLWIFI_LTE_COEX is not set | ||
75 | diff --git a/drivers/net/wireless/intel/iwlwifi/Kconfig.noupstream b/drivers/net/wireless/intel/iwlwifi/Kconfig.noupstream | |||
76 | index fb00937..434c115 100644 | |||
77 | --- a/drivers/net/wireless/intel/iwlwifi/Kconfig.noupstream | |||
78 | +++ b/drivers/net/wireless/intel/iwlwifi/Kconfig.noupstream | |||
79 | @@ -38,26 +38,6 @@ config IWLWIFI_DEVICE_TESTMODE | |||
80 | 38 | default y if IWLMVM | 38 | default y if IWLMVM |
81 | 39 | select IWLWIFI_SUPPORT_DEBUG_OVERRIDES | 39 | select IWLWIFI_SUPPORT_DEBUG_OVERRIDES |
82 | 40 | 40 | ||
83 | 41 | config IWLWIFI_FRQ_MGR_TEST | ||
84 | 42 | bool "Enable Frequency Manager API - Test Mode" | ||
85 | 43 | depends on IWLMVM && IWLWIFI_SUPPORT_DEBUG_OVERRIDES | ||
86 | 44 | help | ||
87 | 45 | This option enables running The Frequency Manager API | ||
88 | 46 | in Debug Mode without having A Frequency Manager. | ||
89 | 47 | In this mode you can run the Frequency Manager on any Platform, | ||
90 | 48 | monitor the notifications that the driver send the Frequency Manager, | ||
91 | 49 | and initiate notifications from the Frequency Manager. | ||
92 | 50 | |||
93 | 51 | config IWLWIFI_FRQ_MGR | ||
94 | 52 | bool "enable Frequency Manager API" if !IWLWIFI_FRQ_MGR_TEST | ||
95 | 53 | default y if IWLWIFI_FRQ_MGR_TEST | ||
96 | 54 | depends on IWLMVM && (IUI_FM || IWLWIFI_FRQ_MGR_TEST) | ||
97 | 55 | help | ||
98 | 56 | This option enables The Frequency Manager API. | ||
99 | 57 | Enabling this option allows the driver to receive and send | ||
100 | 58 | Frequency notification from and to the Frequency Manager. | ||
101 | 59 | The notification can involve Tx power, Rx gain, and ADC/DAC | ||
102 | 60 | |||
103 | 61 | config IWLWIFI_SUPPORT_DEBUG_OVERRIDES | 41 | config IWLWIFI_SUPPORT_DEBUG_OVERRIDES |
104 | 62 | depends on IWLWIFI | 42 | depends on IWLWIFI |
105 | 63 | bool "enable default value override (for debugging)" | 43 | bool "enable default value override (for debugging)" |
106 | @@ -94,12 +74,6 @@ config IWLMVM_VENDOR_CMDS | |||
107 | 94 | This option mostly exists for non-upstream tagging, so best | 74 | This option mostly exists for non-upstream tagging, so best |
108 | 95 | leave it set to Y. | 75 | leave it set to Y. |
109 | 96 | 76 | ||
110 | 97 | config IWLWIFI_LTE_COEX | ||
111 | 98 | bool "enable lte coexistence support" | ||
112 | 99 | depends on IWLMVM_VENDOR_CMDS | ||
113 | 100 | help | ||
114 | 101 | This option enables LTE-Coexistence (vendor) commands | ||
115 | 102 | |||
116 | 103 | config IWLMVM_TDLS_PEER_CACHE | 77 | config IWLMVM_TDLS_PEER_CACHE |
117 | 104 | bool "enable TDLS peer caching and traffic monitoring" | 78 | bool "enable TDLS peer caching and traffic monitoring" |
118 | 105 | depends on IWLMVM_VENDOR_CMDS | 79 | depends on IWLMVM_VENDOR_CMDS |
119 | diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/coex.h b/drivers/net/wireless/intel/iwlwifi/fw/api/coex.h | |||
120 | index 33abd47..faf38ee 100644 | |||
121 | --- a/drivers/net/wireless/intel/iwlwifi/fw/api/coex.h | |||
122 | +++ b/drivers/net/wireless/intel/iwlwifi/fw/api/coex.h | |||
123 | @@ -8,7 +8,7 @@ | |||
124 | 8 | * Copyright(c) 2013 - 2014 Intel Corporation. All rights reserved. | 8 | * Copyright(c) 2013 - 2014 Intel Corporation. All rights reserved. |
125 | 9 | * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH | 9 | * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH |
126 | 10 | * Copyright(c) 2017 Intel Deutschland GmbH | 10 | * Copyright(c) 2017 Intel Deutschland GmbH |
128 | 11 | * Copyright(c) 2018 Intel Corporation | 11 | * Copyright(c) 2018 - 2019 Intel Corporation |
129 | 12 | * | 12 | * |
130 | 13 | * This program is free software; you can redistribute it and/or modify | 13 | * This program is free software; you can redistribute it and/or modify |
131 | 14 | * it under the terms of version 2 of the GNU General Public License as | 14 | * it under the terms of version 2 of the GNU General Public License as |
132 | @@ -31,7 +31,7 @@ | |||
133 | 31 | * Copyright(c) 2013 - 2014 Intel Corporation. All rights reserved. | 31 | * Copyright(c) 2013 - 2014 Intel Corporation. All rights reserved. |
134 | 32 | * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH | 32 | * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH |
135 | 33 | * Copyright(c) 2017 Intel Deutschland GmbH | 33 | * Copyright(c) 2017 Intel Deutschland GmbH |
137 | 34 | * Copyright(c) 2018 Intel Corporation | 34 | * Copyright(c) 2018 - 2019 Intel Corporation |
138 | 35 | * All rights reserved. | 35 | * All rights reserved. |
139 | 36 | * | 36 | * |
140 | 37 | * Redistribution and use in source and binary forms, with or without | 37 | * Redistribution and use in source and binary forms, with or without |
141 | @@ -242,124 +242,4 @@ struct iwl_bt_coex_profile_notif { | |||
142 | 242 | __le16 reserved; | 242 | __le16 reserved; |
143 | 243 | } __packed; /* BT_COEX_PROFILE_NTFY_API_S_VER_4 */ | 243 | } __packed; /* BT_COEX_PROFILE_NTFY_API_S_VER_4 */ |
144 | 244 | 244 | ||
145 | 245 | #ifdef CPTCFG_IWLWIFI_FRQ_MGR | ||
146 | 246 | /* | ||
147 | 247 | * struct iwl_config_2g_coex_cmd - 2G Coex configuration command | ||
148 | 248 | * (CONFIG_2G_COEX_CMD = 0x71) | ||
149 | 249 | * @enabled: 2g coex is enabled/disabled | ||
150 | 250 | */ | ||
151 | 251 | struct iwl_config_2g_coex_cmd { | ||
152 | 252 | __le32 enabled; | ||
153 | 253 | } __packed; /* CONFIG_2G_COEX_CMD_API_S_VER_1 */ | ||
154 | 254 | #endif | ||
155 | 255 | |||
156 | 256 | #ifdef CPTCFG_IWLWIFI_LTE_COEX | ||
157 | 257 | |||
158 | 258 | #define WIFI_BAND_24_NUM_CHANNELS 14 | ||
159 | 259 | #define LTE_COEX_MFUART_CONFIG_LENGTH 12 | ||
160 | 260 | #define LTE_COEX_FRAME_STRUCTURE_LENGTH 2 | ||
161 | 261 | |||
162 | 262 | /** | ||
163 | 263 | * struct iwl_lte_coex_config_cmd - LTE Coex configuration command | ||
164 | 264 | * @lte_state: lte modem state | ||
165 | 265 | * @lte_band: lte operating band | ||
166 | 266 | * @lte_chan: lte operating channel | ||
167 | 267 | * @lte_frame_structure: ? | ||
168 | 268 | * @tx_safe_freq_min: ? | ||
169 | 269 | * @tx_safe_freq_max: ? | ||
170 | 270 | * @rx_safe_freq_min: ? | ||
171 | 271 | * @rx_safe_freq_max: ? | ||
172 | 272 | * @max_tx_power: wifi static max tx output power per channel | ||
173 | 273 | * | ||
174 | 274 | * Used for LTE_COEX_CONFIG_CMD command | ||
175 | 275 | */ | ||
176 | 276 | struct iwl_lte_coex_config_cmd { | ||
177 | 277 | __le32 lte_state; | ||
178 | 278 | __le32 lte_band; | ||
179 | 279 | __le32 lte_chan; | ||
180 | 280 | __le32 lte_frame_structure[LTE_COEX_FRAME_STRUCTURE_LENGTH]; | ||
181 | 281 | __le32 tx_safe_freq_min; | ||
182 | 282 | __le32 tx_safe_freq_max; | ||
183 | 283 | __le32 rx_safe_freq_min; | ||
184 | 284 | __le32 rx_safe_freq_max; | ||
185 | 285 | u8 max_tx_power[WIFI_BAND_24_NUM_CHANNELS]; | ||
186 | 286 | } __packed; /* LTE_COEX_CONFIG_CMD_API_S_VER_1 */ | ||
187 | 287 | |||
188 | 288 | /** | ||
189 | 289 | * struct iwl_lte_coex_static_params_cmd - LTE Coex static params configuration | ||
190 | 290 | * command | ||
191 | 291 | * @mfu_config: MFUART config and RT signals assert/de-assert timing | ||
192 | 292 | * @tx_power_in_dbm: Wifi safe power table | ||
193 | 293 | * | ||
194 | 294 | * Used for LTE_COEX_STATIC_PARAMS_CMD command | ||
195 | 295 | */ | ||
196 | 296 | struct iwl_lte_coex_static_params_cmd { | ||
197 | 297 | __le32 mfu_config[LTE_COEX_MFUART_CONFIG_LENGTH]; | ||
198 | 298 | s8 tx_power_in_dbm[32]; | ||
199 | 299 | } __packed; /* LTE_COEX_STATIC_PARAMS_CMD_API_S_VER_1 */ | ||
200 | 300 | |||
201 | 301 | /** | ||
202 | 302 | * struct iwl_lte_coex_wifi_reported_channel_cmd - LTE Coex reported channels | ||
203 | 303 | * configuration command | ||
204 | 304 | * @channel: channel number (1-14) | ||
205 | 305 | * @bandwidth: bandwidth (0-3) | ||
206 | 306 | * | ||
207 | 307 | * Used for LTE_COEX_WIFI_REPORTED_CHANNEL_CMD command | ||
208 | 308 | */ | ||
209 | 309 | struct iwl_lte_coex_wifi_reported_channel_cmd { | ||
210 | 310 | __le32 channel; | ||
211 | 311 | __le32 bandwidth; | ||
212 | 312 | } __packed; /* LTE_COEX_WIFI_REPORTED_CHANNEL_CMD_API_S_VER_1 */ | ||
213 | 313 | |||
214 | 314 | /** | ||
215 | 315 | * struct iwl_lte_coex_sps_cmd - LTE Coex semi persistent info command | ||
216 | 316 | * | ||
217 | 317 | * @lte_semi_persistent_info: | ||
218 | 318 | * | ||
219 | 319 | * Used for LTE_COEX_SPS_CMD command | ||
220 | 320 | */ | ||
221 | 321 | struct iwl_lte_coex_sps_cmd { | ||
222 | 322 | __le32 lte_semi_persistent_info; | ||
223 | 323 | } __packed; /* LTE_COEX_WIFI_SPS_CMD_API_S_VER_1 */ | ||
224 | 324 | |||
225 | 325 | /** | ||
226 | 326 | * struct iwl_lte_coex_fine_tuning_params_cmd - LTE Coex fine tuning parameters | ||
227 | 327 | * @rx_protection_assert_timing: 802_RX_PRI request advance time | ||
228 | 328 | * @tx_protection_assert_timing: 802_TX_ON request advance time | ||
229 | 329 | * @rx_protection_timeout: Cancel Rx Protection request due to no Rx threshold | ||
230 | 330 | * @min_tx_power: Min-Tx-Power threshold for Data/Management frames | ||
231 | 331 | * @lte_ul_load_uapsd_threshold: 'LTE UL Load' counter thresholds | ||
232 | 332 | * for recommending Power-Manager to enter to UAPSD | ||
233 | 333 | * @rx_failure_during_ul_uapsd_threshold: 'Rx Failure due to UL' counter | ||
234 | 334 | * thresholds for recommending Power-Manager to enter to UAPSD | ||
235 | 335 | * @rx_failure_during_ul_sc_threshold: 'Rx Failure due to UL' | ||
236 | 336 | * counter threshold for recommending Scan-Manager to apply compensation | ||
237 | 337 | * @rx_duration_for_ack_protection_us: Tx Ack size for Tx Protection | ||
238 | 338 | * @beacon_failure_during_ul_counter: Failed Rx Beacon threshold | ||
239 | 339 | * @dtim_failure_during_ul_counter: Failed Rx DTIM threshold | ||
240 | 340 | * | ||
241 | 341 | * Used for LTE_COEX_FINE_TUNING_PARAMS_CMD command | ||
242 | 342 | */ | ||
243 | 343 | struct iwl_lte_coex_fine_tuning_params_cmd { | ||
244 | 344 | __le32 rx_protection_assert_timing; | ||
245 | 345 | __le32 tx_protection_assert_timing; | ||
246 | 346 | __le32 rx_protection_timeout; | ||
247 | 347 | __le32 min_tx_power; | ||
248 | 348 | __le32 lte_ul_load_uapsd_threshold; | ||
249 | 349 | __le32 rx_failure_during_ul_uapsd_threshold; | ||
250 | 350 | __le32 rx_failure_during_ul_sc_threshold; | ||
251 | 351 | __le32 rx_duration_for_ack_protection_us; | ||
252 | 352 | __le32 beacon_failure_during_ul_counter; | ||
253 | 353 | __le32 dtim_failure_during_ul_counter; | ||
254 | 354 | } __packed; /* LTE_COEX_FINE_TUNING_PARAMS_CMD_API_S_VER_1 */ | ||
255 | 355 | |||
256 | 356 | /** | ||
257 | 357 | * struct iwl_lte_coex_statistic_ntfy - LTE Coex statistics notification | ||
258 | 358 | * @statistic_placeholder: placeholder | ||
259 | 359 | */ | ||
260 | 360 | struct iwl_lte_coex_statistic_ntfy { | ||
261 | 361 | __le32 statistic_placeholder; | ||
262 | 362 | } __packed; /* LTE_COEX_STATISTIC_NTFY_API_S_VER_1 */ | ||
263 | 363 | #endif /* CPTCFG_IWLWIFI_LTE_COEX */ | ||
264 | 364 | |||
265 | 365 | #endif /* __iwl_fw_api_coex_h__ */ | 245 | #endif /* __iwl_fw_api_coex_h__ */ |
266 | diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/commands.h b/drivers/net/wireless/intel/iwlwifi/fw/api/commands.h | |||
267 | index e7eecb1..d665938 100644 | |||
268 | --- a/drivers/net/wireless/intel/iwlwifi/fw/api/commands.h | |||
269 | +++ b/drivers/net/wireless/intel/iwlwifi/fw/api/commands.h | |||
270 | @@ -8,7 +8,7 @@ | |||
271 | 8 | * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. | 8 | * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. |
272 | 9 | * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH | 9 | * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH |
273 | 10 | * Copyright(c) 2016 - 2017 Intel Deutschland GmbH | 10 | * Copyright(c) 2016 - 2017 Intel Deutschland GmbH |
275 | 11 | * Copyright(c) 2018 Intel Corporation | 11 | * Copyright(c) 2018 - 2019 Intel Corporation |
276 | 12 | * | 12 | * |
277 | 13 | * This program is free software; you can redistribute it and/or modify | 13 | * This program is free software; you can redistribute it and/or modify |
278 | 14 | * it under the terms of version 2 of the GNU General Public License as | 14 | * it under the terms of version 2 of the GNU General Public License as |
279 | @@ -31,7 +31,7 @@ | |||
280 | 31 | * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. | 31 | * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. |
281 | 32 | * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH | 32 | * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH |
282 | 33 | * Copyright(c) 2016 - 2017 Intel Deutschland GmbH | 33 | * Copyright(c) 2016 - 2017 Intel Deutschland GmbH |
284 | 34 | * Copyright(c) 2018 Intel Corporation | 34 | * Copyright(c) 2018 - 2019 Intel Corporation |
285 | 35 | * All rights reserved. | 35 | * All rights reserved. |
286 | 36 | * | 36 | * |
287 | 37 | * Redistribution and use in source and binary forms, with or without | 37 | * Redistribution and use in source and binary forms, with or without |
288 | @@ -540,35 +540,6 @@ enum iwl_legacy_cmds { | |||
289 | 540 | */ | 540 | */ |
290 | 541 | BT_COEX_CI = 0x5d, | 541 | BT_COEX_CI = 0x5d, |
291 | 542 | 542 | ||
292 | 543 | #ifdef CPTCFG_IWLWIFI_LTE_COEX | ||
293 | 544 | /** | ||
294 | 545 | * @LTE_COEX_CONFIG_CMD: &struct iwl_lte_coex_config_cmd | ||
295 | 546 | */ | ||
296 | 547 | LTE_COEX_CONFIG_CMD = 0x4a, | ||
297 | 548 | |||
298 | 549 | /** | ||
299 | 550 | * @LTE_COEX_WIFI_REPORTED_CHANNEL_CMD: | ||
300 | 551 | * &struct iwl_lte_coex_wifi_reported_channel_cmd | ||
301 | 552 | */ | ||
302 | 553 | LTE_COEX_WIFI_REPORTED_CHANNEL_CMD = 0X4b, | ||
303 | 554 | |||
304 | 555 | /** | ||
305 | 556 | * @LTE_COEX_STATIC_PARAMS_CMD: &struct iwl_lte_coex_static_params_cmd | ||
306 | 557 | */ | ||
307 | 558 | LTE_COEX_STATIC_PARAMS_CMD = 0x4c, | ||
308 | 559 | |||
309 | 560 | /** | ||
310 | 561 | * @LTE_COEX_SPS_CMD: struct iwl_lte_coex_sps_cmd | ||
311 | 562 | */ | ||
312 | 563 | LTE_COEX_SPS_CMD = 0x4d, | ||
313 | 564 | |||
314 | 565 | /** | ||
315 | 566 | * @LTE_COEX_FINE_TUNING_PARAMS_CMD: | ||
316 | 567 | * &struct iwl_lte_coex_fine_tuning_params_cmd | ||
317 | 568 | */ | ||
318 | 569 | LTE_COEX_FINE_TUNING_PARAMS_CMD = 0x57, | ||
319 | 570 | #endif | ||
320 | 571 | |||
321 | 572 | /** | 543 | /** |
322 | 573 | * @REPLY_SF_CFG_CMD: &struct iwl_sf_cfg_cmd | 544 | * @REPLY_SF_CFG_CMD: &struct iwl_sf_cfg_cmd |
323 | 574 | */ | 545 | */ |
324 | diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/rs.h b/drivers/net/wireless/intel/iwlwifi/fw/api/rs.h | |||
325 | index 9eddc4d..4347be6 100644 | |||
326 | --- a/drivers/net/wireless/intel/iwlwifi/fw/api/rs.h | |||
327 | +++ b/drivers/net/wireless/intel/iwlwifi/fw/api/rs.h | |||
328 | @@ -7,7 +7,7 @@ | |||
329 | 7 | * | 7 | * |
330 | 8 | * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. | 8 | * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. |
331 | 9 | * Copyright(c) 2017 Intel Deutschland GmbH | 9 | * Copyright(c) 2017 Intel Deutschland GmbH |
333 | 10 | * Copyright(c) 2018 Intel Corporation | 10 | * Copyright(c) 2018 - 2019 Intel Corporation |
334 | 11 | * | 11 | * |
335 | 12 | * This program is free software; you can redistribute it and/or modify | 12 | * This program is free software; you can redistribute it and/or modify |
336 | 13 | * it under the terms of version 2 of the GNU General Public License as | 13 | * it under the terms of version 2 of the GNU General Public License as |
337 | @@ -29,7 +29,7 @@ | |||
338 | 29 | * | 29 | * |
339 | 30 | * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. | 30 | * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. |
340 | 31 | * Copyright(c) 2017 Intel Deutschland GmbH | 31 | * Copyright(c) 2017 Intel Deutschland GmbH |
342 | 32 | * Copyright(c) 2018 Intel Corporation | 32 | * Copyright(c) 2018 - 2019 Intel Corporation |
343 | 33 | * All rights reserved. | 33 | * All rights reserved. |
344 | 34 | * | 34 | * |
345 | 35 | * Redistribution and use in source and binary forms, with or without | 35 | * Redistribution and use in source and binary forms, with or without |
346 | @@ -166,8 +166,16 @@ enum iwl_tlc_mng_ht_rates { | |||
347 | 166 | IWL_TLC_MNG_HT_RATE_MAX = IWL_TLC_MNG_HT_RATE_MCS11, | 166 | IWL_TLC_MNG_HT_RATE_MAX = IWL_TLC_MNG_HT_RATE_MCS11, |
348 | 167 | }; | 167 | }; |
349 | 168 | 168 | ||
352 | 169 | /* Maximum supported tx antennas number */ | 169 | enum IWL_TLC_MNG_NSS { |
353 | 170 | #define MAX_NSS 2 | 170 | IWL_TLC_NSS_1, |
354 | 171 | IWL_TLC_NSS_2, | ||
355 | 172 | IWL_TLC_NSS_MAX | ||
356 | 173 | }; | ||
357 | 174 | |||
358 | 175 | enum IWL_TLC_HT_BW_RATES { | ||
359 | 176 | IWL_TLC_HT_BW_NONE_160, | ||
360 | 177 | IWL_TLC_HT_BW_160, | ||
361 | 178 | }; | ||
362 | 171 | 179 | ||
363 | 172 | /** | 180 | /** |
364 | 173 | * struct tlc_config_cmd - TLC configuration | 181 | * struct tlc_config_cmd - TLC configuration |
365 | @@ -195,7 +203,7 @@ struct iwl_tlc_config_cmd { | |||
366 | 195 | u8 amsdu; | 203 | u8 amsdu; |
367 | 196 | __le16 flags; | 204 | __le16 flags; |
368 | 197 | __le16 non_ht_rates; | 205 | __le16 non_ht_rates; |
370 | 198 | __le16 ht_rates[MAX_NSS][2]; | 206 | __le16 ht_rates[IWL_TLC_NSS_MAX][2]; |
371 | 199 | __le16 max_mpdu_len; | 207 | __le16 max_mpdu_len; |
372 | 200 | u8 sgi_ch_width_supp; | 208 | u8 sgi_ch_width_supp; |
373 | 201 | u8 reserved2[1]; | 209 | u8 reserved2[1]; |
374 | diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/scan.h b/drivers/net/wireless/intel/iwlwifi/fw/api/scan.h | |||
375 | index 1940a8c..8678b78 100644 | |||
376 | --- a/drivers/net/wireless/intel/iwlwifi/fw/api/scan.h | |||
377 | +++ b/drivers/net/wireless/intel/iwlwifi/fw/api/scan.h | |||
378 | @@ -93,6 +93,8 @@ struct iwl_ssid_ie { | |||
379 | 93 | #define IWL_SCAN_SHORT_BLACKLIST_LEN 16 | 93 | #define IWL_SCAN_SHORT_BLACKLIST_LEN 16 |
380 | 94 | #define IWL_SCAN_MAX_PROFILES 11 | 94 | #define IWL_SCAN_MAX_PROFILES 11 |
381 | 95 | #define SCAN_OFFLOAD_PROBE_REQ_SIZE 512 | 95 | #define SCAN_OFFLOAD_PROBE_REQ_SIZE 512 |
382 | 96 | #define SCAN_NUM_BAND_PROBE_DATA_V_1 2 | ||
383 | 97 | #define SCAN_NUM_BAND_PROBE_DATA_V_2 3 | ||
384 | 96 | 98 | ||
385 | 97 | /* Default watchdog (in MS) for scheduled scan iteration */ | 99 | /* Default watchdog (in MS) for scheduled scan iteration */ |
386 | 98 | #define IWL_SCHED_SCAN_WATCHDOG cpu_to_le16(15000) | 100 | #define IWL_SCHED_SCAN_WATCHDOG cpu_to_le16(15000) |
387 | @@ -252,9 +254,22 @@ struct iwl_scan_probe_segment { | |||
388 | 252 | * @common_data: last (and common) part of the probe | 254 | * @common_data: last (and common) part of the probe |
389 | 253 | * @buf: raw data block | 255 | * @buf: raw data block |
390 | 254 | */ | 256 | */ |
391 | 257 | struct iwl_scan_probe_req_v1 { | ||
392 | 258 | struct iwl_scan_probe_segment mac_header; | ||
393 | 259 | struct iwl_scan_probe_segment band_data[SCAN_NUM_BAND_PROBE_DATA_V_1]; | ||
394 | 260 | struct iwl_scan_probe_segment common_data; | ||
395 | 261 | u8 buf[SCAN_OFFLOAD_PROBE_REQ_SIZE]; | ||
396 | 262 | } __packed; | ||
397 | 263 | |||
398 | 264 | /* iwl_scan_probe_req - PROBE_REQUEST_FRAME_API_S_VER_v2 | ||
399 | 265 | * @mac_header: first (and common) part of the probe | ||
400 | 266 | * @band_data: band specific data | ||
401 | 267 | * @common_data: last (and common) part of the probe | ||
402 | 268 | * @buf: raw data block | ||
403 | 269 | */ | ||
404 | 255 | struct iwl_scan_probe_req { | 270 | struct iwl_scan_probe_req { |
405 | 256 | struct iwl_scan_probe_segment mac_header; | 271 | struct iwl_scan_probe_segment mac_header; |
407 | 257 | struct iwl_scan_probe_segment band_data[2]; | 272 | struct iwl_scan_probe_segment band_data[SCAN_NUM_BAND_PROBE_DATA_V_2]; |
408 | 258 | struct iwl_scan_probe_segment common_data; | 273 | struct iwl_scan_probe_segment common_data; |
409 | 259 | u8 buf[SCAN_OFFLOAD_PROBE_REQ_SIZE]; | 274 | u8 buf[SCAN_OFFLOAD_PROBE_REQ_SIZE]; |
410 | 260 | } __packed; | 275 | } __packed; |
411 | @@ -627,15 +642,29 @@ enum iwl_umac_scan_general_flags2 { | |||
412 | 627 | * struct iwl_scan_channel_cfg_umac | 642 | * struct iwl_scan_channel_cfg_umac |
413 | 628 | * @flags: bitmap - 0-19: directed scan to i'th ssid. | 643 | * @flags: bitmap - 0-19: directed scan to i'th ssid. |
414 | 629 | * @channel_num: channel number 1-13 etc. | 644 | * @channel_num: channel number 1-13 etc. |
415 | 645 | * @band: band of channel: 0 for 2GHz, 1 for 5GHz | ||
416 | 630 | * @iter_count: repetition count for the channel. | 646 | * @iter_count: repetition count for the channel. |
417 | 631 | * @iter_interval: interval between two scan iterations on one channel. | 647 | * @iter_interval: interval between two scan iterations on one channel. |
418 | 632 | */ | 648 | */ |
420 | 633 | struct iwl_scan_channel_cfg_umac { | 649 | struct iwl_scan_channel_cfg_umac { |
421 | 634 | __le32 flags; | 650 | __le32 flags; |
426 | 635 | u8 channel_num; | 651 | /* Both versions are of the same size, so use a union without adjusting |
427 | 636 | u8 iter_count; | 652 | * the command size later |
428 | 637 | __le16 iter_interval; | 653 | */ |
429 | 638 | } __packed; /* SCAN_CHANNEL_CFG_S_VER2 */ | 654 | union { |
430 | 655 | struct { | ||
431 | 656 | u8 channel_num; | ||
432 | 657 | u8 iter_count; | ||
433 | 658 | __le16 iter_interval; | ||
434 | 659 | } v1; /* SCAN_CHANNEL_CFG_S_VER1 */ | ||
435 | 660 | struct { | ||
436 | 661 | u8 channel_num; | ||
437 | 662 | u8 band; | ||
438 | 663 | u8 iter_count; | ||
439 | 664 | u8 iter_interval; | ||
440 | 665 | } v2; /* SCAN_CHANNEL_CFG_S_VER2 */ | ||
441 | 666 | }; | ||
442 | 667 | } __packed; | ||
443 | 639 | 668 | ||
444 | 640 | /** | 669 | /** |
445 | 641 | * struct iwl_scan_umac_schedule | 670 | * struct iwl_scan_umac_schedule |
446 | @@ -649,6 +678,16 @@ struct iwl_scan_umac_schedule { | |||
447 | 649 | u8 reserved; | 678 | u8 reserved; |
448 | 650 | } __packed; /* SCAN_SCHED_PARAM_API_S_VER_1 */ | 679 | } __packed; /* SCAN_SCHED_PARAM_API_S_VER_1 */ |
449 | 651 | 680 | ||
450 | 681 | struct iwl_scan_req_umac_tail_v1 { | ||
451 | 682 | /* SCAN_PERIODIC_PARAMS_API_S_VER_1 */ | ||
452 | 683 | struct iwl_scan_umac_schedule schedule[IWL_MAX_SCHED_SCAN_PLANS]; | ||
453 | 684 | __le16 delay; | ||
454 | 685 | __le16 reserved; | ||
455 | 686 | /* SCAN_PROBE_PARAMS_API_S_VER_1 */ | ||
456 | 687 | struct iwl_scan_probe_req_v1 preq; | ||
457 | 688 | struct iwl_ssid_ie direct_scan[PROBE_OPTION_MAX]; | ||
458 | 689 | } __packed; | ||
459 | 690 | |||
460 | 652 | /** | 691 | /** |
461 | 653 | * struct iwl_scan_req_umac_tail - the rest of the UMAC scan request command | 692 | * struct iwl_scan_req_umac_tail - the rest of the UMAC scan request command |
462 | 654 | * parameters following channels configuration array. | 693 | * parameters following channels configuration array. |
463 | @@ -658,12 +697,12 @@ struct iwl_scan_umac_schedule { | |||
464 | 658 | * @preq: probe request with IEs blocks | 697 | * @preq: probe request with IEs blocks |
465 | 659 | * @direct_scan: list of SSIDs for directed active scan | 698 | * @direct_scan: list of SSIDs for directed active scan |
466 | 660 | */ | 699 | */ |
468 | 661 | struct iwl_scan_req_umac_tail { | 700 | struct iwl_scan_req_umac_tail_v2 { |
469 | 662 | /* SCAN_PERIODIC_PARAMS_API_S_VER_1 */ | 701 | /* SCAN_PERIODIC_PARAMS_API_S_VER_1 */ |
470 | 663 | struct iwl_scan_umac_schedule schedule[IWL_MAX_SCHED_SCAN_PLANS]; | 702 | struct iwl_scan_umac_schedule schedule[IWL_MAX_SCHED_SCAN_PLANS]; |
471 | 664 | __le16 delay; | 703 | __le16 delay; |
472 | 665 | __le16 reserved; | 704 | __le16 reserved; |
474 | 666 | /* SCAN_PROBE_PARAMS_API_S_VER_1 */ | 705 | /* SCAN_PROBE_PARAMS_API_S_VER_2 */ |
475 | 667 | struct iwl_scan_probe_req preq; | 706 | struct iwl_scan_probe_req preq; |
476 | 668 | struct iwl_ssid_ie direct_scan[PROBE_OPTION_MAX]; | 707 | struct iwl_ssid_ie direct_scan[PROBE_OPTION_MAX]; |
477 | 669 | } __packed; | 708 | } __packed; |
478 | diff --git a/drivers/net/wireless/intel/iwlwifi/fw/file.h b/drivers/net/wireless/intel/iwlwifi/fw/file.h | |||
479 | index b3f8e7f..a2b9299 100644 | |||
480 | --- a/drivers/net/wireless/intel/iwlwifi/fw/file.h | |||
481 | +++ b/drivers/net/wireless/intel/iwlwifi/fw/file.h | |||
482 | @@ -248,9 +248,6 @@ enum iwl_ucode_tlv_flag { | |||
483 | 248 | IWL_UCODE_TLV_FLAGS_EBS_SUPPORT = BIT(25), | 248 | IWL_UCODE_TLV_FLAGS_EBS_SUPPORT = BIT(25), |
484 | 249 | IWL_UCODE_TLV_FLAGS_P2P_PS_UAPSD = BIT(26), | 249 | IWL_UCODE_TLV_FLAGS_P2P_PS_UAPSD = BIT(26), |
485 | 250 | IWL_UCODE_TLV_FLAGS_BCAST_FILTERING = BIT(29), | 250 | IWL_UCODE_TLV_FLAGS_BCAST_FILTERING = BIT(29), |
486 | 251 | #ifdef CPTCFG_IWLWIFI_LTE_COEX | ||
487 | 252 | IWL_UCODE_TLV_FLAGS_LTE_COEX = BIT(31), | ||
488 | 253 | #endif | ||
489 | 254 | }; | 251 | }; |
490 | 255 | 252 | ||
491 | 256 | typedef unsigned int __bitwise iwl_ucode_tlv_api_t; | 253 | typedef unsigned int __bitwise iwl_ucode_tlv_api_t; |
492 | @@ -335,6 +332,7 @@ enum iwl_ucode_tlv_api { | |||
493 | 335 | IWL_UCODE_TLV_API_SAR_TABLE_VER = (__force iwl_ucode_tlv_api_t)55, | 332 | IWL_UCODE_TLV_API_SAR_TABLE_VER = (__force iwl_ucode_tlv_api_t)55, |
494 | 336 | IWL_UCODE_TLV_API_REDUCED_SCAN_CONFIG = (__force iwl_ucode_tlv_api_t)56, | 333 | IWL_UCODE_TLV_API_REDUCED_SCAN_CONFIG = (__force iwl_ucode_tlv_api_t)56, |
495 | 337 | IWL_UCODE_TLV_API_ADWELL_HB_DEF_N_AP = (__force iwl_ucode_tlv_api_t)57, | 334 | IWL_UCODE_TLV_API_ADWELL_HB_DEF_N_AP = (__force iwl_ucode_tlv_api_t)57, |
496 | 335 | IWL_UCODE_TLV_API_SCAN_EXT_CHAN_VER = (__force iwl_ucode_tlv_api_t)58, | ||
497 | 338 | 336 | ||
498 | 339 | NUM_IWL_UCODE_TLV_API | 337 | NUM_IWL_UCODE_TLV_API |
499 | 340 | #ifdef __CHECKER__ | 338 | #ifdef __CHECKER__ |
500 | diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-dbg-cfg.h b/drivers/net/wireless/intel/iwlwifi/iwl-dbg-cfg.h | |||
501 | index 75ceca4..f470ca4 100644 | |||
502 | --- a/drivers/net/wireless/intel/iwlwifi/iwl-dbg-cfg.h | |||
503 | +++ b/drivers/net/wireless/intel/iwlwifi/iwl-dbg-cfg.h | |||
504 | @@ -204,9 +204,6 @@ struct iwl_dbg_cfg { | |||
505 | 204 | IWL_MVM_MOD_PARAM(bool, init_dbg) | 204 | IWL_MVM_MOD_PARAM(bool, init_dbg) |
506 | 205 | IWL_MVM_MOD_PARAM(bool, tfd_q_hang_detect) | 205 | IWL_MVM_MOD_PARAM(bool, tfd_q_hang_detect) |
507 | 206 | #endif /* CPTCFG_IWLMVM */ | 206 | #endif /* CPTCFG_IWLMVM */ |
508 | 207 | #ifdef CPTCFG_IWLWIFI_FRQ_MGR_TEST | ||
509 | 208 | IWL_DBG_CFG_NODEF(u8, fm_debug_mode) | ||
510 | 209 | #endif | ||
511 | 210 | #ifdef CPTCFG_IWLWIFI_DEVICE_TESTMODE | 207 | #ifdef CPTCFG_IWLWIFI_DEVICE_TESTMODE |
512 | 211 | IWL_DBG_CFG_NODEF(u32, dnt_out_mode) | 208 | IWL_DBG_CFG_NODEF(u32, dnt_out_mode) |
513 | 212 | /* XXX: should be dbgm_ or dbg_mon_ for consistency? */ | 209 | /* XXX: should be dbgm_ or dbg_mon_ for consistency? */ |
514 | @@ -262,18 +259,17 @@ struct iwl_dbg_cfg { | |||
515 | 262 | IWL_DBG_CFG_STR(fw_dbg_conf) | 259 | IWL_DBG_CFG_STR(fw_dbg_conf) |
516 | 263 | IWL_DBG_CFG_STR(nvm_file) | 260 | IWL_DBG_CFG_STR(nvm_file) |
517 | 264 | IWL_DBG_CFG_STR(fw_file_pre) | 261 | IWL_DBG_CFG_STR(fw_file_pre) |
518 | 265 | IWL_DBG_CFG_NODEF(u32, d0i3_debug) | ||
519 | 266 | IWL_DBG_CFG_NODEF(u32, valid_ants) | 262 | IWL_DBG_CFG_NODEF(u32, valid_ants) |
520 | 267 | IWL_DBG_CFG_NODEF(u32, no_ack_en) | 263 | IWL_DBG_CFG_NODEF(u32, no_ack_en) |
521 | 268 | IWL_DBG_CFG_NODEF(bool, no_ldpc) | 264 | IWL_DBG_CFG_NODEF(bool, no_ldpc) |
522 | 269 | IWL_DBG_CFG_NODEF(u16, rx_agg_subframes) | 265 | IWL_DBG_CFG_NODEF(u16, rx_agg_subframes) |
523 | 266 | IWL_DBG_CFG_NODEF(bool, tx_siso_80bw_like_160bw) | ||
524 | 270 | IWL_DBG_CFG_NODEF(u16, rx_mcs_80) | 267 | IWL_DBG_CFG_NODEF(u16, rx_mcs_80) |
525 | 271 | IWL_DBG_CFG_NODEF(u16, tx_mcs_80) | 268 | IWL_DBG_CFG_NODEF(u16, tx_mcs_80) |
526 | 272 | IWL_DBG_CFG_NODEF(u16, rx_mcs_160) | 269 | IWL_DBG_CFG_NODEF(u16, rx_mcs_160) |
527 | 273 | IWL_DBG_CFG_NODEF(u16, tx_mcs_160) | 270 | IWL_DBG_CFG_NODEF(u16, tx_mcs_160) |
528 | 274 | IWL_DBG_CFG_NODEF(u32, secure_boot_cfg) | 271 | IWL_DBG_CFG_NODEF(u32, secure_boot_cfg) |
529 | 275 | IWL_MOD_PARAM(u32, uapsd_disable) | 272 | IWL_MOD_PARAM(u32, uapsd_disable) |
530 | 276 | IWL_MOD_PARAM(bool, d0i3_disable) | ||
531 | 277 | IWL_MOD_PARAM(bool, lar_disable) | 273 | IWL_MOD_PARAM(bool, lar_disable) |
532 | 278 | IWL_MOD_PARAM(bool, fw_monitor) | 274 | IWL_MOD_PARAM(bool, fw_monitor) |
533 | 279 | IWL_MOD_PARAM(bool, fw_restart) | 275 | IWL_MOD_PARAM(bool, fw_restart) |
534 | @@ -285,7 +281,6 @@ struct iwl_dbg_cfg { | |||
535 | 285 | IWL_MOD_PARAM(int, amsdu_size) | 281 | IWL_MOD_PARAM(int, amsdu_size) |
536 | 286 | IWL_MOD_PARAM(int, swcrypto) | 282 | IWL_MOD_PARAM(int, swcrypto) |
537 | 287 | IWL_MOD_PARAM(uint, disable_11n) | 283 | IWL_MOD_PARAM(uint, disable_11n) |
538 | 288 | IWL_MOD_PARAM(uint, d0i3_timeout) | ||
539 | 289 | IWL_DBG_CFG_BIN(he_ppe_thres) | 284 | IWL_DBG_CFG_BIN(he_ppe_thres) |
540 | 290 | IWL_DBG_CFG_NODEF(u8, he_chan_width_dis) | 285 | IWL_DBG_CFG_NODEF(u8, he_chan_width_dis) |
541 | 291 | IWL_DBG_CFG_NODEF(u32, vht_cap_flip) | 286 | IWL_DBG_CFG_NODEF(u32, vht_cap_flip) |
542 | diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-drv.c b/drivers/net/wireless/intel/iwlwifi/iwl-drv.c | |||
543 | index 2308b4f..c4bfbb8 100644 | |||
544 | --- a/drivers/net/wireless/intel/iwlwifi/iwl-drv.c | |||
545 | +++ b/drivers/net/wireless/intel/iwlwifi/iwl-drv.c | |||
546 | @@ -2048,8 +2048,6 @@ struct iwl_mod_params iwlwifi_mod_params = { | |||
547 | 2048 | .fw_restart = true, | 2048 | .fw_restart = true, |
548 | 2049 | .bt_coex_active = true, | 2049 | .bt_coex_active = true, |
549 | 2050 | .power_level = IWL_POWER_INDEX_1, | 2050 | .power_level = IWL_POWER_INDEX_1, |
550 | 2051 | .d0i3_disable = true, | ||
551 | 2052 | .d0i3_timeout = 1000, | ||
552 | 2053 | .uapsd_disable = IWL_DISABLE_UAPSD_BSS | IWL_DISABLE_UAPSD_P2P_CLIENT, | 2051 | .uapsd_disable = IWL_DISABLE_UAPSD_BSS | IWL_DISABLE_UAPSD_P2P_CLIENT, |
553 | 2054 | /* the rest are 0 by default */ | 2052 | /* the rest are 0 by default */ |
554 | 2055 | }; | 2053 | }; |
555 | @@ -2202,9 +2200,6 @@ MODULE_PARM_DESC(antenna_coupling, | |||
556 | 2202 | module_param_named(nvm_file, iwlwifi_mod_params.nvm_file, charp, 0444); | 2200 | module_param_named(nvm_file, iwlwifi_mod_params.nvm_file, charp, 0444); |
557 | 2203 | MODULE_PARM_DESC(nvm_file, "NVM file name"); | 2201 | MODULE_PARM_DESC(nvm_file, "NVM file name"); |
558 | 2204 | 2202 | ||
559 | 2205 | module_param_named(d0i3_disable, iwlwifi_mod_params.d0i3_disable, bool, 0444); | ||
560 | 2206 | MODULE_PARM_DESC(d0i3_disable, "disable d0i3 functionality (default: N)"); | ||
561 | 2207 | |||
562 | 2208 | module_param_named(lar_disable, iwlwifi_mod_params.lar_disable, bool, 0444); | 2203 | module_param_named(lar_disable, iwlwifi_mod_params.lar_disable, bool, 0444); |
563 | 2209 | MODULE_PARM_DESC(lar_disable, "disable LAR functionality (default: N)"); | 2204 | MODULE_PARM_DESC(lar_disable, "disable LAR functionality (default: N)"); |
564 | 2210 | 2205 | ||
565 | @@ -2252,9 +2247,6 @@ module_param_named(fw_monitor, iwlwifi_mod_params.fw_monitor, bool, 0444); | |||
566 | 2252 | MODULE_PARM_DESC(fw_monitor, | 2247 | MODULE_PARM_DESC(fw_monitor, |
567 | 2253 | "firmware monitor - to debug FW (default: false - needs lots of memory)"); | 2248 | "firmware monitor - to debug FW (default: false - needs lots of memory)"); |
568 | 2254 | 2249 | ||
569 | 2255 | module_param_named(d0i3_timeout, iwlwifi_mod_params.d0i3_timeout, uint, 0444); | ||
570 | 2256 | MODULE_PARM_DESC(d0i3_timeout, "Timeout to D0i3 entry when idle (ms)"); | ||
571 | 2257 | |||
572 | 2258 | module_param_named(disable_11ac, iwlwifi_mod_params.disable_11ac, bool, 0444); | 2250 | module_param_named(disable_11ac, iwlwifi_mod_params.disable_11ac, bool, 0444); |
573 | 2259 | MODULE_PARM_DESC(disable_11ac, "Disable VHT capabilities (default: false)"); | 2251 | MODULE_PARM_DESC(disable_11ac, "Disable VHT capabilities (default: false)"); |
574 | 2260 | 2252 | ||
575 | diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-modparams.h b/drivers/net/wireless/intel/iwlwifi/iwl-modparams.h | |||
576 | index d8d1202..27d2cb3 100644 | |||
577 | --- a/drivers/net/wireless/intel/iwlwifi/iwl-modparams.h | |||
578 | +++ b/drivers/net/wireless/intel/iwlwifi/iwl-modparams.h | |||
579 | @@ -6,7 +6,7 @@ | |||
580 | 6 | * GPL LICENSE SUMMARY | 6 | * GPL LICENSE SUMMARY |
581 | 7 | * | 7 | * |
582 | 8 | * Copyright(c) 2007 - 2014 Intel Corporation. All rights reserved. | 8 | * Copyright(c) 2007 - 2014 Intel Corporation. All rights reserved. |
584 | 9 | * Copyright(c) 2018 Intel Corporation | 9 | * Copyright(c) 2018 - 2019 Intel Corporation |
585 | 10 | * | 10 | * |
586 | 11 | * This program is free software; you can redistribute it and/or modify | 11 | * This program is free software; you can redistribute it and/or modify |
587 | 12 | * it under the terms of version 2 of the GNU General Public License as | 12 | * it under the terms of version 2 of the GNU General Public License as |
588 | @@ -27,7 +27,7 @@ | |||
589 | 27 | * BSD LICENSE | 27 | * BSD LICENSE |
590 | 28 | * | 28 | * |
591 | 29 | * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved. | 29 | * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved. |
593 | 30 | * Copyright(c) 2018 Intel Corporation | 30 | * Copyright(c) 2018 - 2019 Intel Corporation |
594 | 31 | * All rights reserved. | 31 | * All rights reserved. |
595 | 32 | * | 32 | * |
596 | 33 | * Redistribution and use in source and binary forms, with or without | 33 | * Redistribution and use in source and binary forms, with or without |
597 | @@ -116,9 +116,6 @@ enum iwl_uapsd_disable { | |||
598 | 116 | * @uapsd_disable: disable U-APSD, see &enum iwl_uapsd_disable, default = | 116 | * @uapsd_disable: disable U-APSD, see &enum iwl_uapsd_disable, default = |
599 | 117 | * IWL_DISABLE_UAPSD_BSS | IWL_DISABLE_UAPSD_P2P_CLIENT | 117 | * IWL_DISABLE_UAPSD_BSS | IWL_DISABLE_UAPSD_P2P_CLIENT |
600 | 118 | * @xvt_default_mode: xVT is the default operation mode, default = false | 118 | * @xvt_default_mode: xVT is the default operation mode, default = false |
601 | 119 | * @d0i3_disable: disable d0i3, default = 1, | ||
602 | 120 | * @d0i3_timeout: time to wait after no refs are taken before | ||
603 | 121 | * entering D0i3 (in msecs) | ||
604 | 122 | * @lar_disable: disable LAR (regulatory), default = 0 | 119 | * @lar_disable: disable LAR (regulatory), default = 0 |
605 | 123 | * @fw_monitor: allow to use firmware monitor | 120 | * @fw_monitor: allow to use firmware monitor |
606 | 124 | * @disable_11ac: disable VHT capabilities, default = false. | 121 | * @disable_11ac: disable VHT capabilities, default = false. |
607 | @@ -144,8 +141,6 @@ struct iwl_mod_params { | |||
608 | 144 | #endif | 141 | #endif |
609 | 145 | char *nvm_file; | 142 | char *nvm_file; |
610 | 146 | u32 uapsd_disable; | 143 | u32 uapsd_disable; |
611 | 147 | bool d0i3_disable; | ||
612 | 148 | unsigned int d0i3_timeout; | ||
613 | 149 | bool lar_disable; | 144 | bool lar_disable; |
614 | 150 | bool fw_monitor; | 145 | bool fw_monitor; |
615 | 151 | bool disable_11ac; | 146 | bool disable_11ac; |
616 | diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-op-mode.h b/drivers/net/wireless/intel/iwlwifi/iwl-op-mode.h | |||
617 | index 2f4ecde..fcb0b69 100644 | |||
618 | --- a/drivers/net/wireless/intel/iwlwifi/iwl-op-mode.h | |||
619 | +++ b/drivers/net/wireless/intel/iwlwifi/iwl-op-mode.h | |||
620 | @@ -166,9 +166,6 @@ struct iwl_test_ops { | |||
621 | 166 | * @nic_config: configure NIC, called before firmware is started. | 166 | * @nic_config: configure NIC, called before firmware is started. |
622 | 167 | * May sleep | 167 | * May sleep |
623 | 168 | * @wimax_active: invoked when WiMax becomes active. May sleep | 168 | * @wimax_active: invoked when WiMax becomes active. May sleep |
624 | 169 | * @enter_d0i3: configure the fw to enter d0i3. return 1 to indicate d0i3 | ||
625 | 170 | * entrance is aborted (e.g. due to held reference). May sleep. | ||
626 | 171 | * @exit_d0i3: configure the fw to exit d0i3. May sleep. | ||
627 | 172 | */ | 169 | */ |
628 | 173 | struct iwl_op_mode_ops { | 170 | struct iwl_op_mode_ops { |
629 | 174 | struct iwl_op_mode *(*start)(struct iwl_trans *trans, | 171 | struct iwl_op_mode *(*start)(struct iwl_trans *trans, |
630 | @@ -193,8 +190,6 @@ struct iwl_op_mode_ops { | |||
631 | 193 | #ifdef CPTCFG_IWLWIFI_DEVICE_TESTMODE | 190 | #ifdef CPTCFG_IWLWIFI_DEVICE_TESTMODE |
632 | 194 | struct iwl_test_ops test_ops; | 191 | struct iwl_test_ops test_ops; |
633 | 195 | #endif | 192 | #endif |
634 | 196 | int (*enter_d0i3)(struct iwl_op_mode *op_mode); | ||
635 | 197 | int (*exit_d0i3)(struct iwl_op_mode *op_mode); | ||
636 | 198 | }; | 193 | }; |
637 | 199 | 194 | ||
638 | 200 | int iwl_opmode_register(const char *name, const struct iwl_op_mode_ops *ops); | 195 | int iwl_opmode_register(const char *name, const struct iwl_op_mode_ops *ops); |
639 | @@ -287,22 +282,4 @@ static inline void iwl_op_mode_wimax_active(struct iwl_op_mode *op_mode) | |||
640 | 287 | op_mode->ops->wimax_active(op_mode); | 282 | op_mode->ops->wimax_active(op_mode); |
641 | 288 | } | 283 | } |
642 | 289 | 284 | ||
643 | 290 | static inline int iwl_op_mode_enter_d0i3(struct iwl_op_mode *op_mode) | ||
644 | 291 | { | ||
645 | 292 | might_sleep(); | ||
646 | 293 | |||
647 | 294 | if (!op_mode->ops->enter_d0i3) | ||
648 | 295 | return 0; | ||
649 | 296 | return op_mode->ops->enter_d0i3(op_mode); | ||
650 | 297 | } | ||
651 | 298 | |||
652 | 299 | static inline int iwl_op_mode_exit_d0i3(struct iwl_op_mode *op_mode) | ||
653 | 300 | { | ||
654 | 301 | might_sleep(); | ||
655 | 302 | |||
656 | 303 | if (!op_mode->ops->exit_d0i3) | ||
657 | 304 | return 0; | ||
658 | 305 | return op_mode->ops->exit_d0i3(op_mode); | ||
659 | 306 | } | ||
660 | 307 | |||
661 | 308 | #endif /* __iwl_op_mode_h__ */ | 285 | #endif /* __iwl_op_mode_h__ */ |
662 | diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-trans.c b/drivers/net/wireless/intel/iwlwifi/iwl-trans.c | |||
663 | index 2c93164..7223469 100644 | |||
664 | --- a/drivers/net/wireless/intel/iwlwifi/iwl-trans.c | |||
665 | +++ b/drivers/net/wireless/intel/iwlwifi/iwl-trans.c | |||
666 | @@ -205,17 +205,3 @@ int iwl_cmd_groups_verify_sorted(const struct iwl_trans_config *trans) | |||
667 | 205 | return 0; | 205 | return 0; |
668 | 206 | } | 206 | } |
669 | 207 | IWL_EXPORT_SYMBOL(iwl_cmd_groups_verify_sorted); | 207 | IWL_EXPORT_SYMBOL(iwl_cmd_groups_verify_sorted); |
670 | 208 | |||
671 | 209 | void iwl_trans_ref(struct iwl_trans *trans) | ||
672 | 210 | { | ||
673 | 211 | if (trans->ops->ref) | ||
674 | 212 | trans->ops->ref(trans); | ||
675 | 213 | } | ||
676 | 214 | IWL_EXPORT_SYMBOL(iwl_trans_ref); | ||
677 | 215 | |||
678 | 216 | void iwl_trans_unref(struct iwl_trans *trans) | ||
679 | 217 | { | ||
680 | 218 | if (trans->ops->unref) | ||
681 | 219 | trans->ops->unref(trans); | ||
682 | 220 | } | ||
683 | 221 | IWL_EXPORT_SYMBOL(iwl_trans_unref); | ||
684 | diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-trans.h b/drivers/net/wireless/intel/iwlwifi/iwl-trans.h | |||
685 | index 43cfa59..6d156ee 100644 | |||
686 | --- a/drivers/net/wireless/intel/iwlwifi/iwl-trans.h | |||
687 | +++ b/drivers/net/wireless/intel/iwlwifi/iwl-trans.h | |||
688 | @@ -165,10 +165,6 @@ static inline u32 iwl_rx_packet_payload_len(const struct iwl_rx_packet *pkt) | |||
689 | 165 | * @CMD_ASYNC: Return right away and don't wait for the response | 165 | * @CMD_ASYNC: Return right away and don't wait for the response |
690 | 166 | * @CMD_WANT_SKB: Not valid with CMD_ASYNC. The caller needs the buffer of | 166 | * @CMD_WANT_SKB: Not valid with CMD_ASYNC. The caller needs the buffer of |
691 | 167 | * the response. The caller needs to call iwl_free_resp when done. | 167 | * the response. The caller needs to call iwl_free_resp when done. |
692 | 168 | * @CMD_SEND_IN_IDLE: The command should be sent even when the trans is idle. | ||
693 | 169 | * @CMD_MAKE_TRANS_IDLE: The command response should mark the trans as idle. | ||
694 | 170 | * @CMD_WAKE_UP_TRANS: The command response should wake up the trans | ||
695 | 171 | * (i.e. mark it as non-idle). | ||
696 | 172 | * @CMD_WANT_ASYNC_CALLBACK: the op_mode's async callback function must be | 168 | * @CMD_WANT_ASYNC_CALLBACK: the op_mode's async callback function must be |
697 | 173 | * called after this command completes. Valid only with CMD_ASYNC. | 169 | * called after this command completes. Valid only with CMD_ASYNC. |
698 | 174 | */ | 170 | */ |
699 | @@ -176,10 +172,7 @@ enum CMD_MODE { | |||
700 | 176 | CMD_ASYNC = BIT(0), | 172 | CMD_ASYNC = BIT(0), |
701 | 177 | CMD_WANT_SKB = BIT(1), | 173 | CMD_WANT_SKB = BIT(1), |
702 | 178 | CMD_SEND_IN_RFKILL = BIT(2), | 174 | CMD_SEND_IN_RFKILL = BIT(2), |
707 | 179 | CMD_SEND_IN_IDLE = BIT(3), | 175 | CMD_WANT_ASYNC_CALLBACK = BIT(3), |
704 | 180 | CMD_MAKE_TRANS_IDLE = BIT(4), | ||
705 | 181 | CMD_WAKE_UP_TRANS = BIT(5), | ||
706 | 182 | CMD_WANT_ASYNC_CALLBACK = BIT(6), | ||
708 | 183 | }; | 176 | }; |
709 | 184 | 177 | ||
710 | 185 | #define DEF_CMD_PAYLOAD_SIZE 320 | 178 | #define DEF_CMD_PAYLOAD_SIZE 320 |
711 | @@ -467,9 +460,8 @@ struct iwl_trans_rxq_dma_data { | |||
712 | 467 | * | 460 | * |
713 | 468 | * All the handlers MUST be implemented | 461 | * All the handlers MUST be implemented |
714 | 469 | * | 462 | * |
718 | 470 | * @start_hw: starts the HW. If low_power is true, the NIC needs to be taken | 463 | * @start_hw: starts the HW. From that point on, the HW can send interrupts. |
719 | 471 | * out of a low power state. From that point on, the HW can send | 464 | * May sleep. |
717 | 472 | * interrupts. May sleep. | ||
720 | 473 | * @op_mode_leave: Turn off the HW RF kill indication if on | 465 | * @op_mode_leave: Turn off the HW RF kill indication if on |
721 | 474 | * May sleep | 466 | * May sleep |
722 | 475 | * @start_fw: allocates and inits all the resources for the transport | 467 | * @start_fw: allocates and inits all the resources for the transport |
723 | @@ -479,9 +471,8 @@ struct iwl_trans_rxq_dma_data { | |||
724 | 479 | * the SCD base address in SRAM, then provide it here, or 0 otherwise. | 471 | * the SCD base address in SRAM, then provide it here, or 0 otherwise. |
725 | 480 | * May sleep | 472 | * May sleep |
726 | 481 | * @stop_device: stops the whole device (embedded CPU put to reset) and stops | 473 | * @stop_device: stops the whole device (embedded CPU put to reset) and stops |
730 | 482 | * the HW. If low_power is true, the NIC will be put in low power state. | 474 | * the HW. From that point on, the HW will be stopped but will still issue |
731 | 483 | * From that point on, the HW will be stopped but will still issue an | 475 | * an interrupt if the HW RF kill switch is triggered. |
729 | 484 | * interrupt if the HW RF kill switch is triggered. | ||
732 | 485 | * This callback must do the right thing and not crash even if %start_hw() | 476 | * This callback must do the right thing and not crash even if %start_hw() |
733 | 486 | * was called but not &start_fw(). May sleep. | 477 | * was called but not &start_fw(). May sleep. |
734 | 487 | * @d3_suspend: put the device into the correct mode for WoWLAN during | 478 | * @d3_suspend: put the device into the correct mode for WoWLAN during |
735 | @@ -539,11 +530,6 @@ struct iwl_trans_rxq_dma_data { | |||
736 | 539 | * @release_nic_access: let the NIC go to sleep. The "flags" parameter | 530 | * @release_nic_access: let the NIC go to sleep. The "flags" parameter |
737 | 540 | * must be the same one that was sent before to the grab_nic_access. | 531 | * must be the same one that was sent before to the grab_nic_access. |
738 | 541 | * @set_bits_mask - set SRAM register according to value and mask. | 532 | * @set_bits_mask - set SRAM register according to value and mask. |
739 | 542 | * @ref: grab a reference to the transport/FW layers, disallowing | ||
740 | 543 | * certain low power states | ||
741 | 544 | * @unref: release a reference previously taken with @ref. Note that | ||
742 | 545 | * initially the reference count is 1, making an initial @unref | ||
743 | 546 | * necessary to allow low power states. | ||
744 | 547 | * @dump_data: return a vmalloc'ed buffer with debug data, maybe containing last | 533 | * @dump_data: return a vmalloc'ed buffer with debug data, maybe containing last |
745 | 548 | * TX'ed commands and similar. The buffer will be vfree'd by the caller. | 534 | * TX'ed commands and similar. The buffer will be vfree'd by the caller. |
746 | 549 | * Note that the transport must fill in the proper file headers. | 535 | * Note that the transport must fill in the proper file headers. |
747 | @@ -552,7 +538,7 @@ struct iwl_trans_rxq_dma_data { | |||
748 | 552 | */ | 538 | */ |
749 | 553 | struct iwl_trans_ops { | 539 | struct iwl_trans_ops { |
750 | 554 | 540 | ||
752 | 555 | int (*start_hw)(struct iwl_trans *iwl_trans, bool low_power); | 541 | int (*start_hw)(struct iwl_trans *iwl_trans); |
753 | 556 | void (*op_mode_leave)(struct iwl_trans *iwl_trans); | 542 | void (*op_mode_leave)(struct iwl_trans *iwl_trans); |
754 | 557 | #if IS_ENABLED(CPTCFG_IWLXVT) | 543 | #if IS_ENABLED(CPTCFG_IWLXVT) |
755 | 558 | int (*start_fw_dbg)(struct iwl_trans *trans, const struct fw_img *fw, | 544 | int (*start_fw_dbg)(struct iwl_trans *trans, const struct fw_img *fw, |
756 | @@ -562,7 +548,7 @@ struct iwl_trans_ops { | |||
757 | 562 | int (*start_fw)(struct iwl_trans *trans, const struct fw_img *fw, | 548 | int (*start_fw)(struct iwl_trans *trans, const struct fw_img *fw, |
758 | 563 | bool run_in_rfkill); | 549 | bool run_in_rfkill); |
759 | 564 | void (*fw_alive)(struct iwl_trans *trans, u32 scd_addr); | 550 | void (*fw_alive)(struct iwl_trans *trans, u32 scd_addr); |
761 | 565 | void (*stop_device)(struct iwl_trans *trans, bool low_power); | 551 | void (*stop_device)(struct iwl_trans *trans); |
762 | 566 | 552 | ||
763 | 567 | void (*d3_suspend)(struct iwl_trans *trans, bool test, bool reset); | 553 | void (*d3_suspend)(struct iwl_trans *trans, bool test, bool reset); |
764 | 568 | int (*d3_resume)(struct iwl_trans *trans, enum iwl_d3_status *status, | 554 | int (*d3_resume)(struct iwl_trans *trans, enum iwl_d3_status *status, |
765 | @@ -575,6 +561,8 @@ struct iwl_trans_ops { | |||
766 | 575 | void (*reclaim)(struct iwl_trans *trans, int queue, int ssn, | 561 | void (*reclaim)(struct iwl_trans *trans, int queue, int ssn, |
767 | 576 | struct sk_buff_head *skbs); | 562 | struct sk_buff_head *skbs); |
768 | 577 | 563 | ||
769 | 564 | void (*set_q_ptrs)(struct iwl_trans *trans, int queue, int ptr); | ||
770 | 565 | |||
771 | 578 | bool (*txq_enable)(struct iwl_trans *trans, int queue, u16 ssn, | 566 | bool (*txq_enable)(struct iwl_trans *trans, int queue, u16 ssn, |
772 | 579 | const struct iwl_trans_txq_scd_cfg *cfg, | 567 | const struct iwl_trans_txq_scd_cfg *cfg, |
773 | 580 | unsigned int queue_wdg_timeout); | 568 | unsigned int queue_wdg_timeout); |
774 | @@ -616,8 +604,6 @@ struct iwl_trans_ops { | |||
775 | 616 | unsigned long *flags); | 604 | unsigned long *flags); |
776 | 617 | void (*set_bits_mask)(struct iwl_trans *trans, u32 reg, u32 mask, | 605 | void (*set_bits_mask)(struct iwl_trans *trans, u32 reg, u32 mask, |
777 | 618 | u32 value); | 606 | u32 value); |
778 | 619 | void (*ref)(struct iwl_trans *trans); | ||
779 | 620 | void (*unref)(struct iwl_trans *trans); | ||
780 | 621 | int (*suspend)(struct iwl_trans *trans); | 607 | int (*suspend)(struct iwl_trans *trans); |
781 | 622 | void (*resume)(struct iwl_trans *trans); | 608 | void (*resume)(struct iwl_trans *trans); |
782 | 623 | 609 | ||
783 | @@ -641,9 +627,6 @@ enum iwl_trans_state { | |||
784 | 641 | /** | 627 | /** |
785 | 642 | * DOC: Platform power management | 628 | * DOC: Platform power management |
786 | 643 | * | 629 | * |
787 | 644 | * There are two types of platform power management: system-wide | ||
788 | 645 | * (WoWLAN) and runtime. | ||
789 | 646 | * | ||
790 | 647 | * In system-wide power management the entire platform goes into a low | 630 | * In system-wide power management the entire platform goes into a low |
791 | 648 | * power state (e.g. idle or suspend to RAM) at the same time and the | 631 | * power state (e.g. idle or suspend to RAM) at the same time and the |
792 | 649 | * device is configured as a wakeup source for the entire platform. | 632 | * device is configured as a wakeup source for the entire platform. |
793 | @@ -652,55 +635,34 @@ enum iwl_trans_state { | |||
794 | 652 | * put the platform in low power mode). The device's behavior in this | 635 | * put the platform in low power mode). The device's behavior in this |
795 | 653 | * mode is dictated by the wake-on-WLAN configuration. | 636 | * mode is dictated by the wake-on-WLAN configuration. |
796 | 654 | * | 637 | * |
797 | 655 | * In runtime power management, only the devices which are themselves | ||
798 | 656 | * idle enter a low power state. This is done at runtime, which means | ||
799 | 657 | * that the entire system is still running normally. This mode is | ||
800 | 658 | * usually triggered automatically by the device driver and requires | ||
801 | 659 | * the ability to enter and exit the low power modes in a very short | ||
802 | 660 | * time, so there is not much impact in usability. | ||
803 | 661 | * | ||
804 | 662 | * The terms used for the device's behavior are as follows: | 638 | * The terms used for the device's behavior are as follows: |
805 | 663 | * | 639 | * |
806 | 664 | * - D0: the device is fully powered and the host is awake; | 640 | * - D0: the device is fully powered and the host is awake; |
807 | 665 | * - D3: the device is in low power mode and only reacts to | 641 | * - D3: the device is in low power mode and only reacts to |
808 | 666 | * specific events (e.g. magic-packet received or scan | 642 | * specific events (e.g. magic-packet received or scan |
809 | 667 | * results found); | 643 | * results found); |
810 | 668 | * - D0I3: the device is in low power mode and reacts to any | ||
811 | 669 | * activity (e.g. RX); | ||
812 | 670 | * | 644 | * |
813 | 671 | * These terms reflect the power modes in the firmware and are not to | 645 | * These terms reflect the power modes in the firmware and are not to |
816 | 672 | * be confused with the physical device power state. The NIC can be | 646 | * be confused with the physical device power state. |
815 | 673 | * in D0I3 mode even if, for instance, the PCI device is in D3 state. | ||
817 | 674 | */ | 647 | */ |
818 | 675 | 648 | ||
819 | 676 | /** | 649 | /** |
820 | 677 | * enum iwl_plat_pm_mode - platform power management mode | 650 | * enum iwl_plat_pm_mode - platform power management mode |
821 | 678 | * | 651 | * |
822 | 679 | * This enumeration describes the device's platform power management | 652 | * This enumeration describes the device's platform power management |
825 | 680 | * behavior when in idle mode (i.e. runtime power management) or when | 653 | * behavior when in system-wide suspend (i.e WoWLAN). |
824 | 681 | * in system-wide suspend (i.e WoWLAN). | ||
826 | 682 | * | 654 | * |
827 | 683 | * @IWL_PLAT_PM_MODE_DISABLED: power management is disabled for this | 655 | * @IWL_PLAT_PM_MODE_DISABLED: power management is disabled for this |
832 | 684 | * device. At runtime, this means that nothing happens and the | 656 | * device. In system-wide suspend mode, it means that the all |
833 | 685 | * device always remains in active. In system-wide suspend mode, | 657 | * connections will be closed automatically by mac80211 before |
834 | 686 | * it means that the all connections will be closed automatically | 658 | * the platform is suspended. |
831 | 687 | * by mac80211 before the platform is suspended. | ||
835 | 688 | * @IWL_PLAT_PM_MODE_D3: the device goes into D3 mode (i.e. WoWLAN). | 659 | * @IWL_PLAT_PM_MODE_D3: the device goes into D3 mode (i.e. WoWLAN). |
836 | 689 | * For runtime power management, this mode is not officially | ||
837 | 690 | * supported. | ||
838 | 691 | * @IWL_PLAT_PM_MODE_D0I3: the device goes into D0I3 mode. | ||
839 | 692 | */ | 660 | */ |
840 | 693 | enum iwl_plat_pm_mode { | 661 | enum iwl_plat_pm_mode { |
841 | 694 | IWL_PLAT_PM_MODE_DISABLED, | 662 | IWL_PLAT_PM_MODE_DISABLED, |
842 | 695 | IWL_PLAT_PM_MODE_D3, | 663 | IWL_PLAT_PM_MODE_D3, |
843 | 696 | IWL_PLAT_PM_MODE_D0I3, | ||
844 | 697 | }; | 664 | }; |
845 | 698 | 665 | ||
846 | 699 | /* Max time to wait for trans to become idle/non-idle on d0i3 | ||
847 | 700 | * enter/exit (in msecs). | ||
848 | 701 | */ | ||
849 | 702 | #define IWL_TRANS_IDLE_TIMEOUT (CPTCFG_IWL_TIMEOUT_FACTOR * 2000) | ||
850 | 703 | |||
851 | 704 | /* Max time to wait for nmi interrupt */ | 666 | /* Max time to wait for nmi interrupt */ |
852 | 705 | #define IWL_TRANS_NMI_TIMEOUT (HZ / 4 * CPTCFG_IWL_TIMEOUT_FACTOR) | 667 | #define IWL_TRANS_NMI_TIMEOUT (HZ / 4 * CPTCFG_IWL_TIMEOUT_FACTOR) |
853 | 706 | 668 | ||
854 | @@ -806,9 +768,6 @@ struct iwl_trans_debug { | |||
855 | 806 | * @system_pm_mode: the system-wide power management mode in use. | 768 | * @system_pm_mode: the system-wide power management mode in use. |
856 | 807 | * This mode is set dynamically, depending on the WoWLAN values | 769 | * This mode is set dynamically, depending on the WoWLAN values |
857 | 808 | * configured from the userspace at runtime. | 770 | * configured from the userspace at runtime. |
858 | 809 | * @runtime_pm_mode: the runtime power management mode in use. This | ||
859 | 810 | * mode is set during the initialization phase and is not | ||
860 | 811 | * supposed to change during runtime. | ||
861 | 812 | */ | 771 | */ |
862 | 813 | struct iwl_trans { | 772 | struct iwl_trans { |
863 | 814 | const struct iwl_trans_ops *ops; | 773 | const struct iwl_trans_ops *ops; |
864 | @@ -857,7 +816,6 @@ struct iwl_trans { | |||
865 | 857 | struct iwl_self_init_dram init_dram; | 816 | struct iwl_self_init_dram init_dram; |
866 | 858 | 817 | ||
867 | 859 | enum iwl_plat_pm_mode system_pm_mode; | 818 | enum iwl_plat_pm_mode system_pm_mode; |
868 | 860 | enum iwl_plat_pm_mode runtime_pm_mode; | ||
869 | 861 | 819 | ||
870 | 862 | #ifdef CPTCFG_IWLWIFI_DEVICE_TESTMODE | 820 | #ifdef CPTCFG_IWLWIFI_DEVICE_TESTMODE |
871 | 863 | struct iwl_testmode testmode; | 821 | struct iwl_testmode testmode; |
872 | @@ -880,16 +838,11 @@ static inline void iwl_trans_configure(struct iwl_trans *trans, | |||
873 | 880 | WARN_ON(iwl_cmd_groups_verify_sorted(trans_cfg)); | 838 | WARN_ON(iwl_cmd_groups_verify_sorted(trans_cfg)); |
874 | 881 | } | 839 | } |
875 | 882 | 840 | ||
877 | 883 | static inline int _iwl_trans_start_hw(struct iwl_trans *trans, bool low_power) | 841 | static inline int iwl_trans_start_hw(struct iwl_trans *trans) |
878 | 884 | { | 842 | { |
879 | 885 | might_sleep(); | 843 | might_sleep(); |
880 | 886 | 844 | ||
887 | 887 | return trans->ops->start_hw(trans, low_power); | 845 | return trans->ops->start_hw(trans); |
882 | 888 | } | ||
883 | 889 | |||
884 | 890 | static inline int iwl_trans_start_hw(struct iwl_trans *trans) | ||
885 | 891 | { | ||
886 | 892 | return trans->ops->start_hw(trans, true); | ||
888 | 893 | } | 846 | } |
889 | 894 | 847 | ||
890 | 895 | static inline void iwl_trans_op_mode_leave(struct iwl_trans *trans) | 848 | static inline void iwl_trans_op_mode_leave(struct iwl_trans *trans) |
891 | @@ -950,21 +903,15 @@ static inline int iwl_trans_start_fw_dbg(struct iwl_trans *trans, | |||
892 | 950 | } | 903 | } |
893 | 951 | #endif | 904 | #endif |
894 | 952 | 905 | ||
897 | 953 | static inline void _iwl_trans_stop_device(struct iwl_trans *trans, | 906 | static inline void iwl_trans_stop_device(struct iwl_trans *trans) |
896 | 954 | bool low_power) | ||
898 | 955 | { | 907 | { |
899 | 956 | might_sleep(); | 908 | might_sleep(); |
900 | 957 | 909 | ||
902 | 958 | trans->ops->stop_device(trans, low_power); | 910 | trans->ops->stop_device(trans); |
903 | 959 | 911 | ||
904 | 960 | trans->state = IWL_TRANS_NO_FW; | 912 | trans->state = IWL_TRANS_NO_FW; |
905 | 961 | } | 913 | } |
906 | 962 | 914 | ||
907 | 963 | static inline void iwl_trans_stop_device(struct iwl_trans *trans) | ||
908 | 964 | { | ||
909 | 965 | _iwl_trans_stop_device(trans, true); | ||
910 | 966 | } | ||
911 | 967 | |||
912 | 968 | static inline void iwl_trans_d3_suspend(struct iwl_trans *trans, bool test, | 915 | static inline void iwl_trans_d3_suspend(struct iwl_trans *trans, bool test, |
913 | 969 | bool reset) | 916 | bool reset) |
914 | 970 | { | 917 | { |
915 | @@ -1045,6 +992,17 @@ static inline void iwl_trans_reclaim(struct iwl_trans *trans, int queue, | |||
916 | 1045 | trans->ops->reclaim(trans, queue, ssn, skbs); | 992 | trans->ops->reclaim(trans, queue, ssn, skbs); |
917 | 1046 | } | 993 | } |
918 | 1047 | 994 | ||
919 | 995 | static inline void iwl_trans_set_q_ptrs(struct iwl_trans *trans, int queue, | ||
920 | 996 | int ptr) | ||
921 | 997 | { | ||
922 | 998 | if (WARN_ON_ONCE(trans->state != IWL_TRANS_FW_ALIVE)) { | ||
923 | 999 | IWL_ERR(trans, "%s bad state = %d\n", __func__, trans->state); | ||
924 | 1000 | return; | ||
925 | 1001 | } | ||
926 | 1002 | |||
927 | 1003 | trans->ops->set_q_ptrs(trans, queue, ptr); | ||
928 | 1004 | } | ||
929 | 1005 | |||
930 | 1048 | static inline void iwl_trans_txq_disable(struct iwl_trans *trans, int queue, | 1006 | static inline void iwl_trans_txq_disable(struct iwl_trans *trans, int queue, |
931 | 1049 | bool configure_scd) | 1007 | bool configure_scd) |
932 | 1050 | { | 1008 | { |
933 | @@ -1324,8 +1282,6 @@ struct iwl_trans *iwl_trans_alloc(unsigned int priv_size, | |||
934 | 1324 | const struct iwl_cfg *cfg, | 1282 | const struct iwl_cfg *cfg, |
935 | 1325 | const struct iwl_trans_ops *ops); | 1283 | const struct iwl_trans_ops *ops); |
936 | 1326 | void iwl_trans_free(struct iwl_trans *trans); | 1284 | void iwl_trans_free(struct iwl_trans *trans); |
937 | 1327 | void iwl_trans_ref(struct iwl_trans *trans); | ||
938 | 1328 | void iwl_trans_unref(struct iwl_trans *trans); | ||
939 | 1329 | 1285 | ||
940 | 1330 | /***************************************************** | 1286 | /***************************************************** |
941 | 1331 | * driver (transport) register/unregister functions | 1287 | * driver (transport) register/unregister functions |
942 | diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/Makefile b/drivers/net/wireless/intel/iwlwifi/mvm/Makefile | |||
943 | index 8e43da7..256e08b 100644 | |||
944 | --- a/drivers/net/wireless/intel/iwlwifi/mvm/Makefile | |||
945 | +++ b/drivers/net/wireless/intel/iwlwifi/mvm/Makefile | |||
946 | @@ -16,5 +16,3 @@ ccflags-y += -I$(src)/../ | |||
947 | 16 | 16 | ||
948 | 17 | # non-upstream things | 17 | # non-upstream things |
949 | 18 | iwlmvm-$(CPTCFG_IWLMVM_VENDOR_CMDS) += vendor-cmd.o | 18 | iwlmvm-$(CPTCFG_IWLMVM_VENDOR_CMDS) += vendor-cmd.o |
950 | 19 | iwlmvm-$(CPTCFG_IWLWIFI_FRQ_MGR) += fm-ops.o | ||
951 | 20 | iwlmvm-$(CPTCFG_IWLWIFI_FRQ_MGR_TEST) += fm-test.o | ||
952 | diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/coex.c b/drivers/net/wireless/intel/iwlwifi/mvm/coex.c | |||
953 | index bd9c105..7fb4ac9 100644 | |||
954 | --- a/drivers/net/wireless/intel/iwlwifi/mvm/coex.c | |||
955 | +++ b/drivers/net/wireless/intel/iwlwifi/mvm/coex.c | |||
956 | @@ -7,7 +7,7 @@ | |||
957 | 7 | * | 7 | * |
958 | 8 | * Copyright(c) 2013 - 2014 Intel Corporation. All rights reserved. | 8 | * Copyright(c) 2013 - 2014 Intel Corporation. All rights reserved. |
959 | 9 | * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH | 9 | * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH |
961 | 10 | * Copyright(c) 2018 Intel Corporation | 10 | * Copyright(c) 2018 - 2019 Intel Corporation |
962 | 11 | * | 11 | * |
963 | 12 | * This program is free software; you can redistribute it and/or modify | 12 | * This program is free software; you can redistribute it and/or modify |
964 | 13 | * it under the terms of version 2 of the GNU General Public License as | 13 | * it under the terms of version 2 of the GNU General Public License as |
965 | @@ -29,7 +29,7 @@ | |||
966 | 29 | * | 29 | * |
967 | 30 | * Copyright(c) 2013 - 2014 Intel Corporation. All rights reserved. | 30 | * Copyright(c) 2013 - 2014 Intel Corporation. All rights reserved. |
968 | 31 | * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH | 31 | * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH |
970 | 32 | * Copyright(c) 2018 Intel Corporation | 32 | * Copyright(c) 2018 - 2019 Intel Corporation |
971 | 33 | * All rights reserved. | 33 | * All rights reserved. |
972 | 34 | * | 34 | * |
973 | 35 | * Redistribution and use in source and binary forms, with or without | 35 | * Redistribution and use in source and binary forms, with or without |
974 | @@ -69,10 +69,6 @@ | |||
975 | 69 | #include "mvm.h" | 69 | #include "mvm.h" |
976 | 70 | #include "iwl-debug.h" | 70 | #include "iwl-debug.h" |
977 | 71 | 71 | ||
978 | 72 | #ifdef CPTCFG_IWLWIFI_LTE_COEX | ||
979 | 73 | #include "lte-coex.h" | ||
980 | 74 | #endif | ||
981 | 75 | |||
982 | 76 | /* 20MHz / 40MHz below / 40Mhz above*/ | 72 | /* 20MHz / 40MHz below / 40Mhz above*/ |
983 | 77 | static const __le64 iwl_ci_mask[][3] = { | 73 | static const __le64 iwl_ci_mask[][3] = { |
984 | 78 | /* dummy entry for channel 0 */ | 74 | /* dummy entry for channel 0 */ |
985 | @@ -622,11 +618,6 @@ u16 iwl_mvm_coex_agg_time_limit(struct iwl_mvm *mvm, | |||
986 | 622 | if (mvm->last_bt_notif.ttc_status & BIT(phy_ctxt->id)) | 618 | if (mvm->last_bt_notif.ttc_status & BIT(phy_ctxt->id)) |
987 | 623 | return LINK_QUAL_AGG_TIME_LIMIT_DEF; | 619 | return LINK_QUAL_AGG_TIME_LIMIT_DEF; |
988 | 624 | 620 | ||
989 | 625 | #ifdef CPTCFG_IWLWIFI_FRQ_MGR | ||
990 | 626 | /* 2G coex */ | ||
991 | 627 | if (mvm->coex_2g_enabled) | ||
992 | 628 | return LINK_QUAL_AGG_TIME_LIMIT_BT_ACT; | ||
993 | 629 | #endif | ||
994 | 630 | if (le32_to_cpu(mvm->last_bt_notif.bt_activity_grading) < | 621 | if (le32_to_cpu(mvm->last_bt_notif.bt_activity_grading) < |
995 | 631 | BT_HIGH_TRAFFIC) | 622 | BT_HIGH_TRAFFIC) |
996 | 632 | return LINK_QUAL_AGG_TIME_LIMIT_DEF; | 623 | return LINK_QUAL_AGG_TIME_LIMIT_DEF; |
997 | @@ -751,150 +742,3 @@ void iwl_mvm_bt_coex_vif_change(struct iwl_mvm *mvm) | |||
998 | 751 | iwl_mvm_bt_coex_notif_handle(mvm); | 742 | iwl_mvm_bt_coex_notif_handle(mvm); |
999 | 752 | } | 743 | } |
1000 | 753 | 744 | ||
1001 | 754 | #ifdef CPTCFG_IWLWIFI_LTE_COEX | ||
1002 | 755 | int iwl_mvm_send_lte_coex_config_cmd(struct iwl_mvm *mvm) | ||
1003 | 756 | { | ||
1004 | 757 | const struct iwl_lte_coex_config_cmd *cmd = &mvm->lte_state.config; | ||
1005 | 758 | |||
1006 | 759 | if (!(mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_LTE_COEX)) { | ||
1007 | 760 | IWL_DEBUG_COEX(mvm, "LTE-Coex not supported!\n"); | ||
1008 | 761 | return -EOPNOTSUPP; | ||
1009 | 762 | } | ||
1010 | 763 | |||
1011 | 764 | IWL_DEBUG_COEX(mvm, "LTE-Coex: lte_coex_config_cmd:\n" | ||
1012 | 765 | "\tstate: %d\n\tband: %d\n\tchan: %d\n", | ||
1013 | 766 | le32_to_cpu(cmd->lte_state), le32_to_cpu(cmd->lte_band), | ||
1014 | 767 | le32_to_cpu(cmd->lte_chan)); | ||
1015 | 768 | |||
1016 | 769 | IWL_DEBUG_COEX(mvm, "\ttx safe freq min: %d\n\ttx safe freq max: %d\n" | ||
1017 | 770 | "\trx safe freq min: %d\n\trx safe freq max: %d\n", | ||
1018 | 771 | le32_to_cpu(cmd->tx_safe_freq_min), | ||
1019 | 772 | le32_to_cpu(cmd->tx_safe_freq_max), | ||
1020 | 773 | le32_to_cpu(cmd->rx_safe_freq_min), | ||
1021 | 774 | le32_to_cpu(cmd->rx_safe_freq_max)); | ||
1022 | 775 | |||
1023 | 776 | return iwl_mvm_send_cmd_pdu(mvm, LTE_COEX_CONFIG_CMD, 0, sizeof(*cmd), | ||
1024 | 777 | cmd); | ||
1025 | 778 | } | ||
1026 | 779 | |||
1027 | 780 | int iwl_mvm_send_lte_coex_wifi_reported_channel_cmd(struct iwl_mvm *mvm) | ||
1028 | 781 | { | ||
1029 | 782 | const struct iwl_lte_coex_wifi_reported_channel_cmd *cmd = | ||
1030 | 783 | &mvm->lte_state.rprtd_chan; | ||
1031 | 784 | |||
1032 | 785 | if (!(mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_LTE_COEX)) { | ||
1033 | 786 | IWL_DEBUG_COEX(mvm, "LTE-Coex not supported!\n"); | ||
1034 | 787 | return -EOPNOTSUPP; | ||
1035 | 788 | } | ||
1036 | 789 | |||
1037 | 790 | IWL_DEBUG_COEX(mvm, "LTE-COEX: lte_coex_wifi_reported_channel_cmd:\n" | ||
1038 | 791 | "\tchannel: %d\n\tbandwidth: %d\n", | ||
1039 | 792 | le32_to_cpu(cmd->channel), le32_to_cpu(cmd->bandwidth)); | ||
1040 | 793 | |||
1041 | 794 | return iwl_mvm_send_cmd_pdu(mvm, LTE_COEX_WIFI_REPORTED_CHANNEL_CMD, | ||
1042 | 795 | 0, sizeof(*cmd), cmd); | ||
1043 | 796 | } | ||
1044 | 797 | |||
1045 | 798 | int iwl_mvm_send_lte_coex_static_params_cmd(struct iwl_mvm *mvm) | ||
1046 | 799 | { | ||
1047 | 800 | const struct iwl_lte_coex_static_params_cmd *cmd = &mvm->lte_state.stat; | ||
1048 | 801 | |||
1049 | 802 | if (!(mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_LTE_COEX)) { | ||
1050 | 803 | IWL_DEBUG_COEX(mvm, "LTE-Coex not supported!\n"); | ||
1051 | 804 | return -EOPNOTSUPP; | ||
1052 | 805 | } | ||
1053 | 806 | |||
1054 | 807 | IWL_DEBUG_COEX(mvm, "LTE-COEX: lte_coex_static_params_cmd:\n" | ||
1055 | 808 | "\tmfu config[0]: %d\n\ttx power[0]: %d\n", | ||
1056 | 809 | le32_to_cpu(cmd->mfu_config[0]), | ||
1057 | 810 | cmd->tx_power_in_dbm[0]); | ||
1058 | 811 | |||
1059 | 812 | return iwl_mvm_send_cmd_pdu(mvm, LTE_COEX_STATIC_PARAMS_CMD, 0, | ||
1060 | 813 | sizeof(*cmd), cmd); | ||
1061 | 814 | } | ||
1062 | 815 | |||
1063 | 816 | int iwl_mvm_send_lte_fine_tuning_params_cmd(struct iwl_mvm *mvm) | ||
1064 | 817 | { | ||
1065 | 818 | const struct iwl_lte_coex_fine_tuning_params_cmd *cmd = | ||
1066 | 819 | &mvm->lte_state.ft; | ||
1067 | 820 | |||
1068 | 821 | if (!(mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_LTE_COEX)) { | ||
1069 | 822 | IWL_DEBUG_COEX(mvm, "LTE-Coex not supported!\n"); | ||
1070 | 823 | return -EOPNOTSUPP; | ||
1071 | 824 | } | ||
1072 | 825 | |||
1073 | 826 | IWL_DEBUG_COEX(mvm, "LTE-COEX: lte_fine_tuning_params_cmd:\n" | ||
1074 | 827 | "\trx protection assert timing: %d\n", | ||
1075 | 828 | le32_to_cpu(cmd->rx_protection_assert_timing)); | ||
1076 | 829 | |||
1077 | 830 | IWL_DEBUG_COEX(mvm, "\ttx protection assert timing: %d\n" | ||
1078 | 831 | "\trx protection timeout: %d\n\tmin tx power: %d\n", | ||
1079 | 832 | le32_to_cpu(cmd->tx_protection_assert_timing), | ||
1080 | 833 | le32_to_cpu(cmd->rx_protection_timeout), | ||
1081 | 834 | le32_to_cpu(cmd->min_tx_power)); | ||
1082 | 835 | |||
1083 | 836 | IWL_DEBUG_COEX(mvm, "\tul load uapsd threshold: %d\n" | ||
1084 | 837 | "\trx failure during ul uapsd threshold: %d\n", | ||
1085 | 838 | le32_to_cpu(cmd->lte_ul_load_uapsd_threshold), | ||
1086 | 839 | le32_to_cpu(cmd->rx_failure_during_ul_uapsd_threshold)); | ||
1087 | 840 | |||
1088 | 841 | IWL_DEBUG_COEX(mvm, | ||
1089 | 842 | "\trx failure during ul scan compensation threshold: %d\n" | ||
1090 | 843 | "\trx duration for ack protection: %d\n", | ||
1091 | 844 | le32_to_cpu(cmd->rx_failure_during_ul_sc_threshold), | ||
1092 | 845 | le32_to_cpu(cmd->rx_duration_for_ack_protection_us)); | ||
1093 | 846 | |||
1094 | 847 | IWL_DEBUG_COEX(mvm, "\tbeacon failure during ul counter: %d\n" | ||
1095 | 848 | "\tdtim failure during ul counter: %d\n", | ||
1096 | 849 | le32_to_cpu(cmd->beacon_failure_during_ul_counter), | ||
1097 | 850 | le32_to_cpu(cmd->dtim_failure_during_ul_counter)); | ||
1098 | 851 | |||
1099 | 852 | return iwl_mvm_send_cmd_pdu(mvm, LTE_COEX_FINE_TUNING_PARAMS_CMD, | ||
1100 | 853 | 0, sizeof(*cmd), cmd); | ||
1101 | 854 | } | ||
1102 | 855 | |||
1103 | 856 | int iwl_mvm_send_lte_sps_cmd(struct iwl_mvm *mvm) | ||
1104 | 857 | { | ||
1105 | 858 | const struct iwl_lte_coex_sps_cmd *cmd = &mvm->lte_state.sps; | ||
1106 | 859 | |||
1107 | 860 | if (!(mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_LTE_COEX)) { | ||
1108 | 861 | IWL_DEBUG_COEX(mvm, "LTE-Coex not supported!\n"); | ||
1109 | 862 | return -EOPNOTSUPP; | ||
1110 | 863 | } | ||
1111 | 864 | |||
1112 | 865 | IWL_DEBUG_COEX(mvm, "LTE-COEX: lte_sps_cmd:\n\tsps info: %d\n", | ||
1113 | 866 | le32_to_cpu(cmd->lte_semi_persistent_info)); | ||
1114 | 867 | |||
1115 | 868 | return iwl_mvm_send_cmd_pdu(mvm, LTE_COEX_SPS_CMD, 0, sizeof(*cmd), | ||
1116 | 869 | cmd); | ||
1117 | 870 | } | ||
1118 | 871 | |||
1119 | 872 | void iwl_mvm_reset_lte_state(struct iwl_mvm *mvm) | ||
1120 | 873 | { | ||
1121 | 874 | struct lte_coex_state *lte_state = &mvm->lte_state; | ||
1122 | 875 | |||
1123 | 876 | lte_state->state = LTE_OFF; | ||
1124 | 877 | lte_state->has_config = 0; | ||
1125 | 878 | lte_state->has_rprtd_chan = 0; | ||
1126 | 879 | lte_state->has_sps = 0; | ||
1127 | 880 | lte_state->has_ft = 0; | ||
1128 | 881 | } | ||
1129 | 882 | |||
1130 | 883 | void iwl_mvm_send_lte_commands(struct iwl_mvm *mvm) | ||
1131 | 884 | { | ||
1132 | 885 | struct lte_coex_state *lte_state = &mvm->lte_state; | ||
1133 | 886 | |||
1134 | 887 | lockdep_assert_held(&mvm->mutex); | ||
1135 | 888 | |||
1136 | 889 | if (lte_state->has_static) | ||
1137 | 890 | iwl_mvm_send_lte_coex_static_params_cmd(mvm); | ||
1138 | 891 | if (lte_state->has_rprtd_chan) | ||
1139 | 892 | iwl_mvm_send_lte_coex_wifi_reported_channel_cmd(mvm); | ||
1140 | 893 | if (lte_state->state != LTE_OFF) | ||
1141 | 894 | iwl_mvm_send_lte_coex_config_cmd(mvm); | ||
1142 | 895 | if (lte_state->has_sps) | ||
1143 | 896 | iwl_mvm_send_lte_sps_cmd(mvm); | ||
1144 | 897 | if (lte_state->has_ft) | ||
1145 | 898 | iwl_mvm_send_lte_fine_tuning_params_cmd(mvm); | ||
1146 | 899 | } | ||
1147 | 900 | #endif /* CPTCFG_IWLWIFI_LTE_COEX */ | ||
1148 | diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c | |||
1149 | index 68814b9..5e6cd75 100644 | |||
1150 | --- a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c | |||
1151 | +++ b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c | |||
1152 | @@ -831,6 +831,8 @@ iwl_mvm_wowlan_config(struct iwl_mvm *mvm, | |||
1153 | 831 | bool unified_image = fw_has_capa(&mvm->fw->ucode_capa, | 831 | bool unified_image = fw_has_capa(&mvm->fw->ucode_capa, |
1154 | 832 | IWL_UCODE_TLV_CAPA_CNSLDTD_D3_D0_IMG); | 832 | IWL_UCODE_TLV_CAPA_CNSLDTD_D3_D0_IMG); |
1155 | 833 | 833 | ||
1156 | 834 | mvm->offload_tid = wowlan_config_cmd->offloading_tid; | ||
1157 | 835 | |||
1158 | 834 | if (!unified_image) { | 836 | if (!unified_image) { |
1159 | 835 | ret = iwl_mvm_switch_to_d3(mvm); | 837 | ret = iwl_mvm_switch_to_d3(mvm); |
1160 | 836 | if (ret) | 838 | if (ret) |
1161 | @@ -1656,6 +1658,13 @@ static bool iwl_mvm_query_wakeup_reasons(struct iwl_mvm *mvm, | |||
1162 | 1656 | mvm_ap_sta->tid_data[i].seq_number = seq; | 1658 | mvm_ap_sta->tid_data[i].seq_number = seq; |
1163 | 1657 | } | 1659 | } |
1164 | 1658 | 1660 | ||
1165 | 1661 | if (mvm->trans->cfg->device_family >= IWL_DEVICE_FAMILY_22000) { | ||
1166 | 1662 | i = mvm->offload_tid; | ||
1167 | 1663 | iwl_trans_set_q_ptrs(mvm->trans, | ||
1168 | 1664 | mvm_ap_sta->tid_data[i].txq_id, | ||
1169 | 1665 | mvm_ap_sta->tid_data[i].seq_number >> 4); | ||
1170 | 1666 | } | ||
1171 | 1667 | |||
1172 | 1659 | /* now we have all the data we need, unlock to avoid mac80211 issues */ | 1668 | /* now we have all the data we need, unlock to avoid mac80211 issues */ |
1173 | 1660 | mutex_unlock(&mvm->mutex); | 1669 | mutex_unlock(&mvm->mutex); |
1174 | 1661 | 1670 | ||
1175 | diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c | |||
1176 | index 02ff26d..222c4c8 100644 | |||
1177 | --- a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c | |||
1178 | +++ b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c | |||
1179 | @@ -8,7 +8,7 @@ | |||
1180 | 8 | * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. | 8 | * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. |
1181 | 9 | * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH | 9 | * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH |
1182 | 10 | * Copyright(c) 2016 - 2017 Intel Deutschland GmbH | 10 | * Copyright(c) 2016 - 2017 Intel Deutschland GmbH |
1184 | 11 | * Copyright(c) 2018 Intel Corporation | 11 | * Copyright(c) 2018 - 2019 Intel Corporation |
1185 | 12 | * | 12 | * |
1186 | 13 | * This program is free software; you can redistribute it and/or modify | 13 | * This program is free software; you can redistribute it and/or modify |
1187 | 14 | * it under the terms of version 2 of the GNU General Public License as | 14 | * it under the terms of version 2 of the GNU General Public License as |
1188 | @@ -31,7 +31,7 @@ | |||
1189 | 31 | * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. | 31 | * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. |
1190 | 32 | * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH | 32 | * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH |
1191 | 33 | * Copyright(c) 2016 - 2017 Intel Deutschland GmbH | 33 | * Copyright(c) 2016 - 2017 Intel Deutschland GmbH |
1193 | 34 | * Copyright(c) 2018 Intel Corporation | 34 | * Copyright(c) 2018 - 2019 Intel Corporation |
1194 | 35 | * All rights reserved. | 35 | * All rights reserved. |
1195 | 36 | * | 36 | * |
1196 | 37 | * Redistribution and use in source and binary forms, with or without | 37 | * Redistribution and use in source and binary forms, with or without |
1197 | @@ -201,19 +201,6 @@ static ssize_t iwl_dbgfs_tx_pwr_lmt_read(struct file *file, | |||
1198 | 201 | pos = scnprintf(buf, bufsz, "bss limit = %d\n", | 201 | pos = scnprintf(buf, bufsz, "bss limit = %d\n", |
1199 | 202 | vif->bss_conf.txpower); | 202 | vif->bss_conf.txpower); |
1200 | 203 | 203 | ||
1201 | 204 | #ifdef CPTCFG_IWLWIFI_FRQ_MGR | ||
1202 | 205 | { | ||
1203 | 206 | struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); | ||
1204 | 207 | struct iwl_mvm *mvm = mvmvif->mvm; | ||
1205 | 208 | |||
1206 | 209 | mutex_lock(&mvm->mutex); | ||
1207 | 210 | if (mvmvif->phy_ctxt) | ||
1208 | 211 | pos += scnprintf(buf + pos, bufsz - pos, "fm limit = %d\n", | ||
1209 | 212 | mvmvif->phy_ctxt->fm_tx_power_limit); | ||
1210 | 213 | mutex_unlock(&mvm->mutex); | ||
1211 | 214 | } | ||
1212 | 215 | #endif | ||
1213 | 216 | |||
1214 | 217 | return simple_read_from_buffer(user_buf, count, ppos, buf, pos); | 204 | return simple_read_from_buffer(user_buf, count, ppos, buf, pos); |
1215 | 218 | } | 205 | } |
1216 | 219 | 206 | ||
1217 | diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fm-ops.c b/drivers/net/wireless/intel/iwlwifi/mvm/fm-ops.c | |||
1218 | 220 | deleted file mode 100644 | 207 | deleted file mode 100644 |
1219 | index f312f90..0000000 | |||
1220 | --- a/drivers/net/wireless/intel/iwlwifi/mvm/fm-ops.c | |||
1221 | +++ /dev/null | |||
1222 | @@ -1,837 +0,0 @@ | |||
1223 | 1 | /****************************************************************************** | ||
1224 | 2 | * | ||
1225 | 3 | * This file is provided under a dual BSD/GPLv2 license. When using or | ||
1226 | 4 | * redistributing this file, you may do so under either license. | ||
1227 | 5 | * | ||
1228 | 6 | * GPL LICENSE SUMMARY | ||
1229 | 7 | * | ||
1230 | 8 | * Copyright(c) 2013 - 2014 Intel Corporation. All rights reserved. | ||
1231 | 9 | * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH | ||
1232 | 10 | * | ||
1233 | 11 | * This program is free software; you can redistribute it and/or modify | ||
1234 | 12 | * it under the terms of version 2 of the GNU General Public License as | ||
1235 | 13 | * published by the Free Software Foundation. | ||
1236 | 14 | * | ||
1237 | 15 | * This program is distributed in the hope that it will be useful, but | ||
1238 | 16 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1239 | 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
1240 | 18 | * General Public License for more details. | ||
1241 | 19 | * | ||
1242 | 20 | * The full GNU General Public License is included in this distribution | ||
1243 | 21 | * in the file called COPYING. | ||
1244 | 22 | * | ||
1245 | 23 | * Contact Information: | ||
1246 | 24 | * Intel Linux Wireless <linuxwifi@intel.com> | ||
1247 | 25 | * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 | ||
1248 | 26 | * | ||
1249 | 27 | * BSD LICENSE | ||
1250 | 28 | * | ||
1251 | 29 | * Copyright(c) 2013 - 2014 Intel Corporation. All rights reserved. | ||
1252 | 30 | * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH | ||
1253 | 31 | * All rights reserved. | ||
1254 | 32 | * | ||
1255 | 33 | * Redistribution and use in source and binary forms, with or without | ||
1256 | 34 | * modification, are permitted provided that the following conditions | ||
1257 | 35 | * are met: | ||
1258 | 36 | * | ||
1259 | 37 | * * Redistributions of source code must retain the above copyright | ||
1260 | 38 | * notice, this list of conditions and the following disclaimer. | ||
1261 | 39 | * * Redistributions in binary form must reproduce the above copyright | ||
1262 | 40 | * notice, this list of conditions and the following disclaimer in | ||
1263 | 41 | * the documentation and/or other materials provided with the | ||
1264 | 42 | * distribution. | ||
1265 | 43 | * * Neither the name Intel Corporation nor the names of its | ||
1266 | 44 | * contributors may be used to endorse or promote products derived | ||
1267 | 45 | * from this software without specific prior written permission. | ||
1268 | 46 | * | ||
1269 | 47 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
1270 | 48 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
1271 | 49 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
1272 | 50 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
1273 | 51 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
1274 | 52 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
1275 | 53 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
1276 | 54 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
1277 | 55 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
1278 | 56 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
1279 | 57 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
1280 | 58 | * | ||
1281 | 59 | *****************************************************************************/ | ||
1282 | 60 | #include <linux/fm/iui_fm.h> | ||
1283 | 61 | #include "mvm.h" | ||
1284 | 62 | |||
1285 | 63 | /* | ||
1286 | 64 | * Used in the FM callback and is declared here since according | ||
1287 | 65 | * to the FM API, the callback does not receive an mvm pointer | ||
1288 | 66 | */ | ||
1289 | 67 | static struct iwl_mvm *g_mvm; | ||
1290 | 68 | |||
1291 | 69 | /* If in debug mode use the fm-test module instead of the original fm API */ | ||
1292 | 70 | static bool debug_mode; | ||
1293 | 71 | |||
1294 | 72 | struct chan_ifaces { | ||
1295 | 73 | struct iui_fm_wlan_channel_tx_power *chan_txpwr; | ||
1296 | 74 | int num_of_vif; /* for statistics */ | ||
1297 | 75 | }; | ||
1298 | 76 | |||
1299 | 77 | struct chan_list { | ||
1300 | 78 | struct iui_fm_wlan_info *winfo; | ||
1301 | 79 | enum iwl_fm_chan_change_action action; | ||
1302 | 80 | }; | ||
1303 | 81 | |||
1304 | 82 | /* last reported channel notification to the FM */ | ||
1305 | 83 | static struct iui_fm_wlan_info last_chan_notif; | ||
1306 | 84 | /* last dcdc values requested by the FM */ | ||
1307 | 85 | static int g_dcdc_div0; | ||
1308 | 86 | static int g_dcdc_div1; | ||
1309 | 87 | |||
1310 | 88 | static struct work_struct fm_chan_notif_wk; | ||
1311 | 89 | |||
1312 | 90 | /* | ||
1313 | 91 | * Search for an interface with a given frequency | ||
1314 | 92 | */ | ||
1315 | 93 | static void iwl_mvm_fm_iface_iterator(void *_data, u8 *mac, | ||
1316 | 94 | struct ieee80211_vif *vif) | ||
1317 | 95 | { | ||
1318 | 96 | struct chan_ifaces *data = _data; | ||
1319 | 97 | struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); | ||
1320 | 98 | struct ieee80211_chanctx_conf *chanctx_conf; | ||
1321 | 99 | |||
1322 | 100 | /* P2P device or NAN are never assigned a channel */ | ||
1323 | 101 | if ((vif->type == NL80211_IFTYPE_P2P_DEVICE) || | ||
1324 | 102 | (vif->type == NL80211_IFTYPE_NAN)) | ||
1325 | 103 | return; | ||
1326 | 104 | |||
1327 | 105 | rcu_read_lock(); | ||
1328 | 106 | |||
1329 | 107 | chanctx_conf = rcu_dereference(vif->chanctx_conf); | ||
1330 | 108 | /* make sure the channel context is assigned */ | ||
1331 | 109 | if (!chanctx_conf) { | ||
1332 | 110 | rcu_read_unlock(); | ||
1333 | 111 | return; | ||
1334 | 112 | } | ||
1335 | 113 | |||
1336 | 114 | if (chanctx_conf->min_def.center_freq1 == | ||
1337 | 115 | KHZ_TO_MHZ(data->chan_txpwr->frequency)) { | ||
1338 | 116 | mvmvif->phy_ctxt->fm_tx_power_limit = | ||
1339 | 117 | data->chan_txpwr->max_tx_pwr; | ||
1340 | 118 | data->num_of_vif++; | ||
1341 | 119 | rcu_read_unlock(); | ||
1342 | 120 | /* FM requests to remove Tx power limitation */ | ||
1343 | 121 | if (data->chan_txpwr->max_tx_pwr == IUI_FM_WLAN_NO_TX_PWR_LIMIT) | ||
1344 | 122 | data->chan_txpwr->max_tx_pwr = | ||
1345 | 123 | IWL_DEFAULT_MAX_TX_POWER; | ||
1346 | 124 | |||
1347 | 125 | iwl_mvm_fm_set_tx_power(g_mvm, vif, | ||
1348 | 126 | data->chan_txpwr->max_tx_pwr); | ||
1349 | 127 | return; | ||
1350 | 128 | } | ||
1351 | 129 | |||
1352 | 130 | rcu_read_unlock(); | ||
1353 | 131 | } | ||
1354 | 132 | |||
1355 | 133 | /* | ||
1356 | 134 | * Search for an interface with a given frequency | ||
1357 | 135 | */ | ||
1358 | 136 | static void iwl_mvm_fm_chan_vldt_iter(void *_data, u8 *mac, | ||
1359 | 137 | struct ieee80211_vif *vif) | ||
1360 | 138 | { | ||
1361 | 139 | struct chan_ifaces *data = _data; | ||
1362 | 140 | struct ieee80211_chanctx_conf *chanctx_conf; | ||
1363 | 141 | |||
1364 | 142 | rcu_read_lock(); | ||
1365 | 143 | |||
1366 | 144 | chanctx_conf = rcu_dereference(vif->chanctx_conf); | ||
1367 | 145 | /* make sure the channel context is assigned */ | ||
1368 | 146 | if (!chanctx_conf) { | ||
1369 | 147 | rcu_read_unlock(); | ||
1370 | 148 | return; | ||
1371 | 149 | } | ||
1372 | 150 | |||
1373 | 151 | if (chanctx_conf->min_def.center_freq1 == | ||
1374 | 152 | KHZ_TO_MHZ(data->chan_txpwr->frequency)) | ||
1375 | 153 | data->num_of_vif++; | ||
1376 | 154 | |||
1377 | 155 | rcu_read_unlock(); | ||
1378 | 156 | } | ||
1379 | 157 | |||
1380 | 158 | static enum iui_fm_wlan_bandwidth | ||
1381 | 159 | iwl_mvm_fm_get_bandwidth(enum nl80211_chan_width bandwidth) | ||
1382 | 160 | { | ||
1383 | 161 | switch (bandwidth) { | ||
1384 | 162 | case NL80211_CHAN_WIDTH_20_NOHT: | ||
1385 | 163 | return IUI_FM_WLAN_BW_20MHZ; | ||
1386 | 164 | case NL80211_CHAN_WIDTH_20: | ||
1387 | 165 | return IUI_FM_WLAN_BW_20MHZ; | ||
1388 | 166 | case NL80211_CHAN_WIDTH_40: | ||
1389 | 167 | return IUI_FM_WLAN_BW_40MHZ; | ||
1390 | 168 | case NL80211_CHAN_WIDTH_80: | ||
1391 | 169 | return IUI_FM_WLAN_BW_80MHZ; | ||
1392 | 170 | case NL80211_CHAN_WIDTH_160: | ||
1393 | 171 | return IUI_FM_WLAN_BW_160MHZ; | ||
1394 | 172 | default: | ||
1395 | 173 | return IUI_FM_WLAN_BW_INVALID; | ||
1396 | 174 | } | ||
1397 | 175 | } | ||
1398 | 176 | |||
1399 | 177 | /* | ||
1400 | 178 | * Search for all channels used by interfaces | ||
1401 | 179 | */ | ||
1402 | 180 | static void iwl_mvm_fm_chan_iterator(struct ieee80211_hw *hw, | ||
1403 | 181 | struct ieee80211_chanctx_conf *ctx, | ||
1404 | 182 | void *_data) | ||
1405 | 183 | { | ||
1406 | 184 | int i; | ||
1407 | 185 | enum nl80211_chan_width band; | ||
1408 | 186 | u32 freq; | ||
1409 | 187 | struct chan_list *data = _data; | ||
1410 | 188 | struct iui_fm_wlan_info *winfo = data->winfo; | ||
1411 | 189 | |||
1412 | 190 | if (winfo->num_channels == IUI_FM_WLAN_MAX_CHANNELS) | ||
1413 | 191 | return; | ||
1414 | 192 | |||
1415 | 193 | freq = MHZ_TO_KHZ(ctx->min_def.center_freq1); | ||
1416 | 194 | band = ctx->min_def.width; | ||
1417 | 195 | |||
1418 | 196 | for (i = 0; i < winfo->num_channels; i++) | ||
1419 | 197 | if (winfo->channel_info[i].frequency == freq) { | ||
1420 | 198 | /* | ||
1421 | 199 | * channel exists - but bandwidth maybe invalid since | ||
1422 | 200 | * we are removing a ctx that operates on this channel | ||
1423 | 201 | */ | ||
1424 | 202 | winfo->channel_info[winfo->num_channels].bandwidth = | ||
1425 | 203 | iwl_mvm_fm_get_bandwidth(band); | ||
1426 | 204 | return; /* channel already exists in list */ | ||
1427 | 205 | } | ||
1428 | 206 | |||
1429 | 207 | winfo->channel_info[winfo->num_channels].frequency = freq; | ||
1430 | 208 | winfo->channel_info[winfo->num_channels].bandwidth = | ||
1431 | 209 | iwl_mvm_fm_get_bandwidth(band); | ||
1432 | 210 | |||
1433 | 211 | winfo->num_channels++; | ||
1434 | 212 | } | ||
1435 | 213 | |||
1436 | 214 | /* | ||
1437 | 215 | * Handling Frequency Managers Tx power mitigation Request. | ||
1438 | 216 | * Reducing the Tx power of all interfaces that use a specific channel. | ||
1439 | 217 | */ | ||
1440 | 218 | static enum iui_fm_mitigation_status | ||
1441 | 219 | iwl_mvm_fm_mitig_txpwr(struct iui_fm_wlan_mitigation *mit) | ||
1442 | 220 | { | ||
1443 | 221 | int i; | ||
1444 | 222 | struct chan_ifaces chan_ifaces; | ||
1445 | 223 | struct iui_fm_wlan_channel_tx_power *chan_txpwr_list = | ||
1446 | 224 | mit->channel_tx_pwr; | ||
1447 | 225 | u32 num_channels = mit->num_channels; | ||
1448 | 226 | |||
1449 | 227 | /* Not required to mitigate tx power */ | ||
1450 | 228 | if (!(mit->bitmask & WLAN_MITI)) | ||
1451 | 229 | goto ret; | ||
1452 | 230 | |||
1453 | 231 | if (IUI_FM_WLAN_MAX_CHANNELS < num_channels) | ||
1454 | 232 | return IUI_FM_MITIGATION_ERROR_INVALID_PARAM; | ||
1455 | 233 | |||
1456 | 234 | for (i = 0; i < num_channels; i++) { | ||
1457 | 235 | chan_ifaces.chan_txpwr = &chan_txpwr_list[i]; | ||
1458 | 236 | chan_ifaces.num_of_vif = 0; | ||
1459 | 237 | /* find all interfaces that use this channel */ | ||
1460 | 238 | ieee80211_iterate_active_interfaces(g_mvm->hw, | ||
1461 | 239 | IEEE80211_IFACE_ITER_NORMAL, | ||
1462 | 240 | iwl_mvm_fm_iface_iterator, | ||
1463 | 241 | &chan_ifaces); | ||
1464 | 242 | IWL_DEBUG_EXTERNAL(g_mvm, | ||
1465 | 243 | "FM: Changed Tx power to %d for %d" | ||
1466 | 244 | " vifs on channel %d\n", | ||
1467 | 245 | chan_ifaces.chan_txpwr->max_tx_pwr, | ||
1468 | 246 | chan_ifaces.num_of_vif, | ||
1469 | 247 | chan_ifaces.chan_txpwr->frequency); | ||
1470 | 248 | } | ||
1471 | 249 | ret: | ||
1472 | 250 | return IUI_FM_MITIGATION_COMPLETE_OK; | ||
1473 | 251 | } | ||
1474 | 252 | |||
1475 | 253 | /* | ||
1476 | 254 | * Handling Frequency Managers ADC/DAC mitigation Request | ||
1477 | 255 | * TODO: implement | ||
1478 | 256 | */ | ||
1479 | 257 | static enum iui_fm_mitigation_status | ||
1480 | 258 | iwl_mvm_fm_mitig_adc_dac_freq(struct iui_fm_wlan_mitigation *mit) | ||
1481 | 259 | { | ||
1482 | 260 | u32 adc_dac_freq = mit->wlan_adc_dac_freq; | ||
1483 | 261 | |||
1484 | 262 | /* Not required to mitigate adc dac */ | ||
1485 | 263 | if (!(mit->bitmask & WLAN_MITI)) | ||
1486 | 264 | goto ret; | ||
1487 | 265 | |||
1488 | 266 | if (adc_dac_freq != 0) | ||
1489 | 267 | return IUI_FM_MITIGATION_ERROR_INVALID_PARAM; | ||
1490 | 268 | |||
1491 | 269 | IWL_DEBUG_EXTERNAL(g_mvm, "FM: adc - dac mitigation\n"); | ||
1492 | 270 | ret: | ||
1493 | 271 | return IUI_FM_MITIGATION_COMPLETE_OK; | ||
1494 | 272 | } | ||
1495 | 273 | |||
1496 | 274 | /* | ||
1497 | 275 | * Handling Frequency Managers Rx Gain mitigation Request | ||
1498 | 276 | * TODO: implement | ||
1499 | 277 | */ | ||
1500 | 278 | static enum iui_fm_mitigation_status | ||
1501 | 279 | iwl_mvm_fm_mitig_rxgain_behavior(struct iui_fm_wlan_mitigation *mit) | ||
1502 | 280 | { | ||
1503 | 281 | enum iui_fm_wlan_rx_gain_behavior rx_gain = mit->rx_gain_behavior; | ||
1504 | 282 | |||
1505 | 283 | /* Not required to mitigate rx gain */ | ||
1506 | 284 | if (!(mit->bitmask & WLAN_MITI)) | ||
1507 | 285 | goto ret; | ||
1508 | 286 | |||
1509 | 287 | if (rx_gain != IUI_FM_WLAN_RX_GAIN_NORMAL) | ||
1510 | 288 | return IUI_FM_MITIGATION_ERROR_INVALID_PARAM; | ||
1511 | 289 | |||
1512 | 290 | IWL_DEBUG_EXTERNAL(g_mvm, | ||
1513 | 291 | "FM: rxgain behaviour mitigation - not implemented\n"); | ||
1514 | 292 | ret: | ||
1515 | 293 | return IUI_FM_MITIGATION_COMPLETE_OK; | ||
1516 | 294 | } | ||
1517 | 295 | |||
1518 | 296 | /* | ||
1519 | 297 | * Enables/Disable 2G coex mode - aggregation limiting. | ||
1520 | 298 | */ | ||
1521 | 299 | static enum iui_fm_mitigation_status | ||
1522 | 300 | iwl_mvm_fm_2g_coex(struct iui_fm_wlan_mitigation *mit) | ||
1523 | 301 | { | ||
1524 | 302 | enum iui_fm_mitigation_status ret = IUI_FM_MITIGATION_COMPLETE_OK; | ||
1525 | 303 | struct iwl_config_2g_coex_cmd cmd = {}; | ||
1526 | 304 | int i; | ||
1527 | 305 | struct iui_fm_wlan_channel_tx_power *chan; | ||
1528 | 306 | struct iui_fm_wlan_channel_tx_power *chan_txpwr_list = | ||
1529 | 307 | mit->channel_tx_pwr; | ||
1530 | 308 | u32 num_channels = mit->num_channels; | ||
1531 | 309 | |||
1532 | 310 | /* Not required to mitigate 2g coex */ | ||
1533 | 311 | if (!(mit->bitmask & WLAN_MITI)) | ||
1534 | 312 | return ret; | ||
1535 | 313 | |||
1536 | 314 | /* fw does not support the 2g coex cmd */ | ||
1537 | 315 | if (!fw_has_capa(&g_mvm->fw->ucode_capa, | ||
1538 | 316 | IWL_UCODE_TLV_CAPA_2G_COEX_SUPPORT)) | ||
1539 | 317 | goto sofia_xmm; | ||
1540 | 318 | |||
1541 | 319 | /* No need to change 2g coex state */ | ||
1542 | 320 | if (g_mvm->coex_2g_enabled == mit->wlan_2g_coex_enable) | ||
1543 | 321 | return ret; | ||
1544 | 322 | |||
1545 | 323 | g_mvm->coex_2g_enabled = mit->wlan_2g_coex_enable; | ||
1546 | 324 | |||
1547 | 325 | cmd.enabled = cpu_to_le32(g_mvm->coex_2g_enabled); | ||
1548 | 326 | |||
1549 | 327 | mutex_lock(&g_mvm->mutex); | ||
1550 | 328 | ret = iwl_mvm_send_cmd_pdu(g_mvm, CONFIG_2G_COEX_CMD, 0, sizeof(cmd), | ||
1551 | 329 | &cmd); | ||
1552 | 330 | mutex_unlock(&g_mvm->mutex); | ||
1553 | 331 | if (ret) { | ||
1554 | 332 | IWL_ERR(g_mvm, "Failed to send 2g coex command(%sabling)\n", | ||
1555 | 333 | g_mvm->coex_2g_enabled ? "en" : "dis"); | ||
1556 | 334 | return IUI_FM_MITIGATION_ERROR; | ||
1557 | 335 | } | ||
1558 | 336 | IWL_DEBUG_EXTERNAL(g_mvm, | ||
1559 | 337 | "FM 2G coex: %sabling 2G coex mode (sent fw cmd)\n", | ||
1560 | 338 | g_mvm->coex_2g_enabled ? "en" : "dis"); | ||
1561 | 339 | return ret; | ||
1562 | 340 | |||
1563 | 341 | sofia_xmm: | ||
1564 | 342 | /* Flow for SOFIA 3G & XMM6321 - don't support the 2g coex cmd */ | ||
1565 | 343 | if (IUI_FM_WLAN_MAX_CHANNELS < num_channels) | ||
1566 | 344 | return IUI_FM_MITIGATION_ERROR_INVALID_PARAM; | ||
1567 | 345 | |||
1568 | 346 | for (i = 0; i < num_channels; i++) { | ||
1569 | 347 | chan = &chan_txpwr_list[i]; | ||
1570 | 348 | if (chan->frequency == FM_2G_COEX_ENABLE_DISABLE) { | ||
1571 | 349 | mutex_lock(&g_mvm->mutex); | ||
1572 | 350 | if (chan->max_tx_pwr == FM_2G_COEX_ENABLE) { | ||
1573 | 351 | g_mvm->coex_2g_enabled = true; | ||
1574 | 352 | } else if (chan->max_tx_pwr == FM_2G_COEX_DISABLE) { | ||
1575 | 353 | g_mvm->coex_2g_enabled = false; | ||
1576 | 354 | } else { | ||
1577 | 355 | IWL_DEBUG_EXTERNAL(g_mvm, | ||
1578 | 356 | "FM 2G coex: ERROR: Invalid paramters for enable/disable(%d)\n", | ||
1579 | 357 | chan->max_tx_pwr); | ||
1580 | 358 | ret = IUI_FM_MITIGATION_ERROR_INVALID_PARAM; | ||
1581 | 359 | } | ||
1582 | 360 | IWL_DEBUG_EXTERNAL(g_mvm, | ||
1583 | 361 | "FM 2G coex: %sabling 2G coex mode\n", | ||
1584 | 362 | g_mvm->coex_2g_enabled ? | ||
1585 | 363 | "en" : "dis"); | ||
1586 | 364 | mutex_unlock(&g_mvm->mutex); | ||
1587 | 365 | break; | ||
1588 | 366 | } | ||
1589 | 367 | } | ||
1590 | 368 | |||
1591 | 369 | return ret; | ||
1592 | 370 | } | ||
1593 | 371 | |||
1594 | 372 | static int iwl_mvm_fm_send_dcdc_cmd(u32 div0, u32 div1, u32 flags) | ||
1595 | 373 | { | ||
1596 | 374 | int ret; | ||
1597 | 375 | struct iwl_dc2dc_config_resp *resp; | ||
1598 | 376 | struct iwl_rx_packet *pkt; | ||
1599 | 377 | struct iwl_dc2dc_config_cmd dcdc = { | ||
1600 | 378 | .flags = cpu_to_le32(flags), | ||
1601 | 379 | .dc2dc_freq_tune0 = cpu_to_le32(div0), | ||
1602 | 380 | .dc2dc_freq_tune1 = cpu_to_le32(div1), | ||
1603 | 381 | }; | ||
1604 | 382 | struct iwl_host_cmd cmd = { | ||
1605 | 383 | .id = DC2DC_CONFIG_CMD, | ||
1606 | 384 | .flags = CMD_WANT_SKB, | ||
1607 | 385 | .data = { &dcdc }, | ||
1608 | 386 | .len = { sizeof(struct iwl_dc2dc_config_cmd) }, | ||
1609 | 387 | }; | ||
1610 | 388 | |||
1611 | 389 | /* fw does not support the dcdc cmd */ | ||
1612 | 390 | if (!fw_has_capa(&g_mvm->fw->ucode_capa, | ||
1613 | 391 | IWL_UCODE_TLV_CAPA_DC2DC_CONFIG_SUPPORT)) | ||
1614 | 392 | return -EINVAL; | ||
1615 | 393 | |||
1616 | 394 | ret = iwl_mvm_send_cmd(g_mvm, &cmd); | ||
1617 | 395 | |||
1618 | 396 | if (ret) { | ||
1619 | 397 | IWL_ERR(g_mvm, "FM: Failed to send dcdc cmd (ret = %d)\n", ret); | ||
1620 | 398 | return ret; | ||
1621 | 399 | } | ||
1622 | 400 | |||
1623 | 401 | pkt = cmd.resp_pkt; | ||
1624 | 402 | if (!pkt) { | ||
1625 | 403 | IWL_ERR(g_mvm, "FM: Error DCDC cmd response is NULL\n"); | ||
1626 | 404 | return -EIO; | ||
1627 | 405 | } | ||
1628 | 406 | resp = (void *)pkt->data; | ||
1629 | 407 | |||
1630 | 408 | /* update the current dcdc values */ | ||
1631 | 409 | g_dcdc_div0 = le32_to_cpu(resp->dc2dc_freq_tune0); | ||
1632 | 410 | g_dcdc_div1 = le32_to_cpu(resp->dc2dc_freq_tune1); | ||
1633 | 411 | |||
1634 | 412 | iwl_free_resp(&cmd); | ||
1635 | 413 | return ret; | ||
1636 | 414 | } | ||
1637 | 415 | |||
1638 | 416 | /* | ||
1639 | 417 | * Enables/Disable DCDC mitigation | ||
1640 | 418 | * In some scenarios, DCDC inserts noise to FMR due to its (DCDC's) | ||
1641 | 419 | * internal clock rate. When WiFi is ON the noise level is very high, | ||
1642 | 420 | * and therefore DCDC needs to change its clock rate. | ||
1643 | 421 | */ | ||
1644 | 422 | static enum iui_fm_mitigation_status | ||
1645 | 423 | iwl_mvm_fm_mitig_dcdc(struct iui_fm_wlan_mitigation *mit) | ||
1646 | 424 | { | ||
1647 | 425 | enum iui_fm_mitigation_status ret = IUI_FM_MITIGATION_COMPLETE_OK; | ||
1648 | 426 | |||
1649 | 427 | /* Not required to mitigate dcdc */ | ||
1650 | 428 | if (!(mit->bitmask & DCDC_MITI)) | ||
1651 | 429 | return ret; | ||
1652 | 430 | |||
1653 | 431 | /* Current dcdc values match requested values */ | ||
1654 | 432 | if (mit->dcdc_div0 == g_dcdc_div0 && mit->dcdc_div1 == g_dcdc_div0) { | ||
1655 | 433 | IWL_DEBUG_EXTERNAL(g_mvm, | ||
1656 | 434 | "FM DCDC: Current dcdc values match requested values - not mitigating\n"); | ||
1657 | 435 | goto out; | ||
1658 | 436 | } | ||
1659 | 437 | |||
1660 | 438 | mutex_lock(&g_mvm->mutex); | ||
1661 | 439 | ret = iwl_mvm_fm_send_dcdc_cmd(mit->dcdc_div0, mit->dcdc_div1, | ||
1662 | 440 | DCDC_FREQ_TUNE_SET); | ||
1663 | 441 | mutex_unlock(&g_mvm->mutex); | ||
1664 | 442 | |||
1665 | 443 | if (ret) | ||
1666 | 444 | ret = IUI_FM_MITIGATION_ERROR; | ||
1667 | 445 | |||
1668 | 446 | out: | ||
1669 | 447 | IWL_DEBUG_EXTERNAL(g_mvm, | ||
1670 | 448 | "FM DCDC: mitigation %s (div0 = %d, div1 = %d)\n", | ||
1671 | 449 | ret ? "failed" : "succeeded", g_dcdc_div0, | ||
1672 | 450 | g_dcdc_div1); | ||
1673 | 451 | |||
1674 | 452 | return ret; | ||
1675 | 453 | } | ||
1676 | 454 | |||
1677 | 455 | /* | ||
1678 | 456 | * Send the FM the original DCDC values, so that FM can know when to activate | ||
1679 | 457 | * the DCDC mitigation. | ||
1680 | 458 | */ | ||
1681 | 459 | void iwl_mvm_fm_notify_current_dcdc(void) | ||
1682 | 460 | { | ||
1683 | 461 | int ret; | ||
1684 | 462 | struct iui_fm_freq_notification notification; | ||
1685 | 463 | struct iui_fm_wlan_info winfo; | ||
1686 | 464 | |||
1687 | 465 | if (!g_mvm) | ||
1688 | 466 | return; | ||
1689 | 467 | |||
1690 | 468 | memset(&winfo, 0, sizeof(struct iui_fm_wlan_info)); | ||
1691 | 469 | |||
1692 | 470 | /* Get current DCDC from the FW */ | ||
1693 | 471 | ret = iwl_mvm_fm_send_dcdc_cmd(0, 0, 0); | ||
1694 | 472 | if (ret) | ||
1695 | 473 | goto out; | ||
1696 | 474 | |||
1697 | 475 | winfo.dcdc_div0 = g_dcdc_div0; | ||
1698 | 476 | winfo.dcdc_div1 = g_dcdc_div1; | ||
1699 | 477 | |||
1700 | 478 | /* mark the change that we are reporting */ | ||
1701 | 479 | winfo.bitmask |= DCDC_UPDATE; | ||
1702 | 480 | |||
1703 | 481 | notification.type = IUI_FM_FREQ_NOTIFICATION_TYPE_WLAN; | ||
1704 | 482 | notification.info.wlan_info = &winfo; | ||
1705 | 483 | |||
1706 | 484 | ret = iwl_mvm_fm_notify_frequency(debug_mode, IUI_FM_MACRO_ID_WLAN, | ||
1707 | 485 | ¬ification); | ||
1708 | 486 | |||
1709 | 487 | out: | ||
1710 | 488 | IWL_DEBUG_EXTERNAL(g_mvm, | ||
1711 | 489 | "FM: notified fm about dcdc div0 = %d div1 = %d (fail = %d)\n", | ||
1712 | 490 | winfo.dcdc_div0, winfo.dcdc_div1, ret); | ||
1713 | 491 | } | ||
1714 | 492 | |||
1715 | 493 | /* | ||
1716 | 494 | * Check if the list of channels that the FM supplied is valid | ||
1717 | 495 | */ | ||
1718 | 496 | static bool iwl_mvm_fm_invalid_channel_list(struct iui_fm_wlan_mitigation *mit) | ||
1719 | 497 | { | ||
1720 | 498 | struct iui_fm_wlan_channel_tx_power *chan_txpwr_list = | ||
1721 | 499 | mit->channel_tx_pwr; | ||
1722 | 500 | u32 num_channels = mit->num_channels; | ||
1723 | 501 | u8 i, j; | ||
1724 | 502 | |||
1725 | 503 | /* Check if the same frequency appears twice */ | ||
1726 | 504 | for (i = 0; i < num_channels; i++) { | ||
1727 | 505 | for (j = 0; j < num_channels; j++) { | ||
1728 | 506 | if (chan_txpwr_list[i].frequency == | ||
1729 | 507 | chan_txpwr_list[j].frequency && i != j) { | ||
1730 | 508 | int freq; | ||
1731 | 509 | |||
1732 | 510 | freq = chan_txpwr_list[i].frequency; | ||
1733 | 511 | IWL_DEBUG_EXTERNAL(g_mvm, | ||
1734 | 512 | "FM: Invalid channel list: duplicated frequencies (freq = %d)\n", | ||
1735 | 513 | freq); | ||
1736 | 514 | return true; | ||
1737 | 515 | } | ||
1738 | 516 | } | ||
1739 | 517 | } | ||
1740 | 518 | |||
1741 | 519 | /* Check that all of the channels are used */ | ||
1742 | 520 | for (i = 0; i < num_channels; i++) { | ||
1743 | 521 | struct chan_ifaces chan_ifaces = { | ||
1744 | 522 | .chan_txpwr = &chan_txpwr_list[i], | ||
1745 | 523 | .num_of_vif = 0, | ||
1746 | 524 | }; | ||
1747 | 525 | ieee80211_iterate_active_interfaces(g_mvm->hw, | ||
1748 | 526 | IEEE80211_IFACE_ITER_NORMAL, | ||
1749 | 527 | iwl_mvm_fm_chan_vldt_iter, | ||
1750 | 528 | &chan_ifaces); | ||
1751 | 529 | if (!chan_ifaces.num_of_vif) { | ||
1752 | 530 | IWL_DEBUG_EXTERNAL(g_mvm, | ||
1753 | 531 | "FM: Invalid channel list: frequency is not in use (freq = %d)\n", | ||
1754 | 532 | chan_txpwr_list[i].frequency); | ||
1755 | 533 | return true; | ||
1756 | 534 | } | ||
1757 | 535 | } | ||
1758 | 536 | |||
1759 | 537 | return false; | ||
1760 | 538 | } | ||
1761 | 539 | |||
1762 | 540 | /* | ||
1763 | 541 | * Frequency Mitigation Callback function implementation. | ||
1764 | 542 | * Frequency Manager can ask to: | ||
1765 | 543 | * 1. Limit Tx power on specific channels | ||
1766 | 544 | * 2. Change ADC/DAC frequency - Currently not supported | ||
1767 | 545 | * 3. Request Rx Gain behavior - Currently not supported | ||
1768 | 546 | * 4. Enter 2G coex mode | ||
1769 | 547 | * 5. Change dcdc clock values | ||
1770 | 548 | */ | ||
1771 | 549 | static enum iui_fm_mitigation_status | ||
1772 | 550 | iwl_mvm_fm_wlan_mitigation(const enum iui_fm_macro_id macro_id, | ||
1773 | 551 | const struct iui_fm_mitigation *mitigation, | ||
1774 | 552 | const uint32_t sequence) | ||
1775 | 553 | { | ||
1776 | 554 | enum iui_fm_mitigation_status ret; | ||
1777 | 555 | struct iui_fm_wlan_mitigation *mit; | ||
1778 | 556 | |||
1779 | 557 | if (WARN_ON(!g_mvm)) | ||
1780 | 558 | return IUI_FM_MITIGATION_ERROR; | ||
1781 | 559 | |||
1782 | 560 | if (macro_id != IUI_FM_MACRO_ID_WLAN || | ||
1783 | 561 | mitigation->type != IUI_FM_MITIGATION_TYPE_WLAN) { | ||
1784 | 562 | ret = IUI_FM_MITIGATION_ERROR_INVALID_PARAM; | ||
1785 | 563 | goto end; | ||
1786 | 564 | } | ||
1787 | 565 | |||
1788 | 566 | mit = mitigation->info.wlan_mitigation; | ||
1789 | 567 | |||
1790 | 568 | if (iwl_mvm_fm_invalid_channel_list(mit)) | ||
1791 | 569 | return IUI_FM_MITIGATION_ERROR_INVALID_PARAM; | ||
1792 | 570 | |||
1793 | 571 | IWL_DEBUG_EXTERNAL(g_mvm, "FM: fm mitigation callback bit mask 0x%x\n", | ||
1794 | 572 | mit->bitmask); | ||
1795 | 573 | |||
1796 | 574 | ret = iwl_mvm_fm_mitig_dcdc(mit); | ||
1797 | 575 | if (ret) | ||
1798 | 576 | goto end; | ||
1799 | 577 | |||
1800 | 578 | /* Enable/Disable 2G coex mode */ | ||
1801 | 579 | ret = iwl_mvm_fm_2g_coex(mit); | ||
1802 | 580 | if (ret) | ||
1803 | 581 | goto end; | ||
1804 | 582 | |||
1805 | 583 | /* | ||
1806 | 584 | * Going to mitigate the Tx power of all stations using the channels in | ||
1807 | 585 | * the channel list mit->channel_tx_pwr received from the FM. | ||
1808 | 586 | */ | ||
1809 | 587 | ret = iwl_mvm_fm_mitig_txpwr(mit); | ||
1810 | 588 | if (ret) | ||
1811 | 589 | goto end; | ||
1812 | 590 | |||
1813 | 591 | ret = iwl_mvm_fm_mitig_adc_dac_freq(mit); | ||
1814 | 592 | |||
1815 | 593 | if (ret) | ||
1816 | 594 | goto end; | ||
1817 | 595 | |||
1818 | 596 | ret = iwl_mvm_fm_mitig_rxgain_behavior(mit); | ||
1819 | 597 | end: | ||
1820 | 598 | IWL_DEBUG_EXTERNAL(g_mvm, "FM: fm mitigation callback %s\n", | ||
1821 | 599 | ret ? "failed" : "succeeded"); | ||
1822 | 600 | return ret; | ||
1823 | 601 | } | ||
1824 | 602 | |||
1825 | 603 | /* | ||
1826 | 604 | * Check if the new list of active channels that the FM is going to be | ||
1827 | 605 | * updated with differs from the old list. | ||
1828 | 606 | * The check includes the channel frequency & BW. | ||
1829 | 607 | */ | ||
1830 | 608 | static bool iwl_mvm_fm_channel_changed(struct iui_fm_wlan_info *winfo) | ||
1831 | 609 | { | ||
1832 | 610 | int i, j; | ||
1833 | 611 | bool changed; | ||
1834 | 612 | |||
1835 | 613 | for (i = 0; i < winfo->num_channels; i++) { | ||
1836 | 614 | changed = true; | ||
1837 | 615 | for (j = 0; j < last_chan_notif.num_channels; j++) { | ||
1838 | 616 | /* The channel was not updated */ | ||
1839 | 617 | if (winfo->channel_info[i].frequency == | ||
1840 | 618 | last_chan_notif.channel_info[j].frequency && | ||
1841 | 619 | winfo->channel_info[i].bandwidth == | ||
1842 | 620 | last_chan_notif.channel_info[j].bandwidth) { | ||
1843 | 621 | changed = false; | ||
1844 | 622 | break; | ||
1845 | 623 | } | ||
1846 | 624 | } | ||
1847 | 625 | /* Channel was updated */ | ||
1848 | 626 | if (changed) | ||
1849 | 627 | return true; | ||
1850 | 628 | } | ||
1851 | 629 | |||
1852 | 630 | IWL_DEBUG_EXTERNAL(g_mvm, | ||
1853 | 631 | "FM: Channel list has not changed - not reporting\n"); | ||
1854 | 632 | return false; | ||
1855 | 633 | } | ||
1856 | 634 | |||
1857 | 635 | /* | ||
1858 | 636 | * Check if the new list of channels being reported to the FM is missing | ||
1859 | 637 | * channels that have been removed - but not reported as removed. | ||
1860 | 638 | * | ||
1861 | 639 | * The check is done by checking the old list of active channels that was | ||
1862 | 640 | * reported to the FM, and making sure that the active channel is still in the | ||
1863 | 641 | * new list. If the channel is absent from the list - it means that it is no | ||
1864 | 642 | * longer in use, so report it invalid. | ||
1865 | 643 | * | ||
1866 | 644 | * For example in case of connecting to an AP on 80MHZ BW. At first the | ||
1867 | 645 | * connection will be on the primary channel with 20MHZ, and then it will be | ||
1868 | 646 | * modified to the center frequency with 80MHZ, but the primary channel will not | ||
1869 | 647 | * be reported as removed. So we need to report this channel as invalid. | ||
1870 | 648 | * | ||
1871 | 649 | */ | ||
1872 | 650 | static void iwl_mvm_fm_remove_channels(struct iui_fm_wlan_info *winfo) | ||
1873 | 651 | { | ||
1874 | 652 | int i, j; | ||
1875 | 653 | bool found; | ||
1876 | 654 | |||
1877 | 655 | for (i = 0; i < last_chan_notif.num_channels; i++) { | ||
1878 | 656 | /* Can't report more channels since we are in the max */ | ||
1879 | 657 | if (winfo->num_channels == IUI_FM_WLAN_MAX_CHANNELS) | ||
1880 | 658 | return; | ||
1881 | 659 | found = false; | ||
1882 | 660 | |||
1883 | 661 | if (last_chan_notif.channel_info[i].bandwidth == | ||
1884 | 662 | IUI_FM_WLAN_BW_INVALID) | ||
1885 | 663 | continue; | ||
1886 | 664 | /* | ||
1887 | 665 | * Search for the old reported channel in the new reported | ||
1888 | 666 | * channels | ||
1889 | 667 | */ | ||
1890 | 668 | for (j = 0; j < winfo->num_channels; j++) { | ||
1891 | 669 | if (last_chan_notif.channel_info[i].frequency == | ||
1892 | 670 | winfo->channel_info[j].frequency) { | ||
1893 | 671 | found = true; | ||
1894 | 672 | break; | ||
1895 | 673 | } | ||
1896 | 674 | } | ||
1897 | 675 | /* | ||
1898 | 676 | * The old reported channel is not in the new ones (It was | ||
1899 | 677 | * removed) - Adding it to the report. | ||
1900 | 678 | */ | ||
1901 | 679 | if (!found) { | ||
1902 | 680 | winfo->channel_info[winfo->num_channels].frequency = | ||
1903 | 681 | last_chan_notif.channel_info[i].frequency; | ||
1904 | 682 | winfo->channel_info[winfo->num_channels].bandwidth = | ||
1905 | 683 | IUI_FM_WLAN_BW_INVALID; | ||
1906 | 684 | winfo->num_channels++; | ||
1907 | 685 | IWL_DEBUG_EXTERNAL(g_mvm, | ||
1908 | 686 | "FM: reporting channel %d invalid\n", | ||
1909 | 687 | last_chan_notif.channel_info[i]. | ||
1910 | 688 | frequency); | ||
1911 | 689 | } | ||
1912 | 690 | } | ||
1913 | 691 | } | ||
1914 | 692 | |||
1915 | 693 | static void iwl_mvm_fm_notif_chan_change_wk(struct work_struct *wk) | ||
1916 | 694 | { | ||
1917 | 695 | int ret; | ||
1918 | 696 | struct iui_fm_freq_notification notification; | ||
1919 | 697 | |||
1920 | 698 | /* FM is enabled - but registration failed */ | ||
1921 | 699 | if (!g_mvm) | ||
1922 | 700 | return; | ||
1923 | 701 | |||
1924 | 702 | mutex_lock(&g_mvm->mutex); | ||
1925 | 703 | |||
1926 | 704 | notification.type = IUI_FM_FREQ_NOTIFICATION_TYPE_WLAN; | ||
1927 | 705 | notification.info.wlan_info = &last_chan_notif; | ||
1928 | 706 | /* parameter not yet supported */ | ||
1929 | 707 | notification.info.wlan_info->wlan_adc_dac_freq = 0; | ||
1930 | 708 | |||
1931 | 709 | ret = iwl_mvm_fm_notify_frequency(debug_mode, IUI_FM_MACRO_ID_WLAN, | ||
1932 | 710 | ¬ification); | ||
1933 | 711 | |||
1934 | 712 | IWL_DEBUG_EXTERNAL(g_mvm, | ||
1935 | 713 | "FM: notified fm about channel change (fail = %d)\n", | ||
1936 | 714 | ret); | ||
1937 | 715 | |||
1938 | 716 | mutex_unlock(&g_mvm->mutex); | ||
1939 | 717 | } | ||
1940 | 718 | |||
1941 | 719 | /* | ||
1942 | 720 | * Notify Frequency Manager that an interface changed a channel. | ||
1943 | 721 | */ | ||
1944 | 722 | void iwl_mvm_fm_notify_channel_change(struct ieee80211_chanctx_conf *ctx, | ||
1945 | 723 | enum iwl_fm_chan_change_action action) | ||
1946 | 724 | { | ||
1947 | 725 | int i; | ||
1948 | 726 | struct iui_fm_wlan_info winfo = { | ||
1949 | 727 | .num_channels = 0, | ||
1950 | 728 | }; | ||
1951 | 729 | struct chan_list chan_info = { | ||
1952 | 730 | .winfo = &winfo, | ||
1953 | 731 | .action = action, | ||
1954 | 732 | }; | ||
1955 | 733 | |||
1956 | 734 | /* FM is enabled - but registration failed */ | ||
1957 | 735 | if (!g_mvm) | ||
1958 | 736 | return; | ||
1959 | 737 | |||
1960 | 738 | lockdep_assert_held(&g_mvm->mutex); | ||
1961 | 739 | |||
1962 | 740 | /* | ||
1963 | 741 | * if notifying the FM about adding/removing a channel ctx we | ||
1964 | 742 | * need to add this channel to the list before iterating over | ||
1965 | 743 | * the channel list since the list is updated only after this | ||
1966 | 744 | * function is called. | ||
1967 | 745 | */ | ||
1968 | 746 | if (action != IWL_FM_CHANGE_CHANCTX) { | ||
1969 | 747 | winfo.channel_info[0].frequency = | ||
1970 | 748 | MHZ_TO_KHZ(ctx->min_def.center_freq1); | ||
1971 | 749 | winfo.channel_info[0].bandwidth = | ||
1972 | 750 | iwl_mvm_fm_get_bandwidth(ctx->min_def.width); | ||
1973 | 751 | /* when removing a channel - report the BW invalid */ | ||
1974 | 752 | winfo.num_channels++; | ||
1975 | 753 | if (action == IWL_FM_REMOVE_CHANCTX) | ||
1976 | 754 | winfo.channel_info[0].bandwidth = | ||
1977 | 755 | IUI_FM_WLAN_BW_INVALID; | ||
1978 | 756 | } | ||
1979 | 757 | |||
1980 | 758 | /* finding all bandwidths of used channels for FM notification */ | ||
1981 | 759 | ieee80211_iter_chan_contexts_atomic(g_mvm->hw, | ||
1982 | 760 | iwl_mvm_fm_chan_iterator, | ||
1983 | 761 | &chan_info); | ||
1984 | 762 | |||
1985 | 763 | iwl_mvm_fm_remove_channels(&winfo); | ||
1986 | 764 | |||
1987 | 765 | for (i = 0; i < winfo.num_channels; i++) | ||
1988 | 766 | IWL_DEBUG_EXTERNAL(g_mvm, | ||
1989 | 767 | "FM: notifying fm about: channel=%d bandwith=%d\n", | ||
1990 | 768 | winfo.channel_info[i].frequency, | ||
1991 | 769 | winfo.channel_info[i].bandwidth); | ||
1992 | 770 | |||
1993 | 771 | /* Do not report to FM if no change happened */ | ||
1994 | 772 | if (!iwl_mvm_fm_channel_changed(&winfo)) | ||
1995 | 773 | return; | ||
1996 | 774 | |||
1997 | 775 | /* mark the change that we are reporting */ | ||
1998 | 776 | winfo.bitmask = WLAN_UPDATE; | ||
1999 | 777 | /* Update the last notification to the FM */ | ||
2000 | 778 | memcpy(&last_chan_notif, &winfo, sizeof(struct iui_fm_wlan_info)); | ||
2001 | 779 | |||
2002 | 780 | schedule_work(&fm_chan_notif_wk); | ||
2003 | 781 | } | ||
2004 | 782 | |||
2005 | 783 | /* | ||
2006 | 784 | * Register the Frequency Mitigation Callback function implementation with | ||
2007 | 785 | * Frequency Manager to receive Frequency Mitigation messages from Frequency | ||
2008 | 786 | * Manager. | ||
2009 | 787 | */ | ||
2010 | 788 | int iwl_mvm_fm_register(struct iwl_mvm *mvm) | ||
2011 | 789 | { | ||
2012 | 790 | int ret; | ||
2013 | 791 | |||
2014 | 792 | if (g_mvm) | ||
2015 | 793 | return -EINVAL; | ||
2016 | 794 | |||
2017 | 795 | g_mvm = mvm; | ||
2018 | 796 | INIT_WORK(&fm_chan_notif_wk, iwl_mvm_fm_notif_chan_change_wk); | ||
2019 | 797 | |||
2020 | 798 | #ifdef CPTCFG_IWLWIFI_SUPPORT_DEBUG_OVERRIDES | ||
2021 | 799 | debug_mode = g_mvm->trans->dbg_cfg.fm_debug_mode; | ||
2022 | 800 | #else | ||
2023 | 801 | debug_mode = false; | ||
2024 | 802 | #endif | ||
2025 | 803 | |||
2026 | 804 | ret = iwl_mvm_fm_register_callback(debug_mode, IUI_FM_MACRO_ID_WLAN, | ||
2027 | 805 | iwl_mvm_fm_wlan_mitigation); | ||
2028 | 806 | |||
2029 | 807 | IWL_DEBUG_EXTERNAL(g_mvm, | ||
2030 | 808 | "FM: registering fm callback function (fail = %d)\n", | ||
2031 | 809 | ret); | ||
2032 | 810 | if (ret) | ||
2033 | 811 | g_mvm = NULL; | ||
2034 | 812 | |||
2035 | 813 | return ret ? -EINVAL : ret; | ||
2036 | 814 | } | ||
2037 | 815 | |||
2038 | 816 | /* | ||
2039 | 817 | * Unregister the Frequency Mitigation Callback function implementation | ||
2040 | 818 | */ | ||
2041 | 819 | int iwl_mvm_fm_unregister(struct iwl_mvm *mvm) | ||
2042 | 820 | { | ||
2043 | 821 | int ret; | ||
2044 | 822 | |||
2045 | 823 | if (g_mvm != mvm) | ||
2046 | 824 | return 0; | ||
2047 | 825 | |||
2048 | 826 | ret = iwl_mvm_fm_register_callback(debug_mode, IUI_FM_MACRO_ID_WLAN, | ||
2049 | 827 | NULL); | ||
2050 | 828 | |||
2051 | 829 | IWL_DEBUG_EXTERNAL(g_mvm, | ||
2052 | 830 | "FM: unregistering fm callback function (fail = %d)\n", | ||
2053 | 831 | ret); | ||
2054 | 832 | |||
2055 | 833 | cancel_work_sync(&fm_chan_notif_wk); | ||
2056 | 834 | g_mvm = NULL; | ||
2057 | 835 | |||
2058 | 836 | return ret ? -EINVAL : ret; | ||
2059 | 837 | } | ||
2060 | diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fm-test.c b/drivers/net/wireless/intel/iwlwifi/mvm/fm-test.c | |||
2061 | 838 | deleted file mode 100644 | 0 | deleted file mode 100644 |
2062 | index 385c92f..0000000 | |||
2063 | --- a/drivers/net/wireless/intel/iwlwifi/mvm/fm-test.c | |||
2064 | +++ /dev/null | |||
2065 | @@ -1,264 +0,0 @@ | |||
2066 | 1 | /****************************************************************************** | ||
2067 | 2 | * | ||
2068 | 3 | * This file is provided under a dual BSD/GPLv2 license. When using or | ||
2069 | 4 | * redistributing this file, you may do so under either license. | ||
2070 | 5 | * | ||
2071 | 6 | * GPL LICENSE SUMMARY | ||
2072 | 7 | * | ||
2073 | 8 | * Copyright(c) 2013 - 2015 Intel Corporation. All rights reserved. | ||
2074 | 9 | * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH | ||
2075 | 10 | * | ||
2076 | 11 | * This program is free software; you can redistribute it and/or modify | ||
2077 | 12 | * it under the terms of version 2 of the GNU General Public License as | ||
2078 | 13 | * published by the Free Software Foundation. | ||
2079 | 14 | * | ||
2080 | 15 | * This program is distributed in the hope that it will be useful, but | ||
2081 | 16 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
2082 | 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
2083 | 18 | * General Public License for more details. | ||
2084 | 19 | * | ||
2085 | 20 | * The full GNU General Public License is included in this distribution | ||
2086 | 21 | * in the file called COPYING. | ||
2087 | 22 | * | ||
2088 | 23 | * Contact Information: | ||
2089 | 24 | * Intel Linux Wireless <linuxwifi@intel.com> | ||
2090 | 25 | * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 | ||
2091 | 26 | * | ||
2092 | 27 | * BSD LICENSE | ||
2093 | 28 | * | ||
2094 | 29 | * Copyright(c) 2013 - 2015 Intel Corporation. All rights reserved. | ||
2095 | 30 | * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH | ||
2096 | 31 | * All rights reserved. | ||
2097 | 32 | * | ||
2098 | 33 | * Redistribution and use in source and binary forms, with or without | ||
2099 | 34 | * modification, are permitted provided that the following conditions | ||
2100 | 35 | * are met: | ||
2101 | 36 | * | ||
2102 | 37 | * * Redistributions of source code must retain the above copyright | ||
2103 | 38 | * notice, this list of conditions and the following disclaimer. | ||
2104 | 39 | * * Redistributions in binary form must reproduce the above copyright | ||
2105 | 40 | * notice, this list of conditions and the following disclaimer in | ||
2106 | 41 | * the documentation and/or other materials provided with the | ||
2107 | 42 | * distribution. | ||
2108 | 43 | * * Neither the name Intel Corporation nor the names of its | ||
2109 | 44 | * contributors may be used to endorse or promote products derived | ||
2110 | 45 | * from this software without specific prior written permission. | ||
2111 | 46 | * | ||
2112 | 47 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
2113 | 48 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
2114 | 49 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
2115 | 50 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
2116 | 51 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
2117 | 52 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
2118 | 53 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
2119 | 54 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
2120 | 55 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
2121 | 56 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
2122 | 57 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
2123 | 58 | * | ||
2124 | 59 | *****************************************************************************/ | ||
2125 | 60 | #include <linux/fm/iui_fm.h> | ||
2126 | 61 | #include <linux/kernel.h> | ||
2127 | 62 | #include <linux/debugfs.h> | ||
2128 | 63 | #include <linux/netdevice.h> | ||
2129 | 64 | |||
2130 | 65 | /* | ||
2131 | 66 | * UT framework to debug Frequency Manager on any platform. | ||
2132 | 67 | * | ||
2133 | 68 | * The framework contains stub functions & debugfs entries so the iwlwifi driver | ||
2134 | 69 | * can run the FM code without having an active FM in the background. | ||
2135 | 70 | * | ||
2136 | 71 | * FM--> iwlwifi driver API: | ||
2137 | 72 | * Done via debugfs entry: request the driver to mitigate its activity. | ||
2138 | 73 | * Through the debugfs the user can request driver to start tx power & | ||
2139 | 74 | * 2g coex mitigation. | ||
2140 | 75 | * | ||
2141 | 76 | * Iwlwfi driver-->FM API | ||
2142 | 77 | * Done via internal "stub" functions that will simulate the calls to the FM | ||
2143 | 78 | * If the debug mode is set, the calls to the real API functions are ignored, | ||
2144 | 79 | * and the stubs are called instead. | ||
2145 | 80 | * | ||
2146 | 81 | * To activate the FM debug mode you need to: | ||
2147 | 82 | * 1. Enable the IWLWIFI_FRQ_MGR_TEST config (it will enable by default the | ||
2148 | 83 | * IWLWIFI_FRQ_MGR config) | ||
2149 | 84 | * 2. add fm_debug_mode=0x1 in the file iwl-dbg-cfg.ini | ||
2150 | 85 | * | ||
2151 | 86 | * NOTE: If the platform does not have a FM then the ut will use the | ||
2152 | 87 | * include/linux/fm/iui_fm_test.h header file, otherwise it will use the | ||
2153 | 88 | * platform header file. | ||
2154 | 89 | */ | ||
2155 | 90 | |||
2156 | 91 | /* pointer to callback function in debug mode */ | ||
2157 | 92 | static iui_fm_mitigation_cb fm_callback; | ||
2158 | 93 | static struct iui_fm_wlan_info fm_notif; | ||
2159 | 94 | static struct dentry *fm_debug_dir; | ||
2160 | 95 | |||
2161 | 96 | static ssize_t | ||
2162 | 97 | iwl_mvm_fm_debug_mitigate_write(struct file *file, | ||
2163 | 98 | const char __user *user_buf, | ||
2164 | 99 | size_t count, loff_t *ppos) | ||
2165 | 100 | { | ||
2166 | 101 | struct iui_fm_mitigation mitigation; | ||
2167 | 102 | struct iui_fm_wlan_mitigation wm; | ||
2168 | 103 | char buf[128]; | ||
2169 | 104 | size_t buf_size = sizeof(buf); | ||
2170 | 105 | int mitigate_2g; | ||
2171 | 106 | int ret; | ||
2172 | 107 | int mitigate_dcdc; | ||
2173 | 108 | |||
2174 | 109 | mitigation.info.wlan_mitigation = &wm; | ||
2175 | 110 | mitigation.type = IUI_FM_MITIGATION_TYPE_WLAN; | ||
2176 | 111 | |||
2177 | 112 | if (copy_from_user(buf, user_buf, buf_size)) | ||
2178 | 113 | return -EFAULT; | ||
2179 | 114 | |||
2180 | 115 | /* All platforms that are not xmm6321 & SOFIA 3G */ | ||
2181 | 116 | if (IUI_FM_WLAN_MAX_CHANNELS == 4) { | ||
2182 | 117 | if (sscanf(buf, "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", | ||
2183 | 118 | &wm.num_channels, | ||
2184 | 119 | &wm.channel_tx_pwr[0].frequency, | ||
2185 | 120 | &wm.channel_tx_pwr[0].max_tx_pwr, | ||
2186 | 121 | &wm.channel_tx_pwr[1].frequency, | ||
2187 | 122 | &wm.channel_tx_pwr[1].max_tx_pwr, | ||
2188 | 123 | &wm.channel_tx_pwr[2].frequency, | ||
2189 | 124 | &wm.channel_tx_pwr[2].max_tx_pwr, | ||
2190 | 125 | &wm.channel_tx_pwr[3].frequency, | ||
2191 | 126 | &wm.channel_tx_pwr[3].max_tx_pwr, | ||
2192 | 127 | &mitigate_dcdc, | ||
2193 | 128 | &wm.dcdc_div0, | ||
2194 | 129 | &wm.dcdc_div1, | ||
2195 | 130 | &mitigate_2g, | ||
2196 | 131 | &wm.wlan_2g_coex_enable) != 14) | ||
2197 | 132 | return -EINVAL; | ||
2198 | 133 | } else if (sscanf(buf, "%d,%d,%d,%d,%d", &wm.num_channels, | ||
2199 | 134 | &wm.channel_tx_pwr[0].frequency, | ||
2200 | 135 | &wm.channel_tx_pwr[0].max_tx_pwr, | ||
2201 | 136 | &wm.channel_tx_pwr[1].frequency, | ||
2202 | 137 | &wm.channel_tx_pwr[1].max_tx_pwr) != 5) { | ||
2203 | 138 | return -EINVAL; | ||
2204 | 139 | } | ||
2205 | 140 | |||
2206 | 141 | if (IUI_FM_WLAN_MAX_CHANNELS < wm.num_channels) | ||
2207 | 142 | return -EINVAL; | ||
2208 | 143 | |||
2209 | 144 | wm.wlan_adc_dac_freq = 0; | ||
2210 | 145 | wm.rx_gain_behavior = IUI_FM_WLAN_RX_GAIN_NORMAL; | ||
2211 | 146 | |||
2212 | 147 | wm.bitmask = 0; | ||
2213 | 148 | |||
2214 | 149 | /* Set bit bitmask to indicate the required mitigations */ | ||
2215 | 150 | if (wm.num_channels || mitigate_2g) | ||
2216 | 151 | wm.bitmask |= WLAN_MITI; | ||
2217 | 152 | if (mitigate_dcdc) | ||
2218 | 153 | wm.bitmask |= DCDC_MITI; | ||
2219 | 154 | |||
2220 | 155 | ret = fm_callback(IUI_FM_MACRO_ID_WLAN, &mitigation, 0); | ||
2221 | 156 | pr_info("FM[test-mode]: mitigation callback %s (bitmask = 0x%x)\n", | ||
2222 | 157 | ret ? "failed" : "succeeded", wm.bitmask); | ||
2223 | 158 | |||
2224 | 159 | return count; | ||
2225 | 160 | } | ||
2226 | 161 | |||
2227 | 162 | static ssize_t | ||
2228 | 163 | iwl_mvm_fm_debug_notify_read(struct file *file, char __user *userbuf, | ||
2229 | 164 | size_t count, loff_t *ppos) | ||
2230 | 165 | { | ||
2231 | 166 | char buf[512]; | ||
2232 | 167 | int bufsz = sizeof(buf); | ||
2233 | 168 | int pos = 0; | ||
2234 | 169 | u8 i; | ||
2235 | 170 | |||
2236 | 171 | pos += scnprintf(buf + pos, bufsz - pos, "num_channels=%d\n", | ||
2237 | 172 | fm_notif.num_channels); | ||
2238 | 173 | for (i = 0; i < fm_notif.num_channels; i++) | ||
2239 | 174 | pos += scnprintf(buf + pos, bufsz - pos, | ||
2240 | 175 | "channel=%d, bandwidth=%d\n", | ||
2241 | 176 | fm_notif.channel_info[i].frequency, | ||
2242 | 177 | fm_notif.channel_info[i].bandwidth); | ||
2243 | 178 | |||
2244 | 179 | pos += scnprintf(buf + pos, bufsz - pos, "dcdc_div0=%d\n", | ||
2245 | 180 | fm_notif.dcdc_div0); | ||
2246 | 181 | pos += scnprintf(buf + pos, bufsz - pos, "dcdc_div1=%d\n", | ||
2247 | 182 | fm_notif.dcdc_div1); | ||
2248 | 183 | |||
2249 | 184 | return simple_read_from_buffer(userbuf, count, ppos, buf, pos); | ||
2250 | 185 | } | ||
2251 | 186 | |||
2252 | 187 | static const struct file_operations fm_debug_mitigate_ops = { | ||
2253 | 188 | .write = iwl_mvm_fm_debug_mitigate_write, | ||
2254 | 189 | .open = simple_open, | ||
2255 | 190 | .llseek = generic_file_llseek, | ||
2256 | 191 | }; | ||
2257 | 192 | |||
2258 | 193 | static const struct file_operations fm_debug_notify_ops = { | ||
2259 | 194 | .read = iwl_mvm_fm_debug_notify_read, | ||
2260 | 195 | .open = simple_open, | ||
2261 | 196 | .llseek = generic_file_llseek, | ||
2262 | 197 | }; | ||
2263 | 198 | |||
2264 | 199 | static int iwl_mvm_fm_create_debugfs(void) | ||
2265 | 200 | { | ||
2266 | 201 | struct dentry *entry; | ||
2267 | 202 | |||
2268 | 203 | fm_debug_dir = debugfs_create_dir("frq_mgr", NULL); | ||
2269 | 204 | |||
2270 | 205 | if (!fm_debug_dir) | ||
2271 | 206 | goto err; | ||
2272 | 207 | |||
2273 | 208 | entry = debugfs_create_file("mitigate", S_IWUSR, fm_debug_dir, | ||
2274 | 209 | NULL, &fm_debug_mitigate_ops); | ||
2275 | 210 | if (!entry) | ||
2276 | 211 | goto err; | ||
2277 | 212 | |||
2278 | 213 | entry = debugfs_create_file("notify", S_IRUSR, fm_debug_dir, | ||
2279 | 214 | NULL, &fm_debug_notify_ops); | ||
2280 | 215 | if (!entry) | ||
2281 | 216 | goto err; | ||
2282 | 217 | |||
2283 | 218 | return 0; | ||
2284 | 219 | err: | ||
2285 | 220 | pr_info("FM: Could not create debugfs entries\n"); | ||
2286 | 221 | debugfs_remove_recursive(fm_debug_dir); | ||
2287 | 222 | return -1; | ||
2288 | 223 | } | ||
2289 | 224 | |||
2290 | 225 | int32_t | ||
2291 | 226 | iwl_mvm_fm_test_register_callback(const enum iui_fm_macro_id macro_id, | ||
2292 | 227 | const iui_fm_mitigation_cb mitigation_cb) | ||
2293 | 228 | { | ||
2294 | 229 | int ret = 0; | ||
2295 | 230 | |||
2296 | 231 | fm_callback = mitigation_cb; | ||
2297 | 232 | |||
2298 | 233 | /* Unregister fm callback */ | ||
2299 | 234 | if (!mitigation_cb) { | ||
2300 | 235 | debugfs_remove_recursive(fm_debug_dir); | ||
2301 | 236 | goto end; | ||
2302 | 237 | } | ||
2303 | 238 | |||
2304 | 239 | /* Register fm callback */ | ||
2305 | 240 | if (iwl_mvm_fm_create_debugfs()) { | ||
2306 | 241 | ret = -1; | ||
2307 | 242 | goto end; | ||
2308 | 243 | } | ||
2309 | 244 | |||
2310 | 245 | end: | ||
2311 | 246 | pr_info("FM[test-mode]: %sregistering fm callback function (fail = %d)\n", | ||
2312 | 247 | ret ? "un" : "", ret); | ||
2313 | 248 | return ret; | ||
2314 | 249 | } | ||
2315 | 250 | |||
2316 | 251 | int32_t | ||
2317 | 252 | iwl_mvm_fm_test_notify_frequency(const enum iui_fm_macro_id macro_id, | ||
2318 | 253 | const struct iui_fm_freq_notification * | ||
2319 | 254 | const notification) | ||
2320 | 255 | { | ||
2321 | 256 | /* Platform does not have a FM or test mode was requested */ | ||
2322 | 257 | memcpy(&fm_notif, notification->info.wlan_info, | ||
2323 | 258 | sizeof(struct iui_fm_wlan_info)); | ||
2324 | 259 | |||
2325 | 260 | pr_info("FM[test-mode]: notifying fm about change (mask = 0x%x)\n", | ||
2326 | 261 | notification->info.wlan_info->bitmask); | ||
2327 | 262 | |||
2328 | 263 | return 0; | ||
2329 | 264 | } | ||
2330 | diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c | |||
2331 | index 8ce91d4..bb2ad8b 100644 | |||
2332 | --- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c | |||
2333 | +++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c | |||
2334 | @@ -1244,13 +1244,8 @@ static int iwl_mvm_load_rt_fw(struct iwl_mvm *mvm) | |||
2335 | 1244 | } | 1244 | } |
2336 | 1245 | 1245 | ||
2337 | 1246 | iwl_fw_dbg_stop_sync(&mvm->fwrt); | 1246 | iwl_fw_dbg_stop_sync(&mvm->fwrt); |
2345 | 1247 | /* | 1247 | iwl_trans_stop_device(mvm->trans); |
2346 | 1248 | * Stop and start the transport without entering low power | 1248 | ret = iwl_trans_start_hw(mvm->trans); |
2340 | 1249 | * mode. This will save the state of other components on the | ||
2341 | 1250 | * device that are triggered by the INIT firwmare (MFUART). | ||
2342 | 1251 | */ | ||
2343 | 1252 | _iwl_trans_stop_device(mvm->trans, false); | ||
2344 | 1253 | ret = _iwl_trans_start_hw(mvm->trans, false); | ||
2347 | 1254 | if (ret) | 1249 | if (ret) |
2348 | 1255 | return ret; | 1250 | return ret; |
2349 | 1256 | 1251 | ||
2350 | @@ -1422,7 +1417,6 @@ int iwl_mvm_up(struct iwl_mvm *mvm) | |||
2351 | 1422 | goto error; | 1417 | goto error; |
2352 | 1423 | } | 1418 | } |
2353 | 1424 | 1419 | ||
2354 | 1425 | #ifdef CONFIG_THERMAL | ||
2355 | 1426 | if (iwl_mvm_is_tt_in_fw(mvm)) { | 1420 | if (iwl_mvm_is_tt_in_fw(mvm)) { |
2356 | 1427 | /* in order to give the responsibility of ct-kill and | 1421 | /* in order to give the responsibility of ct-kill and |
2357 | 1428 | * TX backoff to FW we need to send empty temperature reporting | 1422 | * TX backoff to FW we need to send empty temperature reporting |
2358 | @@ -1434,6 +1428,7 @@ int iwl_mvm_up(struct iwl_mvm *mvm) | |||
2359 | 1434 | iwl_mvm_tt_tx_backoff(mvm, 0); | 1428 | iwl_mvm_tt_tx_backoff(mvm, 0); |
2360 | 1435 | } | 1429 | } |
2361 | 1436 | 1430 | ||
2362 | 1431 | #ifdef CONFIG_THERMAL | ||
2363 | 1437 | /* TODO: read the budget from BIOS / Platform NVM */ | 1432 | /* TODO: read the budget from BIOS / Platform NVM */ |
2364 | 1438 | 1433 | ||
2365 | 1439 | /* | 1434 | /* |
2366 | @@ -1446,9 +1441,6 @@ int iwl_mvm_up(struct iwl_mvm *mvm) | |||
2367 | 1446 | if (ret) | 1441 | if (ret) |
2368 | 1447 | goto error; | 1442 | goto error; |
2369 | 1448 | } | 1443 | } |
2370 | 1449 | #else | ||
2371 | 1450 | /* Initialize tx backoffs to the minimal possible */ | ||
2372 | 1451 | iwl_mvm_tt_tx_backoff(mvm, 0); | ||
2373 | 1452 | #endif | 1444 | #endif |
2374 | 1453 | 1445 | ||
2375 | 1454 | if (!fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_SET_LTR_GEN2)) | 1446 | if (!fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_SET_LTR_GEN2)) |
2376 | @@ -1479,10 +1471,6 @@ int iwl_mvm_up(struct iwl_mvm *mvm) | |||
2377 | 1479 | if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) | 1471 | if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) |
2378 | 1480 | iwl_mvm_send_recovery_cmd(mvm, ERROR_RECOVERY_UPDATE_DB); | 1472 | iwl_mvm_send_recovery_cmd(mvm, ERROR_RECOVERY_UPDATE_DB); |
2379 | 1481 | 1473 | ||
2380 | 1482 | #ifdef CPTCFG_IWLWIFI_LTE_COEX | ||
2381 | 1483 | iwl_mvm_send_lte_commands(mvm); | ||
2382 | 1484 | #endif | ||
2383 | 1485 | |||
2384 | 1486 | #ifdef CPTCFG_IWLMVM_VENDOR_CMDS | 1474 | #ifdef CPTCFG_IWLMVM_VENDOR_CMDS |
2385 | 1487 | /* set_mode must be IWL_TX_POWER_MODE_SET_DEVICE if this was | 1475 | /* set_mode must be IWL_TX_POWER_MODE_SET_DEVICE if this was |
2386 | 1488 | * ever initialized. | 1476 | * ever initialized. |
2387 | @@ -1506,10 +1494,6 @@ int iwl_mvm_up(struct iwl_mvm *mvm) | |||
2388 | 1506 | } | 1494 | } |
2389 | 1507 | #endif | 1495 | #endif |
2390 | 1508 | 1496 | ||
2391 | 1509 | #ifdef CPTCFG_IWLWIFI_FRQ_MGR | ||
2392 | 1510 | iwl_mvm_fm_notify_current_dcdc(); | ||
2393 | 1511 | #endif | ||
2394 | 1512 | |||
2395 | 1513 | if (iwl_acpi_get_eckv(mvm->dev, &mvm->ext_clock_valid)) | 1497 | if (iwl_acpi_get_eckv(mvm->dev, &mvm->ext_clock_valid)) |
2396 | 1514 | IWL_DEBUG_INFO(mvm, "ECKV table doesn't exist in BIOS\n"); | 1498 | IWL_DEBUG_INFO(mvm, "ECKV table doesn't exist in BIOS\n"); |
2397 | 1515 | 1499 | ||
2398 | diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/lte-coex.h b/drivers/net/wireless/intel/iwlwifi/mvm/lte-coex.h | |||
2399 | 1516 | deleted file mode 100644 | 1500 | deleted file mode 100644 |
2400 | index 5bf99ee..0000000 | |||
2401 | --- a/drivers/net/wireless/intel/iwlwifi/mvm/lte-coex.h | |||
2402 | +++ /dev/null | |||
2403 | @@ -1,125 +0,0 @@ | |||
2404 | 1 | /****************************************************************************** | ||
2405 | 2 | * | ||
2406 | 3 | * This file is provided under a dual BSD/GPLv2 license. When using or | ||
2407 | 4 | * redistributing this file, you may do so under either license. | ||
2408 | 5 | * | ||
2409 | 6 | * GPL LICENSE SUMMARY | ||
2410 | 7 | * | ||
2411 | 8 | * Copyright(c) 2014 Intel Corporation. All rights reserved. | ||
2412 | 9 | * Copyright(c) 2014 Intel Mobile Communications GmbH | ||
2413 | 10 | * | ||
2414 | 11 | * This program is free software; you can redistribute it and/or modify | ||
2415 | 12 | * it under the terms of version 2 of the GNU General Public License as | ||
2416 | 13 | * published by the Free Software Foundation. | ||
2417 | 14 | * | ||
2418 | 15 | * This program is distributed in the hope that it will be useful, but | ||
2419 | 16 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
2420 | 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
2421 | 18 | * General Public License for more details. | ||
2422 | 19 | * | ||
2423 | 20 | * The full GNU General Public License is included in this distribution | ||
2424 | 21 | * in the file called COPYING. | ||
2425 | 22 | * | ||
2426 | 23 | * Contact Information: | ||
2427 | 24 | * Intel Linux Wireless <linuxwifi@intel.com> | ||
2428 | 25 | * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 | ||
2429 | 26 | * | ||
2430 | 27 | * BSD LICENSE | ||
2431 | 28 | * | ||
2432 | 29 | * Copyright(c) 2014 Intel Corporation. All rights reserved. | ||
2433 | 30 | * Copyright(c) 2014 Intel Mobile Communications GmbH | ||
2434 | 31 | * All rights reserved. | ||
2435 | 32 | * | ||
2436 | 33 | * Redistribution and use in source and binary forms, with or without | ||
2437 | 34 | * modification, are permitted provided that the following conditions | ||
2438 | 35 | * are met: | ||
2439 | 36 | * | ||
2440 | 37 | * * Redistributions of source code must retain the above copyright | ||
2441 | 38 | * notice, this list of conditions and the following disclaimer. | ||
2442 | 39 | * * Redistributions in binary form must reproduce the above copyright | ||
2443 | 40 | * notice, this list of conditions and the following disclaimer in | ||
2444 | 41 | * the documentation and/or other materials provided with the | ||
2445 | 42 | * distribution. | ||
2446 | 43 | * * Neither the name Intel Corporation nor the names of its | ||
2447 | 44 | * contributors may be used to endorse or promote products derived | ||
2448 | 45 | * from this software without specific prior written permission. | ||
2449 | 46 | * | ||
2450 | 47 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
2451 | 48 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
2452 | 49 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
2453 | 50 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
2454 | 51 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
2455 | 52 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
2456 | 53 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
2457 | 54 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
2458 | 55 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
2459 | 56 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
2460 | 57 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
2461 | 58 | * | ||
2462 | 59 | *****************************************************************************/ | ||
2463 | 60 | |||
2464 | 61 | #ifndef __coex_h__ | ||
2465 | 62 | #define __coex_h__ | ||
2466 | 63 | |||
2467 | 64 | #include <linux/types.h> | ||
2468 | 65 | |||
2469 | 66 | /* LTE-Coex protocol user space commands */ | ||
2470 | 67 | |||
2471 | 68 | #define LTE_OFF 0 | ||
2472 | 69 | #define LTE_IDLE 1 | ||
2473 | 70 | #define LTE_CONNECTED 2 | ||
2474 | 71 | |||
2475 | 72 | /* LTE-Coex error codes */ | ||
2476 | 73 | |||
2477 | 74 | #define LTE_OK 0 | ||
2478 | 75 | /* LTE state machine violation */ | ||
2479 | 76 | #define LTE_STATE_ERR 1 | ||
2480 | 77 | #define LTE_ILLEGAL_PARAMS 2 | ||
2481 | 78 | #define LTE_INVALID_DATA 3 | ||
2482 | 79 | #define LTE_OTHER_ERR 4 | ||
2483 | 80 | |||
2484 | 81 | |||
2485 | 82 | struct lte_coex_state_cmd { | ||
2486 | 83 | __u8 lte_state; | ||
2487 | 84 | } __packed; | ||
2488 | 85 | |||
2489 | 86 | #define LTE_MWS_CONF_LENGTH 12 | ||
2490 | 87 | #define LTE_SAFE_PT_LENGTH 32 | ||
2491 | 88 | #define LTE_SAFE_PT_FIRST -128 | ||
2492 | 89 | #define LTE_SAFE_PT_LAST 127 | ||
2493 | 90 | struct lte_coex_config_info_cmd { | ||
2494 | 91 | __u32 mws_conf_data[LTE_MWS_CONF_LENGTH]; | ||
2495 | 92 | __s8 safe_power_table[LTE_SAFE_PT_LENGTH]; | ||
2496 | 93 | } __packed; | ||
2497 | 94 | |||
2498 | 95 | #define LTE_CONNECTED_BANDS_LENGTH 8 | ||
2499 | 96 | #define LTE_FRAME_STRUCT_LENGTH 2 | ||
2500 | 97 | #define LTE_TX_POWER_LENGTH 14 | ||
2501 | 98 | #define LTE_FRQ_MIN 2400 | ||
2502 | 99 | #define LTE_FRQ_MAX 2500 | ||
2503 | 100 | #define LTE_MAX_TX_MIN 0 | ||
2504 | 101 | #define LTE_MAX_TX_MAX 31 | ||
2505 | 102 | struct lte_coex_dynamic_info_cmd { | ||
2506 | 103 | __u32 lte_connected_bands[LTE_CONNECTED_BANDS_LENGTH]; | ||
2507 | 104 | __u32 lte_frame_structure[LTE_FRAME_STRUCT_LENGTH]; | ||
2508 | 105 | __u16 wifi_tx_safe_freq_min; | ||
2509 | 106 | __u16 wifi_tx_safe_freq_max; | ||
2510 | 107 | __u16 wifi_rx_safe_freq_min; | ||
2511 | 108 | __u16 wifi_rx_safe_freq_max; | ||
2512 | 109 | __u8 wifi_max_tx_power[LTE_TX_POWER_LENGTH]; | ||
2513 | 110 | } __packed; | ||
2514 | 111 | |||
2515 | 112 | struct lte_coex_sps_info_cmd { | ||
2516 | 113 | __u32 sps_info; | ||
2517 | 114 | } __packed; | ||
2518 | 115 | |||
2519 | 116 | #define LTE_RC_CHAN_MIN 1 | ||
2520 | 117 | #define LTE_RC_CHAN_MAX 14 | ||
2521 | 118 | #define LTE_RC_BW_MIN 0 | ||
2522 | 119 | #define LTE_RC_BW_MAX 3 | ||
2523 | 120 | struct lte_coex_wifi_reported_chan_cmd { | ||
2524 | 121 | __u8 chan; | ||
2525 | 122 | __u8 bandwidth; | ||
2526 | 123 | } __packed; | ||
2527 | 124 | |||
2528 | 125 | #endif /* __coex_h__ */ | ||
2529 | diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c | |||
2530 | index 9c26dd4..ebcacd1 100644 | |||
2531 | --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c | |||
2532 | +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c | |||
2533 | @@ -633,6 +633,8 @@ static int iwl_mvm_mac_ctxt_cmd_sta(struct iwl_mvm *mvm, | |||
2534 | 633 | /* We need the dtim_period to set the MAC as associated */ | 633 | /* We need the dtim_period to set the MAC as associated */ |
2535 | 634 | if (vif->bss_conf.assoc && vif->bss_conf.dtim_period && | 634 | if (vif->bss_conf.assoc && vif->bss_conf.dtim_period && |
2536 | 635 | !force_assoc_off) { | 635 | !force_assoc_off) { |
2537 | 636 | struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); | ||
2538 | 637 | u8 ap_sta_id = mvmvif->ap_sta_id; | ||
2539 | 636 | u32 dtim_offs; | 638 | u32 dtim_offs; |
2540 | 637 | 639 | ||
2541 | 638 | /* | 640 | /* |
2542 | @@ -668,7 +670,29 @@ static int iwl_mvm_mac_ctxt_cmd_sta(struct iwl_mvm *mvm, | |||
2543 | 668 | dtim_offs); | 670 | dtim_offs); |
2544 | 669 | 671 | ||
2545 | 670 | ctxt_sta->is_assoc = cpu_to_le32(1); | 672 | ctxt_sta->is_assoc = cpu_to_le32(1); |
2547 | 671 | cmd.filter_flags |= cpu_to_le32(MAC_FILTER_ACCEPT_GRP); | 673 | |
2548 | 674 | /* | ||
2549 | 675 | * allow multicast data frames only as long as the station is | ||
2550 | 676 | * authorized, i.e., GTK keys are already installed (if needed) | ||
2551 | 677 | */ | ||
2552 | 678 | if (ap_sta_id < IWL_MVM_STATION_COUNT) { | ||
2553 | 679 | struct ieee80211_sta *sta; | ||
2554 | 680 | |||
2555 | 681 | rcu_read_lock(); | ||
2556 | 682 | |||
2557 | 683 | sta = rcu_dereference(mvm->fw_id_to_mac_id[ap_sta_id]); | ||
2558 | 684 | if (!IS_ERR_OR_NULL(sta)) { | ||
2559 | 685 | struct iwl_mvm_sta *mvmsta = | ||
2560 | 686 | iwl_mvm_sta_from_mac80211(sta); | ||
2561 | 687 | |||
2562 | 688 | if (mvmsta->sta_state == | ||
2563 | 689 | IEEE80211_STA_AUTHORIZED) | ||
2564 | 690 | cmd.filter_flags |= | ||
2565 | 691 | cpu_to_le32(MAC_FILTER_ACCEPT_GRP); | ||
2566 | 692 | } | ||
2567 | 693 | |||
2568 | 694 | rcu_read_unlock(); | ||
2569 | 695 | } | ||
2570 | 672 | } else { | 696 | } else { |
2571 | 673 | ctxt_sta->is_assoc = cpu_to_le32(0); | 697 | ctxt_sta->is_assoc = cpu_to_le32(0); |
2572 | 674 | 698 | ||
2573 | diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | |||
2574 | index 60a345c..c610056 100644 | |||
2575 | --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | |||
2576 | +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | |||
2577 | @@ -1124,15 +1124,6 @@ static void iwl_mvm_restart_cleanup(struct iwl_mvm *mvm) | |||
2578 | 1124 | mvm->ps_disabled = false; | 1124 | mvm->ps_disabled = false; |
2579 | 1125 | mvm->rfkill_safe_init_done = false; | 1125 | mvm->rfkill_safe_init_done = false; |
2580 | 1126 | 1126 | ||
2581 | 1127 | #ifdef CPTCFG_IWLWIFI_FRQ_MGR | ||
2582 | 1128 | /* | ||
2583 | 1129 | * In case that 2g coex was enabled - and now the FW is being | ||
2584 | 1130 | * restarted, we need to disable 2g coex mode in the driver as well | ||
2585 | 1131 | * so that the fw & driver will be synced on the mode. | ||
2586 | 1132 | */ | ||
2587 | 1133 | mvm->coex_2g_enabled = false; | ||
2588 | 1134 | #endif | ||
2589 | 1135 | |||
2590 | 1136 | /* just in case one was running */ | 1127 | /* just in case one was running */ |
2591 | 1137 | iwl_mvm_cleanup_roc_te(mvm); | 1128 | iwl_mvm_cleanup_roc_te(mvm); |
2592 | 1138 | ieee80211_remain_on_channel_expired(mvm->hw); | 1129 | ieee80211_remain_on_channel_expired(mvm->hw); |
2593 | @@ -1368,18 +1359,6 @@ static int iwl_mvm_set_tx_power(struct iwl_mvm *mvm, struct ieee80211_vif *vif, | |||
2594 | 1368 | .v5.v3.pwr_restriction = cpu_to_le16(8 * tx_power), | 1359 | .v5.v3.pwr_restriction = cpu_to_le16(8 * tx_power), |
2595 | 1369 | }; | 1360 | }; |
2596 | 1370 | 1361 | ||
2597 | 1371 | #ifdef CPTCFG_IWLWIFI_FRQ_MGR | ||
2598 | 1372 | struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); | ||
2599 | 1373 | |||
2600 | 1374 | /* | ||
2601 | 1375 | * if set Tx power request did not come from Frequency Manager(FM) | ||
2602 | 1376 | * Take minimum between wanted Tx power to FM Tx power limit | ||
2603 | 1377 | */ | ||
2604 | 1378 | if (mvmvif->phy_ctxt && tx_power > mvmvif->phy_ctxt->fm_tx_power_limit) | ||
2605 | 1379 | cmd.v5.v3.pwr_restriction = | ||
2606 | 1380 | cpu_to_le16(mvmvif->phy_ctxt->fm_tx_power_limit); | ||
2607 | 1381 | #endif | ||
2608 | 1382 | |||
2609 | 1383 | if (tx_power == IWL_DEFAULT_MAX_TX_POWER) | 1362 | if (tx_power == IWL_DEFAULT_MAX_TX_POWER) |
2610 | 1384 | cmd.v5.v3.pwr_restriction = cpu_to_le16(IWL_DEV_MAX_TX_POWER); | 1363 | cmd.v5.v3.pwr_restriction = cpu_to_le16(IWL_DEV_MAX_TX_POWER); |
2611 | 1385 | 1364 | ||
2612 | @@ -1395,35 +1374,6 @@ static int iwl_mvm_set_tx_power(struct iwl_mvm *mvm, struct ieee80211_vif *vif, | |||
2613 | 1395 | return iwl_mvm_send_cmd_pdu(mvm, REDUCE_TX_POWER_CMD, 0, len, &cmd); | 1374 | return iwl_mvm_send_cmd_pdu(mvm, REDUCE_TX_POWER_CMD, 0, len, &cmd); |
2614 | 1396 | } | 1375 | } |
2615 | 1397 | 1376 | ||
2616 | 1398 | #ifdef CPTCFG_IWLWIFI_FRQ_MGR | ||
2617 | 1399 | int iwl_mvm_fm_set_tx_power(struct iwl_mvm *mvm, struct ieee80211_vif *vif, | ||
2618 | 1400 | s8 txpower) | ||
2619 | 1401 | { | ||
2620 | 1402 | int ret; | ||
2621 | 1403 | |||
2622 | 1404 | mutex_lock(&mvm->mutex); | ||
2623 | 1405 | /* set Tx power to min between drivers limit and FM limit */ | ||
2624 | 1406 | ret = iwl_mvm_set_tx_power(mvm, vif, min_t(s8, txpower, | ||
2625 | 1407 | vif->bss_conf.txpower)); | ||
2626 | 1408 | mutex_unlock(&mvm->mutex); | ||
2627 | 1409 | return ret; | ||
2628 | 1410 | } | ||
2629 | 1411 | |||
2630 | 1412 | /* | ||
2631 | 1413 | * Updates Tx power limitation for the mac if FM has already limited | ||
2632 | 1414 | * the Tx power on the channel that this mac is using. | ||
2633 | 1415 | */ | ||
2634 | 1416 | static void iwl_mvm_update_ctx_tx_power_limit(struct iwl_mvm *mvm, | ||
2635 | 1417 | struct ieee80211_vif *vif, | ||
2636 | 1418 | struct iwl_mvm_phy_ctxt *phy_ctxt) | ||
2637 | 1419 | { | ||
2638 | 1420 | /* Tx power has not been limited by FM */ | ||
2639 | 1421 | if (phy_ctxt->fm_tx_power_limit == IWL_DEFAULT_MAX_TX_POWER) | ||
2640 | 1422 | return; | ||
2641 | 1423 | iwl_mvm_set_tx_power(mvm, vif, phy_ctxt->fm_tx_power_limit); | ||
2642 | 1424 | } | ||
2643 | 1425 | #endif | ||
2644 | 1426 | |||
2645 | 1427 | static int iwl_mvm_post_channel_switch(struct ieee80211_hw *hw, | 1377 | static int iwl_mvm_post_channel_switch(struct ieee80211_hw *hw, |
2646 | 1428 | struct ieee80211_vif *vif) | 1378 | struct ieee80211_vif *vif) |
2647 | 1429 | { | 1379 | { |
2648 | @@ -1620,10 +1570,6 @@ static int iwl_mvm_mac_add_interface(struct ieee80211_hw *hw, | |||
2649 | 1620 | if (ret) | 1570 | if (ret) |
2650 | 1621 | goto out_unref_phy; | 1571 | goto out_unref_phy; |
2651 | 1622 | 1572 | ||
2652 | 1623 | #ifdef CPTCFG_IWLWIFI_FRQ_MGR | ||
2653 | 1624 | iwl_mvm_update_ctx_tx_power_limit(mvm, vif, mvmvif->phy_ctxt); | ||
2654 | 1625 | #endif | ||
2655 | 1626 | |||
2656 | 1627 | ret = iwl_mvm_add_p2p_bcast_sta(mvm, vif); | 1573 | ret = iwl_mvm_add_p2p_bcast_sta(mvm, vif); |
2657 | 1628 | if (ret) | 1574 | if (ret) |
2658 | 1629 | goto out_unbind; | 1575 | goto out_unbind; |
2659 | @@ -2647,10 +2593,6 @@ static int iwl_mvm_start_ap_ibss(struct ieee80211_hw *hw, | |||
2660 | 2647 | if (ret) | 2593 | if (ret) |
2661 | 2648 | goto out_remove; | 2594 | goto out_remove; |
2662 | 2649 | 2595 | ||
2663 | 2650 | #ifdef CPTCFG_IWLWIFI_FRQ_MGR | ||
2664 | 2651 | iwl_mvm_update_ctx_tx_power_limit(mvm, vif, mvmvif->phy_ctxt); | ||
2665 | 2652 | #endif | ||
2666 | 2653 | |||
2667 | 2654 | /* | 2596 | /* |
2668 | 2655 | * This is not very nice, but the simplest: | 2597 | * This is not very nice, but the simplest: |
2669 | 2656 | * For older FWs adding the mcast sta before the bcast station may | 2598 | * For older FWs adding the mcast sta before the bcast station may |
2670 | @@ -3323,10 +3265,20 @@ static int iwl_mvm_mac_sta_state(struct ieee80211_hw *hw, | |||
2671 | 3323 | /* enable beacon filtering */ | 3265 | /* enable beacon filtering */ |
2672 | 3324 | WARN_ON(iwl_mvm_enable_beacon_filter(mvm, vif, 0)); | 3266 | WARN_ON(iwl_mvm_enable_beacon_filter(mvm, vif, 0)); |
2673 | 3325 | 3267 | ||
2674 | 3268 | /* | ||
2675 | 3269 | * Now that the station is authorized, i.e., keys were already | ||
2676 | 3270 | * installed, need to indicate to the FW that | ||
2677 | 3271 | * multicast data frames can be forwarded to the driver | ||
2678 | 3272 | */ | ||
2679 | 3273 | iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL); | ||
2680 | 3274 | |||
2681 | 3326 | iwl_mvm_rs_rate_init(mvm, sta, mvmvif->phy_ctxt->channel->band, | 3275 | iwl_mvm_rs_rate_init(mvm, sta, mvmvif->phy_ctxt->channel->band, |
2682 | 3327 | true); | 3276 | true); |
2683 | 3328 | } else if (old_state == IEEE80211_STA_AUTHORIZED && | 3277 | } else if (old_state == IEEE80211_STA_AUTHORIZED && |
2684 | 3329 | new_state == IEEE80211_STA_ASSOC) { | 3278 | new_state == IEEE80211_STA_ASSOC) { |
2685 | 3279 | /* Multicast data frames are no longer allowed */ | ||
2686 | 3280 | iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL); | ||
2687 | 3281 | |||
2688 | 3330 | /* disable beacon filtering */ | 3282 | /* disable beacon filtering */ |
2689 | 3331 | ret = iwl_mvm_disable_beacon_filter(mvm, vif, 0); | 3283 | ret = iwl_mvm_disable_beacon_filter(mvm, vif, 0); |
2690 | 3332 | WARN_ON(ret && | 3284 | WARN_ON(ret && |
2691 | @@ -4083,10 +4035,6 @@ static int __iwl_mvm_add_chanctx(struct iwl_mvm *mvm, | |||
2692 | 4083 | iwl_mvm_phy_ctxt_ref(mvm, phy_ctxt); | 4035 | iwl_mvm_phy_ctxt_ref(mvm, phy_ctxt); |
2693 | 4084 | *phy_ctxt_id = phy_ctxt->id; | 4036 | *phy_ctxt_id = phy_ctxt->id; |
2694 | 4085 | 4037 | ||
2695 | 4086 | #ifdef CPTCFG_IWLWIFI_FRQ_MGR | ||
2696 | 4087 | iwl_mvm_fm_notify_channel_change(ctx, IWL_FM_ADD_CHANCTX); | ||
2697 | 4088 | #endif | ||
2698 | 4089 | |||
2699 | 4090 | out: | 4038 | out: |
2700 | 4091 | return ret; | 4039 | return ret; |
2701 | 4092 | } | 4040 | } |
2702 | @@ -4113,9 +4061,6 @@ static void __iwl_mvm_remove_chanctx(struct iwl_mvm *mvm, | |||
2703 | 4113 | lockdep_assert_held(&mvm->mutex); | 4061 | lockdep_assert_held(&mvm->mutex); |
2704 | 4114 | 4062 | ||
2705 | 4115 | iwl_mvm_phy_ctxt_unref(mvm, phy_ctxt); | 4063 | iwl_mvm_phy_ctxt_unref(mvm, phy_ctxt); |
2706 | 4116 | #ifdef CPTCFG_IWLWIFI_FRQ_MGR | ||
2707 | 4117 | iwl_mvm_fm_notify_channel_change(ctx, IWL_FM_REMOVE_CHANCTX); | ||
2708 | 4118 | #endif | ||
2709 | 4119 | } | 4064 | } |
2710 | 4120 | 4065 | ||
2711 | 4121 | static void iwl_mvm_remove_chanctx(struct ieee80211_hw *hw, | 4066 | static void iwl_mvm_remove_chanctx(struct ieee80211_hw *hw, |
2712 | @@ -4164,9 +4109,6 @@ static void iwl_mvm_change_chanctx(struct ieee80211_hw *hw, | |||
2713 | 4164 | iwl_mvm_phy_ctxt_changed(mvm, phy_ctxt, def, | 4109 | iwl_mvm_phy_ctxt_changed(mvm, phy_ctxt, def, |
2714 | 4165 | ctx->rx_chains_static, | 4110 | ctx->rx_chains_static, |
2715 | 4166 | ctx->rx_chains_dynamic); | 4111 | ctx->rx_chains_dynamic); |
2716 | 4167 | #ifdef CPTCFG_IWLWIFI_FRQ_MGR | ||
2717 | 4168 | iwl_mvm_fm_notify_channel_change(ctx, IWL_FM_CHANGE_CHANCTX); | ||
2718 | 4169 | #endif | ||
2719 | 4170 | 4112 | ||
2720 | 4171 | out_unlock: | 4113 | out_unlock: |
2721 | 4172 | mutex_unlock(&mvm->mutex); | 4114 | mutex_unlock(&mvm->mutex); |
2722 | @@ -4217,10 +4159,6 @@ static int __iwl_mvm_assign_vif_chanctx(struct iwl_mvm *mvm, | |||
2723 | 4217 | if (ret) | 4159 | if (ret) |
2724 | 4218 | goto out; | 4160 | goto out; |
2725 | 4219 | 4161 | ||
2726 | 4220 | #ifdef CPTCFG_IWLWIFI_FRQ_MGR | ||
2727 | 4221 | iwl_mvm_update_ctx_tx_power_limit(mvm, vif, mvmvif->phy_ctxt); | ||
2728 | 4222 | #endif | ||
2729 | 4223 | |||
2730 | 4224 | /* | 4162 | /* |
2731 | 4225 | * Power state must be updated before quotas, | 4163 | * Power state must be updated before quotas, |
2732 | 4226 | * otherwise fw will complain. | 4164 | * otherwise fw will complain. |
2733 | diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | |||
2734 | index 372e86e..e140a1f 100644 | |||
2735 | --- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | |||
2736 | +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | |||
2737 | @@ -89,10 +89,6 @@ | |||
2738 | 89 | #include "fw/acpi.h" | 89 | #include "fw/acpi.h" |
2739 | 90 | #include "iwl-nvm-parse.h" | 90 | #include "iwl-nvm-parse.h" |
2740 | 91 | 91 | ||
2741 | 92 | #ifdef CPTCFG_IWLWIFI_LTE_COEX | ||
2742 | 93 | #include "lte-coex.h" | ||
2743 | 94 | #endif | ||
2744 | 95 | |||
2745 | 96 | #include <linux/average.h> | 92 | #include <linux/average.h> |
2746 | 97 | 93 | ||
2747 | 98 | #define IWL_MVM_MAX_ADDRESSES 5 | 94 | #define IWL_MVM_MAX_ADDRESSES 5 |
2748 | @@ -162,10 +158,6 @@ struct iwl_mvm_phy_ctxt { | |||
2749 | 162 | */ | 158 | */ |
2750 | 163 | struct ieee80211_channel *channel; | 159 | struct ieee80211_channel *channel; |
2751 | 164 | 160 | ||
2752 | 165 | #ifdef CPTCFG_IWLWIFI_FRQ_MGR | ||
2753 | 166 | /* Frequency Manager tx power limit*/ | ||
2754 | 167 | s8 fm_tx_power_limit; | ||
2755 | 168 | #endif | ||
2756 | 169 | }; | 161 | }; |
2757 | 170 | 162 | ||
2758 | 171 | struct iwl_mvm_time_event_data { | 163 | struct iwl_mvm_time_event_data { |
2759 | @@ -598,24 +590,6 @@ struct iwl_mvm_frame_stats { | |||
2760 | 598 | int last_frame_idx; | 590 | int last_frame_idx; |
2761 | 599 | }; | 591 | }; |
2762 | 600 | 592 | ||
2763 | 601 | #ifdef CPTCFG_IWLWIFI_LTE_COEX | ||
2764 | 602 | struct lte_coex_state { | ||
2765 | 603 | u8 state; | ||
2766 | 604 | |||
2767 | 605 | bool has_static; | ||
2768 | 606 | bool has_config; | ||
2769 | 607 | bool has_sps; | ||
2770 | 608 | bool has_rprtd_chan; | ||
2771 | 609 | bool has_ft; | ||
2772 | 610 | |||
2773 | 611 | struct iwl_lte_coex_static_params_cmd stat; | ||
2774 | 612 | struct iwl_lte_coex_config_cmd config; | ||
2775 | 613 | struct iwl_lte_coex_sps_cmd sps; | ||
2776 | 614 | struct iwl_lte_coex_wifi_reported_channel_cmd rprtd_chan; | ||
2777 | 615 | struct iwl_lte_coex_fine_tuning_params_cmd ft; | ||
2778 | 616 | }; | ||
2779 | 617 | #endif | ||
2780 | 618 | |||
2781 | 619 | #define IWL_MVM_DEBUG_SET_TEMPERATURE_DISABLE 0xff | 593 | #define IWL_MVM_DEBUG_SET_TEMPERATURE_DISABLE 0xff |
2782 | 620 | #define IWL_MVM_DEBUG_SET_TEMPERATURE_MIN -100 | 594 | #define IWL_MVM_DEBUG_SET_TEMPERATURE_MIN -100 |
2783 | 621 | #define IWL_MVM_DEBUG_SET_TEMPERATURE_MAX 200 | 595 | #define IWL_MVM_DEBUG_SET_TEMPERATURE_MAX 200 |
2784 | @@ -1062,6 +1036,7 @@ struct iwl_mvm { | |||
2785 | 1062 | struct ieee80211_channel **nd_channels; | 1036 | struct ieee80211_channel **nd_channels; |
2786 | 1063 | int n_nd_channels; | 1037 | int n_nd_channels; |
2787 | 1064 | bool net_detect; | 1038 | bool net_detect; |
2788 | 1039 | u8 offload_tid; | ||
2789 | 1065 | #ifdef CPTCFG_IWLWIFI_DEBUGFS | 1040 | #ifdef CPTCFG_IWLWIFI_DEBUGFS |
2790 | 1066 | bool d3_wake_sysassert; | 1041 | bool d3_wake_sysassert; |
2791 | 1067 | bool d3_test_active; | 1042 | bool d3_test_active; |
2792 | @@ -1080,17 +1055,9 @@ struct iwl_mvm { | |||
2793 | 1080 | u8 bt_tx_prio; | 1055 | u8 bt_tx_prio; |
2794 | 1081 | enum iwl_bt_force_ant_mode bt_force_ant_mode; | 1056 | enum iwl_bt_force_ant_mode bt_force_ant_mode; |
2795 | 1082 | 1057 | ||
2796 | 1083 | #ifdef CPTCFG_IWLWIFI_LTE_COEX | ||
2797 | 1084 | /* LTE-Coex */ | ||
2798 | 1085 | struct lte_coex_state lte_state; | ||
2799 | 1086 | #endif | ||
2800 | 1087 | /* Aux ROC */ | 1058 | /* Aux ROC */ |
2801 | 1088 | struct list_head aux_roc_te_list; | 1059 | struct list_head aux_roc_te_list; |
2802 | 1089 | 1060 | ||
2803 | 1090 | #ifdef CPTCFG_IWLWIFI_FRQ_MGR | ||
2804 | 1091 | /* 2G-Coex */ | ||
2805 | 1092 | bool coex_2g_enabled; | ||
2806 | 1093 | #endif | ||
2807 | 1094 | /* Thermal Throttling and CTkill */ | 1061 | /* Thermal Throttling and CTkill */ |
2808 | 1095 | struct iwl_mvm_tt_mgmt thermal_throttle; | 1062 | struct iwl_mvm_tt_mgmt thermal_throttle; |
2809 | 1096 | #ifdef CONFIG_THERMAL | 1063 | #ifdef CONFIG_THERMAL |
2810 | @@ -1519,6 +1486,12 @@ static inline bool iwl_mvm_is_reduced_config_scan_supported(struct iwl_mvm *mvm) | |||
2811 | 1519 | IWL_UCODE_TLV_API_REDUCED_SCAN_CONFIG); | 1486 | IWL_UCODE_TLV_API_REDUCED_SCAN_CONFIG); |
2812 | 1520 | } | 1487 | } |
2813 | 1521 | 1488 | ||
2814 | 1489 | static inline bool iwl_mvm_is_scan_ext_chan_supported(struct iwl_mvm *mvm) | ||
2815 | 1490 | { | ||
2816 | 1491 | return fw_has_api(&mvm->fw->ucode_capa, | ||
2817 | 1492 | IWL_UCODE_TLV_API_SCAN_EXT_CHAN_VER); | ||
2818 | 1493 | } | ||
2819 | 1494 | |||
2820 | 1522 | static inline bool iwl_mvm_has_new_rx_stats_api(struct iwl_mvm *mvm) | 1495 | static inline bool iwl_mvm_has_new_rx_stats_api(struct iwl_mvm *mvm) |
2821 | 1523 | { | 1496 | { |
2822 | 1524 | return fw_has_api(&mvm->fw->ucode_capa, | 1497 | return fw_has_api(&mvm->fw->ucode_capa, |
2823 | @@ -1548,7 +1521,6 @@ iwl_mvm_get_agg_status(struct iwl_mvm *mvm, void *tx_resp) | |||
2824 | 1548 | 1521 | ||
2825 | 1549 | static inline bool iwl_mvm_is_tt_in_fw(struct iwl_mvm *mvm) | 1522 | static inline bool iwl_mvm_is_tt_in_fw(struct iwl_mvm *mvm) |
2826 | 1550 | { | 1523 | { |
2827 | 1551 | #ifdef CONFIG_THERMAL | ||
2828 | 1552 | /* these two TLV are redundant since the responsibility to CT-kill by | 1524 | /* these two TLV are redundant since the responsibility to CT-kill by |
2829 | 1553 | * FW happens only after we send at least one command of | 1525 | * FW happens only after we send at least one command of |
2830 | 1554 | * temperature THs report. | 1526 | * temperature THs report. |
2831 | @@ -1557,9 +1529,6 @@ static inline bool iwl_mvm_is_tt_in_fw(struct iwl_mvm *mvm) | |||
2832 | 1557 | IWL_UCODE_TLV_CAPA_CT_KILL_BY_FW) && | 1529 | IWL_UCODE_TLV_CAPA_CT_KILL_BY_FW) && |
2833 | 1558 | fw_has_capa(&mvm->fw->ucode_capa, | 1530 | fw_has_capa(&mvm->fw->ucode_capa, |
2834 | 1559 | IWL_UCODE_TLV_CAPA_TEMP_THS_REPORT_SUPPORT); | 1531 | IWL_UCODE_TLV_CAPA_TEMP_THS_REPORT_SUPPORT); |
2835 | 1560 | #else /* CONFIG_THERMAL */ | ||
2836 | 1561 | return false; | ||
2837 | 1562 | #endif /* CONFIG_THERMAL */ | ||
2838 | 1563 | } | 1532 | } |
2839 | 1564 | 1533 | ||
2840 | 1565 | static inline bool iwl_mvm_is_ctdp_supported(struct iwl_mvm *mvm) | 1534 | static inline bool iwl_mvm_is_ctdp_supported(struct iwl_mvm *mvm) |
2841 | @@ -2087,27 +2056,6 @@ void iwl_mvm_enter_ctkill(struct iwl_mvm *mvm); | |||
2842 | 2087 | int iwl_mvm_send_temp_report_ths_cmd(struct iwl_mvm *mvm); | 2056 | int iwl_mvm_send_temp_report_ths_cmd(struct iwl_mvm *mvm); |
2843 | 2088 | int iwl_mvm_ctdp_command(struct iwl_mvm *mvm, u32 op, u32 budget); | 2057 | int iwl_mvm_ctdp_command(struct iwl_mvm *mvm, u32 op, u32 budget); |
2844 | 2089 | 2058 | ||
2845 | 2090 | #ifdef CPTCFG_IWLWIFI_FRQ_MGR | ||
2846 | 2091 | /* Frequency Manager */ | ||
2847 | 2092 | #define FM_2G_COEX_ENABLE_DISABLE 0xFFFFFFFF | ||
2848 | 2093 | #define FM_2G_COEX_ENABLE -100 | ||
2849 | 2094 | #define FM_2G_COEX_DISABLE 25 | ||
2850 | 2095 | |||
2851 | 2096 | enum iwl_fm_chan_change_action { | ||
2852 | 2097 | IWL_FM_ADD_CHANCTX = 0, | ||
2853 | 2098 | IWL_FM_REMOVE_CHANCTX = 1, | ||
2854 | 2099 | IWL_FM_CHANGE_CHANCTX = 2, | ||
2855 | 2100 | }; | ||
2856 | 2101 | |||
2857 | 2102 | int iwl_mvm_fm_set_tx_power(struct iwl_mvm *mvm, struct ieee80211_vif *vif, | ||
2858 | 2103 | s8 txpower); | ||
2859 | 2104 | void iwl_mvm_fm_notify_channel_change(struct ieee80211_chanctx_conf *ctx, | ||
2860 | 2105 | enum iwl_fm_chan_change_action action); | ||
2861 | 2106 | void iwl_mvm_fm_notify_current_dcdc(void); | ||
2862 | 2107 | int iwl_mvm_fm_register(struct iwl_mvm *mvm); | ||
2863 | 2108 | int iwl_mvm_fm_unregister(struct iwl_mvm *mvm); | ||
2864 | 2109 | #endif | ||
2865 | 2110 | |||
2866 | 2111 | /* Location Aware Regulatory */ | 2059 | /* Location Aware Regulatory */ |
2867 | 2112 | struct iwl_mcc_update_resp * | 2060 | struct iwl_mcc_update_resp * |
2868 | 2113 | iwl_mvm_update_mcc(struct iwl_mvm *mvm, const char *alpha2, | 2061 | iwl_mvm_update_mcc(struct iwl_mvm *mvm, const char *alpha2, |
2869 | @@ -2205,16 +2153,6 @@ void iwl_mvm_tcm_add_vif(struct iwl_mvm *mvm, struct ieee80211_vif *vif); | |||
2870 | 2205 | void iwl_mvm_tcm_rm_vif(struct iwl_mvm *mvm, struct ieee80211_vif *vif); | 2153 | void iwl_mvm_tcm_rm_vif(struct iwl_mvm *mvm, struct ieee80211_vif *vif); |
2871 | 2206 | u8 iwl_mvm_tcm_load_percentage(u32 airtime, u32 elapsed); | 2154 | u8 iwl_mvm_tcm_load_percentage(u32 airtime, u32 elapsed); |
2872 | 2207 | 2155 | ||
2873 | 2208 | #ifdef CPTCFG_IWLWIFI_LTE_COEX | ||
2874 | 2209 | int iwl_mvm_send_lte_coex_static_params_cmd(struct iwl_mvm *mvm); | ||
2875 | 2210 | int iwl_mvm_send_lte_coex_config_cmd(struct iwl_mvm *mvm); | ||
2876 | 2211 | int iwl_mvm_send_lte_coex_wifi_reported_channel_cmd(struct iwl_mvm *mvm); | ||
2877 | 2212 | int iwl_mvm_send_lte_sps_cmd(struct iwl_mvm *mvm); | ||
2878 | 2213 | int iwl_mvm_send_lte_fine_tuning_params_cmd(struct iwl_mvm *mvm); | ||
2879 | 2214 | void iwl_mvm_reset_lte_state(struct iwl_mvm *mvm); | ||
2880 | 2215 | void iwl_mvm_send_lte_commands(struct iwl_mvm *mvm); | ||
2881 | 2216 | #endif | ||
2882 | 2217 | |||
2883 | 2218 | void iwl_mvm_nic_restart(struct iwl_mvm *mvm, bool fw_error); | 2156 | void iwl_mvm_nic_restart(struct iwl_mvm *mvm, bool fw_error); |
2884 | 2219 | unsigned int iwl_mvm_get_wd_timeout(struct iwl_mvm *mvm, | 2157 | unsigned int iwl_mvm_get_wd_timeout(struct iwl_mvm *mvm, |
2885 | 2220 | struct ieee80211_vif *vif, | 2158 | struct ieee80211_vif *vif, |
2886 | diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c | |||
2887 | index 018d6e0..ca25c5c 100644 | |||
2888 | --- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c | |||
2889 | +++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c | |||
2890 | @@ -399,21 +399,12 @@ static const struct iwl_hcmd_names iwl_mvm_legacy_names[] = { | |||
2891 | 399 | HCMD_NAME(TIME_QUOTA_CMD), | 399 | HCMD_NAME(TIME_QUOTA_CMD), |
2892 | 400 | HCMD_NAME(NON_QOS_TX_COUNTER_CMD), | 400 | HCMD_NAME(NON_QOS_TX_COUNTER_CMD), |
2893 | 401 | HCMD_NAME(LEDS_CMD), | 401 | HCMD_NAME(LEDS_CMD), |
2894 | 402 | #ifdef CPTCFG_IWLWIFI_LTE_COEX | ||
2895 | 403 | HCMD_NAME(LTE_COEX_CONFIG_CMD), | ||
2896 | 404 | HCMD_NAME(LTE_COEX_WIFI_REPORTED_CHANNEL_CMD), | ||
2897 | 405 | HCMD_NAME(LTE_COEX_STATIC_PARAMS_CMD), | ||
2898 | 406 | HCMD_NAME(LTE_COEX_SPS_CMD), | ||
2899 | 407 | #endif | ||
2900 | 408 | HCMD_NAME(LQ_CMD), | 402 | HCMD_NAME(LQ_CMD), |
2901 | 409 | HCMD_NAME(FW_PAGING_BLOCK_CMD), | 403 | HCMD_NAME(FW_PAGING_BLOCK_CMD), |
2902 | 410 | HCMD_NAME(SCAN_OFFLOAD_REQUEST_CMD), | 404 | HCMD_NAME(SCAN_OFFLOAD_REQUEST_CMD), |
2903 | 411 | HCMD_NAME(SCAN_OFFLOAD_ABORT_CMD), | 405 | HCMD_NAME(SCAN_OFFLOAD_ABORT_CMD), |
2904 | 412 | HCMD_NAME(HOT_SPOT_CMD), | 406 | HCMD_NAME(HOT_SPOT_CMD), |
2905 | 413 | HCMD_NAME(SCAN_OFFLOAD_PROFILES_QUERY_CMD), | 407 | HCMD_NAME(SCAN_OFFLOAD_PROFILES_QUERY_CMD), |
2906 | 414 | #ifdef CPTCFG_IWLWIFI_LTE_COEX | ||
2907 | 415 | HCMD_NAME(LTE_COEX_FINE_TUNING_PARAMS_CMD), | ||
2908 | 416 | #endif | ||
2909 | 417 | HCMD_NAME(BT_COEX_UPDATE_REDUCED_TXP), | 408 | HCMD_NAME(BT_COEX_UPDATE_REDUCED_TXP), |
2910 | 418 | HCMD_NAME(BT_COEX_CI), | 409 | HCMD_NAME(BT_COEX_CI), |
2911 | 419 | HCMD_NAME(PHY_CONFIGURATION_CMD), | 410 | HCMD_NAME(PHY_CONFIGURATION_CMD), |
2912 | @@ -1024,12 +1015,6 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg, | |||
2913 | 1024 | else | 1015 | else |
2914 | 1025 | memset(&mvm->rx_stats, 0, sizeof(struct mvm_statistics_rx)); | 1016 | memset(&mvm->rx_stats, 0, sizeof(struct mvm_statistics_rx)); |
2915 | 1026 | 1017 | ||
2916 | 1027 | #ifdef CPTCFG_IWLWIFI_FRQ_MGR | ||
2917 | 1028 | err = iwl_mvm_fm_register(mvm); | ||
2918 | 1029 | if (err) | ||
2919 | 1030 | pr_err("Unable to register with Frequency Manager: %d\n", err); | ||
2920 | 1031 | #endif | ||
2921 | 1032 | |||
2922 | 1033 | #ifdef CPTCFG_IWLWIFI_SUPPORT_DEBUG_OVERRIDES | 1018 | #ifdef CPTCFG_IWLWIFI_SUPPORT_DEBUG_OVERRIDES |
2923 | 1034 | iwl_mvm_init_modparams(mvm); | 1019 | iwl_mvm_init_modparams(mvm); |
2924 | 1035 | #endif | 1020 | #endif |
2925 | @@ -1066,10 +1051,6 @@ static void iwl_op_mode_mvm_stop(struct iwl_op_mode *op_mode) | |||
2926 | 1066 | 1051 | ||
2927 | 1067 | ieee80211_unregister_hw(mvm->hw); | 1052 | ieee80211_unregister_hw(mvm->hw); |
2928 | 1068 | 1053 | ||
2929 | 1069 | #ifdef CPTCFG_IWLWIFI_FRQ_MGR | ||
2930 | 1070 | iwl_mvm_fm_unregister(mvm); | ||
2931 | 1071 | #endif | ||
2932 | 1072 | |||
2933 | 1073 | kfree(mvm->scan_cmd); | 1054 | kfree(mvm->scan_cmd); |
2934 | 1074 | kfree(mvm->mcast_filter_cmd); | 1055 | kfree(mvm->mcast_filter_cmd); |
2935 | 1075 | mvm->mcast_filter_cmd = NULL; | 1056 | mvm->mcast_filter_cmd = NULL; |
2936 | diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/phy-ctxt.c b/drivers/net/wireless/intel/iwlwifi/mvm/phy-ctxt.c | |||
2937 | index cd5ff55..9925616 100644 | |||
2938 | --- a/drivers/net/wireless/intel/iwlwifi/mvm/phy-ctxt.c | |||
2939 | +++ b/drivers/net/wireless/intel/iwlwifi/mvm/phy-ctxt.c | |||
2940 | @@ -7,8 +7,8 @@ | |||
2941 | 7 | * | 7 | * |
2942 | 8 | * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. | 8 | * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. |
2943 | 9 | * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH | 9 | * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH |
2946 | 10 | * Copyright(c) 2017 Intel Deutschland GmbH | 10 | * Copyright(c) 2017 Intel Deutschland GmbH |
2947 | 11 | * Copyright(c) 2018 Intel Corporation | 11 | * Copyright(c) 2018 - 2019 Intel Corporation |
2948 | 12 | * | 12 | * |
2949 | 13 | * This program is free software; you can redistribute it and/or modify | 13 | * This program is free software; you can redistribute it and/or modify |
2950 | 14 | * it under the terms of version 2 of the GNU General Public License as | 14 | * it under the terms of version 2 of the GNU General Public License as |
2951 | @@ -30,7 +30,7 @@ | |||
2952 | 30 | * | 30 | * |
2953 | 31 | * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. | 31 | * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. |
2954 | 32 | * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH | 32 | * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH |
2956 | 33 | * Copyright(c) 2018 Intel Corporation | 33 | * Copyright(c) 2018 - 2019 Intel Corporation |
2957 | 34 | * All rights reserved. | 34 | * All rights reserved. |
2958 | 35 | * | 35 | * |
2959 | 36 | * Redistribution and use in source and binary forms, with or without | 36 | * Redistribution and use in source and binary forms, with or without |
2960 | @@ -221,10 +221,6 @@ int iwl_mvm_phy_ctxt_add(struct iwl_mvm *mvm, struct iwl_mvm_phy_ctxt *ctxt, | |||
2961 | 221 | 221 | ||
2962 | 222 | ctxt->channel = chandef->chan; | 222 | ctxt->channel = chandef->chan; |
2963 | 223 | 223 | ||
2964 | 224 | #ifdef CPTCFG_IWLWIFI_FRQ_MGR | ||
2965 | 225 | ctxt->fm_tx_power_limit = IWL_DEFAULT_MAX_TX_POWER; | ||
2966 | 226 | #endif | ||
2967 | 227 | |||
2968 | 228 | return iwl_mvm_phy_ctxt_apply(mvm, ctxt, chandef, | 224 | return iwl_mvm_phy_ctxt_apply(mvm, ctxt, chandef, |
2969 | 229 | chains_static, chains_dynamic, | 225 | chains_static, chains_dynamic, |
2970 | 230 | FW_CTXT_ACTION_ADD, 0); | 226 | FW_CTXT_ACTION_ADD, 0); |
2971 | diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c b/drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c | |||
2972 | index 4a7b1e6..761a3e6 100644 | |||
2973 | --- a/drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c | |||
2974 | +++ b/drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c | |||
2975 | @@ -193,7 +193,7 @@ rs_fw_vht_set_enabled_rates(const struct ieee80211_sta *sta, | |||
2976 | 193 | int i, highest_mcs; | 193 | int i, highest_mcs; |
2977 | 194 | 194 | ||
2978 | 195 | for (i = 0; i < sta->rx_nss; i++) { | 195 | for (i = 0; i < sta->rx_nss; i++) { |
2980 | 196 | if (i == MAX_NSS) | 196 | if (i == IWL_TLC_NSS_MAX) |
2981 | 197 | break; | 197 | break; |
2982 | 198 | 198 | ||
2983 | 199 | highest_mcs = rs_fw_vht_highest_rx_mcs_index(vht_cap, i + 1); | 199 | highest_mcs = rs_fw_vht_highest_rx_mcs_index(vht_cap, i + 1); |
2984 | @@ -204,9 +204,10 @@ rs_fw_vht_set_enabled_rates(const struct ieee80211_sta *sta, | |||
2985 | 204 | if (sta->bandwidth == IEEE80211_STA_RX_BW_20) | 204 | if (sta->bandwidth == IEEE80211_STA_RX_BW_20) |
2986 | 205 | supp &= ~BIT(IWL_TLC_MNG_HT_RATE_MCS9); | 205 | supp &= ~BIT(IWL_TLC_MNG_HT_RATE_MCS9); |
2987 | 206 | 206 | ||
2989 | 207 | cmd->ht_rates[i][0] = cpu_to_le16(supp); | 207 | cmd->ht_rates[i][IWL_TLC_HT_BW_NONE_160] = cpu_to_le16(supp); |
2990 | 208 | if (sta->bandwidth == IEEE80211_STA_RX_BW_160) | 208 | if (sta->bandwidth == IEEE80211_STA_RX_BW_160) |
2992 | 209 | cmd->ht_rates[i][1] = cmd->ht_rates[i][0]; | 209 | cmd->ht_rates[i][IWL_TLC_HT_BW_160] = |
2993 | 210 | cmd->ht_rates[i][IWL_TLC_HT_BW_NONE_160]; | ||
2994 | 210 | } | 211 | } |
2995 | 211 | } | 212 | } |
2996 | 212 | 213 | ||
2997 | @@ -241,7 +242,7 @@ rs_fw_he_set_enabled_rates(const struct ieee80211_sta *sta, | |||
2998 | 241 | le16_to_cpu(sband->iftype_data->he_cap.he_mcs_nss_supp.tx_mcs_160); | 242 | le16_to_cpu(sband->iftype_data->he_cap.he_mcs_nss_supp.tx_mcs_160); |
2999 | 242 | int i; | 243 | int i; |
3000 | 243 | 244 | ||
3002 | 244 | for (i = 0; i < sta->rx_nss && i < MAX_NSS; i++) { | 245 | for (i = 0; i < sta->rx_nss && i < IWL_TLC_NSS_MAX; i++) { |
3003 | 245 | u16 _mcs_160 = (mcs_160 >> (2 * i)) & 0x3; | 246 | u16 _mcs_160 = (mcs_160 >> (2 * i)) & 0x3; |
3004 | 246 | u16 _mcs_80 = (mcs_80 >> (2 * i)) & 0x3; | 247 | u16 _mcs_80 = (mcs_80 >> (2 * i)) & 0x3; |
3005 | 247 | u16 _tx_mcs_160 = (tx_mcs_160 >> (2 * i)) & 0x3; | 248 | u16 _tx_mcs_160 = (tx_mcs_160 >> (2 * i)) & 0x3; |
3006 | @@ -255,7 +256,7 @@ rs_fw_he_set_enabled_rates(const struct ieee80211_sta *sta, | |||
3007 | 255 | } | 256 | } |
3008 | 256 | if (_mcs_80 > _tx_mcs_80) | 257 | if (_mcs_80 > _tx_mcs_80) |
3009 | 257 | _mcs_80 = _tx_mcs_80; | 258 | _mcs_80 = _tx_mcs_80; |
3011 | 258 | cmd->ht_rates[i][0] = | 259 | cmd->ht_rates[i][IWL_TLC_HT_BW_NONE_160] = |
3012 | 259 | cpu_to_le16(rs_fw_he_ieee80211_mcs_to_rs_mcs(_mcs_80)); | 260 | cpu_to_le16(rs_fw_he_ieee80211_mcs_to_rs_mcs(_mcs_80)); |
3013 | 260 | 261 | ||
3014 | 261 | /* If one side doesn't support - mark both as not supporting */ | 262 | /* If one side doesn't support - mark both as not supporting */ |
3015 | @@ -266,7 +267,7 @@ rs_fw_he_set_enabled_rates(const struct ieee80211_sta *sta, | |||
3016 | 266 | } | 267 | } |
3017 | 267 | if (_mcs_160 > _tx_mcs_160) | 268 | if (_mcs_160 > _tx_mcs_160) |
3018 | 268 | _mcs_160 = _tx_mcs_160; | 269 | _mcs_160 = _tx_mcs_160; |
3020 | 269 | cmd->ht_rates[i][1] = | 270 | cmd->ht_rates[i][IWL_TLC_HT_BW_160] = |
3021 | 270 | cpu_to_le16(rs_fw_he_ieee80211_mcs_to_rs_mcs(_mcs_160)); | 271 | cpu_to_le16(rs_fw_he_ieee80211_mcs_to_rs_mcs(_mcs_160)); |
3022 | 271 | } | 272 | } |
3023 | 272 | } | 273 | } |
3024 | @@ -300,8 +301,10 @@ static void rs_fw_set_supp_rates(struct ieee80211_sta *sta, | |||
3025 | 300 | rs_fw_vht_set_enabled_rates(sta, vht_cap, cmd); | 301 | rs_fw_vht_set_enabled_rates(sta, vht_cap, cmd); |
3026 | 301 | } else if (ht_cap->ht_supported) { | 302 | } else if (ht_cap->ht_supported) { |
3027 | 302 | cmd->mode = IWL_TLC_MNG_MODE_HT; | 303 | cmd->mode = IWL_TLC_MNG_MODE_HT; |
3030 | 303 | cmd->ht_rates[0][0] = cpu_to_le16(ht_cap->mcs.rx_mask[0]); | 304 | cmd->ht_rates[IWL_TLC_NSS_1][IWL_TLC_HT_BW_NONE_160] = |
3031 | 304 | cmd->ht_rates[1][0] = cpu_to_le16(ht_cap->mcs.rx_mask[1]); | 305 | cpu_to_le16(ht_cap->mcs.rx_mask[0]); |
3032 | 306 | cmd->ht_rates[IWL_TLC_NSS_2][IWL_TLC_HT_BW_NONE_160] = | ||
3033 | 307 | cpu_to_le16(ht_cap->mcs.rx_mask[1]); | ||
3034 | 305 | } | 308 | } |
3035 | 306 | } | 309 | } |
3036 | 307 | 310 | ||
3037 | @@ -433,6 +436,16 @@ void rs_fw_rate_init(struct iwl_mvm *mvm, struct ieee80211_sta *sta, | |||
3038 | 433 | iwl_mvm_reset_frame_stats(mvm); | 436 | iwl_mvm_reset_frame_stats(mvm); |
3039 | 434 | #endif | 437 | #endif |
3040 | 435 | rs_fw_set_supp_rates(sta, sband, &cfg_cmd); | 438 | rs_fw_set_supp_rates(sta, sband, &cfg_cmd); |
3041 | 439 | #ifdef CPTCFG_IWLWIFI_SUPPORT_DEBUG_OVERRIDES | ||
3042 | 440 | /* | ||
3043 | 441 | * if AP disables mimo on 160bw (cmd->ht_rates[1][1] == 0 | ||
3044 | 442 | * we disable mimo on 80bw cmd->ht_rates[1][0] | ||
3045 | 443 | */ | ||
3046 | 444 | if (mvm->trans->dbg_cfg.tx_siso_80bw_like_160bw && | ||
3047 | 445 | !cfg_cmd.ht_rates[1][1]) | ||
3048 | 446 | cfg_cmd.ht_rates[1][0] = 0; | ||
3049 | 447 | |||
3050 | 448 | #endif | ||
3051 | 436 | 449 | ||
3052 | 437 | /* | 450 | /* |
3053 | 438 | * since TLC offload works with one mode we can assume | 451 | * since TLC offload works with one mode we can assume |
3054 | diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c | |||
3055 | index 446d523..4acee82 100644 | |||
3056 | --- a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c | |||
3057 | +++ b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c | |||
3058 | @@ -77,7 +77,10 @@ | |||
3059 | 77 | #define IWL_SCAN_DWELL_FRAGMENTED 44 | 77 | #define IWL_SCAN_DWELL_FRAGMENTED 44 |
3060 | 78 | #define IWL_SCAN_DWELL_EXTENDED 90 | 78 | #define IWL_SCAN_DWELL_EXTENDED 90 |
3061 | 79 | #define IWL_SCAN_NUM_OF_FRAGS 3 | 79 | #define IWL_SCAN_NUM_OF_FRAGS 3 |
3062 | 80 | #define IWL_SCAN_LAST_2_4_CHN 14 | ||
3063 | 80 | 81 | ||
3064 | 82 | #define IWL_SCAN_BAND_5_2 0 | ||
3065 | 83 | #define IWL_SCAN_BAND_2_4 1 | ||
3066 | 81 | 84 | ||
3067 | 82 | /* adaptive dwell max budget time [TU] for full scan */ | 85 | /* adaptive dwell max budget time [TU] for full scan */ |
3068 | 83 | #define IWL_SCAN_ADWELL_MAX_BUDGET_FULL_SCAN 300 | 86 | #define IWL_SCAN_ADWELL_MAX_BUDGET_FULL_SCAN 300 |
3069 | @@ -956,11 +959,24 @@ static int iwl_mvm_scan_lmac_flags(struct iwl_mvm *mvm, | |||
3070 | 956 | return flags; | 959 | return flags; |
3071 | 957 | } | 960 | } |
3072 | 958 | 961 | ||
3073 | 962 | static void | ||
3074 | 963 | iwl_mvm_scan_set_legacy_probe_req(struct iwl_scan_probe_req_v1 *p_req, | ||
3075 | 964 | struct iwl_scan_probe_req *src_p_req) | ||
3076 | 965 | { | ||
3077 | 966 | int i; | ||
3078 | 967 | |||
3079 | 968 | p_req->mac_header = src_p_req->mac_header; | ||
3080 | 969 | for (i = 0; i < SCAN_NUM_BAND_PROBE_DATA_V_1; i++) | ||
3081 | 970 | p_req->band_data[i] = src_p_req->band_data[i]; | ||
3082 | 971 | p_req->common_data = src_p_req->common_data; | ||
3083 | 972 | memcpy(p_req->buf, src_p_req->buf, sizeof(p_req->buf)); | ||
3084 | 973 | } | ||
3085 | 974 | |||
3086 | 959 | static int iwl_mvm_scan_lmac(struct iwl_mvm *mvm, struct ieee80211_vif *vif, | 975 | static int iwl_mvm_scan_lmac(struct iwl_mvm *mvm, struct ieee80211_vif *vif, |
3087 | 960 | struct iwl_mvm_scan_params *params) | 976 | struct iwl_mvm_scan_params *params) |
3088 | 961 | { | 977 | { |
3089 | 962 | struct iwl_scan_req_lmac *cmd = mvm->scan_cmd; | 978 | struct iwl_scan_req_lmac *cmd = mvm->scan_cmd; |
3091 | 963 | struct iwl_scan_probe_req *preq = | 979 | struct iwl_scan_probe_req_v1 *preq = |
3092 | 964 | (void *)(cmd->data + sizeof(struct iwl_scan_channel_cfg_lmac) * | 980 | (void *)(cmd->data + sizeof(struct iwl_scan_channel_cfg_lmac) * |
3093 | 965 | mvm->fw->ucode_capa.n_scan_channels); | 981 | mvm->fw->ucode_capa.n_scan_channels); |
3094 | 966 | u32 ssid_bitmap = 0; | 982 | u32 ssid_bitmap = 0; |
3095 | @@ -1030,7 +1046,7 @@ static int iwl_mvm_scan_lmac(struct iwl_mvm *mvm, struct ieee80211_vif *vif, | |||
3096 | 1030 | iwl_mvm_lmac_scan_cfg_channels(mvm, params->channels, | 1046 | iwl_mvm_lmac_scan_cfg_channels(mvm, params->channels, |
3097 | 1031 | params->n_channels, ssid_bitmap, cmd); | 1047 | params->n_channels, ssid_bitmap, cmd); |
3098 | 1032 | 1048 | ||
3100 | 1033 | *preq = params->preq; | 1049 | iwl_mvm_scan_set_legacy_probe_req(preq, ¶ms->preq); |
3101 | 1034 | 1050 | ||
3102 | 1035 | return 0; | 1051 | return 0; |
3103 | 1036 | } | 1052 | } |
3104 | @@ -1408,9 +1424,17 @@ iwl_mvm_umac_scan_cfg_channels(struct iwl_mvm *mvm, | |||
3105 | 1408 | 1424 | ||
3106 | 1409 | for (i = 0; i < n_channels; i++) { | 1425 | for (i = 0; i < n_channels; i++) { |
3107 | 1410 | channel_cfg[i].flags = cpu_to_le32(ssid_bitmap); | 1426 | channel_cfg[i].flags = cpu_to_le32(ssid_bitmap); |
3111 | 1411 | channel_cfg[i].channel_num = channels[i]->hw_value; | 1427 | channel_cfg[i].v1.channel_num = channels[i]->hw_value; |
3112 | 1412 | channel_cfg[i].iter_count = 1; | 1428 | if (iwl_mvm_is_scan_ext_chan_supported(mvm)) { |
3113 | 1413 | channel_cfg[i].iter_interval = 0; | 1429 | channel_cfg[i].v2.band = |
3114 | 1430 | channels[i]->hw_value <= IWL_SCAN_LAST_2_4_CHN ? | ||
3115 | 1431 | IWL_SCAN_BAND_2_4 : IWL_SCAN_BAND_5_2; | ||
3116 | 1432 | channel_cfg[i].v2.iter_count = 1; | ||
3117 | 1433 | channel_cfg[i].v2.iter_interval = 0; | ||
3118 | 1434 | } else { | ||
3119 | 1435 | channel_cfg[i].v1.iter_count = 1; | ||
3120 | 1436 | channel_cfg[i].v1.iter_interval = 0; | ||
3121 | 1437 | } | ||
3122 | 1414 | } | 1438 | } |
3123 | 1415 | } | 1439 | } |
3124 | 1416 | 1440 | ||
3125 | @@ -1500,9 +1524,12 @@ static int iwl_mvm_scan_umac(struct iwl_mvm *mvm, struct ieee80211_vif *vif, | |||
3126 | 1500 | struct iwl_scan_req_umac *cmd = mvm->scan_cmd; | 1524 | struct iwl_scan_req_umac *cmd = mvm->scan_cmd; |
3127 | 1501 | struct iwl_scan_umac_chan_param *chan_param; | 1525 | struct iwl_scan_umac_chan_param *chan_param; |
3128 | 1502 | void *cmd_data = iwl_mvm_get_scan_req_umac_data(mvm); | 1526 | void *cmd_data = iwl_mvm_get_scan_req_umac_data(mvm); |
3132 | 1503 | struct iwl_scan_req_umac_tail *sec_part = cmd_data + | 1527 | void *sec_part = cmd_data + sizeof(struct iwl_scan_channel_cfg_umac) * |
3133 | 1504 | sizeof(struct iwl_scan_channel_cfg_umac) * | 1528 | mvm->fw->ucode_capa.n_scan_channels; |
3134 | 1505 | mvm->fw->ucode_capa.n_scan_channels; | 1529 | struct iwl_scan_req_umac_tail_v2 *tail_v2 = |
3135 | 1530 | (struct iwl_scan_req_umac_tail_v2 *)sec_part; | ||
3136 | 1531 | struct iwl_scan_req_umac_tail_v1 *tail_v1; | ||
3137 | 1532 | struct iwl_ssid_ie *direct_scan; | ||
3138 | 1506 | int uid, i; | 1533 | int uid, i; |
3139 | 1507 | u32 ssid_bitmap = 0; | 1534 | u32 ssid_bitmap = 0; |
3140 | 1508 | u8 channel_flags = 0; | 1535 | u8 channel_flags = 0; |
3141 | @@ -1564,18 +1591,12 @@ static int iwl_mvm_scan_umac(struct iwl_mvm *mvm, struct ieee80211_vif *vif, | |||
3142 | 1564 | chan_param->flags = channel_flags; | 1591 | chan_param->flags = channel_flags; |
3143 | 1565 | chan_param->count = params->n_channels; | 1592 | chan_param->count = params->n_channels; |
3144 | 1566 | 1593 | ||
3145 | 1567 | iwl_scan_build_ssids(params, sec_part->direct_scan, &ssid_bitmap); | ||
3146 | 1568 | |||
3147 | 1569 | iwl_mvm_umac_scan_cfg_channels(mvm, params->channels, | ||
3148 | 1570 | params->n_channels, ssid_bitmap, | ||
3149 | 1571 | cmd_data); | ||
3150 | 1572 | |||
3151 | 1573 | for (i = 0; i < params->n_scan_plans; i++) { | 1594 | for (i = 0; i < params->n_scan_plans; i++) { |
3152 | 1574 | struct cfg80211_sched_scan_plan *scan_plan = | 1595 | struct cfg80211_sched_scan_plan *scan_plan = |
3153 | 1575 | ¶ms->scan_plans[i]; | 1596 | ¶ms->scan_plans[i]; |
3154 | 1576 | 1597 | ||
3157 | 1577 | sec_part->schedule[i].iter_count = scan_plan->iterations; | 1598 | tail_v2->schedule[i].iter_count = scan_plan->iterations; |
3158 | 1578 | sec_part->schedule[i].interval = | 1599 | tail_v2->schedule[i].interval = |
3159 | 1579 | cpu_to_le16(scan_plan->interval); | 1600 | cpu_to_le16(scan_plan->interval); |
3160 | 1580 | } | 1601 | } |
3161 | 1581 | 1602 | ||
3162 | @@ -1585,12 +1606,24 @@ static int iwl_mvm_scan_umac(struct iwl_mvm *mvm, struct ieee80211_vif *vif, | |||
3163 | 1585 | * For example, when regular scan is requested the driver sets one scan | 1606 | * For example, when regular scan is requested the driver sets one scan |
3164 | 1586 | * plan with one iteration. | 1607 | * plan with one iteration. |
3165 | 1587 | */ | 1608 | */ |
3168 | 1588 | if (!sec_part->schedule[i - 1].iter_count) | 1609 | if (!tail_v2->schedule[i - 1].iter_count) |
3169 | 1589 | sec_part->schedule[i - 1].iter_count = 0xff; | 1610 | tail_v2->schedule[i - 1].iter_count = 0xff; |
3170 | 1590 | 1611 | ||
3173 | 1591 | sec_part->delay = cpu_to_le16(params->delay); | 1612 | tail_v2->delay = cpu_to_le16(params->delay); |
3172 | 1592 | sec_part->preq = params->preq; | ||
3174 | 1593 | 1613 | ||
3175 | 1614 | if (iwl_mvm_is_scan_ext_chan_supported(mvm)) { | ||
3176 | 1615 | tail_v2->preq = params->preq; | ||
3177 | 1616 | direct_scan = tail_v2->direct_scan; | ||
3178 | 1617 | } else { | ||
3179 | 1618 | tail_v1 = (struct iwl_scan_req_umac_tail_v1 *)sec_part; | ||
3180 | 1619 | iwl_mvm_scan_set_legacy_probe_req(&tail_v1->preq, | ||
3181 | 1620 | ¶ms->preq); | ||
3182 | 1621 | direct_scan = tail_v1->direct_scan; | ||
3183 | 1622 | } | ||
3184 | 1623 | iwl_scan_build_ssids(params, direct_scan, &ssid_bitmap); | ||
3185 | 1624 | iwl_mvm_umac_scan_cfg_channels(mvm, params->channels, | ||
3186 | 1625 | params->n_channels, ssid_bitmap, | ||
3187 | 1626 | cmd_data); | ||
3188 | 1594 | return 0; | 1627 | return 0; |
3189 | 1595 | } | 1628 | } |
3190 | 1596 | 1629 | ||
3191 | @@ -2020,6 +2053,7 @@ static int iwl_mvm_scan_stop_wait(struct iwl_mvm *mvm, int type) | |||
3192 | 2020 | int iwl_mvm_scan_size(struct iwl_mvm *mvm) | 2053 | int iwl_mvm_scan_size(struct iwl_mvm *mvm) |
3193 | 2021 | { | 2054 | { |
3194 | 2022 | int base_size = IWL_SCAN_REQ_UMAC_SIZE_V1; | 2055 | int base_size = IWL_SCAN_REQ_UMAC_SIZE_V1; |
3195 | 2056 | int tail_size; | ||
3196 | 2023 | 2057 | ||
3197 | 2024 | if (iwl_mvm_is_adaptive_dwell_v2_supported(mvm)) | 2058 | if (iwl_mvm_is_adaptive_dwell_v2_supported(mvm)) |
3198 | 2025 | base_size = IWL_SCAN_REQ_UMAC_SIZE_V8; | 2059 | base_size = IWL_SCAN_REQ_UMAC_SIZE_V8; |
3199 | @@ -2028,16 +2062,21 @@ int iwl_mvm_scan_size(struct iwl_mvm *mvm) | |||
3200 | 2028 | else if (iwl_mvm_cdb_scan_api(mvm)) | 2062 | else if (iwl_mvm_cdb_scan_api(mvm)) |
3201 | 2029 | base_size = IWL_SCAN_REQ_UMAC_SIZE_V6; | 2063 | base_size = IWL_SCAN_REQ_UMAC_SIZE_V6; |
3202 | 2030 | 2064 | ||
3204 | 2031 | if (fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_UMAC_SCAN)) | 2065 | if (fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_UMAC_SCAN)) { |
3205 | 2066 | if (iwl_mvm_is_scan_ext_chan_supported(mvm)) | ||
3206 | 2067 | tail_size = sizeof(struct iwl_scan_req_umac_tail_v2); | ||
3207 | 2068 | else | ||
3208 | 2069 | tail_size = sizeof(struct iwl_scan_req_umac_tail_v1); | ||
3209 | 2070 | |||
3210 | 2032 | return base_size + | 2071 | return base_size + |
3211 | 2033 | sizeof(struct iwl_scan_channel_cfg_umac) * | 2072 | sizeof(struct iwl_scan_channel_cfg_umac) * |
3212 | 2034 | mvm->fw->ucode_capa.n_scan_channels + | 2073 | mvm->fw->ucode_capa.n_scan_channels + |
3215 | 2035 | sizeof(struct iwl_scan_req_umac_tail); | 2074 | tail_size; |
3216 | 2036 | 2075 | } | |
3217 | 2037 | return sizeof(struct iwl_scan_req_lmac) + | 2076 | return sizeof(struct iwl_scan_req_lmac) + |
3218 | 2038 | sizeof(struct iwl_scan_channel_cfg_lmac) * | 2077 | sizeof(struct iwl_scan_channel_cfg_lmac) * |
3219 | 2039 | mvm->fw->ucode_capa.n_scan_channels + | 2078 | mvm->fw->ucode_capa.n_scan_channels + |
3221 | 2040 | sizeof(struct iwl_scan_probe_req); | 2079 | sizeof(struct iwl_scan_probe_req_v1); |
3222 | 2041 | } | 2080 | } |
3223 | 2042 | 2081 | ||
3224 | 2043 | /* | 2082 | /* |
3225 | diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/vendor-cmd.c b/drivers/net/wireless/intel/iwlwifi/mvm/vendor-cmd.c | |||
3226 | index 7cf15d1..c3ab21b 100644 | |||
3227 | --- a/drivers/net/wireless/intel/iwlwifi/mvm/vendor-cmd.c | |||
3228 | +++ b/drivers/net/wireless/intel/iwlwifi/mvm/vendor-cmd.c | |||
3229 | @@ -67,10 +67,6 @@ | |||
3230 | 67 | #include "mvm.h" | 67 | #include "mvm.h" |
3231 | 68 | #include "iwl-vendor-cmd.h" | 68 | #include "iwl-vendor-cmd.h" |
3232 | 69 | 69 | ||
3233 | 70 | #ifdef CPTCFG_IWLWIFI_LTE_COEX | ||
3234 | 71 | #include "lte-coex.h" | ||
3235 | 72 | #endif | ||
3236 | 73 | |||
3237 | 74 | #include "iwl-io.h" | 70 | #include "iwl-io.h" |
3238 | 75 | #include "iwl-prph.h" | 71 | #include "iwl-prph.h" |
3239 | 76 | 72 | ||
3240 | @@ -267,360 +263,6 @@ free: | |||
3241 | 267 | return retval; | 263 | return retval; |
3242 | 268 | } | 264 | } |
3243 | 269 | 265 | ||
3244 | 270 | #ifdef CPTCFG_IWLWIFI_LTE_COEX | ||
3245 | 271 | static int iwl_vendor_lte_coex_state_cmd(struct wiphy *wiphy, | ||
3246 | 272 | struct wireless_dev *wdev, | ||
3247 | 273 | const void *data, int data_len) | ||
3248 | 274 | { | ||
3249 | 275 | struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy); | ||
3250 | 276 | struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); | ||
3251 | 277 | const struct lte_coex_state_cmd *cmd = data; | ||
3252 | 278 | struct sk_buff *skb; | ||
3253 | 279 | int err = LTE_OK; | ||
3254 | 280 | |||
3255 | 281 | skb = cfg80211_vendor_cmd_alloc_reply_skb(wiphy, 100); | ||
3256 | 282 | if (!skb) | ||
3257 | 283 | return -ENOMEM; | ||
3258 | 284 | |||
3259 | 285 | if (data_len != sizeof(*cmd)) { | ||
3260 | 286 | err = LTE_INVALID_DATA; | ||
3261 | 287 | goto out; | ||
3262 | 288 | } | ||
3263 | 289 | |||
3264 | 290 | IWL_DEBUG_COEX(mvm, "LTE-COEX: state cmd:\n\tstate: %d\n", | ||
3265 | 291 | cmd->lte_state); | ||
3266 | 292 | |||
3267 | 293 | switch (cmd->lte_state) { | ||
3268 | 294 | case LTE_OFF: | ||
3269 | 295 | if (mvm->lte_state.has_config && | ||
3270 | 296 | mvm->lte_state.state != LTE_CONNECTED) { | ||
3271 | 297 | err = LTE_STATE_ERR; | ||
3272 | 298 | goto out; | ||
3273 | 299 | } | ||
3274 | 300 | mvm->lte_state.state = LTE_OFF; | ||
3275 | 301 | mvm->lte_state.has_config = 0; | ||
3276 | 302 | mvm->lte_state.has_rprtd_chan = 0; | ||
3277 | 303 | mvm->lte_state.has_sps = 0; | ||
3278 | 304 | mvm->lte_state.has_ft = 0; | ||
3279 | 305 | break; | ||
3280 | 306 | case LTE_IDLE: | ||
3281 | 307 | if (!mvm->lte_state.has_static || | ||
3282 | 308 | (mvm->lte_state.has_config && | ||
3283 | 309 | mvm->lte_state.state != LTE_CONNECTED)) { | ||
3284 | 310 | err = LTE_STATE_ERR; | ||
3285 | 311 | goto out; | ||
3286 | 312 | } | ||
3287 | 313 | mvm->lte_state.has_config = 0; | ||
3288 | 314 | mvm->lte_state.has_sps = 0; | ||
3289 | 315 | mvm->lte_state.state = LTE_IDLE; | ||
3290 | 316 | break; | ||
3291 | 317 | case LTE_CONNECTED: | ||
3292 | 318 | if (!(mvm->lte_state.has_config)) { | ||
3293 | 319 | err = LTE_STATE_ERR; | ||
3294 | 320 | goto out; | ||
3295 | 321 | } | ||
3296 | 322 | mvm->lte_state.state = LTE_CONNECTED; | ||
3297 | 323 | break; | ||
3298 | 324 | default: | ||
3299 | 325 | err = LTE_ILLEGAL_PARAMS; | ||
3300 | 326 | goto out; | ||
3301 | 327 | } | ||
3302 | 328 | |||
3303 | 329 | mvm->lte_state.config.lte_state = cpu_to_le32(mvm->lte_state.state); | ||
3304 | 330 | |||
3305 | 331 | mutex_lock(&mvm->mutex); | ||
3306 | 332 | if (iwl_mvm_send_lte_coex_config_cmd(mvm)) | ||
3307 | 333 | err = LTE_OTHER_ERR; | ||
3308 | 334 | mutex_unlock(&mvm->mutex); | ||
3309 | 335 | |||
3310 | 336 | out: | ||
3311 | 337 | if (err) | ||
3312 | 338 | iwl_mvm_reset_lte_state(mvm); | ||
3313 | 339 | |||
3314 | 340 | if (nla_put_u8(skb, NLA_BINARY, err)) { | ||
3315 | 341 | kfree_skb(skb); | ||
3316 | 342 | return -ENOBUFS; | ||
3317 | 343 | } | ||
3318 | 344 | |||
3319 | 345 | return cfg80211_vendor_cmd_reply(skb); | ||
3320 | 346 | } | ||
3321 | 347 | |||
3322 | 348 | static int iwl_vendor_lte_coex_config_cmd(struct wiphy *wiphy, | ||
3323 | 349 | struct wireless_dev *wdev, | ||
3324 | 350 | const void *data, int data_len) | ||
3325 | 351 | { | ||
3326 | 352 | struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy); | ||
3327 | 353 | struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); | ||
3328 | 354 | const struct lte_coex_config_info_cmd *cmd = data; | ||
3329 | 355 | struct iwl_lte_coex_static_params_cmd *stat = &mvm->lte_state.stat; | ||
3330 | 356 | struct sk_buff *skb; | ||
3331 | 357 | int err = LTE_OK; | ||
3332 | 358 | int i, j; | ||
3333 | 359 | |||
3334 | 360 | skb = cfg80211_vendor_cmd_alloc_reply_skb(wiphy, 100); | ||
3335 | 361 | if (!skb) | ||
3336 | 362 | return -ENOMEM; | ||
3337 | 363 | |||
3338 | 364 | if (data_len != sizeof(*cmd)) { | ||
3339 | 365 | err = LTE_INVALID_DATA; | ||
3340 | 366 | goto out; | ||
3341 | 367 | } | ||
3342 | 368 | |||
3343 | 369 | IWL_DEBUG_COEX(mvm, "LTE-COEX: config cmd:\n"); | ||
3344 | 370 | |||
3345 | 371 | /* send static config only once in the FW life */ | ||
3346 | 372 | if (mvm->lte_state.has_static) | ||
3347 | 373 | goto out; | ||
3348 | 374 | |||
3349 | 375 | for (i = 0; i < LTE_MWS_CONF_LENGTH; i++) { | ||
3350 | 376 | IWL_DEBUG_COEX(mvm, "\tmws config data[%d]: %d\n", i, | ||
3351 | 377 | cmd->mws_conf_data[i]); | ||
3352 | 378 | stat->mfu_config[i] = cpu_to_le32(cmd->mws_conf_data[i]); | ||
3353 | 379 | } | ||
3354 | 380 | |||
3355 | 381 | if (cmd->safe_power_table[0] != LTE_SAFE_PT_FIRST || | ||
3356 | 382 | cmd->safe_power_table[LTE_SAFE_PT_LENGTH - 1] != | ||
3357 | 383 | LTE_SAFE_PT_LAST) { | ||
3358 | 384 | err = LTE_ILLEGAL_PARAMS; | ||
3359 | 385 | goto out; | ||
3360 | 386 | } | ||
3361 | 387 | |||
3362 | 388 | /* power table must be ascending ordered */ | ||
3363 | 389 | j = LTE_SAFE_PT_FIRST; | ||
3364 | 390 | for (i = 0; i < LTE_SAFE_PT_LENGTH; i++) { | ||
3365 | 391 | IWL_DEBUG_COEX(mvm, "\tsafe power table[%d]: %d\n", i, | ||
3366 | 392 | cmd->safe_power_table[i]); | ||
3367 | 393 | if (cmd->safe_power_table[i] < j) { | ||
3368 | 394 | err = LTE_ILLEGAL_PARAMS; | ||
3369 | 395 | goto out; | ||
3370 | 396 | } | ||
3371 | 397 | j = cmd->safe_power_table[i]; | ||
3372 | 398 | stat->tx_power_in_dbm[i] = cmd->safe_power_table[i]; | ||
3373 | 399 | } | ||
3374 | 400 | |||
3375 | 401 | mutex_lock(&mvm->mutex); | ||
3376 | 402 | if (iwl_mvm_send_lte_coex_static_params_cmd(mvm)) | ||
3377 | 403 | err = LTE_OTHER_ERR; | ||
3378 | 404 | else | ||
3379 | 405 | mvm->lte_state.has_static = 1; | ||
3380 | 406 | mutex_unlock(&mvm->mutex); | ||
3381 | 407 | |||
3382 | 408 | out: | ||
3383 | 409 | if (err) | ||
3384 | 410 | iwl_mvm_reset_lte_state(mvm); | ||
3385 | 411 | |||
3386 | 412 | if (nla_put_u8(skb, NLA_BINARY, err)) { | ||
3387 | 413 | kfree_skb(skb); | ||
3388 | 414 | return -ENOBUFS; | ||
3389 | 415 | } | ||
3390 | 416 | |||
3391 | 417 | return cfg80211_vendor_cmd_reply(skb); | ||
3392 | 418 | } | ||
3393 | 419 | |||
3394 | 420 | static int in_range(int val, int min, int max) | ||
3395 | 421 | { | ||
3396 | 422 | return (val >= min) && (val <= max); | ||
3397 | 423 | } | ||
3398 | 424 | |||
3399 | 425 | static bool is_valid_lte_range(u16 min, u16 max) | ||
3400 | 426 | { | ||
3401 | 427 | return (min == 0 && max == 0) || | ||
3402 | 428 | (max >= min && | ||
3403 | 429 | in_range(min, LTE_FRQ_MIN, LTE_FRQ_MAX) && | ||
3404 | 430 | in_range(max, LTE_FRQ_MIN, LTE_FRQ_MAX)); | ||
3405 | 431 | } | ||
3406 | 432 | |||
3407 | 433 | static int iwl_vendor_lte_coex_dynamic_info_cmd(struct wiphy *wiphy, | ||
3408 | 434 | struct wireless_dev *wdev, | ||
3409 | 435 | const void *data, int data_len) | ||
3410 | 436 | { | ||
3411 | 437 | struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy); | ||
3412 | 438 | struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); | ||
3413 | 439 | const struct lte_coex_dynamic_info_cmd *cmd = data; | ||
3414 | 440 | struct iwl_lte_coex_config_cmd *config = &mvm->lte_state.config; | ||
3415 | 441 | struct sk_buff *skb; | ||
3416 | 442 | int err = LTE_OK; | ||
3417 | 443 | int i; | ||
3418 | 444 | |||
3419 | 445 | skb = cfg80211_vendor_cmd_alloc_reply_skb(wiphy, 100); | ||
3420 | 446 | if (!skb) | ||
3421 | 447 | return -ENOMEM; | ||
3422 | 448 | |||
3423 | 449 | if (data_len != sizeof(*cmd)) { | ||
3424 | 450 | err = LTE_INVALID_DATA; | ||
3425 | 451 | goto out; | ||
3426 | 452 | } | ||
3427 | 453 | |||
3428 | 454 | if (!mvm->lte_state.has_static || | ||
3429 | 455 | (mvm->lte_state.has_config && | ||
3430 | 456 | mvm->lte_state.state != LTE_CONNECTED)) { | ||
3431 | 457 | err = LTE_STATE_ERR; | ||
3432 | 458 | goto out; | ||
3433 | 459 | } | ||
3434 | 460 | |||
3435 | 461 | IWL_DEBUG_COEX(mvm, "LTE-COEX: dynamic cmd:\n" | ||
3436 | 462 | "\tlte band[0]: %d, chan[0]: %d\n\ttx range: %d - %d\n" | ||
3437 | 463 | "\trx range: %d - %d\n", cmd->lte_connected_bands[0], | ||
3438 | 464 | cmd->lte_connected_bands[1], cmd->wifi_tx_safe_freq_min, | ||
3439 | 465 | cmd->wifi_tx_safe_freq_max, cmd->wifi_rx_safe_freq_min, | ||
3440 | 466 | cmd->wifi_rx_safe_freq_max); | ||
3441 | 467 | |||
3442 | 468 | /* TODO: validate lte connected bands and channel, and frame struct */ | ||
3443 | 469 | config->lte_band = cpu_to_le32(cmd->lte_connected_bands[0]); | ||
3444 | 470 | config->lte_chan = cpu_to_le32(cmd->lte_connected_bands[1]); | ||
3445 | 471 | for (i = 0; i < LTE_FRAME_STRUCT_LENGTH; i++) { | ||
3446 | 472 | IWL_DEBUG_COEX(mvm, "\tframe structure[%d]: %d\n", i, | ||
3447 | 473 | cmd->lte_frame_structure[i]); | ||
3448 | 474 | config->lte_frame_structure[i] = | ||
3449 | 475 | cpu_to_le32(cmd->lte_frame_structure[i]); | ||
3450 | 476 | } | ||
3451 | 477 | if (!is_valid_lte_range(cmd->wifi_tx_safe_freq_min, | ||
3452 | 478 | cmd->wifi_tx_safe_freq_max) || | ||
3453 | 479 | !is_valid_lte_range(cmd->wifi_rx_safe_freq_min, | ||
3454 | 480 | cmd->wifi_rx_safe_freq_max)) { | ||
3455 | 481 | err = LTE_ILLEGAL_PARAMS; | ||
3456 | 482 | goto out; | ||
3457 | 483 | } | ||
3458 | 484 | config->tx_safe_freq_min = cpu_to_le32(cmd->wifi_tx_safe_freq_min); | ||
3459 | 485 | config->tx_safe_freq_max = cpu_to_le32(cmd->wifi_tx_safe_freq_max); | ||
3460 | 486 | config->rx_safe_freq_min = cpu_to_le32(cmd->wifi_rx_safe_freq_min); | ||
3461 | 487 | config->rx_safe_freq_max = cpu_to_le32(cmd->wifi_rx_safe_freq_max); | ||
3462 | 488 | for (i = 0; i < LTE_TX_POWER_LENGTH; i++) { | ||
3463 | 489 | IWL_DEBUG_COEX(mvm, "\twifi max tx power[%d]: %d\n", i, | ||
3464 | 490 | cmd->wifi_max_tx_power[i]); | ||
3465 | 491 | if (!in_range(cmd->wifi_max_tx_power[i], LTE_MAX_TX_MIN, | ||
3466 | 492 | LTE_MAX_TX_MAX)) { | ||
3467 | 493 | err = LTE_ILLEGAL_PARAMS; | ||
3468 | 494 | goto out; | ||
3469 | 495 | } | ||
3470 | 496 | config->max_tx_power[i] = cmd->wifi_max_tx_power[i]; | ||
3471 | 497 | } | ||
3472 | 498 | |||
3473 | 499 | mvm->lte_state.has_config = 1; | ||
3474 | 500 | |||
3475 | 501 | if (mvm->lte_state.state == LTE_CONNECTED) { | ||
3476 | 502 | mutex_lock(&mvm->mutex); | ||
3477 | 503 | if (iwl_mvm_send_lte_coex_config_cmd(mvm)) | ||
3478 | 504 | err = LTE_OTHER_ERR; | ||
3479 | 505 | mutex_unlock(&mvm->mutex); | ||
3480 | 506 | } | ||
3481 | 507 | out: | ||
3482 | 508 | if (err) | ||
3483 | 509 | iwl_mvm_reset_lte_state(mvm); | ||
3484 | 510 | |||
3485 | 511 | if (nla_put_u8(skb, NLA_BINARY, err)) { | ||
3486 | 512 | kfree_skb(skb); | ||
3487 | 513 | return -ENOBUFS; | ||
3488 | 514 | } | ||
3489 | 515 | |||
3490 | 516 | return cfg80211_vendor_cmd_reply(skb); | ||
3491 | 517 | } | ||
3492 | 518 | |||
3493 | 519 | static int iwl_vendor_lte_sps_cmd(struct wiphy *wiphy, | ||
3494 | 520 | struct wireless_dev *wdev, const void *data, | ||
3495 | 521 | int data_len) | ||
3496 | 522 | { | ||
3497 | 523 | struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy); | ||
3498 | 524 | struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); | ||
3499 | 525 | const struct lte_coex_sps_info_cmd *cmd = data; | ||
3500 | 526 | struct iwl_lte_coex_sps_cmd *sps = &mvm->lte_state.sps; | ||
3501 | 527 | struct sk_buff *skb; | ||
3502 | 528 | int err = LTE_OK; | ||
3503 | 529 | |||
3504 | 530 | skb = cfg80211_vendor_cmd_alloc_reply_skb(wiphy, 100); | ||
3505 | 531 | if (!skb) | ||
3506 | 532 | return -ENOMEM; | ||
3507 | 533 | |||
3508 | 534 | if (data_len != sizeof(*cmd)) { | ||
3509 | 535 | err = LTE_INVALID_DATA; | ||
3510 | 536 | goto out; | ||
3511 | 537 | } | ||
3512 | 538 | |||
3513 | 539 | IWL_DEBUG_COEX(mvm, "LTE-COEX: sps cmd:\n\tsps info: %d\n", | ||
3514 | 540 | cmd->sps_info); | ||
3515 | 541 | |||
3516 | 542 | if (mvm->lte_state.state != LTE_CONNECTED) { | ||
3517 | 543 | err = LTE_STATE_ERR; | ||
3518 | 544 | goto out; | ||
3519 | 545 | } | ||
3520 | 546 | |||
3521 | 547 | /* TODO: validate SPS */ | ||
3522 | 548 | sps->lte_semi_persistent_info = cpu_to_le32(cmd->sps_info); | ||
3523 | 549 | |||
3524 | 550 | mutex_lock(&mvm->mutex); | ||
3525 | 551 | if (iwl_mvm_send_lte_sps_cmd(mvm)) | ||
3526 | 552 | err = LTE_OTHER_ERR; | ||
3527 | 553 | else | ||
3528 | 554 | mvm->lte_state.has_sps = 1; | ||
3529 | 555 | mutex_unlock(&mvm->mutex); | ||
3530 | 556 | |||
3531 | 557 | out: | ||
3532 | 558 | if (err) | ||
3533 | 559 | iwl_mvm_reset_lte_state(mvm); | ||
3534 | 560 | |||
3535 | 561 | if (nla_put_u8(skb, NLA_BINARY, err)) { | ||
3536 | 562 | kfree_skb(skb); | ||
3537 | 563 | return -ENOBUFS; | ||
3538 | 564 | } | ||
3539 | 565 | |||
3540 | 566 | return cfg80211_vendor_cmd_reply(skb); | ||
3541 | 567 | } | ||
3542 | 568 | |||
3543 | 569 | static int | ||
3544 | 570 | iwl_vendor_lte_coex_wifi_reported_channel_cmd(struct wiphy *wiphy, | ||
3545 | 571 | struct wireless_dev *wdev, | ||
3546 | 572 | const void *data, int data_len) | ||
3547 | 573 | { | ||
3548 | 574 | struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy); | ||
3549 | 575 | struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); | ||
3550 | 576 | const struct lte_coex_wifi_reported_chan_cmd *cmd = data; | ||
3551 | 577 | struct iwl_lte_coex_wifi_reported_channel_cmd *rprtd_chan = | ||
3552 | 578 | &mvm->lte_state.rprtd_chan; | ||
3553 | 579 | struct sk_buff *skb; | ||
3554 | 580 | int err = LTE_OK; | ||
3555 | 581 | |||
3556 | 582 | skb = cfg80211_vendor_cmd_alloc_reply_skb(wiphy, 100); | ||
3557 | 583 | if (!skb) | ||
3558 | 584 | return -ENOMEM; | ||
3559 | 585 | |||
3560 | 586 | if (data_len != sizeof(*cmd)) { | ||
3561 | 587 | err = LTE_INVALID_DATA; | ||
3562 | 588 | goto out; | ||
3563 | 589 | } | ||
3564 | 590 | |||
3565 | 591 | IWL_DEBUG_COEX(mvm, "LTE-COEX: wifi reported channel cmd:\n" | ||
3566 | 592 | "\tchannel: %d, bandwidth: %d\n", cmd->chan, | ||
3567 | 593 | cmd->bandwidth); | ||
3568 | 594 | |||
3569 | 595 | if (!in_range(cmd->chan, LTE_RC_CHAN_MIN, LTE_RC_CHAN_MAX) || | ||
3570 | 596 | !in_range(cmd->bandwidth, LTE_RC_BW_MIN, LTE_RC_BW_MAX)) { | ||
3571 | 597 | err = LTE_ILLEGAL_PARAMS; | ||
3572 | 598 | goto out; | ||
3573 | 599 | } | ||
3574 | 600 | |||
3575 | 601 | rprtd_chan->channel = cpu_to_le32(cmd->chan); | ||
3576 | 602 | rprtd_chan->bandwidth = cpu_to_le32(cmd->bandwidth); | ||
3577 | 603 | |||
3578 | 604 | mutex_lock(&mvm->mutex); | ||
3579 | 605 | if (iwl_mvm_send_lte_coex_wifi_reported_channel_cmd(mvm)) | ||
3580 | 606 | err = LTE_OTHER_ERR; | ||
3581 | 607 | else | ||
3582 | 608 | mvm->lte_state.has_rprtd_chan = 1; | ||
3583 | 609 | mutex_unlock(&mvm->mutex); | ||
3584 | 610 | |||
3585 | 611 | out: | ||
3586 | 612 | if (err) | ||
3587 | 613 | iwl_mvm_reset_lte_state(mvm); | ||
3588 | 614 | |||
3589 | 615 | if (nla_put_u8(skb, NLA_BINARY, err)) { | ||
3590 | 616 | kfree_skb(skb); | ||
3591 | 617 | return -ENOBUFS; | ||
3592 | 618 | } | ||
3593 | 619 | |||
3594 | 620 | return cfg80211_vendor_cmd_reply(skb); | ||
3595 | 621 | } | ||
3596 | 622 | #endif /* CPTCFG_IWLWIFI_LTE_COEX */ | ||
3597 | 623 | |||
3598 | 624 | static int iwl_vendor_frame_filter_cmd(struct wiphy *wiphy, | 266 | static int iwl_vendor_frame_filter_cmd(struct wiphy *wiphy, |
3599 | 625 | struct wireless_dev *wdev, | 267 | struct wireless_dev *wdev, |
3600 | 626 | const void *data, int data_len) | 268 | const void *data, int data_len) |
3601 | @@ -1563,53 +1205,6 @@ static const struct wiphy_vendor_command iwl_mvm_vendor_commands[] = { | |||
3602 | 1563 | WIPHY_VENDOR_CMD_NEED_RUNNING, | 1205 | WIPHY_VENDOR_CMD_NEED_RUNNING, |
3603 | 1564 | .doit = iwl_mvm_get_low_latency, | 1206 | .doit = iwl_mvm_get_low_latency, |
3604 | 1565 | }, | 1207 | }, |
3605 | 1566 | #ifdef CPTCFG_IWLWIFI_LTE_COEX | ||
3606 | 1567 | { | ||
3607 | 1568 | .info = { | ||
3608 | 1569 | .vendor_id = INTEL_OUI, | ||
3609 | 1570 | .subcmd = IWL_MVM_VENDOR_CMD_LTE_STATE, | ||
3610 | 1571 | }, | ||
3611 | 1572 | .flags = WIPHY_VENDOR_CMD_NEED_NETDEV | | ||
3612 | 1573 | WIPHY_VENDOR_CMD_NEED_RUNNING, | ||
3613 | 1574 | .doit = iwl_vendor_lte_coex_state_cmd, | ||
3614 | 1575 | }, | ||
3615 | 1576 | { | ||
3616 | 1577 | .info = { | ||
3617 | 1578 | .vendor_id = INTEL_OUI, | ||
3618 | 1579 | .subcmd = IWL_MVM_VENDOR_CMD_LTE_COEX_CONFIG_INFO, | ||
3619 | 1580 | }, | ||
3620 | 1581 | .flags = WIPHY_VENDOR_CMD_NEED_NETDEV | | ||
3621 | 1582 | WIPHY_VENDOR_CMD_NEED_RUNNING, | ||
3622 | 1583 | .doit = iwl_vendor_lte_coex_config_cmd, | ||
3623 | 1584 | }, | ||
3624 | 1585 | { | ||
3625 | 1586 | .info = { | ||
3626 | 1587 | .vendor_id = INTEL_OUI, | ||
3627 | 1588 | .subcmd = IWL_MVM_VENDOR_CMD_LTE_COEX_DYNAMIC_INFO, | ||
3628 | 1589 | }, | ||
3629 | 1590 | .flags = WIPHY_VENDOR_CMD_NEED_NETDEV | | ||
3630 | 1591 | WIPHY_VENDOR_CMD_NEED_RUNNING, | ||
3631 | 1592 | .doit = iwl_vendor_lte_coex_dynamic_info_cmd, | ||
3632 | 1593 | }, | ||
3633 | 1594 | { | ||
3634 | 1595 | .info = { | ||
3635 | 1596 | .vendor_id = INTEL_OUI, | ||
3636 | 1597 | .subcmd = IWL_MVM_VENDOR_CMD_LTE_COEX_SPS_INFO, | ||
3637 | 1598 | }, | ||
3638 | 1599 | .flags = WIPHY_VENDOR_CMD_NEED_NETDEV | | ||
3639 | 1600 | WIPHY_VENDOR_CMD_NEED_RUNNING, | ||
3640 | 1601 | .doit = iwl_vendor_lte_sps_cmd, | ||
3641 | 1602 | }, | ||
3642 | 1603 | { | ||
3643 | 1604 | .info = { | ||
3644 | 1605 | .vendor_id = INTEL_OUI, | ||
3645 | 1606 | .subcmd = IWL_MVM_VENDOR_CMD_LTE_COEX_WIFI_RPRTD_CHAN, | ||
3646 | 1607 | }, | ||
3647 | 1608 | .flags = WIPHY_VENDOR_CMD_NEED_NETDEV | | ||
3648 | 1609 | WIPHY_VENDOR_CMD_NEED_RUNNING, | ||
3649 | 1610 | .doit = iwl_vendor_lte_coex_wifi_reported_channel_cmd, | ||
3650 | 1611 | }, | ||
3651 | 1612 | #endif /* CPTCFG_IWLWIFI_LTE_COEX */ | ||
3652 | 1613 | { | 1208 | { |
3653 | 1614 | .info = { | 1209 | .info = { |
3654 | 1615 | .vendor_id = INTEL_OUI, | 1210 | .vendor_id = INTEL_OUI, |
3655 | diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c | |||
3656 | index 8b2364a..fee789b 100644 | |||
3657 | --- a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c | |||
3658 | +++ b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c | |||
3659 | @@ -65,7 +65,6 @@ | |||
3660 | 65 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | 65 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
3661 | 66 | 66 | ||
3662 | 67 | #include <linux/module.h> | 67 | #include <linux/module.h> |
3663 | 68 | #include <linux/pm_runtime.h> | ||
3664 | 69 | #include <linux/pci.h> | 68 | #include <linux/pci.h> |
3665 | 70 | #include <linux/acpi.h> | 69 | #include <linux/acpi.h> |
3666 | 71 | 70 | ||
3667 | @@ -875,25 +874,6 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
3668 | 875 | /* register transport layer debugfs here */ | 874 | /* register transport layer debugfs here */ |
3669 | 876 | iwl_trans_pcie_dbgfs_register(iwl_trans); | 875 | iwl_trans_pcie_dbgfs_register(iwl_trans); |
3670 | 877 | 876 | ||
3671 | 878 | /* if RTPM is in use, enable it in our device */ | ||
3672 | 879 | if (iwl_trans->runtime_pm_mode != IWL_PLAT_PM_MODE_DISABLED) { | ||
3673 | 880 | /* We explicitly set the device to active here to | ||
3674 | 881 | * clear contingent errors. | ||
3675 | 882 | */ | ||
3676 | 883 | pm_runtime_set_active(&pdev->dev); | ||
3677 | 884 | |||
3678 | 885 | pm_runtime_set_autosuspend_delay(&pdev->dev, | ||
3679 | 886 | iwlwifi_mod_params.d0i3_timeout); | ||
3680 | 887 | pm_runtime_use_autosuspend(&pdev->dev); | ||
3681 | 888 | |||
3682 | 889 | /* We are not supposed to call pm_runtime_allow() by | ||
3683 | 890 | * ourselves, but let userspace enable runtime PM via | ||
3684 | 891 | * sysfs. However, since we don't enable this from | ||
3685 | 892 | * userspace yet, we need to allow/forbid() ourselves. | ||
3686 | 893 | */ | ||
3687 | 894 | pm_runtime_allow(&pdev->dev); | ||
3688 | 895 | } | ||
3689 | 896 | |||
3690 | 897 | /* The PCI device starts with a reference taken and we are | 877 | /* The PCI device starts with a reference taken and we are |
3691 | 898 | * supposed to release it here. But to simplify the | 878 | * supposed to release it here. But to simplify the |
3692 | 899 | * interaction with the opmode, we don't do it now, but let | 879 | * interaction with the opmode, we don't do it now, but let |
3693 | @@ -911,15 +891,6 @@ static void iwl_pci_remove(struct pci_dev *pdev) | |||
3694 | 911 | { | 891 | { |
3695 | 912 | struct iwl_trans *trans = pci_get_drvdata(pdev); | 892 | struct iwl_trans *trans = pci_get_drvdata(pdev); |
3696 | 913 | 893 | ||
3697 | 914 | /* if RTPM was in use, restore it to the state before probe */ | ||
3698 | 915 | if (trans->runtime_pm_mode != IWL_PLAT_PM_MODE_DISABLED) { | ||
3699 | 916 | /* We should not call forbid here, but we do for now. | ||
3700 | 917 | * Check the comment to pm_runtime_allow() in | ||
3701 | 918 | * iwl_pci_probe(). | ||
3702 | 919 | */ | ||
3703 | 920 | pm_runtime_forbid(trans->dev); | ||
3704 | 921 | } | ||
3705 | 922 | |||
3706 | 923 | iwl_drv_stop(trans->drv); | 894 | iwl_drv_stop(trans->drv); |
3707 | 924 | 895 | ||
3708 | 925 | iwl_trans_pcie_free(trans); | 896 | iwl_trans_pcie_free(trans); |
3709 | @@ -977,76 +948,6 @@ static int iwl_pci_resume(struct device *device) | |||
3710 | 977 | return 0; | 948 | return 0; |
3711 | 978 | } | 949 | } |
3712 | 979 | 950 | ||
3713 | 980 | int iwl_pci_fw_enter_d0i3(struct iwl_trans *trans) | ||
3714 | 981 | { | ||
3715 | 982 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); | ||
3716 | 983 | int ret; | ||
3717 | 984 | |||
3718 | 985 | if (test_bit(STATUS_FW_ERROR, &trans->status)) | ||
3719 | 986 | return 0; | ||
3720 | 987 | |||
3721 | 988 | set_bit(STATUS_TRANS_GOING_IDLE, &trans->status); | ||
3722 | 989 | |||
3723 | 990 | /* config the fw */ | ||
3724 | 991 | ret = iwl_op_mode_enter_d0i3(trans->op_mode); | ||
3725 | 992 | if (ret == 1) { | ||
3726 | 993 | IWL_DEBUG_RPM(trans, "aborting d0i3 entrance\n"); | ||
3727 | 994 | clear_bit(STATUS_TRANS_GOING_IDLE, &trans->status); | ||
3728 | 995 | return -EBUSY; | ||
3729 | 996 | } | ||
3730 | 997 | if (ret) | ||
3731 | 998 | goto err; | ||
3732 | 999 | |||
3733 | 1000 | ret = wait_event_timeout(trans_pcie->d0i3_waitq, | ||
3734 | 1001 | test_bit(STATUS_TRANS_IDLE, &trans->status), | ||
3735 | 1002 | msecs_to_jiffies(IWL_TRANS_IDLE_TIMEOUT)); | ||
3736 | 1003 | if (!ret) { | ||
3737 | 1004 | IWL_ERR(trans, "Timeout entering D0i3\n"); | ||
3738 | 1005 | ret = -ETIMEDOUT; | ||
3739 | 1006 | goto err; | ||
3740 | 1007 | } | ||
3741 | 1008 | |||
3742 | 1009 | clear_bit(STATUS_TRANS_GOING_IDLE, &trans->status); | ||
3743 | 1010 | |||
3744 | 1011 | return 0; | ||
3745 | 1012 | err: | ||
3746 | 1013 | clear_bit(STATUS_TRANS_GOING_IDLE, &trans->status); | ||
3747 | 1014 | iwl_trans_fw_error(trans); | ||
3748 | 1015 | return ret; | ||
3749 | 1016 | } | ||
3750 | 1017 | |||
3751 | 1018 | int iwl_pci_fw_exit_d0i3(struct iwl_trans *trans) | ||
3752 | 1019 | { | ||
3753 | 1020 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); | ||
3754 | 1021 | int ret; | ||
3755 | 1022 | |||
3756 | 1023 | /* sometimes a D0i3 entry is not followed through */ | ||
3757 | 1024 | if (!test_bit(STATUS_TRANS_IDLE, &trans->status)) | ||
3758 | 1025 | return 0; | ||
3759 | 1026 | |||
3760 | 1027 | /* config the fw */ | ||
3761 | 1028 | ret = iwl_op_mode_exit_d0i3(trans->op_mode); | ||
3762 | 1029 | if (ret) | ||
3763 | 1030 | goto err; | ||
3764 | 1031 | |||
3765 | 1032 | /* we clear STATUS_TRANS_IDLE only when D0I3_END command is completed */ | ||
3766 | 1033 | |||
3767 | 1034 | ret = wait_event_timeout(trans_pcie->d0i3_waitq, | ||
3768 | 1035 | !test_bit(STATUS_TRANS_IDLE, &trans->status), | ||
3769 | 1036 | msecs_to_jiffies(IWL_TRANS_IDLE_TIMEOUT)); | ||
3770 | 1037 | if (!ret) { | ||
3771 | 1038 | IWL_ERR(trans, "Timeout exiting D0i3\n"); | ||
3772 | 1039 | ret = -ETIMEDOUT; | ||
3773 | 1040 | goto err; | ||
3774 | 1041 | } | ||
3775 | 1042 | |||
3776 | 1043 | return 0; | ||
3777 | 1044 | err: | ||
3778 | 1045 | clear_bit(STATUS_TRANS_IDLE, &trans->status); | ||
3779 | 1046 | iwl_trans_fw_error(trans); | ||
3780 | 1047 | return ret; | ||
3781 | 1048 | } | ||
3782 | 1049 | |||
3783 | 1050 | static const struct dev_pm_ops iwl_dev_pm_ops = { | 951 | static const struct dev_pm_ops iwl_dev_pm_ops = { |
3784 | 1051 | SET_SYSTEM_SLEEP_PM_OPS(iwl_pci_suspend, | 952 | SET_SYSTEM_SLEEP_PM_OPS(iwl_pci_suspend, |
3785 | 1052 | iwl_pci_resume) | 953 | iwl_pci_resume) |
3786 | diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/internal.h b/drivers/net/wireless/intel/iwlwifi/pcie/internal.h | |||
3787 | index 1f8e9a6..48017cc 100644 | |||
3788 | --- a/drivers/net/wireless/intel/iwlwifi/pcie/internal.h | |||
3789 | +++ b/drivers/net/wireless/intel/iwlwifi/pcie/internal.h | |||
3790 | @@ -558,7 +558,6 @@ struct iwl_trans_pcie { | |||
3791 | 558 | bool ucode_write_complete; | 558 | bool ucode_write_complete; |
3792 | 559 | wait_queue_head_t ucode_write_waitq; | 559 | wait_queue_head_t ucode_write_waitq; |
3793 | 560 | wait_queue_head_t wait_command_queue; | 560 | wait_queue_head_t wait_command_queue; |
3794 | 561 | wait_queue_head_t d0i3_waitq; | ||
3795 | 562 | 561 | ||
3796 | 563 | u8 page_offs, dev_cmd_offs; | 562 | u8 page_offs, dev_cmd_offs; |
3797 | 564 | 563 | ||
3798 | @@ -581,7 +580,6 @@ struct iwl_trans_pcie { | |||
3799 | 581 | /*protect hw register */ | 580 | /*protect hw register */ |
3800 | 582 | spinlock_t reg_lock; | 581 | spinlock_t reg_lock; |
3801 | 583 | bool cmd_hold_nic_awake; | 582 | bool cmd_hold_nic_awake; |
3802 | 584 | bool ref_cmd_in_flight; | ||
3803 | 585 | 583 | ||
3804 | 586 | #ifdef CPTCFG_IWLWIFI_DEBUGFS | 584 | #ifdef CPTCFG_IWLWIFI_DEBUGFS |
3805 | 587 | struct cont_rec fw_mon_data; | 585 | struct cont_rec fw_mon_data; |
3806 | @@ -696,6 +694,7 @@ void iwl_pcie_hcmd_complete(struct iwl_trans *trans, | |||
3807 | 696 | struct iwl_rx_cmd_buffer *rxb); | 694 | struct iwl_rx_cmd_buffer *rxb); |
3808 | 697 | void iwl_trans_pcie_reclaim(struct iwl_trans *trans, int txq_id, int ssn, | 695 | void iwl_trans_pcie_reclaim(struct iwl_trans *trans, int txq_id, int ssn, |
3809 | 698 | struct sk_buff_head *skbs); | 696 | struct sk_buff_head *skbs); |
3810 | 697 | void iwl_trans_pcie_set_q_ptrs(struct iwl_trans *trans, int txq_id, int ptr); | ||
3811 | 699 | void iwl_trans_pcie_tx_reset(struct iwl_trans *trans); | 698 | void iwl_trans_pcie_tx_reset(struct iwl_trans *trans); |
3812 | 700 | void iwl_pcie_gen2_update_byte_tbl(struct iwl_trans_pcie *trans_pcie, | 699 | void iwl_pcie_gen2_update_byte_tbl(struct iwl_trans_pcie *trans_pcie, |
3813 | 701 | struct iwl_txq *txq, u16 byte_cnt, | 700 | struct iwl_txq *txq, u16 byte_cnt, |
3814 | @@ -1063,9 +1062,6 @@ void iwl_trans_pcie_dbgfs_register(struct iwl_trans *trans); | |||
3815 | 1063 | static inline void iwl_trans_pcie_dbgfs_register(struct iwl_trans *trans) { } | 1062 | static inline void iwl_trans_pcie_dbgfs_register(struct iwl_trans *trans) { } |
3816 | 1064 | #endif | 1063 | #endif |
3817 | 1065 | 1064 | ||
3818 | 1066 | int iwl_pci_fw_exit_d0i3(struct iwl_trans *trans); | ||
3819 | 1067 | int iwl_pci_fw_enter_d0i3(struct iwl_trans *trans); | ||
3820 | 1068 | |||
3821 | 1069 | void iwl_pcie_rx_allocator_work(struct work_struct *data); | 1065 | void iwl_pcie_rx_allocator_work(struct work_struct *data); |
3822 | 1070 | 1066 | ||
3823 | 1071 | /* common functions that are used by gen2 transport */ | 1067 | /* common functions that are used by gen2 transport */ |
3824 | @@ -1119,9 +1115,8 @@ int iwl_trans_pcie_gen2_tx(struct iwl_trans *trans, struct sk_buff *skb, | |||
3825 | 1119 | struct iwl_device_cmd *dev_cmd, int txq_id); | 1115 | struct iwl_device_cmd *dev_cmd, int txq_id); |
3826 | 1120 | int iwl_trans_pcie_gen2_send_hcmd(struct iwl_trans *trans, | 1116 | int iwl_trans_pcie_gen2_send_hcmd(struct iwl_trans *trans, |
3827 | 1121 | struct iwl_host_cmd *cmd); | 1117 | struct iwl_host_cmd *cmd); |
3831 | 1122 | void iwl_trans_pcie_gen2_stop_device(struct iwl_trans *trans, | 1118 | void iwl_trans_pcie_gen2_stop_device(struct iwl_trans *trans); |
3832 | 1123 | bool low_power); | 1119 | void _iwl_trans_pcie_gen2_stop_device(struct iwl_trans *trans); |
3830 | 1124 | void _iwl_trans_pcie_gen2_stop_device(struct iwl_trans *trans, bool low_power); | ||
3833 | 1125 | void iwl_pcie_gen2_txq_unmap(struct iwl_trans *trans, int txq_id); | 1120 | void iwl_pcie_gen2_txq_unmap(struct iwl_trans *trans, int txq_id); |
3834 | 1126 | void iwl_pcie_gen2_tx_free(struct iwl_trans *trans); | 1121 | void iwl_pcie_gen2_tx_free(struct iwl_trans *trans); |
3835 | 1127 | void iwl_pcie_gen2_tx_stop(struct iwl_trans *trans); | 1122 | void iwl_pcie_gen2_tx_stop(struct iwl_trans *trans); |
3836 | diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c b/drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c | |||
3837 | index 104b7cc..c099ad8 100644 | |||
3838 | --- a/drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c | |||
3839 | +++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c | |||
3840 | @@ -136,7 +136,7 @@ static void iwl_pcie_gen2_apm_stop(struct iwl_trans *trans, bool op_mode_leave) | |||
3841 | 136 | BIT(trans->cfg->csr->flag_init_done)); | 136 | BIT(trans->cfg->csr->flag_init_done)); |
3842 | 137 | } | 137 | } |
3843 | 138 | 138 | ||
3845 | 139 | void _iwl_trans_pcie_gen2_stop_device(struct iwl_trans *trans, bool low_power) | 139 | void _iwl_trans_pcie_gen2_stop_device(struct iwl_trans *trans) |
3846 | 140 | { | 140 | { |
3847 | 141 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); | 141 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); |
3848 | 142 | 142 | ||
3849 | @@ -215,7 +215,7 @@ void _iwl_trans_pcie_gen2_stop_device(struct iwl_trans *trans, bool low_power) | |||
3850 | 215 | iwl_pcie_prepare_card_hw(trans); | 215 | iwl_pcie_prepare_card_hw(trans); |
3851 | 216 | } | 216 | } |
3852 | 217 | 217 | ||
3854 | 218 | void iwl_trans_pcie_gen2_stop_device(struct iwl_trans *trans, bool low_power) | 218 | void iwl_trans_pcie_gen2_stop_device(struct iwl_trans *trans) |
3855 | 219 | { | 219 | { |
3856 | 220 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); | 220 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); |
3857 | 221 | bool was_in_rfkill; | 221 | bool was_in_rfkill; |
3858 | @@ -223,7 +223,7 @@ void iwl_trans_pcie_gen2_stop_device(struct iwl_trans *trans, bool low_power) | |||
3859 | 223 | mutex_lock(&trans_pcie->mutex); | 223 | mutex_lock(&trans_pcie->mutex); |
3860 | 224 | trans_pcie->opmode_down = true; | 224 | trans_pcie->opmode_down = true; |
3861 | 225 | was_in_rfkill = test_bit(STATUS_RFKILL_OPMODE, &trans->status); | 225 | was_in_rfkill = test_bit(STATUS_RFKILL_OPMODE, &trans->status); |
3863 | 226 | _iwl_trans_pcie_gen2_stop_device(trans, low_power); | 226 | _iwl_trans_pcie_gen2_stop_device(trans); |
3864 | 227 | iwl_trans_pcie_handle_stop_rfkill(trans, was_in_rfkill); | 227 | iwl_trans_pcie_handle_stop_rfkill(trans, was_in_rfkill); |
3865 | 228 | mutex_unlock(&trans_pcie->mutex); | 228 | mutex_unlock(&trans_pcie->mutex); |
3866 | 229 | } | 229 | } |
3867 | diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c | |||
3868 | index 77e740d..1e63a59 100644 | |||
3869 | --- a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c | |||
3870 | +++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c | |||
3871 | @@ -69,7 +69,6 @@ | |||
3872 | 69 | #include <linux/bitops.h> | 69 | #include <linux/bitops.h> |
3873 | 70 | #include <linux/gfp.h> | 70 | #include <linux/gfp.h> |
3874 | 71 | #include <linux/vmalloc.h> | 71 | #include <linux/vmalloc.h> |
3875 | 72 | #include <linux/pm_runtime.h> | ||
3876 | 73 | #include <linux/module.h> | 72 | #include <linux/module.h> |
3877 | 74 | #include <linux/wait.h> | 73 | #include <linux/wait.h> |
3878 | 75 | 74 | ||
3879 | @@ -1279,7 +1278,7 @@ static void iwl_pcie_init_msix(struct iwl_trans_pcie *trans_pcie) | |||
3880 | 1279 | trans_pcie->hw_mask = trans_pcie->hw_init_mask; | 1278 | trans_pcie->hw_mask = trans_pcie->hw_init_mask; |
3881 | 1280 | } | 1279 | } |
3882 | 1281 | 1280 | ||
3884 | 1282 | static void _iwl_trans_pcie_stop_device(struct iwl_trans *trans, bool low_power) | 1281 | static void _iwl_trans_pcie_stop_device(struct iwl_trans *trans) |
3885 | 1283 | { | 1282 | { |
3886 | 1284 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); | 1283 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); |
3887 | 1285 | 1284 | ||
3888 | @@ -1495,7 +1494,7 @@ void iwl_trans_pcie_handle_stop_rfkill(struct iwl_trans *trans, | |||
3889 | 1495 | iwl_trans_pcie_rf_kill(trans, hw_rfkill); | 1494 | iwl_trans_pcie_rf_kill(trans, hw_rfkill); |
3890 | 1496 | } | 1495 | } |
3891 | 1497 | 1496 | ||
3893 | 1498 | static void iwl_trans_pcie_stop_device(struct iwl_trans *trans, bool low_power) | 1497 | static void iwl_trans_pcie_stop_device(struct iwl_trans *trans) |
3894 | 1499 | { | 1498 | { |
3895 | 1500 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); | 1499 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); |
3896 | 1501 | bool was_in_rfkill; | 1500 | bool was_in_rfkill; |
3897 | @@ -1503,7 +1502,7 @@ static void iwl_trans_pcie_stop_device(struct iwl_trans *trans, bool low_power) | |||
3898 | 1503 | mutex_lock(&trans_pcie->mutex); | 1502 | mutex_lock(&trans_pcie->mutex); |
3899 | 1504 | trans_pcie->opmode_down = true; | 1503 | trans_pcie->opmode_down = true; |
3900 | 1505 | was_in_rfkill = test_bit(STATUS_RFKILL_OPMODE, &trans->status); | 1504 | was_in_rfkill = test_bit(STATUS_RFKILL_OPMODE, &trans->status); |
3902 | 1506 | _iwl_trans_pcie_stop_device(trans, low_power); | 1505 | _iwl_trans_pcie_stop_device(trans); |
3903 | 1507 | iwl_trans_pcie_handle_stop_rfkill(trans, was_in_rfkill); | 1506 | iwl_trans_pcie_handle_stop_rfkill(trans, was_in_rfkill); |
3904 | 1508 | mutex_unlock(&trans_pcie->mutex); | 1507 | mutex_unlock(&trans_pcie->mutex); |
3905 | 1509 | } | 1508 | } |
3906 | @@ -1519,9 +1518,9 @@ void iwl_trans_pcie_rf_kill(struct iwl_trans *trans, bool state) | |||
3907 | 1519 | state ? "disabled" : "enabled"); | 1518 | state ? "disabled" : "enabled"); |
3908 | 1520 | if (iwl_op_mode_hw_rf_kill(trans->op_mode, state)) { | 1519 | if (iwl_op_mode_hw_rf_kill(trans->op_mode, state)) { |
3909 | 1521 | if (trans->cfg->gen2) | 1520 | if (trans->cfg->gen2) |
3911 | 1522 | _iwl_trans_pcie_gen2_stop_device(trans, true); | 1521 | _iwl_trans_pcie_gen2_stop_device(trans); |
3912 | 1523 | else | 1522 | else |
3914 | 1524 | _iwl_trans_pcie_stop_device(trans, true); | 1523 | _iwl_trans_pcie_stop_device(trans); |
3915 | 1525 | } | 1524 | } |
3916 | 1526 | } | 1525 | } |
3917 | 1527 | 1526 | ||
3918 | @@ -1780,7 +1779,7 @@ static int iwl_trans_pcie_clear_persistence_bit(struct iwl_trans *trans) | |||
3919 | 1780 | return 0; | 1779 | return 0; |
3920 | 1781 | } | 1780 | } |
3921 | 1782 | 1781 | ||
3923 | 1783 | static int _iwl_trans_pcie_start_hw(struct iwl_trans *trans, bool low_power) | 1782 | static int _iwl_trans_pcie_start_hw(struct iwl_trans *trans) |
3924 | 1784 | { | 1783 | { |
3925 | 1785 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); | 1784 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); |
3926 | 1786 | int err; | 1785 | int err; |
3927 | @@ -1816,20 +1815,16 @@ static int _iwl_trans_pcie_start_hw(struct iwl_trans *trans, bool low_power) | |||
3928 | 1816 | /* ...rfkill can call stop_device and set it false if needed */ | 1815 | /* ...rfkill can call stop_device and set it false if needed */ |
3929 | 1817 | iwl_pcie_check_hw_rf_kill(trans); | 1816 | iwl_pcie_check_hw_rf_kill(trans); |
3930 | 1818 | 1817 | ||
3931 | 1819 | /* Make sure we sync here, because we'll need full access later */ | ||
3932 | 1820 | if (low_power) | ||
3933 | 1821 | pm_runtime_resume(trans->dev); | ||
3934 | 1822 | |||
3935 | 1823 | return 0; | 1818 | return 0; |
3936 | 1824 | } | 1819 | } |
3937 | 1825 | 1820 | ||
3939 | 1826 | static int iwl_trans_pcie_start_hw(struct iwl_trans *trans, bool low_power) | 1821 | static int iwl_trans_pcie_start_hw(struct iwl_trans *trans) |
3940 | 1827 | { | 1822 | { |
3941 | 1828 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); | 1823 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); |
3942 | 1829 | int ret; | 1824 | int ret; |
3943 | 1830 | 1825 | ||
3944 | 1831 | mutex_lock(&trans_pcie->mutex); | 1826 | mutex_lock(&trans_pcie->mutex); |
3946 | 1832 | ret = _iwl_trans_pcie_start_hw(trans, low_power); | 1827 | ret = _iwl_trans_pcie_start_hw(trans); |
3947 | 1833 | mutex_unlock(&trans_pcie->mutex); | 1828 | mutex_unlock(&trans_pcie->mutex); |
3948 | 1834 | 1829 | ||
3949 | 1835 | return ret; | 1830 | return ret; |
3950 | @@ -2413,41 +2408,6 @@ static void iwl_trans_pcie_set_bits_mask(struct iwl_trans *trans, u32 reg, | |||
3951 | 2413 | spin_unlock_irqrestore(&trans_pcie->reg_lock, flags); | 2408 | spin_unlock_irqrestore(&trans_pcie->reg_lock, flags); |
3952 | 2414 | } | 2409 | } |
3953 | 2415 | 2410 | ||
3954 | 2416 | static void iwl_trans_pcie_ref(struct iwl_trans *trans) | ||
3955 | 2417 | { | ||
3956 | 2418 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); | ||
3957 | 2419 | |||
3958 | 2420 | if (iwlwifi_mod_params.d0i3_disable) | ||
3959 | 2421 | return; | ||
3960 | 2422 | |||
3961 | 2423 | pm_runtime_get(&trans_pcie->pci_dev->dev); | ||
3962 | 2424 | |||
3963 | 2425 | #ifdef CONFIG_PM | ||
3964 | 2426 | #if (defined(CONFIG_PM_RUNTIME) || LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0)) | ||
3965 | 2427 | IWL_DEBUG_RPM(trans, "runtime usage count: %d\n", | ||
3966 | 2428 | atomic_read(&trans_pcie->pci_dev->dev.power.usage_count)); | ||
3967 | 2429 | #endif | ||
3968 | 2430 | #endif /* CONFIG_PM */ | ||
3969 | 2431 | } | ||
3970 | 2432 | |||
3971 | 2433 | static void iwl_trans_pcie_unref(struct iwl_trans *trans) | ||
3972 | 2434 | { | ||
3973 | 2435 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); | ||
3974 | 2436 | |||
3975 | 2437 | if (iwlwifi_mod_params.d0i3_disable) | ||
3976 | 2438 | return; | ||
3977 | 2439 | |||
3978 | 2440 | pm_runtime_mark_last_busy(&trans_pcie->pci_dev->dev); | ||
3979 | 2441 | pm_runtime_put_autosuspend(&trans_pcie->pci_dev->dev); | ||
3980 | 2442 | |||
3981 | 2443 | #ifdef CONFIG_PM | ||
3982 | 2444 | #if (defined(CONFIG_PM_RUNTIME) || LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0)) | ||
3983 | 2445 | IWL_DEBUG_RPM(trans, "runtime usage count: %d\n", | ||
3984 | 2446 | atomic_read(&trans_pcie->pci_dev->dev.power.usage_count)); | ||
3985 | 2447 | #endif | ||
3986 | 2448 | #endif /* CONFIG_PM */ | ||
3987 | 2449 | } | ||
3988 | 2450 | |||
3989 | 2451 | static const char *get_csr_string(int cmd) | 2411 | static const char *get_csr_string(int cmd) |
3990 | 2452 | { | 2412 | { |
3991 | 2453 | #define IWL_CMD(x) case x: return #x | 2413 | #define IWL_CMD(x) case x: return #x |
3992 | @@ -3369,18 +3329,11 @@ static struct iwl_trans_dump_data | |||
3993 | 3369 | #ifdef CONFIG_PM_SLEEP | 3329 | #ifdef CONFIG_PM_SLEEP |
3994 | 3370 | static int iwl_trans_pcie_suspend(struct iwl_trans *trans) | 3330 | static int iwl_trans_pcie_suspend(struct iwl_trans *trans) |
3995 | 3371 | { | 3331 | { |
3996 | 3372 | if (trans->runtime_pm_mode == IWL_PLAT_PM_MODE_D0I3 && | ||
3997 | 3373 | (trans->system_pm_mode == IWL_PLAT_PM_MODE_D0I3)) | ||
3998 | 3374 | return iwl_pci_fw_enter_d0i3(trans); | ||
3999 | 3375 | |||
4000 | 3376 | return 0; | 3332 | return 0; |
4001 | 3377 | } | 3333 | } |
4002 | 3378 | 3334 | ||
4003 | 3379 | static void iwl_trans_pcie_resume(struct iwl_trans *trans) | 3335 | static void iwl_trans_pcie_resume(struct iwl_trans *trans) |
4004 | 3380 | { | 3336 | { |
4005 | 3381 | if (trans->runtime_pm_mode == IWL_PLAT_PM_MODE_D0I3 && | ||
4006 | 3382 | (trans->system_pm_mode == IWL_PLAT_PM_MODE_D0I3)) | ||
4007 | 3383 | iwl_pci_fw_exit_d0i3(trans); | ||
4008 | 3384 | } | 3337 | } |
4009 | 3385 | #endif /* CONFIG_PM_SLEEP */ | 3338 | #endif /* CONFIG_PM_SLEEP */ |
4010 | 3386 | 3339 | ||
4011 | @@ -3399,8 +3352,6 @@ static void iwl_trans_pcie_resume(struct iwl_trans *trans) | |||
4012 | 3399 | .grab_nic_access = iwl_trans_pcie_grab_nic_access, \ | 3352 | .grab_nic_access = iwl_trans_pcie_grab_nic_access, \ |
4013 | 3400 | .release_nic_access = iwl_trans_pcie_release_nic_access, \ | 3353 | .release_nic_access = iwl_trans_pcie_release_nic_access, \ |
4014 | 3401 | .set_bits_mask = iwl_trans_pcie_set_bits_mask, \ | 3354 | .set_bits_mask = iwl_trans_pcie_set_bits_mask, \ |
4015 | 3402 | .ref = iwl_trans_pcie_ref, \ | ||
4016 | 3403 | .unref = iwl_trans_pcie_unref, \ | ||
4017 | 3404 | .dump_data = iwl_trans_pcie_dump_data, \ | 3355 | .dump_data = iwl_trans_pcie_dump_data, \ |
4018 | 3405 | .d3_suspend = iwl_trans_pcie_d3_suspend, \ | 3356 | .d3_suspend = iwl_trans_pcie_d3_suspend, \ |
4019 | 3406 | .d3_resume = iwl_trans_pcie_d3_resume, \ | 3357 | .d3_resume = iwl_trans_pcie_d3_resume, \ |
4020 | @@ -3454,6 +3405,8 @@ static const struct iwl_trans_ops trans_ops_pcie_gen2 = { | |||
4021 | 3454 | .tx = iwl_trans_pcie_gen2_tx, | 3405 | .tx = iwl_trans_pcie_gen2_tx, |
4022 | 3455 | .reclaim = iwl_trans_pcie_reclaim, | 3406 | .reclaim = iwl_trans_pcie_reclaim, |
4023 | 3456 | 3407 | ||
4024 | 3408 | .set_q_ptrs = iwl_trans_pcie_set_q_ptrs, | ||
4025 | 3409 | |||
4026 | 3457 | .txq_alloc = iwl_trans_pcie_dyn_txq_alloc, | 3410 | .txq_alloc = iwl_trans_pcie_dyn_txq_alloc, |
4027 | 3458 | .txq_free = iwl_trans_pcie_dyn_txq_free, | 3411 | .txq_free = iwl_trans_pcie_dyn_txq_free, |
4028 | 3459 | .wait_txq_empty = iwl_trans_pcie_wait_txq_empty, | 3412 | .wait_txq_empty = iwl_trans_pcie_wait_txq_empty, |
4029 | @@ -3722,8 +3675,6 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev, | |||
4030 | 3722 | /* Initialize the wait queue for commands */ | 3675 | /* Initialize the wait queue for commands */ |
4031 | 3723 | init_waitqueue_head(&trans_pcie->wait_command_queue); | 3676 | init_waitqueue_head(&trans_pcie->wait_command_queue); |
4032 | 3724 | 3677 | ||
4033 | 3725 | init_waitqueue_head(&trans_pcie->d0i3_waitq); | ||
4034 | 3726 | |||
4035 | 3727 | if (trans_pcie->msix_enabled) { | 3678 | if (trans_pcie->msix_enabled) { |
4036 | 3728 | ret = iwl_pcie_init_msix_handler(pdev, trans_pcie); | 3679 | ret = iwl_pcie_init_msix_handler(pdev, trans_pcie); |
4037 | 3729 | if (ret) | 3680 | if (ret) |
4038 | @@ -3748,8 +3699,6 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev, | |||
4039 | 3748 | WQ_HIGHPRI | WQ_UNBOUND, 1); | 3699 | WQ_HIGHPRI | WQ_UNBOUND, 1); |
4040 | 3749 | INIT_WORK(&trans_pcie->rba.rx_alloc, iwl_pcie_rx_allocator_work); | 3700 | INIT_WORK(&trans_pcie->rba.rx_alloc, iwl_pcie_rx_allocator_work); |
4041 | 3750 | 3701 | ||
4042 | 3751 | trans->runtime_pm_mode = IWL_PLAT_PM_MODE_DISABLED; | ||
4043 | 3752 | |||
4044 | 3753 | #ifdef CPTCFG_IWLWIFI_DEBUGFS | 3702 | #ifdef CPTCFG_IWLWIFI_DEBUGFS |
4045 | 3754 | trans_pcie->fw_mon_data.state = IWL_FW_MON_DBGFS_STATE_CLOSED; | 3703 | trans_pcie->fw_mon_data.state = IWL_FW_MON_DBGFS_STATE_CLOSED; |
4046 | 3755 | mutex_init(&trans_pcie->fw_mon_data.mutex); | 3704 | mutex_init(&trans_pcie->fw_mon_data.mutex); |
4047 | diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c b/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c | |||
4048 | index af389f0..2740032 100644 | |||
4049 | --- a/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c | |||
4050 | +++ b/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c | |||
4051 | @@ -50,7 +50,6 @@ | |||
4052 | 50 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 50 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
4053 | 51 | * | 51 | * |
4054 | 52 | *****************************************************************************/ | 52 | *****************************************************************************/ |
4055 | 53 | #include <linux/pm_runtime.h> | ||
4056 | 54 | #include <net/tso.h> | 53 | #include <net/tso.h> |
4057 | 55 | #include <linux/tcp.h> | 54 | #include <linux/tcp.h> |
4058 | 56 | 55 | ||
4059 | @@ -654,12 +653,8 @@ int iwl_trans_pcie_gen2_tx(struct iwl_trans *trans, struct sk_buff *skb, | |||
4060 | 654 | iwl_pcie_gen2_get_num_tbs(trans, tfd)); | 653 | iwl_pcie_gen2_get_num_tbs(trans, tfd)); |
4061 | 655 | 654 | ||
4062 | 656 | /* start timer if queue currently empty */ | 655 | /* start timer if queue currently empty */ |
4069 | 657 | if (txq->read_ptr == txq->write_ptr) { | 656 | if (txq->read_ptr == txq->write_ptr && txq->wd_timeout) |
4070 | 658 | if (txq->wd_timeout) | 657 | mod_timer(&txq->stuck_timer, jiffies + txq->wd_timeout); |
4065 | 659 | mod_timer(&txq->stuck_timer, jiffies + txq->wd_timeout); | ||
4066 | 660 | IWL_DEBUG_RPM(trans, "Q: %d first tx - take ref\n", txq->id); | ||
4067 | 661 | iwl_trans_ref(trans); | ||
4068 | 662 | } | ||
4071 | 663 | 658 | ||
4072 | 664 | /* Tell device the write index *just past* this latest filled TFD */ | 659 | /* Tell device the write index *just past* this latest filled TFD */ |
4073 | 665 | txq->write_ptr = iwl_queue_inc_wrap(trans, txq->write_ptr); | 660 | txq->write_ptr = iwl_queue_inc_wrap(trans, txq->write_ptr); |
4074 | @@ -904,12 +899,6 @@ static int iwl_pcie_gen2_enqueue_hcmd(struct iwl_trans *trans, | |||
4075 | 904 | mod_timer(&txq->stuck_timer, jiffies + txq->wd_timeout); | 899 | mod_timer(&txq->stuck_timer, jiffies + txq->wd_timeout); |
4076 | 905 | 900 | ||
4077 | 906 | spin_lock_irqsave(&trans_pcie->reg_lock, flags); | 901 | spin_lock_irqsave(&trans_pcie->reg_lock, flags); |
4078 | 907 | if (!(cmd->flags & CMD_SEND_IN_IDLE) && | ||
4079 | 908 | !trans_pcie->ref_cmd_in_flight) { | ||
4080 | 909 | trans_pcie->ref_cmd_in_flight = true; | ||
4081 | 910 | IWL_DEBUG_RPM(trans, "set ref_cmd_in_flight - ref\n"); | ||
4082 | 911 | iwl_trans_ref(trans); | ||
4083 | 912 | } | ||
4084 | 913 | /* Increment and update queue's write index */ | 902 | /* Increment and update queue's write index */ |
4085 | 914 | txq->write_ptr = iwl_queue_inc_wrap(trans, txq->write_ptr); | 903 | txq->write_ptr = iwl_queue_inc_wrap(trans, txq->write_ptr); |
4086 | 915 | iwl_pcie_gen2_txq_inc_wr_ptr(trans, txq); | 904 | iwl_pcie_gen2_txq_inc_wr_ptr(trans, txq); |
4087 | @@ -943,16 +932,6 @@ static int iwl_pcie_gen2_send_hcmd_sync(struct iwl_trans *trans, | |||
4088 | 943 | 932 | ||
4089 | 944 | IWL_DEBUG_INFO(trans, "Setting HCMD_ACTIVE for command %s\n", cmd_str); | 933 | IWL_DEBUG_INFO(trans, "Setting HCMD_ACTIVE for command %s\n", cmd_str); |
4090 | 945 | 934 | ||
4091 | 946 | if (pm_runtime_suspended(&trans_pcie->pci_dev->dev)) { | ||
4092 | 947 | ret = wait_event_timeout(trans_pcie->d0i3_waitq, | ||
4093 | 948 | pm_runtime_active(&trans_pcie->pci_dev->dev), | ||
4094 | 949 | msecs_to_jiffies(IWL_TRANS_IDLE_TIMEOUT)); | ||
4095 | 950 | if (!ret) { | ||
4096 | 951 | IWL_ERR(trans, "Timeout exiting D0i3 before hcmd\n"); | ||
4097 | 952 | return -ETIMEDOUT; | ||
4098 | 953 | } | ||
4099 | 954 | } | ||
4100 | 955 | |||
4101 | 956 | cmd_idx = iwl_pcie_gen2_enqueue_hcmd(trans, cmd); | 935 | cmd_idx = iwl_pcie_gen2_enqueue_hcmd(trans, cmd); |
4102 | 957 | if (cmd_idx < 0) { | 936 | if (cmd_idx < 0) { |
4103 | 958 | ret = cmd_idx; | 937 | ret = cmd_idx; |
4104 | @@ -1077,23 +1056,6 @@ void iwl_pcie_gen2_txq_unmap(struct iwl_trans *trans, int txq_id) | |||
4105 | 1077 | } | 1056 | } |
4106 | 1078 | iwl_pcie_gen2_free_tfd(trans, txq); | 1057 | iwl_pcie_gen2_free_tfd(trans, txq); |
4107 | 1079 | txq->read_ptr = iwl_queue_inc_wrap(trans, txq->read_ptr); | 1058 | txq->read_ptr = iwl_queue_inc_wrap(trans, txq->read_ptr); |
4108 | 1080 | |||
4109 | 1081 | if (txq->read_ptr == txq->write_ptr) { | ||
4110 | 1082 | unsigned long flags; | ||
4111 | 1083 | |||
4112 | 1084 | spin_lock_irqsave(&trans_pcie->reg_lock, flags); | ||
4113 | 1085 | if (txq_id != trans_pcie->cmd_queue) { | ||
4114 | 1086 | IWL_DEBUG_RPM(trans, "Q %d - last tx freed\n", | ||
4115 | 1087 | txq->id); | ||
4116 | 1088 | iwl_trans_unref(trans); | ||
4117 | 1089 | } else if (trans_pcie->ref_cmd_in_flight) { | ||
4118 | 1090 | trans_pcie->ref_cmd_in_flight = false; | ||
4119 | 1091 | IWL_DEBUG_RPM(trans, | ||
4120 | 1092 | "clear ref_cmd_in_flight\n"); | ||
4121 | 1093 | iwl_trans_unref(trans); | ||
4122 | 1094 | } | ||
4123 | 1095 | spin_unlock_irqrestore(&trans_pcie->reg_lock, flags); | ||
4124 | 1096 | } | ||
4125 | 1097 | } | 1059 | } |
4126 | 1098 | 1060 | ||
4127 | 1099 | while (!skb_queue_empty(&txq->overflow_q)) { | 1061 | while (!skb_queue_empty(&txq->overflow_q)) { |
4128 | diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/tx.c b/drivers/net/wireless/intel/iwlwifi/pcie/tx.c | |||
4129 | index 7c601ac..a1e4835 100644 | |||
4130 | --- a/drivers/net/wireless/intel/iwlwifi/pcie/tx.c | |||
4131 | +++ b/drivers/net/wireless/intel/iwlwifi/pcie/tx.c | |||
4132 | @@ -65,7 +65,6 @@ | |||
4133 | 65 | #include <linux/ieee80211.h> | 65 | #include <linux/ieee80211.h> |
4134 | 66 | #include <linux/slab.h> | 66 | #include <linux/slab.h> |
4135 | 67 | #include <linux/sched.h> | 67 | #include <linux/sched.h> |
4136 | 68 | #include <linux/pm_runtime.h> | ||
4137 | 69 | #include <net/ip6_checksum.h> | 68 | #include <net/ip6_checksum.h> |
4138 | 70 | #include <net/tso.h> | 69 | #include <net/tso.h> |
4139 | 71 | 70 | ||
4140 | @@ -637,12 +636,6 @@ static void iwl_pcie_clear_cmd_in_flight(struct iwl_trans *trans) | |||
4141 | 637 | 636 | ||
4142 | 638 | lockdep_assert_held(&trans_pcie->reg_lock); | 637 | lockdep_assert_held(&trans_pcie->reg_lock); |
4143 | 639 | 638 | ||
4144 | 640 | if (trans_pcie->ref_cmd_in_flight) { | ||
4145 | 641 | trans_pcie->ref_cmd_in_flight = false; | ||
4146 | 642 | IWL_DEBUG_RPM(trans, "clear ref_cmd_in_flight - unref\n"); | ||
4147 | 643 | iwl_trans_unref(trans); | ||
4148 | 644 | } | ||
4149 | 645 | |||
4150 | 646 | if (!trans->cfg->base_params->apmg_wake_up_wa) | 639 | if (!trans->cfg->base_params->apmg_wake_up_wa) |
4151 | 647 | return; | 640 | return; |
4152 | 648 | if (WARN_ON(!trans_pcie->cmd_hold_nic_awake)) | 641 | if (WARN_ON(!trans_pcie->cmd_hold_nic_awake)) |
4153 | @@ -681,13 +674,8 @@ static void iwl_pcie_txq_unmap(struct iwl_trans *trans, int txq_id) | |||
4154 | 681 | unsigned long flags; | 674 | unsigned long flags; |
4155 | 682 | 675 | ||
4156 | 683 | spin_lock_irqsave(&trans_pcie->reg_lock, flags); | 676 | spin_lock_irqsave(&trans_pcie->reg_lock, flags); |
4162 | 684 | if (txq_id != trans_pcie->cmd_queue) { | 677 | if (txq_id == trans_pcie->cmd_queue) |
4158 | 685 | IWL_DEBUG_RPM(trans, "Q %d - last tx freed\n", | ||
4159 | 686 | txq->id); | ||
4160 | 687 | iwl_trans_unref(trans); | ||
4161 | 688 | } else { | ||
4163 | 689 | iwl_pcie_clear_cmd_in_flight(trans); | 678 | iwl_pcie_clear_cmd_in_flight(trans); |
4164 | 690 | } | ||
4165 | 691 | spin_unlock_irqrestore(&trans_pcie->reg_lock, flags); | 679 | spin_unlock_irqrestore(&trans_pcie->reg_lock, flags); |
4166 | 692 | } | 680 | } |
4167 | 693 | } | 681 | } |
4168 | @@ -1223,15 +1211,22 @@ void iwl_trans_pcie_reclaim(struct iwl_trans *trans, int txq_id, int ssn, | |||
4169 | 1223 | txq->overflow_tx = false; | 1211 | txq->overflow_tx = false; |
4170 | 1224 | } | 1212 | } |
4171 | 1225 | 1213 | ||
4172 | 1226 | if (txq->read_ptr == txq->write_ptr) { | ||
4173 | 1227 | IWL_DEBUG_RPM(trans, "Q %d - last tx reclaimed\n", txq->id); | ||
4174 | 1228 | iwl_trans_unref(trans); | ||
4175 | 1229 | } | ||
4176 | 1230 | |||
4177 | 1231 | out: | 1214 | out: |
4178 | 1232 | spin_unlock_bh(&txq->lock); | 1215 | spin_unlock_bh(&txq->lock); |
4179 | 1233 | } | 1216 | } |
4180 | 1234 | 1217 | ||
4181 | 1218 | /* Set wr_ptr of specific device and txq */ | ||
4182 | 1219 | void iwl_trans_pcie_set_q_ptrs(struct iwl_trans *trans, int txq_id, int ptr) | ||
4183 | 1220 | { | ||
4184 | 1221 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); | ||
4185 | 1222 | struct iwl_txq *txq = trans_pcie->txq[txq_id]; | ||
4186 | 1223 | |||
4187 | 1224 | lockdep_assert_held(&txq->lock); | ||
4188 | 1225 | |||
4189 | 1226 | txq->write_ptr = ptr; | ||
4190 | 1227 | txq->read_ptr = txq->write_ptr; | ||
4191 | 1228 | } | ||
4192 | 1229 | |||
4193 | 1235 | static int iwl_pcie_set_cmd_in_flight(struct iwl_trans *trans, | 1230 | static int iwl_pcie_set_cmd_in_flight(struct iwl_trans *trans, |
4194 | 1236 | const struct iwl_host_cmd *cmd) | 1231 | const struct iwl_host_cmd *cmd) |
4195 | 1237 | { | 1232 | { |
4196 | @@ -1245,13 +1240,6 @@ static int iwl_pcie_set_cmd_in_flight(struct iwl_trans *trans, | |||
4197 | 1245 | if (test_bit(STATUS_TRANS_DEAD, &trans->status)) | 1240 | if (test_bit(STATUS_TRANS_DEAD, &trans->status)) |
4198 | 1246 | return -ENODEV; | 1241 | return -ENODEV; |
4199 | 1247 | 1242 | ||
4200 | 1248 | if (!(cmd->flags & CMD_SEND_IN_IDLE) && | ||
4201 | 1249 | !trans_pcie->ref_cmd_in_flight) { | ||
4202 | 1250 | trans_pcie->ref_cmd_in_flight = true; | ||
4203 | 1251 | IWL_DEBUG_RPM(trans, "set ref_cmd_in_flight - ref\n"); | ||
4204 | 1252 | iwl_trans_ref(trans); | ||
4205 | 1253 | } | ||
4206 | 1254 | |||
4207 | 1255 | /* | 1243 | /* |
4208 | 1256 | * wake up the NIC to make sure that the firmware will see the host | 1244 | * wake up the NIC to make sure that the firmware will see the host |
4209 | 1257 | * command - we will let the NIC sleep once all the host commands | 1245 | * command - we will let the NIC sleep once all the host commands |
4210 | @@ -1865,20 +1853,6 @@ void iwl_pcie_hcmd_complete(struct iwl_trans *trans, | |||
4211 | 1865 | wake_up(&trans_pcie->wait_command_queue); | 1853 | wake_up(&trans_pcie->wait_command_queue); |
4212 | 1866 | } | 1854 | } |
4213 | 1867 | 1855 | ||
4214 | 1868 | if (meta->flags & CMD_MAKE_TRANS_IDLE) { | ||
4215 | 1869 | IWL_DEBUG_INFO(trans, "complete %s - mark trans as idle\n", | ||
4216 | 1870 | iwl_get_cmd_string(trans, cmd->hdr.cmd)); | ||
4217 | 1871 | set_bit(STATUS_TRANS_IDLE, &trans->status); | ||
4218 | 1872 | wake_up(&trans_pcie->d0i3_waitq); | ||
4219 | 1873 | } | ||
4220 | 1874 | |||
4221 | 1875 | if (meta->flags & CMD_WAKE_UP_TRANS) { | ||
4222 | 1876 | IWL_DEBUG_INFO(trans, "complete %s - clear trans idle flag\n", | ||
4223 | 1877 | iwl_get_cmd_string(trans, cmd->hdr.cmd)); | ||
4224 | 1878 | clear_bit(STATUS_TRANS_IDLE, &trans->status); | ||
4225 | 1879 | wake_up(&trans_pcie->d0i3_waitq); | ||
4226 | 1880 | } | ||
4227 | 1881 | |||
4228 | 1882 | meta->flags = 0; | 1856 | meta->flags = 0; |
4229 | 1883 | 1857 | ||
4230 | 1884 | spin_unlock_bh(&txq->lock); | 1858 | spin_unlock_bh(&txq->lock); |
4231 | @@ -1925,16 +1899,6 @@ static int iwl_pcie_send_hcmd_sync(struct iwl_trans *trans, | |||
4232 | 1925 | IWL_DEBUG_INFO(trans, "Setting HCMD_ACTIVE for command %s\n", | 1899 | IWL_DEBUG_INFO(trans, "Setting HCMD_ACTIVE for command %s\n", |
4233 | 1926 | iwl_get_cmd_string(trans, cmd->id)); | 1900 | iwl_get_cmd_string(trans, cmd->id)); |
4234 | 1927 | 1901 | ||
4235 | 1928 | if (pm_runtime_suspended(&trans_pcie->pci_dev->dev)) { | ||
4236 | 1929 | ret = wait_event_timeout(trans_pcie->d0i3_waitq, | ||
4237 | 1930 | pm_runtime_active(&trans_pcie->pci_dev->dev), | ||
4238 | 1931 | msecs_to_jiffies(IWL_TRANS_IDLE_TIMEOUT)); | ||
4239 | 1932 | if (!ret) { | ||
4240 | 1933 | IWL_ERR(trans, "Timeout exiting D0i3 before hcmd\n"); | ||
4241 | 1934 | return -ETIMEDOUT; | ||
4242 | 1935 | } | ||
4243 | 1936 | } | ||
4244 | 1937 | |||
4245 | 1938 | cmd_idx = iwl_pcie_enqueue_hcmd(trans, cmd); | 1902 | cmd_idx = iwl_pcie_enqueue_hcmd(trans, cmd); |
4246 | 1939 | if (cmd_idx < 0) { | 1903 | if (cmd_idx < 0) { |
4247 | 1940 | ret = cmd_idx; | 1904 | ret = cmd_idx; |
4248 | @@ -2517,22 +2481,18 @@ int iwl_trans_pcie_tx(struct iwl_trans *trans, struct sk_buff *skb, | |||
4249 | 2517 | wait_write_ptr = ieee80211_has_morefrags(fc); | 2481 | wait_write_ptr = ieee80211_has_morefrags(fc); |
4250 | 2518 | 2482 | ||
4251 | 2519 | /* start timer if queue currently empty */ | 2483 | /* start timer if queue currently empty */ |
4268 | 2520 | if (txq->read_ptr == txq->write_ptr) { | 2484 | if (txq->read_ptr == txq->write_ptr && txq->wd_timeout) { |
4269 | 2521 | if (txq->wd_timeout) { | 2485 | /* |
4270 | 2522 | /* | 2486 | * If the TXQ is active, then set the timer, if not, |
4271 | 2523 | * If the TXQ is active, then set the timer, if not, | 2487 | * set the timer in remainder so that the timer will |
4272 | 2524 | * set the timer in remainder so that the timer will | 2488 | * be armed with the right value when the station will |
4273 | 2525 | * be armed with the right value when the station will | 2489 | * wake up. |
4274 | 2526 | * wake up. | 2490 | */ |
4275 | 2527 | */ | 2491 | if (!txq->frozen) |
4276 | 2528 | if (!txq->frozen) | 2492 | mod_timer(&txq->stuck_timer, |
4277 | 2529 | mod_timer(&txq->stuck_timer, | 2493 | jiffies + txq->wd_timeout); |
4278 | 2530 | jiffies + txq->wd_timeout); | 2494 | else |
4279 | 2531 | else | 2495 | txq->frozen_expiry_remainder = txq->wd_timeout; |
4264 | 2532 | txq->frozen_expiry_remainder = txq->wd_timeout; | ||
4265 | 2533 | } | ||
4266 | 2534 | IWL_DEBUG_RPM(trans, "Q: %d first tx - take ref\n", txq->id); | ||
4267 | 2535 | iwl_trans_ref(trans); | ||
4280 | 2536 | } | 2496 | } |
4281 | 2537 | 2497 | ||
4282 | 2538 | /* Tell device the write index *just past* this latest filled TFD */ | 2498 | /* Tell device the write index *just past* this latest filled TFD */ |
4283 | diff --git a/drivers/net/wireless/intel/iwlwifi/xvt/fw.c b/drivers/net/wireless/intel/iwlwifi/xvt/fw.c | |||
4284 | index 95a3eca..6755e7d 100644 | |||
4285 | --- a/drivers/net/wireless/intel/iwlwifi/xvt/fw.c | |||
4286 | +++ b/drivers/net/wireless/intel/iwlwifi/xvt/fw.c | |||
4287 | @@ -322,7 +322,7 @@ static int iwl_xvt_config_ltr(struct iwl_xvt *xvt) | |||
4288 | 322 | return iwl_xvt_send_cmd_pdu(xvt, LTR_CONFIG, 0, sizeof(cmd), &cmd); | 322 | return iwl_xvt_send_cmd_pdu(xvt, LTR_CONFIG, 0, sizeof(cmd), &cmd); |
4289 | 323 | } | 323 | } |
4290 | 324 | 324 | ||
4292 | 325 | int iwl_xvt_run_fw(struct iwl_xvt *xvt, u32 ucode_type, bool cont_run) | 325 | int iwl_xvt_run_fw(struct iwl_xvt *xvt, u32 ucode_type) |
4293 | 326 | { | 326 | { |
4294 | 327 | int ret; | 327 | int ret; |
4295 | 328 | 328 | ||
4296 | @@ -338,13 +338,10 @@ int iwl_xvt_run_fw(struct iwl_xvt *xvt, u32 ucode_type, bool cont_run) | |||
4297 | 338 | iwl_xvt_txq_disable(xvt); | 338 | iwl_xvt_txq_disable(xvt); |
4298 | 339 | } | 339 | } |
4299 | 340 | iwl_fw_dbg_stop_sync(&xvt->fwrt); | 340 | iwl_fw_dbg_stop_sync(&xvt->fwrt); |
4301 | 341 | _iwl_trans_stop_device(xvt->trans, !cont_run); | 341 | iwl_trans_stop_device(xvt->trans); |
4302 | 342 | } | 342 | } |
4303 | 343 | 343 | ||
4308 | 344 | if (cont_run) | 344 | ret = iwl_trans_start_hw(xvt->trans); |
4305 | 345 | ret = _iwl_trans_start_hw(xvt->trans, false); | ||
4306 | 346 | else | ||
4307 | 347 | ret = iwl_trans_start_hw(xvt->trans); | ||
4309 | 348 | if (ret) { | 345 | if (ret) { |
4310 | 349 | IWL_ERR(xvt, "Failed to start HW\n"); | 346 | IWL_ERR(xvt, "Failed to start HW\n"); |
4311 | 350 | return ret; | 347 | return ret; |
4312 | diff --git a/drivers/net/wireless/intel/iwlwifi/xvt/user-infc.c b/drivers/net/wireless/intel/iwlwifi/xvt/user-infc.c | |||
4313 | index 137fd8c..ee89d9a 100644 | |||
4314 | --- a/drivers/net/wireless/intel/iwlwifi/xvt/user-infc.c | |||
4315 | +++ b/drivers/net/wireless/intel/iwlwifi/xvt/user-infc.c | |||
4316 | @@ -482,11 +482,12 @@ init_error: | |||
4317 | 482 | iwl_trans_stop_device(xvt->trans); | 482 | iwl_trans_stop_device(xvt->trans); |
4318 | 483 | return err; | 483 | return err; |
4319 | 484 | } | 484 | } |
4321 | 485 | static int iwl_xvt_run_runtime_fw(struct iwl_xvt *xvt, bool cont_run) | 485 | |
4322 | 486 | static int iwl_xvt_run_runtime_fw(struct iwl_xvt *xvt) | ||
4323 | 486 | { | 487 | { |
4324 | 487 | int err; | 488 | int err; |
4325 | 488 | 489 | ||
4327 | 489 | err = iwl_xvt_run_fw(xvt, IWL_UCODE_REGULAR, cont_run); | 490 | err = iwl_xvt_run_fw(xvt, IWL_UCODE_REGULAR); |
4328 | 490 | if (err) | 491 | if (err) |
4329 | 491 | goto fw_error; | 492 | goto fw_error; |
4330 | 492 | 493 | ||
4331 | @@ -557,7 +558,7 @@ static int iwl_xvt_start_op_mode(struct iwl_xvt *xvt) | |||
4332 | 557 | */ | 558 | */ |
4333 | 558 | if (!(xvt->sw_stack_cfg.load_mask & IWL_XVT_LOAD_MASK_INIT)) { | 559 | if (!(xvt->sw_stack_cfg.load_mask & IWL_XVT_LOAD_MASK_INIT)) { |
4334 | 559 | if (xvt->sw_stack_cfg.load_mask & IWL_XVT_LOAD_MASK_RUNTIME) { | 560 | if (xvt->sw_stack_cfg.load_mask & IWL_XVT_LOAD_MASK_RUNTIME) { |
4336 | 560 | err = iwl_xvt_run_runtime_fw(xvt, false); | 561 | err = iwl_xvt_run_runtime_fw(xvt); |
4337 | 561 | } else { | 562 | } else { |
4338 | 562 | if (xvt->state != IWL_XVT_STATE_UNINITIALIZED) { | 563 | if (xvt->state != IWL_XVT_STATE_UNINITIALIZED) { |
4339 | 563 | xvt->fw_running = false; | 564 | xvt->fw_running = false; |
4340 | @@ -579,7 +580,7 @@ static int iwl_xvt_start_op_mode(struct iwl_xvt *xvt) | |||
4341 | 579 | /* when fw image is unified, only regular ucode is loaded. */ | 580 | /* when fw image is unified, only regular ucode is loaded. */ |
4342 | 580 | if (iwl_xvt_is_unified_fw(xvt)) | 581 | if (iwl_xvt_is_unified_fw(xvt)) |
4343 | 581 | ucode_type = IWL_UCODE_REGULAR; | 582 | ucode_type = IWL_UCODE_REGULAR; |
4345 | 582 | err = iwl_xvt_run_fw(xvt, ucode_type, false); | 583 | err = iwl_xvt_run_fw(xvt, ucode_type); |
4346 | 583 | if (err) | 584 | if (err) |
4347 | 584 | return err; | 585 | return err; |
4348 | 585 | 586 | ||
4349 | @@ -665,7 +666,7 @@ static int iwl_xvt_continue_init(struct iwl_xvt *xvt) | |||
4350 | 665 | 666 | ||
4351 | 666 | if (xvt->sw_stack_cfg.load_mask & IWL_XVT_LOAD_MASK_RUNTIME) | 667 | if (xvt->sw_stack_cfg.load_mask & IWL_XVT_LOAD_MASK_RUNTIME) |
4352 | 667 | /* Run runtime FW stops the device by itself if error occurs */ | 668 | /* Run runtime FW stops the device by itself if error occurs */ |
4354 | 668 | err = iwl_xvt_run_runtime_fw(xvt, true); | 669 | err = iwl_xvt_run_runtime_fw(xvt); |
4355 | 669 | 670 | ||
4356 | 670 | goto cont_init_end; | 671 | goto cont_init_end; |
4357 | 671 | 672 | ||
4358 | diff --git a/drivers/net/wireless/intel/iwlwifi/xvt/xvt.h b/drivers/net/wireless/intel/iwlwifi/xvt/xvt.h | |||
4359 | index 8ede75f..baae1bf 100644 | |||
4360 | --- a/drivers/net/wireless/intel/iwlwifi/xvt/xvt.h | |||
4361 | +++ b/drivers/net/wireless/intel/iwlwifi/xvt/xvt.h | |||
4362 | @@ -7,7 +7,7 @@ | |||
4363 | 7 | * | 7 | * |
4364 | 8 | * Copyright(c) 2007 - 2014 Intel Corporation. All rights reserved. | 8 | * Copyright(c) 2007 - 2014 Intel Corporation. All rights reserved. |
4365 | 9 | * Copyright(c) 2015 - 2017 Intel Deutschland GmbH | 9 | * Copyright(c) 2015 - 2017 Intel Deutschland GmbH |
4367 | 10 | * Copyright(c) 2018 Intel Corporation | 10 | * Copyright(c) 2018 - 2019 Intel Corporation |
4368 | 11 | * | 11 | * |
4369 | 12 | * This program is free software; you can redistribute it and/or modify | 12 | * This program is free software; you can redistribute it and/or modify |
4370 | 13 | * it under the terms of version 2 of the GNU General Public License as | 13 | * it under the terms of version 2 of the GNU General Public License as |
4371 | @@ -29,7 +29,7 @@ | |||
4372 | 29 | * | 29 | * |
4373 | 30 | * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved. | 30 | * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved. |
4374 | 31 | * Copyright(c) 2015 - 2017 Intel Deutschland GmbH | 31 | * Copyright(c) 2015 - 2017 Intel Deutschland GmbH |
4376 | 32 | * Copyright(c) 2018 Intel Corporation | 32 | * Copyright(c) 2018 - 2019 Intel Corporation |
4377 | 33 | * All rights reserved. | 33 | * All rights reserved. |
4378 | 34 | * | 34 | * |
4379 | 35 | * Redistribution and use in source and binary forms, with or without | 35 | * Redistribution and use in source and binary forms, with or without |
4380 | @@ -443,7 +443,7 @@ int iwl_xvt_user_cmd_execute(struct iwl_testmode *testmode, u32 cmd, | |||
4381 | 443 | struct iwl_tm_data *data_out, bool *supported_cmd); | 443 | struct iwl_tm_data *data_out, bool *supported_cmd); |
4382 | 444 | 444 | ||
4383 | 445 | /* FW */ | 445 | /* FW */ |
4385 | 446 | int iwl_xvt_run_fw(struct iwl_xvt *xvt, u32 ucode_type, bool cont_run); | 446 | int iwl_xvt_run_fw(struct iwl_xvt *xvt, u32 ucode_type); |
4386 | 447 | 447 | ||
4387 | 448 | /* NVM */ | 448 | /* NVM */ |
4388 | 449 | int iwl_xvt_nvm_init(struct iwl_xvt *xvt); | 449 | int iwl_xvt_nvm_init(struct iwl_xvt *xvt); |
4389 | diff --git a/include/linux/fm/iui_fm.h b/include/linux/fm/iui_fm.h | |||
4390 | 450 | deleted file mode 100644 | 450 | deleted file mode 100644 |
4391 | index 1411a3b..0000000 | |||
4392 | --- a/include/linux/fm/iui_fm.h | |||
4393 | +++ /dev/null | |||
4394 | @@ -1,143 +0,0 @@ | |||
4395 | 1 | /****************************************************************************** | ||
4396 | 2 | * | ||
4397 | 3 | * This file is provided under a dual BSD/GPLv2 license. When using or | ||
4398 | 4 | * redistributing this file, you may do so under either license. | ||
4399 | 5 | * | ||
4400 | 6 | * GPL LICENSE SUMMARY | ||
4401 | 7 | * | ||
4402 | 8 | * Copyright(c) 2012 - 2015 Intel Corporation. All rights reserved. | ||
4403 | 9 | * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH | ||
4404 | 10 | * | ||
4405 | 11 | * This program is free software; you can redistribute it and/or modify | ||
4406 | 12 | * it under the terms of version 2 of the GNU General Public License as | ||
4407 | 13 | * published by the Free Software Foundation. | ||
4408 | 14 | * | ||
4409 | 15 | * This program is distributed in the hope that it will be useful, but | ||
4410 | 16 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
4411 | 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
4412 | 18 | * General Public License for more details. | ||
4413 | 19 | * | ||
4414 | 20 | * You should have received a copy of the GNU General Public License | ||
4415 | 21 | * along with this program; if not, write to the Free Software | ||
4416 | 22 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, | ||
4417 | 23 | * USA | ||
4418 | 24 | * | ||
4419 | 25 | * The full GNU General Public License is included in this distribution | ||
4420 | 26 | * in the file called COPYING. | ||
4421 | 27 | * | ||
4422 | 28 | * Contact Information: | ||
4423 | 29 | * Intel Linux Wireless <linuxwifi@intel.com> | ||
4424 | 30 | * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 | ||
4425 | 31 | * | ||
4426 | 32 | * BSD LICENSE | ||
4427 | 33 | * | ||
4428 | 34 | * Copyright(c) 2012 - 2015 Intel Corporation. All rights reserved. | ||
4429 | 35 | * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH | ||
4430 | 36 | * All rights reserved. | ||
4431 | 37 | * | ||
4432 | 38 | * Redistribution and use in source and binary forms, with or without | ||
4433 | 39 | * modification, are permitted provided that the following conditions | ||
4434 | 40 | * are met: | ||
4435 | 41 | * | ||
4436 | 42 | * * Redistributions of source code must retain the above copyright | ||
4437 | 43 | * notice, this list of conditions and the following disclaimer. | ||
4438 | 44 | * * Redistributions in binary form must reproduce the above copyright | ||
4439 | 45 | * notice, this list of conditions and the following disclaimer in | ||
4440 | 46 | * the documentation and/or other materials provided with the | ||
4441 | 47 | * distribution. | ||
4442 | 48 | * * Neither the name Intel Corporation nor the names of its | ||
4443 | 49 | * contributors may be used to endorse or promote products derived | ||
4444 | 50 | * from this software without specific prior written permission. | ||
4445 | 51 | * | ||
4446 | 52 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
4447 | 53 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
4448 | 54 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
4449 | 55 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
4450 | 56 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
4451 | 57 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
4452 | 58 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
4453 | 59 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
4454 | 60 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
4455 | 61 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
4456 | 62 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
4457 | 63 | * | ||
4458 | 64 | *****************************************************************************/ | ||
4459 | 65 | |||
4460 | 66 | #ifndef __FM_TEST_IUI_H | ||
4461 | 67 | #define __FM_TEST_IUI_H | ||
4462 | 68 | |||
4463 | 69 | #include <linux/errno.h> | ||
4464 | 70 | |||
4465 | 71 | #if defined(CONFIG_IUI_FM) /* Use platform h file - NOT XMM6312/SOFIA-3G */ | ||
4466 | 72 | #include <linux/fm/iui_fm_lte.h> | ||
4467 | 73 | #else /* Platform doesn't have FM - use test h file */ | ||
4468 | 74 | #include "iui_fm_test.h" | ||
4469 | 75 | #endif /* CONFIG_IUI_FM */ | ||
4470 | 76 | |||
4471 | 77 | #ifdef CPTCFG_IWLWIFI_FRQ_MGR_TEST | ||
4472 | 78 | int32_t | ||
4473 | 79 | iwl_mvm_fm_test_register_callback(const enum iui_fm_macro_id macro_id, | ||
4474 | 80 | const iui_fm_mitigation_cb mitigation_cb); | ||
4475 | 81 | int32_t | ||
4476 | 82 | iwl_mvm_fm_test_notify_frequency(const enum iui_fm_macro_id macro_id, | ||
4477 | 83 | const struct iui_fm_freq_notification * | ||
4478 | 84 | const notification); | ||
4479 | 85 | #endif /* CPTCFG_IWLWIFI_FRQ_MGR_TEST */ | ||
4480 | 86 | |||
4481 | 87 | /* | ||
4482 | 88 | * If platform has FM then we have 2 modes: | ||
4483 | 89 | * Regular mode: Call the FM register function | ||
4484 | 90 | * Debug mode: Don't call the FM register function & use test mode | ||
4485 | 91 | * implementation. | ||
4486 | 92 | * If platform does not have FM then we use test mode implementation. | ||
4487 | 93 | */ | ||
4488 | 94 | static inline | ||
4489 | 95 | int32_t iwl_mvm_fm_register_callback(bool dbg_mode, | ||
4490 | 96 | const enum iui_fm_macro_id macro_id, | ||
4491 | 97 | const iui_fm_mitigation_cb mitigation_cb) | ||
4492 | 98 | { | ||
4493 | 99 | #ifdef CPTCFG_IWLWIFI_FRQ_MGR_TEST | ||
4494 | 100 | /* Platform does not have a FM or test mode was requested */ | ||
4495 | 101 | if (dbg_mode) | ||
4496 | 102 | return iwl_mvm_fm_test_register_callback(macro_id, | ||
4497 | 103 | mitigation_cb); | ||
4498 | 104 | #endif /* CPTCFG_IWLWIFI_FRQ_MGR_TEST */ | ||
4499 | 105 | |||
4500 | 106 | #if defined(CONFIG_IUI_FM) /* Not XMM6321/Sofa-3G - Platform has a FM */ | ||
4501 | 107 | return iui_fm_register_mitigation_callback_lte(macro_id, | ||
4502 | 108 | mitigation_cb); | ||
4503 | 109 | #else | ||
4504 | 110 | |||
4505 | 111 | return -EPERM; /* fm_debug_mode was not set */ | ||
4506 | 112 | #endif /* CONFIG_IUI_FM */ | ||
4507 | 113 | } | ||
4508 | 114 | |||
4509 | 115 | /* | ||
4510 | 116 | * If platform has FM then we have 2 modes: | ||
4511 | 117 | * Regular mode: Call the FM notify function | ||
4512 | 118 | * Debug mode: Don't call the FM notify function & use test mode | ||
4513 | 119 | * implementation. | ||
4514 | 120 | * If platfom does not have FM then we use test mode implementation. | ||
4515 | 121 | */ | ||
4516 | 122 | static inline | ||
4517 | 123 | int32_t iwl_mvm_fm_notify_frequency(bool dbg_mode, | ||
4518 | 124 | const enum iui_fm_macro_id macro_id, | ||
4519 | 125 | const struct iui_fm_freq_notification * | ||
4520 | 126 | const notification) | ||
4521 | 127 | { | ||
4522 | 128 | #ifdef CPTCFG_IWLWIFI_FRQ_MGR_TEST | ||
4523 | 129 | /* Platform does not have a FM or test mode was requested */ | ||
4524 | 130 | if (dbg_mode) | ||
4525 | 131 | return iwl_mvm_fm_test_notify_frequency(macro_id, | ||
4526 | 132 | notification); | ||
4527 | 133 | #endif /* CPTCFG_IWLWIFI_FRQ_MGR_TEST */ | ||
4528 | 134 | |||
4529 | 135 | #if defined(CONFIG_IUI_FM) /* Not XMM6312/Sofia-3G - Platform has a FM */ | ||
4530 | 136 | return iui_fm_notify_frequency_lte(macro_id, notification); | ||
4531 | 137 | #else | ||
4532 | 138 | return -EPERM; /* fm_debug_mode was not set */ | ||
4533 | 139 | #endif /*CONFIG_IUI_FM */ | ||
4534 | 140 | } | ||
4535 | 141 | |||
4536 | 142 | #endif /* __FM_IUI_H */ | ||
4537 | 143 | |||
4538 | diff --git a/include/linux/fm/iui_fm_test.h b/include/linux/fm/iui_fm_test.h | |||
4539 | 144 | deleted file mode 100644 | 0 | deleted file mode 100644 |
4540 | index e347a55..0000000 | |||
4541 | --- a/include/linux/fm/iui_fm_test.h | |||
4542 | +++ /dev/null | |||
4543 | @@ -1,796 +0,0 @@ | |||
4544 | 1 | /* | ||
4545 | 2 | * Copyright (C) 2013 Intel Mobile Communications GmbH | ||
4546 | 3 | * | ||
4547 | 4 | * This software is licensed under the terms of the GNU General Public | ||
4548 | 5 | * License version 2, as published by the Free Software Foundation, and | ||
4549 | 6 | * may be copied, distributed, and modified under those terms. | ||
4550 | 7 | * | ||
4551 | 8 | * This program is distributed in the hope that it will be useful, | ||
4552 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
4553 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
4554 | 11 | * GNU General Public License for more details. | ||
4555 | 12 | */ | ||
4556 | 13 | |||
4557 | 14 | #ifndef _IUI_FM_H | ||
4558 | 15 | #define _IUI_FM_H | ||
4559 | 16 | |||
4560 | 17 | /** | ||
4561 | 18 | * @file iui_fm.h | ||
4562 | 19 | * @brief The IUI Frequency Manager interface exposes an RPC-compatible | ||
4563 | 20 | * interface to pass frequency information between macros on the AP and | ||
4564 | 21 | * the Frequency Manager component on the MEX. | ||
4565 | 22 | * | ||
4566 | 23 | * @addtogroup ISPEC_FREQ_MANAGER Frequency manager | ||
4567 | 24 | * @{ | ||
4568 | 25 | */ | ||
4569 | 26 | |||
4570 | 27 | #ifdef __cplusplus | ||
4571 | 28 | extern "C" { | ||
4572 | 29 | #endif /* __cplusplus */ | ||
4573 | 30 | |||
4574 | 31 | /* Choose whether to use integer types defined in the Linux Kernel (for kernel | ||
4575 | 32 | builds) or C Library (for Userspace/MEX builds). */ | ||
4576 | 33 | #ifdef __KERNEL__ | ||
4577 | 34 | #include <linux/types.h> | ||
4578 | 35 | #include <linux/kernel.h> | ||
4579 | 36 | #define INT32_MAX INT_MAX | ||
4580 | 37 | #else /* __KERNEL__ */ | ||
4581 | 38 | #include <stdint.h> | ||
4582 | 39 | #endif /* __KERNEL__ */ | ||
4583 | 40 | |||
4584 | 41 | /** | ||
4585 | 42 | * Zero-based enum of Frequency Manager Macro ID's. | ||
4586 | 43 | * Identifies a Frequency Manager Macro in the IuiFm API's. | ||
4587 | 44 | * | ||
4588 | 45 | * @IUI_FM_MACRO_ID_INVALID: Invalid Macro ID | ||
4589 | 46 | * @IUI_FM_MACRO_ID_EMMC: SD/eMMC Macro | ||
4590 | 47 | * @IUI_FM_MACRO_ID_CLASS_D: Class D Amplifier Macro | ||
4591 | 48 | * @IUI_FM_MACRO_ID_PMU_CP: PMU Charge Pump Macro | ||
4592 | 49 | * @IUI_FM_MACRO_ID_MS_CP: MS Charge Pump Macro | ||
4593 | 50 | * @IUI_FM_MACRO_ID_DCDC: DC to DC Converter Macro | ||
4594 | 51 | * @IUI_FM_MACRO_ID_RESERVED: not in use | ||
4595 | 52 | * @IUI_FM_MACRO_ID_WLAN: Wireless LAN Macro | ||
4596 | 53 | * @IUI_FM_MACRO_ID_FMR: FM Radio Macro | ||
4597 | 54 | * @IUI_FM_MACRO_ID_BT: Bluetooth Macro | ||
4598 | 55 | * @IUI_FM_MACRO_ID_GNSS: Global Navigation Satellite System | ||
4599 | 56 | * (GPS/GLONASS) Macro | ||
4600 | 57 | * @IUI_FM_MACRO_ID_MAX: Number of Macro's defined, used | ||
4601 | 58 | * internally for range checking | ||
4602 | 59 | * @IUI_FM_MACRO_ID_FIRST: Point to the first macro ID, used internally | ||
4603 | 60 | * for iteration and range checking | ||
4604 | 61 | */ | ||
4605 | 62 | enum iui_fm_macro_id { | ||
4606 | 63 | IUI_FM_MACRO_ID_INVALID = -1, | ||
4607 | 64 | IUI_FM_MACRO_ID_EMMC = 0, | ||
4608 | 65 | IUI_FM_MACRO_ID_CLASS_D = 1, | ||
4609 | 66 | IUI_FM_MACRO_ID_PMU_CP = 2, | ||
4610 | 67 | IUI_FM_MACRO_ID_MS_CP = 3, | ||
4611 | 68 | IUI_FM_MACRO_ID_DCDC = 4, | ||
4612 | 69 | IUI_FM_MACRO_ID_RESERVED = 5, | ||
4613 | 70 | IUI_FM_MACRO_ID_WLAN = 6, | ||
4614 | 71 | IUI_FM_MACRO_ID_FMR = 7, | ||
4615 | 72 | IUI_FM_MACRO_ID_BT = 8, | ||
4616 | 73 | IUI_FM_MACRO_ID_GNSS = 9, | ||
4617 | 74 | IUI_FM_MACRO_ID_MAX = 10, | ||
4618 | 75 | IUI_FM_MACRO_ID_FIRST = IUI_FM_MACRO_ID_EMMC | ||
4619 | 76 | }; | ||
4620 | 77 | |||
4621 | 78 | /** | ||
4622 | 79 | * Enum used to indicate the priority of a mitigation request. | ||
4623 | 80 | * | ||
4624 | 81 | * @IUI_FM_MITIGATION_PRIORITY_NORMAL: The priority value of a mitigation | ||
4625 | 82 | * request when not in an emergency call | ||
4626 | 83 | * or situation. | ||
4627 | 84 | * @IUI_FM_MITIGATION_PRIORITY_EMERGENCY: Can be used during an emergency call | ||
4628 | 85 | * to indicate that the mitigation | ||
4629 | 86 | * request should be applied with more | ||
4630 | 87 | * haste than usual, even if this causes | ||
4631 | 88 | * a degredation in currently-running | ||
4632 | 89 | * processes. | ||
4633 | 90 | */ | ||
4634 | 91 | enum iui_fm_mitigation_priority { | ||
4635 | 92 | IUI_FM_MITIGATION_PRIORITY_NORMAL = 0, | ||
4636 | 93 | IUI_FM_MITIGATION_PRIORITY_EMERGENCY = 1 | ||
4637 | 94 | }; | ||
4638 | 95 | |||
4639 | 96 | /** | ||
4640 | 97 | * Enum used to identify an SD/eMMC device. | ||
4641 | 98 | * | ||
4642 | 99 | * @IUI_FM_EMMC_DEVICE_ID_0: SD/eMMC Device 0 | ||
4643 | 100 | * @IUI_FM_EMMC_DEVICE_ID_1: SD/eMMC Device 1 | ||
4644 | 101 | * @IUI_FM_EMMC_DEVICE_ID_2: SD/eMMC Device 2 | ||
4645 | 102 | * @IUI_FM_EMMC_DEVICE_ID_MAX: Number of SD/eMMC Devices Defined, used | ||
4646 | 103 | * internally for range checking and array sizing | ||
4647 | 104 | */ | ||
4648 | 105 | enum iui_fm_emmc_device_id { | ||
4649 | 106 | IUI_FM_EMMC_DEVICE_ID_0 = 0, | ||
4650 | 107 | IUI_FM_EMMC_DEVICE_ID_1 = 1, | ||
4651 | 108 | IUI_FM_EMMC_DEVICE_ID_2 = 2, | ||
4652 | 109 | IUI_FM_EMMC_DEVICE_ID_MAX = 3 | ||
4653 | 110 | }; | ||
4654 | 111 | |||
4655 | 112 | /** | ||
4656 | 113 | * Enum used to indicate from which main clock the operating frequency | ||
4657 | 114 | * of an SD/eMMC device is derived. | ||
4658 | 115 | * | ||
4659 | 116 | * Possible SD/eMMC operating frequencies are derived by dividing the selected | ||
4660 | 117 | * main clock frequency by powers of 2. The largest possible divisor is that | ||
4661 | 118 | * which results in the lowest operating frequency greater than 200 KHz. Hence | ||
4662 | 119 | * the possible operating frequencies are: | ||
4663 | 120 | * | ||
4664 | 121 | * Clock Source: 104 MHz: | ||
4665 | 122 | * 2^0: 104 MHz | ||
4666 | 123 | * 2^1: 52 MHz | ||
4667 | 124 | * 2^2: 26 MHz | ||
4668 | 125 | * 2^3: 13 MHz | ||
4669 | 126 | * 2^4: 6.5 MHz | ||
4670 | 127 | * 2^5: 3.25 MHz | ||
4671 | 128 | * 2^6: 1.625 MHz | ||
4672 | 129 | * 2^7: 812.5 KHz | ||
4673 | 130 | * 2^8: 406.25 KHz | ||
4674 | 131 | * 2^9: 203.125 KHz | ||
4675 | 132 | * | ||
4676 | 133 | * Clock Source: 96 MHz: | ||
4677 | 134 | * 2^0: 96 MHz | ||
4678 | 135 | * 2^1: 48 MHz | ||
4679 | 136 | * 2^2: 24 MHz | ||
4680 | 137 | * 2^3: 12 MHz | ||
4681 | 138 | * 2^4: 6 MHz | ||
4682 | 139 | * 2^5: 3 MHz | ||
4683 | 140 | * 2^6: 1.5 MHz | ||
4684 | 141 | * 2^7: 750 KHz | ||
4685 | 142 | * 2^8: 375 KHz | ||
4686 | 143 | * | ||
4687 | 144 | * @IUI_FM_EMMC_CLOCK_SRC_104MHZ 104 MHz main clock source for SD/eMMC. | ||
4688 | 145 | * @IUI_FM_EMMC_CLOCK_SRC_96MHZ 96 MHz main clock source for SD/eMMC. | ||
4689 | 146 | */ | ||
4690 | 147 | enum iui_fm_emmc_clock_src { | ||
4691 | 148 | IUI_FM_EMMC_CLOCK_SRC_104MHZ = 0, | ||
4692 | 149 | IUI_FM_EMMC_CLOCK_SRC_96MHZ = 1 | ||
4693 | 150 | }; | ||
4694 | 151 | |||
4695 | 152 | /** | ||
4696 | 153 | * @brief Bitfield structure of 32-bit width to store the operating frequency | ||
4697 | 154 | * information for one SD/eMMC device. | ||
4698 | 155 | * | ||
4699 | 156 | * @frequency SD/eMMC Operating Frequency in KHz. | ||
4700 | 157 | * @clk_src SD/eMMC Clock Source. Values in enum iui_fm_emmc_clock_src. | ||
4701 | 158 | */ | ||
4702 | 159 | struct iui_fm_emmc_freq_bitfield { | ||
4703 | 160 | uint32_t frequency:28; | ||
4704 | 161 | uint32_t clk_src:4; | ||
4705 | 162 | }; | ||
4706 | 163 | |||
4707 | 164 | /** | ||
4708 | 165 | * @brief Contains operating frequency information for all of the SD/eMMC | ||
4709 | 166 | * devices. | ||
4710 | 167 | * | ||
4711 | 168 | * @emmc_frequency Array of frequency information for each EMMC device. | ||
4712 | 169 | */ | ||
4713 | 170 | struct iui_fm_emmc_freq_info { | ||
4714 | 171 | struct iui_fm_emmc_freq_bitfield | ||
4715 | 172 | emmc_frequency[IUI_FM_EMMC_DEVICE_ID_MAX]; | ||
4716 | 173 | }; | ||
4717 | 174 | |||
4718 | 175 | /** | ||
4719 | 176 | * @brief Enum representing the possible channel bandwidths used by the WLAN | ||
4720 | 177 | * macro. | ||
4721 | 178 | * | ||
4722 | 179 | * @IUI_FM_WLAN_BW_INVALID Used if WLAN channel is in disconnected state. | ||
4723 | 180 | * @IUI_FM_WLAN_BW_20MHZ 20 MHz bandwidth. | ||
4724 | 181 | * @IUI_FM_WLAN_BW_40MHZ 40 MHz bandwidth (NOT SUPPORTED). | ||
4725 | 182 | * @IUI_FM_WLAN_BW_80MHZ 80 MHz bandwidth (NOT SUPPORTED). | ||
4726 | 183 | */ | ||
4727 | 184 | enum iui_fm_wlan_bandwidth { | ||
4728 | 185 | IUI_FM_WLAN_BW_INVALID = -1, | ||
4729 | 186 | IUI_FM_WLAN_BW_20MHZ = 0, | ||
4730 | 187 | IUI_FM_WLAN_BW_40MHZ = 1, | ||
4731 | 188 | IUI_FM_WLAN_BW_80MHZ = 2, | ||
4732 | 189 | IUI_FM_WLAN_BW_160MHZ = 3 | ||
4733 | 190 | }; | ||
4734 | 191 | |||
4735 | 192 | /** | ||
4736 | 193 | * Structure used to store the frequency and bandwidth of a WLAN channel. | ||
4737 | 194 | * | ||
4738 | 195 | * @frequency Current WLAN channel center frequency in KHz if in | ||
4739 | 196 | * transfer/receive mode, or an invalid value otherwise. | ||
4740 | 197 | * Available values: 2412000-2484000, 3657500-3690000, | ||
4741 | 198 | * 4915000-5825000 (KHz). | ||
4742 | 199 | * @bandwadth Channel bandwidth enum. Set to IUI_FM_WLAN_BW_INVALID if WLAN | ||
4743 | 200 | * channel is disconnected. | ||
4744 | 201 | */ | ||
4745 | 202 | struct iui_fm_wlan_channel_info { | ||
4746 | 203 | uint32_t frequency; | ||
4747 | 204 | enum iui_fm_wlan_bandwidth bandwidth; | ||
4748 | 205 | }; | ||
4749 | 206 | |||
4750 | 207 | /** | ||
4751 | 208 | * Maximum number of channels that can be used by the WLAN macro at a time. | ||
4752 | 209 | */ | ||
4753 | 210 | #define IUI_FM_WLAN_MAX_CHANNELS 4 | ||
4754 | 211 | #define DCDC_UPDATE 1 | ||
4755 | 212 | #define WLAN_UPDATE 2 | ||
4756 | 213 | #define DCDC_MITI DCDC_UPDATE | ||
4757 | 214 | #define WLAN_MITI WLAN_UPDATE | ||
4758 | 215 | |||
4759 | 216 | /** | ||
4760 | 217 | * @brief Structure used for Frequency Notification by the WLAN macro. | ||
4761 | 218 | * | ||
4762 | 219 | * @num_channels Number of valid elements in the channel_info array, set to | ||
4763 | 220 | * the number of channels currently in use by the WLAN macro, or | ||
4764 | 221 | * 0 if WLAN is not in transfer/receive mode. | ||
4765 | 222 | * @channel_info Array of WLAN channel information structures. Only the first | ||
4766 | 223 | * num_channels elements are valid. | ||
4767 | 224 | * @wlan_adc_dac_freq Current WLAN ADC/DAC frequency in KHz. Available | ||
4768 | 225 | * values: 0 (parameter not yet supported). | ||
4769 | 226 | */ | ||
4770 | 227 | struct iui_fm_wlan_info { | ||
4771 | 228 | uint32_t num_channels; | ||
4772 | 229 | struct iui_fm_wlan_channel_info channel_info[IUI_FM_WLAN_MAX_CHANNELS]; | ||
4773 | 230 | uint32_t wlan_adc_dac_freq; | ||
4774 | 231 | uint32_t dcdc_div0; | ||
4775 | 232 | uint32_t dcdc_div1; | ||
4776 | 233 | uint32_t bitmask; | ||
4777 | 234 | }; | ||
4778 | 235 | |||
4779 | 236 | /** | ||
4780 | 237 | * Special value for the max_tx_pwr field of struct | ||
4781 | 238 | * iui_fm_wlan_channel_tx_power to clear a previously-set TX power limit. | ||
4782 | 239 | */ | ||
4783 | 240 | #define IUI_FM_WLAN_NO_TX_PWR_LIMIT INT32_MAX | ||
4784 | 241 | |||
4785 | 242 | /** | ||
4786 | 243 | * @brief Structure to store the maximum allowed transmit power for one WLAN | ||
4787 | 244 | * channel. | ||
4788 | 245 | * | ||
4789 | 246 | * @frequency WLAN Channel Frequency in KHz. | ||
4790 | 247 | * @max_tx_pwr Maximum allowed transmit power for the given channel frequency | ||
4791 | 248 | * in dBm within the range 0 to +30, or | ||
4792 | 249 | * IUI_FM_WLAN_NO_TX_PWR_LIMIT to cancel a previously-set transmit | ||
4793 | 250 | * power limit. | ||
4794 | 251 | */ | ||
4795 | 252 | struct iui_fm_wlan_channel_tx_power { | ||
4796 | 253 | uint32_t frequency; | ||
4797 | 254 | int32_t max_tx_pwr; | ||
4798 | 255 | }; | ||
4799 | 256 | |||
4800 | 257 | /** | ||
4801 | 258 | * @brief Enum defining mitigation actions for WLAN macro to implement for the | ||
4802 | 259 | * WLAN RX Gain Stage behavior. | ||
4803 | 260 | * | ||
4804 | 261 | * @IUI_FM_WLAN_RX_GAIN_NORMAL RX Gain Stage should behave as | ||
4805 | 262 | * normal with no reduction in gain. | ||
4806 | 263 | * @IUI_FM_WLAN_RX_GAIN_REDUCE_AUTO RX Gain should be reduced by an | ||
4807 | 264 | * unspecified amount. The WLAN macro | ||
4808 | 265 | * is to determine the appropriate gain | ||
4809 | 266 | * reduction amount internally. | ||
4810 | 267 | * @IUI_FM_WLAN_RX_GAIN_REDUCE_SPECIFIED RX Gain should be reduced by the | ||
4811 | 268 | * specified amount (NOT SUPPORTED). | ||
4812 | 269 | */ | ||
4813 | 270 | enum iui_fm_wlan_rx_gain_behavior { | ||
4814 | 271 | IUI_FM_WLAN_RX_GAIN_NORMAL = 0, | ||
4815 | 272 | IUI_FM_WLAN_RX_GAIN_REDUCE_AUTO = 1 | ||
4816 | 273 | /* IUI_FM_WLAN_RX_GAIN_REDUCE_SPECIFIED = 2 */ | ||
4817 | 274 | }; | ||
4818 | 275 | |||
4819 | 276 | /** | ||
4820 | 277 | * @brief Mitigation information structure for the WLAN macro. | ||
4821 | 278 | * | ||
4822 | 279 | * @num_channels Number of valid elements in the channel_tx_pwr array, | ||
4823 | 280 | * set to the number of channels for which the maximum | ||
4824 | 281 | * allowed transmit power is being set. | ||
4825 | 282 | * @channel_tx_pwr Array of maximum allowed transmit power for zero or more | ||
4826 | 283 | * WLAN channels. Only the first num_channels elements are | ||
4827 | 284 | * valid. | ||
4828 | 285 | * @wlan_adc_dac_freq Requested WLAN ADC/DAC frequency in KHz. Available | ||
4829 | 286 | * values: 0 (parameter not yet supported). | ||
4830 | 287 | * @rx_gain_behavior Indicates the requested behavior of the WLAN RX Gain | ||
4831 | 288 | * Stage (NOT SUPPORTED). | ||
4832 | 289 | * @rx_gain_reduction Amount by which to reduce the WLAN RX Gain (in dB) if | ||
4833 | 290 | * the rx_gain_bahavior field is set to | ||
4834 | 291 | * IUI_FM_WLAN_RX_GAIN_REDUCE_SPECIFIED (NOT SUPPORTED). | ||
4835 | 292 | */ | ||
4836 | 293 | struct iui_fm_wlan_mitigation { | ||
4837 | 294 | uint32_t num_channels; | ||
4838 | 295 | struct iui_fm_wlan_channel_tx_power | ||
4839 | 296 | channel_tx_pwr[IUI_FM_WLAN_MAX_CHANNELS]; | ||
4840 | 297 | uint32_t wlan_adc_dac_freq; | ||
4841 | 298 | enum iui_fm_wlan_rx_gain_behavior rx_gain_behavior; | ||
4842 | 299 | /* uint32_t rx_gain_reduction; */ | ||
4843 | 300 | uint32_t wlan_2g_coex_enable; | ||
4844 | 301 | uint32_t dcdc_div0; | ||
4845 | 302 | uint32_t dcdc_div1; | ||
4846 | 303 | uint32_t bitmask; | ||
4847 | 304 | }; | ||
4848 | 305 | |||
4849 | 306 | /** | ||
4850 | 307 | * @brief Enum representing the injection side indicated by the FM Radio | ||
4851 | 308 | * macro. | ||
4852 | 309 | * | ||
4853 | 310 | * @IUI_FM_FMR_INJECTION_SIDE_LOW FM Radio Low Side Injection. | ||
4854 | 311 | * @IUI_FM_FMR_INJECTION_SIDE_HIGH FM Radio High Side Injection. | ||
4855 | 312 | */ | ||
4856 | 313 | enum iui_fm_fmr_injection_side { | ||
4857 | 314 | IUI_FM_FMR_INJECTION_SIDE_LOW = 0, | ||
4858 | 315 | IUI_FM_FMR_INJECTION_SIDE_HIGH = 1 | ||
4859 | 316 | }; | ||
4860 | 317 | |||
4861 | 318 | /** | ||
4862 | 319 | * @brief Structure containing the operating information for the FM Radio | ||
4863 | 320 | * macro. | ||
4864 | 321 | * | ||
4865 | 322 | * @rx_freq Tuned frequency in KHz, or 0 if FM Radio is not in use. | ||
4866 | 323 | * @inj_side Injection Side currently in use. | ||
4867 | 324 | */ | ||
4868 | 325 | struct iui_fm_fmr_info { | ||
4869 | 326 | uint32_t rx_freq; | ||
4870 | 327 | enum iui_fm_fmr_injection_side inj_side; | ||
4871 | 328 | }; | ||
4872 | 329 | |||
4873 | 330 | /** | ||
4874 | 331 | * @brief Indicates the status of the Bluetooth module. | ||
4875 | 332 | * | ||
4876 | 333 | * @IUI_FM_BT_STATE_OFF Bluetooth module is turned off. | ||
4877 | 334 | * @IUI_FM_BT_STATE_ON Bluetooth module is turned on. | ||
4878 | 335 | */ | ||
4879 | 336 | enum iui_fm_bt_state { | ||
4880 | 337 | IUI_FM_BT_STATE_OFF = 0, /**< Bluetooth module is turned off. */ | ||
4881 | 338 | IUI_FM_BT_STATE_ON = 1 /**< Bluetooth module is turned on. */ | ||
4882 | 339 | }; | ||
4883 | 340 | |||
4884 | 341 | /** | ||
4885 | 342 | * @brief Structure containing the operating information for the Bluetooth | ||
4886 | 343 | * macro. | ||
4887 | 344 | * | ||
4888 | 345 | * Passed by the Bluetooth macro to Frequency Manager as a Frequency | ||
4889 | 346 | * Notification. | ||
4890 | 347 | * | ||
4891 | 348 | * @bt_state Current state of the Bluetooth macro. | ||
4892 | 349 | */ | ||
4893 | 350 | struct iui_fm_bt_info { | ||
4894 | 351 | enum iui_fm_bt_state bt_state; | ||
4895 | 352 | }; | ||
4896 | 353 | |||
4897 | 354 | /** | ||
4898 | 355 | * @brief Define the number of Bluetooth hopping channels available. | ||
4899 | 356 | */ | ||
4900 | 357 | #define IUI_FM_BT_NUM_CHANNELS 79 | ||
4901 | 358 | |||
4902 | 359 | /** | ||
4903 | 360 | * @brief Number of bits in one word of the Bluetooth Channel Mask. | ||
4904 | 361 | */ | ||
4905 | 362 | #define IUI_FM_BT_CHANNEL_MASK_WORD_BITS 32 | ||
4906 | 363 | |||
4907 | 364 | /** | ||
4908 | 365 | * @brief Number of words needed to contain the full Bluetooth Channel | ||
4909 | 366 | * Bitmask. | ||
4910 | 367 | * | ||
4911 | 368 | * For 79 hopping channels, 3 32-bit words are needed. | ||
4912 | 369 | */ | ||
4913 | 370 | #define IUI_FM_BT_CHANNEL_MASK_WORDS 3 | ||
4914 | 371 | |||
4915 | 372 | /** | ||
4916 | 373 | * @brief Bitfield structure representing a hopping channel mask for the | ||
4917 | 374 | * Bluetooth Macro. | ||
4918 | 375 | * | ||
4919 | 376 | * A set bit indicates a Bluetooth hopping frequency that should be avoided in | ||
4920 | 377 | * order to mitigate crosstalk with another macro. | ||
4921 | 378 | * | ||
4922 | 379 | * @bt_ch_mask Array of words containing the Bluetooth Channel Mask. Each bit | ||
4923 | 380 | * represents one Bluetooth hopping frequency, with the least of | ||
4924 | 381 | * the first word representing the lowest frequency Bluetooth | ||
4925 | 382 | * Hopping Frequency. If the number of hopping frequencies | ||
4926 | 383 | * available is not a multiple of the word width (in bits), then | ||
4927 | 384 | * the remaining unused bits in the last word are ignored. If a | ||
4928 | 385 | * bit is set, the Bluetooth Hopping Frequency corresponding to | ||
4929 | 386 | * that bit should be avoided by the Bluetooth Macro in order to | ||
4930 | 387 | * avoid crosstalk with another macro. | ||
4931 | 388 | */ | ||
4932 | 389 | struct iui_fm_bt_channel_mask { | ||
4933 | 390 | uint32_t bt_ch_mask[IUI_FM_BT_CHANNEL_MASK_WORDS]; | ||
4934 | 391 | }; | ||
4935 | 392 | |||
4936 | 393 | /** | ||
4937 | 394 | * @brief GNSS Macro State enum indicating which (if any) of the GNSS | ||
4938 | 395 | * technologies are being used. | ||
4939 | 396 | * | ||
4940 | 397 | * @IUI_FM_GNSS_STATE_OFF GNSS macro is switched off. | ||
4941 | 398 | * @IUI_FM_GNSS_STATE_GPS_ACTIVE GNSS macro is on and in GPS mode. | ||
4942 | 399 | * @IUI_FM_GNSS_STATE_GLONASS_ACTIVE GNSS macro is on and in GLONASS | ||
4943 | 400 | * mode. | ||
4944 | 401 | * @IUI_FM_GNSS_STATE_GPS_GLONASS_ACTIVE GNSS macro is on and in GPS+GLONASS | ||
4945 | 402 | * mode. | ||
4946 | 403 | */ | ||
4947 | 404 | enum iui_fm_gnss_state { | ||
4948 | 405 | IUI_FM_GNSS_STATE_OFF = 0, | ||
4949 | 406 | IUI_FM_GNSS_STATE_GPS_ACTIVE = 1, | ||
4950 | 407 | IUI_FM_GNSS_STATE_GLONASS_ACTIVE = 2, | ||
4951 | 408 | IUI_FM_GNSS_STATE_GPS_GLONASS_ACTIVE = 3 | ||
4952 | 409 | }; | ||
4953 | 410 | |||
4954 | 411 | /** | ||
4955 | 412 | * @brief GNSS Frequency Information structure passed from GNSS macro to the FM | ||
4956 | 413 | * module during a Frequency Indication. | ||
4957 | 414 | * | ||
4958 | 415 | * @state State of the GNSS module. | ||
4959 | 416 | * @snr Current RX signal to noise ratio for the active GNSS | ||
4960 | 417 | * technology (GPS or GLONASS), or the stronger of the two if | ||
4961 | 418 | * both GPS and GLONASS are active. Valid range: 0..55 dB, or | ||
4962 | 419 | * -1 if not available. | ||
4963 | 420 | * @bus_frequency Bus Frequency used by the GNSS module in KHz, or 0 if GNSS | ||
4964 | 421 | * is inactive/off. Available frequencies: | ||
4965 | 422 | * 78000 KHz (currently not supported) | ||
4966 | 423 | * 83200 KHz | ||
4967 | 424 | * 96000 KHz | ||
4968 | 425 | * @pll_frequency Current operating frequency of the GNSS PLL in KHz, or 0 | ||
4969 | 426 | * if the GNSS PLL is disabled. Available frequencies: | ||
4970 | 427 | * 124800 KHz | ||
4971 | 428 | * 104000 KHz | ||
4972 | 429 | * 96000 KHz | ||
4973 | 430 | * 89000 KHz(currently not supported) | ||
4974 | 431 | * @adc_frequency Current operating frequency of the GNSS ADC output clock | ||
4975 | 432 | * in KHz, or 0 if the GNSS ADC is disabled. Available | ||
4976 | 433 | * frequencies: | ||
4977 | 434 | * 44131 KHz | ||
4978 | 435 | * 52957 KHz | ||
4979 | 436 | * 66196 KHz | ||
4980 | 437 | */ | ||
4981 | 438 | struct iui_fm_gnss_info { | ||
4982 | 439 | enum iui_fm_gnss_state state; | ||
4983 | 440 | int32_t snr; | ||
4984 | 441 | uint32_t bus_frequency; | ||
4985 | 442 | uint32_t pll_frequency; | ||
4986 | 443 | uint32_t adc_frequency; | ||
4987 | 444 | }; | ||
4988 | 445 | |||
4989 | 446 | /** | ||
4990 | 447 | * @brief Mitigation information structure for the GNSS macro. | ||
4991 | 448 | * | ||
4992 | 449 | * @priority Indicates whether the ongoing processing of a previous | ||
4993 | 450 | * mitigation request should be interrupted to fulfil this new | ||
4994 | 451 | * request. Based on whether the phone is currently in an | ||
4995 | 452 | * emergency call or other situation. | ||
4996 | 453 | * @bus_frequency Requested GNSS bus clock frequency in KHz, or 0 if the | ||
4997 | 454 | * GNSS bus is disabled. Available frequencies: | ||
4998 | 455 | * 78000 KHz (currently not supported) | ||
4999 | 456 | * 83200 KHz | ||
5000 | 457 | * 96000 KHz |
The diff has been truncated for viewing.
Test build https:/ /code.launchpad .net/~vicamo/ +recipe/ test-mp- 369139- backport- iwlwifi- dkms passed in all series.