From owner-p4-projects@FreeBSD.ORG Fri Jun 22 16:05:23 2007 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7A09016A46C; Fri, 22 Jun 2007 16:05:23 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4AD8716A41F for ; Fri, 22 Jun 2007 16:05:23 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id 3D3BA13C44B for ; Fri, 22 Jun 2007 16:05:23 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.8/8.13.8) with ESMTP id l5MG5Nk9022628 for ; Fri, 22 Jun 2007 16:05:23 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.8/8.13.8/Submit) id l5MG5NOk022625 for perforce@freebsd.org; Fri, 22 Jun 2007 16:05:23 GMT (envelope-from rpaulo@FreeBSD.org) Date: Fri, 22 Jun 2007 16:05:23 GMT Message-Id: <200706221605.l5MG5NOk022625@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo To: Perforce Change Reviews Cc: Subject: PERFORCE change 122157 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jun 2007 16:05:23 -0000 http://perforce.freebsd.org/chv.cgi?CH=122157 Change 122157 by rpaulo@rpaulo_epsilon on 2007/06/22 16:05:19 Adapt to bsdimp@ changes to the USB stack. This driver does not depend on usb_port.h. Add some comments. Affected files ... .. //depot/projects/soc2007/rpaulo-macbook/dev/usb/atp.c#2 edit Differences ... ==== //depot/projects/soc2007/rpaulo-macbook/dev/usb/atp.c#2 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $P4: //depot/projects/soc2007/rpaulo-macbook/dev/usb/atp.c#1 $ + * $P4: //depot/projects/soc2007/rpaulo-macbook/dev/usb/atp.c#2 $ */ #include @@ -51,8 +51,8 @@ #include "usbdevs.h" #ifdef USB_DEBUG -#define DPRINTF(x) if (atpdebug) logprintf x -#define DPRINTFN(n,x) if (atpdebug>(n)) logprintf x +#define DPRINTF(x) if (atpdebug) printf x +#define DPRINTFN(n,x) if (atpdebug>(n)) printf x int atpdebug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, atp, CTLFLAG_RW, 0, "USB atp"); SYSCTL_INT(_hw_usb_atp, OID_AUTO, debug, CTLFLAG_RW, @@ -64,12 +64,16 @@ +/* + * Device interface. + */ +static int atp_match(device_t); +static int atp_attach(device_t); +static int atp_detach(device_t); -struct atp_softc { - device_t sc_dev; - -}; - +/* + * char device interface. + */ static d_open_t atp_open; static d_close_t atp_close; static d_read_t atp_read; @@ -87,6 +91,33 @@ .d_name = "atp", }; +struct atp_softc { + device_t sc_dev; + +}; + +static device_method_t atp_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, atp_match), + DEVMETHOD(device_attach, atp_attach), + DEVMETHOD(device_detach, atp_detach), + + { 0, 0 } +}; + +static driver_t atp_driver = { + "atp", + atp_methods, + sizeof(struct atp_softc) +}; + +static devclass_t atp_devclass; + +DRIVER_MODULE(atp, uhub, atp_driver, atp_devclass, usbd_driver_load, 0); + +/* + * Products supported by this driver. + */ static struct atp_product { uint16_t vendor; uint16_t product; @@ -97,13 +128,10 @@ }; -USB_DECLARE_DRIVER(atp); - - static int atp_match(device_t self) { - USB_MATCH_START(atp, uaa); + struct usb_attach_arg *uaa = device_get_ivars(self); usb_interface_descriptor_t *id; int size, i; usbd_status err; @@ -189,4 +217,4 @@ return -1; } -DRIVER_MODULE(atp, uhub, atp_driver, atp_devclass, usbd_driver_load, 0); +