diff options
author | raj <raj@FreeBSD.org> | 2009-02-17 14:57:05 +0000 |
---|---|---|
committer | raj <raj@FreeBSD.org> | 2009-02-17 14:57:05 +0000 |
commit | fe8e0abcf53c6335cdb09c1bf1bd11c6b3fcb8df (patch) | |
tree | 6a7c1cddf95f5c82a405ff60e8bf160f8d6eb47b /sys/dev/tsec/if_tsec_ocp.c | |
parent | 11a3f6d70678aa71a8de150e7782914dbc0fe6ce (diff) | |
download | FreeBSD-src-fe8e0abcf53c6335cdb09c1bf1bd11c6b3fcb8df.zip FreeBSD-src-fe8e0abcf53c6335cdb09c1bf1bd11c6b3fcb8df.tar.gz |
Additional features for the tsec(4) Ethernet driver.
- interrupt coalescing
- polling
- jumbo frames
- multicast
- VLAN tagging
The enhanced version of the chip (eTSEC) can also take advantage of:
- TCP/IP checksum calculation h/w offloading
Obtained from: Freescale, Semihalf
Diffstat (limited to 'sys/dev/tsec/if_tsec_ocp.c')
-rw-r--r-- | sys/dev/tsec/if_tsec_ocp.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/sys/dev/tsec/if_tsec_ocp.c b/sys/dev/tsec/if_tsec_ocp.c index 5c1a74d..b65145b 100644 --- a/sys/dev/tsec/if_tsec_ocp.c +++ b/sys/dev/tsec/if_tsec_ocp.c @@ -134,15 +134,23 @@ tsec_ocp_probe(device_t dev) sc->sc_bas.bsh = rman_get_bushandle(sc->sc_rres); sc->sc_bas.bst = rman_get_bustag(sc->sc_rres); - /* Check that we actually have a TSEC at this address */ - id = TSEC_READ(sc, TSEC_REG_ID) | TSEC_READ(sc, TSEC_REG_ID2); + /* Check if we are eTSEC (enhanced TSEC) */ + id = TSEC_READ(sc, TSEC_REG_ID); + sc->is_etsec = ((id >> 16) == TSEC_ETSEC_ID) ? 1 : 0; + id |= TSEC_READ(sc, TSEC_REG_ID2); bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_rrid, sc->sc_rres); - if (id == 0) + if (id == 0) { + device_printf(dev, "could not identify TSEC type\n"); return (ENXIO); + } + + if (sc->is_etsec) + device_set_desc(dev, "Enhanced Three-Speed Ethernet Controller"); + else + device_set_desc(dev, "Three-Speed Ethernet Controller"); - device_set_desc(dev, "Three-Speed Ethernet Controller"); return (BUS_PROBE_DEFAULT); } @@ -167,6 +175,8 @@ tsec_ocp_attach(device_t dev) MTX_DEF); mtx_init(&sc->receive_lock, device_get_nameunit(dev), "TSEC RX lock", MTX_DEF); + mtx_init(&sc->ic_lock, device_get_nameunit(dev), "TSEC IC lock", + MTX_DEF); /* Allocate IO memory for TSEC registers */ sc->sc_rrid = 0; @@ -300,6 +310,7 @@ tsec_ocp_detach(device_t dev) /* Destroy locks */ mtx_destroy(&sc->receive_lock); mtx_destroy(&sc->transmit_lock); + mtx_destroy(&sc->ic_lock); return (0); } |