STRUCT UIO_INFO(9) Device drivers infrastructure STRUCT UIO_INFO(9)NAME
struct_uio_info - UIO device capabilities
SYNOPSIS
struct uio_info {
struct uio_device * uio_dev;
const char * name;
const char * version;
struct uio_mem mem[MAX_UIO_MAPS];
struct uio_port port[MAX_UIO_PORT_REGIONS];
long irq;
unsigned long irq_flags;
void * priv;
irqreturn_t (* handler) (int irq, struct uio_info *dev_info);
int (* mmap) (struct uio_info *info, struct vm_area_struct *vma);
int (* open) (struct uio_info *info, struct inode *inode);
int (* release) (struct uio_info *info, struct inode *inode);
int (* irqcontrol) (struct uio_info *info, s32 irq_on);
};
MEMBERS
uio_dev
the UIO device this info belongs to
name
device name
version
device driver version
mem[MAX_UIO_MAPS]
list of mappable memory regions, size==0 for end of list
port[MAX_UIO_PORT_REGIONS]
list of port regions, size==0 for end of list
irq
interrupt number or UIO_IRQ_CUSTOM
irq_flags
flags for request_irq
priv
optional private data
handler
the device's irq handler
mmap
mmap operation for this uio device
open
open operation for this uio device
release
release operation for this uio device
irqcontrol
disable/enable irqs when 0/1 is written to /dev/uioX
COPYRIGHT Kernel Hackers Manual 3.10 June 2014 STRUCT UIO_INFO(9)
Check Out this Related Man Page
STRUCT HSI_PORT(9) High Speed Synchronous Serial STRUCT HSI_PORT(9)NAME
struct_hsi_port - HSI port device
SYNOPSIS
struct hsi_port {
struct device device;
struct hsi_config tx_cfg;
struct hsi_config rx_cfg;
unsigned int num;
unsigned int shared:1;
int claimed;
struct mutex lock;
int (* async) (struct hsi_msg *msg);
int (* setup) (struct hsi_client *cl);
int (* flush) (struct hsi_client *cl);
int (* start_tx) (struct hsi_client *cl);
int (* stop_tx) (struct hsi_client *cl);
int (* release) (struct hsi_client *cl);
struct atomic_notifier_head n_head;
};
MEMBERS
device
Driver model representation of the device
tx_cfg
Current TX path configuration
rx_cfg
Current RX path configuration
num
Port number
shared
Set when port can be shared by different clients
claimed
Reference count of clients which claimed the port
lock
Serialize port claim
async
Asynchronous transfer callback
setup
Callback to set the HSI client configuration
flush
Callback to clean the HW state and destroy all pending transfers
start_tx
Callback to inform that a client wants to TX data
stop_tx
Callback to inform that a client no longer wishes to TX data
release
Callback to inform that a client no longer uses the port
n_head
Notifier chain for signaling port events to the clients.
COPYRIGHT Kernel Hackers Manual 3.10 June 2014 STRUCT HSI_PORT(9)
Hi, everybody
I have next problem...
1) My Example program code
void main()
{
int fd;
int len;
int buf;
fd=open("mydev", O_RDONLY);
lseek(fd, 0, SEEK_SET);
len=read(fd, buf, sizeof(buf));
}
2) My Example Driver code
static int mydev_read(dev_t dev, ?, ?, struct uio* uio)
{... (0 Replies)
Hello,
I have develop a driver for my hardware and now, I need to handle a IRQ but I does not work.
As I can understand, to handle a irq, it is necessary to make a request_irq(). If the return value is zero, ok, no problem to handle irq.
Here is a easy example of my driver:
#include... (8 Replies)
request_irq always returns EINVAL
What am I doing wrong here ?
int mydrvr_open(struct inode *inode, struct file *filp)
{
int ret;
printk("<1> \nModule Opened!");
//disable_irq(4);
//free_irq(4, NULL);
ret = request_irq(4, &imr_interrupt_handler,IRQF_SHARED,... (0 Replies)