|
@@ -466,7 +466,6 @@ static int rndis_filter_query_device(struct rndis_device *dev, u32 oid,
|
|
struct rndis_query_request *query;
|
|
struct rndis_query_request *query;
|
|
struct rndis_query_complete *query_complete;
|
|
struct rndis_query_complete *query_complete;
|
|
int ret = 0;
|
|
int ret = 0;
|
|
- unsigned long t;
|
|
|
|
|
|
|
|
if (!result)
|
|
if (!result)
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
@@ -503,11 +502,7 @@ static int rndis_filter_query_device(struct rndis_device *dev, u32 oid,
|
|
if (ret != 0)
|
|
if (ret != 0)
|
|
goto cleanup;
|
|
goto cleanup;
|
|
|
|
|
|
- t = wait_for_completion_timeout(&request->wait_event, 5*HZ);
|
|
|
|
- if (t == 0) {
|
|
|
|
- ret = -ETIMEDOUT;
|
|
|
|
- goto cleanup;
|
|
|
|
- }
|
|
|
|
|
|
+ wait_for_completion(&request->wait_event);
|
|
|
|
|
|
/* Copy the response back */
|
|
/* Copy the response back */
|
|
query_complete = &request->response_msg.msg.query_complete;
|
|
query_complete = &request->response_msg.msg.query_complete;
|
|
@@ -556,7 +551,6 @@ int rndis_filter_set_device_mac(struct net_device *ndev, char *mac)
|
|
u32 extlen = sizeof(struct rndis_config_parameter_info) +
|
|
u32 extlen = sizeof(struct rndis_config_parameter_info) +
|
|
2*NWADR_STRLEN + 4*ETH_ALEN;
|
|
2*NWADR_STRLEN + 4*ETH_ALEN;
|
|
int ret;
|
|
int ret;
|
|
- unsigned long t;
|
|
|
|
|
|
|
|
request = get_rndis_request(rdev, RNDIS_MSG_SET,
|
|
request = get_rndis_request(rdev, RNDIS_MSG_SET,
|
|
RNDIS_MESSAGE_SIZE(struct rndis_set_request) + extlen);
|
|
RNDIS_MESSAGE_SIZE(struct rndis_set_request) + extlen);
|
|
@@ -597,21 +591,13 @@ int rndis_filter_set_device_mac(struct net_device *ndev, char *mac)
|
|
if (ret != 0)
|
|
if (ret != 0)
|
|
goto cleanup;
|
|
goto cleanup;
|
|
|
|
|
|
- t = wait_for_completion_timeout(&request->wait_event, 5*HZ);
|
|
|
|
- if (t == 0) {
|
|
|
|
- netdev_err(ndev, "timeout before we got a set response...\n");
|
|
|
|
- /*
|
|
|
|
- * can't put_rndis_request, since we may still receive a
|
|
|
|
- * send-completion.
|
|
|
|
- */
|
|
|
|
- return -EBUSY;
|
|
|
|
- } else {
|
|
|
|
- set_complete = &request->response_msg.msg.set_complete;
|
|
|
|
- if (set_complete->status != RNDIS_STATUS_SUCCESS) {
|
|
|
|
- netdev_err(ndev, "Fail to set MAC on host side:0x%x\n",
|
|
|
|
- set_complete->status);
|
|
|
|
- ret = -EINVAL;
|
|
|
|
- }
|
|
|
|
|
|
+ wait_for_completion(&request->wait_event);
|
|
|
|
+
|
|
|
|
+ set_complete = &request->response_msg.msg.set_complete;
|
|
|
|
+ if (set_complete->status != RNDIS_STATUS_SUCCESS) {
|
|
|
|
+ netdev_err(ndev, "Fail to set MAC on host side:0x%x\n",
|
|
|
|
+ set_complete->status);
|
|
|
|
+ ret = -EINVAL;
|
|
}
|
|
}
|
|
|
|
|
|
cleanup:
|
|
cleanup:
|
|
@@ -631,7 +617,6 @@ rndis_filter_set_offload_params(struct net_device *ndev,
|
|
struct rndis_set_complete *set_complete;
|
|
struct rndis_set_complete *set_complete;
|
|
u32 extlen = sizeof(struct ndis_offload_params);
|
|
u32 extlen = sizeof(struct ndis_offload_params);
|
|
int ret;
|
|
int ret;
|
|
- unsigned long t;
|
|
|
|
u32 vsp_version = nvdev->nvsp_version;
|
|
u32 vsp_version = nvdev->nvsp_version;
|
|
|
|
|
|
if (vsp_version <= NVSP_PROTOCOL_VERSION_4) {
|
|
if (vsp_version <= NVSP_PROTOCOL_VERSION_4) {
|
|
@@ -665,20 +650,12 @@ rndis_filter_set_offload_params(struct net_device *ndev,
|
|
if (ret != 0)
|
|
if (ret != 0)
|
|
goto cleanup;
|
|
goto cleanup;
|
|
|
|
|
|
- t = wait_for_completion_timeout(&request->wait_event, 5*HZ);
|
|
|
|
- if (t == 0) {
|
|
|
|
- netdev_err(ndev, "timeout before we got aOFFLOAD set response...\n");
|
|
|
|
- /* can't put_rndis_request, since we may still receive a
|
|
|
|
- * send-completion.
|
|
|
|
- */
|
|
|
|
- return -EBUSY;
|
|
|
|
- } else {
|
|
|
|
- set_complete = &request->response_msg.msg.set_complete;
|
|
|
|
- if (set_complete->status != RNDIS_STATUS_SUCCESS) {
|
|
|
|
- netdev_err(ndev, "Fail to set offload on host side:0x%x\n",
|
|
|
|
- set_complete->status);
|
|
|
|
- ret = -EINVAL;
|
|
|
|
- }
|
|
|
|
|
|
+ wait_for_completion(&request->wait_event);
|
|
|
|
+ set_complete = &request->response_msg.msg.set_complete;
|
|
|
|
+ if (set_complete->status != RNDIS_STATUS_SUCCESS) {
|
|
|
|
+ netdev_err(ndev, "Fail to set offload on host side:0x%x\n",
|
|
|
|
+ set_complete->status);
|
|
|
|
+ ret = -EINVAL;
|
|
}
|
|
}
|
|
|
|
|
|
cleanup:
|
|
cleanup:
|
|
@@ -706,7 +683,6 @@ static int rndis_filter_set_rss_param(struct rndis_device *rdev, int num_queue)
|
|
u32 *itab;
|
|
u32 *itab;
|
|
u8 *keyp;
|
|
u8 *keyp;
|
|
int i, ret;
|
|
int i, ret;
|
|
- unsigned long t;
|
|
|
|
|
|
|
|
request = get_rndis_request(
|
|
request = get_rndis_request(
|
|
rdev, RNDIS_MSG_SET,
|
|
rdev, RNDIS_MSG_SET,
|
|
@@ -749,20 +725,12 @@ static int rndis_filter_set_rss_param(struct rndis_device *rdev, int num_queue)
|
|
if (ret != 0)
|
|
if (ret != 0)
|
|
goto cleanup;
|
|
goto cleanup;
|
|
|
|
|
|
- t = wait_for_completion_timeout(&request->wait_event, 5*HZ);
|
|
|
|
- if (t == 0) {
|
|
|
|
- netdev_err(ndev, "timeout before we got a set response...\n");
|
|
|
|
- /* can't put_rndis_request, since we may still receive a
|
|
|
|
- * send-completion.
|
|
|
|
- */
|
|
|
|
- return -ETIMEDOUT;
|
|
|
|
- } else {
|
|
|
|
- set_complete = &request->response_msg.msg.set_complete;
|
|
|
|
- if (set_complete->status != RNDIS_STATUS_SUCCESS) {
|
|
|
|
- netdev_err(ndev, "Fail to set RSS parameters:0x%x\n",
|
|
|
|
- set_complete->status);
|
|
|
|
- ret = -EINVAL;
|
|
|
|
- }
|
|
|
|
|
|
+ wait_for_completion(&request->wait_event);
|
|
|
|
+ set_complete = &request->response_msg.msg.set_complete;
|
|
|
|
+ if (set_complete->status != RNDIS_STATUS_SUCCESS) {
|
|
|
|
+ netdev_err(ndev, "Fail to set RSS parameters:0x%x\n",
|
|
|
|
+ set_complete->status);
|
|
|
|
+ ret = -EINVAL;
|
|
}
|
|
}
|
|
|
|
|
|
cleanup:
|
|
cleanup:
|
|
@@ -791,8 +759,6 @@ int rndis_filter_set_packet_filter(struct rndis_device *dev, u32 new_filter)
|
|
struct rndis_set_complete *set_complete;
|
|
struct rndis_set_complete *set_complete;
|
|
u32 status;
|
|
u32 status;
|
|
int ret;
|
|
int ret;
|
|
- unsigned long t;
|
|
|
|
- struct net_device *ndev = dev->ndev;
|
|
|
|
|
|
|
|
request = get_rndis_request(dev, RNDIS_MSG_SET,
|
|
request = get_rndis_request(dev, RNDIS_MSG_SET,
|
|
RNDIS_MESSAGE_SIZE(struct rndis_set_request) +
|
|
RNDIS_MESSAGE_SIZE(struct rndis_set_request) +
|
|
@@ -815,26 +781,14 @@ int rndis_filter_set_packet_filter(struct rndis_device *dev, u32 new_filter)
|
|
if (ret != 0)
|
|
if (ret != 0)
|
|
goto cleanup;
|
|
goto cleanup;
|
|
|
|
|
|
- t = wait_for_completion_timeout(&request->wait_event, 5*HZ);
|
|
|
|
|
|
+ wait_for_completion(&request->wait_event);
|
|
|
|
|
|
- if (t == 0) {
|
|
|
|
- netdev_err(ndev,
|
|
|
|
- "timeout before we got a set response...\n");
|
|
|
|
- ret = -ETIMEDOUT;
|
|
|
|
- /*
|
|
|
|
- * We can't deallocate the request since we may still receive a
|
|
|
|
- * send completion for it.
|
|
|
|
- */
|
|
|
|
- goto exit;
|
|
|
|
- } else {
|
|
|
|
- set_complete = &request->response_msg.msg.set_complete;
|
|
|
|
- status = set_complete->status;
|
|
|
|
- }
|
|
|
|
|
|
+ set_complete = &request->response_msg.msg.set_complete;
|
|
|
|
+ status = set_complete->status;
|
|
|
|
|
|
cleanup:
|
|
cleanup:
|
|
if (request)
|
|
if (request)
|
|
put_rndis_request(dev, request);
|
|
put_rndis_request(dev, request);
|
|
-exit:
|
|
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -846,7 +800,6 @@ static int rndis_filter_init_device(struct rndis_device *dev)
|
|
struct rndis_initialize_complete *init_complete;
|
|
struct rndis_initialize_complete *init_complete;
|
|
u32 status;
|
|
u32 status;
|
|
int ret;
|
|
int ret;
|
|
- unsigned long t;
|
|
|
|
struct netvsc_device *nvdev = net_device_to_netvsc_device(dev->ndev);
|
|
struct netvsc_device *nvdev = net_device_to_netvsc_device(dev->ndev);
|
|
|
|
|
|
request = get_rndis_request(dev, RNDIS_MSG_INIT,
|
|
request = get_rndis_request(dev, RNDIS_MSG_INIT,
|
|
@@ -870,12 +823,7 @@ static int rndis_filter_init_device(struct rndis_device *dev)
|
|
goto cleanup;
|
|
goto cleanup;
|
|
}
|
|
}
|
|
|
|
|
|
- t = wait_for_completion_timeout(&request->wait_event, 5*HZ);
|
|
|
|
-
|
|
|
|
- if (t == 0) {
|
|
|
|
- ret = -ETIMEDOUT;
|
|
|
|
- goto cleanup;
|
|
|
|
- }
|
|
|
|
|
|
+ wait_for_completion(&request->wait_event);
|
|
|
|
|
|
init_complete = &request->response_msg.msg.init_complete;
|
|
init_complete = &request->response_msg.msg.init_complete;
|
|
status = init_complete->status;
|
|
status = init_complete->status;
|
|
@@ -1008,7 +956,6 @@ int rndis_filter_device_add(struct hv_device *dev,
|
|
struct netvsc_device_info *device_info = additional_info;
|
|
struct netvsc_device_info *device_info = additional_info;
|
|
struct ndis_offload_params offloads;
|
|
struct ndis_offload_params offloads;
|
|
struct nvsp_message *init_packet;
|
|
struct nvsp_message *init_packet;
|
|
- unsigned long t;
|
|
|
|
struct ndis_recv_scale_cap rsscap;
|
|
struct ndis_recv_scale_cap rsscap;
|
|
u32 rsscap_size = sizeof(struct ndis_recv_scale_cap);
|
|
u32 rsscap_size = sizeof(struct ndis_recv_scale_cap);
|
|
u32 mtu, size;
|
|
u32 mtu, size;
|
|
@@ -1151,11 +1098,8 @@ int rndis_filter_device_add(struct hv_device *dev,
|
|
VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
|
|
VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
|
|
if (ret)
|
|
if (ret)
|
|
goto out;
|
|
goto out;
|
|
- t = wait_for_completion_timeout(&net_device->channel_init_wait, 5*HZ);
|
|
|
|
- if (t == 0) {
|
|
|
|
- ret = -ETIMEDOUT;
|
|
|
|
- goto out;
|
|
|
|
- }
|
|
|
|
|
|
+ wait_for_completion(&net_device->channel_init_wait);
|
|
|
|
+
|
|
if (init_packet->msg.v5_msg.subchn_comp.status !=
|
|
if (init_packet->msg.v5_msg.subchn_comp.status !=
|
|
NVSP_STAT_SUCCESS) {
|
|
NVSP_STAT_SUCCESS) {
|
|
ret = -ENODEV;
|
|
ret = -ENODEV;
|
|
@@ -1192,17 +1136,12 @@ void rndis_filter_device_remove(struct hv_device *dev)
|
|
{
|
|
{
|
|
struct netvsc_device *net_dev = hv_device_to_netvsc_device(dev);
|
|
struct netvsc_device *net_dev = hv_device_to_netvsc_device(dev);
|
|
struct rndis_device *rndis_dev = net_dev->extension;
|
|
struct rndis_device *rndis_dev = net_dev->extension;
|
|
- unsigned long t;
|
|
|
|
|
|
|
|
/* If not all subchannel offers are complete, wait for them until
|
|
/* If not all subchannel offers are complete, wait for them until
|
|
* completion to avoid race.
|
|
* completion to avoid race.
|
|
*/
|
|
*/
|
|
- while (net_dev->num_sc_offered > 0) {
|
|
|
|
- t = wait_for_completion_timeout(&net_dev->channel_init_wait,
|
|
|
|
- 10 * HZ);
|
|
|
|
- if (t == 0)
|
|
|
|
- WARN(1, "Netvsc: Waiting for sub-channel processing");
|
|
|
|
- }
|
|
|
|
|
|
+ if (net_dev->num_sc_offered > 0)
|
|
|
|
+ wait_for_completion(&net_dev->channel_init_wait);
|
|
|
|
|
|
/* Halt and release the rndis device */
|
|
/* Halt and release the rndis device */
|
|
rndis_filter_halt_device(rndis_dev);
|
|
rndis_filter_halt_device(rndis_dev);
|