diff options
author | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2011-07-14 06:01:27 +0200 |
---|---|---|
committer | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2011-07-14 06:01:27 +0200 |
commit | f4ad2df2209acac66f3df47d847f1f714283feab (patch) | |
tree | 23da0368acbb6c15cdebd2a35808cd6bbe99b8ae /driver/sysfs.c | |
parent | b492b1aac3d12683ccbc973b08b023ba0466cbec (diff) | |
download | pcitool-f4ad2df2209acac66f3df47d847f1f714283feab.tar.gz pcitool-f4ad2df2209acac66f3df47d847f1f714283feab.tar.bz2 pcitool-f4ad2df2209acac66f3df47d847f1f714283feab.tar.xz pcitool-f4ad2df2209acac66f3df47d847f1f714283feab.zip |
First iteration of work to preserve DMA state between executions
Diffstat (limited to 'driver/sysfs.c')
-rw-r--r-- | driver/sysfs.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/driver/sysfs.c b/driver/sysfs.c index b082d3c..0653aef 100644 --- a/driver/sysfs.c +++ b/driver/sysfs.c @@ -90,14 +90,17 @@ void pcidriver_sysfs_remove(pcidriver_privdata_t *privdata, struct class_device_ static SYSFS_GET_FUNCTION(pcidriver_show_kmem_entry) { #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,13) -// pcidriver_privdata_t *privdata = (pcidriver_privdata_t *)cls->class_data; + pcidriver_privdata_t *privdata = SYSFS_GET_PRIVDATA; /* As we can be sure that attr.name contains a filename which we * created (see _pcidriver_sysfs_initialize), we do not need to have * sanity checks but can directly call simple_strtol() */ int id = simple_strtol(attr->attr.name + strlen("kbuf"), NULL, 10); - - return snprintf(buf, PAGE_SIZE, "I am in the kmem_entry show function for buffer %d\n", id); + pcidriver_kmem_entry_t *entry = pcidriver_kmem_find_entry_id(privdata, id); + if (entry) + return snprintf(buf, PAGE_SIZE, "buffer: %d\ntype: %lu\nuse: 0x%lx\nitem: %lu\nsize: %lu\n", id, entry->type, entry->use, entry->item, entry->size); + else + return snprintf(buf, PAGE_SIZE, "I am in the kmem_entry show function for buffer %d\n", id); #else return 0; #endif |