* ----------------------------------------------------------------------------
*/
-static void canprio_sff_match_add(struct canprio_rules *rls, u32 canid, u32 mask)
+static void canprio_sff_match_add(struct canprio_rules *rls, u32 can_id, u32 can_mask)
{
int i;
printk("%s() invoked\n", __FUNCTION__);
- mask &= CAN_SFF_MASK;
- canid &= mask;
+ can_mask &= CAN_SFF_MASK;
+ can_id &= can_mask;
- if (mask == CAN_SFF_MASK) {
- set_bit(canid, rls->match_sff);
+ if (can_mask == CAN_SFF_MASK) {
+ set_bit(can_id, rls->match_sff);
return;
}
/* Add record (set bit to 1) for each ID that conforms particular rule */
for (i = 0; i <= CAN_SFF_MASK; i++) {
- if ((i & mask) == canid)
+ if ((i & can_mask) == can_id)
set_bit(i, rls->match_sff);
}
}
{
struct canprio_head *head = (struct canprio_head *)tp->root;
struct canprio_filter *f;
- u32 canid;
+ u32 can_id;
int i;
printk(" canprio_classify() invoked\n");
- canid = (u32)canprio_get_id(skb);
+ can_id = (u32)canprio_get_id(skb);
list_for_each_entry(f, &head->flist, link) {
bool match = false;
- if (canid & CAN_EFF_FLAG) {
- canid &= CAN_EFF_MASK;
+ if (can_id & CAN_EFF_FLAG) {
+ can_id &= CAN_EFF_MASK;
for (i = 0; i < f->rules->eff_rules_count; i++) {
if ((f->rules->rules_raw[i].can_id & f->rules->rules_raw[i].can_mask & CAN_EFF_MASK) ==
- (canid & f->rules->rules_raw[i].can_mask & CAN_EFF_MASK)) {
+ (can_id & f->rules->rules_raw[i].can_mask & CAN_EFF_MASK)) {
match = true;
break;
}
}
} else {
- match = test_bit(canid, f->rules->match_sff);
+ match = test_bit(can_id, f->rules->match_sff);
}
//if (f->rules->inv_match_en)
if (match) {
*res = f->res;
- printk( " canprio_classify() match ok: ID 0x%x\n", canid);
+ printk( " canprio_classify() match ok: ID 0x%x\n", can_id);
return TC_POLICE_OK;
}
}