w11 - cpp 0.794
Backend server for Rlink and w11
Loading...
Searching...
No Matches
Rw11CntlDEUNA.ipp
Go to the documentation of this file.
1// $Id: Rw11CntlDEUNA.ipp 1186 2019-07-12 17:49:59Z mueller $
2// SPDX-License-Identifier: GPL-3.0-or-later
3// Copyright 2017- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4//
5// Revision History:
6// Date Rev Version Comment
7// 2017-02-25 856 1.0 Initial version
8// ---------------------------------------------------------------------------
9
14// all method definitions in namespace Retro
15namespace Retro {
16
17//--------------------------------------+-----------------------------------
19inline const Rtime& Rw11CntlDEUNA::RxPollTime() const
20{
21 return fRxPollTime;
22}
23
24//--------------------------------------+-----------------------------------
26inline size_t Rw11CntlDEUNA::RxQueLimit() const
27{
28 return fRxQueLimit;
29}
30
31//--------------------------------------+-----------------------------------
33inline bool Rw11CntlDEUNA::Running() const
34{
35 return fRunning;
36}
37
38//--------------------------------------+-----------------------------------
40inline void Rw11CntlDEUNA::Wlist2UBAddr(const uint16_t wlist[2], uint32_t& addr)
41{
42 addr = uint32_t(wlist[0]) | uint32_t(wlist[1])<<16;
43 return;
44}
45
46//--------------------------------------+-----------------------------------
48inline void Rw11CntlDEUNA::Wlist2UBAddrLen(const uint16_t wlist[2],
49 uint32_t& addr, uint16_t& len)
50{
51 addr = uint32_t(wlist[0]) | uint32_t(wlist[1] & 0xff)<<16;
52 len = (wlist[1]>>8) & 0xff;
53 return;
54}
55
56//--------------------------------------+-----------------------------------
58inline void Rw11CntlDEUNA::UBAddrLen2Wlist(uint16_t wlist[2],
59 uint32_t addr, uint16_t len)
60{
61 wlist[0] = uint16_t(addr);
62 wlist[1] = uint16_t(addr>>16) | ((len & 0xff)<<8);
63 return;
64}
65
66//--------------------------------------+-----------------------------------
68inline uint16_t Rw11CntlDEUNA::RingIndexNext(uint16_t index, uint16_t size,
69 uint16_t inc) const
70{
71 uint16_t next = index + inc;
72 if (next >= size) next -= size;
73 return next;
74}
75
76//--------------------------------------+-----------------------------------
78inline uint16_t Rw11CntlDEUNA::TxRingIndexNext(uint16_t inc) const
79{
81}
82
83//--------------------------------------+-----------------------------------
85inline uint16_t Rw11CntlDEUNA::RxRingIndexNext(uint16_t inc) const
86{
88}
89
90//--------------------------------------+-----------------------------------
92inline uint32_t Rw11CntlDEUNA::RingDscAddr(uint32_t base, uint16_t elen,
93 uint16_t index) const
94{
95 return base + 2 * uint32_t(elen) * uint32_t(index);
96}
97
98//--------------------------------------+-----------------------------------
100inline uint32_t Rw11CntlDEUNA::TxRingDscAddr(uint16_t index) const
101{
102 return fTxRingBase + 2 * uint32_t(fTxRingELen) * uint32_t(index);
103}
104
105//--------------------------------------+-----------------------------------
107inline uint32_t Rw11CntlDEUNA::RxRingDscAddr(uint16_t index) const
108{
109 return fRxRingBase + 2 * uint32_t(fRxRingELen) * uint32_t(index);
110}
111
112//--------------------------------------+-----------------------------------
114inline void Rw11CntlDEUNA::SetRingDsc(uint16_t dst[4], const uint16_t src[4])
115{
116 dst[0] = src[0];
117 dst[1] = src[1];
118 dst[2] = src[2];
119 dst[3] = src[3];
120 return;
121}
122
123} // end namespace Retro
FIXME_docs.
Definition: Rtime.hpp:25
uint16_t fTxRingELen
tx ring entry length
bool fRunning
in kSTATE_RUN and active
void Wlist2UBAddrLen(const uint16_t wlist[2], uint32_t &addr, uint16_t &len)
FIXME_docs.
void Wlist2UBAddr(const uint16_t wlist[2], uint32_t &addr)
FIXME_docs.
Rtime fRxPollTime
rx poll time interval
uint16_t TxRingIndexNext(uint16_t inc=1) const
FIXME_docs.
uint16_t fRxRingELen
rx ring entry length
void UBAddrLen2Wlist(uint16_t wlist[2], uint32_t addr, uint16_t len)
FIXME_docs.
size_t fRxQueLimit
rx queue limit
uint16_t fTxRingIndex
tx ring index
uint32_t TxRingDscAddr(uint16_t index) const
FIXME_docs.
bool Running() const
FIXME_docs.
size_t RxQueLimit() const
FIXME_docs.
uint32_t RingDscAddr(uint32_t base, uint16_t elen, uint16_t index) const
FIXME_docs.
const Rtime & RxPollTime() const
FIXME_docs.
uint16_t fRxRingIndex
rx ring index
uint32_t fTxRingBase
tx ring base
uint16_t fRxRingSize
rx ring size (# of entries)
uint32_t RxRingDscAddr(uint16_t index) const
FIXME_docs.
uint16_t fTxRingSize
tx ring size (# of entries)
uint32_t fRxRingBase
rx ring base
uint16_t RingIndexNext(uint16_t index, uint16_t size, uint16_t inc=1) const
FIXME_docs.
static void SetRingDsc(uint16_t dst[4], const uint16_t src[4])
FIXME_docs.
uint16_t RxRingIndexNext(uint16_t inc=1) const
FIXME_docs.
Declaration of class ReventLoop.
Definition: ReventLoop.cpp:47