summaryrefslogtreecommitdiff
path: root/net/tipc/core.h
diff options
context:
space:
mode:
authorJon Paul Maloy <jon.maloy@ericsson.com>2014-05-14 13:39:13 +0400
committerDavid S. Miller <davem@davemloft.net>2014-05-14 23:19:48 +0400
commit38504c28a201a80d12a6a0f821fecb331cb1f223 (patch)
tree001139319f80f9d00cfa510638f61a1ec1725459 /net/tipc/core.h
parent37e22164a8a3c39bdad45aa463b1e69a1fdf4110 (diff)
downloadlinux-38504c28a201a80d12a6a0f821fecb331cb1f223.tar.xz
tipc: improve and extend media address conversion functions
TIPC currently handles two media specific addresses: Ethernet MAC addresses and InfiniBand addresses. Those are kept in three different formats: 1) A "raw" format as obtained from the device. This format is known only by the media specific adapter code in eth_media.c and ib_media.c. 2) A "generic" internal format, in the form of struct tipc_media_addr, which can be referenced and passed around by the generic media- unaware code. 3) A serialized version of the latter, to be conveyed in neighbor discovery messages. Conversion between the three formats can only be done by the media specific code, so we have function pointers for this purpose in struct tipc_media. Here, the media adapters can install their own conversion functions at startup. We now introduce a new such function, 'raw2addr()', whose purpose is to convert from format 1 to format 2 above. We also try to as far as possible uniform commenting, variable names and usage of these functions, with the purpose of making them more comprehensible. We can now also remove the function tipc_l2_media_addr_set(), whose job is done better by the new function. Finally, we expand the field for serialized addresses (format 3) in discovery messages from 20 to 32 bytes. This is permitted according to the spec, and reduces the risk of problems when we add new media in the future. Signed-off-by: Jon Maloy <jon.maloy@ericsson.com> Reviewed-by: Ying Xue <ying.xue@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/core.h')
-rw-r--r--net/tipc/core.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/tipc/core.h b/net/tipc/core.h
index 2e00682bc455..bb26ed1ee966 100644
--- a/net/tipc/core.h
+++ b/net/tipc/core.h
@@ -57,6 +57,7 @@
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <linux/rtnetlink.h>
+#include <linux/etherdevice.h>
#define TIPC_MOD_VER "2.0.0"