Lines Matching refs:srb

149 static int usbat_flash_transport(struct scsi_cmnd * srb, struct us_data *us);
150 static int usbat_hp8200e_transport(struct scsi_cmnd *srb, struct us_data *us);
1180 usb_stor_access_xfer_buf(buffer, len, us->srb, in usbat_flash_read_data()
1256 usb_stor_access_xfer_buf(buffer, len, us->srb, in usbat_flash_write_data()
1291 struct scsi_cmnd *srb) in usbat_hp8200e_handle_read10() argument
1300 usb_stor_dbg(us, "transfersize %d\n", srb->transfersize); in usbat_hp8200e_handle_read10()
1302 if (scsi_bufflen(srb) < 0x10000) { in usbat_hp8200e_handle_read10()
1309 scsi_sglist(srb), in usbat_hp8200e_handle_read10()
1310 scsi_bufflen(srb), scsi_sg_count(srb), 1); in usbat_hp8200e_handle_read10()
1328 srb->transfersize = scsi_bufflen(srb)/len; in usbat_hp8200e_handle_read10()
1331 if (!srb->transfersize) { in usbat_hp8200e_handle_read10()
1332 srb->transfersize = 2048; /* A guess */ in usbat_hp8200e_handle_read10()
1334 srb->transfersize); in usbat_hp8200e_handle_read10()
1343 len = (65535/srb->transfersize) * srb->transfersize; in usbat_hp8200e_handle_read10()
1345 len = min(len, scsi_bufflen(srb)); in usbat_hp8200e_handle_read10()
1354 while (transferred != scsi_bufflen(srb)) { in usbat_hp8200e_handle_read10()
1356 if (len > scsi_bufflen(srb) - transferred) in usbat_hp8200e_handle_read10()
1357 len = scsi_bufflen(srb) - transferred; in usbat_hp8200e_handle_read10()
1370 data[7+7] = MSB_of(len / srb->transfersize); /* SCSI command */ in usbat_hp8200e_handle_read10()
1371 data[7+8] = LSB_of(len / srb->transfersize); /* num sectors */ in usbat_hp8200e_handle_read10()
1385 usb_stor_access_xfer_buf(buffer, len, srb, in usbat_hp8200e_handle_read10()
1391 sector += len / srb->transfersize; in usbat_hp8200e_handle_read10()
1552 static int usbat_hp8200e_transport(struct scsi_cmnd *srb, struct us_data *us) in usbat_hp8200e_transport() argument
1561 len = scsi_bufflen(srb); in usbat_hp8200e_transport()
1586 data[i] = (i-7 >= srb->cmd_len) ? 0 : srb->cmnd[i-7]; in usbat_hp8200e_transport()
1593 if (srb->cmnd[0] == TEST_UNIT_READY) in usbat_hp8200e_transport()
1596 if (srb->sc_data_direction == DMA_TO_DEVICE) { in usbat_hp8200e_transport()
1603 scsi_sglist(srb), in usbat_hp8200e_transport()
1604 len, scsi_sg_count(srb), 10); in usbat_hp8200e_transport()
1613 } else if (srb->cmnd[0] == READ_10 || in usbat_hp8200e_transport()
1614 srb->cmnd[0] == GPCMD_READ_CD) { in usbat_hp8200e_transport()
1616 return usbat_hp8200e_handle_read10(us, registers, data, srb); in usbat_hp8200e_transport()
1641 result = usbat_write_block(us, USBAT_ATA, srb->cmnd, 12, in usbat_hp8200e_transport()
1642 srb->cmnd[0] == GPCMD_BLANK ? 75 : 10, 0); in usbat_hp8200e_transport()
1649 if (len != 0 && (srb->sc_data_direction == DMA_FROM_DEVICE)) { in usbat_hp8200e_transport()
1670 result = usbat_read_block(us, scsi_sglist(srb), len, in usbat_hp8200e_transport()
1671 scsi_sg_count(srb)); in usbat_hp8200e_transport()
1680 static int usbat_flash_transport(struct scsi_cmnd * srb, struct us_data *us) in usbat_flash_transport() argument
1690 if (srb->cmnd[0] == INQUIRY) { in usbat_flash_transport()
1697 if (srb->cmnd[0] == READ_CAPACITY) { in usbat_flash_transport()
1718 usb_stor_set_xfer_buf(ptr, 8, srb); in usbat_flash_transport()
1723 if (srb->cmnd[0] == MODE_SELECT_10) { in usbat_flash_transport()
1728 if (srb->cmnd[0] == READ_10) { in usbat_flash_transport()
1729 block = ((u32)(srb->cmnd[2]) << 24) | ((u32)(srb->cmnd[3]) << 16) | in usbat_flash_transport()
1730 ((u32)(srb->cmnd[4]) << 8) | ((u32)(srb->cmnd[5])); in usbat_flash_transport()
1732 blocks = ((u32)(srb->cmnd[7]) << 8) | ((u32)(srb->cmnd[8])); in usbat_flash_transport()
1739 if (srb->cmnd[0] == READ_12) { in usbat_flash_transport()
1743 block = ((u32)(srb->cmnd[2]) << 24) | ((u32)(srb->cmnd[3]) << 16) | in usbat_flash_transport()
1744 ((u32)(srb->cmnd[4]) << 8) | ((u32)(srb->cmnd[5])); in usbat_flash_transport()
1746 blocks = ((u32)(srb->cmnd[6]) << 24) | ((u32)(srb->cmnd[7]) << 16) | in usbat_flash_transport()
1747 ((u32)(srb->cmnd[8]) << 8) | ((u32)(srb->cmnd[9])); in usbat_flash_transport()
1754 if (srb->cmnd[0] == WRITE_10) { in usbat_flash_transport()
1755 block = ((u32)(srb->cmnd[2]) << 24) | ((u32)(srb->cmnd[3]) << 16) | in usbat_flash_transport()
1756 ((u32)(srb->cmnd[4]) << 8) | ((u32)(srb->cmnd[5])); in usbat_flash_transport()
1758 blocks = ((u32)(srb->cmnd[7]) << 8) | ((u32)(srb->cmnd[8])); in usbat_flash_transport()
1765 if (srb->cmnd[0] == WRITE_12) { in usbat_flash_transport()
1769 block = ((u32)(srb->cmnd[2]) << 24) | ((u32)(srb->cmnd[3]) << 16) | in usbat_flash_transport()
1770 ((u32)(srb->cmnd[4]) << 8) | ((u32)(srb->cmnd[5])); in usbat_flash_transport()
1772 blocks = ((u32)(srb->cmnd[6]) << 24) | ((u32)(srb->cmnd[7]) << 16) | in usbat_flash_transport()
1773 ((u32)(srb->cmnd[8]) << 8) | ((u32)(srb->cmnd[9])); in usbat_flash_transport()
1781 if (srb->cmnd[0] == TEST_UNIT_READY) { in usbat_flash_transport()
1791 if (srb->cmnd[0] == REQUEST_SENSE) { in usbat_flash_transport()
1800 usb_stor_set_xfer_buf(ptr, 18, srb); in usbat_flash_transport()
1805 if (srb->cmnd[0] == ALLOW_MEDIUM_REMOVAL) { in usbat_flash_transport()
1814 srb->cmnd[0], srb->cmnd[0]); in usbat_flash_transport()