Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Nov 2009 10:48:42 GMT
From:      Alexander Motin <mav@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 170471 for review
Message-ID:  <200911111048.nABAmgbc046105@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/chv.cgi?CH=170471

Change 170471 by mav@mav_mavbook on 2009/11/11 10:48:39

	IFC

Affected files ...

.. //depot/projects/scottl-camlock/src/UPDATING#21 integrate
.. //depot/projects/scottl-camlock/src/contrib/ee/ee.c#4 integrate
.. //depot/projects/scottl-camlock/src/crypto/openssh/ssh_namespace.h#5 integrate
.. //depot/projects/scottl-camlock/src/lib/libc/gen/fmtmsg.c#2 integrate
.. //depot/projects/scottl-camlock/src/lib/libc/net/gai_strerror.c#2 integrate
.. //depot/projects/scottl-camlock/src/lib/libc/nls/C.msg#3 integrate
.. //depot/projects/scottl-camlock/src/lib/libc/nls/Makefile.inc#4 integrate
.. //depot/projects/scottl-camlock/src/lib/libc/nls/ja_JP.UTF-8.msg#1 branch
.. //depot/projects/scottl-camlock/src/lib/libc/nls/ja_JP.eucJP.msg#1 branch
.. //depot/projects/scottl-camlock/src/lib/libusb/libusb.h#4 integrate
.. //depot/projects/scottl-camlock/src/lib/libusb/libusb10.c#4 integrate
.. //depot/projects/scottl-camlock/src/lib/libusb/libusb10_desc.c#4 integrate
.. //depot/projects/scottl-camlock/src/lib/libusb/libusb10_io.c#4 integrate
.. //depot/projects/scottl-camlock/src/lib/libusb/libusb20.c#3 integrate
.. //depot/projects/scottl-camlock/src/lib/libusb/libusb20_desc.c#2 integrate
.. //depot/projects/scottl-camlock/src/lib/libusb/libusb20_ugen20.c#5 integrate
.. //depot/projects/scottl-camlock/src/sbin/camcontrol/camcontrol.8#9 integrate
.. //depot/projects/scottl-camlock/src/sbin/camcontrol/camcontrol.c#29 integrate
.. //depot/projects/scottl-camlock/src/sbin/reboot/reboot.c#3 integrate
.. //depot/projects/scottl-camlock/src/secure/lib/libssh/Makefile#5 integrate
.. //depot/projects/scottl-camlock/src/share/man/man5/rc.conf.5#10 integrate
.. //depot/projects/scottl-camlock/src/share/zoneinfo/antarctica#4 integrate
.. //depot/projects/scottl-camlock/src/sys/amd64/amd64/initcpu.c#9 integrate
.. //depot/projects/scottl-camlock/src/sys/amd64/amd64/trap.c#23 integrate
.. //depot/projects/scottl-camlock/src/sys/amd64/amd64/vm_machdep.c#14 integrate
.. //depot/projects/scottl-camlock/src/sys/amd64/isa/isa_dma.c#5 integrate
.. //depot/projects/scottl-camlock/src/sys/arm/arm/trap.c#13 integrate
.. //depot/projects/scottl-camlock/src/sys/arm/arm/vm_machdep.c#19 integrate
.. //depot/projects/scottl-camlock/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c#3 integrate
.. //depot/projects/scottl-camlock/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c#5 integrate
.. //depot/projects/scottl-camlock/src/sys/conf/NOTES#41 integrate
.. //depot/projects/scottl-camlock/src/sys/conf/files#53 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/an/if_an.c#12 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/an/if_anreg.h#7 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/arcmsr/arcmsr.c#16 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/arcmsr/arcmsr.h#5 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/ata/ata-pci.h#22 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/ata/chipsets/ata-intel.c#10 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/bge/if_bge.c#27 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/fdc/fdc.c#18 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/ieee488/ibfoo.c#4 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/siis/siis.c#18 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/siis/siis.h#5 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/sound/usb/uaudio.c#24 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/syscons/scterm-teken.c#9 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/syscons/syscons.c#22 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/syscons/syscons.h#13 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/usb/controller/ehci.c#10 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/usb/controller/ehci.h#5 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/usb/controller/ehci_ixp4xx.c#6 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/usb/controller/ehci_mbus.c#7 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/usb/controller/ehci_pci.c#9 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/usb/input/atp.c#1 branch
.. //depot/projects/scottl-camlock/src/sys/dev/usb/input/uhid.c#7 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/usb/input/ukbd.c#11 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/usb/input/ums.c#9 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/usb/storage/umass.c#12 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/usb/usb_core.h#8 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/usb/usb_transfer.c#12 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/usb/usbdi.h#13 integrate
.. //depot/projects/scottl-camlock/src/sys/i386/i386/initcpu.c#11 integrate
.. //depot/projects/scottl-camlock/src/sys/i386/i386/trap.c#20 integrate
.. //depot/projects/scottl-camlock/src/sys/i386/i386/vm_machdep.c#16 integrate
.. //depot/projects/scottl-camlock/src/sys/i386/isa/isa_dma.c#6 integrate
.. //depot/projects/scottl-camlock/src/sys/ia64/ia64/trap.c#15 integrate
.. //depot/projects/scottl-camlock/src/sys/ia64/ia64/vm_machdep.c#11 integrate
.. //depot/projects/scottl-camlock/src/sys/kern/kern_sig.c#27 integrate
.. //depot/projects/scottl-camlock/src/sys/kern/vfs_lookup.c#21 integrate
.. //depot/projects/scottl-camlock/src/sys/mips/include/pcb.h#2 integrate
.. //depot/projects/scottl-camlock/src/sys/mips/mips/machdep.c#3 integrate
.. //depot/projects/scottl-camlock/src/sys/mips/mips/pmap.c#7 integrate
.. //depot/projects/scottl-camlock/src/sys/mips/mips/trap.c#2 integrate
.. //depot/projects/scottl-camlock/src/sys/mips/mips/vm_machdep.c#2 integrate
.. //depot/projects/scottl-camlock/src/sys/modules/usb/Makefile#12 integrate
.. //depot/projects/scottl-camlock/src/sys/modules/usb/atp/Makefile#1 branch
.. //depot/projects/scottl-camlock/src/sys/net80211/ieee80211_ioctl.h#16 integrate
.. //depot/projects/scottl-camlock/src/sys/netinet/ip_ipsec.c#12 integrate
.. //depot/projects/scottl-camlock/src/sys/netinet/ip_ipsec.h#5 integrate
.. //depot/projects/scottl-camlock/src/sys/netinet/ip_output.c#26 integrate
.. //depot/projects/scottl-camlock/src/sys/netinet/ipfw/ip_dummynet.c#5 integrate
.. //depot/projects/scottl-camlock/src/sys/netinet6/nd6.c#26 integrate
.. //depot/projects/scottl-camlock/src/sys/pc98/cbus/scterm-sck.c#4 integrate
.. //depot/projects/scottl-camlock/src/sys/powerpc/aim/mmu_oea64.c#8 integrate
.. //depot/projects/scottl-camlock/src/sys/powerpc/aim/trap.c#5 integrate
.. //depot/projects/scottl-camlock/src/sys/powerpc/aim/vm_machdep.c#5 integrate
.. //depot/projects/scottl-camlock/src/sys/powerpc/booke/trap.c#3 integrate
.. //depot/projects/scottl-camlock/src/sys/powerpc/booke/vm_machdep.c#5 integrate
.. //depot/projects/scottl-camlock/src/sys/rpc/clnt_vc.c#6 integrate
.. //depot/projects/scottl-camlock/src/sys/sparc64/include/pcb.h#4 integrate
.. //depot/projects/scottl-camlock/src/sys/sparc64/sparc64/trap.c#15 integrate
.. //depot/projects/scottl-camlock/src/sys/sparc64/sparc64/vm_machdep.c#9 integrate
.. //depot/projects/scottl-camlock/src/sys/sun4v/sun4v/trap.c#7 integrate
.. //depot/projects/scottl-camlock/src/sys/sun4v/sun4v/vm_machdep.c#6 integrate
.. //depot/projects/scottl-camlock/src/sys/sys/proc.h#28 integrate
.. //depot/projects/scottl-camlock/src/sys/sys/signalvar.h#13 integrate
.. //depot/projects/scottl-camlock/src/sys/teken/teken.c#6 integrate
.. //depot/projects/scottl-camlock/src/sys/teken/teken.h#5 integrate
.. //depot/projects/scottl-camlock/src/sys/teken/teken_subr.h#5 integrate
.. //depot/projects/scottl-camlock/src/tools/regression/lib/libutil/test-flopen.c#4 integrate
.. //depot/projects/scottl-camlock/src/usr.bin/gzip/unbzip2.c#3 integrate
.. //depot/projects/scottl-camlock/src/usr.sbin/sysinstall/Makefile#4 integrate
.. //depot/projects/scottl-camlock/src/usr.sbin/sysinstall/acpi.c#2 delete
.. //depot/projects/scottl-camlock/src/usr.sbin/sysinstall/acpidump.h#2 delete
.. //depot/projects/scottl-camlock/src/usr.sbin/sysinstall/biosmptable.c#2 delete
.. //depot/projects/scottl-camlock/src/usr.sbin/sysinstall/dist.c#5 integrate
.. //depot/projects/scottl-camlock/src/usr.sbin/sysinstall/install.c#5 integrate
.. //depot/projects/scottl-camlock/src/usr.sbin/sysinstall/menus.c#7 integrate
.. //depot/projects/scottl-camlock/src/usr.sbin/sysinstall/sysinstall.8#4 integrate
.. //depot/projects/scottl-camlock/src/usr.sbin/vidcontrol/vidcontrol.1#2 integrate
.. //depot/projects/scottl-camlock/src/usr.sbin/vidcontrol/vidcontrol.c#2 integrate

