Commit bcd5c59f authored by Hannes Reinecke's avatar Hannes Reinecke Committed by Martin K. Petersen
Browse files
parent 1789671d
Loading
Loading
Loading
Loading
+251 −180
Original line number Diff line number Diff line
@@ -42,7 +42,8 @@

static struct scsi_host_template atp870u_template;
static void send_s870(struct atp_unit *dev,unsigned char c);
static void atp_is(struct atp_unit *dev, unsigned char c, bool wide_chip, unsigned char lvdmode);
static void atp_is(struct atp_unit *dev, unsigned char c, bool wide_chip,
		   unsigned char lvdmode);

static inline void atp_writeb_base(struct atp_unit *atp, u8 reg, u8 val)
{
@@ -145,7 +146,8 @@ static irqreturn_t atp870u_intr_handle(int irq, void *dev_id)
	if (dev->working[c] != 0) {
		if (is885(dev)) {
			if ((atp_readb_io(dev, c, 0x16) & 0x80) == 0)
				atp_writeb_io(dev, c, 0x16, (atp_readb_io(dev, c, 0x16) | 0x80));
				atp_writeb_io(dev, c, 0x16,
					      (atp_readb_io(dev, c, 0x16) | 0x80));
		}
		if ((atp_readb_pci(dev, c, 0x00) & 0x08) != 0)
		{
@@ -192,9 +194,12 @@ static irqreturn_t atp870u_intr_handle(int irq, void *dev_id)
			}
			if (is885(dev)) {
				adrcnt = 0;
				((unsigned char *) &adrcnt)[2] = atp_readb_io(dev, c, 0x12);
				((unsigned char *) &adrcnt)[1] = atp_readb_io(dev, c, 0x13);
				((unsigned char *) &adrcnt)[0] = atp_readb_io(dev, c, 0x14);
				((unsigned char *) &adrcnt)[2] =
					atp_readb_io(dev, c, 0x12);
				((unsigned char *) &adrcnt)[1] =
					atp_readb_io(dev, c, 0x13);
				((unsigned char *) &adrcnt)[0] =
					atp_readb_io(dev, c, 0x14);
				if (dev->id[c][target_id].last_len != adrcnt) {
					k = dev->id[c][target_id].last_len;
					k -= adrcnt;
@@ -202,7 +207,10 @@ static irqreturn_t atp870u_intr_handle(int irq, void *dev_id)
					dev->id[c][target_id].last_len = adrcnt;
				}
#ifdef ED_DBGP
				printk("dev->id[c][target_id].last_len = %d dev->id[c][target_id].tran_len = %d\n",dev->id[c][target_id].last_len,dev->id[c][target_id].tran_len);
				printk("dev->id[c][target_id].last_len = %d "
				       "dev->id[c][target_id].tran_len = %d\n",
				       dev->id[c][target_id].last_len,
				       dev->id[c][target_id].tran_len);
#endif
			}

@@ -218,7 +226,8 @@ static irqreturn_t atp870u_intr_handle(int irq, void *dev_id)
			 *	Issue more commands
			 */
			spin_lock_irqsave(dev->host->host_lock, flags);
			if (((dev->quhd[c] != dev->quend[c]) || (dev->last_cmd[c] != 0xff)) &&
			if (((dev->quhd[c] != dev->quend[c]) ||
			     (dev->last_cmd[c] != 0xff)) &&
			    (dev->in_snd[c] == 0)) {
#ifdef ED_DBGP
				printk("Call sent_s870\n");
@@ -247,9 +256,12 @@ static irqreturn_t atp870u_intr_handle(int irq, void *dev_id)
			   dev->last_cmd[c] = 0xff;
			}
			adrcnt = 0;
			((unsigned char *) &adrcnt)[2] = atp_readb_io(dev, c, 0x12);
			((unsigned char *) &adrcnt)[1] = atp_readb_io(dev, c, 0x13);
			((unsigned char *) &adrcnt)[0] = atp_readb_io(dev, c, 0x14);
			((unsigned char *) &adrcnt)[2] =
				atp_readb_io(dev, c, 0x12);
			((unsigned char *) &adrcnt)[1] =
				atp_readb_io(dev, c, 0x13);
			((unsigned char *) &adrcnt)[0] =
				atp_readb_io(dev, c, 0x14);
			k = dev->id[c][target_id].last_len;
			k -= adrcnt;
			dev->id[c][target_id].tran_len = k;
@@ -267,7 +279,6 @@ static irqreturn_t atp870u_intr_handle(int irq, void *dev_id)
				else
					i=0x49;
			}
			
		}
		if ((i == 0x80) || (i == 0x8f)) {
#ifdef ED_DBGP
@@ -285,9 +296,12 @@ static irqreturn_t atp870u_intr_handle(int irq, void *dev_id)
					printk("cmdp = 0x41\n");
#endif
					adrcnt = 0;
					((unsigned char *) &adrcnt)[2] = atp_readb_io(dev, c, 0x12);
					((unsigned char *) &adrcnt)[1] = atp_readb_io(dev, c, 0x13);
					((unsigned char *) &adrcnt)[0] = atp_readb_io(dev, c, 0x14);
					((unsigned char *) &adrcnt)[2] =
						atp_readb_io(dev, c, 0x12);
					((unsigned char *) &adrcnt)[1] =
						atp_readb_io(dev, c, 0x13);
					((unsigned char *) &adrcnt)[0] =
						atp_readb_io(dev, c, 0x14);
					k = dev->id[c][target_id].last_len;
					k -= adrcnt;
					dev->id[c][target_id].tran_len = k;
@@ -346,7 +360,10 @@ static irqreturn_t atp870u_intr_handle(int irq, void *dev_id)
			atp_writeb_io(dev, c, 0x13, ((unsigned char *) &k)[1]);
			atp_writeb_io(dev, c, 0x14, ((unsigned char *) &k)[0]);
#ifdef ED_DBGP
			printk("k %x, k[0] 0x%x k[1] 0x%x k[2] 0x%x\n", k, atp_readb_io(dev, c, 0x14), atp_readb_io(dev, c, 0x13), atp_readb_io(dev, c, 0x12));
			printk("k %x, k[0] 0x%x k[1] 0x%x k[2] 0x%x\n", k,
			       atp_readb_io(dev, c, 0x14),
			       atp_readb_io(dev, c, 0x13),
			       atp_readb_io(dev, c, 0x12));
#endif
			/* Remap wide */
			j = target_id;
@@ -362,20 +379,33 @@ static irqreturn_t atp870u_intr_handle(int irq, void *dev_id)
			if (is885(dev)) {
				i = atp_readb_pci(dev, c, 1) & 0xf3;
				//j=workreq->cmnd[0];
				if ((workreq->cmnd[0] == 0x08) || (workreq->cmnd[0] == 0x28) || (workreq->cmnd[0] == 0x0a) || (workreq->cmnd[0] == 0x2a)) {
				if ((workreq->cmnd[0] == 0x08) ||
				    (workreq->cmnd[0] == 0x28) ||
				    (workreq->cmnd[0] == 0x0a) ||
				    (workreq->cmnd[0] == 0x2a)) {
				   i |= 0x0c;
				}
				atp_writeb_pci(dev, c, 1, i);
			} else if (is880(dev)) {
				if ((workreq->cmnd[0] == 0x08) || (workreq->cmnd[0] == 0x28) || (workreq->cmnd[0] == 0x0a) || (workreq->cmnd[0] == 0x2a))
					atp_writeb_base(dev, 0x3b, (atp_readb_base(dev, 0x3b) & 0x3f) | 0xc0);
				if ((workreq->cmnd[0] == 0x08) ||
				    (workreq->cmnd[0] == 0x28) ||
				    (workreq->cmnd[0] == 0x0a) ||
				    (workreq->cmnd[0] == 0x2a))
					atp_writeb_base(dev, 0x3b,
							(atp_readb_base(dev, 0x3b) & 0x3f) | 0xc0);
				else
					atp_writeb_base(dev, 0x3b, atp_readb_base(dev, 0x3b) & 0x3f);
					atp_writeb_base(dev, 0x3b,
							atp_readb_base(dev, 0x3b) & 0x3f);
			} else {
				if ((workreq->cmnd[0] == 0x08) || (workreq->cmnd[0] == 0x28) || (workreq->cmnd[0] == 0x0a) || (workreq->cmnd[0] == 0x2a))
					atp_writeb_base(dev, 0x3a, (atp_readb_base(dev, 0x3a) & 0xf3) | 0x08);
				if ((workreq->cmnd[0] == 0x08) ||
				    (workreq->cmnd[0] == 0x28) ||
				    (workreq->cmnd[0] == 0x0a) ||
				    (workreq->cmnd[0] == 0x2a))
					atp_writeb_base(dev, 0x3a,
							(atp_readb_base(dev, 0x3a) & 0xf3) | 0x08);
				else
					atp_writeb_base(dev, 0x3a, atp_readb_base(dev, 0x3a) & 0xf3);
					atp_writeb_base(dev, 0x3a,
							atp_readb_base(dev, 0x3a) & 0xf3);
			}
			j = 0;
			id = 1;
@@ -409,8 +439,8 @@ static irqreturn_t atp870u_intr_handle(int irq, void *dev_id)
					k = id;
				}
				if (k > adrcnt) {
					((unsigned short int *)prd)[2] = (unsigned short int)
					    (k - adrcnt);
					((unsigned short int *)prd)[2] =
						(unsigned short int)(k - adrcnt);
					((unsigned long *)prd)[0] += adrcnt;
					adrcnt = 0;
					dev->id[c][target_id].prd_pos = prd;
@@ -425,7 +455,8 @@ static irqreturn_t atp870u_intr_handle(int irq, void *dev_id)
			}
			atp_writel_pci(dev, c, 0x04, dev->id[c][target_id].prdaddr);
#ifdef ED_DBGP
			printk("dev->id[%d][%d].prdaddr 0x%8x\n", c, target_id, dev->id[c][target_id].prdaddr);
			printk("dev->id[%d][%d].prdaddr 0x%8x\n",
			       c, target_id, dev->id[c][target_id].prdaddr);
#endif
			if (!is885(dev)) {
				atp_writeb_pci(dev, c, 2, 0x06);
@@ -503,7 +534,8 @@ static irqreturn_t atp870u_intr_handle(int irq, void *dev_id)
			 *	If there is stuff to send and nothing going then send it
			 */
			spin_lock_irqsave(dev->host->host_lock, flags);
			if (((dev->last_cmd[c] != 0xff) || (dev->quhd[c] != dev->quend[c])) &&
			if (((dev->last_cmd[c] != 0xff) ||
			     (dev->quhd[c] != dev->quend[c])) &&
			    (dev->in_snd[c] == 0)) {
#ifdef ED_DBGP
			   printk("Call sent_s870(scsi_done)\n");
@@ -528,9 +560,12 @@ static irqreturn_t atp870u_intr_handle(int irq, void *dev_id)
			atp_writeb_io(dev, c, 0x10, 0x41);
			if (is885(dev)) {
				k = dev->id[c][target_id].last_len;
				atp_writeb_io(dev, c, 0x12, ((unsigned char *) (&k))[2]);
				atp_writeb_io(dev, c, 0x13, ((unsigned char *) (&k))[1]);
				atp_writeb_io(dev, c, 0x14, ((unsigned char *) (&k))[0]);
				atp_writeb_io(dev, c, 0x12,
					      ((unsigned char *) (&k))[2]);
				atp_writeb_io(dev, c, 0x13,
					      ((unsigned char *) (&k))[1]);
				atp_writeb_io(dev, c, 0x14,
					      ((unsigned char *) (&k))[0]);
				dev->id[c][target_id].dirct = 0x00;
			} else {
				dev->id[c][target_id].dirct = 0x00;
@@ -547,11 +582,15 @@ static irqreturn_t atp870u_intr_handle(int irq, void *dev_id)
			atp_writeb_io(dev, c, 0x10, 0x41);
			if (is885(dev)) {
				k = dev->id[c][target_id].last_len;
				atp_writeb_io(dev, c, 0x12, ((unsigned char *) (&k))[2]);
				atp_writeb_io(dev, c, 0x13, ((unsigned char *) (&k))[1]);
				atp_writeb_io(dev, c, 0x14, ((unsigned char *) (&k))[0]);
			}
			atp_writeb_io(dev, c, 0x15, atp_readb_io(dev, c, 0x15) | 0x20);
				atp_writeb_io(dev, c, 0x12,
					      ((unsigned char *) (&k))[2]);
				atp_writeb_io(dev, c, 0x13,
					      ((unsigned char *) (&k))[1]);
				atp_writeb_io(dev, c, 0x14,
					      ((unsigned char *) (&k))[0]);
			}
			atp_writeb_io(dev, c, 0x15,
				      atp_readb_io(dev, c, 0x15) | 0x20);
			dev->id[c][target_id].dirct = 0x20;
			atp_writeb_io(dev, c, 0x18, 0x08);
			atp_writeb_pci(dev, c, 0, 0x01);
@@ -602,8 +641,6 @@ static int atp870u_queuecommand_lck(struct scsi_cmnd *req_p,
	host = req_p->device->host;
	dev = (struct atp_unit *)&host->hostdata;


		
	m = 1;
	m = m << scmd_id(req_p);

@@ -653,9 +690,14 @@ static int atp870u_queuecommand_lck(struct scsi_cmnd *req_p,
	}
	dev->quereq[c][dev->quend[c]] = req_p;
#ifdef ED_DBGP
	printk("dev->ioport[c] = %x atp_readb_io(dev, c, 0x1c) = %x dev->in_int[%d] = %d dev->in_snd[%d] = %d\n",dev->ioport[c],atp_readb_io(dev, c, 0x1c),c,dev->in_int[c],c,dev->in_snd[c]);
	printk("dev->ioport[c] = %x atp_readb_io(dev, c, 0x1c) = %x "
	       "dev->in_int[%d] = %d dev->in_snd[%d] = %d\n",
	       dev->ioport[c], atp_readb_io(dev, c, 0x1c), c,
	       dev->in_int[c],c,dev->in_snd[c]);
#endif
	if ((atp_readb_io(dev, c, 0x1c) == 0) && (dev->in_int[c] == 0) && (dev->in_snd[c] == 0)) {
	if ((atp_readb_io(dev, c, 0x1c) == 0) &&
	    (dev->in_int[c] == 0) &&
	    (dev->in_snd[c] == 0)) {
#ifdef ED_DBGP
		printk("Call sent_s870(atp870u_queuecommand)\n");
#endif
@@ -729,7 +771,8 @@ static void send_s870(struct atp_unit *dev,unsigned char c)
		dev->id[c][scmd_id(workreq)].curr_req = workreq;
		dev->last_cmd[c] = scmd_id(workreq);
	}
	if ((atp_readb_io(dev, c, 0x1f) & 0xb0) != 0 || atp_readb_io(dev, c, 0x1c) != 0) {
	if ((atp_readb_io(dev, c, 0x1f) & 0xb0) != 0 ||
	    atp_readb_io(dev, c, 0x1c) != 0) {
#ifdef ED_DBGP
		printk("Abort to Send\n");
#endif
@@ -797,7 +840,8 @@ static void send_s870(struct atp_unit *dev,unsigned char c)
	 */
	atp_writeb_io(dev, c, 0x11, dev->id[c][target_id].devsp);
#ifdef ED_DBGP
	printk("dev->id[%d][%d].devsp = %2x\n",c,target_id,dev->id[c][target_id].devsp);
	printk("dev->id[%d][%d].devsp = %2x\n",c,target_id,
	       dev->id[c][target_id].devsp);
#endif

	sg_count = scsi_dma_map(workreq);
@@ -872,12 +916,17 @@ static void send_s870(struct atp_unit *dev,unsigned char c)
		}
		(((u16 *) (prd))[i - 1]) = cpu_to_le16(0x8000);
#ifdef ED_DBGP
		printk("prd %4x %4x %4x %4x\n",(((unsigned short int *)prd)[0]),(((unsigned short int *)prd)[1]),(((unsigned short int *)prd)[2]),(((unsigned short int *)prd)[3]));
		printk("prd %4x %4x %4x %4x\n",
		       (((unsigned short int *)prd)[0]),
		       (((unsigned short int *)prd)[1]),
		       (((unsigned short int *)prd)[2]),
		       (((unsigned short int *)prd)[3]));
		printk("2. bttl %x, l %x\n",bttl, l);
#endif
	}
#ifdef ED_DBGP
	printk("send_s870: prdaddr_2 0x%8x target_id %d\n", dev->id[c][target_id].prdaddr,target_id);
	printk("send_s870: prdaddr_2 0x%8x target_id %d\n",
	       dev->id[c][target_id].prdaddr,target_id);
#endif
	dev->id[c][target_id].prdaddr = dev->id[c][target_id].prd_bus;
	atp_writel_pci(dev, c, 4, dev->id[c][target_id].prdaddr);
@@ -891,15 +940,21 @@ static void send_s870(struct atp_unit *dev,unsigned char c)
		}
		atp_writeb_pci(dev, c, 1, j);
	} else if (is880(dev)) {
		if ((workreq->cmnd[0] == 0x08) || (workreq->cmnd[0] == 0x28) || (workreq->cmnd[0] == 0x0a) || (workreq->cmnd[0] == 0x2a))
			atp_writeb_base(dev, 0x3b, (atp_readb_base(dev, 0x3b) & 0x3f) | 0xc0);
		if ((workreq->cmnd[0] == 0x08) || (workreq->cmnd[0] == 0x28) ||
		    (workreq->cmnd[0] == 0x0a) || (workreq->cmnd[0] == 0x2a))
			atp_writeb_base(dev, 0x3b,
					(atp_readb_base(dev, 0x3b) & 0x3f) | 0xc0);
		else
			atp_writeb_base(dev, 0x3b, atp_readb_base(dev, 0x3b) & 0x3f);
			atp_writeb_base(dev, 0x3b,
					atp_readb_base(dev, 0x3b) & 0x3f);
	} else {
		if ((workreq->cmnd[0] == 0x08) || (workreq->cmnd[0] == 0x28) || (workreq->cmnd[0] == 0x0a) || (workreq->cmnd[0] == 0x2a))
			atp_writeb_base(dev, 0x3a, (atp_readb_base(dev, 0x3a) & 0xf3) | 0x08);
		if ((workreq->cmnd[0] == 0x08) || (workreq->cmnd[0] == 0x28) ||
		    (workreq->cmnd[0] == 0x0a) || (workreq->cmnd[0] == 0x2a))
			atp_writeb_base(dev, 0x3a,
					(atp_readb_base(dev, 0x3a) & 0xf3) | 0x08);
		else
			atp_writeb_base(dev, 0x3a, atp_readb_base(dev, 0x3a) & 0xf3);
			atp_writeb_base(dev, 0x3a,
					atp_readb_base(dev, 0x3a) & 0xf3);
	}

	if(workreq->sc_data_direction == DMA_TO_DEVICE) {
@@ -1193,7 +1248,9 @@ static void atp870u_free_tables(struct Scsi_Host *host)
		for (k = 0; k < 16; k++) {
			if (!atp_dev->id[j][k].prd_table)
				continue;
			dma_free_coherent(&atp_dev->pdev->dev, 1024, atp_dev->id[j][k].prd_table, atp_dev->id[j][k].prd_bus);
			dma_free_coherent(&atp_dev->pdev->dev, 1024,
					  atp_dev->id[j][k].prd_table,
					  atp_dev->id[j][k].prd_bus);
			atp_dev->id[j][k].prd_table = NULL;
		}
	}
@@ -1205,7 +1262,10 @@ static int atp870u_init_tables(struct Scsi_Host *host)
	int c,k;
	for(c=0;c < 2;c++) {
		for(k=0;k<16;k++) {
				atp_dev->id[c][k].prd_table = dma_alloc_coherent(&atp_dev->pdev->dev, 1024, &(atp_dev->id[c][k].prd_bus), GFP_KERNEL);
			atp_dev->id[c][k].prd_table =
				dma_alloc_coherent(&atp_dev->pdev->dev, 1024,
						   &(atp_dev->id[c][k].prd_bus),
						   GFP_KERNEL);
			if (!atp_dev->id[c][k].prd_table) {
				printk("atp870u_init_tables fail\n");
				atp870u_free_tables(host);
@@ -1263,7 +1323,8 @@ static void atp870_init(struct Scsi_Host *shpnt)

	pci_read_config_byte(pdev, 0x49, &host_id);

	dev_info(&pdev->dev, "ACARD AEC-671X PCI Ultra/W SCSI-2/3 Host Adapter: IO:%lx, IRQ:%d.\n",
	dev_info(&pdev->dev, "ACARD AEC-671X PCI Ultra/W SCSI-2/3 "
		 "Host Adapter: IO:%lx, IRQ:%d.\n",
		 shpnt->io_port, shpnt->irq);

	atpdev->ioport[0] = shpnt->io_port;
@@ -1314,7 +1375,8 @@ static void atp880_init(struct Scsi_Host *shpnt)

	host_id = atp_readb_base(atpdev, 0x39) >> 4;

	dev_info(&pdev->dev, "ACARD AEC-67160 PCI Ultra3 LVD Host Adapter: IO:%lx, IRQ:%d.\n",
	dev_info(&pdev->dev, "ACARD AEC-67160 PCI Ultra3 LVD "
		 "Host Adapter: IO:%lx, IRQ:%d.\n",
		 shpnt->io_port, shpnt->irq);
	atpdev->host_id[0] = host_id;

@@ -1393,7 +1455,8 @@ static void atp885_init(struct Scsi_Host *shpnt)
	unsigned int n;
	unsigned char setupdata[2][16];

	dev_info(&pdev->dev, "ACARD AEC-67162 PCI Ultra3 LVD Host Adapter: IO:%lx, IRQ:%d.\n",
	dev_info(&pdev->dev, "ACARD AEC-67162 PCI Ultra3 LVD "
		 "Host Adapter: IO:%lx, IRQ:%d.\n",
		 shpnt->io_port, shpnt->irq);

	atpdev->ioport[0] = shpnt->io_port + 0x80;
@@ -1413,11 +1476,13 @@ static void atp885_init(struct Scsi_Host *shpnt)
			atpdev->global_map[m] = 0;
			for (k = 0; k < 4; k++) {
				atp_writew_base(atpdev, 0x3c, n++);
				((u32 *)&setupdata[m][0])[k] = atp_readl_base(atpdev, 0x38);
				((u32 *)&setupdata[m][0])[k] =
					atp_readl_base(atpdev, 0x38);
			}
			for (k = 0; k < 4; k++) {
				atp_writew_base(atpdev, 0x3c, n++);
				((u32 *)&atpdev->sp[m][0])[k] = atp_readl_base(atpdev, 0x38);
				((u32 *)&atpdev->sp[m][0])[k] =
					atp_readl_base(atpdev, 0x38);
			}
			n += 8;
		}
@@ -1659,7 +1724,6 @@ static void atp870u_remove (struct pci_dev *pdev)
	struct atp_unit *devext = pci_get_drvdata(pdev);
	struct Scsi_Host *pshost = devext->host;

	
	scsi_remove_host(pshost);
	free_irq(pshost->irq, pshost);
	pci_release_regions(pdev);
@@ -1709,7 +1773,8 @@ static struct pci_driver atp870u_driver = {

module_pci_driver(atp870u_driver);

static void atp_is(struct atp_unit *dev, unsigned char c, bool wide_chip, unsigned char lvdmode)
static void atp_is(struct atp_unit *dev, unsigned char c, bool wide_chip,
		   unsigned char lvdmode)
{
	unsigned char i, j, k, rmb, n;
	unsigned short int m;
@@ -1983,7 +2048,8 @@ static void atp_is(struct atp_unit *dev, unsigned char c, bool wide_chip, unsign
			dev->wide_id[c] |= m;
			dev->id[c][i].devsp = 0xce;
#ifdef ED_DBGP
			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
			continue;
		}
@@ -2005,7 +2071,8 @@ static void atp_is(struct atp_unit *dev, unsigned char c, bool wide_chip, unsign
		while ((atp_readb_io(dev, c, 0x1f) & 0x80) == 0x00)
			cpu_relax();

		if (atp_readb_io(dev, c, 0x17) != 0x11 && atp_readb_io(dev, c, 0x17) != 0x8e)
		if (atp_readb_io(dev, c, 0x17) != 0x11 &&
		    atp_readb_io(dev, c, 0x17) != 0x8e)
			continue;

		while (atp_readb_io(dev, c, 0x17) != 0x8e)
@@ -2109,7 +2176,9 @@ static void atp_is(struct atp_unit *dev, unsigned char c, bool wide_chip, unsign
		m = m << i;
		dev->wide_id[c] |= m;
not_wide:
		if ((dev->id[c][i].devtype == 0x00) || (dev->id[c][i].devtype == 0x07) || ((dev->id[c][i].devtype == 0x05) && ((n & 0x10) != 0))) {
		if ((dev->id[c][i].devtype == 0x00) ||
		    (dev->id[c][i].devtype == 0x07) ||
		    ((dev->id[c][i].devtype == 0x05) && ((n & 0x10) != 0))) {
			m = 1;
			m = m << i;
			if ((dev->async[c] & m) != 0) {
@@ -2148,7 +2217,8 @@ static void atp_is(struct atp_unit *dev, unsigned char c, bool wide_chip, unsign
		while ((atp_readb_io(dev, c, 0x1f) & 0x80) == 0x00)
			cpu_relax();

		if (atp_readb_io(dev, c, 0x17) != 0x11 && atp_readb_io(dev, c, 0x17) != 0x8e)
		if (atp_readb_io(dev, c, 0x17) != 0x11 &&
		    atp_readb_io(dev, c, 0x17) != 0x8e)
			continue;

		while (atp_readb_io(dev, c, 0x17) != 0x8e)
@@ -2310,7 +2380,8 @@ static void atp_is(struct atp_unit *dev, unsigned char c, bool wide_chip, unsign
set_syn_ok:
		dev->id[c][i].devsp = (dev->id[c][i].devsp & 0x0f) | j;
#ifdef ED_DBGP
		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
	}
}
+7 −7

File changed.

Contains only whitespace changes.