From patchwork Thu Aug 26 14:19:30 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Cohen X-Patchwork-Id: 134931 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o7QEHLNf017876 for ; Thu, 26 Aug 2010 14:19:28 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753848Ab0HZOT1 (ORCPT ); Thu, 26 Aug 2010 10:19:27 -0400 Received: from mail-bw0-f46.google.com ([209.85.214.46]:32941 "EHLO mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753794Ab0HZOT1 (ORCPT ); Thu, 26 Aug 2010 10:19:27 -0400 Received: by mail-bw0-f46.google.com with SMTP id 11so1108123bwz.19 for ; Thu, 26 Aug 2010 07:19:26 -0700 (PDT) Received: by 10.204.76.205 with SMTP id d13mr6410905bkk.93.1282832365739; Thu, 26 Aug 2010 07:19:25 -0700 (PDT) Received: from localhost ([82.166.227.17]) by mx.google.com with ESMTPS id bq20sm1689978bkb.16.2010.08.26.07.19.24 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 26 Aug 2010 07:19:25 -0700 (PDT) Date: Thu, 26 Aug 2010 17:19:30 +0300 From: Eli Cohen To: Roland Dreier Cc: RDMA list Subject: [PATCHv10 1/4] libibverbs: Add link layer field to ibv_port_attr Message-ID: <20100826141930.GN8795@mtldesk30> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Thu, 26 Aug 2010 14:19:28 +0000 (UTC) diff --git a/include/infiniband/verbs.h b/include/infiniband/verbs.h index 0f1cb2e..17df3ff 100644 --- a/include/infiniband/verbs.h +++ b/include/infiniband/verbs.h @@ -161,6 +161,12 @@ enum ibv_port_state { IBV_PORT_ACTIVE_DEFER = 5 }; +enum { + IBV_LINK_LAYER_UNSPECIFIED, + IBV_LINK_LAYER_INFINIBAND, + IBV_LINK_LAYER_ETHERNET, +}; + struct ibv_port_attr { enum ibv_port_state state; enum ibv_mtu max_mtu; @@ -181,6 +187,8 @@ struct ibv_port_attr { uint8_t active_width; uint8_t active_speed; uint8_t phys_state; + uint8_t link_layer; + uint8_t pad; }; enum ibv_event_type { @@ -693,6 +701,16 @@ struct ibv_context { void *abi_compat; }; +static inline int ___ibv_query_port(struct ibv_context *context, + uint8_t port_num, + struct ibv_port_attr *port_attr) +{ + port_attr->link_layer = IBV_LINK_LAYER_UNSPECIFIED; + port_attr->pad = 0; + + return context->ops.query_port(context, port_num, port_attr); +} + /** * ibv_get_device_list - Get list of IB devices currently available * @num_devices: optional. if non-NULL, set to the number of devices @@ -1097,4 +1115,7 @@ END_C_DECLS # undef __attribute_const +#define ibv_query_port(context, port_num, port_attr) \ + ___ibv_query_port(context, port_num, port_attr) + #endif /* INFINIBAND_VERBS_H */