Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 21848
b: refs/heads/master
c: 6e7846e
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed Feb 12, 2006
1 parent bb72b85 commit cc2d518
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8eabd02c246b808e0e27c3ee9ea17d0349efb06d
refs/heads/master: 6e7846e9c548443c86cfbad9e4defb4bdcfc538b
3 changes: 2 additions & 1 deletion trunk/drivers/scsi/ahci.c
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,8 @@ static void ahci_qc_prep(struct ata_queued_cmd *qc)
ata_tf_to_fis(&qc->tf, pp->cmd_tbl, 0);
if (is_atapi) {
memset(pp->cmd_tbl + AHCI_CMD_TBL_CDB, 0, 32);
memcpy(pp->cmd_tbl + AHCI_CMD_TBL_CDB, qc->cdb, ap->cdb_len);
memcpy(pp->cmd_tbl + AHCI_CMD_TBL_CDB, qc->cdb,
qc->dev->cdb_len);
}

n_elem = 0;
Expand Down
19 changes: 12 additions & 7 deletions trunk/drivers/scsi/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,7 @@ static void ata_dev_identify(struct ata_port *ap, unsigned int device)
unsigned int using_edd;
struct ata_taskfile tf;
unsigned int err_mask;
int rc;
int i, rc;

if (!ata_dev_present(dev)) {
DPRINTK("ENTER/EXIT (host %u, dev %u) -- nodev\n",
Expand Down Expand Up @@ -1087,7 +1087,7 @@ static void ata_dev_identify(struct ata_port *ap, unsigned int device)

}

ap->host->max_cmd_len = 16;
dev->cdb_len = 16;
}

/* ATAPI-specific feature tests */
Expand All @@ -1100,15 +1100,20 @@ static void ata_dev_identify(struct ata_port *ap, unsigned int device)
printk(KERN_WARNING "ata%u: unsupported CDB len\n", ap->id);
goto err_out_nosup;
}
ap->cdb_len = (unsigned int) rc;
ap->host->max_cmd_len = (unsigned char) ap->cdb_len;
dev->cdb_len = (unsigned int) rc;

/* print device info to dmesg */
printk(KERN_INFO "ata%u: dev %u ATAPI, max %s\n",
ap->id, device,
ata_mode_string(xfer_modes));
}

ap->host->max_cmd_len = 0;
for (i = 0; i < ATA_MAX_DEVICES; i++)
ap->host->max_cmd_len = max_t(unsigned int,
ap->host->max_cmd_len,
ap->device[i].cdb_len);

DPRINTK("EXIT, drv_stat = 0x%x\n", ata_chk_status(ap));
return;

Expand Down Expand Up @@ -4203,7 +4208,7 @@ static void atapi_packet_task(void *_data)

/* send SCSI cdb */
DPRINTK("send cdb\n");
WARN_ON(ap->cdb_len < 12);
WARN_ON(qc->dev->cdb_len < 12);

if (qc->tf.protocol == ATA_PROT_ATAPI_DMA ||
qc->tf.protocol == ATA_PROT_ATAPI_NODATA) {
Expand All @@ -4217,12 +4222,12 @@ static void atapi_packet_task(void *_data)
*/
spin_lock_irqsave(&ap->host_set->lock, flags);
ap->flags &= ~ATA_FLAG_NOINTR;
ata_data_xfer(ap, qc->cdb, ap->cdb_len, 1);
ata_data_xfer(ap, qc->cdb, qc->dev->cdb_len, 1);
if (qc->tf.protocol == ATA_PROT_ATAPI_DMA)
ap->ops->bmdma_start(qc); /* initiate bmdma */
spin_unlock_irqrestore(&ap->host_set->lock, flags);
} else {
ata_data_xfer(ap, qc->cdb, ap->cdb_len, 1);
ata_data_xfer(ap, qc->cdb, qc->dev->cdb_len, 1);

/* PIO commands are handled by polling */
ap->hsm_task_state = HSM_ST;
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/scsi/libata-scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -2146,7 +2146,7 @@ static void atapi_request_sense(struct ata_queued_cmd *qc)
ata_sg_init_one(qc, cmd->sense_buffer, sizeof(cmd->sense_buffer));
qc->dma_dir = DMA_FROM_DEVICE;

memset(&qc->cdb, 0, ap->cdb_len);
memset(&qc->cdb, 0, qc->dev->cdb_len);
qc->cdb[0] = REQUEST_SENSE;
qc->cdb[4] = SCSI_SENSE_BUFFERSIZE;

Expand Down Expand Up @@ -2248,7 +2248,7 @@ static unsigned int atapi_xlat(struct ata_queued_cmd *qc, const u8 *scsicmd)
if (ata_check_atapi_dma(qc))
using_pio = 1;

memcpy(&qc->cdb, scsicmd, qc->ap->cdb_len);
memcpy(&qc->cdb, scsicmd, dev->cdb_len);

qc->complete_fn = atapi_qc_complete;

Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/scsi/sata_sil24.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ static void sil24_dev_config(struct ata_port *ap, struct ata_device *dev)
{
void __iomem *port = (void __iomem *)ap->ioaddr.cmd_addr;

if (ap->cdb_len == 16)
if (dev->cdb_len == 16)
writel(PORT_CS_CDB16, port + PORT_CTRL_STAT);
else
writel(PORT_CS_CDB16, port + PORT_CTRL_CLR);
Expand Down Expand Up @@ -543,7 +543,7 @@ static void sil24_qc_prep(struct ata_queued_cmd *qc)
prb = &cb->atapi.prb;
sge = cb->atapi.sge;
memset(cb->atapi.cdb, 0, 32);
memcpy(cb->atapi.cdb, qc->cdb, ap->cdb_len);
memcpy(cb->atapi.cdb, qc->cdb, qc->dev->cdb_len);

if (qc->tf.protocol != ATA_PROT_ATAPI_NODATA) {
if (qc->tf.flags & ATA_TFLAG_WRITE)
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/linux/libata.h
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ struct ata_device {

unsigned int multi_count; /* sectors count for
READ/WRITE MULTIPLE */
unsigned int cdb_len;

/* for CHS addressing */
u16 cylinders; /* Number of cylinders */
Expand Down Expand Up @@ -377,7 +378,6 @@ struct ata_port {
unsigned int mwdma_mask;
unsigned int udma_mask;
unsigned int cbl; /* cable type; ATA_CBL_xxx */
unsigned int cdb_len;

struct ata_device device[ATA_MAX_DEVICES];

Expand Down

0 comments on commit cc2d518

Please sign in to comment.