From 30be5238b22072e44c48ed363a3be3900efb20b1 Mon Sep 17 00:00:00 2001 From: ben Date: Mon, 9 Jul 2007 13:12:16 +0000 Subject: [PATCH] add the next directory entries git-svn-id: svn+ssh://en.codiert.org/home/staff/ben/dev/misc.svn/projects/fpgafs@356 766a2236-cff9-0310-b0c0-a81a5f92509a --- files.c | 30 ++++++++++++++++++++++++++++-- fpgafs.h | 6 ++++++ fpgafs_lldrv_cham.c | 4 +++- fpgafs_lldrv_dbg.c | 14 +++++++++++++- inode.c | 2 ++ llmgmt.c | 13 +++++++++++++ 6 files changed, 65 insertions(+), 4 deletions(-) diff --git a/files.c b/files.c index 8867a7a..a9c7c3c 100644 --- a/files.c +++ b/files.c @@ -76,12 +76,38 @@ static const struct file_operations fpgafs_cmd_fops = { .write = fpgafs_cmd_write, }; +static ssize_t fpgafs_load_read(struct file *file, char __user *buf, + size_t len, loff_t *pos) +{ + return 0; +} + +static ssize_t fpgafs_load_write(struct file *file, const char __user *buf, + size_t len, loff_t *pos) +{ + return 0; +} + +static const struct file_operations fpgafs_load_fops = { + .open = fpgafs_open, + .write = fpgafs_load_write, + .read = fpgafs_load_read, +}; + +static const struct file_operations fpgafs_din_fops = { + .open = fpgafs_open, + .read = fpgafs_recv_data, +}; + +static const struct file_operations fpgafs_dout_fops = { + .open = fpgafs_open, + .write = fpgafs_send_data, +}; + struct tree_descr fpgafs_dir_contents[] = { -#if 0 { "din", &fpgafs_din_fops, 0222, }, { "dout", &fpgafs_dout_fops, 0444, }, { "load", &fpgafs_load_fops, 0666, }, -#endif { "cmd", &fpgafs_cmd_fops, 0222, }, { "stat", &fpgafs_stat_fops, 0444, }, {}, diff --git a/fpgafs.h b/fpgafs.h index 8b39e8c..0d7d5a3 100644 --- a/fpgafs.h +++ b/fpgafs.h @@ -42,6 +42,9 @@ struct fpgafs_lldrv { int (*send) (unsigned char *buf, int len); int (*recv) (unsigned char *buf, int len); + + int (*read_load) (unsigned char *buf, int len); + int (*write_load) (unsigned char *buf, int len); }; int fpgafs_register_lldrv(struct fpgafs_lldrv *drv); @@ -50,4 +53,7 @@ int fpgafs_unregister_lldrv(struct fpgafs_lldrv *drv); int fpgafs_send_data(char *buf, int len); int fpgafs_recv_data(char *buf, int len); +int fpgafs_read_load(char *buf, int len); +int fpgafs_write_load(char *buf, int len); + #endif /* FPGAFS_H */ diff --git a/fpgafs_lldrv_cham.c b/fpgafs_lldrv_cham.c index 19e87c2..49a8dcd 100644 --- a/fpgafs_lldrv_cham.c +++ b/fpgafs_lldrv_cham.c @@ -23,7 +23,9 @@ static struct fpgafs_lldrv fpgafs_lldrv_cham = { .init = NULL, .exit = NULL, .send = &fpgafs_send_data_cham, - .recv = &fpgafs_recv_data_cham + .recv = &fpgafs_recv_data_cham, + .read_load = NULL, + .write_load = NULL, }; /* init exit functions ... */ diff --git a/fpgafs_lldrv_dbg.c b/fpgafs_lldrv_dbg.c index b89c47e..423c4b6 100644 --- a/fpgafs_lldrv_dbg.c +++ b/fpgafs_lldrv_dbg.c @@ -18,12 +18,24 @@ static int fpgafs_recv_data_dbg(unsigned char *buf, int len) return 4; } +static int fpgafs_read_load_dbg(unsigned char *buf, int len) +{ + return 0; +} + +static int fpgafs_write_load_dbg(unsigned char *buf, int len) +{ + return 0; +} + static struct fpgafs_lldrv fpgafs_lldrv_dbg = { .name = "dbg", .init = NULL, .exit = NULL, .send = &fpgafs_send_data_dbg, - .recv = &fpgafs_recv_data_dbg + .recv = &fpgafs_recv_data_dbg, + .read_load = &fpgafs_read_load_dbg, + .write_load = &fpgafs_write_load_dbg, }; /* init exit functions ... */ diff --git a/inode.c b/inode.c index ac55351..2b05d31 100644 --- a/inode.c +++ b/inode.c @@ -296,6 +296,8 @@ int __init fpgafs_init(void) return -ENOMEM; register_filesystem(&fpgafs_type); + printk("fpgafs: Benjamin Krill write_load(buf, len) : -EBUSY; +} +EXPORT_SYMBOL_GPL(fpgafs_write_load); + +int fpgafs_read_load(char *buf, int len) +{ + return (lldrv_cur) ? lldrv_cur->read_load(buf, len) : -EBUSY; +} +EXPORT_SYMBOL_GPL(fpgafs_read_load); + +/* low level un-/register functions */ int fpgafs_register_lldrv(struct fpgafs_lldrv *drv) { unsigned long flags;