Skip to content

Commit

Permalink
cargo fmt for fxmac and axdriver_net
Browse files Browse the repository at this point in the history
  • Loading branch information
elliott10 committed Feb 7, 2025
1 parent 7f97273 commit c1f0c8c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
10 changes: 6 additions & 4 deletions axdriver_net/src/fxmac.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
use crate::{EthernetAddress, NetBufPtr, NetDriverOps};
use alloc::boxed::Box;
use alloc::vec::Vec;
use alloc::collections::VecDeque;
use core::ptr::NonNull;
use alloc::vec::Vec;
use axdriver_base::{BaseDriverOps, DevError, DevResult, DeviceType};
use crate::{EthernetAddress, NetBufPtr, NetDriverOps};
use core::ptr::NonNull;

use fxmac_rs::{self, xmac_init, FXmac, FXmacLwipPortTx, FXmacRecvHandler};
use log::*;
use fxmac_rs::{self, FXmac, xmac_init, FXmacLwipPortTx, FXmacRecvHandler};

extern crate alloc;

const QS: usize = 64;
//const NET_BUF_LEN: usize = 1526;

/// fxmac driver device
pub struct FXmacNic {
inner: &'static mut FXmac,
rx_buffer_queue: VecDeque<NetBufPtr>,
Expand All @@ -22,6 +23,7 @@ unsafe impl Sync for FXmacNic {}
unsafe impl Send for FXmacNic {}

impl FXmacNic {
/// initialize fxmac driver
pub fn init(mapped_regs: usize) -> DevResult<Self> {
info!("FXmacNic init @ {:#x}", mapped_regs);
let rx_buffer_queue = VecDeque::with_capacity(QS);
Expand Down
7 changes: 4 additions & 3 deletions axdriver_net/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
//! Common traits and types for network device (NIC) drivers.
#![no_std]
#![feature(const_mut_refs)]

#[cfg(feature = "ixgbe")]
/// ixgbe NIC device driver.
pub mod ixgbe;
#[cfg(feature = "fxmac")]
/// fxmac driver for PhytiumPi
pub mod fxmac;
#[cfg(feature = "ixgbe")]
/// ixgbe NIC device driver.
pub mod ixgbe;
mod net_buf;

use core::ptr::NonNull;
Expand Down

0 comments on commit c1f0c8c

Please sign in to comment.