From owner-p4-projects@FreeBSD.ORG Sun Jun 25 17:22:49 2006 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 9A06116A401; Sun, 25 Jun 2006 17:22:49 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 76E7716A40B for ; Sun, 25 Jun 2006 17:22:49 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 39C4243D46 for ; Sun, 25 Jun 2006 17:22:49 +0000 (GMT) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k5PHMnK1048209 for ; Sun, 25 Jun 2006 17:22:49 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k5PHMmGn048206 for perforce@freebsd.org; Sun, 25 Jun 2006 17:22:48 GMT (envelope-from hselasky@FreeBSD.org) Date: Sun, 25 Jun 2006 17:22:48 GMT Message-Id: <200606251722.k5PHMmGn048206@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 99993 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: Sun, 25 Jun 2006 17:22:49 -0000 http://perforce.freebsd.org/chv.cgi?CH=99993 Change 99993 by hselasky@hselasky_mini_itx on 2006/06/25 17:22:26 Finished converting "sys/dev/if_ndis/if_ndis_usb.c". Affected files ... .. //depot/projects/usb/src/sys/dev/if_ndis/if_ndis_usb.c#2 edit Differences ... ==== //depot/projects/usb/src/sys/dev/if_ndis/if_ndis_usb.c#2 (text+ko) ==== @@ -31,8 +31,6 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/if_ndis/if_ndis_usb.c,v 1.5 2005/04/24 20:21:22 wpaul Exp $"); - #include #include #include @@ -42,6 +40,11 @@ #include #include +#include +#include +#include +#include + #include #include #include @@ -50,14 +53,6 @@ #include -#include -#include -#include -#include -#include -#include -#include "usbdevs.h" - #include #include @@ -67,25 +62,26 @@ #include #include +__FBSDID("$FreeBSD: src/sys/dev/if_ndis/if_ndis_usb.c,v 1.5 2005/04/24 20:21:22 wpaul Exp $"); + MODULE_DEPEND(ndis, usb, 1, 1, 1); -Static int ndisusb_match (device_ptr_t); -Static int ndisusb_attach (device_ptr_t); -Static struct resource_list *ndis_get_resource_list - (device_t, device_t); +static device_probe_t ndisusb_probe; +static device_attach_t ndisusb_attach; +static struct resource_list *ndis_get_resource_list(device_t, device_t); -extern int ndisdrv_modevent (module_t, int, void *); -extern int ndis_attach (device_t); -extern int ndis_shutdown (device_t); -extern int ndis_detach (device_t); -extern int ndis_suspend (device_t); -extern int ndis_resume (device_t); +extern device_attach_t ndis_attach; +extern device_shutdown_t ndis_shutdown; +extern device_detach_t ndis_detach; +extern device_suspend_t ndis_suspend; +extern device_resume_t ndis_resume; +extern int ndisdrv_modevent(module_t, int, void *); extern unsigned char drv_data[]; -Static device_method_t ndis_methods[] = { +static device_method_t ndis_methods[] = { /* Device interface */ - DEVMETHOD(device_probe, ndisusb_match), + DEVMETHOD(device_probe, ndisusb_probe), DEVMETHOD(device_attach, ndisusb_attach), DEVMETHOD(device_detach, ndis_detach), DEVMETHOD(device_shutdown, ndis_shutdown), @@ -98,60 +94,56 @@ { 0, 0 } }; -Static driver_t ndis_driver = { +static driver_t ndis_driver = { "ndis", ndis_methods, sizeof(struct ndis_softc) }; -Static devclass_t ndis_devclass; +static devclass_t ndis_devclass; DRIVER_MODULE(ndis, uhub, ndis_driver, ndis_devclass, ndisdrv_modevent, 0); -USB_MATCH(ndisusb) +static int +ndisusb_probe(device_t dev) { - USB_MATCH_START(ndisusb, uaa); + struct usb_attach_arg *uaa = device_get_ivars(dev); - if (windrv_lookup(0, "USB Bus") == NULL) - return(UMATCH_NONE); + if (windrv_lookup(0, "USB Bus") == NULL) { + return UMATCH_NONE; + } - if (uaa->iface != NULL) - return(UMATCH_NONE); + if (uaa->iface != NULL) { + return UMATCH_NONE; + } - return(UMATCH_NONE); + return UMATCH_NONE; } -USB_ATTACH(ndisusb) +static int +ndisusb_attach(device_t dev) { - USB_ATTACH_START(ndisusb, dummy, uaa); - struct ndis_softc *sc; - driver_object *drv; + struct ndis_softc *sc = device_get_softc(dev); + driver_object *drv; - sc = (struct ndis_softc *)dummy; - - if (uaa->device == NULL) - USB_ATTACH_ERROR_RETURN; - - sc->ndis_dev = self; + sc->ndis_dev = dev; /* Create PDO for this device instance */ drv = windrv_lookup(0, "USB Bus"); - windrv_create_pdo(drv, self); + windrv_create_pdo(drv, dev); - if (ndis_attach(self) != 0) - USB_ATTACH_ERROR_RETURN; + if (ndis_attach(dev) != 0) { + return ENXIO; + } - USB_ATTACH_SUCCESS_RETURN; + return 0; /* success */ } static struct resource_list * -ndis_get_resource_list(dev, child) - device_t dev; - device_t child; +ndis_get_resource_list(device_t dev, device_t child) { - struct ndis_softc *sc; + struct ndis_softc *sc = device_get_softc(dev); - sc = device_get_softc(dev); return (BUS_GET_RESOURCE_LIST(device_get_parent(sc->ndis_dev), dev)); }