Lines Matching +full:write +full:- +full:to +full:- +full:write

2  *  file.c - part of debugfs, a tiny little debug file system
4 * Copyright (C) 2004 Greg Kroah-Hartman <greg@kroah.com>
11 * debugfs is for people to use instead of /proc or /sys.
38 if (inode->i_private) in default_open()
39 file->private_data = inode->i_private; in default_open()
46 .write = default_write_file,
53 nd_set_link(nd, dentry->d_inode->i_private); in debugfs_follow_link()
77 * debugfs_create_u8 - create a debugfs file that is used to read and write an unsigned 8-bit value
78 * @name: a pointer to a string containing the name of the file to create.
80 * @parent: a pointer to the parent dentry for this file. This should be a
83 * @value: a pointer to the variable that the file should read to and write
88 * set, it can be read from, and written to.
90 * This function will return a pointer to a dentry if it succeeds. This
91 * pointer must be passed to the debugfs_remove() function when the file is
92 * to be removed (no automatic cleanup happens if your module is unloaded,
95 * If debugfs is not enabled in the kernel, the value -%ENODEV will be
96 * returned. It is not wise to check for this value, but rather, check for
97 * %NULL or !%NULL instead as to eliminate the need for #ifdef in the calling
103 /* if there are no write bits set, make read only */ in debugfs_create_u8()
106 /* if there are no read bits set, make write only */ in debugfs_create_u8()
129 …* debugfs_create_u16 - create a debugfs file that is used to read and write an unsigned 16-bit val…
130 * @name: a pointer to a string containing the name of the file to create.
132 * @parent: a pointer to the parent dentry for this file. This should be a
135 * @value: a pointer to the variable that the file should read to and write
140 * set, it can be read from, and written to.
142 * This function will return a pointer to a dentry if it succeeds. This
143 * pointer must be passed to the debugfs_remove() function when the file is
144 * to be removed (no automatic cleanup happens if your module is unloaded,
147 * If debugfs is not enabled in the kernel, the value -%ENODEV will be
148 * returned. It is not wise to check for this value, but rather, check for
149 * %NULL or !%NULL instead as to eliminate the need for #ifdef in the calling
155 /* if there are no write bits set, make read only */ in debugfs_create_u16()
158 /* if there are no read bits set, make write only */ in debugfs_create_u16()
181 …* debugfs_create_u32 - create a debugfs file that is used to read and write an unsigned 32-bit val…
182 * @name: a pointer to a string containing the name of the file to create.
184 * @parent: a pointer to the parent dentry for this file. This should be a
187 * @value: a pointer to the variable that the file should read to and write
192 * set, it can be read from, and written to.
194 * This function will return a pointer to a dentry if it succeeds. This
195 * pointer must be passed to the debugfs_remove() function when the file is
196 * to be removed (no automatic cleanup happens if your module is unloaded,
199 * If debugfs is not enabled in the kernel, the value -%ENODEV will be
200 * returned. It is not wise to check for this value, but rather, check for
201 * %NULL or !%NULL instead as to eliminate the need for #ifdef in the calling
207 /* if there are no write bits set, make read only */ in debugfs_create_u32()
210 /* if there are no read bits set, make write only */ in debugfs_create_u32()
234 …* debugfs_create_u64 - create a debugfs file that is used to read and write an unsigned 64-bit val…
235 * @name: a pointer to a string containing the name of the file to create.
237 * @parent: a pointer to the parent dentry for this file. This should be a
240 * @value: a pointer to the variable that the file should read to and write
245 * set, it can be read from, and written to.
247 * This function will return a pointer to a dentry if it succeeds. This
248 * pointer must be passed to the debugfs_remove() function when the file is
249 * to be removed (no automatic cleanup happens if your module is unloaded,
252 * If debugfs is not enabled in the kernel, the value -%ENODEV will be
253 * returned. It is not wise to check for this value, but rather, check for
254 * %NULL or !%NULL instead as to eliminate the need for #ifdef in the calling
260 /* if there are no write bits set, make read only */ in debugfs_create_u64()
263 /* if there are no read bits set, make write only */ in debugfs_create_u64()
286 …* debugfs_create_x{8,16,32,64} - create a debugfs file that is used to read and write an unsigned …
294 * debugfs_create_x8 - create a debugfs file that is used to read and write an unsigned 8-bit value
295 * @name: a pointer to a string containing the name of the file to create.
297 * @parent: a pointer to the parent dentry for this file. This should be a
300 * @value: a pointer to the variable that the file should read to and write
306 /* if there are no write bits set, make read only */ in debugfs_create_x8()
309 /* if there are no read bits set, make write only */ in debugfs_create_x8()
318 …* debugfs_create_x16 - create a debugfs file that is used to read and write an unsigned 16-bit val…
319 * @name: a pointer to a string containing the name of the file to create.
321 * @parent: a pointer to the parent dentry for this file. This should be a
324 * @value: a pointer to the variable that the file should read to and write
330 /* if there are no write bits set, make read only */ in debugfs_create_x16()
333 /* if there are no read bits set, make write only */ in debugfs_create_x16()
342 …* debugfs_create_x32 - create a debugfs file that is used to read and write an unsigned 32-bit val…
343 * @name: a pointer to a string containing the name of the file to create.
345 * @parent: a pointer to the parent dentry for this file. This should be a
348 * @value: a pointer to the variable that the file should read to and write
354 /* if there are no write bits set, make read only */ in debugfs_create_x32()
357 /* if there are no read bits set, make write only */ in debugfs_create_x32()
366 …* debugfs_create_x64 - create a debugfs file that is used to read and write an unsigned 64-bit val…
367 * @name: a pointer to a string containing the name of the file to create.
369 * @parent: a pointer to the parent dentry for this file. This should be a
372 * @value: a pointer to the variable that the file should read to and write
397 * debugfs_create_size_t - create a debugfs file that is used to read and write an size_t value
398 * @name: a pointer to a string containing the name of the file to create.
400 * @parent: a pointer to the parent dentry for this file. This should be a
403 * @value: a pointer to the variable that the file should read to and write
418 u32 *val = file->private_data; in read_file_bool()
435 u32 *val = file->private_data; in write_file_bool()
437 buf_size = min(count, (sizeof(buf)-1)); in write_file_bool()
439 return -EFAULT; in write_file_bool()
449 .write = write_file_bool,
455 * debugfs_create_bool - create a debugfs file that is used to read and write a boolean value
456 * @name: a pointer to a string containing the name of the file to create.
458 * @parent: a pointer to the parent dentry for this file. This should be a
461 * @value: a pointer to the variable that the file should read to and write
466 * set, it can be read from, and written to.
468 * This function will return a pointer to a dentry if it succeeds. This
469 * pointer must be passed to the debugfs_remove() function when the file is
470 * to be removed (no automatic cleanup happens if your module is unloaded,
473 * If debugfs is not enabled in the kernel, the value -%ENODEV will be
474 * returned. It is not wise to check for this value, but rather, check for
475 * %NULL or !%NULL instead as to eliminate the need for #ifdef in the calling
488 struct debugfs_blob_wrapper *blob = file->private_data; in read_file_blob()
489 return simple_read_from_buffer(user_buf, count, ppos, blob->data, in read_file_blob()
490 blob->size); in read_file_blob()
500 * debugfs_create_blob - create a debugfs file that is used to read a binary blob
501 * @name: a pointer to a string containing the name of the file to create.
503 * @parent: a pointer to the parent dentry for this file. This should be a
506 * @blob: a pointer to a struct debugfs_blob_wrapper which contains a pointer
507 * to the blob data and the size of the data.
510 * @blob->data as a binary blob. If the @mode variable is so set it can be
513 * This function will return a pointer to a dentry if it succeeds. This
514 * pointer must be passed to the debugfs_remove() function when the file is
515 * to be removed (no automatic cleanup happens if your module is unloaded,
518 * If debugfs is not enabled in the kernel, the value -%ENODEV will be
519 * returned. It is not wise to check for this value, but rather, check for
520 * %NULL or !%NULL instead as to eliminate the need for #ifdef in the calling
534 * The regset32 stuff is used to print 32-bit registers using the
535 * seq_file utilities. We offer printing a register set in an already-opened
540 * debugfs_print_regs32 - use seq_print to describe a set of registers
541 * @s: the seq_file structure being used to generate output
544 * @base: the base address to be used in reading the registers
545 * @prefix: a string to be prefixed to every output line
548 * some 32-bit hardware registers. It is meant to be used within debugfs
549 * files based on seq_file that need to show registers, intermixed with other
550 * information. The prefix argument may be used to specify a leading string,
562 ret += seq_printf(s, "%s = 0x%08x\n", regs->name, in debugfs_print_regs32()
563 readl(base + regs->offset)); in debugfs_print_regs32()
571 struct debugfs_regset32 *regset = s->private; in debugfs_show_regset32()
573 debugfs_print_regs32(s, regset->regs, regset->nregs, regset->base, ""); in debugfs_show_regset32()
579 return single_open(file, debugfs_show_regset32, inode->i_private); in debugfs_open_regset32()
590 * debugfs_create_regset32 - create a debugfs file that returns register values
591 * @name: a pointer to a string containing the name of the file to create.
593 * @parent: a pointer to the parent dentry for this file. This should be a
596 * @regset: a pointer to a struct debugfs_regset32, which contains a pointer
597 * to an array of register definitions, the array size and the base
598 * address where the register bank is to be found.
601 * the names and values of a set of 32-bit registers. If the @mode variable
604 * This function will return a pointer to a dentry if it succeeds. This
605 * pointer must be passed to the debugfs_remove() function when the file is
606 * to be removed (no automatic cleanup happens if your module is unloaded,
609 * If debugfs is not enabled in the kernel, the value -%ENODEV will be
610 * returned. It is not wise to check for this value, but rather, check for
611 * %NULL or !%NULL instead as to eliminate the need for #ifdef in the calling