Commit f4f8a039 authored by Linus Torvalds's avatar Linus Torvalds

Manual merge of minor syntax clash

parents dc0a81a9 4f70b416
...@@ -95,10 +95,10 @@ HandSpring Visor, Palm USB, and Cli ...@@ -95,10 +95,10 @@ HandSpring Visor, Palm USB, and Cli
Kroah-Hartman at greg@kroah.com Kroah-Hartman at greg@kroah.com
Compaq iPAQ and HP Jornada driver Compaq iPAQ, HP Jornada and Casio EM500 driver
This driver can be used to connect to Compaq iPAQ and HP Jornada PDAs This driver can be used to connect to Compaq iPAQ, HP Jornada and Casio EM500
running Windows CE 3.0 or PocketPC 2002 using a USB cable/cradle. It PDAs running Windows CE 3.0 or PocketPC 2002 using a USB cable/cradle. It
has been tested only on the Compaq H3135, but is rumoured to work on has been tested only on the Compaq H3135, but is rumoured to work on
with the H3600 and later models as well as the Jornada 548 and 568. with the H3600 and later models as well as the Jornada 548 and 568.
With minor modifications, it may work for other CE based handhelds too. With minor modifications, it may work for other CE based handhelds too.
......
...@@ -1141,6 +1141,10 @@ static int sd_init_onedisk(Scsi_Disk * sdkp, int dsk_nr) ...@@ -1141,6 +1141,10 @@ static int sd_init_onedisk(Scsi_Disk * sdkp, int dsk_nr)
* we're only interested in the header anyway, this should * we're only interested in the header anyway, this should
* be fine. * be fine.
* -- Matthew Dharm (mdharm-scsi@one-eyed-alien.net) * -- Matthew Dharm (mdharm-scsi@one-eyed-alien.net)
*
* As it turns out, some devices return an error for
* every MODE_SENSE request except one for page 0.
* So, we should also try that. --aeb
*/ */
memset((void *) &cmd[0], 0, 8); memset((void *) &cmd[0], 0, 8);
...@@ -1161,8 +1165,9 @@ static int sd_init_onedisk(Scsi_Disk * sdkp, int dsk_nr) ...@@ -1161,8 +1165,9 @@ static int sd_init_onedisk(Scsi_Disk * sdkp, int dsk_nr)
the_result = SRpnt->sr_result; the_result = SRpnt->sr_result;
if (the_result) { if (the_result) {
printk(KERN_NOTICE "%s: test WP failed, assume " printk("%s: test WP failed, assume Write Enabled\n",
"Write Enabled\n", nbuff); nbuff);
/* alternatively, try page 0 */
} else { } else {
sdkp->write_prot = ((buffer[2] & 0x80) != 0); sdkp->write_prot = ((buffer[2] & 0x80) != 0);
printk(KERN_NOTICE "%s: Write Protect is %s\n", nbuff, printk(KERN_NOTICE "%s: Write Protect is %s\n", nbuff,
......
...@@ -794,6 +794,7 @@ static void *usblp_probe(struct usb_device *dev, unsigned int ifnum, ...@@ -794,6 +794,7 @@ static void *usblp_probe(struct usb_device *dev, unsigned int ifnum,
{ {
struct usblp *usblp = 0; struct usblp *usblp = 0;
int protocol; int protocol;
int retval;
char name[6]; char name[6];
/* Malloc and start initializing usblp structure so we can use it /* Malloc and start initializing usblp structure so we can use it
...@@ -808,7 +809,12 @@ static void *usblp_probe(struct usb_device *dev, unsigned int ifnum, ...@@ -808,7 +809,12 @@ static void *usblp_probe(struct usb_device *dev, unsigned int ifnum,
init_waitqueue_head(&usblp->wait); init_waitqueue_head(&usblp->wait);
usblp->ifnum = ifnum; usblp->ifnum = ifnum;
if (usb_register_dev(&usblp_driver, 1, &usblp->minor)) { retval = usb_register_dev(&usblp_driver, 1, &usblp->minor);
if (retval) {
if (retval != -ENODEV) {
err("Not able to get a minor for this device.");
goto abort;
}
/* Look for a free usblp_table entry on our own. */ /* Look for a free usblp_table entry on our own. */
while (usblp_table[usblp->minor]) { while (usblp_table[usblp->minor]) {
usblp->minor++; usblp->minor++;
...@@ -871,6 +877,9 @@ static void *usblp_probe(struct usb_device *dev, unsigned int ifnum, ...@@ -871,6 +877,9 @@ static void *usblp_probe(struct usb_device *dev, unsigned int ifnum,
usblp_check_status(usblp, 0); usblp_check_status(usblp, 0);
#endif #endif
/* add a table entry so the device works when advertised */
usblp_table[usblp->minor] = usblp;
/* If we have devfs, create with perms=660. */ /* If we have devfs, create with perms=660. */
sprintf(name, "lp%d", usblp->minor); sprintf(name, "lp%d", usblp->minor);
usblp->devfs = devfs_register(usb_devfs_handle, name, usblp->devfs = devfs_register(usb_devfs_handle, name,
...@@ -886,7 +895,7 @@ static void *usblp_probe(struct usb_device *dev, unsigned int ifnum, ...@@ -886,7 +895,7 @@ static void *usblp_probe(struct usb_device *dev, unsigned int ifnum,
usblp->current_protocol, usblp->dev->descriptor.idVendor, usblp->current_protocol, usblp->dev->descriptor.idVendor,
usblp->dev->descriptor.idProduct); usblp->dev->descriptor.idProduct);
return usblp_table[usblp->minor] = usblp; return usblp;
abort: abort:
if (usblp) { if (usblp) {
......
...@@ -154,12 +154,10 @@ static int ohci_hub_control ( ...@@ -154,12 +154,10 @@ static int ohci_hub_control (
u16 wLength u16 wLength
) { ) {
struct ohci_hcd *ohci = hcd_to_ohci (hcd); struct ohci_hcd *ohci = hcd_to_ohci (hcd);
int ports; int ports = hcd->self.root_hub->maxchild;
u32 temp; u32 temp;
int retval = 0; int retval = 0;
// if (port request)
ports = roothub_a (ohci) & RH_A_NDP;
switch (typeReq) { switch (typeReq) {
case ClearHubFeature: case ClearHubFeature:
switch (wValue) { switch (wValue) {
......
...@@ -569,6 +569,9 @@ td_fill (struct ohci_hcd *ohci, unsigned int info, ...@@ -569,6 +569,9 @@ td_fill (struct ohci_hcd *ohci, unsigned int info,
td->hwNextTD = cpu_to_le32 (td_pt->td_dma); td->hwNextTD = cpu_to_le32 (td_pt->td_dma);
td->hwPSW [0] = cpu_to_le16 ((data & 0x0FFF) | 0xE000); td->hwPSW [0] = cpu_to_le16 ((data & 0x0FFF) | 0xE000);
/* HC might read the TD right after we link it ... */
wmb ();
/* append to queue */ /* append to queue */
td->ed->hwTailP = td->hwNextTD; td->ed->hwTailP = td->hwNextTD;
} }
...@@ -641,8 +644,10 @@ static void td_submit_urb (struct urb *urb) ...@@ -641,8 +644,10 @@ static void td_submit_urb (struct urb *urb)
cnt++; cnt++;
} }
/* start bulk list */ /* start bulk list */
if (!ohci->sleeping) if (!ohci->sleeping) {
wmb ();
writel (OHCI_BLF, &ohci->regs->cmdstatus); writel (OHCI_BLF, &ohci->regs->cmdstatus);
}
break; break;
case PIPE_INTERRUPT: case PIPE_INTERRUPT:
...@@ -654,6 +659,7 @@ static void td_submit_urb (struct urb *urb) ...@@ -654,6 +659,7 @@ static void td_submit_urb (struct urb *urb)
break; break;
case PIPE_CONTROL: case PIPE_CONTROL:
/* control requests don't use toggle state */
info = TD_CC | TD_DP_SETUP | TD_T_DATA0; info = TD_CC | TD_DP_SETUP | TD_T_DATA0;
td_fill (ohci, info, td_fill (ohci, info,
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
...@@ -678,8 +684,10 @@ static void td_submit_urb (struct urb *urb) ...@@ -678,8 +684,10 @@ static void td_submit_urb (struct urb *urb)
: TD_CC | TD_DP_OUT | TD_T_DATA1; : TD_CC | TD_DP_OUT | TD_T_DATA1;
td_fill (ohci, info, data, 0, urb, cnt++); td_fill (ohci, info, data, 0, urb, cnt++);
/* start control list */ /* start control list */
if (!ohci->sleeping) if (!ohci->sleeping) {
wmb ();
writel (OHCI_CLF, &ohci->regs->cmdstatus); writel (OHCI_CLF, &ohci->regs->cmdstatus);
}
break; break;
case PIPE_ISOCHRONOUS: case PIPE_ISOCHRONOUS:
......
...@@ -411,6 +411,7 @@ static void* mdc800_usb_probe (struct usb_device *dev ,unsigned int ifnum, ...@@ -411,6 +411,7 @@ static void* mdc800_usb_probe (struct usb_device *dev ,unsigned int ifnum,
int i,j; int i,j;
struct usb_interface_descriptor *intf_desc; struct usb_interface_descriptor *intf_desc;
int irq_interval=0; int irq_interval=0;
int retval;
dbg ("(mdc800_usb_probe) called."); dbg ("(mdc800_usb_probe) called.");
...@@ -475,7 +476,11 @@ static void* mdc800_usb_probe (struct usb_device *dev ,unsigned int ifnum, ...@@ -475,7 +476,11 @@ static void* mdc800_usb_probe (struct usb_device *dev ,unsigned int ifnum,
down (&mdc800->io_lock); down (&mdc800->io_lock);
usb_register_dev (&mdc800_usb_driver, 1, &mdc800->minor); retval = usb_register_dev (&mdc800_usb_driver, 1, &mdc800->minor);
if (retval && (retval != -ENODEV)) {
err ("Not able to get a minor for this device.");
return 0;
}
mdc800->dev=dev; mdc800->dev=dev;
mdc800->open=0; mdc800->open=0;
......
...@@ -812,6 +812,7 @@ probe_scanner(struct usb_device *dev, unsigned int ifnum, ...@@ -812,6 +812,7 @@ probe_scanner(struct usb_device *dev, unsigned int ifnum,
int ep_cnt; int ep_cnt;
int ix; int ix;
int scn_minor; int scn_minor;
int retval;
char valid_device = 0; char valid_device = 0;
char have_bulk_in, have_bulk_out, have_intr; char have_bulk_in, have_bulk_out, have_intr;
...@@ -953,7 +954,13 @@ probe_scanner(struct usb_device *dev, unsigned int ifnum, ...@@ -953,7 +954,13 @@ probe_scanner(struct usb_device *dev, unsigned int ifnum,
down(&scn_mutex); down(&scn_mutex);
if (usb_register_dev(&scanner_driver, 1, &scn_minor)) { retval = usb_register_dev(&scanner_driver, 1, &scn_minor);
if (retval) {
if (retval != -ENODEV) {
err ("Not able to get a minor for this device.");
up(&scn_mutex);
return NULL;
}
for (scn_minor = 0; scn_minor < SCN_MAX_MNR; scn_minor++) { for (scn_minor = 0; scn_minor < SCN_MAX_MNR; scn_minor++) {
if (!p_scn_table[scn_minor]) if (!p_scn_table[scn_minor])
break; break;
......
...@@ -606,6 +606,7 @@ int hiddev_connect(struct hid_device *hid) ...@@ -606,6 +606,7 @@ int hiddev_connect(struct hid_device *hid)
{ {
struct hiddev *hiddev; struct hiddev *hiddev;
int minor, i; int minor, i;
int retval;
char devfs_name[16]; char devfs_name[16];
for (i = 0; i < hid->maxapplication; i++) for (i = 0; i < hid->maxapplication; i++)
...@@ -615,7 +616,12 @@ int hiddev_connect(struct hid_device *hid) ...@@ -615,7 +616,12 @@ int hiddev_connect(struct hid_device *hid)
if (i == hid->maxapplication) if (i == hid->maxapplication)
return -1; return -1;
if (usb_register_dev (&hiddev_driver, 1, &minor)) { retval = usb_register_dev (&hiddev_driver, 1, &minor);
if (retval) {
if (retval != -ENODEV) {
err ("Not able to get a minor for this device.");
return -1;
}
for (minor = 0; minor < HIDDEV_MINORS && hiddev_table[minor]; minor++); for (minor = 0; minor < HIDDEV_MINORS && hiddev_table[minor]; minor++);
if (minor == HIDDEV_MINORS) { if (minor == HIDDEV_MINORS) {
printk(KERN_ERR "hiddev: no more free hiddev devices\n"); printk(KERN_ERR "hiddev: no more free hiddev devices\n");
......
...@@ -727,6 +727,7 @@ static void *dabusb_probe (struct usb_device *usbdev, unsigned int ifnum, ...@@ -727,6 +727,7 @@ static void *dabusb_probe (struct usb_device *usbdev, unsigned int ifnum,
const struct usb_device_id *id) const struct usb_device_id *id)
{ {
int devnum; int devnum;
int retval;
pdabusb_t s; pdabusb_t s;
dbg("dabusb: probe: vendor id 0x%x, device id 0x%x ifnum:%d", dbg("dabusb: probe: vendor id 0x%x, device id 0x%x ifnum:%d",
...@@ -739,7 +740,10 @@ static void *dabusb_probe (struct usb_device *usbdev, unsigned int ifnum, ...@@ -739,7 +740,10 @@ static void *dabusb_probe (struct usb_device *usbdev, unsigned int ifnum,
if (ifnum != _DABUSB_IF && usbdev->descriptor.idProduct == 0x9999) if (ifnum != _DABUSB_IF && usbdev->descriptor.idProduct == 0x9999)
return NULL; return NULL;
if (usb_register_dev (&dabusb_driver, 1, &devnum)) { retval = usb_register_dev (&dabusb_driver, 1, &devnum);
if (retval) {
if (retval != -ENODEV)
return NULL;
devnum = dabusb_find_struct (); devnum = dabusb_find_struct ();
if (devnum == -1) if (devnum == -1)
return NULL; return NULL;
......
...@@ -3899,6 +3899,17 @@ static void *ibmcam_probe(struct usb_device *dev, unsigned int ifnum, const stru ...@@ -3899,6 +3899,17 @@ static void *ibmcam_probe(struct usb_device *dev, unsigned int ifnum, const stru
return uvd; return uvd;
} }
static struct usb_device_id id_table[] = {
{ USB_DEVICE_VER(IBMCAM_VENDOR_ID, IBMCAM_PRODUCT_ID, 0x0002, 0x0002) }, /* Model 1 */
{ USB_DEVICE_VER(IBMCAM_VENDOR_ID, IBMCAM_PRODUCT_ID, 0x030a, 0x030a) }, /* Model 2 */
{ USB_DEVICE_VER(IBMCAM_VENDOR_ID, IBMCAM_PRODUCT_ID, 0x0301, 0x0301) }, /* Model 3 */
{ USB_DEVICE_VER(IBMCAM_VENDOR_ID, NETCAM_PRODUCT_ID, 0x030a, 0x030a) }, /* Model 4 */
{ USB_DEVICE_VER(IBMCAM_VENDOR_ID, VEO_800C_PRODUCT_ID, 0x030a, 0x030a) }, /* Model 2 */
{ USB_DEVICE_VER(IBMCAM_VENDOR_ID, VEO_800D_PRODUCT_ID, 0x030a, 0x030a) }, /* Model 4 */
{ } /* Terminating entry */
};
/* /*
* ibmcam_init() * ibmcam_init()
* *
...@@ -3926,7 +3937,8 @@ static int __init ibmcam_init(void) ...@@ -3926,7 +3937,8 @@ static int __init ibmcam_init(void)
sizeof(ibmcam_t), sizeof(ibmcam_t),
"ibmcam", "ibmcam",
&cbTbl, &cbTbl,
THIS_MODULE); THIS_MODULE,
id_table);
} }
static void __exit ibmcam_cleanup(void) static void __exit ibmcam_cleanup(void)
...@@ -3934,15 +3946,6 @@ static void __exit ibmcam_cleanup(void) ...@@ -3934,15 +3946,6 @@ static void __exit ibmcam_cleanup(void)
usbvideo_Deregister(&cams); usbvideo_Deregister(&cams);
} }
static __devinitdata struct usb_device_id id_table[] = {
{ USB_DEVICE_VER(IBMCAM_VENDOR_ID, IBMCAM_PRODUCT_ID, 0x0002, 0x0002) }, /* Model 1 */
{ USB_DEVICE_VER(IBMCAM_VENDOR_ID, IBMCAM_PRODUCT_ID, 0x030a, 0x030a) }, /* Model 2 */
{ USB_DEVICE_VER(IBMCAM_VENDOR_ID, IBMCAM_PRODUCT_ID, 0x0301, 0x0301) }, /* Model 3 */
{ USB_DEVICE_VER(IBMCAM_VENDOR_ID, NETCAM_PRODUCT_ID, 0x030a, 0x030a) }, /* Model 4 */
{ USB_DEVICE_VER(IBMCAM_VENDOR_ID, VEO_800C_PRODUCT_ID, 0x030a, 0x030a) }, /* Model 2 */
{ USB_DEVICE_VER(IBMCAM_VENDOR_ID, VEO_800D_PRODUCT_ID, 0x030a, 0x030a) }, /* Model 4 */
{ } /* Terminating entry */
};
MODULE_DEVICE_TABLE(usb, id_table); MODULE_DEVICE_TABLE(usb, id_table);
module_init(ibmcam_init); module_init(ibmcam_init);
......
...@@ -767,7 +767,8 @@ static int __init konicawc_init(void) ...@@ -767,7 +767,8 @@ static int __init konicawc_init(void)
sizeof(struct konicawc), sizeof(struct konicawc),
"konicawc", "konicawc",
&cbTbl, &cbTbl,
THIS_MODULE); THIS_MODULE,
id_table);
} }
......
...@@ -659,6 +659,12 @@ static void *ultracam_probe(struct usb_device *dev, unsigned int ifnum ,const st ...@@ -659,6 +659,12 @@ static void *ultracam_probe(struct usb_device *dev, unsigned int ifnum ,const st
return uvd; return uvd;
} }
static struct usb_device_id id_table[] = {
{ USB_DEVICE(ULTRACAM_VENDOR_ID, ULTRACAM_PRODUCT_ID) },
{ } /* Terminating entry */
};
/* /*
* ultracam_init() * ultracam_init()
* *
...@@ -682,7 +688,8 @@ static int __init ultracam_init(void) ...@@ -682,7 +688,8 @@ static int __init ultracam_init(void)
sizeof(ultracam_t), sizeof(ultracam_t),
"ultracam", "ultracam",
&cbTbl, &cbTbl,
THIS_MODULE); THIS_MODULE,
id_table);
} }
static void __exit ultracam_cleanup(void) static void __exit ultracam_cleanup(void)
...@@ -690,16 +697,7 @@ static void __exit ultracam_cleanup(void) ...@@ -690,16 +697,7 @@ static void __exit ultracam_cleanup(void)
usbvideo_Deregister(&cams); usbvideo_Deregister(&cams);
} }
#if defined(usb_device_id_ver)
static __devinitdata struct usb_device_id id_table[] = {
{ USB_DEVICE(ULTRACAM_VENDOR_ID, ULTRACAM_PRODUCT_ID) },
{ } /* Terminating entry */
};
MODULE_DEVICE_TABLE(usb, id_table); MODULE_DEVICE_TABLE(usb, id_table);
#endif /* defined(usb_device_id_ver) */
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
module_init(ultracam_init); module_init(ultracam_init);
......
...@@ -749,7 +749,8 @@ int usbvideo_register( ...@@ -749,7 +749,8 @@ int usbvideo_register(
const int num_extra, const int num_extra,
const char *driverName, const char *driverName,
const usbvideo_cb_t *cbTbl, const usbvideo_cb_t *cbTbl,
struct module *md ) struct module *md,
const struct usb_device_id *id_table)
{ {
static const char proc[] = "usbvideo_register"; static const char proc[] = "usbvideo_register";
usbvideo_t *cams; usbvideo_t *cams;
...@@ -839,6 +840,7 @@ int usbvideo_register( ...@@ -839,6 +840,7 @@ int usbvideo_register(
cams->usbdrv.name = cams->drvName; cams->usbdrv.name = cams->drvName;
cams->usbdrv.probe = cams->cb.probe; cams->usbdrv.probe = cams->cb.probe;
cams->usbdrv.disconnect = cams->cb.disconnect; cams->usbdrv.disconnect = cams->cb.disconnect;
cams->usbdrv.id_table = id_table;
#if USES_PROC_FS #if USES_PROC_FS
if (cams->uses_procfs) { if (cams->uses_procfs) {
...@@ -1192,7 +1194,7 @@ static int usbvideo_v4l_mmap(struct file *file, struct vm_area_struct *vma) ...@@ -1192,7 +1194,7 @@ static int usbvideo_v4l_mmap(struct file *file, struct vm_area_struct *vma)
if (!CAMERA_IS_OPERATIONAL(uvd)) if (!CAMERA_IS_OPERATIONAL(uvd))
return -EFAULT; return -EFAULT;
if (size > (((2 * uvd->max_frame_size) + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1))) if (size > (((USBVIDEO_NUMFRAMES * uvd->max_frame_size) + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1)))
return -EINVAL; return -EINVAL;
pos = (unsigned long) uvd->fbuf; pos = (unsigned long) uvd->fbuf;
...@@ -1471,12 +1473,14 @@ static int usbvideo_v4l_do_ioctl(struct inode *inode, struct file *file, ...@@ -1471,12 +1473,14 @@ static int usbvideo_v4l_do_ioctl(struct inode *inode, struct file *file,
case VIDIOCGMBUF: case VIDIOCGMBUF:
{ {
struct video_mbuf *vm = arg; struct video_mbuf *vm = arg;
int i;
memset(vm, 0, sizeof(*vm)); memset(vm, 0, sizeof(*vm));
vm->size = uvd->max_frame_size * 2; vm->size = uvd->max_frame_size * USBVIDEO_NUMFRAMES;
vm->frames = 2; vm->frames = USBVIDEO_NUMFRAMES;
vm->offsets[0] = 0; for(i = 0; i < USBVIDEO_NUMFRAMES; i++)
vm->offsets[1] = uvd->max_frame_size; vm->offsets[i] = i * uvd->max_frame_size;
return 0; return 0;
} }
case VIDIOCMCAPTURE: case VIDIOCMCAPTURE:
...@@ -1518,8 +1522,8 @@ static int usbvideo_v4l_do_ioctl(struct inode *inode, struct file *file, ...@@ -1518,8 +1522,8 @@ static int usbvideo_v4l_do_ioctl(struct inode *inode, struct file *file,
} }
return -EINVAL; return -EINVAL;
} }
if ((vm->frame != 0) && (vm->frame != 1)) { if ((vm->frame < 0) || (vm->frame >= USBVIDEO_NUMFRAMES)) {
err("VIDIOCMCAPTURE: vm.frame=%d. !E [0,1]", vm->frame); err("VIDIOCMCAPTURE: vm.frame=%d. !E [0-%d]", vm->frame, USBVIDEO_NUMFRAMES-1);
return -EINVAL; return -EINVAL;
} }
if (uvd->frame[vm->frame].frameState == FrameState_Grabbing) { if (uvd->frame[vm->frame].frameState == FrameState_Grabbing) {
...@@ -1618,7 +1622,7 @@ static int usbvideo_v4l_read(struct file *file, char *buf, ...@@ -1618,7 +1622,7 @@ static int usbvideo_v4l_read(struct file *file, char *buf,
static const char proc[] = "usbvideo_v4l_read"; static const char proc[] = "usbvideo_v4l_read";
uvd_t *uvd = file->private_data; uvd_t *uvd = file->private_data;
int noblock = file->f_flags & O_NONBLOCK; int noblock = file->f_flags & O_NONBLOCK;
int frmx = -1; int frmx = -1, i;
usbvideo_frame_t *frame; usbvideo_frame_t *frame;
if (!CAMERA_IS_OPERATIONAL(uvd) || (buf == NULL)) if (!CAMERA_IS_OPERATIONAL(uvd) || (buf == NULL))
...@@ -1630,14 +1634,13 @@ static int usbvideo_v4l_read(struct file *file, char *buf, ...@@ -1630,14 +1634,13 @@ static int usbvideo_v4l_read(struct file *file, char *buf,
down(&uvd->lock); down(&uvd->lock);
/* See if a frame is completed, then use it. */ /* See if a frame is completed, then use it. */
if ((uvd->frame[0].frameState == FrameState_Done) || for(i = 0; i < USBVIDEO_NUMFRAMES; i++) {
(uvd->frame[0].frameState == FrameState_Done_Hold) || if ((uvd->frame[i].frameState == FrameState_Done) ||
(uvd->frame[0].frameState == FrameState_Error)) { (uvd->frame[i].frameState == FrameState_Done_Hold) ||
frmx = 0; (uvd->frame[i].frameState == FrameState_Error)) {
} else if ((uvd->frame[1].frameState >= FrameState_Done) || frmx = i;
(uvd->frame[1].frameState == FrameState_Done_Hold) || break;
(uvd->frame[1].frameState >= FrameState_Done)) { }
frmx = 1;
} }
/* FIXME: If we don't start a frame here then who ever does? */ /* FIXME: If we don't start a frame here then who ever does? */
...@@ -1652,10 +1655,12 @@ static int usbvideo_v4l_read(struct file *file, char *buf, ...@@ -1652,10 +1655,12 @@ static int usbvideo_v4l_read(struct file *file, char *buf,
* We will need to wait until it becomes cooked, of course. * We will need to wait until it becomes cooked, of course.
*/ */
if (frmx == -1) { if (frmx == -1) {
if (uvd->frame[0].frameState == FrameState_Grabbing) for(i = 0; i < USBVIDEO_NUMFRAMES; i++) {
frmx = 0; if (uvd->frame[i].frameState == FrameState_Grabbing) {
else if (uvd->frame[1].frameState == FrameState_Grabbing) frmx = i;
frmx = 1; break;
}
}
} }
/* /*
...@@ -1753,7 +1758,7 @@ static int usbvideo_v4l_read(struct file *file, char *buf, ...@@ -1753,7 +1758,7 @@ static int usbvideo_v4l_read(struct file *file, char *buf,
/* Mark it as available to be used again. */ /* Mark it as available to be used again. */
uvd->frame[frmx].frameState = FrameState_Unused; uvd->frame[frmx].frameState = FrameState_Unused;
if (usbvideo_NewFrame(uvd, frmx ? 0 : 1)) { if (usbvideo_NewFrame(uvd, (frmx + 1) % USBVIDEO_NUMFRAMES)) {
err("%s: usbvideo_NewFrame failed.", proc); err("%s: usbvideo_NewFrame failed.", proc);
} }
} }
...@@ -1990,7 +1995,7 @@ static int usbvideo_NewFrame(uvd_t *uvd, int framenum) ...@@ -1990,7 +1995,7 @@ static int usbvideo_NewFrame(uvd_t *uvd, int framenum)
uvd->settingsAdjusted = 1; uvd->settingsAdjusted = 1;
} }
n = (framenum - 1 + USBVIDEO_NUMFRAMES) % USBVIDEO_NUMFRAMES; n = (framenum + 1) % USBVIDEO_NUMFRAMES;
if (uvd->frame[n].frameState == FrameState_Ready) if (uvd->frame[n].frameState == FrameState_Ready)
framenum = n; framenum = n;
...@@ -2022,7 +2027,8 @@ static int usbvideo_NewFrame(uvd_t *uvd, int framenum) ...@@ -2022,7 +2027,8 @@ static int usbvideo_NewFrame(uvd_t *uvd, int framenum)
*/ */
if (!(uvd->flags & FLAGS_SEPARATE_FRAMES)) { if (!(uvd->flags & FLAGS_SEPARATE_FRAMES)) {
/* This copies previous frame into this one to mask losses */ /* This copies previous frame into this one to mask losses */
memmove(frame->data, uvd->frame[1-framenum].data, uvd->max_frame_size); int prev = (framenum - 1 + USBVIDEO_NUMFRAMES) % USBVIDEO_NUMFRAMES;
memmove(frame->data, uvd->frame[prev].data, uvd->max_frame_size);
} else { } else {
if (uvd->flags & FLAGS_CLEAN_FRAMES) { if (uvd->flags & FLAGS_CLEAN_FRAMES) {
/* This provides a "clean" frame but slows things down */ /* This provides a "clean" frame but slows things down */
......
...@@ -327,7 +327,8 @@ int usbvideo_register( ...@@ -327,7 +327,8 @@ int usbvideo_register(
const int num_extra, const int num_extra,
const char *driverName, const char *driverName,
const usbvideo_cb_t *cbTable, const usbvideo_cb_t *cbTable,
struct module *md); struct module *md,
const struct usb_device_id *id_table);
uvd_t *usbvideo_AllocateDevice(usbvideo_t *cams); uvd_t *usbvideo_AllocateDevice(usbvideo_t *cams);
int usbvideo_RegisterVideoDevice(uvd_t *uvd); int usbvideo_RegisterVideoDevice(uvd_t *uvd);
void usbvideo_Deregister(usbvideo_t **uvt); void usbvideo_Deregister(usbvideo_t **uvt);
......
...@@ -1948,7 +1948,13 @@ static void *auerswald_probe (struct usb_device *usbdev, unsigned int ifnum, ...@@ -1948,7 +1948,13 @@ static void *auerswald_probe (struct usb_device *usbdev, unsigned int ifnum,
init_waitqueue_head (&cp->bufferwait); init_waitqueue_head (&cp->bufferwait);
down (&dev_table_mutex); down (&dev_table_mutex);
if (usb_register_dev (&auerswald_driver, 1, &dtindex)) { ret = usb_register_dev (&auerswald_driver, 1, &dtindex);
if (ret) {
if (ret != -ENODEV) {
err ("Not able to get a minor for this device.");
up (&dev_table_mutex);
goto pfail;
}
/* find a free slot in the device table */ /* find a free slot in the device table */
for (dtindex = 0; dtindex < AUER_MAX_DEVICES; ++dtindex) { for (dtindex = 0; dtindex < AUER_MAX_DEVICES; ++dtindex) {
if (dev_table[dtindex] == NULL) if (dev_table[dtindex] == NULL)
......
...@@ -290,6 +290,7 @@ brlvger_probe (struct usb_device *dev, unsigned ifnum, ...@@ -290,6 +290,7 @@ brlvger_probe (struct usb_device *dev, unsigned ifnum,
{ {
struct brlvger_priv *priv = NULL; struct brlvger_priv *priv = NULL;
int i; int i;
int retval;
struct usb_endpoint_descriptor *endpoint; struct usb_endpoint_descriptor *endpoint;
struct usb_interface_descriptor *actifsettings; struct usb_interface_descriptor *actifsettings;
/* protects against reentrance: once we've found a free slot /* protects against reentrance: once we've found a free slot
...@@ -315,7 +316,12 @@ brlvger_probe (struct usb_device *dev, unsigned ifnum, ...@@ -315,7 +316,12 @@ brlvger_probe (struct usb_device *dev, unsigned ifnum,
down(&reserve_sem); down(&reserve_sem);
if (usb_register_dev(&brlvger_driver, 1, &i)) { retval = usb_register_dev(&brlvger_driver, 1, &i);
if (retval) {
if (retval != -ENODEV) {
err("Not able to get a minor for this device.");
goto error;
}
for( i = 0; i < MAX_NR_BRLVGER_DEVS; i++ ) for( i = 0; i < MAX_NR_BRLVGER_DEVS; i++ )
if( display_table[i] == NULL ) if( display_table[i] == NULL )
break; break;
......
...@@ -62,6 +62,8 @@ ...@@ -62,6 +62,8 @@
#define DRIVER_AUTHOR "Petko Manolov <petkan@users.sourceforge.net>" #define DRIVER_AUTHOR "Petko Manolov <petkan@users.sourceforge.net>"
#define DRIVER_DESC "Pegasus/Pegasus II USB Ethernet driver" #define DRIVER_DESC "Pegasus/Pegasus II USB Ethernet driver"
static const char driver_name [] = "pegasus";
#define PEGASUS_USE_INTR #define PEGASUS_USE_INTR
#define PEGASUS_WRITE_EEPROM #define PEGASUS_WRITE_EEPROM
#define BMSR_MEDIA (BMSR_10HALF | BMSR_10FULL | BMSR_100HALF | \ #define BMSR_MEDIA (BMSR_10HALF | BMSR_10FULL | BMSR_100HALF | \
...@@ -811,7 +813,6 @@ static int pegasus_ethtool_ioctl(struct net_device *net, void *uaddr) ...@@ -811,7 +813,6 @@ static int pegasus_ethtool_ioctl(struct net_device *net, void *uaddr)
{ {
pegasus_t *pegasus; pegasus_t *pegasus;
int cmd; int cmd;
char tmp[128];
pegasus = net->priv; pegasus = net->priv;
if (get_user(cmd, (int *) uaddr)) if (get_user(cmd, (int *) uaddr))
...@@ -819,12 +820,11 @@ static int pegasus_ethtool_ioctl(struct net_device *net, void *uaddr) ...@@ -819,12 +820,11 @@ static int pegasus_ethtool_ioctl(struct net_device *net, void *uaddr)
switch (cmd) { switch (cmd) {
case ETHTOOL_GDRVINFO:{ case ETHTOOL_GDRVINFO:{
struct ethtool_drvinfo info = { ETHTOOL_GDRVINFO }; struct ethtool_drvinfo info = { ETHTOOL_GDRVINFO };
strncpy(info.driver, DRIVER_DESC, ETHTOOL_BUSINFO_LEN); strncpy(info.driver, driver_name, sizeof info.driver);
strncpy(info.version, DRIVER_VERSION, strncpy(info.version, DRIVER_VERSION,
ETHTOOL_BUSINFO_LEN); ETHTOOL_BUSINFO_LEN);
sprintf(tmp, "usb%d:%d", pegasus->usb->bus->busnum, usb_make_path(pegasus->usb, info.bus_info,
pegasus->usb->devnum); sizeof info.bus_info);
strncpy(info.bus_info, tmp, ETHTOOL_BUSINFO_LEN);
if (copy_to_user(uaddr, &info, sizeof(info))) if (copy_to_user(uaddr, &info, sizeof(info)))
return -EFAULT; return -EFAULT;
return 0; return 0;
...@@ -833,8 +833,7 @@ static int pegasus_ethtool_ioctl(struct net_device *net, void *uaddr) ...@@ -833,8 +833,7 @@ static int pegasus_ethtool_ioctl(struct net_device *net, void *uaddr)
struct ethtool_cmd ecmd; struct ethtool_cmd ecmd;
short lpa, bmcr; short lpa, bmcr;
if (copy_from_user(&ecmd, uaddr, sizeof(ecmd))) memset(&ecmd, 0, sizeof ecmd);
return -EFAULT;
ecmd.supported = (SUPPORTED_10baseT_Half | ecmd.supported = (SUPPORTED_10baseT_Half |
SUPPORTED_10baseT_Full | SUPPORTED_10baseT_Full |
SUPPORTED_100baseT_Half | SUPPORTED_100baseT_Half |
...@@ -1104,7 +1103,7 @@ static void pegasus_disconnect(struct usb_device *dev, void *ptr) ...@@ -1104,7 +1103,7 @@ static void pegasus_disconnect(struct usb_device *dev, void *ptr)
} }
static struct usb_driver pegasus_driver = { static struct usb_driver pegasus_driver = {
name: "pegasus", name: driver_name,
probe: pegasus_probe, probe: pegasus_probe,
disconnect: pegasus_disconnect, disconnect: pegasus_disconnect,
id_table: pegasus_ids, id_table: pegasus_ids,
......
...@@ -60,9 +60,9 @@ CONFIG_USB_SERIAL_VISOR ...@@ -60,9 +60,9 @@ CONFIG_USB_SERIAL_VISOR
module, say M here and read <file:Documentation/modules.txt>. module, say M here and read <file:Documentation/modules.txt>.
CONFIG_USB_SERIAL_IPAQ CONFIG_USB_SERIAL_IPAQ
Say Y here if you want to connect to your Compaq iPAQ or HP Jornada Say Y here if you want to connect to your Compaq iPAQ, HP Jornada
548/568 running Windows CE 3.0 or PocketPC 2002 using a USB 548/568 or Casio EM500 running Windows CE 3.0 or PocketPC 2002
cradle/cable. For information on using the driver, using a USB cradle/cable. For information on using the driver,
read <file:Documentation/usb/usb-serial.txt>. read <file:Documentation/usb/usb-serial.txt>.
This code is also available as a module ( = code which can be This code is also available as a module ( = code which can be
......
...@@ -16,7 +16,7 @@ dep_tristate ' USB Digi International AccelePort USB Serial Driver' CONFIG_USB_ ...@@ -16,7 +16,7 @@ dep_tristate ' USB Digi International AccelePort USB Serial Driver' CONFIG_USB_
dep_tristate ' USB Empeg empeg-car Mark I/II Driver' CONFIG_USB_SERIAL_EMPEG $CONFIG_USB_SERIAL dep_tristate ' USB Empeg empeg-car Mark I/II Driver' CONFIG_USB_SERIAL_EMPEG $CONFIG_USB_SERIAL
dep_tristate ' USB FTDI Single Port Serial Driver (EXPERIMENTAL)' CONFIG_USB_SERIAL_FTDI_SIO $CONFIG_USB_SERIAL $CONFIG_EXPERIMENTAL dep_tristate ' USB FTDI Single Port Serial Driver (EXPERIMENTAL)' CONFIG_USB_SERIAL_FTDI_SIO $CONFIG_USB_SERIAL $CONFIG_EXPERIMENTAL
dep_tristate ' USB Handspring Visor / Palm m50x / Sony Clie Driver' CONFIG_USB_SERIAL_VISOR $CONFIG_USB_SERIAL dep_tristate ' USB Handspring Visor / Palm m50x / Sony Clie Driver' CONFIG_USB_SERIAL_VISOR $CONFIG_USB_SERIAL
dep_tristate ' USB Compaq iPAQ / HP Jornada Driver' CONFIG_USB_SERIAL_IPAQ $CONFIG_USB_SERIAL dep_tristate ' USB Compaq iPAQ / HP Jornada / Casio EM500 Driver' CONFIG_USB_SERIAL_IPAQ $CONFIG_USB_SERIAL
dep_tristate ' USB IR Dongle Serial Driver (EXPERIMENTAL)' CONFIG_USB_SERIAL_IR $CONFIG_USB_SERIAL $CONFIG_EXPERIMENTAL dep_tristate ' USB IR Dongle Serial Driver (EXPERIMENTAL)' CONFIG_USB_SERIAL_IR $CONFIG_USB_SERIAL $CONFIG_EXPERIMENTAL
dep_tristate ' USB Inside Out Edgeport Serial Driver' CONFIG_USB_SERIAL_EDGEPORT $CONFIG_USB_SERIAL dep_tristate ' USB Inside Out Edgeport Serial Driver' CONFIG_USB_SERIAL_EDGEPORT $CONFIG_USB_SERIAL
dep_tristate ' USB Keyspan PDA Single Port Serial Driver' CONFIG_USB_SERIAL_KEYSPAN_PDA $CONFIG_USB_SERIAL dep_tristate ' USB Keyspan PDA Single Port Serial Driver' CONFIG_USB_SERIAL_KEYSPAN_PDA $CONFIG_USB_SERIAL
......
...@@ -25,6 +25,11 @@ static __devinitdata struct usb_device_id edgeport_2port_id_table [] = { ...@@ -25,6 +25,11 @@ static __devinitdata struct usb_device_id edgeport_2port_id_table [] = {
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_421) }, { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_421) },
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_21) }, { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_21) },
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_2_DIN) }, { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_2_DIN) },
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_BB_EDGEPORT_2) },
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_BB_EDGEPORT_2I) },
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_BB_EDGEPORT_421) },
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_BB_EDGEPORT_21) },
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_BB_EDGEPORT_2_DIN) },
{ } { }
}; };
...@@ -37,6 +42,11 @@ static __devinitdata struct usb_device_id edgeport_4port_id_table [] = { ...@@ -37,6 +42,11 @@ static __devinitdata struct usb_device_id edgeport_4port_id_table [] = {
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_8_DUAL_CPU) }, { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_8_DUAL_CPU) },
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_4_DIN) }, { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_4_DIN) },
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_COMPATIBLE) }, { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_COMPATIBLE) },
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_BB_EDGEPORT_4) },
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_BB_EDGEPORT_4T) },
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_BB_EDGEPORT_4I) },
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_BB_EDGEPORT_8_DUAL_CPU) },
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_BB_EDGEPORT_4_DIN) },
{ } { }
}; };
...@@ -44,6 +54,9 @@ static __devinitdata struct usb_device_id edgeport_8port_id_table [] = { ...@@ -44,6 +54,9 @@ static __devinitdata struct usb_device_id edgeport_8port_id_table [] = {
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_8) }, { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_8) },
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_16_DUAL_CPU) }, { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_16_DUAL_CPU) },
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_8I) }, { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_8I) },
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_BB_EDGEPORT_8) },
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_BB_EDGEPORT_16_DUAL_CPU) },
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_BB_EDGEPORT_8I) },
{ } { }
}; };
...@@ -66,6 +79,19 @@ static __devinitdata struct usb_device_id id_table_combined [] = { ...@@ -66,6 +79,19 @@ static __devinitdata struct usb_device_id id_table_combined [] = {
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_16_DUAL_CPU) }, { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_16_DUAL_CPU) },
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_COMPATIBLE) }, { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_COMPATIBLE) },
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_8I) }, { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_8I) },
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_BB_EDGEPORT_2) },
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_BB_EDGEPORT_2I) },
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_BB_EDGEPORT_421) },
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_BB_EDGEPORT_21) },
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_BB_EDGEPORT_2_DIN) },
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_BB_EDGEPORT_4) },
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_BB_EDGEPORT_4T) },
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_BB_EDGEPORT_4I) },
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_BB_EDGEPORT_8_DUAL_CPU) },
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_BB_EDGEPORT_4_DIN) },
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_BB_EDGEPORT_8) },
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_BB_EDGEPORT_16_DUAL_CPU) },
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_BB_EDGEPORT_8I) },
{ } /* Terminating entry */ { } /* Terminating entry */
}; };
......
...@@ -92,6 +92,20 @@ ...@@ -92,6 +92,20 @@
#define ION_DEVICE_ID_EDGEPORT_8I 0x014 // Edgeport/8 RS422 (single-CPU) #define ION_DEVICE_ID_EDGEPORT_8I 0x014 // Edgeport/8 RS422 (single-CPU)
#define ION_DEVICE_ID_MT4X56USB 0x1403 // OEM device #define ION_DEVICE_ID_MT4X56USB 0x1403 // OEM device
// BlackBox OEM devices
#define ION_DEVICE_ID_BB_EDGEPORT_4 0x001 // Edgeport/4 RS232
#define ION_DEVICE_ID_BB_EDGEPORT_4T 0x004 // Edgeport/4 RS232 for Telxon (aka "Fleetport")
#define ION_DEVICE_ID_BB_EDGEPORT_2 0x005 // Edgeport/2 RS232
#define ION_DEVICE_ID_BB_EDGEPORT_4I 0x006 // Edgeport/4 RS422
#define ION_DEVICE_ID_BB_EDGEPORT_2I 0x007 // Edgeport/2 RS422/RS485
#define ION_DEVICE_ID_BB_EDGEPORT_421 0x00C // Edgeport/421 Hub+RS232+Parallel
#define ION_DEVICE_ID_BB_EDGEPORT_21 0x00D // Edgeport/21 RS232+Parallel
#define ION_DEVICE_ID_BB_EDGEPORT_8_DUAL_CPU 0x00E // Half of an Edgeport/8 (the kind with 2 EP/4s on 1 PCB)
#define ION_DEVICE_ID_BB_EDGEPORT_8 0x00F // Edgeport/8 (single-CPU)
#define ION_DEVICE_ID_BB_EDGEPORT_2_DIN 0x010 // Edgeport/2 RS232 with Apple DIN connector
#define ION_DEVICE_ID_BB_EDGEPORT_4_DIN 0x011 // Edgeport/4 RS232 with Apple DIN connector
#define ION_DEVICE_ID_BB_EDGEPORT_16_DUAL_CPU 0x012 // Half of an Edgeport/16 (the kind with 2 EP/8s)
#define ION_DEVICE_ID_BB_EDGEPORT_8I 0x014 // Edgeport/8 RS422 (single-CPU)
// These IDs are used by the Edgeport.exe program for uninstalling. // These IDs are used by the Edgeport.exe program for uninstalling.
// //
#define EDGEPORT_DEVICE_IDS {0x001, 0x003, 0x004, 0x005, 0x006, 0x007, 0x00B, \ #define EDGEPORT_DEVICE_IDS {0x001, 0x003, 0x004, 0x005, 0x006, 0x007, 0x00B, \
......
...@@ -9,6 +9,10 @@ ...@@ -9,6 +9,10 @@
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* (30/4/2002) ganesh
* Added support for the Casio EM500. Completely untested. Thanks
* to info from Nathan <wfilardo@fuse.net>
*
* (19/3/2002) ganesh * (19/3/2002) ganesh
* Don't submit urbs while holding spinlocks. Not strictly necessary * Don't submit urbs while holding spinlocks. Not strictly necessary
* in 2.5.x. * in 2.5.x.
...@@ -58,7 +62,7 @@ ...@@ -58,7 +62,7 @@
*/ */
#define DRIVER_VERSION "v0.2" #define DRIVER_VERSION "v0.2"
#define DRIVER_AUTHOR "Ganesh Varadarajan <ganesh@veritas.com>" #define DRIVER_AUTHOR "Ganesh Varadarajan <ganesh@veritas.com>"
#define DRIVER_DESC "USB Compaq iPAQ, HP Jornada driver" #define DRIVER_DESC "USB Compaq iPAQ, HP Jornada, Casio EM500 driver"
/* Function prototypes for an ipaq */ /* Function prototypes for an ipaq */
static int ipaq_open (struct usb_serial_port *port, struct file *filp); static int ipaq_open (struct usb_serial_port *port, struct file *filp);
...@@ -81,6 +85,7 @@ static __devinitdata struct usb_device_id ipaq_id_table [] = { ...@@ -81,6 +85,7 @@ static __devinitdata struct usb_device_id ipaq_id_table [] = {
{ USB_DEVICE(COMPAQ_VENDOR_ID, COMPAQ_IPAQ_ID) }, { USB_DEVICE(COMPAQ_VENDOR_ID, COMPAQ_IPAQ_ID) },
{ USB_DEVICE(HP_VENDOR_ID, HP_JORNADA_548_ID) }, { USB_DEVICE(HP_VENDOR_ID, HP_JORNADA_548_ID) },
{ USB_DEVICE(HP_VENDOR_ID, HP_JORNADA_568_ID) }, { USB_DEVICE(HP_VENDOR_ID, HP_JORNADA_568_ID) },
{ USB_DEVICE(CASIO_VENDOR_ID, CASIO_EM500_ID) },
{ } /* Terminating entry */ { } /* Terminating entry */
}; };
......
...@@ -23,6 +23,9 @@ ...@@ -23,6 +23,9 @@
#define HP_JORNADA_548_ID 0x1016 #define HP_JORNADA_548_ID 0x1016
#define HP_JORNADA_568_ID 0x1116 #define HP_JORNADA_568_ID 0x1116
#define CASIO_VENDOR_ID 0x07cf
#define CASIO_EM500_ID 0x2002
/* /*
* Since we can't queue our bulk write urbs (don't know why - it just * Since we can't queue our bulk write urbs (don't know why - it just
* doesn't work), we can send down only one write urb at a time. The simplistic * doesn't work), we can send down only one write urb at a time. The simplistic
......
...@@ -142,6 +142,7 @@ static struct usb_serial_device_type pl2303_device = { ...@@ -142,6 +142,7 @@ static struct usb_serial_device_type pl2303_device = {
struct pl2303_private { struct pl2303_private {
u8 line_control; u8 line_control;
u8 termios_initialized;
}; };
...@@ -214,13 +215,19 @@ static void pl2303_set_termios (struct usb_serial_port *port, struct termios *ol ...@@ -214,13 +215,19 @@ static void pl2303_set_termios (struct usb_serial_port *port, struct termios *ol
int baud; int baud;
int i; int i;
dbg (__FUNCTION__ " - port %d", port->number); dbg (__FUNCTION__ " - port %d, initialized = %d", port->number,
((struct pl2303_private *) port->private)->termios_initialized);
if ((!port->tty) || (!port->tty->termios)) { if ((!port->tty) || (!port->tty->termios)) {
dbg(__FUNCTION__" - no tty structures"); dbg(__FUNCTION__" - no tty structures");
return; return;
} }
if (!(((struct pl2303_private *) port->private)->termios_initialized)) {
*(port->tty->termios) = tty_std_termios;
port->tty->termios->c_cflag = B9600 | CS8 | CREAD | HUPCL | CLOCAL;
((struct pl2303_private *) port->private)->termios_initialized = 1;
}
cflag = port->tty->termios->c_cflag; cflag = port->tty->termios->c_cflag;
/* check that they really want us to change something */ /* check that they really want us to change something */
if (old_termios) { if (old_termios) {
...@@ -390,9 +397,6 @@ static int pl2303_open (struct usb_serial_port *port, struct file *filp) ...@@ -390,9 +397,6 @@ static int pl2303_open (struct usb_serial_port *port, struct file *filp)
/* Setup termios */ /* Setup termios */
if (port->tty) { if (port->tty) {
*(port->tty->termios) = tty_std_termios;
port->tty->termios->c_cflag = B9600 | CS8 | CREAD | HUPCL | CLOCAL;
pl2303_set_termios (port, &tmp_termios); pl2303_set_termios (port, &tmp_termios);
} }
......
...@@ -28,11 +28,15 @@ CONFIG_USB_STORAGE_FREECOM ...@@ -28,11 +28,15 @@ CONFIG_USB_STORAGE_FREECOM
Support for the Freecom USB to IDE/ATAPI adaptor. Support for the Freecom USB to IDE/ATAPI adaptor.
Freecom has a web page at <http://www.freecom.de/>. Freecom has a web page at <http://www.freecom.de/>.
CONFIG_USB_STORAGE_DATAFAB
Support for certain Datafab CompactFlash readers.
Datafab has a web page at <http://www.datafabusa.com/>.
CONFIG_USB_STORAGE_DPCM CONFIG_USB_STORAGE_DPCM
Say Y here to support the Microtech ZiO! CompactFlash/SmartMedia Say Y here to support the Microtech ZiO! CompactFlash reader.
reader, details at <http://www.microtechint.com/zio/index.html>. There is a web page at <http://www.microtechint.com/zio/index.html>.
This driver treats the flash card as a removable storage device.
CONFIG_USB_STORAGE_SDDR09 CONFIG_USB_STORAGE_SDDR09
Say Y here to include additional code to support the Sandisk SDDR-09 Say Y here to include additional code to support the Sandisk SDDR-09
SmartMedia reader in the USB Mass Storage driver. SmartMedia reader in the USB Mass Storage driver.
Also works for the Microtech Zio! SmartMedia reader.
...@@ -6,7 +6,7 @@ if [ "$CONFIG_SCSI" = "n" ]; then ...@@ -6,7 +6,7 @@ if [ "$CONFIG_SCSI" = "n" ]; then
fi fi
dep_tristate ' USB Mass Storage support' CONFIG_USB_STORAGE $CONFIG_USB $CONFIG_SCSI dep_tristate ' USB Mass Storage support' CONFIG_USB_STORAGE $CONFIG_USB $CONFIG_SCSI
dep_mbool ' USB Mass Storage verbose debug' CONFIG_USB_STORAGE_DEBUG $CONFIG_USB_STORAGE dep_mbool ' USB Mass Storage verbose debug' CONFIG_USB_STORAGE_DEBUG $CONFIG_USB_STORAGE
dep_mbool ' Datafab MDCFE-B Compact Flash Reader support' CONFIG_USB_STORAGE_DATAFAB $CONFIG_USB_STORAGE $CONFIG_EXPERIMENTAL dep_mbool ' Datafab Compact Flash Reader support' CONFIG_USB_STORAGE_DATAFAB $CONFIG_USB_STORAGE $CONFIG_EXPERIMENTAL
dep_mbool ' Freecom USB/ATAPI Bridge support' CONFIG_USB_STORAGE_FREECOM $CONFIG_USB_STORAGE dep_mbool ' Freecom USB/ATAPI Bridge support' CONFIG_USB_STORAGE_FREECOM $CONFIG_USB_STORAGE
dep_mbool ' ISD-200 USB/ATA Bridge support' CONFIG_USB_STORAGE_ISD200 $CONFIG_USB_STORAGE dep_mbool ' ISD-200 USB/ATA Bridge support' CONFIG_USB_STORAGE_ISD200 $CONFIG_USB_STORAGE
dep_mbool ' Microtech CompactFlash/SmartMedia support' CONFIG_USB_STORAGE_DPCM $CONFIG_USB_STORAGE dep_mbool ' Microtech CompactFlash/SmartMedia support' CONFIG_USB_STORAGE_DPCM $CONFIG_USB_STORAGE
......
...@@ -327,6 +327,7 @@ void usb_stor_show_sense( ...@@ -327,6 +327,7 @@ void usb_stor_show_sense(
case 0x3502: what="enclosure services unavailable"; break; case 0x3502: what="enclosure services unavailable"; break;
case 0x3503: what="enclosure services transfer failure"; break; case 0x3503: what="enclosure services transfer failure"; break;
case 0x3504: what="enclosure services transfer refused"; break; case 0x3504: what="enclosure services transfer refused"; break;
case 0x3A00: what="medium not present"; break;
case 0x3B0F: what="end of medium reached"; break; case 0x3B0F: what="end of medium reached"; break;
case 0x3F02: what="changed operating definition"; break; case 0x3F02: what="changed operating definition"; break;
case 0x4100: what="data path failure (should use 40 NN)"; break; case 0x4100: what="data path failure (should use 40 NN)"; break;
......
...@@ -37,8 +37,13 @@ ...@@ -37,8 +37,13 @@
* 675 Mass Ave, Cambridge, MA 02139, USA. * 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#include <linux/config.h>
#include "usb.h" #include "usb.h"
/* This places the Shuttle/SCM USB<->SCSI bridge devices in multi-target /* This places the Shuttle/SCM USB<->SCSI bridge devices in multi-target
* mode */ * mode */
int usb_stor_euscsi_init(struct us_data *us); int usb_stor_euscsi_init(struct us_data *us);
#ifdef CONFIG_USB_STORAGE_SDDR09
int sddr09_init(struct us_data *us);
#endif
...@@ -192,7 +192,7 @@ static int jumpshot_raw_bulk(int direction, ...@@ -192,7 +192,7 @@ static int jumpshot_raw_bulk(int direction,
return US_BULK_TRANSFER_SHORT; return US_BULK_TRANSFER_SHORT;
} }
US_DEBUGP("jumpshot_raw_bulk: Transfered %d of %d bytes\n", act_len, len); US_DEBUGP("jumpshot_raw_bulk: Transferred %d of %d bytes\n", act_len, len);
return US_BULK_TRANSFER_GOOD; return US_BULK_TRANSFER_GOOD;
} }
......
This diff is collapsed.
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
* *
* Current development and maintenance by: * Current development and maintenance by:
* (c) 2000 Robert Baruch (autophile@dol.net) * (c) 2000 Robert Baruch (autophile@dol.net)
* (c) 2002 Andries Brouwer (aeb@cwi.nl)
* *
* See sddr09.c for more explanation * See sddr09.c for more explanation
* *
...@@ -39,6 +40,9 @@ struct sddr09_card_info { ...@@ -39,6 +40,9 @@ struct sddr09_card_info {
int blockmask; /* 2^blockshift - 1 */ int blockmask; /* 2^blockshift - 1 */
int *lba_to_pba; /* logical to physical map */ int *lba_to_pba; /* logical to physical map */
int *pba_to_lba; /* physical to logical map */ int *pba_to_lba; /* physical to logical map */
int lbact; /* number of available pages */
int flags;
#define SDDR09_WP 1 /* write protected */
}; };
#endif #endif
...@@ -130,14 +130,14 @@ UNUSUAL_DEV( 0x04e6, 0x0003, 0x0000, 0x9999, ...@@ -130,14 +130,14 @@ UNUSUAL_DEV( 0x04e6, 0x0003, 0x0000, 0x9999,
"ImageMate SDDR09", "ImageMate SDDR09",
US_SC_SCSI, US_PR_EUSB_SDDR09, NULL, US_SC_SCSI, US_PR_EUSB_SDDR09, NULL,
US_FL_SINGLE_LUN | US_FL_START_STOP ), US_FL_SINGLE_LUN | US_FL_START_STOP ),
#endif
/* This entry is from Andries.Brouwer@cwi.nl */ /* This entry is from Andries.Brouwer@cwi.nl */
UNUSUAL_DEV( 0x04e6, 0x0005, 0x0100, 0x0208, UNUSUAL_DEV( 0x04e6, 0x0005, 0x0100, 0x0208,
"SCM Microsystems", "SCM Microsystems",
"eUSB SmartMedia / CompactFlash Adapter", "eUSB SmartMedia / CompactFlash Adapter",
US_SC_SCSI, US_PR_DPCM_USB, NULL, US_SC_SCSI, US_PR_DPCM_USB, sddr09_init,
US_FL_START_STOP), US_FL_START_STOP),
#endif
UNUSUAL_DEV( 0x04e6, 0x0006, 0x0100, 0x0205, UNUSUAL_DEV( 0x04e6, 0x0006, 0x0100, 0x0205,
"Shuttle", "Shuttle",
......
...@@ -525,6 +525,7 @@ static void * skel_probe(struct usb_device *udev, unsigned int ifnum, const stru ...@@ -525,6 +525,7 @@ static void * skel_probe(struct usb_device *udev, unsigned int ifnum, const stru
int minor; int minor;
int buffer_size; int buffer_size;
int i; int i;
int retval;
char name[10]; char name[10];
...@@ -535,14 +536,20 @@ static void * skel_probe(struct usb_device *udev, unsigned int ifnum, const stru ...@@ -535,14 +536,20 @@ static void * skel_probe(struct usb_device *udev, unsigned int ifnum, const stru
} }
down (&minor_table_mutex); down (&minor_table_mutex);
if (usb_register_dev (&skel_driver, 1, &minor)) { retval = usb_register_dev (&skel_driver, 1, &minor);
if (retval) {
if (retval != -ENODEV) {
/* something prevented us from registering this driver */
err ("Not able to get a minor for this device.");
goto exit;
}
/* we could not get a dynamic minor, so lets find one of our own */ /* we could not get a dynamic minor, so lets find one of our own */
for (minor = 0; minor < MAX_DEVICES; ++minor) { for (minor = 0; minor < MAX_DEVICES; ++minor) {
if (minor_table[minor] == NULL) if (minor_table[minor] == NULL)
break; break;
} }
if (minor >= MAX_DEVICES) { if (minor >= MAX_DEVICES) {
info ("Too many devices plugged in, can not handle this device."); err ("Too many devices plugged in, can not handle this device.");
goto exit; goto exit;
} }
} }
......
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