Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[pandora-kernel.git] / drivers / staging / vt6656 / main_usb.c
index 457d91c..3a3fdc5 100644 (file)
@@ -73,7 +73,6 @@
 #include "int.h"
 #include "iowpa.h"
 
-/*---------------------  Static Definitions -------------------------*/
 /* static int msglevel = MSG_LEVEL_DEBUG; */
 static int          msglevel                =MSG_LEVEL_INFO;
 
@@ -96,14 +95,12 @@ MODULE_DESCRIPTION(DEVICE_FULL_DRV_NAM);
 #define RX_DESC_DEF0     64
 DEVICE_PARAM(RxDescriptors0,"Number of receive usb desc buffer");
 
-
 #define TX_DESC_DEF0     64
 DEVICE_PARAM(TxDescriptors0,"Number of transmit usb desc buffer");
 
 #define CHANNEL_DEF     6
 DEVICE_PARAM(Channel, "Channel number");
 
-
 /* PreambleType[] is the preamble length used for transmit.
    0: indicate allows long preamble type
    1: indicate allows short preamble type
@@ -119,7 +116,6 @@ DEVICE_PARAM(RTSThreshold, "RTS threshold");
 #define FRAG_THRESH_DEF     2346
 DEVICE_PARAM(FragThreshold, "Fragmentation threshold");
 
-
 #define DATA_RATE_DEF     13
 /* datarate[] index
    0: indicate 1 Mbps   0x02
@@ -149,7 +145,6 @@ DEVICE_PARAM(OPMode, "Infrastruct, adhoc, AP mode ");
    2: indicate AP mode used
 */
 
-
 /* PSMode[]
    0: indicate disable power saving mode
    1: indicate enable power saving mode
@@ -158,7 +153,6 @@ DEVICE_PARAM(OPMode, "Infrastruct, adhoc, AP mode ");
 #define PS_MODE_DEF     0
 DEVICE_PARAM(PSMode, "Power saving mode");
 
-
 #define SHORT_RETRY_DEF     8
 DEVICE_PARAM(ShortRetryLimit, "Short frame retry limits");
 
@@ -174,8 +168,6 @@ DEVICE_PARAM(LongRetryLimit, "long frame retry limits");
 #define BBP_TYPE_DEF     2
 DEVICE_PARAM(BasebandType, "baseband type");
 
-
-
 /* 80211hEnable[]
    0: indicate disable 802.11h
    1: indicate enable 802.11h
@@ -185,7 +177,6 @@ DEVICE_PARAM(BasebandType, "baseband type");
 
 DEVICE_PARAM(b80211hEnable, "802.11h mode");
 
-
 /*
  * Static vars definitions
  */
@@ -205,12 +196,9 @@ static const long frequency_list[] = {
     5700, 5745, 5765, 5785, 5805, 5825
        };
 
-
 static const struct iw_handler_def     iwctl_handler_def;
 */
 
-/*---------------------  Static Functions  --------------------------*/
-
 static int vt6656_probe(struct usb_interface *intf,
                        const struct usb_device_id *id);
 static void vt6656_disconnect(struct usb_interface *intf);
@@ -246,21 +234,13 @@ static int Config_FileGetParameter(unsigned char *string,
                                   unsigned char *dest,
                                   unsigned char *source);
 
-
 static void usb_device_reset(struct vnt_private *pDevice);
 
-
-
-/*---------------------  Export Variables  --------------------------*/
-
-/*---------------------  Export Functions  --------------------------*/
-
-
 static void
 device_set_options(struct vnt_private *pDevice) {
 
-    BYTE    abyBroadcastAddr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
-    BYTE    abySNAP_RFC1042[ETH_ALEN] = {0xAA, 0xAA, 0x03, 0x00, 0x00, 0x00};
+    u8    abyBroadcastAddr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
+    u8    abySNAP_RFC1042[ETH_ALEN] = {0xAA, 0xAA, 0x03, 0x00, 0x00, 0x00};
     u8 abySNAP_Bridgetunnel[ETH_ALEN] = {0xAA, 0xAA, 0x03, 0x00, 0x00, 0xF8};
 
     memcpy(pDevice->abyBroadcastAddr, abyBroadcastAddr, ETH_ALEN);
@@ -294,7 +274,6 @@ device_set_options(struct vnt_private *pDevice) {
     pDevice->bDiversityRegCtlON = false;
 }
 
-
 static void device_init_diversity_timer(struct vnt_private *pDevice)
 {
     init_timer(&pDevice->TimerSQ3Tmax1);
@@ -315,7 +294,6 @@ static void device_init_diversity_timer(struct vnt_private *pDevice)
     return;
 }
 
-
 /*
  * initialization of MAC & BBP registers
  */
@@ -367,8 +345,8 @@ static int device_init_registers(struct vnt_private *pDevice,
         }
     }
 
