From cf3aa9a70ee63bb6d784eda23823a5144cd8c5fd Mon Sep 17 00:00:00 2001 From: leonidk Date: Thu, 25 Sep 2008 14:01:31 +0000 Subject: [PATCH] [MLX4] Enable Event Log writing on DISPATCH_LEVEL The patch replaces a standard buffer conversion function, requiring PASSIVE_LEVEL, by a home-made one, which doesn't. It prevents reported crash upon fatal error handling. git-svn-id: svn://openib.tc.cornell.edu/gen1@1619 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- trunk/hw/mlx4/kernel/bus/core/l2w_debug.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/trunk/hw/mlx4/kernel/bus/core/l2w_debug.c b/trunk/hw/mlx4/kernel/bus/core/l2w_debug.c index 60843030..c2dd7a24 100644 --- a/trunk/hw/mlx4/kernel/bus/core/l2w_debug.c +++ b/trunk/hw/mlx4/kernel/bus/core/l2w_debug.c @@ -107,6 +107,16 @@ Return Value: } /* WriteEventLogEntry */ +// bsize is to be a strlen(src) +// dest has to have enough place, i.e at least (2*strlen(src) + 2) +void __ansi_to_wchar( USHORT *dest, UCHAR *src, int bsize) +{ + int i; + + for (i=0; ipdev->p_self_do, (ULONG)EVENT_MLX4_ANY_ERROR, 0, 0, wbuf, 0, 0 ); + // print to Event Log + __ansi_to_wchar( wbuf, buf, (int)strlen((void*)buf) ); + WriteEventLogEntryStr( mdev->pdev->p_self_do, (ULONG)EVENT_MLX4_ANY_ERROR, 0, 0, wbuf, 0, 0 ); } VOID -- 2.46.0