Lines Matching refs:scsicmd

52 typedef unsigned int (*ata_xlat_func_t)(struct ata_queued_cmd *qc, const u8 *scsicmd);
354 qc->scsicmd = cmd; in ata_scsi_qc_new()
546 struct scsi_cmnd *cmd = qc->scsicmd; in ata_gen_ata_desc_sense()
622 struct scsi_cmnd *cmd = qc->scsicmd; in ata_gen_fixed_sense()
719 const u8 *scsicmd) in ata_scsi_start_stop_xlat() argument
725 if (scsicmd[1] & 0x1) { in ata_scsi_start_stop_xlat()
728 if (scsicmd[4] & 0x2) in ata_scsi_start_stop_xlat()
730 if (((scsicmd[4] >> 4) & 0xf) != 0) in ata_scsi_start_stop_xlat()
732 if (scsicmd[4] & 0x1) { in ata_scsi_start_stop_xlat()
765 ata_scsi_set_sense(qc->scsicmd, ILLEGAL_REQUEST, 0x24, 0x0); in ata_scsi_start_stop_xlat()
786 static unsigned int ata_scsi_flush_xlat(struct ata_queued_cmd *qc, const u8 *scsicmd) in ata_scsi_flush_xlat() argument
813 static void scsi_6_lba_len(const u8 *scsicmd, u64 *plba, u32 *plen) in scsi_6_lba_len() argument
820 lba |= ((u64)scsicmd[2]) << 8; in scsi_6_lba_len()
821 lba |= ((u64)scsicmd[3]); in scsi_6_lba_len()
823 len |= ((u32)scsicmd[4]); in scsi_6_lba_len()
840 static void scsi_10_lba_len(const u8 *scsicmd, u64 *plba, u32 *plen) in scsi_10_lba_len() argument
847 lba |= ((u64)scsicmd[2]) << 24; in scsi_10_lba_len()
848 lba |= ((u64)scsicmd[3]) << 16; in scsi_10_lba_len()
849 lba |= ((u64)scsicmd[4]) << 8; in scsi_10_lba_len()
850 lba |= ((u64)scsicmd[5]); in scsi_10_lba_len()
852 len |= ((u32)scsicmd[7]) << 8; in scsi_10_lba_len()
853 len |= ((u32)scsicmd[8]); in scsi_10_lba_len()
870 static void scsi_16_lba_len(const u8 *scsicmd, u64 *plba, u32 *plen) in scsi_16_lba_len() argument
877 lba |= ((u64)scsicmd[2]) << 56; in scsi_16_lba_len()
878 lba |= ((u64)scsicmd[3]) << 48; in scsi_16_lba_len()
879 lba |= ((u64)scsicmd[4]) << 40; in scsi_16_lba_len()
880 lba |= ((u64)scsicmd[5]) << 32; in scsi_16_lba_len()
881 lba |= ((u64)scsicmd[6]) << 24; in scsi_16_lba_len()
882 lba |= ((u64)scsicmd[7]) << 16; in scsi_16_lba_len()
883 lba |= ((u64)scsicmd[8]) << 8; in scsi_16_lba_len()
884 lba |= ((u64)scsicmd[9]); in scsi_16_lba_len()
886 len |= ((u32)scsicmd[10]) << 24; in scsi_16_lba_len()
887 len |= ((u32)scsicmd[11]) << 16; in scsi_16_lba_len()
888 len |= ((u32)scsicmd[12]) << 8; in scsi_16_lba_len()
889 len |= ((u32)scsicmd[13]); in scsi_16_lba_len()
909 static unsigned int ata_scsi_verify_xlat(struct ata_queued_cmd *qc, const u8 *scsicmd) in ata_scsi_verify_xlat() argument
920 if (scsicmd[0] == VERIFY) in ata_scsi_verify_xlat()
921 scsi_10_lba_len(scsicmd, &block, &n_block); in ata_scsi_verify_xlat()
922 else if (scsicmd[0] == VERIFY_16) in ata_scsi_verify_xlat()
923 scsi_16_lba_len(scsicmd, &block, &n_block); in ata_scsi_verify_xlat()
1001 ata_scsi_set_sense(qc->scsicmd, ILLEGAL_REQUEST, 0x24, 0x0); in ata_scsi_verify_xlat()
1006 ata_scsi_set_sense(qc->scsicmd, ILLEGAL_REQUEST, 0x21, 0x0); in ata_scsi_verify_xlat()
1011 qc->scsicmd->result = SAM_STAT_GOOD; in ata_scsi_verify_xlat()
1035 static unsigned int ata_scsi_rw_xlat(struct ata_queued_cmd *qc, const u8 *scsicmd) in ata_scsi_rw_xlat() argument
1044 if (scsicmd[0] == WRITE_10 || scsicmd[0] == WRITE_6 || in ata_scsi_rw_xlat()
1045 scsicmd[0] == WRITE_16) in ata_scsi_rw_xlat()
1049 switch (scsicmd[0]) { in ata_scsi_rw_xlat()
1052 scsi_10_lba_len(scsicmd, &block, &n_block); in ata_scsi_rw_xlat()
1056 scsi_6_lba_len(scsicmd, &block, &n_block); in ata_scsi_rw_xlat()
1066 scsi_16_lba_len(scsicmd, &block, &n_block); in ata_scsi_rw_xlat()
1157 ata_scsi_set_sense(qc->scsicmd, ILLEGAL_REQUEST, 0x24, 0x0); in ata_scsi_rw_xlat()
1162 ata_scsi_set_sense(qc->scsicmd, ILLEGAL_REQUEST, 0x21, 0x0); in ata_scsi_rw_xlat()
1167 qc->scsicmd->result = SAM_STAT_GOOD; in ata_scsi_rw_xlat()
1174 struct scsi_cmnd *cmd = qc->scsicmd; in ata_scsi_qc_complete()
1243 u8 *scsicmd = cmd->cmnd; in ata_scsi_translate() local
1271 if (xlat_func(qc, scsicmd)) in ata_scsi_translate()
1664 u8 *scsicmd = args->cmd->cmnd, *p, *last; in ata_scsiop_mode_sense() local
1675 six_byte = (scsicmd[0] == MODE_SENSE); in ata_scsiop_mode_sense()
1676 ebd = !(scsicmd[1] & 0x8); /* dbd bit inverted == edb */ in ata_scsiop_mode_sense()
1681 page_control = scsicmd[2] >> 6; in ata_scsiop_mode_sense()
1695 alloc_len = scsicmd[4]; in ata_scsiop_mode_sense()
1698 alloc_len = (scsicmd[7] << 8) + scsicmd[8]; in ata_scsiop_mode_sense()
1705 pg = scsicmd[2] & 0x3f; in ata_scsiop_mode_sense()
1706 spg = scsicmd[3]; in ata_scsiop_mode_sense()
1933 qc->scsidone(qc->scsicmd); in atapi_sense_complete()
1946 struct scsi_cmnd *cmd = qc->scsicmd; in atapi_request_sense()
1991 struct scsi_cmnd *cmd = qc->scsicmd; in atapi_qc_complete()
2010 u8 *scsicmd = cmd->cmnd; in atapi_qc_complete() local
2012 if (scsicmd[0] == INQUIRY) { in atapi_qc_complete()
2055 static unsigned int atapi_xlat(struct ata_queued_cmd *qc, const u8 *scsicmd) in atapi_xlat() argument
2057 struct scsi_cmnd *cmd = qc->scsicmd; in atapi_xlat()
2067 memcpy(&qc->cdb, scsicmd, qc->ap->cdb_len); in atapi_xlat()
2201 ata_scsi_pass_thru(struct ata_queued_cmd *qc, const u8 *scsicmd) in ata_scsi_pass_thru() argument
2204 struct scsi_cmnd *cmd = qc->scsicmd; in ata_scsi_pass_thru()
2206 if ((tf->protocol = ata_scsi_map_proto(scsicmd[1])) == ATA_PROT_UNKNOWN) in ata_scsi_pass_thru()
2213 if (scsicmd[0] == ATA_16) { in ata_scsi_pass_thru()
2219 if (scsicmd[1] & 0x01) { in ata_scsi_pass_thru()
2220 tf->hob_feature = scsicmd[3]; in ata_scsi_pass_thru()
2221 tf->hob_nsect = scsicmd[5]; in ata_scsi_pass_thru()
2222 tf->hob_lbal = scsicmd[7]; in ata_scsi_pass_thru()
2223 tf->hob_lbam = scsicmd[9]; in ata_scsi_pass_thru()
2224 tf->hob_lbah = scsicmd[11]; in ata_scsi_pass_thru()
2232 tf->feature = scsicmd[4]; in ata_scsi_pass_thru()
2233 tf->nsect = scsicmd[6]; in ata_scsi_pass_thru()
2234 tf->lbal = scsicmd[8]; in ata_scsi_pass_thru()
2235 tf->lbam = scsicmd[10]; in ata_scsi_pass_thru()
2236 tf->lbah = scsicmd[12]; in ata_scsi_pass_thru()
2237 tf->device = scsicmd[13]; in ata_scsi_pass_thru()
2238 tf->command = scsicmd[14]; in ata_scsi_pass_thru()
2245 tf->feature = scsicmd[3]; in ata_scsi_pass_thru()
2246 tf->nsect = scsicmd[4]; in ata_scsi_pass_thru()
2247 tf->lbal = scsicmd[5]; in ata_scsi_pass_thru()
2248 tf->lbam = scsicmd[6]; in ata_scsi_pass_thru()
2249 tf->lbah = scsicmd[7]; in ata_scsi_pass_thru()
2250 tf->device = scsicmd[8]; in ata_scsi_pass_thru()
2251 tf->command = scsicmd[9]; in ata_scsi_pass_thru()
2349 u8 *scsicmd = cmd->cmnd; in ata_scsi_dump_cdb() local
2354 scsicmd[0], scsicmd[1], scsicmd[2], scsicmd[3], in ata_scsi_dump_cdb()
2355 scsicmd[4], scsicmd[5], scsicmd[6], scsicmd[7], in ata_scsi_dump_cdb()
2356 scsicmd[8]); in ata_scsi_dump_cdb()
2434 const u8 *scsicmd = cmd->cmnd; in ata_scsi_simulate() local
2440 switch(scsicmd[0]) { in ata_scsi_simulate()
2453 if (scsicmd[1] & 2) /* is CmdDt set? */ in ata_scsi_simulate()
2455 else if ((scsicmd[1] & 1) == 0) /* is EVPD clear? */ in ata_scsi_simulate()
2457 else if (scsicmd[2] == 0x00) in ata_scsi_simulate()
2459 else if (scsicmd[2] == 0x80) in ata_scsi_simulate()
2461 else if (scsicmd[2] == 0x83) in ata_scsi_simulate()
2482 if ((scsicmd[1] & 0x1f) == SAI_READ_CAPACITY_16) in ata_scsi_simulate()