Subject: NetBSD 1.2/i386 refusing to recognize Adaptec 2940U ?? (fixed now???)
To: None <netbsd-help@NetBSD.ORG>
From: Jonathan Marsden <Jonathan@xc.org>
List: netbsd-help
Date: 02/13/1997 17:57:27
I've successfully set up several NetBSD machines that use Adaptec
2940* controllers.  But this one was defying me.

Problem: NetBSD 1.2/i386 refuses to recognize Adaptec 2940U controller card

Machine: Dell Dimension P166v, 32MB RAM, 3.2GB IBM ATA2 disk, ATAPI CDROM, 3C590 NIC.

Symptom: dmesg output shows only:

  ...
  vendor 0x9004 product 0x6178 (class mass storage, subclass SCSI, revision 0x01) at pci0 dev 13 function 0 not configured

as extra output when the 2940U is installed.

I note that the vendor and product ID string looked for in
/usr/src/sys/dev/pci/ahc_pci.c is:

   #define PCI_DEVICE_ID_ADAPTEC_2940U	0x81789004ul

I note product id 0x8178, not 0x6178 which is what the card is returning.

Diagnosis: Card is returning a product ID unknown to NetBSD 1.2.

Solution: Hack /usr/src/sys/dev/pci/ahc_pci.c to know about this card
(context diff enclosed below).

Result:

ahc1 at pci0 dev 13 function 0
ahc1: interrupting at irq 11
ahc1: Reading SEEPROM...done.
ahc1: aic7880 Single Channel, SCSI Id=7, 3 SCBs
ahc1: Reseting Channel A
ahc1: Downloading Sequencer Program...Done
scsibus0 at ahc1
ep0 at pci0 dev 15 function 0: 3Com 3C590 Ethernet
ep0: aui/bnc/utp address 00:60:97:61:d4:1f
ep0: shifting address bits by 2
ep0: interrupting at irq 10
biomask c840 netmask cc40 ttymask dcd2
changing root device to wd0a

Looks good so far!

Questions:

Q1: Do I have a bad 2940U?  Or just an OEM version that NetBSD 1.2 won't recognize?

Q2: What regression tests can I run to check this *really* works OK?

Q3: How should I submit this patch to the NetBSD developers?

Thanks,

Jonathan (who just did his first ever kernel hack <grin>)
--
Jonathan Marsden   | Internet: jonathan@xc.org  | Making electronic 
1849 N. Wabash Ave.| Phone: +1 (909) 794 1151   | communications work 
Redlands, CA 92374 | FAX:   +1 (909) 794 3016   | reliably for Christian 
USA                | http://www.xc.org/jonathan | missions worldwide 
------------------------------------------------------------------------
*** ahc_pci.c.orig	Wed Jul 17 17:41:19 1996
--- ahc_pci.c	Thu Feb 13 09:27:34 1997
***************
*** 83,88 ****
--- 83,89 ----
  #define PCI_DEVICE_ID_ADAPTEC_3940U	0x82789004ul
  #define PCI_DEVICE_ID_ADAPTEC_2944U	0x84789004ul
  #define PCI_DEVICE_ID_ADAPTEC_2940U	0x81789004ul
+ #define PCI_DEVICE_ID_OEM_2940U	0x61789004ul
  #define PCI_DEVICE_ID_ADAPTEC_3940	0x72789004ul
  #define PCI_DEVICE_ID_ADAPTEC_2944	0x74789004ul
  #define PCI_DEVICE_ID_ADAPTEC_2940	0x71789004ul
***************
*** 212,217 ****
--- 213,221 ----
  		case PCI_DEVICE_ID_ADAPTEC_2940U:
  			return ("Adaptec 2940 Ultra SCSI host adapter");
  			break;
+ 		case PCI_DEVICE_ID_OEM_2940U:
+ 			return ("OEM AHA 2940 Ultra SCSI host adapter");
+ 			break;
  		case PCI_DEVICE_ID_ADAPTEC_2944:
  			return ("Adaptec 2944 SCSI host adapter");
  			break;
***************
*** 260,265 ****
--- 264,270 ----
  	case PCI_DEVICE_ID_ADAPTEC_3940U:
  	case PCI_DEVICE_ID_ADAPTEC_2944U:
  	case PCI_DEVICE_ID_ADAPTEC_2940U:
+ 	case PCI_DEVICE_ID_OEM_2940U:
  	case PCI_DEVICE_ID_ADAPTEC_3940:
  	case PCI_DEVICE_ID_ADAPTEC_2944:
  	case PCI_DEVICE_ID_ADAPTEC_2940:
***************
*** 341,346 ****
--- 346,352 ----
  			break;
  		case PCI_DEVICE_ID_ADAPTEC_2944U:
  		case PCI_DEVICE_ID_ADAPTEC_2940U:
+ 		case PCI_DEVICE_ID_OEM_2940U:
  			ahc_t = AHC_294U;
  			break;
  		case PCI_DEVICE_ID_ADAPTEC_2944:
------------------------------------------------------------------------