/* Execute an ATAPI command. Return OK or error.
*/
cmd_fis_t fis;
- prd_t prd;
+ prd_t prd[1];
int nr_prds = 0;
assert(size <= AHCI_TMP_SIZE);
if (!write && (ps->flags & FLAG_USE_DMADIR))
fis.cf_feat |= ATA_FEAT_PACKET_DMADIR;
- prd.vp_addr = ps->tmp_phys;
- prd.vp_size = size;
+ prd[0].vp_addr = ps->tmp_phys;
+ prd[0].vp_size = size;
nr_prds++;
}
/* Start the command, and wait for it to complete or fail. */
- port_set_cmd(ps, cmd, &fis, packet, &prd, nr_prds, write);
+ port_set_cmd(ps, cmd, &fis, packet, prd, nr_prds, write);
return port_exec(ps, cmd, ahci_command_timeout);
}
/* See if the user specified a custom mapping. Unlike all other
* configuration options, this is a per-instance setting.
*/
- strcpy(key, "ahci0_map");
+ strlcpy(key, "ahci0_map", sizeof(key));
key[4] += ahci_instance;
if (env_get_param(key, val, sizeof(val)) == OK) {