From patchwork Mon Jan 28 21:38:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hefty, Sean" X-Patchwork-Id: 2058371 X-Patchwork-Delegate: hal@mellanox.com Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 3983BDF2A1 for ; Mon, 28 Jan 2013 21:39:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754477Ab3A1VjO (ORCPT ); Mon, 28 Jan 2013 16:39:14 -0500 Received: from mga09.intel.com ([134.134.136.24]:42435 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754492Ab3A1VjL (ORCPT ); Mon, 28 Jan 2013 16:39:11 -0500 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 28 Jan 2013 13:38:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.84,554,1355126400"; d="scan'208";a="277656213" Received: from cst-linux.jf.intel.com ([10.23.221.68]) by orsmga002.jf.intel.com with ESMTP; 28 Jan 2013 13:39:10 -0800 From: sean.hefty@intel.com To: linux-rdma@vger.kernel.org, alexne@mellanox.com Cc: Sean Hefty Subject: [PATCH 6/7] libibumad: Define ntohll/htonll Date: Mon, 28 Jan 2013 13:38:54 -0800 Message-Id: <1359409135-559-6-git-send-email-sean.hefty@intel.com> X-Mailer: git-send-email 1.7.3 In-Reply-To: <1359409135-559-1-git-send-email-sean.hefty@intel.com> References: <1359409135-559-1-git-send-email-sean.hefty@intel.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Sean Hefty 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 | 15 +++++++++++++-- 1 files changed, 13 insertions(+), 2 deletions(-) diff --git a/include/infiniband/umad.h b/include/infiniband/umad.h index 23abf0d..08fff71 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,16 @@ static inline void umad_free(void *umad) free(umad); } +#ifndef ntohll + #if __BYTE_ORDER == __LITTLE_ENDIAN + #define ntohll(x) bswap_64(x) + #elif __BYTE_ORDER == __BIG_ENDIAN + #define ntohll(x) x + #endif +#endif +#ifndef htonll + #define htonll ntohll +#endif + END_C_DECLS #endif /* _UMAD_H */