Date: Tue, 13 Jan 2009 20:42:06 +0000 (UTC) From: Andrew Thompson <thompsa@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r187189 - in user/thompsa/usb: . bin/kenv bin/ln lib/libarchive lib/libc/string lib/libusb20 lib/msun/src sbin/mount share/examples/cvsup sys/amd64/conf sys/arm/arm sys/boot/forth sys/c... Message-ID: <200901132042.n0DKg6KY015323@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: thompsa Date: Tue Jan 13 20:42:05 2009 New Revision: 187189 URL: http://svn.freebsd.org/changeset/base/187189 Log: MFH r187125-187188 Added: user/thompsa/usb/sys/dev/usb2/controller/atmegadci.c - copied unchanged from r187188, head/sys/dev/usb2/controller/atmegadci.c user/thompsa/usb/sys/dev/usb2/controller/atmegadci.h - copied unchanged from r187188, head/sys/dev/usb2/controller/atmegadci.h user/thompsa/usb/sys/dev/usb2/controller/atmegadci_atmelarm.c - copied unchanged from r187188, head/sys/dev/usb2/controller/atmegadci_atmelarm.c user/thompsa/usb/sys/modules/usb2/controller_atmegadci/ - copied from r187188, head/sys/modules/usb2/controller_atmegadci/ Deleted: user/thompsa/usb/sys/powerpc/booke/support.S Modified: user/thompsa/usb/ (props changed) user/thompsa/usb/bin/kenv/kenv.1 user/thompsa/usb/bin/ln/ln.1 user/thompsa/usb/lib/libarchive/archive_read_support_format_iso9660.c user/thompsa/usb/lib/libc/string/ffs.3 user/thompsa/usb/lib/libusb20/libusb20.c user/thompsa/usb/lib/msun/src/e_rem_pio2.c user/thompsa/usb/lib/msun/src/e_rem_pio2f.c user/thompsa/usb/lib/msun/src/k_cosf.c user/thompsa/usb/lib/msun/src/k_sinf.c user/thompsa/usb/lib/msun/src/k_tanf.c user/thompsa/usb/sbin/mount/mount.c user/thompsa/usb/share/examples/cvsup/refuse.README user/thompsa/usb/sys/amd64/conf/GENERIC user/thompsa/usb/sys/amd64/conf/USB2 user/thompsa/usb/sys/arm/arm/cpufunc_asm_sheeva.S (props changed) user/thompsa/usb/sys/boot/forth/support.4th user/thompsa/usb/sys/conf/files user/thompsa/usb/sys/conf/files.powerpc user/thompsa/usb/sys/dev/ath/ath_hal/ar5212/ar5212_rfgain.c user/thompsa/usb/sys/dev/bce/if_bce.c user/thompsa/usb/sys/dev/sound/pci/hda/hdac.c user/thompsa/usb/sys/dev/usb/usbdevs user/thompsa/usb/sys/dev/usb2/controller/at91dci.c user/thompsa/usb/sys/dev/usb2/controller/at91dci.h user/thompsa/usb/sys/dev/usb2/controller/at91dci_atmelarm.c user/thompsa/usb/sys/dev/usb2/controller/ehci2.c user/thompsa/usb/sys/dev/usb2/controller/ehci2.h user/thompsa/usb/sys/dev/usb2/controller/ehci2_pci.c user/thompsa/usb/sys/dev/usb2/controller/musb2_otg.c user/thompsa/usb/sys/dev/usb2/controller/musb2_otg.h user/thompsa/usb/sys/dev/usb2/controller/musb2_otg_atmelarm.c user/thompsa/usb/sys/dev/usb2/controller/ohci2.c user/thompsa/usb/sys/dev/usb2/controller/ohci2.h user/thompsa/usb/sys/dev/usb2/controller/ohci2_atmelarm.c user/thompsa/usb/sys/dev/usb2/controller/ohci2_pci.c user/thompsa/usb/sys/dev/usb2/controller/uhci2.c user/thompsa/usb/sys/dev/usb2/controller/uhci2.h user/thompsa/usb/sys/dev/usb2/controller/uhci2_pci.c user/thompsa/usb/sys/dev/usb2/controller/usb2_bus.h user/thompsa/usb/sys/dev/usb2/controller/usb2_controller.c user/thompsa/usb/sys/dev/usb2/controller/usb2_controller.h user/thompsa/usb/sys/dev/usb2/controller/uss820dci.c user/thompsa/usb/sys/dev/usb2/controller/uss820dci.h user/thompsa/usb/sys/dev/usb2/controller/uss820dci_atmelarm.c user/thompsa/usb/sys/dev/usb2/core/usb2_busdma.c user/thompsa/usb/sys/dev/usb2/core/usb2_compat_linux.c user/thompsa/usb/sys/dev/usb2/core/usb2_core.h user/thompsa/usb/sys/dev/usb2/core/usb2_debug.c user/thompsa/usb/sys/dev/usb2/core/usb2_device.c user/thompsa/usb/sys/dev/usb2/core/usb2_generic.c user/thompsa/usb/sys/dev/usb2/core/usb2_handle_request.c user/thompsa/usb/sys/dev/usb2/core/usb2_hub.c user/thompsa/usb/sys/dev/usb2/core/usb2_mbuf.h user/thompsa/usb/sys/dev/usb2/core/usb2_parse.c user/thompsa/usb/sys/dev/usb2/core/usb2_request.c user/thompsa/usb/sys/dev/usb2/core/usb2_sw_transfer.c user/thompsa/usb/sys/dev/usb2/core/usb2_transfer.c user/thompsa/usb/sys/dev/usb2/core/usb2_transfer.h user/thompsa/usb/sys/dev/usb2/include/usb2_defs.h user/thompsa/usb/sys/dev/usb2/include/usb2_devid.h user/thompsa/usb/sys/dev/usb2/include/usb2_devtable.h user/thompsa/usb/sys/dev/usb2/include/usb2_standard.h user/thompsa/usb/sys/dev/usb2/serial/u3g2.c user/thompsa/usb/sys/dev/usb2/serial/uark2.c user/thompsa/usb/sys/dev/usb2/serial/ubsa2.c user/thompsa/usb/sys/dev/usb2/serial/ubser2.c user/thompsa/usb/sys/dev/usb2/serial/uchcom2.c user/thompsa/usb/sys/dev/usb2/serial/ucycom2.c user/thompsa/usb/sys/dev/usb2/serial/ufoma2.c user/thompsa/usb/sys/dev/usb2/serial/uftdi2.c user/thompsa/usb/sys/dev/usb2/serial/ugensa2.c user/thompsa/usb/sys/dev/usb2/serial/uipaq2.c user/thompsa/usb/sys/dev/usb2/serial/ulpt2.c user/thompsa/usb/sys/dev/usb2/serial/umct2.c user/thompsa/usb/sys/dev/usb2/serial/umodem2.c user/thompsa/usb/sys/dev/usb2/serial/umoscom2.c user/thompsa/usb/sys/dev/usb2/serial/uplcom2.c user/thompsa/usb/sys/dev/usb2/serial/usb2_serial.c user/thompsa/usb/sys/dev/usb2/serial/usb2_serial.h user/thompsa/usb/sys/dev/usb2/serial/uvisor2.c user/thompsa/usb/sys/dev/usb2/serial/uvscom2.c user/thompsa/usb/sys/dev/usb2/sound/uaudio2.c user/thompsa/usb/sys/dev/usb2/storage/ata-usb2.c user/thompsa/usb/sys/dev/usb2/storage/umass2.c user/thompsa/usb/sys/i386/conf/GENERIC user/thompsa/usb/sys/i386/conf/USB2 user/thompsa/usb/sys/i386/i386/msi.c user/thompsa/usb/sys/kern/kern_timeout.c user/thompsa/usb/sys/powerpc/booke/locore.S user/thompsa/usb/sys/powerpc/booke/machdep.c user/thompsa/usb/sys/powerpc/booke/pmap.c user/thompsa/usb/sys/powerpc/booke/trap_subr.S user/thompsa/usb/sys/powerpc/include/pcpu.h user/thompsa/usb/sys/powerpc/include/pmap.h user/thompsa/usb/sys/powerpc/include/pte.h user/thompsa/usb/sys/powerpc/include/tlb.h user/thompsa/usb/sys/powerpc/powerpc/genassym.c user/thompsa/usb/tools/sched/schedgraph.py user/thompsa/usb/usr.bin/make/job.c user/thompsa/usb/usr.bin/make/main.c user/thompsa/usb/usr.bin/netstat/inet6.c user/thompsa/usb/usr.sbin/crunch/crunchgen/crunchgen.c user/thompsa/usb/usr.sbin/makefs/ffs/ffs_bswap.c (props changed) user/thompsa/usb/usr.sbin/makefs/ffs/ffs_subr.c (props changed) user/thompsa/usb/usr.sbin/makefs/ffs/ufs_bswap.h (props changed) user/thompsa/usb/usr.sbin/makefs/getid.c (props changed) user/thompsa/usb/usr.sbin/usbconfig/usbconfig.c Modified: user/thompsa/usb/bin/kenv/kenv.1 ============================================================================== --- user/thompsa/usb/bin/kenv/kenv.1 Tue Jan 13 19:18:43 2009 (r187188) +++ user/thompsa/usb/bin/kenv/kenv.1 Tue Jan 13 20:42:05 2009 (r187189) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 13, 2005 +.Dd January 13, 2009 .Dt KENV 1 .Os .Sh NAME @@ -67,8 +67,28 @@ If the .Fl q option is set, warnings normally printed as a result of being unable to perform the requested operation will be suppressed. +.Pp +Variables can be added to the kernel environment using the +.Xr /boot/loader.conf +file, or also statically compiled into the kernel using the statement +.Pp +.Dl Ic env Ar filename +.Pp +in the kernel config file. +The file can contain lines of the form +.Pp +.Dl name = "value" # this is a comment +.Pp +where whitespace around name and '=', and +everything after a '#' character, are ignored. Almost any printable +character except '=' is acceptable as part of a name. Quotes +are optional and necessary only if the value contains +whitespace. +.Pp .Sh SEE ALSO .Xr kenv 2 , +.Xr config 5 , +.Xr loader.conf 5 , .Xr loader 8 .Sh HISTORY The Modified: user/thompsa/usb/bin/ln/ln.1 ============================================================================== --- user/thompsa/usb/bin/ln/ln.1 Tue Jan 13 19:18:43 2009 (r187188) +++ user/thompsa/usb/bin/ln/ln.1 Tue Jan 13 20:42:05 2009 (r187189) @@ -38,7 +38,7 @@ .Sh NAME .Nm ln , .Nm link -.Nd make links +.Nd link files .Sh SYNOPSIS .Nm .Op Fl s Op Fl F @@ -57,8 +57,13 @@ .Sh DESCRIPTION The .Nm -utility creates a new directory entry (linked file) which has the -same modes as the original file. +utility creates a new directory entry (linked file) for the file name +specified by +.Ar target_file . +The +.Ar target_file +will be created with the same file modes as the +.Ar source_file . It is useful for maintaining multiple copies of a file in many places at once without using up storage for the .Dq copies ; @@ -148,7 +153,7 @@ links. A hard link to a file is indistinguishable from the original directory entry; any changes to a file are effectively independent of the name used to reference the file. -Hard links may not normally refer to directories and may not span file systems. +Directories may not be hardlinked, and hard links may not span file systems. .Pp A symbolic link contains the name of the file to which it is linked. Modified: user/thompsa/usb/lib/libarchive/archive_read_support_format_iso9660.c ============================================================================== --- user/thompsa/usb/lib/libarchive/archive_read_support_format_iso9660.c Tue Jan 13 19:18:43 2009 (r187188) +++ user/thompsa/usb/lib/libarchive/archive_read_support_format_iso9660.c Tue Jan 13 20:42:05 2009 (r187189) @@ -466,7 +466,10 @@ archive_read_format_iso9660_read_header( * seek backwards to extract it, so issue a warning. */ if (file->offset < iso9660->current_position) { archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, - "Ignoring out-of-order file"); + "Ignoring out-of-order file @%x (%s) %jd < %jd", + file, + iso9660->pathname.s, + file->offset, iso9660->current_position); iso9660->entry_bytes_remaining = 0; iso9660->entry_sparse_offset = 0; release_file(iso9660, file); @@ -607,7 +610,7 @@ parse_file_info(struct iso9660 *iso9660, file->parent = parent; if (parent != NULL) parent->refcount++; - file->offset = toi(isodirrec + DR_extent_offset, DR_extent_size) + file->offset = (uint64_t)toi(isodirrec + DR_extent_offset, DR_extent_size) * iso9660->logical_block_size; file->size = toi(isodirrec + DR_size_offset, DR_size_size); file->mtime = isodate7(isodirrec + DR_date_offset); Modified: user/thompsa/usb/lib/libc/string/ffs.3 ============================================================================== --- user/thompsa/usb/lib/libc/string/ffs.3 Tue Jan 13 19:18:43 2009 (r187188) +++ user/thompsa/usb/lib/libc/string/ffs.3 Tue Jan 13 20:42:05 2009 (r187189) @@ -108,4 +108,4 @@ The and .Fn flsll functions appeared in -.Fx 8.0 . +.Fx 7.1 . Modified: user/thompsa/usb/lib/libusb20/libusb20.c ============================================================================== --- user/thompsa/usb/lib/libusb20/libusb20.c Tue Jan 13 19:18:43 2009 (r187188) +++ user/thompsa/usb/lib/libusb20/libusb20.c Tue Jan 13 20:42:05 2009 (r187189) @@ -486,6 +486,8 @@ libusb20_dev_close(struct libusb20_devic pdev->is_opened = 0; + pdev->claimed_interfaces = 0; + return (error); } Modified: user/thompsa/usb/lib/msun/src/e_rem_pio2.c ============================================================================== --- user/thompsa/usb/lib/msun/src/e_rem_pio2.c Tue Jan 13 19:18:43 2009 (r187188) +++ user/thompsa/usb/lib/msun/src/e_rem_pio2.c Tue Jan 13 20:42:05 2009 (r187189) @@ -49,7 +49,7 @@ pio2_3 = 2.02226624871116645580e-21, / pio2_3t = 8.47842766036889956997e-32; /* 0x397B839A, 0x252049C1 */ #ifdef INLINE_REM_PIO2 -extern inline +extern __gnu89_inline #endif int __ieee754_rem_pio2(double x, double *y) Modified: user/thompsa/usb/lib/msun/src/e_rem_pio2f.c ============================================================================== --- user/thompsa/usb/lib/msun/src/e_rem_pio2f.c Tue Jan 13 19:18:43 2009 (r187188) +++ user/thompsa/usb/lib/msun/src/e_rem_pio2f.c Tue Jan 13 20:42:05 2009 (r187189) @@ -41,7 +41,7 @@ pio2_1 = 1.57079631090164184570e+00, / pio2_1t = 1.58932547735281966916e-08; /* 0x3E5110b4, 0x611A6263 */ #ifdef INLINE_REM_PIO2F -extern inline +extern __gnu89_inline #endif int __ieee754_rem_pio2f(float x, double *y) Modified: user/thompsa/usb/lib/msun/src/k_cosf.c ============================================================================== --- user/thompsa/usb/lib/msun/src/k_cosf.c Tue Jan 13 19:18:43 2009 (r187188) +++ user/thompsa/usb/lib/msun/src/k_cosf.c Tue Jan 13 20:42:05 2009 (r187189) @@ -31,7 +31,7 @@ C2 = -0x16c087e80f1e27.0p-62, /* -0.001 C3 = 0x199342e0ee5069.0p-68; /* 0.0000243904487962774090654 */ #ifdef INLINE_KERNEL_COSDF -extern inline +extern __gnu89_inline #endif float __kernel_cosdf(double x) Modified: user/thompsa/usb/lib/msun/src/k_sinf.c ============================================================================== --- user/thompsa/usb/lib/msun/src/k_sinf.c Tue Jan 13 19:18:43 2009 (r187188) +++ user/thompsa/usb/lib/msun/src/k_sinf.c Tue Jan 13 20:42:05 2009 (r187189) @@ -30,7 +30,7 @@ S3 = -0x1a00f9e2cae774.0p-65, /* -0.0001 S4 = 0x16cd878c3b46a7.0p-71; /* 0.0000027183114939898219064 */ #ifdef INLINE_KERNEL_SINDF -extern inline +extern __gnu89_inline #endif float __kernel_sindf(double x) Modified: user/thompsa/usb/lib/msun/src/k_tanf.c ============================================================================== --- user/thompsa/usb/lib/msun/src/k_tanf.c Tue Jan 13 19:18:43 2009 (r187188) +++ user/thompsa/usb/lib/msun/src/k_tanf.c Tue Jan 13 20:42:05 2009 (r187189) @@ -33,7 +33,7 @@ T[] = { }; #ifdef INLINE_KERNEL_TANDF -extern inline +extern __gnu89_inline #endif float __kernel_tandf(double x, int iy) Modified: user/thompsa/usb/sbin/mount/mount.c ============================================================================== --- user/thompsa/usb/sbin/mount/mount.c Tue Jan 13 19:18:43 2009 (r187188) +++ user/thompsa/usb/sbin/mount/mount.c Tue Jan 13 20:42:05 2009 (r187189) @@ -70,6 +70,7 @@ int debug, fstab_style, verbose; struct cpa { char **a; + ssize_t sz; int c; }; @@ -503,11 +504,9 @@ hasopt(const char *mntopts, const char * static void append_arg(struct cpa *sa, char *arg) { - static int a_sz; - - if (sa->c + 1 == a_sz) { - a_sz = a_sz == 0 ? 8 : a_sz * 2; - sa->a = realloc(sa->a, sizeof(sa->a) * a_sz); + if (sa->c + 1 == sa->sz) { + sa->sz = sa->sz == 0 ? 8 : sa->sz * 2; + sa->a = realloc(sa->a, sizeof(sa->a) * sa->sz); if (sa->a == NULL) errx(1, "realloc failed"); } @@ -518,11 +517,10 @@ int mountfs(const char *vfstype, const char *spec, const char *name, int flags, const char *options, const char *mntopts) { - struct cpa mnt_argv; struct statfs sf; int i, ret; char *optbuf, execname[PATH_MAX], mntpath[PATH_MAX]; - static int mnt_argv_inited; + static struct cpa mnt_argv; /* resolve the mountpoint with realpath(3) */ (void)checkpath(name, mntpath); @@ -557,10 +555,6 @@ mountfs(const char *vfstype, const char /* Construct the name of the appropriate mount command */ (void)snprintf(execname, sizeof(execname), "mount_%s", vfstype); - if (!mnt_argv_inited) { - mnt_argv_inited++; - mnt_argv.a = NULL; - } mnt_argv.c = -1; append_arg(&mnt_argv, execname); mangle(optbuf, &mnt_argv); Modified: user/thompsa/usb/share/examples/cvsup/refuse.README ============================================================================== --- user/thompsa/usb/share/examples/cvsup/refuse.README Tue Jan 13 19:18:43 2009 (r187188) +++ user/thompsa/usb/share/examples/cvsup/refuse.README Tue Jan 13 20:42:05 2009 (r187189) @@ -12,8 +12,8 @@ everything beneath that directory will b You can copy "refuse" to your sup directory and add or remove whatever you like. The example supfiles in this directory set -CVSup's base directory to "/usr". The sup directory is in the base -directory; i.e., it is "/usr/sup". If you have changed your base +CVSup's base directory to "/var/db". The sup directory is in the base +directory; i.e., it is "/var/db/sup". If you have changed your base directory, your sup directory is /path/to/base/sup. This file used to contain /usr/src/etc/sendmail/freebsd.mc in case @@ -62,4 +62,4 @@ depend on files in completely different For more information about refuse files see cvsup(1), which is installed by the "cvsup" and "cvsup-bin" ports. See also the CVSup -FAQ at <http://www.polstra.com/projects/freeware/CVSup/>. +FAQ at <http://www.cvsup.org/faq.html>. Modified: user/thompsa/usb/sys/amd64/conf/GENERIC ============================================================================== --- user/thompsa/usb/sys/amd64/conf/GENERIC Tue Jan 13 19:18:43 2009 (r187188) +++ user/thompsa/usb/sys/amd64/conf/GENERIC Tue Jan 13 20:42:05 2009 (r187189) @@ -1,8 +1,8 @@ # # GENERIC -- Generic kernel configuration file for FreeBSD/amd64 # -# For more information on this file, please read the handbook section on -# Kernel Configuration Files: +# For more information on this file, please read the config(5) manual page, +# and/or the handbook section on Kernel Configuration Files: # # http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html # @@ -24,6 +24,12 @@ ident GENERIC # To statically compile in device wiring instead of /boot/device.hints #hints "GENERIC.hints" # Default places to look for devices. +# Use the following to compile in values accessible to the kernel +# through getenv() (or kenv(1) in userland). The format of the file +# is 'variable=value', see kenv(1) +# +# env "GENERIC.env" + makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols options SCHED_ULE # ULE scheduler Modified: user/thompsa/usb/sys/amd64/conf/USB2 ============================================================================== --- user/thompsa/usb/sys/amd64/conf/USB2 Tue Jan 13 19:18:43 2009 (r187188) +++ user/thompsa/usb/sys/amd64/conf/USB2 Tue Jan 13 20:42:05 2009 (r187189) @@ -108,3 +108,7 @@ device usb2_input_ms # USB sound and MIDI device support #device usb2_sound + +# USB scanner support +device usb2_image +device usb2_scanner Modified: user/thompsa/usb/sys/boot/forth/support.4th ============================================================================== --- user/thompsa/usb/sys/boot/forth/support.4th Tue Jan 13 19:18:43 2009 (r187188) +++ user/thompsa/usb/sys/boot/forth/support.4th Tue Jan 13 20:42:05 2009 (r187189) @@ -820,7 +820,7 @@ only forth also support-functions defini \ Interface to loading conf files : load_conf ( addr len -- ) - ." ----- Trying conf " 2dup type cr + \ ." ----- Trying conf " 2dup type cr \ debugging 0 to end_of_file? reset_line_reading O_RDONLY fopen fd ! @@ -912,7 +912,7 @@ string current_file_name_ref \ used to p \ loader_conf_files processing support functions : get_conf_files ( -- addr len ) \ put addr/len on stack, reset var - ." -- starting on <" conf_files strtype ." >" cr + \ ." -- starting on <" conf_files strtype ." >" cr \ debugging conf_files strget 0 0 conf_files strset ; @@ -939,8 +939,7 @@ string current_file_name_ref \ used to p pos char+ to pos repeat addr len pos addr r@ + pos r> - - 2dup - ." get_file_name has " type cr + \ 2dup ." get_file_name has " type cr \ debugging ; : get_next_file ( addr len ptr -- addr len ptr' addr' len' | 0 ) Modified: user/thompsa/usb/sys/conf/files ============================================================================== --- user/thompsa/usb/sys/conf/files Tue Jan 13 19:18:43 2009 (r187188) +++ user/thompsa/usb/sys/conf/files Tue Jan 13 20:42:05 2009 (r187189) @@ -1609,6 +1609,7 @@ dev/usb2/wlan/usb2_wlan.c optional usb2_ # # USB2 serial and parallel port drivers # +dev/usb2/serial/u3g2.c optional usb2_core usb2_serial usb2_serial_3g dev/usb2/serial/uark2.c optional usb2_core usb2_serial usb2_serial_ark dev/usb2/serial/ubsa2.c optional usb2_core usb2_serial usb2_serial_bsa dev/usb2/serial/ubser2.c optional usb2_core usb2_serial usb2_serial_bser Modified: user/thompsa/usb/sys/conf/files.powerpc ============================================================================== --- user/thompsa/usb/sys/conf/files.powerpc Tue Jan 13 19:18:43 2009 (r187188) +++ user/thompsa/usb/sys/conf/files.powerpc Tue Jan 13 20:42:05 2009 (r187189) @@ -84,7 +84,6 @@ powerpc/booke/interrupt.c optional e500 powerpc/booke/locore.S optional e500 no-obj powerpc/booke/machdep.c optional e500 powerpc/booke/pmap.c optional e500 -powerpc/booke/support.S optional e500 powerpc/booke/swtch.S optional e500 powerpc/booke/trap.c optional e500 powerpc/booke/uio_machdep.c optional e500 Modified: user/thompsa/usb/sys/dev/ath/ath_hal/ar5212/ar5212_rfgain.c ============================================================================== --- user/thompsa/usb/sys/dev/ath/ath_hal/ar5212/ar5212_rfgain.c Tue Jan 13 19:18:43 2009 (r187188) +++ user/thompsa/usb/sys/dev/ath/ath_hal/ar5212/ar5212_rfgain.c Tue Jan 13 20:42:05 2009 (r187189) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5212_rfgain.c,v 1.2 2008/11/19 21:23:01 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" @@ -280,7 +280,8 @@ ar5212GetRfgain(struct ath_hal *ah) GAIN_VALUES *gv = &ahp->ah_gainValues; uint32_t rddata, probeType; - if (!gv->active) + /* NB: beware of touching the BB when PHY is powered down */ + if (!gv->active || !ahp->ah_phyPowerOn) return HAL_RFGAIN_INACTIVE; if (ahp->ah_rfgainState == HAL_RFGAIN_READ_REQUESTED) { Modified: user/thompsa/usb/sys/dev/bce/if_bce.c ============================================================================== --- user/thompsa/usb/sys/dev/bce/if_bce.c Tue Jan 13 19:18:43 2009 (r187188) +++ user/thompsa/usb/sys/dev/bce/if_bce.c Tue Jan 13 20:42:05 2009 (r187189) @@ -106,6 +106,8 @@ static struct bce_type bce_devs[] = { "HP NC370T Multifunction Gigabit Server Adapter" }, { BRCM_VENDORID, BRCM_DEVICEID_BCM5706, HP_VENDORID, 0x3106, "HP NC370i Multifunction Gigabit Server Adapter" }, + { BRCM_VENDORID, BRCM_DEVICEID_BCM5706, HP_VENDORID, 0x3070, + "HP NC380T PCI Express Dual Port Multifunction Gigabit Server Adapter" }, { BRCM_VENDORID, BRCM_DEVICEID_BCM5706, PCI_ANY_ID, PCI_ANY_ID, "Broadcom NetXtreme II BCM5706 1000Base-T" }, @@ -116,18 +118,38 @@ static struct bce_type bce_devs[] = { "Broadcom NetXtreme II BCM5706 1000Base-SX" }, /* BCM5708C controllers and OEM boards. */ + { BRCM_VENDORID, BRCM_DEVICEID_BCM5708, HP_VENDORID, 0x7037, + "HP NC373T PCI Express Multifunction Gigabit Server Adapter" }, + { BRCM_VENDORID, BRCM_DEVICEID_BCM5708, HP_VENDORID, 0x7038, + "HP NC373i Integrated Multifunction Gigabit Server Adapter" }, { BRCM_VENDORID, BRCM_DEVICEID_BCM5708, PCI_ANY_ID, PCI_ANY_ID, "Broadcom NetXtreme II BCM5708 1000Base-T" }, /* BCM5708S controllers and OEM boards. */ + { BRCM_VENDORID, BRCM_DEVICEID_BCM5708S, HP_VENDORID, 0x1706, + "HP NC373m Multifunction Gigabit Server Adapter" }, + { BRCM_VENDORID, BRCM_DEVICEID_BCM5708S, HP_VENDORID, 0x7038, + "HP NC373i PCI Express Multifunction Gigabit Server Adapter" }, + { BRCM_VENDORID, BRCM_DEVICEID_BCM5708S, HP_VENDORID, 0x703b, + "HP NC373i Integrated Multifunction Gigabit Server Adapter" }, + { BRCM_VENDORID, BRCM_DEVICEID_BCM5708S, HP_VENDORID, 0x703d, + "HP NC373F PCI Express Multifunction Gigabit Server Adapter" }, { BRCM_VENDORID, BRCM_DEVICEID_BCM5708S, PCI_ANY_ID, PCI_ANY_ID, "Broadcom NetXtreme II BCM5708 1000Base-SX" }, /* BCM5709C controllers and OEM boards. */ + { BRCM_VENDORID, BRCM_DEVICEID_BCM5709, HP_VENDORID, 0x7055, + "HP NC382i Integrated Quad Port PCI Express Gigabit Server Adapter" }, + { BRCM_VENDORID, BRCM_DEVICEID_BCM5709, HP_VENDORID, 0x7059, + "HP NC382T PCI Express Dual Port Multifunction Gigabit Server Adapter" }, { BRCM_VENDORID, BRCM_DEVICEID_BCM5709, PCI_ANY_ID, PCI_ANY_ID, "Broadcom NetXtreme II BCM5709 1000Base-T" }, /* BCM5709S controllers and OEM boards. */ + { BRCM_VENDORID, BRCM_DEVICEID_BCM5709S, HP_VENDORID, 0x171d, + "HP NC382m Dual Port 1GbE Multifunction BL-c Adapter" }, + { BRCM_VENDORID, BRCM_DEVICEID_BCM5709S, HP_VENDORID, 0x7056, + "HP NC382i Integrated Quad Port PCI Express Gigabit Server Adapter" }, { BRCM_VENDORID, BRCM_DEVICEID_BCM5709S, PCI_ANY_ID, PCI_ANY_ID, "Broadcom NetXtreme II BCM5709 1000Base-SX" }, Modified: user/thompsa/usb/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- user/thompsa/usb/sys/dev/sound/pci/hda/hdac.c Tue Jan 13 19:18:43 2009 (r187188) +++ user/thompsa/usb/sys/dev/sound/pci/hda/hdac.c Tue Jan 13 20:42:05 2009 (r187189) @@ -83,7 +83,7 @@ #include "mixer_if.h" -#define HDA_DRV_TEST_REV "20090110_0123" +#define HDA_DRV_TEST_REV "20090113_0124" SND_DECLARE_FILE("$FreeBSD$"); @@ -6111,6 +6111,29 @@ hdac_audio_prepare_pin_ctrl(struct hdac_ } static void +hdac_audio_ctl_commit(struct hdac_devinfo *devinfo) +{ + struct hdac_audio_ctl *ctl; + int i, z; + + i = 0; + while ((ctl = hdac_audio_ctl_each(devinfo, &i)) != NULL) { + if (ctl->enable == 0 || ctl->ossmask != 0) { + /* Mute disabled and mixer controllable controls. + * Last will be initialized by mixer_init(). + * This expected to reduce click on startup. */ + hdac_audio_ctl_amp_set(ctl, HDA_AMP_MUTE_ALL, 0, 0); + continue; + } + /* Init fixed controls to 0dB amplification. */ + z = ctl->offset; + if (z > ctl->step) + z = ctl->step; + hdac_audio_ctl_amp_set(ctl, HDA_AMP_MUTE_NONE, z, z); + } +} + +static void hdac_audio_commit(struct hdac_devinfo *devinfo) { struct hdac_softc *sc = devinfo->codec->sc; @@ -6126,11 +6149,41 @@ hdac_audio_commit(struct hdac_devinfo *d hdac_command(sc, HDA_CMD_12BIT(cad, devinfo->nid, 0x7e7, 0), cad); + /* Commit controls. */ + hdac_audio_ctl_commit(devinfo); + + /* Commit selectors, pins and EAPD. */ + for (i = 0; i < devinfo->nodecnt; i++) { + w = &devinfo->widget[i]; + if (w == NULL) + continue; + if (w->selconn == -1) + w->selconn = 0; + if (w->nconns > 0) + hdac_widget_connection_select(w, w->selconn); + if (w->type == HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) { + hdac_command(sc, + HDA_CMD_SET_PIN_WIDGET_CTRL(cad, w->nid, + w->wclass.pin.ctrl), cad); + } + if (w->param.eapdbtl != HDAC_INVALID) { + uint32_t val; + + val = w->param.eapdbtl; + if (devinfo->function.audio.quirks & + HDA_QUIRK_EAPDINV) + val ^= HDA_CMD_SET_EAPD_BTL_ENABLE_EAPD; + hdac_command(sc, + HDA_CMD_SET_EAPD_BTL_ENABLE(cad, w->nid, + val), cad); + } + } + + /* Commit GPIOs. */ gdata = 0; gmask = 0; gdir = 0; commitgpio = 0; - numgpio = HDA_PARAM_GPIO_COUNT_NUM_GPIO( devinfo->function.audio.gpio); @@ -6185,54 +6238,6 @@ hdac_audio_commit(struct hdac_devinfo *d HDA_CMD_SET_GPIO_DATA(cad, devinfo->nid, gdata), cad); } - - for (i = 0; i < devinfo->nodecnt; i++) { - w = &devinfo->widget[i]; - if (w == NULL) - continue; - if (w->selconn == -1) - w->selconn = 0; - if (w->nconns > 0) - hdac_widget_connection_select(w, w->selconn); - if (w->type == HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) { - hdac_command(sc, - HDA_CMD_SET_PIN_WIDGET_CTRL(cad, w->nid, - w->wclass.pin.ctrl), cad); - } - if (w->param.eapdbtl != HDAC_INVALID) { - uint32_t val; - - val = w->param.eapdbtl; - if (devinfo->function.audio.quirks & - HDA_QUIRK_EAPDINV) - val ^= HDA_CMD_SET_EAPD_BTL_ENABLE_EAPD; - hdac_command(sc, - HDA_CMD_SET_EAPD_BTL_ENABLE(cad, w->nid, - val), cad); - - } - } -} - -static void -hdac_audio_ctl_commit(struct hdac_devinfo *devinfo) -{ - struct hdac_audio_ctl *ctl; - int i, z; - - i = 0; - while ((ctl = hdac_audio_ctl_each(devinfo, &i)) != NULL) { - if (ctl->enable == 0) { - /* Mute disabled controls. */ - hdac_audio_ctl_amp_set(ctl, HDA_AMP_MUTE_ALL, 0, 0); - continue; - } - /* Init controls to 0dB amplification. */ - z = ctl->offset; - if (z > ctl->step) - z = ctl->step; - hdac_audio_ctl_amp_set(ctl, HDA_AMP_MUTE_NONE, z, z); - } } static void @@ -7477,10 +7482,6 @@ hdac_attach2(void *arg) ); hdac_audio_commit(devinfo); HDA_BOOTHVERBOSE( - device_printf(sc->dev, "Ctls commit...\n"); - ); - hdac_audio_ctl_commit(devinfo); - HDA_BOOTHVERBOSE( device_printf(sc->dev, "HP switch init...\n"); ); hdac_hp_switch_init(devinfo); @@ -7730,10 +7731,6 @@ hdac_resume(device_t dev) ); hdac_audio_commit(devinfo); HDA_BOOTHVERBOSE( - device_printf(dev, "Ctls commit...\n"); - ); - hdac_audio_ctl_commit(devinfo); - HDA_BOOTHVERBOSE( device_printf(dev, "HP switch init...\n"); ); hdac_hp_switch_init(devinfo); Modified: user/thompsa/usb/sys/dev/usb/usbdevs ============================================================================== --- user/thompsa/usb/sys/dev/usb/usbdevs Tue Jan 13 19:18:43 2009 (r187188) +++ user/thompsa/usb/sys/dev/usb/usbdevs Tue Jan 13 20:42:05 2009 (r187189) @@ -151,6 +151,7 @@ vendor PLANTRONICS 0x047f Plantronics vendor KYOCERA 0x0482 Kyocera Wireless Corp. vendor STMICRO 0x0483 STMicroelectronics vendor FOXCONN 0x0489 Foxconn +vendor MEIZU 0x0492 Meizu Electronics vendor YAMAHA 0x0499 YAMAHA vendor COMPAQ 0x049f Compaq vendor HITACHI 0x04a4 Hitachi @@ -1657,6 +1658,9 @@ product MCT DU_H3SP_USB232 0x0200 D-Link product MCT USB232 0x0210 USB-232 Interface product MCT SITECOM_USB232 0x0230 Sitecom USB-232 Products +/* Meizu Electronics */ +product MEIZU M6_SL 0x0140 MiniPlayer M6 (SL) + /* Melco, Inc products */ product MELCO LUATX1 0x0001 LUA-TX Ethernet product MELCO LUATX5 0x0005 LUA-TX Ethernet Modified: user/thompsa/usb/sys/dev/usb2/controller/at91dci.c ============================================================================== --- user/thompsa/usb/sys/dev/usb2/controller/at91dci.c Tue Jan 13 19:18:43 2009 (r187188) +++ user/thompsa/usb/sys/dev/usb2/controller/at91dci.c Tue Jan 13 20:42:05 2009 (r187189) @@ -50,14 +50,11 @@ __FBSDID("$FreeBSD$"); #include <dev/usb2/include/usb2_defs.h> #define USB_DEBUG_VAR at91dcidebug -#define usb2_config_td_cc at91dci_config_copy -#define usb2_config_td_softc at91dci_softc #include <dev/usb2/core/usb2_core.h> #include <dev/usb2/core/usb2_debug.h> #include <dev/usb2/core/usb2_busdma.h> #include <dev/usb2/core/usb2_process.h> -#include <dev/usb2/core/usb2_config_td.h> #include <dev/usb2/core/usb2_sw_transfer.h> #include <dev/usb2/core/usb2_transfer.h> #include <dev/usb2/core/usb2_device.h> @@ -106,7 +103,6 @@ static void at91dci_standard_done(struct static usb2_sw_transfer_func_t at91dci_root_intr_done; static usb2_sw_transfer_func_t at91dci_root_ctrl_done; -static usb2_config_td_command_t at91dci_root_ctrl_task; /* * NOTE: Some of the bits in the CSR register have inverse meaning so @@ -263,13 +259,13 @@ at91dci_pull_down(struct at91dci_softc * static void at91dci_wakeup_peer(struct usb2_xfer *xfer) { - struct at91dci_softc *sc = xfer->usb2_sc; + struct at91dci_softc *sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); uint8_t use_polling; if (!(sc->sc_flags.status_suspend)) { return; } - use_polling = mtx_owned(xfer->xfer_mtx) ? 1 : 0; + use_polling = mtx_owned(xfer->xroot->xfer_mtx) ? 1 : 0; AT91_UDP_WRITE_4(sc, AT91_UDP_GSTATE, AT91_UDP_GSTATE_ESR); @@ -702,7 +698,7 @@ at91dci_xfer_do_fifo(struct usb2_xfer *x return (1); /* not complete */ done: - sc = xfer->usb2_sc; + sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); temp = (xfer->endpoint & UE_ADDR); /* update FIFO bank flag and multi buffer */ @@ -733,11 +729,9 @@ repeat: } } -static void -at91dci_vbus_interrupt(struct usb2_bus *bus, uint8_t is_on) +void +at91dci_vbus_interrupt(struct at91dci_softc *sc, uint8_t is_on) { - struct at91dci_softc *sc = AT9100_DCI_BUS2SC(bus); - DPRINTFN(5, "vbus = %u\n", is_on); USB_BUS_LOCK(&sc->sc_bus); @@ -764,7 +758,6 @@ at91dci_vbus_interrupt(struct usb2_bus * &at91dci_root_intr_done); } } - USB_BUS_UNLOCK(&sc->sc_bus); } @@ -890,7 +883,7 @@ at91dci_setup_standard_chain(struct usb2 DPRINTFN(9, "addr=%d endpt=%d sumlen=%d speed=%d\n", xfer->address, UE_GET_ADDR(xfer->endpoint), - xfer->sumlen, usb2_get_speed(xfer->udev)); + xfer->sumlen, usb2_get_speed(xfer->xroot->udev)); temp.max_frame_size = xfer->max_frame_size; @@ -905,7 +898,7 @@ at91dci_setup_standard_chain(struct usb2 temp.setup_alt_next = xfer->flags_int.short_frames_ok; temp.offset = 0; - sc = xfer->usb2_sc; + sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); ep_no = (xfer->endpoint & UE_ADDR); /* check if we should prepend a setup message */ @@ -1032,7 +1025,7 @@ at91dci_timeout(void *arg) DPRINTF("xfer=%p\n", xfer); - USB_BUS_LOCK_ASSERT(xfer->udev->bus, MA_OWNED); + USB_BUS_LOCK_ASSERT(xfer->xroot->bus, MA_OWNED); /* transfer is transferred */ at91dci_device_done(xfer, USB_ERR_TIMEOUT); @@ -1046,7 +1039,7 @@ at91dci_start_standard_chain(struct usb2 /* poll one time */ if (at91dci_xfer_do_fifo(xfer)) { - struct at91dci_softc *sc = xfer->usb2_sc; + struct at91dci_softc *sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); uint8_t ep_no = xfer->endpoint & UE_ADDR; /* @@ -1059,7 +1052,7 @@ at91dci_start_standard_chain(struct usb2 DPRINTFN(15, "enable interrupts on endpoint %d\n", ep_no); /* put transfer on interrupt queue */ - usb2_transfer_enqueue(&xfer->udev->bus->intr_q, xfer); + usb2_transfer_enqueue(&xfer->xroot->bus->intr_q, xfer); /* start timeout, if any */ if (xfer->timeout != 0) { @@ -1073,7 +1066,7 @@ static void at91dci_root_intr_done(struct usb2_xfer *xfer, struct usb2_sw_transfer *std) { - struct at91dci_softc *sc = xfer->usb2_sc; + struct at91dci_softc *sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); DPRINTFN(9, "\n"); @@ -1213,7 +1206,7 @@ done: static void at91dci_device_done(struct usb2_xfer *xfer, usb2_error_t error) { - struct at91dci_softc *sc = xfer->usb2_sc; + struct at91dci_softc *sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); uint8_t ep_no; USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); @@ -1627,7 +1620,7 @@ at91dci_device_isoc_fs_close(struct usb2 static void at91dci_device_isoc_fs_enter(struct usb2_xfer *xfer) { - struct at91dci_softc *sc = xfer->usb2_sc; + struct at91dci_softc *sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); uint32_t temp; uint32_t nframes; @@ -1709,7 +1702,7 @@ at91dci_root_ctrl_open(struct usb2_xfer static void at91dci_root_ctrl_close(struct usb2_xfer *xfer) { - struct at91dci_softc *sc = xfer->usb2_sc; + struct at91dci_softc *sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); if (sc->sc_root_ctrl.xfer == xfer) { sc->sc_root_ctrl.xfer = NULL; @@ -1783,7 +1776,7 @@ static const struct usb2_hub_descriptor_ .wHubCharacteristics[0] = (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL) & 0xFF, .wHubCharacteristics[1] = - (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL) >> 16, + (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL) >> 8, .bPwrOn2PwrGood = 50, .bHubContrCurrent = 0, .DeviceRemovable = {0}, /* port is removable */ @@ -1813,26 +1806,24 @@ at91dci_root_ctrl_enter(struct usb2_xfer static void at91dci_root_ctrl_start(struct usb2_xfer *xfer) { - struct at91dci_softc *sc = xfer->usb2_sc; + struct at91dci_softc *sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); sc->sc_root_ctrl.xfer = xfer; - usb2_config_td_queue_command( - &sc->sc_config_td, NULL, &at91dci_root_ctrl_task, 0, 0); + usb2_bus_roothub_exec(xfer->xroot->bus); } static void -at91dci_root_ctrl_task(struct at91dci_softc *sc, - struct at91dci_config_copy *cc, uint16_t refcount) +at91dci_root_ctrl_task(struct usb2_bus *bus) { - at91dci_root_ctrl_poll(sc); + at91dci_root_ctrl_poll(AT9100_DCI_BUS2SC(bus)); } static void at91dci_root_ctrl_done(struct usb2_xfer *xfer, struct usb2_sw_transfer *std) { - struct at91dci_softc *sc = xfer->usb2_sc; + struct at91dci_softc *sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); uint16_t value; uint16_t index; uint8_t use_polling; @@ -1853,7 +1844,7 @@ at91dci_root_ctrl_done(struct usb2_xfer value = UGETW(std->req.wValue); index = UGETW(std->req.wIndex); - use_polling = mtx_owned(xfer->xfer_mtx) ? 1 : 0; + use_polling = mtx_owned(xfer->xroot->xfer_mtx) ? 1 : 0; /* demultiplex the control request */ @@ -2258,7 +2249,7 @@ at91dci_root_intr_open(struct usb2_xfer static void at91dci_root_intr_close(struct usb2_xfer *xfer) { - struct at91dci_softc *sc = xfer->usb2_sc; + struct at91dci_softc *sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); if (sc->sc_root_intr.xfer == xfer) { sc->sc_root_intr.xfer = NULL; @@ -2275,7 +2266,7 @@ at91dci_root_intr_enter(struct usb2_xfer static void at91dci_root_intr_start(struct usb2_xfer *xfer) { - struct at91dci_softc *sc = xfer->usb2_sc; + struct at91dci_softc *sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); sc->sc_root_intr.xfer = xfer; } @@ -2305,11 +2296,6 @@ at91dci_xfer_setup(struct usb2_setup_par xfer = parm->curr_xfer; /* - * setup xfer - */ - xfer->usb2_sc = sc; - - /* * NOTE: This driver does not use any of the parameters that * are computed from the following values. Just set some * reasonable dummies: @@ -2477,5 +2463,5 @@ struct usb2_bus_methods at91dci_bus_meth .get_hw_ep_profile = &at91dci_get_hw_ep_profile, .set_stall = &at91dci_set_stall, .clear_stall = &at91dci_clear_stall, - .vbus_interrupt = &at91dci_vbus_interrupt, + .roothub_exec = &at91dci_root_ctrl_task, }; Modified: user/thompsa/usb/sys/dev/usb2/controller/at91dci.h ============================================================================== --- user/thompsa/usb/sys/dev/usb2/controller/at91dci.h Tue Jan 13 19:18:43 2009 (r187188) +++ user/thompsa/usb/sys/dev/usb2/controller/at91dci.h Tue Jan 13 20:42:05 2009 (r187189) @@ -34,6 +34,8 @@ #ifndef _AT9100_DCI_H_ #define _AT9100_DCI_H_ +#define AT91_MAX_DEVICES (USB_MIN_DEVICES + 1) + #define AT91_UDP_FRM 0x00 /* Frame number register */ #define AT91_UDP_FRM_MASK (0x7FF << 0) /* Frame Number as Defined in * the Packet Field Formats */ @@ -204,8 +206,8 @@ struct at91dci_softc { LIST_HEAD(, usb2_xfer) sc_interrupt_list_head; struct usb2_sw_transfer sc_root_ctrl; struct usb2_sw_transfer sc_root_intr; - struct usb2_config_td sc_config_td; + struct usb2_device *sc_devices[AT91_MAX_DEVICES]; struct resource *sc_io_res; struct resource *sc_irq_res; void *sc_intr_hdl; @@ -238,5 +240,6 @@ void at91dci_uninit(struct at91dci_softc void at91dci_suspend(struct at91dci_softc *sc); void at91dci_resume(struct at91dci_softc *sc); void at91dci_interrupt(struct at91dci_softc *sc); +void at91dci_vbus_interrupt(struct at91dci_softc *sc, uint8_t is_on); #endif /* _AT9100_DCI_H_ */ Modified: user/thompsa/usb/sys/dev/usb2/controller/at91dci_atmelarm.c ============================================================================== --- user/thompsa/usb/sys/dev/usb2/controller/at91dci_atmelarm.c Tue Jan 13 19:18:43 2009 (r187188) +++ user/thompsa/usb/sys/dev/usb2/controller/at91dci_atmelarm.c Tue Jan 13 20:42:05 2009 (r187189) @@ -34,7 +34,6 @@ __FBSDID("$FreeBSD$"); #include <dev/usb2/core/usb2_core.h> #include <dev/usb2/core/usb2_busdma.h> #include <dev/usb2/core/usb2_process.h> -#include <dev/usb2/core/usb2_config_td.h> #include <dev/usb2/core/usb2_sw_transfer.h> #include <dev/usb2/core/usb2_util.h> @@ -73,7 +72,7 @@ struct at91_udp_softc { }; static void -at91_vbus_interrupt(struct at91_udp_softc *sc) +at91_vbus_poll(struct at91_udp_softc *sc) { uint32_t temp; uint8_t vbus_val; @@ -85,8 +84,7 @@ at91_vbus_interrupt(struct at91_udp_soft /* just forward it */ vbus_val = at91_pio_gpio_get(VBUS_BASE, VBUS_MASK); - (sc->sc_dci.sc_bus.methods->vbus_interrupt) - (&sc->sc_dci.sc_bus, vbus_val); + at91dci_vbus_interrupt(&sc->sc_dci, vbus_val); } static void @@ -145,9 +143,12 @@ at91_udp_attach(device_t dev) sc->sc_dci.sc_pull_down = &at91_udp_pull_down; sc->sc_dci.sc_pull_arg = sc; - /* get all DMA memory */ - + /* initialise some bus fields */ sc->sc_dci.sc_bus.parent = dev; + sc->sc_dci.sc_bus.devices = sc->sc_dci.sc_devices; + sc->sc_dci.sc_bus.devices_max = AT91_MAX_DEVICES; + + /* get all DMA memory */ if (usb2_bus_mem_alloc_all(&sc->sc_dci.sc_bus, USB_GET_DMA_TAG(dev), NULL)) { return (ENOMEM); @@ -205,12 +206,6 @@ at91_udp_attach(device_t dev) } device_set_ivars(sc->sc_dci.sc_bus.bdev, &sc->sc_dci.sc_bus); - err = usb2_config_td_setup(&sc->sc_dci.sc_config_td, sc, - &sc->sc_dci.sc_bus.bus_mtx, NULL, 0, 4); - if (err) { - device_printf(dev, "could not setup config thread!\n"); - goto error; - } #if (__FreeBSD_version >= 700031) err = bus_setup_intr(dev, sc->sc_dci.sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, NULL, (void *)at91dci_interrupt, sc, &sc->sc_dci.sc_intr_hdl); @@ -224,10 +219,10 @@ at91_udp_attach(device_t dev) } #if (__FreeBSD_version >= 700031) err = bus_setup_intr(dev, sc->sc_vbus_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, - NULL, (void *)at91_vbus_interrupt, sc, &sc->sc_vbus_intr_hdl); + NULL, (void *)at91_vbus_poll, sc, &sc->sc_vbus_intr_hdl); #else err = bus_setup_intr(dev, sc->sc_vbus_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, - (void *)at91_vbus_interrupt, sc, &sc->sc_vbus_intr_hdl); + (void *)at91_vbus_poll, sc, &sc->sc_vbus_intr_hdl); #endif if (err) { sc->sc_vbus_intr_hdl = NULL; @@ -241,7 +236,7 @@ at91_udp_attach(device_t dev) goto error; } else { /* poll VBUS one time */ - at91_vbus_interrupt(sc); + at91_vbus_poll(sc); } return (0); @@ -305,8 +300,6 @@ at91_udp_detach(device_t dev) sc->sc_dci.sc_io_res); sc->sc_dci.sc_io_res = NULL; } - usb2_config_td_unsetup(&sc->sc_dci.sc_config_td); - usb2_bus_mem_free_all(&sc->sc_dci.sc_bus, NULL); /* disable clocks */ Copied: user/thompsa/usb/sys/dev/usb2/controller/atmegadci.c (from r187188, head/sys/dev/usb2/controller/atmegadci.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/thompsa/usb/sys/dev/usb2/controller/atmegadci.c Tue Jan 13 20:42:05 2009 (r187189, copy of r187188, head/sys/dev/usb2/controller/atmegadci.c) @@ -0,0 +1,2327 @@ +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); + +/*- + * Copyright (c) 2009 Hans Petter Selasky. 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 the driver for the ATMEGA series USB Device + * Controller + */ + +/* + * NOTE: When the chip detects BUS-reset it will also reset the + * endpoints, Function-address and more. + */ + +#include <dev/usb2/include/usb2_standard.h> +#include <dev/usb2/include/usb2_mfunc.h> +#include <dev/usb2/include/usb2_error.h> +#include <dev/usb2/include/usb2_defs.h> + +#define USB_DEBUG_VAR atmegadci_debug + +#include <dev/usb2/core/usb2_core.h> +#include <dev/usb2/core/usb2_debug.h> +#include <dev/usb2/core/usb2_busdma.h> +#include <dev/usb2/core/usb2_process.h> +#include <dev/usb2/core/usb2_sw_transfer.h> +#include <dev/usb2/core/usb2_transfer.h> +#include <dev/usb2/core/usb2_device.h> +#include <dev/usb2/core/usb2_hub.h> +#include <dev/usb2/core/usb2_util.h> + +#include <dev/usb2/controller/usb2_controller.h> +#include <dev/usb2/controller/usb2_bus.h> +#include <dev/usb2/controller/atmegadci.h> + +#define ATMEGA_BUS2SC(bus) \ + ((struct atmegadci_softc *)(((uint8_t *)(bus)) - \ + USB_P2U(&(((struct atmegadci_softc *)0)->sc_bus)))) *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200901132042.n0DKg6KY015323>