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

scsi: Centralise ssp frame information units

The xfer_rdy, command, and task frame's iu structures are not available
in <scsi/sas.h>, but only aic94xx driver folder. Add them to
include/scsi/sas.h

Signed-off-by: John Garry <john.garry@huawei.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

John Garry and committed by
Martin K. Petersen
c15d75be 4190230e

+80 -43
+6 -43
drivers/scsi/aic94xx/aic94xx_sas.h
··· 327 327 328 328 #define LUN_SIZE 8 329 329 330 - /* See SAS spec, task IU 331 - */ 332 - struct ssp_task_iu { 333 - u8 lun[LUN_SIZE]; /* BE */ 334 - u16 _r_a; 335 - u8 tmf; 336 - u8 _r_b; 337 - __be16 tag; /* BE */ 338 - u8 _r_c[14]; 339 - } __attribute__ ((packed)); 340 - 341 - /* See SAS spec, command IU 342 - */ 343 - struct ssp_command_iu { 344 - u8 lun[LUN_SIZE]; 345 - u8 _r_a; 346 - u8 efb_prio_attr; /* enable first burst, task prio & attr */ 347 - #define EFB_MASK 0x80 348 - #define TASK_PRIO_MASK 0x78 349 - #define TASK_ATTR_MASK 0x07 350 - 351 - u8 _r_b; 352 - u8 add_cdb_len; /* in dwords, since bit 0,1 are reserved */ 353 - union { 354 - u8 cdb[16]; 355 - struct { 356 - __le64 long_cdb_addr; /* bus address, LE */ 357 - __le32 long_cdb_size; /* LE */ 358 - u8 _r_c[3]; 359 - u8 eol_ds; /* eol:6,6, ds:5,4 */ 360 - } long_cdb; /* sequencer extension */ 361 - }; 362 - } __attribute__ ((packed)); 363 - 364 - struct xfer_rdy_iu { 365 - __be32 requested_offset; /* BE */ 366 - __be32 write_data_len; /* BE */ 367 - __be32 _r_a; 368 - } __attribute__ ((packed)); 369 - 330 + #define EFB_MASK 0x80 331 + #define TASK_PRIO_MASK 0x78 332 + #define TASK_ATTR_MASK 0x07 370 333 /* ---------- SCB tasks ---------- */ 371 334 372 335 /* This is both ssp_task and long_ssp_task ··· 474 511 u8 proto_conn_rate; 475 512 __le32 _r_a; 476 513 struct ssp_frame_hdr ssp_frame; 477 - struct ssp_task_iu ssp_task; 514 + struct ssp_tmf_iu ssp_task; 478 515 __le16 sister_scb; 479 516 __le16 conn_handle; 480 517 u8 flags; /* ovrd_itnl_timer:3,3, suspend_data_trans:2,2 */ ··· 512 549 u8 _r_b[3]; 513 550 u8 conn_mask; 514 551 u8 _r_c[19]; 515 - struct ssp_task_iu ssp_task; /* LUN and TAG */ 552 + struct ssp_tmf_iu ssp_task; /* LUN and TAG */ 516 553 __le16 _r_d; 517 554 __le16 conn_handle; 518 555 __le64 _r_e; ··· 525 562 u8 proto_conn_rate; 526 563 __le32 _r_a; 527 564 struct ssp_frame_hdr ssp_frame; 528 - struct ssp_task_iu ssp_task; 565 + struct ssp_tmf_iu ssp_task; 529 566 __le16 sister_scb; 530 567 __le16 conn_handle; 531 568 u8 flags; /* itnl override and suspend data tx */
+74
include/scsi/sas.h
··· 344 344 u8 sense_data[0]; 345 345 } __attribute__ ((packed)); 346 346 347 + struct ssp_command_iu { 348 + u8 lun[8]; 349 + u8 _r_a; 350 + 351 + union { 352 + struct { 353 + u8 attr:3; 354 + u8 prio:4; 355 + u8 efb:1; 356 + }; 357 + u8 efb_prio_attr; 358 + }; 359 + 360 + u8 _r_b; 361 + 362 + u8 _r_c:2; 363 + u8 add_cdb_len:6; 364 + 365 + u8 cdb[16]; 366 + u8 add_cdb[0]; 367 + } __attribute__ ((packed)); 368 + 369 + struct xfer_rdy_iu { 370 + __be32 requested_offset; 371 + __be32 write_data_len; 372 + __be32 _r_a; 373 + } __attribute__ ((packed)); 374 + 375 + struct ssp_tmf_iu { 376 + u8 lun[8]; 377 + u16 _r_a; 378 + u8 tmf; 379 + u8 _r_b; 380 + __be16 tag; 381 + u8 _r_c[14]; 382 + } __attribute__ ((packed)); 383 + 347 384 /* ---------- SMP ---------- */ 348 385 349 386 struct report_general_resp { ··· 573 536 574 537 u8 resp_data[0]; 575 538 u8 sense_data[0]; 539 + } __attribute__ ((packed)); 540 + 541 + struct ssp_command_iu { 542 + u8 lun[8]; 543 + u8 _r_a; 544 + 545 + union { 546 + struct { 547 + u8 efb:1; 548 + u8 prio:4; 549 + u8 attr:3; 550 + }; 551 + u8 efb_prio_attr; 552 + }; 553 + 554 + u8 _r_b; 555 + 556 + u8 add_cdb_len:6; 557 + u8 _r_c:2; 558 + 559 + u8 cdb[16]; 560 + u8 add_cdb[0]; 561 + } __attribute__ ((packed)); 562 + 563 + struct xfer_rdy_iu { 564 + __be32 requested_offset; 565 + __be32 write_data_len; 566 + __be32 _r_a; 567 + } __attribute__ ((packed)); 568 + 569 + struct ssp_tmf_iu { 570 + u8 lun[8]; 571 + u16 _r_a; 572 + u8 tmf; 573 + u8 _r_b; 574 + __be16 tag; 575 + u8 _r_c[14]; 576 576 } __attribute__ ((packed)); 577 577 578 578 /* ---------- SMP ---------- */