devfs.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016 Eistec AB
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
25 #ifndef FS_DEVFS_H
26 #define FS_DEVFS_H
27 
28 #include "clist.h"
29 #include "vfs.h"
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
38 typedef struct devfs devfs_t;
39 
45 struct devfs {
47  const char *path;
49  void *private_data;
50 };
51 
58 
73 int devfs_register(devfs_t *node);
74 
86 int devfs_unregister(devfs_t *node);
87 
88 #ifdef __cplusplus
89 }
90 #endif
91 
92 #endif /* FS_DEVFS_H */
93 
devfs_register
int devfs_register(devfs_t *node)
Register a node in DevFS.
devfs::f_op
const vfs_file_ops_t * f_op
Pointer to file operations table for this device.
Definition: devfs.h:48
devfs::private_data
void * private_data
Pointer to device driver specific data.
Definition: devfs.h:49
devfs_file_system
const vfs_file_system_t devfs_file_system
DevFS file system driver.
devfs::list_entry
clist_node_t list_entry
List item entry.
Definition: devfs.h:46
devfs_unregister
int devfs_unregister(devfs_t *node)
Remove a registration from DevFS.
devfs
A device "file" consists of a file name and an opaque pointer to device driver private data.
Definition: devfs.h:45
clist.h
Circular linked list.
devfs::path
const char * path
File system relative path to this node.
Definition: devfs.h:47
vfs_file_system_t
A file system driver.
Definition: vfs.h:256
list_node
List node structure.
Definition: list.h:40
vfs_file_ops
Operations on open files.
Definition: vfs.h:328
vfs.h
VFS layer API declarations.