aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/bcm43xx/Makefile87
-rw-r--r--drivers/net/wireless/bcm43xx/bcm43xx.h6
-rw-r--r--drivers/net/wireless/bcm43xx/bcm43xx_debugfs.c8
-rw-r--r--drivers/net/wireless/bcm43xx/bcm43xx_main.c11
4 files changed, 14 insertions, 98 deletions
diff --git a/drivers/net/wireless/bcm43xx/Makefile b/drivers/net/wireless/bcm43xx/Makefile
index 98d4efb1d12a..3e5ed77835e2 100644
--- a/drivers/net/wireless/bcm43xx/Makefile
+++ b/drivers/net/wireless/bcm43xx/Makefile
@@ -1,87 +1,8 @@
1# Makefile for bcm43xx driver 1obj-$(CONFIG_BCM43XX) += bcm43xx.o
2bcm43xx-obj-$(CONFIG_BCM43XX_DEBUG) += bcm43xx_debugfs.o
2 3
3VERSION := 0.0.1 4bcm43xx-objs := bcm43xx_main.o bcm43xx_dma.o \
4RELEASE_NAME := bcm43xx-$(VERSION)
5
6# Optional path, where the SoftMAC subsystem is located.
7# You may set SOFTMAC_DIR in your bashrc, for example.
8SOFTMAC_DIR ?=
9
10KVER := $(shell uname -r)
11KDIR ?= /lib/modules/$(KVER)/build
12PWD := $(shell pwd)
13MODPATH := $(DESTDIR)/lib/modules/$(KVER)/kernel/drivers/net/bcm43xx
14
15# Comment/uncomment to enable/disable debugging
16DEBUG = y
17
18
19ifeq ($(DEBUG),y)
20DEBUGFS_OBJ = bcm43xx_debugfs.o
21CFLAGS += -O2 -DCONFIG_BCM43XX_DEBUG
22else
23DEBUGFS_OBJ =
24CFLAGS += -O2
25endif
26
27CFLAGS += -DBCM43xx_VERSION=$(VERSION) -I/lib/modules/$(KVER)/include
28ifneq ($(SOFTMAC_DIR),)
29CPPFLAGS := -I$(SOFTMAC_DIR) $(CPPFLAGS)
30endif
31
32ifneq ($(KERNELRELEASE),)
33# call from kernel build system
34
35obj-m := bcm43xx.o
36bcm43xx-objs := bcm43xx_main.o bcm43xx_dma.o $(DEBUGFS_OBJ) \
37 bcm43xx_radio.o bcm43xx_phy.o \ 5 bcm43xx_radio.o bcm43xx_phy.o \
38 bcm43xx_power.o bcm43xx_wx.o \ 6 bcm43xx_power.o bcm43xx_wx.o \
39 bcm43xx_pio.o bcm43xx_ilt.o \ 7 bcm43xx_pio.o bcm43xx_ilt.o \
40 bcm43xx_leds.o 8 bcm43xx_leds.o $(bcm43xx-obj-y)
41
42else
43
44default: modules
45
46modules:
47 $(MAKE) -C $(KDIR) M=$(PWD) modules
48
49install: bcm43xx.ko
50 install -d $(MODPATH)
51 install -m 644 -c bcm43xx.ko $(MODPATH)
52 /sbin/depmod -a
53
54uninstall:
55 rm -rf $(MODPATH)
56 /sbin/depmod -a
57
58endif
59
60clean:
61 find . \( -name '*.ko' -o -name '*.o' -o -name '.tmp_versions' -o -name '*~' -o -name '.*.cmd' \
62 -o -name '*.mod.c' -o -name '*.tar.bz2' -o -name '*.rej' -o -name '*.orig' \)\
63 -print | xargs rm -Rf
64
65depend .depend dep:
66 $(CC) $(CFLAGS) -M *.c > .depend
67
68ifeq (.depend,$(wildcard .depend))
69include .depend
70endif
71
72DISTFILES = $(shell find . \( -not -name '.' \) -print | grep -v "\.tar\.bz2" | grep -v "\/\." )
73DISTDIR = $(RELEASE_NAME)
74
75release: clean
76 @rm -rf $(DISTDIR)
77 @mkdir $(DISTDIR)
78 @chmod 777 $(DISTDIR)
79 @for file in $(DISTFILES); do \
80 if test -d $$file; then \
81 mkdir $(DISTDIR)/$$file; \
82 else \
83 cp -p $$file $(DISTDIR)/$$file; \
84 fi; \
85 done
86 @tar -c $(DISTDIR) | bzip2 -9 > $(RELEASE_NAME).tar.bz2
87 @rm -rf $(DISTDIR)
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx.h b/drivers/net/wireless/bcm43xx/bcm43xx.h
index 38e75ed2b654..7b97d8bf79ed 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx.h
+++ b/drivers/net/wireless/bcm43xx/bcm43xx.h
@@ -17,14 +17,10 @@
17#include "bcm43xx_leds.h" 17#include "bcm43xx_leds.h"
18 18
19 19
20#define DRV_NAME __stringify(KBUILD_MODNAME) 20#define PFX KBUILD_MODNAME ": "
21#define DRV_VERSION __stringify(BCM43xx_VERSION)
22#define BCM43xx_DRIVER_NAME DRV_NAME " driver " DRV_VERSION
23#define PFX DRV_NAME ": "
24 21
25#define BCM43xx_SWITCH_CORE_MAX_RETRIES 10 22#define BCM43xx_SWITCH_CORE_MAX_RETRIES 10
26#define BCM43xx_IRQWAIT_MAX_RETRIES 50 23#define BCM43xx_IRQWAIT_MAX_RETRIES 50
27#define BCM43xx_TX_TIMEOUT (10 * HZ)
28 24
29#define BCM43xx_IO_SIZE 8192 25#define BCM43xx_IO_SIZE 8192
30#define BCM43xx_REG_ACTIVE_CORE 0x80 26#define BCM43xx_REG_ACTIVE_CORE 0x80
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_debugfs.c b/drivers/net/wireless/bcm43xx/bcm43xx_debugfs.c
index f8cfc84ca0da..5a7dc43cd676 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx_debugfs.c
+++ b/drivers/net/wireless/bcm43xx/bcm43xx_debugfs.c
@@ -141,7 +141,7 @@ static ssize_t drvinfo_read_file(struct file *file, char __user *userbuf,
141 down(&big_buffer_sem); 141 down(&big_buffer_sem);
142 142
143 /* This is where the information is written to the "driver" file */ 143 /* This is where the information is written to the "driver" file */
144 fappend(BCM43xx_DRIVER_NAME "\n"); 144 fappend(KBUILD_MODNAME " driver\n");
145 fappend("Compiled at: %s %s\n", __DATE__, __TIME__); 145 fappend("Compiled at: %s %s\n", __DATE__, __TIME__);
146 146
147 res = simple_read_from_buffer(userbuf, count, ppos, buf, pos); 147 res = simple_read_from_buffer(userbuf, count, ppos, buf, pos);
@@ -433,12 +433,12 @@ void bcm43xx_debugfs_log_txstat(struct bcm43xx_private *bcm,
433void bcm43xx_debugfs_init(void) 433void bcm43xx_debugfs_init(void)
434{ 434{
435 memset(&fs, 0, sizeof(fs)); 435 memset(&fs, 0, sizeof(fs));
436 fs.root = debugfs_create_dir(DRV_NAME, NULL); 436 fs.root = debugfs_create_dir(KBUILD_MODNAME, NULL);
437 if (!fs.root) 437 if (!fs.root)
438 printk(KERN_ERR PFX "debugfs: creating \"" DRV_NAME "\" subdir failed!\n"); 438 printk(KERN_ERR PFX "debugfs: creating \"" KBUILD_MODNAME "\" subdir failed!\n");
439 fs.dentry_driverinfo = debugfs_create_file("driver", 0444, fs.root, NULL, &drvinfo_fops); 439 fs.dentry_driverinfo = debugfs_create_file("driver", 0444, fs.root, NULL, &drvinfo_fops);
440 if (!fs.dentry_driverinfo) 440 if (!fs.dentry_driverinfo)
441 printk(KERN_ERR PFX "debugfs: creating \"" DRV_NAME "/driver\" failed!\n"); 441 printk(KERN_ERR PFX "debugfs: creating \"" KBUILD_MODNAME "/driver\" failed!\n");
442} 442}
443 443
444void bcm43xx_debugfs_exit(void) 444void bcm43xx_debugfs_exit(void)
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_main.c b/drivers/net/wireless/bcm43xx/bcm43xx_main.c
index 4b4e60a22c0b..cfb0f0a485a7 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx_main.c
+++ b/drivers/net/wireless/bcm43xx/bcm43xx_main.c
@@ -2471,7 +2471,7 @@ static int bcm43xx_initialize_irq(struct bcm43xx_private *bcm)
2471 } 2471 }
2472#endif 2472#endif
2473 res = request_irq(bcm->irq, bcm43xx_interrupt_handler, 2473 res = request_irq(bcm->irq, bcm43xx_interrupt_handler,
2474 SA_SHIRQ, DRV_NAME, bcm); 2474 SA_SHIRQ, KBUILD_MODNAME, bcm);
2475 if (res) { 2475 if (res) {
2476 printk(KERN_ERR PFX "Cannot register IRQ%d\n", bcm->irq); 2476 printk(KERN_ERR PFX "Cannot register IRQ%d\n", bcm->irq);
2477 return -EFAULT; 2477 return -EFAULT;
@@ -3809,7 +3809,7 @@ static int bcm43xx_attach_board(struct bcm43xx_private *bcm)
3809 } 3809 }
3810#endif 3810#endif
3811 3811
3812 err = pci_request_regions(pci_dev, DRV_NAME); 3812 err = pci_request_regions(pci_dev, KBUILD_MODNAME);
3813 if (err) { 3813 if (err) {
3814 printk(KERN_ERR PFX 3814 printk(KERN_ERR PFX
3815 "could not access PCI resources (%i)\n", err); 3815 "could not access PCI resources (%i)\n", err);
@@ -4389,12 +4389,11 @@ static int __devinit bcm43xx_init_one(struct pci_dev *pdev,
4389#endif 4389#endif
4390 net_dev->wireless_handlers = &bcm43xx_wx_handlers_def; 4390 net_dev->wireless_handlers = &bcm43xx_wx_handlers_def;
4391 net_dev->irq = pdev->irq; 4391 net_dev->irq = pdev->irq;
4392 net_dev->watchdog_timeo = BCM43xx_TX_TIMEOUT;
4393 4392
4394 /* initialize the bcm43xx_private struct */ 4393 /* initialize the bcm43xx_private struct */
4395 bcm = bcm43xx_priv(net_dev); 4394 bcm = bcm43xx_priv(net_dev);
4396 memset(bcm, 0, sizeof(*bcm)); 4395 memset(bcm, 0, sizeof(*bcm));
4397 wq = create_workqueue(DRV_NAME "_wq"); 4396 wq = create_workqueue(KBUILD_MODNAME "_wq");
4398 if (!wq) { 4397 if (!wq) {
4399 err = -ENOMEM; 4398 err = -ENOMEM;
4400 goto err_free_netdev; 4399 goto err_free_netdev;
@@ -4567,7 +4566,7 @@ static int bcm43xx_resume(struct pci_dev *pdev)
4567#endif /* CONFIG_PM */ 4566#endif /* CONFIG_PM */
4568 4567
4569static struct pci_driver bcm43xx_pci_driver = { 4568static struct pci_driver bcm43xx_pci_driver = {
4570 .name = BCM43xx_DRIVER_NAME, 4569 .name = KBUILD_MODNAME,
4571 .id_table = bcm43xx_pci_tbl, 4570 .id_table = bcm43xx_pci_tbl,
4572 .probe = bcm43xx_init_one, 4571 .probe = bcm43xx_init_one,
4573 .remove = __devexit_p(bcm43xx_remove_one), 4572 .remove = __devexit_p(bcm43xx_remove_one),
@@ -4579,7 +4578,7 @@ static struct pci_driver bcm43xx_pci_driver = {
4579 4578
4580static int __init bcm43xx_init(void) 4579static int __init bcm43xx_init(void)
4581{ 4580{
4582 printk(KERN_INFO BCM43xx_DRIVER_NAME "\n"); 4581 printk(KERN_INFO KBUILD_MODNAME " driver\n");
4583 bcm43xx_debugfs_init(); 4582 bcm43xx_debugfs_init();
4584 return pci_register_driver(&bcm43xx_pci_driver); 4583 return pci_register_driver(&bcm43xx_pci_driver);
4585} 4584}