diff options
| author | 2025-04-23 04:25:39 +1000 | |
|---|---|---|
| committer | 2025-04-23 04:25:39 +1000 | |
| commit | 670e2062cb0afac2280f9221faab4fc58171c5ea (patch) | |
| tree | fbb5df69129c930dc4a7b37e61811d49f2f5e07f /src/osd/modules/netdev/netdev_common.cpp | |
| parent | 9058810fe26f9e1f562c25062418dfd5335e397f (diff) | |
osd: Got rid of the gross globals and functions for manipulating them in the network modules.
Diffstat (limited to 'src/osd/modules/netdev/netdev_common.cpp')
| -rw-r--r-- | src/osd/modules/netdev/netdev_common.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/osd/modules/netdev/netdev_common.cpp b/src/osd/modules/netdev/netdev_common.cpp new file mode 100644 index 00000000000..b6a2328c7a6 --- /dev/null +++ b/src/osd/modules/netdev/netdev_common.cpp @@ -0,0 +1,39 @@ +// license:BSD-3-Clause +// copyright-holders:Carl + +#include "netdev_common.h" + + +namespace osd { + +network_device_base::network_device_base(network_handler &handler) + : m_handler(handler) + , m_stopped(true) +{ +} + +network_device_base::~network_device_base() +{ +} + +void network_device_base::start() +{ + m_stopped = false; +} + +void network_device_base::stop() +{ + m_stopped = true; +} + +void network_device_base::poll() +{ + uint8_t *buf; + int len; + while (!m_stopped && (len = recv_dev(&buf))) + { + m_handler.recv_cb(buf, len); + } +} + +} // namespace osd |
