• Home
  • Raw
  • Download

Lines Matching refs:f

59 	struct snd_seq_prioq *f;  in snd_seq_prioq_new()  local
61 f = kzalloc(sizeof(*f), GFP_KERNEL); in snd_seq_prioq_new()
62 if (!f) in snd_seq_prioq_new()
65 spin_lock_init(&f->lock); in snd_seq_prioq_new()
66 f->head = NULL; in snd_seq_prioq_new()
67 f->tail = NULL; in snd_seq_prioq_new()
68 f->cells = 0; in snd_seq_prioq_new()
70 return f; in snd_seq_prioq_new()
76 struct snd_seq_prioq *f = *fifo; in snd_seq_prioq_delete() local
79 if (f == NULL) { in snd_seq_prioq_delete()
87 if (f->cells > 0) { in snd_seq_prioq_delete()
89 while (f->cells > 0) in snd_seq_prioq_delete()
90 snd_seq_cell_free(snd_seq_prioq_cell_out(f, NULL)); in snd_seq_prioq_delete()
93 kfree(f); in snd_seq_prioq_delete()
146 int snd_seq_prioq_cell_in(struct snd_seq_prioq * f, in snd_seq_prioq_cell_in() argument
154 if (snd_BUG_ON(!f || !cell)) in snd_seq_prioq_cell_in()
160 spin_lock_irqsave(&f->lock, flags); in snd_seq_prioq_cell_in()
165 if (f->tail && !prior) { in snd_seq_prioq_cell_in()
166 if (compare_timestamp(&cell->event, &f->tail->event)) { in snd_seq_prioq_cell_in()
168 f->tail->next = cell; in snd_seq_prioq_cell_in()
169 f->tail = cell; in snd_seq_prioq_cell_in()
171 f->cells++; in snd_seq_prioq_cell_in()
172 spin_unlock_irqrestore(&f->lock, flags); in snd_seq_prioq_cell_in()
180 cur = f->head; /* cursor */ in snd_seq_prioq_cell_in()
197 spin_unlock_irqrestore(&f->lock, flags); in snd_seq_prioq_cell_in()
208 if (f->head == cur) /* this is the first cell, set head to it */ in snd_seq_prioq_cell_in()
209 f->head = cell; in snd_seq_prioq_cell_in()
211 f->tail = cell; in snd_seq_prioq_cell_in()
212 f->cells++; in snd_seq_prioq_cell_in()
213 spin_unlock_irqrestore(&f->lock, flags); in snd_seq_prioq_cell_in()
227 struct snd_seq_event_cell *snd_seq_prioq_cell_out(struct snd_seq_prioq *f, in snd_seq_prioq_cell_out() argument
233 if (f == NULL) { in snd_seq_prioq_cell_out()
237 spin_lock_irqsave(&f->lock, flags); in snd_seq_prioq_cell_out()
239 cell = f->head; in snd_seq_prioq_cell_out()
243 f->head = cell->next; in snd_seq_prioq_cell_out()
246 if (f->tail == cell) in snd_seq_prioq_cell_out()
247 f->tail = NULL; in snd_seq_prioq_cell_out()
250 f->cells--; in snd_seq_prioq_cell_out()
253 spin_unlock_irqrestore(&f->lock, flags); in snd_seq_prioq_cell_out()
258 int snd_seq_prioq_avail(struct snd_seq_prioq * f) in snd_seq_prioq_avail() argument
260 if (f == NULL) { in snd_seq_prioq_avail()
264 return f->cells; in snd_seq_prioq_avail()
290 void snd_seq_prioq_leave(struct snd_seq_prioq * f, int client, int timestamp) in snd_seq_prioq_leave() argument
298 spin_lock_irqsave(&f->lock, flags); in snd_seq_prioq_leave()
299 cell = f->head; in snd_seq_prioq_leave()
304 if (cell == f->head) { in snd_seq_prioq_leave()
305 f->head = cell->next; in snd_seq_prioq_leave()
309 if (cell == f->tail) in snd_seq_prioq_leave()
310 f->tail = cell->next; in snd_seq_prioq_leave()
311 f->cells--; in snd_seq_prioq_leave()
333 spin_unlock_irqrestore(&f->lock, flags); in snd_seq_prioq_leave()
399 void snd_seq_prioq_remove_events(struct snd_seq_prioq * f, int client, in snd_seq_prioq_remove_events() argument
408 spin_lock_irqsave(&f->lock, flags); in snd_seq_prioq_remove_events()
409 cell = f->head; in snd_seq_prioq_remove_events()
417 if (cell == f->head) { in snd_seq_prioq_remove_events()
418 f->head = cell->next; in snd_seq_prioq_remove_events()
423 if (cell == f->tail) in snd_seq_prioq_remove_events()
424 f->tail = cell->next; in snd_seq_prioq_remove_events()
425 f->cells--; in snd_seq_prioq_remove_events()
441 spin_unlock_irqrestore(&f->lock, flags); in snd_seq_prioq_remove_events()