Lines Matching full:cell

130 /* enqueue cell to prioq */
132 struct snd_seq_event_cell * cell) in snd_seq_prioq_cell_in() argument
139 if (snd_BUG_ON(!f || !cell)) in snd_seq_prioq_cell_in()
143 prior = (cell->event.flags & SNDRV_SEQ_PRIORITY_MASK); in snd_seq_prioq_cell_in()
151 if (compare_timestamp(&cell->event, &f->tail->event)) { in snd_seq_prioq_cell_in()
152 /* add new cell to tail of the fifo */ in snd_seq_prioq_cell_in()
153 f->tail->next = cell; in snd_seq_prioq_cell_in()
154 f->tail = cell; in snd_seq_prioq_cell_in()
155 cell->next = NULL; in snd_seq_prioq_cell_in()
161 /* traverse list of elements to find the place where the new cell is in snd_seq_prioq_cell_in()
164 prev = NULL; /* previous cell */ in snd_seq_prioq_cell_in()
170 int rel = compare_timestamp_rel(&cell->event, &cur->event); in snd_seq_prioq_cell_in()
172 /* new cell has earlier schedule time, */ in snd_seq_prioq_cell_in()
177 /* new cell has equal or larger schedule time, */ in snd_seq_prioq_cell_in()
178 /* move cursor to next cell */ in snd_seq_prioq_cell_in()
190 prev->next = cell; in snd_seq_prioq_cell_in()
191 cell->next = cur; in snd_seq_prioq_cell_in()
193 if (f->head == cur) /* this is the first cell, set head to it */ in snd_seq_prioq_cell_in()
194 f->head = cell; in snd_seq_prioq_cell_in()
196 f->tail = cell; in snd_seq_prioq_cell_in()
211 /* dequeue cell from prioq */
215 struct snd_seq_event_cell *cell; in snd_seq_prioq_cell_out() local
224 cell = f->head; in snd_seq_prioq_cell_out()
225 if (cell && current_time && !event_is_ready(&cell->event, current_time)) in snd_seq_prioq_cell_out()
226 cell = NULL; in snd_seq_prioq_cell_out()
227 if (cell) { in snd_seq_prioq_cell_out()
228 f->head = cell->next; in snd_seq_prioq_cell_out()
231 if (f->tail == cell) in snd_seq_prioq_cell_out()
234 cell->next = NULL; in snd_seq_prioq_cell_out()
239 return cell; in snd_seq_prioq_cell_out()
252 static inline int prioq_match(struct snd_seq_event_cell *cell, in prioq_match() argument
255 if (cell->event.source.client == client || in prioq_match()
256 cell->event.dest.client == client) in prioq_match()
260 switch (cell->event.flags & SNDRV_SEQ_TIME_STAMP_MASK) { in prioq_match()
262 if (cell->event.time.tick) in prioq_match()
266 if (cell->event.time.time.tv_sec || in prioq_match()
267 cell->event.time.time.tv_nsec) in prioq_match()
277 register struct snd_seq_event_cell *cell, *next; in snd_seq_prioq_leave() local
284 cell = f->head; in snd_seq_prioq_leave()
285 while (cell) { in snd_seq_prioq_leave()
286 next = cell->next; in snd_seq_prioq_leave()
287 if (prioq_match(cell, client, timestamp)) { in snd_seq_prioq_leave()
288 /* remove cell from prioq */ in snd_seq_prioq_leave()
289 if (cell == f->head) { in snd_seq_prioq_leave()
290 f->head = cell->next; in snd_seq_prioq_leave()
292 prev->next = cell->next; in snd_seq_prioq_leave()
294 if (cell == f->tail) in snd_seq_prioq_leave()
295 f->tail = cell->next; in snd_seq_prioq_leave()
297 /* add cell to free list */ in snd_seq_prioq_leave()
298 cell->next = NULL; in snd_seq_prioq_leave()
300 freefirst = cell; in snd_seq_prioq_leave()
302 freeprev->next = cell; in snd_seq_prioq_leave()
304 freeprev = cell; in snd_seq_prioq_leave()
309 cell->event.type, in snd_seq_prioq_leave()
310 cell->event.source.client, in snd_seq_prioq_leave()
311 cell->event.dest.client, in snd_seq_prioq_leave()
314 prev = cell; in snd_seq_prioq_leave()
316 cell = next; in snd_seq_prioq_leave()
387 struct snd_seq_event_cell *cell, *next; in snd_seq_prioq_remove_events() local
394 cell = f->head; in snd_seq_prioq_remove_events()
396 while (cell) { in snd_seq_prioq_remove_events()
397 next = cell->next; in snd_seq_prioq_remove_events()
398 if (cell->event.source.client == client && in snd_seq_prioq_remove_events()
399 prioq_remove_match(info, &cell->event)) { in snd_seq_prioq_remove_events()
401 /* remove cell from prioq */ in snd_seq_prioq_remove_events()
402 if (cell == f->head) { in snd_seq_prioq_remove_events()
403 f->head = cell->next; in snd_seq_prioq_remove_events()
405 prev->next = cell->next; in snd_seq_prioq_remove_events()
408 if (cell == f->tail) in snd_seq_prioq_remove_events()
409 f->tail = cell->next; in snd_seq_prioq_remove_events()
412 /* add cell to free list */ in snd_seq_prioq_remove_events()
413 cell->next = NULL; in snd_seq_prioq_remove_events()
415 freefirst = cell; in snd_seq_prioq_remove_events()
417 freeprev->next = cell; in snd_seq_prioq_remove_events()
420 freeprev = cell; in snd_seq_prioq_remove_events()
422 prev = cell; in snd_seq_prioq_remove_events()
424 cell = next; in snd_seq_prioq_remove_events()