Commit fe5d00eb authored by Malcolm Priestley's avatar Malcolm Priestley Committed by Greg Kroah-Hartman

staging: vt6656: channel/control/firmware/int/usbpipe to new structures

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: default avatarMalcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent da033bfd
...@@ -436,11 +436,10 @@ CHvChannelGetList ( ...@@ -436,11 +436,10 @@ CHvChannelGetList (
} }
void CHvInitChannelTable(void *pDeviceHandler) void CHvInitChannelTable(struct vnt_private *pDevice)
{ {
PSDevice pDevice = (PSDevice) pDeviceHandler; int bMultiBand = FALSE;
BOOL bMultiBand = FALSE; int ii;
unsigned int ii;
for (ii = 1; ii <= CB_MAX_CHANNEL; ii++) for (ii = 1; ii <= CB_MAX_CHANNEL; ii++)
sChannelTbl[ii].bValid = FALSE; sChannelTbl[ii].bValid = FALSE;
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#ifndef _CHANNEL_H_ #ifndef _CHANNEL_H_
#define _CHANNEL_H_ #define _CHANNEL_H_
#include "device.h"
#include "ttype.h" #include "ttype.h"
/*--------------------- Export Definitions -------------------------*/ /*--------------------- Export Definitions -------------------------*/
...@@ -47,7 +48,7 @@ typedef struct tagSChannelTblElement { ...@@ -47,7 +48,7 @@ typedef struct tagSChannelTblElement {
/*--------------------- Export Functions --------------------------*/ /*--------------------- Export Functions --------------------------*/
BOOL ChannelValid(unsigned int CountryCode, unsigned int ChannelNum); BOOL ChannelValid(unsigned int CountryCode, unsigned int ChannelNum);
void CHvInitChannelTable(void *pDeviceHandler); void CHvInitChannelTable(struct vnt_private *pDevice);
BYTE CHbyGetChannelMapping(BYTE byChannelNumber); BYTE CHbyGetChannelMapping(BYTE byChannelNumber);
BOOL CHvChannelGetList(unsigned int uCountryCodeIdx, PBYTE pbyChannelTable); BOOL CHvChannelGetList(unsigned int uCountryCodeIdx, PBYTE pbyChannelTable);
......
...@@ -56,43 +56,34 @@ ...@@ -56,43 +56,34 @@
/*--------------------- Export Functions --------------------------*/ /*--------------------- Export Functions --------------------------*/
void ControlvWriteByte(PSDevice pDevice, BYTE byRegType, BYTE byRegOfs, void ControlvWriteByte(struct vnt_private *pDevice, u8 reg, u8 reg_off,
BYTE byData) u8 data)
{ {
BYTE byData1;
byData1 = byData; CONTROLnsRequestOut(pDevice, MESSAGE_TYPE_WRITE, reg_off, reg,
CONTROLnsRequestOut(pDevice, sizeof(u8), &data);
MESSAGE_TYPE_WRITE,
byRegOfs, return;
byRegType,
1,
&byData1);
} }
void ControlvReadByte(PSDevice pDevice, BYTE byRegType, BYTE byRegOfs, void ControlvReadByte(struct vnt_private *pDevice, u8 reg, u8 reg_off,
PBYTE pbyData) u8 *data)
{ {
int ntStatus; CONTROLnsRequestIn(pDevice, MESSAGE_TYPE_READ,
BYTE byData1; reg_off, reg, sizeof(u8), data);
ntStatus = CONTROLnsRequestIn(pDevice, return;
MESSAGE_TYPE_READ,
byRegOfs,
byRegType,
1,
&byData1);
*pbyData = byData1;
} }
void ControlvMaskByte(PSDevice pDevice, BYTE byRegType, BYTE byRegOfs, void ControlvMaskByte(struct vnt_private *pDevice, u8 reg_type, u8 reg_off,
BYTE byMask, BYTE byData) u8 reg_mask, u8 data)
{ {
BYTE pbyData[2]; u8 reg_data[2];
pbyData[0] = byData;
pbyData[1] = byMask; reg_data[0] = data;
CONTROLnsRequestOut(pDevice, reg_data[1] = reg_mask;
MESSAGE_TYPE_WRITE_MASK,
byRegOfs, CONTROLnsRequestOut(pDevice, MESSAGE_TYPE_WRITE_MASK, reg_off,
byRegType, reg_type, ARRAY_SIZE(reg_data), reg_data);
2,
pbyData); return;
} }
...@@ -51,28 +51,14 @@ ...@@ -51,28 +51,14 @@
/*--------------------- Export Functions --------------------------*/ /*--------------------- Export Functions --------------------------*/
void ControlvWriteByte( void ControlvWriteByte(struct vnt_private *pDevice, u8 reg, u8 reg_off,
PSDevice pDevice, u8 data);
BYTE byRegType,
BYTE byRegOfs,
BYTE byData
);
void ControlvReadByte(struct vnt_private *pDevice, u8 reg, u8 reg_off,
u8 *data);
void ControlvReadByte( void ControlvMaskByte(struct vnt_private *pDevice, u8 reg_type, u8 reg_off,
PSDevice pDevice, u8 reg_mask, u8 data);
BYTE byRegType,
BYTE byRegOfs,
PBYTE pbyData
);
void ControlvMaskByte(
PSDevice pDevice,
BYTE byRegType,
BYTE byRegOfs,
BYTE byMask,
BYTE byData
);
#endif /* __CONTROL_H__ */ #endif /* __CONTROL_H__ */
...@@ -56,10 +56,7 @@ static int msglevel =MSG_LEVEL_INFO; ...@@ -56,10 +56,7 @@ static int msglevel =MSG_LEVEL_INFO;
/*--------------------- Export Functions --------------------------*/ /*--------------------- Export Functions --------------------------*/
BOOL int FIRMWAREbDownload(struct vnt_private *pDevice)
FIRMWAREbDownload(
PSDevice pDevice
)
{ {
struct device *dev = &pDevice->usb->dev; struct device *dev = &pDevice->usb->dev;
const struct firmware *fw; const struct firmware *fw;
...@@ -114,10 +111,7 @@ FIRMWAREbDownload( ...@@ -114,10 +111,7 @@ FIRMWAREbDownload(
} }
MODULE_FIRMWARE(FIRMWARE_NAME); MODULE_FIRMWARE(FIRMWARE_NAME);
BOOL int FIRMWAREbBrach2Sram(struct vnt_private *pDevice)
FIRMWAREbBrach2Sram(
PSDevice pDevice
)
{ {
int NdisStatus; int NdisStatus;
...@@ -139,10 +133,7 @@ FIRMWAREbBrach2Sram( ...@@ -139,10 +133,7 @@ FIRMWAREbBrach2Sram(
} }
BOOL int FIRMWAREbCheckVersion(struct vnt_private *pDevice)
FIRMWAREbCheckVersion(
PSDevice pDevice
)
{ {
int ntStatus; int ntStatus;
......
...@@ -41,19 +41,8 @@ ...@@ -41,19 +41,8 @@
/*--------------------- Export Functions --------------------------*/ /*--------------------- Export Functions --------------------------*/
BOOL int FIRMWAREbDownload(struct vnt_private *);
FIRMWAREbDownload( int FIRMWAREbBrach2Sram(struct vnt_private *);
PSDevice pDevice int FIRMWAREbCheckVersion(struct vnt_private *);
);
BOOL
FIRMWAREbBrach2Sram(
PSDevice pDevice
);
BOOL
FIRMWAREbCheckVersion(
PSDevice pDevice
);
#endif /* __FIRMWARE_H__ */ #endif /* __FIRMWARE_H__ */
...@@ -75,9 +75,8 @@ static int msglevel = MSG_LEVEL_INFO; /* MSG_LEVEL_DEBUG */ ...@@ -75,9 +75,8 @@ static int msglevel = MSG_LEVEL_INFO; /* MSG_LEVEL_DEBUG */
* if we've gotten no data * if we've gotten no data
* *
-*/ -*/
void INTvWorkItem(void *Context) void INTvWorkItem(struct vnt_private *pDevice)
{ {
PSDevice pDevice = Context;
int ntStatus; int ntStatus;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---->Interrupt Polling Thread\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---->Interrupt Polling Thread\n");
...@@ -88,10 +87,10 @@ void INTvWorkItem(void *Context) ...@@ -88,10 +87,10 @@ void INTvWorkItem(void *Context)
spin_unlock_irq(&pDevice->lock); spin_unlock_irq(&pDevice->lock);
} }
void INTnsProcessData(PSDevice pDevice) void INTnsProcessData(struct vnt_private *pDevice)
{ {
PSINTData pINTData; PSINTData pINTData;
PSMgmtObject pMgmt = &(pDevice->sMgmtObj); struct vnt_manager *pMgmt = &pDevice->vnt_mgmt;
struct net_device_stats *pStats = &pDevice->stats; struct net_device_stats *pStats = &pDevice->stats;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---->s_nsInterruptProcessData\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---->s_nsInterruptProcessData\n");
......
...@@ -65,7 +65,7 @@ SINTData, *PSINTData; ...@@ -65,7 +65,7 @@ SINTData, *PSINTData;
/*--------------------- Export Functions --------------------------*/ /*--------------------- Export Functions --------------------------*/
void INTvWorkItem(void *Context); void INTvWorkItem(struct vnt_private *);
void INTnsProcessData(PSDevice pDevice); void INTnsProcessData(struct vnt_private *);
#endif /* __INT_H__ */ #endif /* __INT_H__ */
...@@ -67,51 +67,18 @@ static int msglevel =MSG_LEVEL_INFO; ...@@ -67,51 +67,18 @@ static int msglevel =MSG_LEVEL_INFO;
/*--------------------- Static Variables --------------------------*/ /*--------------------- Static Variables --------------------------*/
/*--------------------- Static Functions --------------------------*/ /*--------------------- Static Functions --------------------------*/
static static void s_nsInterruptUsbIoCompleteRead(struct urb *urb);
void static void s_nsBulkInUsbIoCompleteRead(struct urb *urb);
s_nsInterruptUsbIoCompleteRead( static void s_nsBulkOutIoCompleteWrite(struct urb *urb);
struct urb *urb static void s_nsControlInUsbIoCompleteRead(struct urb *urb);
); static void s_nsControlInUsbIoCompleteWrite(struct urb *urb);
static
void
s_nsBulkInUsbIoCompleteRead(
struct urb *urb
);
static
void
s_nsBulkOutIoCompleteWrite(
struct urb *urb
);
static
void
s_nsControlInUsbIoCompleteRead(
struct urb *urb
);
static
void
s_nsControlInUsbIoCompleteWrite(
struct urb *urb
);
/*--------------------- Export Variables --------------------------*/ /*--------------------- Export Variables --------------------------*/
/*--------------------- Export Functions --------------------------*/ /*--------------------- Export Functions --------------------------*/
int PIPEnsControlOutAsyn( int PIPEnsControlOutAsyn(struct vnt_private *pDevice, u8 byRequest,
PSDevice pDevice, u16 wValue, u16 wIndex, u16 wLength, u8 *pbyBuffer)
BYTE byRequest,
WORD wValue,
WORD wIndex,
WORD wLength,
PBYTE pbyBuffer
)
{ {
int ntStatus; int ntStatus;
...@@ -147,14 +114,8 @@ int PIPEnsControlOutAsyn( ...@@ -147,14 +114,8 @@ int PIPEnsControlOutAsyn(
return ntStatus; return ntStatus;
} }
int PIPEnsControlOut( int PIPEnsControlOut(struct vnt_private *pDevice, u8 byRequest, u16 wValue,
PSDevice pDevice, u16 wIndex, u16 wLength, u8 *pbyBuffer)
BYTE byRequest,
WORD wValue,
WORD wIndex,
WORD wLength,
PBYTE pbyBuffer
)
{ {
int ntStatus = 0; int ntStatus = 0;
int ii; int ii;
...@@ -206,14 +167,8 @@ int PIPEnsControlOut( ...@@ -206,14 +167,8 @@ int PIPEnsControlOut(
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
int PIPEnsControlIn( int PIPEnsControlIn(struct vnt_private *pDevice, u8 byRequest, u16 wValue,
PSDevice pDevice, u16 wIndex, u16 wLength, u8 *pbyBuffer)
BYTE byRequest,
WORD wValue,
WORD wIndex,
WORD wLength,
PBYTE pbyBuffer
)
{ {
int ntStatus = 0; int ntStatus = 0;
int ii; int ii;
...@@ -263,13 +218,9 @@ int PIPEnsControlIn( ...@@ -263,13 +218,9 @@ int PIPEnsControlIn(
return ntStatus; return ntStatus;
} }
static static void s_nsControlInUsbIoCompleteWrite(struct urb *urb)
void
s_nsControlInUsbIoCompleteWrite(
struct urb *urb
)
{ {
PSDevice pDevice; struct vnt_private *pDevice = (struct vnt_private *)urb->context;
pDevice = urb->context; pDevice = urb->context;
switch (urb->status) { switch (urb->status) {
...@@ -304,15 +255,11 @@ s_nsControlInUsbIoCompleteWrite( ...@@ -304,15 +255,11 @@ s_nsControlInUsbIoCompleteWrite(
* Return Value: STATUS_INSUFFICIENT_RESOURCES or result of IoCallDriver * Return Value: STATUS_INSUFFICIENT_RESOURCES or result of IoCallDriver
* *
*/ */
static
void static void s_nsControlInUsbIoCompleteRead(struct urb *urb)
s_nsControlInUsbIoCompleteRead(
struct urb *urb
)
{ {
PSDevice pDevice; struct vnt_private *pDevice = (struct vnt_private *)urb->context;
pDevice = urb->context;
switch (urb->status) { switch (urb->status) {
case 0: case 0:
break; break;
...@@ -345,7 +292,8 @@ s_nsControlInUsbIoCompleteRead( ...@@ -345,7 +292,8 @@ s_nsControlInUsbIoCompleteRead(
* Return Value: STATUS_INSUFFICIENT_RESOURCES or result of IoCallDriver * Return Value: STATUS_INSUFFICIENT_RESOURCES or result of IoCallDriver
* *
*/ */
int PIPEnsInterruptRead(PSDevice pDevice)
int PIPEnsInterruptRead(struct vnt_private *pDevice)
{ {
int ntStatus = STATUS_FAILURE; int ntStatus = STATUS_FAILURE;
...@@ -396,21 +344,16 @@ usb_fill_bulk_urb(pDevice->pInterruptURB, ...@@ -396,21 +344,16 @@ usb_fill_bulk_urb(pDevice->pInterruptURB,
* Return Value: STATUS_INSUFFICIENT_RESOURCES or result of IoCallDriver * Return Value: STATUS_INSUFFICIENT_RESOURCES or result of IoCallDriver
* *
*/ */
static
void
s_nsInterruptUsbIoCompleteRead(
struct urb *urb
)
static void s_nsInterruptUsbIoCompleteRead(struct urb *urb)
{ {
PSDevice pDevice; struct vnt_private *pDevice = (struct vnt_private *)urb->context;
int ntStatus; int ntStatus;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---->s_nsInterruptUsbIoCompleteRead\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---->s_nsInterruptUsbIoCompleteRead\n");
// //
// The context given to IoSetCompletionRoutine is the receive buffer object // The context given to IoSetCompletionRoutine is the receive buffer object
// //
pDevice = (PSDevice)urb->context;
// //
// We have a number of cases: // We have a number of cases:
...@@ -483,7 +426,8 @@ s_nsInterruptUsbIoCompleteRead( ...@@ -483,7 +426,8 @@ s_nsInterruptUsbIoCompleteRead(
* Return Value: STATUS_INSUFFICIENT_RESOURCES or result of IoCallDriver * Return Value: STATUS_INSUFFICIENT_RESOURCES or result of IoCallDriver
* *
*/ */
int PIPEnsBulkInUsbRead(PSDevice pDevice, PRCB pRCB)
int PIPEnsBulkInUsbRead(struct vnt_private *pDevice, PRCB pRCB)
{ {
int ntStatus = 0; int ntStatus = 0;
struct urb *pUrb; struct urb *pUrb;
...@@ -543,18 +487,14 @@ int PIPEnsBulkInUsbRead(PSDevice pDevice, PRCB pRCB) ...@@ -543,18 +487,14 @@ int PIPEnsBulkInUsbRead(PSDevice pDevice, PRCB pRCB)
* Return Value: STATUS_INSUFFICIENT_RESOURCES or result of IoCallDriver * Return Value: STATUS_INSUFFICIENT_RESOURCES or result of IoCallDriver
* *
*/ */
static
void
s_nsBulkInUsbIoCompleteRead(
struct urb *urb
)
static void s_nsBulkInUsbIoCompleteRead(struct urb *urb)
{ {
PRCB pRCB = (PRCB)urb->context; PRCB pRCB = (PRCB)urb->context;
PSDevice pDevice = (PSDevice)pRCB->pDevice; struct vnt_private *pDevice = pRCB->pDevice;
unsigned long bytesRead; unsigned long bytesRead;
BOOL bIndicateReceive = FALSE; int bIndicateReceive = FALSE;
BOOL bReAllocSkb = FALSE; int bReAllocSkb = FALSE;
int status; int status;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---->s_nsBulkInUsbIoCompleteRead\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---->s_nsBulkInUsbIoCompleteRead\n");
...@@ -618,11 +558,8 @@ s_nsBulkInUsbIoCompleteRead( ...@@ -618,11 +558,8 @@ s_nsBulkInUsbIoCompleteRead(
* Return Value: STATUS_INSUFFICIENT_RESOURCES or result of IoCallDriver * Return Value: STATUS_INSUFFICIENT_RESOURCES or result of IoCallDriver
* *
*/ */
int
PIPEnsSendBulkOut( int PIPEnsSendBulkOut(struct vnt_private *pDevice, PUSB_SEND_CONTEXT pContext)
PSDevice pDevice,
PUSB_SEND_CONTEXT pContext
)
{ {
int status; int status;
struct urb *pUrb; struct urb *pUrb;
...@@ -699,13 +636,10 @@ PIPEnsSendBulkOut( ...@@ -699,13 +636,10 @@ PIPEnsSendBulkOut(
* (IofCompleteRequest) to stop working on the irp. * (IofCompleteRequest) to stop working on the irp.
* *
*/ */
static
void static void s_nsBulkOutIoCompleteWrite(struct urb *urb)
s_nsBulkOutIoCompleteWrite(
struct urb *urb
)
{ {
PSDevice pDevice; struct vnt_private *pDevice;
int status; int status;
CONTEXT_TYPE ContextType; CONTEXT_TYPE ContextType;
unsigned long ulBufLen; unsigned long ulBufLen;
......
...@@ -41,35 +41,15 @@ ...@@ -41,35 +41,15 @@
/*--------------------- Export Functions --------------------------*/ /*--------------------- Export Functions --------------------------*/
int PIPEnsControlOut( int PIPEnsControlOut(struct vnt_private *, u8 byRequest, u16 wValue,
PSDevice pDevice, u16 wIndex, u16 wLength, u8 *pbyBuffer);
BYTE byRequest, int PIPEnsControlOutAsyn(struct vnt_private *, u8 byRequest,
WORD wValue, u16 wValue, u16 wIndex, u16 wLength, u8 *pbyBuffer);
WORD wIndex, int PIPEnsControlIn(struct vnt_private *, u8 byRequest, u16 wValue,
WORD wLength, u16 wIndex, u16 wLength, u8 *pbyBuffer);
PBYTE pbyBuffer
); int PIPEnsInterruptRead(struct vnt_private *);
int PIPEnsBulkInUsbRead(struct vnt_private *, PRCB pRCB);
int PIPEnsControlOutAsyn( int PIPEnsSendBulkOut(struct vnt_private *, PUSB_SEND_CONTEXT pContext);
PSDevice pDevice,
BYTE byRequest,
WORD wValue,
WORD wIndex,
WORD wLength,
PBYTE pbyBuffer
);
int PIPEnsControlIn(
PSDevice pDevice,
BYTE byRequest,
WORD wValue,
WORD wIndex,
WORD wLength,
PBYTE pbyBuffer
);
int PIPEnsInterruptRead(PSDevice pDevice);
int PIPEnsBulkInUsbRead(PSDevice pDevice, PRCB pRCB);
int PIPEnsSendBulkOut(PSDevice pDevice, PUSB_SEND_CONTEXT pContext);
#endif /* __USBPIPE_H__ */ #endif /* __USBPIPE_H__ */
...@@ -67,10 +67,10 @@ static int msglevel = MSG_LEVEL_INFO; ...@@ -67,10 +67,10 @@ static int msglevel = MSG_LEVEL_INFO;
* Return Value: * Return Value:
* *
*/ */
int wpa_set_keys(PSDevice pDevice, void *ctx) int wpa_set_keys(struct vnt_private *pDevice, void *ctx)
{ {
struct viawget_wpa_param *param = ctx; struct viawget_wpa_param *param = ctx;
PSMgmtObject pMgmt = &pDevice->sMgmtObj; struct vnt_manager *pMgmt = &pDevice->vnt_mgmt;
DWORD dwKeyIndex = 0; DWORD dwKeyIndex = 0;
BYTE abyKey[MAX_KEY_LEN]; BYTE abyKey[MAX_KEY_LEN];
BYTE abySeq[MAX_KEY_LEN]; BYTE abySeq[MAX_KEY_LEN];
......
...@@ -52,6 +52,6 @@ typedef unsigned long long NDIS_802_11_KEY_RSC; ...@@ -52,6 +52,6 @@ typedef unsigned long long NDIS_802_11_KEY_RSC;
/*--------------------- Export Functions --------------------------*/ /*--------------------- Export Functions --------------------------*/
int wpa_set_keys(PSDevice pDevice, void *ctx); int wpa_set_keys(struct vnt_private *, void *ctx);
#endif /* __WPACL_H__ */ #endif /* __WPACL_H__ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment