Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions drivers/net/wireless/ath/ath12k/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2296,6 +2296,7 @@ void ath12k_core_deinit(struct ath12k_base *ab)
void ath12k_core_free(struct ath12k_base *ab)
{
timer_delete_sync(&ab->rx_replenish_retry);
ath12k_wmi_free();
destroy_workqueue(ab->workqueue_aux);
destroy_workqueue(ab->workqueue);
kfree(ab);
Expand All @@ -2320,6 +2321,9 @@ struct ath12k_base *ath12k_core_alloc(struct device *dev, size_t priv_size,
if (!ab->workqueue_aux)
goto err_free_wq;

if (ath12k_wmi_alloc() < 0)
goto err_free_wq_aux;

mutex_init(&ab->core_lock);
spin_lock_init(&ab->base_lock);
init_completion(&ab->reset_complete);
Expand Down Expand Up @@ -2354,6 +2358,8 @@ struct ath12k_base *ath12k_core_alloc(struct device *dev, size_t priv_size,

return ab;

err_free_wq_aux:
destroy_workqueue(ab->workqueue_aux);
err_free_wq:
destroy_workqueue(ab->workqueue);
err_sc_free:
Expand Down
10 changes: 5 additions & 5 deletions drivers/net/wireless/ath/ath12k/dp.c
Original file line number Diff line number Diff line change
Expand Up @@ -946,11 +946,11 @@ void ath12k_dp_vdev_tx_attach(struct ath12k *ar, struct ath12k_link_vif *arvif)

dp_link_vif = ath12k_dp_vif_to_dp_link_vif(&ahvif->dp_vif, link_id);

dp_link_vif->tcl_metadata |= u32_encode_bits(1, HTT_TCL_META_DATA_TYPE) |
u32_encode_bits(arvif->vdev_id,
HTT_TCL_META_DATA_VDEV_ID) |
u32_encode_bits(ar->pdev->pdev_id,
HTT_TCL_META_DATA_PDEV_ID);
dp_link_vif->tcl_metadata = u32_encode_bits(1, HTT_TCL_META_DATA_TYPE) |
u32_encode_bits(arvif->vdev_id,
HTT_TCL_META_DATA_VDEV_ID) |
u32_encode_bits(ar->pdev->pdev_id,
HTT_TCL_META_DATA_PDEV_ID);

/* set HTT extension valid bit to 0 by default */
dp_link_vif->tcl_metadata &= ~HTT_TCL_META_DATA_VALID_HTT;
Expand Down
7 changes: 0 additions & 7 deletions drivers/net/wireless/ath/ath12k/dp.h
Original file line number Diff line number Diff line change
Expand Up @@ -338,13 +338,6 @@ struct ath12k_rx_desc_info {
u8 in_use : 1,
device_id : 3,
reserved : 4;
struct {
__le32 info0;
__le32 peer_meta_data;
} rx_mpdu_info;
struct {
__le32 info0;
} rx_msdu_info;
};

struct ath12k_tx_desc_info {
Expand Down
6 changes: 2 additions & 4 deletions drivers/net/wireless/ath/ath12k/dp_mon.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,14 @@ ath12k_dp_mon_fill_rx_rate(struct ath12k_pdev_dp *dp_pdev,
bool is_cck;

pkt_type = ppdu_info->preamble_type;
rate_mcs = ppdu_info->rate;
rate_mcs = ppdu_info->mcs;
nss = ppdu_info->nss;
sgi = ppdu_info->gi;

switch (pkt_type) {
case RX_MSDU_START_PKT_TYPE_11A:
case RX_MSDU_START_PKT_TYPE_11B:
rate_mcs = ppdu_info->rate;
is_cck = (pkt_type == RX_MSDU_START_PKT_TYPE_11B);
if (rx_status->band < NUM_NL80211_BANDS) {
struct ath12k *ar = ath12k_pdev_dp_to_ar(dp_pdev);
Expand Down Expand Up @@ -471,13 +472,10 @@ void ath12k_dp_mon_update_radiotap(struct ath12k_pdev_dp *dp_pdev,
rxs->encoding = RX_ENC_HE;
ptr = skb_push(mon_skb, sizeof(struct ieee80211_radiotap_he));
ath12k_dp_mon_rx_update_radiotap_he(ppduinfo, ptr);
rxs->rate_idx = ppduinfo->rate;
} else if (ppduinfo->vht_flags) {
rxs->encoding = RX_ENC_VHT;
rxs->rate_idx = ppduinfo->rate;
} else if (ppduinfo->ht_flags) {
rxs->encoding = RX_ENC_HT;
rxs->rate_idx = ppduinfo->rate;
} else {
struct ath12k *ar;

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/ath/ath12k/dp_peer.c
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ struct ath12k_dp_peer *ath12k_dp_peer_find_by_peerid(struct ath12k_pdev_dp *dp_p
RCU_LOCKDEP_WARN(!rcu_read_lock_held(),
"ath12k dp peer find by peerid index called without rcu lock");

if (!peer_id || peer_id >= ATH12K_DP_PEER_ID_INVALID)
if (peer_id >= ATH12K_DP_PEER_ID_INVALID)
return NULL;

index = ath12k_dp_peer_get_peerid_index(dp, peer_id);
Expand Down
3 changes: 1 addition & 2 deletions drivers/net/wireless/ath/ath12k/dp_rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1205,8 +1205,7 @@ ath12k_dp_rx_h_find_link_peer(struct ath12k_pdev_dp *dp_pdev, struct sk_buff *ms

lockdep_assert_held(&dp->dp_lock);

if (rxcb->peer_id)
peer = ath12k_dp_link_peer_find_by_peerid(dp_pdev, rxcb->peer_id);
peer = ath12k_dp_link_peer_find_by_peerid(dp_pdev, rxcb->peer_id);

if (peer)
return peer;
Expand Down
11 changes: 0 additions & 11 deletions drivers/net/wireless/ath/ath12k/dp_rx.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,6 @@ struct ath12k_dp_rx_rfc1042_hdr {
__be16 snap_type;
} __packed;

struct ath12k_dp_rx_proc_ctx {
int device_id;
struct ath12k_dp *dp;
struct ath12k_dp *partner_dp;
int ring_id;
int hw_link_id;
struct sk_buff_head *msdu_list;
int *num_buffs_reaped;
int *total_msdu_reaped;
};

static inline u32 ath12k_he_gi_to_nl80211_he_gi(u8 sgi)
{
u32 ret = 0;
Expand Down
36 changes: 0 additions & 36 deletions drivers/net/wireless/ath/ath12k/hal.c
Original file line number Diff line number Diff line change
Expand Up @@ -326,34 +326,6 @@ void *ath12k_hal_srng_dst_peek(struct ath12k_base *ab, struct hal_srng *srng)
}
EXPORT_SYMBOL(ath12k_hal_srng_dst_peek);

u32 ath12k_hal_srng_dst_get_curr_tp(struct hal_srng *srng)
{
lockdep_assert_held(&srng->lock);

return srng->u.dst_ring.tp;
}
EXPORT_SYMBOL(ath12k_hal_srng_dst_get_curr_tp);

void *ath12k_hal_srng_dst_ring_get_and_update_tp(struct hal_srng *srng, u32 *updated_tp)
{
void *desc;

lockdep_assert_held(&srng->lock);

if (srng->u.dst_ring.tp == srng->u.dst_ring.cached_hp)
return NULL;

desc = srng->ring_base_vaddr + srng->u.dst_ring.tp;

srng->u.dst_ring.tp = (srng->u.dst_ring.tp + srng->entry_size) %
srng->ring_size;
if (updated_tp)
*updated_tp = srng->u.dst_ring.tp;

return desc;
}
EXPORT_SYMBOL(ath12k_hal_srng_dst_ring_get_and_update_tp);

void *ath12k_hal_srng_dst_get_next_entry(struct ath12k_base *ab,
struct hal_srng *srng)
{
Expand Down Expand Up @@ -521,14 +493,6 @@ void *ath12k_hal_srng_src_get_next_reaped(struct ath12k_base *ab,
return desc;
}

void ath12k_hal_srng_update_tp(struct hal_srng *srng, u32 new_tp)
{
lockdep_assert_held(&srng->lock);

srng->u.dst_ring.tp = new_tp;
}
EXPORT_SYMBOL(ath12k_hal_srng_update_tp);

void ath12k_hal_srng_access_begin(struct ath12k_base *ab, struct hal_srng *srng)
{
u32 hp;
Expand Down
3 changes: 0 additions & 3 deletions drivers/net/wireless/ath/ath12k/hal.h
Original file line number Diff line number Diff line change
Expand Up @@ -1483,8 +1483,6 @@ int ath12k_hal_srng_get_entrysize(struct ath12k_base *ab, u32 ring_type);
int ath12k_hal_srng_get_max_entries(struct ath12k_base *ab, u32 ring_type);
void ath12k_hal_srng_get_params(struct ath12k_base *ab, struct hal_srng *srng,
struct hal_srng_params *params);
u32 ath12k_hal_srng_dst_get_curr_tp(struct hal_srng *srng);
void *ath12k_hal_srng_dst_ring_get_and_update_tp(struct hal_srng *srng, u32 *updated_tp);
void *ath12k_hal_srng_dst_get_next_entry(struct ath12k_base *ab,
struct hal_srng *srng);
void *ath12k_hal_srng_src_peek(struct ath12k_base *ab, struct hal_srng *srng);
Expand All @@ -1501,7 +1499,6 @@ void *ath12k_hal_srng_src_get_next_entry(struct ath12k_base *ab,
struct hal_srng *srng);
int ath12k_hal_srng_src_num_free(struct ath12k_base *ab, struct hal_srng *srng,
bool sync_hw_ptr);
void ath12k_hal_srng_update_tp(struct hal_srng *srng, u32 new_tp);
void ath12k_hal_srng_access_begin(struct ath12k_base *ab,
struct hal_srng *srng);
void ath12k_hal_srng_access_end(struct ath12k_base *ab, struct hal_srng *srng);
Expand Down
21 changes: 12 additions & 9 deletions drivers/net/wireless/ath/ath12k/mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -8170,16 +8170,16 @@ int ath12k_mac_op_change_sta_links(struct ieee80211_hw *hw,
continue;

arvif = wiphy_dereference(hw->wiphy, ahvif->link[link_id]);
arsta = ath12k_mac_alloc_assign_link_sta(ah, ahsta, ahvif, link_id);
if (!arvif || !arvif->is_created)
continue;

if (!arvif || !arsta) {
arsta = ath12k_mac_alloc_assign_link_sta(ah, ahsta, ahvif, link_id);
if (!arsta) {
ath12k_hw_warn(ah, "Failed to alloc/assign link sta");
continue;
}

ar = arvif->ar;
if (!ar)
continue;

ret = ath12k_mac_station_add(ar, arvif, arsta);
if (ret) {
Expand Down Expand Up @@ -8515,6 +8515,10 @@ ath12k_create_vht_cap(struct ath12k *ar, u32 rate_cap_tx_chainmask,
vht_cap.vht_supported = 1;
vht_cap.cap = ar->pdev->cap.vht_cap;

if (ar->pdev->cap.nss_ratio_enabled)
vht_cap.vht_mcs.tx_highest |=
cpu_to_le16(IEEE80211_VHT_EXT_NSS_BW_CAPABLE);

ath12k_set_vht_txbf_cap(ar, &vht_cap.cap);

/* 80P80 is not supported */
Expand Down Expand Up @@ -10410,7 +10414,7 @@ int ath12k_mac_vdev_create(struct ath12k *ar, struct ath12k_link_vif *arvif)
if (ret) {
ath12k_warn(ab, "failed to create WMI vdev %d: %d\n",
arvif->vdev_id, ret);
return ret;
goto err;
}

ar->num_created_vdevs++;
Expand Down Expand Up @@ -10577,13 +10581,13 @@ int ath12k_mac_vdev_create(struct ath12k *ar, struct ath12k_link_vif *arvif)
if (ret) {
ath12k_warn(ar->ab, "failed to delete peer vdev_id %d addr %pM\n",
arvif->vdev_id, arvif->bssid);
goto err;
goto err_dp_peer_del;
}

ret = ath12k_wait_for_peer_delete_done(ar, arvif->vdev_id,
arvif->bssid);
if (ret)
goto err_vdev_del;
goto err_dp_peer_del;

ar->num_peers--;
}
Expand All @@ -10600,8 +10604,6 @@ int ath12k_mac_vdev_create(struct ath12k *ar, struct ath12k_link_vif *arvif)

ath12k_wmi_vdev_delete(ar, arvif->vdev_id);
ar->num_created_vdevs--;
arvif->is_created = false;
arvif->ar = NULL;
ar->allocated_vdev_map &= ~(1LL << arvif->vdev_id);
ab->free_vdev_map |= 1LL << arvif->vdev_id;
ab->free_vdev_stats_id_map &= ~(1LL << arvif->vdev_stats_id);
Expand All @@ -10610,6 +10612,7 @@ int ath12k_mac_vdev_create(struct ath12k *ar, struct ath12k_link_vif *arvif)
spin_unlock_bh(&ar->data_lock);

err:
arvif->is_created = false;
arvif->ar = NULL;
return ret;
}
Expand Down
3 changes: 1 addition & 2 deletions drivers/net/wireless/ath/ath12k/wifi7/dp_mon.c
Original file line number Diff line number Diff line change
Expand Up @@ -1779,8 +1779,7 @@ ath12k_wifi7_dp_mon_rx_parse_status_tlv(struct ath12k_pdev_dp *dp_pdev,

info[1] = __le32_to_cpu(mpdu_start->info1);
peer_id = u32_get_bits(info[1], HAL_RX_MPDU_START_INFO1_PEERID);
if (peer_id)
ppdu_info->peer_id = peer_id;
ppdu_info->peer_id = peer_id;

ppdu_info->mpdu_len += u32_get_bits(info[1],
HAL_RX_MPDU_START_INFO2_MPDU_LEN);
Expand Down
Loading
Loading