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