[haiku-commits] haiku: hrev43240 - src/add-ons/kernel/drivers/network/wwan/usb_beceemwmx

  • From: kallisti5@xxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 12 Nov 2011 15:35:14 +0100 (CET)

Revision:    hrev43240
Commit:      5ec0ede4ba4a47b71b6d54a832b827ac3d42d1f7
URL:         http://cgit.haiku-os.org/haiku/commit/?id=5ec0ede
Author:      Alexander von Gluck IV <kallisti5@xxxxxxxxxxx>
Date:        Sat Nov 12 14:34:34 2011 UTC

* style cleanup
* whitespace cleanup
* no functional change

............................................................................

 .../network/wwan/usb_beceemwmx/BeceemDevice.h      |    2 -
 .../network/wwan/usb_beceemwmx/DeviceStruct.h      |   76 ++++++++--------
 .../drivers/network/wwan/usb_beceemwmx/Driver.h    |    1 +
 .../drivers/network/wwan/usb_beceemwmx/util.cpp    |   15 ++--
 .../drivers/network/wwan/usb_beceemwmx/util.h      |    3 +-
 5 files changed, 51 insertions(+), 46 deletions(-)

diff --git 
a/src/add-ons/kernel/drivers/network/wwan/usb_beceemwmx/BeceemDevice.h 
b/src/add-ons/kernel/drivers/network/wwan/usb_beceemwmx/BeceemDevice.h
index 6c295bf..0adddfc 100644
--- a/src/add-ons/kernel/drivers/network/wwan/usb_beceemwmx/BeceemDevice.h
+++ b/src/add-ons/kernel/drivers/network/wwan/usb_beceemwmx/BeceemDevice.h
@@ -12,8 +12,6 @@
  *             ASIX AX88172/AX88772/AX88178 USB 2.0 Ethernet Driver
  *                     (c) 2008 by S.Zharski, <imker@xxxxxx>
  */
-
-
 #ifndef _USB_BECEEM_DEVICE_H_
 #define _USB_BECEEM_DEVICE_H_
 
diff --git 
a/src/add-ons/kernel/drivers/network/wwan/usb_beceemwmx/DeviceStruct.h 
b/src/add-ons/kernel/drivers/network/wwan/usb_beceemwmx/DeviceStruct.h
index 1efaa6a..883bf53 100644
--- a/src/add-ons/kernel/drivers/network/wwan/usb_beceemwmx/DeviceStruct.h
+++ b/src/add-ons/kernel/drivers/network/wwan/usb_beceemwmx/DeviceStruct.h
@@ -5,12 +5,13 @@
  *
  *     Based on GPL code developed by: Beceem Communications Pvt. Ltd
  */
-
 #ifndef _USB_BECEEM_DEVICE_STRUCT_
 #define _USB_BECEEM_DEVICE_STRUCT_
 
+
 #include "Driver.h"
 
