[patch] RFC: Namespace-collision between SIM710 and 53C7,8XX

Arjan van de Ven (arjan@fenrus.demon.nl)
Sun, 17 Oct 1999 16:25:35 +0200 (CEST)


Hi,

The SIM710 and 53C7,8XX scsi-drivers have a very bad case of
namespace-collision. The following patch at least lets the drivers
compile, but the change is rather big to do without someone testing it.
Could you (anyone?) give feedback on the patch below?
(patch against 2.3.22)

Greetings,
Arjan van de Ven

diff -u -r linux2322_clean/drivers/scsi/sim710.c linux/drivers/scsi/sim710.c
--- linux2322_clean/drivers/scsi/sim710.c Sat Oct 16 14:17:02 1999
+++ linux/drivers/scsi/sim710.c Sun Oct 17 16:26:30 1999
@@ -58,7 +58,9 @@
*
*/

+#ifndef LinuxVersionCode
#define LinuxVersionCode(v, p, s) (((v)<<16)+((p)<<8)+(s))
+#endif

#include <linux/module.h>

@@ -280,7 +282,7 @@
u8 dsa_status[MAX_STATUS];
} target[8];

- u32 script[sizeof(SCRIPT)/4] __attribute__ ((aligned (4)));
+ u32 script[sizeof(SCRIPT710)/4] __attribute__ ((aligned (4)));
};


@@ -564,10 +566,10 @@
int i;

hostdata->running = NULL;
- memcpy (hostdata->script, SCRIPT, sizeof(SCRIPT));
- for (i = 0; i < PATCHES; i++)
- hostdata->script[LABELPATCHES[i]] += virt_to_bus(hostdata->script);
- patch_abs_32 (hostdata->script, 0, reselected_identify,
+ memcpy (hostdata->script, SCRIPT710, sizeof(SCRIPT710));
+ for (i = 0; i < PATCHES710; i++)
+ hostdata->script[LABELPATCHES710[i]] += virt_to_bus(hostdata->script);
+ patch_abs_32 (hostdata->script, 0, reselected_identify710,
virt_to_bus((void *)&(hostdata->reselected_identify)));
patch_abs_32 (hostdata->script, 0, msgin_buf,
virt_to_bus((void *)&(hostdata->msgin_buf[0])));
diff -u -r linux2322_clean/drivers/scsi/sim710_d.h linux/drivers/scsi/sim710_d.h
--- linux2322_clean/drivers/scsi/sim710_d.h Sat Oct 16 14:17:02 1999
+++ linux/drivers/scsi/sim710_d.h Sun Oct 17 16:26:22 1999
@@ -1,4 +1,4 @@
-u32 SCRIPT[] = {
+u32 SCRIPT710[] = {
/*


@@ -15,7 +15,7 @@
ABSOLUTE dsa_dataout = 1064
ABSOLUTE dsa_size = 2088

-ABSOLUTE reselected_identify = 0
+ABSOLUTE reselected_identify710 = 0
ABSOLUTE msgin_buf = 0


@@ -1725,7 +1725,7 @@

at 0x00000316 : */ 0x9f030000,0xab930016,
/*
- MOVE 1, reselected_identify, WHEN MSG_IN
+ MOVE 1, reselected_identify710, WHEN MSG_IN

at 0x00000318 : */ 0x0f000001,0x00000000,
/*
@@ -1776,12 +1776,12 @@
};

#define A_dsa_cmnd 0x00000010
-u32 A_dsa_cmnd_used[] = {
+u32 A_dsa_cmnd_used710[] = {
0x0000001d,
};

#define A_dsa_datain 0x00000028
-u32 A_dsa_datain_used[] = {
+u32 A_dsa_datain_used710[] = {
0x0000003d,
0x0000003f,
0x00000041,
@@ -1913,7 +1913,7 @@
};

#define A_dsa_dataout 0x00000428
-u32 A_dsa_dataout_used[] = {
+u32 A_dsa_dataout_used710[] = {
0x00000143,
0x00000145,
0x00000147,
@@ -2045,12 +2045,12 @@
};

#define A_dsa_msgin 0x00000020
-u32 A_dsa_msgin_used[] = {
+u32 A_dsa_msgin_used710[] = {
0x0000002f,
};

#define A_dsa_msgout 0x00000008
-u32 A_dsa_msgout_used[] = {
+u32 A_dsa_msgout_used710[] = {
0x00000013,
0x00000285,
0x000002c5,
@@ -2058,21 +2058,21 @@
};

#define A_dsa_select 0x00000000
-u32 A_dsa_select_used[] = {
+u32 A_dsa_select_used710[] = {
0x00000006,
};

#define A_dsa_size 0x00000828
-u32 A_dsa_size_used[] = {
+u32 A_dsa_size_used710[] = {
};

#define A_dsa_status 0x00000018
-u32 A_dsa_status_used[] = {
+u32 A_dsa_status_used710[] = {
0x0000002b,
};

#define A_had_cmdout 0x00000004
-u32 A_had_cmdout_used[] = {
+u32 A_had_cmdout_used710[] = {
0x0000001a,
};

@@ -2279,8 +2279,8 @@
0x0000030b,
};

-#define A_reselected_identify 0x00000000
-u32 A_reselected_identify_used[] = {
+#define A_reselected_identify710 0x00000000
+u32 A_reselected_identify710_used[] = {
0x00000319,
};

@@ -2304,7 +2304,7 @@
#define Ent_wait_disc2 0x00000ad0
#define Ent_wait_disc3 0x00000bd0
#define Ent_wait_disc_complete 0x000000d0
-u32 LABELPATCHES[] = {
+u32 LABELPATCHES710[] = {
0x00000007,
0x00000009,
0x00000015,
@@ -2352,9 +2352,9 @@
struct {
u32 offset;
void *address;
-} EXTERNAL_PATCHES[] = {
+} EXTERNAL_PATCHES710[] = {
};

-u32 INSTRUCTIONS = 407;
-u32 PATCHES = 42;
-u32 EXTERNAL_PATCHES_LEN = 0;
+u32 INSTRUCTIONS710 = 407;
+u32 PATCHES710 = 42;
+u32 EXTERNAL_PATCHES_LEN710 = 0;

-
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/