Char driver for direct TetrAmm.
More...
#include <linux/module.h>
#include <linux/cdev.h>
#include <linux/device.h>
#include <linux/fs.h>
#include <asm/uaccess.h>
#include "BEST_PCIe.h"
#include "BEST_PCIe_internal.h"
#include "BEST_direct_tetramm.h"
|
|
#define | debug_print(fmt, args...) do { if (DEBUG_tetramm_PRINT) printk( KERN_DEBUG fmt, ##args); } while (0) |
| |
|
#define | DIRECT_READ_DATA_OFFSET 0x10 |
| | offset at which data start (first word enables latch)
|
| |
|
#define | DIRECT_WRITE_DATA_OFFSET 0x10 |
| | offset at which data start (first word enables latch)
|
| |
|
#define | TETRAMM_ASCII_FMT "%016llx" |
| |
|
| static const struct file_operations | dma_char_fops |
| |
Char driver for direct TetrAmm.
- Author
- Jan Marjanovic (j.mar.nosp@m.jano.nosp@m.vic@c.nosp@m.aene.nosp@m.ls.co.nosp@m.m)
- Date
- July 2014
| int tetramm_char_open |
( |
struct inode * |
inode, |
|
|
struct file * |
file |
|
) |
| |
Opens char device (stores dev struct in pirvate data)
- Parameters
-
| inode | Index node structure |
| file | File structure |
- Returns
- 0 on success, negative number on fail
| ssize_t tetramm_char_read |
( |
struct file * |
file, |
|
|
char __user * |
buf, |
|
|
size_t |
count, |
|
|
loff_t * |
pos |
|
) |
| |
Reads from char device.
- Parameters
-
| file | File structure (path, ...) |
| buf | Buffer to read to |
| count | Number of bytes to read |
| pos | |
- Returns
- Numbers of bytes successfully read
Creates new TetrAmm char device.
- Parameters
-
| dev | Structure with TetrAmm info |
| best_class | Class which this device will be part of |
Removes TetrAmm char device.
- Parameters
-
| dev | Structure with TetrAmm info |
| best_class | Class which this device will be part of |
| const struct file_operations dma_char_fops |
|
static |
Initial value:= {
.owner = THIS_MODULE,
.unlocked_ioctl = tetramm_char_ioctl
}
int tetramm_char_open(struct inode *inode, struct file *file)
Opens char device (stores dev struct in pirvate data)
Definition: BEST_direct_tetramm.c:38
ssize_t tetramm_char_read(struct file *file, char __user *buf, size_t count, loff_t *pos)
Reads from char device.
Definition: BEST_direct_tetramm.c:62