ehci_ixp4xx.c (227849) | ehci_ixp4xx.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 * IXP435 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 * IXP435 attachment driver for the USB Enhanced Host Controller. 27 */ 28 29#include <sys/cdefs.h> |
30__FBSDID("$FreeBSD: head/sys/dev/usb/controller/ehci_ixp4xx.c 227849 2011-11-22 21:56:55Z hselasky $"); | 30__FBSDID("$FreeBSD: head/sys/dev/usb/controller/ehci_ixp4xx.c 228483 2011-12-14 00:28:54Z hselasky $"); |
31 32#include "opt_bus.h" 33 34#include <sys/stdint.h> 35#include <sys/stddef.h> 36#include <sys/param.h> 37#include <sys/queue.h> 38#include <sys/types.h> --- 34 unchanged lines hidden (view full) --- 73 ehci_softc_t base; /* storage for EHCI code */ 74 bus_space_tag_t iot; 75 bus_space_handle_t ioh; 76 struct bus_space tag; /* tag for private bus space ops */ 77}; 78 79static device_attach_t ehci_ixp_attach; 80static device_detach_t ehci_ixp_detach; | 31 32#include "opt_bus.h" 33 34#include <sys/stdint.h> 35#include <sys/stddef.h> 36#include <sys/param.h> 37#include <sys/queue.h> 38#include <sys/types.h> --- 34 unchanged lines hidden (view full) --- 73 ehci_softc_t base; /* storage for EHCI code */ 74 bus_space_tag_t iot; 75 bus_space_handle_t ioh; 76 struct bus_space tag; /* tag for private bus space ops */ 77}; 78 79static device_attach_t ehci_ixp_attach; 80static device_detach_t ehci_ixp_detach; |
81static device_shutdown_t ehci_ixp_shutdown; 82static device_suspend_t ehci_ixp_suspend; 83static device_resume_t ehci_ixp_resume; | |
84 85static uint8_t ehci_bs_r_1(void *, bus_space_handle_t, bus_size_t); 86static void ehci_bs_w_1(void *, bus_space_handle_t, bus_size_t, u_int8_t); 87static uint16_t ehci_bs_r_2(void *, bus_space_handle_t, bus_size_t); 88static void ehci_bs_w_2(void *, bus_space_handle_t, bus_size_t, uint16_t); 89static uint32_t ehci_bs_r_4(void *, bus_space_handle_t, bus_size_t); 90static void ehci_bs_w_4(void *, bus_space_handle_t, bus_size_t, uint32_t); 91 92static int | 81 82static uint8_t ehci_bs_r_1(void *, bus_space_handle_t, bus_size_t); 83static void ehci_bs_w_1(void *, bus_space_handle_t, bus_size_t, u_int8_t); 84static uint16_t ehci_bs_r_2(void *, bus_space_handle_t, bus_size_t); 85static void ehci_bs_w_2(void *, bus_space_handle_t, bus_size_t, uint16_t); 86static uint32_t ehci_bs_r_4(void *, bus_space_handle_t, bus_size_t); 87static void ehci_bs_w_4(void *, bus_space_handle_t, bus_size_t, uint32_t); 88 89static int |
93ehci_ixp_suspend(device_t self) 94{ 95 ehci_softc_t *sc = device_get_softc(self); 96 int err; 97 98 err = bus_generic_suspend(self); 99 if (err) 100 return (err); 101 ehci_suspend(sc); 102 return (0); 103} 104 105static int 106ehci_ixp_resume(device_t self) 107{ 108 ehci_softc_t *sc = device_get_softc(self); 109 110 ehci_resume(sc); 111 112 bus_generic_resume(self); 113 114 return (0); 115} 116 117static int 118ehci_ixp_shutdown(device_t self) 119{ 120 ehci_softc_t *sc = device_get_softc(self); 121 int err; 122 123 err = bus_generic_shutdown(self); 124 if (err) 125 return (err); 126 ehci_shutdown(sc); 127 128 return (0); 129} 130 131static int | |
132ehci_ixp_probe(device_t self) 133{ 134 135 device_set_desc(self, EHCI_HC_DEVSTR); 136 137 return (BUS_PROBE_DEFAULT); 138} 139 --- 190 unchanged lines hidden (view full) --- 330 bus_space_write_4((bus_space_tag_t) t, h, 0x100 + o, v); 331} 332 333static device_method_t ehci_methods[] = { 334 /* Device interface */ 335 DEVMETHOD(device_probe, ehci_ixp_probe), 336 DEVMETHOD(device_attach, ehci_ixp_attach), 337 DEVMETHOD(device_detach, ehci_ixp_detach), | 90ehci_ixp_probe(device_t self) 91{ 92 93 device_set_desc(self, EHCI_HC_DEVSTR); 94 95 return (BUS_PROBE_DEFAULT); 96} 97 --- 190 unchanged lines hidden (view full) --- 288 bus_space_write_4((bus_space_tag_t) t, h, 0x100 + o, v); 289} 290 291static device_method_t ehci_methods[] = { 292 /* Device interface */ 293 DEVMETHOD(device_probe, ehci_ixp_probe), 294 DEVMETHOD(device_attach, ehci_ixp_attach), 295 DEVMETHOD(device_detach, ehci_ixp_detach), |
338 DEVMETHOD(device_suspend, ehci_ixp_suspend), 339 DEVMETHOD(device_resume, ehci_ixp_resume), 340 DEVMETHOD(device_shutdown, ehci_ixp_shutdown), | 296 DEVMETHOD(device_suspend, bus_generic_suspend), 297 DEVMETHOD(device_resume, bus_generic_resume), 298 DEVMETHOD(device_shutdown, bus_generic_shutdown), |
341 342 DEVMETHOD_END 343}; 344 345static driver_t ehci_driver = { 346 "ehci", 347 ehci_methods, 348 sizeof(struct ixp_ehci_softc), 349}; 350 351static devclass_t ehci_devclass; 352 353DRIVER_MODULE(ehci, ixp, ehci_driver, ehci_devclass, 0, 0); 354MODULE_DEPEND(ehci, usb, 1, 1, 1); | 299 300 DEVMETHOD_END 301}; 302 303static driver_t ehci_driver = { 304 "ehci", 305 ehci_methods, 306 sizeof(struct ixp_ehci_softc), 307}; 308 309static devclass_t ehci_devclass; 310 311DRIVER_MODULE(ehci, ixp, ehci_driver, ehci_devclass, 0, 0); 312MODULE_DEPEND(ehci, usb, 1, 1, 1); |