feat(driver): 把virtio添加到sysfs (#752)

This commit is contained in:
LoGin
2024-04-22 15:11:47 +08:00
committed by GitHub
parent a17651b14b
commit e32effb150
21 changed files with 1131 additions and 279 deletions

View File

@ -5,7 +5,7 @@ use core::{
use alloc::{collections::BTreeMap, sync::Arc};
use crate::{driver::net::NetDriver, libs::rwlock::RwLock};
use crate::{driver::net::NetDevice, libs::rwlock::RwLock};
use smoltcp::wire::IpEndpoint;
use self::socket::SocketInode;
@ -18,7 +18,7 @@ pub mod syscall;
lazy_static! {
/// # 所有网络接口的列表
/// 这个列表在中断上下文会使用到因此需要irqsave
pub static ref NET_DRIVERS: RwLock<BTreeMap<usize, Arc<dyn NetDriver>>> = RwLock::new(BTreeMap::new());
pub static ref NET_DEVICES: RwLock<BTreeMap<usize, Arc<dyn NetDevice>>> = RwLock::new(BTreeMap::new());
}
/// 生成网络接口的id (全局自增)