Defines | Typedefs | Functions | Variables

llif.h File Reference

interface to device driver. More...

Go to the source code of this file.

Defines

#define PRINTF(n)   if ( verbose>=(n) ) printf
#define MFA_FAIL   0xffffffff

Typedefs

typedef unsigned short u16
typedef unsigned u32
typedef u32 MFA

Functions

int setMbox (struct MU *m, int ibox, u32 value)
 set a mail mbox register: ibox [0-3].
u32 getMbox (struct MU *m, int ibox)
 get contents of mailbox register: ibox [0-3]
u32 getMboxShadow (struct MU *m, int ibox)
 get last contents of mailbox register: ibox [0-3]
int setMboxBits (struct MU *m, int ibox, u32 bits_to_set)
 just set these bits.
int clrMboxBits (struct MU *m, int ibox, u32 bits_to_clr)
 just clr these bits.
int setMboxField (struct MU *m, int ibox, u32 field_mask, u32 field_value)
 set the field in the register only.
u32 pollMboxBits (struct MU *m, int ibox, u32 mask, u32 goal)
 return when any of the bits become true.
int pollAck (struct MU *m)
 polls regular ack from acq32.
struct MUmmapMbox (int iboard)
 iboard [1-3].
void setMboxPollcount (struct MU *m, int poll_count)
int getMboxPollcount (struct MU *m)
void showLastWrites (struct MU *m)
struct DmaBuffermmapDmaBuffer (int iboard, unsigned nbytes)
u32 getBusAddr (struct DmaBuffer *b, u32 offset)
u32getVaddr (struct DmaBuffer *b, u32 offset)
int getDmaBufferLen (struct DmaBuffer *b)
struct DmaBuffermmapBigBuffer (int iboard, unsigned nbytes)
void mmapValidateDmaBuffer (struct MU *mbx, int nsamples)
void acq32_enableInts (struct MU *mbx, unsigned mask)
void acq32_maskInts (struct MU *mbx, unsigned mask)
int hbPoll (struct DmaBuffer *buf, int offset, int sample_len, volatile int *user_abort)
void hbPrimePoll (struct DmaBuffer *buf, int offset, int sample_len)
void hbPrimeBuffer (struct DmaBuffer *buf)
MFA mu_reserveOutbound (struct MU *mu)
 I2O Q ports: OUTBOUND: host reserves free MFA, puts MFA as command INBOUND: host gets message MFA, replaces MFA when done.
int mu_putOutbound (struct MU *mu, MFA mfa)
MFA mu_getInbound (struct MU *mu)
int mu_returnInbound (struct MU *mu, MFA mfa)
static void memset32 (u32 *buf, u32 value, int count)

Variables

int verbose

Detailed Description

interface to device driver.

Definition in file llif.h.


Define Documentation

#define MFA_FAIL   0xffffffff

Definition at line 210 of file llif.h.

#define PRINTF (   n  )     if ( verbose>=(n) ) printf

Typedef Documentation

typedef u32 MFA

Definition at line 104 of file llif.h.

typedef unsigned short u16

Definition at line 94 of file llif.h.

typedef unsigned u32

Definition at line 95 of file llif.h.


Function Documentation

void acq32_enableInts ( struct MU mbx,
unsigned  mask 
)

Definition at line 532 of file llif.c.

References ACQ32_IOS_INTS_ENABLE, and MU::fd.

Referenced by measureBridgeStats(), and runTest().

void acq32_maskInts ( struct MU mbx,
unsigned  mask 
)

Definition at line 539 of file llif.c.

References ACQ32_IOS_INTS_DISABLE, and MU::fd.

Referenced by measureBridgeStats(), and runTest().

int clrMboxBits ( struct MU m,
int  ibox,
u32  bits_to_clr 
)

just clr these bits.

Definition at line 250 of file llif.c.

References IN_RANGE, MU::mailboxes, and MU::mailboxes_shadow.

u32 getBusAddr ( struct DmaBuffer b,
u32  offset 
)
int getDmaBufferLen ( struct DmaBuffer b  ) 

Definition at line 423 of file llif.c.

References DmaBuffer::nbytes.

u32 getMbox ( struct MU m,
int  ibox 
)

get contents of mailbox register: ibox [0-3]

Definition at line 269 of file llif.c.

References ACQ32_IOGMBX, MU::fd, IN_RANGE, MU::mailboxes, MU::mailboxes_shadow, and PRINTF.

Referenced by llGetCsr(), llGetTinst(), llGetTlatch(), measureBridge(), measureBridgeStats(), mmapMbox(), monitor_handler(), pollAck(), pollMboxBits(), and quit_handler().

int getMboxPollcount ( struct MU m  ) 

Definition at line 326 of file llif.c.

References MU::poll_count.

Referenced by do_run(), runSCM216(), runSYNC_2V(), runSYNC_2VAO32(), runSYNC_2VRFM(), and runSYNC_ECM().

u32 getMboxShadow ( struct MU m,
int  ibox 
)

get last contents of mailbox register: ibox [0-3]

Definition at line 298 of file llif.c.

References IN_RANGE, and MU::mailboxes_shadow.

Referenced by llWaitDmaDone().

u32* getVaddr ( struct DmaBuffer b,
u32  offset 
)
int hbPoll ( struct DmaBuffer buf,
int  offset,
int  sample_len,
volatile int *  user_abort 
)

Definition at line 737 of file llif.c.

References INITBUF_MARKER, marker, PRINTF, udelay(), and DmaBuffer::vaddr.

Referenced by do_run(), and runSCM216().

void hbPrimeBuffer ( struct DmaBuffer buf  ) 

Definition at line 720 of file llif.c.

References INITBUF_MARKER, len, memset32(), DmaBuffer::nbytes, and DmaBuffer::vaddr.

Referenced by initCardResource().

void hbPrimePoll ( struct DmaBuffer buf,
int  offset,
int  sample_len 
)

Definition at line 729 of file llif.c.

References marker, and DmaBuffer::vaddr.

Referenced by do_run(), and runSCM216().

static void memset32 ( u32 buf,
u32  value,
int  count 
) [inline, static]

Definition at line 199 of file llif.h.

Referenced by do_run(), hbPrimeBuffer(), runSYNC_2V(), runSYNC_2VAO32(), and runSYNC_ECM().

struct DmaBuffer* mmapBigBuffer ( int  iboard,
unsigned  nbytes 
) [read]
struct DmaBuffer* mmapDmaBuffer ( int  iboard,
unsigned  nbytes 
) [read]
struct MU* mmapMbox ( int  iboard  )  [read]

iboard [1-3].

return mapping on success.

Definition at line 332 of file llif.c.

References ACQ32_IOG_PCIREGS_OFFSET, dbg, MU::fd, fname, FNAME_FMT_MBOX, getMbox(), IN_RANGE, MU::inbound_q_port, MU::mailboxes, MU::outbound_q_port, PRINTF, and USE_IOCTL_DOC.

Referenced by initCardResource().

void mmapValidateDmaBuffer ( struct MU mbx,
int  nsamples 
)

Definition at line 694 of file llif.c.

References ACQ32_IOS_VALIDATE_BIGBUF, and MU::fd.

Referenced by main().

MFA mu_getInbound ( struct MU mu  ) 

Definition at line 774 of file llif.c.

References MU::outbound_q_port.

int mu_putOutbound ( struct MU mu,
MFA  mfa 
)

Definition at line 766 of file llif.c.

References MU::inbound_q_port.

Referenced by do_run(), and llSetDacs().

MFA mu_reserveOutbound ( struct MU mu  ) 

I2O Q ports: OUTBOUND: host reserves free MFA, puts MFA as command INBOUND: host gets message MFA, replaces MFA when done.

NB: direction with respect to HOST!

Definition at line 762 of file llif.c.

References MU::inbound_q_port.

Referenced by do_run(), and llSetDacs().

int mu_returnInbound ( struct MU mu,
MFA  mfa 
)

Definition at line 778 of file llif.c.

References MU::outbound_q_port.

int pollAck ( struct MU m  ) 

polls regular ack from acq32.

Definition at line 131 of file llprotocol.c.

References BP_CI_ACK_BIT, BP_MB_COMMAND, getMbox(), MASK, and PRINTF.

Referenced by enterLLC().

u32 pollMboxBits ( struct MU m,
int  ibox,
u32  mask,
u32  goal 
)

return when any of the bits become true.

Definition at line 304 of file llif.c.

References getMbox(), and PRINTF.

Referenced by enterLLC(), and llPollSack().

int setMbox ( struct MU m,
int  ibox,
u32  value 
)

set a mail mbox register: ibox [0-3].

return 0 on success

Definition at line 206 of file llif.c.

References ACQ32_IOSMBX, MU::fd, IN_RANGE, MU::mailboxes, MU::mailboxes_lastwrite, MU::mailboxes_shadow, and PRINTF.

Referenced by enterLLC(), enterLLC_SYNC_ECM(), llSetAddr(), llSetCmd(), llSetTlatch(), and runSCM216().

int setMboxBits ( struct MU m,
int  ibox,
u32  bits_to_set 
)

just set these bits.

Definition at line 242 of file llif.c.

References IN_RANGE, MU::mailboxes, and MU::mailboxes_shadow.

int setMboxField ( struct MU m,
int  ibox,
u32  field_mask,
u32  field_value 
)

set the field in the register only.

Definition at line 258 of file llif.c.

References IN_RANGE, MU::mailboxes, and MU::mailboxes_shadow.

void setMboxPollcount ( struct MU m,
int  poll_count 
)

Definition at line 322 of file llif.c.

References MU::poll_count.

Referenced by llv2WaitDmaDone(), llv2WaitDmaDone_2v(), and llWaitDmaDone().

void showLastWrites ( struct MU m  ) 

Definition at line 233 of file llif.c.

References MU::mailboxes_lastwrite.

Referenced by quit_handler().


Variable Documentation

int verbose

Definition at line 400 of file llcontrol.c.

Referenced by main(), and monitor_handler().