linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Roland Vossen" <rvossen@broadcom.com>
To: gregkh@suse.de
Cc: devel@linuxdriverproject.org, linux-wireless@vger.kernel.org
Subject: [PATCH 02/21] staging: brcm80211: cleaned brcmu_utils.h
Date: Thu, 9 Jun 2011 16:44:42 +0200	[thread overview]
Message-ID: <1307630701-9170-3-git-send-email-rvossen@broadcom.com> (raw)
In-Reply-To: <1307630701-9170-1-git-send-email-rvossen@broadcom.com>

Code cleanup. Moved softmac specific definitions into brcmsmac/types.h
Removed unused definitions.

Signed-off-by: Roland Vossen <rvossen@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Franky Lin <frankyl@broadcom.com>
---
 drivers/staging/brcm80211/brcmsmac/types.h      |    6 ++
 drivers/staging/brcm80211/include/brcmu_utils.h |  110 +++++------------------
 2 files changed, 29 insertions(+), 87 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmsmac/types.h b/drivers/staging/brcm80211/brcmsmac/types.h
index 0de99d5..dd0bcf9 100644
--- a/drivers/staging/brcm80211/brcmsmac/types.h
+++ b/drivers/staging/brcm80211/brcmsmac/types.h
@@ -343,6 +343,12 @@ do {						\
 #define SET_REG(r, mask, val) \
 		W_REG((r), ((R_REG(r) & ~(mask)) | (val)))
 
+/* multi-bool data type: set of bools, mbool is true if any is set */
+typedef u32 mbool;
+#define mboolset(mb, bit)		((mb) |= (bit))	/* set one bool */
+#define mboolclr(mb, bit)		((mb) &= ~(bit))	/* clear one bool */
+#define mboolisset(mb, bit)		(((mb) & (bit)) != 0)	/* true if one bool is set */
+#define	mboolmaskset(mb, mask, val)	((mb) = (((mb) & ~(mask)) | (val)))
 
 /* forward declarations */
 struct sk_buff;
diff --git a/drivers/staging/brcm80211/include/brcmu_utils.h b/drivers/staging/brcm80211/include/brcmu_utils.h
index a4b52cf..e3308e8 100644
--- a/drivers/staging/brcm80211/include/brcmu_utils.h
+++ b/drivers/staging/brcm80211/include/brcmu_utils.h
@@ -22,16 +22,12 @@
 * Use brcmu_binit() to initialize before use
 */
 
-	struct brcmu_strbuf {
-		char *buf;	/* pointer to current position in origbuf */
-		unsigned int size;	/* current (residual) size in bytes */
-		char *origbuf;	/* unmodified pointer to orignal buffer */
-		unsigned int origsize;	/* unmodified orignal buffer size in bytes */
-	};
-
-/* ** driver-only section ** */
-
-#define GPIO_PIN_NOTDEFINED 	0x20	/* Pin not defined */
+struct brcmu_strbuf {
+	char *buf;	/* pointer to current position in origbuf */
+	unsigned int size;	/* current (residual) size in bytes */
+	char *origbuf;	/* unmodified pointer to orignal buffer */
+	unsigned int origsize;	/* unmodified orignal buffer size in bytes */
+};
 
 /*
  * Spin at most 'us' microseconds while 'exp' is true.
@@ -54,24 +50,25 @@
 #define PKTQ_MAX_PREC           16	/* Maximum precedence levels */
 #endif
 
-	struct pktq_prec {
-		struct sk_buff *head;	/* first packet to dequeue */
-		struct sk_buff *tail;	/* last packet to dequeue */
-		u16 len;		/* number of queued packets */
-		u16 max;		/* maximum number of queued packets */
-	};
+struct pktq_prec {
+	struct sk_buff *head;	/* first packet to dequeue */
+	struct sk_buff *tail;	/* last packet to dequeue */
+	u16 len;		/* number of queued packets */
+	u16 max;		/* maximum number of queued packets */
+};
 
 /* multi-priority pkt queue */
-	struct pktq {
-		u16 num_prec;	/* number of precedences in use */
-		u16 hi_prec;	/* rapid dequeue hint (>= highest non-empty prec) */
-		u16 max;	/* total max packets */
-		u16 len;	/* total number of packets */
-		/* q array must be last since # of elements can be either PKTQ_MAX_PREC or 1 */
-		struct pktq_prec q[PKTQ_MAX_PREC];
-	};
-
-#define PKTQ_PREC_ITER(pq, prec)        for (prec = (pq)->num_prec - 1; prec >= 0; prec--)
+struct pktq {
+	u16 num_prec;	/* number of precedences in use */
+	u16 hi_prec;	/* rapid dequeue hint (>= highest non-empty prec) */
+	u16 max;	/* total max packets */
+	u16 len;	/* total number of packets */
+	/*
+	 * q array must be last since # of elements can be either
+	 * PKTQ_MAX_PREC or 1
+	 */
+	struct pktq_prec q[PKTQ_MAX_PREC];
+};
 
 /* fn(pkt, arg).  return true if pkt belongs to if */
 typedef bool(*ifpkt_cb_t) (struct sk_buff *, void *);
@@ -194,28 +191,6 @@ extern int brcmu_iovar_lencheck(const struct brcmu_iovar *table, void *arg,
 #define IOVT_BUFFER	8	/* buffer is size-checked as per minlen */
 #define BCM_IOVT_VALID(type) (((unsigned int)(type)) <= IOVT_BUFFER)
 
-/* Initializer for IOV type strings */
-#define BCM_IOV_TYPE_INIT { \
-	"void", \
-	"bool", \
-	"s8", \
-	"u8", \
-	"s16", \
-	"u16", \
-	"s32", \
-	"u32", \
-	"buffer", \
-	"" }
-
-#define BCM_IOVT_IS_INT(type) (\
-	(type == IOVT_BOOL) || \
-	(type == IOVT_INT8) || \
-	(type == IOVT_UINT8) || \
-	(type == IOVT_INT16) || \
-	(type == IOVT_UINT16) || \
-	(type == IOVT_INT32) || \
-	(type == IOVT_UINT32))
-
 /* ** driver/apps-shared section ** */
 
 #define BCME_STRLEN 		64	/* Max string length for BCM errors */
