+++ /dev/null
-#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
#ifndef __WINBOND_BSS_F_H
#define __WINBOND_BSS_F_H
-#include "adapter.h"
+#include "core.h"
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
#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 */
#include "wblinux_f.h"
void
-Mds_reset_descriptor(struct wb35_adapter * adapter)
+Mds_reset_descriptor(struct wbsoft_priv * adapter)
{
PMDS pMds = &adapter->Mds;
}
unsigned char
-Mds_initial(struct wb35_adapter * adapter)
+Mds_initial(struct wbsoft_priv * adapter)
{
PMDS pMds = &adapter->Mds;
}
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;
}
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;
}
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
// 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;
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;
#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
#include "mds_f.h"
-void MLMEResetTxRx(struct wb35_adapter * adapter)
+void MLMEResetTxRx(struct wbsoft_priv * adapter)
{
s32 i;
//=============================================================================
/* 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;
}
//=============================================================================
-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 */
{
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;
desc->Type = adapter->sMlmeFrame.DataType;
}
-void MLMEfreeMMPDUBuffer(struct wb35_adapter * adapter, s8 *pData)
+void MLMEfreeMMPDUBuffer(struct wbsoft_priv * adapter, s8 *pData)
{
int i;
}
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;
#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
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
} 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)
#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);
#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;
add_timer(&adapter->Mds.timer);
}
-void vRxTimerStop(struct wb35_adapter *adapter)
+void vRxTimerStop(struct wbsoft_priv *adapter)
{
del_timer_sync(&adapter->Mds.timer);
}
// 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
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;
}
-void Wb35Tx(struct wb35_adapter *adapter)
+void Wb35Tx(struct wbsoft_priv *adapter)
{
phw_data_t pHwData = &adapter->sHwData;
PWB35TX pWb35Tx = &pHwData->Wb35Tx;
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;
#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;
}
}
-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;
}
-void Wb35Tx_EP2VM(struct wb35_adapter *adapter)
+void Wb35Tx_EP2VM(struct wbsoft_priv *adapter)
{
phw_data_t pHwData = &adapter->sHwData;
PWB35TX pWb35Tx = &pHwData->Wb35Tx;
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;
#ifndef __WINBOND_WB35TX_F_H
#define __WINBOND_WB35TX_F_H
-#include "adapter.h"
+#include "core.h"
#include "wbhal_f.h"
//====================================
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
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;
}
-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;
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;
}
}
-void hal_surprise_remove(struct wb35_adapter *adapter)
+void hal_surprise_remove(struct wbsoft_priv *adapter)
{
phw_data_t pHwData = &adapter->sHwData;
}
}
-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;
#include "wb35tx_f.h"
#include "wb35rx_f.h"
-#include "adapter.h"
+#include "core.h"
//====================================================================================
// Function declaration
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 );
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
#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
#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_
}
void
-WBLINUX_stop( struct wb35_adapter * adapter )
+WBLINUX_stop( struct wbsoft_priv * adapter )
{
struct sk_buff *pSkb;
}
void
-WbWlanHalt(struct wb35_adapter *adapter)
+WbWlanHalt( struct wbsoft_priv * adapter )
{
//---------------------
adapter->sLocalPara.ShutDowned = true;
}
unsigned char
-WbWLanInitialize(struct wb35_adapter *adapter)
+WbWLanInitialize(struct wbsoft_priv * adapter)
{
phw_data_t pHwData;
u8 *pMacAddr;
#ifndef __WBLINUX_F_H
#define __WBLINUX_F_H
-#include "adapter.h"
+#include "core.h"
#include "mds_s.h"
//=========================================================================
//
// 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
{
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;
}
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)
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;
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;
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);
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;
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));