Commit ddb6a1aa authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://kernel.bkbits.net/gregkh/linux/linus-2.6

into home.osdl.org:/home/torvalds/v2.5/linux
parents 8d33ca95 e0efa2db
......@@ -245,7 +245,7 @@ static void st5481B_mode(struct st5481_bcs *bcs, int mode)
}
}
static int __devinit st5481_setup_b_out(struct st5481_bcs *bcs)
static int st5481_setup_b_out(struct st5481_bcs *bcs)
{
struct usb_device *dev = bcs->adapter->usb_dev;
struct usb_host_interface *altsetting;
......@@ -279,7 +279,7 @@ static void st5481_release_b_out(struct st5481_bcs *bcs)
st5481_release_isocpipes(b_out->urb);
}
int __devinit st5481_setup_b(struct st5481_bcs *bcs)
int st5481_setup_b(struct st5481_bcs *bcs)
{
int retval;
......
......@@ -788,7 +788,7 @@ static void ttusb_iso_irq(struct urb *urb, struct pt_regs *ptregs)
}
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
usb_submit_urb(urb, GFP_KERNEL);
usb_submit_urb(urb, GFP_ATOMIC);
#endif
}
......
......@@ -147,7 +147,8 @@ int usb_hcd_pci_probe (struct pci_dev *dev, const struct pci_device_id *id)
hcd->description = driver->description;
hcd->pdev = dev;
hcd->self.bus_name = pci_name(dev);
hcd->product_desc = dev->dev.name;
if (hcd->product_desc == NULL)
hcd->product_desc = "USB Host Controller";
hcd->self.controller = &dev->dev;
hcd->controller = hcd->self.controller;
......
......@@ -1307,7 +1307,8 @@ static void hcd_endpoint_disable (struct usb_device *udev, int endpoint)
/* ignore urbs for other endpoints */
if (usb_pipeendpoint (tmp) != epnum)
continue;
if ((tmp ^ endpoint) & USB_DIR_IN)
/* NOTE assumption that only ep0 is a control endpoint */
if (epnum != 0 && ((tmp ^ endpoint) & USB_DIR_IN))
continue;
/* another cpu may be in hcd, spinning on hcd_data_lock
......
......@@ -597,10 +597,8 @@ static int hub_probe(struct usb_interface *intf, const struct usb_device_id *id)
usb_set_intfdata (intf, hub);
if (hub_configure(hub, endpoint) >= 0) {
strcpy (intf->dev.name, "Hub");
if (hub_configure(hub, endpoint) >= 0)
return 0;
}
hub_disconnect (intf);
return -ENODEV;
......
......@@ -978,68 +978,6 @@ int usb_set_address(struct usb_device *dev)
return retval;
}
/* improve on the default device description, if we can ... and
* while we're at it, maybe show the vendor and product strings.
*/
static void set_device_description (struct usb_device *dev)
{
void *buf;
int mfgr = dev->descriptor.iManufacturer;
int prod = dev->descriptor.iProduct;
int vendor_id = dev->descriptor.idVendor;
int product_id = dev->descriptor.idProduct;
char *mfgr_str, *prod_str;
/* set default; keep it if there are no strings, or kmalloc fails */
sprintf (dev->dev.name, "USB device %04x:%04x",
vendor_id, product_id);
if (!(buf = kmalloc(256 * 2, GFP_KERNEL)))
return;
prod_str = (char *) buf;
mfgr_str = (char *) buf + 256;
if (prod && usb_string (dev, prod, prod_str, 256) > 0) {
#ifdef DEBUG
dev_printk (KERN_INFO, &dev->dev, "Product: %s\n", prod_str);
#endif
} else {
prod_str = 0;
}
if (mfgr && usb_string (dev, mfgr, mfgr_str, 256) > 0) {
#ifdef DEBUG
dev_printk (KERN_INFO, &dev->dev, "Manufacturer: %s\n", mfgr_str);
#endif
} else {
mfgr_str = 0;
}
/* much like pci ... describe as either:
* - both strings: 'product descr (vendor descr)'
* - product only: 'product descr (USB device vvvv:pppp)'
* - vendor only: 'USB device vvvv:pppp (vendor descr)'
* - neither string: 'USB device vvvv:pppp'
*/
if (prod_str && mfgr_str) {
snprintf(dev->dev.name, sizeof dev->dev.name,
"%s (%s)", prod_str, mfgr_str);
} else if (prod_str) {
snprintf(dev->dev.name, sizeof dev->dev.name,
"%s (USB device %04x:%04x)",
prod_str, vendor_id, product_id);
} else if (mfgr_str) {
snprintf(dev->dev.name, sizeof dev->dev.name,
"USB device %04x:%04x (%s)",
vendor_id, product_id, mfgr_str);
}
kfree(buf);
}
/*
* By the time we get here, we chose a new device address
* and is in the default state. We need to identify the thing and
......@@ -1056,7 +994,7 @@ static void set_device_description (struct usb_device *dev)
#define SET_ADDRESS_RETRYS 2
int usb_new_device(struct usb_device *dev, struct device *parent)
{
int err = 0;
int err = -EINVAL;
int i;
int j;
......@@ -1098,7 +1036,7 @@ int usb_new_device(struct usb_device *dev, struct device *parent)
i = 8;
break;
default:
return -EINVAL;
goto fail;
}
dev->epmaxpacketin [0] = i;
dev->epmaxpacketout[0] = i;
......@@ -1112,12 +1050,10 @@ int usb_new_device(struct usb_device *dev, struct device *parent)
wait_ms(200);
}
if (err < 0) {
dev_err(&dev->dev, "USB device not accepting new address=%d (error=%d)\n",
dev_err(&dev->dev,
"device not accepting address %d, error %d\n",
dev->devnum, err);
dev->state = USB_STATE_DEFAULT;
clear_bit(dev->devnum, dev->bus->devmap.devicemap);
dev->devnum = -1;
return 1;
goto fail;
}
wait_ms(10); /* Let the SET_ADDRESS settle */
......@@ -1130,13 +1066,8 @@ int usb_new_device(struct usb_device *dev, struct device *parent)
}
if (err < 8) {
if (err < 0)
dev_err(&dev->dev, "USB device not responding, giving up (error=%d)\n", err);
else
dev_err(&dev->dev, "USB device descriptor short read (expected %i, got %i)\n", 8, err);
clear_bit(dev->devnum, dev->bus->devmap.devicemap);
dev->devnum = -1;
return 1;
dev_err(&dev->dev, "device descriptor read/8, error %d\n", err);
goto fail;
}
if (dev->speed == USB_SPEED_FULL) {
dev->epmaxpacketin [0] = dev->descriptor.bMaxPacketSize0;
......@@ -1147,43 +1078,41 @@ int usb_new_device(struct usb_device *dev, struct device *parent)
err = usb_get_device_descriptor(dev);
if (err < (signed)sizeof(dev->descriptor)) {
if (err < 0)
dev_err(&dev->dev, "unable to get device descriptor (error=%d)\n", err);
else
dev_err(&dev->dev, "USB device descriptor short read (expected %Zi, got %i)\n",
sizeof(dev->descriptor), err);
clear_bit(dev->devnum, dev->bus->devmap.devicemap);
dev->devnum = -1;
return 1;
dev_err(&dev->dev, "device descriptor read/all, error %d\n", err);
goto fail;
}
err = usb_get_configuration(dev);
if (err < 0) {
dev_err(&dev->dev, "unable to get device %d configuration (error=%d)\n",
dev->devnum, err);
clear_bit(dev->devnum, dev->bus->devmap.devicemap);
dev->devnum = -1;
return 1;
goto fail;
}
/* we set the default configuration here */
/* choose and set the configuration here */
if (dev->descriptor.bNumConfigurations != 1) {
dev_info(&dev->dev,
"configuration #%d chosen from %d choices\n",
dev->config[0].desc.bConfigurationValue,
dev->descriptor.bNumConfigurations);
}
err = usb_set_configuration(dev, dev->config[0].desc.bConfigurationValue);
if (err) {
dev_err(&dev->dev, "failed to set device %d default configuration (error=%d)\n",
dev->devnum, err);
clear_bit(dev->devnum, dev->bus->devmap.devicemap);
dev->devnum = -1;
return 1;
goto fail;
}
/* USB device state == configured ... tell the world! */
dev_dbg(&dev->dev, "new device strings: Mfr=%d, Product=%d, SerialNumber=%d\n",
dev->descriptor.iManufacturer, dev->descriptor.iProduct, dev->descriptor.iSerialNumber);
set_device_description (dev);
#ifdef DEBUG
if (dev->descriptor.iProduct)
usb_show_string(dev, "Product", dev->descriptor.iProduct);
if (dev->descriptor.iManufacturer)
usb_show_string(dev, "Manufacturer", dev->descriptor.iManufacturer);
if (dev->descriptor.iSerialNumber)
usb_show_string(dev, "SerialNumber", dev->descriptor.iSerialNumber);
#endif
......@@ -1191,7 +1120,7 @@ int usb_new_device(struct usb_device *dev, struct device *parent)
/* put into sysfs, with device and config specific files */
err = device_add (&dev->dev);
if (err)
return err;
goto fail;
usb_create_driverfs_dev_files (dev);
/* Register all of the interfaces for this device with the driver core.
......@@ -1208,20 +1137,6 @@ int usb_new_device(struct usb_device *dev, struct device *parent)
sprintf (&interface->dev.bus_id[0], "%d-%s:%d",
dev->bus->busnum, dev->devpath,
desc->bInterfaceNumber);
if (!desc->iInterface
|| usb_string (dev, desc->iInterface,
interface->dev.name,
sizeof interface->dev.name) <= 0) {
/* typically devices won't bother with interface
* descriptions; this is the normal case. an
* interface's driver might describe it better.
* (also: iInterface is per-altsetting ...)
*/
sprintf (&interface->dev.name[0],
"usb-%s-%s interface %d",
dev->bus->bus_name, dev->devpath,
desc->bInterfaceNumber);
}
dev_dbg (&dev->dev, "%s - registering interface %s\n", __FUNCTION__, interface->dev.bus_id);
device_add (&interface->dev);
usb_create_driverfs_intf_files (interface);
......@@ -1231,6 +1146,12 @@ int usb_new_device(struct usb_device *dev, struct device *parent)
usbfs_add_device(dev);
return 0;
fail:
dev->state = USB_STATE_DEFAULT;
clear_bit(dev->devnum, dev->bus->devmap.devicemap);
dev->devnum = -1;
usb_put_dev(dev);
return err;
}
/**
......
......@@ -2535,7 +2535,6 @@ static int net2280_probe (struct pci_dev *pdev, const struct pci_device_id *id)
dev->gadget.ops = &net2280_ops;
strcpy (dev->gadget.dev.bus_id, pci_name(pdev));
strcpy (dev->gadget.dev.name, pdev->dev.name);
dev->gadget.dev.parent = &pdev->dev;
dev->gadget.dev.dma_mask = pdev->dev.dma_mask;
dev->gadget.name = driver_name;
......
......@@ -591,8 +591,8 @@ show_registers (struct class_device *class_dev, char *buf)
/* Capability Registers */
i = readw (&ehci->caps->hci_version);
temp = snprintf (next, size,
"%s\nEHCI %x.%02x, hcd state %d (driver " DRIVER_VERSION ")\n",
hcd->pdev->dev.name,
"PCI device %s\nEHCI %x.%02x, hcd state %d (driver " DRIVER_VERSION ")\n",
pci_name(hcd->pdev),
i >> 8, i & 0x0ff, ehci->hcd.state);
size -= temp;
next += temp;
......
......@@ -44,6 +44,7 @@ static struct usb_hcd *ehci_hcd_alloc (void)
kmalloc (sizeof (struct ehci_hcd), GFP_KERNEL);
if (ehci != 0) {
memset (ehci, 0, sizeof (struct ehci_hcd));
ehci->hcd.product_desc = "EHCI Host Controller";
return &ehci->hcd;
}
return 0;
......
......@@ -412,8 +412,7 @@ static int hc_reset (struct ohci_hcd *ohci)
/* Disable HC interrupts */
writel (OHCI_INTR_MIE, &ohci->regs->intrdisable);
ohci_dbg (ohci, "USB HC reset_hc %s: ctrl = 0x%x ;\n",
hcd_to_bus (&ohci->hcd)->bus_name,
ohci_dbg (ohci, "reset, control = 0x%x\n",
readl (&ohci->regs->control));
/* Reset USB (needed by some controllers); RemoteWakeupConnected
......@@ -548,7 +547,6 @@ static int hc_start (struct ohci_hcd *ohci)
return -ENODEV;
}
create_debug_files (ohci);
return 0;
}
......
......@@ -30,6 +30,7 @@ static struct usb_hcd *ohci_hcd_alloc (void)
ohci = (struct ohci_hcd *) kmalloc (sizeof *ohci, GFP_KERNEL);
if (ohci != 0) {
memset (ohci, 0, sizeof (struct ohci_hcd));
ohci->hcd.product_desc = "OHCI Host Controller";
return &ohci->hcd;
}
return 0;
......
......@@ -101,6 +101,7 @@ ohci_pci_start (struct usb_hcd *hcd)
ohci_stop (hcd);
return -EBUSY;
}
create_debug_files (ohci);
#ifdef DEBUG
ohci_dump (ohci, 1);
......@@ -115,6 +116,7 @@ static int ohci_pci_suspend (struct usb_hcd *hcd, u32 state)
struct ohci_hcd *ohci = hcd_to_ohci (hcd);
unsigned long flags;
u16 cmd;
u32 tmp;
if ((ohci->hc_control & OHCI_CTRL_HCFS) != OHCI_USB_OPER) {
ohci_dbg (ohci, "can't suspend (state is %s)\n",
......@@ -156,15 +158,12 @@ static int ohci_pci_suspend (struct usb_hcd *hcd, u32 state)
(void) readl (&ohci->regs->control);
mdelay (500); /* No schedule here ! */
switch (readl (&ohci->regs->control) & OHCI_CTRL_HCFS) {
tmp = readl (&ohci->regs->control) | OHCI_CTRL_HCFS;
switch (tmp) {
case OHCI_USB_RESET:
ohci_dbg (ohci, "suspend->reset ?\n");
break;
case OHCI_USB_RESUME:
ohci_dbg (ohci, "suspend->resume ?\n");
break;
case OHCI_USB_OPER:
ohci_dbg (ohci, "suspend->operational ?\n");
ohci_err (ohci, "can't suspend; hcfs %d\n", tmp);
break;
case OHCI_USB_SUSPEND:
ohci_dbg (ohci, "suspended\n");
......
......@@ -296,6 +296,7 @@ ohci_sa1111_start (struct usb_hcd *hcd)
ohci_stop (hcd);
return -EBUSY;
}
create_debug_files (ohci);
#ifdef DEBUG
ohci_dump (ohci, 1);
......
......@@ -2460,6 +2460,7 @@ static struct usb_hcd *uhci_hcd_alloc(void)
return NULL;
memset(uhci, 0, sizeof(*uhci));
uhci->hcd.product_desc = "UHCI Host Controller";
return &uhci->hcd;
}
......
......@@ -121,7 +121,7 @@ static int get_registers(pegasus_t * pegasus, __u16 indx, __u16 size,
char *buffer;
DECLARE_WAITQUEUE(wait, current);
buffer = kmalloc(size, GFP_DMA);
buffer = kmalloc(size, GFP_KERNEL);
if (!buffer) {
warn("%s: looks like we're out of memory", __FUNCTION__);
return -ENOMEM;
......@@ -170,7 +170,7 @@ static int set_registers(pegasus_t * pegasus, __u16 indx, __u16 size,
char *buffer;
DECLARE_WAITQUEUE(wait, current);
buffer = kmalloc(size, GFP_DMA);
buffer = kmalloc(size, GFP_KERNEL);
if (!buffer) {
warn("%s: looks like we're out of memory", __FUNCTION__);
return -ENOMEM;
......@@ -218,7 +218,7 @@ static int set_register(pegasus_t * pegasus, __u16 indx, __u8 data)
char *tmp;
DECLARE_WAITQUEUE(wait, current);
tmp = kmalloc(1, GFP_DMA);
tmp = kmalloc(1, GFP_KERNEL);
if (!tmp) {
warn("%s: looks like we're out of memory", __FUNCTION__);
return -ENOMEM;
......
......@@ -51,6 +51,7 @@
#define PHY_GO 0x40
#define MII_TIMEOUT 10
#define INTBUFSIZE 8
#define RTL8150_REQT_READ 0xc0
#define RTL8150_REQT_WRITE 0x40
......@@ -98,7 +99,7 @@ struct rtl8150 {
struct usb_ctrlrequest dr;
int intr_interval;
u16 rx_creg;
u8 intr_buff[8];
u8 *intr_buff;
u8 phy;
};
......@@ -646,7 +647,7 @@ static int rtl8150_open(struct net_device *netdev)
if ((res = usb_submit_urb(dev->rx_urb, GFP_KERNEL)))
warn("%s: rx_urb submit failed: %d", __FUNCTION__, res);
usb_fill_int_urb(dev->intr_urb, dev->udev, usb_rcvintpipe(dev->udev, 3),
dev->intr_buff, sizeof(dev->intr_buff), intr_callback,
dev->intr_buff, INTBUFSIZE, intr_callback,
dev, dev->intr_interval);
if ((res = usb_submit_urb(dev->intr_urb, GFP_KERNEL)))
warn("%s: intr_urb submit failed: %d", __FUNCTION__, res);
......@@ -790,8 +791,15 @@ static int rtl8150_probe(struct usb_interface *intf,
} else
memset(dev, 0, sizeof(rtl8150_t));
dev->intr_buff = kmalloc(INTBUFSIZE, GFP_KERNEL);
if (!dev->intr_buff) {
kfree(dev);
return -ENOMEM;
}
netdev = alloc_etherdev(0);
if (!netdev) {
kfree(dev->intr_buff);
kfree(dev);
err("Oh boy, out of memory again?!?");
return -ENOMEM;
......@@ -843,6 +851,7 @@ static int rtl8150_probe(struct usb_interface *intf,
out1:
free_all_urbs(dev);
out:
kfree(dev->intr_buff);
kfree(netdev);
kfree(dev);
return -EIO;
......@@ -862,6 +871,7 @@ static void rtl8150_disconnect(struct usb_interface *intf)
if (dev->rx_skb)
dev_kfree_skb(dev->rx_skb);
kfree(dev->netdev);
kfree(dev->intr_buff);
kfree(dev);
}
}
......
......@@ -2048,8 +2048,11 @@ static int usbnet_stop (struct net_device *net)
dev->wait = 0;
remove_wait_queue (&unlink_wakeup, &wait);
// deferred work (task, timer, softirq) must also stop
flush_scheduled_work ();
/* deferred work (task, timer, softirq) must also stop.
* can't flush_scheduled_work() until we drop rtnl (later),
* else workers could deadlock; so make workers a NOP.
*/
dev->flags = 0;
del_timer_sync (&dev->delay);
tasklet_kill (&dev->bh);
......@@ -2488,6 +2491,9 @@ static void usbnet_disconnect (struct usb_interface *intf)
unregister_netdev (dev->net);
/* we don't hold rtnl here ... */
flush_scheduled_work ();
if (dev->driver_info->unbind)
dev->driver_info->unbind (dev, intf);
......
......@@ -17,6 +17,10 @@
* See http://ftdi-usb-sio.sourceforge.net for upto date testing info
* and extra documentation
*
* (05/Aug/2003) Ian Abbott
* Added VID/PID for ID TECH IDT1221U USB to RS-232 adapter.
* VID/PID provided by Steve Briggs.
*
* (23/Jul/2003) Ian Abbott
* Added PIDs for CrystalFontz 547, 633, 631, 635, 640 and 640 from
* Wayne Wylupski.
......@@ -324,6 +328,7 @@ static struct usb_device_id id_table_8U232AM [] = {
{ USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2803_6_PID, 0, 0x3ff) },
{ USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2803_7_PID, 0, 0x3ff) },
{ USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2803_8_PID, 0, 0x3ff) },
{ USB_DEVICE_VER(IDTECH_VID, IDTECH_IDT1221U_PID, 0, 0x3ff) },
{ } /* Terminating entry */
};
......@@ -395,6 +400,7 @@ static struct usb_device_id id_table_FT232BM [] = {
{ USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2803_6_PID, 0x400, 0xffff) },
{ USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2803_7_PID, 0x400, 0xffff) },
{ USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2803_8_PID, 0x400, 0xffff) },
{ USB_DEVICE_VER(IDTECH_VID, IDTECH_IDT1221U_PID, 0x400, 0xffff) },
{ } /* Terminating entry */
};
......@@ -479,6 +485,7 @@ static struct usb_device_id id_table_combined [] = {
{ USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803_6_PID) },
{ USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803_7_PID) },
{ USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803_8_PID) },
{ USB_DEVICE(IDTECH_VID, IDTECH_IDT1221U_PID) },
{ USB_DEVICE_VER(FTDI_VID, FTDI_HE_TIRA1_PID, 0x400, 0xffff) },
{ USB_DEVICE(FTDI_VID, FTDI_USB_UIRT_PID) },
{ } /* Terminating entry */
......
......@@ -127,6 +127,12 @@
/* http://home.earthlink.net/~jrhees/USBUIRT/index.htm */
#define FTDI_USB_UIRT_PID 0xF850 /* Product Id */
/*
* Definitions for ID TECH (www.idt-net.com) devices
*/
#define IDTECH_VID 0x0ACD /* ID TECH Vendor ID */
#define IDTECH_IDT1221U_PID 0x0300 /* IDT1221U USB to RS-232 adapter */
/* Commands */
#define FTDI_SIO_RESET 0 /* Reset the port */
#define FTDI_SIO_MODEM_CTRL 1 /* Set the modem control register */
......
......@@ -285,12 +285,6 @@ static void pl2303_set_termios (struct usb_serial_port *port, struct termios *ol
buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6]);
i = usb_control_msg (serial->dev, usb_sndctrlpipe (serial->dev, 0),
VENDOR_WRITE_REQUEST, VENDOR_WRITE_REQUEST_TYPE,
0, 1, NULL, 0, 100);
dbg ("0x40:1:0:1 %d", i);
if (cflag & CSIZE) {
switch (cflag & CSIZE) {
case CS5: buf[6] = 5; break;
......@@ -428,9 +422,6 @@ static int pl2303_open (struct usb_serial_port *port, struct file *filp)
SOUP (VENDOR_WRITE_REQUEST_TYPE, VENDOR_WRITE_REQUEST, 0x0404, 1);
FISH (VENDOR_READ_REQUEST_TYPE, VENDOR_READ_REQUEST, 0x8484, 0);
FISH (VENDOR_READ_REQUEST_TYPE, VENDOR_READ_REQUEST, 0x8383, 0);
SOUP (VENDOR_WRITE_REQUEST_TYPE, VENDOR_WRITE_REQUEST, 0, 1);
SOUP (VENDOR_WRITE_REQUEST_TYPE, VENDOR_WRITE_REQUEST, 1, 0xc0);
SOUP (VENDOR_WRITE_REQUEST_TYPE, VENDOR_WRITE_REQUEST, 2, 4);
/* Setup termios */
if (port->tty) {
......
......@@ -1238,7 +1238,6 @@ int usb_serial_probe(struct usb_interface *interface,
port->dev.bus = &usb_serial_bus_type;
snprintf (&port->dev.bus_id[0], sizeof(port->dev.bus_id), "ttyUSB%d", port->number);
snprintf (&port->dev.name[0], sizeof(port->dev.name), "usb serial port %d", port->number);
dbg ("%s - registering %s", __FUNCTION__, port->dev.bus_id);
device_register (&port->dev);
}
......
......@@ -55,7 +55,6 @@ int usb_stor_euscsi_init(struct us_data *us)
0x0C, USB_RECIP_INTERFACE | USB_TYPE_VENDOR,
0x01, 0x0, us->iobuf, 0x1, 5*HZ);
US_DEBUGP("-- result is %d\n", result);
US_DEBUGP("-- data afterwards is %d\n", us->iobuf[0]);
return 0;
}
......@@ -67,6 +66,7 @@ int usb_stor_ucr61s2b_init(struct us_data *us)
struct bulk_cb_wrap *bcb = (struct bulk_cb_wrap*) us->iobuf;
struct bulk_cs_wrap *bcs = (struct bulk_cs_wrap*) us->iobuf;
int res, partial;
static char init_string[] = "\xec\x0a\x06\x00$PCCHIPS";
US_DEBUGP("Sending UCR-61S2B initialization packet...\n");
......@@ -74,9 +74,9 @@ int usb_stor_ucr61s2b_init(struct us_data *us)
bcb->Tag = 0;
bcb->DataTransferLength = cpu_to_le32(0);
bcb->Flags = bcb->Lun = 0;
bcb->Length = sizeof(UCR61S2B_INIT);
bcb->Length = sizeof(init_string) - 1;
memset(bcb->CDB, 0, sizeof(bcb->CDB));
memcpy(bcb->CDB, UCR61S2B_INIT, sizeof(UCR61S2B_INIT));
memcpy(bcb->CDB, init_string, sizeof(init_string) - 1);
res = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe, bcb,
US_BULK_CB_WRAP_LEN, &partial);
......
......@@ -49,8 +49,6 @@ int usb_stor_euscsi_init(struct us_data *us);
int sddr09_init(struct us_data *us);
#endif
#define UCR61S2B_INIT "\xec\x0a\x06\x00$PCCHIPS"
/* This function is required to activate all four slots on the UCR-61S2B
* flash reader */
int usb_stor_ucr61s2b_init(struct us_data *us);
......@@ -526,7 +526,6 @@ static int skel_probe(struct usb_interface *interface, const struct usb_device_i
init_MUTEX (&dev->sem);
dev->udev = udev;
dev->interface = interface;
dev->minor = interface->minor;
/* set up the endpoint information */
/* check out the endpoints */
......@@ -606,6 +605,7 @@ static int skel_probe(struct usb_interface *interface, const struct usb_device_i
goto error;
}
dev->minor = interface->minor;
/* let the user know what node this device is now attached to */
info ("USB Skeleton device now attached to USBSkel-%d", dev->minor);
......@@ -641,9 +641,6 @@ static void skel_disconnect(struct usb_interface *interface)
down (&dev->sem);
/* disable open() */
interface->minor = -1;
minor = dev->minor;
/* give back our minor */
......
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