|
@@ -135,11 +135,8 @@ static int cs378x_get_cw(struct camd *c, uint16_t *ca_id, uint16_t *idx, uint8_t
|
135
|
135
|
|
136
|
136
|
READ:
|
137
|
137
|
ret = cs378x_recv(c, data, &data_len);
|
138
|
|
- if (ret < 0) {
|
139
|
|
- ts_LOGf("ERR | No code word has been received (ret = %d)\n", ret);
|
140
|
|
- cs378x_reconnect(c);
|
141
|
|
- return ret;
|
142
|
|
- }
|
|
138
|
+ if (ret < 0) // Fatal error
|
|
139
|
+ return -1;
|
143
|
140
|
|
144
|
141
|
// EMM request, ignore it. Sometimes OSCAM sends two EMM requests after CW
|
145
|
142
|
if (data[0] == 0x05)
|
|
@@ -150,12 +147,6 @@ READ:
|
150
|
147
|
data[0],
|
151
|
148
|
data[0] == 0x08 ? "No card" :
|
152
|
149
|
data[0] == 0x44 ? "No code word found" : "Unknown err");
|
153
|
|
- c->ecm_recv_errors++;
|
154
|
|
- usleep(10000);
|
155
|
|
- if (c->ecm_recv_errors >= ECM_RECV_ERRORS_LIMIT) {
|
156
|
|
- c->key->is_valid_cw = 0;
|
157
|
|
- memset(cw, 0, 16); // Invalid CW
|
158
|
|
- }
|
159
|
150
|
return 0;
|
160
|
151
|
}
|
161
|
152
|
|
|
@@ -173,7 +164,7 @@ READ:
|
173
|
164
|
*idx = (data[16] << 8) | data[17];
|
174
|
165
|
memcpy(cw, data + 20, 16);
|
175
|
166
|
|
176
|
|
- return ret;
|
|
167
|
+ return 1;
|
177
|
168
|
}
|
178
|
169
|
|
179
|
170
|
void camd_proto_cs378x(struct camd_ops *ops) {
|