Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/cadence/if_cgem.c
Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | |||||
/* Default for sysctl rxbufs. Must be < CGEM_NUM_RX_DESCS of course. */ | /* Default for sysctl rxbufs. Must be < CGEM_NUM_RX_DESCS of course. */ | ||||
#define DEFAULT_NUM_RX_BUFS 256 /* number of receive bufs to queue. */ | #define DEFAULT_NUM_RX_BUFS 256 /* number of receive bufs to queue. */ | ||||
#define TX_MAX_DMA_SEGS 8 /* maximum segs in a tx mbuf dma */ | #define TX_MAX_DMA_SEGS 8 /* maximum segs in a tx mbuf dma */ | ||||
#define CGEM_CKSUM_ASSIST (CSUM_IP | CSUM_TCP | CSUM_UDP | \ | #define CGEM_CKSUM_ASSIST (CSUM_IP | CSUM_TCP | CSUM_UDP | \ | ||||
CSUM_TCP_IPV6 | CSUM_UDP_IPV6) | CSUM_TCP_IPV6 | CSUM_UDP_IPV6) | ||||
static struct ofw_compat_data compat_data[] = { | |||||
{ "cadence,gem", 1 }, | |||||
{ "cdns,macb", 1 }, | |||||
{ NULL, 0 }, | |||||
}; | |||||
struct cgem_softc { | struct cgem_softc { | ||||
if_t ifp; | if_t ifp; | ||||
struct mtx sc_mtx; | struct mtx sc_mtx; | ||||
device_t dev; | device_t dev; | ||||
device_t miibus; | device_t miibus; | ||||
u_int mii_media_active; /* last active media */ | u_int mii_media_active; /* last active media */ | ||||
int if_old_flags; | int if_old_flags; | ||||
struct resource *mem_res; | struct resource *mem_res; | ||||
▲ Show 20 Lines • Show All 1,521 Lines • ▼ Show 20 Lines | |||||
static int | static int | ||||
cgem_probe(device_t dev) | cgem_probe(device_t dev) | ||||
{ | { | ||||
if (!ofw_bus_status_okay(dev)) | if (!ofw_bus_status_okay(dev)) | ||||
return (ENXIO); | return (ENXIO); | ||||
if (!ofw_bus_is_compatible(dev, "cadence,gem")) | if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) | ||||
return (ENXIO); | return (ENXIO); | ||||
device_set_desc(dev, "Cadence CGEM Gigabit Ethernet Interface"); | device_set_desc(dev, "Cadence CGEM Gigabit Ethernet Interface"); | ||||
return (0); | return (0); | ||||
} | } | ||||
static int | static int | ||||
cgem_attach(device_t dev) | cgem_attach(device_t dev) | ||||
▲ Show 20 Lines • Show All 222 Lines • Show Last 20 Lines |