Commit fa50b308 authored by Ondrej Zary's avatar Ondrej Zary Committed by Martin K. Petersen

atp870u: Move chip-specific lines out of is880() and is885()

Move few chip-specifis lines out of is880() and is885() so they become
almost identical.
Signed-off-by: default avatarOndrej Zary <linux@rainbow-software.org>
Reviewed-by: default avatarHannes Reinicke <hare@suse.de>
Acked-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent bdf8b62d
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
static struct scsi_host_template atp870u_template; static struct scsi_host_template atp870u_template;
static void send_s870(struct atp_unit *dev,unsigned char c); static void send_s870(struct atp_unit *dev,unsigned char c);
static void is885(struct atp_unit *dev, unsigned char c); static void is885(struct atp_unit *dev, unsigned char c, unsigned char lvdmode);
static void tscam_885(void); static void tscam_885(void);
static inline void atp_writeb_base(struct atp_unit *atp, u8 reg, u8 val) static inline void atp_writeb_base(struct atp_unit *atp, u8 reg, u8 val)
...@@ -1596,9 +1596,9 @@ static void is870(struct atp_unit *dev, unsigned char c) ...@@ -1596,9 +1596,9 @@ static void is870(struct atp_unit *dev, unsigned char c)
atp_writeb_io(dev, c, 0x3a, atp_readb_io(dev, c, 0x3a) & 0xef); atp_writeb_io(dev, c, 0x3a, atp_readb_io(dev, c, 0x3a) & 0xef);
} }
static void is880(struct atp_unit *dev, unsigned char c) static void is880(struct atp_unit *dev, unsigned char c, unsigned char lvdmode)
{ {
unsigned char i, j, k, rmb, n, lvdmode; unsigned char i, j, k, rmb, n;
unsigned short int m; unsigned short int m;
static unsigned char mbuf[512]; static unsigned char mbuf[512];
static unsigned char satn[9] = { 0, 0, 0, 0, 0, 0, 0, 6, 6 }; static unsigned char satn[9] = { 0, 0, 0, 0, 0, 0, 0, 6, 6 };
...@@ -1610,8 +1610,6 @@ static void is880(struct atp_unit *dev, unsigned char c) ...@@ -1610,8 +1610,6 @@ static void is880(struct atp_unit *dev, unsigned char c)
static unsigned char wide[6] = { 0x80, 1, 2, 3, 1, 0 }; static unsigned char wide[6] = { 0x80, 1, 2, 3, 1, 0 };
static unsigned char u3[9] = { 0x80, 1, 6, 4, 0x09, 00, 0x0e, 0x01, 0x02 }; static unsigned char u3[9] = { 0x80, 1, 6, 4, 0x09, 00, 0x0e, 0x01, 0x02 };
lvdmode = atp_readb_base(dev, 0x3f) & 0x40;
for (i = 0; i < 16; i++) { for (i = 0; i < 16; i++) {
m = 1; m = 1;
m = m << i; m = m << i;
...@@ -2379,7 +2377,7 @@ static int atp870u_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -2379,7 +2377,7 @@ static int atp870u_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
outb(0x20, base_io + 0x51); outb(0x20, base_io + 0x51);
tscam(shpnt); tscam(shpnt);
is880(p, 0); is880(p, 0, atp_readb_base(p, 0x3f) & 0x40);
outb(0xb0, base_io + 0x38); outb(0xb0, base_io + 0x38);
shpnt->max_id = 16; shpnt->max_id = 16;
shpnt->this_id = host_id; shpnt->this_id = host_id;
...@@ -2525,10 +2523,11 @@ static int atp870u_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -2525,10 +2523,11 @@ static int atp870u_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
tscam_885(); tscam_885();
printk(KERN_INFO " Scanning Channel A SCSI Device ...\n"); printk(KERN_INFO " Scanning Channel A SCSI Device ...\n");
is885(p, 0); is885(p, 0, atp_readb_io(p, 0, 0x1b) >> 7);
atp_writeb_io(p, 0, 0x16, 0x80);
printk(KERN_INFO " Scanning Channel B SCSI Device ...\n"); printk(KERN_INFO " Scanning Channel B SCSI Device ...\n");
is885(p, 1); is885(p, 1, atp_readb_io(p, 1, 0x1b) >> 7);
atp_writeb_io(p, 1, 0x16, 0x80);
k = inb(base_io + 0x28) & 0xcf; k = inb(base_io + 0x28) & 0xcf;
k |= 0xc0; k |= 0xc0;
outb(k, base_io + 0x28); outb(k, base_io + 0x28);
...@@ -2829,9 +2828,9 @@ static void tscam_885(void) ...@@ -2829,9 +2828,9 @@ static void tscam_885(void)
static void is885(struct atp_unit *dev, unsigned char c) static void is885(struct atp_unit *dev, unsigned char c, unsigned char lvdmode)
{ {
unsigned char i, j, k, rmb, n, lvdmode; unsigned char i, j, k, rmb, n;
unsigned short int m; unsigned short int m;
static unsigned char mbuf[512]; static unsigned char mbuf[512];
static unsigned char satn[9] = { 0, 0, 0, 0, 0, 0, 0, 6, 6 }; static unsigned char satn[9] = { 0, 0, 0, 0, 0, 0, 0, 6, 6 };
...@@ -2843,8 +2842,6 @@ static void is885(struct atp_unit *dev, unsigned char c) ...@@ -2843,8 +2842,6 @@ static void is885(struct atp_unit *dev, unsigned char c)
static unsigned char wide[6] = { 0x80, 1, 2, 3, 1, 0 }; static unsigned char wide[6] = { 0x80, 1, 2, 3, 1, 0 };
static unsigned char u3[9] = { 0x80, 1, 6, 4, 0x09, 00, 0x0e, 0x01, 0x02 }; static unsigned char u3[9] = { 0x80, 1, 6, 4, 0x09, 00, 0x0e, 0x01, 0x02 };
lvdmode = atp_readb_io(dev, c, 0x1b) >> 7;
for (i = 0; i < 16; i++) { for (i = 0; i < 16; i++) {
m = 1; m = 1;
m = m << i; m = m << i;
...@@ -3408,7 +3405,6 @@ static void is885(struct atp_unit *dev, unsigned char c) ...@@ -3408,7 +3405,6 @@ static void is885(struct atp_unit *dev, unsigned char c)
printk("dev->id[%2d][%2d].devsp = %2x\n",c,i,dev->id[c][i].devsp); printk("dev->id[%2d][%2d].devsp = %2x\n",c,i,dev->id[c][i].devsp);
#endif #endif
} }
atp_writeb_io(dev, c, 0x16, 0x80);
} }
module_init(atp870u_init); module_init(atp870u_init);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment