Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
mite.h File Reference
#include <linux/pci.h>
#include <linux/log2.h>
#include "../comedidev.h"

Go to the source code of this file.

Data Structures

struct  mite_dma_descriptor
 
struct  mite_dma_descriptor_ring
 
struct  mite_channel
 
struct  mite_struct
 

Macros

#define PCIMIO_COMPAT
 
#define MDPRINTK(format, args...)   do { } while (0)
 
#define MAX_MITE_DMA_CHANNELS   8
 

Enumerations

enum  mite_registers {
  MITE_UNKNOWN_DMA_BURST_REG = 0x28, MITE_IODWBSR = 0xc0, MITE_IODWBSR_1 = 0xc4, MITE_IODWCR_1 = 0xf4,
  MITE_PCI_CONFIG_OFFSET = 0x300, MITE_CSIGR = 0x460
}
 
enum  MITE_IODWBSR_bits { WENAB = 0x80 }
 
enum  MITE_UNKNOWN_DMA_BURST_bits { UNKNOWN_DMA_BURST_ENABLE_BITS = 0x600 }
 
enum  MITE_MCR_bits { MCRPON = 0 }
 
enum  MITE_DCR_bits { DCR_NORMAL = (1 << 29), DCRPON = 0 }
 
enum  MITE_CHOR_bits {
  CHOR_DMARESET = (1 << 31), CHOR_SET_SEND_TC = (1 << 11), CHOR_CLR_SEND_TC = (1 << 10), CHOR_SET_LPAUSE = (1 << 9),
  CHOR_CLR_LPAUSE = (1 << 8), CHOR_CLRDONE = (1 << 7), CHOR_CLRRB = (1 << 6), CHOR_CLRLC = (1 << 5),
  CHOR_FRESET = (1 << 4), CHOR_ABORT = (1 << 3), CHOR_STOP = (1 << 2), CHOR_CONT = (1 << 1),
  CHOR_START = (1 << 0), CHOR_PON = (CHOR_CLR_SEND_TC | CHOR_CLR_LPAUSE)
}
 
enum  MITE_CHCR_bits {
  CHCR_SET_DMA_IE = (1 << 31), CHCR_CLR_DMA_IE = (1 << 30), CHCR_SET_LINKP_IE = (1 << 29), CHCR_CLR_LINKP_IE = (1 << 28),
  CHCR_SET_SAR_IE = (1 << 27), CHCR_CLR_SAR_IE = (1 << 26), CHCR_SET_DONE_IE = (1 << 25), CHCR_CLR_DONE_IE = (1 << 24),
  CHCR_SET_MRDY_IE = (1 << 23), CHCR_CLR_MRDY_IE = (1 << 22), CHCR_SET_DRDY_IE = (1 << 21), CHCR_CLR_DRDY_IE = (1 << 20),
  CHCR_SET_LC_IE = (1 << 19), CHCR_CLR_LC_IE = (1 << 18), CHCR_SET_CONT_RB_IE = (1 << 17), CHCR_CLR_CONT_RB_IE = (1 << 16),
  CHCR_FIFODIS = (1 << 15), CHCR_FIFO_ON = 0, CHCR_BURSTEN = (1 << 14), CHCR_NO_BURSTEN = 0,
  CHCR_BYTE_SWAP_DEVICE = (1 << 6), CHCR_BYTE_SWAP_MEMORY = (1 << 4), CHCR_DIR = (1 << 3), CHCR_DEV_TO_MEM = CHCR_DIR,
  CHCR_MEM_TO_DEV = 0, CHCR_NORMAL = (0 << 0), CHCR_CONTINUE = (1 << 0), CHCR_RINGBUFF = (2 << 0),
  CHCR_LINKSHORT = (4 << 0), CHCR_LINKLONG = (5 << 0), CHCRPON
}
 
enum  ConfigRegister_bits {
  CR_REQS_MASK = 0x7 << 16, CR_ASEQDONT = 0x0 << 10, CR_ASEQUP = 0x1 << 10, CR_ASEQDOWN = 0x2 << 10,
  CR_ASEQ_MASK = 0x3 << 10, CR_PSIZE8 = (1 << 8), CR_PSIZE16 = (2 << 8), CR_PSIZE32 = (3 << 8),
  CR_PORTCPU = (0 << 6), CR_PORTIO = (1 << 6), CR_PORTVXI = (2 << 6), CR_PORTMXI = (3 << 6),
  CR_AMDEVICE = (1 << 0)
}
 
