]> rtime.felk.cvut.cz Git - lincan.git/blobdiff - lincan/src/can_quekern.c
LinCAN sources go through big white-space cleanup.
[lincan.git] / lincan / src / can_quekern.c
index 69417872ac3c73bccd31c5a149f1296e92ff9eff..a102ac2a314005923f3ff69af35b40b445ddbbce 100644 (file)
@@ -51,8 +51,8 @@ extern atomic_t edge_num_cnt;
        ##args)
 
 
-/* 
- * 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
@@ -105,7 +105,7 @@ void canque_dead_func(unsigned long data)
                canque_fifo_done_kern(&qedge->fifo);
                kfree(qedge);
        }
-       
+
        can_spin_lock_irqsave(&canque_dead_func_lock, flags);
        entry=canque_dead_ends.next;
        can_spin_unlock_irqrestore(&canque_dead_func_lock,flags);
@@ -150,7 +150,7 @@ static inline void canque_dead_tasklet_schedule(void)
 void canque_edge_do_dead(struct canque_edge_t *edge)
 {
        can_spin_irqflags_t flags;
-       
+
        canque_notify_bothends(edge,CANQUEUE_NOTIFY_NOUSR);
     #ifdef CAN_WITH_RTL
        /* The problem of the above call is, that in RT-Linux to Linux notify
@@ -171,7 +171,7 @@ void canque_edge_do_dead(struct canque_edge_t *edge)
                can_spin_unlock_irqrestore(&edge->inends->ends_lock, flags);
        }
     #endif /*CAN_WITH_RTL*/
