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:
parent
2a520986b3
commit
df373873b5
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=44907
@ -27,7 +27,7 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* 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 <machine/clock.h> /* for DELAY */
|
||||||
|
|
||||||
#include <pci/pcivar.h>
|
#include <pci/pcivar.h>
|
||||||
|
#include <pci/pcireg.h> /* for PCIM_CMD_xxx */
|
||||||
#include <pci/if_fxpreg.h>
|
#include <pci/if_fxpreg.h>
|
||||||
#include <pci/if_fxpvar.h>
|
#include <pci/if_fxpvar.h>
|
||||||
|
|
||||||
@ -529,6 +530,7 @@ fxp_attach(config_id, unit)
|
|||||||
vm_offset_t pbase;
|
vm_offset_t pbase;
|
||||||
struct ifnet *ifp;
|
struct ifnet *ifp;
|
||||||
int s;
|
int s;
|
||||||
|
u_long val;
|
||||||
|
|
||||||
sc = malloc(sizeof(struct fxp_softc), M_DEVBUF, M_NOWAIT);
|
sc = malloc(sizeof(struct fxp_softc), M_DEVBUF, M_NOWAIT);
|
||||||
if (sc == NULL)
|
if (sc == NULL)
|
||||||
@ -538,6 +540,13 @@ fxp_attach(config_id, unit)
|
|||||||
|
|
||||||
s = splimp();
|
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.
|
* Map control/status registers.
|
||||||
*/
|
*/
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* 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 <machine/clock.h> /* for DELAY */
|
||||||
|
|
||||||
#include <pci/pcivar.h>
|
#include <pci/pcivar.h>
|
||||||
|
#include <pci/pcireg.h> /* for PCIM_CMD_xxx */
|
||||||
#include <pci/if_fxpreg.h>
|
#include <pci/if_fxpreg.h>
|
||||||
#include <pci/if_fxpvar.h>
|
#include <pci/if_fxpvar.h>
|
||||||
|
|
||||||
@ -529,6 +530,7 @@ fxp_attach(config_id, unit)
|
|||||||
vm_offset_t pbase;
|
vm_offset_t pbase;
|
||||||
struct ifnet *ifp;
|
struct ifnet *ifp;
|
||||||
int s;
|
int s;
|
||||||
|
u_long val;
|
||||||
|
|
||||||
sc = malloc(sizeof(struct fxp_softc), M_DEVBUF, M_NOWAIT);
|
sc = malloc(sizeof(struct fxp_softc), M_DEVBUF, M_NOWAIT);
|
||||||
if (sc == NULL)
|
if (sc == NULL)
|
||||||
@ -538,6 +540,13 @@ fxp_attach(config_id, unit)
|
|||||||
|
|
||||||
s = splimp();
|
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.
|
* Map control/status registers.
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user