diff options
author | wes <wes@FreeBSD.org> | 1999-03-20 04:51:25 +0000 |
---|---|---|
committer | wes <wes@FreeBSD.org> | 1999-03-20 04:51:25 +0000 |
commit | 0f81341182cb110610013cf015bec8e64b272e8e (patch) | |
tree | 5ef533ee06a6167aa7e5645dfae72b5cef605aaa /sys/dev | |
parent | e371fa9cc62067c3afa60926e76a90d1b44fa5a8 (diff) | |
download | FreeBSD-src-0f81341182cb110610013cf015bec8e64b272e8e.zip FreeBSD-src-0f81341182cb110610013cf015bec8e64b272e8e.tar.gz |
Turn on PCI bus mastering in driver attach routine
to avoid hanging the system if the BIOS has not
initialized the interface.
PR: 10150
Reviewed by: dg
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/fxp/if_fxp.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/dev/fxp/if_fxp.c b/sys/dev/fxp/if_fxp.c index 6568929..77f0ade 100644 --- a/sys/dev/fxp/if_fxp.c +++ b/sys/dev/fxp/if_fxp.c @@ -27,7 +27,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: if_fxp.c,v 1.64 1999/02/12 17:56:23 julian Exp $ + * $Id: if_fxp.c,v 1.65 1999/03/17 16:44:53 luigi Exp $ */ /* @@ -98,6 +98,7 @@ #include <machine/clock.h> /* for DELAY */ #include <pci/pcivar.h> +#include <pci/pcireg.h> /* for PCIM_CMD_xxx */ #include <pci/if_fxpreg.h> #include <pci/if_fxpvar.h> @@ -529,6 +530,7 @@ fxp_attach(config_id, unit) vm_offset_t pbase; struct ifnet *ifp; int s; + u_long val; sc = malloc(sizeof(struct fxp_softc), M_DEVBUF, M_NOWAIT); if (sc == NULL) @@ -539,6 +541,13 @@ fxp_attach(config_id, unit) s = splimp(); /* + * Enable bus mastering. + */ + val = pci_conf_read(config_id, PCI_COMMAND_STATUS_REG); + val |= (PCIM_CMD_MEMEN|PCIM_CMD_BUSMASTEREN); + pci_conf_write(config_id, PCI_COMMAND_STATUS_REG, val); + + /* * Map control/status registers. */ if (!pci_map_mem(config_id, FXP_PCI_MMBA, |