comparison rvinterf/etmsync/fileio.c @ 289:244f08f58e51

fc-fsio: error decoding implemented
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Fri, 28 Feb 2014 23:12:52 +0000
parents 146e7bf3fa4e
children 69e8ae2b5ba2
comparison
equal deleted inserted replaced
288:e33d71e9033f 289:244f08f58e51
39 *dp++ = flags; 39 *dp++ = flags;
40 rc = etm_pkt_exch(cmdpkt, dp - cmdpkt - 1); 40 rc = etm_pkt_exch(cmdpkt, dp - cmdpkt - 1);
41 if (rc) 41 if (rc)
42 return(rc); 42 return(rc);
43 if (rvi_msg[3]) { 43 if (rvi_msg[3]) {
44 printf("open fd: FFS error %d\n", rvi_msg[3]); 44 report_ffs_err("open fd", rvi_msg[3]);
45 return(ERROR_TARGET); 45 return(ERROR_TARGET);
46 } 46 }
47 if (rvi_msg_len != 6) { 47 if (rvi_msg_len != 6) {
48 printf("error: open fd response has wrong length\n"); 48 printf("error: open fd response has wrong length\n");
49 return(ERROR_TARGET); 49 return(ERROR_TARGET);
70 cmdpkt[4] = rdsize; 70 cmdpkt[4] = rdsize;
71 rc = etm_pkt_exch(cmdpkt, 4); 71 rc = etm_pkt_exch(cmdpkt, 4);
72 if (rc) 72 if (rc)
73 return(rc); 73 return(rc);
74 if (rvi_msg[3]) { 74 if (rvi_msg[3]) {
75 printf("read fd: FFS error %d\n", rvi_msg[3]); 75 report_ffs_err("read fd", rvi_msg[3]);
76 return(ERROR_TARGET); 76 return(ERROR_TARGET);
77 } 77 }
78 if (rvi_msg_len < 6) { 78 if (rvi_msg_len < 6) {
79 *rdret = 0; 79 *rdret = 0;
80 return(0); 80 return(0);
99 cmdpkt[3] = fd; 99 cmdpkt[3] = fd;
100 rc = etm_pkt_exch(cmdpkt, 3); 100 rc = etm_pkt_exch(cmdpkt, 3);
101 if (rc) 101 if (rc)
102 return(rc); 102 return(rc);
103 if (rvi_msg[3]) { 103 if (rvi_msg[3]) {
104 printf("close fd: FFS error %d\n", rvi_msg[3]); 104 report_ffs_err("close fd", rvi_msg[3]);
105 return(ERROR_TARGET); 105 return(ERROR_TARGET);
106 } 106 }
107 if (rvi_msg_len != 5) { 107 if (rvi_msg_len != 5) {
108 printf("error: close fd response has wrong length\n"); 108 printf("error: close fd response has wrong length\n");
109 return(ERROR_TARGET); 109 return(ERROR_TARGET);
138 *dp++ = rdsize; 138 *dp++ = rdsize;
139 rc = etm_pkt_exch(cmdpkt, dp - cmdpkt - 1); 139 rc = etm_pkt_exch(cmdpkt, dp - cmdpkt - 1);
140 if (rc) 140 if (rc)
141 return(rc); 141 return(rc);
142 if (rvi_msg[3]) { 142 if (rvi_msg[3]) {
143 printf("read file: FFS error %d\n", rvi_msg[3]); 143 report_ffs_err("read file", rvi_msg[3]);
144 return(ERROR_TARGET); 144 return(ERROR_TARGET);
145 } 145 }
146 if (rvi_msg_len < 6) { 146 if (rvi_msg_len < 6) {
147 *rdret = 0; 147 *rdret = 0;
148 return(0); 148 return(0);