Lines Matching full:cell

130 /* enqueue cell to prioq */
132 struct snd_seq_event_cell * cell) in snd_seq_prioq_cell_in() argument
138 if (snd_BUG_ON(!f || !cell)) in snd_seq_prioq_cell_in()
142 prior = (cell->event.flags & SNDRV_SEQ_PRIORITY_MASK); in snd_seq_prioq_cell_in()
150 if (compare_timestamp(&cell->event, &f->tail->event)) { in snd_seq_prioq_cell_in()
151 /* add new cell to tail of the fifo */ in snd_seq_prioq_cell_in()
152 f->tail->next = cell; in snd_seq_prioq_cell_in()
153 f->tail = cell; in snd_seq_prioq_cell_in()
154 cell->next = NULL; in snd_seq_prioq_cell_in()
159 /* traverse list of elements to find the place where the new cell is in snd_seq_prioq_cell_in()
162 prev = NULL; /* previous cell */ in snd_seq_prioq_cell_in()
168 int rel = compare_timestamp_rel(&cell->event, &cur->event); in snd_seq_prioq_cell_in()
170 /* new cell has earlier schedule time, */ in snd_seq_prioq_cell_in()
175 /* new cell has equal or larger schedule time, */ in snd_seq_prioq_cell_in()
176 /* move cursor to next cell */ in snd_seq_prioq_cell_in()
187 prev->next = cell; in snd_seq_prioq_cell_in()
188 cell->next = cur; in snd_seq_prioq_cell_in()
190 if (f->head == cur) /* this is the first cell, set head to it */ in snd_seq_prioq_cell_in()
191 f->head = cell; in snd_seq_prioq_cell_in()
193 f->tail = cell; in snd_seq_prioq_cell_in()
207 /* dequeue cell from prioq */
211 struct snd_seq_event_cell *cell; in snd_seq_prioq_cell_out() local
219 cell = f->head; in snd_seq_prioq_cell_out()
220 if (cell && current_time && !event_is_ready(&cell->event, current_time)) in snd_seq_prioq_cell_out()
221 cell = NULL; in snd_seq_prioq_cell_out()
222 if (cell) { in snd_seq_prioq_cell_out()
223 f->head = cell->next; in snd_seq_prioq_cell_out()
226 if (f->tail == cell) in snd_seq_prioq_cell_out()
229 cell->next = NULL; in snd_seq_prioq_cell_out()
233 return cell; in snd_seq_prioq_cell_out()
248 bool (*match)(struct snd_seq_event_cell *cell, in prioq_remove_cells() argument
252 register struct snd_seq_event_cell *cell, *next; in prioq_remove_cells() local
258 for (cell = f->head; cell; cell = next) { in prioq_remove_cells()
259 next = cell->next; in prioq_remove_cells()
260 if (!match(cell, arg)) { in prioq_remove_cells()
261 prev = cell; in prioq_remove_cells()
265 /* remove cell from prioq */ in prioq_remove_cells()
266 if (cell == f->head) in prioq_remove_cells()
267 f->head = cell->next; in prioq_remove_cells()
269 prev->next = cell->next; in prioq_remove_cells()
270 if (cell == f->tail) in prioq_remove_cells()
271 f->tail = cell->next; in prioq_remove_cells()
274 /* add cell to free list */ in prioq_remove_cells()
275 cell->next = NULL; in prioq_remove_cells()
277 freefirst = cell; in prioq_remove_cells()
279 freeprev->next = cell; in prioq_remove_cells()
280 freeprev = cell; in prioq_remove_cells()
297 static inline bool prioq_match(struct snd_seq_event_cell *cell, void *arg) in prioq_match() argument
301 if (cell->event.source.client == v->client || in prioq_match()
302 cell->event.dest.client == v->client) in prioq_match()
306 switch (cell->event.flags & SNDRV_SEQ_TIME_STAMP_MASK) { in prioq_match()
308 if (cell->event.time.tick) in prioq_match()
312 if (cell->event.time.time.tv_sec || in prioq_match()
313 cell->event.time.time.tv_nsec) in prioq_match()
333 static bool prioq_remove_match(struct snd_seq_event_cell *cell, void *arg) in prioq_remove_match() argument
336 struct snd_seq_event *ev = &cell->event; in prioq_remove_match()