summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichal Schmidt <mschmidt@redhat.com>2015-07-22 13:41:33 +0200
committerMichal Schmidt <mschmidt@redhat.com>2015-07-22 13:41:33 +0200
commit75cb22f1bf5a4ca465221f6041be96d10c95ff8d (patch)
tree1125d034e43005d5c02d09b7483e48209f5839fc /src
parent3ddcc19509276c821507e37e42491a3a42f0df81 (diff)
parent01f61d331bb5038f0c877ac03c54333328b6ea28 (diff)
Merge pull request #651 from keszybz/ata_id-wwn-ordering
ata_id: unreverse WWN identifier
Diffstat (limited to 'src')
-rw-r--r--src/udev/ata_id/ata_id.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/udev/ata_id/ata_id.c b/src/udev/ata_id/ata_id.c
index 7ba0b7fc8f..a59d4c6d50 100644
--- a/src/udev/ata_id/ata_id.c
+++ b/src/udev/ata_id/ata_id.c
@@ -638,10 +638,20 @@ int main(int argc, char *argv[])
* All other values are reserved.
*/
word = identify.wyde[108];
- if ((word & 0xf000) == 0x5000)
+ if ((word & 0xf000) == 0x5000) {
+ uint64_t wwwn;
+
+ wwwn = identify.wyde[108];
+ wwwn <<= 16;
+ wwwn |= identify.wyde[109];
+ wwwn <<= 16;
+ wwwn |= identify.wyde[110];
+ wwwn <<= 16;
+ wwwn |= identify.wyde[111];
printf("ID_WWN=0x%1$" PRIx64 "\n"
"ID_WWN_WITH_EXTENSION=0x%1$" PRIx64 "\n",
- identify.octa[108/4]);
+ wwwn);
+ }
/* from Linux's include/linux/ata.h */
if (identify.wyde[0] == 0x848a ||