Lines Matching defs:scanner

2  *  @brief SANE backend for Plustek parallelport scanner
299 static pModeParam getModeList( Plustek_Scanner *scanner )
303 if((_ASIC_IS_98003 == scanner->hw->caps.AsicID) ||
304 (_ASIC_IS_98001 == scanner->hw->caps.AsicID)) {
313 if( 0 != scanner->val[OPT_EXT_MODE].w ) {
322 static SANE_Status close_pipe( Plustek_Scanner *scanner )
324 if( scanner->r_pipe >= 0 ) {
327 close( scanner->r_pipe );
328 scanner->r_pipe = -1;
330 if( scanner->w_pipe >= 0 ) {
333 close( scanner->w_pipe );
334 scanner->w_pipe = -1;
371 Plustek_Scanner *scanner = (Plustek_Scanner *)args;
375 close( scanner->r_pipe );
376 scanner->r_pipe = -1;
398 data_length = scanner->params.lines * scanner->params.bytes_per_line;
402 DBG( _DBG_PROC, "buf = 0x%08lx\n", (unsigned long)scanner->buf );
404 if( NULL == scanner->buf ) {
410 if( scanner->hw->readImage ) {
412 status = (unsigned long)scanner->hw->readImage( scanner->hw,
413 scanner->buf, data_length);
416 unsigned char *buf = scanner->buf;
419 status = scanner->hw->prepare( scanner->hw, buf );
423 for( line = 0; line < scanner->params.lines; line++ ) {
425 status = scanner->hw->readLine( scanner->hw );
430 write( scanner->w_pipe, buf, scanner->params.bytes_per_line );
432 buf += scanner->params.bytes_per_line;
451 if( scanner->hw->readImage ) {
453 write( scanner->w_pipe, scanner->buf, status );
462 static SANE_Status do_cancel( Plustek_Scanner *scanner, SANE_Bool closepipe )
470 scanner->scanning = SANE_FALSE;
472 if( sanei_thread_is_valid( scanner->reader_pid )) {
477 if( -1 != scanner->hw->fd ) {
479 scanner->hw->stopScan( scanner->hw, &int_cnt );
489 sanei_thread_kill( scanner->reader_pid );
493 res = sanei_thread_waitpid( scanner->reader_pid, 0 );
496 if( res != scanner->reader_pid ) {
501 sanei_thread_kill( scanner->reader_pid );
503 sanei_thread_sendsig( scanner->reader_pid, SIGKILL );
507 sanei_thread_invalidate( scanner->reader_pid );
512 close_pipe( scanner );
515 drvclose( scanner->hw );
560 * @param s - pointer to the scanner specific structure
616 * @param s - pointer to the scanner specific structure
1012 dev->sane.type = SANE_I18N ("flatbed scanner");
1029 * go ahead and open the scanner device
1056 DBG( _DBG_ERROR, "failed to find Plustek scanner\n" );
1817 * open the driver and get some information about the scanner
1845 DBG( _DBG_ERROR, "failed to find Plustek scanner\n" );
1850 /* All ready to go. Set image def and see what the scanner