megaraid_sas : add endianess annotations
Subsystems (2)
PATCH RESEND 12/18 megaraid_sas : add endianess annotations
This adds endianness annotations to all data structures, and a few variables directly referencing them.
Signed-off-by Christoph Hellwig <[email protected]>
--- drivers/scsi/megaraid/megaraid_sas.h | 302 +++++++++++++------------- drivers/scsi/megaraid/megaraid_sas_base.c | 2 +- drivers/scsi/megaraid/megaraid_sas_fp.c | 10 +- drivers/scsi/megaraid/megaraid_sas_fusion.c | 2 +- drivers/scsi/megaraid/megaraid_sas_fusion.h | 276 ++++++++++++------------ 5 files changed, 296 insertions(+), 296 deletions(-)
drivers/scsi/megaraid/megaraid_sas.h +151 -151
@@ -414,7 +414,7 @@ enum MR_PD_STATE {* defines the physical drive address structure */ struct MR_PD_ADDRESS { -u16 deviceId; +__le16 deviceId;u16 enclDeviceId;union {
@@ -439,8 +439,8 @@ struct MR_PD_ADDRESS {* defines the physical drive list structure */ struct MR_PD_LIST { -u32 size; -u32 count; +__le32 size; +__le32 count;struct MR_PD_ADDRESS addr[1 ]; } __packed;
@@ -457,28 +457,28 @@ union MR_LD_REF {struct {u8 targetId;u8 reserved; -u16 seqNum; +__le16 seqNum; }; -u32 ref; +__le32 ref; } __packed;/* * defines the logical drive list structure */ struct MR_LD_LIST { -u32 ldCount; -u32 reserved; +__le32 ldCount; +__le32 reserved;struct {union MR_LD_REF ref;u8 state;u8 reserved[3 ]; -u64 size; +__le64 size; } ldList[MAX_LOGICAL_DRIVES_EXT ]; } __packed;struct MR_LD_TARGETID_LIST { -u32 size; -u32 count; +__le32 size; +__le32 count;u8 pad[3 ];u8 targetId[MAX_LOGICAL_DRIVES_EXT ]; };
@@ -559,7 +559,7 @@ struct megasas_ctrl_prop { } OnOffProperties;u8 autoSnapVDSpace;u8 viewSpace; -u16 spinDownTime; +__le16 spinDownTime;u8 reserved[24 ]; } __packed;
@@ -573,10 +573,10 @@ struct megasas_ctrl_info {*/ struct { -u16 vendor_id; -u16 device_id; -u16 sub_vendor_id; -u16 sub_device_id; +__le16 vendor_id; +__le16 device_id; +__le16 sub_vendor_id; +__le16 sub_device_id;u8 reserved[24 ]; } __attribute__ ((packed)) pci;
@@ -617,8 +617,8 @@ struct megasas_ctrl_info {/* * List of components residing in flash. All str are null terminated */ -u32 image_check_word; -u32 image_component_count; +__le32 image_check_word; +__le32 image_component_count;struct {
@@ -635,7 +635,7 @@ struct megasas_ctrl_info {* empty if a flash operation has not occurred. All stings are null * terminated */ -u32 pending_image_component_count; +__le32 pending_image_component_count;struct {
@@ -668,39 +668,39 @@ struct megasas_ctrl_info { } __attribute__ ((packed)) hw_present; -u32 current_fw_time; +__le32 current_fw_time;/* * Maximum data transfer sizes */ -u16 max_concurrent_cmds; -u16 max_sge_count; -u32 max_request_size; +__le16 max_concurrent_cmds; +__le16 max_sge_count; +__le32 max_request_size;/* * Logical and physical device counts */ -u16 ld_present_count; -u16 ld_degraded_count; -u16 ld_offline_count; +__le16 ld_present_count; +__le16 ld_degraded_count; +__le16 ld_offline_count; -u16 pd_present_count; -u16 pd_disk_present_count; -u16 pd_disk_pred_failure_count; -u16 pd_disk_failed_count; +__le16 pd_present_count; +__le16 pd_disk_present_count; +__le16 pd_disk_pred_failure_count; +__le16 pd_disk_failed_count;/* * Memory size information */ -u16 nvram_size; -u16 memory_size; -u16 flash_size; +__le16 nvram_size; +__le16 memory_size; +__le16 flash_size;/* * Error counters */ -u16 mem_correctable_error_count; -u16 mem_uncorrectable_error_count; +__le16 mem_correctable_error_count; +__le16 mem_uncorrectable_error_count;/* * Cluster information
@@ -711,7 +711,7 @@ struct megasas_ctrl_info {/* * Additional max data transfer sizes */ -u16 max_strips_per_io; +__le16 max_strips_per_io;/* * Controller capabilities structures
@@ -811,7 +811,7 @@ struct megasas_ctrl_info {* deviceInterface.portAddr, and the rest shall be * populated in deviceInterfacePortAddr2. */ -u64 deviceInterfacePortAddr2[8 ];/*6a0h */ +__le64 deviceInterfacePortAddr2[8 ];/*6a0h */ u8 reserved3[128 ];/*6e0h */ struct {/*760h */
@@ -848,26 +848,26 @@ struct megasas_ctrl_info {u16 reserved[6 ]; } pdsForRaidLevels; -u16 maxPds;/*780h */ -u16 maxDedHSPs;/*782h */ -u16 maxGlobalHSPs;/*784h */ -u16 ddfSize;/*786h */ +__le16 maxPds;/*780h */ +__le16 maxDedHSPs;/*782h */ +__le16 maxGlobalHSP;/*784h */ +__le16 ddfSize;/*786h */ u8 maxLdsPerArray;/*788h */ u8 partitionsInDDF;/*789h */ u8 lockKeyBinding;/*78ah */ u8 maxPITsPerLd;/*78bh */ u8 maxViewsPerLd;/*78ch */ u8 maxTargetId;/*78dh */ -u16 maxBvlVdSize;/*78eh */ +__le16 maxBvlVdSize;/*78eh */ -u16 maxConfigurableSSCSize;/*790h */ -u16 currentSSCsize;/*792h */ +__le16 maxConfigurableSSCSize;/*790h */ +__le16 currentSSCsize;/*792h */ char expanderFwVersion[12 ];/*794h */ -u16 PFKTrialTimeRemaining;/*7A0h */ +__le16 PFKTrialTimeRemaining;/*7A0h */ -u16 cacheMemorySize;/*7A2h */ +__le16 cacheMemorySize;/*7A2h */ struct {/*7A4h */ #if defined(__BIG_ENDIAN_BITFIELD)
@@ -937,7 +937,7 @@ struct megasas_ctrl_info {u8 temperatureROC;/*7C9h */ u8 temperatureCtrl;/*7CAh */ u8 reserved4;/*7CBh */ -u16 maxConfigurablePds;/*7CCh */ +__le16 maxConfigurablePds;/*7CCh */ u8 reserved5[2 ];/*0x7CDh */
@@ -1173,22 +1173,22 @@ struct megasas_register_set {struct megasas_sge32 { -u32 phys_addr; -u32 length; +__le32 phys_addr; +__le32 length; } __attribute__ ((packed));struct megasas_sge64 { -u64 phys_addr; -u32 length; +__le64 phys_addr; +__le32 length; } __attribute__ ((packed));struct megasas_sge_skinny { -u64 phys_addr; -u32 length; -u32 flag; +__le64 phys_addr; +__le32 length; +__le32 flag; } __packed;union megasas_sgl {
@@ -1211,12 +1211,12 @@ struct megasas_header {u8 cdb_len;/*06h */ u8 sge_count;/*07h */ -u32 context;/*08h */ -u32 pad_0;/*0Ch */ +__le32 context;/*08h */ +__le32 pad_0;/*0Ch */ -u16 flags;/*10h */ -u16 timeout;/*12h */ -u32 data_xferlen;/*14h */ +__le16 flags;/*10h */ +__le16 timeout;/*12h */ +__le32 data_xferlen;/*14h */ } __attribute__ ((packed));
@@ -1249,7 +1249,7 @@ typedef union _MFI_CAPABILITIES { u32 reserved:25;#endif } mfi_capabilities; -u32 reg; +__le32 reg; }MFI_CAPABILITIES ;struct megasas_init_frame {
@@ -1261,35 +1261,35 @@ struct megasas_init_frame {u8 reserved_1;/*03h */ MFI_CAPABILITIES driver_operations;/*04h*/ -u32 context;/*08h */ -u32 pad_0;/*0Ch */ +__le32 context;/*08h */ +__le32 pad_0;/*0Ch */ -u16 flags;/*10h */ -u16 reserved_3;/*12h */ -u32 data_xfer_len;/*14h */ +__le16 flags;/*10h */ +__le16 reserved_3;/*12h */ +__le32 data_xfer_len;/*14h */ -u32 queue_info_new_phys_addr_lo;/*18h */ -u32 queue_info_new_phys_addr_hi;/*1Ch */ -u32 queue_info_old_phys_addr_lo;/*20h */ -u32 queue_info_old_phys_addr_hi;/*24h */ -u32 reserved_4[2 ];/*28h */ -u32 system_info_lo;/*30h */ -u32 system_info_hi;/*34h */ -u32 reserved_5[2 ];/*38h */ +__le32 queue_info_new_phys_addr_lo;/*18h */ +__le32 queue_info_new_phys_addr_hi;/*1Ch */ +__le32 queue_info_old_phys_addr_lo;/*20h */ +__le32 queue_info_old_phys_addr_hi;/*24h */ +__le32 reserved_4[2 ];/*28h */ +__le32 system_info_lo;/*30h */ +__le32 system_info_hi;/*34h */ +__le32 reserved_5[2 ];/*38h */ } __attribute__ ((packed));struct megasas_init_queue_info { -u32 init_flags;/*00h */ -u32 reply_queue_entries;/*04h */ +__le32 init_flags;/*00h */ +__le32 reply_queue_entries;/*04h */ -u32 reply_queue_start_phys_addr_lo;/*08h */ -u32 reply_queue_start_phys_addr_hi;/*0Ch */ -u32 producer_index_phys_addr_lo;/*10h */ -u32 producer_index_phys_addr_hi;/*14h */ -u32 consumer_index_phys_addr_lo;/*18h */ -u32 consumer_index_phys_addr_hi;/*1Ch */ +__le32 reply_queue_start_phys_addr_lo;/*08h */ +__le32 reply_queue_start_phys_addr_hi;/*0Ch */ +__le32 producer_index_phys_addr_lo;/*10h */ +__le32 producer_index_phys_addr_hi;/*14h */ +__le32 consumer_index_phys_addr_lo;/*18h */ +__le32 consumer_index_phys_addr_hi;/*1Ch */ } __attribute__ ((packed));
@@ -1305,18 +1305,18 @@ struct megasas_io_frame {u8 reserved_0;/*06h */ u8 sge_count;/*07h */ -u32 context;/*08h */ -u32 pad_0;/*0Ch */ +__le32 context;/*08h */ +__le32 pad_0;/*0Ch */ -u16 flags;/*10h */ -u16 timeout;/*12h */ -u32 lba_count;/*14h */ +__le16 flags;/*10h */ +__le16 timeout;/*12h */ +__le32 lba_count;/*14h */ -u32 sense_buf_phys_addr_lo;/*18h */ -u32 sense_buf_phys_addr_hi;/*1Ch */ +__le32 sense_buf_phys_addr_lo;/*18h */ +__le32 sense_buf_phys_addr_hi;/*1Ch */ -u32 start_lba_lo;/*20h */ -u32 start_lba_hi;/*24h */ +__le32 start_lba_lo;/*20h */ +__le32 start_lba_hi;/*24h */ union megasas_sgl sgl;/*28h */
@@ -1334,15 +1334,15 @@ struct megasas_pthru_frame {u8 cdb_len;/*06h */ u8 sge_count;/*07h */ -u32 context;/*08h */ -u32 pad_0;/*0Ch */ +__le32 context;/*08h */ +__le32 pad_0;/*0Ch */ -u16 flags;/*10h */ -u16 timeout;/*12h */ -u32 data_xfer_len;/*14h */ +__le16 flags;/*10h */ +__le16 timeout;/*12h */ +__le32 data_xfer_len;/*14h */ -u32 sense_buf_phys_addr_lo;/*18h */ -u32 sense_buf_phys_addr_hi;/*1Ch */ +__le32 sense_buf_phys_addr_lo;/*18h */ +__le32 sense_buf_phys_addr_hi;/*1Ch */ u8 cdb[16 ];/*20h */ union megasas_sgl sgl;/*30h */
@@ -1357,19 +1357,19 @@ struct megasas_dcmd_frame {u8 reserved_1[4 ];/*03h */ u8 sge_count;/*07h */ -u32 context;/*08h */ -u32 pad_0;/*0Ch */ +__le32 context;/*08h */ +__le32 pad_0;/*0Ch */ -u16 flags;/*10h */ -u16 timeout;/*12h */ +__le16 flags;/*10h */ +__le16 timeout;/*12h */ -u32 data_xfer_len;/*14h */ -u32 opcode;/*18h */ +__le32 data_xfer_len;/*14h */ +__le32 opcode;/*18h */ union {/*1Ch */ u8 b[12 ]; -u16 s[6 ]; -u32 w[3 ]; +__le16 s[6 ]; +__le32 w[3 ]; } mbox;union megasas_sgl sgl;/*28h */
@@ -1383,22 +1383,22 @@ struct megasas_abort_frame {u8 cmd_status;/*02h */ u8 reserved_1;/*03h */ -u32 reserved_2;/*04h */ +__le32 reserved_2;/*04h */ -u32 context;/*08h */ -u32 pad_0;/*0Ch */ +__le32 context;/*08h */ +__le32 pad_0;/*0Ch */ -u16 flags;/*10h */ -u16 reserved_3;/*12h */ -u32 reserved_4;/*14h */ +__le16 flags;/*10h */ +__le16 reserved_3;/*12h */ +__le32 reserved_4;/*14h */ -u32 abort_context;/*18h */ -u32 pad_1;/*1Ch */ +__le32 abort_context;/*18h */ +__le32 pad_1;/*1Ch */ -u32 abort_mfi_phys_addr_lo;/*20h */ -u32 abort_mfi_phys_addr_hi;/*24h */ +__le32 abort_mfi_phys_addr_lo;/*20h */ +__le32 abort_mfi_phys_addr_hi;/*24h */ -u32 reserved_5[6 ];/*28h */ +__le32 reserved_5[6 ];/*28h */ } __attribute__ ((packed));
@@ -1412,14 +1412,14 @@ struct megasas_smp_frame {u8 reserved_2[3 ];/*04h */ u8 sge_count;/*07h */ -u32 context;/*08h */ -u32 pad_0;/*0Ch */ +__le32 context;/*08h */ +__le32 pad_0;/*0Ch */ -u16 flags;/*10h */ -u16 timeout;/*12h */ +__le16 flags;/*10h */ +__le16 timeout;/*12h */ -u32 data_xfer_len;/*14h */ -u64 sas_addr;/*18h */ +__le32 data_xfer_len;/*14h */ +__le64 sas_addr;/*18h */ union {struct megasas_sge32 sge32[2 ];/* [0]: resp [1]: req */
@@ -1439,16 +1439,16 @@ struct megasas_stp_frame {u8 reserved_3[2 ];/*05h */ u8 sge_count;/*07h */ -u32 context;/*08h */ -u32 pad_0;/*0Ch */ +__le32 context;/*08h */ +__le32 pad_0;/*0Ch */ -u16 flags;/*10h */ -u16 timeout;/*12h */ +__le16 flags;/*10h */ +__le16 timeout;/*12h */ -u32 data_xfer_len;/*14h */ +__le32 data_xfer_len;/*14h */ -u16 fis[10 ];/*18h */ -u32 stp_flags; +__le16 fis[10 ];/*18h */ +__le32 stp_flags;union {struct megasas_sge32 sge32[2 ];/* [0]: resp [1]: data */
@@ -1492,18 +1492,18 @@ union megasas_evt_class_locale { } __attribute__ ((packed));struct megasas_evt_log_info { -u32 newest_seq_num; -u32 oldest_seq_num; -u32 clear_seq_num; -u32 shutdown_seq_num; -u32 boot_seq_num; +__le32 newest_seq_num; +__le32 oldest_seq_num; +__le32 clear_seq_num; +__le32 shutdown_seq_num; +__le32 boot_seq_num; } __attribute__ ((packed));struct megasas_progress { -u16 progress; -u16 elapsed_seconds; +__le16 progress; +__le16 elapsed_seconds; } __attribute__ ((packed));
@@ -1524,9 +1524,9 @@ struct megasas_evtarg_pd {struct megasas_evt_detail { -u32 seq_num; -u32 time_stamp; -u32 code; +__le32 seq_num; +__le32 time_stamp; +__le32 code;union megasas_evt_class_locale cl;u8 arg_type;u8 reserved1[15 ];
@@ -1545,18 +1545,18 @@ struct megasas_evt_detail {struct {struct megasas_evtarg_ld ld; -u64 count; +__le64 count; } __attribute__ ((packed)) ld_count;struct { -u64 lba; +__le64 lba;struct megasas_evtarg_ld ld; } __attribute__ ((packed)) ld_lba;struct {struct megasas_evtarg_ld ld; -u32 prevOwner; -u32 newOwner; +__le32 prevOwner; +__le32 newOwner; } __attribute__ ((packed)) ld_owner;struct {
@@ -1613,7 +1613,7 @@ struct megasas_evt_detail {struct {u16 vendorId; -u16 deviceId; +__le16 deviceId;u16 subVendorId;u16 subDeviceId; } __attribute__ ((packed)) pci;
@@ -1633,9 +1633,9 @@ struct megasas_evt_detail { } __attribute__ ((packed)) ecc;u8 b[96 ]; -u16 s[48 ]; -u32 w[24 ]; -u64 d[12 ]; +__le16 s[48 ]; +__le32 w[24 ]; +__le64 d[12 ]; } args;char description[128 ];
@@ -1662,9 +1662,9 @@ struct MR_DRV_SYSTEM_INFO {struct megasas_instance { -u32 *producer; +__le32 *producer;dma_addr_t producer_h; -u32 *consumer; +__le32 *consumer;dma_addr_t consumer_h;struct MR_DRV_SYSTEM_INFO *system_info_buf;dma_addr_t system_info_h;
@@ -1675,7 +1675,7 @@ struct megasas_instance {struct MR_CTRL_HB_HOST_MEM *hb_host_mem;dma_addr_t hb_host_mem_h; -u32 *reply_queue; +__le32 *reply_queue;dma_addr_t reply_queue_h;u32 *crash_dump_buf;
@@ -1978,10 +1978,10 @@ u8 MR_TargetIdToLdGet(u32 ldTgtId, struct MR_DRV_RAID_MAP_ALL *map);struct MR_LD_RAID *MR_LdRaidGet (u32 ld,struct MR_DRV_RAID_MAP_ALL *map);u16 MR_ArPdGet (u32 ar,u32 arm,struct MR_DRV_RAID_MAP_ALL *map);u16 MR_LdSpanArrayGet (u32 ld,u32 span,struct MR_DRV_RAID_MAP_ALL *map); -u16 MR_PdDevHandleGet (u32 pd,struct MR_DRV_RAID_MAP_ALL *map); +__le16 MR_PdDevHandleGet (u32 pd,struct MR_DRV_RAID_MAP_ALL *map);u16 MR_GetLDTgtId (u32 ld,struct MR_DRV_RAID_MAP_ALL *map); -u16 get_updated_dev_handle (struct megasas_instance *instance, +__le16 get_updated_dev_handle (struct megasas_instance *instance,struct LD_LOAD_BALANCE_INFO *lbInfo,struct IO_REQUEST_INFO *in_info);void mr_update_load_balance_params (struct MR_DRV_RAID_MAP_ALL *map,struct LD_LOAD_BALANCE_INFO *lbInfo);
drivers/scsi/megaraid/megaraid_sas_base.c +1 -1
@@ -4232,7 +4232,7 @@ int megasas_set_crash_dump_params(struct megasas_instance *instance,static int megasas_issue_init_mfi (struct megasas_instance *instance) { -u32 context; +__le32 context;struct megasas_cmd *cmd;
drivers/scsi/megaraid/megaraid_sas_fp.c +5 -5
@@ -142,7 +142,7 @@ u16 MR_LdSpanArrayGet(u32 ld, u32 span, struct MR_DRV_RAID_MAP_ALL *map)return le16_to_cpu (map->raidMap.ldSpanMap[ld].spanBlock[span].span.arrayRef); } -u16 MR_PdDevHandleGet (u32 pd,struct MR_DRV_RAID_MAP_ALL *map) +__le16 MR_PdDevHandleGet (u32 pd,struct MR_DRV_RAID_MAP_ALL *map) {return map->raidMap.devHndlInfo[pd].curDevHdl; }
@@ -735,7 +735,7 @@ static u8 mr_spanset_get_phy_params(struct megasas_instance *instance, u32 ld,u8 retval = TRUE;u8 do_invader =0 ;u64 *pdBlock = &io_info->pdBlock; -u16 *pDevHandle = &io_info->devHandle; +__le16 *pDevHandle = &io_info->devHandle;u32 logArm, rowMod, armQ, arm; if ((instance->pdev->device == PCI_DEVICE_ID_LSI_INVADER ||
@@ -817,7 +817,7 @@ u8 MR_GetPhyParams(struct megasas_instance *instance, u32 ld, u64 stripRow,u8 retval = TRUE;u8 do_invader =0 ;u64 *pdBlock = &io_info->pdBlock; -u16 *pDevHandle = &io_info->devHandle; +__le16 *pDevHandle = &io_info->devHandle;if ((instance->pdev->device ==PCI_DEVICE_ID_LSI_INVADER || instance->pdev->device ==PCI_DEVICE_ID_LSI_FURY ))
@@ -1341,11 +1341,11 @@ u8 megasas_get_best_arm_pd(struct megasas_instance *instance,return io_info->pd_after_lb; } -u16 get_updated_dev_handle (struct megasas_instance *instance, +__le16 get_updated_dev_handle (struct megasas_instance *instance,struct LD_LOAD_BALANCE_INFO *lbInfo,struct IO_REQUEST_INFO *io_info) {u8 arm_pd; -u16 devHandle; +__le16 devHandle;struct fusion_context *fusion;struct MR_DRV_RAID_MAP_ALL *drv_map;
drivers/scsi/megaraid/megaraid_sas_fusion.c +1 -1
@@ -1667,7 +1667,7 @@ static void megasas_build_ld_nonrw_fusion(struct megasas_instance *instance,struct MR_DRV_RAID_MAP_ALL *local_map_ptr;struct fusion_context *fusion = instance->ctrl_context;u8 span, physArm; -u16 devHandle; +__le16 devHandle;u32 ld, arRef, pd;struct MR_LD_RAID *raid;struct RAID_CONTEXT *pRAID_Context;
drivers/scsi/megaraid/megaraid_sas_fusion.h +138 -138
534 lines not on this page · raw message
Signature · 1 line
1.7.1
Quoted 5 lines · On 04/20/2015 02:34 PM, [email protected] wrote:
This adds endianness annotations to all data structures, and a few variables directly referencing them.
Signed-off-by Christoph Hellwig <[email protected]>---
Reviewed-by Hannes Reinecke <[email protected]>
Cheers,
Hannes
Signature · 8 lines
Dr. Hannes Reinecke zSeries & Storage [email protected] +49 911 74053 688 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg) -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 4 lines · On 04/20/2015 02:34 PM, [email protected] wrote:
This adds endianness annotations to all data structures, and a few variables directly referencing them.
Signed-off-by Christoph Hellwig <[email protected]>
Reviewed-by Tomas Henzl <[email protected]>
Tomas