Changeset View
Changeset View
Standalone View
Standalone View
sys/cam/scsi/scsi_da.c
Show First 20 Lines • Show All 2,843 Lines • ▼ Show 20 Lines | if (scsi_vpd_supported_page(periph, SVPD_ATA_INFORMATION)) { | ||||
softc->zone_interface = DA_ZONE_IF_ATA_PASS; | softc->zone_interface = DA_ZONE_IF_ATA_PASS; | ||||
} else | } else | ||||
softc->zone_interface = DA_ZONE_IF_SCSI; | softc->zone_interface = DA_ZONE_IF_SCSI; | ||||
} | } | ||||
TASK_INIT(&softc->sysctl_task, 0, dasysctlinit, periph); | TASK_INIT(&softc->sysctl_task, 0, dasysctlinit, periph); | ||||
/* | /* | ||||
* Take an exclusive section lock qon the periph while dastart is called | * Take an exclusive section lock on the periph while dastart is called | ||||
* to finish the probe. The lock will be dropped in dadone at the end | * to finish the probe. The lock will be dropped in dadone at the end | ||||
* of probe. This locks out daopen and daclose from racing with the | * of probe. This locks out daopen and daclose from racing with the | ||||
* probe. | * probe. | ||||
* | * | ||||
* XXX if cam_periph_hold returns an error, we don't hold a refcount. | * XXX if cam_periph_hold returns an error, we don't hold a refcount. | ||||
*/ | */ | ||||
(void)da_periph_hold(periph, PRIBIO, DA_REF_PROBE_HOLD); | (void)da_periph_hold(periph, PRIBIO, DA_REF_PROBE_HOLD); | ||||
▲ Show 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | softc->disk->d_devstat = devstat_new_entry(periph->periph_name, | ||||
periph->unit_number, 0, | periph->unit_number, 0, | ||||
DEVSTAT_BS_UNAVAILABLE, | DEVSTAT_BS_UNAVAILABLE, | ||||
SID_TYPE(&cgd->inq_data) | | SID_TYPE(&cgd->inq_data) | | ||||
XPORT_DEVSTAT_TYPE(cpi.transport), | XPORT_DEVSTAT_TYPE(cpi.transport), | ||||
DEVSTAT_PRIORITY_DISK); | DEVSTAT_PRIORITY_DISK); | ||||
softc->disk->d_open = daopen; | softc->disk->d_open = daopen; | ||||
softc->disk->d_close = daclose; | softc->disk->d_close = daclose; | ||||
softc->disk->d_strategy = dastrategy; | softc->disk->d_strategy = dastrategy; | ||||
if (cam_sim_pollable(periph->sim)) | |||||
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 */ | ||||
▲ Show 20 Lines • Show All 3,714 Lines • Show Last 20 Lines |