[PATCH 2/3] Clarify error message when loading mac addresses

Olof Johansson dev at skyshaper.net
Tue Jun 4 04:35:31 EDT 2013


Currently the mac address printout is wrong since it says it can't
readd MAC_ADDR0 for mac addresses where it doesn't even try to do
this.

Use this message only for addr[0] and another for the ones where we
use locally assigned addresses.

Signed-off-by: Olof Johansson <dev at skyshaper.net>
---
 main.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/main.c b/main.c
index bcdc7c3..662327e 100644
--- a/main.c
+++ b/main.c
@@ -708,13 +708,14 @@ static int wcn36xx_read_mac_addresses(struct wcn36xx *wcn)
 						  wcn->dev);

 		if (status) {
-			wcn36xx_warn("Failed to read macaddress file %s, using a random
address instead",
-				     files[i]);
 			if (i == 0) {
 				/* Assign a random mac with Qualcomm oui */
+				wcn36xx_warn("Failed to read macaddress file %s, using a random
address instead",
+					     files[i]);
 				memcpy(wcn->addresses[i].addr, qcom_oui, 3);
 				get_random_bytes(wcn->addresses[i].addr + 3, 3);
 			} else {
+				wcn36xx_warn("Failed to read macaddress file, using a random
address instead");
 				/* Assign locally administered mac addresses to
 				 * all but the first mac */
 				memcpy(wcn->addresses[i].addr,
-- 
1.8.2.2



More information about the wcn36xx mailing list