]> git.openfabrics.org - ~shefty/libibverbs.git/commitdiff
Deprecate "ib_XXX" names
authorRoland Dreier <rolandd@cisco.com>
Tue, 11 Apr 2006 21:41:11 +0000 (21:41 +0000)
committerRoland Dreier <rolandd@cisco.com>
Thu, 9 Nov 2006 19:36:00 +0000 (11:36 -0800)
Deprecate various "ib_XXX" names (introduced as part of SA and
marshalling code).  Preferred versions like "ibv_XXX" are now
available.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
ChangeLog
include/infiniband/marshall.h
include/infiniband/sa-kern-abi.h
include/infiniband/sa.h
src/libibverbs.map
src/marshall.c

index 5fa558c139e84a4ae000b2330f07df0d08c7d18d..8acd8b5dd6d6aac780f3ce590ca6fad9ed61e861 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2006-04-11  Roland Dreier  <rdreier@cisco.com>
+
+       * include/infiniband/sa-kern-abi.h: Deprecate struct
+       ib_kern_path_rec name; struct ibv_kern_path_rec is now preferred.
+
+       * include/infiniband/sa.h: Deprecate struct ib_sa_XXX names;
+       struct ibv_sa_XXX is now preferred.
+
+       * src/marshall.c, include/infiniband/marshall.h: Deprecate
+       ib_copy_XXX() names; ibv_copy_XXX() is preferred.  Add stub
+       wrappers with the old names so old binaries still work.
+
 2006-04-11  Hoang-Nam Nguyen  <HNGUYEN@de.ibm.com>
 
        * src/verbs.c (ibv_rate_to_mult, mult_to_ibv_rate): Add new
index d6bd38f1b753615ef3c9dae53b3d69735965def1..fe2bb1e18e8ce790a26f7f68c8dc58dba3142268 100644 (file)
 #  define END_C_DECLS
 #endif /* __cplusplus */
 
+#if __GNUC__ >= 3
+#  define __attribute_deprecated       __attribute__((deprecated))
+#else
+#  define __attribute_deprecated
+#endif
+
 BEGIN_C_DECLS
 
+void ibv_copy_qp_attr_from_kern(struct ibv_qp_attr *dst,
+                               struct ibv_kern_qp_attr *src);
+
+void ibv_copy_path_rec_from_kern(struct ibv_sa_path_rec *dst,
+                                struct ibv_kern_path_rec *src);
+
+void ibv_copy_path_rec_to_kern(struct ibv_kern_path_rec *dst,
+                              struct ibv_sa_path_rec *src);
+
+/*
+ * Obsolete, deprecated names.  Will be removed in libibverbs 1.1.
+ */
+
 void ib_copy_qp_attr_from_kern(struct ibv_qp_attr *dst,
-                              struct ibv_kern_qp_attr *src);
+                              struct ibv_kern_qp_attr *src) __attribute_deprecated;
 
 void ib_copy_path_rec_from_kern(struct ib_sa_path_rec *dst,
-                               struct ib_kern_path_rec *src);
+                               struct ib_kern_path_rec *src) __attribute_deprecated;
 
 void ib_copy_path_rec_to_kern(struct ib_kern_path_rec *dst,
-                             struct ib_sa_path_rec *src);
+                             struct ib_sa_path_rec *src) __attribute_deprecated;
 
 END_C_DECLS
 
+#undef __attribute_deprecated
+
 #endif /* INFINIBAND_MARSHALL_H */
index fe1155ea7270bbf23740fe1c2e35fa051afaa302..4927d114ea0fa25655bad198073af4095306666c 100644 (file)
  * SOFTWARE.
  */
 
-#ifndef SA_KERN_ABI_H
-#define SA_KERN_ABI_H
+#ifndef INFINIBAND_SA_KERN_ABI_H
+#define INFINIBAND_SA_KERN_ABI_H
 
 #include <linux/types.h>
 
