bnxt_ethtool.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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 BNXT_LED_DFLT_ENA \
  23. (PORT_LED_CFG_REQ_ENABLES_LED0_ID | \
  24. PORT_LED_CFG_REQ_ENABLES_LED0_STATE | \
  25. PORT_LED_CFG_REQ_ENABLES_LED0_BLINK_ON | \
  26. PORT_LED_CFG_REQ_ENABLES_LED0_BLINK_OFF | \
  27. PORT_LED_CFG_REQ_ENABLES_LED0_GROUP_ID)
  28. #define BNXT_LED_DFLT_ENA_SHIFT 6
  29. #define BNXT_LED_DFLT_ENABLES(x) \
  30. cpu_to_le32(BNXT_LED_DFLT_ENA << (BNXT_LED_DFLT_ENA_SHIFT * (x)))
  31. #define BNXT_FW_RESET_AP (ETH_RESET_AP << ETH_RESET_SHARED_SHIFT)
  32. #define BNXT_FW_RESET_CHIP ((ETH_RESET_MGMT | ETH_RESET_IRQ | \
  33. ETH_RESET_DMA | ETH_RESET_FILTER | \
  34. ETH_RESET_OFFLOAD | ETH_RESET_MAC | \
  35. ETH_RESET_PHY | ETH_RESET_RAM) \
  36. << ETH_RESET_SHARED_SHIFT)
  37. #define BNXT_PXP_REG_LEN 0x3110
  38. #define BNXT_IP_PROTO_FULL_MASK 0xFF
  39. extern const struct ethtool_ops bnxt_ethtool_ops;
  40. u32 bnxt_get_rxfh_indir_size(struct net_device *dev);
  41. void _bnxt_fw_to_linkmode(unsigned long *mode, u16 fw_speeds);
  42. u32 bnxt_fw_to_ethtool_speed(u16);
  43. u16 bnxt_get_fw_auto_link_speeds(const unsigned long *mode);
  44. int bnxt_hwrm_nvm_get_dev_info(struct bnxt *bp,
  45. struct hwrm_nvm_get_dev_info_output *nvm_dev_info);
  46. int bnxt_hwrm_firmware_reset(struct net_device *dev, u8 proc_type,
  47. u8 self_reset, u8 flags);
  48. int bnxt_flash_package_from_fw_obj(struct net_device *dev, const struct firmware *fw,
  49. u32 install_type, struct netlink_ext_ack *extack);
  50. int bnxt_get_pkginfo(struct net_device *dev, char *ver, int size);
  51. void bnxt_ethtool_init(struct bnxt *bp);
  52. void bnxt_ethtool_free(struct bnxt *bp);
  53. int bnxt_find_nvram_item(struct net_device *dev, u16 type, u16 ordinal,
  54. u16 ext, u16 *index, u32 *item_length,
  55. u32 *data_length);
  56. int bnxt_find_nvram_item(struct net_device *dev, u16 type, u16 ordinal,
  57. u16 ext, u16 *index, u32 *item_length,
  58. u32 *data_length);
  59. int bnxt_flash_nvram(struct net_device *dev, u16 dir_type,
  60. u16 dir_ordinal, u16 dir_ext, u16 dir_attr,
  61. u32 dir_item_len, const u8 *data,
  62. size_t data_len);
  63. int bnxt_get_nvram_item(struct net_device *dev, u32 index, u32 offset,
  64. u32 length, u8 *data);
  65. #endif