-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dwc_eqos - cosmetics (comments, naming) (#20)
- Rename the registers to more-closely match the names in the TRD. - Add or enhance comments. - Include Fragment/Packet indexes only in Debug builds.
- Loading branch information
Showing
10 changed files
with
348 additions
and
285 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,22 @@ | ||
/* | ||
Device behavior. Includes adapter and interrupt since they are 1:1 with the device. | ||
*/ | ||
#pragma once | ||
|
||
// Referenced in driver.cpp DriverEntry. | ||
// Called by WDF. | ||
__declspec(code_seg("PAGE")) | ||
EVT_WDF_DRIVER_DEVICE_ADD | ||
DeviceAdd; | ||
|
||
// Called by rxqueue.cpp RxQueueSetNotificationEnabled. | ||
void | ||
DeviceSetNotificationRxQueue( | ||
_In_ NETADAPTER adapter, | ||
_In_opt_ NETPACKETQUEUE rxQueue); | ||
|
||
// Called by txqueue.cpp TxQueueSetNotificationEnabled. | ||
void | ||
DeviceSetNotificationTxQueue( | ||
_In_ NETADAPTER adapter, | ||
_In_opt_ NETPACKETQUEUE txQueue); | ||
|
||
__declspec(code_seg("PAGE")) | ||
EVT_WDF_DRIVER_DEVICE_ADD | ||
DeviceAdd; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,29 @@ | ||
/* | ||
Definitions shared between TxQueue and RxQueue. | ||
*/ | ||
#pragma once | ||
|
||
UINT32 constexpr QueueDescriptorSize = 64; | ||
UINT32 constexpr QueueDescriptorSize = 64; // 64 == sizeof(TxDescriptor) == sizeof(RxDescriptor) | ||
UINT32 constexpr QueueDescriptorMinCount = PAGE_SIZE / QueueDescriptorSize; | ||
UINT32 constexpr QueueDescriptorMaxCount = 0x400; | ||
|
||
bool constexpr QueueBurstLengthX8 = true; | ||
UINT32 constexpr QueueBurstLength = 64u / (QueueBurstLengthX8 ? 8 : 1); // TODO: load from ACPI? | ||
|
||
// Alignment is mainly to make sure the allocation does not cross a 4GB boundary, | ||
// but it also simplifies working with the addresses. | ||
// but it also simplifies the QueueDescriptorAddressToIndex implementation. | ||
auto const QueueDescriptorAlignment = QueueDescriptorMaxCount * QueueDescriptorSize; | ||
|
||
// Given the size of the fragment ring, return the number of descriptors to | ||
// allocate for the descriptor ring. This will be a power of 2 between | ||
// QueueDescriptorMinCount and QueueDescriptorMaxCount. | ||
_IRQL_requires_max_(PASSIVE_LEVEL) | ||
UINT32 | ||
QueueDescriptorCount(UINT32 fragmentCount); | ||
|
||
// Given a Current_App_RxDesc or Current_App_TxDesc address, return the corresponding | ||
// index into the descriptor ring. Assumes that descriptor ring is aligned to | ||
// QueueDescriptorAlignment. descPhysical and descCount are for assertions. | ||
_IRQL_requires_max_(DISPATCH_LEVEL) | ||
UINT32 | ||
QueueDescriptorAddressToIndex(UINT32 address, PHYSICAL_ADDRESS descPhysical, UINT32 descCount); |
Oops, something went wrong.