From patchwork Sat Jun 22 21:47:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ira Weiny X-Patchwork-Id: 2766611 X-Patchwork-Delegate: hal@mellanox.com Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id AD156C0AB1 for ; Sat, 22 Jun 2013 21:47:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E546920115 for ; Sat, 22 Jun 2013 21:47:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 073CD20113 for ; Sat, 22 Jun 2013 21:47:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751361Ab3FVVrf (ORCPT ); Sat, 22 Jun 2013 17:47:35 -0400 Received: from mga01.intel.com ([192.55.52.88]:59051 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751032Ab3FVVrf (ORCPT ); Sat, 22 Jun 2013 17:47:35 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 22 Jun 2013 14:47:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.87,920,1363158000"; d="scan'208";a="358036508" Received: from scvm10.sc.intel.com ([10.82.195.27]) by fmsmga002.fm.intel.com with SMTP; 22 Jun 2013 14:47:13 -0700 Date: Sat, 22 Jun 2013 14:47:13 -0700 From: Ira Weiny To: linux-rdma@vger.kernel.org Cc: Hal Rosenstock Subject: [PATCH] libibumad: add ClassPortInfo struct Message-Id: <20130622144713.806a3988582a9d1156fbad43@intel.com> X-Mailer: Sylpheed 3.3.0 (GTK+ 2.18.9; x86_64-unknown-linux-gnu) Mime-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Ira Weiny --- include/infiniband/umad_types.h | 33 +++++++++++++++++++++++++++++++++ 1 files changed, 33 insertions(+), 0 deletions(-) diff --git a/include/infiniband/umad_types.h b/include/infiniband/umad_types.h index 32c747a..2d7c8cd 100644 --- a/include/infiniband/umad_types.h +++ b/include/infiniband/umad_types.h @@ -167,5 +167,38 @@ enum { UMAD_OPENIB_OUI = 0x001405 }; +enum { + UMAD_CLASS_RESP_TIME_MASK = 0x1F +}; +struct umad_class_port_info { + uint8_t base_ver; + uint8_t class_ver; + be16_t cap_mask; + be32_t cap_mask2_resp_time; + uint8_t redir_gid[16]; /* network byte order */ + be32_t redir_tc_sl_fl; + be16_t redir_lid; + be16_t redir_pkey; + be32_t redir_qp; + be32_t redir_qkey; + uint8_t trap_gid[16]; /* network byte order */ + be32_t trap_tc_sl_fl; + be16_t trap_lid; + be16_t trap_pkey; + be32_t trap_hop_qp; + be32_t trap_qkey; +}; +static inline uint32_t +umad_class_cap_mask2(struct umad_class_port_info *cpi) +{ + return (ntohl(cpi->cap_mask2_resp_time) >> 5); +} +static inline uint8_t +umad_class_resp_time(struct umad_class_port_info *cpi) +{ + return (uint8_t)(ntohl(cpi->cap_mask2_resp_time) + & UMAD_CLASS_RESP_TIME_MASK); +} + END_C_DECLS #endif /* _UMAD_TYPES_H */