Defines | Functions | Variables

llprotocol.c File Reference

implementation of bus level protocol. More...

#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.

Variables

sigjmp_buf G_env

Detailed Description

implementation of bus level protocol.

Definition in file llprotocol.c.


Define Documentation

#define ACQ196_TCR_MASK   0xfff

Definition at line 269 of file llprotocol.c.

Referenced by llv2_extend32().

#define LLCV2_POISON   0xf0000001

Definition at line 291 of file llprotocol.c.

Referenced by 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 271 of file llprotocol.c.

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 221 of file llprotocol.c.

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

Referenced by appEnterLLC_SYNC_2V(), appEnterLLC_SYNC_2VAO32(), and appEnterLLC_SYNC_ECM().

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

Definition at line 198 of file llprotocol.c.

References BP_SET_A1, and enterLLC().

Referenced by enterLLC_SYNC_ECM(), and runTest().

int enterLLCSoftClock ( struct MU m,
int  clkpos,
int  trpos,
int  internal_loopback,
u32  command_mods 
)

Definition at line 178 of file llprotocol.c.

References BP_SET_A1, and enterLLC().

Referenced by runTest().

int leaveLLC ( struct MU m  ) 

Definition at line 235 of file llprotocol.c.

References LLC_CSR_M_ESC, and llSetCmd().

Referenced by quit_handler(), and runTest().

u32 llv2_extend32 ( u32  old32,
u32  new12 
)

return 32 bit count as function of old32, new12.

Definition at line 281 of file llprotocol.c.

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 363 of file llprotocol.c.

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

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

Todo:
old, new looks wrong!

Definition at line 293 of file llprotocol.c.

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 331 of file llprotocol.c.

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 243 of file llprotocol.c.

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

Referenced by card_v1_WaitDmaDone().

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().


Variable Documentation

sigjmp_buf G_env

Definition at line 129 of file llprotocol.c.

Referenced by llPollSack(), and runTest().