LLC2_API
Defines | Functions
llprotocol.cpp File Reference
#include "local.h"
#include <assert.h>
#include "llif.h"
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <fcntl.h>
#include <signal.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include "acq32busprot.h"
#include "llprotocol.h"

Go to the source code of this file.

Defines

#define ACQ196_TCR_MASK   0xfff
#define SERVICE_ROLLOVER(tim, reg, mask, temp)
#define LLCV2_POISON   0xf0000001

Functions

int pollAck (struct MU *m)
 polls regular ack from acq32.
static int enterLLC (struct MU *m, unsigned mode, unsigned a3, int clkpos, int trpos)
int enterLLCSoftClock (struct MU *m, int clkpos, int trpos, int internal_loopback, u32 command_mods)
int enterLLCExtClock (struct MU *m, int clkpos, int trpos, unsigned short divisor, int internal_loopback, u32 command_mods)
int enterLLC_SYNC_ECM (struct MU *m, int clkpos, int trpos, unsigned short divisor, int internal_loopback, u32 command_mods, u32 init_buf_baddr)
 Enter LowLatency Mode for EXTERNAL CLOCK capture.
int leaveLLC (struct MU *m)
u32 llWaitDmaDone (struct MU *m)
 polls until DMA has completed.
u32 llv2_extend32 (u32 old32, u32 new12)
 return 32 bit count as function of old32, new12.
u32 llv2WaitDmaDone (struct MU *m, volatile u32 *hstats)
 polls until DMA has completed.
u32 llv2WaitDmaDone_2v (struct MU *m, volatile u32 *hstats, unsigned tlatch)
 polls until DMA has completed.
void llv2InitDmaDone (volatile u32 *hstats)
 polls until DMA has completed.

Define Documentation

#define ACQ196_TCR_MASK   0xfff

Definition at line 271 of file llprotocol.cpp.

Referenced by llv2_extend32().

#define LLCV2_POISON   0xf0000001

Definition at line 293 of file llprotocol.cpp.

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

#define SERVICE_ROLLOVER (   tim,
  reg,
  mask,
  temp 
)
Value:
temp = (reg) & (mask);                                          \
        if (((tim) & (mask)) > (temp)){                                 \
                (tim) = (((tim) & ~(mask)) | (temp)) + ((mask)+1);      \
        }else{                                                          \
                (tim) = (((tim) & ~(mask)) | (temp));                   \
        }

Definition at line 273 of file llprotocol.cpp.

Referenced by llv2_extend32().


Function Documentation

static int enterLLC ( struct MU m,
unsigned  mode,
unsigned  a3,
int  clkpos,
int  trpos 
) [static]
int enterLLC_SYNC_ECM ( struct MU m,
int  clkpos,
int  trpos,
unsigned short  divisor,
int  internal_loopback,
u32  command_mods,
u32  init_buf_baddr 
)

Enter LowLatency Mode for EXTERNAL CLOCK capture.

Definition at line 222 of file llprotocol.cpp.

References BP_FC_SET_LLCV2_INIT, BP_MB_A4, enterLLCExtClock(), and setMbox().

Referenced by appEnterLLC_SYNC_2VAO32().

int enterLLCExtClock ( struct MU m,
int  clkpos,
int  trpos,
unsigned short  divisor,
int  internal_loopback,
u32  command_mods 
)
int enterLLCSoftClock ( struct MU m,
int  clkpos,
int  trpos,
int  internal_loopback,
u32  command_mods 
)
int leaveLLC ( struct MU m)

Definition at line 236 of file llprotocol.cpp.

References LLC_CSR_M_ESC, llSetCmd(), and setPathCleanup().

Referenced by quit_handler(), and LL_ControlSystemI::Stop().

u32 llv2_extend32 ( u32  old32,
u32  new12 
)

return 32 bit count as function of old32, new12.

Definition at line 283 of file llprotocol.cpp.

References ACQ196_TCR_MASK, and SERVICE_ROLLOVER.

Referenced by llv2WaitDmaDone(), llv2WaitDmaDone_2v(), sync_2v_updateTstats(), and v2_updateTstats().

void llv2InitDmaDone ( volatile u32 hstats)

polls until DMA has completed.

Returns tlatch guaranteed DMA done when tlatch updated V2 method does NOT poll PCI

Definition at line 364 of file llprotocol.cpp.

References LLC_SYNC2V_IN_LAST, LLCV2_POISON, and LLCV2_STATUS_BDR.

Referenced by LL_ControlSystemI::Arm().

u32 llv2WaitDmaDone ( struct MU m,
volatile u32 hstats 
)

polls until DMA has completed.

Returns tlatch guaranteed DMA done when tlatch updated V2 method does NOT poll PCI

Definition at line 295 of file llprotocol.cpp.

References BP_MB_LLC_TADC, LLCV2_POISON, LLCV2_STATUS_BDR, LLCV2_STATUS_TLATCH, llv2_extend32(), mask, and setMboxPollcount().

Referenced by card_v2_WaitDmaDone().

u32 llv2WaitDmaDone_2v ( struct MU m,
volatile u32 hstats,
unsigned  tlatch 
)

polls until DMA has completed.

Returns tlatch guaranteed DMA done when tlatch updated V2 method does NOT poll PCI

Definition at line 332 of file llprotocol.cpp.

References LLC_SYNC2V_IN_LAST, LLCV2_POISON, LLCV2_STATUS_TLATCH, llv2_extend32(), mask, and setMboxPollcount().

Referenced by card_sync_2v_WaitDmaDone().

u32 llWaitDmaDone ( struct MU m)

polls until DMA has completed.

Returns tlatch guaranteed DMA done when tlatch updated

Definition at line 245 of file llprotocol.cpp.

References BP_MB_LLC_TADC, getMboxShadow(), llGetTlatch(), and setMboxPollcount().

int pollAck ( struct MU m)

polls regular ack from acq32.

Definition at line 130 of file llprotocol.cpp.

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

Referenced by enterLLC().