diff options
author | Joe Eykholt <jeykholt@cisco.com> | 2009-11-03 11:49:05 -0800 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2009-12-04 12:01:17 -0600 |
commit | 093bb6a2d378ee83fc6ab886c772b6be86abb5a8 (patch) | |
tree | 30fea295440a3c4d5242902fbf3a7b3543d9aa9d /include/scsi | |
parent | 52a6690d3f0cb7414c34b1e26c569b32d4987662 (diff) | |
download | linux-093bb6a2d378ee83fc6ab886c772b6be86abb5a8.tar.bz2 |
[SCSI] libfc: add set_fid function to libfc template
This is to notify the LLD when an FC_ID is assigned to the local port.
The fnic driver needs to push the assigned FC_ID to firmware.
It currently does this by intercepting the FLOGI responses, and
in order to make that code more common with FIP and NPIV, it
makes more sense to wait until the local port has completely
handled the FLOGI or FDISC response. Also, when we fix
point-to-point FC_ID assignment, we'll need this callback as well.
Add a call to the libfc template, which is called whenever
the local port FC_ID is being assigned. It defaults to
fc_lport_set_fid(), supplied by libfc.
As additional benefit of this function, the LLD may determine
the MAC address that caused the change by looking at the received frame.
We also print the assigned port ID as long as it isn't 0.
Setting port ID to 0 happens often in reset while retrying FLOGI,
and would be uninteresting. This replaces the previous message
which didn't identify the host adapter instance.
patch v2 note: changed one word in a comment. "intercepted" -> "provided".
Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'include/scsi')
-rw-r--r-- | include/scsi/libfc.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h index 310d8a22b726..67ce9fa1fee4 100644 --- a/include/scsi/libfc.h +++ b/include/scsi/libfc.h @@ -581,6 +581,26 @@ struct libfc_function_template { int (*lport_reset)(struct fc_lport *); /* + * Set the local port FC_ID. + * + * This may be provided by the LLD to allow it to be + * notified when the local port is assigned a FC-ID. + * + * The frame, if non-NULL, is the incoming frame with the + * FLOGI LS_ACC or FLOGI, and may contain the granted MAC + * address for the LLD. The frame pointer may be NULL if + * no MAC is associated with this assignment (LOGO or PLOGI). + * + * If FC_ID is non-zero, r_a_tov and e_d_tov must be valid. + * + * Note: this is called with the local port mutex held. + * + * STATUS: OPTIONAL + */ + void (*lport_set_port_id)(struct fc_lport *, u32 port_id, + struct fc_frame *); + + /* * Create a remote port with a given port ID * * STATUS: OPTIONAL |