Linux Audio

Check our new training course

Loading...
 1/* SPDX-License-Identifier: GPL-2.0-only */
 2/*
 3 *  FUJITSU Extended Socket Network Device driver
 4 *  Copyright (c) 2015 FUJITSU LIMITED
 5 */
 6
 7#ifndef FJES_H_
 8#define FJES_H_
 9
10#include <linux/acpi.h>
11
12#include "fjes_hw.h"
13
14#define FJES_ACPI_SYMBOL	"Extended Socket"
15#define FJES_MAX_QUEUES		1
16#define FJES_TX_RETRY_INTERVAL	(20 * HZ)
17#define FJES_TX_RETRY_TIMEOUT	(100)
18#define FJES_TX_TX_STALL_TIMEOUT	(FJES_TX_RETRY_INTERVAL / 2)
19#define FJES_OPEN_ZONE_UPDATE_WAIT	(300) /* msec */
20#define FJES_IRQ_WATCH_DELAY	(HZ)
21
22/* board specific private data structure */
23struct fjes_adapter {
24	struct net_device *netdev;
25	struct platform_device *plat_dev;
26
27	struct napi_struct napi;
28	struct rtnl_link_stats64 stats64;
29
30	unsigned int tx_retry_count;
31	unsigned long tx_start_jiffies;
32	unsigned long rx_last_jiffies;
33	bool unset_rx_last;
34
35	struct work_struct force_close_task;
36	bool force_reset;
37	bool open_guard;
38
39	bool irq_registered;
40
41	struct workqueue_struct *txrx_wq;
42	struct workqueue_struct *control_wq;
43
44	struct work_struct tx_stall_task;
45	struct work_struct raise_intr_rxdata_task;
46
47	struct work_struct unshare_watch_task;
48	unsigned long unshare_watch_bitmask;
49
50	struct delayed_work interrupt_watch_task;
51	bool interrupt_watch_enable;
52
53	struct fjes_hw hw;
54
55#ifdef CONFIG_DEBUG_FS
56	struct dentry *dbg_adapter;
57#endif
58};
59
60extern char fjes_driver_name[];
61extern char fjes_driver_version[];
62extern const u32 fjes_support_mtu[];
63
64void fjes_set_ethtool_ops(struct net_device *);
65
66#ifdef CONFIG_DEBUG_FS
67void fjes_dbg_adapter_init(struct fjes_adapter *adapter);
68void fjes_dbg_adapter_exit(struct fjes_adapter *adapter);
69void fjes_dbg_init(void);
70void fjes_dbg_exit(void);
71#else
72static inline void fjes_dbg_adapter_init(struct fjes_adapter *adapter) {}
73static inline void fjes_dbg_adapter_exit(struct fjes_adapter *adapter) {}
74static inline void fjes_dbg_init(void) {}
75static inline void fjes_dbg_exit(void) {}
76#endif /* CONFIG_DEBUG_FS */
77
78#endif /* FJES_H_ */
 1/*
 2 *  FUJITSU Extended Socket Network Device driver
 3 *  Copyright (c) 2015 FUJITSU LIMITED
 4 *
 5 * This program is free software; you can redistribute it and/or modify it
 6 * under the terms and conditions of the GNU General Public License,
 7 * version 2, as published by the Free Software Foundation.
 8 *
 9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, see <http://www.gnu.org/licenses/>.
16 *
17 * The full GNU General Public License is included in this distribution in
18 * the file called "COPYING".
19 *
20 */
21
22#ifndef FJES_H_
23#define FJES_H_
24
25#include <linux/acpi.h>
26
27#include "fjes_hw.h"
28
29#define FJES_ACPI_SYMBOL	"Extended Socket"
30#define FJES_MAX_QUEUES		1
31#define FJES_TX_RETRY_INTERVAL	(20 * HZ)
32#define FJES_TX_RETRY_TIMEOUT	(100)
33#define FJES_TX_TX_STALL_TIMEOUT	(FJES_TX_RETRY_INTERVAL / 2)
34#define FJES_OPEN_ZONE_UPDATE_WAIT	(300) /* msec */
35#define FJES_IRQ_WATCH_DELAY	(HZ)
36
37/* board specific private data structure */
38struct fjes_adapter {
39	struct net_device *netdev;
40	struct platform_device *plat_dev;
41
42	struct napi_struct napi;
43	struct rtnl_link_stats64 stats64;
44
45	unsigned int tx_retry_count;
46	unsigned long tx_start_jiffies;
47	unsigned long rx_last_jiffies;
48	bool unset_rx_last;
49
50	struct work_struct force_close_task;
51	bool force_reset;
52	bool open_guard;
53
54	bool irq_registered;
55
56	struct workqueue_struct *txrx_wq;
57	struct workqueue_struct *control_wq;
58
59	struct work_struct tx_stall_task;
60	struct work_struct raise_intr_rxdata_task;
61
62	struct work_struct unshare_watch_task;
63	unsigned long unshare_watch_bitmask;
64
65	struct delayed_work interrupt_watch_task;
66	bool interrupt_watch_enable;
67
68	struct fjes_hw hw;
69
70#ifdef CONFIG_DEBUG_FS
71	struct dentry *dbg_adapter;
72#endif
73};
74
75extern char fjes_driver_name[];
76extern char fjes_driver_version[];
77extern const u32 fjes_support_mtu[];
78
79void fjes_set_ethtool_ops(struct net_device *);
80
81#ifdef CONFIG_DEBUG_FS
82void fjes_dbg_adapter_init(struct fjes_adapter *adapter);
83void fjes_dbg_adapter_exit(struct fjes_adapter *adapter);
84void fjes_dbg_init(void);
85void fjes_dbg_exit(void);
86#else
87static inline void fjes_dbg_adapter_init(struct fjes_adapter *adapter) {}
88static inline void fjes_dbg_adapter_exit(struct fjes_adapter *adapter) {}
89static inline void fjes_dbg_init(void) {}
90static inline void fjes_dbg_exit(void) {}
91#endif /* CONFIG_DEBUG_FS */
92
93#endif /* FJES_H_ */