sfc: Copy RX prefix into skb head area in efx_rx_mk_skb()
[firefly-linux-kernel-4.4.55.git] / drivers / net / ethernet / sfc / net_driver.h
index b14a717ac3e8d95099b5d2648be590e138bc9e61..1a3e4972c68f6eabe032215642e69ec4b4e45357 100644 (file)
@@ -91,6 +91,7 @@
 
 /* Forward declare Precision Time Protocol (PTP) support structure. */
 struct efx_ptp_data;
+struct hwtstamp_config;
 
 struct efx_self_tests;
 
@@ -520,15 +521,6 @@ enum nic_state {
        STATE_RECOVERY = 3,     /* device recovering from PCI error */
 };
 
-/*
- * Alignment of the skb->head which wraps a page-allocated RX buffer
- *
- * The skb allocated to wrap an rx_buffer can have this alignment. Since
- * the data is memcpy'd from the rx_buf, it does not need to be equal to
- * NET_IP_ALIGN.
- */
-#define EFX_PAGE_SKB_ALIGN 2
-
 /* Forward declaration */
 struct efx_nic;
 
@@ -683,6 +675,8 @@ struct vfdi_status;
  * @n_channels: Number of channels in use
  * @n_rx_channels: Number of channels used for RX (= number of RX queues)
  * @n_tx_channels: Number of channels used for TX
+ * @rx_ip_align: RX DMA address offset to have IP header aligned in
+ *     in accordance with NET_IP_ALIGN
  * @rx_dma_len: Current maximum RX DMA length
  * @rx_buffer_order: Order (log2) of number of pages for each RX buffer
  * @rx_buffer_truesize: Amortised allocation size of an RX buffer,
@@ -816,6 +810,7 @@ struct efx_nic {
        unsigned rss_spread;
        unsigned tx_channel_offset;
        unsigned n_tx_channels;
+       unsigned int rx_ip_align;
        unsigned int rx_dma_len;
        unsigned int rx_buffer_order;
        unsigned int rx_buffer_truesize;
@@ -849,10 +844,14 @@ struct efx_nic {
        struct work_struct mac_work;
        bool port_enabled;
 
+       bool mc_bist_for_other_fn;
        bool port_initialized;
        struct net_device *net_dev;
 
        struct efx_buffer stats_buffer;
+       u64 rx_nodesc_drops_total;
+       u64 rx_nodesc_drops_while_down;
+       bool rx_nodesc_drops_prev_state;
 
        unsigned int phy_type;
        const struct efx_phy_operations *phy_op;
@@ -956,6 +955,7 @@ struct efx_mtd_partition {
  * @update_stats: Update statistics not provided by event handling.
  *     Either argument may be %NULL.
  * @start_stats: Start the regular fetching of statistics
+ * @pull_stats: Pull stats from the NIC and wait until they arrive.
  * @stop_stats: Stop the regular fetching of statistics
  * @set_id_led: Set state of identifying LED or revert to automatic function
  * @push_irq_moderation: Apply interrupt moderation value
@@ -1034,6 +1034,10 @@ struct efx_mtd_partition {
  * @mtd_sync: Wait for write-back to complete on MTD partition.  This
  *     also notifies the driver that a writer has finished using this
  *     partition.
+ * @ptp_write_host_time: Send host time to MC as part of sync protocol
+ * @ptp_set_ts_config: Set hardware timestamp configuration.  The flags
+ *     and tx_type will already have been validated but this operation
+ *     must validate and update rx_filter.
  * @revision: Hardware architecture revision
  * @txd_ptr_tbl_base: TX descriptor ring base address
  * @rxd_ptr_tbl_base: RX descriptor ring base address
@@ -1052,6 +1056,7 @@ struct efx_mtd_partition {
  * @offload_features: net_device feature flags for protocol offload
  *     features implemented in hardware
  * @mcdi_max_ver: Maximum MCDI version supported
+ * @hwtstamp_filters: Mask of hardware timestamp filter types supported
  */
 struct efx_nic_type {
        unsigned int (*mem_map_size)(struct efx_nic *efx);
@@ -1074,6 +1079,7 @@ struct efx_nic_type {
        size_t (*update_stats)(struct efx_nic *efx, u64 *full_stats,
                               struct rtnl_link_stats64 *core_stats);
        void (*start_stats)(struct efx_nic *efx);
+       void (*pull_stats)(struct efx_nic *efx);
        void (*stop_stats)(struct efx_nic *efx);
        void (*set_id_led)(struct efx_nic *efx, enum efx_led_mode mode);
        void (*push_irq_moderation)(struct efx_channel *channel);
@@ -1152,6 +1158,8 @@ struct efx_nic_type {
        int (*mtd_sync)(struct mtd_info *mtd);
 #endif
        void (*ptp_write_host_time)(struct efx_nic *efx, u32 host_time);
+       int (*ptp_set_ts_config)(struct efx_nic *efx,
+                                struct hwtstamp_config *init);
 
        int revision;
        unsigned int txd_ptr_tbl_base;
@@ -1170,6 +1178,7 @@ struct efx_nic_type {
        netdev_features_t offload_features;
        int mcdi_max_ver;
        unsigned int max_rx_ip_filters;
+       u32 hwtstamp_filters;
 };
 
 /**************************************************************************