diff options
author | Taku Izumi <izumi.taku@jp.fujitsu.com> | 2015-08-21 10:29:33 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-08-24 23:06:36 +0200 |
commit | ff5b42103227c01c4082f27b06a43758efbf5ab8 (patch) | |
tree | 43c7ab05565e272e77914187c4537ac012abf2be /drivers/net/fjes/fjes_main.c | |
parent | fjes: interrupt_watch_task (diff) | |
download | linux-ff5b42103227c01c4082f27b06a43758efbf5ab8.tar.xz linux-ff5b42103227c01c4082f27b06a43758efbf5ab8.zip |
fjes: force_close_task
This patch adds force_close_task.
This task is used to close network device forcibly.
Signed-off-by: Taku Izumi <izumi.taku@jp.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/fjes/fjes_main.c')
-rw-r--r-- | drivers/net/fjes/fjes_main.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/net/fjes/fjes_main.c b/drivers/net/fjes/fjes_main.c index 5fce33dec820..caecfb39ecf9 100644 --- a/drivers/net/fjes/fjes_main.c +++ b/drivers/net/fjes/fjes_main.c @@ -54,6 +54,7 @@ static void fjes_free_resources(struct fjes_adapter *); static netdev_tx_t fjes_xmit_frame(struct sk_buff *, struct net_device *); static void fjes_raise_intr_rxdata_task(struct work_struct *); static void fjes_tx_stall_task(struct work_struct *); +static void fjes_force_close_task(struct work_struct *); static irqreturn_t fjes_intr(int, void*); static struct rtnl_link_stats64 * fjes_get_stats64(struct net_device *, struct rtnl_link_stats64 *); @@ -492,6 +493,17 @@ static void fjes_tx_stall_task(struct work_struct *work) queue_work(adapter->txrx_wq, &adapter->tx_stall_task); } +static void fjes_force_close_task(struct work_struct *work) +{ + struct fjes_adapter *adapter = container_of(work, + struct fjes_adapter, force_close_task); + struct net_device *netdev = adapter->netdev; + + rtnl_lock(); + dev_close(netdev); + rtnl_unlock(); +} + static void fjes_raise_intr_rxdata_task(struct work_struct *work) { struct fjes_adapter *adapter = container_of(work, @@ -1003,6 +1015,7 @@ static int fjes_probe(struct platform_device *plat_dev) if (err) goto err_free_netdev; + INIT_WORK(&adapter->force_close_task, fjes_force_close_task); adapter->force_reset = false; adapter->open_guard = false; |