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/madwifi-old-openhal/openhal/ath5k_hw.c

    r2669 r2703  
    488488        hal->ah_ant_diversity = AR5K_TUNE_ANT_DIVERSITY; 
    489489 
    490         switch (device) { 
    491                 case PCI_PRODUCT_ATHEROS_AR2413: 
    492                 case PCI_PRODUCT_ATHEROS_AR5413: 
    493                 case PCI_PRODUCT_ATHEROS_AR5424: 
     490        /* 
     491         * Set the mac revision based on the pci id 
     492         */ 
     493        hal->ah_version = mac_version; 
     494 
     495        if (hal->ah_version == AR5K_AR5212) 
     496                hal->ah_magic = AR5K_EEPROM_MAGIC_5212; 
     497        else if (hal->ah_version == AR5K_AR5211) 
     498                hal->ah_magic = AR5K_EEPROM_MAGIC_5211; 
     499 
     500        /* Get MAC revision */ 
     501        srev = AR5K_REG_READ(AR5K_SREV); 
     502        hal->ah_mac_srev = srev; 
     503        hal->ah_mac_version = AR5K_REG_MS(srev, AR5K_SREV_VER); 
     504        hal->ah_mac_revision = AR5K_REG_MS(srev, AR5K_SREV_REV); 
     505 
     506        switch (srev) { 
     507                case AR5K_SREV_VER_AR2424: 
     508                case AR5K_SREV_VER_AR5424: 
     509                case AR5K_SREV_VER_AR5413: 
     510                case AR5K_SREV_VER_AR5414: 
    494511                        /* 
    495512                         * Known single chip solutions 
     
    505522        } 
    506523 
    507         /* 
    508          * Set the mac revision based on the pci id 
    509          */ 
    510         hal->ah_version = mac_version; 
    511  
    512         if (hal->ah_version == AR5K_AR5212) 
    513                 hal->ah_magic = AR5K_EEPROM_MAGIC_5212; 
    514         else if (hal->ah_version == AR5K_AR5211) 
    515                 hal->ah_magic = AR5K_EEPROM_MAGIC_5211; 
    516  
    517524        /* Bring device out of sleep and reset it's units */ 
    518525        if (ath5k_hw_nic_wakeup(hal, AR5K_INIT_MODE, TRUE) != TRUE) 
    519526                goto failed; 
    520527 
    521         /* Get MAC, PHY and RADIO revisions */ 
    522         srev = AR5K_REG_READ(AR5K_SREV); 
    523         hal->ah_mac_srev = srev; 
    524         hal->ah_mac_version = AR5K_REG_MS(srev, AR5K_SREV_VER); 
    525         hal->ah_mac_revision = AR5K_REG_MS(srev, AR5K_SREV_REV); 
     528        /* Get PHY and RADIO revisions */ 
    526529        hal->ah_phy_revision =  
    527530                AR5K_REG_READ(AR5K_PHY_CHIP_ID) & 0x00ffffffff; 
     
    623626        *status = AR5K_OK; 
    624627 
    625         printk(KERN_INFO "ath_hal: Atheros HW found \n"); 
    626         printk(KERN_INFO "ath_hal: MAC version: %s\n", 
    627                 ath5k_hw_get_part_name(AR5K_VERSION_VER,hal->ah_mac_srev)); 
    628         printk(KERN_INFO "ath_hal: PHY version: %s\n", 
    629                 ath5k_hw_get_part_name(AR5K_VERSION_RAD,hal->ah_radio_5ghz_revision)); 
     628        printk(KERN_INFO "ath_hal: MAC revision: %s (0x%x)\n", 
     629                ath5k_hw_get_part_name(AR5K_VERSION_VER,hal->ah_mac_srev), 
     630                                        hal->ah_mac_srev); 
     631        if((AR5K_MODE_11B & hal->ah_capabilities.cap_mode) && 
     632        (AR5K_MODE_11A & hal->ah_capabilities.cap_mode)){ 
     633                printk(KERN_INFO "ath_hal: PHY revision: %s (0x%x)\n", 
     634                        ath5k_hw_get_part_name(AR5K_VERSION_RAD, 
     635                                                hal->ah_radio_5ghz_revision), 
     636                                                hal->ah_radio_5ghz_revision); 
     637        } 
     638        if((AR5K_MODE_11B & hal->ah_capabilities.cap_mode) && 
     639        !(AR5K_MODE_11A & hal->ah_capabilities.cap_mode)){ 
     640                printk(KERN_INFO "ath_hal: 2Ghz PHY revision: %s (0x%x)\n", 
     641                        ath5k_hw_get_part_name(AR5K_VERSION_RAD, 
     642                                                hal->ah_radio_2ghz_revision), 
     643                                                hal->ah_radio_2ghz_revision); 
     644        } 
     645        if(!(AR5K_MODE_11B & hal->ah_capabilities.cap_mode) && 
     646        (AR5K_MODE_11A & hal->ah_capabilities.cap_mode)){ 
     647                printk(KERN_INFO "ath_hal: 5Ghz PHY revision: %s (0x%x)\n", 
     648                        ath5k_hw_get_part_name(AR5K_VERSION_RAD, 
     649                                                hal->ah_radio_5ghz_revision), 
     650                                                hal->ah_radio_5ghz_revision); 
     651        } 
    630652        printk(KERN_INFO "ath_hal: EEPROM version: %x.%x\n", 
    631653                (hal->ah_ee_version & 0xF000) >> 12, hal->ah_ee_version & 0xFFF); 
     
    64016423{ 
    64026424        struct ath5k_srev_name names[] = AR5K_SREV_NAME; 
    6403         const char *name = "xxxx"; 
     6425        const char *name = "xxxxx"; 
    64046426        int i; 
    64056427 
    64066428        for (i = 0; i < AR5K_ELEMENTS(names); i++) { 
    6407                 if (type == AR5K_VERSION_DEV) { 
    6408                         if (names[i].sr_type == type && 
    6409                                 names[i].sr_val == val) { 
    6410                                 name = names[i].sr_name; 
    6411                                 break; 
    6412                         } 
    6413                         continue; 
    6414                 } 
    64156429                if (names[i].sr_type != type || 
    64166430                    names[i].sr_val == AR5K_SREV_UNKNOWN)