Skip to content

Commit 6bb986e

Browse files
author
Kalle Valo
committed
Merge tag 'iwlwifi-next-for-kalle-2020-05-29' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next
Third set of iwlwifi patches intended for v5.8 * Update range request API; * Add ACPI DSM support; * Support enabling 5.2GHz bands in Indonesia via ACPI; * Bump FW API version to 56; * TX queues refactoring started; * Fix one memory leak; * Some other small fixes and clean-ups; # gpg: Signature made Fri 29 May 2020 10:38:28 AM EEST using RSA key ID 1A3CC5FA # gpg: Good signature from "Luciano Roth Coelho (Luca) <[email protected]>" # gpg: aka "Luciano Roth Coelho (Intel) <[email protected]>"
2 parents 5cf2740 + e6d4318 commit 6bb986e

File tree

21 files changed

+524
-297
lines changed

21 files changed

+524
-297
lines changed

drivers/net/wireless/intel/iwlwifi/cfg/22000.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
#include "iwl-prph.h"
5858

5959
/* Highest firmware API version supported */
60-
#define IWL_22000_UCODE_API_MAX 55
60+
#define IWL_22000_UCODE_API_MAX 56
6161

6262
/* Lowest firmware API version supported */
6363
#define IWL_22000_UCODE_API_MIN 39

drivers/net/wireless/intel/iwlwifi/fw/acpi.c

Lines changed: 88 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -58,44 +58,121 @@
5858
*
5959
*****************************************************************************/
6060

61+
#include <linux/uuid.h>
6162
#include "iwl-drv.h"
6263
#include "iwl-debug.h"
6364
#include "acpi.h"
6465
#include "fw/runtime.h"
6566

66-
void *iwl_acpi_get_object(struct device *dev, acpi_string method)
67+
static const guid_t intel_wifi_guid = GUID_INIT(0xF21202BF, 0x8F78, 0x4DC6,
68+
0xA5, 0xB3, 0x1F, 0x73,
69+
0x8E, 0x28, 0x5A, 0xDE);
70+
71+
static int iwl_acpi_get_handle(struct device *dev, acpi_string method,
72+
acpi_handle *ret_handle)
6773
{
6874
acpi_handle root_handle;
69-
acpi_handle handle;
70-
struct acpi_buffer buf = {ACPI_ALLOCATE_BUFFER, NULL};
7175
acpi_status status;
7276

7377
root_handle = ACPI_HANDLE(dev);
7478
if (!root_handle) {
7579
IWL_DEBUG_DEV_RADIO(dev,
76-
"Could not retrieve root port ACPI handle\n");
77-
return ERR_PTR(-ENOENT);
80+
"ACPI: Could not retrieve root port handle\n");
81+
return -ENOENT;
7882
}
7983

