Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/usb/wlan/if_urtw.c
Show First 20 Lines • Show All 61 Lines • ▼ Show 20 Lines | |||||
#include <dev/usb/wlan/if_urtwvar.h> | #include <dev/usb/wlan/if_urtwvar.h> | ||||
/* copy some rate indices from if_rtwn_ridx.h */ | /* copy some rate indices from if_rtwn_ridx.h */ | ||||
#define URTW_RIDX_CCK5 2 | #define URTW_RIDX_CCK5 2 | ||||
#define URTW_RIDX_CCK11 3 | #define URTW_RIDX_CCK11 3 | ||||
#define URTW_RIDX_OFDM6 4 | #define URTW_RIDX_OFDM6 4 | ||||
#define URTW_RIDX_OFDM24 8 | #define URTW_RIDX_OFDM24 8 | ||||
static SYSCTL_NODE(_hw_usb, OID_AUTO, urtw, CTLFLAG_RW, 0, "USB Realtek 8187L"); | static SYSCTL_NODE(_hw_usb, OID_AUTO, urtw, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, | ||||
"USB Realtek 8187L"); | |||||
#ifdef URTW_DEBUG | #ifdef URTW_DEBUG | ||||
int urtw_debug = 0; | int urtw_debug = 0; | ||||
SYSCTL_INT(_hw_usb_urtw, OID_AUTO, debug, CTLFLAG_RWTUN, &urtw_debug, 0, | SYSCTL_INT(_hw_usb_urtw, OID_AUTO, debug, CTLFLAG_RWTUN, &urtw_debug, 0, | ||||
"control debugging printfs"); | "control debugging printfs"); | ||||
enum { | enum { | ||||
URTW_DEBUG_XMIT = 0x00000001, /* basic xmit operation */ | URTW_DEBUG_XMIT = 0x00000001, /* basic xmit operation */ | ||||
URTW_DEBUG_RECV = 0x00000002, /* basic recv operation */ | URTW_DEBUG_RECV = 0x00000002, /* basic recv operation */ | ||||
URTW_DEBUG_RESET = 0x00000004, /* reset processing */ | URTW_DEBUG_RESET = 0x00000004, /* reset processing */ | ||||
▲ Show 20 Lines • Show All 4,301 Lines • ▼ Show 20 Lines | #define URTW_SYSCTL_STAT_ADD32(c, h, n, p, d) \ | ||||
struct sysctl_ctx_list *ctx; | struct sysctl_ctx_list *ctx; | ||||
struct sysctl_oid_list *child, *parent; | struct sysctl_oid_list *child, *parent; | ||||
struct sysctl_oid *tree; | struct sysctl_oid *tree; | ||||
struct urtw_stats *stats = &sc->sc_stats; | struct urtw_stats *stats = &sc->sc_stats; | ||||
ctx = device_get_sysctl_ctx(sc->sc_dev); | ctx = device_get_sysctl_ctx(sc->sc_dev); | ||||
child = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->sc_dev)); | child = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->sc_dev)); | ||||
tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", CTLFLAG_RD, | tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", | ||||
NULL, "URTW statistics"); | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "URTW statistics"); | ||||
parent = SYSCTL_CHILDREN(tree); | parent = SYSCTL_CHILDREN(tree); | ||||
/* Tx statistics. */ | /* Tx statistics. */ | ||||
tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "tx", CTLFLAG_RD, | tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "tx", | ||||
NULL, "Tx MAC statistics"); | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Tx MAC statistics"); | ||||
child = SYSCTL_CHILDREN(tree); | child = SYSCTL_CHILDREN(tree); | ||||
URTW_SYSCTL_STAT_ADD32(ctx, child, "1m", &stats->txrates[0], | URTW_SYSCTL_STAT_ADD32(ctx, child, "1m", &stats->txrates[0], | ||||
"1 Mbit/s"); | "1 Mbit/s"); | ||||
URTW_SYSCTL_STAT_ADD32(ctx, child, "2m", &stats->txrates[1], | URTW_SYSCTL_STAT_ADD32(ctx, child, "2m", &stats->txrates[1], | ||||
"2 Mbit/s"); | "2 Mbit/s"); | ||||
URTW_SYSCTL_STAT_ADD32(ctx, child, "5.5m", &stats->txrates[2], | URTW_SYSCTL_STAT_ADD32(ctx, child, "5.5m", &stats->txrates[2], | ||||
"5.5 Mbit/s"); | "5.5 Mbit/s"); | ||||
URTW_SYSCTL_STAT_ADD32(ctx, child, "6m", &stats->txrates[4], | URTW_SYSCTL_STAT_ADD32(ctx, child, "6m", &stats->txrates[4], | ||||
Show All 38 Lines |