]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Staging: w35und: merge struct wb35_adapter to struct wbsoft_priv
authorPekka Enberg <penberg@cs.helsinki.fi>
Thu, 30 Oct 2008 14:14:38 +0000 (16:14 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 6 Jan 2009 21:51:49 +0000 (13:51 -0800)
This patch merges struct wb35_adapter to struct wbsoft_priv. Now we can finally
start passing a pointer to struct ieee80211_hw around where necessary.

Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 files changed:
drivers/staging/winbond/adapter.h [deleted file]
drivers/staging/winbond/bss_f.h
drivers/staging/winbond/core.h
drivers/staging/winbond/mds.c
drivers/staging/winbond/mds_f.h
drivers/staging/winbond/mlmetxrx.c
drivers/staging/winbond/mlmetxrx_f.h
drivers/staging/winbond/mto.h
drivers/staging/winbond/mto_f.h
drivers/staging/winbond/rxisr.c
drivers/staging/winbond/scan_s.h
drivers/staging/winbond/wb35tx.c
drivers/staging/winbond/wb35tx_f.h
drivers/staging/winbond/wbhal.c
drivers/staging/winbond/wbhal_f.h
drivers/staging/winbond/wblinux.c
drivers/staging/winbond/wblinux_f.h
drivers/staging/winbond/wbusb.c

diff --git a/drivers/staging/winbond/adapter.h b/drivers/staging/winbond/adapter.h
deleted file mode 100644 (file)
index 239cc3a..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-#ifndef __WINBOND_ADAPTER_H
-#define __WINBOND_ADAPTER_H
-
-#include <linux/wireless.h>
-
-#include "bssdscpt.h"
-#include "mto.h"
-#include "wbhal_s.h"
-
-#define WBLINUX_PACKET_ARRAY_SIZE (ETHERNET_TX_DESCRIPTORS*4)
-
-#define WB_MAX_LINK_NAME_LEN 40
-
-struct wb35_adapter {
-       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 SpinLock;
-       u32 shutdown;
-
-       atomic_t ThreadCount;
-
-       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
-       struct iw_statistics iw_stats;
-
-       u8 LinkName[WB_MAX_LINK_NAME_LEN];
-};
-
-#endif
index feffe5f25f0587d0a19c41f38588bb931d4db1bd..a433b5a859249e454efa62f78e00829ed90eb311 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __WINBOND_BSS_F_H
 #define __WINBOND_BSS_F_H
 
-#include "adapter.h"
+#include "core.h"
 
 struct PMKID_Information_Element;
 
@@ -9,54 +9,54 @@ struct PMKID_Information_Element;
 // BSS descriptor DataBase management global function
 //
 
-void vBSSdescriptionInit(struct wb35_adapter * adapter);
-void vBSSfoundList(struct wb35_adapter * adapter);
-u8 boChanFilter(struct wb35_adapter * adapter, u8 ChanNo);
-u16 wBSSallocateEntry(struct wb35_adapter * adapter);
-u16 wBSSGetEntry(struct wb35_adapter * adapter);
-void vSimpleHouseKeeping(struct wb35_adapter * adapter);
-u16 wBSShouseKeeping(struct wb35_adapter * adapter);
-void ClearBSSdescpt(struct wb35_adapter * adapter, u16 i);
-u16 wBSSfindBssID(struct wb35_adapter * adapter, u8 *pbBssid);
-u16 wBSSfindDedicateCandidate(struct wb35_adapter * adapter, struct SSID_Element *psSsid, u8 *pbBssid);
-u16 wBSSfindMACaddr(struct wb35_adapter * adapter, u8 *pbMacAddr);
-u16 wBSSsearchMACaddr(struct wb35_adapter * adapter, u8 *pbMacAddr, u8 band);
-u16 wBSSaddScanData(struct wb35_adapter *, u16, psRXDATA);
-u16 wBSSUpdateScanData(struct wb35_adapter * adapter, u16 wBssIdx, psRXDATA psRcvData);
-u16 wBSScreateIBSSdata(struct wb35_adapter * adapter, PWB_BSSDESCRIPTION psDesData);
-void DesiredRate2BSSdescriptor(struct wb35_adapter * adapter, PWB_BSSDESCRIPTION psDesData,
+void vBSSdescriptionInit(struct wbsoft_priv * adapter);
+void vBSSfoundList(struct wbsoft_priv * adapter);
+u8 boChanFilter(struct wbsoft_priv * adapter, u8 ChanNo);
+u16 wBSSallocateEntry(struct wbsoft_priv * adapter);
+u16 wBSSGetEntry(struct wbsoft_priv * adapter);
+void vSimpleHouseKeeping(struct wbsoft_priv * adapter);
+u16 wBSShouseKeeping(struct wbsoft_priv * adapter);
+void ClearBSSdescpt(struct wbsoft_priv * adapter, u16 i);
+u16 wBSSfindBssID(struct wbsoft_priv * adapter, u8 *pbBssid);
+u16 wBSSfindDedicateCandidate(struct wbsoft_priv * adapter, struct SSID_Element *psSsid, u8 *pbBssid);
+u16 wBSSfindMACaddr(struct wbsoft_priv * adapter, u8 *pbMacAddr);
+u16 wBSSsearchMACaddr(struct wbsoft_priv * adapter, u8 *pbMacAddr, u8 band);
+u16 wBSSaddScanData(struct wbsoft_priv *, u16, psRXDATA);
+u16 wBSSUpdateScanData(struct wbsoft_priv * adapter, u16 wBssIdx, psRXDATA psRcvData);
+u16 wBSScreateIBSSdata(struct wbsoft_priv * adapter, PWB_BSSDESCRIPTION psDesData);
+void DesiredRate2BSSdescriptor(struct wbsoft_priv * adapter, PWB_BSSDESCRIPTION psDesData,
                                                         u8 *pBasicRateSet, u8 BasicRateCount,
                                                         u8 *pOperationRateSet, u8 OperationRateCount);
-void DesiredRate2InfoElement(struct wb35_adapter * adapter, u8 *addr, u16 *iFildOffset,
+void DesiredRate2InfoElement(struct wbsoft_priv * adapter, u8  *addr, u16 *iFildOffset,
                                                         u8 *pBasicRateSet, u8 BasicRateCount,
                                                         u8 *pOperationRateSet, u8 OperationRateCount);
-void BSSAddIBSSdata(struct wb35_adapter * adapter, PWB_BSSDESCRIPTION psDesData);
+void BSSAddIBSSdata(struct wbsoft_priv * adapter, PWB_BSSDESCRIPTION psDesData);
 unsigned char boCmpMacAddr( u8 *, u8 *);
 unsigned char boCmpSSID(struct SSID_Element *psSSID1, struct SSID_Element *psSSID2);
-u16 wBSSfindSSID(struct wb35_adapter * adapter, struct SSID_Element *psSsid);
-u16 wRoamingQuery(struct wb35_adapter * adapter);
-void vRateToBitmap(struct wb35_adapter * adapter, u16 index);
-u8 bRateToBitmapIndex(struct wb35_adapter * adapter, u8 bRate);
+u16 wBSSfindSSID(struct wbsoft_priv * adapter, struct SSID_Element *psSsid);
+u16 wRoamingQuery(struct wbsoft_priv * adapter);
+void vRateToBitmap(struct wbsoft_priv * adapter, u16 index);
+u8 bRateToBitmapIndex(struct wbsoft_priv * adapter, u8 bRate);
 u8 bBitmapToRate(u8 i);
-unsigned char boIsERPsta(struct wb35_adapter * adapter, u16 i);
-unsigned char boCheckConnect(struct wb35_adapter * adapter);
-unsigned char boCheckSignal(struct wb35_adapter * adapter);
-void AddIBSSIe(struct wb35_adapter * adapter,PWB_BSSDESCRIPTION psDesData );//added by ws for WPA_None06/01/04
-void BssScanUpToDate(struct wb35_adapter * adapter);
-void BssUpToDate(struct wb35_adapter * adapter);
+unsigned char boIsERPsta(struct wbsoft_priv * adapter, u16 i);
+unsigned char boCheckConnect(struct wbsoft_priv * adapter);
+unsigned char boCheckSignal(struct wbsoft_priv * adapter);
+void AddIBSSIe(struct wbsoft_priv * adapter,PWB_BSSDESCRIPTION psDesData );//added by ws for WPA_None06/01/04
+void BssScanUpToDate(struct wbsoft_priv * adapter);
+void BssUpToDate(struct wbsoft_priv * adapter);
 void RateSort(u8 *RateArray, u8 num, u8 mode);
-void RateReSortForSRate(struct wb35_adapter * adapter, u8 *RateArray, u8 num);
-void Assemble_IE(struct wb35_adapter * adapter, u16 wBssIdx);
-void SetMaxTxRate(struct wb35_adapter * adapter);
+void RateReSortForSRate(struct wbsoft_priv * adapter, u8 *RateArray, u8 num);
+void Assemble_IE(struct wbsoft_priv * adapter, u16 wBssIdx);
+void SetMaxTxRate(struct wbsoft_priv * adapter);
 
-void CreateWpaIE(struct wb35_adapter * adapter, u16* iFildOffset, u8 *msg, struct  Management_Frame* msgHeader,
+void CreateWpaIE(struct wbsoft_priv * adapter, u16* iFildOffset, u8 *msg, struct  Management_Frame* msgHeader,
                                 struct Association_Request_Frame_Body* msgBody, u16 iMSindex); //added by WS 05/14/05
 
 #ifdef _WPA2_
-void CreateRsnIE(struct wb35_adapter * adapter, u16* iFildOffset, u8 *msg, struct  Management_Frame* msgHeader,
+void CreateRsnIE(struct wbsoft_priv * adapter, u16* iFildOffset, u8 *msg, struct  Management_Frame* msgHeader,
                                 struct Association_Request_Frame_Body* msgBody, u16 iMSindex);//added by WS 05/14/05
 
-u16 SearchPmkid(struct wb35_adapter * adapter, struct  Management_Frame* msgHeader,
+u16 SearchPmkid(struct wbsoft_priv * adapter, struct  Management_Frame* msgHeader,
                                   struct PMKID_Information_Element * AssoReq_PMKID );
 #endif
 
index 62ad9545548d39071b41dc90c2946224866e1af0..64b73bbf747456f9d1dbbf00fc04bb28deec0db7 100644 (file)
@@ -1,10 +1,44 @@
 #ifndef __WINBOND_CORE_H
 #define __WINBOND_CORE_H
 
-#include "adapter.h"
+#include <linux/wireless.h>
+
+#include "bssdscpt.h"
+#include "mto.h"
+#include "wbhal_s.h"
+
+#define WBLINUX_PACKET_ARRAY_SIZE (ETHERNET_TX_DESCRIPTORS*4)
+
+#define WB_MAX_LINK_NAME_LEN 40
 
 struct wbsoft_priv {
-       struct wb35_adapter *adapter;
+       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 SpinLock;
+       u32 shutdown;
+
+       atomic_t ThreadCount;
+
+       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
+       struct iw_statistics iw_stats;
+
+       u8 LinkName[WB_MAX_LINK_NAME_LEN];
 };
 
 #endif /* __WINBOND_CORE_H */
index 35ea100a665c317b7e39a521f8f492980712ee59..df59b04da749a2b7f7d4c1badf207c9a00413ad2 100644 (file)
@@ -8,7 +8,7 @@
 #include "wblinux_f.h"
 
 void
-Mds_reset_descriptor(struct wb35_adapter * adapter)
+Mds_reset_descriptor(struct wbsoft_priv * adapter)
 {
        PMDS pMds = &adapter->Mds;
 
@@ -21,7 +21,7 @@ Mds_reset_descriptor(struct wb35_adapter * adapter)
 }
 
 unsigned char
-Mds_initial(struct wb35_adapter * adapter)
+Mds_initial(struct wbsoft_priv * adapter)
 {
        PMDS pMds = &adapter->Mds;
 
@@ -35,13 +35,13 @@ Mds_initial(struct wb35_adapter * adapter)
 }
 
 void
-Mds_Destroy(struct wb35_adapter * adapter)
+Mds_Destroy(struct wbsoft_priv * adapter)
 {
        vRxTimerStop(adapter);
 }
 
 void
-Mds_Tx(struct wb35_adapter * adapter)
+Mds_Tx(struct wbsoft_priv * adapter)
 {
        phw_data_t      pHwData = &adapter->sHwData;
        PMDS            pMds = &adapter->Mds;
@@ -183,7 +183,7 @@ Mds_Tx(struct wb35_adapter * adapter)
 }
 
 void
-Mds_SendComplete(struct wb35_adapter * adapter, PT02_DESCRIPTOR pT02)
+Mds_SendComplete(struct wbsoft_priv * adapter, PT02_DESCRIPTOR pT02)
 {
        PMDS    pMds = &adapter->Mds;
        phw_data_t      pHwData = &adapter->sHwData;
@@ -236,7 +236,7 @@ Mds_SendComplete(struct wb35_adapter * adapter, PT02_DESCRIPTOR pT02)
 }
 
 void
-Mds_HeaderCopy(struct wb35_adapter * adapter, PDESCRIPTOR pDes, u8 *TargetBuffer)
+Mds_HeaderCopy(struct wbsoft_priv * adapter, PDESCRIPTOR pDes, u8 *TargetBuffer)
 {
        PMDS    pMds = &adapter->Mds;
        u8      *src_buffer = pDes->buffer_address[0];//931130.5.g
@@ -333,7 +333,7 @@ Mds_HeaderCopy(struct wb35_adapter * adapter, PDESCRIPTOR pDes, u8 *TargetBuffer
 
 // The function return the 4n size of usb pk
 u16
-Mds_BodyCopy(struct wb35_adapter * adapter, PDESCRIPTOR pDes, u8 *TargetBuffer)
+Mds_BodyCopy(struct wbsoft_priv * adapter, PDESCRIPTOR pDes, u8 *TargetBuffer)
 {
        PT00_DESCRIPTOR pT00;
        PMDS    pMds = &adapter->Mds;
@@ -436,7 +436,7 @@ Mds_BodyCopy(struct wb35_adapter * adapter, PDESCRIPTOR pDes, u8 *TargetBuffer)
 
 
 void
-Mds_DurationSet(  struct wb35_adapter * adapter,  PDESCRIPTOR pDes,  u8 *buffer )
+Mds_DurationSet(  struct wbsoft_priv * adapter,  PDESCRIPTOR pDes,  u8 *buffer )
 {
        PT00_DESCRIPTOR pT00;
        PT01_DESCRIPTOR pT01;
index 2e0f7a84a481386134e946181d2073e22b539ec0..a3724ac6798df98ee148623683a677a6c50dc842 100644 (file)
@@ -2,31 +2,31 @@
 #define __WINBOND_MDS_F_H
 
 #include "wbhal_s.h"
-#include "adapter.h"
+#include "core.h"
 
-unsigned char Mds_initial(  struct wb35_adapter *adapter );
-void Mds_Destroy(  struct wb35_adapter *adapter );
-void Mds_Tx(  struct wb35_adapter *adapter );
-void Mds_HeaderCopy(  struct wb35_adapter *adapter,  PDESCRIPTOR pDes,  u8 *TargetBuffer );
-u16 Mds_BodyCopy(  struct wb35_adapter *adapter,  PDESCRIPTOR pDes,  u8 *TargetBuffer );
-void Mds_DurationSet(  struct wb35_adapter *adapter,  PDESCRIPTOR pDes,  u8 *TargetBuffer );
-void Mds_SendComplete(  struct wb35_adapter *adapter,  PT02_DESCRIPTOR pT02 );
-void Mds_MpduProcess(  struct wb35_adapter *adapter,  PDESCRIPTOR pRxDes );
-void Mds_reset_descriptor(  struct wb35_adapter *adapter );
+unsigned char Mds_initial(  struct wbsoft_priv *adapter );
+void Mds_Destroy(  struct wbsoft_priv *adapter );
+void Mds_Tx(  struct wbsoft_priv *adapter );
+void Mds_HeaderCopy(  struct wbsoft_priv *adapter,  PDESCRIPTOR pDes,  u8 *TargetBuffer );
+u16 Mds_BodyCopy(  struct wbsoft_priv *adapter,  PDESCRIPTOR pDes,  u8 *TargetBuffer );
+void Mds_DurationSet(  struct wbsoft_priv *adapter,  PDESCRIPTOR pDes,  u8 *TargetBuffer );
+void Mds_SendComplete(  struct wbsoft_priv *adapter,  PT02_DESCRIPTOR pT02 );
+void Mds_MpduProcess(  struct wbsoft_priv *adapter,  PDESCRIPTOR pRxDes );
+void Mds_reset_descriptor(  struct wbsoft_priv *adapter );
 extern void DataDmp(u8 *pdata, u32 len, u32 offset);
 
 
-void vRxTimerInit(struct wb35_adapter *adapter);
-void vRxTimerStart(struct wb35_adapter *adapter, int timeout_value);
-void vRxTimerStop(struct wb35_adapter *adapter);
+void vRxTimerInit(struct wbsoft_priv *adapter);
+void vRxTimerStart(struct wbsoft_priv *adapter, int timeout_value);
+void vRxTimerStop(struct wbsoft_priv *adapter);
 
 // For Asynchronous indicating. The routine collocates with USB.
-void Mds_MsduProcess(  struct wb35_adapter *adapter,  PRXLAYER1 pRxLayer1,  u8 SlotIndex);
+void Mds_MsduProcess(  struct wbsoft_priv *adapter,  PRXLAYER1 pRxLayer1,  u8 SlotIndex);
 
 // For data frame sending 20060802
-u16 MDS_GetPacketSize(  struct wb35_adapter *adapter );
-void MDS_GetNextPacket(  struct wb35_adapter *adapter,  PDESCRIPTOR pDes );
-void MDS_GetNextPacketComplete(  struct wb35_adapter *adapter,  PDESCRIPTOR pDes );
-void MDS_SendResult(  struct wb35_adapter *adapter,  u8 PacketId,  unsigned char SendOK );
+u16 MDS_GetPacketSize(  struct wbsoft_priv *adapter );
+void MDS_GetNextPacket(  struct wbsoft_priv *adapter,  PDESCRIPTOR pDes );
+void MDS_GetNextPacketComplete(  struct wbsoft_priv *adapter,  PDESCRIPTOR pDes );
+void MDS_SendResult(  struct wbsoft_priv *adapter,  u8 PacketId,  unsigned char SendOK );
 
 #endif
index ee80aed7f0b8f3dea5740f969a551c63cb06dba8..f3da9a6a85c102f18d6ef9ff9d87a4578251993a 100644 (file)
@@ -19,7 +19,7 @@
 
 #include "mds_f.h"
 
-void MLMEResetTxRx(struct wb35_adapter * adapter)
+void MLMEResetTxRx(struct wbsoft_priv * adapter)
 {
        s32     i;
 
@@ -55,7 +55,7 @@ void MLMEResetTxRx(struct wb35_adapter * adapter)
 //=============================================================================
 
 /* FIXME: Should this just be replaced with kmalloc() and kfree()? */
-u8 *MLMEGetMMPDUBuffer(struct wb35_adapter * adapter)
+u8 *MLMEGetMMPDUBuffer(struct wbsoft_priv * adapter)
 {
        s32 i;
        u8 *returnVal;
@@ -73,7 +73,7 @@ u8 *MLMEGetMMPDUBuffer(struct wb35_adapter * adapter)
 }
 
 //=============================================================================
-u8 MLMESendFrame(struct wb35_adapter * adapter, u8 *pMMPDU, u16 len, u8 DataType)
+u8 MLMESendFrame(struct wbsoft_priv * adapter, u8 *pMMPDU, u16 len, u8 DataType)
 /*     DataType : FRAME_TYPE_802_11_MANAGEMENT, FRAME_TYPE_802_11_MANAGEMENT_CHALLENGE,
                                FRAME_TYPE_802_11_DATA */
 {
@@ -98,7 +98,7 @@ u8 MLMESendFrame(struct wb35_adapter * adapter, u8 *pMMPDU, u16 len, u8 DataType
        return true;
 }
 
-void MLME_GetNextPacket(struct wb35_adapter *adapter, PDESCRIPTOR desc)
+void MLME_GetNextPacket(struct wbsoft_priv *adapter, PDESCRIPTOR desc)
 {
        desc->InternalUsed = desc->buffer_start_index + desc->buffer_number;
        desc->InternalUsed %= MAX_DESCRIPTOR_BUFFER_INDEX;
@@ -109,7 +109,7 @@ void MLME_GetNextPacket(struct wb35_adapter *adapter, PDESCRIPTOR desc)
        desc->Type = adapter->sMlmeFrame.DataType;
 }
 
-void MLMEfreeMMPDUBuffer(struct wb35_adapter * adapter, s8 *pData)
+void MLMEfreeMMPDUBuffer(struct wbsoft_priv * adapter, s8 *pData)
 {
        int i;
 
@@ -127,7 +127,7 @@ void MLMEfreeMMPDUBuffer(struct wb35_adapter * adapter, s8 *pData)
 }
 
 void
-MLME_SendComplete(struct wb35_adapter * adapter, u8 PacketID, unsigned char SendOK)
+MLME_SendComplete(struct wbsoft_priv * adapter, u8 PacketID, unsigned char SendOK)
 {
        MLME_TXCALLBACK TxCallback;
 
index 0f264ed64ea42de8c3cbd858600c2a46a1fd54c3..905c301028a3cbd24ce81aadb7911aefe81ed1da 100644 (file)
@@ -8,34 +8,34 @@
 #ifndef _MLMETXRX_H
 #define _MLMETXRX_H
 
-#include "adapter.h"
+#include "core.h"
 
 void
 MLMEProcThread(
-     struct wb35_adapter *    adapter
+     struct wbsoft_priv *    adapter
        );
 
-void MLMEResetTxRx( struct wb35_adapter * adapter);
+void MLMEResetTxRx( struct wbsoft_priv * adapter);
 
 u8 *
 MLMEGetMMPDUBuffer(
-     struct wb35_adapter *    adapter
+     struct wbsoft_priv *    adapter
    );
 
-void MLMEfreeMMPDUBuffer( struct wb35_adapter * adapter,  s8 * pData);
+void MLMEfreeMMPDUBuffer( struct wbsoft_priv * adapter,  s8 * pData);
 
-void MLME_GetNextPacket(  struct wb35_adapter * adapter,  PDESCRIPTOR pDes );
-u8 MLMESendFrame( struct wb35_adapter * adapter,
+void MLME_GetNextPacket(  struct wbsoft_priv * adapter,  PDESCRIPTOR pDes );
+u8 MLMESendFrame( struct wbsoft_priv * adapter,
                                        u8      *pMMPDU,
                                        u16     len,
                                         u8     DataType);
 
 void
-MLME_SendComplete(  struct wb35_adapter * adapter,  u8 PacketID,  unsigned char SendOK );
+MLME_SendComplete(  struct wbsoft_priv * adapter,  u8 PacketID,  unsigned char SendOK );
 
 void
 MLMERcvFrame(
-     struct wb35_adapter *    adapter,
+     struct wbsoft_priv *    adapter,
      PRXBUFFER        pRxBufferArray,
      u8            NumOfBuffer,
      u8            ReturnSlotIndex
@@ -43,11 +43,11 @@ MLMERcvFrame(
 
 void
 MLMEReturnPacket(
-     struct wb35_adapter *    adapter,
+     struct wbsoft_priv *    adapter,
      u8 *          pRxBufer
    );
 #ifdef _IBSS_BEACON_SEQ_STICK_
-s8 SendBCNullData(struct wb35_adapter * adapter, u16 wIdx);
+s8 SendBCNullData(struct wbsoft_priv * adapter, u16 wIdx);
 #endif
 
 #endif
index 9a175449ce50659971f2f7d7cb7d44cecc540d31..536c4f15c416dd03b607e080dc8a0d012268eace 100644 (file)
@@ -131,7 +131,7 @@ typedef struct _MTO_PARAMETERS
 } MTO_PARAMETERS, *PMTO_PARAMETERS;
 
 
-#define MTO_FUNC_INPUT              struct wb35_adapter *      adapter
+#define MTO_FUNC_INPUT              struct wbsoft_priv *       adapter
 #define MTO_FUNC_INPUT_DATA         adapter
 #define MTO_DATA()                  (adapter->sMtoPara)
 #define MTO_HAL()                   (&adapter->sHwData)
index ce4319da1f3ad58783440fdb8f559c4c87ff2f5d..81f59137c6d66fa655756a3ce7aa574a798a8d17 100644 (file)
@@ -1,11 +1,11 @@
 #ifndef __WINBOND_MTO_F_H
 #define __WINBOND_MTO_F_H
 
-#include "adapter.h"
+#include "core.h"
 
-extern void MTO_Init(struct wb35_adapter *);
-extern void MTO_PeriodicTimerExpired(struct wb35_adapter *);
-extern void MTO_SetDTORateRange(struct wb35_adapter *, u8 *, u8);
+extern void MTO_Init(struct wbsoft_priv *);
+extern void MTO_PeriodicTimerExpired(struct wbsoft_priv *);
+extern void MTO_SetDTORateRange(struct wbsoft_priv *, u8 *, u8);
 extern u8 MTO_GetTxRate(MTO_FUNC_INPUT, u32 fpdu_len);
 extern u8 MTO_GetTxFallbackRate(MTO_FUNC_INPUT);
 extern void MTO_SetTxCount(MTO_FUNC_INPUT, u8 t0, u8 index);
index f5c98d915c7b61fa1492a35fd3574182fb566171..d591003a38ec1b999589b7c6be4e8a7e2df7b1f6 100644 (file)
@@ -1,19 +1,19 @@
 #include "os_common.h"
-#include "adapter.h"
+#include "core.h"
 
 static void RxTimerHandler(unsigned long data)
 {
        WARN_ON(1);
 }
 
-void vRxTimerInit(struct wb35_adapter *adapter)
+void vRxTimerInit(struct wbsoft_priv *adapter)
 {
        init_timer(&adapter->Mds.timer);
        adapter->Mds.timer.function = RxTimerHandler;
        adapter->Mds.timer.data = (unsigned long) adapter;
 }
 
-void vRxTimerStart(struct wb35_adapter *adapter, int timeout_value)
+void vRxTimerStart(struct wbsoft_priv *adapter, int timeout_value)
 {
        if (timeout_value < MIN_TIMEOUT_VAL)
                timeout_value = MIN_TIMEOUT_VAL;
@@ -22,7 +22,7 @@ void vRxTimerStart(struct wb35_adapter *adapter, int timeout_value)
        add_timer(&adapter->Mds.timer);
 }
 
-void vRxTimerStop(struct wb35_adapter *adapter)
+void vRxTimerStop(struct wbsoft_priv *adapter)
 {
        del_timer_sync(&adapter->Mds.timer);
 }
index 726954684ce5f92cf1214dfd54a0e8d8286a1a7d..775bb81f23cc83e0cba00a79b244948994988806 100644 (file)
@@ -114,8 +114,8 @@ typedef struct _SCAN_PARAMETERS
 
 // static functions
 
-//static void ScanTimerHandler(struct wb35_adapter * adapter);
-//static void vScanTimerStart(struct wb35_adapter *    adapter, int timeout_value);
-//static void vScanTimerStop(struct wb35_adapter * adapter);
+//static void ScanTimerHandler(struct wbsoft_priv * adapter);
+//static void vScanTimerStart(struct wbsoft_priv *     adapter, int timeout_value);
+//static void vScanTimerStop(struct wbsoft_priv * adapter);
 
 #endif
index ce7e9812739ff669cac860f68571be5575bf19db..32ee391eac861cd9c3497cc5b37fabeaa61c3270 100644 (file)
@@ -23,7 +23,7 @@ Wb35Tx_get_tx_buffer(phw_data_t pHwData, u8 **pBuffer)
        return true;
 }
 
-void Wb35Tx_start(struct wb35_adapter *adapter)
+void Wb35Tx_start(struct wbsoft_priv *adapter)
 {
        phw_data_t pHwData = &adapter->sHwData;
        PWB35TX pWb35Tx = &pHwData->Wb35Tx;
@@ -37,7 +37,7 @@ void Wb35Tx_start(struct wb35_adapter *adapter)
 }
 
 
-void Wb35Tx(struct wb35_adapter *adapter)
+void Wb35Tx(struct wbsoft_priv *adapter)
 {
        phw_data_t      pHwData = &adapter->sHwData;
        PWB35TX         pWb35Tx = &pHwData->Wb35Tx;
@@ -91,7 +91,7 @@ void Wb35Tx(struct wb35_adapter *adapter)
 
 void Wb35Tx_complete(struct urb * pUrb)
 {
-       struct wb35_adapter *adapter = pUrb->context;
+       struct wbsoft_priv *adapter = pUrb->context;
        phw_data_t      pHwData = &adapter->sHwData;
        PWB35TX         pWb35Tx = &pHwData->Wb35Tx;
        PMDS            pMds = &adapter->Mds;
@@ -194,7 +194,7 @@ void Wb35Tx_destroy(phw_data_t pHwData)
        #endif
 }
 
-void Wb35Tx_CurrentTime(struct wb35_adapter *adapter, u32 TimeCount)
+void Wb35Tx_CurrentTime(struct wbsoft_priv *adapter, u32 TimeCount)
 {
        phw_data_t pHwData = &adapter->sHwData;
        PWB35TX pWb35Tx = &pHwData->Wb35Tx;
@@ -211,7 +211,7 @@ void Wb35Tx_CurrentTime(struct wb35_adapter *adapter, u32 TimeCount)
        }
 }
 
-void Wb35Tx_EP2VM_start(struct wb35_adapter *adapter)
+void Wb35Tx_EP2VM_start(struct wbsoft_priv *adapter)
 {
        phw_data_t pHwData = &adapter->sHwData;
        PWB35TX pWb35Tx = &pHwData->Wb35Tx;
@@ -226,7 +226,7 @@ void Wb35Tx_EP2VM_start(struct wb35_adapter *adapter)
 }
 
 
-void Wb35Tx_EP2VM(struct wb35_adapter *adapter)
+void Wb35Tx_EP2VM(struct wbsoft_priv *adapter)
 {
        phw_data_t      pHwData = &adapter->sHwData;
        PWB35TX pWb35Tx = &pHwData->Wb35Tx;
@@ -265,7 +265,7 @@ error:
 
 void Wb35Tx_EP2VM_complete(struct urb * pUrb)
 {
-       struct wb35_adapter *adapter = pUrb->context;
+       struct wbsoft_priv *adapter = pUrb->context;
        phw_data_t      pHwData = &adapter->sHwData;
        T02_DESCRIPTOR  T02, TSTATUS;
        PWB35TX         pWb35Tx = &pHwData->Wb35Tx;
index 466eb6f26c60b4d660046a9f63dbac07b235c3cc..277faa7aaed8b9344085ca5290126f8ea352a926 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __WINBOND_WB35TX_F_H
 #define __WINBOND_WB35TX_F_H
 
-#include "adapter.h"
+#include "core.h"
 #include "wbhal_f.h"
 
 //====================================
@@ -11,16 +11,16 @@ unsigned char Wb35Tx_initial(        phw_data_t pHwData );
 void Wb35Tx_destroy(  phw_data_t pHwData );
 unsigned char Wb35Tx_get_tx_buffer(  phw_data_t pHwData,  u8 **pBuffer );
 
-void Wb35Tx_EP2VM(struct wb35_adapter *adapter);
-void Wb35Tx_EP2VM_start(struct wb35_adapter *adapter);
+void Wb35Tx_EP2VM(struct wbsoft_priv *adapter);
+void Wb35Tx_EP2VM_start(struct wbsoft_priv *adapter);
 void Wb35Tx_EP2VM_complete(struct urb *urb);
 
-void Wb35Tx_start(struct wb35_adapter *adapter);
+void Wb35Tx_start(struct wbsoft_priv *adapter);
 void Wb35Tx_stop(  phw_data_t pHwData );
-void Wb35Tx(struct wb35_adapter *adapter);
+void Wb35Tx(struct wbsoft_priv *adapter);
 void Wb35Tx_complete(struct urb *urb);
 void Wb35Tx_reset_descriptor(  phw_data_t pHwData );
 
-void Wb35Tx_CurrentTime(struct wb35_adapter *adapter,  u32 TimeCount);
+void Wb35Tx_CurrentTime(struct wbsoft_priv *adapter,  u32 TimeCount);
 
 #endif
index 1fb8c3d78467b02816d1462301c295bf964e61f4..163ca3c4f117b320c58d5c5f00de720b2ce55700 100644 (file)
@@ -32,7 +32,7 @@ void hal_get_permanent_address( phw_data_t pHwData, u8 *pethernet_address )
 
 static void hal_led_control(unsigned long data)
 {
-       struct wb35_adapter *adapter = (struct wb35_adapter *) data;
+       struct wbsoft_priv *adapter = (struct wbsoft_priv *) data;
        phw_data_t pHwData = &adapter->sHwData;
        struct wb35_reg *reg = &pHwData->reg;
        u32     LEDSet = (pHwData->SoftwareSet & HAL_LED_SET_MASK) >> HAL_LED_SET_SHIFT;
@@ -316,7 +316,7 @@ static void hal_led_control(unsigned long data)
 }
 
 
-u8 hal_init_hardware(phw_data_t pHwData, struct wb35_adapter * adapter)
+u8 hal_init_hardware(phw_data_t pHwData, struct wbsoft_priv * adapter)
 {
        u16 SoftwareSet;
 
@@ -671,7 +671,7 @@ s32 hal_get_rssi(  phw_data_t pHwData,  u32 *HalRssiArry,  u8 Count )
        return ltmp;
 }
 //----------------------------------------------------------------------------------------------------
-s32 hal_get_rssi_bss(struct wb35_adapter *adapter,  u16 idx,  u8 Count)
+s32 hal_get_rssi_bss(struct wbsoft_priv *adapter,  u16 idx,  u8 Count)
 {
        phw_data_t pHwData = &adapter->sHwData;
        struct wb35_reg *reg = &pHwData->reg;
@@ -841,7 +841,7 @@ void hal_system_power_change(phw_data_t pHwData, u32 PowerState)
        }
 }
 
-void hal_surprise_remove(struct wb35_adapter *adapter)
+void hal_surprise_remove(struct wbsoft_priv *adapter)
 {
        phw_data_t pHwData = &adapter->sHwData;
 
@@ -853,7 +853,7 @@ void hal_surprise_remove(struct wb35_adapter *adapter)
        }
 }
 
-void hal_rate_change(struct wb35_adapter *adapter) // Notify the HAL rate is changing 20060613.1
+void hal_rate_change(struct wbsoft_priv *adapter) // Notify the HAL rate is changing 20060613.1
 {
        phw_data_t pHwData = &adapter->sHwData;
        u8              rate = CURRENT_TX_RATE;
index 4cb4da05540025cad7da5f36fc2187095edd599f..e7a1d611bdeb945ed84a45992d9cef8558143c3e 100644 (file)
@@ -5,7 +5,7 @@
 #include "wb35tx_f.h"
 #include "wb35rx_f.h"
 
-#include "adapter.h"
+#include "core.h"
 
 //====================================================================================
 // Function declaration
@@ -21,7 +21,7 @@ void hal_clear_all_key(  phw_data_t pHwData );
 void hal_get_ethernet_address(  phw_data_t pHwData,  u8 *current_address );
 void hal_set_ethernet_address(  phw_data_t pHwData,  u8 *current_address );
 void hal_get_permanent_address(  phw_data_t pHwData,  u8 *pethernet_address );
-unsigned char hal_init_hardware(  phw_data_t pHwData,  struct wb35_adapter * adapter );
+unsigned char hal_init_hardware(  phw_data_t pHwData,  struct wbsoft_priv * adapter );
 void hal_set_power_save_mode(  phw_data_t pHwData,  unsigned char power_save,  unsigned char wakeup,  unsigned char dtim );
 void hal_get_power_save_mode(  phw_data_t pHwData,   u8 *pin_pwr_save );
 void hal_set_slot_time(  phw_data_t pHwData,  u8 type );
@@ -61,7 +61,7 @@ void hal_set_cwmax(  phw_data_t pHwData,  u16 cwin_max );
 void hal_set_rsn_wpa(  phw_data_t pHwData,  u32 * RSN_IE_Bitmap , u32 * RSN_OUI_type , unsigned char bDesiredAuthMode);
 //s32 hal_get_rssi(  phw_data_t pHwData,  u32 HalRssi );
 s32 hal_get_rssi(  phw_data_t pHwData,  u32 *HalRssiArry,  u8 Count );
-s32 hal_get_rssi_bss(struct wb35_adapter *adapter,  u16 idx,  u8 Count);
+s32 hal_get_rssi_bss(struct wbsoft_priv *adapter,  u16 idx,  u8 Count);
 void hal_set_connect_info(  phw_data_t pHwData,  unsigned char boConnect );
 u8 hal_get_est_sq3(  phw_data_t pHwData,  u8 Count );
 void hal_set_rf_power(  phw_data_t pHwData,  u8 PowerIndex ); // 20060621 Modify
@@ -82,13 +82,13 @@ u8 hal_get_hw_radio_off                     (  phw_data_t pHwData );
 #define hal_scan_interval( _A )                (_A->Scan_Interval)
 void hal_scan_status_indicate(  phw_data_t pHwData, u8 status);        // 0: complete, 1: in progress
 void hal_system_power_change(  phw_data_t pHwData, u32 PowerState ); // 20051230 -=D0 1=D1 ..
-void hal_surprise_remove(struct wb35_adapter *adapter);
+void hal_surprise_remove(struct wbsoft_priv *adapter);
 
 #define PHY_DEBUG( msg, args... )
 
 
 
-void hal_rate_change(struct wb35_adapter *adapter); // Notify the HAL rate is changing 20060613.1
+void hal_rate_change(struct wbsoft_priv *adapter); // Notify the HAL rate is changing 20060613.1
 unsigned char hal_get_dxx_reg(  phw_data_t pHwData,  u16 number,  u32 * pValue );
 unsigned char hal_set_dxx_reg(  phw_data_t pHwData,  u16 number,  u32 value );
 #define hal_get_time_count( _P )       (_P->time_count/10)     // return 100ms count
index d6894f9da83240f92132bfeac9854eae3ff6a8dd..594c0692a93d96289e68ba717b8917abf4b11ce7 100644 (file)
 #include "wblinux_f.h"
 
 unsigned char
-WBLINUX_Initial(struct wb35_adapter * adapter)
+WBLINUX_Initial(struct wbsoft_priv * adapter)
 {
        spin_lock_init( &adapter->SpinLock );
        return true;
 }
 
 void
-WBLINUX_Destroy(struct wb35_adapter * adapter)
+WBLINUX_Destroy(struct wbsoft_priv * adapter)
 {
        WBLINUX_stop( adapter );
 #ifdef _PE_USB_INI_DUMP_
@@ -33,7 +33,7 @@ WBLINUX_Destroy(struct wb35_adapter * adapter)
 }
 
 void
-WBLINUX_stop(  struct wb35_adapter * adapter )
+WBLINUX_stop(  struct wbsoft_priv * adapter )
 {
        struct sk_buff *pSkb;
 
@@ -63,7 +63,7 @@ WBLINUX_stop(  struct wb35_adapter * adapter )
 }
 
 void
-WbWlanHalt(struct wb35_adapter *adapter)
+WbWlanHalt(  struct wbsoft_priv * adapter )
 {
        //---------------------
        adapter->sLocalPara.ShutDowned = true;
@@ -85,7 +85,7 @@ WbWlanHalt(struct wb35_adapter *adapter)
 }
 
 unsigned char
-WbWLanInitialize(struct wb35_adapter *adapter)
+WbWLanInitialize(struct wbsoft_priv * adapter)
 {
        phw_data_t      pHwData;
        u8              *pMacAddr;
index ed2676b22f6b27d1678941a6a67881eab3ddbb66..4b786fcf34ec6dcb22feba55fc6068e71a39dfea 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __WBLINUX_F_H
 #define __WBLINUX_F_H
 
-#include "adapter.h"
+#include "core.h"
 #include "mds_s.h"
 
 //=========================================================================
@@ -9,14 +9,14 @@
 //
 // wblinux_f.h
 //
-unsigned char WBLINUX_Initial(  struct wb35_adapter *adapter );
+unsigned char WBLINUX_Initial(  struct wbsoft_priv *adapter );
 int wb35_start_xmit(struct sk_buff *skb, struct net_device *netdev );
-void WBLINUX_stop(  struct wb35_adapter *adapter );
-void WBLINUX_Destroy(  struct wb35_adapter *adapter );
+void WBLINUX_stop(  struct wbsoft_priv *adapter );
+void WBLINUX_Destroy(  struct wbsoft_priv *adapter );
 void wb35_set_multicast( struct net_device *netdev );
 struct net_device_stats * wb35_netdev_stats( struct net_device *netdev );
-void WBLINUX_stop(  struct wb35_adapter *adapter );
-void WbWlanHalt(  struct wb35_adapter *adapter );
-unsigned char WbWLanInitialize(struct wb35_adapter *adapter);
+void WBLINUX_stop(  struct wbsoft_priv *adapter );
+void WbWlanHalt(  struct wbsoft_priv *adapter );
+unsigned char WbWLanInitialize(struct wbsoft_priv *adapter);
 
 #endif
index d8fa9e56318ad854cb25cced2153c2954c5a35cc..a6bc78e4609d8db129d0788db8151bb603ce5bd9 100644 (file)
@@ -120,7 +120,7 @@ static int wbsoft_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
 {
        struct wbsoft_priv *priv = dev->priv;
 
-       MLMESendFrame(priv->adapter, skb->data, skb->len, FRAME_TYPE_802_11_MANAGEMENT);
+       MLMESendFrame(priv, skb->data, skb->len, FRAME_TYPE_802_11_MANAGEMENT);
 
        return NETDEV_TX_OK;
 }
@@ -144,20 +144,20 @@ static int wbsoft_config(struct ieee80211_hw *dev, struct ieee80211_conf *conf)
        ch.ChanNo = 1;  /* Should use channel_num, or something, as that is already pre-translated */
 
 
-       hal_set_current_channel(&priv->adapter->sHwData, ch);
-       hal_set_beacon_period(&priv->adapter->sHwData, conf->beacon_int);
-//     hal_set_cap_info(&priv->adapter->sHwData, ?? );
+       hal_set_current_channel(&priv->sHwData, ch);
+       hal_set_beacon_period(&priv->sHwData, conf->beacon_int);
+//     hal_set_cap_info(&priv->sHwData, ?? );
 // hal_set_ssid(phw_data_t pHwData,  u8 * pssid,  u8 ssid_len); ??
-       hal_set_accept_broadcast(&priv->adapter->sHwData, 1);
-       hal_set_accept_promiscuous(&priv->adapter->sHwData,  1);
-       hal_set_accept_multicast(&priv->adapter->sHwData,  1);
-       hal_set_accept_beacon(&priv->adapter->sHwData,  1);
-       hal_set_radio_mode(&priv->adapter->sHwData,  0);
+       hal_set_accept_broadcast(&priv->sHwData, 1);
+       hal_set_accept_promiscuous(&priv->sHwData,  1);
+       hal_set_accept_multicast(&priv->sHwData,  1);
+       hal_set_accept_beacon(&priv->sHwData,  1);
+       hal_set_radio_mode(&priv->sHwData,  0);
        //hal_set_antenna_number(  phw_data_t pHwData, u8 number )
        //hal_set_rf_power(phw_data_t pHwData, u8 PowerIndex)
 
 
-//     hal_start_bss(&priv->adapter->sHwData, WLAN_BSSTYPE_INFRASTRUCTURE);    ??
+//     hal_start_bss(&priv->sHwData, WLAN_BSSTYPE_INFRASTRUCTURE);     ??
 
 //void hal_set_rates(phw_data_t pHwData, u8 * pbss_rates,
 //                u8 length, unsigned char basic_rate_set)
@@ -196,7 +196,6 @@ static const struct ieee80211_ops wbsoft_ops = {
 
 static int wb35_probe(struct usb_interface *intf, const struct usb_device_id *id_table)
 {
-       struct wb35_adapter *adapter;
        PWBUSB          pWbUsb;
         struct usb_host_interface *interface;
        struct usb_endpoint_descriptor *endpoint;
@@ -221,13 +220,14 @@ static int wb35_probe(struct usb_interface *intf, const struct usb_device_id *id
                goto error;
        }
 
-       adapter = kzalloc(sizeof(*adapter), GFP_KERNEL);
-       if (!adapter) {
-               err = -ENOMEM;
+       dev = ieee80211_alloc_hw(sizeof(*priv), &wbsoft_ops);
+       if (!dev)
                goto error;
-       }
 
-       pWbUsb = &adapter->sHwData.WbUsb;
+       priv = dev->priv;
+       my_dev = dev;
+
+       pWbUsb = &priv->sHwData.WbUsb;
        pWbUsb->udev = udev;
 
         interface = intf->cur_altsetting;
@@ -238,23 +238,14 @@ static int wb35_probe(struct usb_interface *intf, const struct usb_device_id *id
                pWbUsb->IsUsb20 = 1;
        }
 
-       if (!WbWLanInitialize(adapter)) {
+       if (!WbWLanInitialize(priv)) {
                err = -EINVAL;
-               goto error_free_adapter;
+               goto error_free_hw;
        }
 
-       dev = ieee80211_alloc_hw(sizeof(*priv), &wbsoft_ops);
-       if (!dev)
-               goto error_free_adapter;
-
-       priv = dev->priv;
-       priv->adapter = adapter;
-
-       my_dev = dev;
-
        SET_IEEE80211_DEV(dev, &udev->dev);
        {
-               phw_data_t pHwData = &adapter->sHwData;
+               phw_data_t pHwData = &priv->sHwData;
                unsigned char           dev_addr[MAX_ADDR_LEN];
                hal_get_permanent_address(pHwData, dev_addr);
                SET_IEEE80211_PERM_ADDR(dev, dev_addr);
@@ -272,14 +263,12 @@ static int wb35_probe(struct usb_interface *intf, const struct usb_device_id *id
        if (err)
                goto error_free_hw;
 
-       usb_set_intfdata(intf, adapter);
+       usb_set_intfdata(intf, priv);
 
        return 0;
 
 error_free_hw:
        ieee80211_free_hw(dev);
-error_free_adapter:
-       kfree(adapter);
 error:
        usb_put_dev(udev);
        return err;
@@ -315,9 +304,9 @@ void packet_came(char *pRxBufferAddress, int PacketSize)
 
 static void wb35_disconnect(struct usb_interface *intf)
 {
-       struct wb35_adapter *adapter = usb_get_intfdata(intf);
+       struct wbsoft_priv *priv = usb_get_intfdata(intf);
 
-       WbWlanHalt(adapter);
+       WbWlanHalt(priv);
 
        usb_set_intfdata(intf, NULL);
        usb_put_dev(interface_to_usbdev(intf));