staging: vt6656: channel/control/firmware/int/usbpipe to new structures
authorMalcolm Priestley <tvboxspy@gmail.com>
Mon, 10 Dec 2012 22:14:36 +0000 (22:14 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 Jan 2013 19:13:33 +0000 (11:13 -0800)
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>
12 files changed:
drivers/staging/vt6656/channel.c
drivers/staging/vt6656/channel.h
drivers/staging/vt6656/control.c
drivers/staging/vt6656/control.h
drivers/staging/vt6656/firmware.c
drivers/staging/vt6656/firmware.h
drivers/staging/vt6656/int.c
drivers/staging/vt6656/int.h
drivers/staging/vt6656/usbpipe.c
drivers/staging/vt6656/usbpipe.h
drivers/staging/vt6656/wpactl.c
drivers/staging/vt6656/wpactl.h

index 65021760785857ba8a1de0703bed253a7ae900db..95f00ba1d3febc6d351bc93febcc280a3cdc22a9 100644 (file)
@@ -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;
index e7b3c1231825bec340d44b4d4e529700ff72a055..8031491b8109193b717deb23b70cf7ccab8d9e4d 100644 (file)
@@ -30,6 +30,7 @@
 #ifndef _CHANNEL_H_
 #define _CHANNEL_H_
 
+#include "device.h"
 #include "ttype.h"
 
 /*---------------------  Export Definitions -------------------------*/
@@ -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);
index 5d8c5719419b09390530537daca8530eb06a56bf..743ef5fb7fe748f00cc5fd6f65163ecf179c0e80 100644 (file)
 
 /*---------------------  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;
 }
index bbe610fd8b5a06608341424896a19ab05f9e6651..76ce0244e100525c7b3584f2219cf1b55cafa5e2 100644 (file)
 
 /*---------------------  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__ */
index 8831ea03c00152864ca4336980624ac16dcef769..93d7301bc294ae4468fab0b7cc462784d92fad1d 100644 (file)
@@ -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;
@@ -114,12 +111,9 @@ out:
 }
 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");
 
@@ -139,10 +133,7 @@ FIRMWAREbBrach2Sram(
 }
 
 
