|
|
@@ -344,7 +344,7 @@ static inline void *rndis_get_ppi(struct rndis_packet *rpkt, u32 type)
|
|
|
return NULL;
|
|
|
}
|
|
|
|
|
|
-static void rndis_filter_receive_data(struct rndis_device *dev,
|
|
|
+static int rndis_filter_receive_data(struct rndis_device *dev,
|
|
|
struct rndis_message *msg,
|
|
|
struct hv_netvsc_packet *pkt,
|
|
|
void **data,
|
|
|
@@ -371,7 +371,7 @@ static void rndis_filter_receive_data(struct rndis_device *dev,
|
|
|
"overflow detected (got %u, min %u)"
|
|
|
"...dropping this message!\n",
|
|
|
pkt->total_data_buflen, rndis_pkt->data_len);
|
|
|
- return;
|
|
|
+ return NVSP_STAT_FAIL;
|
|
|
}
|
|
|
|
|
|
/*
|
|
|
@@ -391,7 +391,8 @@ static void rndis_filter_receive_data(struct rndis_device *dev,
|
|
|
}
|
|
|
|
|
|
csum_info = rndis_get_ppi(rndis_pkt, TCPIP_CHKSUM_PKTINFO);
|
|
|
- netvsc_recv_callback(dev->net_dev->dev, pkt, data, csum_info, channel);
|
|
|
+ return netvsc_recv_callback(dev->net_dev->dev, pkt, data,
|
|
|
+ csum_info, channel);
|
|
|
}
|
|
|
|
|
|
int rndis_filter_receive(struct hv_device *dev,
|
|
|
@@ -406,7 +407,7 @@ int rndis_filter_receive(struct hv_device *dev,
|
|
|
int ret = 0;
|
|
|
|
|
|
if (!net_dev) {
|
|
|
- ret = -EINVAL;
|
|
|
+ ret = NVSP_STAT_FAIL;
|
|
|
goto exit;
|
|
|
}
|
|
|
|
|
|
@@ -416,7 +417,7 @@ int rndis_filter_receive(struct hv_device *dev,
|
|
|
if (!net_dev->extension) {
|
|
|
netdev_err(ndev, "got rndis message but no rndis device - "
|
|
|
"dropping this message!\n");
|
|
|
- ret = -ENODEV;
|
|
|
+ ret = NVSP_STAT_FAIL;
|
|
|
goto exit;
|
|
|
}
|
|
|
|
|
|
@@ -424,7 +425,7 @@ int rndis_filter_receive(struct hv_device *dev,
|
|
|
if (rndis_dev->state == RNDIS_DEV_UNINITIALIZED) {
|
|
|
netdev_err(ndev, "got rndis message but rndis device "
|
|
|
"uninitialized...dropping this message!\n");
|
|
|
- ret = -ENODEV;
|
|
|
+ ret = NVSP_STAT_FAIL;
|
|
|
goto exit;
|
|
|
}
|
|
|
|
|
|
@@ -436,8 +437,8 @@ int rndis_filter_receive(struct hv_device *dev,
|
|
|
switch (rndis_msg->ndis_msg_type) {
|
|
|
case RNDIS_MSG_PACKET:
|
|
|
/* data msg */
|
|
|
- rndis_filter_receive_data(rndis_dev, rndis_msg, pkt,
|
|
|
- data, channel);
|
|
|
+ ret = rndis_filter_receive_data(rndis_dev, rndis_msg, pkt,
|
|
|
+ data, channel);
|
|
|
break;
|
|
|
|
|
|
case RNDIS_MSG_INIT_C:
|
|
|
@@ -460,9 +461,6 @@ int rndis_filter_receive(struct hv_device *dev,
|
|
|
}
|
|
|
|
|
|
exit:
|
|
|
- if (ret != 0)
|
|
|
- pkt->status = NVSP_STAT_FAIL;
|
|
|
-
|
|
|
return ret;
|
|
|
}
|
|
|
|