From: Albert H. <he...@us...> - 2009-02-01 18:29:40
|
Update of /cvsroot/gc-linux/linux/drivers/usb/host In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv17186/drivers/usb/host Modified Files: Kconfig Makefile rvl-sthcd.c Log Message: Merge 2.6.28. Also: - run checkpatch against the non-broken source code - add GPIO driver fixes - implement getgeo for the special block drivers - small fixes Index: Makefile =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/usb/host/Makefile,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Makefile 14 Sep 2008 19:20:31 -0000 1.2 +++ Makefile 1 Feb 2009 18:29:35 -0000 1.3 @@ -8,6 +8,8 @@ isp1760-objs := isp1760-hcd.o isp1760-if.o +obj-$(CONFIG_USB_WHCI_HCD) += whci/ + obj-$(CONFIG_PCI) += pci-quirks.o obj-$(CONFIG_USB_EHCI_HCD) += ehci-hcd.o @@ -20,3 +22,4 @@ obj-$(CONFIG_USB_R8A66597_HCD) += r8a66597-hcd.o obj-$(CONFIG_USB_ISP1760_HCD) += isp1760.o obj-$(CONFIG_USB_WII_HCD) += rvl-sthcd.o +obj-$(CONFIG_USB_HWA_HCD) += hwa-hc.o Index: Kconfig =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/usb/host/Kconfig,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Kconfig 15 Nov 2008 20:10:15 -0000 1.4 +++ Kconfig 1 Feb 2009 18:29:35 -0000 1.5 @@ -110,35 +110,23 @@ config USB_ISP1760_HCD tristate "ISP 1760 HCD support" - depends on USB && EXPERIMENTAL + depends on USB && EXPERIMENTAL && (PCI || PPC_OF) ---help--- The ISP1760 chip is a USB 2.0 host controller. This driver does not support isochronous transfers or OTG. + This USB controller is usually attached to a non-DMA-Master + capable bus. NXP's eval kit brings this chip on PCI card + where the chip itself is behind a PLB to simulate such + a bus. To compile this driver as a module, choose M here: the - module will be called isp1760-hcd. - -config USB_ISP1760_PCI - bool "Support for the PCI bus" - depends on USB_ISP1760_HCD && PCI - ---help--- - Enables support for the device present on the PCI bus. - This should only be required if you happen to have the eval kit from - NXP and you are going to test it. - -config USB_ISP1760_OF - bool "Support for the OF platform bus" - depends on USB_ISP1760_HCD && PPC_OF - ---help--- - Enables support for the device present on the PowerPC - OpenFirmware platform bus. + module will be called isp1760. config USB_OHCI_HCD tristate "OHCI HCD support" depends on USB && USB_ARCH_HAS_OHCI select ISP1301_OMAP if MACH_OMAP_H2 || MACH_OMAP_H3 - select I2C if ARCH_PNX4008 ---help--- The Open Host Controller Interface (OHCI) is a standard for accessing USB 1.1 host controller hardware. It does more in hardware than Intel's @@ -312,16 +300,43 @@ help The Nintendo Wii includes a USB 1.1 host controller that can be accessed through the API provided by the starlet subsystem. - + Enable this option if you plan to use the internal Nintendo Wii bluetooth dongle or any USB peripheral connected to the external ports. - + USB devices using isochronous transfers are not supported. Use of USB hubs is partially supported. - + Use completely at you own risk. If unsure, say N. - + To compile this driver as a module, choose M here: the module will be called rvl-sthcd. +config USB_WHCI_HCD + tristate "Wireless USB Host Controller Interface (WHCI) driver (EXPERIMENTAL)" + depends on EXPERIMENTAL + depends on PCI && USB + select USB_WUSB + select UWB_WHCI + help + A driver for PCI-based Wireless USB Host Controllers that are + compliant with the WHCI specification. + + To compile this driver a module, choose M here: the module + will be called "whci-hcd". + +config USB_HWA_HCD + tristate "Host Wire Adapter (HWA) driver (EXPERIMENTAL)" + depends on EXPERIMENTAL + depends on USB + select USB_WUSB + select UWB_HWA + help + This driver enables you to connect Wireless USB devices to + your system using a Host Wire Adaptor USB dongle. This is an + UWB Radio Controller and WUSB Host Controller connected to + your machine via USB (specified in WUSB1.0). + + To compile this driver a module, choose M here: the module + will be called "hwa-hc". Index: rvl-sthcd.c =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/usb/host/rvl-sthcd.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- rvl-sthcd.c 25 Nov 2008 19:09:31 -0000 1.4 +++ rvl-sthcd.c 1 Feb 2009 18:29:35 -0000 1.5 @@ -2,9 +2,9 @@ * drivers/usb/host/rvl-sthcd.c * * USB Host Controller driver for the Nintendo Wii - * Copyright (C) 2008 The GameCube Linux Team + * Copyright (C) 2008-2009 The GameCube Linux Team * Copyright (C) 2008 Maarten ter Huurne - * Copyright (C) 2008 Albert Herranz + * Copyright (C) 2008,2009 Albert Herranz * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -69,7 +69,7 @@ * we need additional ports here. */ #define STHCD_MAX_DEVIDS 15 -#define STHCD_MAX_PORTS STHCD_MAX_DEVIDS +#define STHCD_MAX_PORTS STHCD_MAX_DEVIDS /* * We get error -7008 after performing large transfers. @@ -247,7 +247,7 @@ { int i; for (i = 0; i < (size + 3) / 4; i += 4) { - u32 *data = &((u32*)buf)[i]; + u32 *data = &((u32 *)buf)[i]; printk(KERN_INFO " %08X %08X %08X %08X\n", data[0], data[1], data[2], data[3] ); @@ -399,7 +399,7 @@ USB_ENDPOINT_XFERTYPE_MASK; int error; - switch(xfer_type) { + switch (xfer_type) { case USB_ENDPOINT_XFER_CONTROL: error = sthcd_pep_alloc_ctrl_xfer_ctx(pep); break; @@ -422,7 +422,7 @@ unsigned int xfer_type = pep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK; - switch(xfer_type) { + switch (xfer_type) { case USB_ENDPOINT_XFER_CONTROL: sthcd_pep_free_ctrl_xfer_ctx(pep); break; @@ -642,7 +642,7 @@ } /* - * + * * Context: interrupts disabled, hcd lock held */ static int sthcd_pep_setup_xfer(struct sthcd_pep *pep) @@ -768,7 +768,7 @@ static int sthcd_pep_xfer_callback(struct starlet_ipc_request *req); /* - * + * * Context: interrupts disabled, hcd lock held */ static int sthcd_pep_start_xfer(struct sthcd_pep *pep) @@ -826,7 +826,7 @@ __releases(sthcd->lock) __acquires(sthcd->lock) { struct usb_hcd *hcd = sthcd_to_hcd(sthcd); - + /* * Release the hcd lock here as the callback may need to * hold it again. @@ -927,25 +927,25 @@ goto err_setup_xfer; } - fake = 0; + fake = 0; if (pep->request == STHCD_IOCTLV_CONTROLREQ) { req = (struct usb_ctrlrequest *)urb->setup_packet; typeReq = (req->bRequestType << 8) | req->bRequest; wValue = le16_to_cpu(req->wValue); - switch(typeReq) { + switch (typeReq) { case DeviceOutRequest | USB_REQ_SET_ADDRESS: /* 0005 */ - if (urb->dev->devnum != 0) { + if (urb->dev->devnum != 0) { /* REVISIT, never reached */ - drv_printk(KERN_WARNING, + drv_printk(KERN_WARNING, "address change %u->%u\n", urb->dev->devnum, wValue); - } + } /* * We are guaranteed to have an udev because the takein * was successful. */ - pep->udev->devnum = wValue; + pep->udev->devnum = wValue; urb->actual_length = 0; /* clear the port reset count, we have an address */ @@ -1035,6 +1035,7 @@ struct urb *urb; int retval; unsigned long flags; + int error; starlet_ipc_free_request(req); @@ -1070,7 +1071,7 @@ sthcd_pep_print(pep); } - switch(status) { + switch (status) { case -7003: case -7004: /* endpoint stall */ @@ -1130,9 +1131,9 @@ sthcd_pep_finish_xfer(pep, xfer_len); /* - * Only schedule the next chunk if we didn't get a short xfer - * and the pep is still active - */ + * Only schedule the next chunk if we didn't get a short xfer + * and the pep is still active + */ if (xfer_len == pep->io_buf_len && pep_is_enabled(pep)) { retval = sthcd_pep_setup_next_xfer(pep); if (retval <= 0) { @@ -1157,7 +1158,7 @@ BUG_ON(!sthcd); BUG_ON(!urb); - int error = usb_hcd_check_unlink_urb(hcd, urb, status); + error = usb_hcd_check_unlink_urb(hcd, urb, status); if (!error) { usb_hcd_unlink_urb_from_ep(hcd, urb); @@ -1192,7 +1193,7 @@ int i; port = sthcd->ports; - for(i = 0; i < sthcd->nr_ports; i++, port++) { + for (i = 0; i < sthcd->nr_ports; i++, port++) { udev = &port->udev; if (!test_and_set_bit(__STHCD_PORT_INUSE, &port->flags)) return udev; @@ -1258,7 +1259,7 @@ } snprintf(pathname, sizeof(pathname), "/dev/usb/oh%u/%04x/%04x", - oh->index, udev->idVendor, udev->idProduct); + oh->index, udev->idVendor, udev->idProduct); error = starlet_open(pathname, 0); if (error < 0) { drv_printk(KERN_ERR, "open %s failed\n", pathname); @@ -1403,7 +1404,7 @@ } break; case GetHubDescriptor: /* 0xA006 */ - /* + /* * For the DeviceRemovable and PortPwrCtrlMask fields: * bit 0 is reserved. * bit 1 is the internal (oh1) port, which is non-removable. @@ -1442,7 +1443,7 @@ break; } - if (retval < 0) + if (retval < 0) DBG("%s: retval=%d (%x)\n", __func__, retval, retval); return retval; } @@ -1472,7 +1473,7 @@ if (test_bit(__STHCD_PORT_DOOMED, &port->flags)) { /* disconnect */ if (!!(port->status_change & USB_PORT_STAT_CONNECTION)) - port->status_change |= + port->status_change |= (USB_PORT_STAT_C_CONNECTION<<16); port->status_change &= ~USB_PORT_STAT_CONNECTION; } @@ -1486,7 +1487,7 @@ set_bit(__STHCD_PORT_DOOMED, &port->flags); } if (!(port->status_change & USB_PORT_STAT_ENABLE)) - port->status_change |= + port->status_change |= (USB_PORT_STAT_C_ENABLE << 16); port->status_change &= ~USB_PORT_STAT_RESET; port->status_change |= (USB_PORT_STAT_ENABLE | @@ -1586,7 +1587,7 @@ if (retval > 0) retval = 0; - if (retval < 0) + if (retval < 0) DBG("%s: retval=%d (%x)\n", __func__, retval, retval); return retval; } @@ -1613,19 +1614,18 @@ spin_lock_irqsave(&sthcd->lock, flags); port = sthcd->ports; - for(i = 0, *p = 0; i < sthcd->nr_ports; i++, port++) { + for (i = 0, *p = 0; i < sthcd->nr_ports; i++, port++) { if ((port->status_change & 0xffff0000) != 0) { *p |= 1 << (i+1); /* REVISIT */ - //break; } } *p = le16_to_cpu(*p); - result = (*p != 0)?2:0; + result = (*p != 0) ? 2 : 0; spin_unlock_irqrestore(&sthcd->lock, flags); -// DBG("%s: poll cycle, changes=%04x\n", __func__, *p); +/* DBG("%s: poll cycle, changes=%04x\n", __func__, *p); */ return result; } @@ -1644,7 +1644,7 @@ struct sthcd_port *port; unsigned long flags; int error; - + drv_printk(KERN_INFO, "inserting device %04X.%04X\n", idVendor, idProduct); @@ -1726,7 +1726,7 @@ goto done; } - params_in->req.bRequestType= requesttype; + params_in->req.bRequestType = requesttype; params_in->req.bRequest = request; params_in->req.wValue = cpu_to_le16p(&value); params_in->req.wIndex = cpu_to_le16p(&index); @@ -1778,7 +1778,7 @@ } snprintf(pathname, sizeof(pathname), "/dev/usb/oh%u/%04x/%04x", - oh->index, idVendor, idProduct); + oh->index, idVendor, idProduct); retval = starlet_open(pathname, 0); if (retval < 0) { drv_printk(KERN_ERR, "open %s failed\n", pathname); @@ -1787,7 +1787,7 @@ } fd = retval; - for (i=0; i < 3; i++) { + for (i = 0; i < 3; i++) { retval = sthcd_usb_control_msg(fd, USB_REQ_GET_DESCRIPTOR, USB_DIR_IN, USB_DT_DEVICE << 8, 0, @@ -1803,7 +1803,7 @@ if (retval >= USB_DT_DEVICE_SIZE) { /* tell if a hub was found */ - retval = (descriptor->bDeviceClass == USB_CLASS_HUB)?1:0; + retval = (descriptor->bDeviceClass == USB_CLASS_HUB) ? 1 : 0; } else { if (retval >= 0) retval = -EINVAL; /* short descriptor */ @@ -1854,7 +1854,7 @@ starlet_ioh_sg_init_table(in, 2); starlet_ioh_sg_entry(&in[0], ¶ms_in->devid_count); starlet_ioh_sg_entry(&in[1], ¶ms_in->_type); - + starlet_ioh_sg_init_table(io, 2); starlet_ioh_sg_entry(&io[0], ¶ms_io->devid_count); starlet_ioh_sg_set_buf(&io[1], ¶ms_io->devids, size); @@ -1895,7 +1895,7 @@ static int sthcd_oh_rescan(struct sthcd_oh *oh) { - static unsigned int poll_cycles = 0; + static unsigned int poll_cycles; struct usb_hcd *hcd = sthcd_to_hcd(oh->hcd); struct sthcd_devid *p; int nr_new_devids, i; @@ -1910,7 +1910,7 @@ nr_new_devids = error; changes = 0; - for(i = 0; i < oh->nr_devids; i++) { + for (i = 0; i < oh->nr_devids; i++) { p = &oh->devids[i]; if (!sthcd_devid_find(oh->new_devids, nr_new_devids, p)) { /* removal */ @@ -1921,7 +1921,7 @@ } } - for(i = 0; i < nr_new_devids; i++) { + for (i = 0; i < nr_new_devids; i++) { p = &oh->new_devids[i]; if (!sthcd_devid_find(oh->devids, oh->nr_devids, p)) { /* insertion */ @@ -1961,11 +1961,10 @@ } poll_cycles = 2; } else { - if (!poll_cycles) { + if (!poll_cycles) hcd->poll_rh = 0; - } else { + else poll_cycles--; - } #else usb_hcd_poll_rh_status(hcd); #endif @@ -2030,7 +2029,7 @@ oh = &sthcd->oh[0]; - while(!kthread_should_stop()) { + while (!kthread_should_stop()) { sthcd_oh_rescan(oh); /* re-check again after the configured interval */ @@ -2083,9 +2082,8 @@ /* device insertion/removal is managed by the rescan thread */ sthcd->rescan_task = kthread_run(sthcd_rescan_thread, sthcd, "ksthcd"); - if (IS_ERR(sthcd->rescan_task)) { + if (IS_ERR(sthcd->rescan_task)) drv_printk(KERN_ERR, "failed to start rescan thread\n"); - } return 0; } @@ -2170,7 +2168,7 @@ spin_lock_irqsave(&sthcd->lock, flags); error = usb_hcd_check_unlink_urb(hcd, urb, status); - if (error) + if (error) goto done; ep = urb->ep; @@ -2355,7 +2353,7 @@ if (usb_disabled()) return -ENODEV; - drv_printk(KERN_INFO, "%s - version %s\n", DRV_DESCRIPTION, + drv_printk(KERN_INFO, "%s - version %s\n", DRV_DESCRIPTION, sthcd_driver_version); return of_register_platform_driver(&sthcd_of_driver); |