atomic_t edge_num_cnt;
//#define CAN_DEBUG
+#undef CAN_DEBUG
#ifdef CAN_DEBUG
- #define DEBUGQUE(fmt,args...) printk(KERN_ERR "can_queue (debug): " fmt,\
+ #define DEBUGQUE(fmt,args...) can_printk(KERN_ERR "can_queue (debug): " fmt,\
##args)
#else
/**
- * canque_fifo_init_slots - initialize one CAN FIFO
+ * canque_fifo_init_slots - initializes slot chain of one CAN FIFO
* @fifo: pointer to the FIFO structure
- * @slotsnr: number of requested slots
*
* Return Value: The negative value indicates, that there is no memory
* to allocate space for the requested number of the slots.
*/
-int canque_fifo_init_slots(struct canque_fifo_t *fifo, int slotsnr)
+int canque_fifo_init_slots(struct canque_fifo_t *fifo)
{
- int size;
struct canque_slot_t *slot;
- if(!slotsnr) slotsnr=MAX_BUF_LENGTH;
- size=sizeof(struct canque_slot_t)*slotsnr;
- fifo->entry=kmalloc(size,GFP_KERNEL);
- if(!fifo->entry) return -1;
+ int slotsnr=fifo->slotsnr;
+ if(!fifo->entry || !slotsnr) return -1;
slot=fifo->entry;
fifo->flist=slot;
while(--slotsnr){
return 1;
}
-/**
- * canque_fifo_done - frees slots allocated for CAN FIFO
- * @fifo: pointer to the FIFO structure
- */
-int canque_fifo_done(struct canque_fifo_t *fifo)
-{
- if(fifo->entry)
- kfree(fifo->entry);
- fifo->entry=NULL;
- return 1;
-}
-
/* atomic_dec_and_test(&qedge->edge_used);
void atomic_inc(&qedge->edge_used);
list_add_tail(struct list_head *new, struct list_head *head)