summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/sys/ib/ibnex/ibnex_devctl.h
blob: 8d74d61c869b32392b6bd881e0d82a74066ac1c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License (the "License").
 * You may not use this file except in compliance with the License.
 *
 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
 * or http://www.opensolaris.org/os/licensing.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
 * If applicable, add the following below this CDDL HEADER, with the
 * fields enclosed by brackets "[]" replaced with your own identifying
 * information: Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 */
/*
 * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 * Use is subject to license terms.
 */

#ifndef _SYS_IB_IBNEX_IBNEX_DEVCTL_H
#define	_SYS_IB_IBNEX_IBNEX_DEVCTL_H

#include <sys/ib/ib_types.h>
#include <sys/ib/ibtl/ibtl_types.h>

#ifdef __cplusplus
extern "C" {
#endif

/*
 * This file contains info for devctls issued by IB cfgadm plugin.
 * The only devctl of interest is DEVCTL_AP_CONTROL which uses
 * these defines and data structures.
 */

#define	IBNEX_HCAGUID_STRSZ	17

/*
 * types of attachment point Identifiers (APID)s supported
 */
#define	IBNEX_BASE_APID		0x01	/* Base static attachment point */
#define	IBNEX_HCA_APID		0x02	/* HCA static attachment point */
#define	IBNEX_DYN_APID		0x04	/* Dynamic IOC/DLPI attachment point */
#define	IBNEX_UNKNOWN_APID	0x08	/* Unknown attachment point */


/* defines for dynamic APID handling */
#define	DYN_SEP		"::"
#define	GET_DYN(a)	(((a) != NULL) ? strstr((a), DYN_SEP) : (void *)0)

#define	IBNEX_FABRIC		"fabric"
#define	IBNEX_VPPA_STR		"vppa"
#define	IBNEX_PORT_STR		"port"
#define	IBNEX_HCASVC_STR	"hca-svc"

/* Enums while reading ib.conf file */
typedef enum ib_service_type_e {
	IB_NAME,		/* name = */
	IB_CLASS,		/* class = */
	IB_PORT_SERVICE,	/* port-svc-list = */
	IB_VPPA_SERVICE,	/* vppa-svc-list = */
	IB_HCASVC_SERVICE,	/* hca-svc-list = */
	IB_NONE
} ib_service_type_t;

/*
 * defines for nvlist types: (for PORT devices and IOCs)
 * The first 6 are common to both IOC and PORT devices.
 * The last 9 are used only for IOC devices.
 */
#define	IBNEX_NODE_INFO_NVL		"node_info"
#define	IBNEX_NODE_APID_NVL		"node_apid"
#define	IBNEX_NODE_TYPE_NVL		"node_type"
#define	IBNEX_NODE_RSTATE_NVL		"node_rstate"
#define	IBNEX_NODE_OSTATE_NVL		"node_ostate"
#define	IBNEX_NODE_COND_NVL		"node_condition"

/*
 * This flag is passed from cfgadm to ib(4D) to convey that it
 * need not attempt to probe the fabric.
 *
 * The value of these flags should be same as flags in enum
 * ibdm_ibnex_get_ioclist_mtd_t.
 */
#define	IBNEX_DONOT_PROBE_FLAG	1
#define	IBNEX_NORMAL_PROBE	0	/* flag used by ib(4D) only */

/*
 * The following are sub-commands to DEVCTL_AP_CONTROL.
 * NOTE: IBNEX_NUM_DEVICE_NODES and IBNEX_NUM_HCA_NODES need to be
 * separate. The former is used to figure out the dynamic ap_ids for
 * the IB fabric. The latter is used for a HCA count on a given host only.
 */
#define	IBNEX_NUM_DEVICE_NODES	0x00010	/* how many device nodes exist? */
#define	IBNEX_NUM_HCA_NODES	0x00020	/* how many HCAs exist in the host? */
#define	IBNEX_SNAPSHOT_SIZE	0x00040	/* What is the "snapshot" size? */
#define	IBNEX_GET_SNAPSHOT	0x00080	/* Get the actual dynamic "snapshot" */
#define	IBNEX_DEVICE_PATH_SZ	0x00100	/* Given APID's device path size */
#define	IBNEX_GET_DEVICE_PATH	0x00200	/* Get device path for a Dynamic APID */
#define	IBNEX_HCA_LIST_SZ	0x00400	/* -x list_clients size for HCA APID */
#define	IBNEX_HCA_LIST_INFO	0x00800	/* -x list_clients info for HCA APID */
#define	IBNEX_UNCFG_CLNTS_SZ	0x01000	/* -x unconfig_clients option size */
#define	IBNEX_UNCFG_CLNTS_INFO	0x02000	/* -x unconfig_clients option data */
#define	IBNEX_UPDATE_PKEY_TBLS	0x04000	/* -x update_pkey_tbls */
#define	IBNEX_CONF_ENTRY_ADD	0x08000	/* -x conf_file add_service */
#define	IBNEX_CONF_ENTRY_DEL	0x10000	/* -x conf_file delete_service */
#define	IBNEX_HCA_VERBOSE_SZ	0x20000	/* -alv hca_apid devctl size */
#define	IBNEX_HCA_VERBOSE_INFO	0x40000	/* -alv hca_apid devctl data */
#define	IBNEX_UPDATE_IOC_CONF	0x80000	/* -x update_ioc_conf */

/*
 * Data structure passed back and forth user/kernel w/ DEVCTL_AP_CONTROL
 * devctl. Note that these are separate structures as some fields are pointers.
 */
typedef struct ibnex_ioctl_data {
	uint_t		cmd;		/* one of the above commands */
	caddr_t		buf;		/* data buffer */
	uint_t		bufsiz;		/* data buffer size */
	caddr_t		ap_id;		/* Search based on this AP_ID name */
	uint_t		ap_id_len;	/* AP_ID name len */
	uint_t		misc_arg;	/* reserved */
} ibnex_ioctl_data_t;


/* For 32-bit app/64-bit kernel */
typedef struct ibnex_ioctl_data_32 {
	uint32_t	cmd;		/* one of the above commands */
	caddr32_t	buf;		/* data buffer */
	uint32_t	bufsiz;		/* data buffer size */
	caddr32_t	ap_id;		/* Search based on this AP_ID name */
	uint32_t	ap_id_len;	/* AP_ID name len */
	uint32_t	misc_arg;	/* reserved */
} ibnex_ioctl_data_32_t;

/*
 * General ibnex IOCTLs
 *
 * IBNEX_CTL_GET_API_VER
 * ======================
 *
 * Gets the version number of the API that IB nexus currently supports.
 *
 * arg - pointer to a structure of type ibnex_ctl_api_ver_t
 *
 * Caller does not set any field of this structure. When this IOCTL is issued,
 * ib nexus will set api_ver_num field to the currently supported API
 * version number.
 *
 * The caller could issue this IOCTL prior to issuing any other general
 * ibnex IOCTLs to detect incompatible changes to the API. The caller may
 * call other IOCTLs only if the api_ver_num matches the API version number
 * used by the caller.
 *
 *
 * IBNEX_CTL_GET_HCA_LIST
 * ======================
 *
 * Gets GUIDs of all HCAs in the system
 *
 * arg - pointer to a structure of type ibnex_ctl_get_hca_list_t
 *
 * Caller allocates memory for HCA GUIDs. Sets hca_guids field to point to the
 * allocated memory. Sets hca_guids_alloc_sz to the number of GUIDs for which
 * memory has been allocated.
 *
 * Upon successful return from the IOCTL, nhcas will contain the number of
 * HCAs in the system. HCA GUIDs will be copied into hca_guids array.
 * The number of GUIDs copied are nhcas or hca_guids_alloc_sz which ever is
 * smaller.
 *
 *
 * IBNEX_CTL_QUERY_HCA
 * ===================
 *
 * Query HCA attributes
 *
 * arg - pointer to a structure of type ibnex_ctl_query_hca_t
 *
 * Caller sets hca_guid field of this structure.
 *
 * Caller allocates memory for hca device path. Sets hca_device_path to point
 * to the allocated memory and hca_device_path_alloc_sz to the number of bytes
 * allocated.
 *
 * Upon successful return from the IOCTL, hca_info will contain HCA attributes
 * for the specified GUID. hca_info.hca_device_path_len will contain the actual
 * string length of the hca device path plus one (for the terminating null
 * character). hca_info.hca_device_path will point to null terminated hca device
 * path string if the caller allocated memory for the hca device path is large
 * enough to hold the hca device path and the terminating null character.
 * Otherwise hca_info.hca_device_path will be set to NULL.
 *
 *
 * IBNEX_CTL_QUERY_HCA_PORT
 * ========================
 *
 * Query HCA port attributes
 *
 * arg - pointer to a structure of type ibnex_ctl_query_hca_port_t
 *
 * Caller sets hca_guid and port_num fields.
 *
 * Caller allocates memory for sgid entries. Sets sgid_tbl to point to
 * the allocated memory and sgid_tbl_alloc_sz to the number of sgid entries
 * for which memory has been allocated.
 *
 * Caller allocates memory for pkey entries. Sets pkey_tbl to point to
 * the allocated memory and pkey_tbl_alloc_sz to the number of pkey entries
 * for which memory has been allocated.
 *
 * Upon successful return from the IOCTL, port_info will contain HCA port
 * attributes for the specified HCA port. port_info.p_sgid_tbl_sz will contain
 * the actual number of sgids associated with this port. port_info.p_pkey_tbl_sz
 * will contain the actual number of pkeys associated with this port.
 *
 * port_info.p_sgid_tbl will point to an array containing sgids. The number of
 * sgids in the array is sgid_tbl_alloc_sz or port_info.p_sgid_tbl_sz
 * whichever is smaller.
 *
 * port_info.p_pkey_tbl will point to an array containing pkeys. The number of
 * pkeys in the array is pkey_tbl_alloc_sz or port_info.p_pkey_tbl_sz
 * whichever is smaller.
 *
 * Error numbers for the above ioctls upon failure:
 *   EINVAL	Invalid parameter passed
 *   EFAULT	A fault occurred copying data to or from the user space
 *		to the kernel space.
 *   ENXIO	Specified HCA GUID does not exist
 *   ENOENT	Specified HCA port does not exist
 *
 */


/*
 * ibnex specific ioctls
 *
 * NOTE: The ioctl codes should not collide with generic devctl ioctls
 * such as DEVCTL_AP_CONFIGURE.
 */
#define	IBNEX_IOC		(1 << 16)
#define	IBNEX_CTL_GET_API_VER	(IBNEX_IOC + 1)	/* Get API version # */
#define	IBNEX_CTL_GET_HCA_LIST	(IBNEX_IOC + 2)	/* Get HCA GUID list */
#define	IBNEX_CTL_QUERY_HCA	(IBNEX_IOC + 3)	/* Query HCA attributes */
#define	IBNEX_CTL_QUERY_HCA_PORT (IBNEX_IOC + 4) /* Query HCA port attributes */

/*
 * The device to open for issuing ibnex IOCTLs
 */
#define	IBNEX_DEVCTL_DEV		"/devices/ib:devctl"

/*
 * ibnex IOCTL API version number - to be incremented when making an
 * incompatible change to the API.
 */
#define	IBNEX_CTL_API_VERSION		1

#define	MAX_HCA_DRVNAME_LEN		16

/*
 * Data structure for IBNEX_CTL_GET_API_VER
 */
typedef struct ibnex_ctl_api_ver_s {
	uint_t		api_ver_num;		/* out: supported API version */
} ibnex_ctl_api_ver_t;

/*
 * Data structure for IBNEX_CTL_GET_HCA_LIST
 */
typedef struct ibnex_ctl_get_hca_list_s {
	ib_guid_t	*hca_guids;		/* in/out: HCA GUID array */
	uint_t		hca_guids_alloc_sz;	/* in: # of HCA GUIDs for */
						/* which storage is allocated */
	uint_t		nhcas;			/* out: actual number of HCAs */
} ibnex_ctl_get_hca_list_t;

typedef struct ibnex_ctl_get_hca_list_32_s {
	caddr32_t	hca_guids;		/* in/out: HCA GUID array */
	uint_t		hca_guids_alloc_sz;	/* in: # of HCA GUIDs for */
						/* which storage is allocated */
	uint_t		nhcas;			/* out: actual number of HCAs */
} ibnex_ctl_get_hca_list_32_t;

/*
 * HCA information structure
 */
typedef struct ibnex_ctl_hca_info_s {
	ib_guid_t	hca_node_guid;		/* Node GUID */
	ib_guid_t	hca_si_guid;		/* Optional System Image GUID */
	uint_t		hca_nports;		/* Number of physical ports */

	/* HCA driver name and instance number */
	char		hca_driver_name[MAX_HCA_DRVNAME_LEN];
	int		hca_driver_instance;

	/*
	 * hca device path and the length.
	 * hca_device_path_len contains the string length of the actual hca
	 * device path plus one (for the terminating null character).
	 */
	char		*hca_device_path;
	uint_t		hca_device_path_len;

	ibt_hca_flags_t		hca_flags;	/* HCA capabilities etc */
	ibt_hca_flags2_t	hca_flags2;	/* HCA capabilities etc */

	uint32_t	hca_vendor_id;		/* Vendor ID */
	uint16_t	hca_device_id;		/* Device ID */
	uint32_t	hca_version_id;		/* Version ID */

	uint_t		hca_max_chans;		/* Max channels supported */
	uint_t		hca_max_chan_sz;	/* Max outstanding WRs on any */
						/* channel */

	uint_t		hca_max_sgl;		/* Max SGL entries per WR */

	uint_t		hca_max_cq;		/* Max num of CQs supported  */
	uint_t		hca_max_cq_sz;		/* Max capacity of each CQ */

	ibt_page_sizes_t	hca_page_sz;	/* Bit mask of page sizes */

	uint_t		hca_max_memr;		/* Max num of HCA mem regions */
	ib_memlen_t	hca_max_memr_len;	/* Largest block, in bytes of */
						/* mem that can be registered */
	uint_t		hca_max_mem_win;	/* Max Memory windows in HCA */

	uint_t		hca_max_rsc; 		/* Max Responder Resources of */
						/* this HCA for RDMAR/Atomics */
						/* with this HCA as target. */
	uint8_t		hca_max_rdma_in_chan;	/* Max RDMAR/Atomics in per */
						/* chan this HCA as target. */
	uint8_t		hca_max_rdma_out_chan;	/* Max RDMA Reads/Atomics out */
						/* per channel by this HCA */
	uint_t		hca_max_ipv6_chan;	/* Max IPV6 channels in HCA */
	uint_t		hca_max_ether_chan;	/* Max Ether channels in HCA */

	uint_t		hca_max_mcg_chans;	/* Max number of channels */
						/* that can join multicast */
						/* groups */
	uint_t		hca_max_mcg;		/* Max multicast groups */
	uint_t		hca_max_chan_per_mcg;	/* Max number of channels per */
						/* Multicast group in HCA */
	uint16_t	hca_max_partitions;	/* Max partitions in HCA */

	ib_time_t	hca_local_ack_delay;

	uint_t		hca_max_port_sgid_tbl_sz;
	uint16_t	hca_max_port_pkey_tbl_sz;
	uint_t		hca_max_pd;		/* Max# of Protection Domains */

	uint_t		hca_max_ud_dest;
	uint_t		hca_max_srqs;		/* Max SRQs supported */
	uint_t		hca_max_srqs_sz;	/* Max outstanding WRs on any */
						/* SRQ */
	uint_t		hca_max_srq_sgl;	/* Max SGL entries per SRQ WR */
	uint_t		hca_max_cq_handlers;
	ibt_lkey_t	hca_reserved_lkey;	/* Reserved L_Key value */
	uint_t		hca_max_fmrs;		/* Max FMR Supported */

	uint_t		hca_max_lso_size;
	uint_t		hca_max_lso_hdr_size;
	uint_t		hca_max_inline_size;

	uint_t		hca_max_cq_mod_count;	/* CQ notify moderation */
	uint_t		hca_max_cq_mod_usec;

	uint32_t	hca_fw_major_version;	/* firmware version */
	uint16_t	hca_fw_minor_version;
	uint16_t	hca_fw_micro_version;

	/* detailed WQE size info */
	uint_t		hca_ud_send_inline_sz;	/* inline size in bytes */
	uint_t		hca_conn_send_inline_sz;
	uint_t		hca_conn_rdmaw_inline_overhead;
	uint_t		hca_recv_sgl_sz;	/* detailed SGL sizes */
	uint_t		hca_ud_send_sgl_sz;
	uint_t		hca_conn_send_sgl_sz;
	uint_t		hca_conn_rdma_sgl_overhead;
	int32_t		hca_pad;
} ibnex_ctl_hca_info_t;

typedef struct ibnex_ctl_hca_info_32_s {
	ib_guid_t	hca_node_guid;		/* Node GUID */
	ib_guid_t	hca_si_guid;		/* Optional System Image GUID */
	uint_t		hca_nports;		/* Number of physical ports */

	/* HCA driver name and instance number */
	char		hca_driver_name[MAX_HCA_DRVNAME_LEN];
	int		hca_driver_instance;

	/*
	 * hca device path and the length.
	 * hca_device_path_len contains the string length of the actual hca
	 * device path plus one (for the terminating null character).
	 */
	caddr32_t	hca_device_path;
	uint_t		hca_device_path_len;

	ibt_hca_flags_t		hca_flags;	/* HCA capabilities etc */
	ibt_hca_flags2_t	hca_flags2;	/* HCA capabilities etc */

	uint32_t	hca_vendor_id;		/* Vendor ID */
	uint16_t	hca_device_id;		/* Device ID */
	uint32_t	hca_version_id;		/* Version ID */

	uint_t		hca_max_chans;		/* Max channels supported */
	uint_t		hca_max_chan_sz;	/* Max outstanding WRs on any */
						/* channel */

	uint_t		hca_max_sgl;		/* Max SGL entries per WR */

	uint_t		hca_max_cq;		/* Max num of CQs supported  */
	uint_t		hca_max_cq_sz;		/* Max capacity of each CQ */

	ibt_page_sizes_t	hca_page_sz;	/* Bit mask of page sizes */

	uint_t		hca_max_memr;		/* Max num of HCA mem regions */
	ib_memlen_t	hca_max_memr_len;	/* Largest block, in bytes of */
						/* mem that can be registered */
	uint_t		hca_max_mem_win;	/* Max Memory windows in HCA */

	uint_t		hca_max_rsc; 		/* Max Responder Resources of */
						/* this HCA for RDMAR/Atomics */
						/* with this HCA as target. */
	uint8_t		hca_max_rdma_in_chan;	/* Max RDMAR/Atomics in per */
						/* chan this HCA as target. */
	uint8_t		hca_max_rdma_out_chan;	/* Max RDMA Reads/Atomics out */
						/* per channel by this HCA */
	uint_t		hca_max_ipv6_chan;	/* Max IPV6 channels in HCA */
	uint_t		hca_max_ether_chan;	/* Max Ether channels in HCA */

	uint_t		hca_max_mcg_chans;	/* Max number of channels */
						/* that can join multicast */
						/* groups */
	uint_t		hca_max_mcg;		/* Max multicast groups */
	uint_t		hca_max_chan_per_mcg;	/* Max number of channels per */
						/* Multicast group in HCA */
	uint16_t	hca_max_partitions;	/* Max partitions in HCA */

	ib_time_t	hca_local_ack_delay;

	uint_t		hca_max_port_sgid_tbl_sz;
	uint16_t	hca_max_port_pkey_tbl_sz;
	uint_t		hca_max_pd;		/* Max# of Protection Domains */

	uint_t		hca_max_ud_dest;
	uint_t		hca_max_srqs;		/* Max SRQs supported */
	uint_t		hca_max_srqs_sz;	/* Max outstanding WRs on any */
						/* SRQ */
	uint_t		hca_max_srq_sgl;	/* Max SGL entries per SRQ WR */
	uint_t		hca_max_cq_handlers;
	ibt_lkey_t	hca_reserved_lkey;	/* Reserved L_Key value */
	uint_t		hca_max_fmrs;		/* Max FMR Supported */

	uint_t		hca_max_lso_size;
	uint_t		hca_max_lso_hdr_size;
	uint_t		hca_max_inline_size;

	uint_t		hca_max_cq_mod_count;	/* CQ notify moderation */
	uint_t		hca_max_cq_mod_usec;

	uint32_t	hca_fw_major_version;	/* firmware version */
	uint16_t	hca_fw_minor_version;
	uint16_t	hca_fw_micro_version;

	/* detailed WQE size info */
	uint_t		hca_ud_send_inline_sz;	/* inline size in bytes */
	uint_t		hca_conn_send_inline_sz;
	uint_t		hca_conn_rdmaw_inline_overhead;
	uint_t		hca_recv_sgl_sz;	/* detailed SGL sizes */
	uint_t		hca_ud_send_sgl_sz;
	uint_t		hca_conn_send_sgl_sz;
	uint_t		hca_conn_rdma_sgl_overhead;
	int32_t		hca_pad;
} ibnex_ctl_hca_info_32_t;

/*
 * Data structure for IBNEX_CTL_QUERY_HCA
 */
typedef struct ibnex_ctl_query_hca_s {
	ib_guid_t	hca_guid;	/* in: HCA GUID */

	/*
	 * in: user allocated memory pointer for hca device path and number of
	 * bytes allocated for the hca device path.
	 */
	char		*hca_device_path;
	uint_t		hca_device_path_alloc_sz;

	ibnex_ctl_hca_info_t	hca_info;	/* out: HCA information */
} ibnex_ctl_query_hca_t;

typedef struct ibnex_ctl_query_hca_32_s {
	ib_guid_t	hca_guid;	/* in: HCA GUID */

	/*
	 * in: user allocated memory pointer for hca device path and number of
	 * bytes allocated for the hca device path.
	 */
	caddr32_t	hca_device_path;
	uint_t		hca_device_path_alloc_sz;

	ibnex_ctl_hca_info_32_t	hca_info;	/* out: HCA information */
} ibnex_ctl_query_hca_32_t;

/*
 * HCA port information structure
 */
typedef struct ibnex_ctl_hca_port_info_s {
	ib_lid_t		p_lid;		/* Base LID of port */
	ib_qkey_cntr_t		p_qkey_violations; /* Bad Q_Key cnt */
	ib_pkey_cntr_t		p_pkey_violations; /* Optional bad P_Key cnt */
	uint8_t			p_sm_sl;	/* SM Service level */
	ib_port_phys_state_t	p_phys_state;
	ib_lid_t		p_sm_lid;	/* SM LID */
	ibt_port_state_t	p_linkstate;	/* Port state */
	uint8_t			p_port_num;	/* Port number */

	ib_link_width_t		p_width_supported;
	ib_link_width_t		p_width_enabled;
	ib_link_width_t		p_width_active;

	ib_mtu_t		p_mtu;		/* Max transfer unit - pkt */
	uint8_t			p_lmc;		/* LID mask control */

	ib_link_speed_t		p_speed_supported;
	ib_link_speed_t		p_speed_enabled;
	ib_link_speed_t		p_speed_active;

	ib_gid_t		*p_sgid_tbl;	/* SGID Table */
	uint_t			p_sgid_tbl_sz;	/* # of entries in SGID table */

	ib_pkey_t		*p_pkey_tbl;	/* P_Key table */
	uint16_t		p_pkey_tbl_sz;	/* # of entries in P_Key tbl */
	uint16_t		p_def_pkey_ix;	/* default pkey index for TI */

	uint8_t			p_max_vl;	/* Max num of virtual lanes */
	uint8_t			p_init_type_reply; /* Optional InitTypeReply */
	ib_time_t		p_subnet_timeout; /* Max Subnet Timeout */
	ibt_port_caps_t		p_capabilities;	/* Port Capabilities */
	uint32_t		p_msg_sz;	/* Max message size */
} ibnex_ctl_hca_port_info_t;

typedef struct ibnex_ctl_hca_port_info_32_s {
	ib_lid_t		p_lid;		/* Base LID of port */
	ib_qkey_cntr_t		p_qkey_violations; /* Bad Q_Key cnt */
	ib_pkey_cntr_t		p_pkey_violations; /* Optional bad P_Key cnt */
	uint8_t			p_sm_sl;	/* SM Service level */
	ib_port_phys_state_t	p_phys_state;
	ib_lid_t		p_sm_lid;	/* SM LID */
	ibt_port_state_t	p_linkstate;	/* Port state */
	uint8_t			p_port_num;	/* Port number */

	ib_link_width_t		p_width_supported;
	ib_link_width_t		p_width_enabled;
	ib_link_width_t		p_width_active;

	ib_mtu_t		p_mtu;		/* Max transfer unit - pkt */
	uint8_t			p_lmc;		/* LID mask control */

	ib_link_speed_t		p_speed_supported;
	ib_link_speed_t		p_speed_enabled;
	ib_link_speed_t		p_speed_active;

	caddr32_t		p_sgid_tbl;	/* SGID Table */
	uint_t			p_sgid_tbl_sz;	/* # of entries in SGID table */

	caddr32_t		p_pkey_tbl;	/* P_Key table */
	uint16_t		p_pkey_tbl_sz;	/* # of entries in P_Key tbl */
	uint16_t		p_def_pkey_ix;	/* default pkey index for TI */

	uint8_t			p_max_vl;	/* Max num of virtual lanes */
	uint8_t			p_init_type_reply; /* Optional InitTypeReply */
	ib_time_t		p_subnet_timeout; /* Max Subnet Timeout */
	ibt_port_caps_t		p_capabilities;	/* Port Capabilities */
	uint32_t		p_msg_sz;	/* Max message size */
} ibnex_ctl_hca_port_info_32_t;

/*
 * Data structure for IBNEX_CTL_QUERY_HCA_PORT
 */
typedef struct ibnex_ctl_query_hca_port_s {
	ib_guid_t	hca_guid;		/* in: HCA GUID */
	uint_t		port_num;		/* in: port number */

	ib_gid_t	*sgid_tbl;		/* in: SGID Table */
	uint_t		sgid_tbl_alloc_sz; /* in: # of entries in SGID table */

	ib_pkey_t	*pkey_tbl;		/* in: P_Key table */
	uint_t		pkey_tbl_alloc_sz; /* in: # of entries in P_Key table */

	uint32_t	pad;
	ibnex_ctl_hca_port_info_t port_info;	/* out: port information */
} ibnex_ctl_query_hca_port_t;

typedef struct ibnex_ctl_query_hca_port_32_s {
	ib_guid_t	hca_guid;		/* in: HCA GUID */
	uint_t		port_num;		/* in: port number */

	caddr32_t	sgid_tbl;		/* in: SGID Table */
	uint_t		sgid_tbl_alloc_sz; /* in: # of entries in SGID table */

	caddr32_t	pkey_tbl;		/* in: P_Key table */
	uint_t		pkey_tbl_alloc_sz; /* in: # of entries in P_Key table */

	uint32_t	pad;
	ibnex_ctl_hca_port_info_32_t port_info;	/* out: port information */
} ibnex_ctl_query_hca_port_32_t;

#ifdef _KERNEL
_NOTE(SCHEME_PROTECTS_DATA("", ibnex_ctl_hca_info_s))
_NOTE(SCHEME_PROTECTS_DATA("", ibnex_ctl_hca_port_info_s))
_NOTE(SCHEME_PROTECTS_DATA("", ibnex_ctl_hca_port_info_32_s))
_NOTE(SCHEME_PROTECTS_DATA("", ibnex_ctl_query_hca_port_s))
_NOTE(SCHEME_PROTECTS_DATA("", ibnex_ctl_query_hca_port_32_s))
#endif


#ifdef __cplusplus
}
#endif

#endif	/* _SYS_IB_IBNEX_IBNEX_DEVCTL_H */