Displaying 20 results from an estimated 30 matches for "vmbus_drv_ctx".
2011 Mar 10
1
[PATCH 13/21] [PATCH 13/21] Staging: hv: Rename vmbus_driver_context structure
...{
+static struct hv_bus hv_bus = {
.bus.name = "vmbus",
.bus.match = vmbus_match,
.bus.shutdown = vmbus_shutdown,
@@ -374,7 +372,6 @@ static ssize_t vmbus_show_device_attr(struct device *dev,
*/
static int vmbus_bus_init(struct pci_dev *pdev)
{
- struct vmbus_driver_context *vmbus_drv_ctx = &vmbus_drv;
int ret;
unsigned int vector;
@@ -399,16 +396,16 @@ static int vmbus_bus_init(struct pci_dev *pdev)
}
- vmbus_drv_ctx->bus.name = driver_name;
+ hv_bus.bus.name = driver_name;
/* Initialize the bus context */
- tasklet_init(&vmbus_drv_ctx->msg_dpc, vmbus_...
2011 Mar 10
1
[PATCH 13/21] [PATCH 13/21] Staging: hv: Rename vmbus_driver_context structure
...{
+static struct hv_bus hv_bus = {
.bus.name = "vmbus",
.bus.match = vmbus_match,
.bus.shutdown = vmbus_shutdown,
@@ -374,7 +372,6 @@ static ssize_t vmbus_show_device_attr(struct device *dev,
*/
static int vmbus_bus_init(struct pci_dev *pdev)
{
- struct vmbus_driver_context *vmbus_drv_ctx = &vmbus_drv;
int ret;
unsigned int vector;
@@ -399,16 +396,16 @@ static int vmbus_bus_init(struct pci_dev *pdev)
}
- vmbus_drv_ctx->bus.name = driver_name;
+ hv_bus.bus.name = driver_name;
/* Initialize the bus context */
- tasklet_init(&vmbus_drv_ctx->msg_dpc, vmbus_...
2011 Mar 10
1
[PATCH 10/21] Staging: hv: Cleanup root device handling
...- setup various driver entry points
* - invoke the vmbus hv main init routine
* - get the irq resource
- * - invoke the vmbus to add the vmbus root device
* - setup the vmbus root device
* - retrieve the channel offers
*/
static int vmbus_bus_init(void)
{
struct vmbus_driver_context *vmbus_drv_ctx = &vmbus_drv;
- struct hv_device *dev_ctx = &vmbus_drv.device_ctx;
int ret;
unsigned int vector;
@@ -483,45 +432,34 @@ static int vmbus_bus_init(void)
DPRINT_INFO(VMBUS_DRV, "irq 0x%x vector 0x%x", vmbus_irq, vector);
- /* Add the root device */
- memset(dev_ctx, 0, si...
2011 Mar 10
1
[PATCH 10/21] Staging: hv: Cleanup root device handling
...- setup various driver entry points
* - invoke the vmbus hv main init routine
* - get the irq resource
- * - invoke the vmbus to add the vmbus root device
* - setup the vmbus root device
* - retrieve the channel offers
*/
static int vmbus_bus_init(void)
{
struct vmbus_driver_context *vmbus_drv_ctx = &vmbus_drv;
- struct hv_device *dev_ctx = &vmbus_drv.device_ctx;
int ret;
unsigned int vector;
@@ -483,45 +432,34 @@ static int vmbus_bus_init(void)
DPRINT_INFO(VMBUS_DRV, "irq 0x%x vector 0x%x", vmbus_irq, vector);
- /* Add the root device */
- memset(dev_ctx, 0, si...
2011 Mar 15
16
[PATCH 00/12] Staging: hv: Cleanup vmbus driver - Phase II
This patch-set fixes the following issues in the vmbus driver (vmbus_drv.c):
Make vmbus driver a platform pci device and cleanup
root device management and irq allocation
(patches 1/12 through 3/12):
1) Make vmbus driver a platform pci driver.
2) Cleanup root device management.
3) Leverage the pci model for allocating irq.
General cleanup of vmbus driver (patches 4/12 though 12/12):
1)
2011 Mar 15
16
[PATCH 00/12] Staging: hv: Cleanup vmbus driver - Phase II
This patch-set fixes the following issues in the vmbus driver (vmbus_drv.c):
Make vmbus driver a platform pci device and cleanup
root device management and irq allocation
(patches 1/12 through 3/12):
1) Make vmbus driver a platform pci driver.
2) Cleanup root device management.
3) Leverage the pci model for allocating irq.
General cleanup of vmbus driver (patches 4/12 though 12/12):
1)
2011 Feb 26
1
[PATCH 5/6] Staging: hv: Rename driver_context to hyperv_driver
...ic int vmbus_on_isr(struct driver_context *drv)
+static int vmbus_on_isr(struct hyperv_driver *drv)
{
int ret = 0;
int cpu = smp_processor_id();
@@ -462,8 +462,8 @@ static ssize_t vmbus_show_device_attr(struct device *dev,
*/
static int vmbus_bus_init(void)
{
- struct vmbus_driver_context *vmbus_drv_ctx = &vmbus_drv;
- struct driver_context *driver = &vmbus_drv.drv_obj;
+ struct vmbus_hyperv_driver *vmbus_drv_ctx = &vmbus_drv;
+ struct hyperv_driver *driver = &vmbus_drv.drv_obj;
struct hyperv_device *dev = &vmbus_drv.device_obj;
int ret;
unsigned int vector;
@@ -587,8 +58...
2011 Feb 26
1
[PATCH 5/6] Staging: hv: Rename driver_context to hyperv_driver
...ic int vmbus_on_isr(struct driver_context *drv)
+static int vmbus_on_isr(struct hyperv_driver *drv)
{
int ret = 0;
int cpu = smp_processor_id();
@@ -462,8 +462,8 @@ static ssize_t vmbus_show_device_attr(struct device *dev,
*/
static int vmbus_bus_init(void)
{
- struct vmbus_driver_context *vmbus_drv_ctx = &vmbus_drv;
- struct driver_context *driver = &vmbus_drv.drv_obj;
+ struct vmbus_hyperv_driver *vmbus_drv_ctx = &vmbus_drv;
+ struct hyperv_driver *driver = &vmbus_drv.drv_obj;
struct hyperv_device *dev = &vmbus_drv.device_obj;
int ret;
unsigned int vector;
@@ -587,8 +58...
2011 Feb 26
2
[PATCH 3/6] Staging: hv: Cleanup hyperv_device variable names
...ce_ctx, &device_info);
+ get_channel_info(device_obj, &device_info);
if (!strcmp(dev_attr->attr.name, "class_id")) {
return sprintf(buf, "{%02x%02x%02x%02x-%02x%02x-%02x%02x-"
@@ -464,7 +464,7 @@ static int vmbus_bus_init(void)
{
struct vmbus_driver_context *vmbus_drv_ctx = &vmbus_drv;
struct hv_driver *driver = &vmbus_drv.drv_obj;
- struct hyperv_device *dev_ctx = &vmbus_drv.device_ctx;
+ struct hyperv_device *dev = &vmbus_drv.device_obj;
int ret;
unsigned int vector;
@@ -535,9 +535,9 @@ static int vmbus_bus_init(void)
DPRINT_INFO(VMBUS_DR...
2011 Feb 26
2
[PATCH 3/6] Staging: hv: Cleanup hyperv_device variable names
...ce_ctx, &device_info);
+ get_channel_info(device_obj, &device_info);
if (!strcmp(dev_attr->attr.name, "class_id")) {
return sprintf(buf, "{%02x%02x%02x%02x-%02x%02x-%02x%02x-"
@@ -464,7 +464,7 @@ static int vmbus_bus_init(void)
{
struct vmbus_driver_context *vmbus_drv_ctx = &vmbus_drv;
struct hv_driver *driver = &vmbus_drv.drv_obj;
- struct hyperv_device *dev_ctx = &vmbus_drv.device_ctx;
+ struct hyperv_device *dev = &vmbus_drv.device_obj;
int ret;
unsigned int vector;
@@ -535,9 +535,9 @@ static int vmbus_bus_init(void)
DPRINT_INFO(VMBUS_DR...
2011 Feb 26
2
[PATCH 6/6] Staging: hv: Cleanup hyperv_driver variable names
...device_obj = device_to_hyperv_device(device);
/* We found our driver ? */
- if (memcmp(&device_obj->class_id, &driver_ctx->class_id,
+ if (memcmp(&device_obj->class_id, &drv->class_id,
sizeof(struct hv_guid)) == 0) {
/*
- * !! NOTE: The driver_ctx is not a vmbus_drv_ctx. We typecast
+ * !! NOTE: The drv is not a vmbus_drv_ctx. We typecast
* it here to access the struct hyperv_driver field
*/
struct vmbus_hyperv_driver *vmbus_drv_ctx =
- (struct vmbus_hyperv_driver *)driver_ctx;
+ (struct vmbus_hyperv_driver *)drv;
device_obj->drv = &vm...
2011 Feb 26
2
[PATCH 6/6] Staging: hv: Cleanup hyperv_driver variable names
...device_obj = device_to_hyperv_device(device);
/* We found our driver ? */
- if (memcmp(&device_obj->class_id, &driver_ctx->class_id,
+ if (memcmp(&device_obj->class_id, &drv->class_id,
sizeof(struct hv_guid)) == 0) {
/*
- * !! NOTE: The driver_ctx is not a vmbus_drv_ctx. We typecast
+ * !! NOTE: The drv is not a vmbus_drv_ctx. We typecast
* it here to access the struct hyperv_driver field
*/
struct vmbus_hyperv_driver *vmbus_drv_ctx =
- (struct vmbus_hyperv_driver *)driver_ctx;
+ (struct vmbus_hyperv_driver *)drv;
device_obj->drv = &vm...
2011 Feb 15
4
[PATCH]: Staging: hv: Allocate the vmbus irq dynamically
...r the following conditions:
+ *
+ * 1) If we succeed in registering our handler OR
+ * 2) If there are no free interrupt lines for our use OR
+ * 3) request_irq fails for reasons other than an irq collision
+ */
+ while (!irq_assigned) {
+ vmbus_irq = vmbus_get_irq();
- bus_unregister(&vmbus_drv_ctx->bus);
+ if (vmbus_irq < 0) {
+ bus_unregister(&vmbus_drv_ctx->bus);
+ ret = -EBUSY;
+ goto cleanup;
+ }
- ret = -1;
- goto cleanup;
+ ret = request_irq(vmbus_irq, vmbus_isr, IRQF_SAMPLE_RANDOM,
+ driver->name, NULL);
+ switch (ret) {
+ case -EBUSY:
+ /* We rac...
2011 Feb 15
4
[PATCH]: Staging: hv: Allocate the vmbus irq dynamically
...r the following conditions:
+ *
+ * 1) If we succeed in registering our handler OR
+ * 2) If there are no free interrupt lines for our use OR
+ * 3) request_irq fails for reasons other than an irq collision
+ */
+ while (!irq_assigned) {
+ vmbus_irq = vmbus_get_irq();
- bus_unregister(&vmbus_drv_ctx->bus);
+ if (vmbus_irq < 0) {
+ bus_unregister(&vmbus_drv_ctx->bus);
+ ret = -EBUSY;
+ goto cleanup;
+ }
- ret = -1;
- goto cleanup;
+ ret = request_irq(vmbus_irq, vmbus_isr, IRQF_SAMPLE_RANDOM,
+ driver->name, NULL);
+ switch (ret) {
+ case -EBUSY:
+ /* We rac...
2011 Feb 26
1
[PATCH 4/6] Staging: hv: Unify the hyperv driver abstractions
...*/
-static int vmbus_on_isr(struct hv_driver *drv)
+static int vmbus_on_isr(struct driver_context *drv)
{
int ret = 0;
int cpu = smp_processor_id();
@@ -463,7 +463,7 @@ static ssize_t vmbus_show_device_attr(struct device *dev,
static int vmbus_bus_init(void)
{
struct vmbus_driver_context *vmbus_drv_ctx = &vmbus_drv;
- struct hv_driver *driver = &vmbus_drv.drv_obj;
+ struct driver_context *driver = &vmbus_drv.drv_obj;
struct hyperv_device *dev = &vmbus_drv.device_obj;
int ret;
unsigned int vector;
@@ -587,7 +587,7 @@ cleanup:
*/
static void vmbus_bus_exit(void)
{
- struct...
2011 Feb 26
1
[PATCH 4/6] Staging: hv: Unify the hyperv driver abstractions
...*/
-static int vmbus_on_isr(struct hv_driver *drv)
+static int vmbus_on_isr(struct driver_context *drv)
{
int ret = 0;
int cpu = smp_processor_id();
@@ -463,7 +463,7 @@ static ssize_t vmbus_show_device_attr(struct device *dev,
static int vmbus_bus_init(void)
{
struct vmbus_driver_context *vmbus_drv_ctx = &vmbus_drv;
- struct hv_driver *driver = &vmbus_drv.drv_obj;
+ struct driver_context *driver = &vmbus_drv.drv_obj;
struct hyperv_device *dev = &vmbus_drv.device_obj;
int ret;
unsigned int vector;
@@ -587,7 +587,7 @@ cleanup:
*/
static void vmbus_bus_exit(void)
{
- struct...
2011 Feb 24
4
[PATCH ] Staging: hv: Hyper-V driver cleanup
...evice_info);
if (!strcmp(dev_attr->attr.name, "class_id")) {
return sprintf(buf, "{%02x%02x%02x%02x-%02x%02x-%02x%02x-"
@@ -462,9 +461,9 @@ static ssize_t vmbus_show_device_attr(struct device *dev,
*/
static int vmbus_bus_init(void)
{
- struct vmbus_driver_context *vmbus_drv_ctx = &vmbus_drv;
- struct hv_driver *driver = &vmbus_drv.drv_obj;
- struct vm_device *dev_ctx = &vmbus_drv.device_ctx;
+ struct vmbus_hyperv_driver *vmb_drv = &g_vmbus_drv;
+ struct hyperv_driver *hv_drv = &g_vmbus_drv.drv;
+ struct hyperv_device *hv_dev = &g_vmbus_drv.hyperv_d...
2011 Feb 24
4
[PATCH ] Staging: hv: Hyper-V driver cleanup
...evice_info);
if (!strcmp(dev_attr->attr.name, "class_id")) {
return sprintf(buf, "{%02x%02x%02x%02x-%02x%02x-%02x%02x-"
@@ -462,9 +461,9 @@ static ssize_t vmbus_show_device_attr(struct device *dev,
*/
static int vmbus_bus_init(void)
{
- struct vmbus_driver_context *vmbus_drv_ctx = &vmbus_drv;
- struct hv_driver *driver = &vmbus_drv.drv_obj;
- struct vm_device *dev_ctx = &vmbus_drv.device_ctx;
+ struct vmbus_hyperv_driver *vmb_drv = &g_vmbus_drv;
+ struct hyperv_driver *hv_drv = &g_vmbus_drv.drv;
+ struct hyperv_device *hv_dev = &g_vmbus_drv.hyperv_d...
2011 Feb 15
3
[PATCH ]:Staging: hv: Allocate the vmbus irq dynamically
...t != 0) {
- DPRINT_ERR(VMBUS_DRV, "ERROR - Unable to request IRQ %d",
- vmbus_irq);
-
+get_irq_again:
+ vmbus_irq = vmbus_get_irq();
+ if ((vmbus_irq < 0) || (prev_irq == vmbus_irq)) {
+ printk(KERN_WARNING "VMBUS_DRV: Failed to allocate IRQ\n");
bus_unregister(&vmbus_drv_ctx->bus);
-
ret = -1;
goto cleanup;
}
- vector = VMBUS_IRQ_VECTOR;
+ prev_irq = vmbus_irq;
+
+ ret = request_irq(vmbus_irq, vmbus_isr, IRQF_SAMPLE_RANDOM,
+ driver->name, NULL);
+
+ if (ret != 0)
+ goto get_irq_again;
+
+ vector = IRQ0_VECTOR + vmbus_irq;
DPRINT_INFO(VMBUS_DRV,...
2011 Feb 15
3
[PATCH ]:Staging: hv: Allocate the vmbus irq dynamically
...t != 0) {
- DPRINT_ERR(VMBUS_DRV, "ERROR - Unable to request IRQ %d",
- vmbus_irq);
-
+get_irq_again:
+ vmbus_irq = vmbus_get_irq();
+ if ((vmbus_irq < 0) || (prev_irq == vmbus_irq)) {
+ printk(KERN_WARNING "VMBUS_DRV: Failed to allocate IRQ\n");
bus_unregister(&vmbus_drv_ctx->bus);
-
ret = -1;
goto cleanup;
}
- vector = VMBUS_IRQ_VECTOR;
+ prev_irq = vmbus_irq;
+
+ ret = request_irq(vmbus_irq, vmbus_isr, IRQF_SAMPLE_RANDOM,
+ driver->name, NULL);
+
+ if (ret != 0)
+ goto get_irq_again;
+
+ vector = IRQ0_VECTOR + vmbus_irq;
DPRINT_INFO(VMBUS_DRV,...