diff options
-rw-r--r-- | drivers/net/hyperv/rndis_filter.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c index 4a4952363e8a..e2b68d9328a7 100644 --- a/drivers/net/hyperv/rndis_filter.c +++ b/drivers/net/hyperv/rndis_filter.c | |||
@@ -365,14 +365,15 @@ static inline void *rndis_get_ppi(struct rndis_packet *rpkt, u32 type) | |||
365 | 365 | ||
366 | static int rndis_filter_receive_data(struct net_device *ndev, | 366 | static int rndis_filter_receive_data(struct net_device *ndev, |
367 | struct netvsc_device *nvdev, | 367 | struct netvsc_device *nvdev, |
368 | struct rndis_message *msg, | ||
369 | struct vmbus_channel *channel, | 368 | struct vmbus_channel *channel, |
370 | void *data, u32 data_buflen) | 369 | struct rndis_message *msg, |
370 | u32 data_buflen) | ||
371 | { | 371 | { |
372 | struct rndis_packet *rndis_pkt = &msg->msg.pkt; | 372 | struct rndis_packet *rndis_pkt = &msg->msg.pkt; |
373 | const struct ndis_tcp_ip_checksum_info *csum_info; | 373 | const struct ndis_tcp_ip_checksum_info *csum_info; |
374 | const struct ndis_pkt_8021q_info *vlan; | 374 | const struct ndis_pkt_8021q_info *vlan; |
375 | u32 data_offset; | 375 | u32 data_offset; |
376 | void *data; | ||
376 | 377 | ||
377 | /* Remove the rndis header and pass it back up the stack */ | 378 | /* Remove the rndis header and pass it back up the stack */ |
378 | data_offset = RNDIS_HEADER_SIZE + rndis_pkt->data_offset; | 379 | data_offset = RNDIS_HEADER_SIZE + rndis_pkt->data_offset; |
@@ -393,14 +394,15 @@ static int rndis_filter_receive_data(struct net_device *ndev, | |||
393 | 394 | ||
394 | vlan = rndis_get_ppi(rndis_pkt, IEEE_8021Q_INFO); | 395 | vlan = rndis_get_ppi(rndis_pkt, IEEE_8021Q_INFO); |
395 | 396 | ||
397 | csum_info = rndis_get_ppi(rndis_pkt, TCPIP_CHKSUM_PKTINFO); | ||
398 | |||
399 | data = (void *)msg + data_offset; | ||
400 | |||
396 | /* | 401 | /* |
397 | * Remove the rndis trailer padding from rndis packet message | 402 | * Remove the rndis trailer padding from rndis packet message |
398 | * rndis_pkt->data_len tell us the real data length, we only copy | 403 | * rndis_pkt->data_len tell us the real data length, we only copy |
399 | * the data packet to the stack, without the rndis trailer padding | 404 | * the data packet to the stack, without the rndis trailer padding |
400 | */ | 405 | */ |
401 | data = (void *)((unsigned long)data + data_offset); | ||
402 | csum_info = rndis_get_ppi(rndis_pkt, TCPIP_CHKSUM_PKTINFO); | ||
403 | |||
404 | return netvsc_recv_callback(ndev, nvdev, channel, | 406 | return netvsc_recv_callback(ndev, nvdev, channel, |
405 | data, rndis_pkt->data_len, | 407 | data, rndis_pkt->data_len, |
406 | csum_info, vlan); | 408 | csum_info, vlan); |
@@ -419,8 +421,8 @@ int rndis_filter_receive(struct net_device *ndev, | |||
419 | 421 | ||
420 | switch (rndis_msg->ndis_msg_type) { | 422 | switch (rndis_msg->ndis_msg_type) { |
421 | case RNDIS_MSG_PACKET: | 423 | case RNDIS_MSG_PACKET: |
422 | return rndis_filter_receive_data(ndev, net_dev, rndis_msg, | 424 | return rndis_filter_receive_data(ndev, net_dev, channel, |
423 | channel, data, buflen); | 425 | rndis_msg, buflen); |
424 | case RNDIS_MSG_INIT_C: | 426 | case RNDIS_MSG_INIT_C: |
425 | case RNDIS_MSG_QUERY_C: | 427 | case RNDIS_MSG_QUERY_C: |
426 | case RNDIS_MSG_SET_C: | 428 | case RNDIS_MSG_SET_C: |