mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-30 00:23:24 +00:00
Refactor drivers
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
d809eca81d
commit
edd808bd3d
@ -3,10 +3,10 @@ use smoltcp::{phy, time::Instant};
|
||||
|
||||
use crate::{
|
||||
buffer::{RxBuffer, TxBuffer},
|
||||
NetworkDevice,
|
||||
AnyNetworkDevice,
|
||||
};
|
||||
|
||||
impl phy::Device for dyn NetworkDevice {
|
||||
impl phy::Device for dyn AnyNetworkDevice {
|
||||
type RxToken<'a> = RxToken;
|
||||
type TxToken<'a> = TxToken<'a>;
|
||||
|
||||
@ -43,7 +43,7 @@ impl phy::RxToken for RxToken {
|
||||
}
|
||||
}
|
||||
|
||||
pub struct TxToken<'a>(&'a mut dyn NetworkDevice);
|
||||
pub struct TxToken<'a>(&'a mut dyn AnyNetworkDevice);
|
||||
|
||||
impl<'a> phy::TxToken for TxToken<'a> {
|
||||
fn consume<R, F>(self, len: usize, f: F) -> R
|
||||
|
Reference in New Issue
Block a user