Exemplo n.º 1
0
int LoadWiMaxImage(void)
{	
	DWORD dwImgSize;		
	unsigned long buforder;
	struct file *fp;	
	int read_size = 0;
	
	if ( g_dwLineState == AUTH_MODE)
	{
		fp = klib_fopen(WIMAX_LOADER_PATH, O_RDONLY, 0);	// download mode
	}
	else
	{
		fp = klib_fopen(WIMAX_IMAGE_PATH, O_RDONLY, 0);		// wimax mode
	}

	if(fp)
	{
		if (g_stWiMAXImage.pImage == NULL)	// check already allocated
		{
			g_stWiMAXImage.pImage = (char *) vmalloc(MAX_WIMAXFW_SIZE);

			if(!g_stWiMAXImage.pImage)
			{
				DumpDebug(HARDWARE, "Error: Memory alloc failure");
				klib_fclose(fp);
				return STATUS_UNSUCCESSFUL;
			}
		}
		
		memset(g_stWiMAXImage.pImage, 0, MAX_WIMAXFW_SIZE);
		read_size = klib_flen_fcopy(g_stWiMAXImage.pImage, MAX_WIMAXFW_SIZE, fp);

		g_stWiMAXImage.uiSize = read_size;
		g_stWiMAXImage.uiWorkAddress = CMC730_WIBRO_ADDRESS;
		g_stWiMAXImage.uiOffset = 0;
		g_stWiMAXImage.buforder = buforder;

		klib_fclose(fp);
	}
	else {
		DumpDebug(HARDWARE, "Error: WiMAX image file open failed");
		return STATUS_UNSUCCESSFUL;
	}

	return STATUS_SUCCESS;
}
Exemplo n.º 2
0
void s3c_bat_use_wimax(int onoff)
{
	struct file     *fp;
	fp = klib_fopen(WIMAX_BAT_SYSPATH, O_RDWR, 0);

	if (!fp)
		pr_err("open fail");
    if (onoff)
			klib_fwrite("1", 1, fp);
	else
		klib_fwrite("0", 1, fp);
		klib_fclose(fp);
}
Exemplo n.º 3
0
int load_wimax_image(int mode)
{
	struct file		*fp;
	int				read_size = 0;

	if (mode == AUTH_MODE)	/* download moed */
		fp = klib_fopen(WIMAX_LOADER_PATH, O_RDONLY, 0);
	else
		fp = klib_fopen(WIMAX_IMAGE_PATH, O_RDONLY, 0);	/* wimax mode */

	if (fp) {
		if (g_wimax_image.data == NULL)	{/* check already allocated */
			g_wimax_image.data =
				(u8 *)vmalloc(MAX_WIMAXFW_SIZE);

			if (!g_wimax_image.data) {
				dump_debug("Error: Memory alloc failure");
				klib_fclose(fp);
				return STATUS_UNSUCCESSFUL;
			}
		}

		memset(g_wimax_image.data, 0, MAX_WIMAXFW_SIZE);
		read_size = klib_flen_fcopy(g_wimax_image.data,
				MAX_WIMAXFW_SIZE, fp);

		g_wimax_image.size = read_size;
		g_wimax_image.address = CMC732_WIMAX_ADDRESS;
		g_wimax_image.offset = 0;

		klib_fclose(fp);
	} else {
		dump_debug("Error: WiMAX image file open failed");
		return STATUS_UNSUCCESSFUL;
	}

	return STATUS_SUCCESS;
}
Exemplo n.º 4
0
int	WimaxMode(void)
{
	struct file *fp;
	int mode = -1;

	fp = klib_fopen("/proc/wmxmode/mode", O_RDONLY, 0);
	if(fp != NULL) 
	{
		mode = klib_fgetc(fp);
		DumpDebug(HARDWARE, "Mode = %d", mode);
		klib_fclose(fp);
	}
	else
	{
		DumpDebug(HARDWARE, "Mode access failed!!!");
	}
	return mode;
}
Exemplo n.º 5
0
void cmc7xx_tune_cpu(struct net_adapter *adapter, int onoff)
{
	struct file		*fp2;

	fp2 = klib_fopen(WIMAX_CPU0SCALING_PATH, O_RDWR, 0);

	if (!fp2) {
		dump_debug("open fail");
		return;
	}

	if ((!onoff) && (adapter->cputunedone)) {
			adapter->cputunedone = false;
			klib_fwrite((char *)&adapter->cpu0scaling,
				strlen(adapter->cpu0scaling), fp2);
	} else if ((onoff) && (!adapter->cputunedone)) {
		adapter->cputunedone = true;
		klib_fread((char *)&adapter->cpu0scaling,
			sizeof(adapter->cpu0scaling), fp2);
		klib_fwrite("performance", strlen("performance"), fp2);
	}

	klib_fclose(fp2);
}