From owner-svn-src-projects@FreeBSD.ORG Fri Jan 28 02:12:43 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95FC81065670; Fri, 28 Jan 2011 02:12:43 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 82F978FC0C; Fri, 28 Jan 2011 02:12:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0S2ChRK051763; Fri, 28 Jan 2011 02:12:43 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0S2ChZG051752; Fri, 28 Jan 2011 02:12:43 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <201101280212.p0S2ChZG051752@svn.freebsd.org> From: Jeff Roberson Date: Fri, 28 Jan 2011 02:12:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218004 - in projects/ofed/head/contrib/ofed/dapl: dapl/openib_cma dapl/openib_cma/linux dapl/openib_scm dapl/openib_scm/linux dapl/openib_ucm/linux dapl/udapl/linux dat/include/dat2 da... X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 02:12:43 -0000 Author: jeff Date: Fri Jan 28 02:12:43 2011 New Revision: 218004 URL: http://svn.freebsd.org/changeset/base/218004 Log: - Port dapl include files to support freebsd. Sponsored by: Isilon Systems, iX Systems, and Panasas. Modified: projects/ofed/head/contrib/ofed/dapl/dapl/openib_cma/device.c projects/ofed/head/contrib/ofed/dapl/dapl/openib_cma/linux/openib_osd.h projects/ofed/head/contrib/ofed/dapl/dapl/openib_scm/device.c projects/ofed/head/contrib/ofed/dapl/dapl/openib_scm/linux/openib_osd.h projects/ofed/head/contrib/ofed/dapl/dapl/openib_ucm/linux/openib_osd.h projects/ofed/head/contrib/ofed/dapl/dapl/udapl/linux/dapl_osd.h projects/ofed/head/contrib/ofed/dapl/dat/include/dat2/dat_platform_specific.h projects/ofed/head/contrib/ofed/dapl/dat/udat/linux/dat_osd.h projects/ofed/head/contrib/ofed/dapl/test/dtest/dtest.c projects/ofed/head/contrib/ofed/dapl/test/dtest/dtestcm.c Modified: projects/ofed/head/contrib/ofed/dapl/dapl/openib_cma/device.c ============================================================================== --- projects/ofed/head/contrib/ofed/dapl/dapl/openib_cma/device.c Fri Jan 28 02:11:41 2011 (r218003) +++ projects/ofed/head/contrib/ofed/dapl/dapl/openib_cma/device.c Fri Jan 28 02:12:43 2011 (r218004) @@ -154,7 +154,9 @@ static int getipaddr_netdev(char *name, /* Fill in the structure */ snprintf(ifr.ifr_name, IFNAMSIZ, "%s", name); +#ifndef __FreeBSD__ ifr.ifr_hwaddr.sa_family = ARPHRD_INFINIBAND; +#endif /* Create a socket fd */ skfd = socket(PF_INET, SOCK_STREAM, 0); @@ -661,8 +663,8 @@ void dapli_thread(void *arg) /* work thread for uAT, uCM, CQ, and async events */ void dapli_thread(void *arg) { - struct pollfd ufds[__FD_SETSIZE]; - struct _ib_hca_transport *uhca[__FD_SETSIZE] = { NULL }; + struct pollfd ufds[FD_SETSIZE]; + struct _ib_hca_transport *uhca[FD_SETSIZE] = { NULL }; struct _ib_hca_transport *hca; int ret, idx, fds; char rbuf[2]; Modified: projects/ofed/head/contrib/ofed/dapl/dapl/openib_cma/linux/openib_osd.h ============================================================================== --- projects/ofed/head/contrib/ofed/dapl/dapl/openib_cma/linux/openib_osd.h Fri Jan 28 02:11:41 2011 (r218003) +++ projects/ofed/head/contrib/ofed/dapl/dapl/openib_cma/linux/openib_osd.h Fri Jan 28 02:12:43 2011 (r218004) @@ -1,7 +1,7 @@ #ifndef OPENIB_OSD_H #define OPENIB_OSD_H -#include +#include #include #if __BYTE_ORDER == __BIG_ENDIAN Modified: projects/ofed/head/contrib/ofed/dapl/dapl/openib_scm/device.c ============================================================================== --- projects/ofed/head/contrib/ofed/dapl/dapl/openib_scm/device.c Fri Jan 28 02:11:41 2011 (r218003) +++ projects/ofed/head/contrib/ofed/dapl/dapl/openib_scm/device.c Fri Jan 28 02:12:43 2011 (r218004) @@ -646,8 +646,8 @@ void dapli_thread(void *arg) /* work thread for uAT, uCM, CQ, and async events */ void dapli_thread(void *arg) { - struct pollfd ufds[__FD_SETSIZE]; - struct _ib_hca_transport *uhca[__FD_SETSIZE] = { NULL }; + struct pollfd ufds[FD_SETSIZE]; + struct _ib_hca_transport *uhca[FD_SETSIZE] = { NULL }; struct _ib_hca_transport *hca; int ret, idx, fds; char rbuf[2]; Modified: projects/ofed/head/contrib/ofed/dapl/dapl/openib_scm/linux/openib_osd.h ============================================================================== --- projects/ofed/head/contrib/ofed/dapl/dapl/openib_scm/linux/openib_osd.h Fri Jan 28 02:11:41 2011 (r218003) +++ projects/ofed/head/contrib/ofed/dapl/dapl/openib_scm/linux/openib_osd.h Fri Jan 28 02:12:43 2011 (r218004) @@ -1,7 +1,7 @@ #ifndef OPENIB_OSD_H #define OPENIB_OSD_H -#include +#include #include #if __BYTE_ORDER == __BIG_ENDIAN Modified: projects/ofed/head/contrib/ofed/dapl/dapl/openib_ucm/linux/openib_osd.h ============================================================================== --- projects/ofed/head/contrib/ofed/dapl/dapl/openib_ucm/linux/openib_osd.h Fri Jan 28 02:11:41 2011 (r218003) +++ projects/ofed/head/contrib/ofed/dapl/dapl/openib_ucm/linux/openib_osd.h Fri Jan 28 02:12:43 2011 (r218004) @@ -1,7 +1,9 @@ #ifndef OPENIB_OSD_H #define OPENIB_OSD_H -#include +#include +#include +#include #include #if __BYTE_ORDER == __BIG_ENDIAN Modified: projects/ofed/head/contrib/ofed/dapl/dapl/udapl/linux/dapl_osd.h ============================================================================== --- projects/ofed/head/contrib/ofed/dapl/dapl/udapl/linux/dapl_osd.h Fri Jan 28 02:11:41 2011 (r218003) +++ projects/ofed/head/contrib/ofed/dapl/dapl/udapl/linux/dapl_osd.h Fri Jan 28 02:12:43 2011 (r218004) @@ -45,9 +45,9 @@ * This file is defined for Linux systems only, including it on any * other build will cause an error */ -#ifndef __linux__ +#if !defined(__linux__) && !defined(__FreeBSD__) #error UNDEFINED OS TYPE -#endif /* __linux__ */ +#endif /* __linux__ || __freebsd__ */ #if !defined (__i386__) && !defined (__ia64__) && !defined(__x86_64__) && !defined(__PPC__) && !defined(__PPC64__) #error UNDEFINED ARCH @@ -67,7 +67,7 @@ #include #include #include /* for getaddrinfo */ -#include +#include #include /* for IOCTL's */ Modified: projects/ofed/head/contrib/ofed/dapl/dat/include/dat2/dat_platform_specific.h ============================================================================== --- projects/ofed/head/contrib/ofed/dapl/dat/include/dat2/dat_platform_specific.h Fri Jan 28 02:11:41 2011 (r218003) +++ projects/ofed/head/contrib/ofed/dapl/dat/include/dat2/dat_platform_specific.h Fri Jan 28 02:12:43 2011 (r218004) @@ -255,8 +255,46 @@ typedef PHYSICAL_ADDRESS DAT_PADDR; #endif /* __KDAPL__ */ /* Windoze ends */ +#elif defined(__FreeBSD__) +#include +#include +#include +#include +typedef u_int32_t DAT_UINT32; /* unsigned host order, 32 bits */ +typedef u_int64_t DAT_UINT64; /* unsigned host order, 64 bits */ +typedef unsigned long long DAT_UVERYLONG; /* unsigned longest native to compiler */ + +typedef void * DAT_PVOID; +typedef int DAT_COUNT; +typedef DAT_UINT64 DAT_PADDR; + +#ifndef UINT64_C +#define UINT64_C(c) c ## ULL +#endif /* UINT64_C */ + +#define DAT_IA_HANDLE_TO_UL(a) (unsigned long)(a) +#define DAT_UL_TO_IA_HANDLE(a) (DAT_IA_HANDLE)(a) + + +typedef struct dat_comm { + int domain; + int type; + int protocol; +} DAT_COMM; + +typedef int DAT_FD; /* DAT File Descriptor */ + +typedef struct sockaddr DAT_SOCK_ADDR; /* Socket address header native to OS */ +typedef struct sockaddr_in6 DAT_SOCK_ADDR6; /* Socket address header native to OS */ +#define DAT_AF_INET AF_INET +#define DAT_AF_INET6 AF_INET6 + +#define DAT_API +#define DAT_EXPORT extern + +/* Linux ends */ #else #error dat_platform_specific.h : OS type not defined #endif Modified: projects/ofed/head/contrib/ofed/dapl/dat/udat/linux/dat_osd.h ============================================================================== --- projects/ofed/head/contrib/ofed/dapl/dat/udat/linux/dat_osd.h Fri Jan 28 02:11:41 2011 (r218003) +++ projects/ofed/head/contrib/ofed/dapl/dat/udat/linux/dat_osd.h Fri Jan 28 02:12:43 2011 (r218004) @@ -48,9 +48,9 @@ * This file is defined for Linux systems only, including it on any * other build will cause an error */ -#ifndef __linux__ +#if defined(__linux__) || defined(__freebsd__) #error "UNDEFINED OS TYPE" -#endif /* __linux__ */ +#endif /* __linux__ || FreeBSD */ #include Modified: projects/ofed/head/contrib/ofed/dapl/test/dtest/dtest.c ============================================================================== --- projects/ofed/head/contrib/ofed/dapl/test/dtest/dtest.c Fri Jan 28 02:11:41 2011 (r218003) +++ projects/ofed/head/contrib/ofed/dapl/test/dtest/dtest.c Fri Jan 28 02:12:43 2011 (r218004) @@ -63,8 +63,8 @@ #else // _WIN32 || _WIN64 -#include -#include +#include +#include #include #include #include Modified: projects/ofed/head/contrib/ofed/dapl/test/dtest/dtestcm.c ============================================================================== --- projects/ofed/head/contrib/ofed/dapl/test/dtest/dtestcm.c Fri Jan 28 02:11:41 2011 (r218003) +++ projects/ofed/head/contrib/ofed/dapl/test/dtest/dtestcm.c Fri Jan 28 02:12:43 2011 (r218004) @@ -64,8 +64,8 @@ #else // _WIN32 || _WIN64 -#include -#include +#include +#include #include #include #include