]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
[MAC80211]: move QoS rx handlers into rx.c
authorJohannes Berg <johannes@sipsolutions.net>
Fri, 27 Jul 2007 13:43:22 +0000 (15:43 +0200)
committerDavid S. Miller <davem@sunset.davemloft.net>
Wed, 10 Oct 2007 23:47:30 +0000 (16:47 -0700)
This patch moves the QoS handlers into rx.c making it possible
to compile wme.c only when NET_SCHED is defined.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Jiri Benc <jbenc@suse.cz>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/Makefile
net/mac80211/rx.c
net/mac80211/wme.c
net/mac80211/wme.h

index b5853991324b85662947fe2ba55b64568cc967d5..0353e75ec9635fe36a2b63873f48a72e471b5dd7 100644 (file)
@@ -2,6 +2,7 @@ obj-$(CONFIG_MAC80211) += mac80211.o rc80211_simple.o
 
 mac80211-objs-$(CONFIG_MAC80211_LEDS) += ieee80211_led.o
 mac80211-objs-$(CONFIG_MAC80211_DEBUGFS) += debugfs.o debugfs_sta.o debugfs_netdev.o debugfs_key.o
+mac80211-objs-$(CONFIG_NET_SCHED) += wme.o
 
 mac80211-objs := \
        ieee80211.o \
@@ -16,7 +17,6 @@ mac80211-objs := \
        regdomain.o \
        tkip.o \
        aes_ccm.o \
-       wme.o \
        ieee80211_cfg.o \
        rx.o \
        $(mac80211-objs-y)
index 8c0d14c5628fd73181b225516e690f28ac99868c..c5a6bb20072690d6de6092a96a508fe912a0da22 100644 (file)
  * these don't have dev/sdata fields in the rx data
  */
 
