Source
264
264
int is_atapi = ata_is_atapi(qc->tf.protocol);
265
265
void *cmd_tbl;
266
266
u32 opts;
267
267
const u32 cmd_fis_len = 5; /* five dwords */
268
268
unsigned int n_elem;
269
269
270
270
/*
271
271
* Fill in command table information. First, the header,
272
272
* a SATA Register - Host to Device command FIS.
273
273
*/
274
-
cmd_tbl = pp->cmd_tbl + qc->tag * AHCI_CMD_TBL_SZ;
274
+
cmd_tbl = pp->cmd_tbl + qc->hw_tag * AHCI_CMD_TBL_SZ;
275
275
276
276
ata_tf_to_fis(&qc->tf, qc->dev->link->pmp, 1, cmd_tbl);
277
277
if (is_atapi) {
278
278
memset(cmd_tbl + AHCI_CMD_TBL_CDB, 0, 32);
279
279
memcpy(cmd_tbl + AHCI_CMD_TBL_CDB, qc->cdb, qc->dev->cdb_len);
280
280
}
281
281
282
282
n_elem = 0;
283
283
if (qc->flags & ATA_QCFLAG_DMAMAP)
284
284
n_elem = acard_ahci_fill_sg(qc, cmd_tbl);
287
287
* Fill in command slot information.
288
288
*
289
289
* ACard note: prd table length not filled in
290
290
*/
291
291
opts = cmd_fis_len | (qc->dev->link->pmp << 12);
292
292
if (qc->tf.flags & ATA_TFLAG_WRITE)
293
293
opts |= AHCI_CMD_WRITE;
294
294
if (is_atapi)
295
295
opts |= AHCI_CMD_ATAPI | AHCI_CMD_PREFETCH;
296
296
297
-
ahci_fill_cmd_slot(pp, qc->tag, opts);
297
+
ahci_fill_cmd_slot(pp, qc->hw_tag, opts);
298
298
}
299
299
300
300
static bool acard_ahci_qc_fill_rtf(struct ata_queued_cmd *qc)
301
301
{
302
302
struct ahci_port_priv *pp = qc->ap->private_data;
303
303
u8 *rx_fis = pp->rx_fis;
304
304
305
305
if (pp->fbs_enabled)
306
306
rx_fis += qc->dev->link->pmp * ACARD_AHCI_RX_FIS_SZ;
307
307