Skip to content

Commit

Permalink
staging: vt6656: change baseband/mac/wcmd/wctl to new structures.
Browse files Browse the repository at this point in the history
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 <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Malcolm Priestley authored and Greg Kroah-Hartman committed Jan 7, 2013
1 parent dd0a774 commit 98583c0
Show file tree
Hide file tree
Showing 8 changed files with 179 additions and 248 deletions.
75 changes: 28 additions & 47 deletions drivers/staging/vt6656/baseband.c
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ s_vClearSQ3Value(PSDevice pDevice);
*
*/
unsigned int
BBuGetFrameTime (
BBuGetFrameTime(
BYTE byPreambleType,
BYTE byPktType,
unsigned int cbFrameLength,
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -968,7 +960,7 @@ BBvSetAntennaMode (PSDevice pDevice, BYTE byAntennaMode)
*
*/

BOOL BBbVT3184Init(PSDevice pDevice)
int BBbVT3184Init(struct vnt_private *pDevice)
{
int ntStatus;
WORD wLength;
Expand Down Expand Up @@ -1161,7 +1153,7 @@ else {
* Return Value: none
*
*/
void BBvLoopbackOn (PSDevice pDevice)
void BBvLoopbackOn(struct vnt_private *pDevice)
{
BYTE byData;

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -1249,8 +1241,7 @@ void BBvLoopbackOff (PSDevice pDevice)
* Return Value: none
*
*/
void
BBvSetShortSlotTime (PSDevice pDevice)
void BBvSetShortSlotTime(struct vnt_private *pDevice)
{
BYTE byBBVGA=0;

Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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++;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -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)
{


Expand Down
43 changes: 18 additions & 25 deletions drivers/staging/vt6656/baseband.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,33 +104,26 @@ BBuGetFrameTime(
WORD wRate
);

void BBvCalculateParameter(PSDevice pDevice,
unsigned int cbFrameLength,
WORD wRate,
BYTE byPacketType,
PWORD pwPhyLen,
PBYTE pbyPhySrv,
PBYTE pbyPhySgn);
void BBvCalculateParameter(struct vnt_private *, u32 cbFrameLength,
u16 wRate, u8 byPacketType, u16 *pwPhyLen, u8 *pbyPhySrv,
u8 *pbyPhySgn);

// timer for antenna diversity

void TimerSQ3CallBack(void *hDeviceContext);
void TimerSQ3Tmax3CallBack(void *hDeviceContext);

void BBvAntennaDiversity(PSDevice pDevice, BYTE byRxRate, BYTE bySQ3);
void BBvLoopbackOn(PSDevice pDevice);
void BBvLoopbackOff(PSDevice pDevice);
void BBvSoftwareReset(PSDevice pDevice);

void BBvSetShortSlotTime(PSDevice pDevice);
void BBvSetVGAGainOffset(PSDevice pDevice, BYTE byData);
void BBvSetAntennaMode(PSDevice pDevice, BYTE byAntennaMode);
BOOL BBbVT3184Init(PSDevice pDevice);
void BBvSetDeepSleep(PSDevice pDevice);
void BBvExitDeepSleep(PSDevice pDevice);
void BBvUpdatePreEDThreshold(
PSDevice pDevice,
BOOL bScanning
);
void TimerSQ3CallBack(struct vnt_private *);
void TimerSQ3Tmax3CallBack(struct vnt_private *);

void BBvAntennaDiversity(struct vnt_private *, u8 byRxRate, u8 bySQ3);
void BBvLoopbackOn(struct vnt_private *);
void BBvLoopbackOff(struct vnt_private *);
void BBvSoftwareReset(struct vnt_private *);

void BBvSetShortSlotTime(struct vnt_private *);
void BBvSetVGAGainOffset(struct vnt_private *, u8 byData);
void BBvSetAntennaMode(struct vnt_private *, u8 byAntennaMode);
int BBbVT3184Init(struct vnt_private *);
void BBvSetDeepSleep(struct vnt_private *);
void BBvExitDeepSleep(struct vnt_private *);
void BBvUpdatePreEDThreshold(struct vnt_private *, int bScanning);

#endif /* __BASEBAND_H__ */
Loading

0 comments on commit 98583c0

Please sign in to comment.