aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/can/ti_hecc.c
diff options
context:
space:
mode:
authorWolfgang Grandegger <wg@grandegger.com>2009-10-08 18:17:11 -0400
committerDavid S. Miller <davem@davemloft.net>2009-10-13 06:44:04 -0400
commita6e4bc5304033e434fabccabb230b8e9ff55d76f (patch)
treea1ddf8a6648a5f60e8196c34ad20f9e107f40e8e /drivers/net/can/ti_hecc.c
parent61321bbd6235ca9a40ba3bc249e8906cc66233c3 (diff)
can: make the number of echo skb's configurable
This patch allows the CAN controller driver to define the number of echo skb's used for the local loopback (echo), as suggested by Kurt Van Dijck, with the function: struct net_device *alloc_candev(int sizeof_priv, unsigned int echo_skb_max); The CAN drivers have been adapted accordingly. For the ems_usb driver, as suggested by Sebastian Haas, the number of echo skb's has been increased to 10, which improves the transmission performance a lot. Signed-off-by: Wolfgang Grandegger <wg@grandegger.com> Signed-off-by: Kurt Van Dijck <kurt.van.dijck@eia.be> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/can/ti_hecc.c')
-rw-r--r--drivers/net/can/ti_hecc.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/net/can/ti_hecc.c b/drivers/net/can/ti_hecc.c
index 814e6c5c6386..23a7128e4eb7 100644
--- a/drivers/net/can/ti_hecc.c
+++ b/drivers/net/can/ti_hecc.c
@@ -74,10 +74,6 @@ MODULE_VERSION(HECC_MODULE_VERSION);
74#define HECC_MB_TX_SHIFT 2 /* as per table above */ 74#define HECC_MB_TX_SHIFT 2 /* as per table above */
75#define HECC_MAX_TX_MBOX BIT(HECC_MB_TX_SHIFT) 75#define HECC_MAX_TX_MBOX BIT(HECC_MB_TX_SHIFT)
76 76
77#if (HECC_MAX_TX_MBOX > CAN_ECHO_SKB_MAX)
78#error "HECC: MAX TX mailboxes should be equal or less than CAN_ECHO_SKB_MAX"
79#endif
80
81#define HECC_TX_PRIO_SHIFT (HECC_MB_TX_SHIFT) 77#define HECC_TX_PRIO_SHIFT (HECC_MB_TX_SHIFT)
82#define HECC_TX_PRIO_MASK (MAX_TX_PRIO << HECC_MB_TX_SHIFT) 78#define HECC_TX_PRIO_MASK (MAX_TX_PRIO << HECC_MB_TX_SHIFT)
83#define HECC_TX_MB_MASK (HECC_MAX_TX_MBOX - 1) 79#define HECC_TX_MB_MASK (HECC_MAX_TX_MBOX - 1)
@@ -902,7 +898,7 @@ static int ti_hecc_probe(struct platform_device *pdev)
902 goto probe_exit_free_region; 898 goto probe_exit_free_region;
903 } 899 }
904 900
905 ndev = alloc_candev(sizeof(struct ti_hecc_priv)); 901 ndev = alloc_candev(sizeof(struct ti_hecc_priv), HECC_MAX_TX_MBOX);
906 if (!ndev) { 902 if (!ndev) {
907 dev_err(&pdev->dev, "alloc_candev failed\n"); 903 dev_err(&pdev->dev, "alloc_candev failed\n");
908 err = -ENOMEM; 904 err = -ENOMEM;