Subject: port-i386/20512: Thinkpad T30 Aironet mini-PCI wireless card: an driver fails to map registers
To: None <gnats-bugs@gnats.netbsd.org>
From: None <stannous@employees.org>
List: netbsd-bugs
Date: 02/27/2003 08:05:41
>Number:         20512
>Category:       port-i386
>Synopsis:       Thinkpad T30 Aironet mini-PCI wireless card: an driver fails to map registers
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-i386-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Feb 27 08:06:00 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Sam Tannous
>Release:        1.6.1_RC2
>Organization:
None
>Environment:
t30netbsd: {1} uname -a
NetBSD t30netbsd 1.6.1_RC2 NetBSD 1.6.1_RC2 (T30KERNEL) #12: Wed Feb 26 11:48:38 EST 2003     stannous@t30netbsd:/usr/src/sys/arch/i386/compile/T30KERNEL i386
t30netbsd: {2} 

>Description:
The an driver fails to recognize the Aironet mini PCI wireless 
card.  I modified /usr/src/sys/dev/pci/if_an_pci.c to include
    
        { PCI_VENDOR_AIRONET,           0xa504},
    
and I also added the folling in my kernel config:
    
   an*     at pci? dev ? function ?
    
but all I get now is
    
----------- 
an0 at pci2 dev 2 function 0: Aironet Wireless Communications product 0xa504
pci_io_find: expected type i/o, found mem
an0: unable to map registers
----------- 

I also have the following pcictl data from the card:

-------
t30netbsd: {2} pcictl /dev/pci2 list
002:00:0: Texas Instruments product 0xac55 (CardBus bridge, revision 0x01)
002:00:1: Texas Instruments product 0xac55 (CardBus bridge, revision 0x01)
002:02:0: Aironet Wireless Communications product 0xa504 (miscellaneous network)
002:08:0: Intel PRO/100 VE Network Controller (ethernet network, revision 0x42)
t30netbsd: {3} 
-------

and 

-------
t30netbsd: {3} pcictl /dev/pci2 dump -d 2
PCI configuration registers:
  Common header:
    0x00: 0xa50414b9 0x0090011f 0x02800000 0x00004008

    Vendor Name: Aironet Wireless Communications (0x14b9)
    Device ID: 0xa504
    Command register: 0x011f
      I/O space accesses: on
      Memory space accesses: on
      Bus mastering: on
      Special cycles: on
      MWI transactions: on
      Palette snooping: off
      Parity error checking: off
      Address/data stepping: off
      System error (SERR): on
      Fast back-to-back transactions: off
    Status register: 0x0090
      Capability List support: on
      66 MHz capable: off
      User Definable Features (UDF) support: off
      Fast back-to-back capable: on
      Data parity error detected: off
      DEVSEL timing: fast (0x0)
      Slave signaled Target Abort: off
      Master received Target Abort: off
      Master received Master Abort: off
      Asserted System Error (SERR): off
      Parity error detected: off
    Class Name: network (0x02)
    Subclass Name: miscellaneous (0x80)
    Interface: 0x00
    Revision ID: 0x00
    BIST: 0x00
    Header Type: 0x00 (0x00)
    Latency Timer: 0x40
    Cache Line Size: 0x08

  Type 0 ("normal" device) header:
    0x10: 0x00008001 0xd0200000 0xd0400000 0x00000000
    0x20: 0x00000000 0x00000000 0x00002002 0x500014b9
    0x30: 0x00000000 0x00000040 0x00000000 0x0404010b

    Base address register at 0x10
      type: i/o
      base: 0x00008000, not sized
    Base address register at 0x14
      type: 32-bit nonprefetchable memory
      base: 0xd0200000, not sized
    Base address register at 0x18
      type: 32-bit nonprefetchable memory
      base: 0xd0400000, not sized
    Base address register at 0x1c
      not implemented(?)
    Base address register at 0x20
      not implemented(?)
    Base address register at 0x24
      not implemented(?)
    Cardbus CIS Pointer: 0x00002002
    Subsystem vendor ID: 0x14b9
    Subsystem ID: 0x5000
    Expansion ROM Base Address: 0x00000000
    Capability list pointer: 0x40
    Reserved @ 0x38: 0x00000000
    Maximum Latency: 0x04
    Minimum Grant: 0x04
    Interrupt pin: 0x01 (pin A)
    Interrupt line: 0x0b
    Capability register at 0x40
      type: 0x01 (Power Management, rev. 1.0)
    Capability register at 0x48
      type: 0x03 (VPD)

  Device-dependent header:
    0x40: 0x06024801 0xc8004000 0x807c0003 0x78000000
    0x50: 0x00000000 0x00000000 0x00000000 0x00000000
    0x60: 0x00000000 0x00000000 0x00000000 0x00000000
    0x70: 0x00000000 0x00000000 0x00000000 0x00000000
    0x80: 0x00000000 0x00000000 0x00000000 0x00000000
    0x90: 0x00000000 0x00000000 0x00000000 0x00000000
    0xa0: 0x00000000 0x00000000 0x00000000 0x00000000
    0xb0: 0x00000000 0x00000000 0x00000000 0x00000000
    0xc0: 0x00000000 0x00000000 0x00000000 0x00000000
    0xd0: 0x00000000 0x00000000 0x00000000 0x00000000
    0xe0: 0x00000000 0x00000000 0x00000000 0x00000000
    0xf0: 0x00000000 0x00000000 0x00000000 0x00000000

t30netbsd: {4} 
----------------------------

I also tried adding the folling line to 
/usr/src/sys/dev/pci/pcidevs.h

  #define       PCI_PRODUCT_AIRONET_MPI350      0xA504 

and added the following to pcidevs_data.h:

        {
            PCI_VENDOR_AIRONET, PCI_PRODUCT_AIRONET_MPI350,
            0,
            "Cisco/Aironet Wireless Communications",
            "Cisco/Aironet MPI350 mini PCI Wireless LAN Adapter",
        },

and added the following to if_an_pci.c:

        { PCI_VENDOR_AIRONET,           PCI_PRODUCT_AIRONET_MPI350 },

thinking that might be the more proper way to do it...but the 
result was the same.

I also tried changing 0x18 to 0x10 in if_an_pci.c 

     #define AN_PCI_IOBA             0x18    /* i/o base */

but that panic's my kernel and the laptop doesn't boot.

I don't know what else to try but I would be happy to test changes
for anyone.

Thanks,
Sam Tannous
>How-To-Repeat:
configure an support and change the if_an_pci.c code to 
recognize the product code in a Thinkpad T30 and reboot.
>Fix:
None that I know of....
>Release-Note:
>Audit-Trail:
>Unformatted: