Skip to content

Commit

Permalink
ath11k_nss: utilize existing function to get arvif from dev
Browse files Browse the repository at this point in the history
Signed-off-by: Sean Khan <[email protected]>
  • Loading branch information
qosmio committed Aug 9, 2024
1 parent 1dcce89 commit e9dcf8d
Showing 1 changed file with 51 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
--- a/drivers/net/wireless/ath/ath11k/nss.c
+++ b/drivers/net/wireless/ath/ath11k/nss.c
@@ -978,36 +978,20 @@ ath11k_nss_vdev_data_receive(struct net_
__attribute__((unused)) struct napi_struct *napi)
{
struct wireless_dev *wdev = NULL;
- struct ieee80211_vif *vif = NULL;
struct ath11k_vif *arvif;
struct ath11k_base *ab;
bool eth_decap = false;
int data_offs = 0;
int ret;

- if (!dev) {
- dev_kfree_skb_any(skb);
- return;
- }
-
- wdev = dev->ieee80211_ptr;
- if (!wdev) {
- dev_kfree_skb_any(skb);
- return;
- }
-
- vif = wdev_to_ieee80211_vif(wdev);
- if (!vif) {
- dev_kfree_skb_any(skb);
- return;
- }
-
- arvif = (struct ath11k_vif *)vif->drv_priv;
+ arvif = ath11k_nss_get_arvif_from_dev(dev);
if (!arvif) {
dev_kfree_skb_any(skb);
return;
}

+ wdev = ieee80211_vif_to_wdev_relaxed(arvif->vif);
+
ab = arvif->ar->ab;

skb->dev = dev;
@@ -1016,7 +1000,7 @@ ath11k_nss_vdev_data_receive(struct net_
ath11k_dbg_dump(ab, ATH11K_DBG_DP_RX, "", "dp rx msdu from nss: ",
skb->data, skb->len);

- if ((vif->type == NL80211_IFTYPE_STATION && wdev->use_4addr) &&
+ if ((arvif->vif->type == NL80211_IFTYPE_STATION && wdev->use_4addr) &&
ath11k_nss_vdev_data_receive_mec_check(arvif->ar, skb)) {
dev_kfree_skb_any(skb);
return;

0 comments on commit e9dcf8d

Please sign in to comment.