Skip to contentSkip to conversation

w35und: some more cleanups

PATCH Pavel Machek 1 participant 1 message Apr 7, 2008 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

Some more cleanups for w35und...

drivers/net/wireless/winbond/winbondport/knl.c +3 -3
index 4e8dad9..442435c 100644
@@ -1,15 +1,15 @@
-//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 //	knl.c
 //		Kernel module
 //	history -- 01/14/03' created 
 //
-//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 #include "os_common.h"
 
 void vKNL_StateMachine(PWB32_ADAPTER Adapter, const K_TRANS** psStateMachineTable,
                        u16 wStateData, pK_MSG psMsg)
 {
-    const K_TRANS* psStateTableEntry;
+	const K_TRANS* psStateTableEntry;
 	
 	if (wStateData == K_NULL_STATE)
 		return;
drivers/net/wireless/winbond/winbondport/linux/common.h +0 -2
index 66b9c7c..a9884e1 100644
@@ -110,10 +110,8 @@ #define OS_ATOMIC			u32
 #define OS_ATOMIC_READ( _A, _V )	_V
 #define OS_ATOMIC_INC( _A, _V )		EncapAtomicInc( _A, (void*)_V )
 #define OS_ATOMIC_DEC( _A, _V )		EncapAtomicDec( _A, (void*)_V )
-#define OS_MEMORY_FREE( _V, _S )	kfree( _V )
 #define OS_MEMORY_CLEAR( _A, _S )	memset( (PUCHAR)_A,0,_S)
 #define OS_MEMORY_COMPARE( _A, _B, _S )	(memcmp(_A,_B,_S)? 0 : 1) // Definition is reverse with Ndis 1: the same 0: different
-#define OS_DELAY( _MT )				//NdisStallExecution( _MT ) _MT : microsecond
 
 
 #define OS_SPIN_LOCK				spinlock_t
drivers/net/wireless/winbond/winbondport/linux/new_wireless.c +50 -75

142 lines not on this page · raw message

drivers/net/wireless/winbond/winbondport/linux/wb35rx.c +1 -1
index 19f3ec6..ea70d84 100644
@@ -153,7 +153,7 @@ void Wb35Rx_Complete(PURB pUrb)
 		if (!pWb35Rx->RxOwner[ RxBufferId ])
 			Wb35Rx_indicate( pHwData );
 		
-		OS_MEMORY_FREE( pWb35Rx->pDRx, MAX_USB_RX_BUFFER);
+		kfree(pWb35Rx->pDRx);
 		// Do the next receive
 		Wb35Rx(pHwData);
 		return;
drivers/net/wireless/winbond/winbondport/mlmetask.c +9 -13
index 771a039..9496f65 100644
@@ -405,17 +405,14 @@ void MLME_Halt( PWB32_ADAPTER Adapter)
 	}
 	for (i=MAX_BSS_DESCRIPT_ELEMENT-1; i>0; i--)
 	{
-		while (psBSS(i)->boInTimerHandler == TRUE)
-		{
-			///NdisMSleep(10000);//10ms
-			OS_SLEEP( 10000 );
+		while (psBSS(i)->boInTimerHandler == TRUE) {
+			OS_SLEEP(10000);
 		}
 	}
 
-	if( Adapter->asBSSDescriptElement )
-	{
-		OS_MEMORY_FREE( Adapter->asBSSDescriptElement, sizeof(WB_BSSDESCRIPTION) * MAX_BSS_DESCRIPT_ELEMENT );
-		Adapter->asBSSDescriptElement = NULL;	//[WK 20060626]
+	if (Adapter->asBSSDescriptElement) {
+		kfree(Adapter->asBSSDescriptElement);
+		Adapter->asBSSDescriptElement = NULL;
 	}
 	#ifdef _PE_STATE_DUMP_
 	WBDEBUG(("STATE: Mlme halt.\n"));
@@ -426,10 +423,9 @@ void MLME_Halt( PWB32_ADAPTER Adapter)
 
 void MLME_Stop( PWB32_ADAPTER Adapter)
 {
-    u16     i;
+	u16 i;
 
-	for (i=MAX_BSS_DESCRIPT_ELEMENT-1; i>0; i--)
-	{
+	for (i=MAX_BSS_DESCRIPT_ELEMENT-1; i>0; i--) {
 		vMlmeTimerStop(Adapter, i);
 	}
 }
@@ -500,9 +496,9 @@ void MLME_Entry(PWB32_ADAPTER Adapter, p
 	#endif
 }
 
-//======================================================================================
+//==========================================================================
 //      Action Function of MLME / ESS State Transition Table 
-//======================================================================================
+//==========================================================================
 void vMlmeProc_EssAuthReq(PWB32_ADAPTER Adapter, pK_MSG psMlmeMsg)
 {
 	u16	i;
drivers/net/wireless/winbond/winbondport/os_common.h +1 -4
index b75e4fe..e24ff41 100644
@@ -1,5 +1,2 @@
-#ifndef NDIS_MINIPORT_DRIVER
 #include "linux/sysdef.h"
-#else
-#include "sysdef.h"
-#endif
+
drivers/net/wireless/winbond/winbondport/rxisr.c +75 -108

293 lines not on this page · raw message

drivers/net/wireless/winbond/winbondport/wbhal.c +90 -134

534 lines not on this page · raw message

drivers/net/wireless/winbond/winbondport/wbndis.c +4 -5
index d9f3a77..36013b7 100644
@@ -560,10 +560,10 @@ void WBNDIS_ConnectStatus(  PADAPTER Ada
 #ifdef NDIS50_MINIPORT
 void WbInitializeString(   PNDIS_STRING DestinationString,  PUCHAR SourceString )
 {
-	u16	i, len;
+	u16 i, len;
 
 	len = (u16)strlen( SourceString );
-	if( (OS_MEMORY_ALLOC( (void* *)&DestinationString->Buffer, 100 ) != 1) || // 100 byte maximum
+	if ((OS_MEMORY_ALLOC( (void* *)&DestinationString->Buffer, 100 ) != 1) || // 100 byte maximum
 		(len >= 50 ) )
 	{
 		DestinationString->MaximumLength = 0;
@@ -578,10 +578,9 @@ void WbInitializeString(   PNDIS_STRING 
 		DestinationString->Buffer[i] = SourceString[i];
 }
 
-void WbFreeString(  NDIS_STRING String )
+void WbFreeString( NDIS_STRING String)
 {
-	if( String.Buffer )
-		OS_MEMORY_FREE( String.Buffer, 100 );
+	kfree(String.Buffer);
 	String.Buffer = NULL;
 }
 #endif
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html