#include <linux/module.h>
#include <linux/fs.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/device.h>
#include <linux/list.h>
#include <linux/poll.h>
#include <linux/wait.h>
#include <linux/kobject.h>
#include <linux/mutex.h>
#include <linux/completion.h>
#include <linux/sysfs.h>
#include <linux/kthread.h>
#include <linux/dma-mapping.h>
#include <linux/idr.h>
#include <linux/most.h>
#define MAX_CHANNELS …
#define STRING_SIZE …
static struct ida mdev_id;
static int dummy_num_buffers;
static struct list_head comp_list;
struct pipe { … };
struct most_channel { … };
#define to_channel(d) …
struct interface_private { … };
static const struct { … } ch_data_type[] = …;
#define list_pop_mbo(ptr) …
static void most_free_mbo_coherent(struct mbo *mbo)
{ … }
static void flush_channel_fifos(struct most_channel *c)
{ … }
static int flush_trash_fifo(struct most_channel *c)
{ … }
static ssize_t available_directions_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t available_datatypes_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t number_of_packet_buffers_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t number_of_stream_buffers_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t size_of_packet_buffer_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t size_of_stream_buffer_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t channel_starving_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t set_number_of_buffers_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t set_buffer_size_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t set_direction_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t set_datatype_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t set_subbuffer_size_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t set_packets_per_xact_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t set_dbr_size_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
#define to_dev_attr(a) …
static umode_t channel_attr_is_visible(struct kobject *kobj,
struct attribute *attr, int index)
{ … }
#define DEV_ATTR(_name) …
static DEVICE_ATTR_RO(available_directions);
static DEVICE_ATTR_RO(available_datatypes);
static DEVICE_ATTR_RO(number_of_packet_buffers);
static DEVICE_ATTR_RO(number_of_stream_buffers);
static DEVICE_ATTR_RO(size_of_stream_buffer);
static DEVICE_ATTR_RO(size_of_packet_buffer);
static DEVICE_ATTR_RO(channel_starving);
static DEVICE_ATTR_RO(set_buffer_size);
static DEVICE_ATTR_RO(set_number_of_buffers);
static DEVICE_ATTR_RO(set_direction);
static DEVICE_ATTR_RO(set_datatype);
static DEVICE_ATTR_RO(set_subbuffer_size);
static DEVICE_ATTR_RO(set_packets_per_xact);
static DEVICE_ATTR_RO(set_dbr_size);
static struct attribute *channel_attrs[] = …;
static const struct attribute_group channel_attr_group = …;
static const struct attribute_group *channel_attr_groups[] = …;
static ssize_t description_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t interface_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR_RO(description);
static DEVICE_ATTR_RO(interface);
static struct attribute *interface_attrs[] = …;
static const struct attribute_group interface_attr_group = …;
static const struct attribute_group *interface_attr_groups[] = …;
static struct most_component *match_component(char *name)
{ … }
struct show_links_data { … };
static int print_links(struct device *dev, void *data)
{ … }
static int most_match(struct device *dev, const struct device_driver *drv)
{ … }
static const struct bus_type mostbus = …;
static ssize_t links_show(struct device_driver *drv, char *buf)
{ … }
static ssize_t components_show(struct device_driver *drv, char *buf)
{ … }
static struct most_channel *get_channel(char *mdev, char *mdev_ch)
{ … }
static
inline int link_channel_to_component(struct most_channel *c,
struct most_component *comp,
char *name,
char *comp_param)
{ … }
int most_set_cfg_buffer_size(char *mdev, char *mdev_ch, u16 val)
{ … }
int most_set_cfg_subbuffer_size(char *mdev, char *mdev_ch, u16 val)
{ … }
int most_set_cfg_dbr_size(char *mdev, char *mdev_ch, u16 val)
{ … }
int most_set_cfg_num_buffers(char *mdev, char *mdev_ch, u16 val)
{ … }
int most_set_cfg_datatype(char *mdev, char *mdev_ch, char *buf)
{ … }
int most_set_cfg_direction(char *mdev, char *mdev_ch, char *buf)
{ … }
int most_set_cfg_packets_xact(char *mdev, char *mdev_ch, u16 val)
{ … }
int most_cfg_complete(char *comp_name)
{ … }
int most_add_link(char *mdev, char *mdev_ch, char *comp_name, char *link_name,
char *comp_param)
{ … }
int most_remove_link(char *mdev, char *mdev_ch, char *comp_name)
{ … }
#define DRV_ATTR(_name) …
static DRIVER_ATTR_RO(links);
static DRIVER_ATTR_RO(components);
static struct attribute *mc_attrs[] = …;
static const struct attribute_group mc_attr_group = …;
static const struct attribute_group *mc_attr_groups[] = …;
static struct device_driver mostbus_driver = …;
static inline void trash_mbo(struct mbo *mbo)
{ … }
static bool hdm_mbo_ready(struct most_channel *c)
{ … }
static void nq_hdm_mbo(struct mbo *mbo)
{ … }
static int hdm_enqueue_thread(void *data)
{ … }
static int run_enqueue_thread(struct most_channel *c, int channel_id)
{ … }
static void arm_mbo(struct mbo *mbo)
{ … }
static int arm_mbo_chain(struct most_channel *c, int dir,
void (*compl)(struct mbo *))
{ … }
void most_submit_mbo(struct mbo *mbo)
{ … }
EXPORT_SYMBOL_GPL(…);
static void most_write_completion(struct mbo *mbo)
{ … }
int channel_has_mbo(struct most_interface *iface, int id,
struct most_component *comp)
{ … }
EXPORT_SYMBOL_GPL(…);
struct mbo *most_get_mbo(struct most_interface *iface, int id,
struct most_component *comp)
{ … }
EXPORT_SYMBOL_GPL(…);
void most_put_mbo(struct mbo *mbo)
{ … }
EXPORT_SYMBOL_GPL(…);
static void most_read_completion(struct mbo *mbo)
{ … }
int most_start_channel(struct most_interface *iface, int id,
struct most_component *comp)
{ … }
EXPORT_SYMBOL_GPL(…);
int most_stop_channel(struct most_interface *iface, int id,
struct most_component *comp)
{ … }
EXPORT_SYMBOL_GPL(…);
int most_register_component(struct most_component *comp)
{ … }
EXPORT_SYMBOL_GPL(…);
static int disconnect_channels(struct device *dev, void *data)
{ … }
int most_deregister_component(struct most_component *comp)
{ … }
EXPORT_SYMBOL_GPL(…);
static void release_channel(struct device *dev)
{ … }
int most_register_interface(struct most_interface *iface)
{ … }
EXPORT_SYMBOL_GPL(…);
void most_deregister_interface(struct most_interface *iface)
{ … }
EXPORT_SYMBOL_GPL(…);
void most_stop_enqueue(struct most_interface *iface, int id)
{ … }
EXPORT_SYMBOL_GPL(…);
void most_resume_enqueue(struct most_interface *iface, int id)
{ … }
EXPORT_SYMBOL_GPL(…);
static int __init most_init(void)
{ … }
static void __exit most_exit(void)
{ … }
subsys_initcall(most_init);
module_exit(most_exit);
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;