1 // SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) 2 /* Do not edit directly, auto-generated from: */ 3 /* Documentation/netlink/specs/dpll.yaml */ 4 /* YNL-GEN kernel source */ 5 6 #include <net/netlink.h> 7 #include <net/genetlink.h> 8 9 #include "dpll_nl.h" 10 11 #include <uapi/linux/dpll.h> 12 13 /* Common nested types */ 14 const struct nla_policy dpll_pin_parent_device_nl_policy[DPLL_A_PIN_STATE + 1] = { 15 [DPLL_A_PIN_PARENT_ID] = { .type = NLA_U32, }, 16 [DPLL_A_PIN_DIRECTION] = NLA_POLICY_RANGE(NLA_U32, 1, 2), 17 [DPLL_A_PIN_PRIO] = { .type = NLA_U32, }, 18 [DPLL_A_PIN_STATE] = NLA_POLICY_RANGE(NLA_U32, 1, 3), 19 }; 20 21 const struct nla_policy dpll_pin_parent_pin_nl_policy[DPLL_A_PIN_STATE + 1] = { 22 [DPLL_A_PIN_PARENT_ID] = { .type = NLA_U32, }, 23 [DPLL_A_PIN_STATE] = NLA_POLICY_RANGE(NLA_U32, 1, 3), 24 }; 25 26 /* DPLL_CMD_DEVICE_ID_GET - do */ 27 static const struct nla_policy dpll_device_id_get_nl_policy[DPLL_A_TYPE + 1] = { 28 [DPLL_A_MODULE_NAME] = { .type = NLA_NUL_STRING, }, 29 [DPLL_A_CLOCK_ID] = { .type = NLA_U64, }, 30 [DPLL_A_TYPE] = NLA_POLICY_RANGE(NLA_U32, 1, 2), 31 }; 32 33 /* DPLL_CMD_DEVICE_GET - do */ 34 static const struct nla_policy dpll_device_get_nl_policy[DPLL_A_ID + 1] = { 35 [DPLL_A_ID] = { .type = NLA_U32, }, 36 }; 37 38 /* DPLL_CMD_DEVICE_SET - do */ 39 static const struct nla_policy dpll_device_set_nl_policy[DPLL_A_ID + 1] = { 40 [DPLL_A_ID] = { .type = NLA_U32, }, 41 }; 42 43 /* DPLL_CMD_PIN_ID_GET - do */ 44 static const struct nla_policy dpll_pin_id_get_nl_policy[DPLL_A_PIN_TYPE + 1] = { 45 [DPLL_A_PIN_MODULE_NAME] = { .type = NLA_NUL_STRING, }, 46 [DPLL_A_PIN_CLOCK_ID] = { .type = NLA_U64, }, 47 [DPLL_A_PIN_BOARD_LABEL] = { .type = NLA_NUL_STRING, }, 48 [DPLL_A_PIN_PANEL_LABEL] = { .type = NLA_NUL_STRING, }, 49 [DPLL_A_PIN_PACKAGE_LABEL] = { .type = NLA_NUL_STRING, }, 50 [DPLL_A_PIN_TYPE] = NLA_POLICY_RANGE(NLA_U32, 1, 5), 51 }; 52 53 /* DPLL_CMD_PIN_GET - do */ 54 static const struct nla_policy dpll_pin_get_do_nl_policy[DPLL_A_PIN_ID + 1] = { 55 [DPLL_A_PIN_ID] = { .type = NLA_U32, }, 56 }; 57 58 /* DPLL_CMD_PIN_GET - dump */ 59 static const struct nla_policy dpll_pin_get_dump_nl_policy[DPLL_A_PIN_ID + 1] = { 60 [DPLL_A_PIN_ID] = { .type = NLA_U32, }, 61 }; 62 63 /* DPLL_CMD_PIN_SET - do */ 64 static const struct nla_policy dpll_pin_set_nl_policy[DPLL_A_PIN_PARENT_PIN + 1] = { 65 [DPLL_A_PIN_ID] = { .type = NLA_U32, }, 66 [DPLL_A_PIN_FREQUENCY] = { .type = NLA_U64, }, 67 [DPLL_A_PIN_DIRECTION] = NLA_POLICY_RANGE(NLA_U32, 1, 2), 68 [DPLL_A_PIN_PRIO] = { .type = NLA_U32, }, 69 [DPLL_A_PIN_STATE] = NLA_POLICY_RANGE(NLA_U32, 1, 3), 70 [DPLL_A_PIN_PARENT_DEVICE] = NLA_POLICY_NESTED(dpll_pin_parent_device_nl_policy), 71 [DPLL_A_PIN_PARENT_PIN] = NLA_POLICY_NESTED(dpll_pin_parent_pin_nl_policy), 72 }; 73 74 /* Ops table for dpll */ 75 static const struct genl_split_ops dpll_nl_ops[] = { 76 { 77 .cmd = DPLL_CMD_DEVICE_ID_GET, 78 .pre_doit = dpll_lock_doit, 79 .doit = dpll_nl_device_id_get_doit, 80 .post_doit = dpll_unlock_doit, 81 .policy = dpll_device_id_get_nl_policy, 82 .maxattr = DPLL_A_TYPE, 83 .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO, 84 }, 85 { 86 .cmd = DPLL_CMD_DEVICE_GET, 87 .pre_doit = dpll_pre_doit, 88 .doit = dpll_nl_device_get_doit, 89 .post_doit = dpll_post_doit, 90 .policy = dpll_device_get_nl_policy, 91 .maxattr = DPLL_A_ID, 92 .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO, 93 }, 94 { 95 .cmd = DPLL_CMD_DEVICE_GET, 96 .start = dpll_lock_dumpit, 97 .dumpit = dpll_nl_device_get_dumpit, 98 .done = dpll_unlock_dumpit, 99 .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DUMP, 100 }, 101 { 102 .cmd = DPLL_CMD_DEVICE_SET, 103 .pre_doit = dpll_pre_doit, 104 .doit = dpll_nl_device_set_doit, 105 .post_doit = dpll_post_doit, 106 .policy = dpll_device_set_nl_policy, 107 .maxattr = DPLL_A_ID, 108 .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO, 109 }, 110 { 111 .cmd = DPLL_CMD_PIN_ID_GET, 112 .pre_doit = dpll_lock_doit, 113 .doit = dpll_nl_pin_id_get_doit, 114 .post_doit = dpll_unlock_doit, 115 .policy = dpll_pin_id_get_nl_policy, 116 .maxattr = DPLL_A_PIN_TYPE, 117 .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO, 118 }, 119 { 120 .cmd = DPLL_CMD_PIN_GET, 121 .pre_doit = dpll_pin_pre_doit, 122 .doit = dpll_nl_pin_get_doit, 123 .post_doit = dpll_pin_post_doit, 124 .policy = dpll_pin_get_do_nl_policy, 125 .maxattr = DPLL_A_PIN_ID, 126 .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO, 127 }, 128 { 129 .cmd = DPLL_CMD_PIN_GET, 130 .start = dpll_lock_dumpit, 131 .dumpit = dpll_nl_pin_get_dumpit, 132 .done = dpll_unlock_dumpit, 133 .policy = dpll_pin_get_dump_nl_policy, 134 .maxattr = DPLL_A_PIN_ID, 135 .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DUMP, 136 }, 137 { 138 .cmd = DPLL_CMD_PIN_SET, 139 .pre_doit = dpll_pin_pre_doit, 140 .doit = dpll_nl_pin_set_doit, 141 .post_doit = dpll_pin_post_doit, 142 .policy = dpll_pin_set_nl_policy, 143 .maxattr = DPLL_A_PIN_PARENT_PIN, 144 .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO, 145 }, 146 }; 147 148 static const struct genl_multicast_group dpll_nl_mcgrps[] = { 149 [DPLL_NLGRP_MONITOR] = { "monitor", }, 150 }; 151 152 struct genl_family dpll_nl_family __ro_after_init = { 153 .name = DPLL_FAMILY_NAME, 154 .version = DPLL_FAMILY_VERSION, 155 .netnsok = true, 156 .parallel_ops = true, 157 .module = THIS_MODULE, 158 .split_ops = dpll_nl_ops, 159 .n_split_ops = ARRAY_SIZE(dpll_nl_ops), 160 .mcgrps = dpll_nl_mcgrps, 161 .n_mcgrps = ARRAY_SIZE(dpll_nl_mcgrps), 162 }; 163