Commit 1a5c2d7e authored by Joe Eykholt's avatar Joe Eykholt Committed by James Bottomley

[SCSI] libfc: add method for setting handler for incoming exchange

Add a method for setting handler for incoming exchange.
For multi-sequence exchanges, this allows the target driver
to add a response handler for handling subsequent sequences,
and exchange manager resets.

The new function is called fc_seq_set_resp().
Signed-off-by: default avatarJoe Eykholt <jeykholt@cisco.com>
Signed-off-by: default avatarRobert Love <robert.w.love@intel.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent 96ad8464
......@@ -558,6 +558,22 @@ static struct fc_seq *fc_seq_start_next(struct fc_seq *sp)
return sp;
}
/*
* Set the response handler for the exchange associated with a sequence.
*/
static void fc_seq_set_resp(struct fc_seq *sp,
void (*resp)(struct fc_seq *, struct fc_frame *,
void *),
void *arg)
{
struct fc_exch *ep = fc_seq_exch(sp);
spin_lock_bh(&ep->ex_lock);
ep->resp = resp;
ep->arg = arg;
spin_unlock_bh(&ep->ex_lock);
}
/**
* fc_seq_exch_abort() - Abort an exchange and sequence
* @req_sp: The sequence to be aborted
......@@ -2329,6 +2345,9 @@ int fc_exch_init(struct fc_lport *lport)
if (!lport->tt.seq_start_next)
lport->tt.seq_start_next = fc_seq_start_next;
if (!lport->tt.seq_set_resp)
lport->tt.seq_set_resp = fc_seq_set_resp;
if (!lport->tt.exch_seq_send)
lport->tt.exch_seq_send = fc_exch_seq_send;
......
......@@ -554,6 +554,16 @@ struct libfc_function_template {
*/
struct fc_seq *(*seq_start_next)(struct fc_seq *);
/*
* Set a response handler for the exchange of the sequence.
*
* STATUS: OPTIONAL
*/
void (*seq_set_resp)(struct fc_seq *sp,
void (*resp)(struct fc_seq *, struct fc_frame *,
void *),
void *arg);
/*
* Assign a sequence for an incoming request frame.
*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment