]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
staging: brcm80211: moved ASSERT logic to fullmac driver
authorRoland Vossen <rvossen@broadcom.com>
Tue, 3 May 2011 09:35:52 +0000 (11:35 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 3 May 2011 19:42:45 +0000 (12:42 -0700)
Code cleanup. Softmac driver does not use ASSERTs anymore.

Cc: devel@linuxdriverproject.org
Cc: linux-wireless@vger.kernel.org
Cc: Brett Rudley <brudley@broadcom.com>
Cc: Henry Ptasinski <henryp@broadcom.com>
Cc: Roland Vossen <rvossen@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/brcm80211/brcmfmac/bcmsdh.c
drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c
drivers/staging/brcm80211/brcmfmac/dhd.h
drivers/staging/brcm80211/brcmfmac/wl_iw.c
drivers/staging/brcm80211/include/bcmdefs.h
drivers/staging/brcm80211/include/bcmutils.h
drivers/staging/brcm80211/util/bcmutils.c

index 67a105ea3f55cadcbb64544c92d75c444214e1c6..3750fcf5a8718dafd0e711e8464dacc6f3659909 100644 (file)
@@ -29,6 +29,8 @@
 #include <sbsdio.h>            /* BRCM sdio device core */
 
 #include <sdio.h>              /* sdio spec */
+#include "dngl_stats.h"
+#include "dhd.h"
 
 #define SDIOH_API_ACCESS_RETRY_LIMIT   2
 const uint bcmsdh_msglevel = BCMSDH_ERROR_VAL;
index c01e0537cdd7db7d59dd52296790a21720498dc6..465f623760f3f4153e82cb7fca033e3a5415bec7 100644 (file)
@@ -43,6 +43,9 @@ extern void dhdsdio_isr(void *args);
 #include <linux/platform_device.h>
 #endif                         /* CONFIG_MACH_SANDGATE2G */
 
+#include "dngl_stats.h"
+#include "dhd.h"
+
 /**
  * SDIO Host Controller info
  */
index a91684e870d41eb4bf5b509d9ddb73dd58c5c9de..2792a4dfe6511ad32a76d092f8ee06d73e6214f7 100644 (file)
@@ -27,6 +27,9 @@
 #include <linux/mmc/sdio_func.h>
 #include <linux/mmc/sdio_ids.h>
 
+#include "dngl_stats.h"
+#include "dhd.h"
+
 #if !defined(SDIO_VENDOR_ID_BROADCOM)
 #define SDIO_VENDOR_ID_BROADCOM                0x02d0
 #endif                         /* !defined(SDIO_VENDOR_ID_BROADCOM) */
index 60cf78213a079ea3f1bbead3727f2ee11f13692c..99c38dd8cb74007e75f5d22e6931a005579763e2 100644 (file)
@@ -397,4 +397,14 @@ extern char nv_path[MOD_PARAM_PATHLEN];
 extern void dhd_wait_for_event(dhd_pub_t *dhd, bool * lockvar);
 extern void dhd_wait_event_wakeup(dhd_pub_t *dhd);
 
+extern u32 g_assert_type;
+
+#ifdef BCMDBG
+#define ASSERT(exp) \
+         do { if (!(exp)) osl_assert(#exp, __FILE__, __LINE__); } while (0)
+extern void osl_assert(char *exp, char *file, int line);
+#else
+#define ASSERT(exp)    do {} while (0)
+#endif  /* defined(BCMDBG) */
+
 #endif                         /* _dhd_h_ */
index 4e4cf36af51c9661ffbd42e4b386981c3dbe6212..a16b46c33d71b8e0e1c80069b7fdb98f505f65e8 100644 (file)
@@ -119,6 +119,9 @@ iscan_info_t *g_iscan;
 
 static const u8 ether_bcast[ETH_ALEN] = {255, 255, 255, 255, 255, 255};
 
+/* Global ASSERT type flag */
+u32 g_assert_type;
+
 static void wl_iw_timerfunc(unsigned long data);
 static void wl_iw_set_event_mask(struct net_device *dev);
 static int wl_iw_iscan(iscan_info_t *iscan, wlc_ssid_t *ssid, u16 action);
@@ -3744,3 +3747,50 @@ void wl_iw_detach(void)
 
        g_scan = NULL;
 }
+
+#if defined(BCMDBG)
+void osl_assert(char *exp, char *file, int line)
+{
+       char tempbuf[256];
+       char *basename;
+
+       basename = strrchr(file, '/');
+       /* skip the '/' */
+       if (basename)
+               basename++;
+
+       if (!basename)
+               basename = file;
+
+       snprintf(tempbuf, 256,
+                "assertion \"%s\" failed: file \"%s\", line %d\n", exp,
+                basename, line);
+
+       /*
+        * Print assert message and give it time to
+        * be written to /var/log/messages
+        */
+       if (!in_interrupt()) {
+               const int delay = 3;
+               printk(KERN_ERR "%s", tempbuf);
+               printk(KERN_ERR "panic in %d seconds\n", delay);
+               set_current_state(TASK_INTERRUPTIBLE);
+               schedule_timeout(delay * HZ);
+       }
+
+       switch (g_assert_type) {
+       case 0:
+               panic(KERN_ERR "%s", tempbuf);
+               break;
+       case 1:
+               printk(KERN_ERR "%s", tempbuf);
+               BUG();
+               break;
+       case 2:
+               printk(KERN_ERR "%s", tempbuf);
+               break;
+       default:
+               break;
+       }
+}
+#endif                         /* defined(BCMDBG) */
index 22a389e1d511c4a8ce5fe85bc272b756a60299cd..0d7d97b9293280c9c088fc242d940fbdd23e74a8 100644 (file)
@@ -114,12 +114,6 @@ typedef struct {
 
 #define BCMEXTRAHDROOM 172
 
-#ifdef BCMDBG
-#ifndef BCMDBG_ASSERT
-#define BCMDBG_ASSERT
-#endif /* BCMDBG_ASSERT */
-#endif /* BCMDBG */
-
 /* Macros for doing definition and get/set of bitfields
  * Usage example, e.g. a three-bit field (bits 4-6):
  *    #define <NAME>_M BITFIELD_MASK(3)
index f2e81e5fd9d0a70b72f25bc33c785576074027fa..f114e3d35390646055cf492029ec9f5067cca745 100644 (file)
@@ -257,16 +257,6 @@ extern struct sk_buff *pktq_mdeq(struct pktq *pq, uint prec_bmp, int *prec_out);
 #define REG_MAP(pa, size)       (void *)(0)
 #endif
 
-extern u32 g_assert_type;
-
-#if defined(BCMDBG_ASSERT)
-#define ASSERT(exp) \
-         do { if (!(exp)) osl_assert(#exp, __FILE__, __LINE__); } while (0)
-extern void osl_assert(char *exp, char *file, int line);
-#else
-#define ASSERT(exp)    do {} while (0)
-#endif  /* defined(BCMDBG_ASSERT) */
-
 /* register access macros */
 #if defined(BCMSDIO)
 #ifdef BRCM_FULLMAC
index e23e2e9e8073ffccdbae8ea788da9338a3b7fa00..68a0dc65f158bcf73eb251eb8a69e50cfdcae807 100644 (file)
@@ -28,9 +28,6 @@
 #include <bcmdevs.h>
 #include <proto/802.11.h>
 
-/* Global ASSERT type flag */
-u32 g_assert_type;
-
 struct sk_buff *BCMFASTPATH pkt_buf_get_skb(uint len)
 {
        struct sk_buff *skb;
@@ -1044,50 +1041,3 @@ int bcm_bprintf(struct bcmstrbuf *b, const char *fmt, ...)
 
        return r;
 }
-
-#if defined(BCMDBG_ASSERT)
-void osl_assert(char *exp, char *file, int line)
-{
-       char tempbuf[256];
-       char *basename;
-
-       basename = strrchr(file, '/');
-       /* skip the '/' */
-       if (basename)
-               basename++;
-
-       if (!basename)
-               basename = file;
-
-       snprintf(tempbuf, 256,
-                "assertion \"%s\" failed: file \"%s\", line %d\n", exp,
-                basename, line);
-
-       /*
-        * Print assert message and give it time to
-        * be written to /var/log/messages
-        */
-       if (!in_interrupt()) {
-               const int delay = 3;
-               printk(KERN_ERR "%s", tempbuf);
-               printk(KERN_ERR "panic in %d seconds\n", delay);
-               set_current_state(TASK_INTERRUPTIBLE);
-               schedule_timeout(delay * HZ);
-       }
-
-       switch (g_assert_type) {
-       case 0:
-               panic(KERN_ERR "%s", tempbuf);
-               break;
-       case 1:
-               printk(KERN_ERR "%s", tempbuf);
-               BUG();
-               break;
-       case 2:
-               printk(KERN_ERR "%s", tempbuf);
-               break;
-       default:
-               break;
-       }
-}
-#endif                         /* defined(BCMDBG_ASSERT) */