|
@@ -48,26 +48,18 @@ int InterfaceIdleModeRespond(struct bcm_mini_adapter *Adapter, unsigned int *pui
|
|
|
unsigned int uiRegRead = 0;
|
|
|
int bytes;
|
|
|
|
|
|
- BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, IDLE_MODE, DBG_LVL_ALL, "SubType of Message :0x%X", ntohl(*puiBuffer));
|
|
|
-
|
|
|
if (ntohl(*puiBuffer) == GO_TO_IDLE_MODE_PAYLOAD) {
|
|
|
- BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, IDLE_MODE, DBG_LVL_ALL, " Got GO_TO_IDLE_MODE_PAYLOAD(210) Msg Subtype");
|
|
|
if (ntohl(*(puiBuffer+1)) == 0 ) {
|
|
|
- BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, IDLE_MODE, DBG_LVL_ALL, "Got IDLE MODE WAKE UP Response From F/W");
|
|
|
|
|
|
status = wrmalt (Adapter, SW_ABORT_IDLEMODE_LOC, &uiRegRead, sizeof(uiRegRead));
|
|
|
- if (status) {
|
|
|
- BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "wrm failed while clearing Idle Mode Reg");
|
|
|
+ if (status)
|
|
|
return status;
|
|
|
- }
|
|
|
|
|
|
if (Adapter->ulPowerSaveMode == DEVICE_POWERSAVE_MODE_AS_MANUAL_CLOCK_GATING) {
|
|
|
uiRegRead = 0x00000000 ;
|
|
|
status = wrmalt (Adapter, DEBUG_INTERRUPT_GENERATOR_REGISTOR, &uiRegRead, sizeof(uiRegRead));
|
|
|
- if (status) {
|
|
|
- BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "wrm failed while clearing Idle Mode Reg");
|
|
|
+ if (status)
|
|
|
return status;
|
|
|
- }
|
|
|
}
|
|
|
/* Below Register should not br read in case of Manual and Protocol Idle mode */
|
|
|
else if (Adapter->ulPowerSaveMode != DEVICE_POWERSAVE_MODE_AS_PROTOCOL_IDLE_MODE) {
|
|
@@ -75,18 +67,15 @@ int InterfaceIdleModeRespond(struct bcm_mini_adapter *Adapter, unsigned int *pui
|
|
|
bytes = rdmalt(Adapter, DEVICE_INT_OUT_EP_REG0, &uiRegRead, sizeof(uiRegRead));
|
|
|
if (bytes < 0) {
|
|
|
status = bytes;
|
|
|
- BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "rdm failed while clearing H/W Abort Reg0");
|
|
|
return status;
|
|
|
}
|
|
|
/* clear on read Register */
|
|
|
bytes = rdmalt(Adapter, DEVICE_INT_OUT_EP_REG1, &uiRegRead, sizeof(uiRegRead));
|
|
|
if (bytes < 0) {
|
|
|
status = bytes;
|
|
|
- BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "rdm failed while clearing H/W Abort Reg1");
|
|
|
return status;
|
|
|
}
|
|
|
}
|
|
|
- BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, IDLE_MODE, DBG_LVL_ALL, "Device Up from Idle Mode");
|
|
|
|
|
|
/* Set Idle Mode Flag to False and Clear IdleMode reg. */
|
|
|
Adapter->IdleMode = false;
|
|
@@ -96,13 +85,9 @@ int InterfaceIdleModeRespond(struct bcm_mini_adapter *Adapter, unsigned int *pui
|
|
|
|
|
|
} else {
|
|
|
if (TRUE == Adapter->IdleMode)
|
|
|
- {
|
|
|
- BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, IDLE_MODE, DBG_LVL_ALL, "Device is already in Idle mode....");
|
|
|
return status ;
|
|
|
- }
|
|
|
|
|
|
uiRegRead = 0;
|
|
|
- BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, IDLE_MODE, DBG_LVL_ALL, "Got Req from F/W to go in IDLE mode \n");
|
|
|
|
|
|
if (Adapter->chip_id == BCS220_2 ||
|
|
|
Adapter->chip_id == BCS220_2BC ||
|
|
@@ -112,7 +97,6 @@ int InterfaceIdleModeRespond(struct bcm_mini_adapter *Adapter, unsigned int *pui
|
|
|
bytes = rdmalt(Adapter, HPM_CONFIG_MSW, &uiRegRead, sizeof(uiRegRead));
|
|
|
if (bytes < 0) {
|
|
|
status = bytes;
|
|
|
- BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, IDLE_MODE, DBG_LVL_ALL, "rdm failed while Reading HPM_CONFIG_LDO145 Reg 0\n");
|
|
|
return status;
|
|
|
}
|
|
|
|
|
@@ -120,16 +104,12 @@ int InterfaceIdleModeRespond(struct bcm_mini_adapter *Adapter, unsigned int *pui
|
|
|
uiRegRead |= (1<<17);
|
|
|
|
|
|
status = wrmalt (Adapter, HPM_CONFIG_MSW, &uiRegRead, sizeof(uiRegRead));
|
|
|
- if (status) {
|
|
|
- BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "wrm failed while clearing Idle Mode Reg\n");
|
|
|
+ if (status)
|
|
|
return status;
|
|
|
- }
|
|
|
-
|
|
|
}
|
|
|
SendIdleModeResponse(Adapter);
|
|
|
}
|
|
|
} else if (ntohl(*puiBuffer) == IDLE_MODE_SF_UPDATE_MSG) {
|
|
|
- BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, IDLE_MODE, DBG_LVL_ALL, "OverRiding Service Flow Params");
|
|
|
OverrideServiceFlowParams(Adapter, puiBuffer);
|
|
|
}
|
|
|
return status;
|
|
@@ -147,11 +127,8 @@ static int InterfaceAbortIdlemode(struct bcm_mini_adapter *Adapter, unsigned int
|
|
|
struct bcm_interface_adapter *psInterfaceAdapter = Adapter->pvInterfaceAdapter;
|
|
|
|
|
|
/* Abort Bus suspend if its already suspended */
|
|
|
- if ((TRUE == psInterfaceAdapter->bSuspended) && (TRUE == Adapter->bDoSuspend)) {
|
|
|
+ if ((TRUE == psInterfaceAdapter->bSuspended) && (TRUE == Adapter->bDoSuspend))
|
|
|
status = usb_autopm_get_interface(psInterfaceAdapter->interface);
|
|
|
- BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, IDLE_MODE, DBG_LVL_ALL, "Bus got wakeup..Aborting Idle mode... status:%d \n", status);
|
|
|
-
|
|
|
- }
|
|
|
|
|
|
if ((Adapter->ulPowerSaveMode == DEVICE_POWERSAVE_MODE_AS_MANUAL_CLOCK_GATING)
|
|
|
||
|
|
@@ -159,20 +136,15 @@ static int InterfaceAbortIdlemode(struct bcm_mini_adapter *Adapter, unsigned int
|
|
|
/* 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, &Pattern, sizeof(Pattern));
|
|
|
- if (status) {
|
|
|
- BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, IDLE_MODE, DBG_LVL_ALL, "WRM to Register SW_ABORT_IDLEMODE_LOC failed..");
|
|
|
- return status;
|
|
|
- }
|
|
|
+ if (status)
|
|
|
+ return status;
|
|
|
}
|
|
|
|
|
|
if (Adapter->ulPowerSaveMode == DEVICE_POWERSAVE_MODE_AS_MANUAL_CLOCK_GATING) {
|
|
|
value = 0x80000000;
|
|
|
status = wrmalt(Adapter, DEBUG_INTERRUPT_GENERATOR_REGISTOR, &value, sizeof(value));
|
|
|
if (status)
|
|
|
- {
|
|
|
- BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, IDLE_MODE, DBG_LVL_ALL, "WRM to DEBUG_INTERRUPT_GENERATOR_REGISTOR Register failed");
|
|
|
return status;
|
|
|
- }
|
|
|
} else if (Adapter->ulPowerSaveMode != DEVICE_POWERSAVE_MODE_AS_PROTOCOL_IDLE_MODE) {
|
|
|
/*
|
|
|
* Get a Interrupt Out URB and send 8 Bytes Down
|
|
@@ -186,12 +158,10 @@ static int InterfaceAbortIdlemode(struct bcm_mini_adapter *Adapter, unsigned int
|
|
|
8,
|
|
|
&lenwritten,
|
|
|
5000);
|
|
|
- if (status) {
|
|
|
- BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, IDLE_MODE, DBG_LVL_ALL, "Sending Abort pattern down fails with status:%d..\n", status);
|
|
|
+ if (status)
|
|
|
return status;
|
|
|
- } else {
|
|
|
+ else
|
|
|
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, IDLE_MODE, DBG_LVL_ALL, "NOB Sent down :%d", lenwritten);
|
|
|
- }
|
|
|
|
|
|
/* mdelay(25); */
|
|
|
|
|
@@ -210,10 +180,8 @@ static int InterfaceAbortIdlemode(struct bcm_mini_adapter *Adapter, unsigned int
|
|
|
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));
|
|
|
- if (status) {
|
|
|
- BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "WRM to Register SW_ABORT_IDLEMODE_LOC failed..");
|
|
|
+ if (status)
|
|
|
return status;
|
|
|
- }
|
|
|
}
|
|
|
return status;
|
|
|
}
|
|
@@ -223,7 +191,6 @@ int InterfaceIdleModeWakeup(struct bcm_mini_adapter *Adapter)
|
|
|
if (Adapter->bTriedToWakeUpFromlowPowerMode) {
|
|
|
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, IDLE_MODE, DBG_LVL_ALL, "Wake up already attempted.. ignoring\n");
|
|
|
} else {
|
|
|
- BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, IDLE_MODE, DBG_LVL_ALL, "Writing Low Power Mode Abort pattern to the Device\n");
|
|
|
Adapter->bTriedToWakeUpFromlowPowerMode = TRUE;
|
|
|
InterfaceAbortIdlemode(Adapter, Adapter->usIdleModePattern);
|
|
|
|
|
@@ -241,10 +208,8 @@ void InterfaceHandleShutdownModeWakeup(struct bcm_mini_adapter *Adapter)
|
|
|
/* clear idlemode interrupt. */
|
|
|
uiRegVal = 0;
|
|
|
Status = wrmalt(Adapter, DEBUG_INTERRUPT_GENERATOR_REGISTOR, &uiRegVal, sizeof(uiRegVal));
|
|
|
- if (Status) {
|
|
|
- BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0,"WRM to DEBUG_INTERRUPT_GENERATOR_REGISTOR Failed with err :%d", Status);
|
|
|
+ if (Status)
|
|
|
return;
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
else {
|
|
@@ -253,14 +218,12 @@ void InterfaceHandleShutdownModeWakeup(struct bcm_mini_adapter *Adapter)
|
|
|
bytes = rdmalt(Adapter, DEVICE_INT_OUT_EP_REG0, &uiRegVal, sizeof(uiRegVal));
|
|
|
if (bytes < 0) {
|
|
|
Status = bytes;
|
|
|
- BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "RDM of DEVICE_INT_OUT_EP_REG0 failed with Err :%d", Status);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
bytes = rdmalt(Adapter, DEVICE_INT_OUT_EP_REG1, &uiRegVal, sizeof(uiRegVal));
|
|
|
if (bytes < 0) {
|
|
|
Status = bytes;
|
|
|
- BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "RDM of DEVICE_INT_OUT_EP_REG1 failed with Err :%d", Status);
|
|
|
return;
|
|
|
}
|
|
|
}
|