16#ifndef included_Retro_Rw11CntlDEUNA
17#define included_Retro_Rw11CntlDEUNA 1
37 void Config(
const std::string& name, uint16_t base,
int lam);
43 void SetType(
const std::string& type);
54 const char*
MnemoPcmd(uint16_t pcmd)
const;
55 const char*
MnemoFunc(uint16_t func)
const;
60 virtual void Dump(std::ostream& os,
int ind=0,
const char* text=0,
67 static const uint16_t
kPR0 = 000;
68 static const uint16_t
kPR1 = 002;
69 static const uint16_t
kPR2 = 004;
70 static const uint16_t
kPR3 = 006;
286 void Wlist2UBAddr(
const uint16_t wlist[2], uint32_t& addr);
288 uint32_t& addr, uint16_t& len);
290 uint32_t addr, uint16_t len);
297 const uint16_t dscnxt[4]);
302 const uint16_t dscnxt[4]);
310 uint16_t inc=1)
const;
315 uint16_t index)
const;
321 void UpdateStat16(uint32_t& stat,
size_t ind, uint32_t inc=1);
322 void UpdateStat32(uint32_t& stat,
size_t ind, uint32_t inc=1);
324 void LogMacFunc(
const char* cmd, uint64_t mac);
327 void LogFunc(
const char* cmd,
const char* tag1, uint16_t val1,
328 const char* tag2=
nullptr, uint16_t val2=0);
332 static void SetRingDsc(uint16_t dst[4],
const uint16_t src[4]);
333 static std::string
RingDsc2String(
const uint16_t dsc[4],
char rxtx);
static const uint16_t kWBit14
static const uint16_t kWBit06
static const uint16_t kWBit12
static const uint16_t kWBit15
static const uint16_t kWBit08
static const uint16_t kWBit09
static const uint16_t kWBit00
static const uint16_t kWBit03
static const uint16_t kWBit13
static const uint16_t kWBit04
static const uint16_t kWBit11
static const uint16_t kWBit07
static const uint16_t kWBit10
static const uint16_t kWBit05
static const uint16_t kWBit02
std::shared_ptr< RethBuf > pbuf_t
Implemenation (inline) of Rw11CntlBase.
static const uint16_t kMODE_M_MBZ_DEUNA
MBZ bit:10,8:4,1.
static const uint16_t kSTAT_M_RRNG
RRNG: rx ring error.
static const uint16_t kTXR2_M_SEGB
SEGB: msg of seg base.
virtual void UnitSetup(size_t ind)
FIXME_docs.
static const uint16_t kPR0_M_RSET
RSET: sw reset.
static const uint16_t kSTATE_PHALT
port halted
static const uint16_t kFUNC_WSID
WSID: write system id.
uint16_t fTxRingELen
tx ring entry length
static std::string RingDsc2OSEString(const uint16_t dsc[4], char fill=' ')
FIXME_docs.
static const uint16_t kSTAT_M_TMOT
TMOT: UNIBUS timeout.
static const uint16_t kSTAT_M_MERR
MERR: multiple errors.
bool fRunning
in kSTATE_RUN and active
static const uint16_t kPC0_M_FUNC
FUNC: function code.
static const uint16_t kFUNC_RMAL
RMAL: read mcast MAC list.
void Wlist2UBAddrLen(const uint16_t wlist[2], uint32_t &addr, uint16_t &len)
FIXME_docs.
static const uint16_t kPR0_M_RXI
RXI: receive rung intr.
uint32_t fCtrTxFraAbort
ctr: xmit aborted frames
enum s_rx fRxRingState
rx ring handler busy
void Config(const std::string &name, uint16_t base, int lam)
FIXME_docs.
static const uint16_t kTXR3_M_LCAR
LCAR: lost carrier.
static const uint16_t kRXR3_M_MLEN
MLEN: message length.
static std::string RingDsc2String(const uint16_t dsc[4], char rxtx)
FIXME_docs.
int AttnHandler(RlinkServer::AttnArgs &args)
FIXME_docs.
static const uint16_t kRXR2_M_ERRS
ERRS: error summary.
void Wlist2UBAddr(const uint16_t wlist[2], uint32_t &addr)
FIXME_docs.
static const uint16_t kSTATE_NHALT
ni halted
void ClearStatus()
FIXME_docs.
static const uint16_t kPCMD_GETCMD
GETCMD: get command.
void SetupPrimClist()
FIXME_docs.
uint16_t fRxDscNxt[4]
rx nxt ring dsc
static const uint16_t kMODE_M_INTL
INTL: int loopback(DELUA)
static const uint32_t kUBAODD_M
bits of odd unibus address
bool ExecGetcmd(RlinkCommandList &clist)
FIXME_docs.
static const uint16_t kPR0_V_PCMDBP
PCMDBP: pcmd busy prot.
void StartTxRing()
FIXME_docs.
Rtime fRxPollTime
rx poll time interval
static const uint16_t kSTATE_RESET
reset
uint16_t TxRingIndexNext(uint16_t inc=1) const
FIXME_docs.
static const uint16_t kPCMD_HALT
HALT: halt.
static const uint16_t kFUNC_RSTAT
RSTAT: read status.
static const uint16_t kTXR2_M_ONE
ONE: one collision.
uint16_t fRxRingELen
rx ring entry length
static const uint16_t kMODE_M_DMNT
DMNT: dis maint message.
void SetRxQueLimit(size_t rxqlim)
FIXME_docs.
int RxPollHandler(const pollfd &pfd)
FIXME_docs.
static const uint16_t kPR0_M_PDMDWB
PDMDWB: pdmd while busy.
static const uint16_t kMODE_M_DRDC
DRDC: dis data chaining.
static const uint16_t kPR0_M_TXI
TXI: transmit rung intr.
std::string MacDefault() const
FIXME_docs.
static const uint16_t kPR0_M_PCMD
PCMD: port command.
static const uint16_t kRXR2_M_OWN
OWN: owned by DENUA.
static const uint16_t kTXR2_M_OWN
OWN: owned by DEUNA.
static const uint16_t kSTAT_M_TRNG
TRNG: tx ring error.
uint16_t fRxDscNxtPC[4]
rx nxt ring dsc from PrimClist
static const uint16_t kPR0
PR0 reg offset.
static const uint16_t kPCMD_STOP
STOP: stop.
static const uint16_t kPCMD_SELFTST
SELFTST: self test.
void LogRingFunc(const char *cmd)
FIXME_docs.
static const uint16_t kTXR3_M_UBTO
UBTO: UNIBUS timeout.
static const uint16_t kDimCtrDelua
DELUA count words (MAXCTR)
void UBAddrLen2Wlist(uint16_t wlist[2], uint32_t addr, uint16_t len)
FIXME_docs.
RtimerFd fRxPollTimer
rx poll timer
void LogFunc(const char *cmd, const char *tag1, uint16_t val1, const char *tag2=nullptr, uint16_t val2=0)
FIXME_docs.
static const uint16_t kTXR3_M_TDR
TDR: TDR value if RTRY=1.
size_t fPC_rdrxdsccur
PrimClist: rd rxdsc index.
static const uint16_t kRXR2_M_ENF
ENF: end of frame.
static const uint16_t kFUNC_WMODE
WMODE: write write.
static const uint16_t kDimCtr
max MAXCTR
size_t fRxQueLimit
rx queue limit
static const uint16_t kFUNC_RMODE
RMODE: read mode.
static const uint16_t kProbeOff
probe address offset (pr0)
uint32_t fCtrTxFraMcast
ctr: xmit mcast frames
static const uint16_t kRXR3_M_BUFL
BUFL: buf length error.
uint16_t fTxDscCur[4]
tx cur ring dsc
static const uint16_t kTXR2_M_ERRS
ERRS: error summary.
size_t fPC_rdpr0
PrimClist: rd pr0 index.
void SetType(const std::string &type)
FIXME_docs.
static const uint16_t kFUNC_RRF
RRF: read ring format.
RethBuf::pbuf_t fRxBufCurr
rx packet current
uint16_t fTxRingIndex
tx ring index
static const uint16_t kRXR2_M_FRAM
FRAM: frame error.
uint32_t fCtrFraLoop
ctr: loopback frames
size_t fPC_rdrxdscnxt
PrimClist: rd rxdsc index.
void ClearMacList()
FIXME_docs.
static const uint16_t kPCMD_GETPCBB
GETPCBB: get pcb base.
static const uint16_t kPCMD_NOOP
NOOP: noop.
std::deque< RethBuf::pbuf_t > fRxBufQueue
rx packet queue
uint32_t fCtrRxFra
ctr: rcvd frames
bool fPcbbValid
pcbb valid
uint16_t fPr0Last
last pr0 value
static const uint16_t kPR0_M_INTR
INTR: intr summary.
static const uint16_t kPR1_M_STATE
STATE: port status.
uint32_t TxRingDscAddr(uint16_t index) const
FIXME_docs.
static const uint16_t kTXR3_M_LCOL
LCOL: late collision.
static const uint16_t kMODE_M_TPAD
TPAD: tx msg padding ena.
void StartRxRing()
FIXME_docs.
static const uint16_t kDimMcast
max length Mcast list (MAXMLT)
bool Running() const
FIXME_docs.
uint16_t fPcb[4]
process control block
const char * MnemoFunc(uint16_t func) const
FIXME_docs.
static const uint16_t kPR3
PR3 reg offset.
size_t fRxBufOffset
rx packet offset
uint16_t fRxDscCur[4]
rx cur ring dsc
static const uint16_t kFUNC_RDPA
RDPA: read def MAC.
static const uint16_t kSTATE_SLOAD
secondary load
void UpdateStat16(uint32_t &stat, size_t ind, uint32_t inc=1)
FIXME_docs.
static const uint16_t kFUNC_RCTR
RCTR: read counters.
uint16_t fTxDscCurPC[4]
tx cur ring dsc from PrimClist
static const uint16_t kMODE_M_DTCR
DTCR: dis tx CRC.
static const uint16_t kTXR3_M_UFLO
UFLO: UNIBUS underflow.
static const uint16_t kMODE_M_ECT
ECT: ena collision test.
static const uint16_t kTXR3_M_BUFL
BUFL: buf length error.
static const uint16_t kIbaddr
DEUNA default address.
static const bool kProbeInt
probe int active
static const uint16_t kRXR2_M_CRC
CRC: CRC check error.
static const uint16_t kPR1_M_ICAB
ICAB: cable fail.
static const uint16_t kSTAT_M_RREV
RREV: ROM version.
size_t RxQueLimit() const
FIXME_docs.
static const uint16_t kRXR3_M_NCHN
NCHN: no data chaining.
static const uint16_t kPR0_M_BRST
RSET: breset seen.
static const uint16_t kFUNC_RPA
RPA: read phys MAC.
uint32_t fPcbb
process control block base
static const uint16_t kPR0_M_DNI
DNI: done intr.
static const uint16_t kPCMD_START
START: start tx/rx.
void SetRxPollTime(const Rtime &time)
FIXME_docs.
uint32_t fCtrRxFraLoBuf
ctr: rcvd frame lost buffers
bool RcvCallback(RethBuf::pbuf_t &pbuf)
FIXME_docs.
static const uint16_t kPC0_M_MBZ
MBZ.
void SetMacDefault(const std::string &mac)
FIXME_docs.
virtual void Start()
FIXME_docs.
RethBuf fTxBuf
tx packet buffer
size_t fPC_lapcb
PrimClist: la pcb index.
static const uint16_t kFUNC_RCSTAT
RCSTAT: read&clr status.
static const uint16_t kPR2
PR2 reg offset.
const char * MnemoPcmd(uint16_t pcmd) const
FIXME_docs.
uint32_t RingDscAddr(uint32_t base, uint16_t elen, uint16_t index) const
FIXME_docs.
static const uint16_t kRXR2_M_OFLO
OFLO: message overflow.
uint16_t fTxDscNxtPC[4]
tx nxt ring dsc from PrimClist
static const uint16_t kTXR2_M_STF
STF: start of frame.
static const uint16_t kSTAT_M_CERR
CERR: collision test er.
static const uint16_t kFUNC_WPA
WPA: write phys MAC.
static const uint16_t kSTAT_M_BABL
BABL: xmit on long(DELUA)
static const uint16_t kSTATE_NUHALT
ni and unibus halted
uint32_t fCtrTxByt
ctr: xmit bytes
uint32_t fCtrTxFra
ctr: xmit frames
static const uint16_t kSTATE_UHALT
unibus halted
const Rtime & RxPollTime() const
FIXME_docs.
size_t fPC_latxdscnxt
PrimClist: la txdsc nxt index.
static const uint16_t kPR0_M_SERI
SERI: status error intr.
static const bool kProbeRem
probr rem active
void StopTxRing()
FIXME_docs.
void LogRingInfo(char rxtx, char rw)
FIXME_docs.
void StopRxRing()
FIXME_docs.
void LogFrameInfo(char rxtx, const RethBuf &buf)
FIXME_docs.
int MacFilter(uint64_t mac)
FIXME_docs.
Rtime fCtrTimeCleared
ctr: time when cleared
uint16_t fRxRingIndex
rx ring index
static const uint16_t kTXR2_M_ENF
ENF: end of frame.
static const uint16_t kFUNC_WRF
WRF: write ring format.
static const uint16_t kPR1_M_XPWR
XPWR: transceive pwr fail.
virtual void Dump(std::ostream &os, int ind=0, const char *text=0, int detail=0) const
FIXME_docs.
size_t fPC_larxdsccur
PrimClist: la rxdsc index.
static const uint16_t kFUNC_RSID
RSID: read system id.
static const uint16_t kTXR3_M_RTRY
RTRY: retry failure.
uint32_t fTxRingBase
tx ring base
uint16_t fRxRingSize
rx ring size (# of entries)
uint16_t GetPr1() const
FIXME_docs.
static const uint16_t kSTAT_M_ERRS
ERRS: error summary.
void UpdateStat32(uint32_t &stat, size_t ind, uint32_t inc=1)
FIXME_docs.
static const uint16_t kTXR2_M_DEF
DEF: deferred.
int TxRingHandler()
FIXME_docs.
uint32_t RxRingDscAddr(uint16_t index) const
FIXME_docs.
static const uint16_t kTXR2_M_MORE
MORE: mult retry needed.
uint64_t fMacDefault
default MAC
uint16_t fTxRingSize
tx ring size (# of entries)
static const uint16_t kPR0_M_USCI
USCI: unsol state chang.
uint32_t fCtrRxByt
ctr: rcvd bytes
uint32_t fCtrTxBytMcast
ctr: xmit mcast bytes
static const uint16_t kPR0_M_BUSY
BUSY: command busy.
size_t fPC_rdtxdscnxt
PrimClist: rd txdsc nxt index.
static const uint16_t kPR0_M_INTE
INTE: intr enable.
static const uint16_t kSTATE_PLOAD
primary load
static const uint16_t kRXR3_M_OVRN
OVRN: overrun error.
static const uint16_t kFUNC_WMAL
RMAL: write mcast MAC list.
static const uint16_t kPCMD_BOOT
BOOT: boot.
static const uint16_t kSTAT_M_PTCH
PTCH: ROM patch.
int RxRingHandler()
FIXME_docs.
static const uint16_t kRXR2_M_SEGB
SEGB: msg of seg base.
static const uint16_t kTXR2_M_MTCH
MTCH: station match.
Rw11CntlDEUNA()
Default constructor.
static const uint16_t kPR0_B_PCMDBP
PCMDBP: pcmd busy prot.
static const uint16_t kSTATE_READY
ready
static const uint16_t kPR1_M_DELUA
ID0: 1=DELUA;0=DEUNA
uint32_t fRxRingBase
rx ring base
void LogMacFunc(const char *cmd, uint64_t mac)
FIXME_docs.
uint32_t fCtrRxBytMcast
ctr: rcvd mcast bytes
static const uint16_t kMODE_M_PROM
PROM: promiscous mode.
static const uint16_t kPR0_M_PCEI
PCEI: port cmd err intr.
static const uint16_t kPR0_M_PCWWB
PCWWB: pcmd write w busy.
size_t fTxBufOffset
tx packet offset
static const uint16_t kPR1_M_PCTO
PCTO: port cmd timeout.
void ClearCtr()
FIXME_docs.
bool fPr1Delua
pr1 delua flag
bool fRingValid
ring format valid
uint16_t fTxDscNxt[4]
tx nxt ring dsc
uint32_t fCtrRxFraLoInt
ctr: rcvd frame lost int error
uint16_t RingIndexNext(uint16_t index, uint16_t size, uint16_t inc=1) const
FIXME_docs.
size_t fPC_latxdsccur
PrimClist: la txdsc cur index.
uint16_t fRxDscCurPC[4]
rx cur ring dsc from PrimClist
static const uint16_t kMODE_M_MBZ_DELUA
MBZ bit:10,8:7,5:4,1.
const char * MnemoState(uint16_t state) const
FIXME_docs.
static const uint16_t kPR0_M_RCBI
RCBI: rcv buff unavail.
uint32_t fCtrRxFraMcast
ctr: rcvd mcast frames
size_t fPC_rdtxdsccur
PrimClist: rd txdsc cur index.
static const uint16_t kFUNC_NOOP
NOOP: noop.
enum s_tx fTxRingState
tx ring handler state
static const uint16_t kMODE_M_ENAL
ENAL: ena all mcasts.
static void SetRingDsc(uint16_t dst[4], const uint16_t src[4])
FIXME_docs.
static const uint16_t kDimCtrDeuna
DEUNA count words (MAXCTR)
~Rw11CntlDEUNA()
Destructor.
static const uint16_t kPCMD_PDMD
PDMD: poll demand.
static const uint16_t kDimPlt
max MAXPLT
static const uint16_t kFUNC_RCCTR
RCCTR: read&clr counters.
uint16_t fPr1State
pr1 state
static const uint16_t kMODE_M_HDPX
HDPX: half-duplex (DEUNA)
static const uint16_t kSTAT_M_RRAM
RRAM: run from RAM.
uint64_t fMacList[2+kDimMcast]
MAC list:0=phys,1=bcast,2+=mcast.
static const uint16_t kRXR2_M_STF
STF: start of frame.
static const uint16_t kRXR3_M_UBTO
UBTO: UNIBUS timeout.
static const uint16_t kPR1
PR1 reg offset.
bool fPr1Pcto
pr1 pcto flag
void SetRunning(bool run)
FIXME_docs.
size_t fPC_rdpcb
PrimClist: rd pcb index.
static const int kLam
DEUNA default lam.
uint16_t RxRingIndexNext(uint16_t inc=1) const
FIXME_docs.
static const uint16_t kMODE_M_LOOP
LOOP: int loopback.
static const uint16_t kSTATE_RUN
running
static const uint32_t kUBA_M
bits of even unibus address
void LogMcastFunc(const char *cmd)
FIXME_docs.
Declaration of class ReventLoop.