]> rtime.felk.cvut.cz Git - lincan.git/blobdiff - lincan/include/can_queue.h
Added support for local message processing and some cleanups.
[lincan.git] / lincan / include / can_queue.h
index 51f1d9b2724d1d306c4e6ec08639402bad71361a..648dca06c510e380464f6ff7aa06cfac087a5b38 100644 (file)
@@ -437,6 +437,21 @@ void canque_activate_edge(struct canque_ends_t *inends, struct canque_edge_t *qe
        spin_unlock_irqrestore(&inends->ends_lock, flags);
 }
 
+/**
+ * canque_filtid2internal - converts message ID and filter flags into internal format
+ * @qedge: pointer to the edge structure
+ * @inends: input side of the edge
+ *
+ * This function maps message ID and %MSG_RTR, %MSG_EXT and %MSG_LOCAL into one 32 bit number
+ */
+static inline
+unsigned int canque_filtid2internal(unsigned long id, int filtflags)
+{
+       filtflags &= MSG_RTR|MSG_EXT|MSG_LOCAL;
+       filtflags += filtflags&MSG_RTR;
+       return (id&MSG_ID_MASK) | (filtflags<<28);
+}
+
 int canque_get_inslot(struct canque_ends_t *qends,
        struct canque_edge_t **qedgep, struct canque_slot_t **slotp, int cmd);
        
@@ -462,8 +477,8 @@ int canque_again_outslot(struct canque_ends_t *qends,
        struct canque_edge_t *qedge, struct canque_slot_t *slot);
 
 int canque_set_filt(struct canque_edge_t *qedge,
-       unsigned long filtid, unsigned long filtmask);
-
+       unsigned long filtid, unsigned long filtmask, int flags);
+       
 int canque_flush(struct canque_edge_t *qedge);
 
 struct canque_edge_t *canque_new_edge_kern(int slotsnr);