1
2
3
4
5
6
7 #ifndef __USB_OPS_LINUX_H__
8 #define __USB_OPS_LINUX_H__
9
10 #define VENDOR_CMD_MAX_DATA_LEN 254
11
12 #define RTW_USB_CONTROL_MSG_TIMEOUT_TEST 10
13 #define RTW_USB_CONTROL_MSG_TIMEOUT 500
14
15 #define MAX_USBCTRL_VENDORREQ_TIMES 10
16
17 #define RTW_USB_BULKOUT_TIME 5000
18
19 #define REALTEK_USB_VENQT_READ 0xC0
20 #define REALTEK_USB_VENQT_WRITE 0x40
21
22 #define ALIGNMENT_UNIT 16
23 #define MAX_VENDOR_REQ_CMD_SIZE 254
24 #define MAX_USB_IO_CTL_SIZE (MAX_VENDOR_REQ_CMD_SIZE + ALIGNMENT_UNIT)
25
26 #define USB_HIGH_SPEED_BULK_SIZE 512
27 #define USB_FULL_SPEED_BULK_SIZE 64
28
29 #define _usbctrl_vendorreq_async_callback(urb, regs) \
30 _usbctrl_vendorreq_async_callback(urb)
31 #define usb_bulkout_zero_complete(purb, regs) \
32 usb_bulkout_zero_complete(purb)
33 #define usb_write_mem_complete(purb, regs) \
34 usb_write_mem_complete(purb)
35 #define usb_write_port_complete(purb, regs) \
36 usb_write_port_complete(purb)
37 #define usb_read_port_complete(purb, regs) \
38 usb_read_port_complete(purb)
39 #define usb_read_interrupt_complete(purb, regs) \
40 usb_read_interrupt_complete(purb)
41
42 unsigned int ffaddr2pipehdl(struct dvobj_priv *pdvobj, u32 addr);
43
44 u8 usb_read8(struct adapter *adapter, u32 addr);
45 u16 usb_read16(struct adapter *adapter, u32 addr);
46 u32 usb_read32(struct adapter *adapter, u32 addr);
47
48 u32 usb_read_port(struct adapter *adapter, u32 addr, struct recv_buf *precvbuf);
49 void usb_read_port_cancel(struct adapter *adapter);
50
51 int usb_write8(struct adapter *adapter, u32 addr, u8 val);
52 int usb_write16(struct adapter *adapter, u32 addr, u16 val);
53 int usb_write32(struct adapter *adapter, u32 addr, u32 val);
54
55 u32 usb_write_port(struct adapter *adapter, u32 addr, u32 cnt, struct xmit_buf *pmem);
56 void usb_write_port_cancel(struct adapter *adapter);
57
58 #endif