if_ndis_usb.c (170612) | if_ndis_usb.c (170934) |
---|---|
1/*- 2 * Copyright (c) 2005 3 * Bill Paul <wpaul@windriver.com>. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 30 * THE POSSIBILITY OF SUCH DAMAGE. 31 */ 32 33#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2005 3 * Bill Paul <wpaul@windriver.com>. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 30 * THE POSSIBILITY OF SUCH DAMAGE. 31 */ 32 33#include <sys/cdefs.h> |
34__FBSDID("$FreeBSD: head/sys/dev/if_ndis/if_ndis_usb.c 170612 2007-06-12 15:37:19Z imp $"); | 34__FBSDID("$FreeBSD: head/sys/dev/if_ndis/if_ndis_usb.c 170934 2007-06-18 22:24:32Z imp $"); |
35 36#include <sys/param.h> 37#include <sys/systm.h> 38#include <sys/sockio.h> 39#include <sys/module.h> 40#include <sys/malloc.h> 41#include <sys/kernel.h> 42#include <sys/socket.h> --- 21 unchanged lines hidden (view full) --- 64#include <compat/ndis/cfg_var.h> 65#include <compat/ndis/resource_var.h> 66#include <compat/ndis/ntoskrnl_var.h> 67#include <compat/ndis/ndis_var.h> 68#include <dev/if_ndis/if_ndisvar.h> 69 70MODULE_DEPEND(ndis, usb, 1, 1, 1); 71 | 35 36#include <sys/param.h> 37#include <sys/systm.h> 38#include <sys/sockio.h> 39#include <sys/module.h> 40#include <sys/malloc.h> 41#include <sys/kernel.h> 42#include <sys/socket.h> --- 21 unchanged lines hidden (view full) --- 64#include <compat/ndis/cfg_var.h> 65#include <compat/ndis/resource_var.h> 66#include <compat/ndis/ntoskrnl_var.h> 67#include <compat/ndis/ndis_var.h> 68#include <dev/if_ndis/if_ndisvar.h> 69 70MODULE_DEPEND(ndis, usb, 1, 1, 1); 71 |
72static int ndisusb_match (device_t); 73static int ndisusb_attach (device_t); 74static struct resource_list *ndis_get_resource_list 75 (device_t, device_t); | 72static device_probe_t ndisusb_match; 73static device_attach_t ndisusb_attach; 74static bus_get_resource_list_t ndis_get_resource_list; |
76 77extern int ndisdrv_modevent (module_t, int, void *); 78extern int ndis_attach (device_t); 79extern int ndis_shutdown (device_t); 80extern int ndis_detach (device_t); 81extern int ndis_suspend (device_t); 82extern int ndis_resume (device_t); 83 --- 19 unchanged lines hidden (view full) --- 103 ndis_methods, 104 sizeof(struct ndis_softc) 105}; 106 107static devclass_t ndis_devclass; 108 109DRIVER_MODULE(ndis, uhub, ndis_driver, ndis_devclass, ndisdrv_modevent, 0); 110 | 75 76extern int ndisdrv_modevent (module_t, int, void *); 77extern int ndis_attach (device_t); 78extern int ndis_shutdown (device_t); 79extern int ndis_detach (device_t); 80extern int ndis_suspend (device_t); 81extern int ndis_resume (device_t); 82 --- 19 unchanged lines hidden (view full) --- 102 ndis_methods, 103 sizeof(struct ndis_softc) 104}; 105 106static devclass_t ndis_devclass; 107 108DRIVER_MODULE(ndis, uhub, ndis_driver, ndis_devclass, ndisdrv_modevent, 0); 109 |
111USB_MATCH(ndisusb) | 110static int 111ndisusb_match(device_t self) |
112{ | 112{ |
113 USB_MATCH_START(ndisusb, uaa); | 113 struct usb_attach_arg *uaa = device_get_ivars(self); |
114 115 if (windrv_lookup(0, "USB Bus") == NULL) | 114 115 if (windrv_lookup(0, "USB Bus") == NULL) |
116 return(UMATCH_NONE); | 116 return (UMATCH_NONE); |
117 118 if (uaa->iface != NULL) | 117 118 if (uaa->iface != NULL) |
119 return(UMATCH_NONE); | 119 return (UMATCH_NONE); |
120 | 120 |
121 return(UMATCH_NONE); | 121 return (UMATCH_NONE); |
122} 123 | 122} 123 |
124USB_ATTACH(ndisusb) | 124static int 125ndisusb_attach(device_t self) |
125{ | 126{ |
126 USB_ATTACH_START(ndisusb, dummy, uaa); | 127 struct ndisusb_softc *dummy = device_get_softc(self); 128 struct usb_attach_arg *uaa = device_get_ivars(self); |
127 struct ndis_softc *sc; 128 driver_object *drv; 129 130 sc = (struct ndis_softc *)dummy; 131 132 if (uaa->device == NULL) 133 return ENXIO; 134 --- 6 unchanged lines hidden (view full) --- 141 142 if (ndis_attach(self) != 0) 143 return ENXIO; 144 145 return 0; 146} 147 148static struct resource_list * | 129 struct ndis_softc *sc; 130 driver_object *drv; 131 132 sc = (struct ndis_softc *)dummy; 133 134 if (uaa->device == NULL) 135 return ENXIO; 136 --- 6 unchanged lines hidden (view full) --- 143 144 if (ndis_attach(self) != 0) 145 return ENXIO; 146 147 return 0; 148} 149 150static struct resource_list * |
149ndis_get_resource_list(dev, child) 150 device_t dev; 151 device_t child; | 151ndis_get_resource_list(device_t dev, device_t child) |
152{ 153 struct ndis_softc *sc; 154 155 sc = device_get_softc(dev); 156 return (BUS_GET_RESOURCE_LIST(device_get_parent(sc->ndis_dev), dev)); 157} | 152{ 153 struct ndis_softc *sc; 154 155 sc = device_get_softc(dev); 156 return (BUS_GET_RESOURCE_LIST(device_get_parent(sc->ndis_dev), dev)); 157} |