EDT PCD SDK Documentation 6.1.0
chardev_intf.h File Reference

(git 0f88f48c, 2023-04-03)

Functions to setup and manage character device (chardev) interfaces associated with a PCI(e) device. More...

#include "edtdrvlnx.h"
#include <linux/device.h>
#include <linux/cdev.h>
Include dependency graph for chardev_intf.h:

Functions

int edt_chardev_init (void)
 Create chardev region and device class, used by all char device interfaces to this PCI device. More...
 
int edt_chardev_cleanup (void)
 Cleanup after edt_chardev_init(). More...
 
int edt_chardev_create_interfaces (const Edt_Dev *edt_p)
 Create character device interfaces to this PCI device. More...
 
int edt_chardev_destroy_interfaces (const Edt_Dev *edt_p)
 Remove all character device files previously created by edt_chardev_create_interfaces() More...
 

Detailed Description

Functions to setup and manage character device (chardev) interfaces associated with a PCI(e) device.

Author
Alex Hogen (alex@.nosp@m.edt..nosp@m.com)

Function Documentation

◆ edt_chardev_init()

int edt_chardev_init ( void  )

Create chardev region and device class, used by all char device interfaces to this PCI device.

Note
Should be called before edt_pcidev_create_interfaces()
Returns
Zero if successful, or negative errno code.

◆ edt_chardev_cleanup()

int edt_chardev_cleanup ( void  )

Cleanup after edt_chardev_init().

Precondition
edt_pcidev_destroy_interfaces() should be called on each interface first, before calling this, so the cdev class remains valid.
Returns
Zero if successful, or negative errno code.

◆ edt_chardev_create_interfaces()

int edt_chardev_create_interfaces ( const Edt_Dev *  edt_p)

Create character device interfaces to this PCI device.

If this is a PCD driver, this will create device files like:

/dev/pcd0_0
/dev/pcd0_1
/dev/pcd0_2

And likewise for PDV:

/dev/pdv0_0
/dev/pdv0_1
/dev/pdv0_2

...where the first number is the EDT device's "unit" number, and the second is the the DMA channel index.

Parameters
edt_pEDT device structure. All channel structs must be initialized before calling this function.
Returns
Zero if successful, or negative errno code.

◆ edt_chardev_destroy_interfaces()

int edt_chardev_destroy_interfaces ( const Edt_Dev *  edt_p)

Remove all character device files previously created by edt_chardev_create_interfaces()

Parameters
edt_pEDT device structure.
Returns
Zero if successful, or negative errno code.