From owner-svn-src-user@FreeBSD.ORG Thu Feb 5 19:04:51 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32F09106566B; Thu, 5 Feb 2009 19:04:51 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1E6388FC0A; Thu, 5 Feb 2009 19:04:51 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n15J4pDO035356; Thu, 5 Feb 2009 19:04:51 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n15J4mtV035304; Thu, 5 Feb 2009 19:04:48 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902051904.n15J4mtV035304@svn.freebsd.org> From: Sam Leffler Date: Thu, 5 Feb 2009 19:04:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188168 - in user/sam/wifi: . contrib/csup contrib/file contrib/wpa_supplicant etc etc/defaults etc/rc.d lib/libc/sparc64/sys lib/libc/string lib/libc/sys lib/libusbhid sbin/fsck_ffs sb... X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Feb 2009 19:04:51 -0000 Author: sam Date: Thu Feb 5 19:04:48 2009 New Revision: 188168 URL: http://svn.freebsd.org/changeset/base/188168 Log: sync w/ head Added: user/sam/wifi/lib/libusbhid/descr_compat.c - copied unchanged from r188167, head/lib/libusbhid/descr_compat.c user/sam/wifi/sys/dev/cfi/cfi_bus_ixp4xx.c - copied unchanged from r188167, head/sys/dev/cfi/cfi_bus_ixp4xx.c user/sam/wifi/tools/tools/cfi/ - copied from r188167, head/tools/tools/cfi/ Modified: user/sam/wifi/ (props changed) user/sam/wifi/ObsoleteFiles.inc user/sam/wifi/contrib/csup/ (props changed) user/sam/wifi/contrib/file/ (props changed) user/sam/wifi/contrib/wpa_supplicant/ (props changed) user/sam/wifi/etc/defaults/rc.conf user/sam/wifi/etc/network.subr user/sam/wifi/etc/rc.d/defaultroute user/sam/wifi/lib/libc/sparc64/sys/__sparc_utrap.c user/sam/wifi/lib/libc/string/memccpy.c user/sam/wifi/lib/libc/string/memchr.c user/sam/wifi/lib/libc/string/memcmp.c user/sam/wifi/lib/libc/string/memmem.c user/sam/wifi/lib/libc/string/strcasecmp.c user/sam/wifi/lib/libc/string/strcasestr.c user/sam/wifi/lib/libc/string/strcmp.c user/sam/wifi/lib/libc/string/strcoll.c user/sam/wifi/lib/libc/string/strdup.c user/sam/wifi/lib/libc/string/strmode.c user/sam/wifi/lib/libc/string/strncmp.c user/sam/wifi/lib/libc/string/strncpy.c user/sam/wifi/lib/libc/string/strnstr.c user/sam/wifi/lib/libc/string/strpbrk.c user/sam/wifi/lib/libc/string/strsep.c user/sam/wifi/lib/libc/string/strstr.c user/sam/wifi/lib/libc/string/wcscat.c user/sam/wifi/lib/libc/string/wcscmp.c user/sam/wifi/lib/libc/string/wcscpy.c user/sam/wifi/lib/libc/string/wcscspn.c user/sam/wifi/lib/libc/string/wcslcat.c user/sam/wifi/lib/libc/string/wcslcpy.c user/sam/wifi/lib/libc/string/wcslen.c user/sam/wifi/lib/libc/string/wcsncat.c user/sam/wifi/lib/libc/string/wcsncmp.c user/sam/wifi/lib/libc/string/wcspbrk.c user/sam/wifi/lib/libc/string/wcsspn.c user/sam/wifi/lib/libc/string/wcsstr.c user/sam/wifi/lib/libc/string/wmemchr.c user/sam/wifi/lib/libc/string/wmemcmp.c user/sam/wifi/lib/libc/string/wmemcpy.c user/sam/wifi/lib/libc/string/wmemmove.c user/sam/wifi/lib/libc/string/wmemset.c user/sam/wifi/lib/libc/sys/send.2 user/sam/wifi/lib/libusbhid/Makefile user/sam/wifi/lib/libusbhid/descr.c user/sam/wifi/lib/libusbhid/usbhid.3 user/sam/wifi/lib/libusbhid/usbhid.h user/sam/wifi/lib/libusbhid/usbvar.h user/sam/wifi/sbin/fsck_ffs/fsck.h user/sam/wifi/sbin/fsck_ffs/fsck_ffs.8 user/sam/wifi/sbin/fsck_ffs/fsutil.c user/sam/wifi/sbin/fsck_ffs/inode.c user/sam/wifi/sbin/fsck_ffs/main.c user/sam/wifi/sbin/fsck_ffs/pass1.c user/sam/wifi/sbin/geom/core/geom.c user/sam/wifi/sbin/ifconfig/ifieee80211.c user/sam/wifi/sbin/ifconfig/regdomain.c user/sam/wifi/sbin/ifconfig/regdomain.h user/sam/wifi/sbin/ipfw/dummynet.c user/sam/wifi/sbin/ipfw/ipfw2.c user/sam/wifi/share/man/man9/lock.9 user/sam/wifi/sys/ (props changed) user/sam/wifi/sys/amd64/amd64/exception.S user/sam/wifi/sys/amd64/amd64/machdep.c user/sam/wifi/sys/amd64/amd64/mp_machdep.c user/sam/wifi/sys/amd64/include/intr_machdep.h user/sam/wifi/sys/arm/arm/busdma_machdep.c user/sam/wifi/sys/arm/arm/dump_machdep.c user/sam/wifi/sys/arm/arm/elf_trampoline.c user/sam/wifi/sys/arm/arm/pmap.c user/sam/wifi/sys/arm/arm/vm_machdep.c user/sam/wifi/sys/arm/conf/AVILA user/sam/wifi/sys/arm/conf/AVILA.hints user/sam/wifi/sys/arm/include/atomic.h user/sam/wifi/sys/arm/sa11x0/assabet_machdep.c user/sam/wifi/sys/arm/xscale/ixp425/avila_machdep.c user/sam/wifi/sys/arm/xscale/ixp425/files.ixp425 user/sam/wifi/sys/arm/xscale/ixp425/ixp425.c user/sam/wifi/sys/arm/xscale/ixp425/ixp425reg.h user/sam/wifi/sys/conf/options user/sam/wifi/sys/dev/acpi_support/acpi_panasonic.c user/sam/wifi/sys/dev/acpica/acpi_pcib_acpi.c user/sam/wifi/sys/dev/ae/if_ae.c user/sam/wifi/sys/dev/an/if_an.c user/sam/wifi/sys/dev/an/if_anreg.h user/sam/wifi/sys/dev/ata/ata-disk.c user/sam/wifi/sys/dev/ata/atapi-cam.c user/sam/wifi/sys/dev/ata/atapi-cd.c user/sam/wifi/sys/dev/ata/atapi-fd.c user/sam/wifi/sys/dev/ata/atapi-tape.c user/sam/wifi/sys/dev/ath/ (props changed) user/sam/wifi/sys/dev/ath/ath_hal/ah_regdomain.c user/sam/wifi/sys/dev/ath/ath_hal/ar5212/ar5212.h user/sam/wifi/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c user/sam/wifi/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c user/sam/wifi/sys/dev/atkbdc/atkbdc_isa.c user/sam/wifi/sys/dev/bge/if_bge.c user/sam/wifi/sys/dev/bm/if_bm.c user/sam/wifi/sys/dev/cardbus/cardbus.c user/sam/wifi/sys/dev/cfi/cfi_core.c user/sam/wifi/sys/dev/cfi/cfi_dev.c user/sam/wifi/sys/dev/cfi/cfi_reg.h user/sam/wifi/sys/dev/cfi/cfi_var.h user/sam/wifi/sys/dev/exca/exca.c user/sam/wifi/sys/dev/firewire/firewire.c user/sam/wifi/sys/dev/firewire/fwohci.c user/sam/wifi/sys/dev/firewire/fwohci_pci.c user/sam/wifi/sys/dev/firewire/fwohcivar.h user/sam/wifi/sys/dev/firewire/sbp.c user/sam/wifi/sys/dev/ichsmb/ichsmb.c user/sam/wifi/sys/dev/ipmi/ipmi_acpi.c user/sam/wifi/sys/dev/ipmi/ipmi_smbios.c user/sam/wifi/sys/dev/kbdmux/kbdmux.c user/sam/wifi/sys/dev/mmc/mmc.c user/sam/wifi/sys/dev/mmc/mmcreg.h user/sam/wifi/sys/dev/pccbb/pccbb.c user/sam/wifi/sys/dev/pccbb/pccbb_pci.c user/sam/wifi/sys/dev/pccbb/pccbbvar.h user/sam/wifi/sys/dev/pci/pci_user.c user/sam/wifi/sys/dev/pci/pcireg.h user/sam/wifi/sys/dev/ppbus/ppbconf.h user/sam/wifi/sys/dev/smbus/smb.c user/sam/wifi/sys/dev/snp/snp.c user/sam/wifi/sys/dev/syscons/teken/ (props changed) user/sam/wifi/sys/dev/usb2/bluetooth/ubtbcmfw2.c user/sam/wifi/sys/dev/usb2/core/usb2_error.c user/sam/wifi/sys/dev/usb2/core/usb2_process.c user/sam/wifi/sys/dev/usb2/include/usb2_error.h user/sam/wifi/sys/dev/usb2/include/usb2_hid.h user/sam/wifi/sys/dev/usb2/include/usb2_mfunc.h user/sam/wifi/sys/dev/usb2/include/usb2_revision.h user/sam/wifi/sys/dev/usb2/input/uhid2.c user/sam/wifi/sys/dev/usb2/quirk/usb2_quirk.c user/sam/wifi/sys/dev/usb2/quirk/usb2_quirk.h user/sam/wifi/sys/dev/usb2/serial/uftdi2.c user/sam/wifi/sys/dev/xen/netback/netback.c user/sam/wifi/sys/dev/xen/netfront/netfront.c user/sam/wifi/sys/geom/geom_subr.c user/sam/wifi/sys/i386/xen/clock.c user/sam/wifi/sys/i386/xen/xen_machdep.c user/sam/wifi/sys/ia64/ia64/mca.c user/sam/wifi/sys/ia64/include/mca.h user/sam/wifi/sys/kern/kern_jail.c user/sam/wifi/sys/kern/subr_autoconf.c user/sam/wifi/sys/kern/subr_bus.c user/sam/wifi/sys/kern/subr_clist.c user/sam/wifi/sys/kern/subr_devstat.c user/sam/wifi/sys/kern/subr_disk.c user/sam/wifi/sys/kern/subr_firmware.c user/sam/wifi/sys/kern/subr_kobj.c user/sam/wifi/sys/kern/subr_prf.c user/sam/wifi/sys/kern/subr_prof.c user/sam/wifi/sys/kern/subr_rman.c user/sam/wifi/sys/kern/subr_rtc.c user/sam/wifi/sys/kern/subr_taskqueue.c user/sam/wifi/sys/kern/subr_witness.c user/sam/wifi/sys/kern/sys_generic.c user/sam/wifi/sys/kern/tty.c user/sam/wifi/sys/kern/tty_inq.c user/sam/wifi/sys/kern/tty_outq.c user/sam/wifi/sys/kern/uipc_socket.c user/sam/wifi/sys/kern/vfs_mount.c user/sam/wifi/sys/kern/vfs_subr.c user/sam/wifi/sys/kern/vfs_syscalls.c user/sam/wifi/sys/modules/usb2/serial_3g/ (props changed) user/sam/wifi/sys/net/if.c user/sam/wifi/sys/net/if_ethersubr.c user/sam/wifi/sys/net/rtsock.c user/sam/wifi/sys/net80211/ieee80211.c user/sam/wifi/sys/netatalk/ddp_usrreq.c user/sam/wifi/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c user/sam/wifi/sys/netinet/in.c user/sam/wifi/sys/netinet/in_pcb.c user/sam/wifi/sys/netinet/ip_divert.c user/sam/wifi/sys/netinet/ip_ipsec.c user/sam/wifi/sys/netinet/ip_output.c user/sam/wifi/sys/netinet/raw_ip.c user/sam/wifi/sys/netinet/sctp_auth.c user/sam/wifi/sys/netinet/sctp_constants.h user/sam/wifi/sys/netinet/sctp_crc32.c user/sam/wifi/sys/netinet/sctp_crc32.h user/sam/wifi/sys/netinet/sctp_input.c user/sam/wifi/sys/netinet/sctp_os_bsd.h user/sam/wifi/sys/netinet/sctp_output.c user/sam/wifi/sys/netinet/sctp_pcb.c user/sam/wifi/sys/netinet/sctp_pcb.h user/sam/wifi/sys/netinet/sctp_sysctl.c user/sam/wifi/sys/netinet/sctp_uio.h user/sam/wifi/sys/netinet/sctp_usrreq.c user/sam/wifi/sys/netinet/sctputil.c user/sam/wifi/sys/netinet/sctputil.h user/sam/wifi/sys/netinet/tcp_usrreq.c user/sam/wifi/sys/netinet/udp_usrreq.c user/sam/wifi/sys/netinet6/in6.c user/sam/wifi/sys/netinet6/in6_pcb.c user/sam/wifi/sys/netinet6/in6_src.c user/sam/wifi/sys/netinet6/nd6_rtr.c user/sam/wifi/sys/netinet6/raw_ip6.c user/sam/wifi/sys/netinet6/sctp6_usrreq.c user/sam/wifi/sys/netinet6/udp6_usrreq.c user/sam/wifi/sys/opencrypto/cryptosoft.c user/sam/wifi/sys/rpc/clnt_rc.c user/sam/wifi/sys/security/audit/audit_pipe.c user/sam/wifi/sys/sys/cfictl.h user/sam/wifi/sys/sys/clist.h user/sam/wifi/sys/sys/conf.h user/sam/wifi/sys/sys/elf_common.h user/sam/wifi/sys/sys/jail.h user/sam/wifi/sys/sys/kobj.h user/sam/wifi/sys/sys/lockmgr.h user/sam/wifi/sys/sys/pciio.h user/sam/wifi/sys/sys/sysctl.h user/sam/wifi/sys/sys/tty.h user/sam/wifi/sys/sys/ttyqueue.h user/sam/wifi/tools/regression/lib/msun/test-conj.t (props changed) user/sam/wifi/tools/tools/README user/sam/wifi/tools/tools/ath/athrd/ (props changed) user/sam/wifi/tools/tools/sysbuild/sysbuild.sh user/sam/wifi/usr.bin/basename/basename.1 user/sam/wifi/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.c user/sam/wifi/usr.bin/csup/ (props changed) user/sam/wifi/usr.bin/dirname/dirname.c user/sam/wifi/usr.bin/make/job.c user/sam/wifi/usr.bin/make/main.c user/sam/wifi/usr.bin/usbhidaction/usbhidaction.c user/sam/wifi/usr.bin/usbhidctl/usbhid.c user/sam/wifi/usr.sbin/bluetooth/Makefile user/sam/wifi/usr.sbin/bluetooth/btpand/btpand.c user/sam/wifi/usr.sbin/bluetooth/btpand/btpand.h user/sam/wifi/usr.sbin/bluetooth/btpand/server.c user/sam/wifi/usr.sbin/bluetooth/hcsecd/hcsecd.c user/sam/wifi/usr.sbin/bluetooth/hcseriald/hcseriald.c user/sam/wifi/usr.sbin/bluetooth/rfcomm_pppd/rfcomm_pppd.c user/sam/wifi/usr.sbin/fifolog/lib/fifolog_reader.c user/sam/wifi/usr.sbin/fifolog/lib/fifolog_write_poll.c user/sam/wifi/usr.sbin/fwcontrol/fwdv.c user/sam/wifi/usr.sbin/fwcontrol/fwmpegts.c user/sam/wifi/usr.sbin/makefs/ffs/ffs_bswap.c (props changed) user/sam/wifi/usr.sbin/makefs/ffs/ffs_subr.c (props changed) user/sam/wifi/usr.sbin/makefs/ffs/ufs_bswap.h (props changed) user/sam/wifi/usr.sbin/makefs/getid.c (props changed) user/sam/wifi/usr.sbin/pciconf/pciconf.8 user/sam/wifi/usr.sbin/pciconf/pciconf.c user/sam/wifi/usr.sbin/pstat/pstat.8 user/sam/wifi/usr.sbin/pstat/pstat.c Modified: user/sam/wifi/ObsoleteFiles.inc ============================================================================== --- user/sam/wifi/ObsoleteFiles.inc Thu Feb 5 18:51:14 2009 (r188167) +++ user/sam/wifi/ObsoleteFiles.inc Thu Feb 5 19:04:48 2009 (r188168) @@ -14,6 +14,8 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # +# 20090203: adding_user.8 moved to adding_user.7 +OLD_FILES+=usr/share/man/man8/adding_user.8.gz # 20090122: tzdata2009a import OLD_FILES+=usr/share/zoneinfo/Asia/Katmandu # 20090102: file 4.26 import Modified: user/sam/wifi/etc/defaults/rc.conf ============================================================================== --- user/sam/wifi/etc/defaults/rc.conf Thu Feb 5 18:51:14 2009 (r188167) +++ user/sam/wifi/etc/defaults/rc.conf Thu Feb 5 19:04:48 2009 (r188168) @@ -101,7 +101,7 @@ nisdomainname="NO" # Set to NIS domain dhclient_program="/sbin/dhclient" # Path to dhcp client program. dhclient_flags="" # Extra flags to pass to dhcp client. #dhclient_flags_fxp0="" # Extra dhclient flags for fxp0 only -background_dhclient="NO" # Start dhcp client in the background. +background_dhclient="YES" # Start dhcp client in the background. #background_dhclient_fxp0="YES" # Start dhcp client on fxp0 in the background. synchronous_dhclient="NO" # Start dhclient directly on configured # interfaces during startup. Modified: user/sam/wifi/etc/network.subr ============================================================================== --- user/sam/wifi/etc/network.subr Thu Feb 5 18:51:14 2009 (r188167) +++ user/sam/wifi/etc/network.subr Thu Feb 5 19:04:48 2009 (r188168) @@ -515,7 +515,9 @@ childif_create() i=`ifconfig wlan create ${create_args}` ifconfig $i name $child && cfg=0 fi - ifn_start $child + if autoif $child; then + ifn_start $child + fi done return ${cfg} Modified: user/sam/wifi/etc/rc.d/defaultroute ============================================================================== --- user/sam/wifi/etc/rc.d/defaultroute Thu Feb 5 18:51:14 2009 (r188167) +++ user/sam/wifi/etc/rc.d/defaultroute Thu Feb 5 19:04:48 2009 (r188168) @@ -18,10 +18,21 @@ stop_cmd=":" defaultroute_start() { - # Return without waiting if we don't have dhcp interfaces. - # Once we can test that the link is actually up, we should - # remove this test and always wait. - [ -z "`list_net_interfaces dhcp`" ] && return + local output carrier nocarrier + + # Return without waiting if we don't have dhcp interfaces or + # if none of the dhcp interfaces is plugged in. + dhcp_interfaces=`list_net_interfaces dhcp` + [ -z "${dhcp_interfaces}" ] && return + carrier=false + for _if in ${dhcp_interfaces}; do + output=`/sbin/ifconfig ${_if}` + nocarrier=`expr "${output}" : '.*[[:blank:]]status: \(no carrier\)'` + [ -z "${nocarrier}" ] && carrier=true + done + if ! ${carrier}; then + return + fi # Wait for a default route delay=${if_up_delay} Modified: user/sam/wifi/lib/libc/sparc64/sys/__sparc_utrap.c ============================================================================== --- user/sam/wifi/lib/libc/sparc64/sys/__sparc_utrap.c Thu Feb 5 18:51:14 2009 (r188167) +++ user/sam/wifi/lib/libc/sparc64/sys/__sparc_utrap.c Thu Feb 5 19:04:48 2009 (r188168) @@ -122,7 +122,7 @@ __utrap_write(const char *str) } void -__utrap_kill_self(sig) +__utrap_kill_self(int sig) { int berrno; Modified: user/sam/wifi/lib/libc/string/memccpy.c ============================================================================== --- user/sam/wifi/lib/libc/string/memccpy.c Thu Feb 5 18:51:14 2009 (r188167) +++ user/sam/wifi/lib/libc/string/memccpy.c Thu Feb 5 19:04:48 2009 (r188168) @@ -36,11 +36,7 @@ __FBSDID("$FreeBSD$"); #include void * -memccpy(t, f, c, n) - void *t; - const void *f; - int c; - size_t n; +memccpy(void *t, const void *f, int c, size_t n) { if (n) { Modified: user/sam/wifi/lib/libc/string/memchr.c ============================================================================== --- user/sam/wifi/lib/libc/string/memchr.c Thu Feb 5 18:51:14 2009 (r188167) +++ user/sam/wifi/lib/libc/string/memchr.c Thu Feb 5 19:04:48 2009 (r188168) @@ -39,10 +39,7 @@ __FBSDID("$FreeBSD$"); #include void * -memchr(s, c, n) - const void *s; - unsigned char c; - size_t n; +memchr(const void *s, int c, size_t n) { if (n != 0) { const unsigned char *p = s; Modified: user/sam/wifi/lib/libc/string/memcmp.c ============================================================================== --- user/sam/wifi/lib/libc/string/memcmp.c Thu Feb 5 18:51:14 2009 (r188167) +++ user/sam/wifi/lib/libc/string/memcmp.c Thu Feb 5 19:04:48 2009 (r188168) @@ -42,9 +42,7 @@ __FBSDID("$FreeBSD$"); * Compare memory regions. */ int -memcmp(s1, s2, n) - const void *s1, *s2; - size_t n; +memcmp(const void *s1, const void *s2, size_t n) { if (n != 0) { const unsigned char *p1 = s1, *p2 = s2; Modified: user/sam/wifi/lib/libc/string/memmem.c ============================================================================== --- user/sam/wifi/lib/libc/string/memmem.c Thu Feb 5 18:51:14 2009 (r188167) +++ user/sam/wifi/lib/libc/string/memmem.c Thu Feb 5 19:04:48 2009 (r188168) @@ -36,9 +36,7 @@ __FBSDID("$FreeBSD$"); */ void * -memmem(l, l_len, s, s_len) - const void *l; size_t l_len; - const void *s; size_t s_len; +memmem(const void *l, size_t l_len, const void *s, size_t s_len) { register char *cur, *last; const char *cl = (const char *)l; Modified: user/sam/wifi/lib/libc/string/strcasecmp.c ============================================================================== --- user/sam/wifi/lib/libc/string/strcasecmp.c Thu Feb 5 18:51:14 2009 (r188167) +++ user/sam/wifi/lib/libc/string/strcasecmp.c Thu Feb 5 19:04:48 2009 (r188168) @@ -39,8 +39,7 @@ __FBSDID("$FreeBSD$"); typedef unsigned char u_char; int -strcasecmp(s1, s2) - const char *s1, *s2; +strcasecmp(const char *s1, const char *s2) { const u_char *us1 = (const u_char *)s1, @@ -53,9 +52,7 @@ strcasecmp(s1, s2) } int -strncasecmp(s1, s2, n) - const char *s1, *s2; - size_t n; +strncasecmp(const char *s1, const char *s2, size_t n) { if (n != 0) { const u_char Modified: user/sam/wifi/lib/libc/string/strcasestr.c ============================================================================== --- user/sam/wifi/lib/libc/string/strcasestr.c Thu Feb 5 18:51:14 2009 (r188167) +++ user/sam/wifi/lib/libc/string/strcasestr.c Thu Feb 5 19:04:48 2009 (r188168) @@ -40,8 +40,7 @@ __FBSDID("$FreeBSD$"); * Find the first occurrence of find in s, ignore case. */ char * -strcasestr(s, find) - const char *s, *find; +strcasestr(const char *s, const char *find) { char c, sc; size_t len; Modified: user/sam/wifi/lib/libc/string/strcmp.c ============================================================================== --- user/sam/wifi/lib/libc/string/strcmp.c Thu Feb 5 18:51:14 2009 (r188167) +++ user/sam/wifi/lib/libc/string/strcmp.c Thu Feb 5 19:04:48 2009 (r188168) @@ -42,11 +42,10 @@ __FBSDID("$FreeBSD$"); * Compare strings. */ int -strcmp(s1, s2) - const char *s1, *s2; +strcmp(const char *s1, const char *s2) { while (*s1 == *s2++) - if (*s1++ == 0) + if (*s1++ == '\0') return (0); return (*(const unsigned char *)s1 - *(const unsigned char *)(s2 - 1)); } Modified: user/sam/wifi/lib/libc/string/strcoll.c ============================================================================== --- user/sam/wifi/lib/libc/string/strcoll.c Thu Feb 5 18:51:14 2009 (r188167) +++ user/sam/wifi/lib/libc/string/strcoll.c Thu Feb 5 19:04:48 2009 (r188168) @@ -33,8 +33,7 @@ __FBSDID("$FreeBSD$"); #include "collate.h" int -strcoll(s, s2) - const char *s, *s2; +strcoll(const char *s, const char *s2) { int len, len2, prim, prim2, sec, sec2, ret, ret2; const char *t, *t2; Modified: user/sam/wifi/lib/libc/string/strdup.c ============================================================================== --- user/sam/wifi/lib/libc/string/strdup.c Thu Feb 5 18:51:14 2009 (r188167) +++ user/sam/wifi/lib/libc/string/strdup.c Thu Feb 5 19:04:48 2009 (r188168) @@ -38,8 +38,7 @@ __FBSDID("$FreeBSD$"); #include char * -strdup(str) - const char *str; +strdup(const char *str) { size_t len; char *copy; Modified: user/sam/wifi/lib/libc/string/strmode.c ============================================================================== --- user/sam/wifi/lib/libc/string/strmode.c Thu Feb 5 18:51:14 2009 (r188167) +++ user/sam/wifi/lib/libc/string/strmode.c Thu Feb 5 19:04:48 2009 (r188168) @@ -38,9 +38,7 @@ __FBSDID("$FreeBSD$"); #include void -strmode(mode, p) - mode_t mode; - char *p; +strmode(/* mode_t */ int mode, char *p) { /* print type */ switch (mode & S_IFMT) { Modified: user/sam/wifi/lib/libc/string/strncmp.c ============================================================================== --- user/sam/wifi/lib/libc/string/strncmp.c Thu Feb 5 18:51:14 2009 (r188167) +++ user/sam/wifi/lib/libc/string/strncmp.c Thu Feb 5 19:04:48 2009 (r188168) @@ -36,9 +36,7 @@ __FBSDID("$FreeBSD$"); #include int -strncmp(s1, s2, n) - const char *s1, *s2; - size_t n; +strncmp(const char *s1, const char *s2, size_t n) { if (n == 0) @@ -47,7 +45,7 @@ strncmp(s1, s2, n) if (*s1 != *s2++) return (*(const unsigned char *)s1 - *(const unsigned char *)(s2 - 1)); - if (*s1++ == 0) + if (*s1++ == '\0') break; } while (--n != 0); return (0); Modified: user/sam/wifi/lib/libc/string/strncpy.c ============================================================================== --- user/sam/wifi/lib/libc/string/strncpy.c Thu Feb 5 18:51:14 2009 (r188167) +++ user/sam/wifi/lib/libc/string/strncpy.c Thu Feb 5 19:04:48 2009 (r188168) @@ -50,10 +50,10 @@ strncpy(char * __restrict dst, const cha const char *s = src; do { - if ((*d++ = *s++) == 0) { + if ((*d++ = *s++) == '\0') { /* NUL pad the remaining n-1 bytes */ while (--n != 0) - *d++ = 0; + *d++ = '\0'; break; } } while (--n != 0); Modified: user/sam/wifi/lib/libc/string/strnstr.c ============================================================================== --- user/sam/wifi/lib/libc/string/strnstr.c Thu Feb 5 18:51:14 2009 (r188167) +++ user/sam/wifi/lib/libc/string/strnstr.c Thu Feb 5 19:04:48 2009 (r188168) @@ -44,10 +44,7 @@ __FBSDID("$FreeBSD$"); * first slen characters of s. */ char * -strnstr(s, find, slen) - const char *s; - const char *find; - size_t slen; +strnstr(const char *s, const char *find, size_t slen) { char c, sc; size_t len; Modified: user/sam/wifi/lib/libc/string/strpbrk.c ============================================================================== --- user/sam/wifi/lib/libc/string/strpbrk.c Thu Feb 5 18:51:14 2009 (r188167) +++ user/sam/wifi/lib/libc/string/strpbrk.c Thu Feb 5 19:04:48 2009 (r188168) @@ -39,14 +39,13 @@ __FBSDID("$FreeBSD$"); * Find the first occurrence in s1 of a character in s2 (excluding NUL). */ char * -strpbrk(s1, s2) - const char *s1, *s2; +strpbrk(const char *s1, const char *s2) { const char *scanp; int c, sc; while ((c = *s1++) != 0) { - for (scanp = s2; (sc = *scanp++) != 0;) + for (scanp = s2; (sc = *scanp++) != '\0';) if (sc == c) return ((char *)(s1 - 1)); } Modified: user/sam/wifi/lib/libc/string/strsep.c ============================================================================== --- user/sam/wifi/lib/libc/string/strsep.c Thu Feb 5 18:51:14 2009 (r188167) +++ user/sam/wifi/lib/libc/string/strsep.c Thu Feb 5 19:04:48 2009 (r188168) @@ -48,9 +48,7 @@ __FBSDID("$FreeBSD$"); * If *stringp is NULL, strsep returns NULL. */ char * -strsep(stringp, delim) - char **stringp; - const char *delim; +strsep(char **stringp, const char *delim) { char *s; const char *spanp; Modified: user/sam/wifi/lib/libc/string/strstr.c ============================================================================== --- user/sam/wifi/lib/libc/string/strstr.c Thu Feb 5 18:51:14 2009 (r188167) +++ user/sam/wifi/lib/libc/string/strstr.c Thu Feb 5 19:04:48 2009 (r188168) @@ -42,17 +42,16 @@ __FBSDID("$FreeBSD$"); * Find the first occurrence of find in s. */ char * -strstr(s, find) - const char *s, *find; +strstr(const char *s, const char *find) { char c, sc; size_t len; - if ((c = *find++) != 0) { + if ((c = *find++) != '\0') { len = strlen(find); do { do { - if ((sc = *s++) == 0) + if ((sc = *s++) == '\0') return (NULL); } while (sc != c); } while (strncmp(s, find, len) != 0); Modified: user/sam/wifi/lib/libc/string/wcscat.c ============================================================================== --- user/sam/wifi/lib/libc/string/wcscat.c Thu Feb 5 18:51:14 2009 (r188167) +++ user/sam/wifi/lib/libc/string/wcscat.c Thu Feb 5 19:04:48 2009 (r188168) @@ -37,9 +37,7 @@ __FBSDID("$FreeBSD$"); #include wchar_t * -wcscat(s1, s2) - wchar_t * __restrict s1; - const wchar_t * __restrict s2; +wcscat(wchar_t * __restrict s1, const wchar_t * __restrict s2) { wchar_t *cp; Modified: user/sam/wifi/lib/libc/string/wcscmp.c ============================================================================== --- user/sam/wifi/lib/libc/string/wcscmp.c Thu Feb 5 18:51:14 2009 (r188167) +++ user/sam/wifi/lib/libc/string/wcscmp.c Thu Feb 5 19:04:48 2009 (r188168) @@ -45,12 +45,11 @@ __FBSDID("$FreeBSD$"); * Compare strings. */ int -wcscmp(s1, s2) - const wchar_t *s1, *s2; +wcscmp(const wchar_t *s1, const wchar_t *s2) { while (*s1 == *s2++) - if (*s1++ == 0) + if (*s1++ == '\0') return (0); /* XXX assumes wchar_t = int */ return (*(const unsigned int *)s1 - *(const unsigned int *)--s2); Modified: user/sam/wifi/lib/libc/string/wcscpy.c ============================================================================== --- user/sam/wifi/lib/libc/string/wcscpy.c Thu Feb 5 18:51:14 2009 (r188167) +++ user/sam/wifi/lib/libc/string/wcscpy.c Thu Feb 5 19:04:48 2009 (r188168) @@ -37,9 +37,7 @@ __FBSDID("$FreeBSD$"); #include wchar_t * -wcscpy(s1, s2) - wchar_t * __restrict s1; - const wchar_t * __restrict s2; +wcscpy(wchar_t * __restrict s1, const wchar_t * __restrict s2) { wchar_t *cp; Modified: user/sam/wifi/lib/libc/string/wcscspn.c ============================================================================== --- user/sam/wifi/lib/libc/string/wcscspn.c Thu Feb 5 18:51:14 2009 (r188167) +++ user/sam/wifi/lib/libc/string/wcscspn.c Thu Feb 5 19:04:48 2009 (r188168) @@ -37,9 +37,7 @@ __FBSDID("$FreeBSD$"); #include size_t -wcscspn(s, set) - const wchar_t *s; - const wchar_t *set; +wcscspn(const wchar_t *s, const wchar_t *set) { const wchar_t *p; const wchar_t *q; Modified: user/sam/wifi/lib/libc/string/wcslcat.c ============================================================================== --- user/sam/wifi/lib/libc/string/wcslcat.c Thu Feb 5 18:51:14 2009 (r188167) +++ user/sam/wifi/lib/libc/string/wcslcat.c Thu Feb 5 19:04:48 2009 (r188168) @@ -46,10 +46,7 @@ __FBSDID("$FreeBSD$"); * truncation occurred. */ size_t -wcslcat(dst, src, siz) - wchar_t *dst; - const wchar_t *src; - size_t siz; +wcslcat(wchar_t *dst, const wchar_t *src, size_t siz) { wchar_t *d = dst; const wchar_t *s = src; Modified: user/sam/wifi/lib/libc/string/wcslcpy.c ============================================================================== --- user/sam/wifi/lib/libc/string/wcslcpy.c Thu Feb 5 18:51:14 2009 (r188167) +++ user/sam/wifi/lib/libc/string/wcslcpy.c Thu Feb 5 19:04:48 2009 (r188168) @@ -44,10 +44,7 @@ __FBSDID("$FreeBSD$"); * Returns wcslen(src); if retval >= siz, truncation occurred. */ size_t -wcslcpy(dst, src, siz) - wchar_t *dst; - const wchar_t *src; - size_t siz; +wcslcpy(wchar_t *dst, const wchar_t *src, size_t siz) { wchar_t *d = dst; const wchar_t *s = src; Modified: user/sam/wifi/lib/libc/string/wcslen.c ============================================================================== --- user/sam/wifi/lib/libc/string/wcslen.c Thu Feb 5 18:51:14 2009 (r188167) +++ user/sam/wifi/lib/libc/string/wcslen.c Thu Feb 5 19:04:48 2009 (r188168) @@ -37,8 +37,7 @@ __FBSDID("$FreeBSD$"); #include size_t -wcslen(s) - const wchar_t *s; +wcslen(const wchar_t *s) { const wchar_t *p; Modified: user/sam/wifi/lib/libc/string/wcsncat.c ============================================================================== --- user/sam/wifi/lib/libc/string/wcsncat.c Thu Feb 5 18:51:14 2009 (r188167) +++ user/sam/wifi/lib/libc/string/wcsncat.c Thu Feb 5 19:04:48 2009 (r188168) @@ -37,10 +37,7 @@ __FBSDID("$FreeBSD$"); #include wchar_t * -wcsncat(s1, s2, n) - wchar_t * __restrict s1; - const wchar_t * __restrict s2; - size_t n; +wcsncat(wchar_t * __restrict s1, const wchar_t * __restrict s2, size_t n) { wchar_t *p; wchar_t *q; Modified: user/sam/wifi/lib/libc/string/wcsncmp.c ============================================================================== --- user/sam/wifi/lib/libc/string/wcsncmp.c Thu Feb 5 18:51:14 2009 (r188167) +++ user/sam/wifi/lib/libc/string/wcsncmp.c Thu Feb 5 19:04:48 2009 (r188168) @@ -39,9 +39,7 @@ __FBSDID("$FreeBSD$"); #include int -wcsncmp(s1, s2, n) - const wchar_t *s1, *s2; - size_t n; +wcsncmp(const wchar_t *s1, const wchar_t *s2, size_t n) { if (n == 0) Modified: user/sam/wifi/lib/libc/string/wcspbrk.c ============================================================================== --- user/sam/wifi/lib/libc/string/wcspbrk.c Thu Feb 5 18:51:14 2009 (r188167) +++ user/sam/wifi/lib/libc/string/wcspbrk.c Thu Feb 5 19:04:48 2009 (r188168) @@ -37,9 +37,7 @@ __FBSDID("$FreeBSD$"); #include wchar_t * -wcspbrk(s, set) - const wchar_t *s; - const wchar_t *set; +wcspbrk(const wchar_t *s, const wchar_t *set) { const wchar_t *p; const wchar_t *q; Modified: user/sam/wifi/lib/libc/string/wcsspn.c ============================================================================== --- user/sam/wifi/lib/libc/string/wcsspn.c Thu Feb 5 18:51:14 2009 (r188167) +++ user/sam/wifi/lib/libc/string/wcsspn.c Thu Feb 5 19:04:48 2009 (r188168) @@ -37,9 +37,7 @@ __FBSDID("$FreeBSD$"); #include size_t -wcsspn(s, set) - const wchar_t *s; - const wchar_t *set; +wcsspn(const wchar_t *s, const wchar_t *set) { const wchar_t *p; const wchar_t *q; Modified: user/sam/wifi/lib/libc/string/wcsstr.c ============================================================================== --- user/sam/wifi/lib/libc/string/wcsstr.c Thu Feb 5 18:51:14 2009 (r188167) +++ user/sam/wifi/lib/libc/string/wcsstr.c Thu Feb 5 19:04:48 2009 (r188168) @@ -49,7 +49,7 @@ wcsstr(const wchar_t * __restrict s, con wchar_t c, sc; size_t len; - if ((c = *find++) != 0) { + if ((c = *find++) != L'\0') { len = wcslen(find); do { do { Modified: user/sam/wifi/lib/libc/string/wmemchr.c ============================================================================== --- user/sam/wifi/lib/libc/string/wmemchr.c Thu Feb 5 18:51:14 2009 (r188167) +++ user/sam/wifi/lib/libc/string/wmemchr.c Thu Feb 5 19:04:48 2009 (r188168) @@ -37,10 +37,7 @@ __FBSDID("$FreeBSD$"); #include wchar_t * -wmemchr(s, c, n) - const wchar_t *s; - wchar_t c; - size_t n; +wmemchr(const wchar_t *s, wchar_t c, size_t n) { size_t i; Modified: user/sam/wifi/lib/libc/string/wmemcmp.c ============================================================================== --- user/sam/wifi/lib/libc/string/wmemcmp.c Thu Feb 5 18:51:14 2009 (r188167) +++ user/sam/wifi/lib/libc/string/wmemcmp.c Thu Feb 5 19:04:48 2009 (r188168) @@ -37,10 +37,7 @@ __FBSDID("$FreeBSD$"); #include int -wmemcmp(s1, s2, n) - const wchar_t *s1; - const wchar_t *s2; - size_t n; +wmemcmp(const wchar_t *s1, const wchar_t *s2, size_t n) { size_t i; Modified: user/sam/wifi/lib/libc/string/wmemcpy.c ============================================================================== --- user/sam/wifi/lib/libc/string/wmemcpy.c Thu Feb 5 18:51:14 2009 (r188167) +++ user/sam/wifi/lib/libc/string/wmemcpy.c Thu Feb 5 19:04:48 2009 (r188168) @@ -38,11 +38,7 @@ __FBSDID("$FreeBSD$"); #include wchar_t * -wmemcpy(d, s, n) - wchar_t * __restrict d; - const wchar_t * __restrict s; - size_t n; +wmemcpy(wchar_t * __restrict d, const wchar_t * __restrict s, size_t n) { - return (wchar_t *)memcpy(d, s, n * sizeof(wchar_t)); } Modified: user/sam/wifi/lib/libc/string/wmemmove.c ============================================================================== --- user/sam/wifi/lib/libc/string/wmemmove.c Thu Feb 5 18:51:14 2009 (r188167) +++ user/sam/wifi/lib/libc/string/wmemmove.c Thu Feb 5 19:04:48 2009 (r188168) @@ -38,11 +38,7 @@ __FBSDID("$FreeBSD$"); #include wchar_t * -wmemmove(d, s, n) - wchar_t *d; - const wchar_t *s; - size_t n; +wmemmove(wchar_t *d, const wchar_t *s, size_t n) { - return (wchar_t *)memmove(d, s, n * sizeof(wchar_t)); } Modified: user/sam/wifi/lib/libc/string/wmemset.c ============================================================================== --- user/sam/wifi/lib/libc/string/wmemset.c Thu Feb 5 18:51:14 2009 (r188167) +++ user/sam/wifi/lib/libc/string/wmemset.c Thu Feb 5 19:04:48 2009 (r188168) @@ -37,10 +37,7 @@ __FBSDID("$FreeBSD$"); #include wchar_t * -wmemset(s, c, n) - wchar_t *s; - wchar_t c; - size_t n; +wmemset(wchar_t *s, wchar_t c, size_t n) { size_t i; wchar_t *p; Modified: user/sam/wifi/lib/libc/sys/send.2 ============================================================================== --- user/sam/wifi/lib/libc/sys/send.2 Thu Feb 5 18:51:14 2009 (r188167) +++ user/sam/wifi/lib/libc/sys/send.2 Thu Feb 5 19:04:48 2009 (r188168) @@ -28,7 +28,7 @@ .\" From: @(#)send.2 8.2 (Berkeley) 2/21/94 .\" $FreeBSD$ .\" -.Dd September 13, 2006 +.Dd February 5, 2009 .Dt SEND 2 .Os .Sh NAME @@ -190,7 +190,7 @@ receiver is not listening on the remote The remote host was down. .It Bq Er ENETDOWN The remote network was down. -.It Bq Er EPERM +.It Bq Er EADDRNOTAVAIL The process using a .Dv SOCK_RAW socket was jailed and the source Modified: user/sam/wifi/lib/libusbhid/Makefile ============================================================================== --- user/sam/wifi/lib/libusbhid/Makefile Thu Feb 5 18:51:14 2009 (r188167) +++ user/sam/wifi/lib/libusbhid/Makefile Thu Feb 5 19:04:48 2009 (r188168) @@ -15,7 +15,7 @@ MLINKS= usbhid.3 libusbhid.3 usbhid.3 hi usbhid.3 hid_init.3 \ usbhid.3 hid_get_data.3 usbhid.3 hid_set_data.3 -SRCS= descr.c parse.c usage.c data.c +SRCS= descr.c descr_compat.c parse.c usage.c data.c INCS= usbhid.h Modified: user/sam/wifi/lib/libusbhid/descr.c ============================================================================== --- user/sam/wifi/lib/libusbhid/descr.c Thu Feb 5 18:51:14 2009 (r188167) +++ user/sam/wifi/lib/libusbhid/descr.c Thu Feb 5 19:04:48 2009 (r188168) @@ -39,21 +39,83 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include "usbhid.h" #include "usbvar.h" +int +hid_set_immed(int fd, int enable) +{ + int ret; + ret = ioctl(fd, USB_SET_IMMED, &enable); + if (ret < 0) + ret = hid_set_immed_compat7(fd, enable); + return (ret); +} + +int +hid_get_report_id(int fd) +{ + int temp = -1; + int ret; + + ret = ioctl(fd, USB_GET_REPORT_ID, &temp); + if (ret < 0) + ret = hid_get_report_id_compat7(fd); + else + ret = temp; + + return (ret); +} + report_desc_t hid_get_report_desc(int fd) { - struct usb_ctl_report_desc rep; + struct usb2_gen_descriptor ugd; + report_desc_t rep; + void *data; + + memset(&ugd, 0, sizeof(ugd)); + + /* get actual length first */ + ugd.ugd_data = NULL; + ugd.ugd_maxlen = 65535; + if (ioctl(fd, USB_GET_REPORT_DESC, &ugd) < 0) { + /* could not read descriptor */ + /* try FreeBSD 7 compat code */ + return (hid_get_report_desc_compat7(fd)); + } - rep.ucrd_size = 0; - if (ioctl(fd, USB_GET_REPORT_DESC, &rep) < 0) + /* + * NOTE: The kernel will return a failure if + * "ugd_actlen" is zero. + */ + data = malloc(ugd.ugd_actlen); + if (data == NULL) return (NULL); - return hid_use_report_desc(rep.ucrd_data, (unsigned int)rep.ucrd_size); + /* fetch actual descriptor */ + ugd.ugd_data = data; + ugd.ugd_maxlen = ugd.ugd_actlen; + if (ioctl(fd, USB_GET_REPORT_DESC, &ugd) < 0) { + /* could not read descriptor */ + free(data); + return (NULL); + } + + /* check END_COLLECTION */ + if (((unsigned char *)ugd.ugd_data)[ugd.ugd_actlen -1] != 0xC0) { + /* invalid end byte */ + free(data); + return (NULL); + } + + rep = hid_use_report_desc(data, ugd.ugd_actlen); + + free(data); + + return (rep); } report_desc_t Copied: user/sam/wifi/lib/libusbhid/descr_compat.c (from r188167, head/lib/libusbhid/descr_compat.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/sam/wifi/lib/libusbhid/descr_compat.c Thu Feb 5 19:04:48 2009 (r188168, copy of r188167, head/lib/libusbhid/descr_compat.c) @@ -0,0 +1,77 @@ +/* + * Copyright (c) 1999 Lennart Augustsson + * 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 THE AUTHOR OR CONTRIBUTORS 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. + */ + +/* + * This file contains fallback-compatibility code for the old FreeBSD + * USB stack. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "usbhid.h" +#include "usbvar.h" + +int +hid_set_immed_compat7(int fd, int enable) +{ + return (ioctl(fd, USB_SET_IMMED, &enable)); +} + +int +hid_get_report_id_compat7(int fd) +{ + int temp = -1; + + if (ioctl(fd, USB_GET_REPORT_ID, &temp) < 0) + return (-1); + + return (temp); +} + +report_desc_t +hid_get_report_desc_compat7(int fd) +{ + struct usb_ctl_report_desc rep; + + rep.ucrd_size = 0; + if (ioctl(fd, USB_GET_REPORT_DESC, &rep) < 0) + return (NULL); + + return (hid_use_report_desc(rep.ucrd_data, (unsigned int)rep.ucrd_size)); +} Modified: user/sam/wifi/lib/libusbhid/usbhid.3 ============================================================================== --- user/sam/wifi/lib/libusbhid/usbhid.3 Thu Feb 5 18:51:14 2009 (r188167) +++ user/sam/wifi/lib/libusbhid/usbhid.3 Thu Feb 5 19:04:48 2009 (r188168) @@ -26,12 +26,13 @@ .\" .\" $FreeBSD$ .\" -.Dd December 29, 2001 +.Dd January 27, 2009 .Dt USBHID 3 .Os .Sh NAME .Nm usbhid , .Nm hid_get_report_desc , +.Nm hid_get_report_id , .Nm hid_use_report_desc , .Nm hid_dispose_report_desc , .Nm hid_start_parse , @@ -51,6 +52,10 @@ .In usbhid.h .Ft report_desc_t .Fn hid_get_report_desc "int file" +.Ft int +.Fn hid_get_report_id "int file" +.Ft int +.Fn hid_set_immed "int fd" "int enable" .Ft report_desc_t .Fn hid_use_report_desc "unsigned char *data" "unsigned int size" .Ft void @@ -94,7 +99,15 @@ which contains the data layout informati The routines can be divided into four parts: extraction of the descriptor, parsing of the descriptor, translating to/from symbolic names, and data manipulation. +.Ss Synchronous HID operation +Synchronous HID operation can be enabled or disabled by a call to +.Fn hid_set_immed . +If the second argument is zero synchronous HID operation is disabled. +Else synchronous HID operation is enabled. +The function returns a negative value on failure. .Ss Descriptor Functions +The report descriptor ID can be obtained by calling +.Fn hid_get_report_id . A report descriptor can be obtained by calling .Fn hid_get_report_desc with a file descriptor obtained by opening a Modified: user/sam/wifi/lib/libusbhid/usbhid.h ============================================================================== --- user/sam/wifi/lib/libusbhid/usbhid.h Thu Feb 5 18:51:14 2009 (r188167) +++ user/sam/wifi/lib/libusbhid/usbhid.h Thu Feb 5 19:04:48 2009 (r188168) @@ -87,6 +87,8 @@ __BEGIN_DECLS report_desc_t hid_get_report_desc(int file); report_desc_t hid_use_report_desc(unsigned char *data, unsigned int size); void hid_dispose_report_desc(report_desc_t); +int hid_get_report_id(int file); +int hid_set_immed(int fd, int enable); /* Parsing of a HID report descriptor, parse.c: */ hid_data_t hid_start_parse(report_desc_t d, int kindset, int id); Modified: user/sam/wifi/lib/libusbhid/usbvar.h ============================================================================== --- user/sam/wifi/lib/libusbhid/usbvar.h Thu Feb 5 18:51:14 2009 (r188167) +++ user/sam/wifi/lib/libusbhid/usbvar.h Thu Feb 5 19:04:48 2009 (r188168) @@ -34,3 +34,8 @@ struct report_desc { unsigned char data[1]; }; +/* internal backwards compatibility functions */ + +int hid_set_immed_compat7(int fd, int enable); +int hid_get_report_id_compat7(int fd); +report_desc_t hid_get_report_desc_compat7(int fd); Modified: user/sam/wifi/sbin/fsck_ffs/fsck.h ============================================================================== --- user/sam/wifi/sbin/fsck_ffs/fsck.h Thu Feb 5 18:51:14 2009 (r188167) +++ user/sam/wifi/sbin/fsck_ffs/fsck.h Thu Feb 5 19:04:48 2009 (r188168) @@ -270,7 +270,7 @@ char yflag; /* assume a yes response * int bkgrdflag; /* use a snapshot to run on an active system */ int bflag; /* location of alternate super block */ int debug; /* output debugging info */ -char damagedflag; /* run in damaged mode */ +int inoopt; /* trim out unused inodes */ char ckclean; /* only do work if not cleanly unmounted */ int cvtlevel; /* convert to newer file system format */ int bkgrdcheck; /* determine if background check is possible */ @@ -337,7 +337,7 @@ void cacheino(union dinode *dp, ino_t i void catch(int); void catchquit(int); int changeino(ino_t dir, const char *name, ino_t newnum); -void check_cgmagic(int cg, struct cg *cgp); +int check_cgmagic(int cg, struct cg *cgp); int chkrange(ufs2_daddr_t blk, int cnt); void ckfini(int markclean); int ckinode(union dinode *dp, struct inodesc *); @@ -362,7 +362,7 @@ int ftypeok(union dinode *dp); void getblk(struct bufarea *bp, ufs2_daddr_t blk, long size); struct bufarea *getdatablk(ufs2_daddr_t blkno, long size); struct inoinfo *getinoinfo(ino_t inumber); -union dinode *getnextinode(ino_t inumber); +union dinode *getnextinode(ino_t inumber, int rebuildcg); void getpathname(char *namebuf, ino_t curdir, ino_t ino); union dinode *ginode(ino_t inumber); void infohandler(int sig); Modified: user/sam/wifi/sbin/fsck_ffs/fsck_ffs.8 ============================================================================== --- user/sam/wifi/sbin/fsck_ffs/fsck_ffs.8 Thu Feb 5 18:51:14 2009 (r188167) +++ user/sam/wifi/sbin/fsck_ffs/fsck_ffs.8 Thu Feb 5 19:04:48 2009 (r188168) @@ -38,7 +38,7 @@ .Nd file system consistency check and interactive repair .Sh SYNOPSIS .Nm -.Op Fl BDFpfny +.Op Fl BFprfny .Op Fl b Ar block .Op Fl c Ar level .Op Fl m Ar mode @@ -216,22 +216,6 @@ are being converted at once. The format of a file system can be determined from the first line of output from .Xr dumpfs 8 . -.It Fl D -Run -.Nm -in 'damaged recovery' mode, which will enable certain aggressive -operations that can make -.Nm -to survive with file systems that has very serious data damage, which -is an useful last resort when on disk data damage is very serious -and causes -.Nm -to crash otherwise. Be -.Em very careful -using this flag, it is dangerous if there are data transmission hazards -because a false positive cylinder group magic number mismatch could -cause -.Em irrevertible data loss! .Pp This option implies the .Fl f @@ -259,6 +243,15 @@ which is assumed to be affirmative; do not open the file system for writing. .It Fl p Preen file systems (see above). +.It Fl r +Free up excess unused inodes. +Decreasing the number of preallocated inodes reduces the +running time of future runs of +.Nm +and frees up space that can allocated to files. +The +.Fl r +option is ignored when running in preen mode. .It Fl y Assume a yes response to all questions asked by .Nm ; Modified: user/sam/wifi/sbin/fsck_ffs/fsutil.c ============================================================================== --- user/sam/wifi/sbin/fsck_ffs/fsutil.c Thu Feb 5 18:51:14 2009 (r188167) +++ user/sam/wifi/sbin/fsck_ffs/fsutil.c Thu Feb 5 19:04:48 2009 (r188168) @@ -333,9 +333,13 @@ ckfini(int markclean) if (!markclean) rerun = 1; } - } else if (!preen && !markclean) { - printf("\n***** FILE SYSTEM STILL DIRTY *****\n"); - rerun = 1; + } else if (!preen) { + if (markclean) { + printf("\n***** FILE SYSTEM IS CLEAN *****\n"); + } else { + printf("\n***** FILE SYSTEM STILL DIRTY *****\n"); + rerun = 1; + } } if (debug && totalreads > 0) printf("cache missed %ld of %ld (%d%%)\n", diskreads, @@ -418,32 +422,73 @@ blwrite(int fd, char *buf, ufs2_daddr_t } /* - * Check cg's magic number. If catastrophic mode is enabled and the cg's - * magic number is bad, offer an option to clear the whole cg. + * Verify cylinder group's magic number and other parameters. If the + * test fails, offer an option to rebuild the whole cylinder group. */ -void +int check_cgmagic(int cg, struct cg *cgp) { - if (!cg_chkmagic(cgp)) { - pwarn("CG %d: BAD MAGIC NUMBER\n", cg); - if (damagedflag) { - if (reply("CLEAR CG")) { - memset(cgp, 0, (size_t)sblock.fs_cgsize); - cgp->cg_initediblk = sblock.fs_ipg; - cgp->cg_old_niblk = sblock.fs_ipg; - cgp->cg_old_ncyl = sblock.fs_old_cpg; - cgp->cg_cgx = cg; - cgp->cg_niblk = sblock.fs_ipg; - cgp->cg_ndblk = sblock.fs_size - cgbase(&sblock, cg); - cgp->cg_magic = CG_MAGIC; - cgdirty(); - printf("PLEASE RERUN FSCK.\n"); - rerun = 1; - } - } else - printf("YOU MAY NEED TO RERUN FSCK WITH -D IF IT CRASHED.\n"); + /* + * Extended cylinder group checks. + */ + if (cg_chkmagic(cgp) && + ((sblock.fs_magic == FS_UFS1_MAGIC && + cgp->cg_old_niblk == sblock.fs_ipg && + cgp->cg_ndblk <= sblock.fs_fpg && + cgp->cg_old_ncyl == sblock.fs_old_cpg) || + (sblock.fs_magic == FS_UFS2_MAGIC && + cgp->cg_niblk == sblock.fs_ipg && + cgp->cg_ndblk <= sblock.fs_fpg && + cgp->cg_initediblk <= sblock.fs_ipg))) { + return (1); + } + pfatal("CYLINDER GROUP %d: BAD MAGIC NUMBER", cg); + if (!reply("REBUILD CYLINDER GROUP")) { + printf("YOU WILL NEED TO RERUN FSCK.\n"); + rerun = 1; + return (1); } + /* + * Zero out the cylinder group and then initialize critical fields. + * Bit maps and summaries will be recalculated by later passes. + */ + memset(cgp, 0, (size_t)sblock.fs_cgsize); + cgp->cg_magic = CG_MAGIC; + cgp->cg_cgx = cg; + cgp->cg_niblk = sblock.fs_ipg; + cgp->cg_initediblk = sblock.fs_ipg < 2 * INOPB(&sblock) ? + sblock.fs_ipg : 2 * INOPB(&sblock); + if (cgbase(&sblock, cg) + sblock.fs_fpg < sblock.fs_size) + cgp->cg_ndblk = sblock.fs_fpg; + else + cgp->cg_ndblk = sblock.fs_size - cgbase(&sblock, cg); + cgp->cg_iusedoff = &cgp->cg_space[0] - (u_char *)(&cgp->cg_firstfield); + if (sblock.fs_magic == FS_UFS1_MAGIC) { + cgp->cg_niblk = 0; + cgp->cg_initediblk = 0; + cgp->cg_old_ncyl = sblock.fs_old_cpg; + cgp->cg_old_niblk = sblock.fs_ipg; + cgp->cg_old_btotoff = cgp->cg_iusedoff; + cgp->cg_old_boff = cgp->cg_old_btotoff + + sblock.fs_old_cpg * sizeof(int32_t); + cgp->cg_iusedoff = cgp->cg_old_boff + + sblock.fs_old_cpg * sizeof(u_int16_t); + } + cgp->cg_freeoff = cgp->cg_iusedoff + howmany(sblock.fs_ipg, CHAR_BIT); *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***