Taku Izumi | 658d439 | 2015-08-21 17:29:17 +0900 | [diff] [blame] | 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 | |
Taku Izumi | 2fcbca6 | 2015-08-21 17:29:20 +0900 | [diff] [blame] | 27 | #include "fjes_hw.h" |
| 28 | |
Taku Izumi | 658d439 | 2015-08-21 17:29:17 +0900 | [diff] [blame] | 29 | #define FJES_ACPI_SYMBOL "Extended Socket" |
Taku Izumi | 2fcbca6 | 2015-08-21 17:29:20 +0900 | [diff] [blame] | 30 | #define FJES_MAX_QUEUES 1 |
| 31 | #define FJES_TX_RETRY_INTERVAL (20 * HZ) |
Taku Izumi | 9acf51c | 2015-08-21 17:29:24 +0900 | [diff] [blame] | 32 | #define FJES_TX_RETRY_TIMEOUT (100) |
Taku Izumi | ac63b94 | 2015-08-21 17:29:26 +0900 | [diff] [blame] | 33 | #define FJES_TX_TX_STALL_TIMEOUT (FJES_TX_RETRY_INTERVAL / 2) |
Taku Izumi | e5d486d | 2015-08-21 17:29:23 +0900 | [diff] [blame] | 34 | #define FJES_OPEN_ZONE_UPDATE_WAIT (300) /* msec */ |
Taku Izumi | 8edb62a | 2015-08-21 17:29:32 +0900 | [diff] [blame] | 35 | #define FJES_IRQ_WATCH_DELAY (HZ) |
Taku Izumi | 2fcbca6 | 2015-08-21 17:29:20 +0900 | [diff] [blame] | 36 | |
| 37 | /* board specific private data structure */ |
| 38 | struct 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 | |
Taku Izumi | ff5b421 | 2015-08-21 17:29:33 +0900 | [diff] [blame] | 50 | struct work_struct force_close_task; |
Taku Izumi | 2fcbca6 | 2015-08-21 17:29:20 +0900 | [diff] [blame] | 51 | bool force_reset; |
| 52 | bool open_guard; |
| 53 | |
| 54 | bool irq_registered; |
| 55 | |
Taku Izumi | b772b9d | 2015-08-21 17:29:25 +0900 | [diff] [blame] | 56 | struct workqueue_struct *txrx_wq; |
Taku Izumi | 8edb62a | 2015-08-21 17:29:32 +0900 | [diff] [blame] | 57 | struct workqueue_struct *control_wq; |
Taku Izumi | b772b9d | 2015-08-21 17:29:25 +0900 | [diff] [blame] | 58 | |
Taku Izumi | ac63b94 | 2015-08-21 17:29:26 +0900 | [diff] [blame] | 59 | struct work_struct tx_stall_task; |
Taku Izumi | b772b9d | 2015-08-21 17:29:25 +0900 | [diff] [blame] | 60 | struct work_struct raise_intr_rxdata_task; |
| 61 | |
Taku Izumi | 8fc4cad | 2015-08-21 17:29:34 +0900 | [diff] [blame] | 62 | struct work_struct unshare_watch_task; |
| 63 | unsigned long unshare_watch_bitmask; |
| 64 | |
Taku Izumi | 8edb62a | 2015-08-21 17:29:32 +0900 | [diff] [blame] | 65 | struct delayed_work interrupt_watch_task; |
| 66 | bool interrupt_watch_enable; |
| 67 | |
Taku Izumi | 2fcbca6 | 2015-08-21 17:29:20 +0900 | [diff] [blame] | 68 | struct fjes_hw hw; |
| 69 | }; |
Taku Izumi | 658d439 | 2015-08-21 17:29:17 +0900 | [diff] [blame] | 70 | |
| 71 | extern char fjes_driver_name[]; |
| 72 | extern char fjes_driver_version[]; |
Taku Izumi | 8cdc3f6 | 2015-08-21 17:29:18 +0900 | [diff] [blame] | 73 | extern const u32 fjes_support_mtu[]; |
Taku Izumi | 658d439 | 2015-08-21 17:29:17 +0900 | [diff] [blame] | 74 | |
Taku Izumi | 786eec2 | 2015-08-21 17:29:38 +0900 | [diff] [blame] | 75 | void fjes_set_ethtool_ops(struct net_device *); |
| 76 | |
Taku Izumi | 658d439 | 2015-08-21 17:29:17 +0900 | [diff] [blame] | 77 | #endif /* FJES_H_ */ |