bfa_fcb_port.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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_fcb_port.h BFA FCS virtual port driver interfaces
  19. */
  20. #ifndef __BFA_FCB_PORT_H__
  21. #define __BFA_FCB_PORT_H__
  22. #include <fcb/bfa_fcb_vport.h>
  23. /**
  24. * fcs_port_fcb FCS port driver interfaces
  25. */
  26. /*
  27. * Forward declarations
  28. */
  29. struct bfad_port_s;
  30. /*
  31. * Callback functions from BFA FCS to driver
  32. */
  33. /**
  34. * Call from FCS to driver module when a port is instantiated. The port
  35. * can be a base port or a virtual port with in the base fabric or
  36. * a virtual fabric.
  37. *
  38. * On this callback, driver is supposed to create scsi_host, scsi_tgt or
  39. * network interfaces bases on ports personality/roles.
  40. *
  41. * base port of base fabric: vf_drv == NULL && vp_drv == NULL
  42. * vport of base fabric: vf_drv == NULL && vp_drv != NULL
  43. * base port of VF: vf_drv != NULL && vp_drv == NULL
  44. * vport of VF: vf_drv != NULL && vp_drv != NULL
  45. *
  46. * @param[in] bfad - driver instance
  47. * @param[in] port - FCS port instance
  48. * @param[in] roles - port roles: IM, TM, IP
  49. * @param[in] vf_drv - VF driver instance, NULL if base fabric (no VF)
  50. * @param[in] vp_drv - vport driver instance, NULL if base port
  51. *
  52. * @return None
  53. */
  54. struct bfad_port_s *bfa_fcb_port_new(struct bfad_s *bfad,
  55. struct bfa_fcs_port_s *port,
  56. enum bfa_port_role roles, struct bfad_vf_s *vf_drv,
  57. struct bfad_vport_s *vp_drv);
  58. /**
  59. * Call from FCS to driver module when a port is deleted. The port
  60. * can be a base port or a virtual port with in the base fabric or
  61. * a virtual fabric.
  62. *
  63. * @param[in] bfad - driver instance
  64. * @param[in] roles - port roles: IM, TM, IP
  65. * @param[in] vf_drv - VF driver instance, NULL if base fabric (no VF)
  66. * @param[in] vp_drv - vport driver instance, NULL if base port
  67. *
  68. * @return None
  69. */
  70. void bfa_fcb_port_delete(struct bfad_s *bfad, enum bfa_port_role roles,
  71. struct bfad_vf_s *vf_drv, struct bfad_vport_s *vp_drv);
  72. /**
  73. * Notification when port transitions to ONLINE state.
  74. *
  75. * Online notification is a logical link up for the local port. This
  76. * notification is sent after a successfull FLOGI, or a successful
  77. * link initialization in proviate-loop or N2N topologies.
  78. *
  79. * @param[in] bfad - driver instance
  80. * @param[in] roles - port roles: IM, TM, IP
  81. * @param[in] vf_drv - VF driver instance, NULL if base fabric (no VF)
  82. * @param[in] vp_drv - vport driver instance, NULL if base port
  83. *
  84. * @return None
  85. */
  86. void bfa_fcb_port_online(struct bfad_s *bfad, enum bfa_port_role roles,
  87. struct bfad_vf_s *vf_drv, struct bfad_vport_s *vp_drv);
  88. /**
  89. * Notification when port transitions to OFFLINE state.
  90. *
  91. * Offline notification is a logical link down for the local port.
  92. *
  93. * @param[in] bfad - driver instance
  94. * @param[in] roles - port roles: IM, TM, IP
  95. * @param[in] vf_drv - VF driver instance, NULL if base fabric (no VF)
  96. * @param[in] vp_drv - vport driver instance, NULL if base port
  97. *
  98. * @return None
  99. */
  100. void bfa_fcb_port_offline(struct bfad_s *bfad, enum bfa_port_role roles,
  101. struct bfad_vf_s *vf_drv, struct bfad_vport_s *vp_drv);
  102. #endif /* __BFA_FCB_PORT_H__ */