mirror of
https://github.com/Stichting-MINIX-Research-Foundation/u-boot.git
synced 2025-09-10 04:26:19 -04:00
net: ftmac100: update get_timer() usages
Use get_timer() the same way as drivers/net/ftgmac100.c Signed-off-by: Po-Yu Chuang <ratbert@faraday-tech.com> Reviewed-by: Macpaul Lin <macpaul@gmail.com> Tested-by: Macpaul Lin <macpaul@gmail.com>
This commit is contained in:
parent
6f6e6e09b2
commit
8d8fd5b696
@ -195,8 +195,8 @@ ftmac100_send (struct eth_device *dev, volatile void *packet, int length)
|
|||||||
{
|
{
|
||||||
struct ftmac100 *ftmac100 = (struct ftmac100 *)dev->iobase;
|
struct ftmac100 *ftmac100 = (struct ftmac100 *)dev->iobase;
|
||||||
struct ftmac100_data *priv = dev->priv;
|
struct ftmac100_data *priv = dev->priv;
|
||||||
int tmo;
|
|
||||||
struct ftmac100_txdes *curr_des = priv->txdes;
|
struct ftmac100_txdes *curr_des = priv->txdes;
|
||||||
|
ulong start;
|
||||||
|
|
||||||
if (curr_des->txdes0 & FTMAC100_TXDES0_TXDMA_OWN) {
|
if (curr_des->txdes0 & FTMAC100_TXDES0_TXDMA_OWN) {
|
||||||
debug ("%s(): no TX descriptor available\n", __func__);
|
debug ("%s(): no TX descriptor available\n", __func__);
|
||||||
@ -224,9 +224,9 @@ ftmac100_send (struct eth_device *dev, volatile void *packet, int length)
|
|||||||
|
|
||||||
/* wait for transfer to succeed */
|
/* wait for transfer to succeed */
|
||||||
|
|
||||||
tmo = get_timer (0) + 5 * CONFIG_SYS_HZ;
|
start = get_timer(0);
|
||||||
while (curr_des->txdes0 & FTMAC100_TXDES0_TXDMA_OWN) {
|
while (curr_des->txdes0 & FTMAC100_TXDES0_TXDMA_OWN) {
|
||||||
if (get_timer (0) >= tmo) {
|
if (get_timer(start) >= 5) {
|
||||||
debug ("%s(): timed out\n", __func__);
|
debug ("%s(): timed out\n", __func__);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user