Lines Matching defs:device
68 /* Avoid deadlock with device removal already under RTNL */
138 static void netvsc_revoke_recv_buf(struct hv_device *device,
163 ret = vmbus_sendpacket(device->channel,
173 if (device->channel->rescind)
188 static void netvsc_revoke_send_buf(struct hv_device *device,
213 ret = vmbus_sendpacket(device->channel,
224 if (device->channel->rescind)
239 static void netvsc_teardown_recv_gpadl(struct hv_device *device,
246 ret = vmbus_teardown_gpadl(device->channel,
261 static void netvsc_teardown_send_gpadl(struct hv_device *device,
268 ret = vmbus_teardown_gpadl(device->channel,
297 static int netvsc_init_buf(struct hv_device *device,
302 struct net_device *ndev = hv_get_drvdata(device);
333 ret = vmbus_establish_gpadl(device->channel, net_device->recv_buf,
354 ret = vmbus_sendpacket(device->channel, init_packet,
425 ret = vmbus_establish_gpadl(device->channel, net_device->send_buf,
445 ret = vmbus_sendpacket(device->channel, init_packet,
497 netvsc_revoke_recv_buf(device, net_device, ndev);
498 netvsc_revoke_send_buf(device, net_device, ndev);
499 netvsc_teardown_recv_gpadl(device, net_device, ndev);
500 netvsc_teardown_send_gpadl(device, net_device, ndev);
507 static int negotiate_nvsp_ver(struct hv_device *device,
512 struct net_device *ndev = hv_get_drvdata(device);
522 ret = vmbus_sendpacket(device->channel, init_packet,
558 ret = vmbus_sendpacket(device->channel, init_packet,
566 static int netvsc_connect_vsp(struct hv_device *device,
570 struct net_device *ndev = hv_get_drvdata(device);
583 if (negotiate_nvsp_ver(device, net_device, init_packet,
615 ret = vmbus_sendpacket(device->channel, init_packet,
623 ret = netvsc_init_buf(device, net_device, device_info);
630 * netvsc_device_remove - Callback when the root bus device is removed
632 void netvsc_device_remove(struct hv_device *device)
634 struct net_device *ndev = hv_get_drvdata(device);
644 netvsc_revoke_recv_buf(device, net_device, ndev);
646 netvsc_teardown_recv_gpadl(device, net_device, ndev);
648 netvsc_revoke_send_buf(device, net_device, ndev);
650 netvsc_teardown_send_gpadl(device, net_device, ndev);
654 /* Disable NAPI and disassociate its context from the device. */
668 netdev_dbg(ndev, "net device safe to remove\n");
671 vmbus_close(device->channel);
678 netvsc_teardown_recv_gpadl(device, net_device, ndev);
679 netvsc_teardown_send_gpadl(device, net_device, ndev);
865 struct hv_device *device,
877 struct net_device *ndev = hv_get_drvdata(device);
970 struct hv_device *device = ndev_ctx->device_ctx;
980 /* If device is rescinded, return error and packet will get dropped. */
993 return netvsc_send_pkt(device, packet, net_device, pb, skb);
1067 int m_ret = netvsc_send_pkt(device, msd_send, net_device,
1078 ret = netvsc_send_pkt(device, cur_send, net_device, pb, skb);
1366 static int netvsc_process_raw_pkt(struct hv_device *device,
1417 struct hv_device *device = netvsc_channel_to_device(channel);
1418 struct net_device *ndev = hv_get_drvdata(device);
1427 work_done += netvsc_process_raw_pkt(device, nvchan, net_device,
1474 * netvsc_device_add - Callback when the device belonging to this
1477 struct netvsc_device *netvsc_device_add(struct hv_device *device,
1482 struct net_device *ndev = hv_get_drvdata(device);
1492 /* Because the device uses NAPI, all the interrupt batching and
1495 set_channel_read_mode(device->channel, HV_CALL_ISR);
1497 /* If we're reopening the device we may have multiple queues, fill the
1507 nvchan->channel = device->channel;
1533 ret = vmbus_open(device->channel, netvsc_ring_bytes,
1548 ret = netvsc_connect_vsp(device, net_device, device_info);
1567 vmbus_close(device->channel);