w11 - cpp 0.794
Backend server for Rlink and w11
Loading...
Searching...
No Matches
Rw11CntlDZ11.cpp
Go to the documentation of this file.
1// $Id: Rw11CntlDZ11.cpp 1185 2019-07-12 17:29:12Z mueller $
2// SPDX-License-Identifier: GPL-3.0-or-later
3// Copyright 2019- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4//
5// Revision History:
6// Date Rev Version Comment
7// 2019-05-19 1150 1.0 Initial version
8// 2019-05-04 1146 0.1 First draft
9// ---------------------------------------------------------------------------
10
15#include <functional>
16#include <algorithm>
17
18#include "librtools/RosFill.hpp"
22#include "librtools/RlogMsg.hpp"
23
24#include "RtraceTools.hpp"
25#include "Rw11CntlDZ11.hpp"
26
27using namespace std;
28using namespace std::placeholders;
29
35// all method definitions in namespace Retro
36namespace Retro {
37
38//------------------------------------------+-----------------------------------
39// constants definitions
40
41const uint16_t Rw11CntlDZ11::kIbaddr;
42const int Rw11CntlDZ11::kLam;
43
44const uint16_t Rw11CntlDZ11::kCNTL;
45const uint16_t Rw11CntlDZ11::kSTAT;
46const uint16_t Rw11CntlDZ11::kFUSE;
47const uint16_t Rw11CntlDZ11::kFDAT;
48
49const uint16_t Rw11CntlDZ11::kProbeOff;
52
53const uint16_t Rw11CntlDZ11::kFifoMaxSize;
54
55const uint16_t Rw11CntlDZ11::kCNTL_V_AWDTH;
56const uint16_t Rw11CntlDZ11::kCNTL_B_AWDTH;
57const uint16_t Rw11CntlDZ11::kCNTL_V_SSEL;
58const uint16_t Rw11CntlDZ11::kCNTL_B_SSEL;
59const uint16_t Rw11CntlDZ11::kCNTL_M_MSE;
60const uint16_t Rw11CntlDZ11::kCNTL_M_MAINT;
61
62const uint16_t Rw11CntlDZ11::kCNTL_V_DATA;
63const uint16_t Rw11CntlDZ11::kCNTL_B_DATA;
64const uint16_t Rw11CntlDZ11::kCNTL_V_RRLIM;
65const uint16_t Rw11CntlDZ11::kCNTL_B_RRLIM;
66const uint16_t Rw11CntlDZ11::kCNTL_V_TRLIM;
67const uint16_t Rw11CntlDZ11::kCNTL_B_TRLIM;
68const uint16_t Rw11CntlDZ11::kCNTL_M_RCLR;
69const uint16_t Rw11CntlDZ11::kCNTL_M_TCLR;
70const uint16_t Rw11CntlDZ11::kCNTL_M_FUNC;
71
72const uint16_t Rw11CntlDZ11::kSSEL_DTLE;
73const uint16_t Rw11CntlDZ11::kSSEL_BRRK;
74const uint16_t Rw11CntlDZ11::kSSEL_CORI;
75const uint16_t Rw11CntlDZ11::kSSEL_RLCN;
76
77const uint16_t Rw11CntlDZ11::kFUNC_NOOP;
78const uint16_t Rw11CntlDZ11::kFUNC_SCO;
79const uint16_t Rw11CntlDZ11::kFUNC_SRING;
80const uint16_t Rw11CntlDZ11::kFUNC_SRLIM;
81
82const uint16_t Rw11CntlDZ11::kCAL_DTR;
83const uint16_t Rw11CntlDZ11::kCAL_BRK;
84const uint16_t Rw11CntlDZ11::kCAL_RXON;
85const uint16_t Rw11CntlDZ11::kCAL_CSR;
86
87const uint16_t Rw11CntlDZ11::kFUSE_V_RFUSE;
88const uint16_t Rw11CntlDZ11::kFUSE_B_RFUSE;
89const uint16_t Rw11CntlDZ11::kFUSE_M_TFUSE;
90
91const uint16_t Rw11CntlDZ11::kFDAT_M_VAL;
92const uint16_t Rw11CntlDZ11::kFDAT_M_LAST;
93const uint16_t Rw11CntlDZ11::kFDAT_M_FERR;
94const uint16_t Rw11CntlDZ11::kFDAT_M_CAL;
95const uint16_t Rw11CntlDZ11::kFDAT_V_LINE;
96const uint16_t Rw11CntlDZ11::kFDAT_B_LINE;
97const uint16_t Rw11CntlDZ11::kFDAT_M_BUF;
98
99const uint16_t Rw11CntlDZ11::kCALCSR_M_MSE;
100const uint16_t Rw11CntlDZ11::kCALCSR_M_CLR;
101const uint16_t Rw11CntlDZ11::kCALCSR_M_MAINT;
102
103//------------------------------------------+-----------------------------------
105
107 : Rw11CntlBase<Rw11UnitDZ11,8>("dz11"),
108 fPC_fdat(0),
109 fPC_fuse(0),
110 fRxQlim(0),
111 fRxRlim(0),
112 fTxRlim(0),
113 fModCntl(false),
114 fItype(0),
115 fFsize(0),
116 fTxRblkSize(4),
117 fTxQueBusy(false),
118 fRxCurUnit(0),
119 fLastFuse(0),
120 fCurDtr(0),
121 fCurBrk(0),
122 fCurRxon(0),
123 fCurCsr(0)
124{
125 // must be here because Units have a back-ptr (not available at Rw11CntlBase)
126 for (size_t i=0; i<NUnit(); i++) {
127 fspUnit[i].reset(new Rw11UnitDZ11(this, i));
128 }
129
130 fStats.Define(kStatNRxBlk, "NRxBlk" , "wblk done");
131 fStats.Define(kStatNTxQue, "NTxQue" , "rblk queued");
132 fStats.Define(kStatNCalDtr, "NCalDtr" , "cal dtr received");
133 fStats.Define(kStatNCalBrk, "NCalBrk" , "cal brk received");
134 fStats.Define(kStatNCalRxon, "NCalRxon" , "cal rxon received");
135 fStats.Define(kStatNCalCsr, "NCalCsr" , "cal csr received");
136 fStats.Define(kStatNCalBad, "NCalBad" , "cal invalid");
137 fStats.Define(kStatNDropMse, "NDropMse" , "drop because mse=0");
138 fStats.Define(kStatNDropMaint,"NDropMaint", "drop because maint=1");
139 fStats.Define(kStatNDropRxon, "NDropRxon" , "drop because rxon=0");
140}
141
142//------------------------------------------+-----------------------------------
144
146{}
147
148//------------------------------------------+-----------------------------------
150
151void Rw11CntlDZ11::Config(const std::string& name, uint16_t base, int lam)
152{
153 ConfigCntl(name, base, lam, kProbeOff, kProbeInt, kProbeRem);
154 return;
155}
156
157//------------------------------------------+-----------------------------------
159
161{
162 if (fStarted || fLam<0 || !fEnable || !fProbe.Found())
163 throw Rexception("Rw11CntlDZ11::Start",
164 "Bad state: started, no lam, not enable, not found");
165
166 // add device register address ibus and rbus mappings
167 // done here because now Cntl bound to Cpu and Cntl probed
168 Cpu().AllIAddrMapInsert(Name()+".csr", Base() + kCNTL);
169 Cpu().AllIAddrMapInsert(Name()+".rbuf", Base() + kSTAT);
170 Cpu().AllIAddrMapInsert(Name()+".tcr", Base() + kFUSE);
171 Cpu().AllIAddrMapInsert(Name()+".tdr", Base() + kFDAT);
172
173 // detect device type
175 fFsize = (1<<fItype) - 1;
176 fRxQlim = fFsize;
177
178 // ensure unit status is initialized
179 Cpu().ExecWibr(fBase+kCNTL, kCNTL_M_RCLR|kCNTL_M_TCLR); // clear rx,tx fifo
180 UnitSetupAll(); // setup rlim,...
181
182 // setup primary info clist
189
190 // add attn handler
192 uint16_t(1)<<fLam, this);
193 fStarted = true;
194 return;
195}
196
197//------------------------------------------+-----------------------------------
199
200 void Rw11CntlDZ11::UnitSetup(size_t /*ind*/)
201{
202 UnitSetupAll();
203 return;
204}
205
206//------------------------------------------+-----------------------------------
208
210{
211 uint16_t srlim = ((fRxRlim & kCNTL_B_RRLIM) << kCNTL_V_RRLIM) |
213 // if no modem control co is all ones, otherwise the attach pattern
214 uint8_t co = 0;
215 if (fModCntl) {
216 for (size_t i=0; i<NUnit(); i++) {
217 if (fspUnit[i]->HasVirt()) co |= uint8_t(1)<<i;
218 }
219 } else {
220 co = 0xff;
221 }
222 uint16_t sco = (uint16_t(co) << kCNTL_V_DATA) | kFUNC_SCO;
223
224 Cpu().ExecWibr(fBase+kCNTL, srlim, fBase+kCNTL, sco);
225
226 return;
227}
228
229//------------------------------------------+-----------------------------------
231
233{
234 // is last know rfuse more than half fifo size get an update
235 // in most cases no update will be needed
236 uint16_t rfuse = (fLastFuse >>kFUSE_V_RFUSE) & kFUSE_B_RFUSE;
237 if (rfuse > fFsize/2) {
239 }
240
242 return;
243}
244
245//------------------------------------------+-----------------------------------
247
248void Rw11CntlDZ11::SetRxQlim(uint16_t qlim)
249{
250 if (qlim == 0) qlim = fFsize;
251 if (qlim > fFsize)
252 throw Rexception("Rw11CntlDZ11::SetRxQlim",
253 "Bad args: qlim larger than fifosize");
254
255 fRxQlim = qlim;
256 return;
257}
258
259//------------------------------------------+-----------------------------------
261
262void Rw11CntlDZ11::SetRxRlim(uint16_t rlim)
263{
264 if (rlim > kCNTL_B_RRLIM)
265 throw Rexception("Rw11CntlDZ11::SetRxRlim","Bad args: rlim too large");
266
267 fRxRlim = rlim;
268 UnitSetupAll();
269 return;
270}
271
272//------------------------------------------+-----------------------------------
274
275void Rw11CntlDZ11::SetTxRlim(uint16_t rlim)
276{
277 if (rlim > kCNTL_B_TRLIM)
278 throw Rexception("Rw11CntlDZ11::SetTxRlim","Bad args: rlim too large");
279
280 fTxRlim = rlim;
281 UnitSetupAll();
282 return;
283}
284
285//------------------------------------------+-----------------------------------
287
288void Rw11CntlDZ11::SetModCntl(bool modcntl)
289{
290 fModCntl = modcntl;
291 UnitSetupAll();
292 return;
293}
294
295//------------------------------------------+-----------------------------------
297
298void Rw11CntlDZ11::Dump(std::ostream& os, int ind, const char* text,
299 int detail) const
300{
301 RosFill bl(ind);
302 os << bl << (text?text:"--") << "Rw11CntlDZ11 @ " << this << endl;
303 os << bl << " fPC_fdat: " << fPC_fdat << endl;
304 os << bl << " fPC_fuse: " << fPC_fuse << endl;
305 os << bl << " fRxQlim: " << RosPrintf(fRxQlim,"d",3) << endl;
306 os << bl << " fRxRlim: " << RosPrintf(fRxRlim,"d",3) << endl;
307 os << bl << " fTxRlim: " << RosPrintf(fTxRlim,"d",3) << endl;
308 os << bl << " fModCntl: " << RosPrintf(fModCntl) << endl;
309 os << bl << " fItype: " << RosPrintf(fItype,"d",3) << endl;
310 os << bl << " fFsize: " << RosPrintf(fFsize,"d",3) << endl;
311 os << bl << " fTxRblkSize: " << RosPrintf(fTxRblkSize,"d",3) << endl;
312 os << bl << " fTxQueBusy: " << RosPrintf(fTxQueBusy) << endl;
313 os << bl << " fRxCurUnit: " << RosPrintf(fRxCurUnit,"d",3) << endl;
314 os << bl << " fLastFuse: " << RosPrintf(fLastFuse,"d",3) << endl;
315 os << bl << " fCurDtr: " << RosPrintBvi(fCurDtr,2) << endl;
316 os << bl << " fCurBrk: " << RosPrintBvi(fCurBrk,2) << endl;
317 os << bl << " fCurRxon: " << RosPrintBvi(fCurRxon,2) << endl;
318 os << bl << " fCurCsr: " << RosPrintBvi(fCurCsr,2)
319 << " mse=" << ((fCurCsr&kCALCSR_M_MSE)!=0)
320 << " maint=" << ((fCurCsr&kCALCSR_M_MAINT)!=0) << endl;
321
322 Rw11CntlBase<Rw11UnitDZ11,8>::Dump(os, ind, " ^", detail);
323 return;
324}
325
326//------------------------------------------+-----------------------------------
328
330{
333
334 fLastFuse = fPrimClist[fPC_fuse].Data();
335
338 return 0;
339}
340
341//------------------------------------------+-----------------------------------
343
344void Rw11CntlDZ11::RxProcess(uint16_t fuse)
345{
346 uint16_t rfuse = (fuse >>kFUSE_V_RFUSE) & kFUSE_B_RFUSE;
347
348 if (rfuse >= fRxQlim) return; // no space in fifo -> quit
349 uint16_t nmax = fRxQlim - rfuse; // limit is fifo space
350 vector<uint16_t> iblock;
351 iblock.reserve(nmax);
352 while (iblock.size() < nmax) {
353 if (!NextBusyRxUnit()) break; // find busy unit, quit if none
354 size_t qsize = fspUnit[fRxCurUnit]->RcvQueueSize();
355 if (qsize > nmax-iblock.size()) qsize = nmax-iblock.size();
356 for (size_t i=0; i<qsize; i++) {
357 uint8_t ichr = fspUnit[fRxCurUnit]->RcvQueueNext();
358 uint16_t iwrd = ((uint16_t(fRxCurUnit) & kFDAT_B_LINE) << kFDAT_V_LINE) |
359 ichr;
360 if (!(fCurCsr & kCALCSR_M_MSE)) { // drop if mse=0
362 } else if (fCurCsr & kCALCSR_M_MAINT) { // drop if maint=1
364 } else if (!(fCurRxon & (uint8_t(1)<<fRxCurUnit))) { // drop if rxon=0
366 } else {
367 iblock.push_back(iwrd);
368 fspUnit[fRxCurUnit]->StatIncRx(ichr);
369 }
370 }
371 }
372
373 if (iblock.size() == 0) return; // nothing found
374
375 if (fTraceLevel > 0) {
376 RlogMsg lmsg(LogFile());
377 lmsg << "-I " << Name() << ": rx "
378 << " rfuse=" << RosPrintf(rfuse,"d",3)
379 << " size=" << RosPrintf(iblock.size(),"d",3);
380 if (fTraceLevel > 1) RtraceTools::TraceBuffer(lmsg, iblock.data(),
381 iblock.size(), fTraceLevel);
382 }
383
385 RlinkCommandList clist;
386 Cpu().AddWbibr(clist, fBase+kFDAT, move(iblock));
387 int ifuse = Cpu().AddRibr(clist, fBase+kFUSE);
388 Server().Exec(clist);
389
390 fLastFuse = clist[ifuse].Data(); // remember fuse after fifo write
391
392 return;
393}
394
395//------------------------------------------+-----------------------------------
397
398void Rw11CntlDZ11::TxProcess(const RlinkCommand& cmd, bool prim, uint16_t fuse)
399{
400 size_t done = cmd.BlockDone();
401 if (done == 0) return;
402
403 uint16_t tfuse = fuse & kFUSE_M_TFUSE;
404 uint16_t rfuse = (fuse >>kFUSE_V_RFUSE) & kFUSE_B_RFUSE;
405 const uint16_t* xbuf = cmd.BlockPointer();
406 bool lastseen = false;
407
408 uint8_t sndbuf[kNUnit][kFifoMaxSize+1];
409 size_t sndcnt[kNUnit] = {};
410
411 for (size_t i=0; i < done; i++) {
412 uint16_t xwrd = xbuf[i];
413 bool last = xwrd & kFDAT_M_LAST;
414 bool ferr = xwrd & kFDAT_M_FERR;
415 bool cal = xwrd & kFDAT_M_CAL;
416 uint16_t line = (xwrd>>kFDAT_V_LINE) & kFDAT_B_LINE;
417 uint8_t ochr = xwrd & kFDAT_M_BUF;
418 if (last) lastseen = true;
419 if (ferr) {
420 fspUnit[line]->StatIncTx(0, true); // count
421 continue; // and ignore
422 }
423 if (cal) {
424 switch (line) {
425 case kCAL_DTR:
426 fCurDtr = ochr;
428 if (fTraceLevel > 0) {
429 RlogMsg lmsg(LogFile());
430 lmsg << "-I " << Name() << ": cal dtr=" << RosPrintBvi(ochr,2);
431 }
432 break;
433 case kCAL_BRK:
434 fCurBrk = ochr;
436 if (fTraceLevel > 0) {
437 RlogMsg lmsg(LogFile());
438 lmsg << "-I " << Name() << ": cal brk=" << RosPrintBvi(ochr,2);
439 }
440 break;
441 case kCAL_RXON:
442 fCurRxon = ochr;
444 if (fTraceLevel > 0) {
445 RlogMsg lmsg(LogFile());
446 lmsg << "-I " << Name() << ": cal rxon=" << RosPrintBvi(ochr,2);
447 }
448 break;
449 case kCAL_CSR:
450 fCurCsr = ochr;
452 if (ochr & kCALCSR_M_CLR) {
453 fCurRxon = 0;
454 fCurBrk = 0;
455 }
456 if (fTraceLevel > 0) {
457 RlogMsg lmsg(LogFile());
458 lmsg << "-I " << Name() << ": cal csr=" << RosPrintBvi(ochr,2)
459 << " mse=" << ((ochr&kCALCSR_M_MSE)!=0)
460 << " clr=" << ((ochr&kCALCSR_M_CLR)!=0)
461 << " maint=" << ((ochr&kCALCSR_M_MAINT)!=0);
462 }
463 break;
464 default:
466 if (fTraceLevel > 0) {
467 RlogMsg lmsg(LogFile());
468 lmsg << "-E " << Name() << ": cal code bad:" << RosPrintf(line,"d");
469 }
470 break;
471 }
472 } else {
473 fspUnit[line]->StatIncTx(ochr);
474 sndbuf[line][sndcnt[line]++] = ochr;
475 }
476 }
477
478 for (size_t i = 0; i < kNUnit; i++) {
479 if (sndcnt[i]) fspUnit[i]->Snd(sndbuf[i], sndcnt[i]);
480 }
481
482 // determine next chunk size: done+tfuse, at least 4, at most fFsize
483 fTxRblkSize = uint16_t(done)+tfuse;
484 fTxRblkSize = max(uint16_t(4), min(fTxRblkSize, fFsize));
485
486 // queue further reads when queue idle and fifo not emptied
487 if ((!fTxQueBusy) && done > 0 && (!lastseen)) {
489 fTxQueBusy = true;
491 }
492
493 if (fTraceLevel > 0) {
494 RlogMsg lmsg(LogFile());
495 lmsg << "-I " << Name() << ": tx "
496 << " pr,si,do=" << prim
497 << "," << RosPrintf(cmd.BlockSize(),"d",3)
498 << "," << RosPrintf(done,"d",3)
499 << " last=" << lastseen
500 << " tfuse=" << RosPrintf(tfuse,"d",3)
501 << " que=" << fTxQueBusy;
502 if (prim) {
503 lmsg << " rfuse=" << RosPrintf(rfuse,"d",3);
504 }
505 if (fTraceLevel > 1) RtraceTools::TraceBuffer(lmsg, xbuf,
506 done, fTraceLevel);
507 }
508
509 // re-sizing the prim rblk invalidates pbuf -> so must be done last
510 if (prim) { // if primary list
511 fPrimClist[fPC_fdat].SetBlockRead(fTxRblkSize); // setup size for next attn
512 }
513
514 return;
515}
516
517//------------------------------------------+-----------------------------------
519
521{
522 fTxQueBusy = false;
523 RlinkCommandList clist;
524 int ifdat = Cpu().AddRbibr(clist, fBase+kFDAT, fTxRblkSize);
525 clist[ifdat].SetExpectStatus(0, RlinkCommand::kStat_M_RbTout |
527 int ifuse = Cpu().AddRibr(clist, fBase+kFUSE);
528
529 Server().Exec(clist);
530
531 fLastFuse = clist[ifuse].Data();
532 TxProcess(clist[ifdat], false, fLastFuse);
533
534 return 0;
535}
536
537//------------------------------------------+-----------------------------------
539
541{
542 for (size_t i=0; i<NUnit(); i++) {
543 fRxCurUnit += 1;
544 if (fRxCurUnit >= NUnit()) fRxCurUnit = 0;
545 if (!fspUnit[fRxCurUnit]->RcvQueueEmpty()) return true;
546 }
547 return false;
548}
549
550} // end namespace Retro
FIXME_docs.
Definition: Rexception.hpp:29
size_t AddAttn()
FIXME_docs.
static const uint8_t kStat_M_RbNak
stat: rbnak flag set
static const uint8_t kStat_M_RbTout
stat: rbtout flag set
size_t BlockSize() const
FIXME_docs.
size_t BlockDone() const
FIXME_docs.
uint16_t * BlockPointer()
FIXME_docs.
void AddAttnHandler(attnhdl_t &&attnhdl, uint16_t mask, void *cdata=nullptr)
FIXME_docs.
void QueueAction(actnhdl_t &&actnhdl)
FIXME_docs.
void GetAttnInfo(AttnArgs &args, RlinkCommandList &clist)
FIXME_docs.
bool Exec(RlinkCommandList &clist, RerrMsg &emsg)
FIXME_docs.
Definition: RlinkServer.ipp:60
FIXME_docs.
Definition: RlogMsg.hpp:24
I/O appicator to generate fill characters.
Definition: RosFill.hpp:24
void Inc(size_t ind, double val=1.)
FIXME_docs.
Definition: Rstats.ipp:29
void Define(size_t ind, const std::string &name, const std::string &text)
FIXME_docs.
Definition: Rstats.cpp:72
Implemenation (inline) of Rw11CntlBase.
static const size_t kNUnit
number of units
virtual void Dump(std::ostream &os, int ind=0, const char *text=0, int detail=0) const
FIXME_docs.
virtual size_t NUnit() const
FIXME_docs.
std::shared_ptr< Rw11UnitDZ11 > fspUnit[NU]
static const bool kProbeRem
probr rem active
int TxRcvHandler()
FIXME_docs.
static const uint16_t kFDAT_M_VAL
fdat.val mask
static const uint16_t kCAL_BRK
static const uint16_t kProbeOff
probe address offset (cntl)
void SetTxRlim(uint16_t rlim)
FIXME_docs.
static const uint16_t kCNTL_M_MAINT
cntl.maint mask
static const uint16_t kCNTL_B_SSEL
cntl.ssel bit mask
static const uint16_t kCNTL_V_AWDTH
cntl.awdth shift
static const uint16_t kFUSE_M_TFUSE
tfuse mask
void SetRxQlim(uint16_t qlim)
FIXME_docs.
static const uint16_t kFUNC_SRLIM
uint8_t fCurCsr
current csr
bool fTxQueBusy
tx queue busy
virtual void UnitSetupAll()
FIXME_docs.
static const uint16_t kCNTL_V_SSEL
cntl.ssel shift
static const uint16_t kCNTL
CNTL and CSR reg offset.
uint16_t fTxRblkSize
tx rblk chunk size
static const uint16_t kSSEL_BRRK
virtual void Dump(std::ostream &os, int ind=0, const char *text=0, int detail=0) const
FIXME_docs.
static const uint16_t kFUSE_V_RFUSE
rfuse shift
void SetRxRlim(uint16_t rlim)
FIXME_docs.
static const bool kProbeInt
probe int active
static const uint16_t kCNTL_B_DATA
cntl.data bit mask
void TxProcess(const RlinkCommand &cmd, bool prim, uint16_t fuse)
FIXME_docs.
static const uint16_t kFDAT_M_CAL
fdat.cal mask
uint16_t fFsize
fifo size
static const uint16_t kCNTL_M_TCLR
cntl.rclr mask
static const uint16_t kFDAT_V_LINE
fdat.line shift
static const uint16_t kSSEL_DTLE
int AttnHandler(RlinkServer::AttnArgs &args)
FIXME_docs.
uint16_t fLastFuse
last seen fuse
static const uint16_t kSSEL_RLCN
static const uint16_t kCNTL_V_DATA
cntl.data shift
static const uint16_t kCNTL_M_RCLR
cntl.rclr mask
void SetModCntl(bool modcntl)
FIXME_docs.
size_t fPC_fuse
PrimClist: fuse index.
uint16_t fRxRlim
rx interrupt rate limit
@ kStatNDropMaint
drop because maint=1
@ kStatNCalBrk
cal brk received
@ kStatNCalBad
cal invalid
@ kStatNCalDtr
cal dtr received
@ kStatNDropRxon
drop because rxon=0
@ kStatNCalCsr
cal csr received
@ kStatNDropMse
drop because mse=0
@ kStatNTxQue
queue rblk
@ kStatNCalRxon
cal rxon received
static const uint16_t kCAL_DTR
~Rw11CntlDZ11()
Destructor.
static const uint16_t kFDAT_M_LAST
fdat.last mask
static const uint16_t kCNTL_M_MSE
cntl.mse mask
bool fModCntl
modem control enable
static const uint16_t kCNTL_V_RRLIM
cntl.rrlim shift
static const uint16_t kFDAT
FDAT and TDR/MSR reg offset.
uint16_t fRxQlim
rx queue limit
static const uint16_t kCAL_RXON
static const uint16_t kCNTL_B_TRLIM
cntl.trlim bit mask
static const uint16_t kCNTL_B_RRLIM
cntl.rrlim bit mask
void Wakeup()
FIXME_docs.
uint8_t fCurBrk
current brk
bool NextBusyRxUnit()
FIXME_docs.
void RxProcess(uint16_t fuse)
FIXME_docs.
static const uint16_t kCAL_CSR
void Config(const std::string &name, uint16_t base, int lam)
FIXME_docs.
static const uint16_t kCNTL_M_FUNC
cntl.func mask
static const uint16_t kCNTL_B_AWDTH
cntl.awdth bit mask
size_t fPC_fdat
PrimClist: fdat index.
static const uint16_t kCNTL_V_TRLIM
cntl.trlim shift
static const uint16_t kFifoMaxSize
maximal fifo size
virtual void Start()
FIXME_docs.
size_t fRxCurUnit
rx current unit
virtual void UnitSetup(size_t ind)
FIXME_docs.
uint8_t fCurRxon
current rxon
static const uint16_t kFDAT_B_LINE
fdat.line bit mask
Rw11CntlDZ11()
Default constructor.
uint16_t fItype
interface type
static const uint16_t kFUSE_B_RFUSE
rfuse bit mask
static const uint16_t kFUNC_SRING
uint8_t fCurDtr
current dtr
static const uint16_t kFUNC_SCO
static const uint16_t kCALCSR_M_MAINT
fdat_cal.maint mask
uint16_t fTxRlim
tx interrupt rate limit
static const uint16_t kFDAT_M_BUF
fdat.buf mask
static const uint16_t kFUNC_NOOP
static const uint16_t kCALCSR_M_MSE
fdat_cal.mse mask
static const uint16_t kSSEL_CORI
static const uint16_t kCALCSR_M_CLR
fdat_cal.clr mask
static const int kLam
DZ11 default lam.
static const uint16_t kIbaddr
DZ11 default address.
static const uint16_t kFDAT_M_FERR
fdat.ferr mask
static const uint16_t kSTAT
STAT and RBUF/LPR reg offset.
static const uint16_t kFUSE
FUSE and TCR reg offset.
int fLam
attn bit number (-1 of none)
Definition: Rw11Cntl.hpp:110
uint32_t fTraceLevel
trace level; 0=off;1=cntl
Definition: Rw11Cntl.hpp:114
RlinkCommandList fPrimClist
clist for attn primary info
Definition: Rw11Cntl.hpp:115
uint16_t Base() const
FIXME_docs.
Definition: Rw11Cntl.ipp:88
Rstats fStats
statistics
Definition: Rw11Cntl.hpp:116
Rw11Probe fProbe
controller probe context
Definition: Rw11Cntl.hpp:113
Rw11Cpu & Cpu() const
FIXME_docs.
Definition: Rw11Cntl.ipp:32
void ConfigCntl(const std::string &name, uint16_t base, int lam, uint16_t probeoff, bool probeint, bool proberem)
FIXME_docs.
Definition: Rw11Cntl.cpp:156
bool fStarted
true if Start() called
Definition: Rw11Cntl.hpp:112
bool fEnable
enable flag
Definition: Rw11Cntl.hpp:111
RlinkServer & Server() const
FIXME_docs.
Definition: Rw11Cntl.ipp:48
const std::string & Name() const
FIXME_docs.
Definition: Rw11Cntl.ipp:80
RlogFile & LogFile() const
FIXME_docs.
Definition: Rw11Cntl.ipp:64
uint16_t fBase
controller base address
Definition: Rw11Cntl.hpp:109
void AllIAddrMapInsert(const std::string &name, uint16_t ibaddr)
FIXME_docs.
Definition: Rw11Cpu.cpp:902
uint16_t ExecRibr(uint16_t ibaddr)
FIXME_docs.
Definition: Rw11Cpu.cpp:506
int AddRbibr(RlinkCommandList &clist, uint16_t ibaddr, size_t size)
FIXME_docs.
Definition: Rw11Cpu.cpp:375
void ExecWibr(uint16_t ibaddr0, uint16_t data0, uint16_t ibaddr1=0, uint16_t data1=0, uint16_t ibaddr2=0, uint16_t data2=0)
FIXME_docs.
Definition: Rw11Cpu.cpp:491
int AddRibr(RlinkCommandList &clist, uint16_t ibaddr)
FIXME_docs.
Definition: Rw11Cpu.cpp:354
int AddWbibr(RlinkCommandList &clist, uint16_t ibaddr, const std::vector< uint16_t > &block)
FIXME_docs.
Definition: Rw11Cpu.cpp:385
RosPrintfS< bool > RosPrintf(bool value, const char *form=0, int width=0, int prec=0)
Creates a print object for the formatted output of a bool value.
Definition: RosPrintf.ipp:38
void TraceBuffer(RlogMsg &lmsg, const uint16_t *pbuf, size_t done, uint32_t level)
FIXME_docs.
Definition: RtraceTools.cpp:34
Declaration of class ReventLoop.
Definition: ReventLoop.cpp:47
bool Found() const
FIXME_docs.
Definition: Rw11Probe.cpp:52
uint16_t DataRem() const
FIXME_docs.
Definition: Rw11Probe.ipp:28