-BOOL
-FIRMWAREbCheckVersion(
-     PSDevice pDevice
-    )
+int FIRMWAREbCheckVersion(struct vnt_private *pDevice)
 {
        int ntStatus;
 
index b2f5b5818a9375b159870c43c94fa125c96df446..ebab3a6351b3d2369cca25916f617f30ad8e16b6 100644 (file)
 
 /*---------------------  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__ */
index 7718ac21039e980da96b4c6b28c467afc34dc8f3..97c6896bd3b239ab35a41502ab993b11891d5e1c 100644 (file)
@@ -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");
@@ -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");
index ffc243feba69d965c7e04cc9d92b48ff8e407813..444b6c2ea4129de4b69d5ac895069154d4a27ebe 100644 (file)
@@ -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__ */
index fc68518526e03f470782aaee81a9cc33cab2b3e4..2a020672a14b68d1522bb99366596bdd706555ee 100644 (file)
@@ -67,51 +67,18 @@ static int          msglevel                =MSG_LEVEL_INFO;
 /*---------------------  Static Variables  --------------------------*/
 
 /*---------------------  Static Functions  --------------------------*/
-static
-void
-s_nsInterruptUsbIoCompleteRead(
-     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
-    );
+static void s_nsInterruptUsbIoCompleteRead(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 Functions  --------------------------*/
 
-int PIPEnsControlOutAsyn(
-     PSDevice     pDevice,
-     BYTE         byRequest,
-     WORD         wValue,
-     WORD         wIndex,
-     WORD         wLength,
-     PBYTE        pbyBuffer
-    )
+int PIPEnsControlOutAsyn(struct vnt_private *pDevice, u8 byRequest,
+       u16 wValue, u16 wIndex, u16 wLength, u8 *pbyBuffer)
 {
        int ntStatus;
 
@@ -147,17 +114,11 @@ int PIPEnsControlOutAsyn(
     return ntStatus;
 }
 
-int PIPEnsControlOut(
-     PSDevice     pDevice,
-     BYTE         byRequest,
-     WORD         wValue,
-     WORD         wIndex,
-     WORD         wLength,
-     PBYTE        pbyBuffer
-    )
+int PIPEnsControlOut(struct vnt_private *pDevice, u8 byRequest, u16 wValue,
+               u16 wIndex, u16 wLength, u8 *pbyBuffer)
 {
        int ntStatus = 0;
-    int ii;
+       int ii;
 
     if (pDevice->Flags & fMP_DISCONNECTED)
         return STATUS_FAILURE;
@@ -206,17 +167,11 @@ int PIPEnsControlOut(
     return STATUS_SUCCESS;
 }
 
-int PIPEnsControlIn(
-     PSDevice     pDevice,
-     BYTE         byRequest,
-     WORD         wValue,
-     WORD         wIndex,
-     WORD         wLength,
-       PBYTE   pbyBuffer
-    )
+int PIPEnsControlIn(struct vnt_private *pDevice, u8 byRequest, u16 wValue,
+       u16 wIndex, u16 wLength,  u8 *pbyBuffer)
 {
        int ntStatus = 0;
-    int ii;
+       int ii;
 
     if (pDevice->Flags & fMP_DISCONNECTED)
         return STATUS_FAILURE;
@@ -263,13 +218,9 @@ int PIPEnsControlIn(
     return ntStatus;
 }
 
-static
-void
-s_nsControlInUsbIoCompleteWrite(
-     struct urb *urb
-    )
+static void s_nsControlInUsbIoCompleteWrite(struct urb *urb)
 {
-    PSDevice        pDevice;
+       struct vnt_private *pDevice = (struct vnt_private *)urb->context;
 
        pDevice = urb->context;
        switch (urb->status) {
@@ -304,15 +255,11 @@ s_nsControlInUsbIoCompleteWrite(
  * Return Value: STATUS_INSUFFICIENT_RESOURCES or result of IoCallDriver
  *
  */
-static
-void
-s_nsControlInUsbIoCompleteRead(
-     struct urb *urb
-    )
+
+static void s_nsControlInUsbIoCompleteRead(struct urb *urb)
 {
-    PSDevice        pDevice;
+       struct vnt_private *pDevice = (struct vnt_private *)urb->context;
 
-       pDevice = urb->context;
        switch (urb->status) {
        case 0:
                break;
@@ -345,9 +292,10 @@ s_nsControlInUsbIoCompleteRead(
  * 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;
 
     DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---->s_nsStartInterruptUsbRead()\n");
 
@@ -396,21 +344,16 @@ usb_fill_bulk_urb(pDevice->pInterruptURB,
  * 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;
-    int ntStatus;
+       struct vnt_private *pDevice = (struct vnt_private *)urb->context;
+       int ntStatus;
 
     DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---->s_nsInterruptUsbIoCompleteRead\n");
     //
     // The context given to IoSetCompletionRoutine is the receive buffer object
     //
-    pDevice = (PSDevice)urb->context;
 
     //
     // We have a number of cases:
@@ -483,10 +426,11 @@ s_nsInterruptUsbIoCompleteRead(
  * 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;
-    struct urb          *pUrb;
+       struct urb *pUrb;
 
 
     DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---->s_nsStartBulkInUsbRead\n");
@@ -543,19 +487,15 @@ int PIPEnsBulkInUsbRead(PSDevice pDevice, PRCB pRCB)
  * 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;
-    PSDevice pDevice = (PSDevice)pRCB->pDevice;
-    unsigned long   bytesRead;
-    BOOL    bIndicateReceive = FALSE;
-    BOOL    bReAllocSkb = FALSE;
-    int status;
+       PRCB pRCB = (PRCB)urb->context;
+       struct vnt_private *pDevice = pRCB->pDevice;
+       unsigned long   bytesRead;
+       int bIndicateReceive = FALSE;
+       int bReAllocSkb = FALSE;
+       int status;
 
     DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---->s_nsBulkInUsbIoCompleteRead\n");
     status = urb->status;
@@ -618,14 +558,11 @@ s_nsBulkInUsbIoCompleteRead(
  * Return Value: STATUS_INSUFFICIENT_RESOURCES or result of IoCallDriver
  *
  */
-int
-PIPEnsSendBulkOut(
-      PSDevice pDevice,
-      PUSB_SEND_CONTEXT pContext
-    )
+
+int PIPEnsSendBulkOut(struct vnt_private *pDevice, PUSB_SEND_CONTEXT pContext)
 {
-    int status;
-    struct urb          *pUrb;
+       int status;
+       struct urb          *pUrb;
 
 
 
@@ -699,17 +636,14 @@ PIPEnsSendBulkOut(
  *               (IofCompleteRequest) to stop working on the irp.
  *
  */
-static
-void
-s_nsBulkOutIoCompleteWrite(
-     struct urb *urb
-    )
+
+static void s_nsBulkOutIoCompleteWrite(struct urb *urb)
 {
-    PSDevice            pDevice;
-    int status;
-    CONTEXT_TYPE        ContextType;
-    unsigned long               ulBufLen;
-    PUSB_SEND_CONTEXT   pContext;
+       struct vnt_private *pDevice;
+       int status;
+       CONTEXT_TYPE ContextType;
+       unsigned long ulBufLen;
+       PUSB_SEND_CONTEXT pContext;
 
 
     DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---->s_nsBulkOutIoCompleteWrite\n");
index b3673474a9e12783d036d3c1e9b744473b33c317..b3023559c15bcfefe032ba0312d1a8a893746406 100644 (file)
 
 /*---------------------  Export Functions  --------------------------*/
 
-int PIPEnsControlOut(
-     PSDevice     pDevice,
-     BYTE         byRequest,
-     WORD         wValue,
-     WORD         wIndex,
-     WORD         wLength,
-     PBYTE        pbyBuffer
-    );
-
-int PIPEnsControlOutAsyn(
-     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);
+int PIPEnsControlOut(struct vnt_private *, u8 byRequest, u16 wValue,
+               u16 wIndex, u16 wLength, u8 *pbyBuffer);
+int PIPEnsControlOutAsyn(struct vnt_private *, u8 byRequest,
+       u16 wValue, u16 wIndex, u16 wLength, u8 *pbyBuffer);
+int PIPEnsControlIn(struct vnt_private *, u8 byRequest, u16 wValue,
+       u16 wIndex, u16 wLength,  u8 *pbyBuffer);
+
+int PIPEnsInterruptRead(struct vnt_private *);
+int PIPEnsBulkInUsbRead(struct vnt_private *, PRCB pRCB);
+int PIPEnsSendBulkOut(struct vnt_private *, PUSB_SEND_CONTEXT pContext);
 
 #endif /* __USBPIPE_H__ */
index 3afbb61cc722a525fe6cea21b45087ea63c5bc8b..569d1a7262857454fb78f730eb0ee33f12e3d9f2 100644 (file)
@@ -67,10 +67,10 @@ static int msglevel = MSG_LEVEL_INFO;
  * 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;
-       PSMgmtObject pMgmt = &pDevice->sMgmtObj;
+       struct vnt_manager *pMgmt = &pDevice->vnt_mgmt;
        DWORD dwKeyIndex = 0;
        BYTE abyKey[MAX_KEY_LEN];
        BYTE abySeq[MAX_KEY_LEN];
index b4ec6b0e1c670967b2294d9b6ea328da88e370a3..2235ee97012e16a30991e9054f535f01af586e96 100644 (file)
@@ -52,6 +52,6 @@ typedef unsigned long long NDIS_802_11_KEY_RSC;
 
 /*---------------------  Export Functions  --------------------------*/
 
-int wpa_set_keys(PSDevice pDevice, void *ctx);
+int wpa_set_keys(struct vnt_private *, void *ctx);
 
 #endif /* __WPACL_H__ */