00001
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #ifndef _OQ_KMOD_H_
00037 # define _OQ_KMOD_H_
00038
00039 # include <linux/cdev.h>
00040 # include <linux/list.h>
00041
00042 # include <orbisquartus.h>
00043
00044
00045 # define OQ_LOG_ITEM_SIZE 4000
00046 # define OQ_LOG_SIZE 1000
00047
00048
00049
00050 struct oq_log_item {
00051 void **data;
00052 struct oq_log_item *next;
00053 };
00054
00055 struct oq_dev {
00056 struct oq_log_item *data;
00057 unsigned long size;
00058 unsigned int access_key;
00059 struct semaphore sem;
00060 struct cdev cdev;
00061 };
00062
00063
00064 loff_t oq_llseek(struct file *filp, loff_t pos, int where);
00065 ssize_t oq_read(struct file *filp, char __user *buf, size_t count,
00066 loff_t *f_pos);
00067 ssize_t oq_write(struct file *filp, const char __user *buf, size_t count,
00068 loff_t *f_pos);
00069 int oq_ioctl(struct inode *inode, struct file *filp,
00070 unsigned int cmd, unsigned long arg);
00071 int oq_open(struct inode *inode, struct file *filp);
00072 int oq_release(struct inode *inode, struct file *filp);
00073
00074 int OQ_LOG(const char *fmt, ...);
00075
00076
00077 struct arriving_pkt {
00078 struct list_head list;
00079 unsigned int packet_id;
00080 unsigned long release_time;
00081 unsigned long latency;
00082 };
00083
00084 int init_simulator_iface(int test);
00085 void shutdown_simulator_iface(void);
00086
00087
00088 #endif