Fix byte order of ATA WWN when converting it to SCSI LUN ID.

This commit is contained in:
Alexander Motin 2013-05-06 15:58:53 +00:00
parent 4c8add8a96
commit 5ab64734f3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=250298

View File

@ -834,6 +834,7 @@ device_fail: if ((path->device->flags & CAM_DEV_UNCONFIGURED) == 0)
{ {
struct ccb_pathinq cpi; struct ccb_pathinq cpi;
int16_t *ptr; int16_t *ptr;
int i;
ident_buf = &softc->ident_data; ident_buf = &softc->ident_data;
for (ptr = (int16_t *)ident_buf; for (ptr = (int16_t *)ident_buf;
@ -913,8 +914,10 @@ device_fail: if ((path->device->flags & CAM_DEV_UNCONFIGURED) == 0)
path->device->device_id_len = 16; path->device->device_id_len = 16;
bcopy(&fake_device_id_hdr, bcopy(&fake_device_id_hdr,
path->device->device_id, 8); path->device->device_id, 8);
bcopy(ident_buf->wwn, for (i = 0; i < 4; i++) {
path->device->device_id + 8, 8); ptr = (int16_t *)(path->device->device_id + 8);
ptr[i] = bswap16(ident_buf->wwn[i]);
}
} }
} }