From: Arun Ramadoss <arun.ramadoss@microchip.com>
To: <linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>
Cc: Woojung Huh <woojung.huh@microchip.com>,
<UNGLinuxDriver@microchip.com>, Andrew Lunn <andrew@lunn.ch>,
Vivien Didelot <vivien.didelot@gmail.com>,
Florian Fainelli <f.fainelli@gmail.com>,
Vladimir Oltean <olteanv@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
"Russell King" <linux@armlinux.org.uk>
Subject: [Patch net-next 5/7] net: dsa: microchip: change the size of reg from u8 to u16
Date: Tue, 28 Jun 2022 22:43:27 +0530 [thread overview]
Message-ID: <20220628171329.25503-6-arun.ramadoss@microchip.com> (raw)
In-Reply-To: <20220628171329.25503-1-arun.ramadoss@microchip.com>
The register size for the ksz8 switches is u8 and for ksz9477 series is
u16. To have common struct for ksz series switches the size of reg is
increased from u8 to u16.
Signed-off-by: Arun Ramadoss <arun.ramadoss@microchip.com>
---
drivers/net/dsa/microchip/ksz8795.c | 22 +++++++++++-----------
drivers/net/dsa/microchip/ksz_common.c | 4 ++--
drivers/net/dsa/microchip/ksz_common.h | 2 +-
3 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/drivers/net/dsa/microchip/ksz8795.c b/drivers/net/dsa/microchip/ksz8795.c
index 2b3db33c32ce..264c960f715d 100644
--- a/drivers/net/dsa/microchip/ksz8795.c
+++ b/drivers/net/dsa/microchip/ksz8795.c
@@ -45,7 +45,7 @@ static void ksz_port_cfg(struct ksz_device *dev, int port, int offset, u8 bits,
static int ksz8_ind_write8(struct ksz_device *dev, u8 table, u16 addr, u8 data)
{
- const u8 *regs;
+ const u16 *regs;
u16 ctrl_addr;
int ret = 0;
@@ -117,7 +117,7 @@ static void ksz8795_set_prio_queue(struct ksz_device *dev, int port, int queue)
void ksz8_r_mib_cnt(struct ksz_device *dev, int port, u16 addr, u64 *cnt)
{
const u32 *masks;
- const u8 *regs;
+ const u16 *regs;
u16 ctrl_addr;
u32 data;
u8 check;
@@ -153,7 +153,7 @@ static void ksz8795_r_mib_pkt(struct ksz_device *dev, int port, u16 addr,
u64 *dropped, u64 *cnt)
{
const u32 *masks;
- const u8 *regs;
+ const u16 *regs;
u16 ctrl_addr;
u32 data;
u8 check;
@@ -205,7 +205,7 @@ static void ksz8863_r_mib_pkt(struct ksz_device *dev, int port, u16 addr,
u64 *dropped, u64 *cnt)
{
u32 *last = (u32 *)dropped;
- const u8 *regs;
+ const u16 *regs;
u16 ctrl_addr;
u32 data;
u32 cur;
@@ -292,7 +292,7 @@ void ksz8_port_init_cnt(struct ksz_device *dev, int port)
static void ksz8_r_table(struct ksz_device *dev, int table, u16 addr, u64 *data)
{
- const u8 *regs;
+ const u16 *regs;
u16 ctrl_addr;
regs = dev->info->regs;
@@ -307,7 +307,7 @@ static void ksz8_r_table(struct ksz_device *dev, int table, u16 addr, u64 *data)
static void ksz8_w_table(struct ksz_device *dev, int table, u16 addr, u64 data)
{
- const u8 *regs;
+ const u16 *regs;
u16 ctrl_addr;
regs = dev->info->regs;
@@ -324,7 +324,7 @@ static int ksz8_valid_dyn_entry(struct ksz_device *dev, u8 *data)
{
int timeout = 100;
const u32 *masks;
- const u8 *regs;
+ const u16 *regs;
masks = dev->info->masks;
regs = dev->info->regs;
@@ -354,7 +354,7 @@ int ksz8_r_dyn_mac_table(struct ksz_device *dev, u16 addr, u8 *mac_addr,
u32 data_hi, data_lo;
const u8 *shifts;
const u32 *masks;
- const u8 *regs;
+ const u16 *regs;
u16 ctrl_addr;
u8 data;
int rc;
@@ -561,7 +561,7 @@ void ksz8_r_phy(struct ksz_device *dev, u16 phy, u16 reg, u16 *val)
{
u8 restart, speed, ctrl, link;
int processed = true;
- const u8 *regs;
+ const u16 *regs;
u8 val1, val2;
u16 data = 0;
u8 p = phy;
@@ -684,7 +684,7 @@ void ksz8_r_phy(struct ksz_device *dev, u16 phy, u16 reg, u16 *val)
void ksz8_w_phy(struct ksz_device *dev, u16 phy, u16 reg, u16 val)
{
u8 restart, speed, ctrl, data;
- const u8 *regs;
+ const u16 *regs;
u8 p = phy;
regs = dev->info->regs;
@@ -1199,7 +1199,7 @@ void ksz8_config_cpu_port(struct dsa_switch *ds)
struct ksz_device *dev = ds->priv;
struct ksz_port *p;
const u32 *masks;
- const u8 *regs;
+ const u16 *regs;
u8 remote;
int i;
diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/microchip/ksz_common.c
index fa66bd14f66a..4992fea208b1 100644
--- a/drivers/net/dsa/microchip/ksz_common.c
+++ b/drivers/net/dsa/microchip/ksz_common.c
@@ -201,7 +201,7 @@ static const struct ksz_dev_ops ksz9477_dev_ops = {
.exit = ksz9477_switch_exit,
};
-static const u8 ksz8795_regs[] = {
+static const u16 ksz8795_regs[] = {
[REG_IND_CTRL_0] = 0x6E,
[REG_IND_DATA_8] = 0x70,
[REG_IND_DATA_CHECK] = 0x72,
@@ -252,7 +252,7 @@ static const u8 ksz8795_shifts[] = {
[DYNAMIC_MAC_SRC_PORT] = 24,
};
-static const u8 ksz8863_regs[] = {
+static const u16 ksz8863_regs[] = {
[REG_IND_CTRL_0] = 0x79,
[REG_IND_DATA_8] = 0x7B,
[REG_IND_DATA_CHECK] = 0x7B,
diff --git a/drivers/net/dsa/microchip/ksz_common.h b/drivers/net/dsa/microchip/ksz_common.h
index c11adf67757d..18794f571687 100644
--- a/drivers/net/dsa/microchip/ksz_common.h
+++ b/drivers/net/dsa/microchip/ksz_common.h
@@ -47,7 +47,7 @@ struct ksz_chip_data {
const struct ksz_mib_names *mib_names;
int mib_cnt;
u8 reg_mib_cnt;
- const u8 *regs;
+ const u16 *regs;
const u32 *masks;
const u8 *shifts;
int stp_ctrl_reg;
--
2.36.1
next prev parent reply other threads:[~2022-06-28 17:15 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-28 17:13 [Patch net-next 0/7] net: dsa: microchip: use ksz_chip_reg for Arun Ramadoss
2022-06-28 17:13 ` [Patch net-next 1/7] net: dsa: microchip: move ksz8->regs to ksz_common Arun Ramadoss
2022-06-28 17:13 ` [Patch net-next 2/7] net: dsa: microchip: move ksz8->masks " Arun Ramadoss
2022-06-28 17:13 ` [Patch net-next 3/7] net: dsa: microchip: move ksz8->shifts " Arun Ramadoss
2022-06-28 17:13 ` [Patch net-next 4/7] net: dsa: microchip: remove the struct ksz8 Arun Ramadoss
2022-06-28 17:13 ` Arun Ramadoss [this message]
2022-06-28 17:13 ` [Patch net-next 6/7] net: dsa: microchip: add P_STP_CTRL to ksz_chip_reg Arun Ramadoss
2022-06-28 17:13 ` [Patch net-next 7/7] net: dsa: microchip: move remaining register offset " Arun Ramadoss
2022-06-29 13:00 ` [Patch net-next 0/7] net: dsa: microchip: use ksz_chip_reg for patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220628171329.25503-6-arun.ramadoss@microchip.com \
--to=arun.ramadoss@microchip.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=f.fainelli@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--cc=vivien.didelot@gmail.com \
--cc=woojung.huh@microchip.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®