[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20101214212959.17022.85347.stgit@mike.mtv.corp.google.com>
Date: Tue, 14 Dec 2010 13:29:59 -0800
From: Mike Waychison <mikew@...gle.com>
To: simon.kagstrom@...insight.net, davem@...emloft.net,
nhorman@...driver.com, Matt Mackall <mpm@...enic.com>
Cc: adurbin@...gle.com, linux-kernel@...r.kernel.org,
chavey@...gle.com, Greg KH <greg@...ah.com>,
netdev@...r.kernel.org,
Américo Wang <xiyou.wangcong@...il.com>,
akpm@...ux-foundation.org, linux-api@...r.kernel.org
Subject: [PATCH v3 12/22] netconsole: Move setting of default ports.
Clients of netpoll_targets need to be able to specify the default port
numbers. Do this by specifying the default port numbers in struct
netpoll_targets directly.
Signed-off-by: Mike Waychison <mikew@...gle.com>
Acked-by: Matt Mackall <mpm@...enic.com>
---
drivers/net/netconsole.c | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
index 5c8701f..fbef723 100644
--- a/drivers/net/netconsole.c
+++ b/drivers/net/netconsole.c
@@ -68,6 +68,7 @@ __setup("netconsole=", option_setup);
struct netpoll_targets {
struct list_head list;
spinlock_t lock;
+ u16 default_local_port, default_remote_port;
#ifdef CONFIG_NETCONSOLE_DYNAMIC
struct configfs_subsystem configfs_subsys;
#endif
@@ -161,8 +162,8 @@ static struct netpoll_target *alloc_param_target(struct netpoll_targets *nts,
nt->nts = nts;
nt->np.name = nts->subsys_name;
strlcpy(nt->np.dev_name, "eth0", IFNAMSIZ);
- nt->np.local_port = 6665;
- nt->np.remote_port = 6666;
+ nt->np.local_port = nts->default_local_port;
+ nt->np.remote_port = nts->default_remote_port;
memset(nt->np.remote_mac, 0xff, ETH_ALEN);
INIT_WORK(&nt->cleanup_work, deferred_netpoll_cleanup);
@@ -635,8 +636,8 @@ static struct config_item *make_netpoll_target(struct config_group *group,
nt->nts = nts;
nt->np.name = nts->subsys_name;
strlcpy(nt->np.dev_name, "eth0", IFNAMSIZ);
- nt->np.local_port = 6665;
- nt->np.remote_port = 6666;
+ nt->np.local_port = nts->default_local_port;
+ nt->np.remote_port = nts->default_remote_port;
memset(nt->np.remote_mac, 0xff, ETH_ALEN);
INIT_WORK(&nt->cleanup_work, deferred_netpoll_cleanup);
@@ -926,6 +927,10 @@ static void __exit unregister_netpoll_targets(struct netpoll_targets *nts)
static int __init init_netconsole(void)
{
int err;
+
+ targets.default_local_port = 6665;
+ targets.default_remote_port = 6666;
+
err = register_netpoll_targets("netconsole", &targets, config);
if (err)
return err;
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists