bnxt_ethtool.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /* Broadcom NetXtreme-C/E network driver.
  2. *
  3. * Copyright (c) 2014-2016 Broadcom Corporation
  4. * Copyright (c) 2016-2017 Broadcom Limited
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation.
  9. */
  10. #ifndef BNXT_ETHTOOL_H
  11. #define BNXT_ETHTOOL_H
  12. struct bnxt_led_cfg {
  13. u8 led_id;
  14. u8 led_state;
  15. u8 led_color;
  16. u8 unused;
  17. __le16 led_blink_on;
  18. __le16 led_blink_off;
  19. u8 led_group_id;
  20. u8 rsvd;
  21. };
  22. #define COREDUMP_LIST_BUF_LEN 2048
  23. #define COREDUMP_RETRIEVE_BUF_LEN 4096
  24. struct bnxt_coredump {
  25. void *data;
  26. int data_size;
  27. u16 total_segs;
  28. };
  29. #define BNXT_COREDUMP_BUF_LEN(len) ((len) - sizeof(struct bnxt_coredump_record))
  30. struct bnxt_hwrm_dbg_dma_info {
  31. void *dest_buf;
  32. int dest_buf_size;
  33. u16 dma_len;
  34. u16 seq_off;
  35. u16 data_len_off;
  36. u16 segs;
  37. u32 seg_start;
  38. u32 buf_len;
  39. };
  40. struct hwrm_dbg_cmn_input {
  41. __le16 req_type;
  42. __le16 cmpl_ring;
  43. __le16 seq_id;
  44. __le16 target_id;
  45. __le64 resp_addr;
  46. __le64 host_dest_addr;
  47. __le32 host_buf_len;
  48. };
  49. struct hwrm_dbg_cmn_output {
  50. __le16 error_code;
  51. __le16 req_type;
  52. __le16 seq_id;
  53. __le16 resp_len;
  54. u8 flags;
  55. #define HWRM_DBG_CMN_FLAGS_MORE 1
  56. };
  57. #define BNXT_LED_DFLT_ENA \
  58. (PORT_LED_CFG_REQ_ENABLES_LED0_ID | \
  59. PORT_LED_CFG_REQ_ENABLES_LED0_STATE | \
  60. PORT_LED_CFG_REQ_ENABLES_LED0_BLINK_ON | \
  61. PORT_LED_CFG_REQ_ENABLES_LED0_BLINK_OFF | \
  62. PORT_LED_CFG_REQ_ENABLES_LED0_GROUP_ID)
  63. #define BNXT_LED_DFLT_ENA_SHIFT 6
  64. #define BNXT_LED_DFLT_ENABLES(x) \
  65. cpu_to_le32(BNXT_LED_DFLT_ENA << (BNXT_LED_DFLT_ENA_SHIFT * (x)))
  66. #define BNXT_FW_RESET_AP 0xfffe
  67. #define BNXT_FW_RESET_CHIP 0xffff
  68. extern const struct ethtool_ops bnxt_ethtool_ops;
  69. u32 _bnxt_fw_to_ethtool_adv_spds(u16, u8);
  70. u32 bnxt_fw_to_ethtool_speed(u16);
  71. u16 bnxt_get_fw_auto_link_speeds(u32);
  72. void bnxt_ethtool_init(struct bnxt *bp);
  73. void bnxt_ethtool_free(struct bnxt *bp);
  74. #endif