1 use alloc::sync::Arc; 2 use system_error::SystemError; 3 4 use crate::{ 5 exception::{ 6 irqdata::IrqHandlerData, 7 irqdesc::{IrqHandler, IrqReturn}, 8 IrqNumber, 9 }, 10 net::net_core::poll_ifaces_try_lock_onetime, 11 }; 12 13 /// 默认的网卡中断处理函数 14 #[derive(Debug)] 15 pub struct DefaultNetIrqHandler; 16 17 impl IrqHandler for DefaultNetIrqHandler { handle( &self, _irq: IrqNumber, _static_data: Option<&dyn IrqHandlerData>, _dynamic_data: Option<Arc<dyn IrqHandlerData>>, ) -> Result<IrqReturn, SystemError>18 fn handle( 19 &self, 20 _irq: IrqNumber, 21 _static_data: Option<&dyn IrqHandlerData>, 22 _dynamic_data: Option<Arc<dyn IrqHandlerData>>, 23 ) -> Result<IrqReturn, SystemError> { 24 poll_ifaces_try_lock_onetime().ok(); 25 Ok(IrqReturn::Handled) 26 } 27 } 28