+static ieee80211_txrx_result
+ieee80211_rx_h_parse_qos(struct ieee80211_txrx_data *rx)
+{
+       u8 *data = rx->skb->data;
+       int tid;
+
+       /* does the frame have a qos control field? */
+       if (WLAN_FC_IS_QOS_DATA(rx->fc)) {
+               u8 *qc = data + ieee80211_get_hdrlen(rx->fc) - QOS_CONTROL_LEN;
+               /* frame has qos control */
+               tid = qc[0] & QOS_CONTROL_TID_MASK;
+       } else {
+               if (unlikely((rx->fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT)) {
+                       /* Separate TID for management frames */
+                       tid = NUM_RX_DATA_QUEUES - 1;
+               } else {
+                       /* no qos control present */
+                       tid = 0; /* 802.1d - Best Effort */
+               }
+       }
+#ifdef CONFIG_MAC80211_DEBUG_COUNTERS
+       I802_DEBUG_INC(rx->local->wme_rx_queue[tid]);
+       if (rx->sta) {
+               I802_DEBUG_INC(rx->sta->wme_rx_queue[tid]);
+       }
+#endif /* CONFIG_MAC80211_DEBUG_COUNTERS */
+
+       rx->u.rx.queue = tid;
+       /* Set skb->priority to 1d tag if highest order bit of TID is not set.
+        * For now, set skb->priority to 0 for other cases. */
+       rx->skb->priority = (tid > 7) ? 0 : tid;
+
+       return TXRX_CONTINUE;
+}
+
 static ieee80211_txrx_result
 ieee80211_rx_h_load_stats(struct ieee80211_txrx_data *rx)
 {
@@ -764,6 +799,26 @@ ieee80211_rx_h_ps_poll(struct ieee80211_txrx_data *rx)
        return TXRX_QUEUED;
 }
 
+static ieee80211_txrx_result
+ieee80211_rx_h_remove_qos_control(struct ieee80211_txrx_data *rx)
+{
+       u16 fc = rx->fc;
+       u8 *data = rx->skb->data;
+       struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) data;
+
+       if (!WLAN_FC_IS_QOS_DATA(fc))
+               return TXRX_CONTINUE;
+
+       /* remove the qos control field, update frame type and meta-data */
+       memmove(data + 2, data, ieee80211_get_hdrlen(fc) - 2);
+       hdr = (struct ieee80211_hdr *) skb_pull(rx->skb, 2);
+       /* change frame type to non QOS */
+       rx->fc = fc &= ~IEEE80211_STYPE_QOS_DATA;
+       hdr->frame_control = cpu_to_le16(fc);
+
+       return TXRX_CONTINUE;
+}
+
 static ieee80211_txrx_result
 ieee80211_rx_h_802_1x_pae(struct ieee80211_txrx_data *rx)
 {
index 7ab82b376e1bc92f8d656bfa30f7a3cf4b2b1152..0f11ccd30a3619fb72e3806501be40e31e6af308 100644 (file)
 #include "ieee80211_i.h"
 #include "wme.h"
 
-static inline int WLAN_FC_IS_QOS_DATA(u16 fc)
-{
-       return (fc & 0x8C) == 0x88;
-}
-
-
-ieee80211_txrx_result
-ieee80211_rx_h_parse_qos(struct ieee80211_txrx_data *rx)
-{
-       u8 *data = rx->skb->data;
-       int tid;
-
-       /* does the frame have a qos control field? */
-       if (WLAN_FC_IS_QOS_DATA(rx->fc)) {
-               u8 *qc = data + ieee80211_get_hdrlen(rx->fc) - QOS_CONTROL_LEN;
-               /* frame has qos control */
-               tid = qc[0] & QOS_CONTROL_TID_MASK;
-       } else {
-               if (unlikely((rx->fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT)) {
-                       /* Separate TID for management frames */
-                       tid = NUM_RX_DATA_QUEUES - 1;
-               } else {
-                       /* no qos control present */
-                       tid = 0; /* 802.1d - Best Effort */
-               }
-       }
-#ifdef CONFIG_MAC80211_DEBUG_COUNTERS
-       I802_DEBUG_INC(rx->local->wme_rx_queue[tid]);
-       if (rx->sta) {
-               I802_DEBUG_INC(rx->sta->wme_rx_queue[tid]);
-       }
-#endif /* CONFIG_MAC80211_DEBUG_COUNTERS */
-
-       rx->u.rx.queue = tid;
-       /* Set skb->priority to 1d tag if highest order bit of TID is not set.
-        * For now, set skb->priority to 0 for other cases. */
-       rx->skb->priority = (tid > 7) ? 0 : tid;
-
-       return TXRX_CONTINUE;
-}
-
-
-ieee80211_txrx_result
-ieee80211_rx_h_remove_qos_control(struct ieee80211_txrx_data *rx)
-{
-       u16 fc = rx->fc;
-       u8 *data = rx->skb->data;
-       struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) data;
-
-       if (!WLAN_FC_IS_QOS_DATA(fc))
-               return TXRX_CONTINUE;
-
-       /* remove the qos control field, update frame type and meta-data */
-       memmove(data + 2, data, ieee80211_get_hdrlen(fc) - 2);
-       hdr = (struct ieee80211_hdr *) skb_pull(rx->skb, 2);
-       /* change frame type to non QOS */
-       rx->fc = fc &= ~IEEE80211_STYPE_QOS_DATA;
-       hdr->frame_control = cpu_to_le16(fc);
-
-       return TXRX_CONTINUE;
-}
-
-
-#ifdef CONFIG_NET_SCHED
 /* maximum number of hardware queues we support. */
 #define TC_80211_MAX_QUEUES 8
 
@@ -675,4 +611,3 @@ void ieee80211_wme_unregister(void)
 {
        unregister_qdisc(&wme_qdisc_ops);
 }
-#endif /* CONFIG_NET_SCHED */
index f0bff10f0e08676c94c61df8646885973756245d..76c713a6450c37290f0ba521cbe2e212e06bc514 100644 (file)
 
 #define QOS_CONTROL_TAG1D_MASK 0x07
 
-ieee80211_txrx_result
-ieee80211_rx_h_parse_qos(struct ieee80211_txrx_data *rx);
-
-ieee80211_txrx_result
-ieee80211_rx_h_remove_qos_control(struct ieee80211_txrx_data *rx);
+static inline int WLAN_FC_IS_QOS_DATA(u16 fc)
+{
+       return (fc & 0x8C) == 0x88;
+}
 
 #ifdef CONFIG_NET_SCHED
 void ieee80211_install_qdisc(struct net_device *dev);