* exchange HELLO messages when a connection is first established. Individual
* LNDs can put whatever else they fancy in lnet_hdr_t::msg.
*/
-typedef struct {
+struct lnet_magicversion {
__u32 magic; /* LNET_PROTO_TCP_MAGIC */
__u16 version_major; /* increment on incompatible change */
__u16 version_minor; /* increment on compatible change */
-} WIRE_ATTR lnet_magicversion_t;
+} WIRE_ATTR;
/* PROTO MAGIC for LNDs */
#define LNET_PROTO_IB_MAGIC 0x0be91b91
}
if (hello->kshm_magic == le32_to_cpu(LNET_PROTO_TCP_MAGIC)) {
- lnet_magicversion_t *hmv = (lnet_magicversion_t *)hello;
+ struct lnet_magicversion *hmv = (struct lnet_magicversion *)hello;
- CLASSERT(sizeof(lnet_magicversion_t) ==
+ CLASSERT(sizeof(struct lnet_magicversion) ==
offsetof(ksock_hello_msg_t, kshm_src_nid));
if (hmv->version_major == cpu_to_le16(KSOCK_PROTO_V1_MAJOR) &&
{
struct socket *sock = conn->ksnc_sock;
lnet_hdr_t *hdr;
- lnet_magicversion_t *hmv;
+ struct lnet_magicversion *hmv;
int rc;
int i;
- CLASSERT(sizeof(lnet_magicversion_t) == offsetof(lnet_hdr_t, src_nid));
+ CLASSERT(sizeof(struct lnet_magicversion) == offsetof(lnet_hdr_t, src_nid));
LIBCFS_ALLOC(hdr, sizeof(*hdr));
if (!hdr) {
return -ENOMEM;
}
- hmv = (lnet_magicversion_t *)&hdr->dest_nid;
+ hmv = (struct lnet_magicversion *)&hdr->dest_nid;
/*
* Re-organize V2.x message header to V1.x (lnet_hdr_t)
CLASSERT((int)offsetof(struct lnet_handle_wire, wh_object_cookie) == 8);
CLASSERT((int)sizeof(((struct lnet_handle_wire *)0)->wh_object_cookie) == 8);
- /* Checks for struct lnet_magicversion_t */
- CLASSERT((int)sizeof(lnet_magicversion_t) == 8);
- CLASSERT((int)offsetof(lnet_magicversion_t, magic) == 0);
- CLASSERT((int)sizeof(((lnet_magicversion_t *)0)->magic) == 4);
- CLASSERT((int)offsetof(lnet_magicversion_t, version_major) == 4);
- CLASSERT((int)sizeof(((lnet_magicversion_t *)0)->version_major) == 2);
- CLASSERT((int)offsetof(lnet_magicversion_t, version_minor) == 6);
- CLASSERT((int)sizeof(((lnet_magicversion_t *)0)->version_minor) == 2);
+ /* Checks for struct struct lnet_magicversion */
+ CLASSERT((int)sizeof(struct lnet_magicversion) == 8);
+ CLASSERT((int)offsetof(struct lnet_magicversion, magic) == 0);
+ CLASSERT((int)sizeof(((struct lnet_magicversion *)0)->magic) == 4);
+ CLASSERT((int)offsetof(struct lnet_magicversion, version_major) == 4);
+ CLASSERT((int)sizeof(((struct lnet_magicversion *)0)->version_major) == 2);
+ CLASSERT((int)offsetof(struct lnet_magicversion, version_minor) == 6);
+ CLASSERT((int)sizeof(((struct lnet_magicversion *)0)->version_minor) == 2);
/* Checks for struct lnet_hdr_t */
CLASSERT((int)sizeof(lnet_hdr_t) == 72);