diff options
author | Zhu Yi <yi.zhu@intel.com> | 2009-05-21 09:47:03 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-05-22 14:06:02 -0400 |
commit | e31a16d6f64ef0e324c6f54d5112703c3f13a9c4 (patch) | |
tree | 4ed30d0ebd1d948aaa14bcd4fb52f29d9bb2e7a8 /net/mac80211/wme.c | |
parent | a971be223f243311a8014ddfc721f68e3ef2da9c (diff) |
wireless: move some utility functions from mac80211 to cfg80211
The patch moves some utility functions from mac80211 to cfg80211.
Because these functions are doing generic 802.11 operations so they
are not mac80211 specific. The moving allows some fullmac drivers
to be also benefit from these utility functions.
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: Samuel Ortiz <samuel.ortiz@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/wme.c')
-rw-r--r-- | net/mac80211/wme.c | 30 |
1 files changed, 1 insertions, 29 deletions
diff --git a/net/mac80211/wme.c b/net/mac80211/wme.c index 45b74f38b867..694343b9102b 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))) { |