Linux MIPS Architecture development
 help / color / mirror / Atom feed
* [patch 2.4] au1x00 prom.c hw addr case insensitivity fix
@ 2003-02-05  4:19 Dan Hopper
  0 siblings, 0 replies; only message in thread
From: Dan Hopper @ 2003-02-05  4:19 UTC (permalink / raw)
  To: linux-mips

[-- Attachment #1: Type: text/plain, Size: 469 bytes --]

Hi folks,

Attached please find a short fix to str2hexnum() in
arch/mips/au1000/common/prom.c of the 2.4 branch.  With this fix,
the contents of the "ethaddr" entry in the environment table passed
by the bootloader to the kernel can have upper case hexadecimal
digits.  

Without the patch, an address such as ethaddr =
"00:50:C2:0C:20:4f" is silently converted to "00:50:02:00:20:4f",
making for some serious head scratching if you're trying to bootp
the kernel.

Dan

[-- Attachment #2: prom.c.uppercase_macaddr.patch --]
[-- Type: text/plain, Size: 415 bytes --]

--- arch/mips/au1000/common/prom.c.orig	Tue Feb  4 20:38:28 2003
+++ arch/mips/au1000/common/prom.c	Tue Feb  4 22:09:17 2003
@@ -105,9 +105,11 @@
 inline unsigned char str2hexnum(unsigned char c)
 {
 	if(c >= '0' && c <= '9')
-	return c - '0';
+		return c - '0';
 	if(c >= 'a' && c <= 'f')
-	return c - 'a' + 10;
+		return c - 'a' + 10;
+	if(c >= 'A' && c <= 'F')
+		return c - 'A' + 10;
 	return 0; /* foo */
 }
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-02-05  4:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-05  4:19 [patch 2.4] au1x00 prom.c hw addr case insensitivity fix Dan Hopper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox