Skip to content

Commit 842adda

Browse files
Karthikeyan Periyasamykvalo
authored andcommitted
wifi: ath12k: Optimize the mac80211 hw data access
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]
1 parent 37a0dd6 commit 842adda

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
@@ -4995,15 +4995,15 @@ static void ath12k_mac_op_tx(struct ieee80211_hw *hw,
49954995
if (ret) {
49964996
ath12k_warn(ar->ab, "failed to queue management frame %d\n",
49974997
ret);
4998-
ieee80211_free_txskb(ar->hw, skb);
4998+
ieee80211_free_txskb(hw, skb);
49994999
}
50005000
return;
50015001
}
50025002

50035003
ret = ath12k_dp_tx(ar, arvif, skb);
50045004
if (ret) {
50055005
ath12k_warn(ar->ab, "failed to transmit frame %d\n", ret);
5006-
ieee80211_free_txskb(ar->hw, skb);
5006+
ieee80211_free_txskb(hw, skb);
50075007
}
50085008
}
50095009

@@ -5604,7 +5604,7 @@ static int ath12k_mac_op_add_interface(struct ieee80211_hw *hw,
56045604
goto err_peer_del;
56055605

56065606
param_id = WMI_VDEV_PARAM_RTS_THRESHOLD;
5607-
param_value = ar->hw->wiphy->rts_threshold;
5607+
param_value = hw->wiphy->rts_threshold;
56085608
ret = ath12k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id,
56095609
param_id, param_value);
56105610
if (ret) {
@@ -6844,7 +6844,7 @@ ath12k_mac_op_set_bitrate_mask(struct ieee80211_hw *hw,
68446844
arvif->vdev_id, ret);
68456845
return ret;
68466846
}
6847-
ieee80211_iterate_stations_atomic(ar->hw,
6847+
ieee80211_iterate_stations_atomic(hw,
68486848
ath12k_mac_disable_peer_fixed_rate,
68496849
arvif);
68506850
} else if (ath12k_mac_bitrate_mask_get_single_nss(ar, band, mask,
@@ -6890,14 +6890,14 @@ ath12k_mac_op_set_bitrate_mask(struct ieee80211_hw *hw,
68906890
return -EINVAL;
68916891
}
68926892

6893-
ieee80211_iterate_stations_atomic(ar->hw,
6893+
ieee80211_iterate_stations_atomic(hw,
68946894
ath12k_mac_disable_peer_fixed_rate,
68956895
arvif);
68966896

68976897
mutex_lock(&ar->conf_mutex);
68986898

68996899
arvif->bitrate_mask = *mask;
6900-
ieee80211_iterate_stations_atomic(ar->hw,
6900+
ieee80211_iterate_stations_atomic(hw,
69016901
ath12k_mac_set_bitrate_mask_iter,
69026902
arvif);
69036903

@@ -6935,7 +6935,7 @@ ath12k_mac_op_reconfig_complete(struct ieee80211_hw *hw,
69356935
ath12k_warn(ar->ab, "pdev %d successfully recovered\n",
69366936
ar->pdev->pdev_id);
69376937
ar->state = ATH12K_STATE_ON;
6938-
ieee80211_wake_queues(ar->hw);
6938+
ieee80211_wake_queues(hw);
69396939

69406940
if (ab->is_reset) {
69416941
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)