Factor out common code
[dvblast.git] / comm.h
blob43f5c441286d43de91a66218fdbe880ac5a296f3
1 /*****************************************************************************
2 * comm.h
3 *****************************************************************************
4 * Copyright (C) 2008 VideoLAN
6 * Authors: Christophe Massiot <massiot@via.ecp.fr>
8 * This program is free software. It comes without any warranty, to
9 * the extent permitted by applicable law. You can redistribute it
10 * and/or modify it under the terms of the Do What The Fuck You Want
11 * To Public License, Version 2, as published by Sam Hocevar. See
12 * http://sam.zoy.org/wtfpl/COPYING for more details.
13 *****************************************************************************/
15 /* DVB Card Drivers */
16 #include <linux/dvb/version.h>
17 #include <linux/dvb/dmx.h>
18 #include <linux/dvb/frontend.h>
19 #include <linux/dvb/ca.h>
21 #include <bitstream/mpeg/psi.h>
23 #define COMM_HEADER_SIZE 8
24 #define COMM_BUFFER_SIZE (COMM_HEADER_SIZE + ((PSI_PRIVATE_MAX_SIZE + PSI_HEADER_SIZE) * (PSI_TABLE_MAX_SECTIONS / 2)))
25 #define COMM_HEADER_MAGIC 0x49
27 #define COMM_MAX_MSG_CHUNK 65535
29 typedef enum {
30 CMD_INVALID = 0,
31 CMD_RELOAD = 1,
32 CMD_SHUTDOWN = 2,
33 CMD_FRONTEND_STATUS = 3,
34 CMD_MMI_STATUS = 4,
35 CMD_MMI_SLOT_STATUS = 5, /* arg: slot */
36 CMD_MMI_OPEN = 6, /* arg: slot */
37 CMD_MMI_CLOSE = 7, /* arg: slot */
38 CMD_MMI_RECV = 8, /* arg: slot */
39 CMD_GET_PAT = 10,
40 CMD_GET_CAT = 11,
41 CMD_GET_NIT = 12,
42 CMD_GET_SDT = 13,
43 CMD_GET_PMT = 14, /* arg: service_id (uint16_t) */
44 CMD_GET_PIDS = 15,
45 CMD_GET_PID = 16, /* arg: pid (uint16_t) */
46 CMD_MMI_SEND_TEXT = 17, /* arg: slot, en50221_mmi_object_t */
47 CMD_MMI_SEND_CHOICE = 18, /* arg: slot, en50221_mmi_object_t */
48 } ctl_cmd_t;
50 typedef enum {
51 RET_OK = 0,
52 RET_ERR = 1,
53 RET_FRONTEND_STATUS = 2,
54 RET_MMI_STATUS = 3,
55 RET_MMI_SLOT_STATUS = 4,
56 RET_MMI_RECV = 5,
57 RET_MMI_WAIT = 6,
58 RET_NODATA = 7,
59 RET_PAT = 8,
60 RET_CAT = 9,
61 RET_NIT = 10,
62 RET_SDT = 11,
63 RET_PMT = 12,
64 RET_PIDS = 13,
65 RET_PID = 14,
66 RET_HUH = 255,
67 } ctl_cmd_answer_t;
69 struct ret_frontend_status
71 struct dvb_frontend_info info;
72 fe_status_t i_status;
73 int32_t i_ber, i_strength, i_snr;
76 struct ret_mmi_status
78 ca_caps_t caps;
81 struct ret_mmi_slot_status
83 ca_slot_info_t sinfo;
86 struct ret_mmi_recv
88 en50221_mmi_object_t object;
91 struct cmd_mmi_send
93 uint8_t i_slot;
94 en50221_mmi_object_t object;
97 struct cmd_pid_info
99 ts_pid_info_t pids[MAX_PIDS];