summaryrefslogtreecommitdiff
path: root/Kernel/Net
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2023-03-06 17:16:25 +0100
committerAndreas Kling <kling@serenityos.org>2023-03-06 23:46:35 +0100
commit359d6e7b0b0ef7add9eb2015d0dd664a82cf73d7 (patch)
treebe51963e0f0dc7e1eeeb670188c8fe1fa5eea37f /Kernel/Net
parent689ca370d4eca80eb5c3856a69c3eed4ed848a29 (diff)
downloadserenity-359d6e7b0b0ef7add9eb2015d0dd664a82cf73d7.zip
Everywhere: Stop using NonnullOwnPtrVector
Same as NonnullRefPtrVector: weird semantics, questionable benefits.
Diffstat (limited to 'Kernel/Net')
-rw-r--r--Kernel/Net/Realtek/RTL8168NetworkAdapter.cpp8
-rw-r--r--Kernel/Net/Realtek/RTL8168NetworkAdapter.h4
2 files changed, 6 insertions, 6 deletions
diff --git a/Kernel/Net/Realtek/RTL8168NetworkAdapter.cpp b/Kernel/Net/Realtek/RTL8168NetworkAdapter.cpp
index 4d74da54d8..6020d26d3e 100644
--- a/Kernel/Net/Realtek/RTL8168NetworkAdapter.cpp
+++ b/Kernel/Net/Realtek/RTL8168NetworkAdapter.cpp
@@ -1103,7 +1103,7 @@ UNMAP_AFTER_INIT void RTL8168NetworkAdapter::initialize_rx_descriptors()
descriptor.buffer_size = RX_BUFFER_SIZE;
descriptor.flags = RXDescriptor::Ownership; // let the NIC know it can use this descriptor
- auto physical_address = m_rx_buffers_regions[i].physical_page(0)->paddr().get();
+ auto physical_address = m_rx_buffers_regions[i]->physical_page(0)->paddr().get();
descriptor.buffer_address_low = physical_address & 0xFFFFFFFF;
descriptor.buffer_address_high = (u64)physical_address >> 32; // cast to prevent shift count >= with of type warnings in 32 bit systems
}
@@ -1120,7 +1120,7 @@ UNMAP_AFTER_INIT void RTL8168NetworkAdapter::initialize_tx_descriptors()
m_tx_buffers_regions.append(move(region));
descriptor.flags = TXDescriptor::FirstSegment | TXDescriptor::LastSegment;
- auto physical_address = m_tx_buffers_regions[i].physical_page(0)->paddr().get();
+ auto physical_address = m_tx_buffers_regions[i]->physical_page(0)->paddr().get();
descriptor.buffer_address_low = physical_address & 0xFFFFFFFF;
descriptor.buffer_address_high = (u64)physical_address >> 32;
}
@@ -1213,7 +1213,7 @@ void RTL8168NetworkAdapter::send_raw(ReadonlyBytes payload)
}
dbgln_if(RTL8168_DEBUG, "RTL8168: Chose descriptor {}", m_tx_free_index);
- memcpy(m_tx_buffers_regions[m_tx_free_index].vaddr().as_ptr(), payload.data(), payload.size());
+ memcpy(m_tx_buffers_regions[m_tx_free_index]->vaddr().as_ptr(), payload.data(), payload.size());
m_tx_free_index = (m_tx_free_index + 1) % number_of_tx_descriptors;
@@ -1247,7 +1247,7 @@ void RTL8168NetworkAdapter::receive()
// Our maximum received packet size is smaller than the descriptor buffer size, so packets should never be segmented
// if this happens on a real NIC it might not respect that, and we will have to support packet segmentation
} else {
- did_receive({ m_rx_buffers_regions[descriptor_index].vaddr().as_ptr(), length });
+ did_receive({ m_rx_buffers_regions[descriptor_index]->vaddr().as_ptr(), length });
}
descriptor.buffer_size = RX_BUFFER_SIZE;
diff --git a/Kernel/Net/Realtek/RTL8168NetworkAdapter.h b/Kernel/Net/Realtek/RTL8168NetworkAdapter.h
index 2b1c741b08..4e199d9533 100644
--- a/Kernel/Net/Realtek/RTL8168NetworkAdapter.h
+++ b/Kernel/Net/Realtek/RTL8168NetworkAdapter.h
@@ -205,10 +205,10 @@ private:
NonnullOwnPtr<IOWindow> m_registers_io_window;
u32 m_ocp_base_address { 0 };
OwnPtr<Memory::Region> m_rx_descriptors_region;
- NonnullOwnPtrVector<Memory::Region> m_rx_buffers_regions;
+ Vector<NonnullOwnPtr<Memory::Region>> m_rx_buffers_regions;
u16 m_rx_free_index { 0 };
OwnPtr<Memory::Region> m_tx_descriptors_region;
- NonnullOwnPtrVector<Memory::Region> m_tx_buffers_regions;
+ Vector<NonnullOwnPtr<Memory::Region>> m_tx_buffers_regions;
u16 m_tx_free_index { 0 };
bool m_link_up { false };
EntropySource m_entropy_source;