diff options
author | Wolfgang Grandegger <wg@grandegger.com> | 2009-10-08 18:17:11 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-10-13 06:44:04 -0400 |
commit | a6e4bc5304033e434fabccabb230b8e9ff55d76f (patch) | |
tree | a1ddf8a6648a5f60e8196c34ad20f9e107f40e8e /include/linux/can | |
parent | 61321bbd6235ca9a40ba3bc249e8906cc66233c3 (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 'include/linux/can')
-rw-r--r-- | include/linux/can/dev.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/include/linux/can/dev.h b/include/linux/can/dev.h index 5824b20b5fcb..1d3f7f00e3af 100644 --- a/include/linux/can/dev.h +++ b/include/linux/can/dev.h | |||
@@ -29,8 +29,6 @@ enum can_mode { | |||
29 | /* | 29 | /* |
30 | * CAN common private data | 30 | * CAN common private data |
31 | */ | 31 | */ |
32 | #define CAN_ECHO_SKB_MAX 4 | ||
33 | |||
34 | struct can_priv { | 32 | struct can_priv { |
35 | struct can_device_stats can_stats; | 33 | struct can_device_stats can_stats; |
36 | 34 | ||
@@ -44,15 +42,16 @@ struct can_priv { | |||
44 | int restart_ms; | 42 | int restart_ms; |
45 | struct timer_list restart_timer; | 43 | struct timer_list restart_timer; |
46 | 44 | ||
47 | struct sk_buff *echo_skb[CAN_ECHO_SKB_MAX]; | ||
48 | |||
49 | int (*do_set_bittiming)(struct net_device *dev); | 45 | int (*do_set_bittiming)(struct net_device *dev); |
50 | int (*do_set_mode)(struct net_device *dev, enum can_mode mode); | 46 | int (*do_set_mode)(struct net_device *dev, enum can_mode mode); |
51 | int (*do_get_state)(const struct net_device *dev, | 47 | int (*do_get_state)(const struct net_device *dev, |
52 | enum can_state *state); | 48 | enum can_state *state); |
49 | |||
50 | unsigned int echo_skb_max; | ||
51 | struct sk_buff **echo_skb; | ||
53 | }; | 52 | }; |
54 | 53 | ||
55 | struct net_device *alloc_candev(int sizeof_priv); | 54 | struct net_device *alloc_candev(int sizeof_priv, unsigned int echo_skb_max); |
56 | void free_candev(struct net_device *dev); | 55 | void free_candev(struct net_device *dev); |
57 | 56 | ||
58 | int open_candev(struct net_device *dev); | 57 | int open_candev(struct net_device *dev); |
@@ -64,8 +63,9 @@ void unregister_candev(struct net_device *dev); | |||
64 | int can_restart_now(struct net_device *dev); | 63 | int can_restart_now(struct net_device *dev); |
65 | void can_bus_off(struct net_device *dev); | 64 | void can_bus_off(struct net_device *dev); |
66 | 65 | ||
67 | void can_put_echo_skb(struct sk_buff *skb, struct net_device *dev, int idx); | 66 | void can_put_echo_skb(struct sk_buff *skb, struct net_device *dev, |
68 | void can_get_echo_skb(struct net_device *dev, int idx); | 67 | unsigned int idx); |
69 | void can_free_echo_skb(struct net_device *dev, int idx); | 68 | void can_get_echo_skb(struct net_device *dev, unsigned int idx); |
69 | void can_free_echo_skb(struct net_device *dev, unsigned int idx); | ||
70 | 70 | ||
71 | #endif /* CAN_DEV_H */ | 71 | #endif /* CAN_DEV_H */ |