Lines Matching +full:num +full:- +full:vectors

1 // SPDX-License-Identifier: GPL-2.0+
22 for (i = 0; i < priv->vectors.info_array_len; i++) { in hbg_all_irq_enable()
23 info = &priv->vectors.info_array[i]; in hbg_all_irq_enable()
24 hbg_hw_irq_enable(priv, info->mask, enabled); in hbg_all_irq_enable()
77 /* Only when not table_overflow, and netdev->flags not set IFF_PROMISC, in hbg_update_promisc_mode()
81 priv->filter.enabled = !(overflow || (netdev->flags & IFF_PROMISC)); in hbg_update_promisc_mode()
82 hbg_hw_set_mac_filter_enable(priv, priv->filter.enabled); in hbg_update_promisc_mode()
89 ether_addr_copy(priv->filter.mac_table[index].addr, addr); in hbg_set_mac_to_mac_table()
92 eth_zero_addr(priv->filter.mac_table[index].addr); in hbg_set_mac_to_mac_table()
102 for (i = 0; i < priv->filter.table_max_len; i++) in hbg_get_index_from_mac_table()
103 if (ether_addr_equal(priv->filter.mac_table[i].addr, addr)) { in hbg_get_index_from_mac_table()
108 return -EINVAL; in hbg_get_index_from_mac_table()
119 for (index = 0; index < priv->filter.table_max_len; index++) in hbg_add_mac_to_filter()
120 if (is_zero_ether_addr(priv->filter.mac_table[index].addr)) { in hbg_add_mac_to_filter()
125 return -ENOSPC; in hbg_add_mac_to_filter()
150 if (ether_addr_equal(netdev->dev_addr, (u8 *)addr)) in hbg_uc_unsync()
174 mac_addr = ((struct sockaddr *)addr)->sa_data; in hbg_net_set_mac_address()
177 return -EADDRNOTAVAIL; in hbg_net_set_mac_address()
199 return -EBUSY; in hbg_net_change_mtu()
201 dev_dbg(&priv->pdev->dev, in hbg_net_change_mtu()
202 "change mtu from %u to %u\n", netdev->mtu, new_mtu); in hbg_net_change_mtu()
205 WRITE_ONCE(netdev->mtu, new_mtu); in hbg_net_change_mtu()
213 struct hbg_ring *ring = &priv->tx_ring; in hbg_net_tx_timeout()
214 char *buf = ring->tout_log_buf; in hbg_net_tx_timeout()
217 pos += scnprintf(buf + pos, HBG_TX_TIMEOUT_BUF_LEN - pos, in hbg_net_tx_timeout()
218 "ring used num: %u, fifo used num: %u\n", in hbg_net_tx_timeout()
221 pos += scnprintf(buf + pos, HBG_TX_TIMEOUT_BUF_LEN - pos, in hbg_net_tx_timeout()
223 ring->ntc, ring->ntu, in hbg_net_tx_timeout()
242 struct hbg_dev_specs *dev_specs = &priv->dev_specs; in hbg_mac_filter_init()
243 struct hbg_mac_filter *filter = &priv->filter; in hbg_mac_filter_init()
246 tmp_table = devm_kcalloc(&priv->pdev->dev, dev_specs->uc_mac_num, in hbg_mac_filter_init()
249 return -ENOMEM; in hbg_mac_filter_init()
251 filter->mac_table = tmp_table; in hbg_mac_filter_init()
252 filter->table_max_len = dev_specs->uc_mac_num; in hbg_mac_filter_init()
253 filter->enabled = true; in hbg_mac_filter_init()
255 hbg_hw_set_mac_filter_enable(priv, filter->enabled); in hbg_mac_filter_init()
261 struct ethtool_pauseparam *pause_param = &priv->user_def.pause_param; in hbg_init_user_def()
263 priv->mac.pause_autoneg = HBG_STATUS_ENABLE; in hbg_init_user_def()
265 pause_param->autoneg = priv->mac.pause_autoneg; in hbg_init_user_def()
266 hbg_hw_get_pause_enable(priv, &pause_param->tx_pause, in hbg_init_user_def()
267 &pause_param->rx_pause); in hbg_init_user_def()
303 struct device *dev = &pdev->dev; in hbg_pci_init()
318 priv->io_base = pcim_iomap_table(pdev)[0]; in hbg_pci_init()
319 if (!priv->io_base) in hbg_pci_init()
320 return dev_err_probe(dev, -ENOMEM, "failed to get io base\n"); in hbg_pci_init()
328 struct device *dev = &pdev->dev; in hbg_probe()
335 return -ENOMEM; in hbg_probe()
341 priv->netdev = netdev; in hbg_probe()
342 priv->pdev = pdev; in hbg_probe()
352 netdev->priv_flags |= IFF_UNICAST_FLT; in hbg_probe()
354 netdev->pcpu_stat_type = NETDEV_PCPU_STAT_TSTATS; in hbg_probe()
355 netdev->max_mtu = priv->dev_specs.max_mtu; in hbg_probe()
356 netdev->min_mtu = priv->dev_specs.min_mtu; in hbg_probe()
357 netdev->netdev_ops = &hbg_netdev_ops; in hbg_probe()
358 netdev->watchdog_timeo = 5 * HZ; in hbg_probe()
361 hbg_net_set_mac_address(priv->netdev, &priv->dev_specs.mac_addr); in hbg_probe()