Lines Matching defs:device

104 	/* Avoid deadlock with device removal already under RTNL */
178 static void netvsc_revoke_recv_buf(struct hv_device *device,
203 ret = vmbus_sendpacket(device->channel,
213 if (device->channel->rescind)
228 static void netvsc_revoke_send_buf(struct hv_device *device,
253 ret = vmbus_sendpacket(device->channel,
264 if (device->channel->rescind)
279 static void netvsc_teardown_recv_gpadl(struct hv_device *device,
286 ret = vmbus_teardown_gpadl(device->channel,
300 static void netvsc_teardown_send_gpadl(struct hv_device *device,
307 ret = vmbus_teardown_gpadl(device->channel,
335 static int netvsc_init_buf(struct hv_device *device,
340 struct net_device *ndev = hv_get_drvdata(device);
370 ret = vmbus_establish_gpadl(device->channel, net_device->recv_buf,
391 ret = vmbus_sendpacket(device->channel, init_packet,
473 ret = vmbus_establish_gpadl(device->channel, net_device->send_buf,
493 ret = vmbus_sendpacket(device->channel, init_packet,
544 netvsc_revoke_recv_buf(device, net_device, ndev);
545 netvsc_revoke_send_buf(device, net_device, ndev);
546 netvsc_teardown_recv_gpadl(device, net_device, ndev);
547 netvsc_teardown_send_gpadl(device, net_device, ndev);
554 static int negotiate_nvsp_ver(struct hv_device *device,
559 struct net_device *ndev = hv_get_drvdata(device);
569 ret = vmbus_sendpacket(device->channel, init_packet,
608 ret = vmbus_sendpacket(device->channel, init_packet,
616 static int netvsc_connect_vsp(struct hv_device *device,
620 struct net_device *ndev = hv_get_drvdata(device);
633 if (negotiate_nvsp_ver(device, net_device, init_packet,
672 ret = vmbus_sendpacket(device->channel, init_packet,
680 ret = netvsc_init_buf(device, net_device, device_info);
687 * netvsc_device_remove - Callback when the root bus device is removed
689 void netvsc_device_remove(struct hv_device *device)
691 struct net_device *ndev = hv_get_drvdata(device);
701 netvsc_revoke_recv_buf(device, net_device, ndev);
703 netvsc_teardown_recv_gpadl(device, net_device, ndev);
705 netvsc_revoke_send_buf(device, net_device, ndev);
707 netvsc_teardown_send_gpadl(device, net_device, ndev);
711 /* Disable NAPI and disassociate its context from the device. */
725 netdev_dbg(ndev, "net device safe to remove\n");
728 vmbus_close(device->channel);
735 netvsc_teardown_recv_gpadl(device, net_device, ndev);
736 netvsc_teardown_send_gpadl(device, net_device, ndev);
987 dma_unmap_single(&hv_dev->device, packet->dma_range[i].dma,
1034 dma = dma_map_single(&hv_dev->device, src, len,
1036 if (dma_mapping_error(&hv_dev->device, dma)) {
1053 struct hv_device *device,
1065 struct net_device *ndev = hv_get_drvdata(device);
1190 struct hv_device *device = ndev_ctx->device_ctx;
1200 /* If device is rescinded, return error and packet will get dropped. */
1213 return netvsc_send_pkt(device, packet, net_device, pb, skb);
1287 int m_ret = netvsc_send_pkt(device, msd_send, net_device,
1298 ret = netvsc_send_pkt(device, cur_send, net_device, pb, skb);
1602 static int netvsc_process_raw_pkt(struct hv_device *device,
1652 struct hv_device *device = netvsc_channel_to_device(channel);
1653 struct net_device *ndev = hv_get_drvdata(device);
1664 work_done += netvsc_process_raw_pkt(device, nvchan, net_device,
1714 * netvsc_device_add - Callback when the device belonging to this
1717 struct netvsc_device *netvsc_device_add(struct hv_device *device,
1722 struct net_device *ndev = hv_get_drvdata(device);
1732 /* Because the device uses NAPI, all the interrupt batching and
1735 set_channel_read_mode(device->channel, HV_CALL_ISR);
1737 /* If we're reopening the device we may have multiple queues, fill the
1747 nvchan->channel = device->channel;
1772 device->channel->next_request_id_callback = vmbus_next_request_id;
1773 device->channel->request_addr_callback = vmbus_request_addr;
1774 device->channel->rqstor_size = netvsc_rqstor_size(netvsc_ring_bytes);
1775 device->channel->max_pkt_size = NETVSC_MAX_PKT_SIZE;
1777 ret = vmbus_open(device->channel, netvsc_ring_bytes,
1792 ret = netvsc_connect_vsp(device, net_device, device_info);
1811 vmbus_close(device->channel);