linux之configfs简介和编程入门

USB - 通过configfs配置Linux USB Gadget 主机将gadget视为一组配置,每个配置都包含若干接口,从gadget的角度看,这些接口被称为功能,每个功能代表一个串行连接或 SCSI 磁盘等。USB Linux 小工具是一种具有 UDC(USB 设备控制器)的设备,可连接到 USB 主机,以扩展其附加功能,如串行端口或大容量存储功能。其中 . 指定配置, 是指向从配置中移除的函数的符号链接,例如。其中 可以是任何在文件系统中合法的字符串, 是配置的编号,例如。 阅读详情
一、什么是configfs
是一种基于ram的文件系统
configfs is a ram-based filesystem that provides the converse of sysfs's functionality.  Where sysfs is a filesystem-based view of kernel objects, configfs is a filesystem-based manager of kernel objects, or config_items.

二、configfs有什么用处
在用户空间配置内核对象

三、configfs VS ioctl
configfs可直接察看,通过用户态目录文件访问接口,适用于内核对象有众多复杂的配置。

四、configs VS sysfs
configfs可以在用户态创建和删除内核对象。
With sysfs, an object is created in kernel (for example, when a device is discovered) and it is registered with sysfs.  Its attributes then appear in sysfs, allowing userspace to read the attributes via readdir(3)/read(2).  It may allow some attributes to be modified via write(2).  The important point is that the object is created and destroyed in kernel, the kernel controls the lifecycle of the sysfs representation, and sysfs is merely a window on all this.
A configfs config_item is created via an explicit userspace operation: mkdir(2).  It is destroyed via rmdir(2).  The attributes appear at mkdir(2) time, and can be read or modified via read(2) and write(2). As with sysfs, readdir(3) queries the list of items and/or attributes. symlink(2) can be used to group items together.  Unlike sysfs, the lifetime of the representation is completely driven by userspace.  The kernel modules backing the items must respond to this.
Both sysfs and configfs can and should exist together on the same system.  One is not a replacement for the other.

五、什么时候用configfs
当内核需要很多参数需要配置时;当需要动态创建内核对象并且内核对象需要修改配置时;
不想写用户态程序和ioctl时,写shell脚本就可以直接配置configfs。

六、怎么知道系统上是否已经安装了configfs,安装在哪个目录
执行如下命令,可以看到安装目录为/sys/kernel/config
cat /proc/mounts | grep configfs 
configfs /sys/kernel/config configfs rw,relatime 0 0

七、configfs组织结构是怎么样的
顶层结构是struct configfs_subsystem,为configfs子系统结构,接着是struct config_group,是configfs目录和属性的容器,struct config_item是configfs目录,代表可配置的内核对象,struct configfs_attribute是目录下面的属性。

八、如何运用configfs

configfs can be compiled as a module or into the kernel.  You can access it by doing
mount -t configfs none /config

The configfs tree will be empty unless client modules are also loaded. These are modules that register their item types with configfs as subsystems.  Once a client subsystem is loaded, it will appear as a subdirectory (or more than one) under /config.  Like sysfs, the configfs tree is always there, whether mounted on /config or not.

An item is created via mkdir(2).  The item's attributes will also appear at this time.  readdir(3) can determine what the attributes are, read(2) can query their default values, and write(2) can store new values.  Don't mix more than one attribute in one attribute file.

There are two types of configfs attributes:

* Normal attributes, which similar to sysfs attributes, are small ASCII text files, with a maximum size of one page (PAGE_SIZE, 4096 on i386).  Preferably only one value per file should be used, and the same caveats from sysfs apply. Configfs expects write(2) to store the entire buffer at once.  When writing to normal configfs attributes, userspace processes should first read the entire file, modify the portions they wish to change, and then write the entire buffer back.

* Binary attributes, which are somewhat similar to sysfs binary attributes, but with a few slight changes to semantics.  The PAGE_SIZE limitation does not apply, but the whole binary item must fit in single kernel vmalloc'ed buffer. The write(2) calls from user space are buffered, and the attributes' write_bin_attribute method will be invoked on the final close, therefore it is imperative for user-space to check the return code of close(2) in order to verify that the operation finished successfully. To avoid a malicious user OOMing the kernel, there's a per-binary attribute maximum buffer value.

