コード例 #1
0
ファイル: hardware.c プロジェクト: Silvist/kernel-R910
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;
}
コード例 #2
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;
}