+
 typedef struct FirmwareInfo
 {
        void*                   pvMappedFirmwareAddress;
@@ -154,27 +155,30 @@ typedef struct _VENDORCFG
        /*
        ARQ Enable ==> 0xddccbbaa
                aa => 0x01 Enables ARQ
-               bb => 0x01 Disables the ARQ feature where MS combines ARQ FB 
and tranport
+               bb => 0x01 Disable the ARQ feature where MS combines ARQ FB and 
tranport
                CID Bw Requests:
                cc => 0x01 Enable ARQ FB BW req enh
                dd => 0th bit Disable ARQ Cut thru for Ack Generation
-               dd => 1st bit enables handling of partial nacking of PDUs, and 
retxing */
+               dd => 1st bit enable handling of partial nacking of PDUs, and 
retxing */
        uint32  m_u32ArqEnable;
 
        /*
        HARQ Enable ==> 0xddccbbaa
-               aa => 0x01 Enables HARQ on Transport;
-               bb => 0 bit Enables HARQ on Management
-               bb => 1 bit Enables Out of order delivery on non-ARQ Rx ERTPS 
HARQ connections
-               bb => 2 bit Enables Out of order delivery on all non-ARQ RX 
HARQ connections
-               dd => If set, used as the PDU purge timer on the non-ARQ Rx 
HARQ RT connections
-               ERTPS, RTPS, UGS
-               HARQ on Management only is NOT Permitted.
-               Eg. 0x0101 => Enables HARQ on Management and HARQ on Transport 
Connections
-               Eg. 0x0301 => Enables HARQ on Management and HARQ on Transport 
Connections
-                                         Enables out of deliver on the non-ARQ 
rx ERTPS HARQ connections
-               Eg. 0x0501 => Enables HARQ on Management and HARQ on Transport 
Connections
-                                         Enables out of deliver on the non-ARQ 
RX HARQ connections */
+               aa =>   0x01 Enable HARQ on Transport;
+               bb =>   0 bit Enable HARQ on Management
+               bb =>   1 bit Enable Out of order delivery on non-ARQ Rx ERTPS
+                               HARQ connections
+               bb =>   2 bit Enable Out of order delivery on all non-ARQ RX
+                               HARQ connections
+               dd =>   If set, used as the PDU purge timer on the non-ARQ Rx
+                               HARQ RT connections ERTPS, RTPS, UGS and HARQ 
on Management
+                               only is NOT Permitted.
+               Examples:
+               0x0101  Enable HARQ on Management and HARQ on Transport 
Connections
+               0x0301  Enable HARQ on Management and HARQ on Transport 
Connections
+                               Enable out of deliver on the non-ARQ rx ERTPS 
HARQ connections
+               0x0501  Enable HARQ on Management and HARQ on Transport 
Connections
+                               Enable out of deliver on the non-ARQ RX HARQ 
connections */
        uint32  m_u32HarqEnable;
 
        // EEPROM Param Location
@@ -230,7 +234,7 @@ typedef struct _VENDORCFG
 
        /*
        PhyParameter2
-               [16]    Set to 1 for accurate CINR measurement on noise limited 
scenarios
+               [16]    Set 1 for accurate CINR measurement on noise limited 
scenarios
                                If set to 1, note the BTS Link Adaptation 
tables may need change
                [15:8]  Backoff in 0.25dBm steps in Transmit power to be
                                applied for an uncalibrated unit */
@@ -372,8 +376,8 @@ typedef struct _GPIO_LED_MAP
 //  TODO : figure out how to handle these linux wait typedefs
 //     wait_queue_head_t       notify_led_event;
 //     wait_queue_head_t       idleModeSyncEvent;
-       bool                                    notify_led_event;
-       bool                                    idleModeSyncEvent;
+       bool                            notify_led_event;
+       bool                            idleModeSyncEvent;
 //  TODO END : figure out how to handle these linux wait typedefs
 
        struct task_struct      *led_cntrl_threadid;
@@ -453,27 +457,27 @@ typedef struct _FLASH_CS_INFO
 
 struct WIMAX_DEVICE
 {
-                       VENDORCFG                       vendorcfg;
+                       VENDORCFG       vendorcfg;
                                // we memcpy the vendor cfg here
-                       uint32        syscfgBefFw;
+                       uint32          syscfgBefFw;
                                // SYS_CFG before firmware
-                       bool                CPUFlashBoot;
+                       bool            CPUFlashBoot;
                                // Reverse MIPS
-                       uint32        deviceChipID;
+                       uint32          deviceChipID;
                                // Beceem interface chip model
-volatile       bool                            driverHalt;
+volatile       bool            driverHalt;
                                // gets set to true when driver is being 
shutdown
 volatile       uint32          driverState;
                                // Driver state, defined in Driver.h
-volatile       bool                            driverDDRinit;
+volatile       bool            driverDDRinit;
                                // has the DDR memory been initialized?
-volatile       bool                            driverFwPushed;
+volatile       bool            driverFwPushed;
                                // has the firmware been pushed to the device?
 
 
-                       GPIO_LED_MAP            LEDMap;
+                       GPIO_LED_MAP LEDMap;
                                // Map of LED's in GPIO
-                       thread_id                       LEDThreadID;
+                       thread_id       LEDThreadID;
                                // Thread ID of LED state handler
 
                        uint32          nvmType;
@@ -485,19 +489,19 @@ volatile  bool                            driverFwPushed;
                        uint32          nvmVerMinor;
                                // NVM Minor
 
-volatile       uint32                  nvmFlashBaseAddr;
+volatile       uint32          nvmFlashBaseAddr;
                                // NVM Flash base address
-                       unsigned long           nvmFlashCalStart;
+                       unsigned long nvmFlashCalStart;
                                // NVM Flash calibrated start
-                       unsigned long           nvmFlashCSStart;
+                       unsigned long nvmFlashCSStart;
                                // NVM Flash CS start
-                       PFLASH_CS_INFO          nvmFlashCSInfo;
+                       PFLASH_CS_INFO nvmFlashCSInfo;
                                // NVM Flash CS info
-                       unsigned long int       nvmFlashID;
+                       unsigned long int nvmFlashID;
                                // ID of Flash chip
-volatile       bool                            nvmFlashCSDone;
+volatile       bool            nvmFlashCSDone;
                                // Has CS been read yet?
-volatile       bool                            nvmFlashRaw;
+volatile       bool            nvmFlashRaw;
                                // Do we need raw access at the moment?
 
                        uint32          nvmFlashMajor;
@@ -507,11 +511,11 @@ volatile  bool                            nvmFlashRaw;
 
                        uint32          hwParamPtr;
                                // Pointer to the NVM Param section address
-                       unsigned char           gpioInfo[32];
+                       unsigned char gpioInfo[32];
                                // Stored GPIO information
                        uint32          gpioBitMap;
                                // GPIO LED bitmap
 };
 
-#endif // _USB_BECEEM_DEVICE_STRUCT_
 
+#endif // _USB_BECEEM_DEVICE_STRUCT_
diff --git a/src/add-ons/kernel/drivers/network/wwan/usb_beceemwmx/Driver.h 
b/src/add-ons/kernel/drivers/network/wwan/usb_beceemwmx/Driver.h
index 27de91d..5dae24e 100644
--- a/src/add-ons/kernel/drivers/network/wwan/usb_beceemwmx/Driver.h
+++ b/src/add-ons/kernel/drivers/network/wwan/usb_beceemwmx/Driver.h
@@ -98,6 +98,7 @@
 #define STATE_IDLEEXIT 0x80    // IDLEMODE_EXIT
 #define STATE_HALT             0x00    // SHUTDOWN_EXIT
 
+
 const uint8 kInvalidRequest = 0xff;
 
 // version of bcm driver this was based upon + end .1
diff --git a/src/add-ons/kernel/drivers/network/wwan/usb_beceemwmx/util.cpp 
b/src/add-ons/kernel/drivers/network/wwan/usb_beceemwmx/util.cpp
index 44bcbc3..95f401f 100644
--- a/src/add-ons/kernel/drivers/network/wwan/usb_beceemwmx/util.cpp
+++ b/src/add-ons/kernel/drivers/network/wwan/usb_beceemwmx/util.cpp
@@ -5,34 +5,35 @@
  *
  */
 
-#include <ByteOrder.h>
 
+#include <ByteOrder.h>
 #include "util.h"
 
+
 void
 convertEndian(bool write, uint32 uiByteCount, uint32* buffer)
 {
        uint32 uiIndex = 0;
 
-       if( write == true ) {
-               for(uiIndex = 0; uiIndex < (uiByteCount/sizeof(uint32)); 
uiIndex++) {
+       if (write == true) {
+               for (uiIndex = 0; uiIndex < (uiByteCount / sizeof(uint32)); 
uiIndex++) {
                        buffer[uiIndex] = htonl(buffer[uiIndex]);
                }
        } else {
-               for(uiIndex = 0; uiIndex < (uiByteCount/sizeof(uint32)); 
uiIndex++) {
+               for (uiIndex = 0; uiIndex < (uiByteCount / sizeof(uint32)); 
uiIndex++) {
                        buffer[uiIndex] = ntohl(buffer[uiIndex]);
                }
        }
 }
 
+
 uint16_t
 CalculateHWChecksum(uint8_t* pu8Buffer, uint32 u32Size)
 {
-       uint16_t u16CheckSum=0;
-       while(u32Size--) {
+       uint16_t u16CheckSum = 0;
+       while (u32Size--) {
                u16CheckSum += (uint8_t)~(*pu8Buffer);
                pu8Buffer++;
        }
        return u16CheckSum;
 }
-
diff --git a/src/add-ons/kernel/drivers/network/wwan/usb_beceemwmx/util.h 
b/src/add-ons/kernel/drivers/network/wwan/usb_beceemwmx/util.h
index 066bbf2..8a3a6de 100644
--- a/src/add-ons/kernel/drivers/network/wwan/usb_beceemwmx/util.h
+++ b/src/add-ons/kernel/drivers/network/wwan/usb_beceemwmx/util.h
@@ -5,8 +5,9 @@
  *
  */
 
+
 #include "Driver.h"
 
+
 void convertEndian(bool write, uint32 uiByteCount, uint32* buffer);
 uint16_t CalculateHWChecksum(uint8_t* pu8Buffer, uint32 u32Size);
-


Other related posts:

  • » [haiku-commits] haiku: hrev43240 - src/add-ons/kernel/drivers/network/wwan/usb_beceemwmx - kallisti5