forked from reactos/reactos
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c99e246
commit 292b4b6
Showing
12 changed files
with
1,632 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
add_definitions( | ||
-DNDIS50_MINIPORT | ||
-DNDIS_MINIPORT_DRIVER | ||
-DNDIS_LEGACY_MINIPORT) | ||
|
||
list(APPEND SOURCE | ||
ndis.c | ||
hardware.c | ||
info.c | ||
interrupt.c | ||
nic.h | ||
send.c) | ||
|
||
add_library(b57xx MODULE ${SOURCE} b57xx.rc) | ||
add_pch(b57xx nic.h SOURCE) | ||
set_module_type(b57xx kernelmodedriver) | ||
add_importlibs(b57xx ndis ntoskrnl hal) | ||
add_cd_file(TARGET b57xx DESTINATION reactos/system32/drivers FOR all) | ||
add_driver_inf(b57xx netb57xx.inf) |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#define REACTOS_VERSION_DLL | ||
#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Broadcom NetXtreme Driver" | ||
#define REACTOS_STR_INTERNAL_NAME "b57xx" | ||
#define REACTOS_STR_ORIGINAL_FILENAME "b57xx.sys" | ||
#include <reactos/version.rc> |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* PROJECT: ReactOS Broadcom NetXtreme Driver | ||
* LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later) | ||
* PURPOSE: Hardware specific definitions | ||
* COPYRIGHT: Copyright 2021 Scott Maday <[email protected]> | ||
*/ | ||
#pragma once | ||
|
||
#define IEEE_802_ADDR_LENGTH 6 | ||
|
||
#define MAX_RESET_ATTEMPTS 10 | ||
#define MAX_EEPROM_READ_ATTEMPTS 10000 | ||
|
||
#define MAXIMUM_MULTICAST_ADDRESSES 16 | ||
|
||
/* Ethernet frame header */ | ||
typedef struct _ETH_HEADER | ||
{ | ||
UCHAR Destination[IEEE_802_ADDR_LENGTH]; | ||
UCHAR Source[IEEE_802_ADDR_LENGTH]; | ||
USHORT PayloadType; | ||
} ETH_HEADER, *PETH_HEADER; |
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 |
---|---|---|
@@ -0,0 +1,92 @@ | ||
/* | ||
* PROJECT: ReactOS Broadcom NetXtreme Driver | ||
* LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later) | ||
* PURPOSE: Debugging support macros | ||
* DEFINES: DBG - Enable debug output | ||
* NASSERT - Disable assertions | ||
*/ | ||
#pragma once | ||
|
||
#define NORMAL_MASK 0x000000FF | ||
#define SPECIAL_MASK 0xFFFFFF00 | ||
#define MIN_TRACE 0x00000001 | ||
#define MID_TRACE 0x00000002 | ||
#define MAX_TRACE 0x00000003 | ||
|
||
#define DEBUG_MEMORY 0x00000100 | ||
#define DEBUG_ULTRA 0xFFFFFFFF | ||
|
||
#if DBG | ||
|
||
extern ULONG DebugTraceLevel; | ||
|
||
#ifdef _MSC_VER | ||
|
||
#define NDIS_DbgPrint(_t_, _x_) \ | ||
if ((_t_ > NORMAL_MASK) \ | ||
? (DebugTraceLevel & _t_) > NORMAL_MASK \ | ||
: (DebugTraceLevel & NORMAL_MASK) >= _t_) { \ | ||
DbgPrint("(%s:%d) ", __FILE__, __LINE__); \ | ||
DbgPrint _x_ ; \ | ||
} | ||
|
||
#else /* _MSC_VER */ | ||
|
||
#define NDIS_DbgPrint(_t_, _x_) \ | ||
if ((_t_ > NORMAL_MASK) \ | ||
? (DebugTraceLevel & _t_) > NORMAL_MASK \ | ||
: (DebugTraceLevel & NORMAL_MASK) >= _t_) { \ | ||
DbgPrint("(%s:%d)(%s) ", __FILE__, __LINE__, __FUNCTION__); \ | ||
DbgPrint _x_ ; \ | ||
} | ||
|
||
#endif /* _MSC_VER */ | ||
|
||
|
||
#define ASSERT_IRQL(x) ASSERT(KeGetCurrentIrql() <= (x)) | ||
#define ASSERT_IRQL_EQUAL(x) ASSERT(KeGetCurrentIrql() == (x)) | ||
|
||
#else /* DBG */ | ||
|
||
#define NDIS_DbgPrint(_t_, _x_) | ||
|
||
#define ASSERT_IRQL(x) | ||
#define ASSERT_IRQL_EQUAL(x) | ||
/* #define ASSERT(x) */ /* ndis.h */ | ||
|
||
#endif /* DBG */ | ||
|
||
|
||
#define assert(x) ASSERT(x) | ||
#define assert_irql(x) ASSERT_IRQL(x) | ||
|
||
|
||
#ifdef _MSC_VER | ||
|
||
#define UNIMPLEMENTED \ | ||
NDIS_DbgPrint(MIN_TRACE, ("The function at %s:%d is unimplemented, \ | ||
but come back another day.\n", __FILE__, __LINE__)); | ||
|
||
#else /* _MSC_VER */ | ||
|
||
#define UNIMPLEMENTED \ | ||
NDIS_DbgPrint(MIN_TRACE, ("%s at %s:%d is unimplemented, \ | ||
but come back another day.\n", __FUNCTION__, __FILE__, __LINE__)); | ||
|
||
#endif /* _MSC_VER */ | ||
|
||
#define UNIMPLEMENTED_DBGBREAK(...) \ | ||
do { \ | ||
NDIS_DbgPrint(MIN_TRACE, ("UNIMPLEMENTED.\n")); \ | ||
DbgPrint("" __VA_ARGS__); \ | ||
DbgBreakPoint(); \ | ||
} while (0) | ||
|
||
|
||
#define CHECKPOINT \ | ||
do { NDIS_DbgPrint(MIN_TRACE, ("%s:%d\n", __FILE__, __LINE__)); } while(0); | ||
|
||
|
||
#define NDIS_MinDbgPrint(...) NDIS_DbgPrint(MIN_TRACE, (__VA_ARGS__)) | ||
|
||
/* EOF */ |
Oops, something went wrong.