aboutsummaryrefslogtreecommitdiffstats
path: root/src/include/ipxe/fc.h
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2011-06-24 22:49:10 +0100
committerMichael Brown <mcb30@ipxe.org>2011-06-28 14:45:01 +0100
commitbf8bfa23e2364793ccdfc32627d8094a74ae87aa (patch)
tree53d20e95786d13330f92b1d1df539d608bcd7bf1 /src/include/ipxe/fc.h
parent5763472b34724d5f320da7ecd90ed32f14c0855b (diff)
downloadipxe-bf8bfa23e2364793ccdfc32627d8094a74ae87aa.tar.gz
[fc] Maintain a list of Fibre Channel upper-layer protocol users
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe/fc.h')
-rw-r--r--src/include/ipxe/fc.h33
1 files changed, 28 insertions, 5 deletions
diff --git a/src/include/ipxe/fc.h b/src/include/ipxe/fc.h
index ab6b5bae7..06d38baf9 100644
--- a/src/include/ipxe/fc.h
+++ b/src/include/ipxe/fc.h
@@ -357,7 +357,15 @@ struct fc_peer {
/** List of upper-layer protocols */
struct list_head ulps;
- /** Active usage count */
+ /** Active usage count
+ *
+ * A peer (and attached ULPs) may be created in response to
+ * unsolicited login requests received via the fabric. We
+ * track our own active usage count independently of the
+ * existence of the peer, so that if the peer becomes logged
+ * out (e.g. due to a link failure) then we know whether or
+ * not we should attempt to relogin.
+ */
unsigned int usage;
};
@@ -424,8 +432,15 @@ struct fc_ulp {
/** Service parameter length */
size_t param_len;
- /** Active usage count */
- unsigned int usage;
+ /** Active users of this upper-layer protocol
+ *
+ * As with peers, an upper-layer protocol may be created in
+ * response to an unsolicited login request received via the
+ * fabric. This list records the number of active users of
+ * the ULP; the number of entries in the list is equivalent to
+ * the peer usage count.
+ */
+ struct list_head users;
};
/** Fibre Channel upper-layer protocol flags */
@@ -434,6 +449,14 @@ enum fc_ulp_flags {
FC_ULP_ORIGINATED_LOGIN_OK = 0x0001,
};
+/** A Fibre Channel upper-layer protocol user */
+struct fc_ulp_user {
+ /** Fibre Channel upper layer protocol */
+ struct fc_ulp *ulp;
+ /** List of users */
+ struct list_head list;
+};
+
/**
* Get reference to Fibre Channel upper-layer protocol
*
@@ -462,8 +485,8 @@ extern struct fc_ulp *
fc_ulp_get_port_id_type ( struct fc_port *port,
const struct fc_port_id *peer_port_id,
unsigned int type );
-extern void fc_ulp_increment ( struct fc_ulp *ulp );
-extern void fc_ulp_decrement ( struct fc_ulp *ulp );
+extern void fc_ulp_attach ( struct fc_ulp *ulp, struct fc_ulp_user *user );
+extern void fc_ulp_detach ( struct fc_ulp_user *user );
extern int fc_ulp_login ( struct fc_ulp *ulp, const void *param,
size_t param_len, int originated );
extern void fc_ulp_logout ( struct fc_ulp *ulp, int rc );