Re: Linux on Indy, kernel compile (2.4.14) and xfree ...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 6 Dec 2001, carsten busse -- hladmin wrote:
> next:
> drivers/scsi/scsi_merge.c: In function '__init_io':
> drivers/scsi/scsi_merge.c:946 structure has no member named 'page'
> 
> this is quite natural, the mips-definition in asm/scatterlist.h does not contain this var (but the one in asm-i386)
> so i've commented this one out, too,
> someone needs to put in an #ifdef statement, to determine if we want to compile on mips -> discard the line 

Just add the page field. We did the same on m68k.

> next:
> drivers/scsi/sgiwd93.c:
> in line 59,60 and 61 i inserted a cast to (unsigned long), otherwise the operation was invalid
> in line 102 and 174, the member of the struct is not called "regp" but "regs", and its not (wd33c93_regs *) but (wd33c93_regs)
> in line 293 and 327, the second parameter from wd33c93_init is not from type wd33c93_regs * but wd33c93_regs, so some hacking required

See attached email (from last Oct).

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds
From geert@linux-m68k.org Thu Dec  6 18:48:40 2001
Date: Mon, 29 Oct 2001 10:16:34 +0100 (MET)
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Ralf Baechle <ralf@oss.sgi.com>, Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: [PATCH 2.4.x] wd33c93 SCSI

	Hi Linus,

In 2.4.14-pre2 the generic wd33c93 driver and its users were updated, but one
instance (SGI driver on MIPS) was forgotten.

--- linux-2.4.14-pre2/drivers/scsi/sgiwd93.c	Thu Sep 13 08:30:03 2001
+++ linux-m68k-2.4.13/drivers/scsi/sgiwd93.c	Sat Sep 29 11:47:11 2001
@@ -43,22 +43,23 @@
 struct Scsi_Host *sgiwd93_host1 = NULL;
 
 /* Wuff wuff, wuff, wd33c93.c, wuff wuff, object oriented, bow wow. */
-static inline void write_wd33c93_count(wd33c93_regs *regp, unsigned long value)
+static inline void write_wd33c93_count(const wd33c93_regs regs,
+				       unsigned long value)
 {
-	regp->SASR = WD_TRANSFER_COUNT_MSB;
-	regp->SCMD = ((value >> 16) & 0xff);
-	regp->SCMD = ((value >>  8) & 0xff);
-	regp->SCMD = ((value >>  0) & 0xff);
+	*regs.SASR = WD_TRANSFER_COUNT_MSB;
+	*regs.SCMD = ((value >> 16) & 0xff);
+	*regs.SCMD = ((value >>  8) & 0xff);
+	*regs.SCMD = ((value >>  0) & 0xff);
 }
 
-static inline unsigned long read_wd33c93_count(wd33c93_regs *regp)
+static inline unsigned long read_wd33c93_count(const wd33c93_regs regs)
 {
 	unsigned long value;
 
-	regp->SASR = WD_TRANSFER_COUNT_MSB;
-	value =  ((regp->SCMD & 0xff) << 16);
-	value |= ((regp->SCMD & 0xff) <<  8);
-	value |= ((regp->SCMD & 0xff) <<  0);
+	*regs.SASR = WD_TRANSFER_COUNT_MSB;
+	value =  (*regs.SCMD << 16);
+	value |= (*regs.SCMD <<  8);
+	value |= (*regs.SCMD <<  0);
 	return value;
 }
 
@@ -99,7 +100,7 @@
 static int dma_setup(Scsi_Cmnd *cmd, int datainp)
 {
 	struct WD33C93_hostdata *hdata = (struct WD33C93_hostdata *)cmd->host->hostdata;
-	wd33c93_regs *regp = hdata->regp;
+	const wd33c93_regs regs = hdata->regs;
 	struct hpc3_scsiregs *hregs = (struct hpc3_scsiregs *) cmd->host->base;
 	struct hpc_chunk *hcp = (struct hpc_chunk *) hdata->dma_bounce_buffer;
 
@@ -128,7 +129,7 @@
 		printk(">tlen<%d>", totlen);
 #endif
 		hdata->dma_bounce_len = totlen; /* a trick... */
-		write_wd33c93_count(regp, totlen);
+		write_wd33c93_count(regs, totlen);
 	} else {
 		/* Non-scattered dma. */
 #ifdef DEBUG_DMA
@@ -144,7 +145,7 @@
 		if (cmd->SCp.ptr == NULL)
 			return 1;
 		fill_hpc_entries (&hcp, cmd->SCp.ptr,cmd->SCp.this_residual);
-		write_wd33c93_count(regp, cmd->SCp.this_residual);
+		write_wd33c93_count(regs, cmd->SCp.this_residual);
 	}
 
 	/* To make sure, if we trip an HPC bug, that we transfer
@@ -171,7 +172,7 @@
 		     int status)
 {
 	struct WD33C93_hostdata *hdata = (struct WD33C93_hostdata *)instance->hostdata;
-	wd33c93_regs *regp = hdata->regp;
+	const wd33c93_regs regs = hdata->regs;
 	struct hpc3_scsiregs *hregs;
 
 	if (!SCpnt)
@@ -198,7 +199,7 @@
 
 		/* Yep, we were doing the scatterlist thang. */
 		totlen = hdata->dma_bounce_len;
-		wd93_residual = read_wd33c93_count(regp);
+		wd93_residual = read_wd33c93_count(regs);
 		transferred = totlen - wd93_residual;
 
 #ifdef DEBUG_DMA
@@ -268,6 +269,7 @@
 	struct WD33C93_hostdata *hdata;
 	struct WD33C93_hostdata *hdata1;
 	uchar *buf;
+	wd33c93_regs regs;
 	
 	if(called)
 		return 0; /* Should bitch on the console about this... */
@@ -289,8 +291,9 @@
 	init_hpc_chain(buf);
 	dma_cache_wback_inv((unsigned long) buf, PAGE_SIZE);
 	/* HPC_SCSI_REG0 | 0x03 | KSEG1 */
-	wd33c93_init(sgiwd93_host, (wd33c93_regs *) KSEG1ADDR (0x1fbc0003),
-		     dma_setup, dma_stop, WD33C93_FS_16_20);
+	regs.SASR = (volatile unsigned char *)KSEG1ADDR (0x1fbc0003);
+	regs.SCMD = (volatile unsigned char *)KSEG1ADDR (0x1fbc0007);
+	wd33c93_init(sgiwd93_host, regs, dma_setup, dma_stop, WD33C93_FS_16_20);
 
 	hdata = (struct WD33C93_hostdata *)sgiwd93_host->hostdata;
 	hdata->no_sync = 0;
@@ -323,8 +326,10 @@
 			init_hpc_chain(buf);
 			dma_cache_wback_inv((unsigned long) buf, PAGE_SIZE);
 			/* HPC_SCSI_REG1 | 0x03 | KSEG1 */
-			wd33c93_init(sgiwd93_host1, (wd33c93_regs *) KSEG1ADDR (0x1fbc8003),
-				     dma_setup, dma_stop, WD33C93_FS_16_20);
+			regs.SASR = (volatile unsigned char *)KSEG1ADDR (0x1fbc8003);
+			regs.SCMD = (volatile unsigned char *)KSEG1ADDR (0x1fbc8007);
+			wd33c93_init(sgiwd93_host1, regs, dma_setup, dma_stop,
+				     WD33C93_FS_16_20);
 	
 			hdata1 = (struct WD33C93_hostdata *)sgiwd93_host1->hostdata;
 			hdata1->no_sync = 0;

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux