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

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

File Facts

System
Linux kernel
Corpus path
drivers/media/usb/dvb-usb/dvb-usb.h
Extension
.h
Size
16250 bytes
Lines
528
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_device_description {
	const char *name;

#define DVB_USB_ID_MAX_NUM 15
	const struct usb_device_id *cold_ids[DVB_USB_ID_MAX_NUM];
	const struct usb_device_id *warm_ids[DVB_USB_ID_MAX_NUM];
};

static inline u8 rc5_custom(struct rc_map_table *key)
{
	return (key->scancode >> 8) & 0xff;
}

static inline u8 rc5_data(struct rc_map_table *key)
{
	return key->scancode & 0xff;
}

static inline u16 rc5_scan(struct rc_map_table *key)
{
	return key->scancode & 0xffff;
}

struct dvb_usb_device;
struct dvb_usb_adapter;
struct usb_data_stream;

/*
 * Properties of USB streaming - TODO this structure should be somewhere else
 * describes the kind of USB transfer used for data-streaming.
 *  (BULK or ISOC)
 */
struct usb_data_stream_properties {
#define USB_BULK  1
#define USB_ISOC  2
	int type;
	int count;
	int endpoint;

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

/**
 * struct dvb_usb_adapter_fe_properties - properties of a dvb-usb-adapter.
 *    A DVB-USB-Adapter is basically a dvb_adapter which is present on a USB-device.
 * @caps: capabilities of the DVB USB device.
 * @pid_filter_count: number of PID filter position in the optional hardware
 *  PID-filter.
 * @streaming_ctrl: called to start and stop the MPEG2-TS streaming of the
 *  device (not URB submitting/killing).
 *  This callback will be called without data URBs being active - data URBs
 *  will be submitted only after streaming_ctrl(1) returns successfully and
 *  they will be killed before streaming_ctrl(0) gets called.
 * @pid_filter_ctrl: called to en/disable the PID filter, if any.
 * @pid_filter: called to set/unset a PID for filtering.
 * @frontend_attach: called to attach the possible frontends (fill fe-field
 *  of struct dvb_usb_device).
 * @tuner_attach: called to attach the correct tuner and to fill pll_addr,
 *  pll_desc and pll_init_buf of struct dvb_usb_device).
 * @stream: configuration of the USB streaming
 * @size_of_priv: size of the priv memory in struct dvb_usb_adapter
 */
struct dvb_usb_adapter_fe_properties {
#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
#define DVB_USB_ADAP_RECEIVES_204_BYTE_TS         0x08
#define DVB_USB_ADAP_RECEIVES_RAW_PAYLOAD         0x10
	int caps;
	int pid_filter_count;

	int (*streaming_ctrl)  (struct dvb_usb_adapter *, int);
	int (*pid_filter_ctrl) (struct dvb_usb_adapter *, int);
	int (*pid_filter)      (struct dvb_usb_adapter *, int, u16, int);

	int (*frontend_attach) (struct dvb_usb_adapter *);
	int (*tuner_attach)    (struct dvb_usb_adapter *);

	struct usb_data_stream_properties stream;

	int size_of_priv;

Annotation

Implementation Notes