tools/spi/spidev_fdx.c
Source file repositories/reference/linux-study-clean/tools/spi/spidev_fdx.c
File Facts
- System
- Linux kernel
- Corpus path
tools/spi/spidev_fdx.c- Extension
.c- Size
- 2798 bytes
- Lines
- 160
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: implementation source
- Status
- source implementation candidate
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
stdio.hunistd.hstdlib.hfcntl.hstring.hsys/ioctl.hsys/types.hsys/stat.hlinux/types.hlinux/spi/spidev.h
Detected Declarations
function do_readfunction do_msgfunction dumpstatfunction main
Annotated Snippet
switch (c) {
case 'm':
msglen = atoi(optarg);
if (msglen < 0)
goto usage;
continue;
case 'r':
readcount = atoi(optarg);
if (readcount < 0)
goto usage;
continue;
case 'v':
verbose++;
continue;
case 'h':
case '?':
usage:
fprintf(stderr,
"usage: %s [-h] [-m N] [-r N] /dev/spidevB.D\n",
argv[0]);
return 1;
}
}
if ((optind + 1) != argc)
goto usage;
name = argv[optind];
fd = open(name, O_RDWR);
if (fd < 0) {
perror("open");
return 1;
}
dumpstat(name, fd);
if (msglen)
do_msg(fd, msglen);
if (readcount)
do_read(fd, readcount);
close(fd);
return 0;
}
Annotation
- Immediate include surface: `stdio.h`, `unistd.h`, `stdlib.h`, `fcntl.h`, `string.h`, `sys/ioctl.h`, `sys/types.h`, `sys/stat.h`.
- Detected declarations: `function do_read`, `function do_msg`, `function dumpstat`, `function main`.
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.