diff options
Diffstat (limited to 'net/mac80211/wme.c')
-rw-r--r-- | net/mac80211/wme.c | 34 |
1 files changed, 3 insertions, 31 deletions
diff --git a/net/mac80211/wme.c b/net/mac80211/wme.c index 0b8ad1f4ecdd..116a923b14d6 100644 --- a/net/mac80211/wme.c +++ b/net/mac80211/wme.c | |||
@@ -23,34 +23,6 @@ | |||
23 | */ | 23 | */ |
24 | const int ieee802_1d_to_ac[8] = { 2, 3, 3, 2, 1, 1, 0, 0 }; | 24 | const int ieee802_1d_to_ac[8] = { 2, 3, 3, 2, 1, 1, 0, 0 }; |
25 | 25 | ||
26 | static const char llc_ip_hdr[8] = {0xAA, 0xAA, 0x3, 0, 0, 0, 0x08, 0}; | ||
27 | |||
28 | /* Given a data frame determine the 802.1p/1d tag to use. */ | ||
29 | static unsigned int classify_1d(struct sk_buff *skb) | ||
30 | { | ||
31 | unsigned int dscp; | ||
32 | |||
33 | /* skb->priority values from 256->263 are magic values to | ||
34 | * directly indicate a specific 802.1d priority. This is used | ||
35 | * to allow 802.1d priority to be passed directly in from VLAN | ||
36 | * tags, etc. | ||
37 | */ | ||
38 | if (skb->priority >= 256 && skb->priority <= 263) | ||
39 | return skb->priority - 256; | ||
40 | |||
41 | switch (skb->protocol) { | ||
42 | case htons(ETH_P_IP): | ||
43 | dscp = ip_hdr(skb)->tos & 0xfc; | ||
44 | break; | ||
45 | |||
46 | default: | ||
47 | return 0; | ||
48 | } | ||
49 | |||
50 | return dscp >> 5; | ||
51 | } | ||
52 | |||
53 | |||
54 | static int wme_downgrade_ac(struct sk_buff *skb) | 26 | static int wme_downgrade_ac(struct sk_buff *skb) |
55 | { | 27 | { |
56 | switch (skb->priority) { | 28 | switch (skb->priority) { |
@@ -94,7 +66,7 @@ static u16 classify80211(struct ieee80211_local *local, struct sk_buff *skb) | |||
94 | 66 | ||
95 | /* use the data classifier to determine what 802.1d tag the | 67 | /* use the data classifier to determine what 802.1d tag the |
96 | * data frame has */ | 68 | * data frame has */ |
97 | skb->priority = classify_1d(skb); | 69 | skb->priority = cfg80211_classify8021d(skb); |
98 | 70 | ||
99 | /* in case we are a client verify acm is not set for this ac */ | 71 | /* in case we are a client verify acm is not set for this ac */ |
100 | while (unlikely(local->wmm_acm & BIT(skb->priority))) { | 72 | while (unlikely(local->wmm_acm & BIT(skb->priority))) { |
@@ -129,11 +101,11 @@ u16 ieee80211_select_queue(struct net_device *dev, struct sk_buff *skb) | |||
129 | * Now we know the 1d priority, fill in the QoS header if | 101 | * Now we know the 1d priority, fill in the QoS header if |
130 | * there is one (and we haven't done this before). | 102 | * there is one (and we haven't done this before). |
131 | */ | 103 | */ |
132 | if (!skb->requeue && ieee80211_is_data_qos(hdr->frame_control)) { | 104 | if (ieee80211_is_data_qos(hdr->frame_control)) { |
133 | u8 *p = ieee80211_get_qos_ctl(hdr); | 105 | u8 *p = ieee80211_get_qos_ctl(hdr); |
134 | u8 ack_policy = 0; | 106 | u8 ack_policy = 0; |
135 | tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK; | 107 | tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK; |
136 | if (local->wifi_wme_noack_test) | 108 | if (unlikely(local->wifi_wme_noack_test)) |
137 | ack_policy |= QOS_CONTROL_ACK_POLICY_NOACK << | 109 | ack_policy |= QOS_CONTROL_ACK_POLICY_NOACK << |
138 | QOS_CONTROL_ACK_POLICY_SHIFT; | 110 | QOS_CONTROL_ACK_POLICY_SHIFT; |
139 | /* qos header is 2 bytes, second reserved */ | 111 | /* qos header is 2 bytes, second reserved */ |