dec21xxx: Sync with FreeBSD 11.1.
Same Jamfile cleanups as in previous commits.
This commit is contained in:
@@ -18,9 +18,6 @@ SubInclude HAIKU_TOP src add-ons kernel drivers network vlance ;
|
|||||||
SubInclude HAIKU_TOP src add-ons kernel drivers network wb840 ;
|
SubInclude HAIKU_TOP src add-ons kernel drivers network wb840 ;
|
||||||
#SubInclude HAIKU_TOP src add-ons kernel drivers network dp83815
|
#SubInclude HAIKU_TOP src add-ons kernel drivers network dp83815
|
||||||
|
|
||||||
# FreeBSD 9.2 drivers
|
|
||||||
SubInclude HAIKU_TOP src add-ons kernel drivers network dec21xxx ;
|
|
||||||
|
|
||||||
# FreeBSD 9.3 drivers
|
# FreeBSD 9.3 drivers
|
||||||
SubInclude HAIKU_TOP src add-ons kernel drivers network jmicron2x0 ;
|
SubInclude HAIKU_TOP src add-ons kernel drivers network jmicron2x0 ;
|
||||||
|
|
||||||
@@ -32,6 +29,7 @@ SubInclude HAIKU_TOP src add-ons kernel drivers network attansic_l1 ;
|
|||||||
SubInclude HAIKU_TOP src add-ons kernel drivers network attansic_l2 ;
|
SubInclude HAIKU_TOP src add-ons kernel drivers network attansic_l2 ;
|
||||||
SubInclude HAIKU_TOP src add-ons kernel drivers network broadcom440x ;
|
SubInclude HAIKU_TOP src add-ons kernel drivers network broadcom440x ;
|
||||||
SubInclude HAIKU_TOP src add-ons kernel drivers network broadcom570x ;
|
SubInclude HAIKU_TOP src add-ons kernel drivers network broadcom570x ;
|
||||||
|
SubInclude HAIKU_TOP src add-ons kernel drivers network dec21xxx ;
|
||||||
SubInclude HAIKU_TOP src add-ons kernel drivers network ipro100 ;
|
SubInclude HAIKU_TOP src add-ons kernel drivers network ipro100 ;
|
||||||
SubInclude HAIKU_TOP src add-ons kernel drivers network ipro1000 ;
|
SubInclude HAIKU_TOP src add-ons kernel drivers network ipro1000 ;
|
||||||
SubInclude HAIKU_TOP src add-ons kernel drivers network marvell_yukon ;
|
SubInclude HAIKU_TOP src add-ons kernel drivers network marvell_yukon ;
|
||||||
|
|||||||
@@ -1,3 +1,36 @@
|
|||||||
SubDir HAIKU_TOP src add-ons kernel drivers network dec21xxx ;
|
SubDir HAIKU_TOP src add-ons kernel drivers network dec21xxx ;
|
||||||
|
|
||||||
SubInclude HAIKU_TOP src add-ons kernel drivers network dec21xxx dev ;
|
UseHeaders [ FDirName $(HAIKU_TOP) src libs compat freebsd11_network ] : true ;
|
||||||
|
UseHeaders [ FDirName $(HAIKU_TOP) src libs compat freebsd11_network compat ]
|
||||||
|
: true ;
|
||||||
|
UsePrivateHeaders net system ;
|
||||||
|
UsePrivateKernelHeaders ;
|
||||||
|
|
||||||
|
SubDirCcFlags [ FDefines _KERNEL=1 FBSD_DRIVER=1 ] ;
|
||||||
|
|
||||||
|
UseHeaders [ FDirName $(SUBDIR) ] : true ;
|
||||||
|
|
||||||
|
SEARCH_SOURCE += [ FDirName $(SUBDIR) dev mii ] ;
|
||||||
|
SEARCH_SOURCE += [ FDirName $(SUBDIR) dev dc ] ;
|
||||||
|
SEARCH_SOURCE += [ FDirName $(SUBDIR) dev de ] ;
|
||||||
|
|
||||||
|
KernelAddon dec21xxx :
|
||||||
|
glue.c
|
||||||
|
glue_de.c
|
||||||
|
dcphy.c
|
||||||
|
if_dc.c
|
||||||
|
pnphy.c
|
||||||
|
if_de.c
|
||||||
|
acphy.c
|
||||||
|
amphy.c
|
||||||
|
ukphy.c
|
||||||
|
ukphy_subr.c
|
||||||
|
: libfreebsd11_network.a
|
||||||
|
;
|
||||||
|
|
||||||
|
ObjectHdrs [ FGristFiles dcphy$(SUFOBJ) pnphy$(SUFOBJ) if_de$(SUFOBJ)
|
||||||
|
acphy$(SUFOBJ) amphy$(SUFOBJ) ukphy$(SUFOBJ) ]
|
||||||
|
: [ FDirName $(TARGET_COMMON_DEBUG_OBJECT_DIR_$(TARGET_PACKAGING_ARCH)) libs
|
||||||
|
compat freebsd11_network ] ;
|
||||||
|
Includes [ FGristFiles dcphy.c pnphy.c acphy.c amphy.c ]
|
||||||
|
: <src!libs!compat!freebsd11_network>miidevs.h ;
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
SubDir HAIKU_TOP src add-ons kernel drivers network dec21xxx dev ;
|
|
||||||
|
|
||||||
SubInclude HAIKU_TOP src add-ons kernel drivers network dec21xxx dev mii ;
|
|
||||||
SubInclude HAIKU_TOP src add-ons kernel drivers network dec21xxx dev dc ;
|
|
||||||
SubInclude HAIKU_TOP src add-ons kernel drivers network dec21xxx dev de ;
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
SubDir HAIKU_TOP src add-ons kernel drivers network dec21xxx dev dc ;
|
|
||||||
|
|
||||||
UseHeaders [ FDirName $(SUBDIR) .. .. ] : true ;
|
|
||||||
UseHeaders [ FDirName $(HAIKU_TOP) src libs compat freebsd_network ] : true ;
|
|
||||||
UseHeaders [ FDirName $(HAIKU_TOP) src libs compat freebsd_network compat ] : true ;
|
|
||||||
|
|
||||||
UsePrivateHeaders net ;
|
|
||||||
UsePrivateKernelHeaders ;
|
|
||||||
|
|
||||||
SubDirCcFlags [ FDefines _KERNEL=1 FBSD_DRIVER=1 ] ;
|
|
||||||
|
|
||||||
KernelAddon dec21xxx :
|
|
||||||
dcphy.c
|
|
||||||
if_dc.c
|
|
||||||
glue.c
|
|
||||||
pnphy.c
|
|
||||||
: libfreebsd_network.a dec21xxx_mii.a dec21xxx_de.a
|
|
||||||
;
|
|
||||||
|
|
||||||
ObjectHdrs [ FGristFiles dcphy$(SUFOBJ) pnphy$(SUFOBJ) ]
|
|
||||||
: [ FDirName $(TARGET_COMMON_DEBUG_OBJECT_DIR_$(TARGET_PACKAGING_ARCH)) libs
|
|
||||||
compat freebsd_network ] ;
|
|
||||||
Includes [ FGristFiles dcphy.c pnphy.c ]
|
|
||||||
: <src!libs!compat!freebsd_network>miidevs.h ;
|
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__FBSDID("$FreeBSD$");
|
__FBSDID("$FreeBSD: releng/11.1/sys/dev/dc/dcphy.c 266974 2014-06-02 17:54:39Z marcel $");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Pseudo-driver for internal NWAY support on DEC 21143 and workalike
|
* Pseudo-driver for internal NWAY support on DEC 21143 and workalike
|
||||||
@@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include <sys/bus.h>
|
#include <sys/bus.h>
|
||||||
|
|
||||||
#include <net/if.h>
|
#include <net/if.h>
|
||||||
|
#include <net/if_var.h>
|
||||||
#include <net/if_arp.h>
|
#include <net/if_arp.h>
|
||||||
#include <net/if_media.h>
|
#include <net/if_media.h>
|
||||||
|
|
||||||
@@ -152,7 +153,7 @@ dcphy_attach(device_t dev)
|
|||||||
&dcphy_funcs, 0);
|
&dcphy_funcs, 0);
|
||||||
|
|
||||||
/*PHY_RESET(sc);*/
|
/*PHY_RESET(sc);*/
|
||||||
dc_sc = sc->mii_pdata->mii_ifp->if_softc;
|
dc_sc = if_getsoftc(sc->mii_pdata->mii_ifp);
|
||||||
CSR_WRITE_4(dc_sc, DC_10BTSTAT, 0);
|
CSR_WRITE_4(dc_sc, DC_10BTSTAT, 0);
|
||||||
CSR_WRITE_4(dc_sc, DC_10BTCTRL, 0);
|
CSR_WRITE_4(dc_sc, DC_10BTCTRL, 0);
|
||||||
|
|
||||||
@@ -190,7 +191,7 @@ dcphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
|
|||||||
int reg;
|
int reg;
|
||||||
u_int32_t mode;
|
u_int32_t mode;
|
||||||
|
|
||||||
dc_sc = mii->mii_ifp->if_softc;
|
dc_sc = if_getsoftc(mii->mii_ifp);
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case MII_POLLSTAT:
|
case MII_POLLSTAT:
|
||||||
@@ -200,7 +201,7 @@ dcphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
|
|||||||
/*
|
/*
|
||||||
* If the interface is not up, don't do anything.
|
* If the interface is not up, don't do anything.
|
||||||
*/
|
*/
|
||||||
if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
|
if ((if_getflags(mii->mii_ifp) & IFF_UP) == 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
mii->mii_media_active = IFM_NONE;
|
mii->mii_media_active = IFM_NONE;
|
||||||
@@ -250,7 +251,7 @@ dcphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
|
|||||||
/*
|
/*
|
||||||
* Is the interface even up?
|
* Is the interface even up?
|
||||||
*/
|
*/
|
||||||
if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
|
if ((if_getflags(mii->mii_ifp) & IFF_UP) == 0)
|
||||||
return (0);
|
return (0);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -297,12 +298,12 @@ dcphy_status(struct mii_softc *sc)
|
|||||||
int anlpar, tstat;
|
int anlpar, tstat;
|
||||||
struct dc_softc *dc_sc;
|
struct dc_softc *dc_sc;
|
||||||
|
|
||||||
dc_sc = mii->mii_ifp->if_softc;
|
dc_sc = if_getsoftc(mii->mii_ifp);
|
||||||
|
|
||||||
mii->mii_media_status = IFM_AVALID;
|
mii->mii_media_status = IFM_AVALID;
|
||||||
mii->mii_media_active = IFM_ETHER;
|
mii->mii_media_active = IFM_ETHER;
|
||||||
|
|
||||||
if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
|
if ((if_getflags(mii->mii_ifp) & IFF_UP) == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
tstat = CSR_READ_4(dc_sc, DC_10BTSTAT);
|
tstat = CSR_READ_4(dc_sc, DC_10BTSTAT);
|
||||||
@@ -377,7 +378,7 @@ dcphy_auto(struct mii_softc *mii)
|
|||||||
{
|
{
|
||||||
struct dc_softc *sc;
|
struct dc_softc *sc;
|
||||||
|
|
||||||
sc = mii->mii_pdata->mii_ifp->if_softc;
|
sc = if_getsoftc(mii->mii_pdata->mii_ifp);
|
||||||
|
|
||||||
DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_PORTSEL);
|
DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_PORTSEL);
|
||||||
DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_FULLDUPLEX);
|
DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_FULLDUPLEX);
|
||||||
@@ -398,7 +399,7 @@ dcphy_reset(struct mii_softc *mii)
|
|||||||
{
|
{
|
||||||
struct dc_softc *sc;
|
struct dc_softc *sc;
|
||||||
|
|
||||||
sc = mii->mii_pdata->mii_ifp->if_softc;
|
sc = if_getsoftc(mii->mii_pdata->mii_ifp);
|
||||||
|
|
||||||
DC_CLRBIT(sc, DC_SIARESET, DC_SIA_RESET);
|
DC_CLRBIT(sc, DC_SIARESET, DC_SIA_RESET);
|
||||||
DELAY(1000);
|
DELAY(1000);
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__FBSDID("$FreeBSD$");
|
__FBSDID("$FreeBSD: releng/11.1/sys/dev/dc/if_dc.c 277565 2015-01-23 15:14:30Z kevlo $");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* DEC "tulip" clone ethernet driver. Supports the DEC/Intel 21143
|
* DEC "tulip" clone ethernet driver. Supports the DEC/Intel 21143
|
||||||
@@ -107,6 +107,7 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
|
||||||
#include <net/if.h>
|
#include <net/if.h>
|
||||||
|
#include <net/if_var.h>
|
||||||
#include <net/if_arp.h>
|
#include <net/if_arp.h>
|
||||||
#include <net/ethernet.h>
|
#include <net/ethernet.h>
|
||||||
#include <net/if_dl.h>
|
#include <net/if_dl.h>
|
||||||
@@ -670,20 +671,16 @@ dc_miibus_readreg(device_t dev, int phy, int reg)
|
|||||||
* code think there's a PHY here.
|
* code think there's a PHY here.
|
||||||
*/
|
*/
|
||||||
return (BMSR_MEDIAMASK);
|
return (BMSR_MEDIAMASK);
|
||||||
break;
|
|
||||||
case MII_PHYIDR1:
|
case MII_PHYIDR1:
|
||||||
if (DC_IS_PNIC(sc))
|
if (DC_IS_PNIC(sc))
|
||||||
return (DC_VENDORID_LO);
|
return (DC_VENDORID_LO);
|
||||||
return (DC_VENDORID_DEC);
|
return (DC_VENDORID_DEC);
|
||||||
break;
|
|
||||||
case MII_PHYIDR2:
|
case MII_PHYIDR2:
|
||||||
if (DC_IS_PNIC(sc))
|
if (DC_IS_PNIC(sc))
|
||||||
return (DC_DEVICEID_82C168);
|
return (DC_DEVICEID_82C168);
|
||||||
return (DC_DEVICEID_21143);
|
return (DC_DEVICEID_21143);
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
return (0);
|
return (0);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
return (0);
|
return (0);
|
||||||
@@ -747,7 +744,6 @@ dc_miibus_readreg(device_t dev, int phy, int reg)
|
|||||||
device_printf(dev, "phy_read: bad phy register %x\n",
|
device_printf(dev, "phy_read: bad phy register %x\n",
|
||||||
reg);
|
reg);
|
||||||
return (0);
|
return (0);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
rval = CSR_READ_4(sc, phy_reg) & 0x0000FFFF;
|
rval = CSR_READ_4(sc, phy_reg) & 0x0000FFFF;
|
||||||
@@ -1981,9 +1977,9 @@ dc_dma_free(struct dc_softc *sc)
|
|||||||
|
|
||||||
/* RX descriptor list. */
|
/* RX descriptor list. */
|
||||||
if (sc->dc_rx_ltag) {
|
if (sc->dc_rx_ltag) {
|
||||||
if (sc->dc_rx_lmap != NULL)
|
if (sc->dc_ldata.dc_rx_list_paddr != 0)
|
||||||
bus_dmamap_unload(sc->dc_rx_ltag, sc->dc_rx_lmap);
|
bus_dmamap_unload(sc->dc_rx_ltag, sc->dc_rx_lmap);
|
||||||
if (sc->dc_rx_lmap != NULL && sc->dc_ldata.dc_rx_list != NULL)
|
if (sc->dc_ldata.dc_rx_list != NULL)
|
||||||
bus_dmamem_free(sc->dc_rx_ltag, sc->dc_ldata.dc_rx_list,
|
bus_dmamem_free(sc->dc_rx_ltag, sc->dc_ldata.dc_rx_list,
|
||||||
sc->dc_rx_lmap);
|
sc->dc_rx_lmap);
|
||||||
bus_dma_tag_destroy(sc->dc_rx_ltag);
|
bus_dma_tag_destroy(sc->dc_rx_ltag);
|
||||||
@@ -1991,9 +1987,9 @@ dc_dma_free(struct dc_softc *sc)
|
|||||||
|
|
||||||
/* TX descriptor list. */
|
/* TX descriptor list. */
|
||||||
if (sc->dc_tx_ltag) {
|
if (sc->dc_tx_ltag) {
|
||||||
if (sc->dc_tx_lmap != NULL)
|
if (sc->dc_ldata.dc_tx_list_paddr != 0)
|
||||||
bus_dmamap_unload(sc->dc_tx_ltag, sc->dc_tx_lmap);
|
bus_dmamap_unload(sc->dc_tx_ltag, sc->dc_tx_lmap);
|
||||||
if (sc->dc_tx_lmap != NULL && sc->dc_ldata.dc_tx_list != NULL)
|
if (sc->dc_ldata.dc_tx_list != NULL)
|
||||||
bus_dmamem_free(sc->dc_tx_ltag, sc->dc_ldata.dc_tx_list,
|
bus_dmamem_free(sc->dc_tx_ltag, sc->dc_ldata.dc_tx_list,
|
||||||
sc->dc_tx_lmap);
|
sc->dc_tx_lmap);
|
||||||
bus_dma_tag_destroy(sc->dc_tx_ltag);
|
bus_dma_tag_destroy(sc->dc_tx_ltag);
|
||||||
@@ -2001,9 +1997,9 @@ dc_dma_free(struct dc_softc *sc)
|
|||||||
|
|
||||||
/* multicast setup frame. */
|
/* multicast setup frame. */
|
||||||
if (sc->dc_stag) {
|
if (sc->dc_stag) {
|
||||||
if (sc->dc_smap != NULL)
|
if (sc->dc_saddr != 0)
|
||||||
bus_dmamap_unload(sc->dc_stag, sc->dc_smap);
|
bus_dmamap_unload(sc->dc_stag, sc->dc_smap);
|
||||||
if (sc->dc_smap != NULL && sc->dc_cdata.dc_sbuf != NULL)
|
if (sc->dc_cdata.dc_sbuf != NULL)
|
||||||
bus_dmamem_free(sc->dc_stag, sc->dc_cdata.dc_sbuf,
|
bus_dmamem_free(sc->dc_stag, sc->dc_cdata.dc_sbuf,
|
||||||
sc->dc_smap);
|
sc->dc_smap);
|
||||||
bus_dma_tag_destroy(sc->dc_stag);
|
bus_dma_tag_destroy(sc->dc_stag);
|
||||||
@@ -2483,7 +2479,7 @@ dc_attach(device_t dev)
|
|||||||
/*
|
/*
|
||||||
* Tell the upper layer(s) we support long frames.
|
* Tell the upper layer(s) we support long frames.
|
||||||
*/
|
*/
|
||||||
ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header);
|
ifp->if_hdrlen = sizeof(struct ether_vlan_header);
|
||||||
ifp->if_capabilities |= IFCAP_VLAN_MTU;
|
ifp->if_capabilities |= IFCAP_VLAN_MTU;
|
||||||
ifp->if_capenable = ifp->if_capabilities;
|
ifp->if_capenable = ifp->if_capabilities;
|
||||||
#ifdef DEVICE_POLLING
|
#ifdef DEVICE_POLLING
|
||||||
@@ -2914,9 +2910,9 @@ dc_rxeof(struct dc_softc *sc)
|
|||||||
(rxstat & (DC_RXSTAT_CRCERR | DC_RXSTAT_DRIBBLE |
|
(rxstat & (DC_RXSTAT_CRCERR | DC_RXSTAT_DRIBBLE |
|
||||||
DC_RXSTAT_MIIERE | DC_RXSTAT_COLLSEEN |
|
DC_RXSTAT_MIIERE | DC_RXSTAT_COLLSEEN |
|
||||||
DC_RXSTAT_RUNT | DC_RXSTAT_DE))) {
|
DC_RXSTAT_RUNT | DC_RXSTAT_DE))) {
|
||||||
ifp->if_ierrors++;
|
if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
|
||||||
if (rxstat & DC_RXSTAT_COLLSEEN)
|
if (rxstat & DC_RXSTAT_COLLSEEN)
|
||||||
ifp->if_collisions++;
|
if_inc_counter(ifp, IFCOUNTER_COLLISIONS, 1);
|
||||||
dc_discard_rxbuf(sc, i);
|
dc_discard_rxbuf(sc, i);
|
||||||
if (rxstat & DC_RXSTAT_CRCERR)
|
if (rxstat & DC_RXSTAT_CRCERR)
|
||||||
continue;
|
continue;
|
||||||
@@ -2942,7 +2938,7 @@ dc_rxeof(struct dc_softc *sc)
|
|||||||
*/
|
*/
|
||||||
if (dc_newbuf(sc, i) != 0) {
|
if (dc_newbuf(sc, i) != 0) {
|
||||||
dc_discard_rxbuf(sc, i);
|
dc_discard_rxbuf(sc, i);
|
||||||
ifp->if_iqdrops++;
|
if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
m->m_pkthdr.rcvif = ifp;
|
m->m_pkthdr.rcvif = ifp;
|
||||||
@@ -2955,14 +2951,14 @@ dc_rxeof(struct dc_softc *sc)
|
|||||||
ETHER_ALIGN, ifp, NULL);
|
ETHER_ALIGN, ifp, NULL);
|
||||||
dc_discard_rxbuf(sc, i);
|
dc_discard_rxbuf(sc, i);
|
||||||
if (m0 == NULL) {
|
if (m0 == NULL) {
|
||||||
ifp->if_iqdrops++;
|
if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
m = m0;
|
m = m0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ifp->if_ipackets++;
|
if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1);
|
||||||
DC_UNLOCK(sc);
|
DC_UNLOCK(sc);
|
||||||
(*ifp->if_input)(ifp, m);
|
(*ifp->if_input)(ifp, m);
|
||||||
DC_LOCK(sc);
|
DC_LOCK(sc);
|
||||||
@@ -3053,19 +3049,19 @@ dc_txeof(struct dc_softc *sc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (txstat & DC_TXSTAT_ERRSUM) {
|
if (txstat & DC_TXSTAT_ERRSUM) {
|
||||||
ifp->if_oerrors++;
|
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
|
||||||
if (txstat & DC_TXSTAT_EXCESSCOLL)
|
if (txstat & DC_TXSTAT_EXCESSCOLL)
|
||||||
ifp->if_collisions++;
|
if_inc_counter(ifp, IFCOUNTER_COLLISIONS, 1);
|
||||||
if (txstat & DC_TXSTAT_LATECOLL)
|
if (txstat & DC_TXSTAT_LATECOLL)
|
||||||
ifp->if_collisions++;
|
if_inc_counter(ifp, IFCOUNTER_COLLISIONS, 1);
|
||||||
if (!(txstat & DC_TXSTAT_UNDERRUN)) {
|
if (!(txstat & DC_TXSTAT_UNDERRUN)) {
|
||||||
ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
|
ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
|
||||||
dc_init_locked(sc);
|
dc_init_locked(sc);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
ifp->if_opackets++;
|
if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1);
|
||||||
ifp->if_collisions += (txstat & DC_TXSTAT_COLLCNT) >> 3;
|
if_inc_counter(ifp, IFCOUNTER_COLLISIONS, (txstat & DC_TXSTAT_COLLCNT) >> 3);
|
||||||
|
|
||||||
bus_dmamap_sync(sc->dc_tx_mtag, sc->dc_cdata.dc_tx_map[idx],
|
bus_dmamap_sync(sc->dc_tx_mtag, sc->dc_cdata.dc_tx_map[idx],
|
||||||
BUS_DMASYNC_POSTWRITE);
|
BUS_DMASYNC_POSTWRITE);
|
||||||
@@ -3260,7 +3256,7 @@ dc_poll(struct ifnet *ifp, enum poll_cmd cmd, int count)
|
|||||||
|
|
||||||
if (status & (DC_ISR_RX_WATDOGTIMEO | DC_ISR_RX_NOBUF)) {
|
if (status & (DC_ISR_RX_WATDOGTIMEO | DC_ISR_RX_NOBUF)) {
|
||||||
uint32_t r = CSR_READ_4(sc, DC_FRAMESDISCARDED);
|
uint32_t r = CSR_READ_4(sc, DC_FRAMESDISCARDED);
|
||||||
ifp->if_ierrors += (r & 0xffff) + ((r >> 17) & 0x7ff);
|
if_inc_counter(ifp, IFCOUNTER_IERRORS, (r & 0xffff) + ((r >> 17) & 0x7ff));
|
||||||
|
|
||||||
if (dc_rx_resync(sc))
|
if (dc_rx_resync(sc))
|
||||||
dc_rxeof(sc);
|
dc_rxeof(sc);
|
||||||
@@ -3342,7 +3338,7 @@ dc_intr(void *arg)
|
|||||||
if ((status & DC_ISR_RX_WATDOGTIMEO)
|
if ((status & DC_ISR_RX_WATDOGTIMEO)
|
||||||
|| (status & DC_ISR_RX_NOBUF)) {
|
|| (status & DC_ISR_RX_NOBUF)) {
|
||||||
r = CSR_READ_4(sc, DC_FRAMESDISCARDED);
|
r = CSR_READ_4(sc, DC_FRAMESDISCARDED);
|
||||||
ifp->if_ierrors += (r & 0xffff) + ((r >> 17) & 0x7ff);
|
if_inc_counter(ifp, IFCOUNTER_IERRORS, (r & 0xffff) + ((r >> 17) & 0x7ff));
|
||||||
if (dc_rxeof(sc) == 0) {
|
if (dc_rxeof(sc) == 0) {
|
||||||
while (dc_rx_resync(sc))
|
while (dc_rx_resync(sc))
|
||||||
dc_rxeof(sc);
|
dc_rxeof(sc);
|
||||||
@@ -3940,7 +3936,7 @@ dc_watchdog(void *xsc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ifp = sc->dc_ifp;
|
ifp = sc->dc_ifp;
|
||||||
ifp->if_oerrors++;
|
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
|
||||||
device_printf(sc->dc_dev, "watchdog timeout\n");
|
device_printf(sc->dc_dev, "watchdog timeout\n");
|
||||||
|
|
||||||
ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
|
ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||||
* THE POSSIBILITY OF SUCH DAMAGE.
|
* THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $FreeBSD$
|
* $FreeBSD: releng/11.1/sys/dev/dc/if_dcreg.h 227675 2011-11-18 19:38:19Z yongari $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__FBSDID("$FreeBSD$");
|
__FBSDID("$FreeBSD: releng/11.1/sys/dev/dc/pnphy.c 266974 2014-06-02 17:54:39Z marcel $");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Pseudo-driver for media selection on the Lite-On PNIC 82c168
|
* Pseudo-driver for media selection on the Lite-On PNIC 82c168
|
||||||
@@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include <sys/bus.h>
|
#include <sys/bus.h>
|
||||||
|
|
||||||
#include <net/if.h>
|
#include <net/if.h>
|
||||||
|
#include <net/if_var.h>
|
||||||
#include <net/if_arp.h>
|
#include <net/if_arp.h>
|
||||||
#include <net/if_media.h>
|
#include <net/if_media.h>
|
||||||
|
|
||||||
@@ -151,7 +152,7 @@ pnphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
|
|||||||
/*
|
/*
|
||||||
* If the interface is not up, don't do anything.
|
* If the interface is not up, don't do anything.
|
||||||
*/
|
*/
|
||||||
if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
|
if ((if_getflags(mii->mii_ifp) & IFF_UP) == 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -179,7 +180,7 @@ pnphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
|
|||||||
/*
|
/*
|
||||||
* Is the interface even up?
|
* Is the interface even up?
|
||||||
*/
|
*/
|
||||||
if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
|
if ((if_getflags(mii->mii_ifp) & IFF_UP) == 0)
|
||||||
return (0);
|
return (0);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@@ -200,7 +201,7 @@ pnphy_status(struct mii_softc *sc)
|
|||||||
int reg;
|
int reg;
|
||||||
struct dc_softc *dc_sc;
|
struct dc_softc *dc_sc;
|
||||||
|
|
||||||
dc_sc = mii->mii_ifp->if_softc;
|
dc_sc = if_getsoftc(mii->mii_ifp);
|
||||||
|
|
||||||
mii->mii_media_status = IFM_AVALID;
|
mii->mii_media_status = IFM_AVALID;
|
||||||
mii->mii_media_active = IFM_ETHER;
|
mii->mii_media_active = IFM_ETHER;
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
SubDir HAIKU_TOP src add-ons kernel drivers network dec21xxx dev de ;
|
|
||||||
|
|
||||||
UseHeaders [ FDirName $(SUBDIR) .. .. ] : true ;
|
|
||||||
UseHeaders [ FDirName $(HAIKU_TOP) src libs compat freebsd_network compat ] : true ;
|
|
||||||
|
|
||||||
UsePrivateHeaders net system ;
|
|
||||||
UsePrivateKernelHeaders ;
|
|
||||||
|
|
||||||
SubDirCcFlags [ FDefines _KERNEL=1 FBSD_DRIVER=1 ] ;
|
|
||||||
|
|
||||||
KernelStaticLibrary dec21xxx_de.a
|
|
||||||
:
|
|
||||||
glue.c
|
|
||||||
if_de.c
|
|
||||||
;
|
|
||||||
|
|
||||||
ObjectHdrs [ FGristFiles if_de$(SUFOBJ) ]
|
|
||||||
: [ FDirName $(TARGET_COMMON_DEBUG_OBJECT_DIR_$(TARGET_PACKAGING_ARCH)) libs
|
|
||||||
compat freebsd_network ] ;
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
/* $NetBSD: dc21040reg.h,v 1.15 1998/05/22 18:50:59 matt Exp $ */
|
/* $NetBSD: dc21040reg.h,v 1.15 1998/05/22 18:50:59 matt Exp $ */
|
||||||
|
|
||||||
/* $FreeBSD$ */
|
/* $FreeBSD: releng/11.1/sys/dev/de/dc21040reg.h 298955 2016-05-03 03:41:25Z pfg $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1994, 1995, 1996 Matt Thomas <matt@3am-software.com>
|
* Copyright (c) 1994, 1995, 1996 Matt Thomas <matt@3am-software.com>
|
||||||
@@ -175,7 +175,7 @@ typedef struct {
|
|||||||
#define TULIP_CMD_SCRAMBLER 0x01000000L /* (RW) Scrambler Mode (21140) */
|
#define TULIP_CMD_SCRAMBLER 0x01000000L /* (RW) Scrambler Mode (21140) */
|
||||||
#define TULIP_CMD_PCSFUNCTION 0x00800000L /* (RW) PCS Function (21140) */
|
#define TULIP_CMD_PCSFUNCTION 0x00800000L /* (RW) PCS Function (21140) */
|
||||||
#define TULIP_CMD_TXTHRSHLDCTL 0x00400000L /* (RW) Transmit Threshold Mode (21140) */
|
#define TULIP_CMD_TXTHRSHLDCTL 0x00400000L /* (RW) Transmit Threshold Mode (21140) */
|
||||||
#define TULIP_CMD_STOREFWD 0x00200000L /* (RW) Store and Foward (21140) */
|
#define TULIP_CMD_STOREFWD 0x00200000L /* (RW) Store and Forward (21140) */
|
||||||
#define TULIP_CMD_NOHEARTBEAT 0x00080000L /* (RW) No Heartbeat (21140) */
|
#define TULIP_CMD_NOHEARTBEAT 0x00080000L /* (RW) No Heartbeat (21140) */
|
||||||
#define TULIP_CMD_PORTSELECT 0x00040000L /* (RW) Post Select (100Mb) (21140) */
|
#define TULIP_CMD_PORTSELECT 0x00040000L /* (RW) Post Select (100Mb) (21140) */
|
||||||
#define TULIP_CMD_ENHCAPTEFFCT 0x00040000L /* (RW) Enhanced Capture Effecty (21041) */
|
#define TULIP_CMD_ENHCAPTEFFCT 0x00040000L /* (RW) Enhanced Capture Effecty (21041) */
|
||||||
|
|||||||
@@ -36,16 +36,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__FBSDID("$FreeBSD$");
|
__FBSDID("$FreeBSD: releng/11.1/sys/dev/de/if_de.c 315221 2017-03-14 02:06:03Z pfg $");
|
||||||
|
|
||||||
#define TULIP_HDR_DATA
|
#define TULIP_HDR_DATA
|
||||||
|
|
||||||
#ifndef __HAIKU__
|
|
||||||
/* We have no such header in Haiku's compat layer
|
|
||||||
but nothing of it is required anyway here. */
|
|
||||||
#include "opt_ddb.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/systm.h>
|
#include <sys/systm.h>
|
||||||
#include <sys/endian.h>
|
#include <sys/endian.h>
|
||||||
@@ -64,6 +58,7 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include <sys/rman.h>
|
#include <sys/rman.h>
|
||||||
|
|
||||||
#include <net/if.h>
|
#include <net/if.h>
|
||||||
|
#include <net/if_var.h>
|
||||||
#include <net/if_arp.h>
|
#include <net/if_arp.h>
|
||||||
#include <net/ethernet.h>
|
#include <net/ethernet.h>
|
||||||
#include <net/if_media.h>
|
#include <net/if_media.h>
|
||||||
@@ -422,7 +417,7 @@ tulip_linkup(tulip_softc_t * const sc, tulip_media_t media)
|
|||||||
* We could set probe_timeout to 0 but setting to 3000 puts this
|
* We could set probe_timeout to 0 but setting to 3000 puts this
|
||||||
* in one central place and the only matters is tulip_link is
|
* in one central place and the only matters is tulip_link is
|
||||||
* followed by a tulip_timeout. Therefore setting it should not
|
* followed by a tulip_timeout. Therefore setting it should not
|
||||||
* result in aberrant behavour.
|
* result in aberrant behaviour.
|
||||||
*/
|
*/
|
||||||
sc->tulip_probe_timeout = 3000;
|
sc->tulip_probe_timeout = 3000;
|
||||||
sc->tulip_probe_state = TULIP_PROBE_INACTIVE;
|
sc->tulip_probe_state = TULIP_PROBE_INACTIVE;
|
||||||
@@ -504,7 +499,7 @@ tulip_21140_gpr_media_sense(tulip_softc_t * const sc)
|
|||||||
mi->mi_actmask, mi->mi_actdata);
|
mi->mi_actmask, mi->mi_actdata);
|
||||||
#endif
|
#endif
|
||||||
/*
|
/*
|
||||||
* It does! If this is the first media we detected, then
|
* It does! If this is the first media we detected, then
|
||||||
* remember this media. If isn't the first, then there were
|
* remember this media. If isn't the first, then there were
|
||||||
* multiple matches which we equate to no match (since we don't
|
* multiple matches which we equate to no match (since we don't
|
||||||
* which to select (if any).
|
* which to select (if any).
|
||||||
@@ -1176,7 +1171,7 @@ tulip_21041_media_poll(tulip_softc_t * const sc,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* if no txprobe active
|
* if no txprobe active
|
||||||
*/
|
*/
|
||||||
if ((sc->tulip_flags & TULIP_TXPROBE_ACTIVE) == 0
|
if ((sc->tulip_flags & TULIP_TXPROBE_ACTIVE) == 0
|
||||||
&& ((sc->tulip_flags & TULIP_WANTRXACT) == 0
|
&& ((sc->tulip_flags & TULIP_WANTRXACT) == 0
|
||||||
@@ -1206,7 +1201,7 @@ tulip_21041_media_poll(tulip_softc_t * const sc,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Since this media failed to probe, try the other one.
|
* Since this media failed to probe, try the other one.
|
||||||
*/
|
*/
|
||||||
@@ -1271,7 +1266,7 @@ static const tulip_phy_attr_t tulip_mii_phy_attrlist[] = {
|
|||||||
},
|
},
|
||||||
#if defined(TULIP_DEBUG)
|
#if defined(TULIP_DEBUG)
|
||||||
"ICS 1890"
|
"ICS 1890"
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
{ 0 }
|
{ 0 }
|
||||||
};
|
};
|
||||||
@@ -1329,7 +1324,7 @@ tulip_mii_phy_readspecific(tulip_softc_t * const sc)
|
|||||||
data = tulip_mii_readreg(sc, sc->tulip_phyaddr, pm->pm_regno);
|
data = tulip_mii_readreg(sc, sc->tulip_phyaddr, pm->pm_regno);
|
||||||
if ((data & pm->pm_mask) == pm->pm_value)
|
if ((data & pm->pm_mask) == pm->pm_value)
|
||||||
idx = 1;
|
idx = 1;
|
||||||
}
|
}
|
||||||
if (idx != 0 && attr->attr_modes[PHY_MODE_FULLDUPLEX].pm_regno) {
|
if (idx != 0 && attr->attr_modes[PHY_MODE_FULLDUPLEX].pm_regno) {
|
||||||
const tulip_phy_modedata_t * const pm = &attr->attr_modes[PHY_MODE_FULLDUPLEX];
|
const tulip_phy_modedata_t * const pm = &attr->attr_modes[PHY_MODE_FULLDUPLEX];
|
||||||
data = tulip_mii_readreg(sc, sc->tulip_phyaddr, pm->pm_regno);
|
data = tulip_mii_readreg(sc, sc->tulip_phyaddr, pm->pm_regno);
|
||||||
@@ -1495,7 +1490,7 @@ tulip_2114x_media_preset(tulip_softc_t * const sc)
|
|||||||
media = sc->tulip_media;
|
media = sc->tulip_media;
|
||||||
else
|
else
|
||||||
media = sc->tulip_probe_media;
|
media = sc->tulip_probe_media;
|
||||||
|
|
||||||
sc->tulip_cmdmode &= ~TULIP_CMD_PORTSELECT;
|
sc->tulip_cmdmode &= ~TULIP_CMD_PORTSELECT;
|
||||||
sc->tulip_flags &= ~TULIP_SQETEST;
|
sc->tulip_flags &= ~TULIP_SQETEST;
|
||||||
if (media != TULIP_MEDIA_UNKNOWN && media != TULIP_MEDIA_MAX) {
|
if (media != TULIP_MEDIA_UNKNOWN && media != TULIP_MEDIA_MAX) {
|
||||||
@@ -1557,7 +1552,7 @@ tulip_2114x_media_preset(tulip_softc_t * const sc)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
********************************************************************
|
********************************************************************
|
||||||
* Start of 21140/21140A support which does not use the MII interface
|
* Start of 21140/21140A support which does not use the MII interface
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -1571,7 +1566,7 @@ tulip_null_media_poll(tulip_softc_t * const sc, tulip_mediapoll_event_t event)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
__inline static void
|
static inline void
|
||||||
tulip_21140_mediainit(tulip_softc_t * const sc, tulip_media_info_t * const mip,
|
tulip_21140_mediainit(tulip_softc_t * const sc, tulip_media_info_t * const mip,
|
||||||
tulip_media_t const media, unsigned gpdata, unsigned cmdmode)
|
tulip_media_t const media, unsigned gpdata, unsigned cmdmode)
|
||||||
{
|
{
|
||||||
@@ -1690,7 +1685,7 @@ tulip_21140_smc9332_media_probe(tulip_softc_t * const sc)
|
|||||||
TULIP_LOCK_ASSERT(sc);
|
TULIP_LOCK_ASSERT(sc);
|
||||||
TULIP_CSR_WRITE(sc, csr_command, TULIP_CMD_PORTSELECT|TULIP_CMD_MUSTBEONE);
|
TULIP_CSR_WRITE(sc, csr_command, TULIP_CMD_PORTSELECT|TULIP_CMD_MUSTBEONE);
|
||||||
TULIP_CSR_WRITE(sc, csr_busmode, TULIP_BUSMODE_SWRESET);
|
TULIP_CSR_WRITE(sc, csr_busmode, TULIP_BUSMODE_SWRESET);
|
||||||
DELAY(10); /* Wait 10 microseconds (actually 50 PCI cycles but at
|
DELAY(10); /* Wait 10 microseconds (actually 50 PCI cycles but at
|
||||||
33MHz that comes to two microseconds but wait a
|
33MHz that comes to two microseconds but wait a
|
||||||
bit longer anyways) */
|
bit longer anyways) */
|
||||||
TULIP_CSR_WRITE(sc, csr_command, TULIP_CMD_PORTSELECT |
|
TULIP_CSR_WRITE(sc, csr_command, TULIP_CMD_PORTSELECT |
|
||||||
@@ -1728,7 +1723,7 @@ tulip_21140_smc9332_media_probe(tulip_softc_t * const sc)
|
|||||||
TULIP_GP_SMC_9332_INIT,
|
TULIP_GP_SMC_9332_INIT,
|
||||||
TULIP_CMD_TXTHRSHLDCTL|TULIP_CMD_FULLDUPLEX);
|
TULIP_CMD_TXTHRSHLDCTL|TULIP_CMD_FULLDUPLEX);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const tulip_boardsw_t tulip_21140_smc9332_boardsw = {
|
static const tulip_boardsw_t tulip_21140_smc9332_boardsw = {
|
||||||
TULIP_21140_SMC_9332,
|
TULIP_21140_SMC_9332,
|
||||||
tulip_21140_smc9332_media_probe,
|
tulip_21140_smc9332_media_probe,
|
||||||
@@ -1870,9 +1865,9 @@ static void
|
|||||||
tulip_srom_idle(tulip_softc_t * const sc)
|
tulip_srom_idle(tulip_softc_t * const sc)
|
||||||
{
|
{
|
||||||
unsigned bit, csr;
|
unsigned bit, csr;
|
||||||
|
|
||||||
csr = SROMSEL ; EMIT;
|
csr = SROMSEL ; EMIT;
|
||||||
csr = SROMSEL | SROMRD; EMIT;
|
csr = SROMSEL | SROMRD; EMIT;
|
||||||
csr ^= SROMCS; EMIT;
|
csr ^= SROMCS; EMIT;
|
||||||
csr ^= SROMCLKON; EMIT;
|
csr ^= SROMCLKON; EMIT;
|
||||||
|
|
||||||
@@ -1887,11 +1882,11 @@ tulip_srom_idle(tulip_softc_t * const sc)
|
|||||||
csr ^= SROMCS; EMIT;
|
csr ^= SROMCS; EMIT;
|
||||||
csr = 0; EMIT;
|
csr = 0; EMIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
tulip_srom_read(tulip_softc_t * const sc)
|
tulip_srom_read(tulip_softc_t * const sc)
|
||||||
{
|
{
|
||||||
unsigned idx;
|
unsigned idx;
|
||||||
const unsigned bitwidth = SROM_BITWIDTH;
|
const unsigned bitwidth = SROM_BITWIDTH;
|
||||||
const unsigned cmdmask = (SROMCMD_RD << bitwidth);
|
const unsigned cmdmask = (SROMCMD_RD << bitwidth);
|
||||||
const unsigned msb = 1 << (bitwidth + 3 - 1);
|
const unsigned msb = 1 << (bitwidth + 3 - 1);
|
||||||
@@ -1905,7 +1900,7 @@ tulip_srom_read(tulip_softc_t * const sc)
|
|||||||
csr = SROMSEL | SROMRD; EMIT;
|
csr = SROMSEL | SROMRD; EMIT;
|
||||||
csr ^= SROMCSON; EMIT;
|
csr ^= SROMCSON; EMIT;
|
||||||
csr ^= SROMCLKON; EMIT;
|
csr ^= SROMCLKON; EMIT;
|
||||||
|
|
||||||
lastbit = 0;
|
lastbit = 0;
|
||||||
for (bits = idx|cmdmask, bit = bitwidth + 3; bit > 0; bit--, bits <<= 1) {
|
for (bits = idx|cmdmask, bit = bitwidth + 3; bit > 0; bit--, bits <<= 1) {
|
||||||
const unsigned thisbit = bits & msb;
|
const unsigned thisbit = bits & msb;
|
||||||
@@ -1922,7 +1917,7 @@ tulip_srom_read(tulip_softc_t * const sc)
|
|||||||
|
|
||||||
for (data = 0, bits = 0; bits < 16; bits++) {
|
for (data = 0, bits = 0; bits < 16; bits++) {
|
||||||
data <<= 1;
|
data <<= 1;
|
||||||
csr ^= SROMCLKON; EMIT; /* clock high; data valid */
|
csr ^= SROMCLKON; EMIT; /* clock high; data valid */
|
||||||
data |= TULIP_CSR_READ(sc, csr_srom_mii) & SROMDIN ? 1 : 0;
|
data |= TULIP_CSR_READ(sc, csr_srom_mii) & SROMDIN ? 1 : 0;
|
||||||
csr ^= SROMCLKOFF; EMIT; /* clock low; data not valid */
|
csr ^= SROMCLKOFF; EMIT; /* clock low; data not valid */
|
||||||
}
|
}
|
||||||
@@ -2135,7 +2130,7 @@ tulip_identify_znyx_nic(tulip_softc_t * const sc)
|
|||||||
} else {
|
} else {
|
||||||
id = 0;
|
id = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (id == 0) {
|
if (id == 0) {
|
||||||
if ((sc->tulip_enaddr[3] & ~3) == 0xF0 && (sc->tulip_enaddr[5] & 2) == 0) {
|
if ((sc->tulip_enaddr[3] & ~3) == 0xF0 && (sc->tulip_enaddr[5] & 2) == 0) {
|
||||||
sc->tulip_boardid[9] = '4';
|
sc->tulip_boardid[9] = '4';
|
||||||
@@ -2401,7 +2396,7 @@ tulip_srom_decode(tulip_softc_t * const sc)
|
|||||||
leaf_offset = saip->sai_leaf_offset_lowbyte
|
leaf_offset = saip->sai_leaf_offset_lowbyte
|
||||||
+ saip->sai_leaf_offset_highbyte * 256;
|
+ saip->sai_leaf_offset_highbyte * 256;
|
||||||
dp = sc->tulip_rombuf + leaf_offset;
|
dp = sc->tulip_rombuf + leaf_offset;
|
||||||
|
|
||||||
sc->tulip_conntype = (tulip_srom_connection_t) (dp[0] + dp[1] * 256); dp += 2;
|
sc->tulip_conntype = (tulip_srom_connection_t) (dp[0] + dp[1] * 256); dp += 2;
|
||||||
|
|
||||||
for (idx2 = 0;; idx2++) {
|
for (idx2 = 0;; idx2++) {
|
||||||
@@ -2458,7 +2453,7 @@ tulip_srom_decode(tulip_softc_t * const sc)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (data & TULIP_SROM_21041_EXTENDED)
|
if (data & TULIP_SROM_21041_EXTENDED)
|
||||||
dp += 6;
|
dp += 6;
|
||||||
}
|
}
|
||||||
#ifdef notdef
|
#ifdef notdef
|
||||||
@@ -2927,7 +2922,7 @@ tulip_read_macaddr(tulip_softc_t * const sc)
|
|||||||
if (cksum >= 65535) cksum -= 65535;
|
if (cksum >= 65535) cksum -= 65535;
|
||||||
|
|
||||||
rom_cksum = *(u_int16_t *) &sc->tulip_rombuf[6];
|
rom_cksum = *(u_int16_t *) &sc->tulip_rombuf[6];
|
||||||
|
|
||||||
if (cksum != rom_cksum)
|
if (cksum != rom_cksum)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
@@ -3039,13 +3034,13 @@ tulip_addr_filter(tulip_softc_t * const sc)
|
|||||||
sc->tulip_flags |= TULIP_WANTSETUP|TULIP_WANTTXSTART;
|
sc->tulip_flags |= TULIP_WANTSETUP|TULIP_WANTTXSTART;
|
||||||
sc->tulip_cmdmode &= ~TULIP_CMD_RXRUN;
|
sc->tulip_cmdmode &= ~TULIP_CMD_RXRUN;
|
||||||
sc->tulip_intrmask &= ~TULIP_STS_RXSTOPPED;
|
sc->tulip_intrmask &= ~TULIP_STS_RXSTOPPED;
|
||||||
#if defined(IFF_ALLMULTI)
|
#if defined(IFF_ALLMULTI)
|
||||||
if (sc->tulip_ifp->if_flags & IFF_ALLMULTI)
|
if (sc->tulip_ifp->if_flags & IFF_ALLMULTI)
|
||||||
sc->tulip_flags |= TULIP_ALLMULTI ;
|
sc->tulip_flags |= TULIP_ALLMULTI ;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
multicnt = 0;
|
multicnt = 0;
|
||||||
ifp = sc->tulip_ifp;
|
ifp = sc->tulip_ifp;
|
||||||
if_maddr_rlock(ifp);
|
if_maddr_rlock(ifp);
|
||||||
|
|
||||||
/* Copy MAC address on stack to align. */
|
/* Copy MAC address on stack to align. */
|
||||||
@@ -3100,8 +3095,8 @@ tulip_addr_filter(tulip_softc_t * const sc)
|
|||||||
hash = tulip_mchash((caddr_t)eaddr);
|
hash = tulip_mchash((caddr_t)eaddr);
|
||||||
sp[hash >> 4] |= htole32(1 << (hash & 0xF));
|
sp[hash >> 4] |= htole32(1 << (hash & 0xF));
|
||||||
} else {
|
} else {
|
||||||
sp[39] = TULIP_SP_MAC(eaddr[0]);
|
sp[39] = TULIP_SP_MAC(eaddr[0]);
|
||||||
sp[40] = TULIP_SP_MAC(eaddr[1]);
|
sp[40] = TULIP_SP_MAC(eaddr[1]);
|
||||||
sp[41] = TULIP_SP_MAC(eaddr[2]);
|
sp[41] = TULIP_SP_MAC(eaddr[2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3117,8 +3112,8 @@ tulip_addr_filter(tulip_softc_t * const sc)
|
|||||||
if (ifma->ifma_addr->sa_family != AF_LINK)
|
if (ifma->ifma_addr->sa_family != AF_LINK)
|
||||||
continue;
|
continue;
|
||||||
addrp = LLADDR((struct sockaddr_dl *)ifma->ifma_addr);
|
addrp = LLADDR((struct sockaddr_dl *)ifma->ifma_addr);
|
||||||
*sp++ = TULIP_SP_MAC(((u_int16_t *)addrp)[0]);
|
*sp++ = TULIP_SP_MAC(((u_int16_t *)addrp)[0]);
|
||||||
*sp++ = TULIP_SP_MAC(((u_int16_t *)addrp)[1]);
|
*sp++ = TULIP_SP_MAC(((u_int16_t *)addrp)[1]);
|
||||||
*sp++ = TULIP_SP_MAC(((u_int16_t *)addrp)[2]);
|
*sp++ = TULIP_SP_MAC(((u_int16_t *)addrp)[2]);
|
||||||
idx++;
|
idx++;
|
||||||
}
|
}
|
||||||
@@ -3134,8 +3129,8 @@ tulip_addr_filter(tulip_softc_t * const sc)
|
|||||||
* Pad the rest with our hardware address
|
* Pad the rest with our hardware address
|
||||||
*/
|
*/
|
||||||
for (; idx < 16; idx++) {
|
for (; idx < 16; idx++) {
|
||||||
*sp++ = TULIP_SP_MAC(eaddr[0]);
|
*sp++ = TULIP_SP_MAC(eaddr[0]);
|
||||||
*sp++ = TULIP_SP_MAC(eaddr[1]);
|
*sp++ = TULIP_SP_MAC(eaddr[1]);
|
||||||
*sp++ = TULIP_SP_MAC(eaddr[2]);
|
*sp++ = TULIP_SP_MAC(eaddr[2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3166,7 +3161,7 @@ tulip_reset(tulip_softc_t * const sc)
|
|||||||
(*sc->tulip_boardsw->bd_media_preset)(sc);
|
(*sc->tulip_boardsw->bd_media_preset)(sc);
|
||||||
|
|
||||||
TULIP_CSR_WRITE(sc, csr_busmode, TULIP_BUSMODE_SWRESET);
|
TULIP_CSR_WRITE(sc, csr_busmode, TULIP_BUSMODE_SWRESET);
|
||||||
DELAY(10); /* Wait 10 microseconds (actually 50 PCI cycles but at
|
DELAY(10); /* Wait 10 microseconds (actually 50 PCI cycles but at
|
||||||
33MHz that comes to two microseconds but wait a
|
33MHz that comes to two microseconds but wait a
|
||||||
bit longer anyways) */
|
bit longer anyways) */
|
||||||
|
|
||||||
@@ -3203,7 +3198,7 @@ tulip_reset(tulip_softc_t * const sc)
|
|||||||
TULIP_TXDESC_PRESYNC(ri);
|
TULIP_TXDESC_PRESYNC(ri);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We need to collect all the mbufs that were on the
|
* We need to collect all the mbufs that were on the
|
||||||
* receive ring before we reinit it either to put
|
* receive ring before we reinit it either to put
|
||||||
* them back on or to know if we have to allocate
|
* them back on or to know if we have to allocate
|
||||||
* more.
|
* more.
|
||||||
@@ -3442,7 +3437,7 @@ tulip_rx_intr(tulip_softc_t * const sc)
|
|||||||
} else {
|
} else {
|
||||||
CTR1(KTR_TULIP, "tulip_rx_intr: bad packet; status %08x",
|
CTR1(KTR_TULIP, "tulip_rx_intr: bad packet; status %08x",
|
||||||
DESC_STATUS(eop));
|
DESC_STATUS(eop));
|
||||||
ifp->if_ierrors++;
|
if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
|
||||||
if (DESC_STATUS(eop) & (TULIP_DSTS_RxBADLENGTH|TULIP_DSTS_RxOVERFLOW|TULIP_DSTS_RxWATCHDOG)) {
|
if (DESC_STATUS(eop) & (TULIP_DSTS_RxBADLENGTH|TULIP_DSTS_RxOVERFLOW|TULIP_DSTS_RxWATCHDOG)) {
|
||||||
sc->tulip_dot3stats.dot3StatsInternalMacReceiveErrors++;
|
sc->tulip_dot3stats.dot3StatsInternalMacReceiveErrors++;
|
||||||
} else {
|
} else {
|
||||||
@@ -3482,7 +3477,7 @@ tulip_rx_intr(tulip_softc_t * const sc)
|
|||||||
#if defined(TULIP_DEBUG)
|
#if defined(TULIP_DEBUG)
|
||||||
cnt++;
|
cnt++;
|
||||||
#endif
|
#endif
|
||||||
ifp->if_ipackets++;
|
if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1);
|
||||||
if (++eop == ri->ri_last)
|
if (++eop == ri->ri_last)
|
||||||
eop = ri->ri_first;
|
eop = ri->ri_first;
|
||||||
ri->ri_nextin = eop;
|
ri->ri_nextin = eop;
|
||||||
@@ -3504,7 +3499,7 @@ tulip_rx_intr(tulip_softc_t * const sc)
|
|||||||
*/
|
*/
|
||||||
m0 = m_devget(mtod(ms, caddr_t), total_len, ETHER_ALIGN, ifp, NULL);
|
m0 = m_devget(mtod(ms, caddr_t), total_len, ETHER_ALIGN, ifp, NULL);
|
||||||
if (m0 == NULL) {
|
if (m0 == NULL) {
|
||||||
ifp->if_ierrors++;
|
if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
|
||||||
goto skip_input;
|
goto skip_input;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
@@ -3539,7 +3534,7 @@ tulip_rx_intr(tulip_softc_t * const sc)
|
|||||||
#endif
|
#endif
|
||||||
if (ms == NULL) {
|
if (ms == NULL) {
|
||||||
/*
|
/*
|
||||||
* Couldn't allocate a new buffer. Don't bother
|
* Couldn't allocate a new buffer. Don't bother
|
||||||
* trying to replenish the receive queue.
|
* trying to replenish the receive queue.
|
||||||
*/
|
*/
|
||||||
fillok = 0;
|
fillok = 0;
|
||||||
@@ -3559,7 +3554,7 @@ tulip_rx_intr(tulip_softc_t * const sc)
|
|||||||
|
|
||||||
M_ASSERTPKTHDR(ms);
|
M_ASSERTPKTHDR(ms);
|
||||||
KASSERT(ms->m_data == ms->m_ext.ext_buf,
|
KASSERT(ms->m_data == ms->m_ext.ext_buf,
|
||||||
("rx mbuf data doesn't point to cluster"));
|
("rx mbuf data doesn't point to cluster"));
|
||||||
ms->m_len = ms->m_pkthdr.len = TULIP_RX_BUFLEN;
|
ms->m_len = ms->m_pkthdr.len = TULIP_RX_BUFLEN;
|
||||||
error = bus_dmamap_load_mbuf(ri->ri_data_tag, *nextout->di_map, ms,
|
error = bus_dmamap_load_mbuf(ri->ri_data_tag, *nextout->di_map, ms,
|
||||||
tulip_dma_map_rxbuf, nextout->di_desc, BUS_DMA_NOWAIT);
|
tulip_dma_map_rxbuf, nextout->di_desc, BUS_DMA_NOWAIT);
|
||||||
@@ -3596,7 +3591,7 @@ tulip_rx_intr(tulip_softc_t * const sc)
|
|||||||
static int
|
static int
|
||||||
tulip_tx_intr(tulip_softc_t * const sc)
|
tulip_tx_intr(tulip_softc_t * const sc)
|
||||||
{
|
{
|
||||||
TULIP_PERFSTART(txintr)
|
TULIP_PERFSTART(txintr)
|
||||||
tulip_ringinfo_t * const ri = &sc->tulip_txinfo;
|
tulip_ringinfo_t * const ri = &sc->tulip_txinfo;
|
||||||
struct mbuf *m;
|
struct mbuf *m;
|
||||||
int xmits = 0;
|
int xmits = 0;
|
||||||
@@ -3678,7 +3673,7 @@ tulip_tx_intr(tulip_softc_t * const sc)
|
|||||||
if (d_status & TULIP_DSTS_ERRSUM) {
|
if (d_status & TULIP_DSTS_ERRSUM) {
|
||||||
CTR1(KTR_TULIP, "tulip_tx_intr: output error: %08x",
|
CTR1(KTR_TULIP, "tulip_tx_intr: output error: %08x",
|
||||||
d_status);
|
d_status);
|
||||||
sc->tulip_ifp->if_oerrors++;
|
if_inc_counter(sc->tulip_ifp, IFCOUNTER_OERRORS, 1);
|
||||||
if (d_status & TULIP_DSTS_TxEXCCOLL)
|
if (d_status & TULIP_DSTS_TxEXCCOLL)
|
||||||
sc->tulip_dot3stats.dot3StatsExcessiveCollisions++;
|
sc->tulip_dot3stats.dot3StatsExcessiveCollisions++;
|
||||||
if (d_status & TULIP_DSTS_TxLATECOLL)
|
if (d_status & TULIP_DSTS_TxLATECOLL)
|
||||||
@@ -3692,14 +3687,14 @@ tulip_tx_intr(tulip_softc_t * const sc)
|
|||||||
if (d_status & TULIP_DSTS_TxBABBLE)
|
if (d_status & TULIP_DSTS_TxBABBLE)
|
||||||
sc->tulip_dot3stats.dot3StatsInternalTransmitBabbles++;
|
sc->tulip_dot3stats.dot3StatsInternalTransmitBabbles++;
|
||||||
} else {
|
} else {
|
||||||
u_int32_t collisions =
|
u_int32_t collisions =
|
||||||
(d_status & TULIP_DSTS_TxCOLLMASK)
|
(d_status & TULIP_DSTS_TxCOLLMASK)
|
||||||
>> TULIP_DSTS_V_TxCOLLCNT;
|
>> TULIP_DSTS_V_TxCOLLCNT;
|
||||||
|
|
||||||
CTR2(KTR_TULIP,
|
CTR2(KTR_TULIP,
|
||||||
"tulip_tx_intr: output ok, collisions %d, status %08x",
|
"tulip_tx_intr: output ok, collisions %d, status %08x",
|
||||||
collisions, d_status);
|
collisions, d_status);
|
||||||
sc->tulip_ifp->if_collisions += collisions;
|
if_inc_counter(sc->tulip_ifp, IFCOUNTER_COLLISIONS, collisions);
|
||||||
if (collisions == 1)
|
if (collisions == 1)
|
||||||
sc->tulip_dot3stats.dot3StatsSingleCollisionFrames++;
|
sc->tulip_dot3stats.dot3StatsSingleCollisionFrames++;
|
||||||
else if (collisions > 1)
|
else if (collisions > 1)
|
||||||
@@ -3733,7 +3728,7 @@ tulip_tx_intr(tulip_softc_t * const sc)
|
|||||||
sc->tulip_txtimer = 0;
|
sc->tulip_txtimer = 0;
|
||||||
else if (xmits > 0)
|
else if (xmits > 0)
|
||||||
sc->tulip_txtimer = TULIP_TXTIMER;
|
sc->tulip_txtimer = TULIP_TXTIMER;
|
||||||
sc->tulip_ifp->if_opackets += xmits;
|
if_inc_counter(sc->tulip_ifp, IFCOUNTER_OPACKETS, xmits);
|
||||||
TULIP_PERFEND(txintr);
|
TULIP_PERFEND(txintr);
|
||||||
return descs;
|
return descs;
|
||||||
}
|
}
|
||||||
@@ -3940,8 +3935,8 @@ tulip_txput(tulip_softc_t * const sc, struct mbuf *m)
|
|||||||
segcnt++;
|
segcnt++;
|
||||||
m0 = m0->m_next;
|
m0 = m0->m_next;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
CTR2(KTR_TULIP, "tulip_txput: sending packet %p (%d chunks)", m, segcnt);
|
CTR2(KTR_TULIP, "tulip_txput: sending packet %p (%d chunks)", m, segcnt);
|
||||||
|
#endif
|
||||||
d_status = 0;
|
d_status = 0;
|
||||||
eop = nextout = ri->ri_nextout;
|
eop = nextout = ri->ri_nextout;
|
||||||
segcnt = 0;
|
segcnt = 0;
|
||||||
@@ -4336,7 +4331,7 @@ tulip_watchdog(void *arg)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
TULIP_LOCK_ASSERT(sc);
|
TULIP_LOCK_ASSERT(sc);
|
||||||
callout_reset(&sc->tulip_stat_timer, hz, tulip_watchdog, sc);
|
callout_reset(&sc->tulip_stat_timer, hz, tulip_watchdog, sc);
|
||||||
#if defined(TULIP_DEBUG)
|
#if defined(TULIP_DEBUG)
|
||||||
rxintrs = sc->tulip_dbg.dbg_rxintrs - sc->tulip_dbg.dbg_last_rxintrs;
|
rxintrs = sc->tulip_dbg.dbg_rxintrs - sc->tulip_dbg.dbg_last_rxintrs;
|
||||||
if (rxintrs > sc->tulip_dbg.dbg_high_rxintrs_hz)
|
if (rxintrs > sc->tulip_dbg.dbg_high_rxintrs_hz)
|
||||||
@@ -4421,7 +4416,7 @@ tulip_attach(tulip_softc_t * const sc)
|
|||||||
IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen);
|
IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen);
|
||||||
ifp->if_snd.ifq_drv_maxlen = ifqmaxlen;
|
ifp->if_snd.ifq_drv_maxlen = ifqmaxlen;
|
||||||
IFQ_SET_READY(&ifp->if_snd);
|
IFQ_SET_READY(&ifp->if_snd);
|
||||||
|
|
||||||
device_printf(sc->tulip_dev, "%s%s pass %d.%d%s\n",
|
device_printf(sc->tulip_dev, "%s%s pass %d.%d%s\n",
|
||||||
sc->tulip_boardid,
|
sc->tulip_boardid,
|
||||||
tulip_chipdescs[sc->tulip_chipid],
|
tulip_chipdescs[sc->tulip_chipid],
|
||||||
@@ -4476,7 +4471,6 @@ tulip_busdma_freering(tulip_ringinfo_t *ri)
|
|||||||
}
|
}
|
||||||
if (ri->ri_descs != NULL) {
|
if (ri->ri_descs != NULL) {
|
||||||
bus_dmamem_free(ri->ri_ring_tag, ri->ri_descs, ri->ri_ring_map);
|
bus_dmamem_free(ri->ri_ring_tag, ri->ri_descs, ri->ri_ring_map);
|
||||||
ri->ri_ring_map = NULL;
|
|
||||||
ri->ri_descs = NULL;
|
ri->ri_descs = NULL;
|
||||||
}
|
}
|
||||||
if (ri->ri_ring_tag != NULL) {
|
if (ri->ri_ring_tag != NULL) {
|
||||||
@@ -4561,8 +4555,6 @@ tulip_busdma_cleanup(tulip_softc_t * const sc)
|
|||||||
if (sc->tulip_setupbuf != NULL) {
|
if (sc->tulip_setupbuf != NULL) {
|
||||||
bus_dmamem_free(sc->tulip_setup_tag, sc->tulip_setupbuf,
|
bus_dmamem_free(sc->tulip_setup_tag, sc->tulip_setupbuf,
|
||||||
sc->tulip_setup_map);
|
sc->tulip_setup_map);
|
||||||
bus_dmamap_destroy(sc->tulip_setup_tag, sc->tulip_setup_map);
|
|
||||||
sc->tulip_setup_map = NULL;
|
|
||||||
sc->tulip_setupbuf = NULL;
|
sc->tulip_setupbuf = NULL;
|
||||||
}
|
}
|
||||||
if (sc->tulip_setup_tag != NULL) {
|
if (sc->tulip_setup_tag != NULL) {
|
||||||
@@ -4620,7 +4612,7 @@ tulip_busdma_init(device_t dev, tulip_softc_t * const sc)
|
|||||||
return (error);
|
return (error);
|
||||||
}
|
}
|
||||||
error = bus_dmamap_load(sc->tulip_setup_tag, sc->tulip_setup_map,
|
error = bus_dmamap_load(sc->tulip_setup_tag, sc->tulip_setup_map,
|
||||||
sc->tulip_setupbuf, sizeof(sc->tulip_setupdata),
|
sc->tulip_setupbuf, sizeof(sc->tulip_setupdata),
|
||||||
tulip_dma_map_addr, &sc->tulip_setup_dma_addr, BUS_DMA_NOWAIT);
|
tulip_dma_map_addr, &sc->tulip_setup_dma_addr, BUS_DMA_NOWAIT);
|
||||||
if (error) {
|
if (error) {
|
||||||
device_printf(dev, "failed to get dma address for setup descriptor\n");
|
device_printf(dev, "failed to get dma address for setup descriptor\n");
|
||||||
@@ -4712,11 +4704,11 @@ tulip_pci_probe(device_t dev)
|
|||||||
name = "Digital 21140 Fast Ethernet";
|
name = "Digital 21140 Fast Ethernet";
|
||||||
break;
|
break;
|
||||||
#ifndef __HAIKU__
|
#ifndef __HAIKU__
|
||||||
|
case CHIPID_21142:
|
||||||
/*
|
/*
|
||||||
* The card with the same id is supported by if_dc - screen it to
|
* The card with the same id is supported by if_dc - screen it to
|
||||||
* prevent duplicated dev entries.
|
* prevent duplicated dev entries.
|
||||||
*/
|
*/
|
||||||
case CHIPID_21142:
|
|
||||||
if (pci_get_revid(dev) >= 0x20)
|
if (pci_get_revid(dev) >= 0x20)
|
||||||
name = "Digital 21143 Fast Ethernet";
|
name = "Digital 21143 Fast Ethernet";
|
||||||
else
|
else
|
||||||
@@ -4736,7 +4728,7 @@ tulip_shutdown(device_t dev)
|
|||||||
{
|
{
|
||||||
tulip_softc_t * const sc = device_get_softc(dev);
|
tulip_softc_t * const sc = device_get_softc(dev);
|
||||||
TULIP_CSR_WRITE(sc, csr_busmode, TULIP_BUSMODE_SWRESET);
|
TULIP_CSR_WRITE(sc, csr_busmode, TULIP_BUSMODE_SWRESET);
|
||||||
DELAY(10); /* Wait 10 microseconds (actually 50 PCI cycles but at
|
DELAY(10); /* Wait 10 microseconds (actually 50 PCI cycles but at
|
||||||
33MHz that comes to two microseconds but wait a
|
33MHz that comes to two microseconds but wait a
|
||||||
bit longer anyways) */
|
bit longer anyways) */
|
||||||
return 0;
|
return 0;
|
||||||
@@ -4868,7 +4860,7 @@ tulip_pci_attach(device_t dev)
|
|||||||
* Make sure there won't be any interrupts or such...
|
* Make sure there won't be any interrupts or such...
|
||||||
*/
|
*/
|
||||||
TULIP_CSR_WRITE(sc, csr_busmode, TULIP_BUSMODE_SWRESET);
|
TULIP_CSR_WRITE(sc, csr_busmode, TULIP_BUSMODE_SWRESET);
|
||||||
DELAY(100); /* Wait 10 microseconds (actually 50 PCI cycles but at
|
DELAY(100); /* Wait 10 microseconds (actually 50 PCI cycles but at
|
||||||
33MHz that comes to two microseconds but wait a
|
33MHz that comes to two microseconds but wait a
|
||||||
bit longer anyways) */
|
bit longer anyways) */
|
||||||
|
|
||||||
@@ -4899,8 +4891,8 @@ tulip_pci_attach(device_t dev)
|
|||||||
rid = 0;
|
rid = 0;
|
||||||
res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
|
res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
|
||||||
RF_SHAREABLE | RF_ACTIVE);
|
RF_SHAREABLE | RF_ACTIVE);
|
||||||
if (res == 0 || bus_setup_intr(dev, res, INTR_TYPE_NET |
|
if (res == NULL || bus_setup_intr(dev, res, INTR_TYPE_NET |
|
||||||
INTR_MPSAFE, NULL, intr_rtn, sc, &ih)) {
|
INTR_MPSAFE, NULL, intr_rtn, sc, &ih)) {
|
||||||
device_printf(dev, "couldn't map interrupt\n");
|
device_printf(dev, "couldn't map interrupt\n");
|
||||||
tulip_busdma_cleanup(sc);
|
tulip_busdma_cleanup(sc);
|
||||||
ether_ifdetach(sc->tulip_ifp);
|
ether_ifdetach(sc->tulip_ifp);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/* $NetBSD: if_devar.h,v 1.32 1999/04/01 14:55:25 tsubai Exp $ */
|
/* $NetBSD: if_devar.h,v 1.32 1999/04/01 14:55:25 tsubai Exp $ */
|
||||||
|
|
||||||
/* $FreeBSD$ */
|
/* $FreeBSD: releng/11.1/sys/dev/de/if_devar.h 298955 2016-05-03 03:41:25Z pfg $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1994-1997 Matt Thomas (matt@3am-software.com)
|
* Copyright (c) 1994-1997 Matt Thomas (matt@3am-software.com)
|
||||||
@@ -842,7 +842,7 @@ static const struct {
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* This driver supports a maximum of 32 tulip boards.
|
* This driver supports a maximum of 32 tulip boards.
|
||||||
* This should be enough for the forseeable future.
|
* This should be enough for the foreseeable future.
|
||||||
*/
|
*/
|
||||||
#define TULIP_MAX_DEVICES 32
|
#define TULIP_MAX_DEVICES 32
|
||||||
|
|
||||||
|
|||||||
@@ -1,24 +0,0 @@
|
|||||||
SubDir HAIKU_TOP src add-ons kernel drivers network dec21xxx dev mii ;
|
|
||||||
|
|
||||||
UseHeaders [ FDirName $(SUBDIR) .. .. ] : true ;
|
|
||||||
UseHeaders [ FDirName $(HAIKU_TOP) src libs compat freebsd_network compat ]
|
|
||||||
: true ;
|
|
||||||
|
|
||||||
UsePrivateHeaders net system ;
|
|
||||||
UsePrivateKernelHeaders ;
|
|
||||||
|
|
||||||
SubDirCcFlags [ FDefines _KERNEL=1 FBSD_DRIVER=1 ] ;
|
|
||||||
|
|
||||||
KernelStaticLibrary dec21xxx_mii.a
|
|
||||||
:
|
|
||||||
acphy.c
|
|
||||||
amphy.c
|
|
||||||
ukphy.c
|
|
||||||
ukphy_subr.c
|
|
||||||
;
|
|
||||||
|
|
||||||
ObjectHdrs [ FGristFiles acphy$(SUFOBJ) amphy$(SUFOBJ) ukphy$(SUFOBJ) ]
|
|
||||||
: [ FDirName $(TARGET_COMMON_DEBUG_OBJECT_DIR_$(TARGET_PACKAGING_ARCH)) libs
|
|
||||||
compat freebsd_network ] ;
|
|
||||||
Includes [ FGristFiles acphy.c amphy.c amphy.c ]
|
|
||||||
: <src!libs!compat!freebsd_network>miidevs.h ;
|
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__FBSDID("$FreeBSD$");
|
__FBSDID("$FreeBSD: releng/11.1/sys/dev/mii/acphy.c 281821 2015-04-21 09:39:48Z glebius $");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Driver for Altima AC101 10/100 PHY
|
* Driver for Altima AC101 10/100 PHY
|
||||||
@@ -139,14 +139,12 @@ acphy_attach(device_t dev)
|
|||||||
sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & sc->mii_capmask;
|
sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & sc->mii_capmask;
|
||||||
device_printf(dev, " ");
|
device_printf(dev, " ");
|
||||||
|
|
||||||
#define ADD(m, c) ifmedia_add(&sc->mii_pdata->mii_media, (m), (c), NULL)
|
#define ADD(m) ifmedia_add(&sc->mii_pdata->mii_media, (m), 0, NULL)
|
||||||
if ((PHY_READ(sc, MII_ACPHY_MCTL) & AC_MCTL_FX_SEL) != 0) {
|
if ((PHY_READ(sc, MII_ACPHY_MCTL) & AC_MCTL_FX_SEL) != 0) {
|
||||||
sc->mii_flags |= MIIF_HAVEFIBER;
|
sc->mii_flags |= MIIF_HAVEFIBER;
|
||||||
ADD(IFM_MAKEWORD(IFM_ETHER, IFM_100_FX, 0, sc->mii_inst),
|
ADD(IFM_MAKEWORD(IFM_ETHER, IFM_100_FX, 0, sc->mii_inst));
|
||||||
MII_MEDIA_100_TX);
|
|
||||||
printf("100baseFX, ");
|
printf("100baseFX, ");
|
||||||
ADD(IFM_MAKEWORD(IFM_ETHER, IFM_100_FX, IFM_FDX, sc->mii_inst),
|
ADD(IFM_MAKEWORD(IFM_ETHER, IFM_100_FX, IFM_FDX, sc->mii_inst));
|
||||||
MII_MEDIA_100_TX_FDX);
|
|
||||||
printf("100baseFX-FDX, ");
|
printf("100baseFX-FDX, ");
|
||||||
}
|
}
|
||||||
#undef ADD
|
#undef ADD
|
||||||
@@ -168,12 +166,6 @@ acphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case MII_MEDIACHG:
|
case MII_MEDIACHG:
|
||||||
/*
|
|
||||||
* If the interface is not up, don't do anything.
|
|
||||||
*/
|
|
||||||
if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
|
|
||||||
break;
|
|
||||||
|
|
||||||
/* Wake & deisolate up if necessary */
|
/* Wake & deisolate up if necessary */
|
||||||
reg = PHY_READ(sc, MII_BMCR);
|
reg = PHY_READ(sc, MII_BMCR);
|
||||||
if (reg & (BMCR_ISO | BMCR_PDOWN))
|
if (reg & (BMCR_ISO | BMCR_PDOWN))
|
||||||
@@ -183,12 +175,6 @@ acphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case MII_TICK:
|
case MII_TICK:
|
||||||
/*
|
|
||||||
* Is the interface even up?
|
|
||||||
*/
|
|
||||||
if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
|
|
||||||
return (0);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This PHY's autonegotiation doesn't need to be kicked.
|
* This PHY's autonegotiation doesn't need to be kicked.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -23,7 +23,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.
|
||||||
*
|
*
|
||||||
* $FreeBSD$
|
* $FreeBSD: releng/11.1/sys/dev/mii/acphyreg.h 165986 2007-01-12 22:58:04Z marius $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _DEV_MII_ACPHYREG_H_
|
#ifndef _DEV_MII_ACPHYREG_H_
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__FBSDID("$FreeBSD$");
|
__FBSDID("$FreeBSD: releng/11.1/sys/dev/mii/amphy.c 257184 2013-10-26 18:40:17Z glebius $");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* driver for AMD AM79c873 PHYs
|
* driver for AMD AM79c873 PHYs
|
||||||
@@ -119,12 +119,6 @@ amphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case MII_MEDIACHG:
|
case MII_MEDIACHG:
|
||||||
/*
|
|
||||||
* If the interface is not up, don't do anything.
|
|
||||||
*/
|
|
||||||
if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
|
|
||||||
break;
|
|
||||||
|
|
||||||
mii_phy_setmedia(sc);
|
mii_phy_setmedia(sc);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||||
* THE POSSIBILITY OF SUCH DAMAGE.
|
* THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $FreeBSD$
|
* $FreeBSD: releng/11.1/sys/dev/mii/amphyreg.h 139749 2005-01-06 01:43:34Z imp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _DEV_MII_AMTPHYREG_H_
|
#ifndef _DEV_MII_AMTPHYREG_H_
|
||||||
|
|||||||
@@ -55,7 +55,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__FBSDID("$FreeBSD$");
|
__FBSDID("$FreeBSD: releng/11.1/sys/dev/mii/ukphy.c 257184 2013-10-26 18:40:17Z glebius $");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* driver for generic unknown PHYs
|
* driver for generic unknown PHYs
|
||||||
@@ -140,12 +140,6 @@ ukphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case MII_MEDIACHG:
|
case MII_MEDIACHG:
|
||||||
/*
|
|
||||||
* If the interface is not up, don't do anything.
|
|
||||||
*/
|
|
||||||
if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
|
|
||||||
break;
|
|
||||||
|
|
||||||
mii_phy_setmedia(sc);
|
mii_phy_setmedia(sc);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__FBSDID("$FreeBSD$");
|
__FBSDID("$FreeBSD: releng/11.1/sys/dev/mii/ukphy_subr.c 215297 2010-11-14 13:26:10Z marius $");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Subroutines shared by the ukphy driver and other PHY drivers.
|
* Subroutines shared by the ukphy driver and other PHY drivers.
|
||||||
|
|||||||
Reference in New Issue
Block a user