Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Apr 2002 12:57:29 -0800 (PST)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 8822 for review
Message-ID:  <200204012057.g31KvTf46197@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://people.freebsd.org/~peter/p4db/chv.cgi?CH=8822

Change 8822 by jhb@jhb_laptop on 2002/04/01 12:57:23

	IFC.

Affected files ...

... //depot/projects/smpng/sys/dev/usb/devlist2h.awk#2 integrate
... //depot/projects/smpng/sys/dev/usb/hid.h#2 integrate
... //depot/projects/smpng/sys/dev/usb/ohci.c#12 integrate
... //depot/projects/smpng/sys/dev/usb/ohcivar.h#5 integrate
... //depot/projects/smpng/sys/dev/usb/uhci.c#13 integrate
... //depot/projects/smpng/sys/dev/usb/uhcivar.h#4 integrate
... //depot/projects/smpng/sys/dev/usb/uhid.c#7 integrate
... //depot/projects/smpng/sys/dev/usb/umodem.c#9 integrate
... //depot/projects/smpng/sys/dev/usb/urio.c#7 integrate
... //depot/projects/smpng/sys/dev/usb/usb.c#9 integrate
... //depot/projects/smpng/sys/dev/usb/usb_subr.c#7 integrate
... //depot/projects/smpng/sys/dev/usb/usbdevs.h#17 integrate
... //depot/projects/smpng/sys/dev/usb/usbdevs_data.h#17 integrate
... //depot/projects/smpng/sys/dev/usb/usbdi.c#6 integrate
... //depot/projects/smpng/sys/dev/usb/usbdi.h#4 integrate
... //depot/projects/smpng/sys/dev/usb/usbdi_util.c#3 integrate
... //depot/projects/smpng/sys/dev/usb/usbdivar.h#6 integrate
... //depot/projects/smpng/sys/dev/wi/if_wavelan_ieee.h#4 integrate
... //depot/projects/smpng/sys/dev/wi/if_wi.c#24 integrate
... //depot/projects/smpng/sys/dev/wi/if_wireg.h#8 integrate
... //depot/projects/smpng/sys/i386/conf/NOTES#31 integrate
... //depot/projects/smpng/sys/kern/kern_prot.c#54 integrate
... //depot/projects/smpng/sys/kern/kern_shutdown.c#19 integrate
... //depot/projects/smpng/sys/sys/disklabel.h#10 integrate
... //depot/projects/smpng/sys/sys/ktr.h#8 integrate

Differences ...

==== //depot/projects/smpng/sys/dev/usb/devlist2h.awk#2 (text+ko) ====

@@ -1,6 +1,6 @@
 #! /usr/bin/awk -f
-#	$NetBSD: devlist2h.awk,v 1.6 1999/08/17 16:06:20 augustss Exp $
-#  $FreeBSD: src/sys/dev/usb/devlist2h.awk,v 1.1 1999/11/18 18:02:44 n_hibma Exp $
+#	$NetBSD: usb/devlist2h.awk,v 1.9 2001/01/18 20:28:22 jdolecek Exp $
+#  $FreeBSD: src/sys/dev/usb/devlist2h.awk,v 1.2 2002/04/01 19:22:04 joe Exp $
 #
 # Copyright (c) 1995, 1996 Christopher G. Demetriou
 # All rights reserved.
@@ -175,7 +175,7 @@
 
 	printf("\n") > dfile
 
