version 1.83, 1997/10/16 03:16:44 |
version 1.84, 1997/10/18 19:51:14 |
|
|
/* |
/* |
* go ask the adapter to do all this for us |
* go ask the adapter to do all this for us |
*/ |
*/ |
if ((*sc_link->scsipi_cmd)(sc_link, |
if (scsipi_command(sc_link, |
(struct scsipi_generic *)&cmd, sizeof(cmd), |
(struct scsipi_generic *)&cmd, sizeof(cmd), |
(u_char *)bp->b_data, bp->b_bcount, |
(u_char *)bp->b_data, bp->b_bcount, |
0, 100000, bp, flags | SCSI_NOSLEEP)) |
0, 100000, bp, flags | SCSI_NOSLEEP)) |
Line 1349 st_read(st, buf, size, flags) |
|
Line 1349 st_read(st, buf, size, flags) |
|
cmd.len); |
cmd.len); |
} else |
} else |
_lto3b(size, cmd.len); |
_lto3b(size, cmd.len); |
return ((*st->sc_link->scsipi_cmd)(st->sc_link, |
return (scsipi_command(st->sc_link, |
(struct scsipi_generic *)&cmd, sizeof(cmd), |
(struct scsipi_generic *)&cmd, sizeof(cmd), |
(u_char *)buf, size, 0, 100000, NULL, flags | SCSI_DATA_IN)); |
(u_char *)buf, size, 0, 100000, NULL, flags | SCSI_DATA_IN)); |
} |
} |
Line 1382 st_read_block_limits(st, flags) |
|
Line 1382 st_read_block_limits(st, flags) |
|
/* |
/* |
* do the command, update the global values |
* do the command, update the global values |
*/ |
*/ |
error = (*sc_link->scsipi_cmd)(sc_link, (struct scsipi_generic *)&cmd, |
error = scsipi_command(sc_link, (struct scsipi_generic *)&cmd, |
sizeof(cmd), (u_char *)&block_limits, sizeof(block_limits), |
sizeof(cmd), (u_char *)&block_limits, sizeof(block_limits), |
ST_RETRIES, 5000, NULL, flags | SCSI_DATA_IN); |
ST_RETRIES, 5000, NULL, flags | SCSI_DATA_IN); |
if (error) |
if (error) |
Line 1436 st_mode_sense(st, flags) |
|
Line 1436 st_mode_sense(st, flags) |
|
* or if we need it as a template for the mode select |
* or if we need it as a template for the mode select |
* store it away. |
* store it away. |
*/ |
*/ |
error = (*sc_link->scsipi_cmd)(sc_link, (struct scsipi_generic *)&cmd, |
error = scsipi_command(sc_link, (struct scsipi_generic *)&cmd, |
sizeof(cmd), (u_char *)&scsipi_sense, scsipi_sense_len, |
sizeof(cmd), (u_char *)&scsipi_sense, scsipi_sense_len, |
ST_RETRIES, 5000, NULL, flags | SCSI_DATA_IN); |
ST_RETRIES, 5000, NULL, flags | SCSI_DATA_IN); |
if (error) |
if (error) |
Line 1516 st_mode_select(st, flags) |
|
Line 1516 st_mode_select(st, flags) |
|
/* |
/* |
* do the command |
* do the command |
*/ |
*/ |
return ((*sc_link->scsipi_cmd)(sc_link, (struct scsipi_generic *)&cmd, |
return (scsipi_command(sc_link, (struct scsipi_generic *)&cmd, |
sizeof(cmd), (u_char *)&scsi_select, scsi_select_len, |
sizeof(cmd), (u_char *)&scsi_select, scsi_select_len, |
ST_RETRIES, 5000, NULL, flags | SCSI_DATA_OUT)); |
ST_RETRIES, 5000, NULL, flags | SCSI_DATA_OUT)); |
} |
} |
Line 1558 st_cmprss(st, onoff) |
|
Line 1558 st_cmprss(st, onoff) |
|
* Do the MODE SENSE command... |
* Do the MODE SENSE command... |
*/ |
*/ |
again: |
again: |
error = (*sc_link->scsipi_cmd)(sc_link, |
error = scsipi_command(sc_link, |
(struct scsipi_generic *)&scmd, sizeof(scmd), |
(struct scsipi_generic *)&scmd, sizeof(scmd), |
(u_char *)&scsi_pdata, scsi_dlen, |
(u_char *)&scsi_pdata, scsi_dlen, |
ST_RETRIES, 5000, NULL, flags | SCSI_DATA_IN); |
ST_RETRIES, 5000, NULL, flags | SCSI_DATA_IN); |
|
|
/* |
/* |
* Do the command |
* Do the command |
*/ |
*/ |
error = (*sc_link->scsipi_cmd)(sc_link, |
error = scsipi_command(sc_link, |
(struct scsipi_generic *)&mcmd, sizeof(mcmd), |
(struct scsipi_generic *)&mcmd, sizeof(mcmd), |
(u_char *)&scsi_pdata, scsi_dlen, |
(u_char *)&scsi_pdata, scsi_dlen, |
ST_RETRIES, 5000, NULL, flags | SCSI_DATA_OUT); |
ST_RETRIES, 5000, NULL, flags | SCSI_DATA_OUT); |
Line 1665 st_erase(st, full, flags) |
|
Line 1665 st_erase(st, full, flags) |
|
* XXX We always do this asynchronously, for now. How long should |
* XXX We always do this asynchronously, for now. How long should |
* we wait if we want to (eventually) to it synchronously? |
* we wait if we want to (eventually) to it synchronously? |
*/ |
*/ |
return ((*st->sc_link->scsipi_cmd)(st->sc_link, |
return (scsipi_command(st->sc_link, |
(struct scsipi_generic *)&cmd, sizeof(cmd), |
(struct scsipi_generic *)&cmd, sizeof(cmd), |
0, 0, ST_RETRIES, 5000, NULL, flags)); |
0, 0, ST_RETRIES, 5000, NULL, flags)); |
} |
} |
Line 1748 st_space(st, number, what, flags) |
|
Line 1748 st_space(st, number, what, flags) |
|
cmd.byte2 = what; |
cmd.byte2 = what; |
_lto3b(number, cmd.number); |
_lto3b(number, cmd.number); |
|
|
return ((*st->sc_link->scsipi_cmd)(st->sc_link, |
return (scsipi_command(st->sc_link, |
(struct scsipi_generic *)&cmd, sizeof(cmd), |
(struct scsipi_generic *)&cmd, sizeof(cmd), |
0, 0, 0, 900000, NULL, flags)); |
0, 0, 0, 900000, NULL, flags)); |
} |
} |
Line 1788 st_write_filemarks(st, number, flags) |
|
Line 1788 st_write_filemarks(st, number, flags) |
|
cmd.opcode = WRITE_FILEMARKS; |
cmd.opcode = WRITE_FILEMARKS; |
_lto3b(number, cmd.number); |
_lto3b(number, cmd.number); |
|
|
return ((*st->sc_link->scsipi_cmd)(st->sc_link, |
return (scsipi_command(st->sc_link, |
(struct scsipi_generic *)&cmd, sizeof(cmd), |
(struct scsipi_generic *)&cmd, sizeof(cmd), |
0, 0, 0, 100000, NULL, flags)); |
0, 0, 0, 100000, NULL, flags)); |
} |
} |
Line 1853 st_load(st, type, flags) |
|
Line 1853 st_load(st, type, flags) |
|
cmd.opcode = LOAD; |
cmd.opcode = LOAD; |
cmd.how = type; |
cmd.how = type; |
|
|
return ((*st->sc_link->scsipi_cmd)(st->sc_link, |
return (scsipi_command(st->sc_link, |
(struct scsipi_generic *)&cmd, sizeof(cmd), |
(struct scsipi_generic *)&cmd, sizeof(cmd), |
0, 0, ST_RETRIES, 300000, NULL, flags)); |
0, 0, ST_RETRIES, 300000, NULL, flags)); |
} |
} |
Line 1880 st_rewind(st, immediate, flags) |
|
Line 1880 st_rewind(st, immediate, flags) |
|
cmd.opcode = REWIND; |
cmd.opcode = REWIND; |
cmd.byte2 = immediate; |
cmd.byte2 = immediate; |
|
|
return ((*st->sc_link->scsipi_cmd)(st->sc_link, |
return (scsipi_command(st->sc_link, |
(struct scsipi_generic *)&cmd, sizeof(cmd), |
(struct scsipi_generic *)&cmd, sizeof(cmd), |
0, 0, ST_RETRIES, immediate ? 5000 : 300000, NULL, flags)); |
0, 0, ST_RETRIES, immediate ? 5000 : 300000, NULL, flags)); |
} |
} |
Line 1914 st_rdpos(st, hard, blkptr) |
|
Line 1914 st_rdpos(st, hard, blkptr) |
|
if (hard) |
if (hard) |
cmd.byte1 = 1; |
cmd.byte1 = 1; |
|
|
error = (*st->sc_link->scsipi_cmd)(st->sc_link, |
error = scsipi_command(st->sc_link, |
(struct scsipi_generic *)&cmd, sizeof(cmd), (u_char *)&posdata, |
(struct scsipi_generic *)&cmd, sizeof(cmd), (u_char *)&posdata, |
sizeof(posdata), ST_RETRIES, 30000, NULL, |
sizeof(posdata), ST_RETRIES, 30000, NULL, |
SCSI_SILENT | SCSI_DATA_IN); |
SCSI_SILENT | SCSI_DATA_IN); |
Line 1963 st_setpos(st, hard, blkptr) |
|
Line 1963 st_setpos(st, hard, blkptr) |
|
if (hard) |
if (hard) |
cmd.bytes[0] = 1 << 2; |
cmd.bytes[0] = 1 << 2; |
_lto4b(*blkptr, &cmd.bytes[2]); |
_lto4b(*blkptr, &cmd.bytes[2]); |
error = (*st->sc_link->scsipi_cmd)(st->sc_link, &cmd, sizeof(cmd), |
error = scsipi_command(st->sc_link, &cmd, sizeof(cmd), |
NULL, 0, ST_RETRIES, 900000, NULL, 0); |
NULL, 0, ST_RETRIES, 900000, NULL, 0); |
/* |
/* |
* XXX: Note file && block number position now unknown (if |
* XXX: Note file && block number position now unknown (if |