1 #ifndef _KPING_INCLUDED
2 #define _KPING_INCLUDED
4 #include <portals/p30.h>
7 #define PTL_PING_IN_SIZE 256 // n packets per buffer
8 #define PTL_PING_IN_BUFFERS 2 // n fallback buffers
10 #define PTL_PING_CLIENT 4
11 #define PTL_PING_SERVER 5
13 #define PING_HEADER_MAGIC 0xDEADBEEF
14 #define PING_BULK_MAGIC 0xCAFEBABE
16 #define PING_HEAD_BITS 0x00000001
17 #define PING_BULK_BITS 0x00000002
18 #define PING_IGNORE_BITS 0xFFFFFFFC
20 #define PTL_PING_ACK 0x01
21 #define PTL_PING_VERBOSE 0x02
22 #define PTL_PING_VERIFY 0x04
23 #define PTL_PING_PREALLOC 0x08
26 #define NEXT_PRIMARY_BUFFER(index) \
27 (((index + 1) >= PTL_PING_IN_BUFFERS) ? 0 : (index + 1))
29 #define PDEBUG(str, err) \
30 CERROR ("%s: error=%s (%d)\n", str, ptl_err_str[err], err)
33 /* Ping data to be passed via the ioctl to kernel space */
38 #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
39 #include <linux/workqueue.h>
41 #include <linux/tqueue.h>
49 ptl_process_id_t my_id;
50 ptl_process_id_t id_local;
53 ptl_handle_md_t mdin_h;
54 ptl_handle_md_t mdout_h;
56 struct task_struct *tsk;
57 }; /* struct pingsrv_data */
61 struct portal_ioctl_data *args;
66 ptl_process_id_t myid;
67 ptl_process_id_t id_local;
68 ptl_process_id_t id_remote;
71 ptl_handle_md_t md_in_head_h;
72 ptl_handle_md_t md_out_head_h;
74 struct task_struct *tsk;
75 }; /* struct pingcli_data */
78 #endif /* __KERNEL__ */
80 #endif /* _KPING_INCLUDED */