示例#1
0
// sangam dbg : used by the set and query info but linux not supported
// is adapter halted?
BOOLEAN adpIsHalted(PMINIPORT_ADAPTER Adapter)
{
    int		i;
    PMINIPORT_ADAPTER*	p = g_Adapters;

	ENTER;
    // check first one
    if (*p == Adapter) {
	// found
		if (g_HaltedFlags[0]) {
		    DumpDebug(HARDWARE, " Adapter (%lu, 0) halted: YES", (unsigned long)Adapter);
		}
		return g_HaltedFlags[0];
    }

    p++;
    // check others
    for (i = 1; i < ADAPTER_MAX_NUMBER; i++, p++) {
	if (*p == Adapter) {
	    // found
	    if (g_HaltedFlags[i]) {
			DumpDebug(HARDWARE, " Adapter (%lu, %d) halted: YES", (unsigned long)Adapter, i);
	    }
	    return g_HaltedFlags[i];
	}
    }
    DumpDebug(HARDWARE, "Adapter (%lu) halted (removed): YES", (unsigned long)Adapter);

    // not found, assume that it was removed already
    return TRUE;
}
示例#2
0
VOID hwRemove(MINIPORT_ADAPTER *Adapter)
{
	PBUFFER_DESCRIPTOR  dsc;
    ENTER;

	//sangam :Free the pending data packets and control packets
	while(!QueueEmpty(Adapter->hw.Q_Send.Head)) {	//sangam dbg : used only for data packet so free skb
		DumpDebug(DISPATCH, "<1> Freeing Q_Send");
		dsc = (PBUFFER_DESCRIPTOR) QueueGetHead(Adapter->hw.Q_Send.Head);
		if (!dsc) {
			DumpDebug(DISPATCH, "<1> Fail...node is null");
			continue;
		}
		QueueRemoveHead(Adapter->hw.Q_Send.Head);
		if(dsc->Buffer)
			kfree(dsc->Buffer);
		if(dsc)
			kfree(dsc);
	}
	// stop data out buffer
//	if (Adapter->hw.ReceiveBuffer!= NULL) 
//			kfree(Adapter->hw.ReceiveBuffer);
	// stop TempData out buffer
#if 0	//cky 20100624
	if (Adapter->hw.ReceiveTempBuffer!= NULL) 
			kfree(Adapter->hw.ReceiveTempBuffer);
#endif

	hwGPIODeInit();	
	LEAVE;
}
示例#3
0
void
DoConvolution(FFT_DATA_TYPE *FFTNum,int Cache,size_t Len2)
{
StartTimer(ConvTime);
if (Cache==-2) /* In memory convolution of both nums */
  {FFT_DATA_TYPE *FFTNum2=FFTNum+Len2;
   DumpDebug("Cm...");
   DoScrambledFHTConv(FFTNum,FFTNum2,Len2);
  }
else if (Cache==-1)  /* In memory self convolution. */
  {
   DumpDebug("C");
   DoScrambledFHTConv(FFTNum,FFTNum,Len2);
  }
#ifdef VIRTUAL_CACHE
else /* Virtual Mem based convolution. */
  {FFT_DATA_TYPE *Num1=FFTNum;
   FFT_DATA_TYPE *Num2=FFTCash[Cache].Mem;

   if (Num2==NULL)
     FatalError("Cache %d doesn't exist.\n",Cache);

   DumpDebug("C%d...",Cache);
   DoScrambledFHTConv(Num1,Num2,Len2);
  }
#else
#error
#if 0
/*
** Eyuk!  What a kludge!
*/
else
  {FILE *f;FFT_DATA_TYPE h1p,h1m;
示例#4
0
static void
localFreeOffscreenLinear(FBLinearPtr linear)
{
    FBManagerPtr offman;
    FBLinearLinkPtr pLink, pLinkPrev = NULL;
    ScreenPtr pScreen = linear->pScreen;

    offman = (FBManagerPtr) dixLookupPrivate(&pScreen->devPrivates,
                                             xf86FBScreenKey);
    pLink = offman->LinearAreas;
    if (!pLink)
        return;

    while (&(pLink->linear) != linear) {
        pLinkPrev = pLink;
        pLink = pLink->next;
        if (!pLink)
            return;
    }

    if (pLink->area) {          /* really an XY area */
        DebugF("FREEING AREA\n");
        localFreeOffscreenArea(pLink->area);
        if (pLinkPrev)
            pLinkPrev->next = pLink->next;
        else
            offman->LinearAreas = pLink->next;
        free(pLink);
        DumpDebug(offman->LinearAreas);
        return;
    }

    pLink->free = 1;

    if (pLink->next && pLink->next->free) {
        FBLinearLinkPtr p = pLink->next;

        pLink->linear.size += p->linear.size;
        pLink->next = p->next;
        free(p);
    }

    if (pLinkPrev) {
        if (pLinkPrev->next && pLinkPrev->next->free && !pLinkPrev->area) {
            FBLinearLinkPtr p = pLinkPrev->next;

            pLinkPrev->linear.size += p->linear.size;
            pLinkPrev->next = p->next;
            free(p);
        }
    }

    DebugF("FREEING LINEAR\n");
    DumpDebug(offman->LinearAreas);
}
示例#5
0
void hwSetInterface()
{
	ENTER;

	g_dwLineState = WimaxMode();

	s3c_gpio_cfgpin(WIMAX_WAKEUP, S3C_GPIO_SFN(1));
	s3c_gpio_cfgpin(WIMAX_IF_MODE0, S3C_GPIO_SFN(1));

	if(g_dwLineState == SDIO_MODE)
	{	
		gpio_set_value(WIMAX_WAKEUP, GPIO_LEVEL_HIGH);
		gpio_set_value(WIMAX_IF_MODE0, GPIO_LEVEL_HIGH);

		msleep(10);

		DatadwValue = 1;
		ControldwValue = 1;
		DumpDebug(HARDWARE, "Interface mode SDIO_MODE");
	}
	else if(g_dwLineState == WTM_MODE || g_dwLineState == AUTH_MODE)
	{
		gpio_set_value(WIMAX_WAKEUP, GPIO_LEVEL_LOW);
		gpio_set_value(WIMAX_IF_MODE0, GPIO_LEVEL_LOW);

		msleep(10);
		
		DatadwValue = 0;
		ControldwValue = 0;
		DumpDebug(HARDWARE, "Interface mode WTM_MODE || AUTH_MODE");
	}
	else if(g_dwLineState == DM_MODE)
	{
		gpio_set_value(WIMAX_WAKEUP, GPIO_LEVEL_HIGH);
		gpio_set_value(WIMAX_IF_MODE0, GPIO_LEVEL_LOW);

		msleep(10);

		DumpDebug(HARDWARE, "Interface mode DM_MODE");
	}
	else if(g_dwLineState == USB_MODE || g_dwLineState ==  USIM_RELAY_MODE)
	{
		gpio_set_value(WIMAX_WAKEUP, GPIO_LEVEL_LOW);
		gpio_set_value(WIMAX_IF_MODE0, GPIO_LEVEL_HIGH);

		msleep(10);

		DatadwValue = 1;
		ControldwValue = 0;
		DumpDebug(HARDWARE, "Interface mode USB_MODE (USIM_RELAY)");
	}

	LEAVE;
}
示例#6
0
INT hwInit(MINIPORT_ADAPTER *Adapter)
{
	ENTER;

	static PVOID ReceiveBuffer = NULL;	//cky 20100624
	if(!hwGPIOInit())
	{
		DumpDebug(DISPATCH, "hwInit: Can't intialize GPIO");
		return STATUS_UNSUCCESSFUL;
	}

	if (ReceiveBuffer == NULL)
	{
		DumpDebug(DISPATCH, "Alloc ReceiveBuffer");
		ReceiveBuffer = kmalloc(SDIO_BUFFER_SIZE+8, GFP_KERNEL); //sumanth: the extra space required to copy ethernet header
		if (ReceiveBuffer == NULL)
		{
			DumpDebug(DISPATCH, "kmalloc fail!!");
			return -ENOMEM;
		}
	}
	else
	{
		DumpDebug(DISPATCH, "ReceiveBuffer already allocated - skip");
	}

	memset(&Adapter->hw,0,sizeof(HARDWARE_INFO));
/*	Adapter->hw.ReceiveBuffer= kmalloc(SDIO_BUFFER_SIZE, GFP_ATOMIC);
	if(Adapter->hw.ReceiveBuffer ==NULL) {
		return -ENOMEM;
	}*/ //sumanth: this buffer is not logically required hence it is eliminated
#if 1	//cky 20100624
	Adapter->hw.ReceiveTempBuffer = ReceiveBuffer;
#else
	Adapter->hw.ReceiveTempBuffer= kmalloc(SDIO_BUFFER_SIZE+8, GFP_ATOMIC); //sumanth: the extra space required to copy ethernet header
	if(Adapter->hw.ReceiveTempBuffer ==NULL) {
//			if(Adapter->hw.ReceiveBuffer)			//sumanth no point in freeing a NULL pointer
//				kfree(Adapter->hw.ReceiveTempBuffer);
		return -ENOMEM;
	}
#endif
	// For sending data and control packets
	QueueInitList(Adapter->hw.Q_Send.Head);
	spin_lock_init(&Adapter->hw.Q_Send.Lock);
	
	INIT_WORK(&Adapter->work, hwTransmitThread);
	init_waitqueue_head(&Adapter->hFWDNEndEvent);

	init_completion(&Adapter->hAwakeAckEvent);
	
	return STATUS_SUCCESS;
	LEAVE;
}
示例#7
0
void controlRemove(PMINIPORT_ADAPTER Adapter)
{
	PCONTROL_PROCESS_DESCRIPTOR process;
	PBUFFER_DESCRIPTOR dsc;
    ENTER;

	// Free the received control packets queue
	while(!QueueEmpty(Adapter->ctl.Q_Received.Head)) 
	{		
	 // queue is not empty
		DumpDebug(DISPATCH, "<1> Freeing Control Receive Queue");
		dsc = (PBUFFER_DESCRIPTOR)QueueGetHead(Adapter->ctl.Q_Received.Head);
		if (!dsc) {
			DumpDebug(DISPATCH, "<1> Fail...node is null");
			continue;
		}
		QueueRemoveHead(Adapter->ctl.Q_Received.Head);
		--Adapter->stats.tx.Control;
		if(dsc->Buffer)
			kfree(dsc->Buffer);
		if(dsc)
			kfree(dsc);
	}
	// process list	
	// sangam : appln read indicates error status -ENODEV
	if(Adapter->ctl.Apps.Inited) {
		if(!QueueEmpty(Adapter->ctl.Apps.ProcessList)) {	
			// first time gethead needed to get the dsc nodes
			process = (PCONTROL_PROCESS_DESCRIPTOR) QueueGetHead(Adapter->ctl.Apps.ProcessList);	
			while (process != NULL)	{
				if(process->Irp) {	// sangam : process read waiting
					process->Irp = FALSE;
					wake_up_interruptible(&process->read_wait);
				}
				process = (PCONTROL_PROCESS_DESCRIPTOR)process->Node.next;
				DumpDebug (TX_CONTROL,"sangam dbg : waking processes");
			}
	//*************** SANGAM check if needed *****************************
/*	
   			while(!QueueEmpty(Adapter->ctl.Apps.ProcessList)) 	
				DumpDebug (TX_CONTROL,"still waiting for process close");
				msleep(1);
			}
*/
		msleep(100);	//delay for the process release
		}
	}
	Adapter->ctl.Apps.Inited = FALSE;

	LEAVE;
	return;
}
示例#8
0
/* get MAC address from device */
VOID GetMacAddress(MINIPORT_ADAPTER *Adapter)
{
	UINT nCount = 0;
	int nResult = 0;
	HW_PRIVATE_PACKET req; 
	ENTER;

	req.Id0   = 'W';
	req.Id1   = 'P';
	req.Code  = HwCodeMacRequest;
	req.Value = 0;
	Adapter->acquired_mac_address = FALSE;
	
	do {
		if(Adapter->bHaltPending)
			return;

		sdio_claim_host(Adapter->func);
		//nResult = sdio_memcpy_toio(Adapter->func,SDIO_DATA_PORT_REG, &req, sizeof(HW_PRIVATE_PACKET));
		nResult = sd_send(Adapter, &req, sizeof(HW_PRIVATE_PACKET));
		
		if(nResult != 0) 
			DumpDebug(DRV_ENTRY,"Send GetMacAddress Request msg but error occurred!! res = %d",nResult);

		sdio_release_host(Adapter->func);

		if(!wait_for_completion_interruptible_timeout(&Adapter->hFWInitCompleteEvent, msecs_to_jiffies(HARDWARE_START_TIMEOUT))) {
			DumpDebug(DRV_ENTRY, "timedout mac req, retry..");

			if(nCount >= HARDWARE_MAX_MAC_RESPONSES || Adapter->bHaltPending == TRUE) {
				DumpDebug(DRV_ENTRY,"Can't get mac address, exceeded number of retries (%d)",nCount);
				Adapter->bHaltPending = TRUE;
				wake_up_interruptible(&Adapter->hFWDNEndEvent);
				gpio_wimax_poweroff();
				gpio_wimax_poweron();
				break;
			}
			nCount++;
			continue;
		}
		// If wait exit before timeout then mac assigned or surprise remove
		if(Adapter->acquired_mac_address == TRUE) {
			DumpDebug(DRV_ENTRY,"MAC Address acquired");
			break;
		}
//		msleep(500);
	
	} while(TRUE);

	return;
	LEAVE;
}
示例#9
0
static void
DoConvolutions(int Cache,size_t FFTLen2,size_t StartP, size_t EndP)
{size_t Pass;
 ModInt *Num1,*Num2;

StartTimer(ConvTime);
if (Cache==-2) /* In memory convolution of both nums */
  {ModInt *FFTNum2=FFTNum+FFTLen2*NPrimes;
   DumpDebug("Cm...");
   for (Pass=StartP;Pass < EndP;Pass++)
     {
      SetModPrime(Pass);
      Num1=FFTNum+FFTLen2*(Pass-StartP);
      Num2=FFTNum2+FFTLen2*(Pass-StartP);
      PrepVector(Prime,FFTLen2);
      VectorModMul( Num1, Num2, FFTLen2);
     }
  }
else if (Cache==-1)  /* In memory self convolution. */
  {
   DumpDebug("C");
   for (Pass=StartP;Pass < EndP;Pass++)
     {
      SetModPrime(Pass);
      Num1=FFTNum+FFTLen2*(Pass-StartP);
      PrepVector(Prime,FFTLen2);
      VectorModMul( Num1, Num1, FFTLen2);
     }
  }
#ifdef VIRTUAL_CACHE
else /* Virtual Mem based convolution. */
  {
   Num1=FFTNum;
   Num2=(ModInt*)FFTCash[Cache].Mem;

   if (Num2==NULL)
     FatalError("Cache %d doesn't exist.\n",Cache);

   DumpDebug("C%d...",Cache);
   for (Pass=StartP;Pass < EndP;Pass++)
     {
      SetModPrime(Pass);
      PrepVector(Prime,FFTLen2);
      VectorModMul( Num1, Num2, FFTLen2);
      Num1+=FFTLen2;Num2+=FFTLen2;
     }
  }
#else
else /* Disk based convolution. */
  {FILE *f;
示例#10
0
// receive control data
VOID controlReceive(MINIPORT_ADAPTER   *Adapter, void *Buffer, unsigned long Length)
{
    PCONTROL_ETHERNET_HEADER    hdr;
	unsigned long flags;

	ENTER;
#if 1	// rx control frame
		if (isDumpEnabled()) {
			// dump packets
			UINT i, l = Length;
			u_char *  b = (u_char *)Buffer;
			DumpDebug(READ_REG, "Recv packet control [%d] = ", l);

			printk("<1>\x1b[1;33m[WiMAX]");
			for (i = 0; i < Length; i++) {
				printk(" %02x", b[i]);
				if (((i + 1) != Length) && (i % 16 == 15))
				{
					printk("\x1b[0m\n<1>\x1b[1;33m[WiMAX]");
				}
			}
			printk("\x1b[0m\n");
		}
#endif

    // check halt flag
    if (Adapter->bHaltPending) {
		return;
    }

    hdr = (PCONTROL_ETHERNET_HEADER)Buffer;
#if 1	//cky 20100311 him relay
	//cky test
	if (hdr->Type == 0x2115)	// relay type
	{
		DumpDebug(TX, "recv: 0x1521 -> 0x1500");
		hdr->Type = 0x15;
	}
#endif

    spin_lock_irqsave(&Adapter->ctl.Q_Received.Lock, flags); 
    
	// not found, add to pending buffers list
	controlEnqueueReceivedBuffer(Adapter, hdr->Type, Buffer, Length);

//	spin_unlock_irqrestore(&Adapter->Control.Lock, flags);
	spin_unlock_irqrestore(&Adapter->ctl.Q_Received.Lock, flags);
	LEAVE;
}
示例#11
0
static int proc_write_sleepmode(struct file *foke, const char *buffer, unsigned long count, void *data)
{
	if (buffer[0] == '0' && g_dwSleepMode == 1)
	{
		DumpDebug("WiMAX Sleep Mode: VI");
		g_dwSleepMode = 0;
	}
	else if (buffer[0] == '1' && g_dwSleepMode == 0)
	{
		DumpDebug("WiMAX Sleep Mode: IDLE");
		g_dwSleepMode = 1;
	}

	return 0;
}
示例#12
0
BOOLEAN SendCmdPacket(PMINIPORT_ADAPTER Adapter, unsigned short uiCmdId)
{
	PHW_PACKET_HEADER pPktHdr;
	UCHAR pTxPkt[CMD_MSG_TOTAL_LENGTH];
	UINT uiBufOffset;
	PWIMAX_MESSAGE_HEADER pWibroMsgHdr;
	int status = 0;
	UINT dwTxSize;

	pPktHdr = (PHW_PACKET_HEADER)pTxPkt;
	pPktHdr->Id0 = 'W';
	pPktHdr->Id1 = 'C';	
	pPktHdr->Length = be16_to_cpu(CMD_MSG_TOTAL_LENGTH); 

	uiBufOffset = sizeof(HW_PACKET_HEADER);
	pWibroMsgHdr = (PWIMAX_MESSAGE_HEADER)(pTxPkt + uiBufOffset);
	pWibroMsgHdr->MsgType = be16_to_cpu(ETHERTYPE_DL);
	pWibroMsgHdr->MsgID = be16_to_cpu(uiCmdId);	
	pWibroMsgHdr->MsgLength = be32_to_cpu(CMD_MSG_LENGTH);
		
	dwTxSize = CMD_MSG_TOTAL_LENGTH;

	status = sd_send(Adapter, pTxPkt, dwTxSize);
	if(status != STATUS_SUCCESS) {
		// crc error or data error - set PCWRT '1' & send current type A packet again		
		DumpDebug(FW_DNLD, "hwSdioWrite : crc error");
		return status;//goto rewrite;
	}
	return status;
}
示例#13
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;
}
示例#14
0
INT hwStart(MINIPORT_ADAPTER *Adapter)
{
	ENTER;

	if(LoadWiMaxImage())
			return STATUS_UNSUCCESSFUL;
	
	Adapter->WibroStatus = WIBRO_STATE_READY;
	Adapter->IPRefreshing = FALSE;
	Adapter->bFWDNEndFlag = FALSE;
	
	if(Adapter->DownloadMode)
	{
//		wimax_download_start_time = jiffies;
		sdio_claim_host(Adapter->func);
		SendCmdPacket(Adapter, MSG_DRIVER_OK_REQ);
		sdio_release_host(Adapter->func);
		switch( wait_event_interruptible_timeout(Adapter->hFWDNEndEvent, (Adapter->bFWDNEndFlag == TRUE), msecs_to_jiffies(FWDOWNLOAD_TIMEOUT*wimax_timeout_multiplier) ) ) 
		{
			// timeout
			case 0:
				Adapter->bHaltPending = TRUE;
				DumpDebug(HARDWARE, "Error hwStart :  F/W Download timeout failed");
				return STATUS_UNSUCCESSFUL;
			
			// Interrupted by signal
			case -ERESTARTSYS:
				DumpDebug(HARDWARE, "Error hwStart :  -ERESTARTSYS retry");
				return STATUS_UNSUCCESSFUL;

			// normal condition check	
			default:
				if (Adapter->SurpriseRemoval == TRUE || Adapter->bHaltPending == TRUE)
				{							
					DumpDebug(HARDWARE, "Error hwStart :  F/W Download surprise removed");
					return STATUS_UNSUCCESSFUL;
				}
				DumpDebug(HARDWARE, "hwStart :  F/W Download Complete");
				break;
		}
		Adapter->DownloadMode = FALSE;
	}

	LEAVE;
	return STATUS_SUCCESS;
}
示例#15
0
BOOLEAN controlIsWakeupPacket(MINIPORT_ADAPTER *Adapter, void *Buffer, unsigned long Length)
{
	PCONTROL_ETHERNET_HEADER hdr = (PCONTROL_ETHERNET_HEADER)Buffer; 
	ENTER;

	if(Length < sizeof (CONTROL_ETHERNET_HEADER))
	{
		DumpDebug (TX_CONTROL,"Packet is too short");
		return FALSE;
	}
	if (hdr->Type == CONTROL_ETH_TYPE_WCM)
	{
		DumpDebug (TX_CONTROL,"Wakeup Control Packet");
		return TRUE;
	}
	LEAVE;
	return FALSE;
}
示例#16
0
static int proc_read_dump(char *page, char **start, off_t off, int count, int *eof, void *data)
{
	DumpDebug("CONTROL_IOCTL_WIMAX_CHECK_CAL");
	gpio_wimax_poweroff();

	//WIMAX_Check_Cal();
	
	return 0;
}
示例#17
0
void DumpMemConfig(FRConfig * Config, const char * Conf)
{
	FILE * ConfigFile = fopen(Conf,"w");
	DumpDebug(&Config->Debug,ConfigFile);
	DumpPreferences(&Config->Preferences,ConfigFile);
	DumpSound(&Config->Sound,ConfigFile);
	DumpSystem(&Config->System,ConfigFile);
	fclose(ConfigFile);
}
示例#18
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;
}
示例#19
0
VOID hwGetMacAddressThread(VOID *data)
{
	PMINIPORT_ADAPTER Adapter = (MINIPORT_ADAPTER *)data;
	ENTER;

	DumpDebug(TX, "Wait for SDIO ready...");
	msleep(2000);	//cky 20100525 important; wait for cmc730 can handle mac req packet
	
	GetMacAddress(Adapter);
	LEAVE;
}
示例#20
0
INT	hwDeviceWakeup(PMINIPORT_ADAPTER pAdapter)
{
	CHAR str[] = "WAKE";
	UCHAR	nCount = 0;
	int nRet = 0;
	
	ENTER;
	do {
		nRet = sdio_memcpy_toio(pAdapter->func, SDIO_DATA_PORT_REG, str, 4);	
		nCount++;
		DumpDebug(HARDWARE, "device wakeup fail..");
	}while((nRet) && (!pAdapter->bHaltPending) && (nCount < HARDWARE_WAKE_MAX_COUNTER) );

	if(nRet) {
		DumpDebug(HARDWARE, "Retry wake-up sequence");
		msleep(HARDWARE_WAKEUP_TIMEOUT);
	}
	LEAVE;
	return nRet;
}
示例#21
0
void UnLoadWiMaxImage(void)
{
	ENTER;
	if(g_stWiMAXImage.pImage != NULL)
	{
		DumpDebug(HARDWARE, "Delete the Image Loaded");
		vfree(g_stWiMAXImage.pImage);
		g_stWiMAXImage.pImage = NULL;
	}
	LEAVE;
}
示例#22
0
static void DumpFunction(const ktap_proto *f, DumpState *D)
{
	DumpInt(f->linedefined, D);
	DumpInt(f->lastlinedefined, D);
	DumpChar(f->numparams, D);
	DumpChar(f->is_vararg, D);
	DumpChar(f->maxstacksize, D);
	DumpCode(f, D);
	DumpConstants(f, D);
	DumpUpvalues(f, D);
	DumpDebug(f, D);
}
示例#23
0
static int proc_write_dump(struct file *foke, const char *buffer, unsigned long count, void *data)
{
	if (buffer[0] == '0')
	{
		if (isDumpEnabled())
		{
			DumpDebug("Control Dump Disabled.");
			g_dumpLogs = 0;
		}
	}
	else if (buffer[0] == '1')
	{
		if (!isDumpEnabled())
		{
			DumpDebug("Control Dump Enabled.");
			g_dumpLogs = 1;
		}
	}

	return 0;
}
示例#24
0
static void DumpFunction(const Proto* f, const TString* p, DumpState* D)
{
    DumpString((f->source==p || D->strip) ? NULL : f->source,D);
    DumpInt(f->linedefined,D);
    DumpInt(f->lastlinedefined,D);
    DumpChar(f->nups,D);
    DumpChar(f->numparams,D);
    DumpChar(f->is_vararg,D);
    DumpChar(f->maxstacksize,D);
    DumpCode(f,D);
    DumpConstants(f,D);
    DumpDebug(f,D);
}
示例#25
0
文件: ldump.c 项目: oss-forks/lua
static void DumpFunction(const Proto* f, DumpState* D)
{
 int i;
 DumpInt(f->linedefined,D);
 DumpInt(f->lastlinedefined,D);
 DumpChar(f->numparams,D);
 DumpChar(f->is_vararg,D);
 DumpChar(f->maxstacksize,D);
 DumpInt(f->sizecode,D);
 for (i=0; i<f->sizecode; i++) DumpUInt(f->code[i],D);
 DumpConstants(f,D);
 DumpUpvalues(f,D);
 DumpDebug(f,D);
}
示例#26
0
// add received packet to pending list
VOID controlEnqueueReceivedBuffer(MINIPORT_ADAPTER *Adapter, USHORT Type, PVOID Buffer, ULONG Length) 
{
    PBUFFER_DESCRIPTOR  dsc;
	PCONTROL_PROCESS_DESCRIPTOR process;

	ENTER;
	// Queue and wake read only if process exist.
	process = controlFindProcessByType(Adapter,Type);
	if(process) {
		dsc = (PBUFFER_DESCRIPTOR)kmalloc(sizeof(BUFFER_DESCRIPTOR),GFP_ATOMIC);
		if(dsc == NULL)
		{
			DumpDebug (TX_CONTROL,"dsc Memory Alloc Failure *****");
			return;
		}
		dsc->Buffer = kmalloc(Length,GFP_ATOMIC);
		if(dsc->Buffer == NULL) {
			kfree(dsc);
			DumpDebug (TX_CONTROL,"Memory Alloc Failure *****");
			return;
		}

		memcpy(dsc->Buffer, Buffer, Length);
		// fill out descriptor
  		dsc->data.Length = Length;
		dsc->data.Type   = Type;
 		// add to pending list
		 QueuePutTail(Adapter->ctl.Q_Received.Head, dsc->Node)

		if(process->Irp)
		{
			process->Irp = FALSE;
			wake_up_interruptible(&process->read_wait);
		}
	}
	else
示例#27
0
文件: ldump.c 项目: ezEngine/ezEngine
static void DumpFunction (const Proto *f, TString *psource, DumpState *D) {
  if (D->strip || f->source == psource)
    DumpString(NULL, D);  /* no debug info or same source as its parent */
  else
    DumpString(f->source, D);
  DumpInt(f->linedefined, D);
  DumpInt(f->lastlinedefined, D);
  DumpByte(f->numparams, D);
  DumpByte(f->is_vararg, D);
  DumpByte(f->maxstacksize, D);
  DumpCode(f, D);
  DumpConstants(f, D);
  DumpUpvalues(f, D);
  DumpProtos(f, D);
  DumpDebug(f, D);
}
示例#28
0
// remove adapter from array
VOID adpRemove(PMINIPORT_ADAPTER Adapter)
{
    int		i;
    PMINIPORT_ADAPTER*	p = g_Adapters;

	ENTER;
    for (i = 0; i < ADAPTER_MAX_NUMBER; i++, p++) {
	if (*p == Adapter) {
	    DumpDebug(HARDWARE, " Adapter (%lu) removed from %d index", (unsigned long)Adapter, i);
	    // clear
	    *p = NULL;
	    break;
	}
    }
	LEAVE;
}
示例#29
0
// sangam dbg : Not usefull as adpsave is success.
// get adapter index
ULONG adpIndex(PMINIPORT_ADAPTER Adapter)
{
    int		i;
    PMINIPORT_ADAPTER*	p = g_Adapters;

	ENTER;
    for (i = 0; i < ADAPTER_MAX_NUMBER; i++, p++) {
	if (*p == Adapter) {
	    // found
	    DumpDebug(HARDWARE, "Index is %d", i);
	    return i;
	}
    }
	LEAVE;
    return (ULONG)(-1);
}
示例#30
0
// save adapter to first free index
ULONG adpSave(PMINIPORT_ADAPTER Adapter)
{
    int		i;
    PMINIPORT_ADAPTER*	p = g_Adapters;

	ENTER;
    for (i = 0; i < ADAPTER_MAX_NUMBER; i++, p++) {
	if (*p == NULL) {
		DumpDebug(HARDWARE, "Adapter (%lu) saved to %d index", (unsigned long)Adapter, i);
	    // initialize
	    *p = Adapter;
	    return i;
	}
    }
	LEAVE;

    return (ULONG)(-1);
}