@@ -78,18 +78,23 @@ int ath9k_htc_tx_start(struct ath9k_htc_priv *priv, struct sk_buff *skb)
7878 struct ieee80211_tx_info * tx_info = IEEE80211_SKB_CB (skb );
7979 struct ieee80211_sta * sta = tx_info -> control .sta ;
8080 struct ath9k_htc_sta * ista ;
81- struct ath9k_htc_vif * avp ;
8281 struct ath9k_htc_tx_ctl tx_ctl ;
8382 enum htc_endpoint_id epid ;
8483 u16 qnum ;
8584 __le16 fc ;
8685 u8 * tx_fhdr ;
87- u8 sta_idx ;
86+ u8 sta_idx , vif_idx ;
8887
8988 hdr = (struct ieee80211_hdr * ) skb -> data ;
9089 fc = hdr -> frame_control ;
9190
92- avp = (struct ath9k_htc_vif * ) tx_info -> control .vif -> drv_priv ;
91+ if (tx_info -> control .vif &&
92+ (struct ath9k_htc_vif * ) tx_info -> control .vif -> drv_priv )
93+ vif_idx = ((struct ath9k_htc_vif * )
94+ tx_info -> control .vif -> drv_priv )-> index ;
95+ else
96+ vif_idx = priv -> nvifs ;
97+
9398 if (sta ) {
9499 ista = (struct ath9k_htc_sta * ) sta -> drv_priv ;
95100 sta_idx = ista -> index ;
@@ -106,7 +111,7 @@ int ath9k_htc_tx_start(struct ath9k_htc_priv *priv, struct sk_buff *skb)
106111 memset (& tx_hdr , 0 , sizeof (struct tx_frame_hdr ));
107112
108113 tx_hdr .node_idx = sta_idx ;
109- tx_hdr .vif_idx = avp -> index ;
114+ tx_hdr .vif_idx = vif_idx ;
110115
111116 if (tx_info -> flags & IEEE80211_TX_CTL_AMPDU ) {
112117 tx_ctl .type = ATH9K_HTC_AMPDU ;
@@ -169,7 +174,7 @@ int ath9k_htc_tx_start(struct ath9k_htc_priv *priv, struct sk_buff *skb)
169174 tx_ctl .type = ATH9K_HTC_NORMAL ;
170175
171176 mgmt_hdr .node_idx = sta_idx ;
172- mgmt_hdr .vif_idx = avp -> index ;
177+ mgmt_hdr .vif_idx = vif_idx ;
173178 mgmt_hdr .tidno = 0 ;
174179 mgmt_hdr .flags = 0 ;
175180
0 commit comments