bfa_rport_priv.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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_RPORT_PRIV_H__
  18. #define __BFA_RPORT_PRIV_H__
  19. #include <bfa_svc.h>
  20. #define BFA_RPORT_MIN 4
  21. struct bfa_rport_mod_s {
  22. struct bfa_rport_s *rps_list; /* list of rports */
  23. struct list_head rp_free_q; /* free bfa_rports */
  24. struct list_head rp_active_q; /* free bfa_rports */
  25. u16 num_rports; /* number of rports */
  26. };
  27. #define BFA_RPORT_MOD(__bfa) (&(__bfa)->modules.rport_mod)
  28. /**
  29. * Convert rport tag to RPORT
  30. */
  31. #define BFA_RPORT_FROM_TAG(__bfa, _tag) \
  32. (BFA_RPORT_MOD(__bfa)->rps_list + \
  33. ((_tag) & (BFA_RPORT_MOD(__bfa)->num_rports - 1)))
  34. /*
  35. * external functions
  36. */
  37. void bfa_rport_isr(struct bfa_s *bfa, struct bfi_msg_s *msg);
  38. #endif /* __BFA_RPORT_PRIV_H__ */