Changeset View
Changeset View
Standalone View
Standalone View
head/sys/cam/scsi/scsi_da.c
Show First 20 Lines • Show All 2,688 Lines • ▼ Show 20 Lines | |||||
static cam_status | static cam_status | ||||
daregister(struct cam_periph *periph, void *arg) | daregister(struct cam_periph *periph, void *arg) | ||||
{ | { | ||||
struct da_softc *softc; | struct da_softc *softc; | ||||
struct ccb_pathinq cpi; | struct ccb_pathinq cpi; | ||||
struct ccb_getdev *cgd; | struct ccb_getdev *cgd; | ||||
char tmpstr[80]; | char tmpstr[80]; | ||||
caddr_t match; | caddr_t match; | ||||
int quirks; | |||||
cgd = (struct ccb_getdev *)arg; | cgd = (struct ccb_getdev *)arg; | ||||
if (cgd == NULL) { | if (cgd == NULL) { | ||||
printf("daregister: no getdev CCB, can't register device\n"); | printf("daregister: no getdev CCB, can't register device\n"); | ||||
return(CAM_REQ_CMP_ERR); | return(CAM_REQ_CMP_ERR); | ||||
} | } | ||||
softc = (struct da_softc *)malloc(sizeof(*softc), M_DEVBUF, | softc = (struct da_softc *)malloc(sizeof(*softc), M_DEVBUF, | ||||
Show All 39 Lines | if (match != NULL) | ||||
softc->quirks = ((struct da_quirk_entry *)match)->quirks; | softc->quirks = ((struct da_quirk_entry *)match)->quirks; | ||||
else | else | ||||
softc->quirks = DA_Q_NONE; | softc->quirks = DA_Q_NONE; | ||||
/* Check if the SIM does not want 6 byte commands */ | /* Check if the SIM does not want 6 byte commands */ | ||||
xpt_path_inq(&cpi, periph->path); | xpt_path_inq(&cpi, periph->path); | ||||
if (cpi.ccb_h.status == CAM_REQ_CMP && (cpi.hba_misc & PIM_NO_6_BYTE)) | if (cpi.ccb_h.status == CAM_REQ_CMP && (cpi.hba_misc & PIM_NO_6_BYTE)) | ||||
softc->quirks |= DA_Q_NO_6_BYTE; | softc->quirks |= DA_Q_NO_6_BYTE; | ||||
/* Override quirks if tunable is set */ | |||||
snprintf(tmpstr, sizeof(tmpstr), "kern.cam.da.%d.quirks", | |||||
periph->unit_number); | |||||
quirks = softc->quirks; | |||||
TUNABLE_INT_FETCH(tmpstr, &quirks); | |||||
softc->quirks = quirks; | |||||
if (SID_TYPE(&cgd->inq_data) == T_ZBC_HM) | if (SID_TYPE(&cgd->inq_data) == T_ZBC_HM) | ||||
softc->zone_mode = DA_ZONE_HOST_MANAGED; | softc->zone_mode = DA_ZONE_HOST_MANAGED; | ||||
else if (softc->quirks & DA_Q_SMR_DM) | else if (softc->quirks & DA_Q_SMR_DM) | ||||
softc->zone_mode = DA_ZONE_DRIVE_MANAGED; | softc->zone_mode = DA_ZONE_DRIVE_MANAGED; | ||||
else | else | ||||
softc->zone_mode = DA_ZONE_NONE; | softc->zone_mode = DA_ZONE_NONE; | ||||
▲ Show 20 Lines • Show All 3,782 Lines • Show Last 20 Lines |