Commit 9bcfab20 authored by Matthias Beyer's avatar Matthias Beyer Committed by Greg Kroah-Hartman

Staging: bcm: led_control.c: Indentation/Whitespace/Line length cleanup

Signed-off-by: default avatarMatthias Beyer <mail@beyermatthias.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 351e836f
...@@ -23,8 +23,12 @@ bool IsReqGpioIsLedInNVM(struct bcm_mini_adapter *Adapter, UINT gpios) ...@@ -23,8 +23,12 @@ bool IsReqGpioIsLedInNVM(struct bcm_mini_adapter *Adapter, UINT gpios)
return TRUE; return TRUE;
} }
static INT LED_Blink(struct bcm_mini_adapter *Adapter, UINT GPIO_Num, UCHAR uiLedIndex, static INT LED_Blink(struct bcm_mini_adapter *Adapter,
ULONG timeout, INT num_of_time, enum bcm_led_events currdriverstate) UINT GPIO_Num,
UCHAR uiLedIndex,
ULONG timeout,
INT num_of_time,
enum bcm_led_events currdriverstate)
{ {
int Status = STATUS_SUCCESS; int Status = STATUS_SUCCESS;
bool bInfinite = false; bool bInfinite = false;
...@@ -95,8 +99,11 @@ static INT ScaleRateofTransfer(ULONG rate) ...@@ -95,8 +99,11 @@ static INT ScaleRateofTransfer(ULONG rate)
static INT LED_Proportional_Blink(struct bcm_mini_adapter *Adapter, UCHAR GPIO_Num_tx, static INT LED_Proportional_Blink(struct bcm_mini_adapter *Adapter,
UCHAR uiTxLedIndex, UCHAR GPIO_Num_rx, UCHAR uiRxLedIndex, UCHAR GPIO_Num_tx,
UCHAR uiTxLedIndex,
UCHAR GPIO_Num_rx,
UCHAR uiRxLedIndex,
enum bcm_led_events currdriverstate) enum bcm_led_events currdriverstate)
{ {
/* Initial values of TX and RX packets */ /* Initial values of TX and RX packets */
...@@ -261,7 +268,8 @@ static INT LED_Proportional_Blink(struct bcm_mini_adapter *Adapter, UCHAR GPIO_N ...@@ -261,7 +268,8 @@ static INT LED_Proportional_Blink(struct bcm_mini_adapter *Adapter, UCHAR GPIO_N
* <OSAL_STATUS_CODE> * <OSAL_STATUS_CODE>
* ----------------------------------------------------------------------------- * -----------------------------------------------------------------------------
*/ */
static INT ValidateDSDParamsChecksum(struct bcm_mini_adapter *Adapter, ULONG ulParamOffset, static INT ValidateDSDParamsChecksum(struct bcm_mini_adapter *Adapter,
ULONG ulParamOffset,
USHORT usParamLen) USHORT usParamLen)
{ {
INT Status = STATUS_SUCCESS; INT Status = STATUS_SUCCESS;
...@@ -347,7 +355,8 @@ static INT ValidateDSDParamsChecksum(struct bcm_mini_adapter *Adapter, ULONG ulP ...@@ -347,7 +355,8 @@ static INT ValidateDSDParamsChecksum(struct bcm_mini_adapter *Adapter, ULONG ulP
* <OSAL_STATUS_CODE> * <OSAL_STATUS_CODE>
* ----------------------------------------------------------------------------- * -----------------------------------------------------------------------------
*/ */
static INT ValidateHWParmStructure(struct bcm_mini_adapter *Adapter, ULONG ulHwParamOffset) static INT ValidateHWParmStructure(struct bcm_mini_adapter *Adapter,
ULONG ulHwParamOffset)
{ {
INT Status = STATUS_SUCCESS; INT Status = STATUS_SUCCESS;
...@@ -387,7 +396,8 @@ static int ReadLEDInformationFromEEPROM(struct bcm_mini_adapter *Adapter, ...@@ -387,7 +396,8 @@ static int ReadLEDInformationFromEEPROM(struct bcm_mini_adapter *Adapter,
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, LED_DUMP_INFO, DBG_LVL_ALL, BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, LED_DUMP_INFO, DBG_LVL_ALL,
"usEEPROMVersion: Minor:0x%X Major:0x%x", "usEEPROMVersion: Minor:0x%X Major:0x%x",
usEEPROMVersion&0xFF, ((usEEPROMVersion>>8)&0xFF)); usEEPROMVersion & 0xFF,
((usEEPROMVersion >> 8) & 0xFF));
if (((usEEPROMVersion>>8)&0xFF) < EEPROM_MAP5_MAJORVERSION) { if (((usEEPROMVersion>>8)&0xFF) < EEPROM_MAP5_MAJORVERSION) {
...@@ -437,8 +447,8 @@ static int ReadLEDInformationFromEEPROM(struct bcm_mini_adapter *Adapter, ...@@ -437,8 +447,8 @@ static int ReadLEDInformationFromEEPROM(struct bcm_mini_adapter *Adapter,
* To read GPIO section, add GPIO offset further. * To read GPIO section, add GPIO offset further.
*/ */
dwReadValue += dwReadValue += DSD_START_OFFSET;
DSD_START_OFFSET; /* = start address of hw param section. */ /* = start address of hw param section. */
dwReadValue += GPIO_SECTION_START_OFFSET; dwReadValue += GPIO_SECTION_START_OFFSET;
/* = GPIO start offset within HW Param section. */ /* = GPIO start offset within HW Param section. */
...@@ -472,7 +482,8 @@ static int ReadLEDInformationFromEEPROM(struct bcm_mini_adapter *Adapter, ...@@ -472,7 +482,8 @@ static int ReadLEDInformationFromEEPROM(struct bcm_mini_adapter *Adapter,
} }
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, LED_DUMP_INFO, DBG_LVL_ALL, BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, LED_DUMP_INFO, DBG_LVL_ALL,
"GPIO's bit map correspond to LED :0x%X", Adapter->gpioBitMap); "GPIO's bit map correspond to LED :0x%X",
Adapter->gpioBitMap);
return Status; return Status;
} }
...@@ -490,7 +501,7 @@ static int ReadConfigFileStructure(struct bcm_mini_adapter *Adapter, ...@@ -490,7 +501,7 @@ static int ReadConfigFileStructure(struct bcm_mini_adapter *Adapter,
memset(GPIO_Array, DISABLE_GPIO_NUM, NUM_OF_LEDS+1); memset(GPIO_Array, DISABLE_GPIO_NUM, NUM_OF_LEDS+1);
if (!Adapter->pstargetparams || IS_ERR(Adapter->pstargetparams)) { if (!Adapter->pstargetparams || IS_ERR(Adapter->pstargetparams)) {
BCM_DEBUG_PRINT (Adapter, DBG_TYPE_OTHERS, LED_DUMP_INFO, BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, LED_DUMP_INFO,
DBG_LVL_ALL, "Target Params not Avail.\n"); DBG_LVL_ALL, "Target Params not Avail.\n");
return -ENOENT; return -ENOENT;
} }
...@@ -555,7 +566,8 @@ static int ReadConfigFileStructure(struct bcm_mini_adapter *Adapter, ...@@ -555,7 +566,8 @@ static int ReadConfigFileStructure(struct bcm_mini_adapter *Adapter,
* dont launch the LED control thread. * dont launch the LED control thread.
*/ */
for (uiIndex = 0; uiIndex < NUM_OF_LEDS; uiIndex++) { for (uiIndex = 0; uiIndex < NUM_OF_LEDS; uiIndex++) {
if ((Adapter->LEDInfo.LEDState[uiIndex].LED_Type == DISABLE_GPIO_NUM) || if ((Adapter->LEDInfo.LEDState[uiIndex].LED_Type ==
DISABLE_GPIO_NUM) ||
(Adapter->LEDInfo.LEDState[uiIndex].LED_Type == 0x7f) || (Adapter->LEDInfo.LEDState[uiIndex].LED_Type == 0x7f) ||
(Adapter->LEDInfo.LEDState[uiIndex].LED_Type == 0)) (Adapter->LEDInfo.LEDState[uiIndex].LED_Type == 0))
uiNum_of_LED_Type++; uiNum_of_LED_Type++;
...@@ -599,14 +611,17 @@ static VOID LedGpioInit(struct bcm_mini_adapter *Adapter) ...@@ -599,14 +611,17 @@ static VOID LedGpioInit(struct bcm_mini_adapter *Adapter)
} }
if (wrmalt(Adapter, GPIO_MODE_REGISTER, &uiResetValue, if (wrmalt(Adapter, GPIO_MODE_REGISTER, &uiResetValue,
sizeof(uiResetValue)) < 0) sizeof(uiResetValue)) < 0)
BCM_DEBUG_PRINT (Adapter, DBG_TYPE_OTHERS, LED_DUMP_INFO, BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, LED_DUMP_INFO,
DBG_LVL_ALL, "LED Thread: WRM Failed\n"); DBG_LVL_ALL, "LED Thread: WRM Failed\n");
Adapter->LEDInfo.bIdle_led_off = false; Adapter->LEDInfo.bIdle_led_off = false;
} }
static INT BcmGetGPIOPinInfo(struct bcm_mini_adapter *Adapter, UCHAR *GPIO_num_tx, static INT BcmGetGPIOPinInfo(struct bcm_mini_adapter *Adapter,
UCHAR *GPIO_num_rx, UCHAR *uiLedTxIndex, UCHAR *uiLedRxIndex, UCHAR *GPIO_num_tx,
UCHAR *GPIO_num_rx,
UCHAR *uiLedTxIndex,
UCHAR *uiLedRxIndex,
enum bcm_led_events currdriverstate) enum bcm_led_events currdriverstate)
{ {
UINT uiIndex = 0; UINT uiIndex = 0;
...@@ -645,6 +660,7 @@ static INT BcmGetGPIOPinInfo(struct bcm_mini_adapter *Adapter, UCHAR *GPIO_num_t ...@@ -645,6 +660,7 @@ static INT BcmGetGPIOPinInfo(struct bcm_mini_adapter *Adapter, UCHAR *GPIO_num_t
} }
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
static VOID LEDControlThread(struct bcm_mini_adapter *Adapter) static VOID LEDControlThread(struct bcm_mini_adapter *Adapter)
{ {
UINT uiIndex = 0; UINT uiIndex = 0;
...@@ -708,7 +724,8 @@ static VOID LEDControlThread(struct bcm_mini_adapter *Adapter) ...@@ -708,7 +724,8 @@ static VOID LEDControlThread(struct bcm_mini_adapter *Adapter)
currdriverstate = DRIVER_INIT; currdriverstate = DRIVER_INIT;
/* Adapter->DriverState; */ /* Adapter->DriverState; */
BcmGetGPIOPinInfo(Adapter, &GPIO_num, &dummyGPIONum, BcmGetGPIOPinInfo(Adapter, &GPIO_num, &dummyGPIONum,
&uiLedIndex, &dummyIndex, currdriverstate); &uiLedIndex, &dummyIndex,
currdriverstate);
if (GPIO_num != DISABLE_GPIO_NUM) if (GPIO_num != DISABLE_GPIO_NUM)
TURN_ON_LED(1 << GPIO_num, uiLedIndex); TURN_ON_LED(1 << GPIO_num, uiLedIndex);
...@@ -722,7 +739,8 @@ static VOID LEDControlThread(struct bcm_mini_adapter *Adapter) ...@@ -722,7 +739,8 @@ static VOID LEDControlThread(struct bcm_mini_adapter *Adapter)
*/ */
currdriverstate = FW_DOWNLOAD; currdriverstate = FW_DOWNLOAD;
BcmGetGPIOPinInfo(Adapter, &GPIO_num, &dummyGPIONum, BcmGetGPIOPinInfo(Adapter, &GPIO_num, &dummyGPIONum,
&uiLedIndex, &dummyIndex, currdriverstate); &uiLedIndex, &dummyIndex,
currdriverstate);
if (GPIO_num != DISABLE_GPIO_NUM) { if (GPIO_num != DISABLE_GPIO_NUM) {
timeout = 50; timeout = 50;
...@@ -733,7 +751,8 @@ static VOID LEDControlThread(struct bcm_mini_adapter *Adapter) ...@@ -733,7 +751,8 @@ static VOID LEDControlThread(struct bcm_mini_adapter *Adapter)
case FW_DOWNLOAD_DONE: case FW_DOWNLOAD_DONE:
currdriverstate = FW_DOWNLOAD_DONE; currdriverstate = FW_DOWNLOAD_DONE;
BcmGetGPIOPinInfo(Adapter, &GPIO_num, &dummyGPIONum, BcmGetGPIOPinInfo(Adapter, &GPIO_num, &dummyGPIONum,
&uiLedIndex, &dummyIndex, currdriverstate); &uiLedIndex, &dummyIndex,
currdriverstate);
if (GPIO_num != DISABLE_GPIO_NUM) if (GPIO_num != DISABLE_GPIO_NUM)
TURN_ON_LED(1 << GPIO_num, uiLedIndex); TURN_ON_LED(1 << GPIO_num, uiLedIndex);
break; break;
...@@ -746,7 +765,8 @@ static VOID LEDControlThread(struct bcm_mini_adapter *Adapter) ...@@ -746,7 +765,8 @@ static VOID LEDControlThread(struct bcm_mini_adapter *Adapter)
case NO_NETWORK_ENTRY: case NO_NETWORK_ENTRY:
currdriverstate = NO_NETWORK_ENTRY; currdriverstate = NO_NETWORK_ENTRY;
BcmGetGPIOPinInfo(Adapter, &GPIO_num, &dummyGPIONum, BcmGetGPIOPinInfo(Adapter, &GPIO_num, &dummyGPIONum,
&uiLedIndex, &dummyGPIONum, currdriverstate); &uiLedIndex, &dummyGPIONum,
currdriverstate);
if (GPIO_num != DISABLE_GPIO_NUM) if (GPIO_num != DISABLE_GPIO_NUM)
TURN_ON_LED(1 << GPIO_num, uiLedIndex); TURN_ON_LED(1 << GPIO_num, uiLedIndex);
break; break;
......
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