From owner-svn-src-head@FreeBSD.ORG Sun Feb 22 01:02:26 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 05919106564A; Sun, 22 Feb 2009 01:02:26 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CDA3F8FC14; Sun, 22 Feb 2009 01:02:25 +0000 (UTC) (envelope-from thompsa@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 n1M12P4E080062; Sun, 22 Feb 2009 01:02:25 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1M12PG6080060; Sun, 22 Feb 2009 01:02:25 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902220102.n1M12PG6080060@svn.freebsd.org> From: Andrew Thompson Date: Sun, 22 Feb 2009 01:02:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188907 - head/sys/dev/usb2/controller X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Feb 2009 01:02:26 -0000 Author: thompsa Date: Sun Feb 22 01:02:25 2009 New Revision: 188907 URL: http://svn.freebsd.org/changeset/base/188907 Log: Use root_mount_hold and root_mount_rel to allow the USB bus to be explored before trying to mount root. Unlike USB1 the busses are not explored at attach but rather after threads are running. Modified: head/sys/dev/usb2/controller/usb2_bus.h head/sys/dev/usb2/controller/usb2_controller.c Modified: head/sys/dev/usb2/controller/usb2_bus.h ============================================================================== --- head/sys/dev/usb2/controller/usb2_bus.h Sat Feb 21 23:46:34 2009 (r188906) +++ head/sys/dev/usb2/controller/usb2_bus.h Sun Feb 22 01:02:25 2009 (r188907) @@ -53,6 +53,7 @@ struct usb2_bus { struct usb2_bus_stat stats_ok; struct usb2_process explore_proc; struct usb2_process roothub_proc; + struct root_hold_token *bus_roothold; /* * There are two callback processes. One for Giant locked * callbacks. One for non-Giant locked callbacks. This should Modified: head/sys/dev/usb2/controller/usb2_controller.c ============================================================================== --- head/sys/dev/usb2/controller/usb2_controller.c Sat Feb 21 23:46:34 2009 (r188906) +++ head/sys/dev/usb2/controller/usb2_controller.c Sun Feb 22 01:02:25 2009 (r188907) @@ -126,6 +126,10 @@ usb2_attach(device_t dev) DPRINTFN(0, "USB device has no ivars\n"); return (ENXIO); } + + /* delay vfs_mountroot until the bus is explored */ + bus->bus_roothold = root_mount_hold(device_get_nameunit(dev)); + if (usb2_post_init_called) { mtx_lock(&Giant); usb2_attach_sub(dev, bus); @@ -153,6 +157,10 @@ usb2_detach(device_t dev) usb2_callout_drain(&bus->power_wdog); /* Let the USB explore process detach all devices. */ + if (bus->bus_roothold != NULL) { + root_mount_rel(bus->bus_roothold); + bus->bus_roothold = NULL; + } USB_BUS_LOCK(bus); if (usb2_proc_msignal(&bus->explore_proc, @@ -225,6 +233,10 @@ usb2_bus_explore(struct usb2_proc_msg *p USB_BUS_LOCK(bus); } + if (bus->bus_roothold != NULL) { + root_mount_rel(bus->bus_roothold); + bus->bus_roothold = NULL; + } } /*------------------------------------------------------------------------* From owner-svn-src-head@FreeBSD.ORG Sun Feb 22 02:50:31 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5DC31106566C; Sun, 22 Feb 2009 02:50:31 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4BDC88FC16; Sun, 22 Feb 2009 02:50:31 +0000 (UTC) (envelope-from alc@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 n1M2oV5X082023; Sun, 22 Feb 2009 02:50:31 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1M2oV2E082022; Sun, 22 Feb 2009 02:50:31 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200902220250.n1M2oV2E082022@svn.freebsd.org> From: Alan Cox Date: Sun, 22 Feb 2009 02:50:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188908 - head/sys/dev/md X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Feb 2009 02:50:31 -0000 Author: alc Date: Sun Feb 22 02:50:31 2009 New Revision: 188908 URL: http://svn.freebsd.org/changeset/base/188908 Log: Remove unnecessary page queues locking around vm_page_wakeup(). (This change is applicable to RELENG_7 but not RELENG_6.) MFC after: 1 week Modified: head/sys/dev/md/md.c Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Sun Feb 22 01:02:25 2009 (r188907) +++ head/sys/dev/md/md.c Sun Feb 22 02:50:31 2009 (r188908) @@ -629,9 +629,7 @@ mdstart_swap(struct md_s *sc, struct bio if (rv == VM_PAGER_ERROR) { sf_buf_free(sf); sched_unpin(); - vm_page_lock_queues(); vm_page_wakeup(m); - vm_page_unlock_queues(); break; } bcopy((void *)(sf_buf_kva(sf) + offs), p, len); @@ -641,9 +639,7 @@ mdstart_swap(struct md_s *sc, struct bio if (rv == VM_PAGER_ERROR) { sf_buf_free(sf); sched_unpin(); - vm_page_lock_queues(); vm_page_wakeup(m); - vm_page_unlock_queues(); break; } bcopy(p, (void *)(sf_buf_kva(sf) + offs), len); @@ -655,9 +651,7 @@ mdstart_swap(struct md_s *sc, struct bio if (rv == VM_PAGER_ERROR) { sf_buf_free(sf); sched_unpin(); - vm_page_lock_queues(); vm_page_wakeup(m); - vm_page_unlock_queues(); break; } bzero((void *)(sf_buf_kva(sf) + offs), len); @@ -667,8 +661,8 @@ mdstart_swap(struct md_s *sc, struct bio } sf_buf_free(sf); sched_unpin(); - vm_page_lock_queues(); vm_page_wakeup(m); + vm_page_lock_queues(); vm_page_activate(m); if (bp->bio_cmd == BIO_WRITE) vm_page_dirty(m); From owner-svn-src-head@FreeBSD.ORG Sun Feb 22 10:26:03 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15490106566C; Sun, 22 Feb 2009 10:26:03 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0426C8FC14; Sun, 22 Feb 2009 10:26:03 +0000 (UTC) (envelope-from mav@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 n1MAQ2N8093923; Sun, 22 Feb 2009 10:26:02 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1MAQ2bP093922; Sun, 22 Feb 2009 10:26:02 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200902221026.n1MAQ2bP093922@svn.freebsd.org> From: Alexander Motin Date: Sun, 22 Feb 2009 10:26:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188912 - head/sys/dev/ata X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Feb 2009 10:26:03 -0000 Author: mav Date: Sun Feb 22 10:26:02 2009 New Revision: 188912 URL: http://svn.freebsd.org/changeset/base/188912 Log: Remove one more place of master/slave terms usage. Modified: head/sys/dev/ata/ata-all.c Modified: head/sys/dev/ata/ata-all.c ============================================================================== --- head/sys/dev/ata/ata-all.c Sun Feb 22 10:25:07 2009 (r188911) +++ head/sys/dev/ata/ata-all.c Sun Feb 22 10:26:02 2009 (r188912) @@ -932,8 +932,7 @@ ata_atapi(device_t dev) struct ata_channel *ch = device_get_softc(device_get_parent(dev)); struct ata_device *atadev = device_get_softc(dev); - return ((atadev->unit == ATA_MASTER && ch->devices & ATA_ATAPI_MASTER) || - (atadev->unit == ATA_SLAVE && ch->devices & ATA_ATAPI_SLAVE)); + return (ch->devices & (ATA_ATAPI_MASTER << atadev->unit)); } int From owner-svn-src-head@FreeBSD.ORG Sun Feb 22 12:40:58 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DADEA106564A; Sun, 22 Feb 2009 12:40:58 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AF4B98FC15; Sun, 22 Feb 2009 12:40:58 +0000 (UTC) (envelope-from rpaulo@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 n1MCewfF096440; Sun, 22 Feb 2009 12:40:58 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1MCewlY096439; Sun, 22 Feb 2009 12:40:58 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200902221240.n1MCewlY096439@svn.freebsd.org> From: Rui Paulo Date: Sun, 22 Feb 2009 12:40:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188914 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Feb 2009 12:40:59 -0000 Author: rpaulo Date: Sun Feb 22 12:40:58 2009 New Revision: 188914 URL: http://svn.freebsd.org/changeset/base/188914 Log: Fix typo. Modified: head/share/man/man4/iwi.4 Modified: head/share/man/man4/iwi.4 ============================================================================== --- head/share/man/man4/iwi.4 Sun Feb 22 10:28:09 2009 (r188913) +++ head/share/man/man4/iwi.4 Sun Feb 22 12:40:58 2009 (r188914) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Apri 13, 2008 +.Dd April 13, 2008 .Os .Dt IWI 4 .Sh NAME From owner-svn-src-head@FreeBSD.ORG Sun Feb 22 13:37:23 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57281106566C; Sun, 22 Feb 2009 13:37:23 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 45A318FC1B; Sun, 22 Feb 2009 13:37:23 +0000 (UTC) (envelope-from trasz@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 n1MDbNca097504; Sun, 22 Feb 2009 13:37:23 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1MDbNq1097503; Sun, 22 Feb 2009 13:37:23 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200902221337.n1MDbNq1097503@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 22 Feb 2009 13:37:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188916 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Feb 2009 13:37:23 -0000 Author: trasz Date: Sun Feb 22 13:37:22 2009 New Revision: 188916 URL: http://svn.freebsd.org/changeset/base/188916 Log: Fix a typo and add manpage links to geom(4). Approved by: rwatson (mentor) Modified: head/share/man/man4/geom.4 Modified: head/share/man/man4/geom.4 ============================================================================== --- head/share/man/man4/geom.4 Sun Feb 22 13:34:01 2009 (r188915) +++ head/share/man/man4/geom.4 Sun Feb 22 13:37:22 2009 (r188916) @@ -249,7 +249,7 @@ It will explicitly close (i.e.: zero the which will propagate all the way down through the mesh. It will then detach and destroy its geom. .It -The geom whose provider is now attached will destroy the provider, +The geom whose provider is now detached will destroy the provider, detach and destroy its consumer and destroy its geom. .It This process percolates all the way down through the mesh, until @@ -431,6 +431,18 @@ This is unused at this time. .It 0x80 Pq Dv G_F_CTLDUMP Dump contents of gctl requests. .El +.Sh SEE ALSO +.Xr disk 9 , +.Xr DECLARE_GEOM_CLASS 9 , +.Xr g_access 9 , +.Xr g_attach 9 , +.Xr g_bio 9 , +.Xr g_consumer 9 , +.Xr g_data 9 , +.Xr g_event 9 , +.Xr g_geom 9 , +.Xr g_provider 9 , +.Xr g_provider_by_name 9 .Sh HISTORY This software was developed for the .Fx From owner-svn-src-head@FreeBSD.ORG Sun Feb 22 13:38:17 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47D4C1065670; Sun, 22 Feb 2009 13:38:17 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 367908FC1C; Sun, 22 Feb 2009 13:38:17 +0000 (UTC) (envelope-from trasz@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 n1MDcH4B097569; Sun, 22 Feb 2009 13:38:17 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1MDcHM7097567; Sun, 22 Feb 2009 13:38:17 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200902221338.n1MDcHM7097567@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 22 Feb 2009 13:38:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188917 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Feb 2009 13:38:17 -0000 Author: trasz Date: Sun Feb 22 13:38:16 2009 New Revision: 188917 URL: http://svn.freebsd.org/changeset/base/188917 Log: Mention disk_gone() in disk(9). Approved by: rwatson (mentor) Modified: head/share/man/man9/Makefile head/share/man/man9/disk.9 Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Sun Feb 22 13:37:22 2009 (r188916) +++ head/share/man/man9/Makefile Sun Feb 22 13:38:16 2009 (r188917) @@ -575,7 +575,9 @@ MLINKS+=devstat.9 devicestat.9 \ devstat.9 devstat_end_transaction.9 \ devstat.9 devstat_remove_entry.9 \ devstat.9 devstat_start_transaction.9 -MLINKS+=disk.9 disk_create.9 \ +MLINKS+=disk.9 disk_alloc.9 \ + disk.9 disk_create.9 \ + disk.9 disk_gone.9 \ disk.9 disk_destroy.9 MLINKS+=domain.9 DOMAIN_SET.9 \ domain.9 net_add_domain.9 \ Modified: head/share/man/man9/disk.9 ============================================================================== --- head/share/man/man9/disk.9 Sun Feb 22 13:37:22 2009 (r188916) +++ head/share/man/man9/disk.9 Sun Feb 22 13:38:16 2009 (r188917) @@ -40,6 +40,8 @@ .Ft void .Fn disk_create "struct disk *disk" "int version" .Ft void +.Fn disk_gone "struct disk *disk" +.Ft void .Fn disk_destroy "struct disk *disk" .Sh DESCRIPTION The disk storage API permits kernel device drivers providing access to @@ -65,6 +67,11 @@ function, fill in the fields and call .Fn disk_create when the device is ready to service requests. +.Fn disk_gone +orphans all of the providers associated with the drive, setting an error +condition of ENXIO in each one. +In addition, it prevents a re-taste on last close for writing if an error +condition has been set in the provider. After calling .Fn disk_destroy , the device driver is not allowed to access the contents of From owner-svn-src-head@FreeBSD.ORG Sun Feb 22 14:08:20 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9081C106566B; Sun, 22 Feb 2009 14:08:20 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 73FED8FC14; Sun, 22 Feb 2009 14:08:20 +0000 (UTC) (envelope-from mav@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 n1ME8K7k098262; Sun, 22 Feb 2009 14:08:20 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1ME8K6n098261; Sun, 22 Feb 2009 14:08:20 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200902221408.n1ME8K6n098261@svn.freebsd.org> From: Alexander Motin Date: Sun, 22 Feb 2009 14:08:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188918 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Feb 2009 14:08:21 -0000 Author: mav Date: Sun Feb 22 14:08:20 2009 New Revision: 188918 URL: http://svn.freebsd.org/changeset/base/188918 Log: Tune AHCI verbose messages to make log more readable. Modified: head/sys/dev/ata/chipsets/ata-ahci.c Modified: head/sys/dev/ata/chipsets/ata-ahci.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-ahci.c Sun Feb 22 13:38:16 2009 (r188917) +++ head/sys/dev/ata/chipsets/ata-ahci.c Sun Feb 22 14:08:20 2009 (r188918) @@ -486,11 +486,13 @@ ata_ahci_issue_cmd(device_t dev, u_int16 ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_IS + offset, ATA_INL(ctlr->r_res2, ATA_AHCI_P_IS + offset)); - if (bootverbose) - device_printf(dev, "ahci_issue_cmd time=%dms cnt=%dms status=%08x\n", - timeout, count, status); - if (timeout && (count >= timeout)) + if (timeout && (count >= timeout)) { + if (bootverbose) { + device_printf(dev, "ahci_issue_cmd timeout: %d of %dms, status=%08x\n", + count, timeout, status); + } return EIO; + } return 0; } @@ -635,7 +637,7 @@ ata_ahci_wait_ready(device_t dev, int t) (ATA_S_BUSY | ATA_S_DRQ)) { DELAY(1000); if (timeout++ > t) { - device_printf(dev, "port is not ready\n"); + device_printf(dev, "port is not ready (timeout %dms)\n", t); return (-1); } } @@ -653,6 +655,9 @@ ata_ahci_softreset(device_t dev, int por struct ata_ahci_cmd_tab *ctp = (struct ata_ahci_cmd_tab *)(ch->dma.work + ATA_AHCI_CT_OFFSET); + if (bootverbose) + device_printf(dev, "software reset port %d...\n", port); + /* kick controller into sane state */ ata_ahci_stop(dev); ata_ahci_clo(dev); @@ -665,9 +670,10 @@ ata_ahci_softreset(device_t dev, int por //ctp->cfis[7] = ATA_D_LBA | ATA_D_IBM; ctp->cfis[15] = (ATA_A_4BIT | ATA_A_RESET); - if (ata_ahci_issue_cmd(dev, ATA_AHCI_CMD_RESET | ATA_AHCI_CMD_CLR_BUSY,100)) - device_printf(dev, "setting SRST failed ??\n"); - //return -1; + if (ata_ahci_issue_cmd(dev, ATA_AHCI_CMD_RESET | ATA_AHCI_CMD_CLR_BUSY,100)) { + device_printf(dev, "software reset set timeout\n"); + return (-1); + } ata_udelay(50); @@ -680,8 +686,10 @@ ata_ahci_softreset(device_t dev, int por if (ata_ahci_issue_cmd(dev, 0, 0)) return -1; - if (ata_ahci_wait_ready(dev, 1000)) + if (ata_ahci_wait_ready(dev, 1000)) { + device_printf(dev, "software reset clear timeout\n"); return (-1); + } return ATA_INL(ctlr->r_res2, ATA_AHCI_P_SIG + offset); } @@ -695,6 +703,9 @@ ata_ahci_reset(device_t dev) u_int32_t signature; int offset = ch->unit << 7; + if (bootverbose) + device_printf(dev, "AHCI reset...\n"); + /* Disable port interrupts */ ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_IE + offset, 0); @@ -718,7 +729,7 @@ ata_ahci_reset(device_t dev) if (!ata_sata_phy_reset(dev)) { if (bootverbose) - device_printf(dev, "phy reset found no device\n"); + device_printf(dev, "AHCI reset done: phy reset found no device\n"); ch->devices = 0; /* enable wanted port interrupts */ @@ -767,11 +778,11 @@ ata_ahci_reset(device_t dev) break; default: /* SOS XXX */ if (bootverbose) - device_printf(dev, "No signature, asuming disk device\n"); + device_printf(dev, "Unknown signature, asuming disk device\n"); ch->devices = ATA_ATA_MASTER; } if (bootverbose) - device_printf(dev, "ahci_reset devices=%08x\n", ch->devices); + device_printf(dev, "AHCI reset done: devices=%08x\n", ch->devices); } static void From owner-svn-src-head@FreeBSD.ORG Sun Feb 22 15:03:29 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D792E1065697; Sun, 22 Feb 2009 15:03:29 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C52608FC16; Sun, 22 Feb 2009 15:03:29 +0000 (UTC) (envelope-from pjd@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 n1MF3T2t099323; Sun, 22 Feb 2009 15:03:29 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1MF3TLq099322; Sun, 22 Feb 2009 15:03:29 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200902221503.n1MF3TLq099322@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 22 Feb 2009 15:03:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188919 - head/sbin/geom/class/journal X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Feb 2009 15:03:30 -0000 Author: pjd Date: Sun Feb 22 15:03:29 2009 New Revision: 188919 URL: http://svn.freebsd.org/changeset/base/188919 Log: - Punctuation fixes. - New sentence - new line. Reported by: Ben Kaduk - No more than 80 chars per line. Modified: head/sbin/geom/class/journal/gjournal.8 Modified: head/sbin/geom/class/journal/gjournal.8 ============================================================================== --- head/sbin/geom/class/journal/gjournal.8 Sun Feb 22 14:08:20 2009 (r188918) +++ head/sbin/geom/class/journal/gjournal.8 Sun Feb 22 15:03:29 2009 (r188919) @@ -244,18 +244,20 @@ change the value. .It Li debug Setting a non-zero value enables debugging at various levels. Debug level 1 will record actions at a journal level, relating to journal -switches, metadata updates etc. +switches, metadata updates, etc. Debug level 2 will record actions at a higher level, relating to the numbers of -entries in journals, access requests etc. +entries in journals, access requests, etc. Debug level 3 will record verbose detail, including insertion of I/Os to the journal. .It Li switch_time The maximum number of seconds a journal is allowed to remain open before switching to a new journal. .It Li force_switch -Force a journal switch when the journal uses more than N% of the free journal space. +Force a journal switch when the journal uses more than N% of the free journal +space. .It Li parallel_flushes -The number of flush I/O requests to be sent in parallel when flushing the journal to the data provider. +The number of flush I/O requests to be sent in parallel when flushing the +journal to the data provider. .It Li accept_immediately The maximum number of I/O requests accepted at the same time. .It Li parallel_copies @@ -263,7 +265,9 @@ The number of copy I/O requests to send .It Li record_entries The maximum number of record entries to allow in a single journal. .It Li optimize -Controls whether entries in a journal will be optimized, by combining overlapping I/Os into a single I/O, and reordering the entries in a journal. This can be disabled by setting the sysctl to 0. +Controls whether entries in a journal will be optimized by combining overlapping +I/Os into a single I/O and reordering the entries in a journal. +This can be disabled by setting the sysctl to 0. .El .Ss cache The string and integer information available for the cache level @@ -286,13 +290,17 @@ The number of bytes currently allocated .It Li limit The maximum number of bytes to be allocated to the cache. .It Li divisor -Sets the cache size to be used as a proportion of kmem_size. A value of 2 (the default) will cause the cache size to be set to 1/2 of the kmem_size. +Sets the cache size to be used as a proportion of kmem_size. +A value of 2 (the default) will cause the cache size to be set to 1/2 of the +kmem_size. .It Li switch Force a journal switch when this percentage of cache has been used. .It Li misses -The number of cache misses, when data has been read, but was not found in the cache. +The number of cache misses, when data has been read, but was not found in the +cache. .It Li alloc_failures -The number of times memory failed to be allocated to the cache because the cache limit was hit. +The number of times memory failed to be allocated to the cache because the cache +limit was hit. .El .Ss stats The string and integer information available for the statistics level @@ -317,7 +325,8 @@ The number of I/Os which were combined b .It Li switches The number of journal switches. .It Li wait_for_copy -The number of times the journal switch process had to wait for the previous journal copy to complete. +The number of times the journal switch process had to wait for the previous +journal copy to complete. .It Li journal_full The number of times the journal was almost full, forcing a journal switch. .It Li low_mem From owner-svn-src-head@FreeBSD.ORG Sun Feb 22 18:15:17 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 989DB10656F5; Sun, 22 Feb 2009 18:15:17 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 82BBC8FC27; Sun, 22 Feb 2009 18:15:17 +0000 (UTC) (envelope-from alc@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 n1MIFHQX002914; Sun, 22 Feb 2009 18:15:17 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1MIFHKQ002913; Sun, 22 Feb 2009 18:15:17 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200902221815.n1MIFHKQ002913@svn.freebsd.org> From: Alan Cox Date: Sun, 22 Feb 2009 18:15:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188921 - head/sys/fs/tmpfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Feb 2009 18:15:19 -0000 Author: alc Date: Sun Feb 22 18:15:17 2009 New Revision: 188921 URL: http://svn.freebsd.org/changeset/base/188921 Log: Simplify the unwiring and activation of pages. MFC after: 1 week Modified: head/sys/fs/tmpfs/tmpfs_vnops.c Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Sun Feb 22 17:57:35 2009 (r188920) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Sun Feb 22 18:15:17 2009 (r188921) @@ -496,8 +496,7 @@ nocache: VM_OBJECT_LOCK(tobj); out: vm_page_lock_queues(); - vm_page_unwire(m, 0); - vm_page_activate(m); + vm_page_unwire(m, TRUE); vm_page_unlock_queues(); vm_page_wakeup(m); vm_object_pip_subtract(tobj, 1); @@ -635,8 +634,7 @@ out: vm_page_zero_invalid(tpg, TRUE); vm_page_dirty(tpg); } - vm_page_unwire(tpg, 0); - vm_page_activate(tpg); + vm_page_unwire(tpg, TRUE); vm_page_unlock_queues(); vm_page_wakeup(tpg); if (vpg != NULL) From owner-svn-src-head@FreeBSD.ORG Sun Feb 22 18:22:21 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9ADD7106566C; Sun, 22 Feb 2009 18:22:21 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6E9978FC08; Sun, 22 Feb 2009 18:22:21 +0000 (UTC) (envelope-from mav@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 n1MIMLX0003079; Sun, 22 Feb 2009 18:22:21 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1MIMLPu003077; Sun, 22 Feb 2009 18:22:21 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200902221822.n1MIMLPu003077@svn.freebsd.org> From: Alexander Motin Date: Sun, 22 Feb 2009 18:22:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188922 - head/sbin/atacontrol X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Feb 2009 18:22:22 -0000 Author: mav Date: Sun Feb 22 18:22:21 2009 New Revision: 188922 URL: http://svn.freebsd.org/changeset/base/188922 Log: Add SATA and USB modes for completeness. USB modes principally can't be set, SATA mode setting is not implementes at this time. Submitted by: Christoph Mallon Modified: head/sbin/atacontrol/atacontrol.8 head/sbin/atacontrol/atacontrol.c Modified: head/sbin/atacontrol/atacontrol.8 ============================================================================== --- head/sbin/atacontrol/atacontrol.8 Sun Feb 22 18:15:17 2009 (r188921) +++ head/sbin/atacontrol/atacontrol.8 Sun Feb 22 18:22:21 2009 (r188922) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 14, 2008 +.Dd February 21, 2009 .Dt ATACONTROL 8 .Os .Sh NAME @@ -180,9 +180,7 @@ Modes are given like case does not matter. .Pp Currently supported modes are: -.Cm PIO0 , PIO1 , PIO2 , PIO3 , PIO4 , -.Cm WDMA2 , -.Cm UDMA2 +.Cm BIOSPIO , PIO0 , PIO1 , PIO2 , PIO3 , PIO4 , WDMA2 , UDMA2 (alias .Cm UDMA33 ) , .Cm UDMA4 @@ -190,11 +188,13 @@ Currently supported modes are: .Cm UDMA66 ) , .Cm UDMA5 (alias -.Cm UDMA100 ) -and +.Cm UDMA100 ) , .Cm UDMA6 (alias -.Cm UDMA133 ) . +.Cm UDMA133 ) , +.Cm SATA150 , SATA300 , USB , USB1 , USB2 +and +.Cm BIOSDMA . .It Ic cap Show detailed info about the device on .Ar device . Modified: head/sbin/atacontrol/atacontrol.c ============================================================================== --- head/sbin/atacontrol/atacontrol.c Sun Feb 22 18:15:17 2009 (r188921) +++ head/sbin/atacontrol/atacontrol.c Sun Feb 22 18:22:21 2009 (r188922) @@ -82,6 +82,11 @@ str2mode(char *str) if (!strcasecmp(str, "UDMA100")) return ATA_UDMA5; if (!strcasecmp(str, "UDMA6")) return ATA_UDMA6; if (!strcasecmp(str, "UDMA133")) return ATA_UDMA6; + if (!strcasecmp(str, "SATA150")) return ATA_SA150; + if (!strcasecmp(str, "SATA300")) return ATA_SA300; + if (!strcasecmp(str, "USB")) return ATA_USB; + if (!strcasecmp(str, "USB1")) return ATA_USB1; + if (!strcasecmp(str, "USB2")) return ATA_USB2; if (!strcasecmp(str, "BIOSDMA")) return ATA_DMA; return -1; } From owner-svn-src-head@FreeBSD.ORG Sun Feb 22 18:45:30 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB7D310656EE; Sun, 22 Feb 2009 18:45:30 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 587FD8FC16; Sun, 22 Feb 2009 18:45:30 +0000 (UTC) (envelope-from nwhitehorn@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 n1MIjU5w003529; Sun, 22 Feb 2009 18:45:30 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1MIjUTM003527; Sun, 22 Feb 2009 18:45:30 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200902221845.n1MIjUTM003527@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 22 Feb 2009 18:45:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188923 - in head: share/mk sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Feb 2009 18:45:31 -0000 Author: nwhitehorn Date: Sun Feb 22 18:45:30 2009 New Revision: 188923 URL: http://svn.freebsd.org/changeset/base/188923 Log: Explicitly disable generation of Altivec instructions in the kernel on PowerPC, and add support to allow users to set their CPUTYPE in make.conf. Modified: head/share/mk/bsd.cpu.mk head/sys/conf/kern.mk Modified: head/share/mk/bsd.cpu.mk ============================================================================== --- head/share/mk/bsd.cpu.mk Sun Feb 22 18:22:21 2009 (r188922) +++ head/share/mk/bsd.cpu.mk Sun Feb 22 18:45:30 2009 (r188923) @@ -118,6 +118,8 @@ _CPUCFLAGS = -mcpu=${CPUTYPE} . if ${CPUTYPE} == "e500" MACHINE_CPU = booke _CPUCFLAGS = -Wa,-me500 -msoft-float +. else +_CPUCFLAGS = -mcpu=${CPUTYPE} . endif . elif ${MACHINE_ARCH} == "mips" . if ${CPUTYPE} == "mips32" Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Sun Feb 22 18:22:21 2009 (r188922) +++ head/sys/conf/kern.mk Sun Feb 22 18:45:30 2009 (r188923) @@ -78,9 +78,10 @@ INLINE_LIMIT?= 8000 # # For PowerPC we tell gcc to use floating point emulation. This avoids using # floating point registers for integer operations which it has a tendency to do. +# Also explicitly disable Altivec instructions inside the kernel. # .if ${MACHINE_ARCH} == "powerpc" -CFLAGS+= -msoft-float +CFLAGS+= -msoft-float -mno-altivec INLINE_LIMIT?= 15000 .endif From owner-svn-src-head@FreeBSD.ORG Sun Feb 22 18:46:37 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02B00106566C; Sun, 22 Feb 2009 18:46:37 +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 E54858FC1D; Sun, 22 Feb 2009 18:46:36 +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 n1MIka55003584; Sun, 22 Feb 2009 18:46:36 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1MIkagS003583; Sun, 22 Feb 2009 18:46:36 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902221846.n1MIkagS003583@svn.freebsd.org> From: Sam Leffler Date: Sun, 22 Feb 2009 18:46:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188924 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Feb 2009 18:46:37 -0000 Author: sam Date: Sun Feb 22 18:46:36 2009 New Revision: 188924 URL: http://svn.freebsd.org/changeset/base/188924 Log: display min/max dwell times in msecs in debug msgs Modified: head/sys/net80211/ieee80211_scan.c Modified: head/sys/net80211/ieee80211_scan.c ============================================================================== --- head/sys/net80211/ieee80211_scan.c Sun Feb 22 18:45:30 2009 (r188923) +++ head/sys/net80211/ieee80211_scan.c Sun Feb 22 18:46:36 2009 (r188924) @@ -346,7 +346,8 @@ scan_dump(struct ieee80211_scan_state *s if_printf(vap->iv_ifp, "scan set "); ieee80211_scan_dump_channels(ss); - printf(" dwell min %lu max %lu\n", ss->ss_mindwell, ss->ss_maxdwell); + printf(" dwell min %lums max %lums\n", + ticks_to_msecs(ss->ss_mindwell), ticks_to_msecs(ss->ss_maxdwell)); } #endif /* IEEE80211_DEBUG */ @@ -919,7 +920,7 @@ again: maxdwell = ss->ss_maxdwell; IEEE80211_DPRINTF(vap, IEEE80211_MSG_SCAN, - "%s: chan %3d%c -> %3d%c [%s, dwell min %lu max %lu]\n", + "%s: chan %3d%c -> %3d%c [%s, dwell min %lums max %lums]\n", __func__, ieee80211_chan2ieee(ic, ic->ic_curchan), channel_type(ic->ic_curchan), @@ -927,7 +928,7 @@ again: (ss->ss_flags & IEEE80211_SCAN_ACTIVE) && (chan->ic_flags & IEEE80211_CHAN_PASSIVE) == 0 ? "active" : "passive", - ss->ss_mindwell, maxdwell); + ticks_to_msecs(ss->ss_mindwell), ticks_to_msecs(maxdwell)); /* * Potentially change channel and phy mode. From owner-svn-src-head@FreeBSD.ORG Sun Feb 22 18:48:55 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D8D21065670; Sun, 22 Feb 2009 18:48:55 +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 1BD8E8FC14; Sun, 22 Feb 2009 18:48:55 +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 n1MImtJ4003655; Sun, 22 Feb 2009 18:48:55 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1MImswD003654; Sun, 22 Feb 2009 18:48:55 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902221848.n1MImswD003654@svn.freebsd.org> From: Sam Leffler Date: Sun, 22 Feb 2009 18:48:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188925 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Feb 2009 18:48:55 -0000 Author: sam Date: Sun Feb 22 18:48:54 2009 New Revision: 188925 URL: http://svn.freebsd.org/changeset/base/188925 Log: change tdma slave behaviour: if the channel is locked don't do bmiss handling (so no scanning/roaming) Reviewed by: Chris Anderson Modified: head/sys/net80211/ieee80211_tdma.c Modified: head/sys/net80211/ieee80211_tdma.c ============================================================================== --- head/sys/net80211/ieee80211_tdma.c Sun Feb 22 18:46:36 2009 (r188924) +++ head/sys/net80211/ieee80211_tdma.c Sun Feb 22 18:48:54 2009 (r188925) @@ -240,11 +240,14 @@ tdma_newstate(struct ieee80211vap *vap, if (status == 0 && nstate == IEEE80211_S_RUN && ostate != IEEE80211_S_RUN && (vap->iv_flags_ext & IEEE80211_FEXT_SWBMISS) && - ts->tdma_slot != 0) { + ts->tdma_slot != 0 && + vap->iv_des_chan == IEEE80211_CHAN_ANYC) { /* * Start s/w beacon miss timer for slave devices w/o - * hardware support. The 2x is a fudge for our doing - * this in software. + * hardware support. Note we do this only if we're + * not locked to a channel (i.e. roam to follow the + * master). The 2x is a fudge for our doing this in + * software. */ vap->iv_swbmiss_period = IEEE80211_TU_TO_TICKS( 2 * vap->iv_bmissthreshold * ts->tdma_bintval * From owner-svn-src-head@FreeBSD.ORG Sun Feb 22 19:50:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 118091065674; Sun, 22 Feb 2009 19:50:10 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E9B108FC1D; Sun, 22 Feb 2009 19:50:09 +0000 (UTC) (envelope-from alc@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 n1MJo9DH004946; Sun, 22 Feb 2009 19:50:09 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1MJo9DC004945; Sun, 22 Feb 2009 19:50:09 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200902221950.n1MJo9DC004945@svn.freebsd.org> From: Alan Cox Date: Sun, 22 Feb 2009 19:50:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188929 - head/sys/fs/tmpfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Feb 2009 19:50:10 -0000 Author: alc Date: Sun Feb 22 19:50:09 2009 New Revision: 188929 URL: http://svn.freebsd.org/changeset/base/188929 Log: Use uiomove_fromphys() instead of the combination of sf_buf and uiomove(). This is not only shorter; it also eliminates unnecessary thread pinning on architectures that implement a direct map. MFC after: 3 weeks Modified: head/sys/fs/tmpfs/tmpfs_vnops.c Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Sun Feb 22 19:23:58 2009 (r188928) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Sun Feb 22 19:50:09 2009 (r188929) @@ -52,8 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include + #include #include @@ -436,10 +435,9 @@ tmpfs_mappedread(vm_object_t vobj, vm_ob { vm_pindex_t idx; vm_page_t m; - struct sf_buf *sf; - off_t offset, addr; + vm_offset_t offset; + off_t addr; size_t tlen; - caddr_t va; int error; addr = uio->uio_offset; @@ -458,12 +456,7 @@ lookupvpg: goto lookupvpg; vm_page_busy(m); VM_OBJECT_UNLOCK(vobj); - sched_pin(); - sf = sf_buf_alloc(m, SFB_CPUPRIVATE); - va = (caddr_t)sf_buf_kva(sf); - error = uiomove(va + offset, tlen, uio); - sf_buf_free(sf); - sched_unpin(); + error = uiomove_fromphys(&m, offset, tlen, uio); VM_OBJECT_LOCK(vobj); vm_page_wakeup(m); VM_OBJECT_UNLOCK(vobj); @@ -487,12 +480,7 @@ nocache: vm_page_zero_invalid(m, TRUE); } VM_OBJECT_UNLOCK(tobj); - sched_pin(); - sf = sf_buf_alloc(m, SFB_CPUPRIVATE); - va = (caddr_t)sf_buf_kva(sf); - error = uiomove(va + offset, tlen, uio); - sf_buf_free(sf); - sched_unpin(); + error = uiomove_fromphys(&m, offset, tlen, uio); VM_OBJECT_LOCK(tobj); out: vm_page_lock_queues(); @@ -557,10 +545,9 @@ tmpfs_mappedwrite(vm_object_t vobj, vm_o { vm_pindex_t idx; vm_page_t vpg, tpg; - struct sf_buf *sf; - off_t offset, addr; + vm_offset_t offset; + off_t addr; size_t tlen; - caddr_t va; int error; error = 0; @@ -586,12 +573,7 @@ lookupvpg: vm_page_undirty(vpg); vm_page_unlock_queues(); VM_OBJECT_UNLOCK(vobj); - sched_pin(); - sf = sf_buf_alloc(vpg, SFB_CPUPRIVATE); - va = (caddr_t)sf_buf_kva(sf); - error = uiomove(va + offset, tlen, uio); - sf_buf_free(sf); - sched_unpin(); + error = uiomove_fromphys(&vpg, offset, tlen, uio); } else { VM_OBJECT_UNLOCK(vobj); vpg = NULL; @@ -613,14 +595,9 @@ nocache: vm_page_zero_invalid(tpg, TRUE); } VM_OBJECT_UNLOCK(tobj); - if (vpg == NULL) { - sched_pin(); - sf = sf_buf_alloc(tpg, SFB_CPUPRIVATE); - va = (caddr_t)sf_buf_kva(sf); - error = uiomove(va + offset, tlen, uio); - sf_buf_free(sf); - sched_unpin(); - } else { + if (vpg == NULL) + error = uiomove_fromphys(&tpg, offset, tlen, uio); + else { KASSERT(vpg->valid == VM_PAGE_BITS_ALL, ("parts of vpg invalid")); pmap_copy_page(vpg, tpg); } From owner-svn-src-head@FreeBSD.ORG Mon Feb 23 06:00:25 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E5A51065696; Mon, 23 Feb 2009 06:00:25 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F20648FC16; Mon, 23 Feb 2009 06:00:24 +0000 (UTC) (envelope-from alc@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 n1N60OBc016184; Mon, 23 Feb 2009 06:00:24 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1N60ORX016182; Mon, 23 Feb 2009 06:00:24 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200902230600.n1N60ORX016182@svn.freebsd.org> From: Alan Cox Date: Mon, 23 Feb 2009 06:00:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188932 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2009 06:00:26 -0000 Author: alc Date: Mon Feb 23 06:00:24 2009 New Revision: 188932 URL: http://svn.freebsd.org/changeset/base/188932 Log: Optimize free_pv_entry(); specifically, avoid repeated TAILQ_REMOVE()s. MFC after: 1 week Modified: head/sys/amd64/amd64/pmap.c head/sys/i386/i386/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sun Feb 22 20:11:10 2009 (r188931) +++ head/sys/amd64/amd64/pmap.c Mon Feb 23 06:00:24 2009 (r188932) @@ -1932,15 +1932,15 @@ free_pv_entry(pmap_t pmap, pv_entry_t pv pc->pc_map[field] |= 1ul << bit; /* move to head of list */ TAILQ_REMOVE(&pmap->pm_pvchunk, pc, pc_list); - TAILQ_INSERT_HEAD(&pmap->pm_pvchunk, pc, pc_list); if (pc->pc_map[0] != PC_FREE0 || pc->pc_map[1] != PC_FREE1 || - pc->pc_map[2] != PC_FREE2) + pc->pc_map[2] != PC_FREE2) { + TAILQ_INSERT_HEAD(&pmap->pm_pvchunk, pc, pc_list); return; + } PV_STAT(pv_entry_spare -= _NPCPV); PV_STAT(pc_chunk_count--); PV_STAT(pc_chunk_frees++); /* entire chunk is free, return it */ - TAILQ_REMOVE(&pmap->pm_pvchunk, pc, pc_list); m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pc)); dump_drop_page(m->phys_addr); vm_page_unwire(m, 0); Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Sun Feb 22 20:11:10 2009 (r188931) +++ head/sys/i386/i386/pmap.c Mon Feb 23 06:00:24 2009 (r188932) @@ -1975,15 +1975,15 @@ free_pv_entry(pmap_t pmap, pv_entry_t pv pc->pc_map[field] |= 1ul << bit; /* move to head of list */ TAILQ_REMOVE(&pmap->pm_pvchunk, pc, pc_list); - TAILQ_INSERT_HEAD(&pmap->pm_pvchunk, pc, pc_list); for (idx = 0; idx < _NPCM; idx++) - if (pc->pc_map[idx] != pc_freemask[idx]) + if (pc->pc_map[idx] != pc_freemask[idx]) { + TAILQ_INSERT_HEAD(&pmap->pm_pvchunk, pc, pc_list); return; + } PV_STAT(pv_entry_spare -= _NPCPV); PV_STAT(pc_chunk_count--); PV_STAT(pc_chunk_frees++); /* entire chunk is free, return it */ - TAILQ_REMOVE(&pmap->pm_pvchunk, pc, pc_list); m = PHYS_TO_VM_PAGE(pmap_kextract((vm_offset_t)pc)); pmap_qremove((vm_offset_t)pc, 1); vm_page_unwire(m, 0); From owner-svn-src-head@FreeBSD.ORG Mon Feb 23 07:33:29 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A48D106564A; Mon, 23 Feb 2009 07:33:29 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5EBEA8FC08; Mon, 23 Feb 2009 07:33:29 +0000 (UTC) (envelope-from pjd@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 n1N7XTJf017957; Mon, 23 Feb 2009 07:33:29 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1N7XTUB017956; Mon, 23 Feb 2009 07:33:29 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200902230733.n1N7XTUB017956@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 23 Feb 2009 07:33:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188934 - head/tools/regression/fstest X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2009 07:33:30 -0000 Author: pjd Date: Mon Feb 23 07:33:29 2009 New Revision: 188934 URL: http://svn.freebsd.org/changeset/base/188934 Log: Add explicit casting in few places. It is only really necessary for open(2)'s third argument, which is optional and obtained through stdarg(3). open(2)'s third argument is 32bit and we pass 64 bits. On little endian it works, because we take lower 32 bits, but on big endian platforms we take upper 32 bits, so we end up with 0. Reported by: Milan Čermák Modified: head/tools/regression/fstest/fstest.c Modified: head/tools/regression/fstest/fstest.c ============================================================================== --- head/tools/regression/fstest/fstest.c Mon Feb 23 06:47:10 2009 (r188933) +++ head/tools/regression/fstest/fstest.c Mon Feb 23 07:33:29 2009 (r188934) @@ -337,7 +337,7 @@ show_stat(struct stat64 *sp, const char printf("%lld", (long long)sp->st_ctime); #ifdef HAS_CHFLAGS else if (strcmp(what, "flags") == 0) - printf("%s", flags2str(chflags_flags, sp->st_flags)); + printf("%s", flags2str(chflags_flags, (long long)sp->st_flags)); #endif else if (strcmp(what, "type") == 0) { switch (sp->st_mode & S_IFMT) { @@ -443,17 +443,17 @@ call_syscall(struct syscall_desc *scall, fprintf(stderr, "too few arguments\n"); exit(1); } - rval = open(STR(0), flags, (mode_t)NUM(2)); + rval = open(STR(0), (int)flags, (mode_t)NUM(2)); } else { if (i == 3) { fprintf(stderr, "too many arguments\n"); exit(1); } - rval = open(STR(0), flags); + rval = open(STR(0), (int)flags); } break; case ACTION_CREATE: - rval = open(STR(0), O_CREAT | O_EXCL, NUM(1)); + rval = open(STR(0), O_CREAT | O_EXCL, (mode_t)NUM(1)); if (rval >= 0) close(rval); break; @@ -461,7 +461,7 @@ call_syscall(struct syscall_desc *scall, rval = unlink(STR(0)); break; case ACTION_MKDIR: - rval = mkdir(STR(0), NUM(1)); + rval = mkdir(STR(0), (mode_t)NUM(1)); break; case ACTION_RMDIR: rval = rmdir(STR(0)); @@ -476,30 +476,30 @@ call_syscall(struct syscall_desc *scall, rval = rename(STR(0), STR(1)); break; case ACTION_MKFIFO: - rval = mkfifo(STR(0), NUM(1)); + rval = mkfifo(STR(0), (mode_t)NUM(1)); break; case ACTION_CHMOD: - rval = chmod(STR(0), NUM(1)); + rval = chmod(STR(0), (mode_t)NUM(1)); break; #ifdef HAS_LCHMOD case ACTION_LCHMOD: - rval = lchmod(STR(0), NUM(1)); + rval = lchmod(STR(0), (mode_t)NUM(1)); break; #endif case ACTION_CHOWN: - rval = chown(STR(0), NUM(1), NUM(2)); + rval = chown(STR(0), (uid_t)NUM(1), (gid_t)NUM(2)); break; case ACTION_LCHOWN: - rval = lchown(STR(0), NUM(1), NUM(2)); + rval = lchown(STR(0), (uid_t)NUM(1), (gid_t)NUM(2)); break; #ifdef HAS_CHFLAGS case ACTION_CHFLAGS: - rval = chflags(STR(0), str2flags(chflags_flags, STR(1))); + rval = chflags(STR(0), (unsigned long)str2flags(chflags_flags, STR(1))); break; #endif #ifdef HAS_LCHFLAGS case ACTION_LCHFLAGS: - rval = lchflags(STR(0), str2flags(chflags_flags, STR(1))); + rval = lchflags(STR(0), (unsigned long)str2flags(chflags_flags, STR(1))); break; #endif case ACTION_TRUNCATE: From owner-svn-src-head@FreeBSD.ORG Mon Feb 23 08:15:07 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC9B61065701; Mon, 23 Feb 2009 08:15:07 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from mail-gw2.york.ac.uk (mail-gw2.york.ac.uk [144.32.128.247]) by mx1.freebsd.org (Postfix) with ESMTP id 6E7DE8FC08; Mon, 23 Feb 2009 08:15:07 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from mail-gw7.york.ac.uk (mail-gw7.york.ac.uk [144.32.129.30]) by mail-gw2.york.ac.uk (8.13.6/8.13.6) with ESMTP id n1N8F4Dr008085; Mon, 23 Feb 2009 08:15:04 GMT Received: from ury.york.ac.uk ([144.32.108.81]) by mail-gw7.york.ac.uk with esmtps (TLSv1:AES256-SHA:256) (Exim 4.68) (envelope-from ) id 1LbVxw-0003Ri-DR; Mon, 23 Feb 2009 08:15:04 +0000 Received: from ury.york.ac.uk (localhost.york.ac.uk [127.0.0.1]) by ury.york.ac.uk (8.14.3/8.14.3) with ESMTP id n1N8F4xK042297; Mon, 23 Feb 2009 08:15:04 GMT (envelope-from gavin@FreeBSD.org) Received: from localhost (gavin@localhost) by ury.york.ac.uk (8.14.3/8.14.3/Submit) with ESMTP id n1N8F3Wr042285; Mon, 23 Feb 2009 08:15:04 GMT (envelope-from gavin@FreeBSD.org) X-Authentication-Warning: ury.york.ac.uk: gavin owned process doing -bs Date: Mon, 23 Feb 2009 08:15:03 +0000 (GMT) From: Gavin Atkinson X-X-Sender: gavin@ury.york.ac.uk To: Alexander Motin In-Reply-To: <200902221408.n1ME8K6n098261@svn.freebsd.org> Message-ID: <20090223080900.Q86550@ury.york.ac.uk> References: <200902221408.n1ME8K6n098261@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-York-MailScanner: Found to be clean X-York-MailScanner-From: gavin@freebsd.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r188918 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2009 08:15:09 -0000 On Sun, 22 Feb 2009, Alexander Motin wrote: > Author: mav > Date: Sun Feb 22 14:08:20 2009 > New Revision: 188918 > URL: http://svn.freebsd.org/changeset/base/188918 > > Log: > Tune AHCI verbose messages to make log more readable. > [snip] > @@ -665,9 +670,10 @@ ata_ahci_softreset(device_t dev, int por > //ctp->cfis[7] = ATA_D_LBA | ATA_D_IBM; > ctp->cfis[15] = (ATA_A_4BIT | ATA_A_RESET); > > - if (ata_ahci_issue_cmd(dev, ATA_AHCI_CMD_RESET | ATA_AHCI_CMD_CLR_BUSY,100)) > - device_printf(dev, "setting SRST failed ??\n"); > - //return -1; > + if (ata_ahci_issue_cmd(dev, ATA_AHCI_CMD_RESET | ATA_AHCI_CMD_CLR_BUSY,100)) { > + device_printf(dev, "software reset set timeout\n"); > + return (-1); > + } > Was the uncommenting of the return intentional here? Before, the code would continue to clear the soft reset even if it didn't appear to have worked. > @@ -767,11 +778,11 @@ ata_ahci_reset(device_t dev) > break; > default: /* SOS XXX */ > if (bootverbose) > - device_printf(dev, "No signature, asuming disk device\n"); > + device_printf(dev, "Unknown signature, asuming disk device\n"); > ch->devices = ATA_ATA_MASTER; > } Spelling is wrong here (and was before you changed it too): should be "assuming" not "asuming" Gavin From owner-svn-src-head@FreeBSD.ORG Mon Feb 23 08:19:30 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80BCB1065670; Mon, 23 Feb 2009 08:19:30 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6F7748FC1F; Mon, 23 Feb 2009 08:19:30 +0000 (UTC) (envelope-from mav@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 n1N8JUJK018809; Mon, 23 Feb 2009 08:19:30 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1N8JUO3018807; Mon, 23 Feb 2009 08:19:30 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200902230819.n1N8JUO3018807@svn.freebsd.org> From: Alexander Motin Date: Mon, 23 Feb 2009 08:19:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188935 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2009 08:19:31 -0000 Author: mav Date: Mon Feb 23 08:19:30 2009 New Revision: 188935 URL: http://svn.freebsd.org/changeset/base/188935 Log: Fix spelling. Submitted by: gavin Modified: head/sys/dev/ata/chipsets/ata-ahci.c head/sys/dev/ata/chipsets/ata-promise.c Modified: head/sys/dev/ata/chipsets/ata-ahci.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-ahci.c Mon Feb 23 07:33:29 2009 (r188934) +++ head/sys/dev/ata/chipsets/ata-ahci.c Mon Feb 23 08:19:30 2009 (r188935) @@ -778,7 +778,7 @@ ata_ahci_reset(device_t dev) break; default: /* SOS XXX */ if (bootverbose) - device_printf(dev, "Unknown signature, asuming disk device\n"); + device_printf(dev, "Unknown signature, assuming disk device\n"); ch->devices = ATA_ATA_MASTER; } if (bootverbose) Modified: head/sys/dev/ata/chipsets/ata-promise.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-promise.c Mon Feb 23 07:33:29 2009 (r188934) +++ head/sys/dev/ata/chipsets/ata-promise.c Mon Feb 23 08:19:30 2009 (r188935) @@ -822,7 +822,7 @@ ata_promise_mio_reset(device_t dev) default: /* SOS XXX */ if (bootverbose) device_printf(dev, - "No signature, asuming disk device\n"); + "No signature, assuming disk device\n"); ch->devices = ATA_ATA_MASTER; } if (bootverbose) From owner-svn-src-head@FreeBSD.ORG Mon Feb 23 08:25:05 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA134106566B; Mon, 23 Feb 2009 08:25:05 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from cmail.optima.ua (cmail.optima.ua [195.248.191.121]) by mx1.freebsd.org (Postfix) with ESMTP id EE5308FC14; Mon, 23 Feb 2009 08:25:04 +0000 (UTC) (envelope-from mav@FreeBSD.org) X-Spam-Flag: SKIP X-Spam-Yversion: Spamooborona-2.1.0 Received: from orphanage.alkar.net (account mav@alkar.net [212.86.226.11] verified) by cmail.optima.ua (CommuniGate Pro SMTP 5.2.9) with ESMTPA id 235492778; Mon, 23 Feb 2009 10:25:03 +0200 Message-ID: <49A25D5F.4080402@FreeBSD.org> Date: Mon, 23 Feb 2009 10:25:03 +0200 From: Alexander Motin User-Agent: Thunderbird 2.0.0.14 (X11/20080612) MIME-Version: 1.0 To: Gavin Atkinson References: <200902221408.n1ME8K6n098261@svn.freebsd.org> <20090223080900.Q86550@ury.york.ac.uk> In-Reply-To: <20090223080900.Q86550@ury.york.ac.uk> X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r188918 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2009 08:25:06 -0000 Gavin Atkinson wrote: > On Sun, 22 Feb 2009, Alexander Motin wrote: > >> Author: mav >> Date: Sun Feb 22 14:08:20 2009 >> New Revision: 188918 >> URL: http://svn.freebsd.org/changeset/base/188918 >> >> Log: >> Tune AHCI verbose messages to make log more readable. >> > [snip] >> @@ -665,9 +670,10 @@ ata_ahci_softreset(device_t dev, int por >> //ctp->cfis[7] = ATA_D_LBA | ATA_D_IBM; >> ctp->cfis[15] = (ATA_A_4BIT | ATA_A_RESET); >> >> - if (ata_ahci_issue_cmd(dev, ATA_AHCI_CMD_RESET | >> ATA_AHCI_CMD_CLR_BUSY,100)) >> - device_printf(dev, "setting SRST failed ??\n"); >> - //return -1; >> + if (ata_ahci_issue_cmd(dev, ATA_AHCI_CMD_RESET | >> ATA_AHCI_CMD_CLR_BUSY,100)) { >> + device_printf(dev, "software reset set timeout\n"); >> + return (-1); >> + } >> > > Was the uncommenting of the return intentional here? Before, the code > would continue to clear the soft reset even if it didn't appear to have > worked. It was. It shouldn't happen now. Linux does the same. >> @@ -767,11 +778,11 @@ ata_ahci_reset(device_t dev) >> break; >> default: /* SOS XXX */ >> if (bootverbose) >> - device_printf(dev, "No signature, asuming disk device\n"); >> + device_printf(dev, "Unknown signature, asuming disk device\n"); >> ch->devices = ATA_ATA_MASTER; >> } > > Spelling is wrong here (and was before you changed it too): should be > "assuming" not "asuming" Thanks! Fixed. -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Mon Feb 23 08:58:29 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E380106566B; Mon, 23 Feb 2009 08:58:29 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8D4C48FC0A; Mon, 23 Feb 2009 08:58:29 +0000 (UTC) (envelope-from mav@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 n1N8wTa9019624; Mon, 23 Feb 2009 08:58:29 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1N8wTQw019623; Mon, 23 Feb 2009 08:58:29 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200902230858.n1N8wTQw019623@svn.freebsd.org> From: Alexander Motin Date: Mon, 23 Feb 2009 08:58:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188936 - head/sys/dev/ata X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2009 08:58:30 -0000 Author: mav Date: Mon Feb 23 08:58:29 2009 New Revision: 188936 URL: http://svn.freebsd.org/changeset/base/188936 Log: Do not call devices probe/attach if there is nothing new was found. Modified: head/sys/dev/ata/ata-all.c Modified: head/sys/dev/ata/ata-all.c ============================================================================== --- head/sys/dev/ata/ata-all.c Mon Feb 23 08:19:30 2009 (r188935) +++ head/sys/dev/ata/ata-all.c Mon Feb 23 08:58:29 2009 (r188936) @@ -722,6 +722,10 @@ ata_identify(device_t dev) /* Create new devices. */ if (bootverbose) device_printf(dev, "New devices: %08x\n", n); + if (n == 0) { + mtx_unlock(&Giant); + return (0); + } for (i = 0; i < ATA_PM; ++i) { if (n & (((ATA_ATA_MASTER | ATA_ATAPI_MASTER) << i))) { int unit = -1; From owner-svn-src-head@FreeBSD.ORG Mon Feb 23 15:34:20 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0DD81065672; Mon, 23 Feb 2009 15:34:20 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 8D9F78FC18; Mon, 23 Feb 2009 15:34:20 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (pool-98-109-39-197.nwrknj.fios.verizon.net [98.109.39.197]) by cyrus.watson.org (Postfix) with ESMTPSA id 189C746B51; Mon, 23 Feb 2009 10:34:20 -0500 (EST) Received: from localhost (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id n1NFY2kq016392; Mon, 23 Feb 2009 10:34:14 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Robert Watson Date: Mon, 23 Feb 2009 10:02:58 -0500 User-Agent: KMail/1.9.7 References: <200902192210.n1JMAddn009074@svn.freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200902231002.59036.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Mon, 23 Feb 2009 10:34:14 -0500 (EST) X-Virus-Scanned: ClamAV 0.94.2/9031/Mon Feb 23 08:19:18 2009 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r188831 - head/sys/nfsclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2009 15:34:21 -0000 On Saturday 21 February 2009 3:47:50 am Robert Watson wrote: > On Thu, 19 Feb 2009, John Baldwin wrote: > > > Author: jhb > > Date: Thu Feb 19 22:10:39 2009 > > New Revision: 188831 > > URL: http://svn.freebsd.org/changeset/base/188831 > > > > Log: > > Don't clear the attribute cache of a file when it is closed. A subsequent > > open() of the same file will load fresh attributes, so they do not need to > > be explicitly flushed in close() to guarantee close to open consistency. > > However, other file desciptors may still reference this file and clearing > > the attributes in close() forces those other file descriptors to fetch > > fresh attributes the next time they need them. > > (hand wave) Not an area of expertise for me, but I was under the loose > impression that one of the reasons for this refresh was to pull in new > timestamps, etc so that applications using file attributes to track > modification time, size, etc definitely saw the right thing reflecting the > server interpretation of all the pending writes having been flushed back on > close(). (more hand waving) I believe that a client always sees updates it performs, so it will always see any updates that result from a write() call that happens before the close(). The only attribute updates that would not now be seen in between a close() and open() are updates made by another client. However, this is "normal" for NFS and matches what happens while a file is opened. What close-to-open requires is that the client have "fresh" attributes when open() is called. It does not make any guarantees about attributes after a close() and before an open(). -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Feb 23 15:34:28 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A36D710656CE; Mon, 23 Feb 2009 15:34:28 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 736C28FC21; Mon, 23 Feb 2009 15:34:28 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (pool-98-109-39-197.nwrknj.fios.verizon.net [98.109.39.197]) by cyrus.watson.org (Postfix) with ESMTPSA id 046E946B23; Mon, 23 Feb 2009 10:34:27 -0500 (EST) Received: from localhost (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id n1NFY2kr016392; Mon, 23 Feb 2009 10:34:22 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Scott Long Date: Mon, 23 Feb 2009 10:10:44 -0500 User-Agent: KMail/1.9.7 References: <200902192218.n1JMI1HF009245@svn.freebsd.org> <499DF860.8020903@samsco.org> In-Reply-To: <499DF860.8020903@samsco.org> MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200902231010.45511.jhb@freebsd.org> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Mon, 23 Feb 2009 10:34:22 -0500 (EST) X-Virus-Scanned: ClamAV 0.94.2/9031/Mon Feb 23 08:19:18 2009 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r188832 - head/sys/nfsclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2009 15:34:29 -0000 On Thursday 19 February 2009 7:25:04 pm Scott Long wrote: > John Baldwin wrote: > > Author: jhb > > Date: Thu Feb 19 22:18:00 2009 > > New Revision: 188832 > > URL: http://svn.freebsd.org/changeset/base/188832 > > > > Log: > > When fetching attributes for a file for NFSv3 mounts, do not perform an > > opportunistic ACCESS RPC to populate both the access and attribute caches > > of the file and instead always use a GETATTR RPC. On many modern NFS > > servers, an ACCESS RPC is much more expensive to service than a GETATTR > > RPC. > > > > Not too long ago, this was a very useful and important optimization. > Can you say which servers this applies to? Could it have been made an > option instead of outright deleted? I know this applies to at least some Net-Apps. I could certainly restore the access priming under a sysctl however. Something like this: --- //depot/projects/smpng/sys/nfsclient/nfs_vnops.c 2009/02/20 15:11:39 +++ //depot/user/jhb/lock/nfsclient/nfs_vnops.c 2009/02/23 15:09:16 @@ -208,6 +208,11 @@ SYSCTL_INT(_vfs_nfs, OID_AUTO, access_cache_timeout, CTLFLAG_RW, &nfsaccess_cache_timeout, 0, "NFS ACCESS cache timeout"); +static int nfs_prime_access_cache = 0; +SYSCTL_INT(_vfs_nfs, OID_AUTO, prime_access_cache, CTLFLAG_RW, + &nfs_prime_access_cache, 0, + "Prime NFS ACCESS cache when fetching attributes"); + static int nfsv3_commit_on_close = 0; SYSCTL_INT(_vfs_nfs, OID_AUTO, nfsv3_commit_on_close, CTLFLAG_RW, &nfsv3_commit_on_close, 0, "write+commit on close, else only write"); @@ -644,6 +649,12 @@ */ if (nfs_getattrcache(vp, &vattr) == 0) goto nfsmout; + if (v3 && nfs_prime_access_cache && nfsaccess_cache_timeout > 0) { + nfsstats.accesscache_misses++; + nfs3_access_otw(vp, NFSV3ACCESS_ALL, td, ap->a_cred); + if (nfs_getattrcache(vp, &vattr) == 0) + goto nfsmout; + } nfsstats.rpccnt[NFSPROC_GETATTR]++; mreq = nfsm_reqhead(vp, NFSPROC_GETATTR, NFSX_FH(v3)); mb = mreq; -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Feb 23 15:34:35 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9BC31065752; Mon, 23 Feb 2009 15:34:35 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 0E5928FC16; Mon, 23 Feb 2009 15:34:34 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (pool-98-109-39-197.nwrknj.fios.verizon.net [98.109.39.197]) by cyrus.watson.org (Postfix) with ESMTPSA id 9458B46B55; Mon, 23 Feb 2009 10:34:33 -0500 (EST) Received: from localhost (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id n1NFY2ks016392; Mon, 23 Feb 2009 10:34:27 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Scott Long Date: Mon, 23 Feb 2009 10:19:50 -0500 User-Agent: KMail/1.9.7 References: <200902192228.n1JMSn2Q009472@svn.freebsd.org> <200902191739.46808.jhb@freebsd.org> <499DF89A.2030703@samsco.org> In-Reply-To: <499DF89A.2030703@samsco.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200902231019.51340.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Mon, 23 Feb 2009 10:34:27 -0500 (EST) X-Virus-Scanned: ClamAV 0.94.2/9031/Mon Feb 23 08:19:18 2009 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r188833 - in head/sys: kern nfsclient sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2009 15:34:41 -0000 On Thursday 19 February 2009 7:26:02 pm Scott Long wrote: > John Baldwin wrote: > > On Thursday 19 February 2009 5:28:49 pm John Baldwin wrote: > >> Author: jhb > >> Date: Thu Feb 19 22:28:48 2009 > >> New Revision: 188833 > >> URL: http://svn.freebsd.org/changeset/base/188833 > >> > >> Log: > >> Enable caching of negative pathname lookups in the NFS client. To avoid > >> stale entries, we save a copy of the directory's modification time when > >> the first negative cache entry was added in the directory's NFS node. > >> When a negative cache entry is hit during a pathname lookup, the parent > >> directory's modification time is checked. If it has changed, all of the > >> negative cache entries for that parent are purged and the lookup falls > >> back to using the RPC. This required adding a new cache_purge_negative() > >> method to the name cache to purge only negative cache entries for a given > >> directory. > >> > >> Submitted by: mohans, Rick Macklem, Ricardo Labiaga @ NetApp > >> Reviewed by: mohans > > > > Together with the previous two changes I measured a 30% drop in the number of > > RPCs for a kernel build (no modules): > > These graphs are fun, but are useless without more information on the > characteristics of the server and the NFS connections. In this case the server was an Isilon. Other folks using similar patches have reported similar results against NetApp filers. My testing was more to do a final sanity check of my tweaking of others patches so they could be integrated into the tree. Note that the primary purpose of the graphs was to show that the difference in RPC counts was statistically meaningful across a run of several tests. Also, note that the graphs are not measuring differences in wall-time, etc. (which could certainly be very sensitive to the server and other factors such as load on the network) but are merely changes in the counts of RPC requests submitted by the client. Since NFS is largely "stateless" without server-to-client callbacks, I presume that the mix of RPC requests submitted by a client are determined mostly by the NFS client rather than the server. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Feb 23 15:38:35 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7F21106564A; Mon, 23 Feb 2009 15:38:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C643A8FC0A; Mon, 23 Feb 2009 15:38:35 +0000 (UTC) (envelope-from jhb@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 n1NFcZw4028915; Mon, 23 Feb 2009 15:38:35 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1NFcZUp028914; Mon, 23 Feb 2009 15:38:35 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200902231538.n1NFcZUp028914@svn.freebsd.org> From: John Baldwin Date: Mon, 23 Feb 2009 15:38:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188937 - head/sys/i386/ibcs2 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2009 15:38:36 -0000 Author: jhb Date: Mon Feb 23 15:38:35 2009 New Revision: 188937 URL: http://svn.freebsd.org/changeset/base/188937 Log: FreeBSD/i386 doesn't include a software FPU emulator anymore, so adjust an iBCS2 syscall to indicate that there is no FPU support at all rather than emulated support if an FPU is not present. Modified: head/sys/i386/ibcs2/ibcs2_sysi86.c Modified: head/sys/i386/ibcs2/ibcs2_sysi86.c ============================================================================== --- head/sys/i386/ibcs2/ibcs2_sysi86.c Mon Feb 23 08:58:29 2009 (r188936) +++ head/sys/i386/ibcs2/ibcs2_sysi86.c Mon Feb 23 15:38:35 2009 (r188937) @@ -60,9 +60,10 @@ ibcs2_sysi86(struct thread *td, struct i case SI86_FPHW: { /* Floating Point information */ int val, error; - if (hw_float) val = IBCS2_FP_387; /* FPU hardware */ - else val = IBCS2_FP_SW; /* FPU emulator */ - + if (hw_float) + val = IBCS2_FP_387; + else + val = IBCS2_FP_NO; if ((error = copyout(&val, args->arg, sizeof(val))) != 0) return error; return 0; From owner-svn-src-head@FreeBSD.ORG Mon Feb 23 15:39:24 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8596106566B; Mon, 23 Feb 2009 15:39:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C30F8FC17; Mon, 23 Feb 2009 15:39:24 +0000 (UTC) (envelope-from jhb@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 n1NFdO7Z028970; Mon, 23 Feb 2009 15:39:24 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1NFdO5O028968; Mon, 23 Feb 2009 15:39:24 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200902231539.n1NFdO5O028968@svn.freebsd.org> From: John Baldwin Date: Mon, 23 Feb 2009 15:39:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188938 - in head/sys: amd64/amd64 i386/isa X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2009 15:39:25 -0000 Author: jhb Date: Mon Feb 23 15:39:24 2009 New Revision: 188938 URL: http://svn.freebsd.org/changeset/base/188938 Log: Some whitespace and style fixes. Submitted by: bde (partly) Modified: head/sys/amd64/amd64/fpu.c head/sys/i386/isa/npx.c Modified: head/sys/amd64/amd64/fpu.c ============================================================================== --- head/sys/amd64/amd64/fpu.c Mon Feb 23 15:38:35 2009 (r188937) +++ head/sys/amd64/amd64/fpu.c Mon Feb 23 15:39:24 2009 (r188938) @@ -98,10 +98,8 @@ typedef u_char bool_t; static void fpu_clean_state(void); -int hw_float = 1; -SYSCTL_INT(_hw,HW_FLOATINGPT, floatingpoint, - CTLFLAG_RD, &hw_float, 0, - "Floatingpoint instructions executed in hardware"); +SYSCTL_INT(_hw, HW_FLOATINGPT, floatingpoint, CTLFLAG_RD, + NULL, 1, "Floating point instructions executed in hardware"); static struct savefpu fpu_cleanstate; static bool_t fpu_cleanstate_ready; Modified: head/sys/i386/isa/npx.c ============================================================================== --- head/sys/i386/isa/npx.c Mon Feb 23 15:38:35 2009 (r188937) +++ head/sys/i386/isa/npx.c Mon Feb 23 15:39:24 2009 (r188938) @@ -167,9 +167,8 @@ static long timezero(const char *funcnam int hw_float; /* XXX currently just alias for npx_exists */ -SYSCTL_INT(_hw,HW_FLOATINGPT, floatingpoint, - CTLFLAG_RD, &hw_float, 0, - "Floatingpoint instructions executed in hardware"); +SYSCTL_INT(_hw, HW_FLOATINGPT, floatingpoint, CTLFLAG_RD, + &hw_float, 0, "Floating point instructions executed in hardware"); static volatile u_int npx_intrs_while_probing; static volatile u_int npx_traps_while_probing; @@ -812,8 +811,8 @@ npxdna() pcb->pcb_flags |= PCB_NPXINITDONE; } else { /* - * The following frstor may cause an IRQ13 when the state - * being restored has a pending error. The error will + * The following fpurstor() may cause an IRQ13 when the + * state being restored has a pending error. The error will * appear to have been triggered by the current (npx) user * instruction even when that instruction is a no-wait * instruction that should not trigger an error (e.g., From owner-svn-src-head@FreeBSD.ORG Mon Feb 23 16:17:54 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A27010656D6; Mon, 23 Feb 2009 16:17:54 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from out2.smtp.messagingengine.com (out2.smtp.messagingengine.com [66.111.4.26]) by mx1.freebsd.org (Postfix) with ESMTP id CFA548FC0C; Mon, 23 Feb 2009 16:17:53 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from compute1.internal (compute1.internal [10.202.2.41]) by out1.messagingengine.com (Postfix) with ESMTP id 548F72A26B6; Mon, 23 Feb 2009 11:17:53 -0500 (EST) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute1.internal (MEProxy); Mon, 23 Feb 2009 11:17:53 -0500 X-Sasl-enc: gVnf49Wc/GxYy06OGJnO2iRXJ1nPhJtf/Dyp29qZjLLO 1235405873 Received: from empiric.lon.incunabulum.net (82-35-112-254.cable.ubr07.dals.blueyonder.co.uk [82.35.112.254]) by mail.messagingengine.com (Postfix) with ESMTPSA id 970CE14185; Mon, 23 Feb 2009 11:17:52 -0500 (EST) Message-ID: <49A2CC2F.9090208@FreeBSD.org> Date: Mon, 23 Feb 2009 16:17:51 +0000 From: "Bruce M. Simpson" User-Agent: Thunderbird 2.0.0.19 (X11/20090126) MIME-Version: 1.0 To: John Baldwin References: <200902231538.n1NFcZUp028914@svn.freebsd.org> In-Reply-To: <200902231538.n1NFcZUp028914@svn.freebsd.org> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r188937 - head/sys/i386/ibcs2 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2009 16:17:56 -0000 John Baldwin wrote: > Log: > FreeBSD/i386 doesn't include a software FPU emulator anymore, so adjust > an iBCS2 syscall to indicate that there is no FPU support at all rather > than emulated support if an FPU is not present. > There are a bunch of x86 like chips out there produced by RDC which do not have a hardware FPU. I had a crack at trying to get FreeBSD to build userland with the softfloat code but didn't get to a working world. Someone else might be interested in picking up on that... From owner-svn-src-head@FreeBSD.ORG Mon Feb 23 17:38:19 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57E6110656E8; Mon, 23 Feb 2009 17:38:19 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by mx1.freebsd.org (Postfix) with ESMTP id 16D498FC1B; Mon, 23 Feb 2009 17:38:19 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from [172.31.193.10] (cpe-075-177-134-250.nc.res.rr.com [75.177.134.250]) (authenticated bits=0) by duke.cs.duke.edu (8.14.2/8.14.2) with ESMTP id n1NHb6rG027969 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 23 Feb 2009 12:37:41 -0500 (EST) X-DKIM: Sendmail DKIM Filter v2.5.3 duke.cs.duke.edu n1NHb6rG027969 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cs.duke.edu; s=mail; t=1235410661; bh=sARNmLcQHNS2oP0mWdTCxQGf1k3VKOIJzjiPwiK2TrI=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=VCEx6/UWCHa1 mZ5fApPo6g0rXXjqXkqSisaMUlgbzGQsWPQgmmnQU6fQ0kh5YocBbMZXm6vKnxszhpK Lf9oIMJIk0QA42IUW3MCgL3M91+xEh3NVp5Ae7AxIqRYHynv4djwmR1mKwosprYGWQn MuKiLt3Kc7hL/UfrtirXm+kT0= Message-ID: <49A2DEBC.9060606@cs.duke.edu> Date: Mon, 23 Feb 2009 12:37:00 -0500 From: Andrew Gallatin User-Agent: Thunderbird 2.0.0.19 (X11/20090105) MIME-Version: 1.0 To: Jeff Roberson References: <200902212315.n1LNFYMc077942@svn.freebsd.org> In-Reply-To: <200902212315.n1LNFYMc077942@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r188904 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2009 17:38:20 -0000 Jeff Roberson wrote: > Author: jeff > Date: Sat Feb 21 23:15:34 2009 > New Revision: 188904 > URL: http://svn.freebsd.org/changeset/base/188904 > > Log: > - Resolve an issue where we may clear an idt while an interrupt on a > different cpu is still assigned to that vector by never clearing idt > entries. This was only provided as a debugging feature and the bugs > are caught by other means. > - Drop the sched lock when rebinding to reassign an interrupt vector > to a new cpu so that pending interrupts have a chance to be delivered > before removing the old vector. Thank you. I can confirm this fixed my "Fatal Trap 30" when unloading drivers. Drew From owner-svn-src-head@FreeBSD.ORG Mon Feb 23 18:16:18 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9ED921065672; Mon, 23 Feb 2009 18:16:18 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 896078FC12; Mon, 23 Feb 2009 18:16:18 +0000 (UTC) (envelope-from thompsa@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 n1NIGIen031918; Mon, 23 Feb 2009 18:16:18 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1NIGHgj031908; Mon, 23 Feb 2009 18:16:17 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902231816.n1NIGHgj031908@svn.freebsd.org> From: Andrew Thompson Date: Mon, 23 Feb 2009 18:16:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188939 - in head: sys/compat/ndis sys/dev/if_ndis sys/dev/usb sys/legacy sys/legacy/dev sys/legacy/dev/usb sys/modules sys/modules/aue sys/modules/axe sys/modules/cdce sys/modules/cue ... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2009 18:16:19 -0000 Author: thompsa Date: Mon Feb 23 18:16:17 2009 New Revision: 188939 URL: http://svn.freebsd.org/changeset/base/188939 Log: Move usb to a graveyard location under sys/legacy/dev, it is intended that the new USB2 stack will fully replace this for 8.0. Remove kernel modules, a subsequent commit will update conf/files. Unhook usbdevs from the build. Added: head/sys/legacy/ head/sys/legacy/dev/ head/sys/legacy/dev/usb/ (props changed) - copied from r188820, head/sys/dev/usb/ Deleted: head/sys/dev/usb/ head/sys/modules/aue/ head/sys/modules/axe/ head/sys/modules/cdce/ head/sys/modules/cue/ head/sys/modules/ehci/ head/sys/modules/kue/ head/sys/modules/ohci/ head/sys/modules/rue/ head/sys/modules/rum/ head/sys/modules/slhci/ head/sys/modules/u3g/ head/sys/modules/uark/ head/sys/modules/ubsa/ head/sys/modules/ucom/ head/sys/modules/udav/ head/sys/modules/udbp/ head/sys/modules/ufm/ head/sys/modules/ufoma/ head/sys/modules/uftdi/ head/sys/modules/ugen/ head/sys/modules/uhci/ head/sys/modules/uhid/ head/sys/modules/uipaq/ head/sys/modules/ukbd/ head/sys/modules/ulpt/ head/sys/modules/umass/ head/sys/modules/umct/ head/sys/modules/umodem/ head/sys/modules/ums/ head/sys/modules/upgt/ head/sys/modules/uplcom/ head/sys/modules/ural/ head/sys/modules/urio/ head/sys/modules/urtw/ head/sys/modules/usb/ head/sys/modules/uscanner/ head/sys/modules/uslcom/ head/sys/modules/uvisor/ head/sys/modules/uvscom/ head/sys/modules/zyd/ Modified: head/sys/compat/ndis/kern_ndis.c head/sys/compat/ndis/kern_windrv.c head/sys/compat/ndis/subr_ndis.c head/sys/compat/ndis/subr_usbd.c head/sys/dev/if_ndis/if_ndis.c head/sys/dev/if_ndis/if_ndis_pccard.c head/sys/dev/if_ndis/if_ndis_pci.c head/sys/dev/if_ndis/if_ndis_usb.c head/sys/modules/Makefile head/usr.sbin/Makefile Modified: head/sys/compat/ndis/kern_ndis.c ============================================================================== --- head/sys/compat/ndis/kern_ndis.c Mon Feb 23 15:39:24 2009 (r188938) +++ head/sys/compat/ndis/kern_ndis.c Mon Feb 23 18:16:17 2009 (r188939) @@ -65,8 +65,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include +#include +#include #include #include Modified: head/sys/compat/ndis/kern_windrv.c ============================================================================== --- head/sys/compat/ndis/kern_windrv.c Mon Feb 23 15:39:24 2009 (r188938) +++ head/sys/compat/ndis/kern_windrv.c Mon Feb 23 18:16:17 2009 (r188939) @@ -56,8 +56,8 @@ __FBSDID("$FreeBSD$"); #include #endif -#include -#include +#include +#include #include #include Modified: head/sys/compat/ndis/subr_ndis.c ============================================================================== --- head/sys/compat/ndis/subr_ndis.c Mon Feb 23 15:39:24 2009 (r188938) +++ head/sys/compat/ndis/subr_ndis.c Mon Feb 23 18:16:17 2009 (r188939) @@ -95,8 +95,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include +#include +#include #include #include Modified: head/sys/compat/ndis/subr_usbd.c ============================================================================== --- head/sys/compat/ndis/subr_usbd.c Mon Feb 23 15:39:24 2009 (r188938) +++ head/sys/compat/ndis/subr_usbd.c Mon Feb 23 18:16:17 2009 (r188939) @@ -56,11 +56,11 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include "usbdevs.h" #include Modified: head/sys/dev/if_ndis/if_ndis.c ============================================================================== --- head/sys/dev/if_ndis/if_ndis.c Mon Feb 23 15:39:24 2009 (r188938) +++ head/sys/dev/if_ndis/if_ndis.c Mon Feb 23 18:16:17 2009 (r188939) @@ -74,8 +74,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include +#include +#include #include #include Modified: head/sys/dev/if_ndis/if_ndis_pccard.c ============================================================================== --- head/sys/dev/if_ndis/if_ndis_pccard.c Mon Feb 23 15:39:24 2009 (r188938) +++ head/sys/dev/if_ndis/if_ndis_pccard.c Mon Feb 23 18:16:17 2009 (r188939) @@ -53,8 +53,8 @@ __FBSDID("$FreeBSD$"); #include -#include -#include +#include +#include #include #include Modified: head/sys/dev/if_ndis/if_ndis_pci.c ============================================================================== --- head/sys/dev/if_ndis/if_ndis_pci.c Mon Feb 23 15:39:24 2009 (r188938) +++ head/sys/dev/if_ndis/if_ndis_pci.c Mon Feb 23 18:16:17 2009 (r188939) @@ -54,8 +54,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include +#include +#include #include #include Modified: head/sys/dev/if_ndis/if_ndis_usb.c ============================================================================== --- head/sys/dev/if_ndis/if_ndis_usb.c Mon Feb 23 15:39:24 2009 (r188938) +++ head/sys/dev/if_ndis/if_ndis_usb.c Mon Feb 23 18:16:17 2009 (r188939) @@ -52,10 +52,10 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include "usbdevs.h" #include Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Mon Feb 23 15:39:24 2009 (r188938) +++ head/sys/modules/Makefile Mon Feb 23 18:16:17 2009 (r188939) @@ -30,9 +30,7 @@ SUBDIR= ${_3dfx} \ ${_asr} \ ata \ ath \ - aue \ ${_auxio} \ - axe \ bce \ bfe \ bge \ @@ -47,7 +45,6 @@ SUBDIR= ${_3dfx} \ ${_cbb} \ cd9660 \ cd9660_iconv \ - cdce \ ${_ce} \ ${_ciss} \ ${_cm} \ @@ -63,7 +60,6 @@ SUBDIR= ${_3dfx} \ ${_cryptodev} \ ${_cs} \ ${_ctau} \ - cue \ cxgb \ ${_cyclic} \ dc \ @@ -76,7 +72,6 @@ SUBDIR= ${_3dfx} \ ${_dtrace} \ dummynet \ ${_ed} \ - ehci \ ${_elink} \ ${_em} \ en \ @@ -145,7 +140,6 @@ SUBDIR= ${_3dfx} \ ${_k8temp} \ kbdmux \ krpc \ - kue \ le \ lge \ libalias \ @@ -205,7 +199,6 @@ SUBDIR= ${_3dfx} \ ${_nwfs} \ ${_nxge} \ ${_opensolaris} \ - ohci \ ${_padlock} \ patm \ ${_pccard} \ @@ -232,8 +225,6 @@ SUBDIR= ${_3dfx} \ re \ reiserfs \ rl \ - rue \ - rum \ ${_s3} \ ${_safe} \ ${_sbni} \ @@ -243,7 +234,6 @@ SUBDIR= ${_3dfx} \ sdhci \ sem \ sf \ - slhci \ sis \ sk \ ${_smbfs} \ @@ -271,43 +261,13 @@ SUBDIR= ${_3dfx} \ twe \ tx \ txp \ - u3g \ - uark \ uart \ - ubsa \ ubsec \ - ucom \ - udav \ - udbp \ udf \ udf_iconv \ - ufm \ ${_ufs} \ - ufoma \ - uftdi \ - ugen \ - uhci \ - uhid \ - uipaq \ - ukbd \ - ulpt \ - umass \ - umct \ - umodem \ - ums \ unionfs \ - ${_upgt} \ - uplcom \ - ural \ - urio \ - ${_urtw} \ - usb \ - usb2 \ - uscanner \ - uslcom \ utopia \ - uvisor \ - uvscom \ ${_vesa} \ vge \ vkbd \ @@ -331,7 +291,6 @@ SUBDIR= ${_3dfx} \ xl \ ${_zfs} \ zlib \ - zyd .if ${MACHINE_ARCH} != "powerpc" _syscons= syscons @@ -440,8 +399,6 @@ _stg= stg _streams= streams _svr4= svr4 _tmpfs= tmpfs -_upgt= upgt -_urtw= urtw _wi= wi _xe= xe .if ${MK_ZFS} != "no" || defined(ALL_MODULES) @@ -572,8 +529,6 @@ _speaker= speaker _sppp= sppp _tmpfs= tmpfs _twa= twa -_upgt= upgt -_urtw= urtw _wi= wi _wpi= wpi _wpifw= wpifw @@ -624,7 +579,6 @@ _an= an _bm= bm _nvram= powermac_nvram _smbfs= smbfs -_upgt= upgt .endif .if ${MACHINE_ARCH} == "sparc64" @@ -633,7 +587,6 @@ _em= em _i2c= i2c _igb= igb _sound= sound -_upgt= upgt .if ${MK_ZFS} != "no" || defined(ALL_MODULES) _zfs= zfs .endif Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Mon Feb 23 15:39:24 2009 (r188938) +++ head/usr.sbin/Makefile Mon Feb 23 18:16:17 2009 (r188939) @@ -406,7 +406,7 @@ _crunch= crunch .endif .if ${MK_USB} != "no" -_usbdevs= usbdevs +#_usbdevs= usbdevs _usbconfig= usbconfig .endif From owner-svn-src-head@FreeBSD.ORG Mon Feb 23 18:22:07 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 500C3106564A; Mon, 23 Feb 2009 18:22:07 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3E99F8FC1F; Mon, 23 Feb 2009 18:22:07 +0000 (UTC) (envelope-from emaste@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 n1NIM7LD032143; Mon, 23 Feb 2009 18:22:07 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1NIM7mj032142; Mon, 23 Feb 2009 18:22:07 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <200902231822.n1NIM7mj032142@svn.freebsd.org> From: Ed Maste Date: Mon, 23 Feb 2009 18:22:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188940 - head/sys/dev/aac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2009 18:22:07 -0000 Author: emaste Date: Mon Feb 23 18:22:06 2009 New Revision: 188940 URL: http://svn.freebsd.org/changeset/base/188940 Log: SVN rev 188743 modified aac_rx_get_fwstatus to use the AAC_RX_OMR0 register instead of AAC_RX_FWSTATUS, as that is the way it's done in Adaptec's vendor driver and in the Linux drivers. (The same applies to aac_rkt_get_fwstatus as well.) However, a concern has been raised about the compatibility of this change and old hardware / firmware versions. In the absense of specific information, revert to the original behaviour if the firmware does not support the "New comm." interface. Users of old cards or firmware haven't reported the problems that are potentially solved by switching to OMR0. Modified: head/sys/dev/aac/aac.c Modified: head/sys/dev/aac/aac.c ============================================================================== --- head/sys/dev/aac/aac.c Mon Feb 23 18:16:17 2009 (r188939) +++ head/sys/dev/aac/aac.c Mon Feb 23 18:22:06 2009 (r188940) @@ -2416,7 +2416,8 @@ aac_rx_get_fwstatus(struct aac_softc *sc { fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - return(AAC_MEM0_GETREG4(sc, AAC_RX_OMR0)); + return(AAC_MEM0_GETREG4(sc, sc->flags & AAC_FLAGS_NEW_COMM ? + AAC_RX_OMR0 : AAC_RX_FWSTATUS)); } static int @@ -2435,7 +2436,8 @@ aac_rkt_get_fwstatus(struct aac_softc *s { fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - return(AAC_MEM0_GETREG4(sc, AAC_RKT_OMR0)); + return(AAC_MEM0_GETREG4(sc, sc->flags & AAC_FLAGS_NEW_COMM ? + AAC_RKT_OMR0 : AAC_RKT_FWSTATUS)); } /* From owner-svn-src-head@FreeBSD.ORG Mon Feb 23 18:22:50 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 737061065679; Mon, 23 Feb 2009 18:22:50 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 602208FC25; Mon, 23 Feb 2009 18:22:50 +0000 (UTC) (envelope-from raj@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 n1NIMor0032192; Mon, 23 Feb 2009 18:22:50 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1NIMoPN032186; Mon, 23 Feb 2009 18:22:50 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <200902231822.n1NIMoPN032186@svn.freebsd.org> From: Rafal Jaworowski Date: Mon, 23 Feb 2009 18:22:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188941 - in head: . gnu/usr.bin/gdb gnu/usr.bin/gdb/gdbserver X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2009 18:22:51 -0000 Author: raj Date: Mon Feb 23 18:22:49 2009 New Revision: 188941 URL: http://svn.freebsd.org/changeset/base/188941 Log: Initial gdbserver support for PowerPC. Obtained from: Juniper Networks, Semihalf Added: head/gnu/usr.bin/gdb/gdbserver/fbsd-ppc-low.c (contents, props changed) head/gnu/usr.bin/gdb/gdbserver/reg-ppc.c (contents, props changed) Modified: head/ObsoleteFiles.inc head/gnu/usr.bin/gdb/Makefile head/gnu/usr.bin/gdb/gdbserver/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon Feb 23 18:22:06 2009 (r188940) +++ head/ObsoleteFiles.inc Mon Feb 23 18:22:49 2009 (r188941) @@ -1674,7 +1674,7 @@ OLD_FILES+=usr/lib/libpam_ssh.a OLD_FILES+=usr/lib/libpam_ssh_p.a OLD_FILES+=usr/bin/help OLD_FILES+=usr/bin/sccs -.if ${TARGET_ARCH} != "arm" && ${TARGET_ARCH} != "i386" +.if ${TARGET_ARCH} != "arm" && ${TARGET_ARCH} != "i386" && ${TARGET_ARCH} != "powerpc" OLD_FILES+=usr/bin/gdbserver .endif OLD_FILES+=usr/bin/ssh-keysign Modified: head/gnu/usr.bin/gdb/Makefile ============================================================================== --- head/gnu/usr.bin/gdb/Makefile Mon Feb 23 18:22:06 2009 (r188940) +++ head/gnu/usr.bin/gdb/Makefile Mon Feb 23 18:22:49 2009 (r188941) @@ -2,7 +2,7 @@ SUBDIR= doc libgdb gdb gdbtui kgdb -.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "arm" +.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "arm" || ${MACHINE_ARCH} == "powerpc" SUBDIR+=gdbserver .endif Modified: head/gnu/usr.bin/gdb/gdbserver/Makefile ============================================================================== --- head/gnu/usr.bin/gdb/gdbserver/Makefile Mon Feb 23 18:22:06 2009 (r188940) +++ head/gnu/usr.bin/gdb/gdbserver/Makefile Mon Feb 23 18:22:49 2009 (r188941) @@ -22,6 +22,10 @@ SRCS+= fbsd-i386-low.c i387-fp.c reg-i38 SRCS+= fbsd-arm-low.c reg-arm.c .endif +.if ${MACHINE_ARCH} == "powerpc" +SRCS+= fbsd-ppc-low.c reg-ppc.c +.endif + #CFLAGS+= -I${.CURDIR}/../arch/${MACHINE_ARCH} CFLAGS+= -I${GDBDIR}/gdb/gdbserver CFLAGS+= -I${GDBDIR}/gdb/regformats Added: head/gnu/usr.bin/gdb/gdbserver/fbsd-ppc-low.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/gnu/usr.bin/gdb/gdbserver/fbsd-ppc-low.c Mon Feb 23 18:22:49 2009 (r188941) @@ -0,0 +1,156 @@ +/* FreeBSD/PowerPC specific low level interface, for the remote server for + GDB. + Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002 + Free Software Foundation, Inc. + + This file is part of GDB. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include +__FBSDID("$FreeBSD$"); + +#include "server.h" +#include "fbsd-low.h" + +#include +#include + +#define ppc_num_regs 71 + +/* Currently, don't check/send MQ. */ +static int ppc_regmap[] = + { 0, 4, 8, 12, 16, 20, 24, 28, + 32, 36, 40, 44, 48, 52, 56, 60, + 64, 68, 72, 76, 80, 84, 88, 92, + 96, 100, 104, 108, 112, 116, 120, 124, +#if 0 + /* + * XXX on FreeBSD the gdbserver for PowerPC was only tested with FPU-less + * cores i.e. e500. Let's leave the original FPR references around in case + * someone picks up and brings support for AIM-like FPU machines. + */ + PT_FPR0*4, PT_FPR0*4 + 8, PT_FPR0*4+16, PT_FPR0*4+24, + PT_FPR0*4+32, PT_FPR0*4+40, PT_FPR0*4+48, PT_FPR0*4+56, + PT_FPR0*4+64, PT_FPR0*4+72, PT_FPR0*4+80, PT_FPR0*4+88, + PT_FPR0*4+96, PT_FPR0*4+104, PT_FPR0*4+112, PT_FPR0*4+120, + PT_FPR0*4+128, PT_FPR0*4+136, PT_FPR0*4+144, PT_FPR0*4+152, + PT_FPR0*4+160, PT_FPR0*4+168, PT_FPR0*4+176, PT_FPR0*4+184, + PT_FPR0*4+192, PT_FPR0*4+200, PT_FPR0*4+208, PT_FPR0*4+216, + PT_FPR0*4+224, PT_FPR0*4+232, PT_FPR0*4+240, PT_FPR0*4+248, +#endif + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + 144, -1, 132, 128, 140, 136, -1 + }; + +static int +ppc_cannot_store_register (int regno) +{ + /* Some kernels do not allow us to store fpscr. */ + if (regno == find_regno ("fpscr")) + return 2; + + return 0; +} + +static int +ppc_cannot_fetch_register (int regno) +{ + return 0; +} + +static CORE_ADDR +ppc_get_pc (void) +{ + unsigned long pc; + + collect_register_by_name ("pc", &pc); + return (CORE_ADDR) pc; +} + +static void +ppc_set_pc (CORE_ADDR pc) +{ + unsigned long newpc = pc; + + supply_register_by_name ("pc", &newpc); +} + +/* Correct in either endianness. Note that this file is + for PowerPC only, not PowerPC64. + This instruction is "twge r2, r2", which GDB uses as a software + breakpoint. */ +static const unsigned long ppc_breakpoint = 0x7d821008; +#define ppc_breakpoint_len 4 + +static int +ppc_breakpoint_at (CORE_ADDR where) +{ + unsigned long insn; + + (*the_target->read_memory) (where, (char *) &insn, 4); + if (insn == ppc_breakpoint) + return 1; + /* If necessary, recognize more trap instructions here. GDB only uses the + one. */ + return 0; +} + +static void +ppc_fill_gregset (void *buf) +{ + int i; + + for (i = 0; i < ppc_num_regs; i++) + if (ppc_regmap[i] != -1) + collect_register (i, ((char *) buf) + ppc_regmap[i]); + +} + +static void +ppc_store_gregset (const void *buf) +{ + int i; + + for (i = 0; i < ppc_num_regs; i++) + if (ppc_regmap[i] != -1) + supply_register (i, ((char *) buf) + ppc_regmap[i]); + +} + +struct regset_info target_regsets[] = { + { PT_GETREGS, PT_SETREGS, sizeof (struct reg), + GENERAL_REGS, + ppc_fill_gregset, ppc_store_gregset }, + { 0, 0, -1, -1, NULL, NULL } +}; + +struct fbsd_target_ops the_low_target = { + ppc_num_regs, + ppc_regmap, + ppc_cannot_fetch_register, + ppc_cannot_store_register, + ppc_get_pc, + ppc_set_pc, + (const char *) &ppc_breakpoint, + ppc_breakpoint_len, + NULL, + 0, + ppc_breakpoint_at, +}; Added: head/gnu/usr.bin/gdb/gdbserver/reg-ppc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/gnu/usr.bin/gdb/gdbserver/reg-ppc.c Mon Feb 23 18:22:49 2009 (r188941) @@ -0,0 +1,113 @@ +/* *INDENT-OFF* */ /* THIS FILE IS GENERATED */ + +/* A register protocol for GDB, the GNU debugger. + Copyright 2001, 2002 Free Software Foundation, Inc. + + This file is part of GDB. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* This file was created with the aid of ``regdat.sh'' and ``../../../../contrib/gdb/gdb/regformats/reg-ppc.dat''. */ + +#include +__FBSDID("$FreeBSD$"); + +#include "regdef.h" +#include "regcache.h" + +struct reg regs_ppc[] = { + { "r0", 0, 32 }, + { "r1", 32, 32 }, + { "r2", 64, 32 }, + { "r3", 96, 32 }, + { "r4", 128, 32 }, + { "r5", 160, 32 }, + { "r6", 192, 32 }, + { "r7", 224, 32 }, + { "r8", 256, 32 }, + { "r9", 288, 32 }, + { "r10", 320, 32 }, + { "r11", 352, 32 }, + { "r12", 384, 32 }, + { "r13", 416, 32 }, + { "r14", 448, 32 }, + { "r15", 480, 32 }, + { "r16", 512, 32 }, + { "r17", 544, 32 }, + { "r18", 576, 32 }, + { "r19", 608, 32 }, + { "r20", 640, 32 }, + { "r21", 672, 32 }, + { "r22", 704, 32 }, + { "r23", 736, 32 }, + { "r24", 768, 32 }, + { "r25", 800, 32 }, + { "r26", 832, 32 }, + { "r27", 864, 32 }, + { "r28", 896, 32 }, + { "r29", 928, 32 }, + { "r30", 960, 32 }, + { "r31", 992, 32 }, + { "f0", 1024, 64 }, + { "f1", 1088, 64 }, + { "f2", 1152, 64 }, + { "f3", 1216, 64 }, + { "f4", 1280, 64 }, + { "f5", 1344, 64 }, + { "f6", 1408, 64 }, + { "f7", 1472, 64 }, + { "f8", 1536, 64 }, + { "f9", 1600, 64 }, + { "f10", 1664, 64 }, + { "f11", 1728, 64 }, + { "f12", 1792, 64 }, + { "f13", 1856, 64 }, + { "f14", 1920, 64 }, + { "f15", 1984, 64 }, + { "f16", 2048, 64 }, + { "f17", 2112, 64 }, + { "f18", 2176, 64 }, + { "f19", 2240, 64 }, + { "f20", 2304, 64 }, + { "f21", 2368, 64 }, + { "f22", 2432, 64 }, + { "f23", 2496, 64 }, + { "f24", 2560, 64 }, + { "f25", 2624, 64 }, + { "f26", 2688, 64 }, + { "f27", 2752, 64 }, + { "f28", 2816, 64 }, + { "f29", 2880, 64 }, + { "f30", 2944, 64 }, + { "f31", 3008, 64 }, + { "pc", 3072, 32 }, + { "ps", 3104, 32 }, + { "cr", 3136, 32 }, + { "lr", 3168, 32 }, + { "ctr", 3200, 32 }, + { "xer", 3232, 32 }, + { "fpscr", 3264, 32 }, +}; + +const char *expedite_regs_ppc[] = { "r1", "pc", 0 }; + +void +init_registers () +{ + set_register_cache (regs_ppc, + sizeof (regs_ppc) / sizeof (regs_ppc[0])); + gdbserver_expedite_regs = expedite_regs_ppc; +} From owner-svn-src-head@FreeBSD.ORG Mon Feb 23 18:31:01 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC09D1065676; Mon, 23 Feb 2009 18:31:01 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C249B8FC12; Mon, 23 Feb 2009 18:31:01 +0000 (UTC) (envelope-from thompsa@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 n1NIV1M4032389; Mon, 23 Feb 2009 18:31:01 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1NIV1tj032376; Mon, 23 Feb 2009 18:31:01 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902231831.n1NIV1tj032376@svn.freebsd.org> From: Andrew Thompson Date: Mon, 23 Feb 2009 18:31:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188942 - in head/sys/dev: usb usb/bluetooth usb/controller usb/image usb/input usb/misc usb/net usb/quirk usb/serial usb/sound usb/storage usb/template usb/wlan usb2 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2009 18:31:03 -0000 Author: thompsa Date: Mon Feb 23 18:31:00 2009 New Revision: 188942 URL: http://svn.freebsd.org/changeset/base/188942 Log: Move the new USB stack into its new home. Added: head/sys/dev/usb/ head/sys/dev/usb/README.TXT (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/core/README.TXT head/sys/dev/usb/bluetooth/ head/sys/dev/usb/bluetooth/TODO.TXT (props changed) - copied unchanged from r188941, head/sys/dev/usb2/bluetooth/TODO.TXT head/sys/dev/usb/bluetooth/ng_ubt.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/bluetooth/ng_ubt2.c head/sys/dev/usb/bluetooth/ng_ubt_var.h (props changed) - copied unchanged from r188941, head/sys/dev/usb2/bluetooth/ng_ubt2_var.h head/sys/dev/usb/bluetooth/ubtbcmfw.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/bluetooth/ubtbcmfw2.c head/sys/dev/usb/controller/ head/sys/dev/usb/controller/at91dci.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/controller/at91dci.c head/sys/dev/usb/controller/at91dci.h (props changed) - copied unchanged from r188941, head/sys/dev/usb2/controller/at91dci.h head/sys/dev/usb/controller/at91dci_atmelarm.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/controller/at91dci_atmelarm.c head/sys/dev/usb/controller/atmegadci.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/controller/atmegadci.c head/sys/dev/usb/controller/atmegadci.h (props changed) - copied unchanged from r188941, head/sys/dev/usb2/controller/atmegadci.h head/sys/dev/usb/controller/atmegadci_atmelarm.c (props changed) - copied unchanged from r188941, head/sys/dev/usb2/controller/atmegadci_atmelarm.c head/sys/dev/usb/controller/ehci.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/controller/ehci2.c head/sys/dev/usb/controller/ehci.h (props changed) - copied unchanged from r188941, head/sys/dev/usb2/controller/ehci2.h head/sys/dev/usb/controller/ehci_ixp4xx.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/controller/ehci2_ixp4xx.c head/sys/dev/usb/controller/ehci_mbus.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/controller/ehci2_mbus.c head/sys/dev/usb/controller/ehci_pci.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/controller/ehci2_pci.c head/sys/dev/usb/controller/musb_otg.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/controller/musb2_otg.c head/sys/dev/usb/controller/musb_otg.h (props changed) - copied unchanged from r188941, head/sys/dev/usb2/controller/musb2_otg.h head/sys/dev/usb/controller/musb_otg_atmelarm.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/controller/musb2_otg_atmelarm.c head/sys/dev/usb/controller/ohci.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/controller/ohci2.c head/sys/dev/usb/controller/ohci.h (props changed) - copied unchanged from r188941, head/sys/dev/usb2/controller/ohci2.h head/sys/dev/usb/controller/ohci_atmelarm.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/controller/ohci2_atmelarm.c head/sys/dev/usb/controller/ohci_pci.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/controller/ohci2_pci.c head/sys/dev/usb/controller/uhci.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/controller/uhci2.c head/sys/dev/usb/controller/uhci.h (props changed) - copied unchanged from r188941, head/sys/dev/usb2/controller/uhci2.h head/sys/dev/usb/controller/uhci_pci.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/controller/uhci2_pci.c head/sys/dev/usb/controller/usb_controller.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/controller/usb2_controller.c head/sys/dev/usb/controller/uss820dci.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/controller/uss820dci.c head/sys/dev/usb/controller/uss820dci.h (props changed) - copied unchanged from r188941, head/sys/dev/usb2/controller/uss820dci.h head/sys/dev/usb/controller/uss820dci_atmelarm.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/controller/uss820dci_atmelarm.c head/sys/dev/usb/image/ head/sys/dev/usb/image/uscanner.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/image/uscanner2.c head/sys/dev/usb/input/ head/sys/dev/usb/input/uhid.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/input/uhid2.c head/sys/dev/usb/input/ukbd.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/input/ukbd2.c head/sys/dev/usb/input/ums.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/input/ums2.c head/sys/dev/usb/input/usb_rdesc.h (props changed) - copied unchanged from r188941, head/sys/dev/usb2/input/usb2_rdesc.h head/sys/dev/usb/misc/ head/sys/dev/usb/misc/udbp.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/misc/udbp2.c head/sys/dev/usb/misc/udbp.h (props changed) - copied unchanged from r188941, head/sys/dev/usb2/misc/udbp2.h head/sys/dev/usb/misc/ufm.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/misc/ufm2.c head/sys/dev/usb/net/ head/sys/dev/usb/net/if_aue.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/ethernet/if_aue2.c head/sys/dev/usb/net/if_auereg.h - copied unchanged from r188941, head/sys/dev/usb2/ethernet/if_auereg.h head/sys/dev/usb/net/if_axe.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/ethernet/if_axe2.c head/sys/dev/usb/net/if_axereg.h - copied unchanged from r188941, head/sys/dev/usb2/ethernet/if_axereg.h head/sys/dev/usb/net/if_cdce.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/ethernet/if_cdce2.c head/sys/dev/usb/net/if_cdcereg.h - copied unchanged from r188941, head/sys/dev/usb2/ethernet/if_cdcereg.h head/sys/dev/usb/net/if_cue.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/ethernet/if_cue2.c head/sys/dev/usb/net/if_cuereg.h - copied unchanged from r188941, head/sys/dev/usb2/ethernet/if_cuereg.h head/sys/dev/usb/net/if_kue.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/ethernet/if_kue2.c head/sys/dev/usb/net/if_kuefw.h - copied unchanged from r188941, head/sys/dev/usb2/ethernet/if_kuefw.h head/sys/dev/usb/net/if_kuereg.h - copied unchanged from r188941, head/sys/dev/usb2/ethernet/if_kuereg.h head/sys/dev/usb/net/if_rue.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/ethernet/if_rue2.c head/sys/dev/usb/net/if_ruereg.h - copied unchanged from r188941, head/sys/dev/usb2/ethernet/if_ruereg.h head/sys/dev/usb/net/if_udav.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/ethernet/if_udav2.c head/sys/dev/usb/net/if_udavreg.h - copied unchanged from r188941, head/sys/dev/usb2/ethernet/if_udavreg.h head/sys/dev/usb/net/usb_ethernet.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/ethernet/usb2_ethernet.c head/sys/dev/usb/net/usb_ethernet.h (props changed) - copied unchanged from r188941, head/sys/dev/usb2/ethernet/usb2_ethernet.h head/sys/dev/usb/quirk/ head/sys/dev/usb/quirk/usb_quirk.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/quirk/usb2_quirk.c head/sys/dev/usb/quirk/usb_quirk.h (props changed) - copied unchanged from r188941, head/sys/dev/usb2/quirk/usb2_quirk.h head/sys/dev/usb/serial/ head/sys/dev/usb/serial/u3g.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/serial/u3g2.c head/sys/dev/usb/serial/uark.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/serial/uark2.c head/sys/dev/usb/serial/ubsa.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/serial/ubsa2.c head/sys/dev/usb/serial/ubser.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/serial/ubser2.c head/sys/dev/usb/serial/uchcom.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/serial/uchcom2.c head/sys/dev/usb/serial/ucycom.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/serial/ucycom2.c head/sys/dev/usb/serial/ufoma.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/serial/ufoma2.c head/sys/dev/usb/serial/uftdi.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/serial/uftdi2.c head/sys/dev/usb/serial/uftdi_reg.h (props changed) - copied unchanged from r188941, head/sys/dev/usb2/serial/uftdi2_reg.h head/sys/dev/usb/serial/ugensa.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/serial/ugensa2.c head/sys/dev/usb/serial/uipaq.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/serial/uipaq2.c head/sys/dev/usb/serial/ulpt.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/serial/ulpt2.c head/sys/dev/usb/serial/umct.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/serial/umct2.c head/sys/dev/usb/serial/umodem.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/serial/umodem2.c head/sys/dev/usb/serial/umoscom.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/serial/umoscom2.c head/sys/dev/usb/serial/uplcom.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/serial/uplcom2.c head/sys/dev/usb/serial/usb_serial.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/serial/usb2_serial.c head/sys/dev/usb/serial/usb_serial.h (props changed) - copied unchanged from r188941, head/sys/dev/usb2/serial/usb2_serial.h head/sys/dev/usb/serial/uslcom.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/serial/uslcom2.c head/sys/dev/usb/serial/uvisor.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/serial/uvisor2.c head/sys/dev/usb/serial/uvscom.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/serial/uvscom2.c head/sys/dev/usb/sound/ head/sys/dev/usb/sound/uaudio.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/sound/uaudio2.c head/sys/dev/usb/sound/uaudio.h (props changed) - copied unchanged from r188941, head/sys/dev/usb2/sound/uaudio2.h head/sys/dev/usb/sound/uaudio_pcm.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/sound/uaudio2_pcm.c head/sys/dev/usb/sound/uaudio_reg.h (props changed) - copied unchanged from r188941, head/sys/dev/usb2/sound/uaudio2_reg.h head/sys/dev/usb/storage/ head/sys/dev/usb/storage/ata-usb.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/storage/ata-usb2.c head/sys/dev/usb/storage/rio500_usb.h (props changed) - copied unchanged from r188941, head/sys/legacy/dev/usb/rio500_usb.h head/sys/dev/usb/storage/umass.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/storage/umass2.c head/sys/dev/usb/storage/urio.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/storage/urio2.c head/sys/dev/usb/storage/ustorage_fs.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/storage/ustorage2_fs.c head/sys/dev/usb/template/ head/sys/dev/usb/template/usb_template.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/template/usb2_template.c head/sys/dev/usb/template/usb_template.h (props changed) - copied unchanged from r188941, head/sys/dev/usb2/template/usb2_template.h head/sys/dev/usb/template/usb_template_cdce.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/template/usb2_template_cdce.c head/sys/dev/usb/template/usb_template_msc.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/template/usb2_template_msc.c head/sys/dev/usb/template/usb_template_mtp.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/template/usb2_template_mtp.c head/sys/dev/usb/ufm_ioctl.h (props changed) - copied unchanged from r188941, head/sys/dev/usb2/include/ufm2_ioctl.h head/sys/dev/usb/usb.h (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/include/usb2_standard.h head/sys/dev/usb/usb_bus.h (props changed) - copied unchanged from r188941, head/sys/dev/usb2/controller/usb2_bus.h head/sys/dev/usb/usb_busdma.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/core/usb2_busdma.c head/sys/dev/usb/usb_busdma.h (props changed) - copied unchanged from r188941, head/sys/dev/usb2/core/usb2_busdma.h head/sys/dev/usb/usb_cdc.h (props changed) - copied unchanged from r188941, head/sys/dev/usb2/include/usb2_cdc.h head/sys/dev/usb/usb_compat_linux.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/core/usb2_compat_linux.c head/sys/dev/usb/usb_compat_linux.h (props changed) - copied unchanged from r188941, head/sys/dev/usb2/core/usb2_compat_linux.h head/sys/dev/usb/usb_controller.h (props changed) - copied unchanged from r188941, head/sys/dev/usb2/controller/usb2_controller.h head/sys/dev/usb/usb_core.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/core/usb2_core.c head/sys/dev/usb/usb_core.h (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/core/usb2_core.h head/sys/dev/usb/usb_debug.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/core/usb2_debug.c head/sys/dev/usb/usb_debug.h (props changed) - copied unchanged from r188941, head/sys/dev/usb2/core/usb2_debug.h head/sys/dev/usb/usb_defs.h (props changed) - copied unchanged from r188941, head/sys/dev/usb2/include/usb2_defs.h head/sys/dev/usb/usb_dev.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/core/usb2_dev.c head/sys/dev/usb/usb_dev.h (props changed) - copied unchanged from r188941, head/sys/dev/usb2/core/usb2_dev.h head/sys/dev/usb/usb_device.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/core/usb2_device.c head/sys/dev/usb/usb_device.h (props changed) - copied unchanged from r188941, head/sys/dev/usb2/core/usb2_device.h head/sys/dev/usb/usb_dynamic.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/core/usb2_dynamic.c head/sys/dev/usb/usb_dynamic.h (props changed) - copied unchanged from r188941, head/sys/dev/usb2/core/usb2_dynamic.h head/sys/dev/usb/usb_endian.h (props changed) - copied unchanged from r188941, head/sys/dev/usb2/include/usb2_endian.h head/sys/dev/usb/usb_error.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/core/usb2_error.c head/sys/dev/usb/usb_error.h (props changed) - copied unchanged from r188941, head/sys/dev/usb2/include/usb2_error.h head/sys/dev/usb/usb_generic.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/core/usb2_generic.c head/sys/dev/usb/usb_generic.h (props changed) - copied unchanged from r188941, head/sys/dev/usb2/core/usb2_generic.h head/sys/dev/usb/usb_handle_request.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/core/usb2_handle_request.c head/sys/dev/usb/usb_handle_request.h (props changed) - copied unchanged from r188941, head/sys/dev/usb2/core/usb2_handle_request.h head/sys/dev/usb/usb_hid.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/core/usb2_hid.c head/sys/dev/usb/usb_hid.h (props changed) - copied unchanged from r188941, head/sys/dev/usb2/core/usb2_hid.h head/sys/dev/usb/usb_hub.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/core/usb2_hub.c head/sys/dev/usb/usb_hub.h (props changed) - copied unchanged from r188941, head/sys/dev/usb2/core/usb2_hub.h head/sys/dev/usb/usb_if.m (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/core/usb2_if.m head/sys/dev/usb/usb_ioctl.h (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/include/usb2_ioctl.h head/sys/dev/usb/usb_lookup.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/core/usb2_lookup.c head/sys/dev/usb/usb_lookup.h (props changed) - copied unchanged from r188941, head/sys/dev/usb2/core/usb2_lookup.h head/sys/dev/usb/usb_mbuf.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/core/usb2_mbuf.c head/sys/dev/usb/usb_mbuf.h (props changed) - copied unchanged from r188941, head/sys/dev/usb2/core/usb2_mbuf.h head/sys/dev/usb/usb_mfunc.h (props changed) - copied unchanged from r188941, head/sys/dev/usb2/include/usb2_mfunc.h head/sys/dev/usb/usb_msctest.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/core/usb2_msctest.c head/sys/dev/usb/usb_msctest.h (props changed) - copied unchanged from r188941, head/sys/dev/usb2/core/usb2_msctest.h head/sys/dev/usb/usb_parse.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/core/usb2_parse.c head/sys/dev/usb/usb_parse.h (props changed) - copied unchanged from r188941, head/sys/dev/usb2/core/usb2_parse.h head/sys/dev/usb/usb_pci.h (props changed) - copied unchanged from r188941, head/sys/dev/usb2/controller/usb2_pci.h head/sys/dev/usb/usb_process.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/core/usb2_process.c head/sys/dev/usb/usb_process.h (props changed) - copied unchanged from r188941, head/sys/dev/usb2/core/usb2_process.h head/sys/dev/usb/usb_request.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/core/usb2_request.c head/sys/dev/usb/usb_request.h (props changed) - copied unchanged from r188941, head/sys/dev/usb2/core/usb2_request.h head/sys/dev/usb/usb_revision.h (props changed) - copied unchanged from r188941, head/sys/dev/usb2/include/usb2_revision.h head/sys/dev/usb/usb_sw_transfer.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/core/usb2_sw_transfer.c head/sys/dev/usb/usb_sw_transfer.h (props changed) - copied unchanged from r188941, head/sys/dev/usb2/core/usb2_sw_transfer.h head/sys/dev/usb/usb_transfer.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/core/usb2_transfer.c head/sys/dev/usb/usb_transfer.h (props changed) - copied unchanged from r188941, head/sys/dev/usb2/core/usb2_transfer.h head/sys/dev/usb/usb_util.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/core/usb2_util.c head/sys/dev/usb/usb_util.h (props changed) - copied unchanged from r188941, head/sys/dev/usb2/core/usb2_util.h head/sys/dev/usb/usbdevs (props changed) - copied unchanged from r188941, head/sys/legacy/dev/usb/usbdevs head/sys/dev/usb/usbhid.h (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/include/usb2_hid.h head/sys/dev/usb/wlan/ head/sys/dev/usb/wlan/if_rum.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/wlan/if_rum2.c head/sys/dev/usb/wlan/if_rumfw.h - copied unchanged from r188941, head/sys/dev/usb2/wlan/if_rumfw.h head/sys/dev/usb/wlan/if_rumreg.h - copied unchanged from r188941, head/sys/dev/usb2/wlan/if_rumreg.h head/sys/dev/usb/wlan/if_rumvar.h - copied unchanged from r188941, head/sys/dev/usb2/wlan/if_rumvar.h head/sys/dev/usb/wlan/if_ural.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/wlan/if_ural2.c head/sys/dev/usb/wlan/if_uralreg.h - copied unchanged from r188941, head/sys/dev/usb2/wlan/if_uralreg.h head/sys/dev/usb/wlan/if_uralvar.h - copied unchanged from r188941, head/sys/dev/usb2/wlan/if_uralvar.h head/sys/dev/usb/wlan/if_zyd.c (contents, props changed) - copied, changed from r188941, head/sys/dev/usb2/wlan/if_zyd2.c head/sys/dev/usb/wlan/if_zydfw.h - copied unchanged from r188941, head/sys/dev/usb2/wlan/if_zydfw.h head/sys/dev/usb/wlan/if_zydreg.h - copied unchanged from r188941, head/sys/dev/usb2/wlan/if_zydreg.h head/sys/dev/usb/wlan/usb_wlan.h (props changed) - copied unchanged from r188941, head/sys/dev/usb2/wlan/usb2_wlan.h Deleted: head/sys/dev/usb2/ Copied and modified: head/sys/dev/usb/README.TXT (from r188941, head/sys/dev/usb2/core/README.TXT) ============================================================================== --- head/sys/dev/usb2/core/README.TXT Mon Feb 23 18:22:49 2009 (r188941, copy source) +++ head/sys/dev/usb/README.TXT Mon Feb 23 18:31:00 2009 (r188942) @@ -47,7 +47,7 @@ functions to setup INTERRUPT- and ISOCHR | to the USB transfer structure pointer. | +--------------------------------------------------------------+ -Reference: /sys/dev/usb2/core/usb2_transfer.c +Reference: /sys/dev/usb/usb_transfer.c /* * A simple USB callback state-machine: @@ -177,8 +177,8 @@ detached when the thread returns from sl USB device driver examples: -/sys/dev/usb2/ethernet/if_axe.c -/sys/dev/usb2/ethernet/if_aue.c +/sys/dev/usb/net/if_axe.c +/sys/dev/usb/net/if_aue.c QUICK REFERENCE =============== Copied: head/sys/dev/usb/bluetooth/TODO.TXT (from r188941, head/sys/dev/usb2/bluetooth/TODO.TXT) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/bluetooth/TODO.TXT Mon Feb 23 18:31:00 2009 (r188942, copy of r188941, head/sys/dev/usb2/bluetooth/TODO.TXT) @@ -0,0 +1,18 @@ +$Id: TODO,v 1.1 2002/11/24 19:46:56 max Exp $ +$FreeBSD$ + +1) SMP/Locking + + The code makes use of ng_send_fn() whenever possible. Just + need to verify and make sure i did it right + +2) Firmware upgrade + + According to Bluetooth spec device may present third interface + to perform firmware upgrade. 3Com USB Bluetooth dongle has + such interface. Need to implement set of Netgraph messages. + +3) Isochronous USB transfers (SCO data) + + Tried to fix isochrounous transfers, which are still disabled + by default. Copied and modified: head/sys/dev/usb/bluetooth/ng_ubt.c (from r188941, head/sys/dev/usb2/bluetooth/ng_ubt2.c) ============================================================================== --- head/sys/dev/usb2/bluetooth/ng_ubt2.c Mon Feb 23 18:22:49 2009 (r188941, copy source) +++ head/sys/dev/usb/bluetooth/ng_ubt.c Mon Feb 23 18:31:00 2009 (r188942) @@ -93,20 +93,20 @@ */ #include "usbdevs.h" -#include -#include -#include +#include +#include +#include #define USB_DEBUG_VAR usb2_debug -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -118,8 +118,7 @@ #include #include -#include -#include +#include static int ubt_modevent(module_t, int, void *); static device_probe_t ubt_probe; @@ -1715,6 +1714,5 @@ DRIVER_MODULE(ng_ubt, ushub, ubt_driver, MODULE_VERSION(ng_ubt, NG_BLUETOOTH_VERSION); MODULE_DEPEND(ng_ubt, netgraph, NG_ABI_VERSION, NG_ABI_VERSION, NG_ABI_VERSION); MODULE_DEPEND(ng_ubt, ng_hci, NG_BLUETOOTH_VERSION, NG_BLUETOOTH_VERSION, NG_BLUETOOTH_VERSION); -MODULE_DEPEND(ng_ubt, usb2_bluetooth, 1, 1, 1); -MODULE_DEPEND(ng_ubt, usb2_core, 1, 1, 1); +MODULE_DEPEND(ng_ubt, usb, 1, 1, 1); Copied: head/sys/dev/usb/bluetooth/ng_ubt_var.h (from r188941, head/sys/dev/usb2/bluetooth/ng_ubt2_var.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/bluetooth/ng_ubt_var.h Mon Feb 23 18:31:00 2009 (r188942, copy of r188941, head/sys/dev/usb2/bluetooth/ng_ubt2_var.h) @@ -0,0 +1,131 @@ +/* + * ng_ubt_var.h + */ + +/*- + * Copyright (c) 2001-2009 Maksim Yevmenkin + * 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. + * + * $Id: ng_ubt_var.h,v 1.2 2003/03/22 23:44:36 max Exp $ + * $FreeBSD$ + */ + +#ifndef _NG_UBT_VAR_H_ +#define _NG_UBT_VAR_H_ 1 + +/* Debug printf's */ +#define UBT_DEBUG(level, sc, fmt, ...) \ +do { \ + if ((sc)->sc_debug >= (level)) \ + device_printf((sc)->sc_dev, "%s:%d: " fmt, \ + __FUNCTION__, __LINE__,## __VA_ARGS__); \ +} while (0) + +#define UBT_ALERT(...) UBT_DEBUG(NG_UBT_ALERT_LEVEL, __VA_ARGS__) +#define UBT_ERR(...) UBT_DEBUG(NG_UBT_ERR_LEVEL, __VA_ARGS__) +#define UBT_WARN(...) UBT_DEBUG(NG_UBT_WARN_LEVEL, __VA_ARGS__) +#define UBT_INFO(...) UBT_DEBUG(NG_UBT_INFO_LEVEL, __VA_ARGS__) + +#define UBT_NG_LOCK(sc) mtx_lock(&(sc)->sc_ng_mtx) +#define UBT_NG_UNLOCK(sc) mtx_unlock(&(sc)->sc_ng_mtx) + +/* Bluetooth USB control request type */ +#define UBT_HCI_REQUEST 0x20 +#define UBT_DEFAULT_QLEN 64 +#define UBT_ISOC_NFRAMES 32 /* should be factor of 8 */ + +/* Bluetooth USB defines */ +enum { + /* Interface #0 transfers */ + UBT_IF_0_BULK_DT_WR = 0, + UBT_IF_0_BULK_DT_RD, + UBT_IF_0_INTR_DT_RD, + UBT_IF_0_CTRL_DT_WR, + + /* Interface #1 transfers */ + UBT_IF_1_ISOC_DT_RD1, + UBT_IF_1_ISOC_DT_RD2, + UBT_IF_1_ISOC_DT_WR1, + UBT_IF_1_ISOC_DT_WR2, + + UBT_N_TRANSFER, /* total number of transfers */ +}; + +/* USB device softc structure */ +struct ubt_softc { + device_t sc_dev; /* for debug printf */ + + /* State */ + ng_ubt_node_debug_ep sc_debug; /* debug level */ + + ng_ubt_node_stat_ep sc_stat; /* statistic */ +#define UBT_STAT_PCKTS_SENT(sc) (sc)->sc_stat.pckts_sent ++ +#define UBT_STAT_BYTES_SENT(sc, n) (sc)->sc_stat.bytes_sent += (n) +#define UBT_STAT_PCKTS_RECV(sc) (sc)->sc_stat.pckts_recv ++ +#define UBT_STAT_BYTES_RECV(sc, n) (sc)->sc_stat.bytes_recv += (n) +#define UBT_STAT_OERROR(sc) (sc)->sc_stat.oerrors ++ +#define UBT_STAT_IERROR(sc) (sc)->sc_stat.ierrors ++ +#define UBT_STAT_RESET(sc) bzero(&(sc)->sc_stat, sizeof((sc)->sc_stat)) + + /* USB device specific */ + struct mtx sc_if_mtx; /* interfaces lock */ + struct usb2_xfer *sc_xfer[UBT_N_TRANSFER]; + + struct mtx sc_ng_mtx; /* lock for shared NG data */ + + /* HCI commands */ + struct ng_bt_mbufq sc_cmdq; /* HCI command queue */ +#define UBT_CTRL_BUFFER_SIZE (sizeof(struct usb2_device_request) + \ + sizeof(ng_hci_cmd_pkt_t) + NG_HCI_CMD_PKT_SIZE) +#define UBT_INTR_BUFFER_SIZE (MCLBYTES-1) /* reserve 1 byte for ID-tag */ + + /* ACL data */ + struct ng_bt_mbufq sc_aclq; /* ACL data queue */ +#define UBT_BULK_READ_BUFFER_SIZE (MCLBYTES-1) /* reserve 1 byte for ID-tag */ +#define UBT_BULK_WRITE_BUFFER_SIZE (MCLBYTES) + + /* SCO data */ + struct ng_bt_mbufq sc_scoq; /* SCO data queue */ + struct mbuf *sc_isoc_in_buffer; /* SCO reassembly buffer */ + + /* Netgraph specific */ + node_p sc_node; /* pointer back to node */ + hook_p sc_hook; /* upstream hook */ + + /* Glue */ + int sc_task_flags; /* task flags */ +#define UBT_FLAG_T_PENDING (1 << 0) /* task pending */ +#define UBT_FLAG_T_STOP_ALL (1 << 1) /* stop all xfers */ +#define UBT_FLAG_T_START_ALL (1 << 2) /* start all read and isoc + write xfers */ +#define UBT_FLAG_T_START_CTRL (1 << 3) /* start control xfer (write) */ +#define UBT_FLAG_T_START_BULK (1 << 4) /* start bulk xfer (write) */ + + struct task sc_task; +}; +typedef struct ubt_softc ubt_softc_t; +typedef struct ubt_softc * ubt_softc_p; + +#endif /* ndef _NG_UBT_VAR_H_ */ + Copied and modified: head/sys/dev/usb/bluetooth/ubtbcmfw.c (from r188941, head/sys/dev/usb2/bluetooth/ubtbcmfw2.c) ============================================================================== --- head/sys/dev/usb2/bluetooth/ubtbcmfw2.c Mon Feb 23 18:22:49 2009 (r188941, copy source) +++ head/sys/dev/usb/bluetooth/ubtbcmfw.c Mon Feb 23 18:31:00 2009 (r188942) @@ -32,21 +32,21 @@ */ #include "usbdevs.h" -#include -#include -#include -#include +#include +#include +#include +#include #define USB_DEBUG_VAR usb2_debug -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include /* * Download firmware to BCM2033. @@ -158,8 +158,7 @@ static driver_t ubtbcmfw_driver = }; DRIVER_MODULE(ubtbcmfw, ushub, ubtbcmfw_driver, ubtbcmfw_devclass, NULL, 0); -MODULE_DEPEND(ubtbcmfw, usb2_bluetooth, 1, 1, 1); -MODULE_DEPEND(ubtbcmfw, usb2_core, 1, 1, 1); +MODULE_DEPEND(ubtbcmfw, usb, 1, 1, 1); /* * Probe for a USB Bluetooth device Copied and modified: head/sys/dev/usb/controller/at91dci.c (from r188941, head/sys/dev/usb2/controller/at91dci.c) ============================================================================== --- head/sys/dev/usb2/controller/at91dci.c Mon Feb 23 18:22:49 2009 (r188941, copy source) +++ head/sys/dev/usb/controller/at91dci.c Mon Feb 23 18:31:00 2009 (r188942) @@ -44,26 +44,26 @@ __FBSDID("$FreeBSD$"); * endpoints, Function-address and more. */ -#include -#include -#include -#include +#include +#include +#include +#include #define USB_DEBUG_VAR at91dcidebug -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include #define AT9100_DCI_BUS2SC(bus) \ ((struct at91dci_softc *)(((uint8_t *)(bus)) - \ Copied: head/sys/dev/usb/controller/at91dci.h (from r188941, head/sys/dev/usb2/controller/at91dci.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/controller/at91dci.h Mon Feb 23 18:31:00 2009 (r188942, copy of r188941, head/sys/dev/usb2/controller/at91dci.h) @@ -0,0 +1,245 @@ +/* $FreeBSD$ */ +/*- + * Copyright (c) 2006 ATMEL + * Copyright (c) 2007 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. + */ + +/* + * USB Device Port (UDP) register definition, based on + * "AT91RM9200.h" provided by ATMEL. + */ + +#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 */ +#define AT91_UDP_FRM_ERR (0x1 << 16) /* Frame Error */ +#define AT91_UDP_FRM_OK (0x1 << 17) /* Frame OK */ + +#define AT91_UDP_GSTATE 0x04 /* Global state register */ +#define AT91_UDP_GSTATE_ADDR (0x1 << 0) /* Addressed state */ +#define AT91_UDP_GSTATE_CONFG (0x1 << 1) /* Configured */ +#define AT91_UDP_GSTATE_ESR (0x1 << 2) /* Enable Send Resume */ +#define AT91_UDP_GSTATE_RSM (0x1 << 3) /* A Resume Has Been Sent to + * the Host */ +#define AT91_UDP_GSTATE_RMW (0x1 << 4) /* Remote Wake Up Enable */ + +#define AT91_UDP_FADDR 0x08 /* Function Address Register */ +#define AT91_UDP_FADDR_MASK (0x7F << 0)/* Function Address Mask */ +#define AT91_UDP_FADDR_EN (0x1 << 8)/* Function Enable */ + +#define AT91_UDP_RES0 0x0C /* Reserved 0 */ + +#define AT91_UDP_IER 0x10 /* Interrupt Enable Register */ +#define AT91_UDP_IDR 0x14 /* Interrupt Disable Register */ +#define AT91_UDP_IMR 0x18 /* Interrupt Mask Register */ +#define AT91_UDP_ISR 0x1C /* Interrupt Status Register */ +#define AT91_UDP_ICR 0x20 /* Interrupt Clear Register */ +#define AT91_UDP_INT_EP(n) (0x1 <<(n))/* Endpoint "n" Interrupt */ +#define AT91_UDP_INT_RXSUSP (0x1 << 8)/* USB Suspend Interrupt */ +#define AT91_UDP_INT_RXRSM (0x1 << 9)/* USB Resume Interrupt */ +#define AT91_UDP_INT_EXTRSM (0x1 << 10)/* USB External Resume Interrupt */ +#define AT91_UDP_INT_SOFINT (0x1 << 11)/* USB Start Of frame Interrupt */ +#define AT91_UDP_INT_END_BR (0x1 << 12)/* USB End Of Bus Reset Interrupt */ +#define AT91_UDP_INT_WAKEUP (0x1 << 13)/* USB Resume Interrupt */ + +#define AT91_UDP_INT_BUS \ + (AT91_UDP_INT_RXSUSP|AT91_UDP_INT_RXRSM| \ + AT91_UDP_INT_END_BR) + +#define AT91_UDP_INT_EPS \ + (AT91_UDP_INT_EP(0)|AT91_UDP_INT_EP(1)| \ + AT91_UDP_INT_EP(2)|AT91_UDP_INT_EP(3)| \ + AT91_UDP_INT_EP(4)|AT91_UDP_INT_EP(5)) + +#define AT91_UDP_INT_DEFAULT \ + (AT91_UDP_INT_EPS|AT91_UDP_INT_BUS) + +#define AT91_UDP_RES1 0x24 /* Reserved 1 */ +#define AT91_UDP_RST 0x28 /* Reset Endpoint Register */ +#define AT91_UDP_RST_EP(n) (0x1 << (n))/* Reset Endpoint "n" */ + +#define AT91_UDP_RES2 0x2C /* Reserved 2 */ + +#define AT91_UDP_CSR(n) (0x30 + (4*(n)))/* Endpoint Control and Status + * Register */ +#define AT91_UDP_CSR_TXCOMP (0x1 << 0) /* Generates an IN packet with data + * previously written in the DPR */ +#define AT91_UDP_CSR_RX_DATA_BK0 (0x1 << 1) /* Receive Data Bank 0 */ +#define AT91_UDP_CSR_RXSETUP (0x1 << 2) /* Sends STALL to the Host + * (Control endpoints) */ +#define AT91_UDP_CSR_ISOERROR (0x1 << 3) /* Isochronous error + * (Isochronous endpoints) */ +#define AT91_UDP_CSR_STALLSENT (0x1 << 3) /* Stall sent (Control, bulk, + * interrupt endpoints) */ +#define AT91_UDP_CSR_TXPKTRDY (0x1 << 4) /* Transmit Packet Ready */ +#define AT91_UDP_CSR_FORCESTALL (0x1 << 5) /* Force Stall (used by + * Control, Bulk and + * Isochronous endpoints). */ +#define AT91_UDP_CSR_RX_DATA_BK1 (0x1 << 6) /* Receive Data Bank 1 (only + * used by endpoints with + * ping-pong attributes). */ +#define AT91_UDP_CSR_DIR (0x1 << 7) /* Transfer Direction */ +#define AT91_UDP_CSR_ET_MASK (0x7 << 8) /* Endpoint transfer type mask */ +#define AT91_UDP_CSR_ET_CTRL (0x0 << 8) /* Control IN+OUT */ +#define AT91_UDP_CSR_ET_ISO (0x1 << 8) /* Isochronous */ +#define AT91_UDP_CSR_ET_BULK (0x2 << 8) /* Bulk */ +#define AT91_UDP_CSR_ET_INT (0x3 << 8) /* Interrupt */ +#define AT91_UDP_CSR_ET_DIR_OUT (0x0 << 8) /* OUT tokens */ +#define AT91_UDP_CSR_ET_DIR_IN (0x4 << 8) /* IN tokens */ +#define AT91_UDP_CSR_DTGLE (0x1 << 11) /* Data Toggle */ +#define AT91_UDP_CSR_EPEDS (0x1 << 15) /* Endpoint Enable Disable */ +#define AT91_UDP_CSR_RXBYTECNT (0x7FF << 16) /* Number Of Bytes Available + * in the FIFO */ + +#define AT91_UDP_FDR(n) (0x50 + (4*(n)))/* Endpoint FIFO Data Register */ +#define AT91_UDP_RES3 0x70 /* Reserved 3 */ +#define AT91_UDP_TXVC 0x74 /* Transceiver Control Register */ +#define AT91_UDP_TXVC_DIS (0x1 << 8) + +#define AT91_UDP_EP_MAX 6 /* maximum number of endpoints + * supported */ + +#define AT91_UDP_READ_4(sc, reg) \ + bus_space_read_4((sc)->sc_io_tag, (sc)->sc_io_hdl, reg) + +#define AT91_UDP_WRITE_4(sc, reg, data) \ + bus_space_write_4((sc)->sc_io_tag, (sc)->sc_io_hdl, reg, data) + +struct at91dci_td; + +typedef uint8_t (at91dci_cmd_t)(struct at91dci_td *td); + +struct at91dci_td { + bus_space_tag_t io_tag; + bus_space_handle_t io_hdl; + struct at91dci_td *obj_next; + at91dci_cmd_t *func; + struct usb2_page_cache *pc; + uint32_t offset; + uint32_t remainder; + uint16_t max_packet_size; + uint8_t status_reg; + uint8_t fifo_reg; + uint8_t fifo_bank:1; + uint8_t error:1; + uint8_t alt_next:1; + uint8_t short_pkt:1; + uint8_t support_multi_buffer:1; + uint8_t did_stall:1; +}; + +struct at91dci_std_temp { + at91dci_cmd_t *func; + struct usb2_page_cache *pc; + struct at91dci_td *td; + struct at91dci_td *td_next; + uint32_t len; + uint32_t offset; + uint16_t max_frame_size; + uint8_t short_pkt; + /* + * short_pkt = 0: transfer should be short terminated + * short_pkt = 1: transfer should not be short terminated + */ + uint8_t setup_alt_next; +}; + +struct at91dci_config_desc { + struct usb2_config_descriptor confd; + struct usb2_interface_descriptor ifcd; + struct usb2_endpoint_descriptor endpd; +} __packed; + +union at91dci_hub_temp { + uWord wValue; + struct usb2_port_status ps; +}; + +struct at91dci_ep_flags { + uint8_t fifo_bank:1; /* hardware specific */ +}; + +struct at91dci_flags { + uint8_t change_connect:1; + uint8_t change_suspend:1; + uint8_t status_suspend:1; /* set if suspended */ + uint8_t status_vbus:1; /* set if present */ + uint8_t status_bus_reset:1; /* set if reset complete */ + uint8_t remote_wakeup:1; + uint8_t self_powered:1; + uint8_t clocks_off:1; + uint8_t port_powered:1; + uint8_t port_enabled:1; + uint8_t d_pulled_up:1; +}; + +struct at91dci_softc { + struct usb2_bus sc_bus; + union at91dci_hub_temp sc_hub_temp; + LIST_HEAD(, usb2_xfer) sc_interrupt_list_head; + struct usb2_sw_transfer sc_root_ctrl; + struct usb2_sw_transfer sc_root_intr; + + struct usb2_device *sc_devices[AT91_MAX_DEVICES]; + struct resource *sc_io_res; + struct resource *sc_irq_res; + void *sc_intr_hdl; + bus_size_t sc_io_size; + bus_space_tag_t sc_io_tag; + bus_space_handle_t sc_io_hdl; + + void (*sc_clocks_on) (void *arg); + void (*sc_clocks_off) (void *arg); + void *sc_clocks_arg; + + void (*sc_pull_up) (void *arg); + void (*sc_pull_down) (void *arg); + void *sc_pull_arg; + + uint8_t sc_rt_addr; /* root HUB address */ + uint8_t sc_dv_addr; /* device address */ + uint8_t sc_conf; /* root HUB config */ + + uint8_t sc_hub_idata[1]; + + struct at91dci_flags sc_flags; + struct at91dci_ep_flags sc_ep_flags[AT91_UDP_EP_MAX]; +}; + +/* prototypes */ + +usb2_error_t at91dci_init(struct at91dci_softc *sc); +void at91dci_uninit(struct at91dci_softc *sc); +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_ */ Copied and modified: head/sys/dev/usb/controller/at91dci_atmelarm.c (from r188941, head/sys/dev/usb2/controller/at91dci_atmelarm.c) ============================================================================== --- head/sys/dev/usb2/controller/at91dci_atmelarm.c Mon Feb 23 18:22:49 2009 (r188941, copy source) +++ head/sys/dev/usb/controller/at91dci_atmelarm.c Mon Feb 23 18:31:00 2009 (r188942) @@ -27,19 +27,19 @@ __FBSDID("$FreeBSD$"); */ -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include -#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include #include Copied and modified: head/sys/dev/usb/controller/atmegadci.c (from r188941, head/sys/dev/usb2/controller/atmegadci.c) ============================================================================== --- head/sys/dev/usb2/controller/atmegadci.c Mon Feb 23 18:22:49 2009 (r188941, copy source) +++ head/sys/dev/usb/controller/atmegadci.c Mon Feb 23 18:31:00 2009 (r188942) @@ -36,26 +36,26 @@ __FBSDID("$FreeBSD$"); * endpoints, Function-address and more. */ -#include -#include -#include -#include +#include +#include +#include +#include #define USB_DEBUG_VAR atmegadci_debug -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include #define ATMEGA_BUS2SC(bus) \ ((struct atmegadci_softc *)(((uint8_t *)(bus)) - \ Copied: head/sys/dev/usb/controller/atmegadci.h (from r188941, head/sys/dev/usb2/controller/atmegadci.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/controller/atmegadci.h Mon Feb 23 18:31:00 2009 (r188942, copy of r188941, head/sys/dev/usb2/controller/atmegadci.h) @@ -0,0 +1,273 @@ +/* $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. + */ + +/* + * USB Device Port register definitions, copied from ATMEGA + * documentation provided by ATMEL. + */ + +#ifndef _ATMEGADCI_H_ +#define _ATMEGADCI_H_ + +#define ATMEGA_MAX_DEVICES (USB_MIN_DEVICES + 1) + +#ifndef ATMEGA_HAVE_BUS_SPACE +#define ATMEGA_HAVE_BUS_SPACE 1 +#endif + +#define ATMEGA_UEINT 0xF4 +#define ATMEGA_UEINT_MASK(n) (1 << (n)) /* endpoint interrupt mask */ + +#define ATMEGA_UEBCHX 0xF3 /* FIFO byte count high */ +#define ATMEGA_UEBCLX 0xF2 /* FIFO byte count low */ +#define ATMEGA_UEDATX 0xF1 /* FIFO data */ + +#define ATMEGA_UEIENX 0xF0 /* interrupt enable register */ +#define ATMEGA_UEIENX_TXINE (1 << 0) +#define ATMEGA_UEIENX_STALLEDE (1 << 1) +#define ATMEGA_UEIENX_RXOUTE (1 << 2) +#define ATMEGA_UEIENX_RXSTPE (1 << 3) /* received SETUP packet */ +#define ATMEGA_UEIENX_NAKOUTE (1 << 4) +#define ATMEGA_UEIENX_NAKINE (1 << 6) +#define ATMEGA_UEIENX_FLERRE (1 << 7) + +#define ATMEGA_UESTA1X 0xEF +#define ATMEGA_UESTA1X_CURRBK (3 << 0) /* current bank */ +#define ATMEGA_UESTA1X_CTRLDIR (1 << 2) /* control endpoint direction */ + +#define ATMEGA_UESTA0X 0xEE +#define ATMEGA_UESTA0X_NBUSYBK (3 << 0) +#define ATMEGA_UESTA0X_DTSEQ (3 << 2) +#define ATMEGA_UESTA0X_UNDERFI (1 << 5) /* underflow */ +#define ATMEGA_UESTA0X_OVERFI (1 << 6) /* overflow */ +#define ATMEGA_UESTA0X_CFGOK (1 << 7) + +#define ATMEGA_UECFG1X 0xED /* endpoint config register */ +#define ATMEGA_UECFG1X_ALLOC (1 << 1) +#define ATMEGA_UECFG1X_EPBK0 (0 << 2) +#define ATMEGA_UECFG1X_EPBK1 (1 << 2) +#define ATMEGA_UECFG1X_EPBK2 (2 << 2) +#define ATMEGA_UECFG1X_EPBK3 (3 << 2) +#define ATMEGA_UECFG1X_EPSIZE(n) ((n) << 4) + +#define ATMEGA_UECFG0X 0xEC +#define ATMEGA_UECFG0X_EPDIR (1 << 0) /* endpoint direction */ +#define ATMEGA_UECFG0X_EPTYPE0 (0 << 6) +#define ATMEGA_UECFG0X_EPTYPE1 (1 << 6) +#define ATMEGA_UECFG0X_EPTYPE2 (2 << 6) +#define ATMEGA_UECFG0X_EPTYPE3 (3 << 6) + +#define ATMEGA_UECONX 0xEB +#define ATMEGA_UECONX_EPEN (1 << 0) +#define ATMEGA_UECONX_RSTDT (1 << 3) +#define ATMEGA_UECONX_STALLRQC (1 << 4) /* stall request clear */ +#define ATMEGA_UECONX_STALLRQ (1 << 5) /* stall request set */ + +#define ATMEGA_UERST 0xEA /* endpoint reset register */ +#define ATMEGA_UERST_MASK(n) (1 << (n)) + +#define ATMEGA_UENUM 0xE9 /* endpoint number */ + +#define ATMEGA_UEINTX 0xE8 /* interrupt register */ +#define ATMEGA_UEINTX_TXINI (1 << 0) +#define ATMEGA_UEINTX_STALLEDI (1 << 1) +#define ATMEGA_UEINTX_RXOUTI (1 << 2) +#define ATMEGA_UEINTX_RXSTPI (1 << 3) /* received setup packet */ +#define ATMEGA_UEINTX_NAKOUTI (1 << 4) +#define ATMEGA_UEINTX_RWAL (1 << 5) +#define ATMEGA_UEINTX_NAKINI (1 << 6) +#define ATMEGA_UEINTX_FIFOCON (1 << 7) + +#define ATMEGA_UDMFN 0xE6 +#define ATMEGA_UDMFN_FNCERR (1 << 4) + +#define ATMEGA_UDFNUMH 0xE5 /* frame number high */ +#define ATMEGA_UDFNUMH_MASK 7 + +#define ATMEGA_UDFNUML 0xE4 /* frame number low */ +#define ATMEGA_UDFNUML_MASK 0xFF + +#define ATMEGA_FRAME_MASK 0x7FF + +#define ATMEGA_UDADDR 0xE3 /* USB address */ +#define ATMEGA_UDADDR_MASK 0x7F +#define ATMEGA_UDADDR_ADDEN (1 << 7) + +#define ATMEGA_UDIEN 0xE2 /* USB device interrupt enable */ +#define ATMEGA_UDINT_SUSPE (1 << 0) +#define ATMEGA_UDINT_MSOFE (1 << 1) +#define ATMEGA_UDINT_SOFE (1 << 2) +#define ATMEGA_UDINT_EORSTE (1 << 3) +#define ATMEGA_UDINT_WAKEUPE (1 << 4) +#define ATMEGA_UDINT_EORSME (1 << 5) +#define ATMEGA_UDINT_UPRSME (1 << 6) + +#define ATMEGA_UDINT 0xE1 /* USB device interrupt status */ +#define ATMEGA_UDINT_SUSPI (1 << 0) +#define ATMEGA_UDINT_MSOFI (1 << 1) +#define ATMEGA_UDINT_SOFI (1 << 2) +#define ATMEGA_UDINT_EORSTI (1 << 3) +#define ATMEGA_UDINT_WAKEUPI (1 << 4) +#define ATMEGA_UDINT_EORSMI (1 << 5) +#define ATMEGA_UDINT_UPRSMI (1 << 6) + +#define ATMEGA_UDCON 0xE0 /* USB device connection register */ +#define ATMEGA_UDCON_DETACH (1 << 0) +#define ATMEGA_UDCON_RMWKUP (1 << 1) +#define ATMEGA_UDCON_LSM (1 << 2) +#define ATMEGA_UDCON_RSTCPU (1 << 3) + +#define ATMEGA_USBINT 0xDA +#define ATMEGA_USBINT_VBUSTI (1 << 0) /* USB VBUS interrupt */ + +#define ATMEGA_USBSTA 0xD9 +#define ATMEGA_USBSTA_VBUS (1 << 0) +#define ATMEGA_USBSTA_ID (1 << 1) + +#define ATMEGA_USBCON 0xD8 +#define ATMEGA_USBCON_VBUSTE (1 << 0) +#define ATMEGA_USBCON_OTGPADE (1 << 4) +#define ATMEGA_USBCON_FRZCLK (1 << 5) +#define ATMEGA_USBCON_USBE (1 << 7) + +#define ATMEGA_UHWCON 0xD7 +#define ATMEGA_UHWCON_UVREGE (1 << 0) + +#define ATMEGA_READ_1(sc, reg) \ + bus_space_read_1((sc)->sc_io_tag, (sc)->sc_io_hdl, reg) + +#define ATMEGA_WRITE_1(sc, reg, data) \ + bus_space_write_1((sc)->sc_io_tag, (sc)->sc_io_hdl, reg, data) + +#define ATMEGA_WRITE_MULTI_1(sc, reg, ptr, len) \ + bus_space_write_multi_1((sc)->sc_io_tag, (sc)->sc_io_hdl, reg, ptr, len) + +#define ATMEGA_READ_MULTI_1(sc, reg, ptr, len) \ + bus_space_read_multi_1((sc)->sc_io_tag, (sc)->sc_io_hdl, reg, ptr, len) + +/* + * Maximum number of endpoints supported: + */ +#define ATMEGA_EP_MAX 7 + +struct atmegadci_td; + +typedef uint8_t (atmegadci_cmd_t)(struct atmegadci_td *td); +typedef void (atmegadci_clocks_t)(struct usb2_bus *); + +struct atmegadci_td { + struct atmegadci_td *obj_next; + atmegadci_cmd_t *func; + struct usb2_page_cache *pc; + uint32_t offset; + uint32_t remainder; + uint16_t max_packet_size; + uint8_t error:1; + uint8_t alt_next:1; + uint8_t short_pkt:1; + uint8_t support_multi_buffer:1; + uint8_t did_stall:1; + uint8_t ep_no:3; +}; + +struct atmegadci_std_temp { + atmegadci_cmd_t *func; + struct usb2_page_cache *pc; + struct atmegadci_td *td; + struct atmegadci_td *td_next; + uint32_t len; + uint32_t offset; + uint16_t max_frame_size; + uint8_t short_pkt; + /* + * short_pkt = 0: transfer should be short terminated + * short_pkt = 1: transfer should not be short terminated + */ + uint8_t setup_alt_next; +}; + +struct atmegadci_config_desc { + struct usb2_config_descriptor confd; + struct usb2_interface_descriptor ifcd; + struct usb2_endpoint_descriptor endpd; +} __packed; + +union atmegadci_hub_temp { + uWord wValue; + struct usb2_port_status ps; +}; + +struct atmegadci_flags { + uint8_t change_connect:1; + uint8_t change_suspend:1; + uint8_t status_suspend:1; /* set if suspended */ + uint8_t status_vbus:1; /* set if present */ + uint8_t status_bus_reset:1; /* set if reset complete */ + uint8_t remote_wakeup:1; + uint8_t self_powered:1; + uint8_t clocks_off:1; + uint8_t port_powered:1; + uint8_t port_enabled:1; + uint8_t d_pulled_up:1; +}; + +struct atmegadci_softc { + struct usb2_bus sc_bus; + union atmegadci_hub_temp sc_hub_temp; + LIST_HEAD(, usb2_xfer) sc_interrupt_list_head; + struct usb2_sw_transfer sc_root_ctrl; + struct usb2_sw_transfer sc_root_intr; + + /* must be set by by the bus interface layer */ + atmegadci_clocks_t *sc_clocks_on; + atmegadci_clocks_t *sc_clocks_off; + + struct usb2_device *sc_devices[ATMEGA_MAX_DEVICES]; + struct resource *sc_irq_res; + void *sc_intr_hdl; +#if (ATMEGA_HAVE_BUS_SPACE != 0) + struct resource *sc_io_res; + bus_space_tag_t sc_io_tag; + bus_space_handle_t sc_io_hdl; +#endif + uint8_t sc_rt_addr; /* root hub address */ + uint8_t sc_dv_addr; /* device address */ + uint8_t sc_conf; /* root hub config */ + + uint8_t sc_hub_idata[1]; + + struct atmegadci_flags sc_flags; +}; + +/* prototypes */ + +usb2_error_t atmegadci_init(struct atmegadci_softc *sc); +void atmegadci_uninit(struct atmegadci_softc *sc); +void atmegadci_suspend(struct atmegadci_softc *sc); +void atmegadci_resume(struct atmegadci_softc *sc); +void atmegadci_interrupt(struct atmegadci_softc *sc); + +#endif /* _ATMEGADCI_H_ */ Copied: head/sys/dev/usb/controller/atmegadci_atmelarm.c (from r188941, head/sys/dev/usb2/controller/atmegadci_atmelarm.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/controller/atmegadci_atmelarm.c Mon Feb 23 18:31:00 2009 (r188942, copy of r188941, head/sys/dev/usb2/controller/atmegadci_atmelarm.c) @@ -0,0 +1,27 @@ +#include +__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. + */ Copied and modified: head/sys/dev/usb/controller/ehci.c (from r188941, head/sys/dev/usb2/controller/ehci2.c) ============================================================================== --- head/sys/dev/usb2/controller/ehci2.c Mon Feb 23 18:22:49 2009 (r188941, copy source) +++ head/sys/dev/usb/controller/ehci.c Mon Feb 23 18:31:00 2009 (r188942) @@ -46,26 +46,26 @@ #include __FBSDID("$FreeBSD$"); -#include -#include -#include -#include +#include +#include +#include +#include #define USB_DEBUG_VAR ehcidebug -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Feb 23 18:33:01 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 78EC21065775; Mon, 23 Feb 2009 18:33:01 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5F5E18FC3B; Mon, 23 Feb 2009 18:33:01 +0000 (UTC) (envelope-from thompsa@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 n1NIX1Je032501; Mon, 23 Feb 2009 18:33:01 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1NIX0DU032458; Mon, 23 Feb 2009 18:33:00 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902231833.n1NIX0DU032458@svn.freebsd.org> From: Andrew Thompson Date: Mon, 23 Feb 2009 18:33:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188943 - in head/sys/modules: . netgraph/bluetooth/ubt netgraph/bluetooth/ubtbcmfw sound/driver/uaudio usb usb/at91dci usb/atmegadci usb/aue usb/axe usb/cdce usb/cue usb/ehci usb/kue u... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2009 18:33:04 -0000 Author: thompsa Date: Mon Feb 23 18:32:59 2009 New Revision: 188943 URL: http://svn.freebsd.org/changeset/base/188943 Log: Hook up new USB modules. Added: head/sys/modules/usb/ head/sys/modules/usb/Makefile (contents, props changed) head/sys/modules/usb/at91dci/ head/sys/modules/usb/at91dci/Makefile (contents, props changed) head/sys/modules/usb/atmegadci/ head/sys/modules/usb/atmegadci/Makefile (contents, props changed) head/sys/modules/usb/aue/ head/sys/modules/usb/aue/Makefile (contents, props changed) head/sys/modules/usb/axe/ head/sys/modules/usb/axe/Makefile (contents, props changed) head/sys/modules/usb/cdce/ head/sys/modules/usb/cdce/Makefile (contents, props changed) head/sys/modules/usb/cue/ head/sys/modules/usb/cue/Makefile (contents, props changed) head/sys/modules/usb/ehci/ head/sys/modules/usb/ehci/Makefile (contents, props changed) head/sys/modules/usb/kue/ head/sys/modules/usb/kue/Makefile (contents, props changed) head/sys/modules/usb/musb/ head/sys/modules/usb/musb/Makefile (contents, props changed) head/sys/modules/usb/ohci/ head/sys/modules/usb/ohci/Makefile (contents, props changed) head/sys/modules/usb/quirk/ head/sys/modules/usb/quirk/Makefile (contents, props changed) head/sys/modules/usb/rue/ head/sys/modules/usb/rue/Makefile (contents, props changed) head/sys/modules/usb/rum/ head/sys/modules/usb/rum/Makefile (contents, props changed) head/sys/modules/usb/template/ head/sys/modules/usb/template/Makefile (contents, props changed) head/sys/modules/usb/u3g/ head/sys/modules/usb/u3g/Makefile (contents, props changed) head/sys/modules/usb/uark/ head/sys/modules/usb/uark/Makefile (contents, props changed) head/sys/modules/usb/ubsa/ head/sys/modules/usb/ubsa/Makefile (contents, props changed) head/sys/modules/usb/ubser/ head/sys/modules/usb/ubser/Makefile (contents, props changed) head/sys/modules/usb/uchcom/ head/sys/modules/usb/uchcom/Makefile (contents, props changed) head/sys/modules/usb/ucom/ head/sys/modules/usb/ucom/Makefile (contents, props changed) head/sys/modules/usb/ucycom/ head/sys/modules/usb/ucycom/Makefile (contents, props changed) head/sys/modules/usb/udav/ head/sys/modules/usb/udav/Makefile (contents, props changed) head/sys/modules/usb/udbp/ head/sys/modules/usb/udbp/Makefile (contents, props changed) head/sys/modules/usb/uether/ head/sys/modules/usb/uether/Makefile (contents, props changed) head/sys/modules/usb/ufm/ head/sys/modules/usb/ufm/Makefile (contents, props changed) head/sys/modules/usb/ufoma/ head/sys/modules/usb/ufoma/Makefile (contents, props changed) head/sys/modules/usb/uftdi/ head/sys/modules/usb/uftdi/Makefile (contents, props changed) head/sys/modules/usb/ugensa/ head/sys/modules/usb/ugensa/Makefile (contents, props changed) head/sys/modules/usb/uhci/ head/sys/modules/usb/uhci/Makefile (contents, props changed) head/sys/modules/usb/uhid/ head/sys/modules/usb/uhid/Makefile (contents, props changed) head/sys/modules/usb/uipaq/ head/sys/modules/usb/uipaq/Makefile (contents, props changed) head/sys/modules/usb/ukbd/ head/sys/modules/usb/ukbd/Makefile (contents, props changed) head/sys/modules/usb/ulpt/ head/sys/modules/usb/ulpt/Makefile (contents, props changed) head/sys/modules/usb/umass/ head/sys/modules/usb/umass/Makefile (contents, props changed) head/sys/modules/usb/umct/ head/sys/modules/usb/umct/Makefile (contents, props changed) head/sys/modules/usb/umodem/ head/sys/modules/usb/umodem/Makefile (contents, props changed) head/sys/modules/usb/umoscom/ head/sys/modules/usb/umoscom/Makefile (contents, props changed) head/sys/modules/usb/ums/ head/sys/modules/usb/ums/Makefile (contents, props changed) head/sys/modules/usb/uplcom/ head/sys/modules/usb/uplcom/Makefile (contents, props changed) head/sys/modules/usb/ural/ head/sys/modules/usb/ural/Makefile (contents, props changed) head/sys/modules/usb/urio/ head/sys/modules/usb/urio/Makefile (contents, props changed) head/sys/modules/usb/usb/ head/sys/modules/usb/usb/Makefile (contents, props changed) head/sys/modules/usb/uscanner/ head/sys/modules/usb/uscanner/Makefile (contents, props changed) head/sys/modules/usb/usfs/ head/sys/modules/usb/usfs/Makefile (contents, props changed) head/sys/modules/usb/uslcom/ head/sys/modules/usb/uslcom/Makefile (contents, props changed) head/sys/modules/usb/uss820dci/ head/sys/modules/usb/uss820dci/Makefile (contents, props changed) head/sys/modules/usb/uvisor/ head/sys/modules/usb/uvisor/Makefile (contents, props changed) head/sys/modules/usb/uvscom/ head/sys/modules/usb/uvscom/Makefile (contents, props changed) head/sys/modules/usb/zyd/ head/sys/modules/usb/zyd/Makefile (contents, props changed) Deleted: head/sys/modules/usb2/ Modified: head/sys/modules/Makefile head/sys/modules/netgraph/bluetooth/ubt/Makefile head/sys/modules/netgraph/bluetooth/ubtbcmfw/Makefile head/sys/modules/sound/driver/uaudio/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Mon Feb 23 18:31:00 2009 (r188942) +++ head/sys/modules/Makefile Mon Feb 23 18:32:59 2009 (r188943) @@ -267,6 +267,7 @@ SUBDIR= ${_3dfx} \ udf_iconv \ ${_ufs} \ unionfs \ + usb \ utopia \ ${_vesa} \ vge \ Modified: head/sys/modules/netgraph/bluetooth/ubt/Makefile ============================================================================== --- head/sys/modules/netgraph/bluetooth/ubt/Makefile Mon Feb 23 18:31:00 2009 (r188942) +++ head/sys/modules/netgraph/bluetooth/ubt/Makefile Mon Feb 23 18:32:59 2009 (r188943) @@ -1,12 +1,12 @@ # $Id: Makefile,v 1.2 2003/03/22 23:44:34 max Exp $ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../../netgraph/bluetooth/drivers/ubt +S= ${.CURDIR}/../../../.. -CFLAGS+= -I${.CURDIR}/../../../../netgraph/bluetooth/include \ - -I${.CURDIR}/../../../../netgraph/bluetooth/drivers/ubt +.PATH: $S/dev/usb/bluetooth -KMOD= ng_ubt -SRCS= ng_ubt.c bus_if.h device_if.h opt_usb.h usbdevs.h +KMOD= ng_ubt +SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \ + ng_ubt.c .include Modified: head/sys/modules/netgraph/bluetooth/ubtbcmfw/Makefile ============================================================================== --- head/sys/modules/netgraph/bluetooth/ubtbcmfw/Makefile Mon Feb 23 18:31:00 2009 (r188942) +++ head/sys/modules/netgraph/bluetooth/ubtbcmfw/Makefile Mon Feb 23 18:32:59 2009 (r188943) @@ -1,12 +1,12 @@ # $Id: Makefile,v 1.1 2003/04/27 00:22:12 max Exp $ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../../netgraph/bluetooth/drivers/ubtbcmfw +S= ${.CURDIR}/../../../.. -CFLAGS+= -I${.CURDIR}/../../../../netgraph/bluetooth/include \ - -I${.CURDIR}/../../../../netgraph/bluetooth/drivers/ubtbcmfw +.PATH: $S/dev/usb/bluetooth -KMOD= ubtbcmfw -SRCS= ubtbcmfw.c bus_if.h device_if.h opt_usb.h usbdevs.h +KMOD= ubtbcmfw +SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h vnode_if.h usbdevs.h \ + ubtbcmfw.c .include Modified: head/sys/modules/sound/driver/uaudio/Makefile ============================================================================== --- head/sys/modules/sound/driver/uaudio/Makefile Mon Feb 23 18:31:00 2009 (r188942) +++ head/sys/modules/sound/driver/uaudio/Makefile Mon Feb 23 18:32:59 2009 (r188943) @@ -1,9 +1,12 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../../dev/sound/usb +S= ${.CURDIR}/../../../.. + +.PATH: $S/dev/usb/sound KMOD= snd_uaudio -SRCS= device_if.h bus_if.h opt_usb.h +SRCS= bus_if.h device_if.h usb_if.h vnode_if.h +SRCS+= opt_usb.h opt_bus.h feeder_if.h channel_if.h usbdevs.h SRCS+= uaudio.c uaudio_pcm.c .include Added: head/sys/modules/usb/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/usb/Makefile Mon Feb 23 18:32:59 2009 (r188943) @@ -0,0 +1,44 @@ +# +# $FreeBSD$ +# +# Copyright (c) 2008 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. +# + +SUBDIR = usb +#SUBDIR += ubt bluetooth_ng ubtfw +SUBDIR += ehci musb ohci uhci uss820dci ${_at91dci} ${_atmegadci} +SUBDIR += rum ural zyd +SUBDIR += uhid ukbd ums udbp ufm uscanner +SUBDIR += ucom u3g uark ubsa ubser uchcom ucycom ufoma uftdi ugensa uipaq ulpt \ + umct umodem umoscom uplcom uslcom uvisor uvscom +SUBDIR += uether aue axe cdce cue kue rue udav +SUBDIR += usfs umass urio +SUBDIR += quirk template + +.if ${MACHINE_ARCH} == "arm" +_at91dci= at91dci +_atmegadci= atmegadci +.endif + +.include Added: head/sys/modules/usb/at91dci/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/usb/at91dci/Makefile Mon Feb 23 18:32:59 2009 (r188943) @@ -0,0 +1,42 @@ +# +# $FreeBSD$ +# +# Copyright (c) 2008 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. +# + +S= ${.CURDIR}/../../.. + +.PATH: $S/dev/usb/controller + +KMOD= at91dci +SRCS= bus_if.h device_if.h usb_if.h \ + opt_bus.h opt_usb.h \ + at91dci.c \ + pci_if.h + +.if defined(HAS_ATMELARM) +SRCS+= at91dci_atmelarm.c +.endif + +.include Added: head/sys/modules/usb/atmegadci/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/usb/atmegadci/Makefile Mon Feb 23 18:32:59 2009 (r188943) @@ -0,0 +1,42 @@ +# +# $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. +# + +S= ${.CURDIR}/../../.. + +.PATH: $S/dev/usb/controller + +KMOD= atmegadci +SRCS= bus_if.h device_if.h usb_if.h \ + opt_bus.h opt_usb.h \ + atmegadci.c \ + pci_if.h + +.if defined(HAS_ATMELARM) +SRCS+= atmegadci_atmelarm.c +.endif + +.include Added: head/sys/modules/usb/aue/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/usb/aue/Makefile Mon Feb 23 18:32:59 2009 (r188943) @@ -0,0 +1,37 @@ +# +# $FreeBSD$ +# +# Copyright (c) 2008 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. +# + +S= ${.CURDIR}/../../.. + +.PATH: $S/dev/usb/net + +KMOD= if_aue +SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \ + miibus_if.h opt_inet.h \ + if_aue.c + +.include Added: head/sys/modules/usb/axe/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/usb/axe/Makefile Mon Feb 23 18:32:59 2009 (r188943) @@ -0,0 +1,37 @@ +# +# $FreeBSD$ +# +# Copyright (c) 2008 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. +# + +S= ${.CURDIR}/../../.. + +.PATH: $S/dev/usb/net + +KMOD= if_axe +SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \ + miibus_if.h opt_inet.h \ + if_axe.c + +.include Added: head/sys/modules/usb/cdce/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/usb/cdce/Makefile Mon Feb 23 18:32:59 2009 (r188943) @@ -0,0 +1,37 @@ +# +# $FreeBSD$ +# +# Copyright (c) 2008 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. +# + +S= ${.CURDIR}/../../.. + +.PATH: $S/dev/usb/net + +KMOD= if_cdce +SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \ + miibus_if.h opt_inet.h \ + if_cdce.c + +.include Added: head/sys/modules/usb/cue/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/usb/cue/Makefile Mon Feb 23 18:32:59 2009 (r188943) @@ -0,0 +1,37 @@ +# +# $FreeBSD$ +# +# Copyright (c) 2008 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. +# + +S= ${.CURDIR}/../../.. + +.PATH: $S/dev/usb/net + +KMOD= if_cue +SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \ + miibus_if.h opt_inet.h \ + if_cue.c + +.include Added: head/sys/modules/usb/ehci/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/usb/ehci/Makefile Mon Feb 23 18:32:59 2009 (r188943) @@ -0,0 +1,38 @@ +# +# $FreeBSD$ +# +# Copyright (c) 2008 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. +# + +S= ${.CURDIR}/../../.. + +.PATH: $S/dev/usb/controller + +KMOD= ehci +SRCS= bus_if.h device_if.h usb_if.h \ + opt_bus.h opt_usb.h \ + ehci_pci.c ehci.c ehci.h \ + pci_if.h + +.include Added: head/sys/modules/usb/kue/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/usb/kue/Makefile Mon Feb 23 18:32:59 2009 (r188943) @@ -0,0 +1,37 @@ +# +# $FreeBSD$ +# +# Copyright (c) 2008 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. +# + +S= ${.CURDIR}/../../.. + +.PATH: $S/dev/usb/net + +KMOD= if_kue +SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \ + miibus_if.h opt_inet.h \ + if_kue.c + +.include Added: head/sys/modules/usb/musb/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/usb/musb/Makefile Mon Feb 23 18:32:59 2009 (r188943) @@ -0,0 +1,42 @@ +# +# $FreeBSD$ +# +# Copyright (c) 2008 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. +# + +S= ${.CURDIR}/../../.. + +.PATH: $S/dev/usb/controller + +KMOD= musb +SRCS= bus_if.h device_if.h usb_if.h \ + opt_bus.h opt_usb.h \ + musb_otg.c \ + pci_if.h + +.if defined(HAS_ATMELARM) +SRCS+= musb_otg_atmelarm.c +.endif + +.include Added: head/sys/modules/usb/ohci/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/usb/ohci/Makefile Mon Feb 23 18:32:59 2009 (r188943) @@ -0,0 +1,38 @@ +# +# $FreeBSD$ +# +# Copyright (c) 2008 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. +# + +S= ${.CURDIR}/../../.. + +.PATH: $S/dev/usb/controller + +KMOD= ohci +SRCS= bus_if.h device_if.h usb_if.h \ + opt_bus.h opt_usb.h \ + ohci_pci.c ohci.c ohci.h \ + pci_if.h + +.include Added: head/sys/modules/usb/quirk/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/usb/quirk/Makefile Mon Feb 23 18:32:59 2009 (r188943) @@ -0,0 +1,36 @@ +# +# $FreeBSD$ +# +# Copyright (c) 2008 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. +# + +S= ${.CURDIR}/../../.. + +.PATH: $S/dev/usb/quirk + +KMOD= usb_quirk +SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \ + usb_quirk.c + +.include Added: head/sys/modules/usb/rue/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/usb/rue/Makefile Mon Feb 23 18:32:59 2009 (r188943) @@ -0,0 +1,37 @@ +# +# $FreeBSD$ +# +# Copyright (c) 2008 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. +# + +S= ${.CURDIR}/../../.. + +.PATH: $S/dev/usb/net + +KMOD= if_rue +SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \ + miibus_if.h opt_inet.h \ + if_rue.c + +.include Added: head/sys/modules/usb/rum/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/usb/rum/Makefile Mon Feb 23 18:32:59 2009 (r188943) @@ -0,0 +1,36 @@ +# +# $FreeBSD$ +# +# Copyright (c) 2008 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. +# + +S= ${.CURDIR}/../../.. + +.PATH: $S/dev/usb/wlan + +KMOD= if_rum +SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \ + if_rum.c + +.include Added: head/sys/modules/usb/template/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/usb/template/Makefile Mon Feb 23 18:32:59 2009 (r188943) @@ -0,0 +1,36 @@ +# +# $FreeBSD$ +# +# Copyright (c) 2008 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. +# + +S= ${.CURDIR}/../../.. + +.PATH: $S/dev/usb/template + +KMOD= usb_template +SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h vnode_if.h usbdevs.h \ + usb_template.c usb_template_cdce.c usb_template_msc.c usb_template_mtp.c + +.include Added: head/sys/modules/usb/u3g/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/usb/u3g/Makefile Mon Feb 23 18:32:59 2009 (r188943) @@ -0,0 +1,36 @@ +# +# $FreeBSD$ +# +# Copyright (c) 2008 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. +# + +S= ${.CURDIR}/../../.. + +.PATH: $S/dev/usb/serial + +KMOD= u3g +SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \ + u3g.c + +.include Added: head/sys/modules/usb/uark/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/usb/uark/Makefile Mon Feb 23 18:32:59 2009 (r188943) @@ -0,0 +1,36 @@ +# +# $FreeBSD$ +# +# Copyright (c) 2008 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. +# + +S= ${.CURDIR}/../../.. + +.PATH: $S/dev/usb/serial + +KMOD= uark +SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \ + uark.c + +.include Added: head/sys/modules/usb/ubsa/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/usb/ubsa/Makefile Mon Feb 23 18:32:59 2009 (r188943) @@ -0,0 +1,36 @@ +# +# $FreeBSD$ +# +# Copyright (c) 2008 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. +# + +S= ${.CURDIR}/../../.. + +.PATH: $S/dev/usb/serial + +KMOD= ubsa +SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \ + ubsa.c + +.include Added: head/sys/modules/usb/ubser/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/usb/ubser/Makefile Mon Feb 23 18:32:59 2009 (r188943) @@ -0,0 +1,36 @@ +# +# $FreeBSD$ +# +# Copyright (c) 2008 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. +# + +S= ${.CURDIR}/../../.. + +.PATH: $S/dev/usb/serial + +KMOD= ubser +SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \ + ubser.c + +.include Added: head/sys/modules/usb/uchcom/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/usb/uchcom/Makefile Mon Feb 23 18:32:59 2009 (r188943) @@ -0,0 +1,36 @@ +# +# $FreeBSD$ +# +# Copyright (c) 2008 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. +# + +S= ${.CURDIR}/../../.. + +.PATH: $S/dev/usb/serial + +KMOD= uchcom +SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \ + uchcom.c + +.include Added: head/sys/modules/usb/ucom/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/usb/ucom/Makefile Mon Feb 23 18:32:59 2009 (r188943) @@ -0,0 +1,36 @@ +# +# $FreeBSD$ +# +# Copyright (c) 2008 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. +# + +S= ${.CURDIR}/../../.. + +.PATH: $S/dev/usb/serial + +KMOD= ucom +SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \ + usb_serial.c + +.include Added: head/sys/modules/usb/ucycom/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/usb/ucycom/Makefile Mon Feb 23 18:32:59 2009 (r188943) @@ -0,0 +1,36 @@ +# +# $FreeBSD$ +# +# Copyright (c) 2008 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. +# + +S= ${.CURDIR}/../../.. + +.PATH: $S/dev/usb/serial + +KMOD= ucycom +SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \ + ucycom.c + +.include Added: head/sys/modules/usb/udav/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/usb/udav/Makefile Mon Feb 23 18:32:59 2009 (r188943) @@ -0,0 +1,37 @@ +# +# $FreeBSD$ +# +# Copyright (c) 2008 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. +# + +S= ${.CURDIR}/../../.. + +.PATH: $S/dev/usb/net + +KMOD= if_udav +SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \ + miibus_if.h opt_inet.h \ + if_udav.c + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Feb 23 18:34:57 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E8E11065758; Mon, 23 Feb 2009 18:34:57 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3888E8FC1F; Mon, 23 Feb 2009 18:34:57 +0000 (UTC) (envelope-from thompsa@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 n1NIYvHS032587; Mon, 23 Feb 2009 18:34:57 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1NIYuCx032570; Mon, 23 Feb 2009 18:34:56 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902231834.n1NIYuCx032570@svn.freebsd.org> From: Andrew Thompson Date: Mon, 23 Feb 2009 18:34:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188944 - in head/sys: amd64/conf arm/conf conf i386/conf ia64/conf pc98/conf powerpc/conf sparc64/conf sun4v/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2009 18:35:00 -0000 Author: thompsa Date: Mon Feb 23 18:34:56 2009 New Revision: 188944 URL: http://svn.freebsd.org/changeset/base/188944 Log: Change over the usb kernel options to the new stack (retaining existing naming). The old usb stack can be compiled in my prefixing the name with 'o'. Modified: head/sys/amd64/conf/GENERIC head/sys/amd64/conf/USB2 head/sys/arm/conf/AVILA head/sys/arm/conf/BWCT head/sys/arm/conf/CAMBRIA head/sys/arm/conf/HL200 head/sys/arm/conf/KB920X head/sys/arm/conf/NSLU head/sys/conf/files head/sys/conf/kmod.mk head/sys/i386/conf/GENERIC head/sys/i386/conf/USB2 head/sys/i386/conf/XBOX head/sys/ia64/conf/GENERIC head/sys/pc98/conf/GENERIC head/sys/powerpc/conf/GENERIC head/sys/powerpc/conf/MPC85XX head/sys/sparc64/conf/GENERIC head/sys/sun4v/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Mon Feb 23 18:32:59 2009 (r188943) +++ head/sys/amd64/conf/GENERIC Mon Feb 23 18:34:56 2009 (r188944) @@ -281,97 +281,38 @@ device firmware # firmware assist modul # Note that 'bpf' is required for DHCP. device bpf # Berkeley packet filter -# USB core support -device usb2_core -# USB controller support -device usb2_controller -device usb2_controller_ehci -device usb2_controller_ohci -device usb2_controller_uhci -# USB mass storage support -device usb2_storage -device usb2_storage_mass -# USB ethernet support, requires miibus -device usb2_ethernet -device usb2_ethernet_aue -device usb2_ethernet_axe -device usb2_ethernet_cdce -device usb2_ethernet_cue -device usb2_ethernet_kue -device usb2_ethernet_rue -device usb2_ethernet_dav -# USB wireless LAN support -device usb2_wlan -device usb2_wlan_rum -device usb2_wlan_ral -device usb2_wlan_zyd -# USB serial device support -device usb2_serial -device usb2_serial_ark -device usb2_serial_bsa -device usb2_serial_bser -device usb2_serial_chcom -device usb2_serial_cycom -device usb2_serial_foma -device usb2_serial_ftdi -device usb2_serial_gensa -device usb2_serial_ipaq -device usb2_serial_lpt -device usb2_serial_mct -device usb2_serial_modem -device usb2_serial_moscom -device usb2_serial_plcom -device usb2_serial_slcom -device usb2_serial_visor -device usb2_serial_vscom -# USB bluetooth support -#device usb2_bluetooth -#device usb2_bluetooth_ng -# USB input device support -device usb2_input -device usb2_input_hid -device usb2_input_kbd -device usb2_input_ms -# USB sound and MIDI device support -#device usb2_sound -# USB scanner support -device usb2_image -device usb2_scanner - -# USB support (deprecated) -#device uhci # UHCI PCI->USB interface -#device ohci # OHCI PCI->USB interface -#device ehci # EHCI PCI->USB interface (USB 2.0) -#device usb # USB Bus (required) +# USB support +device uhci # UHCI PCI->USB interface +device ohci # OHCI PCI->USB interface +device ehci # EHCI PCI->USB interface (USB 2.0) +device usb # USB Bus (required) #device udbp # USB Double Bulk Pipe devices -#device ugen # Generic -#device uhid # "Human Interface Devices" -#device ukbd # Keyboard -#device ulpt # Printer -#device umass # Disks/Mass storage - Requires scbus and da -#device ums # Mouse -#device ural # Ralink Technology RT2500USB wireless NICs -#device rum # Ralink Technology RT2501USB wireless NICs -#device urio # Diamond Rio 500 MP3 player -#device uscanner # Scanners +device uhid # "Human Interface Devices" +device ukbd # Keyboard +device ulpt # Printer +device umass # Disks/Mass storage - Requires scbus and da +device ums # Mouse +device ural # Ralink Technology RT2500USB wireless NICs +device rum # Ralink Technology RT2501USB wireless NICs +device urio # Diamond Rio 500 MP3 player +device uscanner # Scanners # USB Serial devices -#device ucom # Generic com ttys -#device uark # Technologies ARK3116 based serial adapters -#device ubsa # Belkin F5U103 and compatible serial adapters -#device uftdi # For FTDI usb serial adapters -#device uipaq # Some WinCE based devices -#device uplcom # Prolific PL-2303 serial adapters -#device uslcom # SI Labs CP2101/CP2102 serial adapters -#device uvisor # Visor and Palm devices -#device uvscom # USB serial support for DDI pocket's PHS +device uark # Technologies ARK3116 based serial adapters +device ubsa # Belkin F5U103 and compatible serial adapters +device uftdi # For FTDI usb serial adapters +device uipaq # Some WinCE based devices +device uplcom # Prolific PL-2303 serial adapters +device uslcom # SI Labs CP2101/CP2102 serial adapters +device uvisor # Visor and Palm devices +device uvscom # USB serial support for DDI pocket's PHS # USB Ethernet, requires miibus -#device aue # ADMtek USB Ethernet -#device axe # ASIX Electronics USB Ethernet -#device cdce # Generic USB over Ethernet -#device cue # CATC USB Ethernet -#device kue # Kawasaki LSI USB Ethernet -#device rue # RealTek RTL8150 USB Ethernet -#device udav # Davicom DM9601E USB +device aue # ADMtek USB Ethernet +device axe # ASIX Electronics USB Ethernet +device cdce # Generic USB over Ethernet +device cue # CATC USB Ethernet +device kue # Kawasaki LSI USB Ethernet +device rue # RealTek RTL8150 USB Ethernet +device udav # Davicom DM9601E USB # FireWire support device firewire # FireWire bus code Modified: head/sys/amd64/conf/USB2 ============================================================================== --- head/sys/amd64/conf/USB2 Mon Feb 23 18:32:59 2009 (r188943) +++ head/sys/amd64/conf/USB2 Mon Feb 23 18:34:56 2009 (r188944) @@ -13,7 +13,6 @@ nodevice uhci nodevice ohci nodevice ehci nodevice usb -nodevice ugen nodevice uhid nodevice ukbd nodevice ulpt @@ -25,7 +24,6 @@ nodevice zyd nodevice urio nodevice uscanner # USB Serial devices -nodevice ucom nodevice u3g nodevice uark nodevice ubsa Modified: head/sys/arm/conf/AVILA ============================================================================== --- head/sys/arm/conf/AVILA Mon Feb 23 18:32:59 2009 (r188943) +++ head/sys/arm/conf/AVILA Mon Feb 23 18:34:56 2009 (r188944) @@ -133,7 +133,6 @@ device usb #options USB_DEBUG device ohci device ehci -device ugen #device umass #device scbus # SCSI bus (required for SCSI) #device da # Direct Access (disks) Modified: head/sys/arm/conf/BWCT ============================================================================== --- head/sys/arm/conf/BWCT Mon Feb 23 18:32:59 2009 (r188943) +++ head/sys/arm/conf/BWCT Mon Feb 23 18:34:56 2009 (r188944) @@ -108,7 +108,6 @@ device bpf # Berkeley packet filter #options USB_DEBUG #device ohci #device usb -#device ugen #device umass # Disks/Mass storage - Requires scbus and da #device at91_qdmmc Modified: head/sys/arm/conf/CAMBRIA ============================================================================== --- head/sys/arm/conf/CAMBRIA Mon Feb 23 18:32:59 2009 (r188943) +++ head/sys/arm/conf/CAMBRIA Mon Feb 23 18:34:56 2009 (r188944) @@ -103,7 +103,6 @@ device usb options USB_EHCI_BIG_ENDIAN_DESC # handle big-endian byte order #options USB_DEBUG device ehci -device ugen device umass device scbus # SCSI bus (required for SCSI) device da # Direct Access (disks) Modified: head/sys/arm/conf/HL200 ============================================================================== --- head/sys/arm/conf/HL200 Mon Feb 23 18:32:59 2009 (r188943) +++ head/sys/arm/conf/HL200 Mon Feb 23 18:34:56 2009 (r188944) @@ -97,7 +97,6 @@ device bpf device ohci # OHCI localbus->USB interface device usb # USB Bus (required) #device udbp # USB Double Bulk Pipe devices -device ugen # Generic device uhid # "Human Interface Devices" device ulpt # Printer device umass # Disks/Mass storage - Requires scbus and da @@ -115,7 +114,6 @@ device kue # Kawasa device rue # RealTek RTL8150 USB Ethernet device udav # usb serial -device ucom device uark device ubsa #device ubser # not yet converted. Modified: head/sys/arm/conf/KB920X ============================================================================== --- head/sys/arm/conf/KB920X Mon Feb 23 18:32:59 2009 (r188943) +++ head/sys/arm/conf/KB920X Mon Feb 23 18:34:56 2009 (r188944) @@ -98,7 +98,6 @@ device bpf device ohci # OHCI localbus->USB interface device usb # USB Bus (required) #device udbp # USB Double Bulk Pipe devices -device ugen # Generic device uhid # "Human Interface Devices" device ulpt # Printer device umass # Disks/Mass storage - Requires scbus and da @@ -116,7 +115,6 @@ device kue # Kawasa device rue # RealTek RTL8150 USB Ethernet device udav # usb serial -device ucom device uark device ubsa device uftdi Modified: head/sys/arm/conf/NSLU ============================================================================== --- head/sys/arm/conf/NSLU Mon Feb 23 18:32:59 2009 (r188943) +++ head/sys/arm/conf/NSLU Mon Feb 23 18:34:56 2009 (r188944) @@ -112,7 +112,6 @@ device usb options USB_DEBUG device ohci device ehci -device ugen device umass device scbus # SCSI bus (required for SCSI) device da # Direct Access (disks) Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Feb 23 18:32:59 2009 (r188943) +++ head/sys/conf/files Mon Feb 23 18:34:56 2009 (r188944) @@ -80,12 +80,12 @@ teken_state.h optional sc \ compile-with "${AWK} -f $S/dev/syscons/teken/gensequences $S/dev/syscons/teken/sequences > teken_state.h" \ no-obj no-implicit-rule before-depend \ clean "teken_state.h" -usbdevs.h optional usb | usb2_core \ +usbdevs.h optional usb | ousb \ dependency "$S/tools/usbdevs2h.awk $S/dev/usb/usbdevs" \ compile-with "${AWK} -f $S/tools/usbdevs2h.awk $S/dev/usb/usbdevs -h" \ no-obj no-implicit-rule before-depend \ clean "usbdevs.h" -usbdevs_data.h optional usb | usb2_core \ +usbdevs_data.h optional usb | ousb \ dependency "$S/tools/usbdevs2h.awk $S/dev/usb/usbdevs" \ compile-with "${AWK} -f $S/tools/usbdevs2h.awk $S/dev/usb/usbdevs -d" \ no-obj no-implicit-rule before-depend \ @@ -502,7 +502,7 @@ dev/ata/chipsets/ata-sis.c optional ata dev/ata/chipsets/ata-via.c optional ata pci | atavia dev/ata/ata-disk.c optional atadisk dev/ata/ata-raid.c optional ataraid -dev/ata/ata-usb.c optional atausb +dev/ata/ata-usb.c optional atausb ousb dev/ata/atapi-cd.c optional atapicd dev/ata/atapi-fd.c optional atapifd dev/ata/atapi-tape.c optional atapist @@ -1393,9 +1393,9 @@ dev/sound/pcm/mixer_if.m optional sound dev/sound/pcm/sndstat.c optional sound dev/sound/pcm/sound.c optional sound dev/sound/pcm/vchan.c optional sound -#dev/sound/usb/upcm.c optional snd_upcm usb -dev/sound/usb/uaudio.c optional snd_uaudio usb -dev/sound/usb/uaudio_pcm.c optional snd_uaudio usb +#dev/sound/usb/upcm.c optional snd_upcm ousb +dev/sound/usb/uaudio.c optional snd_uaudio ousb +dev/sound/usb/uaudio_pcm.c optional snd_uaudio ousb dev/sound/midi/midi.c optional sound dev/sound/midi/mpu401.c optional sound dev/sound/midi/mpu_if.m optional sound @@ -1478,200 +1478,188 @@ dev/uart/uart_tty.c optional uart dev/ubsec/ubsec.c optional ubsec # # USB support -dev/usb/ehci.c optional ehci -dev/usb/ehci_ddb.c optional ehci -dev/usb/ehci_pci.c optional ehci pci -dev/usb/hid.c optional usb -dev/usb/if_aue.c optional aue -dev/usb/if_axe.c optional axe -dev/usb/if_cdce.c optional cdce -dev/usb/if_cue.c optional cue -dev/usb/if_kue.c optional kue -dev/usb/if_ural.c optional ural -dev/usb/if_rue.c optional rue -dev/usb/if_rum.c optional rum -dev/usb/if_udav.c optional udav -dev/usb/if_zyd.c optional zyd -dev/usb/ohci.c optional ohci -dev/usb/ohci_pci.c optional ohci pci -dev/usb/sl811hs.c optional slhci -dev/usb/slhci_pccard.c optional slhci pccard -dev/usb/uark.c optional uark -dev/usb/u3g.c optional u3g -dev/usb/ubsa.c optional ubsa -dev/usb/ubser.c optional ubser -dev/usb/ucom.c optional ucom -dev/usb/ucycom.c optional ucycom -dev/usb/udbp.c optional udbp -dev/usb/ufoma.c optional ufoma -dev/usb/ufm.c optional ufm -dev/usb/uftdi.c optional uftdi -dev/usb/ugen.c optional ugen -dev/usb/uhci.c optional uhci -dev/usb/uhci_pci.c optional uhci pci -dev/usb/uhid.c optional uhid -dev/usb/uhub.c optional usb -dev/usb/uipaq.c optional uipaq -dev/usb/ukbd.c optional ukbd -dev/usb/ulpt.c optional ulpt -dev/usb/umass.c optional umass -dev/usb/umct.c optional umct -dev/usb/umodem.c optional umodem -dev/usb/ums.c optional ums -dev/usb/uplcom.c optional uplcom -dev/usb/urio.c optional urio -dev/usb/usb.c optional usb -dev/usb/usb_ethersubr.c optional usb +legacy/dev/usb/ehci.c optional oehci +legacy/dev/usb/ehci_ddb.c optional oehci +legacy/dev/usb/ehci_pci.c optional oehci pci +legacy/dev/usb/hid.c optional ousb +legacy/dev/usb/if_aue.c optional oaue +legacy/dev/usb/if_axe.c optional oaxe +legacy/dev/usb/if_cdce.c optional ocdce +legacy/dev/usb/if_cue.c optional ocue +legacy/dev/usb/if_kue.c optional okue +legacy/dev/usb/if_ural.c optional oural +legacy/dev/usb/if_rue.c optional orue +legacy/dev/usb/if_rum.c optional orum +legacy/dev/usb/if_udav.c optional oudav +legacy/dev/usb/if_zyd.c optional ozyd +legacy/dev/usb/ohci.c optional oohci +legacy/dev/usb/ohci_pci.c optional oohci pci +legacy/dev/usb/sl811hs.c optional oslhci +legacy/dev/usb/slhci_pccard.c optional oslhci pccard +legacy/dev/usb/uark.c optional ouark +legacy/dev/usb/u3g.c optional ou3g +legacy/dev/usb/ubsa.c optional oubsa +legacy/dev/usb/ubser.c optional oubser +legacy/dev/usb/ucom.c optional oucom +legacy/dev/usb/ucycom.c optional oucycom +legacy/dev/usb/udbp.c optional oudbp +legacy/dev/usb/ufoma.c optional oufoma +legacy/dev/usb/ufm.c optional oufm +legacy/dev/usb/uftdi.c optional ouftdi +legacy/dev/usb/ugen.c optional ougen +legacy/dev/usb/uhci.c optional ouhci +legacy/dev/usb/uhci_pci.c optional ouhci pci +legacy/dev/usb/uhid.c optional ouhid +legacy/dev/usb/uhub.c optional ousb +legacy/dev/usb/uipaq.c optional ouipaq +legacy/dev/usb/ukbd.c optional oukbd +legacy/dev/usb/ulpt.c optional oulpt +legacy/dev/usb/umass.c optional oumass +legacy/dev/usb/umct.c optional oumct +legacy/dev/usb/umodem.c optional oumodem +legacy/dev/usb/ums.c optional oums +legacy/dev/usb/uplcom.c optional ouplcom +legacy/dev/usb/urio.c optional ourio +legacy/dev/usb/usb.c optional ousb +legacy/dev/usb/usb_ethersubr.c optional ousb +legacy/dev/usb/usb_if.m optional ousb +legacy/dev/usb/usb_mem.c optional ousb +legacy/dev/usb/usb_quirks.c optional ousb +legacy/dev/usb/usb_subr.c optional ousb +legacy/dev/usb/usbdi.c optional ousb +legacy/dev/usb/usbdi_util.c optional ousb +legacy/dev/usb/uscanner.c optional ouscanner +legacy/dev/usb/uslcom.c optional ouslcom +legacy/dev/usb/uvisor.c optional ouvisor +legacy/dev/usb/uvscom.c optional ouvscom +# +# USB controller drivers +# +dev/usb/controller/at91dci.c optional at91dci +dev/usb/controller/at91dci_atmelarm.c optional at91dci at91rm9200 +dev/usb/controller/musb_otg.c optional musb +dev/usb/controller/musb_otg_atmelarm.c optional musb at91rm9200 +dev/usb/controller/ehci.c optional ehci +dev/usb/controller/ehci_pci.c optional ehci pci +dev/usb/controller/ohci.c optional ohci +dev/usb/controller/ohci_atmelarm.c optional ohci at91rm9200 +dev/usb/controller/ohci_pci.c optional ohci pci +dev/usb/controller/uhci.c optional uhci +dev/usb/controller/uhci_pci.c optional uhci pci +dev/usb/controller/uss820dci.c optional uss820dci +dev/usb/controller/uss820dci_atmelarm.c optional uss820dci at91rm9200 +dev/usb/controller/usb_controller.c optional usb +# +# USB storage drivers +# +dev/usb/storage/ata-usb.c optional atausb +dev/usb/storage/umass.c optional umass +dev/usb/storage/urio.c optional urio +dev/usb/storage/ustorage_fs.c optional usfs +# +# USB core +# +dev/usb/usb_busdma.c optional usb +dev/usb/usb_compat_linux.c optional usb +dev/usb/usb_core.c optional usb +dev/usb/usb_debug.c optional usb +dev/usb/usb_dev.c optional usb +dev/usb/usb_device.c optional usb +dev/usb/usb_dynamic.c optional usb +dev/usb/usb_error.c optional usb +dev/usb/usb_generic.c optional usb +dev/usb/usb_handle_request.c optional usb +dev/usb/usb_hid.c optional usb +dev/usb/usb_hub.c optional usb dev/usb/usb_if.m optional usb -dev/usb/usb_mem.c optional usb -dev/usb/usb_quirks.c optional usb -dev/usb/usb_subr.c optional usb -dev/usb/usbdi.c optional usb -dev/usb/usbdi_util.c optional usb -dev/usb/uscanner.c optional uscanner -dev/usb/uslcom.c optional uslcom -dev/usb/uvisor.c optional uvisor -dev/usb/uvscom.c optional uvscom -# -# USB2 controller drivers -# -dev/usb2/controller/at91dci.c optional usb2_core usb2_controller usb2_controller_at91dci -dev/usb2/controller/at91dci_atmelarm.c optional usb2_core usb2_controller usb2_controller_at91dci at91rm9200 -dev/usb2/controller/musb2_otg.c optional usb2_core usb2_controller usb2_controller_musb -dev/usb2/controller/musb2_otg_atmelarm.c optional usb2_core usb2_controller usb2_controller_musb at91rm9200 -dev/usb2/controller/ehci2.c optional usb2_core usb2_controller usb2_controller_ehci -dev/usb2/controller/ehci2_pci.c optional usb2_core usb2_controller usb2_controller_ehci pci -dev/usb2/controller/ohci2.c optional usb2_core usb2_controller usb2_controller_ohci -dev/usb2/controller/ohci2_atmelarm.c optional usb2_core usb2_controller usb2_controller_ohci at91rm9200 -dev/usb2/controller/ohci2_pci.c optional usb2_core usb2_controller usb2_controller_ohci pci -dev/usb2/controller/uhci2.c optional usb2_core usb2_controller usb2_controller_uhci -dev/usb2/controller/uhci2_pci.c optional usb2_core usb2_controller usb2_controller_uhci pci -dev/usb2/controller/uss820dci.c optional usb2_core usb2_controller usb2_controller_uss820dci -dev/usb2/controller/uss820dci_atmelarm.c optional usb2_core usb2_controller usb2_controller_uss820dci at91rm9200 -dev/usb2/controller/usb2_controller.c optional usb2_core usb2_controller -# -# USB2 storage drivers -# -dev/usb2/storage/ata-usb2.c optional usb2_core usb2_storage usb2_storage_ata -dev/usb2/storage/umass2.c optional usb2_core usb2_storage usb2_storage_mass -dev/usb2/storage/urio2.c optional usb2_core usb2_storage usb2_storage_rio -dev/usb2/storage/usb2_storage.c optional usb2_core usb2_storage -dev/usb2/storage/ustorage2_fs.c optional usb2_core usb2_storage usb2_storage_fs -# -# USB2 NDIS driver -# -dev/usb2/ndis/if_ndis_usb2.c optional usb2_core usb2_ndis -dev/usb2/ndis/usb2_ndis.c optional usb2_core usb2_ndis -# -# USB2 core -# -dev/usb2/core/usb2_busdma.c optional usb2_core -dev/usb2/core/usb2_compat_linux.c optional usb2_core -dev/usb2/core/usb2_core.c optional usb2_core -dev/usb2/core/usb2_debug.c optional usb2_core -dev/usb2/core/usb2_dev.c optional usb2_core -dev/usb2/core/usb2_device.c optional usb2_core -dev/usb2/core/usb2_dynamic.c optional usb2_core -dev/usb2/core/usb2_error.c optional usb2_core -dev/usb2/core/usb2_generic.c optional usb2_core -dev/usb2/core/usb2_handle_request.c optional usb2_core -dev/usb2/core/usb2_hid.c optional usb2_core -dev/usb2/core/usb2_hub.c optional usb2_core -dev/usb2/core/usb2_if.m optional usb2_core -dev/usb2/core/usb2_lookup.c optional usb2_core -dev/usb2/core/usb2_mbuf.c optional usb2_core -dev/usb2/core/usb2_msctest.c optional usb2_core -dev/usb2/core/usb2_parse.c optional usb2_core -dev/usb2/core/usb2_process.c optional usb2_core -dev/usb2/core/usb2_request.c optional usb2_core -dev/usb2/core/usb2_sw_transfer.c optional usb2_core -dev/usb2/core/usb2_transfer.c optional usb2_core -dev/usb2/core/usb2_util.c optional usb2_core -# -# USB2 ethernet drivers -# -dev/usb2/ethernet/if_aue2.c optional usb2_core usb2_ethernet usb2_ethernet_aue -dev/usb2/ethernet/if_axe2.c optional usb2_core usb2_ethernet usb2_ethernet_axe -dev/usb2/ethernet/if_cdce2.c optional usb2_core usb2_ethernet usb2_ethernet_cdce -dev/usb2/ethernet/if_cue2.c optional usb2_core usb2_ethernet usb2_ethernet_cue -dev/usb2/ethernet/if_kue2.c optional usb2_core usb2_ethernet usb2_ethernet_kue -dev/usb2/ethernet/if_rue2.c optional usb2_core usb2_ethernet usb2_ethernet_rue -dev/usb2/ethernet/if_udav2.c optional usb2_core usb2_ethernet usb2_ethernet_dav -dev/usb2/ethernet/usb2_ethernet.c optional usb2_core usb2_ethernet -# -# USB2 WLAN drivers -# -dev/usb2/wlan/if_rum2.c optional usb2_core usb2_wlan usb2_wlan_rum -dev/usb2/wlan/if_ural2.c optional usb2_core usb2_wlan usb2_wlan_ral -dev/usb2/wlan/if_zyd2.c optional usb2_core usb2_wlan usb2_wlan_zyd -dev/usb2/wlan/usb2_wlan.c optional usb2_core usb2_wlan -# -# 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 -dev/usb2/serial/uchcom2.c optional usb2_core usb2_serial usb2_serial_chcom -dev/usb2/serial/ucycom2.c optional usb2_core usb2_serial usb2_serial_cycom -dev/usb2/serial/ufoma2.c optional usb2_core usb2_serial usb2_serial_foma -dev/usb2/serial/uftdi2.c optional usb2_core usb2_serial usb2_serial_ftdi -dev/usb2/serial/ugensa2.c optional usb2_core usb2_serial usb2_serial_gensa -dev/usb2/serial/uipaq2.c optional usb2_core usb2_serial usb2_serial_ipaq -dev/usb2/serial/ulpt2.c optional usb2_core usb2_serial usb2_serial_lpt -dev/usb2/serial/umct2.c optional usb2_core usb2_serial usb2_serial_mct -dev/usb2/serial/umodem2.c optional usb2_core usb2_serial usb2_serial_modem -dev/usb2/serial/umoscom2.c optional usb2_core usb2_serial usb2_serial_moscom -dev/usb2/serial/uplcom2.c optional usb2_core usb2_serial usb2_serial_plcom -dev/usb2/serial/uslcom2.c optional usb2_core usb2_serial usb2_serial_slcom -dev/usb2/serial/usb2_serial.c optional usb2_core usb2_serial -dev/usb2/serial/uvisor2.c optional usb2_core usb2_serial usb2_serial_visor -dev/usb2/serial/uvscom2.c optional usb2_core usb2_serial usb2_serial_vscom -dev/usb2/serial/u3g2.c optional usb2_core usb2_serial usb2_serial_3g -# -# USB2 bluetooth drivers -# -dev/usb2/bluetooth/usb2_bluetooth.c optional usb2_core usb2_bluetooth -dev/usb2/bluetooth/ng_ubt2.c optional usb2_core usb2_bluetooth usb2_bluetooth_ng -dev/usb2/bluetooth/ubtbcmfw2.c optional usb2_core usb2_bluetooth usb2_bluetooth_fw - -# -# USB2 misc drivers -# -dev/usb2/misc/usb2_misc.c optional usb2_core usb2_misc -dev/usb2/misc/ufm2.c optional usb2_core usb2_misc usb2_misc_fm -dev/usb2/misc/udbp2.c optional usb2_core usb2_misc usb2_misc_dbp -# -# USB2 input drivers -# -dev/usb2/input/uhid2.c optional usb2_core usb2_input usb2_input_hid -dev/usb2/input/ukbd2.c optional usb2_core usb2_input usb2_input_kbd -dev/usb2/input/ums2.c optional usb2_core usb2_input usb2_input_ms -dev/usb2/input/usb2_input.c optional usb2_core usb2_input -# -# USB2 quirks -# -dev/usb2/quirk/usb2_quirk.c optional usb2_core usb2_quirk -# -# USB2 templates -# -dev/usb2/template/usb2_template.c optional usb2_core usb2_template -dev/usb2/template/usb2_template_cdce.c optional usb2_core usb2_template -dev/usb2/template/usb2_template_msc.c optional usb2_core usb2_template -dev/usb2/template/usb2_template_mtp.c optional usb2_core usb2_template -# -# USB2 image drivers +dev/usb/usb_lookup.c optional usb +dev/usb/usb_mbuf.c optional usb +dev/usb/usb_msctest.c optional usb +dev/usb/usb_parse.c optional usb +dev/usb/usb_process.c optional usb +dev/usb/usb_request.c optional usb +dev/usb/usb_sw_transfer.c optional usb +dev/usb/usb_transfer.c optional usb +dev/usb/usb_util.c optional usb +# +# USB ethernet drivers +# +dev/usb/net/if_aue.c optional aue +dev/usb/net/if_axe.c optional axe +dev/usb/net/if_cdce.c optional cdce +dev/usb/net/if_cue.c optional cue +dev/usb/net/if_kue.c optional kue +dev/usb/net/if_rue.c optional rue +dev/usb/net/if_udav.c optional udav +dev/usb/net/usb_ethernet.c \ + optional (aue | axe | cdce | cue | kue | rue | udav) +# +# USB WLAN drivers +# +dev/usb/wlan/if_rum.c optional rum +dev/usb/wlan/if_ural.c optional ural +dev/usb/wlan/if_zyd.c optional zyd +# +# USB serial and parallel port drivers +# +dev/usb/serial/u3g.c optional u3g +dev/usb/serial/uark.c optional uark +dev/usb/serial/ubsa.c optional ubsa +dev/usb/serial/ubser.c optional ubser +dev/usb/serial/uchcom.c optional uchcom +dev/usb/serial/ucycom.c optional ucycom +dev/usb/serial/ufoma.c optional ufoma +dev/usb/serial/uftdi.c optional uftdi +dev/usb/serial/ugensa.c optional ugensa +dev/usb/serial/uipaq.c optional uipaq +dev/usb/serial/ulpt.c optional ulpt +dev/usb/serial/umct.c optional umct +dev/usb/serial/umodem.c optional umodem +dev/usb/serial/umoscom.c optional umoscom +dev/usb/serial/uplcom.c optional uplcom +dev/usb/serial/uslcom.c optional uslcom +dev/usb/serial/uvisor.c optional uvisor +dev/usb/serial/uvscom.c optional uvscom +dev/usb/serial/usb_serial.c \ + optional (ucom | u3g | uark | ubsa | ubser | uchcom | ucycom | ufoma | uftdi | ugensa | uipaq | ulpt | umct | umodem | umoscom | uplcom | uslcom | uvisor | uvscom) +# +# USB bluetooth drivers +# +dev/usb/bluetooth/ng_ubt.c optional ubt +dev/usb/bluetooth/ubtbcmfw.c optional ubtbcmfw +# +# USB misc drivers +# +dev/usb/misc/ufm.c optional ufm +dev/usb/misc/udbp.c optional udbp +# +# USB input drivers +# +dev/usb/input/uhid.c optional uhid +dev/usb/input/ukbd.c optional ukbd +dev/usb/input/ums.c optional ums +# +# USB quirks +# +dev/usb/quirk/usb_quirk.c optional usb +# +# USB templates +# +dev/usb/template/usb_template.c optional usb_template +dev/usb/template/usb_template_cdce.c optional usb_template +dev/usb/template/usb_template_msc.c optional usb_template +dev/usb/template/usb_template_mtp.c optional usb_template +# +# USB image drivers # -dev/usb2/image/usb2_image.c optional usb2_core usb2_image -dev/usb2/image/uscanner2.c optional usb2_core usb2_image usb2_scanner +dev/usb/image/uscanner.c optional uscanner # -# USB2 sound and MIDI drivers +# USB sound and MIDI drivers # -dev/usb2/sound/usb2_sound.c optional usb2_core usb2_sound -dev/usb2/sound/uaudio2.c optional usb2_core usb2_sound -dev/usb2/sound/uaudio2_pcm.c optional usb2_core usb2_sound +dev/usb/sound/uaudio.c optional usound +dev/usb/sound/uaudio_pcm.c optional usound # -# USB2 END +# USB END # dev/utopia/idtphy.c optional utopia dev/utopia/suni.c optional utopia Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Mon Feb 23 18:32:59 2009 (r188943) +++ head/sys/conf/kmod.mk Mon Feb 23 18:34:56 2009 (r188944) @@ -330,7 +330,6 @@ MFILES?= dev/acpica/acpi_if.m dev/agp/ag dev/sound/pcm/feeder_if.m dev/sound/pcm/mixer_if.m \ dev/sound/midi/mpu_if.m dev/sound/midi/mpufoi_if.m \ dev/sound/midi/synth_if.m dev/usb/usb_if.m isa/isa_if.m \ - dev/usb2/core/usb2_if.m \ kern/bus_if.m kern/clock_if.m \ kern/cpufreq_if.m kern/device_if.m kern/serdev_if.m \ libkern/iconv_converter_if.m opencrypto/cryptodev_if.m \ Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Mon Feb 23 18:32:59 2009 (r188943) +++ head/sys/i386/conf/GENERIC Mon Feb 23 18:34:56 2009 (r188944) @@ -294,99 +294,40 @@ device firmware # firmware assist modul # Note that 'bpf' is required for DHCP. device bpf # Berkeley packet filter -# USB core support -device usb2_core -# USB controller support -device usb2_controller -device usb2_controller_ehci -device usb2_controller_ohci -device usb2_controller_uhci -# USB mass storage support -device usb2_storage -device usb2_storage_mass -# USB ethernet support, requires miibus -device usb2_ethernet -device usb2_ethernet_aue -device usb2_ethernet_axe -device usb2_ethernet_cdce -device usb2_ethernet_cue -device usb2_ethernet_kue -device usb2_ethernet_rue -device usb2_ethernet_dav -# USB wireless LAN support -device usb2_wlan -device usb2_wlan_rum -device usb2_wlan_ral -device usb2_wlan_zyd -# USB serial device support -device usb2_serial -device usb2_serial_ark -device usb2_serial_bsa -device usb2_serial_bser -device usb2_serial_chcom -device usb2_serial_cycom -device usb2_serial_foma -device usb2_serial_ftdi -device usb2_serial_gensa -device usb2_serial_ipaq -device usb2_serial_lpt -device usb2_serial_mct -device usb2_serial_modem -device usb2_serial_moscom -device usb2_serial_plcom -device usb2_serial_slcom -device usb2_serial_visor -device usb2_serial_vscom -# USB bluetooth support -#device usb2_bluetooth -#device usb2_bluetooth_ng -# USB input device support -device usb2_input -device usb2_input_hid -device usb2_input_kbd -device usb2_input_ms -# USB sound and MIDI device support -#device usb2_sound -# USB scanner support -device usb2_image -device usb2_scanner - -# USB support (deprecated) -#device uhci # UHCI PCI->USB interface -#device ohci # OHCI PCI->USB interface -#device ehci # EHCI PCI->USB interface (USB 2.0) -#device usb # USB Bus (required) +# USB support +device uhci # UHCI PCI->USB interface +device ohci # OHCI PCI->USB interface +device ehci # EHCI PCI->USB interface (USB 2.0) +device usb # USB Bus (required) #device udbp # USB Double Bulk Pipe devices -#device ugen # Generic -#device uhid # "Human Interface Devices" -#device ukbd # Keyboard -#device ulpt # Printer -#device umass # Disks/Mass storage - Requires scbus and da -#device ums # Mouse -#device ural # Ralink Technology RT2500USB wireless NICs -#device rum # Ralink Technology RT2501USB wireless NICs -#device zyd # ZyDAS zb1211/zb1211b wireless NICs -#device urio # Diamond Rio 500 MP3 player -#device uscanner # Scanners +device uhid # "Human Interface Devices" +device ukbd # Keyboard +device ulpt # Printer +device umass # Disks/Mass storage - Requires scbus and da +device ums # Mouse +device ural # Ralink Technology RT2500USB wireless NICs +device rum # Ralink Technology RT2501USB wireless NICs +device zyd # ZyDAS zb1211/zb1211b wireless NICs +device urio # Diamond Rio 500 MP3 player +device uscanner # Scanners # USB Serial devices -#device ucom # Generic com ttys -#device u3g # USB-based 3G modems (Option, Huawei, Sierra) -#device uark # Technologies ARK3116 based serial adapters -#device ubsa # Belkin F5U103 and compatible serial adapters -#device uftdi # For FTDI usb serial adapters -#device uipaq # Some WinCE based devices -#device uplcom # Prolific PL-2303 serial adapters -#device uslcom # SI Labs CP2101/CP2102 serial adapters -#device uvisor # Visor and Palm devices -#device uvscom # USB serial support for DDI pocket's PHS +device u3g # USB-based 3G modems (Option, Huawei, Sierra) +device uark # Technologies ARK3116 based serial adapters +device ubsa # Belkin F5U103 and compatible serial adapters +device uftdi # For FTDI usb serial adapters +device uipaq # Some WinCE based devices +device uplcom # Prolific PL-2303 serial adapters +device uslcom # SI Labs CP2101/CP2102 serial adapters +device uvisor # Visor and Palm devices +device uvscom # USB serial support for DDI pocket's PHS # USB Ethernet, requires miibus -#device aue # ADMtek USB Ethernet -#device axe # ASIX Electronics USB Ethernet -#device cdce # Generic USB over Ethernet -#device cue # CATC USB Ethernet -#device kue # Kawasaki LSI USB Ethernet -#device rue # RealTek RTL8150 USB Ethernet -#device udav # Davicom DM9601E USB +device aue # ADMtek USB Ethernet +device axe # ASIX Electronics USB Ethernet +device cdce # Generic USB over Ethernet +device cue # CATC USB Ethernet +device kue # Kawasaki LSI USB Ethernet +device rue # RealTek RTL8150 USB Ethernet +device udav # Davicom DM9601E USB # FireWire support device firewire # FireWire bus code Modified: head/sys/i386/conf/USB2 ============================================================================== --- head/sys/i386/conf/USB2 Mon Feb 23 18:32:59 2009 (r188943) +++ head/sys/i386/conf/USB2 Mon Feb 23 18:34:56 2009 (r188944) @@ -13,7 +13,6 @@ nodevice uhci nodevice ohci nodevice ehci nodevice usb -nodevice ugen nodevice uhid nodevice ukbd nodevice ulpt @@ -25,7 +24,6 @@ nodevice zyd nodevice urio nodevice uscanner # USB Serial devices -nodevice ucom nodevice u3g nodevice uark nodevice ubsa Modified: head/sys/i386/conf/XBOX ============================================================================== --- head/sys/i386/conf/XBOX Mon Feb 23 18:32:59 2009 (r188943) +++ head/sys/i386/conf/XBOX Mon Feb 23 18:34:56 2009 (r188944) @@ -85,7 +85,6 @@ device bpf # Berkeley packet filter #device uhci # UHCI PCI->USB interface device ohci # OHCI PCI->USB interface device usb # USB Bus (required) -device ugen # Generic device uhid # "Human Interface Devices" device ukbd # Keyboard device ulpt # Printer Modified: head/sys/ia64/conf/GENERIC ============================================================================== --- head/sys/ia64/conf/GENERIC Mon Feb 23 18:32:59 2009 (r188943) +++ head/sys/ia64/conf/GENERIC Mon Feb 23 18:34:56 2009 (r188944) @@ -70,8 +70,7 @@ device firewire # FireWire bus code device miibus # MII bus support (Ethernet) device pci # PCI bus support device scbus # SCSI bus (required for SCSI) -#device usb # USB Bus (required for USB) -device usb2_core # USB Bus (required for USB) +device usb # USB Bus (required for USB) # ATA and ATAPI devices device ata # ATA controller @@ -108,57 +107,15 @@ device amr # AMI MegaRAID device ida # Compaq Smart RAID device mlx # Mylex DAC960 family -# USB controller support -device usb2_controller -device usb2_controller_ehci -device usb2_controller_ohci -device usb2_controller_uhci -# USB mass storage support -device usb2_storage -device usb2_storage_mass -# USB serial device support -device usb2_serial -device usb2_serial_ark -device usb2_serial_bsa -device usb2_serial_bser -device usb2_serial_chcom -device usb2_serial_cycom -device usb2_serial_foma -device usb2_serial_ftdi -device usb2_serial_gensa -device usb2_serial_ipaq -device usb2_serial_lpt -device usb2_serial_mct -device usb2_serial_modem -device usb2_serial_moscom -device usb2_serial_plcom -device usb2_serial_slcom -device usb2_serial_visor -device usb2_serial_vscom -# USB bluetooth support -#device usb2_bluetooth -#device usb2_bluetooth_ng -# USB input device support -device usb2_input -device usb2_input_hid -device usb2_input_kbd -device usb2_input_ms -# USB sound and MIDI device support -#device usb2_sound -# USB scanner support -#device usb2_image -#device usb2_scanner - # USB host controllers and peripherals -#device ehci # EHCI host controller -#device ohci # OHCI PCI->USB interface -#device ugen # Generic device -#device uhci # UHCI PCI->USB interface -#device uhid # Human Interface Devices -#device ukbd # Keyboard -#device ulpt # Printer -#device umass # Disks/Mass storage (need scbus & da) -#device ums # Mouse +device ehci # EHCI host controller +device ohci # OHCI PCI->USB interface +device uhci # UHCI PCI->USB interface +device uhid # Human Interface Devices +device ukbd # Keyboard +device ulpt # Printer +device umass # Disks/Mass storage (need scbus & da) +device ums # Mouse # PCI Ethernet NICs. device de # DEC/Intel DC21x4x (``Tulip'') @@ -178,21 +135,11 @@ device sf # Adaptec AIC-6915 (``Starfi device sis # Silicon Integrated Systems SiS 900/SiS 7016 device xl # 3Com 3c90x ("Boomerang", "Cyclone") -# USB ethernet support, requires miibus -device usb2_ethernet -device usb2_ethernet_aue -device usb2_ethernet_axe -device usb2_ethernet_cdce -device usb2_ethernet_cue -device usb2_ethernet_kue -device usb2_ethernet_rue -device usb2_ethernet_dav - -# USB Ethernet (deprecated) -#device aue # ADMtek USB Ethernet -#device cdce # Generic USB over Ethernet -#device cue # CATC USB Ethernet -#device kue # Kawasaki LSI USB Ethernet +# USB Ethernet +device aue # ADMtek USB Ethernet +device cdce # Generic USB over Ethernet +device cue # CATC USB Ethernet +device kue # Kawasaki LSI USB Ethernet # FireWire support device sbp # SCSI over FireWire (need scbus & da) Modified: head/sys/pc98/conf/GENERIC ============================================================================== --- head/sys/pc98/conf/GENERIC Mon Feb 23 18:32:59 2009 (r188943) +++ head/sys/pc98/conf/GENERIC Mon Feb 23 18:34:56 2009 (r188944) @@ -250,70 +250,12 @@ device firmware # firmware assist modul # Note that 'bpf' is required for DHCP. device bpf # Berkeley packet filter -# USB core support -#device usb2_core -# USB controller support -#device usb2_controller -#device usb2_controller_ehci -#device usb2_controller_ohci -#device usb2_controller_uhci -# USB mass storage support -#device usb2_storage -#device usb2_storage_mass -# USB ethernet support, requires miibus -#device usb2_ethernet -#device usb2_ethernet_aue -#device usb2_ethernet_axe -#device usb2_ethernet_cdce -#device usb2_ethernet_cue -#device usb2_ethernet_kue -#device usb2_ethernet_rue -#device usb2_ethernet_dav -# USB wireless LAN support -#device usb2_wlan -#device usb2_wlan_rum -#device usb2_wlan_ral -#device usb2_wlan_zyd -# USB serial device support -#device usb2_serial -#device usb2_serial_ark -#device usb2_serial_bsa -#device usb2_serial_bser -#device usb2_serial_chcom -#device usb2_serial_cycom -#device usb2_serial_foma -#device usb2_serial_ftdi -#device usb2_serial_gensa -#device usb2_serial_ipaq -#device usb2_serial_lpt -#device usb2_serial_mct -#device usb2_serial_modem -#device usb2_serial_moscom -#device usb2_serial_plcom -#device usb2_serial_slcom -#device usb2_serial_visor -#device usb2_serial_vscom -# USB bluetooth support -#device usb2_bluetooth -#device usb2_bluetooth_ng -# USB input device support -#device usb2_input -#device usb2_input_hid -#device usb2_input_kbd -#device usb2_input_ms -# USB sound and MIDI device support -#device usb2_sound -# USB scanner support -#device usb2_image -#device usb2_scanner - -# USB support (deprecated) +# USB support #device uhci # UHCI PCI->USB interface #device ohci # OHCI PCI->USB interface #device ehci # EHCI PCI->USB interface (USB 2.0) #device usb # USB Bus (required) #device udbp # USB Double Bulk Pipe devices -#device ugen # Generic #device uhid # "Human Interface Devices" #device ukbd # Keyboard #device ulpt # Printer @@ -325,7 +267,6 @@ device bpf # Berkeley packet filter #device urio # Diamond Rio 500 MP3 player #device uscanner # Scanners # USB Serial devices -#device ucom # Generic com ttys #device uark # Technologies ARK3116 based serial adapters #device ubsa # Belkin F5U103 and compatible serial adapters #device ubser # BWCT console serial adapters Modified: head/sys/powerpc/conf/GENERIC ============================================================================== --- head/sys/powerpc/conf/GENERIC Mon Feb 23 18:32:59 2009 (r188943) +++ head/sys/powerpc/conf/GENERIC Mon Feb 23 18:34:56 2009 (r188944) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Feb 23 18:36:55 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68BC110656CF; Mon, 23 Feb 2009 18:36:55 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3C2348FC37; Mon, 23 Feb 2009 18:36:55 +0000 (UTC) (envelope-from thompsa@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 n1NIatC7032671; Mon, 23 Feb 2009 18:36:55 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1NIasQM032661; Mon, 23 Feb 2009 18:36:54 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902231836.n1NIasQM032661@svn.freebsd.org> From: Andrew Thompson Date: Mon, 23 Feb 2009 18:36:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188945 - in head: etc/mtree include lib/libusb20 lib/libusbhid share/man/man7 usr.bin/usbhidaction usr.bin/usbhidctl usr.sbin/bluetooth/bcmfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2009 18:36:58 -0000 Author: thompsa Date: Mon Feb 23 18:36:54 2009 New Revision: 188945 URL: http://svn.freebsd.org/changeset/base/188945 Log: Build fixups for the new USB stack. Modified: head/etc/mtree/BSD.include.dist head/include/Makefile head/lib/libusb20/libusb20_ugen20.c head/lib/libusbhid/descr.c head/lib/libusbhid/descr_compat.c head/lib/libusbhid/usbvar.h head/share/man/man7/hier.7 head/usr.bin/usbhidaction/usbhidaction.c head/usr.bin/usbhidctl/usbhid.c head/usr.sbin/bluetooth/bcmfw/bcmfw.c Modified: head/etc/mtree/BSD.include.dist ============================================================================== --- head/etc/mtree/BSD.include.dist Mon Feb 23 18:34:56 2009 (r188944) +++ head/etc/mtree/BSD.include.dist Mon Feb 23 18:36:54 2009 (r188945) @@ -120,10 +120,6 @@ .. usb .. - usb2 - include - .. - .. utopia .. vkbd Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Mon Feb 23 18:34:56 2009 (r188944) +++ head/include/Makefile Mon Feb 23 18:36:54 2009 (r188945) @@ -54,7 +54,7 @@ LSUBDIRS= cam/scsi \ security/mac_mls security/mac_partition \ ufs/ffs ufs/ufs -LSUBSUBDIRS= dev/mpt/mpilib dev/usb2/include +LSUBSUBDIRS= dev/mpt/mpilib .if ${MACHINE_ARCH} == "powerpc" _dev_powermac_nvram= dev/powermac_nvram Modified: head/lib/libusb20/libusb20_ugen20.c ============================================================================== --- head/lib/libusb20/libusb20_ugen20.c Mon Feb 23 18:34:56 2009 (r188944) +++ head/lib/libusb20/libusb20_ugen20.c Mon Feb 23 18:36:54 2009 (r188945) @@ -39,11 +39,11 @@ #include "libusb20_desc.h" #include "libusb20_int.h" -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include static libusb20_init_backend_t ugen20_init_backend; static libusb20_open_device_t ugen20_open_device; Modified: head/lib/libusbhid/descr.c ============================================================================== --- head/lib/libusbhid/descr.c Mon Feb 23 18:34:56 2009 (r188944) +++ head/lib/libusbhid/descr.c Mon Feb 23 18:36:54 2009 (r188945) @@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include "usbhid.h" #include "usbvar.h" @@ -49,8 +49,10 @@ hid_set_immed(int fd, int enable) { int ret; ret = ioctl(fd, USB_SET_IMMED, &enable); +#ifdef HID_COMPAT7 if (ret < 0) ret = hid_set_immed_compat7(fd, enable); +#endif return (ret); } @@ -61,9 +63,11 @@ hid_get_report_id(int fd) int ret; ret = ioctl(fd, USB_GET_REPORT_ID, &temp); +#ifdef HID_COMPAT7 if (ret < 0) ret = hid_get_report_id_compat7(fd); else +#endif ret = temp; return (ret); @@ -81,11 +85,13 @@ hid_get_report_desc(int fd) /* get actual length first */ ugd.ugd_data = NULL; ugd.ugd_maxlen = 65535; +#ifdef HID_COMPAT7 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)); } +#endif /* * NOTE: The kernel will return a failure if Modified: head/lib/libusbhid/descr_compat.c ============================================================================== --- head/lib/libusbhid/descr_compat.c Mon Feb 23 18:34:56 2009 (r188944) +++ head/lib/libusbhid/descr_compat.c Mon Feb 23 18:36:54 2009 (r188945) @@ -28,6 +28,7 @@ * This file contains fallback-compatibility code for the old FreeBSD * USB stack. */ +#ifdef HID_COMPAT7 #include __FBSDID("$FreeBSD$"); @@ -75,3 +76,4 @@ hid_get_report_desc_compat7(int fd) return (hid_use_report_desc(rep.ucrd_data, (unsigned int)rep.ucrd_size)); } +#endif /* HID_COMPAT7 */ Modified: head/lib/libusbhid/usbvar.h ============================================================================== --- head/lib/libusbhid/usbvar.h Mon Feb 23 18:34:56 2009 (r188944) +++ head/lib/libusbhid/usbvar.h Mon Feb 23 18:36:54 2009 (r188945) @@ -36,6 +36,8 @@ struct report_desc { /* internal backwards compatibility functions */ +#ifdef HID_COMPAT7 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); +#endif Modified: head/share/man/man7/hier.7 ============================================================================== --- head/share/man/man7/hier.7 Mon Feb 23 18:34:56 2009 (r188944) +++ head/share/man/man7/hier.7 Mon Feb 23 18:36:54 2009 (r188945) @@ -232,8 +232,6 @@ see .Xr ppbus 4 .It Pa usb/ The USB subsystem -.It Pa usb2/include -The USB subsystem .It Pa utopia/ Physical chip driver for ATM interfaces; see Modified: head/usr.bin/usbhidaction/usbhidaction.c ============================================================================== --- head/usr.bin/usbhidaction/usbhidaction.c Mon Feb 23 18:34:56 2009 (r188944) +++ head/usr.bin/usbhidaction/usbhidaction.c Mon Feb 23 18:36:54 2009 (r188945) @@ -46,7 +46,7 @@ #include #include #include -#include +#include #include #include #include Modified: head/usr.bin/usbhidctl/usbhid.c ============================================================================== --- head/usr.bin/usbhidctl/usbhid.c Mon Feb 23 18:34:56 2009 (r188944) +++ head/usr.bin/usbhidctl/usbhid.c Mon Feb 23 18:36:54 2009 (r188945) @@ -47,7 +47,7 @@ #include #include #include -#include +#include int verbose = 0; int all = 0; Modified: head/usr.sbin/bluetooth/bcmfw/bcmfw.c ============================================================================== --- head/usr.sbin/bluetooth/bcmfw/bcmfw.c Mon Feb 23 18:34:56 2009 (r188944) +++ head/usr.sbin/bluetooth/bcmfw/bcmfw.c Mon Feb 23 18:36:54 2009 (r188945) @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include From owner-svn-src-head@FreeBSD.ORG Mon Feb 23 18:56:50 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 017B11065A0D; Mon, 23 Feb 2009 18:56:49 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E11488FC16; Mon, 23 Feb 2009 18:56:49 +0000 (UTC) (envelope-from thompsa@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 n1NIunDJ033068; Mon, 23 Feb 2009 18:56:49 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1NIunjw033066; Mon, 23 Feb 2009 18:56:49 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902231856.n1NIunjw033066@svn.freebsd.org> From: Andrew Thompson Date: Mon, 23 Feb 2009 18:56:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188946 - in head: . sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2009 18:56:52 -0000 Author: thompsa Date: Mon Feb 23 18:56:49 2009 New Revision: 188946 URL: http://svn.freebsd.org/changeset/base/188946 Log: Add an UPDATING entry and bump the OS version to 800064. Modified: head/UPDATING head/sys/sys/param.h Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon Feb 23 18:36:54 2009 (r188945) +++ head/UPDATING Mon Feb 23 18:56:49 2009 (r188946) @@ -22,6 +22,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20090223: + The new USB2 stack has now been permanently moved in and all kernel and + module names revered to their previous values (eg, usb, ehci, ohci, + ums, ...). The old usb stack can be compled in by prefixing the name + with the letter 'o', the old usb modules have been removed. + Updating entry 20090216 for xorg may still apply. + 20090217: The rc.conf(5) option if_up_delay has been renamed to defaultroute_delay to better reflect its purpose. If you have Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Mon Feb 23 18:36:54 2009 (r188945) +++ head/sys/sys/param.h Mon Feb 23 18:56:49 2009 (r188946) @@ -57,7 +57,7 @@ * is created, otherwise 1. */ #undef __FreeBSD_version -#define __FreeBSD_version 800063 /* Master, propagated to newvers */ +#define __FreeBSD_version 800064 /* Master, propagated to newvers */ #ifndef LOCORE #include From owner-svn-src-head@FreeBSD.ORG Mon Feb 23 19:06:47 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6BA51065678; Mon, 23 Feb 2009 19:06:47 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9438F8FC16; Mon, 23 Feb 2009 19:06:47 +0000 (UTC) (envelope-from thompsa@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 n1NJ6lKN033305; Mon, 23 Feb 2009 19:06:47 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1NJ6l8J033304; Mon, 23 Feb 2009 19:06:47 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902231906.n1NJ6l8J033304@svn.freebsd.org> From: Andrew Thompson Date: Mon, 23 Feb 2009 19:06:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188947 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2009 19:06:49 -0000 Author: thompsa Date: Mon Feb 23 19:06:47 2009 New Revision: 188947 URL: http://svn.freebsd.org/changeset/base/188947 Log: Reintroduce r188878, provide compat typedefs for usb1. Modified: head/sys/dev/usb/usb.h Modified: head/sys/dev/usb/usb.h ============================================================================== --- head/sys/dev/usb/usb.h Mon Feb 23 18:56:49 2009 (r188946) +++ head/sys/dev/usb/usb.h Mon Feb 23 19:06:47 2009 (r188947) @@ -109,6 +109,7 @@ struct usb2_device_request { uWord wIndex; uWord wLength; } __packed; +typedef struct usb2_device_request usb_device_request_t; #define UT_WRITE 0x00 #define UT_READ 0x80 @@ -230,6 +231,7 @@ struct usb2_descriptor { uByte bDescriptorType; uByte bDescriptorSubtype; } __packed; +typedef struct usb2_descriptor usb_descriptor_t; struct usb2_device_descriptor { uByte bLength; @@ -252,6 +254,7 @@ struct usb2_device_descriptor { uByte iSerialNumber; uByte bNumConfigurations; } __packed; +typedef struct usb2_device_descriptor usb_device_descriptor_t; /* Binary Device Object Store (BOS) */ struct usb2_bos_descriptor { @@ -260,6 +263,7 @@ struct usb2_bos_descriptor { uWord wTotalLength; uByte bNumDeviceCaps; } __packed; +typedef struct usb2_bos_descriptor usb_bos_descriptor_t; /* Binary Device Object Store Capability */ struct usb2_bos_cap_descriptor { @@ -273,6 +277,7 @@ struct usb2_bos_cap_descriptor { #define USB_DEVCAP_CONTAINER_ID 0x04 /* data ... */ } __packed; +typedef struct usb2_bos_cap_descriptor usb_bos_cap_descriptor_t; struct usb2_devcap_usb2ext_descriptor { uByte bLength; @@ -281,6 +286,7 @@ struct usb2_devcap_usb2ext_descriptor { uByte bmAttributes; #define USB_V2EXT_LPM 0x02 } __packed; +typedef struct usb2_devcap_usb2ext_descriptor usb_devcap_usb2ext_descriptor_t; struct usb2_devcap_ss_descriptor { uByte bLength; @@ -292,6 +298,7 @@ struct usb2_devcap_ss_descriptor { uByte bU1DevExitLat; uByte bU2DevExitLat; } __packed; +typedef struct usb2_devcap_ss_descriptor usb_devcap_ss_descriptor_t; struct usb2_devcap_container_id_descriptor { uByte bLength; @@ -300,6 +307,8 @@ struct usb2_devcap_container_id_descript uByte bReserved; uByte ContainerID; } __packed; +typedef struct usb2_devcap_container_id_descriptor + usb_devcap_container_id_descriptor_t; /* Device class codes */ #define UDCLASS_IN_INTERFACE 0x00 @@ -330,6 +339,7 @@ struct usb2_config_descriptor { uByte bMaxPower; /* max current in 2 mA units */ #define UC_POWER_FACTOR 2 } __packed; +typedef struct usb2_config_descriptor usb_config_descriptor_t; struct usb2_interface_descriptor { uByte bLength; @@ -342,6 +352,7 @@ struct usb2_interface_descriptor { uByte bInterfaceProtocol; uByte iInterface; } __packed; +typedef struct usb2_interface_descriptor usb_interface_descriptor_t; struct usb2_interface_assoc_descriptor { uByte bLength; @@ -353,6 +364,7 @@ struct usb2_interface_assoc_descriptor { uByte bFunctionProtocol; uByte iFunction; } __packed; +typedef struct usb2_interface_assoc_descriptor usb_interface_assoc_descriptor_t; /* Interface class codes */ #define UICLASS_UNSPEC 0x00 @@ -473,6 +485,7 @@ struct usb2_endpoint_descriptor { #define UE_ZERO_MPS 0xFFFF /* for internal use only */ uByte bInterval; } __packed; +typedef struct usb2_endpoint_descriptor usb_endpoint_descriptor_t; struct usb2_endpoint_ss_comp_descriptor { uByte bLength; @@ -481,6 +494,8 @@ struct usb2_endpoint_ss_comp_descriptor uByte bmAttributes; uWord wBytesPerInterval; } __packed; +typedef struct usb2_endpoint_ss_comp_descriptor + usb_endpoint_ss_comp_descriptor_t; struct usb2_string_descriptor { uByte bLength; @@ -488,6 +503,7 @@ struct usb2_string_descriptor { uWord bString[126]; uByte bUnused; } __packed; +typedef struct usb2_string_descriptor usb_string_descriptor_t; #define USB_MAKE_STRING_DESC(m,name) \ struct name { \ @@ -529,6 +545,7 @@ struct usb2_hub_descriptor { (((desc)->DeviceRemovable[(i)/8] >> ((i) % 8)) & 1) uByte PortPowerCtrlMask[1]; /* deprecated */ } __packed; +typedef struct usb2_hub_descriptor usb_hub_descriptor_t; struct usb2_hub_ss_descriptor { uByte bDescLength; @@ -541,6 +558,7 @@ struct usb2_hub_ss_descriptor { uWord wHubDelay; uByte DeviceRemovable[2]; /* max 15 ports */ } __packed; +typedef struct usb2_hub_ss_descriptor usb_hub_ss_descriptor_t; /* minimum HUB descriptor (8-ports maximum) */ struct usb2_hub_descriptor_min { @@ -553,6 +571,7 @@ struct usb2_hub_descriptor_min { uByte DeviceRemovable[1]; uByte PortPowerCtrlMask[1]; } __packed; +typedef struct usb2_hub_descriptor_min usb_hub_descriptor_min_t; struct usb2_device_qualifier { uByte bLength; @@ -565,6 +584,7 @@ struct usb2_device_qualifier { uByte bNumConfigurations; uByte bReserved; } __packed; +typedef struct usb2_device_qualifier usb_device_qualifier_t; struct usb2_otg_descriptor { uByte bLength; @@ -573,6 +593,7 @@ struct usb2_otg_descriptor { #define UOTG_SRP 0x01 #define UOTG_HNP 0x02 } __packed; +typedef struct usb2_otg_descriptor usb_otg_descriptor_t; /* OTG feature selectors */ #define UOTG_B_HNP_ENABLE 3 @@ -587,6 +608,7 @@ struct usb2_status { /* Endpoint status flags */ #define UES_HALT 0x0001 } __packed; +typedef struct usb2_status usb_status_t; struct usb2_hub_status { uWord wHubStatus; @@ -594,6 +616,7 @@ struct usb2_hub_status { #define UHS_OVER_CURRENT 0x0002 uWord wHubChange; } __packed; +typedef struct usb2_hub_status usb_hub_status_t; struct usb2_port_status { uWord wPortStatus; @@ -615,5 +638,6 @@ struct usb2_port_status { #define UPS_C_OVERCURRENT_INDICATOR 0x0008 #define UPS_C_PORT_RESET 0x0010 } __packed; +typedef struct usb2_port_status usb_port_status_t; #endif /* _USB2_STANDARD_H_ */ From owner-svn-src-head@FreeBSD.ORG Mon Feb 23 19:13:15 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51C111065702; Mon, 23 Feb 2009 19:13:13 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 37D3B8FC1C; Mon, 23 Feb 2009 19:13:13 +0000 (UTC) (envelope-from thompsa@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 n1NJDDUi033455; Mon, 23 Feb 2009 19:13:13 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1NJDDtN033453; Mon, 23 Feb 2009 19:13:13 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902231913.n1NJDDtN033453@svn.freebsd.org> From: Andrew Thompson Date: Mon, 23 Feb 2009 19:13:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188948 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2009 19:13:17 -0000 Author: thompsa Date: Mon Feb 23 19:13:12 2009 New Revision: 188948 URL: http://svn.freebsd.org/changeset/base/188948 Log: Add ObsoleteFiles entries for the USB changeover. Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon Feb 23 19:06:47 2009 (r188947) +++ head/ObsoleteFiles.inc Mon Feb 23 19:13:12 2009 (r188948) @@ -14,6 +14,49 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # +# 20090223: changeover of USB stacks +OLD_DIRS+=usr/include/dev/usb2 +OLD_FILES+=usr/include/dev/usb/dsbr100io.h +OLD_FILES+=usr/include/dev/usb/ehcireg.h +OLD_FILES+=usr/include/dev/usb/ehcivar.h +OLD_FILES+=usr/include/dev/usb/hid.h +OLD_FILES+=usr/include/dev/usb/if_auereg.h +OLD_FILES+=usr/include/dev/usb/if_axereg.h +OLD_FILES+=usr/include/dev/usb/if_cdcereg.h +OLD_FILES+=usr/include/dev/usb/if_cuereg.h +OLD_FILES+=usr/include/dev/usb/if_kuereg.h +OLD_FILES+=usr/include/dev/usb/if_ruereg.h +OLD_FILES+=usr/include/dev/usb/if_rumreg.h +OLD_FILES+=usr/include/dev/usb/if_rumvar.h +OLD_FILES+=usr/include/dev/usb/if_udavreg.h +OLD_FILES+=usr/include/dev/usb/if_upgtvar.h +OLD_FILES+=usr/include/dev/usb/if_uralreg.h +OLD_FILES+=usr/include/dev/usb/if_uralvar.h +OLD_FILES+=usr/include/dev/usb/if_zydfw.h +OLD_FILES+=usr/include/dev/usb/if_zydreg.h +OLD_FILES+=usr/include/dev/usb/kue_fw.h +OLD_FILES+=usr/include/dev/usb/ohcireg.h +OLD_FILES+=usr/include/dev/usb/ohcivar.h +OLD_FILES+=usr/include/dev/usb/rio500_usb.h +OLD_FILES+=usr/include/dev/usb/rt2573_ucode.h +OLD_FILES+=usr/include/dev/usb/sl811hsreg.h +OLD_FILES+=usr/include/dev/usb/sl811hsvar.h +OLD_FILES+=usr/include/dev/usb/ubser.h +OLD_FILES+=usr/include/dev/usb/ucomvar.h +OLD_FILES+=usr/include/dev/usb/udbp.h +OLD_FILES+=usr/include/dev/usb/uftdireg.h +OLD_FILES+=usr/include/dev/usb/ugraphire_rdesc.h +OLD_FILES+=usr/include/dev/usb/uhcireg.h +OLD_FILES+=usr/include/dev/usb/uhcivar.h +OLD_FILES+=usr/include/dev/usb/usb_ethersubr.h +OLD_FILES+=usr/include/dev/usb/usb_mem.h +OLD_FILES+=usr/include/dev/usb/usb_port.h +OLD_FILES+=usr/include/dev/usb/usb_quirks.h +OLD_FILES+=usr/include/dev/usb/usbcdc.h +OLD_FILES+=usr/include/dev/usb/usbdi.h +OLD_FILES+=usr/include/dev/usb/usbdi_util.h +OLD_FILES+=usr/include/dev/usb/usbdivar.h +OLD_FILES+=usr/include/dev/usb/uxb360gp_rdesc.h # 20090203: removal of pccard header files OLD_FILES+=usr/include/pccard/cardinfo.h OLD_FILES+=usr/include/pccard/cis.h From owner-svn-src-head@FreeBSD.ORG Mon Feb 23 19:28:29 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC1F410656C6; Mon, 23 Feb 2009 19:28:29 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9AE828FC14; Mon, 23 Feb 2009 19:28:29 +0000 (UTC) (envelope-from thompsa@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 n1NJSTdq033760; Mon, 23 Feb 2009 19:28:29 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1NJSTOw033759; Mon, 23 Feb 2009 19:28:29 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902231928.n1NJSTOw033759@svn.freebsd.org> From: Andrew Thompson Date: Mon, 23 Feb 2009 19:28:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188949 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2009 19:28:30 -0000 Author: thompsa Date: Mon Feb 23 19:28:29 2009 New Revision: 188949 URL: http://svn.freebsd.org/changeset/base/188949 Log: Fix spelling. Spotted by: Fabian Keil Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon Feb 23 19:13:12 2009 (r188948) +++ head/UPDATING Mon Feb 23 19:28:29 2009 (r188949) @@ -25,7 +25,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. 20090223: The new USB2 stack has now been permanently moved in and all kernel and module names revered to their previous values (eg, usb, ehci, ohci, - ums, ...). The old usb stack can be compled in by prefixing the name + ums, ...). The old usb stack can be compiled in by prefixing the name with the letter 'o', the old usb modules have been removed. Updating entry 20090216 for xorg may still apply. From owner-svn-src-head@FreeBSD.ORG Mon Feb 23 19:30:00 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 823721065676; Mon, 23 Feb 2009 19:30:00 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 711DB8FC1F; Mon, 23 Feb 2009 19:30:00 +0000 (UTC) (envelope-from thompsa@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 n1NJU0rN033832; Mon, 23 Feb 2009 19:30:00 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1NJU0wY033831; Mon, 23 Feb 2009 19:30:00 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902231930.n1NJU0wY033831@svn.freebsd.org> From: Andrew Thompson Date: Mon, 23 Feb 2009 19:30:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188950 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2009 19:30:01 -0000 Author: thompsa Date: Mon Feb 23 19:30:00 2009 New Revision: 188950 URL: http://svn.freebsd.org/changeset/base/188950 Log: Fix spelling (again). Spotted by: Fabian Keil Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon Feb 23 19:28:29 2009 (r188949) +++ head/UPDATING Mon Feb 23 19:30:00 2009 (r188950) @@ -24,7 +24,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. 20090223: The new USB2 stack has now been permanently moved in and all kernel and - module names revered to their previous values (eg, usb, ehci, ohci, + module names reverted to their previous values (eg, usb, ehci, ohci, ums, ...). The old usb stack can be compiled in by prefixing the name with the letter 'o', the old usb modules have been removed. Updating entry 20090216 for xorg may still apply. From owner-svn-src-head@FreeBSD.ORG Mon Feb 23 19:31:48 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC8FB1065689; Mon, 23 Feb 2009 19:31:48 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CB0FA8FC08; Mon, 23 Feb 2009 19:31:48 +0000 (UTC) (envelope-from nwhitehorn@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 n1NJVmMY033900; Mon, 23 Feb 2009 19:31:48 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1NJVmnL033899; Mon, 23 Feb 2009 19:31:48 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200902231931.n1NJVmnL033899@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 23 Feb 2009 19:31:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188951 - head/sys/powerpc/aim X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2009 19:31:51 -0000 Author: nwhitehorn Date: Mon Feb 23 19:31:48 2009 New Revision: 188951 URL: http://svn.freebsd.org/changeset/base/188951 Log: Fix comment: we write the trap vector to SPRG3, not SPRG0. Modified: head/sys/powerpc/aim/trap_subr.S Modified: head/sys/powerpc/aim/trap_subr.S ============================================================================== --- head/sys/powerpc/aim/trap_subr.S Mon Feb 23 19:30:00 2009 (r188950) +++ head/sys/powerpc/aim/trap_subr.S Mon Feb 23 19:31:48 2009 (r188951) @@ -288,7 +288,7 @@ CNAME(alitrap): mflr %r28 /* save LR */ mfcr %r29 /* save CR */ - /* Put our exception vector in SPRG0 */ + /* Put our exception vector in SPRG3 */ li %r31, EXC_ALI mtsprg3 %r31 @@ -360,7 +360,7 @@ CNAME(dsisize) = .-CNAME(dsitrap) * Preamble code for DSI/ISI traps */ disitrap: - /* Write the trap vector to SPRG0 by computing LR & 0xff00 */ + /* Write the trap vector to SPRG3 by computing LR & 0xff00 */ mflr %r1 andi. %r1,%r1,0xff00 mtsprg3 %r1 @@ -533,7 +533,7 @@ CNAME(breakpoint): * Now the kdb trap catching code. */ dbtrap: - /* Write the trap vector to SPRG0 by computing LR & 0xff00 */ + /* Write the trap vector to SPRG3 by computing LR & 0xff00 */ mflr %r1 andi. %r1,%r1,0xff00 mtsprg3 %r1 From owner-svn-src-head@FreeBSD.ORG Mon Feb 23 20:56:28 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 263F3106566B; Mon, 23 Feb 2009 20:56:28 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 150898FC1A; Mon, 23 Feb 2009 20:56:28 +0000 (UTC) (envelope-from trasz@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 n1NKuRGY035891; Mon, 23 Feb 2009 20:56:27 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1NKuR8v035890; Mon, 23 Feb 2009 20:56:27 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200902232056.n1NKuR8v035890@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 23 Feb 2009 20:56:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188954 - head/sys/ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2009 20:56:28 -0000 Author: trasz Date: Mon Feb 23 20:56:27 2009 New Revision: 188954 URL: http://svn.freebsd.org/changeset/base/188954 Log: Refactor, moving error checking outside of the 'if (mp->mnt_flag & MNT_SOFTDEP)' conditional. No functional changes. Reviewed by: kib Approved by: rwatson (mentor) Tested by: pho Sponsored by: FreeBSD Foundation Modified: head/sys/ufs/ffs/ffs_vfsops.c Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Mon Feb 23 19:58:35 2009 (r188953) +++ head/sys/ufs/ffs/ffs_vfsops.c Mon Feb 23 20:56:27 2009 (r188954) @@ -1075,13 +1075,13 @@ ffs_unmount(mp, mntflags, td) vn_start_write(NULL, &mp, V_WAIT); } } - if (mp->mnt_flag & MNT_SOFTDEP) { - if ((error = softdep_flushfiles(mp, flags, td)) != 0) - goto fail; - } else { - if ((error = ffs_flushfiles(mp, flags, td)) != 0) - goto fail; - } + if (mp->mnt_flag & MNT_SOFTDEP) + error = softdep_flushfiles(mp, flags, td); + else + error = ffs_flushfiles(mp, flags, td); + if (error != 0) + goto fail; + UFS_LOCK(ump); if (fs->fs_pendingblocks != 0 || fs->fs_pendinginodes != 0) { printf("%s: unmount pending error: blocks %jd files %d\n", From owner-svn-src-head@FreeBSD.ORG Mon Feb 23 21:07:20 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 724B0106564A; Mon, 23 Feb 2009 21:07:20 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5DC0F8FC16; Mon, 23 Feb 2009 21:07:20 +0000 (UTC) (envelope-from thompsa@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 n1NL7K0v036148; Mon, 23 Feb 2009 21:07:20 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1NL7K9g036144; Mon, 23 Feb 2009 21:07:20 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902232107.n1NL7K9g036144@svn.freebsd.org> From: Andrew Thompson Date: Mon, 23 Feb 2009 21:07:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188955 - in head/sys: conf dev/ata dev/sound/usb legacy/dev/ata legacy/dev/sound legacy/dev/sound/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2009 21:07:21 -0000 Author: thompsa Date: Mon Feb 23 21:07:20 2009 New Revision: 188955 URL: http://svn.freebsd.org/changeset/base/188955 Log: Move two missed usb drivers out to the graveyard location under sys/legacy/dev. Added: head/sys/legacy/dev/ata/ head/sys/legacy/dev/ata/ata-usb.c (props changed) - copied unchanged from r188941, head/sys/dev/ata/ata-usb.c head/sys/legacy/dev/sound/ head/sys/legacy/dev/sound/usb/ head/sys/legacy/dev/sound/usb/uaudio.c (props changed) - copied unchanged from r188941, head/sys/dev/sound/usb/uaudio.c head/sys/legacy/dev/sound/usb/uaudio.h (props changed) - copied unchanged from r188941, head/sys/dev/sound/usb/uaudio.h head/sys/legacy/dev/sound/usb/uaudio_pcm.c (props changed) - copied unchanged from r188941, head/sys/dev/sound/usb/uaudio_pcm.c head/sys/legacy/dev/sound/usb/uaudioreg.h (props changed) - copied unchanged from r188941, head/sys/dev/sound/usb/uaudioreg.h Deleted: head/sys/dev/ata/ata-usb.c head/sys/dev/sound/usb/uaudio.c head/sys/dev/sound/usb/uaudio.h head/sys/dev/sound/usb/uaudio_pcm.c head/sys/dev/sound/usb/uaudioreg.h Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Feb 23 20:56:27 2009 (r188954) +++ head/sys/conf/files Mon Feb 23 21:07:20 2009 (r188955) @@ -502,7 +502,7 @@ dev/ata/chipsets/ata-sis.c optional ata dev/ata/chipsets/ata-via.c optional ata pci | atavia dev/ata/ata-disk.c optional atadisk dev/ata/ata-raid.c optional ataraid -dev/ata/ata-usb.c optional atausb ousb +legacy/dev/ata/ata-usb.c optional atausb ousb dev/ata/atapi-cd.c optional atapicd dev/ata/atapi-fd.c optional atapifd dev/ata/atapi-tape.c optional atapist @@ -1394,8 +1394,8 @@ dev/sound/pcm/sndstat.c optional sound dev/sound/pcm/sound.c optional sound dev/sound/pcm/vchan.c optional sound #dev/sound/usb/upcm.c optional snd_upcm ousb -dev/sound/usb/uaudio.c optional snd_uaudio ousb -dev/sound/usb/uaudio_pcm.c optional snd_uaudio ousb +legacy/dev/sound/usb/uaudio.c optional snd_uaudio ousb +legacy/dev/sound/usb/uaudio_pcm.c optional snd_uaudio ousb dev/sound/midi/midi.c optional sound dev/sound/midi/mpu401.c optional sound dev/sound/midi/mpu_if.m optional sound Copied: head/sys/legacy/dev/ata/ata-usb.c (from r188941, head/sys/dev/ata/ata-usb.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/legacy/dev/ata/ata-usb.c Mon Feb 23 21:07:20 2009 (r188955, copy of r188941, head/sys/dev/ata/ata-usb.c) @@ -0,0 +1,970 @@ +/*- + * Copyright (c) 2006 - 2008 Sren Schmidt + * 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, + * without modification, immediately at the beginning of the file. + * 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 ``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 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_ata.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* Command Block Wrapper */ +struct bbb_cbw { + u_int8_t signature[4]; +#define CBWSIGNATURE 0x43425355 + + u_int8_t tag[4]; + u_int8_t transfer_length[4]; + u_int8_t flags; +#define CBWFLAGS_OUT 0x00 +#define CBWFLAGS_IN 0x80 + + u_int8_t lun; + u_int8_t length; +#define CBWCDBLENGTH 16 + + u_int8_t cdb[CBWCDBLENGTH]; +}; + +/* Command Status Wrapper */ +struct bbb_csw { + u_int8_t signature[4]; +#define CSWSIGNATURE 0x53425355 + + u_int8_t tag[4]; + u_int8_t residue[4]; + u_int8_t status; +#define CSWSTATUS_GOOD 0x0 +#define CSWSTATUS_FAILED 0x1 +#define CSWSTATUS_PHASE 0x2 +}; + +/* USB-ATA 'controller' softc */ +struct atausb_softc { + device_t dev; /* base device */ + usbd_interface_handle iface; /* interface */ + int ifaceno; /* interface number */ + u_int8_t bulkin; /* endpoint address's */ + u_int8_t bulkout; + u_int8_t bulkirq; + usbd_pipe_handle bulkin_pipe; /* pipe handle's */ + usbd_pipe_handle bulkout_pipe; + usbd_pipe_handle bulkirq_pipe; + int maxlun; + int timeout; + struct ata_request *ata_request; + usb_device_request_t usb_request; + struct bbb_cbw cbw; + struct bbb_csw csw; + +#define ATAUSB_T_BBB_CBW 0 +#define ATAUSB_T_BBB_DATA 1 +#define ATAUSB_T_BBB_DCLEAR 2 +#define ATAUSB_T_BBB_CSW1 3 +#define ATAUSB_T_BBB_CSW2 4 +#define ATAUSB_T_BBB_SCLEAR 5 +#define ATAUSB_T_BBB_RESET1 6 +#define ATAUSB_T_BBB_RESET2 7 +#define ATAUSB_T_BBB_RESET3 8 +#define ATAUSB_T_MAX 9 + usbd_xfer_handle transfer[ATAUSB_T_MAX]; + + int state; +#define ATAUSB_S_ATTACH 0 +#define ATAUSB_S_IDLE 1 +#define ATAUSB_S_BBB_COMMAND 2 +#define ATAUSB_S_BBB_DATA 3 +#define ATAUSB_S_BBB_DCLEAR 4 +#define ATAUSB_S_BBB_STATUS1 5 +#define ATAUSB_S_BBB_SCLEAR 6 +#define ATAUSB_S_BBB_STATUS2 7 +#define ATAUSB_S_BBB_RESET1 8 +#define ATAUSB_S_BBB_RESET2 9 +#define ATAUSB_S_BBB_RESET3 10 +#define ATAUSB_S_DETACH 11 + + struct mtx locked_mtx; + struct ata_channel *locked_ch; + struct ata_channel *restart_ch; +}; + +static int atausbdebug = 0; + +/* prototypes*/ +static usbd_status atausb_start(struct atausb_softc *sc, usbd_pipe_handle pipe, void *buffer, int buflen, int flags, usbd_xfer_handle xfer); +static usbd_status atausb_ctl_start(struct atausb_softc *sc, usbd_device_handle udev, usb_device_request_t *req, void *buffer, int buflen, int flags, usbd_xfer_handle xfer); +static void atausb_clear_stall(struct atausb_softc *sc, u_int8_t endpt, usbd_pipe_handle pipe, int state, usbd_xfer_handle xfer); +static void atausb_bbb_reset(struct atausb_softc *sc); +static int atausb_bbb_start(struct ata_request *request); +static void atausb_bbb_finish(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status err); +int ata_usbchannel_begin_transaction(struct ata_request *request); +int ata_usbchannel_end_transaction(struct ata_request *request); + + +/* + * USB frontend part + */ +USB_DECLARE_DRIVER(atausb); +DRIVER_MODULE(atausb, uhub, atausb_driver, atausb_devclass, 0, 0); +MODULE_VERSION(atausb, 1); + +static int +atausb_match(device_t dev) +{ + struct usb_attach_arg *uaa = device_get_ivars(dev); + usb_interface_descriptor_t *id; + + if (uaa->iface == NULL) + return UMATCH_NONE; + + id = usbd_get_interface_descriptor(uaa->iface); + if (!id || id->bInterfaceClass != UICLASS_MASS) + return UMATCH_NONE; + + switch (id->bInterfaceSubClass) { + case UISUBCLASS_QIC157: + case UISUBCLASS_RBC: + case UISUBCLASS_SCSI: + case UISUBCLASS_SFF8020I: + case UISUBCLASS_SFF8070I: + case UISUBCLASS_UFI: + switch (id->bInterfaceProtocol) { + case UIPROTO_MASS_CBI: + case UIPROTO_MASS_CBI_I: + case UIPROTO_MASS_BBB: + case UIPROTO_MASS_BBB_OLD: + return UMATCH_IFACECLASS_IFACESUBCLASS_IFACEPROTO; + default: + return UMATCH_IFACECLASS_IFACESUBCLASS; + } + break; + default: + return UMATCH_IFACECLASS; + } +} + +static int +atausb_attach(device_t dev) +{ + struct atausb_softc *sc = device_get_softc(dev); + struct usb_attach_arg *uaa = device_get_ivars(dev); + usb_interface_descriptor_t *id; + usb_endpoint_descriptor_t *ed; + usbd_device_handle udev; + usb_device_request_t request; + device_t child; + char devinfo[1024], *proto, *subclass; + u_int8_t maxlun; + int err, i; + + sc->dev = dev; + usbd_devinfo(uaa->device, 0, devinfo); + device_set_desc_copy(dev, devinfo); + sc->bulkin = sc->bulkout = sc->bulkirq = -1; + sc->bulkin_pipe = sc->bulkout_pipe= sc->bulkirq_pipe = NULL; + sc->iface = uaa->iface; + sc->ifaceno = uaa->ifaceno; + sc->maxlun = 0; + sc->timeout = 5000; + sc->locked_ch = NULL; + sc->restart_ch = NULL; + mtx_init(&sc->locked_mtx, "ATAUSB lock", NULL, MTX_DEF); + + id = usbd_get_interface_descriptor(sc->iface); + switch (id->bInterfaceProtocol) { + case UIPROTO_MASS_BBB: + case UIPROTO_MASS_BBB_OLD: + proto = "Bulk-Only"; + break; + case UIPROTO_MASS_CBI: + proto = "CBI"; + break; + case UIPROTO_MASS_CBI_I: + proto = "CBI with CCI"; + break; + default: + proto = "Unknown"; + } + switch (id->bInterfaceSubClass) { + case UISUBCLASS_RBC: + subclass = "RBC"; + break; + case UISUBCLASS_QIC157: + case UISUBCLASS_SFF8020I: + case UISUBCLASS_SFF8070I: + subclass = "ATAPI"; + break; + case UISUBCLASS_SCSI: + subclass = "SCSI"; + break; + case UISUBCLASS_UFI: + subclass = "UFI"; + break; + default: + subclass = "Unknown"; + } + device_printf(dev, "using %s over %s\n", subclass, proto); + if (strcmp(proto, "Bulk-Only") || + (strcmp(subclass, "ATAPI") && strcmp(subclass, "SCSI"))) + return ENXIO; + + for (i = 0 ; i < id->bNumEndpoints ; i++) { + if (!(ed = usbd_interface2endpoint_descriptor(sc->iface, i))) { + device_printf(sc->dev, "could not read endpoint descriptor\n"); + return ENXIO; + } + if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN && + (ed->bmAttributes & UE_XFERTYPE) == UE_BULK) { + sc->bulkin = ed->bEndpointAddress; + } + if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_OUT && + (ed->bmAttributes & UE_XFERTYPE) == UE_BULK) { + sc->bulkout = ed->bEndpointAddress; + } + if (id->bInterfaceProtocol == UIPROTO_MASS_CBI_I && + UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN && + (ed->bmAttributes & UE_XFERTYPE) == UE_INTERRUPT) { + sc->bulkirq = ed->bEndpointAddress; + } + } + + /* check whether we found at least the endpoints we need */ + if (!sc->bulkin || !sc->bulkout) { + device_printf(sc->dev, "needed endpoints not found (%d,%d)\n", + sc->bulkin, sc->bulkout); + atausb_detach(dev); + return ENXIO; + } + + /* open the pipes */ + if (usbd_open_pipe(sc->iface, sc->bulkout, + USBD_EXCLUSIVE_USE, &sc->bulkout_pipe)) { + device_printf(sc->dev, "cannot open bulkout pipe (%d)\n", sc->bulkout); + atausb_detach(dev); + return ENXIO; + } + if (usbd_open_pipe(sc->iface, sc->bulkin, + USBD_EXCLUSIVE_USE, &sc->bulkin_pipe)) { + device_printf(sc->dev, "cannot open bulkin pipe (%d)\n", sc->bulkin); + atausb_detach(dev); + return ENXIO; + } + if (id->bInterfaceProtocol == UIPROTO_MASS_CBI_I) { + if (usbd_open_pipe(sc->iface, sc->bulkirq, + USBD_EXCLUSIVE_USE, &sc->bulkirq_pipe)) { + device_printf(sc->dev, "cannot open bulkirq pipe (%d)\n", + sc->bulkirq); + atausb_detach(dev); + return ENXIO; + } + } + sc->state = ATAUSB_S_ATTACH; + + /* alloc needed number of transfer handles */ + for (i = 0; i < ATAUSB_T_MAX; i++) { + sc->transfer[i] = usbd_alloc_xfer(uaa->device); + if (!sc->transfer[i]) { + device_printf(sc->dev, "out of memory\n"); + atausb_detach(dev); + return ENXIO; + } + } + + /* driver is ready to process requests here */ + sc->state = ATAUSB_S_IDLE; + + /* get number of devices so we can add matching channels */ + usbd_interface2device_handle(sc->iface, &udev); + request.bmRequestType = UT_READ_CLASS_INTERFACE; + request.bRequest = 0xfe; //GET_MAX_LUN; + USETW(request.wValue, 0); + USETW(request.wIndex, sc->ifaceno); + USETW(request.wLength, sizeof(maxlun)); + switch ((err = usbd_do_request(udev, &request, &maxlun))) { + case USBD_NORMAL_COMPLETION: + if (bootverbose) + device_printf(sc->dev, "maxlun=%d\n", maxlun); + sc->maxlun = maxlun; + break; + default: + if (bootverbose) + device_printf(sc->dev, "get maxlun not supported %s\n", + usbd_errstr(err)); + } + + /* ata channels are children to this USB control device */ + for (i = 0; i <= sc->maxlun; i++) { + if ((child = device_add_child(sc->dev, "ata", + devclass_find_free_unit(ata_devclass, 2))) == NULL) { + device_printf(sc->dev, "failed to add ata child device\n"); + } else + device_set_ivars(child, (void *)(intptr_t)i); + } + bus_generic_attach(sc->dev); + return 0; +} + +static int +atausb_detach(device_t dev) +{ + struct atausb_softc *sc = device_get_softc(dev); + usbd_device_handle udev; + device_t *children; + int nchildren, i; + + /* signal that device is going away */ + sc->state = ATAUSB_S_DETACH; + + /* abort all the pipes in case there are active transfers */ + usbd_interface2device_handle(sc->iface, &udev); + usbd_abort_default_pipe(udev); + if (sc->bulkout_pipe) + usbd_abort_pipe(sc->bulkout_pipe); + if (sc->bulkin_pipe) + usbd_abort_pipe(sc->bulkin_pipe); + if (sc->bulkirq_pipe) + usbd_abort_pipe(sc->bulkirq_pipe); + + /* detach & delete all children */ + if (!device_get_children(dev, &children, &nchildren)) { + for (i = 0; i < nchildren; i++) + device_delete_child(dev, children[i]); + free(children, M_TEMP); + } + + /* free the transfers */ + for (i = 0; i < ATAUSB_T_MAX; i++) + if (sc->transfer[i]) + usbd_free_xfer(sc->transfer[i]); + + /* remove all the pipes */ + if (sc->bulkout_pipe) + usbd_close_pipe(sc->bulkout_pipe); + if (sc->bulkin_pipe) + usbd_close_pipe(sc->bulkin_pipe); + if (sc->bulkirq_pipe) + usbd_close_pipe(sc->bulkirq_pipe); + + mtx_destroy(&sc->locked_mtx); + return 0; +} + + +/* + * Generic USB transfer routines + */ +static usbd_status +atausb_start(struct atausb_softc *sc, usbd_pipe_handle pipe, + void *buffer, int buflen, int flags, usbd_xfer_handle xfer) +{ + usbd_status err; + + if (sc->state == ATAUSB_S_DETACH) + return USBD_NOT_STARTED; + + usbd_setup_xfer(xfer, pipe, (void *)sc, buffer, buflen, flags, + sc->timeout, atausb_bbb_finish); + err = usbd_transfer(xfer); + if (err && (err != USBD_IN_PROGRESS)) { + if (atausbdebug) + device_printf(sc->dev, "failed to setup transfer, %s\n", + usbd_errstr(err)); + return err; + } + return USBD_NORMAL_COMPLETION; +} + +static usbd_status +atausb_ctl_start(struct atausb_softc *sc, usbd_device_handle udev, + usb_device_request_t *req, void *buffer, int buflen, int flags, + usbd_xfer_handle xfer) +{ + usbd_status err; + + if (sc->state == ATAUSB_S_DETACH) + return USBD_NOT_STARTED; + + usbd_setup_default_xfer(xfer, udev, (void *)sc, sc->timeout, req, + buffer, buflen, flags, atausb_bbb_finish); + err = usbd_transfer(xfer); + if (err && (err != USBD_IN_PROGRESS)) { + if (atausbdebug) + device_printf(sc->dev, "failed to setup ctl transfer, %s\n", + usbd_errstr(err)); + return err; + } + return USBD_NORMAL_COMPLETION; +} + +static void +atausb_clear_stall(struct atausb_softc *sc, u_int8_t endpt, + usbd_pipe_handle pipe, int state, usbd_xfer_handle xfer) +{ + usbd_device_handle udev; + + if (atausbdebug) + device_printf(sc->dev, "clear endpoint 0x%02x stall\n", endpt); + usbd_interface2device_handle(sc->iface, &udev); + sc->state = state; + usbd_clear_endpoint_toggle(pipe); + sc->usb_request.bmRequestType = UT_WRITE_ENDPOINT; + sc->usb_request.bRequest = UR_CLEAR_FEATURE; + USETW(sc->usb_request.wValue, UF_ENDPOINT_HALT); + USETW(sc->usb_request.wIndex, endpt); + USETW(sc->usb_request.wLength, 0); + atausb_ctl_start(sc, udev, &sc->usb_request, NULL, 0, 0, xfer); +} + + +/* + * Bulk-Only transport part + */ +static void +atausb_bbb_reset(struct atausb_softc *sc) +{ + usbd_device_handle udev; + + if (atausbdebug) + device_printf(sc->dev, "Bulk Reset\n"); + sc->timeout = 5000; + sc->state = ATAUSB_S_BBB_RESET1; + usbd_interface2device_handle(sc->iface, &udev); + sc->usb_request.bmRequestType = UT_WRITE_CLASS_INTERFACE; + sc->usb_request.bRequest = 0xff; /* bulk-only reset */ + USETW(sc->usb_request.wValue, 0); + USETW(sc->usb_request.wIndex, sc->ifaceno); + USETW(sc->usb_request.wLength, 0); + atausb_ctl_start(sc, udev, &sc->usb_request, NULL, + 0, 0, sc->transfer[ATAUSB_T_BBB_RESET1]); +} + +static int +atausb_bbb_start(struct ata_request *request) +{ + struct atausb_softc *sc = + device_get_softc(device_get_parent(request->parent)); + struct ata_channel *ch = device_get_softc(request->parent); + + sc->timeout = (request->timeout * 1000) + 5000; + USETDW(sc->cbw.signature, CBWSIGNATURE); + USETDW(sc->cbw.tag, UGETDW(sc->cbw.tag) + 1); + USETDW(sc->cbw.transfer_length, request->bytecount); + sc->cbw.flags = (request->flags & ATA_R_READ) ? CBWFLAGS_IN : CBWFLAGS_OUT; + sc->cbw.lun = ch->unit; + sc->cbw.length = 16; + bzero(sc->cbw.cdb, 16); + bcopy(request->u.atapi.ccb, sc->cbw.cdb, 12); /* XXX SOS */ + sc->state = ATAUSB_S_BBB_COMMAND; + if (atausb_start(sc, sc->bulkout_pipe, &sc->cbw, sizeof(struct bbb_cbw), + 0, sc->transfer[ATAUSB_T_BBB_CBW])) { + request->result = EIO; + if (atausbdebug) + device_printf(request->dev, "cannot setup USB transfer\n"); + atausb_bbb_reset(sc); + return ATA_OP_FINISHED; + } + return ATA_OP_CONTINUES; +} + +static void +atausb_bbb_finish(usbd_xfer_handle xfer, usbd_private_handle priv, + usbd_status err) +{ + struct atausb_softc *sc = (struct atausb_softc *)priv; + struct ata_request *request = sc->ata_request; + usbd_xfer_handle next_xfer; + + //device_printf(sc->dev, "BBB state %d: %s\n", sc->state, usbd_errstr(err)); + + if (sc->state == ATAUSB_S_DETACH) { + device_printf(sc->dev, "WARNING - device has been removed\n"); + return; + } + + switch (sc->state) { + case ATAUSB_S_BBB_COMMAND: /* command transport phase */ + if (err) { + if (atausbdebug) + device_printf(sc->dev, "failed to send CBW\n"); + request->result = EIO; + atausb_bbb_reset(sc); + return; + } + + /* next is data transport phase, setup transfer */ + sc->state = ATAUSB_S_BBB_DATA; + if (request->flags & ATA_R_READ) { + if (atausb_start(sc, sc->bulkin_pipe, + request->data, request->bytecount, + USBD_SHORT_XFER_OK, + sc->transfer[ATAUSB_T_BBB_DATA])) { + request->result = EIO; + atausb_bbb_reset(sc); + } + return; + } + if (request->flags & ATA_R_WRITE) { + if (atausb_start(sc, sc->bulkout_pipe, + request->data, request->bytecount, + 0, sc->transfer[ATAUSB_T_BBB_DATA])) { + request->result = EIO; + atausb_bbb_reset(sc); + } + return; + } + /* FALLTHROUGH */ + + case ATAUSB_S_BBB_DATA: /* data transport phase */ + if (request->flags & (ATA_R_READ | ATA_R_WRITE)) { + usbd_get_xfer_status(xfer, NULL, NULL, &request->donecount, NULL); + if (err) { + if (atausbdebug) + device_printf(sc->dev, "data %s count %d failed: %s\n", + (request->flags & ATA_R_READ?"read":"write"), + request->bytecount, usbd_errstr(err)); + if (err == USBD_STALLED) { + atausb_clear_stall(sc, + (request->flags & ATA_R_READ ? + sc->bulkin : sc->bulkout), + (request->flags & ATA_R_READ ? + sc->bulkin_pipe : sc->bulkout_pipe), + ATAUSB_S_BBB_DCLEAR, + sc->transfer[ATAUSB_T_BBB_DCLEAR]); + } + else { + request->result = EIO; + atausb_bbb_reset(sc); + } + return; + } + } + /* FALLTHROUGH */ + + case ATAUSB_S_BBB_DCLEAR: /* stall clear after data phase */ + case ATAUSB_S_BBB_SCLEAR: /* stall clear after status phase */ + if (err) { + if (atausbdebug) + device_printf(sc->dev, "bulk%s stall clear failed %s\n", + (request->flags & ATA_R_READ ? "in" : "out"), + usbd_errstr(err)); + request->result = EIO; + atausb_bbb_reset(sc); + return; + } + + if (sc->state == ATAUSB_S_BBB_COMMAND || + sc->state == ATAUSB_S_BBB_DATA || + sc->state == ATAUSB_S_BBB_DCLEAR) { + /* first attempt on status transport phase setup transfer */ + sc->state = ATAUSB_S_BBB_STATUS1; + next_xfer = sc->transfer[ATAUSB_T_BBB_CSW1]; + } + else { + /* second attempt of fetching status */ + sc->state = ATAUSB_S_BBB_STATUS2; + next_xfer = sc->transfer[ATAUSB_T_BBB_CSW2]; + } + if (atausb_start(sc, sc->bulkin_pipe, &sc->csw, sizeof(struct bbb_csw), + USBD_SHORT_XFER_OK, next_xfer)) { + request->result = EIO; + atausb_bbb_reset(sc); + } + return; + + case ATAUSB_S_BBB_STATUS1: /* status transfer first attempt */ + case ATAUSB_S_BBB_STATUS2: /* status transfer second attempt */ + if (err) { + if (atausbdebug) + device_printf(sc->dev, "cannot get CSW, %s%s\n", + usbd_errstr(err), + sc->state == ATAUSB_S_BBB_STATUS1 ? ", retry":""); + if (sc->state == ATAUSB_S_BBB_STATUS1) { + atausb_clear_stall(sc, sc->bulkin, sc->bulkin_pipe, + ATAUSB_S_BBB_SCLEAR, + sc->transfer[ATAUSB_T_BBB_SCLEAR]); + } + else { + request->result = EIO; + atausb_bbb_reset(sc); + } + return; + } + + int residue = UGETDW(sc->csw.residue); + + if (!residue && + (request->bytecount - request->donecount)) + residue = request->bytecount - request->donecount; + + /* check CSW and handle eventual error */ + if (UGETDW(sc->csw.signature) != CSWSIGNATURE) { + if (atausbdebug) + device_printf(sc->dev, "bad CSW signature 0x%08x != 0x%08x\n", + UGETDW(sc->csw.signature), CSWSIGNATURE); + request->result = EIO; + atausb_bbb_reset(sc); + return; + } + else if (UGETDW(sc->csw.tag) != UGETDW(sc->cbw.tag)) { + if (atausbdebug) + device_printf(sc->dev, "bad CSW tag %d != %d\n", + UGETDW(sc->csw.tag), UGETDW(sc->cbw.tag)); + request->result = EIO; + atausb_bbb_reset(sc); + return; + } + else if (sc->csw.status > CSWSTATUS_PHASE) { + if (atausbdebug) + device_printf(sc->dev, "bad CSW status %d > %d\n", + sc->csw.status, CSWSTATUS_PHASE); + request->result = EIO; + atausb_bbb_reset(sc); + return; + } + else if (sc->csw.status == CSWSTATUS_PHASE) { + if (atausbdebug) + device_printf(sc->dev, "phase error residue = %d\n", residue); + request->result = EIO; + atausb_bbb_reset(sc); + return; + } + else if (request->donecount > request->bytecount) { + if (atausbdebug) + device_printf(sc->dev, "buffer overrun %d > %d", + request->donecount, request->bytecount); + request->result = EIO; + atausb_bbb_reset(sc); + return; + } + else if (sc->csw.status == CSWSTATUS_FAILED) { + if (atausbdebug) + device_printf(sc->dev, "CSWSTATUS_FAILED\n"); + request->error = ATA_E_ATAPI_SENSE_MASK ; + sc->state = ATAUSB_S_IDLE; + ata_interrupt(device_get_softc(request->parent)); + return; + } + else { + sc->state = ATAUSB_S_IDLE; + ata_interrupt(device_get_softc(request->parent)); + return; + } + /* NOT REACHED */ + + case ATAUSB_S_BBB_RESET1: + if (err) + if (atausbdebug) + device_printf(sc->dev, + "BBB reset failure: %s\n", usbd_errstr(err)); + atausb_clear_stall(sc, sc->bulkin, sc->bulkin_pipe, + ATAUSB_S_BBB_RESET2, + sc->transfer[ATAUSB_T_BBB_RESET2]); + return; + + case ATAUSB_S_BBB_RESET2: + if (err) + if (atausbdebug) + device_printf(sc->dev, "BBB bulkin clear stall failure: %s\n", + usbd_errstr(err)); + atausb_clear_stall(sc, sc->bulkout, sc->bulkout_pipe, + ATAUSB_S_BBB_RESET3, + sc->transfer[ATAUSB_T_BBB_RESET3]); + return; + + case ATAUSB_S_BBB_RESET3: + if (err) + if (atausbdebug) + device_printf(sc->dev, "BBB bulk-out clear stall failure: %s\n", + usbd_errstr(err)); + sc->state = ATAUSB_S_IDLE; + if (request) { + if (err) + request->result = ENXIO; + else + request->result = EIO; + ata_interrupt(device_get_softc(request->parent)); + } + return; + + default: + if (atausbdebug) + device_printf(sc->dev, "unknown state %d", sc->state); + } +} + + +/* + * ATA backend part + */ +struct atapi_inquiry { + u_int8_t device_type; + u_int8_t device_modifier; + u_int8_t version; + u_int8_t response_format; + u_int8_t length; + u_int8_t reserved[2]; + u_int8_t flags; + u_int8_t vendor[8]; + u_int8_t product[16]; + u_int8_t revision[4]; + //u_int8_t crap[60]; +}; + +int +ata_usbchannel_begin_transaction(struct ata_request *request) +{ + struct atausb_softc *sc = + device_get_softc(device_get_parent(request->parent)); + + if (atausbdebug > 1) + device_printf(request->dev, "begin_transaction %s\n", + ata_cmd2str(request)); + + /* sanity just in case */ + if (sc->state != ATAUSB_S_IDLE) { + printf("begin is busy (%d)\n", sc->state); + request->result = EBUSY; + return ATA_OP_FINISHED; + } + + /* XXX SOS convert the request into the format used, only BBB for now*/ + sc->ata_request = request; + + /* ATA/ATAPI IDENTIFY needs special treatment */ + if (!(request->flags & ATA_R_ATAPI)) { + if (request->u.ata.command != ATA_ATAPI_IDENTIFY) { + device_printf(request->dev,"%s unsupported\n",ata_cmd2str(request)); + request->result = EIO; + return ATA_OP_FINISHED; + } + request->flags |= ATA_R_ATAPI; + bzero(request->u.atapi.ccb, 16); + request->u.atapi.ccb[0] = ATAPI_INQUIRY; + request->u.atapi.ccb[4] = 255; //sizeof(struct atapi_inquiry); + request->data += 256; /* arbitrary offset into ata_param */ + request->bytecount = 255; //sizeof(struct atapi_inquiry); + } + return atausb_bbb_start(request); +} + +int +ata_usbchannel_end_transaction(struct ata_request *request) +{ + if (atausbdebug > 1) + device_printf(request->dev, "end_transaction %s\n", + ata_cmd2str(request)); + + /* XXX SOS convert the request from the format used, only BBB for now*/ + + /* ATA/ATAPI IDENTIFY needs special treatment */ + if ((request->flags & ATA_R_ATAPI) && + (request->u.atapi.ccb[0] == ATAPI_INQUIRY)) { + struct ata_device *atadev = device_get_softc(request->dev); + struct atapi_inquiry *inquiry = (struct atapi_inquiry *)request->data; + u_int16_t *ptr; + + /* convert inquiry data into simple ata_param like format */ + atadev->param.config = ATA_PROTO_ATAPI | ATA_PROTO_ATAPI_12; + atadev->param.config |= (inquiry->device_type & 0x1f) << 8; + bzero(atadev->param.model, sizeof(atadev->param.model)); + strncpy(atadev->param.model, inquiry->vendor, 8); + strcpy(atadev->param.model, " "); + strncpy(atadev->param.model, inquiry->product, 16); + ptr = (u_int16_t*)(atadev->param.model + sizeof(atadev->param.model)); + while (--ptr >= (u_int16_t*)atadev->param.model) + *ptr = ntohs(*ptr); + strncpy(atadev->param.revision, inquiry->revision, 4); + ptr=(u_int16_t*)(atadev->param.revision+sizeof(atadev->param.revision)); + while (--ptr >= (u_int16_t*)atadev->param.revision) + *ptr = ntohs(*ptr); + request->result = 0; + } + return ATA_OP_FINISHED; +} + +static int +ata_usbchannel_probe(device_t dev) +{ + char buffer[32]; + + sprintf(buffer, "USB lun %d", (int)(intptr_t)device_get_ivars(dev)); + device_set_desc_copy(dev, buffer); + + return 0; +} + +static int +ata_usbchannel_attach(device_t dev) +{ + struct ata_channel *ch = device_get_softc(dev); + + if (ch->attached) + return (0); + ch->attached = 1; + + /* initialize the softc basics */ + ch->dev = dev; + ch->unit = (intptr_t)device_get_ivars(dev); + ch->state = ATA_IDLE; + ch->hw.begin_transaction = ata_usbchannel_begin_transaction; + ch->hw.end_transaction = ata_usbchannel_end_transaction; + ch->hw.status = NULL; + ch->hw.command = NULL; + bzero(&ch->state_mtx, sizeof(struct mtx)); + mtx_init(&ch->state_mtx, "ATA state lock", NULL, MTX_DEF); + bzero(&ch->queue_mtx, sizeof(struct mtx)); + mtx_init(&ch->queue_mtx, "ATA queue lock", NULL, MTX_DEF); + TAILQ_INIT(&ch->ata_queue); + + /* XXX SOS reset the controller HW, the channel and device(s) */ + //ATA_RESET(dev); + + /* probe and attach device on this channel */ + ch->devices = ATA_ATAPI_MASTER; + if (!ata_delayed_attach) + ata_identify(dev); + return 0; +} + +static int +ata_usbchannel_detach(device_t dev) +{ + struct ata_channel *ch = device_get_softc(dev); + device_t *children; + int nchildren, i; + + if (!ch->attached) + return (0); + ch->attached = 0; + + /* detach & delete all children */ + if (!device_get_children(dev, &children, &nchildren)) { + for (i = 0; i < nchildren; i++) + if (children[i]) + device_delete_child(dev, children[i]); + free(children, M_TEMP); + } + mtx_destroy(&ch->state_mtx); + mtx_destroy(&ch->queue_mtx); + return 0; +} + +static void +ata_usbchannel_setmode(device_t parent, device_t dev) +{ + struct atausb_softc *sc = device_get_softc(GRANDPARENT(dev)); + struct ata_device *atadev = device_get_softc(dev); + usbd_device_handle udev; + + usbd_interface2device_handle(sc->iface, &udev); + if (usbd_get_speed(udev) == USB_SPEED_HIGH) + atadev->mode = ATA_USB2; + else + atadev->mode = ATA_USB1; +} + +static int +ata_usbchannel_locking(device_t dev, int flags) +{ + struct atausb_softc *sc = device_get_softc(device_get_parent(dev)); + struct ata_channel *ch = device_get_softc(dev); + int res = -1; + + + mtx_lock(&sc->locked_mtx); + switch (flags) { + case ATA_LF_LOCK: + if (sc->locked_ch == NULL) + sc->locked_ch = ch; + if (sc->locked_ch != ch) + sc->restart_ch = ch; + break; + + case ATA_LF_UNLOCK: + if (sc->locked_ch == ch) { + sc->locked_ch = NULL; + if (sc->restart_ch) { + ch = sc->restart_ch; + sc->restart_ch = NULL; + mtx_unlock(&sc->locked_mtx); + ata_start(ch->dev); + return res; + } + } + break; + + case ATA_LF_WHICH: + break; + } + if (sc->locked_ch) + res = sc->locked_ch->unit; + mtx_unlock(&sc->locked_mtx); + return res; +} + +static device_method_t ata_usbchannel_methods[] = { + /* device interface */ + DEVMETHOD(device_probe, ata_usbchannel_probe), + DEVMETHOD(device_attach, ata_usbchannel_attach), + DEVMETHOD(device_detach, ata_usbchannel_detach), + + /* ATA methods */ + DEVMETHOD(ata_setmode, ata_usbchannel_setmode), + DEVMETHOD(ata_locking, ata_usbchannel_locking), + //DEVMETHOD(ata_reset, ata_usbchannel_reset), + + { 0, 0 } +}; + +static driver_t ata_usbchannel_driver = { + "ata", + ata_usbchannel_methods, + sizeof(struct ata_channel), +}; + +DRIVER_MODULE(ata, atausb, ata_usbchannel_driver, ata_devclass, 0, 0); +MODULE_DEPEND(atausb, ata, 1, 1, 1); Copied: head/sys/legacy/dev/sound/usb/uaudio.c (from r188941, head/sys/dev/sound/usb/uaudio.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/legacy/dev/sound/usb/uaudio.c Mon Feb 23 21:07:20 2009 (r188955, copy of r188941, head/sys/dev/sound/usb/uaudio.c) @@ -0,0 +1,4662 @@ +/* $NetBSD: uaudio.c,v 1.91 2004/11/05 17:46:14 kent Exp $ */ +/* $FreeBSD$ */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Feb 23 21:09:29 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 297B3106566C; Mon, 23 Feb 2009 21:09:29 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F0EAA8FC0C; Mon, 23 Feb 2009 21:09:28 +0000 (UTC) (envelope-from trasz@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 n1NL9Sjx036222; Mon, 23 Feb 2009 21:09:28 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1NL9Snh036220; Mon, 23 Feb 2009 21:09:28 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200902232109.n1NL9Snh036220@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 23 Feb 2009 21:09:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188956 - in head/sys: fs/msdosfs ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2009 21:09:29 -0000 Author: trasz Date: Mon Feb 23 21:09:28 2009 New Revision: 188956 URL: http://svn.freebsd.org/changeset/base/188956 Log: Right now, when trying to unmount a device that's already gone, msdosfs_unmount() and ffs_unmount() exit early after getting ENXIO. However, dounmount() treats ENXIO as a success and proceeds with unmounting. In effect, the filesystem gets unmounted without closing GEOM provider etc. Reviewed by: kib Approved by: rwatson (mentor) Tested by: dho Sponsored by: FreeBSD Foundation Modified: head/sys/fs/msdosfs/msdosfs_vfsops.c head/sys/ufs/ffs/ffs_vfsops.c Modified: head/sys/fs/msdosfs/msdosfs_vfsops.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_vfsops.c Mon Feb 23 21:07:20 2009 (r188955) +++ head/sys/fs/msdosfs/msdosfs_vfsops.c Mon Feb 23 21:09:28 2009 (r188956) @@ -779,12 +779,12 @@ msdosfs_unmount(struct mount *mp, int mn if (mntflags & MNT_FORCE) flags |= FORCECLOSE; error = vflush(mp, 0, flags, td); - if (error) + if (error && error != ENXIO) return error; pmp = VFSTOMSDOSFS(mp); if ((pmp->pm_flags & MSDOSFSMNT_RONLY) == 0) { error = markvoldirty(pmp, 0); - if (error) { + if (error && error != ENXIO) { (void)markvoldirty(pmp, 1); return (error); } @@ -835,7 +835,7 @@ msdosfs_unmount(struct mount *mp, int mn MNT_ILOCK(mp); mp->mnt_flag &= ~MNT_LOCAL; MNT_IUNLOCK(mp); - return (0); + return (error); } static int Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Mon Feb 23 21:07:20 2009 (r188955) +++ head/sys/ufs/ffs/ffs_vfsops.c Mon Feb 23 21:09:28 2009 (r188956) @@ -1079,7 +1079,7 @@ ffs_unmount(mp, mntflags, td) error = softdep_flushfiles(mp, flags, td); else error = ffs_flushfiles(mp, flags, td); - if (error != 0) + if (error != 0 && error != ENXIO) goto fail; UFS_LOCK(ump); @@ -1094,7 +1094,7 @@ ffs_unmount(mp, mntflags, td) if (fs->fs_ronly == 0) { fs->fs_clean = fs->fs_flags & (FS_UNCLEAN|FS_NEEDSFSCK) ? 0 : 1; error = ffs_sbupdate(ump, MNT_WAIT, 0); - if (error) { + if (error && error != ENXIO) { fs->fs_clean = 0; goto fail; } From owner-svn-src-head@FreeBSD.ORG Mon Feb 23 21:19:18 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6A3C106567F; Mon, 23 Feb 2009 21:19:18 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 90B4D8FC15; Mon, 23 Feb 2009 21:19:18 +0000 (UTC) (envelope-from thompsa@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 n1NLJIFi036431; Mon, 23 Feb 2009 21:19:18 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1NLJI96036428; Mon, 23 Feb 2009 21:19:18 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902232119.n1NLJI96036428@svn.freebsd.org> From: Andrew Thompson Date: Mon, 23 Feb 2009 21:19:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188957 - in head/sys: conf dev/ata dev/sound/usb dev/usb/sound dev/usb/storage modules/ata/atausb modules/sound/driver/uaudio X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2009 21:19:20 -0000 Author: thompsa Date: Mon Feb 23 21:19:18 2009 New Revision: 188957 URL: http://svn.freebsd.org/changeset/base/188957 Log: Move the uaudio and ata-usb drivers into their correct locations. Added: head/sys/dev/ata/ata-usb.c - copied unchanged from r188946, head/sys/dev/usb/storage/ata-usb.c head/sys/dev/sound/usb/uaudio.c - copied, changed from r188946, head/sys/dev/usb/sound/uaudio.c head/sys/dev/sound/usb/uaudio.h - copied unchanged from r188946, head/sys/dev/usb/sound/uaudio.h head/sys/dev/sound/usb/uaudio_pcm.c - copied, changed from r188946, head/sys/dev/usb/sound/uaudio_pcm.c head/sys/dev/sound/usb/uaudioreg.h - copied unchanged from r188946, head/sys/dev/usb/sound/uaudio_reg.h Deleted: head/sys/dev/usb/sound/ head/sys/dev/usb/storage/ata-usb.c Modified: head/sys/conf/files head/sys/modules/ata/atausb/Makefile head/sys/modules/sound/driver/uaudio/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Feb 23 21:09:28 2009 (r188956) +++ head/sys/conf/files Mon Feb 23 21:19:18 2009 (r188957) @@ -502,6 +502,7 @@ dev/ata/chipsets/ata-sis.c optional ata dev/ata/chipsets/ata-via.c optional ata pci | atavia dev/ata/ata-disk.c optional atadisk dev/ata/ata-raid.c optional ataraid +dev/ata/ata-usb.c optional atausb usb legacy/dev/ata/ata-usb.c optional atausb ousb dev/ata/atapi-cd.c optional atapicd dev/ata/atapi-fd.c optional atapifd @@ -1393,7 +1394,8 @@ dev/sound/pcm/mixer_if.m optional sound dev/sound/pcm/sndstat.c optional sound dev/sound/pcm/sound.c optional sound dev/sound/pcm/vchan.c optional sound -#dev/sound/usb/upcm.c optional snd_upcm ousb +dev/sound/usb/uaudio.c optional snd_uaudio usb +dev/sound/usb/uaudio_pcm.c optional snd_uaudio usb legacy/dev/sound/usb/uaudio.c optional snd_uaudio ousb legacy/dev/sound/usb/uaudio_pcm.c optional snd_uaudio ousb dev/sound/midi/midi.c optional sound @@ -1552,7 +1554,6 @@ dev/usb/controller/usb_controller.c opti # # USB storage drivers # -dev/usb/storage/ata-usb.c optional atausb dev/usb/storage/umass.c optional umass dev/usb/storage/urio.c optional urio dev/usb/storage/ustorage_fs.c optional usfs @@ -1654,11 +1655,6 @@ dev/usb/template/usb_template_mtp.c opti # dev/usb/image/uscanner.c optional uscanner # -# USB sound and MIDI drivers -# -dev/usb/sound/uaudio.c optional usound -dev/usb/sound/uaudio_pcm.c optional usound -# # USB END # dev/utopia/idtphy.c optional utopia Copied: head/sys/dev/ata/ata-usb.c (from r188946, head/sys/dev/usb/storage/ata-usb.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ata/ata-usb.c Mon Feb 23 21:19:18 2009 (r188957, copy of r188946, head/sys/dev/usb/storage/ata-usb.c) @@ -0,0 +1,1102 @@ +/*- + * Copyright (c) 2006 - 2008 Sren Schmidt + * All rights reserved. + * + * Copyright (c) 2006 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, + * without modification, immediately at the beginning of the file. + * 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 ``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 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "usbdevs.h" +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include + +#define ATAUSB_BULK_SIZE (1<<17) + +/* Command Block Wrapper */ +struct bbb_cbw { + uint8_t signature[4]; +#define CBWSIGNATURE 0x43425355 + + uint8_t tag[4]; + uint8_t transfer_length[4]; + uint8_t flags; +#define CBWFLAGS_OUT 0x00 +#define CBWFLAGS_IN 0x80 + + uint8_t lun; + uint8_t length; +#define CBWCDBLENGTH 16 + + uint8_t cdb[CBWCDBLENGTH]; +} __packed; + +/* Command Status Wrapper */ +struct bbb_csw { + uint8_t signature[4]; +#define CSWSIGNATURE 0x53425355 + + uint8_t tag[4]; + uint8_t residue[4]; + uint8_t status; +#define CSWSTATUS_GOOD 0x0 +#define CSWSTATUS_FAILED 0x1 +#define CSWSTATUS_PHASE 0x2 +} __packed; + +/* USB-ATA 'controller' softc */ +struct atausb2_softc { + struct bbb_cbw cbw; + struct bbb_csw csw; + struct mtx locked_mtx; + + struct ata_channel *locked_ch; + struct ata_channel *restart_ch; + struct ata_request *ata_request; + +#define ATAUSB_T_BBB_RESET1 0 +#define ATAUSB_T_BBB_RESET2 1 +#define ATAUSB_T_BBB_RESET3 2 +#define ATAUSB_T_BBB_COMMAND 3 +#define ATAUSB_T_BBB_DATA_READ 4 +#define ATAUSB_T_BBB_DATA_RD_CS 5 +#define ATAUSB_T_BBB_DATA_WRITE 6 +#define ATAUSB_T_BBB_DATA_WR_CS 7 +#define ATAUSB_T_BBB_STATUS 8 +#define ATAUSB_T_BBB_MAX 9 + +#define ATAUSB_T_MAX ATAUSB_T_BBB_MAX + + struct usb2_xfer *xfer[ATAUSB_T_MAX]; + caddr_t ata_data; + device_t dev; + + uint32_t timeout; + uint32_t ata_donecount; + uint32_t ata_bytecount; + + uint8_t last_xfer_no; + uint8_t usb2_speed; + uint8_t intr_stalled; + uint8_t maxlun; + uint8_t iface_no; + uint8_t status_try; +}; + +static const int atausbdebug = 0; + +/* prototypes */ + +static device_probe_t atausb2_probe; +static device_attach_t atausb2_attach; +static device_detach_t atausb2_detach; + +static usb2_callback_t atausb2_t_bbb_reset1_callback; +static usb2_callback_t atausb2_t_bbb_reset2_callback; +static usb2_callback_t atausb2_t_bbb_reset3_callback; +static usb2_callback_t atausb2_t_bbb_command_callback; +static usb2_callback_t atausb2_t_bbb_data_read_callback; +static usb2_callback_t atausb2_t_bbb_data_rd_cs_callback; +static usb2_callback_t atausb2_t_bbb_data_write_callback; +static usb2_callback_t atausb2_t_bbb_data_wr_cs_callback; +static usb2_callback_t atausb2_t_bbb_status_callback; +static usb2_callback_t atausb2_tr_error; + +static void atausb2_cancel_request(struct atausb2_softc *sc); +static void atausb2_transfer_start(struct atausb2_softc *sc, uint8_t xfer_no); +static void atausb2_t_bbb_data_clear_stall_callback(struct usb2_xfer *xfer, uint8_t next_xfer, uint8_t stall_xfer); +static int ata_usbchannel_begin_transaction(struct ata_request *request); +static int ata_usbchannel_end_transaction(struct ata_request *request); + +static device_probe_t ata_usbchannel_probe; +static device_attach_t ata_usbchannel_attach; +static device_detach_t ata_usbchannel_detach; + +static ata_setmode_t ata_usbchannel_setmode; +static ata_locking_t ata_usbchannel_locking; + +/* + * USB frontend part + */ + +struct usb2_config atausb2_config[ATAUSB_T_BBB_MAX] = { + + [ATAUSB_T_BBB_RESET1] = { + .type = UE_CONTROL, + .endpoint = 0x00, /* Control pipe */ + .direction = UE_DIR_ANY, + .mh.bufsize = sizeof(struct usb2_device_request), + .mh.flags = {}, + .mh.callback = &atausb2_t_bbb_reset1_callback, + .mh.timeout = 5000, /* 5 seconds */ + .mh.interval = 500, /* 500 milliseconds */ + }, + + [ATAUSB_T_BBB_RESET2] = { + .type = UE_CONTROL, + .endpoint = 0x00, /* Control pipe */ + .direction = UE_DIR_ANY, + .mh.bufsize = sizeof(struct usb2_device_request), + .mh.flags = {}, + .mh.callback = &atausb2_t_bbb_reset2_callback, + .mh.timeout = 5000, /* 5 seconds */ + .mh.interval = 50, /* 50 milliseconds */ + }, + + [ATAUSB_T_BBB_RESET3] = { + .type = UE_CONTROL, + .endpoint = 0x00, /* Control pipe */ + .direction = UE_DIR_ANY, + .mh.bufsize = sizeof(struct usb2_device_request), + .mh.flags = {}, + .mh.callback = &atausb2_t_bbb_reset3_callback, + .mh.timeout = 5000, /* 5 seconds */ + .mh.interval = 50, /* 50 milliseconds */ + }, + + [ATAUSB_T_BBB_COMMAND] = { + .type = UE_BULK, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_OUT, + .mh.bufsize = sizeof(struct bbb_cbw), + .mh.flags = {}, + .mh.callback = &atausb2_t_bbb_command_callback, + .mh.timeout = 5000, /* 5 seconds */ + }, + + [ATAUSB_T_BBB_DATA_READ] = { + .type = UE_BULK, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_IN, + .mh.bufsize = ATAUSB_BULK_SIZE, + .mh.flags = {.proxy_buffer = 1,.short_xfer_ok = 1,}, + .mh.callback = &atausb2_t_bbb_data_read_callback, + .mh.timeout = 0, /* overwritten later */ + }, + + [ATAUSB_T_BBB_DATA_RD_CS] = { + .type = UE_CONTROL, + .endpoint = 0x00, /* Control pipe */ + .direction = UE_DIR_ANY, + .mh.bufsize = sizeof(struct usb2_device_request), + .mh.flags = {}, + .mh.callback = &atausb2_t_bbb_data_rd_cs_callback, + .mh.timeout = 5000, /* 5 seconds */ + }, + + [ATAUSB_T_BBB_DATA_WRITE] = { + .type = UE_BULK, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_OUT, + .mh.bufsize = ATAUSB_BULK_SIZE, + .mh.flags = {.proxy_buffer = 1,.short_xfer_ok = 1,}, + .mh.callback = &atausb2_t_bbb_data_write_callback, + .mh.timeout = 0, /* overwritten later */ + }, + + [ATAUSB_T_BBB_DATA_WR_CS] = { + .type = UE_CONTROL, + .endpoint = 0x00, /* Control pipe */ + .direction = UE_DIR_ANY, + .mh.bufsize = sizeof(struct usb2_device_request), + .mh.flags = {}, + .mh.callback = &atausb2_t_bbb_data_wr_cs_callback, + .mh.timeout = 5000, /* 5 seconds */ + }, + + [ATAUSB_T_BBB_STATUS] = { + .type = UE_BULK, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_IN, + .mh.bufsize = sizeof(struct bbb_csw), + .mh.flags = {.short_xfer_ok = 1,}, + .mh.callback = &atausb2_t_bbb_status_callback, + .mh.timeout = 5000, /* ms */ + }, +}; + +static devclass_t atausb2_devclass; + +static device_method_t atausb2_methods[] = { + DEVMETHOD(device_probe, atausb2_probe), + DEVMETHOD(device_attach, atausb2_attach), + DEVMETHOD(device_detach, atausb2_detach), + {0, 0} +}; + +static driver_t atausb2_driver = { + .name = "atausb", + .methods = atausb2_methods, + .size = sizeof(struct atausb2_softc), +}; + +DRIVER_MODULE(atausb, ushub, atausb2_driver, atausb2_devclass, 0, 0); +MODULE_DEPEND(atausb, usb, 1, 1, 1); +MODULE_VERSION(atausb, 1); + +static int +atausb2_probe(device_t dev) +{ + struct usb2_attach_arg *uaa = device_get_ivars(dev); + struct usb2_interface_descriptor *id; + + if (uaa->usb2_mode != USB_MODE_HOST) { + return (ENXIO); + } + if (uaa->use_generic == 0) { + /* give other drivers a try first */ + return (ENXIO); + } + id = usb2_get_interface_descriptor(uaa->iface); + if ((!id) || (id->bInterfaceClass != UICLASS_MASS)) { + return (ENXIO); + } + switch (id->bInterfaceSubClass) { + case UISUBCLASS_QIC157: + case UISUBCLASS_RBC: + case UISUBCLASS_SCSI: + case UISUBCLASS_SFF8020I: + case UISUBCLASS_SFF8070I: + case UISUBCLASS_UFI: + switch (id->bInterfaceProtocol) { + case UIPROTO_MASS_CBI: + case UIPROTO_MASS_CBI_I: + case UIPROTO_MASS_BBB: + case UIPROTO_MASS_BBB_OLD: + return (0); + default: + return (0); + } + break; + default: + return (0); + } +} + +static int +atausb2_attach(device_t dev) +{ + struct atausb2_softc *sc = device_get_softc(dev); + struct usb2_attach_arg *uaa = device_get_ivars(dev); + struct usb2_interface_descriptor *id; + const char *proto, *subclass; + struct usb2_device_request request; + uint16_t i; + uint8_t maxlun; + uint8_t has_intr; + int err; + + device_set_usb2_desc(dev); + + sc->dev = dev; + sc->maxlun = 0; + sc->locked_ch = NULL; + sc->restart_ch = NULL; + sc->usb2_speed = usb2_get_speed(uaa->device); + mtx_init(&sc->locked_mtx, "ATAUSB lock", NULL, (MTX_DEF | MTX_RECURSE)); + + id = usb2_get_interface_descriptor(uaa->iface); + switch (id->bInterfaceProtocol) { + case UIPROTO_MASS_BBB: + case UIPROTO_MASS_BBB_OLD: + proto = "Bulk-Only"; + break; + case UIPROTO_MASS_CBI: + proto = "CBI"; + break; + case UIPROTO_MASS_CBI_I: + proto = "CBI with CCI"; + break; + default: + proto = "Unknown"; + } + + switch (id->bInterfaceSubClass) { + case UISUBCLASS_RBC: + subclass = "RBC"; + break; + case UISUBCLASS_QIC157: + case UISUBCLASS_SFF8020I: + case UISUBCLASS_SFF8070I: + subclass = "ATAPI"; + break; + case UISUBCLASS_SCSI: + subclass = "SCSI"; + break; + case UISUBCLASS_UFI: + subclass = "UFI"; + break; + default: + subclass = "Unknown"; + } + + has_intr = (id->bInterfaceProtocol == UIPROTO_MASS_CBI_I); + sc->iface_no = id->bInterfaceNumber; + + device_printf(dev, "using %s over %s\n", subclass, proto); + if (strcmp(proto, "Bulk-Only") || + (strcmp(subclass, "ATAPI") && strcmp(subclass, "SCSI"))) { + goto detach; + } + err = usb2_transfer_setup(uaa->device, &uaa->info.bIfaceIndex, + sc->xfer, atausb2_config, ATAUSB_T_BBB_MAX, sc, + &sc->locked_mtx); + + /* skip reset first time */ + sc->last_xfer_no = ATAUSB_T_BBB_COMMAND; + + if (err) { + device_printf(sc->dev, "could not setup required " + "transfers, %s\n", usb2_errstr(err)); + goto detach; + } + /* get number of devices so we can add matching channels */ + request.bmRequestType = UT_READ_CLASS_INTERFACE; + request.bRequest = 0xfe; /* GET_MAX_LUN; */ + USETW(request.wValue, 0); + USETW(request.wIndex, sc->iface_no); + USETW(request.wLength, sizeof(maxlun)); + err = usb2_do_request(uaa->device, &Giant, &request, &maxlun); + + if (err) { + if (bootverbose) { + device_printf(sc->dev, "get maxlun not supported %s\n", + usb2_errstr(err)); + } + } else { + sc->maxlun = maxlun; + if (bootverbose) { + device_printf(sc->dev, "maxlun=%d\n", sc->maxlun); + } + } + + /* ata channels are children to this USB control device */ + for (i = 0; i <= sc->maxlun; i++) { + if (!device_add_child(sc->dev, "ata", + devclass_find_free_unit(ata_devclass, 2))) { + device_printf(sc->dev, "failed to attach ata child device\n"); + goto detach; + } + } + bus_generic_attach(sc->dev); + + return (0); + +detach: + atausb2_detach(dev); + return (ENXIO); +} + +static int +atausb2_detach(device_t dev) +{ + struct atausb2_softc *sc = device_get_softc(dev); + device_t *children; + int nchildren, i; + + /* teardown our statemachine */ + + usb2_transfer_unsetup(sc->xfer, ATAUSB_T_MAX); + + /* detach & delete all children, if any */ + + if (!device_get_children(dev, &children, &nchildren)) { + for (i = 0; i < nchildren; i++) { + device_delete_child(dev, children[i]); + } + free(children, M_TEMP); + } + mtx_destroy(&sc->locked_mtx); + return (0); +} + +static void +atausb2_transfer_start(struct atausb2_softc *sc, uint8_t xfer_no) +{ + if (atausbdebug) { + device_printf(sc->dev, "BBB transfer %d\n", xfer_no); + } + if (sc->xfer[xfer_no]) { + sc->last_xfer_no = xfer_no; + usb2_transfer_start(sc->xfer[xfer_no]); + } else { + atausb2_cancel_request(sc); + } +} + +static void +atausb2_t_bbb_reset1_callback(struct usb2_xfer *xfer) +{ + struct atausb2_softc *sc = xfer->priv_sc; + struct usb2_device_request req; + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + atausb2_transfer_start(sc, ATAUSB_T_BBB_RESET2); + return; + + case USB_ST_SETUP: + req.bmRequestType = UT_WRITE_CLASS_INTERFACE; + req.bRequest = 0xff; /* bulk-only reset */ + USETW(req.wValue, 0); + req.wIndex[0] = sc->iface_no; + req.wIndex[1] = 0; + USETW(req.wLength, 0); + + usb2_copy_in(xfer->frbuffers, 0, &req, sizeof(req)); + + xfer->frlengths[0] = sizeof(req); + xfer->nframes = 1; + usb2_start_hardware(xfer); + return; + + default: /* Error */ + atausb2_tr_error(xfer); + return; + + } +} + +static void +atausb2_t_bbb_reset2_callback(struct usb2_xfer *xfer) +{ + atausb2_t_bbb_data_clear_stall_callback(xfer, ATAUSB_T_BBB_RESET3, + ATAUSB_T_BBB_DATA_READ); +} + +static void +atausb2_t_bbb_reset3_callback(struct usb2_xfer *xfer) +{ + atausb2_t_bbb_data_clear_stall_callback(xfer, ATAUSB_T_BBB_COMMAND, + ATAUSB_T_BBB_DATA_WRITE); +} + +static void +atausb2_t_bbb_data_clear_stall_callback(struct usb2_xfer *xfer, + uint8_t next_xfer, + uint8_t stall_xfer) +{ + struct atausb2_softc *sc = xfer->priv_sc; + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: +tr_transferred: + atausb2_transfer_start(sc, next_xfer); + return; + + case USB_ST_SETUP: + if (usb2_clear_stall_callback(xfer, sc->xfer[stall_xfer])) { + goto tr_transferred; + } + return; + + default: /* Error */ + atausb2_tr_error(xfer); + return; + + } +} + +static void +atausb2_t_bbb_command_callback(struct usb2_xfer *xfer) +{ + struct atausb2_softc *sc = xfer->priv_sc; + struct ata_request *request = sc->ata_request; + struct ata_channel *ch; + uint32_t tag; + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + atausb2_transfer_start + (sc, ((request->flags & ATA_R_READ) ? ATAUSB_T_BBB_DATA_READ : + (request->flags & ATA_R_WRITE) ? ATAUSB_T_BBB_DATA_WRITE : + ATAUSB_T_BBB_STATUS)); + return; + + case USB_ST_SETUP: + + sc->status_try = 0; + + if (request) { + ch = device_get_softc(request->parent); + + sc->timeout = (request->timeout * 1000) + 5000; + + tag = UGETDW(sc->cbw.tag) + 1; + + USETDW(sc->cbw.signature, CBWSIGNATURE); + USETDW(sc->cbw.tag, tag); + USETDW(sc->cbw.transfer_length, request->bytecount); + sc->cbw.flags = (request->flags & ATA_R_READ) ? CBWFLAGS_IN : CBWFLAGS_OUT; + sc->cbw.lun = ch->unit; + sc->cbw.length = 16; + bzero(sc->cbw.cdb, 16); + bcopy(request->u.atapi.ccb, sc->cbw.cdb, 12); /* XXX SOS */ + + usb2_copy_in(xfer->frbuffers, 0, &sc->cbw, sizeof(sc->cbw)); + + xfer->frlengths[0] = sizeof(sc->cbw); + usb2_start_hardware(xfer); + } + return; + + default: /* Error */ + atausb2_tr_error(xfer); + return; + + } +} + +static void +atausb2_t_bbb_data_read_callback(struct usb2_xfer *xfer) +{ + struct atausb2_softc *sc = xfer->priv_sc; + uint32_t max_bulk = xfer->max_data_length; + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + + usb2_copy_out(xfer->frbuffers, 0, + sc->ata_data, xfer->actlen); + + sc->ata_bytecount -= xfer->actlen; + sc->ata_data += xfer->actlen; + sc->ata_donecount += xfer->actlen; + + if (xfer->actlen < xfer->sumlen) { + /* short transfer */ + sc->ata_bytecount = 0; + } + case USB_ST_SETUP: + + if (atausbdebug > 1) { + device_printf(sc->dev, "%s: max_bulk=%d, ata_bytecount=%d\n", + __FUNCTION__, max_bulk, sc->ata_bytecount); + } + if (sc->ata_bytecount == 0) { + atausb2_transfer_start(sc, ATAUSB_T_BBB_STATUS); + return; + } + if (max_bulk > sc->ata_bytecount) { + max_bulk = sc->ata_bytecount; + } + xfer->timeout = sc->timeout; + xfer->frlengths[0] = max_bulk; + + usb2_start_hardware(xfer); + return; + + default: /* Error */ + if (xfer->error == USB_ERR_CANCELLED) { + atausb2_tr_error(xfer); + } else { + atausb2_transfer_start(sc, ATAUSB_T_BBB_DATA_RD_CS); + } + return; + + } +} + +static void +atausb2_t_bbb_data_rd_cs_callback(struct usb2_xfer *xfer) +{ + atausb2_t_bbb_data_clear_stall_callback(xfer, ATAUSB_T_BBB_STATUS, + ATAUSB_T_BBB_DATA_READ); +} + +static void +atausb2_t_bbb_data_write_callback(struct usb2_xfer *xfer) +{ + struct atausb2_softc *sc = xfer->priv_sc; + uint32_t max_bulk = xfer->max_data_length; + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + + sc->ata_bytecount -= xfer->actlen; + sc->ata_data += xfer->actlen; + sc->ata_donecount += xfer->actlen; + + case USB_ST_SETUP: + + if (atausbdebug > 1) { + device_printf(sc->dev, "%s: max_bulk=%d, ata_bytecount=%d\n", + __FUNCTION__, max_bulk, sc->ata_bytecount); + } + if (sc->ata_bytecount == 0) { + atausb2_transfer_start(sc, ATAUSB_T_BBB_STATUS); + return; + } + if (max_bulk > sc->ata_bytecount) { + max_bulk = sc->ata_bytecount; + } + xfer->timeout = sc->timeout; + xfer->frlengths[0] = max_bulk; + + usb2_copy_in(xfer->frbuffers, 0, + sc->ata_data, max_bulk); + + usb2_start_hardware(xfer); + return; + + default: /* Error */ + if (xfer->error == USB_ERR_CANCELLED) { + atausb2_tr_error(xfer); + } else { + atausb2_transfer_start(sc, ATAUSB_T_BBB_DATA_WR_CS); + } + return; + + } +} + +static void +atausb2_t_bbb_data_wr_cs_callback(struct usb2_xfer *xfer) +{ + atausb2_t_bbb_data_clear_stall_callback(xfer, ATAUSB_T_BBB_STATUS, + ATAUSB_T_BBB_DATA_WRITE); +} + +static void +atausb2_t_bbb_status_callback(struct usb2_xfer *xfer) +{ + struct atausb2_softc *sc = xfer->priv_sc; + struct ata_request *request = sc->ata_request; + uint32_t residue; + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + + if (xfer->actlen < sizeof(sc->csw)) { + bzero(&sc->csw, sizeof(sc->csw)); + } + usb2_copy_out(xfer->frbuffers, 0, &sc->csw, xfer->actlen); + + if (request->flags & (ATA_R_READ | ATA_R_WRITE)) { + request->donecount = sc->ata_donecount; + } + residue = UGETDW(sc->csw.residue); + + if (!residue) { + residue = (request->bytecount - request->donecount); + } + if (residue > request->bytecount) { + if (atausbdebug) { + device_printf(sc->dev, "truncating residue from %d " + "to %d bytes\n", residue, + request->bytecount); + } + residue = request->bytecount; + } + /* check CSW and handle eventual error */ + if (UGETDW(sc->csw.signature) != CSWSIGNATURE) { + if (atausbdebug) { + device_printf(sc->dev, "bad CSW signature 0x%08x != 0x%08x\n", + UGETDW(sc->csw.signature), CSWSIGNATURE); + } + goto tr_error; + } else if (UGETDW(sc->csw.tag) != UGETDW(sc->cbw.tag)) { + if (atausbdebug) { + device_printf(sc->dev, "bad CSW tag %d != %d\n", + UGETDW(sc->csw.tag), UGETDW(sc->cbw.tag)); + } + goto tr_error; + } else if (sc->csw.status > CSWSTATUS_PHASE) { + if (atausbdebug) { + device_printf(sc->dev, "bad CSW status %d > %d\n", + sc->csw.status, CSWSTATUS_PHASE); + } + goto tr_error; + } else if (sc->csw.status == CSWSTATUS_PHASE) { + if (atausbdebug) { + device_printf(sc->dev, "phase error residue = %d\n", residue); + } + goto tr_error; + } else if (request->donecount > request->bytecount) { + if (atausbdebug) { + device_printf(sc->dev, "buffer overrun %d > %d\n", + request->donecount, request->bytecount); + } + goto tr_error; + } else if (sc->csw.status == CSWSTATUS_FAILED) { + if (atausbdebug) { + device_printf(sc->dev, "CSWSTATUS_FAILED\n"); + } + request->error = ATA_E_ATAPI_SENSE_MASK; + } + sc->last_xfer_no = ATAUSB_T_BBB_COMMAND; + + sc->ata_request = NULL; + + /* drop the USB transfer lock while doing the ATA interrupt */ + mtx_unlock(&sc->locked_mtx); + + ata_interrupt(device_get_softc(request->parent)); + + mtx_lock(&sc->locked_mtx); + return; + + case USB_ST_SETUP: + xfer->frlengths[0] = xfer->max_data_length; + usb2_start_hardware(xfer); + return; + + default: +tr_error: + if ((xfer->error == USB_ERR_CANCELLED) || + (sc->status_try)) { + atausb2_tr_error(xfer); + } else { + sc->status_try = 1; + atausb2_transfer_start(sc, ATAUSB_T_BBB_DATA_RD_CS); + } + return; + + } +} + +static void +atausb2_cancel_request(struct atausb2_softc *sc) +{ + struct ata_request *request; + + mtx_assert(&sc->locked_mtx, MA_OWNED); + + request = sc->ata_request; + sc->ata_request = NULL; + sc->last_xfer_no = ATAUSB_T_BBB_RESET1; + + if (request) { + request->error = ATA_E_ATAPI_SENSE_MASK; + + mtx_unlock(&sc->locked_mtx); + + ata_interrupt(device_get_softc(request->parent)); + + mtx_lock(&sc->locked_mtx); + } +} + +static void +atausb2_tr_error(struct usb2_xfer *xfer) +{ + struct atausb2_softc *sc = xfer->priv_sc; + + if (xfer->error != USB_ERR_CANCELLED) { + + if (atausbdebug) { + device_printf(sc->dev, "transfer failed, %s, in state %d " + "-> BULK reset\n", usb2_errstr(xfer->error), + sc->last_xfer_no); + } + } + atausb2_cancel_request(sc); +} + +/* + * ATA backend part + */ +struct atapi_inquiry { + uint8_t device_type; + uint8_t device_modifier; + uint8_t version; + uint8_t response_format; + uint8_t length; + uint8_t reserved[2]; + uint8_t flags; + uint8_t vendor[8]; + uint8_t product[16]; + uint8_t revision[4]; + /* uint8_t crap[60]; */ +} __packed; + +static int +ata_usbchannel_begin_transaction(struct ata_request *request) +{ + struct atausb2_softc *sc = + device_get_softc(device_get_parent(request->parent)); + int error; + + if (atausbdebug > 1) { + device_printf(request->dev, "begin_transaction %s\n", + ata_cmd2str(request)); + } + mtx_lock(&sc->locked_mtx); + + /* sanity, just in case */ + if (sc->ata_request) { + device_printf(request->dev, "begin is busy, " + "state = %d\n", sc->last_xfer_no); + request->result = EBUSY; + error = ATA_OP_FINISHED; + goto done; + } + /* + * XXX SOS convert the request into the format used, only BBB for + * now + */ + + /* ATA/ATAPI IDENTIFY needs special treatment */ + if (!(request->flags & ATA_R_ATAPI)) { + if (request->u.ata.command != ATA_ATAPI_IDENTIFY) { + device_printf(request->dev, "%s unsupported\n", + ata_cmd2str(request)); + request->result = EIO; + error = ATA_OP_FINISHED; + goto done; + } + request->flags |= ATA_R_ATAPI; + bzero(request->u.atapi.ccb, 16); + request->u.atapi.ccb[0] = ATAPI_INQUIRY; + request->u.atapi.ccb[4] = 255; /* sizeof(struct + * atapi_inquiry); */ + request->data += 256; /* arbitrary offset into ata_param */ + request->bytecount = 255; /* sizeof(struct + * atapi_inquiry); */ + } + if (sc->xfer[sc->last_xfer_no]) { + + sc->ata_request = request; + sc->ata_bytecount = request->bytecount; + sc->ata_data = request->data; + sc->ata_donecount = 0; + + usb2_transfer_start(sc->xfer[sc->last_xfer_no]); + error = ATA_OP_CONTINUES; + } else { + request->result = EIO; + error = ATA_OP_FINISHED; + } + +done: + mtx_unlock(&sc->locked_mtx); + return (error); +} + +static int +ata_usbchannel_end_transaction(struct ata_request *request) +{ + if (atausbdebug > 1) { + device_printf(request->dev, "end_transaction %s\n", + ata_cmd2str(request)); + } + /* + * XXX SOS convert the request from the format used, only BBB for + * now + */ + + /* ATA/ATAPI IDENTIFY needs special treatment */ + if ((request->flags & ATA_R_ATAPI) && + (request->u.atapi.ccb[0] == ATAPI_INQUIRY)) { + struct ata_device *atadev = device_get_softc(request->dev); + struct atapi_inquiry *inquiry = (struct atapi_inquiry *)request->data; + uint16_t *ptr; + + /* convert inquiry data into simple ata_param like format */ + atadev->param.config = ATA_PROTO_ATAPI | ATA_PROTO_ATAPI_12; + atadev->param.config |= (inquiry->device_type & 0x1f) << 8; + bzero(atadev->param.model, sizeof(atadev->param.model)); + strncpy(atadev->param.model, inquiry->vendor, 8); + strcpy(atadev->param.model, " "); + strncpy(atadev->param.model, inquiry->product, 16); + ptr = (uint16_t *)(atadev->param.model + sizeof(atadev->param.model)); + while (--ptr >= (uint16_t *)atadev->param.model) { + *ptr = ntohs(*ptr); + } + strncpy(atadev->param.revision, inquiry->revision, 4); + ptr = (uint16_t *)(atadev->param.revision + sizeof(atadev->param.revision)); + while (--ptr >= (uint16_t *)atadev->param.revision) { + *ptr = ntohs(*ptr); + } + request->result = 0; + } + return (ATA_OP_FINISHED); +} + +static int *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Feb 23 22:13:05 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EDE0D1065672; Mon, 23 Feb 2009 22:13:05 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D9DB28FC12; Mon, 23 Feb 2009 22:13:05 +0000 (UTC) (envelope-from mav@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 n1NMD5dr041007; Mon, 23 Feb 2009 22:13:05 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1NMD5fn041006; Mon, 23 Feb 2009 22:13:05 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200902232213.n1NMD5fn041006@svn.freebsd.org> From: Alexander Motin Date: Mon, 23 Feb 2009 22:13:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188958 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2009 22:13:08 -0000 Author: mav Date: Mon Feb 23 22:13:05 2009 New Revision: 188958 URL: http://svn.freebsd.org/changeset/base/188958 Log: Fix non-AHCI channels detection on combined JMicron controllers, broken by r188694. Modified: head/sys/dev/ata/chipsets/ata-jmicron.c Modified: head/sys/dev/ata/chipsets/ata-jmicron.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-jmicron.c Mon Feb 23 21:19:18 2009 (r188957) +++ head/sys/dev/ata/chipsets/ata-jmicron.c Mon Feb 23 22:13:05 2009 (r188958) @@ -132,6 +132,8 @@ ata_jmicron_chipinit(device_t dev) /* set the number of HW channels */ ctlr->channels = ctlr->chip->cfg1 + ctlr->chip->cfg2; + ctlr->ichannels |= ((0xffffffffU >> (32 - ctlr->chip->cfg2)) + << ctlr->chip->cfg1); } return 0; } From owner-svn-src-head@FreeBSD.ORG Mon Feb 23 22:29:38 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7AE041065674; Mon, 23 Feb 2009 22:29:38 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 53F998FC17; Mon, 23 Feb 2009 22:29:38 +0000 (UTC) (envelope-from mav@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 n1NMTcsU041349; Mon, 23 Feb 2009 22:29:38 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1NMTcen041348; Mon, 23 Feb 2009 22:29:38 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200902232229.n1NMTcen041348@svn.freebsd.org> From: Alexander Motin Date: Mon, 23 Feb 2009 22:29:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188959 - head/sbin/atacontrol X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2009 22:29:39 -0000 Author: mav Date: Mon Feb 23 22:29:38 2009 New Revision: 188959 URL: http://svn.freebsd.org/changeset/base/188959 Log: Bring SATA revision reporting into conformance with SATA-IO guidelines. Modified: head/sbin/atacontrol/atacontrol.c Modified: head/sbin/atacontrol/atacontrol.c ============================================================================== --- head/sbin/atacontrol/atacontrol.c Mon Feb 23 22:13:05 2009 (r188958) +++ head/sbin/atacontrol/atacontrol.c Mon Feb 23 22:29:38 2009 (r188959) @@ -132,11 +132,11 @@ param_print(struct ata_params *parm) printf("<%.40s/%.8s> ", parm->model, parm->revision); if (parm->satacapabilities && parm->satacapabilities != 0xffff) { if (parm->satacapabilities & ATA_SATA_GEN2) - printf("Serial ATA II\n"); + printf("SATA revision 2.x\n"); else if (parm->satacapabilities & ATA_SATA_GEN1) - printf("Serial ATA v1.0\n"); + printf("SATA revision 1.x\n"); else - printf("Unknown serial ATA version\n"); + printf("Unknown SATA revision\n"); } else printf("ATA/ATAPI revision %d\n", version(parm->version_major)); @@ -157,11 +157,11 @@ cap_print(struct ata_params *parm) printf("Protocol "); if (parm->satacapabilities && parm->satacapabilities != 0xffff) { if (parm->satacapabilities & ATA_SATA_GEN2) - printf("Serial ATA II\n"); + printf("SATA revision 2.x\n"); else if (parm->satacapabilities & ATA_SATA_GEN1) - printf("Serial ATA v1.0\n"); + printf("SATA revision 1.x\n"); else - printf("Unknown serial ATA version\n"); + printf("Unknown SATA revision\n"); } else printf("ATA/ATAPI revision %d\n", version(parm->version_major)); From owner-svn-src-head@FreeBSD.ORG Mon Feb 23 22:49:43 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C8FD106566C; Mon, 23 Feb 2009 22:49:43 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4A63A8FC17; Mon, 23 Feb 2009 22:49:43 +0000 (UTC) (envelope-from thompsa@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 n1NMnhFF041782; Mon, 23 Feb 2009 22:49:43 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1NMnhCk041781; Mon, 23 Feb 2009 22:49:43 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902232249.n1NMnhCk041781@svn.freebsd.org> From: Andrew Thompson Date: Mon, 23 Feb 2009 22:49:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188960 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2009 22:49:43 -0000 Author: thompsa Date: Mon Feb 23 22:49:43 2009 New Revision: 188960 URL: http://svn.freebsd.org/changeset/base/188960 Log: Remove ugen from NOTES, its no longer an optional device. Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Mon Feb 23 22:29:38 2009 (r188959) +++ head/sys/conf/NOTES Mon Feb 23 22:49:43 2009 (r188960) @@ -2410,8 +2410,6 @@ device usb device udbp # USB Fm Radio device ufm -# Generic USB device driver -device ugen # Human Interface Device (anything with buttons and dials) device uhid # USB keyboard From owner-svn-src-head@FreeBSD.ORG Mon Feb 23 22:56:03 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63EC01065673; Mon, 23 Feb 2009 22:56:03 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 51CB08FC0C; Mon, 23 Feb 2009 22:56:03 +0000 (UTC) (envelope-from thompsa@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 n1NMu3s1041937; Mon, 23 Feb 2009 22:56:03 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1NMu3oK041935; Mon, 23 Feb 2009 22:56:03 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902232256.n1NMu3oK041935@svn.freebsd.org> From: Andrew Thompson Date: Mon, 23 Feb 2009 22:56:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188961 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2009 22:56:04 -0000 Author: thompsa Date: Mon Feb 23 22:56:03 2009 New Revision: 188961 URL: http://svn.freebsd.org/changeset/base/188961 Log: - comment out slhci in NOTES for the moment - rearrange the ucom entry so its recognised by config(8) Modified: head/sys/conf/NOTES head/sys/conf/files Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Mon Feb 23 22:49:43 2009 (r188960) +++ head/sys/conf/NOTES Mon Feb 23 22:56:03 2009 (r188961) @@ -2402,7 +2402,7 @@ device ohci # EHCI controller device ehci # SL811 Controller -device slhci +#device slhci # General USB code (mandatory for USB) device usb # Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Feb 23 22:49:43 2009 (r188960) +++ head/sys/conf/files Mon Feb 23 22:56:03 2009 (r188961) @@ -1621,8 +1621,8 @@ dev/usb/serial/uplcom.c optional uplcom dev/usb/serial/uslcom.c optional uslcom dev/usb/serial/uvisor.c optional uvisor dev/usb/serial/uvscom.c optional uvscom -dev/usb/serial/usb_serial.c \ - optional (ucom | u3g | uark | ubsa | ubser | uchcom | ucycom | ufoma | uftdi | ugensa | uipaq | ulpt | umct | umodem | umoscom | uplcom | uslcom | uvisor | uvscom) +dev/usb/serial/usb_serial.c optional ucom | \ + (u3g | uark | ubsa | ubser | uchcom | ucycom | ufoma | uftdi | ugensa | uipaq | ulpt | umct | umodem | umoscom | uplcom | uslcom | uvisor | uvscom) # # USB bluetooth drivers # From owner-svn-src-head@FreeBSD.ORG Mon Feb 23 22:57:55 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8AD59106564A; Mon, 23 Feb 2009 22:57:55 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 78C8F8FC27; Mon, 23 Feb 2009 22:57:55 +0000 (UTC) (envelope-from rwatson@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 n1NMvtq1042003; Mon, 23 Feb 2009 22:57:55 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1NMvtgt042002; Mon, 23 Feb 2009 22:57:55 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200902232257.n1NMvtgt042002@svn.freebsd.org> From: Robert Watson Date: Mon, 23 Feb 2009 22:57:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188962 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2009 22:57:56 -0000 Author: rwatson Date: Mon Feb 23 22:57:55 2009 New Revision: 188962 URL: http://svn.freebsd.org/changeset/base/188962 Log: In in_rtqkill(), assert the radix head lock, and pass RTF_RNH_LOCKED to in_rtrequest(); the radix head lock is already acquired before rnh_walktree is called in in_rtqtimo_one(). This avoids a recursive acquisition that is no longer permitted in 8.x due to use of an rwlock for the radix head lock. Reported by: dikshie MFC after: 3 days Modified: head/sys/netinet/in_rmx.c Modified: head/sys/netinet/in_rmx.c ============================================================================== --- head/sys/netinet/in_rmx.c Mon Feb 23 22:56:03 2009 (r188961) +++ head/sys/netinet/in_rmx.c Mon Feb 23 22:57:55 2009 (r188962) @@ -203,6 +203,8 @@ in_rtqkill(struct radix_node *rn, void * struct rtentry *rt = (struct rtentry *)rn; int err; + RADIX_NODE_HEAD_WLOCK_ASSERT(ap->rnh); + if (rt->rt_flags & RTPRF_OURS) { ap->found++; @@ -213,7 +215,8 @@ in_rtqkill(struct radix_node *rn, void * err = in_rtrequest(RTM_DELETE, (struct sockaddr *)rt_key(rt), rt->rt_gateway, rt_mask(rt), - rt->rt_flags, 0, rt->rt_fibnum); + rt->rt_flags | RTF_RNH_LOCKED, 0, + rt->rt_fibnum); if (err) { log(LOG_WARNING, "in_rtqkill: error %d\n", err); } else { From owner-svn-src-head@FreeBSD.ORG Mon Feb 23 22:58:59 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 590351065670; Mon, 23 Feb 2009 22:58:59 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 474908FC08; Mon, 23 Feb 2009 22:58:59 +0000 (UTC) (envelope-from rwatson@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 n1NMwxJ1042076; Mon, 23 Feb 2009 22:58:59 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1NMwxLN042075; Mon, 23 Feb 2009 22:58:59 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200902232258.n1NMwxLN042075@svn.freebsd.org> From: Robert Watson Date: Mon, 23 Feb 2009 22:58:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188963 - head/sys/netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2009 22:59:00 -0000 Author: rwatson Date: Mon Feb 23 22:58:59 2009 New Revision: 188963 URL: http://svn.freebsd.org/changeset/base/188963 Log: Assert the radix head lock in in6_rtqkill(). MFC after: 3 days Modified: head/sys/netinet6/in6_rmx.c Modified: head/sys/netinet6/in6_rmx.c ============================================================================== --- head/sys/netinet6/in6_rmx.c Mon Feb 23 22:57:55 2009 (r188962) +++ head/sys/netinet6/in6_rmx.c Mon Feb 23 22:58:59 2009 (r188963) @@ -244,6 +244,8 @@ in6_rtqkill(struct radix_node *rn, void struct rtentry *rt = (struct rtentry *)rn; int err; + RADIX_NODE_HEAD_WLOCK_ASSERT(ap->rnh); + if (rt->rt_flags & RTPRF_OURS) { ap->found++; From owner-svn-src-head@FreeBSD.ORG Mon Feb 23 23:00:13 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3FE14106564A; Mon, 23 Feb 2009 23:00:13 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2DB2C8FC16; Mon, 23 Feb 2009 23:00:13 +0000 (UTC) (envelope-from rwatson@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 n1NN0DDg042167; Mon, 23 Feb 2009 23:00:13 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1NN0Dwa042166; Mon, 23 Feb 2009 23:00:13 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200902232300.n1NN0Dwa042166@svn.freebsd.org> From: Robert Watson Date: Mon, 23 Feb 2009 23:00:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188964 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2009 23:00:13 -0000 Author: rwatson Date: Mon Feb 23 23:00:12 2009 New Revision: 188964 URL: http://svn.freebsd.org/changeset/base/188964 Log: Add a debugging sysctl, debug.vm_lowmem, that when assigned a value of 1 will trigger a pass through the VM's low-memory handlers, such as protocol and UMA drain routines. This makes it easier to exercise these otherwise rarely-invoked code paths. MFC after: 3 days Modified: head/sys/vm/vm_kern.c Modified: head/sys/vm/vm_kern.c ============================================================================== --- head/sys/vm/vm_kern.c Mon Feb 23 22:58:59 2009 (r188963) +++ head/sys/vm/vm_kern.c Mon Feb 23 23:00:12 2009 (r188964) @@ -73,6 +73,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -500,3 +501,24 @@ kmem_init(start, end) /* ... and ending with the completion of the above `insert' */ vm_map_unlock(m); } + +/* + * Allow userspace to directly trigger the VM drain routine for testing + * purposes. + */ +static int +debug_vm_lowmem(SYSCTL_HANDLER_ARGS) +{ + int error, i; + + i = 0; + error = sysctl_handle_int(oidp, &i, 0, req); + if (error) + return (error); + if (i) + EVENTHANDLER_INVOKE(vm_lowmem, 0); + return (0); +} + +SYSCTL_PROC(_debug, OID_AUTO, vm_lowmem, CTLTYPE_INT | CTLFLAG_RW, 0, 0, + debug_vm_lowmem, "I", "set to trigger vm_lowmem event"); From owner-svn-src-head@FreeBSD.ORG Mon Feb 23 23:04:16 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3AE3D10656BE; Mon, 23 Feb 2009 23:04:16 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 27EDD8FC1D; Mon, 23 Feb 2009 23:04:16 +0000 (UTC) (envelope-from rwatson@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 n1NN4GBL042303; Mon, 23 Feb 2009 23:04:16 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1NN4Gu5042302; Mon, 23 Feb 2009 23:04:16 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200902232304.n1NN4Gu5042302@svn.freebsd.org> From: Robert Watson Date: Mon, 23 Feb 2009 23:04:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188965 - head/sys/nfsserver X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2009 23:04:17 -0000 Author: rwatson Date: Mon Feb 23 23:04:15 2009 New Revision: 188965 URL: http://svn.freebsd.org/changeset/base/188965 Log: Include audit.h so that the system call path protected by NFS_LEGACYRPC can audit its arguments. Submitted by: Jaakko Heinonen MFC after: 1 week X-MFC-note: MFC with r188311 Modified: head/sys/nfsserver/nfs_syscalls.c Modified: head/sys/nfsserver/nfs_syscalls.c ============================================================================== --- head/sys/nfsserver/nfs_syscalls.c Mon Feb 23 23:00:12 2009 (r188964) +++ head/sys/nfsserver/nfs_syscalls.c Mon Feb 23 23:04:15 2009 (r188965) @@ -73,6 +73,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #ifdef NFS_LEGACYRPC static MALLOC_DEFINE(M_NFSSVC, "nfss_srvsock", "Nfs server structure"); From owner-svn-src-head@FreeBSD.ORG Mon Feb 23 23:12:01 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C29021065673; Mon, 23 Feb 2009 23:12:01 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AF3538FC0A; Mon, 23 Feb 2009 23:12:01 +0000 (UTC) (envelope-from thompsa@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 n1NNC1f2042491; Mon, 23 Feb 2009 23:12:01 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1NNC1bh042490; Mon, 23 Feb 2009 23:12:01 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902232312.n1NNC1bh042490@svn.freebsd.org> From: Andrew Thompson Date: Mon, 23 Feb 2009 23:12:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188966 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2009 23:12:03 -0000 Author: thompsa Date: Mon Feb 23 23:12:01 2009 New Revision: 188966 URL: http://svn.freebsd.org/changeset/base/188966 Log: Use the correct config names for the netgraph bluetooth modules. Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Feb 23 23:04:15 2009 (r188965) +++ head/sys/conf/files Mon Feb 23 23:12:01 2009 (r188966) @@ -1626,8 +1626,8 @@ dev/usb/serial/usb_serial.c optional uc # # USB bluetooth drivers # -dev/usb/bluetooth/ng_ubt.c optional ubt -dev/usb/bluetooth/ubtbcmfw.c optional ubtbcmfw +dev/usb/bluetooth/ng_ubt.c optional netgraph_bluetooth_ubt usb +dev/usb/bluetooth/ubtbcmfw.c optional netgraph_bluetooth_ubtbcmfw usb # # USB misc drivers # @@ -2243,8 +2243,8 @@ netgraph/atm/uni/ng_uni.c optional ngatm netgraph/bluetooth/common/ng_bluetooth.c optional netgraph_bluetooth netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c optional netgraph_bluetooth_bt3c netgraph/bluetooth/drivers/h4/ng_h4.c optional netgraph_bluetooth_h4 -netgraph/bluetooth/drivers/ubt/ng_ubt.c optional netgraph_bluetooth_ubt -netgraph/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c optional netgraph_bluetooth_ubtbcmfw +netgraph/bluetooth/drivers/ubt/ng_ubt.c optional netgraph_bluetooth_ubt ousb +netgraph/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c optional netgraph_bluetooth_ubtbcmfw ousb netgraph/bluetooth/hci/ng_hci_cmds.c optional netgraph_bluetooth_hci netgraph/bluetooth/hci/ng_hci_evnt.c optional netgraph_bluetooth_hci netgraph/bluetooth/hci/ng_hci_main.c optional netgraph_bluetooth_hci From owner-svn-src-head@FreeBSD.ORG Mon Feb 23 23:30:17 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 991E61065673; Mon, 23 Feb 2009 23:30:17 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 859A78FC0C; Mon, 23 Feb 2009 23:30:17 +0000 (UTC) (envelope-from rwatson@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 n1NNUHH8042880; Mon, 23 Feb 2009 23:30:17 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1NNUHOR042879; Mon, 23 Feb 2009 23:30:17 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200902232330.n1NNUHOR042879@svn.freebsd.org> From: Robert Watson Date: Mon, 23 Feb 2009 23:30:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188967 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2009 23:30:18 -0000 Author: rwatson Date: Mon Feb 23 23:30:17 2009 New Revision: 188967 URL: http://svn.freebsd.org/changeset/base/188967 Log: Put debug.vm_lowmem sysctl under DIAGNOSTIC. Submitted by: sam MFC after: 3 days Modified: head/sys/vm/vm_kern.c Modified: head/sys/vm/vm_kern.c ============================================================================== --- head/sys/vm/vm_kern.c Mon Feb 23 23:12:01 2009 (r188966) +++ head/sys/vm/vm_kern.c Mon Feb 23 23:30:17 2009 (r188967) @@ -502,6 +502,7 @@ kmem_init(start, end) vm_map_unlock(m); } +#ifdef DIAGNOSTIC /* * Allow userspace to directly trigger the VM drain routine for testing * purposes. @@ -522,3 +523,4 @@ debug_vm_lowmem(SYSCTL_HANDLER_ARGS) SYSCTL_PROC(_debug, OID_AUTO, vm_lowmem, CTLTYPE_INT | CTLFLAG_RW, 0, 0, debug_vm_lowmem, "I", "set to trigger vm_lowmem event"); +#endif From owner-svn-src-head@FreeBSD.ORG Mon Feb 23 23:41:12 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9DA81065676; Mon, 23 Feb 2009 23:41:12 +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 9C72E8FC13; Mon, 23 Feb 2009 23:41:12 +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 n1NNfCtI043134; Mon, 23 Feb 2009 23:41:12 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1NNfCpr043130; Mon, 23 Feb 2009 23:41:12 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902232341.n1NNfCpr043130@svn.freebsd.org> From: Sam Leffler Date: Mon, 23 Feb 2009 23:41:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188968 - in head/sys/dev/ath: . ath_hal ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2009 23:41:13 -0000 Author: sam Date: Mon Feb 23 23:41:12 2009 New Revision: 188968 URL: http://svn.freebsd.org/changeset/base/188968 Log: print mac+rf part names; drop the printing 2ghz rf stuff (might come back) Modified: head/sys/dev/ath/ath_hal/ah.c head/sys/dev/ath/ath_hal/ah.h head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/ath_hal/ah.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah.c Mon Feb 23 23:30:17 2009 (r188967) +++ head/sys/dev/ath/ath_hal/ah.c Mon Feb 23 23:41:12 2009 (r188968) @@ -22,6 +22,8 @@ #include "ah_internal.h" #include "ah_devid.h" +#include "ar5416/ar5416reg.h" /* NB: includes ar5212reg.h */ + /* linker set of registered chips */ OS_SET_DECLARE(ah_chips, struct ath_hal_chip); @@ -78,6 +80,44 @@ ath_hal_attach(uint16_t devid, HAL_SOFTC return AH_NULL; } +const char * +ath_hal_mac_name(struct ath_hal *ah) +{ + switch (ah->ah_macVersion) { + case AR_SREV_VERSION_CRETE: + case AR_SREV_VERSION_MAUI_1: + return "5210"; + case AR_SREV_VERSION_MAUI_2: + case AR_SREV_VERSION_OAHU: + return "5211"; + case AR_SREV_VERSION_VENICE: + return "5212"; + case AR_SREV_VERSION_GRIFFIN: + return "2413"; + case AR_SREV_VERSION_CONDOR: + return "5424"; + case AR_SREV_VERSION_EAGLE: + return "5413"; + case AR_SREV_VERSION_COBRA: + return "2415"; + case AR_SREV_2425: + return "2425"; + case AR_SREV_2417: + return "2417"; + case AR_XSREV_VERSION_OWL_PCI: + return "5416"; + case AR_XSREV_VERSION_OWL_PCIE: + return "5418"; + case AR_XSREV_VERSION_SOWL: + return "9160"; + case AR_XSREV_VERSION_MERLIN: + return "9280"; + case AR_XSREV_VERSION_KITE: + return "9285"; + } + return "????"; +} + /* * Return the mask of available modes based on the hardware capabilities. */ @@ -108,6 +148,48 @@ ath_hal_rfprobe(struct ath_hal *ah, HAL_ return AH_NULL; } +const char * +ath_hal_rf_name(struct ath_hal *ah) +{ + switch (ah->ah_analog5GhzRev & AR_RADIO_SREV_MAJOR) { + case 0: /* 5210 */ + return "5110"; /* NB: made up */ + case AR_RAD5111_SREV_MAJOR: + case AR_RAD5111_SREV_PROD: + return "5111"; + case AR_RAD2111_SREV_MAJOR: + return "2111"; + case AR_RAD5112_SREV_MAJOR: + case AR_RAD5112_SREV_2_0: + case AR_RAD5112_SREV_2_1: + return "5112"; + case AR_RAD2112_SREV_MAJOR: + case AR_RAD2112_SREV_2_0: + case AR_RAD2112_SREV_2_1: + return "2112"; + case AR_RAD2413_SREV_MAJOR: + return "2413"; + case AR_RAD5413_SREV_MAJOR: + return "5413"; + case AR_RAD2316_SREV_MAJOR: + return "2316"; + case AR_RAD2317_SREV_MAJOR: + return "2317"; + case AR_RAD5424_SREV_MAJOR: + return "5424"; + + case AR_RAD5133_SREV_MAJOR: + return "5133"; + case AR_RAD2133_SREV_MAJOR: + return "2133"; + case AR_RAD5122_SREV_MAJOR: + return "5122"; + case AR_RAD2122_SREV_MAJOR: + return "2122"; + } + return "????"; +} + /* * Poll the register looking for a specific value. */ Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Mon Feb 23 23:30:17 2009 (r188967) +++ head/sys/dev/ath/ath_hal/ah.h Mon Feb 23 23:41:12 2009 (r188968) @@ -789,6 +789,9 @@ extern const char *__ahdecl ath_hal_prob extern struct ath_hal * __ahdecl ath_hal_attach(uint16_t devid, HAL_SOFTC, HAL_BUS_TAG, HAL_BUS_HANDLE, HAL_STATUS* status); +extern const char *ath_hal_mac_name(struct ath_hal *); +extern const char *ath_hal_rf_name(struct ath_hal *); + /* * Regulatory interfaces. Drivers should use ath_hal_init_channels to * request a set of channels for a particular country code and/or Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Mon Feb 23 23:30:17 2009 (r188967) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Mon Feb 23 23:41:12 2009 (r188968) @@ -14,12 +14,12 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5416reg.h,v 1.10 2008/11/11 00:11:30 sam Exp $ + * $FreeBSD$ */ #ifndef _DEV_ATH_AR5416REG_H #define _DEV_ATH_AR5416REG_H -#include "ar5212/ar5212reg.h" +#include /* * Register added starting with the AR5416 Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Mon Feb 23 23:30:17 2009 (r188967) +++ head/sys/dev/ath/if_ath.c Mon Feb 23 23:41:12 2009 (r188968) @@ -7267,34 +7267,12 @@ bad: static void ath_announce(struct ath_softc *sc) { -#define HAL_MODE_DUALBAND (HAL_MODE_11A|HAL_MODE_11B) struct ifnet *ifp = sc->sc_ifp; struct ath_hal *ah = sc->sc_ah; - u_int modes; - if_printf(ifp, "mac %d.%d phy %d.%d", - ah->ah_macVersion, ah->ah_macRev, - ah->ah_phyRev >> 4, ah->ah_phyRev & 0xf); - /* - * Print radio revision(s). We check the wireless modes - * to avoid falsely printing revs for inoperable parts. - * Dual-band radio revs are returned in the 5Ghz rev number. - */ - modes = ath_hal_getwirelessmodes(ah); - if ((modes & HAL_MODE_DUALBAND) == HAL_MODE_DUALBAND) { - if (ah->ah_analog5GhzRev && ah->ah_analog2GhzRev) - printf(" 5ghz radio %d.%d 2ghz radio %d.%d", - ah->ah_analog5GhzRev >> 4, - ah->ah_analog5GhzRev & 0xf, - ah->ah_analog2GhzRev >> 4, - ah->ah_analog2GhzRev & 0xf); - else - printf(" radio %d.%d", ah->ah_analog5GhzRev >> 4, - ah->ah_analog5GhzRev & 0xf); - } else - printf(" radio %d.%d", ah->ah_analog5GhzRev >> 4, - ah->ah_analog5GhzRev & 0xf); - printf("\n"); + if_printf(ifp, "AR%s mac %d.%d RF%s phy %d.%d\n", + ath_hal_mac_name(ah), ah->ah_macVersion, ah->ah_macRev, + ath_hal_rf_name(ah), ah->ah_phyRev >> 4, ah->ah_phyRev & 0xf); if (bootverbose) { int i; for (i = 0; i <= WME_AC_VO; i++) { @@ -7310,7 +7288,6 @@ ath_announce(struct ath_softc *sc) if_printf(ifp, "using %u rx buffers\n", ath_rxbuf); if (ath_txbuf != ATH_TXBUF) if_printf(ifp, "using %u tx buffers\n", ath_txbuf); -#undef HAL_MODE_DUALBAND } #ifdef ATH_SUPPORT_TDMA From owner-svn-src-head@FreeBSD.ORG Mon Feb 23 23:46:56 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D02CD106568D; Mon, 23 Feb 2009 23:46:56 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BDFC28FC1F; Mon, 23 Feb 2009 23:46:56 +0000 (UTC) (envelope-from thompsa@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 n1NNkuYU043276; Mon, 23 Feb 2009 23:46:56 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1NNkuvp043272; Mon, 23 Feb 2009 23:46:56 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902232346.n1NNkuvp043272@svn.freebsd.org> From: Andrew Thompson Date: Mon, 23 Feb 2009 23:46:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188969 - head/sys/dev/usb/wlan X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2009 23:46:57 -0000 Author: thompsa Date: Mon Feb 23 23:46:56 2009 New Revision: 188969 URL: http://svn.freebsd.org/changeset/base/188969 Log: Make sure at least two tx slots are free before sending the mbuf since an additional frame may be sent for 80211 protection. Modified: head/sys/dev/usb/wlan/if_rum.c head/sys/dev/usb/wlan/if_rumvar.h head/sys/dev/usb/wlan/if_ural.c head/sys/dev/usb/wlan/if_uralvar.h Modified: head/sys/dev/usb/wlan/if_rum.c ============================================================================== --- head/sys/dev/usb/wlan/if_rum.c Mon Feb 23 23:41:12 2009 (r188968) +++ head/sys/dev/usb/wlan/if_rum.c Mon Feb 23 23:46:56 2009 (r188969) @@ -1167,10 +1167,6 @@ rum_tx_raw(struct rum_softc *sc, struct RUM_LOCK_ASSERT(sc, MA_OWNED); KASSERT(params != NULL, ("no raw xmit params")); - data = STAILQ_FIRST(&sc->tx_free); - STAILQ_REMOVE_HEAD(&sc->tx_free, next); - sc->tx_nfree--; - rate = params->ibp_rate0 & IEEE80211_RATE_VAL; /* XXX validate */ if (rate == 0) { @@ -1185,13 +1181,17 @@ rum_tx_raw(struct rum_softc *sc, struct params->ibp_flags & IEEE80211_BPF_RTS ? IEEE80211_PROT_RTSCTS : IEEE80211_PROT_CTSONLY, rate); - if (error) { + if (error || sc->tx_nfree == 0) { m_freem(m0); - return error; + return ENOBUFS; } flags |= RT2573_TX_LONG_RETRY | RT2573_TX_IFS_SIFS; } + data = STAILQ_FIRST(&sc->tx_free); + STAILQ_REMOVE_HEAD(&sc->tx_free, next); + sc->tx_nfree--; + data->m = m0; data->ni = ni; data->rate = rate; @@ -1254,9 +1254,9 @@ rum_tx_data(struct rum_softc *sc, struct prot = ic->ic_protmode; if (prot != IEEE80211_PROT_NONE) { error = rum_sendprot(sc, m0, ni, prot, rate); - if (error) { + if (error || sc->tx_nfree == 0) { m_freem(m0); - return error; + return ENOBUFS; } flags |= RT2573_TX_LONG_RETRY | RT2573_TX_IFS_SIFS; } @@ -1306,7 +1306,7 @@ rum_start(struct ifnet *ifp) IFQ_DRV_DEQUEUE(&ifp->if_snd, m); if (m == NULL) break; - if (sc->tx_nfree == 0) { + if (sc->tx_nfree < RUM_TX_MINFREE) { IFQ_DRV_PREPEND(&ifp->if_snd, m); ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; @@ -2149,7 +2149,7 @@ rum_raw_xmit(struct ieee80211_node *ni, ieee80211_free_node(ni); return ENETDOWN; } - if (sc->tx_nfree == 0) { + if (sc->tx_nfree < RUM_TX_MINFREE) { ifp->if_drv_flags |= IFF_DRV_OACTIVE; RUM_UNLOCK(sc); m_freem(m); Modified: head/sys/dev/usb/wlan/if_rumvar.h ============================================================================== --- head/sys/dev/usb/wlan/if_rumvar.h Mon Feb 23 23:41:12 2009 (r188968) +++ head/sys/dev/usb/wlan/if_rumvar.h Mon Feb 23 23:46:56 2009 (r188969) @@ -18,6 +18,7 @@ */ #define RUM_TX_LIST_COUNT 8 +#define RUM_TX_MINFREE 2 struct rum_rx_radiotap_header { struct ieee80211_radiotap_header wr_ihdr; Modified: head/sys/dev/usb/wlan/if_ural.c ============================================================================== --- head/sys/dev/usb/wlan/if_ural.c Mon Feb 23 23:41:12 2009 (r188968) +++ head/sys/dev/usb/wlan/if_ural.c Mon Feb 23 23:46:56 2009 (r188969) @@ -1243,10 +1243,6 @@ ural_tx_raw(struct ural_softc *sc, struc RAL_LOCK_ASSERT(sc, MA_OWNED); KASSERT(params != NULL, ("no raw xmit params")); - data = STAILQ_FIRST(&sc->tx_free); - STAILQ_REMOVE_HEAD(&sc->tx_free, next); - sc->tx_nfree--; - rate = params->ibp_rate0 & IEEE80211_RATE_VAL; /* XXX validate */ if (rate == 0) { @@ -1261,13 +1257,17 @@ ural_tx_raw(struct ural_softc *sc, struc params->ibp_flags & IEEE80211_BPF_RTS ? IEEE80211_PROT_RTSCTS : IEEE80211_PROT_CTSONLY, rate); - if (error) { + if (error || sc->tx_nfree == 0) { m_freem(m0); - return error; + return ENOBUFS; } flags |= RAL_TX_IFS_SIFS; } + data = STAILQ_FIRST(&sc->tx_free); + STAILQ_REMOVE_HEAD(&sc->tx_free, next); + sc->tx_nfree--; + data->m = m0; data->ni = ni; data->rate = rate; @@ -1328,9 +1328,9 @@ ural_tx_data(struct ural_softc *sc, stru prot = ic->ic_protmode; if (prot != IEEE80211_PROT_NONE) { error = ural_sendprot(sc, m0, ni, prot, rate); - if (error) { + if (error || sc->tx_nfree == 0) { m_freem(m0); - return error; + return ENOBUFS; } flags |= RAL_TX_IFS_SIFS; } @@ -1380,7 +1380,7 @@ ural_start(struct ifnet *ifp) IFQ_DRV_DEQUEUE(&ifp->if_snd, m); if (m == NULL) break; - if (sc->tx_nfree == 0) { + if (sc->tx_nfree < RAL_TX_MINFREE) { IFQ_DRV_PREPEND(&ifp->if_snd, m); ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; @@ -2235,7 +2235,7 @@ ural_raw_xmit(struct ieee80211_node *ni, ieee80211_free_node(ni); return ENETDOWN; } - if (sc->tx_nfree == 0) { + if (sc->tx_nfree < RAL_TX_MINFREE) { ifp->if_drv_flags |= IFF_DRV_OACTIVE; RAL_UNLOCK(sc); m_freem(m); Modified: head/sys/dev/usb/wlan/if_uralvar.h ============================================================================== --- head/sys/dev/usb/wlan/if_uralvar.h Mon Feb 23 23:41:12 2009 (r188968) +++ head/sys/dev/usb/wlan/if_uralvar.h Mon Feb 23 23:46:56 2009 (r188969) @@ -18,6 +18,7 @@ */ #define RAL_TX_LIST_COUNT 8 +#define RAL_TX_MINFREE 2 #define URAL_SCAN_START 1 #define URAL_SCAN_END 2 From owner-svn-src-head@FreeBSD.ORG Mon Feb 23 23:48:17 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE87C1065687; Mon, 23 Feb 2009 23:48:17 +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 A171D8FC13; Mon, 23 Feb 2009 23:48:17 +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 n1NNmHvv043354; Mon, 23 Feb 2009 23:48:17 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1NNmHKg043349; Mon, 23 Feb 2009 23:48:17 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902232348.n1NNmHKg043349@svn.freebsd.org> From: Sam Leffler Date: Mon, 23 Feb 2009 23:48:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188970 - in head/sys/dev/ath/ath_hal: . ar5210 ar5211 ar5212 ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2009 23:48:18 -0000 Author: sam Date: Mon Feb 23 23:48:17 2009 New Revision: 188970 URL: http://svn.freebsd.org/changeset/base/188970 Log: remove private copies of gpio methods that were needed when the hal was an independent entity Modified: head/sys/dev/ath/ath_hal/ah_internal.h head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Modified: head/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_internal.h Mon Feb 23 23:46:56 2009 (r188969) +++ head/sys/dev/ath/ath_hal/ah_internal.h Mon Feb 23 23:48:17 2009 (r188970) @@ -242,12 +242,6 @@ struct ath_hal_private { uint16_t *data); HAL_BOOL (*ah_eepromWrite)(struct ath_hal *, u_int off, uint16_t data); - HAL_BOOL (*ah_gpioCfgOutput)(struct ath_hal *, uint32_t gpio); - HAL_BOOL (*ah_gpioCfgInput)(struct ath_hal *, uint32_t gpio); - uint32_t (*ah_gpioGet)(struct ath_hal *, uint32_t gpio); - HAL_BOOL (*ah_gpioSet)(struct ath_hal *, - uint32_t gpio, uint32_t val); - void (*ah_gpioSetIntr)(struct ath_hal*, u_int, uint32_t); HAL_BOOL (*ah_getChipPowerLimits)(struct ath_hal *, struct ieee80211_channel *); int16_t (*ah_getNfAdjust)(struct ath_hal *, @@ -318,15 +312,15 @@ struct ath_hal_private { #define ath_hal_eepromWrite(_ah, _off, _data) \ AH_PRIVATE(_ah)->ah_eepromWrite(_ah, _off, _data) #define ath_hal_gpioCfgOutput(_ah, _gpio) \ - AH_PRIVATE(_ah)->ah_gpioCfgOutput(_ah, _gpio) + (_ah)->ah_gpioCfgOutput(_ah, _gpio) #define ath_hal_gpioCfgInput(_ah, _gpio) \ - AH_PRIVATE(_ah)->ah_gpioCfgInput(_ah, _gpio) + (_ah)->ah_gpioCfgInput(_ah, _gpio) #define ath_hal_gpioGet(_ah, _gpio) \ - AH_PRIVATE(_ah)->ah_gpioGet(_ah, _gpio) + (_ah)->ah_gpioGet(_ah, _gpio) #define ath_hal_gpioSet(_ah, _gpio, _val) \ - AH_PRIVATE(_ah)->ah_gpioGet(_ah, _gpio, _val) + (_ah)->ah_gpioSet(_ah, _gpio, _val) #define ath_hal_gpioSetIntr(_ah, _gpio, _ilevel) \ - AH_PRIVATE(_ah)->ah_gpioSetIntr(_ah, _gpio, _ilevel) + (_ah)->ah_gpioSetIntr(_ah, _gpio, _ilevel) #define ath_hal_getpowerlimits(_ah, _chan) \ AH_PRIVATE(_ah)->ah_getChipPowerLimits(_ah, _chan) #define ath_hal_getNfAdjust(_ah, _c) \ Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c Mon Feb 23 23:46:56 2009 (r188969) +++ head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c Mon Feb 23 23:48:17 2009 (r188970) @@ -155,11 +155,6 @@ static const struct ath_hal_private ar52 #ifdef AH_SUPPORT_WRITE_EEPROM .ah_eepromWrite = ar5210EepromWrite, #endif - .ah_gpioCfgInput = ar5210GpioCfgInput, - .ah_gpioCfgOutput = ar5210GpioCfgOutput, - .ah_gpioGet = ar5210GpioGet, - .ah_gpioSet = ar5210GpioSet, - .ah_gpioSetIntr = ar5210Gpio0SetIntr, .ah_getChipPowerLimits = ar5210GetChipPowerLimits, }; Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c Mon Feb 23 23:46:56 2009 (r188969) +++ head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c Mon Feb 23 23:48:17 2009 (r188970) @@ -155,11 +155,6 @@ static const struct ath_hal_private ar52 #ifdef AH_SUPPORT_WRITE_EEPROM .ah_eepromWrite = ar5211EepromWrite, #endif - .ah_gpioCfgInput = ar5211GpioCfgInput, - .ah_gpioCfgOutput = ar5211GpioCfgOutput, - .ah_gpioGet = ar5211GpioGet, - .ah_gpioSet = ar5211GpioSet, - .ah_gpioSetIntr = ar5211GpioSetIntr, .ah_getChipPowerLimits = ar5211GetChipPowerLimits, }; Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Mon Feb 23 23:46:56 2009 (r188969) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Mon Feb 23 23:48:17 2009 (r188970) @@ -151,11 +151,6 @@ static const struct ath_hal_private ar52 #ifdef AH_SUPPORT_WRITE_EEPROM .ah_eepromWrite = ar5212EepromWrite, #endif - .ah_gpioCfgOutput = ar5212GpioCfgOutput, - .ah_gpioCfgInput = ar5212GpioCfgInput, - .ah_gpioGet = ar5212GpioGet, - .ah_gpioSet = ar5212GpioSet, - .ah_gpioSetIntr = ar5212GpioSetIntr, .ah_getChipPowerLimits = ar5212GetChipPowerLimits, }; Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Mon Feb 23 23:46:56 2009 (r188969) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Mon Feb 23 23:48:17 2009 (r188970) @@ -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: ar5416_attach.c,v 1.27 2008/11/27 22:30:07 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" @@ -147,11 +147,6 @@ ar5416InitState(struct ath_hal_5416 *ahp #ifdef AH_SUPPORT_WRITE_EEPROM ahp->ah_priv.ah_eepromWrite = ar5416EepromWrite; #endif - ahp->ah_priv.ah_gpioCfgOutput = ar5416GpioCfgOutput; - ahp->ah_priv.ah_gpioCfgInput = ar5416GpioCfgInput; - ahp->ah_priv.ah_gpioGet = ar5416GpioGet; - ahp->ah_priv.ah_gpioSet = ar5416GpioSet; - ahp->ah_priv.ah_gpioSetIntr = ar5416GpioSetIntr; ahp->ah_priv.ah_getChipPowerLimits = ar5416GetChipPowerLimits; /* From owner-svn-src-head@FreeBSD.ORG Mon Feb 23 23:54:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B1A04106566B; Mon, 23 Feb 2009 23:54:08 +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 84D8F8FC17; Mon, 23 Feb 2009 23:54:08 +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 n1NNs82N043512; Mon, 23 Feb 2009 23:54:08 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1NNs88D043509; Mon, 23 Feb 2009 23:54:08 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902232354.n1NNs88D043509@svn.freebsd.org> From: Sam Leffler Date: Mon, 23 Feb 2009 23:54:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188971 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2009 23:54:09 -0000 Author: sam Date: Mon Feb 23 23:54:08 2009 New Revision: 188971 URL: http://svn.freebsd.org/changeset/base/188971 Log: 5416 and later parts get the radio rev differently; add ar5416GetRadioRev to do it the right way Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c head/sys/dev/ath/ath_hal/ar5416/ar9160_attach.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416.h Mon Feb 23 23:48:17 2009 (r188970) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416.h Mon Feb 23 23:54:08 2009 (r188971) @@ -85,6 +85,7 @@ struct ath_hal; extern struct ath_hal * ar5416Attach(uint16_t devid, HAL_SOFTC sc, HAL_BUS_TAG st, HAL_BUS_HANDLE sh, HAL_STATUS *status); +extern uint32_t ar5416GetRadioRev(struct ath_hal *ah); extern void ar5416InitState(struct ath_hal_5416 *, uint16_t devid, HAL_SOFTC sc, HAL_BUS_TAG st, HAL_BUS_HANDLE sh, HAL_STATUS *status); Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Mon Feb 23 23:48:17 2009 (r188970) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Mon Feb 23 23:54:08 2009 (r188971) @@ -156,6 +156,21 @@ ar5416InitState(struct ath_hal_5416 *ahp AH5416(ah)->ah_tx_chainmask = AR5416_DEFAULT_TXCHAINMASK; } +uint32_t +ar5416GetRadioRev(struct ath_hal *ah) +{ + uint32_t val; + int i; + + /* Read Radio Chip Rev Extract */ + OS_REG_WRITE(ah, AR_PHY(0x36), 0x00007058); + for (i = 0; i < 8; i++) + OS_REG_WRITE(ah, AR_PHY(0x20), 0x00010000); + val = (OS_REG_READ(ah, AR_PHY(256)) >> 24) & 0xff; + val = ((val & 0xf0) >> 4) | ((val & 0x0f) << 4); + return ath_hal_reverseBits(val, 8); +} + /* * Attach for an AR5416 part. */ Modified: head/sys/dev/ath/ath_hal/ar5416/ar9160_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar9160_attach.c Mon Feb 23 23:48:17 2009 (r188970) +++ head/sys/dev/ath/ath_hal/ar5416/ar9160_attach.c Mon Feb 23 23:54:08 2009 (r188971) @@ -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: ar9160_attach.c,v 1.14 2008/11/27 22:30:08 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" @@ -190,7 +190,7 @@ ar9160Attach(uint16_t devid, HAL_SOFTC s OS_REG_WRITE(ah, AR_PHY(0), 0x00000007); /* Read Radio Chip Rev Extract */ - AH_PRIVATE(ah)->ah_analog5GhzRev = ar5212GetRadioRev(ah); + AH_PRIVATE(ah)->ah_analog5GhzRev = ar5416GetRadioRev(ah); switch (AH_PRIVATE(ah)->ah_analog5GhzRev & AR_RADIO_SREV_MAJOR) { case AR_RAD2133_SREV_MAJOR: /* Sowl: 2G/3x3 */ case AR_RAD5133_SREV_MAJOR: /* Sowl: 2+5G/3x3 */ From owner-svn-src-head@FreeBSD.ORG Mon Feb 23 23:58:38 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C07F106564A; Mon, 23 Feb 2009 23:58:38 +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 E23E68FC0C; Mon, 23 Feb 2009 23:58:37 +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 n1NNwbDM043638; Mon, 23 Feb 2009 23:58:37 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1NNwb2m043633; Mon, 23 Feb 2009 23:58:37 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902232358.n1NNwb2m043633@svn.freebsd.org> From: Sam Leffler Date: Mon, 23 Feb 2009 23:58:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188972 - in head/sys/dev/ath/ath_hal: ar5211 ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2009 23:58:38 -0000 Author: sam Date: Mon Feb 23 23:58:37 2009 New Revision: 188972 URL: http://svn.freebsd.org/changeset/base/188972 Log: attach methods don't need to be public, make 'em static Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211.h head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c head/sys/dev/ath/ath_hal/ar5416/ar5416.h head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c head/sys/dev/ath/ath_hal/ar5416/ar9160_attach.c Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5211/ar5211.h Mon Feb 23 23:54:08 2009 (r188971) +++ head/sys/dev/ath/ath_hal/ar5211/ar5211.h Mon Feb 23 23:58:37 2009 (r188972) @@ -144,8 +144,6 @@ struct ath_hal_5211 { struct ath_hal; -extern struct ath_hal *ar5211Attach(uint16_t, HAL_SOFTC, - HAL_BUS_TAG, HAL_BUS_HANDLE, HAL_STATUS *); extern void ar5211Detach(struct ath_hal *); extern HAL_BOOL ar5211Reset(struct ath_hal *, HAL_OPMODE, Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c Mon Feb 23 23:54:08 2009 (r188971) +++ head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c Mon Feb 23 23:58:37 2009 (r188972) @@ -182,7 +182,7 @@ ar5211GetRadioRev(struct ath_hal *ah) /* * Attach for an AR5211 part. */ -struct ath_hal * +static struct ath_hal * ar5211Attach(uint16_t devid, HAL_SOFTC sc, HAL_BUS_TAG st, HAL_BUS_HANDLE sh, HAL_STATUS *status) { Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416.h Mon Feb 23 23:54:08 2009 (r188971) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416.h Mon Feb 23 23:58:37 2009 (r188972) @@ -83,8 +83,6 @@ extern HAL_BOOL ar2133RfAttach(struct at struct ath_hal; -extern struct ath_hal * ar5416Attach(uint16_t devid, HAL_SOFTC sc, - HAL_BUS_TAG st, HAL_BUS_HANDLE sh, HAL_STATUS *status); extern uint32_t ar5416GetRadioRev(struct ath_hal *ah); extern void ar5416InitState(struct ath_hal_5416 *, uint16_t devid, HAL_SOFTC sc, HAL_BUS_TAG st, HAL_BUS_HANDLE sh, Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Mon Feb 23 23:54:08 2009 (r188971) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Mon Feb 23 23:58:37 2009 (r188972) @@ -174,7 +174,7 @@ ar5416GetRadioRev(struct ath_hal *ah) /* * Attach for an AR5416 part. */ -struct ath_hal * +static struct ath_hal * ar5416Attach(uint16_t devid, HAL_SOFTC sc, HAL_BUS_TAG st, HAL_BUS_HANDLE sh, HAL_STATUS *status) { Modified: head/sys/dev/ath/ath_hal/ar5416/ar9160_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar9160_attach.c Mon Feb 23 23:54:08 2009 (r188971) +++ head/sys/dev/ath/ath_hal/ar5416/ar9160_attach.c Mon Feb 23 23:58:37 2009 (r188972) @@ -57,8 +57,6 @@ static const HAL_PERCAL_DATA ar9160_adc_ .calPostProc = ar5416AdcDcCalibration }; -struct ath_hal *ar9160Attach(uint16_t devid, HAL_SOFTC sc, - HAL_BUS_TAG st, HAL_BUS_HANDLE sh, HAL_STATUS *status); static void ar9160Detach(struct ath_hal *); static HAL_BOOL ar9160FillCapabilityInfo(struct ath_hal *ah); @@ -90,7 +88,7 @@ ar9160AniSetup(struct ath_hal *ah) /* * Attach for an AR9160 part. */ -struct ath_hal * +static struct ath_hal * ar9160Attach(uint16_t devid, HAL_SOFTC sc, HAL_BUS_TAG st, HAL_BUS_HANDLE sh, HAL_STATUS *status) { From owner-svn-src-head@FreeBSD.ORG Tue Feb 24 00:03:15 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A8F5106564A; Tue, 24 Feb 2009 00:03:15 +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 1892D8FC27; Tue, 24 Feb 2009 00:03:15 +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 n1O03E5r043778; Tue, 24 Feb 2009 00:03:14 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1O03ETf043776; Tue, 24 Feb 2009 00:03:14 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902240003.n1O03ETf043776@svn.freebsd.org> From: Sam Leffler Date: Tue, 24 Feb 2009 00:03:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188973 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Feb 2009 00:03:15 -0000 Author: sam Date: Tue Feb 24 00:03:14 2009 New Revision: 188973 URL: http://svn.freebsd.org/changeset/base/188973 Log: move eeprom attach above first reset as the reset code checks the eeprom contents for 9280 and later parts Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c head/sys/dev/ath/ath_hal/ar5416/ar9160_attach.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Mon Feb 23 23:58:37 2009 (r188972) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Tue Feb 24 00:03:14 2009 (r188973) @@ -244,6 +244,10 @@ ar5416Attach(uint16_t devid, HAL_SOFTC s HAL_INI_VAL((struct ini *)&AH5416(ah)->ah_ini_addac, 31, 1) = 0; } + ecode = ath_hal_v14EepromAttach(ah); + if (ecode != HAL_OK) + goto bad; + if (!ar5416ChipReset(ah, AH_NULL)) { /* reset chip */ HALDEBUG(ah, HAL_DEBUG_ANY, "%s: chip reset failed\n", __func__); @@ -297,10 +301,6 @@ ar5416Attach(uint16_t devid, HAL_SOFTC s #endif } - ecode = ath_hal_v14EepromAttach(ah); - if (ecode != HAL_OK) - goto bad; - /* * Got everything we need now to setup the capabilities. */ Modified: head/sys/dev/ath/ath_hal/ar5416/ar9160_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar9160_attach.c Mon Feb 23 23:58:37 2009 (r188972) +++ head/sys/dev/ath/ath_hal/ar5416/ar9160_attach.c Tue Feb 24 00:03:14 2009 (r188973) @@ -166,6 +166,10 @@ ar9160Attach(uint16_t devid, HAL_SOFTC s else HAL_INI_INIT(&AH5416(ah)->ah_ini_addac, ar9160Addac, 2); + ecode = ath_hal_v14EepromAttach(ah); + if (ecode != HAL_OK) + goto bad; + if (!ar5416ChipReset(ah, AH_NULL)) { /* reset chip */ HALDEBUG(ah, HAL_DEBUG_ANY, "%s: chip reset failed\n", __func__); ecode = HAL_EIO; @@ -217,10 +221,6 @@ ar9160Attach(uint16_t devid, HAL_SOFTC s goto bad; } - ecode = ath_hal_v14EepromAttach(ah); - if (ecode != HAL_OK) - goto bad; - /* * Got everything we need now to setup the capabilities. */ From owner-svn-src-head@FreeBSD.ORG Tue Feb 24 00:12:17 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F33211065677; Tue, 24 Feb 2009 00:12:16 +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 DE3858FC08; Tue, 24 Feb 2009 00:12:16 +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 n1O0CG7t044001; Tue, 24 Feb 2009 00:12:16 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1O0CGWd043986; Tue, 24 Feb 2009 00:12:16 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902240012.n1O0CGWd043986@svn.freebsd.org> From: Sam Leffler Date: Tue, 24 Feb 2009 00:12:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188974 - in head/sys/dev/ath: . ath_hal ath_hal/ar5210 ath_hal/ar5211 ath_hal/ar5212 ath_hal/ar5312 ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Feb 2009 00:12:17 -0000 Author: sam Date: Tue Feb 24 00:12:16 2009 New Revision: 188974 URL: http://svn.freebsd.org/changeset/base/188974 Log: 5416 and later parts mux the gpio outputs; extend the api to include a signal type that's used to select the appropriate mux Modified: head/sys/dev/ath/ath_hal/ah.h head/sys/dev/ath/ath_hal/ah_internal.h head/sys/dev/ath/ath_hal/ar5210/ar5210.h head/sys/dev/ath/ath_hal/ar5210/ar5210_misc.c head/sys/dev/ath/ath_hal/ar5211/ar5211.h head/sys/dev/ath/ath_hal/ar5211/ar5211_misc.c head/sys/dev/ath/ath_hal/ar5212/ar5212.h head/sys/dev/ath/ath_hal/ar5212/ar5212_gpio.c head/sys/dev/ath/ath_hal/ar5312/ar5312.h head/sys/dev/ath/ath_hal/ar5312/ar5312_gpio.c head/sys/dev/ath/ath_hal/ar5312/ar5315_gpio.c head/sys/dev/ath/ath_hal/ar5416/ar5416.h head/sys/dev/ath/ath_hal/ar5416/ar5416_gpio.c head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Tue Feb 24 00:03:14 2009 (r188973) +++ head/sys/dev/ath/ath_hal/ah.h Tue Feb 24 00:12:16 2009 (r188974) @@ -359,6 +359,22 @@ typedef enum { } HAL_INT; typedef enum { + HAL_GPIO_MUX_OUTPUT = 0, + HAL_GPIO_MUX_PCIE_ATTENTION_LED = 1, + HAL_GPIO_MUX_PCIE_POWER_LED = 2, + HAL_GPIO_MUX_TX_FRAME = 3, + HAL_GPIO_MUX_RX_CLEAR_EXTERNAL = 4, + HAL_GPIO_MUX_MAC_NETWORK_LED = 5, + HAL_GPIO_MUX_MAC_POWER_LED = 6 +} HAL_GPIO_MUX_TYPE; + +typedef enum { + HAL_GPIO_INTR_LOW = 0, + HAL_GPIO_INTR_HIGH = 1, + HAL_GPIO_INTR_DISABLE = 2 +} HAL_GPIO_INTR_TYPE; + +typedef enum { HAL_RFGAIN_INACTIVE = 0, HAL_RFGAIN_READ_REQUESTED = 1, HAL_RFGAIN_NEED_CHANGE = 2 @@ -700,7 +716,8 @@ struct ath_hal { void __ahdecl(*ah_setLedState)(struct ath_hal*, HAL_LED_STATE); void __ahdecl(*ah_writeAssocid)(struct ath_hal*, const uint8_t *bssid, uint16_t assocId); - HAL_BOOL __ahdecl(*ah_gpioCfgOutput)(struct ath_hal *, uint32_t gpio); + HAL_BOOL __ahdecl(*ah_gpioCfgOutput)(struct ath_hal *, + uint32_t gpio, HAL_GPIO_MUX_TYPE); HAL_BOOL __ahdecl(*ah_gpioCfgInput)(struct ath_hal *, uint32_t gpio); uint32_t __ahdecl(*ah_gpioGet)(struct ath_hal *, uint32_t gpio); HAL_BOOL __ahdecl(*ah_gpioSet)(struct ath_hal *, Modified: head/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_internal.h Tue Feb 24 00:03:14 2009 (r188973) +++ head/sys/dev/ath/ath_hal/ah_internal.h Tue Feb 24 00:12:16 2009 (r188974) @@ -311,8 +311,8 @@ struct ath_hal_private { AH_PRIVATE(_ah)->ah_eepromRead(_ah, _off, _data) #define ath_hal_eepromWrite(_ah, _off, _data) \ AH_PRIVATE(_ah)->ah_eepromWrite(_ah, _off, _data) -#define ath_hal_gpioCfgOutput(_ah, _gpio) \ - (_ah)->ah_gpioCfgOutput(_ah, _gpio) +#define ath_hal_gpioCfgOutput(_ah, _gpio, _type) \ + (_ah)->ah_gpioCfgOutput(_ah, _gpio, _type) #define ath_hal_gpioCfgInput(_ah, _gpio) \ (_ah)->ah_gpioCfgInput(_ah, _gpio) #define ath_hal_gpioGet(_ah, _gpio) \ Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5210/ar5210.h Tue Feb 24 00:03:14 2009 (r188973) +++ head/sys/dev/ath/ath_hal/ar5210/ar5210.h Tue Feb 24 00:12:16 2009 (r188974) @@ -207,7 +207,8 @@ extern HAL_BOOL ar5210SetRegulatoryDomai extern u_int ar5210GetWirelessModes(struct ath_hal *ah); extern void ar5210EnableRfKill(struct ath_hal *); extern HAL_BOOL ar5210GpioCfgInput(struct ath_hal *, uint32_t gpio); -extern HAL_BOOL ar5210GpioCfgOutput(struct ath_hal *, uint32_t gpio); +extern HAL_BOOL ar5210GpioCfgOutput(struct ath_hal *, uint32_t gpio, + HAL_GPIO_MUX_TYPE); extern uint32_t ar5210GpioGet(struct ath_hal *, uint32_t gpio); extern HAL_BOOL ar5210GpioSet(struct ath_hal *, uint32_t gpio, uint32_t); extern void ar5210Gpio0SetIntr(struct ath_hal *, u_int, uint32_t ilevel); Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_misc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5210/ar5210_misc.c Tue Feb 24 00:03:14 2009 (r188973) +++ head/sys/dev/ath/ath_hal/ar5210/ar5210_misc.c Tue Feb 24 00:12:16 2009 (r188974) @@ -158,7 +158,7 @@ ar5210EnableRfKill(struct ath_hal *ah) * Configure GPIO Output lines */ HAL_BOOL -ar5210GpioCfgOutput(struct ath_hal *ah, uint32_t gpio) +ar5210GpioCfgOutput(struct ath_hal *ah, uint32_t gpio, HAL_GPIO_MUX_TYPE type) { HALASSERT(gpio < AR_NUM_GPIO); Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5211/ar5211.h Tue Feb 24 00:03:14 2009 (r188973) +++ head/sys/dev/ath/ath_hal/ar5211/ar5211.h Tue Feb 24 00:12:16 2009 (r188974) @@ -233,7 +233,8 @@ extern u_int ar5211GetWirelessModes(stru extern void ar5211EnableRfKill(struct ath_hal *); extern uint32_t ar5211GpioGet(struct ath_hal *, uint32_t gpio); extern void ar5211GpioSetIntr(struct ath_hal *, u_int, uint32_t ilevel); -extern HAL_BOOL ar5211GpioCfgOutput(struct ath_hal *, uint32_t gpio); +extern HAL_BOOL ar5211GpioCfgOutput(struct ath_hal *, uint32_t gpio, + HAL_GPIO_MUX_TYPE); extern HAL_BOOL ar5211GpioCfgInput(struct ath_hal *, uint32_t gpio); extern HAL_BOOL ar5211GpioSet(struct ath_hal *, uint32_t gpio, uint32_t val); extern void ar5211SetLedState(struct ath_hal *, HAL_LED_STATE); Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211_misc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5211/ar5211_misc.c Tue Feb 24 00:03:14 2009 (r188973) +++ head/sys/dev/ath/ath_hal/ar5211/ar5211_misc.c Tue Feb 24 00:12:16 2009 (r188974) @@ -192,7 +192,7 @@ ar5211EnableRfKill(struct ath_hal *ah) * Configure GPIO Output lines */ HAL_BOOL -ar5211GpioCfgOutput(struct ath_hal *ah, uint32_t gpio) +ar5211GpioCfgOutput(struct ath_hal *ah, uint32_t gpio, HAL_GPIO_MUX_TYPE type) { uint32_t reg; Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212.h Tue Feb 24 00:03:14 2009 (r188973) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212.h Tue Feb 24 00:12:16 2009 (r188974) @@ -450,7 +450,8 @@ extern HAL_BOOL ar5212SetRegulatoryDomai uint16_t regDomain, HAL_STATUS *stats); extern u_int ar5212GetWirelessModes(struct ath_hal *ah); extern void ar5212EnableRfKill(struct ath_hal *); -extern HAL_BOOL ar5212GpioCfgOutput(struct ath_hal *, uint32_t gpio); +extern HAL_BOOL ar5212GpioCfgOutput(struct ath_hal *, uint32_t gpio, + HAL_GPIO_MUX_TYPE); extern HAL_BOOL ar5212GpioCfgInput(struct ath_hal *, uint32_t gpio); extern HAL_BOOL ar5212GpioSet(struct ath_hal *, uint32_t gpio, uint32_t val); extern uint32_t ar5212GpioGet(struct ath_hal *ah, uint32_t gpio); Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_gpio.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_gpio.c Tue Feb 24 00:03:14 2009 (r188973) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_gpio.c Tue Feb 24 00:12:16 2009 (r188974) @@ -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_gpio.c,v 1.3 2008/11/10 04:08:03 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" @@ -36,7 +36,7 @@ * Configure GPIO Output lines */ HAL_BOOL -ar5212GpioCfgOutput(struct ath_hal *ah, uint32_t gpio) +ar5212GpioCfgOutput(struct ath_hal *ah, uint32_t gpio, HAL_GPIO_MUX_TYPE type) { HALASSERT(gpio < AR_NUM_GPIO); Modified: head/sys/dev/ath/ath_hal/ar5312/ar5312.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5312/ar5312.h Tue Feb 24 00:03:14 2009 (r188973) +++ head/sys/dev/ath/ath_hal/ar5312/ar5312.h Tue Feb 24 00:12:16 2009 (r188974) @@ -41,14 +41,16 @@ extern HAL_BOOL ar5312IsInterruptPending(struct ath_hal *ah); /* AR5312 */ -extern HAL_BOOL ar5312GpioCfgOutput(struct ath_hal *, uint32_t gpio); +extern HAL_BOOL ar5312GpioCfgOutput(struct ath_hal *, uint32_t gpio, + HAL_GPIO_MUX_TYPE); extern HAL_BOOL ar5312GpioCfgInput(struct ath_hal *, uint32_t gpio); extern HAL_BOOL ar5312GpioSet(struct ath_hal *, uint32_t gpio, uint32_t val); extern uint32_t ar5312GpioGet(struct ath_hal *ah, uint32_t gpio); extern void ar5312GpioSetIntr(struct ath_hal *ah, u_int, uint32_t ilevel); /* AR2315+ */ -extern HAL_BOOL ar5315GpioCfgOutput(struct ath_hal *, uint32_t gpio); +extern HAL_BOOL ar5315GpioCfgOutput(struct ath_hal *, uint32_t gpio, + HAL_GPIO_MUX_TYPE); extern HAL_BOOL ar5315GpioCfgInput(struct ath_hal *, uint32_t gpio); extern HAL_BOOL ar5315GpioSet(struct ath_hal *, uint32_t gpio, uint32_t val); extern uint32_t ar5315GpioGet(struct ath_hal *ah, uint32_t gpio); Modified: head/sys/dev/ath/ath_hal/ar5312/ar5312_gpio.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5312/ar5312_gpio.c Tue Feb 24 00:03:14 2009 (r188973) +++ head/sys/dev/ath/ath_hal/ar5312/ar5312_gpio.c Tue Feb 24 00:12:16 2009 (r188974) @@ -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: ar5312_gpio.c,v 1.3 2008/11/10 04:08:04 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" @@ -35,7 +35,7 @@ * Configure GPIO Output lines */ HAL_BOOL -ar5312GpioCfgOutput(struct ath_hal *ah, uint32_t gpio) +ar5312GpioCfgOutput(struct ath_hal *ah, uint32_t gpio, HAL_GPIO_MUX_TYPE type) { uint32_t gpioOffset = (AR5312_GPIO_BASE - ((uint32_t) ah->ah_sh)); Modified: head/sys/dev/ath/ath_hal/ar5312/ar5315_gpio.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5312/ar5315_gpio.c Tue Feb 24 00:03:14 2009 (r188973) +++ head/sys/dev/ath/ath_hal/ar5312/ar5315_gpio.c Tue Feb 24 00:12:16 2009 (r188974) @@ -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: ar5315_gpio.c,v 1.3 2008/11/10 04:08:04 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" @@ -35,7 +35,7 @@ * Configure GPIO Output lines */ HAL_BOOL -ar5315GpioCfgOutput(struct ath_hal *ah, uint32_t gpio) +ar5315GpioCfgOutput(struct ath_hal *ah, uint32_t gpio, HAL_GPIO_MUX_TYPE type) { uint32_t gpioOffset = (AR5315_GPIO_BASE - ((uint32_t) ah->ah_sh)); Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416.h Tue Feb 24 00:03:14 2009 (r188973) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416.h Tue Feb 24 00:12:16 2009 (r188974) @@ -120,7 +120,8 @@ extern HAL_BOOL ar5416IsInterruptPending extern HAL_BOOL ar5416GetPendingInterrupts(struct ath_hal *, HAL_INT *masked); extern HAL_INT ar5416SetInterrupts(struct ath_hal *ah, HAL_INT ints); -extern HAL_BOOL ar5416GpioCfgOutput(struct ath_hal *, uint32_t gpio); +extern HAL_BOOL ar5416GpioCfgOutput(struct ath_hal *, uint32_t gpio, + HAL_GPIO_MUX_TYPE); extern HAL_BOOL ar5416GpioCfgInput(struct ath_hal *, uint32_t gpio); extern HAL_BOOL ar5416GpioSet(struct ath_hal *, uint32_t gpio, uint32_t val); extern uint32_t ar5416GpioGet(struct ath_hal *ah, uint32_t gpio); Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_gpio.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_gpio.c Tue Feb 24 00:03:14 2009 (r188973) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_gpio.c Tue Feb 24 00:12:16 2009 (r188974) @@ -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: ar5416_gpio.c,v 1.3 2008/11/10 04:08:04 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" @@ -36,7 +36,7 @@ * Configure GPIO Output lines */ HAL_BOOL -ar5416GpioCfgOutput(struct ath_hal *ah, uint32_t gpio) +ar5416GpioCfgOutput(struct ath_hal *ah, uint32_t gpio, HAL_GPIO_MUX_TYPE type) { HALASSERT(gpio < AR_NUM_GPIO); OS_REG_CLR_BIT(ah, AR_GPIO_INTR_OUT, AR_GPIO_BIT(gpio)); Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Tue Feb 24 00:03:14 2009 (r188973) +++ head/sys/dev/ath/if_ath.c Tue Feb 24 00:12:16 2009 (r188974) @@ -559,7 +559,8 @@ ath_attach(u_int16_t devid, struct ath_s */ sc->sc_softled = (devid == AR5212_DEVID_IBM || devid == AR5211_DEVID); if (sc->sc_softled) { - ath_hal_gpioCfgOutput(ah, sc->sc_ledpin); + ath_hal_gpioCfgOutput(ah, sc->sc_ledpin, + HAL_GPIO_MUX_MAC_NETWORK_LED); ath_hal_gpioset(ah, sc->sc_ledpin, !sc->sc_ledon); } @@ -1218,7 +1219,8 @@ ath_resume(struct ath_softc *sc) ieee80211_resume_all(ic); } if (sc->sc_softled) { - ath_hal_gpioCfgOutput(ah, sc->sc_ledpin); + ath_hal_gpioCfgOutput(ah, sc->sc_ledpin, + HAL_GPIO_MUX_MAC_NETWORK_LED); ath_hal_gpioset(ah, sc->sc_ledpin, !sc->sc_ledon); } } @@ -6653,7 +6655,8 @@ ath_sysctl_softled(SYSCTL_HANDLER_ARGS) if (softled != sc->sc_softled) { if (softled) { /* NB: handle any sc_ledpin change */ - ath_hal_gpioCfgOutput(sc->sc_ah, sc->sc_ledpin); + ath_hal_gpioCfgOutput(sc->sc_ah, sc->sc_ledpin, + HAL_GPIO_MUX_MAC_NETWORK_LED); ath_hal_gpioset(sc->sc_ah, sc->sc_ledpin, !sc->sc_ledon); } @@ -6675,7 +6678,8 @@ ath_sysctl_ledpin(SYSCTL_HANDLER_ARGS) if (ledpin != sc->sc_ledpin) { sc->sc_ledpin = ledpin; if (sc->sc_softled) { - ath_hal_gpioCfgOutput(sc->sc_ah, sc->sc_ledpin); + ath_hal_gpioCfgOutput(sc->sc_ah, sc->sc_ledpin, + HAL_GPIO_MUX_MAC_NETWORK_LED); ath_hal_gpioset(sc->sc_ah, sc->sc_ledpin, !sc->sc_ledon); } Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Tue Feb 24 00:03:14 2009 (r188973) +++ head/sys/dev/ath/if_athvar.h Tue Feb 24 00:12:16 2009 (r188974) @@ -700,8 +700,8 @@ void ath_intr(void *); #define ath_hal_gettxintrtxqs(_ah, _txqs) \ ((*(_ah)->ah_getTxIntrQueue)((_ah), (_txqs))) -#define ath_hal_gpioCfgOutput(_ah, _gpio) \ - ((*(_ah)->ah_gpioCfgOutput)((_ah), (_gpio))) +#define ath_hal_gpioCfgOutput(_ah, _gpio, _type) \ + ((*(_ah)->ah_gpioCfgOutput)((_ah), (_gpio), (_type))) #define ath_hal_gpioset(_ah, _gpio, _b) \ ((*(_ah)->ah_gpioSet)((_ah), (_gpio), (_b))) #define ath_hal_gpioget(_ah, _gpio) \ From owner-svn-src-head@FreeBSD.ORG Tue Feb 24 00:29:32 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83EEC1065687; Tue, 24 Feb 2009 00:29:32 +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 5717F8FC1B; Tue, 24 Feb 2009 00:29:32 +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 n1O0TWUo044320; Tue, 24 Feb 2009 00:29:32 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1O0TWTw044319; Tue, 24 Feb 2009 00:29:32 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902240029.n1O0TWTw044319@svn.freebsd.org> From: Sam Leffler Date: Tue, 24 Feb 2009 00:29:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188975 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Feb 2009 00:29:33 -0000 Author: sam Date: Tue Feb 24 00:29:32 2009 New Revision: 188975 URL: http://svn.freebsd.org/changeset/base/188975 Log: misc fixups, mostly for code not compiled yet Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Tue Feb 24 00:12:16 2009 (r188974) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Tue Feb 24 00:29:32 2009 (r188975) @@ -763,19 +763,19 @@ ar5416SetDeltaSlope(struct ath_hal *ah, { #define INIT_CLOCKMHZSCALED 0x64000000 uint32_t coef_scaled, ds_coef_exp, ds_coef_man; - uint32_t clockMhzScaled = INIT_CLOCKMHZSCALED; + uint32_t clockMhzScaled; CHAN_CENTERS centers; - if (IEEE80211_IS_CHAN_TURBO(chan)) - clockMhzScaled *= 2; /* half and quarter rate can divide the scaled clock by 2 or 4 respectively */ /* scale for selected channel bandwidth */ - if (IEEE80211_IS_CHAN_HALF(chan)) { - clockMhzScaled = clockMhzScaled >> 1; - } else if (IEEE80211_IS_CHAN_QUARTER(chan)) { - clockMhzScaled = clockMhzScaled >> 2; - } + clockMhzScaled = INIT_CLOCKMHZSCALED; + if (IEEE80211_IS_CHAN_TURBO(chan)) + clockMhzScaled <<= 1; + else if (IEEE80211_IS_CHAN_HALF(chan)) + clockMhzScaled >>= 1; + else if (IEEE80211_IS_CHAN_QUARTER(chan)) + clockMhzScaled >>= 2; /* * ALGO -> coef = 1e8/fcarrier*fclock/40; @@ -846,6 +846,7 @@ ar5416SpurMitigate(struct ath_hal *ah, c * Need to verify range +/- 9.5 for static ht20, otherwise spur * is out-of-band and can be ignored. */ + /* XXX ath9k changes */ for (i = 0; i < AR5416_EEPROM_MODAL_SPURS; i++) { cur_bb_spur = ath_hal_getSpurChan(ah, i, is2GHz); if (AR_NO_SPUR == cur_bb_spur) @@ -1110,7 +1111,7 @@ ar9280SpurMitigate(struct ath_hal *ah, c break; cur_bb_spur = cur_bb_spur - freq; - if (IS_CHAN_HT40(ichan)) { + if (IEEE80211_IS_CHAN_HT40(chan)) { if ((cur_bb_spur > -AR_SPUR_FEEQ_BOUND_HT40) && (cur_bb_spur < AR_SPUR_FEEQ_BOUND_HT40)) { bb_spur = cur_bb_spur; @@ -1187,7 +1188,7 @@ ar9280SpurMitigate(struct ath_hal *ah, c * in 11A mode the denominator of spur_freq_sd should be 40 and * it should be 44 in 11G */ - denominator = IEEE80211_IS_CHAN_2GHZ(ichan) ? 44 : 40; + denominator = IEEE80211_IS_CHAN_2GHZ(chan) ? 44 : 40; spur_freq_sd = ((bb_spur_off * 2048) / denominator) & 0x3ff; newVal = (AR_PHY_TIMING11_USE_SPUR_IN_AGC | From owner-svn-src-head@FreeBSD.ORG Tue Feb 24 00:33:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ECDB9106564A; Tue, 24 Feb 2009 00:33:08 +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 D8E178FC12; Tue, 24 Feb 2009 00:33:08 +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 n1O0X83q045565; Tue, 24 Feb 2009 00:33:08 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1O0X8FE045560; Tue, 24 Feb 2009 00:33:08 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902240033.n1O0X8FE045560@svn.freebsd.org> From: Sam Leffler Date: Tue, 24 Feb 2009 00:33:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188976 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Feb 2009 00:33:09 -0000 Author: sam Date: Tue Feb 24 00:33:08 2009 New Revision: 188976 URL: http://svn.freebsd.org/changeset/base/188976 Log: Fill in gpio support for 5416 and later parts: o add output mux support o gpio pin count is chip-dependent o 9280 and 9285 do input handling different o hookup gpio interrupts o no need to save/restore soft led state around reset Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h head/sys/dev/ath/ath_hal/ar5416/ar5416_gpio.c head/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416.h Tue Feb 24 00:29:32 2009 (r188975) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416.h Tue Feb 24 00:33:08 2009 (r188976) @@ -59,6 +59,7 @@ struct ath_hal_5416 { HAL_INI_ARRAY ah_ini_addac; u_int ah_globaltxtimeout; /* global tx timeout */ + u_int ah_gpioMask; int ah_hangs; /* h/w hangs state */ uint8_t ah_keytype[AR5416_KEYTABLE_SIZE]; /* Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_gpio.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_gpio.c Tue Feb 24 00:29:32 2009 (r188975) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_gpio.c Tue Feb 24 00:33:08 2009 (r188976) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2008 Sam Leffler, Errno Consulting + * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting * Copyright (c) 2002-2008 Atheros Communications, Inc. * * Permission to use, copy, modify, and/or distribute this software for any @@ -21,36 +21,95 @@ #include "ah.h" #include "ah_internal.h" #include "ah_devid.h" -#ifdef AH_DEBUG -#include "ah_desc.h" /* NB: for HAL_PHYERR* */ -#endif #include "ar5416/ar5416.h" #include "ar5416/ar5416reg.h" #include "ar5416/ar5416phy.h" -#define AR_NUM_GPIO 6 /* 6 GPIO pins */ #define AR_GPIO_BIT(_gpio) (1 << _gpio) /* + * Configure GPIO Output Mux control + */ +static void +cfgOutputMux(struct ath_hal *ah, uint32_t gpio, uint32_t type) +{ + int addr; + uint32_t gpio_shift, reg; + + /* each MUX controls 6 GPIO pins */ + if (gpio > 11) + addr = AR_GPIO_OUTPUT_MUX3; + else if (gpio > 5) + addr = AR_GPIO_OUTPUT_MUX2; + else + addr = AR_GPIO_OUTPUT_MUX1; + + /* + * 5 bits per GPIO pin. Bits 0..4 for 1st pin in that mux, + * bits 5..9 for 2nd pin, etc. + */ + gpio_shift = (gpio % 6) * 5; + + /* + * From Owl to Merlin 1.0, the value read from MUX1 bit 4 to bit + * 9 are wrong. Here is hardware's coding: + * PRDATA[4:0] <= gpio_output_mux[0]; + * PRDATA[9:4] <= gpio_output_mux[1]; + * <==== Bit 4 is used by both gpio_output_mux[0] [1]. + * Currently the max value for gpio_output_mux[] is 6. So bit 4 + * will never be used. So it should be fine that bit 4 won't be + * able to recover. + */ + reg = OS_REG_READ(ah, addr); + if (addr == AR_GPIO_OUTPUT_MUX1 && !AR_SREV_MERLIN_20_OR_LATER(ah)) + reg = ((reg & 0x1F0) << 1) | (reg & ~0x1F0); + reg &= ~(0x1f << gpio_shift); + reg |= type << gpio_shift; + OS_REG_WRITE(ah, addr, reg); +} + +/* * Configure GPIO Output lines */ HAL_BOOL ar5416GpioCfgOutput(struct ath_hal *ah, uint32_t gpio, HAL_GPIO_MUX_TYPE type) { - HALASSERT(gpio < AR_NUM_GPIO); - OS_REG_CLR_BIT(ah, AR_GPIO_INTR_OUT, AR_GPIO_BIT(gpio)); + uint32_t gpio_shift, reg; + + HALASSERT(gpio < AH_PRIVATE(ah)->ah_caps.halNumGpioPins); + + /* NB: type maps directly to hardware */ + cfgOutputMux(ah, gpio, type); + gpio_shift = gpio << 1; /* 2 bits per output mode */ + + reg = OS_REG_READ(ah, AR_GPIO_OE_OUT); + reg &= ~(AR_GPIO_OE_OUT_DRV << gpio_shift); + reg |= AR_GPIO_OE_OUT_DRV_ALL << gpio_shift, + OS_REG_WRITE(ah, AR_GPIO_OE_OUT, reg); + return AH_TRUE; } - + /* * Configure GPIO Input lines */ HAL_BOOL ar5416GpioCfgInput(struct ath_hal *ah, uint32_t gpio) { - HALASSERT(gpio < AR_NUM_GPIO); - OS_REG_SET_BIT(ah, AR_GPIO_INTR_OUT, AR_GPIO_BIT(gpio)); + uint32_t gpio_shift, reg; + + HALASSERT(gpio < AH_PRIVATE(ah)->ah_caps.halNumGpioPins); + + /* TODO: configure input mux for AR5416 */ + /* If configured as input, set output to tristate */ + gpio_shift = gpio << 1; + + reg = OS_REG_READ(ah, AR_GPIO_OE_OUT); + reg &= ~(AR_GPIO_OE_OUT_DRV << gpio_shift); + reg |= AR_GPIO_OE_OUT_DRV_ALL << gpio_shift, + OS_REG_WRITE(ah, AR_GPIO_OE_OUT, reg); + return AH_TRUE; } @@ -62,14 +121,14 @@ ar5416GpioSet(struct ath_hal *ah, uint32 { uint32_t reg; - HALASSERT(gpio < AR_NUM_GPIO); - reg = MS(OS_REG_READ(ah, AR_GPIO_INTR_OUT), AR_GPIO_OUT_VAL); + HALASSERT(gpio < AH_PRIVATE(ah)->ah_caps.halNumGpioPins); + + reg = OS_REG_READ(ah, AR_GPIO_IN_OUT); if (val & 1) reg |= AR_GPIO_BIT(gpio); else reg &= ~AR_GPIO_BIT(gpio); - - OS_REG_RMW_FIELD(ah, AR_GPIO_INTR_OUT, AR_GPIO_OUT_VAL, reg); + OS_REG_WRITE(ah, AR_GPIO_IN_OUT, reg); return AH_TRUE; } @@ -79,34 +138,92 @@ ar5416GpioSet(struct ath_hal *ah, uint32 uint32_t ar5416GpioGet(struct ath_hal *ah, uint32_t gpio) { - if (gpio >= AR_NUM_GPIO) + uint32_t bits; + + if (gpio >= AH_PRIVATE(ah)->ah_caps.halNumGpioPins) return 0xffffffff; - return ((OS_REG_READ(ah, AR_GPIO_IN) & AR_GPIO_BIT(gpio)) >> gpio); + /* + * Read output value for all gpio's, shift it, + * and verify whether the specific bit is set. + */ + if (AR_SREV_MERLIN_10_OR_LATER(ah)) + bits = MS(OS_REG_READ(ah, AR_GPIO_IN_OUT), AR928X_GPIO_IN_VAL); + else + bits = MS(OS_REG_READ(ah, AR_GPIO_IN_OUT), AR_GPIO_IN_VAL); + return ((bits & AR_GPIO_BIT(gpio)) != 0); } /* - * Set the GPIO Interrupt + * Set the GPIO Interrupt Sync and Async interrupts are both set/cleared. + * Async GPIO interrupts may not be raised when the chip is put to sleep. */ void ar5416GpioSetIntr(struct ath_hal *ah, u_int gpio, uint32_t ilevel) { - uint32_t val; - - HALASSERT(gpio < AR_NUM_GPIO); - /* XXX bounds check gpio */ - val = MS(OS_REG_READ(ah, AR_GPIO_INTR_OUT), AR_GPIO_INTR_CTRL); - if (ilevel) /* 0 == interrupt on pin high */ - val &= ~AR_GPIO_BIT(gpio); - else /* 1 == interrupt on pin low */ - val |= AR_GPIO_BIT(gpio); - OS_REG_RMW_FIELD(ah, AR_GPIO_INTR_OUT, AR_GPIO_INTR_CTRL, val); - - /* Change the interrupt mask. */ - val = MS(OS_REG_READ(ah, AR_INTR_ASYNC_ENABLE), AR_INTR_GPIO); - val |= AR_GPIO_BIT(gpio); - OS_REG_RMW_FIELD(ah, AR_INTR_ASYNC_ENABLE, AR_INTR_GPIO, val); - - val = MS(OS_REG_READ(ah, AR_INTR_ASYNC_MASK), AR_INTR_GPIO); - val |= AR_GPIO_BIT(gpio); - OS_REG_RMW_FIELD(ah, AR_INTR_ASYNC_MASK, AR_INTR_GPIO, val); + uint32_t val, mask; + + HALASSERT(gpio < AH_PRIVATE(ah)->ah_caps.halNumGpioPins); + + if (ilevel == HAL_GPIO_INTR_DISABLE) { + val = MS(OS_REG_READ(ah, AR_INTR_ASYNC_ENABLE), + AR_INTR_ASYNC_ENABLE_GPIO) &~ AR_GPIO_BIT(gpio); + OS_REG_RMW_FIELD(ah, AR_INTR_ASYNC_ENABLE, + AR_INTR_ASYNC_ENABLE_GPIO, val); + + mask = MS(OS_REG_READ(ah, AR_INTR_ASYNC_MASK), + AR_INTR_ASYNC_MASK_GPIO) &~ AR_GPIO_BIT(gpio); + OS_REG_RMW_FIELD(ah, AR_INTR_ASYNC_MASK, + AR_INTR_ASYNC_MASK_GPIO, mask); + + /* Clear synchronous GPIO interrupt registers and pending interrupt flag */ + val = MS(OS_REG_READ(ah, AR_INTR_SYNC_ENABLE), + AR_INTR_SYNC_ENABLE_GPIO) &~ AR_GPIO_BIT(gpio); + OS_REG_RMW_FIELD(ah, AR_INTR_SYNC_ENABLE, + AR_INTR_SYNC_ENABLE_GPIO, val); + + mask = MS(OS_REG_READ(ah, AR_INTR_SYNC_MASK), + AR_INTR_SYNC_MASK_GPIO) &~ AR_GPIO_BIT(gpio); + OS_REG_RMW_FIELD(ah, AR_INTR_SYNC_MASK, + AR_INTR_SYNC_MASK_GPIO, mask); + + val = MS(OS_REG_READ(ah, AR_INTR_SYNC_CAUSE), + AR_INTR_SYNC_ENABLE_GPIO) | AR_GPIO_BIT(gpio); + OS_REG_RMW_FIELD(ah, AR_INTR_SYNC_CAUSE, + AR_INTR_SYNC_ENABLE_GPIO, val); + } else { + val = MS(OS_REG_READ(ah, AR_GPIO_INTR_POL), + AR_GPIO_INTR_POL_VAL); + if (ilevel == HAL_GPIO_INTR_HIGH) { + /* 0 == interrupt on pin high */ + val &= ~AR_GPIO_BIT(gpio); + } else if (ilevel == HAL_GPIO_INTR_LOW) { + /* 1 == interrupt on pin low */ + val |= AR_GPIO_BIT(gpio); + } + OS_REG_RMW_FIELD(ah, AR_GPIO_INTR_POL, + AR_GPIO_INTR_POL_VAL, val); + + /* Change the interrupt mask. */ + val = MS(OS_REG_READ(ah, AR_INTR_ASYNC_ENABLE), + AR_INTR_ASYNC_ENABLE_GPIO) | AR_GPIO_BIT(gpio); + OS_REG_RMW_FIELD(ah, AR_INTR_ASYNC_ENABLE, + AR_INTR_ASYNC_ENABLE_GPIO, val); + + mask = MS(OS_REG_READ(ah, AR_INTR_ASYNC_MASK), + AR_INTR_ASYNC_MASK_GPIO) | AR_GPIO_BIT(gpio); + OS_REG_RMW_FIELD(ah, AR_INTR_ASYNC_MASK, + AR_INTR_ASYNC_MASK_GPIO, mask); + + /* Set synchronous GPIO interrupt registers as well */ + val = MS(OS_REG_READ(ah, AR_INTR_SYNC_ENABLE), + AR_INTR_SYNC_ENABLE_GPIO) | AR_GPIO_BIT(gpio); + OS_REG_RMW_FIELD(ah, AR_INTR_SYNC_ENABLE, + AR_INTR_SYNC_ENABLE_GPIO, val); + + mask = MS(OS_REG_READ(ah, AR_INTR_SYNC_MASK), + AR_INTR_SYNC_MASK_GPIO) | AR_GPIO_BIT(gpio); + OS_REG_RMW_FIELD(ah, AR_INTR_SYNC_MASK, + AR_INTR_SYNC_MASK_GPIO, mask); + } + AH5416(ah)->ah_gpioMask = mask; /* for ar5416SetInterrupts */ } Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c Tue Feb 24 00:29:32 2009 (r188975) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c Tue Feb 24 00:33:08 2009 (r188976) @@ -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: ar5416_interrupts.c,v 1.6 2008/11/10 04:08:04 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" @@ -167,7 +167,7 @@ ar5416SetInterrupts(struct ath_hal *ah, { struct ath_hal_5212 *ahp = AH5212(ah); uint32_t omask = ahp->ah_maskReg; - uint32_t mask,mask2; + uint32_t mask, mask2; HALDEBUG(ah, HAL_DEBUG_INTERRUPT, "%s: 0x%x => 0x%x\n", __func__, omask, ints); @@ -248,11 +248,19 @@ ar5416SetInterrupts(struct ath_hal *ah, HALDEBUG(ah, HAL_DEBUG_INTERRUPT, "%s: enable IER\n", __func__); OS_REG_WRITE(ah, AR_IER, AR_IER_ENABLE); - OS_REG_WRITE(ah, AR_INTR_ASYNC_ENABLE, AR_INTR_MAC_IRQ); - OS_REG_WRITE(ah, AR_INTR_ASYNC_MASK, AR_INTR_MAC_IRQ); - - OS_REG_WRITE(ah, AR_INTR_SYNC_ENABLE, AR_INTR_SYNC_DEFAULT); - OS_REG_WRITE(ah, AR_INTR_SYNC_MASK, AR_INTR_SYNC_DEFAULT); + mask = AR_INTR_MAC_IRQ; + if (ints & HAL_INT_GPIO) + mask |= SM(AH5416(ah)->ah_gpioMask, + AR_INTR_ASYNC_MASK_GPIO); + OS_REG_WRITE(ah, AR_INTR_ASYNC_ENABLE, mask); + OS_REG_WRITE(ah, AR_INTR_ASYNC_MASK, mask); + + mask = AR_INTR_SYNC_DEFAULT; + if (ints & HAL_INT_GPIO) + mask |= SM(AH5416(ah)->ah_gpioMask, + AR_INTR_SYNC_MASK_GPIO); + OS_REG_WRITE(ah, AR_INTR_SYNC_ENABLE, mask); + OS_REG_WRITE(ah, AR_INTR_SYNC_MASK, mask); } return omask; Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Tue Feb 24 00:29:32 2009 (r188975) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Tue Feb 24 00:33:08 2009 (r188976) @@ -117,7 +117,6 @@ ar5416Reset(struct ath_hal *ah, HAL_OPMO #define FAIL(_code) do { ecode = _code; goto bad; } while (0) struct ath_hal_5212 *ahp = AH5212(ah); HAL_CHANNEL_INTERNAL *ichan; - uint32_t softLedCfg; uint32_t saveDefAntenna, saveLedState; uint32_t macStaId1; uint16_t rfXpdGain[2]; @@ -181,7 +180,6 @@ ar5416Reset(struct ath_hal *ah, HAL_OPMO saveLedState = OS_REG_READ(ah, AR_MAC_LED) & (AR_MAC_LED_ASSOC | AR_MAC_LED_MODE | AR_MAC_LED_BLINK_THRESH_SEL | AR_MAC_LED_BLINK_SLOW); - softLedCfg = OS_REG_READ(ah, AR_GPIO_INTR_OUT); /* * Adjust gain parameters before reset if @@ -342,8 +340,6 @@ ar5416Reset(struct ath_hal *ah, HAL_OPMO /* Restore previous led state */ OS_REG_WRITE(ah, AR_MAC_LED, OS_REG_READ(ah, AR_MAC_LED) | saveLedState); - /* Restore soft Led state to GPIO */ - OS_REG_WRITE(ah, AR_GPIO_INTR_OUT, softLedCfg); /* Restore previous antenna */ OS_REG_WRITE(ah, AR_DEF_ANTENNA, saveDefAntenna); Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Tue Feb 24 00:29:32 2009 (r188975) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Tue Feb 24 00:33:08 2009 (r188976) @@ -31,7 +31,6 @@ #define AR_GTTM 0x0068 /* global transmit timeout mode */ #define AR_CST 0x006C /* carrier sense timeout */ #define AR_MAC_LED 0x1f04 /* LED control */ -#define AR5416_PCIE_PM_CTRL 0x4014 #define AR_AHB_MODE 0x4024 /* AHB mode for dma */ #define AR_INTR_SYNC_CAUSE_CLR 0x4028 /* clear interrupt */ #define AR_INTR_SYNC_CAUSE 0x4028 /* check pending interrupts */ @@ -42,8 +41,15 @@ #define AR_INTR_ASYNC_ENABLE 0x403c /* enable interrupts */ #define AR5416_PCIE_SERDES 0x4040 #define AR5416_PCIE_SERDES2 0x4044 -#define AR_GPIO_IN 0x4048 /* GPIO input register */ -#define AR_GPIO_INTR_OUT 0x404c /* GPIO output register */ +#define AR_GPIO_IN_OUT 0x4048 /* GPIO input/output register */ +#define AR_GPIO_OE_OUT 0x404c /* GPIO output enable register */ +#define AR_GPIO_INTR_POL 0x4050 /* GPIO interrupt polarity */ +#define AR_GPIO_INPUT_EN_VAL 0x4054 /* GPIO input enable and value */ +#define AR_GPIO_INPUT_MUX1 0x4058 +#define AR_GPIO_INPUT_MUX2 0x405c +#define AR_GPIO_OUTPUT_MUX1 0x4060 +#define AR_GPIO_OUTPUT_MUX2 0x4064 +#define AR_GPIO_OUTPUT_MUX3 0x4068 #define AR_EEPROM_STATUS_DATA 0x407c #define AR_OBS 0x4080 #define AR_RTC_RC 0x7000 /* reset control */ @@ -258,6 +264,21 @@ AR_INTR_SYNC_RADM_CPL_TIMEOUT | AR_INTR_SYNC_LOCAL_TIMEOUT | \ AR_INTR_SYNC_MAC_SLEEP_ACCESS) +#define AR_INTR_SYNC_MASK_GPIO 0xFFFC0000 +#define AR_INTR_SYNC_MASK_GPIO_S 18 + +#define AR_INTR_SYNC_ENABLE_GPIO 0xFFFC0000 +#define AR_INTR_SYNC_ENABLE_GPIO_S 18 + +#define AR_INTR_ASYNC_MASK_GPIO 0xFFFC0000 /* async int mask */ +#define AR_INTR_ASYNC_MASK_GPIO_S 18 + +#define AR_INTR_ASYNC_CAUSE_GPIO 0xFFFC0000 /* GPIO interrupts */ +#define AR_INTR_ASYNC_USED (AR_INTR_MAC_IRQ | AR_INTR_ASYNC_CAUSE_GPIO) + +#define AR_INTR_ASYNC_ENABLE_GPIO 0xFFFC0000 /* enable interrupts */ +#define AR_INTR_ASYNC_ENABLE_GPIO_S 18 + /* RTC registers */ #define AR_RTC_RC_M 0x00000003 #define AR_RTC_RC_MAC_WARM 0x00000001 @@ -418,6 +439,22 @@ #define AR_GPIO_INTR_CTRL 0x3FF00000 #define AR_GPIO_INTR_CTRL_S 20 +#define AR_GPIO_IN_VAL 0x0FFFC000 /* pre-9280 */ +#define AR_GPIO_IN_VAL_S 14 +#define AR928X_GPIO_IN_VAL 0x000FFC00 +#define AR928X_GPIO_IN_VAL_S 10 +#define AR9285_GPIO_IN_VAL 0x00FFF000 +#define AR9285_GPIO_IN_VAL_S 12 + +#define AR_GPIO_OE_OUT_DRV 0x3 /* 2 bit mask shifted by 2*bitpos */ +#define AR_GPIO_OE_OUT_DRV_NO 0x0 /* tristate */ +#define AR_GPIO_OE_OUT_DRV_LOW 0x1 /* drive if low */ +#define AR_GPIO_OE_OUT_DRV_HI 0x2 /* drive if high */ +#define AR_GPIO_OE_OUT_DRV_ALL 0x3 /* drive always */ + +#define AR_GPIO_INTR_POL_VAL 0x1FFF +#define AR_GPIO_INTR_POL_VAL_S 0 + #define AR_2040_JOINED_RX_CLEAR 0x00000001 /* use ctl + ext rx_clear for cca */ #define AR_PCU_TXBUF_CTRL_SIZE_MASK 0x7FF From owner-svn-src-head@FreeBSD.ORG Tue Feb 24 00:39:49 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4DC59106566C; Tue, 24 Feb 2009 00:39:49 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B1A58FC1D; Tue, 24 Feb 2009 00:39:49 +0000 (UTC) (envelope-from thompsa@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 n1O0dnLE045775; Tue, 24 Feb 2009 00:39:49 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1O0dn7a045773; Tue, 24 Feb 2009 00:39:49 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902240039.n1O0dn7a045773@svn.freebsd.org> From: Andrew Thompson Date: Tue, 24 Feb 2009 00:39:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188977 - in head/sys: amd64/conf i386/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Feb 2009 00:39:49 -0000 Author: thompsa Date: Tue Feb 24 00:39:48 2009 New Revision: 188977 URL: http://svn.freebsd.org/changeset/base/188977 Log: Exclude ndis from the LINT build as it currently breaks the build, patches to move to the new usb stack are in progress. Modified: head/sys/amd64/conf/NOTES head/sys/i386/conf/NOTES Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Tue Feb 24 00:33:08 2009 (r188976) +++ head/sys/amd64/conf/NOTES Tue Feb 24 00:39:48 2009 (r188977) @@ -509,5 +509,5 @@ options VM_KMEM_SIZE_MAX options VM_KMEM_SIZE_SCALE # Enable NDIS binary driver support -options NDISAPI -device ndis +#options NDISAPI +#device ndis Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Tue Feb 24 00:33:08 2009 (r188976) +++ head/sys/i386/conf/NOTES Tue Feb 24 00:39:48 2009 (r188977) @@ -882,8 +882,8 @@ options DEBUG_SVR4 # enable verbose deb device streams # STREAMS network driver (required for svr4). # Enable NDIS binary driver support -options NDISAPI -device ndis +#options NDISAPI +#device ndis ##################################################################### From owner-svn-src-head@FreeBSD.ORG Tue Feb 24 00:53:11 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3B491065680; Tue, 24 Feb 2009 00:53:10 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C6B8B8FC0A; Tue, 24 Feb 2009 00:53:10 +0000 (UTC) (envelope-from thompsa@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 n1O0rApD046096; Tue, 24 Feb 2009 00:53:10 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1O0rAtH046093; Tue, 24 Feb 2009 00:53:10 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902240053.n1O0rAtH046093@svn.freebsd.org> From: Andrew Thompson Date: Tue, 24 Feb 2009 00:53:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188978 - in head: etc/mtree include usr.bin/kdump X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Feb 2009 00:53:11 -0000 Author: thompsa Date: Tue Feb 24 00:53:10 2009 New Revision: 188978 URL: http://svn.freebsd.org/changeset/base/188978 Log: Install the old usb headers under /usr/include/legacy/dev/usb as they are needed by the hal port. This will be removed before 8.0. Add an exclusion to kdump as some structs will be redefined. Requested by: marcus Modified: head/etc/mtree/BSD.include.dist head/include/Makefile head/usr.bin/kdump/mkioctls Modified: head/etc/mtree/BSD.include.dist ============================================================================== --- head/etc/mtree/BSD.include.dist Tue Feb 24 00:39:48 2009 (r188977) +++ head/etc/mtree/BSD.include.dist Tue Feb 24 00:53:10 2009 (r188978) @@ -195,6 +195,12 @@ .. kadm5 .. + legacy + dev + usb + .. + .. + .. libmilter .. lwres Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Tue Feb 24 00:39:48 2009 (r188977) +++ head/include/Makefile Tue Feb 24 00:53:10 2009 (r188978) @@ -54,7 +54,7 @@ LSUBDIRS= cam/scsi \ security/mac_mls security/mac_partition \ ufs/ffs ufs/ufs -LSUBSUBDIRS= dev/mpt/mpilib +LSUBSUBDIRS= dev/mpt/mpilib legacy/dev/usb .if ${MACHINE_ARCH} == "powerpc" _dev_powermac_nvram= dev/powermac_nvram Modified: head/usr.bin/kdump/mkioctls ============================================================================== --- head/usr.bin/kdump/mkioctls Tue Feb 24 00:39:48 2009 (r188977) +++ head/usr.bin/kdump/mkioctls Tue Feb 24 00:53:10 2009 (r188978) @@ -18,11 +18,14 @@ fi LC_ALL=C; export LC_ALL +# include subdirs to exclude from the search +exclude="^legacy/.*" + # Build a list of headers that have ioctls in them. # XXX should we use an ANSI cpp? ioctl_includes=` cd $1 - find -H -s * -name '*.h' | + find -H -s * -name '*.h' \! -regex $exclude | xargs egrep -l \ '^#[ ]*define[ ]+[A-Za-z_][A-Za-z0-9_]*[ ]+_IO[^a-z0-9_]' | awk '{printf("#include <%s>\\\\n", $1)}' From owner-svn-src-head@FreeBSD.ORG Tue Feb 24 00:56:00 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C8C5106566B; Tue, 24 Feb 2009 00:56:00 +0000 (UTC) (envelope-from marcus@marcuscom.com) Received: from creme-brulee.marcuscom.com (marcuscom-pt.tunnel.tserv1.fmt.ipv6.he.net [IPv6:2001:470:1f00:ffff::1279]) by mx1.freebsd.org (Postfix) with ESMTP id 3C6E08FC0A; Tue, 24 Feb 2009 00:56:00 +0000 (UTC) (envelope-from marcus@marcuscom.com) Received: from [IPv6:2001:470:1f00:2464::4] (shumai.marcuscom.com [IPv6:2001:470:1f00:2464::4]) by creme-brulee.marcuscom.com (8.14.3/8.14.3) with ESMTP id n1O0vU9X082189; Mon, 23 Feb 2009 19:57:30 -0500 (EST) (envelope-from marcus@marcuscom.com) From: Joe Marcus Clarke To: Andrew Thompson In-Reply-To: <200902240053.n1O0rAtH046093@svn.freebsd.org> References: <200902240053.n1O0rAtH046093@svn.freebsd.org> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-zhl4UiX7rmTGuZalcbDT" Organization: MarcusCom, Inc. Date: Mon, 23 Feb 2009 19:56:18 -0500 Message-Id: <1235436978.91306.17.camel@shumai.marcuscom.com> Mime-Version: 1.0 X-Mailer: Evolution 2.24.4 FreeBSD GNOME Team Port X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,NO_RELAYS autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on creme-brulee.marcuscom.com Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r188978 - in head: etc/mtree include usr.bin/kdump X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Feb 2009 00:56:01 -0000 --=-zhl4UiX7rmTGuZalcbDT Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Tue, 2009-02-24 at 00:53 +0000, Andrew Thompson wrote: > Author: thompsa > Date: Tue Feb 24 00:53:10 2009 > New Revision: 188978 > URL: http://svn.freebsd.org/changeset/base/188978 >=20 > Log: > Install the old usb headers under /usr/include/legacy/dev/usb as they a= re > needed by the hal port. This will be removed before 8.0. > =20 > Add an exclusion to kdump as some structs will be redefined. > =20 > Requested by: marcus Thanks! Joe --=20 PGP Key : http://www.marcuscom.com/pgp.asc --=-zhl4UiX7rmTGuZalcbDT Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEABECAAYFAkmjRbAACgkQb2iPiv4Uz4c4OgCeI9/RRRRon/upb9gflnIlpAIw +TEAn15VnLbZVVGbQaO2X9IPysIBthAn =mUwZ -----END PGP SIGNATURE----- --=-zhl4UiX7rmTGuZalcbDT-- From owner-svn-src-head@FreeBSD.ORG Tue Feb 24 01:07:07 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19D661065670; Tue, 24 Feb 2009 01:07:07 +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 05C248FC0C; Tue, 24 Feb 2009 01:07:07 +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 n1O177Yb046413; Tue, 24 Feb 2009 01:07:07 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1O176dq046398; Tue, 24 Feb 2009 01:07:06 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902240107.n1O176dq046398@svn.freebsd.org> From: Sam Leffler Date: Tue, 24 Feb 2009 01:07:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188979 - in head/sys/dev/ath/ath_hal: . ar5210 ar5211 ar5212 ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Feb 2009 01:07:07 -0000 Author: sam Date: Tue Feb 24 01:07:06 2009 New Revision: 188979 URL: http://svn.freebsd.org/changeset/base/188979 Log: Add PCIE power control api: o add ah_configPCIE and ah_disablePCIE for drivers to configure PCIE power save operation (modeled after ath9k, may need changes) o add private state flag to indicate if device is PCIE (replaces private hack in 5212 code) o add serdes programming ini bits for 5416 and later parts and setup for each part (5416 and 9160 logic hand-crafted from existing routines); 5212 remains open-coded but is now hooked in via ah_configPCIE o add PCIE workaround gunk o add ar5416AttachPCIE for iodomatic code used by 5416 and later parts Modified: head/sys/dev/ath/ath_hal/ah.h head/sys/dev/ath/ath_hal/ah_internal.h head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c head/sys/dev/ath/ath_hal/ar5212/ar2425.c head/sys/dev/ath/ath_hal/ar5212/ar5212.h head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c head/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c head/sys/dev/ath/ath_hal/ar5212/ar5413.c head/sys/dev/ath/ath_hal/ar5416/ar5416.h head/sys/dev/ath/ath_hal/ar5416/ar5416.ini head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h head/sys/dev/ath/ath_hal/ar5416/ar9160.ini head/sys/dev/ath/ath_hal/ar5416/ar9160_attach.c Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Tue Feb 24 00:53:10 2009 (r188978) +++ head/sys/dev/ath/ath_hal/ah.h Tue Feb 24 01:07:06 2009 (r188979) @@ -624,6 +624,8 @@ struct ath_hal { HAL_BOOL bChannelChange, HAL_STATUS *status); HAL_BOOL __ahdecl(*ah_phyDisable)(struct ath_hal *); HAL_BOOL __ahdecl(*ah_disable)(struct ath_hal *); + void __ahdecl(*ah_configPCIE)(struct ath_hal *, HAL_BOOL restore); + void __ahdecl(*ah_disablePCIE)(struct ath_hal *); void __ahdecl(*ah_setPCUConfig)(struct ath_hal *); HAL_BOOL __ahdecl(*ah_perCalibration)(struct ath_hal*, struct ieee80211_channel *, HAL_BOOL *); Modified: head/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_internal.h Tue Feb 24 00:53:10 2009 (r188978) +++ head/sys/dev/ath/ath_hal/ah_internal.h Tue Feb 24 01:07:06 2009 (r188979) @@ -269,6 +269,7 @@ struct ath_hal_private { uint16_t ah_phyRev; /* PHY revision */ uint16_t ah_analog5GhzRev; /* 2GHz radio revision */ uint16_t ah_analog2GhzRev; /* 5GHz radio revision */ + uint8_t ah_ispcie; /* PCIE, special treatment */ HAL_OPMODE ah_opmode; /* operating mode from reset */ const struct ieee80211_channel *ah_curchan;/* operating channel */ @@ -327,6 +328,10 @@ struct ath_hal_private { AH_PRIVATE(_ah)->ah_getNfAdjust(_ah, _c) #define ath_hal_getNoiseFloor(_ah, _nfArray) \ AH_PRIVATE(_ah)->ah_getNoiseFloor(_ah, _nfArray) +#define ath_hal_configPCIE(_ah, _reset) \ + (_ah)->ah_configPCIE(_ah, _reset) +#define ath_hal_disablePCIE(_ah) \ + (_ah)->ah_disablePCIE(_ah) #define ath_hal_eepromDetach(_ah) \ AH_PRIVATE(_ah)->ah_eepromDetach(_ah) Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c Tue Feb 24 00:53:10 2009 (r188978) +++ head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c Tue Feb 24 01:07:06 2009 (r188979) @@ -33,6 +33,9 @@ static HAL_BOOL ar5210GetChannelEdges(st static HAL_BOOL ar5210GetChipPowerLimits(struct ath_hal *ah, struct ieee80211_channel *chan); +static void ar5210ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore); +static void ar5210DisablePCIE(struct ath_hal *ah); + static const struct ath_hal_private ar5210hal = {{ .ah_magic = AR5210_MAGIC, .ah_abi = HAL_ABI_VERSION, @@ -44,6 +47,8 @@ static const struct ath_hal_private ar52 .ah_reset = ar5210Reset, .ah_phyDisable = ar5210PhyDisable, .ah_disable = ar5210Disable, + .ah_configPCIE = ar5210ConfigPCIE, + .ah_disablePCIE = ar5210DisablePCIE, .ah_setPCUConfig = ar5210SetPCUConfig, .ah_perCalibration = ar5210PerCalibration, .ah_perCalibrationN = ar5210PerCalibrationN, @@ -318,6 +323,16 @@ ar5210GetChipPowerLimits(struct ath_hal return AH_TRUE; } +static void +ar5210ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore) +{ +} + +static void +ar5210DisablePCIE(struct ath_hal *ah) +{ +} + /* * Fill all software cached or static hardware state information. */ Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c Tue Feb 24 00:53:10 2009 (r188978) +++ head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c Tue Feb 24 01:07:06 2009 (r188979) @@ -33,6 +33,9 @@ static HAL_BOOL ar5211GetChannelEdges(st static HAL_BOOL ar5211GetChipPowerLimits(struct ath_hal *ah, struct ieee80211_channel *chan); +static void ar5211ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore); +static void ar5211DisablePCIE(struct ath_hal *ah); + static const struct ath_hal_private ar5211hal = {{ .ah_magic = AR5211_MAGIC, .ah_abi = HAL_ABI_VERSION, @@ -44,6 +47,8 @@ static const struct ath_hal_private ar52 .ah_reset = ar5211Reset, .ah_phyDisable = ar5211PhyDisable, .ah_disable = ar5211Disable, + .ah_configPCIE = ar5211ConfigPCIE, + .ah_disablePCIE = ar5211DisablePCIE, .ah_setPCUConfig = ar5211SetPCUConfig, .ah_perCalibration = ar5211PerCalibration, .ah_perCalibrationN = ar5211PerCalibrationN, @@ -440,6 +445,16 @@ ar5211GetChipPowerLimits(struct ath_hal return AH_TRUE; } +static void +ar5211ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore) +{ +} + +static void +ar5211DisablePCIE(struct ath_hal *ah) +{ +} + /* * Fill all software cached or static hardware state information. */ Modified: head/sys/dev/ath/ath_hal/ar5212/ar2425.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar2425.c Tue Feb 24 00:53:10 2009 (r188978) +++ head/sys/dev/ath/ath_hal/ar5212/ar2425.c Tue Feb 24 01:07:06 2009 (r188979) @@ -61,7 +61,7 @@ ar2425WriteRegs(struct ath_hal *ah, u_in * Bit 0 enables link to go to L1 when MAC goes to sleep. * Bit 3 enables the loop back the link down to reset. */ - if (IS_PCIE(ah) && ath_hal_pcieL1SKPEnable) { + if (AH_PRIVATE(ah)->ah_ispcie && && ath_hal_pcieL1SKPEnable) { OS_REG_WRITE(ah, AR_PCIE_PMC, AR_PCIE_PMC_ENA_L1 | AR_PCIE_PMC_ENA_RESET); } Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212.h Tue Feb 24 00:53:10 2009 (r188978) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212.h Tue Feb 24 01:07:06 2009 (r188979) @@ -356,8 +356,6 @@ struct ath_hal_5212 { ((AH_PRIVATE(ah)->ah_macVersion) == AR_SREV_2417) #define IS_HB63(ah) (AH5212(ah)->ah_isHb63 == AH_TRUE) -#define IS_PCIE(ah) (IS_5424(ah) || IS_2425(ah)) - #define AH_RADIO_MAJOR(ah) \ (AH_PRIVATE(ah)->ah_analog5GhzRev & AR_RADIO_SREV_MAJOR) #define AH_RADIO_MINOR(ah) \ Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Tue Feb 24 00:53:10 2009 (r188978) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Tue Feb 24 01:07:06 2009 (r188979) @@ -29,6 +29,9 @@ #define AH_5212_COMMON #include "ar5212/ar5212.ini" +static void ar5212ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore); +static void ar5212DisablePCIE(struct ath_hal *ah); + static const struct ath_hal_private ar5212hal = {{ .ah_magic = AR5212_MAGIC, .ah_abi = HAL_ABI_VERSION, @@ -40,6 +43,8 @@ static const struct ath_hal_private ar52 .ah_reset = ar5212Reset, .ah_phyDisable = ar5212PhyDisable, .ah_disable = ar5212Disable, + .ah_configPCIE = ar5212ConfigPCIE, + .ah_disablePCIE = ar5212DisablePCIE, .ah_setPCUConfig = ar5212SetPCUConfig, .ah_perCalibration = ar5212PerCalibration, .ah_perCalibrationN = ar5212PerCalibrationN, @@ -154,36 +159,6 @@ static const struct ath_hal_private ar52 .ah_getChipPowerLimits = ar5212GetChipPowerLimits, }; -/* - * Disable PLL when in L0s as well as receiver clock when in L1. - * This power saving option must be enabled through the Serdes. - * - * Programming the Serdes must go through the same 288 bit serial shift - * register as the other analog registers. Hence the 9 writes. - * - * XXX Clean up the magic numbers. - */ -static void -configurePciePowerSave(struct ath_hal *ah) -{ - OS_REG_WRITE(ah, AR_PCIE_SERDES, 0x9248fc00); - OS_REG_WRITE(ah, AR_PCIE_SERDES, 0x24924924); - - /* RX shut off when elecidle is asserted */ - OS_REG_WRITE(ah, AR_PCIE_SERDES, 0x28000039); - OS_REG_WRITE(ah, AR_PCIE_SERDES, 0x53160824); - OS_REG_WRITE(ah, AR_PCIE_SERDES, 0xe5980579); - - /* Shut off PLL and CLKREQ active in L1 */ - OS_REG_WRITE(ah, AR_PCIE_SERDES, 0x001defff); - OS_REG_WRITE(ah, AR_PCIE_SERDES, 0x1aaabe40); - OS_REG_WRITE(ah, AR_PCIE_SERDES, 0xbe105554); - OS_REG_WRITE(ah, AR_PCIE_SERDES, 0x000e3007); - - /* Load the new settings */ - OS_REG_WRITE(ah, AR_PCIE_SERDES2, 0x00000000); -} - uint32_t ar5212GetRadioRev(struct ath_hal *ah) { @@ -320,7 +295,7 @@ ar5212Attach(uint16_t devid, HAL_SOFTC s HAL_BUS_TAG st, HAL_BUS_HANDLE sh, HAL_STATUS *status) { #define AH_EEPROM_PROTECT(ah) \ - (IS_PCIE(ah) ? AR_EEPROM_PROTECT_PCIE : AR_EEPROM_PROTECT) + (AH_PRIVATE(ah)->ah_ispcie)? AR_EEPROM_PROTECT_PCIE : AR_EEPROM_PROTECT) struct ath_hal_5212 *ahp; struct ath_hal *ah; struct ath_hal_rf *rf; @@ -352,6 +327,7 @@ ar5212Attach(uint16_t devid, HAL_SOFTC s val = OS_REG_READ(ah, AR_SREV) & AR_SREV_ID; AH_PRIVATE(ah)->ah_macVersion = val >> AR_SREV_ID_S; AH_PRIVATE(ah)->ah_macRev = val & AR_SREV_REVISION; + AH_PRIVATE(ah)->ah_ispcie = IS_5424(ah) || IS_2425(ah); if (!ar5212IsMacSupported(AH_PRIVATE(ah)->ah_macVersion, AH_PRIVATE(ah)->ah_macRev)) { HALDEBUG(ah, HAL_DEBUG_ANY, @@ -374,9 +350,9 @@ ar5212Attach(uint16_t devid, HAL_SOFTC s AH_PRIVATE(ah)->ah_phyRev = OS_REG_READ(ah, AR_PHY_CHIP_ID); - if (IS_PCIE(ah)) { + if (AH_PRIVATE(ah)->ah_ispcie) { /* XXX: build flag to disable this? */ - configurePciePowerSave(ah); + ath_hal_configPCIE(ah, AH_FALSE); } if (!ar5212ChipTest(ah)) { @@ -466,7 +442,7 @@ ar5212Attach(uint16_t devid, HAL_SOFTC s val = OS_REG_READ(ah, AR_PCICFG); val = MS(val, AR_PCICFG_EEPROM_SIZE); if (val == 0) { - if (!IS_PCIE(ah)) { + if (!AH_PRIVATE(ah)->ah_ispcie) { HALDEBUG(ah, HAL_DEBUG_ANY, "%s: unsupported EEPROM size %u (0x%x) found\n", __func__, val, val); @@ -663,6 +639,42 @@ ar5212GetChannelEdges(struct ath_hal *ah } /* + * Disable PLL when in L0s as well as receiver clock when in L1. + * This power saving option must be enabled through the Serdes. + * + * Programming the Serdes must go through the same 288 bit serial shift + * register as the other analog registers. Hence the 9 writes. + * + * XXX Clean up the magic numbers. + */ +static void +ar5212ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore) +{ + OS_REG_WRITE(ah, AR_PCIE_SERDES, 0x9248fc00); + OS_REG_WRITE(ah, AR_PCIE_SERDES, 0x24924924); + + /* RX shut off when elecidle is asserted */ + OS_REG_WRITE(ah, AR_PCIE_SERDES, 0x28000039); + OS_REG_WRITE(ah, AR_PCIE_SERDES, 0x53160824); + OS_REG_WRITE(ah, AR_PCIE_SERDES, 0xe5980579); + + /* Shut off PLL and CLKREQ active in L1 */ + OS_REG_WRITE(ah, AR_PCIE_SERDES, 0x001defff); + OS_REG_WRITE(ah, AR_PCIE_SERDES, 0x1aaabe40); + OS_REG_WRITE(ah, AR_PCIE_SERDES, 0xbe105554); + OS_REG_WRITE(ah, AR_PCIE_SERDES, 0x000e3007); + + /* Load the new settings */ + OS_REG_WRITE(ah, AR_PCIE_SERDES2, 0x00000000); +} + +static void +ar5212DisablePCIE(struct ath_hal *ah) +{ + /* NB: fill in for 9100 */ +} + +/* * Fill all software cached or static hardware state information. * Return failure if capabilities are to come from EEPROM and * cannot be read. Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c Tue Feb 24 00:53:10 2009 (r188978) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c Tue Feb 24 01:07:06 2009 (r188979) @@ -1107,7 +1107,7 @@ ar5212SetResetReg(struct ath_hal *ah, ui /* XXX ar5212MacStop & co. */ - if (IS_PCIE(ah)) { + if (AH_PRIVATE(ah)->ah_ispcie) { resetMask &= ~AR_RC_PCI; } Modified: head/sys/dev/ath/ath_hal/ar5212/ar5413.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5413.c Tue Feb 24 00:53:10 2009 (r188978) +++ head/sys/dev/ath/ath_hal/ar5212/ar5413.c Tue Feb 24 01:07:06 2009 (r188979) @@ -232,7 +232,7 @@ ar5413SetRfRegs(struct ath_hal *ah, ar5212ModifyRfBuffer(priv->Bank6Data, 1 , 1, 291, 2); /* Optimum value for rf_pwd_iclobuf2G for PCIe chips only */ - if (IS_PCIE(ah)) { + if (AH_PRIVATE(ah)->ah_ispcie) { ar5212ModifyRfBuffer(priv->Bank6Data, ath_hal_reverseBits(6, 3), 3, 131, 3); } Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416.h Tue Feb 24 00:53:10 2009 (r188978) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416.h Tue Feb 24 01:07:06 2009 (r188979) @@ -57,6 +57,7 @@ struct ath_hal_5416 { HAL_INI_ARRAY ah_ini_bank6; HAL_INI_ARRAY ah_ini_bank7; HAL_INI_ARRAY ah_ini_addac; + HAL_INI_ARRAY ah_ini_pcieserdes; u_int ah_globaltxtimeout; /* global tx timeout */ u_int ah_gpioMask; @@ -89,6 +90,7 @@ extern void ar5416InitState(struct ath_h HAL_SOFTC sc, HAL_BUS_TAG st, HAL_BUS_HANDLE sh, HAL_STATUS *status); extern void ar5416Detach(struct ath_hal *ah); +extern void ar5416AttachPCIE(struct ath_hal *ah); extern HAL_BOOL ar5416FillCapabilityInfo(struct ath_hal *ah); #define IS_5GHZ_FAST_CLOCK_EN(_ah, _c) \ Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.ini ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416.ini Tue Feb 24 00:53:10 2009 (r188978) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416.ini Tue Feb 24 01:07:06 2009 (r188979) @@ -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: ar5416.ini,v 1.3 2008/11/10 04:08:04 sam Exp $ + * $FreeBSD$ */ /* Auto Generated PCI Register Writes. Created: 09/20/06 */ @@ -686,3 +686,17 @@ static const uint32_t ar5416Addac[][2] = {0x0989c, 0x00000000 }, {0x098c4, 0x00000000 }, }; + +/* hand-crafted from code that does explicit register writes */ +static const uint32_t ar5416PciePhy[][2] = { + { AR_PCIE_SERDES, 0x9248fc00 }, + { AR_PCIE_SERDES, 0x24924924 }, + { AR_PCIE_SERDES, 0x28000039 }, + { AR_PCIE_SERDES, 0x53160824 }, + { AR_PCIE_SERDES, 0xe5980579 }, + { AR_PCIE_SERDES, 0x001defff }, + { AR_PCIE_SERDES, 0x1aaabe40 }, + { AR_PCIE_SERDES, 0xbe105554 }, + { AR_PCIE_SERDES, 0x000e3007 }, + { AR_PCIE_SERDES2, 0x00000000 }, +}; Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Tue Feb 24 00:53:10 2009 (r188978) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Tue Feb 24 01:07:06 2009 (r188979) @@ -28,6 +28,8 @@ #include "ar5416/ar5416.ini" +static void ar5416ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore); + static void ar5416AniSetup(struct ath_hal *ah) { @@ -76,6 +78,7 @@ ar5416InitState(struct ath_hal_5416 *ahp ah->ah_reset = ar5416Reset; ah->ah_phyDisable = ar5416PhyDisable; ah->ah_disable = ar5416Disable; + ah->ah_configPCIE = ar5416ConfigPCIE; ah->ah_perCalibration = ar5416PerCalibration; ah->ah_perCalibrationN = ar5416PerCalibrationN, ah->ah_resetCalValid = ar5416ResetCalValid, @@ -219,6 +222,7 @@ ar5416Attach(uint16_t devid, HAL_SOFTC s val = OS_REG_READ(ah, AR_SREV) & AR_SREV_ID; AH_PRIVATE(ah)->ah_macVersion = val >> AR_SREV_ID_S; AH_PRIVATE(ah)->ah_macRev = val & AR_SREV_REVISION; + AH_PRIVATE(ah)->ah_ispcie = (devid == AR5416_DEVID_PCIE); /* setup common ini data; rf backends handle remainder */ HAL_INI_INIT(&ahp->ah_ini_modes, ar5416Modes, 6); @@ -244,6 +248,9 @@ ar5416Attach(uint16_t devid, HAL_SOFTC s HAL_INI_VAL((struct ini *)&AH5416(ah)->ah_ini_addac, 31, 1) = 0; } + HAL_INI_INIT(&AH5416(ah)->ah_ini_pcieserdes, ar5416PciePhy, 2); + ar5416AttachPCIE(ah); + ecode = ath_hal_v14EepromAttach(ah); if (ecode != HAL_OK) goto bad; @@ -368,6 +375,26 @@ ar5416Detach(struct ath_hal *ah) ath_hal_free(ah); } +void +ar5416AttachPCIE(struct ath_hal *ah) +{ + if (AH_PRIVATE(ah)->ah_ispcie) + ath_hal_configPCIE(ah, AH_FALSE); + else + ath_hal_disablePCIE(ah); +} + +static void +ar5416ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore) +{ + if (AH_PRIVATE(ah)->ah_ispcie && !restore) { + ath_hal_ini_write(ah, &AH5416(ah)->ah_ini_pcieserdes, 1, 0); + OS_DELAY(1000); + OS_REG_SET_BIT(ah, AR_PCIE_PM_CTRL, AR_PCIE_PM_CTRL_ENA); + OS_REG_WRITE(ah, AR_WA, AR_WA_DEFAULT); + } +} + /* * Fill all software cached or static hardware state information. * Return failure if capabilities are to come from EEPROM and Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Tue Feb 24 00:53:10 2009 (r188978) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Tue Feb 24 01:07:06 2009 (r188979) @@ -31,6 +31,8 @@ #define AR_GTTM 0x0068 /* global transmit timeout mode */ #define AR_CST 0x006C /* carrier sense timeout */ #define AR_MAC_LED 0x1f04 /* LED control */ +#define AR_WA 0x4004 /* PCIE work-arounds */ +#define AR_PCIE_PM_CTRL 0x4014 #define AR_AHB_MODE 0x4024 /* AHB mode for dma */ #define AR_INTR_SYNC_CAUSE_CLR 0x4028 /* clear interrupt */ #define AR_INTR_SYNC_CAUSE 0x4028 /* check pending interrupts */ @@ -185,6 +187,17 @@ #define AR_MAC_LED_ASSOC_PEND 0x00000800 /* STA is trying to associate */ #define AR_MAC_LED_ASSOC_S 10 +#define AR_WA_UNTIE_RESET_EN 0x00008000 /* ena PCI reset to POR */ +#define AR_WA_RESET_EN 0x00040000 /* ena AR_WA_UNTIE_RESET_EN */ +#define AR_WA_ANALOG_SHIFT 0x00100000 +#define AR_WA_POR_SHORT 0x00200000 /* PCIE phy reset control */ + +#define AR_WA_DEFAULT 0x0000073f +#define AR9280_WA_DEFAULT 0x0040073f +#define AR9285_WA_DEFAULT 0x004a05cb + +#define AR_PCIE_PM_CTRL_ENA 0x00080000 + #define AR_AHB_EXACT_WR_EN 0x00000000 /* write exact bytes */ #define AR_AHB_BUF_WR_EN 0x00000001 /* buffer write upto cacheline*/ #define AR_AHB_EXACT_RD_EN 0x00000000 /* read exact bytes */ Modified: head/sys/dev/ath/ath_hal/ar5416/ar9160.ini ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar9160.ini Tue Feb 24 00:53:10 2009 (r188978) +++ head/sys/dev/ath/ath_hal/ar5416/ar9160.ini Tue Feb 24 01:07:06 2009 (r188979) @@ -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: ar9160.ini,v 1.5 2008/11/10 04:08:05 sam Exp $ + * $FreeBSD$ */ /* Auto Generated PCI Register Writes. Created: 05/22/08 */ @@ -697,3 +697,17 @@ static const uint32_t ar9160Addac_1_1[][ {0x0000989c, 0x00000000 }, {0x000098cc, 0x00000000 }, }; + +/* hand-crafted from code that does explicit register writes */ +static const uint32_t ar9160PciePhy[][2] = { + { AR_PCIE_SERDES, 0x9248fc00 }, + { AR_PCIE_SERDES, 0x24924924 }, + { AR_PCIE_SERDES, 0x28000039 }, + { AR_PCIE_SERDES, 0x53160824 }, + { AR_PCIE_SERDES, 0xe5980579 }, + { AR_PCIE_SERDES, 0x001defff }, + { AR_PCIE_SERDES, 0x1aaabe40 }, + { AR_PCIE_SERDES, 0xbe105554 }, + { AR_PCIE_SERDES, 0x000e3007 }, + { AR_PCIE_SERDES2, 0x00000000 }, +}; Modified: head/sys/dev/ath/ath_hal/ar5416/ar9160_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar9160_attach.c Tue Feb 24 00:53:10 2009 (r188978) +++ head/sys/dev/ath/ath_hal/ar5416/ar9160_attach.c Tue Feb 24 01:07:06 2009 (r188979) @@ -148,7 +148,7 @@ ar9160Attach(uint16_t devid, HAL_SOFTC s AH_PRIVATE(ah)->ah_macVersion = (val & AR_XSREV_VERSION) >> AR_XSREV_TYPE_S; AH_PRIVATE(ah)->ah_macRev = MS(val, AR_XSREV_REVISION); - /* XXX extract pcie info */ + AH_PRIVATE(ah)->ah_ispcie = (val & AR_XSREV_TYPE_HOST_MODE) == 0; /* setup common ini data; rf backends handle remainder */ HAL_INI_INIT(&ahp->ah_ini_modes, ar9160Modes, 6); @@ -170,6 +170,9 @@ ar9160Attach(uint16_t devid, HAL_SOFTC s if (ecode != HAL_OK) goto bad; + HAL_INI_INIT(&AH5416(ah)->ah_ini_pcieserdes, ar9160PciePhy, 2); + ar5416AttachPCIE(ah); + if (!ar5416ChipReset(ah, AH_NULL)) { /* reset chip */ HALDEBUG(ah, HAL_DEBUG_ANY, "%s: chip reset failed\n", __func__); ecode = HAL_EIO; From owner-svn-src-head@FreeBSD.ORG Tue Feb 24 01:09:33 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A528106564A; Tue, 24 Feb 2009 01:09:33 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.freebsd.org (Postfix) with ESMTP id 1EED68FC08; Tue, 24 Feb 2009 01:09:32 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from trouble.errno.com (trouble.errno.com [10.0.0.248]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id n1O19WbP021277 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 23 Feb 2009 17:09:32 -0800 (PST) (envelope-from sam@freebsd.org) Message-ID: <49A348CC.9070305@freebsd.org> Date: Mon, 23 Feb 2009 17:09:32 -0800 From: Sam Leffler Organization: FreeBSD Project User-Agent: Thunderbird 2.0.0.18 (X11/20081209) MIME-Version: 1.0 To: src-committers@freebsd.org References: <200902240107.n1O176dq046398@svn.freebsd.org> In-Reply-To: <200902240107.n1O176dq046398@svn.freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-DCC-sonic.net-Metrics: ebb.errno.com; whitelist Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r188979 - in head/sys/dev/ath/ath_hal: . ar5210 ar5211 ar5212 ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Feb 2009 01:09:33 -0000 Sam Leffler wrote: > Author: sam > Date: Tue Feb 24 01:07:06 2009 > New Revision: 188979 > URL: http://svn.freebsd.org/changeset/base/188979 > > Log: > Add PCIE power control api: > o add ah_configPCIE and ah_disablePCIE for drivers to configure PCIE > power save operation (modeled after ath9k, may need changes) > o add private state flag to indicate if device is PCIE (replaces private > hack in 5212 code) > o add serdes programming ini bits for 5416 and later parts and setup > for each part (5416 and 9160 logic hand-crafted from existing routines); > 5212 remains open-coded but is now hooked in via ah_configPCIE > o add PCIE workaround gunk > o add ar5416AttachPCIE for iodomatic code used by 5416 and later parts > Note this _may_ reduce power consumption for pcie cards; no promises. Still need to hookup to the driver for suspend/resume so beware of regressions (I think worst case it'll just drop back to the previous power usage). Sam From owner-svn-src-head@FreeBSD.ORG Tue Feb 24 01:16:41 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4BBB106566B; Tue, 24 Feb 2009 01:16:41 +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 884818FC19; Tue, 24 Feb 2009 01:16:41 +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 n1O1Gfkw046619; Tue, 24 Feb 2009 01:16:41 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1O1GfXv046616; Tue, 24 Feb 2009 01:16:41 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902240116.n1O1GfXv046616@svn.freebsd.org> From: Sam Leffler Date: Tue, 24 Feb 2009 01:16:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188980 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Feb 2009 01:16:42 -0000 Author: sam Date: Tue Feb 24 01:16:40 2009 New Revision: 188980 URL: http://svn.freebsd.org/changeset/base/188980 Log: move attach debug msg to the rf backend Modified: head/sys/dev/ath/ath_hal/ar5416/ar2133.c head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c head/sys/dev/ath/ath_hal/ar5416/ar9160_attach.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar2133.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar2133.c Tue Feb 24 01:07:06 2009 (r188979) +++ head/sys/dev/ath/ath_hal/ar5416/ar2133.c Tue Feb 24 01:16:40 2009 (r188980) @@ -415,6 +415,8 @@ ar2133RfAttach(struct ath_hal *ah, HAL_S struct ar2133State *priv; uint32_t *bankData; + HALDEBUG(ah, HAL_DEBUG_ATTACH, "%s: attach AR2133 radio\n", __func__); + HALASSERT(ahp->ah_rfHal == AH_NULL); priv = ath_hal_malloc(sizeof(struct ar2133State) + AH5416(ah)->ah_ini_bank0.rows * sizeof(uint32_t) Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Tue Feb 24 01:07:06 2009 (r188979) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Tue Feb 24 01:16:40 2009 (r188980) @@ -336,8 +336,6 @@ ar5416Attach(uint16_t devid, HAL_SOFTC s if (ahp->ah_miscMode != 0) OS_REG_WRITE(ah, AR_MISC_MODE, ahp->ah_miscMode); - HALDEBUG(ah, HAL_DEBUG_ATTACH, "%s: Attaching AR2133 radio\n", - __func__); rfStatus = ar2133RfAttach(ah, &ecode); if (!rfStatus) { HALDEBUG(ah, HAL_DEBUG_ANY, "%s: RF setup failed, status %u\n", Modified: head/sys/dev/ath/ath_hal/ar5416/ar9160_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar9160_attach.c Tue Feb 24 01:07:06 2009 (r188979) +++ head/sys/dev/ath/ath_hal/ar5416/ar9160_attach.c Tue Feb 24 01:16:40 2009 (r188980) @@ -215,8 +215,6 @@ ar9160Attach(uint16_t devid, HAL_SOFTC s goto bad; #endif } - HALDEBUG(ah, HAL_DEBUG_ATTACH, "%s: Attaching AR2133 radio\n", - __func__); rfStatus = ar2133RfAttach(ah, &ecode); if (!rfStatus) { HALDEBUG(ah, HAL_DEBUG_ANY, "%s: RF setup failed, status %u\n", From owner-svn-src-head@FreeBSD.ORG Tue Feb 24 02:15:15 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D9D2106564A; Tue, 24 Feb 2009 02:15:15 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout011.mac.com (asmtpout011.mac.com [17.148.16.86]) by mx1.freebsd.org (Postfix) with ESMTP id 2645A8FC14; Tue, 24 Feb 2009 02:15:15 +0000 (UTC) (envelope-from xcllnt@mac.com) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed Received: from rkreddy-lt.jnpr.net (natint3.juniper.net [66.129.224.36]) by asmtp011.mac.com (Sun Java(tm) System Messaging Server 6.3-7.03 (built Aug 7 2008; 32bit)) with ESMTPSA id <0KFJ00ERCSX06B10@asmtp011.mac.com>; Mon, 23 Feb 2009 18:15:01 -0800 (PST) Message-id: <4B38CBCB-F964-44D1-BA51-40F7037978B6@mac.com> From: Marcel Moolenaar To: Rafal Jaworowski In-reply-to: <200902231822.n1NIMoPN032186@svn.freebsd.org> Date: Mon, 23 Feb 2009 18:15:00 -0800 References: <200902231822.n1NIMoPN032186@svn.freebsd.org> X-Mailer: Apple Mail (2.930.3) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r188941 - in head: . gnu/usr.bin/gdb gnu/usr.bin/gdb/gdbserver X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Feb 2009 02:15:15 -0000 On Feb 23, 2009, at 10:22 AM, Rafal Jaworowski wrote: > Author: raj > Date: Mon Feb 23 18:22:49 2009 > New Revision: 188941 > URL: http://svn.freebsd.org/changeset/base/188941 > > Log: > Initial gdbserver support for PowerPC. > > Obtained from: Juniper Networks, Semihalf Thanks Rafal! -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-head@FreeBSD.ORG Tue Feb 24 03:34:05 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 805C9106564A; Tue, 24 Feb 2009 03:34:05 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6D1F58FC1A; Tue, 24 Feb 2009 03:34:05 +0000 (UTC) (envelope-from thompsa@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 n1O3Y53e049409; Tue, 24 Feb 2009 03:34:05 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1O3Y50B049405; Tue, 24 Feb 2009 03:34:05 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902240334.n1O3Y50B049405@svn.freebsd.org> From: Andrew Thompson Date: Tue, 24 Feb 2009 03:34:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188981 - in head/sys/dev/usb: . input quirk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Feb 2009 03:34:06 -0000 Author: thompsa Date: Tue Feb 24 03:34:05 2009 New Revision: 188981 URL: http://svn.freebsd.org/changeset/base/188981 Log: MFp4 //depot/projects/usb; 157814, 157863, 157868 - The software computed HID size is not always correct, because the algoritm does not handle unsorted HID descriptors. - Change the way we obtain the report ID. - Use the X/Y/Z+button locations instead for report ID source for ums. - Add more range checks. - Remove Microsoft Mouse quirks. If the positions are moduloed the report length multiplied by 8, the values seem correct. - Some minor style changes. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/input/ums.c head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/usb_hid.c head/sys/dev/usb/usb_hid.h Modified: head/sys/dev/usb/input/ums.c ============================================================================== --- head/sys/dev/usb/input/ums.c Tue Feb 24 01:16:40 2009 (r188980) +++ head/sys/dev/usb/input/ums.c Tue Feb 24 03:34:05 2009 (r188981) @@ -87,8 +87,7 @@ SYSCTL_INT(_hw_usb2_ums, OID_AUTO, debug enum { UMS_INTR_DT, - UMS_INTR_CS, - UMS_N_TRANSFER = 2, + UMS_N_TRANSFER, }; struct ums_softc { @@ -113,9 +112,8 @@ struct ums_softc { #define UMS_FLAG_Z_AXIS 0x0004 #define UMS_FLAG_T_AXIS 0x0008 #define UMS_FLAG_SBU 0x0010 /* spurious button up events */ -#define UMS_FLAG_INTR_STALL 0x0020 /* set if transfer error */ -#define UMS_FLAG_REVZ 0x0040 /* Z-axis is reversed */ -#define UMS_FLAG_W_AXIS 0x0080 +#define UMS_FLAG_REVZ 0x0020 /* Z-axis is reversed */ +#define UMS_FLAG_W_AXIS 0x0040 uint8_t sc_buttons; uint8_t sc_iid; @@ -124,7 +122,6 @@ struct ums_softc { static void ums_put_queue_timeout(void *__sc); -static usb2_callback_t ums_clear_stall_callback; static usb2_callback_t ums_intr_callback; static device_probe_t ums_probe; @@ -159,19 +156,6 @@ ums_put_queue_timeout(void *__sc) } static void -ums_clear_stall_callback(struct usb2_xfer *xfer) -{ - struct ums_softc *sc = xfer->priv_sc; - struct usb2_xfer *xfer_other = sc->sc_xfer[UMS_INTR_DT]; - - if (usb2_clear_stall_callback(xfer, xfer_other)) { - DPRINTF("stall cleared\n"); - sc->sc_flags &= ~UMS_FLAG_INTR_STALL; - usb2_transfer_start(xfer_other); - } -} - -static void ums_intr_callback(struct usb2_xfer *xfer) { struct ums_softc *sc = xfer->priv_sc; @@ -194,9 +178,9 @@ ums_intr_callback(struct usb2_xfer *xfer sizeof(sc->sc_temp)); len = sizeof(sc->sc_temp); } - if (len == 0) { + if (len == 0) goto tr_setup; - } + usb2_copy_out(xfer->frbuffers, 0, buf, len); DPRINTFN(6, "data = %02x %02x %02x %02x " @@ -207,21 +191,23 @@ ums_intr_callback(struct usb2_xfer *xfer (len > 6) ? buf[6] : 0, (len > 7) ? buf[7] : 0); /* - * The M$ Wireless Intellimouse 2.0 sends 1 extra leading byte - * of data compared to most USB mice. This byte frequently - * switches from 0x01 (usual state) to 0x02. I assume it is to - * allow extra, non-standard, reporting (say battery-life). + * The M$ Wireless Intellimouse 2.0 sends 1 extra + * leading byte of data compared to most USB + * mice. This byte frequently switches from 0x01 + * (usual state) to 0x02. I assume it is to allow + * extra, non-standard, reporting (say battery-life). * - * However at the same time it generates a left-click message - * on the button byte which causes spurious left-click's where - * there shouldn't be. This should sort that. Currently it's - * the only user of UMS_FLAG_T_AXIS so use it as an - * identifier. + * However at the same time it generates a left-click + * message on the button byte which causes spurious + * left-click's where there shouldn't be. This should + * sort that. Currently it's the only user of + * UMS_FLAG_T_AXIS so use it as an identifier. * * - * UPDATE: This problem affects the M$ Wireless Notebook Optical Mouse, - * too. However, the leading byte for this mouse is normally 0x11, - * and the phantom mouse click occurs when its 0x14. + * UPDATE: This problem affects the M$ Wireless + * Notebook Optical Mouse, too. However, the leading + * byte for this mouse is normally 0x11, and the + * phantom mouse click occurs when its 0x14. * * We probably should switch to some more official quirk. */ @@ -287,12 +273,14 @@ ums_intr_callback(struct usb2_xfer *xfer */ /* - * The Qtronix keyboard has a built in PS/2 port for a mouse. - * The firmware once in a while posts a spurious button up - * event. This event we ignore by doing a timeout for 50 msecs. - * If we receive dx=dy=dz=buttons=0 before we add the event to - * the queue. - * In any other case we delete the timeout event. + * The Qtronix keyboard has a built in PS/2 + * port for a mouse. The firmware once in a + * while posts a spurious button up + * event. This event we ignore by doing a + * timeout for 50 msecs. If we receive + * dx=dy=dz=buttons=0 before we add the event + * to the queue. In any other case we delete + * the timeout event. */ if ((sc->sc_flags & UMS_FLAG_SBU) && (dx == 0) && (dy == 0) && (dz == 0) && (dt == 0) && @@ -309,25 +297,21 @@ ums_intr_callback(struct usb2_xfer *xfer } case USB_ST_SETUP: tr_setup: - if (sc->sc_flags & UMS_FLAG_INTR_STALL) { - usb2_transfer_start(sc->sc_xfer[UMS_INTR_CS]); - } else { - /* check if we can put more data into the FIFO */ - if (usb2_fifo_put_bytes_max( - sc->sc_fifo.fp[USB_FIFO_RX]) != 0) { - xfer->frlengths[0] = xfer->max_data_length; - usb2_start_hardware(xfer); - } + /* check if we can put more data into the FIFO */ + if (usb2_fifo_put_bytes_max( + sc->sc_fifo.fp[USB_FIFO_RX]) != 0) { + xfer->frlengths[0] = xfer->max_data_length; + usb2_start_hardware(xfer); } - return; + break; default: /* Error */ if (xfer->error != USB_ERR_CANCELLED) { - /* start clear stall */ - sc->sc_flags |= UMS_FLAG_INTR_STALL; - usb2_transfer_start(sc->sc_xfer[UMS_INTR_CS]); + /* try clear stall first */ + xfer->flags.stall_pipe = 1; + goto tr_setup; } - return; + break; } } @@ -341,16 +325,6 @@ static const struct usb2_config ums_conf .mh.bufsize = 0, /* use wMaxPacketSize */ .mh.callback = &ums_intr_callback, }, - - [UMS_INTR_CS] = { - .type = UE_CONTROL, - .endpoint = 0x00, /* Control pipe */ - .direction = UE_DIR_ANY, - .mh.bufsize = sizeof(struct usb2_device_request), - .mh.callback = &ums_clear_stall_callback, - .mh.timeout = 1000, /* 1 second */ - .mh.interval = 50, /* 50ms */ - }, }; static int @@ -359,39 +333,34 @@ ums_probe(device_t dev) struct usb2_attach_arg *uaa = device_get_ivars(dev); struct usb2_interface_descriptor *id; void *d_ptr; - int32_t error = 0; + int error; uint16_t d_len; DPRINTFN(11, "\n"); - if (uaa->usb2_mode != USB_MODE_HOST) { + if (uaa->usb2_mode != USB_MODE_HOST) return (ENXIO); - } - if (uaa->iface == NULL) { - return (ENXIO); - } + id = usb2_get_interface_descriptor(uaa->iface); if ((id == NULL) || - (id->bInterfaceClass != UICLASS_HID)) { + (id->bInterfaceClass != UICLASS_HID)) return (ENXIO); - } - error = usb2_req_get_hid_desc - (uaa->device, &Giant, + + error = usb2_req_get_hid_desc(uaa->device, &Giant, &d_ptr, &d_len, M_TEMP, uaa->info.bIfaceIndex); - if (error) { + if (error) return (ENXIO); - } + if (hid_is_collection(d_ptr, d_len, - HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_MOUSE))) { + HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_MOUSE))) error = 0; - } else if ((id->bInterfaceSubClass == UISUBCLASS_BOOT) && - (id->bInterfaceProtocol == UIPROTO_MOUSE)) { + else if ((id->bInterfaceSubClass == UISUBCLASS_BOOT) && + (id->bInterfaceProtocol == UIPROTO_MOUSE)) error = 0; - } else { + else error = ENXIO; - } free(d_ptr, M_TEMP); return (error); @@ -404,9 +373,10 @@ ums_attach(device_t dev) struct ums_softc *sc = device_get_softc(dev); void *d_ptr = NULL; int unit = device_get_unit(dev); - int32_t isize; + int isize; + int isizebits; + int err; uint32_t flags; - int32_t err; uint16_t d_len; uint8_t i; @@ -443,14 +413,14 @@ ums_attach(device_t dev) goto detach; } if (hid_locate(d_ptr, d_len, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_X), - hid_input, &sc->sc_loc_x, &flags)) { + hid_input, &sc->sc_loc_x, &flags, &sc->sc_iid)) { if ((flags & MOUSE_FLAGS_MASK) == MOUSE_FLAGS) { sc->sc_flags |= UMS_FLAG_X_AXIS; } } if (hid_locate(d_ptr, d_len, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_Y), - hid_input, &sc->sc_loc_y, &flags)) { + hid_input, &sc->sc_loc_y, &flags, &sc->sc_iid)) { if ((flags & MOUSE_FLAGS_MASK) == MOUSE_FLAGS) { sc->sc_flags |= UMS_FLAG_Y_AXIS; @@ -458,9 +428,9 @@ ums_attach(device_t dev) } /* Try the wheel first as the Z activator since it's tradition. */ if (hid_locate(d_ptr, d_len, HID_USAGE2(HUP_GENERIC_DESKTOP, - HUG_WHEEL), hid_input, &sc->sc_loc_z, &flags) || + HUG_WHEEL), hid_input, &sc->sc_loc_z, &flags, &sc->sc_iid) || hid_locate(d_ptr, d_len, HID_USAGE2(HUP_GENERIC_DESKTOP, - HUG_TWHEEL), hid_input, &sc->sc_loc_z, &flags)) { + HUG_TWHEEL), hid_input, &sc->sc_loc_z, &flags, &sc->sc_iid)) { if ((flags & MOUSE_FLAGS_MASK) == MOUSE_FLAGS) { sc->sc_flags |= UMS_FLAG_Z_AXIS; } @@ -469,14 +439,14 @@ ums_attach(device_t dev) * put the Z on the W coordinate. */ if (hid_locate(d_ptr, d_len, HID_USAGE2(HUP_GENERIC_DESKTOP, - HUG_Z), hid_input, &sc->sc_loc_w, &flags)) { + HUG_Z), hid_input, &sc->sc_loc_w, &flags, &sc->sc_iid)) { if ((flags & MOUSE_FLAGS_MASK) == MOUSE_FLAGS) { sc->sc_flags |= UMS_FLAG_W_AXIS; } } } else if (hid_locate(d_ptr, d_len, HID_USAGE2(HUP_GENERIC_DESKTOP, - HUG_Z), hid_input, &sc->sc_loc_z, &flags)) { + HUG_Z), hid_input, &sc->sc_loc_z, &flags, &sc->sc_iid)) { if ((flags & MOUSE_FLAGS_MASK) == MOUSE_FLAGS) { sc->sc_flags |= UMS_FLAG_Z_AXIS; @@ -490,7 +460,7 @@ ums_attach(device_t dev) * TWHEEL */ if (hid_locate(d_ptr, d_len, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_TWHEEL), - hid_input, &sc->sc_loc_t, &flags)) { + hid_input, &sc->sc_loc_t, &flags, &sc->sc_iid)) { sc->sc_loc_t.pos += 8; @@ -502,14 +472,14 @@ ums_attach(device_t dev) for (i = 0; i < UMS_BUTTON_MAX; i++) { if (!hid_locate(d_ptr, d_len, HID_USAGE2(HUP_BUTTON, (i + 1)), - hid_input, &sc->sc_loc_btn[i], NULL)) { + hid_input, &sc->sc_loc_btn[i], NULL, &sc->sc_iid)) { break; } } sc->sc_buttons = i; - isize = hid_report_size(d_ptr, d_len, hid_input, &sc->sc_iid); + isize = hid_report_size(d_ptr, d_len, hid_input, NULL); /* * The Microsoft Wireless Notebook Optical Mouse seems to be in worse @@ -533,27 +503,23 @@ ums_attach(device_t dev) sc->sc_loc_btn[1].pos = 9; sc->sc_loc_btn[2].pos = 10; } + /* - * The Microsoft Wireless Notebook Optical Mouse 3000 Model 1049 has - * five Report IDs: 19 23 24 17 18 (in the order they appear in report - * descriptor), it seems that report id 17 contains the necessary - * mouse information(3-buttons,X,Y,wheel) so we specify it manually. + * Some Microsoft devices have incorrectly high location + * positions. Correct this: */ - if ((uaa->info.idVendor == USB_VENDOR_MICROSOFT) && - (uaa->info.idProduct == USB_PRODUCT_MICROSOFT_WLNOTEBOOK3)) { - sc->sc_flags = (UMS_FLAG_X_AXIS | - UMS_FLAG_Y_AXIS | - UMS_FLAG_Z_AXIS); - sc->sc_buttons = 3; - isize = 5; - sc->sc_iid = 17; - sc->sc_loc_x.pos = 8; - sc->sc_loc_y.pos = 16; - sc->sc_loc_z.pos = 24; - sc->sc_loc_btn[0].pos = 0; - sc->sc_loc_btn[1].pos = 1; - sc->sc_loc_btn[2].pos = 2; + isizebits = isize * 8; + if ((sc->sc_iid != 0) && (isizebits > 8)) { + isizebits -= 8; /* remove size of report ID */ + sc->sc_loc_w.pos %= isizebits; + sc->sc_loc_x.pos %= isizebits; + sc->sc_loc_y.pos %= isizebits; + sc->sc_loc_z.pos %= isizebits; + sc->sc_loc_t.pos %= isizebits; + for (i = 0; i != UMS_BUTTON_MAX; i++) + sc->sc_loc_btn[i].pos %= isizebits; } + if (usb2_test_quirk(uaa, UQ_MS_REVZ)) { /* Some wheels need the Z axis reversed. */ sc->sc_flags |= UMS_FLAG_REVZ; @@ -668,7 +634,6 @@ ums_stop_read(struct usb2_fifo *fifo) { struct ums_softc *sc = fifo->priv_sc0; - usb2_transfer_stop(sc->sc_xfer[UMS_INTR_CS]); usb2_transfer_stop(sc->sc_xfer[UMS_INTR_DT]); usb2_callout_stop(&sc->sc_callout); } Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Tue Feb 24 01:16:40 2009 (r188980) +++ head/sys/dev/usb/quirk/usb_quirk.c Tue Feb 24 03:34:05 2009 (r188981) @@ -105,10 +105,7 @@ static struct usb2_quirk_entry usb2_quir {USB_QUIRK_ENTRY(USB_VENDOR_METAGEEK, USB_PRODUCT_METAGEEK_WISPY1B, 0x0000, 0xFFFF, UQ_KBD_IGNORE, UQ_HID_IGNORE, UQ_NONE)}, {USB_QUIRK_ENTRY(USB_VENDOR_TENX, USB_PRODUCT_TENX_UAUDIO0, 0x0101, 0x0101, UQ_AUDIO_SWAP_LR, UQ_NONE)}, /* MS keyboards do weird things */ - {USB_QUIRK_ENTRY(USB_VENDOR_MICROSOFT, USB_PRODUCT_MICROSOFT_WLNOTEBOOK, 0x0000, 0xFFFF, UQ_MS_BAD_CLASS, UQ_MS_LEADING_BYTE, UQ_NONE)}, - {USB_QUIRK_ENTRY(USB_VENDOR_MICROSOFT, USB_PRODUCT_MICROSOFT_WLNOTEBOOK2, 0x0000, 0xFFFF, UQ_MS_BAD_CLASS, UQ_MS_LEADING_BYTE, UQ_NONE)}, {USB_QUIRK_ENTRY(USB_VENDOR_MICROSOFT, USB_PRODUCT_MICROSOFT_WLINTELLIMOUSE, 0x0000, 0xFFFF, UQ_MS_LEADING_BYTE, UQ_NONE)}, - {USB_QUIRK_ENTRY(USB_VENDOR_MICROSOFT, USB_PRODUCT_MICROSOFT_COMFORT3000, 0x0000, 0xFFFF, UQ_MS_BAD_CLASS, UQ_MS_LEADING_BYTE, UQ_NONE)}, {USB_QUIRK_ENTRY(USB_VENDOR_METAGEEK, USB_PRODUCT_METAGEEK_WISPY24X, 0x0000, 0xFFFF, UQ_KBD_IGNORE, UQ_HID_IGNORE, UQ_NONE)}, }; Modified: head/sys/dev/usb/usb_hid.c ============================================================================== --- head/sys/dev/usb/usb_hid.c Tue Feb 24 01:16:40 2009 (r188980) +++ head/sys/dev/usb/usb_hid.c Tue Feb 24 03:34:05 2009 (r188981) @@ -155,7 +155,7 @@ top: } for (;;) { p = s->p; - if (p >= s->end) + if ((p >= s->end) || (p < s->start)) return (0); bSize = *p++; @@ -388,32 +388,53 @@ top: * hid_report_size *------------------------------------------------------------------------*/ int -hid_report_size(const void *buf, int len, enum hid_kind k, uint8_t *idp) +hid_report_size(const void *buf, int len, enum hid_kind k, uint8_t *id) { struct hid_data *d; struct hid_item h; - int hi, lo, size, id; + uint32_t temp; + uint32_t hpos; + uint32_t lpos; + uint8_t any_id; + + any_id = 0; + hpos = 0; + lpos = 0xFFFFFFFF; - id = 0; - hi = lo = -1; - for (d = hid_start_parse(buf, len, 1 << k); hid_get_item(d, &h);) + for (d = hid_start_parse(buf, len, 1 << k); hid_get_item(d, &h);) { if (h.kind == k) { - if (h.report_ID != 0 && !id) - id = h.report_ID; - if (h.report_ID == id) { - if (lo < 0) - lo = h.loc.pos; - hi = h.loc.pos + h.loc.size * h.loc.count; + /* check for ID-byte presense */ + if ((h.report_ID != 0) && !any_id) { + if (id != NULL) + *id = h.report_ID; + any_id = 1; } + /* compute minimum */ + if (lpos > h.loc.pos) + lpos = h.loc.pos; + /* compute end position */ + temp = h.loc.pos + (h.loc.size * h.loc.count); + /* compute maximum */ + if (hpos < temp) + hpos = temp; } + } hid_end_parse(d); - size = hi - lo; - if (id != 0) { - size += 8; - *idp = id; /* XXX wrong */ - } else - *idp = 0; - return ((size + 7) / 8); + + /* safety check - can happen in case of currupt descriptors */ + if (lpos > hpos) + temp = 0; + else + temp = hpos - lpos; + + /* check for ID byte */ + if (any_id) + temp += 8; + else if (id != NULL) + *id = 0; + + /* return length in bytes rounded up */ + return ((temp + 7) / 8); } /*------------------------------------------------------------------------* @@ -421,7 +442,7 @@ hid_report_size(const void *buf, int len *------------------------------------------------------------------------*/ int hid_locate(const void *desc, int size, uint32_t u, enum hid_kind k, - struct hid_location *loc, uint32_t *flags) + struct hid_location *loc, uint32_t *flags, uint8_t *id) { struct hid_data *d; struct hid_item h; @@ -432,12 +453,19 @@ hid_locate(const void *desc, int size, u *loc = h.loc; if (flags != NULL) *flags = h.flags; + if (id != NULL) + *id = h.report_ID; hid_end_parse(d); return (1); } } + if (loc != NULL) + loc->size = 0; + if (flags != NULL) + *flags = 0; + if (id != NULL) + *id = 0; hid_end_parse(d); - loc->size = 0; return (0); } @@ -450,26 +478,35 @@ hid_get_data(const uint8_t *buf, uint32_ uint32_t hpos = loc->pos; uint32_t hsize = loc->size; uint32_t data; - int i, s, t; + uint32_t rpos; + uint8_t n; DPRINTFN(11, "hid_get_data: loc %d/%d\n", hpos, hsize); + /* Range check and limit */ if (hsize == 0) return (0); + if (hsize > 32) + hsize = 32; + /* Get data in a safe way */ data = 0; - s = hpos / 8; - for (i = hpos; i < (hpos + hsize); i += 8) { - t = (i / 8); - if (t < len) { - data |= buf[t] << ((t - s) * 8); - } + rpos = (hpos / 8); + n = (hsize + 7) / 8; + rpos += n; + while (n--) { + rpos--; + if (rpos < len) + data |= buf[rpos] << (8 * n); } - data >>= hpos % 8; - data &= (1 << hsize) - 1; - hsize = 32 - hsize; - /* Sign extend */ - data = ((int32_t)data << hsize) >> hsize; + + /* Correctly shift down data */ + data = (data >> (hpos % 8)); + + /* Mask and sign extend in one */ + n = 32 - hsize; + data = ((int32_t)data << n) >> n; + DPRINTFN(11, "hid_get_data: loc %d/%d = %lu\n", loc->pos, loc->size, (long)data); return (data); Modified: head/sys/dev/usb/usb_hid.h ============================================================================== --- head/sys/dev/usb/usb_hid.h Tue Feb 24 01:16:40 2009 (r188980) +++ head/sys/dev/usb/usb_hid.h Tue Feb 24 03:34:05 2009 (r188981) @@ -79,9 +79,11 @@ struct hid_item { struct hid_data *hid_start_parse(const void *d, int len, int kindset); void hid_end_parse(struct hid_data *s); int hid_get_item(struct hid_data *s, struct hid_item *h); -int hid_report_size(const void *buf, int len, enum hid_kind k, uint8_t *id); +int hid_report_size(const void *buf, int len, enum hid_kind k, + uint8_t *id); int hid_locate(const void *desc, int size, uint32_t usage, - enum hid_kind kind, struct hid_location *loc, uint32_t *flags); + enum hid_kind kind, struct hid_location *loc, + uint32_t *flags, uint8_t *id); uint32_t hid_get_data(const uint8_t *buf, uint32_t len, struct hid_location *loc); int hid_is_collection(const void *desc, int size, uint32_t usage); From owner-svn-src-head@FreeBSD.ORG Tue Feb 24 03:38:24 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91F2B106566B; Tue, 24 Feb 2009 03:38:24 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7FC238FC23; Tue, 24 Feb 2009 03:38:24 +0000 (UTC) (envelope-from thompsa@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 n1O3cOEd049531; Tue, 24 Feb 2009 03:38:24 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1O3cOGe049530; Tue, 24 Feb 2009 03:38:24 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902240338.n1O3cOGe049530@svn.freebsd.org> From: Andrew Thompson Date: Tue, 24 Feb 2009 03:38:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188982 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Feb 2009 03:38:25 -0000 Author: thompsa Date: Tue Feb 24 03:38:24 2009 New Revision: 188982 URL: http://svn.freebsd.org/changeset/base/188982 Log: MFp4 //depot/projects/usb@157847 Improvements to "usb2_transfer_setup()" and "usb2_transfer_unsetup()". Set "ppxfer[n]" when the transfer setup is complete to prevent races. Remove redundant NULL-checks from "usb2_transfer_unsetup()". Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/usb_transfer.c Modified: head/sys/dev/usb/usb_transfer.c ============================================================================== --- head/sys/dev/usb/usb_transfer.c Tue Feb 24 03:34:05 2009 (r188981) +++ head/sys/dev/usb/usb_transfer.c Tue Feb 24 03:38:24 2009 (r188982) @@ -887,18 +887,14 @@ usb2_transfer_setup(struct usb2_device * parm.size[0] += ((-parm.size[0]) & (USB_HOST_ALIGN - 1)); if (buf) { - /* * Common initialization of the * "usb2_xfer" structure. */ xfer = USB_ADD_BYTES(buf, parm.size[0]); - - ppxfer[n] = xfer; xfer->address = udev->address; xfer->priv_sc = priv_sc; xfer->xroot = info; - info->setup_refcount++; usb2_callout_init_mtx(&xfer->timeout_handle, &udev->bus->bus_mtx, 0); @@ -915,9 +911,22 @@ usb2_transfer_setup(struct usb2_device * refcount++; } + /* set transfer pipe pointer */ + xfer->pipe = pipe; + parm.size[0] += sizeof(xfer[0]); + parm.methods = xfer->pipe->methods; + parm.curr_xfer = xfer; - xfer->pipe = pipe; + /* + * Call the Host or Device controller transfer + * setup routine: + */ + (udev->bus->methods->xfer_setup) (&parm); + + /* check for error */ + if (parm.err) + goto done; if (buf) { /* @@ -930,18 +939,19 @@ usb2_transfer_setup(struct usb2_device * * want more information. */ xfer->pipe->refcount++; - } - parm.methods = xfer->pipe->methods; - parm.curr_xfer = xfer; - /* - * Call the Host or Device controller transfer setup - * routine: - */ - (udev->bus->methods->xfer_setup) (&parm); + /* + * Whenever we set ppxfer[] then we + * also need to increment the + * "setup_refcount": + */ + info->setup_refcount++; - if (parm.err) { - goto done; + /* + * Transfer is successfully setup and + * can be used: + */ + ppxfer[n] = xfer; } } @@ -1121,72 +1131,60 @@ usb2_transfer_unsetup(struct usb2_xfer * while (n_setup--) { xfer = pxfer[n_setup]; - if (xfer) { - if (xfer->pipe) { - USB_XFER_LOCK(xfer); - USB_BUS_LOCK(xfer->xroot->bus); + if (xfer == NULL) + continue; - /* - * HINT: when you start/stop a transfer, it - * might be a good idea to directly use the - * "pxfer[]" structure: - * - * usb2_transfer_start(sc->pxfer[0]); - * usb2_transfer_stop(sc->pxfer[0]); - * - * That way, if your code has many parts that - * will not stop running under the same - * lock, in other words "xfer_mtx", the - * usb2_transfer_start and - * usb2_transfer_stop functions will simply - * return when they detect a NULL pointer - * argument. - * - * To avoid any races we clear the "pxfer[]" - * pointer while holding the private mutex - * of the driver: - */ - pxfer[n_setup] = NULL; + info = xfer->xroot; - USB_BUS_UNLOCK(xfer->xroot->bus); - USB_XFER_UNLOCK(xfer); + USB_XFER_LOCK(xfer); + USB_BUS_LOCK(info->bus); - usb2_transfer_drain(xfer); + /* + * HINT: when you start/stop a transfer, it might be a + * good idea to directly use the "pxfer[]" structure: + * + * usb2_transfer_start(sc->pxfer[0]); + * usb2_transfer_stop(sc->pxfer[0]); + * + * That way, if your code has many parts that will not + * stop running under the same lock, in other words + * "xfer_mtx", the usb2_transfer_start and + * usb2_transfer_stop functions will simply return + * when they detect a NULL pointer argument. + * + * To avoid any races we clear the "pxfer[]" pointer + * while holding the private mutex of the driver: + */ + pxfer[n_setup] = NULL; - if (xfer->flags_int.bdma_enable) { - needs_delay = 1; - } - /* - * NOTE: default pipe does not have an - * interface, even if pipe->iface_index == 0 - */ - xfer->pipe->refcount--; + USB_BUS_UNLOCK(info->bus); + USB_XFER_UNLOCK(xfer); - } else { - /* clear the transfer pointer */ - pxfer[n_setup] = NULL; - } + usb2_transfer_drain(xfer); - usb2_callout_drain(&xfer->timeout_handle); + if (xfer->flags_int.bdma_enable) + needs_delay = 1; - if (xfer->xroot) { - info = xfer->xroot; + /* + * NOTE: default pipe does not have an + * interface, even if pipe->iface_index == 0 + */ + xfer->pipe->refcount--; - USB_BUS_LOCK(info->bus); + usb2_callout_drain(&xfer->timeout_handle); - USB_ASSERT(info->setup_refcount != 0, - ("Invalid setup " - "reference count!\n")); + USB_BUS_LOCK(info->bus); - info->setup_refcount--; + USB_ASSERT(info->setup_refcount != 0, ("Invalid setup " + "reference count!\n")); - if (info->setup_refcount == 0) { - usb2_transfer_unsetup_sub(info, - needs_delay); - } else { - USB_BUS_UNLOCK(info->bus); - } - } + info->setup_refcount--; + + if (info->setup_refcount == 0) { + usb2_transfer_unsetup_sub(info, + needs_delay); + } else { + USB_BUS_UNLOCK(info->bus); } } } From owner-svn-src-head@FreeBSD.ORG Tue Feb 24 03:39:14 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A98E1065676; Tue, 24 Feb 2009 03:39:14 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 176158FC08; Tue, 24 Feb 2009 03:39:14 +0000 (UTC) (envelope-from thompsa@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 n1O3dExc049598; Tue, 24 Feb 2009 03:39:14 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1O3dDEb049586; Tue, 24 Feb 2009 03:39:13 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902240339.n1O3dDEb049586@svn.freebsd.org> From: Andrew Thompson Date: Tue, 24 Feb 2009 03:39:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188983 - in head/sys/dev/usb: . controller X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Feb 2009 03:39:14 -0000 Author: thompsa Date: Tue Feb 24 03:39:13 2009 New Revision: 188983 URL: http://svn.freebsd.org/changeset/base/188983 Log: MFp4 //depot/projects/usb@157853 Clean up old way of polling the USB hardware. The existing polling support was a bit hackish. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/controller/at91dci.c head/sys/dev/usb/controller/atmegadci.c head/sys/dev/usb/controller/ehci.c head/sys/dev/usb/controller/musb_otg.c head/sys/dev/usb/controller/ohci.c head/sys/dev/usb/controller/uhci.c head/sys/dev/usb/controller/uss820dci.c head/sys/dev/usb/usb_controller.h head/sys/dev/usb/usb_core.h head/sys/dev/usb/usb_ioctl.h head/sys/dev/usb/usb_request.c head/sys/dev/usb/usb_transfer.c Modified: head/sys/dev/usb/controller/at91dci.c ============================================================================== --- head/sys/dev/usb/controller/at91dci.c Tue Feb 24 03:38:24 2009 (r188982) +++ head/sys/dev/usb/controller/at91dci.c Tue Feb 24 03:39:13 2009 (r188983) @@ -260,23 +260,16 @@ static void at91dci_wakeup_peer(struct usb2_xfer *xfer) { 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->xroot->xfer_mtx) ? 1 : 0; AT91_UDP_WRITE_4(sc, AT91_UDP_GSTATE, AT91_UDP_GSTATE_ESR); /* wait 8 milliseconds */ - if (use_polling) { - /* polling */ - DELAY(8000); - } else { - /* Wait for reset to complete. */ - usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 125); - } + /* Wait for reset to complete. */ + usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 125); AT91_UDP_WRITE_4(sc, AT91_UDP_GSTATE, 0); } @@ -1826,7 +1819,6 @@ at91dci_root_ctrl_done(struct usb2_xfer struct at91dci_softc *sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); uint16_t value; uint16_t index; - uint8_t use_polling; USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); @@ -1844,8 +1836,6 @@ at91dci_root_ctrl_done(struct usb2_xfer value = UGETW(std->req.wValue); index = UGETW(std->req.wIndex); - use_polling = mtx_owned(xfer->xroot->xfer_mtx) ? 1 : 0; - /* demultiplex the control request */ switch (std->req.bmRequestType) { @@ -2459,7 +2449,6 @@ struct usb2_bus_methods at91dci_bus_meth .pipe_init = &at91dci_pipe_init, .xfer_setup = &at91dci_xfer_setup, .xfer_unsetup = &at91dci_xfer_unsetup, - .do_poll = &at91dci_do_poll, .get_hw_ep_profile = &at91dci_get_hw_ep_profile, .set_stall = &at91dci_set_stall, .clear_stall = &at91dci_clear_stall, Modified: head/sys/dev/usb/controller/atmegadci.c ============================================================================== --- head/sys/dev/usb/controller/atmegadci.c Tue Feb 24 03:38:24 2009 (r188982) +++ head/sys/dev/usb/controller/atmegadci.c Tue Feb 24 03:39:13 2009 (r188983) @@ -204,25 +204,18 @@ static void atmegadci_wakeup_peer(struct usb2_xfer *xfer) { struct atmegadci_softc *sc = ATMEGA_BUS2SC(xfer->xroot->bus); - uint8_t use_polling; uint8_t temp; if (!sc->sc_flags.status_suspend) { return; } - use_polling = mtx_owned(xfer->xroot->xfer_mtx) ? 1 : 0; temp = ATMEGA_READ_1(sc, ATMEGA_UDCON); ATMEGA_WRITE_1(sc, ATMEGA_UDCON, temp | ATMEGA_UDCON_RMWKUP); /* wait 8 milliseconds */ - if (use_polling) { - /* polling */ - DELAY(8000); - } else { - /* Wait for reset to complete. */ - usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 125); - } + /* Wait for reset to complete. */ + usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 125); /* hardware should have cleared RMWKUP bit */ } @@ -1695,7 +1688,6 @@ atmegadci_root_ctrl_done(struct usb2_xfe struct atmegadci_softc *sc = ATMEGA_BUS2SC(xfer->xroot->bus); uint16_t value; uint16_t index; - uint8_t use_polling; USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); @@ -1713,8 +1705,6 @@ atmegadci_root_ctrl_done(struct usb2_xfe value = UGETW(std->req.wValue); index = UGETW(std->req.wIndex); - use_polling = mtx_owned(xfer->xroot->xfer_mtx) ? 1 : 0; - /* demultiplex the control request */ switch (std->req.bmRequestType) { @@ -2319,7 +2309,6 @@ struct usb2_bus_methods atmegadci_bus_me .pipe_init = &atmegadci_pipe_init, .xfer_setup = &atmegadci_xfer_setup, .xfer_unsetup = &atmegadci_xfer_unsetup, - .do_poll = &atmegadci_do_poll, .get_hw_ep_profile = &atmegadci_get_hw_ep_profile, .set_stall = &atmegadci_set_stall, .clear_stall = &atmegadci_clear_stall, Modified: head/sys/dev/usb/controller/ehci.c ============================================================================== --- head/sys/dev/usb/controller/ehci.c Tue Feb 24 03:38:24 2009 (r188982) +++ head/sys/dev/usb/controller/ehci.c Tue Feb 24 03:39:13 2009 (r188983) @@ -3051,7 +3051,6 @@ ehci_root_ctrl_done(struct usb2_xfer *xf uint16_t value; uint16_t index; uint8_t l; - uint8_t use_polling; USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); @@ -3069,8 +3068,6 @@ ehci_root_ctrl_done(struct usb2_xfer *xf value = UGETW(std->req.wValue); index = UGETW(std->req.wIndex); - use_polling = mtx_owned(xfer->xroot->xfer_mtx) ? 1 : 0; - DPRINTFN(3, "type=0x%02x request=0x%02x wLen=0x%04x " "wValue=0x%04x wIndex=0x%04x\n", std->req.bmRequestType, std->req.bRequest, @@ -3217,23 +3214,13 @@ ehci_root_ctrl_done(struct usb2_xfer *xf EOWRITE4(sc, port, v | EHCI_PS_FPR); } /* wait 20ms for resume sequence to complete */ - if (use_polling) { - /* polling */ - DELAY(20000); - } else { - usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 50); - } + usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 50); EOWRITE4(sc, port, v & ~(EHCI_PS_SUSP | EHCI_PS_FPR | (3 << 10) /* High Speed */ )); - /* settle time */ - if (use_polling) { - /* polling */ - DELAY(4000); - } else { - usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 250); - } + /* 4ms settle time */ + usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 250); break; case UHF_PORT_POWER: EOWRITE4(sc, port, v & ~EHCI_PS_PP); @@ -3382,27 +3369,17 @@ ehci_root_ctrl_done(struct usb2_xfer *xf v &= ~(EHCI_PS_PE | EHCI_PS_PR); EOWRITE4(sc, port, v | EHCI_PS_PR); - if (use_polling) { - /* polling */ - DELAY(USB_PORT_ROOT_RESET_DELAY * 1000); - } else { - /* Wait for reset to complete. */ - usb2_pause_mtx(&sc->sc_bus.bus_mtx, - USB_MS_TO_TICKS(USB_PORT_ROOT_RESET_DELAY)); - } + /* Wait for reset to complete. */ + usb2_pause_mtx(&sc->sc_bus.bus_mtx, + USB_MS_TO_TICKS(USB_PORT_ROOT_RESET_DELAY)); /* Terminate reset sequence. */ if (!(sc->sc_flags & EHCI_SCFLG_NORESTERM)) EOWRITE4(sc, port, v); - if (use_polling) { - /* polling */ - DELAY(EHCI_PORT_RESET_COMPLETE * 1000); - } else { - /* Wait for HC to complete reset. */ - usb2_pause_mtx(&sc->sc_bus.bus_mtx, - USB_MS_TO_TICKS(EHCI_PORT_RESET_COMPLETE)); - } + /* Wait for HC to complete reset. */ + usb2_pause_mtx(&sc->sc_bus.bus_mtx, + USB_MS_TO_TICKS(EHCI_PORT_RESET_COMPLETE)); v = EOREAD4(sc, port); DPRINTF("ehci after reset, status=0x%08x\n", v); @@ -3956,7 +3933,6 @@ struct usb2_bus_methods ehci_bus_methods .pipe_init = ehci_pipe_init, .xfer_setup = ehci_xfer_setup, .xfer_unsetup = ehci_xfer_unsetup, - .do_poll = ehci_do_poll, .get_dma_delay = ehci_get_dma_delay, .device_resume = ehci_device_resume, .device_suspend = ehci_device_suspend, Modified: head/sys/dev/usb/controller/musb_otg.c ============================================================================== --- head/sys/dev/usb/controller/musb_otg.c Tue Feb 24 03:38:24 2009 (r188982) +++ head/sys/dev/usb/controller/musb_otg.c Tue Feb 24 03:39:13 2009 (r188983) @@ -206,25 +206,18 @@ musbotg_wakeup_peer(struct usb2_xfer *xf { struct musbotg_softc *sc = MUSBOTG_BUS2SC(xfer->xroot->bus); uint8_t temp; - uint8_t use_polling; if (!(sc->sc_flags.status_suspend)) { return; } - use_polling = mtx_owned(xfer->xroot->xfer_mtx) ? 1 : 0; temp = MUSB2_READ_1(sc, MUSB2_REG_POWER); temp |= MUSB2_MASK_RESUME; MUSB2_WRITE_1(sc, MUSB2_REG_POWER, temp); /* wait 8 milliseconds */ - if (use_polling) { - /* polling */ - DELAY(8000); - } else { - /* Wait for reset to complete. */ - usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 125); - } + /* Wait for reset to complete. */ + usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 125); temp = MUSB2_READ_1(sc, MUSB2_REG_POWER); temp &= ~MUSB2_MASK_RESUME; @@ -2232,7 +2225,6 @@ musbotg_root_ctrl_done(struct usb2_xfer struct musbotg_softc *sc = MUSBOTG_BUS2SC(xfer->xroot->bus); uint16_t value; uint16_t index; - uint8_t use_polling; USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); @@ -2250,8 +2242,6 @@ musbotg_root_ctrl_done(struct usb2_xfer value = UGETW(std->req.wValue); index = UGETW(std->req.wIndex); - use_polling = mtx_owned(xfer->xroot->xfer_mtx) ? 1 : 0; - /* demultiplex the control request */ switch (std->req.bmRequestType) { @@ -2867,7 +2857,6 @@ struct usb2_bus_methods musbotg_bus_meth .pipe_init = &musbotg_pipe_init, .xfer_setup = &musbotg_xfer_setup, .xfer_unsetup = &musbotg_xfer_unsetup, - .do_poll = &musbotg_do_poll, .get_hw_ep_profile = &musbotg_get_hw_ep_profile, .set_stall = &musbotg_set_stall, .clear_stall = &musbotg_clear_stall, Modified: head/sys/dev/usb/controller/ohci.c ============================================================================== --- head/sys/dev/usb/controller/ohci.c Tue Feb 24 03:38:24 2009 (r188982) +++ head/sys/dev/usb/controller/ohci.c Tue Feb 24 03:39:13 2009 (r188983) @@ -2156,7 +2156,6 @@ ohci_root_ctrl_done(struct usb2_xfer *xf uint16_t value; uint16_t index; uint8_t l; - uint8_t use_polling; USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); @@ -2174,8 +2173,6 @@ ohci_root_ctrl_done(struct usb2_xfer *xf value = UGETW(std->req.wValue); index = UGETW(std->req.wIndex); - use_polling = mtx_owned(xfer->xroot->xfer_mtx) ? 1 : 0; - DPRINTFN(3, "type=0x%02x request=0x%02x wLen=0x%04x " "wValue=0x%04x wIndex=0x%04x\n", std->req.bmRequestType, std->req.bRequest, @@ -2410,13 +2407,8 @@ ohci_root_ctrl_done(struct usb2_xfer *xf OWRITE4(sc, port, UPS_RESET); for (v = 0;; v++) { if (v < 12) { - if (use_polling) { - /* polling */ - DELAY(USB_PORT_ROOT_RESET_DELAY * 1000); - } else { - usb2_pause_mtx(&sc->sc_bus.bus_mtx, - USB_MS_TO_TICKS(USB_PORT_ROOT_RESET_DELAY)); - } + usb2_pause_mtx(&sc->sc_bus.bus_mtx, + USB_MS_TO_TICKS(USB_PORT_ROOT_RESET_DELAY)); if ((OREAD4(sc, port) & UPS_RESET) == 0) { break; @@ -2853,7 +2845,6 @@ struct usb2_bus_methods ohci_bus_methods .pipe_init = ohci_pipe_init, .xfer_setup = ohci_xfer_setup, .xfer_unsetup = ohci_xfer_unsetup, - .do_poll = ohci_do_poll, .get_dma_delay = ohci_get_dma_delay, .device_resume = ohci_device_resume, .device_suspend = ohci_device_suspend, Modified: head/sys/dev/usb/controller/uhci.c ============================================================================== --- head/sys/dev/usb/controller/uhci.c Tue Feb 24 03:38:24 2009 (r188982) +++ head/sys/dev/usb/controller/uhci.c Tue Feb 24 03:39:13 2009 (r188983) @@ -2382,7 +2382,7 @@ struct usb2_hub_descriptor_min uhci_hubd * events have been reset. */ static usb2_error_t -uhci_portreset(uhci_softc_t *sc, uint16_t index, uint8_t use_polling) +uhci_portreset(uhci_softc_t *sc, uint16_t index) { uint16_t port; uint16_t x; @@ -2406,23 +2406,14 @@ uhci_portreset(uhci_softc_t *sc, uint16_ UHCICMD(sc, (UHCI_CMD_MAXP | UHCI_CMD_RS)); /* wait a little bit */ - if (use_polling) { - DELAY(10000); - } else { - usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 100); - } + usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 100); } x = URWMASK(UREAD2(sc, port)); UWRITE2(sc, port, x | UHCI_PORTSC_PR); - if (use_polling) { - /* polling */ - DELAY(USB_PORT_ROOT_RESET_DELAY * 1000); - } else { - usb2_pause_mtx(&sc->sc_bus.bus_mtx, - USB_MS_TO_TICKS(USB_PORT_ROOT_RESET_DELAY)); - } + usb2_pause_mtx(&sc->sc_bus.bus_mtx, + USB_MS_TO_TICKS(USB_PORT_ROOT_RESET_DELAY)); DPRINTFN(4, "uhci port %d reset, status0 = 0x%04x\n", index, UREAD2(sc, port)); @@ -2449,13 +2440,8 @@ uhci_portreset(uhci_softc_t *sc, uint16_ for (lim = 0; lim < 12; lim++) { - if (use_polling) { - /* polling */ - DELAY(USB_PORT_RESET_DELAY * 1000); - } else { - usb2_pause_mtx(&sc->sc_bus.bus_mtx, - USB_MS_TO_TICKS(USB_PORT_RESET_DELAY)); - } + usb2_pause_mtx(&sc->sc_bus.bus_mtx, + USB_MS_TO_TICKS(USB_PORT_RESET_DELAY)); x = UREAD2(sc, port); @@ -2540,7 +2526,6 @@ uhci_root_ctrl_done(struct usb2_xfer *xf uint16_t index; uint16_t status; uint16_t change; - uint8_t use_polling; USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); @@ -2558,8 +2543,6 @@ uhci_root_ctrl_done(struct usb2_xfer *xf value = UGETW(std->req.wValue); index = UGETW(std->req.wIndex); - use_polling = mtx_owned(xfer->xroot->xfer_mtx) ? 1 : 0; - DPRINTFN(3, "type=0x%02x request=0x%02x wLen=0x%04x " "wValue=0x%04x wIndex=0x%04x\n", std->req.bmRequestType, std->req.bRequest, @@ -2779,12 +2762,7 @@ uhci_root_ctrl_done(struct usb2_xfer *xf UWRITE2(sc, port, URWMASK(x)); /* wait 20ms for resume sequence to complete */ - if (use_polling) { - /* polling */ - DELAY(20000); - } else { - usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 50); - } + usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 50); /* clear suspend and resume detect */ UWRITE2(sc, port, URWMASK(x) & ~(UHCI_PORTSC_RD | @@ -2831,7 +2809,7 @@ uhci_root_ctrl_done(struct usb2_xfer *xf UWRITE2(sc, port, x | UHCI_PORTSC_SUSP); break; case UHF_PORT_RESET: - std->err = uhci_portreset(sc, index, use_polling); + std->err = uhci_portreset(sc, index); goto done; case UHF_PORT_POWER: /* pretend we turned on power */ @@ -3372,7 +3350,6 @@ struct usb2_bus_methods uhci_bus_methods .pipe_init = uhci_pipe_init, .xfer_setup = uhci_xfer_setup, .xfer_unsetup = uhci_xfer_unsetup, - .do_poll = uhci_do_poll, .get_dma_delay = uhci_get_dma_delay, .device_resume = uhci_device_resume, .device_suspend = uhci_device_suspend, Modified: head/sys/dev/usb/controller/uss820dci.c ============================================================================== --- head/sys/dev/usb/controller/uss820dci.c Tue Feb 24 03:38:24 2009 (r188982) +++ head/sys/dev/usb/controller/uss820dci.c Tue Feb 24 03:39:13 2009 (r188983) @@ -1844,7 +1844,6 @@ uss820dci_root_ctrl_done(struct usb2_xfe struct uss820dci_softc *sc = USS820_DCI_BUS2SC(xfer->xroot->bus); uint16_t value; uint16_t index; - uint8_t use_polling; USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); @@ -1862,8 +1861,6 @@ uss820dci_root_ctrl_done(struct usb2_xfe value = UGETW(std->req.wValue); index = UGETW(std->req.wIndex); - use_polling = mtx_owned(xfer->xroot->xfer_mtx) ? 1 : 0; - /* demultiplex the control request */ switch (std->req.bmRequestType) { @@ -2481,7 +2478,6 @@ struct usb2_bus_methods uss820dci_bus_me .pipe_init = &uss820dci_pipe_init, .xfer_setup = &uss820dci_xfer_setup, .xfer_unsetup = &uss820dci_xfer_unsetup, - .do_poll = &uss820dci_do_poll, .get_hw_ep_profile = &uss820dci_get_hw_ep_profile, .set_stall = &uss820dci_set_stall, .clear_stall = &uss820dci_clear_stall, Modified: head/sys/dev/usb/usb_controller.h ============================================================================== --- head/sys/dev/usb/usb_controller.h Tue Feb 24 03:38:24 2009 (r188982) +++ head/sys/dev/usb/usb_controller.h Tue Feb 24 03:39:13 2009 (r188983) @@ -57,7 +57,6 @@ struct usb2_bus_methods { /* USB Device and Host mode - Mandatory */ void (*pipe_init) (struct usb2_device *udev, struct usb2_endpoint_descriptor *edesc, struct usb2_pipe *pipe); - void (*do_poll) (struct usb2_bus *); void (*xfer_setup) (struct usb2_setup_params *parm); void (*xfer_unsetup) (struct usb2_xfer *xfer); void (*get_dma_delay) (struct usb2_bus *, uint32_t *pdelay); Modified: head/sys/dev/usb/usb_core.h ============================================================================== --- head/sys/dev/usb/usb_core.h Tue Feb 24 03:38:24 2009 (r188982) +++ head/sys/dev/usb/usb_core.h Tue Feb 24 03:39:13 2009 (r188983) @@ -34,10 +34,6 @@ /* Default USB configuration */ -#ifndef USB_NO_POLL -#define USB_NO_POLL 0 -#endif - #ifndef USB_USE_CONDVAR #define USB_USE_CONDVAR 0 #endif Modified: head/sys/dev/usb/usb_ioctl.h ============================================================================== --- head/sys/dev/usb/usb_ioctl.h Tue Feb 24 03:38:24 2009 (r188982) +++ head/sys/dev/usb/usb_ioctl.h Tue Feb 24 03:39:13 2009 (r188983) @@ -48,7 +48,6 @@ struct usb2_read_dir { struct usb2_ctl_request { void *ucr_data; uint16_t ucr_flags; -#define USB_USE_POLLING 0x0001 /* internal flag */ #define USB_SHORT_XFER_OK 0x0004 /* allow short reads */ #define USB_DELAY_STATUS_STAGE 0x0010 /* insert delay before STATUS stage */ #define USB_USER_DATA_PTR 0x0020 /* internal flag */ Modified: head/sys/dev/usb/usb_request.c ============================================================================== --- head/sys/dev/usb/usb_request.c Tue Feb 24 03:38:24 2009 (r188982) +++ head/sys/dev/usb/usb_request.c Tue Feb 24 03:39:13 2009 (r188983) @@ -201,10 +201,6 @@ tr_setup: * o USB_SHORT_XFER_OK: allows the data transfer to be shorter than * specified * - * o USB_USE_POLLING: forces the transfer to complete from the - * current context by polling the interrupt handler. This flag can be - * used to perform USB transfers after that the kernel has crashed. - * * o USB_DELAY_STATUS_STAGE: allows the status stage to be performed * at a later point in time. This is tunable by the "hw.usb.ss_delay" * sysctl. This flag is mostly useful for debugging. @@ -385,12 +381,8 @@ usb2_do_request_flags(struct usb2_device usb2_transfer_start(xfer); while (usb2_transfer_pending(xfer)) { - if ((flags & USB_USE_POLLING) || cold) { - usb2_do_poll(udev->default_xfer, USB_DEFAULT_XFER_MAX); - } else { - usb2_cv_wait(udev->default_cv, - xfer->xroot->xfer_mtx); - } + usb2_cv_wait(udev->default_cv, + xfer->xroot->xfer_mtx); } err = xfer->error; Modified: head/sys/dev/usb/usb_transfer.c ============================================================================== --- head/sys/dev/usb/usb_transfer.c Tue Feb 24 03:38:24 2009 (r188982) +++ head/sys/dev/usb/usb_transfer.c Tue Feb 24 03:39:13 2009 (r188983) @@ -2705,120 +2705,14 @@ usb2_clear_stall_callback(struct usb2_xf return (1); /* Clear Stall Finished */ } -#if (USB_NO_POLL == 0) - -/*------------------------------------------------------------------------* - * usb2_callout_poll - *------------------------------------------------------------------------*/ -static void -usb2_callout_poll(struct usb2_xfer *xfer) -{ - struct usb2_callout *co; - void (*cb) (void *); - void *arg; - struct mtx *mtx; - uint32_t delta; - - if (xfer == NULL) { - return; - } - co = &xfer->timeout_handle; - -#if __FreeBSD_version >= 800000 - mtx = (void *)(co->co.c_lock); -#else - mtx = co->co.c_mtx; -#endif - mtx_lock(mtx); - - if (usb2_callout_pending(co)) { - delta = ticks - co->co.c_time; - if (!(delta & 0x80000000)) { - - cb = co->co.c_func; - arg = co->co.c_arg; - - /* timed out */ - usb2_callout_stop(co); - - (cb) (arg); - } - } - mtx_unlock(mtx); -} - - -/*------------------------------------------------------------------------* - * usb2_do_poll - * - * This function is called from keyboard driver when in polling - * mode. - *------------------------------------------------------------------------*/ void usb2_do_poll(struct usb2_xfer **ppxfer, uint16_t max) { - struct usb2_xfer *xfer; - struct usb2_xfer_root *xroot; - struct usb2_device *udev; - struct usb2_proc_msg *pm; - uint32_t to; - uint16_t n; - - /* compute system tick delay */ - to = ((uint32_t)(1000000)) / ((uint32_t)(hz)); - DELAY(to); - atomic_add_int((volatile int *)&ticks, 1); - - for (n = 0; n != max; n++) { - xfer = ppxfer[n]; - if (xfer) { - xroot = xfer->xroot; - udev = xroot->udev; - - /* - * Poll hardware - signal that we are polling by - * locking the private mutex: - */ - USB_XFER_LOCK(xfer); - (udev->bus->methods->do_poll) (udev->bus); - USB_XFER_UNLOCK(xfer); - - /* poll clear stall start */ - USB_BUS_LOCK(xfer->xroot->bus); - pm = &udev->cs_msg[0].hdr; - (pm->pm_callback) (pm); - USB_BUS_UNLOCK(xfer->xroot->bus); - - if (udev->default_xfer[1]) { - - /* poll timeout */ - usb2_callout_poll(udev->default_xfer[1]); - - /* poll clear stall done thread */ - USB_BUS_LOCK(xfer->xroot->bus); - pm = &udev->default_xfer[1]-> - xroot->done_m[0].hdr; - (pm->pm_callback) (pm); - USB_BUS_UNLOCK(xfer->xroot->bus); - } - /* poll timeout */ - usb2_callout_poll(xfer); - - /* poll done thread */ - USB_BUS_LOCK(xfer->xroot->bus); - pm = &xroot->done_m[0].hdr; - (pm->pm_callback) (pm); - USB_BUS_UNLOCK(xfer->xroot->bus); - } + static uint8_t once = 0; + /* polling is currently not supported */ + if (!once) { + once = 1; + printf("usb2_do_poll: USB polling is " + "not supported!\n"); } } - -#else - -void -usb2_do_poll(struct usb2_xfer **ppxfer, uint16_t max) -{ - /* polling not supported */ -} - -#endif From owner-svn-src-head@FreeBSD.ORG Tue Feb 24 03:40:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3726F10656C8; Tue, 24 Feb 2009 03:40:10 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 240D78FC2D; Tue, 24 Feb 2009 03:40:10 +0000 (UTC) (envelope-from thompsa@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 n1O3eAoT049657; Tue, 24 Feb 2009 03:40:10 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1O3eAIA049656; Tue, 24 Feb 2009 03:40:10 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902240340.n1O3eAIA049656@svn.freebsd.org> From: Andrew Thompson Date: Tue, 24 Feb 2009 03:40:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188984 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Feb 2009 03:40:10 -0000 Author: thompsa Date: Tue Feb 24 03:40:09 2009 New Revision: 188984 URL: http://svn.freebsd.org/changeset/base/188984 Log: MFp4 //depot/projects/usb@157855 Document short_frames_ok. Submitted by: Hans Petter Selasky Modified: head/share/man/man4/usb2_core.4 Modified: head/share/man/man4/usb2_core.4 ============================================================================== --- head/share/man/man4/usb2_core.4 Tue Feb 24 03:39:13 2009 (r188983) +++ head/share/man/man4/usb2_core.4 Tue Feb 24 03:40:09 2009 (r188984) @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd September 20, 2008 +.Dd February 17, 2009 .Dt USB2_CORE 4 .Os . @@ -459,6 +459,11 @@ operation. This flag allows the received transfer length, "xfer->actlen" to be less than "xfer->sumlen" upon completion of a transfer. This flag can be changed during operation. +.It short_frames_ok +This flag allows the reception of multiple short USB frames. This flag +only has effect for BULK and INTERRUPT endpoints and if the number of +frames received is greater than 1. This flag can be changed during +operation. .It pipe_bof This flag causes a failing USB transfer to remain first in the PIPE queue except in the case of "xfer->error" equal to From owner-svn-src-head@FreeBSD.ORG Tue Feb 24 03:40:49 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E904106564A; Tue, 24 Feb 2009 03:40:49 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0BFF48FC0A; Tue, 24 Feb 2009 03:40:49 +0000 (UTC) (envelope-from thompsa@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 n1O3em0c049705; Tue, 24 Feb 2009 03:40:48 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1O3emqi049701; Tue, 24 Feb 2009 03:40:48 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902240340.n1O3emqi049701@svn.freebsd.org> From: Andrew Thompson Date: Tue, 24 Feb 2009 03:40:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188985 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Feb 2009 03:40:49 -0000 Author: thompsa Date: Tue Feb 24 03:40:48 2009 New Revision: 188985 URL: http://svn.freebsd.org/changeset/base/188985 Log: MFp4 //depot/projects/usb@157909 Changes to make implementing USB NDIS easier. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/usb_device.c head/sys/dev/usb/usb_device.h head/sys/dev/usb/usb_request.c head/sys/dev/usb/usb_request.h Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Tue Feb 24 03:40:09 2009 (r188984) +++ head/sys/dev/usb/usb_device.c Tue Feb 24 03:40:48 2009 (r188985) @@ -323,6 +323,40 @@ usb2_free_pipe_data(struct usb2_device * } /*------------------------------------------------------------------------* + * usb2_pipe_foreach + * + * This function will iterate all the USB endpoints except the control + * endpoint. This function is NULL safe. + * + * Return values: + * NULL: End of USB pipes + * Else: Pointer to next USB pipe + *------------------------------------------------------------------------*/ +struct usb2_pipe * +usb2_pipe_foreach(struct usb2_device *udev, struct usb2_pipe *pipe) +{ + struct usb2_pipe *pipe_end = udev->pipes + USB_EP_MAX; + + /* be NULL safe */ + if (udev == NULL) + return (NULL); + + /* get next pipe */ + if (pipe == NULL) + pipe = udev->pipes; + else + pipe++; + + /* find next allocated pipe */ + while (pipe != pipe_end) { + if (pipe->edesc != NULL) + return (pipe); + pipe++; + } + return (NULL); +} + +/*------------------------------------------------------------------------* * usb2_fill_iface_data * * This function will fill in interface data and allocate USB pipes @@ -1430,7 +1464,7 @@ usb2_alloc_device(device_t parent_dev, s * 0. If this value is different from "USB_MAX_IPACKET" a new * USB control request will be setup! */ - err = usb2_req_get_desc(udev, &Giant, &udev->ddesc, + err = usb2_req_get_desc(udev, &Giant, NULL, &udev->ddesc, USB_MAX_IPACKET, USB_MAX_IPACKET, 0, UDESC_DEVICE, 0, 0); if (err) { DPRINTFN(0, "getting device descriptor " Modified: head/sys/dev/usb/usb_device.h ============================================================================== --- head/sys/dev/usb/usb_device.h Tue Feb 24 03:40:09 2009 (r188984) +++ head/sys/dev/usb/usb_device.h Tue Feb 24 03:40:48 2009 (r188985) @@ -183,5 +183,6 @@ void *usb2_find_descriptor(struct usb2_d uint8_t subtype, uint8_t subtype_mask); void usb_linux_free_device(struct usb_device *dev); uint8_t usb2_peer_can_wakeup(struct usb2_device *udev); +struct usb2_pipe *usb2_pipe_foreach(struct usb2_device *udev, struct usb2_pipe *pipe); #endif /* _USB2_DEVICE_H_ */ Modified: head/sys/dev/usb/usb_request.c ============================================================================== --- head/sys/dev/usb/usb_request.c Tue Feb 24 03:40:09 2009 (r188984) +++ head/sys/dev/usb/usb_request.c Tue Feb 24 03:40:48 2009 (r188985) @@ -615,17 +615,24 @@ done: * argument specifies the minimum descriptor length. The "max_len" * argument specifies the maximum descriptor length. If the real * descriptor length is less than the minimum length the missing - * byte(s) will be zeroed. The length field, first byte, of the USB - * descriptor will get overwritten in case it indicates a length that - * is too big. Also the type field, second byte, of the USB descriptor - * will get forced to the correct type. + * byte(s) will be zeroed. The type field, the second byte of the USB + * descriptor, will get forced to the correct type. If the "actlen" + * pointer is non-NULL, the actual length of the transfer will get + * stored in the 16-bit unsigned integer which it is pointing to. The + * first byte of the descriptor will not get updated. If the "actlen" + * pointer is NULL the first byte of the descriptor will get updated + * to reflect the actual length instead. If "min_len" is not equal to + * "max_len" then this function will try to retrive the beginning of + * the descriptor and base the maximum length on the first byte of the + * descriptor. * * Returns: * 0: Success * Else: Failure *------------------------------------------------------------------------*/ usb2_error_t -usb2_req_get_desc(struct usb2_device *udev, struct mtx *mtx, void *desc, +usb2_req_get_desc(struct usb2_device *udev, + struct mtx *mtx, uint16_t *actlen, void *desc, uint16_t min_len, uint16_t max_len, uint16_t id, uint8_t type, uint8_t index, uint8_t retries) @@ -667,11 +674,11 @@ usb2_req_get_desc(struct usb2_device *ud if (min_len == max_len) { - /* enforce correct type and length */ - - if (buf[0] > min_len) { + /* enforce correct length */ + if ((buf[0] > min_len) && (actlen == NULL)) buf[0] = min_len; - } + + /* enforce correct type */ buf[1] = type; goto done; @@ -693,6 +700,12 @@ usb2_req_get_desc(struct usb2_device *ud min_len = max_len; } done: + if (actlen != NULL) { + if (err) + *actlen = 0; + else + *actlen = min_len; + } return (err); } @@ -808,7 +821,7 @@ usb2_req_get_string_desc(struct usb2_dev uint16_t max_len, uint16_t lang_id, uint8_t string_index) { - return (usb2_req_get_desc(udev, mtx, sdesc, 2, max_len, lang_id, + return (usb2_req_get_desc(udev, mtx, NULL, sdesc, 2, max_len, lang_id, UDESC_STRING, string_index, 0)); } @@ -827,7 +840,7 @@ usb2_req_get_config_desc(struct usb2_dev DPRINTFN(4, "confidx=%d\n", conf_index); - err = usb2_req_get_desc(udev, mtx, d, sizeof(*d), + err = usb2_req_get_desc(udev, mtx, NULL, d, sizeof(*d), sizeof(*d), 0, UDESC_CONFIG, conf_index, 0); if (err) { goto done; @@ -878,7 +891,7 @@ usb2_req_get_config_desc_full(struct usb if (cdesc == NULL) { return (USB_ERR_NOMEM); } - err = usb2_req_get_desc(udev, mtx, cdesc, len, len, 0, + err = usb2_req_get_desc(udev, mtx, NULL, cdesc, len, len, 0, UDESC_CONFIG, index, 3); if (err) { free(cdesc, mtype); @@ -904,7 +917,7 @@ usb2_req_get_device_desc(struct usb2_dev struct usb2_device_descriptor *d) { DPRINTFN(4, "\n"); - return (usb2_req_get_desc(udev, mtx, d, sizeof(*d), + return (usb2_req_get_desc(udev, mtx, NULL, d, sizeof(*d), sizeof(*d), 0, UDESC_DEVICE, 0, 3)); } @@ -1407,7 +1420,7 @@ retry: usb2_pause_mtx(mtx, USB_MS_TO_TICKS(USB_SET_ADDRESS_SETTLE)); /* get the device descriptor */ - err = usb2_req_get_desc(udev, mtx, &udev->ddesc, + err = usb2_req_get_desc(udev, mtx, NULL, &udev->ddesc, USB_MAX_IPACKET, USB_MAX_IPACKET, 0, UDESC_DEVICE, 0, 0); if (err) { DPRINTFN(0, "getting device descriptor " Modified: head/sys/dev/usb/usb_request.h ============================================================================== --- head/sys/dev/usb/usb_request.h Tue Feb 24 03:40:09 2009 (r188984) +++ head/sys/dev/usb/usb_request.h Tue Feb 24 03:40:48 2009 (r188985) @@ -50,8 +50,9 @@ usb2_error_t usb2_req_get_config_desc_fu struct mtx *mtx, struct usb2_config_descriptor **ppcd, struct malloc_type *mtype, uint8_t conf_index); usb2_error_t usb2_req_get_desc(struct usb2_device *udev, struct mtx *mtx, - void *desc, uint16_t min_len, uint16_t max_len, uint16_t id, - uint8_t type, uint8_t index, uint8_t retries); + uint16_t *actlen, void *desc, uint16_t min_len, + uint16_t max_len, uint16_t id, uint8_t type, + uint8_t index, uint8_t retries); usb2_error_t usb2_req_get_device_desc(struct usb2_device *udev, struct mtx *mtx, struct usb2_device_descriptor *d); usb2_error_t usb2_req_get_device_status(struct usb2_device *udev, From owner-svn-src-head@FreeBSD.ORG Tue Feb 24 03:41:53 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 614E51065690; Tue, 24 Feb 2009 03:41:53 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4E0058FC16; Tue, 24 Feb 2009 03:41:53 +0000 (UTC) (envelope-from thompsa@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 n1O3fr1E049768; Tue, 24 Feb 2009 03:41:53 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1O3frNQ049764; Tue, 24 Feb 2009 03:41:53 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902240341.n1O3frNQ049764@svn.freebsd.org> From: Andrew Thompson Date: Tue, 24 Feb 2009 03:41:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188986 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Feb 2009 03:41:54 -0000 Author: thompsa Date: Tue Feb 24 03:41:52 2009 New Revision: 188986 URL: http://svn.freebsd.org/changeset/base/188986 Log: MFp4 //depot/projects/usb@157958 - We don't need to exit the Giant mutex when sleeping. This is done automatically. Replace Giant by NULL mutex for all control requests in the enumeration path. - Optimise away duplicate alternate interface selection requests in USB Host mode. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/usb_device.c head/sys/dev/usb/usb_generic.c head/sys/dev/usb/usb_handle_request.c head/sys/dev/usb/usb_hub.c Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Tue Feb 24 03:40:48 2009 (r188985) +++ head/sys/dev/usb/usb_device.c Tue Feb 24 03:41:52 2009 (r188986) @@ -551,12 +551,12 @@ usb2_set_config_index(struct usb2_device * device. "usb2_free_iface_data()" will also reset * the current config number and index. */ - err = usb2_req_set_config(udev, &Giant, USB_UNCONFIG_NO); + err = usb2_req_set_config(udev, NULL, USB_UNCONFIG_NO); goto done; } /* get the full config descriptor */ err = usb2_req_get_config_desc_full(udev, - &Giant, &cdp, M_USB, index); + NULL, &cdp, M_USB, index); if (err) { goto done; } @@ -583,7 +583,7 @@ usb2_set_config_index(struct usb2_device * determined by the HUB characteristics. */ err = usb2_req_get_hub_descriptor - (udev, &Giant, &hd, 1); + (udev, NULL, &hd, 1); if (err) { DPRINTFN(0, "could not read " "HUB descriptor: %s\n", @@ -597,7 +597,7 @@ usb2_set_config_index(struct usb2_device UGETW(hd.wHubCharacteristics)); } else { err = usb2_req_get_device_status - (udev, &Giant, &ds); + (udev, NULL, &ds); if (err) { DPRINTFN(0, "could not read " "device status: %s\n", @@ -640,7 +640,7 @@ usb2_set_config_index(struct usb2_device udev->curr_config_index = index; /* Set the actual configuration value. */ - err = usb2_req_set_config(udev, &Giant, cdp->bConfigurationValue); + err = usb2_req_set_config(udev, NULL, cdp->bConfigurationValue); if (err) { goto done; } @@ -669,8 +669,10 @@ done: * * This function will select an alternate interface index for the * given interface index. The interface should not be in use when this - * function is called. That means there should be no open USB - * transfers. Else an error is returned. + * function is called. That means there should not be any open USB + * transfers. Else an error is returned. If the alternate setting is + * already set this function will simply return success. This function + * is called in Host mode and Device mode! * * Returns: * 0: Success @@ -697,6 +699,15 @@ usb2_set_alt_interface_index(struct usb2 } if (udev->flags.usb2_mode == USB_MODE_DEVICE) { usb2_detach_device(udev, iface_index, 1); + } else { + if (iface->alt_index == alt_index) { + /* + * Optimise away duplicate setting of + * alternate setting in USB Host Mode! + */ + err = 0; + goto done; + } } /* * Free all generic FIFOs for this interface, except control @@ -708,8 +719,7 @@ usb2_set_alt_interface_index(struct usb2 if (err) { goto done; } - err = usb2_req_set_alt_interface_no - (udev, &Giant, iface_index, + err = usb2_req_set_alt_interface_no(udev, NULL, iface_index, iface->idesc->bAlternateSetting); done: @@ -1415,7 +1425,7 @@ usb2_alloc_device(device_t parent_dev, s if (udev->flags.usb2_mode == USB_MODE_HOST) { - err = usb2_req_set_address(udev, &Giant, device_index); + err = usb2_req_set_address(udev, NULL, device_index); /* This is the new USB device address from now on */ @@ -1435,7 +1445,7 @@ usb2_alloc_device(device_t parent_dev, s "(ignored)\n", udev->address); } /* allow device time to set new address */ - usb2_pause_mtx(&Giant, + usb2_pause_mtx(NULL, USB_MS_TO_TICKS(USB_SET_ADDRESS_SETTLE)); } else { /* We are not self powered */ @@ -1464,13 +1474,13 @@ usb2_alloc_device(device_t parent_dev, s * 0. If this value is different from "USB_MAX_IPACKET" a new * USB control request will be setup! */ - err = usb2_req_get_desc(udev, &Giant, NULL, &udev->ddesc, + err = usb2_req_get_desc(udev, NULL, NULL, &udev->ddesc, USB_MAX_IPACKET, USB_MAX_IPACKET, 0, UDESC_DEVICE, 0, 0); if (err) { DPRINTFN(0, "getting device descriptor " "at addr %d failed!\n", udev->address); /* XXX try to re-enumerate the device */ - err = usb2_req_re_enumerate(udev, &Giant); + err = usb2_req_re_enumerate(udev, NULL); if (err) { goto done; } @@ -1486,7 +1496,7 @@ usb2_alloc_device(device_t parent_dev, s udev->speed); /* get the full device descriptor */ - err = usb2_req_get_device_desc(udev, &Giant, &udev->ddesc); + err = usb2_req_get_device_desc(udev, NULL, &udev->ddesc); if (err) { DPRINTF("addr=%d, getting full desc failed\n", udev->address); @@ -1525,7 +1535,7 @@ usb2_alloc_device(device_t parent_dev, s udev->ddesc.iProduct || udev->ddesc.iSerialNumber) { /* read out the language ID string */ - err = usb2_req_get_string_desc(udev, &Giant, + err = usb2_req_get_string_desc(udev, NULL, (char *)scratch_ptr, 4, scratch_size, USB_LANGUAGE_TABLE); } else { @@ -1544,21 +1554,21 @@ usb2_alloc_device(device_t parent_dev, s /* get serial number string */ err = usb2_req_get_string_any - (udev, &Giant, (char *)scratch_ptr, + (udev, NULL, (char *)scratch_ptr, scratch_size, udev->ddesc.iSerialNumber); strlcpy(udev->serial, (char *)scratch_ptr, sizeof(udev->serial)); /* get manufacturer string */ err = usb2_req_get_string_any - (udev, &Giant, (char *)scratch_ptr, + (udev, NULL, (char *)scratch_ptr, scratch_size, udev->ddesc.iManufacturer); strlcpy(udev->manufacturer, (char *)scratch_ptr, sizeof(udev->manufacturer)); /* get product string */ err = usb2_req_get_string_any - (udev, &Giant, (char *)scratch_ptr, + (udev, NULL, (char *)scratch_ptr, scratch_size, udev->ddesc.iProduct); strlcpy(udev->product, (char *)scratch_ptr, sizeof(udev->product)); @@ -1609,7 +1619,7 @@ repeat_set_config: set_config_failed = 1; /* XXX try to re-enumerate the device */ err = usb2_req_re_enumerate( - udev, &Giant); + udev, NULL); if (err == 0) goto repeat_set_config; } Modified: head/sys/dev/usb/usb_generic.c ============================================================================== --- head/sys/dev/usb/usb_generic.c Tue Feb 24 03:40:48 2009 (r188985) +++ head/sys/dev/usb/usb_generic.c Tue Feb 24 03:41:52 2009 (r188986) @@ -664,7 +664,7 @@ ugen_get_cdesc(struct usb2_fifo *f, stru } else { if (usb2_req_get_config_desc_full(udev, - &Giant, &cdesc, M_USBDEV, + NULL, &cdesc, M_USBDEV, ugd->ugd_config_index)) { return (ENXIO); } @@ -695,7 +695,7 @@ ugen_get_sdesc(struct usb2_fifo *f, stru uint16_t size = sizeof(f->udev->bus->scratch[0].data); int error; - if (usb2_req_get_string_desc(f->udev, &Giant, ptr, + if (usb2_req_get_string_desc(f->udev, NULL, ptr, size, ugd->ugd_lang_id, ugd->ugd_string_index)) { error = EINVAL; } else { Modified: head/sys/dev/usb/usb_handle_request.c ============================================================================== --- head/sys/dev/usb/usb_handle_request.c Tue Feb 24 03:40:48 2009 (r188985) +++ head/sys/dev/usb/usb_handle_request.c Tue Feb 24 03:41:52 2009 (r188986) @@ -277,6 +277,10 @@ tr_repeat: } break; } + /* + * Doing the alternate setting will detach the + * interface aswell: + */ error = usb2_set_alt_interface_index(udev, iface_index, req.wValue[0]); if (error) { Modified: head/sys/dev/usb/usb_hub.c ============================================================================== --- head/sys/dev/usb/usb_hub.c Tue Feb 24 03:40:48 2009 (r188985) +++ head/sys/dev/usb/usb_hub.c Tue Feb 24 03:41:52 2009 (r188986) @@ -244,7 +244,7 @@ uhub_read_port_status(struct uhub_softc usb2_error_t err; err = usb2_req_get_port_status( - sc->sc_udev, &Giant, &ps, portno); + sc->sc_udev, NULL, &ps, portno); /* update status regardless of error */ @@ -289,7 +289,7 @@ repeat: /* first clear the port connection change bit */ - err = usb2_req_clear_port_feature(udev, &Giant, + err = usb2_req_clear_port_feature(udev, NULL, portno, UHF_C_PORT_CONNECTION); if (err) { @@ -329,18 +329,18 @@ repeat: DPRINTF("Port %d was still " "suspended, clearing.\n", portno); err = usb2_req_clear_port_feature(sc->sc_udev, - &Giant, portno, UHF_PORT_SUSPEND); + NULL, portno, UHF_PORT_SUSPEND); } /* USB Host Mode */ /* wait for maximum device power up time */ - usb2_pause_mtx(&Giant, + usb2_pause_mtx(NULL, USB_MS_TO_TICKS(USB_PORT_POWERUP_DELAY)); /* reset port, which implies enabling it */ - err = usb2_req_reset_port(udev, &Giant, portno); + err = usb2_req_reset_port(udev, NULL, portno); if (err) { DPRINTFN(0, "port %d reset " @@ -425,7 +425,7 @@ error: if (err == 0) { if (sc->sc_st.port_status & UPS_PORT_ENABLED) { err = usb2_req_clear_port_feature( - sc->sc_udev, &Giant, + sc->sc_udev, NULL, portno, UHF_PORT_ENABLE); } } @@ -459,7 +459,7 @@ uhub_suspend_resume_port(struct uhub_sof /* first clear the port suspend change bit */ - err = usb2_req_clear_port_feature(udev, &Giant, + err = usb2_req_clear_port_feature(udev, NULL, portno, UHF_C_PORT_SUSPEND); if (err) { DPRINTF("clearing suspend failed.\n"); @@ -542,7 +542,7 @@ uhub_explore(struct usb2_device *udev) if (sc->sc_st.port_change & UPS_C_OVERCURRENT_INDICATOR) { DPRINTF("Overcurrent on port %u.\n", portno); err = usb2_req_clear_port_feature( - udev, &Giant, portno, UHF_C_PORT_OVER_CURRENT); + udev, NULL, portno, UHF_C_PORT_OVER_CURRENT); if (err) { /* most likely the HUB is gone */ break; @@ -558,7 +558,7 @@ uhub_explore(struct usb2_device *udev) } if (sc->sc_st.port_change & UPS_C_PORT_ENABLED) { err = usb2_req_clear_port_feature( - udev, &Giant, portno, UHF_C_PORT_ENABLE); + udev, NULL, portno, UHF_C_PORT_ENABLE); if (err) { /* most likely the HUB is gone */ break; @@ -682,13 +682,13 @@ uhub_attach(device_t dev) DPRINTFN(2, "getting HUB descriptor\n"); /* assuming that there is one port */ - err = usb2_req_get_hub_descriptor(udev, &Giant, &hubdesc, 1); + err = usb2_req_get_hub_descriptor(udev, NULL, &hubdesc, 1); nports = hubdesc.bNbrPorts; if (!err && (nports >= 8)) { /* get complete HUB descriptor */ - err = usb2_req_get_hub_descriptor(udev, &Giant, &hubdesc, nports); + err = usb2_req_get_hub_descriptor(udev, NULL, &hubdesc, nports); } if (err) { DPRINTFN(0, "getting hub descriptor failed," @@ -737,7 +737,7 @@ uhub_attach(device_t dev) goto error; } /* wait with power off for a while */ - usb2_pause_mtx(&Giant, USB_MS_TO_TICKS(USB_POWER_DOWN_TIME)); + usb2_pause_mtx(NULL, USB_MS_TO_TICKS(USB_POWER_DOWN_TIME)); /* * To have the best chance of success we do things in the exact same @@ -784,7 +784,7 @@ uhub_attach(device_t dev) } if (!err) { /* turn the power on */ - err = usb2_req_set_port_feature(udev, &Giant, + err = usb2_req_set_port_feature(udev, NULL, portno, UHF_PORT_POWER); } if (err) { @@ -795,7 +795,7 @@ uhub_attach(device_t dev) portno); /* wait for stable power */ - usb2_pause_mtx(&Giant, USB_MS_TO_TICKS(pwrdly)); + usb2_pause_mtx(NULL, USB_MS_TO_TICKS(pwrdly)); } device_printf(dev, "%d port%s with %d " @@ -1661,13 +1661,13 @@ usb2_dev_resume_peer(struct usb2_device /* resume current port (Valid in Host and Device Mode) */ err = usb2_req_clear_port_feature(udev->parent_hub, - &Giant, udev->port_no, UHF_PORT_SUSPEND); + NULL, udev->port_no, UHF_PORT_SUSPEND); if (err) { DPRINTFN(0, "Resuming port failed!\n"); return; } /* resume settle time */ - usb2_pause_mtx(&Giant, USB_MS_TO_TICKS(USB_PORT_RESUME_DELAY)); + usb2_pause_mtx(NULL, USB_MS_TO_TICKS(USB_PORT_RESUME_DELAY)); if (bus->methods->device_resume != NULL) { /* resume USB device on the USB controller */ @@ -1703,7 +1703,7 @@ usb2_dev_resume_peer(struct usb2_device if (usb2_peer_can_wakeup(udev)) { /* clear remote wakeup */ err = usb2_req_clear_device_feature(udev, - &Giant, UF_DEVICE_REMOTE_WAKEUP); + NULL, UF_DEVICE_REMOTE_WAKEUP); if (err) { DPRINTFN(0, "Clearing device " "remote wakeup failed: %s!\n", @@ -1782,7 +1782,7 @@ repeat: if (usb2_peer_can_wakeup(udev)) { /* allow device to do remote wakeup */ err = usb2_req_set_device_feature(udev, - &Giant, UF_DEVICE_REMOTE_WAKEUP); + NULL, UF_DEVICE_REMOTE_WAKEUP); if (err) { DPRINTFN(0, "Setting device " "remote wakeup failed!\n"); @@ -1803,12 +1803,12 @@ repeat: /* do DMA delay */ temp = usb2_get_dma_delay(udev->bus); - usb2_pause_mtx(&Giant, USB_MS_TO_TICKS(temp)); + usb2_pause_mtx(NULL, USB_MS_TO_TICKS(temp)); } /* suspend current port */ err = usb2_req_set_port_feature(udev->parent_hub, - &Giant, udev->port_no, UHF_PORT_SUSPEND); + NULL, udev->port_no, UHF_PORT_SUSPEND); if (err) { DPRINTFN(0, "Suspending port failed\n"); return; From owner-svn-src-head@FreeBSD.ORG Tue Feb 24 03:43:05 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BEACA106564A; Tue, 24 Feb 2009 03:43:05 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AB48D8FC15; Tue, 24 Feb 2009 03:43:05 +0000 (UTC) (envelope-from thompsa@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 n1O3h5UN049830; Tue, 24 Feb 2009 03:43:05 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1O3h5uV049822; Tue, 24 Feb 2009 03:43:05 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902240343.n1O3h5uV049822@svn.freebsd.org> From: Andrew Thompson Date: Tue, 24 Feb 2009 03:43:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188987 - in head: lib/libusb20 sys/dev/usb usr.sbin/usbconfig X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Feb 2009 03:43:06 -0000 Author: thompsa Date: Tue Feb 24 03:43:05 2009 New Revision: 188987 URL: http://svn.freebsd.org/changeset/base/188987 Log: MFp4 //depot/projects/usb@157974 Add support for setting and getting the USB template value through libusb20 and usbconfig. Submitted by: Hans Petter Selasky Modified: head/lib/libusb20/libusb20.3 head/lib/libusb20/libusb20.c head/lib/libusb20/libusb20_int.h head/lib/libusb20/libusb20_ugen20.c head/sys/dev/usb/usb_dev.c head/sys/dev/usb/usb_device.h head/sys/dev/usb/usb_ioctl.h head/usr.sbin/usbconfig/usbconfig.c Modified: head/lib/libusb20/libusb20.3 ============================================================================== --- head/lib/libusb20/libusb20.3 Tue Feb 24 03:41:52 2009 (r188986) +++ head/lib/libusb20/libusb20.3 Tue Feb 24 03:43:05 2009 (r188987) @@ -698,6 +698,30 @@ returned. . .Sh USB BACKEND OPERATIONS . +.Fn libusb20_be_get_template pbackend ptemp +This function will return the currently selected global USB device +side mode template into the integer pointer +.Fa ptemp . +This function returns zero on success else a LIBUSB20_ERROR value is +returned. +. +.Pp +. +.Fn libusb20_be_set_template pbackend temp +This function will set the global USB device side mode template to +.Fa temp . +The new template is not activated until after the next USB +enumeration. +The template number decides how the USB device will present itself to +the USB Host, like Mass Storage Device, USB Ethernet Device. Also see +the +.Xr usb2_template 4 +module. +This function returns zero on success else a LIBUSB20_ERROR value is +returned. +. +.Pp +. .Fn libusb20_be_get_dev_quirk pbackend index pquirk This function will return the device quirk according to .Fa index Modified: head/lib/libusb20/libusb20.c ============================================================================== --- head/lib/libusb20/libusb20.c Tue Feb 24 03:41:52 2009 (r188986) +++ head/lib/libusb20/libusb20.c Tue Feb 24 03:43:05 2009 (r188987) @@ -1165,6 +1165,23 @@ libusb20_be_get_perm(struct libusb20_bac return (pbe->methods->root_get_perm(pbe, mode)); } +int +libusb20_be_set_template(struct libusb20_backend *pbe, int temp) +{ + return (pbe->methods->root_set_template(pbe, temp)); +} + +int +libusb20_be_get_template(struct libusb20_backend *pbe, int *ptemp) +{ + int temp; + + if (ptemp == NULL) + ptemp = &temp; + + return (pbe->methods->root_get_template(pbe, ptemp)); +} + struct libusb20_device * libusb20_be_device_foreach(struct libusb20_backend *pbe, struct libusb20_device *pdev) { Modified: head/lib/libusb20/libusb20_int.h ============================================================================== --- head/lib/libusb20/libusb20_int.h Tue Feb 24 03:41:52 2009 (r188986) +++ head/lib/libusb20/libusb20_int.h Tue Feb 24 03:43:05 2009 (r188987) @@ -70,6 +70,8 @@ typedef int (libusb20_root_get_perm_t)(s typedef int (libusb20_root_set_owner_t)(struct libusb20_backend *pbe, uid_t user, gid_t group); typedef int (libusb20_root_set_perm_t)(struct libusb20_backend *pbe, mode_t mode); typedef void (libusb20_exit_backend_t)(struct libusb20_backend *pbe); +typedef int (libusb20_root_set_template_t)(struct libusb20_backend *pbe, int temp); +typedef int (libusb20_root_get_template_t)(struct libusb20_backend *pbe, int *ptemp); #define LIBUSB20_DEFINE(n,field) \ libusb20_##field##_t *field; @@ -105,6 +107,8 @@ typedef void (libusb20_exit_backend_t)(s m(n, root_get_owner) \ m(n, root_set_perm) \ m(n, root_get_perm) \ + m(n, root_set_template) \ + m(n, root_get_template) \ /* mandatory device methods */ \ m(n, open_device) \ m(n, close_device) \ Modified: head/lib/libusb20/libusb20_ugen20.c ============================================================================== --- head/lib/libusb20/libusb20_ugen20.c Tue Feb 24 03:41:52 2009 (r188986) +++ head/lib/libusb20/libusb20_ugen20.c Tue Feb 24 03:43:05 2009 (r188987) @@ -72,6 +72,8 @@ static libusb20_root_set_owner_t ugen20_ static libusb20_root_get_owner_t ugen20_root_get_owner; static libusb20_root_set_perm_t ugen20_root_set_perm; static libusb20_root_get_perm_t ugen20_root_get_perm; +static libusb20_root_set_template_t ugen20_root_set_template; +static libusb20_root_get_template_t ugen20_root_get_template; const struct libusb20_backend_methods libusb20_ugen20_backend = { LIBUSB20_BACKEND(LIBUSB20_DECLARE, ugen20) @@ -1179,3 +1181,15 @@ ugen20_root_get_perm(struct libusb20_bac return (ugen20_be_do_perm(USB_GET_ROOT_PERM, 0, 0, 0, 0, NULL, NULL, mode)); } + +static int +ugen20_root_set_template(struct libusb20_backend *pbe, int temp) +{ + return (ugen20_be_ioctl(USB_SET_TEMPLATE, &temp)); +} + +static int +ugen20_root_get_template(struct libusb20_backend *pbe, int *ptemp) +{ + return (ugen20_be_ioctl(USB_GET_TEMPLATE, ptemp)); +} Modified: head/sys/dev/usb/usb_dev.c ============================================================================== --- head/sys/dev/usb/usb_dev.c Tue Feb 24 03:41:52 2009 (r188986) +++ head/sys/dev/usb/usb_dev.c Tue Feb 24 03:43:05 2009 (r188987) @@ -1377,6 +1377,15 @@ usb2_ioctl(struct cdev *dev, u_long cmd, case USB_DEV_QUIRK_REMOVE: err = usb2_quirk_ioctl_p(cmd, data, fflag, td); break; + case USB_GET_TEMPLATE: + *(int *)data = usb2_template; + break; + case USB_SET_TEMPLATE: + err = priv_check(curthread, PRIV_ROOT); + if (err) + break; + usb2_template = *(int *)data; + break; default: err = ENOTTY; break; Modified: head/sys/dev/usb/usb_device.h ============================================================================== --- head/sys/dev/usb/usb_device.h Tue Feb 24 03:41:52 2009 (r188986) +++ head/sys/dev/usb/usb_device.h Tue Feb 24 03:43:05 2009 (r188987) @@ -155,6 +155,10 @@ struct usb2_device { char product[64]; /* product string */ }; +/* globals */ + +extern int usb2_template; + /* function prototypes */ struct usb2_device *usb2_alloc_device(device_t parent_dev, struct usb2_bus *bus, Modified: head/sys/dev/usb/usb_ioctl.h ============================================================================== --- head/sys/dev/usb/usb_ioctl.h Tue Feb 24 03:41:52 2009 (r188986) +++ head/sys/dev/usb/usb_ioctl.h Tue Feb 24 03:43:05 2009 (r188987) @@ -267,6 +267,8 @@ struct usb2_gen_quirk { #define USB_SET_PORT_DISABLE _IOW ('U', 144, int) #define USB_SET_POWER_MODE _IOW ('U', 145, int) #define USB_GET_POWER_MODE _IOR ('U', 146, int) +#define USB_SET_TEMPLATE _IOW ('U', 147, int) +#define USB_GET_TEMPLATE _IOR ('U', 148, int) /* Modem device */ #define USB_GET_CM_OVER_DATA _IOR ('U', 180, int) Modified: head/usr.sbin/usbconfig/usbconfig.c ============================================================================== --- head/usr.sbin/usbconfig/usbconfig.c Tue Feb 24 03:41:52 2009 (r188986) +++ head/usr.sbin/usbconfig/usbconfig.c Tue Feb 24 03:43:05 2009 (r188987) @@ -42,6 +42,7 @@ struct options { const char *quirkname; void *buffer; + int template; gid_t gid; uid_t uid; mode_t mode; @@ -65,6 +66,8 @@ struct options { uint8_t got_set_alt:1; uint8_t got_set_owner:1; uint8_t got_set_perm:1; + uint8_t got_set_template:1; + uint8_t got_get_template:1; uint8_t got_suspend:1; uint8_t got_resume:1; uint8_t got_reset:1; @@ -99,6 +102,8 @@ enum { T_SET_ALT, T_SET_OWNER, T_SET_PERM, + T_SET_TEMPLATE, + T_GET_TEMPLATE, T_ADD_DEVICE_QUIRK, T_REMOVE_DEVICE_QUIRK, T_SHOW_IFACE_DRIVER, @@ -130,6 +135,8 @@ static const struct token token[] = { {"set_alt", T_SET_ALT, 1}, {"set_owner", T_SET_OWNER, 1}, {"set_perm", T_SET_PERM, 1}, + {"set_template", T_SET_TEMPLATE, 1}, + {"get_template", T_GET_TEMPLATE, 0}, {"add_dev_quirk_vplh", T_ADD_DEVICE_QUIRK, 5}, {"remove_dev_quirk_vplh", T_REMOVE_DEVICE_QUIRK, 5}, {"dump_quirk_names", T_DUMP_QUIRK_NAMES, 0}, @@ -283,6 +290,8 @@ usage(void) " set_alt " "\n" " set_owner " "\n" " set_perm " "\n" + " set_template