#include <linux/device.h>
#include <linux/ethtool.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/netdevice.h>
#include <linux/signal.h>
#include <linux/slab.h>
#include <linux/sysfs.h>
#include <linux/usb.h>
#include <linux/can.h>
#include <linux/can/dev.h>
#include <linux/can/error.h>
#include "pcan_usb_core.h"
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
static const struct usb_device_id peak_usb_table[] = …;
MODULE_DEVICE_TABLE(usb, peak_usb_table);
static ssize_t can_channel_id_show(struct device *dev, struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(can_channel_id);
static struct attribute *peak_usb_sysfs_attrs[] = …;
static const struct attribute_group peak_usb_sysfs_group = …;
#define DUMP_WIDTH …
void pcan_dump_mem(const char *prompt, const void *p, int l)
{ … }
void peak_usb_init_time_ref(struct peak_time_ref *time_ref,
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_time(struct peak_time_ref *time_ref, u32 ts, ktime_t *time)
{ … }
int peak_usb_netif_rx_64(struct sk_buff *skb, u32 ts_low, u32 ts_high)
{ … }
static void peak_usb_read_bulk_callback(struct urb *urb)
{ … }
static void peak_usb_write_bulk_callback(struct urb *urb)
{ … }
static netdev_tx_t peak_usb_ndo_start_xmit(struct sk_buff *skb,
struct net_device *netdev)
{ … }
static int peak_usb_start(struct peak_usb_device *dev)
{ … }
static int peak_usb_ndo_open(struct net_device *netdev)
{ … }
static void peak_usb_unlink_all_urbs(struct peak_usb_device *dev)
{ … }
static int peak_usb_ndo_stop(struct net_device *netdev)
{ … }
void peak_usb_restart_complete(struct peak_usb_device *dev)
{ … }
void peak_usb_async_complete(struct urb *urb)
{ … }
static int peak_usb_restart(struct peak_usb_device *dev)
{ … }
static int peak_usb_set_mode(struct net_device *netdev, enum can_mode mode)
{ … }
static int peak_usb_set_bittiming(struct net_device *netdev)
{ … }
static int peak_usb_set_data_bittiming(struct net_device *netdev)
{ … }
static int peak_eth_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
{ … }
static const struct net_device_ops peak_usb_netdev_ops = …;
int peak_usb_get_eeprom_len(struct net_device *netdev)
{ … }
int peak_usb_get_eeprom(struct net_device *netdev,
struct ethtool_eeprom *eeprom, u8 *data)
{ … }
int peak_usb_set_eeprom(struct net_device *netdev,
struct ethtool_eeprom *eeprom, u8 *data)
{ … }
int pcan_get_ts_info(struct net_device *dev, struct kernel_ethtool_ts_info *info)
{ … }
static int peak_usb_create_dev(const struct peak_usb_adapter *peak_usb_adapter,
struct usb_interface *intf, int ctrl_idx)
{ … }
static void peak_usb_disconnect(struct usb_interface *intf)
{ … }
static int peak_usb_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{ … }
static struct usb_driver peak_usb_driver = …;
static int __init peak_usb_init(void)
{ … }
static int peak_usb_do_device_exit(struct device *d, void *arg)
{ … }
static void __exit peak_usb_exit(void)
{ … }
module_init(…) …;
module_exit(peak_usb_exit);