diff options
-rw-r--r-- | drivers/scsi/libfc/fc_exch.c | 19 | ||||
-rw-r--r-- | include/scsi/libfc.h | 10 |
2 files changed, 29 insertions, 0 deletions
diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c index e0b5b15c355b..1f124c0351b4 100644 --- a/drivers/scsi/libfc/fc_exch.c +++ b/drivers/scsi/libfc/fc_exch.c | |||
@@ -558,6 +558,22 @@ static struct fc_seq *fc_seq_start_next(struct fc_seq *sp) | |||
558 | return sp; | 558 | return sp; |
559 | } | 559 | } |
560 | 560 | ||
561 | /* | ||
562 | * Set the response handler for the exchange associated with a sequence. | ||
563 | */ | ||
564 | static void fc_seq_set_resp(struct fc_seq *sp, | ||
565 | void (*resp)(struct fc_seq *, struct fc_frame *, | ||
566 | void *), | ||
567 | void *arg) | ||
568 | { | ||
569 | struct fc_exch *ep = fc_seq_exch(sp); | ||
570 | |||
571 | spin_lock_bh(&ep->ex_lock); | ||
572 | ep->resp = resp; | ||
573 | ep->arg = arg; | ||
574 | spin_unlock_bh(&ep->ex_lock); | ||
575 | } | ||
576 | |||
561 | /** | 577 | /** |
562 | * fc_seq_exch_abort() - Abort an exchange and sequence | 578 | * fc_seq_exch_abort() - Abort an exchange and sequence |
563 | * @req_sp: The sequence to be aborted | 579 | * @req_sp: The sequence to be aborted |
@@ -2329,6 +2345,9 @@ int fc_exch_init(struct fc_lport *lport) | |||
2329 | if (!lport->tt.seq_start_next) | 2345 | if (!lport->tt.seq_start_next) |
2330 | lport->tt.seq_start_next = fc_seq_start_next; | 2346 | lport->tt.seq_start_next = fc_seq_start_next; |
2331 | 2347 | ||
2348 | if (!lport->tt.seq_set_resp) | ||
2349 | lport->tt.seq_set_resp = fc_seq_set_resp; | ||
2350 | |||
2332 | if (!lport->tt.exch_seq_send) | 2351 | if (!lport->tt.exch_seq_send) |
2333 | lport->tt.exch_seq_send = fc_exch_seq_send; | 2352 | lport->tt.exch_seq_send = fc_exch_seq_send; |
2334 | 2353 | ||
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h index 3ae2a760b4f3..3b8f5d83611b 100644 --- a/include/scsi/libfc.h +++ b/include/scsi/libfc.h | |||
@@ -555,6 +555,16 @@ struct libfc_function_template { | |||
555 | struct fc_seq *(*seq_start_next)(struct fc_seq *); | 555 | struct fc_seq *(*seq_start_next)(struct fc_seq *); |
556 | 556 | ||
557 | /* | 557 | /* |
558 | * Set a response handler for the exchange of the sequence. | ||
559 | * | ||
560 | * STATUS: OPTIONAL | ||
561 | */ | ||
562 | void (*seq_set_resp)(struct fc_seq *sp, | ||
563 | void (*resp)(struct fc_seq *, struct fc_frame *, | ||
564 | void *), | ||
565 | void *arg); | ||
566 | |||
567 | /* | ||
558 | * Assign a sequence for an incoming request frame. | 568 | * Assign a sequence for an incoming request frame. |
559 | * | 569 | * |
560 | * STATUS: OPTIONAL | 570 | * STATUS: OPTIONAL |