ƭsphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget1/translations/zh_CN/userspace-api/fwctl/fwctl-cxlmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget1/translations/zh_TW/userspace-api/fwctl/fwctl-cxlmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget1/translations/it_IT/userspace-api/fwctl/fwctl-cxlmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget1/translations/ja_JP/userspace-api/fwctl/fwctl-cxlmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget1/translations/ko_KR/userspace-api/fwctl/fwctl-cxlmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hPortuguese (Brazilian)}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget1/translations/pt_BR/userspace-api/fwctl/fwctl-cxlmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget1/translations/sp_SP/userspace-api/fwctl/fwctl-cxlmodnameN 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:spacepreserveuh1hhhhhhK/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl-cxl.rsthKubhsection)}(hhh](htitle)}(hfwctl cxl driverh]hfwctl cxl driver}(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)}(h Dave Jiang h]h paragraph)}(h Dave Jiangh]h Dave Jiang}(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)}(hX6The CXL spec defines a set of commands that can be issued to the mailbox of a CXL device or switch. It also left room for vendor specific commands to be issued to the mailbox as well. fwctl provides a path to issue a set of allowed mailbox commands from user space to the device moderated by the kernel driver.h]hX6The CXL spec defines a set of commands that can be issued to the mailbox of a CXL device or switch. It also left room for vendor specific commands to be issued to the mailbox as well. fwctl provides a path to issue a set of allowed mailbox commands from user space to the device moderated by the kernel driver.}(hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hjhhubh)}(hThe following 3 commands will be used to support CXL Features: CXL spec r3.1 8.2.9.6.1 Get Supported Features (Opcode 0500h) CXL spec r3.1 8.2.9.6.2 Get Feature (Opcode 0501h) CXL spec r3.1 8.2.9.6.3 Set Feature (Opcode 0502h)h]hThe following 3 commands will be used to support CXL Features: CXL spec r3.1 8.2.9.6.1 Get Supported Features (Opcode 0500h) CXL spec r3.1 8.2.9.6.2 Get Feature (Opcode 0501h) CXL spec r3.1 8.2.9.6.3 Set Feature (Opcode 0502h)}(hj>hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hXThe "Get Supported Features" return data may be filtered by the kernel driver to drop any features that are forbidden by the kernel or being exclusively used by the kernel. The driver will set the "Set Feature Size" of the "Get Supported Features Supported Feature Entry" to 0 to indicate that the Feature cannot be modified. The "Get Supported Features" command and the "Get Features" falls under the fwctl policy of FWCTL_RPC_CONFIGURATION.h]hXThe “Get Supported Features” return data may be filtered by the kernel driver to drop any features that are forbidden by the kernel or being exclusively used by the kernel. The driver will set the “Set Feature Size” of the “Get Supported Features Supported Feature Entry” to 0 to indicate that the Feature cannot be modified. The “Get Supported Features” command and the “Get Features” falls under the fwctl policy of FWCTL_RPC_CONFIGURATION.}(hjLhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hXWFor "Set Feature" command, the access policy currently is broken down into two categories depending on the Set Feature effects reported by the device. If the Set Feature will cause immediate change to the device, the fwctl access policy must be FWCTL_RPC_DEBUG_WRITE_FULL. The effects for this level are "immediate config change", "immediate data change", "immediate policy change", or "immediate log change" for the set effects mask. If the effects are "config change with cold reset" or "config change with conventional reset", then the fwctl access policy must be FWCTL_RPC_DEBUG_WRITE or higher.h]hXsFor “Set Feature” command, the access policy currently is broken down into two categories depending on the Set Feature effects reported by the device. If the Set Feature will cause immediate change to the device, the fwctl access policy must be FWCTL_RPC_DEBUG_WRITE_FULL. The effects for this level are “immediate config change”, “immediate data change”, “immediate policy change”, or “immediate log change” for the set effects mask. If the effects are “config change with cold reset” or “config change with conventional reset”, then the fwctl access policy must be FWCTL_RPC_DEBUG_WRITE or higher.}(hjZhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h]overviewah ]h"]overviewah$]h&]uh1hhhhhhhhK ubh)}(hhh](h)}(hfwctl cxl User APIh]hfwctl cxl User API}(hjshhhNhNubah}(h]h ]h"]h$]h&]uh1hhjphhhhhK'ubhindex)}(hhh]h}(h]h ]h"]h$]h&]entries](singlefwctl_rpc_cxl (C struct)c.fwctl_rpc_cxlhNtauh1jhjphhhNhNubhdesc)}(hhh](hdesc_signature)}(h fwctl_rpc_cxlh]hdesc_signature_line)}(hstruct fwctl_rpc_cxlh](hdesc_sig_keyword)}(hstructh]hstruct}(hjhhhNhNubah}(h]h ]kah"]h$]h&]uh1jhjhhhf/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl-cxl:41: ./include/uapi/fwctl/cxl.hhKubhdesc_sig_space)}(h h]h }(hjhhhNhNubah}(h]h ]wah"]h$]h&]uh1jhjhhhjhKubh desc_name)}(h fwctl_rpc_cxlh]h desc_sig_name)}(hjh]h fwctl_rpc_cxl}(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)}(hioctl(FWCTL_RPC) input for CXLh]hioctl(FWCTL_RPC) input for CXL}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhf/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl-cxl:41: ./include/uapi/fwctl/cxl.hhKhjhhubah}(h]h ]h"]h$]h&]uh1jhjhhhjhKubeh}(h]h ](cstructeh"]h$]h&]domainjobjtypejdesctypejnoindex noindexentrynocontentsentryuh1jhhhjphNhNubh container)}(hX**Definition**:: struct fwctl_rpc_cxl { struct { __u32 opcode; __u32 flags; __u32 op_size; __u32 reserved1; }; union { struct cxl_mbox_get_sup_feats_in get_sup_feats_in; struct cxl_mbox_get_feat_in get_feat_in; struct cxl_mbox_set_feat_in set_feat_in; }; }; **Members** ``{unnamed_struct}`` anonymous ``opcode`` CXL mailbox command opcode ``flags`` Flags for the command (input). ``op_size`` Size of input payload. ``reserved1`` Reserved. Must be 0s. ``{unnamed_union}`` anonymous ``get_sup_feats_in`` Get Supported Features input ``get_feat_in`` Get Feature input ``set_feat_in`` Set Feature inputh](h)}(h**Definition**::h](hstrong)}(h**Definition**h]h Definition}(hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1j*hj&ubh:}(hj&hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhf/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl-cxl:41: ./include/uapi/fwctl/cxl.hhKhj"ubh literal_block)}(hX8struct fwctl_rpc_cxl { struct { __u32 opcode; __u32 flags; __u32 op_size; __u32 reserved1; }; union { struct cxl_mbox_get_sup_feats_in get_sup_feats_in; struct cxl_mbox_get_feat_in get_feat_in; struct cxl_mbox_set_feat_in set_feat_in; }; };h]hX8struct fwctl_rpc_cxl { struct { __u32 opcode; __u32 flags; __u32 op_size; __u32 reserved1; }; union { struct cxl_mbox_get_sup_feats_in get_sup_feats_in; struct cxl_mbox_get_feat_in get_feat_in; struct cxl_mbox_set_feat_in set_feat_in; }; };}hjGsbah}(h]h ]h"]h$]h&]hhuh1jEhf/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl-cxl:41: ./include/uapi/fwctl/cxl.hhKhj"ubh)}(h **Members**h]j+)}(hjXh]hMembers}(hjZhhhNhNubah}(h]h ]h"]h$]h&]uh1j*hjVubah}(h]h ]h"]h$]h&]uh1hhf/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl-cxl:41: ./include/uapi/fwctl/cxl.hhK#hj"ubhdefinition_list)}(hhh](hdefinition_list_item)}(h``{unnamed_struct}`` anonymous h](hterm)}(h``{unnamed_struct}``h]hliteral)}(hj}h]h{unnamed_struct}}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj{ubah}(h]h ]h"]h$]h&]uh1jyhf/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl-cxl:41: ./include/uapi/fwctl/cxl.hhKhjuubh definition)}(hhh]h)}(h anonymoush]h anonymous}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKhjubah}(h]h ]h"]h$]h&]uh1jhjuubeh}(h]h ]h"]h$]h&]uh1jshjhKhjpubjt)}(h&``opcode`` CXL mailbox command opcode h](jz)}(h ``opcode``h]j)}(hjh]hopcode}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jyhf/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl-cxl:41: ./include/uapi/fwctl/cxl.hhKhjubj)}(hhh]h)}(hCXL mailbox command opcodeh]hCXL mailbox command opcode}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jshjhKhjpubjt)}(h)``flags`` Flags for the command (input). h](jz)}(h ``flags``h]j)}(hjh]hflags}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jyhf/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl-cxl:41: ./include/uapi/fwctl/cxl.hhKhjubj)}(hhh]h)}(hFlags for the command (input).h]hFlags for the command (input).}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKhj ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jshjhKhjpubjt)}(h#``op_size`` Size of input payload. h](jz)}(h ``op_size``h]j)}(hj,h]hop_size}(hj.hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj*ubah}(h]h ]h"]h$]h&]uh1jyhf/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl-cxl:41: ./include/uapi/fwctl/cxl.hhKhj&ubj)}(hhh]h)}(hSize of input payload.h]hSize of input payload.}(hjEhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjAhKhjBubah}(h]h ]h"]h$]h&]uh1jhj&ubeh}(h]h ]h"]h$]h&]uh1jshjAhKhjpubjt)}(h$``reserved1`` Reserved. Must be 0s. h](jz)}(h ``reserved1``h]j)}(hjeh]h reserved1}(hjghhhNhNubah}(h]h ]h"]h$]h&]uh1jhjcubah}(h]h ]h"]h$]h&]uh1jyhf/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl-cxl:41: ./include/uapi/fwctl/cxl.hhKhj_ubj)}(hhh]h)}(hReserved. Must be 0s.h]hReserved. Must be 0s.}(hj~hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjzhKhj{ubah}(h]h ]h"]h$]h&]uh1jhj_ubeh}(h]h ]h"]h$]h&]uh1jshjzhKhjpubjt)}(h``{unnamed_union}`` anonymous h](jz)}(h``{unnamed_union}``h]j)}(hjh]h{unnamed_union}}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jyhf/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl-cxl:41: ./include/uapi/fwctl/cxl.hhKhjubj)}(hhh]h)}(h anonymoush]h anonymous}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jshjhKhjpubjt)}(h2``get_sup_feats_in`` Get Supported Features input h](jz)}(h``get_sup_feats_in``h]j)}(hjh]hget_sup_feats_in}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jyhf/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl-cxl:41: ./include/uapi/fwctl/cxl.hhKhjubj)}(hhh]h)}(hGet Supported Features inputh]hGet Supported Features input}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jshjhKhjpubjt)}(h"``get_feat_in`` Get Feature input h](jz)}(h``get_feat_in``h]j)}(hjh]h get_feat_in}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jyhf/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl-cxl:41: ./include/uapi/fwctl/cxl.hhKhj ubj)}(hhh]h)}(hGet Feature inputh]hGet Feature input}(hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj%hKhj&ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jshj%hKhjpubjt)}(h!``set_feat_in`` Set Feature inputh](jz)}(h``set_feat_in``h]j)}(hjIh]h set_feat_in}(hjKhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjGubah}(h]h ]h"]h$]h&]uh1jyhf/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl-cxl:41: ./include/uapi/fwctl/cxl.hhKhjCubj)}(hhh]h)}(hSet Feature inputh]hSet Feature input}(hjbhhhNhNubah}(h]h ]h"]h$]h&]uh1hhf/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl-cxl:41: ./include/uapi/fwctl/cxl.hhKhj_ubah}(h]h ]h"]h$]h&]uh1jhjCubeh}(h]h ]h"]h$]h&]uh1jshj^hKhjpubeh}(h]h ]h"]h$]h&]uh1jnhj"ubeh}(h]h ] kernelindentah"]h$]h&]uh1j hjphhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jfwctl_rpc_cxl_out (C struct)c.fwctl_rpc_cxl_outhNtauh1jhjphhhNhNubj)}(hhh](j)}(hfwctl_rpc_cxl_outh]j)}(hstruct fwctl_rpc_cxl_outh](j)}(hjh]hstruct}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhhf/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl-cxl:41: ./include/uapi/fwctl/cxl.hhKubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhhjhKubj)}(hfwctl_rpc_cxl_outh]j)}(hjh]hfwctl_rpc_cxl_out}(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)}(hioctl(FWCTL_RPC) output for CXLh]hioctl(FWCTL_RPC) output for CXL}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhf/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl-cxl:41: ./include/uapi/fwctl/cxl.hhK'hjhhubah}(h]h ]h"]h$]h&]uh1jhjhhhjhKubeh}(h]h ](jstructeh"]h$]h&]jjjjjjjjjuh1jhhhjphNhNubj!)}(hX**Definition**:: struct fwctl_rpc_cxl_out { struct { __u32 size; __u32 retval; }; union { struct cxl_mbox_get_sup_feats_out get_sup_feats_out; __u8 payload[]; }; }; **Members** ``{unnamed_struct}`` anonymous ``size`` Size of the output payload ``retval`` Return value from device ``{unnamed_union}`` anonymous ``get_sup_feats_out`` Get Supported Features output ``payload`` raw byte stream of payloadh](h)}(h**Definition**::h](j+)}(h**Definition**h]h Definition}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j*hjubh:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhf/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl-cxl:41: ./include/uapi/fwctl/cxl.hhK+hjubjF)}(hstruct fwctl_rpc_cxl_out { struct { __u32 size; __u32 retval; }; union { struct cxl_mbox_get_sup_feats_out get_sup_feats_out; __u8 payload[]; }; };h]hstruct fwctl_rpc_cxl_out { struct { __u32 size; __u32 retval; }; union { struct cxl_mbox_get_sup_feats_out get_sup_feats_out; __u8 payload[]; }; };}hj"sbah}(h]h ]h"]h$]h&]hhuh1jEhf/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl-cxl:41: ./include/uapi/fwctl/cxl.hhK-hjubh)}(h **Members**h]j+)}(hj3h]hMembers}(hj5hhhNhNubah}(h]h ]h"]h$]h&]uh1j*hj1ubah}(h]h ]h"]h$]h&]uh1hhf/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl-cxl:41: ./include/uapi/fwctl/cxl.hhK8hjubjo)}(hhh](jt)}(h``{unnamed_struct}`` anonymous h](jz)}(h``{unnamed_struct}``h]j)}(hjRh]h{unnamed_struct}}(hjThhhNhNubah}(h]h ]h"]h$]h&]uh1jhjPubah}(h]h ]h"]h$]h&]uh1jyhf/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl-cxl:41: ./include/uapi/fwctl/cxl.hhKhjLubj)}(hhh]h)}(h anonymoush]h anonymous}(hjkhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjghKhjhubah}(h]h ]h"]h$]h&]uh1jhjLubeh}(h]h ]h"]h$]h&]uh1jshjghKhjIubjt)}(h$``size`` Size of the output payload h](jz)}(h``size``h]j)}(hjh]hsize}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jyhf/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl-cxl:41: ./include/uapi/fwctl/cxl.hhK)hjubj)}(hhh]h)}(hSize of the output payloadh]hSize of the output payload}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhK)hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jshjhK)hjIubjt)}(h$``retval`` Return value from device h](jz)}(h ``retval``h]j)}(hjh]hretval}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jyhf/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl-cxl:41: ./include/uapi/fwctl/cxl.hhK*hjubj)}(hhh]h)}(hReturn value from deviceh]hReturn value from device}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhK*hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jshjhK*hjIubjt)}(h``{unnamed_union}`` anonymous h](jz)}(h``{unnamed_union}``h]j)}(hjh]h{unnamed_union}}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jyhf/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl-cxl:41: ./include/uapi/fwctl/cxl.hhKhjubj)}(hhh]h)}(h anonymoush]h anonymous}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jshjhKhjIubjt)}(h4``get_sup_feats_out`` Get Supported Features output h](jz)}(h``get_sup_feats_out``h]j)}(hj6h]hget_sup_feats_out}(hj8hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj4ubah}(h]h ]h"]h$]h&]uh1jyhf/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl-cxl:41: ./include/uapi/fwctl/cxl.hhK+hj0ubj)}(hhh]h)}(hGet Supported Features outputh]hGet Supported Features output}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjKhK+hjLubah}(h]h ]h"]h$]h&]uh1jhj0ubeh}(h]h ]h"]h$]h&]uh1jshjKhK+hjIubjt)}(h&``payload`` raw byte stream of payloadh](jz)}(h ``payload``h]j)}(hjoh]hpayload}(hjqhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjmubah}(h]h ]h"]h$]h&]uh1jyhf/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl-cxl:41: ./include/uapi/fwctl/cxl.hhK+hjiubj)}(hhh]h)}(hraw byte stream of payloadh]hraw byte stream of payload}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhf/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl-cxl:41: ./include/uapi/fwctl/cxl.hhK,hjubah}(h]h ]h"]h$]h&]uh1jhjiubeh}(h]h ]h"]h$]h&]uh1jshjhK+hjIubeh}(h]h ]h"]h$]h&]uh1jnhjubeh}(h]h ] kernelindentah"]h$]h&]uh1j hjphhhNhNubh)}(hhh](h)}(h1. Driver info queryh]h1. Driver info query}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhK,ubh)}(hXFirst step for the app is to issue the ioctl(FWCTL_CMD_INFO). Successful invocation of the ioctl implies the Features capability is operational and returns an all zeros 32bit payload. A ``struct fwctl_info`` needs to be filled out with the ``fwctl_info.out_device_type`` set to ``FWCTL_DEVICE_TYPE_CXL``. The return data should be ``struct fwctl_info_cxl`` that contains a reserved 32bit field that should be all zeros.h](hFirst step for the app is to issue the ioctl(FWCTL_CMD_INFO). Successful invocation of the ioctl implies the Features capability is operational and returns an all zeros 32bit payload. A }(hjhhhNhNubj)}(h``struct fwctl_info``h]hstruct fwctl_info}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh! needs to be filled out with the }(hjhhhNhNubj)}(h``fwctl_info.out_device_type``h]hfwctl_info.out_device_type}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh set to }(hjhhhNhNubj)}(h``FWCTL_DEVICE_TYPE_CXL``h]hFWCTL_DEVICE_TYPE_CXL}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh. The return data should be }(hjhhhNhNubj)}(h``struct fwctl_info_cxl``h]hstruct fwctl_info_cxl}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh? that contains a reserved 32bit field that should be all zeros.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK.hjhhubeh}(h]driver-info-queryah ]h"]1. driver info queryah$]h&]uh1hhjphhhhhK,ubh)}(hhh](h)}(h2. Send hardware commandsh]h2. Send hardware commands}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhK6ubh)}(hX^Next step is to send the 'Get Supported Features' command to the driver from user space via ioctl(FWCTL_RPC). A ``struct fwctl_rpc_cxl`` is pointed to by ``fwctl_rpc.in``. ``struct fwctl_rpc_cxl.in_payload`` points to the hardware input structure that is defined by the CXL spec. ``fwctl_rpc.out`` points to the buffer that contains a ``struct fwctl_rpc_cxl_out`` that includes the hardware output data inlined as ``fwctl_rpc_cxl_out.payload``. This command is called twice. First time to retrieve the number of features supported. A second time to retrieve the specific feature details as the output data.h](htNext step is to send the ‘Get Supported Features’ command to the driver from user space via ioctl(FWCTL_RPC). A }(hj0hhhNhNubj)}(h``struct fwctl_rpc_cxl``h]hstruct fwctl_rpc_cxl}(hj8hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj0ubh is pointed to by }(hj0hhhNhNubj)}(h``fwctl_rpc.in``h]h fwctl_rpc.in}(hjJhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj0ubh. }(hj0hhhNhNubj)}(h#``struct fwctl_rpc_cxl.in_payload``h]hstruct fwctl_rpc_cxl.in_payload}(hj\hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj0ubhI points to the hardware input structure that is defined by the CXL spec. }(hj0hhhNhNubj)}(h``fwctl_rpc.out``h]h fwctl_rpc.out}(hjnhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj0ubh& points to the buffer that contains a }(hj0hhhNhNubj)}(h``struct fwctl_rpc_cxl_out``h]hstruct fwctl_rpc_cxl_out}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj0ubh3 that includes the hardware output data inlined as }(hj0hhhNhNubj)}(h``fwctl_rpc_cxl_out.payload``h]hfwctl_rpc_cxl_out.payload}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj0ubh. This command is called twice. First time to retrieve the number of features supported. A second time to retrieve the specific feature details as the output data.}(hj0hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK8hjhhubh)}(hXhAfter getting the specific feature details, a Get/Set Feature command can be appropriately programmed and sent. For a "Set Feature" command, the retrieved feature info contains an effects field that details the resulting "Set Feature" command will trigger. That will inform the user whether the system is configured to allowed the "Set Feature" command or not.h]hXtAfter getting the specific feature details, a Get/Set Feature command can be appropriately programmed and sent. For a “Set Feature” command, the retrieved feature info contains an effects field that details the resulting “Set Feature” command will trigger. That will inform the user whether the system is configured to allowed the “Set Feature” command or not.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKAhjhhubh)}(hhh](h)}(hCode example of a Get Featureh]hCode example of a Get Feature}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKHubjF)}(hXBstatic int cxl_fwctl_rpc_get_test_feature(int fd, struct test_feature *feat_ctx, const uint32_t expected_data) { struct cxl_mbox_get_feat_in *feat_in; struct fwctl_rpc_cxl_out *out; struct fwctl_rpc rpc = {0}; struct fwctl_rpc_cxl *in; size_t out_size, in_size; uint32_t val; void *data; int rc; in_size = sizeof(*in) + sizeof(*feat_in); rc = posix_memalign((void **)&in, 16, in_size); if (rc) return -ENOMEM; memset(in, 0, in_size); feat_in = &in->get_feat_in; uuid_copy(feat_in->uuid, feat_ctx->uuid); feat_in->count = feat_ctx->get_size; out_size = sizeof(*out) + feat_ctx->get_size; rc = posix_memalign((void **)&out, 16, out_size); if (rc) goto free_in; memset(out, 0, out_size); in->opcode = CXL_MBOX_OPCODE_GET_FEATURE; in->op_size = sizeof(*feat_in); rpc.size = sizeof(rpc); rpc.scope = FWCTL_RPC_CONFIGURATION; rpc.in_len = in_size; rpc.out_len = out_size; rpc.in = (uint64_t)(uint64_t *)in; rpc.out = (uint64_t)(uint64_t *)out; rc = send_command(fd, &rpc, out); if (rc) goto free_all; data = out->payload; val = le32toh(*(__le32 *)data); if (memcmp(&val, &expected_data, sizeof(val)) != 0) { rc = -ENXIO; goto free_all; } free_all: free(out); free_in: free(in); return rc; }h]hXBstatic int cxl_fwctl_rpc_get_test_feature(int fd, struct test_feature *feat_ctx, const uint32_t expected_data) { struct cxl_mbox_get_feat_in *feat_in; struct fwctl_rpc_cxl_out *out; struct fwctl_rpc rpc = {0}; struct fwctl_rpc_cxl *in; size_t out_size, in_size; uint32_t val; void *data; int rc; in_size = sizeof(*in) + sizeof(*feat_in); rc = posix_memalign((void **)&in, 16, in_size); if (rc) return -ENOMEM; memset(in, 0, in_size); feat_in = &in->get_feat_in; uuid_copy(feat_in->uuid, feat_ctx->uuid); feat_in->count = feat_ctx->get_size; out_size = sizeof(*out) + feat_ctx->get_size; rc = posix_memalign((void **)&out, 16, out_size); if (rc) goto free_in; memset(out, 0, out_size); in->opcode = CXL_MBOX_OPCODE_GET_FEATURE; in->op_size = sizeof(*feat_in); rpc.size = sizeof(rpc); rpc.scope = FWCTL_RPC_CONFIGURATION; rpc.in_len = in_size; rpc.out_len = out_size; rpc.in = (uint64_t)(uint64_t *)in; rpc.out = (uint64_t)(uint64_t *)out; rc = send_command(fd, &rpc, out); if (rc) goto free_all; data = out->payload; val = le32toh(*(__le32 *)data); if (memcmp(&val, &expected_data, sizeof(val)) != 0) { rc = -ENXIO; goto free_all; } free_all: free(out); free_in: free(in); return rc; }}hjsbah}(h]h ]h"]h$]h&]hhƌforcelanguagejhighlight_args}uh1jEhhhKJhjhhubh)}(hTake a look at CXL CLI test directory for a detailed user code for examples on how to exercise this path.h](h'Take a look at CXL CLI test directory <}(hjhhhNhNubh reference)}(h4https://github.com/pmem/ndctl/tree/main/test/fwctl.ch]h4https://github.com/pmem/ndctl/tree/main/test/fwctl.c}(hjhhhNhNubah}(h]h ]h"]h$]h&]refurijuh1jhjubhE> for a detailed user code for examples on how to exercise this path.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h]code-example-of-a-get-featureah ]h"]code example of a get featureah$]h&]uh1hhjhhhhhKHubeh}(h]send-hardware-commandsah ]h"]2. send hardware commandsah$]h&]uh1hhjphhhhhK6ubeh}(h]fwctl-cxl-user-apiah ]h"]fwctl cxl user apiah$]h&]uh1hhhhhhhhK'ubh)}(hhh](h)}(hfwctl cxl Kernel APIh]hfwctl cxl Kernel API}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j$devm_cxl_setup_features (C function)c.devm_cxl_setup_featureshNtauh1jhjhhhNhNubj)}(hhh](j)}(h9int devm_cxl_setup_features (struct cxl_dev_state *cxlds)h]j)}(h8int devm_cxl_setup_features(struct cxl_dev_state *cxlds)h](hdesc_sig_keyword_type)}(hinth]hint}(hjBhhhNhNubah}(h]h ]ktah"]h$]h&]uh1j@hj<hhhj/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl-cxl:140: ./drivers/cxl/core/features.chKubj)}(h h]h }(hjRhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj<hhhjQhKubj)}(hdevm_cxl_setup_featuresh]j)}(hdevm_cxl_setup_featuresh]hdevm_cxl_setup_features}(hjdhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj`ubah}(h]h ](jjeh"]h$]h&]hhuh1jhj<hhhjQhKubhdesc_parameterlist)}(h(struct cxl_dev_state *cxlds)h]hdesc_parameter)}(hstruct cxl_dev_state *cxldsh](j)}(hjh]hstruct}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubh)}(hhh]j)}(h cxl_dev_stateh]h cxl_dev_state}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&] refdomainjreftype identifier reftargetjmodnameN classnameN c:parent_keysphinx.domains.c LookupKey)}data]j ASTIdentifier)}jjfsbc.devm_cxl_setup_featuresasbuh1hhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubhdesc_sig_punctuation)}(h*h]h*}(hjhhhNhNubah}(h]h ]pah"]h$]h&]uh1jhjubj)}(hcxldsh]hcxlds}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphhhuh1j~hjzubah}(h]h ]h"]h$]h&]hhuh1jxhj<hhhjQhKubeh}(h]h ]h"]h$]h&]hhjuh1jjjhj8hhhjQhKubah}(h]j3ah ](jjeh"]h$]h&]jj)jhuh1jhjQhKhj5hhubj)}(hhh]h)}(h(Allocate and initialize features contexth]h(Allocate and initialize features context}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl-cxl:140: ./drivers/cxl/core/features.chKhj hhubah}(h]h ]h"]h$]h&]uh1jhj5hhhjQhKubeh}(h]h ](jfunctioneh"]h$]h&]jjjj+ jj+ jjjuh1jhhhjhNhNubj!)}(h**Parameters** ``struct cxl_dev_state *cxlds`` CXL device context **Description** Return 0 on success or -errno on failure.h](h)}(h**Parameters**h]j+)}(hj5 h]h Parameters}(hj7 hhhNhNubah}(h]h ]h"]h$]h&]uh1j*hj3 ubah}(h]h ]h"]h$]h&]uh1hhj/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl-cxl:140: ./drivers/cxl/core/features.chKhj/ ubjo)}(hhh]jt)}(h3``struct cxl_dev_state *cxlds`` CXL device context h](jz)}(h``struct cxl_dev_state *cxlds``h]j)}(hjT h]hstruct cxl_dev_state *cxlds}(hjV hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjR ubah}(h]h ]h"]h$]h&]uh1jyhj/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl-cxl:140: ./drivers/cxl/core/features.chKhjN ubj)}(hhh]h)}(hCXL device contexth]hCXL device context}(hjm hhhNhNubah}(h]h ]h"]h$]h&]uh1hhji hKhjj ubah}(h]h ]h"]h$]h&]uh1jhjN ubeh}(h]h ]h"]h$]h&]uh1jshji hKhjK ubah}(h]h ]h"]h$]h&]uh1jnhj/ ubh)}(h**Description**h]j+)}(hj h]h Description}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j*hj ubah}(h]h ]h"]h$]h&]uh1hhj/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl-cxl:140: ./drivers/cxl/core/features.chKhj/ ubh)}(h)Return 0 on success or -errno on failure.h]h)Return 0 on success or -errno on failure.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl-cxl:140: ./drivers/cxl/core/features.chKhj/ ubeh}(h]h ] kernelindentah"]h$]h&]uh1j hjhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jcxl_features_state (C struct)c.cxl_features_statehNtauh1jhjhhhNhNubj)}(hhh](j)}(hcxl_features_stateh]j)}(hstruct cxl_features_stateh](j)}(hjh]hstruct}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj hhhe/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl-cxl:142: ./include/cxl/features.hhKubj)}(h h]h }(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj hhhj hKubj)}(hcxl_features_stateh]j)}(hj h]hcxl_features_state}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubah}(h]h ](jjeh"]h$]h&]hhuh1jhj hhhj hKubeh}(h]h ]h"]h$]h&]hhjuh1jjjhj hhhj hKubah}(h]j ah ](jjeh"]h$]h&]jj)jhuh1jhj hKhj hhubj)}(hhh]h)}(h!The Features state for the deviceh]h!The Features state for the device}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl-cxl:142: ./include/cxl/features.hhK3hj hhubah}(h]h ]h"]h$]h&]uh1jhj hhhj hKubeh}(h]h ](jstructeh"]h$]h&]jjjj. jj. jjjuh1jhhhjhNhNubj!)}(hXL**Definition**:: struct cxl_features_state { struct cxl_dev_state *cxlds; struct cxl_feat_entries { int num_features; int num_user_features; struct cxl_feat_entry ent[]; } *entries; }; **Members** ``cxlds`` Pointer to CXL device state ``entries`` CXl feature entry contexth](h)}(h**Definition**::h](j+)}(h**Definition**h]h Definition}(hj: hhhNhNubah}(h]h ]h"]h$]h&]uh1j*hj6 ubh:}(hj6 hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl-cxl:142: ./include/cxl/features.hhK7hj2 ubjF)}(hstruct cxl_features_state { struct cxl_dev_state *cxlds; struct cxl_feat_entries { int num_features; int num_user_features; struct cxl_feat_entry ent[]; } *entries; };h]hstruct cxl_features_state { struct cxl_dev_state *cxlds; struct cxl_feat_entries { int num_features; int num_user_features; struct cxl_feat_entry ent[]; } *entries; };}hjS sbah}(h]h ]h"]h$]h&]hhuh1jEhe/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl-cxl:142: ./include/cxl/features.hhK9hj2 ubh)}(h **Members**h]j+)}(hjd h]hMembers}(hjf hhhNhNubah}(h]h ]h"]h$]h&]uh1j*hjb ubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl-cxl:142: ./include/cxl/features.hhKBhj2 ubjo)}(hhh](jt)}(h&``cxlds`` Pointer to CXL device state h](jz)}(h ``cxlds``h]j)}(hj h]hcxlds}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1jyhe/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl-cxl:142: ./include/cxl/features.hhK5hj} ubj)}(hhh]h)}(hPointer to CXL device stateh]hPointer to CXL device state}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hK5hj ubah}(h]h ]h"]h$]h&]uh1jhj} ubeh}(h]h ]h"]h$]h&]uh1jshj hK5hjz ubjt)}(h%``entries`` CXl feature entry contexth](jz)}(h ``entries``h]j)}(hj h]hentries}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1jyhe/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl-cxl:142: ./include/cxl/features.hhK5hj ubj)}(hhh]h)}(hCXl feature entry contexth]hCXl feature entry context}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhe/var/lib/git/docbuild/linux/Documentation/userspace-api/fwctl/fwctl-cxl:142: ./include/cxl/features.hhK6hj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jshj hK5hjz ubeh}(h]h ]h"]h$]h&]uh1jnhj2 ubeh}(h]h ] kernelindentah"]h$]h&]uh1j hjhhhNhNubeh}(h]fwctl-cxl-kernel-apiah ]h"]fwctl cxl kernel apiah$]h&]uh1hhhhhhhhKubeh}(h]fwctl-cxl-driverah ]h"]fwctl cxl driverah$]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_handlerj0 error_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}nameids}(j j jmjjjjjjj jjjj j u nametypes}(j jmjjj jj uh}(j hjjjjjpjjjjjjjjjjj jj3j8j j u 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] transformerN include_log] decorationNhhub.