1[PATCHv7 2/4] libibverbs: change kernel API to accept link layer
2
3Modify the code to allow passing the link layer of a port from kernel to user.
4Update ibv_query_port.3 man page with the change.
5
6Signed-off-by: Eli Cohen <eli@mellanox.co.il>
7---
8 include/infiniband/kern-abi.h |    3 ++-
9 man/ibv_query_port.3          |    1 +
10 src/cmd.c                     |    1 +
11 3 files changed, 4 insertions(+), 1 deletions(-)
12
13Index: libibverbs/include/infiniband/kern-abi.h
14===================================================================
15--- libibverbs.orig/include/infiniband/kern-abi.h	2010-06-08 11:08:57.895171000 +0300
16+++ libibverbs/include/infiniband/kern-abi.h	2010-06-08 11:09:10.172540000 +0300
17@@ -231,7 +231,8 @@ struct ibv_query_port_resp {
18 	__u8  active_width;
19 	__u8  active_speed;
20 	__u8  phys_state;
21-	__u8  reserved[3];
22+	__u8  link_layer;
23+	__u8  reserved[2];
24 };
25 
26 struct ibv_alloc_pd {
27Index: libibverbs/man/ibv_query_port.3
28===================================================================
29--- libibverbs.orig/man/ibv_query_port.3	2010-06-08 11:08:57.951172000 +0300
30+++ libibverbs/man/ibv_query_port.3	2010-06-08 11:09:10.177543000 +0300
31@@ -44,6 +44,7 @@ uint8_t                 init_type_reply;
32 uint8_t                 active_width;   /* Currently active link width */
33 uint8_t                 active_speed;   /* Currently active link speed */
34 uint8_t                 phys_state;     /* Physical port state */
35+uint8_t                 link_layer;     /* link layer protocol of the port */
36 .in -8
37 };
38 .sp
39Index: libibverbs/src/cmd.c
40===================================================================
41--- libibverbs.orig/src/cmd.c	2010-06-08 11:08:57.999167000 +0300
42+++ libibverbs/src/cmd.c	2010-06-08 11:09:10.186539000 +0300
43@@ -196,6 +196,7 @@ int ibv_cmd_query_port(struct ibv_contex
44 	port_attr->active_width    = resp.active_width;
45 	port_attr->active_speed    = resp.active_speed;
46 	port_attr->phys_state      = resp.phys_state;
47+	port_attr->link_layer      = resp.link_layer;
48 
49 	return 0;
50 }
51