blob: f0358992b04fa820cb083300765271b92823320a [file] [log] [blame]
Ian Campbellf942dc22011-03-15 00:06:18 +00001/*
2 * Xenbus code for netif backend
3 *
4 * Copyright (C) 2005 Rusty Russell <rusty@rustcorp.com.au>
5 * Copyright (C) 2005 XenSource Ltd
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20*/
21
22#include "common.h"
23
24struct backend_info {
25 struct xenbus_device *dev;
26 struct xenvif *vif;
Paul Durrantea732df2013-09-26 12:09:52 +010027
28 /* This is the state that will be reflected in xenstore when any
29 * active hotplug script completes.
30 */
31 enum xenbus_state state;
32
Ian Campbellf942dc22011-03-15 00:06:18 +000033 enum xenbus_state frontend_state;
34 struct xenbus_watch hotplug_status_watch;
Ian Campbell17938a62011-04-03 22:26:24 +000035 u8 have_hotplug_status_watch:1;
Ian Campbellf942dc22011-03-15 00:06:18 +000036};
37
38static int connect_rings(struct backend_info *);
39static void connect(struct backend_info *);
40static void backend_create_xenvif(struct backend_info *be);
41static void unregister_hotplug_status_watch(struct backend_info *be);
David Vrabeldc62cca2013-10-07 13:55:19 +010042static void set_backend_state(struct backend_info *be,
43 enum xenbus_state state);
Ian Campbellf942dc22011-03-15 00:06:18 +000044
45static int netback_remove(struct xenbus_device *dev)
46{
47 struct backend_info *be = dev_get_drvdata(&dev->dev);
48
David Vrabeldc62cca2013-10-07 13:55:19 +010049 set_backend_state(be, XenbusStateClosed);
50
Ian Campbellf942dc22011-03-15 00:06:18 +000051 unregister_hotplug_status_watch(be);
52 if (be->vif) {
53 kobject_uevent(&dev->dev.kobj, KOBJ_OFFLINE);
54 xenbus_rm(XBT_NIL, dev->nodename, "hotplug-status");
Paul Durrant279f4382013-09-17 17:46:08 +010055 xenvif_free(be->vif);
Ian Campbellf942dc22011-03-15 00:06:18 +000056 be->vif = NULL;
57 }
58 kfree(be);
59 dev_set_drvdata(&dev->dev, NULL);
60 return 0;
61}
62
63
64/**
65 * Entry point to this code when a new device is created. Allocate the basic
66 * structures and switch to InitWait.
67 */
68static int netback_probe(struct xenbus_device *dev,
69 const struct xenbus_device_id *id)
70{
71 const char *message;
72 struct xenbus_transaction xbt;
73 int err;
74 int sg;
75 struct backend_info *be = kzalloc(sizeof(struct backend_info),
76 GFP_KERNEL);
77 if (!be) {
78 xenbus_dev_fatal(dev, -ENOMEM,
79 "allocating backend structure");
80 return -ENOMEM;
81 }
82
83 be->dev = dev;
84 dev_set_drvdata(&dev->dev, be);
85
86 sg = 1;
87
88 do {
89 err = xenbus_transaction_start(&xbt);
90 if (err) {
91 xenbus_dev_fatal(dev, err, "starting transaction");
92 goto fail;
93 }
94
95 err = xenbus_printf(xbt, dev->nodename, "feature-sg", "%d", sg);
96 if (err) {
97 message = "writing feature-sg";
98 goto abort_transaction;
99 }
100
101 err = xenbus_printf(xbt, dev->nodename, "feature-gso-tcpv4",
102 "%d", sg);
103 if (err) {
104 message = "writing feature-gso-tcpv4";
105 goto abort_transaction;
106 }
107
Paul Durranta9468582013-10-16 17:50:31 +0100108 err = xenbus_printf(xbt, dev->nodename, "feature-gso-tcpv6",
109 "%d", sg);
110 if (err) {
111 message = "writing feature-gso-tcpv6";
112 goto abort_transaction;
113 }
114
Paul Durrant2eba61d2013-10-16 17:50:29 +0100115 /* We support partial checksum setup for IPv6 packets */
116 err = xenbus_printf(xbt, dev->nodename,
117 "feature-ipv6-csum-offload",
118 "%d", 1);
119 if (err) {
120 message = "writing feature-ipv6-csum-offload";
121 goto abort_transaction;
122 }
123
Ian Campbellf942dc22011-03-15 00:06:18 +0000124 /* We support rx-copy path. */
125 err = xenbus_printf(xbt, dev->nodename,
126 "feature-rx-copy", "%d", 1);
127 if (err) {
128 message = "writing feature-rx-copy";
129 goto abort_transaction;
130 }
131
132 /*
133 * We don't support rx-flip path (except old guests who don't
134 * grok this feature flag).
135 */
136 err = xenbus_printf(xbt, dev->nodename,
137 "feature-rx-flip", "%d", 0);
138 if (err) {
139 message = "writing feature-rx-flip";
140 goto abort_transaction;
141 }
142
143 err = xenbus_transaction_end(xbt, 0);
144 } while (err == -EAGAIN);
145
146 if (err) {
147 xenbus_dev_fatal(dev, err, "completing transaction");
148 goto fail;
149 }
150
Wei Liue1f00a692013-05-22 06:34:45 +0000151 /*
152 * Split event channels support, this is optional so it is not
153 * put inside the above loop.
154 */
155 err = xenbus_printf(XBT_NIL, dev->nodename,
156 "feature-split-event-channels",
157 "%u", separate_tx_rx_irq);
158 if (err)
Wei Liu8ef2c3b2013-07-02 00:08:54 +0100159 pr_debug("Error writing feature-split-event-channels\n");
Wei Liue1f00a692013-05-22 06:34:45 +0000160
Ian Campbellf942dc22011-03-15 00:06:18 +0000161 err = xenbus_switch_state(dev, XenbusStateInitWait);
162 if (err)
163 goto fail;
164
Paul Durrantea732df2013-09-26 12:09:52 +0100165 be->state = XenbusStateInitWait;
166
Ian Campbellf942dc22011-03-15 00:06:18 +0000167 /* This kicks hotplug scripts, so do it immediately. */
168 backend_create_xenvif(be);
169
170 return 0;
171
172abort_transaction:
173 xenbus_transaction_end(xbt, 1);
174 xenbus_dev_fatal(dev, err, "%s", message);
175fail:
Wei Liu8ef2c3b2013-07-02 00:08:54 +0100176 pr_debug("failed\n");
Ian Campbellf942dc22011-03-15 00:06:18 +0000177 netback_remove(dev);
178 return err;
179}
180
181
182/*
183 * Handle the creation of the hotplug script environment. We add the script
184 * and vif variables to the environment, for the benefit of the vif-* hotplug
185 * scripts.
186 */
187static int netback_uevent(struct xenbus_device *xdev,
188 struct kobj_uevent_env *env)
189{
190 struct backend_info *be = dev_get_drvdata(&xdev->dev);
191 char *val;
192
193 val = xenbus_read(XBT_NIL, xdev->nodename, "script", NULL);
194 if (IS_ERR(val)) {
195 int err = PTR_ERR(val);
196 xenbus_dev_fatal(xdev, err, "reading script");
197 return err;
198 } else {
199 if (add_uevent_var(env, "script=%s", val)) {
200 kfree(val);
201 return -ENOMEM;
202 }
203 kfree(val);
204 }
205
206 if (!be || !be->vif)
207 return 0;
208
209 return add_uevent_var(env, "vif=%s", be->vif->dev->name);
210}
211
212
213static void backend_create_xenvif(struct backend_info *be)
214{
215 int err;
216 long handle;
217 struct xenbus_device *dev = be->dev;
218
219 if (be->vif != NULL)
220 return;
221
222 err = xenbus_scanf(XBT_NIL, dev->nodename, "handle", "%li", &handle);
223 if (err != 1) {
224 xenbus_dev_fatal(dev, err, "reading handle");
225 return;
226 }
227
228 be->vif = xenvif_alloc(&dev->dev, dev->otherend_id, handle);
229 if (IS_ERR(be->vif)) {
230 err = PTR_ERR(be->vif);
231 be->vif = NULL;
232 xenbus_dev_fatal(dev, err, "creating interface");
233 return;
234 }
235
236 kobject_uevent(&dev->dev.kobj, KOBJ_ONLINE);
237}
238
Paul Durrantea732df2013-09-26 12:09:52 +0100239static void backend_disconnect(struct backend_info *be)
Ian Campbellf942dc22011-03-15 00:06:18 +0000240{
Paul Durrant279f4382013-09-17 17:46:08 +0100241 if (be->vif)
Ian Campbellf942dc22011-03-15 00:06:18 +0000242 xenvif_disconnect(be->vif);
Paul Durrant279f4382013-09-17 17:46:08 +0100243}
244
Paul Durrantea732df2013-09-26 12:09:52 +0100245static void backend_connect(struct backend_info *be)
Paul Durrant279f4382013-09-17 17:46:08 +0100246{
Paul Durrantea732df2013-09-26 12:09:52 +0100247 if (be->vif)
248 connect(be);
249}
Paul Durrant279f4382013-09-17 17:46:08 +0100250
Paul Durrantea732df2013-09-26 12:09:52 +0100251static inline void backend_switch_state(struct backend_info *be,
252 enum xenbus_state state)
253{
254 struct xenbus_device *dev = be->dev;
255
256 pr_debug("%s -> %s\n", dev->nodename, xenbus_strstate(state));
257 be->state = state;
258
259 /* If we are waiting for a hotplug script then defer the
260 * actual xenbus state change.
261 */
262 if (!be->have_hotplug_status_watch)
263 xenbus_switch_state(dev, state);
264}
265
266/* Handle backend state transitions:
267 *
268 * The backend state starts in InitWait and the following transitions are
269 * allowed.
270 *
271 * InitWait -> Connected
272 *
273 * ^ \ |
274 * | \ |
275 * | \ |
276 * | \ |
277 * | \ |
278 * | \ |
279 * | V V
280 *
281 * Closed <-> Closing
282 *
283 * The state argument specifies the eventual state of the backend and the
284 * function transitions to that state via the shortest path.
285 */
286static void set_backend_state(struct backend_info *be,
287 enum xenbus_state state)
288{
289 while (be->state != state) {
290 switch (be->state) {
291 case XenbusStateClosed:
292 switch (state) {
293 case XenbusStateInitWait:
294 case XenbusStateConnected:
295 pr_info("%s: prepare for reconnect\n",
296 be->dev->nodename);
297 backend_switch_state(be, XenbusStateInitWait);
298 break;
299 case XenbusStateClosing:
300 backend_switch_state(be, XenbusStateClosing);
301 break;
302 default:
303 BUG();
304 }
305 break;
306 case XenbusStateInitWait:
307 switch (state) {
308 case XenbusStateConnected:
309 backend_connect(be);
310 backend_switch_state(be, XenbusStateConnected);
311 break;
312 case XenbusStateClosing:
313 case XenbusStateClosed:
314 backend_switch_state(be, XenbusStateClosing);
315 break;
316 default:
317 BUG();
318 }
319 break;
320 case XenbusStateConnected:
321 switch (state) {
322 case XenbusStateInitWait:
323 case XenbusStateClosing:
324 case XenbusStateClosed:
325 backend_disconnect(be);
326 backend_switch_state(be, XenbusStateClosing);
327 break;
328 default:
329 BUG();
330 }
331 break;
332 case XenbusStateClosing:
333 switch (state) {
334 case XenbusStateInitWait:
335 case XenbusStateConnected:
336 case XenbusStateClosed:
337 backend_switch_state(be, XenbusStateClosed);
338 break;
339 default:
340 BUG();
341 }
342 break;
343 default:
344 BUG();
345 }
Ian Campbellf942dc22011-03-15 00:06:18 +0000346 }
347}
348
349/**
350 * Callback received when the frontend's state changes.
351 */
352static void frontend_changed(struct xenbus_device *dev,
353 enum xenbus_state frontend_state)
354{
355 struct backend_info *be = dev_get_drvdata(&dev->dev);
356
Paul Durrantea732df2013-09-26 12:09:52 +0100357 pr_debug("%s -> %s\n", dev->otherend, xenbus_strstate(frontend_state));
Ian Campbellf942dc22011-03-15 00:06:18 +0000358
359 be->frontend_state = frontend_state;
360
361 switch (frontend_state) {
362 case XenbusStateInitialising:
Paul Durrantea732df2013-09-26 12:09:52 +0100363 set_backend_state(be, XenbusStateInitWait);
Ian Campbellf942dc22011-03-15 00:06:18 +0000364 break;
365
366 case XenbusStateInitialised:
367 break;
368
369 case XenbusStateConnected:
Paul Durrantea732df2013-09-26 12:09:52 +0100370 set_backend_state(be, XenbusStateConnected);
Ian Campbellf942dc22011-03-15 00:06:18 +0000371 break;
372
373 case XenbusStateClosing:
Paul Durrantea732df2013-09-26 12:09:52 +0100374 set_backend_state(be, XenbusStateClosing);
Ian Campbellf942dc22011-03-15 00:06:18 +0000375 break;
376
377 case XenbusStateClosed:
Paul Durrantea732df2013-09-26 12:09:52 +0100378 set_backend_state(be, XenbusStateClosed);
Ian Campbellf942dc22011-03-15 00:06:18 +0000379 if (xenbus_dev_is_online(dev))
380 break;
381 /* fall through if not online */
382 case XenbusStateUnknown:
Paul Durrantea732df2013-09-26 12:09:52 +0100383 set_backend_state(be, XenbusStateClosed);
Ian Campbellf942dc22011-03-15 00:06:18 +0000384 device_unregister(&dev->dev);
385 break;
386
387 default:
388 xenbus_dev_fatal(dev, -EINVAL, "saw state %d at frontend",
389 frontend_state);
390 break;
391 }
392}
393
394
395static void xen_net_read_rate(struct xenbus_device *dev,
396 unsigned long *bytes, unsigned long *usec)
397{
398 char *s, *e;
399 unsigned long b, u;
400 char *ratestr;
401
402 /* Default to unlimited bandwidth. */
403 *bytes = ~0UL;
404 *usec = 0;
405
406 ratestr = xenbus_read(XBT_NIL, dev->nodename, "rate", NULL);
407 if (IS_ERR(ratestr))
408 return;
409
410 s = ratestr;
411 b = simple_strtoul(s, &e, 10);
412 if ((s == e) || (*e != ','))
413 goto fail;
414
415 s = e + 1;
416 u = simple_strtoul(s, &e, 10);
417 if ((s == e) || (*e != '\0'))
418 goto fail;
419
420 *bytes = b;
421 *usec = u;
422
423 kfree(ratestr);
424 return;
425
426 fail:
427 pr_warn("Failed to parse network rate limit. Traffic unlimited.\n");
428 kfree(ratestr);
429}
430
431static int xen_net_read_mac(struct xenbus_device *dev, u8 mac[])
432{
433 char *s, *e, *macstr;
434 int i;
435
436 macstr = s = xenbus_read(XBT_NIL, dev->nodename, "mac", NULL);
437 if (IS_ERR(macstr))
438 return PTR_ERR(macstr);
439
440 for (i = 0; i < ETH_ALEN; i++) {
441 mac[i] = simple_strtoul(s, &e, 16);
442 if ((s == e) || (*e != ((i == ETH_ALEN-1) ? '\0' : ':'))) {
443 kfree(macstr);
444 return -ENOENT;
445 }
446 s = e+1;
447 }
448
449 kfree(macstr);
450 return 0;
451}
452
453static void unregister_hotplug_status_watch(struct backend_info *be)
454{
455 if (be->have_hotplug_status_watch) {
456 unregister_xenbus_watch(&be->hotplug_status_watch);
457 kfree(be->hotplug_status_watch.node);
458 }
459 be->have_hotplug_status_watch = 0;
460}
461
462static void hotplug_status_changed(struct xenbus_watch *watch,
463 const char **vec,
464 unsigned int vec_size)
465{
466 struct backend_info *be = container_of(watch,
467 struct backend_info,
468 hotplug_status_watch);
469 char *str;
470 unsigned int len;
471
472 str = xenbus_read(XBT_NIL, be->dev->nodename, "hotplug-status", &len);
473 if (IS_ERR(str))
474 return;
475 if (len == sizeof("connected")-1 && !memcmp(str, "connected", len)) {
Paul Durrantea732df2013-09-26 12:09:52 +0100476 /* Complete any pending state change */
477 xenbus_switch_state(be->dev, be->state);
478
Ian Campbellf942dc22011-03-15 00:06:18 +0000479 /* Not interested in this watch anymore. */
480 unregister_hotplug_status_watch(be);
481 }
482 kfree(str);
483}
484
485static void connect(struct backend_info *be)
486{
487 int err;
488 struct xenbus_device *dev = be->dev;
489
490 err = connect_rings(be);
491 if (err)
492 return;
493
494 err = xen_net_read_mac(dev, be->vif->fe_dev_addr);
495 if (err) {
496 xenbus_dev_fatal(dev, err, "parsing %s/mac", dev->nodename);
497 return;
498 }
499
500 xen_net_read_rate(dev, &be->vif->credit_bytes,
501 &be->vif->credit_usec);
502 be->vif->remaining_credit = be->vif->credit_bytes;
503
504 unregister_hotplug_status_watch(be);
505 err = xenbus_watch_pathfmt(dev, &be->hotplug_status_watch,
506 hotplug_status_changed,
507 "%s/%s", dev->nodename, "hotplug-status");
Paul Durrantea732df2013-09-26 12:09:52 +0100508 if (!err)
Ian Campbellf942dc22011-03-15 00:06:18 +0000509 be->have_hotplug_status_watch = 1;
Ian Campbellf942dc22011-03-15 00:06:18 +0000510
511 netif_wake_queue(be->vif->dev);
512}
513
514
515static int connect_rings(struct backend_info *be)
516{
517 struct xenvif *vif = be->vif;
518 struct xenbus_device *dev = be->dev;
519 unsigned long tx_ring_ref, rx_ring_ref;
Wei Liue1f00a692013-05-22 06:34:45 +0000520 unsigned int tx_evtchn, rx_evtchn, rx_copy;
Ian Campbellf942dc22011-03-15 00:06:18 +0000521 int err;
522 int val;
523
524 err = xenbus_gather(XBT_NIL, dev->otherend,
525 "tx-ring-ref", "%lu", &tx_ring_ref,
Wei Liue1f00a692013-05-22 06:34:45 +0000526 "rx-ring-ref", "%lu", &rx_ring_ref, NULL);
Ian Campbellf942dc22011-03-15 00:06:18 +0000527 if (err) {
528 xenbus_dev_fatal(dev, err,
Wei Liue1f00a692013-05-22 06:34:45 +0000529 "reading %s/ring-ref",
Ian Campbellf942dc22011-03-15 00:06:18 +0000530 dev->otherend);
531 return err;
532 }
533
Wei Liue1f00a692013-05-22 06:34:45 +0000534 /* Try split event channels first, then single event channel. */
535 err = xenbus_gather(XBT_NIL, dev->otherend,
536 "event-channel-tx", "%u", &tx_evtchn,
537 "event-channel-rx", "%u", &rx_evtchn, NULL);
538 if (err < 0) {
539 err = xenbus_scanf(XBT_NIL, dev->otherend,
540 "event-channel", "%u", &tx_evtchn);
541 if (err < 0) {
542 xenbus_dev_fatal(dev, err,
543 "reading %s/event-channel(-tx/rx)",
544 dev->otherend);
545 return err;
546 }
547 rx_evtchn = tx_evtchn;
548 }
549
Ian Campbellf942dc22011-03-15 00:06:18 +0000550 err = xenbus_scanf(XBT_NIL, dev->otherend, "request-rx-copy", "%u",
551 &rx_copy);
552 if (err == -ENOENT) {
553 err = 0;
554 rx_copy = 0;
555 }
556 if (err < 0) {
557 xenbus_dev_fatal(dev, err, "reading %s/request-rx-copy",
558 dev->otherend);
559 return err;
560 }
561 if (!rx_copy)
562 return -EOPNOTSUPP;
563
564 if (vif->dev->tx_queue_len != 0) {
565 if (xenbus_scanf(XBT_NIL, dev->otherend,
566 "feature-rx-notify", "%d", &val) < 0)
567 val = 0;
568 if (val)
569 vif->can_queue = 1;
570 else
571 /* Must be non-zero for pfifo_fast to work. */
572 vif->dev->tx_queue_len = 1;
573 }
574
575 if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-sg",
576 "%d", &val) < 0)
577 val = 0;
578 vif->can_sg = !!val;
579
Paul Durrant82cada22013-10-16 17:50:32 +0100580 vif->gso_mask = 0;
581 vif->gso_prefix_mask = 0;
582
Ian Campbellf942dc22011-03-15 00:06:18 +0000583 if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-gso-tcpv4",
584 "%d", &val) < 0)
585 val = 0;
Paul Durrant82cada22013-10-16 17:50:32 +0100586 if (val)
587 vif->gso_mask |= GSO_BIT(TCPV4);
Ian Campbellf942dc22011-03-15 00:06:18 +0000588
589 if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-gso-tcpv4-prefix",
590 "%d", &val) < 0)
591 val = 0;
Paul Durrant82cada22013-10-16 17:50:32 +0100592 if (val)
593 vif->gso_prefix_mask |= GSO_BIT(TCPV4);
594
595 if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-gso-tcpv6",
596 "%d", &val) < 0)
597 val = 0;
598 if (val)
599 vif->gso_mask |= GSO_BIT(TCPV6);
600
601 if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-gso-tcpv6-prefix",
602 "%d", &val) < 0)
603 val = 0;
604 if (val)
605 vif->gso_prefix_mask |= GSO_BIT(TCPV6);
606
607 if (vif->gso_mask & vif->gso_prefix_mask) {
608 xenbus_dev_fatal(dev, err,
609 "%s: gso and gso prefix flags are not "
610 "mutually exclusive",
611 dev->otherend);
612 return -EOPNOTSUPP;
613 }
Ian Campbellf942dc22011-03-15 00:06:18 +0000614
615 if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-no-csum-offload",
616 "%d", &val) < 0)
617 val = 0;
Paul Durrant146c8a72013-10-16 17:50:28 +0100618 vif->ip_csum = !val;
619
620 if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-ipv6-csum-offload",
621 "%d", &val) < 0)
622 val = 0;
623 vif->ipv6_csum = !!val;
Ian Campbellf942dc22011-03-15 00:06:18 +0000624
625 /* Map the shared frame, irq etc. */
Wei Liue1f00a692013-05-22 06:34:45 +0000626 err = xenvif_connect(vif, tx_ring_ref, rx_ring_ref,
627 tx_evtchn, rx_evtchn);
Ian Campbellf942dc22011-03-15 00:06:18 +0000628 if (err) {
629 xenbus_dev_fatal(dev, err,
Wei Liue1f00a692013-05-22 06:34:45 +0000630 "mapping shared-frames %lu/%lu port tx %u rx %u",
631 tx_ring_ref, rx_ring_ref,
632 tx_evtchn, rx_evtchn);
Ian Campbellf942dc22011-03-15 00:06:18 +0000633 return err;
634 }
635 return 0;
636}
637
638
639/* ** Driver Registration ** */
640
641
642static const struct xenbus_device_id netback_ids[] = {
643 { "vif" },
644 { "" }
645};
646
647
Jan Beulich73db1442011-12-22 09:08:13 +0000648static DEFINE_XENBUS_DRIVER(netback, ,
Ian Campbellf942dc22011-03-15 00:06:18 +0000649 .probe = netback_probe,
650 .remove = netback_remove,
651 .uevent = netback_uevent,
652 .otherend_changed = frontend_changed,
Jan Beulich73db1442011-12-22 09:08:13 +0000653);
Ian Campbellf942dc22011-03-15 00:06:18 +0000654
655int xenvif_xenbus_init(void)
656{
Jan Beulich73db1442011-12-22 09:08:13 +0000657 return xenbus_register_backend(&netback_driver);
Ian Campbellf942dc22011-03-15 00:06:18 +0000658}
Wei Liub103f352013-05-16 23:26:11 +0000659
660void xenvif_xenbus_fini(void)
661{
662 return xenbus_unregister_driver(&netback_driver);
663}