if (ixEthAccPortRxCallbackRegister(p_npe->eth_id, npe_rx_callback,
(u32)p_npe) != IX_ETH_ACC_SUCCESS) {
printf("can't register RX callback!\n");
- return 0;
+ return -1;
}
if (ixEthAccPortTxDoneCallbackRegister(p_npe->eth_id, npe_tx_callback,
(u32)p_npe) != IX_ETH_ACC_SUCCESS) {
printf("can't register TX callback!\n");
- return 0;
+ return -1;
}
npe_set_mac_address(dev);
if (ixEthAccPortEnable(p_npe->eth_id) != IX_ETH_ACC_SUCCESS) {
printf("can't enable port!\n");
- return 0;
+ return -1;
}
p_npe->active = 1;
- return 1;
+ return 0;
}
#if 0 /* test-only: probably have to deal with it when booting linux (for a clean state) */
if (efis->actual_phy_addr == -1) {
printf ("Unable to discover phy!\n");
- return 0;
+ return -1;
}
#else
efis->actual_phy_addr = -1;
efis->initialized = 1;
- return 1;
+ return 0;
}
if ((INL(dev, DE4X5_STS) & (STS_TS | STS_RS)) != 0) {
printf("Error: Cannot reset ethernet controller.\n");
- return 0;
+ return -1;
}
#ifdef CONFIG_TULIP_SELECT_MEDIA
send_setup_frame(dev, bis);
- return 1;
+ return 0;
}
static int dc21x4x_send(struct eth_device* dev, volatile void *packet, int length)
static int eepro100_init (struct eth_device *dev, bd_t * bis)
{
- int i, status = 0;
+ int i, status = -1;
int tx_cur;
struct descriptor *ias_cmd, *cfg_cmd;
goto Done;
}
- status = 1;
+ status = 0;
Done:
return status;
#endif
if (!macb_phy_init(macb))
- return 0;
+ return -1;
/* Enable TX and RX */
macb_writel(macb, NCR, MACB_BIT(TE) | MACB_BIT(RE));
- return 1;
+ return 0;
}
static void macb_halt(struct eth_device *netdev)
if (i <= 0) {
printf("%s: TIMEOUT: controller init failed\n", dev->name);
pcnet_reset (dev);
- return 0;
+ return -1;
}
/*
*/
pcnet_write_csr (dev, 0, 0x0002);
- return 1;
+ return 0;
}
static int pcnet_send(struct eth_device* dev, volatile void *packet, int pkt_len)
if (inb(ioaddr + MediaStatus) & MSRLinkFail) {
printf("Cable not connected or other link failure\n");
- return(0);
+ return -1 ;
}
- return 1;
+ return 0;
}
/* Serial EEPROM section. */
/**************************************************************************
RESET - Finish setting up the ethernet interface
***************************************************************************/
-static void rtl_reset(struct eth_device *dev, bd_t *bis)
+static int rtl_reset(struct eth_device *dev, bd_t *bis)
{
int i;
#ifdef DEBUG_RTL8169
printf ("%s elapsed time : %d\n", __FUNCTION__, currticks()-stime);
#endif
+ return 0;
}
/**************************************************************************
startup_tsec(dev);
/* If there's no link, fail */
- return priv->link;
+ return (priv->link ? 0 : -1);
}
(dev->enetaddr[0] << 16);
if (marvell_88e_phy_config(dev, &speed, &duplex) == 0)
- return 0;
+ return -1;
value =
MAC_CONFIG_2_PREAMBLE_LENGTH(7) | MAC_CONFIG_2_PAD_CRC |
/* enable TX queue */
reg_TX_CONTROL(base) = TX_CONTROL_GO | 0x01;
- return 1;
+ return 0;
}
/*
db->desc_pool_ptr = (uchar *)&desc_pool_array[0];
db->desc_pool_dma_ptr = (dma_addr_t)&desc_pool_array[0];
if (db->desc_pool_ptr == NULL)
- return 0;
+ return -1;
db->buf_pool_ptr = &buf_pool[0];
db->buf_pool_dma_ptr = (dma_addr_t)&buf_pool[0];
if (db->buf_pool_ptr == NULL)
- return 0;
+ return -1;
db->first_tx_desc = (struct tx_desc *) db->desc_pool_ptr;
db->first_tx_desc_dma = db->desc_pool_dma_ptr;
db->cr6_data |= ULI526X_TXTH_256;
db->cr0_data = CR0_DEFAULT;
uli526x_init(dev);
- return 1;
+ return 0;
}
static void uli526x_disable(struct eth_device *dev)
if (dev->enetaddr[0] & 0x01) {
printf("%s: MacAddress is multcast address\n",
__FUNCTION__);
- return 0;
+ return -1;
}
uec_set_mac_address(uec, dev->enetaddr);
uec->the_first_run = 1;
err = uec_open(uec, COMM_DIR_RX_AND_TX);
if (err) {
printf("%s: cannot enable UEC device\n", dev->name);
- return 0;
+ return -1;
}
- return uec->mii_info->link;
+ return (uec->mii_info->link ? 0 : -1);
}
static void uec_halt(struct eth_device* dev)
do {
debug ("Trying %s\n", eth_current->name);
- if (!eth_current->init(eth_current,bis)) {
+ if (eth_current->init(eth_current,bis) >= 0) {
eth_current->state = ETH_STATE_ACTIVE;
return 0;