80-
/* Get the method's handle */
81-
status = acpi_get_handle(root_handle, method, &handle);
84+
status = acpi_get_handle(root_handle, method, ret_handle);
8285
if (ACPI_FAILURE(status)) {
83-
IWL_DEBUG_DEV_RADIO(dev, "%s method not found\n", method);
84-
return ERR_PTR(-ENOENT);
86+
IWL_DEBUG_DEV_RADIO(dev,
87+
"ACPI: %s method not found\n", method);
88+
return -ENOENT;
8589
}
90+
return 0;
91+
}
92+
93+
void *iwl_acpi_get_object(struct device *dev, acpi_string method)
94+
{
95+
struct acpi_buffer buf = {ACPI_ALLOCATE_BUFFER, NULL};
96+
acpi_handle handle;
97+
acpi_status status;
98+
int ret;
99+
100+
ret = iwl_acpi_get_handle(dev, method, &handle);
101+
if (ret)
102+
return ERR_PTR(-ENOENT);
86103

87104
/* Call the method with no arguments */
88105
status = acpi_evaluate_object(handle, NULL, NULL, &buf);
89106
if (ACPI_FAILURE(status)) {
90-
IWL_DEBUG_DEV_RADIO(dev, "%s invocation failed (0x%x)\n",
107+
IWL_DEBUG_DEV_RADIO(dev,
108+
"ACPI: %s method invocation failed (status: 0x%x)\n",
91109
method, status);
92110
return ERR_PTR(-ENOENT);
93111
}
94-
95112
return buf.pointer;
96113
}
97114
IWL_EXPORT_SYMBOL(iwl_acpi_get_object);
98115

116+
/**
117+
* Generic function for evaluating a method defined in the device specific
118+
* method (DSM) interface. The returned acpi object must be freed by calling
119+
* function.
120+
*/
121+
void *iwl_acpi_get_dsm_object(struct device *dev, int rev, int func,
122+
union acpi_object *args)
123+
{
124+
union acpi_object *obj;
125+
126+
obj = acpi_evaluate_dsm(ACPI_HANDLE(dev), &intel_wifi_guid, rev, func,
127+
args);
128+
if (!obj) {
129+
IWL_DEBUG_DEV_RADIO(dev,
130+
"ACPI: DSM method invocation failed (rev: %d, func:%d)\n",
131+
rev, func);
132+
return ERR_PTR(-ENOENT);
133+
}
134+
return obj;
135+
}
136+
137+
/**
138+
* Evaluate a DSM with no arguments and a single u8 return value (inside a
139+
* buffer object), verify and return that value.
140+
*/
141+
int iwl_acpi_get_dsm_u8(struct device *dev, int rev, int func)
142+
{
143+
union acpi_object *obj;
144+
int ret;
145+
146+
obj = iwl_acpi_get_dsm_object(dev, rev, func, NULL);
147+
if (IS_ERR(obj))
148+
return -ENOENT;
149+
150+
if (obj->type != ACPI_TYPE_BUFFER) {
151+
IWL_DEBUG_DEV_RADIO(dev,
152+
"ACPI: DSM method did not return a valid object, type=%d\n",
153+
obj->type);
154+
ret = -EINVAL;
155+
goto out;
156+
}
157+
158+
if (obj->buffer.length != sizeof(u8)) {
159+
IWL_DEBUG_DEV_RADIO(dev,
160+
"ACPI: DSM method returned invalid buffer, length=%d\n",
161+
obj->buffer.length);
162+
ret = -EINVAL;
163+
goto out;
164+
}
165+
166+
ret = obj->buffer.pointer[0];
167+
IWL_DEBUG_DEV_RADIO(dev,
168+
"ACPI: DSM method evaluated: func=%d, ret=%d\n",
169+
func, ret);
170+
out:
171+
ACPI_FREE(obj);
172+
return ret;
173+
}
174+
IWL_EXPORT_SYMBOL(iwl_acpi_get_dsm_u8);
175+
99176
union acpi_object *iwl_acpi_get_wifi_pkg(struct device *dev,
100177
union acpi_object *data,
101178
int data_size, int *tbl_rev)

drivers/net/wireless/intel/iwlwifi/fw/acpi.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,23 @@ struct iwl_geo_profile {
127127
u8 values[ACPI_GEO_TABLE_SIZE];
128128
};
129129

130+
enum iwl_dsm_funcs_rev_0 {
131+
DSM_FUNC_QUERY = 0,
132+
DSM_FUNC_DISABLE_SRD = 1,
133+
DSM_FUNC_ENABLE_INDONESIA_5G2 = 2,
134+
};
135+
130136
#ifdef CONFIG_ACPI
131137

132138
struct iwl_fw_runtime;
133139

134140
void *iwl_acpi_get_object(struct device *dev, acpi_string method);
135141

142+
void *iwl_acpi_get_dsm_object(struct device *dev, int rev, int func,
143+
union acpi_object *args);
144+
145+
int iwl_acpi_get_dsm_u8(struct device *dev, int rev, int func);
146+
136147
union acpi_object *iwl_acpi_get_wifi_pkg(struct device *dev,
137148
union acpi_object *data,
138149
int data_size, int *tbl_rev);
@@ -192,6 +203,17 @@ static inline void *iwl_acpi_get_object(struct device *dev, acpi_string method)
192203
return ERR_PTR(-ENOENT);
193204
}
194205

