aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/atp870u.c
diff options
context:
space:
mode:
authorOndrej Zary <linux@rainbow-software.org>2015-11-17 13:23:56 -0500
committerMartin K. Petersen <martin.petersen@oracle.com>2015-11-25 22:08:37 -0500
commit485025606b5bbd1024c9b2781fb8909afbd1a64d (patch)
treec99d2ec30117a26e65d2a5f3ab03793f7592f76d /drivers/scsi/atp870u.c
parent152c3ac5e18057dbec396db83c76fccfa44aa258 (diff)
atp870u: Convert is880() to use wrappers
Subtract 0x40 to use _io access wrappers. Now it's obvious that is870() and is880() are very similar. Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Hannes Reinicke <hare@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/atp870u.c')
-rw-r--r--drivers/scsi/atp870u.c352
1 files changed, 176 insertions, 176 deletions
diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c
index 305eda807e11..1b9276f61850 100644
--- a/drivers/scsi/atp870u.c
+++ b/drivers/scsi/atp870u.c
@@ -1594,7 +1594,7 @@ set_syn_ok:
1594 atp_writeb_io(dev, 0, 0x3a, atp_readb_io(dev, 0, 0x3a) & 0xef); 1594 atp_writeb_io(dev, 0, 0x3a, atp_readb_io(dev, 0, 0x3a) & 0xef);
1595} 1595}
1596 1596
1597static void is880(struct atp_unit *dev, unsigned int wkport) 1597static void is880(struct atp_unit *dev)
1598{ 1598{
1599 unsigned char i, j, k, rmb, n, lvdmode; 1599 unsigned char i, j, k, rmb, n, lvdmode;
1600 unsigned short int m; 1600 unsigned short int m;
@@ -1608,7 +1608,7 @@ static void is880(struct atp_unit *dev, unsigned int wkport)
1608 static unsigned char wide[6] = { 0x80, 1, 2, 3, 1, 0 }; 1608 static unsigned char wide[6] = { 0x80, 1, 2, 3, 1, 0 };
1609 static unsigned char u3[9] = { 0x80, 1, 6, 4, 0x09, 00, 0x0e, 0x01, 0x02 }; 1609 static unsigned char u3[9] = { 0x80, 1, 6, 4, 0x09, 00, 0x0e, 0x01, 0x02 };
1610 1610
1611 lvdmode = inb(wkport + 0x3f) & 0x40; 1611 lvdmode = atp_readb_base(dev, 0x3f) & 0x40;
1612 1612
1613 for (i = 0; i < 16; i++) { 1613 for (i = 0; i < 16; i++) {
1614 m = 1; 1614 m = 1;
@@ -1620,100 +1620,100 @@ static void is880(struct atp_unit *dev, unsigned int wkport)
1620 printk(KERN_INFO " ID: %2d Host Adapter\n", dev->host_id[0]); 1620 printk(KERN_INFO " ID: %2d Host Adapter\n", dev->host_id[0]);
1621 continue; 1621 continue;
1622 } 1622 }
1623 outb(0x01, wkport + 0x5b); 1623 atp_writeb_io(dev, 0, 0x1b, 0x01);
1624 outb(0x08, wkport + 0x41); 1624 atp_writeb_io(dev, 0, 1, 0x08);
1625 outb(0x7f, wkport + 0x42); 1625 atp_writeb_io(dev, 0, 2, 0x7f);
1626 outb(satn[0], wkport + 0x43); 1626 atp_writeb_io(dev, 0, 3, satn[0]);
1627 outb(satn[1], wkport + 0x44); 1627 atp_writeb_io(dev, 0, 4, satn[1]);
1628 outb(satn[2], wkport + 0x45); 1628 atp_writeb_io(dev, 0, 5, satn[2]);
1629 outb(satn[3], wkport + 0x46); 1629 atp_writeb_io(dev, 0, 6, satn[3]);
1630 outb(satn[4], wkport + 0x47); 1630 atp_writeb_io(dev, 0, 7, satn[4]);
1631 outb(satn[5], wkport + 0x48); 1631 atp_writeb_io(dev, 0, 8, satn[5]);
1632 outb(0, wkport + 0x4f); 1632 atp_writeb_io(dev, 0, 0x0f, 0);
1633 outb(dev->id[0][i].devsp, wkport + 0x51); 1633 atp_writeb_io(dev, 0, 0x11, dev->id[0][i].devsp);
1634 outb(0, wkport + 0x52); 1634 atp_writeb_io(dev, 0, 0x12, 0);
1635 outb(satn[6], wkport + 0x53); 1635 atp_writeb_io(dev, 0, 0x13, satn[6]);
1636 outb(satn[7], wkport + 0x54); 1636 atp_writeb_io(dev, 0, 0x14, satn[7]);
1637 j = i; 1637 j = i;
1638 if ((j & 0x08) != 0) { 1638 if ((j & 0x08) != 0) {
1639 j = (j & 0x07) | 0x40; 1639 j = (j & 0x07) | 0x40;
1640 } 1640 }
1641 outb(j, wkport + 0x55); 1641 atp_writeb_io(dev, 0, 0x15, j);
1642 outb(satn[8], wkport + 0x58); 1642 atp_writeb_io(dev, 0, 0x18, satn[8]);
1643 1643
1644 while ((inb(wkport + 0x5f) & 0x80) == 0x00) 1644 while ((atp_readb_io(dev, 0, 0x1f) & 0x80) == 0x00)
1645 cpu_relax(); 1645 cpu_relax();
1646 1646
1647 if (inb(wkport + 0x57) != 0x11 && inb(wkport + 0x57) != 0x8e) 1647 if (atp_readb_io(dev, 0, 0x17) != 0x11 && atp_readb_io(dev, 0, 0x17) != 0x8e)
1648 continue; 1648 continue;
1649 1649
1650 while (inb(wkport + 0x57) != 0x8e) 1650 while (atp_readb_io(dev, 0, 0x17) != 0x8e)
1651 cpu_relax(); 1651 cpu_relax();
1652 1652
1653 dev->active_id[0] |= m; 1653 dev->active_id[0] |= m;
1654 1654
1655 outb(0x30, wkport + 0x50); 1655 atp_writeb_io(dev, 0, 0x10, 0x30);
1656 outb(0x00, wkport + 0x54); 1656 atp_writeb_io(dev, 0, 0x14, 0x00);
1657 1657
1658phase_cmd: 1658phase_cmd:
1659 outb(0x08, wkport + 0x58); 1659 atp_writeb_io(dev, 0, 0x18, 0x08);
1660 1660
1661 while ((inb(wkport + 0x5f) & 0x80) == 0x00) 1661 while ((atp_readb_io(dev, 0, 0x1f) & 0x80) == 0x00)
1662 cpu_relax(); 1662 cpu_relax();
1663 1663
1664 j = inb(wkport + 0x57); 1664 j = atp_readb_io(dev, 0, 0x17);
1665 if (j != 0x16) { 1665 if (j != 0x16) {
1666 outb(0x41, wkport + 0x50); 1666 atp_writeb_io(dev, 0, 0x10, 0x41);
1667 goto phase_cmd; 1667 goto phase_cmd;
1668 } 1668 }
1669sel_ok: 1669sel_ok:
1670 outb(inqd[0], wkport + 0x43); 1670 atp_writeb_io(dev, 0, 3, inqd[0]);
1671 outb(inqd[1], wkport + 0x44); 1671 atp_writeb_io(dev, 0, 4, inqd[1]);
1672 outb(inqd[2], wkport + 0x45); 1672 atp_writeb_io(dev, 0, 5, inqd[2]);
1673 outb(inqd[3], wkport + 0x46); 1673 atp_writeb_io(dev, 0, 6, inqd[3]);
1674 outb(inqd[4], wkport + 0x47); 1674 atp_writeb_io(dev, 0, 7, inqd[4]);
1675 outb(inqd[5], wkport + 0x48); 1675 atp_writeb_io(dev, 0, 8, inqd[5]);
1676 outb(0, wkport + 0x4f); 1676 atp_writeb_io(dev, 0, 0x0f, 0);
1677 outb(dev->id[0][i].devsp, wkport + 0x51); 1677 atp_writeb_io(dev, 0, 0x11, dev->id[0][i].devsp);
1678 outb(0, wkport + 0x52); 1678 atp_writeb_io(dev, 0, 0x12, 0);
1679 outb(inqd[6], wkport + 0x53); 1679 atp_writeb_io(dev, 0, 0x13, inqd[6]);
1680 outb(inqd[7], wkport + 0x54); 1680 atp_writeb_io(dev, 0, 0x14, inqd[7]);
1681 outb(inqd[8], wkport + 0x58); 1681 atp_writeb_io(dev, 0, 0x18, inqd[8]);
1682 1682
1683 while ((inb(wkport + 0x5f) & 0x80) == 0x00) 1683 while ((atp_readb_io(dev, 0, 0x1f) & 0x80) == 0x00)
1684 cpu_relax(); 1684 cpu_relax();
1685 1685
1686 if (inb(wkport + 0x57) != 0x11 && inb(wkport + 0x57) != 0x8e) 1686 if (atp_readb_io(dev, 0, 0x17) != 0x11 && atp_readb_io(dev, 0, 0x17) != 0x8e)
1687 continue; 1687 continue;
1688 1688
1689 while (inb(wkport + 0x57) != 0x8e) 1689 while (atp_readb_io(dev, 0, 0x17) != 0x8e)
1690 cpu_relax(); 1690 cpu_relax();
1691 1691
1692 outb(0x00, wkport + 0x5b); 1692 atp_writeb_io(dev, 0, 0x1b, 0x00);
1693 outb(0x08, wkport + 0x58); 1693 atp_writeb_io(dev, 0, 0x18, 0x08);
1694 j = 0; 1694 j = 0;
1695rd_inq_data: 1695rd_inq_data:
1696 k = inb(wkport + 0x5f); 1696 k = atp_readb_io(dev, 0, 0x1f);
1697 if ((k & 0x01) != 0) { 1697 if ((k & 0x01) != 0) {
1698 mbuf[j++] = inb(wkport + 0x59); 1698 mbuf[j++] = atp_readb_io(dev, 0, 0x19);
1699 goto rd_inq_data; 1699 goto rd_inq_data;
1700 } 1700 }
1701 if ((k & 0x80) == 0) { 1701 if ((k & 0x80) == 0) {
1702 goto rd_inq_data; 1702 goto rd_inq_data;
1703 } 1703 }
1704 j = inb(wkport + 0x57); 1704 j = atp_readb_io(dev, 0, 0x17);
1705 if (j == 0x16) { 1705 if (j == 0x16) {
1706 goto inq_ok; 1706 goto inq_ok;
1707 } 1707 }
1708 outb(0x46, wkport + 0x50); 1708 atp_writeb_io(dev, 0, 0x10, 0x46);
1709 outb(0, wkport + 0x52); 1709 atp_writeb_io(dev, 0, 0x12, 0);
1710 outb(0, wkport + 0x53); 1710 atp_writeb_io(dev, 0, 0x13, 0);
1711 outb(0, wkport + 0x54); 1711 atp_writeb_io(dev, 0, 0x14, 0);
1712 outb(0x08, wkport + 0x58); 1712 atp_writeb_io(dev, 0, 0x18, 0x08);
1713 while ((inb(wkport + 0x5f) & 0x80) == 0x00) 1713 while ((atp_readb_io(dev, 0, 0x1f) & 0x80) == 0x00)
1714 cpu_relax(); 1714 cpu_relax();
1715 1715
1716 if (inb(wkport + 0x57) != 0x16) 1716 if (atp_readb_io(dev, 0, 0x17) != 0x16)
1717 goto sel_ok; 1717 goto sel_ok;
1718 1718
1719inq_ok: 1719inq_ok:
@@ -1736,43 +1736,43 @@ inq_ok:
1736 goto chg_wide; 1736 goto chg_wide;
1737 } 1737 }
1738 1738
1739 outb(0x01, wkport + 0x5b); 1739 atp_writeb_io(dev, 0, 0x1b, 0x01);
1740 outb(satn[0], wkport + 0x43); 1740 atp_writeb_io(dev, 0, 3, satn[0]);
1741 outb(satn[1], wkport + 0x44); 1741 atp_writeb_io(dev, 0, 4, satn[1]);
1742 outb(satn[2], wkport + 0x45); 1742 atp_writeb_io(dev, 0, 5, satn[2]);
1743 outb(satn[3], wkport + 0x46); 1743 atp_writeb_io(dev, 0, 6, satn[3]);
1744 outb(satn[4], wkport + 0x47); 1744 atp_writeb_io(dev, 0, 7, satn[4]);
1745 outb(satn[5], wkport + 0x48); 1745 atp_writeb_io(dev, 0, 8, satn[5]);
1746 outb(0, wkport + 0x4f); 1746 atp_writeb_io(dev, 0, 0x0f, 0);
1747 outb(dev->id[0][i].devsp, wkport + 0x51); 1747 atp_writeb_io(dev, 0, 0x11, dev->id[0][i].devsp);
1748 outb(0, wkport + 0x52); 1748 atp_writeb_io(dev, 0, 0x12, 0);
1749 outb(satn[6], wkport + 0x53); 1749 atp_writeb_io(dev, 0, 0x13, satn[6]);
1750 outb(satn[7], wkport + 0x54); 1750 atp_writeb_io(dev, 0, 0x14, satn[7]);
1751 outb(satn[8], wkport + 0x58); 1751 atp_writeb_io(dev, 0, 0x18, satn[8]);
1752 1752
1753 while ((inb(wkport + 0x5f) & 0x80) == 0x00) 1753 while ((atp_readb_io(dev, 0, 0x1f) & 0x80) == 0x00)
1754 cpu_relax(); 1754 cpu_relax();
1755 1755
1756 if (inb(wkport + 0x57) != 0x11 && inb(wkport + 0x57) != 0x8e) 1756 if (atp_readb_io(dev, 0, 0x17) != 0x11 && atp_readb_io(dev, 0, 0x17) != 0x8e)
1757 continue; 1757 continue;
1758 1758
1759 while (inb(wkport + 0x57) != 0x8e) 1759 while (atp_readb_io(dev, 0, 0x17) != 0x8e)
1760 cpu_relax(); 1760 cpu_relax();
1761 1761
1762try_u3: 1762try_u3:
1763 j = 0; 1763 j = 0;
1764 outb(0x09, wkport + 0x54); 1764 atp_writeb_io(dev, 0, 0x14, 0x09);
1765 outb(0x20, wkport + 0x58); 1765 atp_writeb_io(dev, 0, 0x18, 0x20);
1766 1766
1767 while ((inb(wkport + 0x5f) & 0x80) == 0) { 1767 while ((atp_readb_io(dev, 0, 0x1f) & 0x80) == 0) {
1768 if ((inb(wkport + 0x5f) & 0x01) != 0) 1768 if ((atp_readb_io(dev, 0, 0x1f) & 0x01) != 0)
1769 outb(u3[j++], wkport + 0x59); 1769 atp_writeb_io(dev, 0, 0x19, u3[j++]);
1770 } 1770 }
1771 1771
1772 while ((inb(wkport + 0x57) & 0x80) == 0x00) 1772 while ((atp_readb_io(dev, 0, 0x17) & 0x80) == 0x00)
1773 cpu_relax(); 1773 cpu_relax();
1774 1774
1775 j = inb(wkport + 0x57) & 0x0f; 1775 j = atp_readb_io(dev, 0, 0x17) & 0x0f;
1776 if (j == 0x0f) { 1776 if (j == 0x0f) {
1777 goto u3p_in; 1777 goto u3p_in;
1778 } 1778 }
@@ -1784,12 +1784,12 @@ try_u3:
1784 } 1784 }
1785 continue; 1785 continue;
1786u3p_out: 1786u3p_out:
1787 outb(0x20, wkport + 0x58); 1787 atp_writeb_io(dev, 0, 0x18, 0x20);
1788 while ((inb(wkport + 0x5f) & 0x80) == 0) { 1788 while ((atp_readb_io(dev, 0, 0x1f) & 0x80) == 0) {
1789 if ((inb(wkport + 0x5f) & 0x01) != 0) 1789 if ((atp_readb_io(dev, 0, 0x1f) & 0x01) != 0)
1790 outb(0, wkport + 0x59); 1790 atp_writeb_io(dev, 0, 0x19, 0);
1791 } 1791 }
1792 j = inb(wkport + 0x57) & 0x0f; 1792 j = atp_readb_io(dev, 0, 0x17) & 0x0f;
1793 if (j == 0x0f) { 1793 if (j == 0x0f) {
1794 goto u3p_in; 1794 goto u3p_in;
1795 } 1795 }
@@ -1801,19 +1801,19 @@ u3p_out:
1801 } 1801 }
1802 continue; 1802 continue;
1803u3p_in: 1803u3p_in:
1804 outb(0x09, wkport + 0x54); 1804 atp_writeb_io(dev, 0, 0x14, 0x09);
1805 outb(0x20, wkport + 0x58); 1805 atp_writeb_io(dev, 0, 0x18, 0x20);
1806 k = 0; 1806 k = 0;
1807u3p_in1: 1807u3p_in1:
1808 j = inb(wkport + 0x5f); 1808 j = atp_readb_io(dev, 0, 0x1f);
1809 if ((j & 0x01) != 0) { 1809 if ((j & 0x01) != 0) {
1810 mbuf[k++] = inb(wkport + 0x59); 1810 mbuf[k++] = atp_readb_io(dev, 0, 0x19);
1811 goto u3p_in1; 1811 goto u3p_in1;
1812 } 1812 }
1813 if ((j & 0x80) == 0x00) { 1813 if ((j & 0x80) == 0x00) {
1814 goto u3p_in1; 1814 goto u3p_in1;
1815 } 1815 }
1816 j = inb(wkport + 0x57) & 0x0f; 1816 j = atp_readb_io(dev, 0, 0x17) & 0x0f;
1817 if (j == 0x0f) { 1817 if (j == 0x0f) {
1818 goto u3p_in; 1818 goto u3p_in;
1819 } 1819 }
@@ -1825,14 +1825,14 @@ u3p_in1:
1825 } 1825 }
1826 continue; 1826 continue;
1827u3p_cmd: 1827u3p_cmd:
1828 outb(0x30, wkport + 0x50); 1828 atp_writeb_io(dev, 0, 0x10, 0x30);
1829 outb(0x00, wkport + 0x54); 1829 atp_writeb_io(dev, 0, 0x14, 0x00);
1830 outb(0x08, wkport + 0x58); 1830 atp_writeb_io(dev, 0, 0x18, 0x08);
1831 1831
1832 while ((inb(wkport + 0x5f) & 0x80) == 0x00) 1832 while ((atp_readb_io(dev, 0, 0x1f) & 0x80) == 0x00)
1833 cpu_relax(); 1833 cpu_relax();
1834 1834
1835 j = inb(wkport + 0x57); 1835 j = atp_readb_io(dev, 0, 0x17);
1836 if (j != 0x16) { 1836 if (j != 0x16) {
1837 if (j == 0x4e) { 1837 if (j == 0x4e) {
1838 goto u3p_out; 1838 goto u3p_out;
@@ -1856,42 +1856,42 @@ u3p_cmd:
1856 continue; 1856 continue;
1857 } 1857 }
1858chg_wide: 1858chg_wide:
1859 outb(0x01, wkport + 0x5b); 1859 atp_writeb_io(dev, 0, 0x1b, 0x01);
1860 outb(satn[0], wkport + 0x43); 1860 atp_writeb_io(dev, 0, 3, satn[0]);
1861 outb(satn[1], wkport + 0x44); 1861 atp_writeb_io(dev, 0, 4, satn[1]);
1862 outb(satn[2], wkport + 0x45); 1862 atp_writeb_io(dev, 0, 5, satn[2]);
1863 outb(satn[3], wkport + 0x46); 1863 atp_writeb_io(dev, 0, 6, satn[3]);
1864 outb(satn[4], wkport + 0x47); 1864 atp_writeb_io(dev, 0, 7, satn[4]);
1865 outb(satn[5], wkport + 0x48); 1865 atp_writeb_io(dev, 0, 8, satn[5]);
1866 outb(0, wkport + 0x4f); 1866 atp_writeb_io(dev, 0, 0x0f, 0);
1867 outb(dev->id[0][i].devsp, wkport + 0x51); 1867 atp_writeb_io(dev, 0, 0x11, dev->id[0][i].devsp);
1868 outb(0, wkport + 0x52); 1868 atp_writeb_io(dev, 0, 0x12, 0);
1869 outb(satn[6], wkport + 0x53); 1869 atp_writeb_io(dev, 0, 0x13, satn[6]);
1870 outb(satn[7], wkport + 0x54); 1870 atp_writeb_io(dev, 0, 0x14, satn[7]);
1871 outb(satn[8], wkport + 0x58); 1871 atp_writeb_io(dev, 0, 0x18, satn[8]);
1872 1872
1873 while ((inb(wkport + 0x5f) & 0x80) == 0x00) 1873 while ((atp_readb_io(dev, 0, 0x1f) & 0x80) == 0x00)
1874 cpu_relax(); 1874 cpu_relax();
1875 1875
1876 if (inb(wkport + 0x57) != 0x11 && inb(wkport + 0x57) != 0x8e) 1876 if (atp_readb_io(dev, 0, 0x17) != 0x11 && atp_readb_io(dev, 0, 0x17) != 0x8e)
1877 continue; 1877 continue;
1878 1878
1879 while (inb(wkport + 0x57) != 0x8e) 1879 while (atp_readb_io(dev, 0, 0x17) != 0x8e)
1880 cpu_relax(); 1880 cpu_relax();
1881 1881
1882try_wide: 1882try_wide:
1883 j = 0; 1883 j = 0;
1884 outb(0x05, wkport + 0x54); 1884 atp_writeb_io(dev, 0, 0x14, 0x05);
1885 outb(0x20, wkport + 0x58); 1885 atp_writeb_io(dev, 0, 0x18, 0x20);
1886 1886
1887 while ((inb(wkport + 0x5f) & 0x80) == 0) { 1887 while ((atp_readb_io(dev, 0, 0x1f) & 0x80) == 0) {
1888 if ((inb(wkport + 0x5f) & 0x01) != 0) 1888 if ((atp_readb_io(dev, 0, 0x1f) & 0x01) != 0)
1889 outb(wide[j++], wkport + 0x59); 1889 atp_writeb_io(dev, 0, 0x19, wide[j++]);
1890 } 1890 }
1891 while ((inb(wkport + 0x57) & 0x80) == 0x00) 1891 while ((atp_readb_io(dev, 0, 0x17) & 0x80) == 0x00)
1892 cpu_relax(); 1892 cpu_relax();
1893 1893
1894 j = inb(wkport + 0x57) & 0x0f; 1894 j = atp_readb_io(dev, 0, 0x17) & 0x0f;
1895 if (j == 0x0f) { 1895 if (j == 0x0f) {
1896 goto widep_in; 1896 goto widep_in;
1897 } 1897 }
@@ -1903,12 +1903,12 @@ try_wide:
1903 } 1903 }
1904 continue; 1904 continue;
1905widep_out: 1905widep_out:
1906 outb(0x20, wkport + 0x58); 1906 atp_writeb_io(dev, 0, 0x18, 0x20);
1907 while ((inb(wkport + 0x5f) & 0x80) == 0) { 1907 while ((atp_readb_io(dev, 0, 0x1f) & 0x80) == 0) {
1908 if ((inb(wkport + 0x5f) & 0x01) != 0) 1908 if ((atp_readb_io(dev, 0, 0x1f) & 0x01) != 0)
1909 outb(0, wkport + 0x59); 1909 atp_writeb_io(dev, 0, 0x19, 0);
1910 } 1910 }
1911 j = inb(wkport + 0x57) & 0x0f; 1911 j = atp_readb_io(dev, 0, 0x17) & 0x0f;
1912 if (j == 0x0f) { 1912 if (j == 0x0f) {
1913 goto widep_in; 1913 goto widep_in;
1914 } 1914 }
@@ -1920,19 +1920,19 @@ widep_out:
1920 } 1920 }
1921 continue; 1921 continue;
1922widep_in: 1922widep_in:
1923 outb(0xff, wkport + 0x54); 1923 atp_writeb_io(dev, 0, 0x14, 0xff);
1924 outb(0x20, wkport + 0x58); 1924 atp_writeb_io(dev, 0, 0x18, 0x20);
1925 k = 0; 1925 k = 0;
1926widep_in1: 1926widep_in1:
1927 j = inb(wkport + 0x5f); 1927 j = atp_readb_io(dev, 0, 0x1f);
1928 if ((j & 0x01) != 0) { 1928 if ((j & 0x01) != 0) {
1929 mbuf[k++] = inb(wkport + 0x59); 1929 mbuf[k++] = atp_readb_io(dev, 0, 0x19);
1930 goto widep_in1; 1930 goto widep_in1;
1931 } 1931 }
1932 if ((j & 0x80) == 0x00) { 1932 if ((j & 0x80) == 0x00) {
1933 goto widep_in1; 1933 goto widep_in1;
1934 } 1934 }
1935 j = inb(wkport + 0x57) & 0x0f; 1935 j = atp_readb_io(dev, 0, 0x17) & 0x0f;
1936 if (j == 0x0f) { 1936 if (j == 0x0f) {
1937 goto widep_in; 1937 goto widep_in;
1938 } 1938 }
@@ -1944,14 +1944,14 @@ widep_in1:
1944 } 1944 }
1945 continue; 1945 continue;
1946widep_cmd: 1946widep_cmd:
1947 outb(0x30, wkport + 0x50); 1947 atp_writeb_io(dev, 0, 0x10, 0x30);
1948 outb(0x00, wkport + 0x54); 1948 atp_writeb_io(dev, 0, 0x14, 0x00);
1949 outb(0x08, wkport + 0x58); 1949 atp_writeb_io(dev, 0, 0x18, 0x08);
1950 1950
1951 while ((inb(wkport + 0x5f) & 0x80) == 0x00) 1951 while ((atp_readb_io(dev, 0, 0x1f) & 0x80) == 0x00)
1952 cpu_relax(); 1952 cpu_relax();
1953 1953
1954 j = inb(wkport + 0x57); 1954 j = atp_readb_io(dev, 0, 0x17);
1955 if (j != 0x16) { 1955 if (j != 0x16) {
1956 if (j == 0x4e) { 1956 if (j == 0x4e) {
1957 goto widep_out; 1957 goto widep_out;
@@ -1996,56 +1996,56 @@ set_sync:
1996 if ((m & dev->wide_id[0]) != 0) { 1996 if ((m & dev->wide_id[0]) != 0) {
1997 j |= 0x01; 1997 j |= 0x01;
1998 } 1998 }
1999 outb(j, wkport + 0x5b); 1999 atp_writeb_io(dev, 0, 0x1b, j);
2000 outb(satn[0], wkport + 0x43); 2000 atp_writeb_io(dev, 0, 3, satn[0]);
2001 outb(satn[1], wkport + 0x44); 2001 atp_writeb_io(dev, 0, 4, satn[1]);
2002 outb(satn[2], wkport + 0x45); 2002 atp_writeb_io(dev, 0, 5, satn[2]);
2003 outb(satn[3], wkport + 0x46); 2003 atp_writeb_io(dev, 0, 6, satn[3]);
2004 outb(satn[4], wkport + 0x47); 2004 atp_writeb_io(dev, 0, 7, satn[4]);
2005 outb(satn[5], wkport + 0x48); 2005 atp_writeb_io(dev, 0, 8, satn[5]);
2006 outb(0, wkport + 0x4f); 2006 atp_writeb_io(dev, 0, 0x0f, 0);
2007 outb(dev->id[0][i].devsp, wkport + 0x51); 2007 atp_writeb_io(dev, 0, 0x11, dev->id[0][i].devsp);
2008 outb(0, wkport + 0x52); 2008 atp_writeb_io(dev, 0, 0x12, 0);
2009 outb(satn[6], wkport + 0x53); 2009 atp_writeb_io(dev, 0, 0x13, satn[6]);
2010 outb(satn[7], wkport + 0x54); 2010 atp_writeb_io(dev, 0, 0x14, satn[7]);
2011 outb(satn[8], wkport + 0x58); 2011 atp_writeb_io(dev, 0, 0x18, satn[8]);
2012 2012
2013 while ((inb(wkport + 0x5f) & 0x80) == 0x00) 2013 while ((atp_readb_io(dev, 0, 0x1f) & 0x80) == 0x00)
2014 cpu_relax(); 2014 cpu_relax();
2015 2015
2016 if ((inb(wkport + 0x57) != 0x11) && (inb(wkport + 0x57) != 0x8e)) { 2016 if (atp_readb_io(dev, 0, 0x17) != 0x11 && atp_readb_io(dev, 0, 0x17) != 0x8e) {
2017 continue; 2017 continue;
2018 } 2018 }
2019 while (inb(wkport + 0x57) != 0x8e) 2019 while (atp_readb_io(dev, 0, 0x17) != 0x8e)
2020 cpu_relax(); 2020 cpu_relax();
2021 2021
2022try_sync: 2022try_sync:
2023 j = 0; 2023 j = 0;
2024 outb(0x06, wkport + 0x54); 2024 atp_writeb_io(dev, 0, 0x14, 0x06);
2025 outb(0x20, wkport + 0x58); 2025 atp_writeb_io(dev, 0, 0x18, 0x20);
2026 2026
2027 while ((inb(wkport + 0x5f) & 0x80) == 0) { 2027 while ((atp_readb_io(dev, 0, 0x1f) & 0x80) == 0) {
2028 if ((inb(wkport + 0x5f) & 0x01) != 0) { 2028 if ((atp_readb_io(dev, 0, 0x1f) & 0x01) != 0) {
2029 if ((m & dev->wide_id[0]) != 0) { 2029 if ((m & dev->wide_id[0]) != 0) {
2030 if ((m & dev->ultra_map[0]) != 0) { 2030 if ((m & dev->ultra_map[0]) != 0) {
2031 outb(synuw[j++], wkport + 0x59); 2031 atp_writeb_io(dev, 0, 0x19, synuw[j++]);
2032 } else { 2032 } else {
2033 outb(synw[j++], wkport + 0x59); 2033 atp_writeb_io(dev, 0, 0x19, synw[j++]);
2034 } 2034 }
2035 } else { 2035 } else {
2036 if ((m & dev->ultra_map[0]) != 0) { 2036 if ((m & dev->ultra_map[0]) != 0) {
2037 outb(synu[j++], wkport + 0x59); 2037 atp_writeb_io(dev, 0, 0x19, synu[j++]);
2038 } else { 2038 } else {
2039 outb(synn[j++], wkport + 0x59); 2039 atp_writeb_io(dev, 0, 0x19, synn[j++]);
2040 } 2040 }
2041 } 2041 }
2042 } 2042 }
2043 } 2043 }
2044 2044
2045 while ((inb(wkport + 0x57) & 0x80) == 0x00) 2045 while ((atp_readb_io(dev, 0, 0x17) & 0x80) == 0x00)
2046 cpu_relax(); 2046 cpu_relax();
2047 2047
2048 j = inb(wkport + 0x57) & 0x0f; 2048 j = atp_readb_io(dev, 0, 0x17) & 0x0f;
2049 if (j == 0x0f) { 2049 if (j == 0x0f) {
2050 goto phase_ins; 2050 goto phase_ins;
2051 } 2051 }
@@ -2057,12 +2057,12 @@ try_sync:
2057 } 2057 }
2058 continue; 2058 continue;
2059phase_outs: 2059phase_outs:
2060 outb(0x20, wkport + 0x58); 2060 atp_writeb_io(dev, 0, 0x18, 0x20);
2061 while ((inb(wkport + 0x5f) & 0x80) == 0x00) { 2061 while ((atp_readb_io(dev, 0, 0x1f) & 0x80) == 0x00) {
2062 if ((inb(wkport + 0x5f) & 0x01) != 0x00) 2062 if ((atp_readb_io(dev, 0, 0x1f) & 0x01) != 0x00)
2063 outb(0x00, wkport + 0x59); 2063 atp_writeb_io(dev, 0, 0x19, 0x00);
2064 } 2064 }
2065 j = inb(wkport + 0x57); 2065 j = atp_readb_io(dev, 0, 0x17);
2066 if (j == 0x85) { 2066 if (j == 0x85) {
2067 goto tar_dcons; 2067 goto tar_dcons;
2068 } 2068 }
@@ -2078,23 +2078,23 @@ phase_outs:
2078 } 2078 }
2079 continue; 2079 continue;
2080phase_ins: 2080phase_ins:
2081 outb(0x06, wkport + 0x54); 2081 atp_writeb_io(dev, 0, 0x14, 0x06);
2082 outb(0x20, wkport + 0x58); 2082 atp_writeb_io(dev, 0, 0x18, 0x20);
2083 k = 0; 2083 k = 0;
2084phase_ins1: 2084phase_ins1:
2085 j = inb(wkport + 0x5f); 2085 j = atp_readb_io(dev, 0, 0x1f);
2086 if ((j & 0x01) != 0x00) { 2086 if ((j & 0x01) != 0x00) {
2087 mbuf[k++] = inb(wkport + 0x59); 2087 mbuf[k++] = atp_readb_io(dev, 0, 0x19);
2088 goto phase_ins1; 2088 goto phase_ins1;
2089 } 2089 }
2090 if ((j & 0x80) == 0x00) { 2090 if ((j & 0x80) == 0x00) {
2091 goto phase_ins1; 2091 goto phase_ins1;
2092 } 2092 }
2093 2093
2094 while ((inb(wkport + 0x57) & 0x80) == 0x00) 2094 while ((atp_readb_io(dev, 0, 0x17) & 0x80) == 0x00)
2095 cpu_relax(); 2095 cpu_relax();
2096 2096
2097 j = inb(wkport + 0x57); 2097 j = atp_readb_io(dev, 0, 0x17);
2098 if (j == 0x85) { 2098 if (j == 0x85) {
2099 goto tar_dcons; 2099 goto tar_dcons;
2100 } 2100 }
@@ -2110,15 +2110,15 @@ phase_ins1:
2110 } 2110 }
2111 continue; 2111 continue;
2112phase_cmds: 2112phase_cmds:
2113 outb(0x30, wkport + 0x50); 2113 atp_writeb_io(dev, 0, 0x10, 0x30);
2114tar_dcons: 2114tar_dcons:
2115 outb(0x00, wkport + 0x54); 2115 atp_writeb_io(dev, 0, 0x14, 0x00);
2116 outb(0x08, wkport + 0x58); 2116 atp_writeb_io(dev, 0, 0x18, 0x08);
2117 2117
2118 while ((inb(wkport + 0x5f) & 0x80) == 0x00) 2118 while ((atp_readb_io(dev, 0, 0x1f) & 0x80) == 0x00)
2119 cpu_relax(); 2119 cpu_relax();
2120 2120
2121 j = inb(wkport + 0x57); 2121 j = atp_readb_io(dev, 0, 0x17);
2122 if (j != 0x16) { 2122 if (j != 0x16) {
2123 continue; 2123 continue;
2124 } 2124 }
@@ -2375,7 +2375,7 @@ flash_ok_880:
2375 outb(0x20, base_io + 0x51); 2375 outb(0x20, base_io + 0x51);
2376 2376
2377 tscam(shpnt); 2377 tscam(shpnt);
2378 is880(p, base_io); 2378 is880(p);
2379 outb(0xb0, base_io + 0x38); 2379 outb(0xb0, base_io + 0x38);
2380 shpnt->max_id = 16; 2380 shpnt->max_id = 16;
2381 shpnt->this_id = host_id; 2381 shpnt->this_id = host_id;