20
20
#ifndef HPSA_CMD_H
21
21
#define HPSA_CMD_H
22
22
23
+ #include <linux/compiler.h>
24
+
23
25
/* general boundary defintions */
24
26
#define SENSEINFOBYTES 32 /* may vary between hbas */
25
27
#define SG_ENTRIES_IN_CMD 32 /* Max SG entries excluding chain blocks */
@@ -200,12 +202,10 @@ union u64bit {
200
202
MAX_EXT_TARGETS + 1) /* + 1 is for the controller itself */
201
203
202
204
/* SCSI-3 Commands */
203
- #pragma pack(1)
204
-
205
205
#define HPSA_INQUIRY 0x12
206
206
struct InquiryData {
207
207
u8 data_byte [36 ];
208
- };
208
+ } __packed ;
209
209
210
210
#define HPSA_REPORT_LOG 0xc2 /* Report Logical LUNs */
211
211
#define HPSA_REPORT_PHYS 0xc3 /* Report Physical LUNs */
@@ -221,7 +221,7 @@ struct raid_map_disk_data {
221
221
u8 xor_mult [2 ]; /**< XOR multipliers for this position,
222
222
* valid for data disks only */
223
223
u8 reserved [2 ];
224
- };
224
+ } __packed ;
225
225
226
226
struct raid_map_data {
227
227
__le32 structure_size ; /* Size of entire structure in bytes */
@@ -247,14 +247,14 @@ struct raid_map_data {
247
247
__le16 dekindex ; /* Data encryption key index. */
248
248
u8 reserved [16 ];
249
249
struct raid_map_disk_data data [RAID_MAP_MAX_ENTRIES ];
250
- };
250
+ } __packed ;
251
251
252
252
struct ReportLUNdata {
253
253
u8 LUNListLength [4 ];
254
254
u8 extended_response_flag ;
255
255
u8 reserved [3 ];
256
256
u8 LUN [HPSA_MAX_LUN ][8 ];
257
- };
257
+ } __packed ;
258
258
259
259
struct ext_report_lun_entry {
260
260
u8 lunid [8 ];
@@ -269,20 +269,20 @@ struct ext_report_lun_entry {
269
269
u8 lun_count ; /* multi-lun device, how many luns */
270
270
u8 redundant_paths ;
271
271
u32 ioaccel_handle ; /* ioaccel1 only uses lower 16 bits */
272
- };
272
+ } __packed ;
273
273
274
274
struct ReportExtendedLUNdata {
275
275
u8 LUNListLength [4 ];
276
276
u8 extended_response_flag ;
277
277
u8 reserved [3 ];
278
278
struct ext_report_lun_entry LUN [HPSA_MAX_PHYS_LUN ];
279
- };
279
+ } __packed ;
280
280
281
281
struct SenseSubsystem_info {
282
282
u8 reserved [36 ];
283
283
u8 portname [8 ];
284
284
u8 reserved1 [1108 ];
285
- };
285
+ } __packed ;
286
286
287
287
/* BMIC commands */
288
288
#define BMIC_READ 0x26
@@ -317,36 +317,36 @@ union SCSI3Addr {
317
317
u8 Targ :6 ;
318
318
u8 Mode :2 ; /* b10 */
319
319
} LogUnit ;
320
- };
320
+ } __packed ;
321
321
322
322
struct PhysDevAddr {
323
323
u32 TargetId :24 ;
324
324
u32 Bus :6 ;
325
325
u32 Mode :2 ;
326
326
/* 2 level target device addr */
327
327
union SCSI3Addr Target [2 ];
328
- };
328
+ } __packed ;
329
329
330
330
struct LogDevAddr {
331
331
u32 VolId :30 ;
332
332
u32 Mode :2 ;
333
333
u8 reserved [4 ];
334
- };
334
+ } __packed ;
335
335
336
336
union LUNAddr {
337
337
u8 LunAddrBytes [8 ];
338
338
union SCSI3Addr SCSI3Lun [4 ];
339
339
struct PhysDevAddr PhysDev ;
340
340
struct LogDevAddr LogDev ;
341
- };
341
+ } __packed ;
342
342
343
343
struct CommandListHeader {
344
344
u8 ReplyQueue ;
345
345
u8 SGList ;
346
346
__le16 SGTotal ;
347
347
__le64 tag ;
348
348
union LUNAddr LUN ;
349
- };
349
+ } __packed ;
350
350
351
351
struct RequestBlock {
352
352
u8 CDBLen ;
@@ -365,18 +365,18 @@ struct RequestBlock {
365
365
#define GET_DIR (tad ) (((tad) >> 6) & 0x03)
366
366
u16 Timeout ;
367
367
u8 CDB [16 ];
368
- };
368
+ } __packed ;
369
369
370
370
struct ErrDescriptor {
371
371
__le64 Addr ;
372
372
__le32 Len ;
373
- };
373
+ } __packed ;
374
374
375
375
struct SGDescriptor {
376
376
__le64 Addr ;
377
377
__le32 Len ;
378
378
__le32 Ext ;
379
- };
379
+ } __packed ;
380
380
381
381
union MoreErrInfo {
382
382
struct {
@@ -390,15 +390,16 @@ union MoreErrInfo {
390
390
u8 offense_num ; /* byte # of offense 0-base */
391
391
u32 offense_value ;
392
392
} Invalid_Cmd ;
393
- };
393
+ } __packed ;
394
+
394
395
struct ErrorInfo {
395
396
u8 ScsiStatus ;
396
397
u8 SenseLen ;
397
398
u16 CommandStatus ;
398
399
u32 ResidualCnt ;
399
400
union MoreErrInfo MoreErrInfo ;
400
401
u8 SenseInfo [SENSEINFOBYTES ];
401
- };
402
+ } __packed ;
402
403
/* Command types */
403
404
#define CMD_IOCTL_PEND 0x01
404
405
#define CMD_SCSI 0x03
@@ -451,7 +452,7 @@ struct CommandList {
451
452
bool retry_pending ;
452
453
struct hpsa_scsi_dev_t * device ;
453
454
atomic_t refcount ; /* Must be last to avoid memset in hpsa_cmd_init() */
454
- } __aligned (COMMANDLIST_ALIGNMENT );
455
+ } __packed __aligned (COMMANDLIST_ALIGNMENT );
455
456
456
457
/* Max S/G elements in I/O accelerator command */
457
458
#define IOACCEL1_MAXSGENTRIES 24
@@ -489,7 +490,7 @@ struct io_accel1_cmd {
489
490
__le64 host_addr ; /* 0x70 - 0x77 */
490
491
u8 CISS_LUN [8 ]; /* 0x78 - 0x7F */
491
492
struct SGDescriptor SG [IOACCEL1_MAXSGENTRIES ];
492
- } __aligned (IOACCEL1_COMMANDLIST_ALIGNMENT );
493
+ } __packed __aligned (IOACCEL1_COMMANDLIST_ALIGNMENT );
493
494
494
495
#define IOACCEL1_FUNCTION_SCSIIO 0x00
495
496
#define IOACCEL1_SGLOFFSET 32
@@ -519,7 +520,7 @@ struct ioaccel2_sg_element {
519
520
u8 chain_indicator ;
520
521
#define IOACCEL2_CHAIN 0x80
521
522
#define IOACCEL2_LAST_SG 0x40
522
- };
523
+ } __packed ;
523
524
524
525
/*
525
526
* SCSI Response Format structure for IO Accelerator Mode 2
@@ -559,7 +560,7 @@ struct io_accel2_scsi_response {
559
560
u8 sense_data_len ; /* sense/response data length */
560
561
u8 resid_cnt [4 ]; /* residual count */
561
562
u8 sense_data_buff [32 ]; /* sense/response data buffer */
562
- };
563
+ } __packed ;
563
564
564
565
/*
565
566
* Structure for I/O accelerator (mode 2 or m2) commands.
@@ -592,7 +593,7 @@ struct io_accel2_cmd {
592
593
__le32 tweak_upper ; /* Encryption tweak, upper 4 bytes */
593
594
struct ioaccel2_sg_element sg [IOACCEL2_MAXSGENTRIES ];
594
595
struct io_accel2_scsi_response error_data ;
595
- } __aligned (IOACCEL2_COMMANDLIST_ALIGNMENT );
596
+ } __packed __aligned (IOACCEL2_COMMANDLIST_ALIGNMENT );
596
597
597
598
/*
598
599
* defines for Mode 2 command struct
@@ -618,15 +619,15 @@ struct hpsa_tmf_struct {
618
619
__le64 abort_tag ; /* cciss tag of SCSI cmd or TMF to abort */
619
620
__le64 error_ptr ; /* Error Pointer */
620
621
__le32 error_len ; /* Error Length */
621
- } __aligned (IOACCEL2_COMMANDLIST_ALIGNMENT );
622
+ } __packed __aligned (IOACCEL2_COMMANDLIST_ALIGNMENT );
622
623
623
624
/* Configuration Table Structure */
624
625
struct HostWrite {
625
626
__le32 TransportRequest ;
626
627
__le32 command_pool_addr_hi ;
627
628
__le32 CoalIntDelay ;
628
629
__le32 CoalIntCount ;
629
- };
630
+ } __packed ;
630
631
631
632
#define SIMPLE_MODE 0x02
632
633
#define PERFORMANT_MODE 0x04
@@ -675,7 +676,7 @@ struct CfgTable {
675
676
#define HPSA_EVENT_NOTIFY_ACCEL_IO_PATH_STATE_CHANGE (1 << 30)
676
677
#define HPSA_EVENT_NOTIFY_ACCEL_IO_PATH_CONFIG_CHANGE (1 << 31)
677
678
__le32 clear_event_notify ;
678
- };
679
+ } __packed ;
679
680
680
681
#define NUM_BLOCKFETCH_ENTRIES 8
681
682
struct TransTable_struct {
@@ -686,14 +687,14 @@ struct TransTable_struct {
686
687
__le32 RepQCtrAddrHigh32 ;
687
688
#define MAX_REPLY_QUEUES 64
688
689
struct vals32 RepQAddr [MAX_REPLY_QUEUES ];
689
- };
690
+ } __packed ;
690
691
691
692
struct hpsa_pci_info {
692
693
unsigned char bus ;
693
694
unsigned char dev_fn ;
694
695
unsigned short domain ;
695
696
u32 board_id ;
696
- };
697
+ } __packed ;
697
698
698
699
struct bmic_identify_controller {
699
700
u8 configured_logical_drive_count ; /* offset 0 */
@@ -702,7 +703,7 @@ struct bmic_identify_controller {
702
703
u8 pad2 [136 ];
703
704
u8 controller_mode ; /* offset 292 */
704
705
u8 pad3 [32 ];
705
- };
706
+ } __packed ;
706
707
707
708
708
709
struct bmic_identify_physical_device {
@@ -845,7 +846,7 @@ struct bmic_identify_physical_device {
845
846
u8 max_link_rate [256 ];
846
847
u8 neg_phys_link_rate [256 ];
847
848
u8 box_conn_name [8 ];
848
- } __attribute((aligned (512 )));
849
+ } __packed __attribute((aligned (512 )));
849
850
850
851
struct bmic_sense_subsystem_info {
851
852
u8 primary_slot_number ;
@@ -858,7 +859,7 @@ struct bmic_sense_subsystem_info {
858
859
u8 secondary_array_serial_number [32 ];
859
860
u8 secondary_cache_serial_number [32 ];
860
861
u8 pad [332 ];
861
- };
862
+ } __packed ;
862
863
863
864
struct bmic_sense_storage_box_params {
864
865
u8 reserved [36 ];
@@ -870,7 +871,6 @@ struct bmic_sense_storage_box_params {
870
871
u8 reserver_3 [84 ];
871
872
u8 phys_connector [2 ];
872
873
u8 reserved_4 [296 ];
873
- };
874
+ } __packed ;
874
875
875
- #pragma pack()
876
876
#endif /* HPSA_CMD_H */
0 commit comments