mei: bus: add me client device list infrastructure

Instead of holding the list of host clients (me_cl)
we want to keep the list me client devices (mei_cl_device)
This way we can create host to me client connection only when needed.
Add list head to mei_cl_device and cl_bus_lock
Add bus_added flag to the me client (mei_me_client) to track if
the appropriate mei_cl_device was already created and is_added
flag to mei_cl_device to track if it was already added to the device
list across the bus rescans

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Tomas Winkler
2015-07-23 15:08:42 +03:00
committed by Greg Kroah-Hartman
parent 512f64d9f7
commit 0ff0a8d853
4 changed files with 10 additions and 2 deletions

View File

@@ -18,6 +18,7 @@ typedef void (*mei_cl_event_cb_t)(struct mei_cl_device *device,
* Drivers for MEI devices will get an mei_cl_device pointer
* when being probed and shall use it for doing ME bus I/O.
*
* @bus_list: device on the bus list
* @bus: parent mei device
* @dev: linux driver model device pointer
* @me_cl: me client
@@ -28,9 +29,11 @@ typedef void (*mei_cl_event_cb_t)(struct mei_cl_device *device,
* events (e.g. Rx buffer pending) notifications.
* @event_context: event callback run context
* @events: Events bitmask sent to the driver.
* @is_added: device is already scanned
* @priv_data: client private data
*/
struct mei_cl_device {
struct list_head bus_list;
struct mei_device *bus;
struct device dev;
@@ -42,6 +45,7 @@ struct mei_cl_device {
mei_cl_event_cb_t event_cb;
void *event_context;
unsigned long events;
unsigned int is_added:1;
void *priv_data;
};