Skip to content

Commit 0426e9e

Browse files
uefi: Replace TftpOpcode with PxeBaseCodeTftpOpcode from uefi-raw
1 parent fd72002 commit 0426e9e

File tree

1 file changed

+9
-20
lines changed

1 file changed

+9
-20
lines changed

uefi/src/proto/network/pxe.rs

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ use crate::proto::unsafe_protocol;
1313
use crate::util::ptr_write_unaligned_and_add;
1414
use bitflags::bitflags;
1515
use ptr_meta::Pointee;
16+
use uefi_raw::protocol::network::pxe::PxeBaseCodeTftpOpcode;
1617

1718
use crate::{CStr8, Char8, Result, Status, StatusExt};
1819

@@ -41,7 +42,7 @@ pub struct BaseCode {
4142
) -> Status,
4243
mtftp: unsafe extern "efiapi" fn(
4344
this: &Self,
44-
operation: TftpOpcode,
45+
operation: PxeBaseCodeTftpOpcode,
4546
buffer: *mut c_void,
4647
overwrite: bool,
4748
buffer_size: &mut u64,
@@ -156,7 +157,7 @@ impl BaseCode {
156157
let status = unsafe {
157158
(self.mtftp)(
158159
self,
159-
TftpOpcode::TftpGetFileSize,
160+
PxeBaseCodeTftpOpcode::TFTP_GET_FILE_SIZE,
160161
null_mut(),
161162
false,
162163
&mut buffer_size,
@@ -187,7 +188,7 @@ impl BaseCode {
187188
let status = unsafe {
188189
(self.mtftp)(
189190
self,
190-
TftpOpcode::TftpReadFile,
191+
PxeBaseCodeTftpOpcode::TFTP_READ_FILE,
191192
buffer_ptr,
192193
false,
193194
&mut buffer_size,
@@ -215,7 +216,7 @@ impl BaseCode {
215216
unsafe {
216217
(self.mtftp)(
217218
self,
218-
TftpOpcode::TftpWriteFile,
219+
PxeBaseCodeTftpOpcode::TFTP_WRITE_FILE,
219220
buffer_ptr,
220221
overwrite,
221222
&mut buffer_size,
@@ -243,7 +244,7 @@ impl BaseCode {
243244
let status = unsafe {
244245
(self.mtftp)(
245246
self,
246-
TftpOpcode::TftpReadDirectory,
247+
PxeBaseCodeTftpOpcode::TFTP_READ_DIRECTORY,
247248
buffer_ptr,
248249
false,
249250
&mut buffer_size,
@@ -316,7 +317,7 @@ impl BaseCode {
316317
let status = unsafe {
317318
(self.mtftp)(
318319
self,
319-
TftpOpcode::MtftpGetFileSize,
320+
PxeBaseCodeTftpOpcode::MTFTP_GET_FILE_SIZE,
320321
null_mut(),
321322
false,
322323
&mut buffer_size,
@@ -348,7 +349,7 @@ impl BaseCode {
348349
let status = unsafe {
349350
(self.mtftp)(
350351
self,
351-
TftpOpcode::MtftpReadFile,
352+
PxeBaseCodeTftpOpcode::MTFTP_READ_FILE,
352353
buffer_ptr,
353354
false,
354355
&mut buffer_size,
@@ -376,7 +377,7 @@ impl BaseCode {
376377
let status = unsafe {
377378
(self.mtftp)(
378379
self,
379-
TftpOpcode::MtftpReadDirectory,
380+
PxeBaseCodeTftpOpcode::MTFTP_READ_DIRECTORY,
380381
buffer_ptr,
381382
false,
382383
&mut buffer_size,
@@ -798,18 +799,6 @@ impl Server {
798799
}
799800
}
800801

801-
/// Corresponds to the `EFI_PXE_BASE_CODE_TFTP_OPCODE` type in the C API.
802-
#[repr(C)]
803-
enum TftpOpcode {
804-
TftpGetFileSize = 1,
805-
TftpReadFile,
806-
TftpWriteFile,
807-
TftpReadDirectory,
808-
MtftpGetFileSize,
809-
MtftpReadFile,
810-
MtftpReadDirectory,
811-
}
812-
813802
/// MTFTP connection parameters
814803
///
815804
/// Corresponds to the `EFI_PXE_BASE_CODE_MTFTP_INFO` type in the C API.

0 commit comments

Comments
 (0)