Lines Matching +full:low +full:- +full:pass

1 // SPDX-License-Identifier: GPL-2.0+
3 * Support for emulating SAT (ata pass through) on devices based
20 #define DRV_NAME "ums-cypress"
67 * ATACB is a protocol used on cypress usb<->ata bridge to
77 if (likely(srb->cmnd[0] != ATA_16 && srb->cmnd[0] != ATA_12)) { in cypress_atacb_passthrough()
82 memcpy(save_cmnd, srb->cmnd, sizeof(save_cmnd)); in cypress_atacb_passthrough()
83 memset(srb->cmnd, 0, MAX_COMMAND_SIZE); in cypress_atacb_passthrough()
99 srb->cmd_len = 16; in cypress_atacb_passthrough()
101 srb->cmnd[0] = 0x24; /* in cypress_atacb_passthrough()
102 * bVSCBSignature : vendor-specific command in cypress_atacb_passthrough()
106 srb->cmnd[1] = 0x24; /* bVSCBSubCommand : 0x24 for ATACB */ in cypress_atacb_passthrough()
108 srb->cmnd[3] = 0xff - 1; /* in cypress_atacb_passthrough()
109 * features, sector count, lba low, lba med in cypress_atacb_passthrough()
112 srb->cmnd[4] = 1; /* TransferBlockCount : 512 */ in cypress_atacb_passthrough()
115 srb->cmnd[ 6] = save_cmnd[ 4]; /* features */ in cypress_atacb_passthrough()
116 srb->cmnd[ 7] = save_cmnd[ 6]; /* sector count */ in cypress_atacb_passthrough()
117 srb->cmnd[ 8] = save_cmnd[ 8]; /* lba low */ in cypress_atacb_passthrough()
118 srb->cmnd[ 9] = save_cmnd[10]; /* lba med */ in cypress_atacb_passthrough()
119 srb->cmnd[10] = save_cmnd[12]; /* lba high */ in cypress_atacb_passthrough()
120 srb->cmnd[11] = save_cmnd[13]; /* device */ in cypress_atacb_passthrough()
121 srb->cmnd[12] = save_cmnd[14]; /* command */ in cypress_atacb_passthrough()
130 srb->cmnd[ 6] = save_cmnd[3]; /* features */ in cypress_atacb_passthrough()
131 srb->cmnd[ 7] = save_cmnd[4]; /* sector count */ in cypress_atacb_passthrough()
132 srb->cmnd[ 8] = save_cmnd[5]; /* lba low */ in cypress_atacb_passthrough()
133 srb->cmnd[ 9] = save_cmnd[6]; /* lba med */ in cypress_atacb_passthrough()
134 srb->cmnd[10] = save_cmnd[7]; /* lba high */ in cypress_atacb_passthrough()
135 srb->cmnd[11] = save_cmnd[8]; /* device */ in cypress_atacb_passthrough()
136 srb->cmnd[12] = save_cmnd[9]; /* command */ in cypress_atacb_passthrough()
139 /* Filter SET_FEATURES - XFER MODE command */ in cypress_atacb_passthrough()
140 if ((srb->cmnd[12] == ATA_CMD_SET_FEATURES) in cypress_atacb_passthrough()
141 && (srb->cmnd[6] == SETFEATURES_XFER)) in cypress_atacb_passthrough()
144 if (srb->cmnd[12] == ATA_CMD_ID_ATA || srb->cmnd[12] == ATA_CMD_ID_ATAPI) in cypress_atacb_passthrough()
145 srb->cmnd[2] |= (1<<7); /* set IdentifyPacketDevice for these cmds */ in cypress_atacb_passthrough()
151 if (srb->result == SAM_STAT_CHECK_CONDITION && in cypress_atacb_passthrough()
152 memcmp(srb->sense_buffer, usb_stor_sense_invalidCDB, in cypress_atacb_passthrough()
162 if ((srb->result != (DID_ERROR << 16) && in cypress_atacb_passthrough()
163 srb->result != (DID_ABORT << 16)) && in cypress_atacb_passthrough()
167 unsigned char *sb = srb->sense_buffer; in cypress_atacb_passthrough()
177 * but reading register selected in srb->cmnd[4] in cypress_atacb_passthrough()
179 srb->cmd_len = 16; in cypress_atacb_passthrough()
180 srb->cmnd[2] = 1; in cypress_atacb_passthrough()
183 memcpy(regs, srb->sense_buffer, sizeof(regs)); in cypress_atacb_passthrough()
184 tmp_result = srb->result; in cypress_atacb_passthrough()
195 sb[2] = 0; /* ATA PASS THROUGH INFORMATION AVAILABLE */ in cypress_atacb_passthrough()
217 desc[ 7] = regs[3]; /* lba low */ in cypress_atacb_passthrough()
223 srb->result = SAM_STAT_CHECK_CONDITION; in cypress_atacb_passthrough()
227 srb->result = SAM_STAT_CHECK_CONDITION; in cypress_atacb_passthrough()
229 memcpy(srb->sense_buffer, in cypress_atacb_passthrough()
233 memcpy(srb->cmnd, save_cmnd, sizeof(save_cmnd)); in cypress_atacb_passthrough()
234 if (srb->cmnd[0] == ATA_12) in cypress_atacb_passthrough()
235 srb->cmd_len = 12; in cypress_atacb_passthrough()
248 (id - cypress_usb_ids) + cypress_unusual_dev_list, in cypress_probe()
258 if (device->descriptor.iManufacturer != 0x38 || in cypress_probe()
259 device->descriptor.iProduct != 0x4e || in cypress_probe()
260 device->descriptor.iSerialNumber != 0x64) { in cypress_probe()
261 us->protocol_name = "Transparent SCSI with Cypress ATACB"; in cypress_probe()
262 us->proto_handler = cypress_atacb_passthrough; in cypress_probe()
264 us->protocol_name = "Transparent SCSI"; in cypress_probe()
265 us->proto_handler = usb_stor_transparent_scsi_command; in cypress_probe()