1 /* Broadcom NetXtreme-C/E network driver.
3 * Copyright (c) 2014-2016 Broadcom Corporation
4 * Copyright (c) 2016-2017 Broadcom Limited
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.
11 #ifndef BNXT_ETHTOOL_H
12 #define BNXT_ETHTOOL_H
25 #define COREDUMP_LIST_BUF_LEN 2048
26 #define COREDUMP_RETRIEVE_BUF_LEN 4096
28 struct bnxt_coredump
{
34 #define BNXT_COREDUMP_BUF_LEN(len) ((len) - sizeof(struct bnxt_coredump_record))
36 struct bnxt_hwrm_dbg_dma_info
{
47 struct hwrm_dbg_cmn_input
{
53 __le64 host_dest_addr
;
57 struct hwrm_dbg_cmn_output
{
63 #define HWRM_DBG_CMN_FLAGS_MORE 1
66 #define BNXT_CRASH_DUMP_LEN (8 << 20)
68 #define BNXT_LED_DFLT_ENA \
69 (PORT_LED_CFG_REQ_ENABLES_LED0_ID | \
70 PORT_LED_CFG_REQ_ENABLES_LED0_STATE | \
71 PORT_LED_CFG_REQ_ENABLES_LED0_BLINK_ON | \
72 PORT_LED_CFG_REQ_ENABLES_LED0_BLINK_OFF | \
73 PORT_LED_CFG_REQ_ENABLES_LED0_GROUP_ID)
75 #define BNXT_LED_DFLT_ENA_SHIFT 6
77 #define BNXT_LED_DFLT_ENABLES(x) \
78 cpu_to_le32(BNXT_LED_DFLT_ENA << (BNXT_LED_DFLT_ENA_SHIFT * (x)))
80 #define BNXT_FW_RESET_AP (ETH_RESET_AP << ETH_RESET_SHARED_SHIFT)
81 #define BNXT_FW_RESET_CHIP ((ETH_RESET_MGMT | ETH_RESET_IRQ | \
82 ETH_RESET_DMA | ETH_RESET_FILTER | \
83 ETH_RESET_OFFLOAD | ETH_RESET_MAC | \
84 ETH_RESET_PHY | ETH_RESET_RAM) \
85 << ETH_RESET_SHARED_SHIFT)
87 #define BNXT_PXP_REG_LEN 0x3110
89 extern const struct ethtool_ops bnxt_ethtool_ops
;
91 u32
bnxt_get_rxfh_indir_size(struct net_device
*dev
);
92 u32
_bnxt_fw_to_ethtool_adv_spds(u16
, u8
);
93 u32
bnxt_fw_to_ethtool_speed(u16
);
94 u16
bnxt_get_fw_auto_link_speeds(u32
);
95 int bnxt_hwrm_nvm_get_dev_info(struct bnxt
*bp
,
96 struct hwrm_nvm_get_dev_info_output
*nvm_dev_info
);
97 int bnxt_flash_package_from_fw_obj(struct net_device
*dev
, const struct firmware
*fw
,
99 void bnxt_ethtool_init(struct bnxt
*bp
);
100 void bnxt_ethtool_free(struct bnxt
*bp
);