qsup_mod.c File Reference

#include "qres_config.h"
#include <linux/aquosa/qos_debug.h>
#include <linux/kernel.h>
#include <linux/version.h>
#include <linux/module.h>
#include <linux/fs.h>
#include <asm/uaccess.h>
#include <linux/proc_fs.h>
#include "qsup_mod.h"
#include "qres_gw_ks.h"
#include "qsup_gw_ks.h"
#include <linux/aquosa/qos_kernel_dep.h>
#include <linux/aquosa/rres_interface.h>
#include <linux/aquosa/rres_proc_fs.h>

Go to the source code of this file.

Defines

#define QOS_DEBUG_LEVEL   QSUP_MOD_DEBUG_LEVEL
#define SUCCESS   0
#define BUF_LEN   80
#define DEBUG

Functions

static int qsup_device_open (struct inode *inode, struct file *file)
static int qsup_device_release (struct inode *inode, struct file *file)
 Called when device is closed by a process.
static ssize_t qsup_device_read (struct file *file, char __user *buffer, size_t length, loff_t *offset)
static ssize_t qsup_device_write (struct file *file, const char __user *buffer, size_t length, loff_t *offset)
int qsup_device_ioctl (struct inode *inode, struct file *file, unsigned int ioctl_num, unsigned long ioctl_param)
qos_rv qsup_dev_register (void)
 Device registration should be done when kernel module is already able to accept ioctl requests.
int qsup_init_module (void)
 Initialize the module - Register the character device.
qos_rv qsup_dev_unregister (void)
 Unregister the device.
void qsup_cleanup_module (void)
 Cleanup - unregister the appropriate file from /proc.
static int rres_read_qsup (char *page, char **start, off_t off, int count, int *eof, void *data)
 Show the list of all tasks served by any server.
int qsup_register_proc (void)
void qsup_proc_unregister (void)

Variables

static int qsup_Device_Open = 0
 Is the device open right now? Used to prevent concurent access into the same device.
struct file_operations qsup_Fops
static qos_dev_info_t qsup_dev_info
struct proc_dir_entry * qres_proc_root

Define Documentation

#define BUF_LEN   80

Definition at line 21 of file qsup_mod.c.

#define DEBUG

Definition at line 22 of file qsup_mod.c.

#define QOS_DEBUG_LEVEL   QSUP_MOD_DEBUG_LEVEL

Definition at line 2 of file qsup_mod.c.

#define SUCCESS   0

Definition at line 20 of file qsup_mod.c.


Function Documentation

void qsup_cleanup_module ( void   ) 

Cleanup - unregister the appropriate file from /proc.

Note:
Unused, so far.

Definition at line 176 of file qsup_mod.c.

References qos_log_err, QOS_OK, qos_strerror(), qsup_cleanup(), and qsup_dev_unregister().

qos_rv qsup_dev_register ( void   ) 

Device registration should be done when kernel module is already able to accept ioctl requests.

Definition at line 124 of file qsup_mod.c.

References qos_dev_info_t::dev_num, qos_dev_register(), qos_log_err, qos_log_info, QOS_OK, QSUP_DEV_NAME, qsup_Fops, and QSUP_MAJOR_NUM.

Referenced by qres_init_module(), and qsup_init_module().

qos_rv qsup_dev_unregister ( void   ) 

Unregister the device.

Definition at line 167 of file qsup_mod.c.

References qos_dev_unregister().

Referenced by qres_cleanup_module(), and qsup_cleanup_module().

int qsup_device_ioctl ( struct inode *  inode,
struct file *  file,
unsigned int  ioctl_num,
unsigned long  ioctl_param 
)

Definition at line 97 of file qsup_mod.c.

References qos_log_debug, qos_rv_int, qos_strerror(), and qsup_gw_ks().

static int qsup_device_open ( struct inode *  inode,
struct file *  file 
) [static]

Definition at line 33 of file qsup_mod.c.

References KERN_INCREMENT, qos_log_debug, qsup_Device_Open, and SUCCESS.

static ssize_t qsup_device_read ( struct file *  file,
char __user *  buffer,
size_t  length,
loff_t *  offset 
) [static]

Definition at line 58 of file qsup_mod.c.

References qos_log_debug.

static int qsup_device_release ( struct inode *  inode,
struct file *  file 
) [static]

Called when device is closed by a process.

Todo:
Either force destroy_server() to be called here, or intercept kill hook for handling premature process end.

Definition at line 46 of file qsup_mod.c.

References KERN_DECREMENT, qos_log_debug, qsup_Device_Open, and SUCCESS.

static ssize_t qsup_device_write ( struct file *  file,
const char __user *  buffer,
size_t  length,
loff_t *  offset 
) [static]

Definition at line 77 of file qsup_mod.c.

References qos_log_debug.

int qsup_init_module ( void   ) 

Initialize the module - Register the character device.

Note:
Unused, so far.

Definition at line 145 of file qsup_mod.c.

References qos_log_crit, qos_log_debug, QOS_OK, qos_strerror(), qsup_dev_register(), and qsup_init_ks().

void qsup_proc_unregister ( void   ) 

Definition at line 223 of file qsup_mod.c.

References qres_proc_root.

int qsup_register_proc ( void   ) 

Definition at line 212 of file qsup_mod.c.

References qres_proc_root, and rres_read_qsup().

static int rres_read_qsup ( char *  page,
char **  start,
off_t  off,
int  count,
int *  eof,
void *  data 
) [static]

Show the list of all tasks served by any server.

Definition at line 191 of file qsup_mod.c.

References qsup_dump(), rres_get_spinlock(), and sched_read_clock_us().

Referenced by qsup_register_proc().


Variable Documentation

struct proc_dir_entry* qres_proc_root

Definition at line 119 of file qsup_mod.c.

int qsup_Device_Open = 0 [static]

Is the device open right now? Used to prevent concurent access into the same device.

Definition at line 28 of file qsup_mod.c.

Referenced by qsup_device_open(), and qsup_device_release().

struct file_operations qsup_Fops
Initial value:
 {
        .read = qsup_device_read,
        .write = qsup_device_write,
        .ioctl = qsup_device_ioctl,
        .open = qsup_device_open,
        .release = qsup_device_release, 
}

Definition at line 111 of file qsup_mod.c.

Referenced by qsup_dev_register().

Generated on Mon Aug 2 22:39:17 2010 for qosres by  doxygen 1.6.3