-    sInitCmd.byInitClass = (BYTE)InitType;
-    sInitCmd.bExistSWNetAddr = (BYTE) pDevice->bExistSWNetAddr;
+    sInitCmd.byInitClass = (u8)InitType;
+    sInitCmd.bExistSWNetAddr = (u8) pDevice->bExistSWNetAddr;
     for (ii = 0; ii < 6; ii++)
        sInitCmd.bySWNetAddr[ii] = pDevice->abyCurrentNetAddr[ii];
     sInitCmd.byShortRetryLimit = pDevice->byShortRetryLimit;
@@ -380,7 +358,7 @@ static int device_init_registers(struct vnt_private *pDevice,
                                     0,
                                     0,
                                     sizeof(CMD_CARD_INIT),
-                                    (PBYTE) &(sInitCmd));
+                                    (u8 *) &(sInitCmd));
 
     if ( ntStatus != STATUS_SUCCESS ) {
         DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" Issue Card init fail \n");
@@ -389,7 +367,7 @@ static int device_init_registers(struct vnt_private *pDevice,
     }
     if (InitType == DEVICE_INIT_COLD) {
 
-        ntStatus = CONTROLnsRequestIn(pDevice,MESSAGE_TYPE_INIT_RSP,0,0,sizeof(RSP_CARD_INIT), (PBYTE) &(sInitRsp));
+        ntStatus = CONTROLnsRequestIn(pDevice,MESSAGE_TYPE_INIT_RSP,0,0,sizeof(RSP_CARD_INIT), (u8 *) &(sInitRsp));
 
         if (ntStatus != STATUS_SUCCESS) {
             DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Cardinit request in status fail!\n");
@@ -419,7 +397,7 @@ static int device_init_registers(struct vnt_private *pDevice,
         pDevice->bNonERPPresent = false;
         pDevice->bBarkerPreambleMd = false;
         if ( pDevice->bFixRate ) {
-            pDevice->wCurrentRate = (WORD) pDevice->uConnectionRate;
+            pDevice->wCurrentRate = (u16) pDevice->uConnectionRate;
         } else {
             if ( pDevice->byBBType == BB_TYPE_11B )
                 pDevice->wCurrentRate = RATE_11M;
@@ -772,7 +750,6 @@ static void device_free_tx_bufs(struct vnt_private *pDevice)
     return;
 }
 
-
 static void device_free_rx_bufs(struct vnt_private *pDevice)
 {
     PRCB pRCB;
@@ -810,7 +787,6 @@ static void device_free_int_bufs(struct vnt_private *pDevice)
     return;
 }
 
-
 static bool device_alloc_bufs(struct vnt_private *pDevice)
 {
 
@@ -818,7 +794,6 @@ static bool device_alloc_bufs(struct vnt_private *pDevice)
     PRCB pRCB;
     int ii;
 
-
     for (ii = 0; ii < pDevice->cbTD; ii++) {
 
         pTxContext = kmalloc(sizeof(USB_SEND_CONTEXT), GFP_KERNEL);
@@ -844,7 +819,6 @@ static bool device_alloc_bufs(struct vnt_private *pDevice)
         goto free_tx;
     }
 
-
     pDevice->FirstRecvFreeList = NULL;
     pDevice->LastRecvFreeList = NULL;
     pDevice->FirstRecvMngList = NULL;
@@ -875,7 +849,6 @@ static bool device_alloc_bufs(struct vnt_private *pDevice)
         pRCB++;
     }
 
-
        pDevice->pControlURB = usb_alloc_urb(0, GFP_ATOMIC);
        if (pDevice->pControlURB == NULL) {
            DBG_PRT(MSG_LEVEL_ERR,KERN_ERR"Failed to alloc control urb\n");
@@ -908,9 +881,6 @@ free_tx:
        return false;
 }
 
-
-
-
 static bool device_init_defrag_cb(struct vnt_private *pDevice)
 {
        int i;
@@ -934,8 +904,6 @@ free_frag:
     return false;
 }
 
-
-
 static void device_free_frag_bufs(struct vnt_private *pDevice)
 {
        PSDeFragControlBlock pDeF;
@@ -950,8 +918,6 @@ static void device_free_frag_bufs(struct vnt_private *pDevice)
     }
 }
 
-
-
 int device_alloc_frag_buf(struct vnt_private *pDevice,
                PSDeFragControlBlock pDeF)
 {
@@ -965,9 +931,6 @@ int device_alloc_frag_buf(struct vnt_private *pDevice,
     return true;
 }
 
-
-/*-----------------------------------------------------------------*/
-
 static int  device_open(struct net_device *dev)
 {
        struct vnt_private *pDevice = netdev_priv(dev);
@@ -976,7 +939,6 @@ static int  device_open(struct net_device *dev)
 
     DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " device_open...\n");
 
-
     pDevice->rx_buf_sz = MAX_TOTAL_SIZE_WITH_ALL_HEADERS;
 
     if (device_alloc_bufs(pDevice) == false) {
@@ -1062,7 +1024,6 @@ static int  device_open(struct net_device *dev)
        else
                bScheduleCommand((void *) pDevice, WLAN_CMD_BSSID_SCAN, NULL);
 
-
     netif_stop_queue(pDevice->dev);
     pDevice->flags |= DEVICE_FLAGS_OPENED;
 
@@ -1084,8 +1045,6 @@ free_rx_tx:
     return -ENOMEM;
 }
 
-
-
 static int device_close(struct net_device *dev)
 {
        struct vnt_private *pDevice = netdev_priv(dev);
@@ -1101,7 +1060,6 @@ static int device_close(struct net_device *dev)
         mdelay(30);
     }
 
-
         memset(pMgmt->abyDesireSSID, 0, WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1);
         pMgmt->bShareKeyAlgorithm = false;
         pDevice->bEncryptionEnable = false;
@@ -1166,7 +1124,6 @@ static void vt6656_disconnect(struct usb_interface *intf)
        if (!device)
                return;
 
-
        usb_set_intfdata(intf, NULL);
        usb_put_dev(interface_to_usbdev(intf));
 
@@ -1407,7 +1364,6 @@ static void device_set_multi(struct net_device *dev)
        u8 byTmpMode = 0;
        int rc;
 
-
        spin_lock_irq(&pDevice->lock);
     rc = CONTROLnsRequestIn(pDevice,
                             MESSAGE_TYPE_READ,
@@ -1443,8 +1399,8 @@ static void device_set_multi(struct net_device *dev)
             mc_filter[bit_nr >> 5] |= cpu_to_le32(1 << (bit_nr & 31));
         }
         for (ii = 0; ii < 4; ii++) {
-             MACvWriteMultiAddr(pDevice, ii, *((PBYTE)&mc_filter[0] + ii));
-             MACvWriteMultiAddr(pDevice, ii+ 4, *((PBYTE)&mc_filter[1] + ii));
+             MACvWriteMultiAddr(pDevice, ii, *((u8 *)&mc_filter[0] + ii));
+             MACvWriteMultiAddr(pDevice, ii+ 4, *((u8 *)&mc_filter[1] + ii));
         }
         pDevice->byRxMode &= ~(RCR_UNICAST);
         pDevice->byRxMode |= (RCR_MULTICAST|RCR_BROADCAST);
@@ -1495,7 +1451,6 @@ static int device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
        return rc;
 }
 
-
 static int ethtool_ioctl(struct net_device *dev, void *useraddr)
 {
        u32 ethcmd;