Commit 71a17fca authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://linuxusb.bkbits.net/linus-2.5

into penguin.transmeta.com:/home/penguin/torvalds/repositories/kernel/linux
parents 7da8fe56 d2c44523
......@@ -1901,11 +1901,11 @@ W: http://pegasus2.sourceforge.net/
S: Maintained
USB SCANNER DRIVER
P: Brian Beattie
M: beattie@beattie-home.net
P: Henning Meier-Geinitz
M: henning@meier-geinitz.de
L: linux-usb-users@lists.sourceforge.net
L: linux-usb-devel@lists.sourceforge.net
W: http://www.beattie-home.net/linux
W: http://www.meier-geinitz.de/kernel/
S: Maintained
USB SE401 DRIVER
......
......@@ -1107,20 +1107,17 @@ static int usb_bluetooth_probe (struct usb_interface *intf,
return -EIO;
}
MOD_INC_USE_COUNT;
info("USB Bluetooth converter detected");
for (minor = 0; minor < BLUETOOTH_TTY_MINORS && bluetooth_table[minor]; ++minor)
;
if (bluetooth_table[minor]) {
err("No more free Bluetooth devices");
MOD_DEC_USE_COUNT;
return -ENODEV;
}
if (!(bluetooth = kmalloc(sizeof(struct usb_bluetooth), GFP_KERNEL))) {
err("Out of memory");
MOD_DEC_USE_COUNT;
return -ENOMEM;
}
......@@ -1236,7 +1233,6 @@ static int usb_bluetooth_probe (struct usb_interface *intf,
/* free up any memory that we allocated */
kfree (bluetooth);
MOD_DEC_USE_COUNT;
return -EIO;
}
......@@ -1295,13 +1291,12 @@ static void usb_bluetooth_disconnect(struct usb_interface *intf)
} else {
info("device disconnected");
}
MOD_DEC_USE_COUNT;
}
static struct tty_driver bluetooth_tty_driver = {
.magic = TTY_DRIVER_MAGIC,
.owner = THIS_MODULE,
.driver_name = "usb-bluetooth",
.name = "usb/ttub/%d",
.major = BLUETOOTH_TTY_MAJOR,
......
......@@ -320,8 +320,6 @@ static int acm_tty_open(struct tty_struct *tty, struct file *filp)
tty->driver_data = acm;
acm->tty = tty;
MOD_INC_USE_COUNT;
lock_kernel();
if (acm->used++) {
......@@ -369,7 +367,6 @@ static void acm_tty_close(struct tty_struct *tty, struct file *filp)
kfree(acm);
}
}
MOD_DEC_USE_COUNT;
}
static int acm_tty_write(struct tty_struct *tty, int from_user, const unsigned char *buf, int count)
......@@ -724,6 +721,7 @@ static struct termios *acm_tty_termios_locked[ACM_TTY_MINORS];
static struct tty_driver acm_tty_driver = {
.magic = TTY_DRIVER_MAGIC,
.owner = THIS_MODULE,
.driver_name = "acm",
.name = "usb/acm/%d",
.major = ACM_TTY_MAJOR,
......
......@@ -1001,7 +1001,7 @@ static int hcd_submit_urb (struct urb *urb, int mem_flags)
spin_lock_irqsave (&hcd_data_lock, flags);
if (HCD_IS_RUNNING (hcd->state) && hcd->state != USB_STATE_QUIESCING) {
usb_get_dev (urb->dev);
list_add (&urb->urb_list, &dev->urb_list);
list_add_tail (&urb->urb_list, &dev->urb_list);
status = 0;
} else {
INIT_LIST_HEAD (&urb->urb_list);
......
......@@ -353,9 +353,6 @@ extern struct semaphore usb_bus_list_lock;
extern void usb_bus_get (struct usb_bus *bus);
extern void usb_bus_put (struct usb_bus *bus);
extern struct usb_interface *usb_ifnum_to_if (struct usb_device *dev,
unsigned ifnum);
extern int usb_find_interface_driver (struct usb_device *dev,
struct usb_interface *interface);
......
......@@ -1484,6 +1484,7 @@ EXPORT_SYMBOL(usb_interface_claimed);
EXPORT_SYMBOL(usb_driver_release_interface);
EXPORT_SYMBOL(usb_match_id);
EXPORT_SYMBOL(usb_find_interface);
EXPORT_SYMBOL(usb_ifnum_to_if);
EXPORT_SYMBOL(usb_new_device);
EXPORT_SYMBOL(usb_reset_device);
......
......@@ -82,7 +82,7 @@
#endif
#define DRIVER_AUTHOR "Johan Verrept, Johan.Verrept@advalvas.be"
#define DRIVER_DESC "Driver for the Alcatel Speed Touch USB ADSL modem"
#define DRIVER_DESC "Driver for the Alcatel SpeedTouch USB ADSL modem"
#define DRIVER_VERSION "1.5A"
#define SPEEDTOUCH_VENDORID 0x06b9
......@@ -158,7 +158,7 @@ static const char udsl_driver_name[] = "Alcatel SpeedTouch USB";
static DECLARE_MUTEX(udsl_usb_ioctl_lock);
#ifdef DEBUG_PACKET
int udsl_print_packet (const unsigned char *data, int len);
static int udsl_print_packet (const unsigned char *data, int len);
#endif
/*
......@@ -169,8 +169,8 @@ static int udsl_atm_open (struct atm_vcc *vcc, short vpi, int vci);
static void udsl_atm_close (struct atm_vcc *vcc);
static int udsl_atm_ioctl (struct atm_dev *dev, unsigned int cmd, void *arg);
static int udsl_atm_send (struct atm_vcc *vcc, struct sk_buff *skb);
int udsl_atm_proc_read (struct atm_dev *atm_dev, loff_t * pos, char *page);
void udsl_atm_processqueue (unsigned long data);
static int udsl_atm_proc_read (struct atm_dev *atm_dev, loff_t * pos, char *page);
static void udsl_atm_processqueue (unsigned long data);
static struct atmdev_ops udsl_atm_devops = {
.open = udsl_atm_open,
......@@ -190,7 +190,7 @@ struct udsl_atm_dev_data {
static int udsl_usb_probe (struct usb_interface *intf,
const struct usb_device_id *id);
static void udsl_usb_disconnect (struct usb_interface *intf);
int udsl_usb_send_data (struct udsl_instance_data *instance, struct atm_vcc *vcc,
static int udsl_usb_send_data (struct udsl_instance_data *instance, struct atm_vcc *vcc,
struct sk_buff *skb);
static int udsl_usb_ioctl (struct usb_interface *intf, unsigned int code, void *user_data);
static int udsl_usb_cancelsends (struct udsl_instance_data *instance, struct atm_vcc *vcc);
......@@ -213,8 +213,7 @@ static struct usb_driver udsl_usb_driver = {
*
****************************************************************************/
struct atm_dev *udsl_atm_startdevice (struct udsl_instance_data *instance,
struct atmdev_ops *devops)
static struct atm_dev *udsl_atm_startdevice (struct udsl_instance_data *instance, struct atmdev_ops *devops)
{
MOD_INC_USE_COUNT;
instance->atm_dev = atm_dev_register (udsl_driver_name, devops, -1, 0);
......@@ -231,7 +230,7 @@ struct atm_dev *udsl_atm_startdevice (struct udsl_instance_data *instance,
return instance->atm_dev;
}
void udsl_atm_stopdevice (struct udsl_instance_data *instance)
static void udsl_atm_stopdevice (struct udsl_instance_data *instance)
{
struct atm_vcc *walk;
struct sk_buff *skb;
......@@ -257,7 +256,7 @@ void udsl_atm_stopdevice (struct udsl_instance_data *instance)
MOD_DEC_USE_COUNT;
}
void udsl_atm_set_mac (struct udsl_instance_data *instance, const char mac[6])
static void udsl_atm_set_mac (struct udsl_instance_data *instance, const char mac[6])
{
if (!instance->atm_dev)
return;
......@@ -270,7 +269,7 @@ void udsl_atm_set_mac (struct udsl_instance_data *instance, const char mac[6])
* ATM helper functions
*
****************************************************************************/
struct sk_buff *udsl_atm_alloc_tx (struct atm_vcc *vcc, unsigned int size)
static struct sk_buff *udsl_atm_alloc_tx (struct atm_vcc *vcc, unsigned int size)
{
struct atmsar_vcc_data *atmsar_vcc =
((struct udsl_atm_dev_data *) vcc->dev_data)->atmsar_vcc;
......@@ -282,13 +281,13 @@ struct sk_buff *udsl_atm_alloc_tx (struct atm_vcc *vcc, unsigned int size)
return NULL;
}
int udsl_atm_proc_read (struct atm_dev *atm_dev, loff_t * pos, char *page)
static int udsl_atm_proc_read (struct atm_dev *atm_dev, loff_t * pos, char *page)
{
struct udsl_instance_data *instance = atm_dev->dev_data;
int left = *pos;
if (!left--)
return sprintf (page, "Speed Touch USB %s-%s (%02x:%02x:%02x:%02x:%02x:%02x)\n",
return sprintf (page, "SpeedTouch USB %s-%s (%02x:%02x:%02x:%02x:%02x:%02x)\n",
instance->usb_dev->bus->bus_name, instance->usb_dev->devpath,
atm_dev->esi[0], atm_dev->esi[1], atm_dev->esi[2],
atm_dev->esi[3], atm_dev->esi[4], atm_dev->esi[5]);
......@@ -317,7 +316,7 @@ int udsl_atm_proc_read (struct atm_dev *atm_dev, loff_t * pos, char *page)
* ATM DATA functions
*
****************************************************************************/
int udsl_atm_send (struct atm_vcc *vcc, struct sk_buff *skb)
static int udsl_atm_send (struct atm_vcc *vcc, struct sk_buff *skb)
{
struct udsl_atm_dev_data *dev_data = vcc->dev_data;
struct udsl_instance_data *instance = vcc->dev->dev_data;
......@@ -361,7 +360,7 @@ int udsl_atm_send (struct atm_vcc *vcc, struct sk_buff *skb)
};
void udsl_atm_processqueue (unsigned long data)
static void udsl_atm_processqueue (unsigned long data)
{
struct udsl_instance_data *instance = (struct udsl_instance_data *) data;
struct atmsar_vcc_data *atmsar_vcc = NULL;
......@@ -420,7 +419,7 @@ void udsl_atm_processqueue (unsigned long data)
* SAR driver entries
*
****************************************************************************/
int udsl_atm_open (struct atm_vcc *vcc, short vpi, int vci)
static int udsl_atm_open (struct atm_vcc *vcc, short vpi, int vci)
{
struct udsl_atm_dev_data *dev_data;
struct udsl_instance_data *instance = vcc->dev->dev_data;
......@@ -458,7 +457,7 @@ int udsl_atm_open (struct atm_vcc *vcc, short vpi, int vci)
return 0;
}
void udsl_atm_close (struct atm_vcc *vcc)
static void udsl_atm_close (struct atm_vcc *vcc)
{
struct udsl_atm_dev_data *dev_data = vcc->dev_data;
struct udsl_instance_data *instance = vcc->dev->dev_data;
......@@ -485,7 +484,7 @@ void udsl_atm_close (struct atm_vcc *vcc)
return;
};
int udsl_atm_ioctl (struct atm_dev *dev, unsigned int cmd, void *arg)
static int udsl_atm_ioctl (struct atm_dev *dev, unsigned int cmd, void *arg)
{
switch (cmd) {
case ATM_QUERYLOOP:
......@@ -538,7 +537,7 @@ static void udsl_usb_send_data_complete (struct urb *urb, struct pt_regs *regs)
ctx->skb, ctx->skb->len, err);
}
int udsl_usb_cancelsends (struct udsl_instance_data *instance, struct atm_vcc *vcc)
static int udsl_usb_cancelsends (struct udsl_instance_data *instance, struct atm_vcc *vcc)
{
int i;
......@@ -558,7 +557,7 @@ int udsl_usb_cancelsends (struct udsl_instance_data *instance, struct atm_vcc *v
}
/**** send ******/
int udsl_usb_send_data (struct udsl_instance_data *instance, struct atm_vcc *vcc,
static int udsl_usb_send_data (struct udsl_instance_data *instance, struct atm_vcc *vcc,
struct sk_buff *skb)
{
int err, i;
......@@ -622,7 +621,7 @@ int udsl_usb_send_data (struct udsl_instance_data *instance, struct atm_vcc *vcc
}
/********* receive *******/
void udsl_usb_data_receive (struct urb *urb, struct pt_regs *regs)
static void udsl_usb_data_receive (struct urb *urb, struct pt_regs *regs)
{
struct udsl_data_ctx *ctx;
struct udsl_instance_data *instance;
......@@ -676,7 +675,7 @@ void udsl_usb_data_receive (struct urb *urb, struct pt_regs *regs)
return;
};
int udsl_usb_data_init (struct udsl_instance_data *instance)
static int udsl_usb_data_init (struct udsl_instance_data *instance)
{
int i, succes;
......@@ -775,6 +774,8 @@ static int udsl_usb_data_exit (struct udsl_instance_data *instance)
ctx->skb = NULL;
}
tasklet_kill (&instance->recvqueue_tasklet);
for (i = 0; i < UDSL_NUMBER_SND_URBS; i++) {
struct udsl_usb_send_data_context *ctx = &(instance->send_ctx[i]);
......@@ -926,7 +927,7 @@ module_exit(udsl_usb_cleanup);
*
*******************************************************************************/
int udsl_print_packet (const unsigned char *data, int len)
static int udsl_print_packet (const unsigned char *data, int len)
{
unsigned char buffer[256];
int i = 0, j = 0;
......
......@@ -23,6 +23,17 @@
#include "usb-serial.h"
static ssize_t show_dev (struct device *dev, char *buf)
{
struct usb_serial_port *port= to_usb_serial_port(dev);
dev_t base;
port = to_usb_serial_port(dev);
base = MKDEV(SERIAL_TTY_MAJOR, port->number);
return sprintf(buf, "%04x\n", base);
}
static DEVICE_ATTR(dev, S_IRUGO, show_dev, NULL);
static int usb_serial_device_match (struct device *dev, struct device_driver *drv)
{
......@@ -79,6 +90,8 @@ static int usb_serial_device_probe (struct device *dev)
minor = port->number;
tty_register_device (&usb_serial_tty_driver, minor);
device_create_file (dev, &dev_attr_dev);
dev_info(&port->serial->dev->dev,
"%s converter now attached to ttyUSB%d (or usb/tts/%d for devfs)\n",
driver->name, minor, minor);
......
......@@ -1257,6 +1257,7 @@ void usb_serial_disconnect(struct usb_interface *interface)
struct tty_driver usb_serial_tty_driver = {
.magic = TTY_DRIVER_MAGIC,
.owner = THIS_MODULE,
.driver_name = "usbserial",
#ifndef CONFIG_DEVFS_FS
.name = "ttyUSB",
......
......@@ -88,8 +88,12 @@ static int detect(struct SHT *sht)
/* register the host */
us->host = scsi_register(sht, sizeof(us));
if (us->host) {
struct usb_interface *iface;
us->host->hostdata[0] = (unsigned long)us;
us->host_no = us->host->host_no;
iface = usb_ifnum_to_if(us->pusb_dev, us->ifnum);
if (iface)
scsi_set_device(us->host, &iface->dev);
return 1;
}
......
......@@ -277,7 +277,9 @@ extern void usb_driver_release_interface(struct usb_driver *driver,
const struct usb_device_id *usb_match_id(struct usb_interface *interface,
const struct usb_device_id *id);
struct usb_interface *usb_find_interface(struct usb_driver *drv, kdev_t kdev);
extern struct usb_interface *usb_find_interface(struct usb_driver *drv, kdev_t kdev);
extern struct usb_interface *usb_ifnum_to_if(struct usb_device *dev, unsigned ifnum);
/**
* usb_make_path - returns stable device path in the usb tree
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment