Larry Finger | 9a60271 | 2013-08-21 22:34:14 -0500 | [diff] [blame] | 1 | /****************************************************************************** |
| 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 Finger | 9a60271 | 2013-08-21 22:34:14 -0500 | [diff] [blame] | 14 | ******************************************************************************/ |
| 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 patidar | 17452ee | 2014-06-21 18:19:37 +0530 | [diff] [blame] | 27 | #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 Finger | 9a60271 | 2013-08-21 22:34:14 -0500 | [diff] [blame] | 37 | #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 | |
| 50 | unsigned int ffaddr2pipehdl(struct dvobj_priv *pdvobj, u32 addr); |
| 51 | |
navin patidar | e73fd15 | 2014-06-11 22:51:40 +0530 | [diff] [blame] | 52 | u8 usb_read8(struct adapter *adapter, u32 addr); |
| 53 | u16 usb_read16(struct adapter *adapter, u32 addr); |
| 54 | u32 usb_read32(struct adapter *adapter, u32 addr); |
Larry Finger | 9a60271 | 2013-08-21 22:34:14 -0500 | [diff] [blame] | 55 | |
navin patidar | e73fd15 | 2014-06-11 22:51:40 +0530 | [diff] [blame] | 56 | u32 usb_read_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem); |
| 57 | void usb_read_port_cancel(struct adapter *adapter); |
| 58 | |
| 59 | int usb_write8(struct adapter *adapter, u32 addr, u8 val); |
| 60 | int usb_write16(struct adapter *adapter, u32 addr, u16 val); |
| 61 | int usb_write32(struct adapter *adapter, u32 addr, u32 val); |
navin patidar | e73fd15 | 2014-06-11 22:51:40 +0530 | [diff] [blame] | 62 | |
Ivan Safonov | 43969aa | 2016-09-19 00:23:42 +0700 | [diff] [blame] | 63 | u32 usb_write_port(struct adapter *adapter, u32 addr, u32 cnt, struct xmit_buf *pmem); |
navin patidar | e73fd15 | 2014-06-11 22:51:40 +0530 | [diff] [blame] | 64 | void usb_write_port_cancel(struct adapter *adapter); |
Larry Finger | 9a60271 | 2013-08-21 22:34:14 -0500 | [diff] [blame] | 65 | |
| 66 | #endif |