Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ class IEthernetDriverSystem
virtual void setGroupcastAddressRecognition(::etl::array<uint8_t, 6> const mac) const = 0;
virtual bool getLinkStatus(size_t port) = 0;
virtual bool writeFrame(struct netif* const aNetif, struct pbuf* const buf) = 0;
virtual ::lwiputils::PbufQueue::Receiver getRx() = 0;
virtual ::lwiputils::PbufQueue& getRx() = 0;
};
} // namespace ethernet
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,7 @@ class TapEthernetSystem final

bool writeFrame(netif* ni, pbuf* pb) override;

::lwiputils::PbufQueue::Receiver getRx() override
{
return ::lwiputils::PbufQueue::Receiver(_driver._queue);
}
::lwiputils::PbufQueue& getRx() override { return _driver._queue; }

::async::ContextType _context;
::async::TimeoutType _rxTimeout;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,7 @@ class S32K148EvbEthernetSystem final
return _driver.writeFrame(aNetif, buf);
}

::lwiputils::PbufQueue::Receiver getRx() override
{
return ::lwiputils::PbufQueue::Receiver(_driver._rxBuffers._queue);
}
::lwiputils::PbufQueue& getRx() override { return _driver._rxBuffers._queue; }

::async::ContextType const _context;
::async::TimeoutType _timeout;
Expand Down
6 changes: 3 additions & 3 deletions libs/bsw/lwipSocket/include/lwipSocket/utils/LwipHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

#pragma once

#include <etl/queue_spsc_atomic.h>
#include <etl/span.h>
#include <ip/IPAddress.h>
#include <util/spsc/Queue.h>

extern "C"
{
Expand All @@ -33,7 +33,7 @@ struct RxCustomPbuf
void* slot;
};

using PbufQueue = ::util::spsc::Queue<pbuf*, 10>;
using PbufQueue = ::etl::queue_spsc_atomic<pbuf*, 10>;

err_t initNetifDriverParameters(::etl::span<uint8_t const, 6> const macAddr, netif& lwipNetif);
::ip::IPAddress from_lwipIp(ip_addr_t const& lwipIp);
Expand All @@ -47,7 +47,7 @@ inline ip_addr_t to_lwipIp(::ip::IPAddress const& ip)
}

bool processPbufQueue(
::lwiputils::PbufQueue::Receiver receiver,
::lwiputils::PbufQueue& receiver,
::etl::span<netif> lwnetifs,
::etl::span<uint16_t const> vlanIds);
} // namespace lwiputils
8 changes: 6 additions & 2 deletions libs/bsw/lwipSocket/src/lwipSocket/utils/FilterFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ netif* filterETHFrames(
* Input all pbufs to their respective interfaces
*/
bool processPbufQueue(
::lwiputils::PbufQueue::Receiver receiver,
::lwiputils::PbufQueue& receiver,
::etl::span<netif> const lwnetifs,
::etl::span<uint16_t const> const vlanIds)
{
Expand All @@ -101,7 +101,11 @@ bool processPbufQueue(
auto const queued = receiver.size();
for (size_t i = 0; i < queued; ++i)
{
auto* const p = receiver.read();
pbuf* p = nullptr;
if (!receiver.pop(p))
{
break;
}
auto* const pNetIf = filterETHFrames(p, lwnetifs, vlanIds);
if ((pNetIf != nullptr) && (pNetIf->input != nullptr))
{
Expand Down
254 changes: 0 additions & 254 deletions libs/bsw/util/include/util/spsc/Queue.h

This file was deleted.

Loading
Loading