diff options
| author | Samuel Ortiz <sameo@linux.intel.com> | 2013-03-27 11:29:57 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-03-29 11:45:59 -0400 |
| commit | cf3baefba04073237decb1b8a8c114b0b45bfc80 (patch) | |
| tree | 735e86d98f20c7fb58b7480565837eabc02d7f7c /drivers/misc | |
| parent | a7b71bc043aded9da4cf51f85271e0779161fe22 (diff) | |
mei: bus: Call bus routines from the core code
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>
Diffstat (limited to 'drivers/misc')
| -rw-r--r-- | drivers/misc/mei/bus.c | 22 | ||||
| -rw-r--r-- | drivers/misc/mei/interrupt.c | 2 | ||||
| -rw-r--r-- | drivers/misc/mei/main.c | 13 | ||||
| -rw-r--r-- | drivers/misc/mei/mei_dev.h | 6 | ||||
| -rw-r--r-- | drivers/misc/mei/pci-me.c | 1 |
5 files changed, 42 insertions, 2 deletions
diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c index 162cd542cac9..c626dc9937eb 100644 --- a/drivers/misc/mei/bus.c +++ b/drivers/misc/mei/bus.c | |||
| @@ -441,3 +441,25 @@ int mei_cl_register_event_cb(struct mei_cl_device *device, | |||
| 441 | return 0; | 441 | return 0; |
| 442 | } | 442 | } |
| 443 | EXPORT_SYMBOL_GPL(mei_cl_register_event_cb); | 443 | EXPORT_SYMBOL_GPL(mei_cl_register_event_cb); |
| 444 | |||
| 445 | void mei_cl_bus_rx_event(struct mei_cl *cl) | ||
| 446 | { | ||
| 447 | struct mei_cl_device *device = cl->device; | ||
| 448 | |||
| 449 | if (!device || !device->event_cb) | ||
| 450 | return; | ||
| 451 | |||
| 452 | set_bit(MEI_CL_EVENT_RX, &device->events); | ||
| 453 | |||
| 454 | schedule_work(&device->event_work); | ||
| 455 | } | ||
| 456 | |||
| 457 | int __init mei_cl_bus_init(void) | ||
| 458 | { | ||
| 459 | return bus_register(&mei_cl_bus_type); | ||
| 460 | } | ||
| 461 | |||
| 462 | void __exit mei_cl_bus_exit(void) | ||
| 463 | { | ||
| 464 | bus_unregister(&mei_cl_bus_type); | ||
| 465 | } | ||
diff --git a/drivers/misc/mei/interrupt.c b/drivers/misc/mei/interrupt.c index 6ce45ef2cd6c..255e0853479c 100644 --- a/drivers/misc/mei/interrupt.c +++ b/drivers/misc/mei/interrupt.c | |||
| @@ -50,6 +50,8 @@ static void mei_cl_complete_handler(struct mei_cl *cl, struct mei_cl_cb *cb) | |||
| 50 | cl->reading_state = MEI_READ_COMPLETE; | 50 | cl->reading_state = MEI_READ_COMPLETE; |
| 51 | if (waitqueue_active(&cl->rx_wait)) | 51 | if (waitqueue_active(&cl->rx_wait)) |
| 52 | wake_up_interruptible(&cl->rx_wait); | 52 | wake_up_interruptible(&cl->rx_wait); |
| 53 | else | ||
| 54 | mei_cl_bus_rx_event(cl); | ||
| 53 | 55 | ||
| 54 | } | 56 | } |
| 55 | } | 57 | } |
diff --git a/drivers/misc/mei/main.c b/drivers/misc/mei/main.c index 27b3df2ba070..872de9d1494b 100644 --- a/drivers/misc/mei/main.c +++ b/drivers/misc/mei/main.c | |||
| @@ -767,6 +767,19 @@ void mei_deregister(void) | |||
| 767 | } | 767 | } |
| 768 | EXPORT_SYMBOL_GPL(mei_deregister); | 768 | EXPORT_SYMBOL_GPL(mei_deregister); |
| 769 | 769 | ||
| 770 | static int __init mei_init(void) | ||
| 771 | { | ||
| 772 | return mei_cl_bus_init(); | ||
| 773 | } | ||
| 774 | |||
| 775 | static void __exit mei_exit(void) | ||
| 776 | { | ||
| 777 | mei_cl_bus_exit(); | ||
| 778 | } | ||
| 779 | |||
| 780 | module_init(mei_init); | ||
| 781 | module_exit(mei_exit); | ||
| 782 | |||
| 770 | MODULE_AUTHOR("Intel Corporation"); | 783 | MODULE_AUTHOR("Intel Corporation"); |
| 771 | MODULE_DESCRIPTION("Intel(R) Management Engine Interface"); | 784 | MODULE_DESCRIPTION("Intel(R) Management Engine Interface"); |
| 772 | MODULE_LICENSE("GPL v2"); | 785 | MODULE_LICENSE("GPL v2"); |
diff --git a/drivers/misc/mei/mei_dev.h b/drivers/misc/mei/mei_dev.h index 0313c24a1a49..7d594bedc685 100644 --- a/drivers/misc/mei/mei_dev.h +++ b/drivers/misc/mei/mei_dev.h | |||
| @@ -292,6 +292,11 @@ struct mei_cl_transport_ops { | |||
| 292 | int (*recv)(struct mei_cl_device *device, u8 *buf, size_t length); | 292 | int (*recv)(struct mei_cl_device *device, u8 *buf, size_t length); |
| 293 | }; | 293 | }; |
| 294 | 294 | ||
| 295 | void mei_cl_bus_rx_event(struct mei_cl *cl); | ||
| 296 | int mei_cl_bus_init(void); | ||
| 297 | void mei_cl_bus_exit(void); | ||
| 298 | |||
| 299 | |||
| 295 | /** | 300 | /** |
| 296 | * struct mei_cl_device - MEI device handle | 301 | * struct mei_cl_device - MEI device handle |
| 297 | * An mei_cl_device pointer is returned from mei_add_device() | 302 | * An mei_cl_device pointer is returned from mei_add_device() |
| @@ -451,7 +456,6 @@ static inline u32 mei_data2slots(size_t length) | |||
| 451 | return DIV_ROUND_UP(sizeof(struct mei_msg_hdr) + length, 4); | 456 | return DIV_ROUND_UP(sizeof(struct mei_msg_hdr) + length, 4); |
| 452 | } | 457 | } |
| 453 | 458 | ||
| 454 | |||
| 455 | /* | 459 | /* |
| 456 | * mei init function prototypes | 460 | * mei init function prototypes |
| 457 | */ | 461 | */ |
diff --git a/drivers/misc/mei/pci-me.c b/drivers/misc/mei/pci-me.c index 178928eaf6cf..a1a582b66f0d 100644 --- a/drivers/misc/mei/pci-me.c +++ b/drivers/misc/mei/pci-me.c | |||
| @@ -197,7 +197,6 @@ static int mei_me_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
| 197 | mei_pdev = pdev; | 197 | mei_pdev = pdev; |
| 198 | pci_set_drvdata(pdev, dev); | 198 | pci_set_drvdata(pdev, dev); |
| 199 | 199 | ||
| 200 | |||
| 201 | schedule_delayed_work(&dev->timer_work, HZ); | 200 | schedule_delayed_work(&dev->timer_work, HZ); |
| 202 | 201 | ||
| 203 | mutex_unlock(&mei_mutex); | 202 | mutex_unlock(&mei_mutex); |
