aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/can
diff options
context:
space:
mode:
authorStephane Grosjean <s.grosjean@peak-system.com>2015-01-23 05:31:22 -0500
committerMarc Kleine-Budde <mkl@pengutronix.de>2015-01-28 08:47:06 -0500
commit2b0861e8cb51a6ace26da466d04eb5d535263cd4 (patch)
tree8a3a1f152aa24e1f4edfcbd41b0ea8fe8b503b18 /drivers/net/can
parentb9f2cc1be77ef2bcf1470b69bfb015447cd3fa9a (diff)
can: peak_usb: upgrade core to new struct canfd_frame
Upgrade PEAK-System USB adapters core to the new data structures (names) and callbacks added for the support of the CANFD extension. This specific patch includes changes that deal with the new struct canfd_frame. Signed-off-by: Stephane Grosjean <s.grosjean@peak-system.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net/can')
-rw-r--r--drivers/net/can/usb/peak_usb/pcan_usb_core.c8
-rw-r--r--drivers/net/can/usb/peak_usb/pcan_usb_core.h2
2 files changed, 6 insertions, 4 deletions
diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_core.c b/drivers/net/can/usb/peak_usb/pcan_usb_core.c
index 10553ffc453f..ae8c448fd4d0 100644
--- a/drivers/net/can/usb/peak_usb/pcan_usb_core.c
+++ b/drivers/net/can/usb/peak_usb/pcan_usb_core.c
@@ -252,7 +252,7 @@ static void peak_usb_write_bulk_callback(struct urb *urb)
252 case 0: 252 case 0:
253 /* transmission complete */ 253 /* transmission complete */
254 netdev->stats.tx_packets++; 254 netdev->stats.tx_packets++;
255 netdev->stats.tx_bytes += context->dlc; 255 netdev->stats.tx_bytes += context->data_len;
256 256
257 /* prevent tx timeout */ 257 /* prevent tx timeout */
258 netdev->trans_start = jiffies; 258 netdev->trans_start = jiffies;
@@ -288,7 +288,7 @@ static netdev_tx_t peak_usb_ndo_start_xmit(struct sk_buff *skb,
288 struct peak_usb_device *dev = netdev_priv(netdev); 288 struct peak_usb_device *dev = netdev_priv(netdev);
289 struct peak_tx_urb_context *context = NULL; 289 struct peak_tx_urb_context *context = NULL;
290 struct net_device_stats *stats = &netdev->stats; 290 struct net_device_stats *stats = &netdev->stats;
291 struct can_frame *cf = (struct can_frame *)skb->data; 291 struct canfd_frame *cfd = (struct canfd_frame *)skb->data;
292 struct urb *urb; 292 struct urb *urb;
293 u8 *obuf; 293 u8 *obuf;
294 int i, err; 294 int i, err;
@@ -321,7 +321,9 @@ static netdev_tx_t peak_usb_ndo_start_xmit(struct sk_buff *skb,
321 } 321 }
322 322
323 context->echo_index = i; 323 context->echo_index = i;
324 context->dlc = cf->can_dlc; 324
325 /* Note: this works with CANFD frames too */
326 context->data_len = cfd->len;
325 327
326 usb_anchor_urb(urb, &dev->tx_submitted); 328 usb_anchor_urb(urb, &dev->tx_submitted);
327 329
diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_core.h b/drivers/net/can/usb/peak_usb/pcan_usb_core.h
index c0e8dfaef526..e8038b30bab5 100644
--- a/drivers/net/can/usb/peak_usb/pcan_usb_core.h
+++ b/drivers/net/can/usb/peak_usb/pcan_usb_core.h
@@ -98,7 +98,7 @@ struct peak_time_ref {
98struct peak_tx_urb_context { 98struct peak_tx_urb_context {
99 struct peak_usb_device *dev; 99 struct peak_usb_device *dev;
100 u32 echo_index; 100 u32 echo_index;
101 u8 dlc; 101 u8 data_len;
102 struct urb *urb; 102 struct urb *urb;
103}; 103};
104 104