]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
Merge branch 'for-rmk' of git://git.pengutronix.de/git/imx/linux-2.6
[net-next-2.6.git] / drivers / net / wireless / ath / ath9k / htc_drv_txrx.c
index bd0b4acc3ece542d15413a1409421c1e538b73da..2a6e45a293a90f38b7add877b0ca231c603ebe1b 100644 (file)
@@ -78,18 +78,23 @@ int ath9k_htc_tx_start(struct ath9k_htc_priv *priv, struct sk_buff *skb)
        struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
        struct ieee80211_sta *sta = tx_info->control.sta;
        struct ath9k_htc_sta *ista;
-       struct ath9k_htc_vif *avp;
        struct ath9k_htc_tx_ctl tx_ctl;
        enum htc_endpoint_id epid;
        u16 qnum;
        __le16 fc;
        u8 *tx_fhdr;
-       u8 sta_idx;
+       u8 sta_idx, vif_idx;
 
        hdr = (struct ieee80211_hdr *) skb->data;
        fc = hdr->frame_control;
 
-       avp = (struct ath9k_htc_vif *) tx_info->control.vif->drv_priv;
+       if (tx_info->control.vif &&
+                       (struct ath9k_htc_vif *) tx_info->control.vif->drv_priv)
+               vif_idx = ((struct ath9k_htc_vif *)
+                               tx_info->control.vif->drv_priv)->index;
+       else
+               vif_idx = priv->nvifs;
+
        if (sta) {
                ista = (struct ath9k_htc_sta *) sta->drv_priv;
                sta_idx = ista->index;
@@ -106,7 +111,7 @@ int ath9k_htc_tx_start(struct ath9k_htc_priv *priv, struct sk_buff *skb)
                memset(&tx_hdr, 0, sizeof(struct tx_frame_hdr));
 
                tx_hdr.node_idx = sta_idx;
-               tx_hdr.vif_idx = avp->index;
+               tx_hdr.vif_idx = vif_idx;
 
                if (tx_info->flags & IEEE80211_TX_CTL_AMPDU) {
                        tx_ctl.type = ATH9K_HTC_AMPDU;
@@ -169,7 +174,7 @@ int ath9k_htc_tx_start(struct ath9k_htc_priv *priv, struct sk_buff *skb)
                tx_ctl.type = ATH9K_HTC_NORMAL;
 
                mgmt_hdr.node_idx = sta_idx;
-               mgmt_hdr.vif_idx = avp->index;
+               mgmt_hdr.vif_idx = vif_idx;
                mgmt_hdr.tidno = 0;
                mgmt_hdr.flags = 0;