Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 159324
b: refs/heads/master
c: 14074ea
h: refs/heads/master
v: v3
  • Loading branch information
sarveshwarb authored and David S. Miller committed Aug 5, 2009
1 parent f6bb7c2 commit 41c0e81
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0d6038ee76f2e06b79d0465807f67e86bf4025de
refs/heads/master: 14074eab8dcaa7f66d8f52612b2dcec51222bb5f
21 changes: 21 additions & 0 deletions trunk/drivers/net/benet/be_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -1019,3 +1019,24 @@ int be_cmd_query_fw_cfg(struct be_adapter *adapter, u32 *port_num)
spin_unlock(&adapter->mbox_lock);
return status;
}

int be_cmd_reset_function(struct be_adapter *adapter)
{
struct be_mcc_wrb *wrb = wrb_from_mbox(&adapter->mbox_mem);
struct be_cmd_req_hdr *req = embedded_payload(wrb);
int status;

spin_lock(&adapter->mbox_lock);

memset(wrb, 0, sizeof(*wrb));

be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0);

be_cmd_hdr_prepare(req, CMD_SUBSYSTEM_COMMON,
OPCODE_COMMON_FUNCTION_RESET, sizeof(*req));

status = be_mbox_notify(adapter);

spin_unlock(&adapter->mbox_lock);
return status;
}
2 changes: 2 additions & 0 deletions trunk/drivers/net/benet/be_cmds.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ struct be_mcc_mailbox {
#define OPCODE_COMMON_QUERY_FIRMWARE_CONFIG 58
#define OPCODE_COMMON_NTWK_PMAC_ADD 59
#define OPCODE_COMMON_NTWK_PMAC_DEL 60
#define OPCODE_COMMON_FUNCTION_RESET 61

#define OPCODE_ETH_ACPI_CONFIG 2
#define OPCODE_ETH_PROMISCUOUS 3
Expand Down Expand Up @@ -744,4 +745,5 @@ extern int be_cmd_set_flow_control(struct be_adapter *adapter,
extern int be_cmd_get_flow_control(struct be_adapter *adapter,
u32 *tx_fc, u32 *rx_fc);
extern int be_cmd_query_fw_cfg(struct be_adapter *adapter, u32 *port_num);
extern int be_cmd_reset_function(struct be_adapter *adapter);
extern void be_process_mcc(struct be_adapter *adapter);
4 changes: 4 additions & 0 deletions trunk/drivers/net/benet/be_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1873,6 +1873,10 @@ static int __devinit be_probe(struct pci_dev *pdev,
if (status)
goto free_netdev;

status = be_cmd_reset_function(adapter);
if (status)
goto ctrl_clean;

status = be_stats_init(adapter);
if (status)
goto ctrl_clean;
Expand Down

0 comments on commit 41c0e81

Please sign in to comment.