View | Details | Raw Unified | Return to bug 8244 | Differences between
and this patch

Collapse All | Expand All

(-)linux-2.6.20.3/drivers/ata/libata-scsi.c (+41 lines)
Lines 2384-2389 static void atapi_qc_complete(struct ata Link Here
2384
	qc->scsidone(cmd);
2384
	qc->scsidone(cmd);
2385
	ata_qc_free(qc);
2385
	ata_qc_free(qc);
2386
}
2386
}
2387
2388
static inline void ata_scsi_dump_cdb2(struct ata_port *ap,
2389
				      struct scsi_cmnd *cmd)
2390
{
2391
	struct scsi_device *scsidev = cmd->device;
2392
	u8 *scsicmd = cmd->cmnd;
2393
2394
	printk(KERN_ERR "CDB (%u:%d,%d,%d) %02x %02x %02x %02x %02x %02x %02x %02x %02x\n",
2395
	       ap->id,
2396
	       scsidev->channel, scsidev->id, scsidev->lun,
2397
	       scsicmd[0], scsicmd[1], scsicmd[2], scsicmd[3],
2398
	       scsicmd[4], scsicmd[5], scsicmd[6], scsicmd[7],
2399
	       scsicmd[8]);
2400
}
2401
2387
/**
2402
/**
2388
 *	atapi_xlat - Initialize PACKET taskfile
2403
 *	atapi_xlat - Initialize PACKET taskfile
2389
 *	@qc: command structure to be initialized
2404
 *	@qc: command structure to be initialized
Lines 2400-2405 static unsigned int atapi_xlat(struct at Link Here
2400
	struct ata_device *dev = qc->dev;
2415
	struct ata_device *dev = qc->dev;
2401
	int using_pio = (dev->flags & ATA_DFLAG_PIO);
2416
	int using_pio = (dev->flags & ATA_DFLAG_PIO);
2402
	int nodata = (scmd->sc_data_direction == DMA_NONE);
2417
	int nodata = (scmd->sc_data_direction == DMA_NONE);
2418
	struct ata_port *ap = qc->ap;
2419
2420
	if (ap->id == 2 || ap->id == 4) {
2421
		u8 *scsicmd = scmd->cmnd;
2422
2423
		switch (scsicmd[0]) {
2424
		case 0x12: /* INQUIRY */
2425
			ata_scsi_dump_cdb2(ap, scmd);
2426
2427
			/* filter out INQUIRY with EVPD */
2428
			if (scsicmd[1] & 0x01)
2429
				goto invalid_fld;
2430
			break;
2431
		case 0x46: /* GET_CONFIGURATION	*/
2432
		case 0x51: /* READ_DISC_INFO */
2433
		case 0x5a: /* MODE_SENSE_10 */
2434
2435
			ata_scsi_dump_cdb2(ap, scmd);
2436
			//goto invalid_fld;
2437
		}
2438
	}
2403
2439
2404
	if (!using_pio)
2440
	if (!using_pio)
2405
		/* Check whether ATAPI DMA is safe */
2441
		/* Check whether ATAPI DMA is safe */
Lines 2442-2447 static unsigned int atapi_xlat(struct at Link Here
2442
	qc->nbytes = scmd->request_bufflen;
2478
	qc->nbytes = scmd->request_bufflen;
2443
2479
2444
	return 0;
2480
	return 0;
2481
2482
invalid_fld:
2483
	ata_scsi_set_sense(scmd, ILLEGAL_REQUEST, 0x24, 0x0);
2484
	/* "Invalid field in cbd" */
2485
	return 1;
2445
}
2486
}
2446
2487
2447
static struct ata_device * ata_find_dev(struct ata_port *ap, int id)
2488
static struct ata_device * ata_find_dev(struct ata_port *ap, int id)

Return to bug 8244