aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/benet/be_cmds.c
diff options
context:
space:
mode:
authorSathya Perla <sathyap@serverengines.com>2009-11-22 17:02:03 -0500
committerDavid S. Miller <davem@davemloft.net>2009-11-23 13:44:23 -0500
commit2243e2e95e24f4c4b1c6575b874ebe0b837d2208 (patch)
tree0a9c10b30834cad4bc231d59352b8c5f9fc9f546 /drivers/net/benet/be_cmds.c
parent01ed30da5d2e718df458f1680fd97751a769c1a2 (diff)
be2net: Issue fw_init/clean cmds to fw
These cmds are issued to the fw in probe/resume and remove/suspend paths to help fw execute some initialization and cleanup code. This change needed the be_hw_up() code to be refactored as be_get_config(). Signed-off-by: Sathya Perla <sathyap@serverengines.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/benet/be_cmds.c')
-rw-r--r--drivers/net/benet/be_cmds.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/drivers/net/benet/be_cmds.c b/drivers/net/benet/be_cmds.c
index 31980f863d12..2af87f100307 100644
--- a/drivers/net/benet/be_cmds.c
+++ b/drivers/net/benet/be_cmds.c
@@ -357,6 +357,57 @@ static struct be_mcc_wrb *wrb_from_mccq(struct be_adapter *adapter)
357 return wrb; 357 return wrb;
358} 358}
359 359
360/* Tell fw we're about to start firing cmds by writing a
361 * special pattern across the wrb hdr; uses mbox
362 */
363int be_cmd_fw_init(struct be_adapter *adapter)
364{
365 u8 *wrb;
366 int status;
367
368 spin_lock(&adapter->mbox_lock);
369
370 wrb = (u8 *)wrb_from_mbox(adapter);
371 *wrb++ = 0xFF;
372 *wrb++ = 0x12;
373 *wrb++ = 0x34;
374 *wrb++ = 0xFF;
375 *wrb++ = 0xFF;
376 *wrb++ = 0x56;
377 *wrb++ = 0x78;
378 *wrb = 0xFF;
379
380 status = be_mbox_notify_wait(adapter);
381
382 spin_unlock(&adapter->mbox_lock);
383 return status;
384}
385
386/* Tell fw we're done with firing cmds by writing a
387 * special pattern across the wrb hdr; uses mbox
388 */
389int be_cmd_fw_clean(struct be_adapter *adapter)
390{
391 u8 *wrb;
392 int status;
393
394 spin_lock(&adapter->mbox_lock);
395
396 wrb = (u8 *)wrb_from_mbox(adapter);
397 *wrb++ = 0xFF;
398 *wrb++ = 0xAA;
399 *wrb++ = 0xBB;
400 *wrb++ = 0xFF;
401 *wrb++ = 0xFF;
402 *wrb++ = 0xCC;
403 *wrb++ = 0xDD;
404 *wrb = 0xFF;
405
406 status = be_mbox_notify_wait(adapter);
407
408 spin_unlock(&adapter->mbox_lock);
409 return status;
410}
360int be_cmd_eq_create(struct be_adapter *adapter, 411int be_cmd_eq_create(struct be_adapter *adapter,
361 struct be_queue_info *eq, int eq_delay) 412 struct be_queue_info *eq, int eq_delay)
362{ 413{