1 /******************************************************************************
3 * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
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.
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
14 ******************************************************************************/
18 #include <osdep_service.h>
19 #include <drv_types.h>
20 #include <osdep_intf.h>
21 #include <usb_ops_linux.h>
23 #define REALTEK_USB_VENQT_READ 0xC0
24 #define REALTEK_USB_VENQT_WRITE 0x40
25 #define REALTEK_USB_VENQT_CMD_REQ 0x05
26 #define REALTEK_USB_VENQT_CMD_IDX 0x00
33 #define ALIGNMENT_UNIT 16
34 #define MAX_VENDOR_REQ_CMD_SIZE 254 /* 8188cu SIE Support */
35 #define MAX_USB_IO_CTL_SIZE (MAX_VENDOR_REQ_CMD_SIZE +ALIGNMENT_UNIT)
37 void rtl8723au_set_hw_type(struct rtw_adapter *padapter);
39 void rtl8723au_recv_tasklet(void *priv);
41 void rtl8723au_xmit_tasklet(void *priv);
43 /* Increase and check if the continual_urb_error of this @param dvobjprive is
44 * larger than MAX_CONTINUAL_URB_ERR. Return result
46 static inline int rtw_inc_and_chk_continual_urb_error(struct dvobj_priv *dvobj)
51 value = atomic_inc_return(&dvobj->continual_urb_error);
52 if (value > MAX_CONTINUAL_URB_ERR) {
53 DBG_8723A("[dvobj:%p][ERROR] continual_urb_error:%d > %d\n",
54 dvobj, value, MAX_CONTINUAL_URB_ERR);
60 /* Set the continual_urb_error of this @param dvobjprive to 0 */
61 static inline void rtw_reset_continual_urb_error(struct dvobj_priv *dvobj)
63 atomic_set(&dvobj->continual_urb_error, 0);
66 bool rtl8723au_chip_configure(struct rtw_adapter *padapter);
68 #endif /* __USB_OPS_H_ */