[openib-general] [PATCH] get rid of some more typedefs in ip2pr_export.h
Tom Duffy
Tom.Duffy at Sun.COM
Wed Aug 4 13:54:42 PDT 2004
Signed-by: Tom Duffy <tduffy at sun.com> with permission from Sun Legal.
Index: drivers/infiniband/ulp/ipoib/ip2pr_export.h
===================================================================
--- drivers/infiniband/ulp/ipoib/ip2pr_export.h (revision 583)
+++ drivers/infiniband/ulp/ipoib/ip2pr_export.h (working copy)
@@ -33,7 +33,7 @@
/*
* address resolution ID
*/
-typedef tUINT64 tIP2PR_PATH_LOOKUP_ID;
+typedef u64 tIP2PR_PATH_LOOKUP_ID;
/*
* invalid address resolution ID
*/
@@ -41,21 +41,21 @@
/*
* address resolved completion function.
*/
-typedef tINT32(*tIP2PR_PATH_LOOKUP_FUNC) (tIP2PR_PATH_LOOKUP_ID plid,
- tINT32 status,
- tUINT32 src_addr,
- tUINT32 dst_addr,
- tTS_IB_PORT hw_port,
- struct ib_device *ca,
- struct ib_path_record *path,
- tPTR usr_arg);
+typedef s32(*tIP2PR_PATH_LOOKUP_FUNC) (tIP2PR_PATH_LOOKUP_ID plid,
+ s32 status,
+ u32 src_addr,
+ u32 dst_addr,
+ tTS_IB_PORT hw_port,
+ struct ib_device *ca,
+ struct ib_path_record *path,
+ tPTR usr_arg);
-typedef tINT32(*tGID2PR_LOOKUP_FUNC) (tIP2PR_PATH_LOOKUP_ID plid,
- tINT32 status,
- tTS_IB_PORT hw_port,
- struct ib_device *ca,
- struct ib_path_record *path,
- tPTR usr_arg);
+typedef s32(*tGID2PR_LOOKUP_FUNC) (tIP2PR_PATH_LOOKUP_ID plid,
+ s32 status,
+ tTS_IB_PORT hw_port,
+ struct ib_device *ca,
+ struct ib_path_record *path,
+ tPTR usr_arg);
/*
* address lookup initiation.
*
@@ -67,32 +67,37 @@
* arg - supplied argument is returned in callback function
* plid - pointer to storage for identifier of this query.
*/
-tINT32 tsIp2prPathRecordLookup(tUINT32 dst_addr, /* NBO */
- tUINT32 src_addr, /* NBO */
- tUINT8 localroute,
- tINT32 bound_dev_if,
- tIP2PR_PATH_LOOKUP_FUNC func,
- tPTR arg, tIP2PR_PATH_LOOKUP_ID * plid);
+s32 tsIp2prPathRecordLookup(u32 dst_addr, /* NBO */
+ u32 src_addr, /* NBO */
+ u8 localroute,
+ s32 bound_dev_if,
+ tIP2PR_PATH_LOOKUP_FUNC func,
+ tPTR arg,
+ tIP2PR_PATH_LOOKUP_ID *plid);
+
/*
* address lookup cancel
*/
-tINT32 tsIp2prPathRecordCancel(tIP2PR_PATH_LOOKUP_ID plid);
+s32 tsIp2prPathRecordCancel(tIP2PR_PATH_LOOKUP_ID plid);
+
/*
* Giver a Source and Destination GID, get the path record
*/
-tINT32 tsGid2prLookup
- (tTS_IB_GID src_gid,
- tTS_IB_GID dst_gid,
- u16 pkey,
- tGID2PR_LOOKUP_FUNC func, tPTR arg, tIP2PR_PATH_LOOKUP_ID * plid);
-tINT32 tsGid2prCancel(tIP2PR_PATH_LOOKUP_ID plid);
+s32 tsGid2prLookup(tTS_IB_GID src_gid,
+ tTS_IB_GID dst_gid,
+ u16 pkey,
+ tGID2PR_LOOKUP_FUNC func,
+ tPTR arg,
+ tIP2PR_PATH_LOOKUP_ID * plid);
+
+s32 tsGid2prCancel(tIP2PR_PATH_LOOKUP_ID plid);
#endif
-struct tIP2PR_LOOKUP_PARAM_STRUCT {
- tUINT32 dst_addr;
+struct ip2pr_lookup_param {
+ u32 dst_addr;
struct ib_path_record *path_record;
};
-struct tGID2PR_LOOKUP_PARAM_STRUCT {
+struct gid2pr_lookup_param {
tTS_IB_GID src_gid;
tTS_IB_GID dst_gid;
u16 pkey;
@@ -100,10 +105,6 @@
tTS_IB_PORT port;
struct ib_path_record *path_record;
};
-typedef struct tIP2PR_LOOKUP_PARAM_STRUCT tIP2PR_LOOKUP_PARAM_STRUCT,
- *tIP2PR_LOOKUP_PARAM;
-typedef struct tGID2PR_LOOKUP_PARAM_STRUCT tGID2PR_LOOKUP_PARAM_STRUCT,
- *tGID2PR_LOOKUP_PARAM;
#define IP2PR_IOC_MAGIC 100
#define IP2PR_IOC_LOOKUP_REQ _IOWR(IP2PR_IOC_MAGIC, 0, void *)
Index: drivers/infiniband/ulp/ipoib/ip2pr_link.c
===================================================================
--- drivers/infiniband/ulp/ipoib/ip2pr_link.c (revision 583)
+++ drivers/infiniband/ulp/ipoib/ip2pr_link.c (working copy)
@@ -2410,14 +2410,15 @@
s32 _tsIp2prUserLookup(unsigned long arg)
{
struct ip2pr_user_req *ureq;
- tIP2PR_LOOKUP_PARAM_STRUCT param;
+ struct ip2pr_lookup_param param;
s32 status;
tIP2PR_PATH_LOOKUP_ID plid;
if (0 == arg) {
return (-EINVAL);
}
- if (copy_from_user(¶m, (tIP2PR_LOOKUP_PARAM) arg, sizeof(param))) {
+ if (copy_from_user(¶m, (struct ip2pr_lookup_param *) arg,
+ sizeof(param))) {
return (-EFAULT);
}
if (NULL == param.path_record) {
@@ -2462,8 +2463,7 @@
s32 _tsGid2prUserLookup(unsigned long arg)
{
struct ip2pr_user_req *ureq;
- tGID2PR_LOOKUP_PARAM_STRUCT param;
- tGID2PR_LOOKUP_PARAM upa;
+ struct gid2pr_lookup_param param, *upa;
s32 status;
tIP2PR_PATH_LOOKUP_ID plid;
@@ -2471,7 +2471,7 @@
return (-EINVAL);
}
- if (copy_from_user(¶m, (tGID2PR_LOOKUP_PARAM) arg,
+ if (copy_from_user(¶m, (struct gid2pr_lookup_param *) arg,
sizeof(param))) {
return (-EFAULT);
}
@@ -2505,7 +2505,7 @@
return (-EHOSTUNREACH);
}
- upa = (tGID2PR_LOOKUP_PARAM) arg;
+ upa = (struct gid2pr_lookup_param *) arg;
copy_to_user(&upa->device, &ureq->device, sizeof(upa->device));
copy_to_user(&upa->port, &ureq->port, sizeof(upa->port));
copy_to_user(param.path_record, &ureq->path_record,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.openfabrics.org/pipermail/general/attachments/20040804/91a4caaa/attachment.sig>
More information about the general
mailing list