bfa_defs_tin.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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_TIN_H__
  18. #define __BFA_DEFS_TIN_H__
  19. #include <protocol/types.h>
  20. #include <protocol/fc.h>
  21. /**
  22. * FCS tin states
  23. */
  24. enum bfa_tin_state_e {
  25. BFA_TIN_SM_OFFLINE = 0, /* tin is offline */
  26. BFA_TIN_SM_WOS_LOGIN = 1, /* Waiting PRLI ACC/RJT from ULP */
  27. BFA_TIN_SM_WFW_ONLINE = 2, /* Waiting ACK to PRLI ACC from FW */
  28. BFA_TIN_SM_ONLINE = 3, /* tin login is complete */
  29. BFA_TIN_SM_WIO_RELOGIN = 4, /* tin relogin is in progress */
  30. BFA_TIN_SM_WIO_LOGOUT = 5, /* Processing of PRLO req from
  31. * Initiator is in progress
  32. */
  33. BFA_TIN_SM_WOS_LOGOUT = 6, /* Processing of PRLO req from
  34. * Initiator is in progress
  35. */
  36. BFA_TIN_SM_WIO_CLEAN = 7, /* Waiting for IO cleanup before tin
  37. * is offline. This can be triggered
  38. * by RPORT LOGO (rcvd/sent) or by
  39. * PRLO (rcvd/sent)
  40. */
  41. };
  42. struct bfa_prli_req_s {
  43. struct fchs_s fchs;
  44. struct fc_prli_s prli_payload;
  45. };
  46. struct bfa_prlo_req_s {
  47. struct fchs_s fchs;
  48. struct fc_prlo_s prlo_payload;
  49. };
  50. void bfa_tin_send_login_rsp(void *bfa_tin, u32 login_rsp,
  51. struct fc_ls_rjt_s rjt_payload);
  52. void bfa_tin_send_logout_rsp(void *bfa_tin, u32 logout_rsp,
  53. struct fc_ls_rjt_s rjt_payload);
  54. /**
  55. * FCS target port statistics
  56. */
  57. struct bfa_tin_stats_s {
  58. u32 onlines; /* ITN nexus onlines (PRLI done) */
  59. u32 offlines; /* ITN Nexus offlines */
  60. u32 prli_req_parse_err; /* prli req parsing errors */
  61. u32 prli_rsp_rjt; /* num prli rsp rejects sent */
  62. u32 prli_rsp_acc; /* num prli rsp accepts sent */
  63. u32 cleanup_comps; /* ITN cleanup completions */
  64. };
  65. /**
  66. * FCS tin attributes returned in queries
  67. */
  68. struct bfa_tin_attr_s {
  69. enum bfa_tin_state_e state;
  70. u8 seq_retry; /* Sequence retry supported */
  71. u8 rsvd[3];
  72. };
  73. /**
  74. * BFA TIN async event data structure for BFAL
  75. */
  76. enum bfa_tin_aen_event {
  77. BFA_TIN_AEN_ONLINE = 1, /* Target online */
  78. BFA_TIN_AEN_OFFLINE = 2, /* Target offline */
  79. BFA_TIN_AEN_DISCONNECT = 3, /* Target disconnected */
  80. };
  81. /**
  82. * BFA TIN event data structure.
  83. */
  84. struct bfa_tin_aen_data_s {
  85. u16 vf_id; /* vf_id of the IT nexus */
  86. u16 rsvd[3];
  87. wwn_t lpwwn; /* WWN of logical port */
  88. wwn_t rpwwn; /* WWN of remote(target) port */
  89. };
  90. /**
  91. * Below APIs are needed from BFA driver
  92. * Move these to BFA driver public header file?
  93. */
  94. /* TIN rcvd new PRLI & gets bfad_tin_t ptr from driver this callback */
  95. void *bfad_tin_rcvd_login_req(void *bfad_tm_port, void *bfa_tin,
  96. wwn_t rp_wwn, u32 rp_fcid,
  97. struct bfa_prli_req_s prli_req);
  98. /* TIN rcvd new PRLO */
  99. void bfad_tin_rcvd_logout_req(void *bfad_tin, wwn_t rp_wwn, u32 rp_fcid,
  100. struct bfa_prlo_req_s prlo_req);
  101. /* TIN is online and ready for IO */
  102. void bfad_tin_online(void *bfad_tin);
  103. /* TIN is offline and BFA driver can shutdown its upper stack */
  104. void bfad_tin_offline(void *bfad_tin);
  105. /* TIN does not need this BFA driver tin tag anymore, so can be freed */
  106. void bfad_tin_res_free(void *bfad_tin);
  107. #endif /* __BFA_DEFS_TIN_H__ */