Back to home page

OSCL-LXR

 
 

    


0001 /* Broadcom NetXtreme-C/E network driver.
0002  *
0003  * Copyright (c) 2014-2016 Broadcom Corporation
0004  * Copyright (c) 2016-2017 Broadcom Limited
0005  *
0006  * This program is free software; you can redistribute it and/or modify
0007  * it under the terms of the GNU General Public License as published by
0008  * the Free Software Foundation.
0009  */
0010 
0011 #ifndef BNXT_ETHTOOL_H
0012 #define BNXT_ETHTOOL_H
0013 
0014 struct bnxt_led_cfg {
0015     u8 led_id;
0016     u8 led_state;
0017     u8 led_color;
0018     u8 unused;
0019     __le16 led_blink_on;
0020     __le16 led_blink_off;
0021     u8 led_group_id;
0022     u8 rsvd;
0023 };
0024 
0025 #define BNXT_LED_DFLT_ENA               \
0026     (PORT_LED_CFG_REQ_ENABLES_LED0_ID |     \
0027      PORT_LED_CFG_REQ_ENABLES_LED0_STATE |      \
0028      PORT_LED_CFG_REQ_ENABLES_LED0_BLINK_ON |   \
0029      PORT_LED_CFG_REQ_ENABLES_LED0_BLINK_OFF |  \
0030      PORT_LED_CFG_REQ_ENABLES_LED0_GROUP_ID)
0031 
0032 #define BNXT_LED_DFLT_ENA_SHIFT 6
0033 
0034 #define BNXT_LED_DFLT_ENABLES(x)            \
0035     cpu_to_le32(BNXT_LED_DFLT_ENA << (BNXT_LED_DFLT_ENA_SHIFT * (x)))
0036 
0037 #define BNXT_FW_RESET_AP    (ETH_RESET_AP << ETH_RESET_SHARED_SHIFT)
0038 #define BNXT_FW_RESET_CHIP  ((ETH_RESET_MGMT | ETH_RESET_IRQ |  \
0039                   ETH_RESET_DMA | ETH_RESET_FILTER |    \
0040                   ETH_RESET_OFFLOAD | ETH_RESET_MAC |   \
0041                   ETH_RESET_PHY | ETH_RESET_RAM)    \
0042                  << ETH_RESET_SHARED_SHIFT)
0043 
0044 #define BNXT_PXP_REG_LEN    0x3110
0045 
0046 extern const struct ethtool_ops bnxt_ethtool_ops;
0047 
0048 u32 bnxt_get_rxfh_indir_size(struct net_device *dev);
0049 u32 _bnxt_fw_to_ethtool_adv_spds(u16, u8);
0050 u32 bnxt_fw_to_ethtool_speed(u16);
0051 u16 bnxt_get_fw_auto_link_speeds(u32);
0052 int bnxt_hwrm_nvm_get_dev_info(struct bnxt *bp,
0053                    struct hwrm_nvm_get_dev_info_output *nvm_dev_info);
0054 int bnxt_hwrm_firmware_reset(struct net_device *dev, u8 proc_type,
0055                  u8 self_reset, u8 flags);
0056 int bnxt_flash_package_from_fw_obj(struct net_device *dev, const struct firmware *fw,
0057                    u32 install_type, struct netlink_ext_ack *extack);
0058 int bnxt_get_pkginfo(struct net_device *dev, char *ver, int size);
0059 void bnxt_ethtool_init(struct bnxt *bp);
0060 void bnxt_ethtool_free(struct bnxt *bp);
0061 int bnxt_find_nvram_item(struct net_device *dev, u16 type, u16 ordinal,
0062              u16 ext, u16 *index, u32 *item_length,
0063              u32 *data_length);
0064 int bnxt_find_nvram_item(struct net_device *dev, u16 type, u16 ordinal,
0065              u16 ext, u16 *index, u32 *item_length,
0066              u32 *data_length);
0067 int bnxt_flash_nvram(struct net_device *dev, u16 dir_type,
0068              u16 dir_ordinal, u16 dir_ext, u16 dir_attr,
0069              u32 dir_item_len, const u8 *data,
0070              size_t data_len);
0071 int bnxt_get_nvram_item(struct net_device *dev, u32 index, u32 offset,
0072             u32 length, u8 *data);
0073 
0074 #endif