Subject: Diffs, actually attached.
To: None <port-i386@netbsd.org>
From: Peter Seebach <seebs@plethora.net>
List: port-i386
Date: 12/18/2000 18:40:49
Oh, more data:

These diffs work with the Linksys cards.  The D-Link card configures
fine and hooks up with no errors, but can't actually ping other hosts.
I will try to sort that out next.

*** if_wi.c.orig	Thu Dec 14 15:54:37 2000
--- if_wi.c	Thu Dec 14 17:53:59 2000
***************
*** 202,207 ****
--- 202,219 ----
  	  PCMCIA_STR_INTERSIL_PRISM2,
  	  1 },
  
+ 	{ PCMCIA_VENDOR_LUCENT,
+ 	  PCMCIA_PRODUCT_LUCENT_WAVELAN_IEEE,
+ 	  PCMCIA_CIS_LINKSYS_WPC11,
+ 	  PCMCIA_STR_LINKSYS_WPC11,
+ 	  1 },
+ 
+ 	{ PCMCIA_VENDOR_LUCENT,
+ 	  PCMCIA_PRODUCT_LUCENT_WAVELAN_IEEE,
+ 	  PCMCIA_CIS_DLINK_DWL_650,
+ 	  PCMCIA_STR_DLINK_DWL_650,
+ 	  1 },
+ 
  	{ 0,
  	  0,
  	  { NULL, NULL, NULL, NULL },
***************
*** 345,350 ****
--- 357,363 ----
  	CSR_WRITE_2(sc, WI_INT_EN, 0);
  	CSR_WRITE_2(sc, WI_EVENT_ACK, 0xFFFF);
  
+ 	printf("\n");
  	/* Reset the NIC. */
  	wi_reset(sc);
  
***************
*** 362,373 ****
  	 * Or, check against possible vendor?  XXX.
  	 */
  	if (bcmp(sc->sc_macaddr, empty_macaddr, ETHER_ADDR_LEN) == 0) {
! 		printf(": could not get mac address, attach failed\n");
  		goto bad_enaddr;
  	}
  
! 	printf("\n%s: address %s\n", sc->sc_dev.dv_xname,
! 	    ether_sprintf(sc->sc_macaddr));
  
  	memcpy(ifp->if_xname, sc->sc_dev.dv_xname, IFNAMSIZ);
  	ifp->if_softc = sc;
--- 375,389 ----
  	 * Or, check against possible vendor?  XXX.
  	 */
  	if (bcmp(sc->sc_macaddr, empty_macaddr, ETHER_ADDR_LEN) == 0) {
! 		printf("%s: could not get mac address, attach failed\n",
! 			sc->sc_dev.dv_xname);
  		goto bad_enaddr;
  	}
  
! 	printf("\n%s: address %s [card type '%s']%s\n", sc->sc_dev.dv_xname,
! 	    ether_sprintf(sc->sc_macaddr),
! 	    pp->pp_name ? pp->pp_name : "(unknown)",
! 	    sc->sc_prism2 ? " (PRISM II)" : "");
  
  	memcpy(ifp->if_xname, sc->sc_dev.dv_xname, IFNAMSIZ);
  	ifp->if_softc = sc;
***************
*** 759,764 ****
--- 775,787 ----
  static void wi_reset(sc)
  	struct wi_softc		*sc;
  {
+ 	/* abject hack! */
+ 	if (sc->sc_prism2) {
+ 		wi_cmd(sc, WI_CMD_INI, 0);
+ 		DELAY(100000);
+ 		wi_cmd(sc, WI_CMD_INI, 0);
+ 		DELAY(100000);
+ 	}
  	if (wi_cmd(sc, WI_CMD_INI, 0))
  		printf("%s: init failed\n", sc->sc_dev.dv_xname);
  	CSR_WRITE_2(sc, WI_INT_EN, 0);
***************
*** 766,772 ****
  
  	/* Calibrate timer. */
  	WI_SETVAL(WI_RID_TICK_TIME, 8);
! 
  	return;
  }
  
--- 789,800 ----
  
  	/* Calibrate timer. */
  	WI_SETVAL(WI_RID_TICK_TIME, 8);
! 	if (sc->sc_prism2) {
! 		struct wi_ltv_gen	gen;
! 		gen.wi_type = WI_RID_TICK_TIME;
! 		gen.wi_len = 2;
! 		wi_read_record(sc, &gen);
! 	}
  	return;
  }
  
***************
*** 780,785 ****
--- 808,814 ----
  	u_int16_t		*ptr;
  	int			i, len, code;
  	struct wi_ltv_gen	*oltv, p2ltv;
+ 	int			ret;
  
  	if (sc->sc_prism2) {
  		oltv = ltv;
***************
*** 816,827 ****
  	}
  
  	/* Tell the NIC to enter record read mode. */
! 	if (wi_cmd(sc, WI_CMD_ACCESS|WI_ACCESS_READ, ltv->wi_type))
  		return(EIO);
  
  	/* Seek to the record. */
