[PATCH] wimax-network-service: 64-bit fixes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm trying to get the 1.5 stack working on 64-bit Ubuntu Maverick (10.10) using the stock kernel (2.6.35-22) with my 5150 card.  I previously had the 1.4 stack working fine in 64-bit Lucid.

This patch fixes the compilation errors reported by Dongwoon Hahn and Peter Lavee back in July, the segfaults reported by Alexey Shvetsov in the same thread, and gets rid of lots of compiler warnings.

However, I'm still not able to actually use the card ... wimaxll works fine:
$ wimaxll -i wmx0 rfkill
rfkill status is 0x3 (HW on SW on)
$ wimaxll -i wmx0 state-get
ready
$

'wimaxd -d -i wmx0' starts up, says:
AppSrv is ready !
Act_FullRestart!
Act_DriverDeviceStatus - DRIVER_UP
and shows driver messages if I hit 'd'

But wimaxcu and wimax_monitor don't work:
$ wimaxcu status
ERROR: Make sure WiMAX Network Service is running.
$ # (wimaxd shows connections coming in, so I know wimaxcu and wimaxd are communicating)
$ wimax_monitor 
[2010/10/02 09:50:28]  MESSAGE   WIMAX DAEMON IS READY
[2010/10/02 09:50:28]  MESSAGE   WIMAX DAEMON IS NOT READY
[2010/10/02 09:50:28]  MESSAGE   WIMAX DAEMON IS READY
[2010/10/02 09:50:28]  ERROR     Failed to update the device status
[2010/10/02 09:50:28]  ERROR     Failed to update the system state
[2010/10/02 09:50:31]  ERROR     Failed to update the device status
[2010/10/02 09:50:31]  ERROR     Failed to update the system state
[2010/10/02 09:50:31]  MESSAGE   WIMAX DAEMON IS NOT READY

I'll continue working on it, but I figured it was worth reporting my progress thus far.

-Paul

