blob: b70efe33df7e28e04680643a0b3319824bf4ad26 [file] [log] [blame]
Shalabh Jain1c99e4c2012-03-26 18:47:59 -07001/* Copyright (c) 2012, Code Aurora Forum. All rights reserved.
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 */
12#ifndef DIAG_DCI_H
13#define DIAG_DCI_H
14#define MAX_DCI_CLIENT 10
15#define DCI_CMD_CODE 0x93
16
17extern unsigned int dci_max_reg;
18extern unsigned int dci_max_clients;
19struct diag_dci_tbl {
20 int pid;
21 int uid;
22 int tag;
23};
24
Shalabh Jain5e9a92b2012-06-07 21:53:49 -070025struct dci_notification_tbl {
26 struct task_struct *client;
27 uint16_t list; /* bit mask */
28 int signal_type;
29};
30
Shalabh Jain1c99e4c2012-03-26 18:47:59 -070031enum {
32 DIAG_DCI_NO_ERROR = 1001, /* No error */
33 DIAG_DCI_NO_REG, /* Could not register */
34 DIAG_DCI_NO_MEM, /* Failed memory allocation */
35 DIAG_DCI_NOT_SUPPORTED, /* This particular client is not supported */
36 DIAG_DCI_HUGE_PACKET, /* Request/Response Packet too huge */
37 DIAG_DCI_SEND_DATA_FAIL,/* writing to kernel or peripheral fails */
38 DIAG_DCI_TABLE_ERR /* Error dealing with registration tables */
39};
40
41int diag_dci_init(void);
42void diag_dci_exit(void);
43void diag_read_smd_dci_work_fn(struct work_struct *);
44int diag_process_dci_client(unsigned char *buf, int len);
45int diag_send_dci_pkt(struct diag_master_table entry, unsigned char *buf,
46 int len, int index);
47#endif