]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
mei: bus: Call bus routines from the core code
authorSamuel Ortiz <sameo@linux.intel.com>
Wed, 27 Mar 2013 15:29:57 +0000 (17:29 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 29 Mar 2013 15:45:59 +0000 (08:45 -0700)
Register the MEI bus type against the kernel core bus APIs and
call the bus Rx handler from interrupt.c

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/mei/bus.c
drivers/misc/mei/interrupt.c
drivers/misc/mei/main.c
drivers/misc/mei/mei_dev.h
drivers/misc/mei/pci-me.c

index 162cd542cac93e19da21113cd3867cbe8b898947..c626dc9937ebdd35ad366e3cf35ddadd752b19b7 100644 (file)
@@ -441,3 +441,25 @@ int mei_cl_register_event_cb(struct mei_cl_device *device,
        return 0;
 }
 EXPORT_SYMBOL_GPL(mei_cl_register_event_cb);
+
+void mei_cl_bus_rx_event(struct mei_cl *cl)
+{
+       struct mei_cl_device *device = cl->device;
+
+       if (!device || !device->event_cb)
+               return;
+
+       set_bit(MEI_CL_EVENT_RX, &device->events);
+
+       schedule_work(&device->event_work);
+}
+
+int __init mei_cl_bus_init(void)
+{
+       return bus_register(&mei_cl_bus_type);
+}
+
+void __exit mei_cl_bus_exit(void)
+{
+       bus_unregister(&mei_cl_bus_type);
+}
index 6ce45ef2cd6cb8f8c86ed7524722f882a2f55244..255e0853479cc1ff891594fa41d3e28248725740 100644 (file)
@@ -50,6 +50,8 @@ static void mei_cl_complete_handler(struct mei_cl *cl, struct mei_cl_cb *cb)
                cl->reading_state = MEI_READ_COMPLETE;
                if (waitqueue_active(&cl->rx_wait))
                        wake_up_interruptible(&cl->rx_wait);
+               else
+                       mei_cl_bus_rx_event(cl);
 
        }
 }
index 27b3df2ba0700908afc0457f8db859be167dd4a0..872de9d1494b8a161b120e881be48907b7c2e33f 100644 (file)
@@ -767,6 +767,19 @@ void mei_deregister(void)
 }
 EXPORT_SYMBOL_GPL(mei_deregister);
 
+static int __init mei_init(void)
+{
+       return mei_cl_bus_init();
+}
+
+static void __exit mei_exit(void)
+{
+       mei_cl_bus_exit();
+}
+
+module_init(mei_init);
+module_exit(mei_exit);
+
 MODULE_AUTHOR("Intel Corporation");
 MODULE_DESCRIPTION("Intel(R) Management Engine Interface");
 MODULE_LICENSE("GPL v2");
index 0313c24a1a49cb4ccca7b59babfda8b20dee59be..7d594bedc6855fb7ff549bee468e9e15a9386431 100644 (file)
@@ -292,6 +292,11 @@ struct mei_cl_transport_ops {
        int (*recv)(struct mei_cl_device *device, u8 *buf, size_t length);
 };
 
+void mei_cl_bus_rx_event(struct mei_cl *cl);
+int mei_cl_bus_init(void);
+void mei_cl_bus_exit(void);
+
+
 /**
  * struct mei_cl_device - MEI device handle
  * An mei_cl_device pointer is returned from mei_add_device()
@@ -451,7 +456,6 @@ static inline u32 mei_data2slots(size_t length)
        return DIV_ROUND_UP(sizeof(struct mei_msg_hdr) + length, 4);
 }
 
-
 /*
  * mei init function prototypes
  */
index 178928eaf6cf5d73c105ff1a2849579beb507f7c..a1a582b66f0d3d28cb3e9acc087a92e2f6bba8c6 100644 (file)
@@ -197,7 +197,6 @@ static int mei_me_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        mei_pdev = pdev;
        pci_set_drvdata(pdev, dev);
 
-
        schedule_delayed_work(&dev->timer_work, HZ);
 
        mutex_unlock(&mei_mutex);