3 * Copyright (c) 2014 Redpine Signals Inc.
5 * Permission to use, copy, modify, and/or distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 #ifndef __RSI_USB_INTF__
19 #define __RSI_USB_INTF__
21 #include <linux/usb.h>
23 #include "rsi_common.h"
25 #define USB_INTERNAL_REG_1 0x25000
26 #define RSI_USB_READY_MAGIC_NUM 0xab
27 #define FW_STATUS_REG 0x41050012
28 #define RSI_TA_HOLD_REG 0x22000844
29 #define RSI_FW_WDT_DISABLE_REQ 0x69
31 #define USB_VENDOR_REGISTER_READ 0x15
32 #define USB_VENDOR_REGISTER_WRITE 0x16
33 #define RSI_USB_TX_HEAD_ROOM 128
40 #define RSI_USB_BUF_SIZE 4096
41 #define RSI_USB_CTRL_BUF_SIZE 0x04
43 struct rx_usb_ctrl_block
{
46 struct sk_buff
*rx_skb
;
50 struct rsi_91x_usbdev
{
52 struct rsi_thread rx_thread
;
54 struct usb_device
*usbdev
;
55 struct usb_interface
*pfunction
;
56 struct rx_usb_ctrl_block rx_cb
[MAX_RX_URBS
];
58 __le16 bulkin_size
[MAX_BULK_EP
];
59 u8 bulkin_endpoint_addr
[MAX_BULK_EP
];
60 __le16 bulkout_size
[MAX_BULK_EP
];
61 u8 bulkout_endpoint_addr
[MAX_BULK_EP
];
64 struct sk_buff_head rx_q
;
67 static inline int rsi_usb_check_queue_status(struct rsi_hw
*adapter
, u8 q_num
)
69 /* In USB, there isn't any need to check the queue status */
70 return QUEUE_NOT_FULL
;
73 static inline int rsi_usb_event_timeout(struct rsi_hw
*adapter
)
75 return EVENT_WAIT_FOREVER
;
78 void rsi_usb_rx_thread(struct rsi_common
*common
);