diff options
author | Andrey Smirnov <andrew.smirnov@gmail.com> | 2016-06-01 21:58:32 -0700 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2016-06-03 09:14:14 +0200 |
commit | 940bd8bb25e037a31ba1cf26d8535bdb24c3723e (patch) | |
tree | 4b6677740366f8f829a2efada955bf749c4b8f7b /drivers/net/e1000/e1000.h | |
parent | ae4915ff38ea9e376321e644108957ab2a93031d (diff) | |
download | barebox-940bd8bb25e037a31ba1cf26d8535bdb24c3723e.tar.gz barebox-940bd8bb25e037a31ba1cf26d8535bdb24c3723e.tar.xz |
e1000: Convert E1000_*_REG macros to functions
E1000_*_REG don't bring any value by being macros and implicit appending
of "E1000_" prefix to the constant name only makes thing harder to grep
or understand. Replace those macros with functions.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/net/e1000/e1000.h')
-rw-r--r-- | drivers/net/e1000/e1000.h | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h index 19faf0bdee..7c5c98b9eb 100644 --- a/drivers/net/e1000/e1000.h +++ b/drivers/net/e1000/e1000.h @@ -28,18 +28,6 @@ #define DEBUGFUNC() do { } while (0) #endif -/* I/O wrapper functions */ -#define E1000_WRITE_REG(a, reg, value) \ - writel((value), ((a)->hw_addr + E1000_##reg)) -#define E1000_READ_REG(a, reg) \ - readl((a)->hw_addr + E1000_##reg) -#define E1000_WRITE_REG_ARRAY(a, reg, offset, value) \ - writel((value), ((a)->hw_addr + E1000_##reg + ((offset) << 2))) -#define E1000_READ_REG_ARRAY(a, reg, offset) \ - readl((a)->hw_addr + E1000_##reg + ((offset) << 2)) -#define E1000_WRITE_FLUSH(a) \ - do { E1000_READ_REG(a, STATUS); } while (0) - /* Enumerated types specific to the e1000 hardware */ /* Media Access Controlers */ typedef enum { @@ -2128,6 +2116,16 @@ struct e1000_hw { int rx_tail, rx_last; }; +void e1000_write_reg(struct e1000_hw *hw, uint32_t reg, + uint32_t value); +uint32_t e1000_read_reg(struct e1000_hw *hw, uint32_t reg); +uint32_t e1000_read_reg_array(struct e1000_hw *hw, + uint32_t base, uint32_t idx); +void e1000_write_reg_array(struct e1000_hw *hw, uint32_t base, + uint32_t idx, uint32_t value); + +void e1000_write_flush(struct e1000_hw *hw); + int32_t e1000_init_eeprom_params(struct e1000_hw *hw); int e1000_validate_eeprom_checksum(struct e1000_hw *hw); int32_t e1000_read_eeprom(struct e1000_hw *hw, uint16_t offset, |