blob: bac572a8bc2e164553cf2046421d5681905b07e1 [file] [log] [blame]
Jarod Wilson7963eb42010-01-04 18:02:27 -05001/***************************************************************************
2 * Copyright (c) 2005-2009, Broadcom Corporation.
3 *
Jorgyano Vieira01c32072012-02-25 21:58:21 -02004 * Name: crystalhd_lnx . h
Jarod Wilson7963eb42010-01-04 18:02:27 -05005 *
6 * Description:
7 * BCM70012 Linux driver
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_LNX_H_
28#define _CRYSTALHD_LNX_H_
29
30#include <linux/module.h>
31#include <linux/kernel.h>
32#include <linux/errno.h>
33#include <linux/string.h>
34#include <linux/mm.h>
35#include <linux/tty.h>
36#include <linux/slab.h>
37#include <linux/delay.h>
38#include <linux/fb.h>
39#include <linux/pci.h>
40#include <linux/init.h>
41#include <linux/interrupt.h>
42#include <linux/pagemap.h>
Dave Airlie5fe68012010-01-20 17:29:10 -050043#include <linux/vmalloc.h>
Jarod Wilson7963eb42010-01-04 18:02:27 -050044
Lars Lindley641b63f2010-03-11 00:21:20 +010045#include <linux/io.h>
Jarod Wilson7963eb42010-01-04 18:02:27 -050046#include <asm/irq.h>
47#include <asm/pgtable.h>
Lars Lindley641b63f2010-03-11 00:21:20 +010048#include <linux/uaccess.h>
Jarod Wilson7963eb42010-01-04 18:02:27 -050049
Jorgyano Vieira01c32072012-02-25 21:58:21 -020050#include "crystalhd.h"
Jarod Wilson7963eb42010-01-04 18:02:27 -050051
52#define CRYSTAL_HD_NAME "Broadcom Crystal HD Decoder (BCM70012) Driver"
53
Jarod Wilson7963eb42010-01-04 18:02:27 -050054/* OS specific PCI information structure and adapter information. */
55struct crystalhd_adp {
56 /* Hardware borad/PCI specifics */
57 char name[32];
58 struct pci_dev *pdev;
59
60 unsigned long pci_mem_start;
61 uint32_t pci_mem_len;
62 void *addr;
63
64 unsigned long pci_i2o_start;
65 uint32_t pci_i2o_len;
66 void *i2o_addr;
67
68 unsigned int drv_data;
69 unsigned int dmabits; /* 32 | 64 */
70 unsigned int registered;
71 unsigned int present;
72 unsigned int msi;
73
74 spinlock_t lock;
75
76 /* API Related */
Vasiliy Kulikovcae16a12010-09-12 22:56:51 +040077 int chd_dec_major;
Jarod Wilson7963eb42010-01-04 18:02:27 -050078 unsigned int cfg_users;
79
Amarjargal Gundjalam9ebee9d2013-05-12 20:43:09 -070080 struct crystalhd_ioctl_data *idata_free_head; /* ioctl data pool */
81 struct crystalhd_elem *elem_pool_head; /* Queue element pool */
Jarod Wilson7963eb42010-01-04 18:02:27 -050082
83 struct crystalhd_cmd cmds;
84
Lior Dotanabfc7682010-05-18 12:46:42 +030085 struct crystalhd_dio_req *ua_map_free_head;
Jarod Wilson7963eb42010-01-04 18:02:27 -050086 struct pci_pool *fill_byte_pool;
87};
88
89
90struct crystalhd_adp *chd_get_adp(void);
91void chd_set_log_level(struct crystalhd_adp *adp, char *arg);
92
93#endif
94