Commit 4c72c53b authored by David S. Miller's avatar David S. Miller

Merge tag 'linux-can-next-for-3.20-20150128' of...

Merge tag 'linux-can-next-for-3.20-20150128' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next

Marc Kleine-Budde says:

====================
pull-request: can-next 2015-28-01

this is a pull request of 12 patches for net-next/master.

There are 3 patches by Ahmed S. Darwish, which update the kvaser_usb
driver and add support for the USBcan-II based adapters. Stéphane
Grosjean contributes 7 patches for the peak_usb driver, which add
support for the CANFD USB adapters. I contribute 2 patches which clean
up the peak_usb driver structure a bit.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 4b222ca6 0a25e1f4
......@@ -25,7 +25,7 @@ config CAN_KVASER_USB
tristate "Kvaser CAN/USB interface"
---help---
This driver adds support for Kvaser CAN/USB devices like Kvaser
Leaf Light.
Leaf Light and Kvaser USBcan II.
The driver provides support for the following devices:
- Kvaser Leaf Light
......@@ -46,6 +46,12 @@ config CAN_KVASER_USB
- Kvaser USBcan R
- Kvaser Leaf Light v2
- Kvaser Mini PCI Express HS
- Kvaser USBcan II HS/HS
- Kvaser USBcan II HS/LS
- Kvaser USBcan Rugged ("USBcan Rev B")
- Kvaser Memorator HS/HS
- Kvaser Memorator HS/LS
- Scania VCI2 (if you have the Kvaser logo on top)
If unsure, say N.
......@@ -53,10 +59,18 @@ config CAN_KVASER_USB
module will be called kvaser_usb.
config CAN_PEAK_USB
tristate "PEAK PCAN-USB/USB Pro interfaces"
tristate "PEAK PCAN-USB/USB Pro interfaces for CAN 2.0b/CAN-FD"
---help---
This driver supports the PCAN-USB and PCAN-USB Pro adapters
from PEAK-System Technik (http://www.peak-system.com).
This driver supports the PEAK-System Technik USB adapters that enable
access to the CAN bus, with repect to the CAN 2.0b and/or CAN-FD
standards, that is:
PCAN-USB single CAN 2.0b channel USB adapter
PCAN-USB Pro dual CAN 2.0b channels USB adapter
PCAN-USB FD single CAN-FD channel USB adapter
PCAN-USB Pro FD dual CAN-FD channels USB adapter
(see also http://www.peak-system.com).
config CAN_8DEV_USB
tristate "8 devices USB2CAN interface"
......
This diff is collapsed.
obj-$(CONFIG_CAN_PEAK_USB) += peak_usb.o
peak_usb-y = pcan_usb_core.o pcan_usb.o pcan_usb_pro.o
peak_usb-y = pcan_usb_core.o pcan_usb.o pcan_usb_pro.o pcan_usb_fd.o
/*
* CAN driver for PEAK System micro-CAN based adapters
*
* Copyright (C) 2003-2011 PEAK System-Technik GmbH
* Copyright (C) 2011-2013 Stephane Grosjean <s.grosjean@peak-system.com>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published
* by the Free Software Foundation; version 2 of the License.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*/
#ifndef PUCAN_H
#define PUCAN_H
/* uCAN commands opcodes list (low-order 10 bits) */
#define PUCAN_CMD_NOP 0x000
#define PUCAN_CMD_RESET_MODE 0x001
#define PUCAN_CMD_NORMAL_MODE 0x002
#define PUCAN_CMD_LISTEN_ONLY_MODE 0x003
#define PUCAN_CMD_TIMING_SLOW 0x004
#define PUCAN_CMD_TIMING_FAST 0x005
#define PUCAN_CMD_FILTER_STD 0x008
#define PUCAN_CMD_TX_ABORT 0x009
#define PUCAN_CMD_WR_ERR_CNT 0x00a
#define PUCAN_CMD_RX_FRAME_ENABLE 0x00b
#define PUCAN_CMD_RX_FRAME_DISABLE 0x00c
#define PUCAN_CMD_END_OF_COLLECTION 0x3ff
/* uCAN received messages list */
#define PUCAN_MSG_CAN_RX 0x0001
#define PUCAN_MSG_ERROR 0x0002
#define PUCAN_MSG_STATUS 0x0003
#define PUCAN_MSG_BUSLOAD 0x0004
#define PUCAN_MSG_CAN_TX 0x1000
/* uCAN command common header */
struct __packed pucan_command {
__le16 opcode_channel;
u16 args[3];
};
/* uCAN TIMING_SLOW command fields */
#define PUCAN_TSLOW_SJW_T(s, t) (((s) & 0xf) | ((!!(t)) << 7))
#define PUCAN_TSLOW_TSEG2(t) ((t) & 0xf)
#define PUCAN_TSLOW_TSEG1(t) ((t) & 0x3f)
#define PUCAN_TSLOW_BRP(b) ((b) & 0x3ff)
struct __packed pucan_timing_slow {
__le16 opcode_channel;
u8 ewl; /* Error Warning limit */
u8 sjw_t; /* Sync Jump Width + Triple sampling */
u8 tseg2; /* Timing SEGment 2 */
u8 tseg1; /* Timing SEGment 1 */
__le16 brp; /* BaudRate Prescaler */
};
/* uCAN TIMING_FAST command fields */
#define PUCAN_TFAST_SJW(s) ((s) & 0x3)
#define PUCAN_TFAST_TSEG2(t) ((t) & 0x7)
#define PUCAN_TFAST_TSEG1(t) ((t) & 0xf)
#define PUCAN_TFAST_BRP(b) ((b) & 0x3ff)
struct __packed pucan_timing_fast {
__le16 opcode_channel;
u8 unused;
u8 sjw; /* Sync Jump Width */
u8 tseg2; /* Timing SEGment 2 */
u8 tseg1; /* Timing SEGment 1 */
__le16 brp; /* BaudRate Prescaler */
};
/* uCAN FILTER_STD command fields */
#define PUCAN_FLTSTD_ROW_IDX_BITS 6
struct __packed pucan_filter_std {
__le16 opcode_channel;
__le16 idx;
__le32 mask; /* CAN-ID bitmask in idx range */
};
/* uCAN WR_ERR_CNT command fields */
#define PUCAN_WRERRCNT_TE 0x4000 /* Tx error cntr write Enable */
#define PUCAN_WRERRCNT_RE 0x8000 /* Rx error cntr write Enable */
struct __packed pucan_wr_err_cnt {
__le16 opcode_channel;
__le16 sel_mask;
u8 tx_counter; /* Tx error counter new value */
u8 rx_counter; /* Rx error counter new value */
u16 unused;
};
/* uCAN RX_FRAME_ENABLE command fields */
#define PUCAN_FLTEXT_ERROR 0x0001
#define PUCAN_FLTEXT_BUSLOAD 0x0002
struct __packed pucan_filter_ext {
__le16 opcode_channel;
__le16 ext_mask;
u32 unused;
};
/* uCAN received messages global format */
struct __packed pucan_msg {
__le16 size;
__le16 type;
__le32 ts_low;
__le32 ts_high;
};
/* uCAN flags for CAN/CANFD messages */
#define PUCAN_MSG_SELF_RECEIVE 0x80
#define PUCAN_MSG_ERROR_STATE_IND 0x40 /* error state indicator */
#define PUCAN_MSG_BITRATE_SWITCH 0x20 /* bitrate switch */
#define PUCAN_MSG_EXT_DATA_LEN 0x10 /* extended data length */
#define PUCAN_MSG_SINGLE_SHOT 0x08
#define PUCAN_MSG_LOOPED_BACK 0x04
#define PUCAN_MSG_EXT_ID 0x02
#define PUCAN_MSG_RTR 0x01
struct __packed pucan_rx_msg {
__le16 size;
__le16 type;
__le32 ts_low;
__le32 ts_high;
__le32 tag_low;
__le32 tag_high;
u8 channel_dlc;
u8 client;
__le16 flags;
__le32 can_id;
u8 d[0];
};
/* uCAN error types */
#define PUCAN_ERMSG_BIT_ERROR 0
#define PUCAN_ERMSG_FORM_ERROR 1
#define PUCAN_ERMSG_STUFF_ERROR 2
#define PUCAN_ERMSG_OTHER_ERROR 3
#define PUCAN_ERMSG_ERR_CNT_DEC 4
struct __packed pucan_error_msg {
__le16 size;
__le16 type;
__le32 ts_low;
__le32 ts_high;
u8 channel_type_d;
u8 code_g;
u8 tx_err_cnt;
u8 rx_err_cnt;
};
#define PUCAN_BUS_PASSIVE 0x20
#define PUCAN_BUS_WARNING 0x40
#define PUCAN_BUS_BUSOFF 0x80
struct __packed pucan_status_msg {
__le16 size;
__le16 type;
__le32 ts_low;
__le32 ts_high;
u8 channel_p_w_b;
u8 unused[3];
};
/* uCAN transmitted message format */
#define PUCAN_MSG_CHANNEL_DLC(c, d) (((c) & 0xf) | ((d) << 4))
struct __packed pucan_tx_msg {
__le16 size;
__le16 type;
__le32 tag_low;
__le32 tag_high;
u8 channel_dlc;
u8 client;
__le16 flags;
__le32 can_id;
u8 d[0];
};
/* build the cmd opcode_channel field with respect to the correct endianness */
static inline __le16 pucan_cmd_opcode_channel(struct peak_usb_device *dev,
int opcode)
{
return cpu_to_le16(((dev->ctrl_idx) << 12) | ((opcode) & 0x3ff));
}
/* return the channel number part from any received message channel_dlc field */
static inline int pucan_msg_get_channel(struct pucan_rx_msg *rm)
{
return rm->channel_dlc & 0xf;
}
/* return the dlc value from any received message channel_dlc field */
static inline int pucan_msg_get_dlc(struct pucan_rx_msg *rm)
{
return rm->channel_dlc >> 4;
}
static inline int pucan_ermsg_get_channel(struct pucan_error_msg *em)
{
return em->channel_type_d & 0x0f;
}
static inline int pucan_stmsg_get_channel(struct pucan_status_msg *sm)
{
return sm->channel_p_w_b & 0x0f;
}
#endif
......@@ -855,10 +855,11 @@ static int pcan_usb_probe(struct usb_interface *intf)
/*
* describe the PCAN-USB adapter
*/
struct peak_usb_adapter pcan_usb = {
const struct peak_usb_adapter pcan_usb = {
.name = "PCAN-USB",
.device_id = PCAN_USB_PRODUCT_ID,
.ctrl_count = 1,
.ctrlmode_supported = CAN_CTRLMODE_3_SAMPLES | CAN_CTRLMODE_LISTENONLY,
.clock = {
.freq = PCAN_USB_CRYSTAL_HZ / 2 ,
},
......
......@@ -37,16 +37,19 @@ MODULE_LICENSE("GPL v2");
static struct usb_device_id peak_usb_table[] = {
{USB_DEVICE(PCAN_USB_VENDOR_ID, PCAN_USB_PRODUCT_ID)},
{USB_DEVICE(PCAN_USB_VENDOR_ID, PCAN_USBPRO_PRODUCT_ID)},
{USB_DEVICE(PCAN_USB_VENDOR_ID, PCAN_USBFD_PRODUCT_ID)},
{USB_DEVICE(PCAN_USB_VENDOR_ID, PCAN_USBPROFD_PRODUCT_ID)},
{} /* Terminating entry */
};
MODULE_DEVICE_TABLE(usb, peak_usb_table);
/* List of supported PCAN-USB adapters (NULL terminated list) */
static struct peak_usb_adapter *peak_usb_adapters_list[] = {
static const struct peak_usb_adapter *const peak_usb_adapters_list[] = {
&pcan_usb,
&pcan_usb_pro,
NULL,
&pcan_usb_fd,
&pcan_usb_pro_fd,
};
/*
......@@ -65,7 +68,7 @@ void pcan_dump_mem(char *prompt, void *p, int l)
* initialize a time_ref object with usb adapter own settings
*/
void peak_usb_init_time_ref(struct peak_time_ref *time_ref,
struct peak_usb_adapter *adapter)
const struct peak_usb_adapter *adapter)
{
if (time_ref) {
memset(time_ref, 0, sizeof(struct peak_time_ref));
......@@ -164,6 +167,21 @@ void peak_usb_get_ts_tv(struct peak_time_ref *time_ref, u32 ts,
}
}
/*
* post received skb after having set any hw timestamp
*/
int peak_usb_netif_rx(struct sk_buff *skb,
struct peak_time_ref *time_ref, u32 ts_low, u32 ts_high)
{
struct skb_shared_hwtstamps *hwts = skb_hwtstamps(skb);
struct timeval tv;
peak_usb_get_ts_tv(time_ref, ts_low, &tv);
hwts->hwtstamp = timeval_to_ktime(tv);
return netif_rx(skb);
}
/*
* callback for bulk Rx urb
*/
......@@ -253,7 +271,7 @@ static void peak_usb_write_bulk_callback(struct urb *urb)
case 0:
/* transmission complete */
netdev->stats.tx_packets++;
netdev->stats.tx_bytes += context->dlc;
netdev->stats.tx_bytes += context->data_len;
/* prevent tx timeout */
netdev->trans_start = jiffies;
......@@ -289,7 +307,7 @@ static netdev_tx_t peak_usb_ndo_start_xmit(struct sk_buff *skb,
struct peak_usb_device *dev = netdev_priv(netdev);
struct peak_tx_urb_context *context = NULL;
struct net_device_stats *stats = &netdev->stats;
struct can_frame *cf = (struct can_frame *)skb->data;
struct canfd_frame *cfd = (struct canfd_frame *)skb->data;
struct urb *urb;
u8 *obuf;
int i, err;
......@@ -322,7 +340,9 @@ static netdev_tx_t peak_usb_ndo_start_xmit(struct sk_buff *skb,
}
context->echo_index = i;
context->dlc = cf->can_dlc;
/* Note: this works with CANFD frames too */
context->data_len = cfd->len;
usb_anchor_urb(urb, &dev->tx_submitted);
......@@ -679,19 +699,43 @@ static int peak_usb_set_mode(struct net_device *netdev, enum can_mode mode)
}
/*
* candev callback used to set device bitrate.
* candev callback used to set device nominal/arbitration bitrate.
*/
static int peak_usb_set_bittiming(struct net_device *netdev)
{
struct peak_usb_device *dev = netdev_priv(netdev);
struct can_bittiming *bt = &dev->can.bittiming;
const struct peak_usb_adapter *pa = dev->adapter;
if (dev->adapter->dev_set_bittiming) {
int err = dev->adapter->dev_set_bittiming(dev, bt);
if (pa->dev_set_bittiming) {
struct can_bittiming *bt = &dev->can.bittiming;
int err = pa->dev_set_bittiming(dev, bt);
if (err)
netdev_info(netdev, "couldn't set bitrate (err %d)\n",
err);
err);
return err;
}
return 0;
}
/*
* candev callback used to set device data bitrate.
*/
static int peak_usb_set_data_bittiming(struct net_device *netdev)
{
struct peak_usb_device *dev = netdev_priv(netdev);
const struct peak_usb_adapter *pa = dev->adapter;
if (pa->dev_set_data_bittiming) {
struct can_bittiming *bt = &dev->can.data_bittiming;
int err = pa->dev_set_data_bittiming(dev, bt);
if (err)
netdev_info(netdev,
"couldn't set data bitrate (err %d)\n",
err);
return err;
}
......@@ -709,7 +753,7 @@ static const struct net_device_ops peak_usb_netdev_ops = {
* create one device which is attached to CAN controller #ctrl_idx of the
* usb adapter.
*/
static int peak_usb_create_dev(struct peak_usb_adapter *peak_usb_adapter,
static int peak_usb_create_dev(const struct peak_usb_adapter *peak_usb_adapter,
struct usb_interface *intf, int ctrl_idx)
{
struct usb_device *usb_dev = interface_to_usbdev(intf);
......@@ -750,9 +794,11 @@ static int peak_usb_create_dev(struct peak_usb_adapter *peak_usb_adapter,
dev->can.clock = peak_usb_adapter->clock;
dev->can.bittiming_const = &peak_usb_adapter->bittiming_const;
dev->can.do_set_bittiming = peak_usb_set_bittiming;
dev->can.data_bittiming_const = &peak_usb_adapter->data_bittiming_const;
dev->can.do_set_data_bittiming = peak_usb_set_data_bittiming;
dev->can.do_set_mode = peak_usb_set_mode;
dev->can.ctrlmode_supported = CAN_CTRLMODE_3_SAMPLES |
CAN_CTRLMODE_LISTENONLY;
dev->can.do_get_berr_counter = peak_usb_adapter->do_get_berr_counter;
dev->can.ctrlmode_supported = peak_usb_adapter->ctrlmode_supported;
netdev->netdev_ops = &peak_usb_netdev_ops;
......@@ -857,17 +903,18 @@ static int peak_usb_probe(struct usb_interface *intf,
{
struct usb_device *usb_dev = interface_to_usbdev(intf);
const u16 usb_id_product = le16_to_cpu(usb_dev->descriptor.idProduct);
struct peak_usb_adapter *peak_usb_adapter, **pp;
const struct peak_usb_adapter *peak_usb_adapter = NULL;
int i, err = -ENOMEM;
usb_dev = interface_to_usbdev(intf);
/* get corresponding PCAN-USB adapter */
for (pp = peak_usb_adapters_list; *pp; pp++)
if ((*pp)->device_id == usb_id_product)
for (i = 0; i < ARRAY_SIZE(peak_usb_adapters_list); i++)
if (peak_usb_adapters_list[i]->device_id == usb_id_product) {
peak_usb_adapter = peak_usb_adapters_list[i];
break;
}
peak_usb_adapter = *pp;
if (!peak_usb_adapter) {
/* should never come except device_id bad usage in this file */
pr_err("%s: didn't find device id. 0x%x in devices list\n",
......
......@@ -25,6 +25,8 @@
/* supported device ids. */
#define PCAN_USB_PRODUCT_ID 0x000c
#define PCAN_USBPRO_PRODUCT_ID 0x000d
#define PCAN_USBPROFD_PRODUCT_ID 0x0011
#define PCAN_USBFD_PRODUCT_ID 0x0012
#define PCAN_USB_DRIVER_NAME "peak_usb"
......@@ -44,8 +46,10 @@ struct peak_usb_device;
struct peak_usb_adapter {
char *name;
u32 device_id;
u32 ctrlmode_supported;
struct can_clock clock;
const struct can_bittiming_const bittiming_const;
const struct can_bittiming_const data_bittiming_const;
unsigned int ctrl_count;
int (*intf_probe)(struct usb_interface *intf);
......@@ -57,6 +61,8 @@ struct peak_usb_adapter {
int (*dev_close)(struct peak_usb_device *dev);
int (*dev_set_bittiming)(struct peak_usb_device *dev,
struct can_bittiming *bt);
int (*dev_set_data_bittiming)(struct peak_usb_device *dev,
struct can_bittiming *bt);
int (*dev_set_bus)(struct peak_usb_device *dev, u8 onoff);
int (*dev_get_device_id)(struct peak_usb_device *dev, u32 *device_id);
int (*dev_decode_buf)(struct peak_usb_device *dev, struct urb *urb);
......@@ -66,6 +72,8 @@ struct peak_usb_adapter {
int (*dev_stop)(struct peak_usb_device *dev);
int (*dev_restart_async)(struct peak_usb_device *dev, struct urb *urb,
u8 *buf);
int (*do_get_berr_counter)(const struct net_device *netdev,
struct can_berr_counter *bec);
u8 ep_msg_in;
u8 ep_msg_out[PCAN_USB_MAX_CHANNEL];
u8 ts_used_bits;
......@@ -78,21 +86,23 @@ struct peak_usb_adapter {
int sizeof_dev_private;
};
extern struct peak_usb_adapter pcan_usb;
extern struct peak_usb_adapter pcan_usb_pro;
extern const struct peak_usb_adapter pcan_usb;
extern const struct peak_usb_adapter pcan_usb_pro;
extern const struct peak_usb_adapter pcan_usb_fd;
extern const struct peak_usb_adapter pcan_usb_pro_fd;
struct peak_time_ref {
struct timeval tv_host_0, tv_host;
u32 ts_dev_1, ts_dev_2;
u64 ts_total;
u32 tick_count;
struct peak_usb_adapter *adapter;
const struct peak_usb_adapter *adapter;
};
struct peak_tx_urb_context {
struct peak_usb_device *dev;
u32 echo_index;
u8 dlc;
u8 data_len;
struct urb *urb;
};
......@@ -102,7 +112,7 @@ struct peak_tx_urb_context {
/* PEAK-System USB device */
struct peak_usb_device {
struct can_priv can;
struct peak_usb_adapter *adapter;
const struct peak_usb_adapter *adapter;
unsigned int ctrl_idx;
u32 state;
......@@ -134,12 +144,14 @@ void pcan_dump_mem(char *prompt, void *p, int l);
/* common timestamp management */
void peak_usb_init_time_ref(struct peak_time_ref *time_ref,
struct peak_usb_adapter *adapter);
const struct peak_usb_adapter *adapter);
void peak_usb_update_ts_now(struct peak_time_ref *time_ref, u32 ts_now);
void peak_usb_set_ts_now(struct peak_time_ref *time_ref, u32 ts_now);
void peak_usb_get_ts_tv(struct peak_time_ref *time_ref, u32 ts,
struct timeval *tv);
int peak_usb_netif_rx(struct sk_buff *skb,
struct peak_time_ref *time_ref, u32 ts_low, u32 ts_high);
void peak_usb_async_complete(struct urb *urb);
void peak_usb_restart_complete(struct peak_usb_device *dev);
#endif
This diff is collapsed.
......@@ -27,14 +27,6 @@
MODULE_SUPPORTED_DEVICE("PEAK-System PCAN-USB Pro adapter");
/* PCAN-USB Pro Endpoints */
#define PCAN_USBPRO_EP_CMDOUT 1
#define PCAN_USBPRO_EP_CMDIN (PCAN_USBPRO_EP_CMDOUT | USB_DIR_IN)
#define PCAN_USBPRO_EP_MSGOUT_0 2
#define PCAN_USBPRO_EP_MSGIN (PCAN_USBPRO_EP_MSGOUT_0 | USB_DIR_IN)
#define PCAN_USBPRO_EP_MSGOUT_1 3
#define PCAN_USBPRO_EP_UNUSED (PCAN_USBPRO_EP_MSGOUT_1 | USB_DIR_IN)
#define PCAN_USBPRO_CHANNEL_COUNT 2
/* PCAN-USB Pro adapter internal clock (MHz) */
......@@ -322,8 +314,8 @@ static int pcan_usb_pro_wait_rsp(struct peak_usb_device *dev,
return (i >= PCAN_USBPRO_RSP_SUBMIT_MAX) ? -ERANGE : err;
}
static int pcan_usb_pro_send_req(struct peak_usb_device *dev, int req_id,
int req_value, void *req_addr, int req_size)
int pcan_usb_pro_send_req(struct peak_usb_device *dev, int req_id,
int req_value, void *req_addr, int req_size)
{
int err;
u8 req_type;
......@@ -475,7 +467,7 @@ static int pcan_usb_pro_set_bittiming(struct peak_usb_device *dev,
return pcan_usb_pro_set_bitrate(dev, ccbt);
}
static void pcan_usb_pro_restart_complete(struct urb *urb)
void pcan_usb_pro_restart_complete(struct urb *urb)
{
/* can delete usb resources */
peak_usb_async_complete(urb);
......@@ -978,7 +970,7 @@ static void pcan_usb_pro_free(struct peak_usb_device *dev)
/*
* probe function for new PCAN-USB Pro usb interface
*/
static int pcan_usb_pro_probe(struct usb_interface *intf)
int pcan_usb_pro_probe(struct usb_interface *intf)
{
struct usb_host_interface *if_desc;
int i;
......@@ -1012,10 +1004,11 @@ static int pcan_usb_pro_probe(struct usb_interface *intf)
/*
* describe the PCAN-USB Pro adapter
*/
struct peak_usb_adapter pcan_usb_pro = {
const struct peak_usb_adapter pcan_usb_pro = {
.name = "PCAN-USB Pro",
.device_id = PCAN_USBPRO_PRODUCT_ID,
.ctrl_count = PCAN_USBPRO_CHANNEL_COUNT,
.ctrlmode_supported = CAN_CTRLMODE_3_SAMPLES | CAN_CTRLMODE_LISTENONLY,
.clock = {
.freq = PCAN_USBPRO_CRYSTAL_HZ,
},
......
......@@ -27,6 +27,14 @@
#define PCAN_USBPRO_INFO_BL 0
#define PCAN_USBPRO_INFO_FW 1
/* PCAN-USB Pro (FD) Endpoints */
#define PCAN_USBPRO_EP_CMDOUT 1
#define PCAN_USBPRO_EP_CMDIN (PCAN_USBPRO_EP_CMDOUT | USB_DIR_IN)
#define PCAN_USBPRO_EP_MSGOUT_0 2
#define PCAN_USBPRO_EP_MSGIN (PCAN_USBPRO_EP_MSGOUT_0 | USB_DIR_IN)
#define PCAN_USBPRO_EP_MSGOUT_1 3
#define PCAN_USBPRO_EP_UNUSED (PCAN_USBPRO_EP_MSGOUT_1 | USB_DIR_IN)
/* Vendor Request value for XXX_FCT */
#define PCAN_USBPRO_FCT_DRVLD 5 /* tell device driver is loaded */
#define PCAN_USBPRO_FCT_DRVLD_REQ_LEN 16
......@@ -176,4 +184,9 @@ union pcan_usb_pro_rec {
struct pcan_usb_pro_txmsg tx_msg;
};
int pcan_usb_pro_probe(struct usb_interface *intf);
int pcan_usb_pro_send_req(struct peak_usb_device *dev, int req_id,
int req_value, void *req_addr, int req_size);
void pcan_usb_pro_restart_complete(struct urb *urb);
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment