N-sim
Emulation and simulation of
Wireless Sensor Networks



   Home


   Project Page


   Download


   CVS



   Installation


   Configuration


   Plug-ins




 Hosted by
SourceForge.net Logo

/home/brennan/n-sim/OrbisQuartus/server/xen/backend/oq_kmod.h

Go to the documentation of this file.
00001 
00014 /*
00015  * Copyright 2007. Los Alamos National Security, LLC. This material
00016  * was produced under U.S. Government contract DE-AC52-06NA25396 for
00017  * Los Alamos National Laboratory (LANL), which is operated by Los
00018  * Alamos National Security, LLC, for the Department of Energy. The
00019  * U.S. Government has rights to use, reproduce, and distribute this
00020  * software. NEITHER THE GOVERNMENT NOR LOS ALAMOS NATIONAL SECURITY,
00021  * LLC, MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES ANY LEGAL
00022  * LIABILITY FOR THE USE OF THIS SOFTWARE. If software is modified to
00023  * produce derivative works, such modified software should be clearly
00024  * marked, so as not to confuse it with the version available from LANL.
00025  *
00026  * Additionally, this program is free software; you can redistribute
00027  * it and/or modify it under the terms of the GNU General Public
00028  * License as published by the Free Software Foundation; version 2 of
00029  * the License. Accordingly, this program is distributed in the hope
00030  * it will be useful, but WITHOUT ANY WARRANTY; without even the
00031  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00032  * PURPOSE. See the GNU General Public License for more details.
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                   /* _OQ_KMOD_H_ */


© 2007, Los Alamos National Security, LLC.