OpenCores
URL https://opencores.org/ocsvn/w11/w11/trunk

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.7/] [tools/] [src/] [librlink/] [RlinkPacketBufRcv.cpp] - Diff between revs 27 and 28

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 27 Rev 28
Line 1... Line 1...
// $Id: RlinkPacketBufRcv.cpp 607 2014-11-30 20:02:48Z mueller $
// $Id: RlinkPacketBufRcv.cpp 621 2014-12-26 21:20:05Z mueller $
//
//
// Copyright 2014- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Copyright 2014- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
//
// This program is free software; you may redistribute and/or modify it under
// This program is free software; you may redistribute and/or modify it under
// the terms of the GNU General Public License as published by the Free
// the terms of the GNU General Public License as published by the Free
Line 11... Line 11...
// or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
// or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
// for complete details.
// for complete details.
// 
// 
// Revision History: 
// Revision History: 
// Date         Rev Version  Comment
// Date         Rev Version  Comment
 
// 2014-12-25   621   1.0.1  Reorganize packet send/revd stats
// 2014-11-30   607   1.0    Initial version
// 2014-11-30   607   1.0    Initial version
// 2014-11-02   600   0.1    First draft (re-organize PacketBuf for rlink v4)
// 2014-11-02   600   0.1    First draft (re-organize PacketBuf for rlink v4)
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
 
 
/*!
/*!
  \file
  \file
  \version $Id: RlinkPacketBufRcv.cpp 607 2014-11-30 20:02:48Z mueller $
  \version $Id: RlinkPacketBufRcv.cpp 621 2014-12-26 21:20:05Z mueller $
  \brief   Implemenation of class RlinkPacketBuf.
  \brief   Implemenation of class RlinkPacketBuf.
 */
 */
 
 
#include <sys/time.h>
#include <sys/time.h>
 
 
Line 53... Line 54...
    fEscSeen(false),
    fEscSeen(false),
    fNakIndex(-1),
    fNakIndex(-1),
    fDropData()
    fDropData()
{
{
  // Statistic setup
  // Statistic setup
 
  fStats.Define(kStatNRxPktByt, "NRxPktByt", "Rx packet bytes rcvd");
  fStats.Define(kStatNRxDrop,   "NRxDrop",   "Rx bytes dropped");
  fStats.Define(kStatNRxDrop,   "NRxDrop",   "Rx bytes dropped");
  fStats.Define(kStatNRxSop,    "NRxSop",    "Rx SOP commas seen");
  fStats.Define(kStatNRxSop,    "NRxSop",    "Rx SOP commas seen");
  fStats.Define(kStatNRxEop,    "NRxEop",    "Rx EOP commas seen");
  fStats.Define(kStatNRxEop,    "NRxEop",    "Rx EOP commas seen");
  fStats.Define(kStatNRxNak,    "NRxNak",    "Rx NAK commas seen");
  fStats.Define(kStatNRxNak,    "NRxNak",    "Rx NAK commas seen");
  fStats.Define(kStatNRxAttn,   "NRxAttn",   "Rx ATTN commas seen");
  fStats.Define(kStatNRxAttn,   "NRxAttn",   "Rx ATTN commas seen");
Line 270... Line 272...
      switch (ec) {
      switch (ec) {
 
 
      case kEcEop:                          // EOP seen
      case kEcEop:                          // EOP seen
        SetFlagBit(kFlagEopSeen);           // -> set eop and return
        SetFlagBit(kFlagEopSeen);           // -> set eop and return
        fRcvState = kRcvDone;
        fRcvState = kRcvDone;
 
        fStats.Inc(kStatNRxPktByt, double(PktSize()));
        return;
        return;
 
 
      case kEcNak:                          // NAK seen
      case kEcNak:                          // NAK seen
        if (TestFlag(kFlagAttnSeen|kFlagNakSeen)) {  // NAK after ATTN or NAK
        if (TestFlag(kFlagAttnSeen|kFlagNakSeen)) {  // NAK after ATTN or NAK
          SetFlagBit(kFlagErrFrame);          // -> set frame error and return
          SetFlagBit(kFlagErrFrame);          // -> set frame error and return

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.