Chapter 3. Writing your own kernel module

Table of Contents

struct uio_info
Adding an interrupt handler

Please have a look at uio_cif.c as an example. The following paragraphs explain the different sections of this file.

This structure tells the framework the details of your driver, Some of the members are required, others are optional.

Usually, your device will have one or more memory regions that can be mapped to user space. For each region, you have to set up a struct uio_mem in the mem[] array. Here's a description of the fields of struct uio_mem:

Please do not touch the kobj element of struct uio_mem! It is used by the UIO framework to set up sysfs files for this mapping. Simply leave it alone.