Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Mar 1999 13:11:07 -0700
From:      Wes Peters <wes@softweyr.com>
To:        freebsd-stable@freebsd.org, freebsd-net@freebsd.org
Subject:   [Fwd: fxp driver causing lockup]
Message-ID:  <36F15DDB.2996A3C8@softweyr.com>

next in thread | raw e-mail | index | archive | help
Dear -STABLE and -NET friends,

I and several other users have been having problems with the fxp0 driver
under FreeBSD 3.x.  Mike Spengler provided me with a code snippet that 
fixes the problem; the PCI bus code was no longer enabling bus mastering
so the driver had to do it.

Here is a patch that fixes the problem for my Toshiba Equuium 7000S with
on-board EEPro 100+.  Please, if any of you have 3.x with an EEPro 100,
test this patch even if you don't have the problem and get back to me
with your results.

Many thanks.

Here's the diff vs. 3.1-RELEASE:

*** if_fxp.c.orig       Wed Mar 17 17:06:51 1999
--- if_fxp.c    Wed Mar 17 17:23:09 1999
***************
*** 98,103 ****
--- 98,104 ----
  #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>

***************
*** 523,528 ****
--- 524,530 ----
        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)
***************
*** 531,536 ****
--- 533,545 ----
        callout_handle_init(&sc->stat_ch);

        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.


Thanks in advance for any testing you can provide.

-- 
             Where am I, and what am I doing in this handbasket?

Wes Peters                                                     +1.801.915.2061
Softweyr LLC                                                  wes@softweyr.com


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?36F15DDB.2996A3C8>