]> git.sur5r.net Git - u-boot/blobdiff - drivers/net/smc911x.c
net: phy: Add support for all targets which requires MANUAL_RELOC
[u-boot] / drivers / net / smc911x.c
index a677fd487adde9e2165b145ae2477247506ea353..c85a178cd89a0ec7db1a619e49f1832f505ced94 100644 (file)
@@ -3,23 +3,7 @@
  *
  * (c) 2007 Pengutronix, Sascha Hauer <s.hauer@pengutronix.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 <common.h>
@@ -35,8 +19,6 @@ u32 pkt_data_pull(struct eth_device *dev, u32 addr) \
 void pkt_data_push(struct eth_device *dev, u32 addr, u32 val) \
        __attribute__ ((weak, alias ("smc911x_reg_write")));
 
-#define mdelay(n)       udelay((n)*1000)
-
 static void smc911x_handle_mac_address(struct eth_device *dev)
 {
        unsigned long addrh, addrl;
@@ -163,8 +145,7 @@ static int smc911x_init(struct eth_device *dev, bd_t * bd)
        return 0;
 }
 
-static int smc911x_send(struct eth_device *dev,
-                       volatile void *packet, int length)
+static int smc911x_send(struct eth_device *dev, void *packet, int length)
 {
        u32 *data = (u32*)packet;
        u32 tmplen;
@@ -206,11 +187,12 @@ static int smc911x_send(struct eth_device *dev,
 static void smc911x_halt(struct eth_device *dev)
 {
        smc911x_reset(dev);
+       smc911x_handle_mac_address(dev);
 }
 
 static int smc911x_rx(struct eth_device *dev)
 {
-       u32 *data = (u32 *)NetRxPackets[0];
+       u32 *data = (u32 *)net_rx_packets[0];
        u32 pktlen, tmplen;
        u32 status;
 
@@ -229,7 +211,7 @@ static int smc911x_rx(struct eth_device *dev)
                                ": dropped bad packet. Status: 0x%08x\n",
                                status);
                else
-                       NetReceive(NetRxPackets[0], pktlen);
+                       net_process_received_packet(net_rx_packets[0], pktlen);
        }
 
        return 0;