Skip to content

Commit

Permalink
staging: vt6656: channel/control/firmware/int/usbpipe to new structures
Browse files Browse the repository at this point in the history
This patch cleans up function declarations, definitions and local variables
where 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 da033bf commit fe5d00e
Show file tree
Hide file tree
Showing 12 changed files with 104 additions and 234 deletions.
7 changes: 3 additions & 4 deletions drivers/staging/vt6656/channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,11 +436,10 @@ CHvChannelGetList (
}


void CHvInitChannelTable(void *pDeviceHandler)
void CHvInitChannelTable(struct vnt_private *pDevice)
{
PSDevice pDevice = (PSDevice) pDeviceHandler;
BOOL bMultiBand = FALSE;
unsigned int ii;
int bMultiBand = FALSE;
int ii;

for (ii = 1; ii <= CB_MAX_CHANNEL; ii++)
sChannelTbl[ii].bValid = FALSE;
Expand Down
3 changes: 2 additions & 1 deletion drivers/staging/vt6656/channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#ifndef _CHANNEL_H_
#define _CHANNEL_H_

#include "device.h"
#include "ttype.h"

/*--------------------- Export Definitions -------------------------*/
Expand All @@ -47,7 +48,7 @@ typedef struct tagSChannelTblElement {
/*--------------------- Export Functions --------------------------*/

BOOL ChannelValid(unsigned int CountryCode, unsigned int ChannelNum);
void CHvInitChannelTable(void *pDeviceHandler);
void CHvInitChannelTable(struct vnt_private *pDevice);
BYTE CHbyGetChannelMapping(BYTE byChannelNumber);

BOOL CHvChannelGetList(unsigned int uCountryCodeIdx, PBYTE pbyChannelTable);
Expand Down
55 changes: 23 additions & 32 deletions drivers/staging/vt6656/control.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,43 +56,34 @@

/*--------------------- Export Functions --------------------------*/

void ControlvWriteByte(PSDevice pDevice, BYTE byRegType, BYTE byRegOfs,
BYTE byData)
void ControlvWriteByte(struct vnt_private *pDevice, u8 reg, u8 reg_off,
u8 data)
{
BYTE byData1;
byData1 = byData;
CONTROLnsRequestOut(pDevice,
MESSAGE_TYPE_WRITE,
byRegOfs,
byRegType,
1,
&byData1);

CONTROLnsRequestOut(pDevice, MESSAGE_TYPE_WRITE, reg_off, reg,
sizeof(u8), &data);

return;
}

void ControlvReadByte(PSDevice pDevice, BYTE byRegType, BYTE byRegOfs,
PBYTE pbyData)
void ControlvReadByte(struct vnt_private *pDevice, u8 reg, u8 reg_off,
u8 *data)
{
int ntStatus;
BYTE byData1;
ntStatus = CONTROLnsRequestIn(pDevice,
MESSAGE_TYPE_READ,
byRegOfs,
byRegType,
1,
&byData1);
*pbyData = byData1;
CONTROLnsRequestIn(pDevice, MESSAGE_TYPE_READ,
reg_off, reg, sizeof(u8), data);
return;
}

void ControlvMaskByte(PSDevice pDevice, BYTE byRegType, BYTE byRegOfs,
BYTE byMask, BYTE byData)
void ControlvMaskByte(struct vnt_private *pDevice, u8 reg_type, u8 reg_off,
u8 reg_mask, u8 data)
{
BYTE pbyData[2];
pbyData[0] = byData;
pbyData[1] = byMask;
CONTROLnsRequestOut(pDevice,
MESSAGE_TYPE_WRITE_MASK,
byRegOfs,
byRegType,
2,
pbyData);
u8 reg_data[2];

reg_data[0] = data;
reg_data[1] = reg_mask;

CONTROLnsRequestOut(pDevice, MESSAGE_TYPE_WRITE_MASK, reg_off,
reg_type, ARRAY_SIZE(reg_data), reg_data);

return;
}
26 changes: 6 additions & 20 deletions drivers/staging/vt6656/control.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,28 +51,14 @@

/*--------------------- Export Functions --------------------------*/

void ControlvWriteByte(
PSDevice pDevice,
BYTE byRegType,
BYTE byRegOfs,
BYTE byData
);
void ControlvWriteByte(struct vnt_private *pDevice, u8 reg, u8 reg_off,
u8 data);

void ControlvReadByte(struct vnt_private *pDevice, u8 reg, u8 reg_off,
u8 *data);

void ControlvReadByte(
PSDevice pDevice,
BYTE byRegType,
BYTE byRegOfs,
PBYTE pbyData
);
void ControlvMaskByte(struct vnt_private *pDevice, u8 reg_type, u8 reg_off,
u8 reg_mask, u8 data);


void ControlvMaskByte(
PSDevice pDevice,
BYTE byRegType,
BYTE byRegOfs,
BYTE byMask,
BYTE byData
);

#endif /* __CONTROL_H__ */
17 changes: 4 additions & 13 deletions drivers/staging/vt6656/firmware.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,7 @@ static int msglevel =MSG_LEVEL_INFO;
/*--------------------- Export Functions --------------------------*/


BOOL
FIRMWAREbDownload(
PSDevice pDevice
)
int FIRMWAREbDownload(struct vnt_private *pDevice)
{
struct device *dev = &pDevice->usb->dev;
const struct firmware *fw;
Expand Down Expand Up @@ -114,12 +111,9 @@ FIRMWAREbDownload(
}
MODULE_FIRMWARE(FIRMWARE_NAME);

BOOL
FIRMWAREbBrach2Sram(
PSDevice pDevice
)
int FIRMWAREbBrach2Sram(struct vnt_private *pDevice)
{
int NdisStatus;
int NdisStatus;

DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---->Branch to Sram\n");

Expand All @@ -139,10 +133,7 @@ FIRMWAREbBrach2Sram(
}


BOOL
FIRMWAREbCheckVersion(
PSDevice pDevice
)
int FIRMWAREbCheckVersion(struct vnt_private *pDevice)
{
int ntStatus;

Expand Down
17 changes: 3 additions & 14 deletions drivers/staging/vt6656/firmware.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,8 @@

/*--------------------- Export Functions --------------------------*/

BOOL
FIRMWAREbDownload(
PSDevice pDevice
);

BOOL
FIRMWAREbBrach2Sram(
PSDevice pDevice
);

BOOL
FIRMWAREbCheckVersion(
PSDevice pDevice
);
int FIRMWAREbDownload(struct vnt_private *);
int FIRMWAREbBrach2Sram(struct vnt_private *);
int FIRMWAREbCheckVersion(struct vnt_private *);

#endif /* __FIRMWARE_H__ */
7 changes: 3 additions & 4 deletions drivers/staging/vt6656/int.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,8 @@ static int msglevel = MSG_LEVEL_INFO; /* MSG_LEVEL_DEBUG */
* if we've gotten no data
*
-*/
void INTvWorkItem(void *Context)
void INTvWorkItem(struct vnt_private *pDevice)
{
PSDevice pDevice = Context;
int ntStatus;

DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---->Interrupt Polling Thread\n");
Expand All @@ -88,10 +87,10 @@ void INTvWorkItem(void *Context)
spin_unlock_irq(&pDevice->lock);
}

void INTnsProcessData(PSDevice pDevice)
void INTnsProcessData(struct vnt_private *pDevice)
{
PSINTData pINTData;
PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
struct vnt_manager *pMgmt = &pDevice->vnt_mgmt;
struct net_device_stats *pStats = &pDevice->stats;

DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---->s_nsInterruptProcessData\n");
Expand Down
4 changes: 2 additions & 2 deletions drivers/staging/vt6656/int.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ SINTData, *PSINTData;

/*--------------------- Export Functions --------------------------*/

void INTvWorkItem(void *Context);
void INTnsProcessData(PSDevice pDevice);
void INTvWorkItem(struct vnt_private *);
void INTnsProcessData(struct vnt_private *);

#endif /* __INT_H__ */
Loading

0 comments on commit fe5d00e

Please sign in to comment.