Lines Matching refs:cm

53 static void em_canid_sff_match_add(struct canid_match *cm, u32 can_id,  in em_canid_sff_match_add()  argument
67 set_bit(can_id, cm->match_sff); in em_canid_sff_match_add()
73 bitmap_fill(cm->match_sff, (1 << CAN_SFF_ID_BITS)); in em_canid_sff_match_add()
84 set_bit(i, cm->match_sff); in em_canid_sff_match_add()
96 struct canid_match *cm = em_canid_priv(m); in em_canid_match() local
105 for (i = 0, lp = cm->rules_raw; in em_canid_match()
106 i < cm->eff_rules_count; i++, lp++) { in em_canid_match()
114 match = (test_bit(can_id, cm->match_sff) ? 1 : 0); in em_canid_match()
124 struct canid_match *cm; in em_canid_change() local
136 cm = kzalloc(sizeof(struct canid_match) + len, GFP_KERNEL); in em_canid_change()
137 if (!cm) in em_canid_change()
140 cm->rules_count = len / sizeof(struct can_filter); in em_canid_change()
153 for (i = 0; i < cm->rules_count; i++) { in em_canid_change()
155 memcpy(cm->rules_raw + cm->eff_rules_count, in em_canid_change()
159 cm->eff_rules_count++; in em_canid_change()
164 for (i = 0; i < cm->rules_count; i++) { in em_canid_change()
166 memcpy(cm->rules_raw in em_canid_change()
167 + cm->eff_rules_count in em_canid_change()
168 + cm->sff_rules_count, in em_canid_change()
171 cm->sff_rules_count++; in em_canid_change()
173 em_canid_sff_match_add(cm, in em_canid_change()
179 m->data = (unsigned long)cm; in em_canid_change()
185 struct canid_match *cm = em_canid_priv(m); in em_canid_destroy() local
187 kfree(cm); in em_canid_destroy()
192 struct canid_match *cm = em_canid_priv(m); in em_canid_dump() local
198 if (nla_put_nohdr(skb, sizeof(struct can_filter) * cm->rules_count, in em_canid_dump()
199 &cm->rules_raw) < 0) in em_canid_dump()