Lines Matching refs:tf

204 				    const struct ata_taskfile *tf)  in ata_scsi_set_sense_information()  argument
211 information = ata_tf_read_block(tf, dev); in ata_scsi_set_sense_information()
681 static void ata_dump_status(unsigned id, struct ata_taskfile *tf) in ata_dump_status() argument
683 u8 stat = tf->command, err = tf->feature; in ata_dump_status()
866 struct ata_taskfile *tf = &qc->result_tf; in ata_gen_passthru_sense() local
879 tf->command & (ATA_BUSY | ATA_DF | ATA_ERR | ATA_DRQ)) { in ata_gen_passthru_sense()
880 ata_to_sense_error(qc->ap->print_id, tf->command, tf->feature, in ata_gen_passthru_sense()
909 desc[3] = tf->feature; /* == error reg */ in ata_gen_passthru_sense()
910 desc[5] = tf->nsect; in ata_gen_passthru_sense()
911 desc[7] = tf->lbal; in ata_gen_passthru_sense()
912 desc[9] = tf->lbam; in ata_gen_passthru_sense()
913 desc[11] = tf->lbah; in ata_gen_passthru_sense()
914 desc[12] = tf->device; in ata_gen_passthru_sense()
915 desc[13] = tf->command; /* == status reg */ in ata_gen_passthru_sense()
921 if (tf->flags & ATA_TFLAG_LBA48) { in ata_gen_passthru_sense()
923 desc[4] = tf->hob_nsect; in ata_gen_passthru_sense()
924 desc[6] = tf->hob_lbal; in ata_gen_passthru_sense()
925 desc[8] = tf->hob_lbam; in ata_gen_passthru_sense()
926 desc[10] = tf->hob_lbah; in ata_gen_passthru_sense()
930 desc[0] = tf->feature; in ata_gen_passthru_sense()
931 desc[1] = tf->command; /* status */ in ata_gen_passthru_sense()
932 desc[2] = tf->device; in ata_gen_passthru_sense()
933 desc[3] = tf->nsect; in ata_gen_passthru_sense()
935 if (tf->flags & ATA_TFLAG_LBA48) { in ata_gen_passthru_sense()
937 if (tf->hob_nsect) in ata_gen_passthru_sense()
939 if (tf->hob_lbal || tf->hob_lbam || tf->hob_lbah) in ata_gen_passthru_sense()
942 desc[9] = tf->lbal; in ata_gen_passthru_sense()
943 desc[10] = tf->lbam; in ata_gen_passthru_sense()
944 desc[11] = tf->lbah; in ata_gen_passthru_sense()
962 struct ata_taskfile *tf = &qc->result_tf; in ata_gen_ata_sense() local
980 tf->command & (ATA_BUSY | ATA_DF | ATA_ERR | ATA_DRQ)) { in ata_gen_ata_sense()
981 ata_to_sense_error(qc->ap->print_id, tf->command, tf->feature, in ata_gen_ata_sense()
987 tf->command, qc->err_mask); in ata_gen_ata_sense()
1178 struct ata_taskfile *tf = &qc->tf; in ata_scsi_start_stop_xlat() local
1188 tf->flags |= ATA_TFLAG_DEVICE | ATA_TFLAG_ISADDR; in ata_scsi_start_stop_xlat()
1189 tf->protocol = ATA_PROT_NODATA; in ata_scsi_start_stop_xlat()
1205 tf->nsect = 1; /* 1 sector, lba=0 */ in ata_scsi_start_stop_xlat()
1208 tf->flags |= ATA_TFLAG_LBA; in ata_scsi_start_stop_xlat()
1210 tf->lbah = 0x0; in ata_scsi_start_stop_xlat()
1211 tf->lbam = 0x0; in ata_scsi_start_stop_xlat()
1212 tf->lbal = 0x0; in ata_scsi_start_stop_xlat()
1213 tf->device |= ATA_LBA; in ata_scsi_start_stop_xlat()
1216 tf->lbal = 0x1; /* sect */ in ata_scsi_start_stop_xlat()
1217 tf->lbam = 0x0; /* cyl low */ in ata_scsi_start_stop_xlat()
1218 tf->lbah = 0x0; /* cyl high */ in ata_scsi_start_stop_xlat()
1221 tf->command = ATA_CMD_VERIFY; /* READ VERIFY */ in ata_scsi_start_stop_xlat()
1235 tf->command = ATA_CMD_STANDBYNOW1; in ata_scsi_start_stop_xlat()
1271 struct ata_taskfile *tf = &qc->tf; in ata_scsi_flush_xlat() local
1273 tf->flags |= ATA_TFLAG_DEVICE; in ata_scsi_flush_xlat()
1274 tf->protocol = ATA_PROT_NODATA; in ata_scsi_flush_xlat()
1277 tf->command = ATA_CMD_FLUSH_EXT; in ata_scsi_flush_xlat()
1279 tf->command = ATA_CMD_FLUSH; in ata_scsi_flush_xlat()
1393 struct ata_taskfile *tf = &qc->tf; in ata_scsi_verify_xlat() local
1401 tf->flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE; in ata_scsi_verify_xlat()
1402 tf->protocol = ATA_PROT_NODATA; in ata_scsi_verify_xlat()
1429 tf->flags |= ATA_TFLAG_LBA; in ata_scsi_verify_xlat()
1433 tf->command = ATA_CMD_VERIFY; in ata_scsi_verify_xlat()
1434 tf->device |= (block >> 24) & 0xf; in ata_scsi_verify_xlat()
1440 tf->flags |= ATA_TFLAG_LBA48; in ata_scsi_verify_xlat()
1441 tf->command = ATA_CMD_VERIFY_EXT; in ata_scsi_verify_xlat()
1443 tf->hob_nsect = (n_block >> 8) & 0xff; in ata_scsi_verify_xlat()
1445 tf->hob_lbah = (block >> 40) & 0xff; in ata_scsi_verify_xlat()
1446 tf->hob_lbam = (block >> 32) & 0xff; in ata_scsi_verify_xlat()
1447 tf->hob_lbal = (block >> 24) & 0xff; in ata_scsi_verify_xlat()
1452 tf->nsect = n_block & 0xff; in ata_scsi_verify_xlat()
1454 tf->lbah = (block >> 16) & 0xff; in ata_scsi_verify_xlat()
1455 tf->lbam = (block >> 8) & 0xff; in ata_scsi_verify_xlat()
1456 tf->lbal = block & 0xff; in ata_scsi_verify_xlat()
1458 tf->device |= ATA_LBA; in ata_scsi_verify_xlat()
1482 tf->command = ATA_CMD_VERIFY; in ata_scsi_verify_xlat()
1483 tf->nsect = n_block & 0xff; /* Sector count 0 means 256 sectors */ in ata_scsi_verify_xlat()
1484 tf->lbal = sect; in ata_scsi_verify_xlat()
1485 tf->lbam = cyl; in ata_scsi_verify_xlat()
1486 tf->lbah = cyl >> 8; in ata_scsi_verify_xlat()
1487 tf->device |= head; in ata_scsi_verify_xlat()
1616 rc = ata_build_rw_tf(&qc->tf, qc->dev, block, n_block, tf_flags, in ata_scsi_rw_xlat()
2521 ap->ops->sff_tf_read(ap, &qc->tf); in atapi_request_sense()
2526 cmd->sense_buffer[2] = qc->tf.feature >> 4; in atapi_request_sense()
2539 qc->tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE; in atapi_request_sense()
2540 qc->tf.command = ATA_CMD_PACKET; in atapi_request_sense()
2543 qc->tf.protocol = ATAPI_PROT_DMA; in atapi_request_sense()
2544 qc->tf.feature |= ATAPI_PKT_DMA; in atapi_request_sense()
2546 qc->tf.protocol = ATAPI_PROT_PIO; in atapi_request_sense()
2547 qc->tf.lbam = SCSI_SENSE_BUFFERSIZE; in atapi_request_sense()
2548 qc->tf.lbah = 0; in atapi_request_sense()
2663 qc->tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE; in atapi_xlat()
2665 qc->tf.flags |= ATA_TFLAG_WRITE; in atapi_xlat()
2669 qc->tf.command = ATA_CMD_PACKET; in atapi_xlat()
2710 qc->tf.lbam = (nbytes & 0xFF); in atapi_xlat()
2711 qc->tf.lbah = (nbytes >> 8); in atapi_xlat()
2714 qc->tf.protocol = ATAPI_PROT_NODATA; in atapi_xlat()
2716 qc->tf.protocol = ATAPI_PROT_PIO; in atapi_xlat()
2719 qc->tf.protocol = ATAPI_PROT_DMA; in atapi_xlat()
2720 qc->tf.feature |= ATAPI_PKT_DMA; in atapi_xlat()
2725 qc->tf.feature |= ATAPI_DMADIR; in atapi_xlat()
2845 struct ata_taskfile *tf = &(qc->tf); in ata_scsi_pass_thru() local
2856 tf->protocol = ata_scsi_map_proto(cdb[1 + cdb_offset]); in ata_scsi_pass_thru()
2857 if (tf->protocol == ATA_PROT_UNKNOWN) { in ata_scsi_pass_thru()
2872 if (ata_is_ncq(tf->protocol)) in ata_scsi_pass_thru()
2873 tf->protocol = ATA_PROT_NCQ_NODATA; in ata_scsi_pass_thru()
2877 tf->flags |= ATA_TFLAG_LBA; in ata_scsi_pass_thru()
2890 tf->hob_feature = cdb[3]; in ata_scsi_pass_thru()
2891 tf->hob_nsect = cdb[5]; in ata_scsi_pass_thru()
2892 tf->hob_lbal = cdb[7]; in ata_scsi_pass_thru()
2893 tf->hob_lbam = cdb[9]; in ata_scsi_pass_thru()
2894 tf->hob_lbah = cdb[11]; in ata_scsi_pass_thru()
2895 tf->flags |= ATA_TFLAG_LBA48; in ata_scsi_pass_thru()
2897 tf->flags &= ~ATA_TFLAG_LBA48; in ata_scsi_pass_thru()
2902 tf->feature = cdb[4]; in ata_scsi_pass_thru()
2903 tf->nsect = cdb[6]; in ata_scsi_pass_thru()
2904 tf->lbal = cdb[8]; in ata_scsi_pass_thru()
2905 tf->lbam = cdb[10]; in ata_scsi_pass_thru()
2906 tf->lbah = cdb[12]; in ata_scsi_pass_thru()
2907 tf->device = cdb[13]; in ata_scsi_pass_thru()
2908 tf->command = cdb[14]; in ata_scsi_pass_thru()
2913 tf->flags &= ~ATA_TFLAG_LBA48; in ata_scsi_pass_thru()
2915 tf->feature = cdb[3]; in ata_scsi_pass_thru()
2916 tf->nsect = cdb[4]; in ata_scsi_pass_thru()
2917 tf->lbal = cdb[5]; in ata_scsi_pass_thru()
2918 tf->lbam = cdb[6]; in ata_scsi_pass_thru()
2919 tf->lbah = cdb[7]; in ata_scsi_pass_thru()
2920 tf->device = cdb[8]; in ata_scsi_pass_thru()
2921 tf->command = cdb[9]; in ata_scsi_pass_thru()
2929 tf->hob_feature = cdb[20]; in ata_scsi_pass_thru()
2930 tf->hob_nsect = cdb[22]; in ata_scsi_pass_thru()
2931 tf->hob_lbal = cdb[16]; in ata_scsi_pass_thru()
2932 tf->hob_lbam = cdb[15]; in ata_scsi_pass_thru()
2933 tf->hob_lbah = cdb[14]; in ata_scsi_pass_thru()
2934 tf->flags |= ATA_TFLAG_LBA48; in ata_scsi_pass_thru()
2936 tf->flags &= ~ATA_TFLAG_LBA48; in ata_scsi_pass_thru()
2938 tf->feature = cdb[21]; in ata_scsi_pass_thru()
2939 tf->nsect = cdb[23]; in ata_scsi_pass_thru()
2940 tf->lbal = cdb[19]; in ata_scsi_pass_thru()
2941 tf->lbam = cdb[18]; in ata_scsi_pass_thru()
2942 tf->lbah = cdb[17]; in ata_scsi_pass_thru()
2943 tf->device = cdb[24]; in ata_scsi_pass_thru()
2944 tf->command = cdb[25]; in ata_scsi_pass_thru()
2945 tf->auxiliary = get_unaligned_be32(&cdb[28]); in ata_scsi_pass_thru()
2949 if (ata_is_ncq(tf->protocol)) in ata_scsi_pass_thru()
2950 tf->nsect = qc->hw_tag << 3; in ata_scsi_pass_thru()
2953 tf->device = dev->devno ? in ata_scsi_pass_thru()
2954 tf->device | ATA_DEV1 : tf->device & ~ATA_DEV1; in ata_scsi_pass_thru()
2956 switch (tf->command) { in ata_scsi_pass_thru()
2962 if (tf->protocol != ATA_PROT_PIO || tf->nsect != 1) { in ata_scsi_pass_thru()
3013 tf->flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE; in ata_scsi_pass_thru()
3015 tf->flags |= ATA_TFLAG_WRITE; in ata_scsi_pass_thru()
3028 if (tf->protocol == ATA_PROT_DMA && !ata_dma_enabled(dev)) { in ata_scsi_pass_thru()
3034 if (ata_is_ncq(tf->protocol) && !ata_ncq_enabled(dev)) { in ata_scsi_pass_thru()
3040 if ((cdb[1] & 0xe0) && !is_multi_taskfile(tf)) { in ata_scsi_pass_thru()
3045 if (is_multi_taskfile(tf)) { in ata_scsi_pass_thru()
3063 if (tf->command == ATA_CMD_SET_FEATURES && in ata_scsi_pass_thru()
3064 tf->feature == SETFEATURES_XFER) { in ata_scsi_pass_thru()
3084 if (tf->command >= 0x5C && tf->command <= 0x5F && !libata_allow_tpm) { in ata_scsi_pass_thru()
3163 struct ata_taskfile *tf = &qc->tf; in ata_scsi_write_same_xlat() local
3227 tf->protocol = ATA_PROT_NCQ; in ata_scsi_write_same_xlat()
3228 tf->command = ATA_CMD_FPDMA_SEND; in ata_scsi_write_same_xlat()
3229 tf->hob_nsect = ATA_SUBCMD_FPDMA_SEND_DSM & 0x1f; in ata_scsi_write_same_xlat()
3230 tf->nsect = qc->hw_tag << 3; in ata_scsi_write_same_xlat()
3231 tf->hob_feature = (size / 512) >> 8; in ata_scsi_write_same_xlat()
3232 tf->feature = size / 512; in ata_scsi_write_same_xlat()
3234 tf->auxiliary = 1; in ata_scsi_write_same_xlat()
3236 tf->protocol = ATA_PROT_DMA; in ata_scsi_write_same_xlat()
3237 tf->hob_feature = 0; in ata_scsi_write_same_xlat()
3238 tf->feature = ATA_DSM_TRIM; in ata_scsi_write_same_xlat()
3239 tf->hob_nsect = (size / 512) >> 8; in ata_scsi_write_same_xlat()
3240 tf->nsect = size / 512; in ata_scsi_write_same_xlat()
3241 tf->command = ATA_CMD_DSM; in ata_scsi_write_same_xlat()
3244 tf->flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE | ATA_TFLAG_LBA48 | in ata_scsi_write_same_xlat()
3408 struct ata_taskfile *tf = &qc->tf; in ata_scsi_zbc_in_xlat() local
3447 tf->protocol = ATA_PROT_NCQ; in ata_scsi_zbc_in_xlat()
3448 tf->command = ATA_CMD_FPDMA_RECV; in ata_scsi_zbc_in_xlat()
3449 tf->hob_nsect = ATA_SUBCMD_FPDMA_RECV_ZAC_MGMT_IN & 0x1f; in ata_scsi_zbc_in_xlat()
3450 tf->nsect = qc->hw_tag << 3; in ata_scsi_zbc_in_xlat()
3451 tf->feature = sect & 0xff; in ata_scsi_zbc_in_xlat()
3452 tf->hob_feature = (sect >> 8) & 0xff; in ata_scsi_zbc_in_xlat()
3453 tf->auxiliary = ATA_SUBCMD_ZAC_MGMT_IN_REPORT_ZONES | (options << 8); in ata_scsi_zbc_in_xlat()
3455 tf->command = ATA_CMD_ZAC_MGMT_IN; in ata_scsi_zbc_in_xlat()
3456 tf->feature = ATA_SUBCMD_ZAC_MGMT_IN_REPORT_ZONES; in ata_scsi_zbc_in_xlat()
3457 tf->protocol = ATA_PROT_DMA; in ata_scsi_zbc_in_xlat()
3458 tf->hob_feature = options; in ata_scsi_zbc_in_xlat()
3459 tf->hob_nsect = (sect >> 8) & 0xff; in ata_scsi_zbc_in_xlat()
3460 tf->nsect = sect & 0xff; in ata_scsi_zbc_in_xlat()
3462 tf->device = ATA_LBA; in ata_scsi_zbc_in_xlat()
3463 tf->lbah = (block >> 16) & 0xff; in ata_scsi_zbc_in_xlat()
3464 tf->lbam = (block >> 8) & 0xff; in ata_scsi_zbc_in_xlat()
3465 tf->lbal = block & 0xff; in ata_scsi_zbc_in_xlat()
3466 tf->hob_lbah = (block >> 40) & 0xff; in ata_scsi_zbc_in_xlat()
3467 tf->hob_lbam = (block >> 32) & 0xff; in ata_scsi_zbc_in_xlat()
3468 tf->hob_lbal = (block >> 24) & 0xff; in ata_scsi_zbc_in_xlat()
3470 tf->flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE | ATA_TFLAG_LBA48; in ata_scsi_zbc_in_xlat()
3491 struct ata_taskfile *tf = &qc->tf; in ata_scsi_zbc_out_xlat() local
3536 tf->protocol = ATA_PROT_NCQ_NODATA; in ata_scsi_zbc_out_xlat()
3537 tf->command = ATA_CMD_NCQ_NON_DATA; in ata_scsi_zbc_out_xlat()
3538 tf->feature = ATA_SUBCMD_NCQ_NON_DATA_ZAC_MGMT_OUT; in ata_scsi_zbc_out_xlat()
3539 tf->nsect = qc->hw_tag << 3; in ata_scsi_zbc_out_xlat()
3540 tf->auxiliary = sa | ((u16)all << 8); in ata_scsi_zbc_out_xlat()
3542 tf->protocol = ATA_PROT_NODATA; in ata_scsi_zbc_out_xlat()
3543 tf->command = ATA_CMD_ZAC_MGMT_OUT; in ata_scsi_zbc_out_xlat()
3544 tf->feature = sa; in ata_scsi_zbc_out_xlat()
3545 tf->hob_feature = all; in ata_scsi_zbc_out_xlat()
3547 tf->lbah = (block >> 16) & 0xff; in ata_scsi_zbc_out_xlat()
3548 tf->lbam = (block >> 8) & 0xff; in ata_scsi_zbc_out_xlat()
3549 tf->lbal = block & 0xff; in ata_scsi_zbc_out_xlat()
3550 tf->hob_lbah = (block >> 40) & 0xff; in ata_scsi_zbc_out_xlat()
3551 tf->hob_lbam = (block >> 32) & 0xff; in ata_scsi_zbc_out_xlat()
3552 tf->hob_lbal = (block >> 24) & 0xff; in ata_scsi_zbc_out_xlat()
3553 tf->device = ATA_LBA; in ata_scsi_zbc_out_xlat()
3554 tf->flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE | ATA_TFLAG_LBA48; in ata_scsi_zbc_out_xlat()
3582 struct ata_taskfile *tf = &qc->tf; in ata_mselect_caching() local
3616 tf->flags |= ATA_TFLAG_DEVICE | ATA_TFLAG_ISADDR; in ata_mselect_caching()
3617 tf->protocol = ATA_PROT_NODATA; in ata_mselect_caching()
3618 tf->nsect = 0; in ata_mselect_caching()
3619 tf->command = ATA_CMD_SET_FEATURES; in ata_mselect_caching()
3620 tf->feature = wce ? SETFEATURES_WC_ON : SETFEATURES_WC_OFF; in ata_mselect_caching()
3854 struct ata_taskfile *tf = &qc->tf; in ata_scsi_security_inout_xlat() local
3884 tf->protocol = dma ? ATA_PROT_DMA : ATA_PROT_PIO; in ata_scsi_security_inout_xlat()
3885 tf->flags |= ATA_TFLAG_DEVICE | ATA_TFLAG_ISADDR | ATA_TFLAG_LBA; in ata_scsi_security_inout_xlat()
3887 tf->flags |= ATA_TFLAG_WRITE; in ata_scsi_security_inout_xlat()
3888 tf->command = ata_scsi_trusted_op(len, send, dma); in ata_scsi_security_inout_xlat()
3889 tf->feature = secp; in ata_scsi_security_inout_xlat()
3890 tf->lbam = spsp & 0xff; in ata_scsi_security_inout_xlat()
3891 tf->lbah = spsp >> 8; in ata_scsi_security_inout_xlat()
3894 tf->nsect = len & 0xff; in ata_scsi_security_inout_xlat()
3895 tf->lbal = len >> 8; in ata_scsi_security_inout_xlat()
3898 tf->lbah = (1 << 7); in ata_scsi_security_inout_xlat()