enum  CHSR_bits {
  CHSR_INT = (1 << 31), CHSR_LPAUSES = (1 << 29), CHSR_SARS = (1 << 27), CHSR_DONE = (1 << 25),
  CHSR_MRDY = (1 << 23), CHSR_DRDY = (1 << 21), CHSR_LINKC = (1 << 19), CHSR_CONTS_RB = (1 << 17),
  CHSR_ERROR = (1 << 15), CHSR_SABORT = (1 << 14), CHSR_HABORT = (1 << 13), CHSR_STOPS = (1 << 12),
  CHSR_OPERR_mask = (3 << 10), CHSR_OPERR_NOERROR = (0 << 10), CHSR_OPERR_FIFOERROR = (1 << 10), CHSR_OPERR_LINKERROR = (1 << 10),
  CHSR_XFERR = (1 << 9), CHSR_END = (1 << 8), CHSR_DRQ1 = (1 << 7), CHSR_DRQ0 = (1 << 6),
  CHSR_LxERR_mask = (3 << 4), CHSR_LBERR = (1 << 4), CHSR_LRERR = (2 << 4), CHSR_LOERR = (3 << 4),
  CHSR_MxERR_mask = (3 << 2), CHSR_MBERR = (1 << 2), CHSR_MRERR = (2 << 2), CHSR_MOERR = (3 << 2),
  CHSR_DxERR_mask = (3 << 0), CHSR_DBERR = (1 << 0), CHSR_DRERR = (2 << 0), CHSR_DOERR = (3 << 0)
}
 

Functions

struct mite_structmite_alloc (struct pci_dev *pcidev)
 
int mite_setup (struct mite_struct *mite)
 
int mite_setup2 (struct mite_struct *mite, unsigned use_iodwbsr_1)
 
void mite_unsetup (struct mite_struct *mite)
 
struct mite_dma_descriptor_ringmite_alloc_ring (struct mite_struct *mite)
 
void mite_free_ring (struct mite_dma_descriptor_ring *ring)
 
struct mite_channelmite_request_channel_in_range (struct mite_struct *mite, struct mite_dma_descriptor_ring *ring, unsigned min_channel, unsigned max_channel)
 
void mite_release_channel (struct mite_channel *mite_chan)
 
unsigned mite_dma_tcr (struct mite_channel *mite_chan)
 
void mite_dma_arm (struct mite_channel *mite_chan)
 
void mite_dma_disarm (struct mite_channel *mite_chan)
 
int mite_sync_input_dma (struct mite_channel *mite_chan, struct comedi_async *async)
 
int mite_sync_output_dma (struct mite_channel *mite_chan, struct comedi_async *async)
 
u32 mite_bytes_written_to_memory_lb (struct mite_channel *mite_chan)
 
u32 mite_bytes_written_to_memory_ub (struct mite_channel *mite_chan)
 
u32 mite_bytes_read_from_memory_lb (struct mite_channel *mite_chan)
 
u32 mite_bytes_read_from_memory_ub (struct mite_channel *mite_chan)
 
u32 mite_bytes_in_transit (struct mite_channel *mite_chan)
 
unsigned mite_get_status (struct mite_channel *mite_chan)
 
int mite_done (struct mite_channel *mite_chan)
 
void mite_prep_dma (struct mite_channel *mite_chan, unsigned int num_device_bits, unsigned int num_memory_bits)
 
int mite_buf_change (struct mite_dma_descriptor_ring *ring, struct comedi_async *async)
 

Macro Definition Documentation

#define MAX_MITE_DMA_CHANNELS   8

Definition at line 40 of file mite.h.

#define MDPRINTK (   format,
  args... 
)    do { } while (0)

Definition at line 37 of file mite.h.

#define PCIMIO_COMPAT

Definition at line 32 of file mite.h.

Enumeration Type Documentation

enum CHSR_bits
Enumerator:
CHSR_INT 
CHSR_LPAUSES 
CHSR_SARS 
CHSR_DONE 
CHSR_MRDY 
CHSR_DRDY 
CHSR_LINKC 
CHSR_CONTS_RB 
CHSR_ERROR 
CHSR_SABORT 
CHSR_HABORT 
CHSR_STOPS 
CHSR_OPERR_mask 
CHSR_OPERR_NOERROR 
CHSR_OPERR_FIFOERROR 
CHSR_OPERR_LINKERROR 
CHSR_XFERR 
CHSR_END 
CHSR_DRQ1 
CHSR_DRQ0 
CHSR_LxERR_mask 
CHSR_LBERR 
CHSR_LRERR 
CHSR_LOERR 
CHSR_MxERR_mask 
CHSR_MBERR 
CHSR_MRERR 
CHSR_MOERR 
CHSR_DxERR_mask 
CHSR_DBERR 
CHSR_DRERR 
CHSR_DOERR 

Definition at line 405 of file mite.h.

Enumerator:
CR_REQS_MASK 
CR_ASEQDONT 
CR_ASEQUP 
CR_ASEQDOWN 
CR_ASEQ_MASK 
CR_PSIZE8 
CR_PSIZE16 
CR_PSIZE32 
CR_PORTCPU 
CR_PORTIO 
CR_PORTVXI 
CR_PORTMXI 
CR_AMDEVICE 

Definition at line 367 of file mite.h.

