Ejemplo n.º 1
0
void usb_stor_transparent_scsi_command(struct scsi_cmnd *srb,
				       struct us_data *us)
{
	/* send the command to the transport layer */
	usb_stor_invoke_transport(srb, us);

	if (srb->result == SAM_STAT_GOOD) {
		/* Fix the READ CAPACITY result if necessary */
		if (us->flags & US_FL_FIX_CAPACITY)
			fix_read_capacity(srb);
	}
}
Ejemplo n.º 2
0
void usb_stor_qic157_command(struct scsi_cmnd *srb, struct us_data *us)
{
	/*
	 * Pad the SCSI command with zeros out to 12 bytes.  If the
	 * command already is 12 bytes or longer, leave it alone.
	 *
	 * NOTE: This only works because a scsi_cmnd struct field contains
	 * a unsigned char cmnd[16], so we know we have storage available
	 */
	for (; srb->cmd_len<12; srb->cmd_len++)
		srb->cmnd[srb->cmd_len] = 0;

	/* send the command to the transport layer */
	usb_stor_invoke_transport(srb, us);
}
Ejemplo n.º 3
0
void usb_stor_qic157_command(struct scsi_cmnd *srb, struct us_data *us)
{
    /* Pad the ATAPI command with zeros
     *
     * NOTE: This only works because a scsi_cmnd struct field contains
     * a unsigned char cmnd[16], so we know we have storage available
     */
    for (; srb->cmd_len<12; srb->cmd_len++)
        srb->cmnd[srb->cmd_len] = 0;

    /* set command length to 12 bytes */
    srb->cmd_len = 12;

    /* send the command to the transport layer */
    usb_stor_invoke_transport(srb, us);
}
Ejemplo n.º 4
0
void usb_stor_ufi_command(Scsi_Cmnd *srb, struct us_data *us)
{
	/* fix some commands -- this is a form of mode translation
	 * UFI devices only accept 12 byte long commands 
	 *
	 * NOTE: This only works because a Scsi_Cmnd struct field contains
	 * a unsigned char cmnd[16], so we know we have storage available
	 */

	/* Pad the ATAPI command with zeros */
	for (; srb->cmd_len<12; srb->cmd_len++)
		srb->cmnd[srb->cmd_len] = 0;

	/* set command length to 12 bytes (this affects the transport layer) */
	srb->cmd_len = 12;

	/* XXX We should be constantly re-evaluating the need for these */

	/* determine the correct data length for these commands */
	switch (srb->cmnd[0]) {

		/* for INQUIRY, UFI devices only ever return 36 bytes */
	case INQUIRY:
		srb->cmnd[4] = 36;
		break;

		/* again, for MODE_SENSE_10, we get the minimum (8) */
	case MODE_SENSE_10:
		srb->cmnd[7] = 0;
		srb->cmnd[8] = 8;
		break;

		/* for REQUEST_SENSE, UFI devices only ever return 18 bytes */
	case REQUEST_SENSE:
		srb->cmnd[4] = 18;
		break;
	} /* end switch on cmnd[0] */

	/* send the command to the transport layer */
	usb_stor_invoke_transport(srb, us);

	if (srb->result == SAM_STAT_GOOD) {
		/* Fix the data for an INQUIRY, if necessary */
		fix_inquiry_data(srb);
	}
}
Ejemplo n.º 5
0
void usb_stor_qic157_command(Scsi_Cmnd *srb, struct us_data *us)
{
	/* Pad the ATAPI command with zeros 
	 *
	 * NOTE: This only works because a Scsi_Cmnd struct field contains
	 * a unsigned char cmnd[16], so we know we have storage available
	 */
	for (; srb->cmd_len<12; srb->cmd_len++)
		srb->cmnd[srb->cmd_len] = 0;

	/* set command length to 12 bytes */
	srb->cmd_len = 12;

	/* send the command to the transport layer */
	usb_stor_invoke_transport(srb, us);
	if (srb->result == SAM_STAT_GOOD) {
		/* fix the INQUIRY data if necessary */
		fix_inquiry_data(srb);
	}
}
Ejemplo n.º 6
0
void usb_stor_transparent_scsi_command(struct scsi_cmnd *srb,
                                       struct us_data *us)
{
    /* send the command to the transport layer */
    usb_stor_invoke_transport(srb, us);
}