Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/ahci/ahci.c
Show First 20 Lines • Show All 2,411 Lines • ▼ Show 20 Lines | if (ccb->ccb_h.func_code == XPT_SCSI_IO) { | ||||
if (ccb->ataio.cmd.flags & CAM_ATAIO_FPDMA) { | if (ccb->ataio.cmd.flags & CAM_ATAIO_FPDMA) { | ||||
fis[12] = tag << 3; | fis[12] = tag << 3; | ||||
fis[13] = 0; | fis[13] = 0; | ||||
} else { | } else { | ||||
fis[12] = ccb->ataio.cmd.sector_count; | fis[12] = ccb->ataio.cmd.sector_count; | ||||
fis[13] = ccb->ataio.cmd.sector_count_exp; | fis[13] = ccb->ataio.cmd.sector_count_exp; | ||||
} | } | ||||
fis[15] = ATA_A_4BIT; | fis[15] = ATA_A_4BIT; | ||||
/* Gross and vile hack -- makes ncq trim work w/o changing ataio size */ | |||||
ngie: Could this be done better (even if it breaks KBI), and if so, is there a plan to do this? | |||||
impAuthorUnsubmitted Not Done Inline ActionsCan't be done w/o breaking the KBI between CAM and userland. Ken Merry, Scott Long and I have been working on a more general solution because the Auxiliary register is used in a lot of the SMR commands, and it needs to have values other than 1 or 0. Since I did most of this work in 10.x, I didn't want to break the KBI. So we have this ugly kludge until the more general work is completed. imp: Can't be done w/o breaking the KBI between CAM and userland. Ken Merry, Scott Long and I have… | |||||
if (ccb->ataio.cmd.flags & CAM_ATAIO_AUX_HACK) | |||||
fis[16] = 1; | |||||
} else { | } else { | ||||
fis[15] = ccb->ataio.cmd.control; | fis[15] = ccb->ataio.cmd.control; | ||||
} | } | ||||
return (20); | return (20); | ||||
} | } | ||||
static int | static int | ||||
ahci_sata_connect(struct ahci_channel *ch) | ahci_sata_connect(struct ahci_channel *ch) | ||||
▲ Show 20 Lines • Show All 241 Lines • ▼ Show 20 Lines | case XPT_PATH_INQ: /* Path routing inquiry */ | ||||
cpi->version_num = 1; /* XXX??? */ | cpi->version_num = 1; /* XXX??? */ | ||||
cpi->hba_inquiry = PI_SDTR_ABLE; | cpi->hba_inquiry = PI_SDTR_ABLE; | ||||
if (ch->caps & AHCI_CAP_SNCQ) | if (ch->caps & AHCI_CAP_SNCQ) | ||||
cpi->hba_inquiry |= PI_TAG_ABLE; | cpi->hba_inquiry |= PI_TAG_ABLE; | ||||
if (ch->caps & AHCI_CAP_SPM) | if (ch->caps & AHCI_CAP_SPM) | ||||
cpi->hba_inquiry |= PI_SATAPM; | cpi->hba_inquiry |= PI_SATAPM; | ||||
cpi->target_sprt = 0; | cpi->target_sprt = 0; | ||||
cpi->hba_misc = PIM_SEQSCAN | PIM_UNMAPPED; | cpi->hba_misc = PIM_SEQSCAN | PIM_UNMAPPED | PIM_NCQ_KLUDGE; | ||||
cpi->hba_eng_cnt = 0; | cpi->hba_eng_cnt = 0; | ||||
if (ch->caps & AHCI_CAP_SPM) | if (ch->caps & AHCI_CAP_SPM) | ||||
cpi->max_target = 15; | cpi->max_target = 15; | ||||
else | else | ||||
cpi->max_target = 0; | cpi->max_target = 0; | ||||
cpi->max_lun = 0; | cpi->max_lun = 0; | ||||
cpi->initiator_id = 0; | cpi->initiator_id = 0; | ||||
cpi->bus_id = cam_sim_bus(sim); | cpi->bus_id = cam_sim_bus(sim); | ||||
▲ Show 20 Lines • Show All 45 Lines • Show Last 20 Lines |
Could this be done better (even if it breaks KBI), and if so, is there a plan to do this?