summaryrefslogtreecommitdiffstats
path: root/net/can/af_can.h
diff options
context:
space:
mode:
authorOliver Hartkopp <socketcan@hartkopp.net>2014-04-02 20:25:26 +0200
committerMarc Kleine-Budde <mkl@pengutronix.de>2014-05-19 09:38:24 +0200
commit45c700291aee5170185bf5d1c2a494b1e3fe0883 (patch)
tree296c18dc3657954ecf84a51c588046e855f2d9cd /net/can/af_can.h
parente3d3917f3d8f624a8df567b581fd8c4da49b443f (diff)
downloadlinux-stable-45c700291aee5170185bf5d1c2a494b1e3fe0883.tar.gz
linux-stable-45c700291aee5170185bf5d1c2a494b1e3fe0883.tar.bz2
linux-stable-45c700291aee5170185bf5d1c2a494b1e3fe0883.zip
can: add hash based access to single EFF frame filters
In contrast to the direct access to the single SFF frame filters (which are indexed by the SFF CAN ID itself) the single EFF frame filters are arranged in a single linked hlist. To reduce the hlist traversal in the case of many filter subscriptions a hash based access is introduced for single EFF filters. Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'net/can/af_can.h')
-rw-r--r--net/can/af_can.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/can/af_can.h b/net/can/af_can.h
index b4bdaa32d7a4..fca0fe9fc45a 100644
--- a/net/can/af_can.h
+++ b/net/can/af_can.h
@@ -60,13 +60,16 @@ struct receiver {
};
#define CAN_SFF_RCV_ARRAY_SZ (1 << CAN_SFF_ID_BITS)
+#define CAN_EFF_RCV_HASH_BITS 10
+#define CAN_EFF_RCV_ARRAY_SZ (1 << CAN_EFF_RCV_HASH_BITS)
-enum { RX_ERR, RX_ALL, RX_FIL, RX_INV, RX_EFF, RX_MAX };
+enum { RX_ERR, RX_ALL, RX_FIL, RX_INV, RX_MAX };
/* per device receive filters linked at dev->ml_priv */
struct dev_rcv_lists {
struct hlist_head rx[RX_MAX];
struct hlist_head rx_sff[CAN_SFF_RCV_ARRAY_SZ];
+ struct hlist_head rx_eff[CAN_EFF_RCV_ARRAY_SZ];
int remove_on_zero_entries;
int entries;
};