]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blame - drivers/staging/crystalhd/crystalhd_cmds.h
Merge tag 'microblaze-3.14-rc1' of git://git.monstr.eu/linux-2.6-microblaze
[mirror_ubuntu-artful-kernel.git] / drivers / staging / crystalhd / crystalhd_cmds.h
CommitLineData
7963eb43
JW
1/***************************************************************************
2 * Copyright (c) 2005-2009, Broadcom Corporation.
3 *
4 * Name: crystalhd_cmds . h
5 *
6 * Description:
7 * BCM70010 Linux driver user command interfaces.
8 *
9 * HISTORY:
10 *
11 **********************************************************************
12 * This file is part of the crystalhd device driver.
13 *
14 * This driver is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation, version 2 of the License.
17 *
18 * This driver is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with this driver. If not, see <http://www.gnu.org/licenses/>.
25 **********************************************************************/
26
27#ifndef _CRYSTALHD_CMDS_H_
28#define _CRYSTALHD_CMDS_H_
29
30/*
31 * NOTE:: This is the main interface file between the Linux layer
cc922722 32 * and the hardware layer. This file will use the definitions
7963eb43
JW
33 * from _dts_glob and dts_defs etc.. which are defined for
34 * windows.
35 */
01c32070
JV
36
37#include "crystalhd.h"
7963eb43 38
831e5bad 39enum crystalhd_state {
7963eb43
JW
40 BC_LINK_INVALID = 0x00,
41 BC_LINK_INIT = 0x01,
42 BC_LINK_CAP_EN = 0x02,
43 BC_LINK_FMT_CHG = 0x04,
44 BC_LINK_SUSPEND = 0x10,
45 BC_LINK_PAUSED = 0x20,
46 BC_LINK_READY = (BC_LINK_INIT | BC_LINK_CAP_EN | BC_LINK_FMT_CHG),
47};
48
49struct crystalhd_user {
50 uint32_t uid;
51 uint32_t in_use;
52 uint32_t mode;
53};
54
55#define DTS_MODE_INV (-1)
56
57struct crystalhd_cmd {
58 uint32_t state;
59 struct crystalhd_adp *adp;
60 struct crystalhd_user user[BC_LINK_MAX_OPENS];
61
62 spinlock_t ctx_lock;
63 uint32_t tx_list_id;
64 uint32_t cin_wait_exit;
65 uint32_t pwr_state_change;
66 struct crystalhd_hw hw_ctx;
67};
68
3e4a7b81
AG
69typedef enum BC_STATUS(*crystalhd_cmd_proc)(struct crystalhd_cmd *,
70 struct crystalhd_ioctl_data *);
7963eb43 71
abfc768d 72struct crystalhd_cmd_tbl {
7963eb43
JW
73 uint32_t cmd_id;
74 const crystalhd_cmd_proc cmd_proc;
75 uint32_t block_mon;
abfc768d 76};
7963eb43 77
3e4a7b81
AG
78enum BC_STATUS crystalhd_suspend(struct crystalhd_cmd *ctx,
79 struct crystalhd_ioctl_data *idata);
abfc768d 80enum BC_STATUS crystalhd_resume(struct crystalhd_cmd *ctx);
3e4a7b81
AG
81crystalhd_cmd_proc crystalhd_get_cmd_proc(struct crystalhd_cmd *ctx,
82 uint32_t cmd, struct crystalhd_user *uc);
83enum BC_STATUS crystalhd_user_open(struct crystalhd_cmd *ctx,
84 struct crystalhd_user **user_ctx);
85enum BC_STATUS crystalhd_user_close(struct crystalhd_cmd *ctx,
86 struct crystalhd_user *uc);
87enum BC_STATUS crystalhd_setup_cmd_context(struct crystalhd_cmd *ctx,
88 struct crystalhd_adp *adp);
abfc768d 89enum BC_STATUS crystalhd_delete_cmd_context(struct crystalhd_cmd *ctx);
7963eb43
JW
90bool crystalhd_cmd_interrupt(struct crystalhd_cmd *ctx);
91
92#endif