Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 07 Jan 2001 05:33:46 -0800
From:      Peter Wemm <peter@netplex.com.au>
To:        Warner Losh <imp@FreeBSD.org>
Cc:        cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/dev/pccard card_if.m pccard.c src/sys/dev/pccbb pccbb.c 
Message-ID:  <200101071333.f07DXlt11106@mobile.wemm.org>
In-Reply-To: <200101070808.f0788tW31080@freefall.freebsd.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
Warner Losh wrote:
> imp         2001/01/07 00:08:54 PST
> 
>   Modified files:
>     sys/dev/pccard       card_if.m pccard.c 
>     sys/dev/pccbb        pccbb.c 
>   Log:
>   Undo the interface change to CARD_GET_MEMORY_OFFSET.  It wasn't tested
>   by even a compile of the OLDCARD code, was unapproved by me the keeper
>   of OLDCARD and broke OLDCARD and the ray driver.
>   
>   Adjust new code to cope with the older interface.

But this is incomplete and cannot work. :-(  You are calling methods that
do not exist.  (there is no CARD_GET_MEMORY_OFFSET() in pccbb yet).

For what it is worth, this is all that would have been required to get
ray and oldcard to work without breaking newcard:

Index: dev/ray/if_ray.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/ray/if_ray.c,v
retrieving revision 1.47
diff -u -2 -r1.47 if_ray.c
--- dev/ray/if_ray.c	2001/01/02 20:29:25	1.47
+++ dev/ray/if_ray.c	2001/01/07 13:06:41
@@ -3367,5 +3367,5 @@
 		    offset);
 		error = CARD_SET_MEMORY_OFFSET(device_get_parent(sc->dev),
-		    sc->dev, sc->am_rid, 0);
+		    sc->dev, sc->am_rid, 0, NULL);
 		if (error) {
 			RAY_PRINTF(sc, "CARD_SET_MEMORY_OFFSET returned 0x%0x",
@@ -3455,5 +3455,5 @@
 		    offset);
 		error = CARD_SET_MEMORY_OFFSET(device_get_parent(sc->dev),
-		    sc->dev, sc->cm_rid, 0);
+		    sc->dev, sc->cm_rid, 0, NULL);
 		if (error) {
 			RAY_PRINTF(sc, "CARD_SET_MEMORY_OFFSET returned 0x%0x",
Index: pccard/pccard_nbk.c
===================================================================
RCS file: /home/ncvs/src/sys/pccard/pccard_nbk.c,v
retrieving revision 1.23
diff -u -2 -r1.23 pccard_nbk.c
--- pccard/pccard_nbk.c	2000/09/28 07:22:30	1.23
+++ pccard/pccard_nbk.c	2001/01/07 13:08:00
@@ -306,8 +306,8 @@
 static int
 pccard_set_memory_offset(device_t bus, device_t child, int rid, 
-    u_int32_t offset)
+    u_int32_t offset, u_int32_t *offsetp)
 {
 	return CARD_SET_MEMORY_OFFSET(device_get_parent(bus), child, rid,
-	    offset);
+	    offset, offsetp);
 }
 
Index: pccard/pcic.c
===================================================================
RCS file: /home/ncvs/src/sys/pccard/pcic.c,v
retrieving revision 1.100
diff -u -2 -r1.100 pcic.c
--- pccard/pcic.c	2000/12/11 15:02:50	1.100
+++ pccard/pcic.c	2001/01/07 13:08:27
@@ -978,5 +978,6 @@
 
 static int
-pcic_set_memory_offset(device_t bus, device_t child, int rid, u_int32_t offset)
+pcic_set_memory_offset(device_t bus, device_t child, int rid, u_int32_t offset,
+    u_int32_t *offsetp)
 {
 	struct pccard_devinfo *devi = device_get_ivars(child);
@@ -984,4 +985,6 @@
 
 	mp->card = offset;
+	if (offsetp)
+		*offsetp = offset;
 
 	return (pcic_memory(devi->slt, rid));

This is pretty trivial and is essentially a NOP for the existing drivers.

Anyway, I am running just happily with this commit backed out and
with the above patch.  All of the modules and drivers compile.

pccbb0: <RF5C478 PCI-CardBus Bridge> at device 12.0 on pci0
cardbus0: <Cardbus bus (newcard)> on pccbb0
pccard0: <16-bit PCCard bus> on pccbb0
pccbb1: <RF5C478 PCI-CardBus Bridge> at device 12.1 on pci0
cardbus1: <Cardbus bus (newcard)> on pccbb1
pccard1: <16-bit PCCard bus> on pccbb1
...
dc0: <Abocom FE2500 10/100BaseTX> port 0x3000-0x30ff mem 0x44020000-0x4403ffff,0x44002000-0x440023ff irq 9 at device 0.0 on cardbus0
dc0: Ethernet address: 00:e0:98:8e:e5:d0
miibus0: <MII bus> on dc0
ukphy0: <Generic IEEE 802.3u media interface> on miibus0
ukphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
ed0: <Kingston KNE-PC2 Ethernet> at port 0x300-0x31f irq 9 function 0 config 32 on pccard1
ed0: address 38:ff:90:c8:c6:df, type NE2000 (16 bit) 

dc0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        inet 10.0.0.5 netmask 0xffffff00 broadcast 10.0.0.255
        ether 00:e0:98:8e:e5:d0 
        media: autoselect (100baseTX <full-duplex>) status: active
        supported media: autoselect 100baseTX <full-duplex> 100baseTX 10baseT/UTP <full-duplex> 10baseT/UTP none
ed0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        inet 10.1.1.2 netmask 0xffffff00 broadcast 10.1.1.255
        ether 38:ff:90:c8:c6:df 

Cheers,
-Peter
--
Peter Wemm - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au
"All of this is for nothing if we don't go to the stars" - JMS/B5



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200101071333.f07DXlt11106>