Lines Matching refs:mbo
275 static int hdm_add_padding(struct most_dev *mdev, int channel, struct mbo *mbo) in hdm_add_padding() argument
283 num_frames = mbo->buffer_length / frame_size; in hdm_add_padding()
292 memmove(mbo->virt_address + j * USB_MTU, in hdm_add_padding()
293 mbo->virt_address + j * frame_size, in hdm_add_padding()
295 mbo->buffer_length = num_frames * USB_MTU; in hdm_add_padding()
309 struct mbo *mbo) in hdm_remove_padding() argument
317 num_frames = mbo->processed_length / USB_MTU; in hdm_remove_padding()
320 memmove(mbo->virt_address + frame_size * j, in hdm_remove_padding()
321 mbo->virt_address + USB_MTU * j, in hdm_remove_padding()
324 mbo->processed_length = frame_size * num_frames; in hdm_remove_padding()
341 struct mbo *mbo = urb->context; in hdm_write_completion() local
342 struct most_dev *mdev = to_mdev(mbo->ifp); in hdm_write_completion()
343 unsigned int channel = mbo->hdm_channel_id; in hdm_write_completion()
349 mbo->processed_length = 0; in hdm_write_completion()
350 mbo->status = MBO_E_INVAL; in hdm_write_completion()
355 mbo->processed_length = urb->actual_length; in hdm_write_completion()
356 mbo->status = MBO_SUCCESS; in hdm_write_completion()
368 mbo->status = MBO_E_CLOSE; in hdm_write_completion()
375 if (likely(mbo->complete)) in hdm_write_completion()
376 mbo->complete(mbo); in hdm_write_completion()
393 struct mbo *mbo = urb->context; in hdm_read_completion() local
394 struct most_dev *mdev = to_mdev(mbo->ifp); in hdm_read_completion()
395 unsigned int channel = mbo->hdm_channel_id; in hdm_read_completion()
402 mbo->processed_length = 0; in hdm_read_completion()
403 mbo->status = MBO_E_INVAL; in hdm_read_completion()
408 mbo->processed_length = urb->actual_length; in hdm_read_completion()
409 mbo->status = MBO_SUCCESS; in hdm_read_completion()
411 hdm_remove_padding(mdev, channel, mbo)) { in hdm_read_completion()
412 mbo->processed_length = 0; in hdm_read_completion()
413 mbo->status = MBO_E_INVAL; in hdm_read_completion()
425 mbo->status = MBO_E_CLOSE; in hdm_read_completion()
436 if (likely(mbo->complete)) in hdm_read_completion()
437 mbo->complete(mbo); in hdm_read_completion()
457 struct mbo *mbo) in hdm_enqueue() argument
466 if (!mbo) in hdm_enqueue()
484 hdm_add_padding(mdev, channel, mbo)) { in hdm_enqueue()
489 urb->transfer_dma = mbo->bus_address; in hdm_enqueue()
490 virt_address = mbo->virt_address; in hdm_enqueue()
491 length = mbo->buffer_length; in hdm_enqueue()
500 mbo); in hdm_enqueue()
511 mbo); in hdm_enqueue()
534 static void *hdm_dma_alloc(struct mbo *mbo, u32 size) in hdm_dma_alloc() argument
536 struct most_dev *mdev = to_mdev(mbo->ifp); in hdm_dma_alloc()
539 &mbo->bus_address); in hdm_dma_alloc()
542 static void hdm_dma_free(struct mbo *mbo, u32 size) in hdm_dma_free() argument
544 struct most_dev *mdev = to_mdev(mbo->ifp); in hdm_dma_free()
546 usb_free_coherent(mdev->usb_device, size, mbo->virt_address, in hdm_dma_free()
547 mbo->bus_address); in hdm_dma_free()