Lines Matching refs:T
23 pub struct VirtioNICDriver<T: Transport> {
24 pub inner: Arc<SpinLock<VirtIONet<HalImpl, T, 2>>>,
27 impl<T: Transport> Clone for VirtioNICDriver<T> {
38 struct VirtioNICDriverWrapper<T: Transport>(UnsafeCell<VirtioNICDriver<T>>);
39 unsafe impl<T: Transport> Send for VirtioNICDriverWrapper<T> {}
40 unsafe impl<T: Transport> Sync for VirtioNICDriverWrapper<T> {}
42 impl<T: Transport> Deref for VirtioNICDriverWrapper<T> {
43 type Target = VirtioNICDriver<T>;
48 impl<T: Transport> DerefMut for VirtioNICDriverWrapper<T> {
54 impl<T: Transport> VirtioNICDriverWrapper<T> {
55 fn force_get_mut(&self) -> &mut VirtioNICDriver<T> { in force_get_mut() argument
60 impl<T: Transport> Debug for VirtioNICDriver<T> {
66 pub struct VirtioInterface<T: Transport> {
67 driver: VirtioNICDriverWrapper<T>,
73 impl<T: Transport> Debug for VirtioInterface<T> {
84 impl<T: Transport> VirtioInterface<T> {
85 pub fn new(mut driver: VirtioNICDriver<T>) -> Arc<Self> { in new()
98 let driver: VirtioNICDriverWrapper<T> = VirtioNICDriverWrapper(UnsafeCell::new(driver)); in new()
110 impl<T: 'static + Transport> VirtioNICDriver<T> {
111 pub fn new(driver_net: VirtIONet<HalImpl, T, 2>) -> Self { in new() argument
122 let inner: Arc<SpinLock<VirtIONet<HalImpl, T, 2>>> = Arc::new(SpinLock::new(driver_net)); in new()
128 pub struct VirtioNetToken<T: Transport> {
129 driver: VirtioNICDriver<T>,
133 impl<'a, T: Transport> VirtioNetToken<T> {
135 driver: VirtioNICDriver<T>, in new() argument
142 impl<T: Transport> phy::Device for VirtioNICDriver<T> {
143 type RxToken<'a> = VirtioNetToken<T> where Self: 'a;
144 type TxToken<'a> = VirtioNetToken<T> where Self: 'a;
185 impl<T: Transport> phy::TxToken for VirtioNetToken<T> {
200 impl<T: Transport> phy::RxToken for VirtioNetToken<T> {
218 pub fn virtio_net<T: Transport + 'static>(transport: T) { in virtio_net() argument
219 let driver_net: VirtIONet<HalImpl, T, 2> = in virtio_net()
220 match VirtIONet::<HalImpl, T, 2>::new(transport, 4096) { in virtio_net()
228 let driver: VirtioNICDriver<T> = VirtioNICDriver::new(driver_net); in virtio_net()
239 impl<T: Transport> Driver for VirtioInterface<T> {
245 impl<T: Transport> NetDriver for VirtioInterface<T> {