Search Linux Wireless

Re: [BUG, ath9k]: NUL bytes at end of /sys/kernel/debug/ieee80211/phy0/ath9k/modal_eeprom

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

 



Hi Holger,

On Mon, May 14, 2012 at 6:55 PM, Mohammed Shafi
<shafi.wireless@xxxxxxxxx> wrote:
>>
>> root@/sys/kernel/debug/ieee80211/phy0/ath9k# xxd <modal_eeprom | tail -4
>> 0000630: 2036 0a20 2020 2020 2020 2054 5820 4469   6.        TX Di
>> 0000640: 7665 7273 6974 7920 3a20 2020 2020 2020  versity :
>> 0000650: 2020 2030 0a00 0000 0000 0000 0000 0000     0............
>> 0000660: 0000 0000 0000 0000 0000 0000            ............
>>

please try with the attached patch. seems to be working. i check if
its fine and review it internally. thank you!

-- 
thanks,
shafi
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
index ac53d90..3307814 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
@@ -3365,9 +3365,11 @@ static bool ath9k_hw_ar9300_fill_eeprom(struct ath_hw *ah)
 }
 
 #if defined(CONFIG_ATH9K_DEBUGFS) || defined(CONFIG_ATH9K_HTC_DEBUGFS)
-static u32 ar9003_dump_modal_eeprom(char *buf, u32 len, u32 size,
+static u32 ar9003_dump_modal_eeprom(char *buf, u32 size,
 				    struct ar9300_modal_eep_header *modal_hdr)
 {
+	u32 len = 0;
+
 	PR_EEP("Chain0 Ant. Control", le16_to_cpu(modal_hdr->antCtrlChain[0]));
 	PR_EEP("Chain1 Ant. Control", le16_to_cpu(modal_hdr->antCtrlChain[1]));
 	PR_EEP("Chain2 Ant. Control", le16_to_cpu(modal_hdr->antCtrlChain[2]));
@@ -3412,11 +3414,11 @@ static u32 ath9k_hw_ar9003_dump_eeprom(struct ath_hw *ah, bool dump_base_hdr,
 	if (!dump_base_hdr) {
 		len += snprintf(buf + len, size - len,
 				"%20s :\n", "2GHz modal Header");
-		len += ar9003_dump_modal_eeprom(buf, len, size,
+		len += ar9003_dump_modal_eeprom(buf + len, size - len,
 						&eep->modalHeader2G);
 		len += snprintf(buf + len, size - len,
 				"%20s :\n", "5GHz modal Header");
-		len += ar9003_dump_modal_eeprom(buf, len, size,
+		len += ar9003_dump_modal_eeprom(buf + len, size - len,
 						&eep->modalHeader5G);
 		goto out;
 	}
diff --git a/drivers/net/wireless/ath/ath9k/eeprom_4k.c b/drivers/net/wireless/ath/ath9k/eeprom_4k.c
index 4322ac8..9e7ca57 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom_4k.c
+++ b/drivers/net/wireless/ath/ath9k/eeprom_4k.c
@@ -72,9 +72,11 @@ static bool ath9k_hw_4k_fill_eeprom(struct ath_hw *ah)
 }
 
 #if defined(CONFIG_ATH9K_DEBUGFS) || defined(CONFIG_ATH9K_HTC_DEBUGFS)
-static u32 ath9k_dump_4k_modal_eeprom(char *buf, u32 len, u32 size,
+static u32 ath9k_dump_4k_modal_eeprom(char *buf, u32 size,
 				      struct modal_eep_4k_header *modal_hdr)
 {
+	u32 len = 0;
+
 	PR_EEP("Chain0 Ant. Control", modal_hdr->antCtrlChain[0]);
 	PR_EEP("Ant. Common Control", modal_hdr->antCtrlCommon);
 	PR_EEP("Chain0 Ant. Gain", modal_hdr->antennaGainCh[0]);
@@ -135,7 +137,7 @@ static u32 ath9k_hw_4k_dump_eeprom(struct ath_hw *ah, bool dump_base_hdr,
 	if (!dump_base_hdr) {
 		len += snprintf(buf + len, size - len,
 				"%20s :\n", "2GHz modal Header");
-		len += ath9k_dump_4k_modal_eeprom(buf, len, size,
+		len += ath9k_dump_4k_modal_eeprom(buf + len, size - len,
 						  &eep->modalHeader);
 		goto out;
 	}
diff --git a/drivers/net/wireless/ath/ath9k/eeprom_9287.c b/drivers/net/wireless/ath/ath9k/eeprom_9287.c
index aa61476..c2c077d 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom_9287.c
+++ b/drivers/net/wireless/ath/ath9k/eeprom_9287.c
@@ -76,9 +76,11 @@ static bool ath9k_hw_ar9287_fill_eeprom(struct ath_hw *ah)
 }
 
 #if defined(CONFIG_ATH9K_DEBUGFS) || defined(CONFIG_ATH9K_HTC_DEBUGFS)
-static u32 ar9287_dump_modal_eeprom(char *buf, u32 len, u32 size,
+static u32 ar9287_dump_modal_eeprom(char *buf, u32 size,
 				    struct modal_eep_ar9287_header *modal_hdr)
 {
+	u32 len = 0;
+
 	PR_EEP("Chain0 Ant. Control", modal_hdr->antCtrlChain[0]);
 	PR_EEP("Chain1 Ant. Control", modal_hdr->antCtrlChain[1]);
 	PR_EEP("Ant. Common Control", modal_hdr->antCtrlCommon);
@@ -132,7 +134,7 @@ static u32 ath9k_hw_ar9287_dump_eeprom(struct ath_hw *ah, bool dump_base_hdr,
 	if (!dump_base_hdr) {
 		len += snprintf(buf + len, size - len,
 				"%20s :\n", "2GHz modal Header");
-		len += ar9287_dump_modal_eeprom(buf, len, size,
+		len += ar9287_dump_modal_eeprom(buf + len, size - len,
 						&eep->modalHeader);
 		goto out;
 	}
diff --git a/drivers/net/wireless/ath/ath9k/eeprom_def.c b/drivers/net/wireless/ath/ath9k/eeprom_def.c
index b5fba8b..fb2eeaa 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom_def.c
+++ b/drivers/net/wireless/ath/ath9k/eeprom_def.c
@@ -133,9 +133,11 @@ static bool ath9k_hw_def_fill_eeprom(struct ath_hw *ah)
 #undef SIZE_EEPROM_DEF
 
 #if defined(CONFIG_ATH9K_DEBUGFS) || defined(CONFIG_ATH9K_HTC_DEBUGFS)
-static u32 ath9k_def_dump_modal_eeprom(char *buf, u32 len, u32 size,
+static u32 ath9k_def_dump_modal_eeprom(char *buf, u32 size,
 				       struct modal_eep_header *modal_hdr)
 {
+	u32 len = 0;
+
 	PR_EEP("Chain0 Ant. Control", modal_hdr->antCtrlChain[0]);
 	PR_EEP("Chain1 Ant. Control", modal_hdr->antCtrlChain[1]);
 	PR_EEP("Chain2 Ant. Control", modal_hdr->antCtrlChain[2]);
@@ -211,11 +213,11 @@ static u32 ath9k_hw_def_dump_eeprom(struct ath_hw *ah, bool dump_base_hdr,
 	if (!dump_base_hdr) {
 		len += snprintf(buf + len, size - len,
 				"%20s :\n", "2GHz modal Header");
-		len += ath9k_def_dump_modal_eeprom(buf, len, size,
+		len += ath9k_def_dump_modal_eeprom(buf + len, size - len,
 						   &eep->modalHeader[0]);
 		len += snprintf(buf + len, size - len,
 				"%20s :\n", "5GHz modal Header");
-		len += ath9k_def_dump_modal_eeprom(buf, len, size,
+		len += ath9k_def_dump_modal_eeprom(buf + len, size - len,
 						   &eep->modalHeader[1]);
 		goto out;
 	}

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux