2 * Copyright (c) 2005 SilverStorm Technologies. All rights reserved.
\r
3 * Copyright (c) 2006 Mellanox Technologies. All rights reserved.
\r
5 * This software is available to you under the OpenIB.org BSD license
\r
8 * Redistribution and use in source and binary forms, with or
\r
9 * without modification, are permitted provided that the following
\r
10 * conditions are met:
\r
12 * - Redistributions of source code must retain the above
\r
13 * copyright notice, this list of conditions and the following
\r
16 * - Redistributions in binary form must reproduce the above
\r
17 * copyright notice, this list of conditions and the following
\r
18 * disclaimer in the documentation and/or other materials
\r
19 * provided with the distribution.
\r
21 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
\r
22 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
\r
23 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
\r
24 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
\r
25 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
\r
26 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
\r
27 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
\r
34 #ifndef _IPOIB_DRIVER_H_
\r
35 #define _IPOIB_DRIVER_H_
\r
38 #include "ipoib_log.h"
\r
39 #include "ipoib_adapter.h"
\r
40 #include <complib/cl_spinlock.h>
\r
41 #include <complib/cl_qlist.h>
\r
42 #include "ipoib_debug.h"
\r
48 #define MAX_BUNDLE_ID_LENGTH 32
\r
50 /* MLX4 supports 4K MTU */
\r
53 * Header length as defined by IPoIB spec:
\r
54 * http://www.ietf.org/internet-drafts/draft-ietf-ipoib-ip-over-infiniband-04.txt
\r
57 #define MAX_PAYLOAD_MTU (IB_MTU - sizeof(ipoib_hdr_t))
\r
60 * Only the protocol type is sent as part of the UD payload
\r
61 * since the rest of the Ethernet header is encapsulated in the
\r
62 * various IB headers. We report out buffer space as if we
\r
63 * transmit the ethernet headers.
\r
65 #define MAX_XFER_BLOCK_SIZE (sizeof(eth_hdr_t) + MAX_PAYLOAD_MTU)
\r
68 typedef struct _ipoib_globals
\r
71 cl_qlist_t adapter_list;
\r
72 cl_qlist_t bundle_list;
\r
76 NDIS_HANDLE h_ndis_wrapper;
\r
77 NDIS_HANDLE h_ibat_dev;
\r
78 volatile LONG ibat_ref;
\r
79 uint32_t bypass_check_bcast_rate;
\r
85 * Spinlock to protect list access.
\r
88 * List of all adapter instances. Used for address translation support.
\r
91 * List of all adapter bundles.
\r
94 * Global counter for generating LAA MACs
\r
97 * Device handle returned by NdisMRegisterDevice.
\r
100 extern ipoib_globals_t g_ipoib;
\r
103 typedef struct _ipoib_bundle
\r
105 cl_list_item_t list_item;
\r
106 char bundle_id[MAX_BUNDLE_ID_LENGTH];
\r
107 cl_qlist_t adapter_list;
\r
113 * List item for storing the bundle in a quick list.
\r
116 * Bundle identifier.
\r
119 * List of adapters in the bundle. The adapter at the head is the
\r
120 * primary adapter of the bundle.
\r
127 IN ipoib_adapter_t* const p_adapter );
\r
129 #define IPOIB_OFFSET(field) ((UINT)FIELD_OFFSET(ipoib_params_t,field))
\r
130 #define IPOIB_SIZE(field) sizeof(((ipoib_params_t*)0)->field)
\r
131 #define IPOIB_INIT_NDIS_STRING(str) \
\r
132 (str)->Length = 0; \
\r
133 (str)->MaximumLength = 0; \
\r
134 (str)->Buffer = NULL;
\r
138 #endif /* _IPOIB_DRIVER_H_ */
\r