]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - contrib/ofed/management/libibumad/man/umad_get_port.3
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / contrib / ofed / management / libibumad / man / umad_get_port.3
1 .\" -*- nroff -*-
2 .\"
3 .TH UMAD_GET_PORT 3  "May 21, 2007" "OpenIB" "OpenIB Programmer\'s Manual"
4 .SH "NAME"
5 umad_get_port, umad_release_port \- open and close an InfiniBand port
6 .SH "SYNOPSIS"
7 .nf
8 .B #include <infiniband/umad.h>
9 .sp
10 .BI "int umad_get_port(char " "*ca_name" ", int " "portnum" ", umad_port_t " "*port" );
11 .nl
12 .BI "int umad_release_port(umad_port_t " "*port" );
13 .fi
14 .SH "DESCRIPTION"
15 .B umad_get_port()
16 fills the
17 .I port
18 structure with the IB port attributes specified by
19 .I ca_name
20 and
21 .I portnum
22 , or the default port if
23 .I ca_name
24 is NULL and
25 .I portnum
26 is zero. If only one of
27 .I ca_name
28 and
29 .I portnum
30 are specified, the other is used as a filter.
31 For example, passing a NULL
32 .I ca_name
33 and 2 for the
34 .I portnum
35 means get a port from any of the local IB devices, as long as it is
36 the second port.
37 Note that the library may use some reference scheme to support port caching
38 therefore
39 .B umad_release_port()
40 should be called before the
41 .I port
42 structure can be deallocated.
43 The argument
44 .I port
45 is an
46 .B umad_port_t
47 struct, as specified in <infiniband/umad.h>.
48 .PP
49 .nf
50 typedef struct umad_port {
51 .in +8
52 char ca_name[UMAD_CA_NAME_LEN];                 /* Name of the device */
53 int portnum;                                    /* Physical port number */
54 uint base_lid;                                  /* Base port LID */
55 uint lmc;                                       /* LMC of LID */
56 uint sm_lid;                                    /* SM LID */
57 uint sm_sl;                                     /* SM service level */
58 uint state;                                     /* Logical port state */
59 uint phys_state;                                /* Physical port state */
60 uint rate;                                      /* Port link bit rate */
61 uint64_t capmask;                               /* Port capabilities */
62 uint64_t gid_prefix;                            /* Gid prefix of this port */
63 uint64_t port_guid;                             /* GUID of this port */
64 .in -8
65 } umad_port_t;
66 .fi
67 .PP
68 .B umad_release_port()
69 releases the resources that were allocated by the
70 .B umad_get_port()
71 function for the specified IB
72 .I port\fR.
73 .SH "RETURN VALUE"
74 .B umad_get_port()
75 and
76 .B umad_release_port()
77 return 0 on success, and a negative value on error.
78 .SH "AUTHORS"
79 .TP
80 Hal Rosenstock <halr@voltaire.com>
81 .TP
82 Dotan Barak <dotanb@mellanox.co.il>