hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/net/can/usb/kvaser_usb/kvaser_usb.h
....@@ -35,9 +35,10 @@
3535 #define KVASER_USB_RX_BUFFER_SIZE 3072
3636 #define KVASER_USB_MAX_NET_DEVICES 5
3737
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)
4142
4243 /* Device capabilities */
4344 #define KVASER_USB_CAP_BERR_CAP 0x01
....@@ -65,12 +66,7 @@
6566 struct kvaser_usb_dev_card_data {
6667 u32 ctrlmode_supported;
6768 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;
7470 };
7571
7672 /* Context for an outstanding, not yet ACKed, transmission */
....@@ -84,7 +80,7 @@
8480 struct usb_device *udev;
8581 struct usb_interface *intf;
8682 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;
8884 const struct kvaser_usb_dev_cfg *cfg;
8985
9086 struct usb_endpoint_descriptor *bulk_in, *bulk_out;
....@@ -166,6 +162,12 @@
166162 int *cmd_len, u16 transid);
167163 };
168164
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
+
169171 struct kvaser_usb_dev_cfg {
170172 const struct can_clock clock;
171173 const unsigned int timestamp_freq;
....@@ -176,6 +178,8 @@
176178 extern const struct kvaser_usb_dev_ops kvaser_usb_hydra_dev_ops;
177179 extern const struct kvaser_usb_dev_ops kvaser_usb_leaf_dev_ops;
178180
181
+void kvaser_usb_unlink_tx_urbs(struct kvaser_usb_net_priv *priv);
182
+
179183 int kvaser_usb_recv_cmd(const struct kvaser_usb *dev, void *cmd, int len,
180184 int *actual_len);
181185
....@@ -185,4 +189,7 @@
185189 int len);
186190
187191 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
+
188195 #endif /* KVASER_USB_H */