Enumerator:
CHCR_SET_DMA_IE 
CHCR_CLR_DMA_IE 
CHCR_SET_LINKP_IE 
CHCR_CLR_LINKP_IE 
CHCR_SET_SAR_IE 
CHCR_CLR_SAR_IE 
CHCR_SET_DONE_IE 
CHCR_CLR_DONE_IE 
CHCR_SET_MRDY_IE 
CHCR_CLR_MRDY_IE 
CHCR_SET_DRDY_IE 
CHCR_CLR_DRDY_IE 
CHCR_SET_LC_IE 
CHCR_CLR_LC_IE 
CHCR_SET_CONT_RB_IE 
CHCR_CLR_CONT_RB_IE 
CHCR_FIFODIS 
CHCR_FIFO_ON 
CHCR_BURSTEN 
CHCR_NO_BURSTEN 
CHCR_BYTE_SWAP_DEVICE 
CHCR_BYTE_SWAP_MEMORY 
CHCR_DIR 
CHCR_DEV_TO_MEM 
CHCR_MEM_TO_DEV 
CHCR_NORMAL 
CHCR_CONTINUE 
CHCR_RINGBUFF 
CHCR_LINKSHORT 
CHCR_LINKLONG 
CHCRPON 

Definition at line 330 of file mite.h.

Enumerator:
CHOR_DMARESET 
CHOR_SET_SEND_TC 
CHOR_CLR_SEND_TC 
CHOR_SET_LPAUSE 
CHOR_CLR_LPAUSE 
CHOR_CLRDONE 
CHOR_CLRRB 
CHOR_CLRLC 
CHOR_FRESET 
CHOR_ABORT 
CHOR_STOP 
CHOR_CONT 
CHOR_START 
CHOR_PON 

Definition at line 313 of file mite.h.

Enumerator:
DCR_NORMAL 
DCRPON 

Definition at line 308 of file mite.h.

Enumerator:
WENAB 

Definition at line 242 of file mite.h.

Enumerator:
MCRPON 

Definition at line 304 of file mite.h.

Enumerator:
MITE_UNKNOWN_DMA_BURST_REG 
MITE_IODWBSR 
MITE_IODWBSR_1 
MITE_IODWCR_1 
MITE_PCI_CONFIG_OFFSET 
MITE_CSIGR 

Definition at line 146 of file mite.h.

Enumerator:
UNKNOWN_DMA_BURST_ENABLE_BITS 

Definition at line 256 of file mite.h.

Function Documentation

struct mite_struct* mite_alloc ( struct pci_dev pcidev)
read

Definition at line 66 of file mite.c.

struct mite_dma_descriptor_ring* mite_alloc_ring ( struct mite_struct mite)
read

Definition at line 217 of file mite.c.

int mite_buf_change ( struct mite_dma_descriptor_ring ring,
struct comedi_async async 
)

Definition at line 331 of file mite.c.

u32 mite_bytes_in_transit ( struct mite_channel mite_chan)

Definition at line 483 of file mite.c.

u32 mite_bytes_read_from_memory_lb ( struct mite_channel mite_chan)

Definition at line 512 of file mite.c.

u32 mite_bytes_read_from_memory_ub ( struct mite_channel mite_chan)

Definition at line 522 of file mite.c.

u32 mite_bytes_written_to_memory_lb ( struct mite_channel mite_chan)

Definition at line 492 of file mite.c.

u32 mite_bytes_written_to_memory_ub ( struct mite_channel mite_chan)

Definition at line 502 of file mite.c.

void mite_dma_arm ( struct mite_channel mite_chan)

Definition at line 306 of file mite.c.

void mite_dma_disarm ( struct mite_channel mite_chan)

Definition at line 546 of file mite.c.

unsigned mite_dma_tcr ( struct mite_channel mite_chan)

Definition at line 531 of file mite.c.

int mite_done ( struct mite_channel mite_chan)

Definition at line 652 of file mite.c.

void mite_free_ring ( struct mite_dma_descriptor_ring ring)

Definition at line 236 of file mite.c.

unsigned mite_get_status ( struct mite_channel mite_chan)

Definition at line 633 of file mite.c.

void mite_prep_dma ( struct mite_channel mite_chan,
unsigned int  num_device_bits,
unsigned int  num_memory_bits 
)

Definition at line 386 of file mite.c.

void mite_release_channel ( struct mite_channel mite_chan)

Definition at line 279 of file mite.c.

struct mite_channel* mite_request_channel_in_range ( struct mite_struct mite,
struct mite_dma_descriptor_ring ring,
unsigned  min_channel,
unsigned  max_channel 
)
read

Definition at line 252 of file mite.c.

int mite_setup ( struct mite_struct mite)

Definition at line 189 of file mite.c.

int mite_setup2 ( struct mite_struct mite,
unsigned  use_iodwbsr_1 
)

Definition at line 103 of file mite.c.

int mite_sync_input_dma ( struct mite_channel mite_chan,
struct comedi_async async 
)

Definition at line 557 of file mite.c.

int mite_sync_output_dma ( struct mite_channel mite_chan,
struct comedi_async async 
)

Definition at line 595 of file mite.c.

void mite_unsetup ( struct mite_struct mite)

Definition at line 195 of file mite.c.