sys/dev/mge/if_mge.c
334
uint8_t lmac[6];
sys/dev/mge/if_mge.c
340
i = OF_getprop(sc->node, "local-mac-address", (void *)lmac, 6);
sys/dev/mge/if_mge.c
344
if (lmac[i] != 0) {
sys/dev/mge/if_mge.c
350
bcopy(lmac, addr, 6);
sys/dev/neta/if_mvneta_fdt.c
235
uint8_t lmac[ETHER_ADDR_LEN];
sys/dev/neta/if_mvneta_fdt.c
246
len = OF_getprop(node, "local-mac-address", (void *)lmac, sizeof(lmac));
sys/dev/neta/if_mvneta_fdt.c
250
if (memcmp(lmac, zeromac, ETHER_ADDR_LEN) == 0) {
sys/dev/neta/if_mvneta_fdt.c
254
memcpy(addr, lmac, ETHER_ADDR_LEN);
sys/dev/vnic/nic_main.c
1200
uint8_t vf, bgx, lmac;
sys/dev/vnic/nic_main.c
1213
lmac = NIC_GET_LMAC_FROM_VF_LMAC_MAP(nic->vf_lmac_map[vf]);
sys/dev/vnic/nic_main.c
1215
bgx_get_lmac_link_state(nic->node, bgx, lmac, &link);
sys/dev/vnic/nic_main.c
307
int bgx, lmac;
sys/dev/vnic/nic_main.c
320
lmac = NIC_GET_LMAC_FROM_VF_LMAC_MAP(nic->vf_lmac_map[vfnum]);
sys/dev/vnic/nic_main.c
321
bgx_set_lmac_mac(nic->node, bgx, lmac, mac);
sys/dev/vnic/nic_main.c
443
int bgx_idx, lmac;
sys/dev/vnic/nic_main.c
456
lmac = NIC_GET_LMAC_FROM_VF_LMAC_MAP(nic->vf_lmac_map[vf]);
sys/dev/vnic/nic_main.c
458
mac = bgx_get_lmac_mac(nic->node, bgx_idx, lmac);
sys/dev/vnic/nic_main.c
526
int bgx_idx, lmac;
sys/dev/vnic/nic_main.c
530
lmac = NIC_GET_LMAC_FROM_VF_LMAC_MAP(nic->vf_lmac_map[bgx->vf_id]);
sys/dev/vnic/nic_main.c
538
bgx_get_rx_stats(nic->node, bgx_idx, lmac, bgx->idx);
sys/dev/vnic/nic_main.c
541
bgx_get_tx_stats(nic->node, bgx_idx, lmac, bgx->idx);
sys/dev/vnic/nic_main.c
571
int lmac;
sys/dev/vnic/nic_main.c
578
for (lmac = 0; lmac < (MAX_BGX_PER_CN88XX * MAX_LMAC_PER_BGX); lmac++) {
sys/dev/vnic/nic_main.c
579
lmac_cfg = nic_reg_read(nic, NIC_PF_LMAC_0_7_CFG | (lmac << 3));
sys/dev/vnic/nic_main.c
582
nic_reg_write(nic, NIC_PF_LMAC_0_7_CFG | (lmac << 3), lmac_cfg);
sys/dev/vnic/nic_main.c
595
int lmac, lmac_cnt = 0;
sys/dev/vnic/nic_main.c
608
for (lmac = 0; lmac < lmac_cnt; lmac++)
sys/dev/vnic/nic_main.c
610
NIC_SET_VF_LMAC_MAP(bgx, lmac);
sys/dev/vnic/nic_main.c
619
lmac = bgx * MAX_LMAC_PER_BGX;
sys/dev/vnic/nic_main.c
620
for (; lmac < lmac_cnt + (bgx * MAX_LMAC_PER_BGX); lmac++) {
sys/dev/vnic/nic_main.c
621
nic_reg_write(nic, NIC_PF_LMAC_0_7_CREDIT + (lmac * 8),
sys/dev/vnic/nic_main.c
691
uint32_t vnic, bgx, lmac, chan;
sys/dev/vnic/nic_main.c
698
lmac = NIC_GET_LMAC_FROM_VF_LMAC_MAP(nic->vf_lmac_map[vnic]);
sys/dev/vnic/nic_main.c
700
chan = (lmac * MAX_BGX_CHANS_PER_LMAC) + (bgx * NIC_CHANS_PER_INF);
sys/dev/vnic/nic_main.c
701
cpi_base = (lmac * NIC_MAX_CPI_PER_LMAC) + (bgx * NIC_CPI_PER_BGX);
sys/dev/vnic/nic_main.c
702
rssi_base = (lmac * nic->rss_ind_tbl_size) + (bgx * NIC_RSSI_PER_BGX);
sys/dev/vnic/nic_main.c
829
uint32_t bgx, lmac, chan;
sys/dev/vnic/nic_main.c
838
lmac = NIC_GET_LMAC_FROM_VF_LMAC_MAP(nic->vf_lmac_map[pqs_vnic]);
sys/dev/vnic/nic_main.c
843
tl4 = (lmac * NIC_TL4_PER_LMAC) + (bgx * NIC_TL4_PER_BGX);
sys/dev/vnic/nic_main.c
85
#define NIC_SET_VF_LMAC_MAP(bgx, lmac) ((((bgx) & 0xF) << 4) | ((lmac) & 0xF))
sys/dev/vnic/nic_main.c
854
chan = (lmac * MAX_BGX_CHANS_PER_LMAC) + (bgx * NIC_CHANS_PER_INF);
sys/dev/vnic/nic_main.c
891
int bgx, lmac;
sys/dev/vnic/nic_main.c
951
lmac = mbx.mac.vf_id;
sys/dev/vnic/nic_main.c
952
bgx = NIC_GET_BGX_FROM_VF_LMAC_MAP(nic->vf_lmac_map[lmac]);
sys/dev/vnic/nic_main.c
953
lmac = NIC_GET_LMAC_FROM_VF_LMAC_MAP(nic->vf_lmac_map[lmac]);
sys/dev/vnic/nic_main.c
954
bgx_set_lmac_mac(nic->node, bgx, lmac, mbx.mac.mac_addr);
sys/dev/vnic/thunder_bgx.c
101
sizeof(struct lmac),
sys/dev/vnic/thunder_bgx.c
1022
bgx->lmac[i].lmacid_bd = lmac_count;
sys/dev/vnic/thunder_bgx.c
135
struct lmac *lmac;
sys/dev/vnic/thunder_bgx.c
140
lmac = device_get_softc(dev);
sys/dev/vnic/thunder_bgx.c
141
lmac->bgx = bgx;
sys/dev/vnic/thunder_bgx.c
193
struct lmac *lmac;
sys/dev/vnic/thunder_bgx.c
197
lmac = device_get_softc(dev);
sys/dev/vnic/thunder_bgx.c
198
bgx = lmac->bgx;
sys/dev/vnic/thunder_bgx.c
214
bgx_reg_read(struct bgx *bgx, uint8_t lmac, uint64_t offset)
sys/dev/vnic/thunder_bgx.c
218
addr = ((uint32_t)lmac << 20) + offset;
sys/dev/vnic/thunder_bgx.c
224
bgx_reg_write(struct bgx *bgx, uint8_t lmac, uint64_t offset, uint64_t val)
sys/dev/vnic/thunder_bgx.c
228
addr = ((uint32_t)lmac << 20) + offset;
sys/dev/vnic/thunder_bgx.c
234
bgx_reg_modify(struct bgx *bgx, uint8_t lmac, uint64_t offset, uint64_t val)
sys/dev/vnic/thunder_bgx.c
238
addr = ((uint32_t)lmac << 20) + offset;
sys/dev/vnic/thunder_bgx.c
244
bgx_poll_reg(struct bgx *bgx, uint8_t lmac, uint64_t reg, uint64_t mask,
sys/dev/vnic/thunder_bgx.c
251
reg_val = bgx_reg_read(bgx, lmac, reg);
sys/dev/vnic/thunder_bgx.c
297
struct lmac *lmac;
sys/dev/vnic/thunder_bgx.c
303
lmac = &bgx->lmac[lmacid];
sys/dev/vnic/thunder_bgx.c
304
link->link_up = lmac->link_up;
sys/dev/vnic/thunder_bgx.c
305
link->duplex = lmac->last_duplex;
sys/dev/vnic/thunder_bgx.c
306
link->speed = lmac->last_speed;
sys/dev/vnic/thunder_bgx.c
315
return (bgx->lmac[lmacid].mac);
sys/dev/vnic/thunder_bgx.c
328
memcpy(bgx->lmac[lmacid].mac, mac, ETHER_ADDR_LEN);
sys/dev/vnic/thunder_bgx.c
332
bgx_sgmii_change_link_state(struct lmac *lmac)
sys/dev/vnic/thunder_bgx.c
334
struct bgx *bgx = lmac->bgx;
sys/dev/vnic/thunder_bgx.c
339
cmr_cfg = bgx_reg_read(bgx, lmac->lmacid, BGX_CMRX_CFG);
sys/dev/vnic/thunder_bgx.c
341
bgx_reg_write(bgx, lmac->lmacid, BGX_CMRX_CFG, cmr_cfg);
sys/dev/vnic/thunder_bgx.c
343
port_cfg = bgx_reg_read(bgx, lmac->lmacid, BGX_GMP_GMI_PRTX_CFG);
sys/dev/vnic/thunder_bgx.c
344
misc_ctl = bgx_reg_read(bgx, lmac->lmacid, BGX_GMP_PCS_MISCX_CTL);
sys/dev/vnic/thunder_bgx.c
346
if (lmac->link_up) {
sys/dev/vnic/thunder_bgx.c
349
port_cfg |= (lmac->last_duplex << 2);
sys/dev/vnic/thunder_bgx.c
354
switch (lmac->last_speed) {
sys/dev/vnic/thunder_bgx.c
361
bgx_reg_write(bgx, lmac->lmacid, BGX_GMP_GMI_TXX_SLOT, 64);
sys/dev/vnic/thunder_bgx.c
362
bgx_reg_write(bgx, lmac->lmacid, BGX_GMP_GMI_TXX_BURST, 0);
sys/dev/vnic/thunder_bgx.c
370
bgx_reg_write(bgx, lmac->lmacid, BGX_GMP_GMI_TXX_SLOT, 64);
sys/dev/vnic/thunder_bgx.c
371
bgx_reg_write(bgx, lmac->lmacid, BGX_GMP_GMI_TXX_BURST, 0);
sys/dev/vnic/thunder_bgx.c
379
bgx_reg_write(bgx, lmac->lmacid, BGX_GMP_GMI_TXX_SLOT, 512);
sys/dev/vnic/thunder_bgx.c
380
if (lmac->last_duplex)
sys/dev/vnic/thunder_bgx.c
381
bgx_reg_write(bgx, lmac->lmacid,
sys/dev/vnic/thunder_bgx.c
384
bgx_reg_write(bgx, lmac->lmacid,
sys/dev/vnic/thunder_bgx.c
390
bgx_reg_write(bgx, lmac->lmacid, BGX_GMP_PCS_MISCX_CTL, misc_ctl);
sys/dev/vnic/thunder_bgx.c
391
bgx_reg_write(bgx, lmac->lmacid, BGX_GMP_GMI_PRTX_CFG, port_cfg);
sys/dev/vnic/thunder_bgx.c
393
port_cfg = bgx_reg_read(bgx, lmac->lmacid, BGX_GMP_GMI_PRTX_CFG);
sys/dev/vnic/thunder_bgx.c
397
bgx_reg_write(bgx, lmac->lmacid, BGX_CMRX_CFG, cmr_cfg);
sys/dev/vnic/thunder_bgx.c
403
struct lmac *lmac;
sys/dev/vnic/thunder_bgx.c
408
lmac = (struct lmac *)arg;
sys/dev/vnic/thunder_bgx.c
410
err = LMAC_MEDIA_STATUS(lmac->phy_if_dev, lmac->lmacid,
sys/dev/vnic/thunder_bgx.c
415
if (!link && lmac->last_link)
sys/dev/vnic/thunder_bgx.c
419
(lmac->last_duplex != duplex ||
sys/dev/vnic/thunder_bgx.c
420
lmac->last_link != link ||
sys/dev/vnic/thunder_bgx.c
421
lmac->last_speed != speed)) {
sys/dev/vnic/thunder_bgx.c
425
lmac->last_link = link;
sys/dev/vnic/thunder_bgx.c
426
lmac->last_speed = speed;
sys/dev/vnic/thunder_bgx.c
427
lmac->last_duplex = duplex;
sys/dev/vnic/thunder_bgx.c
433
lmac->link_up = true;
sys/dev/vnic/thunder_bgx.c
435
lmac->link_up = false;
sys/dev/vnic/thunder_bgx.c
437
if (lmac->is_sgmii)
sys/dev/vnic/thunder_bgx.c
438
bgx_sgmii_change_link_state(lmac);
sys/dev/vnic/thunder_bgx.c
440
bgx_xaui_check_link(lmac);
sys/dev/vnic/thunder_bgx.c
443
callout_reset(&lmac->check_link, hz * 2, bgx_lmac_handler, lmac);
sys/dev/vnic/thunder_bgx.c
447
bgx_get_rx_stats(int node, int bgx_idx, int lmac, int idx)
sys/dev/vnic/thunder_bgx.c
456
lmac = (0);
sys/dev/vnic/thunder_bgx.c
457
return (bgx_reg_read(bgx, lmac, BGX_CMRX_RX_STAT0 + (idx * 8)));
sys/dev/vnic/thunder_bgx.c
461
bgx_get_tx_stats(int node, int bgx_idx, int lmac, int idx)
sys/dev/vnic/thunder_bgx.c
469
return (bgx_reg_read(bgx, lmac, BGX_CMRX_TX_STAT0 + (idx * 8)));
sys/dev/vnic/thunder_bgx.c
473
bgx_flush_dmac_addrs(struct bgx *bgx, int lmac)
sys/dev/vnic/thunder_bgx.c
477
while (bgx->lmac[lmac].dmac > 0) {
sys/dev/vnic/thunder_bgx.c
478
offset = ((bgx->lmac[lmac].dmac - 1) * sizeof(uint64_t)) +
sys/dev/vnic/thunder_bgx.c
479
(lmac * MAX_DMAC_PER_LMAC * sizeof(uint64_t));
sys/dev/vnic/thunder_bgx.c
481
bgx->lmac[lmac].dmac--;
sys/dev/vnic/thunder_bgx.c
486
bgx_add_dmac_addr(uint64_t dmac, int node, int bgx_idx, int lmac)
sys/dev/vnic/thunder_bgx.c
504
dmac = dmac | (1UL << 48) | ((uint64_t)lmac << 49); /* Enable DMAC */
sys/dev/vnic/thunder_bgx.c
505
if (bgx->lmac[lmac].dmac == MAX_DMAC_PER_LMAC) {
sys/dev/vnic/thunder_bgx.c
508
lmac);
sys/dev/vnic/thunder_bgx.c
512
if (bgx->lmac[lmac].dmac == MAX_DMAC_PER_LMAC_TNS_BYPASS_MODE)
sys/dev/vnic/thunder_bgx.c
513
bgx->lmac[lmac].dmac = 1;
sys/dev/vnic/thunder_bgx.c
515
offset = (bgx->lmac[lmac].dmac * sizeof(uint64_t)) +
sys/dev/vnic/thunder_bgx.c
516
(lmac * MAX_DMAC_PER_LMAC * sizeof(uint64_t));
sys/dev/vnic/thunder_bgx.c
518
bgx->lmac[lmac].dmac++;
sys/dev/vnic/thunder_bgx.c
520
bgx_reg_write(bgx, lmac, BGX_CMRX_RX_DMAC_CTL,
sys/dev/vnic/thunder_bgx.c
531
struct lmac *lmac;
sys/dev/vnic/thunder_bgx.c
538
lmac = &bgx->lmac[lmac_idx];
sys/dev/vnic/thunder_bgx.c
539
if (lmac->is_sgmii) {
sys/dev/vnic/thunder_bgx.c
689
bgx_xaui_check_link(struct lmac *lmac)
sys/dev/vnic/thunder_bgx.c
691
struct bgx *bgx = lmac->bgx;
sys/dev/vnic/thunder_bgx.c
692
int lmacid = lmac->lmacid;
sys/dev/vnic/thunder_bgx.c
79
static int bgx_xaui_check_link(struct lmac *lmac);
sys/dev/vnic/thunder_bgx.c
797
struct lmac *lmac;
sys/dev/vnic/thunder_bgx.c
800
lmac = (struct lmac *)arg;
sys/dev/vnic/thunder_bgx.c
803
bgx_reg_modify(lmac->bgx, lmac->lmacid,
sys/dev/vnic/thunder_bgx.c
805
bgx_poll_reg(lmac->bgx, lmac->lmacid, BGX_SPUX_STATUS1,
sys/dev/vnic/thunder_bgx.c
808
link = bgx_reg_read(lmac->bgx, lmac->lmacid, BGX_SPUX_STATUS1);
sys/dev/vnic/thunder_bgx.c
810
lmac->link_up = 1;
sys/dev/vnic/thunder_bgx.c
811
if (lmac->bgx->lmac_type == BGX_MODE_XLAUI)
sys/dev/vnic/thunder_bgx.c
812
lmac->last_speed = 40000;
sys/dev/vnic/thunder_bgx.c
814
lmac->last_speed = 10000;
sys/dev/vnic/thunder_bgx.c
815
lmac->last_duplex = 1;
sys/dev/vnic/thunder_bgx.c
817
lmac->link_up = 0;
sys/dev/vnic/thunder_bgx.c
820
if (lmac->last_link != lmac->link_up) {
sys/dev/vnic/thunder_bgx.c
821
lmac->last_link = lmac->link_up;
sys/dev/vnic/thunder_bgx.c
822
if (lmac->link_up)
sys/dev/vnic/thunder_bgx.c
823
bgx_xaui_check_link(lmac);
sys/dev/vnic/thunder_bgx.c
826
callout_reset(&lmac->check_link, hz * 2, bgx_poll_for_link, lmac);
sys/dev/vnic/thunder_bgx.c
833
struct lmac *lmac;
sys/dev/vnic/thunder_bgx.c
836
lmac = &bgx->lmac[lmacid];
sys/dev/vnic/thunder_bgx.c
837
lmac->bgx = bgx;
sys/dev/vnic/thunder_bgx.c
840
lmac->is_sgmii = 1;
sys/dev/vnic/thunder_bgx.c
844
lmac->is_sgmii = 0;
sys/dev/vnic/thunder_bgx.c
849
if (lmac->is_sgmii) {
sys/dev/vnic/thunder_bgx.c
876
if (lmac->phy_if_dev == NULL) {
sys/dev/vnic/thunder_bgx.c
882
if (LMAC_PHY_CONNECT(lmac->phy_if_dev, lmac->phyaddr,
sys/dev/vnic/thunder_bgx.c
888
mtx_init(&lmac->check_link_mtx, "BGX link poll", NULL, MTX_DEF);
sys/dev/vnic/thunder_bgx.c
889
callout_init_mtx(&lmac->check_link, &lmac->check_link_mtx, 0);
sys/dev/vnic/thunder_bgx.c
890
mtx_lock(&lmac->check_link_mtx);
sys/dev/vnic/thunder_bgx.c
891
bgx_lmac_handler(lmac);
sys/dev/vnic/thunder_bgx.c
892
mtx_unlock(&lmac->check_link_mtx);
sys/dev/vnic/thunder_bgx.c
894
mtx_init(&lmac->check_link_mtx, "BGX link poll", NULL, MTX_DEF);
sys/dev/vnic/thunder_bgx.c
895
callout_init_mtx(&lmac->check_link, &lmac->check_link_mtx, 0);
sys/dev/vnic/thunder_bgx.c
896
mtx_lock(&lmac->check_link_mtx);
sys/dev/vnic/thunder_bgx.c
897
bgx_poll_for_link(lmac);
sys/dev/vnic/thunder_bgx.c
898
mtx_unlock(&lmac->check_link_mtx);
sys/dev/vnic/thunder_bgx.c
907
struct lmac *lmac;
sys/dev/vnic/thunder_bgx.c
910
lmac = &bgx->lmac[lmacid];
sys/dev/vnic/thunder_bgx.c
913
callout_drain(&lmac->check_link);
sys/dev/vnic/thunder_bgx.c
914
mtx_destroy(&lmac->check_link_mtx);
sys/dev/vnic/thunder_bgx.c
925
if (lmac->phy_if_dev == NULL) {
sys/dev/vnic/thunder_bgx.c
930
if (LMAC_PHY_DISCONNECT(lmac->phy_if_dev, lmac->phyaddr,
sys/dev/vnic/thunder_bgx.c
936
lmac->phy_if_dev = NULL;
sys/dev/vnic/thunder_bgx.h
205
void bgx_add_dmac_addr(uint64_t dmac, int node, int bgx_idx, int lmac);
sys/dev/vnic/thunder_bgx.h
213
uint64_t bgx_get_rx_stats(int node, int bgx_idx, int lmac, int idx);
sys/dev/vnic/thunder_bgx.h
214
uint64_t bgx_get_tx_stats(int node, int bgx_idx, int lmac, int idx);
sys/dev/vnic/thunder_bgx_fdt.c
378
uint8_t lmac;
sys/dev/vnic/thunder_bgx_fdt.c
388
lmac = 0;
sys/dev/vnic/thunder_bgx_fdt.c
413
if (OF_getencprop(child, "reg", &bgx->lmac[lmac].phyaddr,
sys/dev/vnic/thunder_bgx_fdt.c
414
sizeof(bgx->lmac[lmac].phyaddr)) <= 0) {
sys/dev/vnic/thunder_bgx_fdt.c
419
bgx->lmac[lmac].phyaddr = MII_PHY_ANY;
sys/dev/vnic/thunder_bgx_fdt.c
436
bgx->lmac[lmac].phy_if_dev =
sys/dev/vnic/thunder_bgx_fdt.c
438
if (bgx->lmac[lmac].phy_if_dev == NULL) {
sys/dev/vnic/thunder_bgx_fdt.c
447
bgx_fdt_get_macaddr(child, bgx->lmac[lmac].mac);
sys/dev/vnic/thunder_bgx_fdt.c
449
bgx->lmac[lmac].lmacid = lmac;
sys/dev/vnic/thunder_bgx_fdt.c
450
lmac++;
sys/dev/vnic/thunder_bgx_fdt.c
451
if (lmac == MAX_LMAC_PER_BGX)
sys/dev/vnic/thunder_bgx_fdt.c
454
if (lmac == 0) {
sys/dev/vnic/thunder_bgx_var.h
56
struct lmac lmac[MAX_LMAC_PER_BGX];