@ -66,12 +66,12 @@ static int smi_reg_read(const char *devname, u8 phy_adr, u8 reg_ofs, u16 * data)
/* check parameters */
if ( phy_adr > PHYADR_MASK ) {
printf ( " Err..(%s) Invalid PHY address %d \n " ,
__FUNCTION __ , phy_adr ) ;
__func __ , phy_adr ) ;
return - EFAULT ;
}
if ( reg_ofs > PHYREG_MASK ) {
printf ( " Err..(%s) Invalid register offset %d \n " ,
__FUNCTION __ , reg_ofs ) ;
__func __ , reg_ofs ) ;
return - EFAULT ;
}
@ -81,7 +81,7 @@ static int smi_reg_read(const char *devname, u8 phy_adr, u8 reg_ofs, u16 * data)
/* read smi register */
smi_reg = MVGBE_REG_RD ( MVGBE_SMI_REG ) ;
if ( timeout - - = = 0 ) {
printf ( " Err..(%s) SMI busy timeout \n " , __FUNCTION __ ) ;
printf ( " Err..(%s) SMI busy timeout \n " , __func __ ) ;
return - EFAULT ;
}
} while ( smi_reg & MVGBE_PHY_SMI_BUSY_MASK ) ;
@ -102,7 +102,7 @@ static int smi_reg_read(const char *devname, u8 phy_adr, u8 reg_ofs, u16 * data)
smi_reg = MVGBE_REG_RD ( MVGBE_SMI_REG ) ;
if ( timeout - - = = 0 ) {
printf ( " Err..(%s) SMI read ready timeout \n " ,
__FUNCTION __ ) ;
__func __ ) ;
return - EFAULT ;
}
} while ( ! ( smi_reg & MVGBE_PHY_SMI_READ_VALID_MASK ) ) ;
@ -113,8 +113,8 @@ static int smi_reg_read(const char *devname, u8 phy_adr, u8 reg_ofs, u16 * data)
* data = ( u16 ) ( MVGBE_REG_RD ( MVGBE_SMI_REG ) & MVGBE_PHY_SMI_DATA_MASK ) ;
debug ( " %s:(adr %d, off %d) value= %04x \n " , __FUNCTION __ , phy_adr ,
reg_ofs , * data ) ;
debug ( " %s:(adr %d, off %d) value= %04x \n " , __func __ , phy_adr , reg_ofs ,
* data ) ;
return 0 ;
}
@ -142,11 +142,11 @@ static int smi_reg_write(const char *devname, u8 phy_adr, u8 reg_ofs, u16 data)
/* check parameters */
if ( phy_adr > PHYADR_MASK ) {
printf ( " Err..(%s) Invalid phy address \n " , __FUNCTION __ ) ;
printf ( " Err..(%s) Invalid phy address \n " , __func __ ) ;
return - EINVAL ;
}
if ( reg_ofs > PHYREG_MASK ) {
printf ( " Err..(%s) Invalid register offset \n " , __FUNCTION __ ) ;
printf ( " Err..(%s) Invalid register offset \n " , __func __ ) ;
return - EINVAL ;
}
@ -156,7 +156,7 @@ static int smi_reg_write(const char *devname, u8 phy_adr, u8 reg_ofs, u16 data)
/* read smi register */
smi_reg = MVGBE_REG_RD ( MVGBE_SMI_REG ) ;
if ( timeout - - = = 0 ) {
printf ( " Err..(%s) SMI busy timeout \n " , __FUNCTION __ ) ;
printf ( " Err..(%s) SMI busy timeout \n " , __func __ ) ;
return - ETIME ;
}
} while ( smi_reg & MVGBE_PHY_SMI_BUSY_MASK ) ;
@ -583,7 +583,7 @@ static int mvgbe_send(struct eth_device *dev, void *dataptr, int datasize)
if ( ( cmd_sts & ( MVGBE_ERROR_SUMMARY | MVGBE_TX_LAST_FRAME ) ) = =
( MVGBE_ERROR_SUMMARY | MVGBE_TX_LAST_FRAME ) & &
cmd_sts & ( MVGBE_UR_ERROR | MVGBE_RL_ERROR ) ) {
printf ( " Err..(%s) in xmit packet \n " , __FUNCTION __ ) ;
printf ( " Err..(%s) in xmit packet \n " , __func __ ) ;
return - 1 ;
}
cmd_sts = readl ( & p_txdesc - > cmd_sts ) ;
@ -604,14 +604,14 @@ static int mvgbe_recv(struct eth_device *dev)
if ( timeout < MVGBE_PHY_SMI_TIMEOUT )
timeout + + ;
else {
debug ( " %s time out... \n " , __FUNCTION __ ) ;
debug ( " %s time out... \n " , __func __ ) ;
return - 1 ;
}
} while ( readl ( & p_rxdesc_curr - > cmd_sts ) & MVGBE_BUFFER_OWNED_BY_DMA ) ;
if ( p_rxdesc_curr - > byte_cnt ! = 0 ) {
debug ( " %s: Received %d byte Packet @ 0x%x (cmd_sts= %08x) \n " ,
__FUNCTION __ , ( u32 ) p_rxdesc_curr - > byte_cnt ,
__func __ , ( u32 ) p_rxdesc_curr - > byte_cnt ,
( u32 ) p_rxdesc_curr - > buf_ptr ,
( u32 ) p_rxdesc_curr - > cmd_sts ) ;
}
@ -628,21 +628,24 @@ static int mvgbe_recv(struct eth_device *dev)
! = ( MVGBE_RX_FIRST_DESC | MVGBE_RX_LAST_DESC ) ) {
printf ( " Err..(%s) Dropping packet spread on "
" multiple descriptors \n " , __FUNCTION __ ) ;
" multiple descriptors \n " , __func __ ) ;
} else if ( cmd_sts & MVGBE_ERROR_SUMMARY ) {
printf ( " Err..(%s) Dropping packet with errors \n " ,
__FUNCTION __ ) ;
__func __ ) ;
} else {
/* !!! call higher layer processing */
debug ( " %s: Sending Received packet to "
" upper layer (NetReceive) \n " , __FUNCTION__ ) ;
" upper layer (net_process_received_packet) \n " ,
__func__ ) ;
/* let the upper layer handle the packet */
NetReceive ( ( p_rxdesc_curr - > buf_ptr + RX_BUF_OFFSET ) ,
( int ) ( p_rxdesc_curr - > byte_cnt - RX_BUF_OFFSET ) ) ;
net_process_received_packet ( ( p_rxdesc_curr - > buf_ptr +
RX_BUF_OFFSET ) ,
( int ) ( p_rxdesc_curr - > byte_cnt -
RX_BUF_OFFSET ) ) ;
}
/*
* free these descriptors and point next in the ring
@ -747,7 +750,7 @@ error2:
free ( dmvgbe ) ;
error1 :
printf ( " Err.. %s Failed to allocate memory \n " ,
__FUNCTION __ ) ;
__func __ ) ;
return - 1 ;
}
@ -767,7 +770,7 @@ error1:
# endif
default : /* this should never happen */
printf ( " Err..(%s) Invalid device number %d \n " ,
__FUNCTION __ , devnum ) ;
__func __ , devnum ) ;
return - 1 ;
}