From: Andrew Lunn <andrew@lunn•ch>
To: Tristram.Ha@microchip•com
Cc: Florian Fainelli <f.fainelli@gmail•com>,
Pavel Machek <pavel@ucw•cz>,
Ruediger Schmitt <ruediger.schmitt@philips•com>,
muvarov@gmail•com, nathan.leigh.conrad@gmail•com,
vivien.didelot@savoirfairelinux•com,
UNGLinuxDriver@microchip•com, netdev@vger•kernel.org,
linux-kernel@vger•kernel.org
Subject: Re: [PATCH v1 RFC 5/7] Break KSZ9477 DSA driver into two files
Date: Sat, 14 Oct 2017 21:52:13 +0200 [thread overview]
Message-ID: <20171014195213.GM18578@lunn.ch> (raw)
In-Reply-To: <1507321985-15097-6-git-send-email-Tristram.Ha@microchip.com>
> diff --git a/drivers/net/dsa/microchip/ksz9477.c b/drivers/net/dsa/microchip/ksz9477.c
> new file mode 100644
> index 0000000..214d380
> --- /dev/null
> +++ b/drivers/net/dsa/microchip/ksz9477.c
> @@ -0,0 +1,1328 @@
> +/*
> + * Microchip KSZ9477 switch driver main logic
> + *
> + * Copyright (C) 2017 Microchip Technology Inc.
> + *
> + * 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, see <http://www.gnu.org/licenses/>.
> + */
> +
> +#include <linux/delay.h>
> +#include <linux/export.h>
> +#include <linux/gpio.h>
> +#include <linux/kernel.h>
> +#include <linux/module.h>
> +#include <linux/platform_data/microchip-ksz.h>
> +#include <linux/phy.h>
> +#include <linux/etherdevice.h>
> +#include <linux/if_bridge.h>
> +#include <net/dsa.h>
> +#include <net/switchdev.h>
> +
> +#include "ksz_priv.h"
> +#include "ksz_common.h"
> +#include "ksz_9477_reg.h"
> +
> +static const struct {
> + int index;
> + char string[ETH_GSTRING_LEN];
> +} mib_names[TOTAL_SWITCH_COUNTER_NUM] = {
> + { 0x00, "rx_hi" },
> + { 0x01, "rx_undersize" },
> + { 0x02, "rx_fragments" },
> + { 0x03, "rx_oversize" },
> + { 0x04, "rx_jabbers" },
> + { 0x05, "rx_symbol_err" },
> + { 0x06, "rx_crc_err" },
> + { 0x07, "rx_align_err" },
> + { 0x08, "rx_mac_ctrl" },
> + { 0x09, "rx_pause" },
> + { 0x0A, "rx_bcast" },
> + { 0x0B, "rx_mcast" },
> + { 0x0C, "rx_ucast" },
> + { 0x0D, "rx_64_or_less" },
> + { 0x0E, "rx_65_127" },
> + { 0x0F, "rx_128_255" },
> + { 0x10, "rx_256_511" },
> + { 0x11, "rx_512_1023" },
> + { 0x12, "rx_1024_1522" },
> + { 0x13, "rx_1523_2000" },
> + { 0x14, "rx_2001" },
> + { 0x15, "tx_hi" },
> + { 0x16, "tx_late_col" },
> + { 0x17, "tx_pause" },
> + { 0x18, "tx_bcast" },
> + { 0x19, "tx_mcast" },
> + { 0x1A, "tx_ucast" },
> + { 0x1B, "tx_deferred" },
> + { 0x1C, "tx_total_col" },
> + { 0x1D, "tx_exc_col" },
> + { 0x1E, "tx_single_col" },
> + { 0x1F, "tx_mult_col" },
> + { 0x80, "rx_total" },
> + { 0x81, "tx_total" },
> + { 0x82, "rx_discards" },
> + { 0x83, "tx_discards" },
> +};
> +
> +static void ksz_cfg32(struct ksz_device *dev, u32 addr, u32 bits, bool set)
> +{
> + u32 data;
> +
> + ksz_read32(dev, addr, &data);
> + if (set)
> + data |= bits;
> + else
> + data &= ~bits;
> + ksz_write32(dev, addr, data);
> +}
In a follow up patch, it would be good to fixup the naming. All
functions should use the ksz9477_ prefix.
But this is O.K. for now.
Reviewed-by: Andrew Lunn <andrew@lunn•ch>
Andrew
next prev parent reply other threads:[~2017-10-14 19:52 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-06 20:32 [PATCH v1 RFC 0/7] Modify KSZ9477 DSA driver in preparation to add other KSZ switch drivers Tristram.Ha
2017-10-06 20:32 ` [PATCH v1 RFC 1/7] Replace license with GPL Tristram.Ha
2017-10-09 9:18 ` David Laight
2017-10-09 18:40 ` Tristram.Ha
2017-10-09 19:40 ` Florian Fainelli
2017-10-14 19:41 ` Andrew Lunn
2017-10-09 19:54 ` Pavel Machek
2017-10-09 19:58 ` Woojung.Huh
2017-10-06 20:33 ` [PATCH v1 RFC 2/7] Clean up code according to patch check suggestions Tristram.Ha
2017-10-09 19:54 ` Pavel Machek
2017-10-09 19:54 ` Florian Fainelli
2017-10-14 19:42 ` Andrew Lunn
2017-10-06 20:33 ` [PATCH v1 RFC 3/7] Rename some functions with ksz9477 prefix Tristram.Ha
2017-10-09 19:54 ` Pavel Machek
2017-10-09 19:56 ` Florian Fainelli
2017-10-14 19:44 ` Andrew Lunn
2017-10-06 20:33 ` [PATCH v1 RFC 4/7] Rename ksz_spi.c to ksz9477_spi.c Tristram.Ha
2017-10-09 19:54 ` Pavel Machek
2017-10-09 19:56 ` Florian Fainelli
2017-10-14 19:45 ` Andrew Lunn
2017-10-06 20:33 ` [PATCH v1 RFC 5/7] Break KSZ9477 DSA driver into two files Tristram.Ha
2017-10-09 19:54 ` Pavel Machek
2017-10-09 20:01 ` Florian Fainelli
2017-10-14 19:52 ` Andrew Lunn [this message]
2017-10-06 20:33 ` [PATCH v1 RFC 6/7] Add MIB counter reading support Tristram.Ha
2017-10-09 19:54 ` Pavel Machek
2017-10-09 20:07 ` Florian Fainelli
2017-10-14 20:07 ` Andrew Lunn
2017-10-06 20:33 ` [PATCH v1 RFC 7/7] Modify tag_ksz.c so that tail tag code can be used by other KSZ switch drivers Tristram.Ha
2017-10-11 20:45 ` Pavel Machek
2017-10-18 18:02 ` Tristram.Ha
2017-10-14 20:15 ` Andrew Lunn
2017-10-09 19:58 ` [PATCH v1 RFC 0/7] Modify KSZ9477 DSA driver in preparation to add " Florian Fainelli
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=20171014195213.GM18578@lunn.ch \
--to=andrew@lunn$(echo .)ch \
--cc=Tristram.Ha@microchip$(echo .)com \
--cc=UNGLinuxDriver@microchip$(echo .)com \
--cc=f.fainelli@gmail$(echo .)com \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=muvarov@gmail$(echo .)com \
--cc=nathan.leigh.conrad@gmail$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
--cc=pavel@ucw$(echo .)cz \
--cc=ruediger.schmitt@philips$(echo .)com \
--cc=vivien.didelot@savoirfairelinux$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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