Bläddra i källkod

Standardise DBG_PRINTF()->DBG(), and remove custom definitions for

DBG_PRINTF() and assert().
tags/v0.9.3
Michael Brown 17 år sedan
förälder
incheckning
ed5ff61790
1 ändrade filer med 9 tillägg och 28 borttagningar
  1. 9
    28
      src/drivers/net/r8169.c

+ 9
- 28
src/drivers/net/r8169.c Visa fil

@@ -73,25 +73,6 @@ static u32 ioaddr;
73 73
 #define RTL8169_USE_IO
74 74
 
75 75
 
76
-#ifdef RTL8169_DEBUG
77
-
78
-#if 0
79
-#define assert(expr) \
80
-               if(!(expr)) { printk( "Assertion failed! %s,%s,%s,line=%d\n", #expr,__FILE__,__FUNCTION__,__LINE__); }
81
-#endif
82
-
83
-#define DBG_PRINTF( fmt, args...)   printk("r8169: " fmt, ## args);
84
-
85
-#else
86
-
87
-#if 0
88
-#define assert(expr) do {} while (0)
89
-#endif
90
-
91
-#define DBG_PRINTF( fmt, args...)   ;
92
-
93
-#endif				// end of #ifdef RTL8169_DEBUG
94
-
95 76
 /* media options 
96 77
         _10_Half = 0x01,
97 78
         _10_Full = 0x02,
@@ -759,11 +740,11 @@ static void rtl8169_hw_start(struct nic *nic)
759 740
 	if (tpc->mcfg == MCFG_METHOD_2 || tpc->mcfg == MCFG_METHOD_3) {
760 741
 		RTL_W16(CPlusCmd,
761 742
 			(RTL_R16(CPlusCmd) | (1 << 14) | (1 << 3)));
762
-		DBG_PRINTF
743
+		DBG
763 744
 		    ("Set MAC Reg C+CR Offset 0xE0: bit-3 and bit-14\n");
764 745
 	} else {
765 746
 		RTL_W16(CPlusCmd, (RTL_R16(CPlusCmd) | (1 << 3)));
766
-		DBG_PRINTF("Set MAC Reg C+CR Offset 0xE0: bit-3.\n");
747
+		DBG("Set MAC Reg C+CR Offset 0xE0: bit-3.\n");
767 748
 	}
768 749
 
769 750
 	{
@@ -919,18 +900,18 @@ static int r8169_probe ( struct nic *nic, struct pci_device *pci ) {
919 900
 	/* Config PHY */
920 901
 	rtl8169_hw_PHY_config(nic);
921 902
 
922
-	DBG_PRINTF("Set MAC Reg C+CR Offset 0x82h = 0x01h\n");
903
+	DBG("Set MAC Reg C+CR Offset 0x82h = 0x01h\n");
923 904
 	RTL_W8(0x82, 0x01);
924 905
 
925 906
 	if (tpc->mcfg < MCFG_METHOD_3) {
926
-		DBG_PRINTF("Set PCI Latency=0x40\n");
907
+		DBG("Set PCI Latency=0x40\n");
927 908
 		pci_write_config_byte(pci, PCI_LATENCY_TIMER, 0x40);
928 909
 	}
929 910
 
930 911
 	if (tpc->mcfg == MCFG_METHOD_2) {
931
-		DBG_PRINTF("Set MAC Reg C+CR Offset 0x82h = 0x01h\n");
912
+		DBG("Set MAC Reg C+CR Offset 0x82h = 0x01h\n");
932 913
 		RTL_W8(0x82, 0x01);
933
-		DBG_PRINTF("Set PHY Reg 0x0bh = 0x00h\n");
914
+		DBG("Set PHY Reg 0x0bh = 0x00h\n");
934 915
 		RTL8169_WRITE_GMII_REG(ioaddr, 0x0b, 0x0000);	//w 0x0b 15 0 0
935 916
 	}
936 917
 
@@ -1049,7 +1030,7 @@ static void rtl8169_hw_PHY_reset(struct nic *nic __unused)
1049 1030
         struct rtl8169_private *priv = dev->priv;
1050 1031
         unsigned long ioaddr = priv->ioaddr;
1051 1032
 
1052
-        DBG_PRINTF("%s: Reset RTL8169s PHY\n", dev->name);
1033
+        DBG("%s: Reset RTL8169s PHY\n", dev->name);
1053 1034
 
1054 1035
         val = ( RTL8169_READ_GMII_REG( ioaddr, 0 ) | 0x8000 ) & 0xffff;
1055 1036
         RTL8169_WRITE_GMII_REG( ioaddr, 0, val );
@@ -1074,7 +1055,7 @@ static void rtl8169_hw_PHY_reset(struct nic *nic __unused)
1074 1055
 static void rtl8169_hw_PHY_config(struct nic *nic __unused)
1075 1056
 {
1076 1057
 
1077
-	DBG_PRINTF("priv->mcfg=%d, priv->pcfg=%d\n", tpc->mcfg, tpc->pcfg);
1058
+	DBG("priv->mcfg=%d, priv->pcfg=%d\n", tpc->mcfg, tpc->pcfg);
1078 1059
 
1079 1060
 	if (tpc->mcfg == MCFG_METHOD_4) {
1080 1061
 /*
@@ -1175,7 +1156,7 @@ static void rtl8169_hw_PHY_config(struct nic *nic __unused)
1175 1156
 		RTL8169_WRITE_GMII_REG((unsigned long) ioaddr, 0x0B,
1176 1157
 				       0x0000);
1177 1158
 	} else {
1178
-		DBG_PRINTF("tpc->mcfg=%d. Discard hw PHY config.\n",
1159
+		DBG("tpc->mcfg=%d. Discard hw PHY config.\n",
1179 1160
 			  tpc->mcfg);
1180 1161
 	}
1181 1162
 }

Laddar…
Avbryt
Spara