mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
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>
This commit is contained in:
parent
61321bbd62
commit
a6e4bc5304
7 changed files with 42 additions and 23 deletions
|
@ -29,8 +29,6 @@ enum can_mode {
|
|||
/*
|
||||
* CAN common private data
|
||||
*/
|
||||
#define CAN_ECHO_SKB_MAX 4
|
||||
|
||||
struct can_priv {
|
||||
struct can_device_stats can_stats;
|
||||
|
||||
|
@ -44,15 +42,16 @@ struct can_priv {
|
|||
int restart_ms;
|
||||
struct timer_list restart_timer;
|
||||
|
||||
struct sk_buff *echo_skb[CAN_ECHO_SKB_MAX];
|
||||
|
||||
int (*do_set_bittiming)(struct net_device *dev);
|
||||
int (*do_set_mode)(struct net_device *dev, enum can_mode mode);
|
||||
int (*do_get_state)(const struct net_device *dev,
|
||||
enum can_state *state);
|
||||
|
||||
unsigned int echo_skb_max;
|
||||
struct sk_buff **echo_skb;
|
||||
};
|
||||
|
||||
struct net_device *alloc_candev(int sizeof_priv);
|
||||
struct net_device *alloc_candev(int sizeof_priv, unsigned int echo_skb_max);
|
||||
void free_candev(struct net_device *dev);
|
||||
|
||||
int open_candev(struct net_device *dev);
|
||||
|
@ -64,8 +63,9 @@ void unregister_candev(struct net_device *dev);
|
|||
int can_restart_now(struct net_device *dev);
|
||||
void can_bus_off(struct net_device *dev);
|
||||
|
||||
void can_put_echo_skb(struct sk_buff *skb, struct net_device *dev, int idx);
|
||||
void can_get_echo_skb(struct net_device *dev, int idx);
|
||||
void can_free_echo_skb(struct net_device *dev, int idx);
|
||||
void can_put_echo_skb(struct sk_buff *skb, struct net_device *dev,
|
||||
unsigned int idx);
|
||||
void can_get_echo_skb(struct net_device *dev, unsigned int idx);
|
||||
void can_free_echo_skb(struct net_device *dev, unsigned int idx);
|
||||
|
||||
#endif /* CAN_DEV_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue