diff options
Diffstat (limited to 'drivers/dma/ioat/dma_v2.c')
-rw-r--r-- | drivers/dma/ioat/dma_v2.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/drivers/dma/ioat/dma_v2.c b/drivers/dma/ioat/dma_v2.c index 7492e9165e08..80ce32de8d32 100644 --- a/drivers/dma/ioat/dma_v2.c +++ b/drivers/dma/ioat/dma_v2.c | |||
@@ -795,6 +795,36 @@ ioat2_is_complete(struct dma_chan *c, dma_cookie_t cookie, | |||
795 | return ioat_is_complete(c, cookie, done, used); | 795 | return ioat_is_complete(c, cookie, done, used); |
796 | } | 796 | } |
797 | 797 | ||
798 | static ssize_t ring_size_show(struct dma_chan *c, char *page) | ||
799 | { | ||
800 | struct ioat2_dma_chan *ioat = to_ioat2_chan(c); | ||
801 | |||
802 | return sprintf(page, "%d\n", (1 << ioat->alloc_order) & ~1); | ||
803 | } | ||
804 | static struct ioat_sysfs_entry ring_size_attr = __ATTR_RO(ring_size); | ||
805 | |||
806 | static ssize_t ring_active_show(struct dma_chan *c, char *page) | ||
807 | { | ||
808 | struct ioat2_dma_chan *ioat = to_ioat2_chan(c); | ||
809 | |||
810 | /* ...taken outside the lock, no need to be precise */ | ||
811 | return sprintf(page, "%d\n", ioat2_ring_active(ioat)); | ||
812 | } | ||
813 | static struct ioat_sysfs_entry ring_active_attr = __ATTR_RO(ring_active); | ||
814 | |||
815 | static struct attribute *ioat2_attrs[] = { | ||
816 | &ring_size_attr.attr, | ||
817 | &ring_active_attr.attr, | ||
818 | &ioat_cap_attr.attr, | ||
819 | &ioat_version_attr.attr, | ||
820 | NULL, | ||
821 | }; | ||
822 | |||
823 | struct kobj_type ioat2_ktype = { | ||
824 | .sysfs_ops = &ioat_sysfs_ops, | ||
825 | .default_attrs = ioat2_attrs, | ||
826 | }; | ||
827 | |||
798 | int __devinit ioat2_dma_probe(struct ioatdma_device *device, int dca) | 828 | int __devinit ioat2_dma_probe(struct ioatdma_device *device, int dca) |
799 | { | 829 | { |
800 | struct pci_dev *pdev = device->pdev; | 830 | struct pci_dev *pdev = device->pdev; |
@@ -827,6 +857,9 @@ int __devinit ioat2_dma_probe(struct ioatdma_device *device, int dca) | |||
827 | err = ioat_register(device); | 857 | err = ioat_register(device); |
828 | if (err) | 858 | if (err) |
829 | return err; | 859 | return err; |
860 | |||
861 | ioat_kobject_add(device, &ioat2_ktype); | ||
862 | |||
830 | if (dca) | 863 | if (dca) |
831 | device->dca = ioat2_dca_init(pdev, device->reg_base); | 864 | device->dca = ioat2_dca_init(pdev, device->reg_base); |
832 | 865 | ||