mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-22 17:31:58 -05:00
Kernel/USB: Don't treat xHCI Short Packet Completion Codes as errors
The Short Packet Completion Code just means that the xHC received fewer bytes than expected. We shouldn't treat them as errors, since our transfer functions already return the actual transfer size.
This commit is contained in:
parent
e8ebdf804e
commit
632afcf822
1 changed files with 4 additions and 2 deletions
|
@ -867,7 +867,8 @@ ErrorOr<size_t> xHCIController::submit_bulk_transfer(Transfer& transfer)
|
|||
pending_transfer.wait_queue.wait_forever();
|
||||
VERIFY(!pending_transfer.endpoint_list_node.is_in_list());
|
||||
|
||||
if (pending_transfer.completion_code != TransferRequestBlock::CompletionCode::Success)
|
||||
if (pending_transfer.completion_code != TransferRequestBlock::CompletionCode::Success
|
||||
&& pending_transfer.completion_code != TransferRequestBlock::CompletionCode::Short_Packet)
|
||||
return EIO;
|
||||
|
||||
return transfer.transfer_data_size() - pending_transfer.remainder;
|
||||
|
@ -1360,7 +1361,8 @@ void xHCIController::handle_transfer_event(TransferRequestBlock const& transfer_
|
|||
auto& endpoint_ring = slot_state.endpoint_rings[endpoint - 1];
|
||||
VERIFY(endpoint_ring.region);
|
||||
|
||||
if (transfer_request_block.transfer_event.completion_code != TransferRequestBlock::CompletionCode::Success)
|
||||
if (transfer_request_block.transfer_event.completion_code != TransferRequestBlock::CompletionCode::Success
|
||||
&& transfer_request_block.transfer_event.completion_code != TransferRequestBlock::CompletionCode::Short_Packet)
|
||||
dmesgln_pci(*this, "Transfer error on slot {} endpoint {}: {}", slot, endpoint, enum_to_string(transfer_request_block.transfer_event.completion_code));
|
||||
|
||||
VERIFY(transfer_request_block.transfer_event.event_data == 0); // The Pointer points to the interrupting TRB
|
||||
|
|
Loading…
Reference in a new issue