Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 235732
b: refs/heads/master
c: da9fcb7
h: refs/heads/master
v: v3
  • Loading branch information
Haiyang Zhang authored and Greg Kroah-Hartman committed Jan 31, 2011
1 parent e7f6e0b commit a373a99
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 78 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 415f228712d86dd5598f809e8e379ff5ad729652
refs/heads/master: da9fcb7260af0cd85351740b526afdc88d4f348a
22 changes: 11 additions & 11 deletions trunk/drivers/staging/hv/channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ static void vmbus_setevent(struct vmbus_channel *channel)
if (channel->offermsg.monitor_allocated) {
/* Each u32 represents 32 channels */
set_bit(channel->offermsg.child_relid & 31,
(unsigned long *) vmbus_connection.SendInterruptPage +
(unsigned long *) vmbus_connection.send_int_page +
(channel->offermsg.child_relid >> 5));

monitorpage = vmbus_connection.MonitorPages;
monitorpage = vmbus_connection.monitor_pages;
monitorpage++; /* Get the child to parent monitor page */

set_bit(channel->monitor_bit,
Expand All @@ -100,11 +100,11 @@ static void VmbusChannelClearEvent(struct vmbus_channel *channel)
if (Channel->offermsg.monitor_allocated) {
/* Each u32 represents 32 channels */
clear_bit(Channel->offermsg.child_relid & 31,
(unsigned long *)vmbus_connection.SendInterruptPage +
(unsigned long *)vmbus_connection.send_int_page +
(Channel->offermsg.child_relid >> 5));

monitorPage =
(struct hv_monitor_page *)vmbus_connection.MonitorPages;
monitorPage = (struct hv_monitor_page *)
vmbus_connection.monitor_pages;
monitorPage++; /* Get the child to parent monitor page */

clear_bit(Channel->monitor_bit,
Expand Down Expand Up @@ -133,7 +133,7 @@ void vmbus_get_debug_info(struct vmbus_channel *channel,
&channel->offermsg.offer.if_instance,
sizeof(struct hv_guid));

monitorpage = (struct hv_monitor_page *)vmbus_connection.MonitorPages;
monitorpage = (struct hv_monitor_page *)vmbus_connection.monitor_pages;

debuginfo->monitorid = channel->offermsg.monitorid;

Expand Down Expand Up @@ -267,7 +267,7 @@ int vmbus_open(struct vmbus_channel *newchannel, u32 send_ringbuffer_size,

spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags);
list_add_tail(&openInfo->msglistentry,
&vmbus_connection.ChannelMsgList);
&vmbus_connection.chn_msg_list);
spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags);

DPRINT_DBG(VMBUS, "Sending channel open msg...");
Expand Down Expand Up @@ -501,8 +501,8 @@ int vmbus_establish_gpadl(struct vmbus_channel *channel, void *kbuffer,
unsigned long flags;
int ret = 0;

next_gpadl_handle = atomic_read(&vmbus_connection.NextGpadlHandle);
atomic_inc(&vmbus_connection.NextGpadlHandle);
next_gpadl_handle = atomic_read(&vmbus_connection.next_gpadl_handle);
atomic_inc(&vmbus_connection.next_gpadl_handle);

ret = create_gpadl_header(kbuffer, size, &msginfo, &msgcount);
if (ret)
Expand All @@ -523,7 +523,7 @@ int vmbus_establish_gpadl(struct vmbus_channel *channel, void *kbuffer,

spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags);
list_add_tail(&msginfo->msglistentry,
&vmbus_connection.ChannelMsgList);
&vmbus_connection.chn_msg_list);

spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags);
DPRINT_DBG(VMBUS, "buffer %p, size %d msg cnt %d",
Expand Down Expand Up @@ -618,7 +618,7 @@ int vmbus_teardown_gpadl(struct vmbus_channel *channel, u32 gpadl_handle)

spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags);
list_add_tail(&info->msglistentry,
&vmbus_connection.ChannelMsgList);
&vmbus_connection.chn_msg_list);
spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags);