Differences ...

==== //depot/projects/scottl-camlock/src/UPDATING#21 (text+ko) ====

@@ -22,6 +22,11 @@
 	machines to maximize performance.  (To disable malloc debugging, run
 	ln -s aj /etc/malloc.conf.)
 
+20091109:
+	The layout of the structure ieee80211req_scan_result has changed.
+	Applications that require wireless scan results (e.g. ifconfig(8))
+	from net80211 need to be recompiled.
+
 20091025:
 	The iwn(4) driver has been updated to support the 5000 and 5150 series.
 	There's one kernel module for each firmware. Adding "device iwnfw"
@@ -1052,4 +1057,4 @@
 Contact Warner Losh if you have any questions about your use of
 this document.
 
-$FreeBSD: src/UPDATING,v 1.644 2009/11/03 21:06:19 thompsa Exp $
+$FreeBSD: src/UPDATING,v 1.645 2009/11/09 16:05:32 rpaulo Exp $

==== //depot/projects/scottl-camlock/src/contrib/ee/ee.c#4 (text+ko) ====

@@ -55,7 +55,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/contrib/ee/ee.c,v 1.7 2009/09/04 07:42:13 ache Exp $");
+__FBSDID("$FreeBSD: src/contrib/ee/ee.c,v 1.8 2009/11/10 00:48:24 delphij Exp $");
 
 char *ee_copyright_message = 
 "Copyright (c) 1986, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 2009 Hugh Mahon ";
@@ -1989,7 +1989,7 @@
 	int number;
 	int i;
 	char *ptr;
-	char *direction = NULL;
+	char *direction = "d";
 	struct text *t_line;
 
 	ptr = cmd_str;

==== //depot/projects/scottl-camlock/src/crypto/openssh/ssh_namespace.h#5 (text) ====

@@ -9,7 +9,7 @@
  *
  * nm libssh.a | awk '/[0-9a-z] [A-Z] / && $3 !~ /^ssh_/ { print "#define", $3, "ssh_" $3 }'
  *
- * $FreeBSD: src/crypto/openssh/ssh_namespace.h,v 1.8 2009/10/05 18:55:13 des Exp $
+ * $FreeBSD: src/crypto/openssh/ssh_namespace.h,v 1.9 2009/11/10 09:45:43 des Exp $
  */
 
 #define a2port					ssh_a2port
@@ -223,6 +223,8 @@
 #define get_u32					ssh_get_u32
 #define get_u64					ssh_get_u64
 #define getrrsetbyname				ssh_getrrsetbyname
+#define glob					ssh_glob
+#define globfree				ssh_globfree
 #define host_hash				ssh_host_hash
 #define hostfile_read_key			ssh_hostfile_read_key
 #define hpdelim					ssh_hpdelim

==== //depot/projects/scottl-camlock/src/lib/libc/gen/fmtmsg.c#2 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libc/gen/fmtmsg.c,v 1.5 2003/05/01 19:03:13 nectar Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/gen/fmtmsg.c,v 1.6 2009/11/08 14:02:54 brueffer Exp $");
 
 #include <fmtmsg.h>
 #include <stdio.h>
@@ -128,7 +128,7 @@
 		size += strlen(sevname);
 	if (text != MM_NULLTXT)
 		size += strlen(text);
-	if (text != MM_NULLACT)
+	if (act != MM_NULLACT)
 		size += strlen(act);
 	if (tag != MM_NULLTAG)
 		size += strlen(tag);

==== //depot/projects/scottl-camlock/src/lib/libc/net/gai_strerror.c#2 (text+ko) ====

@@ -28,9 +28,19 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libc/net/gai_strerror.c,v 1.2 2006/05/21 11:22:31 ume Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/net/gai_strerror.c,v 1.3 2009/11/09 12:46:59 ume Exp $");
 
+#include "namespace.h"
 #include <netdb.h>
+#if defined(NLS)
+#include <nl_types.h>
+#include <errno.h>
+#include <limits.h>
+#include <stdlib.h>
+#include <string.h>
+#include "reentrant.h"
+#endif
+#include "un-namespace.h"
 
 /* Entries EAI_ADDRFAMILY (1) and EAI_NODATA (7) are obsoleted, but left */
 /* for backward compatibility with userland code prior to 2553bis-02 */
@@ -52,9 +62,57 @@
 	"Argument buffer overflow"			/* EAI_OVERFLOW */
 };
 
