| .. | .. |
|---|
| 35 | 35 | #define KVASER_USB_RX_BUFFER_SIZE 3072 |
|---|
| 36 | 36 | #define KVASER_USB_MAX_NET_DEVICES 5 |
|---|
| 37 | 37 | |
|---|
| 38 | | -/* USB devices features */ |
|---|
| 39 | | -#define KVASER_USB_HAS_SILENT_MODE BIT(0) |
|---|
| 40 | | -#define KVASER_USB_HAS_TXRX_ERRORS BIT(1) |
|---|
| 38 | +/* Kvaser USB device quirks */ |
|---|
| 39 | +#define KVASER_USB_QUIRK_HAS_SILENT_MODE BIT(0) |
|---|
| 40 | +#define KVASER_USB_QUIRK_HAS_TXRX_ERRORS BIT(1) |
|---|
| 41 | +#define KVASER_USB_QUIRK_IGNORE_CLK_FREQ BIT(2) |
|---|
| 41 | 42 | |
|---|
| 42 | 43 | /* Device capabilities */ |
|---|
| 43 | 44 | #define KVASER_USB_CAP_BERR_CAP 0x01 |
|---|
| .. | .. |
|---|
| 65 | 66 | struct kvaser_usb_dev_card_data { |
|---|
| 66 | 67 | u32 ctrlmode_supported; |
|---|
| 67 | 68 | u32 capabilities; |
|---|
| 68 | | - union { |
|---|
| 69 | | - struct { |
|---|
| 70 | | - enum kvaser_usb_leaf_family family; |
|---|
| 71 | | - } leaf; |
|---|
| 72 | | - struct kvaser_usb_dev_card_data_hydra hydra; |
|---|
| 73 | | - }; |
|---|
| 69 | + struct kvaser_usb_dev_card_data_hydra hydra; |
|---|
| 74 | 70 | }; |
|---|
| 75 | 71 | |
|---|
| 76 | 72 | /* Context for an outstanding, not yet ACKed, transmission */ |
|---|
| .. | .. |
|---|
| 84 | 80 | struct usb_device *udev; |
|---|
| 85 | 81 | struct usb_interface *intf; |
|---|
| 86 | 82 | struct kvaser_usb_net_priv *nets[KVASER_USB_MAX_NET_DEVICES]; |
|---|
| 87 | | - const struct kvaser_usb_dev_ops *ops; |
|---|
| 83 | + const struct kvaser_usb_driver_info *driver_info; |
|---|
| 88 | 84 | const struct kvaser_usb_dev_cfg *cfg; |
|---|
| 89 | 85 | |
|---|
| 90 | 86 | struct usb_endpoint_descriptor *bulk_in, *bulk_out; |
|---|
| .. | .. |
|---|
| 166 | 162 | int *cmd_len, u16 transid); |
|---|
| 167 | 163 | }; |
|---|
| 168 | 164 | |
|---|
| 165 | +struct kvaser_usb_driver_info { |
|---|
| 166 | + u32 quirks; |
|---|
| 167 | + enum kvaser_usb_leaf_family family; |
|---|
| 168 | + const struct kvaser_usb_dev_ops *ops; |
|---|
| 169 | +}; |
|---|
| 170 | + |
|---|
| 169 | 171 | struct kvaser_usb_dev_cfg { |
|---|
| 170 | 172 | const struct can_clock clock; |
|---|
| 171 | 173 | const unsigned int timestamp_freq; |
|---|
| .. | .. |
|---|
| 176 | 178 | extern const struct kvaser_usb_dev_ops kvaser_usb_hydra_dev_ops; |
|---|
| 177 | 179 | extern const struct kvaser_usb_dev_ops kvaser_usb_leaf_dev_ops; |
|---|
| 178 | 180 | |
|---|
| 181 | +void kvaser_usb_unlink_tx_urbs(struct kvaser_usb_net_priv *priv); |
|---|
| 182 | + |
|---|
| 179 | 183 | int kvaser_usb_recv_cmd(const struct kvaser_usb *dev, void *cmd, int len, |
|---|
| 180 | 184 | int *actual_len); |
|---|
| 181 | 185 | |
|---|
| .. | .. |
|---|
| 185 | 189 | int len); |
|---|
| 186 | 190 | |
|---|
| 187 | 191 | int kvaser_usb_can_rx_over_error(struct net_device *netdev); |
|---|
| 192 | + |
|---|
| 193 | +extern const struct can_bittiming_const kvaser_usb_flexc_bittiming_const; |
|---|
| 194 | + |
|---|
| 188 | 195 | #endif /* KVASER_USB_H */ |
|---|