Lines Matching refs:tf
206 const struct ata_taskfile *tf)
213 information = ata_tf_read_block(tf, dev);
659 * @tf: ptr to filled out taskfile
668 static void ata_dump_status(unsigned id, struct ata_taskfile *tf)
670 u8 stat = tf->command, err = tf->feature;
853 struct ata_taskfile *tf = &qc->result_tf;
868 tf->command & (ATA_BUSY | ATA_DF | ATA_ERR | ATA_DRQ)) {
869 ata_to_sense_error(qc->ap->print_id, tf->command, tf->feature,
899 desc[3] = tf->feature; /* == error reg */
900 desc[5] = tf->nsect;
901 desc[7] = tf->lbal;
902 desc[9] = tf->lbam;
903 desc[11] = tf->lbah;
904 desc[12] = tf->device;
905 desc[13] = tf->command; /* == status reg */
911 if (tf->flags & ATA_TFLAG_LBA48) {
913 desc[4] = tf->hob_nsect;
914 desc[6] = tf->hob_lbal;
915 desc[8] = tf->hob_lbam;
916 desc[10] = tf->hob_lbah;
920 desc[0] = tf->feature;
921 desc[1] = tf->command; /* status */
922 desc[2] = tf->device;
923 desc[3] = tf->nsect;
925 if (tf->flags & ATA_TFLAG_LBA48) {
927 if (tf->hob_nsect)
929 if (tf->hob_lbal || tf->hob_lbam || tf->hob_lbah)
932 desc[9] = tf->lbal;
933 desc[10] = tf->lbam;
934 desc[11] = tf->lbah;
952 struct ata_taskfile *tf = &qc->result_tf;
972 tf->command & (ATA_BUSY | ATA_DF | ATA_ERR | ATA_DRQ)) {
973 ata_to_sense_error(qc->ap->print_id, tf->command, tf->feature,
979 tf->command, qc->err_mask);
1171 struct ata_taskfile *tf = &qc->tf;
1181 tf->flags |= ATA_TFLAG_DEVICE | ATA_TFLAG_ISADDR;
1182 tf->protocol = ATA_PROT_NODATA;
1198 tf->nsect = 1; /* 1 sector, lba=0 */
1201 tf->flags |= ATA_TFLAG_LBA;
1203 tf->lbah = 0x0;
1204 tf->lbam = 0x0;
1205 tf->lbal = 0x0;
1206 tf->device |= ATA_LBA;
1209 tf->lbal = 0x1; /* sect */
1210 tf->lbam = 0x0; /* cyl low */
1211 tf->lbah = 0x0; /* cyl high */
1214 tf->command = ATA_CMD_VERIFY; /* READ VERIFY */
1228 tf->command = ATA_CMD_STANDBYNOW1;
1264 struct ata_taskfile *tf = &qc->tf;
1266 tf->flags |= ATA_TFLAG_DEVICE;
1267 tf->protocol = ATA_PROT_NODATA;
1270 tf->command = ATA_CMD_FLUSH_EXT;
1272 tf->command = ATA_CMD_FLUSH;
1386 struct ata_taskfile *tf = &qc->tf;
1394 tf->flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE;
1395 tf->protocol = ATA_PROT_NODATA;
1422 tf->flags |= ATA_TFLAG_LBA;
1426 tf->command = ATA_CMD_VERIFY;
1427 tf->device |= (block >> 24) & 0xf;
1433 tf->flags |= ATA_TFLAG_LBA48;
1434 tf->command = ATA_CMD_VERIFY_EXT;
1436 tf->hob_nsect = (n_block >> 8) & 0xff;
1438 tf->hob_lbah = (block >> 40) & 0xff;
1439 tf->hob_lbam = (block >> 32) & 0xff;
1440 tf->hob_lbal = (block >> 24) & 0xff;
1445 tf->nsect = n_block & 0xff;
1447 tf->lbah = (block >> 16) & 0xff;
1448 tf->lbam = (block >> 8) & 0xff;
1449 tf->lbal = block & 0xff;
1451 tf->device |= ATA_LBA;
1475 tf->command = ATA_CMD_VERIFY;
1476 tf->nsect = n_block & 0xff; /* Sector count 0 means 256 sectors */
1477 tf->lbal = sect;
1478 tf->lbam = cyl;
1479 tf->lbah = cyl >> 8;
1480 tf->device |= head;
1609 rc = ata_build_rw_tf(&qc->tf, qc->dev, block, n_block, tf_flags,
2532 ap->ops->sff_tf_read(ap, &qc->tf);
2537 cmd->sense_buffer[2] = qc->tf.feature >> 4;
2550 qc->tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE;
2551 qc->tf.command = ATA_CMD_PACKET;
2554 qc->tf.protocol = ATAPI_PROT_DMA;
2555 qc->tf.feature |= ATAPI_PKT_DMA;
2557 qc->tf.protocol = ATAPI_PROT_PIO;
2558 qc->tf.lbam = SCSI_SENSE_BUFFERSIZE;
2559 qc->tf.lbah = 0;
2674 qc->tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE;
2676 qc->tf.flags |= ATA_TFLAG_WRITE;
2680 qc->tf.command = ATA_CMD_PACKET;
2721 qc->tf.lbam = (nbytes & 0xFF);
2722 qc->tf.lbah = (nbytes >> 8);
2725 qc->tf.protocol = ATAPI_PROT_NODATA;
2727 qc->tf.protocol = ATAPI_PROT_PIO;
2730 qc->tf.protocol = ATAPI_PROT_DMA;
2731 qc->tf.feature |= ATAPI_PKT_DMA;
2736 qc->tf.feature |= ATAPI_DMADIR;
2874 struct ata_taskfile *tf = &(qc->tf);
2885 tf->protocol = ata_scsi_map_proto(cdb[1 + cdb_offset]);
2886 if (tf->protocol == ATA_PROT_UNKNOWN) {
2901 if (ata_is_ncq(tf->protocol))
2902 tf->protocol = ATA_PROT_NCQ_NODATA;
2906 tf->flags |= ATA_TFLAG_LBA;
2919 tf->hob_feature = cdb[3];
2920 tf->hob_nsect = cdb[5];
2921 tf->hob_lbal = cdb[7];
2922 tf->hob_lbam = cdb[9];
2923 tf->hob_lbah = cdb[11];
2924 tf->flags |= ATA_TFLAG_LBA48;
2926 tf->flags &= ~ATA_TFLAG_LBA48;
2931 tf->feature = cdb[4];
2932 tf->nsect = cdb[6];
2933 tf->lbal = cdb[8];
2934 tf->lbam = cdb[10];
2935 tf->lbah = cdb[12];
2936 tf->device = cdb[13];
2937 tf->command = cdb[14];
2942 tf->flags &= ~ATA_TFLAG_LBA48;
2944 tf->feature = cdb[3];
2945 tf->nsect = cdb[4];
2946 tf->lbal = cdb[5];
2947 tf->lbam = cdb[6];
2948 tf->lbah = cdb[7];
2949 tf->device = cdb[8];
2950 tf->command = cdb[9];
2958 tf->hob_feature = cdb[20];
2959 tf->hob_nsect = cdb[22];
2960 tf->hob_lbal = cdb[16];
2961 tf->hob_lbam = cdb[15];
2962 tf->hob_lbah = cdb[14];
2963 tf->flags |= ATA_TFLAG_LBA48;
2965 tf->flags &= ~ATA_TFLAG_LBA48;
2967 tf->feature = cdb[21];
2968 tf->nsect = cdb[23];
2969 tf->lbal = cdb[19];
2970 tf->lbam = cdb[18];
2971 tf->lbah = cdb[17];
2972 tf->device = cdb[24];
2973 tf->command = cdb[25];
2974 tf->auxiliary = get_unaligned_be32(&cdb[28]);
2978 if (ata_is_ncq(tf->protocol))
2979 tf->nsect = qc->hw_tag << 3;
2982 tf->device = dev->devno ?
2983 tf->device | ATA_DEV1 : tf->device & ~ATA_DEV1;
2985 switch (tf->command) {
2991 if (tf->protocol != ATA_PROT_PIO || tf->nsect != 1) {
3042 tf->flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE;
3044 tf->flags |= ATA_TFLAG_WRITE;
3057 if (tf->protocol == ATA_PROT_DMA && dev->dma_mode == 0) {
3063 if (ata_is_ncq(tf->protocol) && !ata_ncq_enabled(dev)) {
3069 if ((cdb[1] & 0xe0) && !is_multi_taskfile(tf)) {
3074 if (is_multi_taskfile(tf)) {
3092 if (tf->command == ATA_CMD_SET_FEATURES &&
3093 tf->feature == SETFEATURES_XFER) {
3113 if (tf->command >= 0x5C && tf->command <= 0x5F && !libata_allow_tpm) {
3192 struct ata_taskfile *tf = &qc->tf;
3256 tf->protocol = ATA_PROT_NCQ;
3257 tf->command = ATA_CMD_FPDMA_SEND;
3258 tf->hob_nsect = ATA_SUBCMD_FPDMA_SEND_DSM & 0x1f;
3259 tf->nsect = qc->hw_tag << 3;
3260 tf->hob_feature = (size / 512) >> 8;
3261 tf->feature = size / 512;
3263 tf->auxiliary = 1;
3265 tf->protocol = ATA_PROT_DMA;
3266 tf->hob_feature = 0;
3267 tf->feature = ATA_DSM_TRIM;
3268 tf->hob_nsect = (size / 512) >> 8;
3269 tf->nsect = size / 512;
3270 tf->command = ATA_CMD_DSM;
3273 tf->flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE | ATA_TFLAG_LBA48 |
3438 struct ata_taskfile *tf = &qc->tf;
3477 tf->protocol = ATA_PROT_NCQ;
3478 tf->command = ATA_CMD_FPDMA_RECV;
3479 tf->hob_nsect = ATA_SUBCMD_FPDMA_RECV_ZAC_MGMT_IN & 0x1f;
3480 tf->nsect = qc->hw_tag << 3;
3481 tf->feature = sect & 0xff;
3482 tf->hob_feature = (sect >> 8) & 0xff;
3483 tf->auxiliary = ATA_SUBCMD_ZAC_MGMT_IN_REPORT_ZONES | (options << 8);
3485 tf->command = ATA_CMD_ZAC_MGMT_IN;
3486 tf->feature = ATA_SUBCMD_ZAC_MGMT_IN_REPORT_ZONES;
3487 tf->protocol = ATA_PROT_DMA;
3488 tf->hob_feature = options;
3489 tf->hob_nsect = (sect >> 8) & 0xff;
3490 tf->nsect = sect & 0xff;
3492 tf->device = ATA_LBA;
3493 tf->lbah = (block >> 16) & 0xff;
3494 tf->lbam = (block >> 8) & 0xff;
3495 tf->lbal = block & 0xff;
3496 tf->hob_lbah = (block >> 40) & 0xff;
3497 tf->hob_lbam = (block >> 32) & 0xff;
3498 tf->hob_lbal = (block >> 24) & 0xff;
3500 tf->flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE | ATA_TFLAG_LBA48;
3521 struct ata_taskfile *tf = &qc->tf;
3566 tf->protocol = ATA_PROT_NCQ_NODATA;
3567 tf->command = ATA_CMD_NCQ_NON_DATA;
3568 tf->feature = ATA_SUBCMD_NCQ_NON_DATA_ZAC_MGMT_OUT;
3569 tf->nsect = qc->hw_tag << 3;
3570 tf->auxiliary = sa | ((u16)all << 8);
3572 tf->protocol = ATA_PROT_NODATA;
3573 tf->command = ATA_CMD_ZAC_MGMT_OUT;
3574 tf->feature = sa;
3575 tf->hob_feature = all;
3577 tf->lbah = (block >> 16) & 0xff;
3578 tf->lbam = (block >> 8) & 0xff;
3579 tf->lbal = block & 0xff;
3580 tf->hob_lbah = (block >> 40) & 0xff;
3581 tf->hob_lbam = (block >> 32) & 0xff;
3582 tf->hob_lbal = (block >> 24) & 0xff;
3583 tf->device = ATA_LBA;
3584 tf->flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE | ATA_TFLAG_LBA48;
3612 struct ata_taskfile *tf = &qc->tf;
3646 tf->flags |= ATA_TFLAG_DEVICE | ATA_TFLAG_ISADDR;
3647 tf->protocol = ATA_PROT_NODATA;
3648 tf->nsect = 0;
3649 tf->command = ATA_CMD_SET_FEATURES;
3650 tf->feature = wce ? SETFEATURES_WC_ON : SETFEATURES_WC_OFF;
3884 struct ata_taskfile *tf = &qc->tf;
3914 tf->protocol = dma ? ATA_PROT_DMA : ATA_PROT_PIO;
3915 tf->flags |= ATA_TFLAG_DEVICE | ATA_TFLAG_ISADDR | ATA_TFLAG_LBA;
3917 tf->flags |= ATA_TFLAG_WRITE;
3918 tf->command = ata_scsi_trusted_op(len, send, dma);
3919 tf->feature = secp;
3920 tf->lbam = spsp & 0xff;
3921 tf->lbah = spsp >> 8;
3924 tf->nsect = len & 0xff;
3925 tf->lbal = len >> 8;
3928 tf->lbah = (1 << 7);