2007-07-01 23:30:51 +02:00
|
|
|
/*********************************************
|
|
|
|
* Benjamin Krill <ben@codiert.org>
|
|
|
|
*********************************************/
|
2007-06-28 18:20:34 +02:00
|
|
|
#ifndef FPGAFS_H
|
|
|
|
#define FPGAFS_H
|
|
|
|
|
|
|
|
#include <linux/kref.h>
|
|
|
|
#include <linux/mutex.h>
|
|
|
|
#include <linux/spinlock.h>
|
|
|
|
#include <linux/fs.h>
|
|
|
|
|
|
|
|
/* magic number the file system */
|
|
|
|
enum {
|
|
|
|
FPGAFS_MAGIC = 0x4255AA42,
|
|
|
|
};
|
|
|
|
|
|
|
|
struct fpga_context {
|
2007-07-10 17:07:35 +02:00
|
|
|
char *load_buf;
|
2007-09-06 21:29:43 +02:00
|
|
|
unsigned intlldrv;
|
2007-07-10 17:07:35 +02:00
|
|
|
int bla;
|
2007-06-28 18:20:34 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
struct fpgafs_inode_info {
|
|
|
|
struct fpga_context *i_ctx;
|
|
|
|
struct inode vfs_inode;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern struct tree_descr fpgafs_dir_contents[];
|
|
|
|
|
|
|
|
#define FPGAFS_I(inode) \
|
|
|
|
container_of(inode, struct fpgafs_inode_info, vfs_inode)
|
|
|
|
|
2007-07-01 23:30:51 +02:00
|
|
|
|
|
|
|
/* command definitions */
|
2007-07-01 11:55:49 +02:00
|
|
|
#define BLA 0
|
|
|
|
|
2007-07-01 23:30:51 +02:00
|
|
|
/* low level driver */
|
|
|
|
struct fpgafs_lldrv {
|
|
|
|
char name[5];
|
|
|
|
|
|
|
|
int (*init) (void);
|
|
|
|
int (*exit) (void);
|
|
|
|
|
2007-07-10 17:07:35 +02:00
|
|
|
int (*send) (struct fpga_context *ctx, const char __user *buf, int len);
|
|
|
|
int (*recv) (struct fpga_context *ctx, unsigned char *buf, int len);
|
2007-07-09 15:12:16 +02:00
|
|
|
|
2007-07-10 17:07:35 +02:00
|
|
|
int (*read_load) (struct fpga_context *ctx, unsigned char *buf, int len);
|
|
|
|
int (*write_load) (struct fpga_context *ctx, const char __user *buf, int len);
|
2007-07-01 23:30:51 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
int fpgafs_register_lldrv(struct fpgafs_lldrv *drv);
|
|
|
|
int fpgafs_unregister_lldrv(struct fpgafs_lldrv *drv);
|
|
|
|
|
2007-07-10 16:18:07 +02:00
|
|
|
ssize_t fpgafs_send_data(struct file *file, const char __user *buf,
|
|
|
|
size_t len, loff_t *pos);
|
|
|
|
ssize_t fpgafs_recv_data(struct file *file, char __user *buf,
|
|
|
|
size_t len, loff_t *pos);
|
|
|
|
|
|
|
|
ssize_t fpgafs_write_load(struct file *file, const char __user *buf,
|
|
|
|
size_t len, loff_t *pos);
|
|
|
|
ssize_t fpgafs_read_load(struct file *file, char __user *buf,
|
|
|
|
size_t len, loff_t *pos);
|
2007-07-09 15:12:16 +02:00
|
|
|
|
2007-07-10 17:07:35 +02:00
|
|
|
struct fpga_context* alloc_fpga_context(void);
|
|
|
|
void free_fpga_context(struct fpga_context *ctx);
|
2007-06-28 18:20:34 +02:00
|
|
|
#endif /* FPGAFS_H */
|