net/sfc: initialize port data on attach
[dpdk.git] / drivers / net / sfc / sfc.c
index a5d4736..8da7879 100644 (file)
@@ -409,9 +409,9 @@ sfc_configure(struct sfc_adapter *sa)
        if (rc != 0)
                goto fail_intr_configure;
 
-       rc = sfc_port_init(sa);
+       rc = sfc_port_configure(sa);
        if (rc != 0)
-               goto fail_port_init;
+               goto fail_port_configure;
 
        rc = sfc_rx_init(sa);
        if (rc != 0)
@@ -429,9 +429,9 @@ fail_tx_init:
        sfc_rx_fini(sa);
 
 fail_rx_init:
-       sfc_port_fini(sa);
+       sfc_port_close(sa);
 
-fail_port_init:
+fail_port_configure:
        sfc_intr_close(sa);
 
 fail_intr_configure:
@@ -453,7 +453,7 @@ sfc_close(struct sfc_adapter *sa)
 
        sfc_tx_fini(sa);
        sfc_rx_fini(sa);
-       sfc_port_fini(sa);
+       sfc_port_close(sa);
        sfc_intr_close(sa);
 
        sa->state = SFC_ADAPTER_INITIALIZED;
@@ -603,8 +603,9 @@ sfc_attach(struct sfc_adapter *sa)
        if (rc != 0)
                goto fail_ev_attach;
 
-       efx_phy_adv_cap_get(sa->nic, EFX_PHY_CAP_PERM,
-                           &sa->port.phy_adv_cap_mask);
+       rc = sfc_port_attach(sa);
+       if (rc != 0)
+               goto fail_port_attach;
 
        rc = sfc_set_rss_defaults(sa);
        if (rc != 0)
@@ -626,6 +627,9 @@ sfc_attach(struct sfc_adapter *sa)
 
 fail_filter_attach:
 fail_set_rss_defaults:
+       sfc_port_detach(sa);
+
+fail_port_attach:
        sfc_ev_detach(sa);
 
 fail_ev_attach:
@@ -651,6 +655,7 @@ sfc_detach(struct sfc_adapter *sa)
        sfc_flow_fini(sa);
 
        sfc_filter_detach(sa);
+       sfc_port_detach(sa);
        sfc_ev_detach(sa);
        sfc_intr_detach(sa);