From: Johannes Berg <johannes@sipsolutions.net>
To: netdev@vger.kernel.org
Cc: Jouni Malinen <jkm@devicescape.com>,
"John W. Linville" <linville@tuxdriver.com>,
Jiri Benc <jbenc@suse.cz>,
Johannes Berg <johannes@sipsolutions.net>
Subject: [PATCH 05/18] d80211: get rid of WME bitfield
Date: Mon, 21 Aug 2006 09:41:12 +0200 [thread overview]
Message-ID: <20060821075159.740408530@sipsolutions.net> (raw)
In-Reply-To: 20060821074107.648561364@sipsolutions.net
[-- Attachment #1: d80211-wme-bitfield.patch --]
[-- Type: text/plain, Size: 3237 bytes --]
This patch gets rid of the endian-ness dependent bitfield
used for WME. It cleans up wme includes and adds some necessary
includes in other files that got them implicitly through wme.h
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
--- wireless-dev.orig/net/d80211/wme.c 2006-08-20 14:56:17.418192788 +0200
+++ wireless-dev/net/d80211/wme.c 2006-08-20 14:56:19.058192788 +0200
@@ -12,7 +12,9 @@
#include <linux/skbuff.h>
#include <linux/module.h>
#include <linux/if_arp.h>
+#include <linux/types.h>
#include <net/ip.h>
+#include <net/pkt_sched.h>
#include <net/d80211.h>
#include "ieee80211_i.h"
@@ -246,15 +248,15 @@ static int wme_qdiscop_enqueue(struct sk
/* now we know the 1d priority, fill in the QoS header if there is one
*/
if (WLAN_FC_IS_QOS_DATA(fc)) {
- struct qos_control *qc = (struct qos_control *)
- (skb->data + ieee80211_get_hdrlen(fc) - 2);
- u8 *p = (u8 *) qc;
- *p++ = 0; /* do this due to gcc's lack of optimization on
- * bitfield ops */
- *p = 0;
- qc->tag1d = skb->priority;
+ u8 *p = skb->data + ieee80211_get_hdrlen(fc) - 2;
+ u8 qos_hdr = skb->priority & QOS_CONTROL_TAG1D_MASK;
if (local->wifi_wme_noack_test)
- qc->ack_policy = 1;
+ qos_hdr |= QOS_CONTROL_ACK_POLICY_NOACK <<
+ QOS_CONTROL_ACK_POLICY_SHIFT;
+ /* qos header is 2 bytes, second reserved */
+ *p = qos_hdr;
+ p++;
+ *p = 0;
}
if (unlikely(queue >= local->hw->queues)) {
--- wireless-dev.orig/net/d80211/wme.h 2006-08-20 14:56:09.068192788 +0200
+++ wireless-dev/net/d80211/wme.h 2006-08-20 14:56:19.058192788 +0200
@@ -11,10 +11,8 @@
#ifndef _WME_H
#define _WME_H
-#include <asm/byteorder.h>
#include <linux/netdevice.h>
-#include <linux/types.h>
-#include <net/pkt_sched.h>
+#include "ieee80211_i.h"
#define QOS_CONTROL_LEN 2
@@ -24,26 +22,7 @@
#define QOS_CONTROL_TID_MASK 0x0f
#define QOS_CONTROL_ACK_POLICY_SHIFT 5
-/* This bit field structure should not be used; it can cause compiler to
- * generate unaligned accesses and inefficient code. */
-struct qos_control {
-#if defined(__LITTLE_ENDIAN_BITFIELD)
- u8 tag1d:3, /* bits 0-2 */
- reserved1:1,
- eosp:1,
- ack_policy:2,
- reserved2:1;
-#elif defined (__BIG_ENDIAN_BITFIELD)
- u8 reserved2:1,
- ack_policy:2,
- eosp:1,
- reserved1:1,
- tag1d:3; /* bits 0-2 */
-#else
-#error "Please fix <asm/byteorder.h>"
-#endif
- u8 reserved;
-} __attribute__ ((packed));
+#define QOS_CONTROL_TAG1D_MASK 0x07
ieee80211_txrx_result
ieee80211_rx_h_parse_qos(struct ieee80211_txrx_data *rx);
--- wireless-dev.orig/net/d80211/fifo_qdisc.c 2006-08-20 14:56:09.098192788 +0200
+++ wireless-dev/net/d80211/fifo_qdisc.c 2006-08-20 14:56:19.058192788 +0200
@@ -13,6 +13,7 @@
#include <linux/config.h>
#include <linux/version.h>
#include <linux/netdevice.h>
+#include <net/pkt_sched.h>
#include <net/d80211.h>
#include "ieee80211_i.h"
#include "wme.h"
--- wireless-dev.orig/net/d80211/ieee80211.c 2006-08-20 14:56:18.438192788 +0200
+++ wireless-dev/net/d80211/ieee80211.c 2006-08-20 14:56:19.058192788 +0200
@@ -18,6 +18,7 @@
#include <linux/etherdevice.h>
#include <linux/if_arp.h>
#include <linux/wireless.h>
+#include <linux/rtnetlink.h>
#include <net/iw_handler.h>
#include <linux/compiler.h>
--
next prev parent reply other threads:[~2006-08-21 8:02 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-21 7:41 [PATCH 00/18] d80211: various cleanups/fixes/changes Johannes Berg
2006-08-21 7:41 ` [PATCH 01/18] d80211: LED triggers Johannes Berg
2006-08-22 0:30 ` [PATCH 01/3] d80211: add support for SIOCSIWRATE, SIOCSIWTXPOW and SIOCSIWPOWER Mohamed Abbas
2006-08-22 0:36 ` [PATCH 02/3] d80211: iwlist scan Mohamed Abbas
2006-08-23 15:46 ` Jiri Benc
2006-08-28 20:37 ` [PATCH 0/7] d80211: support more wireless command mabbas
2006-08-22 0:38 ` [PATCH 03/3] d80211: adhoc Mohamed Abbas
2006-08-23 15:51 ` Jiri Benc
2006-08-23 15:19 ` [PATCH 01/3] d80211: add support for SIOCSIWRATE, SIOCSIWTXPOW and SIOCSIWPOWER Jiri Benc
2006-08-25 18:37 ` Jouni Malinen
2006-08-25 18:46 ` Mohamed Abbas
2006-08-22 16:54 ` [PATCH 01/18] d80211: LED triggers Jouni Malinen
2006-08-22 18:38 ` Jiri Benc
2006-08-23 7:02 ` Johannes Berg
2006-08-23 18:16 ` Jiri Benc
2006-08-24 7:03 ` Johannes Berg
2006-09-22 11:59 ` Jiri Benc
2006-08-21 7:41 ` [PATCH 02/18] d80211: master link Johannes Berg
2006-08-21 8:13 ` Johannes Berg
2006-08-21 19:08 ` Jiri Benc
2006-08-22 7:49 ` Johannes Berg
2006-08-21 7:41 ` [PATCH 03/18] d80211: pointers as extended booleans Johannes Berg
2006-08-22 6:43 ` Bill Fink
2006-08-22 8:39 ` Johannes Berg
2006-08-21 7:41 ` [PATCH 04/18] d80211: use kzalloc() Johannes Berg
2006-08-21 7:41 ` Johannes Berg [this message]
2006-08-21 7:41 ` [PATCH 06/18] d80211: rework rate control registration Johannes Berg
2006-08-21 19:19 ` Jiri Benc
2006-08-22 8:33 ` Johannes Berg
2006-08-21 7:41 ` [PATCH 07/18] d80211: get rid of sta_aid in favour of keeping track of TIM Johannes Berg
2006-08-22 18:36 ` Jiri Benc
2006-08-23 7:04 ` Johannes Berg
2006-08-23 10:04 ` [PATCH] " Johannes Berg
2006-08-23 10:05 ` Johannes Berg
2006-08-23 10:16 ` [PATCH ] " Johannes Berg
2006-08-21 7:41 ` [PATCH 08/18] d80211: clean up exports Johannes Berg
2006-08-22 16:44 ` Jouni Malinen
2006-08-23 7:01 ` Johannes Berg
2006-08-23 10:03 ` [PATCH] " Johannes Berg
2006-08-21 7:41 ` [PATCH 09/18] d80211: move out rate control registration code Johannes Berg
2006-08-21 7:41 ` [PATCH 10/18] d80211: clean up includes Johannes Berg
2006-08-21 7:41 ` [PATCH 11/18] d80211: clean up qdisc requeue Johannes Berg
2006-08-21 19:31 ` Jiri Benc
2006-08-22 7:48 ` Johannes Berg
2006-08-21 7:41 ` [PATCH 12/18] d80211: fix some sparse warnings Johannes Berg
2006-08-22 18:55 ` Jiri Benc
2006-08-21 7:41 ` [PATCH 13/18] d80211: clean up some coding style issues Johannes Berg
2006-08-21 19:35 ` Jiri Benc
2006-08-22 8:27 ` Johannes Berg
2006-08-21 7:41 ` [PATCH 14/18] d80211: make lowlevel TX framedump option visible Johannes Berg
2006-08-21 7:41 ` [PATCH 15/18] d80211: surface IBSS debug Johannes Berg
2006-08-21 7:41 ` [PATCH 16/18] d80211: get rid of MICHAEL_MIC_HWACCEL define Johannes Berg
2006-08-22 19:00 ` Jiri Benc
2006-08-23 7:05 ` Johannes Berg
2006-08-23 9:46 ` Jiri Benc
2006-08-21 7:41 ` [PATCH 17/18] d80211: surface powersave debug switch Johannes Berg
2006-08-21 7:41 ` [PATCH 18/18] d80211: fix some documentation Johannes Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060821075159.740408530@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=jbenc@suse.cz \
--cc=jkm@devicescape.com \
--cc=linville@tuxdriver.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).