From: Rostislav Lisovy Date: Mon, 22 Aug 2011 10:50:42 +0000 (+0200) Subject: Canprio-specific 'struct canprio_rule' changed to 'struct can_filter' from linux... X-Git-Url: http://rtime.felk.cvut.cz/gitweb/lisovros/linux_canprio.git/commitdiff_plain/3c8ccb7e125443fdda3a938aee8cbed1f87b7373 Canprio-specific 'struct canprio_rule' changed to 'struct can_filter' from linux/can.h --- diff --git a/net/sched/cls_canprio.c b/net/sched/cls_canprio.c index a3380c43ef1..12c471305c2 100644 --- a/net/sched/cls_canprio.c +++ b/net/sched/cls_canprio.c @@ -38,15 +38,10 @@ #include #include #include +#include -//-------------------------------------- -//FIXME put in some *.h file shared with userspace "tc"? -struct canprio_rule { - __u32 canid; - __u32 canid_mask; -}; -struct canprio_rule *canprio_rules; +struct can_filter *canprio_rules; int canprio_rules_count = 0; //-------------------------------------- @@ -63,7 +58,7 @@ enum { static const struct nla_policy canprio_policy[TCA_CANPRIO_MAX + 1] = { [TCA_CANPRIO_CLASSID] = { .type = NLA_U32 }, //FIXME Be aware of possible problems with 64bit kernel and 32bit userspace etc. - [TCA_CANPRIO_RULES] = { .len = (sizeof(struct canprio_rule)) }, //FIXME + [TCA_CANPRIO_RULES] = { .len = (sizeof(struct can_filter)) }, //FIXME [TCA_CANPRIO_INV_EN] = { .type = NLA_U32 }, }; @@ -368,23 +363,23 @@ static int canprio_change(struct tcf_proto *tp, unsigned long base, u32 handle, return -EINVAL; canprio_rules = nla_data(tb[TCA_CANPRIO_RULES]); - canprio_rules_count = (nla_len(tb[TCA_CANPRIO_RULES]) / sizeof(struct canprio_rule)); + canprio_rules_count = (nla_len(tb[TCA_CANPRIO_RULES]) / sizeof(struct can_filter)); printk(" rules_count = %u\n", canprio_rules_count); for (i = 0; i < canprio_rules_count; i++) { /* FIXME: shouldn't use here the same logic as in * can_rcv_filter() to filter for various combination * of flags (EFF, RTR) */ - if (canprio_rules[i].canid & CAN_EFF_FLAG) { - err = canprio_eff_match_add(f, canprio_rules[i].canid, canprio_rules[i].canid_mask); + if (canprio_rules[i].can_id & CAN_EFF_FLAG) { + err = canprio_eff_match_add(f, canprio_rules[i].can_id, canprio_rules[i].can_mask); if (err < 0) goto errout; } else { - canprio_sff_match_add(f, canprio_rules[i].canid, canprio_rules[i].canid_mask); + canprio_sff_match_add(f, canprio_rules[i].can_id, canprio_rules[i].can_mask); } printk(" can ID to match = 0x%x with mask 0x%x\n", - canprio_rules[i].canid, canprio_rules[i].canid_mask); + canprio_rules[i].can_id, canprio_rules[i].can_mask); } f->inv_match_en = 0;