CAPS Universe documentation  1.0.4
All you need to know to be successful
Data Structures | Functions | Variables
samsung-spl2-series.c File Reference

Shared functions by all SPL2 drivers. More...

Data Structures

struct  ml_printer_name_to_id
 Definition of name-to-ID correlation for Samsung printers. More...
 

Functions

int spl2_driver_module_init (struct caps_drv *drvi, void *d)
 
int spl2_driver_module_exit (struct caps_drv *drvi, void *d)
 
static unsigned par_threads_autodetection (unsigned tcnt)
 
unsigned drv_spl2_par_threads_get (struct caps_drv *drvi)
 
int spl2_driver_runtime_adaptions (struct caps_drv *drvi, void *d)
 
static void spl2_driver_handle_nls (void)
 
int main (int argc, char *argv[])
 
int spl2_driver_page_setup (struct caps_drv *drvi, void *d)
 
int spl2_driver_job_finish (struct caps_drv *drvi, void *d)
 
int spl2_driver_job_setup (struct caps_drv *drvi, void *d)
 
int spl2_driver_page_print (struct caps_drv *drvi, void *d)
 
int spl2_driver_device_monitor (struct caps_drv *drvi, void *d)
 

Variables

static const struct ml_printer_name_to_id supported_printers []
 
const struct caps_generic_driver caps_spl2_driver
 

Detailed Description

Author
Jürgen Borleis
Warning
Use as experimental

Function Documentation

◆ spl2_driver_module_init()

int spl2_driver_module_init ( struct caps_drv drvi,
void *  d 
)
Note
Called after caps_pp_instance_runtime_prepare() did its job

Used to allocate some driver specific memory.

◆ spl2_driver_module_exit()

int spl2_driver_module_exit ( struct caps_drv drvi,
void *  d 
)
Note
Called before termination to clean up memory use

◆ par_threads_autodetection()

static unsigned par_threads_autodetection ( unsigned  tcnt)
static

Autodetect the amount of available CPU cores and adapt the user's setting on demand

Parameters
[in]tcntThread count from the user's setting (can be '0' for autodetection)
Returns
Amount of additional threads to process bands in parallel

It returns always an amount of additional threads. Additional means relative to the main worker thread. This is implementation specific regarding to the index worker helper.

For a single core CPU it behaves differently: for this case always one additional thread is used.

Todo:
move to libcapsdriver!

◆ drv_spl2_par_threads_get()

unsigned drv_spl2_par_threads_get ( struct caps_drv drvi)

Get the amount of additional thread to be used to process indepenent bands

Parameters
[in]drviThe printer instance info
Return values
PositiveAmount of additional threads to use for processing (can be 0)

Since it makes no sense to run more threads than CPU cores are available, limit the number of threads to use here. The calculation is:

  • one thread for the main worker's loop
  • n additional threads up to the available CPU cores
Note
If 'threads' is set to '0', an autodetection is done
If 'threads' isn't set at all, the amount of additional threads is '1'
If 'threads' has an invalid setting, the amount of additional threads is '1'

@TODO in libcapsdriver! Generisch. Mit Doku, wie es pro Drucker zu überschreiben ist.

◆ spl2_driver_runtime_adaptions()

int spl2_driver_runtime_adaptions ( struct caps_drv drvi,
void *  d 
)

◆ spl2_driver_handle_nls()

static void spl2_driver_handle_nls ( void  )
static

◆ main()

int main ( int  argc,
char *  argv[] 
)

◆ spl2_driver_page_setup()

int spl2_driver_page_setup ( struct caps_drv drvi,
void *  d 
)

◆ spl2_driver_job_finish()

int spl2_driver_job_finish ( struct caps_drv drvi,
void *  d 
)

◆ spl2_driver_job_setup()

int spl2_driver_job_setup ( struct caps_drv drvi,
void *  d 
)

◆ spl2_driver_page_print()

int spl2_driver_page_print ( struct caps_drv drvi,
void *  d 
)

◆ spl2_driver_device_monitor()

int spl2_driver_device_monitor ( struct caps_drv drvi,
void *  d 
)

Variable Documentation

◆ supported_printers

const struct ml_printer_name_to_id supported_printers[]
static
Initial value:
= {
{ .printer_name = "ML-1520", .id = CAPS_SPL2_ML_1520, },
{ .printer_name = "ML-1640", .id = CAPS_SPL2_ML_1640, },
{ .printer_name = "ML-2240", .id = CAPS_SPL2_ML_2240, },
{ .printer_name = NULL, },
}
@ CAPS_SPL2_ML_1640
Definition: samsung-spl2-series.h:92
@ CAPS_SPL2_ML_2240
Definition: samsung-spl2-series.h:95
@ CAPS_SPL2_ML_1520
Definition: samsung-spl2-series.h:90

◆ caps_spl2_driver

const struct caps_generic_driver caps_spl2_driver
extern