Changeset View
Changeset View
Standalone View
Standalone View
sys/cam/scsi/scsi_da.c
Show First 20 Lines • Show All 2,915 Lines • ▼ Show 20 Lines | daregister(struct cam_periph *periph, void *arg) | ||||
softc->disk->d_strategy = dastrategy; | softc->disk->d_strategy = dastrategy; | ||||
softc->disk->d_dump = dadump; | softc->disk->d_dump = dadump; | ||||
softc->disk->d_getattr = dagetattr; | softc->disk->d_getattr = dagetattr; | ||||
softc->disk->d_gone = dadiskgonecb; | softc->disk->d_gone = dadiskgonecb; | ||||
softc->disk->d_name = "da"; | softc->disk->d_name = "da"; | ||||
softc->disk->d_drv1 = periph; | softc->disk->d_drv1 = periph; | ||||
if (cpi.maxio == 0) | if (cpi.maxio == 0) | ||||
softc->maxio = DFLTPHYS; /* traditional default */ | softc->maxio = DFLTPHYS; /* traditional default */ | ||||
else if (cpi.maxio > MAXPHYS) | else if (cpi.maxio > maxphys) | ||||
softc->maxio = MAXPHYS; /* for safety */ | softc->maxio = maxphys; /* for safety */ | ||||
else | else | ||||
softc->maxio = cpi.maxio; | softc->maxio = cpi.maxio; | ||||
if (softc->quirks & DA_Q_128KB) | if (softc->quirks & DA_Q_128KB) | ||||
softc->maxio = min(softc->maxio, 128 * 1024); | softc->maxio = min(softc->maxio, 128 * 1024); | ||||
softc->disk->d_maxsize = softc->maxio; | softc->disk->d_maxsize = softc->maxio; | ||||
softc->disk->d_unit = periph->unit_number; | softc->disk->d_unit = periph->unit_number; | ||||
softc->disk->d_flags = DISKFLAG_DIRECT_COMPLETION | DISKFLAG_CANZONE; | softc->disk->d_flags = DISKFLAG_DIRECT_COMPLETION | DISKFLAG_CANZONE; | ||||
if ((softc->quirks & DA_Q_NO_SYNC_CACHE) == 0) | if ((softc->quirks & DA_Q_NO_SYNC_CACHE) == 0) | ||||
▲ Show 20 Lines • Show All 1,880 Lines • ▼ Show 20 Lines | if ((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) { | ||||
* give them an 'illegal' value we'll avoid that | * give them an 'illegal' value we'll avoid that | ||||
* here. | * here. | ||||
*/ | */ | ||||
if (block_size == 0) { | if (block_size == 0) { | ||||
block_size = 512; | block_size = 512; | ||||
if (maxsector == 0) | if (maxsector == 0) | ||||
maxsector = -1; | maxsector = -1; | ||||
} | } | ||||
if (block_size >= MAXPHYS) { | if (block_size >= maxphys) { | ||||
xpt_print(periph->path, | xpt_print(periph->path, | ||||
"unsupportable block size %ju\n", | "unsupportable block size %ju\n", | ||||
(uintmax_t) block_size); | (uintmax_t) block_size); | ||||
announce_buf = NULL; | announce_buf = NULL; | ||||
cam_periph_invalidate(periph); | cam_periph_invalidate(periph); | ||||
} else { | } else { | ||||
/* | /* | ||||
* We pass rcaplong into dasetgeom(), | * We pass rcaplong into dasetgeom(), | ||||
▲ Show 20 Lines • Show All 1,809 Lines • Show Last 20 Lines |