Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
[safe/jmp/linux-2.6] / net / mac80211 / iface.c
index 264a6c9..edf21ce 100644 (file)
@@ -684,21 +684,25 @@ static u16 ieee80211_monitor_select_queue(struct net_device *dev,
        struct ieee80211_local *local = sdata->local;
        struct ieee80211_hdr *hdr;
        struct ieee80211_radiotap_header *rtap = (void *)skb->data;
+       u8 *p;
 
        if (local->hw.queues < 4)
                return 0;
 
        if (skb->len < 4 ||
-           skb->len < rtap->it_len + 2 /* frame control */)
+           skb->len < le16_to_cpu(rtap->it_len) + 2 /* frame control */)
                return 0; /* doesn't matter, frame will be dropped */
 
-       hdr = (void *)((u8 *)skb->data + rtap->it_len);
+       hdr = (void *)((u8 *)skb->data + le16_to_cpu(rtap->it_len));
 
-       if (!ieee80211_is_data(hdr->frame_control)) {
+       if (!ieee80211_is_data_qos(hdr->frame_control)) {
                skb->priority = 7;
                return ieee802_1d_to_ac[skb->priority];
        }
 
+       p = ieee80211_get_qos_ctl(hdr);
+       skb->priority = *p & IEEE80211_QOS_CTL_TAG1D_MASK;
+
        return ieee80211_downgrade_queue(local, skb);
 }
 
@@ -856,8 +860,12 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name,
 
        INIT_LIST_HEAD(&sdata->key_list);
 
-       sdata->force_unicast_rateidx = -1;
-       sdata->max_ratectrl_rateidx = -1;
+       for (i = 0; i < IEEE80211_NUM_BANDS; i++) {
+               struct ieee80211_supported_band *sband;
+               sband = local->hw.wiphy->bands[i];
+               sdata->rc_rateidx_mask[i] =
+                       sband ? (1 << sband->n_bitrates) - 1 : 0;
+       }
 
        /* setup type-dependent data */
        ieee80211_setup_sdata(sdata, type);