[ewg] Re: kernel_addons patch for ipath support

Michael S. Tsirkin mst at mellanox.co.il
Fri Feb 16 03:51:03 PST 2007


Okay, but where does the following come from, and what does it do?

> diff -urN ofed_1_2/kernel_addons/backport/2.6.16/include/linux/hvcall.h infinipath-drivers/kernel_addons/backport/2.6.16/include/linux/hvcall.h
> --- ofed_1_2/kernel_addons/backport/2.6.16/include/linux/hvcall.h	1969-12-31 16:00:00.000000000 -0800
> +++ infinipath-drivers/kernel_addons/backport/2.6.16/include/linux/hvcall.h	2007-02-12 11:20:29.126379000 -0800
> @@ -0,0 +1,232 @@
> +#ifndef ASM_HVCALL_BACKPORT_2616_H
> +#define ASM_HVCALL_BACKPORT_2616_H
> +
> +#include_next <asm/hvcall.h>
> +
> +#ifdef __KERNEL__
> +
> +#define H_SUCCESS               H_Success
> +#define H_BUSY                  H_Busy
> +#define H_CONSTRAINED           H_Constrained
> +#define H_PAGE_REGISTERED       15
> +
> +#define H_PARAMETER             H_Parameter
> +#define H_NO_MEM                H_NoMem
> +#define H_RESOURCE              H_Resource
> +#define H_HARDWARE              H_Hardware
> +#define H_ADAPTER_PARM          -17
> +#define H_RH_PARM               -18
> +#define H_RT_PARM               -22
> +#define H_MLENGTH_PARM          -27
> +#define H_MEM_PARM              -28
> +#define H_MEM_ACCESS_PARM       -29
> +#define H_ALIAS_EXIST           -39
> +#define H_TABLE_FULL            -41
> +#define H_NOT_ENOUGH_RESOURCES  -44
> +#define H_R_STATE               -45
> +
> +#define H_CB_ALIGNMENT          4096
> +
> +#define H_RESET_EVENTS          0x15C
> +#define H_ALLOC_RESOURCE        0x160
> +#define H_FREE_RESOURCE         0x164
> +#define H_MODIFY_QP             0x168
> +#define H_QUERY_QP              0x16C
> +#define H_REREGISTER_PMR        0x170
> +#define H_REGISTER_SMR          0x174
> +#define H_QUERY_MR              0x178
> +#define H_QUERY_MW              0x17C
> +#define H_QUERY_HCA             0x180
> +#define H_QUERY_PORT            0x184
> +#define H_MODIFY_PORT           0x188
> +#define H_DEFINE_AQP1           0x18C
> +#define H_DEFINE_AQP0           0x194
> +#define H_RESIZE_MR             0x198
> +#define H_ATTACH_MCQP           0x19C
> +#define H_DETACH_MCQP           0x1A0
> +#define H_REGISTER_RPAGES       0x1AC
> +#define H_DISABLE_AND_GETC      0x1B0
> +#define H_ERROR_DATA            0x1B4
> +#define H_QUERY_INT_STATE       0x1E4
> +
> +#define H_LONG_BUSY_ORDER_1_MSEC   H_LongBusyOrder1msec
> +#define H_LONG_BUSY_ORDER_10_MSEC  H_LongBusyOrder10msec
> +#define H_LONG_BUSY_ORDER_100_MSEC H_LongBusyOrder100msec
> +#define H_LONG_BUSY_ORDER_1_SEC    H_LongBusyOrder1sec
> +#define H_LONG_BUSY_ORDER_10_SEC   H_LongBusyOrder10sec
> +#define H_LONG_BUSY_ORDER_100_SEC  H_LongBusyOrder100sec
> +#define H_IS_LONG_BUSY(x) ((x >= H_LongBusyStartRange) && (x <= H_LongBusyEndRange))
> +
> +
> +#ifndef __ASSEMBLY__
> +#include <linux/kernel.h>
> +inline static long plpar_hcall_7arg_7ret(unsigned long opcode,
> +					 unsigned long arg1,    /* <R4  */
> +					 unsigned long arg2,	/* <R5  */
> +					 unsigned long arg3,	/* <R6  */
> +					 unsigned long arg4,	/* <R7  */
> +					 unsigned long arg5,	/* <R8  */
> +					 unsigned long arg6,	/* <R9  */
> +					 unsigned long arg7,	/* <R10 */
> +					 unsigned long *out1,	/* <R4  */
> +					 unsigned long *out2,	/* <R5  */
> +					 unsigned long *out3,	/* <R6  */
> +					 unsigned long *out4,	/* <R7  */
> +					 unsigned long *out5,	/* <R8  */
> +					 unsigned long *out6,	/* <R9  */
> +					 unsigned long *out7	/* <R10 */
> +    )
> +{
> +	unsigned long regs[11] = {opcode,
> +				  arg1, arg2, arg3, arg4, arg5, arg6, arg7};
> +
> +	__asm__ __volatile__("mr 3,%10\n"
> +			     "mr 4,%11\n"
> +			     "mr 5,%12\n"
> +			     "mr 6,%13\n"
> +			     "mr 7,%14\n"
> +			     "mr 8,%15\n"
> +			     "mr 9,%16\n"
> +			     "mr 10,%17\n"
> +			     "mr 11,%18\n"
> +			     "mr 12,%19\n"
> +			     ".long 0x44000022\n"
> +			     "mr %0,3\n"
> +			     "mr %1,4\n"
> +			     "mr %2,5\n"
> +			     "mr %3,6\n"
> +			     "mr %4,7\n"
> +			     "mr %5,8\n"
> +			     "mr %6,9\n"
> +			     "mr %7,10\n"
> +			     "mr %8,11\n"
> +			     "mr %9,12\n":"=r"(regs[0]),
> +			     "=r"(regs[1]), "=r"(regs[2]),
> +			     "=r"(regs[3]), "=r"(regs[4]),
> +			     "=r"(regs[5]), "=r"(regs[6]),
> +			     "=r"(regs[7]), "=r"(regs[8]),
> +			     "=r"(regs[9])
> +			     :"r"(regs[0]), "r"(regs[1]),
> +			     "r"(regs[2]), "r"(regs[3]),
> +			     "r"(regs[4]), "r"(regs[5]),
> +			     "r"(regs[6]), "r"(regs[7]),
> +			     "r"(regs[8]), "r"(regs[9])
> +			     :"r0", "r2", "r3", "r4", "r5", "r6", "r7",
> +			     "r8", "r9", "r10", "r11", "r12", "cc",
> +			     "xer", "ctr", "lr", "cr0", "cr1", "cr5",
> +			     "cr6", "cr7");
> +	*out1 = regs[1];
> +	*out2 = regs[2];
> +	*out3 = regs[3];
> +	*out4 = regs[4];
> +	*out5 = regs[5];
> +	*out6 = regs[6];
> +	*out7 = regs[7];
> +
> +	if (!H_isLongBusy(regs[0]) && regs[0] < 0) {
> +		printk(KERN_ERR "HCALL77_IN r3=%lx r4=%lx r5=%lx r6=%lx "
> +		       "r7=%lx r8=%lx r9=%lx r10=%lx",
> +		       opcode, arg1, arg2, arg3,
> +		       arg4, arg5, arg6, arg7);
> +		printk(KERN_ERR "HCALL77_OUT r3=%lx r4=%lx r5=%lx "
> +		       "r6=%lx r7=%lx r8=%lx r9=%lx r10=%lx ",
> +		       regs[0], regs[1],
> +		       regs[2], regs[3],
> +		       regs[4], regs[5],
> +		       regs[6], regs[7]);
> +	}
> +	return regs[0];
> +}
> +
> +inline static long plpar_hcall_9arg_9ret(unsigned long opcode,
> +					 unsigned long arg1,	/* <R4  */
> +					 unsigned long arg2,	/* <R5  */
> +					 unsigned long arg3,	/* <R6  */
> +					 unsigned long arg4,	/* <R7  */
> +					 unsigned long arg5,	/* <R8  */
> +					 unsigned long arg6,	/* <R9  */
> +					 unsigned long arg7,	/* <R10 */
> +					 unsigned long arg8,	/* <R11 */
> +					 unsigned long arg9,	/* <R12 */
> +					 unsigned long *out1,	/* <R4  */
> +					 unsigned long *out2,	/* <R5  */
> +					 unsigned long *out3,	/* <R6  */
> +					 unsigned long *out4,	/* <R7  */
> +					 unsigned long *out5,	/* <R8  */
> +					 unsigned long *out6,	/* <R9  */
> +					 unsigned long *out7,	/* <R10 */
> +					 unsigned long *out8,	/* <R11 */
> +					 unsigned long *out9	/* <R12 */
> +    )
> +{
> +	unsigned long regs[11] = {opcode,
> +				  arg1, arg2, arg3, arg4, arg5, arg6, arg7,
> +				  arg8, arg9};
> +
> +	__asm__ __volatile__("mr 3,%10\n"
> +			     "mr 4,%11\n"
> +			     "mr 5,%12\n"
> +			     "mr 6,%13\n"
> +			     "mr 7,%14\n"
> +			     "mr 8,%15\n"
> +			     "mr 9,%16\n"
> +			     "mr 10,%17\n"
> +			     "mr 11,%18\n"
> +			     "mr 12,%19\n"
> +			     ".long 0x44000022\n"
> +			     "mr %0,3\n"
> +			     "mr %1,4\n"
> +			     "mr %2,5\n"
> +			     "mr %3,6\n"
> +			     "mr %4,7\n"
> +			     "mr %5,8\n"
> +			     "mr %6,9\n"
> +			     "mr %7,10\n"
> +			     "mr %8,11\n"
> +			     "mr %9,12\n":"=r"(regs[0]),
> +			     "=r"(regs[1]), "=r"(regs[2]),
> +			     "=r"(regs[3]), "=r"(regs[4]),
> +			     "=r"(regs[5]), "=r"(regs[6]),
> +			     "=r"(regs[7]), "=r"(regs[8]),
> +			     "=r"(regs[9])
> +			     :"r"(regs[0]), "r"(regs[1]),
> +			     "r"(regs[2]), "r"(regs[3]),
> +			     "r"(regs[4]), "r"(regs[5]),
> +			     "r"(regs[6]), "r"(regs[7]),
> +			     "r"(regs[8]), "r"(regs[9])
> +			     :"r0", "r2", "r3", "r4", "r5", "r6", "r7",
> +			     "r8", "r9", "r10", "r11", "r12", "cc",
> +			     "xer", "ctr", "lr", "cr0", "cr1", "cr5",
> +			     "cr6", "cr7");
> +	*out1 = regs[1];
> +	*out2 = regs[2];
> +	*out3 = regs[3];
> +	*out4 = regs[4];
> +	*out5 = regs[5];
> +	*out6 = regs[6];
> +	*out7 = regs[7];
> +	*out8 = regs[8];
> +	*out9 = regs[9];
> +
> +	if (!H_isLongBusy(regs[0]) && regs[0] < 0) {
> +		printk(KERN_ERR "HCALL99_IN r3=%lx r4=%lx r5=%lx r6=%lx "
> +		       "r7=%lx r8=%lx r9=%lx r10=%lx "
> +		       "r11=%lx r12=%lx",
> +		       opcode, arg1, arg2, arg3,
> +		       arg4, arg5, arg6, arg7,
> +		       arg8, arg9);
> +		printk(KERN_ERR "HCALL99_OUT r3=%lx r4=%lx r5=%lx "
> +		       "r6=%lx r7=%lx r8=%lx r9=%lx r10=%lx "
> +		       "r11=%lx r12=lx",
> +		       regs[0], regs[1],
> +		       regs[2], regs[3],
> +		       regs[4], regs[5],
> +		       regs[6], regs[7],
> +		       regs[8]);
> +	}
> +	return regs[0];
> +}
> +
> +#endif /* __ASSEMBLY__ */
> +#endif /* __KERNEL__ */
> +#endif
> 
> diff -urN ofed_1_2/kernel_addons/backport/2.6.16_sles10/include/linux/hvcall.h infinipath-drivers/kernel_addons/backport/2.6.16_sles10/include/linux/hvcall.h
> --- ofed_1_2/kernel_addons/backport/2.6.16_sles10/include/linux/hvcall.h	1969-12-31 16:00:00.000000000 -0800
> +++ infinipath-drivers/kernel_addons/backport/2.6.16_sles10/include/linux/hvcall.h	2007-02-12 11:20:29.263255000 -0800
> @@ -0,0 +1,232 @@
> +#ifndef ASM_HVCALL_BACKPORT_2616_H
> +#define ASM_HVCALL_BACKPORT_2616_H
> +
> +#include_next <asm/hvcall.h>
> +
> +#ifdef __KERNEL__
> +
> +#define H_SUCCESS               H_Success
> +#define H_BUSY                  H_Busy
> +#define H_CONSTRAINED           H_Constrained
> +#define H_PAGE_REGISTERED       15
> +
> +#define H_PARAMETER             H_Parameter
> +#define H_NO_MEM                H_NoMem
> +#define H_RESOURCE              H_Resource
> +#define H_HARDWARE              H_Hardware
> +#define H_ADAPTER_PARM          -17
> +#define H_RH_PARM               -18
> +#define H_RT_PARM               -22
> +#define H_MLENGTH_PARM          -27
> +#define H_MEM_PARM              -28
> +#define H_MEM_ACCESS_PARM       -29
> +#define H_ALIAS_EXIST           -39
> +#define H_TABLE_FULL            -41
> +#define H_NOT_ENOUGH_RESOURCES  -44
> +#define H_R_STATE               -45
> +
> +#define H_CB_ALIGNMENT          4096
> +
> +#define H_RESET_EVENTS          0x15C
> +#define H_ALLOC_RESOURCE        0x160
> +#define H_FREE_RESOURCE         0x164
> +#define H_MODIFY_QP             0x168
> +#define H_QUERY_QP              0x16C
> +#define H_REREGISTER_PMR        0x170
> +#define H_REGISTER_SMR          0x174
> +#define H_QUERY_MR              0x178
> +#define H_QUERY_MW              0x17C
> +#define H_QUERY_HCA             0x180
> +#define H_QUERY_PORT            0x184
> +#define H_MODIFY_PORT           0x188
> +#define H_DEFINE_AQP1           0x18C
> +#define H_DEFINE_AQP0           0x194
> +#define H_RESIZE_MR             0x198
> +#define H_ATTACH_MCQP           0x19C
> +#define H_DETACH_MCQP           0x1A0
> +#define H_REGISTER_RPAGES       0x1AC
> +#define H_DISABLE_AND_GETC      0x1B0
> +#define H_ERROR_DATA            0x1B4
> +#define H_QUERY_INT_STATE       0x1E4
> +
> +#define H_LONG_BUSY_ORDER_1_MSEC   H_LongBusyOrder1msec
> +#define H_LONG_BUSY_ORDER_10_MSEC  H_LongBusyOrder10msec
> +#define H_LONG_BUSY_ORDER_100_MSEC H_LongBusyOrder100msec
> +#define H_LONG_BUSY_ORDER_1_SEC    H_LongBusyOrder1sec
> +#define H_LONG_BUSY_ORDER_10_SEC   H_LongBusyOrder10sec
> +#define H_LONG_BUSY_ORDER_100_SEC  H_LongBusyOrder100sec
> +#define H_IS_LONG_BUSY(x) ((x >= H_LongBusyStartRange) && (x <= H_LongBusyEndRange))
> +
> +
> +#ifndef __ASSEMBLY__
> +#include <linux/kernel.h>
> +inline static long plpar_hcall_7arg_7ret(unsigned long opcode,
> +					 unsigned long arg1,    /* <R4  */
> +					 unsigned long arg2,	/* <R5  */
> +					 unsigned long arg3,	/* <R6  */
> +					 unsigned long arg4,	/* <R7  */
> +					 unsigned long arg5,	/* <R8  */
> +					 unsigned long arg6,	/* <R9  */
> +					 unsigned long arg7,	/* <R10 */
> +					 unsigned long *out1,	/* <R4  */
> +					 unsigned long *out2,	/* <R5  */
> +					 unsigned long *out3,	/* <R6  */
> +					 unsigned long *out4,	/* <R7  */
> +					 unsigned long *out5,	/* <R8  */
> +					 unsigned long *out6,	/* <R9  */
> +					 unsigned long *out7	/* <R10 */
> +    )
> +{
> +	unsigned long regs[11] = {opcode,
> +				  arg1, arg2, arg3, arg4, arg5, arg6, arg7};
> +
> +	__asm__ __volatile__("mr 3,%10\n"
> +			     "mr 4,%11\n"
> +			     "mr 5,%12\n"
> +			     "mr 6,%13\n"
> +			     "mr 7,%14\n"
> +			     "mr 8,%15\n"
> +			     "mr 9,%16\n"
> +			     "mr 10,%17\n"
> +			     "mr 11,%18\n"
> +			     "mr 12,%19\n"
> +			     ".long 0x44000022\n"
> +			     "mr %0,3\n"
> +			     "mr %1,4\n"
> +			     "mr %2,5\n"
> +			     "mr %3,6\n"
> +			     "mr %4,7\n"
> +			     "mr %5,8\n"
> +			     "mr %6,9\n"
> +			     "mr %7,10\n"
> +			     "mr %8,11\n"
> +			     "mr %9,12\n":"=r"(regs[0]),
> +			     "=r"(regs[1]), "=r"(regs[2]),
> +			     "=r"(regs[3]), "=r"(regs[4]),
> +			     "=r"(regs[5]), "=r"(regs[6]),
> +			     "=r"(regs[7]), "=r"(regs[8]),
> +			     "=r"(regs[9])
> +			     :"r"(regs[0]), "r"(regs[1]),
> +			     "r"(regs[2]), "r"(regs[3]),
> +			     "r"(regs[4]), "r"(regs[5]),
> +			     "r"(regs[6]), "r"(regs[7]),
> +			     "r"(regs[8]), "r"(regs[9])
> +			     :"r0", "r2", "r3", "r4", "r5", "r6", "r7",
> +			     "r8", "r9", "r10", "r11", "r12", "cc",
> +			     "xer", "ctr", "lr", "cr0", "cr1", "cr5",
> +			     "cr6", "cr7");
> +	*out1 = regs[1];
> +	*out2 = regs[2];
> +	*out3 = regs[3];
> +	*out4 = regs[4];
> +	*out5 = regs[5];
> +	*out6 = regs[6];
> +	*out7 = regs[7];
> +
> +	if (!H_isLongBusy(regs[0]) && regs[0] < 0) {
> +		printk(KERN_ERR "HCALL77_IN r3=%lx r4=%lx r5=%lx r6=%lx "
> +		       "r7=%lx r8=%lx r9=%lx r10=%lx",
> +		       opcode, arg1, arg2, arg3,
> +		       arg4, arg5, arg6, arg7);
> +		printk(KERN_ERR "HCALL77_OUT r3=%lx r4=%lx r5=%lx "
> +		       "r6=%lx r7=%lx r8=%lx r9=%lx r10=%lx ",
> +		       regs[0], regs[1],
> +		       regs[2], regs[3],
> +		       regs[4], regs[5],
> +		       regs[6], regs[7]);
> +	}
> +	return regs[0];
> +}
> +
> +inline static long plpar_hcall_9arg_9ret(unsigned long opcode,
> +					 unsigned long arg1,	/* <R4  */
> +					 unsigned long arg2,	/* <R5  */
> +					 unsigned long arg3,	/* <R6  */
> +					 unsigned long arg4,	/* <R7  */
> +					 unsigned long arg5,	/* <R8  */
> +					 unsigned long arg6,	/* <R9  */
> +					 unsigned long arg7,	/* <R10 */
> +					 unsigned long arg8,	/* <R11 */
> +					 unsigned long arg9,	/* <R12 */
> +					 unsigned long *out1,	/* <R4  */
> +					 unsigned long *out2,	/* <R5  */
> +					 unsigned long *out3,	/* <R6  */
> +					 unsigned long *out4,	/* <R7  */
> +					 unsigned long *out5,	/* <R8  */
> +					 unsigned long *out6,	/* <R9  */
> +					 unsigned long *out7,	/* <R10 */
> +					 unsigned long *out8,	/* <R11 */
> +					 unsigned long *out9	/* <R12 */
> +    )
> +{
> +	unsigned long regs[11] = {opcode,
> +				  arg1, arg2, arg3, arg4, arg5, arg6, arg7,
> +				  arg8, arg9};
> +
> +	__asm__ __volatile__("mr 3,%10\n"
> +			     "mr 4,%11\n"
> +			     "mr 5,%12\n"
> +			     "mr 6,%13\n"
> +			     "mr 7,%14\n"
> +			     "mr 8,%15\n"
> +			     "mr 9,%16\n"
> +			     "mr 10,%17\n"
> +			     "mr 11,%18\n"
> +			     "mr 12,%19\n"
> +			     ".long 0x44000022\n"
> +			     "mr %0,3\n"
> +			     "mr %1,4\n"
> +			     "mr %2,5\n"
> +			     "mr %3,6\n"
> +			     "mr %4,7\n"
> +			     "mr %5,8\n"
> +			     "mr %6,9\n"
> +			     "mr %7,10\n"
> +			     "mr %8,11\n"
> +			     "mr %9,12\n":"=r"(regs[0]),
> +			     "=r"(regs[1]), "=r"(regs[2]),
> +			     "=r"(regs[3]), "=r"(regs[4]),
> +			     "=r"(regs[5]), "=r"(regs[6]),
> +			     "=r"(regs[7]), "=r"(regs[8]),
> +			     "=r"(regs[9])
> +			     :"r"(regs[0]), "r"(regs[1]),
> +			     "r"(regs[2]), "r"(regs[3]),
> +			     "r"(regs[4]), "r"(regs[5]),
> +			     "r"(regs[6]), "r"(regs[7]),
> +			     "r"(regs[8]), "r"(regs[9])
> +			     :"r0", "r2", "r3", "r4", "r5", "r6", "r7",
> +			     "r8", "r9", "r10", "r11", "r12", "cc",
> +			     "xer", "ctr", "lr", "cr0", "cr1", "cr5",
> +			     "cr6", "cr7");
> +	*out1 = regs[1];
> +	*out2 = regs[2];
> +	*out3 = regs[3];
> +	*out4 = regs[4];
> +	*out5 = regs[5];
> +	*out6 = regs[6];
> +	*out7 = regs[7];
> +	*out8 = regs[8];
> +	*out9 = regs[9];
> +
> +	if (!H_isLongBusy(regs[0]) && regs[0] < 0) {
> +		printk(KERN_ERR "HCALL99_IN r3=%lx r4=%lx r5=%lx r6=%lx "
> +		       "r7=%lx r8=%lx r9=%lx r10=%lx "
> +		       "r11=%lx r12=%lx",
> +		       opcode, arg1, arg2, arg3,
> +		       arg4, arg5, arg6, arg7,
> +		       arg8, arg9);
> +		printk(KERN_ERR "HCALL99_OUT r3=%lx r4=%lx r5=%lx "
> +		       "r6=%lx r7=%lx r8=%lx r9=%lx r10=%lx "
> +		       "r11=%lx r12=lx",
> +		       regs[0], regs[1],
> +		       regs[2], regs[3],
> +		       regs[4], regs[5],
> +		       regs[6], regs[7],
> +		       regs[8]);
> +	}
> +	return regs[0];
> +}
> +
> +#endif /* __ASSEMBLY__ */
> +#endif /* __KERNEL__ */
> +#endif

