blob: 78d9b6e035bfcc40e4b147a5804a9f0c5f7ba5ce [file] [log] [blame]
Larry Finger9a602712013-08-21 22:34:14 -05001/******************************************************************************
2 *
3 * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
Larry Finger9a602712013-08-21 22:34:14 -050014 ******************************************************************************/
15#ifndef __USB_OPS_LINUX_H__
16#define __USB_OPS_LINUX_H__
17
18#define VENDOR_CMD_MAX_DATA_LEN 254
19
20#define RTW_USB_CONTROL_MSG_TIMEOUT_TEST 10/* ms */
21#define RTW_USB_CONTROL_MSG_TIMEOUT 500/* ms */
22
23#define MAX_USBCTRL_VENDORREQ_TIMES 10
24
25#define RTW_USB_BULKOUT_TIME 5000/* ms */
26
navin patidar17452ee2014-06-21 18:19:37 +053027#define REALTEK_USB_VENQT_READ 0xC0
28#define REALTEK_USB_VENQT_WRITE 0x40
29
30#define ALIGNMENT_UNIT 16
31#define MAX_VENDOR_REQ_CMD_SIZE 254 /* 8188cu SIE Support */
32#define MAX_USB_IO_CTL_SIZE (MAX_VENDOR_REQ_CMD_SIZE + ALIGNMENT_UNIT)
33
34#define USB_HIGH_SPEED_BULK_SIZE 512
35#define USB_FULL_SPEED_BULK_SIZE 64
36
Larry Finger9a602712013-08-21 22:34:14 -050037#define _usbctrl_vendorreq_async_callback(urb, regs) \
38 _usbctrl_vendorreq_async_callback(urb)
39#define usb_bulkout_zero_complete(purb, regs) \
40 usb_bulkout_zero_complete(purb)
41#define usb_write_mem_complete(purb, regs) \
42 usb_write_mem_complete(purb)
43#define usb_write_port_complete(purb, regs) \
44 usb_write_port_complete(purb)
45#define usb_read_port_complete(purb, regs) \
46 usb_read_port_complete(purb)
47#define usb_read_interrupt_complete(purb, regs) \
48 usb_read_interrupt_complete(purb)
49
50unsigned int ffaddr2pipehdl(struct dvobj_priv *pdvobj, u32 addr);
51
navin patidare73fd152014-06-11 22:51:40 +053052u8 usb_read8(struct adapter *adapter, u32 addr);
53u16 usb_read16(struct adapter *adapter, u32 addr);
54u32 usb_read32(struct adapter *adapter, u32 addr);
Larry Finger9a602712013-08-21 22:34:14 -050055
navin patidare73fd152014-06-11 22:51:40 +053056u32 usb_read_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem);
57void usb_read_port_cancel(struct adapter *adapter);
58
59int usb_write8(struct adapter *adapter, u32 addr, u8 val);
60int usb_write16(struct adapter *adapter, u32 addr, u16 val);
61int usb_write32(struct adapter *adapter, u32 addr, u32 val);
navin patidare73fd152014-06-11 22:51:40 +053062
Ivan Safonov43969aa2016-09-19 00:23:42 +070063u32 usb_write_port(struct adapter *adapter, u32 addr, u32 cnt, struct xmit_buf *pmem);
navin patidare73fd152014-06-11 22:51:40 +053064void usb_write_port_cancel(struct adapter *adapter);
Larry Finger9a602712013-08-21 22:34:14 -050065
66#endif