bfa_fcs_fcpim.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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. bfa_boolean_t seq_rec; /* seq recovery support */
  40. bfa_boolean_t rec_support; /* REC supported */
  41. bfa_boolean_t conf_comp; /* FCP_CONF support */
  42. bfa_boolean_t task_retry_id; /* task retry id supp */
  43. struct bfa_fcxp_wqe_s fcxp_wqe; /* wait qelem for fcxp */
  44. struct bfa_fcxp_s *fcxp; /* FCXP in use */
  45. struct bfa_itnim_stats_s stats; /* itn statistics */
  46. };
  47. static inline struct bfad_port_s *
  48. bfa_fcs_itnim_get_drvport(struct bfa_fcs_itnim_s *itnim)
  49. {
  50. return itnim->rport->port->bfad_port;
  51. }
  52. static inline struct bfa_fcs_port_s *
  53. bfa_fcs_itnim_get_port(struct bfa_fcs_itnim_s *itnim)
  54. {
  55. return itnim->rport->port;
  56. }
  57. static inline wwn_t
  58. bfa_fcs_itnim_get_nwwn(struct bfa_fcs_itnim_s *itnim)
  59. {
  60. return itnim->rport->nwwn;
  61. }
  62. static inline wwn_t
  63. bfa_fcs_itnim_get_pwwn(struct bfa_fcs_itnim_s *itnim)
  64. {
  65. return itnim->rport->pwwn;
  66. }
  67. static inline u32
  68. bfa_fcs_itnim_get_fcid(struct bfa_fcs_itnim_s *itnim)
  69. {
  70. return itnim->rport->pid;
  71. }
  72. static inline u32
  73. bfa_fcs_itnim_get_maxfrsize(struct bfa_fcs_itnim_s *itnim)
  74. {
  75. return itnim->rport->maxfrsize;
  76. }
  77. static inline enum fc_cos
  78. bfa_fcs_itnim_get_cos(struct bfa_fcs_itnim_s *itnim)
  79. {
  80. return itnim->rport->fc_cos;
  81. }
  82. static inline struct bfad_itnim_s *
  83. bfa_fcs_itnim_get_drvitn(struct bfa_fcs_itnim_s *itnim)
  84. {
  85. return itnim->itnim_drv;
  86. }
  87. static inline struct bfa_itnim_s *
  88. bfa_fcs_itnim_get_halitn(struct bfa_fcs_itnim_s *itnim)
  89. {
  90. return itnim->bfa_itnim;
  91. }
  92. /**
  93. * bfa fcs FCP Initiator mode API functions
  94. */
  95. void bfa_fcs_itnim_get_attr(struct bfa_fcs_itnim_s *itnim,
  96. struct bfa_itnim_attr_s *attr);
  97. void bfa_fcs_itnim_get_stats(struct bfa_fcs_itnim_s *itnim,
  98. struct bfa_itnim_stats_s *stats);
  99. struct bfa_fcs_itnim_s *bfa_fcs_itnim_lookup(struct bfa_fcs_port_s *port,
  100. wwn_t rpwwn);
  101. bfa_status_t bfa_fcs_itnim_attr_get(struct bfa_fcs_port_s *port, wwn_t rpwwn,
  102. struct bfa_itnim_attr_s *attr);
  103. bfa_status_t bfa_fcs_itnim_stats_get(struct bfa_fcs_port_s *port, wwn_t rpwwn,
  104. struct bfa_itnim_stats_s *stats);
  105. bfa_status_t bfa_fcs_itnim_stats_clear(struct bfa_fcs_port_s *port,
  106. wwn_t rpwwn);
  107. #endif /* __BFA_FCS_FCPIM_H__ */