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
This commit is contained in:
parent
5fb7a317c3
commit
30be5238b2
30
files.c
30
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, },
|
||||
{},
|
||||
|
6
fpgafs.h
6
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 */
|
||||
|
@ -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 ... */
|
||||
|
@ -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 ... */
|
||||
|
2
inode.c
2
inode.c
@ -296,6 +296,8 @@ int __init fpgafs_init(void)
|
||||
return -ENOMEM;
|
||||
|
||||
register_filesystem(&fpgafs_type);
|
||||
printk("fpgafs: Benjamin Krill <ben@codiert.org");
|
||||
printk("fpgafs: successfull loaded ...");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
13
llmgmt.c
13
llmgmt.c
@ -25,6 +25,19 @@ int fpgafs_recv_data(char *buf, int len)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(fpgafs_recv_data);
|
||||
|
||||
int fpgafs_write_load(char *buf, int len)
|
||||
{
|
||||
return (lldrv_cur) ? lldrv_cur->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;
|
||||
|
Loading…
Reference in New Issue
Block a user