Index: if_aue.c =================================================================== RCS file: /home/ncvs/src/sys/dev/usb/if_aue.c,v retrieving revision 1.19.2.20 diff -u -r1.19.2.20 if_aue.c --- if_aue.c 1 Mar 2004 00:07:21 -0000 1.19.2.20 +++ if_aue.c 13 Apr 2004 22:06:34 -0000 @@ -208,7 +208,7 @@ Static void aue_miibus_statchg(device_ptr_t); Static void aue_setmulti(struct aue_softc *); -Static u_int32_t aue_crc(caddr_t); +Static uint32_t aue_mchash(const uint8_t *); Static void aue_reset(struct aue_softc *); Static int aue_csr_read_1(struct aue_softc *, int); @@ -523,9 +523,11 @@ #define AUE_BITS 6 Static u_int32_t -aue_crc(caddr_t addr) +aue_mchash(const uint8_t *addr) { - u_int32_t idx, bit, data, crc; + uint32_t crc; + int idx, bit; + uint8_t data; /* Compute CRC for the address value. */ crc = 0xFFFFFFFF; /* initial value */ @@ -567,7 +569,7 @@ { if (ifma->ifma_addr->sa_family != AF_LINK) continue; - h = aue_crc(LLADDR((struct sockaddr_dl *)ifma->ifma_addr)); + h = aue_mchash(LLADDR((struct sockaddr_dl *)ifma->ifma_addr)); AUE_SETBIT(sc, AUE_MAR + (h >> 3), 1 << (h & 0x7)); } Index: if_cue.c =================================================================== RCS file: /home/ncvs/src/sys/dev/usb/if_cue.c,v retrieving revision 1.7.2.7 diff -u -r1.7.2.7 if_cue.c --- if_cue.c 1 Mar 2004 00:07:21 -0000 1.7.2.7 +++ if_cue.c 13 Apr 2004 22:06:34 -0000 @@ -116,7 +116,7 @@ Static void cue_shutdown(device_ptr_t); Static void cue_setmulti(struct cue_softc *); -Static u_int32_t cue_crc(caddr_t); +Static uint32_t cue_mchash(const uint8_t *); Static void cue_reset(struct cue_softc *); Static int cue_csr_read_1(struct cue_softc *, int); @@ -330,10 +330,12 @@ #define CUE_POLY 0xEDB88320 #define CUE_BITS 9 -Static u_int32_t -cue_crc(caddr_t addr) +Static uint32_t +cue_mchash(const uint8_t *addr) { - u_int32_t idx, bit, data, crc; + uint32_t crc; + int idx, bit; + uint8_t data; /* Compute CRC for the address value. */ crc = 0xFFFFFFFF; /* initial value */ @@ -376,7 +378,7 @@ { if (ifma->ifma_addr->sa_family != AF_LINK) continue; - h = cue_crc(LLADDR((struct sockaddr_dl *)ifma->ifma_addr)); + h = cue_mchash(LLADDR((struct sockaddr_dl *)ifma->ifma_addr)); sc->cue_mctab[h >> 3] |= 1 << (h & 0x7); } @@ -386,9 +388,9 @@ */ if (ifp->if_flags & IFF_BROADCAST) { #if __FreeBSD_version >= 500000 - h = cue_crc(ifp->if_broadcastaddr); + h = cue_mchash(ifp->if_broadcastaddr); #else - h = cue_crc(etherbroadcastaddr); + h = cue_mchash(etherbroadcastaddr); #endif sc->cue_mctab[h >> 3] |= 1 << (h & 0x7); } Index: if_rue.c =================================================================== RCS file: /home/ncvs/src/sys/dev/usb/if_rue.c,v retrieving revision 1.2.2.2 diff -u -r1.2.2.2 if_rue.c --- if_rue.c 1 Mar 2004 00:07:21 -0000 1.2.2.2 +++ if_rue.c 13 Apr 2004 22:06:35 -0000 @@ -22,7 +22,37 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. + */ +/*- + * Copyright (c) 1997, 1998, 1999, 2000 + * Bill Paul . All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Bill Paul. + * 4. Neither the name of the author nor the names of any co-contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. * + * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. */ #include @@ -73,7 +103,7 @@ #include "miibus_if.h" #ifdef USB_DEBUG -static int ruedebug = 0; +Static int ruedebug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, rue, CTLFLAG_RW, 0, "USB rue"); SYSCTL_INT(_hw_usb_rue, OID_AUTO, debug, CTLFLAG_RW, &ruedebug, 0, "rue debug level"); @@ -127,7 +157,7 @@ Static int rue_miibus_writereg(device_ptr_t, int, int, int); Static void rue_miibus_statchg(device_ptr_t); -static u_int8_t rue_calchash(caddr_t); +Static uint32_t rue_mchash(const uint8_t *); Static void rue_setmulti(struct rue_softc *); Static void rue_reset(struct rue_softc *); @@ -434,22 +464,20 @@ * Calculate CRC of a multicast group address, return the upper 6 bits. */ -static u_int8_t -rue_calchash(caddr_t addr) +Static uint32_t +rue_mchash(const uint8_t *addr) { - u_int32_t crc, carry; - int i, j; - u_int8_t c; + uint32_t crc, carry; + int idx, bit; + uint8_t data; /* Compute CRC for the address value. */ crc = 0xFFFFFFFF; /* initial value */ - for (i = 0; i < 6; i++) { - c = *(addr + i); - for (j = 0; j < 8; j++) { - carry = ((crc & 0x80000000) ? 1 : 0) ^ (c & 0x01); + for (idx = 0; idx < 6; idx++) { + for (data = *addr++, bit = 0; bit < 8; bit++, data >>= 1) { + carry = ((crc & 0x80000000) ? 1 : 0) ^ (data & 0x01); crc <<= 1; - c >>= 1; if (carry) crc = (crc ^ 0x04c11db6) | carry; } @@ -499,7 +527,7 @@ { if (ifma->ifma_addr->sa_family != AF_LINK) continue; - h = rue_calchash(LLADDR((struct sockaddr_dl *)ifma->ifma_addr)); + h = rue_mchash(LLADDR((struct sockaddr_dl *)ifma->ifma_addr)); if (h < 32) hashes[0] |= (1 << h); else @@ -752,14 +780,14 @@ struct mbuf *m_new = NULL; if (m == NULL) { - MGETHDR(m_new, M_NOWAIT, MT_DATA); + MGETHDR(m_new, M_DONTWAIT, MT_DATA); if (m_new == NULL) { printf("rue%d: no memory for rx list " "-- packet dropped!\n", sc->rue_unit); return (ENOBUFS); } - MCLGET(m_new, M_NOWAIT); + MCLGET(m_new, M_DONTWAIT); if (!(m_new->m_flags & M_EXT)) { printf("rue%d: no memory for rx list " "-- packet dropped!\n", sc->rue_unit); Index: uftdi.c =================================================================== RCS file: /home/ncvs/src/sys/dev/usb/uftdi.c,v retrieving revision 1.3.2.4 diff -u -r1.3.2.4 uftdi.c --- uftdi.c 1 Mar 2004 00:07:22 -0000 1.3.2.4 +++ uftdi.c 13 Apr 2004 22:06:35 -0000 @@ -152,7 +152,16 @@ if (uaa->vendor == USB_VENDOR_FTDI && (uaa->product == USB_PRODUCT_FTDI_SERIAL_8U100AX || - uaa->product == USB_PRODUCT_FTDI_SERIAL_8U232AM)) + uaa->product == USB_PRODUCT_FTDI_SERIAL_8U232AM || + uaa->product == USB_PRODUCT_FTDI_CFA_631 || + uaa->product == USB_PRODUCT_FTDI_CFA_632 || + uaa->product == USB_PRODUCT_FTDI_CFA_633 || + uaa->product == USB_PRODUCT_FTDI_CFA_634 || + uaa->product == USB_PRODUCT_FTDI_USBSERIAL || + uaa->product == USB_PRODUCT_FTDI_MX2_3 || + uaa->product == USB_PRODUCT_FTDI_MX4_5 || + uaa->product == USB_PRODUCT_FTDI_LK202 || + uaa->product == USB_PRODUCT_FTDI_LK204)) return (UMATCH_VENDOR_PRODUCT); return (UMATCH_NONE); @@ -205,6 +214,15 @@ sc->sc_hdrlen = 1; break; case USB_PRODUCT_FTDI_SERIAL_8U232AM: + case USB_PRODUCT_FTDI_CFA_631: + case USB_PRODUCT_FTDI_CFA_632: + case USB_PRODUCT_FTDI_CFA_633: + case USB_PRODUCT_FTDI_CFA_634: + case USB_PRODUCT_FTDI_USBSERIAL: + case USB_PRODUCT_FTDI_MX2_3: + case USB_PRODUCT_FTDI_MX4_5: + case USB_PRODUCT_FTDI_LK202: + case USB_PRODUCT_FTDI_LK204: sc->sc_type = UFTDI_TYPE_8U232AM; sc->sc_hdrlen = 0; break; Index: uhci.c =================================================================== RCS file: /home/ncvs/src/sys/dev/usb/uhci.c,v retrieving revision 1.40.2.13 diff -u -r1.40.2.13 uhci.c --- uhci.c 1 Mar 2004 00:07:22 -0000 1.40.2.13 +++ uhci.c 13 Apr 2004 22:06:35 -0000 @@ -724,6 +724,9 @@ #endif sc->sc_bus.use_polling++; sc->sc_suspend = why; + UWRITE2(sc, UHCI_INTR, 0); /* disable interrupts */ + uhci_globalreset(sc); /* reset the controller */ + uhci_reset(sc); if (cmd & UHCI_CMD_RS) uhci_run(sc, 0); /* in case BIOS has started it */ Index: usbdi.c =================================================================== RCS file: /home/ncvs/src/sys/dev/usb/usbdi.c,v retrieving revision 1.34.2.9 diff -u -r1.34.2.9 usbdi.c --- usbdi.c 1 Mar 2004 07:23:27 -0000 1.34.2.9 +++ usbdi.c 13 Apr 2004 22:06:36 -0000 @@ -1,9 +1,4 @@ -/* $NetBSD: usbdi.c,v 1.101 2002/06/01 23:51:04 lukem Exp $ */ - -/* Also already have from NetBSD: - * $NetBSD: usbdi.c,v 1.102 2002/07/11 21:14:35 augustss Exp $ - * $NetBSD: usbdi.c,v 1.103 2002/09/27 15:37:38 provos Exp $ - */ +/* $NetBSD: usbdi.c,v 1.103 2002/09/27 15:37:38 provos Exp $ */ #include __FBSDID("$FreeBSD: src/sys/dev/usb/usbdi.c,v 1.34.2.9 2004/03/01 07:23:27 julian Exp $"); @@ -1118,11 +1113,9 @@ int usbd_ratecheck(struct timeval *last) { -#if 0 - static struct timeval errinterval = { 0, 250000 }; /* 0.25 s*/ - - return (ratecheck(last, &errinterval)); -#endif + if (last->tv_sec == time_second) + return (0); + last->tv_sec = time_second; return (1); } Index: uscanner.c =================================================================== RCS file: /home/ncvs/src/sys/dev/usb/uscanner.c,v retrieving revision 1.2.2.19 diff -u -r1.2.2.19 uscanner.c --- uscanner.c 1 Mar 2004 00:07:23 -0000 1.2.2.19 +++ uscanner.c 13 Apr 2004 22:06:36 -0000 @@ -196,6 +196,7 @@ {{ USB_VENDOR_EPSON, USB_PRODUCT_EPSON_640U }, 0 }, {{ USB_VENDOR_EPSON, USB_PRODUCT_EPSON_1650 }, 0 }, {{ USB_VENDOR_EPSON, USB_PRODUCT_EPSON_1660 }, 0 }, + {{ USB_VENDOR_EPSON, USB_PRODUCT_EPSON_1670 }, 0 }, {{ USB_VENDOR_EPSON, USB_PRODUCT_EPSON_1260 }, 0 }, {{ USB_VENDOR_EPSON, USB_PRODUCT_EPSON_3200 }, USC_KEEP_OPEN }, {{ USB_VENDOR_EPSON, USB_PRODUCT_EPSON_GT9700F }, USC_KEEP_OPEN }, Index: uvisor.c =================================================================== RCS file: /home/ncvs/src/sys/dev/usb/uvisor.c,v retrieving revision 1.7.2.9 diff -u -r1.7.2.9 uvisor.c --- uvisor.c 4 Apr 2004 19:17:35 -0000 1.7.2.9 +++ uvisor.c 13 Apr 2004 22:06:36 -0000 @@ -1,3 +1,4 @@ +/* $NetBSD: uvisor.c,v 1.9 2001/01/23 14:04:14 augustss Exp $ */ /* $FreeBSD: src/sys/dev/usb/uvisor.c,v 1.7.2.9 2004/04/04 19:17:35 joe Exp $ */ /* Also already merged from NetBSD: @@ -163,6 +164,8 @@ Static usbd_status uvisor_init(struct uvisor_softc *); +Static usbd_status clie_3_5_init(struct uvisor_softc *); + Static void uvisor_close(void *, int); struct ucom_callback uvisor_callback = { @@ -221,6 +224,7 @@ {{ USB_VENDOR_SONY, USB_PRODUCT_SONY_CLIE_41 }, 0 }, {{ USB_VENDOR_SONY, USB_PRODUCT_SONY_CLIE_S360 }, PALM4 }, {{ USB_VENDOR_SONY, USB_PRODUCT_SONY_CLIE_NX60 }, PALM4 }, + {{ USB_VENDOR_SONY, USB_PRODUCT_SONY_CLIE_35 }, 0 }, /* {{ USB_VENDOR_SONY, USB_PRODUCT_SONY_CLIE_25 }, PALM4 },*/ }; #define uvisor_lookup(v, p) ((const struct uvisor_type *)usb_lookup(uvisor_devs, v, p)) @@ -336,7 +340,12 @@ ucom->sc_opkthdrlen = 0; ucom->sc_callback = &uvisor_callback; - err = uvisor_init(sc); + if (uaa->vendor == USB_VENDOR_SONY && + uaa->product == USB_PRODUCT_SONY_CLIE_35) + err = clie_3_5_init(sc); + else + err = uvisor_init(sc); + if (err) { printf("%s: init failed, %s\n", USBDEVNAME(ucom->sc_dev), usbd_errstr(err)); @@ -482,6 +491,76 @@ DPRINTF(("uvisor_init: avail=%d\n", UGETW(avail))); DPRINTF(("uvisor_init: done\n")); + return (err); +} + +usbd_status +clie_3_5_init(struct uvisor_softc *sc) +{ + usbd_status err; + usb_device_request_t req; + char buffer[256]; + + /* + * Note that PEG-300 series devices expect the following two calls. + */ + + /* get the config number */ + DPRINTF(("clie_3_5_init: getting config info\n")); + req.bmRequestType = UT_READ; + req.bRequest = UR_GET_CONFIG; + USETW(req.wValue, 0); + USETW(req.wIndex, 0); + USETW(req.wLength, 1); + err = usbd_do_request(sc->sc_ucom.sc_udev, &req, buffer); + if (err) + return (err); + + /* get the interface number */ + DPRINTF(("clie_3_5_init: get the interface number\n")); + req.bmRequestType = UT_READ_DEVICE; + req.bRequest = UR_GET_INTERFACE; + USETW(req.wValue, 0); + USETW(req.wIndex, 0); + USETW(req.wLength, 1); + err = usbd_do_request(sc->sc_ucom.sc_udev, &req, buffer); + if (err) + return (err); + +#ifdef USB_DEBUG + { + struct uvisor_connection_info coninfo; + int i, np; + char *string; + + np = UGETW(coninfo.num_ports); + DPRINTF(("%s: Number of ports: %d\n", USBDEVNAME(sc->sc_ucom.sc_dev), np)); + for (i = 0; i < np; ++i) { + switch (coninfo.connections[i].port_function_id) { + case UVISOR_FUNCTION_GENERIC: + string = "Generic"; + break; + case UVISOR_FUNCTION_DEBUGGER: + string = "Debugger"; + break; + case UVISOR_FUNCTION_HOTSYNC: + string = "HotSync"; + break; + case UVISOR_FUNCTION_REMOTE_FILE_SYS: + string = "Remote File System"; + break; + default: + string = "unknown"; + break; + } + DPRINTF(("%s: port %d, is for %s\n", + USBDEVNAME(sc->sc_ucom.sc_dev), coninfo.connections[i].port, + string)); + } + } +#endif + + DPRINTF(("clie_3_5_init: done\n")); return (err); } Index: uvscom.c =================================================================== RCS file: /home/ncvs/src/sys/dev/usb/uvscom.c,v retrieving revision 1.9.2.9 diff -u -r1.9.2.9 uvscom.c --- uvscom.c 1 Mar 2004 00:07:23 -0000 1.9.2.9 +++ uvscom.c 13 Apr 2004 22:06:36 -0000 @@ -59,7 +59,6 @@ #include #endif #include -#include #include #include