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