Browse Source

Fixed DBG macro format, fixed compile warnings. removed extra parameter from mtd80x_disable(...)

tags/v0.9.3
Marty Connor 18 years ago
parent
commit
08d7ea1d34
1 changed files with 25 additions and 25 deletions
  1. 25
    25
      src/drivers/net/mtd80x.c

+ 25
- 25
src/drivers/net/mtd80x.c View File

473
 /**************************************************************************
473
 /**************************************************************************
474
 RESET - Reset Adapter
474
 RESET - Reset Adapter
475
 ***************************************************************************/
475
 ***************************************************************************/
476
-static void mtd_reset(struct nic *nic)
476
+static void mtd_reset( struct nic *nic )
477
 {
477
 {
478
     /* Reset the chip to erase previous misconfiguration. */
478
     /* Reset the chip to erase previous misconfiguration. */
479
     outl(0x00000001, mtdx.ioaddr + BCR);
479
     outl(0x00000001, mtdx.ioaddr + BCR);
501
     getlinkstatus(nic);
501
     getlinkstatus(nic);
502
     if (mtdx.linkok)
502
     if (mtdx.linkok)
503
     {
503
     {
504
-        char* texts[]={"half","full","10","100","1000"};
504
+        static const char* texts[]={"half","full","10","100","1000"};
505
         getlinktype(nic);
505
         getlinktype(nic);
506
-        DBG(("Link is OK : %s %s\n", texts[mtdx.duplexmode-1], texts[mtdx.line_speed+1] ));
506
+        DBG ( "Link is OK : %s %s\n", texts[mtdx.duplexmode-1], texts[mtdx.line_speed+1] );
507
     } else
507
     } else
508
     {
508
     {
509
-        DBG(("No link!!!\n"));
509
+        DBG ( "No link!!!\n" );
510
     }
510
     }
511
 
511
 
512
     mtdx.crvalue |= /*TxEnable |*/ RxEnable | TxThreshold;
512
     mtdx.crvalue |= /*TxEnable |*/ RxEnable | TxThreshold;
520
 /**************************************************************************
520
 /**************************************************************************
521
 POLL - Wait for a frame
521
 POLL - Wait for a frame
522
 ***************************************************************************/
522
 ***************************************************************************/
523
-static int mtd_poll(struct nic *nic, int retrieve)
523
+static int mtd_poll(struct nic *nic, __unused int retrieve)
524
 {
524
 {
525
     s32 rx_status = mtdx.cur_rx->status;
525
     s32 rx_status = mtdx.cur_rx->status;
526
     int retval = 0;
526
     int retval = 0;
548
         /* Omit the four octet CRC from the length. */
548
         /* Omit the four octet CRC from the length. */
549
         short pkt_len = ((rx_status & FLNGMASK) >> FLNGShift) - 4;
549
         short pkt_len = ((rx_status & FLNGMASK) >> FLNGShift) - 4;
550
 
550
 
551
-        DBG(( "  netdev_rx() normal Rx pkt length %d"
552
-	      " status %x.\n", pkt_len, rx_status));
551
+        DBG ( " netdev_rx() normal Rx pkt length %d"
552
+ 	      " status %x.\n", pkt_len, rx_status );
553
 
553
 
554
         nic->packetlen = pkt_len;
554
         nic->packetlen = pkt_len;
555
         memcpy(nic->packet, mtdx.cur_rx->skbuff, pkt_len);
555
         memcpy(nic->packet, mtdx.cur_rx->skbuff, pkt_len);
615
 
615
 
616
     tx_status = mtdx.tx_ring[0].status;
616
     tx_status = mtdx.tx_ring[0].status;
617
     if (currticks() >= to){
617
     if (currticks() >= to){
618
-        DBG(("TX Time Out"));
618
+        DBG ( "TX Time Out" );
619
     } else if( tx_status & (CSL | LC | EC | UDF | HF)){
619
     } else if( tx_status & (CSL | LC | EC | UDF | HF)){
620
-        printf("Transmit error: %s %s %s %s %s.\n",
621
-               tx_status,
622
-               tx_status & EC ? "abort" : "",
623
-               tx_status & CSL ? "carrier" : "",
624
-               tx_status & LC ? "late" : "",
625
-               tx_status & UDF ? "fifo" : "",
626
-               tx_status & HF ? "heartbeat" : "" );
620
+        printf( "Transmit error: %8.8x %s %s %s %s %s\n",
621
+                tx_status,
622
+                tx_status & EC ? "abort" : "",
623
+                tx_status & CSL ? "carrier" : "",
624
+                tx_status & LC ? "late" : "",
625
+                tx_status & UDF ? "fifo" : "",
626
+                tx_status & HF ? "heartbeat" : "" );
627
     }
627
     }
628
 
628
 
629
     /*hex_dump( txb, size );*/
629
     /*hex_dump( txb, size );*/
630
     /*pause();*/
630
     /*pause();*/
631
 
631
 
632
-    DBG(("TRANSMIT\n"));
632
+    DBG ( "TRANSMIT\n" );
633
 }
633
 }
634
 
634
 
635
 /**************************************************************************
635
 /**************************************************************************
636
 DISABLE - Turn off ethernet interface
636
 DISABLE - Turn off ethernet interface
637
 ***************************************************************************/
637
 ***************************************************************************/
638
-static void mtd_disable ( struct nic *nic, struct pci_device *pci __unused ) {
638
+static void mtd_disable ( struct nic *nic ) {
639
 
639
 
640
     /* Disable Tx Rx*/
640
     /* Disable Tx Rx*/
641
-    outl( mtdx.crvalue & (~TxEnable) & (~RxEnable), mtdx.ioaddr + TCRRCR);
641
+    outl( mtdx.crvalue & (~TxEnable) & (~RxEnable), mtdx.ioaddr + TCRRCR );
642
 
642
 
643
     /* Reset the chip to erase previous misconfiguration. */
643
     /* Reset the chip to erase previous misconfiguration. */
644
     mtd_reset(nic);
644
     mtd_reset(nic);
645
 
645
 
646
-    DBG(("DISABLE\n"));
646
+    DBG ( "DISABLE\n" );
647
 }
647
 }
648
 
648
 
649
 static struct nic_operations mtd_operations = {
649
 static struct nic_operations mtd_operations = {
686
         nic->node_addr[i] = inb(mtdx.ioaddr + PAR0 + i);
686
         nic->node_addr[i] = inb(mtdx.ioaddr + PAR0 + i);
687
     }
687
     }
688
 
688
 
689
-    if (memcmp(nic->node_addr, "\0\0\0\0\0", 6) == 0)
689
+    if (memcmp(nic->node_addr, "\0\0\0\0\0\0", 6) == 0)
690
     {
690
     {
691
         return 0;
691
         return 0;
692
     }
692
     }
693
 
693
 
694
-    DBG(("%s : ioaddr %#hX, addr %!\n",mtdx.nic_name, mtdx.ioaddr, nic->node_addr));
694
+    /*    DBG ( "%s: ioaddr %#hX, addr %!\n",mtdx.nic_name, mtdx.ioaddr, nic->node_addr ); */
695
 
695
 
696
     /* Reset the chip to erase previous misconfiguration. */
696
     /* Reset the chip to erase previous misconfiguration. */
697
     outl(0x00000001, mtdx.ioaddr + BCR);
697
     outl(0x00000001, mtdx.ioaddr + BCR);
708
             if (mii_status != 0xffff && mii_status != 0x0000) {
708
             if (mii_status != 0xffff && mii_status != 0x0000) {
709
                 mtdx.phys[phy_idx] = phy;
709
                 mtdx.phys[phy_idx] = phy;
710
 
710
 
711
-                DBG(("%s: MII PHY found at address %d, status "
712
-		     "0x%4.4x.\n", mtdx.nic_name, phy, mii_status));
711
+                DBG ( "%s: MII PHY found at address %d, status "
712
+		      "0x%4.4x.\n", mtdx.nic_name, phy, mii_status );
713
                 /* get phy type */
713
                 /* get phy type */
714
                 {
714
                 {
715
                     unsigned int data;
715
                     unsigned int data;
742
         /* get phy type */
742
         /* get phy type */
743
         if (inl(mtdx.ioaddr + PHYIDENTIFIER) == MysonPHYID ) {
743
         if (inl(mtdx.ioaddr + PHYIDENTIFIER) == MysonPHYID ) {
744
             mtdx.PHYType = MysonPHY;
744
             mtdx.PHYType = MysonPHY;
745
-            DBG(("MysonPHY\n"));
745
+            DBG ( "MysonPHY\n" );
746
         } else {
746
         } else {
747
             mtdx.PHYType = OtherPHY;
747
             mtdx.PHYType = OtherPHY;
748
-            DBG(("OtherPHY\n"));
748
+            DBG ( "OtherPHY\n" );
749
         }
749
         }
750
     }
750
     }
751
 
751
 

Loading…
Cancel
Save