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
This commit is contained in:
Wes Peters 1999-03-20 04:51:25 +00:00
parent 2a520986b3
commit df373873b5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=44907
2 changed files with 20 additions and 2 deletions

View File

@ -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)
@ -538,6 +540,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.
*/

View File

@ -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)
@ -538,6 +540,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.
*/