! 	if (wi_seek(sc, ltv->wi_type, 0, WI_BAP1))
  		return(EIO);
  
  	/*
  	 * Read the length and record type and make sure they
--- 845,862 ----
  	}
  
  	/* Tell the NIC to enter record read mode. */
! 	if ((ret = wi_cmd(sc, WI_CMD_ACCESS|WI_ACCESS_READ, ltv->wi_type)) != 0) {
! 		printf("%s: cmd_access failed [%d] trying to read type 0x%X\n",
! 		    sc->sc_dev.dv_xname, ret, ltv->wi_type);
  		return(EIO);
+ 	}
  
  	/* Seek to the record. */
! 	if ((ret = wi_seek(sc, ltv->wi_type, 0, WI_BAP1)) != 0) {
! 		printf("%s: wi_seek [%d] trying to read type 0x%X\n",
! 		    sc->sc_dev.dv_xname, ret, ltv->wi_type);
  		return(EIO);
+ 	}
  
  	/*
  	 * Read the length and record type and make sure they
***************
*** 829,839 ****
  	 * room to hold all of the returned data).
  	 */
  	len = CSR_READ_2(sc, WI_DATA1);
! 	if (len > ltv->wi_len)
  		return(ENOSPC);
  	code = CSR_READ_2(sc, WI_DATA1);
! 	if (code != ltv->wi_type)
  		return(EIO);
  
  	ltv->wi_len = len;
  	ltv->wi_type = code;
--- 864,880 ----
  	 * room to hold all of the returned data).
  	 */
  	len = CSR_READ_2(sc, WI_DATA1);
! 	if (len > ltv->wi_len) {
! 		printf("%s: too many bytes [%d, expected %d] reading type 0x%X\n",
! 		    sc->sc_dev.dv_xname, len, ltv->wi_len, ltv->wi_type);
  		return(ENOSPC);
+ 	}
  	code = CSR_READ_2(sc, WI_DATA1);
! 	if (code != ltv->wi_type) {
! 		printf("%s: wrong type [0x%X, expected 0x%X] reading type 0x%X\n",
! 		    sc->sc_dev.dv_xname, code, ltv->wi_type, ltv->wi_type);
  		return(EIO);
+ 	}
  
  	ltv->wi_len = len;
  	ltv->wi_type = code;
*** pcmciadevs.h.orig	Thu Dec 14 15:54:56 2000
--- pcmciadevs.h	Thu Dec 14 17:26:38 2000
***************
*** 1,4 ****
! /*	$NetBSD: pcmciadevs.h,v 1.92.2.3 2000/08/09 23:30:02 gmcgarry Exp $	*/
  
  /*
   * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
--- 1,4 ----
! /*	$NetBSD$	*/
  
  /*
   * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
***************
*** 529,531 ****
--- 529,537 ----
  #define	PCMCIA_CIS_INTERSIL_PRISM2	{ "INTERSIL", "HFA384x/IEEE", "Version 01.02", NULL}
  #define	PCMCIA_PRODUCT_INTERSIL_PRISM2	-1
  #define	PCMCIA_STR_INTERSIL_PRISM2	"Intersil Prism II"
+ #define	PCMCIA_CIS_LINKSYS_WPC11	{ "Instant Wireless ", " Network PC CARD", "Version 01.02", NULL}
+ #define	PCMCIA_PRODUCT_LINKSYS_WPC11	-1
+ #define	PCMCIA_STR_LINKSYS_WPC11	"Linksys WPC11"
+ #define	PCMCIA_CIS_DLINK_DWL_650	{ "D", "Link DWL-650 11Mbps WLAN Card", "Version 01.02", NULL}
+ #define	PCMCIA_PRODUCT_DLINK_DWL_650	-1
+ #define	PCMCIA_STR_DLINK_DWL_650	"D-Link DWL-650"
*** pcmciadevs.orig	Thu Dec 14 15:54:49 2000
--- pcmciadevs	Mon Dec 18 10:41:34 2000
***************
*** 296,298 ****
--- 296,300 ----
  product BILLIONTON LNT10TN	{ "PCMCIA", "LNT-10TN", NULL, NULL } Billionton Systems Inc. LNT-10TN NE2000 Compatible Card
  product NDC ND5100_E		{ "NDC", "Ethernet", "A", NULL } Sohoware ND5100E NE2000 Compatible Card
  product INTERSIL PRISM2		{ "INTERSIL", "HFA384x/IEEE", "Version 01.02", NULL} Intersil Prism II
+ product LINKSYS WPC11		{ "Instant&spWireless&sp", "&spNetwork&spPC&spCARD", "Version 01.02", NULL} Linksys WPC11
+ product DLINK DWL_650		{ "D", "Link&spDWL-650&sp11Mbps&spWLAN&spCard", "Version 01.02", NULL} D-Link DWL-650