summaryrefslogtreecommitdiffstats
path: root/net/ncsi/internal.h
diff options
context:
space:
mode:
authorSamuel Mendoza-Jonas <sam@mendozajonas.com>2018-11-15 23:51:58 -0500
committerDavid S. Miller <davem@davemloft.net>2018-11-18 00:09:49 -0500
commit2878a2cfe57a5db21844801cf502fe535a3134b2 (patch)
treebd3fa6082c4195610fecb1ef657cae4e16c42aa5 /net/ncsi/internal.h
parent0b970e1b040c10d0e2a252943a2feaa6ee3cacdf (diff)
net/ncsi: Reset channel state in ncsi_start_dev()
When the NCSI driver is stopped with ncsi_stop_dev() the channel monitors are stopped and the state set to "inactive". However the channels are still configured and active from the perspective of the network controller. We should suspend each active channel but in the context of ncsi_stop_dev() the transmit queue has been or is about to be stopped so we won't have time to do so. Instead when ncsi_start_dev() is called if the NCSI topology has already been probed then call ncsi_reset_dev() to suspend any channels that were previously active. This resets the network controller to a known state, provides an up to date view of channel link state, and makes sure that mode flags such as NCSI_MODE_TX_ENABLE are properly reset. In addition to ncsi_start_dev() use ncsi_reset_dev() in ncsi-netlink.c to update the channel configuration more cleanly. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ncsi/internal.h')
-rw-r--r--net/ncsi/internal.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/ncsi/internal.h b/net/ncsi/internal.h
index ec65778c41f3..bda51cb179fe 100644
--- a/net/ncsi/internal.h
+++ b/net/ncsi/internal.h
@@ -287,6 +287,7 @@ struct ncsi_dev_priv {
287#define NCSI_DEV_PROBED 1 /* Finalized NCSI topology */ 287#define NCSI_DEV_PROBED 1 /* Finalized NCSI topology */
288#define NCSI_DEV_HWA 2 /* Enabled HW arbitration */ 288#define NCSI_DEV_HWA 2 /* Enabled HW arbitration */
289#define NCSI_DEV_RESHUFFLE 4 289#define NCSI_DEV_RESHUFFLE 4
290#define NCSI_DEV_RESET 8 /* Reset state of NC */
290 unsigned int gma_flag; /* OEM GMA flag */ 291 unsigned int gma_flag; /* OEM GMA flag */
291 spinlock_t lock; /* Protect the NCSI device */ 292 spinlock_t lock; /* Protect the NCSI device */
292#if IS_ENABLED(CONFIG_IPV6) 293#if IS_ENABLED(CONFIG_IPV6)
@@ -342,6 +343,7 @@ extern spinlock_t ncsi_dev_lock;
342 list_for_each_entry_rcu(nc, &np->channels, node) 343 list_for_each_entry_rcu(nc, &np->channels, node)
343 344
344/* Resources */ 345/* Resources */
346int ncsi_reset_dev(struct ncsi_dev *nd);
345void ncsi_start_channel_monitor(struct ncsi_channel *nc); 347void ncsi_start_channel_monitor(struct ncsi_channel *nc);
346void ncsi_stop_channel_monitor(struct ncsi_channel *nc); 348void ncsi_stop_channel_monitor(struct ncsi_channel *nc);
347struct ncsi_channel *ncsi_find_channel(struct ncsi_package *np, 349struct ncsi_channel *ncsi_find_channel(struct ncsi_package *np,