1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
4  * All rights reserved.
5  *
6  * Purpose:
7  *
8  * Author: Warren Hsu
9  *
10  * Date: Mar. 30, 2005
11  *
12  */
13 
14 #ifndef __USBPIPE_H__
15 #define __USBPIPE_H__
16 
17 #include "device.h"
18 
19 struct vnt_interrupt_data {
20 	u8 tsr0;
21 	u8 pkt0;
22 	u16 time0;
23 	u8 tsr1;
24 	u8 pkt1;
25 	u16 time1;
26 	u8 tsr2;
27 	u8 pkt2;
28 	u16 time2;
29 	u8 tsr3;
30 	u8 pkt3;
31 	u16 time3;
32 	__le64 tsf;
33 	u8 isr0;
34 	u8 isr1;
35 	u8 rts_success;
36 	u8 rts_fail;
37 	u8 ack_fail;
38 	u8 fcs_err;
39 	u8 sw[2];
40 } __packed;
41 
42 struct vnt_tx_usb_header {
43 	u8 type;
44 	u8 pkt_no;
45 	__le16 tx_byte_count;
46 } __packed;
47 
48 #define VNT_REG_BLOCK_SIZE	64
49 
50 int vnt_control_out(struct vnt_private *priv, u8 request, u16 value,
51 		    u16 index, u16 length, const u8 *buffer);
52 int vnt_control_in(struct vnt_private *priv, u8 request, u16 value,
53 		   u16 index, u16 length,  u8 *buffer);
54 
55 int vnt_control_out_u8(struct vnt_private *priv, u8 reg, u8 ref_off, u8 data);
56 int vnt_control_in_u8(struct vnt_private *priv, u8 reg, u8 reg_off, u8 *data);
57 
58 int vnt_control_out_blocks(struct vnt_private *priv,
59 			   u16 block, u8 reg, u16 len, const u8 *data);
60 
61 int vnt_start_interrupt_urb(struct vnt_private *priv);
62 int vnt_submit_rx_urb(struct vnt_private *priv, struct vnt_rcb *rcb);
63 int vnt_tx_context(struct vnt_private *priv,
64 		   struct vnt_usb_send_context *context,
65 		   struct sk_buff *skb);
66 
67 #endif /* __USBPIPE_H__ */
68