diff options
author | Jon Paul Maloy <jon.maloy@ericsson.com> | 2014-05-14 13:39:13 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-05-14 23:19:48 +0400 |
commit | 38504c28a201a80d12a6a0f821fecb331cb1f223 (patch) | |
tree | 001139319f80f9d00cfa510638f61a1ec1725459 /Documentation/unaligned-memory-access.txt | |
parent | 37e22164a8a3c39bdad45aa463b1e69a1fdf4110 (diff) | |
download | linux-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 'Documentation/unaligned-memory-access.txt')
0 files changed, 0 insertions, 0 deletions