When an item needs to be destroyed, remove it with rmdir(2).  An item cannot be destroyed if any other item has a link to it (via symlink(2)).  Links can be removed via unlink(2).

九、Coding With configfs

Every object in configfs is a config_item.  A config_item reflects an object in the subsystem.  It has attributes that match values on that object.  configfs handles the filesystem representation of that object and its attributes, allowing the subsystem to ignore all but the basic show/store interaction.
Items are created and destroyed inside a config_group.  A group is a collection of items that share the same attributes and operations. Items are created by mkdir(2) and removed by rmdir(2), but configfs handles that.  The group has a set of operations to perform these tasks
A subsystem is the top level of a client module.  During initialization, the client module registers the subsystem with configfs, the subsystem appears as a directory at the top of the configfs filesystem.  A subsystem is also a config_group, and can do everything a config_group can.

十、代码示例(来自内核目录Documentation\filesystems\configfs)
介绍代码之前,先过一下基本的数据结构:
struct configfs_subsystem {
	struct config_group	su_group;
	struct mutex		su_mutex;
};
configfs子系统,config_group是抽象容器,之所以叫容器,是因为容器中可以包括config_item,还可以递归包含config_group。struct mutex是用于子系统访问控制的。
struct config_group {
	struct config_item		cg_item;
	struct list_head		cg_children;
	struct configfs_subsystem 	*cg_subsys;
	struct list_head		default_groups;
	struct list_head		group_entry;
};
config_group作为幕后主使,是不轻易出现在台前的。所以有了94行的struct config_item来表现为一个目录。
struct config_item {
	char			*ci_name;
	char			ci_namebuf[CONFIGFS_ITEM_NAME_LEN];
	struct kref		ci_kref;
	struct list_head	ci_entry;
	struct config_item	*ci_parent;
	struct config_group	*ci_group;
	struct config_item_type	*ci_type;
	struct dentry		*ci_dentry;
}; 
config_item             行为目录名称。
config_item_type 行为目录下属性和属性操作,属性表现为目录下的文本文件。
struct config_item_type {
	struct module				*ct_owner;
	struct configfs_item_operations		*ct_item_ops;
	struct configfs_group_operations	*ct_group_ops;
	struct configfs_attribute		**ct_attrs;
	struct configfs_bin_attribute		**ct_bin_attrs;
};
configfs_item_operations行为属性操作方法,操作对象是configfs_attribute属性。
configfs_group_operations行为目录操作方法,可以在当前目录下创建item或group。
configfs_attribute行为当前目录属性数组。
struct configfs_attribute {
	const char		*ca_name;
	struct module 		*ca_owner;
	umode_t			ca_mode;
	ssize_t (*show)(struct config_item *, char *);
	ssize_t (*store)(struct config_item *, const char *, size_t);
};
属性非常简单,有属性名称、所属模块和访问权限。
示例1:创建一个最简单的configfs目录和可读写的属性
创建目录01-childless,下面有三个属性,其中属性storeme为可写。
# ll /sys/kernel/config/01-childless/
-r–r–r–. 1 root root 4096 Sep 27 05:16 description
-r–r–r–. 1 root root 4096 Sep 27 05:16 showme
-rw-r–r–. 1 root root 4096 Sep 27 05:16 storeme
37/*
38 * 01-childless
39 *
40 * This first example is a childless subsystem.  It cannot create
41 * any config_items.  It just has attributes.
42 *
43 * Note that we are enclosing the configfs_subsystem inside a container.
44 * This is not necessary if a subsystem has no attributes directly
45 * on the subsystem.  See the next example, 02-simple-children, for
46 * such a subsystem.
47 */
48
49struct childless {
50     struct configfs_subsystem subsys;
51     int showme;
52     int storeme;
53};
创建一个结构体包含了configfs子系统,两个属性showme, storeme放在了这里。
虽然注释里说明了为什么把这两个属性放这里,但还是没太理解,既然属性description可以放子系统下,为什么其他两个属性不行呢?有谁知道的告知一下。
子系统定义如下:
138static struct childless childless_subsys = {
139     .subsys = {
140          .su_group = {
141               .cg_item = {
142                    .ci_namebuf = "01-childless",
143                    .ci_type = &childless_type,
144               },
145          },
146     },
147};
142行,定义目录名称。
143行,定义属性和操作。
接着看属性和操作的定义:
114CHILDLESS_ATTR_RO(showme, childless_showme_read);
115CHILDLESS_ATTR(storeme, S_IRUGO | S_IWUSR, childless_storeme_read,
116            childless_storeme_write);
117CHILDLESS_ATTR_RO(description, childless_description_read);
118
119static struct configfs_attribute *childless_attrs[] = {
120     &childless_attr_showme.attr,
121     &childless_attr_storeme.attr,
122     &childless_attr_description.attr,
123     NULL,
124};
125
126CONFIGFS_ATTR_OPS(childless);
127static struct configfs_item_operations childless_item_ops = {
128     .show_attribute          = childless_attr_show,
129     .store_attribute     = childless_attr_store,
130};
131
132static struct config_item_type childless_type = {
133     .ct_item_ops     = &childless_item_ops,
134     .ct_attrs     = childless_attrs,
135     .ct_owner     = THIS_MODULE,
136};

