|
@@ -51,8 +51,10 @@ static int cs378x_recv(struct camd *c, uint8_t *data, int *data_len) {
|
51
|
51
|
if (r < 4)
|
52
|
52
|
return -1;
|
53
|
53
|
uint32_t auth_token = (((data[0] << 24) | (data[1] << 16) | (data[2]<<8) | data[3]) & 0xffffffffL);
|
54
|
|
- if (auth_token != c->cs378x.auth_token)
|
55
|
|
- ts_LOGf("WARN: recv auth 0x%08x != camd_auth 0x%08x\n", auth_token, c->cs378x.auth_token);
|
|
54
|
+ if (auth_token != c->cs378x.auth_token) {
|
|
55
|
+ ts_LOGf("ERR | [%s] recv auth 0x%08x != camd_auth 0x%08x\n",
|
|
56
|
+ c->ops.ident, auth_token, c->cs378x.auth_token);
|
|
57
|
+ }
|
56
|
58
|
|
57
|
59
|
*data_len = 256;
|
58
|
60
|
for (i = 0; i < *data_len; i += 16) { // Read and decrypt payload
|
|
@@ -143,7 +145,8 @@ READ:
|
143
|
145
|
goto READ;
|
144
|
146
|
|
145
|
147
|
if (data[0] != 0x01) {
|
146
|
|
- ts_LOGf("ERR | Unexpected server response on code word request (ret data[0] == 0x%02x /%s/)\n",
|
|
148
|
+ ts_LOGf("ERR | [%s] Unexpected server response on code word request (ret data[0] == 0x%02x /%s/)\n",
|
|
149
|
+ c->ops.ident,
|
147
|
150
|
data[0],
|
148
|
151
|
data[0] == 0x08 ? "No card" :
|
149
|
152
|
data[0] == 0x44 ? "No code word found" : "Unknown err");
|
|
@@ -151,12 +154,12 @@ READ:
|
151
|
154
|
}
|
152
|
155
|
|
153
|
156
|
if (data_len < 48) {
|
154
|
|
- ts_LOGf("ERR | Code word data_len (%d) mismatch != 48\n", data_len);
|
|
157
|
+ ts_LOGf("ERR | [%s] Code word packet len != 48 (%d)\n", c->ops.ident, data_len);
|
155
|
158
|
return 0;
|
156
|
159
|
}
|
157
|
160
|
|
158
|
161
|
if (data[1] < 0x10) {
|
159
|
|
- ts_LOGf("ERR | Code word len (%d) mismatch != 16\n", data[1]);
|
|
162
|
+ ts_LOGf("ERR | [%s] Code word len != 16 (%d)\n", c->ops.ident, data[1]);
|
160
|
163
|
return 0;
|
161
|
164
|
}
|
162
|
165
|
|