drivers/infiniband/core/iwpm_util.h

Source file repositories/reference/linux-study-clean/drivers/infiniband/core/iwpm_util.h

File Facts

System
Linux kernel
Corpus path
drivers/infiniband/core/iwpm_util.h
Extension
.h
Size
8267 bytes
Lines
266
Domain
Driver Families
Bucket
drivers/infiniband
Inferred role
Driver Families: implementation source
Status
source 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.

Dependency Surface

Detected Declarations

Annotated Snippet

struct iwpm_nlmsg_request {
	struct list_head    inprocess_list;
	__u32               nlmsg_seq;
	void                *req_buffer;
	u8	            nl_client;
	u8                  request_done;
	u16                 err_code;
	struct semaphore    sem;
	struct kref         kref;
};

struct iwpm_mapping_info {
	struct hlist_node hlist_node;
	struct sockaddr_storage local_sockaddr;
	struct sockaddr_storage mapped_sockaddr;
	u8     nl_client;
	u32    map_flags;
};

struct iwpm_remote_info {
	struct hlist_node hlist_node;
	struct sockaddr_storage remote_sockaddr;
	struct sockaddr_storage mapped_loc_sockaddr;
	struct sockaddr_storage mapped_rem_sockaddr;
	u8     nl_client;
};

struct iwpm_admin_data {
	atomic_t nlmsg_seq;
	u32      reg_list[RDMA_NL_NUM_CLIENTS];
};

/**
 * iwpm_get_nlmsg_request - Allocate and initialize netlink message request
 * @nlmsg_seq: Sequence number of the netlink message
 * @nl_client: The index of the netlink client
 * @gfp: Indicates how the memory for the request should be allocated
 *
 * Returns the newly allocated netlink request object if successful,
 * otherwise returns NULL
 */
struct iwpm_nlmsg_request *iwpm_get_nlmsg_request(__u32 nlmsg_seq,
						u8 nl_client, gfp_t gfp);

/**
 * iwpm_free_nlmsg_request - Deallocate netlink message request
 * @kref: Holds reference of netlink message request
 */
void iwpm_free_nlmsg_request(struct kref *kref);

/**
 * iwpm_find_nlmsg_request - Find netlink message request in the request list
 * @echo_seq: Sequence number of the netlink request to find
 *
 * Returns the found netlink message request,
 * if not found, returns NULL
 */
struct iwpm_nlmsg_request *iwpm_find_nlmsg_request(__u32 echo_seq);

/**
 * iwpm_wait_complete_req - Block while servicing the netlink request
 * @nlmsg_request: Netlink message request to service
 *
 * Wakes up, after the request is completed or expired
 * Returns 0 if the request is complete without error
 */
int iwpm_wait_complete_req(struct iwpm_nlmsg_request *nlmsg_request);

/**
 * iwpm_get_nlmsg_seq - Get the sequence number for a netlink
 *			message to send to the port mapper
 *
 * Returns the sequence number for the netlink message.
 */
int iwpm_get_nlmsg_seq(void);

/**
 * iwpm_add_remote_info - Add remote address info of the connecting peer
 *                    to the remote info hash table
 * @reminfo: The remote info to be added
 */
void iwpm_add_remote_info(struct iwpm_remote_info *reminfo);

/**
 * iwpm_check_registration - Check if the client registration
 *			      matches the given one
 * @nl_client: The index of the netlink client
 * @reg: The given registration type to compare with
 *
 * Call iwpm_register_pid() to register a client

Annotation

Implementation Notes