From: Matthew Wilcox Date: Fri, 27 Feb 2009 13:20:04 +0000 (-0700) Subject: Correct Device Serial Number output X-Git-Tag: v3.1.3~17 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=6f9f8fd740d30111953c38944214f2857cca5894;p=pciutils.git Correct Device Serial Number output 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 --- diff --git a/ls-ecaps.c b/ls-ecaps.c index e062d3c..38da824 100644 --- a/ls-ecaps.c +++ b/ls-ecaps.c @@ -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