forked from linux-msm/qdl
-
Notifications
You must be signed in to change notification settings - Fork 1
/
qdl.h
49 lines (31 loc) · 1.08 KB
/
qdl.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
#ifndef QDL_H
#define QDL_H
#include <stdbool.h>
#include <stdint.h>
#include "patch.h"
#include "program.h"
#include <libxml/tree.h>
#define MAPPING_SZ 64
struct qdl_device {
int fd;
int in_ep;
int out_ep;
__attribute__((unused)) size_t in_max_pkt_size;
size_t out_max_pkt_size;
size_t multiplier;
char *mappings[MAPPING_SZ]; // array index is the id from the device
uint32_t serial;
uint32_t msm_id_len;
uint8_t *msm_id;
uint32_t pk_hash_len;
uint8_t *pk_hash;
};
int qdl_read(struct qdl_device *ctx, void *buf, size_t len, unsigned int timeout);
int qdl_write(struct qdl_device *ctx, const void *buf, size_t len);
int firehose_run(struct qdl_device *ctx, const char *incdir, const char *storage);
int sahara_run(struct qdl_device *ctx, char *img_arr[], bool single_image);
void print_hex_dump(const char *prefix, const void *buf, size_t len);
unsigned attr_as_unsigned(xmlNode *node, const char *attr, int *errors);
const char *attr_as_string(xmlNode *node, const char *attr, int *errors);
extern bool qdl_debug;
#endif /* QDL_H */