diff options
Diffstat (limited to 'include/scsi/scsi_transport_fc.h')
| -rw-r--r-- | include/scsi/scsi_transport_fc.h | 52 |
1 files changed, 50 insertions, 2 deletions
diff --git a/include/scsi/scsi_transport_fc.h b/include/scsi/scsi_transport_fc.h index 68a8d873bbd9..fc50bd64aa4e 100644 --- a/include/scsi/scsi_transport_fc.h +++ b/include/scsi/scsi_transport_fc.h | |||
| @@ -33,7 +33,6 @@ | |||
| 33 | 33 | ||
| 34 | struct scsi_transport_template; | 34 | struct scsi_transport_template; |
| 35 | 35 | ||
| 36 | |||
| 37 | /* | 36 | /* |
| 38 | * FC Port definitions - Following FC HBAAPI guidelines | 37 | * FC Port definitions - Following FC HBAAPI guidelines |
| 39 | * | 38 | * |
| @@ -352,6 +351,7 @@ struct fc_rport { /* aka fc_starget_attrs */ | |||
| 352 | struct delayed_work fail_io_work; | 351 | struct delayed_work fail_io_work; |
| 353 | struct work_struct stgt_delete_work; | 352 | struct work_struct stgt_delete_work; |
| 354 | struct work_struct rport_delete_work; | 353 | struct work_struct rport_delete_work; |
| 354 | struct request_queue *rqst_q; /* bsg support */ | ||
| 355 | } __attribute__((aligned(sizeof(unsigned long)))); | 355 | } __attribute__((aligned(sizeof(unsigned long)))); |
| 356 | 356 | ||
| 357 | /* bit field values for struct fc_rport "flags" field: */ | 357 | /* bit field values for struct fc_rport "flags" field: */ |
| @@ -514,6 +514,9 @@ struct fc_host_attrs { | |||
| 514 | struct workqueue_struct *work_q; | 514 | struct workqueue_struct *work_q; |
| 515 | char devloss_work_q_name[20]; | 515 | char devloss_work_q_name[20]; |
| 516 | struct workqueue_struct *devloss_work_q; | 516 | struct workqueue_struct *devloss_work_q; |
| 517 | |||
| 518 | /* bsg support */ | ||
| 519 | struct request_queue *rqst_q; | ||
| 517 | }; | 520 | }; |
| 518 | 521 | ||
| 519 | #define shost_to_fc_host(x) \ | 522 | #define shost_to_fc_host(x) \ |
| @@ -579,6 +582,47 @@ struct fc_host_attrs { | |||
| 579 | (((struct fc_host_attrs *)(x)->shost_data)->devloss_work_q) | 582 | (((struct fc_host_attrs *)(x)->shost_data)->devloss_work_q) |
| 580 | 583 | ||
| 581 | 584 | ||
| 585 | struct fc_bsg_buffer { | ||
| 586 | unsigned int payload_len; | ||
| 587 | int sg_cnt; | ||
| 588 | struct scatterlist *sg_list; | ||
| 589 | }; | ||
| 590 | |||
| 591 | /* Values for fc_bsg_job->state_flags (bitflags) */ | ||
| 592 | #define FC_RQST_STATE_INPROGRESS 0 | ||
| 593 | #define FC_RQST_STATE_DONE 1 | ||
| 594 | |||
| 595 | struct fc_bsg_job { | ||
| 596 | struct Scsi_Host *shost; | ||
| 597 | struct fc_rport *rport; | ||
| 598 | struct device *dev; | ||
| 599 | struct request *req; | ||
| 600 | spinlock_t job_lock; | ||
| 601 | unsigned int state_flags; | ||
| 602 | unsigned int ref_cnt; | ||
| 603 | void (*job_done)(struct fc_bsg_job *); | ||
| 604 | |||
| 605 | struct fc_bsg_request *request; | ||
| 606 | struct fc_bsg_reply *reply; | ||
| 607 | unsigned int request_len; | ||
| 608 | unsigned int reply_len; | ||
| 609 | /* | ||
| 610 | * On entry : reply_len indicates the buffer size allocated for | ||
| 611 | * the reply. | ||
| 612 | * | ||
| 613 | * Upon completion : the message handler must set reply_len | ||
| 614 | * to indicates the size of the reply to be returned to the | ||
| 615 | * caller. | ||
| 616 | */ | ||
| 617 | |||
| 618 | /* DMA payloads for the request/response */ | ||
| 619 | struct fc_bsg_buffer request_payload; | ||
| 620 | struct fc_bsg_buffer reply_payload; | ||
| 621 | |||
| 622 | void *dd_data; /* Used for driver-specific storage */ | ||
| 623 | }; | ||
| 624 | |||
| 625 | |||
| 582 | /* The functions by which the transport class and the driver communicate */ | 626 | /* The functions by which the transport class and the driver communicate */ |
| 583 | struct fc_function_template { | 627 | struct fc_function_template { |
| 584 | void (*get_rport_dev_loss_tmo)(struct fc_rport *); | 628 | void (*get_rport_dev_loss_tmo)(struct fc_rport *); |
| @@ -614,9 +658,14 @@ struct fc_function_template { | |||
| 614 | int (* tsk_mgmt_response)(struct Scsi_Host *, u64, u64, int); | 658 | int (* tsk_mgmt_response)(struct Scsi_Host *, u64, u64, int); |
| 615 | int (* it_nexus_response)(struct Scsi_Host *, u64, int); | 659 | int (* it_nexus_response)(struct Scsi_Host *, u64, int); |
| 616 | 660 | ||
| 661 | /* bsg support */ | ||
| 662 | int (*bsg_request)(struct fc_bsg_job *); | ||
| 663 | int (*bsg_timeout)(struct fc_bsg_job *); | ||
| 664 | |||
| 617 | /* allocation lengths for host-specific data */ | 665 | /* allocation lengths for host-specific data */ |
| 618 | u32 dd_fcrport_size; | 666 | u32 dd_fcrport_size; |
| 619 | u32 dd_fcvport_size; | 667 | u32 dd_fcvport_size; |
| 668 | u32 dd_bsg_size; | ||
| 620 | 669 | ||
| 621 | /* | 670 | /* |
| 622 | * The driver sets these to tell the transport class it | 671 | * The driver sets these to tell the transport class it |
| @@ -737,7 +786,6 @@ fc_vport_set_state(struct fc_vport *vport, enum fc_vport_state new_state) | |||
| 737 | vport->vport_state = new_state; | 786 | vport->vport_state = new_state; |
| 738 | } | 787 | } |
| 739 | 788 | ||
| 740 | |||
| 741 | struct scsi_transport_template *fc_attach_transport( | 789 | struct scsi_transport_template *fc_attach_transport( |
| 742 | struct fc_function_template *); | 790 | struct fc_function_template *); |
| 743 | void fc_release_transport(struct scsi_transport_template *); | 791 | void fc_release_transport(struct scsi_transport_template *); |
