diff --git a/backend_canonselphy.c b/backend_canonselphy.c index 6d06b3d..c5a3913 100644 --- a/backend_canonselphy.c +++ b/backend_canonselphy.c @@ -611,13 +611,14 @@ static void *canonselphy_init(void) extern struct dyesub_backend canonselphy_backend; static int canonselphy_attach(void *vctx, struct libusb_device_handle *dev, int type, - uint8_t endp_up, uint8_t endp_down, uint8_t jobid) + uint8_t endp_up, uint8_t endp_down, int iface, uint8_t jobid) { struct canonselphy_ctx *ctx = vctx; int i, num; uint8_t rdbuf[READBACK_LEN]; UNUSED(jobid); + UNUSED(iface); ctx->dev = dev; ctx->endp_up = endp_up; diff --git a/backend_canonselphyneo.c b/backend_canonselphyneo.c index 75987e9..85047fd 100644 --- a/backend_canonselphyneo.c +++ b/backend_canonselphyneo.c @@ -187,13 +187,14 @@ static void *selphyneo_init(void) extern struct dyesub_backend selphyneo_backend; static int selphyneo_attach(void *vctx, struct libusb_device_handle *dev, int type, - uint8_t endp_up, uint8_t endp_down, uint8_t jobid) + uint8_t endp_up, uint8_t endp_down, int iface, uint8_t jobid) { struct selphyneo_ctx *ctx = vctx; struct selphyneo_readback rdback; int ret, num; UNUSED(jobid); + UNUSED(iface); ctx->dev = dev; ctx->endp_up = endp_up; diff --git a/backend_common.c b/backend_common.c index 0265470..42a74b5 100644 --- a/backend_common.c +++ b/backend_common.c @@ -1239,7 +1239,7 @@ bypass: } /* Attach backend to device */ - if (backend->attach(backend_ctx, dev, printer_type, endp_up, endp_down, jobid)) { + if (backend->attach(backend_ctx, dev, printer_type, endp_up, endp_down, iface, jobid)) { ERROR("Unable to attach to printer!\n"); ret = CUPS_BACKEND_FAILED; goto done_close; diff --git a/backend_common.h b/backend_common.h index f021a04..9567a7a 100644 --- a/backend_common.h +++ b/backend_common.h @@ -209,7 +209,7 @@ struct dyesub_backend { void (*cmdline_usage)(void); /* Optional */ void *(*init)(void); int (*attach)(void *ctx, struct libusb_device_handle *dev, int type, - uint8_t endp_up, uint8_t endp_down, uint8_t jobid); + uint8_t endp_up, uint8_t endp_down, int iface, uint8_t jobid); void (*teardown)(void *ctx); int (*cmdline_arg)(void *ctx, int argc, char **argv); int (*read_parse)(void *ctx, const void **job, int data_fd, int copies); diff --git a/backend_dnpds40.c b/backend_dnpds40.c index 560ff69..307d732 100644 --- a/backend_dnpds40.c +++ b/backend_dnpds40.c @@ -66,6 +66,7 @@ struct dnpds40_ctx { struct libusb_device_handle *dev; uint8_t endp_up; uint8_t endp_down; + int iface; int type; @@ -776,7 +777,7 @@ static int dnpds80dx_query_paper(struct dnpds40_ctx *ctx) } static int dnpds40_attach(void *vctx, struct libusb_device_handle *dev, int type, - uint8_t endp_up, uint8_t endp_down, uint8_t jobid) + uint8_t endp_up, uint8_t endp_down, int iface, uint8_t jobid) { struct dnpds40_ctx *ctx = vctx; @@ -786,6 +787,7 @@ static int dnpds40_attach(void *vctx, struct libusb_device_handle *dev, int type ctx->endp_up = endp_up; ctx->endp_down = endp_down; ctx->type = type; + ctx->iface = iface; if (test_mode < TEST_MODE_NOATTACH) { struct dnpds40_cmd cmd; diff --git a/backend_hiti.c b/backend_hiti.c index 7c06986..aa1b905 100644 --- a/backend_hiti.c +++ b/backend_hiti.c @@ -859,11 +859,13 @@ static void *hiti_init(void) extern struct dyesub_backend hiti_backend; static int hiti_attach(void *vctx, struct libusb_device_handle *dev, int type, - uint8_t endp_up, uint8_t endp_down, uint8_t jobid) + uint8_t endp_up, uint8_t endp_down, int iface, uint8_t jobid) { struct hiti_ctx *ctx = vctx; int ret; + UNUSED(iface); + ctx->dev = dev; ctx->endp_up = endp_up; ctx->endp_down = endp_down; diff --git a/backend_kodak1400.c b/backend_kodak1400.c index 662c2c3..9e995f2 100644 --- a/backend_kodak1400.c +++ b/backend_kodak1400.c @@ -286,11 +286,12 @@ static void *kodak1400_init(void) } static int kodak1400_attach(void *vctx, struct libusb_device_handle *dev, int type, - uint8_t endp_up, uint8_t endp_down, uint8_t jobid) + uint8_t endp_up, uint8_t endp_down, int iface, uint8_t jobid) { struct kodak1400_ctx *ctx = vctx; UNUSED(jobid); + UNUSED(iface); ctx->dev = dev; ctx->endp_up = endp_up; diff --git a/backend_kodak605.c b/backend_kodak605.c index f787dea..63b9296 100644 --- a/backend_kodak605.c +++ b/backend_kodak605.c @@ -358,7 +358,7 @@ static void *kodak605_init(void) } static int kodak605_attach(void *vctx, struct libusb_device_handle *dev, int type, - uint8_t endp_up, uint8_t endp_down, uint8_t jobid) + uint8_t endp_up, uint8_t endp_down, int iface, uint8_t jobid) { struct kodak605_ctx *ctx = vctx; @@ -366,6 +366,7 @@ static int kodak605_attach(void *vctx, struct libusb_device_handle *dev, int typ ctx->dev.endp_up = endp_up; ctx->dev.endp_down = endp_down; ctx->dev.type = type; + ctx->dev.iface = iface; ctx->dev.error_codes = &error_codes; if (ctx->dev.type != P_KODAK_605) { diff --git a/backend_kodak6800.c b/backend_kodak6800.c index 20f7572..b262e9f 100644 --- a/backend_kodak6800.c +++ b/backend_kodak6800.c @@ -678,10 +678,12 @@ static void *kodak6800_init(void) } static int kodak6800_attach(void *vctx, struct libusb_device_handle *dev, int type, - uint8_t endp_up, uint8_t endp_down, uint8_t jobid) + uint8_t endp_up, uint8_t endp_down, int iface, uint8_t jobid) { struct kodak6800_ctx *ctx = vctx; + UNUSED(iface); + ctx->dev = dev; ctx->endp_up = endp_up; ctx->endp_down = endp_down; diff --git a/backend_magicard.c b/backend_magicard.c index b8ac6a0..4a4ba7a 100644 --- a/backend_magicard.c +++ b/backend_magicard.c @@ -437,11 +437,12 @@ static void* magicard_init(void) } static int magicard_attach(void *vctx, struct libusb_device_handle *dev, int type, - uint8_t endp_up, uint8_t endp_down, uint8_t jobid) + uint8_t endp_up, uint8_t endp_down, int iface, uint8_t jobid) { struct magicard_ctx *ctx = vctx; UNUSED(jobid); + UNUSED(iface); ctx->dev = dev; ctx->endp_up = endp_up; diff --git a/backend_mitsu70x.c b/backend_mitsu70x.c index 7553357..801d72b 100644 --- a/backend_mitsu70x.c +++ b/backend_mitsu70x.c @@ -695,10 +695,12 @@ static void *mitsu70x_init(void) } static int mitsu70x_attach(void *vctx, struct libusb_device_handle *dev, int type, - uint8_t endp_up, uint8_t endp_down, uint8_t jobid) + uint8_t endp_up, uint8_t endp_down, int iface, uint8_t jobid) { struct mitsu70x_ctx *ctx = vctx; + UNUSED(iface); + ctx->jobid = jobid; if (!ctx->jobid) jobid++; diff --git a/backend_mitsu9550.c b/backend_mitsu9550.c index 331b93c..e178167 100644 --- a/backend_mitsu9550.c +++ b/backend_mitsu9550.c @@ -424,12 +424,13 @@ static void *mitsu9550_init(void) } static int mitsu9550_attach(void *vctx, struct libusb_device_handle *dev, int type, - uint8_t endp_up, uint8_t endp_down, uint8_t jobid) + uint8_t endp_up, uint8_t endp_down, int iface, uint8_t jobid) { struct mitsu9550_ctx *ctx = vctx; struct mitsu9550_media media; UNUSED(jobid); + UNUSED(iface); ctx->dev = dev; ctx->endp_up = endp_up; diff --git a/backend_mitsud90.c b/backend_mitsud90.c index 70d8abe..0aa8e45 100644 --- a/backend_mitsud90.c +++ b/backend_mitsud90.c @@ -513,12 +513,13 @@ static void *mitsud90_init(void) } static int mitsud90_attach(void *vctx, struct libusb_device_handle *dev, int type, - uint8_t endp_up, uint8_t endp_down, uint8_t jobid) + uint8_t endp_up, uint8_t endp_down, int iface, uint8_t jobid) { struct mitsud90_ctx *ctx = vctx; struct mitsud90_media_resp resp; UNUSED(jobid); + UNUSED(iface); ctx->dev = dev; ctx->endp_up = endp_up; diff --git a/backend_mitsup95d.c b/backend_mitsup95d.c index e1abf02..84155ae 100644 --- a/backend_mitsup95d.c +++ b/backend_mitsup95d.c @@ -131,11 +131,12 @@ static int mitsup95d_get_status(struct mitsup95d_ctx *ctx, uint8_t *resp) } static int mitsup95d_attach(void *vctx, struct libusb_device_handle *dev, int type, - uint8_t endp_up, uint8_t endp_down, uint8_t jobid) + uint8_t endp_up, uint8_t endp_down, int iface, uint8_t jobid) { struct mitsup95d_ctx *ctx = vctx; UNUSED(jobid); + UNUSED(iface); ctx->dev = dev; ctx->endp_up = endp_up; diff --git a/backend_shinkos1245.c b/backend_shinkos1245.c index 1f33fe9..cee40c4 100644 --- a/backend_shinkos1245.c +++ b/backend_shinkos1245.c @@ -941,10 +941,12 @@ static void *shinkos1245_init(void) } static int shinkos1245_attach(void *vctx, struct libusb_device_handle *dev, int type, - uint8_t endp_up, uint8_t endp_down, uint8_t jobid) + uint8_t endp_up, uint8_t endp_down, int iface, uint8_t jobid) { struct shinkos1245_ctx *ctx = vctx; + UNUSED(iface); + ctx->dev = dev; ctx->endp_up = endp_up; ctx->endp_down = endp_down; diff --git a/backend_shinkos2145.c b/backend_shinkos2145.c index f00f87a..367e350 100644 --- a/backend_shinkos2145.c +++ b/backend_shinkos2145.c @@ -831,7 +831,7 @@ static void *shinkos2145_init(void) } static int shinkos2145_attach(void *vctx, struct libusb_device_handle *dev, int type, - uint8_t endp_up, uint8_t endp_down, uint8_t jobid) + uint8_t endp_up, uint8_t endp_down, int iface, uint8_t jobid) { struct shinkos2145_ctx *ctx = vctx; @@ -839,6 +839,7 @@ static int shinkos2145_attach(void *vctx, struct libusb_device_handle *dev, int ctx->dev.endp_up = endp_up; ctx->dev.endp_down = endp_down; ctx->dev.type = type; + ctx->dev.iface = iface; ctx->dev.error_codes = &error_codes; /* Ensure jobid is sane */ diff --git a/backend_shinkos6145.c b/backend_shinkos6145.c index 220c259..5347ca4 100644 --- a/backend_shinkos6145.c +++ b/backend_shinkos6145.c @@ -986,7 +986,7 @@ static void *shinkos6145_init(void) } static int shinkos6145_attach(void *vctx, struct libusb_device_handle *dev, int type, - uint8_t endp_up, uint8_t endp_down, uint8_t jobid) + uint8_t endp_up, uint8_t endp_down, int iface, uint8_t jobid) { struct shinkos6145_ctx *ctx = vctx; @@ -994,6 +994,7 @@ static int shinkos6145_attach(void *vctx, struct libusb_device_handle *dev, int ctx->dev.endp_up = endp_up; ctx->dev.endp_down = endp_down; ctx->dev.type = type; + ctx->dev.iface = iface; ctx->dev.error_codes = &error_codes; if (type == P_SHINKO_S6145 || diff --git a/backend_shinkos6245.c b/backend_shinkos6245.c index 2e351b2..a156c03 100644 --- a/backend_shinkos6245.c +++ b/backend_shinkos6245.c @@ -972,7 +972,7 @@ static void *shinkos6245_init(void) } static int shinkos6245_attach(void *vctx, struct libusb_device_handle *dev, int type, - uint8_t endp_up, uint8_t endp_down, uint8_t jobid) + uint8_t endp_up, uint8_t endp_down, int iface, uint8_t jobid) { struct shinkos6245_ctx *ctx = vctx; @@ -980,6 +980,7 @@ static int shinkos6245_attach(void *vctx, struct libusb_device_handle *dev, int ctx->dev.endp_up = endp_up; ctx->dev.endp_down = endp_down; ctx->dev.type = type; + ctx->dev.iface = iface; if (type == P_KODAK_8810) { ctx->dev.error_codes = &ek8810_error_codes; diff --git a/backend_sinfonia.h b/backend_sinfonia.h index 28ecb2a..2726054 100644 --- a/backend_sinfonia.h +++ b/backend_sinfonia.h @@ -83,6 +83,7 @@ struct sinfonia_usbdev { uint8_t endp_up; uint8_t endp_down; int type; + int iface; const struct sinfonia_param *params; int params_count; diff --git a/backend_sonyupd.c b/backend_sonyupd.c index 7a43fd4..ecc13bb 100644 --- a/backend_sonyupd.c +++ b/backend_sonyupd.c @@ -99,11 +99,12 @@ static void* upd_init(void) } static int upd_attach(void *vctx, struct libusb_device_handle *dev, int type, - uint8_t endp_up, uint8_t endp_down, uint8_t jobid) + uint8_t endp_up, uint8_t endp_down, int iface, uint8_t jobid) { struct upd_ctx *ctx = vctx; UNUSED(jobid); + UNUSED(iface); ctx->dev = dev; ctx->endp_up = endp_up; diff --git a/backend_sonyupdneo.c b/backend_sonyupdneo.c index b94d2d5..d0d653a 100644 --- a/backend_sonyupdneo.c +++ b/backend_sonyupdneo.c @@ -52,6 +52,7 @@ struct updneo_ctx { struct libusb_device_handle *dev; uint8_t endp_up; uint8_t endp_down; + int iface; int type; int native_bpp; @@ -72,7 +73,7 @@ static void* updneo_init(void) } static int updneo_attach(void *vctx, struct libusb_device_handle *dev, int type, - uint8_t endp_up, uint8_t endp_down, uint8_t jobid) + uint8_t endp_up, uint8_t endp_down, int iface, uint8_t jobid) { struct updneo_ctx *ctx = vctx; @@ -82,6 +83,7 @@ static int updneo_attach(void *vctx, struct libusb_device_handle *dev, int type, ctx->endp_up = endp_up; ctx->endp_down = endp_down; ctx->type = type; + ctx->iface = iface; if (ctx->type == P_SONY_UPD898) { ctx->marker.color = "#000000"; /* Ie black! */ @@ -268,8 +270,7 @@ static struct deviceid_dict dict[MAX_DICT]; static int updneo_get_status(struct updneo_ctx *ctx) { - uint8_t iface = 0; // XXX need to extract this. FML. - char *ieee_id = get_device_id(ctx->dev, iface); + char *ieee_id = get_device_id(ctx->dev, ctx->iface); if (!ieee_id) return CUPS_BACKEND_FAILED;