-
Notifications
You must be signed in to change notification settings - Fork 1
/
vtunerc_priv.h
121 lines (99 loc) · 2.91 KB
/
vtunerc_priv.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
/*
* vtunerc: Internal defines
*
* Copyright (C) 2010-11 Honza Petrous <[email protected]>
* [Created 2010-03-23]
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation version 2.
*
* This program is distributed WITHOUT ANY WARRANTY of any
* kind, whether express or implied; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef _VTUNERC_PRIV_H
#define _VTUNERC_PRIV_H
#include <linux/module.h> /* Specifically, a module */
#include <linux/kernel.h> /* We're doing kernel work */
#include <linux/cdev.h>
#include <linux/version.h>
#include "demux.h"
#include "dmxdev.h"
#include "dvb_demux.h"
#include "dvb_frontend.h"
#include "dvb_net.h"
#include "dvbdev.h"
#include "vtuner.h"
#define MAX_PIDTAB_LEN 30
#define PID_UNKNOWN 0x0FFFF
#define MAX_NUM_VTUNER_MODES 3
struct vtunerc_config {
int debug;
int tscheck;
int devices;
};
struct vtunerc_ctx {
/* DVB api */
struct dmx_frontend hw_frontend;
struct dmx_frontend mem_frontend;
struct dmxdev dmxdev;
struct dmxdev dmxdev1;
struct dmxdev dmxdev2;
struct dvb_adapter dvb_adapter;
struct dvb_demux demux;
struct dvb_frontend *fe;
struct dvb_net dvbnet;
struct dvb_device *ca;
/* internals */
int idx;
char *name;
u8 vtype;
struct dvb_frontend_info *feinfo;
struct vtunerc_config *config;
unsigned short pidtab[MAX_PIDTAB_LEN];
struct semaphore xchange_sem;
struct semaphore ioctl_sem;
struct semaphore tswrite_sem;
int fd_opened;
int closing;
char *procname;
char *kernel_buf;
ssize_t kernel_buf_size;
/* ctrldev */
char trail[188];
unsigned int trailsize;
int noresponse;
int num_modes;
char *ctypes[MAX_NUM_VTUNER_MODES];
struct vtuner_message ctrldev_request;
struct vtuner_message ctrldev_response;
wait_queue_head_t ctrldev_wait_request_wq;
wait_queue_head_t ctrldev_wait_response_wq;
/* proc statistics */
unsigned int stat_wr_data;
unsigned int stat_rd_data;
unsigned int stat_ctrl_sess;
unsigned short pidstat[MAX_PIDTAB_LEN];
};
int vtunerc_register_ctrldev(struct vtunerc_ctx *ctx);
void vtunerc_unregister_ctrldev(struct vtunerc_config *config);
struct vtunerc_ctx *vtunerc_get_ctx(int minor);
int /*__devinit*/ vtunerc_frontend_init(struct vtunerc_ctx *ctx, int vtype);
int /*__devinit*/ vtunerc_frontend_clear(struct vtunerc_ctx *ctx);
int vtunerc_ctrldev_xchange_message(struct vtunerc_ctx *ctx,
struct vtuner_message *msg,
int wait4response);
#define dprintk(ctx, fmt, arg...) do { \
if (ctx->config && (ctx->config->debug)) \
printk(KERN_DEBUG "vtunerc%d: " fmt, ctx->idx, ##arg); \
} while (0)
/* backward compatibility stuff */
#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
static inline void *PDE_DATA(const struct inode *inode)
{
return PROC_I(inode)->pde->data;
}
#endif
#endif