@@ -298,38 +273,6 @@ struct brcmu_tlv {
 
 #define ETHER_ADDR_STR_LEN	18	/* 18-bytes of Ethernet address buffer length */
 
-/* crypto utility function */
-/* 128-bit xor: *dst = *src1 xor *src2. dst1, src1 and src2 may have any alignment */
-	static inline void
-	 xor_128bit_block(const u8 *src1, const u8 *src2, u8 *dst) {
-		if (
-#ifdef __i386__
-			   1 ||
-#endif
-			   (((unsigned long) src1 | (unsigned long) src2 | (unsigned long) dst) &
-			    3) == 0) {
-			/* ARM CM3 rel time: 1229 (727 if alignment check could be omitted) */
-			/* x86 supports unaligned.  This version runs 6x-9x faster on x86. */
-			((u32 *) dst)[0] =
-			    ((const u32 *)src1)[0] ^ ((const u32 *)
-							 src2)[0];
-			((u32 *) dst)[1] =
-			    ((const u32 *)src1)[1] ^ ((const u32 *)
-							 src2)[1];
-			((u32 *) dst)[2] =
-			    ((const u32 *)src1)[2] ^ ((const u32 *)
-							 src2)[2];
-			((u32 *) dst)[3] =
-			    ((const u32 *)src1)[3] ^ ((const u32 *)
-							 src2)[3];
-		} else {
-			/* ARM CM3 rel time: 4668 (4191 if alignment check could be omitted) */
-			int k;
-			for (k = 0; k < 16; k++)
-				dst[k] = src1[k] ^ src2[k];
-		}
-	}
-
 /* externs */
 /* crc */
 extern u8 brcmu_crc8(u8 *p, uint nbytes, u8 crc);
@@ -346,13 +289,6 @@ extern char *brcmu_chipname(uint chipid, char *buf, uint len);
 extern struct brcmu_tlv *brcmu_parse_tlvs(void *buf, int buflen,
 					  uint key);
 
-/* multi-bool data type: set of bools, mbool is true if any is set */
-	typedef u32 mbool;
-#define mboolset(mb, bit)		((mb) |= (bit))	/* set one bool */
-#define mboolclr(mb, bit)		((mb) &= ~(bit))	/* clear one bool */
-#define mboolisset(mb, bit)		(((mb) & (bit)) != 0)	/* true if one bool is set */
-#define	mboolmaskset(mb, mask, val)	((mb) = (((mb) & ~(mask)) | (val)))
-
 /* power conversion */
 extern u16 brcmu_qdbm_to_mw(u8 qdbm);
 extern u8 brcmu_mw_to_qdbm(u16 mw);
-- 
1.7.4.1



  parent reply	other threads:[~2011-06-09 14:45 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-09 14:44 [PATCH 00/21] staging: brcm80211: code cleanup and fullmac bugfix Roland Vossen
2011-06-09 14:44 ` [PATCH 01/21] staging: brcm80211: moved typedefs to decrease header file dependencies Roland Vossen
2011-06-09 14:44 ` Roland Vossen [this message]
2011-06-09 14:44 ` [PATCH 03/21] staging: brcm80211: #include reduction Roland Vossen
2011-06-09 14:44 ` [PATCH 04/21] staging: brcm80211: Remove flags from wl_is_nonetwork Roland Vossen
2011-06-09 14:44 ` [PATCH 05/21] staging: brcm80211: remove 'used' keyword from function ai_ispcie() Roland Vossen
2011-06-09 14:44 ` [PATCH 06/21] staging: brcm80211: remove regs variable from brcms_ioctl function Roland Vossen
2011-06-09 14:44 ` [PATCH 07/21] staging: brcm80211: remove d11regs_t parameter from wlc_tbtt function Roland Vossen
2011-06-09 14:44 ` [PATCH 08/21] staging: brcm80211: remove device id parameter from ai_attach() Roland Vossen
2011-06-09 14:44 ` [PATCH 09/21] staging: brcm80211: remove unused fields from struct si_info Roland Vossen
2011-06-09 14:44 ` [PATCH 10/21] staging: brcm80211: fixed double #include problem Roland Vossen
2011-06-09 14:44 ` [PATCH 11/21] staging: brcm80211: Fix for suspend issue in brcmfmac driver Roland Vossen
2011-06-09 14:44 ` [PATCH 12/21] staging: brcm80211: use __BIG_ENDIAN macro in dma.c Roland Vossen
2011-06-09 23:53   ` Jonas Gorski
2011-06-10  9:52     ` Arend van Spriel
2011-06-10 11:17       ` Jonas Gorski
2011-06-14 17:52         ` Henry Ptasinski
2011-06-28 20:01           ` Greg KH
2011-06-09 14:44 ` [PATCH 13/21] staging: brcm80211: replaced bmac acronym by brcms_b_ Roland Vossen
2011-06-09 14:44 ` [PATCH 14/21] staging: brcm80211: replaced wlc_ by brcms_c_ Roland Vossen
2011-06-09 14:44 ` [PATCH 15/21] staging: brcm80211: removed superfluous forward struct declarations Roland Vossen
2011-06-09 14:44 ` [PATCH 16/21] staging: brcm80211: further replaced wlc_ by brcmsmac_c_ Roland Vossen
2011-06-09 14:44 ` [PATCH 17/21] staging: brcm80211: replaced wlc_ by brcms_c_, part 2 Roland Vossen
2011-06-09 14:44 ` [PATCH 18/21] staging: brcm80211: remove checkpatch errors found in fullmac Roland Vossen
2011-06-09 14:44 ` [PATCH 19/21] staging: brcm80211: fix checkpatch errors from main.c Roland Vossen
2011-06-09 14:45 ` [PATCH 20/21] staging: brcm80211: fix checkpatch errors in brcmsmac driver Roland Vossen
2011-06-09 14:45 ` [PATCH 21/21] staging: brcm80211: change wl_cfg80211_suspend corresponding to cfg80211 Roland Vossen
2011-06-09 18:54 ` [PATCH 00/21] staging: brcm80211: code cleanup and fullmac bugfix Dan Carpenter
2011-06-09 21:30   ` julie Sullivan
2011-06-10  8:07     ` Roland Vossen
2011-06-12 18:23       ` julie Sullivan
2011-06-12 19:00         ` Dan Carpenter
2011-06-12 21:04           ` julie Sullivan
2011-06-14 17:50           ` Henry Ptasinski
2011-06-24 22:38             ` Henry Ptasinski
2011-06-09 23:02 ` Julian Calaby

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=1307630701-9170-3-git-send-email-rvossen@broadcom.com \
    --to=rvossen@broadcom.com \
    --cc=devel@linuxdriverproject.org \
    --cc=gregkh@suse.de \
    --cc=linux-wireless@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).