summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-05-10 11:40:03 -0600
committerTom Rini <trini@konsulko.com>2020-05-18 18:36:55 -0400
commit09140113108541b95d340f3c7b6ee597d31ccc73 (patch)
tree4b4241b799bbbb2eeef4164392442b193af1703f /drivers/net
parent691d719db7183dfb1d1360efed4c5e9f6899095f (diff)
downloadu-boot-09140113108541b95d340f3c7b6ee597d31ccc73.tar.gz
u-boot-09140113108541b95d340f3c7b6ee597d31ccc73.tar.bz2
u-boot-09140113108541b95d340f3c7b6ee597d31ccc73.zip
command: Remove the cmd_tbl_t typedef
We should not use typedefs in U-Boot. They cannot be used as forward declarations which means that header files must include the full header to access them. Drop the typedef and rename the struct to remove the _s suffix which is now not useful. This requires quite a few header-file additions. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/e1000.c5
-rw-r--r--drivers/net/e1000.h4
-rw-r--r--drivers/net/e1000_spi.c21
-rw-r--r--drivers/net/fsl-mc/mc.c3
-rw-r--r--drivers/net/pfe_eth/pfe_cmd.c15
-rw-r--r--drivers/net/phy/b53.c7
-rw-r--r--drivers/net/phy/mv88e6352.c7
-rw-r--r--drivers/net/vsc9953.c1
8 files changed, 35 insertions, 28 deletions
diff --git a/drivers/net/e1000.c b/drivers/net/e1000.c
index 7e98449cfa..82b1db3fb3 100644
--- a/drivers/net/e1000.c
+++ b/drivers/net/e1000.c
@@ -30,6 +30,7 @@ tested on both gig copper and gig fiber boards
*/
#include <common.h>
+#include <command.h>
#include <cpu_func.h>
#include <dm.h>
#include <errno.h>
@@ -5761,8 +5762,8 @@ struct e1000_hw *e1000_find_card(unsigned int cardnum)
#endif /* !CONFIG_DM_ETH */
#ifdef CONFIG_CMD_E1000
-static int do_e1000(cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+static int do_e1000(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
unsigned char *mac = NULL;
#ifdef CONFIG_DM_ETH
diff --git a/drivers/net/e1000.h b/drivers/net/e1000.h
index 2ae3085515..19ed4777d9 100644
--- a/drivers/net/e1000.h
+++ b/drivers/net/e1000.h
@@ -74,8 +74,8 @@ void e1000_lower_ee_clk(struct e1000_hw *hw, uint32_t *eecd);
#endif
#ifdef CONFIG_E1000_SPI
-int do_e1000_spi(cmd_tbl_t *cmdtp, struct e1000_hw *hw,
- int argc, char * const argv[]);
+int do_e1000_spi(struct cmd_tbl *cmdtp, struct e1000_hw *hw,
+ int argc, char *const argv[]);
#endif
/* Enumerated types specific to the e1000 hardware */
diff --git a/drivers/net/e1000_spi.c b/drivers/net/e1000_spi.c
index 52b3c79794..dcb561ff79 100644
--- a/drivers/net/e1000_spi.c
+++ b/drivers/net/e1000_spi.c
@@ -1,4 +1,5 @@
#include <common.h>
+#include <command.h>
#include <console.h>
#include "e1000.h"
#include <malloc.h>
@@ -315,8 +316,8 @@ static int e1000_spi_eeprom_program(struct e1000_hw *hw,
return 0;
}
-static int do_e1000_spi_show(cmd_tbl_t *cmdtp, struct e1000_hw *hw,
- int argc, char * const argv[])
+static int do_e1000_spi_show(struct cmd_tbl *cmdtp, struct e1000_hw *hw,
+ int argc, char *const argv[])
{
unsigned int length = 0;
u16 i, offset = 0;
@@ -384,8 +385,8 @@ static int do_e1000_spi_show(cmd_tbl_t *cmdtp, struct e1000_hw *hw,
return 0;
}
-static int do_e1000_spi_dump(cmd_tbl_t *cmdtp, struct e1000_hw *hw,
- int argc, char * const argv[])
+static int do_e1000_spi_dump(struct cmd_tbl *cmdtp, struct e1000_hw *hw,
+ int argc, char *const argv[])
{
unsigned int length;
u16 offset;
@@ -429,8 +430,8 @@ static int do_e1000_spi_dump(cmd_tbl_t *cmdtp, struct e1000_hw *hw,
return 0;
}
-static int do_e1000_spi_program(cmd_tbl_t *cmdtp, struct e1000_hw *hw,
- int argc, char * const argv[])
+static int do_e1000_spi_program(struct cmd_tbl *cmdtp, struct e1000_hw *hw,
+ int argc, char *const argv[])
{
unsigned int length;
const void *source;
@@ -464,8 +465,8 @@ static int do_e1000_spi_program(cmd_tbl_t *cmdtp, struct e1000_hw *hw,
return 0;
}
-static int do_e1000_spi_checksum(cmd_tbl_t *cmdtp, struct e1000_hw *hw,
- int argc, char * const argv[])
+static int do_e1000_spi_checksum(struct cmd_tbl *cmdtp, struct e1000_hw *hw,
+ int argc, char *const argv[])
{
uint16_t i, length, checksum = 0, checksum_reg;
uint16_t *buffer;
@@ -540,8 +541,8 @@ static int do_e1000_spi_checksum(cmd_tbl_t *cmdtp, struct e1000_hw *hw,
return 0;
}
-int do_e1000_spi(cmd_tbl_t *cmdtp, struct e1000_hw *hw,
- int argc, char * const argv[])
+int do_e1000_spi(struct cmd_tbl *cmdtp, struct e1000_hw *hw,
+ int argc, char *const argv[])
{
if (argc < 1) {
cmd_usage(cmdtp);
diff --git a/drivers/net/fsl-mc/mc.c b/drivers/net/fsl-mc/mc.c
index da0815a46f..39824094f9 100644
--- a/drivers/net/fsl-mc/mc.c
+++ b/drivers/net/fsl-mc/mc.c
@@ -1745,7 +1745,8 @@ err:
return err;
}
-static int do_fsl_mc(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_fsl_mc(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
int err = 0;
if (argc < 3)
diff --git a/drivers/net/pfe_eth/pfe_cmd.c b/drivers/net/pfe_eth/pfe_cmd.c
index dd8c68d57d..bae5f8a479 100644
--- a/drivers/net/pfe_eth/pfe_cmd.c
+++ b/drivers/net/pfe_eth/pfe_cmd.c
@@ -9,6 +9,7 @@
* @brief PFE utility commands
*/
+#include <command.h>
#include <net/pfe_eth/pfe_eth.h>
static inline void pfe_command_help(void)
@@ -16,7 +17,7 @@ static inline void pfe_command_help(void)
printf("Usage: pfe [pe | status | expt ] <options>\n");
}
-static void pfe_command_pe(int argc, char * const argv[])
+static void pfe_command_pe(int argc, char *const argv[])
{
if (argc >= 3 && strcmp(argv[2], "pmem") == 0) {
if (argc >= 4 && strcmp(argv[3], "read") == 0) {
@@ -271,7 +272,7 @@ static void bmu(int id, void *base)
#define PEMBOX_ADDR_TMU 0x290
#define PESTATUS_ADDR_UTIL 0x0
-static void pfe_pe_status(int argc, char * const argv[])
+static void pfe_pe_status(int argc, char *const argv[])
{
int do_clear = 0;
u32 id;
@@ -336,7 +337,7 @@ static void pfe_pe_status(int argc, char * const argv[])
}
}
-static void pfe_command_status(int argc, char * const argv[])
+static void pfe_command_status(int argc, char *const argv[])
{
if (argc >= 3 && strcmp(argv[2], "pe") == 0) {
pfe_pe_status(argc, argv);
@@ -370,7 +371,7 @@ static const char *register_names[EXPT_REG_COUNT] = {
" r12", " r13", " r14", " r15"
};
-static void pfe_command_expt(int argc, char * const argv[])
+static void pfe_command_expt(int argc, char *const argv[])
{
unsigned int id, i, val, addr;
@@ -414,7 +415,7 @@ static void send_dummy_pkt_to_hif(void)
writel(buf, TMU_PHY_INQ_PKTINFO);
}
-static void pfe_command_stop(int argc, char * const argv[])
+static void pfe_command_stop(int argc, char *const argv[])
{
int pfe_pe_id, hif_stop_loop = 10;
u32 rx_status;
@@ -462,8 +463,8 @@ static void pfe_command_stop(int argc, char * const argv[])
}
#endif
-static int pfe_command(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int pfe_command(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
if (argc == 1 || strcmp(argv[1], "help") == 0) {
pfe_command_help();
diff --git a/drivers/net/phy/b53.c b/drivers/net/phy/b53.c
index 30c4812d82..f039f895c8 100644
--- a/drivers/net/phy/b53.c
+++ b/drivers/net/phy/b53.c
@@ -23,6 +23,7 @@
*/
#include <common.h>
+#include <command.h>
#include <errno.h>
#include <malloc.h>
@@ -627,7 +628,7 @@ int phy_b53_init(void)
return 0;
}
-int do_b53_reg_read(const char *name, int argc, char * const argv[])
+int do_b53_reg_read(const char *name, int argc, char *const argv[])
{
u8 page, offset, width;
struct mii_dev *bus;
@@ -681,7 +682,7 @@ int do_b53_reg_read(const char *name, int argc, char * const argv[])
return ret;
}
-int do_b53_reg_write(const char *name, int argc, char * const argv[])
+int do_b53_reg_write(const char *name, int argc, char *const argv[])
{
u8 page, offset, width;
struct mii_dev *bus;
@@ -727,7 +728,7 @@ int do_b53_reg_write(const char *name, int argc, char * const argv[])
return ret;
}
-int do_b53_reg(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_b53_reg(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
const char *cmd, *mdioname;
int ret = 0;
diff --git a/drivers/net/phy/mv88e6352.c b/drivers/net/phy/mv88e6352.c
index 6fe08b80c1..a27a9cc03e 100644
--- a/drivers/net/phy/mv88e6352.c
+++ b/drivers/net/phy/mv88e6352.c
@@ -5,6 +5,7 @@
*/
#include <common.h>
+#include <command.h>
#include <miiphy.h>
#include <linux/errno.h>
#include <mv88e6352.h>
@@ -230,7 +231,7 @@ int mv88e_sw_reset(const char *devname, u8 phy_addr)
return -ETIMEDOUT;
}
-int do_mvsw_reg_read(const char *name, int argc, char * const argv[])
+int do_mvsw_reg_read(const char *name, int argc, char *const argv[])
{
u16 value = 0, phyaddr, reg, port;
int ret;
@@ -245,7 +246,7 @@ int do_mvsw_reg_read(const char *name, int argc, char * const argv[])
return ret;
}
-int do_mvsw_reg_write(const char *name, int argc, char * const argv[])
+int do_mvsw_reg_write(const char *name, int argc, char *const argv[])
{
u16 value = 0, phyaddr, reg, port;
int ret;
@@ -261,7 +262,7 @@ int do_mvsw_reg_write(const char *name, int argc, char * const argv[])
}
-int do_mvsw_reg(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_mvsw_reg(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
int ret;
const char *cmd, *ethname;
diff --git a/drivers/net/vsc9953.c b/drivers/net/vsc9953.c
index f17839c70f..93eb2b158c 100644
--- a/drivers/net/vsc9953.c
+++ b/drivers/net/vsc9953.c
@@ -5,6 +5,7 @@
* Driver for the Vitesse VSC9953 L2 Switch
*/
+#include <command.h>
#include <asm/io.h>
#include <asm/fsl_serdes.h>
#include <fm_eth.h>