Browse Source

eth_ntoa and warnings fixups

tags/v0.9.3
Marty Connor 18 years ago
parent
commit
eefac0e258
1 changed files with 13 additions and 11 deletions
  1. 13
    11
      src/drivers/net/natsemi.c

+ 13
- 11
src/drivers/net/natsemi.c View File

55
 
55
 
56
 #include "etherboot.h"
56
 #include "etherboot.h"
57
 #include "nic.h"
57
 #include "nic.h"
58
+#include "pcibios.h"
58
 #include <gpxe/pci.h>
59
 #include <gpxe/pci.h>
60
+#include <gpxe/ethernet.h>
59
 
61
 
60
 /* defines */
62
 /* defines */
61
 
63
 
222
 static void natsemi_check_duplex(struct nic *nic);
224
 static void natsemi_check_duplex(struct nic *nic);
223
 static void natsemi_transmit(struct nic *nic, const char *d, unsigned int t, unsigned int s, const char *p);
225
 static void natsemi_transmit(struct nic *nic, const char *d, unsigned int t, unsigned int s, const char *p);
224
 static int  natsemi_poll(struct nic *nic, int retrieve);
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
 static void natsemi_irq(struct nic *nic, irq_action_t action);
228
 static void natsemi_irq(struct nic *nic, irq_action_t action);
227
 
229
 
228
 /* 
230
 /* 
244
 
246
 
245
     int i;
247
     int i;
246
     int prev_eedata;
248
     int prev_eedata;
247
-    u32 tmp;
249
+    uint32_t tmp;
248
 
250
 
249
     if (pci->ioaddr == 0)
251
     if (pci->ioaddr == 0)
250
         return 0;
252
         return 0;
266
      * in PCI config space.  Some boards apparently need
268
      * in PCI config space.  Some boards apparently need
267
      * to be brought to D0 in this manner.
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
     if (tmp & (0x03|0x100)) {
272
     if (tmp & (0x03|0x100)) {
271
 	/* D0 state, disable PME assertion */
273
 	/* D0 state, disable PME assertion */
272
 	u32 newtmp = tmp & ~(0x03|0x100);
274
 	u32 newtmp = tmp & ~(0x03|0x100);
283
 	prev_eedata = eedata;
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
     /* Reset the chip to erase any previous misconfiguration. */
292
     /* Reset the chip to erase any previous misconfiguration. */
291
     outl(ChipReset, ioaddr + ChipCmd);
293
     outl(ChipReset, ioaddr + ChipCmd);
507
     /* load Transmit Descriptor Register */
509
     /* load Transmit Descriptor Register */
508
     outl(virt_to_bus(&txd), ioaddr + TxRingPtr); 
510
     outl(virt_to_bus(&txd), ioaddr + TxRingPtr); 
509
     if (natsemi_debug > 1)
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
                inl(ioaddr + TxRingPtr));
513
                inl(ioaddr + TxRingPtr));
512
 }
514
 }
513
 
515
 
533
         rxd[i].cmdsts = (u32) RX_BUF_SIZE;
535
         rxd[i].cmdsts = (u32) RX_BUF_SIZE;
534
         rxd[i].bufptr = virt_to_bus(&rxb[i*RX_BUF_SIZE]);
536
         rxd[i].bufptr = virt_to_bus(&rxb[i*RX_BUF_SIZE]);
535
         if (natsemi_debug > 1)
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
                    i, &rxd[i], rxd[i].link, rxd[i].cmdsts, rxd[i].bufptr);
539
                    i, &rxd[i], rxd[i].link, rxd[i].cmdsts, rxd[i].bufptr);
538
     }
540
     }
539
 
541
 
541
     outl(virt_to_bus(&rxd[0]), ioaddr + RxRingPtr);
543
     outl(virt_to_bus(&rxd[0]), ioaddr + RxRingPtr);
542
 
544
 
543
     if (natsemi_debug > 1)
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
                inl(ioaddr + RxRingPtr));
547
                inl(ioaddr + RxRingPtr));
546
 }
548
 }
547
 
549
 
611
     /* load Transmit Descriptor Register */
613
     /* load Transmit Descriptor Register */
612
     outl(virt_to_bus(&txd), ioaddr + TxRingPtr);
614
     outl(virt_to_bus(&txd), ioaddr + TxRingPtr);
613
     if (natsemi_debug > 1)
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
                inl(ioaddr + TxRingPtr));
617
                inl(ioaddr + TxRingPtr));
616
 
618
 
617
     memcpy(txb, d, ETH_ALEN);
619
     memcpy(txb, d, ETH_ALEN);
722
  */
724
  */
723
 
725
 
724
 static void
726
 static void
725
-natsemi_disable ( struct nic *nic, struct pci_device *pci __unused ) {
727
+natsemi_disable ( struct nic *nic ) {
726
 
728
 
727
     natsemi_init(nic);
729
     natsemi_init(nic);
728
 
730
 

Loading…
Cancel
Save