206+
static inline void *iwl_acpi_get_dsm_object(struct device *dev, int rev,
207+
int func, union acpi_object *args)
208+
{
209+
return ERR_PTR(-ENOENT);
210+
}
211+
212+
static inline int iwl_acpi_get_dsm_u8(struct device *dev, int rev, int func)
213+
{
214+
return -ENOENT;
215+
}
216+
195217
static inline union acpi_object *iwl_acpi_get_wifi_pkg(struct device *dev,
196218
union acpi_object *data,
197219
int data_size,

drivers/net/wireless/intel/iwlwifi/fw/api/location.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -550,13 +550,11 @@ struct iwl_tof_range_req_ap_entry_v4 {
550550
/**
551551
* enum iwl_location_cipher - location cipher selection
552552
* @IWL_LOCATION_CIPHER_CCMP_128: CCMP 128
553-
* @IWL_LOCATION_CIPHER_CCMP_256: CCMP 256
554553
* @IWL_LOCATION_CIPHER_GCMP_128: GCMP 128
555554
* @IWL_LOCATION_CIPHER_GCMP_256: GCMP 256
556555
*/
557556
enum iwl_location_cipher {
558557
IWL_LOCATION_CIPHER_CCMP_128,
559-
IWL_LOCATION_CIPHER_CCMP_256,
560558
IWL_LOCATION_CIPHER_GCMP_128,
561559
IWL_LOCATION_CIPHER_GCMP_256,
562560
};
@@ -577,7 +575,8 @@ enum iwl_location_cipher {
577575
* @samples_per_burst: the number of FTMs pairs in single Burst (1-31);
578576
* @num_of_bursts: Recommended value to be sent to the AP. 2s Exponent of
579577
* the number of measurement iterations (min 2^0 = 1, max 2^14)
580-
* @reserved: For alignment and future use
578+
* @sta_id: the station id of the AP. Only relevant when associated to the AP,
579+
* otherwise should be set to &IWL_MVM_INVALID_STA.
581580
* @cipher: pairwise cipher suite for secured measurement.
582581
* &enum iwl_location_cipher.
583582
* @hltk: HLTK to be used for secured 11az measurement
@@ -586,7 +585,8 @@ enum iwl_location_cipher {
586585
* If &IWL_INITIATOR_AP_FLAGS_USE_CALIB is set, the fw will use the
587586
* calibration value that corresponds to the rx bandwidth of the FTM
588587
* frame.
589-
* @reserved2: For alignment and future use.
588+
* @beacon_interval: beacon interval of the AP in TUs. Only required if
589+
* &IWL_INITIATOR_AP_FLAGS_TB is set.
590590
*/
591591
struct iwl_tof_range_req_ap_entry {
592592
__le32 initiator_ap_flags;
@@ -598,13 +598,13 @@ struct iwl_tof_range_req_ap_entry {
598598
__le16 burst_period;
599599
u8 samples_per_burst;
600600
u8 num_of_bursts;
601-
u8 reserved;
601+
u8 sta_id;
602602
u8 cipher;
603603
u8 hltk[HLTK_11AZ_LEN];
604604
u8 tk[TK_11AZ_LEN];
605605
__le16 calib[IWL_TOF_BW_NUM];
606-
__le16 reserved2;
607-
} __packed; /* LOCATION_RANGE_REQ_AP_ENTRY_CMD_API_S_VER_5 */
606+
__le16 beacon_interval;
607+
} __packed; /* LOCATION_RANGE_REQ_AP_ENTRY_CMD_API_S_VER_6 */
608608

609609
/**
610610
* enum iwl_tof_response_mode

drivers/net/wireless/intel/iwlwifi/fw/api/nvm-reg.h

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
99
* Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
1010
* Copyright(c) 2016 - 2017 Intel Deutschland GmbH
11-
* Copyright(C) 2018 - 2019 Intel Corporation
11+
* Copyright(C) 2018 - 2020 Intel Corporation
1212
*
1313
* This program is free software; you can redistribute it and/or modify
1414
* it under the terms of version 2 of the GNU General Public License as
@@ -31,7 +31,7 @@
3131
* Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
3232
* Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
3333
* Copyright(c) 2016 - 2017 Intel Deutschland GmbH
34-
* Copyright(C) 2018 - 2019 Intel Corporation
34+
* Copyright(C) 2018 - 2020 Intel Corporation
3535
* All rights reserved.
3636
*
3737
* Redistribution and use in source and binary forms, with or without
@@ -74,6 +74,11 @@ enum iwl_regulatory_and_nvm_subcmd_ids {
7474
*/
7575
NVM_ACCESS_COMPLETE = 0x0,
7676

77+
/**
78+
* @LARI_CONFIG_CHANGE: &struct iwl_lari_config_change_cmd
79+
*/
80+
LARI_CONFIG_CHANGE = 0x1,
81+
7782
/**
7883
* @NVM_GET_INFO:
7984
* Command is &struct iwl_nvm_get_info,
@@ -446,4 +451,29 @@ struct iwl_tas_config_cmd {
446451
__le32 black_list_size;
447452
__le32 black_list_array[IWL_TAS_BLACK_LIST_MAX];
448453
} __packed; /* TAS_CONFIG_CMD_API_S_VER_2 */
454+
455+
/**
456+
* enum iwl_lari_configs - bit masks for the various LARI config operations
457+
* @LARI_CONFIG_DISABLE_11AC_UKRAINE_MSK: disable 11ac in ukraine
458+
* @LARI_CONFIG_CHANGE_ETSI_TO_PASSIVE_MSK: ETSI 5.8GHz SRD passive scan
459+
* @LARI_CONFIG_CHANGE_ETSI_TO_DISABLED_MSK: ETSI 5.8GHz SRD disabled
460+
* @LARI_CONFIG_ENABLE_5G2_IN_INDONESIA_MSK: enable 5.15/5.35GHz bands in
461+
* Indonesia
462+
*/
463+
enum iwl_lari_config_masks {
464+
LARI_CONFIG_DISABLE_11AC_UKRAINE_MSK = BIT(0),
465+
LARI_CONFIG_CHANGE_ETSI_TO_PASSIVE_MSK = BIT(1),
466+
LARI_CONFIG_CHANGE_ETSI_TO_DISABLED_MSK = BIT(2),
467+
LARI_CONFIG_ENABLE_5G2_IN_INDONESIA_MSK = BIT(3),
468+
};
469+
470+
/**
471+
* struct iwl_lari_config_change_cmd - change LARI configuration
472+
* @config_bitmap: bit map of the config commands. each bit will trigger a
473+
* different predefined FW config operation
474+
*/
475+
struct iwl_lari_config_change_cmd {
476+
__le32 config_bitmap;
477+
} __packed; /* LARI_CHANGE_CONF_CMD_S_VER_1 */
478+
449479
#endif /* __iwl_fw_api_nvm_reg_h__ */

drivers/net/wireless/intel/iwlwifi/iwl-context-info-gen3.h

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* GPL LICENSE SUMMARY
77
*
8-
* Copyright(c) 2018 Intel Corporation
8+
* Copyright(c) 2018, 2020 Intel Corporation
99
*
1010
* This program is free software; you can redistribute it and/or modify
1111
* it under the terms of version 2 of the GNU General Public License as
@@ -18,7 +18,7 @@
1818
*
1919
* BSD LICENSE
2020
*
21-
* Copyright(c) 2018 Intel Corporation
21+
* Copyright(c) 2018, 2020 Intel Corporation
2222
* All rights reserved.
2323
*
2424
* Redistribution and use in source and binary forms, with or without
@@ -93,6 +93,11 @@ enum iwl_prph_scratch_mtr_format {
9393
* @IWL_PRPH_SCRATCH_MTR_FORMAT: a mask for the size of the tfd.
9494
* There are 4 optional values: 0: 16 bit, 1: 32 bit, 2: 64 bit,
9595
* 3: 256 bit.
96+
* @IWL_PRPH_SCRATCH_RB_SIZE_EXT_MASK: RB size full information, ignored
97+
* by older firmware versions, so set IWL_PRPH_SCRATCH_RB_SIZE_4K
98+
* appropriately; use the below values for this.
99+
* @IWL_PRPH_SCRATCH_RB_SIZE_EXT_8K: 8kB RB size
100+
* @IWL_PRPH_SCRATCH_RB_SIZE_EXT_12K: 12kB RB size
96101
*/
97102
enum iwl_prph_scratch_flags {
98103
IWL_PRPH_SCRATCH_EARLY_DEBUG_EN = BIT(4),
@@ -103,6 +108,9 @@ enum iwl_prph_scratch_flags {
103108
IWL_PRPH_SCRATCH_RB_SIZE_4K = BIT(16),
104109
IWL_PRPH_SCRATCH_MTR_MODE = BIT(17),
105110
IWL_PRPH_SCRATCH_MTR_FORMAT = BIT(18) | BIT(19),
111+
IWL_PRPH_SCRATCH_RB_SIZE_EXT_MASK = 0xf << 20,
112+
IWL_PRPH_SCRATCH_RB_SIZE_EXT_8K = 8 << 20,
113+
IWL_PRPH_SCRATCH_RB_SIZE_EXT_12K = 9 << 20,
106114
};
107115

108116
/*

drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ enum iwl_nvm_channel_flags {
240240
* @REG_CAPA_40MHZ_FORBIDDEN: 11n channel with a width of 40Mhz is forbidden
241241
* for this regulatory domain (valid only in 5Ghz).
242242
* @REG_CAPA_DC_HIGH_ENABLED: DC HIGH allowed.
243+
* @REG_CAPA_11AX_DISABLED: 11ax is forbidden for this regulatory domain.
243244
*/
244245
enum iwl_reg_capa_flags {
245246
REG_CAPA_BF_CCD_LOW_BAND = BIT(0),
@@ -250,6 +251,7 @@ enum iwl_reg_capa_flags {
250251
REG_CAPA_MCS_9_ALLOWED = BIT(5),
251252
REG_CAPA_40MHZ_FORBIDDEN = BIT(7),
252253
REG_CAPA_DC_HIGH_ENABLED = BIT(9),
254+
REG_CAPA_11AX_DISABLED = BIT(10),
253255
};
254256

255257
static inline void iwl_nvm_print_channel_flags(struct device *dev, u32 level,
@@ -1115,6 +1117,9 @@ static u32 iwl_nvm_get_regdom_bw_flags(const u16 *nvm_chan,
11151117
flags |= NL80211_RRF_NO_160MHZ;
11161118
}
11171119

1120+
if (cap_flags & REG_CAPA_11AX_DISABLED)
1121+
flags |= NL80211_RRF_NO_HE;
1122+
11181123
return flags;
11191124
}
11201125

0 commit comments

Comments
 (0)