summaryrefslogtreecommitdiff
path: root/drivers/staging/most/aim-network/networking.c
diff options
context:
space:
mode:
authorChristian Gromm <christian.gromm@microchip.com>2015-09-28 15:18:35 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-09-29 01:18:49 (GMT)
commitf13f6981bca3c79ba97c4092ab5ed6aed8b2ce99 (patch)
tree7d8ab0de3da61089e314cd22fff2242c431d9ded /drivers/staging/most/aim-network/networking.c
parent9161e9311c29e905c8b1cf9f10f5010239d49975 (diff)
downloadlinux-f13f6981bca3c79ba97c4092ab5ed6aed8b2ce99.tar.xz
staging: most: fix channel operation in multi-aim context
This patch fixes the opening and closing process of a physical channel when used by different AIMs. Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de> Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/most/aim-network/networking.c')
-rw-r--r--drivers/staging/most/aim-network/networking.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/staging/most/aim-network/networking.c b/drivers/staging/most/aim-network/networking.c
index 761c4cb..c13bd89 100644
--- a/drivers/staging/most/aim-network/networking.c
+++ b/drivers/staging/most/aim-network/networking.c
@@ -79,6 +79,7 @@ struct net_dev_context {
static struct list_head net_devices = LIST_HEAD_INIT(net_devices);
static struct spinlock list_lock;
+static struct most_aim aim;
static int skb_to_mamac(const struct sk_buff *skb, struct mbo *mbo)
@@ -194,14 +195,14 @@ static int most_nd_open(struct net_device *dev)
BUG_ON(!nd->tx.linked || !nd->rx.linked);
- if (most_start_channel(nd->iface, nd->rx.ch_id)) {
+ if (most_start_channel(nd->iface, nd->rx.ch_id, &aim)) {
netdev_err(dev, "most_start_channel() failed\n");
return -EBUSY;
}
- if (most_start_channel(nd->iface, nd->tx.ch_id)) {
+ if (most_start_channel(nd->iface, nd->tx.ch_id, &aim)) {
netdev_err(dev, "most_start_channel() failed\n");
- most_stop_channel(nd->iface, nd->rx.ch_id);
+ most_stop_channel(nd->iface, nd->rx.ch_id, &aim);
return -EBUSY;
}
@@ -227,8 +228,8 @@ static int most_nd_stop(struct net_device *dev)
netif_stop_queue(dev);
if (nd->channels_opened) {
- most_stop_channel(nd->iface, nd->rx.ch_id);
- most_stop_channel(nd->iface, nd->tx.ch_id);
+ most_stop_channel(nd->iface, nd->rx.ch_id, &aim);
+ most_stop_channel(nd->iface, nd->tx.ch_id, &aim);
nd->channels_opened = false;
}