MCPcopy Create free account
hub / github.com/F-Stack/f-stack / cvm_oct_common_init

Function cvm_oct_common_init

freebsd/mips/cavium/octe/ethernet-common.c:302–335  ·  view source on GitHub ↗

* Per network device initialization * * @param dev Device to initialize * @return Zero on success */

Source from the content-addressed store, hash-verified

300 * @return Zero on success
301 */
302int cvm_oct_common_init(struct ifnet *ifp)
303{
304 uint8_t mac[6];
305 cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp->if_softc;
306
307 if (cvm_assign_mac_address(NULL, mac) != 0)
308 return ENXIO;
309
310 ifp->if_mtu = ETHERMTU;
311
312 cvm_oct_mdio_setup_device(ifp);
313
314 cvm_oct_common_set_mac_address(ifp, mac);
315 cvm_oct_common_change_mtu(ifp, ifp->if_mtu);
316
317 /*
318 * Do any last-minute board-specific initialization.
319 */
320 switch (cvmx_sysinfo_get()->board_type) {
321#if defined(OCTEON_VENDOR_LANNER)
322 case CVMX_BOARD_TYPE_CUST_LANNER_MR320:
323 case CVMX_BOARD_TYPE_CUST_LANNER_MR321X:
324 if (priv->phy_id == 16)
325 cvm_oct_mv88e61xx_setup_device(ifp);
326 break;
327#endif
328 default:
329 break;
330 }
331
332 device_attach(priv->dev);
333
334 return 0;
335}
336
337void cvm_oct_common_uninit(struct ifnet *ifp)
338{

Callers 4

cvm_oct_sgmii_initFunction · 0.85
cvm_oct_rgmii_initFunction · 0.85
cvm_oct_spi_initFunction · 0.85
cvm_oct_xaui_initFunction · 0.85

Calls 7

cvm_assign_mac_addressFunction · 0.85
cvmx_sysinfo_getFunction · 0.85
device_attachFunction · 0.50

Tested by

no test coverage detected