Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: hv: Convert camel cased struct fields in netvsc.h to lower cases

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Haiyang Zhang and committed by
Greg Kroah-Hartman
53d21fdb 72a2f5bd

+265 -263
+171 -169
drivers/staging/hv/netvsc.c
··· 83 83 return NULL; 84 84 85 85 /* Set to 2 to allow both inbound and outbound traffic */ 86 - atomic_cmpxchg(&net_device->RefCount, 0, 2); 86 + atomic_cmpxchg(&net_device->refcnt, 0, 2); 87 87 88 - net_device->Device = device; 88 + net_device->dev = device; 89 89 device->Extension = net_device; 90 90 91 91 return net_device; ··· 93 93 94 94 static void free_net_device(struct netvsc_device *device) 95 95 { 96 - WARN_ON(atomic_read(&device->RefCount) == 0); 97 - device->Device->Extension = NULL; 96 + WARN_ON(atomic_read(&device->refcnt) == 0); 97 + device->dev->Extension = NULL; 98 98 kfree(device); 99 99 } 100 100 ··· 105 105 struct netvsc_device *net_device; 106 106 107 107 net_device = device->Extension; 108 - if (net_device && atomic_read(&net_device->RefCount) > 1) 109 - atomic_inc(&net_device->RefCount); 108 + if (net_device && atomic_read(&net_device->refcnt) > 1) 109 + atomic_inc(&net_device->refcnt); 110 110 else 111 111 net_device = NULL; 112 112 ··· 119 119 struct netvsc_device *net_device; 120 120 121 121 net_device = device->Extension; 122 - if (net_device && atomic_read(&net_device->RefCount)) 123 - atomic_inc(&net_device->RefCount); 122 + if (net_device && atomic_read(&net_device->refcnt)) 123 + atomic_inc(&net_device->refcnt); 124 124 else 125 125 net_device = NULL; 126 126 ··· 134 134 net_device = device->Extension; 135 135 /* ASSERT(netDevice); */ 136 136 137 - atomic_dec(&net_device->RefCount); 137 + atomic_dec(&net_device->refcnt); 138 138 } 139 139 140 140 static struct netvsc_device *release_outbound_net_device( ··· 147 147 return NULL; 148 148 149 149 /* Busy wait until the ref drop to 2, then set it to 1 */ 150 - while (atomic_cmpxchg(&net_device->RefCount, 2, 1) != 2) 150 + while (atomic_cmpxchg(&net_device->refcnt, 2, 1) != 2) 151 151 udelay(100); 152 152 153 153 return net_device; ··· 163 163 return NULL; 164 164 165 165 /* Busy wait until the ref drop to 1, then set it to 0 */ 166 - while (atomic_cmpxchg(&net_device->RefCount, 1, 0) != 1) 166 + while (atomic_cmpxchg(&net_device->refcnt, 1, 0) != 1) 167 167 udelay(100); 168 168 169 169 device->Extension = NULL; ··· 222 222 /* page-size grandularity */ 223 223 /* ASSERT((netDevice->ReceiveBufferSize & (PAGE_SIZE - 1)) == 0); */ 224 224 225 - net_device->ReceiveBuffer = 226 - osd_page_alloc(net_device->ReceiveBufferSize >> PAGE_SHIFT); 227 - if (!net_device->ReceiveBuffer) { 225 + net_device->recv_buf = 226 + osd_page_alloc(net_device->recv_buf_size >> PAGE_SHIFT); 227 + if (!net_device->recv_buf) { 228 228 DPRINT_ERR(NETVSC, 229 229 "unable to allocate receive buffer of size %d", 230 - net_device->ReceiveBufferSize); 230 + net_device->recv_buf_size); 231 231 ret = -1; 232 232 goto Cleanup; 233 233 } ··· 242 242 * channel. Note: This call uses the vmbus connection rather 243 243 * than the channel to establish the gpadl handle. 244 244 */ 245 - ret = vmbus_establish_gpadl(device->channel, net_device->ReceiveBuffer, 246 - net_device->ReceiveBufferSize, 247 - &net_device->ReceiveBufferGpadlHandle); 245 + ret = vmbus_establish_gpadl(device->channel, net_device->recv_buf, 246 + net_device->recv_buf_size, 247 + &net_device->recv_buf_gpadl_handle); 248 248 if (ret != 0) { 249 249 DPRINT_ERR(NETVSC, 250 250 "unable to establish receive buffer's gpadl"); ··· 256 256 /* Notify the NetVsp of the gpadl handle */ 257 257 DPRINT_INFO(NETVSC, "Sending NvspMessage1TypeSendReceiveBuffer..."); 258 258 259 - init_packet = &net_device->ChannelInitPacket; 259 + init_packet = &net_device->channel_init_pkt; 260 260 261 261 memset(init_packet, 0, sizeof(struct nvsp_message)); 262 262 263 - init_packet->Header.MessageType = NvspMessage1TypeSendReceiveBuffer; 264 - init_packet->Messages.Version1Messages.SendReceiveBuffer. 265 - GpadlHandle = net_device->ReceiveBufferGpadlHandle; 266 - init_packet->Messages.Version1Messages. 267 - SendReceiveBuffer.Id = NETVSC_RECEIVE_BUFFER_ID; 263 + init_packet->hdr.msg_type = NVSP_MSG1_TYPE_SEND_RECV_BUF; 264 + init_packet->msg.v1_msg.send_recv_buf. 265 + gpadl_handle = net_device->recv_buf_gpadl_handle; 266 + init_packet->msg.v1_msg. 267 + send_recv_buf.id = NETVSC_RECEIVE_BUFFER_ID; 268 268 269 269 /* Send the gpadl notification request */ 270 270 ret = vmbus_sendpacket(device->channel, init_packet, ··· 278 278 goto Cleanup; 279 279 } 280 280 281 - osd_waitevent_wait(net_device->ChannelInitEvent); 281 + osd_waitevent_wait(net_device->channel_init_event); 282 282 283 283 /* Check the response */ 284 - if (init_packet->Messages.Version1Messages. 285 - SendReceiveBufferComplete.Status != NvspStatusSuccess) { 284 + if (init_packet->msg.v1_msg. 285 + send_recv_buf_complete.status != NVSP_STAT_SUCCESS) { 286 286 DPRINT_ERR(NETVSC, "Unable to complete receive buffer " 287 287 "initialzation with NetVsp - status %d", 288 - init_packet->Messages.Version1Messages. 289 - SendReceiveBufferComplete.Status); 288 + init_packet->msg.v1_msg. 289 + send_recv_buf_complete.status); 290 290 ret = -1; 291 291 goto Cleanup; 292 292 } ··· 295 295 /* ASSERT(netDevice->ReceiveSectionCount == 0); */ 296 296 /* ASSERT(netDevice->ReceiveSections == NULL); */ 297 297 298 - net_device->ReceiveSectionCount = init_packet->Messages. 299 - Version1Messages.SendReceiveBufferComplete.NumSections; 298 + net_device->recv_section_cnt = init_packet->msg. 299 + v1_msg.send_recv_buf_complete.num_sections; 300 300 301 - net_device->ReceiveSections = kmalloc(net_device->ReceiveSectionCount 301 + net_device->recv_section = kmalloc(net_device->recv_section_cnt 302 302 * sizeof(struct nvsp_1_receive_buffer_section), GFP_KERNEL); 303 - if (net_device->ReceiveSections == NULL) { 303 + if (net_device->recv_section == NULL) { 304 304 ret = -1; 305 305 goto Cleanup; 306 306 } 307 307 308 - memcpy(net_device->ReceiveSections, 309 - init_packet->Messages.Version1Messages. 310 - SendReceiveBufferComplete.Sections, 311 - net_device->ReceiveSectionCount * 308 + memcpy(net_device->recv_section, 309 + init_packet->msg.v1_msg. 310 + send_recv_buf_complete.sections, 311 + net_device->recv_section_cnt * 312 312 sizeof(struct nvsp_1_receive_buffer_section)); 313 313 314 314 DPRINT_INFO(NETVSC, "Receive sections info (count %d, offset %d, " 315 315 "endoffset %d, suballoc size %d, num suballocs %d)", 316 - net_device->ReceiveSectionCount, 317 - net_device->ReceiveSections[0].Offset, 318 - net_device->ReceiveSections[0].EndOffset, 319 - net_device->ReceiveSections[0].SubAllocationSize, 320 - net_device->ReceiveSections[0].NumSubAllocations); 316 + net_device->recv_section_cnt, 317 + net_device->recv_section[0].offset, 318 + net_device->recv_section[0].end_offset, 319 + net_device->recv_section[0].sub_alloc_size, 320 + net_device->recv_section[0].num_sub_allocs); 321 321 322 322 /* 323 323 * For 1st release, there should only be 1 section that represents the 324 324 * entire receive buffer 325 325 */ 326 - if (net_device->ReceiveSectionCount != 1 || 327 - net_device->ReceiveSections->Offset != 0) { 326 + if (net_device->recv_section_cnt != 1 || 327 + net_device->recv_section->offset != 0) { 328 328 ret = -1; 329 329 goto Cleanup; 330 330 } ··· 351 351 "device being destroyed?"); 352 352 return -1; 353 353 } 354 - if (net_device->SendBufferSize <= 0) { 354 + if (net_device->send_buf_size <= 0) { 355 355 ret = -EINVAL; 356 356 goto Cleanup; 357 357 } ··· 359 359 /* page-size grandularity */ 360 360 /* ASSERT((netDevice->SendBufferSize & (PAGE_SIZE - 1)) == 0); */ 361 361 362 - net_device->SendBuffer = 363 - osd_page_alloc(net_device->SendBufferSize >> PAGE_SHIFT); 364 - if (!net_device->SendBuffer) { 362 + net_device->send_buf = 363 + osd_page_alloc(net_device->send_buf_size >> PAGE_SHIFT); 364 + if (!net_device->send_buf) { 365 365 DPRINT_ERR(NETVSC, "unable to allocate send buffer of size %d", 366 - net_device->SendBufferSize); 366 + net_device->send_buf_size); 367 367 ret = -1; 368 368 goto Cleanup; 369 369 } ··· 377 377 * channel. Note: This call uses the vmbus connection rather 378 378 * than the channel to establish the gpadl handle. 379 379 */ 380 - ret = vmbus_establish_gpadl(device->channel, net_device->SendBuffer, 381 - net_device->SendBufferSize, 382 - &net_device->SendBufferGpadlHandle); 380 + ret = vmbus_establish_gpadl(device->channel, net_device->send_buf, 381 + net_device->send_buf_size, 382 + &net_device->send_buf_gpadl_handle); 383 383 if (ret != 0) { 384 384 DPRINT_ERR(NETVSC, "unable to establish send buffer's gpadl"); 385 385 goto Cleanup; ··· 390 390 /* Notify the NetVsp of the gpadl handle */ 391 391 DPRINT_INFO(NETVSC, "Sending NvspMessage1TypeSendSendBuffer..."); 392 392 393 - init_packet = &net_device->ChannelInitPacket; 393 + init_packet = &net_device->channel_init_pkt; 394 394 395 395 memset(init_packet, 0, sizeof(struct nvsp_message)); 396 396 397 - init_packet->Header.MessageType = NvspMessage1TypeSendSendBuffer; 398 - init_packet->Messages.Version1Messages.SendReceiveBuffer. 399 - GpadlHandle = net_device->SendBufferGpadlHandle; 400 - init_packet->Messages.Version1Messages.SendReceiveBuffer.Id = 397 + init_packet->hdr.msg_type = NVSP_MSG1_TYPE_SEND_SEND_BUF; 398 + init_packet->msg.v1_msg.send_recv_buf. 399 + gpadl_handle = net_device->send_buf_gpadl_handle; 400 + init_packet->msg.v1_msg.send_recv_buf.id = 401 401 NETVSC_SEND_BUFFER_ID; 402 402 403 403 /* Send the gpadl notification request */ ··· 412 412 goto Cleanup; 413 413 } 414 414 415 - osd_waitevent_wait(net_device->ChannelInitEvent); 415 + osd_waitevent_wait(net_device->channel_init_event); 416 416 417 417 /* Check the response */ 418 - if (init_packet->Messages.Version1Messages. 419 - SendSendBufferComplete.Status != NvspStatusSuccess) { 418 + if (init_packet->msg.v1_msg. 419 + send_send_buf_complete.status != NVSP_STAT_SUCCESS) { 420 420 DPRINT_ERR(NETVSC, "Unable to complete send buffer " 421 421 "initialzation with NetVsp - status %d", 422 - init_packet->Messages.Version1Messages. 423 - SendSendBufferComplete.Status); 422 + init_packet->msg.v1_msg. 423 + send_send_buf_complete.status); 424 424 ret = -1; 425 425 goto Cleanup; 426 426 } 427 427 428 - net_device->SendSectionSize = init_packet-> 429 - Messages.Version1Messages.SendSendBufferComplete.SectionSize; 428 + net_device->send_section_size = init_packet-> 429 + msg.v1_msg.send_send_buf_complete.section_size; 430 430 431 431 goto Exit; 432 432 ··· 449 449 * NvspMessage1TypeSendReceiveBuffer msg) therefore, we need 450 450 * to send a revoke msg here 451 451 */ 452 - if (net_device->ReceiveSectionCount) { 452 + if (net_device->recv_section_cnt) { 453 453 DPRINT_INFO(NETVSC, 454 454 "Sending NvspMessage1TypeRevokeReceiveBuffer..."); 455 455 456 456 /* Send the revoke receive buffer */ 457 - revoke_packet = &net_device->RevokePacket; 457 + revoke_packet = &net_device->revoke_packet; 458 458 memset(revoke_packet, 0, sizeof(struct nvsp_message)); 459 459 460 - revoke_packet->Header.MessageType = 461 - NvspMessage1TypeRevokeReceiveBuffer; 462 - revoke_packet->Messages.Version1Messages. 463 - RevokeReceiveBuffer.Id = NETVSC_RECEIVE_BUFFER_ID; 460 + revoke_packet->hdr.msg_type = 461 + NVSP_MSG1_TYPE_REVOKE_RECV_BUF; 462 + revoke_packet->msg.v1_msg. 463 + revoke_recv_buf.id = NETVSC_RECEIVE_BUFFER_ID; 464 464 465 - ret = vmbus_sendpacket(net_device->Device->channel, 465 + ret = vmbus_sendpacket(net_device->dev->channel, 466 466 revoke_packet, 467 467 sizeof(struct nvsp_message), 468 468 (unsigned long)revoke_packet, ··· 479 479 } 480 480 481 481 /* Teardown the gpadl on the vsp end */ 482 - if (net_device->ReceiveBufferGpadlHandle) { 482 + if (net_device->recv_buf_gpadl_handle) { 483 483 DPRINT_INFO(NETVSC, "Tearing down receive buffer's GPADL..."); 484 484 485 - ret = vmbus_teardown_gpadl(net_device->Device->channel, 486 - net_device->ReceiveBufferGpadlHandle); 485 + ret = vmbus_teardown_gpadl(net_device->dev->channel, 486 + net_device->recv_buf_gpadl_handle); 487 487 488 488 /* If we failed here, we might as well return and have a leak rather than continue and a bugchk */ 489 489 if (ret != 0) { ··· 491 491 "unable to teardown receive buffer's gpadl"); 492 492 return -1; 493 493 } 494 - net_device->ReceiveBufferGpadlHandle = 0; 494 + net_device->recv_buf_gpadl_handle = 0; 495 495 } 496 496 497 - if (net_device->ReceiveBuffer) { 497 + if (net_device->recv_buf) { 498 498 DPRINT_INFO(NETVSC, "Freeing up receive buffer..."); 499 499 500 500 /* Free up the receive buffer */ 501 - osd_page_free(net_device->ReceiveBuffer, 502 - net_device->ReceiveBufferSize >> PAGE_SHIFT); 503 - net_device->ReceiveBuffer = NULL; 501 + osd_page_free(net_device->recv_buf, 502 + net_device->recv_buf_size >> PAGE_SHIFT); 503 + net_device->recv_buf = NULL; 504 504 } 505 505 506 - if (net_device->ReceiveSections) { 507 - net_device->ReceiveSectionCount = 0; 508 - kfree(net_device->ReceiveSections); 509 - net_device->ReceiveSections = NULL; 506 + if (net_device->recv_section) { 507 + net_device->recv_section_cnt = 0; 508 + kfree(net_device->recv_section); 509 + net_device->recv_section = NULL; 510 510 } 511 511 512 512 return ret; ··· 523 523 * NvspMessage1TypeSendReceiveBuffer msg) therefore, we need 524 524 * to send a revoke msg here 525 525 */ 526 - if (net_device->SendSectionSize) { 526 + if (net_device->send_section_size) { 527 527 DPRINT_INFO(NETVSC, 528 528 "Sending NvspMessage1TypeRevokeSendBuffer..."); 529 529 530 530 /* Send the revoke send buffer */ 531 - revoke_packet = &net_device->RevokePacket; 531 + revoke_packet = &net_device->revoke_packet; 532 532 memset(revoke_packet, 0, sizeof(struct nvsp_message)); 533 533 534 - revoke_packet->Header.MessageType = 535 - NvspMessage1TypeRevokeSendBuffer; 536 - revoke_packet->Messages.Version1Messages. 537 - RevokeSendBuffer.Id = NETVSC_SEND_BUFFER_ID; 534 + revoke_packet->hdr.msg_type = 535 + NVSP_MSG1_TYPE_REVOKE_SEND_BUF; 536 + revoke_packet->msg.v1_msg. 537 + revoke_send_buf.id = NETVSC_SEND_BUFFER_ID; 538 538 539 - ret = vmbus_sendpacket(net_device->Device->channel, 539 + ret = vmbus_sendpacket(net_device->dev->channel, 540 540 revoke_packet, 541 541 sizeof(struct nvsp_message), 542 542 (unsigned long)revoke_packet, ··· 553 553 } 554 554 555 555 /* Teardown the gpadl on the vsp end */ 556 - if (net_device->SendBufferGpadlHandle) { 556 + if (net_device->send_buf_gpadl_handle) { 557 557 DPRINT_INFO(NETVSC, "Tearing down send buffer's GPADL..."); 558 - ret = vmbus_teardown_gpadl(net_device->Device->channel, 559 - net_device->SendBufferGpadlHandle); 558 + ret = vmbus_teardown_gpadl(net_device->dev->channel, 559 + net_device->send_buf_gpadl_handle); 560 560 561 561 /* 562 562 * If we failed here, we might as well return and have a leak ··· 567 567 "gpadl"); 568 568 return -1; 569 569 } 570 - net_device->SendBufferGpadlHandle = 0; 570 + net_device->send_buf_gpadl_handle = 0; 571 571 } 572 572 573 - if (net_device->SendBuffer) { 573 + if (net_device->send_buf) { 574 574 DPRINT_INFO(NETVSC, "Freeing up send buffer..."); 575 575 576 576 /* Free up the receive buffer */ 577 - osd_page_free(net_device->SendBuffer, 578 - net_device->SendBufferSize >> PAGE_SHIFT); 579 - net_device->SendBuffer = NULL; 577 + osd_page_free(net_device->send_buf, 578 + net_device->send_buf_size >> PAGE_SHIFT); 579 + net_device->send_buf = NULL; 580 580 } 581 581 582 582 return ret; ··· 597 597 return -1; 598 598 } 599 599 600 - init_packet = &net_device->ChannelInitPacket; 600 + init_packet = &net_device->channel_init_pkt; 601 601 602 602 memset(init_packet, 0, sizeof(struct nvsp_message)); 603 - init_packet->Header.MessageType = NvspMessageTypeInit; 604 - init_packet->Messages.InitMessages.Init.MinProtocolVersion = 603 + init_packet->hdr.msg_type = NVSP_MSG_TYPE_INIT; 604 + init_packet->msg.init_msg.init.min_protocol_ver = 605 605 NVSP_MIN_PROTOCOL_VERSION; 606 - init_packet->Messages.InitMessages.Init.MaxProtocolVersion = 606 + init_packet->msg.init_msg.init.max_protocol_ver = 607 607 NVSP_MAX_PROTOCOL_VERSION; 608 608 609 609 DPRINT_INFO(NETVSC, "Sending NvspMessageTypeInit..."); ··· 620 620 goto Cleanup; 621 621 } 622 622 623 - osd_waitevent_wait(net_device->ChannelInitEvent); 623 + osd_waitevent_wait(net_device->channel_init_event); 624 624 625 625 /* Now, check the response */ 626 626 /* ASSERT(initPacket->Messages.InitMessages.InitComplete.MaximumMdlChainLength <= MAX_MULTIPAGE_BUFFER_COUNT); */ 627 627 DPRINT_INFO(NETVSC, "NvspMessageTypeInit status(%d) max mdl chain (%d)", 628 - init_packet->Messages.InitMessages.InitComplete.Status, 629 - init_packet->Messages.InitMessages. 630 - InitComplete.MaximumMdlChainLength); 628 + init_packet->msg.init_msg.init_complete.status, 629 + init_packet->msg.init_msg. 630 + init_complete.max_mdl_chain_len); 631 631 632 - if (init_packet->Messages.InitMessages.InitComplete.Status != 633 - NvspStatusSuccess) { 632 + if (init_packet->msg.init_msg.init_complete.status != 633 + NVSP_STAT_SUCCESS) { 634 634 DPRINT_ERR(NETVSC, 635 635 "unable to initialize with netvsp (status 0x%x)", 636 - init_packet->Messages.InitMessages.InitComplete.Status); 636 + init_packet->msg.init_msg.init_complete.status); 637 637 ret = -1; 638 638 goto Cleanup; 639 639 } 640 640 641 - if (init_packet->Messages.InitMessages.InitComplete. 642 - NegotiatedProtocolVersion != NVSP_PROTOCOL_VERSION_1) { 641 + if (init_packet->msg.init_msg.init_complete. 642 + negotiated_protocol_ver != NVSP_PROTOCOL_VERSION_1) { 643 643 DPRINT_ERR(NETVSC, "unable to initialize with netvsp " 644 644 "(version expected 1 got %d)", 645 - init_packet->Messages.InitMessages. 646 - InitComplete.NegotiatedProtocolVersion); 645 + init_packet->msg.init_msg. 646 + init_complete.negotiated_protocol_ver); 647 647 ret = -1; 648 648 goto Cleanup; 649 649 } ··· 654 654 655 655 ndis_version = 0x00050000; 656 656 657 - init_packet->Header.MessageType = NvspMessage1TypeSendNdisVersion; 658 - init_packet->Messages.Version1Messages. 659 - SendNdisVersion.NdisMajorVersion = 657 + init_packet->hdr.msg_type = NVSP_MSG1_TYPE_SEND_NDIS_VER; 658 + init_packet->msg.v1_msg. 659 + send_ndis_ver.ndis_major_ver = 660 660 (ndis_version & 0xFFFF0000) >> 16; 661 - init_packet->Messages.Version1Messages. 662 - SendNdisVersion.NdisMinorVersion = 661 + init_packet->msg.v1_msg. 662 + send_ndis_ver.ndis_minor_ver = 663 663 ndis_version & 0xFFFF; 664 664 665 665 /* Send the init request */ ··· 719 719 DPRINT_DBG(NETVSC, "netvsc channel object allocated - %p", net_device); 720 720 721 721 /* Initialize the NetVSC channel extension */ 722 - net_device->ReceiveBufferSize = NETVSC_RECEIVE_BUFFER_SIZE; 723 - spin_lock_init(&net_device->receive_packet_list_lock); 722 + net_device->recv_buf_size = NETVSC_RECEIVE_BUFFER_SIZE; 723 + spin_lock_init(&net_device->recv_pkt_list_lock); 724 724 725 - net_device->SendBufferSize = NETVSC_SEND_BUFFER_SIZE; 725 + net_device->send_buf_size = NETVSC_SEND_BUFFER_SIZE; 726 726 727 - INIT_LIST_HEAD(&net_device->ReceivePacketList); 727 + INIT_LIST_HEAD(&net_device->recv_pkt_list); 728 728 729 729 for (i = 0; i < NETVSC_RECEIVE_PACKETLIST_COUNT; i++) { 730 730 packet = kzalloc(sizeof(struct hv_netvsc_packet) + ··· 737 737 break; 738 738 } 739 739 list_add_tail(&packet->list_ent, 740 - &net_device->ReceivePacketList); 740 + &net_device->recv_pkt_list); 741 741 } 742 - net_device->ChannelInitEvent = osd_waitevent_create(); 743 - if (!net_device->ChannelInitEvent) { 742 + net_device->channel_init_event = osd_waitevent_create(); 743 + if (!net_device->channel_init_event) { 744 744 ret = -ENOMEM; 745 745 goto Cleanup; 746 746 } ··· 779 779 Cleanup: 780 780 781 781 if (net_device) { 782 - kfree(net_device->ChannelInitEvent); 782 + kfree(net_device->channel_init_event); 783 783 784 784 list_for_each_entry_safe(packet, pos, 785 - &net_device->ReceivePacketList, 785 + &net_device->recv_pkt_list, 786 786 list_ent) { 787 787 list_del(&packet->list_ent); 788 788 kfree(packet); ··· 816 816 } 817 817 818 818 /* Wait for all send completions */ 819 - while (atomic_read(&net_device->NumOutstandingSends)) { 819 + while (atomic_read(&net_device->num_outstanding_sends)) { 820 820 DPRINT_INFO(NETVSC, "waiting for %d requests to complete...", 821 - atomic_read(&net_device->NumOutstandingSends)); 821 + atomic_read(&net_device->num_outstanding_sends)); 822 822 udelay(100); 823 823 } 824 824 ··· 840 840 841 841 /* Release all resources */ 842 842 list_for_each_entry_safe(netvsc_packet, pos, 843 - &net_device->ReceivePacketList, list_ent) { 843 + &net_device->recv_pkt_list, list_ent) { 844 844 list_del(&netvsc_packet->list_ent); 845 845 kfree(netvsc_packet); 846 846 } 847 847 848 - kfree(net_device->ChannelInitEvent); 848 + kfree(net_device->channel_init_event); 849 849 free_net_device(net_device); 850 850 return 0; 851 851 } ··· 875 875 (packet->DataOffset8 << 3)); 876 876 877 877 DPRINT_DBG(NETVSC, "send completion packet - type %d", 878 - nvsp_packet->Header.MessageType); 878 + nvsp_packet->hdr.msg_type); 879 879 880 - if ((nvsp_packet->Header.MessageType == NvspMessageTypeInitComplete) || 881 - (nvsp_packet->Header.MessageType == 882 - NvspMessage1TypeSendReceiveBufferComplete) || 883 - (nvsp_packet->Header.MessageType == 884 - NvspMessage1TypeSendSendBufferComplete)) { 880 + if ((nvsp_packet->hdr.msg_type == NVSP_MSG_TYPE_INIT_COMPLETE) || 881 + (nvsp_packet->hdr.msg_type == 882 + NVSP_MSG1_TYPE_SEND_RECV_BUF_COMPLETE) || 883 + (nvsp_packet->hdr.msg_type == 884 + NVSP_MSG1_TYPE_SEND_SEND_BUF_COMPLETE)) { 885 885 /* Copy the response back */ 886 - memcpy(&net_device->ChannelInitPacket, nvsp_packet, 886 + memcpy(&net_device->channel_init_pkt, nvsp_packet, 887 887 sizeof(struct nvsp_message)); 888 - osd_waitevent_set(net_device->ChannelInitEvent); 889 - } else if (nvsp_packet->Header.MessageType == 890 - NvspMessage1TypeSendRNDISPacketComplete) { 888 + osd_waitevent_set(net_device->channel_init_event); 889 + } else if (nvsp_packet->hdr.msg_type == 890 + NVSP_MSG1_TYPE_SEND_RNDIS_PKT_COMPLETE) { 891 891 /* Get the send context */ 892 892 nvsc_packet = (struct hv_netvsc_packet *)(unsigned long) 893 893 packet->TransactionId; ··· 897 897 nvsc_packet->completion.send.send_completion( 898 898 nvsc_packet->completion.send.send_completion_ctx); 899 899 900 - atomic_dec(&net_device->NumOutstandingSends); 900 + atomic_dec(&net_device->num_outstanding_sends); 901 901 } else { 902 902 DPRINT_ERR(NETVSC, "Unknown send completion packet type - " 903 - "%d received!!", nvsp_packet->Header.MessageType); 903 + "%d received!!", nvsp_packet->hdr.msg_type); 904 904 } 905 905 906 906 put_net_device(device); ··· 921 921 return -2; 922 922 } 923 923 924 - sendMessage.Header.MessageType = NvspMessage1TypeSendRNDISPacket; 924 + sendMessage.hdr.msg_type = NVSP_MSG1_TYPE_SEND_RNDIS_PKT; 925 925 if (packet->is_data_pkt) { 926 926 /* 0 is RMC_DATA; */ 927 - sendMessage.Messages.Version1Messages.SendRNDISPacket.ChannelType = 0; 927 + sendMessage.msg.v1_msg.send_rndis_pkt.channel_type = 0; 928 928 } else { 929 929 /* 1 is RMC_CONTROL; */ 930 - sendMessage.Messages.Version1Messages.SendRNDISPacket.ChannelType = 1; 930 + sendMessage.msg.v1_msg.send_rndis_pkt.channel_type = 1; 931 931 } 932 932 933 933 /* Not using send buffer section */ 934 - sendMessage.Messages.Version1Messages.SendRNDISPacket.SendBufferSectionIndex = 0xFFFFFFFF; 935 - sendMessage.Messages.Version1Messages.SendRNDISPacket.SendBufferSectionSize = 0; 934 + sendMessage.msg.v1_msg.send_rndis_pkt.send_buf_section_index = 935 + 0xFFFFFFFF; 936 + sendMessage.msg.v1_msg.send_rndis_pkt.send_buf_section_size = 0; 936 937 937 938 if (packet->page_buf_cnt) { 938 939 ret = vmbus_sendpacket_pagebuffer(device->channel, ··· 955 954 DPRINT_ERR(NETVSC, "Unable to send packet %p ret %d", 956 955 packet, ret); 957 956 958 - atomic_inc(&net_device->NumOutstandingSends); 957 + atomic_inc(&net_device->num_outstanding_sends); 959 958 put_net_device(device); 960 959 return ret; 961 960 } ··· 998 997 (packet->DataOffset8 << 3)); 999 998 1000 999 /* Make sure this is a valid nvsp packet */ 1001 - if (nvsp_packet->Header.MessageType != 1002 - NvspMessage1TypeSendRNDISPacket) { 1000 + if (nvsp_packet->hdr.msg_type != 1001 + NVSP_MSG1_TYPE_SEND_RNDIS_PKT) { 1003 1002 DPRINT_ERR(NETVSC, "Unknown nvsp packet type received - %d", 1004 - nvsp_packet->Header.MessageType); 1003 + nvsp_packet->hdr.msg_type); 1005 1004 put_net_device(device); 1006 1005 return; 1007 1006 } 1008 1007 1009 1008 DPRINT_DBG(NETVSC, "NVSP packet received - type %d", 1010 - nvsp_packet->Header.MessageType); 1009 + nvsp_packet->hdr.msg_type); 1011 1010 1012 1011 vmxferpage_packet = (struct vmtransfer_page_packet_header *)packet; 1013 1012 ··· 1028 1027 * We grab it here so that we know exactly how many we can 1029 1028 * fulfil 1030 1029 */ 1031 - spin_lock_irqsave(&net_device->receive_packet_list_lock, flags); 1032 - while (!list_empty(&net_device->ReceivePacketList)) { 1033 - list_move_tail(net_device->ReceivePacketList.next, &listHead); 1030 + spin_lock_irqsave(&net_device->recv_pkt_list_lock, flags); 1031 + while (!list_empty(&net_device->recv_pkt_list)) { 1032 + list_move_tail(net_device->recv_pkt_list.next, &listHead); 1034 1033 if (++count == vmxferpage_packet->RangeCount + 1) 1035 1034 break; 1036 1035 } 1037 - spin_unlock_irqrestore(&net_device->receive_packet_list_lock, flags); 1036 + spin_unlock_irqrestore(&net_device->recv_pkt_list_lock, flags); 1038 1037 1039 1038 /* 1040 1039 * We need at least 2 netvsc pkts (1 to represent the xfer ··· 1047 1046 count, vmxferpage_packet->RangeCount + 1); 1048 1047 1049 1048 /* Return it to the freelist */ 1050 - spin_lock_irqsave(&net_device->receive_packet_list_lock, flags); 1049 + spin_lock_irqsave(&net_device->recv_pkt_list_lock, flags); 1051 1050 for (i = count; i != 0; i--) { 1052 1051 list_move_tail(listHead.next, 1053 - &net_device->ReceivePacketList); 1052 + &net_device->recv_pkt_list); 1054 1053 } 1055 - spin_unlock_irqrestore(&net_device->receive_packet_list_lock, 1054 + spin_unlock_irqrestore(&net_device->recv_pkt_list_lock, 1056 1055 flags); 1057 1056 1058 1057 netvsc_send_recv_completion(device, ··· 1105 1104 vmxferpage_packet->Ranges[i].ByteCount; 1106 1105 1107 1106 start = virt_to_phys((void *)((unsigned long)net_device-> 1108 - ReceiveBuffer + vmxferpage_packet->Ranges[i].ByteOffset)); 1107 + recv_buf + vmxferpage_packet->Ranges[i].ByteOffset)); 1109 1108 1110 1109 netvsc_packet->page_buf[0].Pfn = start >> PAGE_SHIFT; 1111 - end_virtual = (unsigned long)net_device->ReceiveBuffer 1110 + end_virtual = (unsigned long)net_device->recv_buf 1112 1111 + vmxferpage_packet->Ranges[i].ByteOffset 1113 1112 + vmxferpage_packet->Ranges[i].ByteCount - 1; 1114 1113 end = virt_to_phys((void *)end_virtual); ··· 1176 1175 DPRINT_DBG(NETVSC, "Sending receive completion pkt - %llx", 1177 1176 transaction_id); 1178 1177 1179 - recvcompMessage.Header.MessageType = 1180 - NvspMessage1TypeSendRNDISPacketComplete; 1178 + recvcompMessage.hdr.msg_type = 1179 + NVSP_MSG1_TYPE_SEND_RNDIS_PKT_COMPLETE; 1181 1180 1182 1181 /* FIXME: Pass in the status */ 1183 - recvcompMessage.Messages.Version1Messages.SendRNDISPacketComplete.Status = NvspStatusSuccess; 1182 + recvcompMessage.msg.v1_msg.send_rndis_pkt_complete.status = 1183 + NVSP_STAT_SUCCESS; 1184 1184 1185 1185 retry_send_cmplt: 1186 1186 /* Send the completion */ ··· 1236 1234 } 1237 1235 1238 1236 /* Overloading use of the lock. */ 1239 - spin_lock_irqsave(&net_device->receive_packet_list_lock, flags); 1237 + spin_lock_irqsave(&net_device->recv_pkt_list_lock, flags); 1240 1238 1241 1239 /* ASSERT(packet->XferPagePacket->Count > 0); */ 1242 1240 packet->xfer_page_pkt->count--; ··· 1249 1247 fsend_receive_comp = true; 1250 1248 transaction_id = packet->completion.recv.recv_completion_tid; 1251 1249 list_add_tail(&packet->xfer_page_pkt->list_ent, 1252 - &net_device->ReceivePacketList); 1250 + &net_device->recv_pkt_list); 1253 1251 1254 1252 } 1255 1253 1256 1254 /* Put the packet back */ 1257 - list_add_tail(&packet->list_ent, &net_device->ReceivePacketList); 1258 - spin_unlock_irqrestore(&net_device->receive_packet_list_lock, flags); 1255 + list_add_tail(&packet->list_ent, &net_device->recv_pkt_list); 1256 + spin_unlock_irqrestore(&net_device->recv_pkt_list_lock, flags); 1259 1257 1260 1258 /* Send a receive completion for the xfer page packet */ 1261 1259 if (fsend_receive_comp)
+82 -82
drivers/staging/hv/netvsc.h
··· 38 38 #define NVSP_MAX_PROTOCOL_VERSION NVSP_PROTOCOL_VERSION_1 39 39 40 40 enum { 41 - NvspMessageTypeNone = 0, 41 + NVSP_MSG_TYPE_NONE = 0, 42 42 43 43 /* Init Messages */ 44 - NvspMessageTypeInit = 1, 45 - NvspMessageTypeInitComplete = 2, 44 + NVSP_MSG_TYPE_INIT = 1, 45 + NVSP_MSG_TYPE_INIT_COMPLETE = 2, 46 46 47 - NvspVersionMessageStart = 100, 47 + NVSP_VERSION_MSG_START = 100, 48 48 49 49 /* Version 1 Messages */ 50 - NvspMessage1TypeSendNdisVersion = NvspVersionMessageStart, 50 + NVSP_MSG1_TYPE_SEND_NDIS_VER = NVSP_VERSION_MSG_START, 51 51 52 - NvspMessage1TypeSendReceiveBuffer, 53 - NvspMessage1TypeSendReceiveBufferComplete, 54 - NvspMessage1TypeRevokeReceiveBuffer, 52 + NVSP_MSG1_TYPE_SEND_RECV_BUF, 53 + NVSP_MSG1_TYPE_SEND_RECV_BUF_COMPLETE, 54 + NVSP_MSG1_TYPE_REVOKE_RECV_BUF, 55 55 56 - NvspMessage1TypeSendSendBuffer, 57 - NvspMessage1TypeSendSendBufferComplete, 58 - NvspMessage1TypeRevokeSendBuffer, 56 + NVSP_MSG1_TYPE_SEND_SEND_BUF, 57 + NVSP_MSG1_TYPE_SEND_SEND_BUF_COMPLETE, 58 + NVSP_MSG1_TYPE_REVOKE_SEND_BUF, 59 59 60 - NvspMessage1TypeSendRNDISPacket, 61 - NvspMessage1TypeSendRNDISPacketComplete, 60 + NVSP_MSG1_TYPE_SEND_RNDIS_PKT, 61 + NVSP_MSG1_TYPE_SEND_RNDIS_PKT_COMPLETE, 62 62 63 63 /* 64 64 * This should be set to the number of messages for the version with 65 65 * the maximum number of messages. 66 66 */ 67 - NvspNumMessagePerVersion = 9, 67 + NVSP_NUM_MSG_PER_VERSION = 9, 68 68 }; 69 69 70 70 enum { 71 - NvspStatusNone = 0, 72 - NvspStatusSuccess, 73 - NvspStatusFailure, 74 - NvspStatusProtocolVersionRangeTooNew, 75 - NvspStatusProtocolVersionRangeTooOld, 76 - NvspStatusInvalidRndisPacket, 77 - NvspStatusBusy, 78 - NvspStatusMax, 71 + NVSP_STAT_NONE = 0, 72 + NVSP_STAT_SUCCESS, 73 + NVSP_STAT_FAIL, 74 + NVSP_STAT_PROTOCOL_TOO_NEW, 75 + NVSP_STAT_PROTOCOL_TOO_OLD, 76 + NVSP_STAT_INVALID_RNDIS_PKT, 77 + NVSP_STAT_BUSY, 78 + NVSP_STAT_MAX, 79 79 }; 80 80 81 81 struct nvsp_message_header { 82 - u32 MessageType; 82 + u32 msg_type; 83 83 }; 84 84 85 85 /* Init Messages */ ··· 90 90 * versioning (i.e. this message will be the same for ever). 91 91 */ 92 92 struct nvsp_message_init { 93 - u32 MinProtocolVersion; 94 - u32 MaxProtocolVersion; 93 + u32 min_protocol_ver; 94 + u32 max_protocol_ver; 95 95 } __attribute__((packed)); 96 96 97 97 /* ··· 100 100 * (i.e. this message will be the same for ever). 101 101 */ 102 102 struct nvsp_message_init_complete { 103 - u32 NegotiatedProtocolVersion; 104 - u32 MaximumMdlChainLength; 105 - u32 Status; 103 + u32 negotiated_protocol_ver; 104 + u32 max_mdl_chain_len; 105 + u32 status; 106 106 } __attribute__((packed)); 107 107 108 108 union nvsp_message_init_uber { 109 - struct nvsp_message_init Init; 110 - struct nvsp_message_init_complete InitComplete; 109 + struct nvsp_message_init init; 110 + struct nvsp_message_init_complete init_complete; 111 111 } __attribute__((packed)); 112 112 113 113 /* Version 1 Messages */ ··· 117 117 * can use this information when handling OIDs sent by the VSC. 118 118 */ 119 119 struct nvsp_1_message_send_ndis_version { 120 - u32 NdisMajorVersion; 121 - u32 NdisMinorVersion; 120 + u32 ndis_major_ver; 121 + u32 ndis_minor_ver; 122 122 } __attribute__((packed)); 123 123 124 124 /* ··· 126 126 * can then use the receive buffer to send data to the VSC. 127 127 */ 128 128 struct nvsp_1_message_send_receive_buffer { 129 - u32 GpadlHandle; 130 - u16 Id; 129 + u32 gpadl_handle; 130 + u16 id; 131 131 } __attribute__((packed)); 132 132 133 133 struct nvsp_1_receive_buffer_section { 134 - u32 Offset; 135 - u32 SubAllocationSize; 136 - u32 NumSubAllocations; 137 - u32 EndOffset; 134 + u32 offset; 135 + u32 sub_alloc_size; 136 + u32 num_sub_allocs; 137 + u32 end_offset; 138 138 } __attribute__((packed)); 139 139 140 140 /* ··· 143 143 * buffer. 144 144 */ 145 145 struct nvsp_1_message_send_receive_buffer_complete { 146 - u32 Status; 147 - u32 NumSections; 146 + u32 status; 147 + u32 num_sections; 148 148 149 149 /* 150 150 * The receive buffer is split into two parts, a large suballocation ··· 165 165 * LargeOffset SmallOffset 166 166 */ 167 167 168 - struct nvsp_1_receive_buffer_section Sections[1]; 168 + struct nvsp_1_receive_buffer_section sections[1]; 169 169 } __attribute__((packed)); 170 170 171 171 /* ··· 174 174 * again. 175 175 */ 176 176 struct nvsp_1_message_revoke_receive_buffer { 177 - u16 Id; 177 + u16 id; 178 178 }; 179 179 180 180 /* ··· 182 182 * can then use the send buffer to send data to the VSP. 183 183 */ 184 184 struct nvsp_1_message_send_send_buffer { 185 - u32 GpadlHandle; 186 - u16 Id; 185 + u32 gpadl_handle; 186 + u16 id; 187 187 } __attribute__((packed)); 188 188 189 189 /* ··· 192 192 * buffer. 193 193 */ 194 194 struct nvsp_1_message_send_send_buffer_complete { 195 - u32 Status; 195 + u32 status; 196 196 197 197 /* 198 198 * The VSC gets to choose the size of the send buffer and the VSP gets ··· 200 200 * dynamic reconfigurations when the cost of GPA-direct buffers 201 201 * decreases. 202 202 */ 203 - u32 SectionSize; 203 + u32 section_size; 204 204 } __attribute__((packed)); 205 205 206 206 /* ··· 208 208 * completes this transaction, the vsp should never use the send buffer again. 209 209 */ 210 210 struct nvsp_1_message_revoke_send_buffer { 211 - u16 Id; 211 + u16 id; 212 212 }; 213 213 214 214 /* ··· 221 221 * channels of communication. However, the Network VSP only has one. 222 222 * Therefore, the channel travels with the RNDIS packet. 223 223 */ 224 - u32 ChannelType; 224 + u32 channel_type; 225 225 226 226 /* 227 227 * This field is used to send part or all of the data through a send ··· 229 229 * index is 0xFFFFFFFF, then the send buffer is not being used and all 230 230 * of the data was sent through other VMBus mechanisms. 231 231 */ 232 - u32 SendBufferSectionIndex; 233 - u32 SendBufferSectionSize; 232 + u32 send_buf_section_index; 233 + u32 send_buf_section_size; 234 234 } __attribute__((packed)); 235 235 236 236 /* ··· 239 239 * message cannot use any resources associated with the original RNDIS packet. 240 240 */ 241 241 struct nvsp_1_message_send_rndis_packet_complete { 242 - u32 Status; 242 + u32 status; 243 243 }; 244 244 245 245 union nvsp_1_message_uber { 246 - struct nvsp_1_message_send_ndis_version SendNdisVersion; 246 + struct nvsp_1_message_send_ndis_version send_ndis_ver; 247 247 248 - struct nvsp_1_message_send_receive_buffer SendReceiveBuffer; 248 + struct nvsp_1_message_send_receive_buffer send_recv_buf; 249 249 struct nvsp_1_message_send_receive_buffer_complete 250 - SendReceiveBufferComplete; 251 - struct nvsp_1_message_revoke_receive_buffer RevokeReceiveBuffer; 250 + send_recv_buf_complete; 251 + struct nvsp_1_message_revoke_receive_buffer revoke_recv_buf; 252 252 253 - struct nvsp_1_message_send_send_buffer SendSendBuffer; 254 - struct nvsp_1_message_send_send_buffer_complete SendSendBufferComplete; 255 - struct nvsp_1_message_revoke_send_buffer RevokeSendBuffer; 253 + struct nvsp_1_message_send_send_buffer send_send_buf; 254 + struct nvsp_1_message_send_send_buffer_complete send_send_buf_complete; 255 + struct nvsp_1_message_revoke_send_buffer revoke_send_buf; 256 256 257 - struct nvsp_1_message_send_rndis_packet SendRNDISPacket; 257 + struct nvsp_1_message_send_rndis_packet send_rndis_pkt; 258 258 struct nvsp_1_message_send_rndis_packet_complete 259 - SendRNDISPacketComplete; 259 + send_rndis_pkt_complete; 260 260 } __attribute__((packed)); 261 261 262 262 union nvsp_all_messages { 263 - union nvsp_message_init_uber InitMessages; 264 - union nvsp_1_message_uber Version1Messages; 263 + union nvsp_message_init_uber init_msg; 264 + union nvsp_1_message_uber v1_msg; 265 265 } __attribute__((packed)); 266 266 267 267 /* ALL Messages */ 268 268 struct nvsp_message { 269 - struct nvsp_message_header Header; 270 - union nvsp_all_messages Messages; 269 + struct nvsp_message_header hdr; 270 + union nvsp_all_messages msg; 271 271 } __attribute__((packed)); 272 272 273 273 ··· 293 293 294 294 /* Per netvsc channel-specific */ 295 295 struct netvsc_device { 296 - struct hv_device *Device; 296 + struct hv_device *dev; 297 297 298 - atomic_t RefCount; 299 - atomic_t NumOutstandingSends; 298 + atomic_t refcnt; 299 + atomic_t num_outstanding_sends; 300 300 /* 301 301 * List of free preallocated hv_netvsc_packet to represent receive 302 302 * packet 303 303 */ 304 - struct list_head ReceivePacketList; 305 - spinlock_t receive_packet_list_lock; 304 + struct list_head recv_pkt_list; 305 + spinlock_t recv_pkt_list_lock; 306 306 307 307 /* Send buffer allocated by us but manages by NetVSP */ 308 - void *SendBuffer; 309 - u32 SendBufferSize; 310 - u32 SendBufferGpadlHandle; 311 - u32 SendSectionSize; 308 + void *send_buf; 309 + u32 send_buf_size; 310 + u32 send_buf_gpadl_handle; 311 + u32 send_section_size; 312 312 313 313 /* Receive buffer allocated by us but manages by NetVSP */ 314 - void *ReceiveBuffer; 315 - u32 ReceiveBufferSize; 316 - u32 ReceiveBufferGpadlHandle; 317 - u32 ReceiveSectionCount; 318 - struct nvsp_1_receive_buffer_section *ReceiveSections; 314 + void *recv_buf; 315 + u32 recv_buf_size; 316 + u32 recv_buf_gpadl_handle; 317 + u32 recv_section_cnt; 318 + struct nvsp_1_receive_buffer_section *recv_section; 319 319 320 320 /* Used for NetVSP initialization protocol */ 321 - struct osd_waitevent *ChannelInitEvent; 322 - struct nvsp_message ChannelInitPacket; 321 + struct osd_waitevent *channel_init_event; 322 + struct nvsp_message channel_init_pkt; 323 323 324 - struct nvsp_message RevokePacket; 324 + struct nvsp_message revoke_packet; 325 325 /* unsigned char HwMacAddr[HW_MACADDR_LEN]; */ 326 326 327 327 /* Holds rndis device info */ 328 - void *Extension; 328 + void *extension; 329 329 }; 330 330 331 331 #endif /* _NETVSC_H_ */
+1 -1
drivers/staging/hv/netvsc_api.h
··· 95 95 */ 96 96 int (*recv_cb)(struct hv_device *dev, 97 97 struct hv_netvsc_packet *packet); 98 - void (*link_status_change)(struct hv_device *dev, u32 Status); 98 + void (*link_status_change)(struct hv_device *dev, u32 status); 99 99 100 100 /* Specific to this driver */ 101 101 int (*send)(struct hv_device *dev, struct hv_netvsc_packet *packet);
+11 -11
drivers/staging/hv/rndis_filter.c
··· 266 266 rndis_filter_send_request_completion; 267 267 packet->completion.send.send_completion_tid = (unsigned long)dev; 268 268 269 - ret = rndis_filter.inner_drv.send(dev->net_dev->Device, packet); 269 + ret = rndis_filter.inner_drv.send(dev->net_dev->dev, packet); 270 270 return ret; 271 271 } 272 272 ··· 338 338 339 339 if (indicate->Status == RNDIS_STATUS_MEDIA_CONNECT) { 340 340 rndis_filter.inner_drv.link_status_change( 341 - dev->net_dev->Device, 1); 341 + dev->net_dev->dev, 1); 342 342 } else if (indicate->Status == RNDIS_STATUS_MEDIA_DISCONNECT) { 343 343 rndis_filter.inner_drv.link_status_change( 344 - dev->net_dev->Device, 0); 344 + dev->net_dev->dev, 0); 345 345 } else { 346 346 /* 347 347 * TODO: ··· 376 376 377 377 pkt->is_data_pkt = true; 378 378 379 - rndis_filter.inner_drv.recv_cb(dev->net_dev->Device, 379 + rndis_filter.inner_drv.recv_cb(dev->net_dev->dev, 380 380 pkt); 381 381 } 382 382 ··· 392 392 return -EINVAL; 393 393 394 394 /* Make sure the rndis device state is initialized */ 395 - if (!net_dev->Extension) { 395 + if (!net_dev->extension) { 396 396 DPRINT_ERR(NETVSC, "got rndis message but no rndis device..." 397 397 "dropping this message!"); 398 398 return -1; 399 399 } 400 400 401 - rndis_dev = (struct rndis_device *)net_dev->Extension; 401 + rndis_dev = (struct rndis_device *)net_dev->extension; 402 402 if (rndis_dev->state == RNDIS_DEV_UNINITIALIZED) { 403 403 DPRINT_ERR(NETVSC, "got rndis message but rndis device " 404 404 "uninitialized...dropping this message!"); ··· 782 782 /* ASSERT(netDevice); */ 783 783 /* ASSERT(netDevice->Device); */ 784 784 785 - netDevice->Extension = rndisDevice; 785 + netDevice->extension = rndisDevice; 786 786 rndisDevice->net_dev = netDevice; 787 787 788 788 /* Send the rndis initialization message */ ··· 819 819 static int rndis_filter_device_remove(struct hv_device *dev) 820 820 { 821 821 struct netvsc_device *net_dev = dev->Extension; 822 - struct rndis_device *rndis_dev = net_dev->Extension; 822 + struct rndis_device *rndis_dev = net_dev->extension; 823 823 824 824 /* Halt and release the rndis device */ 825 825 rndis_filter_halt_device(rndis_dev); 826 826 827 827 kfree(rndis_dev); 828 - net_dev->Extension = NULL; 828 + net_dev->extension = NULL; 829 829 830 830 /* Pass control to inner driver to remove the device */ 831 831 rndis_filter.inner_drv.base.OnDeviceRemove(dev); ··· 844 844 if (!netDevice) 845 845 return -EINVAL; 846 846 847 - return rndis_filter_open_device(netDevice->Extension); 847 + return rndis_filter_open_device(netDevice->extension); 848 848 } 849 849 850 850 int rndis_filter_close(struct hv_device *dev) ··· 854 854 if (!netDevice) 855 855 return -EINVAL; 856 856 857 - return rndis_filter_close_device(netDevice->Extension); 857 + return rndis_filter_close_device(netDevice->extension); 858 858 } 859 859 860 860 static int rndis_filter_send(struct hv_device *dev,