cxgb4_cudbg.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * Copyright (C) 2017 Chelsio Communications. All rights reserved.
  3. *
  4. * This program is free software; you can redistribute it and/or modify it
  5. * under the terms and conditions of the GNU General Public License,
  6. * version 2, as published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope it will be useful, but WITHOUT
  9. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  10. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  11. * more details.
  12. *
  13. * The full GNU General Public License is included in this distribution in
  14. * the file called "COPYING".
  15. *
  16. */
  17. #ifndef __CXGB4_CUDBG_H__
  18. #define __CXGB4_CUDBG_H__
  19. #include "cudbg_if.h"
  20. #include "cudbg_lib_common.h"
  21. #include "cudbg_entity.h"
  22. #include "cudbg_lib.h"
  23. #define CUDBG_DUMP_BUFF_SIZE (32 * 1024 * 1024) /* 32 MB */
  24. #define CUDBG_COMPRESS_BUFF_SIZE (4 * 1024 * 1024) /* 4 MB */
  25. typedef int (*cudbg_collect_callback_t)(struct cudbg_init *pdbg_init,
  26. struct cudbg_buffer *dbg_buff,
  27. struct cudbg_error *cudbg_err);
  28. struct cxgb4_collect_entity {
  29. enum cudbg_dbg_entity_type entity;
  30. cudbg_collect_callback_t collect_cb;
  31. };
  32. enum CXGB4_ETHTOOL_DUMP_FLAGS {
  33. CXGB4_ETH_DUMP_NONE = ETH_FW_DUMP_DISABLE,
  34. CXGB4_ETH_DUMP_MEM = (1 << 0), /* On-Chip Memory Dumps */
  35. CXGB4_ETH_DUMP_HW = (1 << 1), /* various FW and HW dumps */
  36. };
  37. #define CXGB4_ETH_DUMP_ALL (CXGB4_ETH_DUMP_MEM | CXGB4_ETH_DUMP_HW)
  38. u32 cxgb4_get_dump_length(struct adapter *adap, u32 flag);
  39. int cxgb4_cudbg_collect(struct adapter *adap, void *buf, u32 *buf_size,
  40. u32 flag);
  41. void cxgb4_init_ethtool_dump(struct adapter *adapter);
  42. int cxgb4_cudbg_vmcore_add_dump(struct adapter *adap);
  43. #endif /* __CXGB4_CUDBG_H__ */