#define NGBE_FRAME_SIZE_MAX (9728) /* Maximum frame size, +FCS */
#define NGBE_FRAME_SIZE_DFT (1522) /* Default frame size, +FCS */
#define NGBE_NUM_POOL (32)
+#define NGBE_PBRXSIZE_MAX 0x00080000 /* 512KB Packet Buffer */
+#define NGBE_PBTXSIZE_MAX 0x00005000 /* 20KB Packet Buffer */
+#define NGBE_TXPKT_SIZE_MAX 0xA /* Max Tx Packet size */
#define NGBE_MAX_QP (8)
#define NGBE_MAX_UTA 128
+#define NGBE_PCI_MASTER_DISABLE_TIMEOUT 800
+
+
#define NGBE_ALIGN 128 /* as intel did */
#define NGBE_ISB_SIZE 16
ngbe_eeprom_none /* No NVM support */
};
+enum ngbe_link_type {
+ ngbe_link_type_unknown = 0,
+ ngbe_link_fiber,
+ ngbe_link_copper
+};
+
enum ngbe_mac_type {
ngbe_mac_unknown = 0,
ngbe_mac_em,
ngbe_media_type_virtual
};
+/* Flow Control Settings */
+enum ngbe_fc_mode {
+ ngbe_fc_none = 0,
+ ngbe_fc_rx_pause,
+ ngbe_fc_tx_pause,
+ ngbe_fc_full,
+ ngbe_fc_default
+};
+
struct ngbe_hw;
struct ngbe_addr_filter_info {
u8 lan_id;
};
+/* Flow control parameters */
+struct ngbe_fc_info {
+ u32 high_water; /* Flow Ctrl High-water */
+ u32 low_water; /* Flow Ctrl Low-water */
+ u16 pause_time; /* Flow Control Pause timer */
+ bool send_xon; /* Flow control send XON */
+ bool strict_ieee; /* Strict IEEE mode */
+ bool disable_fc_autoneg; /* Do not autonegotiate FC */
+ bool fc_was_autonegged; /* Is current_mode the result of autonegging? */
+ enum ngbe_fc_mode current_mode; /* FC mode in effect */
+ enum ngbe_fc_mode requested_mode; /* FC mode requested by caller */
+};
+
/* Statistics counters collected by the MAC */
/* PB[] RxTx */
struct ngbe_pb_stats {
struct ngbe_rom_info {
s32 (*init_params)(struct ngbe_hw *hw);
+ s32 (*readw_buffer)(struct ngbe_hw *hw, u32 offset, u32 words,
+ void *data);
s32 (*read32)(struct ngbe_hw *hw, u32 addr, u32 *data);
+ s32 (*writew_buffer)(struct ngbe_hw *hw, u32 offset, u32 words,
+ void *data);
s32 (*validate_checksum)(struct ngbe_hw *hw, u16 *checksum_val);
enum ngbe_eeprom_type type;
s32 (*get_link_capabilities)(struct ngbe_hw *hw,
u32 *speed, bool *autoneg);
+ /* Packet Buffer manipulation */
+ void (*setup_pba)(struct ngbe_hw *hw);
+
+ /* LED */
+ s32 (*led_on)(struct ngbe_hw *hw, u32 index);
+ s32 (*led_off)(struct ngbe_hw *hw, u32 index);
+
/* RAR */
s32 (*set_rar)(struct ngbe_hw *hw, u32 index, u8 *addr, u32 vmdq,
u32 enable_addr);
u32 mc_addr_count,
ngbe_mc_addr_itr func, bool clear);
s32 (*clear_vfta)(struct ngbe_hw *hw);
+ s32 (*set_vfta)(struct ngbe_hw *hw, u32 vlan,
+ u32 vind, bool vlan_on, bool vlvf_bypass);
+ s32 (*set_vlvf)(struct ngbe_hw *hw, u32 vlan, u32 vind,
+ bool vlan_on, u32 *vfta_delta, u32 vfta,
+ bool vlvf_bypass);
+ void (*set_mac_anti_spoofing)(struct ngbe_hw *hw, bool enable, int vf);
+ void (*set_vlan_anti_spoofing)(struct ngbe_hw *hw,
+ bool enable, int vf);
+
+ /* Flow Control */
+ s32 (*fc_enable)(struct ngbe_hw *hw);
+ s32 (*setup_fc)(struct ngbe_hw *hw);
+ void (*fc_autoneg)(struct ngbe_hw *hw);
/* Manageability interface */
s32 (*init_thermal_sensor_thresh)(struct ngbe_hw *hw);
s32 (*check_overtemp)(struct ngbe_hw *hw);
enum ngbe_mac_type type;
+ enum ngbe_link_type link_type;
u8 addr[ETH_ADDR_LEN];
u8 perm_addr[ETH_ADDR_LEN];
#define NGBE_MAX_MTA 128
u32 mcft_size;
u32 vft_size;
u32 num_rar_entries;
+ u32 rx_pb_size;
u32 max_tx_queues;
u32 max_rx_queues;
bool get_link_status;
s32 (*setup_link)(struct ngbe_hw *hw, u32 speed,
bool autoneg_wait_to_complete);
s32 (*check_link)(struct ngbe_hw *hw, u32 *speed, bool *link_up);
+ s32 (*set_phy_power)(struct ngbe_hw *hw, bool on);
+ s32 (*led_oem_chk)(struct ngbe_hw *hw, u32 *data);
+ s32 (*get_adv_pause)(struct ngbe_hw *hw, u8 *pause_bit);
+ s32 (*get_lp_adv_pause)(struct ngbe_hw *hw, u8 *pause_bit);
+ s32 (*set_pause_adv)(struct ngbe_hw *hw, u16 pause_bit);
enum ngbe_media_type media_type;
enum ngbe_phy_type type;
u32 autoneg_advertised;
};
+struct ngbe_mbx_stats {
+ u32 msgs_tx;
+ u32 msgs_rx;
+
+ u32 acks;
+ u32 reqs;
+ u32 rsts;
+};
+
+struct ngbe_mbx_info {
+ void (*init_params)(struct ngbe_hw *hw);
+ s32 (*read)(struct ngbe_hw *hw, u32 *msg, u16 size, u16 vf_number);
+ s32 (*write)(struct ngbe_hw *hw, u32 *msg, u16 size, u16 vf_number);
+ s32 (*check_for_msg)(struct ngbe_hw *hw, u16 mbx_id);
+ s32 (*check_for_ack)(struct ngbe_hw *hw, u16 mbx_id);
+ s32 (*check_for_rst)(struct ngbe_hw *hw, u16 mbx_id);
+
+ struct ngbe_mbx_stats stats;
+ u32 timeout;
+ u32 usec_delay;
+ u16 size;
+};
+
enum ngbe_isb_idx {
NGBE_ISB_HEADER,
NGBE_ISB_MISC,
void *back;
struct ngbe_mac_info mac;
struct ngbe_addr_filter_info addr_ctrl;
+ struct ngbe_fc_info fc;
struct ngbe_phy_info phy;
struct ngbe_rom_info rom;
struct ngbe_bus_info bus;
+ struct ngbe_mbx_info mbx;
u16 device_id;
u16 vendor_id;
u16 sub_device_id;
u16 sub_system_id;
u32 eeprom_id;
+ u8 revision_id;
bool adapter_stopped;
uint64_t isb_dma;
u32 q_tx_regs[8 * 4];
bool offset_loaded;
bool is_pf;
+ bool gpio_ctl;
+ u32 led_conf;
struct {
u64 rx_qp_packets;
u64 tx_qp_packets;