Date: Fri, 31 Dec 2004 18:47:58 GMT From: John Baldwin <jhb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 68013 for review Message-ID: <200412311847.iBVIlw0R027153@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=68013 Change 68013 by jhb@jhb_slimer on 2004/12/31 18:47:24 IFC @68012. Affected files ... .. //depot/projects/smpng/sys/conf/files#131 integrate .. //depot/projects/smpng/sys/conf/kmod.mk#39 integrate .. //depot/projects/smpng/sys/dev/bktr/CHANGELOG.TXT#3 integrate .. //depot/projects/smpng/sys/dev/usb/usbdevs#70 integrate .. //depot/projects/smpng/sys/kern/kern_sysctl.c#44 integrate .. //depot/projects/smpng/sys/kern/sched_ule.c#50 integrate .. //depot/projects/smpng/sys/modules/usb/Makefile#8 integrate .. //depot/projects/smpng/sys/netipx/ipx_input.c#11 integrate .. //depot/projects/smpng/sys/netipx/ipx_pcb.c#14 integrate .. //depot/projects/smpng/sys/netipx/ipx_usrreq.c#18 integrate .. //depot/projects/smpng/sys/netipx/ipx_var.h#6 integrate .. //depot/projects/smpng/sys/netipx/spx_usrreq.c#17 integrate .. //depot/projects/smpng/sys/sys/copyright.h#6 integrate .. //depot/projects/smpng/sys/tools/usbdevs2h.awk#2 integrate Differences ... ==== //depot/projects/smpng/sys/conf/files#131 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/files,v 1.976 2004/12/28 00:07:56 rik Exp $ +# $FreeBSD: src/sys/conf/files,v 1.977 2004/12/30 23:19:40 imp Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -52,9 +52,14 @@ clean "pccarddevs.h" usbdevs.h optional usb \ dependency "$S/tools/usbdevs2h.awk $S/dev/usb/usbdevs" \ - compile-with "${AWK} -f $S/tools/usbdevs2h.awk $S/dev/usb/usbdevs" \ + compile-with "${AWK} -f $S/tools/usbdevs2h.awk $S/dev/usb/usbdevs -h" \ + no-obj no-implicit-rule before-depend \ + clean "usbdevs.h" +usbdevs_data.h optional usb \ + dependency "$S/tools/usbdevs2h.awk $S/dev/usb/usbdevs" \ + compile-with "${AWK} -f $S/tools/usbdevs2h.awk $S/dev/usb/usbdevs -d" \ no-obj no-implicit-rule before-depend \ - clean "usbdevs.h usbdevs_data.h" + clean "usbdevs_data.h" kern/device_if.m standard kern/bus_if.m standard kern/clock_if.m optional genclock ==== //depot/projects/smpng/sys/conf/kmod.mk#39 (text+ko) ==== @@ -1,5 +1,5 @@ # From: @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91 -# $FreeBSD: src/sys/conf/kmod.mk,v 1.176 2004/12/08 07:23:12 ru Exp $ +# $FreeBSD: src/sys/conf/kmod.mk,v 1.177 2004/12/30 23:22:08 imp Exp $ # # The include file <bsd.kmod.mk> handles building and installing loadable # kernel modules. @@ -340,13 +340,9 @@ ${AWK} -f @/tools/vnode_if.awk @/kern/vnode_if.src -q .endif -.for _i in mii pccard usb +.for _i in mii pccard .if ${SRCS:M${_i}devs.h} != "" CLEANFILES+= ${_i}devs.h -_i= ${_i:Musb} -.if !empty(_i) -CLEANFILES+= ${_i}devs_data.h -.endif .if !exists(@) ${_i}devs.h: @ .else @@ -356,6 +352,26 @@ .endif .endfor # _i +.if ${SRCS:Musbdevs.h} != "" +CLEANFILES+= usbdevs.h +.if !exists(@) +usbdevs.h: @ +.else +usbdevs.h: @/tools/usbdevs2h.awk @/dev/usb/usbdevs +.endif + ${AWK} -f @/tools/usbdevs2h.awk @/dev/usb/usbdevs -h +.endif + +.if ${SRCS:Musbdevs_data.h} != "" +CLEANFILES+= usbdevs_data.h +.if !exists(@) +usbdevs_data.h: @ +.else +usbdevs_data.h: @/tools/usbdevs2h.awk @/dev/usb/usbdevs +.endif + ${AWK} -f @/tools/usbdevs2h.awk @/dev/usb/usbdevs -d +.endif + .if ${SRCS:Macpi_quirks.h} != "" CLEANFILES+= acpi_quirks.h .if !exists(@) ==== //depot/projects/smpng/sys/dev/bktr/CHANGELOG.TXT#3 (text+ko) ==== @@ -1,6 +1,8 @@ -/* $FreeBSD: src/sys/dev/bktr/CHANGELOG.TXT,v 1.19 2002/05/16 22:43:18 eric Exp $ */ +/* $FreeBSD: src/sys/dev/bktr/CHANGELOG.TXT,v 1.20 2004/12/31 09:18:29 julian Exp $ */ /* * MAINTAINER = Roger Hardiman <roger@freebsd.org> + * Newsflash: Roger is temorararily out of touch and unable + * to maintain this.. */ /* @@ -518,4 +520,5 @@ support for audio on Hauppauge cards without the audio mux. The MSP is used for audio selection. (the 44xxx models) - +[see http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/dev/bktr/ +for newer change logs ] ==== //depot/projects/smpng/sys/dev/usb/usbdevs#70 (text+ko) ==== @@ -1,5 +1,5 @@ -$FreeBSD: src/sys/dev/usb/usbdevs,v 1.220 2004/12/29 06:21:41 imp Exp $ -/* $NetBSD: usbdevs,v 1.388 2004/11/05 13:51:16 scw Exp $ */ +$FreeBSD: src/sys/dev/usb/usbdevs,v 1.221 2004/12/31 18:37:49 imp Exp $ +/* $NetBSD: usbdevs,v 1.392 2004/12/29 08:38:44 imp Exp $ */ /* * Copyright (c) 1998-2004 The NetBSD Foundation, Inc. @@ -411,8 +411,10 @@ vendor EXTENDED 0x08e9 Extended Systems vendor MSYSTEMS 0x08ec M-Systems vendor AUTHENTEC 0x08ff AuthenTec +vendor AUDIOTECHNICA 0x0909 Audio-Technica vendor TRUMPION 0x090a Trumpion Microelectronics vendor ALATION 0x0910 Alation Systems +vendor CONCORDCAMERA 0x0919 Concord Camera vendor GOHUBS 0x0921 GoHubs vendor BIOMETRIC 0x0929 American Biometric Company vendor TOSHIBA 0x0930 Toshiba Corporation @@ -423,8 +425,11 @@ vendor BLUEWATER 0x0956 BlueWater Systems vendor AGILENT 0x0957 Agilent Technologies vendor PORTSMITH 0x095a Portsmith +vendor ACERW 0x0967 Acer vendor ADIRONDACK 0x0976 Adirondack Wire & Cable vendor BECKHOFF 0x0978 Beckhoff +vendor MINDSATWORK 0x097a Minds At Work +vendor POINTCHIPS 0x09a6 PointChips vendor INTERSIL 0x09aa Intersil vendor ALTIUS 0x09b3 Altius Solutions vendor ARRIS 0x09c1 Arris Interactive @@ -437,10 +442,11 @@ vendor ARESCOM 0x09f5 ARESCOM vendor BAY 0x09f9 Bay Associates vendor ALTERA 0x09fb Altera -vendor CSR 0x0a12 Cambridge Silicon Radio Ltd. +vendor CSR 0x0a12 Cambridge Silicon Radio vendor TREK 0x0a16 Trek Technology vendor ASAHIOPTICAL 0x0a17 Asahi Optical vendor BOCASYSTEMS 0x0a43 Boca Systems +vendor MEDIAGEAR 0x0a48 MediaGear vendor BROADCOM 0x0a5c Broadcom vendor GREENHOUSE 0x0a6b GREENHOUSE vendor GEOCAST 0x0a79 Geocast Network Systems @@ -448,33 +454,52 @@ vendor VODAFONE 0x0af0 Vodafone vendor TODOS 0x0b0c Todos Data System vendor SIIG2 0x0b39 SIIG +vendor TEKRAM 0x0b3b Tekram Technology vendor HAL 0x0b41 HAL Corporation -vendor EMS 0x0b43 EMS Production Ltd. +vendor EMS 0x0b43 EMS Production vendor NEC2 0x0b62 NEC vendor ATI2 0x0b6f ATI +vendor ZEEVO 0x0b7a Zeevo, Inc. +vendor KURUSUGAWA 0x0b7e Kurusugawa Electronics, Inc. vendor ASIX 0x0b95 ASIX Electronics +vendor USR 0x0baf U.S. Robotics vendor REALTEK 0x0bda RealTek +vendor ADDONICS2 0x0bf6 Addonics Technology vendor AGATE 0x0c08 Agate Technologies vendor DMI 0x0c0b DMI +vendor CHICONY2 0x0c45 Chicony Electronics +vendor SEALEVEL 0x0c52 Sealevel System vendor LUWEN 0x0c76 Luwen +vendor ZCOM 0x0cde Z-Com +vendor TANGTOP 0x0d3d Tangtop vendor SMC3 0x0d5c Standard Microsystems vendor PNY 0x0d7d PNY +vendor ACDC 0x0d7e American Computer & Digital Components +vendor ABC 0x0d8c ABC vendor MSI 0x0db0 Micro Star International -vendor HAWKING 0x0e66 Hawking Technologies +vendor HAWKING 0x0e66 Hawking +vendor OTI 0x0ea0 Ours Technology +vendor PILOTECH 0x0eaf Pilotech +vendor EGALAX 0x0eef eGalax vendor MICROTUNE 0x0f4d Microtune, Inc. vendor QUALCOMM2 0x1004 Qualcomm vendor WESTERN 0x1058 Western Digital vendor MOTOROLA 0x1063 Motorola +vendor CCYU 0x1065 CCYU Technology vendor PLX 0x10b5 PLX vendor ASANTE 0x10bd Asante vendor JRC 0x1145 Japan Radio Company vendor DELORME 0x1163 DeLorme Publishing -vendor ACERCM 0x1189 Acer Communications & Multimedia Inc. +vendor SERVERWORKS 0x1166 ServerWorks +vendor ACERCM 0x1189 Acer Communications & Multimedia vendor TWINMOS 0x126f TwinMOS +vendor TSUNAMI 0x1241 Tsunami +vendor CREATIVE2 0x1292 Creative Labs vendor BELKIN2 0x1293 Belkin Components -vendor AINCOMM 0x12fd Ain Communication Technology +vendor AINCOMM 0x12fd Aincomm vendor MOBILITY 0x1342 Mobility vendor SHARK 0x13d2 Shark +vendor SILICOM 0x1485 Silicom vendor SILICONPORTALS 0x1527 Silicon Portals vendor SOHOWARE 0x15e8 SOHOware vendor UMAX 0x1606 UMAX Data Systems @@ -483,9 +508,23 @@ vendor ACTIONTEC 0x1668 Actiontec Electronics vendor LINKSYS3 0x1915 Linksys vendor DLINK 0x2001 D-Link +vendor ERICSSON 0x2282 Ericsson +vendor MOTOROLA2 0x22b8 Motorola +vendor TRIPPLITE 0x2478 Tripp-Lite +vendor HIROSE 0x2631 Hirose Electric +vendor NHJ 0x2770 NHJ +vendor PLANEX 0x2c02 Planex Communications vendor VIDZMEDIA 0x3275 VidzMedia Pte Ltd +vendor AEI 0x3334 AEI +vendor PQI 0x3538 PQI vendor DAISY 0x3579 Daisy Technology +vendor NI 0x3923 National Instruments +vendor MICRONET 0x3980 Micronet Communications +vendor IODATA2 0x40bb I-O Data +vendor IRIVER 0x4102 iRiver vendor DELL 0x413c Dell +vendor AVERATEC 0x50c2 Averatec +vendor ONSPEC2 0x55aa OnSpec Electronic Inc. vendor SITECOM 0x6189 Sitecom vendor INTEL 0x8086 Intel vendor HP2 0xf003 Hewlett Packard ==== //depot/projects/smpng/sys/kern/kern_sysctl.c#44 (text+ko) ==== @@ -36,7 +36,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/kern/kern_sysctl.c,v 1.162 2004/10/27 19:26:01 rwatson Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/kern_sysctl.c,v 1.163 2004/12/31 14:52:53 pjd Exp $"); #include "opt_compat.h" #include "opt_mac.h" @@ -512,9 +512,9 @@ error = suser(req->td); if (error) - return error; + return (error); sysctl_sysctl_debug_dump_node(&sysctl__children, 0); - return ENOENT; + return (ENOENT); } SYSCTL_PROC(_sysctl, 0, debug, CTLTYPE_STRING|CTLFLAG_RD, @@ -592,14 +592,14 @@ if (!namelen) { if ((oidp->oid_kind & CTLTYPE) != CTLTYPE_NODE) - return 0; + return (0); if (oidp->oid_handler) /* We really should call the handler here...*/ - return 0; + return (0); lsp = (struct sysctl_oid_list *)oidp->oid_arg1; if (!sysctl_sysctl_next_ls(lsp, 0, 0, next+1, len, level+1, oidpp)) - return 0; + return (0); goto emptynode; } @@ -608,9 +608,9 @@ if (oidp->oid_number > *name) { if ((oidp->oid_kind & CTLTYPE) != CTLTYPE_NODE) - return 0; + return (0); if (oidp->oid_handler) - return 0; + return (0); lsp = (struct sysctl_oid_list *)oidp->oid_arg1; if (!sysctl_sysctl_next_ls(lsp, name+1, namelen-1, next+1, len, level+1, oidpp)) @@ -632,7 +632,7 @@ emptynode: *len = level; } - return 1; + return (1); } static int @@ -647,7 +647,7 @@ i = sysctl_sysctl_next_ls(lsp, name, namelen, newoid, &j, 1, &oid); if (i) - return ENOENT; + return (ENOENT); error = SYSCTL_OUT(req, newoid, j * sizeof (int)); return (error); } @@ -663,7 +663,7 @@ char *p; if (!*name) - return ENOENT; + return (ENOENT); p = name + strlen(name) - 1 ; if (*p == '.') @@ -708,7 +708,7 @@ if (i == '.') *p = '\0'; } - return ENOENT; + return (ENOENT); } static int @@ -719,7 +719,7 @@ struct sysctl_oid *op = 0; if (!req->newlen) - return ENOENT; + return (ENOENT); if (req->newlen >= MAXPATHLEN) /* XXX arbitrary, undocumented */ return (ENAMETOOLONG); @@ -972,7 +972,7 @@ sysctl_new_kernel(struct sysctl_req *req, void *p, size_t l) { if (!req->newptr) - return 0; + return (0); if (req->newlen - req->newidx < l) return (EINVAL); bcopy((char *)req->newptr + req->newidx, p, l); @@ -1091,7 +1091,7 @@ int error; if (!req->newptr) - return 0; + return (0); if (req->newlen - req->newidx < l) return (EINVAL); error = copyin((char *)req->newptr + req->newidx, p, l); @@ -1223,7 +1223,7 @@ } if (!oid->oid_handler) - return EINVAL; + return (EINVAL); if ((oid->oid_kind & CTLTYPE) == CTLTYPE_NODE) { arg1 = (int *)arg1 + indx; ==== //depot/projects/smpng/sys/kern/sched_ule.c#50 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/kern/sched_ule.c,v 1.144 2004/12/30 20:52:44 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/sched_ule.c,v 1.145 2004/12/30 22:17:00 jhb Exp $"); #include <opt_sched.h> @@ -1299,7 +1299,7 @@ else base_pri = td->td_base_pri; if (prio >= base_pri) { - td->td_flags &= ~ TDF_BORROWING; + td->td_flags &= ~TDF_BORROWING; sched_thread_priority(td, base_pri); } else sched_lend_prio(td, prio); @@ -1314,7 +1314,7 @@ td->td_base_pri = prio; /* - * If the therad is borrowing another thread's priority, don't + * If the thread is borrowing another thread's priority, don't * ever lower the priority. */ if (td->td_flags & TDF_BORROWING && td->td_priority < prio) @@ -1331,7 +1331,7 @@ if (TD_ON_LOCK(td) && oldprio != prio) turnstile_adjust(td, oldprio); } - + void sched_switch(struct thread *td, struct thread *newtd, int flags) { ==== //depot/projects/smpng/sys/modules/usb/Makefile#8 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/modules/usb/Makefile,v 1.16 2004/12/29 08:49:51 imp Exp $ +# $FreeBSD: src/sys/modules/usb/Makefile,v 1.17 2004/12/31 16:05:07 jhb Exp $ MAINTAINER= n_hibma@freebsd.org @@ -16,7 +16,7 @@ usb_port.h \ usb_quirks.c usb_quirks.h \ usb_subr.c \ - usbdevs.h \ + usbdevs.h usbdevs_data.h \ usbdi.c usbdi.h usbdivar.h \ usbdi_util.c usbdi_util.h \ usb_ethersubr.c usbdevs.h ==== //depot/projects/smpng/sys/netipx/ipx_input.c#11 (text+ko) ==== @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Robert N. M. Watson + * Copyright (c) 2004 Robert N. M. Watson * Copyright (c) 1995, Mike Mitchell * Copyright (c) 1984, 1985, 1986, 1987, 1993 * The Regents of the University of California. All rights reserved. @@ -36,7 +36,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/netipx/ipx_input.c,v 1.37 2004/12/30 17:54:53 rwatson Exp $"); +__FBSDID("$FreeBSD: src/sys/netipx/ipx_input.c,v 1.38 2004/12/31 17:05:37 rwatson Exp $"); #include <sys/param.h> #include <sys/systm.h> ==== //depot/projects/smpng/sys/netipx/ipx_pcb.c#14 (text+ko) ==== @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Robert N. M. Watson + * Copyright (c) 2004 Robert N. M. Watson * Copyright (c) 1995, Mike Mitchell * Copyright (c) 1984, 1985, 1986, 1987, 1993 * The Regents of the University of California. All rights reserved. @@ -36,7 +36,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/netipx/ipx_pcb.c,v 1.32 2004/12/30 17:54:53 rwatson Exp $"); +__FBSDID("$FreeBSD: src/sys/netipx/ipx_pcb.c,v 1.33 2004/12/31 17:05:37 rwatson Exp $"); #include <sys/param.h> #include <sys/systm.h> ==== //depot/projects/smpng/sys/netipx/ipx_usrreq.c#18 (text+ko) ==== @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Robert N. M. Watson + * Copyright (c) 2004 Robert N. M. Watson * Copyright (c) 1995, Mike Mitchell * Copyright (c) 1984, 1985, 1986, 1987, 1993 * The Regents of the University of California. All rights reserved. @@ -36,7 +36,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/netipx/ipx_usrreq.c,v 1.43 2004/12/30 17:49:40 rwatson Exp $"); +__FBSDID("$FreeBSD: src/sys/netipx/ipx_usrreq.c,v 1.44 2004/12/31 17:05:37 rwatson Exp $"); #include "opt_ipx.h" ==== //depot/projects/smpng/sys/netipx/ipx_var.h#6 (text+ko) ==== @@ -33,7 +33,7 @@ * * @(#)ipx_var.h * - * $FreeBSD: src/sys/netipx/ipx_var.h,v 1.19 2004/12/30 17:49:40 rwatson Exp $ + * $FreeBSD: src/sys/netipx/ipx_var.h,v 1.20 2004/12/31 11:54:39 rwatson Exp $ */ #ifndef _NETIPX_IPX_VAR_H_ @@ -78,6 +78,7 @@ struct ifnet; struct ipx_addr; +struct ipxpcb; struct mbuf; struct thread; struct route; ==== //depot/projects/smpng/sys/netipx/spx_usrreq.c#17 (text+ko) ==== @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Robert N. M. Watson + * Copyright (c) 2004 Robert N. M. Watson * Copyright (c) 1995, Mike Mitchell * Copyright (c) 1984, 1985, 1986, 1987, 1993 * The Regents of the University of California. All rights reserved. @@ -36,7 +36,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/netipx/spx_usrreq.c,v 1.49 2004/12/30 17:49:40 rwatson Exp $"); +__FBSDID("$FreeBSD: src/sys/netipx/spx_usrreq.c,v 1.50 2004/12/31 17:05:37 rwatson Exp $"); #include <sys/param.h> #include <sys/lock.h> ==== //depot/projects/smpng/sys/sys/copyright.h#6 (text+ko) ==== @@ -1,5 +1,5 @@ /* - * Copyright (C) 1992-2004 The FreeBSD Project. All rights reserved. + * Copyright (C) 1992-2005 The FreeBSD Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -22,7 +22,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/sys/copyright.h,v 1.17 2003/12/31 22:27:51 imp Exp $ + * $FreeBSD: src/sys/sys/copyright.h,v 1.18 2004/12/31 18:06:45 imp Exp $ */ @@ -30,7 +30,7 @@ /* FreeBSD */ #define COPYRIGHT_FreeBSD \ - "Copyright (c) 1992-2004 The FreeBSD Project.\n" + "Copyright (c) 1992-2005 The FreeBSD Project.\n" /* Berkeley */ #define COPYRIGHT_UCB \ @@ -38,7 +38,7 @@ /* a port of FreeBSD to the NEC PC98, Japan */ #define COPYRIGHT_PC98 \ - "Copyright (c) 1994-2004 FreeBSD(98) porting team.\nCopyright (c) 1992 A.Kojima F.Ukai M.Ishii (KMC).\n" + "Copyright (c) 1994-2005 FreeBSD(98) porting team.\nCopyright (c) 1992 A.Kojima F.Ukai M.Ishii (KMC).\n" #if defined(PC98) char copyright[] = COPYRIGHT_FreeBSD/**/COPYRIGHT_PC98/**/COPYRIGHT_UCB; ==== //depot/projects/smpng/sys/tools/usbdevs2h.awk#2 (text+ko) ==== @@ -1,6 +1,6 @@ #! /usr/bin/awk -f # $NetBSD: usb/devlist2h.awk,v 1.9 2001/01/18 20:28:22 jdolecek Exp $ -# $FreeBSD: src/sys/tools/usbdevs2h.awk,v 1.3 2004/04/16 05:22:11 obrien Exp $ +# $FreeBSD: src/sys/tools/usbdevs2h.awk,v 1.4 2004/12/30 23:18:34 imp Exp $ # # Copyright (c) 1995, 1996 Christopher G. Demetriou # All rights reserved. @@ -30,207 +30,244 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # +function usage() +{ + print "usage: usbdevs2h.awk <srcfile> [-d|-h]"; + exit 1; +} + BEGIN { - nproducts = nvendors = 0 - dfile="usbdevs_data.h" - hfile="usbdevs.h" + +nproducts = nvendors = 0 +# Process the command line +for (i = 1; i < ARGC; i++) { + arg = ARGV[i]; + if (arg !~ /^-[dh]+$/ && arg !~ /devs$/) + usage(); + if (arg ~ /^-.*d/) + dfile="usbdevs_data.h" + if (arg ~ /^-.*h/) + hfile="usbdevs.h" + if (arg ~ /devs$/) + srcfile = arg; } -NR == 1 { +ARGC = 1; +line=0; + +while ((getline < srcfile) > 0) { + line++; + if (line == 1) { VERSION = $0 gsub("\\$", "", VERSION) - if (os == "NetBSD") - printf("/*\t\$NetBSD\$\t*/\n\n") > dfile - else if (os == "FreeBSD") - printf("/* \$FreeBSD\$ */\n\n") > dfile - else if (os == "OpenBSD") - printf("/*\t\$OpenBSD\$\t*/\n\n") > dfile - else - printf("/* ??? */\n\n") > dfile - printf("/*\n") > dfile - printf(" * THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.\n") \ - > dfile - printf(" *\n") > dfile - printf(" * generated from:\n") > dfile - printf(" *\t%s\n", VERSION) > dfile - printf(" */\n") > dfile - - if (os == "NetBSD") - printf("/*\t\$NetBSD\$\t*/\n\n") > hfile - else if (os == "FreeBSD") - printf("/* \$FreeBSD\$ */\n\n") > hfile - else if (os == "OpenBSD") - printf("/*\t\$OpenBSD\$\t*/\n\n") > hfile - else - printf("/* ??? */\n\n") > hfile - printf("/*\n") > hfile - printf(" * THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.\n") \ - > hfile - printf(" *\n") > hfile - printf(" * generated from:\n") > hfile - printf(" *\t%s\n", VERSION) > hfile - printf(" */\n") > hfile - - next -} -$1 == "vendor" { + if (dfile) { + if (os == "NetBSD") + printf("/*\t\$NetBSD\$\t*/\n\n") > dfile + else if (os == "FreeBSD") + printf("/* \$FreeBSD\$ */\n\n") > dfile + else if (os == "OpenBSD") + printf("/*\t\$OpenBSD\$\t*/\n\n") > dfile + else + printf("/* ??? */\n\n") > dfile + printf("/*\n") > dfile + printf(" * THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.\n") \ + > dfile + printf(" *\n") > dfile + printf(" * generated from:\n") > dfile + printf(" *\t%s\n", VERSION) > dfile + printf(" */\n") > dfile + } + + if (hfile) { + if (os == "NetBSD") + printf("/*\t\$NetBSD\$\t*/\n\n") > hfile + else if (os == "FreeBSD") + printf("/* \$FreeBSD\$ */\n\n") > hfile + else if (os == "OpenBSD") + printf("/*\t\$OpenBSD\$\t*/\n\n") > hfile + else + printf("/* ??? */\n\n") > hfile + printf("/*\n") > hfile + printf(" * THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.\n") \ + > hfile + printf(" *\n") > hfile + printf(" * generated from:\n") > hfile + printf(" *\t%s\n", VERSION) > hfile + printf(" */\n") > hfile + } + continue; + } + if ($1 == "vendor") { nvendors++ vendorindex[$2] = nvendors; # record index for this name, for later. vendors[nvendors, 1] = $2; # name vendors[nvendors, 2] = $3; # id - printf("#define\tUSB_VENDOR_%s\t%s\t", vendors[nvendors, 1], - vendors[nvendors, 2]) > hfile - + if (hfile) + printf("#define\tUSB_VENDOR_%s\t%s\t", vendors[nvendors, 1], + vendors[nvendors, 2]) > hfile i = 3; f = 4; # comments ocomment = oparen = 0 if (f <= NF) { - printf("\t/* ") > hfile + if (hfile) + printf("\t/* ") > hfile ocomment = 1; } while (f <= NF) { if ($f == "#") { - printf("(") > hfile + if (hfile) + printf("(") > hfile oparen = 1 f++ continue } if (oparen) { - printf("%s", $f) > hfile - if (f < NF) + if (hfile) + printf("%s", $f) > hfile + if (f < NF && hfile) printf(" ") > hfile f++ continue } vendors[nvendors, i] = $f - printf("%s", vendors[nvendors, i]) > hfile - if (f < NF) + if (hfile) + printf("%s", vendors[nvendors, i]) > hfile + if (f < NF && hfile) printf(" ") > hfile i++; f++; } - if (oparen) + if (oparen && hfile) printf(")") > hfile - if (ocomment) + if (ocomment && hfile) printf(" */") > hfile - printf("\n") > hfile + if (hfile) + printf("\n") > hfile - next -} -$1 == "product" { + continue; + } + if ($1 == "product") { nproducts++ products[nproducts, 1] = $2; # vendor name products[nproducts, 2] = $3; # product id products[nproducts, 3] = $4; # id - printf("#define\tUSB_PRODUCT_%s_%s\t%s\t", products[nproducts, 1], - products[nproducts, 2], products[nproducts, 3]) > hfile + if (hfile) + printf("#define\tUSB_PRODUCT_%s_%s\t%s\t", \ + products[nproducts, 1], products[nproducts, 2], \ + products[nproducts, 3]) > hfile i=4; f = 5; # comments ocomment = oparen = 0 if (f <= NF) { - printf("\t/* ") > hfile + if (hfile) + printf("\t/* ") > hfile ocomment = 1; } while (f <= NF) { if ($f == "#") { - printf("(") > hfile + if (hfile) + printf("(") > hfile oparen = 1 f++ continue } if (oparen) { - printf("%s", $f) > hfile - if (f < NF) + if (hfile) + printf("%s", $f) > hfile + if (f < NF && hfile) printf(" ") > hfile f++ continue } products[nproducts, i] = $f - printf("%s", products[nproducts, i]) > hfile - if (f < NF) + if (hfile) + printf("%s", products[nproducts, i]) > hfile + if (f < NF && hfile) printf(" ") > hfile i++; f++; } - if (oparen) + if (oparen && hfile) printf(")") > hfile - if (ocomment) + if (ocomment && hfile) printf(" */") > hfile - printf("\n") > hfile + if (hfile) + printf("\n") > hfile - next -} -{ + continue; + } if ($0 == "") blanklines++ - print $0 > hfile - if (blanklines < 2) - print $0 > dfile + if (hfile) + print $0 > hfile + if (blanklines < 2 && dfile) + print $0 > dfile } -END { # print out the match tables - printf("\n") > dfile + if (dfile) { + printf("\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", - products[i, 1], products[i, 1], products[i, 2]) \ - > dfile - printf("\t ") > dfile - printf("0") > dfile - printf(",\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", + products[i, 1], products[i, 1], products[i, 2]) \ + > dfile + printf("\t ") > dfile + printf("0") > dfile + printf(",\n") > dfile - vendi = vendorindex[products[i, 1]]; - printf("\t \"") > dfile - j = 3; - needspace = 0; - while (vendors[vendi, j] != "") { - if (needspace) - printf(" ") > dfile - printf("%s", vendors[vendi, j]) > dfile - needspace = 1 - j++ - } - printf("\",\n") > dfile + vendi = vendorindex[products[i, 1]]; + printf("\t \"") > dfile + j = 3; + needspace = 0; + while (vendors[vendi, j] != "") { + if (needspace) + printf(" ") > dfile + printf("%s", vendors[vendi, j]) > dfile + needspace = 1 + j++ + } + printf("\",\n") > dfile - printf("\t \"") > dfile - j = 4; - needspace = 0; - while (products[i, j] != "") { - if (needspace) - printf(" ") > dfile - printf("%s", products[i, j]) > dfile - needspace = 1 - j++ + printf("\t \"") > dfile + j = 4; + needspace = 0; + while (products[i, j] != "") { + if (needspace) + printf(" ") > dfile + printf("%s", products[i, j]) > dfile + needspace = 1 + j++ + } + printf("\",\n") > dfile + printf("\t},\n") > dfile } - printf("\",\n") > dfile - printf("\t},\n") > dfile - } - for (i = 1; i <= nvendors; i++) { - printf("\t{\n") > dfile - printf("\t USB_VENDOR_%s, 0,\n", vendors[i, 1]) \ - > dfile - printf("\t USB_KNOWNDEV_NOPROD,\n") \ - > dfile - printf("\t \"") > dfile - j = 3; - needspace = 0; - while (vendors[i, j] != "") { - if (needspace) - printf(" ") > dfile - printf("%s", vendors[i, j]) > dfile - needspace = 1 - j++ + for (i = 1; i <= nvendors; i++) { + printf("\t{\n") > dfile + printf("\t USB_VENDOR_%s, 0,\n", vendors[i, 1]) \ + > dfile + printf("\t USB_KNOWNDEV_NOPROD,\n") \ + > dfile + printf("\t \"") > dfile + j = 3; + needspace = 0; + while (vendors[i, j] != "") { + if (needspace) + printf(" ") > dfile + printf("%s", vendors[i, j]) > dfile + needspace = 1 + j++ + } + printf("\",\n") > dfile + printf("\t NULL,\n") > dfile + printf("\t},\n") > dfile } - printf("\",\n") > dfile - printf("\t NULL,\n") > dfile - printf("\t},\n") > dfile + printf("\t{ 0, 0, 0, NULL, NULL, }\n") > dfile + printf("};\n") > dfile } - printf("\t{ 0, 0, 0, NULL, NULL, }\n") > dfile - printf("};\n") > dfile }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200412311847.iBVIlw0R027153>