aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/benet
diff options
context:
space:
mode:
authorSathya Perla <sathyap@serverengines.com>2009-07-27 18:53:30 -0400
committerDavid S. Miller <davem@davemloft.net>2009-08-02 02:06:37 -0400
commitd9509ac1295ce2ec121333d29b8a85a9e564f817 (patch)
tree8916f1496443d330ef9bbf1af3145162cf264dda /drivers/net/benet
parentefd2e40a8cc891e8f90e0bdde000006bd6201530 (diff)
be2net: delete unnecessary code from be_cmd_POST()
When the driver loads the POST stage of the card is expected to be POST_STAGE_ARMFW_RDY. Signed-off-by: Sathya Perla <sathyap@serverengines.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/benet')
-rw-r--r--drivers/net/benet/be_cmds.c45
1 files changed, 4 insertions, 41 deletions
diff --git a/drivers/net/benet/be_cmds.c b/drivers/net/benet/be_cmds.c
index ebf65c788192..de107732dcdc 100644
--- a/drivers/net/benet/be_cmds.c
+++ b/drivers/net/benet/be_cmds.c
@@ -227,54 +227,17 @@ static int be_POST_stage_get(struct be_adapter *adapter, u16 *stage)
227 return 0; 227 return 0;
228} 228}
229 229
230static int be_POST_stage_poll(struct be_adapter *adapter, u16 poll_stage)
231{
232 u16 stage, cnt, error;
233 for (cnt = 0; cnt < 5000; cnt++) {
234 error = be_POST_stage_get(adapter, &stage);
235 if (error)
236 return -1;
237
238 if (stage == poll_stage)
239 break;
240 udelay(1000);
241 }
242 if (stage != poll_stage)
243 return -1;
244 return 0;
245}
246
247
248int be_cmd_POST(struct be_adapter *adapter) 230int be_cmd_POST(struct be_adapter *adapter)
249{ 231{
250 u16 stage, error; 232 u16 stage, error;
251 233
252 error = be_POST_stage_get(adapter, &stage); 234 error = be_POST_stage_get(adapter, &stage);
253 if (error) 235 if (error || stage != POST_STAGE_ARMFW_RDY) {
254 goto err; 236 dev_err(&adapter->pdev->dev, "POST failed.\n");
255 237 return -1;
256 if (stage == POST_STAGE_ARMFW_RDY) 238 }
257 return 0;
258
259 if (stage != POST_STAGE_AWAITING_HOST_RDY)
260 goto err;
261
262 /* On awaiting host rdy, reset and again poll on awaiting host rdy */
263 iowrite32(POST_STAGE_BE_RESET, adapter->csr + MPU_EP_SEMAPHORE_OFFSET);
264 error = be_POST_stage_poll(adapter, POST_STAGE_AWAITING_HOST_RDY);
265 if (error)
266 goto err;
267
268 /* Now kickoff POST and poll on armfw ready */
269 iowrite32(POST_STAGE_HOST_RDY, adapter->csr + MPU_EP_SEMAPHORE_OFFSET);
270 error = be_POST_stage_poll(adapter, POST_STAGE_ARMFW_RDY);
271 if (error)
272 goto err;
273 239
274 return 0; 240 return 0;
275err:
276 printk(KERN_WARNING DRV_NAME ": ERROR, stage=%d\n", stage);
277 return -1;
278} 241}
279 242
280static inline void *embedded_payload(struct be_mcc_wrb *wrb) 243static inline void *embedded_payload(struct be_mcc_wrb *wrb)