-
Notifications
You must be signed in to change notification settings - Fork 13.5k
std: sys: net: uefi: tcp4: Implement write #141532
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
A blocking implementation of tcp4 write. Signed-off-by: Ayush Singh <[email protected]>
@rustbot label +O-UEFI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few nits but this looks reasonable to me. @nicholasbishop would you mind double checking since this is UEFI?
let protocol = self.protocol.as_ptr(); | ||
let mut token = tcp4::IoToken { | ||
completion_token, | ||
packet: tcp4::IoTokenPacket { tx_data: &mut tx_data as *mut _ as *mut _ }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
packet: tcp4::IoTokenPacket { tx_data: ptr::from_mut(&mut tx_data).cast::<whatever>() },
What casts are needed? tx_data
should be tcp4::TransmitData
, and that looks like what is expected in https://docs.rs/r-efi/latest/r_efi/protocols/tcp4/union.IoTokenPacket.html.
Also, isn't rx_data
missing?
|
||
let fragment = tcp4::FragmentData { | ||
fragment_length: data_len, | ||
fragment_buffer: buf.as_ptr() as *mut _, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit to make the cast obvious (especially since it includes a mutability change)
fragment_buffer: buf.as_ptr().cast::<c_void>().cast_mut()
A blocking implementation of tcp4 write.