+#if defined(NLS)
+static char		gai_buf[NL_TEXTMAX];
+static once_t		gai_init_once = ONCE_INITIALIZER;
+static thread_key_t	gai_key;
+static int		gai_keycreated = 0;
+
+static void
+gai_keycreate(void)
+{
+	gai_keycreated = (thr_keycreate(&gai_key, free) == 0);
+}
+#endif
+
 const char *
 gai_strerror(int ecode)
 {
+#if defined(NLS)
+	nl_catd catd;
+	char *buf;
+
+	if (thr_main() != 0)
+		buf = gai_buf;
+	else {
+		if (thr_once(&gai_init_once, gai_keycreate) != 0 ||
+		    !gai_keycreated)
+			goto thr_err;
+		if ((buf = thr_getspecific(gai_key)) == NULL) {
+			if ((buf = malloc(sizeof(gai_buf))) == NULL)
+				goto thr_err;
+			if (thr_setspecific(gai_key, buf) != 0) {
+				free(buf);
+				goto thr_err;
+			}
+		}
+	}
+
+	catd = catopen("libc", NL_CAT_LOCALE);
+	if (ecode > 0 && ecode < EAI_MAX)
+		strlcpy(buf, catgets(catd, 3, ecode, ai_errlist[ecode]),
+		    sizeof(gai_buf));
+	else if (ecode == 0)
+		strlcpy(buf, catgets(catd, 3, NL_MSGMAX - 1, "Success"),
+		    sizeof(gai_buf));
+	else
+		strlcpy(buf, catgets(catd, 3, NL_MSGMAX, "Unknown error"),
+		    sizeof(gai_buf));
+	catclose(catd);
+	return buf;
+
+thr_err:
+#endif
 	if (ecode >= 0 && ecode < EAI_MAX)
 		return ai_errlist[ecode];
 	return "Unknown error";

==== //depot/projects/scottl-camlock/src/lib/libc/nls/C.msg#3 (text+ko) ====

@@ -1,4 +1,4 @@
-$ $FreeBSD: src/lib/libc/nls/C.msg,v 1.2 2009/10/13 17:57:06 rwatson Exp $
+$ $FreeBSD: src/lib/libc/nls/C.msg,v 1.3 2009/11/09 12:46:59 ume Exp $
 $
 $ Message catalog for C locale (template)
 $
@@ -257,3 +257,39 @@
 30 User defined signal 1
 $ SIGUSR2
 31 User defined signal 2
+$
+$ gai_strerror() support catalog
+$
+$set 3
+$ 1 (obsolete)
+1 Address family for hostname not supported
+$ EAI_AGAIN
+2 Temporary failure in name resolution
+$ EAI_BADFLAGS
+3 Invalid value for ai_flags
+$ EAI_FAIL
+4 Non-recoverable failure in name resolution
+$ EAI_FAMILY
+5 ai_family not supported
+$ EAI_MEMORY
+6 Memory allocation failure
+$ 7 (obsolete)
+7 No address associated with hostname
+$ EAI_NONAME
+8 hostname nor servname provided, or not known
+$ EAI_SERVICE
+9 servname not supported for ai_socktype
+$ EAI_SOCKTYPE
+10 ai_socktype not supported
+$ EAI_SYSTEM
+11 System error returned in errno
+$ EAI_BADHINTS
+12 Invalid value for hints
+$ EAI_PROTOCOL
+13 Resolved protocol is unknown
+$ EAI_OVERFLOW
+14 Argument buffer overflow
+$ 0
+32766 Success
+$ NL_MSGMAX
+32767 Unknown error

==== //depot/projects/scottl-camlock/src/lib/libc/nls/Makefile.inc#4 (text+ko) ====

@@ -1,5 +1,5 @@
 #	from $NetBSD: Makefile.inc,v 1.7 1995/02/27 13:06:20 cgd Exp $
-# $FreeBSD: src/lib/libc/nls/Makefile.inc,v 1.18 2009/09/27 13:16:38 gabor Exp $
+# $FreeBSD: src/lib/libc/nls/Makefile.inc,v 1.20 2009/11/09 12:33:47 ume Exp $
 
 .PATH: ${.CURDIR}/nls
 
@@ -23,6 +23,8 @@
 NLS+=	gl_ES.ISO8859-1
 NLS+=	hu_HU.ISO8859-2
 NLS+=	it_IT.ISO8859-15
+NLS+=	ja_JP.UTF-8
+NLS+=	ja_JP.eucJP
 NLS+=	ko_KR.UTF-8
 NLS+=	ko_KR.eucKR
 NLS+=	mn_MN.UTF-8

==== //depot/projects/scottl-camlock/src/lib/libusb/libusb.h#4 (text+ko) ====

@@ -1,4 +1,4 @@
-/* $FreeBSD: src/lib/libusb/libusb.h,v 1.9 2009/07/30 00:11:41 alfred Exp $ */
+/* $FreeBSD: src/lib/libusb/libusb.h,v 1.10 2009/11/08 20:03:52 thompsa Exp $ */
 /*-
  * Copyright (c) 2009 Sylvestre Gallon. All rights reserved.
  *
@@ -271,9 +271,11 @@
 	uint16_t wLength;
 }	libusb_control_setup;
 
+#define	LIBUSB_CONTROL_SETUP_SIZE	8	/* bytes */
+
 typedef struct libusb_iso_packet_descriptor {
-	unsigned int length;
-	unsigned int actual_length;
+	uint32_t length;
+	uint32_t actual_length;
 	enum libusb_transfer_status status;
 }	libusb_iso_packet_descriptor __aligned(sizeof(void *));
 
@@ -282,9 +284,9 @@
 typedef struct libusb_transfer {
 	libusb_device_handle *dev_handle;
 	uint8_t	flags;
-	unsigned int endpoint;
+	uint32_t endpoint;
 	uint8_t type;
-	unsigned int timeout;
+	uint32_t timeout;
 	enum libusb_transfer_status status;
 	int	length;
 	int	actual_length;
@@ -320,7 +322,7 @@
 int	libusb_set_configuration(libusb_device_handle * devh, int configuration);
 int	libusb_claim_interface(libusb_device_handle * devh, int interface_number);
 int	libusb_release_interface(libusb_device_handle * devh, int interface_number);
-int	libusb_reset_device(libusb_device_handle * dev);
+int	libusb_reset_device(libusb_device_handle * devh);
 int 	libusb_kernel_driver_active(libusb_device_handle * devh, int interface);
 int 	libusb_detach_kernel_driver(libusb_device_handle * devh, int interface);
 int 	libusb_attach_kernel_driver(libusb_device_handle * devh, int interface);
@@ -333,7 +335,8 @@
 int	libusb_get_config_descriptor(libusb_device * dev, uint8_t config_index, struct libusb_config_descriptor **config);
 int	libusb_get_config_descriptor_by_value(libusb_device * dev, uint8_t bConfigurationValue, struct libusb_config_descriptor **config);
 void	libusb_free_config_descriptor(struct libusb_config_descriptor *config);
-int	libusb_get_string_descriptor_ascii(libusb_device_handle * dev, uint8_t desc_index, uint8_t *data, int length);
+int	libusb_get_string_descriptor_ascii(libusb_device_handle * devh, uint8_t desc_index, uint8_t *data, int length);
+int	libusb_get_descriptor(libusb_device_handle * devh, uint8_t desc_type, uint8_t desc_index, uint8_t *data, int length);
 
 /* Asynchronous device I/O */
 
@@ -341,7 +344,16 @@
 void	libusb_free_transfer(struct libusb_transfer *transfer);
 int	libusb_submit_transfer(struct libusb_transfer *transfer);
 int	libusb_cancel_transfer(struct libusb_transfer *transfer);
-uint8_t *libusb_get_iso_packet_buffer_simple(struct libusb_transfer *transfer, unsigned int packet);
+uint8_t *libusb_get_iso_packet_buffer(struct libusb_transfer *transfer, uint32_t index);
+uint8_t *libusb_get_iso_packet_buffer_simple(struct libusb_transfer *transfer, uint32_t index);
+void	libusb_set_iso_packet_lengths(struct libusb_transfer *transfer, uint32_t length);
+uint8_t *libusb_control_transfer_get_data(struct libusb_transfer *transfer);
+struct libusb_control_setup *libusb_control_transfer_get_setup(struct libusb_transfer *transfer);
+void	libusb_fill_control_setup(uint8_t *buf, uint8_t bmRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex, uint16_t wLength);
+void	libusb_fill_control_transfer(struct libusb_transfer *transfer, libusb_device_handle *devh, uint8_t *buf, libusb_transfer_cb_fn callback, void *user_data, uint32_t timeout);
+void	libusb_fill_bulk_transfer(struct libusb_transfer *transfer, libusb_device_handle *devh, uint8_t endpoint, uint8_t *buf, int length, libusb_transfer_cb_fn callback, void *user_data, uint32_t timeout);
+void	libusb_fill_interrupt_transfer(struct libusb_transfer *transfer, libusb_device_handle *devh, uint8_t endpoint, uint8_t *buf, int length, libusb_transfer_cb_fn callback, void *user_data, uint32_t timeout);
+void	libusb_fill_iso_transfer(struct libusb_transfer *transfer, libusb_device_handle *devh, uint8_t endpoint, uint8_t *buf, int length, int npacket, libusb_transfer_cb_fn callback, void *user_data, uint32_t timeout);
 
 /* Polling and timing */
 
@@ -362,9 +374,14 @@
 
 /* Synchronous device I/O */
 
-int	libusb_control_transfer(libusb_device_handle * devh, uint8_t bmRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex, uint8_t *data, uint16_t wLength, unsigned int timeout);
-int	libusb_bulk_transfer(libusb_device_handle *devh, uint8_t endpoint, uint8_t *data, int length, int *transferred, unsigned int timeout);
-int	libusb_interrupt_transfer(libusb_device_handle *devh, uint8_t endpoint, uint8_t *data, int length, int *transferred, unsigned int timeout);
+int	libusb_control_transfer(libusb_device_handle * devh, uint8_t bmRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex, uint8_t *data, uint16_t wLength, uint32_t timeout);
+int	libusb_bulk_transfer(libusb_device_handle * devh, uint8_t endpoint, uint8_t *data, int length, int *transferred, uint32_t timeout);
+int	libusb_interrupt_transfer(libusb_device_handle * devh, uint8_t endpoint, uint8_t *data, int length, int *transferred, uint32_t timeout);
+
+/* Byte-order */
+
+uint16_t libusb_cpu_to_le16(uint16_t x);
+uint16_t libusb_le16_to_cpu(uint16_t x);
 
 #if 0
 {					/* indent fix */

==== //depot/projects/scottl-camlock/src/lib/libusb/libusb10.c#4 (text+ko) ====

@@ -1,4 +1,4 @@
-/* $FreeBSD: src/lib/libusb/libusb10.c,v 1.3 2009/07/30 00:11:41 alfred Exp $ */
+/* $FreeBSD: src/lib/libusb/libusb10.c,v 1.4 2009/11/08 20:03:52 thompsa Exp $ */
 /*-
  * Copyright (c) 2009 Sylvestre Gallon. All rights reserved.
  * Copyright (c) 2009 Hans Petter Selasky. All rights reserved.
@@ -35,6 +35,7 @@
 #include <sys/ioctl.h>
 #include <sys/filio.h>
 #include <sys/queue.h>
+#include <sys/endian.h>
 
 #include "libusb20.h"
 #include "libusb20_desc.h"
@@ -185,8 +186,6 @@
 	/* create libusb v1.0 compliant devices */
 	i = 0;
 	while ((pdev = libusb20_be_device_foreach(usb_backend, NULL))) {
-		/* get device into libUSB v1.0 list */
-		libusb20_be_dequeue_device(usb_backend, pdev);
 
 		dev = malloc(sizeof(*dev));
 		if (dev == NULL) {
@@ -199,6 +198,10 @@
 			libusb20_be_free(usb_backend);
 			return (LIBUSB_ERROR_NO_MEM);
 		}
+
+		/* get device into libUSB v1.0 list */
+		libusb20_be_dequeue_device(usb_backend, pdev);
+
 		memset(dev, 0, sizeof(*dev));
 
 		/* init transfer queues */
@@ -416,6 +419,8 @@
 	libusb10_remove_pollfd(ctx, &dev->dev_poll);
 
 	libusb20_dev_close(pdev);
+
+	/* unref will free the "pdev" when the refcount reaches zero */
 	libusb_unref_device(dev);
 
 	/* make sure our event loop detects the closed device */
@@ -1195,7 +1200,7 @@
 	struct libusb20_transfer *pxfer1;
 	struct libusb_super_transfer *sxfer;
 	struct libusb_device *dev;
-	unsigned int endpoint;
+	uint32_t endpoint;
 	int err;
 
 	if (uxfer == NULL)
@@ -1252,7 +1257,7 @@
 	struct libusb20_transfer *pxfer1;
 	struct libusb_super_transfer *sxfer;
 	struct libusb_device *dev;
-	unsigned int endpoint;
+	uint32_t endpoint;
 
 	if (uxfer == NULL)
 		return (LIBUSB_ERROR_INVALID_PARAM);
@@ -1312,3 +1317,16 @@
 {
 	/* TODO */
 }
+
+uint16_t
+libusb_cpu_to_le16(uint16_t x)
+{
+	return (htole16(x));
+}
+
+uint16_t
+libusb_le16_to_cpu(uint16_t x)
+{
+	return (le16toh(x));
+}
+

==== //depot/projects/scottl-camlock/src/lib/libusb/libusb10_desc.c#4 (text+ko) ====

@@ -1,4 +1,4 @@
-/* $FreeBSD: src/lib/libusb/libusb10_desc.c,v 1.3 2009/07/30 00:11:41 alfred Exp $ */
+/* $FreeBSD: src/lib/libusb/libusb10_desc.c,v 1.4 2009/11/08 20:03:52 thompsa Exp $ */
 /*-
  * Copyright (c) 2009 Sylvestre Gallon. All rights reserved.
  *
@@ -35,6 +35,8 @@
 #include "libusb.h"
 #include "libusb10.h"
 
+#define	N_ALIGN(n) (-((-(n)) & (-8UL)))
+
 /* USB descriptors */
 
 int
@@ -114,17 +116,17 @@
 
 	nalt = nif = pconf->num_interface;
 	nep = 0;
-	nextra = pconf->extra.len;
+	nextra = N_ALIGN(pconf->extra.len);
 
 	for (i = 0; i < nif; i++) {
 
 		pinf = pconf->interface + i;
-		nextra += pinf->extra.len;
+		nextra += N_ALIGN(pinf->extra.len);
 		nep += pinf->num_endpoints;
 		k = pinf->num_endpoints;
 		pend = pinf->endpoints;
 		while (k--) {
-			nextra += pend->extra.len;
+			nextra += N_ALIGN(pend->extra.len);
 			pend++;
 		}
 
@@ -132,12 +134,12 @@
 		nalt += pinf->num_altsetting;
 		pinf = pinf->altsetting;
 		while (j--) {
-			nextra += pinf->extra.len;
+			nextra += N_ALIGN(pinf->extra.len);
 			nep += pinf->num_endpoints;
 			k = pinf->num_endpoints;
 			pend = pinf->endpoints;
 			while (k--) {
-				nextra += pend->extra.len;
+				nextra += N_ALIGN(pend->extra.len);
 				pend++;
 			}
 			pinf++;
@@ -150,17 +152,18 @@
 	    (nalt * sizeof(libusb_interface_descriptor)) +
 	    (nep * sizeof(libusb_endpoint_descriptor));
 
+	nextra = N_ALIGN(nextra);
+
 	pconfd = malloc(nextra);
 
 	if (pconfd == NULL) {
 		free(pconf);
 		return (LIBUSB_ERROR_NO_MEM);
 	}
-	/* make sure memory is clean */
+	/* make sure memory is initialised */
 	memset(pconfd, 0, nextra);
 
-	pconfd->interface = (libusb_interface *) (pconfd +
-	    sizeof(libusb_config_descriptor));
+	pconfd->interface = (libusb_interface *) (pconfd + 1);
 
 	ifd = (libusb_interface_descriptor *) (pconfd->interface + nif);
 	endd = (libusb_endpoint_descriptor *) (ifd + nalt);
@@ -181,7 +184,7 @@
 		pconfd->extra_length = pconf->extra.len;
 		pconfd->extra = pextra;
 		memcpy(pextra, pconf->extra.ptr, pconfd->extra_length);
-		pextra += pconfd->extra_length;
+		pextra += N_ALIGN(pconfd->extra_length);
 	}
 	/* setup all interface and endpoint pointers */
 
@@ -221,7 +224,7 @@
 				ifd->extra_length = pinf->extra.len;
 				ifd->extra = pextra;
 				memcpy(pextra, pinf->extra.ptr, pinf->extra.len);
-				pextra += pinf->extra.len;
+				pextra += N_ALIGN(pinf->extra.len);
 			}
 			for (k = 0; k < pinf->num_endpoints; k++) {
 				pend = &pinf->endpoints[k];
@@ -238,7 +241,7 @@
 					endd->extra_length = pend->extra.len;
 					endd->extra = pextra;
 					memcpy(pextra, pend->extra.ptr, pend->extra.len);
-					pextra += pend->extra.len;
+					pextra += N_ALIGN(pend->extra.len);
 				}
 			}
 		}
@@ -304,3 +307,12 @@
 
 	return (LIBUSB_ERROR_OTHER);
 }
+
+int
+libusb_get_descriptor(libusb_device_handle * devh, uint8_t desc_type, 
+    uint8_t desc_index, uint8_t *data, int length)
+{
+	return (libusb_control_transfer(devh, LIBUSB_ENDPOINT_IN,
+	    LIBUSB_REQUEST_GET_DESCRIPTOR, (desc_type << 8) | desc_index, 0, data,
+	    length, 1000));
+}

==== //depot/projects/scottl-camlock/src/lib/libusb/libusb10_io.c#4 (text+ko) ====

@@ -1,4 +1,4 @@
-/* $FreeBSD: src/lib/libusb/libusb10_io.c,v 1.3 2009/07/30 00:11:41 alfred Exp $ */
+/* $FreeBSD: src/lib/libusb/libusb10_io.c,v 1.4 2009/11/08 20:03:52 thompsa Exp $ */
 /*-
  * Copyright (c) 2009 Sylvestre Gallon. All rights reserved.
  *
@@ -32,6 +32,7 @@
 #include <time.h>
 #include <errno.h>
 #include <sys/queue.h>
+#include <sys/endian.h>
 
 #include "libusb20.h"
 #include "libusb20_desc.h"
@@ -148,19 +149,19 @@
 		goto do_done;
 	}
 	for (i = 0; i != nfds; i++) {
-		if (fds[i].revents == 0)
-			continue;
 		if (ppdev[i] != NULL) {
 			dev = libusb_get_device(ppdev[i]);
 
-			err = libusb20_dev_process(ppdev[i]);
+			if (fds[i].revents == 0)
+				err = 0;	/* nothing to do */
+			else
+				err = libusb20_dev_process(ppdev[i]);
+
 			if (err) {
 				/* cancel all transfers - device is gone */
 				libusb10_cancel_all_transfer(dev);
-				/*
-				 * make sure we don't go into an infinite
-				 * loop
-				 */
+
+				/* remove USB device from polling loop */
 				libusb10_remove_pollfd(dev->ctx, &dev->dev_poll);
 			}
 			CTX_UNLOCK(ctx);
@@ -573,3 +574,160 @@
 	DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_interrupt_transfer leave");
 	return (ret);
 }
+
+uint8_t *
+libusb_get_iso_packet_buffer(struct libusb_transfer *transfer, uint32_t index)
+{
+	uint8_t *ptr;
+	uint32_t n;
+
+	if (transfer->num_iso_packets < 0)
+		return (NULL);
+
+	if (index >= (uint32_t)transfer->num_iso_packets)
+		return (NULL);
+
+	ptr = transfer->buffer;
+	if (ptr == NULL)
+		return (NULL);
+
+	for (n = 0; n != index; n++) {
+		ptr += transfer->iso_packet_desc[n].length;
+	}
+	return (ptr);
+}
+
+uint8_t *
+libusb_get_iso_packet_buffer_simple(struct libusb_transfer *transfer, uint32_t index)
+{
+	uint8_t *ptr;
+
+	if (transfer->num_iso_packets < 0)
+		return (NULL);
+
+	if (index >= (uint32_t)transfer->num_iso_packets)
+		return (NULL);
+
+	ptr = transfer->buffer;
+	if (ptr == NULL)
+		return (NULL);
+
+	ptr += transfer->iso_packet_desc[0].length * index;
+
+	return (ptr);
+}
+
+void
+libusb_set_iso_packet_lengths(struct libusb_transfer *transfer, uint32_t length)
+{
+	int n;
+
+	if (transfer->num_iso_packets < 0)
+		return;
+
+	for (n = 0; n != transfer->num_iso_packets; n++)
+		transfer->iso_packet_desc[n].length = length;
+}
+
+uint8_t *
+libusb_control_transfer_get_data(struct libusb_transfer *transfer)
+{
+	if (transfer->buffer == NULL)
+		return (NULL);
+
+	return (transfer->buffer + LIBUSB_CONTROL_SETUP_SIZE);
+}
+
+struct libusb_control_setup *
+libusb_control_transfer_get_setup(struct libusb_transfer *transfer)
+{
+	return ((struct libusb_control_setup *)transfer->buffer);
+}
+
+void
+libusb_fill_control_setup(uint8_t *buf, uint8_t bmRequestType,
+    uint8_t bRequest, uint16_t wValue,
+    uint16_t wIndex, uint16_t wLength)
+{
+	struct libusb_control_setup *req = (struct libusb_control_setup *)buf;
+
+	/* The alignment is OK for all fields below. */
+	req->bmRequestType = bmRequestType;
+	req->bRequest = bRequest;
+	req->wValue = htole16(wValue);
+	req->wIndex = htole16(wIndex);
+	req->wLength = htole16(wLength);
+}
+
+void
+libusb_fill_control_transfer(struct libusb_transfer *transfer, 
+    libusb_device_handle *devh, uint8_t *buf,
+    libusb_transfer_cb_fn callback, void *user_data,
+    uint32_t timeout)
+{
+	struct libusb_control_setup *setup = (struct libusb_control_setup *)buf;
+
+	transfer->dev_handle = devh;
+	transfer->endpoint = 0;
+	transfer->type = LIBUSB_TRANSFER_TYPE_CONTROL;
+	transfer->timeout = timeout;
+	transfer->buffer = buf;
+	if (setup != NULL)
+		transfer->length = LIBUSB_CONTROL_SETUP_SIZE
+			+ le16toh(setup->wLength);
+	else
+		transfer->length = 0;
+	transfer->user_data = user_data;
+	transfer->callback = callback;
+
+}
+
+void
+libusb_fill_bulk_transfer(struct libusb_transfer *transfer, 
+    libusb_device_handle *devh, uint8_t endpoint, uint8_t *buf, 
+    int length, libusb_transfer_cb_fn callback, void *user_data,
+    uint32_t timeout)
+{
+	transfer->dev_handle = devh;
+	transfer->endpoint = endpoint;
+	transfer->type = LIBUSB_TRANSFER_TYPE_BULK;
+	transfer->timeout = timeout;
+	transfer->buffer = buf;
+	transfer->length = length;
+	transfer->user_data = user_data;
+	transfer->callback = callback;
+}
+
+void
+libusb_fill_interrupt_transfer(struct libusb_transfer *transfer,
+    libusb_device_handle *devh, uint8_t endpoint, uint8_t *buf,
+    int length, libusb_transfer_cb_fn callback, void *user_data,
+    uint32_t timeout)
+{
+	transfer->dev_handle = devh;
+	transfer->endpoint = endpoint;
+	transfer->type = LIBUSB_TRANSFER_TYPE_INTERRUPT;
+	transfer->timeout = timeout;
+	transfer->buffer = buf;
+	transfer->length = length;
+	transfer->user_data = user_data;
+	transfer->callback = callback;
+}
+
+void
+libusb_fill_iso_transfer(struct libusb_transfer *transfer, 
+    libusb_device_handle *devh, uint8_t endpoint, uint8_t *buf,
+    int length, int npacket, libusb_transfer_cb_fn callback,
+    void *user_data, uint32_t timeout)
+{
+	transfer->dev_handle = devh;
+	transfer->endpoint = endpoint;
+	transfer->type = LIBUSB_TRANSFER_TYPE_ISOCHRONOUS;
+	transfer->timeout = timeout;
+	transfer->buffer = buf;
+	transfer->length = length;
+	transfer->num_iso_packets = npacket;
+	transfer->user_data = user_data;
+	transfer->callback = callback;
+}
+

==== //depot/projects/scottl-camlock/src/lib/libusb/libusb20.c#3 (text+ko) ====

@@ -1,4 +1,4 @@
-/* $FreeBSD: src/lib/libusb/libusb20.c,v 1.4 2009/06/12 16:07:06 thompsa Exp $ */
+/* $FreeBSD: src/lib/libusb/libusb20.c,v 1.5 2009/11/08 20:03:52 thompsa Exp $ */
 /*-
  * Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
  *
@@ -630,6 +630,9 @@
 	struct LIBUSB20_CONTROL_SETUP_DECODED req;
 	int error;
 
+	/* make sure memory is initialised */
+	memset(ptr, 0, len);
+
 	if (len < 4) {
 		/* invalid length */
 		return (LIBUSB20_ERROR_INVALID_PARAM);
@@ -1093,7 +1096,8 @@
 	if (pbe->methods->exit_backend) {
 		pbe->methods->exit_backend(pbe);
 	}
-	return;
+	/* free backend */
+	free(pbe);
 }
 
 void
@@ -1101,7 +1105,6 @@
 {
 	pdev->beMethods = pbe->methods;	/* copy backend methods */
 	TAILQ_INSERT_TAIL(&(pbe->usb_devs), pdev, dev_entry);
-	return;
 }
 
 void
