forked from Minki/linux
[PATCH] bcm43xx: Fix makefile. Remove all the "out-of-tree" stuff.
Signed-off-by: Michael Buesch <mbuesch@freenet.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
6f3e2045ca
commit
65f3f19120
@ -1,87 +1,8 @@
|
||||
# Makefile for bcm43xx driver
|
||||
obj-$(CONFIG_BCM43XX) += bcm43xx.o
|
||||
bcm43xx-obj-$(CONFIG_BCM43XX_DEBUG) += bcm43xx_debugfs.o
|
||||
|
||||
VERSION := 0.0.1
|
||||
RELEASE_NAME := bcm43xx-$(VERSION)
|
||||
|
||||
# Optional path, where the SoftMAC subsystem is located.
|
||||
# You may set SOFTMAC_DIR in your bashrc, for example.
|
||||
SOFTMAC_DIR ?=
|
||||
|
||||
KVER := $(shell uname -r)
|
||||
KDIR ?= /lib/modules/$(KVER)/build
|
||||
PWD := $(shell pwd)
|
||||
MODPATH := $(DESTDIR)/lib/modules/$(KVER)/kernel/drivers/net/bcm43xx
|
||||
|
||||
# Comment/uncomment to enable/disable debugging
|
||||
DEBUG = y
|
||||
|
||||
|
||||
ifeq ($(DEBUG),y)
|
||||
DEBUGFS_OBJ = bcm43xx_debugfs.o
|
||||
CFLAGS += -O2 -DCONFIG_BCM43XX_DEBUG
|
||||
else
|
||||
DEBUGFS_OBJ =
|
||||
CFLAGS += -O2
|
||||
endif
|
||||
|
||||
CFLAGS += -DBCM43xx_VERSION=$(VERSION) -I/lib/modules/$(KVER)/include
|
||||
ifneq ($(SOFTMAC_DIR),)
|
||||
CPPFLAGS := -I$(SOFTMAC_DIR) $(CPPFLAGS)
|
||||
endif
|
||||
|
||||
ifneq ($(KERNELRELEASE),)
|
||||
# call from kernel build system
|
||||
|
||||
obj-m := bcm43xx.o
|
||||
bcm43xx-objs := bcm43xx_main.o bcm43xx_dma.o $(DEBUGFS_OBJ) \
|
||||
bcm43xx-objs := bcm43xx_main.o bcm43xx_dma.o \
|
||||
bcm43xx_radio.o bcm43xx_phy.o \
|
||||
bcm43xx_power.o bcm43xx_wx.o \
|
||||
bcm43xx_pio.o bcm43xx_ilt.o \
|
||||
bcm43xx_leds.o
|
||||
|
||||
else
|
||||
|
||||
default: modules
|
||||
|
||||
modules:
|
||||
$(MAKE) -C $(KDIR) M=$(PWD) modules
|
||||
|
||||
install: bcm43xx.ko
|
||||
install -d $(MODPATH)
|
||||
install -m 644 -c bcm43xx.ko $(MODPATH)
|
||||
/sbin/depmod -a
|
||||
|
||||
uninstall:
|
||||
rm -rf $(MODPATH)
|
||||
/sbin/depmod -a
|
||||
|
||||
endif
|
||||
|
||||
clean:
|
||||
find . \( -name '*.ko' -o -name '*.o' -o -name '.tmp_versions' -o -name '*~' -o -name '.*.cmd' \
|
||||
-o -name '*.mod.c' -o -name '*.tar.bz2' -o -name '*.rej' -o -name '*.orig' \)\
|
||||
-print | xargs rm -Rf
|
||||
|
||||
depend .depend dep:
|
||||
$(CC) $(CFLAGS) -M *.c > .depend
|
||||
|
||||
ifeq (.depend,$(wildcard .depend))
|
||||
include .depend
|
||||
endif
|
||||
|
||||
DISTFILES = $(shell find . \( -not -name '.' \) -print | grep -v "\.tar\.bz2" | grep -v "\/\." )
|
||||
DISTDIR = $(RELEASE_NAME)
|
||||
|
||||
release: clean
|
||||
@rm -rf $(DISTDIR)
|
||||
@mkdir $(DISTDIR)
|
||||
@chmod 777 $(DISTDIR)
|
||||
@for file in $(DISTFILES); do \
|
||||
if test -d $$file; then \
|
||||
mkdir $(DISTDIR)/$$file; \
|
||||
else \
|
||||
cp -p $$file $(DISTDIR)/$$file; \
|
||||
fi; \
|
||||
done
|
||||
@tar -c $(DISTDIR) | bzip2 -9 > $(RELEASE_NAME).tar.bz2
|
||||
@rm -rf $(DISTDIR)
|
||||
bcm43xx_leds.o $(bcm43xx-obj-y)
|
||||
|
@ -17,14 +17,10 @@
|
||||
#include "bcm43xx_leds.h"
|
||||
|
||||
|
||||
#define DRV_NAME __stringify(KBUILD_MODNAME)
|
||||
#define DRV_VERSION __stringify(BCM43xx_VERSION)
|
||||
#define BCM43xx_DRIVER_NAME DRV_NAME " driver " DRV_VERSION
|
||||
#define PFX DRV_NAME ": "
|
||||
#define PFX KBUILD_MODNAME ": "
|
||||
|
||||
#define BCM43xx_SWITCH_CORE_MAX_RETRIES 10
|
||||
#define BCM43xx_IRQWAIT_MAX_RETRIES 50
|
||||
#define BCM43xx_TX_TIMEOUT (10 * HZ)
|
||||
|
||||
#define BCM43xx_IO_SIZE 8192
|
||||
#define BCM43xx_REG_ACTIVE_CORE 0x80
|
||||
|
@ -141,7 +141,7 @@ static ssize_t drvinfo_read_file(struct file *file, char __user *userbuf,
|
||||
down(&big_buffer_sem);
|
||||
|
||||
/* This is where the information is written to the "driver" file */
|
||||
fappend(BCM43xx_DRIVER_NAME "\n");
|
||||
fappend(KBUILD_MODNAME " driver\n");
|
||||
fappend("Compiled at: %s %s\n", __DATE__, __TIME__);
|
||||
|
||||
res = simple_read_from_buffer(userbuf, count, ppos, buf, pos);
|
||||
@ -433,12 +433,12 @@ void bcm43xx_debugfs_log_txstat(struct bcm43xx_private *bcm,
|
||||
void bcm43xx_debugfs_init(void)
|
||||
{
|
||||
memset(&fs, 0, sizeof(fs));
|
||||
fs.root = debugfs_create_dir(DRV_NAME, NULL);
|
||||
fs.root = debugfs_create_dir(KBUILD_MODNAME, NULL);
|
||||
if (!fs.root)
|
||||
printk(KERN_ERR PFX "debugfs: creating \"" DRV_NAME "\" subdir failed!\n");
|
||||
printk(KERN_ERR PFX "debugfs: creating \"" KBUILD_MODNAME "\" subdir failed!\n");
|
||||
fs.dentry_driverinfo = debugfs_create_file("driver", 0444, fs.root, NULL, &drvinfo_fops);
|
||||
if (!fs.dentry_driverinfo)
|
||||
printk(KERN_ERR PFX "debugfs: creating \"" DRV_NAME "/driver\" failed!\n");
|
||||
printk(KERN_ERR PFX "debugfs: creating \"" KBUILD_MODNAME "/driver\" failed!\n");
|
||||
}
|
||||
|
||||
void bcm43xx_debugfs_exit(void)
|
||||
|
@ -2471,7 +2471,7 @@ static int bcm43xx_initialize_irq(struct bcm43xx_private *bcm)
|
||||
}
|
||||
#endif
|
||||
res = request_irq(bcm->irq, bcm43xx_interrupt_handler,
|
||||
SA_SHIRQ, DRV_NAME, bcm);
|
||||
SA_SHIRQ, KBUILD_MODNAME, bcm);
|
||||
if (res) {
|
||||
printk(KERN_ERR PFX "Cannot register IRQ%d\n", bcm->irq);
|
||||
return -EFAULT;
|
||||
@ -3809,7 +3809,7 @@ static int bcm43xx_attach_board(struct bcm43xx_private *bcm)
|
||||
}
|
||||
#endif
|
||||
|
||||
err = pci_request_regions(pci_dev, DRV_NAME);
|
||||
err = pci_request_regions(pci_dev, KBUILD_MODNAME);
|
||||
if (err) {
|
||||
printk(KERN_ERR PFX
|
||||
"could not access PCI resources (%i)\n", err);
|
||||
@ -4389,12 +4389,11 @@ static int __devinit bcm43xx_init_one(struct pci_dev *pdev,
|
||||
#endif
|
||||
net_dev->wireless_handlers = &bcm43xx_wx_handlers_def;
|
||||
net_dev->irq = pdev->irq;
|
||||
net_dev->watchdog_timeo = BCM43xx_TX_TIMEOUT;
|
||||
|
||||
/* initialize the bcm43xx_private struct */
|
||||
bcm = bcm43xx_priv(net_dev);
|
||||
memset(bcm, 0, sizeof(*bcm));
|
||||
wq = create_workqueue(DRV_NAME "_wq");
|
||||
wq = create_workqueue(KBUILD_MODNAME "_wq");
|
||||
if (!wq) {
|
||||
err = -ENOMEM;
|
||||
goto err_free_netdev;
|
||||
@ -4567,7 +4566,7 @@ static int bcm43xx_resume(struct pci_dev *pdev)
|
||||
#endif /* CONFIG_PM */
|
||||
|
||||
static struct pci_driver bcm43xx_pci_driver = {
|
||||
.name = BCM43xx_DRIVER_NAME,
|
||||
.name = KBUILD_MODNAME,
|
||||
.id_table = bcm43xx_pci_tbl,
|
||||
.probe = bcm43xx_init_one,
|
||||
.remove = __devexit_p(bcm43xx_remove_one),
|
||||
@ -4579,7 +4578,7 @@ static struct pci_driver bcm43xx_pci_driver = {
|
||||
|
||||
static int __init bcm43xx_init(void)
|
||||
{
|
||||
printk(KERN_INFO BCM43xx_DRIVER_NAME "\n");
|
||||
printk(KERN_INFO KBUILD_MODNAME " driver\n");
|
||||
bcm43xx_debugfs_init();
|
||||
return pci_register_driver(&bcm43xx_pci_driver);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user