diff options
| author | Michael Brown | 2011-06-25 00:16:17 +0200 |
|---|---|---|
| committer | Michael Brown | 2011-06-28 15:45:07 +0200 |
| commit | 5f608a44a5574ec53c791e55894179dccb85f1c6 (patch) | |
| tree | d57a92982f17ae989ba52a056f543991c0598921 /src/include/ipxe/fc.h | |
| parent | [fc] Maintain a list of Fibre Channel upper-layer protocol users (diff) | |
| download | ipxe-5f608a44a5574ec53c791e55894179dccb85f1c6.tar.gz ipxe-5f608a44a5574ec53c791e55894179dccb85f1c6.tar.xz ipxe-5f608a44a5574ec53c791e55894179dccb85f1c6.zip | |
[fc] Send xfer_window_changed() when FCP link is established
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe/fc.h')
| -rw-r--r-- | src/include/ipxe/fc.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/include/ipxe/fc.h b/src/include/ipxe/fc.h index 06d38baf9..6689f394e 100644 --- a/src/include/ipxe/fc.h +++ b/src/include/ipxe/fc.h @@ -455,6 +455,13 @@ struct fc_ulp_user { struct fc_ulp *ulp; /** List of users */ struct list_head list; + /** Containing object reference count, or NULL */ + struct refcnt *refcnt; + /** Examine link state + * + * @v user Fibre Channel upper-layer-protocol user + */ + void ( * examine ) ( struct fc_ulp_user *user ); }; /** @@ -479,6 +486,43 @@ fc_ulp_put ( struct fc_ulp *ulp ) { ref_put ( &ulp->refcnt ); } +/** + * Get reference to Fibre Channel upper-layer protocol user + * + * @v user Fibre Channel upper-layer protocol user + * @ret user Fibre Channel upper-layer protocol user + */ +static inline __attribute__ (( always_inline )) struct fc_ulp_user * +fc_ulp_user_get ( struct fc_ulp_user *user ) { + ref_get ( user->refcnt ); + return user; +} + +/** + * Drop reference to Fibre Channel upper-layer protocol user + * + * @v user Fibre Channel upper-layer protocol user + */ +static inline __attribute__ (( always_inline )) void +fc_ulp_user_put ( struct fc_ulp_user *user ) { + ref_put ( user->refcnt ); +} + +/** + * Initialise Fibre Channel upper-layer protocol user + * + * @v user Fibre Channel upper-layer protocol user + * @v examine Examine link state method + * @v refcnt Containing object reference count, or NULL + */ +static inline __attribute__ (( always_inline )) void +fc_ulp_user_init ( struct fc_ulp_user *user, + void ( * examine ) ( struct fc_ulp_user *user ), + struct refcnt *refcnt ) { + user->examine = examine; + user->refcnt = refcnt; +} + extern struct fc_ulp * fc_ulp_get_wwn_type ( const struct fc_name *port_wwn, unsigned int type ); extern struct fc_ulp * |
