Lines Matching refs:port

51 	struct sfxge_port *port = &sc->port;
52 efsys_mem_t *esmp = &(port->mac_stats.dma_buf);
57 SFXGE_PORT_LOCK_ASSERT_OWNED(port);
59 if (__predict_false(port->init_state != SFXGE_PORT_STARTED)) {
65 if (now - port->mac_stats.update_time < hz) {
70 port->mac_stats.update_time = now;
79 port->mac_stats.decode_buf, NULL)) != EAGAIN)
96 SFXGE_PORT_LOCK(&sc->port);
102 mac_stats = (uint64_t *)sc->port.mac_stats.decode_buf;
122 SFXGE_PORT_UNLOCK(&sc->port);
133 SFXGE_PORT_LOCK(&sc->port);
135 val = ((uint64_t *)sc->port.mac_stats.decode_buf)[id];
136 SFXGE_PORT_UNLOCK(&sc->port);
192 return (sc->port.wanted_fc);
205 struct sfxge_port *port;
210 port = &sc->port;
216 SFXGE_PORT_LOCK(port);
218 if (port->wanted_fc != fcntl) {
219 if (port->init_state == SFXGE_PORT_STARTED)
221 port->wanted_fc,
224 port->wanted_fc = fcntl;
227 SFXGE_PORT_UNLOCK(port);
229 SFXGE_PORT_LOCK(port);
230 fcntl = port->wanted_fc;
231 SFXGE_PORT_UNLOCK(port);
243 struct sfxge_port *port;
247 port = &sc->port;
249 SFXGE_PORT_LOCK(port);
250 if (__predict_true(port->init_state == SFXGE_PORT_STARTED) &&
255 SFXGE_PORT_UNLOCK(port);
276 struct sfxge_port *port;
279 port = &sc->port;
281 if (port->link_mode == mode)
284 port->link_mode = mode;
287 link_state = (port->link_mode != EFX_LINK_DOWN ?
289 if_initbaudrate(sc->ifnet, sfxge_link_baudrate[port->link_mode]);
298 struct sfxge_port *port;
303 port = &sc->port;
305 SFXGE_PORT_LOCK(port);
307 if (__predict_false(port->init_state != SFXGE_PORT_STARTED))
315 SFXGE_PORT_UNLOCK(port);
322 struct sfxge_port *port = &sc->port;
323 uint8_t *mcast_addr = port->mcast_addrs;
328 mtx_assert(&port->lock, MA_OWNED);
330 port->mcast_count = 0;
334 if (port->mcast_count == EFX_MAC_MULTICAST_LIST_MAX) {
344 ++port->mcast_count;
350 rc = efx_mac_multicast_list_set(sc->enp, port->mcast_addrs,
351 port->mcast_count);
364 struct sfxge_port *port = &sc->port;
368 mtx_assert(&port->lock, MA_OWNED);
378 (port->mcast_count > 0), all_mulcst, B_TRUE);
386 struct sfxge_port *port = &sc->port;
389 SFXGE_PORT_LOCK(port);
393 * checks IFF_DRV_RUNNING flag which implies port started, but
400 if (__predict_true(port->init_state == SFXGE_PORT_STARTED))
404 SFXGE_PORT_UNLOCK(port);
411 struct sfxge_port *port;
414 port = &sc->port;
417 SFXGE_PORT_LOCK(port);
419 KASSERT(port->init_state == SFXGE_PORT_STARTED,
420 ("port not started"));
422 port->init_state = SFXGE_PORT_INITIALIZED;
424 port->mac_stats.update_time = 0;
429 (void)efx_mac_stats_periodic(enp, &port->mac_stats.dma_buf, 0, B_FALSE);
431 port->link_mode = EFX_LINK_UNKNOWN;
433 /* Destroy the common code port object. */
438 SFXGE_PORT_UNLOCK(port);
446 struct sfxge_port *port;
452 port = &sc->port;
455 SFXGE_PORT_LOCK(port);
457 KASSERT(port->init_state == SFXGE_PORT_INITIALIZED,
458 ("port not initialized"));
464 /* Initialize the port object in the common code. */
488 if ((rc = efx_mac_stats_periodic(enp, &port->mac_stats.dma_buf,
502 port->init_state = SFXGE_PORT_STARTED;
505 SFXGE_PORT_UNLOCK(port);
514 (void)efx_mac_stats_periodic(enp, &port->mac_stats.dma_buf, 0, B_FALSE);
524 SFXGE_PORT_UNLOCK(port);
532 struct sfxge_port *port = &sc->port;
533 efsys_mem_t *esmp = &port->phy_stats.dma_buf;
538 SFXGE_PORT_LOCK_ASSERT_OWNED(port);
540 if (__predict_false(port->init_state != SFXGE_PORT_STARTED)) {
546 if (now - port->phy_stats.update_time < hz) {
551 port->phy_stats.update_time = now;
564 port->phy_stats.decode_buf)) != EAGAIN)
583 SFXGE_PORT_LOCK(&sc->port);
585 val = ((uint32_t *)sc->port.phy_stats.decode_buf)[id];
586 SFXGE_PORT_UNLOCK(&sc->port);
621 struct sfxge_port *port;
624 port = &sc->port;
625 esmp = &port->mac_stats.dma_buf;
627 KASSERT(port->init_state == SFXGE_PORT_INITIALIZED,
630 port->init_state = SFXGE_PORT_UNINITIALIZED;
632 port->link_mode = EFX_LINK_UNKNOWN;
635 sfxge_dma_free(&port->phy_stats.dma_buf);
636 free(port->phy_stats.decode_buf, M_SFXGE);
639 free(port->mac_stats.decode_buf, M_SFXGE);
641 SFXGE_PORT_LOCK_DESTROY(port);
643 port->sc = NULL;
649 struct sfxge_port *port;
655 port = &sc->port;
656 mac_stats_buf = &port->mac_stats.dma_buf;
657 phy_stats_buf = &port->phy_stats.dma_buf;
659 KASSERT(port->init_state == SFXGE_PORT_UNINITIALIZED,
662 port->sc = sc;
664 SFXGE_PORT_LOCK_INIT(port, device_get_nameunit(sc->dev));
667 port->phy_stats.decode_buf = malloc(EFX_PHY_NSTATS * sizeof(uint32_t),
680 port->wanted_fc = EFX_FCNTL_RESPOND | EFX_FCNTL_GENERATE;
690 port->mac_stats.decode_buf = malloc(EFX_MAC_NSTATS * sizeof(uint64_t),
696 port->init_state = SFXGE_PORT_INITIALIZED;
702 free(port->mac_stats.decode_buf, M_SFXGE);
705 free(port->phy_stats.decode_buf, M_SFXGE);
706 SFXGE_PORT_LOCK_DESTROY(port);
707 port->sc = NULL;
761 mode = sc->port.link_mode;
897 * We need port state to initialise the ifmedia list.
969 /* Now discard port state until interface is started. */