hvt                63 drivers/hv/hv_fcopy.c static struct hvutil_transport *hvt;
hvt               103 drivers/hv/hv_fcopy.c 		if (hvutil_transport_send(hvt, &our_ver, sizeof(our_ver),
hvt               174 drivers/hv/hv_fcopy.c 	rc = hvutil_transport_send(hvt, out_src, out_len, NULL);
hvt               340 drivers/hv/hv_fcopy.c 	hvt = hvutil_transport_init(fcopy_devname, 0, 0,
hvt               342 drivers/hv/hv_fcopy.c 	if (!hvt)
hvt               352 drivers/hv/hv_fcopy.c 	hvutil_transport_destroy(hvt);
hvt               103 drivers/hv/hv_kvp.c static struct hvutil_transport *hvt;
hvt               143 drivers/hv/hv_kvp.c 		hvutil_transport_send(hvt, kvp_msg, sizeof(*kvp_msg),
hvt               496 drivers/hv/hv_kvp.c 	rc = hvutil_transport_send(hvt, message, sizeof(*message), NULL);
hvt               752 drivers/hv/hv_kvp.c 	hvt = hvutil_transport_init(kvp_devname, CN_KVP_IDX, CN_KVP_VAL,
hvt               754 drivers/hv/hv_kvp.c 	if (!hvt)
hvt               766 drivers/hv/hv_kvp.c 	hvutil_transport_destroy(hvt);
hvt                70 drivers/hv/hv_snapshot.c static struct hvutil_transport *hvt;
hvt               117 drivers/hv/hv_snapshot.c 		if (hvutil_transport_send(hvt, &our_ver, sizeof(our_ver),
hvt               194 drivers/hv/hv_snapshot.c 	rc = hvutil_transport_send(hvt, vss_msg, sizeof(*vss_msg), NULL);
hvt               371 drivers/hv/hv_snapshot.c 	hvt = hvutil_transport_init(vss_devname, CN_VSS_IDX, CN_VSS_VAL,
hvt               373 drivers/hv/hv_snapshot.c 	if (!hvt) {
hvt               386 drivers/hv/hv_snapshot.c 	hvutil_transport_destroy(hvt);
hvt                18 drivers/hv/hv_utils_transport.c static void hvt_reset(struct hvutil_transport *hvt)
hvt                20 drivers/hv/hv_utils_transport.c 	kfree(hvt->outmsg);
hvt                21 drivers/hv/hv_utils_transport.c 	hvt->outmsg = NULL;
hvt                22 drivers/hv/hv_utils_transport.c 	hvt->outmsg_len = 0;
hvt                23 drivers/hv/hv_utils_transport.c 	if (hvt->on_reset)
hvt                24 drivers/hv/hv_utils_transport.c 		hvt->on_reset();
hvt                30 drivers/hv/hv_utils_transport.c 	struct hvutil_transport *hvt;
hvt                33 drivers/hv/hv_utils_transport.c 	hvt = container_of(file->f_op, struct hvutil_transport, fops);
hvt                35 drivers/hv/hv_utils_transport.c 	if (wait_event_interruptible(hvt->outmsg_q, hvt->outmsg_len > 0 ||
hvt                36 drivers/hv/hv_utils_transport.c 				     hvt->mode != HVUTIL_TRANSPORT_CHARDEV))
hvt                39 drivers/hv/hv_utils_transport.c 	mutex_lock(&hvt->lock);
hvt                41 drivers/hv/hv_utils_transport.c 	if (hvt->mode == HVUTIL_TRANSPORT_DESTROY) {
hvt                46 drivers/hv/hv_utils_transport.c 	if (!hvt->outmsg) {
hvt                51 drivers/hv/hv_utils_transport.c 	if (count < hvt->outmsg_len) {
hvt                56 drivers/hv/hv_utils_transport.c 	if (!copy_to_user(buf, hvt->outmsg, hvt->outmsg_len))
hvt                57 drivers/hv/hv_utils_transport.c 		ret = hvt->outmsg_len;
hvt                61 drivers/hv/hv_utils_transport.c 	kfree(hvt->outmsg);
hvt                62 drivers/hv/hv_utils_transport.c 	hvt->outmsg = NULL;
hvt                63 drivers/hv/hv_utils_transport.c 	hvt->outmsg_len = 0;
hvt                65 drivers/hv/hv_utils_transport.c 	if (hvt->on_read)
hvt                66 drivers/hv/hv_utils_transport.c 		hvt->on_read();
hvt                67 drivers/hv/hv_utils_transport.c 	hvt->on_read = NULL;
hvt                70 drivers/hv/hv_utils_transport.c 	mutex_unlock(&hvt->lock);
hvt                77 drivers/hv/hv_utils_transport.c 	struct hvutil_transport *hvt;
hvt                81 drivers/hv/hv_utils_transport.c 	hvt = container_of(file->f_op, struct hvutil_transport, fops);
hvt                87 drivers/hv/hv_utils_transport.c 	if (hvt->mode == HVUTIL_TRANSPORT_DESTROY)
hvt                90 drivers/hv/hv_utils_transport.c 		ret = hvt->on_msg(inmsg, count);
hvt                99 drivers/hv/hv_utils_transport.c 	struct hvutil_transport *hvt;
hvt               101 drivers/hv/hv_utils_transport.c 	hvt = container_of(file->f_op, struct hvutil_transport, fops);
hvt               103 drivers/hv/hv_utils_transport.c 	poll_wait(file, &hvt->outmsg_q, wait);
hvt               105 drivers/hv/hv_utils_transport.c 	if (hvt->mode == HVUTIL_TRANSPORT_DESTROY)
hvt               108 drivers/hv/hv_utils_transport.c 	if (hvt->outmsg_len > 0)
hvt               116 drivers/hv/hv_utils_transport.c 	struct hvutil_transport *hvt;
hvt               120 drivers/hv/hv_utils_transport.c 	hvt = container_of(file->f_op, struct hvutil_transport, fops);
hvt               122 drivers/hv/hv_utils_transport.c 	mutex_lock(&hvt->lock);
hvt               124 drivers/hv/hv_utils_transport.c 	if (hvt->mode == HVUTIL_TRANSPORT_DESTROY) {
hvt               126 drivers/hv/hv_utils_transport.c 	} else if (hvt->mode == HVUTIL_TRANSPORT_INIT) {
hvt               131 drivers/hv/hv_utils_transport.c 		hvt->mode = HVUTIL_TRANSPORT_CHARDEV;
hvt               133 drivers/hv/hv_utils_transport.c 	else if (hvt->mode == HVUTIL_TRANSPORT_NETLINK) {
hvt               139 drivers/hv/hv_utils_transport.c 		hvt->mode = HVUTIL_TRANSPORT_CHARDEV;
hvt               145 drivers/hv/hv_utils_transport.c 		hvt_reset(hvt);
hvt               147 drivers/hv/hv_utils_transport.c 	mutex_unlock(&hvt->lock);
hvt               152 drivers/hv/hv_utils_transport.c static void hvt_transport_free(struct hvutil_transport *hvt)
hvt               154 drivers/hv/hv_utils_transport.c 	misc_deregister(&hvt->mdev);
hvt               155 drivers/hv/hv_utils_transport.c 	kfree(hvt->outmsg);
hvt               156 drivers/hv/hv_utils_transport.c 	kfree(hvt);
hvt               161 drivers/hv/hv_utils_transport.c 	struct hvutil_transport *hvt;
hvt               164 drivers/hv/hv_utils_transport.c 	hvt = container_of(file->f_op, struct hvutil_transport, fops);
hvt               166 drivers/hv/hv_utils_transport.c 	mutex_lock(&hvt->lock);
hvt               167 drivers/hv/hv_utils_transport.c 	mode_old = hvt->mode;
hvt               168 drivers/hv/hv_utils_transport.c 	if (hvt->mode != HVUTIL_TRANSPORT_DESTROY)
hvt               169 drivers/hv/hv_utils_transport.c 		hvt->mode = HVUTIL_TRANSPORT_INIT;
hvt               174 drivers/hv/hv_utils_transport.c 	hvt_reset(hvt);
hvt               177 drivers/hv/hv_utils_transport.c 		complete(&hvt->release);
hvt               179 drivers/hv/hv_utils_transport.c 	mutex_unlock(&hvt->lock);
hvt               186 drivers/hv/hv_utils_transport.c 	struct hvutil_transport *hvt, *hvt_found = NULL;
hvt               189 drivers/hv/hv_utils_transport.c 	list_for_each_entry(hvt, &hvt_list, list) {
hvt               190 drivers/hv/hv_utils_transport.c 		if (hvt->cn_id.idx == msg->id.idx &&
hvt               191 drivers/hv/hv_utils_transport.c 		    hvt->cn_id.val == msg->id.val) {
hvt               192 drivers/hv/hv_utils_transport.c 			hvt_found = hvt;
hvt               206 drivers/hv/hv_utils_transport.c 	mutex_lock(&hvt->lock);
hvt               207 drivers/hv/hv_utils_transport.c 	if (hvt->mode == HVUTIL_TRANSPORT_INIT)
hvt               208 drivers/hv/hv_utils_transport.c 		hvt->mode = HVUTIL_TRANSPORT_NETLINK;
hvt               210 drivers/hv/hv_utils_transport.c 	if (hvt->mode == HVUTIL_TRANSPORT_NETLINK)
hvt               214 drivers/hv/hv_utils_transport.c 	mutex_unlock(&hvt->lock);
hvt               217 drivers/hv/hv_utils_transport.c int hvutil_transport_send(struct hvutil_transport *hvt, void *msg, int len,
hvt               223 drivers/hv/hv_utils_transport.c 	if (hvt->mode == HVUTIL_TRANSPORT_INIT ||
hvt               224 drivers/hv/hv_utils_transport.c 	    hvt->mode == HVUTIL_TRANSPORT_DESTROY) {
hvt               226 drivers/hv/hv_utils_transport.c 	} else if (hvt->mode == HVUTIL_TRANSPORT_NETLINK) {
hvt               230 drivers/hv/hv_utils_transport.c 		cn_msg->id.idx = hvt->cn_id.idx;
hvt               231 drivers/hv/hv_utils_transport.c 		cn_msg->id.val = hvt->cn_id.val;
hvt               246 drivers/hv/hv_utils_transport.c 	mutex_lock(&hvt->lock);
hvt               247 drivers/hv/hv_utils_transport.c 	if (hvt->mode != HVUTIL_TRANSPORT_CHARDEV) {
hvt               252 drivers/hv/hv_utils_transport.c 	if (hvt->outmsg) {
hvt               257 drivers/hv/hv_utils_transport.c 	hvt->outmsg = kzalloc(len, GFP_KERNEL);
hvt               258 drivers/hv/hv_utils_transport.c 	if (hvt->outmsg) {
hvt               259 drivers/hv/hv_utils_transport.c 		memcpy(hvt->outmsg, msg, len);
hvt               260 drivers/hv/hv_utils_transport.c 		hvt->outmsg_len = len;
hvt               261 drivers/hv/hv_utils_transport.c 		hvt->on_read = on_read_cb;
hvt               262 drivers/hv/hv_utils_transport.c 		wake_up_interruptible(&hvt->outmsg_q);
hvt               266 drivers/hv/hv_utils_transport.c 	mutex_unlock(&hvt->lock);
hvt               275 drivers/hv/hv_utils_transport.c 	struct hvutil_transport *hvt;
hvt               277 drivers/hv/hv_utils_transport.c 	hvt = kzalloc(sizeof(*hvt), GFP_KERNEL);
hvt               278 drivers/hv/hv_utils_transport.c 	if (!hvt)
hvt               281 drivers/hv/hv_utils_transport.c 	hvt->cn_id.idx = cn_idx;
hvt               282 drivers/hv/hv_utils_transport.c 	hvt->cn_id.val = cn_val;
hvt               284 drivers/hv/hv_utils_transport.c 	hvt->mdev.minor = MISC_DYNAMIC_MINOR;
hvt               285 drivers/hv/hv_utils_transport.c 	hvt->mdev.name = name;
hvt               287 drivers/hv/hv_utils_transport.c 	hvt->fops.owner = THIS_MODULE;
hvt               288 drivers/hv/hv_utils_transport.c 	hvt->fops.read = hvt_op_read;
hvt               289 drivers/hv/hv_utils_transport.c 	hvt->fops.write = hvt_op_write;
hvt               290 drivers/hv/hv_utils_transport.c 	hvt->fops.poll = hvt_op_poll;
hvt               291 drivers/hv/hv_utils_transport.c 	hvt->fops.open = hvt_op_open;
hvt               292 drivers/hv/hv_utils_transport.c 	hvt->fops.release = hvt_op_release;
hvt               294 drivers/hv/hv_utils_transport.c 	hvt->mdev.fops = &hvt->fops;
hvt               296 drivers/hv/hv_utils_transport.c 	init_waitqueue_head(&hvt->outmsg_q);
hvt               297 drivers/hv/hv_utils_transport.c 	mutex_init(&hvt->lock);
hvt               298 drivers/hv/hv_utils_transport.c 	init_completion(&hvt->release);
hvt               301 drivers/hv/hv_utils_transport.c 	list_add(&hvt->list, &hvt_list);
hvt               304 drivers/hv/hv_utils_transport.c 	hvt->on_msg = on_msg;
hvt               305 drivers/hv/hv_utils_transport.c 	hvt->on_reset = on_reset;
hvt               307 drivers/hv/hv_utils_transport.c 	if (misc_register(&hvt->mdev))
hvt               311 drivers/hv/hv_utils_transport.c 	if (hvt->cn_id.idx > 0 && hvt->cn_id.val > 0 &&
hvt               312 drivers/hv/hv_utils_transport.c 	    cn_add_callback(&hvt->cn_id, name, hvt_cn_callback))
hvt               315 drivers/hv/hv_utils_transport.c 	return hvt;
hvt               319 drivers/hv/hv_utils_transport.c 	list_del(&hvt->list);
hvt               321 drivers/hv/hv_utils_transport.c 	kfree(hvt);
hvt               325 drivers/hv/hv_utils_transport.c void hvutil_transport_destroy(struct hvutil_transport *hvt)
hvt               329 drivers/hv/hv_utils_transport.c 	mutex_lock(&hvt->lock);
hvt               330 drivers/hv/hv_utils_transport.c 	mode_old = hvt->mode;
hvt               331 drivers/hv/hv_utils_transport.c 	hvt->mode = HVUTIL_TRANSPORT_DESTROY;
hvt               332 drivers/hv/hv_utils_transport.c 	wake_up_interruptible(&hvt->outmsg_q);
hvt               333 drivers/hv/hv_utils_transport.c 	mutex_unlock(&hvt->lock);
hvt               341 drivers/hv/hv_utils_transport.c 	list_del(&hvt->list);
hvt               343 drivers/hv/hv_utils_transport.c 	if (hvt->cn_id.idx > 0 && hvt->cn_id.val > 0)
hvt               344 drivers/hv/hv_utils_transport.c 		cn_del_callback(&hvt->cn_id);
hvt               347 drivers/hv/hv_utils_transport.c 		wait_for_completion(&hvt->release);
hvt               349 drivers/hv/hv_utils_transport.c 	hvt_transport_free(hvt);
hvt                41 drivers/hv/hv_utils_transport.h int hvutil_transport_send(struct hvutil_transport *hvt, void *msg, int len,
hvt                43 drivers/hv/hv_utils_transport.h void hvutil_transport_destroy(struct hvutil_transport *hvt);