#include <linux/ptrace.h>
#include <linux/ioport.h>
#include <linux/spinlock.h>
+#include <linux/moduleparam.h>
#include <linux/skbuff.h>
#include <linux/string.h>
#include <linux/serial.h>
#include <linux/serial_reg.h>
+#include <linux/bitops.h>
#include <asm/system.h>
-#include <asm/bitops.h>
#include <asm/io.h>
#include <linux/device.h>
/* ======================== Module parameters ======================== */
-/* Bit map of interrupts to choose from */
-static u_int irq_mask = 0xffff;
-static int irq_list[4] = { -1 };
-
-MODULE_PARM(irq_mask, "i");
-MODULE_PARM(irq_list, "1-4i");
-
MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>, Jose Orlando Pereira <jop@di.uminho.pt>");
MODULE_DESCRIPTION("Bluetooth driver for the 3Com Bluetooth PCMCIA card");
MODULE_LICENSE("GPL");
} bt3c_info_t;
-void bt3c_config(dev_link_t *link);
-void bt3c_release(dev_link_t *link);
-int bt3c_event(event_t event, int priority, event_callback_args_t *args);
+static void bt3c_config(dev_link_t *link);
+static void bt3c_release(dev_link_t *link);
+static int bt3c_event(event_t event, int priority, event_callback_args_t *args);
static dev_info_t dev_info = "bt3c_cs";
-dev_link_t *bt3c_attach(void);
-void bt3c_detach(dev_link_t *);
+static dev_link_t *bt3c_attach(void);
+static void bt3c_detach(dev_link_t *);
static dev_link_t *dev_list = NULL;
#define CONTROL 4
-inline void bt3c_address(unsigned int iobase, unsigned short addr)
+static inline void bt3c_address(unsigned int iobase, unsigned short addr)
{
outb(addr & 0xff, iobase + ADDR_L);
outb((addr >> 8) & 0xff, iobase + ADDR_H);
}
-inline void bt3c_put(unsigned int iobase, unsigned short value)
+static inline void bt3c_put(unsigned int iobase, unsigned short value)
{
outb(value & 0xff, iobase + DATA_L);
outb((value >> 8) & 0xff, iobase + DATA_H);
}
-inline void bt3c_io_write(unsigned int iobase, unsigned short addr, unsigned short value)
+static inline void bt3c_io_write(unsigned int iobase, unsigned short addr, unsigned short value)
{
bt3c_address(iobase, addr);
bt3c_put(iobase, value);
}
-inline unsigned short bt3c_get(unsigned int iobase)
+static inline unsigned short bt3c_get(unsigned int iobase)
{
unsigned short value = inb(iobase + DATA_L);
}
-inline unsigned short bt3c_read(unsigned int iobase, unsigned short addr)
+static inline unsigned short bt3c_read(unsigned int iobase, unsigned short addr)
{
bt3c_address(iobase, addr);
static struct device *bt3c_device(void)
{
- static char *kobj_name = "bt3c";
-
static struct device dev = {
.bus_id = "pcmcia",
};
- dev.kobj.k_name = kmalloc(strlen(kobj_name) + 1, GFP_KERNEL);
- strcpy(dev.kobj.k_name, kobj_name);
+ kobject_set_name(&dev.kobj, "bt3c");
kobject_init(&dev.kobj);
return &dev;
}
-int bt3c_open(bt3c_info_t *info)
+static int bt3c_open(bt3c_info_t *info)
{
const struct firmware *firmware;
struct hci_dev *hdev;
}
-int bt3c_close(bt3c_info_t *info)
+static int bt3c_close(bt3c_info_t *info)
{
struct hci_dev *hdev = info->hdev;
return 0;
}
-dev_link_t *bt3c_attach(void)
+static dev_link_t *bt3c_attach(void)
{
bt3c_info_t *info;
client_reg_t client_reg;
dev_link_t *link;
- int i, ret;
+ int ret;
/* Create new info device */
info = kmalloc(sizeof(*info), GFP_KERNEL);
link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
link->io.NumPorts1 = 8;
link->irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_HANDLE_PRESENT;
- link->irq.IRQInfo1 = IRQ_INFO2_VALID | IRQ_LEVEL_ID;
-
- if (irq_list[0] == -1)
- link->irq.IRQInfo2 = irq_mask;
- else
- for (i = 0; i < 4; i++)
- link->irq.IRQInfo2 |= 1 << irq_list[i];
+ link->irq.IRQInfo1 = IRQ_LEVEL_ID;
link->irq.Handler = bt3c_interrupt;
link->irq.Instance = info;
link->next = dev_list;
dev_list = link;
client_reg.dev_info = &dev_info;
- client_reg.Attributes = INFO_IO_CLIENT | INFO_CARD_SHARE;
client_reg.EventMask =
CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |
}
-void bt3c_detach(dev_link_t *link)
+static void bt3c_detach(dev_link_t *link)
{
bt3c_info_t *info = link->priv;
dev_link_t **linkp;
return get_tuple(handle, tuple, parse);
}
-void bt3c_config(dev_link_t *link)
+static void bt3c_config(dev_link_t *link)
{
- static ioaddr_t base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 };
+ static kio_addr_t base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 };
client_handle_t handle = link->handle;
bt3c_info_t *info = link->priv;
tuple_t tuple;
}
-void bt3c_release(dev_link_t *link)
+static void bt3c_release(dev_link_t *link)
{
bt3c_info_t *info = link->priv;
}
-int bt3c_event(event_t event, int priority, event_callback_args_t *args)
+static int bt3c_event(event_t event, int priority, event_callback_args_t *args)
{
dev_link_t *link = args->client_data;
bt3c_info_t *info = link->priv;
static void __exit exit_bt3c_cs(void)
{
pcmcia_unregister_driver(&bt3c_driver);
-
- /* XXX: this really needs to move into generic code.. */
- while (dev_list != NULL)
- bt3c_detach(dev_list);
+ BUG_ON(dev_list != NULL);
}
module_init(init_bt3c_cs);