Deleted Added
full compact
xenbusb.c (222975) xenbusb.c (225704)
1/******************************************************************************
2 * Copyright (C) 2010 Spectra Logic Corporation
3 * Copyright (C) 2008 Doug Rabson
4 * Copyright (C) 2005 Rusty Russell, IBM Corporation
5 * Copyright (C) 2005 Mike Wray, Hewlett-Packard
6 * Copyright (C) 2005 XenSource Ltd
7 *
8 * This file may be distributed separately from the Linux kernel, or

--- 38 unchanged lines hidden (view full) ---

47 * xbd0
48 * xbd1
49 * xenbusb_back0/
50 * xbbd0
51 * xnb0
52 * xnb1
53 */
54#include <sys/cdefs.h>
1/******************************************************************************
2 * Copyright (C) 2010 Spectra Logic Corporation
3 * Copyright (C) 2008 Doug Rabson
4 * Copyright (C) 2005 Rusty Russell, IBM Corporation
5 * Copyright (C) 2005 Mike Wray, Hewlett-Packard
6 * Copyright (C) 2005 XenSource Ltd
7 *
8 * This file may be distributed separately from the Linux kernel, or

--- 38 unchanged lines hidden (view full) ---

47 * xbd0
48 * xbd1
49 * xenbusb_back0/
50 * xbbd0
51 * xnb0
52 * xnb1
53 */
54#include <sys/cdefs.h>
55__FBSDID("$FreeBSD: head/sys/xen/xenbus/xenbusb.c 222975 2011-06-11 04:59:01Z gibbs $");
55__FBSDID("$FreeBSD: head/sys/xen/xenbus/xenbusb.c 225704 2011-09-20 23:44:34Z gibbs $");
56
57#include <sys/param.h>
58#include <sys/bus.h>
59#include <sys/kernel.h>
60#include <sys/lock.h>
61#include <sys/malloc.h>
62#include <sys/module.h>
63#include <sys/sbuf.h>

--- 704 unchanged lines hidden (view full) ---

768 if (device_get_children(dev, &kids, &count) == 0) {
769 for (i = 0; i < count; i++) {
770 if (device_get_state(kids[i]) == DS_NOTPRESENT)
771 continue;
772
773 ivars = device_get_ivars(kids[i]);
774
775 xs_unregister_watch(&ivars->xd_otherend_watch);
56
57#include <sys/param.h>
58#include <sys/bus.h>
59#include <sys/kernel.h>
60#include <sys/lock.h>
61#include <sys/malloc.h>
62#include <sys/module.h>
63#include <sys/sbuf.h>

--- 704 unchanged lines hidden (view full) ---

768 if (device_get_children(dev, &kids, &count) == 0) {
769 for (i = 0; i < count; i++) {
770 if (device_get_state(kids[i]) == DS_NOTPRESENT)
771 continue;
772
773 ivars = device_get_ivars(kids[i]);
774
775 xs_unregister_watch(&ivars->xd_otherend_watch);
776 ivars->xd_state = XenbusStateInitialising;
776 xenbus_set_state(kids[i], XenbusStateInitialising);
777
778 /*
779 * Find the new backend details and
780 * re-register our watch.
781 */
782 error = XENBUSB_GET_OTHEREND_NODE(dev, ivars);
783 if (error)
784 return (error);
785
777
778 /*
779 * Find the new backend details and
780 * re-register our watch.
781 */
782 error = XENBUSB_GET_OTHEREND_NODE(dev, ivars);
783 if (error)
784 return (error);
785
786 DEVICE_RESUME(kids[i]);
787
788 statepath = malloc(ivars->xd_otherend_path_len
789 + strlen("/state") + 1, M_XENBUS, M_WAITOK);
790 sprintf(statepath, "%s/state", ivars->xd_otherend_path);
791
792 free(ivars->xd_otherend_watch.node, M_XENBUS);
793 ivars->xd_otherend_watch.node = statepath;
786 statepath = malloc(ivars->xd_otherend_path_len
787 + strlen("/state") + 1, M_XENBUS, M_WAITOK);
788 sprintf(statepath, "%s/state", ivars->xd_otherend_path);
789
790 free(ivars->xd_otherend_watch.node, M_XENBUS);
791 ivars->xd_otherend_watch.node = statepath;
794 xs_register_watch(&ivars->xd_otherend_watch);
795
792
793 DEVICE_RESUME(kids[i]);
794
795 xs_register_watch(&ivars->xd_otherend_watch);
796#if 0
797 /*
798 * Can't do this yet since we are running in
799 * the xenwatch thread and if we sleep here,
800 * we will stop delivering watch notifications
801 * and the device will never come back online.
802 */
803 sx_xlock(&ivars->xd_lock);

--- 146 unchanged lines hidden ---
796#if 0
797 /*
798 * Can't do this yet since we are running in
799 * the xenwatch thread and if we sleep here,
800 * we will stop delivering watch notifications
801 * and the device will never come back online.
802 */
803 sx_xlock(&ivars->xd_lock);

--- 146 unchanged lines hidden ---