]>
Commit | Line | Data |
---|---|---|
fceaf24a | 1 | /* |
fceaf24a HJ |
2 | * Copyright (c) 2009, Microsoft Corporation. |
3 | * | |
4 | * This program is free software; you can redistribute it and/or modify it | |
5 | * under the terms and conditions of the GNU General Public License, | |
6 | * version 2, as published by the Free Software Foundation. | |
7 | * | |
8 | * This program is distributed in the hope it will be useful, but WITHOUT | |
9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | |
11 | * more details. | |
12 | * | |
13 | * You should have received a copy of the GNU General Public License along with | |
14 | * this program; if not, write to the Free Software Foundation, Inc., 59 Temple | |
15 | * Place - Suite 330, Boston, MA 02111-1307 USA. | |
16 | * | |
17 | * Authors: | |
d0e94d17 | 18 | * Haiyang Zhang <haiyangz@microsoft.com> |
fceaf24a | 19 | * Hank Janssen <hjanssen@microsoft.com> |
fceaf24a | 20 | */ |
eb335bc4 HJ |
21 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
22 | ||
fceaf24a HJ |
23 | #include <linux/init.h> |
24 | #include <linux/module.h> | |
25 | #include <linux/highmem.h> | |
26 | #include <linux/device.h> | |
fceaf24a | 27 | #include <linux/io.h> |
fceaf24a HJ |
28 | #include <linux/delay.h> |
29 | #include <linux/netdevice.h> | |
30 | #include <linux/inetdevice.h> | |
31 | #include <linux/etherdevice.h> | |
32 | #include <linux/skbuff.h> | |
33 | #include <linux/in.h> | |
5a0e3ad6 | 34 | #include <linux/slab.h> |
06e719d8 S |
35 | #include <linux/dmi.h> |
36 | #include <linux/pci.h> | |
fceaf24a HJ |
37 | #include <net/arp.h> |
38 | #include <net/route.h> | |
39 | #include <net/sock.h> | |
40 | #include <net/pkt_sched.h> | |
3f335ea2 S |
41 | |
42 | #include "hyperv.h" | |
5ca7252a | 43 | #include "hyperv_net.h" |
fceaf24a | 44 | |
fceaf24a | 45 | struct net_device_context { |
02fafbc6 | 46 | /* point back to our device context */ |
6bad88da | 47 | struct hv_device *device_ctx; |
b220f5f9 | 48 | unsigned long avail; |
c996edcf | 49 | struct work_struct work; |
fceaf24a HJ |
50 | }; |
51 | ||
fceaf24a | 52 | |
b220f5f9 SH |
53 | #define PACKET_PAGES_LOWATER 8 |
54 | /* Need this many pages to handle worst case fragmented packet */ | |
55 | #define PACKET_PAGES_HIWATER (MAX_SKB_FRAGS + 2) | |
56 | ||
99c8da0f | 57 | static int ring_size = 128; |
450d7a4b SH |
58 | module_param(ring_size, int, S_IRUGO); |
59 | MODULE_PARM_DESC(ring_size, "Ring buffer size (# of pages)"); | |
fceaf24a | 60 | |
0ff36f69 BP |
61 | /* no-op so the netdev core doesn't return -EINVAL when modifying the the |
62 | * multicast address list in SIOCADDMULTI. hv is setup to get all multicast | |
63 | * when it calls RndisFilterOnOpen() */ | |
4e9bfefa | 64 | static void netvsc_set_multicast_list(struct net_device *net) |
fceaf24a HJ |
65 | { |
66 | } | |
67 | ||
fceaf24a HJ |
68 | static int netvsc_open(struct net_device *net) |
69 | { | |
fceaf24a | 70 | struct net_device_context *net_device_ctx = netdev_priv(net); |
6bad88da | 71 | struct hv_device *device_obj = net_device_ctx->device_ctx; |
02fafbc6 | 72 | int ret = 0; |
fceaf24a | 73 | |
02fafbc6 | 74 | if (netif_carrier_ok(net)) { |
454f18a9 | 75 | /* Open up the device */ |
9c26aa0d | 76 | ret = rndis_filter_open(device_obj); |
02fafbc6 | 77 | if (ret != 0) { |
eb335bc4 HJ |
78 | netdev_err(net, "unable to open device (ret %d).\n", |
79 | ret); | |
fceaf24a HJ |
80 | return ret; |
81 | } | |
82 | ||
83 | netif_start_queue(net); | |
02fafbc6 | 84 | } else { |
eb335bc4 | 85 | netdev_err(net, "unable to open device...link is down.\n"); |
fceaf24a HJ |
86 | } |
87 | ||
fceaf24a HJ |
88 | return ret; |
89 | } | |
90 | ||
fceaf24a HJ |
91 | static int netvsc_close(struct net_device *net) |
92 | { | |
fceaf24a | 93 | struct net_device_context *net_device_ctx = netdev_priv(net); |
6bad88da | 94 | struct hv_device *device_obj = net_device_ctx->device_ctx; |
02fafbc6 | 95 | int ret; |
fceaf24a | 96 | |
fceaf24a HJ |
97 | netif_stop_queue(net); |
98 | ||
9c26aa0d | 99 | ret = rndis_filter_close(device_obj); |
fceaf24a | 100 | if (ret != 0) |
eb335bc4 | 101 | netdev_err(net, "unable to close device (ret %d).\n", ret); |
fceaf24a | 102 | |
fceaf24a HJ |
103 | return ret; |
104 | } | |
105 | ||
fceaf24a HJ |
106 | static void netvsc_xmit_completion(void *context) |
107 | { | |
4193d4f4 | 108 | struct hv_netvsc_packet *packet = (struct hv_netvsc_packet *)context; |
02fafbc6 | 109 | struct sk_buff *skb = (struct sk_buff *) |
72a2f5bd | 110 | (unsigned long)packet->completion.send.send_completion_tid; |
fceaf24a | 111 | |
fceaf24a HJ |
112 | kfree(packet); |
113 | ||
02fafbc6 | 114 | if (skb) { |
7880fc54 | 115 | struct net_device *net = skb->dev; |
b220f5f9 SH |
116 | struct net_device_context *net_device_ctx = netdev_priv(net); |
117 | unsigned int num_pages = skb_shinfo(skb)->nr_frags + 2; | |
fceaf24a | 118 | |
b220f5f9 | 119 | dev_kfree_skb_any(skb); |
fceaf24a | 120 | |
581de3b0 TH |
121 | net_device_ctx->avail += num_pages; |
122 | if (net_device_ctx->avail >= PACKET_PAGES_HIWATER) | |
b220f5f9 | 123 | netif_wake_queue(net); |
fceaf24a | 124 | } |
fceaf24a HJ |
125 | } |
126 | ||
02fafbc6 | 127 | static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net) |
fceaf24a | 128 | { |
fceaf24a | 129 | struct net_device_context *net_device_ctx = netdev_priv(net); |
4193d4f4 | 130 | struct hv_netvsc_packet *packet; |
02fafbc6 | 131 | int ret; |
6048718d | 132 | unsigned int i, num_pages; |
fceaf24a | 133 | |
6048718d SH |
134 | /* Add 1 for skb->data and additional one for RNDIS */ |
135 | num_pages = skb_shinfo(skb)->nr_frags + 1 + 1; | |
b220f5f9 SH |
136 | if (num_pages > net_device_ctx->avail) |
137 | return NETDEV_TX_BUSY; | |
fceaf24a | 138 | |
454f18a9 | 139 | /* Allocate a netvsc packet based on # of frags. */ |
02fafbc6 | 140 | packet = kzalloc(sizeof(struct hv_netvsc_packet) + |
6048718d | 141 | (num_pages * sizeof(struct hv_page_buffer)) + |
f8ba8c70 | 142 | sizeof(struct rndis_filter_packet), GFP_ATOMIC); |
02fafbc6 | 143 | if (!packet) { |
b220f5f9 | 144 | /* out of memory, silently drop packet */ |
eb335bc4 | 145 | netdev_err(net, "unable to allocate hv_netvsc_packet\n"); |
b220f5f9 SH |
146 | |
147 | dev_kfree_skb(skb); | |
148 | net->stats.tx_dropped++; | |
149 | return NETDEV_TX_OK; | |
fceaf24a HJ |
150 | } |
151 | ||
72a2f5bd | 152 | packet->extension = (void *)(unsigned long)packet + |
02fafbc6 | 153 | sizeof(struct hv_netvsc_packet) + |
6048718d | 154 | (num_pages * sizeof(struct hv_page_buffer)); |
fceaf24a | 155 | |
454f18a9 | 156 | /* Setup the rndis header */ |
72a2f5bd | 157 | packet->page_buf_cnt = num_pages; |
fceaf24a | 158 | |
454f18a9 BP |
159 | /* TODO: Flush all write buffers/ memory fence ??? */ |
160 | /* wmb(); */ | |
fceaf24a | 161 | |
454f18a9 | 162 | /* Initialize it from the skb */ |
72a2f5bd | 163 | packet->total_data_buflen = skb->len; |
fceaf24a | 164 | |
6048718d | 165 | /* Start filling in the page buffers starting after RNDIS buffer. */ |
ca623ad3 HZ |
166 | packet->page_buf[1].pfn = virt_to_phys(skb->data) >> PAGE_SHIFT; |
167 | packet->page_buf[1].offset | |
6048718d | 168 | = (unsigned long)skb->data & (PAGE_SIZE - 1); |
ca623ad3 | 169 | packet->page_buf[1].len = skb_headlen(skb); |
6048718d SH |
170 | |
171 | /* Additional fragments are after SKB data */ | |
172 | for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { | |
173 | skb_frag_t *f = &skb_shinfo(skb)->frags[i]; | |
174 | ||
ca623ad3 HZ |
175 | packet->page_buf[i+2].pfn = page_to_pfn(f->page); |
176 | packet->page_buf[i+2].offset = f->page_offset; | |
177 | packet->page_buf[i+2].len = f->size; | |
fceaf24a HJ |
178 | } |
179 | ||
454f18a9 | 180 | /* Set the completion routine */ |
72a2f5bd HZ |
181 | packet->completion.send.send_completion = netvsc_xmit_completion; |
182 | packet->completion.send.send_completion_ctx = packet; | |
183 | packet->completion.send.send_completion_tid = (unsigned long)skb; | |
fceaf24a | 184 | |
55acb696 | 185 | ret = rndis_filter_send(net_device_ctx->device_ctx, |
02fafbc6 | 186 | packet); |
02fafbc6 | 187 | if (ret == 0) { |
b852fdce SH |
188 | net->stats.tx_bytes += skb->len; |
189 | net->stats.tx_packets++; | |
fceaf24a | 190 | |
581de3b0 TH |
191 | net_device_ctx->avail -= num_pages; |
192 | if (net_device_ctx->avail < PACKET_PAGES_LOWATER) | |
b220f5f9 SH |
193 | netif_stop_queue(net); |
194 | } else { | |
195 | /* we are shutting down or bus overloaded, just drop packet */ | |
b852fdce | 196 | net->stats.tx_dropped++; |
b220f5f9 | 197 | netvsc_xmit_completion(packet); |
fceaf24a HJ |
198 | } |
199 | ||
b220f5f9 | 200 | return NETDEV_TX_OK; |
fceaf24a HJ |
201 | } |
202 | ||
3e189519 | 203 | /* |
02fafbc6 GKH |
204 | * netvsc_linkstatus_callback - Link up/down notification |
205 | */ | |
90ef117a | 206 | void netvsc_linkstatus_callback(struct hv_device *device_obj, |
02fafbc6 | 207 | unsigned int status) |
fceaf24a | 208 | { |
6bad88da | 209 | struct net_device *net = dev_get_drvdata(&device_obj->device); |
c996edcf | 210 | struct net_device_context *ndev_ctx; |
fceaf24a | 211 | |
02fafbc6 | 212 | if (!net) { |
eb335bc4 HJ |
213 | netdev_err(net, "got link status but net device " |
214 | "not initialized yet\n"); | |
fceaf24a HJ |
215 | return; |
216 | } | |
217 | ||
02fafbc6 | 218 | if (status == 1) { |
fceaf24a HJ |
219 | netif_carrier_on(net); |
220 | netif_wake_queue(net); | |
7c161d0b | 221 | netif_notify_peers(net); |
c996edcf HZ |
222 | ndev_ctx = netdev_priv(net); |
223 | schedule_work(&ndev_ctx->work); | |
02fafbc6 | 224 | } else { |
fceaf24a HJ |
225 | netif_carrier_off(net); |
226 | netif_stop_queue(net); | |
227 | } | |
fceaf24a HJ |
228 | } |
229 | ||
3e189519 HJ |
230 | /* |
231 | * netvsc_recv_callback - Callback when we receive a packet from the | |
232 | * "wire" on the specified device. | |
02fafbc6 | 233 | */ |
f79adf8f | 234 | int netvsc_recv_callback(struct hv_device *device_obj, |
02fafbc6 | 235 | struct hv_netvsc_packet *packet) |
fceaf24a | 236 | { |
6bad88da | 237 | struct net_device *net = dev_get_drvdata(&device_obj->device); |
fceaf24a HJ |
238 | struct sk_buff *skb; |
239 | void *data; | |
02fafbc6 | 240 | int i; |
fceaf24a HJ |
241 | unsigned long flags; |
242 | ||
02fafbc6 | 243 | if (!net) { |
eb335bc4 HJ |
244 | netdev_err(net, "got receive callback but net device" |
245 | " not initialized yet\n"); | |
fceaf24a HJ |
246 | return 0; |
247 | } | |
248 | ||
9495c282 | 249 | /* Allocate a skb - TODO direct I/O to pages? */ |
72a2f5bd | 250 | skb = netdev_alloc_skb_ip_align(net, packet->total_data_buflen); |
9495c282 SH |
251 | if (unlikely(!skb)) { |
252 | ++net->stats.rx_dropped; | |
253 | return 0; | |
254 | } | |
fceaf24a | 255 | |
454f18a9 | 256 | /* for kmap_atomic */ |
fceaf24a HJ |
257 | local_irq_save(flags); |
258 | ||
02fafbc6 GKH |
259 | /* |
260 | * Copy to skb. This copy is needed here since the memory pointed by | |
261 | * hv_netvsc_packet cannot be deallocated | |
262 | */ | |
72a2f5bd | 263 | for (i = 0; i < packet->page_buf_cnt; i++) { |
ca623ad3 | 264 | data = kmap_atomic(pfn_to_page(packet->page_buf[i].pfn), |
02fafbc6 GKH |
265 | KM_IRQ1); |
266 | data = (void *)(unsigned long)data + | |
ca623ad3 | 267 | packet->page_buf[i].offset; |
02fafbc6 | 268 | |
ca623ad3 HZ |
269 | memcpy(skb_put(skb, packet->page_buf[i].len), data, |
270 | packet->page_buf[i].len); | |
02fafbc6 GKH |
271 | |
272 | kunmap_atomic((void *)((unsigned long)data - | |
ca623ad3 | 273 | packet->page_buf[i].offset), KM_IRQ1); |
fceaf24a HJ |
274 | } |
275 | ||
276 | local_irq_restore(flags); | |
277 | ||
278 | skb->protocol = eth_type_trans(skb, net); | |
fceaf24a HJ |
279 | skb->ip_summed = CHECKSUM_NONE; |
280 | ||
9495c282 SH |
281 | net->stats.rx_packets++; |
282 | net->stats.rx_bytes += skb->len; | |
283 | ||
02fafbc6 GKH |
284 | /* |
285 | * Pass the skb back up. Network stack will deallocate the skb when it | |
9495c282 SH |
286 | * is done. |
287 | * TODO - use NAPI? | |
02fafbc6 | 288 | */ |
9495c282 | 289 | netif_rx(skb); |
fceaf24a | 290 | |
fceaf24a HJ |
291 | return 0; |
292 | } | |
293 | ||
f82f4ad7 SH |
294 | static void netvsc_get_drvinfo(struct net_device *net, |
295 | struct ethtool_drvinfo *info) | |
296 | { | |
297 | strcpy(info->driver, "hv_netvsc"); | |
298 | strcpy(info->version, HV_DRV_VERSION); | |
299 | strcpy(info->fw_version, "N/A"); | |
300 | } | |
301 | ||
302 | static const struct ethtool_ops ethtool_ops = { | |
303 | .get_drvinfo = netvsc_get_drvinfo, | |
f82f4ad7 SH |
304 | .get_link = ethtool_op_get_link, |
305 | }; | |
306 | ||
df2fff28 GKH |
307 | static const struct net_device_ops device_ops = { |
308 | .ndo_open = netvsc_open, | |
309 | .ndo_stop = netvsc_close, | |
310 | .ndo_start_xmit = netvsc_start_xmit, | |
df2fff28 | 311 | .ndo_set_multicast_list = netvsc_set_multicast_list, |
b681b588 HZ |
312 | .ndo_change_mtu = eth_change_mtu, |
313 | .ndo_validate_addr = eth_validate_addr, | |
314 | .ndo_set_mac_address = eth_mac_addr, | |
df2fff28 GKH |
315 | }; |
316 | ||
c996edcf HZ |
317 | /* |
318 | * Send GARP packet to network peers after migrations. | |
319 | * After Quick Migration, the network is not immediately operational in the | |
320 | * current context when receiving RNDIS_STATUS_MEDIA_CONNECT event. So, add | |
321 | * another netif_notify_peers() into a scheduled work, otherwise GARP packet | |
322 | * will not be sent after quick migration, and cause network disconnection. | |
323 | */ | |
324 | static void netvsc_send_garp(struct work_struct *w) | |
325 | { | |
326 | struct net_device_context *ndev_ctx; | |
327 | struct net_device *net; | |
328 | ||
329 | msleep(20); | |
330 | ndev_ctx = container_of(w, struct net_device_context, work); | |
331 | net = dev_get_drvdata(&ndev_ctx->device_ctx->device); | |
332 | netif_notify_peers(net); | |
333 | } | |
334 | ||
335 | ||
9efd21e1 | 336 | static int netvsc_probe(struct hv_device *dev) |
df2fff28 | 337 | { |
df2fff28 GKH |
338 | struct net_device *net = NULL; |
339 | struct net_device_context *net_device_ctx; | |
340 | struct netvsc_device_info device_info; | |
341 | int ret; | |
342 | ||
546d9e10 | 343 | net = alloc_etherdev(sizeof(struct net_device_context)); |
df2fff28 GKH |
344 | if (!net) |
345 | return -1; | |
346 | ||
347 | /* Set initial state */ | |
348 | netif_carrier_off(net); | |
df2fff28 GKH |
349 | |
350 | net_device_ctx = netdev_priv(net); | |
9efd21e1 | 351 | net_device_ctx->device_ctx = dev; |
b220f5f9 | 352 | net_device_ctx->avail = ring_size; |
9efd21e1 | 353 | dev_set_drvdata(&dev->device, net); |
c996edcf | 354 | INIT_WORK(&net_device_ctx->work, netvsc_send_garp); |
df2fff28 GKH |
355 | |
356 | /* Notify the netvsc driver of the new device */ | |
aae23986 | 357 | device_info.ring_size = ring_size; |
bc2d5975 | 358 | ret = rndis_filte_device_add(dev, &device_info); |
df2fff28 GKH |
359 | if (ret != 0) { |
360 | free_netdev(net); | |
9efd21e1 | 361 | dev_set_drvdata(&dev->device, NULL); |
df2fff28 | 362 | |
eb335bc4 | 363 | netdev_err(net, "unable to add netvsc device (ret %d)\n", ret); |
df2fff28 GKH |
364 | return ret; |
365 | } | |
366 | ||
367 | /* | |
368 | * If carrier is still off ie we did not get a link status callback, | |
369 | * update it if necessary | |
370 | */ | |
371 | /* | |
372 | * FIXME: We should use a atomic or test/set instead to avoid getting | |
373 | * out of sync with the device's link status | |
374 | */ | |
375 | if (!netif_carrier_ok(net)) | |
72a2f5bd | 376 | if (!device_info.link_state) |
df2fff28 GKH |
377 | netif_carrier_on(net); |
378 | ||
72a2f5bd | 379 | memcpy(net->dev_addr, device_info.mac_adr, ETH_ALEN); |
df2fff28 GKH |
380 | |
381 | net->netdev_ops = &device_ops; | |
382 | ||
6048718d | 383 | /* TODO: Add GSO and Checksum offload */ |
877a344b | 384 | net->hw_features = NETIF_F_SG; |
6048718d SH |
385 | net->features = NETIF_F_SG; |
386 | ||
f82f4ad7 | 387 | SET_ETHTOOL_OPS(net, ðtool_ops); |
9efd21e1 | 388 | SET_NETDEV_DEV(net, &dev->device); |
df2fff28 GKH |
389 | |
390 | ret = register_netdev(net); | |
391 | if (ret != 0) { | |
392 | /* Remove the device and release the resource */ | |
58de3fc6 | 393 | rndis_filter_device_remove(dev); |
df2fff28 GKH |
394 | free_netdev(net); |
395 | } | |
396 | ||
df2fff28 GKH |
397 | return ret; |
398 | } | |
399 | ||
415b023a | 400 | static int netvsc_remove(struct hv_device *dev) |
df2fff28 | 401 | { |
415b023a | 402 | struct net_device *net = dev_get_drvdata(&dev->device); |
df2fff28 GKH |
403 | int ret; |
404 | ||
df2fff28 | 405 | if (net == NULL) { |
415b023a | 406 | dev_err(&dev->device, "No net device to remove\n"); |
df2fff28 GKH |
407 | return 0; |
408 | } | |
409 | ||
df2fff28 GKH |
410 | /* Stop outbound asap */ |
411 | netif_stop_queue(net); | |
412 | /* netif_carrier_off(net); */ | |
413 | ||
414 | unregister_netdev(net); | |
415 | ||
416 | /* | |
417 | * Call to the vsc driver to let it know that the device is being | |
418 | * removed | |
419 | */ | |
58de3fc6 | 420 | ret = rndis_filter_device_remove(dev); |
df2fff28 GKH |
421 | if (ret != 0) { |
422 | /* TODO: */ | |
eb335bc4 | 423 | netdev_err(net, "unable to remove vsc device (ret %d)\n", ret); |
df2fff28 GKH |
424 | } |
425 | ||
426 | free_netdev(net); | |
df2fff28 GKH |
427 | return ret; |
428 | } | |
429 | ||
f1542a66 | 430 | /* The one and only one */ |
fde0ef9b S |
431 | static struct hv_driver netvsc_drv = { |
432 | .probe = netvsc_probe, | |
433 | .remove = netvsc_remove, | |
d4890970 | 434 | }; |
f1542a66 | 435 | |
bd1de709 | 436 | static void netvsc_drv_exit(void) |
fceaf24a | 437 | { |
fde0ef9b | 438 | vmbus_child_driver_unregister(&netvsc_drv.driver); |
fceaf24a HJ |
439 | } |
440 | ||
4753ff6a S |
441 | |
442 | static const struct dmi_system_id __initconst | |
443 | hv_netvsc_dmi_table[] __maybe_unused = { | |
444 | { | |
445 | .ident = "Hyper-V", | |
446 | .matches = { | |
447 | DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"), | |
448 | DMI_MATCH(DMI_PRODUCT_NAME, "Virtual Machine"), | |
449 | DMI_MATCH(DMI_BOARD_NAME, "Virtual Machine"), | |
450 | }, | |
451 | }, | |
452 | { }, | |
453 | }; | |
454 | MODULE_DEVICE_TABLE(dmi, hv_netvsc_dmi_table); | |
455 | ||
1fde28cf | 456 | static int __init netvsc_drv_init(void) |
df2fff28 | 457 | { |
fde0ef9b | 458 | struct hv_driver *drv = &netvsc_drv; |
df2fff28 GKH |
459 | int ret; |
460 | ||
bb546d0e S |
461 | pr_info("initializing...."); |
462 | ||
463 | if (!dmi_check_system(hv_netvsc_dmi_table)) | |
464 | return -ENODEV; | |
465 | ||
466 | ||
df2fff28 | 467 | /* Callback to client driver to complete the initialization */ |
073aad34 | 468 | netvsc_initialize(drv); |
df2fff28 | 469 | |
fde0ef9b | 470 | drv->driver.name = drv->name; |
df2fff28 | 471 | |
df2fff28 | 472 | /* The driver belongs to vmbus */ |
150f9398 | 473 | ret = vmbus_child_driver_register(&drv->driver); |
df2fff28 | 474 | |
df2fff28 GKH |
475 | return ret; |
476 | } | |
477 | ||
fceaf24a HJ |
478 | static void __exit netvsc_exit(void) |
479 | { | |
fceaf24a | 480 | netvsc_drv_exit(); |
fceaf24a HJ |
481 | } |
482 | ||
06e719d8 S |
483 | static const struct pci_device_id __initconst |
484 | hv_netvsc_pci_table[] __maybe_unused = { | |
485 | { PCI_DEVICE(0x1414, 0x5353) }, /* VGA compatible controller */ | |
486 | { 0 } | |
487 | }; | |
488 | MODULE_DEVICE_TABLE(pci, hv_netvsc_pci_table); | |
489 | ||
26c14cc1 HJ |
490 | MODULE_LICENSE("GPL"); |
491 | MODULE_VERSION(HV_DRV_VERSION); | |
7880fc54 | 492 | MODULE_DESCRIPTION("Microsoft Hyper-V network driver"); |
fceaf24a | 493 | |
1fde28cf | 494 | module_init(netvsc_drv_init); |
fceaf24a | 495 | module_exit(netvsc_exit); |