Merge tag 'block-5.11-2021-01-10' of git://git.kernel.dk/linux-block
[linux/fpc-iii.git] / drivers / media / common / videobuf2 / videobuf2-dma-contig.c
bloba7f61ba854405f63fa0a4842a5589d9dab076a68
1 /*
2 * videobuf2-dma-contig.c - DMA contig memory allocator for videobuf2
4 * Copyright (C) 2010 Samsung Electronics
6 * Author: Pawel Osciak <pawel@osciak.com>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation.
13 #include <linux/dma-buf.h>
14 #include <linux/module.h>
15 #include <linux/refcount.h>
16 #include <linux/scatterlist.h>
17 #include <linux/sched.h>
18 #include <linux/slab.h>
19 #include <linux/dma-mapping.h>
21 #include <media/videobuf2-v4l2.h>
22 #include <media/videobuf2-dma-contig.h>
23 #include <media/videobuf2-memops.h>
25 struct vb2_dc_buf {
26 struct device *dev;
27 void *vaddr;
28 unsigned long size;
29 void *cookie;
30 dma_addr_t dma_addr;
31 unsigned long attrs;
32 enum dma_data_direction dma_dir;
33 struct sg_table *dma_sgt;
34 struct frame_vector *vec;
36 /* MMAP related */
37 struct vb2_vmarea_handler handler;
38 refcount_t refcount;
39 struct sg_table *sgt_base;
41 /* DMABUF related */
42 struct dma_buf_attachment *db_attach;
45 /*********************************************/
46 /* scatterlist table functions */
47 /*********************************************/
49 static unsigned long vb2_dc_get_contiguous_size(struct sg_table *sgt)
51 struct scatterlist *s;
52 dma_addr_t expected = sg_dma_address(sgt->sgl);
53 unsigned int i;
54 unsigned long size = 0;
56 for_each_sgtable_dma_sg(sgt, s, i) {
57 if (sg_dma_address(s) != expected)
58 break;
59 expected += sg_dma_len(s);
60 size += sg_dma_len(s);
62 return size;
65 /*********************************************/
66 /* callbacks for all buffers */
67 /*********************************************/
69 static void *vb2_dc_cookie(void *buf_priv)
71 struct vb2_dc_buf *buf = buf_priv;
73 return &buf->dma_addr;
76 static void *vb2_dc_vaddr(void *buf_priv)
78 struct vb2_dc_buf *buf = buf_priv;
79 struct dma_buf_map map;
80 int ret;
82 if (!buf->vaddr && buf->db_attach) {
83 ret = dma_buf_vmap(buf->db_attach->dmabuf, &map);
84 buf->vaddr = ret ? NULL : map.vaddr;
87 return buf->vaddr;
90 static unsigned int vb2_dc_num_users(void *buf_priv)
92 struct vb2_dc_buf *buf = buf_priv;
94 return refcount_read(&buf->refcount);
97 static void vb2_dc_prepare(void *buf_priv)
99 struct vb2_dc_buf *buf = buf_priv;
100 struct sg_table *sgt = buf->dma_sgt;
102 if (!sgt)
103 return;
105 dma_sync_sgtable_for_device(buf->dev, sgt, buf->dma_dir);
108 static void vb2_dc_finish(void *buf_priv)
110 struct vb2_dc_buf *buf = buf_priv;
111 struct sg_table *sgt = buf->dma_sgt;
113 if (!sgt)
114 return;
116 dma_sync_sgtable_for_cpu(buf->dev, sgt, buf->dma_dir);
119 /*********************************************/
120 /* callbacks for MMAP buffers */
121 /*********************************************/
123 static void vb2_dc_put(void *buf_priv)
125 struct vb2_dc_buf *buf = buf_priv;
127 if (!refcount_dec_and_test(&buf->refcount))
128 return;
130 if (buf->sgt_base) {
131 sg_free_table(buf->sgt_base);
132 kfree(buf->sgt_base);
134 dma_free_attrs(buf->dev, buf->size, buf->cookie, buf->dma_addr,
135 buf->attrs);
136 put_device(buf->dev);
137 kfree(buf);
140 static void *vb2_dc_alloc(struct device *dev, unsigned long attrs,
141 unsigned long size, enum dma_data_direction dma_dir,
142 gfp_t gfp_flags)
144 struct vb2_dc_buf *buf;
146 if (WARN_ON(!dev))
147 return ERR_PTR(-EINVAL);
149 buf = kzalloc(sizeof *buf, GFP_KERNEL);
150 if (!buf)
151 return ERR_PTR(-ENOMEM);
153 buf->attrs = attrs;
154 buf->cookie = dma_alloc_attrs(dev, size, &buf->dma_addr,
155 GFP_KERNEL | gfp_flags, buf->attrs);
156 if (!buf->cookie) {
157 dev_err(dev, "dma_alloc_coherent of size %ld failed\n", size);
158 kfree(buf);
159 return ERR_PTR(-ENOMEM);
162 if ((buf->attrs & DMA_ATTR_NO_KERNEL_MAPPING) == 0)
163 buf->vaddr = buf->cookie;
165 /* Prevent the device from being released while the buffer is used */
166 buf->dev = get_device(dev);
167 buf->size = size;
168 buf->dma_dir = dma_dir;
170 buf->handler.refcount = &buf->refcount;
171 buf->handler.put = vb2_dc_put;
172 buf->handler.arg = buf;
174 refcount_set(&buf->refcount, 1);
176 return buf;
179 static int vb2_dc_mmap(void *buf_priv, struct vm_area_struct *vma)
181 struct vb2_dc_buf *buf = buf_priv;
182 int ret;
184 if (!buf) {
185 printk(KERN_ERR "No buffer to map\n");
186 return -EINVAL;
189 ret = dma_mmap_attrs(buf->dev, vma, buf->cookie,
190 buf->dma_addr, buf->size, buf->attrs);
192 if (ret) {
193 pr_err("Remapping memory failed, error: %d\n", ret);
194 return ret;
197 vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP;
198 vma->vm_private_data = &buf->handler;
199 vma->vm_ops = &vb2_common_vm_ops;
201 vma->vm_ops->open(vma);
203 pr_debug("%s: mapped dma addr 0x%08lx at 0x%08lx, size %ld\n",
204 __func__, (unsigned long)buf->dma_addr, vma->vm_start,
205 buf->size);
207 return 0;
210 /*********************************************/
211 /* DMABUF ops for exporters */
212 /*********************************************/
214 struct vb2_dc_attachment {
215 struct sg_table sgt;
216 enum dma_data_direction dma_dir;
219 static int vb2_dc_dmabuf_ops_attach(struct dma_buf *dbuf,
220 struct dma_buf_attachment *dbuf_attach)
222 struct vb2_dc_attachment *attach;
223 unsigned int i;
224 struct scatterlist *rd, *wr;
225 struct sg_table *sgt;
226 struct vb2_dc_buf *buf = dbuf->priv;
227 int ret;
229 attach = kzalloc(sizeof(*attach), GFP_KERNEL);
230 if (!attach)
231 return -ENOMEM;
233 sgt = &attach->sgt;
234 /* Copy the buf->base_sgt scatter list to the attachment, as we can't
235 * map the same scatter list to multiple attachments at the same time.
237 ret = sg_alloc_table(sgt, buf->sgt_base->orig_nents, GFP_KERNEL);
238 if (ret) {
239 kfree(attach);
240 return -ENOMEM;
243 rd = buf->sgt_base->sgl;
244 wr = sgt->sgl;
245 for (i = 0; i < sgt->orig_nents; ++i) {
246 sg_set_page(wr, sg_page(rd), rd->length, rd->offset);
247 rd = sg_next(rd);
248 wr = sg_next(wr);
251 attach->dma_dir = DMA_NONE;
252 dbuf_attach->priv = attach;
254 return 0;
257 static void vb2_dc_dmabuf_ops_detach(struct dma_buf *dbuf,
258 struct dma_buf_attachment *db_attach)
260 struct vb2_dc_attachment *attach = db_attach->priv;
261 struct sg_table *sgt;
263 if (!attach)
264 return;
266 sgt = &attach->sgt;
268 /* release the scatterlist cache */
269 if (attach->dma_dir != DMA_NONE)
271 * Cache sync can be skipped here, as the vb2_dc memory is
272 * allocated from device coherent memory, which means the
273 * memory locations do not require any explicit cache
274 * maintenance prior or after being used by the device.
276 dma_unmap_sgtable(db_attach->dev, sgt, attach->dma_dir,
277 DMA_ATTR_SKIP_CPU_SYNC);
278 sg_free_table(sgt);
279 kfree(attach);
280 db_attach->priv = NULL;
283 static struct sg_table *vb2_dc_dmabuf_ops_map(
284 struct dma_buf_attachment *db_attach, enum dma_data_direction dma_dir)
286 struct vb2_dc_attachment *attach = db_attach->priv;
287 /* stealing dmabuf mutex to serialize map/unmap operations */
288 struct mutex *lock = &db_attach->dmabuf->lock;
289 struct sg_table *sgt;
291 mutex_lock(lock);
293 sgt = &attach->sgt;
294 /* return previously mapped sg table */
295 if (attach->dma_dir == dma_dir) {
296 mutex_unlock(lock);
297 return sgt;
300 /* release any previous cache */
301 if (attach->dma_dir != DMA_NONE) {
302 dma_unmap_sgtable(db_attach->dev, sgt, attach->dma_dir,
303 DMA_ATTR_SKIP_CPU_SYNC);
304 attach->dma_dir = DMA_NONE;
308 * mapping to the client with new direction, no cache sync
309 * required see comment in vb2_dc_dmabuf_ops_detach()
311 if (dma_map_sgtable(db_attach->dev, sgt, dma_dir,
312 DMA_ATTR_SKIP_CPU_SYNC)) {
313 pr_err("failed to map scatterlist\n");
314 mutex_unlock(lock);
315 return ERR_PTR(-EIO);
318 attach->dma_dir = dma_dir;
320 mutex_unlock(lock);
322 return sgt;
325 static void vb2_dc_dmabuf_ops_unmap(struct dma_buf_attachment *db_attach,
326 struct sg_table *sgt, enum dma_data_direction dma_dir)
328 /* nothing to be done here */
331 static void vb2_dc_dmabuf_ops_release(struct dma_buf *dbuf)
333 /* drop reference obtained in vb2_dc_get_dmabuf */
334 vb2_dc_put(dbuf->priv);
337 static int
338 vb2_dc_dmabuf_ops_begin_cpu_access(struct dma_buf *dbuf,
339 enum dma_data_direction direction)
341 return 0;
344 static int
345 vb2_dc_dmabuf_ops_end_cpu_access(struct dma_buf *dbuf,
346 enum dma_data_direction direction)
348 return 0;
351 static int vb2_dc_dmabuf_ops_vmap(struct dma_buf *dbuf, struct dma_buf_map *map)
353 struct vb2_dc_buf *buf = dbuf->priv;
355 dma_buf_map_set_vaddr(map, buf->vaddr);
357 return 0;
360 static int vb2_dc_dmabuf_ops_mmap(struct dma_buf *dbuf,
361 struct vm_area_struct *vma)
363 return vb2_dc_mmap(dbuf->priv, vma);
366 static const struct dma_buf_ops vb2_dc_dmabuf_ops = {
367 .attach = vb2_dc_dmabuf_ops_attach,
368 .detach = vb2_dc_dmabuf_ops_detach,
369 .map_dma_buf = vb2_dc_dmabuf_ops_map,
370 .unmap_dma_buf = vb2_dc_dmabuf_ops_unmap,
371 .begin_cpu_access = vb2_dc_dmabuf_ops_begin_cpu_access,
372 .end_cpu_access = vb2_dc_dmabuf_ops_end_cpu_access,
373 .vmap = vb2_dc_dmabuf_ops_vmap,
374 .mmap = vb2_dc_dmabuf_ops_mmap,
375 .release = vb2_dc_dmabuf_ops_release,
378 static struct sg_table *vb2_dc_get_base_sgt(struct vb2_dc_buf *buf)
380 int ret;
381 struct sg_table *sgt;
383 sgt = kmalloc(sizeof(*sgt), GFP_KERNEL);
384 if (!sgt) {
385 dev_err(buf->dev, "failed to alloc sg table\n");
386 return NULL;
389 ret = dma_get_sgtable_attrs(buf->dev, sgt, buf->cookie, buf->dma_addr,
390 buf->size, buf->attrs);
391 if (ret < 0) {
392 dev_err(buf->dev, "failed to get scatterlist from DMA API\n");
393 kfree(sgt);
394 return NULL;
397 return sgt;
400 static struct dma_buf *vb2_dc_get_dmabuf(void *buf_priv, unsigned long flags)
402 struct vb2_dc_buf *buf = buf_priv;
403 struct dma_buf *dbuf;
404 DEFINE_DMA_BUF_EXPORT_INFO(exp_info);
406 exp_info.ops = &vb2_dc_dmabuf_ops;
407 exp_info.size = buf->size;
408 exp_info.flags = flags;
409 exp_info.priv = buf;
411 if (!buf->sgt_base)
412 buf->sgt_base = vb2_dc_get_base_sgt(buf);
414 if (WARN_ON(!buf->sgt_base))
415 return NULL;
417 dbuf = dma_buf_export(&exp_info);
418 if (IS_ERR(dbuf))
419 return NULL;
421 /* dmabuf keeps reference to vb2 buffer */
422 refcount_inc(&buf->refcount);
424 return dbuf;
427 /*********************************************/
428 /* callbacks for USERPTR buffers */
429 /*********************************************/
431 static void vb2_dc_put_userptr(void *buf_priv)
433 struct vb2_dc_buf *buf = buf_priv;
434 struct sg_table *sgt = buf->dma_sgt;
435 int i;
436 struct page **pages;
438 if (sgt) {
440 * No need to sync to CPU, it's already synced to the CPU
441 * since the finish() memop will have been called before this.
443 dma_unmap_sgtable(buf->dev, sgt, buf->dma_dir,
444 DMA_ATTR_SKIP_CPU_SYNC);
445 pages = frame_vector_pages(buf->vec);
446 /* sgt should exist only if vector contains pages... */
447 BUG_ON(IS_ERR(pages));
448 if (buf->dma_dir == DMA_FROM_DEVICE ||
449 buf->dma_dir == DMA_BIDIRECTIONAL)
450 for (i = 0; i < frame_vector_count(buf->vec); i++)
451 set_page_dirty_lock(pages[i]);
452 sg_free_table(sgt);
453 kfree(sgt);
454 } else {
455 dma_unmap_resource(buf->dev, buf->dma_addr, buf->size,
456 buf->dma_dir, 0);
458 vb2_destroy_framevec(buf->vec);
459 kfree(buf);
462 static void *vb2_dc_get_userptr(struct device *dev, unsigned long vaddr,
463 unsigned long size, enum dma_data_direction dma_dir)
465 struct vb2_dc_buf *buf;
466 struct frame_vector *vec;
467 unsigned int offset;
468 int n_pages, i;
469 int ret = 0;
470 struct sg_table *sgt;
471 unsigned long contig_size;
472 unsigned long dma_align = dma_get_cache_alignment();
474 /* Only cache aligned DMA transfers are reliable */
475 if (!IS_ALIGNED(vaddr | size, dma_align)) {
476 pr_debug("user data must be aligned to %lu bytes\n", dma_align);
477 return ERR_PTR(-EINVAL);
480 if (!size) {
481 pr_debug("size is zero\n");
482 return ERR_PTR(-EINVAL);
485 if (WARN_ON(!dev))
486 return ERR_PTR(-EINVAL);
488 buf = kzalloc(sizeof *buf, GFP_KERNEL);
489 if (!buf)
490 return ERR_PTR(-ENOMEM);
492 buf->dev = dev;
493 buf->dma_dir = dma_dir;
495 offset = lower_32_bits(offset_in_page(vaddr));
496 vec = vb2_create_framevec(vaddr, size);
497 if (IS_ERR(vec)) {
498 ret = PTR_ERR(vec);
499 goto fail_buf;
501 buf->vec = vec;
502 n_pages = frame_vector_count(vec);
503 ret = frame_vector_to_pages(vec);
504 if (ret < 0) {
505 unsigned long *nums = frame_vector_pfns(vec);
508 * Failed to convert to pages... Check the memory is physically
509 * contiguous and use direct mapping
511 for (i = 1; i < n_pages; i++)
512 if (nums[i-1] + 1 != nums[i])
513 goto fail_pfnvec;
514 buf->dma_addr = dma_map_resource(buf->dev,
515 __pfn_to_phys(nums[0]), size, buf->dma_dir, 0);
516 if (dma_mapping_error(buf->dev, buf->dma_addr)) {
517 ret = -ENOMEM;
518 goto fail_pfnvec;
520 goto out;
523 sgt = kzalloc(sizeof(*sgt), GFP_KERNEL);
524 if (!sgt) {
525 pr_err("failed to allocate sg table\n");
526 ret = -ENOMEM;
527 goto fail_pfnvec;
530 ret = sg_alloc_table_from_pages(sgt, frame_vector_pages(vec), n_pages,
531 offset, size, GFP_KERNEL);
532 if (ret) {
533 pr_err("failed to initialize sg table\n");
534 goto fail_sgt;
538 * No need to sync to the device, this will happen later when the
539 * prepare() memop is called.
541 if (dma_map_sgtable(buf->dev, sgt, buf->dma_dir,
542 DMA_ATTR_SKIP_CPU_SYNC)) {
543 pr_err("failed to map scatterlist\n");
544 ret = -EIO;
545 goto fail_sgt_init;
548 contig_size = vb2_dc_get_contiguous_size(sgt);
549 if (contig_size < size) {
550 pr_err("contiguous mapping is too small %lu/%lu\n",
551 contig_size, size);
552 ret = -EFAULT;
553 goto fail_map_sg;
556 buf->dma_addr = sg_dma_address(sgt->sgl);
557 buf->dma_sgt = sgt;
558 out:
559 buf->size = size;
561 return buf;
563 fail_map_sg:
564 dma_unmap_sgtable(buf->dev, sgt, buf->dma_dir, DMA_ATTR_SKIP_CPU_SYNC);
566 fail_sgt_init:
567 sg_free_table(sgt);
569 fail_sgt:
570 kfree(sgt);
572 fail_pfnvec:
573 vb2_destroy_framevec(vec);
575 fail_buf:
576 kfree(buf);
578 return ERR_PTR(ret);
581 /*********************************************/
582 /* callbacks for DMABUF buffers */
583 /*********************************************/
585 static int vb2_dc_map_dmabuf(void *mem_priv)
587 struct vb2_dc_buf *buf = mem_priv;
588 struct sg_table *sgt;
589 unsigned long contig_size;
591 if (WARN_ON(!buf->db_attach)) {
592 pr_err("trying to pin a non attached buffer\n");
593 return -EINVAL;
596 if (WARN_ON(buf->dma_sgt)) {
597 pr_err("dmabuf buffer is already pinned\n");
598 return 0;
601 /* get the associated scatterlist for this buffer */
602 sgt = dma_buf_map_attachment(buf->db_attach, buf->dma_dir);
603 if (IS_ERR(sgt)) {
604 pr_err("Error getting dmabuf scatterlist\n");
605 return -EINVAL;
608 /* checking if dmabuf is big enough to store contiguous chunk */
609 contig_size = vb2_dc_get_contiguous_size(sgt);
610 if (contig_size < buf->size) {
611 pr_err("contiguous chunk is too small %lu/%lu\n",
612 contig_size, buf->size);
613 dma_buf_unmap_attachment(buf->db_attach, sgt, buf->dma_dir);
614 return -EFAULT;
617 buf->dma_addr = sg_dma_address(sgt->sgl);
618 buf->dma_sgt = sgt;
619 buf->vaddr = NULL;
621 return 0;
624 static void vb2_dc_unmap_dmabuf(void *mem_priv)
626 struct vb2_dc_buf *buf = mem_priv;
627 struct sg_table *sgt = buf->dma_sgt;
628 struct dma_buf_map map = DMA_BUF_MAP_INIT_VADDR(buf->vaddr);
630 if (WARN_ON(!buf->db_attach)) {
631 pr_err("trying to unpin a not attached buffer\n");
632 return;
635 if (WARN_ON(!sgt)) {
636 pr_err("dmabuf buffer is already unpinned\n");
637 return;
640 if (buf->vaddr) {
641 dma_buf_vunmap(buf->db_attach->dmabuf, &map);
642 buf->vaddr = NULL;
644 dma_buf_unmap_attachment(buf->db_attach, sgt, buf->dma_dir);
646 buf->dma_addr = 0;
647 buf->dma_sgt = NULL;
650 static void vb2_dc_detach_dmabuf(void *mem_priv)
652 struct vb2_dc_buf *buf = mem_priv;
654 /* if vb2 works correctly you should never detach mapped buffer */
655 if (WARN_ON(buf->dma_addr))
656 vb2_dc_unmap_dmabuf(buf);
658 /* detach this attachment */
659 dma_buf_detach(buf->db_attach->dmabuf, buf->db_attach);
660 kfree(buf);
663 static void *vb2_dc_attach_dmabuf(struct device *dev, struct dma_buf *dbuf,
664 unsigned long size, enum dma_data_direction dma_dir)
666 struct vb2_dc_buf *buf;
667 struct dma_buf_attachment *dba;
669 if (dbuf->size < size)
670 return ERR_PTR(-EFAULT);
672 if (WARN_ON(!dev))
673 return ERR_PTR(-EINVAL);
675 buf = kzalloc(sizeof(*buf), GFP_KERNEL);
676 if (!buf)
677 return ERR_PTR(-ENOMEM);
679 buf->dev = dev;
680 /* create attachment for the dmabuf with the user device */
681 dba = dma_buf_attach(dbuf, buf->dev);
682 if (IS_ERR(dba)) {
683 pr_err("failed to attach dmabuf\n");
684 kfree(buf);
685 return dba;
688 buf->dma_dir = dma_dir;
689 buf->size = size;
690 buf->db_attach = dba;
692 return buf;
695 /*********************************************/
696 /* DMA CONTIG exported functions */
697 /*********************************************/
699 const struct vb2_mem_ops vb2_dma_contig_memops = {
700 .alloc = vb2_dc_alloc,
701 .put = vb2_dc_put,
702 .get_dmabuf = vb2_dc_get_dmabuf,
703 .cookie = vb2_dc_cookie,
704 .vaddr = vb2_dc_vaddr,
705 .mmap = vb2_dc_mmap,
706 .get_userptr = vb2_dc_get_userptr,
707 .put_userptr = vb2_dc_put_userptr,
708 .prepare = vb2_dc_prepare,
709 .finish = vb2_dc_finish,
710 .map_dmabuf = vb2_dc_map_dmabuf,
711 .unmap_dmabuf = vb2_dc_unmap_dmabuf,
712 .attach_dmabuf = vb2_dc_attach_dmabuf,
713 .detach_dmabuf = vb2_dc_detach_dmabuf,
714 .num_users = vb2_dc_num_users,
716 EXPORT_SYMBOL_GPL(vb2_dma_contig_memops);
719 * vb2_dma_contig_set_max_seg_size() - configure DMA max segment size
720 * @dev: device for configuring DMA parameters
721 * @size: size of DMA max segment size to set
723 * To allow mapping the scatter-list into a single chunk in the DMA
724 * address space, the device is required to have the DMA max segment
725 * size parameter set to a value larger than the buffer size. Otherwise,
726 * the DMA-mapping subsystem will split the mapping into max segment
727 * size chunks. This function sets the DMA max segment size
728 * parameter to let DMA-mapping map a buffer as a single chunk in DMA
729 * address space.
730 * This code assumes that the DMA-mapping subsystem will merge all
731 * scatterlist segments if this is really possible (for example when
732 * an IOMMU is available and enabled).
733 * Ideally, this parameter should be set by the generic bus code, but it
734 * is left with the default 64KiB value due to historical litmiations in
735 * other subsystems (like limited USB host drivers) and there no good
736 * place to set it to the proper value.
737 * This function should be called from the drivers, which are known to
738 * operate on platforms with IOMMU and provide access to shared buffers
739 * (either USERPTR or DMABUF). This should be done before initializing
740 * videobuf2 queue.
742 int vb2_dma_contig_set_max_seg_size(struct device *dev, unsigned int size)
744 if (!dev->dma_parms) {
745 dev_err(dev, "Failed to set max_seg_size: dma_parms is NULL\n");
746 return -ENODEV;
748 if (dma_get_max_seg_size(dev) < size)
749 return dma_set_max_seg_size(dev, size);
751 return 0;
753 EXPORT_SYMBOL_GPL(vb2_dma_contig_set_max_seg_size);
755 MODULE_DESCRIPTION("DMA-contig memory handling routines for videobuf2");
756 MODULE_AUTHOR("Pawel Osciak <pawel@osciak.com>");
757 MODULE_LICENSE("GPL");