summaryrefslogtreecommitdiffstats
path: root/sys/pci
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>1999-02-23 01:52:42 +0000
committerwpaul <wpaul@FreeBSD.org>1999-02-23 01:52:42 +0000
commit0296536212dfade61aa842de462affec233bc3aa (patch)
treec7261274b265841efc4755b6f61e4690b5b8d2d2 /sys/pci
parent422fcfce289dbbdc40e3de6addf6ab800af863dd (diff)
downloadFreeBSD-src-0296536212dfade61aa842de462affec233bc3aa.zip
FreeBSD-src-0296536212dfade61aa842de462affec233bc3aa.tar.gz
Minor updates for the ASIX AX88141, which is a newer version of the
AX88140A with power management and magic packet support. Correct the addresses of the PCI power management registers and add some code to detect the revision ID of the AX88141 and identify it in the probe messages. No other changes are needed since the AX88141 is functionally identical to the AX88140A.
Diffstat (limited to 'sys/pci')
-rw-r--r--sys/pci/if_ax.c17
-rw-r--r--sys/pci/if_axreg.h17
2 files changed, 24 insertions, 10 deletions
diff --git a/sys/pci/if_ax.c b/sys/pci/if_ax.c
index fedd345..a9e5d40 100644
--- a/sys/pci/if_ax.c
+++ b/sys/pci/if_ax.c
@@ -29,11 +29,11 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: if_ax.c,v 1.4 1999/01/28 00:57:52 dillon Exp $
+ * $Id: if_ax.c,v 1.9 1999/02/23 01:44:20 wpaul Exp $
*/
/*
- * ASIX AX88140A fast ethernet PCI NIC driver.
+ * ASIX AX88140A and AX88141 fast ethernet PCI NIC driver.
*
* Written by Bill Paul <wpaul@ctr.columbia.edu>
* Electrical Engineering Department
@@ -87,7 +87,7 @@
#ifndef lint
static const char rcsid[] =
- "$Id: if_ax.c,v 1.4 1999/01/28 00:57:52 dillon Exp $";
+ "$Id: if_ax.c,v 1.9 1999/02/23 01:44:20 wpaul Exp $";
#endif
/*
@@ -96,6 +96,8 @@ static const char rcsid[] =
static struct ax_type ax_devs[] = {
{ AX_VENDORID, AX_DEVICEID_AX88140A,
"ASIX AX88140A 10/100BaseTX" },
+ { AX_VENDORID, AX_DEVICEID_AX88140A,
+ "ASIX AX88141 10/100BaseTX" },
{ 0, 0, NULL }
};
@@ -1048,12 +1050,17 @@ ax_probe(config_id, device_id)
pcidi_t device_id;
{
struct ax_type *t;
+ u_int32_t rev;
t = ax_devs;
while(t->ax_name != NULL) {
if ((device_id & 0xFFFF) == t->ax_vid &&
((device_id >> 16) & 0xFFFF) == t->ax_did) {
+ /* Check the PCI revision */
+ rev = pci_conf_read(config_id, AX_PCI_REVID) & 0xFF;
+ if (rev >= AX_REVISION_88141)
+ t++;
return(t->ax_name);
}
t++;
@@ -2129,7 +2136,7 @@ static void ax_stop(sc)
sc->ax_cdata.ax_rx_chain[i].ax_mbuf = NULL;
}
}
- bzero((volatile char *)&sc->ax_ldata->ax_rx_list,
+ bzero((char *)&sc->ax_ldata->ax_rx_list,
sizeof(sc->ax_ldata->ax_rx_list));
/*
@@ -2142,7 +2149,7 @@ static void ax_stop(sc)
}
}
- bzero((volatile char *)&sc->ax_ldata->ax_tx_list,
+ bzero((char *)&sc->ax_ldata->ax_tx_list,
sizeof(sc->ax_ldata->ax_tx_list));
ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
diff --git a/sys/pci/if_axreg.h b/sys/pci/if_axreg.h
index 700c42c..6a78b51 100644
--- a/sys/pci/if_axreg.h
+++ b/sys/pci/if_axreg.h
@@ -29,7 +29,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: if_axreg.h,v 1.4 1999/01/16 20:33:34 wpaul Exp $
+ * $Id: if_axreg.h,v 1.5 1999/02/23 01:44:20 wpaul Exp $
*/
/*
@@ -391,6 +391,13 @@ struct ax_softc {
#define AX_DEVICEID_AX88140A 0x1400
/*
+ * The ASIX AX88140 and ASIX AX88141 have the same vendor and
+ * device IDs but different revision values.
+ */
+#define AX_REVISION_88140 0x00
+#define AX_REVISION_88141 0x10
+
+/*
* Texas Instruments PHY identifiers
*/
#define TI_PHY_VENDORID 0x4000
@@ -446,10 +453,10 @@ struct ax_softc {
#define AX_PCI_EEPROM_DATA 0x4C
/* power management registers */
-#define AX_PCI_CAPID 0xDC /* 8 bits */
-#define AX_PCI_NEXTPTR 0xDD /* 8 bits */
-#define AX_PCI_PWRMGMTCAP 0xDE /* 16 bits */
-#define AX_PCI_PWRMGMTCTRL 0xE0 /* 16 bits */
+#define AX_PCI_CAPID 0x44 /* 8 bits */
+#define AX_PCI_NEXTPTR 0x55 /* 8 bits */
+#define AX_PCI_PWRMGMTCAP 0x46 /* 16 bits */
+#define AX_PCI_PWRMGMTCTRL 0x48 /* 16 bits */
#define AX_PSTATE_MASK 0x0003
#define AX_PSTATE_D0 0x0000
OpenPOWER on IntegriCloud