diff options
Diffstat (limited to 'drivers/net/igb/igb.h')
-rw-r--r-- | drivers/net/igb/igb.h | 74 |
1 files changed, 23 insertions, 51 deletions
diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h index ca7c53f11844..3a35dd3553ba 100644 --- a/drivers/net/igb/igb.h +++ b/drivers/net/igb/igb.h @@ -1,7 +1,7 @@ /******************************************************************************* Intel(R) Gigabit Ethernet Linux driver - Copyright(c) 2007-2013 Intel Corporation. + Copyright(c) 2007-2014 Intel Corporation. This program is free software; you can redistribute it and/or modify it under the terms and conditions of the GNU General Public License, @@ -12,14 +12,11 @@ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License along with - this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - The full GNU General Public License is included in this distribution in the file called "COPYING". Contact Information: + Linux NICS <linux.nics@intel.com> e1000-devel Mailing List <e1000-devel@lists.sourceforge.net> Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 @@ -64,16 +61,20 @@ struct igb_adapter; #include "e1000_manage.h" #include "e1000_mbx.h" -#define IGB_ERR(args...) printk(KERN_ERR "igb: " args) +#define IGB_ERR(args...) pr_err(KERN_ERR "igb: " args) #define PFX "igb: " #define DPRINTK(nlevel, klevel, fmt, args...) \ (void)((NETIF_MSG_##nlevel & adapter->msg_enable) && \ printk(KERN_##klevel PFX "%s: %s: " fmt, adapter->netdev->name, \ - __FUNCTION__ , ## args)) + __func__ , ## args)) #ifdef HAVE_PTP_1588_CLOCK +#ifdef HAVE_INCLUDE_LINUX_TIMECOUNTER_H +#include <linux/timecounter.h> +#else #include <linux/clocksource.h> +#endif /* HAVE_INCLUDE_TIMECOUNTER_H */ #include <linux/net_tstamp.h> #include <linux/ptp_clock_kernel.h> #endif /* HAVE_PTP_1588_CLOCK */ @@ -125,7 +126,6 @@ struct igb_adapter; #define OUI_LEN 3 #define IGB_MAX_VMDQ_QUEUES 8 - struct vf_data_storage { unsigned char vf_mac_addresses[ETH_ALEN]; u16 vf_mc_hashes[IGB_MAX_VF_MC_ENTRIES]; @@ -228,7 +228,7 @@ struct igb_lro_stats { */ struct igb_lrohdr { struct iphdr iph; - struct tcphdr th; + struct tcphdr th; __be32 ts[0]; }; @@ -300,6 +300,7 @@ struct igb_tx_buffer { unsigned int bytecount; u16 gso_segs; __be16 protocol; + DEFINE_DMA_UNMAP_ADDR(dma); DEFINE_DMA_UNMAP_LEN(len); u32 tx_flags; @@ -358,9 +359,6 @@ struct igb_ring { struct igb_tx_buffer *tx_buffer_info; struct igb_rx_buffer *rx_buffer_info; }; -#ifdef HAVE_PTP_1588_CLOCK - unsigned long last_rx_timestamp; -#endif /* HAVE_PTP_1588_CLOCK */ void *desc; /* descriptor ring memory */ unsigned long flags; /* ring specific flags */ void __iomem *tail; /* pointer to ring tail register */ @@ -484,17 +482,11 @@ static inline struct netdev_queue *txring_txq(const struct igb_ring *tx_ring) } #endif /* CONFIG_BQL */ -// #ifdef EXT_THERMAL_SENSOR_SUPPORT -// #ifdef IGB_PROCFS -struct igb_therm_proc_data -{ +struct igb_therm_proc_data { struct e1000_hw *hw; struct e1000_thermal_diode_data *sensor_data; }; -// #endif /* IGB_PROCFS */ -// #endif /* EXT_THERMAL_SENSOR_SUPPORT */ - #ifdef IGB_HWMON #define IGB_HWMON_TYPE_LOC 0 #define IGB_HWMON_TYPE_TEMP 1 @@ -647,8 +639,10 @@ struct igb_adapter { struct delayed_work ptp_overflow_work; struct work_struct ptp_tx_work; struct sk_buff *ptp_tx_skb; + struct hwtstamp_config tstamp_config; unsigned long ptp_tx_start; unsigned long last_rx_ptp_check; + unsigned long last_rx_timestamp; spinlock_t tmreg_lock; struct cyclecounter cc; struct timecounter tc; @@ -663,7 +657,6 @@ struct igb_adapter { #endif /* HAVE_I2C_SUPPORT */ unsigned long link_check_timeout; - int devrc; int copper_tries; @@ -753,15 +746,14 @@ struct igb_vmdq_adapter { struct e1000_fw_hdr { u8 cmd; u8 buf_len; - union - { + union { u8 cmd_resv; u8 ret_status; } cmd_or_resp; u8 checksum; }; -#pragma pack(push,1) +#pragma pack(push, 1) struct e1000_fw_drv_info { struct e1000_fw_hdr hdr; u8 port_num; @@ -774,7 +766,8 @@ struct e1000_fw_drv_info { enum e1000_state_t { __IGB_TESTING, __IGB_RESETTING, - __IGB_DOWN + __IGB_DOWN, + __IGB_PTP_TX_IN_PROGRESS, }; extern char igb_driver_name[]; @@ -798,7 +791,7 @@ extern void igb_setup_tctl(struct igb_adapter *); extern void igb_setup_rctl(struct igb_adapter *); extern netdev_tx_t igb_xmit_frame_ring(struct sk_buff *, struct igb_ring *); extern void igb_unmap_and_free_tx_resource(struct igb_ring *, - struct igb_tx_buffer *); + struct igb_tx_buffer *); extern void igb_alloc_rx_buffers(struct igb_ring *, u16); extern void igb_clean_rx_ring(struct igb_ring *); extern int igb_setup_queues(struct igb_adapter *adapter); @@ -819,27 +812,6 @@ extern void igb_ptp_rx_rgtstamp(struct igb_q_vector *q_vector, extern void igb_ptp_rx_pktstamp(struct igb_q_vector *q_vector, unsigned char *va, struct sk_buff *skb); -static inline void igb_ptp_rx_hwtstamp(struct igb_ring *rx_ring, - union e1000_adv_rx_desc *rx_desc, - struct sk_buff *skb) -{ - if (igb_test_staterr(rx_desc, E1000_RXDADV_STAT_TSIP)) { -#ifdef CONFIG_IGB_DISABLE_PACKET_SPLIT - igb_ptp_rx_pktstamp(rx_ring->q_vector, skb->data, skb); - skb_pull(skb, IGB_TS_HDR_LEN); -#endif - return; - } - - if (igb_test_staterr(rx_desc, E1000_RXDADV_STAT_TS)) - igb_ptp_rx_rgtstamp(rx_ring->q_vector, skb); - - /* Update the last_rx_timestamp timer in order to enable watchdog check - * for error case of latched timestamp on a dropped packet. - */ - rx_ring->last_rx_timestamp = jiffies; -} - extern int igb_ptp_hwtstamp_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd); #endif /* HAVE_PTP_1588_CLOCK */ @@ -848,7 +820,7 @@ extern int ethtool_ioctl(struct ifreq *); #endif extern int igb_write_mc_addr_list(struct net_device *netdev); extern int igb_add_mac_filter(struct igb_adapter *adapter, u8 *addr, u16 queue); -extern int igb_del_mac_filter(struct igb_adapter *adapter, u8* addr, u16 queue); +extern int igb_del_mac_filter(struct igb_adapter *adapter, u8 *addr, u16 queue); extern int igb_available_rars(struct igb_adapter *adapter); extern s32 igb_vlvf_set(struct igb_adapter *, u32, bool, u32); extern void igb_configure_vt_default_pool(struct igb_adapter *adapter); @@ -859,18 +831,18 @@ extern void igb_vlan_mode(struct net_device *, u32); #define E1000_PCS_CFG_IGN_SD 1 +int igb_ptp_set_ts_config(struct net_device *netdev, struct ifreq *ifr); +int igb_ptp_get_ts_config(struct net_device *netdev, struct ifreq *ifr); #ifdef IGB_HWMON void igb_sysfs_exit(struct igb_adapter *adapter); int igb_sysfs_init(struct igb_adapter *adapter); #else #ifdef IGB_PROCFS -int igb_procfs_init(struct igb_adapter* adapter); -void igb_procfs_exit(struct igb_adapter* adapter); +int igb_procfs_init(struct igb_adapter *adapter); +void igb_procfs_exit(struct igb_adapter *adapter); int igb_procfs_topdir_init(void); void igb_procfs_topdir_exit(void); #endif /* IGB_PROCFS */ #endif /* IGB_HWMON */ - - #endif /* _IGB_H_ */ |