#include <rtl_malloc.h>
-/*
- * Modifies Tx message processing
+/*
+ * Modifies Tx message processing
* 0 .. local message processing disabled
* 1 .. local messages disabled by default but can be enabled by canque_set_filt
* 2 .. local messages enabled by default, can be disabled by canque_set_filt
unsigned pending_inops;
unsigned pending_outops;
int i;
-
+
can_spin_lock_irqsave (&canque_pending_edges_lock, flags);
while(!list_empty(&canque_pending_edges_list)){
if(pending_inops&1)
canque_notify_inends(qedge,i);
}
-
+
canque_edge_decref(qedge);
can_spin_lock_irqsave (&canque_pending_edges_lock, flags);
}
/**
- * canqueue_rtl2lin_check_and_pend - postpones edge notification if called from RT-Linux
+ * canqueue_rtl2lin_check_and_pend - postpones edge notification if called from RT-Linux
* @qends: notification target ends
* @qedge: edge delivering notification
* @what: notification type
if(rtl_rt_system_is_idle()) return 0;
can_spin_lock_irqsave (&canque_pending_edges_lock, flags);
-
+
if(what>CANQUE_PENDOPS_LIMIT) what=CANQUE_PENDOPS_LIMIT;
if(qends == qedge->inends) {
}
can_spin_unlock_irqrestore (&canque_pending_edges_lock, flags);
-
+
return 1;
}
int ret;
unsigned old_age;
rtl_sigset_t sigset;
-
+
old_age=atomic_read(&qends->endinfo.rtlinfo.rtl_writeq_age);
while((ret=canque_get_inslot4id(qends,qedgep,slotp,cmd,id,prio))==-1){
rtl_sigemptyset(&sigset);
return -1;
old_age=atomic_read(&qends->endinfo.rtlinfo.rtl_writeq_age);
}
-
+
return ret;
}
int ret;
unsigned old_age;
rtl_sigset_t sigset;
-
+
old_age=atomic_read(&qends->endinfo.rtlinfo.rtl_readq_age);
while((ret=canque_test_outslot(qends,qedgep,slotp))==-1){
rtl_sigemptyset(&sigset);
int ret;
unsigned old_age;
rtl_sigset_t sigset;
-
+
old_age=atomic_read(&qends->endinfo.rtlinfo.rtl_emptyq_age);
while(!(ret=canque_fifo_test_fl(&qedge->fifo,EMPTY)?1:0)){
rtl_sigemptyset(&sigset);
return -1;
old_age=atomic_read(&qends->endinfo.rtlinfo.rtl_emptyq_age);
}
-
+
return ret;
}
/**
* canqueue_notify_rtl - notification callback handler for Linux userspace clients
* @qends: pointer to the callback side ends structure
- * @qedge: edge which invoked notification
+ * @qedge: edge which invoked notification
* @what: notification type
*/
void canqueue_notify_rtl(struct canque_ends_t *qends, struct canque_edge_t *qedge, int what)
{
rtl_irqstate_t flags;
-
+
switch(what){
case CANQUEUE_NOTIFY_EMPTY:
rtl_spin_lock_irqsave(&qends->endinfo.rtlinfo.rtl_lock, flags);
rtl_wait_init(&(qends->endinfo.rtlinfo.rtl_readq));
rtl_wait_init(&(qends->endinfo.rtlinfo.rtl_writeq));
rtl_wait_init(&(qends->endinfo.rtlinfo.rtl_emptyq));
-
+
qends->notify=canqueue_notify_rtl;
qends->endinfo.rtlinfo.pend_flags=0;
return 0;
/*Wait for sending of all pending messages in the output FIFOs*/
/*if(sync)
canqueue_ends_sync_all_rtl(qends);*/
-
+
/* Finish or kill all outgoing edges listed in inends */
delayed=canqueue_ends_kill_inlist(qends, 1);
/* Kill all incoming edges listed in outends */