| /linux/tools/testing/selftests/net/ |
| H A D | ipv6_flowlabel_mgr.c | 1 // SPDX-License-Identifier: GPL-2.0 48 static int flowlabel_get(int fd, uint32_t label, uint8_t share, uint16_t flags) in flowlabel_get() argument 61 return setsockopt(fd, SOL_IPV6, IPV6_FLOWLABEL_MGR, &req, sizeof(req)); in flowlabel_get() 64 static int flowlabel_put(int fd, uint32_t label) in flowlabel_put() argument 71 return setsockopt(fd, SOL_IPV6, IPV6_FLOWLABEL_MGR, &req, sizeof(req)); in flowlabel_put() 74 static void run_tests(int fd) in run_tests() argument 79 explain("cannot get non-existent label"); in run_tests() 80 expect_fail(flowlabel_get(fd, 1, IPV6_FL_S_ANY, 0)); in run_tests() 82 explain("cannot put non-existent label"); in run_tests() 83 expect_fail(flowlabel_put(fd, 1)); in run_tests() [all …]
|
| H A D | tun.c | 1 // SPDX-License-Identifier: GPL-2.0 20 static int tun_attach(int fd, char *dev) in tun_attach() argument 28 return ioctl(fd, TUNSETQUEUE, (void *) &ifr); in tun_attach() 31 static int tun_detach(int fd, char *dev) in tun_detach() argument 39 return ioctl(fd, TUNSETQUEUE, (void *) &ifr); in tun_detach() 45 int fd, err; in tun_alloc() local 47 fd = open("/dev/net/tun", O_RDWR); in tun_alloc() 48 if (fd < 0) { in tun_alloc() 49 fprintf(stderr, "can't open tun: %s\n", strerror(errno)); in tun_alloc() 50 return fd; in tun_alloc() [all …]
|
| /linux/tools/bpf/bpftool/ |
| H A D | common.c | 1 // SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 /* Copyright (C) 2017-2018 Netronome Systems, Inc. */ 84 /* Probe whether kernel switched from memlock-based (RLIMIT_MEMLOCK) to 85 * memcg-based memory accounting for BPF maps and programs. This was done in 86 * commit 97306be45fbe ("Merge branch 'switch to memcg-base 201 int fd = -1; open_obj_pinned() local 230 int fd; open_obj_pinned_any() local 363 do_pin_fd(int fd,const char * name) do_pin_fd() argument 381 int fd; do_pin_any() local 454 get_fd_type(int fd) get_fd_type() argument 483 get_fdinfo(int fd,const char * key) get_fdinfo() argument 555 int fd, err = 0; do_build_table_cb() local 678 int fd; read_sysfs_hex_int() local 814 int fd, nb_fds = 0; prog_fd_by_nametag() local 947 int nb_fds, fd; prog_parse_fd() local 975 int fd, nb_fds = 0; map_fd_by_name() local 1108 int nb_fds, fd; map_parse_fd() local 1136 int fd; map_parse_fd_and_info() local [all...] |
| H A D | struct_ops.c | 1 // SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 51 t = btf__type_by_id(kern_btf, info->btf_vmlinux_value_type_id); in get_kern_struct_ops_name() 52 st_ops_name = btf__name_by_offset(kern_btf, t->name_off); in get_kern_struct_ops_name() 72 p_err("can't find bpf_map_info from btf_vmlinux"); in get_map_info_type_id() 78 map_info_alloc_len = map_info_type->size; in get_map_info_type_id() 117 * It returns the fd in "*res_fd" and map_info in "*info". 118 * In the very first iteration, info->id should be 0. 119 * An optional map "*name" filter can be specified. 120 * The filter can be made more flexible in the future. 121 * e.g. filter by kernel-struct-ops-name, regex-name, glob-name, ...etc. [all …]
|
| /linux/tools/testing/selftests/pci_endpoint/ |
| H A D | pci_endpoint_test.c | 1 // SPDX-License-Identifier: GPL-2.0 27 ret = ioctl(self->fd, cmd, arg); \ 28 ret = ret < 0 ? -errno : ret; \ 31 static const char *test_device = "/dev/pci-endpoint-test.0"; 36 int fd; in FIXTURE() local 41 self->fd = open(test_device, O_RDWR); in FIXTURE_SETUP() 43 ASSERT_NE(-1, self->fd) TH_LOG("Can't open PCI Endpoint Test device"); in FIXTURE_SETUP() 48 close(self->fd); in FIXTURE_TEARDOWN() 67 pci_ep_ioctl(PCITEST_BAR, variant->barno); in TEST_F() 68 if (ret == -ENODATA) in TEST_F() [all …]
|
| /linux/drivers/net/can/peak_canfd/ |
| H A D | Kconfig | 1 # SPDX-License-Identifier: GPL-2.0-only 4 tristate "PEAK-System PCAN-PCIe FD cards" 6 This driver adds support for the PEAK-System PCI Express FD 7 CAN-FD cards family. 8 These 1x or 2x CAN-FD channels cards offer CAN 2.0 a/b as well as 9 CAN-FD access to the CAN bus. Besides the nominal bitrate of up to 10 1 Mbit/s, the data bytes of CAN-FD frames can be transmitted with 11 up to 12 Mbit/s. A galvanic isolation of the CAN ports protects the 13 disturbances of up to 500 Volts. The PCAN-PCI Express FD can be 14 operated with ambient temperatures in a range of -40 to +85 °C.
|
| /linux/Documentation/filesystems/ |
| H A D | inotify.rst | 1 .. SPDX-License-Identifier: GPL-2.0 4 Inotify - A Powerful yet Simple File Change Notification System 13 - Deleted obsoleted interface, just refer to manpages for user interface. 18 What is the design decision behind not tying the watch to the open fd of 29 What is the design decision behind using an-fd-per-instance as opposed to 30 an fd-per-watch? 33 An fd-per-watch quickly consumes more file descriptors than are allowed, 34 more fd's than are feasible to manage, and more fd's than are optimally 35 select()-able. Yes, root can bump the per-process fd limit and yes, users 36 can use epoll, but requiring both is a silly and extraneous requirement. [all …]
|
| /linux/include/uapi/linux/ |
| H A D | can.h | 1 /* SPDX-License-Identifier: ((GPL-2.0-only WITH Linux-syscall-note) OR BSD-3-Clause) */ 3 * linux/can.h 5 * Definitions for CAN network layer (socket addr / CAN frame / CAN filter) 9 * Copyright (c) 2002-2007 Volkswagen Group Electronic Research 53 /* controller area network (CAN) kernel definitions */ 60 /* valid bits in CAN ID for frame formats */ 69 * bit 0-28 : CAN identifier (11/29 bit) 83 * bit 0-28 : error class mask (see include/uapi/linux/can/error.h) 84 * bit 29-31 : set to zero 88 /* CAN payload length and DLC definitions according to ISO 11898-1 */ [all …]
|
| /linux/Documentation/input/ |
| H A D | uinput.rst | 10 process can create a virtual input device with specific capabilities. Once 11 this virtual device is created, the process can send events through it, 12 that will be delivered to userspace and in-kernel consumers. 28 create uinput devices and send events. libevdev is less error-prone than 38 --------------- 44 .. code-block:: c 48 void emit(int fd, int type, int code, int val) 59 write(fd, &ie, sizeof(ie)); 66 int fd = open("/dev/uinput", O_WRONLY | O_NONBLOCK); 73 ioctl(fd, UI_SET_EVBIT, EV_KEY); [all …]
|
| /linux/Documentation/networking/ |
| H A D | can.rst | 2 SocketCAN - Controller Area Network 8 The socketcan package is an implementation of CAN protocols 9 (Controller Area Network) for Linux. CAN is a networking technology 11 automotive fields. While there have been other CAN implementations 13 socket API, the Linux network stack and implements the CAN device 14 drivers as network interfaces. The CAN socket API has been designed 16 familiar with network programming, to easily learn how to use CAN 20 .. _socketcan-motivation: 25 There have been CAN implementations for Linux before SocketCAN so the 27 implementations come as a device driver for some CAN hardware, they [all …]
|
| H A D | packet_mmap.rst | 1 .. SPDX-License-Identifier: GPL-2.0 17 Howto can be found at: 22 - Ulisses Alonso Camaró <uaca@i.hate.spam.alumni.uv.es> 23 - Johann Baudy 34 configurable circular buffer mapped in user space that can be used to either 37 transmission, multiple packets can be sent through one system call to get the 48 card can also be an advantage. 67 [setup] socket() -------> creation of the capture socket 68 setsockopt() ---> allocation of the circular buffer (ring) 70 mmap() ---------> mapping of the allocated buffer to the [all …]
|
| H A D | phonet.rst | 1 .. SPDX-License-Identifier: GPL-2.0 9 ------------ 12 and RPC. With the Linux Phonet socket family, Linux host processes can 16 Phonet packets can be exchanged through various hardware connections 19 - USB with the CDC Phonet interface, 20 - infrared, 21 - Bluetooth, 22 - an RS232 serial port (with a dedicated "FBUS" line discipline), 23 - the SSI bus with some TI OMAP processors. 27 -------------- [all …]
|
| /linux/fs/ |
| H A D | file.c | 1 // SPDX-License-Identifier: GPL-2.0 5 * Copyright (C) 1998-1999, Stephen Tweedie and Bill Hawes 7 * Manage the dynamic fd arrays in the process files_struct. 37 atomic_long_set(&ref->refcnt, FILE_REF_DEAD); in __file_ref_put_badval() 47 atomic_long_set(&ref->refcnt, FILE_REF_SATURATED); in __file_ref_put_badval() 52 * __file_ref_put - Slowpath of file_ref_put() 60 * possible. This signals the caller that it can safely schedule the 75 * This can fail if a concurrent get() operation has in __file_ref_put() 81 if (!atomic_long_try_cmpxchg_release(&ref->refcnt, &cnt, FILE_REF_DEAD)) in __file_ref_put() 85 * The caller can safely schedule the object for in __file_ref_put() [all …]
|
| /linux/include/linux/can/ |
| H A D | length.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 3 * Copyright (C) 2020 Marc Kleine-Budde <kernel@pengutronix.de> 11 #include <linux/can.h> 12 #include <linux/can/netlink.h> 16 * Size of a Classical CAN Standard Frame header in bits 19 * --------------------------------------------------------- 26 * FD Format indicator (FDF) 1 34 * Size of a Classical CAN Extended Frame header in bits 37 * --------------------------------------------------------- 46 * FD Format indicator (FDF) 1 [all …]
|
| /linux/drivers/net/can/ctucanfd/ |
| H A D | Kconfig | 2 tristate "CTU CAN-FD IP core" if COMPILE_TEST 4 This driver adds support for the CTU CAN FD open-source IP core. 8 is available (https://gitlab.fel.cvut.cz/canbus/zynq/zynq-can-sja1000-top). 9 Implementation on Intel FPGA-based PCI Express board is available 10 from project (https://gitlab.fel.cvut.cz/canbus/pcie-ctucanfd) and 11 on Intel SoC from project (https://gitlab.fel.cvut.cz/canbus/intel-soc-ctucanfd). 12 Guidepost CTU FEE CAN bus projects page https://canbus.pages.fel.cvut.cz/ . 15 tristate "CTU CAN-FD IP core PCI/PCIe driver" 19 This driver adds PCI/PCIe support for CTU CAN-FD IP core. 22 at https://gitlab.fel.cvut.cz/canbus/pcie-ctucanfd . [all …]
|
| /linux/tools/testing/selftests/thermal/intel/workload_hint/ |
| H A D | workload_hint_test.c | 1 // SPDX-License-Identifier: GPL-2.0 29 int fd; in workload_hint_exit() local 33 fd = open(WORKLOAD_ENABLE_ATTRIBUTE, O_RDWR); in workload_hint_exit() 34 if (fd < 0) { in workload_hint_exit() 39 if (write(fd, "0\n", 2) < 0) { in workload_hint_exit() 40 perror("Can't disable workload hints"); in workload_hint_exit() 46 close(fd); in workload_hint_exit() 53 int fd, re in main() local [all...] |
| /linux/fs/jffs2/ |
| H A D | build.c | 2 * JFFS2 -- Journalling Flash File System, Version 2. 4 * Copyright © 2001-2007 Red Hat, Inc. 5 * Copyright © 2004-2010 David Woodhouse <dwmw2@infradead.org> 29 for (; *i < c->inocache_hashsize; (*i)++) { in first_inode_chain() 30 if (c->inocache_list[*i]) in first_inode_chain() 31 return c->inocache_list[*i]; in first_inode_chain() 40 if (ic->next) in next_inode() 41 return ic->next; in next_inode() 56 struct jffs2_full_dirent *fd; in jffs2_build_inode_pass1() local 58 dbg_fsbuild("building directory inode #%u\n", ic->ino); in jffs2_build_inode_pass1() [all …]
|
| /linux/Documentation/arch/powerpc/ |
| H A D | vas-api.rst | 1 .. SPDX-License-Identifier: GPL-2.0 2 .. _VAS-API: 12 allows both userspace and kernel communicate to co-processor 14 unit comprises of one or more hardware engines or co-processor types 20 then requests can be submitted directly without kernel involvement. 21 Requests to the GZIP engine must be formatted as a co-processor Request 30 kernel to setup channel / window which can be used to send compression 38 /dev/crypto/nx-gzip device node implemented by the VAS/NX device driver. 39 An application must open the /dev/crypto/nx-gzip device to obtain a file 40 descriptor (fd). Then should issue VAS_TX_WIN_OPEN ioctl with this fd to [all …]
|
| /linux/drivers/infiniband/hw/hfi1/ |
| H A D | user_exp_rcv.c | 1 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause 4 * Copyright(c) 2015-2018 Intel Corporation. 15 struct hfi1_filedata *fd); 17 static int set_rcvarray_entry(struct hfi1_filedata *fd, 29 static int program_rcvarray(struct hfi1_filedata *fd, struct tid_user_buf *, 33 static int unprogram_rcvarray(struct hfi1_filedata *fd, u32 tidinfo); 34 static void __clear_tid_node(struct hfi1_filedata *fd, 36 static void clear_tid_node(struct hfi1_filedata *fd, struct tid_rb_node *node); 50 int hfi1_user_exp_rcv_init(struct hfi1_filedata *fd, in hfi1_user_exp_rcv_init() argument 55 fd->entry_to_rb = kcalloc(uctxt->expected_count, in hfi1_user_exp_rcv_init() [all …]
|
| /linux/Documentation/networking/device_drivers/can/ctu/ |
| H A D | ctucanfd-driver.rst | 1 .. SPDX-License-Identifier: GPL-2.0-or-later 3 CTU CAN FD Driver 9 About CTU CAN FD IP Core 10 ------------------------ 12 `CTU CAN FD <https://gitlab.fel.cvut.cz/canbus/ctucanfd_ip_core>`_ 19 `Vivado integration <https://gitlab.fel.cvut.cz/canbus/zynq/zynq-can-sja1000-top>`_ 20 and Intel Cyclone V 5CSEMA4U23C6 based DE0-Nano-SoC Terasic board 21 `QSys integration <https://gitlab.fel.cvut.cz/canbus/intel-soc-ctucanfd>`_ 23 `PCIe integration <https://gitlab.fel.cvut.cz/canbus/pcie-ctucanfd>`_ of the core. 30 The basic functional model of the CTU CAN FD peripheral has been [all …]
|
| /linux/tools/testing/selftests/filesystems/ |
| H A D | kernfs_test.c | 1 // SPDX-License-Identifier: GPL-2.0 15 int fd; in TEST() local 17 /* Read-only file that can never have any extended attributes set. */ in TEST() 18 fd = open("/sys/kernel/warn_count", O_RDONLY | O_CLOEXEC); in TEST() 19 ASSERT_GE(fd, 0); in TEST() 20 ASSERT_EQ(flistxattr(fd, NULL, 0), 0); in TEST() 21 EXPECT_EQ(close(fd), 0); in TEST() 26 int fd; in TEST() local 29 /* Read-only file that can never have any extended attributes set. */ in TEST() 30 fd = open("/sys/kernel/warn_count", O_RDONLY | O_CLOEXEC); in TEST() [all …]
|
| /linux/Documentation/dev-tools/ |
| H A D | kcov.rst | 5 for coverage-guided fuzzing. Coverage data of a running kernel is exported via 7 thus KCOV can capture precise coverage of a single system call. 13 inherently non-deterministic parts of the kernel (e.g. scheduler, locking). 15 Besides collecting code coverage, KCOV can also collect comparison operands. 18 Besides collecting coverage data from syscall handlers, KCOV can also collect 24 ------------- 41 mount -t debugfs none /sys/kernel/debug 44 ------------------- 49 .. code-block:: c 73 int fd; [all …]
|
| /linux/tools/testing/selftests/thermal/intel/power_floor/ |
| H A D | power_floor_test.c | 1 // SPDX-License-Identifier: GPL-2.0 18 int fd; in power_floor_exit() local 22 fd = open(POWER_FLOOR_ENABLE_ATTRIBUTE, O_RDWR); in power_floor_exit() 23 if (fd < 0) { in power_floor_exit() 28 if (write(fd, "0\n", 2) < 0) { in power_floor_exit() 29 perror("Can' disable power floor notifications\n"); in power_floor_exit() 35 close(fd); in power_floor_exit() 42 int fd, ret; in main() local 52 fd = open(POWER_FLOOR_ENABLE_ATTRIBUTE, O_RDWR); in main() 53 if (fd < 0) { in main() [all …]
|
| /linux/tools/testing/selftests/bpf/prog_tests/ |
| H A D | test_veristat.c | 1 // SPDX-License-Identifier: GPL-2.0 9 if (!ASSERT_HAS_SUBSTR(fix->output, (str), (name))) \ 15 int fd; member 27 strcpy(fix->veristat, "./veristat"); in init_fixture() 29 strcpy(fix->veristat, "../veristat"); in init_fixture() 31 PRINT_FAIL("Can't find veristat binary"); in init_fixture() 33 snprintf(fix->tmpfile, sizeof(fix->tmpfil in init_fixture() 108 int fd; test_set_global_vars_from_file_succeeds() local [all...] |
| /linux/tools/perf/util/ |
| H A D | trace-event-info.c | 1 // SPDX-License-Identifier: GPL-2.0-only 24 #include "trace-event.h" 42 /* unfortunately, you can not stat debugfs or proc files for size */ 48 int r, fd; in record_file() local 49 int err = -EIO; in record_file() 51 fd = open(file, O_RDONLY); in record_file() 52 if (fd < 0) { in record_file() 53 pr_debug("Can't read '%s'", file); in record_file() 54 return -errno; in record_file() 64 r = read(fd, buf, BUFSIZ); in record_file() [all …]
|