Commit f285604a authored by David S. Miller's avatar David S. Miller

Merge branch 'net-macb-convert-to-phylink'

Antoine Tenart says:

====================
net: macb: convert to phylink

This series converts the MACB Ethernet driver to the Phylink framework.
The MAC configuration is moved to the Phylink ops and Phylink helpers
are now used in the ethtools functions. This helps to access the flow
control and pauseparam logic and this will be helpful in the future for
boards using this controller with SFP cages.

Since v2:
  - Moved the Tx and Rx buffer initialization rework to its own patch.

Since v1:
  - Stopped using state->link in mac_config and moved macb_set_tx_clk to
    the link_up helper..
  - Fixed the node given to phylink_of_phy_connect.
  - Removed netif_carrier_off from macb_open.
  - Fixed the macb_get_wol logic.
  - Rewored macb_ioctl as suggested.
  - Added a call to phylink_destroy in macb_remove.
  - Fixed the suspend/resume case by calling phylink_start/stop in the
    resume/suspend helpers. I had to take the rtnl lock to do this,
    which might be something to discuss.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents d7eaf962 7897b071
...@@ -22,7 +22,7 @@ if NET_VENDOR_CADENCE ...@@ -22,7 +22,7 @@ if NET_VENDOR_CADENCE
config MACB config MACB
tristate "Cadence MACB/GEM support" tristate "Cadence MACB/GEM support"
depends on HAS_DMA && COMMON_CLK depends on HAS_DMA && COMMON_CLK
select PHYLIB select PHYLINK
---help--- ---help---
The Cadence MACB ethernet interface is found on many Atmel AT32 and The Cadence MACB ethernet interface is found on many Atmel AT32 and
AT91 parts. This driver also supports the Cadence GEM (Gigabit AT91 parts. This driver also supports the Cadence GEM (Gigabit
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#ifndef _MACB_H #ifndef _MACB_H
#define _MACB_H #define _MACB_H
#include <linux/phy.h> #include <linux/phylink.h>
#include <linux/ptp_clock_kernel.h> #include <linux/ptp_clock_kernel.h>
#include <linux/net_tstamp.h> #include <linux/net_tstamp.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
...@@ -1185,15 +1185,14 @@ struct macb { ...@@ -1185,15 +1185,14 @@ struct macb {
struct macb_or_gem_ops macbgem_ops; struct macb_or_gem_ops macbgem_ops;
struct mii_bus *mii_bus; struct mii_bus *mii_bus;
struct device_node *phy_node; struct phylink *phylink;
int link; struct phylink_config phylink_config;
int speed;
int duplex;
u32 caps; u32 caps;
unsigned int dma_burst_length; unsigned int dma_burst_length;
phy_interface_t phy_interface; phy_interface_t phy_interface;
int speed;
/* AT91RM9200 transmit */ /* AT91RM9200 transmit */
struct sk_buff *skb; /* holds skb until xmit interrupt completes */ struct sk_buff *skb; /* holds skb until xmit interrupt completes */
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment