diff options
author | Arend van Spriel <arend@broadcom.com> | 2011-03-02 21:18:44 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-03-02 19:48:04 -0500 |
commit | 278d927d660b1652cf9a1425b0ce20a385ea9cff (patch) | |
tree | d1de5a58d61a1d7f36cdbb76b8d7e82f6d852fc8 /drivers/staging/brcm80211/util | |
parent | 4fe9042fe05a828293f693405f14b3f6a7898866 (diff) | |
download | linux-278d927d660b1652cf9a1425b0ce20a385ea9cff.tar.gz |
staging: brcm80211: cleanup declaration in osl.h
Several declarations and macro definitions in osl.h are still needed
and therefore moved to bcmutils.h or hnddma.h. The osl_assert function
is moved to bcmutils.c accordingly.
Reviewed-by: Brett Rudley <brudley@broadcom.com>
Reviewed-by: Henry Ptasinski <henryp@broadcom.com>
Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/brcm80211/util')
-rw-r--r-- | drivers/staging/brcm80211/util/bcmutils.c | 54 | ||||
-rw-r--r-- | drivers/staging/brcm80211/util/linux_osl.c | 51 |
2 files changed, 52 insertions, 53 deletions
diff --git a/drivers/staging/brcm80211/util/bcmutils.c b/drivers/staging/brcm80211/util/bcmutils.c index e31151b9dbeb..d066ed7d373f 100644 --- a/drivers/staging/brcm80211/util/bcmutils.c +++ b/drivers/staging/brcm80211/util/bcmutils.c @@ -17,11 +17,12 @@ #include <linux/ctype.h> #include <linux/kernel.h> #include <linux/string.h> -#include <bcmdefs.h> -#include <stdarg.h> #include <linux/module.h> #include <linux/pci.h> #include <linux/netdevice.h> +#include <linux/sched.h> +#include <bcmdefs.h> +#include <stdarg.h> #include <osl.h> #include <bcmutils.h> #include <siutils.h> @@ -29,6 +30,9 @@ #include <bcmdevs.h> #include <proto/802.11.h> +/* Global ASSERT type flag */ +u32 g_assert_type; + struct sk_buff *BCMFASTPATH pkt_buf_get_skb(struct osl_info *osh, uint len) { struct sk_buff *skb; @@ -1091,3 +1095,49 @@ 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) */ diff --git a/drivers/staging/brcm80211/util/linux_osl.c b/drivers/staging/brcm80211/util/linux_osl.c index 70c35e9d31a8..2f76aaf73570 100644 --- a/drivers/staging/brcm80211/util/linux_osl.c +++ b/drivers/staging/brcm80211/util/linux_osl.c @@ -32,9 +32,6 @@ #define OS_HANDLE_MAGIC 0x1234abcd /* Magic # to recognise osh */ #define BCM_MEM_FILENAME_LEN 24 /* Mem. filename length */ -/* Global ASSERT type flag */ -u32 g_assert_type; - struct osl_info *osl_attach(void *pdev, uint bustype) { struct osl_info *osh; @@ -55,51 +52,3 @@ void osl_detach(struct osl_info *osh) ASSERT(osh->magic == OS_HANDLE_MAGIC); kfree(osh); } - -#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; - -#ifdef BCMDBG_ASSERT - 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 /* BCMDBG_ASSERT */ - -} -#endif /* defined(BCMDBG_ASSERT) */ - |