staticint __fbnic_fw_enable_mbx(struct fbnic_dev *fbd, int vector)
{ int err;
/* Initialize mailbox and attempt to poll it into ready state */
fbnic_mbx_init(fbd);
err = fbnic_mbx_poll_tx_ready(fbd); if (err) {
dev_warn(fbd->dev, "FW mailbox did not enter ready state\n"); return err;
}
/* Enable interrupt and unmask the vector */
enable_irq(vector);
fbnic_wr32(fbd, FBNIC_INTR_MASK_CLEAR(0), 1u << FBNIC_FW_MSIX_ENTRY);
/* Mask the vector */
fbnic_wr32(fbd, FBNIC_INTR_MASK_SET(0), 1u << FBNIC_FW_MSIX_ENTRY);
/* Make sure disabling logs message is sent, must be done here to *avoidriskofcompletingwithoutarunninginterrupt.
*/
fbnic_mbx_flush_tx(fbd);
fbnic_mbx_clean(fbd);
}
/** *fbnic_fw_free_mbx-Disablemailboxandplaceitinstandbystate *@fbd:Pointertodevicetodisable * *Thisfunctionwilldisablethemailboxinterrupt,freeanymessagesstill *inthemailboxandplaceitintoadisabledstate.Thefirmwareis *expectedtoseetheupdateandassumethatthehostisintheresetstate.
**/ void fbnic_fw_free_mbx(struct fbnic_dev *fbd)
{ /* Vector has already been freed */ if (!fbd->fw_msix_vector) return;
vector = pci_irq_vector(pdev, FBNIC_PCS_MSIX_ENTRY); if (vector < 0) return vector;
/* Request the IRQ for PCS link vector. *MapPCScausetoit,andunmaskit
*/
err = request_irq(vector, &fbnic_pcs_msix_intr, 0,
fbd->netdev->name, fbd); if (err) return err;
/* Map and enable interrupt, unmask vector after link is configured */
fbnic_wr32(fbd, FBNIC_INTR_MSIX_CTRL(FBNIC_INTR_MSIX_CTRL_PCS_IDX),
FBNIC_PCS_MSIX_ENTRY | FBNIC_INTR_MSIX_CTRL_ENABLE);
fbd->pcs_msix_vector = vector;
return0;
}
/** *fbnic_pcs_free_irq-TeardownthePCSIRQtoprepareforstopping *@fbd:Pointertodevicethatisstopping * *Thisfunctionundoestheworkdoneinfbnic_pcs_request_irqandprepares *thedevicetonolongerreceivetrafficonthehostinterface.
**/ void fbnic_pcs_free_irq(struct fbnic_dev *fbd)
{ /* Vector has already been freed */ if (!fbd->pcs_msix_vector) return;
for (i = 0; i < ARRAY_SIZE(fbd->napi_irq); i++)
snprintf(fbd->napi_irq[i].name, sizeof(fbd->napi_irq[i].name), "%s-TxRx-%u", fbd->netdev->name, i);
}
int fbnic_napi_request_irq(struct fbnic_dev *fbd, struct fbnic_napi_vector *nv)
{ struct fbnic_net *fbn = netdev_priv(fbd->netdev); int i = fbnic_napi_idx(nv); int err;
if (!fbd->napi_irq[i].users) {
err = fbnic_request_irq(fbd, nv->v_idx,
fbnic_msix_clean_rings, 0,
fbd->napi_irq[i].name,
&fbn->napi[i]); if (err) return err;
}
fbd->napi_irq[i].users++; return0;
}
void fbnic_napi_free_irq(struct fbnic_dev *fbd, struct fbnic_napi_vector *nv)
{ struct fbnic_net *fbn = netdev_priv(fbd->netdev); int i = fbnic_napi_idx(nv);
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.