Finish renaming in if_dwc.

By using DWC TRM terminology, normal descriptor format should be named
extended and alternate descriptor format should be named normal.

Should not been functional change.

MFC after:	4 weeks
This commit is contained in:
Michal Meloun 2020-06-19 18:34:27 +00:00
parent 8d43a8685c
commit 188aee740f
7 changed files with 15 additions and 14 deletions

View File

@ -114,7 +114,7 @@ static int
a20_if_dwc_mac_type(device_t dev)
{
return (DWC_GMAC_ALT_DESC);
return (DWC_GMAC_NORMAL_DESC);
}
static int

View File

@ -66,7 +66,7 @@ static int
aml8726_if_dwc_mac_type(device_t dev)
{
return (DWC_GMAC_ALT_DESC);
return (DWC_GMAC_NORMAL_DESC);
}
static int

View File

@ -160,7 +160,7 @@ static int
if_dwc_rk_mac_type(device_t dev)
{
return (DWC_GMAC_ALT_DESC);
return (DWC_GMAC_NORMAL_DESC);
}
static int

View File

@ -74,7 +74,7 @@ static int
if_dwc_socfpga_mac_type(device_t dev)
{
return (DWC_GMAC);
return (DWC_GMAC_EXT_DESC);
}
static int

View File

@ -249,7 +249,7 @@ dwc_setup_txdesc(struct dwc_softc *sc, int idx, bus_addr_t paddr,
flags = 0;
--sc->txcount;
} else {
if (sc->mactype == DWC_GMAC_ALT_DESC)
if (sc->mactype != DWC_GMAC_EXT_DESC)
flags = NTDESC1_TCH | NTDESC1_FS
| NTDESC1_LS | NTDESC1_IC;
else
@ -259,7 +259,7 @@ dwc_setup_txdesc(struct dwc_softc *sc, int idx, bus_addr_t paddr,
}
sc->txdesc_ring[idx].addr1 = (uint32_t)(paddr);
if (sc->mactype == DWC_GMAC_ALT_DESC) {
if (sc->mactype != DWC_GMAC_EXT_DESC) {
sc->txdesc_ring[idx].desc0 = 0;
sc->txdesc_ring[idx].desc1 = flags | len;
} else {
@ -537,7 +537,7 @@ dwc_setup_rxdesc(struct dwc_softc *sc, int idx, bus_addr_t paddr)
nidx = next_rxidx(sc, idx);
sc->rxdesc_ring[idx].addr2 = sc->rxdesc_ring_paddr +
(nidx * sizeof(struct dwc_hwdesc));
if (sc->mactype == DWC_GMAC_ALT_DESC)
if (sc->mactype != DWC_GMAC_EXT_DESC)
sc->rxdesc_ring[idx].desc1 = NRDESC1_RCH | RX_MAX_PACKET;
else
sc->rxdesc_ring[idx].desc1 = ERDESC1_RCH | MCLBYTES;
@ -661,7 +661,7 @@ dwc_hash_maddr(void *arg, struct sockaddr_dl *sdl, u_int cnt)
crc = ether_crc32_le(LLADDR(sdl), ETHER_ADDR_LEN);
/* Take lower 8 bits and reverse it */
val = bitreverse(~crc & 0xff);
if (ctx->sc->mactype == DWC_GMAC_ALT_DESC)
if (ctx->sc->mactype != DWC_GMAC_EXT_DESC)
val >>= 2; /* Only need lower 6 bits */
hashreg = (val >> 5);
hashbit = (val & 31);
@ -682,7 +682,7 @@ dwc_setup_rxfilter(struct dwc_softc *sc)
DWC_ASSERT_LOCKED(sc);
ifp = sc->ifp;
nhash = sc->mactype == DWC_GMAC_ALT_DESC ? 2 : 8;
nhash = sc->mactype != DWC_GMAC_EXT_DESC ? 2 : 8;
/*
* Set the multicast (group) filter hash.
@ -715,7 +715,7 @@ dwc_setup_rxfilter(struct dwc_softc *sc)
WRITE4(sc, MAC_ADDRESS_LOW(0), lo);
WRITE4(sc, MAC_ADDRESS_HIGH(0), hi);
WRITE4(sc, MAC_FRAME_FILTER, ffval);
if (sc->mactype == DWC_GMAC_ALT_DESC) {
if (sc->mactype != DWC_GMAC_EXT_DESC) {
WRITE4(sc, GMAC_MAC_HTLOW, ctx.hash[0]);
WRITE4(sc, GMAC_MAC_HTHIGH, ctx.hash[1]);
} else {
@ -1260,7 +1260,7 @@ dwc_attach(device_t dev)
return (ENXIO);
}
if (sc->mactype == DWC_GMAC_ALT_DESC) {
if (sc->mactype != DWC_GMAC_EXT_DESC) {
reg = BUS_MODE_FIXEDBURST;
reg |= (BUS_MODE_PRIORXTX_41 << BUS_MODE_PRIORXTX_SHIFT);
} else

View File

@ -272,8 +272,9 @@
#define CURRENT_HOST_RECEIVE_BUF_ADDR 0x1054
#define HW_FEATURE 0x1058
#define DWC_GMAC 0x1
#define DWC_GMAC_ALT_DESC 0x2
#define DWC_GMAC_NORMAL_DESC 0x1
#define DWC_GMAC_EXT_DESC 0x2
#define GMAC_MII_CLK_60_100M_DIV42 0x0
#define GMAC_MII_CLK_100_150M_DIV62 0x1
#define GMAC_MII_CLK_25_35M_DIV16 0x2

View File

@ -41,7 +41,7 @@ CODE {
static int
if_dwc_default_mac_type(device_t dev)
{
return (DWC_GMAC);
return (DWC_GMAC_EXT_DESC);
}
static int