Browse Source

removed type casting from DBG statements.

tags/v0.9.3
Udayan Kumar 17 years ago
parent
commit
37517f7752
1 changed files with 16 additions and 19 deletions
  1. 16
    19
      src/drivers/net/natsemi.c

+ 16
- 19
src/drivers/net/natsemi.c View File

59
 */
59
 */
60
 
60
 
61
 #include <stdint.h>
61
 #include <stdint.h>
62
-#include <pic8259.h>
63
 #include <stdlib.h>
62
 #include <stdlib.h>
64
 #include <stdio.h>
63
 #include <stdio.h>
65
 #include <io.h>
64
 #include <io.h>
80
  
79
  
81
 static int natsemi_spi_read_bit ( struct bit_basher *, unsigned int );
80
 static int natsemi_spi_read_bit ( struct bit_basher *, unsigned int );
82
 static void natsemi_spi_write_bit ( struct bit_basher *,unsigned int, unsigned long ); 
81
 static void natsemi_spi_write_bit ( struct bit_basher *,unsigned int, unsigned long ); 
83
-void natsemi_init_eeprom ( struct natsemi_private * ); 
82
+static void natsemi_init_eeprom ( struct natsemi_private * ); 
84
 static int natsemi_probe (struct pci_device *pci, const struct pci_device_id *id);
83
 static int natsemi_probe (struct pci_device *pci, const struct pci_device_id *id);
85
 static void natsemi_reset (struct net_device *netdev);
84
 static void natsemi_reset (struct net_device *netdev);
86
 static int natsemi_open (struct net_device *netdev);
85
 static int natsemi_open (struct net_device *netdev);
142
  *
141
  *
143
  * @v NAT		NATSEMI NIC
142
  * @v NAT		NATSEMI NIC
144
  */
143
  */
145
- void natsemi_init_eeprom ( struct natsemi_private *np ) {
144
+static void natsemi_init_eeprom ( struct natsemi_private *np ) {
146
 
145
 
147
 	/* Initialise three-wire bus 
146
 	/* Initialise three-wire bus 
148
 	 */
147
 	 */
355
 	}
354
 	}
356
 	outl (virt_to_bus (&np->tx[0]),np->ioaddr + TxRingPtr);
355
 	outl (virt_to_bus (&np->tx[0]),np->ioaddr + TxRingPtr);
357
 
356
 
358
-	DBG ("Natsemi Tx descriptor loaded with: %#08x\n",
359
-	     (unsigned int) inl (np->ioaddr + TxRingPtr));
357
+	DBG ("Natsemi Tx descriptor loaded with: %#08lx\n",
358
+	     inl (np->ioaddr + TxRingPtr));
360
 
359
 
361
 	/* Setup RX ring
360
 	/* Setup RX ring
362
 	 */
361
 	 */
369
 						? &np->rx[i + 1] : &np->rx[0]);
368
 						? &np->rx[i + 1] : &np->rx[0]);
370
 		np->rx[i].cmdsts = RX_BUF_SIZE;
369
 		np->rx[i].cmdsts = RX_BUF_SIZE;
371
 		np->rx[i].bufptr = virt_to_bus (np->iobuf[i]->data);
370
 		np->rx[i].bufptr = virt_to_bus (np->iobuf[i]->data);
372
-		DBG (" Address of iobuf [%d] = %#08x and iobuf->data = %#08x \n", i, 
373
-		     (unsigned int) &np->iobuf[i], (unsigned int) &np->iobuf[i]->data);
371
+		DBG (" Address of iobuf [%d] = %p and iobuf->data = %p \n", i, 
372
+		      &np->iobuf[i],  &np->iobuf[i]->data);
374
 	}
373
 	}
375
 	outl (virt_to_bus (&np->rx[0]), np->ioaddr + RxRingPtr);
374
 	outl (virt_to_bus (&np->rx[0]), np->ioaddr + RxRingPtr);
376
 
375
 
