Meaning of CONFIG_* and [PATCH] 3c509 and modular ISAPnP

From: Petr Vandrovec (vandrove@vc.cvut.cz)
Date: Thu Apr 06 2000 - 12:24:05 EST


Hi Linus, hi others,
  could you apply this patch to 3c509 driver in 2.3.99-pre4-pre4?
Without that modular 3c509 does not understand modular ISAPNP.
  So please apply this, isapnp.h defines __ISAPNP__ just if
CONFIG_ISAPNP || (CONFIG_ISAPNP_MODULE && MODULE).
  But I have one question - I was always under impression that
if I have two modularizable things, say ABC and DEF, then I can
simple check CONFIG_ABC in DEF driver and it will be defined if
either ABC is in kernel or if both ABC and DEF are modules.
  Is it no longer true or it was never true? At least CONFIG_ISAPNP
in drivers/net/3c515.c suffered from same thing, so this patch
is attached too.
                                        Thanks,
                                                Petr Vandrovec
                                                vandrove@vc.cvut.cz

diff -ur linux/drivers/net/3c509.c linux/drivers/net/3c509.c
--- linux/drivers/net/3c509.c Tue Mar 21 23:43:39 2000
+++ linux/drivers/net/3c509.c Thu Apr 6 18:56:24 2000
@@ -168,7 +168,7 @@
 };
 #endif
 
-#ifdef CONFIG_ISAPNP
+#ifdef __ISAPNP__
 struct el3_isapnp_adapters_struct {
         unsigned short vendor, function;
         char *name;
@@ -187,7 +187,7 @@
         {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}
 };
 #endif /* CONFIG_ISAPNP */
-#if defined(CONFIG_ISAPNP) || defined(MODULE)
+#if defined(__ISAPNP__) || defined(MODULE)
 static int nopnp = 0;
 #endif
 
@@ -198,7 +198,7 @@
         u16 phys_addr[3];
         static int current_tag = 0;
         int mca_slot = -1;
-#ifdef CONFIG_ISAPNP
+#ifdef __ISAPNP__
         static int pnp_cards = 0;
 #endif
 
@@ -294,7 +294,7 @@
         }
 #endif
 
-#ifdef CONFIG_ISAPNP
+#ifdef __ISAPNP__
         if (nopnp == 1)
                 goto no_pnp;
 
@@ -376,7 +376,7 @@
                 phys_addr[i] = htons(id_read_eeprom(i));
         }
 
-#ifdef CONFIG_ISAPNP
+#ifdef __ISAPNP__
         if (nopnp == 0) {
                 /* The ISA PnP 3c509 cards respond to the ID sequence.
                    This check is needed in order not to register them twice. */
diff -ur linux/drivers/net/3c515.c linux/drivers/net/3c515.c
--- linux/drivers/net/3c515.c Tue Mar 21 23:43:39 2000
+++ linux/drivers/net/3c515.c Thu Apr 6 19:20:46 2000
@@ -353,7 +353,7 @@
         { "Default", 0, 0xFF, XCVR_10baseT, 10000},
 };
 
-#ifdef CONFIG_ISAPNP
+#ifdef __ISAPNP__
 struct corkscrew_isapnp_adapters_struct {
         unsigned short vendor, function;
         char *name;
@@ -445,7 +445,7 @@
         static int ioaddr;
         static int pnp_cards = 0;
 
-#ifdef CONFIG_ISAPNP
+#ifdef __ISAPNP__
         if(nopnp == 1)
                 goto no_pnp;
         for(i=0; corkscrew_isapnp_adapters[i].vendor != 0; i++) {
@@ -503,12 +503,12 @@
                 }
         }
 no_pnp:
-#endif /* not CONFIG_ISAPNP */
+#endif /* not __ISAPNP__ */
 
         /* Check all locations on the ISA bus -- evil! */
         for (ioaddr = 0x100; ioaddr < 0x400; ioaddr += 0x20) {
                 int irq;
-#ifdef CONFIG_ISAPNP
+#ifdef __ISAPNP__
                 /* Make sure this was not already picked up by isapnp */
                 if(ioaddr == corkscrew_isapnp_phys_addr[0]) continue;
                 if(ioaddr == corkscrew_isapnp_phys_addr[1]) continue;

-
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 Apr 07 2000 - 21:00:17 EST