Changeset View
Changeset View
Standalone View
Standalone View
sys/cam/ata/ata_pmp.c
Show All 12 Lines | |||||
#ifndef PMP_DEFAULT_HIDE_SPECIAL | #ifndef PMP_DEFAULT_HIDE_SPECIAL | ||||
#define PMP_DEFAULT_HIDE_SPECIAL 1 | #define PMP_DEFAULT_HIDE_SPECIAL 1 | ||||
#endif | #endif | ||||
static int pmp_retry_count = PMP_DEFAULT_RETRY; | static int pmp_retry_count = PMP_DEFAULT_RETRY; | ||||
static int pmp_default_timeout = PMP_DEFAULT_TIMEOUT; | static int pmp_default_timeout = PMP_DEFAULT_TIMEOUT; | ||||
static int pmp_hide_special = PMP_DEFAULT_HIDE_SPECIAL; | static int pmp_hide_special = PMP_DEFAULT_HIDE_SPECIAL; | ||||
static SYSCTL_NODE(_kern_cam, OID_AUTO, pmp, CTLFLAG_RD, 0, | static SYSCTL_NODE(_kern_cam, OID_AUTO, pmp, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, | ||||
"CAM Direct Access Disk driver"); | "CAM Direct Access Disk driver"); | ||||
SYSCTL_INT(_kern_cam_pmp, OID_AUTO, retry_count, CTLFLAG_RWTUN, | SYSCTL_INT(_kern_cam_pmp, OID_AUTO, retry_count, CTLFLAG_RWTUN, | ||||
&pmp_retry_count, 0, "Normal I/O retry count"); | &pmp_retry_count, 0, "Normal I/O retry count"); | ||||
SYSCTL_INT(_kern_cam_pmp, OID_AUTO, default_timeout, CTLFLAG_RWTUN, | SYSCTL_INT(_kern_cam_pmp, OID_AUTO, default_timeout, CTLFLAG_RWTUN, | ||||
&pmp_default_timeout, 0, "Normal I/O timeout (in seconds)"); | &pmp_default_timeout, 0, "Normal I/O timeout (in seconds)"); | ||||
SYSCTL_INT(_kern_cam_pmp, OID_AUTO, hide_special, CTLFLAG_RWTUN, | SYSCTL_INT(_kern_cam_pmp, OID_AUTO, hide_special, CTLFLAG_RWTUN, | ||||
&pmp_hide_special, 0, "Hide extra ports"); | &pmp_hide_special, 0, "Hide extra ports"); | ||||
static struct periph_driver pmpdriver = | static struct periph_driver pmpdriver = | ||||
Show All 24 Lines | |||||
softc = (struct pmp_softc *)periph->softc; | softc = (struct pmp_softc *)periph->softc; | ||||
snprintf(tmpstr, sizeof(tmpstr), "CAM PMP unit %d", periph->unit_number); | snprintf(tmpstr, sizeof(tmpstr), "CAM PMP unit %d", periph->unit_number); | ||||
snprintf(tmpstr2, sizeof(tmpstr2), "%d", periph->unit_number); | snprintf(tmpstr2, sizeof(tmpstr2), "%d", periph->unit_number); | ||||
sysctl_ctx_init(&softc->sysctl_ctx); | sysctl_ctx_init(&softc->sysctl_ctx); | ||||
softc->flags |= PMP_FLAG_SCTX_INIT; | softc->flags |= PMP_FLAG_SCTX_INIT; | ||||
softc->sysctl_tree = SYSCTL_ADD_NODE_WITH_LABEL(&softc->sysctl_ctx, | softc->sysctl_tree = SYSCTL_ADD_NODE_WITH_LABEL(&softc->sysctl_ctx, | ||||
SYSCTL_STATIC_CHILDREN(_kern_cam_pmp), OID_AUTO, tmpstr2, | SYSCTL_STATIC_CHILDREN(_kern_cam_pmp), OID_AUTO, tmpstr2, | ||||
CTLFLAG_RD, 0, tmpstr, "device_index"); | CTLFLAG_RD | CTLFLAG_MPSAFE, 0, tmpstr, "device_index"); | ||||
if (softc->sysctl_tree == NULL) { | if (softc->sysctl_tree == NULL) { | ||||
printf("pmpsysctlinit: unable to allocate sysctl tree\n"); | printf("pmpsysctlinit: unable to allocate sysctl tree\n"); | ||||
cam_periph_release(periph); | cam_periph_release(periph); | ||||
return; | return; | ||||
} | } | ||||
cam_periph_release(periph); | cam_periph_release(periph); | ||||
} | } | ||||
Show All 12 Lines |