-
-
Notifications
You must be signed in to change notification settings - Fork 17
/
nisprog.h
63 lines (48 loc) · 1.76 KB
/
nisprog.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
#ifndef _NISPROG_H
#define _NISPROG_H
#include <stdint.h>
#include "libcli.h"
/* state of connection to ECU */
enum npstate_t {
NP_DISC, /** disconnected */
NP_NORMALCONN, /** normal connection to stock firmware */
NP_NPKCONN /** kernel connection to npkern */
};
extern enum npstate_t npstate;
enum ecutype_t {
NISECU_UNK,
NISECU_7055_35, /** old 350nm part */
NISECU_7055_18, /** 180nm */
NISECU_7058
};
struct nisecu_t {
//enum ecutype_t ecutype; /** decides which flashblock descriptor to use etc */
uint8_t ecuid[6]; /** ASCIIz */
const void *keyset; /** keyset to use */
const void *flashdev; /** device descriptor */
};
extern struct nisecu_t nisecu;
/* public funcs */
void nisecu_cleardata(struct nisecu_t *pne);
/***** CLI command handlers */
enum cli_retval cmd_npconn(int argc, char **argv);
enum cli_retval cmd_npdisc(int argc, char **argv);
enum cli_retval cmd_npconf(int argc, char **argv);
enum cli_retval cmd_setdev(int argc, char **argv);
enum cli_retval cmd_guesskey(int argc, char **argv);
enum cli_retval cmd_setkeys(int argc, char **argv);
enum cli_retval cmd_kspeed(int argc, char **argv);
enum cli_retval cmd_runkernel(int argc, char **argv);
enum cli_retval cmd_stopkernel(int argc, char **argv);
enum cli_retval cmd_writevin(int argc, char** argv);
enum cli_retval cmd_initk(int argc, char **argv);
enum cli_retval cmd_dumpmem(int argc, char **argv);
enum cli_retval cmd_watch(int argc, char **argv);
enum cli_retval cmd_flverif(int argc, char **argv);
enum cli_retval cmd_flblock(int argc, char **argv);
enum cli_retval cmd_flrom(int argc, char **argv);
enum cli_retval cmd_npt(int argc, char **argv);
// Subaru specific commands
enum cli_retval cmd_spconn(int argc, char **argv);
enum cli_retval cmd_sprunkernel(int argc, char **argv);
#endif