Skip to content

Commit

Permalink
feat: rebase to master
Browse files Browse the repository at this point in the history
  • Loading branch information
hky1999 committed Nov 12, 2023
1 parent 20fe99c commit b2adb57
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/device/net/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub use self::{dev::VirtIONet, net_buf::RxBuffer, net_buf::TxBuffer};

use crate::volatile::ReadOnly;
use bitflags::bitflags;
use zerocopy::{AsBytes, FromBytes};
use zerocopy::{AsBytes, FromBytes, FromZeroes};

const MAX_BUFFER_LEN: usize = 65535;
const MIN_BUFFER_LEN: usize = 1526;
Expand Down Expand Up @@ -112,7 +112,7 @@ type EthernetAddress = [u8; 6];
/// and buffers for incoming packets are placed in the receiveq1. . .receiveqN.
/// In each case, the packet itself is preceded by a header.
#[repr(C)]
#[derive(AsBytes, Debug, Default, FromBytes)]
#[derive(AsBytes, Debug, Default, FromBytes, FromZeroes)]
pub struct VirtioNetHdr {
flags: Flags,
gso_type: GsoType,
Expand All @@ -124,7 +124,7 @@ pub struct VirtioNetHdr {
// payload starts from here
}

#[derive(AsBytes, Copy, Clone, Debug, Default, Eq, FromBytes, PartialEq)]
#[derive(AsBytes, Copy, Clone, Debug, Default, Eq, FromBytes, FromZeroes, PartialEq)]
#[repr(transparent)]
struct Flags(u8);

Expand All @@ -137,7 +137,7 @@ bitflags! {
}

#[repr(transparent)]
#[derive(AsBytes, Debug, Copy, Clone, Default, Eq, FromBytes, PartialEq)]
#[derive(AsBytes, Debug, Copy, Clone, Default, Eq, FromBytes, FromZeroes, PartialEq)]
struct GsoType(u8);

impl GsoType {
Expand Down

0 comments on commit b2adb57

Please sign in to comment.