Re: 2.3.99-pre3 won't compile ncr53c8xx.c

From: Gérard Roudier (groudier@club-internet.fr)
Date: Wed Mar 29 2000 - 14:44:28 EST


On Wed, 29 Mar 2000, Martin Lucina wrote:

> As the subject says, I get
>
> gcc -D__KERNEL__ -I/usr/src/linux-2.3/include -Wall -Wstrict-prototypes -O2
> -fomit-frame-pointer -fno-strict-aliasing -pipe -mno-fp-regs -ffixed-8
> -mcpu=ev4 -Wa,-mev6 -c -o ncr53c8xx.o ncr53c8xx.c
> ncr53c8xx.c: In function `ncr_script_copy_and_bind':
> ncr53c8xx.c:3004: warning: `new' might be used uninitialized in this
> function
> ncr53c8xx.c: In function `ncr_prepare_setting':
> ncr53c8xx.c:3311: structure has no member named `base_io'
> .. (lots more about base_io)
>
> This is on an AlphaStation 200, Debian 2.1, gcc is egcs-1.1.2.
>
> Can someone please point me to a functional 2.3 kernel that will run on an
> AlphaStation 200 (Avanti)? I would like to integrate my bugfixes and
> patches for tgafb into 2.3.x but I can't do that unless I have a functional
> platform.

Did you try the below patch I sent to the list one week ago ?

:From groudier@club-internet.fr Wed Mar 29 21:11:54 2000
:Date: Thu, 23 Mar 2000 22:38:56 +0100 (CET)
:From: Gérard Roudier <groudier@club-internet.fr>
:To: Sven Koch <haegar@comunit.net>
:Cc: linux-kernel@vger.rutgers.edu, Bjoern Kriews <bkr@cut.de>
:Subject: Re: compilation problem with 2.3.99pre3-6 and ncr53c8xx

On Thu, 23 Mar 2000, Sven Koch wrote:

> hi...
>
> I've ran into a compilation problem with 2.3.99pre3-6 and ncr53c8xx, on an
> Alpha XL-300 with AXP-SuSE 6.3 as the base system:
>
> # make boot
> [...]
> make[3]: Entering directory
> `/usr/local/src/linux-2.3.99-pre3-6/drivers/scsi'
> gcc -D__KERNEL__ -I/usr/local/src/linux-2.3.99-pre3-6/include -Wall
> -Wstrict-proncr53c8xx.c: In function `ncr_prepare_setting':
> ncr53c8xx.c:3311: structure has no member named `base_io'
> ncr53c8xx.c:3312: structure has no member named `base_io'
> ncr53c8xx.c:3313: structure has no member named `base_io'
> ncr53c8xx.c:3314: structure has no member named `base_io'
> [...and MUCH more of these...]
> ncr53c8xx.c:8345: structure has no member named `base_io'
> ncr53c8xx.c:8345: structure has no member named `base_io'
> sym53c8xx_comm.h: At top level:
> sym53c8xx_comm.h:502: warning: `remap_pci_mem' defined but not used
> sym53c8xx_comm.h:511: warning: `unmap_pci_mem' defined but not used
> make[3]: *** [ncr53c8xx.o] Error 1

Damned! I forgot we still use PCI normal IOs for Alpha under Linux.
The warnings should not make problems. For the errors, you may try the
below diffs against my current driver version:

--- linux/drivers/scsi/ncr53c8xx.c.0318 Sun Mar 19 19:26:27 2000
+++ linux/drivers/scsi/ncr53c8xx.c Thu Mar 23 22:27:46 2000
@@ -104,7 +104,7 @@
 /*
 ** Name and version of the driver
 */
-#define SCSI_NCR_DRIVER_NAME "ncr53c8xx - version 3.2g"
+#define SCSI_NCR_DRIVER_NAME "ncr53c8xx - version pre-3.2h-1"
 
 #define SCSI_NCR_DEBUG_FLAGS (0)
 
@@ -1120,7 +1120,7 @@
         u_char revision_id; /* PCI device revision id */
         u_char bus; /* PCI BUS number */
         u_char device_fn; /* PCI BUS device and function */
- u_long port; /* IO space base address */
+ u_long base_io; /* IO space base address */
         u_int irq; /* IRQ level */
         u_int features; /* Chip features map */
         u_char myaddr; /* SCSI id of the adapter */
@@ -3734,7 +3734,7 @@
         */
 
         request_region(device->slot.io_port, 128, "ncr53c8xx");
- np->port = device->slot.io_port;
+ np->base_io = device->slot.io_port;
 
 #ifdef SCSI_NCR_NVRAM_SUPPORT
         if (nvram) {
@@ -3951,11 +3951,11 @@
                 unmap_pci_mem((vm_offset_t) np->vaddr, (u_long) 128);
         }
 #endif /* !NCR_IOMAPPED */
- if (np->port) {
+ if (np->base_io) {
 #ifdef DEBUG_NCR53C8XX
- printk(KERN_DEBUG "%s: releasing IO region %x[%d]\n", ncr_name(np), np->port, 128);
+ printk(KERN_DEBUG "%s: releasing IO region %x[%d]\n", ncr_name(np), np->base_io, 128);
 #endif
- release_region(np->port, 128);
+ release_region(np->base_io, 128);
         }
         if (np->irq) {
 #ifdef DEBUG_NCR53C8XX
@@ -4260,11 +4260,17 @@
         **----------------------------------------------------
         */
 
- segments = ncr_scatter (np, cp, cp->cmd);
-
- if (segments < 0) {
- ncr_free_ccb(np, cp);
- return(DID_ERROR);
+ direction = scsi_data_direction(cmd);
+ if (direction != SCSI_DATA_NONE) {
+ segments = ncr_scatter (np, cp, cp->cmd);
+ if (segments < 0) {
+ ncr_free_ccb(np, cp);
+ return(DID_ERROR);
+ }
+ }
+ else {
+ cp->data_len = 0;
+ segments = 0;
         }
 
         /*----------------------------------------------------
@@ -4275,8 +4281,6 @@
         */
         if (!cp->data_len)
                 direction = SCSI_DATA_NONE;
- else
- direction = scsi_data_direction(cmd);
 
         /*
         ** If data direction is UNKNOWN, speculate DATA_READ
@@ -4796,9 +4800,9 @@
 #endif /* !NCR_IOMAPPED */
 
 #ifdef DEBUG_NCR53C8XX
- printk("%s: releasing IO region %x[%d]\n", ncr_name(np), np->port, 128);
+ printk("%s: releasing IO region %x[%d]\n", ncr_name(np), np->base_io, 128);
 #endif
- release_region(np->port, 128);
+ release_region(np->base_io, 128);
 
         /*
         ** Free allocated ccb(s)
------------ CUT HERE --------------------------------

Gérard.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Mar 31 2000 - 21:00:25 EST