[openib-general] modify_device API?
Sean Hefty
mshefty at ichips.intel.com
Thu Aug 19 08:58:49 PDT 2004
On Tue, 17 Aug 2004 14:49:01 -0700
Roland Dreier <roland at topspin.com> wrote:
> Sean> Patch is applied. I need to think about what to do about
> Sean> the ib_device_cap_flags and ib_device_modify_flags. Any
> Sean> thoughts?
>
> We could maybe use IB_DEV_CAP_ and IB_DEV_MOD_ as the prefixes...
Here's a patch that fixes the duplicate names and updates a couple of areas for consistency with other parts of the API/spec. I renamed the ib_device_cap and ib_port structures to ib_device_attr and ib_port_attr, respectively. I didn't see that these were in use in the checked-in mthca driver yet, so I didn't create a patch for those files.
Patch is not yet applied. Please respond with any comments.
- Sean
Index: ib_verbs.h
===================================================================
--- ib_verbs.h (revision 666)
+++ ib_verbs.h (working copy)
@@ -125,8 +125,8 @@
enum ib_device_cap_flags {
IB_DEVICE_RESIZE_MAX_WR = 1,
- IB_DEVICE_BAD_PKEY_CNT = (1<<1),
- IB_DEVICE_BAD_QKEY_CNT = (1<<2),
+ IB_DEVICE_BAD_PKEY_CNTR = (1<<1),
+ IB_DEVICE_BAD_QKEY_CNTR = (1<<2),
IB_DEVICE_RAW_MULTI = (1<<3),
IB_DEVICE_AUTO_PATH_MIG = (1<<4),
IB_DEVICE_CHANGE_PHY_PORT = (1<<5),
@@ -148,7 +148,7 @@
IB_ATOMIC_GLOB
};
-struct ib_device_cap {
+struct ib_device_attr {
u64 fw_ver;
u64 node_guid;
u64 sys_image_guid;
@@ -237,7 +237,7 @@
IB_PORT_BOOT_MGMT_SUP = (1<<9)
};
-struct ib_port {
+struct ib_port_attr {
enum ib_port_state state;
enum ib_mtu max_mtu;
enum ib_mtu active_mtu;
@@ -257,7 +257,7 @@
};
enum ib_device_modify_flags {
- IB_DEVICE_SYS_IMAGE_GUID = 1
+ IB_DEVICE_MODIFY_SYS_IMAGE_GUID = 1
};
struct ib_device_modify {
@@ -629,9 +629,9 @@
u32 flags;
int (*query_device)(struct ib_device *device,
- struct ib_device_cap *device_cap);
+ struct ib_device_attr *device_attr);
int (*query_port)(struct ib_device *device,
- u8 port_num, struct ib_port *port);
+ u8 port_num, struct ib_port_attr *port_attr);
int (*query_gid)(struct ib_device *device,
u8 port_num, int index,
union ib_gid *gid);
@@ -737,16 +737,16 @@
};
static inline int ib_query_device(struct ib_device *device,
- struct ib_device_cap *device_cap)
+ struct ib_device_attr *device_attr)
{
- return device->query_device(device, device_cap);
+ return device->query_device(device, device_attr);
}
static inline int ib_query_port(struct ib_device *device,
u8 port_num,
- struct ib_port *port)
+ struct ib_port_attr *port_attr)
{
- return device->query_port(device, port_num, port);
+ return device->query_port(device, port_num, port_attr);
}
static inline int ib_query_gid(struct ib_device *device,
More information about the general
mailing list