Explorar el Código

Warnings purge for via-velocity.[ch]

tags/v0.9.3
Marty Connor hace 17 años
padre
commit
1069a74d20
Se han modificado 2 ficheros con 19 adiciones y 22 borrados
  1. 13
    10
      src/drivers/net/via-velocity.c
  2. 6
    12
      src/drivers/net/via-velocity.h

+ 13
- 10
src/drivers/net/via-velocity.c Ver fichero

@@ -356,7 +356,7 @@ static void velocity_get_options(struct velocity_opt *opts, int index,
356 356
 	velocity_set_bool_opt(&opts->flags, ValPktLen[index],
357 357
 			      VAL_PKT_LEN_DEF, VELOCITY_FLAGS_VAL_PKT_LEN,
358 358
 			      "ValPktLen", devname);
359
-	velocity_set_int_opt((int *) &opts->spd_dpx, speed_duplex[index],
359
+	velocity_set_int_opt((void *) &opts->spd_dpx, speed_duplex[index],
360 360
 			     MED_LNK_MIN, MED_LNK_MAX, MED_LNK_DEF,
361 361
 			     "Media link mode", devname);
362 362
 	velocity_set_int_opt((int *) &opts->wol_opts, wol_opts[index],
@@ -472,8 +472,7 @@ extern void hex_dump(const char *data, const unsigned int len);
472 472
 /**************************************************************************
473 473
 POLL - Wait for a frame
474 474
 ***************************************************************************/
475
-//EB53 static int velocity_poll(struct nic *nic, int retrieve)
476
-static int  velocity_poll(struct nic *nic __unused)
475
+static int velocity_poll(struct nic *nic, int retrieve)
477 476
 {
478 477
 	/* Work out whether or not there's an ethernet packet ready to
479 478
 	 * read.  Return 0 if not.
@@ -486,6 +485,8 @@ static int  velocity_poll(struct nic *nic __unused)
486 485
 		return 0;
487 486
 	rmb();
488 487
 
488
+	if ( ! retrieve ) return 1;
489
+
489 490
 	/*
490 491
 	 *      Don't drop CE or RL error frame although RXOK is off
491 492
 	 */
@@ -666,9 +667,8 @@ static struct nic_operations velocity_operations = {
666 667
 /**************************************************************************
667 668
 PROBE - Look for an adapter, this routine's visible to the outside
668 669
 ***************************************************************************/
669
-static int velocity_probe(struct pci_device *dev, struct pci_device *pci)
670
+static int velocity_probe( struct nic *nic, struct pci_device *pci)
670 671
 {
671
-	struct nic *nic = (struct nic *) dev;
672 672
 	int ret, i;
673 673
 	struct mac_regs *regs;
674 674
 
@@ -705,9 +705,10 @@ static int velocity_probe(struct pci_device *dev, struct pci_device *pci)
705 705
 	for (i = 0; i < 6; i++)
706 706
 		nic->node_addr[i] = readb(&regs->PAR[i]);
707 707
 
708
-	DBG ( "%s: %s at ioaddr %#hX\n", pci->driver_name, eth_ntoa ( nic->node_addr ), BASE );
708
+	DBG ( "%s: %s at ioaddr %#hX\n", pci->driver_name, eth_ntoa ( nic->node_addr ),
709
+	      (unsigned int) BASE );
709 710
 
710
-	velocity_get_options(&vptr->options, 0, pci->driver_name);
711
+	velocity_get_options(&vptr->options, 0, (char *) pci->driver_name);
711 712
 
712 713
 	/* 
713 714
 	 *      Mask out the options cannot be set to the chip
@@ -768,7 +769,7 @@ static void velocity_init_info(struct pci_device *pdev,
768 769
 
769 770
 	printf
770 771
 	    ("chip_id: 0x%hX, io_size: %d, num_txq %d, multicast_limit: %d\n",
771
-	     vptr->chip_id, vptr->io_size, vptr->num_txq,
772
+	     vptr->chip_id, (unsigned int) vptr->io_size, vptr->num_txq,
772 773
 	     vptr->multicast_limit);
773 774
 	printf("Name: %s\n", info->name);
774 775
 
@@ -1148,14 +1149,16 @@ static int velocity_init_rings(struct velocity_info *vptr)
1148 1149
 
1149 1150
 
1150 1151
 	for (idx = 0; idx < RX_DESC_DEF; idx++) {
1151
-		*((u32 *) & (vptr->rd_ring[idx].rdesc0)) = 0;
1152
+		vptr->rd_ring[idx].rdesc0.RSR = 0;
1153
+		vptr->rd_ring[idx].rdesc0.len = 0;
1154
+		vptr->rd_ring[idx].rdesc0.reserved = 0;
1155
+		vptr->rd_ring[idx].rdesc0.owner = 0;
1152 1156
 		vptr->rd_ring[idx].len = cpu_to_le32(vptr->rx_buf_sz);
1153 1157
 		vptr->rd_ring[idx].inten = 1;
1154 1158
 		vptr->rd_ring[idx].pa_low =
1155 1159
 		    virt_to_bus(vptr->rxb + (RX_DESC_DEF * idx));
1156 1160
 		vptr->rd_ring[idx].pa_high = 0;
1157 1161
 		vptr->rd_ring[idx].rdesc0.owner = OWNED_BY_NIC;
1158
-
1159 1162
 	}
1160 1163
 
1161 1164
 /*	for (i = 0; idx < TX_DESC_DEF; idx++ ) {

+ 6
- 12
src/drivers/net/via-velocity.h Ver fichero

@@ -1,4 +1,3 @@
1
-#define EB54 1
2 1
 /*
3 2
  * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
4 3
  * All rights reserved.
@@ -27,14 +26,6 @@
27 26
 
28 27
 #include "timer.h"
29 28
 
30
-#ifndef EB54
31
-typedef unsigned char u8;
32
-typedef signed char s8;
33
-typedef unsigned short u16;
34
-typedef signed short s16;
35
-typedef unsigned int u32;
36
-typedef signed int s32;
37
-#endif
38 29
 #ifndef VELOCITY_H
39 30
 #define VELOCITY_H
40 31
 
@@ -1630,9 +1621,12 @@ struct velocity_context {
1630 1621
     ((int) ((w) & (x)));})
1631 1622
 
1632 1623
 #define MII_GET_PHY_ID(p) ({\
1633
-    u32 id;\
1634
-    velocity_mii_read((p),MII_REG_PHYID2,(u16 *) &id);\
1635
-    velocity_mii_read((p),MII_REG_PHYID1,((u16 *) &id)+1);\
1624
+    u32 id;  \
1625
+    u16 id2; \
1626
+    u16 id1; \
1627
+    velocity_mii_read((p),MII_REG_PHYID2, &id2);\
1628
+    velocity_mii_read((p),MII_REG_PHYID1, &id1);\
1629
+    id = ( ( (u32)id2 ) << 16 ) | id1;		\
1636 1630
     (id);})
1637 1631
 
1638 1632
 #ifdef LINUX

Loading…
Cancelar
Guardar