ret = vmbus_post_msg(msg,
Expand Down
16 changes: 8 additions & 8 deletions trunk/drivers/staging/hv/channel_mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ void free_channel(struct vmbus_channel *channel)
* ie we can't destroy ourselves.
*/
INIT_WORK(&channel->work, release_channel);
queue_work(vmbus_connection.WorkQueue, &channel->work);
queue_work(vmbus_connection.work_queue, &channel->work);
}


Expand Down Expand Up @@ -363,7 +363,7 @@ static void vmbus_process_offer(struct work_struct *work)
/* Make sure this is a new offer */
spin_lock_irqsave(&vmbus_connection.channel_lock, flags);

list_for_each_entry(channel, &vmbus_connection.ChannelList, listentry) {
list_for_each_entry(channel, &vmbus_connection.chn_list, listentry) {
if (!memcmp(&channel->offermsg.offer.if_type,
&newchannel->offermsg.offer.if_type,
sizeof(struct hv_guid)) &&
Expand All @@ -377,7 +377,7 @@ static void vmbus_process_offer(struct work_struct *work)

if (fnew)
list_add_tail(&newchannel->listentry,
&vmbus_connection.ChannelList);
&vmbus_connection.chn_list);

spin_unlock_irqrestore(&vmbus_connection.channel_lock, flags);

Expand Down Expand Up @@ -579,7 +579,7 @@ static void vmbus_onopen_result(struct vmbus_channel_message_header *hdr)
*/
spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags);

list_for_each(curr, &vmbus_connection.ChannelMsgList) {
list_for_each(curr, &vmbus_connection.chn_msg_list) {
/* FIXME: this should probably use list_entry() instead */
msginfo = (struct vmbus_channel_msginfo *)curr;
requestheader =
Expand Down Expand Up @@ -627,7 +627,7 @@ static void vmbus_ongpadl_created(struct vmbus_channel_message_header *hdr)
*/
spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags);

list_for_each(curr, &vmbus_connection.ChannelMsgList) {
list_for_each(curr, &vmbus_connection.chn_msg_list) {
/* FIXME: this should probably use list_entry() instead */
msginfo = (struct vmbus_channel_msginfo *)curr;
requestheader =
Expand Down Expand Up @@ -675,7 +675,7 @@ static void vmbus_ongpadl_torndown(
*/
spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags);

list_for_each(curr, &vmbus_connection.ChannelMsgList) {
list_for_each(curr, &vmbus_connection.chn_msg_list) {
/* FIXME: this should probably use list_entry() instead */
msginfo = (struct vmbus_channel_msginfo *)curr;
requestheader =
Expand Down Expand Up @@ -717,7 +717,7 @@ static void vmbus_onversion_response(
version_response = (struct vmbus_channel_version_response *)hdr;
spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags);

list_for_each(curr, &vmbus_connection.ChannelMsgList) {
list_for_each(curr, &vmbus_connection.chn_msg_list) {
/* FIXME: this should probably use list_entry() instead */
msginfo = (struct vmbus_channel_msginfo *)curr;
requestheader =
Expand Down Expand Up @@ -859,7 +859,7 @@ void vmbus_release_unattached_channels(void)

spin_lock_irqsave(&vmbus_connection.channel_lock, flags);

list_for_each_entry_safe(channel, pos, &vmbus_connection.ChannelList,
list_for_each_entry_safe(channel, pos, &vmbus_connection.chn_list,
listentry) {
if (channel == start)
break;
Expand Down
74 changes: 37 additions & 37 deletions trunk/drivers/staging/hv/connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
#include "vmbus_private.h"


struct VMBUS_CONNECTION vmbus_connection = {
.ConnectState = Disconnected,
.NextGpadlHandle = ATOMIC_INIT(0xE1E10),
struct vmbus_connection vmbus_connection = {
.conn_state = DISCONNECTED,
.next_gpadl_handle = ATOMIC_INIT(0xE1E10),
};

/*
Expand All @@ -45,44 +45,44 @@ int vmbus_connect(void)
unsigned long flags;

/* Make sure we are not connecting or connected */
if (vmbus_connection.ConnectState != Disconnected)
if (vmbus_connection.conn_state != DISCONNECTED)
return -1;

/* Initialize the vmbus connection */
vmbus_connection.ConnectState = Connecting;
vmbus_connection.WorkQueue = create_workqueue("hv_vmbus_con");
if (!vmbus_connection.WorkQueue) {
vmbus_connection.conn_state = CONNECTING;
vmbus_connection.work_queue = create_workqueue("hv_vmbus_con");
if (!vmbus_connection.work_queue) {
ret = -1;
goto Cleanup;
}

INIT_LIST_HEAD(&vmbus_connection.ChannelMsgList);
INIT_LIST_HEAD(&vmbus_connection.chn_msg_list);
spin_lock_init(&vmbus_connection.channelmsg_lock);

INIT_LIST_HEAD(&vmbus_connection.ChannelList);
INIT_LIST_HEAD(&vmbus_connection.chn_list);
spin_lock_init(&vmbus_connection.channel_lock);

/*
* Setup the vmbus event connection for channel interrupt
* abstraction stuff
*/
vmbus_connection.InterruptPage = osd_page_alloc(1);
if (vmbus_connection.InterruptPage == NULL) {
vmbus_connection.int_page = osd_page_alloc(1);
if (vmbus_connection.int_page == NULL) {
ret = -1;
goto Cleanup;
}

vmbus_connection.RecvInterruptPage = vmbus_connection.InterruptPage;
vmbus_connection.SendInterruptPage =
(void *)((unsigned long)vmbus_connection.InterruptPage +
vmbus_connection.recv_int_page = vmbus_connection.int_page;
vmbus_connection.send_int_page =
(void *)((unsigned long)vmbus_connection.int_page +
(PAGE_SIZE >> 1));

/*
* Setup the monitor notification facility. The 1st page for
* parent->child and the 2nd page for child->parent
*/
vmbus_connection.MonitorPages = osd_page_alloc(2);
if (vmbus_connection.MonitorPages == NULL) {
vmbus_connection.monitor_pages = osd_page_alloc(2);
if (vmbus_connection.monitor_pages == NULL) {
ret = -1;
goto Cleanup;
}
Expand All @@ -105,10 +105,10 @@ int vmbus_connect(void)

msg->header.msgtype = CHANNELMSG_INITIATE_CONTACT;
msg->vmbus_version_requested = VMBUS_REVISION_NUMBER;
msg->interrupt_page = virt_to_phys(vmbus_connection.InterruptPage);
msg->monitor_page1 = virt_to_phys(vmbus_connection.MonitorPages);
msg->interrupt_page = virt_to_phys(vmbus_connection.int_page);
msg->monitor_page1 = virt_to_phys(vmbus_connection.monitor_pages);
msg->monitor_page2 = virt_to_phys(
(void *)((unsigned long)vmbus_connection.MonitorPages +
(void *)((unsigned long)vmbus_connection.monitor_pages +
PAGE_SIZE));

/*
Expand All @@ -117,7 +117,7 @@ int vmbus_connect(void)
*/
spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags);
list_add_tail(&msginfo->msglistentry,
&vmbus_connection.ChannelMsgList);
&vmbus_connection.chn_msg_list);

spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags);

Expand All @@ -141,7 +141,7 @@ int vmbus_connect(void)
/* Check if successful */
if (msginfo->response.version_response.version_supported) {
DPRINT_INFO(VMBUS, "Vmbus connected!!");
vmbus_connection.ConnectState = Connected;
vmbus_connection.conn_state = CONNECTED;

} else {
DPRINT_ERR(VMBUS, "Vmbus connection failed!!..."
Expand All @@ -156,19 +156,19 @@ int vmbus_connect(void)
return 0;

Cleanup:
vmbus_connection.ConnectState = Disconnected;
vmbus_connection.conn_state = DISCONNECTED;

if (vmbus_connection.WorkQueue)
destroy_workqueue(vmbus_connection.WorkQueue);
if (vmbus_connection.work_queue)
destroy_workqueue(vmbus_connection.work_queue);

if (vmbus_connection.InterruptPage) {
osd_page_free(vmbus_connection.InterruptPage, 1);
vmbus_connection.InterruptPage = NULL;
if (vmbus_connection.int_page) {
osd_page_free(vmbus_connection.int_page, 1);
vmbus_connection.int_page = NULL;
}

if (vmbus_connection.MonitorPages) {
osd_page_free(vmbus_connection.MonitorPages, 2);
vmbus_connection.MonitorPages = NULL;
if (vmbus_connection.monitor_pages) {
osd_page_free(vmbus_connection.monitor_pages, 2);
vmbus_connection.monitor_pages = NULL;
}

if (msginfo) {
Expand All @@ -189,7 +189,7 @@ int vmbus_disconnect(void)
struct vmbus_channel_message_header *msg;

/* Make sure we are connected */
if (vmbus_connection.ConnectState != Connected)
if (vmbus_connection.conn_state != CONNECTED)
return -1;

msg = kzalloc(sizeof(struct vmbus_channel_message_header), GFP_KERNEL);
Expand All @@ -203,12 +203,12 @@ int vmbus_disconnect(void)
if (ret != 0)
goto Cleanup;

osd_page_free(vmbus_connection.InterruptPage, 1);
osd_page_free(vmbus_connection.int_page, 1);

/* TODO: iterate thru the msg list and free up */
destroy_workqueue(vmbus_connection.WorkQueue);
destroy_workqueue(vmbus_connection.work_queue);

vmbus_connection.ConnectState = Disconnected;
vmbus_connection.conn_state = DISCONNECTED;

DPRINT_INFO(VMBUS, "Vmbus disconnected!!");

Expand All @@ -228,7 +228,7 @@ struct vmbus_channel *relid2channel(u32 relid)
unsigned long flags;

spin_lock_irqsave(&vmbus_connection.channel_lock, flags);
list_for_each_entry(channel, &vmbus_connection.ChannelList, listentry) {
list_for_each_entry(channel, &vmbus_connection.chn_list, listentry) {
if (channel->offermsg.child_relid == relid) {
found_channel = channel;
break;
Expand Down Expand Up @@ -276,7 +276,7 @@ void vmbus_on_event(void)
int maxdword = MAX_NUM_CHANNELS_SUPPORTED >> 5;
int bit;
int relid;
u32 *recv_int_page = vmbus_connection.RecvInterruptPage;
u32 *recv_int_page = vmbus_connection.recv_int_page;

/* Check events */
if (recv_int_page) {
Expand Down Expand Up @@ -326,7 +326,7 @@ int vmbus_set_event(u32 child_relid)
{
/* Each u32 represents 32 channels */
set_bit(child_relid & 31,
(unsigned long *)vmbus_connection.SendInterruptPage +
(unsigned long *)vmbus_connection.send_int_page +
(child_relid >> 5));

return hv_signal_event();
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/staging/hv/vmbus_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ static void vmbus_on_msg_dpc(struct hv_driver *drv)
continue;
INIT_WORK(&ctx->work, vmbus_onmessage_work);
memcpy(&ctx->msg, msg, sizeof(*msg));
queue_work(vmbus_connection.WorkQueue, &ctx->work);
queue_work(vmbus_connection.work_queue, &ctx->work);
}

msg->header.message_type = HVMSG_NONE;
Expand Down
Loading

0 comments on commit a373a99

Please sign in to comment.