bfa_csdebug.c 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. #include <cs/bfa_debug.h>
  18. #include <bfa_os_inc.h>
  19. #include <cs/bfa_q.h>
  20. #include <log/bfa_log_hal.h>
  21. /**
  22. * cs_debug_api
  23. */
  24. void
  25. bfa_panic(int line, char *file, char *panicstr)
  26. {
  27. bfa_log(NULL, BFA_LOG_HAL_ASSERT, file, line, panicstr);
  28. bfa_os_panic();
  29. }
  30. void
  31. bfa_sm_panic(struct bfa_log_mod_s *logm, int line, char *file, int event)
  32. {
  33. bfa_log(logm, BFA_LOG_HAL_SM_ASSERT, file, line, event);
  34. bfa_os_panic();
  35. }
  36. int
  37. bfa_q_is_on_q_func(struct list_head *q, struct list_head *qe)
  38. {
  39. struct list_head *tqe;
  40. tqe = bfa_q_next(q);
  41. while (tqe != q) {
  42. if (tqe == qe)
  43. return 1;
  44. tqe = bfa_q_next(tqe);
  45. if (tqe == NULL)
  46. break;
  47. }
  48. return 0;
  49. }