Lines Matching refs:srb

3286 int sd_rw(struct scsi_cmnd *srb, struct rtsx_chip *chip, u32 start_sector,
3294 if (srb->sc_data_direction == DMA_FROM_DEVICE) {
3336 (sd_card->pre_dir != srb->sc_data_direction ||
3400 trans_dma_enable(srb->sc_data_direction, chip, sector_cnt * 512,
3403 if (srb->sc_data_direction == DMA_FROM_DEVICE) {
3416 if (srb->sc_data_direction == DMA_FROM_DEVICE) {
3436 trans_dma_enable(srb->sc_data_direction, chip,
3478 trans_dma_enable(srb->sc_data_direction, chip,
3492 retval = rtsx_transfer_data(chip, SD_CARD, scsi_sglist(srb),
3493 scsi_bufflen(srb), scsi_sg_count(srb),
3494 srb->sc_data_direction, chip->sd_timeout);
3540 sd_card->pre_dir = srb->sc_data_direction;
3741 int sd_pass_thru_mode(struct scsi_cmnd *srb, struct rtsx_chip *chip)
3744 unsigned int lun = SCSI_LUN(srb);
3775 if (srb->cmnd[2] != 0x53 || srb->cmnd[3] != 0x44 ||
3776 srb->cmnd[4] != 0x20 || srb->cmnd[5] != 0x43 ||
3777 srb->cmnd[6] != 0x61 || srb->cmnd[7] != 0x72 ||
3778 srb->cmnd[8] != 0x64) {
3783 switch (srb->cmnd[1] & 0x0F) {
3806 len = min_t(int, 18, scsi_bufflen(srb));
3807 rtsx_stor_set_xfer_buf(buf, len, srb);
3812 static inline int get_rsp_type(struct scsi_cmnd *srb, u8 *rsp_type,
3818 switch (srb->cmnd[10]) {
3851 int sd_execute_no_data(struct scsi_cmnd *srb, struct rtsx_chip *chip)
3854 unsigned int lun = SCSI_LUN(srb);
3875 cmd_idx = srb->cmnd[2] & 0x3F;
3876 if (srb->cmnd[1] & 0x02)
3879 if (srb->cmnd[1] & 0x01)
3882 arg = ((u32)srb->cmnd[3] << 24) | ((u32)srb->cmnd[4] << 16) |
3883 ((u32)srb->cmnd[5] << 8) | srb->cmnd[6];
3885 retval = get_rsp_type(srb, &rsp_type, &rsp_len);
3949 scsi_set_resid(srb, 0);
3963 int sd_execute_read_data(struct scsi_cmnd *srb, struct rtsx_chip *chip)
3966 unsigned int lun = SCSI_LUN(srb);
3988 cmd_idx = srb->cmnd[2] & 0x3F;
3989 if (srb->cmnd[1] & 0x04)
3992 if (srb->cmnd[1] & 0x02)
3995 if (srb->cmnd[1] & 0x01)
3998 data_len = ((u32)srb->cmnd[7] << 16) | ((u32)srb->cmnd[8]
3999 << 8) | srb->cmnd[9];
4001 retval = get_rsp_type(srb, &rsp_type, &rsp_len);
4057 byte_cnt = ((u16)(srb->cmnd[8] & 0x03) << 8) | srb->cmnd[9];
4061 cmd[1] = srb->cmnd[3];
4062 cmd[2] = srb->cmnd[4];
4063 cmd[3] = srb->cmnd[5];
4064 cmd[4] = srb->cmnd[6];
4079 min_len = min(data_len, scsi_bufflen(srb));
4080 rtsx_stor_set_xfer_buf(buf, min_len, srb);
4093 0xFF, (srb->cmnd[7] & 0xFE) >> 1);
4100 srb->cmnd[3]);
4102 srb->cmnd[4]);
4104 srb->cmnd[5]);
4106 srb->cmnd[6]);
4118 retval = rtsx_transfer_data(chip, SD_CARD, scsi_sglist(srb),
4119 scsi_bufflen(srb),
4120 scsi_sg_count(srb),
4166 if ((srb->cmnd[1] & 0x02) || (srb->cmnd[1] & 0x04))
4180 scsi_set_resid(srb, 0);
4197 int sd_execute_write_data(struct scsi_cmnd *srb, struct rtsx_chip *chip)
4200 unsigned int lun = SCSI_LUN(srb);
4227 cmd_idx = srb->cmnd[2] & 0x3F;
4228 if (srb->cmnd[1] & 0x04)
4231 if (srb->cmnd[1] & 0x02)
4234 if (srb->cmnd[1] & 0x01)
4237 data_len = ((u32)srb->cmnd[7] << 16) | ((u32)srb->cmnd[8]
4238 << 8) | srb->cmnd[9];
4239 arg = ((u32)srb->cmnd[3] << 24) | ((u32)srb->cmnd[4] << 16) |
4240 ((u32)srb->cmnd[5] << 8) | srb->cmnd[6];
4249 retval = get_rsp_type(srb, &rsp_type, &rsp_len);
4317 rtsx_stor_get_xfer_buf(buf, data_len, srb);
4364 srb->cmnd[8] & 0x03);
4366 srb->cmnd[9]);
4390 0xFF, (srb->cmnd[7] & 0xFE) >> 1);
4401 retval = rtsx_transfer_data(chip, SD_CARD, scsi_sglist(srb),
4402 scsi_bufflen(srb),
4403 scsi_sg_count(srb),
4420 scsi_set_resid(srb, 0);
4472 if ((srb->cmnd[1] & 0x02) || (srb->cmnd[1] & 0x04))
4520 scsi_set_resid(srb, 0);
4526 scsi_set_resid(srb, 0);
4543 int sd_get_cmd_rsp(struct scsi_cmnd *srb, struct rtsx_chip *chip)
4546 unsigned int lun = SCSI_LUN(srb);
4561 data_len = ((u16)srb->cmnd[7] << 8) | srb->cmnd[8];
4571 rtsx_stor_set_xfer_buf(sd_card->rsp, count, srb);
4578 scsi_set_resid(srb, 0);
4582 int sd_hw_rst(struct scsi_cmnd *srb, struct rtsx_chip *chip)
4585 unsigned int lun = SCSI_LUN(srb);
4599 if (srb->cmnd[2] != 0x53 || srb->cmnd[3] != 0x44 ||
4600 srb->cmnd[4] != 0x20 || srb->cmnd[5] != 0x43 ||
4601 srb->cmnd[6] != 0x61 || srb->cmnd[7] != 0x72 ||
4602 srb->cmnd[8] != 0x64) {
4607 switch (srb->cmnd[1] & 0x0F) {
4610 if (srb->cmnd[9] == 0x64)
4641 scsi_set_resid(srb, 0);