bfa_defs_rport.h 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. /*
  2. * Copyright (c) 2005-2009 Brocade Communications Systems, Inc.
  3. * All rights reserved
  4. * www.brocade.com
  5. *
  6. * Linux driver for Brocade Fibre Channel Host Bus Adapter.
  7. *
  8. * This program is free software; you can redistribute it and/or modify it
  9. * under the terms of the GNU General Public License (GPL) Version 2 as
  10. * published by the Free Software Foundation
  11. *
  12. * This program is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * General Public License for more details.
  16. */
  17. #ifndef __BFA_DEFS_RPORT_H__
  18. #define __BFA_DEFS_RPORT_H__
  19. #include <bfa_os_inc.h>
  20. #include <protocol/types.h>
  21. #include <defs/bfa_defs_pport.h>
  22. #include <defs/bfa_defs_port.h>
  23. #include <defs/bfa_defs_qos.h>
  24. /**
  25. * FCS remote port states
  26. */
  27. enum bfa_rport_state {
  28. BFA_RPORT_UNINIT = 0, /* PORT is not yet initialized */
  29. BFA_RPORT_OFFLINE = 1, /* rport is offline */
  30. BFA_RPORT_PLOGI = 2, /* PLOGI to rport is in progress */
  31. BFA_RPORT_ONLINE = 3, /* login to rport is complete */
  32. BFA_RPORT_PLOGI_RETRY = 4, /* retrying login to rport */
  33. BFA_RPORT_NSQUERY = 5, /* nameserver query */
  34. BFA_RPORT_ADISC = 6, /* ADISC authentication */
  35. BFA_RPORT_LOGO = 7, /* logging out with rport */
  36. BFA_RPORT_LOGORCV = 8, /* handling LOGO from rport */
  37. BFA_RPORT_NSDISC = 9, /* re-discover rport */
  38. };
  39. /**
  40. * Rport Scsi Function : Initiator/Target.
  41. */
  42. enum bfa_rport_function {
  43. BFA_RPORT_INITIATOR = 0x01, /* SCSI Initiator */
  44. BFA_RPORT_TARGET = 0x02, /* SCSI Target */
  45. };
  46. /**
  47. * port/node symbolic names for rport
  48. */
  49. #define BFA_RPORT_SYMNAME_MAXLEN 255
  50. struct bfa_rport_symname_s {
  51. char symname[BFA_RPORT_SYMNAME_MAXLEN];
  52. };
  53. struct bfa_rport_hal_stats_s {
  54. u32 sm_un_cr; /* uninit: create events */
  55. u32 sm_un_unexp; /* uninit: exception events */
  56. u32 sm_cr_on; /* created: online events */
  57. u32 sm_cr_del; /* created: delete events */
  58. u32 sm_cr_hwf; /* created: IOC down */
  59. u32 sm_cr_unexp; /* created: exception events */
  60. u32 sm_fwc_rsp; /* fw create: f/w responses */
  61. u32 sm_fwc_del; /* fw create: delete events */
  62. u32 sm_fwc_off; /* fw create: offline events */
  63. u32 sm_fwc_hwf; /* fw create: IOC down */
  64. u32 sm_fwc_unexp; /* fw create: exception events*/
  65. u32 sm_on_off; /* online: offline events */
  66. u32 sm_on_del; /* online: delete events */
  67. u32 sm_on_hwf; /* online: IOC down events */
  68. u32 sm_on_unexp; /* online: exception events */
  69. u32 sm_fwd_rsp; /* fw delete: fw responses */
  70. u32 sm_fwd_del; /* fw delete: delete events */
  71. u32 sm_fwd_hwf; /* fw delete: IOC down events */
  72. u32 sm_fwd_unexp; /* fw delete: exception events*/
  73. u32 sm_off_del; /* offline: delete events */
  74. u32 sm_off_on; /* offline: online events */
  75. u32 sm_off_hwf; /* offline: IOC down events */
  76. u32 sm_off_unexp; /* offline: exception events */
  77. u32 sm_del_fwrsp; /* delete: fw responses */
  78. u32 sm_del_hwf; /* delete: IOC down events */
  79. u32 sm_del_unexp; /* delete: exception events */
  80. u32 sm_delp_fwrsp; /* delete pend: fw responses */
  81. u32 sm_delp_hwf; /* delete pend: IOC downs */
  82. u32 sm_delp_unexp; /* delete pend: exceptions */
  83. u32 sm_offp_fwrsp; /* off-pending: fw responses */
  84. u32 sm_offp_del; /* off-pending: deletes */
  85. u32 sm_offp_hwf; /* off-pending: IOC downs */
  86. u32 sm_offp_unexp; /* off-pending: exceptions */
  87. u32 sm_iocd_off; /* IOC down: offline events */
  88. u32 sm_iocd_del; /* IOC down: delete events */
  89. u32 sm_iocd_on; /* IOC down: online events */
  90. u32 sm_iocd_unexp; /* IOC down: exceptions */
  91. u32 rsvd;
  92. };
  93. /**
  94. * FCS remote port statistics
  95. */
  96. struct bfa_rport_stats_s {
  97. u32 offlines; /* remote port offline count */
  98. u32 onlines; /* remote port online count */
  99. u32 rscns; /* RSCN affecting rport */
  100. u32 plogis; /* plogis sent */
  101. u32 plogi_accs; /* plogi accepts */
  102. u32 plogi_timeouts; /* plogi timeouts */
  103. u32 plogi_rejects; /* rcvd plogi rejects */
  104. u32 plogi_failed; /* local failure */
  105. u32 plogi_rcvd; /* plogis rcvd */
  106. u32 prli_rcvd; /* inbound PRLIs */
  107. u32 adisc_rcvd; /* ADISCs received */
  108. u32 adisc_rejects; /* recvd ADISC rejects */
  109. u32 adisc_sent; /* ADISC requests sent */
  110. u32 adisc_accs; /* ADISC accepted by rport */
  111. u32 adisc_failed; /* ADISC failed (no response) */
  112. u32 adisc_rejected; /* ADISC rejected by us */
  113. u32 logos; /* logos sent */
  114. u32 logo_accs; /* LOGO accepts from rport */
  115. u32 logo_failed; /* LOGO failures */
  116. u32 logo_rejected; /* LOGO rejects from rport */
  117. u32 logo_rcvd; /* LOGO from remote port */
  118. u32 rpsc_rcvd; /* RPSC received */
  119. u32 rpsc_rejects; /* recvd RPSC rejects */
  120. u32 rpsc_sent; /* RPSC requests sent */
  121. u32 rpsc_accs; /* RPSC accepted by rport */
  122. u32 rpsc_failed; /* RPSC failed (no response) */
  123. u32 rpsc_rejected; /* RPSC rejected by us */
  124. u32 rsvd;
  125. struct bfa_rport_hal_stats_s hal_stats; /* BFA rport stats */
  126. };
  127. /**
  128. * Rport's QoS attributes
  129. */
  130. struct bfa_rport_qos_attr_s {
  131. enum bfa_qos_priority qos_priority; /* rport's QoS priority */
  132. u32 qos_flow_id; /* QoS flow Id */
  133. };
  134. /**
  135. * FCS remote port attributes returned in queries
  136. */
  137. struct bfa_rport_attr_s {
  138. wwn_t nwwn; /* node wwn */
  139. wwn_t pwwn; /* port wwn */
  140. enum fc_cos cos_supported; /* supported class of services */
  141. u32 pid; /* port ID */
  142. u32 df_sz; /* Max payload size */
  143. enum bfa_rport_state state; /* Rport State machine state */
  144. enum fc_cos fc_cos; /* FC classes of services */
  145. bfa_boolean_t cisc; /* CISC capable device */
  146. struct bfa_rport_symname_s symname; /* Symbolic Name */
  147. enum bfa_rport_function scsi_function; /* Initiator/Target */
  148. struct bfa_rport_qos_attr_s qos_attr; /* qos attributes */
  149. enum bfa_pport_speed curr_speed; /* operating speed got from
  150. * RPSC ELS. UNKNOWN, if RPSC
  151. * is not supported */
  152. bfa_boolean_t trl_enforced; /* TRL enforced ? TRUE/FALSE */
  153. enum bfa_pport_speed assigned_speed; /* Speed assigned by the user.
  154. * will be used if RPSC is not
  155. * supported by the rport */
  156. };
  157. #define bfa_rport_aen_qos_data_t struct bfa_rport_qos_attr_s
  158. /**
  159. * BFA remote port events
  160. * Arguments below are in BFAL context from Mgmt
  161. * BFA_RPORT_AEN_ONLINE: [in]: lpwwn [out]: vf_id, lpwwn, rpwwn
  162. * BFA_RPORT_AEN_OFFLINE: [in]: lpwwn [out]: vf_id, lpwwn, rpwwn
  163. * BFA_RPORT_AEN_DISCONNECT:[in]: lpwwn [out]: vf_id, lpwwn, rpwwn
  164. * BFA_RPORT_AEN_QOS_PRIO: [in]: lpwwn [out]: vf_id, lpwwn, rpwwn, prio
  165. * BFA_RPORT_AEN_QOS_FLOWID:[in]: lpwwn [out]: vf_id, lpwwn, rpwwn, flow_id
  166. */
  167. enum bfa_rport_aen_event {
  168. BFA_RPORT_AEN_ONLINE = 1, /* RPort online event */
  169. BFA_RPORT_AEN_OFFLINE = 2, /* RPort offline event */
  170. BFA_RPORT_AEN_DISCONNECT = 3, /* RPort disconnect event */
  171. BFA_RPORT_AEN_QOS_PRIO = 4, /* QOS priority change event */
  172. BFA_RPORT_AEN_QOS_FLOWID = 5, /* QOS flow Id change event */
  173. };
  174. struct bfa_rport_aen_data_s {
  175. u16 vf_id; /* vf_id of this logical port */
  176. u16 rsvd[3];
  177. wwn_t ppwwn; /* WWN of its physical port */
  178. wwn_t lpwwn; /* WWN of this logical port */
  179. wwn_t rpwwn; /* WWN of this remote port */
  180. union {
  181. bfa_rport_aen_qos_data_t qos;
  182. } priv;
  183. };
  184. #endif /* __BFA_DEFS_RPORT_H__ */