FreeBSD/sys/dev/bxe/bxe.c
/* this function is called upon a link interrupt */
this function is called upon a link interrupt
this function is called upon a link interrupt
static void
bxe_link_attn(struct bxe_softc *sc)
{
    uint32_t pause_enabled = 0;
    struct host_port_stats *pstats;
    int cmng_fns;
    bxe_stats_handle(sc, STATS_EVENT_STOP);
    elink_link_update(&sc->link_params, &sc->link_vars);
    if (sc->link_vars.link_up) {
        if (!CHIP_IS_E1(sc) && sc->dropless_fc) {
            pause_enabled = 0;
            if (sc->link_vars.flow_ctrl & ELINK_FLOW_CTRL_TX) {
                pause_enabled = 1;
            }
            REG_WR(sc,
                   (BAR_USTRORM_INTMEM +
                    USTORM_ETH_PAUSE_ENABLED_OFFSET(SC_PORT(sc))),
                   pause_enabled);
        }
        if (sc->link_vars.mac_type != ELINK_MAC_TYPE_EMAC) {
            pstats = BXE_SP(sc, port_stats);
            memset(&(pstats->mac_stx[0]), 0, sizeof(struct mac_stx));
        }
        if (sc->state == BXE_STATE_OPEN) {
            bxe_stats_handle(sc, STATS_EVENT_LINK_UP);
        }
    }
    if (sc->link_vars.link_up && sc->link_vars.line_speed) {
        cmng_fns = bxe_get_cmng_fns_mode(sc);
        if (cmng_fns != CMNG_FNS_NONE) {
            bxe_cmng_fns_init(sc, FALSE, cmng_fns);
            storm_memset_cmng(sc, &sc->cmng, SC_PORT(sc));
        } else {
            BLOGD(sc, DBG_LOAD, "single function mode without fairness\n");
        }
    }
    bxe_link_report_locked(sc);
    if (IS_MF(sc)) {
        ; 
    }
}
static void bxe_link_attn ( struct bxe_softc * sc ) { uint32_t pause_enabled = 0 ; struct host_port_stats * pstats ; int cmng_fns ; bxe_stats_handle ( sc , STATS_EVENT_STOP ) ; elink_link_update ( & sc -> link_params , & sc -> link_vars ) ; if ( sc -> link_vars . link_up ) { if ( ! CHIP_IS_E1 ( sc ) && sc -> dropless_fc ) { pause_enabled = 0 ; if ( sc -> link_vars . flow_ctrl & ELINK_FLOW_CTRL_TX ) { pause_enabled = 1 ; } REG_WR ( sc , ( BAR_USTRORM_INTMEM + USTORM_ETH_PAUSE_ENABLED_OFFSET ( SC_PORT ( sc ) ) ) , pause_enabled ) ; } if ( sc -> link_vars . mac_type != ELINK_MAC_TYPE_EMAC ) { pstats = BXE_SP ( sc , port_stats ) ; memset ( & ( pstats -> mac_stx [ 0 ] ) , 0 , sizeof ( struct mac_stx ) ) ; } if ( sc -> state == BXE_STATE_OPEN ) { bxe_stats_handle ( sc , STATS_EVENT_LINK_UP ) ; } } if ( sc -> link_vars . link_up && sc -> link_vars . line_speed ) { cmng_fns = bxe_get_cmng_fns_mode ( sc ) ; if ( cmng_fns != CMNG_FNS_NONE ) { bxe_cmng_fns_init ( sc , FALSE , cmng_fns ) ; storm_memset_cmng ( sc , & sc -> cmng , SC_PORT ( sc ) ) ; } else { BLOGD ( sc , DBG_LOAD , " \n " ) ; } } bxe_link_report_locked ( sc ) ; if ( IS_MF ( sc ) ) { ; } }
this function is called upon a link interrupt
this function is called upon a link interrupt
/* Make sure that we are synced with the current statistics */ /* dropless flow control */ /* reset old mac stats */ /* rate shaping and fairness are disabled */ // XXX bxe_link_sync_notify(sc);