*
*/
-/******************************************************************************
- *
- * Device reset
- *
- ******************************************************************************
- */
-
-/**
- * Reset hardware
- *
- * @v intelxl Intel device
- * @ret rc Return status code
- */
-static int intelxl_reset ( struct intelxl_nic *intelxl ) {
- uint32_t pfgen_ctrl;
-
- /* Perform a global software reset */
- pfgen_ctrl = readl ( intelxl->regs + INTELXL_PFGEN_CTRL );
- writel ( ( pfgen_ctrl | INTELXL_PFGEN_CTRL_PFSWR ),
- intelxl->regs + INTELXL_PFGEN_CTRL );
- mdelay ( INTELXL_RESET_DELAY_MS );
-
- return 0;
-}
-
/******************************************************************************
*
* MAC address
dma_set_mask_64bit ( intelxl->dma );
netdev->dma = intelxl->dma;
- /* Reset the NIC */
- if ( ( rc = intelxl_reset ( intelxl ) ) != 0 )
- goto err_reset;
+ /* Locate PCI Express capability */
+ intelxl->exp = pci_find_capability ( pci, PCI_CAP_ID_EXP );
+ if ( ! intelxl->exp ) {
+ DBGC ( intelxl, "INTELXL %p missing PCIe capability\n",
+ intelxl );
+ rc = -ENXIO;
+ goto err_exp;
+ }
+
+ /* Reset the function via PCIe FLR */
+ pci_reset ( pci, intelxl->exp );
/* Get function number, port number and base queue number */
pffunc_rid = readl ( intelxl->regs + INTELXL_PFFUNC_RID );
intelxl_msix_disable ( intelxl, pci );
err_msix:
err_fetch_mac:
- intelxl_reset ( intelxl );
- err_reset:
+ pci_reset ( pci, intelxl->exp );
+ err_exp:
iounmap ( intelxl->regs );
err_ioremap:
netdev_nullify ( netdev );
intelxl_msix_disable ( intelxl, pci );
/* Reset the NIC */
- intelxl_reset ( intelxl );
+ pci_reset ( pci, intelxl->exp );
/* Free network device */
iounmap ( intelxl->regs );
INTELXL_QINT_TQCTL_NEXTQ_TYPE ( 0x1 ) /**< Transmit queue */
#define INTELXL_QINT_TQCTL_CAUSE_ENA 0x40000000UL /**< Enable */
-/** PF Control Register */
-#define INTELXL_PFGEN_CTRL 0x092400
-#define INTELXL_PFGEN_CTRL_PFSWR 0x00000001UL /**< Software Reset */
-
-/** Time to delay for device reset, in milliseconds */
-#define INTELXL_RESET_DELAY_MS 100
-
/** Function Requester ID Information Register */
#define INTELXL_PFFUNC_RID 0x09c000
#define INTELXL_PFFUNC_RID_FUNC_NUM(x) \