1 /* 2 * PROJECT: ReactOS DC21x4 Driver 3 * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later) 4 * PURPOSE: Debug routines 5 * COPYRIGHT: Copyright 2023 Dmitry Borisov <di.sean@protonmail.com> 6 */ 7 8 /* INCLUDES *******************************************************************/ 9 10 #include "dc21x4.h" 11 12 /* GLOBALS ********************************************************************/ 13 14 static PCSTR MediaName[MEDIA_MAX] = 15 { 16 "10Base-T", 17 "10Base-2 (BNC)", 18 "10Base-5 (AUI)", 19 "100Base-TX HD", 20 "10Base-T FD", 21 "100Base-TX FD", 22 "100Base-T4", 23 "100Base-FX HD", 24 "100Base-FX FD", 25 "HomePNA", 26 "MII", 27 }; 28 29 /* FUNCTIONS ******************************************************************/ 30 31 PCSTR 32 MediaNumber2Str( 33 _In_ PDC21X4_ADAPTER Adapter, 34 _In_ ULONG MediaNumber) 35 { 36 switch (MediaNumber) 37 { 38 case MEDIA_100TX_HD: 39 { 40 if (Adapter->ChipType == DC21041) 41 return "10Base-T HD"; 42 break; 43 } 44 45 default: 46 break; 47 } 48 49 ASSERT(MediaNumber < MEDIA_MAX); 50 51 return MediaName[MediaNumber]; 52 } 53 54 PCSTR 55 DcDbgBusError( 56 _In_ ULONG InterruptStatus) 57 { 58 switch (InterruptStatus & DC_STATUS_SYSTEM_ERROR_MASK) 59 { 60 case DC_STATUS_SYSTEM_ERROR_PARITY: 61 return "Parity Error"; 62 case DC_STATUS_SYSTEM_ERROR_MASTER_ABORT: 63 return "Master Abort"; 64 case DC_STATUS_SYSTEM_ERROR_TARGET_ABORT: 65 return "Target Abort"; 66 67 default: 68 return "<unknown>"; 69 } 70 } 71