aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/bearer.c
diff options
context:
space:
mode:
authorAllan Stephens <allan.stephens@windriver.com>2011-10-18 11:34:29 -0400
committerPaul Gortmaker <paul.gortmaker@windriver.com>2011-12-27 11:33:39 -0500
commit5c216e1d28c82332db0fa53e30536577fb6130c6 (patch)
tree66bc9a4653495c1fddf87cc5fd3d88ab1d14a3a7 /net/tipc/bearer.c
parentd6d4577ae48bcfde06894540ea793abf076e1643 (diff)
tipc: Allow run-time alteration of default link settings
Permits run-time alteration of default link settings on a per-media and per-bearer basis, in addition to the existing per-link basis. The following syntax can now be used: tipc-config -lt=<link-name|bearer-name|media-name>/<tolerance> tipc-config -lp=<link-name|bearer-name|media-name>/<priority> tipc-config -lw=<link-name|bearer-name|media-name>/<window> Note that changes to the default settings for a given media type has no effect on the default settings used by existing bearers. Similarly, changes to default bearer settings has no effect on existing link endpoints that utilize that interface. Thanks to Florian Westphal <fw@strlen.de> for his contributions to the development of this enhancement. Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Diffstat (limited to 'net/tipc/bearer.c')
-rw-r--r--net/tipc/bearer.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c
index aa37261626d6..b40e98adfd7f 100644
--- a/net/tipc/bearer.c
+++ b/net/tipc/bearer.c
@@ -65,10 +65,10 @@ static int media_name_valid(const char *name)
65} 65}
66 66
67/** 67/**
68 * media_find - locates specified media object by name 68 * tipc_media_find - locates specified media object by name
69 */ 69 */
70 70
71static struct media *media_find(const char *name) 71struct media *tipc_media_find(const char *name)
72{ 72{
73 u32 i; 73 u32 i;
74 74
@@ -118,7 +118,7 @@ int tipc_register_media(struct media *m_ptr)
118 goto exit; 118 goto exit;
119 if (media_count >= MAX_MEDIA) 119 if (media_count >= MAX_MEDIA)
120 goto exit; 120 goto exit;
121 if (media_find(m_ptr->name) || media_find_id(m_ptr->type_id)) 121 if (tipc_media_find(m_ptr->name) || media_find_id(m_ptr->type_id))
122 goto exit; 122 goto exit;
123 123
124 media_list[media_count] = m_ptr; 124 media_list[media_count] = m_ptr;
@@ -229,10 +229,10 @@ static int bearer_name_validate(const char *name,
229} 229}
230 230
231/** 231/**
232 * bearer_find - locates bearer object with matching bearer name 232 * tipc_bearer_find - locates bearer object with matching bearer name
233 */ 233 */
234 234
235static struct tipc_bearer *bearer_find(const char *name) 235struct tipc_bearer *tipc_bearer_find(const char *name)
236{ 236{
237 struct tipc_bearer *b_ptr; 237 struct tipc_bearer *b_ptr;
238 u32 i; 238 u32 i;
@@ -463,7 +463,7 @@ int tipc_enable_bearer(const char *name, u32 disc_domain, u32 priority)
463 463
464 write_lock_bh(&tipc_net_lock); 464 write_lock_bh(&tipc_net_lock);
465 465
466 m_ptr = media_find(b_name.media_name); 466 m_ptr = tipc_media_find(b_name.media_name);
467 if (!m_ptr) { 467 if (!m_ptr) {
468 warn("Bearer <%s> rejected, media <%s> not registered\n", name, 468 warn("Bearer <%s> rejected, media <%s> not registered\n", name,
469 b_name.media_name); 469 b_name.media_name);
@@ -513,6 +513,8 @@ restart:
513 513
514 b_ptr->identity = bearer_id; 514 b_ptr->identity = bearer_id;
515 b_ptr->media = m_ptr; 515 b_ptr->media = m_ptr;
516 b_ptr->tolerance = m_ptr->tolerance;
517 b_ptr->window = m_ptr->window;
516 b_ptr->net_plane = bearer_id + 'A'; 518 b_ptr->net_plane = bearer_id + 'A';
517 b_ptr->active = 1; 519 b_ptr->active = 1;
518 b_ptr->priority = priority; 520 b_ptr->priority = priority;
@@ -546,7 +548,7 @@ int tipc_block_bearer(const char *name)
546 struct link *temp_l_ptr; 548 struct link *temp_l_ptr;
547 549
548 read_lock_bh(&tipc_net_lock); 550 read_lock_bh(&tipc_net_lock);
549 b_ptr = bearer_find(name); 551 b_ptr = tipc_bearer_find(name);
550 if (!b_ptr) { 552 if (!b_ptr) {
551 warn("Attempt to block unknown bearer <%s>\n", name); 553 warn("Attempt to block unknown bearer <%s>\n", name);
552 read_unlock_bh(&tipc_net_lock); 554 read_unlock_bh(&tipc_net_lock);
@@ -600,7 +602,7 @@ int tipc_disable_bearer(const char *name)
600 int res; 602 int res;
601 603
602 write_lock_bh(&tipc_net_lock); 604 write_lock_bh(&tipc_net_lock);
603 b_ptr = bearer_find(name); 605 b_ptr = tipc_bearer_find(name);
604 if (b_ptr == NULL) { 606 if (b_ptr == NULL) {
605 warn("Attempt to disable unknown bearer <%s>\n", name); 607 warn("Attempt to disable unknown bearer <%s>\n", name);
606 res = -EINVAL; 608 res = -EINVAL;