Lines Matching refs:mac
27 struct spl2sw_mac *mac = netdev_priv(ndev); in spl2sw_ethernet_open() local
28 struct spl2sw_common *comm = mac->comm; in spl2sw_ethernet_open()
31 netdev_dbg(ndev, "Open port = %x\n", mac->lan_port); in spl2sw_ethernet_open()
33 comm->enable |= mac->lan_port; in spl2sw_ethernet_open()
51 struct spl2sw_mac *mac = netdev_priv(ndev); in spl2sw_ethernet_stop() local
52 struct spl2sw_common *comm = mac->comm; in spl2sw_ethernet_stop()
56 comm->enable &= ~mac->lan_port; in spl2sw_ethernet_stop()
68 struct spl2sw_mac *mac = netdev_priv(ndev); in spl2sw_ethernet_start_xmit() local
69 struct spl2sw_common *comm = mac->comm; in spl2sw_ethernet_start_xmit()
110 cmd1 = TXD_OWN | TXD_SOP | TXD_EOP | (mac->to_vlan << 12) | in spl2sw_ethernet_start_xmit()
141 struct spl2sw_mac *mac = netdev_priv(ndev); in spl2sw_ethernet_set_rx_mode() local
143 spl2sw_mac_rx_mode_set(mac); in spl2sw_ethernet_set_rx_mode()
148 struct spl2sw_mac *mac = netdev_priv(ndev); in spl2sw_ethernet_set_mac_address() local
156 netdev_dbg(ndev, "Old Ethernet (MAC) address = %pM\n", mac->mac_addr); in spl2sw_ethernet_set_mac_address()
157 if (is_valid_ether_addr(mac->mac_addr)) { in spl2sw_ethernet_set_mac_address()
158 err = spl2sw_mac_addr_del(mac); in spl2sw_ethernet_set_mac_address()
164 ether_addr_copy(mac->mac_addr, ndev->dev_addr); in spl2sw_ethernet_set_mac_address()
165 return spl2sw_mac_addr_add(mac); in spl2sw_ethernet_set_mac_address()
170 struct spl2sw_mac *mac = netdev_priv(ndev); in spl2sw_ethernet_tx_timeout() local
171 struct spl2sw_common *comm = mac->comm; in spl2sw_ethernet_tx_timeout()
226 u8 *mac; in spl2sw_nvmem_get_mac_address() local
234 mac = nvmem_cell_read(cell, &len); in spl2sw_nvmem_get_mac_address()
236 if (IS_ERR(mac)) in spl2sw_nvmem_get_mac_address()
237 return PTR_ERR(mac); in spl2sw_nvmem_get_mac_address()
240 kfree(mac); in spl2sw_nvmem_get_mac_address()
248 spl2sw_check_mac_vendor_id_and_convert(mac); in spl2sw_nvmem_get_mac_address()
251 if (!is_valid_ether_addr(mac)) { in spl2sw_nvmem_get_mac_address()
252 dev_info(dev, "Invalid mac address in nvmem (%pM)!\n", mac); in spl2sw_nvmem_get_mac_address()
253 kfree(mac); in spl2sw_nvmem_get_mac_address()
257 ether_addr_copy(addrbuf, mac); in spl2sw_nvmem_get_mac_address()
258 kfree(mac); in spl2sw_nvmem_get_mac_address()
266 struct spl2sw_mac *mac; in spl2sw_init_netdev() local
272 ndev = devm_alloc_etherdev(&pdev->dev, sizeof(*mac)); in spl2sw_init_netdev()
279 mac = netdev_priv(ndev); in spl2sw_init_netdev()
280 mac->ndev = ndev; in spl2sw_init_netdev()
281 ether_addr_copy(mac->mac_addr, mac_addr); in spl2sw_init_netdev()
328 struct spl2sw_mac *mac; in spl2sw_probe() local
457 mac = netdev_priv(ndev); in spl2sw_probe()
458 mac->phy_node = phy_np; in spl2sw_probe()
459 mac->phy_mode = phy_mode; in spl2sw_probe()
460 mac->comm = comm; in spl2sw_probe()
462 mac->lan_port = 0x1 << i; /* forward to port i */ in spl2sw_probe()
463 mac->to_vlan = 0x1 << i; /* vlan group: i */ in spl2sw_probe()
464 mac->vlan_id = i; /* vlan group: i */ in spl2sw_probe()
467 ret = spl2sw_mac_addr_add(mac); in spl2sw_probe()
471 spl2sw_mac_rx_mode_set(mac); in spl2sw_probe()