Skip to content

Commit f1c2696

Browse files
author
Kalle Valo
committed
Merge tag 'ath-next-20240502' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath
ath.git patches for v6.10 ath12k * debugfs support * dfs_simulate_radar debugfs file * disable Wireless Extensions * suspend and hibernation support * ACPI support * refactoring in preparation of multi-link support ath11k * support hibernation (required changes in qrtr and MHI subsystems) * ieee80211-freq-limit Device Tree property support ath10k * firmware-name Device Tree property support
2 parents d08aeb9 + bf76b14 commit f1c2696

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+2651
-671
lines changed

Documentation/devicetree/bindings/net/wireless/qcom,ath10k.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ properties:
7373
- sky85703-11
7474
- sky85803
7575

76+
firmware-name:
77+
maxItems: 1
78+
description:
79+
If present, a board or platform specific string used to lookup firmware
80+
files for the device.
81+
7682
wifi-firmware:
7783
type: object
7884
additionalProperties: false

Documentation/devicetree/bindings/net/wireless/qcom,ath11k.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ properties:
5959
minItems: 1
6060
maxItems: 2
6161

62+
ieee80211-freq-limit: true
63+
6264
wifi-firmware:
6365
type: object
6466
description: |
@@ -88,6 +90,7 @@ required:
8890
additionalProperties: false
8991

9092
allOf:
93+
- $ref: ieee80211.yaml#
9194
- if:
9295
properties:
9396
compatible:

drivers/bus/mhi/host/internal.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ enum dev_st_transition {
8080
DEV_ST_TRANSITION_FP,
8181
DEV_ST_TRANSITION_SYS_ERR,
8282
DEV_ST_TRANSITION_DISABLE,
83+
DEV_ST_TRANSITION_DISABLE_DESTROY_DEVICE,
8384
DEV_ST_TRANSITION_MAX,
8485
};
8586

@@ -90,7 +91,8 @@ enum dev_st_transition {
9091
dev_st_trans(MISSION_MODE, "MISSION MODE") \
9192
dev_st_trans(FP, "FLASH PROGRAMMER") \
9293
dev_st_trans(SYS_ERR, "SYS ERROR") \
93-
dev_st_trans_end(DISABLE, "DISABLE")
94+
dev_st_trans(DISABLE, "DISABLE") \
95+
dev_st_trans_end(DISABLE_DESTROY_DEVICE, "DISABLE (DESTROY DEVICE)")
9496

9597
extern const char * const dev_state_tran_str[DEV_ST_TRANSITION_MAX];
9698
#define TO_DEV_STATE_TRANS_STR(state) (((state) >= DEV_ST_TRANSITION_MAX) ? \

drivers/bus/mhi/host/pm.c

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,8 @@ static int mhi_pm_mission_mode_transition(struct mhi_controller *mhi_cntrl)
468468
}
469469

470470
/* Handle shutdown transitions */
471-
static void mhi_pm_disable_transition(struct mhi_controller *mhi_cntrl)
471+
static void mhi_pm_disable_transition(struct mhi_controller *mhi_cntrl,
472+
bool destroy_device)
472473
{
473474
enum mhi_pm_state cur_state;
474475
struct mhi_event *mhi_event;
@@ -530,8 +531,16 @@ static void mhi_pm_disable_transition(struct mhi_controller *mhi_cntrl)
530531
dev_dbg(dev, "Waiting for all pending threads to complete\n");
531532
wake_up_all(&mhi_cntrl->state_event);
532533

533-
dev_dbg(dev, "Reset all active channels and remove MHI devices\n");
534-
device_for_each_child(&mhi_cntrl->mhi_dev->dev, NULL, mhi_destroy_device);
534+
/*
535+
* Only destroy the 'struct device' for channels if indicated by the
536+
* 'destroy_device' flag. Because, during system suspend or hibernation
537+
* state, there is no need to destroy the 'struct device' as the endpoint
538+
* device would still be physically attached to the machine.
539+
*/
540+
if (destroy_device) {
541+
dev_dbg(dev, "Reset all active channels and remove MHI devices\n");
542+
device_for_each_child(&mhi_cntrl->mhi_dev->dev, NULL, mhi_destroy_device);
543+
}
535544

536545
mutex_lock(&mhi_cntrl->pm_mutex);
537546

@@ -821,7 +830,10 @@ void mhi_pm_st_worker(struct work_struct *work)
821830
mhi_pm_sys_error_transition(mhi_cntrl);
822831
break;
823832
case DEV_ST_TRANSITION_DISABLE:
824-
mhi_pm_disable_transition(mhi_cntrl);
833+
mhi_pm_disable_transition(mhi_cntrl, false);
834+
break;
835+
case DEV_ST_TRANSITION_DISABLE_DESTROY_DEVICE:
836+
mhi_pm_disable_transition(mhi_cntrl, true);
825837
break;
826838
default:
827839
break;
@@ -1175,7 +1187,8 @@ int mhi_async_power_up(struct mhi_controller *mhi_cntrl)
11751187
}
11761188
EXPORT_SYMBOL_GPL(mhi_async_power_up);
11771189

1178-
void mhi_power_down(struct mhi_controller *mhi_cntrl, bool graceful)
1190+
static void __mhi_power_down(struct mhi_controller *mhi_cntrl, bool graceful,
1191+
bool destroy_device)
11791192
{
11801193
enum mhi_pm_state cur_state, transition_state;
11811194
struct device *dev = &mhi_cntrl->mhi_dev->dev;
@@ -1211,15 +1224,32 @@ void mhi_power_down(struct mhi_controller *mhi_cntrl, bool graceful)
12111224
write_unlock_irq(&mhi_cntrl->pm_lock);
12121225
mutex_unlock(&mhi_cntrl->pm_mutex);
12131226

1214-
mhi_queue_state_transition(mhi_cntrl, DEV_ST_TRANSITION_DISABLE);
1227+
if (destroy_device)
1228+
mhi_queue_state_transition(mhi_cntrl,
1229+
DEV_ST_TRANSITION_DISABLE_DESTROY_DEVICE);
1230+
else
1231+
mhi_queue_state_transition(mhi_cntrl,
1232+
DEV_ST_TRANSITION_DISABLE);
12151233

12161234
/* Wait for shutdown to complete */
12171235
flush_work(&mhi_cntrl->st_worker);
12181236

12191237
disable_irq(mhi_cntrl->irq[0]);
12201238
}
1239+
1240+
void mhi_power_down(struct mhi_controller *mhi_cntrl, bool graceful)
1241+
{
1242+
__mhi_power_down(mhi_cntrl, graceful, true);
1243+
}
12211244
EXPORT_SYMBOL_GPL(mhi_power_down);
12221245

