bfa_fcs_vport.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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_vport.h BFA fcs vport module public interface
  19. */
  20. #ifndef __BFA_FCS_VPORT_H__
  21. #define __BFA_FCS_VPORT_H__
  22. #include <defs/bfa_defs_status.h>
  23. #include <defs/bfa_defs_port.h>
  24. #include <defs/bfa_defs_vport.h>
  25. #include <fcs/bfa_fcs.h>
  26. #include <fcb/bfa_fcb_vport.h>
  27. struct bfa_fcs_vport_s {
  28. struct list_head qe; /* queue elem */
  29. bfa_sm_t sm; /* state machine */
  30. bfa_fcs_lport_t lport; /* logical port */
  31. struct bfa_timer_s timer; /* general purpose timer */
  32. struct bfad_vport_s *vport_drv; /* Driver private */
  33. struct bfa_vport_stats_s vport_stats; /* vport statistics */
  34. struct bfa_lps_s *lps; /* Lport login service */
  35. int fdisc_retries;
  36. };
  37. #define bfa_fcs_vport_get_port(vport) \
  38. ((struct bfa_fcs_port_s *)(&vport->port))
  39. /**
  40. * bfa fcs vport public functions
  41. */
  42. bfa_status_t bfa_fcs_vport_create(struct bfa_fcs_vport_s *vport,
  43. struct bfa_fcs_s *fcs, u16 vf_id,
  44. struct bfa_port_cfg_s *port_cfg,
  45. struct bfad_vport_s *vport_drv);
  46. bfa_status_t bfa_fcs_pbc_vport_create(struct bfa_fcs_vport_s *vport,
  47. struct bfa_fcs_s *fcs, uint16_t vf_id,
  48. struct bfa_port_cfg_s *port_cfg,
  49. struct bfad_vport_s *vport_drv);
  50. bfa_status_t bfa_fcs_vport_delete(struct bfa_fcs_vport_s *vport);
  51. bfa_status_t bfa_fcs_vport_start(struct bfa_fcs_vport_s *vport);
  52. bfa_status_t bfa_fcs_vport_stop(struct bfa_fcs_vport_s *vport);
  53. void bfa_fcs_vport_get_attr(struct bfa_fcs_vport_s *vport,
  54. struct bfa_vport_attr_s *vport_attr);
  55. void bfa_fcs_vport_get_stats(struct bfa_fcs_vport_s *vport,
  56. struct bfa_vport_stats_s *vport_stats);
  57. void bfa_fcs_vport_clr_stats(struct bfa_fcs_vport_s *vport);
  58. struct bfa_fcs_vport_s *bfa_fcs_vport_lookup(struct bfa_fcs_s *fcs,
  59. u16 vf_id, wwn_t vpwwn);
  60. #endif /* __BFA_FCS_VPORT_H__ */