]> git.ipfire.org Git - thirdparty/pciutils.git/commitdiff
Correct Device Serial Number output
authorMatthew Wilcox <matthew@wil.cx>
Fri, 27 Feb 2009 13:20:04 +0000 (06:20 -0700)
committerMartin Mares <mj@ucw.cz>
Wed, 4 Mar 2009 10:27:20 +0000 (11:27 +0100)
We are currently printing the Device Serial Number backwards.  Ben
Hutchings noticed that the DSN was an EUI-64 (derived from a MAC
address), but printed backwards.  Before:

        Capabilities: [140] Device Serial Number 97-62-84-ff-ff-3b-1f-00

After:
        Capabilities: [140] Device Serial Number 00-1f-3b-ff-ff-84-62-97

The MAC address is:

wlan0     Link encap:Ethernet  HWaddr 00:1f:3b:84:62:97

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
ls-ecaps.c

index e062d3c3e74961b629013b06b02dbd158da9c382..38da824f5696ca589a9a8267983d4d4c95914b67 100644 (file)
@@ -20,8 +20,8 @@ cap_dsn(struct device *d, int where)
   t1 = get_conf_long(d, where + 4);
   t2 = get_conf_long(d, where + 8);
   printf("Device Serial Number %02x-%02x-%02x-%02x-%02x-%02x-%02x-%02x\n",
-       t1 & 0xff, (t1 >> 8) & 0xff, (t1 >> 16) & 0xff, t1 >> 24,
-       t2 & 0xff, (t2 >> 8) & 0xff, (t2 >> 16) & 0xff, t2 >> 24);
+       t2 >> 24, (t2 >> 16) & 0xff, (t2 >> 8) & 0xff, t2 & 0xff,
+       t1 >> 24, (t1 >> 16) & 0xff, (t1 >> 8) & 0xff, t1 & 0xff);
 }
 
 static void