netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 net-next 00/11] net: dsa: microchip: Modify KSZ9477 DSA driver in preparation to add other KSZ switch drivers
@ 2018-10-23  2:26 Tristram.Ha
  2018-10-23  2:26 ` [PATCH v3 net-next 01/11] net: dsa: microchip: Replace license with GPL Tristram.Ha
                   ` (10 more replies)
  0 siblings, 11 replies; 15+ messages in thread
From: Tristram.Ha @ 2018-10-23  2:26 UTC (permalink / raw)
  To: Andrew Lunn, Florian Fainelli, Pavel Machek
  Cc: Tristram Ha, Ruediger Schmitt, UNGLinuxDriver, netdev

From: Tristram Ha <Tristram.Ha@microchip.com>

This series of patches is to modify the original KSZ9477 DSA driver so
that other KSZ switch drivers can be added and use the common code.

There are several steps to accomplish this achievement.  First is to
rename some function names with a prefix to indicate chip specific
function.  Second is to move common code into header that can be shared.
Last is to modify tag_ksz.c so that it can handle many tail tag formats
used by different KSZ switch drivers.

ksz_common.c will contain the common code used by all KSZ switch drivers.
ksz9477.c will contain KSZ9477 code from the original ksz_common.c.
ksz9477_spi.c is renamed from ksz_spi.c.
ksz9477_reg.h is renamed from ksz_9477_reg.h.
ksz_common.h is added to provide common code access to KSZ switch
drivers.
ksz_spi.h is added to provide common SPI access functions to KSZ SPI
drivers.

v3
- The phy_device structure is used to hold port link information
- A structure is passed in ksz_xmit and ksz_rcv instead of function pointer
- Switch offload forwarding is supported

v2
- Initialize reg_mutex before use
- The alu_mutex is only used inside chip specific functions

v1
- Each patch in the set is self-contained
- Use ksz9477 prefix to indicate KSZ9477 specific code

Tristram Ha (11):
  Replace license with GPL.
  Clean up code according to patch check suggestions.
  Initialize mutex before use.
  Rename some functions with ksz9477 prefix to separate chip specific
    code from common code.
  Rename ksz_spi.c to ksz9477_spi.c and update Kconfig in preparation to
    add more KSZ switch drivers.
  Break KSZ9477 DSA driver into two files in preparation to add more KSZ
        switch drivers.     Add common functions in ksz_common.h so that
    other KSZ switch drivers     can access code in ksz_common.c.    
    Add ksz_spi.h for common functions used by KSZ switch SPI drivers.
  Prepare PHY for proper advertisement and get link status for the port.
  Rename ksz_9477_reg.h to ksz9477_reg.h for consistency as the product
    name is always KSZ####.
  Add MIB counter reading support.
  Modify tag_ksz.c so that tail tag code can be used by other KSZ switch
    drivers.
  Add switch offload forwarding support.

 drivers/net/dsa/microchip/Kconfig                  |   18 +-
 drivers/net/dsa/microchip/Makefile                 |    5 +-
 drivers/net/dsa/microchip/ksz9477.c                | 1387 ++++++++++++++++++++
 .../microchip/{ksz_9477_reg.h => ksz9477_reg.h}    |   23 +-
 drivers/net/dsa/microchip/ksz9477_spi.c            |  189 +++
 drivers/net/dsa/microchip/ksz_common.c             | 1253 ++++--------------
 drivers/net/dsa/microchip/ksz_common.h             |  231 ++++
 drivers/net/dsa/microchip/ksz_priv.h               |  256 ++--
 drivers/net/dsa/microchip/ksz_spi.c                |  217 ---
 drivers/net/dsa/microchip/ksz_spi.h                |   82 ++
 include/net/dsa.h                                  |    2 +-
 net/dsa/Kconfig                                    |    4 +
 net/dsa/dsa.c                                      |    8 +-
 net/dsa/dsa_priv.h                                 |    2 +-
 net/dsa/tag_ksz.c                                  |  101 +-
 15 files changed, 2354 insertions(+), 1424 deletions(-)
 create mode 100644 drivers/net/dsa/microchip/ksz9477.c
 rename drivers/net/dsa/microchip/{ksz_9477_reg.h => ksz9477_reg.h} (98%)
 create mode 100644 drivers/net/dsa/microchip/ksz9477_spi.c
 create mode 100644 drivers/net/dsa/microchip/ksz_common.h
 delete mode 100644 drivers/net/dsa/microchip/ksz_spi.c
 create mode 100644 drivers/net/dsa/microchip/ksz_spi.h

-- 
1.9.1

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2018-10-24 19:35 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-23  2:26 [PATCH v3 net-next 00/11] net: dsa: microchip: Modify KSZ9477 DSA driver in preparation to add other KSZ switch drivers Tristram.Ha
2018-10-23  2:26 ` [PATCH v3 net-next 01/11] net: dsa: microchip: Replace license with GPL Tristram.Ha
2018-10-24 11:05   ` Pavel Machek
2018-10-23  2:26 ` [PATCH v3 net-next 03/11] net: dsa: microchip: Initialize mutex before use Tristram.Ha
2018-10-23 13:15   ` Andrew Lunn
2018-10-24 11:07   ` Pavel Machek
2018-10-23  2:26 ` [PATCH v3 net-next 04/11] net: dsa: microchip: Rename some functions with ksz9477 prefix Tristram.Ha
2018-10-23  2:26 ` [PATCH v3 net-next 05/11] net: dsa: microchip: Rename ksz_spi.c to ksz9477_spi.c Tristram.Ha
2018-10-23  2:26 ` [PATCH v3 net-next 06/11] net: dsa: microchip: Break KSZ9477 DSA driver into two files Tristram.Ha
2018-10-23  2:26 ` [PATCH v3 net-next 07/11] net: dsa: microchip: Prepare PHY for proper advertisement Tristram.Ha
2018-10-23  2:26 ` [PATCH v3 net-next 08/11] net: dsa: microchip: Rename ksz_9477_reg.h to ksz9477_reg.h Tristram.Ha
2018-10-23  2:26 ` [PATCH v3 net-next 09/11] net: dsa: microchip: Add MIB counter reading support Tristram.Ha
2018-10-23  2:26 ` [PATCH v3 net-next 10/11] net: dsa: microchip: Modify tag_ksz.c so that tail tag code can be used by other KSZ switch drivers Tristram.Ha
2018-10-23  2:26 ` [PATCH v3 net-next 11/11] net: dsa: microchip: Add switch offload forwarding support Tristram.Ha
2018-10-23  3:26 ` [PATCH v3 net-next 00/11] net: dsa: microchip: Modify KSZ9477 DSA driver in preparation to add other KSZ switch drivers David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).