mitsu70x: Add some FW version sanity checks for EK305 and D70/D707

This is particularly important for the EK305.
This commit is contained in:
Solomon Peachy 2016-12-02 08:51:51 -05:00
parent c1b8f6397c
commit d8b3b600db
1 changed files with 13 additions and 1 deletions

View File

@ -315,12 +315,15 @@ struct mitsu70x_printerstatus_resp {
uint8_t unk[34];
int16_t model[6]; /* LE, UTF-16 */
int16_t serno[6]; /* LE, UTF-16 */
struct mitsu70x_status_ver vers[7]; // components are 'LMFTR??'
struct mitsu70x_status_ver vers[7]; // components are 'MLRTF'
uint8_t null[8];
struct mitsu70x_status_deck lower;
struct mitsu70x_status_deck upper;
} __attribute__((packed));
#define EK305_0104_M_CSUM 0x2878 /* 1.04 316F8 3 2878 */
#define MD70X_0112_M_CSUM 0x9FC3 /* 1.12 316W1 1 9FC3 */
struct mitsu70x_memorystatus_resp {
uint8_t hdr[3]; /* E4 56 33 */
uint8_t memory;
@ -1294,6 +1297,15 @@ top:
mitsu70x_media_types(resp.lower.media_brand, resp.lower.media_type));
ATTR("marker-types=ribbonWax\n");
}
/* FW sanity checking */
if (ctx->type == P_KODAK_305) {
if (be16_to_cpu(resp.vers[0].checksum) != EK305_0104_M_CSUM)
WARNING("Printer FW out of date. Highly recommend upgrading EK305 to v1.04!\n");
} else if (ctx->type == P_MITSU_D70X) {
if (be16_to_cpu(resp.vers[0].checksum) != MD70X_0112_M_CSUM)
WARNING("Printer FW out of date. Highly recommend upgrading D70/D707 to v1.12!\n");
}
skip_status:
/* Perform memory status query */