Skip to content

Commit

Permalink
Merge branch 'dev/202405' into user/v-yitawu/DecodeUefiLog
Browse files Browse the repository at this point in the history
  • Loading branch information
YiTa-AMI authored Feb 19, 2025
2 parents f5d51c2 + f55d046 commit 2a09a96
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
9 changes: 9 additions & 0 deletions HidPkg/UefiHidDxeV2/src/keyboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,9 @@ impl HidReportReceiver for KeyboardHidHandler {
fn initialize(&mut self, controller: efi::Handle, hid_io: &dyn HidIo) -> Result<(), efi::Status> {
let descriptor = hid_io.get_report_descriptor()?;
self.process_descriptor(descriptor)?;
// Set the key toggle state here so that the subsequent reset() can send the LED state to the device.
self.set_key_toggle_state(protocols::simple_text_input_ex::CAPS_LOCK_ACTIVE);
self.reset(hid_io, true)?;
self.install_protocol_interfaces(controller)?;
self.initialize_keyboard_layout()?;
Ok(())
Expand Down Expand Up @@ -819,6 +822,7 @@ mod test {
let boot_services = create_fake_static_boot_service();
let mut keyboard_handler = KeyboardHidHandler::new(boot_services, 1 as efi::Handle);
let mut hid_io = MockHidIo::new();
hid_io.expect_set_output_report().returning(|_, _| Ok(()));
hid_io
.expect_get_report_descriptor()
.returning(|| Ok(hidparser::parse_report_descriptor(&MOUSE_REPORT_DESCRIPTOR).unwrap()));
Expand All @@ -840,6 +844,7 @@ mod test {

let mut keyboard_handler = KeyboardHidHandler::new(boot_services, 1 as efi::Handle);
let mut hid_io = MockHidIo::new();
hid_io.expect_set_output_report().returning(|_, _| Ok(()));
hid_io
.expect_get_report_descriptor()
.returning(|| Ok(hidparser::parse_report_descriptor(&BOOT_KEYBOARD_REPORT_DESCRIPTOR).unwrap()));
Expand All @@ -863,6 +868,7 @@ mod test {

let mut keyboard_handler = KeyboardHidHandler::new(boot_services, 1 as efi::Handle);
let mut hid_io = MockHidIo::new();
hid_io.expect_set_output_report().returning(|_, _| Ok(()));
hid_io
.expect_get_report_descriptor()
.returning(|| Ok(hidparser::parse_report_descriptor(&BOOT_KEYBOARD_REPORT_DESCRIPTOR).unwrap()));
Expand Down Expand Up @@ -1088,6 +1094,7 @@ mod test {
unsafe { HANDLER = &mut keyboard_handler as *mut KeyboardHidHandler };

let mut hid_io = MockHidIo::new();
hid_io.expect_set_output_report().returning(|_, _| Ok(()));
hid_io
.expect_get_report_descriptor()
.returning(|| Ok(hidparser::parse_report_descriptor(&BOOT_KEYBOARD_REPORT_DESCRIPTOR).unwrap()));
Expand Down Expand Up @@ -1158,6 +1165,7 @@ mod test {

let mut keyboard_handler = KeyboardHidHandler::new(boot_services, 1 as efi::Handle);
let mut hid_io = MockHidIo::new();
hid_io.expect_set_output_report().returning(|_, _| Ok(()));
hid_io
.expect_get_report_descriptor()
.returning(|| Ok(hidparser::parse_report_descriptor(&BOOT_KEYBOARD_REPORT_DESCRIPTOR).unwrap()));
Expand Down Expand Up @@ -1222,6 +1230,7 @@ mod test {

let mut keyboard_handler = KeyboardHidHandler::new(boot_services, 1 as efi::Handle);
let mut hid_io = MockHidIo::new();
hid_io.expect_set_output_report().returning(|_, _| Ok(()));
hid_io
.expect_get_report_descriptor()
.returning(|| Ok(hidparser::parse_report_descriptor(&BOOT_KEYBOARD_REPORT_DESCRIPTOR).unwrap()));
Expand Down
2 changes: 2 additions & 0 deletions HidPkg/UefiHidDxeV2/src/keyboard/simple_text_in.rs
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,7 @@ mod test {
let mut keyboard_handler = KeyboardHidHandler::new(boot_services, 1 as efi::Handle);

let mut hid_io = MockHidIo::new();
hid_io.expect_set_output_report().returning(|_, _| Ok(()));
hid_io
.expect_get_report_descriptor()
.returning(|| Ok(hidparser::parse_report_descriptor(&BOOT_KEYBOARD_REPORT_DESCRIPTOR).unwrap()));
Expand Down Expand Up @@ -607,6 +608,7 @@ mod test {
let mut keyboard_handler = KeyboardHidHandler::new(boot_services, 1 as efi::Handle);

let mut hid_io = MockHidIo::new();
hid_io.expect_set_output_report().returning(|_, _| Ok(()));
hid_io
.expect_get_report_descriptor()
.returning(|| Ok(hidparser::parse_report_descriptor(&BOOT_KEYBOARD_REPORT_DESCRIPTOR).unwrap()));
Expand Down
4 changes: 4 additions & 0 deletions HidPkg/UefiHidDxeV2/src/keyboard/simple_text_in_ex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,7 @@ mod test {
let mut keyboard_handler = KeyboardHidHandler::new(boot_services, 1 as efi::Handle);

let mut hid_io = MockHidIo::new();
hid_io.expect_set_output_report().returning(|_, _| Ok(()));
hid_io
.expect_get_report_descriptor()
.returning(|| Ok(hidparser::parse_report_descriptor(&BOOT_KEYBOARD_REPORT_DESCRIPTOR).unwrap()));
Expand Down Expand Up @@ -775,6 +776,7 @@ mod test {
let mut keyboard_handler = KeyboardHidHandler::new(boot_services, 1 as efi::Handle);

let mut hid_io = MockHidIo::new();
hid_io.expect_set_output_report().returning(|_, _| Ok(()));
hid_io
.expect_get_report_descriptor()
.returning(|| Ok(hidparser::parse_report_descriptor(&BOOT_KEYBOARD_REPORT_DESCRIPTOR).unwrap()));
Expand Down Expand Up @@ -840,6 +842,7 @@ mod test {
let mut keyboard_handler = KeyboardHidHandler::new(boot_services, 1 as efi::Handle);

let mut hid_io = MockHidIo::new();
hid_io.expect_set_output_report().returning(|_, _| Ok(()));
hid_io
.expect_get_report_descriptor()
.returning(|| Ok(hidparser::parse_report_descriptor(&BOOT_KEYBOARD_REPORT_DESCRIPTOR).unwrap()));
Expand Down Expand Up @@ -978,6 +981,7 @@ mod test {
let mut keyboard_handler = KeyboardHidHandler::new(boot_services, 1 as efi::Handle);

let mut hid_io = MockHidIo::new();
hid_io.expect_set_output_report().returning(|_, _| Ok(()));
hid_io
.expect_get_report_descriptor()
.returning(|| Ok(hidparser::parse_report_descriptor(&BOOT_KEYBOARD_REPORT_DESCRIPTOR).unwrap()));
Expand Down

0 comments on commit 2a09a96

Please sign in to comment.