Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] dvbdev: document most of the functions/data structs

Document the most relevant functions and data structs for
developers that are working with the DVB subsystem.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Acked-by: Jonathan Corbet <corbet@lwn.net>

+99 -16
+1
Documentation/DocBook/device-drivers.tmpl
··· 237 237 !Idrivers/media/dvb-core/dvb_frontend.h 238 238 !Idrivers/media/dvb-core/dvb_math.h 239 239 !Idrivers/media/dvb-core/dvb_ringbuffer.h 240 + !Idrivers/media/dvb-core/dvbdev.h 240 241 </sect1> 241 242 <sect1><title>Remote Controller devices</title> 242 243 !Iinclude/media/rc-core.h
+98 -16
drivers/media/dvb-core/dvbdev.h
··· 57 57 58 58 struct dvb_frontend; 59 59 60 + /** 61 + * struct dvb_adapter - represents a Digital TV adapter using Linux DVB API 62 + * 63 + * @num: Number of the adapter 64 + * @list_head: List with the DVB adapters 65 + * @device_list: List with the DVB devices 66 + * @name: Name of the adapter 67 + * @proposed_mac: proposed MAC address for the adapter 68 + * @priv: private data 69 + * @device: pointer to struct device 70 + * @module: pointer to struct module 71 + * @mfe_shared: mfe shared: indicates mutually exclusive frontends 72 + * Thie usage of this flag is currently deprecated 73 + * @mfe_dvbdev: Frontend device in use, in the case of MFE 74 + * @mfe_lock: Lock to prevent using the other frontends when MFE is 75 + * used. 76 + * @mdev: pointer to struct media_device, used when the media 77 + * controller is used. 78 + */ 60 79 struct dvb_adapter { 61 80 int num; 62 81 struct list_head list_head; ··· 97 78 #endif 98 79 }; 99 80 100 - 81 + /** 82 + * struct dvb_device - represents a DVB device node 83 + * 84 + * @list_head: List head with all DVB devices 85 + * @fops: pointer to struct file_operations 86 + * @adapter: pointer to the adapter that holds this device node 87 + * @type: type of the device: DVB_DEVICE_SEC, DVB_DEVICE_FRONTEND, 88 + * DVB_DEVICE_DEMUX, DVB_DEVICE_DVR, DVB_DEVICE_CA, DVB_DEVICE_NET 89 + * @minor: devnode minor number. Major number is always DVB_MAJOR. 90 + * @id: device ID number, inside the adapter 91 + * @readers: Initialized by the caller. Each call to open() in Read Only mode 92 + * decreases this counter by one. 93 + * @writers: Initialized by the caller. Each call to open() in Read/Write 94 + * mode decreases this counter by one. 95 + * @users: Initialized by the caller. Each call to open() in any mode 96 + * decreases this counter by one. 97 + * @wait_queue: wait queue, used to wait for certain events inside one of 98 + * the DVB API callers 99 + * @kernel_ioctl: callback function used to handle ioctl calls from userspace. 100 + * @name: Name to be used for the device at the Media Controller 101 + * @entity: pointer to struct media_entity associated with the device node 102 + * @pads: pointer to struct media_pad associated with @entity; 103 + * @priv: private data 104 + * 105 + * This structure is used by the DVB core (frontend, CA, net, demux) in 106 + * order to create the device nodes. Usually, driver should not initialize 107 + * this struct diretly. 108 + */ 101 109 struct dvb_device { 102 110 struct list_head list_head; 103 111 const struct file_operations *fops; ··· 155 109 void *priv; 156 110 }; 157 111 112 + /** 113 + * dvb_register_adapter - Registers a new DVB adapter 114 + * 115 + * @adap: pointer to struct dvb_adapter 116 + * @name: Adapter's name 117 + * @module: initialized with THIS_MODULE at the caller 118 + * @device: pointer to struct device that corresponds to the device driver 119 + * @adapter_nums: Array with a list of the numbers for @dvb_register_adapter; 120 + * to select among them. Typically, initialized with: 121 + * DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nums) 122 + */ 123 + int dvb_register_adapter(struct dvb_adapter *adap, const char *name, 124 + struct module *module, struct device *device, 125 + short *adapter_nums); 158 126 159 - extern int dvb_register_adapter(struct dvb_adapter *adap, const char *name, 160 - struct module *module, struct device *device, 161 - short *adapter_nums); 162 - extern int dvb_unregister_adapter (struct dvb_adapter *adap); 127 + /** 128 + * dvb_unregister_adapter - Unregisters a DVB adapter 129 + * 130 + * @adap: pointer to struct dvb_adapter 131 + */ 132 + int dvb_unregister_adapter(struct dvb_adapter *adap); 163 133 164 - extern int dvb_register_device (struct dvb_adapter *adap, 165 - struct dvb_device **pdvbdev, 166 - const struct dvb_device *template, 167 - void *priv, 168 - int type); 134 + /** 135 + * dvb_register_device - Registers a new DVB device 136 + * 137 + * @adap: pointer to struct dvb_adapter 138 + * @pdvbdev: pointer to the place where the new struct dvb_device will be 139 + * stored 140 + * @template: Template used to create &pdvbdev; 141 + * @device: pointer to struct device that corresponds to the device driver 142 + * @adapter_nums: Array with a list of the numbers for @dvb_register_adapter; 143 + * to select among them. Typically, initialized with: 144 + * DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nums) 145 + * @priv: private data 146 + * @type: type of the device: DVB_DEVICE_SEC, DVB_DEVICE_FRONTEND, 147 + * DVB_DEVICE_DEMUX, DVB_DEVICE_DVR, DVB_DEVICE_CA, DVB_DEVICE_NET 148 + */ 149 + int dvb_register_device(struct dvb_adapter *adap, 150 + struct dvb_device **pdvbdev, 151 + const struct dvb_device *template, 152 + void *priv, 153 + int type); 169 154 170 - extern void dvb_unregister_device (struct dvb_device *dvbdev); 155 + /** 156 + * dvb_unregister_device - Unregisters a DVB device 157 + * 158 + * @dvbdev: pointer to struct dvb_device 159 + */ 160 + void dvb_unregister_device(struct dvb_device *dvbdev); 171 161 172 162 #ifdef CONFIG_MEDIA_CONTROLLER_DVB 173 163 void dvb_create_media_graph(struct dvb_adapter *adap); ··· 218 136 #define dvb_register_media_controller(a, b) {} 219 137 #endif 220 138 221 - extern int dvb_generic_open (struct inode *inode, struct file *file); 222 - extern int dvb_generic_release (struct inode *inode, struct file *file); 223 - extern long dvb_generic_ioctl (struct file *file, 139 + int dvb_generic_open (struct inode *inode, struct file *file); 140 + int dvb_generic_release (struct inode *inode, struct file *file); 141 + long dvb_generic_ioctl (struct file *file, 224 142 unsigned int cmd, unsigned long arg); 225 143 226 144 /* we don't mess with video_usercopy() any more, 227 145 we simply define out own dvb_usercopy(), which will hopefully become 228 146 generic_usercopy() someday... */ 229 147 230 - extern int dvb_usercopy(struct file *file, unsigned int cmd, unsigned long arg, 231 - int (*func)(struct file *file, unsigned int cmd, void *arg)); 148 + int dvb_usercopy(struct file *file, unsigned int cmd, unsigned long arg, 149 + int (*func)(struct file *file, unsigned int cmd, void *arg)); 232 150 233 151 /** generic DVB attach function. */ 234 152 #ifdef CONFIG_MEDIA_ATTACH