Skip to content

Commit 4eceef7

Browse files
Karthikeyan Periyasamygregkh
authored andcommitted
wifi: ath12k: Optimize the mac80211 hw data access
[ Upstream commit 842adda ] Currently mac80211 hw data is accessed by convert the hw to radio (ar) structure and then radio to hw structure which is not necessary in some places where mac80211 hw data is already present. So in that kind of places avoid the conversion and directly access the mac80211 hw data. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1 Signed-off-by: Karthikeyan Periyasamy <[email protected]> Acked-by: Jeff Johnson <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected] Stable-dep-of: 8fac326 ("wifi: ath12k: fix atomic calls in ath12k_mac_op_set_bitrate_mask()") Signed-off-by: Sasha Levin <[email protected]>
1 parent 3d94c4b commit 4eceef7

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

drivers/net/wireless/ath/ath12k/mac.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4945,15 +4945,15 @@ static void ath12k_mac_op_tx(struct ieee80211_hw *hw,
49454945
if (ret) {
49464946
ath12k_warn(ar->ab, "failed to queue management frame %d\n",
49474947
ret);
4948-
ieee80211_free_txskb(ar->hw, skb);
4948+
ieee80211_free_txskb(hw, skb);
49494949
}
49504950
return;
49514951
}
49524952

49534953
ret = ath12k_dp_tx(ar, arvif, skb);
49544954
if (ret) {
49554955
ath12k_warn(ar->ab, "failed to transmit frame %d\n", ret);
4956-
ieee80211_free_txskb(ar->hw, skb);
4956+
ieee80211_free_txskb(hw, skb);
49574957
}
49584958
}
49594959

@@ -5496,7 +5496,7 @@ static int ath12k_mac_op_add_interface(struct ieee80211_hw *hw,
54965496
goto err_peer_del;
54975497

54985498
param_id = WMI_VDEV_PARAM_RTS_THRESHOLD;
5499-
param_value = ar->hw->wiphy->rts_threshold;
5499+
param_value = hw->wiphy->rts_threshold;
55005500
ret = ath12k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id,
55015501
param_id, param_value);
55025502
if (ret) {
@@ -6676,7 +6676,7 @@ ath12k_mac_op_set_bitrate_mask(struct ieee80211_hw *hw,
66766676
arvif->vdev_id, ret);
66776677
return ret;
66786678
}
6679-
ieee80211_iterate_stations_atomic(ar->hw,
6679+
ieee80211_iterate_stations_atomic(hw,
66806680
ath12k_mac_disable_peer_fixed_rate,
66816681
arvif);
66826682
} else if (ath12k_mac_bitrate_mask_get_single_nss(ar, band, mask,
@@ -6722,14 +6722,14 @@ ath12k_mac_op_set_bitrate_mask(struct ieee80211_hw *hw,
67226722
return -EINVAL;
67236723
}
67246724

6725-
ieee80211_iterate_stations_atomic(ar->hw,
6725+
ieee80211_iterate_stations_atomic(hw,
67266726
ath12k_mac_disable_peer_fixed_rate,
67276727
arvif);
67286728

67296729
mutex_lock(&ar->conf_mutex);
67306730

67316731
arvif->bitrate_mask = *mask;
6732-
ieee80211_iterate_stations_atomic(ar->hw,
6732+
ieee80211_iterate_stations_atomic(hw,
67336733
ath12k_mac_set_bitrate_mask_iter,
67346734
arvif);
67356735

@@ -6767,7 +6767,7 @@ ath12k_mac_op_reconfig_complete(struct ieee80211_hw *hw,
67676767
ath12k_warn(ar->ab, "pdev %d successfully recovered\n",
67686768
ar->pdev->pdev_id);
67696769
ar->state = ATH12K_STATE_ON;
6770-
ieee80211_wake_queues(ar->hw);
6770+
ieee80211_wake_queues(hw);
67716771

67726772
if (ab->is_reset) {
67736773
recovery_count = atomic_inc_return(&ab->recovery_count);

drivers/net/wireless/ath/ath12k/reg.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ static const struct ieee80211_regdomain ath12k_world_regd = {
2828
}
2929
};
3030

31-
static bool ath12k_regdom_changes(struct ath12k *ar, char *alpha2)
31+
static bool ath12k_regdom_changes(struct ieee80211_hw *hw, char *alpha2)
3232
{
3333
const struct ieee80211_regdomain *regd;
3434

35-
regd = rcu_dereference_rtnl(ar->hw->wiphy->regd);
35+
regd = rcu_dereference_rtnl(hw->wiphy->regd);
3636
/* This can happen during wiphy registration where the previous
3737
* user request is received before we update the regd received
3838
* from firmware.
@@ -71,7 +71,7 @@ ath12k_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request)
7171
return;
7272
}
7373

74-
if (!ath12k_regdom_changes(ar, request->alpha2)) {
74+
if (!ath12k_regdom_changes(hw, request->alpha2)) {
7575
ath12k_dbg(ar->ab, ATH12K_DBG_REG, "Country is already set\n");
7676
return;
7777
}

0 commit comments

Comments
 (0)