drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:287:3: error: implicit declaration of function 'phy_init_eee'
Subsystems (4)
PATCH 294/295 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:287:3: error: implicit declaration of function 'phy_init_eee'
Hi Giuseppe,
Here is a build dependency: the below commit used some functions provided by the immediate next commit "phy: add the EEE support and the way to access to the MMD registers."
---
Kernel build failed on
tree: git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git master head: a59a4d1921664da63d801ba477950114c71c88c9 commit: d765955d2ae0b88781a0db3a5bacfe4241925e09 [294/295] stmmac: add the Energy Efficient Ethernet support config: x86_64-allmodconfig
All related error/warning messages:
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c: In function 'stmmac_eee_init':drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:287:3: error: implicit declaration of function 'phy_init_eee' [-Werror=implicit-function-declaration] drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c: In function 'stmmac_get_ethtool_stats':drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c:380:4: error: implicit declaration of function 'phy_get_eee_err' [-Werror=implicit-function-declaration] drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c: In function 'stmmac_ethtool_op_get_eee':drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c:494:2: error: implicit declaration of function 'phy_ethtool_get_eee' [-Werror=implicit-function-declaration] drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c: In function 'stmmac_ethtool_op_set_eee':drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c:519:2: error: implicit declaration of function 'phy_ethtool_set_eee' [-Werror=implicit-function-declaration]
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:287:
284 /* MAC core supports the EEE feature. */
285 if (priv->dma_cap.eee) {
286 /* Check if the PHY supports EEE */
Quoted 1 line
287 if (
phy_init_eee(priv->phydev, 1))
288 goto out;
289
290 priv->eee_active = 1;
---
0-DAY kernel build testing backend Open Source Technology Centre
Fengguang Wu <[email protected]> Intel Corporation
Quoted 1 line
From
d765955d2ae0b88781a0db3a5bacfe4241925e09Mon Sep 17 00:00:00 2001
From: Giuseppe CAVALLARO <[email protected]>
Date: Wed, 27 Jun 2012 21:14:37 +0000
Subject: [PATCH] stmmac: add the Energy Efficient Ethernet support
This patch adds the Energy Efficient Ethernet support to the stmmac.
Please see the driver's documentation for further details about this support in the driver.
Thanks also goes to Rayagond Kokatanur for his first implementation.
Note:
to clearly manage and expose the lpi interrupt status and eee ethtool stats I've had to do some modifications to the driver's design and I found really useful to move other parts of the code (e.g. mmc irq stat) in the main directly. So this means that some core has been reworked to introduce the EEE.
v1: initial patch
v2: fixed some sparse issues (typos)
v3: erroneously sent the v2 renamed as v3
v4:
o Fixed the return value of the stmmac_eee_init as suggested by D.Miller
o Totally reviewed the ethtool support for EEE
o Added a new internal parameter to tune the SW timer for TX LPI.
v5: do not change any eee setting in case of the stmmac_ethtool_op_set_eee fails
(it has to return -EOPNOTSUPP in that case).
--- drivers/net/ethernet/stmicro/stmmac/common.h | 31 +++- drivers/net/ethernet/stmicro/stmmac/dwmac1000.h | 20 +++ .../net/ethernet/stmicro/stmmac/dwmac1000_core.c | 101 +++++++++++- .../net/ethernet/stmicro/stmmac/dwmac100_core.c | 4 +- drivers/net/ethernet/stmicro/stmmac/dwmac_dma.h | 1 + drivers/net/ethernet/stmicro/stmmac/stmmac.h | 8 + .../net/ethernet/stmicro/stmmac/stmmac_ethtool.c | 57 +++++++ drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 166 +++++++++++++++++++- .../net/ethernet/stmicro/stmmac/stmmac_platform.c | 2 + 9 files changed, 372 insertions(+), 18 deletions(-)
drivers/net/ethernet/stmicro/stmmac/common.h +30 -1
@@ -89,18 +89,28 @@ struct stmmac_extra_stats {unsigned long tx_early_irq;unsigned long fatal_bus_error_irq;/* Extra info */ unsigned long threshold;unsigned long tx_pkt_n;unsigned long rx_pkt_n;unsigned long poll_n;unsigned long sched_timer_n;unsigned long normal_irq_n; +unsigned long mmc_tx_irq_n; +unsigned long mmc_rx_irq_n; +unsigned long mmc_rx_csum_offload_irq_n; +/* EEE */ +unsigned long irq_receive_pmt_irq_n; +unsigned long irq_tx_path_in_lpi_mode_n; +unsigned long irq_tx_path_exit_lpi_mode_n; +unsigned long irq_rx_path_in_lpi_mode_n; +unsigned long irq_rx_path_exit_lpi_mode_n; +unsigned long phy_eee_wakeup_error_n; };/* CSR Frequency Access Defines*/ #define CSR_F_35M 35000000#define CSR_F_60M 60000000#define CSR_F_100M 100000000#define CSR_F_150M 150000000#define CSR_F_250M 250000000#define CSR_F_300M 300000000
@@ -156,18 +166,29 @@ enum rx_frame_status { /* IPC status */ llc_snap = 4, };enum tx_dma_irq_status { tx_hard_error =1 , tx_hard_error_bump_tc =2 , handle_tx_rx =3 , }; +enum core_specific_irq_mask { + core_mmc_tx_irq =1 , + core_mmc_rx_irq =2 , + core_mmc_rx_csum_offload_irq =4 , + core_irq_receive_pmt_irq =8 , + core_irq_tx_path_in_lpi_mode =16 , + core_irq_tx_path_exit_lpi_mode =32 , + core_irq_rx_path_in_lpi_mode =64 , + core_irq_rx_path_exit_lpi_mode =128 , +}; +/* DMA HW capabilities */ struct dma_features {unsigned int mbps_10_100;unsigned int mbps_1000;unsigned int half_duplex;unsigned int hash_filter;unsigned int multi_addr;unsigned int pcs;unsigned int sma_mdio;
@@ -202,18 +223,22 @@ struct dma_features {/* Power Down and WOL */ #define PMT_NOT_SUPPORTED 0#define PMT_SUPPORTED 1/* Common MAC defines */ #define MAC_CTRL_REG 0x00000000/* MAC Control */ #define MAC_ENABLE_TX 0x00000008/* Transmitter Enable */ #define MAC_RNABLE_RX 0x00000004/* Receiver Enable */ +/* Default LPI timers */ +#define STMMAC_DEFAULT_LIT_LS_TIMER 0x3E8 +#define STMMAC_DEFAULT_TWT_LS_TIMER 0x0 +struct stmmac_desc_ops {/* DMA RX descriptor ring initialization */ void (*init_rx_desc) (struct dma_desc *p,unsigned int ring_size,int disable_rx_ic);/* DMA TX descriptor ring initialization */ void (*init_tx_desc) (struct dma_desc *p,unsigned int ring_size);/* Invoked by the xmit function to prepare the tx descriptor */ void (*prepare_tx_desc) (struct dma_desc *p, int is_fs, int len,
@@ -272,31 +297,35 @@ struct stmmac_dma_ops {struct stmmac_ops {/* MAC core initialization */ void (*core_init) (void __iomem *ioaddr)____cacheline_aligned ;/* Enable and verify that the IPC module is supported */ int (*rx_ipc) (void __iomem *ioaddr);/* Dump MAC registers */ void (*dump_regs) (void __iomem *ioaddr);/* Handle extra events on specific interrupts hw dependent */ -void (*host_irq_status) (void __iomem *ioaddr); +int (*host_irq_status) (void __iomem *ioaddr);/* Multicast filter setting */ void (*set_filter) (struct net_device *dev,int id);/* Flow control setting */ void (*flow_ctrl) (void __iomem *ioaddr,unsigned int duplex,unsigned int fc,unsigned int pause_time);/* Set power management mode (e.g. magic frame) */ void (*pmt) (void __iomem *ioaddr,unsigned long mode);/* Set/Get Unicast MAC addresses */ void (*set_umac_addr) (void __iomem *ioaddr,unsigned char *addr,unsigned int reg_n);void (*get_umac_addr) (void __iomem *ioaddr,unsigned char *addr,unsigned int reg_n); +void (*set_eee_mode) (void __iomem *ioaddr); +void (*reset_eee_mode) (void __iomem *ioaddr); +void (*set_eee_timer) (void __iomem *ioaddr,int ls,int tw); +void (*set_eee_pls) (void __iomem *ioaddr,int link); };struct mac_link {int port;int duplex;int speed; };struct mii_regs {
drivers/net/ethernet/stmicro/stmmac/dwmac1000.h +20 -0
@@ -30,18 +30,19 @@#define GMAC_MII_ADDR 0x00000010/* MII Address */ #define GMAC_MII_DATA 0x00000014/* MII Data */ #define GMAC_FLOW_CTRL 0x00000018/* Flow Control */ #define GMAC_VLAN_TAG 0x0000001c/* VLAN Tag */ #define GMAC_VERSION 0x00000020/* GMAC CORE Version */ #define GMAC_WAKEUP_FILTER 0x00000028/* Wake-up Frame Filter */ #define GMAC_INT_STATUS 0x00000038/* interrupt status register */ enum dwmac1000_irq_status { + lpiis_irq =0x400 , time_stamp_irq =0x0200 , mmc_rx_csum_offload_irq =0x0080 , mmc_tx_irq =0x0040 , mmc_rx_irq =0x0020 , mmc_irq =0x0010 , pmt_irq =0x0008 , pcs_ane_irq =0x0004 , pcs_link_irq =0x0002 , rgmii_irq =0x0001 ,
@@ -54,18 +55,37 @@ enum power_event { pointer_reset =0x80000000 , global_unicast =0x00000200 , wake_up_rx_frame =0x00000040 , magic_frame =0x00000020 , wake_up_frame_en =0x00000004 , magic_pkt_en =0x00000002 , power_down = 0x00000001, }; +/* Energy Efficient Ethernet (EEE) +* +* LPI status, timer and control register offset +*/ +#define LPI_CTRL_STATUS 0x0030 +#define LPI_TIMER_CTRL 0x0034 + +/* LPI control and status defines */ +#define LPI_CTRL_STATUS_LPITXA 0x00080000/* Enable LPI TX Automate */ +#define LPI_CTRL_STATUS_PLSEN 0x00040000/* Enable PHY Link Status */ +#define LPI_CTRL_STATUS_PLS 0x00020000/* PHY Link Status */ +#define LPI_CTRL_STATUS_LPIEN 0x00010000/* LPI Enable */ +#define LPI_CTRL_STATUS_RLPIST 0x00000200/* Receive LPI state */ +#define LPI_CTRL_STATUS_TLPIST 0x00000100/* Transmit LPI state */ +#define LPI_CTRL_STATUS_RLPIEX 0x00000008/* Receive LPI Exit */ +#define LPI_CTRL_STATUS_RLPIEN 0x00000004/* Receive LPI Entry */ +#define LPI_CTRL_STATUS_TLPIEX 0x00000002/* Transmit LPI Exit */ +#define LPI_CTRL_STATUS_TLPIEN 0x00000001/* Transmit LPI Entry */ +/* GMAC HW ADDR regs */ #define GMAC_ADDR_HIGH (reg) (((reg > 15) ? 0x00000800 : 0x00000040) + \ (reg * 8))#define GMAC_ADDR_LOW (reg) (((reg > 15) ? 0x00000804 : 0x00000044) + \ (reg * 8))#define GMAC_MAX_PERFECT_ADDRESSES 32#define GMAC_AN_CTRL 0x000000c0/* AN control */ #define GMAC_AN_STATUS 0x000000c4/* AN status */
drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c +93 -8
143 lines not on this page · raw message
drivers/net/ethernet/stmicro/stmmac/dwmac100_core.c +2 -2
@@ -66,21 +66,21 @@ static void dwmac100_dump_mac_regs(void __iomem *ioaddr)pr_info ("\tVLAN2 tag (offset 0x%x): 0x%08x\n" ,MAC_VLAN2 ,readl (ioaddr +MAC_VLAN2 )); }static int dwmac100_rx_ipc_enable (void __iomem *ioaddr) {return 0 ; } -static void dwmac100_irq_status (void __iomem *ioaddr) +static int dwmac100_irq_status (void __iomem *ioaddr) { -return ; +return 0 ; }static void dwmac100_set_umac_addr (void __iomem *ioaddr,unsigned char *addr,unsigned int reg_n) {stmmac_set_mac_addr (ioaddr, addr,MAC_ADDR_HIGH ,MAC_ADDR_LOW ); } static void dwmac100_get_umac_addr(void __iomem *ioaddr, unsigned char *addr,
drivers/net/ethernet/stmicro/stmmac/dwmac_dma.h +1 -0
@@ -64,18 +64,19 @@#define DMA_INTR_ENA_TSE 0x00000002/* Transmit Stopped */ #define DMA_INTR_ABNORMAL (DMA_INTR_ENA_AIE | DMA_INTR_ENA_FBE | \ DMA_INTR_ENA_UNE)/* DMA default interrupt mask */ #define DMA_INTR_DEFAULT_MASK (DMA_INTR_NORMAL | DMA_INTR_ABNORMAL)/* DMA Status register defines */ +#define DMA_STATUS_GLPII 0x40000000/* GMAC LPI interrupt */ #define DMA_STATUS_GPI 0x10000000/* PMT interrupt */ #define DMA_STATUS_GMI 0x08000000/* MMC interrupt */ #define DMA_STATUS_GLI 0x04000000/* GMAC Line interface int */ #define DMA_STATUS_GMI 0x08000000#define DMA_STATUS_GLI 0x04000000#define DMA_STATUS_EB_MASK 0x00380000/* Error Bits Mask */ #define DMA_STATUS_EB_TX_ABORT 0x00080000/* Error Bits - TX Abort */ #define DMA_STATUS_EB_RX_ABORT 0x00100000/* Error Bits - RX Abort */ #define DMA_STATUS_TS_MASK 0x00700000/* Transmit Process State */
drivers/net/ethernet/stmicro/stmmac/stmmac.h +8 -0
@@ -81,35 +81,43 @@ struct stmmac_priv {struct plat_stmmacenet_data *plat;struct stmmac_counters mmc;struct dma_features dma_cap;int hw_cap_support;#ifdef CONFIG_HAVE_CLK struct clk *stmmac_clk;#endif int clk_csr;int synopsys_id; +struct timer_list eee_ctrl_timer; +bool tx_path_in_lpi_mode; +int lpi_irq; +int eee_enabled; +int eee_active; +int tx_lpi_timer; };extern int phyaddr;extern int stmmac_mdio_unregister (struct net_device *ndev);extern int stmmac_mdio_register (struct net_device *ndev);extern void stmmac_set_ethtool_ops (struct net_device *netdev);extern const struct stmmac_desc_ops enh_desc_ops;extern const struct stmmac_desc_ops ndesc_ops;int stmmac_freeze (struct net_device *ndev);int stmmac_restore (struct net_device *ndev);int stmmac_resume (struct net_device *ndev);int stmmac_suspend (struct net_device *ndev);int stmmac_dvr_remove (struct net_device *ndev);struct stmmac_priv *stmmac_dvr_probe (struct device *device,struct plat_stmmacenet_data *plat_dat,void __iomem *addr); +void stmmac_disable_eee_mode (struct stmmac_priv *priv); +bool stmmac_eee_init (struct stmmac_priv *priv);#ifdef CONFIG_HAVE_CLK static inline int stmmac_clk_enable (struct stmmac_priv *priv) {if (!IS_ERR (priv->stmmac_clk))return clk_prepare_enable (priv->stmmac_clk);return 0 ; }
drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c +57 -0
126 lines not on this page · raw message
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +159 -7
439 lines not on this page · raw message
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +2 -0
@@ -150,18 +150,20 @@ static int stmmac_pltfr_probe(struct platform_device *pdev)* named as "eth_wake_irq" * * In case the wake up interrupt is not passed from the platform * so the driver will continue to use the mac irq (ndev->irq) */ priv->wol_irq =platform_get_irq_byname (pdev,"eth_wake_irq" );if (priv->wol_irq == -ENXIO ) priv->wol_irq = priv->dev->irq; + priv->lpi_irq =platform_get_irq_byname (pdev,"eth_lpi" ); +platform_set_drvdata (pdev, priv->dev);pr_debug ("STMMAC platform driver registration completed" );return 0 ; out_unmap:iounmap (addr);platform_set_drvdata (pdev,NULL );
Signature · 1 line
1.7.10
Quoted 6 lines · On 7/1/2012 1:35 PM, [email protected] wrote:
Hi Giuseppe,
Here is a build dependency: the below commit used some functions provided by the immediate next commit "phy: add the EEE support and the way to access to the MMD registers."
I had built all w/o issues (on arm/sh/x86) but I'm looking at the build again.
I hope to fix it in case of I am able to reproduce the problem because I'm on business trip and I have some issue to run tests :-(
I'll try
Peppe
Quoted 32 lines
---
Kernel build failed ontree: git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git master head: a59a4d1921664da63d801ba477950114c71c88c9 commit: d765955d2ae0b88781a0db3a5bacfe4241925e09 [294/295] stmmac: add the Energy Efficient Ethernet support config: x86_64-allmodconfigAll related error/warning messages:
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c: In function 'stmmac_eee_init':drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:287:3: error: implicit declaration of function 'phy_init_eee' [-Werror=implicit-function-declaration]drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c: In function 'stmmac_get_ethtool_stats':drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c:380:4: error: implicit declaration of function 'phy_get_eee_err' [-Werror=implicit-function-declaration]drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c: In function 'stmmac_ethtool_op_get_eee':drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c:494:2: error: implicit declaration of function 'phy_ethtool_get_eee' [-Werror=implicit-function-declaration]drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c: In function 'stmmac_ethtool_op_set_eee':drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c:519:2: error: implicit declaration of function 'phy_ethtool_set_eee' [-Werror=implicit-function-declaration]
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:287:
284 /* MAC core supports the EEE feature. */
285 if (priv->dma_cap.eee) {
286 /* Check if the PHY supports EEE */Quoted 1 line
287 if (
phy_init_eee(priv->phydev, 1))288 goto out; 289 290 priv->eee_active = 1;---
0-DAY kernel build testing backend Open Source Technology Centre
Fengguang Wu <[email protected]> Intel Corporation
Quoted 8 lines · Giuseppe CAVALLARO
Quoted 6 lines · On 7/1/2012 1:35 PM, [email protected] wrote:
Hi Giuseppe,
Here is a build dependency: the below commit used some functions provided by the immediate next commit "phy: add the EEE support and the way to access to the MMD registers."
Quoted 8 lines
I had built all w/o issues (on arm/sh/x86) but I'm looking at the build again.
I hope to fix it in case of I am able to reproduce the problem because I'm on business trip and I have some issue to run tests :-(I'll try
Peppe
Hi Peppe, please note that the next commit actually builds fine. So it should be a simple matter of swapping order of the two commits.
I'm not sure if net-next tree is rebase-able. If not, I'll stop doing commit-by-commit build tests on it in future.
Thanks,
Fengguang
Quoted 33 lines
Quoted 32 lines
---
Kernel build failed ontree: git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git master head: a59a4d1921664da63d801ba477950114c71c88c9 commit: d765955d2ae0b88781a0db3a5bacfe4241925e09 [294/295] stmmac: add the Energy Efficient Ethernet support config: x86_64-allmodconfigAll related error/warning messages:
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c: In function 'stmmac_eee_init':drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:287:3: error: implicit declaration of function 'phy_init_eee' [-Werror=implicit-function-declaration]drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c: In function 'stmmac_get_ethtool_stats':drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c:380:4: error: implicit declaration of function 'phy_get_eee_err' [-Werror=implicit-function-declaration]drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c: In function 'stmmac_ethtool_op_get_eee':drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c:494:2: error: implicit declaration of function 'phy_ethtool_get_eee' [-Werror=implicit-function-declaration]drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c: In function 'stmmac_ethtool_op_set_eee':drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c:519:2: error: implicit declaration of function 'phy_ethtool_set_eee' [-Werror=implicit-function-declaration]
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:287:
284 /* MAC core supports the EEE feature. */
285 if (priv->dma_cap.eee) {
286 /* Check if the PHY supports EEE */Quoted 1 line
287 if (
phy_init_eee(priv->phydev, 1))288 goto out; 289 290 priv->eee_active = 1;---
0-DAY kernel build testing backend Open Source Technology Centre
Fengguang Wu <[email protected]> Intel Corporation
David Miller
maintainerFrom: Fengguang Wu <[email protected]>
Date: Fri, 6 Jul 2012 16:15:56 +0800
Quoted 1 line
I'm not sure if net-next tree is rebase-able.
Never was, never will be.
Please start to tone down your reports, many are overly verbose and largely in the end not useful.
Hi David,
Quoted 6 lines
Quoted 1 line
I'm not sure if net-next tree is rebase-able.
Never was, never will be.
Please start to tone down your reports, many are overly verbose and largely in the end not useful.
It took me a while to get to know your working style and preferences. I'm aiming for the best quality service and will try to feed you with the information that matters.
Thanks,
Fengguang