2019-05-30 07:57:23 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2015-08-21 16:29:17 +08:00
|
|
|
/*
|
|
|
|
* FUJITSU Extended Socket Network Device driver
|
|
|
|
* Copyright (c) 2015 FUJITSU LIMITED
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef FJES_H_
|
|
|
|
#define FJES_H_
|
|
|
|
|
|
|
|
#include <linux/acpi.h>
|
|
|
|
|
2015-08-21 16:29:20 +08:00
|
|
|
#include "fjes_hw.h"
|
|
|
|
|
2015-08-21 16:29:17 +08:00
|
|
|
#define FJES_ACPI_SYMBOL "Extended Socket"
|
2015-08-21 16:29:20 +08:00
|
|
|
#define FJES_MAX_QUEUES 1
|
|
|
|
#define FJES_TX_RETRY_INTERVAL (20 * HZ)
|
2015-08-21 16:29:24 +08:00
|
|
|
#define FJES_TX_RETRY_TIMEOUT (100)
|
2015-08-21 16:29:26 +08:00
|
|
|
#define FJES_TX_TX_STALL_TIMEOUT (FJES_TX_RETRY_INTERVAL / 2)
|
2015-08-21 16:29:23 +08:00
|
|
|
#define FJES_OPEN_ZONE_UPDATE_WAIT (300) /* msec */
|
2015-08-21 16:29:32 +08:00
|
|
|
#define FJES_IRQ_WATCH_DELAY (HZ)
|
2015-08-21 16:29:20 +08:00
|
|
|
|
|
|
|
/* board specific private data structure */
|
|
|
|
struct fjes_adapter {
|
|
|
|
struct net_device *netdev;
|
|
|
|
struct platform_device *plat_dev;
|
|
|
|
|
|
|
|
struct napi_struct napi;
|
|
|
|
struct rtnl_link_stats64 stats64;
|
|
|
|
|
|
|
|
unsigned int tx_retry_count;
|
|
|
|
unsigned long tx_start_jiffies;
|
|
|
|
unsigned long rx_last_jiffies;
|
|
|
|
bool unset_rx_last;
|
|
|
|
|
2015-08-21 16:29:33 +08:00
|
|
|
struct work_struct force_close_task;
|
2015-08-21 16:29:20 +08:00
|
|
|
bool force_reset;
|
|
|
|
bool open_guard;
|
|
|
|
|
|
|
|
bool irq_registered;
|
|
|
|
|
2015-08-21 16:29:25 +08:00
|
|
|
struct workqueue_struct *txrx_wq;
|
2015-08-21 16:29:32 +08:00
|
|
|
struct workqueue_struct *control_wq;
|
2015-08-21 16:29:25 +08:00
|
|
|
|
2015-08-21 16:29:26 +08:00
|
|
|
struct work_struct tx_stall_task;
|
2015-08-21 16:29:25 +08:00
|
|
|
struct work_struct raise_intr_rxdata_task;
|
|
|
|
|
2015-08-21 16:29:34 +08:00
|
|
|
struct work_struct unshare_watch_task;
|
|
|
|
unsigned long unshare_watch_bitmask;
|
|
|
|
|
2015-08-21 16:29:32 +08:00
|
|
|
struct delayed_work interrupt_watch_task;
|
|
|
|
bool interrupt_watch_enable;
|
|
|
|
|
2015-08-21 16:29:20 +08:00
|
|
|
struct fjes_hw hw;
|
2016-10-14 19:28:07 +08:00
|
|
|
|
|
|
|
#ifdef CONFIG_DEBUG_FS
|
|
|
|
struct dentry *dbg_adapter;
|
|
|
|
#endif
|
2015-08-21 16:29:20 +08:00
|
|
|
};
|
2015-08-21 16:29:17 +08:00
|
|
|
|
|
|
|
extern char fjes_driver_name[];
|
|
|
|
extern char fjes_driver_version[];
|
2015-08-21 16:29:18 +08:00
|
|
|
extern const u32 fjes_support_mtu[];
|
2015-08-21 16:29:17 +08:00
|
|
|
|
2015-08-21 16:29:38 +08:00
|
|
|
void fjes_set_ethtool_ops(struct net_device *);
|
|
|
|
|
2016-10-14 19:28:07 +08:00
|
|
|
#ifdef CONFIG_DEBUG_FS
|
|
|
|
void fjes_dbg_adapter_init(struct fjes_adapter *adapter);
|
|
|
|
void fjes_dbg_adapter_exit(struct fjes_adapter *adapter);
|
|
|
|
void fjes_dbg_init(void);
|
|
|
|
void fjes_dbg_exit(void);
|
|
|
|
#else
|
|
|
|
static inline void fjes_dbg_adapter_init(struct fjes_adapter *adapter) {}
|
|
|
|
static inline void fjes_dbg_adapter_exit(struct fjes_adapter *adapter) {}
|
|
|
|
static inline void fjes_dbg_init(void) {}
|
|
|
|
static inline void fjes_dbg_exit(void) {}
|
|
|
|
#endif /* CONFIG_DEBUG_FS */
|
|
|
|
|
2015-08-21 16:29:17 +08:00
|
|
|
#endif /* FJES_H_ */
|