Date: Tue, 20 Nov 2007 06:44:45 GMT From: Kevin Lo <kevlo@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 129272 for review Message-ID: <200711200644.lAK6ijPa017042@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=129272 Change 129272 by kevlo@kevlo_rtsl on 2007/11/20 06:44:12 Use pci_enable_busmaster() to turn on busmaster Affected files ... .. //depot/projects/wifi/sys/dev/bwi/if_bwi_pci.c#4 edit Differences ... ==== //depot/projects/wifi/sys/dev/bwi/if_bwi_pci.c#4 (text+ko) ==== @@ -110,36 +110,6 @@ return ENXIO; } -static u_int32_t -bwi_pci_setup(device_t dev) -{ - u_int32_t cmd; - - /* - * Enable memory mapping and bus mastering. - */ - cmd = pci_read_config(dev, PCIR_COMMAND, 4); - cmd |= PCIM_CMD_MEMEN | PCIM_CMD_BUSMASTEREN; - pci_write_config(dev, PCIR_COMMAND, cmd, 4); - cmd = pci_read_config(dev, PCIR_COMMAND, 4); - if ((cmd & PCIM_CMD_MEMEN) == 0) { - device_printf(dev, "failed to enable memory mapping\n"); - return 0; - } - if ((cmd & PCIM_CMD_BUSMASTEREN) == 0) { - device_printf(dev, "failed to enable bus mastering\n"); - return 0; - } - - /* - * Disable retry timeout to keep PCI Tx retries from - * interfering with C3 CPU state. - */ - pci_write_config(dev, PCIR_RETRY_TIMEOUT, 0, 1); - - return 1; -} - static int bwi_pci_attach(device_t dev) { @@ -149,8 +119,10 @@ sc->sc_dev = dev; - if (!bwi_pci_setup(dev)) - goto bad; + /* + * Enable bus mastering. + */ + pci_enable_busmaster(dev); /* * Setup memory-mapping of PCI registers. @@ -251,9 +223,6 @@ { struct bwi_pci_softc *psc = device_get_softc(dev); - if (!bwi_pci_setup(dev)) - return ENXIO; - bwi_resume(&psc->sc_sc); return (0);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200711200644.lAK6ijPa017042>