Commit 786bdddc authored by Gokulnath Avanashilingam's avatar Gokulnath Avanashilingam Committed by Greg Kroah-Hartman

staging: bcm: line over 80 characters in InterfaceIdleMode.c

Fixed all the line over 80 characters warning found by
checkpatch.pl script.
Signed-off-by: default avatarGokulnath Avanashilingam <Gokulnath.Avanashilingam@in.bosch.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d52dd37e
#include "headers.h" #include "headers.h"
/* /*
Function: InterfaceIdleModeWakeup Function: InterfaceIdleModeWakeup
Description: This is the hardware specific Function for waking up HW device from Idle mode. Description: This is the hardware specific Function for
A software abort pattern is written to the device to wake it and necessary power state waking up HW device from Idle mode.
transitions from host are performed here. A software abort pattern is written to the
device to wake it and necessary power state
transitions from host are performed here.
Input parameters: IN struct bcm_mini_adapter *Adapter - Miniport Adapter Context Input parameters: IN struct bcm_mini_adapter *Adapter
- Miniport Adapter Context
Return: BCM_STATUS_SUCCESS - If Wakeup of the HW Interface
Return: BCM_STATUS_SUCCESS - If Wakeup of the HW Interface was successful. was successful.
Other - If an error occurred. Other - If an error occurred.
*/ */
/* /*
Function: InterfaceIdleModeRespond Function: InterfaceIdleModeRespond
Description: This is the hardware specific Function for responding to Idle mode request from target. Description: This is the hardware specific Function for
Necessary power state transitions from host for idle mode or other device specific responding to Idle mode request from target.
initializations are performed here. Necessary power state transitions from host for
idle mode or other device specific initializations
are performed here.
Input parameters: IN struct bcm_mini_adapter * Adapter - Miniport Adapter Context Input parameters: IN struct bcm_mini_adapter * Adapter
- Miniport Adapter Context
Return: BCM_STATUS_SUCCESS - If Idle mode response related
Return: BCM_STATUS_SUCCESS - If Idle mode response related HW configuration was successful. HW configuration was successful.
Other - If an error occurred. Other - If an error occurred.
*/ */
/* /*
...@@ -36,13 +41,15 @@ this value will be at address bfc02fa4.just before value d0ea1dle. ...@@ -36,13 +41,15 @@ this value will be at address bfc02fa4.just before value d0ea1dle.
Set time value by writing at bfc02f98 7d0 Set time value by writing at bfc02f98 7d0
checking the Ack timer expire on kannon by running command checking the Ack timer expire on kannon by running command
d qcslog .. if it shows e means host has not send response to f/w with in 200 ms. Response should be d qcslog .. if it shows e means host has not send response
to f/w with in 200 ms. Response should be
send to f/w with in 200 ms after the Idle/Shutdown req issued send to f/w with in 200 ms after the Idle/Shutdown req issued
*/ */
int InterfaceIdleModeRespond(struct bcm_mini_adapter *Adapter, unsigned int *puiBuffer) int InterfaceIdleModeRespond(struct bcm_mini_adapter *Adapter,
unsigned int *puiBuffer)
{ {
int status = STATUS_SUCCESS; int status = STATUS_SUCCESS;
unsigned int uiRegRead = 0; unsigned int uiRegRead = 0;
...@@ -51,33 +58,42 @@ int InterfaceIdleModeRespond(struct bcm_mini_adapter *Adapter, unsigned int *pui ...@@ -51,33 +58,42 @@ int InterfaceIdleModeRespond(struct bcm_mini_adapter *Adapter, unsigned int *pui
if (ntohl(*puiBuffer) == GO_TO_IDLE_MODE_PAYLOAD) { if (ntohl(*puiBuffer) == GO_TO_IDLE_MODE_PAYLOAD) {
if (ntohl(*(puiBuffer+1)) == 0 ) { if (ntohl(*(puiBuffer+1)) == 0 ) {
status = wrmalt (Adapter, SW_ABORT_IDLEMODE_LOC, &uiRegRead, sizeof(uiRegRead)); status = wrmalt (Adapter, SW_ABORT_IDLEMODE_LOC,
&uiRegRead, sizeof(uiRegRead));
if (status) if (status)
return status; return status;
if (Adapter->ulPowerSaveMode == DEVICE_POWERSAVE_MODE_AS_MANUAL_CLOCK_GATING) { if (Adapter->ulPowerSaveMode ==
DEVICE_POWERSAVE_MODE_AS_MANUAL_CLOCK_GATING) {
uiRegRead = 0x00000000 ; uiRegRead = 0x00000000 ;
status = wrmalt (Adapter, DEBUG_INTERRUPT_GENERATOR_REGISTOR, &uiRegRead, sizeof(uiRegRead)); status = wrmalt (Adapter,
DEBUG_INTERRUPT_GENERATOR_REGISTOR,
&uiRegRead, sizeof(uiRegRead));
if (status) if (status)
return status; return status;
} }
/* Below Register should not br read in case of Manual and Protocol Idle mode */ /* Below Register should not br read in case of
else if (Adapter->ulPowerSaveMode != DEVICE_POWERSAVE_MODE_AS_PROTOCOL_IDLE_MODE) { * Manual and Protocol Idle mode */
else if (Adapter->ulPowerSaveMode !=
DEVICE_POWERSAVE_MODE_AS_PROTOCOL_IDLE_MODE) {
/* clear on read Register */ /* clear on read Register */
bytes = rdmalt(Adapter, DEVICE_INT_OUT_EP_REG0, &uiRegRead, sizeof(uiRegRead)); bytes = rdmalt(Adapter, DEVICE_INT_OUT_EP_REG0,
&uiRegRead, sizeof(uiRegRead));
if (bytes < 0) { if (bytes < 0) {
status = bytes; status = bytes;
return status; return status;
} }
/* clear on read Register */ /* clear on read Register */
bytes = rdmalt(Adapter, DEVICE_INT_OUT_EP_REG1, &uiRegRead, sizeof(uiRegRead)); bytes = rdmalt(Adapter, DEVICE_INT_OUT_EP_REG1,
&uiRegRead, sizeof(uiRegRead));
if (bytes < 0) { if (bytes < 0) {
status = bytes; status = bytes;
return status; return status;
} }
} }
/* Set Idle Mode Flag to False and Clear IdleMode reg. */ /* Set Idle Mode Flag to False and
* Clear IdleMode reg. */
Adapter->IdleMode = false; Adapter->IdleMode = false;
Adapter->bTriedToWakeUpFromlowPowerMode = false; Adapter->bTriedToWakeUpFromlowPowerMode = false;
...@@ -94,7 +110,8 @@ int InterfaceIdleModeRespond(struct bcm_mini_adapter *Adapter, unsigned int *pui ...@@ -94,7 +110,8 @@ int InterfaceIdleModeRespond(struct bcm_mini_adapter *Adapter, unsigned int *pui
Adapter->chip_id == BCS250_BC || Adapter->chip_id == BCS250_BC ||
Adapter->chip_id == BCS220_3) { Adapter->chip_id == BCS220_3) {
bytes = rdmalt(Adapter, HPM_CONFIG_MSW, &uiRegRead, sizeof(uiRegRead)); bytes = rdmalt(Adapter, HPM_CONFIG_MSW,
&uiRegRead, sizeof(uiRegRead));
if (bytes < 0) { if (bytes < 0) {
status = bytes; status = bytes;
return status; return status;
...@@ -103,7 +120,8 @@ int InterfaceIdleModeRespond(struct bcm_mini_adapter *Adapter, unsigned int *pui ...@@ -103,7 +120,8 @@ int InterfaceIdleModeRespond(struct bcm_mini_adapter *Adapter, unsigned int *pui
uiRegRead |= (1<<17); uiRegRead |= (1<<17);
status = wrmalt (Adapter, HPM_CONFIG_MSW, &uiRegRead, sizeof(uiRegRead)); status = wrmalt (Adapter, HPM_CONFIG_MSW,
&uiRegRead, sizeof(uiRegRead));
if (status) if (status)
return status; return status;
} }
...@@ -115,7 +133,8 @@ int InterfaceIdleModeRespond(struct bcm_mini_adapter *Adapter, unsigned int *pui ...@@ -115,7 +133,8 @@ int InterfaceIdleModeRespond(struct bcm_mini_adapter *Adapter, unsigned int *pui
return status; return status;
} }
static int InterfaceAbortIdlemode(struct bcm_mini_adapter *Adapter, unsigned int Pattern) static int InterfaceAbortIdlemode(struct bcm_mini_adapter *Adapter,
unsigned int Pattern)
{ {
int status = STATUS_SUCCESS; int status = STATUS_SUCCESS;
unsigned int value; unsigned int value;
...@@ -123,29 +142,38 @@ static int InterfaceAbortIdlemode(struct bcm_mini_adapter *Adapter, unsigned int ...@@ -123,29 +142,38 @@ static int InterfaceAbortIdlemode(struct bcm_mini_adapter *Adapter, unsigned int
unsigned long timeout = 0, itr = 0; unsigned long timeout = 0, itr = 0;
int lenwritten = 0; int lenwritten = 0;
unsigned char aucAbortPattern[8] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; unsigned char aucAbortPattern[8] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
struct bcm_interface_adapter *psInterfaceAdapter = Adapter->pvInterfaceAdapter; 0xFF, 0xFF, 0xFF};
struct bcm_interface_adapter *psInterfaceAdapter =
Adapter->pvInterfaceAdapter;
/* Abort Bus suspend if its already suspended */ /* Abort Bus suspend if its already suspended */
if ((TRUE == psInterfaceAdapter->bSuspended) && (TRUE == Adapter->bDoSuspend)) if ((TRUE == psInterfaceAdapter->bSuspended) &&
status = usb_autopm_get_interface(psInterfaceAdapter->interface); (TRUE == Adapter->bDoSuspend))
status = usb_autopm_get_interface(
if ((Adapter->ulPowerSaveMode == DEVICE_POWERSAVE_MODE_AS_MANUAL_CLOCK_GATING) psInterfaceAdapter->interface);
||
(Adapter->ulPowerSaveMode == DEVICE_POWERSAVE_MODE_AS_PROTOCOL_IDLE_MODE)) { if ((Adapter->ulPowerSaveMode ==
DEVICE_POWERSAVE_MODE_AS_MANUAL_CLOCK_GATING) ||
(Adapter->ulPowerSaveMode ==
DEVICE_POWERSAVE_MODE_AS_PROTOCOL_IDLE_MODE)) {
/* write the SW abort pattern. */ /* write the SW abort pattern. */
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, IDLE_MODE, DBG_LVL_ALL, "Writing pattern<%d> to SW_ABORT_IDLEMODE_LOC\n", Pattern); status = wrmalt(Adapter, SW_ABORT_IDLEMODE_LOC,
status = wrmalt(Adapter, SW_ABORT_IDLEMODE_LOC, &Pattern, sizeof(Pattern)); &Pattern, sizeof(Pattern));
if (status) if (status)
return status; return status;
} }
if (Adapter->ulPowerSaveMode == DEVICE_POWERSAVE_MODE_AS_MANUAL_CLOCK_GATING) { if (Adapter->ulPowerSaveMode ==
DEVICE_POWERSAVE_MODE_AS_MANUAL_CLOCK_GATING) {
value = 0x80000000; value = 0x80000000;
status = wrmalt(Adapter, DEBUG_INTERRUPT_GENERATOR_REGISTOR, &value, sizeof(value)); status = wrmalt(Adapter,
DEBUG_INTERRUPT_GENERATOR_REGISTOR,
&value, sizeof(value));
if (status) if (status)
return status; return status;
} else if (Adapter->ulPowerSaveMode != DEVICE_POWERSAVE_MODE_AS_PROTOCOL_IDLE_MODE) { } else if (Adapter->ulPowerSaveMode !=
DEVICE_POWERSAVE_MODE_AS_PROTOCOL_IDLE_MODE) {
/* /*
* Get a Interrupt Out URB and send 8 Bytes Down * Get a Interrupt Out URB and send 8 Bytes Down
* To be Done in Thread Context. * To be Done in Thread Context.
...@@ -161,7 +189,9 @@ static int InterfaceAbortIdlemode(struct bcm_mini_adapter *Adapter, unsigned int ...@@ -161,7 +189,9 @@ static int InterfaceAbortIdlemode(struct bcm_mini_adapter *Adapter, unsigned int
if (status) if (status)
return status; return status;
else else
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, IDLE_MODE, DBG_LVL_ALL, "NOB Sent down :%d", lenwritten); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS,
IDLE_MODE, DBG_LVL_ALL,
"NOB Sent down :%d", lenwritten);
/* mdelay(25); */ /* mdelay(25); */
...@@ -174,12 +204,18 @@ static int InterfaceAbortIdlemode(struct bcm_mini_adapter *Adapter, unsigned int ...@@ -174,12 +204,18 @@ static int InterfaceAbortIdlemode(struct bcm_mini_adapter *Adapter, unsigned int
if (chip_id == Adapter->chip_id) if (chip_id == Adapter->chip_id)
break; break;
} }
if (timeout < jiffies ) if ( timeout < jiffies )
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, IDLE_MODE, DBG_LVL_ALL, "Not able to read chip-id even after 25 msec"); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS,
IDLE_MODE, DBG_LVL_ALL,
"Not able to read chip-id even after 25 msec");
else else
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, IDLE_MODE, DBG_LVL_ALL, "Number of completed iteration to read chip-id :%lu", itr); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS,
IDLE_MODE, DBG_LVL_ALL,
"Number of completed iteration to"
"read chip-id :%lu", itr);
status = wrmalt(Adapter, SW_ABORT_IDLEMODE_LOC, &Pattern, sizeof(status)); status = wrmalt(Adapter, SW_ABORT_IDLEMODE_LOC,
&Pattern, sizeof(status));
if (status) if (status)
return status; return status;
} }
...@@ -189,7 +225,9 @@ int InterfaceIdleModeWakeup(struct bcm_mini_adapter *Adapter) ...@@ -189,7 +225,9 @@ int InterfaceIdleModeWakeup(struct bcm_mini_adapter *Adapter)
{ {
ULONG Status = 0; ULONG Status = 0;
if (Adapter->bTriedToWakeUpFromlowPowerMode) { if (Adapter->bTriedToWakeUpFromlowPowerMode) {
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, IDLE_MODE, DBG_LVL_ALL, "Wake up already attempted.. ignoring\n"); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS,
IDLE_MODE, DBG_LVL_ALL,
"Wake up already attempted.. ignoring\n");
} else { } else {
Adapter->bTriedToWakeUpFromlowPowerMode = TRUE; Adapter->bTriedToWakeUpFromlowPowerMode = TRUE;
InterfaceAbortIdlemode(Adapter, Adapter->usIdleModePattern); InterfaceAbortIdlemode(Adapter, Adapter->usIdleModePattern);
...@@ -204,24 +242,31 @@ void InterfaceHandleShutdownModeWakeup(struct bcm_mini_adapter *Adapter) ...@@ -204,24 +242,31 @@ void InterfaceHandleShutdownModeWakeup(struct bcm_mini_adapter *Adapter)
INT Status = 0; INT Status = 0;
int bytes; int bytes;
if (Adapter->ulPowerSaveMode == DEVICE_POWERSAVE_MODE_AS_MANUAL_CLOCK_GATING) { if (Adapter->ulPowerSaveMode ==
DEVICE_POWERSAVE_MODE_AS_MANUAL_CLOCK_GATING) {
/* clear idlemode interrupt. */ /* clear idlemode interrupt. */
uiRegVal = 0; uiRegVal = 0;
Status = wrmalt(Adapter, DEBUG_INTERRUPT_GENERATOR_REGISTOR, &uiRegVal, sizeof(uiRegVal)); Status = wrmalt(Adapter,
DEBUG_INTERRUPT_GENERATOR_REGISTOR,
&uiRegVal, sizeof(uiRegVal));
if (Status) if (Status)
return; return;
} }
else { else {
/* clear Interrupt EP registers. */ /* clear Interrupt EP registers. */
bytes = rdmalt(Adapter, DEVICE_INT_OUT_EP_REG0, &uiRegVal, sizeof(uiRegVal)); bytes = rdmalt(Adapter,
DEVICE_INT_OUT_EP_REG0,
&uiRegVal, sizeof(uiRegVal));
if (bytes < 0) { if (bytes < 0) {
Status = bytes; Status = bytes;
return; return;
} }
bytes = rdmalt(Adapter, DEVICE_INT_OUT_EP_REG1, &uiRegVal, sizeof(uiRegVal)); bytes = rdmalt(Adapter,
DEVICE_INT_OUT_EP_REG1,
&uiRegVal, sizeof(uiRegVal));
if (bytes < 0) { if (bytes < 0) {
Status = bytes; Status = bytes;
return; return;
......
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