Re: [PATCH] staging: most: core: add autoconf ability

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 04/20/2017 05:26 PM, Greg KH wrote:
On Thu, Apr 20, 2017 at 05:01:49PM +0200, Christian Gromm wrote:
This patch extends the driver with the possibility of automatic
configuration. This covers channel settings and connection establishing of
a MOST device interface while it is registered with the core.

Making use of auto configuration will significantly cut the start-up
overhead and the duration until the driver is available in userspace.
Since the configuration depends on the type of network interface controller
its setup and the peripheral interface, it can _not_ be part of the kernel
and needs to be added once the system has been engineered.

I don't understand, what is using this new api you have added?  What is
missing here?

What's missing is a module that holds the configuration, which looks
basically like the sample module below. Once such a module is loaded
along with the "regular" driver modules, configuration and linking of
the channels is done automatically and you don't need any user space
applications taking care of this.

But as stated in the commit message, this can't be part of the kernel
tree since the information contained by this module heavily depends
on what NIC is used, how it is configured and how the system
designer wants to layout the network.

regards,
Chris

/*
 * default_conf.c - Default configuration for the MOST channels.
 *
 * Copyright (C) 2017, Microchip Technology Germany II GmbH & Co. KG
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * This file is licensed under GPLv2.
 */

#include "most.h"
#include <linux/module.h>

static struct most_config_probe config_probes[] = {
	/* MediaLB */
	{
		.ch_name = "ca2",
		.cfg = {
			.direction = MOST_CH_RX,
			.data_type = MOST_CH_CONTROL,
			.num_buffers = 16,
			.buffer_size = 64,
		},
		.comp_name = "cdev",
		.comp_param = "inic-mlb-crx",
	},
	{
		.ch_name = "ca4",
		.cfg = {
			.direction = MOST_CH_TX,
			.data_type = MOST_CH_CONTROL,
			.num_buffers = 16,
			.buffer_size = 64,
		},
		.comp_name = "cdev",
		.comp_param = "inic-mlb-ctx",
	},
	{
		.ch_name = "ca6",
		.cfg = {
			.direction = MOST_CH_RX,
			.data_type = MOST_CH_ASYNC,
			.num_buffers = 20,
			.buffer_size = 1522,
		},
		.comp_name = "cdev",
		.comp_param = "inic-mlb-arx",
	},
	{
		.ch_name = "ca8",
		.cfg = {
			.direction = MOST_CH_TX,
			.data_type = MOST_CH_ASYNC,
			.num_buffers = 20,
			.buffer_size = 1522,
		},
		.comp_name = "cdev",
		.comp_param = "inic-mlb-atx",
	},

	/* USB */
	{
		.ch_name = "ep8f",
		.cfg = {
			.direction = MOST_CH_RX,
			.data_type = MOST_CH_CONTROL,
			.num_buffers = 16,
			.buffer_size = 64,
		},
		.comp_name = "cdev",
		.comp_param = "inic-usb-crx",
	},
	{
		.ch_name = "ep0f",
		.cfg = {
			.direction = MOST_CH_TX,
			.data_type = MOST_CH_CONTROL,
			.num_buffers = 16,
			.buffer_size = 64,
		},
		.comp_name = "cdev",
		.comp_param = "inic-usb-ctx",
	},
	{
		.ch_name = "ep8e",
		.cfg = {
			.direction = MOST_CH_RX,
			.data_type = MOST_CH_ASYNC,
			.num_buffers = 20,
			.buffer_size = 1522,
		},
		.comp_name = "cdev",
		.comp_param = "inic-usb-arx",
	},
	{
		.ch_name = "ep0e",
		.cfg = {
			.direction = MOST_CH_TX,
			.data_type = MOST_CH_ASYNC,
			.num_buffers = 20,
			.buffer_size = 1522,
		},
		.comp_name = "cdev",
		.comp_param = "inic-usb-atx",
	},
	{
		.ch_name = "ep81",
		.cfg = {
			.direction = MOST_CH_RX,
			.data_type = MOST_CH_ISOC,
			.num_buffers = 20,
			.buffer_size = 188 * 8,
			.subbuffer_size = 188,
			.packets_per_xact = 2,
		},
		.comp_name = "v4l",
		.comp_param = "ep81",
	},
	{
		.ch_name = "ep82",
		.cfg = {
			.direction = MOST_CH_RX,
			.data_type = MOST_CH_SYNC,
			.num_buffers = 20,
			.buffer_size = 8192,
			.subbuffer_size = 4,
			.packets_per_xact = 128,
		},
		.comp_name = "sound",
		.comp_param = "ep82.2x16",
	},

	/* sentinel */
	{}
};

static struct most_config_set config_set = {
	.probes = config_probes
};

static int __init mod_init(void)
{
	most_register_config_set(&config_set);
	return 0;
}

static void __exit mod_exit(void)
{
	most_deregister_config_set(&config_set);
}

module_init(mod_init);
module_exit(mod_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Andrey Shvetsov <andrey.shvetsov@xxxxxx>");
MODULE_DESCRIPTION("Default configuration for the MOST channels");


thanks,

greg k-h

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux