Skip to content

Commit

Permalink
net: macb: convert to phylink
Browse files Browse the repository at this point in the history
This patch 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.

Tested-by: Alexandre Belloni <[email protected]>
Signed-off-by: Antoine Tenart <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
atenart authored and davem330 committed Nov 13, 2019
1 parent 6e952d9 commit 7897b07
Show file tree
Hide file tree
Showing 3 changed files with 237 additions and 219 deletions.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/cadence/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ if NET_VENDOR_CADENCE
config MACB
tristate "Cadence MACB/GEM support"
depends on HAS_DMA && COMMON_CLK
select PHYLIB
select PHYLINK
---help---
The Cadence MACB ethernet interface is found on many Atmel AT32 and
AT91 parts. This driver also supports the Cadence GEM (Gigabit
Expand Down
9 changes: 4 additions & 5 deletions drivers/net/ethernet/cadence/macb.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#ifndef _MACB_H
#define _MACB_H

#include <linux/phy.h>
#include <linux/phylink.h>
#include <linux/ptp_clock_kernel.h>
#include <linux/net_tstamp.h>
#include <linux/interrupt.h>
Expand Down Expand Up @@ -1185,15 +1185,14 @@ struct macb {
struct macb_or_gem_ops macbgem_ops;

struct mii_bus *mii_bus;
struct device_node *phy_node;
int link;
int speed;
int duplex;
struct phylink *phylink;
struct phylink_config phylink_config;

u32 caps;
unsigned int dma_burst_length;

phy_interface_t phy_interface;
int speed;

/* AT91RM9200 transmit */
struct sk_buff *skb; /* holds skb until xmit interrupt completes */
Expand Down
Loading

0 comments on commit 7897b07

Please sign in to comment.