return 0;
err_alloc_cls:
- enetc_clear_cbdr(&si->cbd_ring);
- enetc_free_cbdr(&si->cbd_ring);
+ enetc_teardown_cbdr(&si->cbd_ring);
return err;
}
{
struct enetc_si *si = priv->si;
- enetc_clear_cbdr(&si->cbd_ring);
- enetc_free_cbdr(&si->cbd_ring);
+ enetc_teardown_cbdr(&si->cbd_ring);
kfree(priv->cls_rules);
}
/* control buffer descriptor ring (CBDR) */
int enetc_setup_cbdr(struct device *dev, struct enetc_hw *hw,
struct enetc_cbdr *cbdr);
-void enetc_free_cbdr(struct enetc_cbdr *cbdr);
-void enetc_clear_cbdr(struct enetc_cbdr *cbdr);
+void enetc_teardown_cbdr(struct enetc_cbdr *cbdr);
int enetc_set_mac_flt_entry(struct enetc_si *si, int index,
char *mac_addr, int si_map);
int enetc_clear_mac_flt_entry(struct enetc_si *si, int index);
return 0;
}
-void enetc_free_cbdr(struct enetc_cbdr *cbdr)
+void enetc_teardown_cbdr(struct enetc_cbdr *cbdr)
{
int size = cbdr->bd_count * sizeof(struct enetc_cbd);
+ /* disable ring */
+ enetc_wr_reg(cbdr->mr, 0);
+
dma_free_coherent(cbdr->dma_dev, size, cbdr->bd_base,
cbdr->bd_dma_base);
cbdr->bd_base = NULL;
cbdr->dma_dev = NULL;
}
-void enetc_clear_cbdr(struct enetc_cbdr *cbdr)
-{
- /* disable ring */
- enetc_wr_reg(cbdr->mr, 0);
-}
-
static void enetc_clean_cbdr(struct enetc_cbdr *ring)
{
struct enetc_cbd *dest_cbd;
enetc_init_port_rfs_memory(si);
enetc_init_port_rss_memory(si);
- enetc_clear_cbdr(&si->cbd_ring);
- enetc_free_cbdr(&si->cbd_ring);
+ enetc_teardown_cbdr(&si->cbd_ring);
}
static int enetc_pf_probe(struct pci_dev *pdev,