Changeset View
Changeset View
Standalone View
Standalone View
sys/cam/ata/ata_da.c
Show First 20 Lines • Show All 250 Lines • ▼ Show 20 Lines | #endif | ||||
struct trim_request trim_req; | struct trim_request trim_req; | ||||
#ifdef CAM_IO_STATS | #ifdef CAM_IO_STATS | ||||
struct sysctl_ctx_list sysctl_stats_ctx; | struct sysctl_ctx_list sysctl_stats_ctx; | ||||
struct sysctl_oid *sysctl_stats_tree; | struct sysctl_oid *sysctl_stats_tree; | ||||
u_int timeouts; | u_int timeouts; | ||||
u_int errors; | u_int errors; | ||||
u_int invalidations; | u_int invalidations; | ||||
#endif | #endif | ||||
#define ADA_ANNOUNCE_SZ 400 | |||||
char announce_buffer[ADA_ANNOUNCE_SZ]; | |||||
}; | }; | ||||
struct ada_quirk_entry { | struct ada_quirk_entry { | ||||
struct scsi_inquiry_pattern inq_pat; | struct scsi_inquiry_pattern inq_pat; | ||||
ada_quirks quirks; | ada_quirks quirks; | ||||
}; | }; | ||||
static struct ada_quirk_entry ada_quirk_table[] = | static struct ada_quirk_entry ada_quirk_table[] = | ||||
▲ Show 20 Lines • Show All 1,387 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
static cam_status | static cam_status | ||||
adaregister(struct cam_periph *periph, void *arg) | adaregister(struct cam_periph *periph, void *arg) | ||||
{ | { | ||||
struct ada_softc *softc; | struct ada_softc *softc; | ||||
struct ccb_pathinq cpi; | struct ccb_pathinq cpi; | ||||
struct ccb_getdev *cgd; | struct ccb_getdev *cgd; | ||||
char announce_buf[80]; | |||||
struct disk_params *dp; | struct disk_params *dp; | ||||
struct sbuf sb; | |||||
char announce_buf[80]; | |||||
caddr_t match; | caddr_t match; | ||||
u_int maxio; | u_int maxio; | ||||
int quirks; | int quirks; | ||||
cgd = (struct ccb_getdev *)arg; | cgd = (struct ccb_getdev *)arg; | ||||
if (cgd == NULL) { | if (cgd == NULL) { | ||||
printf("adaregister: no getdev CCB, can't register device\n"); | printf("adaregister: no getdev CCB, can't register device\n"); | ||||
return(CAM_REQ_CMP_ERR); | return(CAM_REQ_CMP_ERR); | ||||
▲ Show 20 Lines • Show All 156 Lines • ▼ Show 20 Lines | adaregister(struct cam_periph *periph, void *arg) | ||||
disk_create(softc->disk, DISK_VERSION); | disk_create(softc->disk, DISK_VERSION); | ||||
cam_periph_lock(periph); | cam_periph_lock(periph); | ||||
dp = &softc->params; | dp = &softc->params; | ||||
snprintf(announce_buf, sizeof(announce_buf), | snprintf(announce_buf, sizeof(announce_buf), | ||||
"%juMB (%ju %u byte sectors)", | "%juMB (%ju %u byte sectors)", | ||||
((uintmax_t)dp->secsize * dp->sectors) / (1024 * 1024), | ((uintmax_t)dp->secsize * dp->sectors) / (1024 * 1024), | ||||
(uintmax_t)dp->sectors, dp->secsize); | (uintmax_t)dp->sectors, dp->secsize); | ||||
xpt_announce_periph(periph, announce_buf); | |||||
xpt_announce_quirks(periph, softc->quirks, ADA_Q_BIT_STRING); | sbuf_new(&sb, softc->announce_buffer, ADA_ANNOUNCE_SZ, SBUF_FIXEDLEN); | ||||
xpt_announce_periph_sbuf(periph, &sb, announce_buf); | |||||
xpt_announce_quirks_sbuf(periph, &sb, softc->quirks, ADA_Q_BIT_STRING); | |||||
sbuf_finish(&sb); | |||||
sbuf_putbuf(&sb); | |||||
/* | /* | ||||
* Create our sysctl variables, now that we know | * Create our sysctl variables, now that we know | ||||
* we have successfully attached. | * we have successfully attached. | ||||
*/ | */ | ||||
if (cam_periph_acquire(periph) == CAM_REQ_CMP) | if (cam_periph_acquire(periph) == CAM_REQ_CMP) | ||||
taskqueue_enqueue(taskqueue_thread, &softc->sysctl_task); | taskqueue_enqueue(taskqueue_thread, &softc->sysctl_task); | ||||
▲ Show 20 Lines • Show All 1,686 Lines • Show Last 20 Lines |