bfa_fcs_fcpim.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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. /**
  18. * bfa_fcs_fcpim.h BFA FCS FCP Initiator Mode interfaces/defines.
  19. */
  20. #ifndef __BFA_FCS_FCPIM_H__
  21. #define __BFA_FCS_FCPIM_H__
  22. #include <defs/bfa_defs_status.h>
  23. #include <defs/bfa_defs_itnim.h>
  24. #include <fcs/bfa_fcs.h>
  25. #include <fcs/bfa_fcs_rport.h>
  26. #include <fcs/bfa_fcs_lport.h>
  27. #include <bfa_fcpim.h>
  28. /*
  29. * forward declarations
  30. */
  31. struct bfad_itnim_s;
  32. struct bfa_fcs_itnim_s {
  33. bfa_sm_t sm; /* state machine */
  34. struct bfa_fcs_rport_s *rport; /* parent remote rport */
  35. struct bfad_itnim_s *itnim_drv; /* driver peer instance */
  36. struct bfa_fcs_s *fcs; /* fcs instance */
  37. struct bfa_timer_s timer; /* timer functions */
  38. struct bfa_itnim_s *bfa_itnim; /* BFA itnim struct */
  39. u32 prli_retries; /* max prli retry attempts */
  40. bfa_boolean_t seq_rec; /* seq recovery support */
  41. bfa_boolean_t rec_support; /* REC supported */
  42. bfa_boolean_t conf_comp; /* FCP_CONF support */
  43. bfa_boolean_t task_retry_id; /* task retry id supp */
  44. struct bfa_fcxp_wqe_s fcxp_wqe; /* wait qelem for fcxp */
  45. struct bfa_fcxp_s *fcxp; /* FCXP in use */
  46. struct bfa_itnim_stats_s stats; /* itn statistics */
  47. };
  48. static inline struct bfad_port_s *
  49. bfa_fcs_itnim_get_drvport(struct bfa_fcs_itnim_s *itnim)
  50. {
  51. return itnim->rport->port->bfad_port;
  52. }
  53. static inline struct bfa_fcs_port_s *
  54. bfa_fcs_itnim_get_port(struct bfa_fcs_itnim_s *itnim)
  55. {
  56. return itnim->rport->port;
  57. }
  58. static inline wwn_t
  59. bfa_fcs_itnim_get_nwwn(struct bfa_fcs_itnim_s *itnim)
  60. {
  61. return itnim->rport->nwwn;
  62. }
  63. static inline wwn_t
  64. bfa_fcs_itnim_get_pwwn(struct bfa_fcs_itnim_s *itnim)
  65. {
  66. return itnim->rport->pwwn;
  67. }
  68. static inline u32
  69. bfa_fcs_itnim_get_fcid(struct bfa_fcs_itnim_s *itnim)
  70. {
  71. return itnim->rport->pid;
  72. }
  73. static inline u32
  74. bfa_fcs_itnim_get_maxfrsize(struct bfa_fcs_itnim_s *itnim)
  75. {
  76. return itnim->rport->maxfrsize;
  77. }
  78. static inline enum fc_cos
  79. bfa_fcs_itnim_get_cos(struct bfa_fcs_itnim_s *itnim)
  80. {
  81. return itnim->rport->fc_cos;
  82. }
  83. static inline struct bfad_itnim_s *
  84. bfa_fcs_itnim_get_drvitn(struct bfa_fcs_itnim_s *itnim)
  85. {
  86. return itnim->itnim_drv;
  87. }
  88. static inline struct bfa_itnim_s *
  89. bfa_fcs_itnim_get_halitn(struct bfa_fcs_itnim_s *itnim)
  90. {
  91. return itnim->bfa_itnim;
  92. }
  93. /**
  94. * bfa fcs FCP Initiator mode API functions
  95. */
  96. void bfa_fcs_itnim_get_attr(struct bfa_fcs_itnim_s *itnim,
  97. struct bfa_itnim_attr_s *attr);
  98. void bfa_fcs_itnim_get_stats(struct bfa_fcs_itnim_s *itnim,
  99. struct bfa_itnim_stats_s *stats);
  100. struct bfa_fcs_itnim_s *bfa_fcs_itnim_lookup(struct bfa_fcs_port_s *port,
  101. wwn_t rpwwn);
  102. bfa_status_t bfa_fcs_itnim_attr_get(struct bfa_fcs_port_s *port, wwn_t rpwwn,
  103. struct bfa_itnim_attr_s *attr);
  104. bfa_status_t bfa_fcs_itnim_stats_get(struct bfa_fcs_port_s *port, wwn_t rpwwn,
  105. struct bfa_itnim_stats_s *stats);
  106. bfa_status_t bfa_fcs_itnim_stats_clear(struct bfa_fcs_port_s *port,
  107. wwn_t rpwwn);
  108. #endif /* __BFA_FCS_FCPIM_H__ */