Lines Matching refs:fibptr
89 struct fib *fibptr; in fib_setup() local
103 for (i = 0, fibptr = &dev->fibs[i]; i < AAC_NUM_FIB; i++, fibptr++) in fib_setup()
105 fibptr->dev = dev; in fib_setup()
106 fibptr->hw_fib = hw_fib_va; in fib_setup()
107 fibptr->data = (void *) fibptr->hw_fib->data; in fib_setup()
108 fibptr->next = fibptr+1; /* Forward chain the fibs */ in fib_setup()
109 init_MUTEX_LOCKED(&fibptr->event_wait); in fib_setup()
110 spin_lock_init(&fibptr->event_lock); in fib_setup()
113 fibptr->hw_fib_pa = hw_fib_pa; in fib_setup()
138 struct fib * fibptr; in fib_alloc() local
142 fibptr = dev->free_fib; in fib_alloc()
143 if(!fibptr) in fib_alloc()
145 dev->free_fib = fibptr->next; in fib_alloc()
150 fibptr->type = FSAFS_NTC_FIB_CONTEXT; in fib_alloc()
151 fibptr->size = sizeof(struct fib); in fib_alloc()
156 fibptr->hw_fib->header.XferState = cpu_to_le32(0); in fib_alloc()
157 fibptr->callback = NULL; in fib_alloc()
158 fibptr->callback_data = NULL; in fib_alloc()
160 return fibptr; in fib_alloc()
171 void fib_free(struct fib * fibptr) in fib_free() argument
175 spin_lock_irqsave(&fibptr->dev->fib_lock, flags); in fib_free()
177 if (fibptr->flags & FIB_CONTEXT_FLAG_TIMED_OUT) { in fib_free()
179 fibptr->next = fibptr->dev->timeout_fib; in fib_free()
180 fibptr->dev->timeout_fib = fibptr; in fib_free()
182 if (fibptr->hw_fib->header.XferState != 0) { in fib_free()
184 (void*)fibptr, fibptr->hw_fib->header.XferState); in fib_free()
186 fibptr->next = fibptr->dev->free_fib; in fib_free()
187 fibptr->dev->free_fib = fibptr; in fib_free()
189 spin_unlock_irqrestore(&fibptr->dev->fib_lock, flags); in fib_free()
199 void fib_init(struct fib *fibptr) in fib_init() argument
201 struct hw_fib *hw_fib = fibptr->hw_fib; in fib_init()
207 hw_fib->header.ReceiverFibAddress = cpu_to_le32(fibptr->hw_fib_pa); in fib_init()
219 void fib_dealloc(struct fib * fibptr) in fib_dealloc() argument
221 struct hw_fib *hw_fib = fibptr->hw_fib; in fib_dealloc()
308 …ev, u32 * index, u32 qid, struct hw_fib * hw_fib, int wait, struct fib * fibptr, unsigned long *no… in aac_queue_get() argument
349 entry->addr = fibptr->hw_fib_pa; in aac_queue_get()
414 int fib_send(u16 command, struct fib * fibptr, unsigned long size, int priority, int wait, int rep… in fib_send() argument
418 struct aac_dev * dev = fibptr->dev; in fib_send()
420 struct hw_fib * hw_fib = fibptr->hw_fib; in fib_send()
453 hw_fib->header.SenderFibAddress = cpu_to_le32(((u32)(fibptr - dev->fibs)) << 1); in fib_send()
454 hw_fib->header.SenderData = (u32)(fibptr - dev->fibs); in fib_send()
464 fibptr->hw_fib->header.Flags = 0; /* 0 the flags field - internal only*/ in fib_send()
486 spin_lock_irqsave(&fibptr->event_lock, flags); in fib_send()
487 if(aac_queue_get( dev, &index, qid, hw_fib, 1, fibptr, &nointr)<0) in fib_send()
493 dprintk((KERN_DEBUG " hw_fib va being sent=%p\n",fibptr->hw_fib)); in fib_send()
494 dprintk((KERN_DEBUG " hw_fib pa being sent=%lx\n",(ulong)fibptr->hw_fib_pa)); in fib_send()
495 dprintk((KERN_DEBUG " fib being sent=%p\n",fibptr)); in fib_send()
501 fibptr->callback = callback; in fib_send()
502 fibptr->callback_data = callback_data; in fib_send()
505 list_add_tail(&fibptr->queue, &q->pendingq); in fib_send()
508 fibptr->done = 0; in fib_send()
509 fibptr->flags = 0; in fib_send()
518 spin_unlock_irqrestore(&fibptr->event_lock, flags); in fib_send()
519 down(&fibptr->event_wait); in fib_send()
520 if(fibptr->done == 0) in fib_send()
523 if((fibptr->flags & FIB_CONTEXT_FLAG_TIMED_OUT)) in fib_send()
632 int fib_adapter_complete(struct fib * fibptr, unsigned short size) in fib_adapter_complete() argument
634 struct hw_fib * hw_fib = fibptr->hw_fib; in fib_adapter_complete()
635 struct aac_dev * dev = fibptr->dev; in fib_adapter_complete()
702 int fib_complete(struct fib * fibptr) in fib_complete() argument
704 struct hw_fib * hw_fib = fibptr->hw_fib; in fib_complete()
727 fib_dealloc(fibptr); in fib_complete()
735 fib_dealloc(fibptr); in fib_complete()
737 fib_dealloc(fibptr); in fib_complete()
788 static void aac_handle_aif(struct aac_dev * dev, struct fib * fibptr) in aac_handle_aif() argument
790 struct hw_fib * hw_fib = fibptr->hw_fib; in aac_handle_aif()