fp@2685: /* Intel(R) Gigabit Ethernet Linux driver
fp@2685: * Copyright(c) 2007-2014 Intel Corporation.
fp@2685: *
fp@2685: * This program is free software; you can redistribute it and/or modify it
fp@2685: * under the terms and conditions of the GNU General Public License,
fp@2685: * version 2, as published by the Free Software Foundation.
fp@2685: *
fp@2685: * This program is distributed in the hope it will be useful, but WITHOUT
fp@2685: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
fp@2685: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
fp@2685: * more details.
fp@2685: *
fp@2685: * You should have received a copy of the GNU General Public License along with
fp@2685: * this program; if not, see .
fp@2685: *
fp@2685: * The full GNU General Public License is included in this distribution in
fp@2685: * the file called "COPYING".
fp@2685: *
fp@2685: * Contact Information:
fp@2685: * e1000-devel Mailing List
fp@2685: * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
fp@2685: */
fp@2685:
fp@2685: /* Linux PRO/1000 Ethernet Driver main header file */
fp@2685:
fp@2685: #ifndef _IGB_H_
fp@2685: #define _IGB_H_
fp@2685:
fp@2685: #include "e1000_mac.h"
fp@2685: #include "e1000_82575.h"
fp@2685:
fp@2685: #include
fp@2685: #include
fp@2685: #include
fp@2685: #include
fp@2685: #include
fp@2685: #include
fp@2685: #include
fp@2685: #include
fp@2685: #include
fp@2685:
fp@2685: struct igb_adapter;
fp@2685:
fp@2685: #define E1000_PCS_CFG_IGN_SD 1
fp@2685:
fp@2685: /* Interrupt defines */
fp@2685: #define IGB_START_ITR 648 /* ~6000 ints/sec */
fp@2685: #define IGB_4K_ITR 980
fp@2685: #define IGB_20K_ITR 196
fp@2685: #define IGB_70K_ITR 56
fp@2685:
fp@2685: /* TX/RX descriptor defines */
fp@2685: #define IGB_DEFAULT_TXD 256
fp@2685: #define IGB_DEFAULT_TX_WORK 128
fp@2685: #define IGB_MIN_TXD 80
fp@2685: #define IGB_MAX_TXD 4096
fp@2685:
fp@2685: #define IGB_DEFAULT_RXD 256
fp@2685: #define IGB_MIN_RXD 80
fp@2685: #define IGB_MAX_RXD 4096
fp@2685:
fp@2685: #define IGB_DEFAULT_ITR 3 /* dynamic */
fp@2685: #define IGB_MAX_ITR_USECS 10000
fp@2685: #define IGB_MIN_ITR_USECS 10
fp@2685: #define NON_Q_VECTORS 1
fp@2685: #define MAX_Q_VECTORS 8
fp@2685: #define MAX_MSIX_ENTRIES 10
fp@2685:
fp@2685: /* Transmit and receive queues */
fp@2685: #define IGB_MAX_RX_QUEUES 8
fp@2685: #define IGB_MAX_RX_QUEUES_82575 4
fp@2685: #define IGB_MAX_RX_QUEUES_I211 2
fp@2685: #define IGB_MAX_TX_QUEUES 8
fp@2685: #define IGB_MAX_VF_MC_ENTRIES 30
fp@2685: #define IGB_MAX_VF_FUNCTIONS 8
fp@2685: #define IGB_MAX_VFTA_ENTRIES 128
fp@2685: #define IGB_82576_VF_DEV_ID 0x10CA
fp@2685: #define IGB_I350_VF_DEV_ID 0x1520
fp@2685:
fp@2685: /* NVM version defines */
fp@2685: #define IGB_MAJOR_MASK 0xF000
fp@2685: #define IGB_MINOR_MASK 0x0FF0
fp@2685: #define IGB_BUILD_MASK 0x000F
fp@2685: #define IGB_COMB_VER_MASK 0x00FF
fp@2685: #define IGB_MAJOR_SHIFT 12
fp@2685: #define IGB_MINOR_SHIFT 4
fp@2685: #define IGB_COMB_VER_SHFT 8
fp@2685: #define IGB_NVM_VER_INVALID 0xFFFF
fp@2685: #define IGB_ETRACK_SHIFT 16
fp@2685: #define NVM_ETRACK_WORD 0x0042
fp@2685: #define NVM_COMB_VER_OFF 0x0083
fp@2685: #define NVM_COMB_VER_PTR 0x003d
fp@2685:
fp@2685: struct vf_data_storage {
fp@2685: unsigned char vf_mac_addresses[ETH_ALEN];
fp@2685: u16 vf_mc_hashes[IGB_MAX_VF_MC_ENTRIES];
fp@2685: u16 num_vf_mc_hashes;
fp@2685: u16 vlans_enabled;
fp@2685: u32 flags;
fp@2685: unsigned long last_nack;
fp@2685: u16 pf_vlan; /* When set, guest VLAN config not allowed. */
fp@2685: u16 pf_qos;
fp@2685: u16 tx_rate;
fp@2685: bool spoofchk_enabled;
fp@2685: };
fp@2685:
fp@2685: #define IGB_VF_FLAG_CTS 0x00000001 /* VF is clear to send data */
fp@2685: #define IGB_VF_FLAG_UNI_PROMISC 0x00000002 /* VF has unicast promisc */
fp@2685: #define IGB_VF_FLAG_MULTI_PROMISC 0x00000004 /* VF has multicast promisc */
fp@2685: #define IGB_VF_FLAG_PF_SET_MAC 0x00000008 /* PF has set MAC address */
fp@2685:
fp@2685: /* RX descriptor control thresholds.
fp@2685: * PTHRESH - MAC will consider prefetch if it has fewer than this number of
fp@2685: * descriptors available in its onboard memory.
fp@2685: * Setting this to 0 disables RX descriptor prefetch.
fp@2685: * HTHRESH - MAC will only prefetch if there are at least this many descriptors
fp@2685: * available in host memory.
fp@2685: * If PTHRESH is 0, this should also be 0.
fp@2685: * WTHRESH - RX descriptor writeback threshold - MAC will delay writing back
fp@2685: * descriptors until either it has this many to write back, or the
fp@2685: * ITR timer expires.
fp@2685: */
fp@2685: #define IGB_RX_PTHRESH ((hw->mac.type == e1000_i354) ? 12 : 8)
fp@2685: #define IGB_RX_HTHRESH 8
fp@2685: #define IGB_TX_PTHRESH ((hw->mac.type == e1000_i354) ? 20 : 8)
fp@2685: #define IGB_TX_HTHRESH 1
fp@2685: #define IGB_RX_WTHRESH ((hw->mac.type == e1000_82576 && \
fp@2685: (adapter->flags & IGB_FLAG_HAS_MSIX)) ? 1 : 4)
fp@2685: #define IGB_TX_WTHRESH ((hw->mac.type == e1000_82576 && \
fp@2685: (adapter->flags & IGB_FLAG_HAS_MSIX)) ? 1 : 16)
fp@2685:
fp@2685: /* this is the size past which hardware will drop packets when setting LPE=0 */
fp@2685: #define MAXIMUM_ETHERNET_VLAN_SIZE 1522
fp@2685:
fp@2685: /* Supported Rx Buffer Sizes */
fp@2685: #define IGB_RXBUFFER_256 256
fp@2685: #define IGB_RXBUFFER_2048 2048
fp@2685: #define IGB_RX_HDR_LEN IGB_RXBUFFER_256
fp@2685: #define IGB_RX_BUFSZ IGB_RXBUFFER_2048
fp@2685:
fp@2685: /* How many Rx Buffers do we bundle into one write to the hardware ? */
fp@2685: #define IGB_RX_BUFFER_WRITE 16 /* Must be power of 2 */
fp@2685:
fp@2685: #define AUTO_ALL_MODES 0
fp@2685: #define IGB_EEPROM_APME 0x0400
fp@2685:
fp@2685: #ifndef IGB_MASTER_SLAVE
fp@2685: /* Switch to override PHY master/slave setting */
fp@2685: #define IGB_MASTER_SLAVE e1000_ms_hw_default
fp@2685: #endif
fp@2685:
fp@2685: #define IGB_MNG_VLAN_NONE -1
fp@2685:
fp@2685: enum igb_tx_flags {
fp@2685: /* cmd_type flags */
fp@2685: IGB_TX_FLAGS_VLAN = 0x01,
fp@2685: IGB_TX_FLAGS_TSO = 0x02,
fp@2685: IGB_TX_FLAGS_TSTAMP = 0x04,
fp@2685:
fp@2685: /* olinfo flags */
fp@2685: IGB_TX_FLAGS_IPV4 = 0x10,
fp@2685: IGB_TX_FLAGS_CSUM = 0x20,
fp@2685: };
fp@2685:
fp@2685: /* VLAN info */
fp@2685: #define IGB_TX_FLAGS_VLAN_MASK 0xffff0000
fp@2685: #define IGB_TX_FLAGS_VLAN_SHIFT 16
fp@2685:
fp@2685: /* The largest size we can write to the descriptor is 65535. In order to
fp@2685: * maintain a power of two alignment we have to limit ourselves to 32K.
fp@2685: */
fp@2685: #define IGB_MAX_TXD_PWR 15
fp@2685: #define IGB_MAX_DATA_PER_TXD (1 << IGB_MAX_TXD_PWR)
fp@2685:
fp@2685: /* Tx Descriptors needed, worst case */
fp@2685: #define TXD_USE_COUNT(S) DIV_ROUND_UP((S), IGB_MAX_DATA_PER_TXD)
fp@2685: #define DESC_NEEDED (MAX_SKB_FRAGS + 4)
fp@2685:
fp@2685: /* EEPROM byte offsets */
fp@2685: #define IGB_SFF_8472_SWAP 0x5C
fp@2685: #define IGB_SFF_8472_COMP 0x5E
fp@2685:
fp@2685: /* Bitmasks */
fp@2685: #define IGB_SFF_ADDRESSING_MODE 0x4
fp@2685: #define IGB_SFF_8472_UNSUP 0x00
fp@2685:
fp@2685: /* wrapper around a pointer to a socket buffer,
fp@2685: * so a DMA handle can be stored along with the buffer
fp@2685: */
fp@2685: struct igb_tx_buffer {
fp@2685: union e1000_adv_tx_desc *next_to_watch;
fp@2685: unsigned long time_stamp;
fp@2685: struct sk_buff *skb;
fp@2685: unsigned int bytecount;
fp@2685: u16 gso_segs;
fp@2685: __be16 protocol;
fp@2685:
fp@2685: DEFINE_DMA_UNMAP_ADDR(dma);
fp@2685: DEFINE_DMA_UNMAP_LEN(len);
fp@2685: u32 tx_flags;
fp@2685: };
fp@2685:
fp@2685: struct igb_rx_buffer {
fp@2685: dma_addr_t dma;
fp@2685: struct page *page;
fp@2685: unsigned int page_offset;
fp@2685: };
fp@2685:
fp@2685: struct igb_tx_queue_stats {
fp@2685: u64 packets;
fp@2685: u64 bytes;
fp@2685: u64 restart_queue;
fp@2685: u64 restart_queue2;
fp@2685: };
fp@2685:
fp@2685: struct igb_rx_queue_stats {
fp@2685: u64 packets;
fp@2685: u64 bytes;
fp@2685: u64 drops;
fp@2685: u64 csum_err;
fp@2685: u64 alloc_failed;
fp@2685: };
fp@2685:
fp@2685: struct igb_ring_container {
fp@2685: struct igb_ring *ring; /* pointer to linked list of rings */
fp@2685: unsigned int total_bytes; /* total bytes processed this int */
fp@2685: unsigned int total_packets; /* total packets processed this int */
fp@2685: u16 work_limit; /* total work allowed per interrupt */
fp@2685: u8 count; /* total number of rings in vector */
fp@2685: u8 itr; /* current ITR setting for ring */
fp@2685: };
fp@2685:
fp@2685: struct igb_ring {
fp@2685: struct igb_q_vector *q_vector; /* backlink to q_vector */
fp@2685: struct net_device *netdev; /* back pointer to net_device */
fp@2685: struct device *dev; /* device pointer for dma mapping */
fp@2685: union { /* array of buffer info structs */
fp@2685: struct igb_tx_buffer *tx_buffer_info;
fp@2685: struct igb_rx_buffer *rx_buffer_info;
fp@2685: };
fp@2685: void *desc; /* descriptor ring memory */
fp@2685: unsigned long flags; /* ring specific flags */
fp@2685: void __iomem *tail; /* pointer to ring tail register */
fp@2685: dma_addr_t dma; /* phys address of the ring */
fp@2685: unsigned int size; /* length of desc. ring in bytes */
fp@2685:
fp@2685: u16 count; /* number of desc. in the ring */
fp@2685: u8 queue_index; /* logical index of the ring*/
fp@2685: u8 reg_idx; /* physical index of the ring */
fp@2685:
fp@2685: /* everything past this point are written often */
fp@2685: u16 next_to_clean;
fp@2685: u16 next_to_use;
fp@2685: u16 next_to_alloc;
fp@2685:
fp@2685: union {
fp@2685: /* TX */
fp@2685: struct {
fp@2685: struct igb_tx_queue_stats tx_stats;
fp@2685: struct u64_stats_sync tx_syncp;
fp@2685: struct u64_stats_sync tx_syncp2;
fp@2685: };
fp@2685: /* RX */
fp@2685: struct {
fp@2685: struct sk_buff *skb;
fp@2685: struct igb_rx_queue_stats rx_stats;
fp@2685: struct u64_stats_sync rx_syncp;
fp@2685: };
fp@2685: };
fp@2685: } ____cacheline_internodealigned_in_smp;
fp@2685:
fp@2685: struct igb_q_vector {
fp@2685: struct igb_adapter *adapter; /* backlink */
fp@2685: int cpu; /* CPU for DCA */
fp@2685: u32 eims_value; /* EIMS mask value */
fp@2685:
fp@2685: u16 itr_val;
fp@2685: u8 set_itr;
fp@2685: void __iomem *itr_register;
fp@2685:
fp@2685: struct igb_ring_container rx, tx;
fp@2685:
fp@2685: struct napi_struct napi;
fp@2685: struct rcu_head rcu; /* to avoid race with update stats on free */
fp@2685: char name[IFNAMSIZ + 9];
fp@2685:
fp@2685: /* for dynamic allocation of rings associated with this q_vector */
fp@2685: struct igb_ring ring[0] ____cacheline_internodealigned_in_smp;
fp@2685: };
fp@2685:
fp@2685: enum e1000_ring_flags_t {
fp@2685: IGB_RING_FLAG_RX_SCTP_CSUM,
fp@2685: IGB_RING_FLAG_RX_LB_VLAN_BSWAP,
fp@2685: IGB_RING_FLAG_TX_CTX_IDX,
fp@2685: IGB_RING_FLAG_TX_DETECT_HANG
fp@2685: };
fp@2685:
fp@2685: #define IGB_TXD_DCMD (E1000_ADVTXD_DCMD_EOP | E1000_ADVTXD_DCMD_RS)
fp@2685:
fp@2685: #define IGB_RX_DESC(R, i) \
fp@2685: (&(((union e1000_adv_rx_desc *)((R)->desc))[i]))
fp@2685: #define IGB_TX_DESC(R, i) \
fp@2685: (&(((union e1000_adv_tx_desc *)((R)->desc))[i]))
fp@2685: #define IGB_TX_CTXTDESC(R, i) \
fp@2685: (&(((struct e1000_adv_tx_context_desc *)((R)->desc))[i]))
fp@2685:
fp@2685: /* igb_test_staterr - tests bits within Rx descriptor status and error fields */
fp@2685: static inline __le32 igb_test_staterr(union e1000_adv_rx_desc *rx_desc,
fp@2685: const u32 stat_err_bits)
fp@2685: {
fp@2685: return rx_desc->wb.upper.status_error & cpu_to_le32(stat_err_bits);
fp@2685: }
fp@2685:
fp@2685: /* igb_desc_unused - calculate if we have unused descriptors */
fp@2685: static inline int igb_desc_unused(struct igb_ring *ring)
fp@2685: {
fp@2685: if (ring->next_to_clean > ring->next_to_use)
fp@2685: return ring->next_to_clean - ring->next_to_use - 1;
fp@2685:
fp@2685: return ring->count + ring->next_to_clean - ring->next_to_use - 1;
fp@2685: }
fp@2685:
fp@2685: #ifdef CONFIG_IGB_HWMON
fp@2685:
fp@2685: #define IGB_HWMON_TYPE_LOC 0
fp@2685: #define IGB_HWMON_TYPE_TEMP 1
fp@2685: #define IGB_HWMON_TYPE_CAUTION 2
fp@2685: #define IGB_HWMON_TYPE_MAX 3
fp@2685:
fp@2685: struct hwmon_attr {
fp@2685: struct device_attribute dev_attr;
fp@2685: struct e1000_hw *hw;
fp@2685: struct e1000_thermal_diode_data *sensor;
fp@2685: char name[12];
fp@2685: };
fp@2685:
fp@2685: struct hwmon_buff {
fp@2685: struct attribute_group group;
fp@2685: const struct attribute_group *groups[2];
fp@2685: struct attribute *attrs[E1000_MAX_SENSORS * 4 + 1];
fp@2685: struct hwmon_attr hwmon_list[E1000_MAX_SENSORS * 4];
fp@2685: unsigned int n_hwmon;
fp@2685: };
fp@2685: #endif
fp@2685:
fp@2685: #define IGB_RETA_SIZE 128
fp@2685:
fp@2685: /* board specific private data structure */
fp@2685: struct igb_adapter {
fp@2685: unsigned long active_vlans[BITS_TO_LONGS(VLAN_N_VID)];
fp@2685:
fp@2685: struct net_device *netdev;
fp@2685:
fp@2685: unsigned long state;
fp@2685: unsigned int flags;
fp@2685:
fp@2685: unsigned int num_q_vectors;
fp@2685: struct msix_entry msix_entries[MAX_MSIX_ENTRIES];
fp@2685:
fp@2685: /* Interrupt Throttle Rate */
fp@2685: u32 rx_itr_setting;
fp@2685: u32 tx_itr_setting;
fp@2685: u16 tx_itr;
fp@2685: u16 rx_itr;
fp@2685:
fp@2685: /* TX */
fp@2685: u16 tx_work_limit;
fp@2685: u32 tx_timeout_count;
fp@2685: int num_tx_queues;
fp@2685: struct igb_ring *tx_ring[16];
fp@2685:
fp@2685: /* RX */
fp@2685: int num_rx_queues;
fp@2685: struct igb_ring *rx_ring[16];
fp@2685:
fp@2685: u32 max_frame_size;
fp@2685: u32 min_frame_size;
fp@2685:
fp@2685: struct timer_list watchdog_timer;
fp@2685: struct timer_list phy_info_timer;
fp@2685:
fp@2685: u16 mng_vlan_id;
fp@2685: u32 bd_number;
fp@2685: u32 wol;
fp@2685: u32 en_mng_pt;
fp@2685: u16 link_speed;
fp@2685: u16 link_duplex;
fp@2685:
fp@2685: struct work_struct reset_task;
fp@2685: struct work_struct watchdog_task;
fp@2685: bool fc_autoneg;
fp@2685: u8 tx_timeout_factor;
fp@2685: struct timer_list blink_timer;
fp@2685: unsigned long led_status;
fp@2685:
fp@2685: /* OS defined structs */
fp@2685: struct pci_dev *pdev;
fp@2685:
fp@2685: spinlock_t stats64_lock;
fp@2685: struct rtnl_link_stats64 stats64;
fp@2685:
fp@2685: /* structs defined in e1000_hw.h */
fp@2685: struct e1000_hw hw;
fp@2685: struct e1000_hw_stats stats;
fp@2685: struct e1000_phy_info phy_info;
fp@2685:
fp@2685: u32 test_icr;
fp@2685: struct igb_ring test_tx_ring;
fp@2685: struct igb_ring test_rx_ring;
fp@2685:
fp@2685: int msg_enable;
fp@2685:
fp@2685: struct igb_q_vector *q_vector[MAX_Q_VECTORS];
fp@2685: u32 eims_enable_mask;
fp@2685: u32 eims_other;
fp@2685:
fp@2685: /* to not mess up cache alignment, always add to the bottom */
fp@2685: u16 tx_ring_count;
fp@2685: u16 rx_ring_count;
fp@2685: unsigned int vfs_allocated_count;
fp@2685: struct vf_data_storage *vf_data;
fp@2685: int vf_rate_link_speed;
fp@2685: u32 rss_queues;
fp@2685: u32 wvbr;
fp@2685: u32 *shadow_vfta;
fp@2685:
fp@2685: struct ptp_clock *ptp_clock;
fp@2685: struct ptp_clock_info ptp_caps;
fp@2685: struct delayed_work ptp_overflow_work;
fp@2685: struct work_struct ptp_tx_work;
fp@2685: struct sk_buff *ptp_tx_skb;
fp@2685: struct hwtstamp_config tstamp_config;
fp@2685: unsigned long ptp_tx_start;
fp@2685: unsigned long last_rx_ptp_check;
fp@2685: unsigned long last_rx_timestamp;
fp@2685: spinlock_t tmreg_lock;
fp@2685: struct cyclecounter cc;
fp@2685: struct timecounter tc;
fp@2685: u32 tx_hwtstamp_timeouts;
fp@2685: u32 rx_hwtstamp_cleared;
fp@2685:
fp@2685: char fw_version[32];
fp@2685: #ifdef CONFIG_IGB_HWMON
fp@2685: struct hwmon_buff *igb_hwmon_buff;
fp@2685: bool ets;
fp@2685: #endif
fp@2685: struct i2c_algo_bit_data i2c_algo;
fp@2685: struct i2c_adapter i2c_adap;
fp@2685: struct i2c_client *i2c_client;
fp@2685: u32 rss_indir_tbl_init;
fp@2685: u8 rss_indir_tbl[IGB_RETA_SIZE];
fp@2685:
fp@2685: unsigned long link_check_timeout;
fp@2685: int copper_tries;
fp@2685: struct e1000_info ei;
fp@2685: u16 eee_advert;
fp@2685: };
fp@2685:
fp@2685: #define IGB_FLAG_HAS_MSI (1 << 0)
fp@2685: #define IGB_FLAG_DCA_ENABLED (1 << 1)
fp@2685: #define IGB_FLAG_QUAD_PORT_A (1 << 2)
fp@2685: #define IGB_FLAG_QUEUE_PAIRS (1 << 3)
fp@2685: #define IGB_FLAG_DMAC (1 << 4)
fp@2685: #define IGB_FLAG_PTP (1 << 5)
fp@2685: #define IGB_FLAG_RSS_FIELD_IPV4_UDP (1 << 6)
fp@2685: #define IGB_FLAG_RSS_FIELD_IPV6_UDP (1 << 7)
fp@2685: #define IGB_FLAG_WOL_SUPPORTED (1 << 8)
fp@2685: #define IGB_FLAG_NEED_LINK_UPDATE (1 << 9)
fp@2685: #define IGB_FLAG_MEDIA_RESET (1 << 10)
fp@2685: #define IGB_FLAG_MAS_CAPABLE (1 << 11)
fp@2685: #define IGB_FLAG_MAS_ENABLE (1 << 12)
fp@2685: #define IGB_FLAG_HAS_MSIX (1 << 13)
fp@2685: #define IGB_FLAG_EEE (1 << 14)
fp@2685:
fp@2685: /* Media Auto Sense */
fp@2685: #define IGB_MAS_ENABLE_0 0X0001
fp@2685: #define IGB_MAS_ENABLE_1 0X0002
fp@2685: #define IGB_MAS_ENABLE_2 0X0004
fp@2685: #define IGB_MAS_ENABLE_3 0X0008
fp@2685:
fp@2685: /* DMA Coalescing defines */
fp@2685: #define IGB_MIN_TXPBSIZE 20408
fp@2685: #define IGB_TX_BUF_4096 4096
fp@2685: #define IGB_DMCTLX_DCFLUSH_DIS 0x80000000 /* Disable DMA Coal Flush */
fp@2685:
fp@2685: #define IGB_82576_TSYNC_SHIFT 19
fp@2685: #define IGB_TS_HDR_LEN 16
fp@2685: enum e1000_state_t {
fp@2685: __IGB_TESTING,
fp@2685: __IGB_RESETTING,
fp@2685: __IGB_DOWN,
fp@2685: __IGB_PTP_TX_IN_PROGRESS,
fp@2685: };
fp@2685:
fp@2685: enum igb_boards {
fp@2685: board_82575,
fp@2685: };
fp@2685:
fp@2685: extern char igb_driver_name[];
fp@2685: extern char igb_driver_version[];
fp@2685:
fp@2685: int igb_up(struct igb_adapter *);
fp@2685: void igb_down(struct igb_adapter *);
fp@2685: void igb_reinit_locked(struct igb_adapter *);
fp@2685: void igb_reset(struct igb_adapter *);
fp@2685: int igb_reinit_queues(struct igb_adapter *);
fp@2685: void igb_write_rss_indir_tbl(struct igb_adapter *);
fp@2685: int igb_set_spd_dplx(struct igb_adapter *, u32, u8);
fp@2685: int igb_setup_tx_resources(struct igb_ring *);
fp@2685: int igb_setup_rx_resources(struct igb_ring *);
fp@2685: void igb_free_tx_resources(struct igb_ring *);
fp@2685: void igb_free_rx_resources(struct igb_ring *);
fp@2685: void igb_configure_tx_ring(struct igb_adapter *, struct igb_ring *);
fp@2685: void igb_configure_rx_ring(struct igb_adapter *, struct igb_ring *);
fp@2685: void igb_setup_tctl(struct igb_adapter *);
fp@2685: void igb_setup_rctl(struct igb_adapter *);
fp@2685: netdev_tx_t igb_xmit_frame_ring(struct sk_buff *, struct igb_ring *);
fp@2685: void igb_unmap_and_free_tx_resource(struct igb_ring *, struct igb_tx_buffer *);
fp@2685: void igb_alloc_rx_buffers(struct igb_ring *, u16);
fp@2685: void igb_update_stats(struct igb_adapter *, struct rtnl_link_stats64 *);
fp@2685: bool igb_has_link(struct igb_adapter *adapter);
fp@2685: void igb_set_ethtool_ops(struct net_device *);
fp@2685: void igb_power_up_link(struct igb_adapter *);
fp@2685: void igb_set_fw_version(struct igb_adapter *);
fp@2685: void igb_ptp_init(struct igb_adapter *adapter);
fp@2685: void igb_ptp_stop(struct igb_adapter *adapter);
fp@2685: void igb_ptp_reset(struct igb_adapter *adapter);
fp@2685: void igb_ptp_rx_hang(struct igb_adapter *adapter);
fp@2685: void igb_ptp_rx_rgtstamp(struct igb_q_vector *q_vector, struct sk_buff *skb);
fp@2685: void igb_ptp_rx_pktstamp(struct igb_q_vector *q_vector, unsigned char *va,
fp@2685: struct sk_buff *skb);
fp@2685: int igb_ptp_set_ts_config(struct net_device *netdev, struct ifreq *ifr);
fp@2685: int igb_ptp_get_ts_config(struct net_device *netdev, struct ifreq *ifr);
fp@2685: #ifdef CONFIG_IGB_HWMON
fp@2685: void igb_sysfs_exit(struct igb_adapter *adapter);
fp@2685: int igb_sysfs_init(struct igb_adapter *adapter);
fp@2685: #endif
fp@2685: static inline s32 igb_reset_phy(struct e1000_hw *hw)
fp@2685: {
fp@2685: if (hw->phy.ops.reset)
fp@2685: return hw->phy.ops.reset(hw);
fp@2685:
fp@2685: return 0;
fp@2685: }
fp@2685:
fp@2685: static inline s32 igb_read_phy_reg(struct e1000_hw *hw, u32 offset, u16 *data)
fp@2685: {
fp@2685: if (hw->phy.ops.read_reg)
fp@2685: return hw->phy.ops.read_reg(hw, offset, data);
fp@2685:
fp@2685: return 0;
fp@2685: }
fp@2685:
fp@2685: static inline s32 igb_write_phy_reg(struct e1000_hw *hw, u32 offset, u16 data)
fp@2685: {
fp@2685: if (hw->phy.ops.write_reg)
fp@2685: return hw->phy.ops.write_reg(hw, offset, data);
fp@2685:
fp@2685: return 0;
fp@2685: }
fp@2685:
fp@2685: static inline s32 igb_get_phy_info(struct e1000_hw *hw)
fp@2685: {
fp@2685: if (hw->phy.ops.get_phy_info)
fp@2685: return hw->phy.ops.get_phy_info(hw);
fp@2685:
fp@2685: return 0;
fp@2685: }
fp@2685:
fp@2685: static inline struct netdev_queue *txring_txq(const struct igb_ring *tx_ring)
fp@2685: {
fp@2685: return netdev_get_tx_queue(tx_ring->netdev, tx_ring->queue_index);
fp@2685: }
fp@2685:
fp@2685: #endif /* _IGB_H_ */