staging: vt6656: change baseband/mac/wcmd/wctl to new structures.
PATCH 3/11 staging: vt6656: change baseband/mac/wcmd/wctl to new structures.
This patch also cleans up function declarations, definitions and local variables were appropriate replacing types defined in "ttype.h" with linux/types.h.
Signed-off-by Malcolm Priestley <[email protected]>
--- drivers/staging/vt6656/baseband.c | 75 +++++++----------- drivers/staging/vt6656/baseband.h | 43 +++++------ drivers/staging/vt6656/mac.c | 83 ++++++++++---------- drivers/staging/vt6656/mac.h | 35 ++++----- drivers/staging/vt6656/wcmd.c | 159 ++++++++++++++------------------------ drivers/staging/vt6656/wcmd.h | 12 ++- drivers/staging/vt6656/wctl.c | 12 +-- drivers/staging/vt6656/wctl.h | 8 +- 8 files changed, 179 insertions(+), 248 deletions(-)
drivers/staging/vt6656/baseband.c +28 -47
@@ -690,7 +690,7 @@ s_vClearSQ3Value(PSDevice pDevice);* */ unsigned int -BBuGetFrameTime ( +BBuGetFrameTime( BYTE byPreambleType, BYTE byPktType, unsigned int cbFrameLength,
@@ -756,23 +756,16 @@ BBuGetFrameTime (* Return Value: none * */ -void -BBvCalculateParameter ( -PSDevice pDevice, -unsigned int cbFrameLength, -WORD wRate, -BYTE byPacketType, -PWORD pwPhyLen, -PBYTE pbyPhySrv, -PBYTE pbyPhySgn - ) +void BBvCalculateParameter (struct vnt_private *pDevice,u32 cbFrameLength, +u16 wRate,u8 byPacketType,u16 *pwPhyLen,u8 *pbyPhySrv, +u8 *pbyPhySgn) { -unsigned int cbBitCount; -unsigned int cbUsCount =0 ; -unsigned int cbTmp; -BOOL bExtBit; -BYTE byPreambleType = pDevice->byPreambleType; -BOOL bCCK = pDevice->bCCK; +u32 cbBitCount; +u32 cbUsCount =0 ; +u32 cbTmp; +int bExtBit; +u8 byPreambleType = pDevice->byPreambleType; +int bCCK = pDevice->bCCK; cbBitCount = cbFrameLength *8 ; bExtBit = FALSE;
@@ -929,8 +922,7 @@ BBvCalculateParameter (* Return Value: none * */ -void -BBvSetAntennaMode (PSDevice pDevice,BYTE byAntennaMode) +void BBvSetAntennaMode (struct vnt_private *pDevice,u8 byAntennaMode) {switch (byAntennaMode) {case ANT_TXA :
@@ -968,7 +960,7 @@ BBvSetAntennaMode (PSDevice pDevice, BYTE byAntennaMode)* */ -BOOL BBbVT3184Init (PSDevice pDevice) +int BBbVT3184Init (struct vnt_private *pDevice) {int ntStatus;WORD wLength;
@@ -1161,7 +1153,7 @@ else {* Return Value: none * */ -void BBvLoopbackOn (PSDevice pDevice) +void BBvLoopbackOn (struct vnt_private *pDevice) {BYTE byData;
@@ -1214,9 +1206,9 @@ void BBvLoopbackOn (PSDevice pDevice)* Return Value: none * */ -void BBvLoopbackOff (PSDevice pDevice) +void BBvLoopbackOff (struct vnt_private *pDevice) { -BYTE byData; +u8 byData;ControlvWriteByte (pDevice,MESSAGE_REQUEST_BBREG ,0xC9 , pDevice->byBBCRc9);//CR201 ControlvWriteByte (pDevice,MESSAGE_REQUEST_BBREG ,0x88 , pDevice->byBBCR88);//CR136
@@ -1249,8 +1241,7 @@ void BBvLoopbackOff (PSDevice pDevice)* Return Value: none * */ -void -BBvSetShortSlotTime (PSDevice pDevice) +void BBvSetShortSlotTime (struct vnt_private *pDevice) {BYTE byBBVGA=0 ;
@@ -1267,7 +1258,7 @@ BBvSetShortSlotTime (PSDevice pDevice) } -void BBvSetVGAGainOffset (PSDevice pDevice,BYTE byData) +void BBvSetVGAGainOffset (struct vnt_private *pDevice,BYTE byData) {ControlvWriteByte (pDevice,MESSAGE_REQUEST_BBREG ,0xE7 , byData);
@@ -1294,8 +1285,7 @@ void BBvSetVGAGainOffset(PSDevice pDevice, BYTE byData)* Return Value: none * */ -void -BBvSoftwareReset (PSDevice pDevice) +void BBvSoftwareReset (struct vnt_private *pDevice) {ControlvWriteByte (pDevice,MESSAGE_REQUEST_BBREG ,0x50 ,0x40 );ControlvWriteByte (pDevice,MESSAGE_REQUEST_BBREG ,0x50 ,0 );
@@ -1315,22 +1305,20 @@ BBvSoftwareReset (PSDevice pDevice)* Return Value: none * */ -void -BBvSetDeepSleep (PSDevice pDevice) +void BBvSetDeepSleep (struct vnt_private *pDevice) {ControlvWriteByte (pDevice,MESSAGE_REQUEST_BBREG ,0x0c ,0x17 );//CR12 ControlvWriteByte (pDevice,MESSAGE_REQUEST_BBREG ,0x0D ,0xB9 );//CR13 } -void -BBvExitDeepSleep (PSDevice pDevice) +void BBvExitDeepSleep (struct vnt_private *pDevice) {ControlvWriteByte (pDevice,MESSAGE_REQUEST_BBREG ,0x0C ,0x00 );//CR12 ControlvWriteByte (pDevice,MESSAGE_REQUEST_BBREG ,0x0D ,0x01 );//CR13 } -static unsigned long s_ulGetLowSQ3 (PSDevice pDevice) +static unsigned long s_ulGetLowSQ3 (struct vnt_private *pDevice) {int ii;unsigned long ulSQ3 =0 ;
@@ -1349,7 +1337,7 @@ static unsigned long s_ulGetLowSQ3(PSDevice pDevice)return ulSQ3; } -static unsigned long s_ulGetRatio (PSDevice pDevice) +static unsigned long s_ulGetRatio (struct vnt_private *pDevice) {int ii, jj;unsigned long ulRatio =0 ;
@@ -1377,9 +1365,7 @@ static unsigned long s_ulGetRatio(PSDevice pDevice) } -static -void -s_vClearSQ3Value (PSDevice pDevice) +static void s_vClearSQ3Value (struct vnt_private *pDevice) {int ii; pDevice->uDiversityCnt =0 ;
@@ -1406,8 +1392,8 @@ s_vClearSQ3Value (PSDevice pDevice)* */ -void -BBvAntennaDiversity (PSDevice pDevice,BYTE byRxRate,BYTE bySQ3) +void BBvAntennaDiversity (struct vnt_private *pDevice, +u8 byRxRate,u8 bySQ3) { pDevice->uDiversityCnt++;
@@ -1541,9 +1527,8 @@ BBvAntennaDiversity (PSDevice pDevice, BYTE byRxRate, BYTE bySQ3)* -*/ -void TimerSQ3CallBack (void *hDeviceContext) +void TimerSQ3CallBack (struct vnt_private *pDevice) { -PSDevice pDevice = (PSDevice )hDeviceContext;DBG_PRT (MSG_LEVEL_DEBUG ,KERN_INFO "TimerSQ3CallBack..." );spin_lock_irq (&pDevice->lock);
@@ -1579,9 +1564,8 @@ void TimerSQ3CallBack(void *hDeviceContext)* -*/ -void TimerSQ3Tmax3CallBack (void *hDeviceContext) +void TimerSQ3Tmax3CallBack (struct vnt_private *pDevice) { -PSDevice pDevice = (PSDevice )hDeviceContext;DBG_PRT (MSG_LEVEL_DEBUG ,KERN_INFO "TimerSQ3Tmax3CallBack..." );spin_lock_irq (&pDevice->lock);
@@ -1607,10 +1591,7 @@ void TimerSQ3Tmax3CallBack(void *hDeviceContext)spin_unlock_irq (&pDevice->lock); } -void -BBvUpdatePreEDThreshold ( -PSDevice pDevice, -BOOL bScanning) +void BBvUpdatePreEDThreshold (struct vnt_private *pDevice,int bScanning) {
drivers/staging/vt6656/baseband.h +18 -25
51 lines not on this page · raw message
drivers/staging/vt6656/mac.c +41 -42
195 lines not on this page · raw message
drivers/staging/vt6656/mac.h +16 -19
@@ -420,24 +420,21 @@/*--------------------- Export Functions --------------------------*/ -void MACvSetMultiAddrByHash (PSDevice pDevice,BYTE byHashIdx); -void MACvWriteMultiAddr (PSDevice pDevice,unsigned int uByteIdx,BYTE byData); -void MACbShutdown (PSDevice pDevice); -void MACvSetBBType (PSDevice pDevice,BYTE byType); -void MACvSetMISCFifo (PSDevice pDevice,WORD wOffset,DWORD dwData); -void MACvDisableKeyEntry (PSDevice pDevice,unsigned int uEntryIdx); -void MACvSetKeyEntry (PSDevice pDevice,WORD wKeyCtl,unsigned int uEntryIdx, -unsigned int uKeyIdx,PBYTE pbyAddr,PDWORD pdwKey); - -void MACvRegBitsOff (PSDevice pDevice,BYTE byRegOfs,BYTE byBits); -void MACvRegBitsOn (PSDevice pDevice,BYTE byRegOfs,BYTE byBits); -void MACvWriteWord (PSDevice pDevice,BYTE byRegOfs,WORD wData); - -void MACvWriteBSSIDAddress (PSDevice pDevice,PBYTE pbyEtherAddr); -void MACvEnableProtectMD (PSDevice pDevice); -void MACvDisableProtectMD (PSDevice pDevice); -void MACvEnableBarkerPreambleMd (PSDevice pDevice); -void MACvDisableBarkerPreambleMd (PSDevice pDevice); -void MACvWriteBeaconInterval (PSDevice pDevice,WORD wInterval); +void MACvSetMultiAddrByHash (struct vnt_private *,u8 ); +void MACvWriteMultiAddr (struct vnt_private *,u32 ,u8 ); +void MACbShutdown (struct vnt_private *); +void MACvSetBBType (struct vnt_private *,u8 ); +void MACvSetMISCFifo (struct vnt_private *pDevice,u16 ,u32 ); +void MACvDisableKeyEntry (struct vnt_private *,u32 ); +void MACvSetKeyEntry (struct vnt_private *,u16 ,u32 ,u32 ,u8 *,u32 *); +void MACvRegBitsOff (struct vnt_private *,u8 ,u8 ); +void MACvRegBitsOn (struct vnt_private *,u8 ,u8 ); +void MACvWriteWord (struct vnt_private *,u8 ,u16 ); +void MACvWriteBSSIDAddress (struct vnt_private *,u8 *); +void MACvEnableProtectMD (struct vnt_private *); +void MACvDisableProtectMD (struct vnt_private *); +void MACvEnableBarkerPreambleMd (struct vnt_private *); +void MACvDisableBarkerPreambleMd (struct vnt_private *); +void MACvWriteBeaconInterval (struct vnt_private *,u16 );#endif /* __MAC_H__ */
drivers/staging/vt6656/wcmd.c +60 -99
255 lines not on this page · raw message
drivers/staging/vt6656/wcmd.h +5 -7
@@ -28,7 +28,6 @@#ifndef __WCMD_H__#define __WCMD_H__ -#include "ttype.h" #include "80211hdr.h" #include "80211mgr.h"
@@ -112,14 +111,13 @@ typedef enum tagCMD_STATE {/*--------------------- Export Types ------------------------------*/ /*--------------------- Export Functions --------------------------*/ +struct vnt_private ; -void vResetCommandTimer (void *hDeviceContext); +void vResetCommandTimer (struct vnt_private *); -BOOL bScheduleCommand (void *hDeviceContext, -CMD_CODE eCommand, -PBYTE pbyItem0); +int bScheduleCommand (struct vnt_private *,CMD_CODE eCommand,u8 *pbyItem0); -void vRunCommand (void *hDeviceContext); +void vRunCommand (struct vnt_private *);/* void
@@ -128,6 +126,6 @@ WCMDvCommandThread(); */ -void BSSvSecondTxData (void *hDeviceContext); +void BSSvSecondTxData (struct vnt_private *);#endif /* __WCMD_H__ */
drivers/staging/vt6656/wctl.c +7 -5
@@ -113,7 +113,8 @@ BOOL WCTLbIsDuplicate (PSCache pCache, PS802_11Header pMACHeader)* */ -unsigned int WCTLuSearchDFCB (PSDevice pDevice,PS802_11Header pMACHeader) +unsigned int WCTLuSearchDFCB (struct vnt_private *pDevice, +PS802_11Header pMACHeader) {unsigned int ii;
@@ -141,7 +142,8 @@ unsigned int WCTLuSearchDFCB(PSDevice pDevice, PS802_11Header pMACHeader)* Return Value: index number in Defragment Database * */ -unsigned int WCTLuInsertDFCB (PSDevice pDevice,PS802_11Header pMACHeader) +unsigned int WCTLuInsertDFCB (struct vnt_private *pDevice, +PS802_11Header pMACHeader) {unsigned int ii;
@@ -180,10 +182,10 @@ unsigned int WCTLuInsertDFCB(PSDevice pDevice, PS802_11Header pMACHeader)* Return Value: TRUE if it is valid fragment packet and we have resource to defragment; otherwise FALSE * */ -BOOL WCTLbHandleFragment (PSDevice pDevice,PS802_11Header pMACHeader, -unsigned int cbFrameLength,BOOL bWEP,BOOL bExtIV) +int WCTLbHandleFragment (struct vnt_private *pDevice,PS802_11Header pMACHeader, +unsigned int cbFrameLength,int bWEP,int bExtIV) { -unsigned int uHeaderSize; +unsigned int uHeaderSize;if (bWEP == TRUE) {
drivers/staging/vt6656/wctl.h +4 -4
@@ -97,9 +97,9 @@/*--------------------- Export Functions --------------------------*/ BOOL WCTLbIsDuplicate (PSCache pCache,PS802_11Header pMACHeader); -BOOL WCTLbHandleFragment (PSDevice pDevice,PS802_11Header pMACHeader, -unsigned int cbFrameLength,BOOL bWEP,BOOL bExtIV); -unsigned int WCTLuSearchDFCB (PSDevice pDevice,PS802_11Header pMACHeader); -unsigned int WCTLuInsertDFCB (PSDevice pDevice,PS802_11Header pMACHeader); +int WCTLbHandleFragment (struct vnt_private *,PS802_11Header pMACHeader, +unsigned int cbFrameLength,BOOL bWEP,BOOL bExtIV); +unsigned int WCTLuSearchDFCB (struct vnt_private *,PS802_11Header pMACHeader); +unsigned int WCTLuInsertDFCB (struct vnt_private *,PS802_11Header pMACHeader);#endif /* __WCTL_H__ */
Signature · 1 line
1.8.0