Lines Matching refs:dev
28 __FBSDID("$FreeBSD: releng/11.0/sys/dev/xe/if_xe_pccard.c 297000 2016-03-18 01:28:41Z jhibbits $");
51 #include <dev/xe/if_xereg.h>
52 #include <dev/xe/if_xevar.h>
54 #include <dev/pccard/pccardvar.h>
55 #include <dev/pccard/pccard_cis.h>
136 xe_cemfix(device_t dev)
138 struct xe_softc *sc = device_get_softc(dev);
141 DEVPRINTF(2, (dev, "cemfix\n"));
143 DEVPRINTF(1, (dev, "CEM I/O port 0x%0jx, size 0x%0jx\n",
144 bus_get_resource_start(dev, SYS_RES_IOPORT, sc->port_rid),
145 bus_get_resource_count(dev, SYS_RES_IOPORT, sc->port_rid)));
147 pccard_attr_write_1(dev, DINGO_ECOR, DINGO_ECOR_IRQ_LEVEL |
150 ioport = bus_get_resource_start(dev, SYS_RES_IOPORT, sc->port_rid);
151 pccard_attr_write_1(dev, DINGO_EBAR0, ioport & 0xff);
152 pccard_attr_write_1(dev, DINGO_EBAR1, (ioport >> 8) & 0xff);
155 pccard_attr_write_1(dev, DINGO_DCOR0, DINGO_DCOR0_SF_INT);
156 pccard_attr_write_1(dev, DINGO_DCOR1, DINGO_DCOR1_INT_LEVEL |
158 pccard_attr_write_1(dev, DINGO_DCOR2, 0x00);
159 pccard_attr_write_1(dev, DINGO_DCOR3, 0x00);
160 pccard_attr_write_1(dev, DINGO_DCOR4, 0x00);
167 xe_pccard_product_match(device_t dev, const struct pccard_product* ent,
177 pccard_get_prodext(dev, &prodext);
186 xe_pccard_get_product(device_t dev)
188 return ((const struct xe_pccard_product *)pccard_product_lookup(dev,
239 xe_pccard_attach(device_t dev)
241 struct xe_softc *scp = device_get_softc(dev);
251 DEVPRINTF(2, (dev, "pccard_attach\n"));
253 pccard_get_vendor(dev, &vendor);
254 pccard_get_product(dev, &product);
255 pccard_get_prodext(dev, &prodext);
256 pccard_get_vendor_str(dev, &vendor_str);
257 pccard_get_product_str(dev, &product_str);
258 pccard_get_cis3_str(dev, &cis3_str);
259 pccard_get_cis4_str(dev, &cis4_str);
261 DEVPRINTF(1, (dev, "vendor = 0x%04x\n", vendor));
262 DEVPRINTF(1, (dev, "product = 0x%04x\n", product));
263 DEVPRINTF(1, (dev, "prodext = 0x%02x\n", prodext));
264 DEVPRINTF(1, (dev, "vendor_str = %s\n", vendor_str));
265 DEVPRINTF(1, (dev, "product_str = %s\n", product_str));
266 DEVPRINTF(1, (dev, "cis3_str = %s\n", cis3_str));
267 DEVPRINTF(1, (dev, "cis4_str = %s\n", cis4_str));
269 xpp = xe_pccard_get_product(dev);
288 pccard_get_ether(dev, scp->enaddr);
292 !pccard_cis_scan(dev, xe_pccard_mac, scp->enaddr)) {
293 device_printf(dev,
295 device_get_desc(dev));
299 if ((err = xe_activate(dev)) != 0)
303 if (scp->modem && xe_cemfix(dev) < 0) {
304 device_printf(dev, "Unable to fix your %s combo card\n",
305 device_get_desc(dev));
306 xe_deactivate(dev);
309 if ((err = xe_attach(dev))) {
310 device_printf(dev, "xe_attach() failed! (%d)\n", err);
311 xe_deactivate(dev);
324 xe_pccard_detach(device_t dev)
326 struct xe_softc *sc = device_get_softc(dev);
328 DEVPRINTF(2, (dev, "pccard_detach\n"));
336 xe_deactivate(dev);
342 xe_pccard_probe(device_t dev)
346 DEVPRINTF(2, (dev, "pccard_probe\n"));
354 if ((xpp = xe_pccard_get_product(dev)) == NULL)
359 device_set_desc(dev, xpp->product.pp_name);
363 device_printf(dev, "Sorry, your %s card is not supported :(\n",
364 device_get_desc(dev));