All pastes #69753 Raw Edit

Miscellany

public text v1 · immutable
#69753 ·published 2006-06-23 12:01 UTC
rendered paste body

enum dvbfe_sec_config_type {
	DVBFE_SEC_CONFIG_NONE = 0,
	DVBFE_SEC_CONFIG_SIMPLE,
	DVBFE_SEC_CONFIG_ADVANCED,
};

struct dvbfe_sec_config
{
	uint32_t lof; /* frequency to subtract */

	/**
	 * The SEC command used depends on the type:
	 *
	 * NONE - no SEC commands will be issued.
	 * 
	 * SIMPLE - the standard DISEQC back compatable sequence is used -
	 * lo_hi+polarisation+sat_pos switch must be supplied.
	 *
	 * ADVANCED - an SEC string is supplied by the user describing the exact sequence
	 * of operations to use.
	 */
	enum dvbfe_sec_config_type type;
	union {
		struct {
			enum dvbfe_diseqc_oscillator lo_hi;
			enum dvbfe_diseqc_polarisation polarisation;
			enum dvbfe_diseqc_switch sat_pos;
		} simple;				/* DVBFE_SEC_CONFIG_SIMPLE */

		char advanced_cmd[256];			/* DVBFE_SEC_CONFIG_ADVANCED */
	} sec;
};

/**
 * Helper function for tuning adapters with SEC support. This function will do
 * everything required, including frequency adjustment based on the parameters
 * in sec_config.
 *
 * Note: Since the SEC configuration structure can be set to disable any SEC
 * operations, this function can be reused for ALL DVB style devices (just
 * set LOF=0,type=DVBFE_SEC_CONFIG_NONE for devices which do not require
 * SEC control).
 *
 * @param fe Frontend concerned.
 * @param sec_config SEC configuration structure.
 * @param params Tuning parameters.
 * @param timeout <0 => wait forever for lock. 0=>return immediately, >0=>
 * number of milliseconds to wait for a lock.
 * @return 0 on locked (or if timeout==0 and everything else worked), or
 * nonzero on failure (including no lock).
 */
extern int dvbfe_sec_set(struct dvbfe_handle *fe,
			  struct dvbfe_sec_config *sec_config,
			  struct dvbfe_parameters *params,
			  int timeout);