* [PATCH] stmmac: pci: set default of the filter bins
@ 2014-10-30 9:39 Andy Shevchenko
2014-10-30 23:44 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Andy Shevchenko @ 2014-10-30 9:39 UTC (permalink / raw)
To: Giuseppe Cavallaro, netdev, Kweh Hock Leong, David S . Miller,
Vince Bridgers
Cc: Andy Shevchenko
The commit 3b57de958e2a brought the support for a different amount of the
filter bins, but didn't update the PCI driver accordingly. This patch appends
the default values when the device is enumerated via PCI bus.
Fixes: 3b57de958e2a (net: stmmac: Support devicetree configs for mcast and ucast filter entries)
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
index 655a23b..7fc1bbf 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
@@ -32,7 +32,10 @@ static struct stmmac_dma_cfg dma_cfg;
static void stmmac_default_data(void)
{
+ struct plat_stmmacenet_data *plat = &plat_dat;
+
memset(&plat_dat, 0, sizeof(struct plat_stmmacenet_data));
+
plat_dat.bus_id = 1;
plat_dat.phy_addr = 0;
plat_dat.interface = PHY_INTERFACE_MODE_GMII;
@@ -47,6 +50,12 @@ static void stmmac_default_data(void)
dma_cfg.pbl = 32;
dma_cfg.burst_len = DMA_AXI_BLEN_256;
plat_dat.dma_cfg = &dma_cfg;
+
+ /* Set default value for multicast hash bins */
+ plat->multicast_filter_bins = HASH_TABLE_SIZE;
+
+ /* Set default value for unicast filter entries */
+ plat->unicast_filter_entries = 1;
}
/**
--
2.1.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] stmmac: pci: set default of the filter bins
2014-10-30 9:39 [PATCH] stmmac: pci: set default of the filter bins Andy Shevchenko
@ 2014-10-30 23:44 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2014-10-30 23:44 UTC (permalink / raw)
To: andriy.shevchenko; +Cc: peppe.cavallaro, netdev, hock.leong.kweh, vbridgers2013
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Date: Thu, 30 Oct 2014 11:39:25 +0200
> @@ -32,7 +32,10 @@ static struct stmmac_dma_cfg dma_cfg;
>
> static void stmmac_default_data(void)
> {
> + struct plat_stmmacenet_data *plat = &plat_dat;
> +
> memset(&plat_dat, 0, sizeof(struct plat_stmmacenet_data));
> +
> plat_dat.bus_id = 1;
> plat_dat.phy_addr = 0;
> plat_dat.interface = PHY_INTERFACE_MODE_GMII;
> @@ -47,6 +50,12 @@ static void stmmac_default_data(void)
> dma_cfg.pbl = 32;
> dma_cfg.burst_len = DMA_AXI_BLEN_256;
> plat_dat.dma_cfg = &dma_cfg;
> +
> + /* Set default value for multicast hash bins */
> + plat->multicast_filter_bins = HASH_TABLE_SIZE;
> +
> + /* Set default value for unicast filter entries */
> + plat->unicast_filter_entries = 1;
Don't do this.
The rest of the function goes "plat_dat.foo" so it looks terribly
inconsistent when you add the local variable to dereference it like
this.
So just do "plat_dat.multicast_filter_bins = x;" etc.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-10-30 23:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-30 9:39 [PATCH] stmmac: pci: set default of the filter bins Andy Shevchenko
2014-10-30 23:44 ` 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).