Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/neta/if_mvneta_fdt.c
Show First 20 Lines • Show All 100 Lines • ▼ Show 20 Lines | mvneta_fdt_probe(device_t dev) | ||||
device_set_desc(dev, "NETA controller"); | device_set_desc(dev, "NETA controller"); | ||||
return (BUS_PROBE_DEFAULT); | return (BUS_PROBE_DEFAULT); | ||||
} | } | ||||
static int | static int | ||||
mvneta_fdt_attach(device_t dev) | mvneta_fdt_attach(device_t dev) | ||||
{ | { | ||||
struct mvneta_softc *sc; | |||||
uint32_t tx_csum_limit; | |||||
int err; | int err; | ||||
sc = device_get_softc(dev); | |||||
/* Try to fetch PHY information from FDT */ | /* Try to fetch PHY information from FDT */ | ||||
err = mvneta_fdt_phy_acquire(dev); | err = mvneta_fdt_phy_acquire(dev); | ||||
if (err != 0) | if (err != 0) | ||||
return (err); | return (err); | ||||
if (ofw_bus_is_compatible(dev, "marvell,armada-370-neta")) { | |||||
tx_csum_limit = MVNETA_A370_MAX_CSUM_MTU; | |||||
} else { | |||||
tx_csum_limit = MVNETA_A3700_MAX_CSUM_MTU; | |||||
} | |||||
if (ofw_bus_has_prop(dev, "tx-csum-limit")) { | |||||
err = OF_getprop(ofw_bus_get_node(dev), "tx-csum-limit", | |||||
&tx_csum_limit, sizeof(tx_csum_limit)); | |||||
if (err <= 0) { | |||||
device_printf(dev, | |||||
"Failed to acquire tx-csum-limit property\n"); | |||||
return (ENXIO); | |||||
} | |||||
} | |||||
sc->tx_csum_limit = tx_csum_limit; | |||||
return (mvneta_attach(dev)); | return (mvneta_attach(dev)); | ||||
} | } | ||||
static int | static int | ||||
mvneta_fdt_phy_acquire(device_t dev) | mvneta_fdt_phy_acquire(device_t dev) | ||||
{ | { | ||||
struct mvneta_softc *sc; | struct mvneta_softc *sc; | ||||
▲ Show 20 Lines • Show All 109 Lines • Show Last 20 Lines |