aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/benet
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-10-27 04:03:26 -0400
committerDavid S. Miller <davem@davemloft.net>2009-10-27 04:03:26 -0400
commitcfadf853f6cd9689f79a63ca960c6f9d6665314f (patch)
tree35418e342d9783f0974ea33ef03875aa21d2362a /drivers/net/benet
parent05423b241311c9380b7280179295bac7794281b6 (diff)
parentf568a926a353d6816b3704d7367f34371df44ce7 (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts: drivers/net/sh_eth.c
Diffstat (limited to 'drivers/net/benet')
-rw-r--r--drivers/net/benet/be_cmds.c33
-rw-r--r--drivers/net/benet/be_cmds.h5
-rw-r--r--drivers/net/benet/be_main.c27
3 files changed, 40 insertions, 25 deletions
diff --git a/drivers/net/benet/be_cmds.c b/drivers/net/benet/be_cmds.c
index 25b6602e464c..827d86b5e70b 100644
--- a/drivers/net/benet/be_cmds.c
+++ b/drivers/net/benet/be_cmds.c
@@ -243,15 +243,26 @@ static int be_POST_stage_get(struct be_adapter *adapter, u16 *stage)
243 243
244int be_cmd_POST(struct be_adapter *adapter) 244int be_cmd_POST(struct be_adapter *adapter)
245{ 245{
246 u16 stage, error; 246 u16 stage;
247 int status, timeout = 0;
247 248
248 error = be_POST_stage_get(adapter, &stage); 249 do {
249 if (error || stage != POST_STAGE_ARMFW_RDY) { 250 status = be_POST_stage_get(adapter, &stage);
250 dev_err(&adapter->pdev->dev, "POST failed.\n"); 251 if (status) {
251 return -1; 252 dev_err(&adapter->pdev->dev, "POST error; stage=0x%x\n",
252 } 253 stage);
254 return -1;
255 } else if (stage != POST_STAGE_ARMFW_RDY) {
256 set_current_state(TASK_INTERRUPTIBLE);
257 schedule_timeout(2 * HZ);
258 timeout += 2;
259 } else {
260 return 0;
261 }
262 } while (timeout < 20);
253 263
254 return 0; 264 dev_err(&adapter->pdev->dev, "POST timeout; stage=0x%x\n", stage);
265 return -1;
255} 266}
256 267
257static inline void *embedded_payload(struct be_mcc_wrb *wrb) 268static inline void *embedded_payload(struct be_mcc_wrb *wrb)
@@ -729,8 +740,8 @@ int be_cmd_q_destroy(struct be_adapter *adapter, struct be_queue_info *q,
729/* Create an rx filtering policy configuration on an i/f 740/* Create an rx filtering policy configuration on an i/f
730 * Uses mbox 741 * Uses mbox
731 */ 742 */
732int be_cmd_if_create(struct be_adapter *adapter, u32 flags, u8 *mac, 743int be_cmd_if_create(struct be_adapter *adapter, u32 cap_flags, u32 en_flags,
733 bool pmac_invalid, u32 *if_handle, u32 *pmac_id) 744 u8 *mac, bool pmac_invalid, u32 *if_handle, u32 *pmac_id)
734{ 745{
735 struct be_mcc_wrb *wrb; 746 struct be_mcc_wrb *wrb;
736 struct be_cmd_req_if_create *req; 747 struct be_cmd_req_if_create *req;
@@ -746,8 +757,8 @@ int be_cmd_if_create(struct be_adapter *adapter, u32 flags, u8 *mac,
746 be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON, 757 be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON,
747 OPCODE_COMMON_NTWK_INTERFACE_CREATE, sizeof(*req)); 758 OPCODE_COMMON_NTWK_INTERFACE_CREATE, sizeof(*req));
748 759
749 req->capability_flags = cpu_to_le32(flags); 760 req->capability_flags = cpu_to_le32(cap_flags);
750 req->enable_flags = cpu_to_le32(flags); 761 req->enable_flags = cpu_to_le32(en_flags);
751 req->pmac_invalid = pmac_invalid; 762 req->pmac_invalid = pmac_invalid;
752 if (!pmac_invalid) 763 if (!pmac_invalid)
753 memcpy(req->mac_addr, mac, ETH_ALEN); 764 memcpy(req->mac_addr, mac, ETH_ALEN);
diff --git a/drivers/net/benet/be_cmds.h b/drivers/net/benet/be_cmds.h
index a1e78cc3e171..fe9f535eff12 100644
--- a/drivers/net/benet/be_cmds.h
+++ b/drivers/net/benet/be_cmds.h
@@ -753,8 +753,9 @@ extern int be_cmd_mac_addr_query(struct be_adapter *adapter, u8 *mac_addr,
753extern int be_cmd_pmac_add(struct be_adapter *adapter, u8 *mac_addr, 753extern int be_cmd_pmac_add(struct be_adapter *adapter, u8 *mac_addr,
754 u32 if_id, u32 *pmac_id); 754 u32 if_id, u32 *pmac_id);
755extern int be_cmd_pmac_del(struct be_adapter *adapter, u32 if_id, u32 pmac_id); 755extern int be_cmd_pmac_del(struct be_adapter *adapter, u32 if_id, u32 pmac_id);
756extern int be_cmd_if_create(struct be_adapter *adapter, u32 if_flags, u8 *mac, 756extern int be_cmd_if_create(struct be_adapter *adapter, u32 cap_flags,
757 bool pmac_invalid, u32 *if_handle, u32 *pmac_id); 757 u32 en_flags, u8 *mac, bool pmac_invalid,
758 u32 *if_handle, u32 *pmac_id);
758extern int be_cmd_if_destroy(struct be_adapter *adapter, u32 if_handle); 759extern int be_cmd_if_destroy(struct be_adapter *adapter, u32 if_handle);
759extern int be_cmd_eq_create(struct be_adapter *adapter, 760extern int be_cmd_eq_create(struct be_adapter *adapter,
760 struct be_queue_info *eq, int eq_delay); 761 struct be_queue_info *eq, int eq_delay);
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
index e0f9d6477184..21b0657de9e8 100644
--- a/drivers/net/benet/be_main.c
+++ b/drivers/net/benet/be_main.c
@@ -1616,19 +1616,22 @@ static int be_open(struct net_device *netdev)
1616static int be_setup(struct be_adapter *adapter) 1616static int be_setup(struct be_adapter *adapter)
1617{ 1617{
1618 struct net_device *netdev = adapter->netdev; 1618 struct net_device *netdev = adapter->netdev;
1619 u32 if_flags; 1619 u32 cap_flags, en_flags;
1620 int status; 1620 int status;
1621 1621
1622 if_flags = BE_IF_FLAGS_BROADCAST | BE_IF_FLAGS_PROMISCUOUS | 1622 cap_flags = BE_IF_FLAGS_UNTAGGED | BE_IF_FLAGS_BROADCAST |
1623 BE_IF_FLAGS_MCAST_PROMISCUOUS | BE_IF_FLAGS_UNTAGGED | 1623 BE_IF_FLAGS_MCAST_PROMISCUOUS |
1624 BE_IF_FLAGS_PASS_L3L4_ERRORS; 1624 BE_IF_FLAGS_PROMISCUOUS |
1625 status = be_cmd_if_create(adapter, if_flags, netdev->dev_addr, 1625 BE_IF_FLAGS_PASS_L3L4_ERRORS;
1626 false/* pmac_invalid */, &adapter->if_handle, 1626 en_flags = BE_IF_FLAGS_UNTAGGED | BE_IF_FLAGS_BROADCAST |
1627 &adapter->pmac_id); 1627 BE_IF_FLAGS_PASS_L3L4_ERRORS;
1628
1629 status = be_cmd_if_create(adapter, cap_flags, en_flags,
1630 netdev->dev_addr, false/* pmac_invalid */,
1631 &adapter->if_handle, &adapter->pmac_id);
1628 if (status != 0) 1632 if (status != 0)
1629 goto do_none; 1633 goto do_none;
1630 1634
1631
1632 status = be_tx_queues_create(adapter); 1635 status = be_tx_queues_create(adapter);
1633 if (status != 0) 1636 if (status != 0)
1634 goto if_destroy; 1637 goto if_destroy;
@@ -2051,6 +2054,10 @@ static int be_hw_up(struct be_adapter *adapter)
2051 if (status) 2054 if (status)
2052 return status; 2055 return status;
2053 2056
2057 status = be_cmd_reset_function(adapter);
2058 if (status)
2059 return status;
2060
2054 status = be_cmd_get_fw_ver(adapter, adapter->fw_ver); 2061 status = be_cmd_get_fw_ver(adapter, adapter->fw_ver);
2055 if (status) 2062 if (status)
2056 return status; 2063 return status;
@@ -2104,10 +2111,6 @@ static int __devinit be_probe(struct pci_dev *pdev,
2104 if (status) 2111 if (status)
2105 goto free_netdev; 2112 goto free_netdev;
2106 2113
2107 status = be_cmd_reset_function(adapter);
2108 if (status)
2109 goto ctrl_clean;
2110
2111 status = be_stats_init(adapter); 2114 status = be_stats_init(adapter);
2112 if (status) 2115 if (status)
2113 goto ctrl_clean; 2116 goto ctrl_clean;