Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  1) /* SPDX-License-Identifier: GPL-2.0-only */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  3)  *  FUJITSU Extended Socket Network Device driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  4)  *  Copyright (c) 2015 FUJITSU LIMITED
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  5)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  6) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  7) #ifndef FJES_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  8) #define FJES_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  9) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #include <linux/acpi.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #include "fjes_hw.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #define FJES_ACPI_SYMBOL	"Extended Socket"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #define FJES_MAX_QUEUES		1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #define FJES_TX_RETRY_INTERVAL	(20 * HZ)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) #define FJES_TX_RETRY_TIMEOUT	(100)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) #define FJES_TX_TX_STALL_TIMEOUT	(FJES_TX_RETRY_INTERVAL / 2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #define FJES_OPEN_ZONE_UPDATE_WAIT	(300) /* msec */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) #define FJES_IRQ_WATCH_DELAY	(HZ)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) /* board specific private data structure */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) struct fjes_adapter {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) 	struct net_device *netdev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) 	struct platform_device *plat_dev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) 	struct napi_struct napi;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) 	struct rtnl_link_stats64 stats64;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) 	unsigned int tx_retry_count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) 	unsigned long tx_start_jiffies;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) 	unsigned long rx_last_jiffies;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) 	bool unset_rx_last;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) 	struct work_struct force_close_task;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) 	bool force_reset;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) 	bool open_guard;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) 	bool irq_registered;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) 	struct workqueue_struct *txrx_wq;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) 	struct workqueue_struct *control_wq;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) 	struct work_struct tx_stall_task;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) 	struct work_struct raise_intr_rxdata_task;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) 	struct work_struct unshare_watch_task;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) 	unsigned long unshare_watch_bitmask;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) 	struct delayed_work interrupt_watch_task;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) 	bool interrupt_watch_enable;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) 	struct fjes_hw hw;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) #ifdef CONFIG_DEBUG_FS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) 	struct dentry *dbg_adapter;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) extern char fjes_driver_name[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) extern char fjes_driver_version[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) extern const u32 fjes_support_mtu[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) void fjes_set_ethtool_ops(struct net_device *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) #ifdef CONFIG_DEBUG_FS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) void fjes_dbg_adapter_init(struct fjes_adapter *adapter);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) void fjes_dbg_adapter_exit(struct fjes_adapter *adapter);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) void fjes_dbg_init(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) void fjes_dbg_exit(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) static inline void fjes_dbg_adapter_init(struct fjes_adapter *adapter) {}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) static inline void fjes_dbg_adapter_exit(struct fjes_adapter *adapter) {}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) static inline void fjes_dbg_init(void) {}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) static inline void fjes_dbg_exit(void) {}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) #endif /* CONFIG_DEBUG_FS */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) #endif /* FJES_H_ */