summaryrefslogtreecommitdiffstats
path: root/driver
diff options
context:
space:
mode:
Diffstat (limited to 'driver')
-rw-r--r--driver/Makefile4
-rw-r--r--driver/ioctl.c1
-rw-r--r--driver/pciDriver.h3
-rw-r--r--driver/sysfs.c11
4 files changed, 12 insertions, 7 deletions
diff --git a/driver/Makefile b/driver/Makefile
index 92fa913..13c3310 100644
--- a/driver/Makefile
+++ b/driver/Makefile
@@ -10,7 +10,7 @@ EXTRA_CFLAGS += -I$(M)/..
default:
@KERNEL_GCC_VERSION=`cat /proc/version | head -n1 | cut -d " " -f 7` ;\
- GCC_VERSION=`$(CC) --version | head -n 1 | tr ' ' '\n' | tail -n 1` ;\
+ GCC_VERSION=`$(CC) --version | head -n 1 | tr ' ' '\n' | grep -e "[0-9]\+\.[0-9]" | head -n 1` ;\
if [ $$KERNEL_GCC_VERSION != $$GCC_VERSION ]; then \
echo "Kernel is compiled with gcc $$KERNEL_GCC_VERSION, but you are now using $$GCC_VERSION" ;\
GCC_MAJOR=`echo $$KERNEL_GCC_VERSION | cut -d "." -f 1-2` ;\
@@ -20,7 +20,7 @@ default:
echo "No compiler of $$GCC_MAJOR series is installed" ;\
exit 1 ;\
fi ;\
- GCC_VERSION=`$$CC --version | head -n 1 | tr ' ' '\n' | tail -n 1` ;\
+ GCC_VERSION=`$$CC --version | head -n 1 | tr ' ' '\n' | grep -e "[0-9]\+\.[0-9]" | head -n 1` ;\
if [ $$KERNEL_GCC_VERSION != $$GCC_VERSION ]; then \
echo "The $$GCC_VERSION of $$GCC_MAJOR series is installed" ;\
exit 1 ;\
diff --git a/driver/ioctl.c b/driver/ioctl.c
index 43a3cf7..2d4af73 100644
--- a/driver/ioctl.c
+++ b/driver/ioctl.c
@@ -150,6 +150,7 @@ static int ioctl_pci_info(pcidriver_privdata_t *privdata, unsigned long arg)
pci_info.bus = privdata->pdev->bus->number;
pci_info.slot = PCI_SLOT(privdata->pdev->devfn);
pci_info.devfn = privdata->pdev->devfn;
+ pci_info.func = PCI_FUNC(privdata->pdev->devfn);
if ((ret = pci_read_config_byte(privdata->pdev, PCI_INTERRUPT_PIN, &(pci_info.interrupt_pin))) != 0)
return ret;
diff --git a/driver/pciDriver.h b/driver/pciDriver.h
index 159f6ad..8e9c0bc 100644
--- a/driver/pciDriver.h
+++ b/driver/pciDriver.h
@@ -61,7 +61,7 @@
/* Identifies the PCI-E Xilinx ML605 */
#define PCIE_XILINX_VENDOR_ID 0x10ee
-#define PCIE_ML605_DEVICE_ID 0x04a0
+#define PCIE_ML605_DEVICE_ID 0x6024
/* Identifies the PCI-E IPE Camera */
#define PCIE_IPECAMERA_DEVICE_ID 0x6081
@@ -170,6 +170,7 @@ typedef struct {
unsigned short device_id;
unsigned short bus;
unsigned short slot;
+ unsigned short func;
unsigned short devfn;
unsigned char interrupt_pin;
unsigned char interrupt_line;
diff --git a/driver/sysfs.c b/driver/sysfs.c
index 37cf362..8d3fccf 100644
--- a/driver/sysfs.c
+++ b/driver/sysfs.c
@@ -100,13 +100,16 @@ static SYSFS_GET_FUNCTION(pcidriver_show_kmem_entry)
* sanity checks but can directly call simple_strtol() */
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)
+ if (entry) {
+ unsigned long addr = entry->cpua;
+ unsigned long dma_addr = entry->dma_handle;
+
if (entry->size >= 16) {
pcidriver_kmem_sync_entry(privdata, entry, PCILIB_KMEM_SYNC_FROMDEVICE);
- return snprintf(buf, PAGE_SIZE, "buffer: %d\ntype: %lx\nuse: 0x%lx\nitem: %lu\nsize: %lu\nrefs: %lu\nhw ref: %i\nmode: 0x%lx\ndata: %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));
+ return snprintf(buf, PAGE_SIZE, "buffer: %d\naddr: %lx\nhw addr: %lx\nbus addr: %lx\ntype: %lx\nuse: 0x%lx\nitem: %lu\nsize: %lu\nrefs: %lu\nhw ref: %i\nmode: 0x%lx\ndata: %8x %8x %8x %8x\n", id, addr, dma_addr, dma_addr, 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: %lx\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, "buffer: %d\naddr: %lx\nhw addr: %lx\nbus addr: %lx\ntype: %lx\nuse: 0x%lx\nitem: %lu\nsize: %lu\nrefs: %lu\nhw ref: %i\nmode: 0x%lx\n", id, addr, dma_addr, dma_addr, 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
return 0;