bfa_port_priv.h 2.8 KB

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