git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git]
/
drivers
/
bluetooth
/
bcm203x.c
diff --git
a/drivers/bluetooth/bcm203x.c
b/drivers/bluetooth/bcm203x.c
index
02a95b2
..
9256985
100644
(file)
--- a/
drivers/bluetooth/bcm203x.c
+++ b/
drivers/bluetooth/bcm203x.c
@@
-2,6
+2,7
@@
*
* Broadcom Blutonium firmware driver
*
*
* Broadcom Blutonium firmware driver
*
+ * Copyright (C) 2003 Maxim Krasnyansky <maxk@qualcomm.com>
* Copyright (C) 2003 Marcel Holtmann <marcel@holtmann.org>
*
*
* Copyright (C) 2003 Marcel Holtmann <marcel@holtmann.org>
*
*
@@
-21,7
+22,6
@@
*
*/
*
*/
-#include <linux/config.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/kernel.h>
@@
-29,7
+29,6
@@
#include <linux/slab.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/slab.h>
#include <linux/types.h>
#include <linux/errno.h>
-#include <linux/timer.h>
#include <linux/device.h>
#include <linux/firmware.h>
#include <linux/device.h>
#include <linux/firmware.h>
@@
-43,7
+42,9
@@
#define BT_DBG(D...)
#endif
#define BT_DBG(D...)
#endif
-#define VERSION "1.0"
+#define VERSION "1.1"
+
+static int ignore = 0;
static struct usb_device_id bcm203x_table[] = {
/* Broadcom Blutonium (BCM2033) */
static struct usb_device_id bcm203x_table[] = {
/* Broadcom Blutonium (BCM2033) */
@@
-54,7
+55,6
@@
static struct usb_device_id bcm203x_table[] = {
MODULE_DEVICE_TABLE(usb, bcm203x_table);
MODULE_DEVICE_TABLE(usb, bcm203x_table);
-
#define BCM203X_ERROR 0
#define BCM203X_RESET 1
#define BCM203X_LOAD_MINIDRV 2
#define BCM203X_ERROR 0
#define BCM203X_RESET 1
#define BCM203X_LOAD_MINIDRV 2
@@
-71,7
+71,7
@@
struct bcm203x_data {
unsigned long state;
unsigned long state;
- struct
timer_list timer
;
+ struct
work_struct work
;
struct urb *urb;
unsigned char *buffer;
struct urb *urb;
unsigned char *buffer;
@@
-81,7
+81,7
@@
struct bcm203x_data {
unsigned int fw_sent;
};
unsigned int fw_sent;
};
-static void bcm203x_complete(struct urb *urb
, struct pt_regs *regs
)
+static void bcm203x_complete(struct urb *urb)
{
struct bcm203x_data *data = urb->context;
struct usb_device *udev = urb->dev;
{
struct bcm203x_data *data = urb->context;
struct usb_device *udev = urb->dev;
@@
-104,7
+104,7
@@
static void bcm203x_complete(struct urb *urb, struct pt_regs *regs)
data->state = BCM203X_SELECT_MEMORY;
data->state = BCM203X_SELECT_MEMORY;
-
mod_timer(&data->timer, jiffies + (HZ / 10)
);
+
schedule_work(&data->work
);
break;
case BCM203X_SELECT_MEMORY:
break;
case BCM203X_SELECT_MEMORY:
@@
-157,9
+157,10
@@
static void bcm203x_complete(struct urb *urb, struct pt_regs *regs)
}
}
}
}
-static void bcm203x_
timer(unsigned long user_data
)
+static void bcm203x_
work(struct work_struct *work
)
{
{
- struct bcm203x_data *data = (struct bcm203x_data *) user_data;
+ struct bcm203x_data *data =
+ container_of(work, struct bcm203x_data, work);
if (usb_submit_urb(data->urb, GFP_ATOMIC) < 0)
BT_ERR("Can't submit URB");
if (usb_submit_urb(data->urb, GFP_ATOMIC) < 0)
BT_ERR("Can't submit URB");
@@
-174,17
+175,15
@@
static int bcm203x_probe(struct usb_interface *intf, const struct usb_device_id
BT_DBG("intf %p id %p", intf, id);
BT_DBG("intf %p id %p", intf, id);
- if (i
ntf->altsetting->desc.bInterfaceNumber != 0
)
+ if (i
gnore || (intf->cur_altsetting->desc.bInterfaceNumber != 0)
)
return -ENODEV;
return -ENODEV;
- data = k
m
alloc(sizeof(*data), GFP_KERNEL);
+ data = k
z
alloc(sizeof(*data), GFP_KERNEL);
if (!data) {
BT_ERR("Can't allocate memory for data structure");
return -ENOMEM;
}
if (!data) {
BT_ERR("Can't allocate memory for data structure");
return -ENOMEM;
}
- memset(data, 0, sizeof(*data));
-
data->udev = udev;
data->state = BCM203X_LOAD_MINIDRV;
data->udev = udev;
data->state = BCM203X_LOAD_MINIDRV;
@@
-235,6
+234,7
@@
static int bcm203x_probe(struct usb_interface *intf, const struct usb_device_id
data->fw_data = kmalloc(firmware->size, GFP_KERNEL);
if (!data->fw_data) {
BT_ERR("Can't allocate memory for firmware image");
data->fw_data = kmalloc(firmware->size, GFP_KERNEL);
if (!data->fw_data) {
BT_ERR("Can't allocate memory for firmware image");
+ release_firmware(firmware);
usb_free_urb(data->urb);
kfree(data->buffer);
kfree(data);
usb_free_urb(data->urb);
kfree(data->buffer);
kfree(data);
@@
-247,13
+247,11
@@
static int bcm203x_probe(struct usb_interface *intf, const struct usb_device_id
release_firmware(firmware);
release_firmware(firmware);
- init_timer(&data->timer);
- data->timer.function = bcm203x_timer;
- data->timer.data = (unsigned long) data;
+ INIT_WORK(&data->work, bcm203x_work);
usb_set_intfdata(intf, data);
usb_set_intfdata(intf, data);
-
mod_timer(&data->timer, jiffies + HZ
);
+
schedule_work(&data->work
);
return 0;
}
return 0;
}
@@
-264,7
+262,7
@@
static void bcm203x_disconnect(struct usb_interface *intf)
BT_DBG("intf %p", intf);
BT_DBG("intf %p", intf);
- usb_
unlink
_urb(data->urb);
+ usb_
kill
_urb(data->urb);
usb_set_intfdata(intf, NULL);
usb_set_intfdata(intf, NULL);
@@
-275,7
+273,6
@@
static void bcm203x_disconnect(struct usb_interface *intf)
}
static struct usb_driver bcm203x_driver = {
}
static struct usb_driver bcm203x_driver = {
- .owner = THIS_MODULE,
.name = "bcm203x",
.probe = bcm203x_probe,
.disconnect = bcm203x_disconnect,
.name = "bcm203x",
.probe = bcm203x_probe,
.disconnect = bcm203x_disconnect,
@@
-303,6
+300,9
@@
static void __exit bcm203x_exit(void)
module_init(bcm203x_init);
module_exit(bcm203x_exit);
module_init(bcm203x_init);
module_exit(bcm203x_exit);
+module_param(ignore, bool, 0644);
+MODULE_PARM_DESC(ignore, "Ignore devices from the matching table");
+
MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>");
MODULE_DESCRIPTION("Broadcom Blutonium firmware driver ver " VERSION);
MODULE_VERSION(VERSION);
MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>");
MODULE_DESCRIPTION("Broadcom Blutonium firmware driver ver " VERSION);
MODULE_VERSION(VERSION);