X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=drivers%2Fnet%2Feepro100.c;h=d4a6386810b6509bcfbcc5ef90556210129287ad;hb=3917c26909e4021c73073672865ec456eb51d640;hp=86709a7f0ad8173902cc5756a5f9b95854eb816f;hpb=8ef583a0351590a91394499eb5ca2ab8a703d959;p=oweals%2Fu-boot.git diff --git a/drivers/net/eepro100.c b/drivers/net/eepro100.c index 86709a7f0a..d4a6386810 100644 --- a/drivers/net/eepro100.c +++ b/drivers/net/eepro100.c @@ -2,23 +2,7 @@ * (C) Copyright 2002 * Wolfgang Denk, DENX Software Engineering, wd@denx.de. * - * See file CREDITS for list of people who contributed to this - * project. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA + * SPDX-License-Identifier: GPL-2.0+ */ #include @@ -242,12 +226,11 @@ static void purge_tx_ring (struct eth_device *dev); static void read_hw_addr (struct eth_device *dev, bd_t * bis); static int eepro100_init (struct eth_device *dev, bd_t * bis); -static int eepro100_send (struct eth_device *dev, volatile void *packet, - int length); +static int eepro100_send(struct eth_device *dev, void *packet, int length); static int eepro100_recv (struct eth_device *dev); static void eepro100_halt (struct eth_device *dev); -#if defined(CONFIG_E500) || defined(CONFIG_DB64360) || defined(CONFIG_DB64460) +#if defined(CONFIG_E500) #define bus_to_phys(a) (a) #define phys_to_bus(a) (a) #else @@ -257,23 +240,23 @@ static void eepro100_halt (struct eth_device *dev); static inline int INW (struct eth_device *dev, u_long addr) { - return le16_to_cpu (*(volatile u16 *) (addr + dev->iobase)); + return le16_to_cpu(*(volatile u16 *)(addr + (u_long)dev->iobase)); } static inline void OUTW (struct eth_device *dev, int command, u_long addr) { - *(volatile u16 *) ((addr + dev->iobase)) = cpu_to_le16 (command); + *(volatile u16 *)((addr + (u_long)dev->iobase)) = cpu_to_le16(command); } static inline void OUTL (struct eth_device *dev, int command, u_long addr) { - *(volatile u32 *) ((addr + dev->iobase)) = cpu_to_le32 (command); + *(volatile u32 *)((addr + (u_long)dev->iobase)) = cpu_to_le32(command); } #if defined(CONFIG_MII) || defined(CONFIG_CMD_MII) static inline int INL (struct eth_device *dev, u_long addr) { - return le32_to_cpu (*(volatile u32 *) (addr + dev->iobase)); + return le32_to_cpu(*(volatile u32 *)(addr + (u_long)dev->iobase)); } static int get_phyreg (struct eth_device *dev, unsigned char addr, @@ -608,7 +591,7 @@ static int eepro100_init (struct eth_device *dev, bd_t * bis) return status; } -static int eepro100_send (struct eth_device *dev, volatile void *packet, int length) +static int eepro100_send(struct eth_device *dev, void *packet, int length) { int i, status = -1; int tx_cur; @@ -691,7 +674,8 @@ static int eepro100_recv (struct eth_device *dev) /* Pass the packet up to the protocol * layers. */ - NetReceive (rx_ring[rx_next].data, length); + net_process_received_packet((u8 *)rx_ring[rx_next].data, + length); } else { /* There was an error. */ @@ -923,7 +907,6 @@ static void purge_tx_ring (struct eth_device *dev) static void read_hw_addr (struct eth_device *dev, bd_t * bis) { - u16 eeprom[0x40]; u16 sum = 0; int i, j; int addr_len = read_eeprom (dev, 0, 6) == 0xffff ? 8 : 6; @@ -931,7 +914,6 @@ static void read_hw_addr (struct eth_device *dev, bd_t * bis) for (j = 0, i = 0; i < 0x40; i++) { u16 value = read_eeprom (dev, i, addr_len); - eeprom[i] = value; sum += value; if (i < 3) { dev->enetaddr[j++] = value;