On Sat, Oct 02, 2010 at 09:35:57AM -0400, Paul Donohue wrote:
> Correct assorted 64-bit issues.
> 
> Signed-off-by: Paul Donohue <wimax at PaulSD.com>
> 
> diff --git a/InfraStack/OSAgnostic/Common/L4Common/SourceControl/BitmanCommon.h b/InfraStack/OSAgnostic/Common/L4Common/SourceControl/BitmanCommon.h
> index bdb48dc..874df35 100644
> --- a/InfraStack/OSAgnostic/Common/L4Common/SourceControl/BitmanCommon.h
> +++ b/InfraStack/OSAgnostic/Common/L4Common/SourceControl/BitmanCommon.h
> @@ -67,6 +67,10 @@
>  #define MASK_1 (0xFFFFFFFFFFFFFFFF)
>  #define MASK_2 (0xFFFFFFFFFFFFFFFE)
>  #define MASK_4 (0xFFFFFFFFFFFFFFFC)
> +#elif __x86_64__
> +#define MASK_1 (0xFFFFFFFFFFFFFFFF)
> +#define MASK_2 (0xFFFFFFFFFFFFFFFE)
> +#define MASK_4 (0xFFFFFFFFFFFFFFFC)
>  #else
>  #define MASK_1 (0xFFFFFFFF)
>  #define MASK_2 (0xFFFFFFFE)
> diff --git a/InfraStack/OSAgnostic/Common/L4Common/SourceControl/CommonTypes.h b/InfraStack/OSAgnostic/Common/L4Common/SourceControl/CommonTypes.h
> index b410c38..f8aba19 100644
> --- a/InfraStack/OSAgnostic/Common/L4Common/SourceControl/CommonTypes.h
> +++ b/InfraStack/OSAgnostic/Common/L4Common/SourceControl/CommonTypes.h
> @@ -91,6 +91,8 @@ typedef const char*	PCSTR;
>  /// when you need to hold both a pointer and a number
>  #ifdef WIN64
>  typedef UINT64 POINTER_AND_UINT;
> +#elif __x86_64__
> +typedef UINT64 POINTER_AND_UINT;
>  #else
>  typedef UINT POINTER_AND_UINT;
>  #endif
> diff --git a/InfraStack/OSDependent/Linux/InfraStackModules/Skeletons/AppSrv/GenericConsole.c b/InfraStack/OSDependent/Linux/InfraStackModules/Skeletons/AppSrv/GenericConsole.c
> index 69cab00..abc22e5 100644
> --- a/InfraStack/OSDependent/Linux/InfraStackModules/Skeletons/AppSrv/GenericConsole.c
> +++ b/InfraStack/OSDependent/Linux/InfraStackModules/Skeletons/AppSrv/GenericConsole.c
> @@ -118,8 +118,13 @@ void print_callstack_to_file(int sig, siginfo_t *info, void *secret)
>  	}
>  	strcat(gcLogFilePathName, "/callstack.log");
>  	if(OSAL_fopen(&fp, gcLogFilePathName, "a", 0) < 0) {
> +#ifdef __x86_64__
> +		syslog(LOG_ERR, "Got signal %d, faulty address is %p, from %p", 
> +		       sig, info->si_addr, uc->uc_mcontext.gregs[REG_RIP]);
> +#else
>  		syslog(LOG_ERR, "Got signal %d, faulty address is %p, from %p", 
>  		       sig, info->si_addr, uc->uc_mcontext.gregs[REG_EIP]);
> +#endif
>  		syslog(LOG_ERR, "Could not open a file %s to log call stack");
>  		// printf("Came here %d\n", __LINE__);
>    		return;
> @@ -137,13 +142,22 @@ void print_callstack_to_file(int sig, siginfo_t *info, void *secret)
>  	fprintf(fp, "Use the function name and offset to function and search file above for the line no \n");
>  	fprintf(fp, "==================================================================================\n\n");
>  	
> +#ifdef __x86_64__
> +	fprintf(fp, "Got signal %d, faulty address is %p, from %p\n", 
> +		sig, info->si_addr, uc->uc_mcontext.gregs[REG_RIP]);
> +#else
>  	fprintf(fp, "Got signal %d, faulty address is %p, from %p\n", 
>  		sig, info->si_addr, uc->uc_mcontext.gregs[REG_EIP]);
> +#endif
>  	// printf("Came here %d\n", __LINE__);
>    	
>    	trace_size = backtrace(trace, 16);
>    	/* overwrite sigaction with caller's address */
> +#ifdef __x86_64__
> +  	trace[1] = (void *) uc->uc_mcontext.gregs[REG_RIP];
> +#else
>    	trace[1] = (void *) uc->uc_mcontext.gregs[REG_EIP];
> +#endif
>  	
>    	messages = backtrace_symbols(trace, trace_size);
>    	/* skip first stack frame (points here) */
> diff --git a/InfraStack/OSDependent/Linux/OSAL/Primitives/wimax_osal_basictypes.h b/InfraStack/OSDependent/Linux/OSAL/Primitives/wimax_osal_basictypes.h
> index 1085c4b..f13fade 100644
> --- a/InfraStack/OSDependent/Linux/OSAL/Primitives/wimax_osal_basictypes.h
> +++ b/InfraStack/OSDependent/Linux/OSAL/Primitives/wimax_osal_basictypes.h
> @@ -39,6 +39,7 @@
>  #include <string.h>
>  #include <ctype.h>
>  #include <sys/stat.h>
> +#include <pthread.h>
>  
>  #if 0
>  #include <sys/socket.h>
> @@ -90,7 +91,7 @@ typedef void* OSAL_critical_section;
>  
>  typedef int pid_t;
>  
> -typedef int OSAL_thread_t;
> +typedef pthread_t OSAL_thread_t;
>  
>  typedef void * OSAL_event_t;
>  
> _______________________________________________
> wimax mailing list
> wimax at linuxwimax.org
> http://lists.linuxwimax.org/listinfo/wimax
> 


[Index of Archives]     [Linux Kernel]     [Linux Wireless]     [Linux Bluetooth]     [Linux Netdev]     [Linux Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux