Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Warnings purge of drivers (continued)
  • Loading branch information
Marty Connor committed Jul 4, 2007
1 parent ac69b85 commit 1af1668
Show file tree
Hide file tree
Showing 18 changed files with 86 additions and 61 deletions.
6 changes: 3 additions & 3 deletions src/drivers/net/amd8111e.c
Expand Up @@ -135,7 +135,6 @@ static void amd8111e_restart(struct amd8111e_priv *lp);
static void amd8111e_init_hw_default(struct amd8111e_priv *lp)
{
unsigned int reg_val;
unsigned int logic_filter[2] = {0,};
void *mmio = lp->mmio;

/* stop the chip */
Expand Down Expand Up @@ -198,7 +197,8 @@ static void amd8111e_init_hw_default(struct amd8111e_priv *lp)
writew(MIB_CLEAR, mmio + MIB_ADDR);

/* Clear LARF */
amd8111e_writeq(*(u64*)logic_filter, mmio + LADRF);
writel( 0, mmio + LADRF);
writel( 0, mmio + LADRF + 4);

/* SRAM_SIZE register */
reg_val = readl(mmio + SRAM_SIZE);
Expand Down Expand Up @@ -342,7 +342,7 @@ static void amd8111e_probe_ext_phy(struct amd8111e_priv *lp)

if (lp->ext_phy_id)
printf("Found MII PHY ID 0x%08x at address 0x%02x\n",
lp->ext_phy_id, lp->ext_phy_addr);
(unsigned int) lp->ext_phy_id, lp->ext_phy_addr);
else
printf("Couldn't detect MII PHY, assuming address 0x01\n");
}
Expand Down
12 changes: 7 additions & 5 deletions src/drivers/net/bnx2.c
Expand Up @@ -22,12 +22,14 @@
#include "bnx2.h"
#include "bnx2_fw.h"

#if 0
/* Dummy defines for error handling */
#define EBUSY 1
#define ENODEV 2
#define EINVAL 3
#define ENOMEM 4
#define EIO 5
#endif

/* The bnx2 seems to be picky about the alignment of the receive buffers
* and possibly the status block.
Expand Down Expand Up @@ -1165,7 +1167,7 @@ bnx2_fw_sync(struct bnx2 *bp, u32 msg_data, int silent)
/* If we timed out, inform the firmware that this is the case. */
if ((val & BNX2_FW_MSG_ACK) != (msg_data & BNX2_DRV_MSG_SEQ)) {
if (!silent)
printf("fw sync timeout, reset code = %x\n", msg_data);
printf("fw sync timeout, reset code = %x\n", (unsigned int) msg_data);

msg_data &= ~BNX2_DRV_MSG_CODE;
msg_data |= BNX2_DRV_MSG_CODE_FW_TIMEOUT;
Expand Down Expand Up @@ -2033,7 +2035,7 @@ static void
bnx2_init_rx_ring(struct bnx2 *bp)
{
struct rx_bd *rxbd;
int i;
unsigned int i;
u16 prod, ring_prod;
u32 val;

Expand Down Expand Up @@ -2066,7 +2068,7 @@ bnx2_init_rx_ring(struct bnx2 *bp)
val = bp->rx_desc_mapping & 0xffffffff;
CTX_WR(bp, GET_CID_ADDR(RX_CID), BNX2_L2CTX_NX_BDHADDR_LO, val);

for (i = 0; i < bp->rx_ring_size; i++) {
for (i = 0; (int) i < bp->rx_ring_size; i++) {
rxbd = &bp->rx_desc_ring[RX_RING_IDX(ring_prod)];
rxbd->rx_bd_haddr_hi = 0;
rxbd->rx_bd_haddr_lo = virt_to_bus(&bnx2_bss.rx_buf[ring_prod][0]);
Expand Down Expand Up @@ -2635,8 +2637,8 @@ bnx2_probe(struct nic *nic, struct pci_device *pdev)
memcpy(nic->node_addr, bp->mac_addr, ETH_ALEN);
printf("Ethernet addr: %s\n", eth_ntoa( nic->node_addr ) );
printf("Broadcom NetXtreme II (%c%d) PCI%s %s %dMHz\n",
((CHIP_ID(bp) & 0xf000) >> 12) + 'A',
((CHIP_ID(bp) & 0x0ff0) >> 4),
(int) ((CHIP_ID(bp) & 0xf000) >> 12) + 'A',
(int) ((CHIP_ID(bp) & 0x0ff0) >> 4),
((bp->flags & PCIX_FLAG) ? "-X" : ""),
((bp->flags & PCI_32BIT_FLAG) ? "32-bit" : "64-bit"),
bp->bus_speed_mhz);
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/net/bnx2.h
Expand Up @@ -4091,7 +4091,7 @@ struct flash_spec {
u32 page_size;
u32 addr_mask;
u32 total_size;
u8 *name;
char *name;
};

struct bnx2 {
Expand Down
5 changes: 4 additions & 1 deletion src/drivers/net/depca.c
@@ -1,5 +1,6 @@
#warning "depca.c almost certainly won't work"
#warning "depca.c almost certainly won't work."

#if 0
/* Not fixed for relocation yet. Probably won't work relocated above 16MB */
#ifdef ALLMULTI
#error multicast support is not yet implemented
Expand Down Expand Up @@ -791,3 +792,5 @@ DRIVER ( "depce", nic_driver, isa_driver, depca_driver,
depca_probe, depca_disable );

ISA_ROM ( "depca", "Digital DE100 and DE200" );

#endif
2 changes: 1 addition & 1 deletion src/drivers/net/dmfe.c
Expand Up @@ -1022,7 +1022,7 @@ static u16 phy_read_1bit(unsigned long ioaddr)

static void dmfe_parse_srom(struct nic *nic)
{
char *srom = db->srom;
unsigned char *srom = db->srom;
int dmfe_mode, tmp_reg;

/* Init CR15 */
Expand Down
13 changes: 7 additions & 6 deletions src/drivers/net/eepro.c
Expand Up @@ -265,11 +265,12 @@ static unsigned eeprom_reg = EEPROM_REG_PRO;
#define eepro_full_reset(ioaddr) outb(RESET_CMD, ioaddr); udelay(255);

/* do a nice reset */
#define eepro_sel_reset(ioaddr) { \
outb(SEL_RESET_CMD, ioaddr); \
SLOW_DOWN; \
SLOW_DOWN; \
}
#define eepro_sel_reset(ioaddr) \
do { \
outb ( SEL_RESET_CMD, ioaddr ); \
(void) SLOW_DOWN; \
(void) SLOW_DOWN; \
} while (0)

/* clear all interrupts */
#define eepro_clear_int(ioaddr) outb(ALL_MASK, ioaddr + STATUS_REG)
Expand Down Expand Up @@ -332,7 +333,7 @@ static void eepro_reset(struct nic *nic)
/* Intialise XMT */
outw((XMT_LOWER_LIMIT << 8), nic->ioaddr + xmt_bar);
eepro_sel_reset(nic->ioaddr);
tx_start = tx_end = (XMT_LOWER_LIMIT << 8);
tx_start = tx_end = (unsigned int) (XMT_LOWER_LIMIT << 8);
tx_last = 0;
eepro_en_rx(nic->ioaddr);
}
Expand Down
6 changes: 3 additions & 3 deletions src/drivers/net/mtd80x.c
Expand Up @@ -534,7 +534,7 @@ static int mtd_poll(struct nic *nic, __unused int retrieve)
if (rx_status & ErrorSummary)
{ /* there was a fatal error */
printf( "%s: Receive error, Rx status %8.8x, Error(s) %s%s%s\n",
mtdx.nic_name, rx_status ,
mtdx.nic_name, (unsigned int) rx_status,
(rx_status & (LONG | RUNT)) ? "length_error ":"",
(rx_status & RXER) ? "frame_error ":"",
(rx_status & CRC) ? "crc_error ":"" );
Expand All @@ -550,7 +550,7 @@ static int mtd_poll(struct nic *nic, __unused int retrieve)
short pkt_len = ((rx_status & FLNGMASK) >> FLNGShift) - 4;

DBG ( " netdev_rx() normal Rx pkt length %d"
" status %x.\n", pkt_len, rx_status );
" status %x.\n", pkt_len, (unsigned int) rx_status );

nic->packetlen = pkt_len;
memcpy(nic->packet, mtdx.cur_rx->skbuff, pkt_len);
Expand Down Expand Up @@ -619,7 +619,7 @@ static void mtd_transmit(
DBG ( "TX Time Out" );
} else if( tx_status & (CSL | LC | EC | UDF | HF)){
printf( "Transmit error: %8.8x %s %s %s %s %s\n",
tx_status,
(unsigned int) tx_status,
tx_status & EC ? "abort" : "",
tx_status & CSL ? "carrier" : "",
tx_status & LC ? "late" : "",
Expand Down
13 changes: 7 additions & 6 deletions src/drivers/net/natsemi.c
Expand Up @@ -536,7 +536,8 @@ natsemi_init_rxd(struct nic *nic __unused)
rxd[i].bufptr = virt_to_bus(&rxb[i*RX_BUF_SIZE]);
if (natsemi_debug > 1)
printf("natsemi_init_rxd: rxd[%d]=%p link=%X cmdsts=%X bufptr=%4.4x\n",
i, &rxd[i], rxd[i].link, rxd[i].cmdsts, rxd[i].bufptr);
i, &rxd[i], (unsigned int) rxd[i].link, (unsigned int) rxd[i].cmdsts,
(unsigned int) rxd[i].bufptr);
}

/* load Receive Descriptor Register */
Expand Down Expand Up @@ -648,11 +649,11 @@ natsemi_transmit(struct nic *nic,
/* wait */ ;

if (currticks() >= to) {
printf("natsemi_transmit: TX Timeout! Tx status %X.\n", tx_status);
printf("natsemi_transmit: TX Timeout! Tx status %X.\n", (unsigned int) tx_status);
}

if (!(tx_status & 0x08000000)) {
printf("natsemi_transmit: Transmit error, Tx status %X.\n", tx_status);
printf("natsemi_transmit: Transmit error, Tx status %X.\n", (unsigned int) tx_status);
}
}

Expand All @@ -677,7 +678,7 @@ natsemi_poll(struct nic *nic, int retrieve)
int retstat = 0;

if (natsemi_debug > 2)
printf("natsemi_poll: cur_rx:%d, status:%X\n", cur_rx, rx_status);
printf("natsemi_poll: cur_rx:%d, status:%X\n", cur_rx, (unsigned int) rx_status);

if (!(rx_status & OWN))
return retstat;
Expand All @@ -686,14 +687,14 @@ natsemi_poll(struct nic *nic, int retrieve)

if (natsemi_debug > 1)
printf("natsemi_poll: got a packet: cur_rx:%d, status:%X\n",
cur_rx, rx_status);
cur_rx, (unsigned int) rx_status);

nic->packetlen = (rx_status & DSIZE) - CRC_SIZE;

if ((rx_status & (DescMore|DescPktOK|RxTooLong)) != DescPktOK) {
/* corrupted packet received */
printf("natsemi_poll: Corrupted packet received, buffer status = %X\n",
rx_status);
(unsigned int) rx_status);
retstat = 0;
} else {
/* give packet to higher level routine */
Expand Down
5 changes: 3 additions & 2 deletions src/drivers/net/ns83820.c
Expand Up @@ -631,9 +631,10 @@ static void ns83820_run_bist(struct nic *nic __unused, const char *name,
}

if (status & fail)
printf("%s failed! (0x%hX & 0x%hX)\n", name, status, fail);
printf("%s failed! (0x%hX & 0x%hX)\n", name, (unsigned int) status,
(unsigned int) fail);
else if (timed_out)
printf("run_bist %s timed out! (%hX)\n", name, status);
printf("run_bist %s timed out! (%hX)\n", name, (unsigned int) status);
dprintf(("done %s in %d loops\n", name, loops));
}

Expand Down
17 changes: 9 additions & 8 deletions src/drivers/net/ns8390.c
Expand Up @@ -449,11 +449,11 @@ static void ns8390_transmit(
/* Programmed I/O */
unsigned short type;
type = (t >> 8) | (t << 8);
eth_pio_write(d, eth_tx_start<<8, ETH_ALEN);
eth_pio_write( (unsigned char *) d, eth_tx_start<<8, ETH_ALEN);
eth_pio_write(nic->node_addr, (eth_tx_start<<8)+ETH_ALEN, ETH_ALEN);
/* bcc generates worse code without (const+const) below */
eth_pio_write((unsigned char *)&type, (eth_tx_start<<8)+(ETH_ALEN+ETH_ALEN), 2);
eth_pio_write(p, (eth_tx_start<<8)+ETH_HLEN, s);
eth_pio_write( (unsigned char *) p, (eth_tx_start<<8)+ETH_HLEN, s);
s += ETH_HLEN;
if (s < ETH_ZLEN) s = ETH_ZLEN;
}
Expand Down Expand Up @@ -533,7 +533,7 @@ static int ns8390_poll(struct nic *nic, int retrieve)
#endif
pktoff = next << 8;
if (eth_flags & FLAG_PIO)
eth_pio_read(pktoff, (char *)&pkthdr, 4);
eth_pio_read(pktoff, (unsigned char *)&pkthdr, 4);
else
memcpy(&pkthdr, bus_to_virt(eth_rmem + pktoff), 4);
pktoff += sizeof(pkthdr);
Expand Down Expand Up @@ -876,9 +876,10 @@ static int eth_probe (struct dev *dev, unsigned short *probe_addrs __unused)
******************************************************************/
unsigned char c;
if (eth_vendor == VENDOR_NONE) {
char romdata[16], testbuf[32];
unsigned char romdata[16];
unsigned char testbuf[32];
int idx;
static char test[] = "NE*000 memory";
static unsigned char test[] = "NE*000 memory";
static unsigned short base[] = {
#ifdef NE_SCAN
NE_SCAN,
Expand All @@ -896,7 +897,7 @@ static int eth_probe (struct dev *dev, unsigned short *probe_addrs __unused)
eth_rx_start = 32 + D8390_TXBUF_SIZE;
c = inb(eth_asic_base + NE_RESET);
outb(c, eth_asic_base + NE_RESET);
inb(0x84);
(void) inb(0x84);
outb(D8390_COMMAND_STP |
D8390_COMMAND_RD2, eth_nic_base + D8390_P0_COMMAND);
outb(D8390_RCR_MON, eth_nic_base + D8390_P0_RCR);
Expand All @@ -907,7 +908,7 @@ static int eth_probe (struct dev *dev, unsigned short *probe_addrs __unused)
eth_flags |= FLAG_16BIT; /* force 16-bit mode */
#endif

eth_pio_write(test, 8192, sizeof(test));
eth_pio_write( (unsigned char *) test, 8192, sizeof(test));
eth_pio_read(8192, testbuf, sizeof(test));
if (!memcmp(test, testbuf, sizeof(test)))
break;
Expand All @@ -919,7 +920,7 @@ static int eth_probe (struct dev *dev, unsigned short *probe_addrs __unused)
D8390_DCR_FT1 | D8390_DCR_LS, eth_nic_base + D8390_P0_DCR);
outb(MEM_16384, eth_nic_base + D8390_P0_PSTART);
outb(MEM_32768, eth_nic_base + D8390_P0_PSTOP);
eth_pio_write(test, 16384, sizeof(test));
eth_pio_write( (unsigned char *) test, 16384, sizeof(test));
eth_pio_read(16384, testbuf, sizeof(test));
if (!memcmp(testbuf, test, sizeof(test)))
break;
Expand Down
4 changes: 2 additions & 2 deletions src/drivers/net/pcnet32.c
Expand Up @@ -787,7 +787,7 @@ static int pcnet32_probe ( struct nic *nic, struct pci_device *pci ) {
ltint = 1;
}

DBG ( "%s at %hX,", chipname, ioaddr );
DBG ( "%s at %hX,", chipname, (unsigned int) ioaddr );

/* read PROM address */
for (i = 0; i < 6; i++)
Expand All @@ -799,7 +799,7 @@ static int pcnet32_probe ( struct nic *nic, struct pci_device *pci ) {
}

/* Print out some hardware info */
DBG ( "%s: IO Addr 0x%hX, MAC Addr %s\n ", chipname, ioaddr,
DBG ( "%s: IO Addr 0x%hX, MAC Addr %s\n ", chipname, (unsigned int) ioaddr,
eth_ntoa ( nic->node_addr ) );

/* Set to pci bus master */
Expand Down
12 changes: 11 additions & 1 deletion src/drivers/net/r8169.c
Expand Up @@ -74,12 +74,22 @@ static u32 ioaddr;


#ifdef RTL8169_DEBUG

#if 0
#define assert(expr) \
if(!(expr)) { printk( "Assertion failed! %s,%s,%s,line=%d\n", #expr,__FILE__,__FUNCTION__,__LINE__); }
#endif

#define DBG_PRINTF( fmt, args...) printk("r8169: " fmt, ## args);

#else

#if 0
#define assert(expr) do {} while (0)
#endif

#define DBG_PRINTF( fmt, args...) ;

#endif // end of #ifdef RTL8169_DEBUG

/* media options
Expand Down Expand Up @@ -904,7 +914,7 @@ static int r8169_probe ( struct nic *nic, struct pci_device *pci ) {

/* Print out some hardware info */
DBG ( "%s: %s at IOAddr %#hX, ", pci->driver_name, eth_ntoa ( nic->node_addr ),
ioaddr );
(unsigned int) ioaddr );

/* Config PHY */
rtl8169_hw_PHY_config(nic);
Expand Down
16 changes: 10 additions & 6 deletions src/drivers/net/sis900.c
Expand Up @@ -751,7 +751,8 @@ sis900_init_rxd(struct nic *nic __unused)
rxd[i].bufptr = virt_to_bus(&rxb[i*RX_BUF_SIZE]);
if (sis900_debug > 0)
printf("sis900_init_rxd: rxd[%d]=%p link=%X cmdsts=%X bufptr=%X\n",
i, &rxd[i], rxd[i].link, rxd[i].cmdsts, rxd[i].bufptr);
i, &rxd[i], (unsigned int) rxd[i].link, (unsigned int) rxd[i].cmdsts,
(unsigned int) rxd[i].bufptr);
}

/* load Receive Descriptor Register */
Expand Down Expand Up @@ -1146,12 +1147,14 @@ sis900_transmit(struct nic *nic,
/* wait */ ;

if (currticks() >= to) {
printf("sis900_transmit: TX Timeout! Tx status %X.\n", tx_status);
printf("sis900_transmit: TX Timeout! Tx status %X.\n",
(unsigned int) tx_status);
}

if (tx_status & (ABORT | UNDERRUN | OWCOLL)) {
/* packet unsuccessfully transmited */
printf("sis900_transmit: Transmit error, Tx status %X.\n", tx_status);
printf("sis900_transmit: Transmit error, Tx status %X.\n",
(unsigned int) tx_status);
}
/* Disable interrupts by clearing the interrupt mask. */
outl(0, ioaddr + imr);
Expand Down Expand Up @@ -1179,14 +1182,15 @@ sis900_poll(struct nic *nic, int retrieve)
int retstat = 0;

if (sis900_debug > 2)
printf("sis900_poll: cur_rx:%d, status:%X\n", cur_rx, rx_status);
printf("sis900_poll: cur_rx:%d, status:%X\n", cur_rx,
(unsigned int) rx_status);

if (!(rx_status & OWN))
return retstat;

if (sis900_debug > 1)
printf("sis900_poll: got a packet: cur_rx:%d, status:%X\n",
cur_rx, rx_status);
cur_rx, (unsigned int) rx_status);

if ( ! retrieve ) return 1;

Expand All @@ -1195,7 +1199,7 @@ sis900_poll(struct nic *nic, int retrieve)
if (rx_status & (ABORT|OVERRUN|TOOLONG|RUNT|RXISERR|CRCERR|FAERR)) {
/* corrupted packet received */
printf("sis900_poll: Corrupted packet received, buffer status = %X\n",
rx_status);
(unsigned int) rx_status);
retstat = 0;
} else {
/* give packet to higher level routine */
Expand Down

0 comments on commit 1af1668

Please sign in to comment.