]> git.karo-electronics.de Git - linux-beck.git/commitdiff
mei: drop reserved host client ids
authorAlexander Usyskin <alexander.usyskin@intel.com>
Sun, 7 Feb 2016 21:35:40 +0000 (23:35 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 7 Feb 2016 22:47:20 +0000 (14:47 -0800)
The reserved host clients can be obsoleted now, a portion of the
platforms is shipped without iAMT enabled, where the reservation is not
relevant and for platforms with iAMT dynamic allocation is sufficient.
Dropping reserved ids makes enumeration more flexible and generic

Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/mei/amthif.c
drivers/misc/mei/bus-fixup.c
drivers/misc/mei/bus.c
drivers/misc/mei/client.c
drivers/misc/mei/client.h
drivers/misc/mei/main.c
drivers/misc/mei/mei_dev.h

index ca2efc3602df261aa7a526f6f9d3ef46b4c3a4a9..de194ef573ee6f1095cba316e8ababc263291c31 100644 (file)
@@ -71,7 +71,7 @@ int mei_amthif_host_init(struct mei_device *dev, struct mei_me_client *me_cl)
 
        mei_cl_init(cl, dev);
 
-       ret = mei_cl_link(cl, MEI_IAMTHIF_HOST_CLIENT_ID);
+       ret = mei_cl_link(cl);
        if (ret < 0) {
                dev_err(dev->dev, "amthif: failed cl_link %d\n", ret);
                return ret;
index b87323f4bb1478cbd2b6940df6b982dea89960f9..e9e6ea3ab73cf3500657d8c6001cb4eff5712568 100644 (file)
@@ -239,7 +239,7 @@ static void mei_nfc(struct mei_cl_device *cldev)
 
        mutex_lock(&bus->device_lock);
        /* we need to connect to INFO GUID */
-       cl = mei_cl_alloc_linked(bus, MEI_HOST_CLIENT_ID_ANY);
+       cl = mei_cl_alloc_linked(bus);
        if (IS_ERR(cl)) {
                ret = PTR_ERR(cl);
                cl = NULL;
index 83b084558ee553bd3b7c78d90240c7a7c66aad50..bc18e5519da6537dc506ea677ba7d5b653b3074f 100644 (file)
@@ -417,7 +417,7 @@ int mei_cldev_enable(struct mei_cl_device *cldev)
 
        if (!cl) {
                mutex_lock(&bus->device_lock);
-               cl = mei_cl_alloc_linked(bus, MEI_HOST_CLIENT_ID_ANY);
+               cl = mei_cl_alloc_linked(bus);
                mutex_unlock(&bus->device_lock);
                if (IS_ERR(cl))
                        return PTR_ERR(cl);
index a27ae2deecb44171052fd46f359ee9b1eee8f3f4..2890669b81f940aba7d24dd6848529309d4d96bf 100644 (file)
@@ -587,27 +587,23 @@ struct mei_cl *mei_cl_allocate(struct mei_device *dev)
  * mei_cl_link - allocate host id in the host map
  *
  * @cl: host client
- * @id: fixed host id or MEI_HOST_CLIENT_ID_ANY (-1) for generic one
  *
  * Return: 0 on success
  *     -EINVAL on incorrect values
  *     -EMFILE if open count exceeded.
  */
-int mei_cl_link(struct mei_cl *cl, int id)
+int mei_cl_link(struct mei_cl *cl)
 {
        struct mei_device *dev;
        long open_handle_count;
+       int id;
 
        if (WARN_ON(!cl || !cl->dev))
                return -EINVAL;
 
        dev = cl->dev;
 
-       /* If Id is not assigned get one*/
-       if (id == MEI_HOST_CLIENT_ID_ANY)
-               id = find_first_zero_bit(dev->host_clients_map,
-                                       MEI_CLIENTS_MAX);
-
+       id = find_first_zero_bit(dev->host_clients_map, MEI_CLIENTS_MAX);
        if (id >= MEI_CLIENTS_MAX) {
                dev_err(dev->dev, "id exceeded %d", MEI_CLIENTS_MAX);
                return -EMFILE;
@@ -1143,11 +1139,10 @@ nortpm:
  * mei_cl_alloc_linked - allocate and link host client
  *
  * @dev: the device structure
- * @id: fixed host id or MEI_HOST_CLIENT_ID_ANY (-1) for generic one
  *
  * Return: cl on success ERR_PTR on failure
  */
-struct mei_cl *mei_cl_alloc_linked(struct mei_device *dev, int id)
+struct mei_cl *mei_cl_alloc_linked(struct mei_device *dev)
 {
        struct mei_cl *cl;
        int ret;
@@ -1158,7 +1153,7 @@ struct mei_cl *mei_cl_alloc_linked(struct mei_device *dev, int id)
                goto err;
        }
 
-       ret = mei_cl_link(cl, id);
+       ret = mei_cl_link(cl);
        if (ret)
                goto err;
 
index be6929620d616523be302f6734b70e509ae523eb..a912ea686d97ba00aa6277c0c65e961a74340cce 100644 (file)
@@ -107,10 +107,10 @@ struct mei_cl *mei_cl_allocate(struct mei_device *dev);
 void mei_cl_init(struct mei_cl *cl, struct mei_device *dev);
 
 
-int mei_cl_link(struct mei_cl *cl, int id);
+int mei_cl_link(struct mei_cl *cl);
 int mei_cl_unlink(struct mei_cl *cl);
 
-struct mei_cl *mei_cl_alloc_linked(struct mei_device *dev, int id);
+struct mei_cl *mei_cl_alloc_linked(struct mei_device *dev);
 
 struct mei_cl_cb *mei_cl_read_cb(const struct mei_cl *cl,
                                 const struct file *fp);
index 58fa2c83ee393698beb6d5f910f5ea8d96ff539f..17970163eacc32a477ec21f7f3022a4f467ace28 100644 (file)
@@ -65,7 +65,7 @@ static int mei_open(struct inode *inode, struct file *file)
                goto err_unlock;
        }
 
-       cl = mei_cl_alloc_linked(dev, MEI_HOST_CLIENT_ID_ANY);
+       cl = mei_cl_alloc_linked(dev);
        if (IS_ERR(cl)) {
                err = PTR_ERR(cl);
                goto err_unlock;
index 6d97f3335e2230f823d18432a1625a4505654d6c..320ddae5ee1e98da08b485a1804fd5435071f6f7 100644 (file)
@@ -53,14 +53,6 @@ extern const uuid_le mei_amthif_guid;
  */
 #define  MEI_MAX_OPEN_HANDLE_COUNT (MEI_CLIENTS_MAX - 1)
 
-/*
- * Internal Clients Number
- */
-#define MEI_HOST_CLIENT_ID_ANY        (-1)
-#define MEI_HBM_HOST_CLIENT_ID         0 /* not used, just for documentation */
-#define MEI_IAMTHIF_HOST_CLIENT_ID     2
-
-
 /* File state */
 enum file_state {
        MEI_FILE_INITIALIZING = 0,