diff options
author | root <root@iss-tomyspiel-1> | 2011-10-21 02:37:19 +0200 |
---|---|---|
committer | root <root@iss-tomyspiel-1> | 2011-10-21 02:37:19 +0200 |
commit | 33fb2003ef2e359f472dc153a7c2e700cdff2922 (patch) | |
tree | 102b48849f6b3a1486ac5ec5bbb305a8c8d274a1 /driver/sysfs.c | |
parent | 64e0f2948b71d37e8cdb99693a00b3f440565953 (diff) | |
download | ipecamera-33fb2003ef2e359f472dc153a7c2e700cdff2922.tar.gz ipecamera-33fb2003ef2e359f472dc153a7c2e700cdff2922.tar.bz2 ipecamera-33fb2003ef2e359f472dc153a7c2e700cdff2922.tar.xz ipecamera-33fb2003ef2e359f472dc153a7c2e700cdff2922.zip |
Support exporting data from kernel buffers
Diffstat (limited to 'driver/sysfs.c')
-rw-r--r-- | driver/sysfs.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/driver/sysfs.c b/driver/sysfs.c index 47e4395..b10157b 100644 --- a/driver/sysfs.c +++ b/driver/sysfs.c @@ -101,7 +101,10 @@ static SYSFS_GET_FUNCTION(pcidriver_show_kmem_entry) int id = simple_strtol(attr->attr.name + strlen("kbuf"), NULL, 10); 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\nrefs: %lu\nhw ref: %i\nmode: 0x%lx\n", id, entry->type, entry->use, entry->item, entry->size, entry->refs&KMEM_REF_COUNT, (entry->refs&KMEM_REF_HW)?1:0, entry->mode); + if (entry->size >= 16) + return snprintf(buf, PAGE_SIZE, "buffer: %d\ntype: %lu\nuse: 0x%lx\nitem: %lu\nsize: %lu\nrefs: %lu\nhw ref: %i\nmode: 0x%lx\n data: %8x %8x %8x %8x\n", id, entry->type, entry->use, entry->item, entry->size, entry->refs&KMEM_REF_COUNT, (entry->refs&KMEM_REF_HW)?1:0, entry->mode, *(u32*)(entry->cpua), *(u32*)(entry->cpua + 4), *(u32*)(entry->cpua + 8), *(u32*)(entry->cpua + 12)); + else + return snprintf(buf, PAGE_SIZE, "buffer: %d\ntype: %lu\nuse: 0x%lx\nitem: %lu\nsize: %lu\nrefs: %lu\nhw ref: %i\nmode: 0x%lx\n", id, entry->type, entry->use, entry->item, entry->size, entry->refs&KMEM_REF_COUNT, (entry->refs&KMEM_REF_HW)?1:0, entry->mode); else return snprintf(buf, PAGE_SIZE, "I am in the kmem_entry show function for buffer %d\n", id); #else |