Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  *  FUJITSU Extended Socket Network Device driver
0004  *  Copyright (c) 2015 FUJITSU LIMITED
0005  */
0006 
0007 #ifndef FJES_H_
0008 #define FJES_H_
0009 
0010 #include <linux/acpi.h>
0011 
0012 #include "fjes_hw.h"
0013 
0014 #define FJES_ACPI_SYMBOL    "Extended Socket"
0015 #define FJES_MAX_QUEUES     1
0016 #define FJES_TX_RETRY_INTERVAL  (20 * HZ)
0017 #define FJES_TX_RETRY_TIMEOUT   (100)
0018 #define FJES_TX_TX_STALL_TIMEOUT    (FJES_TX_RETRY_INTERVAL / 2)
0019 #define FJES_OPEN_ZONE_UPDATE_WAIT  (300) /* msec */
0020 #define FJES_IRQ_WATCH_DELAY    (HZ)
0021 
0022 /* board specific private data structure */
0023 struct fjes_adapter {
0024     struct net_device *netdev;
0025     struct platform_device *plat_dev;
0026 
0027     struct napi_struct napi;
0028     struct rtnl_link_stats64 stats64;
0029 
0030     unsigned int tx_retry_count;
0031     unsigned long tx_start_jiffies;
0032     unsigned long rx_last_jiffies;
0033     bool unset_rx_last;
0034 
0035     struct work_struct force_close_task;
0036     bool force_reset;
0037     bool open_guard;
0038 
0039     bool irq_registered;
0040 
0041     struct workqueue_struct *txrx_wq;
0042     struct workqueue_struct *control_wq;
0043 
0044     struct work_struct tx_stall_task;
0045     struct work_struct raise_intr_rxdata_task;
0046 
0047     struct work_struct unshare_watch_task;
0048     unsigned long unshare_watch_bitmask;
0049 
0050     struct delayed_work interrupt_watch_task;
0051     bool interrupt_watch_enable;
0052 
0053     struct fjes_hw hw;
0054 
0055 #ifdef CONFIG_DEBUG_FS
0056     struct dentry *dbg_adapter;
0057 #endif
0058 };
0059 
0060 extern char fjes_driver_name[];
0061 extern char fjes_driver_version[];
0062 extern const u32 fjes_support_mtu[];
0063 
0064 void fjes_set_ethtool_ops(struct net_device *);
0065 
0066 #ifdef CONFIG_DEBUG_FS
0067 void fjes_dbg_adapter_init(struct fjes_adapter *adapter);
0068 void fjes_dbg_adapter_exit(struct fjes_adapter *adapter);
0069 void fjes_dbg_init(void);
0070 void fjes_dbg_exit(void);
0071 #else
0072 static inline void fjes_dbg_adapter_init(struct fjes_adapter *adapter) {}
0073 static inline void fjes_dbg_adapter_exit(struct fjes_adapter *adapter) {}
0074 static inline void fjes_dbg_init(void) {}
0075 static inline void fjes_dbg_exit(void) {}
0076 #endif /* CONFIG_DEBUG_FS */
0077 
0078 #endif /* FJES_H_ */