From 1069a74d2004b06293ec89f0dcfc22b550491b7c Mon Sep 17 00:00:00 2001 From: Marty Connor Date: Wed, 4 Jul 2007 21:58:28 -0400 Subject: [PATCH] Warnings purge for via-velocity.[ch] --- src/drivers/net/via-velocity.c | 23 +++++++++++++---------- src/drivers/net/via-velocity.h | 18 ++++++------------ 2 files changed, 19 insertions(+), 22 deletions(-) diff --git a/src/drivers/net/via-velocity.c b/src/drivers/net/via-velocity.c index 740cc30a..bb934bbe 100644 --- a/src/drivers/net/via-velocity.c +++ b/src/drivers/net/via-velocity.c @@ -356,7 +356,7 @@ static void velocity_get_options(struct velocity_opt *opts, int index, velocity_set_bool_opt(&opts->flags, ValPktLen[index], VAL_PKT_LEN_DEF, VELOCITY_FLAGS_VAL_PKT_LEN, "ValPktLen", devname); - velocity_set_int_opt((int *) &opts->spd_dpx, speed_duplex[index], + velocity_set_int_opt((void *) &opts->spd_dpx, speed_duplex[index], MED_LNK_MIN, MED_LNK_MAX, MED_LNK_DEF, "Media link mode", devname); 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); /************************************************************************** POLL - Wait for a frame ***************************************************************************/ -//EB53 static int velocity_poll(struct nic *nic, int retrieve) -static int velocity_poll(struct nic *nic __unused) +static int velocity_poll(struct nic *nic, int retrieve) { /* Work out whether or not there's an ethernet packet ready to * read. Return 0 if not. @@ -486,6 +485,8 @@ static int velocity_poll(struct nic *nic __unused) return 0; rmb(); + if ( ! retrieve ) return 1; + /* * Don't drop CE or RL error frame although RXOK is off */ @@ -666,9 +667,8 @@ static struct nic_operations velocity_operations = { /************************************************************************** PROBE - Look for an adapter, this routine's visible to the outside ***************************************************************************/ -static int velocity_probe(struct pci_device *dev, struct pci_device *pci) +static int velocity_probe( struct nic *nic, struct pci_device *pci) { - struct nic *nic = (struct nic *) dev; int ret, i; struct mac_regs *regs; @@ -705,9 +705,10 @@ static int velocity_probe(struct pci_device *dev, struct pci_device *pci) for (i = 0; i < 6; i++) nic->node_addr[i] = readb(®s->PAR[i]); - DBG ( "%s: %s at ioaddr %#hX\n", pci->driver_name, eth_ntoa ( nic->node_addr ), BASE ); + DBG ( "%s: %s at ioaddr %#hX\n", pci->driver_name, eth_ntoa ( nic->node_addr ), + (unsigned int) BASE ); - velocity_get_options(&vptr->options, 0, pci->driver_name); + velocity_get_options(&vptr->options, 0, (char *) pci->driver_name); /* * Mask out the options cannot be set to the chip @@ -768,7 +769,7 @@ static void velocity_init_info(struct pci_device *pdev, printf ("chip_id: 0x%hX, io_size: %d, num_txq %d, multicast_limit: %d\n", - vptr->chip_id, vptr->io_size, vptr->num_txq, + vptr->chip_id, (unsigned int) vptr->io_size, vptr->num_txq, vptr->multicast_limit); printf("Name: %s\n", info->name); @@ -1148,14 +1149,16 @@ static int velocity_init_rings(struct velocity_info *vptr) for (idx = 0; idx < RX_DESC_DEF; idx++) { - *((u32 *) & (vptr->rd_ring[idx].rdesc0)) = 0; + vptr->rd_ring[idx].rdesc0.RSR = 0; + vptr->rd_ring[idx].rdesc0.len = 0; + vptr->rd_ring[idx].rdesc0.reserved = 0; + vptr->rd_ring[idx].rdesc0.owner = 0; vptr->rd_ring[idx].len = cpu_to_le32(vptr->rx_buf_sz); vptr->rd_ring[idx].inten = 1; vptr->rd_ring[idx].pa_low = virt_to_bus(vptr->rxb + (RX_DESC_DEF * idx)); vptr->rd_ring[idx].pa_high = 0; vptr->rd_ring[idx].rdesc0.owner = OWNED_BY_NIC; - } /* for (i = 0; idx < TX_DESC_DEF; idx++ ) { diff --git a/src/drivers/net/via-velocity.h b/src/drivers/net/via-velocity.h index 6e1195d6..e0b8809f 100644 --- a/src/drivers/net/via-velocity.h +++ b/src/drivers/net/via-velocity.h @@ -1,4 +1,3 @@ -#define EB54 1 /* * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc. * All rights reserved. @@ -27,14 +26,6 @@ #include "timer.h" -#ifndef EB54 -typedef unsigned char u8; -typedef signed char s8; -typedef unsigned short u16; -typedef signed short s16; -typedef unsigned int u32; -typedef signed int s32; -#endif #ifndef VELOCITY_H #define VELOCITY_H @@ -1630,9 +1621,12 @@ struct velocity_context { ((int) ((w) & (x)));}) #define MII_GET_PHY_ID(p) ({\ - u32 id;\ - velocity_mii_read((p),MII_REG_PHYID2,(u16 *) &id);\ - velocity_mii_read((p),MII_REG_PHYID1,((u16 *) &id)+1);\ + u32 id; \ + u16 id2; \ + u16 id1; \ + velocity_mii_read((p),MII_REG_PHYID2, &id2);\ + velocity_mii_read((p),MII_REG_PHYID1, &id1);\ + id = ( ( (u32)id2 ) << 16 ) | id1; \ (id);}) #ifdef LINUX