Subject: helpers for CardBus patches
To: None <tech-kern@netbsd.org>
From: Jonathan Stone <jonathan@DSG.Stanford.EDU>
List: tech-kern
Date: 06/16/1999 19:38:07
Below are the acutal `patches from Hayakawa-san's CardBus patches.  I
dont know enough about COM IRQ usage to judge teh pros and cons of
avoiding the standard COM1 and COM2 values on PCMCIA, but the rest look OK.

Any objection to committing these, to make life simpler for the (many)
people using those patches?




Index: sys/conf/files
diff -c sys/conf/files:1.1.1.1 sys/conf/files:1.1.1.1.4.1
*** sys/conf/files:1.1.1.1	Wed Jan 20 22:27:45 1999
--- sys/conf/files	Wed Feb 17 01:32:49 1999
***************
*** 348,353 ****
--- 348,354 ----
  define	usbus { }			# USB attachment
  define	vmebus { }			# VME bus attachment
  define	pcmciabus { [controller = -1], [socket = -1]}	# PCMCIA bus attachment
+ define	cardslot {[slot = -1]}		# PC-Card attachment
  
  # We need the USB bus controllers here so different busses can
  # use them in an 'attach-with'.
Index: sys/dev/pci/files.pci
diff -c sys/dev/pci/files.pci:1.1.1.1.2.1 sys/dev/pci/files.pci:1.1.1.1.2.1.2.1
*** sys/dev/pci/files.pci:1.1.1.1.2.1	Sun Jan 24 20:01:38 1999
--- sys/dev/pci/files.pci	Wed Feb 17 01:41:08 1999
***************
*** 180,182 ****
--- 180,187 ----
  # OHCI USB controller
  attach	ohci at pci with ohci_pci
  file	dev/pci/ohci_pci.c		ohci
+ 
+ # YENTA PCI-Cardbus bridge 
+ device  cbb: cardslot, pcmciabus
+ attach	cbb at pci with cbb_pci
+ file	dev/pci/pccbb.c			cbb
Index: sys/dev/pcmcia/com_pcmcia.c
diff -c sys/dev/pcmcia/com_pcmcia.c:1.1.1.1 sys/dev/pcmcia/com_pcmcia.c:1.1.1.1.4.1
*** sys/dev/pcmcia/com_pcmcia.c:1.1.1.1	Wed Jan 20 22:28:24 1999
--- sys/dev/pcmcia/com_pcmcia.c	Mon Feb 22 03:08:41 1999
***************
*** 234,239 ****
--- 234,247 ----
  			continue;
  
  		if (autoalloc == 0) {
+ 		/* XXX: I dont want to use com0 and com1.  Usually,
+ 		   The addresses of com0 and com1 have been already
+ 		   occupied by ISA com devices. */
+ 		
+ 		  if (cfe->iospace[0].start == IO_COM1 ||
+ 		      cfe->iospace[0].start == IO_COM2) {
+ 		    continue;
+ 		  }
  			/* 
  			 * cfe->iomask == 3 is our test for the "generic" config table 
  			 * entry, which we want to avoid on the first pass and use
Index: sys/dev/pcmcia/pcmcia.c
diff -c sys/dev/pcmcia/pcmcia.c:1.1.1.1 sys/dev/pcmcia/pcmcia.c:1.1.1.1.4.1
*** sys/dev/pcmcia/pcmcia.c:1.1.1.1	Wed Jan 20 22:28:25 1999
--- sys/dev/pcmcia/pcmcia.c	Mon Mar 22 23:15:54 1999
***************
*** 111,116 ****
--- 111,119 ----
  	struct cfdata *match;
  	void *aux;
  {
+   if (strcmp(match->cf_driver->cd_name, "pcmcia")) {
+     return 0;
+   }
  	/* if the autoconfiguration got this far, there's a socket here */
  	return (1);
  }