summaryrefslogtreecommitdiff
path: root/drivers/media/dvb/dvb-usb/dvb_usb.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb/dvb-usb/dvb_usb.h')
-rw-r--r--drivers/media/dvb/dvb-usb/dvb_usb.h111
1 files changed, 52 insertions, 59 deletions
diff --git a/drivers/media/dvb/dvb-usb/dvb_usb.h b/drivers/media/dvb/dvb-usb/dvb_usb.h
index a87a9ff579c4..56bf3a7f085b 100644
--- a/drivers/media/dvb/dvb-usb/dvb_usb.h
+++ b/drivers/media/dvb/dvb-usb/dvb_usb.h
@@ -10,10 +10,8 @@
#ifndef DVB_USB_H
#define DVB_USB_H
-#include <linux/input.h>
-#include <linux/usb.h>
+#include <linux/usb/input.h>
#include <linux/firmware.h>
-#include <linux/mutex.h>
#include <media/rc-core.h>
#include "dvb_frontend.h"
@@ -65,15 +63,35 @@
.rc_map = (rc), \
})
+struct dvb_usb_device;
+struct dvb_usb_adapter;
+
struct dvb_usb_driver_info {
const char *name;
const char *rc_map;
const struct dvb_usb_device_properties *props;
};
-struct dvb_usb_device;
-struct dvb_usb_adapter;
-struct usb_data_stream;
+/**
+ * struct dvb_rc properties of remote controller, using rc-core
+ * @rc_codes: name of rc codes table
+ * @protocol: type of protocol(s) currently used by the driver
+ * @allowed_protos: protocol(s) supported by the driver
+ * @driver_type: Used to point if a device supports raw mode
+ * @change_protocol: callback to change protocol
+ * @rc_query: called to query an event event.
+ * @rc_interval: time in ms between two queries.
+ * @bulk_mode: device supports bulk mode for RC (disable polling mode)
+ */
+struct dvb_usb_rc {
+ char *map_name;
+ u64 allowed_protos;
+ int (*change_protocol)(struct rc_dev *dev, u64 rc_type);
+ int (*query) (struct dvb_usb_device *d);
+ unsigned int interval;
+ const enum rc_driver_type driver_type;
+ bool bulk_mode;
+};
/**
* Properties of USB streaming - TODO this structure should be somewhere else
@@ -83,13 +101,13 @@ struct usb_data_stream;
struct usb_data_stream_properties {
#define USB_BULK 1
#define USB_ISOC 2
- int type;
- int count;
- int endpoint;
+ u8 type;
+ u8 count;
+ u8 endpoint;
union {
struct {
- int buffersize; /* per URB */
+ unsigned int buffersize; /* per URB */
} bulk;
struct {
int framesperurb;
@@ -124,10 +142,9 @@ struct dvb_usb_adapter_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
- int caps;
- int size_of_priv;
+ u8 caps;
- int pid_filter_count;
+ u8 pid_filter_count;
int (*pid_filter_ctrl) (struct dvb_usb_adapter *, int);
int (*pid_filter) (struct dvb_usb_adapter *, int, u16, int);
@@ -135,27 +152,6 @@ struct dvb_usb_adapter_properties {
};
/**
- * struct dvb_rc properties of remote controller, using rc-core
- * @rc_codes: name of rc codes table
- * @protocol: type of protocol(s) currently used by the driver
- * @allowed_protos: protocol(s) supported by the driver
- * @driver_type: Used to point if a device supports raw mode
- * @change_protocol: callback to change protocol
- * @rc_query: called to query an event event.
- * @rc_interval: time in ms between two queries.
- * @bulk_mode: device supports bulk mode for RC (disable polling mode)
- */
-struct dvb_usb_rc {
- char *map_name;
- u64 allowed_protos;
- int (*change_protocol)(struct rc_dev *dev, u64 rc_type);
- int (*query) (struct dvb_usb_device *d);
- int interval;
- const enum rc_driver_type driver_type;
- bool bulk_mode;
-};
-
-/**
* struct dvb_usb_device_properties - properties of a dvb-usb-device
* @owner: owner of the dvb_adapter
* @usb_ctrl: which USB device-side controller is in use. Needed for firmware
@@ -196,8 +192,11 @@ struct dvb_usb_device_properties {
const char *driver_name;
struct module *owner;
short *adapter_nr;
+
u8 bInterfaceNumber;
- int size_of_priv;
+ unsigned int size_of_priv;
+ u8 generic_bulk_ctrl_endpoint;
+ u8 generic_bulk_ctrl_endpoint_response;
#define WARM 0
#define COLD 1
@@ -207,11 +206,12 @@ struct dvb_usb_device_properties {
int (*download_firmware) (struct dvb_usb_device *,
const struct firmware *);
- int num_adapters;
- int (*get_adapter_count) (struct dvb_usb_device *);
- struct dvb_usb_adapter_properties adapter[MAX_NO_OF_ADAPTER_PER_DEVICE];
+ struct i2c_algorithm *i2c_algo;
- int (*power_ctrl) (struct dvb_usb_device *, int);
+ unsigned int num_adapters;
+ struct dvb_usb_adapter_properties adapter[MAX_NO_OF_ADAPTER_PER_DEVICE];
+ int (*get_adapter_count) (struct dvb_usb_device *);
+ int (*power_ctrl) (struct dvb_usb_device *, int);
int (*read_config) (struct dvb_usb_device *d);
int (*read_mac_address) (struct dvb_usb_adapter *, u8 []);
int (*frontend_attach) (struct dvb_usb_adapter *);
@@ -221,18 +221,13 @@ struct dvb_usb_device_properties {
int (*fe_ioctl_override) (struct dvb_frontend *,
unsigned int, void *, unsigned int);
int (*init) (struct dvb_usb_device *);
- void (*disconnect) (struct dvb_usb_device *);
+ void (*exit) (struct dvb_usb_device *);
int (*get_rc_config) (struct dvb_usb_device *, struct dvb_usb_rc *);
#define DVB_USB_FE_TS_TYPE_188 0
#define DVB_USB_FE_TS_TYPE_204 1
#define DVB_USB_FE_TS_TYPE_RAW 2
int (*get_stream_config) (struct dvb_frontend *, u8 *,
struct usb_data_stream_properties *);
-
- struct i2c_algorithm *i2c_algo;
-
- int generic_bulk_ctrl_endpoint;
- int generic_bulk_ctrl_endpoint_response;
};
/**
@@ -247,12 +242,12 @@ struct dvb_usb_device_properties {
*/
#define MAX_NO_URBS_FOR_DATA_STREAM 10
struct usb_data_stream {
- struct usb_device *udev;
- struct usb_data_stream_properties props;
+ struct usb_device *udev;
+ struct usb_data_stream_properties props;
#define USB_STATE_INIT 0x00
#define USB_STATE_URB_BUF 0x01
- int state;
+ u8 state;
void (*complete) (struct usb_data_stream *, u8 *, size_t);
@@ -297,26 +292,23 @@ struct usb_data_stream {
struct dvb_usb_adapter {
const struct dvb_usb_adapter_properties *props;
struct usb_data_stream stream;
- u8 id;
+ u8 id;
u8 ts_type;
- int pid_filtering;
- int feed_count;
- int max_feed_count;
-
- /* sync frontend and streaming as those are different tasks */
- struct mutex sync_mutex;
+ bool pid_filtering;
+ u8 feed_count;
+ u8 max_feed_count;
+ s8 active_fe;
/* dvb */
struct dvb_adapter dvb_adap;
struct dmxdev dmxdev;
struct dvb_demux demux;
struct dvb_net dvb_net;
+ struct mutex sync_mutex;
struct dvb_frontend *fe[MAX_NO_OF_FE_PER_ADAP];
int (*fe_init[MAX_NO_OF_FE_PER_ADAP]) (struct dvb_frontend *);
int (*fe_sleep[MAX_NO_OF_FE_PER_ADAP]) (struct dvb_frontend *);
-
- int active_fe;
};
/**
@@ -346,11 +338,12 @@ struct dvb_usb_device {
const struct dvb_usb_device_properties *props;
const char *name;
const char *rc_map;
- struct dvb_usb_rc rc;
+
struct usb_device *udev;
+ struct usb_interface *intf;
+ struct dvb_usb_rc rc;
struct work_struct probe_work;
pid_t work_pid;
- struct usb_interface *intf;
int powered;
/* locking */