annotate rvinterf/etmsync/pirhackinit.c @ 918:c298d579788e

fc-pirhackinit implemented, compiles
author Space Falcon <falcon@ivan.Harhan.ORG>
date Tue, 08 Sep 2015 19:46:40 +0000
parents
children 7cb0b32f1997
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
918
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
1 /*
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
2 * This fc-pirhackinit utility is highly specific to the TCS211-on-Pirelli
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
3 * exercise. DO NOT run it against Pirelli's stock firmware, nor is it needed
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
4 * when using our full-source FreeCalypso firmware.
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
5 */
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
6
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
7 #include <sys/types.h>
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
8 #include <stdio.h>
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
9 #include <stdlib.h>
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
10 #include <string.h>
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
11 #include <strings.h>
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
12 #include "etm.h"
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
13 #include "ffs.h"
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
14 #include "ffserr.h"
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
15 #include "tmffs2.h"
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
16 #include "localtypes.h"
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
17 #include "exitcodes.h"
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
18
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
19 extern u_char pirelli_imeisv[8];
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
20
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
21 write_pcm_imei()
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
22 {
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
23 static char destfile[] = "/pcm/IMEI";
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
24 u_char swapped[8];
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
25 int i, d1, d2;
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
26
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
27 printf("Writing %s\n", destfile);
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
28 for (i = 0; i < 8; i++) {
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
29 d1 = pirelli_imeisv[i] >> 4;
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
30 d2 = pirelli_imeisv[i] & 0xF;
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
31 swapped[i] = (d2 << 4) | d1;
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
32 }
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
33 return do_short_fwrite(destfile, swapped, 8);
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
34 }
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
35
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
36 read_mem_region(memaddr, databuf, total_bytes)
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
37 u32 memaddr;
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
38 u_char *databuf;
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
39 {
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
40 int chunk, remain, rc;
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
41
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
42 for (remain = total_bytes; remain; remain -= chunk) {
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
43 chunk = remain;
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
44 if (chunk > 240)
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
45 chunk = 240;
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
46 rc = do_memory_read(memaddr, databuf, chunk);
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
47 if (rc)
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
48 return(rc);
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
49 memaddr += chunk;
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
50 databuf += chunk;
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
51 }
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
52 return(0);
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
53 }
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
54
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
55 write_buf_to_file(pathname, data, datalen)
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
56 char *pathname;
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
57 u_char *data;
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
58 {
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
59 int tfd, rc, chunk, remain;
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
60
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
61 if (datalen <= max_short_file_write(pathname))
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
62 return do_short_fwrite(pathname, data, datalen);
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
63 /* do it the long way */
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
64 rc = fd_open(pathname, FFS_O_WRONLY | FFS_O_CREATE | FFS_O_TRUNC, &tfd);
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
65 if (rc)
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
66 return(rc);
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
67 for (remain = datalen; remain; remain -= chunk) {
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
68 chunk = remain;
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
69 if (chunk > 240)
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
70 chunk = 240;
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
71 rc = fd_write(tfd, data, chunk);
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
72 if (rc) {
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
73 fd_close(tfd);
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
74 return(rc);
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
75 }
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
76 data += chunk;
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
77 }
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
78 return fd_close(tfd);
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
79 }
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
80
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
81 copy_calib_record(memaddr, pathname, size)
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
82 u32 memaddr;
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
83 char *pathname;
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
84 int size;
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
85 {
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
86 u_char *buf;
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
87 int rc;
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
88
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
89 buf = malloc(size);
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
90 if (!buf) {
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
91 perror("malloc");
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
92 exit(ERROR_UNIX);
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
93 }
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
94 rc = read_mem_region(memaddr, buf, size);
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
95 if (rc) {
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
96 free(buf);
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
97 return(rc);
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
98 }
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
99 rc = write_buf_to_file(pathname, buf, size);
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
100 free(buf);
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
101 return(rc);
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
102 }
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
103
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
104 static struct calmap {
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
105 u32 offset;
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
106 int size;
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
107 char *ti_equiv;
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
108 } pirelli_cal_map[] = {
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
109 {0x06E5, 36, "/sys/adccal"},
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
110 {0x072B, 512, "/gsm/rf/tx/ramps.900"},
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
111 {0x092C, 128, "/gsm/rf/tx/levels.900"},
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
112 {0x09AD, 128, "/gsm/rf/tx/calchan.900"},
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
113 {0x0A2E, 512, "/gsm/rf/tx/ramps.1800"},
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
114 {0x0C2F, 128, "/gsm/rf/tx/levels.1800"},
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
115 {0x0CB0, 128, "/gsm/rf/tx/calchan.1800"},
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
116 {0x0D31, 512, "/gsm/rf/tx/ramps.1900"},
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
117 {0x0F32, 128, "/gsm/rf/tx/levels.1900"},
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
118 {0x0FB3, 128, "/gsm/rf/tx/calchan.1900"},
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
119 {0x10AF, 40, "/gsm/rf/rx/calchan.900"},
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
120 {0x10D8, 8, "/gsm/rf/rx/agcparams.900"},
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
121 {0x10E1, 40, "/gsm/rf/rx/calchan.1800"},
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
122 {0x110A, 8, "/gsm/rf/rx/agcparams.1800"},
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
123 {0x1113, 40, "/gsm/rf/rx/calchan.1900"},
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
124 {0x113C, 8, "/gsm/rf/rx/agcparams.1900"},
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
125 {0, 0, 0}
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
126 };
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
127
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
128 copy_calib_data()
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
129 {
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
130 struct calmap *tp;
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
131 int rc;
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
132
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
133 printf("Copying calibration records to FFS\n");
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
134 for (tp = pirelli_cal_map; tp->size; tp++) {
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
135 rc = copy_calib_record(0x027F0000 + tp->offset, tp->ti_equiv,
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
136 tp->size);
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
137 if (rc)
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
138 return(rc);
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
139 }
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
140 return(0);
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
141 }
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
142
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
143 single_op_main()
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
144 {
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
145 int rc;
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
146
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
147 rc = get_pirelli_imei();
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
148 if (rc)
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
149 return(rc);
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
150 printf("Creating TCS211 file system directories\n");
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
151 rc = create_std_dirs();
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
152 if (rc)
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
153 return(rc);
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
154 rc = write_pcm_imei();
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
155 if (rc)
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
156 return(rc);
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
157 rc = copy_calib_data();
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
158 if (rc)
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
159 return(rc);
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
160 return set_rfcap("tri900");
c298d579788e fc-pirhackinit implemented, compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
161 }