bearer.c (8e8c668927b029f6ccc350eb1aa936864cc4eb6f) bearer.c (35c55c9877f8de0ab129fa1a309271d0ecc868b9)
1/*
2 * net/tipc/bearer.c: TIPC bearer code
3 *
1/*
2 * net/tipc/bearer.c: TIPC bearer code
3 *
4 * Copyright (c) 1996-2006, 2013-2014, Ericsson AB
4 * Copyright (c) 1996-2006, 2013-2016, Ericsson AB
5 * Copyright (c) 2004-2006, 2010-2013, Wind River Systems
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions are met:
10 *
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.

--- 21 unchanged lines hidden (view full) ---

34 * POSSIBILITY OF SUCH DAMAGE.
35 */
36
37#include <net/sock.h>
38#include "core.h"
39#include "bearer.h"
40#include "link.h"
41#include "discover.h"
5 * Copyright (c) 2004-2006, 2010-2013, Wind River Systems
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions are met:
10 *
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.

--- 21 unchanged lines hidden (view full) ---

34 * POSSIBILITY OF SUCH DAMAGE.
35 */
36
37#include <net/sock.h>
38#include "core.h"
39#include "bearer.h"
40#include "link.h"
41#include "discover.h"
42#include "monitor.h"
42#include "bcast.h"
43#include "netlink.h"
44
45#define MAX_ADDR_STR 60
46
47static struct tipc_media * const media_info_array[] = {
48 &eth_media_info,
49#ifdef CONFIG_TIPC_MEDIA_IB

--- 258 unchanged lines hidden (view full) ---

308 pr_warn("Bearer <%s> rejected, discovery object creation failed\n",
309 name);
310 return -EINVAL;
311 }
312
313 rcu_assign_pointer(tn->bearer_list[bearer_id], b);
314 if (skb)
315 tipc_bearer_xmit_skb(net, bearer_id, skb, &b->bcast_addr);
43#include "bcast.h"
44#include "netlink.h"
45
46#define MAX_ADDR_STR 60
47
48static struct tipc_media * const media_info_array[] = {
49 &eth_media_info,
50#ifdef CONFIG_TIPC_MEDIA_IB

--- 258 unchanged lines hidden (view full) ---

309 pr_warn("Bearer <%s> rejected, discovery object creation failed\n",
310 name);
311 return -EINVAL;
312 }
313
314 rcu_assign_pointer(tn->bearer_list[bearer_id], b);
315 if (skb)
316 tipc_bearer_xmit_skb(net, bearer_id, skb, &b->bcast_addr);
317
318 if (tipc_mon_create(net, bearer_id))
319 return -ENOMEM;
320
316 pr_info("Enabled bearer <%s>, discovery domain %s, priority %u\n",
317 name,
318 tipc_addr_string_fill(addr_string, disc_domain), priority);
319 return res;
320}
321
322/**
323 * tipc_reset_bearer - Reset all links established over this bearer

--- 19 unchanged lines hidden (view full) ---

343 pr_info("Disabling bearer <%s>\n", b->name);
344 b->media->disable_media(b);
345 tipc_node_delete_links(net, bearer_id);
346 RCU_INIT_POINTER(b->media_ptr, NULL);
347 if (b->link_req)
348 tipc_disc_delete(b->link_req);
349 RCU_INIT_POINTER(tn->bearer_list[bearer_id], NULL);
350 kfree_rcu(b, rcu);
321 pr_info("Enabled bearer <%s>, discovery domain %s, priority %u\n",
322 name,
323 tipc_addr_string_fill(addr_string, disc_domain), priority);
324 return res;
325}
326
327/**
328 * tipc_reset_bearer - Reset all links established over this bearer

--- 19 unchanged lines hidden (view full) ---

348 pr_info("Disabling bearer <%s>\n", b->name);
349 b->media->disable_media(b);
350 tipc_node_delete_links(net, bearer_id);
351 RCU_INIT_POINTER(b->media_ptr, NULL);
352 if (b->link_req)
353 tipc_disc_delete(b->link_req);
354 RCU_INIT_POINTER(tn->bearer_list[bearer_id], NULL);
355 kfree_rcu(b, rcu);
356 tipc_mon_delete(net, bearer_id);
351}
352
353int tipc_enable_l2_media(struct net *net, struct tipc_bearer *b,
354 struct nlattr *attr[])
355{
356 struct net_device *dev;
357 char *driver_name = strchr((const char *)b->name, ':') + 1;
358

--- 714 unchanged lines hidden ---
357}
358
359int tipc_enable_l2_media(struct net *net, struct tipc_bearer *b,
360 struct nlattr *attr[])
361{
362 struct net_device *dev;
363 char *driver_name = strchr((const char *)b->name, ':') + 1;
364

--- 714 unchanged lines hidden ---