133行,属性操作定义在128行和129行,这两个函数又是由126行宏定义的。126行宏依赖一个函数to_##_item,其中_item是宏的传入参数,这个函数的作用是从struct config_item转换到第49行的结构,然后作为函数show_attribute和store_attribute的传入参数。
134行,关联了属性数组,属性数组在119行定义,第120-122行属性又分别在114-117行定义。
一切准备就绪之后,在模块初始化地方调用子系统注册函数之后,就可以在/sys/kernel/config/下看到创建了子系统了。 
407static int __init configfs_example_init(void)
408{
409     int ret;
410     int i;
411     struct configfs_subsystem *subsys;
412
413     for (i = 0; example_subsys[i]; i++) {
414          subsys = example_subsys[i];
415
416          config_group_init(&subsys->su_group);
417          mutex_init(&subsys->su_mutex);
418          ret = configfs_register_subsystem(subsys);
419          if (ret) {
420               printk(KERN_ERR "Error %d while registering subsystem %s\n",
421                      ret,
422                      subsys->su_group.cg_item.ci_namebuf);
423               goto out_unregister;
424          }
425     }
426
427     return 0;
416-417行,初始化子系统。
418行,注册子系统。
这里做个小结:
1、创建子系统struct configfs_subsystem
2、创建子系统下config_item_type,对应位置configfs_subsystem->config_group->config_item->config_item_type
3、创建config_item_type对应的属性数组和操作,操作主要是show_attribute和store_attribute
4、注册子系统configfs_register_subsystem

示例2:创建一个configfs目录,用户空间可创建目录(新的内核对象)
首先是定义configfs子系统,
304static struct configfs_subsystem simple_children_subsys = {
305     .su_group = {
306          .cg_item = {
307               .ci_namebuf = "02-simple-children",
308               .ci_type = &simple_children_type,
309          },
310     },
311};
接着定义config_item_type, 
289/*
290 * Note that, since no extra work is required on ->drop_item(),
291 * no ->drop_item() is provided.
292 */
293static struct configfs_group_operations simple_children_group_ops = {
294     .make_item     = simple_children_make_item,
295};
296
297static struct config_item_type simple_children_type = {
298     .ct_item_ops     = &simple_children_item_ops,
299     .ct_group_ops     = &simple_children_group_ops,
300     .ct_attrs     = simple_children_attrs,
301     .ct_owner     = THIS_MODULE,
302};
298行,定义了子系统根目录属性操作,跟示例1类似
300行,定义了子系统根目录属性,跟示例1类似
299行,这里新增加了configfs_group_operations,具体定义在293行,继续跟进294行函数simple_children_make_item
232struct simple_children {
233     struct config_group group;
234};
235
236static inline struct simple_children *to_simple_children(struct config_item *item)
237{
238     return item ? container_of(to_config_group(item), struct simple_children, group) : NULL;
239}
240
241static struct config_item *simple_children_make_item(struct config_group *group, const char *name)
242{
243     struct simple_child *simple_child;
244
245     simple_child = kzalloc(sizeof(struct simple_child), GFP_KERNEL);
246     if (!simple_child)
247          return ERR_PTR(-ENOMEM);
248
249     config_item_init_type_name(&simple_child->item, name,
250                       &simple_child_type);
251
252     simple_child->storeme = 0;
253
254     return &simple_child->item;
255}
241行,定义了configfs_group_operations->make_item操作,返回值是新创建的struct config_item,传入参数是struct config_group,即是指定config_group下创建config_item项,这就意味着在该子系统(i.e /sys/kernel/config/02-simple-children)下执行命令mkdir,最终会执行到这个函数。
那执行mkdir 之后,会生成一个怎样的新目录呢?
249行,当调用mkdir时,这时就调用config_item_init_type_name初始化这个config_item,接着看250行的simple_child_type到底定义了怎么一个item类型?
171static struct configfs_attribute simple_child_attr_storeme = {
172     .ca_owner = THIS_MODULE,
173     .ca_name = "storeme",
174     .ca_mode = S_IRUGO | S_IWUSR,
175};
176
177static struct configfs_attribute *simple_child_attrs[] = {
178     &simple_child_attr_storeme,
179     NULL,
180};
219static struct configfs_item_operations simple_child_item_ops = {
220     .release          = simple_child_release,
221     .show_attribute          = simple_child_attr_show,
222     .store_attribute     = simple_child_attr_store,
223};
224
225static struct config_item_type simple_child_type = {
226     .ct_item_ops     = &simple_child_item_ops,
227     .ct_attrs     = simple_child_attrs,
228     .ct_owner     = THIS_MODULE,
229};
225行,定义了config_item_type。
227行,先看属性,simple_child_attrs定义在177行,只有一个属性,这个属性定义在171行,仔细看一下这个属性,有可读写的。
所以经过mkdir之后,该目录下就自动生成一个名字为storeme的属性,其对应的操作定义在219行。具体如下:
# cd /sys/kernel/config/02-simple-children/
# ls
description
# mkdir test
# ll
-r–r–r–. 1 root root 4096 Sep 28 21:24 description
drwxr-xr-x. 2 root root    0 Sep 28 21:24 test
# tree
.
|– description
`– test
    `– storeme
1 directory, 2 files
# cat test/storeme 
0
# echo 1 > test/storeme 
# cat test/storeme 
1

示例3:创建group
之前我们讲过,config_group是可以嵌套的,那么现在就来看一下嵌套之后是什么样的:
# cd /sys/kernel/config/03-group-children/
# ls
description 
# mkdir test
# mkdir test/test1
# mkdir test/test2
# mkdir test/test3
# tree
.
|– description
`– test
    |– description
    |– test1
    |   `– storeme
    |– test2
    |   `– storeme
    `– test3
        `– storeme
看出与示例2的区别了吗?
首先看子系统定义
382static struct configfs_subsystem group_children_subsys = {
383     .su_group = {
384          .cg_item = {
385               .ci_namebuf = "03-group-children",
386               .ci_type = &group_children_type,
387          },
388     },
389};
386行,config_item_type与之前的不一样,跟过去看看
371static struct configfs_group_operations group_children_group_ops = {
372     .make_group     = group_children_make_group,
373};
374
375static struct config_item_type group_children_type = {
376     .ct_item_ops     = &group_children_item_ops,
377     .ct_group_ops     = &group_children_group_ops,
378     .ct_attrs     = group_children_attrs,
379     .ct_owner     = THIS_MODULE,
380};
375行,定义新的config_item_type,其根本区别在377行configfs_group_operations
371行,定义了configfs_group_operations,这里定义了make_group函数,在子系统下mkdir就会调用这个函数。
326static struct config_group *group_children_make_group(struct config_group *group, const char *name)
327{
328     struct simple_children *simple_children;
329
330     simple_children = kzalloc(sizeof(struct simple_children),
331                      GFP_KERNEL);
332     if (!simple_children)
333          return ERR_PTR(-ENOMEM);
334
335     config_group_init_type_name(&simple_children->group, name,
336                        &simple_children_type);
337
338     return &simple_children->group;
339}
这份代码非常眼熟,跟示例2中创建config_item太像了,只不过把所有对象由config_item改为config_group类型的。
336行,simple_children_type正是示例2中对应的config_item_type。
所以这里的创建步骤首先是创建一个为config_group的目录,再在这个目录下创建config_item的目录。
到这里为止,简单地了解了一下configfs的实现原理,在某些应用中不失为一种很好的手段。
转载请注原出处:http://blog.youkuaiyun.com/liumangxiong
Linux configfs和sysfs的使用与理解 本文介绍了configfs和sys的区别与使用流程,以实例来分析使用过程。 阅读详情

相关推荐

Linux configfs简介

Linux configfs的简单介绍

Bluetangos的博客 1649

Linux内核编程:设备树overlay和ConfigFS文件系统

在嵌入式Linux下,设备树(device tree)用来描述硬件平台的各种资源,Linux内核在启动过程中,会解析设备树,获取各种硬件资源来初始化硬件。设备树的overlay功能是指可以在系统运行期间动态修改设备树。一般情况下,如上图所示,设备树经过DTC编译器编译为二进制的hello.dtb文件,加载到内存,随Linux内核一起启动后,一般就无法更改了。如果我们想修改设备树,需要修改hello.dts文件文件,重新编译成二进制文件:hello.dtb,然后重新启动内核,重新解析。有了设备树的overlay功能,省去了设备树的重新编译和内核重启,我们可以直接编写一个设备树插件:overlay.dts,编译成overlay.dtbo后,直接给设备树“打补丁”,在运行期间就可以动态添加节点、修改节点...设备树的overlay功能,在很多场合都会用得到,会让我们的开发更加方便:外界插拔设备,无法在设备树中预先描述:耳机树莓派 + FPGA开发板基于I2C的温度传感器管脚的重新配置:PIN multiplexing修改bootcmd、分区...设备树的overlay功能,目前还没有加入到内核mainline(linux-5.10.x),但目前有些开发板和配套的BSP已经支持了,支持在系统运行期间动态修改设备树文件。如果你手头的开发板或内核平台还没有支持device tree overlay,可以学习本期课程,学习内核中设备树overlay的实现原理,如何给内核打补丁,使内核支持设备树的overlay功能。有了本期课程的学习基础,明白了设备树overlay的实现原理和运行机制,你就可以尝试在自己的开发板平台上实现这个功能了。本期课程的主要内容如下:在开发板上如何实现设备树的overlay功能Configfs文件系统的配置与挂载Configfs编程接口如何编写设备树 overlay插件设备树 overlay的编译和运行设备树overlay运行机制分析本期课程适合哪些人学习:嵌入式驱动工程师嵌入式BSP工程师嵌入式软件工程师想从事嵌入式开发的同学全网首家讲解设备树overlay的视频教程。   

Linux usb【4】- gadget configfs介绍

usb_add_config_only主要就是将config_usb_cfg->usb_configuration 结构挂到gadget_info->usb_composite_dev->configs链表上,同时将config_usb_cfg->usb_configuration->usb_composite_dev赋值为gadget_info->usb_composite_dev,并将这个配置描述符里的接口描述符清0。有了这个usb_ep结构,uac2驱动就可以使用它进行数据收发了。

liverdream的专栏 2159

Linux驱动-ConfigFS-读写属性操作

前面的知识点从ConfigFS 概念 -> ConfigFS基础必备 ->ConfigFS注册子系统->ConfigFS注册group组->ConfigFS 注册Item-> ConfigFS 释放资源->再到这里ConfigFS 属性读取。其实都是从一个简单例子,一步一步到各个知识点,对同一个实例不断添加知识点的功能。这里就开始理解属性相关知识了。如上分析了 configfs_attribute 属性定义的属性数组,那么属性如何定义呢?我个人分析如下;内核属性如果生成成功就是这个 name 属性。

十年饮冰,难凉热血 1169

深入解析Linux USB Gadget:从configfs配置到实战应用

本文深入解析Linux USB Gadget技术,详细介绍了如何通过configfs虚拟文件系统,将嵌入式设备配置为USB从设备。内容涵盖从内核准备、环境搭建到实战创建CDC ACM串口、大容量存储、网络设备及复合设备的完整流程,并提供了脚本化应用与性能调优指南,帮助开发者灵活实现产品调试、文件传输和网络连接等功能。

weixin_29196315的博客 651

29-Gadget框架02:ConfigFS虚拟文件系统与动态配置

ConfigFS是基于内存的文件系统,主要用于动态配置和管理内核对象。它提供了一种以文件和目录形式访问内核对象的接口,允许在运行时添加、修改和删除内核对象,而无需重新编译内核或修改内核代码。ConfigFS虚拟文件系统├── 核心理念│ ├── 用户空间配置内核对象│ ├── 与SysFS方向相反│ └── 用户控制对象生命周期├── 核心结构│ ├── config_group(目录)│ ├── config_item(文件)│ └── config_item_attribute(属性)

内核笔记 44

Linux configfs机制

1、在使用intel SOC过程中,驱动的DTS需要在内核启动以后把FPGA core load以后加载PL侧设备的DTS,此时使用的是Linux的dts的overlay机制,该机制本质是使用Linux的configfs 机制,在此分析。 2、 Linux内核驱动中使用的设备树作为驱动match的方法,在内核初始化时候会对dts解析,然后生成一个个的device node,根...

liujiliei的博客 3758

OrthoFinder功能、流程和文件注释

OrthoFinder 的标准输出包括:直系同源组,直系同源基因,有根基因树,解析基因树,无根物种树、有根物种树,基因重复事件以及相关的统计数据。

hs6605015的博客 3047

linux configfs(以usb_gadget为例)

configfs介绍 linux 中configfs的官方介绍文档为documentation/filesystems/configfs.rst,关键信息如下: configfs - Userspace-driven kernel object configuration.直接翻译过来就是用户空间配置内核对象,在configfs.rst中可以看到其中的描述: configfs是一个基于ram的文件系统,通过对该文件系统的操作实现对内核对象的配置。 configfs组成 根据configfs.rst的说明我们

TNT的博客 4047

Docker启动安装nacos(详情讲解,全网最细)

docker安装nacos保姆级教程

ilvjiale的博客 8万+

交流电路计算方法:复阻抗和相量法

一,复阻抗 电容电路,电压与电流的大小比值是XC=1/WC,相位上电流比电压超前90度 这样描述很麻烦,在复平面里,相位超前90度,可以用什么数学表示呢? 也就是说,一个相量,乘以j之后,大小没变化,相位变得超前90度了 同样的,大小不变,相位落后90度应该除以j 原来我们说电容电路,给个电压,算电流又要算XC,又要另外说相位超前90度,现在可以简单点 在这个计算式里,1/wc还是原来的容抗大...

theory and practice的博客 3万+

Linux文件系统:2、configfs详解

configfs是 Linux 内核中的一种虚拟文件系统,用于动态配置内核对象的属性和行为。它提供了一种用户空间和内核空间之间交互的接口,允许用户空间通过创建和管理 configfs 目录来配置内核对象。configfs 的设计目标是提供一种灵活、可扩展的配置机制,使用户能够在运行时动态地配置内核对象,而无需重新编译和加载内核模块。它可以与其他子系统(如网络子系统、文件系统等)进行集成,以实现更复杂的配置和管理功能。

嵌入山脊的博客 4377

实战避坑:示波器测量非隔离开关电源的炸机风险与隔离方案

本文详细分析了使用示波器测量非隔离开关电源时的炸机风险,揭示了地线环路导致的短路问题,并对比了四种防炸机解决方案,包括示波器隔离供电、拔掉电源地线、使用差分探头和被测板隔离供电。重点推荐使用隔离变压器方案,确保测量安全与精度,同时提供了实操建议与经验分享,帮助工程师避免常见测量事故。

weixin_29224309的博客 561

linux usb 驱动 - configfs 文件系统

作者: baron个人博客:configfs 是 Linux 内核中的一个,他和 sysfs 类似,都是以和的形式导出到用户空间和用户交互, 虚拟表示 configfs 中的"目录"只是一个用户界面的表现形式, 没有实际的物理存储空间分配, 目录结构只是内核对象的一种层次化展示方式. 每个"目录"实际上映射到一个 config_group, 目录操作被转换为对应的 config_group 操作, 比如 mkdir 实际上是调用 make_group 来创建新的内核配置项.

sty01z的博客 1112

华为IPD实战:从概念到发布的完整流程拆解(附各阶段关键文档模板)

本文深入拆解华为IPD(集成产品开发)从概念到发布的完整实战流程,涵盖概念、计划、开发验证及发布生命周期四大阶段。详细解析了各阶段的核心活动、关键产出与决策评审点,并提供了如《初始业务计划书》等关键文档模板框架,旨在帮助企业将IPD理论转化为可执行的操作指南,提升研发效率与产品成功率。

weixin_29212429的博客 535

【YOLOv8改进-注意力机制】LSKNet(Large Selective Kernel Network ):空间选择注意力

【YOLOv8改进-注意力机制】LSKNet(Large Selective Kernel Network ):空间选择注意力 (论文笔记+引入代码)。LSKNet能够动态调整其大的空间接收场,以更好地模拟遥感场景中各种对象的范围上下文。据我们所知,这是首次在遥感目标检测领域探索大型和选择性核机制。

专注于图像领域,主要研究内容包括计算机视觉和深度学习,特别是在图像分类、目标检测和图像生成等方面有深入的研究和实践经验。 2864

linux通过configfs方式开启uvc、uac、adb等功能

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。原文链接:https://blog.youkuaiyun.com/u013905694/article/details/129707112。linux通过configfs方式开启uvc、uac、adb等功能。已于 2023-03-22 13:02:02 修改。setusbconfig uvc:开启uvc功能。文章标签: adb linux android。Powered by 金山文档。

u010689853的博客 2226

北斗导航 | 接收机自主完好性监测(RAIM)算法近三年研究现状总结(2022-2025)

近三年RAIM算法已从传统的单故障检测演进为多星座协同、智能融合的复杂系统,在航空、自动驾驶等安全关键领域实现规模化应用。未来需重点突破城市复杂环境适应性和标准化体系建设,推动技术从"可用"向"可信"跨越。

尘世冰封的专栏 440

Linux USB Gadget | 框架 / 复合设备实践 / Configfs 配置

……

u013669912的博客 2352

手把手教你学Simulink——基于传统电网建模与稳定性分析的场景实例:基于同步发电机的单机无穷大系统建模与稳定性分析

本文详细介绍了使用MATLAB/Simulink进行单机无穷大系统(SMIB)建模与稳定性分析的方法。教程从系统结构设计入手,包含同步发电机、输电线路、无穷大母线等核心模块的建模步骤和参数配置示例。重点讲解了七个关键步骤:项目创建、模块配置、控制系统集成、负载添加(可选)以及仿真运行与结果分析,并提供了具体的MATLAB代码示例。最后通过性能评估指标(功角差、电压跌落、频率偏差)分析系统稳定性,为电力系统动态特性研究提供了实用指导,强调准确参数设置对仿真结果的重要性。

MHD0815的博客 298

老版QQ原生表情gif动态

这是老版的QQ表情,不过全是动态的的,Windows照片查看器是不会动的,可以右击用浏览器打开查看,再说一遍是老版的,只是分享给宁愿用老版也要动态的人。

Android Linux usb gadget configfs

Linux USB gadget configured through configfs 25th April 2013 OverviewA USB Linux Gadget is a device which has a UDC (USB Device Controller) and can be connected to a USB Host to extend it

前行 4062

NTscan扫描工具

ntscan是一个扫描器,可以扫描没有密码和弱密码的共享,先到配置文件中填写猜测的用户名和密码,扫描过程中右侧出现的是扫描日志。

linux on android usb,Android Linux usb gadget configfs

Linux USB gadget configured through configfs25th April 2013OverviewA USB Linux Gadget is a device which has a UDC (USB Device Controller) and canbe connected to a USB Host to extend it with additional...

weixin_29775447的博客 292

android 蓝牙通讯demo

android 下蓝牙通讯demo,实现了发现蓝牙,使能蓝牙,通过蓝牙发送消息。

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

configfs 示例3

*定义了configfs_group_operations->make_item操作,返回值是新创建的struct config_item,传入参数是struct config_group,即是指定config_group下创建config_item项,这就意味着在该子系统(i.e /sys/kernel/config/02-simple-children)下执行命令mkdir,最终会执行到这个函数*/.ci_type = &children_type, // 定义属性和操作。

学海无涯,回头是岸 474
上一篇: 腾讯 soter 原理
下一篇: Android监听UEvent事件的测试程序
沉默的过客
博客等级 码龄13年 60粉丝 17原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值