1/*-
2 * Copyright (C) 2012 Emulex
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright notice,
--- 22 unchanged lines hidden (view full) ---
31 * Contact Information:
32 * freebsd-drivers@emulex.com
33 *
34 * Emulex
35 * 3333 Susan Street
36 * Costa Mesa, CA 92626
37 */
38
39/* $FreeBSD: head/sys/dev/oce/oce_hw.c 232470 2012-03-03 18:03:50Z jhb $ */
40
41#include "oce_if.h"
42
43static int oce_POST(POCE_SOFTC sc);
44
45/**
46 * @brief Function to post status
47 * @param sc software handle to the device
--- 352 unchanged lines hidden (view full) ---
400 0, &sc->macaddr.mac_addr[0], &sc->if_id);
401 if (rc)
402 return rc;
403
404 atomic_inc_32(&sc->nifs);
405
406 sc->if_cap_flags = capab_en_flags;
407
408 /* Enable VLAN Promisc on HW */
409 rc = oce_config_vlan(sc, (uint8_t) sc->if_id, NULL, 0, 1, 1);
410 if (rc)
411 goto error;
412
413 /* set default flow control */
414 rc = oce_set_flow_control(sc, sc->flow_control);
415 if (rc)
416 goto error;
417
418 rc = oce_rxf_set_promiscuous(sc, sc->promisc);
419 if (rc)
420 goto error;
--- 51 unchanged lines hidden (view full) ---
472 struct link_status link = { 0 };
473 int rc = 0;
474
475 rc = oce_get_link_status(sc, &link);
476 if (rc)
477 return 1;
478
479 if (link.logical_link_status == NTWK_LOGICAL_LINK_UP) {
480 sc->ifp->if_drv_flags |= IFF_DRV_RUNNING;
481 sc->link_status = NTWK_LOGICAL_LINK_UP;
482 if_link_state_change(sc->ifp, LINK_STATE_UP);
483 } else {
484 sc->ifp->if_drv_flags &=
485 ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE);
486 sc->link_status = NTWK_LOGICAL_LINK_DOWN;
487 if_link_state_change(sc->ifp, LINK_STATE_DOWN);
488 }
489
490 if (link.mac_speed > 0 && link.mac_speed < 5)
491 sc->link_speed = link.mac_speed;
492 else
493 sc->link_speed = 0;
--- 102 unchanged lines hidden ---
2 * Copyright (C) 2012 Emulex
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright notice,
--- 22 unchanged lines hidden (view full) ---
31 * Contact Information:
32 * freebsd-drivers@emulex.com
33 *
34 * Emulex
35 * 3333 Susan Street
36 * Costa Mesa, CA 92626
37 */
38
39/* $FreeBSD: head/sys/dev/oce/oce_hw.c 232470 2012-03-03 18:03:50Z jhb $ */
40
41#include "oce_if.h"
42
43static int oce_POST(POCE_SOFTC sc);
44
45/**
46 * @brief Function to post status
47 * @param sc software handle to the device
--- 352 unchanged lines hidden (view full) ---
400 0, &sc->macaddr.mac_addr[0], &sc->if_id);
401 if (rc)
402 return rc;
403
404 atomic_inc_32(&sc->nifs);
405
406 sc->if_cap_flags = capab_en_flags;
407
408 /* Enable VLAN Promisc on HW */
409 rc = oce_config_vlan(sc, (uint8_t) sc->if_id, NULL, 0, 1, 1);
410 if (rc)
411 goto error;
412
413 /* set default flow control */
414 rc = oce_set_flow_control(sc, sc->flow_control);
415 if (rc)
416 goto error;
417
418 rc = oce_rxf_set_promiscuous(sc, sc->promisc);
419 if (rc)
420 goto error;
--- 51 unchanged lines hidden (view full) ---
472 struct link_status link = { 0 };
473 int rc = 0;
474
475 rc = oce_get_link_status(sc, &link);
476 if (rc)
477 return 1;
478
479 if (link.logical_link_status == NTWK_LOGICAL_LINK_UP) {
480 sc->ifp->if_drv_flags |= IFF_DRV_RUNNING;
481 sc->link_status = NTWK_LOGICAL_LINK_UP;
482 if_link_state_change(sc->ifp, LINK_STATE_UP);
483 } else {
484 sc->ifp->if_drv_flags &=
485 ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE);
486 sc->link_status = NTWK_LOGICAL_LINK_DOWN;
487 if_link_state_change(sc->ifp, LINK_STATE_DOWN);
488 }
489
490 if (link.mac_speed > 0 && link.mac_speed < 5)
491 sc->link_speed = link.mac_speed;
492 else
493 sc->link_speed = 0;
--- 102 unchanged lines hidden ---