/** * pds_client_register - Link the client to the firmware * @pf: ptr to the PF driver's private data struct * @devname: name that includes service into, e.g. pds_core.vDPA * * Return: positive client ID (ci) on success, or * negative for error
*/ int pds_client_register(struct pdsc *pf, char *devname)
{ union pds_core_adminq_comp comp = {}; union pds_core_adminq_cmd cmd = {}; int err;
u16 ci;
/** * pds_client_unregister - Unlink the client from the firmware * @pf: ptr to the PF driver's private data struct * @client_id: id returned from pds_client_register() * * Return: 0 on success, or * negative for error
*/ int pds_client_unregister(struct pdsc *pf, u16 client_id)
{ union pds_core_adminq_comp comp = {}; union pds_core_adminq_cmd cmd = {}; int err;
/** * pds_client_adminq_cmd - Process an adminq request for the client * @padev: ptr to the client device * @req: ptr to buffer with request * @req_len: length of actual struct used for request * @resp: ptr to buffer where answer is to be copied * @flags: optional flags from pds_core_adminq_flags * * Return: 0 on success, or * negative for error * * Client sends pointers to request and response buffers * Core copies request data into pds_core_client_request_cmd * Core sets other fields as needed * Core posts to AdminQ * Core copies completion data into response buffer
*/ int pds_client_adminq_cmd(struct pds_auxiliary_dev *padev, union pds_core_adminq_cmd *req,
size_t req_len, union pds_core_adminq_comp *resp,
u64 flags)
{ union pds_core_adminq_cmd cmd = {}; struct pci_dev *pf_pdev; struct pdsc *pf;
size_t cp_len; int err;
int pdsc_auxbus_dev_add(struct pdsc *cf, struct pdsc *pf, enum pds_core_vif_types vt, struct pds_auxiliary_dev **pd_ptr)
{ struct pds_auxiliary_dev *padev; char devname[PDS_DEVNAME_LEN]; unsignedlong mask;
u16 vt_support; int client_id; int err = 0;
if (!cf) return -ENODEV;
if (vt >= PDS_DEV_TYPE_MAX) return -EINVAL;
mutex_lock(&pf->config_lock);
mask = BIT_ULL(PDSC_S_FW_DEAD) |
BIT_ULL(PDSC_S_STOPPING_DRIVER); if (cf->state & mask) {
dev_err(pf->dev, "%s: can't add dev, VF client in bad state %#lx\n",
__func__, cf->state);
err = -ENXIO; goto out_unlock;
}
/* Verify that the type is supported and enabled. It is not * an error if the firmware doesn't support the feature, the * driver just won't set up an auxiliary_device for it.
*/
vt_support = !!le16_to_cpu(pf->dev_ident.vif_types[vt]); if (!(vt_support &&
pf->viftype_status[vt].supported &&
pf->viftype_status[vt].enabled)) goto out_unlock;
/* Need to register with FW and get the client_id before * creating the aux device so that the aux client can run * adminq commands as part its probe
*/
snprintf(devname, sizeof(devname), "%s.%s.%d",
PDS_CORE_DRV_NAME, pf->viftype_status[vt].name, cf->uid);
client_id = pds_client_register(pf, devname); if (client_id < 0) {
err = client_id; goto out_unlock;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.