drivers/media/usb/dvb-usb-v2/dvb_usb.h

Source file repositories/reference/linux-study-clean/drivers/media/usb/dvb-usb-v2/dvb_usb.h

File Facts

System
Linux kernel
Corpus path
drivers/media/usb/dvb-usb-v2/dvb_usb.h
Extension
.h
Size
13378 bytes
Lines
418
Domain
Driver Families
Bucket
drivers/media
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct dvb_usb_driver_info {
	const char *name;
	const char *rc_map;
	const struct dvb_usb_device_properties *props;
};

/**
 * struct dvb_usb_rc - structure for remote controller configuration
 * @map_name: name of rc codes table
 * @allowed_protos: protocol(s) supported by the driver
 * @change_protocol: callback to change protocol
 * @query: called to query an event from the device
 * @interval: time in ms between two queries
 * @driver_type: used to point if a device supports raw mode
 * @bulk_mode: device supports bulk mode for rc (disable polling mode)
 * @timeout: set to length of last space before raw IR goes idle
 */
struct dvb_usb_rc {
	const char *map_name;
	u64 allowed_protos;
	int (*change_protocol)(struct rc_dev *dev, u64 *rc_proto);
	int (*query) (struct dvb_usb_device *d);
	unsigned int interval;
	enum rc_driver_type driver_type;
	bool bulk_mode;
	int timeout;
};

/**
 * struct usb_data_stream_properties - usb streaming configuration for adapter
 * @type: urb type
 * @count: count of used urbs
 * @endpoint: stream usb endpoint number
 * @u: union for @bulk and @isoc
 */
struct usb_data_stream_properties {
#define USB_BULK  1
#define USB_ISOC  2
	u8 type;
	u8 count;
	u8 endpoint;

	union {
		struct {
			unsigned int buffersize; /* per URB */
		} bulk;
		struct {
			int framesperurb;
			int framesize;
			int interval;
		} isoc;
	} u;
};

/**
 * struct dvb_usb_adapter_properties - properties of dvb usb device adapter
 * @caps: adapter capabilities
 * @pid_filter_count: pid count of adapter pid-filter
 * @pid_filter_ctrl: called to enable/disable pid-filter
 * @pid_filter: called to set/unset pid for filtering
 * @stream: adapter usb stream configuration
 */
struct dvb_usb_adapter_properties {
#define MAX_NO_OF_FE_PER_ADAP 3
#define DVB_USB_ADAP_HAS_PID_FILTER               0x01
#define DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF 0x02
#define DVB_USB_ADAP_NEED_PID_FILTERING           0x04
	u8 caps;

	u8 pid_filter_count;
	int (*pid_filter_ctrl) (struct dvb_usb_adapter *, int);
	int (*pid_filter) (struct dvb_usb_adapter *, int, u16, int);

	struct usb_data_stream_properties stream;
};

/**
 * struct dvb_usb_device_properties - properties of a dvb-usb-device
 * @driver_name: name of the owning driver module
 * @owner: owner of the dvb_adapter
 * @adapter_nr: values from the DVB_DEFINE_MOD_OPT_ADAPTER_NR() macro
 * @bInterfaceNumber: usb interface number driver binds
 * @size_of_priv: bytes allocated for the driver private data
 * @generic_bulk_ctrl_endpoint: bulk control endpoint number for sent
 * @generic_bulk_ctrl_endpoint_response: bulk control endpoint number for
 *  receive
 * @generic_bulk_ctrl_delay: delay between bulk control sent and receive message
 * @probe: like probe on driver model
 * @disconnect: like disconnect on driver model
 * @identify_state: called to determine the firmware state (cold or warm) and

Annotation

Implementation Notes