diff options
Diffstat (limited to 'drivers/net/ethernet/emulex/benet/be_cmds.c')
-rw-r--r-- | drivers/net/ethernet/emulex/benet/be_cmds.c | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.c b/drivers/net/ethernet/emulex/benet/be_cmds.c index e0e8bc1ef14c..94c35c8d799d 100644 --- a/drivers/net/ethernet/emulex/benet/be_cmds.c +++ b/drivers/net/ethernet/emulex/benet/be_cmds.c | |||
@@ -141,11 +141,17 @@ static int be_mcc_compl_process(struct be_adapter *adapter, | |||
141 | subsystem = resp_hdr->subsystem; | 141 | subsystem = resp_hdr->subsystem; |
142 | } | 142 | } |
143 | 143 | ||
144 | if (opcode == OPCODE_LOWLEVEL_LOOPBACK_TEST && | ||
145 | subsystem == CMD_SUBSYSTEM_LOWLEVEL) { | ||
146 | complete(&adapter->et_cmd_compl); | ||
147 | return 0; | ||
148 | } | ||
149 | |||
144 | if (((opcode == OPCODE_COMMON_WRITE_FLASHROM) || | 150 | if (((opcode == OPCODE_COMMON_WRITE_FLASHROM) || |
145 | (opcode == OPCODE_COMMON_WRITE_OBJECT)) && | 151 | (opcode == OPCODE_COMMON_WRITE_OBJECT)) && |
146 | (subsystem == CMD_SUBSYSTEM_COMMON)) { | 152 | (subsystem == CMD_SUBSYSTEM_COMMON)) { |
147 | adapter->flash_status = compl_status; | 153 | adapter->flash_status = compl_status; |
148 | complete(&adapter->flash_compl); | 154 | complete(&adapter->et_cmd_compl); |
149 | } | 155 | } |
150 | 156 | ||
151 | if (compl_status == MCC_STATUS_SUCCESS) { | 157 | if (compl_status == MCC_STATUS_SUCCESS) { |
@@ -2017,6 +2023,9 @@ int be_cmd_rss_config(struct be_adapter *adapter, u8 *rsstable, | |||
2017 | 0x3ea83c02, 0x4a110304}; | 2023 | 0x3ea83c02, 0x4a110304}; |
2018 | int status; | 2024 | int status; |
2019 | 2025 | ||
2026 | if (!(be_if_cap_flags(adapter) & BE_IF_FLAGS_RSS)) | ||
2027 | return 0; | ||
2028 | |||
2020 | if (mutex_lock_interruptible(&adapter->mbox_lock)) | 2029 | if (mutex_lock_interruptible(&adapter->mbox_lock)) |
2021 | return -1; | 2030 | return -1; |
2022 | 2031 | ||
@@ -2160,7 +2169,7 @@ int lancer_cmd_write_object(struct be_adapter *adapter, struct be_dma_mem *cmd, | |||
2160 | be_mcc_notify(adapter); | 2169 | be_mcc_notify(adapter); |
2161 | spin_unlock_bh(&adapter->mcc_lock); | 2170 | spin_unlock_bh(&adapter->mcc_lock); |
2162 | 2171 | ||
2163 | if (!wait_for_completion_timeout(&adapter->flash_compl, | 2172 | if (!wait_for_completion_timeout(&adapter->et_cmd_compl, |
2164 | msecs_to_jiffies(60000))) | 2173 | msecs_to_jiffies(60000))) |
2165 | status = -1; | 2174 | status = -1; |
2166 | else | 2175 | else |
@@ -2255,8 +2264,8 @@ int be_cmd_write_flashrom(struct be_adapter *adapter, struct be_dma_mem *cmd, | |||
2255 | be_mcc_notify(adapter); | 2264 | be_mcc_notify(adapter); |
2256 | spin_unlock_bh(&adapter->mcc_lock); | 2265 | spin_unlock_bh(&adapter->mcc_lock); |
2257 | 2266 | ||
2258 | if (!wait_for_completion_timeout(&adapter->flash_compl, | 2267 | if (!wait_for_completion_timeout(&adapter->et_cmd_compl, |
2259 | msecs_to_jiffies(40000))) | 2268 | msecs_to_jiffies(40000))) |
2260 | status = -1; | 2269 | status = -1; |
2261 | else | 2270 | else |
2262 | status = adapter->flash_status; | 2271 | status = adapter->flash_status; |
@@ -2367,6 +2376,7 @@ int be_cmd_loopback_test(struct be_adapter *adapter, u32 port_num, | |||
2367 | { | 2376 | { |
2368 | struct be_mcc_wrb *wrb; | 2377 | struct be_mcc_wrb *wrb; |
2369 | struct be_cmd_req_loopback_test *req; | 2378 | struct be_cmd_req_loopback_test *req; |
2379 | struct be_cmd_resp_loopback_test *resp; | ||
2370 | int status; | 2380 | int status; |
2371 | 2381 | ||
2372 | spin_lock_bh(&adapter->mcc_lock); | 2382 | spin_lock_bh(&adapter->mcc_lock); |
@@ -2381,8 +2391,8 @@ int be_cmd_loopback_test(struct be_adapter *adapter, u32 port_num, | |||
2381 | 2391 | ||
2382 | be_wrb_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_LOWLEVEL, | 2392 | be_wrb_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_LOWLEVEL, |
2383 | OPCODE_LOWLEVEL_LOOPBACK_TEST, sizeof(*req), wrb, NULL); | 2393 | OPCODE_LOWLEVEL_LOOPBACK_TEST, sizeof(*req), wrb, NULL); |
2384 | req->hdr.timeout = cpu_to_le32(4); | ||
2385 | 2394 | ||
2395 | req->hdr.timeout = cpu_to_le32(15); | ||
2386 | req->pattern = cpu_to_le64(pattern); | 2396 | req->pattern = cpu_to_le64(pattern); |
2387 | req->src_port = cpu_to_le32(port_num); | 2397 | req->src_port = cpu_to_le32(port_num); |
2388 | req->dest_port = cpu_to_le32(port_num); | 2398 | req->dest_port = cpu_to_le32(port_num); |
@@ -2390,12 +2400,15 @@ int be_cmd_loopback_test(struct be_adapter *adapter, u32 port_num, | |||
2390 | req->num_pkts = cpu_to_le32(num_pkts); | 2400 | req->num_pkts = cpu_to_le32(num_pkts); |
2391 | req->loopback_type = cpu_to_le32(loopback_type); | 2401 | req->loopback_type = cpu_to_le32(loopback_type); |
2392 | 2402 | ||
2393 | status = be_mcc_notify_wait(adapter); | 2403 | be_mcc_notify(adapter); |
2394 | if (!status) { | 2404 | |
2395 | struct be_cmd_resp_loopback_test *resp = embedded_payload(wrb); | 2405 | spin_unlock_bh(&adapter->mcc_lock); |
2396 | status = le32_to_cpu(resp->status); | ||
2397 | } | ||
2398 | 2406 | ||
2407 | wait_for_completion(&adapter->et_cmd_compl); | ||
2408 | resp = embedded_payload(wrb); | ||
2409 | status = le32_to_cpu(resp->status); | ||
2410 | |||
2411 | return status; | ||
2399 | err: | 2412 | err: |
2400 | spin_unlock_bh(&adapter->mcc_lock); | 2413 | spin_unlock_bh(&adapter->mcc_lock); |
2401 | return status; | 2414 | return status; |