-	printf("struct usb_knowndev usb_knowndevs[] = {\n") > dfile
+	printf("const struct usb_knowndev usb_knowndevs[] = {\n") > dfile
 	for (i = 1; i <= nproducts; i++) {
 		printf("\t{\n") > dfile
 		printf("\t    USB_VENDOR_%s, USB_PRODUCT_%s_%s,\n",

==== //depot/projects/smpng/sys/dev/usb/hid.h#2 (text+ko) ====

@@ -1,5 +1,5 @@
-/*	$NetBSD: hid.h,v 1.5 2000/04/27 15:26:46 augustss Exp $	*/
-/*	$FreeBSD: src/sys/dev/usb/hid.h,v 1.10 2000/07/17 18:41:18 n_hibma Exp $ */
+/*	$NetBSD: hid.h,v 1.6 2000/06/01 14:28:57 augustss Exp $	*/
+/*	$FreeBSD: src/sys/dev/usb/hid.h,v 1.11 2002/04/01 19:01:08 joe Exp $ */
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.

==== //depot/projects/smpng/sys/dev/usb/ohci.c#12 (text+ko) ====

@@ -1,5 +1,5 @@
-/*	$NetBSD: ohci.c,v 1.90 2000/05/08 18:28:46 thorpej Exp $	*/
-/*	$FreeBSD: src/sys/dev/usb/ohci.c,v 1.73 2002/04/01 13:28:49 joe Exp $	*/
+/*	$NetBSD: ohci.c,v 1.94 2000/11/10 14:11:49 augustss Exp $	*/
+/*	$FreeBSD: src/sys/dev/usb/ohci.c,v 1.76 2002/04/01 20:01:41 joe Exp $	*/
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -91,6 +91,9 @@
 #define DPRINTF(x)	if (ohcidebug) logprintf x
 #define DPRINTFN(n,x)	if (ohcidebug>(n)) logprintf x
 int ohcidebug = 1;
+#ifndef __NetBSD__
+#define bitmask_snprintf(q,f,b,l) snprintf((b), (l), "%b", (q), (f))
+#endif
 #else
 #define DPRINTF(x)
 #define DPRINTFN(n,x)
@@ -1315,6 +1318,7 @@
 				(struct ohci_pipe *)xfer->pipe;
 			if (sitd->flags & OHCI_CALL_DONE) {
 				opipe->u.iso.inuse -= xfer->nframes;
+				/* XXX update frlengths with actual length */
 				/* XXX xfer->actlen = actlen; */
 				xfer->status = USBD_NORMAL_COMPLETION;
 				usb_transfer_complete(xfer);
@@ -1779,11 +1783,15 @@
 void
 ohci_dump_td(ohci_soft_td_t *std)
 {
-	DPRINTF(("TD(%p) at %08lx: %b delay=%d ec=%d cc=%d\ncbp=0x%08lx "
+	char sbuf[128];
+
+	bitmask_snprintf((int)le32toh(std->td.td_flags),
+			 "\20\23R\24OUT\25IN\31TOG1\32SETTOGGLE",
+			 sbuf, sizeof(sbuf));
+
+	DPRINTF(("TD(%p) at %08lx: %s delay=%d ec=%d cc=%d\ncbp=0x%08lx "
 		 "nexttd=0x%08lx be=0x%08lx\n",
-		 std, (u_long)std->physaddr,
-		 (int)le32toh(std->td.td_flags),
-		 "\20\23R\24OUT\25IN\31TOG1\32SETTOGGLE",
+		 std, (u_long)std->physaddr, sbuf,
 		 OHCI_TD_GET_DI(le32toh(std->td.td_flags)),
 		 OHCI_TD_GET_EC(le32toh(std->td.td_flags)),
 		 OHCI_TD_GET_CC(le32toh(std->td.td_flags)),
@@ -1823,17 +1831,22 @@
 void
 ohci_dump_ed(ohci_soft_ed_t *sed)
 {
- 	DPRINTF(("ED(%p) at 0x%08lx: addr=%d endpt=%d maxp=%d %b\ntailp=0x%08lx "
- 		 "headflags=%b headp=0x%08lx nexted=0x%08lx\n",
+	char sbuf[128], sbuf2[128];
+
+	bitmask_snprintf((int)le32toh(sed->ed.ed_flags),
+			 "\20\14OUT\15IN\16LOWSPEED\17SKIP\20ISO",
+			 sbuf, sizeof(sbuf));
+	bitmask_snprintf((u_long)le32toh(sed->ed.ed_headp),
+			 "\20\1HALT\2CARRY", sbuf2, sizeof(sbuf2));
+
+	DPRINTF(("ED(%p) at 0x%08lx: addr=%d endpt=%d maxp=%d %s\ntailp=0x%08lx "
+		 "headflags=%s headp=0x%08lx nexted=0x%08lx\n",
+
 		 sed, (u_long)sed->physaddr,
 		 OHCI_ED_GET_FA(le32toh(sed->ed.ed_flags)),
 		 OHCI_ED_GET_EN(le32toh(sed->ed.ed_flags)),
-		 OHCI_ED_GET_MAXP(le32toh(sed->ed.ed_flags)),
-		 (int)le32toh(sed->ed.ed_flags),
-		 "\20\14OUT\15IN\16LOWSPEED\17SKIP\20ISO",
-		 (u_long)(uintptr_t)le32toh(sed->ed.ed_tailp),
-		 (int)(uintptr_t)le32toh(sed->ed.ed_headp),
-		 "\20\1HALT\2CARRY",
+		 OHCI_ED_GET_MAXP(le32toh(sed->ed.ed_flags)), sbuf,
+		 (u_long)le32toh(sed->ed.ed_tailp), sbuf2,
 		 (u_long)le32toh(sed->ed.ed_headp),
 		 (u_long)le32toh(sed->ed.ed_nexted)));
 }

==== //depot/projects/smpng/sys/dev/usb/ohcivar.h#5 (text+ko) ====

@@ -1,5 +1,5 @@
-/*	$NetBSD: ohcivar.h,v 1.21 2000/03/29 01:46:27 augustss Exp $	*/
-/*	$FreeBSD: src/sys/dev/usb/ohcivar.h,v 1.25 2002/04/01 13:18:11 joe Exp $	*/
+/*	$NetBSD: ohcivar.h,v 1.22 2000/04/25 09:20:55 augustss Exp $	*/
+/*	$FreeBSD: src/sys/dev/usb/ohcivar.h,v 1.26 2002/04/01 19:01:08 joe Exp $	*/
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.

==== //depot/projects/smpng/sys/dev/usb/uhci.c#13 (text+ko) ====

@@ -1,5 +1,5 @@
-/*	$NetBSD: uhci.c,v 1.118 2000/05/30 16:56:54 augustss Exp $	*/
-/*	$FreeBSD: src/sys/dev/usb/uhci.c,v 1.90 2002/04/01 13:36:09 joe Exp $	*/
+/*	$NetBSD: uhci.c,v 1.130 2000/12/18 15:55:30 tsutsui Exp $	*/
+/*	$FreeBSD: src/sys/dev/usb/uhci.c,v 1.96 2002/04/01 20:18:21 joe Exp $	*/
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -763,6 +763,8 @@
 void
 uhci_dump_td(uhci_soft_td_t *p)
 {
+	char sbuf[128], sbuf2[128];
+
 	DPRINTFN(-1,("TD(%p) at %08lx = link=0x%08lx status=0x%08lx "
 		     "token=0x%08lx buffer=0x%08lx\n",
 		     p, (long)p->physaddr,
@@ -770,13 +772,16 @@
 		     (long)le32toh(p->td.td_status),
 		     (long)le32toh(p->td.td_token),
 		     (long)le32toh(p->td.td_buffer)));
-	DPRINTFN(-1,("  %b %b,errcnt=%d,actlen=%d pid=%02x,addr=%d,endpt=%d,"
-		     "D=%d,maxlen=%d\n",
-		     (int)le32toh(p->td.td_link),
-		     "\20\1T\2Q\3VF",
-		     (int)le32toh(p->td.td_status),
-		     "\20\22BITSTUFF\23CRCTO\24NAK\25BABBLE\26DBUFFER\27"
-		     "STALLED\30ACTIVE\31IOC\32ISO\33LS\36SPD",
+
+	bitmask_snprintf((int)le32toh(p->td.td_link), "\20\1T\2Q\3VF",
+			 sbuf, sizeof(sbuf));
+	bitmask_snprintf((int)le32toh(p->td.td_status),
+			 "\20\22BITSTUFF\23CRCTO\24NAK\25BABBLE\26DBUFFER\27"
+			 "STALLED\30ACTIVE\31IOC\32ISO\33LS\36SPD",
+			 sbuf2, sizeof(sbuf2));
+
+	DPRINTFN(-1,("  %s %s,errcnt=%d,actlen=%d pid=%02x,addr=%d,endpt=%d,"
+		     "D=%d,maxlen=%d\n", sbuf, sbuf2,
 		     UHCI_TD_GET_ERRCNT(le32toh(p->td.td_status)),
 		     UHCI_TD_GET_ACTLEN(le32toh(p->td.td_status)),
 		     UHCI_TD_GET_PID(le32toh(p->td.td_token)),
@@ -1167,6 +1172,9 @@
 		uhci_dumpregs(sc);
 	}
 #endif
+	status = UREAD2(sc, UHCI_STS);
+	if (status == 0)	/* The interrupt was not for us. */
+		return (0);
 
 	if (sc->sc_suspend != PWR_RESUME) {
 		printf("%s: interrupt while not operating ignored\n",
@@ -1174,10 +1182,6 @@
 		return (0);
 	}
 
-	status = UREAD2(sc, UHCI_STS);
-	if (status == 0)	/* The interrupt was not for us. */
-		return (0);
-
 #if defined(DIAGNOSTIC) && defined(__NetBSD__)
 	if (sc->sc_suspend != PWR_RESUME)
 		printf("uhci_intr: suspended sts=0x%x\n", status);
@@ -1205,8 +1209,9 @@
 	}
 	if (status & UHCI_STS_HCH) {
 		/* no acknowledge needed */
-		printf("%s: host controller halted\n",
-		       USBDEVNAME(sc->sc_bus.bdev));
+		if (!sc->sc_dying)
+			printf("%s: host controller halted\n", 
+			    USBDEVNAME(sc->sc_bus.bdev));
 		sc->sc_dying = 1;
 	}
 
@@ -1345,7 +1350,7 @@
 	if (xfer->nframes != 0) {
 		/* Isoc transfer, do things differently. */
 		uhci_soft_td_t **stds = upipe->u.iso.stds;
-		int i, n, nframes;
+		int i, n, nframes, len;
 
 		DPRINTFN(5,("uhci_idone: ii=%p isoc ready\n", ii));
 
@@ -1363,7 +1368,9 @@
 			if (++n >= UHCI_VFRAMELIST_COUNT)
 				n = 0;
 			status = le32toh(std->td.td_status);
-			actlen += UHCI_TD_GET_ACTLEN(status);
+			len = UHCI_TD_GET_ACTLEN(status);
+			xfer->frlengths[i] = len;
+			actlen += len;
 		}
 		upipe->u.iso.inuse -= nframes;
 		xfer->actlen = actlen;
@@ -2373,7 +2380,7 @@
 	for (i = 0; i < nframes; i++) {
 		std = stds[n];
 		std->td.td_status &= htole32(~(UHCI_TD_ACTIVE | UHCI_TD_IOC));
-		len = UHCI_TD_GET_MAXLEN(std->td.td_token);
+		len = UHCI_TD_GET_MAXLEN(le32toh(std->td.td_token));
 		if (len > maxlen)
 			maxlen = len;
 		if (++n >= UHCI_VFRAMELIST_COUNT)

==== //depot/projects/smpng/sys/dev/usb/uhcivar.h#4 (text+ko) ====

@@ -1,5 +1,5 @@
-/*	$NetBSD: uhcivar.h,v 1.29 2000/04/25 09:20:55 augustss Exp $	*/
-/*	$FreeBSD: src/sys/dev/usb/uhcivar.h,v 1.30 2002/03/16 12:44:21 joe Exp $	*/
+/*	$NetBSD: uhcivar.h,v 1.31 2000/06/01 14:28:59 augustss Exp $	*/
+/*	$FreeBSD: src/sys/dev/usb/uhcivar.h,v 1.31 2002/04/01 19:01:08 joe Exp $	*/
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.

==== //depot/projects/smpng/sys/dev/usb/uhid.c#7 (text+ko) ====

@@ -1,5 +1,5 @@
-/*	$NetBSD: uhid.c,v 1.38 2000/04/27 15:26:48 augustss Exp $	*/
-/*	$FreeBSD: src/sys/dev/usb/uhid.c,v 1.44 2002/03/11 16:22:15 joe Exp $	*/
+/*	$NetBSD: uhid.c,v 1.40 2000/10/10 12:37:01 augustss Exp $	*/
+/*	$FreeBSD: src/sys/dev/usb/uhid.c,v 1.46 2002/04/01 20:32:50 joe Exp $	*/
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -228,7 +228,7 @@
 
 	sc->sc_ep_addr = ed->bEndpointAddress;
 
-	desc = 0;
+	desc = NULL;
 	err = usbd_alloc_report_desc(uaa->iface, &desc, &size, M_USBDEV);
 	if (err) {
 		printf("%s: no report descriptor\n", USBDEVNAME(sc->sc_dev));
@@ -256,9 +256,7 @@
 
 #if defined(__NetBSD__) || defined(__OpenBSD__)
 int
-uhid_activate(self, act)
-	device_ptr_t self;
-	enum devact act;
+uhid_activate(device_ptr_t self, enum devact act)
 {
 	struct uhid_softc *sc = (struct uhid_softc *)self;
 
@@ -323,16 +321,14 @@
 	destroy_dev(sc->dev);
 #endif
 
-	free(sc->sc_repdesc, M_USBDEV);
+	if (sc->sc_repdesc)
+		free(sc->sc_repdesc, M_USBDEV);
 
 	return (0);
 }
 
 void
-uhid_intr(xfer, addr, status)
-	usbd_xfer_handle xfer;
-	usbd_private_handle addr;
-	usbd_status status;
+uhid_intr(usbd_xfer_handle xfer, usbd_private_handle addr, usbd_status status)
 {
 	struct uhid_softc *sc = addr;
 
@@ -376,11 +372,7 @@
 }
 
 int
-uhidopen(dev, flag, mode, p)
-	dev_t dev;
-	int flag;
-	int mode;
-	usb_proc_ptr p;
+uhidopen(dev_t dev, int flag, int mode, usb_proc_ptr p)
 {
 	struct uhid_softc *sc;
 	usbd_status err;
@@ -425,11 +417,7 @@
 }
 
 int
-uhidclose(dev, flag, mode, p)
-	dev_t dev;
-	int flag;
-	int mode;
-	usb_proc_ptr p;
+uhidclose(dev_t dev, int flag, int mode, usb_proc_ptr p)
 {
 	struct uhid_softc *sc;
 
@@ -456,10 +444,7 @@
 }
 
 int
-uhid_do_read(sc, uio, flag)
-	struct uhid_softc *sc;
-	struct uio *uio;
-	int flag;
+uhid_do_read(struct uhid_softc *sc, struct uio *uio, int flag)
 {
 	int s;
 	int error = 0;
@@ -521,10 +506,7 @@
 }
 
 int
-uhidread(dev, uio, flag)
-	dev_t dev;
-	struct uio *uio;
-	int flag;
+uhidread(dev_t dev, struct uio *uio, int flag)
 {
 	struct uhid_softc *sc;
 	int error;
@@ -539,10 +521,7 @@
 }
 
 int
-uhid_do_write(sc, uio, flag)
-	struct uhid_softc *sc;
-	struct uio *uio;
-	int flag;
+uhid_do_write(struct uhid_softc *sc, struct uio *uio, int flag)
 {
 	int error;
 	int size;
@@ -573,10 +552,7 @@
 }
 
 int
-uhidwrite(dev, uio, flag)
-	dev_t dev;
-	struct uio *uio;
-	int flag;
+uhidwrite(dev_t dev, struct uio *uio, int flag)
 {
 	struct uhid_softc *sc;
 	int error;
@@ -591,12 +567,8 @@
 }
 
 int
-uhid_do_ioctl(sc, cmd, addr, flag, p)
-	struct uhid_softc *sc;
-	u_long cmd;
-	caddr_t addr;
-	int flag;
-	usb_proc_ptr p;
+uhid_do_ioctl(struct uhid_softc *sc, u_long cmd, caddr_t addr, int flag,
+	      usb_proc_ptr p)
 {
 	struct usb_ctl_report_desc *rd;
 	struct usb_ctl_report *re;
@@ -706,12 +678,7 @@
 }
 
 int
-uhidioctl(dev, cmd, addr, flag, p)
-	dev_t dev;
-	u_long cmd;
-	caddr_t addr;
-	int flag;
-	usb_proc_ptr p;
+uhidioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, usb_proc_ptr p)
 {
 	struct uhid_softc *sc;
 	int error;
@@ -726,10 +693,7 @@
 }
 
 int
-uhidpoll(dev, events, p)
-	dev_t dev;
-	int events;
-	usb_proc_ptr p;
+uhidpoll(dev_t dev, int events, usb_proc_ptr p)
 {
 	struct uhid_softc *sc;
 	int revents = 0;

==== //depot/projects/smpng/sys/dev/usb/umodem.c#9 (text+ko) ====

@@ -1,5 +1,5 @@
 /*	$NetBSD: umodem.c,v 1.5 1999/01/08 11:58:25 augustss Exp $	*/
-/*	$FreeBSD: src/sys/dev/usb/umodem.c,v 1.35 2002/03/11 16:22:15 joe Exp $	*/
+/*	$FreeBSD: src/sys/dev/usb/umodem.c,v 1.36 2002/04/01 19:01:09 joe Exp $	*/
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -361,9 +361,7 @@
 }
 
 void
-umodem_get_caps(dev, cm, acm)
-	usbd_device_handle dev;
-	int *cm, *acm;
+umodem_get_caps(usbd_device_handle dev, int *cm, int *acm)
 {
 	usb_cdc_cm_descriptor_t *cmd;
 	usb_cdc_acm_descriptor_t *cad;
@@ -386,8 +384,7 @@
 } 
 
 void
-umodemstart(tp)
-	struct tty *tp;
+umodemstart(struct tty *tp)
 {
 	struct umodem_softc *sc;
 	struct cblock *cbp;
@@ -465,10 +462,8 @@
 }
 
 void
-umodemwritecb(xfer, priv, status)
-	usbd_xfer_handle xfer;
-	usbd_private_handle priv;
-	usbd_status status;
+umodemwritecb(usbd_xfer_handle xfer, usbd_private_handle priv,
+	      usbd_status status)
 {
 	struct umodem_softc *sc = (struct umodem_softc *)priv;
 	struct tty *tp = sc->sc_tty;
@@ -502,9 +497,7 @@
 }
 
 int
-umodemparam(tp, t)
-	struct tty *tp;
-	struct termios *t;
+umodemparam(struct tty *tp, struct termios *t)
 {
 	struct umodem_softc *sc;
 	usb_cdc_line_state_t ls;
@@ -574,10 +567,7 @@
 }
 
 int
-umodemopen(dev, flag, mode, p)
-	dev_t dev;
-	int flag, mode;
-	usb_proc_ptr p;
+umodemopen(dev_t dev, int flag, int mode, usb_proc_ptr p)
 {
 	int unit = UMODEMUNIT(dev);
 	struct umodem_softc *sc;
@@ -720,8 +710,7 @@
 }
 
 usbd_status
-umodemstartread(sc)
-	struct umodem_softc *sc;
+umodemstartread(struct umodem_softc *sc)
 {
 	usbd_status err;
 
@@ -739,10 +728,7 @@
 }
  
 void
-umodemreadcb(xfer, p, status)
-	usbd_xfer_handle xfer;
-	usbd_private_handle p;
-	usbd_status status;
+umodemreadcb(usbd_xfer_handle xfer, usbd_private_handle p, usbd_status status)
 {
 	struct umodem_softc *sc = (struct umodem_softc *)p;
 	struct tty *tp = sc->sc_tty;
@@ -784,10 +770,7 @@
 }
 
 int
-umodemclose(dev, flag, mode, p)
-	dev_t dev;
-	int flag, mode;
-	usb_proc_ptr p;
+umodemclose(dev_t dev, int flag, int mode, usb_proc_ptr p)
 {
 	struct umodem_softc *sc;
 	struct tty *tp;
@@ -836,8 +819,7 @@
 }
  
 void
-umodem_cleanup(sc)
-	struct umodem_softc *sc;
+umodem_cleanup(struct umodem_softc *sc)
 {
 	umodem_shutdown(sc);
 
@@ -854,10 +836,7 @@
 }
 
 int
-umodemread(dev, uio, flag)
-	dev_t dev;
-	struct uio *uio;
-	int flag;
+umodemread(dev_t dev, uio *uio, int flag)
 {
 	struct umodem_softc *sc;
 	struct tty *tp;
@@ -873,10 +852,7 @@
 }
  
 int
-umodemwrite(dev, uio, flag)
-	dev_t dev;
-	struct uio *uio;
-	int flag;
+umodemwrite(dev_t dev, struct uio *uio, int flag)
 {
 	struct umodem_softc *sc;
 	struct tty *tp;
@@ -892,9 +868,7 @@
 }
 
 void
-umodemstop(tp, flag)
-	struct tty *tp;
-	int flag;
+umodemstop(struct tty *tp, int flag)
 {
 	struct umodem_softc *sc;
 	int s;
@@ -913,8 +887,7 @@
 }
 
 struct tty *
-umodemtty(dev)
-	dev_t dev;
+umodemtty(dev_t dev)
 {
 	struct umodem_softc *sc;
 	struct tty *tp;
@@ -927,12 +900,7 @@
 }
 
 int
-umodemioctl(dev, cmd, data, flag, p)
-	dev_t dev;
-	u_long cmd;
-	caddr_t data;
-	int flag;
-	usb_proc_ptr p;
+umodemioctl(dev_t dev, u_long cmd, caddr_t data, int flag, usb_proc_ptr p)
 {
 	struct umodem_softc *sc;
 	struct tty *tp;
@@ -1013,8 +981,7 @@
 }
 
 void
-umodem_shutdown(sc)
-	struct umodem_softc *sc;
+umodem_shutdown(struct umodem_softc *sc)
 {
 	struct tty *tp = sc->sc_tty;
 
@@ -1034,9 +1001,7 @@
 }
 
 void
-umodem_modem(sc, onoff)
-	struct umodem_softc *sc;
-	int onoff;
+umodem_modem(struct umodem_softc *sc, int onoff)
 {
 	usb_device_request_t req;
 
@@ -1057,9 +1022,7 @@
 }
 
 void
-umodem_break(sc, onoff)
-	struct umodem_softc *sc;
-	int onoff;
+umodem_break(struct umodem_softc *sc, int onoff)
 {
 	usb_device_request_t req;
 
@@ -1078,10 +1041,7 @@
 }
 
 void *
-umodem_get_desc(dev, type, subtype)
-	usbd_device_handle dev;
-	int type;
-	int subtype;
+umodem_get_desc(usbd_device_handle dev, int type, int subtype)
 {
 	usb_descriptor_t *desc;
 	usb_config_descriptor_t *cd = usbd_get_config_descriptor(dev);
@@ -1100,10 +1060,7 @@
 }
 
 usbd_status
-umodem_set_comm_feature(sc, feature, state)
-	struct umodem_softc *sc;
-	int feature;
-	int state;
+umodem_set_comm_feature(struct umodem_softc *sc, int feature, int state)
 {
 	usb_device_request_t req;
 	usbd_status err;
@@ -1127,9 +1084,7 @@
 }
 
 usbd_status
-umodem_set_line_coding(sc, state)
-	struct umodem_softc *sc;
-	usb_cdc_line_state_t *state;
+umodem_set_line_coding(struct umodem_softc *sc, usb_cdc_line_state_t state)
 {
 	usb_device_request_t req;
 	usbd_status err;
@@ -1164,9 +1119,7 @@
 
 #if defined(__NetBSD__) || defined(__OpenBSD__)
 int
-umodem_activate(self, act)
-	device_ptr_t self;
-	enum devact act;
+umodem_activate(device_ptr_t self, enum devact act)
 {
 	struct umodem_softc *sc = (struct umodem_softc *)self;
 

==== //depot/projects/smpng/sys/dev/usb/urio.c#7 (text+ko) ====

@@ -28,7 +28,7 @@
  * its contributors.
  */
 
-/* $FreeBSD: src/sys/dev/usb/urio.c,v 1.14 2002/03/11 16:22:15 joe Exp $ */
+/* $FreeBSD: src/sys/dev/usb/urio.c,v 1.15 2002/04/01 19:01:09 joe Exp $ */
 
 /*
  * 2000/3/24  added NetBSD/OpenBSD support (from Alex Nemirovsky)
@@ -292,11 +292,7 @@
 
 
 int
-urioopen(dev, flag, mode, p)
-	dev_t dev;
-	int flag;
-	int mode;
-	usb_proc_ptr p;
+urioopen(dev_t dev, int flag, int mode, usb_proc_ptr p)
 {
 #if (USBDI >= 1)
 	struct urio_softc * sc;
@@ -336,11 +332,7 @@
 }
 
 int
-urioclose(dev, flag, mode, p)
-	dev_t dev;
-	int flag;
-	int mode;
-	usb_proc_ptr p;
+urioclose(dev_t dev, int flag, int mode, usb_proc_ptr p)
 {
 #if (USBDI >= 1)
 	struct urio_softc * sc;
@@ -363,10 +355,7 @@
 }
 
 int
-urioread(dev, uio, flag)
-	dev_t dev;
-	struct uio *uio;
-	int flag;
+urioread(dev_t dev, struct uio *uio, int flag)
 {
 #if (USBDI >= 1)
 	struct urio_softc * sc;
@@ -440,10 +429,7 @@
 }
 
 int
-uriowrite(dev, uio, flag)
-	dev_t dev;
-	struct uio *uio;
-	int flag;
+uriowrite(dev_t dev, struct uio *uio, int flag)
 {
 #if (USBDI >= 1)
 	struct urio_softc * sc;
@@ -510,12 +496,7 @@
 
 
 int
-urioioctl(dev, cmd, addr, flag, p)
-	dev_t dev;
-	u_long cmd;
-	caddr_t addr; 
-	int flag;
-	usb_proc_ptr p;
+urioioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, usb_proc_ptr p)
 {
 #if (USBDI >= 1)
 	struct urio_softc * sc;
@@ -616,9 +597,7 @@
 
 #if defined(__NetBSD__) || defined(__OpenBSD__)
 int
-urio_activate(self, act)
-	device_ptr_t self;
-	enum devact act;
+urio_activate(device_ptr_t self, enum devact act)
 {
 	struct urio_softc *sc = (struct urio_softc *)self;
 

==== //depot/projects/smpng/sys/dev/usb/usb.c#9 (text+ko) ====

@@ -1,5 +1,5 @@
-/*	$NetBSD: usb.c,v 1.43 2000/03/29 18:24:53 augustss Exp $	*/
-/*	$FreeBSD: src/sys/dev/usb/usb.c,v 1.60 2002/04/01 16:53:29 joe Exp $	*/
+/*	$NetBSD: usb.c,v 1.48 2000/12/13 04:05:14 augustss Exp $	*/
+/*	$FreeBSD: src/sys/dev/usb/usb.c,v 1.62 2002/04/01 17:54:07 joe Exp $	*/
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -170,11 +170,6 @@
 
 Static int usb_get_next_event(struct usb_event *);
 
-#if defined(__NetBSD__) || defined(__OpenBSD__)
-/* Flag to see if we are in the cold boot process. */
-extern int cold;
-#endif
-
 Static const char *usbrev_str[] = USBREV_STR;
 
 USB_DECLARE_DRIVER_INIT(usb,

==== //depot/projects/smpng/sys/dev/usb/usb_subr.c#7 (text+ko) ====

@@ -1,5 +1,5 @@
-/*	$NetBSD: usb_subr.c,v 1.71 2000/03/29 18:24:53 augustss Exp $	*/
-/*	$FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.36 2002/04/01 16:53:29 joe Exp $	*/
+/*	$NetBSD: usb_subr.c,v 1.86 2001/05/16 04:50:11 lukem Exp $	*/
+/*	$FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.41 2002/04/01 19:26:36 joe Exp $	*/
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -463,7 +463,6 @@
 	for (endpt = 0; endpt < nendpt; endpt++) {
 		DPRINTFN(10,("usbd_fill_iface_data: endpt=%d\n", endpt));
 		for (; p < end; p += ed->bLength) {
-			ed = (usb_endpoint_descriptor_t *)p;
 			DPRINTFN(10,("usbd_fill_iface_data: p=%p end=%p "
 				     "len=%d type=%d\n",
 				 p, end, ed->bLength, ed->bDescriptorType));
@@ -600,18 +599,43 @@
 		/* May be self powered. */
 		if (cdp->bmAttributes & UC_BUS_POWERED) {
 			/* Must ask device. */
-			err = usbd_get_device_status(dev, &ds);
-			if (!err && (UGETW(ds.wStatus) & UDS_SELF_POWERED))
-				selfpowered = 1;
-			DPRINTF(("usbd_set_config_index: status=0x%04x, "
-				 "error=%s\n",
-				 UGETW(ds.wStatus), usbd_errstr(err)));
+			if (dev->quirks->uq_flags & UQ_POWER_CLAIM) {
+				/*
+				 * Hub claims to be self powered, but isn't.
+				 * It seems that the power status can be
+				 * determined by the hub characteristics.
+				 */
+				usb_hub_descriptor_t hd;
+				usb_device_request_t req;
+				req.bmRequestType = UT_READ_CLASS_DEVICE;
+				req.bRequest = UR_GET_DESCRIPTOR;
+				USETW(req.wValue, 0);
+				USETW(req.wIndex, 0);
+				USETW(req.wLength, USB_HUB_DESCRIPTOR_SIZE);
+				err = usbd_do_request(dev, &req, &hd);
+				if (!err &&
+				    (UGETW(hd.wHubCharacteristics) &
+				     UHD_PWR_INDIVIDUAL))
+					selfpowered = 1;
+				DPRINTF(("usbd_set_config_index: charac=0x%04x"
+				    ", error=%s\n",
+				    UGETW(hd.wHubCharacteristics),
+				    usbd_errstr(err)));
+			} else {
+				err = usbd_get_device_status(dev, &ds);
+				if (!err &&
+				    (UGETW(ds.wStatus) & UDS_SELF_POWERED))
+					selfpowered = 1;
+				DPRINTF(("usbd_set_config_index: status=0x%04x"
+				    ", error=%s\n",
+				    UGETW(ds.wStatus), usbd_errstr(err)));
+			}
 		} else
 			selfpowered = 1;
 	}
-	DPRINTF(("usbd_set_config_index: (addr %d) attr=0x%02x, "
-		 "selfpowered=%d, power=%d\n", 
-		 dev->address, cdp->bmAttributes, 
+	DPRINTF(("usbd_set_config_index: (addr %d) cno=%d attr=0x%02x, "
+		 "selfpowered=%d, power=%d\n",
+		 cdp->bConfigurationValue, dev->address, cdp->bmAttributes, 
 		 selfpowered, cdp->bMaxPower * 2));
 
 	/* Check if we have enough power. */
@@ -623,7 +647,6 @@
 #endif
 	power = cdp->bMaxPower * 2;
 	if (power > dev->powersrc->power) {
-		DPRINTF(("power exceeded %d %d\n", power,dev->powersrc->power));
 		/* XXX print nicer message. */
 		if (msg)
 			printf("%s: device addr %d (config %d) exceeds power "
@@ -873,9 +896,6 @@
 	uaa.usegeneric = 1;
 	uaa.configno = UHUB_UNK_CONFIGURATION;
 	uaa.ifaceno = UHUB_UNK_INTERFACE;
-	uaa.vendor = UHUB_UNK_VENDOR;
-	uaa.product = UHUB_UNK_PRODUCT;
-	uaa.release = UHUB_UNK_RELEASE;
 	dv = USB_DO_ATTACH(dev, bdev, parent, &uaa, usbd_print, usbd_submatch);
 	if (dv != NULL) {
 		dev->subdevs = malloc(2 * sizeof dv, M_USB, M_NOWAIT);

==== //depot/projects/smpng/sys/dev/usb/usbdevs.h#17 (text+ko) ====

@@ -1,4 +1,4 @@
-/*	$FreeBSD: src/sys/dev/usb/usbdevs.h,v 1.94 2002/03/31 21:38:38 joe Exp $	*/
+/*	$FreeBSD: src/sys/dev/usb/usbdevs.h,v 1.95 2002/04/01 19:22:04 joe Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.

==== //depot/projects/smpng/sys/dev/usb/usbdevs_data.h#17 (text+ko) ====

@@ -1,4 +1,4 @@
-/*	$FreeBSD: src/sys/dev/usb/usbdevs_data.h,v 1.94 2002/03/31 21:38:38 joe Exp $	*/
+/*	$FreeBSD: src/sys/dev/usb/usbdevs_data.h,v 1.95 2002/04/01 19:22:04 joe Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
@@ -44,7 +44,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-struct usb_knowndev usb_knowndevs[] = {
+const struct usb_knowndev usb_knowndevs[] = {
 	{
 	    USB_VENDOR_3COM, USB_PRODUCT_3COM_HOMECONN,
 	    0,

==== //depot/projects/smpng/sys/dev/usb/usbdi.c#6 (text+ko) ====

@@ -1,5 +1,5 @@
-/*	$NetBSD: usbdi.c,v 1.73 2000/05/31 16:14:42 augustss Exp $	*/
-/*	$FreeBSD: src/sys/dev/usb/usbdi.c,v 1.51 2002/04/01 13:43:02 joe Exp $	*/
+/*	$NetBSD: usbdi.c,v 1.77 2000/09/23 21:02:04 augustss Exp $	*/
+/*	$FreeBSD: src/sys/dev/usb/usbdi.c,v 1.54 2002/04/01 17:30:24 joe Exp $	*/
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -77,10 +77,10 @@
 
 Static usbd_status usbd_ar_pipe(usbd_pipe_handle pipe);
 Static void usbd_do_request_async_cb 
-    (usbd_xfer_handle, usbd_private_handle, usbd_status);
+	(usbd_xfer_handle, usbd_private_handle, usbd_status);
 Static void usbd_start_next(usbd_pipe_handle pipe);
 Static usbd_status usbd_open_pipe_ival
-    (usbd_interface_handle, u_int8_t, u_int8_t, usbd_pipe_handle *, int);
+	(usbd_interface_handle, u_int8_t, u_int8_t, usbd_pipe_handle *, int);
 
 Static int usbd_nbuses = 0;
 
@@ -96,10 +96,9 @@
 	--usbd_nbuses;
 }
 
-Static __inline int usbd_xfer_isread(usbd_xfer_handle xfer);
-Static __inline int
-usbd_xfer_isread(xfer)
-	usbd_xfer_handle xfer;
+static __inline int usbd_xfer_isread(usbd_xfer_handle xfer);
+static __inline int
+usbd_xfer_isread(usbd_xfer_handle xfer)
 {
 	if (xfer->rqflags & URQ_REQUEST)
 		return (xfer->request.bmRequestType & UT_READ);
@@ -110,10 +109,8 @@
 
 #ifdef USB_DEBUG
 void usbd_dump_queue(usbd_pipe_handle);
-
 void
-usbd_dump_queue(pipe)
-	usbd_pipe_handle pipe;
+usbd_dump_queue(usbd_pipe_handle pipe)
 {
 	usbd_xfer_handle xfer;
 
@@ -127,23 +124,16 @@
 #endif
 
 usbd_status 
-usbd_open_pipe(iface, address, flags, pipe)
-	usbd_interface_handle iface;
-	u_int8_t address;
-	u_int8_t flags;
-	usbd_pipe_handle *pipe;
+usbd_open_pipe(usbd_interface_handle iface, u_int8_t address,
+	       u_int8_t flags, usbd_pipe_handle *pipe)
 { 
 	return (usbd_open_pipe_ival(iface, address, flags, pipe, 
 				    USBD_DEFAULT_INTERVAL));
 }
 
 usbd_status 
-usbd_open_pipe_ival(iface, address, flags, pipe, ival)
-	usbd_interface_handle iface;
-	u_int8_t address;
-	u_int8_t flags;
-	usbd_pipe_handle *pipe;
-	int ival;
+usbd_open_pipe_ival(usbd_interface_handle iface, u_int8_t address,
+		    u_int8_t flags, usbd_pipe_handle *pipe, int ival)
 { 
 	usbd_pipe_handle p;
 	struct usbd_endpoint *ep;
@@ -173,16 +163,10 @@
 }
 
 usbd_status 
-usbd_open_pipe_intr(iface, address, flags, pipe, priv, buffer, len, cb, ival)
-	usbd_interface_handle iface;
-	u_int8_t address;
-	u_int8_t flags;

>>> TRUNCATED FOR MAIL (1000 lines) <<<

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe p4-projects" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200204012057.g31KvTf46197>