aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/eth_media.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/tipc/eth_media.c')
-rw-r--r--net/tipc/eth_media.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/net/tipc/eth_media.c b/net/tipc/eth_media.c
index 34d0462db3aa..1f8d83b9c8b4 100644
--- a/net/tipc/eth_media.c
+++ b/net/tipc/eth_media.c
@@ -38,13 +38,11 @@
38#include <net/tipc/tipc_bearer.h> 38#include <net/tipc/tipc_bearer.h>
39#include <net/tipc/tipc_msg.h> 39#include <net/tipc/tipc_msg.h>
40#include <linux/netdevice.h> 40#include <linux/netdevice.h>
41#include <linux/version.h>
42 41
43#define MAX_ETH_BEARERS 2 42#define MAX_ETH_BEARERS 2
44#define TIPC_PROTOCOL 0x88ca 43#define ETH_LINK_PRIORITY TIPC_DEF_LINK_PRI
45#define ETH_LINK_PRIORITY 10
46#define ETH_LINK_TOLERANCE TIPC_DEF_LINK_TOL 44#define ETH_LINK_TOLERANCE TIPC_DEF_LINK_TOL
47 45#define ETH_LINK_WINDOW TIPC_DEF_LINK_WIN
48 46
49/** 47/**
50 * struct eth_bearer - Ethernet bearer data structure 48 * struct eth_bearer - Ethernet bearer data structure
@@ -78,7 +76,7 @@ static int send_msg(struct sk_buff *buf, struct tipc_bearer *tb_ptr,
78 clone->nh.raw = clone->data; 76 clone->nh.raw = clone->data;
79 dev = ((struct eth_bearer *)(tb_ptr->usr_handle))->dev; 77 dev = ((struct eth_bearer *)(tb_ptr->usr_handle))->dev;
80 clone->dev = dev; 78 clone->dev = dev;
81 dev->hard_header(clone, dev, TIPC_PROTOCOL, 79 dev->hard_header(clone, dev, ETH_P_TIPC,
82 &dest->dev_addr.eth_addr, 80 &dest->dev_addr.eth_addr,
83 dev->dev_addr, clone->len); 81 dev->dev_addr, clone->len);
84 dev_queue_xmit(clone); 82 dev_queue_xmit(clone);
@@ -141,7 +139,7 @@ static int enable_bearer(struct tipc_bearer *tb_ptr)
141 return -EDQUOT; 139 return -EDQUOT;
142 if (!eb_ptr->dev) { 140 if (!eb_ptr->dev) {
143 eb_ptr->dev = dev; 141 eb_ptr->dev = dev;
144 eb_ptr->tipc_packet_type.type = __constant_htons(TIPC_PROTOCOL); 142 eb_ptr->tipc_packet_type.type = __constant_htons(ETH_P_TIPC);
145 eb_ptr->tipc_packet_type.dev = dev; 143 eb_ptr->tipc_packet_type.dev = dev;
146 eb_ptr->tipc_packet_type.func = recv_msg; 144 eb_ptr->tipc_packet_type.func = recv_msg;
147 eb_ptr->tipc_packet_type.af_packet_priv = eb_ptr; 145 eb_ptr->tipc_packet_type.af_packet_priv = eb_ptr;
@@ -240,13 +238,13 @@ static char *eth_addr2str(struct tipc_media_addr *a, char *str_buf, int str_size
240} 238}
241 239
242/** 240/**
243 * eth_media_start - activate Ethernet bearer support 241 * tipc_eth_media_start - activate Ethernet bearer support
244 * 242 *
245 * Register Ethernet media type with TIPC bearer code. Also register 243 * Register Ethernet media type with TIPC bearer code. Also register
246 * with OS for notifications about device state changes. 244 * with OS for notifications about device state changes.
247 */ 245 */
248 246
249int eth_media_start(void) 247int tipc_eth_media_start(void)
250{ 248{
251 struct tipc_media_addr bcast_addr; 249 struct tipc_media_addr bcast_addr;
252 int res; 250 int res;
@@ -260,7 +258,7 @@ int eth_media_start(void)
260 res = tipc_register_media(TIPC_MEDIA_TYPE_ETH, "eth", 258 res = tipc_register_media(TIPC_MEDIA_TYPE_ETH, "eth",
261 enable_bearer, disable_bearer, send_msg, 259 enable_bearer, disable_bearer, send_msg,
262 eth_addr2str, &bcast_addr, ETH_LINK_PRIORITY, 260 eth_addr2str, &bcast_addr, ETH_LINK_PRIORITY,
263 ETH_LINK_TOLERANCE, TIPC_DEF_LINK_WIN); 261 ETH_LINK_TOLERANCE, ETH_LINK_WINDOW);
264 if (res) 262 if (res)
265 return res; 263 return res;
266 264
@@ -273,10 +271,10 @@ int eth_media_start(void)
273} 271}
274 272
275/** 273/**
276 * eth_media_stop - deactivate Ethernet bearer support 274 * tipc_eth_media_stop - deactivate Ethernet bearer support
277 */ 275 */
278 276
279void eth_media_stop(void) 277void tipc_eth_media_stop(void)
280{ 278{
281 int i; 279 int i;
282 280