1246+
void mhi_power_down_keep_dev(struct mhi_controller *mhi_cntrl,
1247+
bool graceful)
1248+
{
1249+
__mhi_power_down(mhi_cntrl, graceful, false);
1250+
}
1251+
EXPORT_SYMBOL_GPL(mhi_power_down_keep_dev);
1252+
12231253
int mhi_sync_power_up(struct mhi_controller *mhi_cntrl)
12241254
{
12251255
int ret = mhi_async_power_up(mhi_cntrl);

drivers/net/wireless/ath/ar5523/ar5523.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1594,6 +1594,20 @@ static int ar5523_probe(struct usb_interface *intf,
15941594
struct ar5523 *ar;
15951595
int error = -ENOMEM;
15961596

1597+
static const u8 bulk_ep_addr[] = {
1598+
AR5523_CMD_TX_PIPE | USB_DIR_OUT,
1599+
AR5523_DATA_TX_PIPE | USB_DIR_OUT,
1600+
AR5523_CMD_RX_PIPE | USB_DIR_IN,
1601+
AR5523_DATA_RX_PIPE | USB_DIR_IN,
1602+
0};
1603+
1604+
if (!usb_check_bulk_endpoints(intf, bulk_ep_addr)) {
1605+
dev_err(&dev->dev,
1606+
"Could not find all expected endpoints\n");
1607+
error = -ENODEV;
1608+
goto out;
1609+
}
1610+
15971611
/*
15981612
* Load firmware if the device requires it. This will return
15991613
* -ENXIO on success and we'll get called back afer the usb

drivers/net/wireless/ath/ath.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,10 @@ struct ath_common {
171171
unsigned int clockrate;
172172

173173
spinlock_t cc_lock;
174-
struct ath_cycle_counters cc_ani;
175-
struct ath_cycle_counters cc_survey;
174+
struct_group(cc,
175+
struct ath_cycle_counters cc_ani;
176+
struct ath_cycle_counters cc_survey;
177+
);
176178

177179
struct ath_regulatory regulatory;
178180
struct ath_regulatory reg_world_copy;

drivers/net/wireless/ath/ath10k/core.c

Lines changed: 14 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
7575
.cal_data_len = 2116,
7676
.fw = {
7777
.dir = QCA988X_HW_2_0_FW_DIR,
78-
.board = QCA988X_HW_2_0_BOARD_DATA_FILE,
7978
.board_size = QCA988X_BOARD_DATA_SZ,
8079
.board_ext_size = QCA988X_BOARD_EXT_DATA_SZ,
8180
},
@@ -116,7 +115,6 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
116115
.cal_data_len = 2116,
117116
.fw = {
118117
.dir = QCA988X_HW_2_0_FW_DIR,
119-
.board = QCA988X_HW_2_0_BOARD_DATA_FILE,
120118
.board_size = QCA988X_BOARD_DATA_SZ,
121119
.board_ext_size = QCA988X_BOARD_EXT_DATA_SZ,
122120
},
@@ -158,7 +156,6 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
158156
.cal_data_len = 2116,
159157
.fw = {
160158
.dir = QCA9887_HW_1_0_FW_DIR,
161-
.board = QCA9887_HW_1_0_BOARD_DATA_FILE,
162159
.board_size = QCA9887_BOARD_DATA_SZ,
163160
.board_ext_size = QCA9887_BOARD_EXT_DATA_SZ,
164161
},
@@ -199,7 +196,6 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
199196
.cal_data_len = 0,
200197
.fw = {
201198
.dir = QCA6174_HW_3_0_FW_DIR,
202-
.board = QCA6174_HW_3_0_BOARD_DATA_FILE,
203199
.board_size = QCA6174_BOARD_DATA_SZ,
204200
.board_ext_size = QCA6174_BOARD_EXT_DATA_SZ,
205201
},
@@ -236,7 +232,6 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
236232
.cal_data_len = 8124,
237233
.fw = {
238234
.dir = QCA6174_HW_2_1_FW_DIR,
239-
.board = QCA6174_HW_2_1_BOARD_DATA_FILE,
240235
.board_size = QCA6174_BOARD_DATA_SZ,
241236
.board_ext_size = QCA6174_BOARD_EXT_DATA_SZ,
242237
},
@@ -277,7 +272,6 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
277272
.cal_data_len = 8124,
278273
.fw = {
279274
.dir = QCA6174_HW_2_1_FW_DIR,
280-
.board = QCA6174_HW_2_1_BOARD_DATA_FILE,
281275
.board_size = QCA6174_BOARD_DATA_SZ,
282276
.board_ext_size = QCA6174_BOARD_EXT_DATA_SZ,
283277
},
@@ -318,7 +312,6 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
318312
.cal_data_len = 8124,
319313
.fw = {
320314
.dir = QCA6174_HW_3_0_FW_DIR,
321-
.board = QCA6174_HW_3_0_BOARD_DATA_FILE,
322315
.board_size = QCA6174_BOARD_DATA_SZ,
323316
.board_ext_size = QCA6174_BOARD_EXT_DATA_SZ,
324317
},
@@ -360,7 +353,6 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
360353
.fw = {
361354
/* uses same binaries as hw3.0 */
362355
.dir = QCA6174_HW_3_0_FW_DIR,
363-
.board = QCA6174_HW_3_0_BOARD_DATA_FILE,
364356
.board_size = QCA6174_BOARD_DATA_SZ,
365357
.board_ext_size = QCA6174_BOARD_EXT_DATA_SZ,
366358
},
@@ -409,7 +401,6 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
409401
.cal_data_len = 12064,
410402
.fw = {
411403
.dir = QCA99X0_HW_2_0_FW_DIR,
412-
.board = QCA99X0_HW_2_0_BOARD_DATA_FILE,
413404
.board_size = QCA99X0_BOARD_DATA_SZ,
414405
.board_ext_size = QCA99X0_BOARD_EXT_DATA_SZ,
415406
},
@@ -457,8 +448,6 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
457448
.cal_data_len = 12064,
458449
.fw = {
459450
.dir = QCA9984_HW_1_0_FW_DIR,
460-
.board = QCA9984_HW_1_0_BOARD_DATA_FILE,
461-
.eboard = QCA9984_HW_1_0_EBOARD_DATA_FILE,
462451
.board_size = QCA99X0_BOARD_DATA_SZ,
463452
.board_ext_size = QCA99X0_BOARD_EXT_DATA_SZ,
464453
.ext_board_size = QCA99X0_EXT_BOARD_DATA_SZ,
@@ -510,7 +499,6 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
510499
.cal_data_len = 12064,
511500
.fw = {
512501
.dir = QCA9888_HW_2_0_FW_DIR,
513-
.board = QCA9888_HW_2_0_BOARD_DATA_FILE,
514502
.board_size = QCA99X0_BOARD_DATA_SZ,
515503
.board_ext_size = QCA99X0_BOARD_EXT_DATA_SZ,
516504
},
@@ -556,7 +544,6 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
556544
.cal_data_len = 8124,
557545
.fw = {
558546
.dir = QCA9377_HW_1_0_FW_DIR,
559-
.board = QCA9377_HW_1_0_BOARD_DATA_FILE,
560547
.board_size = QCA9377_BOARD_DATA_SZ,
561548
.board_ext_size = QCA9377_BOARD_EXT_DATA_SZ,
562549
},
@@ -597,7 +584,6 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
597584
.cal_data_len = 8124,
598585
.fw = {
599586
.dir = QCA9377_HW_1_0_FW_DIR,
600-
.board = QCA9377_HW_1_0_BOARD_DATA_FILE,
601587
.board_size = QCA9377_BOARD_DATA_SZ,
602588
.board_ext_size = QCA9377_BOARD_EXT_DATA_SZ,
603589
},
@@ -640,7 +626,6 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
640626
.cal_data_len = 8124,
641627
.fw = {
642628
.dir = QCA9377_HW_1_0_FW_DIR,
643-
.board = QCA9377_HW_1_0_BOARD_DATA_FILE,
644629
.board_size = QCA9377_BOARD_DATA_SZ,
645630
.board_ext_size = QCA9377_BOARD_EXT_DATA_SZ,
646631
},
@@ -680,7 +665,6 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
680665
.cal_data_len = 12064,
681666
.fw = {
682667
.dir = QCA4019_HW_1_0_FW_DIR,
683-
.board = QCA4019_HW_1_0_BOARD_DATA_FILE,
684668
.board_size = QCA4019_BOARD_DATA_SZ,
685669
.board_ext_size = QCA4019_BOARD_EXT_DATA_SZ,
686670
},
@@ -720,6 +704,8 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
720704
.max_spatial_stream = 4,
721705
.fw = {
722706
.dir = WCN3990_HW_1_0_FW_DIR,
707+
.board_size = WCN3990_BOARD_DATA_SZ,
708+
.board_ext_size = WCN3990_BOARD_EXT_DATA_SZ,
723709
},
724710
.sw_decrypt_mcast_mgmt = true,
725711
.rx_desc_ops = &wcn3990_rx_desc_ops,
@@ -942,11 +928,20 @@ static const struct firmware *ath10k_fetch_fw_file(struct ath10k *ar,
942928
if (dir == NULL)
943929
dir = ".";
944930

931+
if (ar->board_name) {
932+
snprintf(filename, sizeof(filename), "%s/%s/%s",
933+
dir, ar->board_name, file);
934+
ret = firmware_request_nowarn(&fw, filename, ar->dev);
935+
ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot fw request '%s': %d\n",
936+
filename, ret);
937+
if (!ret)
938+
return fw;
939+
}
940+
945941
snprintf(filename, sizeof(filename), "%s/%s", dir, file);
946942
ret = firmware_request_nowarn(&fw, filename, ar->dev);
947943
ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot fw request '%s': %d\n",
948944
filename, ret);
949-
950945
if (ret)
951946
return ERR_PTR(ret);
952947

@@ -1288,11 +1283,6 @@ static int ath10k_core_fetch_board_data_api_1(struct ath10k *ar, int bd_ie_type)
12881283
char boardname[100];
12891284

12901285
if (bd_ie_type == ATH10K_BD_IE_BOARD) {
1291-
if (!ar->hw_params.fw.board) {
1292-
ath10k_err(ar, "failed to find board file fw entry\n");
1293-
return -EINVAL;
1294-
}
1295-
12961286
scnprintf(boardname, sizeof(boardname), "board-%s-%s.bin",
12971287
ath10k_bus_str(ar->hif.bus), dev_name(ar->dev));
12981288

@@ -1302,7 +1292,7 @@ static int ath10k_core_fetch_board_data_api_1(struct ath10k *ar, int bd_ie_type)
13021292
if (IS_ERR(ar->normal_mode_fw.board)) {
13031293
fw = ath10k_fetch_fw_file(ar,
13041294
ar->hw_params.fw.dir,
1305-
ar->hw_params.fw.board);
1295+
ATH10K_BOARD_DATA_FILE);
13061296
ar->normal_mode_fw.board = fw;
13071297
}
13081298

@@ -1312,13 +1302,8 @@ static int ath10k_core_fetch_board_data_api_1(struct ath10k *ar, int bd_ie_type)
13121302
ar->normal_mode_fw.board_data = ar->normal_mode_fw.board->data;
13131303
ar->normal_mode_fw.board_len = ar->normal_mode_fw.board->size;
13141304
} else if (bd_ie_type == ATH10K_BD_IE_BOARD_EXT) {
1315-
if (!ar->hw_params.fw.eboard) {
1316-
ath10k_err(ar, "failed to find eboard file fw entry\n");
1317-
return -EINVAL;
1318-
}
1319-
13201305
fw = ath10k_fetch_fw_file(ar, ar->hw_params.fw.dir,
1321-
ar->hw_params.fw.eboard);
1306+
ATH10K_EBOARD_DATA_FILE);
13221307
ar->normal_mode_fw.ext_board = fw;
13231308
if (IS_ERR(ar->normal_mode_fw.ext_board))
13241309
return PTR_ERR(ar->normal_mode_fw.ext_board);

drivers/net/wireless/ath/ath10k/core.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,6 +1081,8 @@ struct ath10k {
10811081
*/
10821082
const struct ath10k_fw_components *running_fw;
10831083

1084+
const char *board_name;
1085+
10841086
const struct firmware *pre_cal_file;
10851087
const struct firmware *cal_file;
10861088

drivers/net/wireless/ath/ath10k/debugfs_sta.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ ath10k_dbg_sta_write_peer_debug_trigger(struct file *file,
439439
}
440440
out:
441441
mutex_unlock(&ar->conf_mutex);
442-
return count;
442+
return ret ?: count;
443443
}
444444

445445
static const struct file_operations fops_peer_debug_trigger = {

0 commit comments

Comments
 (0)