Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1582540 > unrolled thread

[PATCH 03/21] net-next: stmmac: add optional setup function

Started byCorentin Labbe <clabbe.montjoie@gmail.com>
First post2017-02-16 14:00 +0100
Last post2017-02-17 09:20 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 03/21] net-next: stmmac: add optional setup function Corentin Labbe <clabbe.montjoie@gmail.com> - 2017-02-16 14:00 +0100
    Re: [linux-sunxi] [PATCH 03/21] net-next: stmmac: add optional setup function Peter Korsgaard <peter@korsgaard.com> - 2017-02-16 21:40 +0100
      Re: [linux-sunxi] [PATCH 03/21] net-next: stmmac: add optional setup  function Corentin Labbe <clabbe.montjoie@gmail.com> - 2017-02-17 09:20 +0100

#1582540 — [PATCH 03/21] net-next: stmmac: add optional setup function

FromCorentin Labbe <clabbe.montjoie@gmail.com>
Date2017-02-16 14:00 +0100
Subject[PATCH 03/21] net-next: stmmac: add optional setup function
Message-ID<tbtPb-6h4-19@gated-at.bofh.it>
Instead of ading more ifthen login for adding a new mac_device_info
setup function, it is easier to add a function pointer to the function
needed.

Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 7 ++++++-
 include/linux/stmmac.h                            | 3 +++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 942efb7..319394e 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -3117,7 +3117,12 @@ static int stmmac_hw_init(struct stmmac_priv *priv)
 	struct mac_device_info *mac;
 
 	/* Identify the MAC HW device */
-	if (priv->plat->has_gmac) {
+	if (priv->plat->setup) {
+		mac = priv->plat->setup(priv->ioaddr,
+					priv->plat->multicast_filter_bins,
+					priv->plat->unicast_filter_entries,
+					&priv->synopsys_id);
+	} else if (priv->plat->has_gmac) {
 		priv->dev->priv_flags |= IFF_UNICAST_FLT;
 		mac = dwmac1000_setup(priv->ioaddr,
 				      priv->plat->multicast_filter_bins,
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
index fc273e9..95ee4c4 100644
--- a/include/linux/stmmac.h
+++ b/include/linux/stmmac.h
@@ -136,6 +136,9 @@ struct plat_stmmacenet_data {
 	void (*fix_mac_speed)(void *priv, unsigned int speed);
 	int (*init)(struct platform_device *pdev, void *priv);
 	void (*exit)(struct platform_device *pdev, void *priv);
+	struct mac_device_info *(*setup)(void __iomem *ioaddr, int mcbins,
+					 int perfect_uc_entries,
+					 int *synopsys_id);
 	void *bsp_priv;
 	struct clk *stmmac_clk;
 	struct clk *pclk;
-- 
2.10.2

[toc] | [next] | [standalone]


#1582927 — Re: [linux-sunxi] [PATCH 03/21] net-next: stmmac: add optional setup function

FromPeter Korsgaard <peter@korsgaard.com>
Date2017-02-16 21:40 +0100
SubjectRe: [linux-sunxi] [PATCH 03/21] net-next: stmmac: add optional setup function
Message-ID<tbB0m-31F-13@gated-at.bofh.it>
In reply to#1582540
>>>>> "Corentin" == Corentin Labbe <clabbe.montjoie@gmail.com> writes:

 > Instead of ading more ifthen login for adding a new mac_device_info

s/login/logic/

-- 
Bye, Peter Korsgaard

[toc] | [prev] | [next] | [standalone]


#1583189 — Re: [linux-sunxi] [PATCH 03/21] net-next: stmmac: add optional setup function

FromCorentin Labbe <clabbe.montjoie@gmail.com>
Date2017-02-17 09:20 +0100
SubjectRe: [linux-sunxi] [PATCH 03/21] net-next: stmmac: add optional setup function
Message-ID<tbLVL-1GO-11@gated-at.bofh.it>
In reply to#1582927
On Thu, Feb 16, 2017 at 09:38:33PM +0100, Peter Korsgaard wrote:
> >>>>> "Corentin" == Corentin Labbe <clabbe.montjoie@gmail.com> writes:
> 
>  > Instead of ading more ifthen login for adding a new mac_device_info
> 
> s/login/logic/
> 
> -- 
> Bye, Peter Korsgaard

Thanks, will fix it.
Regards
Corentin Labbe

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web