Lines Matching refs:port

149 static int send_command(struct parport *port, unsigned char *buf, int bufsize,
293 if (send_command(sp->port, command_b, 56, 50000, 1000000))
297 if (send_command(sp->port, cmd_buf_status, 10, 50000, 1000000))
301 sanei_canon_pp_read(sp->port, 6, buffer_info_block);
357 if (sanei_canon_pp_wake_scanner(sp->port, mode))
365 if (sanei_canon_pp_scanner_init(sp->port))
370 if (sanei_canon_pp_scanner_init(sp->port))
380 if (send_command(sp->port, cmd_readid, 10, 10000, 100000))
382 sanei_canon_pp_read(sp->port, 38, (unsigned char *)(sp->id_string));
385 if (send_command(sp->port, cmd_readinfo, 10, 10000, 100000))
387 sanei_canon_pp_read(sp->port, 12, scanner_info);
441 sanei_canon_pp_sleep_scanner(sp->port);
657 if (send_command(sp->port, packet_req_command, 10, 9000, 2000000))
665 if (sanei_canon_pp_read(sp->port, 4, packet_header))
684 if (sanei_canon_pp_read(sp->port, read_data_size, input_buffer))
699 sanei_canon_pp_write(sp->port, 10, packet_req_command);
995 if (send_command(sp->port, command_buffer, 10, 100000, 5000000))
1005 sanei_canon_pp_read(sp->port, scanline_size * scanline_count,
1040 if (send_command(sp->port, cmd_cleargamma, 10, 100000, 5000000))
1053 if (send_command(sp->port, cmd_readgamma, 10, 100000, 10000000))
1063 sanei_canon_pp_read(sp->port, 32, sp->gamma);
1087 if (send_command(sp->port, command_buffer, 10,
1096 sanei_canon_pp_read(sp->port, scanline_size *
1268 sanei_canon_pp_write(sp->port, 10, cmd_abort);
1269 sanei_canon_pp_check_status(sp->port);
1277 if (sanei_canon_pp_write(sp->port, 10, cmd_setgamma))
1279 if (sanei_canon_pp_write(sp->port, 32, sp->gamma))
1285 int sanei_canon_pp_sleep_scanner(struct parport *port)
1288 sanei_canon_pp_write(port, 10, cmd_scanend);
1289 sanei_canon_pp_check_status(port);
1291 ieee1284_terminate(port);
1295 /* expect(port, "Enter Transparent Mode", 0x1f, 0x1f, 1000000); */
1298 int sanei_canon_pp_detect(struct parport *port, int mode)
1302 * the port, quickly and reliably. Fast version of
1310 * PRE: port is open/unclaimed
1311 * POST: port is closed/unclaimed
1314 /* port is already open, just need to claim it */
1316 if (ieee1284_claim(port) != E1284_OK)
1318 DBG(0,"detect: Unable to claim port\n");
1321 if (sanei_canon_pp_wake_scanner(port, mode))
1324 ieee1284_release(port);
1329 sanei_canon_pp_sleep_scanner(port);
1331 ieee1284_release(port);
1332 /* ieee1284_close(port); */
1337 static int send_command(struct parport *port, unsigned char *buf, int bufsize,
1348 if (sanei_canon_pp_write(port, bufsize, buf))
1353 } while (sanei_canon_pp_check_status(port) &&