Subject: kern/5902: NewMedia Basics Lan
To: None <gnats-bugs@gnats.netbsd.org>
From: Stefan Grefen <grefen@hprc.tandem.com>
List: netbsd-bugs
Date: 08/03/1998 23:40:51
>Number:         5902
>Category:       kern
>Synopsis:       Support for new media ethernet
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          support
>Submitter-Id:   net
>Arrival-Date:   Mon Aug  3 15:05:00 1998
>Last-Modified:
>Originator:     Stefan Grefen
>Organization:
Stefan Grefen                                Tandem Computers Europe Inc.
grefen@hprc.tandem.com                       High Performance Research Center
 --- Hacking's just another word for nothing left to kludge. ---
>Release:        1.3F today<NetBSD-current source date>
>Environment:
	
NetBSD billy 1.3F NetBSD 1.3F (MOBY) #5: Mon Aug  3 13:35:57 PDT 1998     grefen@billy:/usr/src/sys/arch/i386/compile/MOBY i386

>Description:
	
	path to support new Media basics Lan-adapter
>How-To-Repeat:
	
>Fix:
*** /usr/sup/src/sys/./dev/pcmcia/pcmciadevs	Fri Jul 31 04:10:40 1998
--- /usr/src/sys/./dev/pcmcia/pcmciadevs	Mon Aug  3 12:48:24 1998
***************
*** 48,53 ****
--- 48,54 ----
  vendor SIMPLETECH		0x014d	Simple Technology
  vendor DAYNA			0x0194	Dayna Corporation
  vendor IODATA			0x01bf	I-O DATA
+ vendor NEWMEDIA			0x0057  NewMedia Corporation
  
  /*
   * List of known products.  Grouped by vendor.
***************
*** 94,99 ****
--- 95,103 ----
  /* TDK Products */
  product TDK LAK_CD021BX		0x0200 TDK LAK-CD021BX Ethernet
  product TDK DFL9610		0x0d0a TDK DFL9610 Ethernet & Digital Cellular
+ 
+ /* NewMedia Products */
+ product NEWMEDIA BASICS		0x0019 New Media BASICS Ethernet 
  
  /* Cards we know only by their cis */
  vendor PREMAX			-1 	Premax
*** /usr/sup/src/sys/./dev/pcmcia/pcmciadevs.h	Fri Jul 31 04:10:41 1998
--- /usr/src/sys/./dev/pcmcia/pcmciadevs.h	Mon Aug  3 12:48:35 1998
***************
*** 1,4 ****
! /*	$NetBSD: pcmciadevs.h,v 1.5 1998/07/30 20:45:35 thorpej Exp $	*/
  
  /*
   * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
--- 1,4 ----
! /*	$NetBSD$	*/
  
  /*
   * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
***************
*** 55,60 ****
--- 55,61 ----
  #define	PCMCIA_VENDOR_SIMPLETECH	0x014d	/* Simple Technology */
  #define	PCMCIA_VENDOR_DAYNA	0x0194	/* Dayna Corporation */
  #define	PCMCIA_VENDOR_IODATA	0x01bf	/* I-O DATA */
+ #define	PCMCIA_VENDOR_NEWMEDIA	0x0057	/* NewMedia Corporation */
  
  /*
   * List of known products.  Grouped by vendor.
***************
*** 139,144 ****
--- 140,150 ----
  #define	PCMCIA_CIS_TDK_DFL9610	{ NULL, NULL, NULL, NULL }
  #define	PCMCIA_PRODUCT_TDK_DFL9610	0x0d0a
  #define	PCMCIA_STR_TDK_DFL9610	"TDK DFL9610 Ethernet & Digital Cellular"
+ 
+ /* NewMedia Products */
+ #define	PCMCIA_CIS_NEWMEDIA_BASICS	{ NULL, NULL, NULL, NULL }
+ #define	PCMCIA_PRODUCT_NEWMEDIA_BASICS	0x0019
+ #define	PCMCIA_STR_NEWMEDIA_BASICS	"New Media BASICS Ethernet"
  
  /* Cards we know only by their cis */
  #define	PCMCIA_VENDOR_PREMAX	-1	/* Premax */
