Print this page
2976 remove useless offsetof() macros


  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
  24  */
  25 
  26 #ifndef _SYS_IB_CLIENTS_OF_SOL_OFS_SOL_CMA_H
  27 #define _SYS_IB_CLIENTS_OF_SOL_OFS_SOL_CMA_H
  28 
  29 #ifdef __cplusplus
  30 extern "C" {
  31 #endif
  32 

  33 
  34 #include <sys/ib/clients/of/sol_ofs/sol_ofs_common.h>
  35 #include <sys/ib/clients/of/rdma/rdma_cm.h>
  36 #include <sys/ib/clients/of/sol_ofs/sol_ib_cma.h> /* Transport Specific */
  37 
  38 #if !defined(offsetof)
  39 #define offsetof(s, m)          (size_t)(&(((s *)0)->m))
  40 #endif
  41 
  42 #define IS_UDP_CMID(idp)        ((idp)->ps == RDMA_PS_UDP || \
  43         (idp)->ps == RDMA_PS_IPOIB)
  44 #define IS_VALID_SOCKADDR(sockaddrp) \
  45         ((sockaddrp)->sa_family == AF_INET || \
  46         (sockaddrp)->sa_family == AF_INET6)
  47 
  48 /*
  49  * Global structure which contains information about all
  50  * CMIDs, which have called rdma_listen().
  51  */
  52 typedef struct sol_cma_glbl_listen_s {
  53         avl_node_t      cma_listen_node;
  54 
  55         uint64_t        cma_listen_chan_sid;
  56         void            *cma_listen_clnt_hdl;
  57         void            *cma_listen_svc_hdl;
  58         genlist_t       cma_listen_chan_list;
  59 } sol_cma_glbl_listen_t;
  60 




  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
  24  */
  25 
  26 #ifndef _SYS_IB_CLIENTS_OF_SOL_OFS_SOL_CMA_H
  27 #define _SYS_IB_CLIENTS_OF_SOL_OFS_SOL_CMA_H
  28 
  29 #ifdef __cplusplus
  30 extern "C" {
  31 #endif
  32 
  33 #include <sys/sysmacros.h>
  34 
  35 #include <sys/ib/clients/of/sol_ofs/sol_ofs_common.h>
  36 #include <sys/ib/clients/of/rdma/rdma_cm.h>
  37 #include <sys/ib/clients/of/sol_ofs/sol_ib_cma.h> /* Transport Specific */
  38 



  39 
  40 #define IS_UDP_CMID(idp)        ((idp)->ps == RDMA_PS_UDP || \
  41         (idp)->ps == RDMA_PS_IPOIB)
  42 #define IS_VALID_SOCKADDR(sockaddrp) \
  43         ((sockaddrp)->sa_family == AF_INET || \
  44         (sockaddrp)->sa_family == AF_INET6)
  45 
  46 /*
  47  * Global structure which contains information about all
  48  * CMIDs, which have called rdma_listen().
  49  */
  50 typedef struct sol_cma_glbl_listen_s {
  51         avl_node_t      cma_listen_node;
  52 
  53         uint64_t        cma_listen_chan_sid;
  54         void            *cma_listen_clnt_hdl;
  55         void            *cma_listen_svc_hdl;
  56         genlist_t       cma_listen_chan_list;
  57 } sol_cma_glbl_listen_t;
  58