blob: 1743dbb83e5bfc6b2968ee3bb2e465f8c165b5a1 [file] [log] [blame]
Taku Izumi658d4392015-08-21 17:29:17 +09001/*
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 Izumi2fcbca62015-08-21 17:29:20 +090027#include "fjes_hw.h"
28
Taku Izumi658d4392015-08-21 17:29:17 +090029#define FJES_ACPI_SYMBOL "Extended Socket"
Taku Izumi2fcbca62015-08-21 17:29:20 +090030#define FJES_MAX_QUEUES 1
31#define FJES_TX_RETRY_INTERVAL (20 * HZ)
Taku Izumi9acf51c2015-08-21 17:29:24 +090032#define FJES_TX_RETRY_TIMEOUT (100)
Taku Izumiac63b942015-08-21 17:29:26 +090033#define FJES_TX_TX_STALL_TIMEOUT (FJES_TX_RETRY_INTERVAL / 2)
Taku Izumie5d486d2015-08-21 17:29:23 +090034#define FJES_OPEN_ZONE_UPDATE_WAIT (300) /* msec */
Taku Izumi8edb62a2015-08-21 17:29:32 +090035#define FJES_IRQ_WATCH_DELAY (HZ)
Taku Izumi2fcbca62015-08-21 17:29:20 +090036
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 bool force_reset;
51 bool open_guard;
52
53 bool irq_registered;
54
Taku Izumib772b9d2015-08-21 17:29:25 +090055 struct workqueue_struct *txrx_wq;
Taku Izumi8edb62a2015-08-21 17:29:32 +090056 struct workqueue_struct *control_wq;
Taku Izumib772b9d2015-08-21 17:29:25 +090057
Taku Izumiac63b942015-08-21 17:29:26 +090058 struct work_struct tx_stall_task;
Taku Izumib772b9d2015-08-21 17:29:25 +090059 struct work_struct raise_intr_rxdata_task;
60
Taku Izumi8edb62a2015-08-21 17:29:32 +090061 struct delayed_work interrupt_watch_task;
62 bool interrupt_watch_enable;
63
Taku Izumi2fcbca62015-08-21 17:29:20 +090064 struct fjes_hw hw;
65};
Taku Izumi658d4392015-08-21 17:29:17 +090066
67extern char fjes_driver_name[];
68extern char fjes_driver_version[];
Taku Izumi8cdc3f62015-08-21 17:29:18 +090069extern const u32 fjes_support_mtu[];
Taku Izumi658d4392015-08-21 17:29:17 +090070
71#endif /* FJES_H_ */