wmi.c (0c8ea05e9b3d8e5287e2a968f2a2e744dfd31b99) wmi.c (8e1debd82466a3fe711784ab37e6b54e56011267)
1// SPDX-License-Identifier: ISC
2/*
3 * Copyright (c) 2005-2011 Atheros Communications Inc.
4 * Copyright (c) 2011-2017 Qualcomm Atheros, Inc.
5 * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
6 * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
7 */
8

--- 7479 unchanged lines hidden (view full) ---

7488 ether_addr_copy(cmd->peer_macaddr.addr, peer_addr);
7489
7490 ath10k_dbg(ar, ATH10K_DBG_WMI,
7491 "wmi vdev %d peer 0x%pM set param %d value %d\n",
7492 vdev_id, peer_addr, param_id, param_value);
7493 return skb;
7494}
7495
1// SPDX-License-Identifier: ISC
2/*
3 * Copyright (c) 2005-2011 Atheros Communications Inc.
4 * Copyright (c) 2011-2017 Qualcomm Atheros, Inc.
5 * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
6 * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
7 */
8

--- 7479 unchanged lines hidden (view full) ---

7488 ether_addr_copy(cmd->peer_macaddr.addr, peer_addr);
7489
7490 ath10k_dbg(ar, ATH10K_DBG_WMI,
7491 "wmi vdev %d peer 0x%pM set param %d value %d\n",
7492 vdev_id, peer_addr, param_id, param_value);
7493 return skb;
7494}
7495
7496static struct sk_buff *ath10k_wmi_op_gen_gpio_config(struct ath10k *ar,
7497 u32 gpio_num, u32 input,
7498 u32 pull_type, u32 intr_mode)
7499{
7500 struct wmi_gpio_config_cmd *cmd;
7501 struct sk_buff *skb;
7502
7503 skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd));
7504 if (!skb)
7505 return ERR_PTR(-ENOMEM);
7506
7507 cmd = (struct wmi_gpio_config_cmd *)skb->data;
7508 cmd->pull_type = __cpu_to_le32(pull_type);
7509 cmd->gpio_num = __cpu_to_le32(gpio_num);
7510 cmd->input = __cpu_to_le32(input);
7511 cmd->intr_mode = __cpu_to_le32(intr_mode);
7512
7513 ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi gpio_config gpio_num 0x%08x input 0x%08x pull_type 0x%08x intr_mode 0x%08x\n",
7514 gpio_num, input, pull_type, intr_mode);
7515
7516 return skb;
7517}
7518
7519static struct sk_buff *ath10k_wmi_op_gen_gpio_output(struct ath10k *ar,
7520 u32 gpio_num, u32 set)
7521{
7522 struct wmi_gpio_output_cmd *cmd;
7523 struct sk_buff *skb;
7524
7525 skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd));
7526 if (!skb)
7527 return ERR_PTR(-ENOMEM);
7528
7529 cmd = (struct wmi_gpio_output_cmd *)skb->data;
7530 cmd->gpio_num = __cpu_to_le32(gpio_num);
7531 cmd->set = __cpu_to_le32(set);
7532
7533 ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi gpio_output gpio_num 0x%08x set 0x%08x\n",
7534 gpio_num, set);
7535
7536 return skb;
7537}
7538
7496static struct sk_buff *
7497ath10k_wmi_op_gen_set_psmode(struct ath10k *ar, u32 vdev_id,
7498 enum wmi_sta_ps_mode psmode)
7499{
7500 struct wmi_sta_powersave_mode_cmd *cmd;
7501 struct sk_buff *skb;
7502
7503 skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd));

--- 1648 unchanged lines hidden (view full) ---

