kodsk6800: Some updates, mostly to internal notes/docs

This commit is contained in:
Solomon Peachy 2016-08-18 21:03:53 -04:00
parent a0c6637dba
commit d6b2ae3d3a
1 changed files with 24 additions and 19 deletions

View File

@ -199,7 +199,7 @@ struct kodak6800_printsize {
uint16_t height; /* BE */
uint8_t type; /* MEDIA_TYPE_* [ ie paper ] */
uint8_t code; /* 00, 01, 02, 03, 04, 05 seen. An index? */
uint8_t code2; /* 00, 01 seen. Seems to be 1 only after a 4x6 printed. */
uint8_t code2; /* 00, 01 seen. Alternates every other 4x6 printed, but only 1 on unknown/1844x2490 print size. */
uint8_t null[2];
} __attribute__((packed));
@ -284,10 +284,10 @@ static void kodak68x0_dump_mediainfo(struct kodak68x0_media_readback *media)
INFO("Legal print sizes:\n");
for (i = 0 ; i < media->count ; i++) {
INFO("\t%d: %dx%d (%02x) %s\n", i,
be16_to_cpu(media->sizes[i].width),
be16_to_cpu(media->sizes[i].height),
media->sizes[i].code,
media->sizes[i].code2? "Disallowed" : "");
be16_to_cpu(media->sizes[i].width),
be16_to_cpu(media->sizes[i].height),
media->sizes[i].code,
media->sizes[i].code2? "Disallowed?" : "");
}
INFO("\n");
}
@ -306,6 +306,7 @@ static int kodak6800_get_mediainfo(struct kodak6800_ctx *ctx, struct kodak68x0_m
req[3] = 0x48;
req[4] = 0x43;
req[5] = 0x1a;
req[6] = 0x00; /* This can be non-zero for additional "banks" */
/* Issue command and get response */
if ((ret = kodak6800_do_cmd(ctx, req, sizeof(req),
@ -667,8 +668,8 @@ static int kodak6800_get_tonecurve(struct kodak6800_ctx *ctx, char *fname)
cmdbuf[8] = 0x4e;
cmdbuf[9] = 0x45;
cmdbuf[10] = 0x72;
cmdbuf[11] = 0x01;
cmdbuf[12] = 0x00;
cmdbuf[11] = 0x01; /* 01 for user tonecurve, can be 00 or 02 */
cmdbuf[12] = 0x00; /* param table? */
cmdbuf[13] = 0x00;
cmdbuf[14] = 0x00;
cmdbuf[15] = 0x00;
@ -783,8 +784,8 @@ static int kodak6800_set_tonecurve(struct kodak6800_ctx *ctx, char *fname)
cmdbuf[8] = 0x4e;
cmdbuf[9] = 0x45;
cmdbuf[10] = 0x77;
cmdbuf[11] = 0x01;
cmdbuf[12] = 0x00;
cmdbuf[11] = 0x01; /* User TC. Can be 00 or 02 */
cmdbuf[12] = 0x00; /* param table? */
cmdbuf[13] = 0x00;
cmdbuf[14] = 0x00;
cmdbuf[15] = 0x00;
@ -882,7 +883,7 @@ static int kodak6800_query_serno(struct libusb_device_handle *dev, uint8_t endp_
return 0;
}
static int kodak6850_send_init(struct kodak6800_ctx *ctx)
static int kodak6850_send_unk(struct kodak6800_ctx *ctx)
{
uint8_t cmdbuf[16];
uint8_t rdbuf[64];
@ -913,12 +914,13 @@ static int kodak6850_send_init(struct kodak6800_ctx *ctx)
return CUPS_BACKEND_FAILED;
}
// XXX I believe this the media position
// saying when we have a 4x6 left on an 8x6 blank
#if 0
// XXX No particular idea what this actually is
if (rdbuf[1] != 0x01 && rdbuf[1] != 0x00) {
ERROR("Unexpected status code (0x%02x)!\n", rdbuf[1]);
return CUPS_BACKEND_FAILED;
}
#endif
return ret;
}
@ -1110,7 +1112,7 @@ static int kodak6800_main_loop(void *vctx, int copies) {
for (num = 0 ; num < ctx->media->count; num++) {
if (ctx->media->sizes[num].height == ctx->hdr.rows &&
ctx->media->sizes[num].width == ctx->hdr.columns &&
ctx->media->sizes[num].code2 == 0x00)
ctx->media->sizes[num].code2 == 0x00) // XXX code2?
break;
}
if (num == ctx->media->count) {
@ -1164,9 +1166,9 @@ static int kodak6800_main_loop(void *vctx, int copies) {
sleep(1);
}
/* This command is unknown, sort of a secondary status query */
if (ctx->type == P_KODAK_6850) {
// INFO("Sending 6850 init sequence\n");
ret = kodak6850_send_init(ctx);
ret = kodak6850_send_unk(ctx);
if (ret)
return ret;
}
@ -1175,6 +1177,7 @@ static int kodak6800_main_loop(void *vctx, int copies) {
#if 0
/* If we want to disable 4x6 rewind on 8x6 media.. */
// XXX not sure about this...?
if (ctx->hdr.size == 0x00 &&
be16_to_cpu(ctx->media->sizes[0].width) == 0x0982) {
ctx->hdr.size = 0x06;
@ -1238,7 +1241,7 @@ static int kodak6800_main_loop(void *vctx, int copies) {
/* Exported */
struct dyesub_backend kodak6800_backend = {
.name = "Kodak 6800/6850",
.version = "0.56",
.version = "0.57",
.uri_prefix = "kodak6800",
.cmdline_usage = kodak6800_cmdline,
.cmdline_arg = kodak6800_cmdline_arg,
@ -1283,12 +1286,14 @@ struct dyesub_backend kodak6800_backend = {
************************************************************************
This command is unique to the 6850:
-> 03 1b 43 48 43 4c 00 00 00 00 00 00 00 00 00 00 [???]
<- [51 octets]
01 01 43 48 43 4c 00 00 00 00 00 00 00 00 00 00
00 00 01 29 00 00 3b 0a 00 00 00 0e 00 03 02 90
00 01 02 1d 03 00 00 00 00 01 00 01 00 00 00 00
01 01 43 48 43 4c 00 00 00 00 00 00 00 00 00 00 <-- Everything after this
00 00 01 29 00 00 3b 0a 00 00 00 0e 00 03 02 90 line is the same as
00 01 02 1d 03 00 00 00 00 01 00 01 00 00 00 00 the "status" resp.
00 00 00
01 00 43 48 43 4c 00 00 00 00 00 00 00 00 00 00