Lines Matching refs:tf
218 struct ata_taskfile *tf, const u8 *cdb,
231 const struct ata_taskfile *tf);
233 const struct ata_taskfile *tf);
241 const struct ata_taskfile *tf);
250 static void ata_tf_read(struct ata_port *ap, struct ata_taskfile *tf);
731 struct ata_taskfile tf; in ata_dev_read_id() local
748 memset(&tf, 0, sizeof(tf)); in ata_dev_read_id()
751 tf.ctl = ap->ctl; in ata_dev_read_id()
752 tf.device = ATA_DEVICE_OBS; in ata_dev_read_id()
753 tf.command = ATA_CMD_ID_ATA; in ata_dev_read_id()
754 tf.protocol = ATA_PROT_PIO; in ata_dev_read_id()
759 tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE; in ata_dev_read_id()
764 tf.flags |= ATA_TFLAG_POLLING; in ata_dev_read_id()
768 err_mask = ata_exec_internal(dev, &tf, NULL, DMA_FROM_DEVICE, in ata_dev_read_id()
777 if ((err_mask == AC_ERR_DEV) && (tf.feature & ATA_ABORTED)) { in ata_dev_read_id()
945 memset(&qc->tf, 0, sizeof(qc->tf)); in ata_qc_reinit()
946 qc->tf.ctl = 0; in ata_qc_reinit()
947 qc->tf.device = ATA_DEVICE_OBS; in ata_qc_reinit()
974 struct ata_taskfile *tf, const u8 *cdb, in ata_exec_internal() argument
1021 qc->tf = *tf; in ata_exec_internal()
1049 qc->tf.command == ATA_CMD_PIO_READ_EXT){ in ata_exec_internal()
1087 *tf = qc->result_tf; in ata_exec_internal()
1107 u8 prot = qc->tf.protocol; in ata_qc_issue()
1140 switch (qc->tf.protocol) { in ata_qc_issue_prot()
1145 qc->tf.flags |= ATA_TFLAG_POLLING; in ata_qc_issue_prot()
1154 switch (qc->tf.protocol) { in ata_qc_issue_prot()
1156 if (qc->tf.flags & ATA_TFLAG_POLLING) in ata_qc_issue_prot()
1157 qc->tf.ctl |= ATA_NIEN; in ata_qc_issue_prot()
1159 ata_tf_to_host(ap, &qc->tf); in ata_qc_issue_prot()
1163 if (qc->tf.flags & ATA_TFLAG_POLLING) in ata_qc_issue_prot()
1176 const struct ata_taskfile *tf) in ata_tf_to_host() argument
1178 ata_tf_load(ap, tf); in ata_tf_to_host()
1179 ata_exec_command(ap, tf); in ata_tf_to_host()
1183 const struct ata_taskfile *tf) in ata_tf_load() argument
1186 unsigned int is_addr = tf->flags & ATA_TFLAG_ISADDR; in ata_tf_load()
1188 if (tf->ctl != ap->last_ctl) { in ata_tf_load()
1190 writeb(tf->ctl, ioaddr->ctl_addr); in ata_tf_load()
1191 ap->last_ctl = tf->ctl; in ata_tf_load()
1195 if (is_addr && (tf->flags & ATA_TFLAG_LBA48)) { in ata_tf_load()
1196 writeb(tf->hob_feature, ioaddr->feature_addr); in ata_tf_load()
1197 writeb(tf->hob_nsect, ioaddr->nsect_addr); in ata_tf_load()
1198 writeb(tf->hob_lbal, ioaddr->lbal_addr); in ata_tf_load()
1199 writeb(tf->hob_lbam, ioaddr->lbam_addr); in ata_tf_load()
1200 writeb(tf->hob_lbah, ioaddr->lbah_addr); in ata_tf_load()
1204 writeb(tf->feature, ioaddr->feature_addr); in ata_tf_load()
1205 writeb(tf->nsect, ioaddr->nsect_addr); in ata_tf_load()
1206 writeb(tf->lbal, ioaddr->lbal_addr); in ata_tf_load()
1207 writeb(tf->lbam, ioaddr->lbam_addr); in ata_tf_load()
1208 writeb(tf->lbah, ioaddr->lbah_addr); in ata_tf_load()
1211 if (tf->flags & ATA_TFLAG_DEVICE) in ata_tf_load()
1212 writeb(tf->device, ioaddr->device_addr); in ata_tf_load()
1218 const struct ata_taskfile *tf) in ata_exec_command() argument
1220 writeb(tf->command, ap->ioaddr.command_addr); in ata_exec_command()
1292 poll_next = (qc->tf.flags & ATA_TFLAG_POLLING); in ata_hsm_move()
1320 if (qc->tf.protocol == ATA_PROT_PIO) { in ata_hsm_move()
1363 if (!(qc->tf.flags & ATA_TFLAG_WRITE)) { in ata_hsm_move()
1381 (!(qc->tf.flags & ATA_TFLAG_WRITE))) { in ata_hsm_move()
1434 int do_write = (qc->tf.flags & ATA_TFLAG_WRITE); in ata_pio_sector()
1445 switch (qc->tf.command) { in ata_pio_sector()
1562 switch (qc->tf.command) { in ata_qc_complete()
1564 if (qc->tf.feature != SETFEATURES_WC_ON && in ata_qc_complete()
1565 qc->tf.feature != SETFEATURES_WC_OFF) in ata_qc_complete()
1583 qc->result_tf.flags = qc->tf.flags; in fill_result_tf()
1587 static void ata_tf_read(struct ata_port *ap, struct ata_taskfile *tf) in ata_tf_read() argument
1591 tf->command = ata_check_status(ap); in ata_tf_read()
1592 tf->feature = readb(ioaddr->error_addr); in ata_tf_read()
1593 tf->nsect = readb(ioaddr->nsect_addr); in ata_tf_read()
1594 tf->lbal = readb(ioaddr->lbal_addr); in ata_tf_read()
1595 tf->lbam = readb(ioaddr->lbam_addr); in ata_tf_read()
1596 tf->lbah = readb(ioaddr->lbah_addr); in ata_tf_read()
1597 tf->device = readb(ioaddr->device_addr); in ata_tf_read()
1599 if (tf->flags & ATA_TFLAG_LBA48) { in ata_tf_read()
1601 writeb(tf->ctl | ATA_HOB, ioaddr->ctl_addr); in ata_tf_read()
1603 tf->hob_feature = readb(ioaddr->error_addr); in ata_tf_read()
1604 tf->hob_nsect = readb(ioaddr->nsect_addr); in ata_tf_read()
1605 tf->hob_lbal = readb(ioaddr->lbal_addr); in ata_tf_read()
1606 tf->hob_lbam = readb(ioaddr->lbam_addr); in ata_tf_read()
1607 tf->hob_lbah = readb(ioaddr->lbah_addr); in ata_tf_read()
1609 writeb(tf->ctl, ioaddr->ctl_addr); in ata_tf_read()
1610 ap->last_ctl = tf->ctl; in ata_tf_read()
1682 struct ata_taskfile tf; in ata_dev_set_feature() local
1687 memset(&tf, 0, sizeof(tf)); in ata_dev_set_feature()
1688 tf.ctl = ap->ctl; in ata_dev_set_feature()
1690 tf.device = ATA_DEVICE_OBS; in ata_dev_set_feature()
1691 tf.command = ATA_CMD_SET_FEATURES; in ata_dev_set_feature()
1692 tf.feature = enable; in ata_dev_set_feature()
1693 tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE; in ata_dev_set_feature()
1694 tf.protocol = ATA_PROT_NODATA; in ata_dev_set_feature()
1695 tf.nsect = feature; in ata_dev_set_feature()
1697 err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, 0, 0); in ata_dev_set_feature()
1705 struct ata_taskfile tf; in ata_dev_init_params() local
1713 memset(&tf, 0, sizeof(tf)); in ata_dev_init_params()
1714 tf.ctl = ap->ctl; in ata_dev_init_params()
1715 tf.device = ATA_DEVICE_OBS; in ata_dev_init_params()
1716 tf.command = ATA_CMD_INIT_DEV_PARAMS; in ata_dev_init_params()
1717 tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE; in ata_dev_init_params()
1718 tf.protocol = ATA_PROT_NODATA; in ata_dev_init_params()
1719 tf.nsect = sectors; in ata_dev_init_params()
1720 tf.device |= (heads - 1) & 0x0f; in ata_dev_init_params()
1722 err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, 0, 0); in ata_dev_init_params()
1724 if (err_mask == AC_ERR_DEV && (tf.feature & ATA_ABORTED)) in ata_dev_init_params()
1792 struct ata_taskfile tf; in ata_dev_read_sectors() local
1804 memset(&tf, 0, sizeof(tf)); in ata_dev_read_sectors()
1805 tf.ctl = ap->ctl; in ata_dev_read_sectors()
1811 tf.device = ATA_DEVICE_OBS; in ata_dev_read_sectors()
1816 tf.command = ATA_CMD_PIO_READ_EXT; in ata_dev_read_sectors()
1817 tf.flags |= ATA_TFLAG_LBA | ATA_TFLAG_LBA48; in ata_dev_read_sectors()
1819 tf.hob_feature = 31; in ata_dev_read_sectors()
1820 tf.feature = 31; in ata_dev_read_sectors()
1821 tf.hob_nsect = (n_block >> 8) & 0xff; in ata_dev_read_sectors()
1822 tf.nsect = n_block & 0xff; in ata_dev_read_sectors()
1824 tf.hob_lbah = 0x0; in ata_dev_read_sectors()
1825 tf.hob_lbam = 0x0; in ata_dev_read_sectors()
1826 tf.hob_lbal = (block >> 24) & 0xff; in ata_dev_read_sectors()
1827 tf.lbah = (block >> 16) & 0xff; in ata_dev_read_sectors()
1828 tf.lbam = (block >> 8) & 0xff; in ata_dev_read_sectors()
1829 tf.lbal = block & 0xff; in ata_dev_read_sectors()
1831 tf.device = 1 << 6; in ata_dev_read_sectors()
1832 if (tf.flags & ATA_TFLAG_FUA) in ata_dev_read_sectors()
1833 tf.device |= 1 << 7; in ata_dev_read_sectors()
1835 tf.command = ATA_CMD_PIO_READ; in ata_dev_read_sectors()
1836 tf.flags |= ATA_TFLAG_LBA ; in ata_dev_read_sectors()
1838 tf.feature = 31; in ata_dev_read_sectors()
1839 tf.nsect = n_block & 0xff; in ata_dev_read_sectors()
1841 tf.lbah = (block >> 16) & 0xff; in ata_dev_read_sectors()
1842 tf.lbam = (block >> 8) & 0xff; in ata_dev_read_sectors()
1843 tf.lbal = block & 0xff; in ata_dev_read_sectors()
1845 tf.device = (block >> 24) & 0xf; in ata_dev_read_sectors()
1847 tf.device |= 1 << 6; in ata_dev_read_sectors()
1848 if (tf.flags & ATA_TFLAG_FUA) in ata_dev_read_sectors()
1849 tf.device |= 1 << 7; in ata_dev_read_sectors()
1853 tf.protocol = ATA_PROT_PIO; in ata_dev_read_sectors()
1858 tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE; in ata_dev_read_sectors()
1859 tf.flags |= ATA_TFLAG_POLLING; in ata_dev_read_sectors()
1861 err_mask = ata_exec_internal(dev, &tf, NULL, DMA_FROM_DEVICE, 0, 0); in ata_dev_read_sectors()
1869 if ((err_mask == AC_ERR_DEV) && (tf.feature & ATA_ABORTED)) { in ata_dev_read_sectors()
1966 struct ata_taskfile tf; in ata_dev_write_sectors() local
1978 memset(&tf, 0, sizeof(tf)); in ata_dev_write_sectors()
1979 tf.ctl = ap->ctl; in ata_dev_write_sectors()
1985 tf.device = ATA_DEVICE_OBS; in ata_dev_write_sectors()
1991 tf.command = ATA_CMD_PIO_WRITE_EXT; in ata_dev_write_sectors()
1992 tf.flags |= ATA_TFLAG_LBA | ATA_TFLAG_LBA48 | ATA_TFLAG_WRITE; in ata_dev_write_sectors()
1994 tf.hob_feature = 31; in ata_dev_write_sectors()
1995 tf.feature = 31; in ata_dev_write_sectors()
1996 tf.hob_nsect = (n_block >> 8) & 0xff; in ata_dev_write_sectors()
1997 tf.nsect = n_block & 0xff; in ata_dev_write_sectors()
1999 tf.hob_lbah = 0x0; in ata_dev_write_sectors()
2000 tf.hob_lbam = 0x0; in ata_dev_write_sectors()
2001 tf.hob_lbal = (block >> 24) & 0xff; in ata_dev_write_sectors()
2002 tf.lbah = (block >> 16) & 0xff; in ata_dev_write_sectors()
2003 tf.lbam = (block >> 8) & 0xff; in ata_dev_write_sectors()
2004 tf.lbal = block & 0xff; in ata_dev_write_sectors()
2006 tf.device = 1 << 6; in ata_dev_write_sectors()
2007 if (tf.flags & ATA_TFLAG_FUA) in ata_dev_write_sectors()
2008 tf.device |= 1 << 7; in ata_dev_write_sectors()
2010 tf.command = ATA_CMD_PIO_WRITE; in ata_dev_write_sectors()
2011 tf.flags |= ATA_TFLAG_LBA | ATA_TFLAG_WRITE; in ata_dev_write_sectors()
2013 tf.feature = 31; in ata_dev_write_sectors()
2014 tf.nsect = n_block & 0xff; in ata_dev_write_sectors()
2016 tf.lbah = (block >> 16) & 0xff; in ata_dev_write_sectors()
2017 tf.lbam = (block >> 8) & 0xff; in ata_dev_write_sectors()
2018 tf.lbal = block & 0xff; in ata_dev_write_sectors()
2020 tf.device = (block >> 24) & 0xf; in ata_dev_write_sectors()
2022 tf.device |= 1 << 6; in ata_dev_write_sectors()
2023 if (tf.flags & ATA_TFLAG_FUA) in ata_dev_write_sectors()
2024 tf.device |= 1 << 7; in ata_dev_write_sectors()
2028 tf.protocol = ATA_PROT_PIO; in ata_dev_write_sectors()
2033 tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE; in ata_dev_write_sectors()
2034 tf.flags |= ATA_TFLAG_POLLING; in ata_dev_write_sectors()
2036 err_mask = ata_exec_internal(dev, &tf, NULL, DMA_FROM_DEVICE, 0, 0); in ata_dev_write_sectors()
2044 if ((err_mask == AC_ERR_DEV) && (tf.feature & ATA_ABORTED)) { in ata_dev_write_sectors()