9152 /* .gen_pdev_get_temperature not implemented */
9153 .gen_addba_clear_resp = ath10k_wmi_op_gen_addba_clear_resp,
9154 .gen_addba_send = ath10k_wmi_op_gen_addba_send,
9155 .gen_addba_set_resp = ath10k_wmi_op_gen_addba_set_resp,
9156 .gen_delba_send = ath10k_wmi_op_gen_delba_send,
9157 .fw_stats_fill = ath10k_wmi_main_op_fw_stats_fill,
9158 .get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype,
9159 .gen_echo = ath10k_wmi_op_gen_echo,
7539static struct sk_buff *
7540ath10k_wmi_op_gen_set_psmode(struct ath10k *ar, u32 vdev_id,
7541 enum wmi_sta_ps_mode psmode)
7542{
7543 struct wmi_sta_powersave_mode_cmd *cmd;
7544 struct sk_buff *skb;
7545
7546 skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd));

--- 1648 unchanged lines hidden (view full) ---

9195 /* .gen_pdev_get_temperature not implemented */
9196 .gen_addba_clear_resp = ath10k_wmi_op_gen_addba_clear_resp,
9197 .gen_addba_send = ath10k_wmi_op_gen_addba_send,
9198 .gen_addba_set_resp = ath10k_wmi_op_gen_addba_set_resp,
9199 .gen_delba_send = ath10k_wmi_op_gen_delba_send,
9200 .fw_stats_fill = ath10k_wmi_main_op_fw_stats_fill,
9201 .get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype,
9202 .gen_echo = ath10k_wmi_op_gen_echo,
9203 .gen_gpio_config = ath10k_wmi_op_gen_gpio_config,
9204 .gen_gpio_output = ath10k_wmi_op_gen_gpio_output,
9205
9160 /* .gen_bcn_tmpl not implemented */
9161 /* .gen_prb_tmpl not implemented */
9162 /* .gen_p2p_go_bcn_ie not implemented */
9163 /* .gen_adaptive_qcs not implemented */
9164 /* .gen_pdev_enable_adaptive_cca not implemented */
9165};
9166
9167static const struct wmi_ops wmi_10_1_ops = {

--- 54 unchanged lines hidden (view full) ---

9222 .gen_pdev_set_quiet_mode = ath10k_wmi_op_gen_pdev_set_quiet_mode,
9223 .gen_addba_clear_resp = ath10k_wmi_op_gen_addba_clear_resp,
9224 .gen_addba_send = ath10k_wmi_op_gen_addba_send,
9225 .gen_addba_set_resp = ath10k_wmi_op_gen_addba_set_resp,
9226 .gen_delba_send = ath10k_wmi_op_gen_delba_send,
9227 .fw_stats_fill = ath10k_wmi_10x_op_fw_stats_fill,
9228 .get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype,
9229 .gen_echo = ath10k_wmi_op_gen_echo,
9206 /* .gen_bcn_tmpl not implemented */
9207 /* .gen_prb_tmpl not implemented */
9208 /* .gen_p2p_go_bcn_ie not implemented */
9209 /* .gen_adaptive_qcs not implemented */
9210 /* .gen_pdev_enable_adaptive_cca not implemented */
9211};
9212
9213static const struct wmi_ops wmi_10_1_ops = {

--- 54 unchanged lines hidden (view full) ---

9268 .gen_pdev_set_quiet_mode = ath10k_wmi_op_gen_pdev_set_quiet_mode,
9269 .gen_addba_clear_resp = ath10k_wmi_op_gen_addba_clear_resp,
9270 .gen_addba_send = ath10k_wmi_op_gen_addba_send,
9271 .gen_addba_set_resp = ath10k_wmi_op_gen_addba_set_resp,
9272 .gen_delba_send = ath10k_wmi_op_gen_delba_send,
9273 .fw_stats_fill = ath10k_wmi_10x_op_fw_stats_fill,
9274 .get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype,
9275 .gen_echo = ath10k_wmi_op_gen_echo,
9276 .gen_gpio_config = ath10k_wmi_op_gen_gpio_config,
9277 .gen_gpio_output = ath10k_wmi_op_gen_gpio_output,
9230 /* .gen_bcn_tmpl not implemented */
9231 /* .gen_prb_tmpl not implemented */
9232 /* .gen_p2p_go_bcn_ie not implemented */
9233 /* .gen_adaptive_qcs not implemented */
9234 /* .gen_pdev_enable_adaptive_cca not implemented */
9235};
9236
9237static const struct wmi_ops wmi_10_2_ops = {

--- 56 unchanged lines hidden (view full) ---

9294 .gen_pktlog_disable = ath10k_wmi_op_gen_pktlog_disable,
9295 .gen_pdev_set_quiet_mode = ath10k_wmi_op_gen_pdev_set_quiet_mode,
9296 .gen_addba_clear_resp = ath10k_wmi_op_gen_addba_clear_resp,
9297 .gen_addba_send = ath10k_wmi_op_gen_addba_send,
9298 .gen_addba_set_resp = ath10k_wmi_op_gen_addba_set_resp,
9299 .gen_delba_send = ath10k_wmi_op_gen_delba_send,
9300 .fw_stats_fill = ath10k_wmi_10x_op_fw_stats_fill,
9301 .get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype,
9278 /* .gen_bcn_tmpl not implemented */
9279 /* .gen_prb_tmpl not implemented */
9280 /* .gen_p2p_go_bcn_ie not implemented */
9281 /* .gen_adaptive_qcs not implemented */
9282 /* .gen_pdev_enable_adaptive_cca not implemented */
9283};
9284
9285static const struct wmi_ops wmi_10_2_ops = {

--- 56 unchanged lines hidden (view full) ---

9342 .gen_pktlog_disable = ath10k_wmi_op_gen_pktlog_disable,
9343 .gen_pdev_set_quiet_mode = ath10k_wmi_op_gen_pdev_set_quiet_mode,
9344 .gen_addba_clear_resp = ath10k_wmi_op_gen_addba_clear_resp,
9345 .gen_addba_send = ath10k_wmi_op_gen_addba_send,
9346 .gen_addba_set_resp = ath10k_wmi_op_gen_addba_set_resp,
9347 .gen_delba_send = ath10k_wmi_op_gen_delba_send,
9348 .fw_stats_fill = ath10k_wmi_10x_op_fw_stats_fill,
9349 .get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype,
9350 .gen_gpio_config = ath10k_wmi_op_gen_gpio_config,
9351 .gen_gpio_output = ath10k_wmi_op_gen_gpio_output,
9302 /* .gen_pdev_enable_adaptive_cca not implemented */
9303};
9304
9305static const struct wmi_ops wmi_10_2_4_ops = {
9306 .rx = ath10k_wmi_10_2_op_rx,
9307 .pull_fw_stats = ath10k_wmi_10_2_4_op_pull_fw_stats,
9308 .gen_init = ath10k_wmi_10_2_op_gen_init,
9309 .gen_peer_assoc = ath10k_wmi_10_2_op_gen_peer_assoc,

--- 55 unchanged lines hidden (view full) ---

9365 .gen_addba_set_resp = ath10k_wmi_op_gen_addba_set_resp,
9366 .gen_delba_send = ath10k_wmi_op_gen_delba_send,
9367 .gen_pdev_get_tpc_config = ath10k_wmi_10_2_4_op_gen_pdev_get_tpc_config,
9368 .fw_stats_fill = ath10k_wmi_10x_op_fw_stats_fill,
9369 .gen_pdev_enable_adaptive_cca =
9370 ath10k_wmi_op_gen_pdev_enable_adaptive_cca,
9371 .get_vdev_subtype = ath10k_wmi_10_2_4_op_get_vdev_subtype,
9372 .gen_bb_timing = ath10k_wmi_10_2_4_op_gen_bb_timing,
9352 /* .gen_pdev_enable_adaptive_cca not implemented */
9353};
9354
9355static const struct wmi_ops wmi_10_2_4_ops = {
9356 .rx = ath10k_wmi_10_2_op_rx,
9357 .pull_fw_stats = ath10k_wmi_10_2_4_op_pull_fw_stats,
9358 .gen_init = ath10k_wmi_10_2_op_gen_init,
9359 .gen_peer_assoc = ath10k_wmi_10_2_op_gen_peer_assoc,

--- 55 unchanged lines hidden (view full) ---

9415 .gen_addba_set_resp = ath10k_wmi_op_gen_addba_set_resp,
9416 .gen_delba_send = ath10k_wmi_op_gen_delba_send,
9417 .gen_pdev_get_tpc_config = ath10k_wmi_10_2_4_op_gen_pdev_get_tpc_config,
9418 .fw_stats_fill = ath10k_wmi_10x_op_fw_stats_fill,
9419 .gen_pdev_enable_adaptive_cca =
9420 ath10k_wmi_op_gen_pdev_enable_adaptive_cca,
9421 .get_vdev_subtype = ath10k_wmi_10_2_4_op_get_vdev_subtype,
9422 .gen_bb_timing = ath10k_wmi_10_2_4_op_gen_bb_timing,
9423 .gen_gpio_config = ath10k_wmi_op_gen_gpio_config,
9424 .gen_gpio_output = ath10k_wmi_op_gen_gpio_output,
9373 /* .gen_bcn_tmpl not implemented */
9374 /* .gen_prb_tmpl not implemented */
9375 /* .gen_p2p_go_bcn_ie not implemented */
9376 /* .gen_adaptive_qcs not implemented */
9377};
9378
9379static const struct wmi_ops wmi_10_4_ops = {
9380 .rx = ath10k_wmi_10_4_op_rx,

--- 65 unchanged lines hidden (view full) ---

9446 /* shared with 10.2 */
9447 .pull_echo_ev = ath10k_wmi_op_pull_echo_ev,
9448 .gen_request_stats = ath10k_wmi_op_gen_request_stats,
9449 .gen_pdev_get_temperature = ath10k_wmi_10_2_op_gen_pdev_get_temperature,
9450 .get_vdev_subtype = ath10k_wmi_10_4_op_get_vdev_subtype,
9451 .gen_pdev_bss_chan_info_req = ath10k_wmi_10_2_op_gen_pdev_bss_chan_info,
9452 .gen_echo = ath10k_wmi_op_gen_echo,
9453 .gen_pdev_get_tpc_config = ath10k_wmi_10_2_4_op_gen_pdev_get_tpc_config,
9425 /* .gen_bcn_tmpl not implemented */
9426 /* .gen_prb_tmpl not implemented */
9427 /* .gen_p2p_go_bcn_ie not implemented */
9428 /* .gen_adaptive_qcs not implemented */
9429};
9430
9431static const struct wmi_ops wmi_10_4_ops = {
9432 .rx = ath10k_wmi_10_4_op_rx,

--- 65 unchanged lines hidden (view full) ---

9498 /* shared with 10.2 */
9499 .pull_echo_ev = ath10k_wmi_op_pull_echo_ev,
9500 .gen_request_stats = ath10k_wmi_op_gen_request_stats,
9501 .gen_pdev_get_temperature = ath10k_wmi_10_2_op_gen_pdev_get_temperature,
9502 .get_vdev_subtype = ath10k_wmi_10_4_op_get_vdev_subtype,
9503 .gen_pdev_bss_chan_info_req = ath10k_wmi_10_2_op_gen_pdev_bss_chan_info,
9504 .gen_echo = ath10k_wmi_op_gen_echo,
9505 .gen_pdev_get_tpc_config = ath10k_wmi_10_2_4_op_gen_pdev_get_tpc_config,
9506 .gen_gpio_config = ath10k_wmi_op_gen_gpio_config,
9507 .gen_gpio_output = ath10k_wmi_op_gen_gpio_output,
9454};
9455
9456int ath10k_wmi_attach(struct ath10k *ar)
9457{
9458 switch (ar->running_fw->fw_file.wmi_op_version) {
9459 case ATH10K_FW_WMI_OP_VERSION_10_4:
9460 ar->wmi.ops = &wmi_10_4_ops;
9461 ar->wmi.cmd = &wmi_10_4_cmd_map;

--- 117 unchanged lines hidden ---
9508};
9509
9510int ath10k_wmi_attach(struct ath10k *ar)
9511{
9512 switch (ar->running_fw->fw_file.wmi_op_version) {
9513 case ATH10K_FW_WMI_OP_VERSION_10_4:
9514 ar->wmi.ops = &wmi_10_4_ops;
9515 ar->wmi.cmd = &wmi_10_4_cmd_map;

--- 117 unchanged lines hidden ---