@@ -1109,5 +1112,4 @@
     struct libusb20_device *pdev)
 {
 	TAILQ_REMOVE(&(pbe->usb_devs), pdev, dev_entry);
-	return;
 }

==== //depot/projects/scottl-camlock/src/lib/libusb/libusb20_desc.c#2 (text+ko) ====

@@ -1,4 +1,4 @@
-/* $FreeBSD: src/lib/libusb/libusb20_desc.c,v 1.1 2009/03/09 17:09:46 thompsa Exp $ */
+/* $FreeBSD: src/lib/libusb/libusb20_desc.c,v 1.2 2009/11/08 20:03:52 thompsa Exp $ */
 /*-
  * Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
  *
@@ -118,6 +118,9 @@
 	if (lub_config == NULL) {
 		return (NULL);		/* out of memory */
 	}
+	/* make sure memory is initialised */
+	memset(lub_config, 0, size);
+
 	lub_interface = (void *)(lub_config + 1);
 	lub_alt_interface = (void *)(lub_interface + niface_no_alt);
 	lub_endpoint = (void *)(lub_interface + niface);

==== //depot/projects/scottl-camlock/src/lib/libusb/libusb20_ugen20.c#5 (text+ko) ====

@@ -1,4 +1,4 @@
-/* $FreeBSD: src/lib/libusb/libusb20_ugen20.c,v 1.5 2009/10/22 21:01:41 thompsa Exp $ */
+/* $FreeBSD: src/lib/libusb/libusb20_ugen20.c,v 1.6 2009/11/08 20:03:52 thompsa Exp $ */
 /*-
  * Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
  *
@@ -449,6 +449,8 @@
 	uint16_t len;
 	int error;
 
+	/* make sure memory is initialised */
+	memset(&cdesc, 0, sizeof(cdesc));
 	memset(&gen_desc, 0, sizeof(gen_desc));
 
 	gen_desc.ugd_data = &cdesc;
@@ -468,6 +470,10 @@
 	if (!ptr) {
 		return (LIBUSB20_ERROR_NO_MEM);
 	}
+
+	/* make sure memory is initialised */
+	memset(ptr, 0, len);
+
 	gen_desc.ugd_data = ptr;
 	gen_desc.ugd_maxlen = len;
 

==== //depot/projects/scottl-camlock/src/sbin/camcontrol/camcontrol.8#9 (text+ko) ====

@@ -25,9 +25,9 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.\" $FreeBSD: src/sbin/camcontrol/camcontrol.8,v 1.46 2009/09/04 18:21:40 mav Exp $
+.\" $FreeBSD: src/sbin/camcontrol/camcontrol.8,v 1.47 2009/11/09 11:39:51 mav Exp $
 .\"
-.Dd September 4, 2009
+.Dd November 9, 2009
 .Dt CAMCONTROL 8
 .Os
 .Sh NAME
@@ -165,6 +165,20 @@
 .Op Fl w
 .Op Fl y
 .Nm
+.Ic idle
+.Op device id
+.Op generic args
+.Op Fl t Ar time
+.Nm
+.Ic standby
+.Op device id
+.Op generic args
+.Op Fl t Ar time
+.Nm
+.Ic sleep
+.Op device id
+.Op generic args
+.Nm
 .Ic help
 .Sh DESCRIPTION
 The
@@ -821,6 +835,15 @@
 will not be asked about the timeout if a timeout is specified on the
 command line.
 .El
+.It Ic idle
+Put ATA device into IDLE state. Optional parameter specifies automatic
+idle timer value in seconds.
+.It Ic standby
+Put ATA device into STANDBY state. Optional parameter specifies automatic
+standby timer value in seconds.
+.It Ic sleep
+Put ATA device into SLEEP state. Note that the only way get device out of
+this state may be reset.
 .It Ic help
 Print out verbose usage information.
 .El

==== //depot/projects/scottl-camlock/src/sbin/camcontrol/camcontrol.c#29 (text+ko) ====

@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sbin/camcontrol/camcontrol.c,v 1.67 2009/11/04 15:24:32 mav Exp $");
+__FBSDID("$FreeBSD: src/sbin/camcontrol/camcontrol.c,v 1.69 2009/11/09 19:47:46 mav Exp $");
 
 #include <sys/ioctl.h>
 #include <sys/stdint.h>
@@ -74,7 +74,10 @@

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



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