377
-	DBG ("Natsemi Rx descriptor loaded with: %#08x\n",
378
-	     (unsigned int) inl (np->ioaddr + RxRingPtr));		
376
+	DBG ("Natsemi Rx descriptor loaded with: %#08lx\n",
377
+	      inl (np->ioaddr + RxRingPtr));		
379
 
378
 
380
 	/* Setup RX Filter 
379
 	/* Setup RX Filter 
381
 	 */
380
 	 */
398
 	outl (tx_config, np->ioaddr + TxConfig);
397
 	outl (tx_config, np->ioaddr + TxConfig);
399
 	outl (rx_config, np->ioaddr + RxConfig);
398
 	outl (rx_config, np->ioaddr + RxConfig);
400
 
399
 
401
-	DBG ("Tx config register = %#08x Rx config register = %#08x\n", 
402
-               (unsigned int) inl (np->ioaddr + TxConfig),
403
-	       (unsigned int) inl (np->ioaddr + RxConfig));
400
+	DBG ("Tx config register = %#08lx Rx config register = %#08lx\n", 
401
+               inl (np->ioaddr + TxConfig),
402
+	       inl (np->ioaddr + RxConfig));
404
 
403
 
405
 	/*Set the Interrupt Mask register
404
 	/*Set the Interrupt Mask register
406
 	 */
405
 	 */
472
 	np->tx[np->tx_cur].bufptr = virt_to_bus (iobuf->data);
471
 	np->tx[np->tx_cur].bufptr = virt_to_bus (iobuf->data);
473
 	np->tx[np->tx_cur].cmdsts = iob_len (iobuf) | OWN;
472
 	np->tx[np->tx_cur].cmdsts = iob_len (iobuf) | OWN;
474
 
473
 
475
-	DBG ("TX id %d at %#08x + %#08x\n", np->tx_cur,
476
-	     (unsigned int) virt_to_bus (&iobuf->data), iob_len (iobuf));
474
+	DBG ("TX id %d at %#08lx + %#08x\n", np->tx_cur,
475
+	     virt_to_bus (&iobuf->data), iob_len (iobuf));
477
 
476
 
478
 	/* increment the circular buffer pointer to the next buffer location
477
 	/* increment the circular buffer pointer to the next buffer location
479
 	 */
478
 	 */
525
 		if (! (tx_status & DescPktOK)) {
524
 		if (! (tx_status & DescPktOK)) {
526
 			netdev_tx_complete_err (netdev,np->tx_iobuf[np->tx_dirty],-EINVAL);
525
 			netdev_tx_complete_err (netdev,np->tx_iobuf[np->tx_dirty],-EINVAL);
527
 			DBG ("Error transmitting packet, tx_status: %#08x\n",
526
 			DBG ("Error transmitting packet, tx_status: %#08x\n",
528
-			     (unsigned int) tx_status);
527
+			     tx_status);
529
 		} else {
528
 		} else {
530
 			netdev_tx_complete (netdev, np->tx_iobuf[np->tx_dirty]);
529
 			netdev_tx_complete (netdev, np->tx_iobuf[np->tx_dirty]);
531
 			DBG ("Success transmitting packet\n");
530
 			DBG ("Success transmitting packet\n");
549
 			netdev_rx_err (netdev, NULL, -EINVAL);
548
 			netdev_rx_err (netdev, NULL, -EINVAL);
550
 
549
 
551
 			DBG ("natsemi_poll: Corrupted packet received!"
550
 			DBG ("natsemi_poll: Corrupted packet received!"
552
-			     " Status = %#08x\n",
553
-			     (unsigned int) np->rx[np->rx_cur].cmdsts);
554
-			//DBG_HD (np->iobuf[np->rx_cur]->data, 30);
551
+			     " Status = %#08lx\n",
552
+			      np->rx[np->rx_cur].cmdsts);
555
 
553
 
556
 		} else 	{
554
 		} else 	{
557
 
555
 
558
-			//DBG_HD (np->iobuf[np->rx_cur]->data, 30);
559
 
556
 
560
 			/* If unable allocate space for this packet,
557
 			/* If unable allocate space for this packet,
561
 			 *  try again next poll
558
 			 *  try again next poll

Loading…
Cancel
Save