Lines Matching refs:dev
32 __FBSDID("$FreeBSD: releng/11.0/sys/dev/altera/atse/if_atse_nexus.c 257336 2013-10-29 13:48:41Z nwhitehorn $");
52 #include <dev/mii/mii.h>
53 #include <dev/mii/miivar.h>
55 #include <dev/altera/atse/if_atsereg.h>
68 atse_resource_int(device_t dev, const char *resname, int *v)
72 error = resource_int_value(device_get_name(dev), device_get_unit(dev),
76 device_printf(dev, "could not fetch '%s' hint\n", resname);
84 atse_resource_long(device_t dev, const char *resname, long *v)
88 error = resource_long_value(device_get_name(dev), device_get_unit(dev),
92 device_printf(dev, "could not fetch '%s' hint\n", resname);
100 atse_probe_nexus(device_t dev)
112 error = atse_resource_int(dev, "rx_irq", &rid);
113 error += atse_resource_long(dev, "rx_maddr", &l);
114 error += atse_resource_long(dev, "rx_msize", &l);
115 error += atse_resource_long(dev, "rxc_maddr", &l);
116 error += atse_resource_long(dev, "rxc_msize", &l);
117 error += atse_resource_int(dev, "tx_irq", &rid);
118 error += atse_resource_long(dev, "tx_maddr", &l);
119 error += atse_resource_long(dev, "tx_msize", &l);
120 error += atse_resource_long(dev, "txc_maddr", &l);
121 error += atse_resource_long(dev, "txc_msize", &l);
126 res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE);
129 bus_release_resource(dev, SYS_RES_MEMORY, rid, res);
132 device_set_desc(dev, "Altera Triple-Speed Ethernet MegaCore");
137 atse_attach_nexus(device_t dev)
142 sc = device_get_softc(dev);
143 sc->atse_dev = dev;
144 sc->atse_unit = device_get_unit(dev);
147 error = atse_resource_int(dev, "rx_irq", &sc->atse_rx_irq);
148 error += atse_resource_long(dev, "rx_maddr", &sc->atse_rx_maddr);
149 error += atse_resource_long(dev, "rx_msize", &sc->atse_rx_msize);
150 error += atse_resource_long(dev, "rxc_maddr", &sc->atse_rxc_maddr);
151 error += atse_resource_long(dev, "rxc_msize", &sc->atse_rxc_msize);
152 error += atse_resource_int(dev, "tx_irq", &sc->atse_tx_irq);
153 error += atse_resource_long(dev, "tx_maddr", &sc->atse_tx_maddr);
154 error += atse_resource_long(dev, "tx_msize", &sc->atse_tx_msize);
155 error += atse_resource_long(dev, "txc_maddr", &sc->atse_txc_maddr);
156 error += atse_resource_long(dev, "txc_msize", &sc->atse_txc_msize);
162 sc->atse_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
165 device_printf(dev, "failed to map memory for ctrl region\n");
175 sc->atse_rx_irq_res = bus_alloc_resource(dev, SYS_RES_IRQ,
180 sc->atse_rx_mem_res = bus_alloc_resource(dev, SYS_RES_MEMORY,
184 device_printf(dev, "failed to map memory for RX\n");
188 sc->atse_rxc_mem_res = bus_alloc_resource(dev, SYS_RES_MEMORY,
192 device_printf(dev, "failed to map memory for RX control\n");
202 sc->atse_tx_irq_res = bus_alloc_resource(dev, SYS_RES_IRQ,
207 sc->atse_tx_mem_res = bus_alloc_resource(dev, SYS_RES_MEMORY,
211 device_printf(dev, "failed to map memory for TX\n");
215 sc->atse_txc_mem_res = bus_alloc_resource(dev, SYS_RES_MEMORY,
219 device_printf(dev, "failed to map memory for TX control\n");
223 error = atse_attach(dev);
231 atse_detach_resources(dev);