Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 Nov 2001 19:33:51 -0700
From:      Warner Losh <imp@harmony.village.org>
To:        Scott Mitchell <scott.mitchell@mail.com>
Cc:        freebsd-mobile@FreeBSD.ORG
Subject:   Re: Xircom Ethernet driver patch for CE2 & CEM33 
Message-ID:  <200111190233.fAJ2Xp766696@harmony.village.org>
In-Reply-To: Your message of "Mon, 19 Nov 2001 00:20:35 GMT." <20011119002035.B30992@localhost> 
References:  <20011119002035.B30992@localhost>  

next in thread | previous in thread | raw e-mail | index | archive | help
In message <20011119002035.B30992@localhost> Scott Mitchell writes:
:   - Some changes supplied by Peter Fürst to prevent the driver becoming
:     confused about the number of bytes to send, and not sending any
:   - A few other minor tweaks

Any what?

: Question: is there any way to enforce these restrictions from within the
: driver?  The CIS on these cards doesn't appear to give any indication that
: these addresses are not allowed.

The bus picks address 0xd0000 for memory, and the driver wants to say
"get bent, I can't use that, give me a different one"?  I don't think
so.

: I don't have a CE2 card, so I can't verify that these changes will do any
: good at all... however, it still works with my CE3 so I don't think I've
: made anything worse :-)

I keep meaning to send you a CE2 card.  I'll give these tests a try.

Warner

P.S.  Here's patch for the bad CIS addresses, relative to -stable.
I've not had a chance to port it to -current yet, but it causes at
least one of the DELL laptops that a local user has to start working
again.

Index: if_xe.c
===================================================================
RCS file: /cache/ncvs/src/sys/dev/xe/if_xe.c,v
retrieving revision 1.13.2.5
diff -u -r1.13.2.5 if_xe.c
--- if_xe.c	21 Jul 2000 22:38:24 -0000	1.13.2.5
+++ if_xe.c	19 Nov 2001 02:31:43 -0000
@@ -226,10 +226,8 @@
   struct xe_softc *sc = (struct xe_softc *) device_get_softc(dev);
   bus_space_tag_t bst;
   bus_space_handle_t bsh;
-  struct resource *r;
-  int rid;
+  struct resource *r; int rid;
   int ioport;
-
 #ifdef XE_DEBUG
   device_printf(dev, "Hacking your Realport, master\n");
 #endif
@@ -244,11 +242,10 @@
   r = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, 0, ~0, 4 << 10, RF_ACTIVE);
   if (!r) {
 #if XE_DEBUG > 0
-    device_printf(dev, "Can't map in attribute memory\n");
+     device_printf(dev, "Can't map in attribute memory\n");
 #endif
-    return -1;
+     return -1;
   }
-
   bsh = rman_get_bushandle(r);
   bst = rman_get_bustag(r);
 
@@ -291,7 +288,7 @@
   int buf;
   u_char ver_str[CISTPL_BUFSIZE>>1];
   off_t offs;
-  int success, rc, i;
+  int success, rc = 0, i;
   int rid;
   struct resource *r;
 
@@ -360,6 +357,7 @@
 #if XE_DEBUG > 1
 	device_printf(dev, "Not a PCMCIA Ethernet card!\n");
 #endif
+	success--;
 	rc = ENODEV;		/* Not a PCMCIA Ethernet device */
       } else {
 	if (media & 0x10) {	/* Ethernet/modem cards */
@@ -388,6 +386,7 @@
 	    scp->dingo = 1;
 	    scp->card_type = "CEM56"; break;
 	  default:
+	    success--;
 	    rc = ENODEV;
 	  }
 	} else {		/* Ethernet-only cards */
@@ -404,6 +403,7 @@
 	    scp->mohawk = 1;
 	    scp->card_type = "CE3"; break;
 	  default:
+	    success--;
 	    rc = ENODEV;
 	  }
 	}
@@ -440,6 +440,8 @@
   /* Die now if something went wrong above */
   if (success < 3)
     return ENXIO;
+  if (rc != 0)
+    return (rc);
 
   /* Check for certain strange CE2's that look like CE's */
   if (strcmp(scp->card_type, "CE") == 0) {

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




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