Show
Ignore:
Timestamp:
09/05/07 00:49:51 (5 years ago)
Author:
mickflemm
Message:
  • Add more chip revision IDs (i found those from the various reports here, we need more)
  • Set single-chip bit based on chip revision id instead of pci ids (also fixes cards with bogus pci ids)
  • Sync card info report code in madwifi-old-openhal with ath5k
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/ath5k/ath5k_hw.c

    r2701 r2703  
    264264        hal->ah_ant_diversity = AR5K_TUNE_ANT_DIVERSITY; 
    265265 
    266         switch (device) { 
    267         case PCI_DEVICE_ID_ATHEROS_AR2413: 
    268         case PCI_DEVICE_ID_ATHEROS_AR5413: 
    269         case PCI_DEVICE_ID_ATHEROS_AR5424: 
    270                 /* 
    271                  * Known single chip solutions 
    272                  */ 
    273                 hal->ah_single_chip = true; 
    274                 break; 
    275         default: 
    276                 /* 
    277                  * Multi chip solutions 
    278                  */ 
    279                 hal->ah_single_chip = false; 
    280                 break; 
    281         } 
    282  
    283         /* 
    284          * Set the mac revision based on the pci id 
     266        /* 
     267         * Set the mac version based on the pci id 
    285268         */ 
    286269        hal->ah_version = mac_version; 
     270 
     271        /* 
     272         * Set the mac revision based by reading SREV 
     273         */ 
     274        srev = ath5k_hw_reg_read(hal, AR5K_SREV); 
     275        hal->ah_mac_srev = srev; 
     276        hal->ah_mac_version = AR5K_REG_MS(srev, AR5K_SREV_VER); 
     277        hal->ah_mac_revision = AR5K_REG_MS(srev, AR5K_SREV_REV); 
     278 
     279        switch (srev) { 
     280                case AR5K_SREV_VER_AR2424: 
     281                case AR5K_SREV_VER_AR5424: 
     282                case AR5K_SREV_VER_AR5413: 
     283                case AR5K_SREV_VER_AR5414: 
     284                        /* 
     285                         * Known single chip solutions 
     286                         */ 
     287                        hal->ah_single_chip = true; 
     288                        break; 
     289                default: 
     290                        /* 
     291                         * Multi chip solutions 
     292                         */ 
     293                        hal->ah_single_chip = false; 
     294                        break; 
     295        } 
    287296 
    288297        /*Fill the hal struct with the needed functions*/ 
     
    314323                goto err_free; 
    315324 
    316         /* Get MAC, PHY and RADIO revisions */ 
    317         srev = ath5k_hw_reg_read(hal, AR5K_SREV); 
    318         hal->ah_mac_srev = srev; 
    319         hal->ah_mac_version = AR5K_REG_MS(srev, AR5K_SREV_VER); 
    320         hal->ah_mac_revision = AR5K_REG_MS(srev, AR5K_SREV_REV); 
     325        /* Get PHY and RADIO revisions */ 
    321326        hal->ah_phy_revision = ath5k_hw_reg_read(hal, AR5K_PHY_CHIP_ID) & 
    322327                        0xffffffff;