iPXE
fc.h
Go to the documentation of this file.
1 #ifndef _IPXE_FC_H
2 #define _IPXE_FC_H
3 
4 /**
5  * @file
6  *
7  * Fibre Channel
8  *
9  */
10 
11 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
12 
13 #include <stdint.h>
14 #include <ipxe/refcnt.h>
15 #include <ipxe/list.h>
16 #include <ipxe/tables.h>
17 #include <ipxe/interface.h>
18 #include <ipxe/retry.h>
19 #include <ipxe/socket.h>
20 
21 /******************************************************************************
22  *
23  * Fibre Channel Names and identifiers
24  *
25  ******************************************************************************
26  */
27 
28 /** A Fibre Channel name */
29 struct fc_name {
31 } __attribute__ (( packed ));
32 
33 /** Length of Fibre Channel name text */
34 #define FC_NAME_STRLEN 23 /* "xx:xx:xx:xx:xx:xx:xx:xx" */
35 
36 /** A Fibre Channel port identifier */
37 struct fc_port_id {
39 } __attribute__ (( packed ));
40 
41 /** Length of Fibre Channel port identifier next */
42 #define FC_PORT_ID_STRLEN 9 /* "xx.xx.xx" */
43 
44 /**
45  * Fibre Channel socket address
46  */
47 struct sockaddr_fc {
48  /** Socket address family (part of struct @c sockaddr)
49  *
50  * Always set to @c AF_FC for Fibre Channel addresses
51  */
53  /** Port ID */
55  /** Padding
56  *
57  * This ensures that a struct @c sockaddr_tcpip is large
58  * enough to hold a socket address for any TCP/IP address
59  * family.
60  */
61  char pad[ sizeof ( struct sockaddr ) - sizeof ( sa_family_t )
62  - sizeof ( struct fc_port_id ) ];
63 } __attribute__ (( packed, may_alias ));
64 
65 extern struct fc_port_id fc_empty_port_id;
66 extern struct fc_port_id fc_f_port_id;
67 extern struct fc_port_id fc_gs_port_id;
68 extern struct fc_port_id fc_ptp_low_port_id;
69 extern struct fc_port_id fc_ptp_high_port_id;
70 
71 extern const char * fc_id_ntoa ( const struct fc_port_id *id );
72 extern int fc_id_aton ( const char *id_text, struct fc_port_id *id );
73 extern const char * fc_ntoa ( const struct fc_name *wwn );
74 extern int fc_aton ( const char *wwn_text, struct fc_name *wwn );
75 extern struct sockaddr * fc_fill_sockaddr ( struct sockaddr_fc *sa_fc,
76  struct fc_port_id *id );
77 
78 /******************************************************************************
79  *
80  * Fibre Channel link state
81  *
82  ******************************************************************************
83  */
84 
85 /** Delay between failed link-up attempts */
86 #define FC_LINK_RETRY_DELAY ( 2 * TICKS_PER_SEC )
87 
88 /** A Fibre Channel link state nonitor */
89 struct fc_link_state {
90  /** Retry timer */
92  /** Link state */
93  int rc;
94  /** Examine link state
95  *
96  * @v link Fibre Channel link state monitor
97  */
98  void ( * examine ) ( struct fc_link_state *link );
99 };
100 
101 /**
102  * Check Fibre Channel link state
103  *
104  * @v link Fibre Channel link state monitor
105  * @ret link_up Link is up
106  */
107 static inline __attribute__ (( always_inline )) int
109  return ( link->rc == 0 );
110 }
111 
112 /******************************************************************************
113  *
114  * Fibre Channel packet formats and exchanges
115  *
116  ******************************************************************************
117  */
118 
119 /** A Fibre Channel Frame Header */
121  /** Routing control
122  *
123  * This is the bitwise OR of one @c fc_r_ctl_routing value and
124  * one @c fc_r_ctl_info value.
125  */
127  /** Destination ID */
128  struct fc_port_id d_id;
129  /** Class-specific control / Priority */
131  /** Source ID */
132  struct fc_port_id s_id;
133  /** Data structure type */
135  /** Frame control - exchange and sequence */
137  /** Frame control - acknowledgements */
139  /** Frame control - miscellaneous */
141  /** Sequence ID */
143  /** Data field control */
145  /** Sequence count */
147  /** Originator exchange ID */
149  /** Responder exchange ID */
151  /** Parameter
152  *
153  * Contains the relative offset when @c FC_F_CTL_MISC_REL_OFF
154  * is set.
155  */
157 } __attribute__ (( packed ));
158 
159 /** Fibre Channel Routing Control Routing */
161  FC_R_CTL_DATA = 0x00, /**< Device Data */
162  FC_R_CTL_ELS = 0x20, /**< Extended Link Services */
163  FC_R_CTL_FC4_LINK = 0x30, /**< FC-4 Link Data */
164  FC_R_CTL_VIDEO = 0x40, /**< Video Data */
165  FC_R_CTL_EH = 0x50, /**< Extended Headers */
166  FC_R_CTL_BLS = 0x80, /**< Basic Link Services */
167  FC_R_CTL_LINK_CTRL = 0xc0, /**< Link Control */
168  FC_R_CTL_EXT_ROUTE = 0xf0, /**< Extended Routing */
169 };
170 
171 /** Fibre Channel Routing Control Routing mask */
172 #define FC_R_CTL_ROUTING_MASK 0xf0
173 
174 /** Fibre Channel Routing Control Information */
176  FC_R_CTL_UNCAT = 0x00, /**< Uncategorized */
177  FC_R_CTL_SOL_DATA = 0x01, /**< Solicited Data */
178  FC_R_CTL_UNSOL_CTRL = 0x02, /**< Unsolicited Control */
179  FC_R_CTL_SOL_CTRL = 0x03, /**< Solicited Control */
180  FC_R_CTL_UNSOL_DATA = 0x04, /**< Unsolicited Data */
181  FC_R_CTL_DATA_DESC = 0x05, /**< Data Descriptor */
182  FC_R_CTL_UNSOL_CMD = 0x06, /**< Unsolicited Command */
183  FC_R_CTL_CMD_STAT = 0x07, /**< Command Status */
184 };
185 
186 /** Fibre Channel Routing Control Information mask */
187 #define FC_R_CTL_INFO_MASK 0x07
188 
189 /** Fibre Channel Data Structure Type */
190 enum fc_type {
191  FC_TYPE_BLS = 0x00, /**< Basic Link Service */
192  FC_TYPE_ELS = 0x01, /**< Extended Link Service */
193  FC_TYPE_FCP = 0x08, /**< Fibre Channel Protocol */
194  FC_TYPE_CT = 0x20, /**< Common Transport */
195 };
196 
197 /** Fibre Channel Frame Control - Exchange and Sequence */
199  FC_F_CTL_ES_RESPONDER = 0x80, /**< Responder of Exchange */
200  FC_F_CTL_ES_RECIPIENT = 0x40, /**< Sequence Recipient */
201  FC_F_CTL_ES_FIRST = 0x20, /**< First Sequence of Exchange */
202  FC_F_CTL_ES_LAST = 0x10, /**< Last Sequence of Exchange */
203  FC_F_CTL_ES_END = 0x08, /**< Last Data Frame of Sequence */
204  FC_F_CTL_ES_TRANSFER = 0x01, /**< Transfer Sequence Initiative */
205 };
206 
207 /** Fibre Channel Frame Control - Miscellaneous */
209  FC_F_CTL_MISC_REL_OFF = 0x08, /**< Relative Offset Present */
210 };
211 
212 /** Responder exchange identifier used before first response */
213 #define FC_RX_ID_UNKNOWN 0xffff
214 
215 struct fc_port;
216 
217 extern int fc_xchg_originate ( struct interface *parent, struct fc_port *port,
218  struct fc_port_id *peer_port_id,
219  unsigned int type );
220 
221 /** A Fibre Channel responder */
222 struct fc_responder {
223  /** Type */
224  unsigned int type;
225  /** Respond to exchange
226  *
227  * @v xchg Exchange interface
228  * @v port Fibre Channel port
229  * @v port_id Local port ID
230  * @v peer_port_id Peer port ID
231  * @ret rc Return status code
232  */
233  int ( * respond ) ( struct interface *xchg, struct fc_port *port,
234  struct fc_port_id *port_id,
235  struct fc_port_id *peer_port_id );
236 };
237 
238 /** Fibre Channel responder table */
239 #define FC_RESPONDERS __table ( struct fc_responder, "fc_responders" )
240 
241 /** Declare a Fibre Channel responder */
242 #define __fc_responder __table_entry ( FC_RESPONDERS, 01 )
243 
244 /******************************************************************************
245  *
246  * Fibre Channel ports
247  *
248  ******************************************************************************
249  */
250 
251 /** A Fibre Channel port */
252 struct fc_port {
253  /** Reference count */
254  struct refcnt refcnt;
255  /** List of all ports */
256  struct list_head list;
257  /** Name of this port */
258  char name[8];
259 
260  /** Transport interface */
262  /** Node name */
264  /** Port name */
266  /** Local port ID */
268  /** Flags */
269  unsigned int flags;
270 
271  /** Link state monitor */
273  /** FLOGI interface */
274  struct interface flogi;
275  /** Link node name */
277  /** Link port name */
279  /** Link port ID (for point-to-point links only) */
281 
282  /** Name server PLOGI interface */
284 
285  /** List of active exchanges */
286  struct list_head xchgs;
287 };
288 
289 /** Fibre Channel port flags */
291  /** Port is attached to a fabric */
293  /** Port is logged in to a name server */
294  FC_PORT_HAS_NS = 0x0002,
295 };
296 
297 /**
298  * Get reference to Fibre Channel port
299  *
300  * @v port Fibre Channel port
301  * @ret port Fibre Channel port
302  */
303 static inline __attribute__ (( always_inline )) struct fc_port *
304 fc_port_get ( struct fc_port *port ) {
305  ref_get ( &port->refcnt );
306  return port;
307 }
308 
309 /**
310  * Drop reference to Fibre Channel port
311  *
312  * @v port Fibre Channel port
313  */
314 static inline __attribute__ (( always_inline )) void
315 fc_port_put ( struct fc_port *port ) {
316  ref_put ( &port->refcnt );
317 }
318 
319 extern struct list_head fc_ports;
320 
321 extern int fc_port_login ( struct fc_port *port, struct fc_port_id *port_id,
322  const struct fc_name *link_node_wwn,
323  const struct fc_name *link_port_wwn,
324  int has_fabric );
325 extern void fc_port_logout ( struct fc_port *port, int rc );
326 extern int fc_port_open ( struct interface *transport,
327  const struct fc_name *node_wwn,
328  const struct fc_name *port_wwn,
329  const char *name );
330 extern struct fc_port * fc_port_find ( const char *name );
331 
332 /******************************************************************************
333  *
334  * Fibre Channel peers
335  *
336  ******************************************************************************
337  */
338 
339 /** A Fibre Channel peer */
340 struct fc_peer {
341  /** Reference count */
342  struct refcnt refcnt;
343  /** List of all peers */
344  struct list_head list;
345 
346  /** Port name */
348 
349  /** Link state monitor */
351  /** PLOGI interface */
352  struct interface plogi;
353  /** Fibre Channel port, if known */
354  struct fc_port *port;
355  /** Peer port ID, if known */
357 
358  /** List of upper-layer protocols */
359  struct list_head ulps;
360  /** Active usage count
361  *
362  * A peer (and attached ULPs) may be created in response to
363  * unsolicited login requests received via the fabric. We
364  * track our own active usage count independently of the
365  * existence of the peer, so that if the peer becomes logged
366  * out (e.g. due to a link failure) then we know whether or
367  * not we should attempt to relogin.
368  */
369  unsigned int usage;
370 };
371 
372 /**
373  * Get reference to Fibre Channel peer
374  *
375  * @v peer Fibre Channel peer
376  * @ret peer Fibre Channel peer
377  */
378 static inline __attribute__ (( always_inline )) struct fc_peer *
379 fc_peer_get ( struct fc_peer *peer ) {
380  ref_get ( &peer->refcnt );
381  return peer;
382 }
383 
384 /**
385  * Drop reference to Fibre Channel peer
386  *
387  * @v peer Fibre Channel peer
388  */
389 static inline __attribute__ (( always_inline )) void
390 fc_peer_put ( struct fc_peer *peer ) {
391  ref_put ( &peer->refcnt );
392 }
393 
394 extern struct list_head fc_peers;
395 
396 extern struct fc_peer * fc_peer_get_wwn ( const struct fc_name *port_wwn );
397 extern struct fc_peer *
399  const struct fc_port_id *peer_port_id );
400 extern int fc_peer_login ( struct fc_peer *peer,
401  struct fc_port *port,
402  struct fc_port_id *port_id );
403 extern void fc_peer_logout ( struct fc_peer *peer, int rc );
404 
405 /******************************************************************************
406  *
407  * Fibre Channel upper-layer protocols
408  *
409  ******************************************************************************
410  */
411 
412 /** A Fibre Channel upper-layer protocol */
413 struct fc_ulp {
414  /** Reference count */
415  struct refcnt refcnt;
416  /** Fibre Channel peer */
417  struct fc_peer *peer;
418  /** List of upper-layer protocols */
419  struct list_head list;
420 
421  /** Type */
422  unsigned int type;
423  /** Flags */
424  unsigned int flags;
425 
426  /** Link state monitor */
428  /** PRLI interface */
429  struct interface prli;
430  /** Service parameters, if any */
431  void *param;
432  /** Service parameter length */
433  size_t param_len;
434 
435  /** Active users of this upper-layer protocol
436  *
437  * As with peers, an upper-layer protocol may be created in
438  * response to an unsolicited login request received via the
439  * fabric. This list records the number of active users of
440  * the ULP; the number of entries in the list is equivalent to
441  * the peer usage count.
442  */
443  struct list_head users;
444 };
445 
446 /** Fibre Channel upper-layer protocol flags */
448  /** A login originated by us has succeeded */
450 };
451 
452 /** A Fibre Channel upper-layer protocol user */
453 struct fc_ulp_user {
454  /** Fibre Channel upper layer protocol */
455  struct fc_ulp *ulp;
456  /** List of users */
457  struct list_head list;
458  /** Containing object reference count, or NULL */
459  struct refcnt *refcnt;
460  /** Examine link state
461  *
462  * @v user Fibre Channel upper-layer-protocol user
463  */
464  void ( * examine ) ( struct fc_ulp_user *user );
465 };
466 
467 /**
468  * Get reference to Fibre Channel upper-layer protocol
469  *
470  * @v ulp Fibre Channel upper-layer protocol
471  * @ret ulp Fibre Channel upper-layer protocol
472  */
473 static inline __attribute__ (( always_inline )) struct fc_ulp *
474 fc_ulp_get ( struct fc_ulp *ulp ) {
475  ref_get ( &ulp->refcnt );
476  return ulp;
477 }
478 
479 /**
480  * Drop reference to Fibre Channel upper-layer protocol
481  *
482  * @v ulp Fibre Channel upper-layer protocol
483  */
484 static inline __attribute__ (( always_inline )) void
485 fc_ulp_put ( struct fc_ulp *ulp ) {
486  ref_put ( &ulp->refcnt );
487 }
488 
489 /**
490  * Get reference to Fibre Channel upper-layer protocol user
491  *
492  * @v user Fibre Channel upper-layer protocol user
493  * @ret user Fibre Channel upper-layer protocol user
494  */
495 static inline __attribute__ (( always_inline )) struct fc_ulp_user *
497  ref_get ( user->refcnt );
498  return user;
499 }
500 
501 /**
502  * Drop reference to Fibre Channel upper-layer protocol user
503  *
504  * @v user Fibre Channel upper-layer protocol user
505  */
506 static inline __attribute__ (( always_inline )) void
508  ref_put ( user->refcnt );
509 }
510 
511 /**
512  * Initialise Fibre Channel upper-layer protocol user
513  *
514  * @v user Fibre Channel upper-layer protocol user
515  * @v examine Examine link state method
516  * @v refcnt Containing object reference count, or NULL
517  */
518 static inline __attribute__ (( always_inline )) void
520  void ( * examine ) ( struct fc_ulp_user *user ),
521  struct refcnt *refcnt ) {
522  user->examine = examine;
523  user->refcnt = refcnt;
524 }
525 
526 extern struct fc_ulp * fc_ulp_get_wwn_type ( const struct fc_name *port_wwn,
527  unsigned int type );
528 extern struct fc_ulp *
530  const struct fc_port_id *peer_port_id,
531  unsigned int type );
532 extern void fc_ulp_attach ( struct fc_ulp *ulp, struct fc_ulp_user *user );
533 extern void fc_ulp_detach ( struct fc_ulp_user *user );
534 extern int fc_ulp_login ( struct fc_ulp *ulp, const void *param,
535  size_t param_len, int originated );
536 extern void fc_ulp_logout ( struct fc_ulp *ulp, int rc );
537 
538 #endif /* _IPXE_FC_H */
Link Control.
Definition: fc.h:167
fc_f_ctl_misc
Fibre Channel Frame Control - Miscellaneous.
Definition: fc.h:208
struct fc_name link_port_wwn
Link port name.
Definition: fc.h:278
#define __attribute__(x)
Definition: compiler.h:10
Solicited Data.
Definition: fc.h:177
char name[8]
Name of this port.
Definition: fc.h:258
struct fc_name port_wwn
Port name.
Definition: fc.h:265
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
struct fc_peer * fc_peer_get_wwn(const struct fc_name *port_wwn)
Get Fibre Channel peer by node name.
Definition: fc.c:1516
const char * name
Definition: ath9k_hw.c:1984
unsigned short uint16_t
Definition: stdint.h:11
struct fc_port_id fc_gs_port_id
Generic services port ID.
Definition: fc.c:71
int fc_aton(const char *wwn_text, struct fc_name *wwn)
Parse Fibre Channel WWN.
Definition: fc.c:144
struct fc_ulp * fc_ulp_get_port_id_type(struct fc_port *port, const struct fc_port_id *peer_port_id, unsigned int type)
Get Fibre Channel upper-layer protocol by port ID and type.
Definition: fc.c:1915
struct list_head fc_peers
struct fc_ulp * ulp
Fibre Channel upper layer protocol.
Definition: fc.h:455
struct list_head list
List of all ports.
Definition: fc.h:256
Basic Link Services.
Definition: fc.h:166
int fc_port_login(struct fc_port *port, struct fc_port_id *port_id, const struct fc_name *link_node_wwn, const struct fc_name *link_port_wwn, int has_fabric)
Log in Fibre Channel port.
Definition: fc.c:941
uint8_t f_ctl_ack
Frame control - acknowledgements.
Definition: fc.h:138
Last Sequence of Exchange.
Definition: fc.h:202
Extended Routing.
Definition: fc.h:168
struct fc_port_id ptp_link_port_id
Link port ID (for point-to-point links only)
Definition: fc.h:280
struct list_head xchgs
List of active exchanges.
Definition: fc.h:286
uint16_t seq_cnt
Sequence count.
Definition: fc.h:146
struct interface flogi
FLOGI interface.
Definition: fc.h:274
uint8_t seq_id
Sequence ID.
Definition: fc.h:142
Fibre Channel Protocol.
Definition: fc.h:193
unsigned int type
Type.
Definition: fc.h:224
uint8_t type
Type.
Definition: ena.h:16
const char * fc_id_ntoa(const struct fc_port_id *id)
Format Fibre Channel port ID.
Definition: fc.c:92
Retry timers.
A Fibre Channel responder.
Definition: fc.h:222
struct fc_name node_wwn
Node name.
Definition: fc.h:263
void fc_ulp_attach(struct fc_ulp *ulp, struct fc_ulp_user *user)
Attach Fibre Channel upper-layer protocol user.
Definition: fc.c:1607
A retry timer.
Definition: retry.h:21
struct refcnt refcnt
Reference count.
Definition: fc.h:342
Fibre Channel socket address.
Definition: fc.h:47
fc_r_ctl_info
Fibre Channel Routing Control Information.
Definition: fc.h:175
struct list_head list
List of upper-layer protocols.
Definition: fc.h:419
struct fc_port_id sfc_port_id
Port ID.
Definition: fc.h:54
Extended Link Services.
Definition: fc.h:162
static void fc_port_put(struct fc_port *port)
Drop reference to Fibre Channel port.
Definition: fc.h:315
struct sockaddr * fc_fill_sockaddr(struct sockaddr_fc *sa_fc, struct fc_port_id *id)
Fill Fibre Channel socket address.
Definition: fc.c:165
uint8_t f_ctl_misc
Frame control - miscellaneous.
Definition: fc.h:140
sa_family_t sfc_family
Socket address family (part of struct sockaddr)
Definition: fc.h:52
struct list_head fc_ports
int fc_ulp_login(struct fc_ulp *ulp, const void *param, size_t param_len, int originated)
Log in Fibre Channel upper-layer protocol.
Definition: fc.c:1657
Last Data Frame of Sequence.
Definition: fc.h:203
Unsolicited Control.
Definition: fc.h:178
static void(*) struct refcnt refcnt)
Definition: pool.h:62
struct fc_peer * peer
Fibre Channel peer.
Definition: fc.h:417
A Fibre Channel port.
Definition: fc.h:252
struct fc_port_id s_id
Source ID.
Definition: fc.h:132
struct fc_port_id fc_empty_port_id
Unassigned port ID.
Definition: fc.c:65
void fc_ulp_logout(struct fc_ulp *ulp, int rc)
Log out Fibre Channel upper-layer protocol.
Definition: fc.c:1727
struct list_head users
Active users of this upper-layer protocol.
Definition: fc.h:443
A doubly-linked list entry (or list head)
Definition: list.h:18
struct fc_port_id fc_f_port_id
F_Port contoller port ID.
Definition: fc.c:68
A reference counter.
Definition: refcnt.h:26
struct fc_port_id port_id
Local port ID.
Definition: fc.h:267
A timer.
Definition: timer.h:28
Unsolicited Command.
Definition: fc.h:182
struct list_head list
List of users.
Definition: fc.h:457
uint8_t bytes[3]
Definition: fc.h:38
Extended Link Service.
Definition: fc.h:192
struct fc_port * port
Fibre Channel port, if known.
Definition: fc.h:354
static struct fc_ulp_user * fc_ulp_user_get(struct fc_ulp_user *user)
Get reference to Fibre Channel upper-layer protocol user.
Definition: fc.h:496
uint8_t bytes[8]
Definition: fc.h:30
void fc_peer_logout(struct fc_peer *peer, int rc)
Log out Fibre Channel peer.
Definition: fc.c:1347
fc_r_ctl_routing
Fibre Channel Routing Control Routing.
Definition: fc.h:160
u8 port
Port number.
Definition: CIB_PRM.h:31
const char * fc_ntoa(const struct fc_name *wwn)
Format Fibre Channel WWN.
Definition: fc.c:127
struct fc_name link_node_wwn
Link node name.
Definition: fc.h:276
Port is attached to a fabric.
Definition: fc.h:292
An object interface.
Definition: interface.h:109
struct list_head ulps
List of upper-layer protocols.
Definition: fc.h:359
A Fibre Channel port identifier.
Definition: fc.h:37
struct ntlm_data user
User name.
Definition: ntlm.h:20
Command Status.
Definition: fc.h:183
size_t param_len
Service parameter length.
Definition: fc.h:433
Object interfaces.
static int fc_link_ok(struct fc_link_state *link)
Check Fibre Channel link state.
Definition: fc.h:108
struct fc_link_state link
Link state monitor.
Definition: fc.h:350
A login originated by us has succeeded.
Definition: fc.h:449
uint8_t type
Data structure type.
Definition: fc.h:134
void fc_port_logout(struct fc_port *port, int rc)
Log out Fibre Channel port.
Definition: fc.c:1039
int fc_port_open(struct interface *transport, const struct fc_name *node_wwn, const struct fc_name *port_wwn, const char *name)
Create Fibre Channel port.
Definition: fc.c:1189
uint16_t sa_family_t
A socket address family.
Definition: socket.h:85
Transfer Sequence Initiative.
Definition: fc.h:204
u32 link
Link to next descriptor.
Definition: ar9003_mac.h:68
struct list_head list
List of all peers.
Definition: fc.h:344
Unsolicited Data.
Definition: fc.h:180
struct interface prli
PRLI interface.
Definition: fc.h:429
unsigned int usage
Active usage count.
Definition: fc.h:369
FC-4 Link Data.
Definition: fc.h:163
Solicited Control.
Definition: fc.h:179
unsigned int type
Type.
Definition: fc.h:422
Linked lists.
Generalized socket address structure.
Definition: socket.h:96
Common Transport.
Definition: fc.h:194
int(* respond)(struct interface *xchg, struct fc_port *port, struct fc_port_id *port_id, struct fc_port_id *peer_port_id)
Respond to exchange.
Definition: fc.h:233
struct fc_port_id port_id
Peer port ID, if known.
Definition: fc.h:356
static void fc_peer_put(struct fc_peer *peer)
Drop reference to Fibre Channel peer.
Definition: fc.h:390
struct fc_link_state link
Link state monitor.
Definition: fc.h:272
void * param
Service parameters, if any.
Definition: fc.h:431
#define ref_get(refcnt)
Get additional reference to object.
Definition: refcnt.h:92
Port is logged in to a name server.
Definition: fc.h:294
static struct fc_ulp * fc_ulp_get(struct fc_ulp *ulp)
Get reference to Fibre Channel upper-layer protocol.
Definition: fc.h:474
uint8_t r_ctl
Routing control.
Definition: fc.h:126
struct hv_monitor_parameter param[4][32]
Parameters.
Definition: hyperv.h:24
fc_port_flags
Fibre Channel port flags.
Definition: fc.h:290
struct fc_link_state link
Link state monitor.
Definition: fc.h:427
int fc_peer_login(struct fc_peer *peer, struct fc_port *port, struct fc_port_id *port_id)
Log in Fibre Channel peer.
Definition: fc.c:1300
void(* examine)(struct fc_ulp_user *user)
Examine link state.
Definition: fc.h:464
Responder of Exchange.
Definition: fc.h:199
struct fc_name port_wwn
Port name.
Definition: fc.h:347
unsigned char uint8_t
Definition: stdint.h:10
static void fc_ulp_user_put(struct fc_ulp_user *user)
Drop reference to Fibre Channel upper-layer protocol user.
Definition: fc.h:507
A Fibre Channel upper-layer protocol user.
Definition: fc.h:453
static struct fc_peer * fc_peer_get(struct fc_peer *peer)
Get reference to Fibre Channel peer.
Definition: fc.h:379
unsigned int uint32_t
Definition: stdint.h:12
int fc_xchg_originate(struct interface *parent, struct fc_port *port, struct fc_port_id *peer_port_id, unsigned int type)
Originate a new Fibre Channel exchange.
Definition: fc.c:728
Data Descriptor.
Definition: fc.h:181
A Fibre Channel peer.
Definition: fc.h:340
struct fc_port * fc_port_find(const char *name)
Find Fibre Channel port by name.
Definition: fc.c:1224
struct fc_ulp * fc_ulp_get_wwn_type(const struct fc_name *port_wwn, unsigned int type)
Get Fibre Channel upper-layer protocol by port name and type.
Definition: fc.c:1880
A Fibre Channel name.
Definition: fc.h:29
struct refcnt refcnt
Reference count.
Definition: fc.h:415
uint8_t f_ctl_es
Frame control - exchange and sequence.
Definition: fc.h:136
static struct fc_port * fc_port_get(struct fc_port *port)
Get reference to Fibre Channel port.
Definition: fc.h:304
struct interface plogi
PLOGI interface.
Definition: fc.h:352
Device Data.
Definition: fc.h:161
int fc_id_aton(const char *id_text, struct fc_port_id *id)
Parse Fibre Channel port ID.
Definition: fc.c:107
Video Data.
Definition: fc.h:164
struct interface transport
Transport interface.
Definition: fc.h:261
fc_type
Fibre Channel Data Structure Type.
Definition: fc.h:190
unsigned int flags
Flags.
Definition: fc.h:269
static void fc_ulp_put(struct fc_ulp *ulp)
Drop reference to Fibre Channel upper-layer protocol.
Definition: fc.h:485
Reference counting.
fc_f_ctl_es
Fibre Channel Frame Control - Exchange and Sequence.
Definition: fc.h:198
struct refcnt * refcnt
Containing object reference count, or NULL.
Definition: fc.h:459
Linker tables.
struct fc_port_id d_id
Destination ID.
Definition: fc.h:128
struct interface ns_plogi
Name server PLOGI interface.
Definition: fc.h:283
uint8_t cs_ctl_prio
Class-specific control / Priority.
Definition: fc.h:130
Uncategorized.
Definition: fc.h:176
uint16_t ox_id
Originator exchange ID.
Definition: fc.h:148
void fc_ulp_detach(struct fc_ulp_user *user)
Detach Fibre Channel upper-layer protocol user.
Definition: fc.c:1625
Relative Offset Present.
Definition: fc.h:209
uint8_t df_ctl
Data field control.
Definition: fc.h:144
Socket addresses.
char pad[sizeof(struct sockaddr) - sizeof(sa_family_t) - sizeof(struct fc_port_id)]
Padding.
Definition: fc.h:62
Sequence Recipient.
Definition: fc.h:200
First Sequence of Exchange.
Definition: fc.h:201
unsigned int flags
Flags.
Definition: fc.h:424
Basic Link Service.
Definition: fc.h:191
struct fc_peer * fc_peer_get_port_id(struct fc_port *port, const struct fc_port_id *peer_port_id)
Get Fibre Channel peer by port ID.
Definition: fc.c:1541
static void fc_ulp_user_init(struct fc_ulp_user *user, void(*examine)(struct fc_ulp_user *user), struct refcnt *refcnt)
Initialise Fibre Channel upper-layer protocol user.
Definition: fc.h:519
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
struct fc_port_id fc_ptp_low_port_id
Point-to-point low port ID.
Definition: fc.c:74
uint16_t rx_id
Responder exchange ID.
Definition: fc.h:150
fc_ulp_flags
Fibre Channel upper-layer protocol flags.
Definition: fc.h:447
uint32_t parameter
Parameter.
Definition: fc.h:156
#define ref_put(refcnt)
Drop reference to object.
Definition: refcnt.h:106
A Fibre Channel upper-layer protocol.
Definition: fc.h:413
Extended Headers.
Definition: fc.h:165
A Fibre Channel Frame Header.
Definition: fc.h:120
uint64_t wwn
WWN.
Definition: edd.h:30
struct fc_port_id fc_ptp_high_port_id
Point-to-point high port ID.
Definition: fc.c:77