Daniel Beichl wrote:
+static int sil_check_atapi_dma(struct ata_queued_cmd *qc)
+{
+ /* limit atapi commands less than 60bytes to pio as certain sil */
+ /* chips seem to have trouble to perform dma for these commands */
+ if ( (qc->scsicmd != NULL) &&
+ (qc->scsicmd->sc_data_direction == DMA_TO_DEVICE) &&
+ (qc->scsicmd->request_bufflen < 60) )
+ {
+ ata_dev_printk( qc->dev, KERN_INFO, "reducing cmd %02x (direction=%d, len=%d) to pio\n",
+ qc->cdb[0],
+ qc->scsicmd->sc_data_direction,
+ qc->scsicmd->request_bufflen );
+ /* do not allow dma */
+ return -1;
+ }
+
+ /* allow dma */
+ return 0;
Comments:
1) Return values are zero or one for this hook
2) There are two data bundling methods in SCSI: single-buffer and
scatterlist. Further, SCSI is deprecating single-buffer method in favor
of always using a scatterlist. Your patch needs to support scatterlist.
Here is an example test found in libata-scsi.c that illustrates how
SCSI-aware code tests for and uses this:
if (cmd->use_sg) {
qc->__sg = (struct scatterlist *) cmd->request_buffer;
3) You need to always include a signoff line:
http://linux.yyz.us/patch-format.html
Jeff
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html