Lines Matching refs:mdl
174 struct cx18_mdl *mdl; in cx18_get_mdl() local
187 while ((mdl = cx18_dequeue(s_vbi, in cx18_get_mdl()
190 cx18_process_vbi_data(cx, mdl, in cx18_get_mdl()
192 cx18_stream_put_mdl_fw(s_vbi, mdl); in cx18_get_mdl()
195 mdl = &cx->vbi.sliced_mpeg_mdl; in cx18_get_mdl()
196 if (mdl->readpos != mdl->bytesused) in cx18_get_mdl()
197 return mdl; in cx18_get_mdl()
201 mdl = cx18_dequeue(s, &s->q_full); in cx18_get_mdl()
202 if (mdl) { in cx18_get_mdl()
204 &mdl->m_flags)) in cx18_get_mdl()
205 return mdl; in cx18_get_mdl()
208 cx18_mdl_swap(mdl); in cx18_get_mdl()
211 cx18_process_vbi_data(cx, mdl, s->type); in cx18_get_mdl()
213 return mdl; in cx18_get_mdl()
246 struct cx18_mdl *mdl = &cx->vbi.sliced_mpeg_mdl; in cx18_setup_sliced_vbi_mdl() local
254 mdl->curr_buf = NULL; in cx18_setup_sliced_vbi_mdl()
255 mdl->bytesused = cx->vbi.sliced_mpeg_size[idx]; in cx18_setup_sliced_vbi_mdl()
256 mdl->readpos = 0; in cx18_setup_sliced_vbi_mdl()
364 struct cx18_mdl *mdl, char __user *ubuf, size_t ucount) in cx18_copy_mdl_to_user() argument
370 if (mdl->curr_buf == NULL) in cx18_copy_mdl_to_user()
371 mdl->curr_buf = list_first_entry(&mdl->buf_list, in cx18_copy_mdl_to_user()
374 if (list_entry_is_past_end(mdl->curr_buf, &mdl->buf_list, list)) { in cx18_copy_mdl_to_user()
380 mdl->readpos = mdl->bytesused; in cx18_copy_mdl_to_user()
384 list_for_each_entry_from(mdl->curr_buf, &mdl->buf_list, list) { in cx18_copy_mdl_to_user()
386 if (mdl->curr_buf->readpos >= mdl->curr_buf->bytesused) in cx18_copy_mdl_to_user()
389 rc = cx18_copy_buf_to_user(s, mdl->curr_buf, ubuf + tot_written, in cx18_copy_mdl_to_user()
393 mdl->readpos += rc; in cx18_copy_mdl_to_user()
398 mdl->curr_buf->readpos < mdl->curr_buf->bytesused || in cx18_copy_mdl_to_user()
399 mdl->readpos >= mdl->bytesused) /* MDL buffers drained */ in cx18_copy_mdl_to_user()
426 struct cx18_mdl *mdl; in cx18_read() local
429 mdl = cx18_get_mdl(s, non_block, &rc); in cx18_read()
431 if (mdl == NULL) { in cx18_read()
445 rc = cx18_copy_mdl_to_user(s, mdl, ubuf + tot_written, in cx18_read()
448 if (mdl != &cx->vbi.sliced_mpeg_mdl) { in cx18_read()
449 if (mdl->readpos == mdl->bytesused) in cx18_read()
450 cx18_stream_put_mdl_fw(s, mdl); in cx18_read()
452 cx18_push(s, mdl, &s->q_full); in cx18_read()
453 } else if (mdl->readpos == mdl->bytesused) { in cx18_read()
458 cx->vbi_data_inserted += mdl->bytesused; in cx18_read()