diff -aurN ETpcihsm-3.33/opt/ETpcihsm/src//csa8fm.h tmp/opt/ETpcihsm/src//csa8fm.h --- ETpcihsm-3.33/opt/ETpcihsm/src//csa8fm.h 2008-08-19 21:30:32.000000000 +0000 +++ tmp/opt/ETpcihsm/src//csa8fm.h 2011-07-07 17:15:46.000000000 +0000 @@ -12,7 +12,7 @@ */ #ifndef INC_CSA8FM_H #define INC_CSA8FM_H -#include +#include "integers.h" /* Functionality module number type. Each FM loaded to the system has a unique FM number. These numbers are also used as the major numbers for the HIFACE diff -aurN ETpcihsm-3.33/opt/ETpcihsm/src//csa8hiface.h tmp/opt/ETpcihsm/src//csa8hiface.h --- ETpcihsm-3.33/opt/ETpcihsm/src//csa8hiface.h 2008-08-19 21:30:32.000000000 +0000 +++ tmp/opt/ETpcihsm/src//csa8hiface.h 2011-07-07 17:16:08.000000000 +0000 @@ -13,7 +13,7 @@ #ifndef INC_CSA8HIFACE_H #define INC_CSA8HIFACE_H -#include +#include "integers.h" /* * The thread context storage index used for HIFACE tokens. diff -aurN ETpcihsm-3.33/opt/ETpcihsm/src//e8k.c tmp/opt/ETpcihsm/src//e8k.c --- ETpcihsm-3.33/opt/ETpcihsm/src//e8k.c 2008-08-19 21:30:32.000000000 +0000 +++ tmp/opt/ETpcihsm/src//e8k.c 2011-07-07 17:20:06.000000000 +0000 @@ -95,7 +95,7 @@ #endif int e8kAdapterCount; -int e8k_dma_threshold = DMA_THRESHOLD; +int e8k_dma_threshold = 4096; #ifdef _MULTI_DATAMODEL typedef struct { diff -aurN ETpcihsm-3.33/opt/ETpcihsm/src//e8k_io.h tmp/opt/ETpcihsm/src//e8k_io.h --- ETpcihsm-3.33/opt/ETpcihsm/src//e8k_io.h 2008-08-19 21:30:32.000000000 +0000 +++ tmp/opt/ETpcihsm/src//e8k_io.h 2011-07-07 17:13:23.000000000 +0000 @@ -24,6 +24,13 @@ #define _ECSA_IO_H /* + * MR: missing types + */ + +typedef unsigned int uint_t; +typedef unsigned short ushort_t; + +/* * The DispatchInfo structure describes a request to the * adapter as well as the response from that request. */ diff -aurN ETpcihsm-3.33/opt/ETpcihsm/src//e8k_linux.c tmp/opt/ETpcihsm/src//e8k_linux.c --- ETpcihsm-3.33/opt/ETpcihsm/src//e8k_linux.c 2008-08-19 21:30:32.000000000 +0000 +++ tmp/opt/ETpcihsm/src//e8k_linux.c 2011-08-03 12:16:26.000000000 +0000 @@ -31,6 +31,10 @@ #include "hiframe.h" #include "e8k_proto.h" #include "e8k_buildno.h" +#include "linux/pci.h" + +typedef unsigned long ulong_t; +typedef struct kmem_cache kmem_cache_t; #ifndef CONFIG_PCI # error "CONFIG_PCI must be enabled in the kernel configuration" @@ -207,9 +211,9 @@ static int e8k_create_mem_cache(void) { - e8k_dcache_64 = kmem_cache_create(name64, 64, 0, SLAB_HWCACHE_ALIGN, 0, 0); - e8k_dcache_256 = kmem_cache_create(name256, 256, 0, SLAB_HWCACHE_ALIGN, 0, 0); - e8k_dcache_1024 = kmem_cache_create(name1024, 1025, 0, SLAB_HWCACHE_ALIGN, 0, 0); + e8k_dcache_64 = kmem_cache_create(name64, 64, 0, SLAB_HWCACHE_ALIGN, NULL); + e8k_dcache_256 = kmem_cache_create(name256, 256, 0, SLAB_HWCACHE_ALIGN, NULL); + e8k_dcache_1024 = kmem_cache_create(name1024, 1025, 0, SLAB_HWCACHE_ALIGN, NULL); if (!e8k_dcache_64) { @@ -258,7 +262,8 @@ * IRQ callback - Linux does a cli() and disables this IRQ. Until * this routine returns, IRQs are off - so be quick! */ -irqreturn_t +//irqreturn_t +irq_handler_t linux_e8k_intr(int irq, void *dev_id, struct pt_regs * regs) { register Ecsa *ecsap = (Ecsa *) dev_id; @@ -272,7 +277,7 @@ } #endif - return IRQ_NONE; + return (irq_handler_t) IRQ_NONE; } /* @@ -284,7 +289,7 @@ e8k_intr(ecsap); spin_unlock(&((ecsap->ecsa_replylock)->spin)); /* psg_mutex_exit(&ecsap->ecsa_replylock); */ - return IRQ_HANDLED; + return (irq_handler_t) IRQ_HANDLED; } /* @@ -482,7 +487,7 @@ /* make sure interrupts are disabled */ /* PUT_INTCSR(ecsap, 0); causes hang on linux with PSG */ - if (request_irq(ecsap->irq, linux_e8k_intr, SA_SHIRQ, ecsap->device_name, ecsap)) { + if (request_irq(ecsap->irq, (irq_handler_t) linux_e8k_intr, IRQF_SHARED, ecsap->device_name, ecsap)) { DPRINT1(0, "e8k: request_irq %d failed\n", ecsap->irq); iounmap(ecsap->ecsa_csr); @@ -755,12 +760,13 @@ #ifdef CONFIG_DEVFS_FS if (devfs_unregister_chrdev(e8k_major, "e8k") != 0) -#else - if (unregister_chrdev(e8k_major, "e8k") != 0) -#endif { LOGMSG0(CE_CONT, "e8k: cannot unregister device\n"); } +#else + unregister_chrdev(e8k_major, "e8k"); +#endif + #ifdef CONFIG_SYSFS #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,16) @@ -792,13 +798,8 @@ DPRINT0(1, "e8k: init_module called\n"); if (!e8k_silent) { - LOGMSG0(CE_CONT, - "e8k: " - VERSION - TRACE( " build " BUILD_VERSION ) - " PSO/PSG driver\n"); - LOGMSG0(CE_CONT, - "e8k: Copyright (c) 2008 SafeNet, Inc.\n"); + LOGMSG0(CE_CONT, "e8k: PSO/PSG driver\n"); + LOGMSG0(CE_CONT, "e8k: Copyright (c) 2008 SafeNet, Inc.\n"); #ifdef CONFIG_SMP LOGMSG0(CE_CONT, "e8k: configured for SMP\n"); #endif @@ -837,12 +838,15 @@ return -EINVAL; } + LOGMSG1(CE_WARN, "e8k: devno: %d\n", devno); + /* pci_module_init() calls e8k_probe_one for each card ... */ - if ((retval = pci_module_init(&e8k_pci_driver)) < 0) { + if ((retval = pci_register_driver(&e8k_pci_driver)) < 0) { LOGMSG0(CE_CONT, "e8k: pci_module_init failed\n"); unregister_chrdev(devno, "e8k"); return retval; } + LOGMSG1(CE_CONT, "e8k: pci_register_driver retval=%d\n", retval); if (!e8k_silent) LOGMSG2(CE_CONT, "e8k: %d PSO/PSG card%s found\n", @@ -850,6 +854,7 @@ e8kAdapterCount > 1 ? "s were" : " was"); if (e8kAdapterCount < 1) { + LOGMSG0(CE_CONT, "e8k: unregister\n"); pci_unregister_driver(&e8k_pci_driver); unregister_chrdev(devno, "e8k"); return -ENODEV; @@ -910,7 +915,7 @@ extern int e8k_dma_threshold; if (e8k_dmamin > 4096 || e8k_dmamin < 256) - e8k_dmamin = DMA_THRESHOLD; + e8k_dmamin = 4096; e8k_dma_threshold = e8k_dmamin; if (e8k_dma_threshold > I2O_MAX_REQUEST_LEN) @@ -1310,7 +1315,7 @@ if ( sg->offset < PAGE_SIZE ) { - pfn = page_to_pfn(sg->page); + pfn = page_to_pfn(sg_page(sg)); if (pfn_valid(pfn)) { return ((char*)pfn_to_kaddr(pfn)) + sg->offset; @@ -1326,13 +1331,15 @@ if (virt_addr_valid(some_ptr)) { - sg->page = virt_to_page(some_ptr); + sg_assign_page(sg, sg_page(sg)); + //sg->page = virt_to_page(some_ptr); sg->offset = (unsigned int)((unsigned long)some_ptr % (PAGE_SIZE) ); ASSERT(e8k_sg_get_host_address(sg) == some_ptr); } else { - sg->page = 0; + //sg->page = 0; + sg_assign_page(sg, 0); sg->offset = PAGE_SIZE; } } @@ -2207,11 +2214,11 @@ mut->sem->lock = 0; mut->sem->count = 1; #else - mut->sem->count.counter = 1; + mut->sem->count = 1; #endif #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) - mut->sem->sleepers = 0; - init_waitqueue_head(&mut->sem->wait); + //mut->sem->sleepers = 0; + init_waitqueue_head(&mut->sem->lock); #else mut->sem->waking = 0; mut->sem->wait = NULL; diff -aurN ETpcihsm-3.33/opt/ETpcihsm/src//e8k_sys.h tmp/opt/ETpcihsm/src//e8k_sys.h --- ETpcihsm-3.33/opt/ETpcihsm/src//e8k_sys.h 2008-08-19 21:30:32.000000000 +0000 +++ tmp/opt/ETpcihsm/src//e8k_sys.h 2011-07-07 17:04:43.000000000 +0000 @@ -40,7 +40,7 @@ #endif #include #include -#include +#include #if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,34) #include diff -aurN ETpcihsm-3.33/opt/ETpcihsm/src//hifacefm.h tmp/opt/ETpcihsm/src//hifacefm.h --- ETpcihsm-3.33/opt/ETpcihsm/src//hifacefm.h 2008-08-19 21:30:32.000000000 +0000 +++ tmp/opt/ETpcihsm/src//hifacefm.h 2011-07-07 17:15:11.000000000 +0000 @@ -11,9 +11,9 @@ */ #ifndef INC_HIFACEFM_H #define INC_HIFACEFM_H -#include -#include -#include +#include "integers.h" +#include "csa8fm.h" +#include "csa8hiface.h" #define SINK_CMD 0 #define ECHO_CMD 1 diff -aurN ETpcihsm-3.33/opt/ETpcihsm/src//hiframe.h tmp/opt/ETpcihsm/src//hiframe.h --- ETpcihsm-3.33/opt/ETpcihsm/src//hiframe.h 2008-08-19 21:30:32.000000000 +0000 +++ tmp/opt/ETpcihsm/src//hiframe.h 2011-07-07 17:14:39.000000000 +0000 @@ -18,8 +18,8 @@ #ifndef INC_HIFRAME_H #define INC_HIFRAME_H -#include -#include +#include "integers.h" +#include "i2oparam.h" /* * Request Frame header structure, as defined in Adapter Interface V6.2 diff -aurN ETpcihsm-3.33/opt/ETpcihsm/src//make.sh tmp/opt/ETpcihsm/src//make.sh --- ETpcihsm-3.33/opt/ETpcihsm/src//make.sh 1970-01-01 00:00:00.000000000 +0000 +++ tmp/opt/ETpcihsm/src//make.sh 2011-07-08 11:46:06.000000000 +0000 @@ -0,0 +1,4 @@ +rmmod e8k +KBUILD_NOPEDANTIC=1 make +dmesg -c >/dev/null +insmod e8k.ko diff -aurN ETpcihsm-3.33/opt/ETpcihsm/src//modules.order tmp/opt/ETpcihsm/src//modules.order --- ETpcihsm-3.33/opt/ETpcihsm/src//modules.order 1970-01-01 00:00:00.000000000 +0000 +++ tmp/opt/ETpcihsm/src//modules.order 2011-08-05 15:07:41.000000000 +0000 @@ -0,0 +1 @@ +kernel//root/tmp/opt/ETpcihsm/src/e8k.ko diff -aurN ETpcihsm-3.33/opt/ETpcihsm/src//sys_linux.h tmp/opt/ETpcihsm/src//sys_linux.h --- ETpcihsm-3.33/opt/ETpcihsm/src//sys_linux.h 2008-08-19 21:30:32.000000000 +0000 +++ tmp/opt/ETpcihsm/src//sys_linux.h 2011-07-07 17:33:56.000000000 +0000 @@ -52,6 +52,10 @@ * it down. */ +#define USE_BOUNCE 1 +#define USE_GET_USER_PAGES 1 + + #if (USE_BOUNCE == 1) #undef USE_GET_USER_PAGES #endif