Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/cxgbe/t4_main.c
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 91 Lines • ▼ Show 20 Lines | |||||
#include "t4_mp_ring.h" | #include "t4_mp_ring.h" | ||||
#include "t4_if.h" | #include "t4_if.h" | ||||
#include "t4_smt.h" | #include "t4_smt.h" | ||||
/* T4 bus driver interface */ | /* T4 bus driver interface */ | ||||
static int t4_probe(device_t); | static int t4_probe(device_t); | ||||
static int t4_attach(device_t); | static int t4_attach(device_t); | ||||
static int t4_detach(device_t); | static int t4_detach(device_t); | ||||
static int t4_child_location_str(device_t, device_t, char *, size_t); | static int t4_child_location(device_t, device_t, struct sbuf *); | ||||
static int t4_ready(device_t); | static int t4_ready(device_t); | ||||
static int t4_read_port_device(device_t, int, device_t *); | static int t4_read_port_device(device_t, int, device_t *); | ||||
static device_method_t t4_methods[] = { | static device_method_t t4_methods[] = { | ||||
DEVMETHOD(device_probe, t4_probe), | DEVMETHOD(device_probe, t4_probe), | ||||
DEVMETHOD(device_attach, t4_attach), | DEVMETHOD(device_attach, t4_attach), | ||||
DEVMETHOD(device_detach, t4_detach), | DEVMETHOD(device_detach, t4_detach), | ||||
DEVMETHOD(bus_child_location_str, t4_child_location_str), | DEVMETHOD(bus_child_location, t4_child_location), | ||||
DEVMETHOD(t4_is_main_ready, t4_ready), | DEVMETHOD(t4_is_main_ready, t4_ready), | ||||
DEVMETHOD(t4_read_port_device, t4_read_port_device), | DEVMETHOD(t4_read_port_device, t4_read_port_device), | ||||
DEVMETHOD_END | DEVMETHOD_END | ||||
}; | }; | ||||
static driver_t t4_driver = { | static driver_t t4_driver = { | ||||
"t4nex", | "t4nex", | ||||
▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | |||||
/* T5 bus driver interface */ | /* T5 bus driver interface */ | ||||
static int t5_probe(device_t); | static int t5_probe(device_t); | ||||
static device_method_t t5_methods[] = { | static device_method_t t5_methods[] = { | ||||
DEVMETHOD(device_probe, t5_probe), | DEVMETHOD(device_probe, t5_probe), | ||||
DEVMETHOD(device_attach, t4_attach), | DEVMETHOD(device_attach, t4_attach), | ||||
DEVMETHOD(device_detach, t4_detach), | DEVMETHOD(device_detach, t4_detach), | ||||
DEVMETHOD(bus_child_location_str, t4_child_location_str), | DEVMETHOD(bus_child_location, t4_child_location), | ||||
DEVMETHOD(t4_is_main_ready, t4_ready), | DEVMETHOD(t4_is_main_ready, t4_ready), | ||||
DEVMETHOD(t4_read_port_device, t4_read_port_device), | DEVMETHOD(t4_read_port_device, t4_read_port_device), | ||||
DEVMETHOD_END | DEVMETHOD_END | ||||
}; | }; | ||||
static driver_t t5_driver = { | static driver_t t5_driver = { | ||||
"t5nex", | "t5nex", | ||||
Show All 18 Lines | |||||
/* T6 bus driver interface */ | /* T6 bus driver interface */ | ||||
static int t6_probe(device_t); | static int t6_probe(device_t); | ||||
static device_method_t t6_methods[] = { | static device_method_t t6_methods[] = { | ||||
DEVMETHOD(device_probe, t6_probe), | DEVMETHOD(device_probe, t6_probe), | ||||
DEVMETHOD(device_attach, t4_attach), | DEVMETHOD(device_attach, t4_attach), | ||||
DEVMETHOD(device_detach, t4_detach), | DEVMETHOD(device_detach, t4_detach), | ||||
DEVMETHOD(bus_child_location_str, t4_child_location_str), | DEVMETHOD(bus_child_location, t4_child_location), | ||||
DEVMETHOD(t4_is_main_ready, t4_ready), | DEVMETHOD(t4_is_main_ready, t4_ready), | ||||
DEVMETHOD(t4_read_port_device, t4_read_port_device), | DEVMETHOD(t4_read_port_device, t4_read_port_device), | ||||
DEVMETHOD_END | DEVMETHOD_END | ||||
}; | }; | ||||
static driver_t t6_driver = { | static driver_t t6_driver = { | ||||
"t6nex", | "t6nex", | ||||
▲ Show 20 Lines • Show All 1,311 Lines • ▼ Show 20 Lines | if (rc != 0) | ||||
t4_detach_common(dev); | t4_detach_common(dev); | ||||
else | else | ||||
t4_sysctls(sc); | t4_sysctls(sc); | ||||
return (rc); | return (rc); | ||||
} | } | ||||
static int | static int | ||||
t4_child_location_str(device_t bus, device_t dev, char *buf, size_t buflen) | t4_child_location(device_t bus, device_t dev, struct sbuf *sb) | ||||
{ | { | ||||
struct adapter *sc; | struct adapter *sc; | ||||
struct port_info *pi; | struct port_info *pi; | ||||
int i; | int i; | ||||
sc = device_get_softc(bus); | sc = device_get_softc(bus); | ||||
buf[0] = '\0'; | |||||
for_each_port(sc, i) { | for_each_port(sc, i) { | ||||
pi = sc->port[i]; | pi = sc->port[i]; | ||||
if (pi != NULL && pi->dev == dev) { | if (pi != NULL && pi->dev == dev) { | ||||
snprintf(buf, buflen, "port=%d", pi->port_id); | sbuf_printf(sb, "port=%d", pi->port_id); | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
return (0); | return (0); | ||||
} | } | ||||
static int | static int | ||||
t4_ready(device_t dev) | t4_ready(device_t dev) | ||||
▲ Show 20 Lines • Show All 10,361 Lines • Show Last 20 Lines |