00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 FILE_LICENCE ( GPL2_OR_LATER );
00018
00019 #include <gpxe/pci.h>
00020 #include <nic.h>
00021
00022 #define WLAN_HOSTIF WLAN_PLX
00023 #include "prism2.c"
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 static int prism2_find_plx ( hfa384x_t *hw, struct pci_device *p )
00037 {
00038 int found = 0;
00039 uint32_t plx_lcr = 0;
00040 uint32_t attr_mem = 0;
00041 uint32_t iobase = 0;
00042 unsigned char *cis_tpl = NULL;
00043 unsigned char *cis_string;
00044
00045
00046 pci_read_config_dword( p, PLX_LOCAL_CONFIG_REGISTER_BASE, &plx_lcr);
00047 plx_lcr &= PCI_BASE_ADDRESS_IO_MASK;
00048 pci_read_config_dword( p, PRISM2_PLX_ATTR_MEM_BASE, &attr_mem);
00049 pci_read_config_dword( p, PRISM2_PLX_IO_BASE, &iobase);
00050 iobase &= PCI_BASE_ADDRESS_IO_MASK;
00051
00052
00053 hw->iobase = iobase;
00054 printf ( "PLX9052 has local config registers at %#x\n", plx_lcr );
00055 printf ( "Prism2 has attribute memory at %#x and I/O base at %#x\n", attr_mem, iobase );
00056
00057
00058 printf ( "Searching for PCMCIA card...\n" );
00059 cis_tpl = bus_to_virt(attr_mem);
00060 while ( *cis_tpl != CISTPL_END ) {
00061 if ( *cis_tpl == CISTPL_VERS_1 ) {
00062
00063 printf ( "...found " );
00064 found = 1;
00065 cis_string = cis_tpl + CISTPL_VERS_1_STR_OFF;
00066 while ( ! ( ( *cis_string == 0 ) && ( *(cis_string+CIS_STEP) == 0 ) ) ) {
00067 printf ( "%c", *cis_string == 0 ? ' ' : *cis_string );
00068 cis_string += CIS_STEP;
00069 }
00070 printf ( "\n" );
00071 }
00072
00073 cis_tpl += CISTPL_HEADER_LEN + CIS_STEP * ( *(cis_tpl+CISTPL_LEN_OFF) );
00074 }
00075 if ( found == 0 ) {
00076 printf ( "...nothing found\n" );
00077 }
00078 ((unsigned char *)bus_to_virt(attr_mem))[COR_OFFSET] = COR_VALUE;
00079 return found;
00080 }
00081
00082 static int prism2_plx_probe ( struct nic *nic, struct pci_device *pci ) {
00083 hfa384x_t *hw = &hw_global;
00084
00085
00086 if ( ! prism2_find_plx ( hw, pci ) ) return 0;
00087 nic->ioaddr = hw->iobase;
00088 nic->irqno = 0;
00089 return prism2_probe ( nic, hw );
00090 }
00091
00092 static void prism2_plx_disable ( struct nic *nic ) {
00093 prism2_disable ( nic );
00094 }
00095
00096 static struct pci_device_id prism2_plx_nics[] = {
00097 PCI_ROM(0x1385, 0x4100, "ma301", "Netgear MA301", 0),
00098 PCI_ROM(0x10b7, 0x7770, "3c-airconnect", "3Com AirConnect", 0),
00099 PCI_ROM(0x111a, 0x1023, "ss1023", "Siemens SpeedStream SS1023", 0),
00100 PCI_ROM(0x15e8, 0x0130, "correga", "Correga", 0),
00101 PCI_ROM(0x1638, 0x1100, "smc2602w", "SMC EZConnect SMC2602W", 0),
00102 PCI_ROM(0x16ab, 0x1100, "gl24110p", "Global Sun Tech GL24110P", 0),
00103 PCI_ROM(0x16ab, 0x1101, "16ab-1101", "Unknown", 0),
00104 PCI_ROM(0x16ab, 0x1102, "wdt11", "Linksys WDT11", 0),
00105 PCI_ROM(0x16ec, 0x3685, "usr2415", "USR 2415", 0),
00106 PCI_ROM(0xec80, 0xec00, "f5d6000", "Belkin F5D6000", 0),
00107 PCI_ROM(0x126c, 0x8030, "emobility", "Nortel emobility", 0),
00108 };
00109
00110 PCI_DRIVER ( prism2_plx_driver, prism2_plx_nics, PCI_NO_CLASS );
00111
00112
00113 DRIVER ( "Prism2/PLX", nic_driver, pci_driver, prism2_plx_driver,
00114 prism2_plx_probe, prism2_plx_disable );
00115
00116
00117
00118
00119
00120
00121
00122