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],
/**************************************************************************
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.
return 0;
rmb();
+ if ( ! retrieve ) return 1;
+
/*
* Don't drop CE or RL error frame although RXOK is off
*/
/**************************************************************************
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;
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
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);
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++ ) {
-#define EB54 1
/*
* Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
* All rights reserved.
#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
((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