*** /usr/sup/src/sys/./dev/pcmcia/pcmciadevs_data.h	Fri Jul 31 04:10:41 1998
--- /usr/src/sys/./dev/pcmcia/pcmciadevs_data.h	Mon Aug  3 12:48:45 1998
***************
*** 1,4 ****
! /*	$NetBSD: pcmciadevs_data.h,v 1.5 1998/07/30 20:45:35 thorpej Exp $	*/
  
  /*
   * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
--- 1,4 ----
! /*	$NetBSD$	*/
  
  /*
   * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
***************
*** 173,178 ****
--- 173,185 ----
  	    "TDK DFL9610 Ethernet & Digital Cellular"	},
  	},
  	{
+ 	    PCMCIA_VENDOR_NEWMEDIA, PCMCIA_PRODUCT_NEWMEDIA_BASICS,
+ 	    PCMCIA_CIS_NEWMEDIA_BASICS,
+ 	    0,
+ 	    "NewMedia Corporation",
+ 	    "New Media BASICS Ethernet"	},
+ 	},
+ 	{
  	    PCMCIA_VENDOR_UNKNOWN, PCMCIA_PRODUCT_MEGAHERTZ_XJ2288,
  	    PCMCIA_CIS_MEGAHERTZ_XJ2288,
  	    0,
***************
*** 317,322 ****
--- 324,336 ----
  	    PCMCIA_KNOWNDEV_NOPROD,
  	    PCMCIA_CIS_INVALID,
  	    "I-O DATA",
+ 	    NULL,
+ 	},
+ 	{
+ 	    PCMCIA_VENDOR_NEWMEDIA, 0,
+ 	    PCMCIA_KNOWNDEV_NOPROD,
+ 	    PCMCIA_CIS_INVALID,
+ 	    "NewMedia Corporation",
  	    NULL,
  	},
  	{
*** /usr/sup/src/sys/./dev/pcmcia/if_sm_pcmcia.c	Mon Jul 20 04:11:31 1998
--- /usr/src/sys/./dev/pcmcia/if_sm_pcmcia.c	Mon Aug  3 12:39:03 1998
***************
*** 86,91 ****
--- 86,92 ----
  
  int	sm_pcmcia_match __P((struct device *, struct cfdata *, void *));
  void	sm_pcmcia_attach __P((struct device *, struct device *, void *));
+ static int sm_pcmcia_get_enaddr __P((struct pcmcia_tuple *, void *));
  
  struct sm_pcmcia_softc {
  	struct	smc91cxx_softc sc_smc;		/* real "smc" softc */
***************
*** 104,109 ****
--- 105,129 ----
  int	sm_pcmcia_enable __P((struct smc91cxx_softc *));
  void	sm_pcmcia_disable __P((struct smc91cxx_softc *));
  
+ static int
+ sm_pcmcia_get_enaddr(tuple, arg)
+     struct pcmcia_tuple *tuple;
+     void *arg;
+ {
+ 	u_int8_t *myla = arg;
+ 	int i;
+ 
+ 	if (tuple->code == 0x22) {	/* Func Extension */
+ 	     if (tuple->length < ETHER_ADDR_LEN)
+ 		return (0);
+ 	    for (i = 0; i < ETHER_ADDR_LEN; i ++) {
+ 		myla[i]  = pcmcia_tuple_read_1(tuple, i + 2 );
+ 	    }
+ 	    return 1;
+ 	}
+ 	return 0;
+ }
+ 
  int
  sm_pcmcia_match(parent, match, aux)
  	struct device *parent;
***************
*** 119,124 ****
--- 139,151 ----
  				return (1);
  		}
  	}
+ 	if (pa->manufacturer == PCMCIA_VENDOR_NEWMEDIA) {
+ 		switch (pa->product) {
+ 		case PCMCIA_PRODUCT_NEWMEDIA_BASICS:
+ 			if (pa->pf->number == 0)
+ 				return (1);
+ 		}
+ 	}
  
  	return (0);
  }
***************
*** 171,176 ****
--- 198,206 ----
  	case PCMCIA_PRODUCT_MEGAHERTZ2_XJACK:
  		model = PCMCIA_STR_MEGAHERTZ2_XJACK;
  		break;
+ 	case PCMCIA_PRODUCT_NEWMEDIA_BASICS:
+ 		model = PCMCIA_STR_NEWMEDIA_BASICS;
+ 		break;
  
  	default:
  		model = "Unknown SMC91Cxx Ethernet";
***************
*** 227,232 ****
--- 257,270 ----
  			printf("%s: unable to read MAC address from CIS\n",
  			    sc->sc_dev.dv_xname);
  		}
+ 	}
+ 
+ 	if( pa->product == PCMCIA_PRODUCT_NEWMEDIA_BASICS ) {
+ 	    if (pcmcia_scan_cis(parent, sm_pcmcia_get_enaddr, myla) != 1) {
+ 		enaddr = NULL;
+ 	    } else {
+ 		enaddr = myla;
+ 	    }
  	}
  
  	/* Perform generic intialization. */
>Audit-Trail:
>Unformatted: