BEST PCIe driver
 All Data Structures Files Functions Variables Macros Pages
BEST_dma_device.h File Reference

Char driver for mSGDMA. More...

Go to the source code of this file.

Data Structures

struct  dma_dev_struct
 

Macros

#define DMA_MAX_BUFFER_NR   32
 Number of DMA buffers.
 

Functions

int dma_dev_create (struct dma_dev_struct *dev, struct class *best_class)
 Creates new DMA char device. More...
 
void dma_dev_remove (struct dma_dev_struct *dev, struct class *best_class)
 Removes DMA char device. More...
 
void dma_reset (struct dma_dev_struct *dev)
 Resets DMA. More...
 
void dma_advance_buf (struct dma_dev_struct *dev)
 Advacnes to next buffer, returns pointer to it. More...
 
int dma_dev_allocate_buffers (struct pci_dev *dev, struct dma_dev_struct *dma)
 Allocates DMA buffers. More...
 
void dma_dev_free_buffers (struct pci_dev *dev, struct dma_dev_struct *dma)
 Frees DMA buffers. More...
 

Detailed Description

Char driver for mSGDMA.

Author
Jan Marjanovic (j.mar.nosp@m.jano.nosp@m.vic@c.nosp@m.aene.nosp@m.ls.co.nosp@m.m)
Date
June 2014

Function Documentation

void dma_advance_buf ( struct dma_dev_struct dev)

Advacnes to next buffer, returns pointer to it.

Parameters
devDMA structure
buf_to_writeReturns address of a buffer to write to
int dma_dev_allocate_buffers ( struct pci_dev *  dev,
struct dma_dev_struct dma 
)

Allocates DMA buffers.

Parameters
devPCI device
dmaDMA strucutre to allocate memory

Fields buf_number and buf_len must have valid values

int dma_dev_create ( struct dma_dev_struct dev,
struct class *  best_class 
)

Creates new DMA char device.

Parameters
devStructure with DMA info
best_classClass which this device will be part of

Creates new char device, which represents FPGA mSGDMA Allowed operation on device is read(), which returns most recent data from buffers

void dma_dev_free_buffers ( struct pci_dev *  dev,
struct dma_dev_struct dma 
)

Frees DMA buffers.

Parameters
devPCI device
dmaDMA strucutre to allocate memory
void dma_dev_remove ( struct dma_dev_struct dev,
struct class *  best_class 
)

Removes DMA char device.

Parameters
devStructure with DMA info
best_classClass which this device will be part of
void dma_reset ( struct dma_dev_struct dev)

Resets DMA.

Parameters
boardPointer to structure with board specific data