blob: 1664a0a15859736b39d70387b9868c4186842e19 [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001/*
2 * Copyright (c) 2013-2014 The Linux Foundation. All rights reserved.
3 *
4 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
5 *
6 *
7 * Permission to use, copy, modify, and/or distribute this software for
8 * any purpose with or without fee is hereby granted, provided that the
9 * above copyright notice and this permission notice appear in all
10 * copies.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
13 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
14 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
15 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
16 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
17 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 * PERFORMANCE OF THIS SOFTWARE.
20 */
21
22/*
23 * This file was originally distributed by Qualcomm Atheros, Inc.
24 * under proprietary terms before Copyright ownership was assigned
25 * to the Linux Foundation.
26 */
27/*
28 * Shared USB definitions
29 *
30 *
31 *
32 *
33 */
34
35#ifndef __A_USB_DEFS_H__
36#define __A_USB_DEFS_H__
37
38#ifndef ATH_TARGET
39#include "athstartpack.h"
40#endif
41
42/* USB endpoint definitions */
43
44#define USB_EP_ADDR_APP_CTRL_IN 0x81
45#define USB_EP_ADDR_APP_DATA_IN 0x82
46#define USB_EP_ADDR_APP_DATA2_IN 0x83
47#define USB_EP_ADDR_APP_INT_IN 0x84
48
49#define USB_EP_ADDR_APP_CTRL_OUT 0x01
50#define USB_EP_ADDR_APP_DATA_LP_OUT 0x02
51#define USB_EP_ADDR_APP_DATA_MP_OUT 0x03
52#define USB_EP_ADDR_APP_DATA_HP_OUT 0x04
53
54#define USB_CONTROL_REQ_SEND_BMI_CMD 1
55#define USB_CONTROL_REQ_RECV_BMI_RESP 2
56#define USB_CONTROL_REQ_DIAG_CMD 3
57#define USB_CONTROL_REQ_DIAG_RESP 4
58
59/* #define USB_CONTROL_MAX_BMI_TRANSFER_SIZE 64 */
60#define USB_CONTROL_MAX_BMI_TRANSFER_SIZE 252
61
62#define HIF_BMI_MAX_TRANSFER_SIZE USB_CONTROL_MAX_BMI_TRANSFER_SIZE
63
64/* 512 Bytes Maxp for High Speed for BULK EP */
65#define USB_HS_BULK_MAXP_SIZE 0x200
66/* 64 Bytes Maxp for Full Speed for BULK EP */
67#define USB_FS_BULK_MAXP_SIZE 0x40
68
69/* diagnostic command defnitions */
70#define USB_CTRL_DIAG_CC_READ 0
71#define USB_CTRL_DIAG_CC_WRITE 1
72#define USB_CTRL_DIAG_CC_WARM_RESET 2
73
74typedef PREPACK struct {
75 A_UINT32 Cmd;
76 A_UINT32 Address;
77 A_UINT32 Value;
78 A_UINT32 _pad[1];
79} POSTPACK USB_CTRL_DIAG_CMD_WRITE;
80
81typedef PREPACK struct {
82 A_UINT32 Cmd;
83 A_UINT32 Address;
84} POSTPACK USB_CTRL_DIAG_CMD_READ;
85
86typedef PREPACK struct {
87 A_UINT32 ReadValue;
88} POSTPACK USB_CTRL_DIAG_RESP_READ;
89
90#define USB_CTRL_MAX_DIAG_CMD_SIZE (sizeof(USB_CTRL_DIAG_CMD_WRITE))
91#define USB_CTRL_MAX_DIAG_RESP_SIZE (sizeof(USB_CTRL_DIAG_RESP_READ))
92
93#ifndef ATH_TARGET
94#include "athendpack.h"
95#endif
96
97#endif