Dsphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget-/translations/zh_CN/userspace-api/fwctl/fwctlmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget-/translations/zh_TW/userspace-api/fwctl/fwctlmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget-/translations/it_IT/userspace-api/fwctl/fwctlmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget-/translations/ja_JP/userspace-api/fwctl/fwctlmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget-/translations/ko_KR/userspace-api/fwctl/fwctlmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hPortuguese (Brazilian)}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget-/translations/pt_BR/userspace-api/fwctl/fwctlmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget-/translations/sp_SP/userspace-api/fwctl/fwctlmodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhcomment)}(h SPDX-License-Identifier: GPL-2.0h]h SPDX-License-Identifier: GPL-2.0}hhsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1hhhhhhG/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl.rsthKubhsection)}(hhh](htitle)}(hfwctl subsystemh]hfwctl subsystem}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh field_list)}(hhh]hfield)}(hhh](h field_name)}(hAuthorh]hAuthor}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhKubh field_body)}(hJason Gunthorpe h]h paragraph)}(hJason Gunthorpeh]hJason Gunthorpe}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhubah}(h]h ]h"]h$]h&]uh1hhhubeh}(h]h ]h"]h$]h&]uh1hhhhKhhhhubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hOverviewh]hOverview}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhK ubh)}(hX[Modern devices contain extensive amounts of FW, and in many cases, are largely software-defined pieces of hardware. The evolution of this approach is largely a reaction to Moore's Law where a chip tape out is now highly expensive, and the chip design is extremely large. Replacing fixed HW logic with a flexible and tightly coupled FW/HW combination is an effective risk mitigation against chip respin. Problems in the HW design can be counteracted in device FW. This is especially true for devices which present a stable and backwards compatible interface to the operating system driver (such as NVMe).h]hX]Modern devices contain extensive amounts of FW, and in many cases, are largely software-defined pieces of hardware. The evolution of this approach is largely a reaction to Moore’s Law where a chip tape out is now highly expensive, and the chip design is extremely large. Replacing fixed HW logic with a flexible and tightly coupled FW/HW combination is an effective risk mitigation against chip respin. Problems in the HW design can be counteracted in device FW. This is especially true for devices which present a stable and backwards compatible interface to the operating system driver (such as NVMe).}(hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hjhhubh)}(hThe FW layer in devices has grown to incredible size and devices frequently integrate clusters of fast processors to run it. For example, mlx5 devices have over 30MB of FW code, and big configurations operate with over 1GB of FW managed runtime state.h]hThe FW layer in devices has grown to incredible size and devices frequently integrate clusters of fast processors to run it. For example, mlx5 devices have over 30MB of FW code, and big configurations operate with over 1GB of FW managed runtime state.}(hj>hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hXThe availability of such a flexible layer has created quite a variety in the industry where single pieces of silicon are now configurable software-defined devices and can operate in substantially different ways depending on the need. Further, we often see cases where specific sites wish to operate devices in ways that are highly specialized and require applications that have been tailored to their unique configuration.h]hXThe availability of such a flexible layer has created quite a variety in the industry where single pieces of silicon are now configurable software-defined devices and can operate in substantially different ways depending on the need. Further, we often see cases where specific sites wish to operate devices in ways that are highly specialized and require applications that have been tailored to their unique configuration.}(hjLhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hX9Further, devices have become multi-functional and integrated to the point they no longer fit neatly into the kernel's division of subsystems. Modern multi-functional devices have drivers, such as bnxt/ice/mlx5/pds, that span many subsystems while sharing the underlying hardware using the auxiliary device system.h]hX;Further, devices have become multi-functional and integrated to the point they no longer fit neatly into the kernel’s division of subsystems. Modern multi-functional devices have drivers, such as bnxt/ice/mlx5/pds, that span many subsystems while sharing the underlying hardware using the auxiliary device system.}(hjZhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK!hjhhubh)}(hXAll together this creates a challenge for the operating system, where devices have an expansive FW environment that needs robust device-specific debugging support, and FW-driven functionality that is not well suited to “generic” interfaces. fwctl seeks to allow access to the full device functionality from user space in the areas of debuggability, management, and first-boot/nth-boot provisioning.h]hXAll together this creates a challenge for the operating system, where devices have an expansive FW environment that needs robust device-specific debugging support, and FW-driven functionality that is not well suited to “generic” interfaces. fwctl seeks to allow access to the full device functionality from user space in the areas of debuggability, management, and first-boot/nth-boot provisioning.}(hjhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK'hjhhubh)}(hXfwctl is aimed at the common device design pattern where the OS and FW communicate via an RPC message layer constructed with a queue or mailbox scheme. In this case the driver will typically have some layer to deliver RPC messages and collect RPC responses from device FW. The in-kernel subsystem drivers that operate the device for its primary purposes will use these RPCs to build their drivers, but devices also usually have a set of ancillary RPCs that don't really fit into any specific subsystem. For example, a HW RAID controller is primarily operated by the block layer but also comes with a set of RPCs to administer the construction of drives within the HW RAID.h]hXfwctl is aimed at the common device design pattern where the OS and FW communicate via an RPC message layer constructed with a queue or mailbox scheme. In this case the driver will typically have some layer to deliver RPC messages and collect RPC responses from device FW. The in-kernel subsystem drivers that operate the device for its primary purposes will use these RPCs to build their drivers, but devices also usually have a set of ancillary RPCs that don’t really fit into any specific subsystem. For example, a HW RAID controller is primarily operated by the block layer but also comes with a set of RPCs to administer the construction of drives within the HW RAID.}(hjvhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK.hjhhubh)}(hX)In the past when devices were more single function, individual subsystems would grow different approaches to solving some of these common problems. For instance, monitoring device health, manipulating its FLASH, debugging the FW, provisioning, all have various unique interfaces across the kernel.h]hX)In the past when devices were more single function, individual subsystems would grow different approaches to solving some of these common problems. For instance, monitoring device health, manipulating its FLASH, debugging the FW, provisioning, all have various unique interfaces across the kernel.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK8hjhhubh)}(hXfwctl's purpose is to define a common set of limited rules, described below, that allow user space to securely construct and execute RPCs inside device FW. The rules serve as an agreement between the operating system and FW on how to correctly design the RPC interface. As a uAPI the subsystem provides a thin layer of discovery and a generic uAPI to deliver the RPCs and collect the response. It supports a system of user space libraries and tools which will use this interface to control the device using the device native protocols.h]hXfwctl’s purpose is to define a common set of limited rules, described below, that allow user space to securely construct and execute RPCs inside device FW. The rules serve as an agreement between the operating system and FW on how to correctly design the RPC interface. As a uAPI the subsystem provides a thin layer of discovery and a generic uAPI to deliver the RPCs and collect the response. It supports a system of user space libraries and tools which will use this interface to control the device using the device native protocols.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK=hjhhubh)}(hhh](h)}(hScope of Actionh]hScope of Action}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKFubh)}(hfwctl drivers are strictly restricted to being a way to operate the device FW. It is not an avenue to access random kernel internals, or other operating system SW states.h]hfwctl drivers are strictly restricted to being a way to operate the device FW. It is not an avenue to access random kernel internals, or other operating system SW states.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKHhjhhubh)}(hX(fwctl instances must operate on a well-defined device function, and the device should have a well-defined security model for what scope within the physical device the function is permitted to access. For instance, the most complex PCIe device today may broadly have several function-level scopes:h]hX(fwctl instances must operate on a well-defined device function, and the device should have a well-defined security model for what scope within the physical device the function is permitted to access. For instance, the most complex PCIe device today may broadly have several function-level scopes:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKLhjhhubh block_quote)}(h1. A privileged function with full access to the on-device global state and configuration 2. Multiple hypervisor functions with control over itself and child functions used with VMs 3. Multiple VM functions tightly scoped within the VM h]henumerated_list)}(hhh](h list_item)}(hWA privileged function with full access to the on-device global state and configuration h]h)}(hVA privileged function with full access to the on-device global state and configurationh]hVA privileged function with full access to the on-device global state and configuration}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKQhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hYMultiple hypervisor functions with control over itself and child functions used with VMs h]h)}(hXMultiple hypervisor functions with control over itself and child functions used with VMsh]hXMultiple hypervisor functions with control over itself and child functions used with VMs}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKThjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(h3Multiple VM functions tightly scoped within the VM h]h)}(h2Multiple VM functions tightly scoped within the VMh]h2Multiple VM functions tightly scoped within the VM}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKWhj ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]enumtypearabicprefixhsuffix.uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhKQhjhhubh)}(hXKThe device may create a logical parent/child relationship between these scopes. For instance, a child VM's FW may be within the scope of the hypervisor FW. It is quite common in the VFIO world that the hypervisor environment has a complex provisioning/profiling/configuration responsibility for the function VFIO assigns to the VM.h]hXMThe device may create a logical parent/child relationship between these scopes. For instance, a child VM’s FW may be within the scope of the hypervisor FW. It is quite common in the VFIO world that the hypervisor environment has a complex provisioning/profiling/configuration responsibility for the function VFIO assigns to the VM.}(hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKYhjhhubh)}(hFurther, within the function, devices often have RPC commands that fall within some general scopes of action (see enum fwctl_rpc_scope):h]hFurther, within the function, devices often have RPC commands that fall within some general scopes of action (see enum fwctl_rpc_scope):}(hjAhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK_hjhhubj)}(hXz1. Access to function & child configuration, FLASH, etc. that becomes live at a function reset. Access to function & child runtime configuration that is transparent or non-disruptive to any driver or VM. 2. Read-only access to function debug information that may report on FW objects in the function & child, including FW objects owned by other kernel subsystems. 3. Write access to function & child debug information strictly compatible with the principles of kernel lockdown and kernel integrity protection. Triggers a kernel taint. 4. Full debug device access. Triggers a kernel taint, requires CAP_SYS_RAWIO. h]j)}(hhh](j)}(hAccess to function & child configuration, FLASH, etc. that becomes live at a function reset. Access to function & child runtime configuration that is transparent or non-disruptive to any driver or VM. h]h)}(hAccess to function & child configuration, FLASH, etc. that becomes live at a function reset. Access to function & child runtime configuration that is transparent or non-disruptive to any driver or VM.h]hAccess to function & child configuration, FLASH, etc. that becomes live at a function reset. Access to function & child runtime configuration that is transparent or non-disruptive to any driver or VM.}(hjZhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKbhjVubah}(h]h ]h"]h$]h&]uh1jhjSubj)}(hRead-only access to function debug information that may report on FW objects in the function & child, including FW objects owned by other kernel subsystems. h]h)}(hRead-only access to function debug information that may report on FW objects in the function & child, including FW objects owned by other kernel subsystems.h]hRead-only access to function debug information that may report on FW objects in the function & child, including FW objects owned by other kernel subsystems.}(hjrhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKfhjnubah}(h]h ]h"]h$]h&]uh1jhjSubj)}(hWrite access to function & child debug information strictly compatible with the principles of kernel lockdown and kernel integrity protection. Triggers a kernel taint. h]h)}(hWrite access to function & child debug information strictly compatible with the principles of kernel lockdown and kernel integrity protection. Triggers a kernel taint.h]hWrite access to function & child debug information strictly compatible with the principles of kernel lockdown and kernel integrity protection. Triggers a kernel taint.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKjhjubah}(h]h ]h"]h$]h&]uh1jhjSubj)}(hKFull debug device access. Triggers a kernel taint, requires CAP_SYS_RAWIO. h]h)}(hJFull debug device access. Triggers a kernel taint, requires CAP_SYS_RAWIO.h]hJFull debug device access. Triggers a kernel taint, requires CAP_SYS_RAWIO.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKnhjubah}(h]h ]h"]h$]h&]uh1jhjSubeh}(h]h ]h"]h$]h&]j(j)j*hj+j,uh1jhjOubah}(h]h ]h"]h$]h&]uh1jhhhKbhjhhubh)}(hUser space will provide a scope label on each RPC and the kernel must enforce the above CAPs and taints based on that scope. A combination of kernel and FW can enforce that RPCs are placed in the correct scope by user space.h]hUser space will provide a scope label on each RPC and the kernel must enforce the above CAPs and taints based on that scope. A combination of kernel and FW can enforce that RPCs are placed in the correct scope by user space.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKphjhhubeh}(h]scope-of-actionah ]h"]scope of actionah$]h&]uh1hhjhhhhhKFubh)}(hhh](h)}(hDisallowed behaviorh]hDisallowed behavior}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKuubh)}(hThere are many things this interface must not allow user space to do (without a taint or CAP), broadly derived from the principles of kernel lockdown. Some examples:h]hThere are many things this interface must not allow user space to do (without a taint or CAP), broadly derived from the principles of kernel lockdown. Some examples:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKwhjhhubj)}(hX1. DMA to/from arbitrary memory, hang the system, compromise FW integrity with untrusted code, or otherwise compromise device or system security and integrity. 2. Provide an abnormal “back door” to kernel drivers. No manipulation of kernel objects owned by kernel drivers. 3. Directly configure or otherwise control kernel drivers. A subsystem kernel driver can react to the device configuration at function reset/driver load time, but otherwise must not be coupled to fwctl. 4. Operate the HW in a way that overlaps with the core purpose of another primary kernel subsystem, such as read/write to LBAs, send/receive of network packets, or operate an accelerator's data plane. h]j)}(hhh](j)}(hDMA to/from arbitrary memory, hang the system, compromise FW integrity with untrusted code, or otherwise compromise device or system security and integrity. h]h)}(hDMA to/from arbitrary memory, hang the system, compromise FW integrity with untrusted code, or otherwise compromise device or system security and integrity.h]hDMA to/from arbitrary memory, hang the system, compromise FW integrity with untrusted code, or otherwise compromise device or system security and integrity.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK{hjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hrProvide an abnormal “back door” to kernel drivers. No manipulation of kernel objects owned by kernel drivers. h]h)}(hqProvide an abnormal “back door” to kernel drivers. No manipulation of kernel objects owned by kernel drivers.h]hqProvide an abnormal “back door” to kernel drivers. No manipulation of kernel objects owned by kernel drivers.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hDirectly configure or otherwise control kernel drivers. A subsystem kernel driver can react to the device configuration at function reset/driver load time, but otherwise must not be coupled to fwctl. h]h)}(hDirectly configure or otherwise control kernel drivers. A subsystem kernel driver can react to the device configuration at function reset/driver load time, but otherwise must not be coupled to fwctl.h]hDirectly configure or otherwise control kernel drivers. A subsystem kernel driver can react to the device configuration at function reset/driver load time, but otherwise must not be coupled to fwctl.}(hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj.ubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hOperate the HW in a way that overlaps with the core purpose of another primary kernel subsystem, such as read/write to LBAs, send/receive of network packets, or operate an accelerator's data plane. h]h)}(hOperate the HW in a way that overlaps with the core purpose of another primary kernel subsystem, such as read/write to LBAs, send/receive of network packets, or operate an accelerator's data plane.h]hOperate the HW in a way that overlaps with the core purpose of another primary kernel subsystem, such as read/write to LBAs, send/receive of network packets, or operate an accelerator’s data plane.}(hjJhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjFubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]j(j)j*hj+j,uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhK{hjhhubh)}(hRfwctl is not a replacement for device direct access subsystems like uacce or VFIO.h]hRfwctl is not a replacement for device direct access subsystems like uacce or VFIO.}(hjjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hXOperations exposed through fwctl's non-tainting interfaces should be fully sharable with other users of the device. For instance, exposing a RPC through fwctl should never prevent a kernel subsystem from also concurrently using that same RPC or hardware unit down the road. In such cases fwctl will be less important than proper kernel subsystems that eventually emerge. Mistakes in this area resulting in clashes will be resolved in favour of a kernel implementation.h]hXOperations exposed through fwctl’s non-tainting interfaces should be fully sharable with other users of the device. For instance, exposing a RPC through fwctl should never prevent a kernel subsystem from also concurrently using that same RPC or hardware unit down the road. In such cases fwctl will be less important than proper kernel subsystems that eventually emerge. Mistakes in this area resulting in clashes will be resolved in favour of a kernel implementation.}(hjxhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h]disallowed-behaviorah ]h"]disallowed behaviorah$]h&]uh1hhjhhhhhKuubeh}(h]overviewah ]h"]overviewah$]h&]uh1hhhhhhhhK ubh)}(hhh](h)}(hfwctl User APIh]hfwctl User API}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubhindex)}(hhh]h}(h]h ]h"]h$]h&]entries](singlefwctl_info_bnxt (C struct)c.fwctl_info_bnxthNtauh1jhjhhhd/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:151: ./include/uapi/fwctl/bnxt.hhNubhdesc)}(hhh](hdesc_signature)}(hfwctl_info_bnxth]hdesc_signature_line)}(hstruct fwctl_info_bnxth](hdesc_sig_keyword)}(hstructh]hstruct}(hjhhhNhNubah}(h]h ]kah"]h$]h&]uh1jhjhhhd/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:151: ./include/uapi/fwctl/bnxt.hhKubhdesc_sig_space)}(h h]h }(hjhhhNhNubah}(h]h ]wah"]h$]h&]uh1jhjhhhjhKubh desc_name)}(hfwctl_info_bnxth]h desc_sig_name)}(hjh]hfwctl_info_bnxt}(hjhhhNhNubah}(h]h ]nah"]h$]h&]uh1jhjubah}(h]h ](sig-namedescnameeh"]h$]h&]hhuh1jhjhhhjhKubeh}(h]h ]h"]h$]h&]hhƌ add_permalinkuh1jsphinx_line_type declaratorhjhhhjhKubah}(h]jah ](sig sig-objecteh"]h$]h&] is_multiline _toc_parts) _toc_namehuh1jhjhKhjhhubh desc_content)}(hhh]h)}(h!ioctl(FWCTL_INFO) out_device_datah]h!ioctl(FWCTL_INFO) out_device_data}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1hhd/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:151: ./include/uapi/fwctl/bnxt.hhKhj!hhubah}(h]h ]h"]h$]h&]uh1jhjhhhjhKubeh}(h]h ](cstructeh"]h$]h&]domainj<objtypej=desctypej=noindex noindexentrynocontentsentryuh1jhhhjhjhNubh container)}(h**Definition**:: struct fwctl_info_bnxt { __u32 uctx_caps; }; **Members** ``uctx_caps`` The command capabilities driver accepts.h](h)}(h**Definition**::h](hstrong)}(h**Definition**h]h Definition}(hjShhhNhNubah}(h]h ]h"]h$]h&]uh1jQhjMubh:}(hjMhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhd/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:151: ./include/uapi/fwctl/bnxt.hhKhjIubh literal_block)}(h0struct fwctl_info_bnxt { __u32 uctx_caps; };h]h0struct fwctl_info_bnxt { __u32 uctx_caps; };}hjnsbah}(h]h ]h"]h$]h&]hhuh1jlhd/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:151: ./include/uapi/fwctl/bnxt.hhKhjIubh)}(h **Members**h]jR)}(hjh]hMembers}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jQhj}ubah}(h]h ]h"]h$]h&]uh1hhd/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:151: ./include/uapi/fwctl/bnxt.hhKhjIubhdefinition_list)}(hhh]hdefinition_list_item)}(h6``uctx_caps`` The command capabilities driver accepts.h](hterm)}(h ``uctx_caps``h]hliteral)}(hjh]h uctx_caps}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhd/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:151: ./include/uapi/fwctl/bnxt.hhKhjubh definition)}(hhh]h)}(h(The command capabilities driver accepts.h]h(The command capabilities driver accepts.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhd/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:151: ./include/uapi/fwctl/bnxt.hhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhKhjubah}(h]h ]h"]h$]h&]uh1jhjIubeh}(h]h ] kernelindentah"]h$]h&]uh1jGhjhhhjhNubh)}(h**Description**h]jR)}(hjh]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jQhjubah}(h]h ]h"]h$]h&]uh1hhd/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:151: ./include/uapi/fwctl/bnxt.hhKhjhhubh)}(h:Return basic information about the FW interface available.h]h:Return basic information about the FW interface available.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhd/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:151: ./include/uapi/fwctl/bnxt.hhKhjhhubhtarget)}(h.. _General ioctl format:h]h}(h]h ]h"]h$]h&]refidgeneral-ioctl-formatuh1jhKhjhhhe/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:152: ./include/uapi/fwctl/fwctl.hubh)}(h**General ioctl format**h]jR)}(hj!h]hGeneral ioctl format}(hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1jQhjubah}(h]jah ]h"]general ioctl formatah$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:152: ./include/uapi/fwctl/fwctl.hhKhjhhexpect_referenced_by_name}j4jsexpect_referenced_by_id}jjsubh)}(hXxThe ioctl interface follows a general format to allow for extensibility. Each ioctl is passed a structure pointer as the argument providing the size of the structure in the first u32. The kernel checks that any structure space beyond what it understands is 0. This allows userspace to use the backward compatible portion while consistently using the newer, larger, structures.h]hXxThe ioctl interface follows a general format to allow for extensibility. Each ioctl is passed a structure pointer as the argument providing the size of the structure in the first u32. The kernel checks that any structure space beyond what it understands is 0. This allows userspace to use the backward compatible portion while consistently using the newer, larger, structures.}(hj<hhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:152: ./include/uapi/fwctl/fwctl.hhK hjhhubh)}(h0ioctls use a standard meaning for common errnos:h]h0ioctls use a standard meaning for common errnos:}(hjKhhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:152: ./include/uapi/fwctl/fwctl.hhKhjhhubj)}(hX- ENOTTY: The IOCTL number itself is not supported at all - E2BIG: The IOCTL number is supported, but the provided structure has non-zero in a part the kernel does not understand. - EOPNOTSUPP: The IOCTL number is supported, and the structure is understood, however a known field has a value the kernel does not understand or support. - EINVAL: Everything about the IOCTL was understood, but a field is not correct. - ENOMEM: Out of memory. - ENODEV: The underlying device has been hot-unplugged and the FD is orphaned. h]h bullet_list)}(hhh](j)}(h7ENOTTY: The IOCTL number itself is not supported at allh]h)}(hjeh]h7ENOTTY: The IOCTL number itself is not supported at all}(hjghhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:152: ./include/uapi/fwctl/fwctl.hhKhjcubah}(h]h ]h"]h$]h&]uh1jhj`ubj)}(hwE2BIG: The IOCTL number is supported, but the provided structure has non-zero in a part the kernel does not understand.h]h)}(hwE2BIG: The IOCTL number is supported, but the provided structure has non-zero in a part the kernel does not understand.h]hwE2BIG: The IOCTL number is supported, but the provided structure has non-zero in a part the kernel does not understand.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:152: ./include/uapi/fwctl/fwctl.hhKhj{ubah}(h]h ]h"]h$]h&]uh1jhj`ubj)}(hEOPNOTSUPP: The IOCTL number is supported, and the structure is understood, however a known field has a value the kernel does not understand or support.h]h)}(hEOPNOTSUPP: The IOCTL number is supported, and the structure is understood, however a known field has a value the kernel does not understand or support.h]hEOPNOTSUPP: The IOCTL number is supported, and the structure is understood, however a known field has a value the kernel does not understand or support.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:152: ./include/uapi/fwctl/fwctl.hhKhjubah}(h]h ]h"]h$]h&]uh1jhj`ubj)}(hNEINVAL: Everything about the IOCTL was understood, but a field is not correct.h]h)}(hNEINVAL: Everything about the IOCTL was understood, but a field is not correct.h]hNEINVAL: Everything about the IOCTL was understood, but a field is not correct.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:152: ./include/uapi/fwctl/fwctl.hhKhjubah}(h]h ]h"]h$]h&]uh1jhj`ubj)}(hENOMEM: Out of memory.h]h)}(hjh]hENOMEM: Out of memory.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:152: ./include/uapi/fwctl/fwctl.hhKhjubah}(h]h ]h"]h$]h&]uh1jhj`ubj)}(hUENODEV: The underlying device has been hot-unplugged and the FD is orphaned. h]j)}(hhh]j)}(hMENODEV: The underlying device has been hot-unplugged and the FD is orphaned. h](j)}(hBENODEV: The underlying device has been hot-unplugged and the FD ish]hBENODEV: The underlying device has been hot-unplugged and the FD is}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhe/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:152: ./include/uapi/fwctl/fwctl.hhKhjubj)}(hhh]h)}(h orphaned.h]h orphaned.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhKhjubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhj`ubeh}(h]h ]h"]h$]h&]bullet-uh1j^hjthKhjZubah}(h]h ]h"]h$]h&]uh1jhjthKhjhhubh)}(h5As well as additional errnos, within specific ioctls.h]h5As well as additional errnos, within specific ioctls.}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:152: ./include/uapi/fwctl/fwctl.hhK!hjhhubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jfwctl_info (C struct) c.fwctl_infohNtauh1jhjhhhjhNubj)}(hhh](j)}(h fwctl_infoh]j)}(hstruct fwctl_infoh](j)}(hjh]hstruct}(hjWhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjShhhe/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:152: ./include/uapi/fwctl/fwctl.hhK&ubj)}(h h]h }(hjehhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjShhhjdhK&ubj)}(h fwctl_infoh]j)}(hjQh]h fwctl_info}(hjwhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjsubah}(h]h ](jjeh"]h$]h&]hhuh1jhjShhhjdhK&ubeh}(h]h ]h"]h$]h&]hhjuh1jjjhjOhhhjdhK&ubah}(h]jJah ](jjeh"]h$]h&]jj)jhuh1jhjdhK&hjLhhubj )}(hhh]h)}(hioctl(FWCTL_INFO)h]hioctl(FWCTL_INFO)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:152: ./include/uapi/fwctl/fwctl.hhK4hjhhubah}(h]h ]h"]h$]h&]uh1jhjLhhhjdhK&ubeh}(h]h ](j<structeh"]h$]h&]jAj<jBjjCjjDjEjFuh1jhhhjhjhNubjH)}(hX**Definition**:: struct fwctl_info { __u32 size; __u32 flags; __u32 out_device_type; __u32 device_data_len; __aligned_u64 out_device_data; }; **Members** ``size`` sizeof(struct fwctl_info) ``flags`` Must be 0 ``out_device_type`` Returns the type of the device from enum fwctl_device_type ``device_data_len`` On input the length of the out_device_data memory. On output the size of the kernel's device_data which may be larger or smaller than the input. Maybe 0 on input. ``out_device_data`` Pointer to a memory of device_data_len bytes. Kernel will fill the entire memory, zeroing as required.h](h)}(h**Definition**::h](jR)}(h**Definition**h]h Definition}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jQhjubh:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:152: ./include/uapi/fwctl/fwctl.hhK8hjubjm)}(hstruct fwctl_info { __u32 size; __u32 flags; __u32 out_device_type; __u32 device_data_len; __aligned_u64 out_device_data; };h]hstruct fwctl_info { __u32 size; __u32 flags; __u32 out_device_type; __u32 device_data_len; __aligned_u64 out_device_data; };}hjsbah}(h]h ]h"]h$]h&]hhuh1jlhe/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:152: ./include/uapi/fwctl/fwctl.hhK:hjubh)}(h **Members**h]jR)}(hjh]hMembers}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jQhjubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:152: ./include/uapi/fwctl/fwctl.hhKBhjubj)}(hhh](j)}(h#``size`` sizeof(struct fwctl_info) h](j)}(h``size``h]j)}(hjh]hsize}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhe/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:152: ./include/uapi/fwctl/fwctl.hhK6hjubj)}(hhh]h)}(hsizeof(struct fwctl_info)h]hsizeof(struct fwctl_info)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhK6hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhK6hjubj)}(h``flags`` Must be 0 h](j)}(h ``flags``h]j)}(hj?h]hflags}(hjAhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj=ubah}(h]h ]h"]h$]h&]uh1jhe/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:152: ./include/uapi/fwctl/fwctl.hhK7hj9ubj)}(hhh]h)}(h Must be 0h]h Must be 0}(hjXhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjThK7hjUubah}(h]h ]h"]h$]h&]uh1jhj9ubeh}(h]h ]h"]h$]h&]uh1jhjThK7hjubj)}(hO``out_device_type`` Returns the type of the device from enum fwctl_device_type h](j)}(h``out_device_type``h]j)}(hjxh]hout_device_type}(hjzhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjvubah}(h]h ]h"]h$]h&]uh1jhe/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:152: ./include/uapi/fwctl/fwctl.hhK8hjrubj)}(hhh]h)}(h:Returns the type of the device from enum fwctl_device_typeh]h:Returns the type of the device from enum fwctl_device_type}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhK8hjubah}(h]h ]h"]h$]h&]uh1jhjrubeh}(h]h ]h"]h$]h&]uh1jhjhK8hjubj)}(h``device_data_len`` On input the length of the out_device_data memory. On output the size of the kernel's device_data which may be larger or smaller than the input. Maybe 0 on input. h](j)}(h``device_data_len``h]j)}(hjh]hdevice_data_len}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhe/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:152: ./include/uapi/fwctl/fwctl.hhK;hjubj)}(hhh]h)}(hOn input the length of the out_device_data memory. On output the size of the kernel's device_data which may be larger or smaller than the input. Maybe 0 on input.h]hOn input the length of the out_device_data memory. On output the size of the kernel’s device_data which may be larger or smaller than the input. Maybe 0 on input.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:152: ./include/uapi/fwctl/fwctl.hhK9hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhK;hjubj)}(hz``out_device_data`` Pointer to a memory of device_data_len bytes. Kernel will fill the entire memory, zeroing as required.h](j)}(h``out_device_data``h]j)}(hjh]hout_device_data}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhe/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:152: ./include/uapi/fwctl/fwctl.hhKhhhc/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:154: ./include/uapi/fwctl/pds.hhKubj)}(h h]h }(hjPhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj>hhhjOhKubj)}(hpds_fwctl_capabilitiesh]j)}(hj<h]hpds_fwctl_capabilities}(hjbhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj^ubah}(h]h ](jjeh"]h$]h&]hhuh1jhj>hhhjOhKubeh}(h]h ]h"]h$]h&]hhjuh1jjjhj:hhhjOhKubah}(h]j5ah ](jjeh"]h$]h&]jj)jhuh1jhjOhKhj7hhubj )}(hhh]h}(h]h ]h"]h$]h&]uh1jhj7hhhjOhKubeh}(h]h ](j<enumeh"]h$]h&]jAj<jBjjCjjDjEjFuh1jhhhjhNhNubjH)}(h**Constants** ``PDS_FWCTL_QUERY_CAP`` firmware can be queried for information ``PDS_FWCTL_SEND_CAP`` firmware can be sent commandsh](h)}(h **Constants**h]jR)}(hjh]h Constants}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jQhjubah}(h]h ]h"]h$]h&]uh1hhc/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:154: ./include/uapi/fwctl/pds.hhKhjubj)}(hhh](j)}(h@``PDS_FWCTL_QUERY_CAP`` firmware can be queried for information h](j)}(h``PDS_FWCTL_QUERY_CAP``h]j)}(hjh]hPDS_FWCTL_QUERY_CAP}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhc/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:154: ./include/uapi/fwctl/pds.hhKhjubj)}(hhh]h)}(h'firmware can be queried for informationh]h'firmware can be queried for information}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhKhjubj)}(h4``PDS_FWCTL_SEND_CAP`` firmware can be sent commandsh](j)}(h``PDS_FWCTL_SEND_CAP``h]j)}(hjh]hPDS_FWCTL_SEND_CAP}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhc/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:154: ./include/uapi/fwctl/pds.hhK!hjubj)}(hhh]h)}(hfirmware can be sent commandsh]hfirmware can be sent commands}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhc/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:154: ./include/uapi/fwctl/pds.hhK"hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhK!hjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ] kernelindentah"]h$]h&]uh1jGhjhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jfwctl_rpc_pds (C struct)c.fwctl_rpc_pdshNtauh1jhjhhhNhNubj)}(hhh](j)}(h fwctl_rpc_pdsh]j)}(hstruct fwctl_rpc_pdsh](j)}(hjh]hstruct}(hjIhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjEhhhc/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:154: ./include/uapi/fwctl/pds.hhK'ubj)}(h h]h }(hjWhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjEhhhjVhK'ubj)}(h fwctl_rpc_pdsh]j)}(hjCh]h fwctl_rpc_pds}(hjihhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjeubah}(h]h ](jjeh"]h$]h&]hhuh1jhjEhhhjVhK'ubeh}(h]h ]h"]h$]h&]hhjuh1jjjhjAhhhjVhK'ubah}(h]j<ah ](jjeh"]h$]h&]jj)jhuh1jhjVhK'hj>hhubj )}(hhh]h}(h]h ]h"]h$]h&]uh1jhj>hhhjVhK'ubeh}(h]h ](j<structeh"]h$]h&]jAj<jBjjCjjDjEjFuh1jhhhjhNhNubjH)}(hX**Definition**:: struct fwctl_rpc_pds { struct { __u32 op; __u32 ep; __u32 rsvd; __u32 len; __aligned_u64 payload; } in; struct { __u32 retval; __u32 rsvd[2]; __u32 len; __aligned_u64 payload; } out; }; **Members** ``in`` rpc in parameters ``in.op`` requested operation code ``in.ep`` firmware endpoint to operate on ``in.rsvd`` reserved ``in.len`` length of payload data ``in.payload`` address of payload buffer ``out`` rpc out parameters ``out.retval`` operation result value ``out.rsvd`` reserved ``out.len`` length of result data buffer ``out.payload`` address of payload data bufferh](h)}(h**Definition**::h](jR)}(h**Definition**h]h Definition}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jQhjubh:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhc/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:154: ./include/uapi/fwctl/pds.hhK&hjubjm)}(hXstruct fwctl_rpc_pds { struct { __u32 op; __u32 ep; __u32 rsvd; __u32 len; __aligned_u64 payload; } in; struct { __u32 retval; __u32 rsvd[2]; __u32 len; __aligned_u64 payload; } out; };h]hXstruct fwctl_rpc_pds { struct { __u32 op; __u32 ep; __u32 rsvd; __u32 len; __aligned_u64 payload; } in; struct { __u32 retval; __u32 rsvd[2]; __u32 len; __aligned_u64 payload; } out; };}hjsbah}(h]h ]h"]h$]h&]hhuh1jlhc/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:154: ./include/uapi/fwctl/pds.hhK(hjubh)}(h **Members**h]jR)}(hjh]hMembers}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jQhjubah}(h]h ]h"]h$]h&]uh1hhc/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:154: ./include/uapi/fwctl/pds.hhK8hjubj)}(hhh](j)}(h``in`` rpc in parameters h](j)}(h``in``h]j)}(hjh]hin}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhc/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:154: ./include/uapi/fwctl/pds.hhK)hjubj)}(hhh]h)}(hrpc in parametersh]hrpc in parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhK)hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhK)hjubj)}(h#``in.op`` requested operation code h](j)}(h ``in.op``h]j)}(hj"h]hin.op}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1jhc/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:154: ./include/uapi/fwctl/pds.hhK$hjubj)}(hhh]h)}(hrequested operation codeh]hrequested operation code}(hj;hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj7hK$hj8ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhj7hK$hjubj)}(h*``in.ep`` firmware endpoint to operate on h](j)}(h ``in.ep``h]j)}(hj[h]hin.ep}(hj]hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjYubah}(h]h ]h"]h$]h&]uh1jhc/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:154: ./include/uapi/fwctl/pds.hhK%hjUubj)}(hhh]h)}(hfirmware endpoint to operate onh]hfirmware endpoint to operate on}(hjthhhNhNubah}(h]h ]h"]h$]h&]uh1hhjphK%hjqubah}(h]h ]h"]h$]h&]uh1jhjUubeh}(h]h ]h"]h$]h&]uh1jhjphK%hjubj)}(h``in.rsvd`` reserved h](j)}(h ``in.rsvd``h]j)}(hjh]hin.rsvd}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhc/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:154: ./include/uapi/fwctl/pds.hhK&hjubj)}(hhh]h)}(hreservedh]hreserved}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhK&hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhK&hjubj)}(h"``in.len`` length of payload data h](j)}(h ``in.len``h]j)}(hjh]hin.len}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhc/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:154: ./include/uapi/fwctl/pds.hhK'hjubj)}(hhh]h)}(hlength of payload datah]hlength of payload data}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhK'hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhK'hjubj)}(h)``in.payload`` address of payload buffer h](j)}(h``in.payload``h]j)}(hjh]h in.payload}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhc/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:154: ./include/uapi/fwctl/pds.hhK(hjubj)}(hhh]h)}(haddress of payload bufferh]haddress of payload buffer}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhK(hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhK(hjubj)}(h``out`` rpc out parameters h](j)}(h``out``h]j)}(hj?h]hout}(hjAhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj=ubah}(h]h ]h"]h$]h&]uh1jhc/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:154: ./include/uapi/fwctl/pds.hhK.hj9ubj)}(hhh]h)}(hrpc out parametersh]hrpc out parameters}(hjXhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjThK.hjUubah}(h]h ]h"]h$]h&]uh1jhj9ubeh}(h]h ]h"]h$]h&]uh1jhjThK.hjubj)}(h&``out.retval`` operation result value h](j)}(h``out.retval``h]j)}(hjxh]h out.retval}(hjzhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjvubah}(h]h ]h"]h$]h&]uh1jhc/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:154: ./include/uapi/fwctl/pds.hhK*hjrubj)}(hhh]h)}(hoperation result valueh]hoperation result value}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhK*hjubah}(h]h ]h"]h$]h&]uh1jhjrubeh}(h]h ]h"]h$]h&]uh1jhjhK*hjubj)}(h``out.rsvd`` reserved h](j)}(h ``out.rsvd``h]j)}(hjh]hout.rsvd}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhc/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:154: ./include/uapi/fwctl/pds.hhK+hjubj)}(hhh]h)}(hreservedh]hreserved}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhK+hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhK+hjubj)}(h)``out.len`` length of result data buffer h](j)}(h ``out.len``h]j)}(hjh]hout.len}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhc/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:154: ./include/uapi/fwctl/pds.hhK,hjubj)}(hhh]h)}(hlength of result data bufferh]hlength of result data buffer}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhK,hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhK,hjubj)}(h.``out.payload`` address of payload data bufferh](j)}(h``out.payload``h]j)}(hj#h]h out.payload}(hj%hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj!ubah}(h]h ]h"]h$]h&]uh1jhc/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:154: ./include/uapi/fwctl/pds.hhK,hjubj)}(hhh]h)}(haddress of payload data bufferh]haddress of payload data buffer}(hj<hhhNhNubah}(h]h ]h"]h$]h&]uh1hhc/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:154: ./include/uapi/fwctl/pds.hhK-hj9ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhj8hK,hjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ] kernelindentah"]h$]h&]uh1jGhjhhhNhNubh)}(hhh](h)}(h sysfs Classh]h sysfs Class}(hjghhhNhNubah}(h]h ]h"]h$]h&]uh1hhjdhhhhhKubh)}(hfwctl has a sysfs class (/sys/class/fwctl/fwctlNN/) and character devices (/dev/fwctl/fwctlNN) with a simple numbered scheme. The character device operates the iotcl uAPI described above.h]hfwctl has a sysfs class (/sys/class/fwctl/fwctlNN/) and character devices (/dev/fwctl/fwctlNN) with a simple numbered scheme. The character device operates the iotcl uAPI described above.}(hjuhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjdhhubh)}(hUfwctl devices can be related to driver components in other subsystems through sysfs::h]hTfwctl devices can be related to driver components in other subsystems through sysfs:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjdhhubjm)}(h$ ls /sys/class/fwctl/fwctl0/device/infiniband/ ibp0s10f0 $ ls /sys/class/infiniband/ibp0s10f0/device/fwctl/ fwctl0/ $ ls /sys/devices/pci0000:00/0000:00:0a.0/fwctl/fwctl0 dev device power subsystem ueventh]h$ ls /sys/class/fwctl/fwctl0/device/infiniband/ ibp0s10f0 $ ls /sys/class/infiniband/ibp0s10f0/device/fwctl/ fwctl0/ $ ls /sys/devices/pci0000:00/0000:00:0a.0/fwctl/fwctl0 dev device power subsystem uevent}hjsbah}(h]h ]h"]h$]h&]hhuh1jlhhhKhjdhhubeh}(h] sysfs-classah ]h"] sysfs classah$]h&]uh1hhjhhhhhKubh)}(hhh](h)}(hUser space Communityh]hUser space Community}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hDrawing inspiration from nvme-cli, participating in the kernel side must come with a user space in a common TBD git tree, at a minimum to usefully operate the kernel driver. Providing such an implementation is a pre-condition to merging a kernel driver.h]hDrawing inspiration from nvme-cli, participating in the kernel side must come with a user space in a common TBD git tree, at a minimum to usefully operate the kernel driver. Providing such an implementation is a pre-condition to merging a kernel driver.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hThe goal is to build user space community around some of the shared problems we all have, and ideally develop some common user space programs with some starting themes of:h]hThe goal is to build user space community around some of the shared problems we all have, and ideally develop some common user space programs with some starting themes of:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj)}(h- Device in-field debugging - HW provisioning - VFIO child device profiling before VM boot - Confidential Compute topics (attestation, secure provisioning) h]j_)}(hhh](j)}(hDevice in-field debugging h]h)}(hDevice in-field debuggingh]hDevice in-field debugging}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hHW provisioning h]h)}(hHW provisioningh]hHW provisioning}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(h+VFIO child device profiling before VM boot h]h)}(h*VFIO child device profiling before VM booth]h*VFIO child device profiling before VM boot}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhjubj)}(h?Confidential Compute topics (attestation, secure provisioning) h]h)}(h>Confidential Compute topics (attestation, secure provisioning)h]h>Confidential Compute topics (attestation, secure provisioning)}(hj'hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj#ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]j'j(uh1j^hhhKhjubah}(h]h ]h"]h$]h&]uh1jhhhKhjhhubh)}(hthat stretch across all subsystems in the kernel. fwupd is a great example of how an excellent user space experience can emerge out of kernel-side diversity.h]hthat stretch across all subsystems in the kernel. fwupd is a great example of how an excellent user space experience can emerge out of kernel-side diversity.}(hjGhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h]user-space-communityah ]h"]user space communityah$]h&]uh1hhjhhhhhKubeh}(h]fwctl-user-apiah ]h"]fwctl user apiah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hfwctl Kernel APIh]hfwctl Kernel API}(hjhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjehhhhhKubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jfwctl_register (C function)c.fwctl_registerhNtauh1jhjehhhNhNubj)}(hhh](j)}(h/int fwctl_register (struct fwctl_device *fwctl)h]j)}(h.int fwctl_register(struct fwctl_device *fwctl)h](hdesc_sig_keyword_type)}(hinth]hint}(hjhhhNhNubah}(h]h ]ktah"]h$]h&]uh1jhjhhh_/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:201: ./drivers/fwctl/main.chMXubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhhjhMXubj)}(hfwctl_registerh]j)}(hfwctl_registerh]hfwctl_register}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ](jjeh"]h$]h&]hhuh1jhjhhhjhMXubhdesc_parameterlist)}(h(struct fwctl_device *fwctl)h]hdesc_parameter)}(hstruct fwctl_device *fwctlh](j)}(hjh]hstruct}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubh)}(hhh]j)}(h fwctl_deviceh]h fwctl_device}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&] refdomainj<reftype identifier reftargetjmodnameN classnameN c:parent_keysphinx.domains.c LookupKey)}data]j  ASTIdentifier)}jjsbc.fwctl_registerasbuh1hhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubhdesc_sig_punctuation)}(h*h]h*}(hj)hhhNhNubah}(h]h ]pah"]h$]h&]uh1j'hjubj)}(hfwctlh]hfwctl}(hj8hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphhhuh1jhjubah}(h]h ]h"]h$]h&]hhuh1jhjhhhjhMXubeh}(h]h ]h"]h$]h&]hhjuh1jjjhjhhhjhMXubah}(h]jah ](jjeh"]h$]h&]jj)jhuh1jhjhMXhjhhubj )}(hhh]h)}(h&Register a new device to the subsystemh]h&Register a new device to the subsystem}(hjbhhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:201: ./drivers/fwctl/main.chMXhj_hhubah}(h]h ]h"]h$]h&]uh1jhjhhhjhMXubeh}(h]h ](j<functioneh"]h$]h&]jAj<jBjzjCjzjDjEjFuh1jhhhjehNhNubjH)}(h**Parameters** ``struct fwctl_device *fwctl`` Previously allocated fwctl_device **Description** On return the device is visible through sysfs and /dev, driver ops may be called.h](h)}(h**Parameters**h]jR)}(hjh]h Parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jQhjubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:201: ./drivers/fwctl/main.chM\hj~ubj)}(hhh]j)}(hA``struct fwctl_device *fwctl`` Previously allocated fwctl_device h](j)}(h``struct fwctl_device *fwctl``h]j)}(hjh]hstruct fwctl_device *fwctl}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jh_/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:201: ./drivers/fwctl/main.chMYhjubj)}(hhh]h)}(h!Previously allocated fwctl_deviceh]h!Previously allocated fwctl_device}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMYhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhMYhjubah}(h]h ]h"]h$]h&]uh1jhj~ubh)}(h**Description**h]jR)}(hjh]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jQhjubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:201: ./drivers/fwctl/main.chM[hj~ubh)}(hQOn return the device is visible through sysfs and /dev, driver ops may be called.h]hQOn return the device is visible through sysfs and /dev, driver ops may be called.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:201: ./drivers/fwctl/main.chMZhj~ubeh}(h]h ] kernelindentah"]h$]h&]uh1jGhjehhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jfwctl_unregister (C function)c.fwctl_unregisterhNtauh1jhjehhhNhNubj)}(hhh](j)}(h2void fwctl_unregister (struct fwctl_device *fwctl)h]j)}(h1void fwctl_unregister(struct fwctl_device *fwctl)h](j)}(hvoidh]hvoid}(hj#hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhh_/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:201: ./drivers/fwctl/main.chMeubj)}(h h]h }(hj2hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhhj1hMeubj)}(hfwctl_unregisterh]j)}(hfwctl_unregisterh]hfwctl_unregister}(hjDhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj@ubah}(h]h ](jjeh"]h$]h&]hhuh1jhjhhhj1hMeubj)}(h(struct fwctl_device *fwctl)h]j)}(hstruct fwctl_device *fwctlh](j)}(hjh]hstruct}(hj`hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj\ubj)}(h h]h }(hjmhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj\ubh)}(hhh]j)}(h fwctl_deviceh]h fwctl_device}(hj~hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj{ubah}(h]h ]h"]h$]h&] refdomainj<reftypej reftargetjmodnameN classnameNj j)}j]j)}jjFsbc.fwctl_unregisterasbuh1hhj\ubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj\ubj()}(hj+h]h*}(hjhhhNhNubah}(h]h ]j4ah"]h$]h&]uh1j'hj\ubj)}(hfwctlh]hfwctl}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj\ubeh}(h]h ]h"]h$]h&]noemphhhuh1jhjXubah}(h]h ]h"]h$]h&]hhuh1jhjhhhj1hMeubeh}(h]h ]h"]h$]h&]hhjuh1jjjhjhhhj1hMeubah}(h]jah ](jjeh"]h$]h&]jj)jhuh1jhj1hMehjhhubj )}(hhh]h)}(h&Unregister a device from the subsystemh]h&Unregister a device from the subsystem}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:201: ./drivers/fwctl/main.chMehjhhubah}(h]h ]h"]h$]h&]uh1jhjhhhj1hMeubeh}(h]h ](j<functioneh"]h$]h&]jAj<jBjjCjjDjEjFuh1jhhhjehNhNubjH)}(hX**Parameters** ``struct fwctl_device *fwctl`` Previously allocated and registered fwctl_device **Description** Undoes fwctl_register(). On return no driver ops will be called. The caller must still call fwctl_put() to free the fwctl. Unregister will return even if userspace still has file descriptors open. This will call ops->close_uctx() on any open FDs and after return no driver op will be called. The FDs remain open but all fops will return -ENODEV. The design of fwctl allows this sort of disassociation of the driver from the subsystem primarily by keeping memory allocations owned by the core subsytem. The fwctl_device and fwctl_uctx can both be freed without requiring a driver callback. This allows the module to remain unlocked while FDs are open.h](h)}(h**Parameters**h]jR)}(hjh]h Parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jQhjubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:201: ./drivers/fwctl/main.chMihjubj)}(hhh]j)}(hP``struct fwctl_device *fwctl`` Previously allocated and registered fwctl_device h](j)}(h``struct fwctl_device *fwctl``h]j)}(hj$h]hstruct fwctl_device *fwctl}(hj&hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj"ubah}(h]h ]h"]h$]h&]uh1jh_/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:201: ./drivers/fwctl/main.chMfhjubj)}(hhh]h)}(h0Previously allocated and registered fwctl_deviceh]h0Previously allocated and registered fwctl_device}(hj=hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj9hMfhj:ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhj9hMfhjubah}(h]h ]h"]h$]h&]uh1jhjubh)}(h**Description**h]jR)}(hj_h]h Description}(hjahhhNhNubah}(h]h ]h"]h$]h&]uh1jQhj]ubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:201: ./drivers/fwctl/main.chMhhjubh)}(hzUndoes fwctl_register(). On return no driver ops will be called. The caller must still call fwctl_put() to free the fwctl.h]hzUndoes fwctl_register(). On return no driver ops will be called. The caller must still call fwctl_put() to free the fwctl.}(hjuhhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:201: ./drivers/fwctl/main.chMghjubh)}(hUnregister will return even if userspace still has file descriptors open. This will call ops->close_uctx() on any open FDs and after return no driver op will be called. The FDs remain open but all fops will return -ENODEV.h]hUnregister will return even if userspace still has file descriptors open. This will call ops->close_uctx() on any open FDs and after return no driver op will be called. The FDs remain open but all fops will return -ENODEV.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:201: ./drivers/fwctl/main.chMjhjubh)}(hX0The design of fwctl allows this sort of disassociation of the driver from the subsystem primarily by keeping memory allocations owned by the core subsytem. The fwctl_device and fwctl_uctx can both be freed without requiring a driver callback. This allows the module to remain unlocked while FDs are open.h]hX0The design of fwctl allows this sort of disassociation of the driver from the subsystem primarily by keeping memory allocations owned by the core subsytem. The fwctl_device and fwctl_uctx can both be freed without requiring a driver callback. This allows the module to remain unlocked while FDs are open.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:201: ./drivers/fwctl/main.chMnhjubeh}(h]h ] kernelindentah"]h$]h&]uh1jGhjehhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jfwctl_ops (C struct) c.fwctl_opshNtauh1jhjehhh`/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:203: ./include/linux/fwctl.hhNubj)}(hhh](j)}(h fwctl_opsh]j)}(hstruct fwctl_opsh](j)}(hjh]hstruct}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhh`/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:203: ./include/linux/fwctl.hhKubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhhjhKubj)}(h fwctl_opsh]j)}(hjh]h fwctl_ops}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ](jjeh"]h$]h&]hhuh1jhjhhhjhKubeh}(h]h ]h"]h$]h&]hhjuh1jjjhjhhhjhKubah}(h]jah ](jjeh"]h$]h&]jj)jhuh1jhjhKhjhhubj )}(hhh]h)}(hDriver provided operationsh]hDriver provided operations}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:203: ./include/linux/fwctl.hhKhjhhubah}(h]h ]h"]h$]h&]uh1jhjhhhjhKubeh}(h]h ](j<structeh"]h$]h&]jAj<jBjjCjjDjEjFuh1jhhhjehjhNubjH)}(hX6**Definition**:: struct fwctl_ops { enum fwctl_device_type device_type; size_t uctx_size; int (*open_uctx)(struct fwctl_uctx *uctx); void (*close_uctx)(struct fwctl_uctx *uctx); void *(*info)(struct fwctl_uctx *uctx, size_t *length); void *(*fw_rpc)(struct fwctl_uctx *uctx, enum fwctl_rpc_scope scope, void *rpc_in, size_t in_len, size_t *out_len); }; **Members** ``device_type`` The drivers assigned device_type number. This is uABI. ``uctx_size`` The size of the fwctl_uctx struct to allocate. The first bytes of this memory will be a fwctl_uctx. The driver can use the remaining bytes as its private memory. ``open_uctx`` Called when a file descriptor is opened before the uctx is ever used. ``close_uctx`` Called when the uctx is destroyed, usually when the FD is closed. ``info`` Implement FWCTL_INFO. Return a kmalloc() memory that is copied to out_device_data. On input length indicates the size of the user buffer on output it indicates the size of the memory. The driver can ignore length on input, the core code will handle everything. ``fw_rpc`` Implement FWCTL_RPC. Deliver rpc_in/in_len to the FW and return the response and set out_len. rpc_in can be returned as the response pointer. Otherwise the returned pointer is freed with kvfree().h](h)}(h**Definition**::h](jR)}(h**Definition**h]h Definition}(hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1jQhj%ubh:}(hj%hhhNhNubeh}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:203: ./include/linux/fwctl.hhKhj!ubjm)}(hXgstruct fwctl_ops { enum fwctl_device_type device_type; size_t uctx_size; int (*open_uctx)(struct fwctl_uctx *uctx); void (*close_uctx)(struct fwctl_uctx *uctx); void *(*info)(struct fwctl_uctx *uctx, size_t *length); void *(*fw_rpc)(struct fwctl_uctx *uctx, enum fwctl_rpc_scope scope, void *rpc_in, size_t in_len, size_t *out_len); };h]hXgstruct fwctl_ops { enum fwctl_device_type device_type; size_t uctx_size; int (*open_uctx)(struct fwctl_uctx *uctx); void (*close_uctx)(struct fwctl_uctx *uctx); void *(*info)(struct fwctl_uctx *uctx, size_t *length); void *(*fw_rpc)(struct fwctl_uctx *uctx, enum fwctl_rpc_scope scope, void *rpc_in, size_t in_len, size_t *out_len); };}hjBsbah}(h]h ]h"]h$]h&]hhuh1jlh`/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:203: ./include/linux/fwctl.hhKhj!ubh)}(h **Members**h]jR)}(hjSh]hMembers}(hjUhhhNhNubah}(h]h ]h"]h$]h&]uh1jQhjQubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:203: ./include/linux/fwctl.hhKhj!ubj)}(hhh](j)}(hG``device_type`` The drivers assigned device_type number. This is uABI. h](j)}(h``device_type``h]j)}(hjrh]h device_type}(hjthhhNhNubah}(h]h ]h"]h$]h&]uh1jhjpubah}(h]h ]h"]h$]h&]uh1jh`/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:203: ./include/linux/fwctl.hhKhjlubj)}(hhh]h)}(h6The drivers assigned device_type number. This is uABI.h]h6The drivers assigned device_type number. This is uABI.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKhjubah}(h]h ]h"]h$]h&]uh1jhjlubeh}(h]h ]h"]h$]h&]uh1jhjhKhjiubj)}(h``uctx_size`` The size of the fwctl_uctx struct to allocate. The first bytes of this memory will be a fwctl_uctx. The driver can use the remaining bytes as its private memory. h](j)}(h ``uctx_size``h]j)}(hjh]h uctx_size}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jh`/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:203: ./include/linux/fwctl.hhKhjubj)}(hhh]h)}(hThe size of the fwctl_uctx struct to allocate. The first bytes of this memory will be a fwctl_uctx. The driver can use the remaining bytes as its private memory.h]hThe size of the fwctl_uctx struct to allocate. The first bytes of this memory will be a fwctl_uctx. The driver can use the remaining bytes as its private memory.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:203: ./include/linux/fwctl.hhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhKhjiubj)}(hT``open_uctx`` Called when a file descriptor is opened before the uctx is ever used. h](j)}(h ``open_uctx``h]j)}(hjh]h open_uctx}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jh`/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:203: ./include/linux/fwctl.hhK$hjubj)}(hhh]h)}(hECalled when a file descriptor is opened before the uctx is ever used.h]hECalled when a file descriptor is opened before the uctx is ever used.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:203: ./include/linux/fwctl.hhK#hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhK$hjiubj)}(hQ``close_uctx`` Called when the uctx is destroyed, usually when the FD is closed. h](j)}(h``close_uctx``h]j)}(hjh]h close_uctx}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jh`/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:203: ./include/linux/fwctl.hhK)hjubj)}(hhh]h)}(hACalled when the uctx is destroyed, usually when the FD is closed.h]hACalled when the uctx is destroyed, usually when the FD is closed.}(hj8hhhNhNubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:203: ./include/linux/fwctl.hhK(hj5ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhj4hK)hjiubj)}(hX``info`` Implement FWCTL_INFO. Return a kmalloc() memory that is copied to out_device_data. On input length indicates the size of the user buffer on output it indicates the size of the memory. The driver can ignore length on input, the core code will handle everything. h](j)}(h``info``h]j)}(hjYh]hinfo}(hj[hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjWubah}(h]h ]h"]h$]h&]uh1jh`/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:203: ./include/linux/fwctl.hhK0hjSubj)}(hhh]h)}(hXImplement FWCTL_INFO. Return a kmalloc() memory that is copied to out_device_data. On input length indicates the size of the user buffer on output it indicates the size of the memory. The driver can ignore length on input, the core code will handle everything.h]hXImplement FWCTL_INFO. Return a kmalloc() memory that is copied to out_device_data. On input length indicates the size of the user buffer on output it indicates the size of the memory. The driver can ignore length on input, the core code will handle everything.}(hjrhhhNhNubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:203: ./include/linux/fwctl.hhK-hjoubah}(h]h ]h"]h$]h&]uh1jhjSubeh}(h]h ]h"]h$]h&]uh1jhjnhK0hjiubj)}(h``fw_rpc`` Implement FWCTL_RPC. Deliver rpc_in/in_len to the FW and return the response and set out_len. rpc_in can be returned as the response pointer. Otherwise the returned pointer is freed with kvfree().h](j)}(h ``fw_rpc``h]j)}(hjh]hfw_rpc}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jh`/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:203: ./include/linux/fwctl.hhK6hjubj)}(hhh]h)}(hImplement FWCTL_RPC. Deliver rpc_in/in_len to the FW and return the response and set out_len. rpc_in can be returned as the response pointer. Otherwise the returned pointer is freed with kvfree().h]hImplement FWCTL_RPC. Deliver rpc_in/in_len to the FW and return the response and set out_len. rpc_in can be returned as the response pointer. Otherwise the returned pointer is freed with kvfree().}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:203: ./include/linux/fwctl.hhK4hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhK6hjiubeh}(h]h ]h"]h$]h&]uh1jhj!ubeh}(h]h ] kernelindentah"]h$]h&]uh1jGhjehhhjhNubh)}(h**Description**h]jR)}(hjh]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jQhjubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:203: ./include/linux/fwctl.hhK:hjehhubh)}(hfwctl_unregister() will wait until all excuting ops are completed before it returns. Drivers should be mindful to not let their ops run for too long as it will block device hot unplug and module unloading.h]hfwctl_unregister() will wait until all excuting ops are completed before it returns. Drivers should be mindful to not let their ops run for too long as it will block device hot unplug and module unloading.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:203: ./include/linux/fwctl.hhKhjehhubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jfwctl_device (C struct)c.fwctl_devicehNtauh1jhjehhhjhNubj)}(hhh](j)}(h fwctl_deviceh]j)}(hstruct fwctl_deviceh](j)}(hjh]hstruct}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhh`/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:203: ./include/linux/fwctl.hhKubj)}(h h]h }(hj"hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhhj!hKubj)}(h fwctl_deviceh]j)}(hjh]h fwctl_device}(hj4hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj0ubah}(h]h ](jjeh"]h$]h&]hhuh1jhjhhhj!hKubeh}(h]h ]h"]h$]h&]hhjuh1jjjhj hhhj!hKubah}(h]jah ](jjeh"]h$]h&]jj)jhuh1jhj!hKhj hhubj )}(hhh]h)}(hPer-driver registration structh]hPer-driver registration struct}(hjVhhhNhNubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:203: ./include/linux/fwctl.hhK=hjShhubah}(h]h ]h"]h$]h&]uh1jhj hhhj!hKubeh}(h]h ](j<structeh"]h$]h&]jAj<jBjnjCjnjDjEjFuh1jhhhjehjhNubjH)}(h**Definition**:: struct fwctl_device { struct device dev; }; **Members** ``dev`` The sysfs (class/fwctl/fwctlXX) deviceh](h)}(h**Definition**::h](jR)}(h**Definition**h]h Definition}(hjzhhhNhNubah}(h]h ]h"]h$]h&]uh1jQhjvubh:}(hjvhhhNhNubeh}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:203: ./include/linux/fwctl.hhKAhjrubjm)}(h/struct fwctl_device { struct device dev; };h]h/struct fwctl_device { struct device dev; };}hjsbah}(h]h ]h"]h$]h&]hhuh1jlh`/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:203: ./include/linux/fwctl.hhKChjrubh)}(h **Members**h]jR)}(hjh]hMembers}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jQhjubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:203: ./include/linux/fwctl.hhKGhjrubj)}(hhh]j)}(h.``dev`` The sysfs (class/fwctl/fwctlXX) deviceh](j)}(h``dev``h]j)}(hjh]hdev}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jh`/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:203: ./include/linux/fwctl.hhK>hjubj)}(hhh]h)}(h&The sysfs (class/fwctl/fwctlXX) deviceh]h&The sysfs (class/fwctl/fwctlXX) device}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:203: ./include/linux/fwctl.hhK?hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhK>hjubah}(h]h ]h"]h$]h&]uh1jhjrubeh}(h]h ] kernelindentah"]h$]h&]uh1jGhjehhhjhNubh)}(h**Description**h]jR)}(hjh]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jQhjubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:203: ./include/linux/fwctl.hhKBhjehhubh)}(hEach driver instance will have one of these structs with the driver private data following immediately after. This struct is refcounted, it is freed by calling fwctl_put().h]hEach driver instance will have one of these structs with the driver private data following immediately after. This struct is refcounted, it is freed by calling fwctl_put().}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:203: ./include/linux/fwctl.hhK?hjehhubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jfwctl_alloc_device (C macro)c.fwctl_alloc_devicehNtauh1jhjehhhjhNubj)}(hhh](j)}(hfwctl_alloc_deviceh]j)}(hfwctl_alloc_deviceh]j)}(hfwctl_alloc_deviceh]j)}(hj>h]hfwctl_alloc_device}(hjHhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjDubah}(h]h ](jjeh"]h$]h&]hhuh1jhj@hhh`/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:203: ./include/linux/fwctl.hhKXubah}(h]h ]h"]h$]h&]hhjuh1jjjhj<hhhj[hKXubah}(h]j7ah ](jjeh"]h$]h&]jj)jhuh1jhj[hKXhj9hhubj )}(hhh]h}(h]h ]h"]h$]h&]uh1jhj9hhhj[hKXubeh}(h]h ](j<macroeh"]h$]h&]jAj<jBjtjCjtjDjEjFuh1jhhhjehjhNubh)}(h8``fwctl_alloc_device (parent, ops, drv_struct, member)``h]j)}(hjzh]h4fwctl_alloc_device (parent, ops, drv_struct, member)}(hj|hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjxubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:203: ./include/linux/fwctl.hhKZhjehhubj)}(hAllocate a fwctl h]h)}(hAllocate a fwctlh]hAllocate a fwctl}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:203: ./include/linux/fwctl.hhKXhjubah}(h]h ]h"]h$]h&]uh1jhjhKXhjehhubjH)}(hX**Parameters** ``parent`` Physical device that provides the FW interface ``ops`` Driver ops to register ``drv_struct`` 'struct driver_fwctl' that holds the struct fwctl_device ``member`` Name of the struct fwctl_device in **drv_struct** **Description** This allocates and initializes the fwctl_device embedded in the drv_struct. Upon success the pointer must be freed via fwctl_put(). Returns a 'drv_struct \*' on success, NULL on error.h](h)}(h**Parameters**h]jR)}(hjh]h Parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jQhjubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:203: ./include/linux/fwctl.hhK\hjubj)}(hhh](j)}(h:``parent`` Physical device that provides the FW interface h](j)}(h ``parent``h]j)}(hjh]hparent}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jh`/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:203: ./include/linux/fwctl.hhKYhjubj)}(hhh]h)}(h.Physical device that provides the FW interfaceh]h.Physical device that provides the FW interface}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKYhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhKYhjubj)}(h``ops`` Driver ops to register h](j)}(h``ops``h]j)}(hjh]hops}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jh`/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:203: ./include/linux/fwctl.hhKZhjubj)}(hhh]h)}(hDriver ops to registerh]hDriver ops to register}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKZhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhKZhjubj)}(hH``drv_struct`` 'struct driver_fwctl' that holds the struct fwctl_device h](j)}(h``drv_struct``h]j)}(hj@h]h drv_struct}(hjBhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj>ubah}(h]h ]h"]h$]h&]uh1jh`/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:203: ./include/linux/fwctl.hhK[hj:ubj)}(hhh]h)}(h8'struct driver_fwctl' that holds the struct fwctl_deviceh]h<‘struct driver_fwctl’ that holds the struct fwctl_device}(hjYhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjUhK[hjVubah}(h]h ]h"]h$]h&]uh1jhj:ubeh}(h]h ]h"]h$]h&]uh1jhjUhK[hjubj)}(h=``member`` Name of the struct fwctl_device in **drv_struct** h](j)}(h ``member``h]j)}(hjyh]hmember}(hj{hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjwubah}(h]h ]h"]h$]h&]uh1jh`/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:203: ./include/linux/fwctl.hhK\hjsubj)}(hhh]h)}(h1Name of the struct fwctl_device in **drv_struct**h](h#Name of the struct fwctl_device in }(hjhhhNhNubjR)}(h**drv_struct**h]h drv_struct}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jQhjubeh}(h]h ]h"]h$]h&]uh1hhjhK\hjubah}(h]h ]h"]h$]h&]uh1jhjsubeh}(h]h ]h"]h$]h&]uh1jhjhK\hjubeh}(h]h ]h"]h$]h&]uh1jhjubh)}(h**Description**h]jR)}(hjh]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jQhjubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:203: ./include/linux/fwctl.hhK^hjubh)}(hThis allocates and initializes the fwctl_device embedded in the drv_struct. Upon success the pointer must be freed via fwctl_put(). Returns a 'drv_struct \*' on success, NULL on error.h]hThis allocates and initializes the fwctl_device embedded in the drv_struct. Upon success the pointer must be freed via fwctl_put(). Returns a ‘drv_struct *’ on success, NULL on error.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:203: ./include/linux/fwctl.hhK]hjubeh}(h]h ] kernelindentah"]h$]h&]uh1jGhjehhhjhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jfwctl_uctx (C struct) c.fwctl_uctxhNtauh1jhjehhhjhNubj)}(hhh](j)}(h fwctl_uctxh]j)}(hstruct fwctl_uctxh](j)}(hjh]hstruct}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhh`/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:203: ./include/linux/fwctl.hhKdubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhhjhKdubj)}(h fwctl_uctxh]j)}(hjh]h fwctl_uctx}(hj'hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj#ubah}(h]h ](jjeh"]h$]h&]hhuh1jhjhhhjhKdubeh}(h]h ]h"]h$]h&]hhjuh1jjjhjhhhjhKdubah}(h]jah ](jjeh"]h$]h&]jj)jhuh1jhjhKdhjhhubj )}(hhh]h)}(hPer user FD contexth]hPer user FD context}(hjIhhhNhNubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:203: ./include/linux/fwctl.hhKzhjFhhubah}(h]h ]h"]h$]h&]uh1jhjhhhjhKdubeh}(h]h ](j<structeh"]h$]h&]jAj<jBjajCjajDjEjFuh1jhhhjehjhNubjH)}(h**Definition**:: struct fwctl_uctx { struct fwctl_device *fwctl; }; **Members** ``fwctl`` fwctl instance that owns the contexth](h)}(h**Definition**::h](jR)}(h**Definition**h]h Definition}(hjmhhhNhNubah}(h]h ]h"]h$]h&]uh1jQhjiubh:}(hjihhhNhNubeh}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:203: ./include/linux/fwctl.hhK~hjeubjm)}(h6struct fwctl_uctx { struct fwctl_device *fwctl; };h]h6struct fwctl_uctx { struct fwctl_device *fwctl; };}hjsbah}(h]h ]h"]h$]h&]hhuh1jlh`/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:203: ./include/linux/fwctl.hhKhjeubh)}(h **Members**h]jR)}(hjh]hMembers}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jQhjubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:203: ./include/linux/fwctl.hhKhjeubj)}(hhh]j)}(h.``fwctl`` fwctl instance that owns the contexth](j)}(h ``fwctl``h]j)}(hjh]hfwctl}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jh`/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:203: ./include/linux/fwctl.hhK{hjubj)}(hhh]h)}(h$fwctl instance that owns the contexth]h$fwctl instance that owns the context}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:203: ./include/linux/fwctl.hhK|hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhK{hjubah}(h]h ]h"]h$]h&]uh1jhjeubeh}(h]h ] kernelindentah"]h$]h&]uh1jGhjehhhjhNubh)}(h**Description**h]jR)}(hjh]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jQhjubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:203: ./include/linux/fwctl.hhKhjehhubh)}(hyEvery FD opened by userspace will get a unique context allocation. Any driver private data will follow immediately after.h]hyEvery FD opened by userspace will get a unique context allocation. Any driver private data will follow immediately after.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl:203: ./include/linux/fwctl.hhK|hjehhubh)}(hhh](h)}(hfwctl Driver designh]hfwctl Driver design}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hXkIn many cases a fwctl driver is going to be part of a larger cross-subsystem device possibly using the auxiliary_device mechanism. In that case several subsystems are going to be sharing the same device and FW interface layer so the device design must already provide for isolation and cooperation between kernel subsystems. fwctl should fit into that same model.h]hXkIn many cases a fwctl driver is going to be part of a larger cross-subsystem device possibly using the auxiliary_device mechanism. In that case several subsystems are going to be sharing the same device and FW interface layer so the device design must already provide for isolation and cooperation between kernel subsystems. fwctl should fit into that same model.}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hXPart of the driver should include a description of how its scope restrictions and security model work. The driver and FW together must ensure that RPCs provided by user space are mapped to the appropriate scope. If the validation is done in the driver then the validation can read a 'command effects' report from the device, or hardwire the enforcement. If the validation is done in the FW, then the driver should pass the fwctl_rpc_scope to the FW along with the command.h]hXPart of the driver should include a description of how its scope restrictions and security model work. The driver and FW together must ensure that RPCs provided by user space are mapped to the appropriate scope. If the validation is done in the driver then the validation can read a ‘command effects’ report from the device, or hardwire the enforcement. If the validation is done in the FW, then the driver should pass the fwctl_rpc_scope to the FW along with the command.}(hj=hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hXEThe driver and FW must cooperate to ensure that either fwctl cannot allocate any FW resources, or any resources it does allocate are freed on FD closure. A driver primarily constructed around FW RPCs may find that its core PCI function and RPC layer belongs under fwctl with auxiliary devices connecting to other subsystems.h]hXEThe driver and FW must cooperate to ensure that either fwctl cannot allocate any FW resources, or any resources it does allocate are freed on FD closure. A driver primarily constructed around FW RPCs may find that its core PCI function and RPC layer belongs under fwctl with auxiliary devices connecting to other subsystems.}(hjKhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hXREach device type must be mindful of Linux's philosophy for stable ABI. The FW RPC interface does not have to meet a strictly stable ABI, but it does need to meet an expectation that user space tools that are deployed and in significant use don't needlessly break. FW upgrade and kernel upgrade should keep widely deployed tooling working.h]hXVEach device type must be mindful of Linux’s philosophy for stable ABI. The FW RPC interface does not have to meet a strictly stable ABI, but it does need to meet an expectation that user space tools that are deployed and in significant use don’t needlessly break. FW upgrade and kernel upgrade should keep widely deployed tooling working.}(hjYhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hXVDevelopment and debugging focused RPCs under more permissive scopes can have less stability if the tools using them are only run under exceptional circumstances and not for every day use of the device. Debugging tools may even require exact version matching as they may require something similar to DWARF debug information from the FW binary.h]hXVDevelopment and debugging focused RPCs under more permissive scopes can have less stability if the tools using them are only run under exceptional circumstances and not for every day use of the device. Debugging tools may even require exact version matching as they may require something similar to DWARF debug information from the FW binary.}(hjghhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h]fwctl-driver-designah ]h"]fwctl driver designah$]h&]uh1hhjehhhhhKubeh}(h]fwctl-kernel-apiah ]h"]fwctl kernel apiah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hSecurity Responseh]hSecurity Response}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hX.The kernel remains the gatekeeper for this interface. If violations of the scopes, security or isolation principles are found, we have options to let devices fix them with a FW update, push a kernel patch to parse and block RPC commands or push a kernel patch to block entire firmware versions/devices.h]hX.The kernel remains the gatekeeper for this interface. If violations of the scopes, security or isolation principles are found, we have options to let devices fix them with a FW update, push a kernel patch to parse and block RPC commands or push a kernel patch to block entire firmware versions/devices.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hWhile the kernel can always directly parse and restrict RPCs, it is expected that the existing kernel pattern of allowing drivers to delegate validation to FW to be a useful design.h]hWhile the kernel can always directly parse and restrict RPCs, it is expected that the existing kernel pattern of allowing drivers to delegate validation to FW to be a useful design.I$}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h]security-responseah ]h"]security responseah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hExisting Similar Examplesh]hExisting Similar Examples}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hXkThe approach described in this document is not a new idea. Direct, or near direct device access has been offered by the kernel in different areas for decades. With more devices wanting to follow this design pattern it is becoming clear that it is not entirely well understood and, more importantly, the security considerations are not well defined or agreed upon.h]hXkThe approach described in this document is not a new idea. Direct, or near direct device access has been offered by the kernel in different areas for decades. With more devices wanting to follow this design pattern it is becoming clear that it is not entirely well understood and, more importantly, the security considerations are not well defined or agreed upon.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hSome examples:h]hSome examples:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubj)}(hX- HW RAID controllers. This includes RPCs to do things like compose drives into a RAID volume, configure RAID parameters, monitor the HW and more. - Baseboard managers. RPCs for configuring settings in the device and more. - NVMe vendor command capsules. nvme-cli provides access to some monitoring functions that different products have defined, but more exist. - CXL also has a NVMe-like vendor command system. - DRM allows user space drivers to send commands to the device via kernel mediation. - RDMA allows user space drivers to directly push commands to the device without kernel involvement. - Various “raw” APIs, raw HID (SDL2), raw USB, NVMe Generic Interface, etc. h]j_)}(hhh](j)}(hHW RAID controllers. This includes RPCs to do things like compose drives into a RAID volume, configure RAID parameters, monitor the HW and more. h]h)}(hHW RAID controllers. This includes RPCs to do things like compose drives into a RAID volume, configure RAID parameters, monitor the HW and more.h]hHW RAID controllers. This includes RPCs to do things like compose drives into a RAID volume, configure RAID parameters, monitor the HW and more.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hJBaseboard managers. RPCs for configuring settings in the device and more. h]h)}(hIBaseboard managers. RPCs for configuring settings in the device and more.h]hIBaseboard managers. RPCs for configuring settings in the device and more.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hNVMe vendor command capsules. nvme-cli provides access to some monitoring functions that different products have defined, but more exist. h]h)}(hNVMe vendor command capsules. nvme-cli provides access to some monitoring functions that different products have defined, but more exist.h]hNVMe vendor command capsules. nvme-cli provides access to some monitoring functions that different products have defined, but more exist.}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(h0CXL also has a NVMe-like vendor command system. h]h)}(h/CXL also has a NVMe-like vendor command system.h]h/CXL also has a NVMe-like vendor command system.}(hj:hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj6ubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hSDRM allows user space drivers to send commands to the device via kernel mediation. h]h)}(hRDRM allows user space drivers to send commands to the device via kernel mediation.h]hRDRM allows user space drivers to send commands to the device via kernel mediation.}(hjRhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjNubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hcRDMA allows user space drivers to directly push commands to the device without kernel involvement. h]h)}(hbRDMA allows user space drivers to directly push commands to the device without kernel involvement.h]hbRDMA allows user space drivers to directly push commands to the device without kernel involvement.}(hjjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjfubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hNVarious “raw” APIs, raw HID (SDL2), raw USB, NVMe Generic Interface, etc. h]h)}(hMVarious “raw” APIs, raw HID (SDL2), raw USB, NVMe Generic Interface, etc.h]hMVarious “raw” APIs, raw HID (SDL2), raw USB, NVMe Generic Interface, etc.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj~ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]j'j(uh1j^hhhMhjubah}(h]h ]h"]h$]h&]uh1jhhhMhjhhubh)}(hThe first 4 are examples of areas that fwctl intends to cover. The latter three are examples of disallowed behavior as they fully overlap with the primary purpose of a kernel subsystem.h]hThe first 4 are examples of areas that fwctl intends to cover. The latter three are examples of disallowed behavior as they fully overlap with the primary purpose of a kernel subsystem.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hX-Some key lessons learned from these past efforts are the importance of having a common user space project to use as a pre-condition for obtaining a kernel driver. Developing good community around useful software in user space is key to getting companies to fund participation to enable their products.h]hX-Some key lessons learned from these past efforts are the importance of having a common user space project to use as a pre-condition for obtaining a kernel driver. Developing good community around useful software in user space is key to getting companies to fund participation to enable their products.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubeh}(h]existing-similar-examplesah ]h"]existing similar examplesah$]h&]uh1hhhhhhhhKubeh}(h]fwctl-subsystemah ]h"]fwctl subsystemah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksentryfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerjerror_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourcehnj _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}j]jasnameids}(jjjjjjjjjbj_j4jjjjZjWjjjzjwjjjju nametypes}(jjjjjbj4jjZjjzjjuh}(jhjjjjjjj_jjjjjjJjOj^jcjM jR j j jjj5j:j<jAjjdjWjjjejjjjjjjj j7j<jjjwjjjjju footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}Rparse_messages]transform_messages]hsystem_message)}(hhh]h)}(hhh]h:Hyperlink target "general-ioctl-format" is not referenced.}hj[ sbah}(h]h ]h"]h$]h&]uh1hhjX ubah}(h]h ]h"]h$]h&]levelKtypeINFOsourcejlineKuh1jV uba transformerN include_log] decorationNhhub.