Lines Matching defs:vrule

52 				int (*add_ptp_key)(struct vcap_rule *vrule,
58 struct vcap_rule *vrule;
61 vrule = vcap_get_rule(lan966x->vcap_ctrl, rule_id);
62 if (!IS_ERR(vrule)) {
66 vcap_rule_get_key_u32(vrule, VCAP_KF_IF_IGR_PORT_MASK,
69 vcap_rule_mod_key_u32(vrule, VCAP_KF_IF_IGR_PORT_MASK,
72 err = vcap_mod_rule(vrule);
76 vrule = vcap_alloc_rule(lan966x->vcap_ctrl, port->dev,
79 if (IS_ERR(vrule))
80 return PTR_ERR(vrule);
82 err = add_ptp_key(vrule, port);
86 err = vcap_rule_add_action_bit(vrule, VCAP_AF_CPU_COPY_ENA, VCAP_BIT_1);
87 err |= vcap_rule_add_action_u32(vrule, VCAP_AF_MASK_MODE, LAN966X_PMM_REPLACE);
88 err |= vcap_val_rule(vrule, proto);
92 err = vcap_add_rule(vrule);
96 vcap_free_rule(vrule);
104 struct vcap_rule *vrule;
108 vrule = vcap_get_rule(lan966x->vcap_ctrl, rule_id);
109 if (IS_ERR(vrule))
112 vcap_rule_get_key_u32(vrule, VCAP_KF_IF_IGR_PORT_MASK, &value, &mask);
121 vcap_rule_mod_key_u32(vrule, VCAP_KF_IF_IGR_PORT_MASK, value, mask);
122 err = vcap_mod_rule(vrule);
125 vcap_free_rule(vrule);
129 static int lan966x_ptp_add_l2_key(struct vcap_rule *vrule,
132 return vcap_rule_add_key_u32(vrule, VCAP_KF_ETYPE, ETH_P_1588, ~0);
135 static int lan966x_ptp_add_ip_event_key(struct vcap_rule *vrule,
138 return vcap_rule_add_key_u32(vrule, VCAP_KF_L4_DPORT, PTP_EV_PORT, ~0) ||
139 vcap_rule_add_key_bit(vrule, VCAP_KF_TCP_IS, VCAP_BIT_0);
142 static int lan966x_ptp_add_ip_general_key(struct vcap_rule *vrule,
145 return vcap_rule_add_key_u32(vrule, VCAP_KF_L4_DPORT, PTP_GEN_PORT, ~0) ||
146 vcap_rule_add_key_bit(vrule, VCAP_KF_TCP_IS, VCAP_BIT_0);