Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

hpsa: define extended_report_lun_entry data structure

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Reviewed-by: Joe Handzik <joseph.t.handzik@hp.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>

authored by

Stephen M. Cameron and committed by
Christoph Hellwig
d5b5d964 0b57075d

+19 -14
+8 -13
drivers/scsi/hpsa.c
··· 2869 2869 nphysicals = be32_to_cpu(*((__be32 *)physicals->LUNListLength)) / 2870 2870 responsesize; 2871 2871 2872 - 2873 2872 /* find ioaccel2 handle in list of physicals: */ 2874 2873 for (i = 0; i < nphysicals; i++) { 2874 + struct ext_report_lun_entry *entry = &physicals->LUN[i]; 2875 + 2875 2876 /* handle is in bytes 28-31 of each lun */ 2876 - if (memcmp(&((struct ReportExtendedLUNdata *) 2877 - physicals)->LUN[i][20], &find, 4) != 0) { 2877 + if (entry->ioaccel_handle != find) 2878 2878 continue; /* didn't match */ 2879 - } 2880 2879 found = 1; 2881 - memcpy(scsi3addr, &((struct ReportExtendedLUNdata *) 2882 - physicals)->LUN[i][0], 8); 2880 + memcpy(scsi3addr, entry->lunid, 8); 2883 2881 if (h->raid_offload_debug > 0) 2884 2882 dev_info(&h->pdev->dev, 2885 - "%s: Searched h=0x%08x, Found h=0x%08x, scsiaddr 0x%02x%02x%02x%02x%02x%02x%02x%02x\n", 2883 + "%s: Searched h=0x%08x, Found h=0x%08x, scsiaddr 0x%8phN\n", 2886 2884 __func__, find, 2887 - ((struct ReportExtendedLUNdata *) 2888 - physicals)->LUN[i][20], 2889 - scsi3addr[0], scsi3addr[1], scsi3addr[2], 2890 - scsi3addr[3], scsi3addr[4], scsi3addr[5], 2891 - scsi3addr[6], scsi3addr[7]); 2885 + entry->ioaccel_handle, scsi3addr); 2892 2886 break; /* found it */ 2893 2887 } 2894 2888 ··· 2967 2973 return RAID_CTLR_LUNID; 2968 2974 2969 2975 if (i < logicals_start) 2970 - return &physdev_list->LUN[i - (raid_ctlr_position == 0)][0]; 2976 + return &physdev_list->LUN[i - 2977 + (raid_ctlr_position == 0)].lunid[0]; 2971 2978 2972 2979 if (i < last_device) 2973 2980 return &logdev_list->LUN[i - nphysicals -
+11 -1
drivers/scsi/hpsa_cmd.h
··· 238 238 u8 LUN[HPSA_MAX_LUN][8]; 239 239 }; 240 240 241 + struct ext_report_lun_entry { 242 + u8 lunid[8]; 243 + u8 wwid[8]; 244 + u8 device_type; 245 + u8 device_flags; 246 + u8 lun_count; /* multi-lun device, how many luns */ 247 + u8 redundant_paths; 248 + u32 ioaccel_handle; /* ioaccel1 only uses lower 16 bits */ 249 + }; 250 + 241 251 struct ReportExtendedLUNdata { 242 252 u8 LUNListLength[4]; 243 253 u8 extended_response_flag; 244 254 u8 reserved[3]; 245 - u8 LUN[HPSA_MAX_LUN][24]; 255 + struct ext_report_lun_entry LUN[HPSA_MAX_LUN]; 246 256 }; 247 257 248 258 struct SenseSubsystem_info {