bfa_port_priv.h 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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_PORT_PRIV_H__
  18. #define __BFA_PORT_PRIV_H__
  19. #include <defs/bfa_defs_pport.h>
  20. #include <bfi/bfi_pport.h>
  21. #include "bfa_intr_priv.h"
  22. /**
  23. * Link notification data structure
  24. */
  25. struct bfa_fcport_ln_s {
  26. struct bfa_fcport_s *fcport;
  27. bfa_sm_t sm;
  28. struct bfa_cb_qe_s ln_qe; /* BFA callback queue elem for ln */
  29. enum bfa_pport_linkstate ln_event; /* ln event for callback */
  30. };
  31. /**
  32. * BFA FC port data structure
  33. */
  34. struct bfa_fcport_s {
  35. struct bfa_s *bfa; /* parent BFA instance */
  36. bfa_sm_t sm; /* port state machine */
  37. wwn_t nwwn; /* node wwn of physical port */
  38. wwn_t pwwn; /* port wwn of physical oprt */
  39. enum bfa_pport_speed speed_sup;
  40. /* supported speeds */
  41. enum bfa_pport_speed speed; /* current speed */
  42. enum bfa_pport_topology topology; /* current topology */
  43. u8 myalpa; /* my ALPA in LOOP topology */
  44. u8 rsvd[3];
  45. u32 mypid:24;
  46. u32 rsvd_b:8;
  47. struct bfa_pport_cfg_s cfg; /* current port configuration */
  48. struct bfa_qos_attr_s qos_attr; /* QoS Attributes */
  49. struct bfa_qos_vc_attr_s qos_vc_attr; /* VC info from ELP */
  50. struct bfa_reqq_wait_s reqq_wait;
  51. /* to wait for room in reqq */
  52. struct bfa_reqq_wait_s svcreq_wait;
  53. /* to wait for room in reqq */
  54. struct bfa_reqq_wait_s stats_reqq_wait;
  55. /* to wait for room in reqq (stats) */
  56. void *event_cbarg;
  57. void (*event_cbfn) (void *cbarg,
  58. bfa_pport_event_t event);
  59. union {
  60. union bfi_fcport_i2h_msg_u i2hmsg;
  61. } event_arg;
  62. void *bfad; /* BFA driver handle */
  63. struct bfa_fcport_ln_s ln; /* Link Notification */
  64. struct bfa_cb_qe_s hcb_qe; /* BFA callback queue elem */
  65. struct bfa_timer_s timer; /* timer */
  66. u32 msgtag; /* fimrware msg tag for reply */
  67. u8 *stats_kva;
  68. u64 stats_pa;
  69. union bfa_fcport_stats_u *stats;
  70. union bfa_fcport_stats_u *stats_ret; /* driver stats location */
  71. bfa_status_t stats_status; /* stats/statsclr status */
  72. bfa_boolean_t stats_busy; /* outstanding stats/statsclr */
  73. bfa_boolean_t stats_qfull;
  74. u32 stats_reset_time; /* stats reset time stamp */
  75. bfa_cb_pport_t stats_cbfn; /* driver callback function */
  76. void *stats_cbarg; /* user callback arg */
  77. bfa_boolean_t diag_busy; /* diag busy status */
  78. bfa_boolean_t beacon; /* port beacon status */
  79. bfa_boolean_t link_e2e_beacon; /* link beacon status */
  80. };
  81. #define BFA_FCPORT_MOD(__bfa) (&(__bfa)->modules.fcport)
  82. /*
  83. * public functions
  84. */
  85. void bfa_fcport_init(struct bfa_s *bfa);
  86. void bfa_fcport_isr(struct bfa_s *bfa, struct bfi_msg_s *msg);
  87. #endif /* __BFA_PORT_PRIV_H__ */