nic_bridge: cache card's MAC address (Fixes #869)

This commit is contained in:
Stefan Kalkowski 2013-08-22 17:32:17 +02:00 committed by Norman Feske
parent 26ba81175b
commit 6484edb657
2 changed files with 7 additions and 6 deletions

View File

@ -127,7 +127,8 @@ bool Net::Nic::handle_ip(Ethernet_frame *eth, Genode::size_t size) {
Net::Nic::Nic()
: _tx_block_alloc(Genode::env()->heap()),
_nic(&_tx_block_alloc, BUF_SIZE, BUF_SIZE)
_nic(&_tx_block_alloc, BUF_SIZE, BUF_SIZE),
_mac(_nic.mac_address().addr)
{
_nic.rx_channel()->sigh_ready_to_ack(_sink_ack);
_nic.rx_channel()->sigh_packet_avail(_sink_submit);

View File

@ -34,16 +34,16 @@ class Net::Nic : public Net::Packet_handler
BUF_SIZE = ::Nic::Session::QUEUE_SIZE * PACKET_SIZE,
};
::Nic::Packet_allocator _tx_block_alloc;
::Nic::Connection _nic;
::Nic::Packet_allocator _tx_block_alloc;
::Nic::Connection _nic;
Ethernet_frame::Mac_address _mac;
public:
Nic();
::Nic::Connection *nic() { return &_nic; }
Ethernet_frame::Mac_address mac() { return _nic.mac_address().addr; }
::Nic::Connection *nic() { return &_nic; }
Ethernet_frame::Mac_address mac() { return _mac; }
/******************************