-       
+
        if(canqueue_disconnect_edge(edge)<0){
                ERRMSGQUE("canque_edge_do_dead: canqueue_disconnect_edge failed !!!\n");
                return;
@@ -197,14 +197,14 @@ void canque_edge_do_dead(struct canque_edge_t *edge)
 /**
  * canqueue_notify_kern - 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
  *
  * The notification event is handled directly by call of this function except case,
  * when called from RT-Linux context in mixed mode Linux/RT-Linux compilation.
  * It is not possible to directly call Linux kernel synchronization primitives
  * in such case. The notification request is postponed and signaled by @pending_inops flags
- * by call canqueue_rtl2lin_check_and_pend() function. 
+ * by call canqueue_rtl2lin_check_and_pend() function.
  * The edge reference count is increased until until all pending notifications are processed.
  */
 void canqueue_notify_kern(struct canque_ends_t *qends, struct canque_edge_t *qedge, int what)
@@ -217,7 +217,7 @@ void canqueue_notify_kern(struct canque_ends_t *qends, struct canque_edge_t *qed
                DEBUGQUE("canqueue_notify_kern postponed\n");
                return;
        }
-       
+
        switch(what){
                case CANQUEUE_NOTIFY_EMPTY:
                        wake_up(&qends->endinfo.fileinfo.emptyq);
@@ -228,14 +228,14 @@ void canqueue_notify_kern(struct canque_ends_t *qends, struct canque_edge_t *qed
                        wake_up(&qends->endinfo.fileinfo.writeq);
                    #ifdef CAN_ENABLE_KERN_FASYNC
                        /* Asynchronous I/O processing */
-                       kill_fasync(&qends->endinfo.fileinfo.fasync, SIGIO, POLL_OUT); 
+                       kill_fasync(&qends->endinfo.fileinfo.fasync, SIGIO, POLL_OUT);
                    #endif /*CAN_ENABLE_KERN_FASYNC*/
                        break;
                case CANQUEUE_NOTIFY_PROC:
                        wake_up(&qends->endinfo.fileinfo.readq);
                    #ifdef CAN_ENABLE_KERN_FASYNC
                        /* Asynchronous I/O processing */
-                       kill_fasync(&qends->endinfo.fileinfo.fasync, SIGIO, POLL_IN); 
+                       kill_fasync(&qends->endinfo.fileinfo.fasync, SIGIO, POLL_IN);
                    #endif /*CAN_ENABLE_KERN_FASYNC*/
                        break;
                case CANQUEUE_NOTIFY_NOUSR:
@@ -267,7 +267,7 @@ int canqueue_ends_init_kern(struct canque_ends_t *qends)
     #ifdef CAN_ENABLE_KERN_FASYNC
        qends->endinfo.fileinfo.fasync=NULL;
     #endif /*CAN_ENABLE_KERN_FASYNC*/
-       
+
        qends->notify=canqueue_notify_kern;
        DEBUGQUE("canqueue_ends_init_kern\n");
        return 0;
@@ -293,7 +293,7 @@ int canque_get_inslot4id_wait_kern(struct canque_ends_t *qends,
 {
        int ret=-1;
        DEBUGQUE("canque_get_inslot4id_wait_kern for cmd %d, id %ld, prio %d\n",cmd,id,prio);
-       wait_event_interruptible((qends->endinfo.fileinfo.writeq), 
+       wait_event_interruptible((qends->endinfo.fileinfo.writeq),
                (ret=canque_get_inslot4id(qends,qedgep,slotp,cmd,id,prio))!=-1);
        return ret;
 }
@@ -315,7 +315,7 @@ int canque_get_outslot_wait_kern(struct canque_ends_t *qends,
 {
        int ret=-1;
        DEBUGQUE("canque_get_outslot_wait_kern\n");
-       wait_event_interruptible((qends->endinfo.fileinfo.readq), 
+       wait_event_interruptible((qends->endinfo.fileinfo.readq),
                (ret=canque_test_outslot(qends,qedgep,slotp))!=-1);
        return ret;
 }
@@ -333,7 +333,7 @@ int canque_sync_wait_kern(struct canque_ends_t *qends, struct canque_edge_t *qed
 {
        int ret=-1;
        DEBUGQUE("canque_sync_wait_kern\n");
-       wait_event_interruptible((qends->endinfo.fileinfo.emptyq), 
+       wait_event_interruptible((qends->endinfo.fileinfo.emptyq),
                (ret=canque_fifo_test_fl(&qedge->fifo,EMPTY)?1:0));
        return ret;
 }
@@ -422,12 +422,12 @@ int canqueue_disconnect_edge_kern(struct canque_ends_t *qends, struct canque_edg
        DEBUGQUE("canqueue_disconnect_edge_kern %d called\n",qedge->edge_num);
        if(!canque_fifo_test_and_set_fl(&qedge->fifo,DEAD)){
                canque_notify_bothends(qedge, CANQUEUE_NOTIFY_DEAD);
-               
+
                if(atomic_read(&qedge->edge_used)>0)
                        atomic_dec(&qedge->edge_used);
 
                DEBUGQUE("canqueue_disconnect_edge_kern %d waiting\n",qedge->edge_num);
-               wait_event((qends->endinfo.fileinfo.emptyq), 
+               wait_event((qends->endinfo.fileinfo.emptyq),
                        (canqueue_disconnect_edge(qedge)>=0));
 
                /*set_current_state(TASK_UNINTERRUPTIBLE);*/
@@ -476,7 +476,7 @@ int canqueue_disconnect_list_kern(struct canque_ends_t *qends, struct list_head
 int canqueue_ends_sync_all_kern(struct canque_ends_t *qends)
 {
        struct canque_edge_t *qedge;
-       
+
        canque_for_each_inedge(qends, qedge){
                DEBUGQUE("canque_sync_wait_kern called for edge %d\n",qedge->edge_num);
                canque_sync_wait_kern(qends, qedge);
@@ -516,7 +516,7 @@ int canqueue_ends_dispose_kern(struct canque_ends_t *qends, int sync)
        /*Wait for sending of all pending messages in the output FIFOs*/
        if(sync)
                canqueue_ends_sync_all_kern(qends);
-       
+
        /* Finish or kill all outgoing edges listed in inends */
        delayed=canqueue_ends_kill_inlist(qends, 1);
        /* Kill all incoming edges listed in outends */