Commit 581f67cf authored by Pekka Enberg's avatar Pekka Enberg Committed by Greg Kroah-Hartman

Staging: w35und: merge wblinux struct to adapter

Zaps another compatability layer from the driver code.
Signed-off-by: default avatarPekka Enberg <penberg@cs.helsinki.fi>
Acked-by: default avatarPavel Machek <pavel@suse.cz>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 88ebc4b9
// #define OS_MEMORY_ALLOC( _V, _S ) WBLINUX_MemoryAlloc( _V, _S )
// ADAPTER.H - #define OS_LINK_STATUS (adapter->LinkStatus == OS_CONNECTED)
// Windows NDIS global variable 'adapter' typedef #define OS_SET_SHUTDOWN( _A ) _A->shutdown=1
// #define OS_SET_RESUME( _A ) _A->shutdown=0
#define OS_CONNECT_STATUS_INDICATE( _A, _F ) WBLINUX_ConnectStatus( _A, _F )
#define OS_DISCONNECTED 0
#define OS_CONNECTED 1
#define OS_STOP( _A ) WBLINUX_stop( _A )
#define OS_CURRENT_RX_BYTE( _A ) _A->RxByteCount
#define OS_CURRENT_TX_BYTE( _A ) _A->TxByteCount
#define OS_EVENT_INDICATE( _A, _B, _F )
#define OS_PMKID_STATUS_EVENT( _A )
#define OS_RECEIVE_PACKET_INDICATE( _A, _D ) WBLinux_ReceivePacket( _A, _D )
#define OS_RECEIVE_802_1X_PACKET_INDICATE( _A, _D ) EAP_ReceivePacket( _A, _D )
#define OS_GET_PACKET( _A, _D ) WBLINUX_GetNextPacket( _A, _D )
#define OS_GET_PACKET_COMPLETE( _A, _D ) WBLINUX_GetNextPacketCompleted( _A, _D )
#define OS_SEND_RESULT( _A, _ID, _R )
#define WBLINUX_PACKET_ARRAY_SIZE (ETHERNET_TX_DESCRIPTORS*4)
#define MAX_ANSI_STRING 40 #define MAX_ANSI_STRING 40
struct wb35_adapter { struct wb35_adapter {
u32 adapterIndex; // 20060703.4 Add for using padapterContext global adapter point u32 adapterIndex; // 20060703.4 Add for using padapterContext global adapter point
WB_LOCALDESCRIPT sLocalPara; // Myself connected parameters
PWB_BSSDESCRIPTION asBSSDescriptElement;
MLME_FRAME sMlmeFrame; // connect to peerSTA parameters
MTO_PARAMETERS sMtoPara; // MTO_struct ...
hw_data_t sHwData; //For HAL
MDS Mds;
spinlock_t AtomicSpinLock;
spinlock_t SpinLock;
u32 shutdown;
WB_LOCALDESCRIPT sLocalPara; // Myself connected parameters OS_ATOMIC ThreadCount;
PWB_BSSDESCRIPTION asBSSDescriptElement;
MLME_FRAME sMlmeFrame; // connect to peerSTA parameters u32 LinkStatus; // OS_DISCONNECTED or OS_CONNECTED
MTO_PARAMETERS sMtoPara; // MTO_struct ... u32 RxByteCount;
hw_data_t sHwData; //For HAL u32 TxByteCount;
MDS Mds;
WBLINUX WbLinux; struct sk_buff *skb_array[WBLINUX_PACKET_ARRAY_SIZE];
struct iw_statistics iw_stats; struct sk_buff *packet_return;
s32 skb_SetIndex;
s32 skb_GetIndex;
s32 netif_state_stop; // 1: stop 0: normal
struct iw_statistics iw_stats;
u8 LinkName[MAX_ANSI_STRING]; u8 LinkName[MAX_ANSI_STRING];
}; };
...@@ -53,7 +53,6 @@ ...@@ -53,7 +53,6 @@
#include "../sme_api.h" #include "../sme_api.h"
#include "../gl_80211.h" #include "../gl_80211.h"
#include "../mto.h" #include "../mto.h"
#include "../wblinux_s.h"
#include "../wbhal_s.h" #include "../wbhal_s.h"
......
...@@ -188,7 +188,6 @@ struct wbsoft_priv { ...@@ -188,7 +188,6 @@ struct wbsoft_priv {
static int wb35_probe(struct usb_interface *intf, const struct usb_device_id *id_table) static int wb35_probe(struct usb_interface *intf, const struct usb_device_id *id_table)
{ {
struct wb35_adapter *adapter; struct wb35_adapter *adapter;
PWBLINUX pWbLinux;
PWBUSB pWbUsb; PWBUSB pWbUsb;
struct usb_host_interface *interface; struct usb_host_interface *interface;
struct usb_endpoint_descriptor *endpoint; struct usb_endpoint_descriptor *endpoint;
...@@ -214,7 +213,6 @@ static int wb35_probe(struct usb_interface *intf, const struct usb_device_id *id ...@@ -214,7 +213,6 @@ static int wb35_probe(struct usb_interface *intf, const struct usb_device_id *id
adapter = kzalloc(sizeof(*adapter), GFP_KERNEL); adapter = kzalloc(sizeof(*adapter), GFP_KERNEL);
my_adapter = adapter; my_adapter = adapter;
pWbLinux = &adapter->WbLinux;
pWbUsb = &adapter->sHwData.WbUsb; pWbUsb = &adapter->sHwData.WbUsb;
pWbUsb->udev = udev; pWbUsb->udev = udev;
...@@ -334,12 +332,9 @@ WbUsb_destroy(phw_data_t pHwData) ...@@ -334,12 +332,9 @@ WbUsb_destroy(phw_data_t pHwData)
static void wb35_disconnect(struct usb_interface *intf) static void wb35_disconnect(struct usb_interface *intf)
{ {
PWBLINUX pWbLinux;
struct wb35_adapter * adapter = usb_get_intfdata(intf); struct wb35_adapter * adapter = usb_get_intfdata(intf);
usb_set_intfdata(intf, NULL); usb_set_intfdata(intf, NULL);
pWbLinux = &adapter->WbLinux;
// Card remove // Card remove
WbWlanHalt(adapter); WbWlanHalt(adapter);
......
...@@ -23,36 +23,32 @@ WBLINUX_MemoryAlloc(void* *VirtualAddress, u32 Length) ...@@ -23,36 +23,32 @@ WBLINUX_MemoryAlloc(void* *VirtualAddress, u32 Length)
s32 s32
EncapAtomicInc(struct wb35_adapter * adapter, void* pAtomic) EncapAtomicInc(struct wb35_adapter * adapter, void* pAtomic)
{ {
PWBLINUX pWbLinux = &adapter->WbLinux;
u32 ltmp; u32 ltmp;
u32 * pltmp = (u32 *)pAtomic; u32 * pltmp = (u32 *)pAtomic;
spin_lock_irq( &pWbLinux->AtomicSpinLock ); spin_lock_irq( &adapter->AtomicSpinLock );
(*pltmp)++; (*pltmp)++;
ltmp = (*pltmp); ltmp = (*pltmp);
spin_unlock_irq( &pWbLinux->AtomicSpinLock ); spin_unlock_irq( &adapter->AtomicSpinLock );
return ltmp; return ltmp;
} }
s32 s32
EncapAtomicDec(struct wb35_adapter * adapter, void* pAtomic) EncapAtomicDec(struct wb35_adapter * adapter, void* pAtomic)
{ {
PWBLINUX pWbLinux = &adapter->WbLinux;
u32 ltmp; u32 ltmp;
u32 * pltmp = (u32 *)pAtomic; u32 * pltmp = (u32 *)pAtomic;
spin_lock_irq( &pWbLinux->AtomicSpinLock ); spin_lock_irq( &adapter->AtomicSpinLock );
(*pltmp)--; (*pltmp)--;
ltmp = (*pltmp); ltmp = (*pltmp);
spin_unlock_irq( &pWbLinux->AtomicSpinLock ); spin_unlock_irq( &adapter->AtomicSpinLock );
return ltmp; return ltmp;
} }
unsigned char unsigned char
WBLINUX_Initial(struct wb35_adapter * adapter) WBLINUX_Initial(struct wb35_adapter * adapter)
{ {
PWBLINUX pWbLinux = &adapter->WbLinux; spin_lock_init( &adapter->SpinLock );
spin_lock_init( &adapter->AtomicSpinLock );
spin_lock_init( &pWbLinux->SpinLock );
spin_lock_init( &pWbLinux->AtomicSpinLock );
return TRUE; return TRUE;
} }
...@@ -87,24 +83,23 @@ WBLINUX_Destroy(struct wb35_adapter * adapter) ...@@ -87,24 +83,23 @@ WBLINUX_Destroy(struct wb35_adapter * adapter)
void void
WBLINUX_stop( struct wb35_adapter * adapter ) WBLINUX_stop( struct wb35_adapter * adapter )
{ {
PWBLINUX pWbLinux = &adapter->WbLinux;
struct sk_buff *pSkb; struct sk_buff *pSkb;
if (OS_ATOMIC_INC( adapter, &pWbLinux->ThreadCount ) == 1) { if (OS_ATOMIC_INC( adapter, &adapter->ThreadCount ) == 1) {
// Shutdown module immediately // Shutdown module immediately
pWbLinux->shutdown = 1; adapter->shutdown = 1;
while (pWbLinux->skb_array[ pWbLinux->skb_GetIndex ]) { while (adapter->skb_array[ adapter->skb_GetIndex ]) {
// Trying to free the un-sending packet // Trying to free the un-sending packet
pSkb = pWbLinux->skb_array[ pWbLinux->skb_GetIndex ]; pSkb = adapter->skb_array[ adapter->skb_GetIndex ];
pWbLinux->skb_array[ pWbLinux->skb_GetIndex ] = NULL; adapter->skb_array[ adapter->skb_GetIndex ] = NULL;
if( in_irq() ) if( in_irq() )
dev_kfree_skb_irq( pSkb ); dev_kfree_skb_irq( pSkb );
else else
dev_kfree_skb( pSkb ); dev_kfree_skb( pSkb );
pWbLinux->skb_GetIndex++; adapter->skb_GetIndex++;
pWbLinux->skb_GetIndex %= WBLINUX_PACKET_ARRAY_SIZE; adapter->skb_GetIndex %= WBLINUX_PACKET_ARRAY_SIZE;
} }
#ifdef _PE_STATE_DUMP_ #ifdef _PE_STATE_DUMP_
...@@ -112,7 +107,7 @@ WBLINUX_stop( struct wb35_adapter * adapter ) ...@@ -112,7 +107,7 @@ WBLINUX_stop( struct wb35_adapter * adapter )
#endif #endif
} }
OS_ATOMIC_DEC(adapter, &pWbLinux->ThreadCount); OS_ATOMIC_DEC(adapter, &adapter->ThreadCount);
} }
void void
...@@ -268,8 +263,6 @@ error: ...@@ -268,8 +263,6 @@ error:
void WBLINUX_ConnectStatus(struct wb35_adapter * adapter, u32 flag) void WBLINUX_ConnectStatus(struct wb35_adapter * adapter, u32 flag)
{ {
PWBLINUX pWbLinux = &adapter->WbLinux; adapter->LinkStatus = flag; // OS_DISCONNECTED or OS_CONNECTED
pWbLinux->LinkStatus = flag; // OS_DISCONNECTED or OS_CONNECTED
} }
//============================================================
// wblinux_s.h
//
#define OS_MEMORY_ALLOC( _V, _S ) WBLINUX_MemoryAlloc( _V, _S )
#define OS_LINK_STATUS (adapter->WbLinux.LinkStatus == OS_CONNECTED)
#define OS_SET_SHUTDOWN( _A ) _A->WbLinux.shutdown=1
#define OS_SET_RESUME( _A ) _A->WbLinux.shutdown=0
#define OS_CONNECT_STATUS_INDICATE( _A, _F ) WBLINUX_ConnectStatus( _A, _F )
#define OS_DISCONNECTED 0
#define OS_CONNECTED 1
#define OS_STOP( _A ) WBLINUX_stop( _A )
#define OS_CURRENT_RX_BYTE( _A ) _A->WbLinux.RxByteCount
#define OS_CURRENT_TX_BYTE( _A ) _A->WbLinux.TxByteCount
#define OS_EVENT_INDICATE( _A, _B, _F )
#define OS_PMKID_STATUS_EVENT( _A )
#define OS_RECEIVE_PACKET_INDICATE( _A, _D ) WBLinux_ReceivePacket( _A, _D )
#define OS_RECEIVE_802_1X_PACKET_INDICATE( _A, _D ) EAP_ReceivePacket( _A, _D )
#define OS_GET_PACKET( _A, _D ) WBLINUX_GetNextPacket( _A, _D )
#define OS_GET_PACKET_COMPLETE( _A, _D ) WBLINUX_GetNextPacketCompleted( _A, _D )
#define OS_SEND_RESULT( _A, _ID, _R )
#define WBLINUX_PACKET_ARRAY_SIZE (ETHERNET_TX_DESCRIPTORS*4)
typedef struct _WBLINUX
{
spinlock_t AtomicSpinLock;
spinlock_t SpinLock;
u32 shutdown;
OS_ATOMIC ThreadCount;
u32 LinkStatus; // OS_DISCONNECTED or OS_CONNECTED
u32 RxByteCount;
u32 TxByteCount;
struct sk_buff *skb_array[ WBLINUX_PACKET_ARRAY_SIZE ];
struct sk_buff *packet_return;
s32 skb_SetIndex;
s32 skb_GetIndex;
s32 netif_state_stop; // 1: stop 0: normal
} WBLINUX, *PWBLINUX;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment