Skip to content

Commit

Permalink
Merge tag 'ath-next-20240812' of git://git.kernel.org/pub/scm/linux/k…
Browse files Browse the repository at this point in the history
…ernel/git/ath/ath

ath.git patches for v6.12

This is a fairly light pull request since ath12k is still working on
MLO-related changes, and the other drivers are mostly in maintenance
mode with a few cleanups and bug fixes.

Major changes:

ath12k

* DebugFS support for transmit DE stats
* Make ASPM support hardware-dependent
* Align BSS Channel information command and message with firmware

ath11k

* Use work queue for beacon tx events

ath9k

* Use devm for gpio_request_one
* Use unmanaged PCI functions in ath9k_pci_owl_loader()
  • Loading branch information
Kalle Valo committed Aug 13, 2024
2 parents 748e21d + 89fbe67 commit ae98f5c
Show file tree
Hide file tree
Showing 18 changed files with 521 additions and 28 deletions.
1 change: 1 addition & 0 deletions drivers/net/wireless/ath/ath11k/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@ struct ath11k_vif {
u8 bssid[ETH_ALEN];
struct cfg80211_bitrate_mask bitrate_mask;
struct delayed_work connection_loss_work;
struct work_struct bcn_tx_work;
int num_legacy_stations;
int rtscts_prot_mode;
int txpower;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/ath/ath11k/dp_rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -2697,7 +2697,7 @@ int ath11k_dp_process_rx(struct ath11k_base *ab, int ring_id,
if (unlikely(push_reason !=
HAL_REO_DEST_RING_PUSH_REASON_ROUTING_INSTRUCTION)) {
dev_kfree_skb_any(msdu);
ab->soc_stats.hal_reo_error[dp->reo_dst_ring[ring_id].ring_id]++;
ab->soc_stats.hal_reo_error[ring_id]++;
continue;
}

Expand Down
12 changes: 12 additions & 0 deletions drivers/net/wireless/ath/ath11k/mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -6599,6 +6599,16 @@ static int ath11k_mac_vdev_delete(struct ath11k *ar, struct ath11k_vif *arvif)
return ret;
}

static void ath11k_mac_bcn_tx_work(struct work_struct *work)
{
struct ath11k_vif *arvif = container_of(work, struct ath11k_vif,
bcn_tx_work);

mutex_lock(&arvif->ar->conf_mutex);
ath11k_mac_bcn_tx_event(arvif);
mutex_unlock(&arvif->ar->conf_mutex);
}

static int ath11k_mac_op_add_interface(struct ieee80211_hw *hw,
struct ieee80211_vif *vif)
{
Expand Down Expand Up @@ -6637,6 +6647,7 @@ static int ath11k_mac_op_add_interface(struct ieee80211_hw *hw,
arvif->vif = vif;

INIT_LIST_HEAD(&arvif->list);
INIT_WORK(&arvif->bcn_tx_work, ath11k_mac_bcn_tx_work);
INIT_DELAYED_WORK(&arvif->connection_loss_work,
ath11k_mac_vif_sta_connection_loss_work);

Expand Down Expand Up @@ -6879,6 +6890,7 @@ static void ath11k_mac_op_remove_interface(struct ieee80211_hw *hw,
int i;

cancel_delayed_work_sync(&arvif->connection_loss_work);
cancel_work_sync(&arvif->bcn_tx_work);

mutex_lock(&ar->conf_mutex);

Expand Down
4 changes: 3 additions & 1 deletion drivers/net/wireless/ath/ath11k/wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -7404,7 +7404,9 @@ static void ath11k_bcn_tx_status_event(struct ath11k_base *ab, struct sk_buff *s
rcu_read_unlock();
return;
}
ath11k_mac_bcn_tx_event(arvif);

queue_work(ab->workqueue, &arvif->bcn_tx_work);

rcu_read_unlock();
}

Expand Down
354 changes: 354 additions & 0 deletions drivers/net/wireless/ath/ath12k/debugfs_htt_stats.c

Large diffs are not rendered by default.

126 changes: 126 additions & 0 deletions drivers/net/wireless/ath/ath12k/debugfs_htt_stats.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ enum ath12k_dbg_htt_ext_stats_type {
ATH12K_DBG_HTT_EXT_STATS_PDEV_TX_SCHED = 4,
ATH12K_DBG_HTT_EXT_STATS_PDEV_ERROR = 5,
ATH12K_DBG_HTT_EXT_STATS_PDEV_TQM = 6,
ATH12K_DBG_HTT_EXT_STATS_TX_DE_INFO = 8,

/* keep this last */
ATH12K_DBG_HTT_NUM_EXT_STATS,
Expand All @@ -143,13 +144,21 @@ enum ath12k_dbg_htt_tlv_tag {
HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG = 13,
HTT_STATS_TX_TQM_CMN_TAG = 14,
HTT_STATS_TX_TQM_PDEV_TAG = 15,
HTT_STATS_TX_DE_EAPOL_PACKETS_TAG = 17,
HTT_STATS_TX_DE_CLASSIFY_FAILED_TAG = 18,
HTT_STATS_TX_DE_CLASSIFY_STATS_TAG = 19,
HTT_STATS_TX_DE_CLASSIFY_STATUS_TAG = 20,
HTT_STATS_TX_DE_ENQUEUE_PACKETS_TAG = 21,
HTT_STATS_TX_DE_ENQUEUE_DISCARD_TAG = 22,
HTT_STATS_TX_DE_CMN_TAG = 23,
HTT_STATS_TX_PDEV_SCHEDULER_TXQ_STATS_TAG = 36,
HTT_STATS_TX_SCHED_CMN_TAG = 37,
HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG = 39,
HTT_STATS_TX_TQM_ERROR_STATS_TAG = 43,
HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG = 44,
HTT_STATS_HW_INTR_MISC_TAG = 54,
HTT_STATS_HW_PDEV_ERRS_TAG = 56,
HTT_STATS_TX_DE_COMPL_STATS_TAG = 65,
HTT_STATS_WHAL_TX_TAG = 66,
HTT_STATS_TX_PDEV_SIFS_HIST_TAG = 67,
HTT_STATS_SCHED_TXQ_SCHED_ORDER_SU_TAG = 86,
Expand Down Expand Up @@ -564,4 +573,121 @@ struct ath12k_htt_tx_tqm_pdev_stats_tlv {
__le32 sched_nonudp_notify2;
} __packed;

struct ath12k_htt_tx_de_cmn_stats_tlv {
__le32 mac_id__word;
__le32 tcl2fw_entry_count;
__le32 not_to_fw;
__le32 invalid_pdev_vdev_peer;
__le32 tcl_res_invalid_addrx;
__le32 wbm2fw_entry_count;
__le32 invalid_pdev;
__le32 tcl_res_addrx_timeout;
__le32 invalid_vdev;
__le32 invalid_tcl_exp_frame_desc;
__le32 vdev_id_mismatch_cnt;
} __packed;

struct ath12k_htt_tx_de_eapol_packets_stats_tlv {
__le32 m1_packets;
__le32 m2_packets;
__le32 m3_packets;
__le32 m4_packets;
__le32 g1_packets;
__le32 g2_packets;
__le32 rc4_packets;
__le32 eap_packets;
__le32 eapol_start_packets;
__le32 eapol_logoff_packets;
__le32 eapol_encap_asf_packets;
} __packed;

struct ath12k_htt_tx_de_classify_stats_tlv {
__le32 arp_packets;
__le32 igmp_packets;
__le32 dhcp_packets;
__le32 host_inspected;
__le32 htt_included;
__le32 htt_valid_mcs;
__le32 htt_valid_nss;
__le32 htt_valid_preamble_type;
__le32 htt_valid_chainmask;
__le32 htt_valid_guard_interval;
__le32 htt_valid_retries;
__le32 htt_valid_bw_info;
__le32 htt_valid_power;
__le32 htt_valid_key_flags;
__le32 htt_valid_no_encryption;
__le32 fse_entry_count;
__le32 fse_priority_be;
__le32 fse_priority_high;
__le32 fse_priority_low;
__le32 fse_traffic_ptrn_be;
__le32 fse_traffic_ptrn_over_sub;
__le32 fse_traffic_ptrn_bursty;
__le32 fse_traffic_ptrn_interactive;
__le32 fse_traffic_ptrn_periodic;
__le32 fse_hwqueue_alloc;
__le32 fse_hwqueue_created;
__le32 fse_hwqueue_send_to_host;
__le32 mcast_entry;
__le32 bcast_entry;
__le32 htt_update_peer_cache;
__le32 htt_learning_frame;
__le32 fse_invalid_peer;
__le32 mec_notify;
} __packed;

struct ath12k_htt_tx_de_classify_failed_stats_tlv {
__le32 ap_bss_peer_not_found;
__le32 ap_bcast_mcast_no_peer;
__le32 sta_delete_in_progress;
__le32 ibss_no_bss_peer;
__le32 invalid_vdev_type;
__le32 invalid_ast_peer_entry;
__le32 peer_entry_invalid;
__le32 ethertype_not_ip;
__le32 eapol_lookup_failed;
__le32 qpeer_not_allow_data;
__le32 fse_tid_override;
__le32 ipv6_jumbogram_zero_length;
__le32 qos_to_non_qos_in_prog;
__le32 ap_bcast_mcast_eapol;
__le32 unicast_on_ap_bss_peer;
__le32 ap_vdev_invalid;
__le32 incomplete_llc;
__le32 eapol_duplicate_m3;
__le32 eapol_duplicate_m4;
} __packed;

struct ath12k_htt_tx_de_classify_status_stats_tlv {
__le32 eok;
__le32 classify_done;
__le32 lookup_failed;
__le32 send_host_dhcp;
__le32 send_host_mcast;
__le32 send_host_unknown_dest;
__le32 send_host;
__le32 status_invalid;
} __packed;

struct ath12k_htt_tx_de_enqueue_packets_stats_tlv {
__le32 enqueued_pkts;
__le32 to_tqm;
__le32 to_tqm_bypass;
} __packed;

struct ath12k_htt_tx_de_enqueue_discard_stats_tlv {
__le32 discarded_pkts;
__le32 local_frames;
__le32 is_ext_msdu;
} __packed;

struct ath12k_htt_tx_de_compl_stats_tlv {
__le32 tcl_dummy_frame;
__le32 tqm_dummy_frame;
__le32 tqm_notify_frame;
__le32 fw2wbm_enq;
__le32 tqm_bypass_frame;
} __packed;

#endif
2 changes: 1 addition & 1 deletion drivers/net/wireless/ath/ath12k/dp_rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -2681,7 +2681,7 @@ int ath12k_dp_rx_process(struct ath12k_base *ab, int ring_id,
if (push_reason !=
HAL_REO_DEST_RING_PUSH_REASON_ROUTING_INSTRUCTION) {
dev_kfree_skb_any(msdu);
ab->soc_stats.hal_reo_error[dp->reo_dst_ring[ring_id].ring_id]++;
ab->soc_stats.hal_reo_error[ring_id]++;
continue;
}

Expand Down
6 changes: 6 additions & 0 deletions drivers/net/wireless/ath/ath12k/hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -924,6 +924,8 @@ static const struct ath12k_hw_params ath12k_hw_params[] = {

.acpi_guid = NULL,
.supports_dynamic_smps_6ghz = true,

.supports_aspm = false,
},
{
.name = "wcn7850 hw2.0",
Expand Down Expand Up @@ -1000,6 +1002,8 @@ static const struct ath12k_hw_params ath12k_hw_params[] = {

.acpi_guid = &wcn7850_uuid,
.supports_dynamic_smps_6ghz = false,

.supports_aspm = true,
},
{
.name = "qcn9274 hw2.0",
Expand Down Expand Up @@ -1072,6 +1076,8 @@ static const struct ath12k_hw_params ath12k_hw_params[] = {

.acpi_guid = NULL,
.supports_dynamic_smps_6ghz = true,

.supports_aspm = false,
},
};

Expand Down
1 change: 1 addition & 0 deletions drivers/net/wireless/ath/ath12k/hw.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ struct ath12k_hw_params {
bool tcl_ring_retry:1;
bool reoq_lut_support:1;
bool supports_shadow_regs:1;
bool supports_aspm:1;

u32 num_tcl_banks;
u32 max_tx_ring;
Expand Down
5 changes: 2 additions & 3 deletions drivers/net/wireless/ath/ath12k/mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -2196,9 +2196,8 @@ static void ath12k_peer_assoc_h_he(struct ath12k *ar,
* request, then use MAX_AMPDU_LEN_FACTOR as 16 to calculate max_ampdu
* length.
*/
ampdu_factor = (he_cap->he_cap_elem.mac_cap_info[3] &
IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_MASK) >>
IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_MASK;
ampdu_factor = u8_get_bits(he_cap->he_cap_elem.mac_cap_info[3],
IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_MASK);

if (ampdu_factor) {
if (sta->deflink.vht_cap.vht_supported)
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/wireless/ath/ath12k/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,8 @@ static void ath12k_pci_update_qrtr_node_id(struct ath12k_base *ab)

static void ath12k_pci_aspm_restore(struct ath12k_pci *ab_pci)
{
if (test_and_clear_bit(ATH12K_PCI_ASPM_RESTORE, &ab_pci->flags))
if (ab_pci->ab->hw_params->supports_aspm &&
test_and_clear_bit(ATH12K_PCI_ASPM_RESTORE, &ab_pci->flags))
pcie_capability_clear_and_set_word(ab_pci->pdev, PCI_EXP_LNKCTL,
PCI_EXP_LNKCTL_ASPMC,
ab_pci->link_ctl &
Expand Down
1 change: 1 addition & 0 deletions drivers/net/wireless/ath/ath12k/wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1538,6 +1538,7 @@ int ath12k_wmi_pdev_bss_chan_info_request(struct ath12k *ar,
cmd->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_PDEV_BSS_CHAN_INFO_REQUEST,
sizeof(*cmd));
cmd->req_type = cpu_to_le32(type);
cmd->pdev_id = cpu_to_le32(ar->pdev->pdev_id);

ath12k_dbg(ar->ab, ATH12K_DBG_WMI,
"WMI bss chan info req type %d\n", type);
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/wireless/ath/ath12k/wmi.h
Original file line number Diff line number Diff line change
Expand Up @@ -3121,6 +3121,7 @@ struct wmi_pdev_bss_chan_info_req_cmd {
__le32 tlv_header;
/* ref wmi_bss_chan_info_req_type */
__le32 req_type;
__le32 pdev_id;
} __packed;

struct wmi_ap_ps_peer_cmd {
Expand Down Expand Up @@ -4085,7 +4086,6 @@ struct wmi_vdev_stopped_event {
} __packed;

struct wmi_pdev_bss_chan_info_event {
__le32 pdev_id;
__le32 freq; /* Units in MHz */
__le32 noise_floor; /* units are dBm */
/* rx clear - how often the channel was unused */
Expand All @@ -4103,6 +4103,7 @@ struct wmi_pdev_bss_chan_info_event {
/*rx_cycle cnt for my bss in 64bits format */
__le32 rx_bss_cycle_count_low;
__le32 rx_bss_cycle_count_high;
__le32 pdev_id;
} __packed;

#define WMI_VDEV_INSTALL_KEY_COMPL_STATUS_SUCCESS 0
Expand Down
8 changes: 3 additions & 5 deletions drivers/net/wireless/ath/ath9k/ath9k_pci_owl_loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ static int ath9k_pci_fixup(struct pci_dev *pdev, const u16 *cal_data,

dev_info(&pdev->dev, "fixup device configuration\n");

mem = pcim_iomap(pdev, 0, 0);
mem = pci_iomap(pdev, 0, 0);
if (!mem) {
dev_err(&pdev->dev, "ioremap error\n");
return -EINVAL;
Expand Down Expand Up @@ -103,7 +103,7 @@ static int ath9k_pci_fixup(struct pci_dev *pdev, const u16 *cal_data,
pci_write_config_word(pdev, PCI_COMMAND, cmd);

pci_write_config_dword(pdev, PCI_BASE_ADDRESS_0, bar0);
pcim_iounmap(pdev, mem);
pci_iounmap(pdev, mem);

pci_disable_device(pdev);

Expand Down Expand Up @@ -200,11 +200,9 @@ static int owl_probe(struct pci_dev *pdev,
const char *eeprom_name;
int err = 0;

if (pcim_enable_device(pdev))
if (pci_enable_device(pdev))
return -EIO;

pcim_pin_device(pdev);

ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL);
if (!ctx)
return -ENOMEM;
Expand Down
7 changes: 2 additions & 5 deletions drivers/net/wireless/ath/ath9k/calib.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,8 @@ static int16_t ath9k_hw_get_nf_hist_mid(int16_t *nfCalBuffer)

for (i = 0; i < ATH9K_NF_CAL_HIST_MAX - 1; i++) {
for (j = 1; j < ATH9K_NF_CAL_HIST_MAX - i; j++) {
if (sort[j] > sort[j - 1]) {
nfval = sort[j];
sort[j] = sort[j - 1];
sort[j - 1] = nfval;
}
if (sort[j] > sort[j - 1])
swap(sort[j], sort[j - 1]);
}
}
nfval = sort[(ATH9K_NF_CAL_HIST_MAX - 1) >> 1];
Expand Down
6 changes: 2 additions & 4 deletions drivers/net/wireless/ath/ath9k/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -1325,11 +1325,11 @@ void ath9k_get_et_stats(struct ieee80211_hw *hw,
struct ath_softc *sc = hw->priv;
int i = 0;

data[i++] = (sc->debug.stats.txstats[PR_QNUM(IEEE80211_AC_BE)].tx_pkts_all +
data[i++] = ((u64)sc->debug.stats.txstats[PR_QNUM(IEEE80211_AC_BE)].tx_pkts_all +
sc->debug.stats.txstats[PR_QNUM(IEEE80211_AC_BK)].tx_pkts_all +
sc->debug.stats.txstats[PR_QNUM(IEEE80211_AC_VI)].tx_pkts_all +
sc->debug.stats.txstats[PR_QNUM(IEEE80211_AC_VO)].tx_pkts_all);
data[i++] = (sc->debug.stats.txstats[PR_QNUM(IEEE80211_AC_BE)].tx_bytes_all +
data[i++] = ((u64)sc->debug.stats.txstats[PR_QNUM(IEEE80211_AC_BE)].tx_bytes_all +
sc->debug.stats.txstats[PR_QNUM(IEEE80211_AC_BK)].tx_bytes_all +
sc->debug.stats.txstats[PR_QNUM(IEEE80211_AC_VI)].tx_bytes_all +
sc->debug.stats.txstats[PR_QNUM(IEEE80211_AC_VO)].tx_bytes_all);
Expand Down Expand Up @@ -1380,8 +1380,6 @@ int ath9k_init_debug(struct ath_hw *ah)

sc->debug.debugfs_phy = debugfs_create_dir("ath9k",
sc->hw->wiphy->debugfsdir);
if (IS_ERR(sc->debug.debugfs_phy))
return -ENOMEM;

#ifdef CONFIG_ATH_DEBUG
debugfs_create_file("debug", 0600, sc->debug.debugfs_phy,
Expand Down
2 changes: 0 additions & 2 deletions drivers/net/wireless/ath/ath9k/htc_drv_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -486,8 +486,6 @@ int ath9k_htc_init_debug(struct ath_hw *ah)

priv->debug.debugfs_phy = debugfs_create_dir(KBUILD_MODNAME,
priv->hw->wiphy->debugfsdir);
if (IS_ERR(priv->debug.debugfs_phy))
return -ENOMEM;

ath9k_cmn_spectral_init_debug(&priv->spec_priv, priv->debug.debugfs_phy);

Expand Down
Loading

0 comments on commit ae98f5c

Please sign in to comment.