Procházet zdrojové kódy

eth_ntoa and warnings fixups

tags/v0.9.3
Marty Connor před 18 roky
rodič
revize
eefac0e258
1 změnil soubory, kde provedl 13 přidání a 11 odebrání
  1. 13
    11
      src/drivers/net/natsemi.c

+ 13
- 11
src/drivers/net/natsemi.c Zobrazit soubor

@@ -55,7 +55,9 @@
55 55
 
56 56
 #include "etherboot.h"
57 57
 #include "nic.h"
58
+#include "pcibios.h"
58 59
 #include <gpxe/pci.h>
60
+#include <gpxe/ethernet.h>
59 61
 
60 62
 /* defines */
61 63
 
@@ -222,7 +224,7 @@ static void natsemi_set_rx_mode(struct nic *nic);
222 224
 static void natsemi_check_duplex(struct nic *nic);
223 225
 static void natsemi_transmit(struct nic *nic, const char *d, unsigned int t, unsigned int s, const char *p);
224 226
 static int  natsemi_poll(struct nic *nic, int retrieve);
225
-static void natsemi_disable(struct nic *nic, struct pci_device *pci);
227
+static void natsemi_disable(struct nic *nic);
226 228
 static void natsemi_irq(struct nic *nic, irq_action_t action);
227 229
 
228 230
 /* 
@@ -244,7 +246,7 @@ natsemi_probe ( struct nic *nic, struct pci_device *pci ) {
244 246
 
245 247
     int i;
246 248
     int prev_eedata;
247
-    u32 tmp;
249
+    uint32_t tmp;
248 250
 
249 251
     if (pci->ioaddr == 0)
250 252
         return 0;
@@ -266,7 +268,7 @@ natsemi_probe ( struct nic *nic, struct pci_device *pci ) {
266 268
      * in PCI config space.  Some boards apparently need
267 269
      * to be brought to D0 in this manner.
268 270
      */
269
-    pci_read_config_dword(pci, PCIPM, &tmp);
271
+    pci_read_config_dword ( pci, PCIPM, &tmp );
270 272
     if (tmp & (0x03|0x100)) {
271 273
 	/* D0 state, disable PME assertion */
272 274
 	u32 newtmp = tmp & ~(0x03|0x100);
@@ -283,9 +285,9 @@ natsemi_probe ( struct nic *nic, struct pci_device *pci ) {
283 285
 	prev_eedata = eedata;
284 286
     }
285 287
 
286
-    printf("\nnatsemi_probe: MAC addr %! at ioaddr %#hX\n",
287
-           nic->node_addr, ioaddr);
288
-    printf("natsemi_probe: Vendor:%#hX Device:%#hX\n", vendor, dev_id);
288
+    DBG ( "\nnatsemi_probe: MAC addr %s at ioaddr %4.4lx\n",
289
+	  eth_ntoa ( nic->node_addr ), ioaddr);
290
+    DBG ( "natsemi_probe: Vendor:%#hX Device:%#hX\n", vendor, dev_id );
289 291
     
290 292
     /* Reset the chip to erase any previous misconfiguration. */
291 293
     outl(ChipReset, ioaddr + ChipCmd);
@@ -507,7 +509,7 @@ natsemi_init_txd(struct nic *nic __unused)
507 509
     /* load Transmit Descriptor Register */
508 510
     outl(virt_to_bus(&txd), ioaddr + TxRingPtr); 
509 511
     if (natsemi_debug > 1)
510
-        printf("natsemi_init_txd: TX descriptor register loaded with: %X\n", 
512
+        printf("natsemi_init_txd: TX descriptor register loaded with: %lx\n", 
511 513
                inl(ioaddr + TxRingPtr));
512 514
 }
513 515
 
@@ -533,7 +535,7 @@ natsemi_init_rxd(struct nic *nic __unused)
533 535
         rxd[i].cmdsts = (u32) RX_BUF_SIZE;
534 536
         rxd[i].bufptr = virt_to_bus(&rxb[i*RX_BUF_SIZE]);
535 537
         if (natsemi_debug > 1)
536
-            printf("natsemi_init_rxd: rxd[%d]=%X link=%X cmdsts=%X bufptr=%X\n", 
538
+            printf("natsemi_init_rxd: rxd[%d]=%p link=%X cmdsts=%X bufptr=%4.4x\n", 
537 539
                    i, &rxd[i], rxd[i].link, rxd[i].cmdsts, rxd[i].bufptr);
538 540
     }
539 541
 
@@ -541,7 +543,7 @@ natsemi_init_rxd(struct nic *nic __unused)
541 543
     outl(virt_to_bus(&rxd[0]), ioaddr + RxRingPtr);
542 544
 
543 545
     if (natsemi_debug > 1)
544
-        printf("natsemi_init_rxd: RX descriptor register loaded with: %X\n", 
546
+        printf("natsemi_init_rxd: RX descriptor register loaded with: %lx\n", 
545 547
                inl(ioaddr + RxRingPtr));
546 548
 }
547 549
 
@@ -611,7 +613,7 @@ natsemi_transmit(struct nic  *nic,
611 613
     /* load Transmit Descriptor Register */
612 614
     outl(virt_to_bus(&txd), ioaddr + TxRingPtr);
613 615
     if (natsemi_debug > 1)
614
-        printf("natsemi_transmit: TX descriptor register loaded with: %X\n", 
616
+        printf("natsemi_transmit: TX descriptor register loaded with: %lx\n", 
615 617
                inl(ioaddr + TxRingPtr));
616 618
 
617 619
     memcpy(txb, d, ETH_ALEN);
@@ -722,7 +724,7 @@ natsemi_poll(struct nic *nic, int retrieve)
722 724
  */
723 725
 
724 726
 static void
725
-natsemi_disable ( struct nic *nic, struct pci_device *pci __unused ) {
727
+natsemi_disable ( struct nic *nic ) {
726 728
 
727 729
     natsemi_init(nic);
728 730
 

Načítá se…
Zrušit
Uložit