Commit 37b81dc5 authored by David S. Miller's avatar David S. Miller

Merge branch 'mvneta-next'

Gregory CLEMENT says:

====================
A fix and a few improvements on mvneta

This series brings some improvements for the mvneta driver and also
adds a fix.

Compared to the v2, the main change is another patch fixing a bug
in mtu_change.

Changelog:
v1 -> v2

 - In patch 2, use EXPORT_SYMBOL_GPL for mvneta_bm_get and
   mvneta_bm_put to be used in module, reported by kbuild test robot.

 - In patch 4, add the counter to the driver's ethtool state,
   suggested by David Miller.

 - In patch 6, use a single if, suggested by Marcin Wojtas

v2 -> v3

 - Adding a patch fixing the mtu change issue

 - Removing the inline keyword for mvneta_rx_refill() and let the
   comiler decided, suggested by David Miller.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents a0732548 562e2f46
This diff is collapsed.
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/of_platform.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/skbuff.h> #include <linux/skbuff.h>
#include <net/hwbm.h> #include <net/hwbm.h>
...@@ -392,6 +393,20 @@ static void mvneta_bm_put_sram(struct mvneta_bm *priv) ...@@ -392,6 +393,20 @@ static void mvneta_bm_put_sram(struct mvneta_bm *priv)
MVNETA_BM_BPPI_SIZE); MVNETA_BM_BPPI_SIZE);
} }
struct mvneta_bm *mvneta_bm_get(struct device_node *node)
{
struct platform_device *pdev = of_find_device_by_node(node);
return pdev ? platform_get_drvdata(pdev) : NULL;
}
EXPORT_SYMBOL_GPL(mvneta_bm_get);
void mvneta_bm_put(struct mvneta_bm *priv)
{
platform_device_put(priv->pdev);
}
EXPORT_SYMBOL_GPL(mvneta_bm_put);
static int mvneta_bm_probe(struct platform_device *pdev) static int mvneta_bm_probe(struct platform_device *pdev)
{ {
struct device_node *dn = pdev->dev.of_node; struct device_node *dn = pdev->dev.of_node;
......
...@@ -130,10 +130,10 @@ struct mvneta_bm_pool { ...@@ -130,10 +130,10 @@ struct mvneta_bm_pool {
}; };
/* Declarations and definitions */ /* Declarations and definitions */
void *mvneta_frag_alloc(unsigned int frag_size);
void mvneta_frag_free(unsigned int frag_size, void *data);
#if IS_ENABLED(CONFIG_MVNETA_BM) #if IS_ENABLED(CONFIG_MVNETA_BM)
struct mvneta_bm *mvneta_bm_get(struct device_node *node);
void mvneta_bm_put(struct mvneta_bm *priv);
void mvneta_bm_pool_destroy(struct mvneta_bm *priv, void mvneta_bm_pool_destroy(struct mvneta_bm *priv,
struct mvneta_bm_pool *bm_pool, u8 port_map); struct mvneta_bm_pool *bm_pool, u8 port_map);
void mvneta_bm_bufs_free(struct mvneta_bm *priv, struct mvneta_bm_pool *bm_pool, void mvneta_bm_bufs_free(struct mvneta_bm *priv, struct mvneta_bm_pool *bm_pool,
...@@ -178,5 +178,7 @@ static inline void mvneta_bm_pool_put_bp(struct mvneta_bm *priv, ...@@ -178,5 +178,7 @@ static inline void mvneta_bm_pool_put_bp(struct mvneta_bm *priv,
static inline u32 mvneta_bm_pool_get_bp(struct mvneta_bm *priv, static inline u32 mvneta_bm_pool_get_bp(struct mvneta_bm *priv,
struct mvneta_bm_pool *bm_pool) struct mvneta_bm_pool *bm_pool)
{ return 0; } { return 0; }
struct mvneta_bm *mvneta_bm_get(struct device_node *node) { return NULL; }
void mvneta_bm_put(struct mvneta_bm *priv) {}
#endif /* CONFIG_MVNETA_BM */ #endif /* CONFIG_MVNETA_BM */
#endif #endif
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