ar71xx_ehci.c (227849) | ar71xx_ehci.c (228483) |
---|---|
1/*- 2 * Copyright (c) 2008 Sam Leffler. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 13 unchanged lines hidden (view full) --- 22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 */ 24 25/* 26 * AR71XX attachment driver for the USB Enhanced Host Controller. 27 */ 28 29#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2008 Sam Leffler. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 13 unchanged lines hidden (view full) --- 22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 */ 24 25/* 26 * AR71XX attachment driver for the USB Enhanced Host Controller. 27 */ 28 29#include <sys/cdefs.h> |
30__FBSDID("$FreeBSD: head/sys/mips/atheros/ar71xx_ehci.c 227849 2011-11-22 21:56:55Z hselasky $"); | 30__FBSDID("$FreeBSD: head/sys/mips/atheros/ar71xx_ehci.c 228483 2011-12-14 00:28:54Z hselasky $"); |
31 32#include "opt_bus.h" 33 34#include <sys/param.h> 35#include <sys/systm.h> 36#include <sys/bus.h> 37#include <sys/rman.h> 38#include <sys/condvar.h> --- 21 unchanged lines hidden (view full) --- 60#define EHCI_HC_DEVSTR "AR71XX Integrated USB 2.0 controller" 61 62struct ar71xx_ehci_softc { 63 ehci_softc_t base; /* storage for EHCI code */ 64}; 65 66static device_attach_t ar71xx_ehci_attach; 67static device_detach_t ar71xx_ehci_detach; | 31 32#include "opt_bus.h" 33 34#include <sys/param.h> 35#include <sys/systm.h> 36#include <sys/bus.h> 37#include <sys/rman.h> 38#include <sys/condvar.h> --- 21 unchanged lines hidden (view full) --- 60#define EHCI_HC_DEVSTR "AR71XX Integrated USB 2.0 controller" 61 62struct ar71xx_ehci_softc { 63 ehci_softc_t base; /* storage for EHCI code */ 64}; 65 66static device_attach_t ar71xx_ehci_attach; 67static device_detach_t ar71xx_ehci_detach; |
68static device_shutdown_t ar71xx_ehci_shutdown; 69static device_suspend_t ar71xx_ehci_suspend; 70static device_resume_t ar71xx_ehci_resume; | |
71 72bs_r_1_proto(reversed); 73bs_w_1_proto(reversed); 74 75static int | 68 69bs_r_1_proto(reversed); 70bs_w_1_proto(reversed); 71 72static int |
76ar71xx_ehci_suspend(device_t self) 77{ 78 ehci_softc_t *sc = device_get_softc(self); 79 int err; 80 81 err = bus_generic_suspend(self); 82 if (err) 83 return (err); 84 ehci_suspend(sc); 85 return (0); 86} 87 88static int 89ar71xx_ehci_resume(device_t self) 90{ 91 ehci_softc_t *sc = device_get_softc(self); 92 93 ehci_resume(sc); 94 95 bus_generic_resume(self); 96 97 return (0); 98} 99 100static int 101ar71xx_ehci_shutdown(device_t self) 102{ 103 ehci_softc_t *sc = device_get_softc(self); 104 int err; 105 106 err = bus_generic_shutdown(self); 107 if (err) 108 return (err); 109 ehci_shutdown(sc); 110 111 return (0); 112} 113 114static int | |
115ar71xx_ehci_probe(device_t self) 116{ 117 118 device_set_desc(self, EHCI_HC_DEVSTR); 119 120 return (BUS_PROBE_DEFAULT); 121} 122 --- 152 unchanged lines hidden (view full) --- 275 return (0); 276} 277 278static device_method_t ehci_methods[] = { 279 /* Device interface */ 280 DEVMETHOD(device_probe, ar71xx_ehci_probe), 281 DEVMETHOD(device_attach, ar71xx_ehci_attach), 282 DEVMETHOD(device_detach, ar71xx_ehci_detach), | 73ar71xx_ehci_probe(device_t self) 74{ 75 76 device_set_desc(self, EHCI_HC_DEVSTR); 77 78 return (BUS_PROBE_DEFAULT); 79} 80 --- 152 unchanged lines hidden (view full) --- 233 return (0); 234} 235 236static device_method_t ehci_methods[] = { 237 /* Device interface */ 238 DEVMETHOD(device_probe, ar71xx_ehci_probe), 239 DEVMETHOD(device_attach, ar71xx_ehci_attach), 240 DEVMETHOD(device_detach, ar71xx_ehci_detach), |
283 DEVMETHOD(device_suspend, ar71xx_ehci_suspend), 284 DEVMETHOD(device_resume, ar71xx_ehci_resume), 285 DEVMETHOD(device_shutdown, ar71xx_ehci_shutdown), | 241 DEVMETHOD(device_suspend, bus_generic_suspend), 242 DEVMETHOD(device_resume, bus_generic_resume), 243 DEVMETHOD(device_shutdown, bus_generic_shutdown), |
286 287 DEVMETHOD_END 288}; 289 290static driver_t ehci_driver = { | 244 245 DEVMETHOD_END 246}; 247 248static driver_t ehci_driver = { |
291 "ehci", 292 ehci_methods, 293 sizeof(struct ar71xx_ehci_softc), | 249 .name = "ehci", 250 .methods = ehci_methods, 251 .size = sizeof(struct ar71xx_ehci_softc), |
294}; 295 296static devclass_t ehci_devclass; 297 298DRIVER_MODULE(ehci, nexus, ehci_driver, ehci_devclass, 0, 0); 299MODULE_DEPEND(ehci, usb, 1, 1, 1); | 252}; 253 254static devclass_t ehci_devclass; 255 256DRIVER_MODULE(ehci, nexus, ehci_driver, ehci_devclass, 0, 0); 257MODULE_DEPEND(ehci, usb, 1, 1, 1); |