Lines Matching refs:pcmd
131 static int sil_exec_cmd(int dev, struct sil_cmd_block *pcmd, int tag) in sil_exec_cmd() argument
135 u64 paddr = virt_to_bus(sata->devno, pcmd); in sil_exec_cmd()
170 struct sil_cmd_block cmdb, *pcmd = &cmdb; in sil_cmd_set_feature() local
176 pcmd->prb.fis.fis_type = SATA_FIS_TYPE_REGISTER_H2D; in sil_cmd_set_feature()
177 pcmd->prb.fis.pm_port_c = (1 << 7); in sil_cmd_set_feature()
178 pcmd->prb.fis.command = ATA_CMD_SET_FEATURES; in sil_cmd_set_feature()
179 pcmd->prb.fis.features = SETFEATURES_XFER; in sil_cmd_set_feature()
186 pcmd->prb.fis.sector_count = XFER_UDMA_6; in sil_cmd_set_feature()
188 pcmd->prb.fis.sector_count = XFER_UDMA_5; in sil_cmd_set_feature()
190 pcmd->prb.fis.sector_count = XFER_UDMA_4; in sil_cmd_set_feature()
192 pcmd->prb.fis.sector_count = XFER_UDMA_3; in sil_cmd_set_feature()
194 ret = sil_exec_cmd(dev, pcmd, 0); in sil_cmd_set_feature()
209 struct sil_cmd_block cmdb, *pcmd = &cmdb; in sil_cmd_identify_device() local
214 pcmd->prb.ctrl = cpu_to_le16(PRB_CTRL_PROTOCOL); in sil_cmd_identify_device()
215 pcmd->prb.prot = cpu_to_le16(PRB_PROT_READ); in sil_cmd_identify_device()
216 pcmd->prb.fis.fis_type = SATA_FIS_TYPE_REGISTER_H2D; in sil_cmd_identify_device()
217 pcmd->prb.fis.pm_port_c = (1 << 7); in sil_cmd_identify_device()
218 pcmd->prb.fis.command = ATA_CMD_ID_ATA; in sil_cmd_identify_device()
219 pcmd->sge.addr = cpu_to_le64(virt_to_bus(sata->devno, id)); in sil_cmd_identify_device()
220 pcmd->sge.cnt = cpu_to_le32(sizeof(id[0]) * ATA_ID_WORDS); in sil_cmd_identify_device()
221 pcmd->sge.flags = cpu_to_le32(SGE_TRM); in sil_cmd_identify_device()
223 ret = sil_exec_cmd(dev, pcmd, 0); in sil_cmd_identify_device()
237 struct sil_cmd_block cmdb, *pcmd = &cmdb; in sil_cmd_soft_reset() local
251 pcmd->prb.ctrl = cpu_to_le16(PRB_CTRL_SRST); in sil_cmd_soft_reset()
252 pcmd->prb.fis.fis_type = SATA_FIS_TYPE_REGISTER_H2D; in sil_cmd_soft_reset()
253 pcmd->prb.fis.pm_port_c = 0xf; in sil_cmd_soft_reset()
270 struct sil_cmd_block cmdb, *pcmd = &cmdb; in sil_sata_rw_cmd() local
276 memset(pcmd, 0, sizeof(struct sil_cmd_block)); in sil_sata_rw_cmd()
277 pcmd->prb.ctrl = cpu_to_le16(PRB_CTRL_PROTOCOL); in sil_sata_rw_cmd()
278 pcmd->prb.fis.fis_type = SATA_FIS_TYPE_REGISTER_H2D; in sil_sata_rw_cmd()
279 pcmd->prb.fis.pm_port_c = (1 << 7); in sil_sata_rw_cmd()
281 pcmd->prb.fis.command = ATA_CMD_WRITE; in sil_sata_rw_cmd()
282 pcmd->prb.prot = cpu_to_le16(PRB_PROT_WRITE); in sil_sata_rw_cmd()
284 pcmd->prb.fis.command = ATA_CMD_READ; in sil_sata_rw_cmd()
285 pcmd->prb.prot = cpu_to_le16(PRB_PROT_READ); in sil_sata_rw_cmd()
288 pcmd->prb.fis.device = ATA_LBA; in sil_sata_rw_cmd()
289 pcmd->prb.fis.device |= (block >> 24) & 0xf; in sil_sata_rw_cmd()
290 pcmd->prb.fis.lba_high = (block >> 16) & 0xff; in sil_sata_rw_cmd()
291 pcmd->prb.fis.lba_mid = (block >> 8) & 0xff; in sil_sata_rw_cmd()
292 pcmd->prb.fis.lba_low = block & 0xff; in sil_sata_rw_cmd()
293 pcmd->prb.fis.sector_count = (u8)blkcnt & 0xff; in sil_sata_rw_cmd()
295 pcmd->sge.addr = cpu_to_le64(virt_to_bus(sata->devno, buffer)); in sil_sata_rw_cmd()
296 pcmd->sge.cnt = cpu_to_le32(blkcnt * ATA_SECT_SIZE); in sil_sata_rw_cmd()
297 pcmd->sge.flags = cpu_to_le32(SGE_TRM); in sil_sata_rw_cmd()
299 ret = sil_exec_cmd(dev, pcmd, 0); in sil_sata_rw_cmd()
315 struct sil_cmd_block cmdb, *pcmd = &cmdb; in sil_sata_rw_cmd_ext() local
321 memset(pcmd, 0, sizeof(struct sil_cmd_block)); in sil_sata_rw_cmd_ext()
322 pcmd->prb.ctrl = cpu_to_le16(PRB_CTRL_PROTOCOL); in sil_sata_rw_cmd_ext()
323 pcmd->prb.fis.fis_type = SATA_FIS_TYPE_REGISTER_H2D; in sil_sata_rw_cmd_ext()
324 pcmd->prb.fis.pm_port_c = (1 << 7); in sil_sata_rw_cmd_ext()
326 pcmd->prb.fis.command = ATA_CMD_WRITE_EXT; in sil_sata_rw_cmd_ext()
327 pcmd->prb.prot = cpu_to_le16(PRB_PROT_WRITE); in sil_sata_rw_cmd_ext()
329 pcmd->prb.fis.command = ATA_CMD_READ_EXT; in sil_sata_rw_cmd_ext()
330 pcmd->prb.prot = cpu_to_le16(PRB_PROT_READ); in sil_sata_rw_cmd_ext()
333 pcmd->prb.fis.lba_high_exp = (block >> 40) & 0xff; in sil_sata_rw_cmd_ext()
334 pcmd->prb.fis.lba_mid_exp = (block >> 32) & 0xff; in sil_sata_rw_cmd_ext()
335 pcmd->prb.fis.lba_low_exp = (block >> 24) & 0xff; in sil_sata_rw_cmd_ext()
336 pcmd->prb.fis.lba_high = (block >> 16) & 0xff; in sil_sata_rw_cmd_ext()
337 pcmd->prb.fis.lba_mid = (block >> 8) & 0xff; in sil_sata_rw_cmd_ext()
338 pcmd->prb.fis.lba_low = block & 0xff; in sil_sata_rw_cmd_ext()
339 pcmd->prb.fis.device = ATA_LBA; in sil_sata_rw_cmd_ext()
340 pcmd->prb.fis.sector_count_exp = (blkcnt >> 8) & 0xff; in sil_sata_rw_cmd_ext()
341 pcmd->prb.fis.sector_count = blkcnt & 0xff; in sil_sata_rw_cmd_ext()
343 pcmd->sge.addr = cpu_to_le64(virt_to_bus(sata->devno, buffer)); in sil_sata_rw_cmd_ext()
344 pcmd->sge.cnt = cpu_to_le32(blkcnt * ATA_SECT_SIZE); in sil_sata_rw_cmd_ext()
345 pcmd->sge.flags = cpu_to_le32(SGE_TRM); in sil_sata_rw_cmd_ext()
347 ret = sil_exec_cmd(dev, pcmd, 0); in sil_sata_rw_cmd_ext()
419 struct sil_cmd_block cmdb, *pcmd = &cmdb; in sil_sata_cmd_flush_cache() local
421 memset((void *)pcmd, 0, sizeof(struct sil_cmd_block)); in sil_sata_cmd_flush_cache()
422 pcmd->prb.fis.fis_type = SATA_FIS_TYPE_REGISTER_H2D; in sil_sata_cmd_flush_cache()
423 pcmd->prb.fis.pm_port_c = (1 << 7); in sil_sata_cmd_flush_cache()
424 pcmd->prb.fis.command = ATA_CMD_FLUSH; in sil_sata_cmd_flush_cache()
426 sil_exec_cmd(dev, pcmd, 0); in sil_sata_cmd_flush_cache()
431 struct sil_cmd_block cmdb, *pcmd = &cmdb; in sil_sata_cmd_flush_cache_ext() local
433 memset((void *)pcmd, 0, sizeof(struct sil_cmd_block)); in sil_sata_cmd_flush_cache_ext()
434 pcmd->prb.fis.fis_type = SATA_FIS_TYPE_REGISTER_H2D; in sil_sata_cmd_flush_cache_ext()
435 pcmd->prb.fis.pm_port_c = (1 << 7); in sil_sata_cmd_flush_cache_ext()
436 pcmd->prb.fis.command = ATA_CMD_FLUSH_EXT; in sil_sata_cmd_flush_cache_ext()
438 sil_exec_cmd(dev, pcmd, 0); in sil_sata_cmd_flush_cache_ext()