aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/can
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-11-09 02:00:54 -0500
committerDavid S. Miller <davem@davemloft.net>2009-11-09 02:00:54 -0500
commitd0e1e88d6e7dbd8e1661cb6a058ca30f54ee39e4 (patch)
treedaab7cc0db83226672f76d2fc9277e4355f89e6b /drivers/net/can
parent9e0d57fd6dad37d72a3ca6db00ca8c76f2215454 (diff)
parent2606289779cb297320a185db5997729d29b6700b (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts: drivers/net/can/usb/ems_usb.c
Diffstat (limited to 'drivers/net/can')
-rw-r--r--drivers/net/can/dev.c17
-rw-r--r--drivers/net/can/usb/ems_usb.c5
2 files changed, 21 insertions, 1 deletions
diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c
index 5fe34d64ca2a..26c89aaeba62 100644
--- a/drivers/net/can/dev.c
+++ b/drivers/net/can/dev.c
@@ -637,6 +637,22 @@ static int can_changelink(struct net_device *dev,
637 return 0; 637 return 0;
638} 638}
639 639
640static size_t can_get_size(const struct net_device *dev)
641{
642 struct can_priv *priv = netdev_priv(dev);
643 size_t size;
644
645 size = nla_total_size(sizeof(u32)); /* IFLA_CAN_STATE */
646 size += sizeof(struct can_ctrlmode); /* IFLA_CAN_CTRLMODE */
647 size += nla_total_size(sizeof(u32)); /* IFLA_CAN_RESTART_MS */
648 size += sizeof(struct can_bittiming); /* IFLA_CAN_BITTIMING */
649 size += sizeof(struct can_clock); /* IFLA_CAN_CLOCK */
650 if (priv->bittiming_const) /* IFLA_CAN_BITTIMING_CONST */
651 size += sizeof(struct can_bittiming_const);
652
653 return size;
654}
655
640static int can_fill_info(struct sk_buff *skb, const struct net_device *dev) 656static int can_fill_info(struct sk_buff *skb, const struct net_device *dev)
641{ 657{
642 struct can_priv *priv = netdev_priv(dev); 658 struct can_priv *priv = netdev_priv(dev);
@@ -687,6 +703,7 @@ static struct rtnl_link_ops can_link_ops __read_mostly = {
687 .setup = can_setup, 703 .setup = can_setup,
688 .newlink = can_newlink, 704 .newlink = can_newlink,
689 .changelink = can_changelink, 705 .changelink = can_changelink,
706 .get_size = can_get_size,
690 .fill_info = can_fill_info, 707 .fill_info = can_fill_info,
691 .fill_xstats = can_fill_xstats, 708 .fill_xstats = can_fill_xstats,
692}; 709};
diff --git a/drivers/net/can/usb/ems_usb.c b/drivers/net/can/usb/ems_usb.c
index 3685f3e42d12..3e4419054c81 100644
--- a/drivers/net/can/usb/ems_usb.c
+++ b/drivers/net/can/usb/ems_usb.c
@@ -315,7 +315,7 @@ static void ems_usb_rx_can_msg(struct ems_usb *dev, struct ems_cpc_msg *msg)
315 if (skb == NULL) 315 if (skb == NULL)
316 return; 316 return;
317 317
318 cf->can_id = msg->msg.can_msg.id; 318 cf->can_id = le32_to_cpu(msg->msg.can_msg.id);
319 cf->can_dlc = min_t(u8, msg->msg.can_msg.length, 8); 319 cf->can_dlc = min_t(u8, msg->msg.can_msg.length, 8);
320 320
321 if (msg->type == CPC_MSG_TYPE_EXT_CAN_FRAME 321 if (msg->type == CPC_MSG_TYPE_EXT_CAN_FRAME
@@ -801,6 +801,9 @@ static netdev_tx_t ems_usb_start_xmit(struct sk_buff *skb, struct net_device *ne
801 msg->length = CPC_CAN_MSG_MIN_SIZE + cf->can_dlc; 801 msg->length = CPC_CAN_MSG_MIN_SIZE + cf->can_dlc;
802 } 802 }
803 803
804 /* Respect byte order */
805 msg->msg.can_msg.id = cpu_to_le32(msg->msg.can_msg.id);
806
804 for (i = 0; i < MAX_TX_URBS; i++) { 807 for (i = 0; i < MAX_TX_URBS; i++) {
805 if (dev->tx_contexts[i].echo_index == MAX_TX_URBS) { 808 if (dev->tx_contexts[i].echo_index == MAX_TX_URBS) {
806 context = &dev->tx_contexts[i]; 809 context = &dev->tx_contexts[i];