Search Linux Wireless

[PATCH 5/7] athk: Use SREV to identify single-chip solutions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Use SREV instead of pci id to identify single chip solutions.

Srev is more accurate info to identify the chip + this makes 
it possible to identify some 5424 chips found on thinkpads with
faulty 5212 pci id.

Changes-licensed-under: ISC
Signed-Off-by: Nick Kossifidis <mickflemm@xxxxxxxxx>

---
diff --git a/drivers/net/wireless/ath5k/hw.c b/drivers/net/wireless/ath5k/hw.c
index c8d1fbd..1c10203 100644
--- a/drivers/net/wireless/ath5k/hw.c
+++ b/drivers/net/wireless/ath5k/hw.c
@@ -229,23 +229,6 @@ struct ath5k_hw *ath5k_hw_attach(u16 device, u8 mac_version, void *sc,
 	ah->ah_software_retry = false;
 	ah->ah_ant_diversity = AR5K_TUNE_ANT_DIVERSITY;
 
-	switch (device) {
-	case PCI_DEVICE_ID_ATHEROS_AR2413:
-	case PCI_DEVICE_ID_ATHEROS_AR5413:
-	case PCI_DEVICE_ID_ATHEROS_AR5424:
-		/*
-		 * Known single chip solutions
-		 */
-		ah->ah_single_chip = true;
-		break;
-	default:
-		/*
-		 * Multi chip solutions
-		 */
-		ah->ah_single_chip = false;
-		break;
-	}
-
 	/*
 	 * Set the mac revision based on the pci id
 	 */
@@ -295,6 +278,14 @@ struct ath5k_hw *ath5k_hw_attach(u16 device, u8 mac_version, void *sc,
 		ah->ah_radio_2ghz_revision = ath5k_hw_radio_revision(ah,
 				CHANNEL_2GHZ);
 
+	/* Identify single chip solutions */
+	if((srev <= AR5K_SREV_VER_AR5414) &&
+	(srev >= AR5K_SREV_VER_AR2424)) {
+		ah->ah_single_chip = true;
+	} else {
+		ah->ah_single_chip = false;
+	}
+
 	/* Single chip radio */
 	if (ah->ah_radio_2ghz_revision == ah->ah_radio_5ghz_revision)
 		ah->ah_radio_2ghz_revision = 0;



-
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux