Skip to contentSkip to conversation

megasas: Correct target/lun mapping

PATCH Applied Hannes Reinecke 2 participants 2 messages Nov 12, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 megasas: Correct target/lun mapping

The structure to reference a logical drive has an unused field, which can be used to carry the lun ID. This enabled seabios to establish the proper target/LUN mapping.

Cc Paolo Bonzini <[email protected]>
Cc Gerd Hofmann <[email protected]>
hw/megasas.c +1 -0
index 7a2036e..395feb3 100644
@@ -1080,6 +1080,7 @@ static int megasas_dcmd_ld_get_list(MegasasState *s, MegasasCmd *cmd)
         /* Logical device size is in blocks */
         bdrv_get_geometry(conf->bs, &ld_size);
         info.ld_list[num_ld_disks].ld.v.target_id = sdev->id;
+        info.ld_list[num_ld_disks].ld.v.lun_id = sdev->lun;
         info.ld_list[num_ld_disks].state = MFI_LD_STATE_OPTIMAL;
         info.ld_list[num_ld_disks].size = cpu_to_le64(ld_size);
         num_ld_disks++;
hw/mfi.h +1 -1
index 436b690..cd8355b 100644
@@ -1085,7 +1085,7 @@ struct mfi_pd_list {
 union mfi_ld_ref {
     struct {
         uint8_t target_id;
-        uint8_t reserved;
+        uint8_t lun_id;
         uint16_t seq;
     } v;
     uint32_t ref;
#1 lore raw

Il 12/11/2012 15:42, Hannes Reinecke ha scritto:

Quoted 7 lines

The structure to reference a logical drive has an unused field, which can be used to carry the lun ID. This enabled seabios to establish the proper target/LUN mapping.

Cc Paolo Bonzini <[email protected]>
Cc Gerd Hofmann <[email protected]>

Applied to scsi-next branch.

Paolo

Quoted 28 lines
hw/megasas.c +1 -0
index 7a2036e..395feb3 100644
@@ -1080,6 +1080,7 @@ static int megasas_dcmd_ld_get_list(MegasasState *s, MegasasCmd *cmd)
         /* Logical device size is in blocks */
         bdrv_get_geometry(conf->bs, &ld_size);
         info.ld_list[num_ld_disks].ld.v.target_id = sdev->id;
+        info.ld_list[num_ld_disks].ld.v.lun_id = sdev->lun;
         info.ld_list[num_ld_disks].state = MFI_LD_STATE_OPTIMAL;
         info.ld_list[num_ld_disks].size = cpu_to_le64(ld_size);
         num_ld_disks++;
hw/mfi.h +1 -1
index 436b690..cd8355b 100644
@@ -1085,7 +1085,7 @@ struct mfi_pd_list {
 union mfi_ld_ref {
     struct {
         uint8_t target_id;
-        uint8_t reserved;
+        uint8_t lun_id;
         uint16_t seq;
     } v;
     uint32_t ref;