]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - drivers/net/netconsole.c
net: Remove the bd* parameter from net stack functions
[karo-tx-uboot.git] / drivers / net / netconsole.c
index dd7032af56cba2680fde59bfb49b9d8281af59ec..87cea7a93209b7fad0fa074c0668dd53ea2d053a 100644 (file)
@@ -2,23 +2,7 @@
  * (C) Copyright 2004
  * 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 <common.h>
@@ -200,18 +184,20 @@ static void nc_send_packet(const char *buf, int len)
                        return; /* inside net loop */
                output_packet = buf;
                output_packet_len = len;
+               input_recursion = 1;
                NetLoop(NETCONS); /* wait for arp reply and send packet */
+               input_recursion = 0;
                output_packet_len = 0;
                return;
        }
 
        if (eth->state != ETH_STATE_ACTIVE) {
                if (eth_is_on_demand_init()) {
-                       if (eth_init(gd->bd) < 0)
+                       if (eth_init() < 0)
                                return;
                        eth_set_last_protocol(NETCONS);
                } else
-                       eth_init_state_only(gd->bd);
+                       eth_init_state_only();
 
                inited = 1;
        }
@@ -229,7 +215,7 @@ static void nc_send_packet(const char *buf, int len)
        }
 }
 
-static int nc_start(void)
+static int nc_start(struct stdio_dev *dev)
 {
        int retval;
 
@@ -249,7 +235,7 @@ static int nc_start(void)
        return 0;
 }
 
-static void nc_putc(char c)
+static void nc_putc(struct stdio_dev *dev, char c)
 {
        if (output_recursion)
                return;
@@ -260,7 +246,7 @@ static void nc_putc(char c)
        output_recursion = 0;
 }
 
-static void nc_puts(const char *s)
+static void nc_puts(struct stdio_dev *dev, const char *s)
 {
        int len;
 
@@ -270,7 +256,7 @@ static void nc_puts(const char *s)
 
        len = strlen(s);
        while (len) {
-               int send_len = min(len, sizeof(input_buffer));
+               int send_len = min(len, (int)sizeof(input_buffer));
                nc_send_packet(s, send_len);
                len -= send_len;
                s += send_len;
@@ -279,7 +265,7 @@ static void nc_puts(const char *s)
        output_recursion = 0;
 }
 
-static int nc_getc(void)
+static int nc_getc(struct stdio_dev *dev)
 {
        uchar c;
 
@@ -300,7 +286,7 @@ static int nc_getc(void)
        return c;
 }
 
-static int nc_tstc(void)
+static int nc_tstc(struct stdio_dev *dev)
 {
        struct eth_device *eth;