mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-24 18:03:25 +00:00
Move network polling code to bottom half
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
9804f053f2
commit
7d24e63216
@ -2,12 +2,13 @@
|
||||
|
||||
use alloc::{collections::linked_list::LinkedList, sync::Arc};
|
||||
|
||||
use aster_softirq::BottomHalfDisabled;
|
||||
use ostd::{
|
||||
mm::{
|
||||
Daddr, DmaDirection, DmaStream, FrameAllocOptions, HasDaddr, Infallible, VmReader,
|
||||
VmWriter, PAGE_SIZE,
|
||||
},
|
||||
sync::{LocalIrqDisabled, SpinLock},
|
||||
sync::SpinLock,
|
||||
Pod,
|
||||
};
|
||||
use spin::Once;
|
||||
@ -17,14 +18,14 @@ use crate::dma_pool::{DmaPool, DmaSegment};
|
||||
pub struct TxBuffer {
|
||||
dma_stream: DmaStream,
|
||||
nbytes: usize,
|
||||
pool: &'static SpinLock<LinkedList<DmaStream>, LocalIrqDisabled>,
|
||||
pool: &'static SpinLock<LinkedList<DmaStream>, BottomHalfDisabled>,
|
||||
}
|
||||
|
||||
impl TxBuffer {
|
||||
pub fn new<H: Pod>(
|
||||
header: &H,
|
||||
packet: &[u8],
|
||||
pool: &'static SpinLock<LinkedList<DmaStream>, LocalIrqDisabled>,
|
||||
pool: &'static SpinLock<LinkedList<DmaStream>, BottomHalfDisabled>,
|
||||
) -> Self {
|
||||
let header = header.as_bytes();
|
||||
let nbytes = header.len() + packet.len();
|
||||
|
Reference in New Issue
Block a user