-struct ib_kern_path_rec {
+/*
+ * Obsolete, deprecated names.  Will be removed in libibverbs 1.1.
+ */
+#define ib_kern_path_rec       ibv_kern_path_rec
+
+struct ibv_kern_path_rec {
        __u8  dgid[16];
        __u8  sgid[16];
        __u16 dlid;
@@ -57,4 +62,4 @@ struct ib_kern_path_rec {
        __u8  preference;
 };
 
-#endif /* SA_KERN_ABI_H */
+#endif /* INFINIBAND_SA_KERN_ABI_H */
index 951da373d0165666dd533ee3c1dc53163c77f994..dc2f3b5146c646545dfdcdbe156871d6a9d799e4 100644 (file)
  * $Id: sa.h 2616 2005-06-15 15:22:39Z halr $
  */
 
-#ifndef IB_SA_H
-#define IB_SA_H
+#ifndef INFINIBAND_SA_H
+#define INFINIBAND_SA_H
 
 #include <infiniband/verbs.h>
 
-enum ib_sa_rate {
-       IB_SA_RATE_2_5_GBPS = 2,
-       IB_SA_RATE_5_GBPS   = 5,
-       IB_SA_RATE_10_GBPS  = 3,
-       IB_SA_RATE_20_GBPS  = 6,
-       IB_SA_RATE_30_GBPS  = 4,
-       IB_SA_RATE_40_GBPS  = 7,
-       IB_SA_RATE_60_GBPS  = 8,
-       IB_SA_RATE_80_GBPS  = 9,
-       IB_SA_RATE_120_GBPS = 10
-};
-
-static inline int ib_sa_rate_enum_to_int(enum ib_sa_rate rate)
-{
-       switch (rate) {
-       case IB_SA_RATE_2_5_GBPS: return  1;
-       case IB_SA_RATE_5_GBPS:   return  2;
-       case IB_SA_RATE_10_GBPS:  return  4;
-       case IB_SA_RATE_20_GBPS:  return  8;
-       case IB_SA_RATE_30_GBPS:  return 12;
-       case IB_SA_RATE_40_GBPS:  return 16;
-       case IB_SA_RATE_60_GBPS:  return 24;
-       case IB_SA_RATE_80_GBPS:  return 32;
-       case IB_SA_RATE_120_GBPS: return 48;
-       default:                  return -1;
-       }
-}
+/*
+ * Obsolete, deprecated names.  Will be removed in libibverbs 1.1.
+ */
+#define ib_sa_path_rec         ibv_sa_path_rec
+#define ib_sa_mcmember_rec     ibv_sa_mcmember_rec
+#define ib_sa_service_rec      ibv_sa_service_rec
 
-struct ib_sa_path_rec {
+struct ibv_sa_path_rec {
        /* reserved */
        /* reserved */
        union ibv_gid dgid;
@@ -92,7 +71,7 @@ struct ib_sa_path_rec {
        uint8_t       preference;
 };
 
-struct ib_sa_mcmember_rec {
+struct ibv_sa_mcmember_rec {
        union ibv_gid mgid;
        union ibv_gid port_gid;
        uint32_t      qkey;
@@ -113,7 +92,7 @@ struct ib_sa_mcmember_rec {
        int           proxy_join;
 };
 
-struct ib_sa_service_rec {
+struct ibv_sa_service_rec {
        uint64_t      id;
        union ibv_gid gid;
        uint16_t      pkey;
@@ -127,4 +106,4 @@ struct ib_sa_service_rec {
        uint64_t      data64[2];
 };
 
-#endif /* IB_SA_H */
+#endif /* INFINIBAND_SA_H */
index 807a9d6d452f7ae4b095d6d1726c63a48d49bdd3..29eb220a44433b233eaeb1ed9e51d392b2182312 100644 (file)
@@ -64,10 +64,13 @@ IBVERBS_1.0 {
                ibv_cmd_destroy_ah;
                ibv_cmd_attach_mcast;
                ibv_cmd_detach_mcast;
+               ibv_copy_qp_attr_from_kern;
+               ibv_copy_path_rec_from_kern;
+               ibv_copy_path_rec_to_kern;
+               ibv_rate_to_mult;
+               mult_to_ibv_rate;
                ib_copy_qp_attr_from_kern;
                ib_copy_path_rec_from_kern;
                ib_copy_path_rec_to_kern;
-               ibv_rate_to_mult;
-               mult_to_ibv_rate;
        local: *;
 };
index 6f6c38790a525000cd458e83a1876e33dc0577b7..1284f64b6001f4565de98938f8c79006444407bc 100644 (file)
@@ -36,8 +36,8 @@
 
 #include <infiniband/marshall.h>
 
-static void ib_copy_ah_attr_from_kern(struct ibv_ah_attr *dst,
-                                     struct ibv_kern_ah_attr *src)
+static void ibv_copy_ah_attr_from_kern(struct ibv_ah_attr *dst,
+                                      struct ibv_kern_ah_attr *src)
 {
        memcpy(dst->grh.dgid.raw, src->grh.dgid, sizeof dst->grh.dgid);
        dst->grh.flow_label = src->grh.flow_label;
@@ -53,8 +53,8 @@ static void ib_copy_ah_attr_from_kern(struct ibv_ah_attr *dst,
        dst->port_num = src->port_num;
 }
 
-void ib_copy_qp_attr_from_kern(struct ibv_qp_attr *dst,
-                              struct ibv_kern_qp_attr *src)
+void ibv_copy_qp_attr_from_kern(struct ibv_qp_attr *dst,
+                               struct ibv_kern_qp_attr *src)
 {
        dst->cur_qp_state = src->cur_qp_state;
        dst->path_mtu = src->path_mtu;
@@ -71,8 +71,8 @@ void ib_copy_qp_attr_from_kern(struct ibv_qp_attr *dst,
        dst->cap.max_recv_sge = src->max_recv_sge;
        dst->cap.max_inline_data = src->max_inline_data;
 
-       ib_copy_ah_attr_from_kern(&dst->ah_attr, &src->ah_attr);
-       ib_copy_ah_attr_from_kern(&dst->alt_ah_attr, &src->alt_ah_attr);
+       ibv_copy_ah_attr_from_kern(&dst->ah_attr, &src->ah_attr);
+       ibv_copy_ah_attr_from_kern(&dst->alt_ah_attr, &src->alt_ah_attr);
 
        dst->pkey_index = src->pkey_index;
        dst->alt_pkey_index = src->alt_pkey_index;
@@ -89,8 +89,8 @@ void ib_copy_qp_attr_from_kern(struct ibv_qp_attr *dst,
        dst->alt_timeout = src->alt_timeout;
 }
 
-void ib_copy_path_rec_from_kern(struct ib_sa_path_rec *dst,
-                               struct ib_kern_path_rec *src)
+void ibv_copy_path_rec_from_kern(struct ibv_sa_path_rec *dst,
+                                struct ibv_kern_path_rec *src)
 {
        memcpy(dst->dgid.raw, src->dgid, sizeof dst->dgid);
        memcpy(dst->sgid.raw, src->sgid, sizeof dst->sgid);
@@ -114,8 +114,8 @@ void ib_copy_path_rec_from_kern(struct ib_sa_path_rec *dst,
        dst->packet_life_time_selector = src->packet_life_time_selector;
 }
 
-void ib_copy_path_rec_to_kern(struct ib_kern_path_rec *dst,
-                             struct ib_sa_path_rec *src)
+void ibv_copy_path_rec_to_kern(struct ibv_kern_path_rec *dst,
+                              struct ibv_sa_path_rec *src)
 {
        memcpy(dst->dgid, src->dgid.raw, sizeof src->dgid);
        memcpy(dst->sgid, src->sgid.raw, sizeof src->sgid);
@@ -138,3 +138,21 @@ void ib_copy_path_rec_to_kern(struct ib_kern_path_rec *dst,
        dst->preference         = src->preference;
        dst->packet_life_time_selector = src->packet_life_time_selector;
 }
+
+void ib_copy_qp_attr_from_kern(struct ibv_qp_attr *dst,
+                              struct ibv_kern_qp_attr *src)
+{
+       return ibv_copy_qp_attr_from_kern(dst, src);
+}
+
+void ib_copy_path_rec_from_kern(struct ib_sa_path_rec *dst,
+                               struct ib_kern_path_rec *src)
+{
+       return ibv_copy_path_rec_from_kern(dst, src);
+}
+
+void ib_copy_path_rec_to_kern(struct ib_kern_path_rec *dst,
+                             struct ib_sa_path_rec *src)
+{
+       return ibv_copy_path_rec_to_kern(dst, src);
+}