~ubuntu-branches/ubuntu/saucy/hplip/saucy-proposed

« back to all changes in this revision

Viewing changes to scan/sane/marvell.c

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2012-05-26 11:20:39 UTC
  • mfrom: (1.5.6) (31.1.3 precise)
  • Revision ID: package-import@ubuntu.com-20120526112039-bevxczegxnbyr5m7
Tags: 3.12.4-1
* New upstream release
* Switch to source/format 3.0 (quilt) - drop dpatch
* Refreshed debian/patches
* dh_autoreconf debian/autogen.sh & set local-options single-debian-patch
* Update to debian/compat -> 9
* Fix "hardened build flags" patch from Moritz - thanks (Closes: #667828)
* Fix "duplex descriptor uninitialized" patch from Matej (Closes: #583273)
* Fix "please migrate to kde-runtime" patch from Pino (Closes: #666544)

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
   /* Load hpmud manually with symbols exported. Otherwise the plugin will not find it. */ 
64
64
   if ((ps->hpmud_handle = dlopen("libhpmud.so", RTLD_LAZY|RTLD_GLOBAL)) == NULL)
65
65
   {
66
 
      BUG("unable to load restricted library: %s\n", dlerror());
67
 
      goto bugout;
 
66
      if ((ps->hpmud_handle = dlopen("libhpmud.so.0", RTLD_LAZY|RTLD_GLOBAL)) == NULL)
 
67
      {
 
68
         BUG("unable to load restricted library: %s\n", dlerror());
 
69
         goto bugout;
 
70
      }
68
71
   } 
69
72
 
70
73
   /* Load math library manually with symbols exported (Ubuntu 8.04). Otherwise the plugin will not find it. */ 
397
400
   switch (ma.scantype)
398
401
   {
399
402
      case HPMUD_SCANTYPE_MARVELL:
400
 
         session->version = MARVELL_1;           
 
403
         session->version = MARVELL_1;
401
404
                 break;
402
405
          case HPMUD_SCANTYPE_MARVELL2:
403
 
         session->version = MARVELL_2;          
 
406
         session->version = MARVELL_2;
404
407
                 break;
405
408
          default:
406
409
         session->version = MARVELL_1;
453
456
   i=0;
454
457
   /* Some of the marvell devices supports both flatbed and ADF, No command to get the src types supported */
455
458
   /* Getting from the model file */
456
 
   if ( session->scansrc == HPMUD_SCANSRC_BOTH)
457
 
   {
458
 
         session->input_source_list[i] = STR_ADF_MODE_ADF;
459
 
         session->input_source_map[i++] = IS_ADF;
460
 
         session->input_source_list[i] = STR_ADF_MODE_FLATBED;
461
 
         session->input_source_map[i++] = IS_PLATEN;               
462
 
         DBG8("scan src  HPMUD_SCANSRC_BOTH \n"); 
463
 
   }
464
 
   else if ( session->scansrc == HPMUD_SCANSRC_ADF)
 
459
   if ( session->scansrc & HPMUD_SCANSRC_ADF)
465
460
   {
466
461
         session->input_source_list[i] = STR_ADF_MODE_ADF;
467
462
         session->input_source_map[i++] = IS_ADF;
468
463
         DBG8("scan src  HPMUD_SCANSRC_ADF \n"); 
469
464
   }
470
 
   else if ( session->scansrc == HPMUD_SCANSRC_FLATBED)
 
465
   if ( session->scansrc & HPMUD_SCANSRC_FLATBED)
471
466
   {
472
467
         session->input_source_list[i] = STR_ADF_MODE_FLATBED;
473
 
         session->input_source_map[i++] = IS_PLATEN;               
474
 
         DBG8("scan src  HPMUD_SCANSRC_FLATBED \n"); 
 
468
         session->input_source_map[i++] = IS_PLATEN;
 
469
         DBG8("scan src  HPMUD_SCANSRC_FLATBED \n");
475
470
    }
476
471
    /* Values if un specified in the, value is 0,  get ADF state from the printer */   
477
 
   else if (session->bb_is_paper_in_adf(session) == 2) 
478
 
   {
479
 
      session->input_source_list[i] = STR_ADF_MODE_FLATBED;
480
 
      session->input_source_map[i++] = IS_PLATEN;
481
 
      DBG8("scan src  b_is_paper_in_adf value  2 \n");       
482
 
   }
483
 
   else
484
 
   {
485
 
      session->input_source_list[i] = STR_ADF_MODE_ADF;
486
 
      session->input_source_map[i++] = IS_ADF;
487
 
      DBG8("scan src  b_is_paper_in_adf value not 2 \n");             
488
 
   }
 
472
   if (session->scansrc == HPMUD_SCANSRC_NA)
 
473
   {
 
474
     if (session->bb_is_paper_in_adf(session) == 2) 
 
475
     {
 
476
       session->input_source_list[i] = STR_ADF_MODE_FLATBED;
 
477
       session->input_source_map[i++] = IS_PLATEN;
 
478
       DBG8("scan src  b_is_paper_in_adf value  2 \n");
 
479
     }
 
480
     else
 
481
     {
 
482
       session->input_source_list[i] = STR_ADF_MODE_ADF;
 
483
       session->input_source_map[i++] = IS_ADF;
 
484
       DBG8("scan src  b_is_paper_in_adf value not 2 \n");
 
485
     }
 
486
    }
489
487
 
490
 
      
491
488
   marvell_control_option(session, MARVELL_OPTION_INPUT_SOURCE, SANE_ACTION_SET_AUTO, NULL, NULL); /* set default option */  
492
489
 
493
490
   /* Set supported resolutions. */
848
845
      if (ret == 0)
849
846
      {
850
847
         stat = SANE_STATUS_NO_DOCS;     /* done scanning */
 
848
         SendScanEvent(ps->uri, EVENT_SCAN_ADF_NO_DOCS);
851
849
         goto bugout;
852
850
      }
853
851
      else if (ret < 0)
863
861
      goto bugout;
864
862
   }
865
863
 
 
864
   SendScanEvent(ps->uri, EVENT_START_SCAN_JOB);
866
865
   memset(xforms, 0, sizeof(xforms));    
867
866
 
868
867
   /* Setup image-processing pipeline for xform. */
956
955
   }
957
956
 
958
957
   if (ret & IP_DONE)
 
958
   {
959
959
      stat = SANE_STATUS_EOF;
 
960
      SendScanEvent(ps->uri, EVENT_END_SCAN_JOB);
 
961
   }
960
962
   else
961
963
      stat = SANE_STATUS_GOOD;
962
964
 
973
975
      if (ps->is_user_cancel)
974
976
      {
975
977
          //Don't do anything. sane_hpaio_cancel() will be invoked automatically
 
978
          SendScanEvent(ps->uri, EVENT_SCAN_CANCEL);
 
979
          return SANE_STATUS_CANCELLED;
 
980
 
976
981
       }
977
982
       else 
978
983
           {