rt305x_dotg.c (227849) | rt305x_dotg.c (228483) |
---|---|
1#include <sys/cdefs.h> | 1#include <sys/cdefs.h> |
2__FBSDID("$FreeBSD: head/sys/mips/rt305x/rt305x_dotg.c 227849 2011-11-22 21:56:55Z hselasky $"); | 2__FBSDID("$FreeBSD: head/sys/mips/rt305x/rt305x_dotg.c 228483 2011-12-14 00:28:54Z hselasky $"); |
3 4/*- 5 * Copyright (c) 2010,2011 Aleksandr Rybalko. All rights reserved. 6 * Copyright (c) 2007-2008 Hans Petter Selasky. All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions 10 * are met: --- 51 unchanged lines hidden (view full) --- 62#include <mips/rt305x/rt305xreg.h> 63#include <mips/rt305x/rt305x_sysctlvar.h> 64 65#define MEM_RID 0 66 67static device_probe_t dotg_obio_probe; 68static device_attach_t dotg_obio_attach; 69static device_detach_t dotg_obio_detach; | 3 4/*- 5 * Copyright (c) 2010,2011 Aleksandr Rybalko. All rights reserved. 6 * Copyright (c) 2007-2008 Hans Petter Selasky. All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions 10 * are met: --- 51 unchanged lines hidden (view full) --- 62#include <mips/rt305x/rt305xreg.h> 63#include <mips/rt305x/rt305x_sysctlvar.h> 64 65#define MEM_RID 0 66 67static device_probe_t dotg_obio_probe; 68static device_attach_t dotg_obio_attach; 69static device_detach_t dotg_obio_detach; |
70static device_shutdown_t dotg_obio_shutdown; | |
71 72struct dotg_obio_softc { 73 struct dotg_softc sc_dci; /* must be first */ 74}; 75 76static int 77dotg_obio_probe(device_t dev) 78{ --- 124 unchanged lines hidden (view full) --- 203 sc->sc_dci.sc_mem_res); 204 sc->sc_dci.sc_mem_res = NULL; 205 } 206 usb_bus_mem_free_all(&sc->sc_dci.sc_bus, NULL); 207 208 return (0); 209} 210 | 70 71struct dotg_obio_softc { 72 struct dotg_softc sc_dci; /* must be first */ 73}; 74 75static int 76dotg_obio_probe(device_t dev) 77{ --- 124 unchanged lines hidden (view full) --- 202 sc->sc_dci.sc_mem_res); 203 sc->sc_dci.sc_mem_res = NULL; 204 } 205 usb_bus_mem_free_all(&sc->sc_dci.sc_bus, NULL); 206 207 return (0); 208} 209 |
211static int 212dotg_obio_shutdown(device_t dev) 213{ 214 struct dotg_obio_softc *sc = device_get_softc(dev); 215 int err; 216 217 err = bus_generic_shutdown(dev); 218 if (err) 219 return (err); 220 221 dotg_uninit(&sc->sc_dci); 222 223 return (0); 224} 225 | |
226static device_method_t dotg_obio_methods[] = { 227 /* Device interface */ 228 DEVMETHOD(device_probe, dotg_obio_probe), 229 DEVMETHOD(device_attach, dotg_obio_attach), 230 DEVMETHOD(device_detach, dotg_obio_detach), | 210static device_method_t dotg_obio_methods[] = { 211 /* Device interface */ 212 DEVMETHOD(device_probe, dotg_obio_probe), 213 DEVMETHOD(device_attach, dotg_obio_attach), 214 DEVMETHOD(device_detach, dotg_obio_detach), |
231 DEVMETHOD(device_shutdown, dotg_obio_shutdown), | 215 DEVMETHOD(device_suspend, bus_generic_suspend), 216 DEVMETHOD(device_resume, bus_generic_resume), 217 DEVMETHOD(device_shutdown, bus_generic_shutdown), |
232 233 DEVMETHOD_END 234}; 235 236static driver_t dotg_obio_driver = { | 218 219 DEVMETHOD_END 220}; 221 222static driver_t dotg_obio_driver = { |
237 "dotg", 238 dotg_obio_methods, 239 sizeof(struct dotg_obio_softc), | 223 .name = "dotg", 224 .methods = dotg_obio_methods, 225 .size = sizeof(struct dotg_obio_softc), |
240}; 241 242static devclass_t dotg_obio_devclass; 243 244DRIVER_MODULE(dotg, obio, dotg_obio_driver, dotg_obio_devclass, 0, 0); | 226}; 227 228static devclass_t dotg_obio_devclass; 229 230DRIVER_MODULE(dotg, obio, dotg_obio_driver, dotg_obio_devclass, 0, 0); |