Changeset View
Changeset View
Standalone View
Standalone View
head/sys/cam/ata/ata_xpt.c
Show First 20 Lines • Show All 887 Lines • ▼ Show 20 Lines | case PROBE_RESET: | ||||
} | } | ||||
xpt_release_ccb(done_ccb); | xpt_release_ccb(done_ccb); | ||||
xpt_schedule(periph, priority); | xpt_schedule(periph, priority); | ||||
goto out; | goto out; | ||||
} | } | ||||
case PROBE_IDENTIFY: | case PROBE_IDENTIFY: | ||||
{ | { | ||||
struct ccb_pathinq cpi; | struct ccb_pathinq cpi; | ||||
int16_t *ptr; | |||||
int veto = 0; | int veto = 0; | ||||
/* | |||||
* Convert to host byte order, and fix the strings. | |||||
*/ | |||||
ident_buf = &softc->ident_data; | ident_buf = &softc->ident_data; | ||||
ata_param_fixup(ident_buf); | for (ptr = (int16_t *)ident_buf; | ||||
ptr < (int16_t *)ident_buf + sizeof(struct ata_params)/2; ptr++) { | |||||
*ptr = le16toh(*ptr); | |||||
} | |||||
/* | /* | ||||
* Allow others to veto this ATA disk attachment. This | * Allow others to veto this ATA disk attachment. This | ||||
* is mainly used by VMs, whose disk controllers may | * is mainly used by VMs, whose disk controllers may | ||||
* share the disks with the simulated ATA controllers. | * share the disks with the simulated ATA controllers. | ||||
*/ | */ | ||||
EVENTHANDLER_INVOKE(ada_probe_veto, path, ident_buf, &veto); | EVENTHANDLER_INVOKE(ada_probe_veto, path, ident_buf, &veto); | ||||
if (veto) { | if (veto) { | ||||
goto device_fail; | goto device_fail; | ||||
} | } | ||||
if (strncmp(ident_buf->model, "FX", 2) && | |||||
strncmp(ident_buf->model, "NEC", 3) && | |||||
strncmp(ident_buf->model, "Pioneer", 7) && | |||||
strncmp(ident_buf->model, "SHARP", 5)) { | |||||
ata_bswap(ident_buf->model, sizeof(ident_buf->model)); | |||||
ata_bswap(ident_buf->revision, sizeof(ident_buf->revision)); | |||||
ata_bswap(ident_buf->serial, sizeof(ident_buf->serial)); | |||||
} | |||||
ata_btrim(ident_buf->model, sizeof(ident_buf->model)); | |||||
ata_bpack(ident_buf->model, ident_buf->model, sizeof(ident_buf->model)); | |||||
ata_btrim(ident_buf->revision, sizeof(ident_buf->revision)); | |||||
ata_bpack(ident_buf->revision, ident_buf->revision, sizeof(ident_buf->revision)); | |||||
ata_btrim(ident_buf->serial, sizeof(ident_buf->serial)); | |||||
ata_bpack(ident_buf->serial, ident_buf->serial, sizeof(ident_buf->serial)); | |||||
/* Device may need spin-up before IDENTIFY become valid. */ | /* Device may need spin-up before IDENTIFY become valid. */ | ||||
if ((ident_buf->specconf == 0x37c8 || | if ((ident_buf->specconf == 0x37c8 || | ||||
ident_buf->specconf == 0x738c) && | ident_buf->specconf == 0x738c) && | ||||
((ident_buf->config & ATA_RESP_INCOMPLETE) || | ((ident_buf->config & ATA_RESP_INCOMPLETE) || | ||||
softc->spinup == 0)) { | softc->spinup == 0)) { | ||||
PROBE_SET_ACTION(softc, PROBE_SPINUP); | PROBE_SET_ACTION(softc, PROBE_SPINUP); | ||||
xpt_release_ccb(done_ccb); | xpt_release_ccb(done_ccb); | ||||
xpt_schedule(periph, priority); | xpt_schedule(periph, priority); | ||||
▲ Show 20 Lines • Show All 1,343 Lines • Show Last 20 Lines |