Also: you sure linux/device.h linux/mm.h aren't needed here?

> diff -urN ofed_1_2/kernel_addons/backport/2.6.5_sles9_sp3/include/linux/dma-mapping.h infinipath-drivers/kernel_addons/backport/2.6.5_sles9_sp3/include/linux/dma-mapping.h
> --- ofed_1_2/kernel_addons/backport/2.6.5_sles9_sp3/include/linux/dma-mapping.h	2007-01-23 08:34:31.840413000 -0800
> +++ infinipath-drivers/kernel_addons/backport/2.6.5_sles9_sp3/include/linux/dma-mapping.h	2007-02-13 10:54:58.101125000 -0800
> @@ -1,8 +1,13 @@
> -#ifndef LINUX_DMA_MAPPING_BACKPORT_H
> -#define LINUX_DMA_MAPPING_BACKPORT_H
> +#ifndef _DMA_MAPPING_BACKPORT_H
> +#define _DMA_MAPPING_BACKPORT_H
>  
> -#include <linux/device.h>
> -#include <linux/mm.h>
>  #include_next <linux/dma-mapping.h>
>  
> -#endif
> +static inline int valid_dma_direction(int dma_direction)
> +{
> +	return ((dma_direction == DMA_BIDIRECTIONAL) ||
> +		(dma_direction == DMA_TO_DEVICE) ||
> +		(dma_direction == DMA_FROM_DEVICE));
> +}
> +
> +#endif /* _DMA_MAPPING_BACKPORT_H */

