ath11k: rename ath11k_wmi_base instances from wmi_sc to wmi_ab
Subsystems (2)
PATCH v2 1/3 ath11k: rename ath11k_wmi_base instances from wmi_sc to wmi_ab
This makes the code consistent with the recent sc to ab rename.
--- drivers/net/wireless/ath/ath11k/core.c | 4 +- drivers/net/wireless/ath/ath11k/core.h | 2 +- drivers/net/wireless/ath/ath11k/htc.c | 2 +- drivers/net/wireless/ath/ath11k/mac.c | 4 +- drivers/net/wireless/ath/ath11k/testmode.c | 2 +- drivers/net/wireless/ath/ath11k/wmi.c | 146 ++++++++++----------- drivers/net/wireless/ath/ath11k/wmi.h | 2 +- 7 files changed, 81 insertions(+), 81 deletions(-)
drivers/net/wireless/ath/ath11k/core.c +2 -2
@@ -629,7 +629,7 @@ static void ath11k_core_restart(struct work_struct *work)idr_destroy (&ar->txmgmt_idr); } -wake_up (&ab->wmi_sc.tx_credits_wq); +wake_up (&ab->wmi_ab.tx_credits_wq);wake_up (&ab->peer_mapping_wq); ret =ath11k_core_reconfigure_on_crash (ab);
@@ -739,7 +739,7 @@ struct ath11k_base *ath11k_core_alloc(struct device *dev)INIT_LIST_HEAD (&ab->peers);init_waitqueue_head (&ab->peer_mapping_wq); -init_waitqueue_head (&ab->wmi_sc.tx_credits_wq); +init_waitqueue_head (&ab->wmi_ab.tx_credits_wq);INIT_WORK (&ab->restart_work, ath11k_core_restart);timer_setup (&ab->rx_replenish_retry, ath11k_ce_rx_replenish_retry,0 ); ab->dev = dev;
drivers/net/wireless/ath/ath11k/core.h +1 -1
@@ -577,7 +577,7 @@ struct ath11k_base {struct platform_device *pdev;struct device *dev;struct ath11k_qmi qmi; -struct ath11k_wmi_base wmi_sc; +struct ath11k_wmi_base wmi_ab;struct completion fw_ready;struct rproc *tgt_rproc;int num_radios;
drivers/net/wireless/ath/ath11k/htc.c +1 -1
@@ -736,7 +736,7 @@ int ath11k_htc_init(struct ath11k_base *ab) htc->ab = ab; -switch (ab->wmi_sc.preferred_hw_mode) { +switch (ab->wmi_ab.preferred_hw_mode) {case WMI_HOST_HW_MODE_SINGLE : htc->wmi_ep_count =1 ;break ;
drivers/net/wireless/ath/ath11k/mac.c +2 -2
@@ -5245,7 +5245,7 @@ ath11k_mac_update_bss_chan_survey(struct ath11k *ar,lockdep_assert_held (&ar->conf_mutex); -if (!test_bit (WMI_TLV_SERVICE_BSS_CHANNEL_INFO_64 , ar->ab->wmi_sc.svc_map) || +if (!test_bit (WMI_TLV_SERVICE_BSS_CHANNEL_INFO_64 , ar->ab->wmi_ab.svc_map) || ar->rx_channel != channel)return ;
@@ -5713,7 +5713,7 @@ int ath11k_mac_create(struct ath11k_base *ab) ar->pdev_idx = i; ar->lmac_id =ath11k_core_get_hw_mac_id (ab, i); - ar->wmi = &ab->wmi_sc.wmi[i]; + ar->wmi = &ab->wmi_ab.wmi[i];/* FIXME wmi[0] is already initialized during attach, * Should we do this again? */
drivers/net/wireless/ath/ath11k/testmode.c +1 -1
@@ -150,7 +150,7 @@ static int ath11k_tm_cmd_wmi(struct ath11k *ar, struct nlattr *tb[])ath11k_dbg_dump (ar->ab,ATH11K_DBG_TESTMODE ,NULL ,"" , buf, buf_len); - skb =ath11k_wmi_alloc_skb (wmi->wmi_sc, buf_len); + skb =ath11k_wmi_alloc_skb (wmi->wmi_ab, buf_len);if (!skb) { ret = -ENOMEM ; goto out;
drivers/net/wireless/ath/ath11k/wmi.c +73 -73
541 lines not on this page · raw message
drivers/net/wireless/ath/ath11k/wmi.h +1 -1
@@ -2354,7 +2354,7 @@ struct wmi_service_available_event { } __packed;struct ath11k_pdev_wmi { -struct ath11k_wmi_base *wmi_sc; +struct ath11k_wmi_base *wmi_ab;enum ath11k_htc_ep_id eid;const struct wmi_peer_flags_map *peer_flags;u32 rx_decap_mode;
Signature · 7 lines
2.20.1 _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH v2 2/3 ath11k: add WMI calls to manually add/del/pause/resume TWT dialogs
These calls are used for debugging and will be required for WFA certification tests.
--- drivers/net/wireless/ath/ath11k/wmi.c | 218 ++++++++++++++++++++++++-- drivers/net/wireless/ath/ath11k/wmi.h | 114 ++++++++++++++ 2 files changed, 318 insertions(+), 14 deletions(-)
drivers/net/wireless/ath/ath11k/wmi.c +204 -14
@@ -97,6 +97,8 @@ static const struct wmi_tlv_policy wmi_tlv_policies[] = { = { .min_len = sizeof(struct wmi_stats_event) }, [WMI_TAG_PDEV_CTL_FAILSAFE_CHECK_EVENT ] = { .min_len = sizeof(struct wmi_pdev_ctl_failsafe_chk_event) }, + [WMI_TAG_TWT_ADD_DIALOG_COMPLETE_EVENT ] + = { .min_len = sizeof(struct wmi_twt_add_dialog_event) }, };#define PRIMAP (_hw_mode_) \
@@ -234,22 +236,22 @@ static int ath11k_wmi_cmd_send_nowait(struct ath11k_pdev_wmi *wmi, struct sk_bufint ath11k_wmi_cmd_send (struct ath11k_pdev_wmi *wmi,struct sk_buff *skb,u32 cmd_id) { -struct ath11k_wmi_base *wmi_sc = wmi->wmi_ab; +struct ath11k_wmi_base *wmi_ab = wmi->wmi_ab;int ret = -EOPNOTSUPP ;might_sleep (); -wait_event_timeout (wmi_sc->tx_credits_wq, ({ +wait_event_timeout (wmi_ab->tx_credits_wq, ({ ret =ath11k_wmi_cmd_send_nowait (wmi, skb, cmd_id); -if (ret &&test_bit (ATH11K_FLAG_CRASH_FLUSH , &wmi_sc->ab->dev_flags)) +if (ret &&test_bit (ATH11K_FLAG_CRASH_FLUSH , &wmi_ab->ab->dev_flags)) ret = -ESHUTDOWN ; (ret != -EAGAIN ); }),WMI_SEND_TIMEOUT_HZ );if (ret == -EAGAIN ) -ath11k_warn (wmi_sc->ab,"wmi command %d timeout\n" , cmd_id); +ath11k_warn (wmi_ab->ab,"wmi command %d timeout\n" , cmd_id);return ret; }
@@ -503,10 +505,10 @@ static int ath11k_service_ready_event(struct ath11k_base *ab, struct sk_buff *skreturn 0 ; } -struct sk_buff *ath11k_wmi_alloc_skb (struct ath11k_wmi_base *wmi_sc,u32 len) +struct sk_buff *ath11k_wmi_alloc_skb (struct ath11k_wmi_base *wmi_ab,u32 len) {struct sk_buff *skb; -struct ath11k_base *ab = wmi_sc->ab; +struct ath11k_base *ab = wmi_ab->ab;u32 round_len =roundup (len,4 ); skb =ath11k_htc_alloc_skb (ab,WMI_SKB_HEADROOM + round_len);
@@ -2580,6 +2582,157 @@ ath11k_wmi_send_twt_disable_cmd(struct ath11k *ar, u32 pdev_id)return ret; } +int +ath11k_wmi_send_twt_add_dialog_cmd (struct ath11k *ar, +struct wmi_twt_add_dialog_params *params) +{ +struct ath11k_pdev_wmi *wmi = ar->wmi; +struct ath11k_base *ab = wmi->wmi_ab->ab; +struct wmi_twt_add_dialog_params_cmd *cmd; +struct sk_buff *skb; +int ret, len; + + len =sizeof (*cmd); + + skb =ath11k_wmi_alloc_skb (wmi->wmi_ab, len); +if (!skb) +return -ENOMEM ; + + cmd = (void *)skb->data; + cmd->tlv_header =FIELD_PREP (WMI_TLV_TAG , +WMI_TAG_TWT_ADD_DIALOG_CMD ) | +FIELD_PREP (WMI_TLV_LEN , len -TLV_HDR_SIZE ); + + cmd->vdev_id = params->vdev_id; +ether_addr_copy (cmd->peer_macaddr.addr, params->peer_macaddr); + cmd->dialog_id = params->dialog_id; + cmd->wake_intvl_us = params->wake_intvl_us; + cmd->wake_intvl_mantis = params->wake_intvl_mantis; + cmd->wake_dura_us = params->wake_dura_us; + cmd->sp_offset_us = params->sp_offset_us; + cmd->flags = params->twt_cmd; +if (params->flag_bcast) + cmd->flags |=WMI_TWT_ADD_DIALOG_FLAG_BCAST ; +if (params->flag_trigger) + cmd->flags |=WMI_TWT_ADD_DIALOG_FLAG_TRIGGER ; +if (params->flag_flow_type) + cmd->flags |=WMI_TWT_ADD_DIALOG_FLAG_FLOW_TYPE ; +if (params->flag_protection) + cmd->flags |=WMI_TWT_ADD_DIALOG_FLAG_PROTECTION ; + + ret =ath11k_wmi_cmd_send (wmi, skb, +WMI_TWT_ADD_DIALOG_CMDID ); +if (ret) { +ath11k_warn (ab,"Failed to send WMI_TWT_ADD_DIALOG_CMDID" ); +dev_kfree_skb (skb); + } +return ret; +} + +int +ath11k_wmi_send_twt_del_dialog_cmd (struct ath11k *ar, +struct wmi_twt_del_dialog_params *params) +{ +struct ath11k_pdev_wmi *wmi = ar->wmi; +struct ath11k_base *ab = wmi->wmi_ab->ab; +struct wmi_twt_del_dialog_params_cmd *cmd; +struct sk_buff *skb; +int ret, len; + + len =sizeof (*cmd); + + skb =ath11k_wmi_alloc_skb (wmi->wmi_ab, len); +if (!skb) +return -ENOMEM ; + + cmd = (void *)skb->data; + cmd->tlv_header =FIELD_PREP (WMI_TLV_TAG , +WMI_TAG_TWT_DEL_DIALOG_CMD ) | +FIELD_PREP (WMI_TLV_LEN , len -TLV_HDR_SIZE ); + + cmd->vdev_id = params->vdev_id; +ether_addr_copy (cmd->peer_macaddr.addr, params->peer_macaddr); + cmd->dialog_id = params->dialog_id; + + ret =ath11k_wmi_cmd_send (wmi, skb, +WMI_TWT_DEL_DIALOG_CMDID ); +if (ret) { +ath11k_warn (ab,"Failed to send WMI_TWT_DEL_DIALOG_CMDID" ); +dev_kfree_skb (skb); + } +return ret; +} + +int +ath11k_wmi_send_twt_pause_dialog_cmd (struct ath11k *ar, +struct wmi_twt_pause_dialog_params *params) +{ +struct ath11k_pdev_wmi *wmi = ar->wmi; +struct ath11k_base *ab = wmi->wmi_ab->ab; +struct wmi_twt_pause_dialog_params_cmd *cmd; +struct sk_buff *skb; +int ret, len; + + len =sizeof (*cmd); + + skb =ath11k_wmi_alloc_skb (wmi->wmi_ab, len); +if (!skb) +return -ENOMEM ; + + cmd = (void *)skb->data; + cmd->tlv_header =FIELD_PREP (WMI_TLV_TAG , +WMI_TAG_TWT_PAUSE_DIALOG_CMD ) | +FIELD_PREP (WMI_TLV_LEN , len -TLV_HDR_SIZE ); + + cmd->vdev_id = params->vdev_id; +ether_addr_copy (cmd->peer_macaddr.addr, params->peer_macaddr); + cmd->dialog_id = params->dialog_id; + + ret =ath11k_wmi_cmd_send (wmi, skb, +WMI_TWT_PAUSE_DIALOG_CMDID ); +if (ret) { +ath11k_warn (ab,"Failed to send WMI_TWT_PAUSE_DIALOG_CMDID" ); +dev_kfree_skb (skb); + } +return ret; +} + +int +ath11k_wmi_send_twt_resume_dialog_cmd (struct ath11k *ar, +struct wmi_twt_resume_dialog_params *params) +{ +struct ath11k_pdev_wmi *wmi = ar->wmi; +struct ath11k_base *ab = wmi->wmi_ab->ab; +struct wmi_twt_resume_dialog_params_cmd *cmd; +struct sk_buff *skb; +int ret, len; + + len =sizeof (*cmd); + + skb =ath11k_wmi_alloc_skb (wmi->wmi_ab, len); +if (!skb) +return -ENOMEM ; + + cmd = (void *)skb->data; + cmd->tlv_header =FIELD_PREP (WMI_TLV_TAG , +WMI_TAG_TWT_RESUME_DIALOG_CMD ) | +FIELD_PREP (WMI_TLV_LEN , len -TLV_HDR_SIZE ); + + cmd->vdev_id = params->vdev_id; +ether_addr_copy (cmd->peer_macaddr.addr, params->peer_macaddr); + cmd->dialog_id = params->dialog_id; + cmd->sp_offset_us = params->sp_offset_us; + cmd->next_twt_size = params->next_twt_size; + + ret =ath11k_wmi_cmd_send (wmi, skb, +WMI_TWT_RESUME_DIALOG_CMDID ); +if (ret) { +ath11k_warn (ab,"Failed to send WMI_TWT_RESUME_DIALOG_CMDID" ); +dev_kfree_skb (skb); + } +return ret; +} +int ath11k_wmi_send_obss_spr_cmd (struct ath11k *ar,u32 vdev_id,struct ieee80211_he_obss_pd *he_obss_pd)
@@ -2851,7 +3004,7 @@ int ath11k_wmi_wait_for_unified_ready(struct ath11k_base *ab)int ath11k_wmi_cmd_init (struct ath11k_base *ab) { -struct ath11k_wmi_base *wmi_sc = &ab->wmi_ab; +struct ath11k_wmi_base *wmi_ab = &ab->wmi_ab;struct wmi_init_cmd_param init_param;struct target_resource_config config;
@@ -2903,21 +3056,21 @@ int ath11k_wmi_cmd_init(struct ath11k_base *ab) config.twt_ap_pdev_count =2 ; config.twt_ap_sta_count =1000 ; -memcpy (&wmi_sc->wlan_resource_config, &config,sizeof (config)); +memcpy (&wmi_ab->wlan_resource_config, &config,sizeof (config)); - init_param.res_cfg = &wmi_sc->wlan_resource_config; - init_param.num_mem_chunks = wmi_sc->num_mem_chunks; - init_param.hw_mode_id = wmi_sc->preferred_hw_mode; - init_param.mem_chunks = wmi_sc->mem_chunks; + init_param.res_cfg = &wmi_ab->wlan_resource_config; + init_param.num_mem_chunks = wmi_ab->num_mem_chunks; + init_param.hw_mode_id = wmi_ab->preferred_hw_mode; + init_param.mem_chunks = wmi_ab->mem_chunks; -if (wmi_sc->preferred_hw_mode ==WMI_HOST_HW_MODE_SINGLE ) +if (wmi_ab->preferred_hw_mode ==WMI_HOST_HW_MODE_SINGLE ) init_param.hw_mode_id =WMI_HOST_HW_MODE_MAX ; init_param.num_band_to_mac = ab->num_radios;ath11k_fill_band_to_mac_param (ab, init_param.band_to_mac); -return ath11k_init_cmd_send (&wmi_sc->wmi[0 ], &init_param); +return ath11k_init_cmd_send (&wmi_ab->wmi[0 ], &init_param); } static int ath11k_wmi_tlv_hw_mode_caps_parse(struct ath11k_base *soc,
@@ -5511,6 +5664,37 @@ ath11k_wmi_pdev_dfs_radar_detected_event(struct ath11k_base *ab, struct sk_buffkfree (tb); } +static void ath11k_wmi_twt_add_dialog_event (struct ath11k_base *ab,struct sk_buff *skb) +{ +const char *status[] = { +"OK" ,"TWT_NOT_ENABLED" ,"USED_DIALOG_ID" ,"INVALID_PARAM" , +"NOT_READY" ,"NO_RESOURCE" ,"NO_ACK" ,"NO_RESPONSE" , +"DENIED" ,"UNKNOWN_ERROR" + }; +const void **tb; +const struct wmi_twt_add_dialog_event *ev; +int ret; + + tb =ath11k_wmi_tlv_parse_alloc (ab, skb->data, skb->len,GFP_ATOMIC ); +if (IS_ERR (tb)) { + ret =PTR_ERR (tb); +ath11k_warn (ab,"failed to parse tlv: %d\n" , ret); +return ; + } + + ev = tb[WMI_TAG_TWT_ADD_DIALOG_COMPLETE_EVENT ]; +if (!ev) { +ath11k_warn (ab,"failed to fetch twt add dialog ev" ); + goto exit; + } + +ath11k_info (ab,"TWT Add Dialog Event - Status: %s, DialogId: %d, VdevId: %d\n" , + status[ev->status], ev->vdev_id, ev->dialog_id); + +exit: +kfree (tb); +} +static void ath11k_wmi_tlv_op_rx (struct ath11k_base *ab,struct sk_buff *skb) {struct wmi_cmd_hdr *cmd_hdr;
@@ -5588,12 +5772,18 @@ static void ath11k_wmi_tlv_op_rx(struct ath11k_base *ab, struct sk_buff *skb)case WMI_PDEV_CSA_SWITCH_COUNT_STATUS_EVENTID :ath11k_wmi_pdev_csa_switch_count_status_event (ab, skb);break ; +case WMI_TWT_ADD_DIALOG_EVENTID : +ath11k_wmi_twt_add_dialog_event (ab, skb); +break ;/* add Unsupported events here */ case WMI_TBTTOFFSET_EXT_UPDATE_EVENTID :case WMI_VDEV_DELETE_RESP_EVENTID :case WMI_PEER_OPER_MODE_CHANGE_EVENTID :case WMI_TWT_ENABLE_EVENTID :case WMI_TWT_DISABLE_EVENTID : +case WMI_TWT_DEL_DIALOG_EVENTID : +case WMI_TWT_PAUSE_DIALOG_EVENTID : +case WMI_TWT_RESUME_DIALOG_EVENTID :ath11k_dbg (ab,ATH11K_DBG_WMI ,"ignoring unsupported event 0x%x\n" , id);break ;
drivers/net/wireless/ath/ath11k/wmi.h +114 -0
126 lines not on this page · raw message
Signature · 7 lines
2.20.1 _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH v2 3/3 ath11k: add debugfs for TWT debug calls
In reply to John CrispinThese new debugfs files allow us to manually add/del/pause/resume TWT dialogs for test/debug purposes.
--- drivers/net/wireless/ath/ath11k/core.h | 1 + drivers/net/wireless/ath/ath11k/debug.c | 197 ++++++++++++++++++++++++ drivers/net/wireless/ath/ath11k/debug.h | 8 + drivers/net/wireless/ath/ath11k/mac.c | 4 + 4 files changed, 210 insertions(+)
drivers/net/wireless/ath/ath11k/core.h +1 -0
@@ -216,6 +216,7 @@ struct ath11k_vif {int num_legacy_stations;int rtscts_prot_mode;int txpower; +struct dentry *debugfs_twt; };struct ath11k_vif_iter {
drivers/net/wireless/ath/ath11k/debug.c +197 -0
203 lines not on this page · raw message
drivers/net/wireless/ath/ath11k/debug.h +8 -0
@@ -133,6 +133,14 @@ static inline void ath11k_dbg_dump(struct ath11k_base *ab, }#endif /* CONFIG_ATH11K_DEBUG */ +#ifdef CONFIG_MAC80211_DEBUGFS +void ath11k_debugfs_twt (struct ath11k_vif *arvif,bool enable); +#else +static inline void ath11k_debugfs_twt (struct ath11k_vif *arvif,bool enable) +{ +} +#endif +#ifdef CONFIG_ATH11K_DEBUGFS int ath11k_debug_soc_create (struct ath11k_base *ab);void ath11k_debug_soc_destroy (struct ath11k_base *ab);
drivers/net/wireless/ath/ath11k/mac.c +4 -0
@@ -1920,6 +1920,8 @@ static void ath11k_mac_op_bss_info_changed(struct ieee80211_hw *hw,ath11k_wmi_send_twt_enable_cmd (ar, ar->pdev_idx); else ath11k_wmi_send_twt_disable_cmd(ar, ar->pdev_idx); +if (vif->type ==NL80211_IFTYPE_AP ) +ath11k_debugfs_twt (arvif, info->twt_requester); }if (changed &BSS_CHANGED_HE_OBSS_PD )
@@ -4217,6 +4219,8 @@ static void ath11k_mac_op_remove_interface(struct ieee80211_hw *hw,/* TODO: recal traffic pause state based on the available vdevs */ +debugfs_remove_recursive (arvif->debugfs_twt); + arvif->debugfs_twt =NULL ;mutex_unlock (&ar->conf_mutex); }
Signature · 7 lines
2.20.1 _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
Quoted 3 lines · John Crispin
This makes the code consistent with the recent sc to ab rename.
Signed-off-by John Crispin <[email protected]>
Failed to apply, please rebase.
error: patch failed: drivers/net/wireless/ath/ath11k/wmi.c:2479
error: drivers/net/wireless/ath/ath11k/wmi.c: patch does not apply stg import: Diff does not apply cleanly
3 patches set to Changes Requested.
11254749 [V2,1/3] ath11k: rename ath11k_wmi_base instances from wmi_sc to wmi_ab 11254745 [V2,2/3] ath11k: add WMI calls to manually add/del/pause/resume TWT dialogs 11254743 [V2,3/3] ath11k: add debugfs for TWT debug calls
Signature · 9 lines
https://patchwork.kernel.org/patch/11254749/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k