drivers/misc/mei/client.c
Source file repositories/reference/linux-study-clean/drivers/misc/mei/client.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/misc/mei/client.c- Extension
.c- Size
- 51991 bytes
- Lines
- 2443
- Domain
- Driver Families
- Bucket
- drivers/misc
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/sched/signal.hlinux/wait.hlinux/delay.hlinux/slab.hlinux/pm_runtime.hlinux/dma-mapping.hlinux/mei.hmei_dev.hhbm.hclient.h
Detected Declarations
function Copyrightfunction mei_me_cl_releasefunction mei_me_cl_putfunction __mei_me_cl_delfunction mei_me_cl_delfunction mei_me_cl_addfunction list_for_each_entryfunction list_for_each_entryfunction mei_me_cl_rm_by_uuidfunction mei_me_cl_rm_allfunction mei_io_cb_freefunction mei_tx_cb_enqueuefunction mei_tx_cb_dequeuefunction mei_cl_set_read_by_fpfunction list_for_each_entryfunction mei_io_list_flush_clfunction list_for_each_entry_safefunction mei_io_tx_list_free_clfunction list_for_each_entry_safefunction mei_io_list_free_fpfunction mei_cl_free_pendingfunction mei_cl_flush_queuesfunction mei_cl_initfunction mei_cl_linkfunction mei_cl_unlinkfunction mei_host_client_initfunction mei_hbuf_acquirefunction mei_cl_wake_allfunction mei_cl_set_disconnectedfunction mei_cl_set_connectingfunction mei_cl_send_disconnectfunction mei_cl_irq_disconnectfunction __mei_cl_disconnectfunction mei_cl_disconnectfunction mei_cl_is_other_connectingfunction list_for_each_entryfunction mei_cl_send_connectfunction mei_cl_irq_connectfunction mei_cl_connectfunction mei_cl_tx_flow_ctrl_credsfunction mei_cl_tx_flow_ctrl_creds_reducefunction ERR_PTRfunction ERR_PTRfunction mei_cl_reset_read_by_vtagfunction list_for_each_entryfunction mei_cl_read_vtag_add_fcfunction list_for_each_entryfunction mei_cl_vt_support_check
Annotated Snippet
if (__me_cl->client_id == client_id) {
me_cl = mei_me_cl_get(__me_cl);
break;
}
}
up_read(&dev->me_clients_rwsem);
return me_cl;
}
/**
* __mei_me_cl_by_uuid_id - locate me client by client id and uuid
* increases ref count
*
* @dev: the device structure
* @uuid: me client uuid
* @client_id: me client id
*
* Return: me client or null if not found
*
* Locking: dev->me_clients_rwsem
*/
static struct mei_me_client *__mei_me_cl_by_uuid_id(struct mei_device *dev,
const uuid_le *uuid, u8 client_id)
{
struct mei_me_client *me_cl;
const uuid_le *pn;
WARN_ON(!rwsem_is_locked(&dev->me_clients_rwsem));
list_for_each_entry(me_cl, &dev->me_clients, list) {
pn = &me_cl->props.protocol_name;
if (uuid_le_cmp(*uuid, *pn) == 0 &&
me_cl->client_id == client_id)
return mei_me_cl_get(me_cl);
}
return NULL;
}
/**
* mei_me_cl_by_uuid_id - locate me client by client id and uuid
* increases ref count
*
* @dev: the device structure
* @uuid: me client uuid
* @client_id: me client id
*
* Return: me client or null if not found
*/
struct mei_me_client *mei_me_cl_by_uuid_id(struct mei_device *dev,
const uuid_le *uuid, u8 client_id)
{
struct mei_me_client *me_cl;
down_read(&dev->me_clients_rwsem);
me_cl = __mei_me_cl_by_uuid_id(dev, uuid, client_id);
up_read(&dev->me_clients_rwsem);
return me_cl;
}
/**
* mei_me_cl_rm_by_uuid - remove all me clients matching uuid
*
* @dev: the device structure
* @uuid: me client uuid
*
* Locking: called under "dev->device_lock" lock
*/
void mei_me_cl_rm_by_uuid(struct mei_device *dev, const uuid_le *uuid)
{
struct mei_me_client *me_cl;
dev_dbg(&dev->dev, "remove %pUl\n", uuid);
down_write(&dev->me_clients_rwsem);
me_cl = __mei_me_cl_by_uuid(dev, uuid);
__mei_me_cl_del(dev, me_cl);
mei_me_cl_put(me_cl);
up_write(&dev->me_clients_rwsem);
}
/**
* mei_me_cl_rm_all - remove all me clients
*
* @dev: the device structure
*
* Locking: called under "dev->device_lock" lock
Annotation
- Immediate include surface: `linux/sched/signal.h`, `linux/wait.h`, `linux/delay.h`, `linux/slab.h`, `linux/pm_runtime.h`, `linux/dma-mapping.h`, `linux/mei.h`, `mei_dev.h`.
- Detected declarations: `function Copyright`, `function mei_me_cl_release`, `function mei_me_cl_put`, `function __mei_me_cl_del`, `function mei_me_cl_del`, `function mei_me_cl_add`, `function list_for_each_entry`, `function list_for_each_entry`, `function mei_me_cl_rm_by_uuid`, `function mei_me_cl_rm_all`.
- Atlas domain: Driver Families / drivers/misc.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.