From patchwork Thu Apr 28 23:04:59 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hefty, Sean" X-Patchwork-Id: 740041 X-Patchwork-Delegate: alexne@voltaire.com 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 p3SN1jd0003226 for ; Thu, 28 Apr 2011 23:05:03 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756604Ab1D1XFC (ORCPT ); Thu, 28 Apr 2011 19:05:02 -0400 Received: from mga09.intel.com ([134.134.136.24]:28811 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756565Ab1D1XFB convert rfc822-to-8bit (ORCPT ); Thu, 28 Apr 2011 19:05:01 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 28 Apr 2011 16:05:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.64,283,1301900400"; d="scan'208";a="739924323" Received: from orsmsx602.amr.corp.intel.com ([10.22.226.211]) by orsmga001.jf.intel.com with ESMTP; 28 Apr 2011 16:05:01 -0700 Received: from orsmsx601.amr.corp.intel.com (10.22.226.213) by orsmsx602.amr.corp.intel.com (10.22.226.211) with Microsoft SMTP Server (TLS) id 8.2.255.0; Thu, 28 Apr 2011 16:05:01 -0700 Received: from orsmsx501.amr.corp.intel.com ([10.22.226.209]) by orsmsx601.amr.corp.intel.com ([10.22.226.213]) with mapi; Thu, 28 Apr 2011 16:05:01 -0700 From: "Hefty, Sean" To: Alex Netes , linux-rdma Date: Thu, 28 Apr 2011 16:04:59 -0700 Subject: [PATCH 6/7] libibumad: Define ntohll/htonll Thread-Topic: [PATCH 6/7] libibumad: Define ntohll/htonll Thread-Index: AcwF+KOKjfxmrqQ9TUaZpwGmB1Rd+Q== Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 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.6 (demeter1.kernel.org [140.211.167.41]); Thu, 28 Apr 2011 23:05:03 +0000 (UTC) Users of umad require ntohll/htonll to set/extract data from MADs. Include the definition with umad, not just libibmad. Signed-off-by: Sean Hefty --- include/infiniband/umad.h | 21 +++++++++++++++++++-- 1 files changed, 19 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/include/infiniband/umad.h b/include/infiniband/umad.h index 23abf0d..6c337c0 100644 --- a/include/infiniband/umad.h +++ b/include/infiniband/umad.h @@ -35,6 +35,8 @@ #include #include +#include +#include #ifdef __cplusplus # define BEGIN_C_DECLS extern "C" { @@ -193,8 +195,6 @@ int umad_debug(int level); void umad_addr_dump(ib_mad_addr_t * addr); void umad_dump(void *umad); -#include - static inline void *umad_alloc(int num, size_t size) { /* alloc array of umad buffers */ return calloc(num, size); @@ -205,5 +205,22 @@ static inline void umad_free(void *umad) free(umad); } +#ifndef ntohll + #if __BYTE_ORDER == __LITTLE_ENDIAN + static inline uint64_t ntohll(uint64_t x) + { + return bswap_64(x); + } + #elif __BYTE_ORDER == __BIG_ENDIAN + static inline uint64_t ntohll(uint64_t x) + { + return x; + } + #endif +#endif +#ifndef htonll + #define htonll ntohll +#endif + END_C_DECLS #endif /* _UMAD_H */