The following looks like it might break mthca - what will provide
pci_disable_msi if you remote it from here?

> diff -urN ofed_1_2/kernel_addons/backport/2.6.5_sles9_sp3/include/linux/pci.h infinipath-drivers/kernel_addons/backport/2.6.5_sles9_sp3/include/linux/pci.h
> --- ofed_1_2/kernel_addons/backport/2.6.5_sles9_sp3/include/linux/pci.h	2007-01-23 08:34:31.916339000 -0800
> +++ infinipath-drivers/kernel_addons/backport/2.6.5_sles9_sp3/include/linux/pci.h	2007-02-13 10:54:58.105121000 -0800
> @@ -9,14 +9,36 @@
>  #define  PCI_EXP_DEVCTL_PAYLOAD	0x00e0	/* Max_Payload_Size */
>  #define PCI_EXP_LNKSTA		18	/* Link Status */
>  
> -struct msix_entry {
> -        u16     vector; /* kernel uses to write allocated vector */
> -        u16     entry;  /* driver uses to specify entry, OS writes */
> -};
> +/*
> + * pci_find_next_capability - Find next capability after current position
> + * @dev: PCI device to query
> + * @pos: Position to search from
> + * @cap: capability code
> + */
> +static inline int pci_find_next_capability(struct pci_dev *dev, u8 pos, int cap)
> +{
> +	u8 id;
> +	int ttl = 48;
> +	int ret;
>  
> -static inline void pci_disable_msi(struct pci_dev* dev) {}
> -static inline void pci_disable_msix(struct pci_dev* dev) {}
> -static inline int pci_enable_msix(struct pci_dev* dev,
> -        struct msix_entry *entries, int nvec) {return -1;}
> +	while (ttl--) {
> +		pci_read_config_byte(dev, pos + PCI_CAP_LIST_NEXT, &pos);
> +		pos &= ~3;
> +		if (pos < 0x40)
> +			break;
> +		pci_read_config_byte(dev, pos + PCI_CAP_LIST_ID, &id);
> +		if (id == 0xff)
> +			break;
> +		if (id == cap) {
> +			ret = pos;
> +			goto bail;
> +		}
> +	}
> +
> +	ret = 0;
> +
> +bail:
> +	return ret;
> +}
>  
>  #endif


-- 
MST




More information about the ewg mailing list