Lines Matching refs:bp
25 struct bnxt *bp = netdev_priv(dev); in bnxt_get_msglevel() local
27 return bp->msg_enable; in bnxt_get_msglevel()
32 struct bnxt *bp = netdev_priv(dev); in bnxt_set_msglevel() local
34 bp->msg_enable = value; in bnxt_set_msglevel()
40 struct bnxt *bp = netdev_priv(dev); in bnxt_get_coalesce() local
45 max_t(u16, BNXT_COAL_TIMER_TO_USEC(bp->coal_ticks), 1); in bnxt_get_coalesce()
46 coal->rx_max_coalesced_frames = bp->coal_bufs / 2; in bnxt_get_coalesce()
48 max_t(u16, BNXT_COAL_TIMER_TO_USEC(bp->coal_ticks_irq), 1); in bnxt_get_coalesce()
49 coal->rx_max_coalesced_frames_irq = bp->coal_bufs_irq / 2; in bnxt_get_coalesce()
57 struct bnxt *bp = netdev_priv(dev); in bnxt_set_coalesce() local
60 bp->coal_ticks = BNXT_USEC_TO_COAL_TIMER(coal->rx_coalesce_usecs); in bnxt_set_coalesce()
61 bp->coal_bufs = coal->rx_max_coalesced_frames * 2; in bnxt_set_coalesce()
62 bp->coal_ticks_irq = in bnxt_set_coalesce()
64 bp->coal_bufs_irq = coal->rx_max_coalesced_frames_irq * 2; in bnxt_set_coalesce()
67 rc = bnxt_hwrm_set_coal(bp); in bnxt_set_coalesce()
76 struct bnxt *bp = netdev_priv(dev); in bnxt_get_sset_count() local
80 return BNXT_NUM_STATS * bp->cp_nr_rings; in bnxt_get_sset_count()
90 struct bnxt *bp = netdev_priv(dev); in bnxt_get_ethtool_stats() local
91 u32 buf_size = sizeof(struct ctx_hw_stats) * bp->cp_nr_rings; in bnxt_get_ethtool_stats()
96 if (!bp->bnapi) in bnxt_get_ethtool_stats()
99 for (i = 0; i < bp->cp_nr_rings; i++) { in bnxt_get_ethtool_stats()
100 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_get_ethtool_stats()
113 struct bnxt *bp = netdev_priv(dev); in bnxt_get_strings() local
119 for (i = 0; i < bp->cp_nr_rings; i++) { in bnxt_get_strings()
165 netdev_err(bp->dev, "bnxt_get_strings invalid request %x\n", in bnxt_get_strings()
174 struct bnxt *bp = netdev_priv(dev); in bnxt_get_ringparam() local
180 ering->rx_pending = bp->rx_ring_size; in bnxt_get_ringparam()
181 ering->rx_jumbo_pending = bp->rx_agg_ring_size; in bnxt_get_ringparam()
182 ering->tx_pending = bp->tx_ring_size; in bnxt_get_ringparam()
188 struct bnxt *bp = netdev_priv(dev); in bnxt_set_ringparam() local
196 bnxt_close_nic(bp, false, false); in bnxt_set_ringparam()
198 bp->rx_ring_size = ering->rx_pending; in bnxt_set_ringparam()
199 bp->tx_ring_size = ering->tx_pending; in bnxt_set_ringparam()
200 bnxt_set_ring_params(bp); in bnxt_set_ringparam()
203 return bnxt_open_nic(bp, false, false); in bnxt_set_ringparam()
211 struct bnxt *bp = netdev_priv(dev); in bnxt_get_channels() local
214 bnxt_get_max_rings(bp, &max_rx_rings, &max_tx_rings); in bnxt_get_channels()
223 channel->rx_count = bp->rx_nr_rings; in bnxt_get_channels()
224 channel->tx_count = bp->tx_nr_rings_per_tc; in bnxt_get_channels()
230 struct bnxt *bp = netdev_priv(dev); in bnxt_set_channels() local
238 bnxt_get_max_rings(bp, &max_rx_rings, &max_tx_rings); in bnxt_set_channels()
248 if (BNXT_PF(bp)) { in bnxt_set_channels()
253 rc = bnxt_close_nic(bp, true, false); in bnxt_set_channels()
255 netdev_err(bp->dev, "Set channel failure rc :%x\n", in bnxt_set_channels()
261 bp->rx_nr_rings = channel->rx_count; in bnxt_set_channels()
262 bp->tx_nr_rings_per_tc = channel->tx_count; in bnxt_set_channels()
263 bp->tx_nr_rings = bp->tx_nr_rings_per_tc; in bnxt_set_channels()
265 bp->tx_nr_rings = bp->tx_nr_rings_per_tc * tcs; in bnxt_set_channels()
266 bp->cp_nr_rings = max_t(int, bp->tx_nr_rings, bp->rx_nr_rings); in bnxt_set_channels()
267 bp->num_stat_ctxs = bp->cp_nr_rings; in bnxt_set_channels()
270 rc = bnxt_open_nic(bp, true, false); in bnxt_set_channels()
271 if ((!rc) && BNXT_PF(bp)) { in bnxt_set_channels()
282 static int bnxt_grxclsrlall(struct bnxt *bp, struct ethtool_rxnfc *cmd, in bnxt_grxclsrlall() argument
287 cmd->data = bp->ntp_fltr_count; in bnxt_grxclsrlall()
292 head = &bp->ntp_fltr_hash_tbl[i]; in bnxt_grxclsrlall()
307 static int bnxt_grxclsrule(struct bnxt *bp, struct ethtool_rxnfc *cmd) in bnxt_grxclsrule() argument
321 head = &bp->ntp_fltr_hash_tbl[i]; in bnxt_grxclsrule()
364 struct bnxt *bp = netdev_priv(dev); in bnxt_get_rxnfc() local
369 cmd->data = bp->rx_nr_rings; in bnxt_get_rxnfc()
373 cmd->rule_cnt = bp->ntp_fltr_count; in bnxt_get_rxnfc()
378 rc = bnxt_grxclsrlall(bp, cmd, (u32 *)rule_locs); in bnxt_get_rxnfc()
382 rc = bnxt_grxclsrule(bp, cmd); in bnxt_get_rxnfc()
407 struct bnxt *bp = netdev_priv(dev); in bnxt_get_rxfh() local
408 struct bnxt_vnic_info *vnic = &bp->vnic_info[0]; in bnxt_get_rxfh()
427 struct bnxt *bp = netdev_priv(dev); in bnxt_get_drvinfo() local
431 strlcpy(info->fw_version, bp->fw_ver_str, sizeof(info->fw_version)); in bnxt_get_drvinfo()
432 strlcpy(info->bus_info, pci_name(bp->pdev), sizeof(info->bus_info)); in bnxt_get_drvinfo()
433 info->n_stats = BNXT_NUM_STATS * bp->cp_nr_rings; in bnxt_get_drvinfo()
434 info->testinfo_len = BNXT_NUM_TESTS(bp); in bnxt_get_drvinfo()
520 struct bnxt *bp = netdev_priv(dev); in bnxt_get_settings() local
521 struct bnxt_link_info *link_info = &bp->link_info; in bnxt_get_settings()
644 struct bnxt *bp = netdev_priv(dev); in bnxt_set_settings() local
645 struct bnxt_link_info *link_info = &bp->link_info; in bnxt_set_settings()
649 if (BNXT_VF(bp)) in bnxt_set_settings()
702 rc = bnxt_hwrm_set_link_setting(bp, set_pause); in bnxt_set_settings()
711 struct bnxt *bp = netdev_priv(dev); in bnxt_get_pauseparam() local
712 struct bnxt_link_info *link_info = &bp->link_info; in bnxt_get_pauseparam()
714 if (BNXT_VF(bp)) in bnxt_get_pauseparam()
726 struct bnxt *bp = netdev_priv(dev); in bnxt_set_pauseparam() local
727 struct bnxt_link_info *link_info = &bp->link_info; in bnxt_set_pauseparam()
729 if (BNXT_VF(bp)) in bnxt_set_pauseparam()
755 rc = bnxt_hwrm_set_pause(bp); in bnxt_set_pauseparam()
761 struct bnxt *bp = netdev_priv(dev); in bnxt_get_link() local
764 return bp->link_info.link_up; in bnxt_get_link()
775 struct bnxt *bp = netdev_priv(dev); in bnxt_flash_nvram() local
781 bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_NVM_WRITE, -1, -1); in bnxt_flash_nvram()
789 kmem = dma_alloc_coherent(&bp->pdev->dev, data_len, &dma_handle, in bnxt_flash_nvram()
799 rc = hwrm_send_message(bp, &req, sizeof(req), FLASH_NVRAM_TIMEOUT); in bnxt_flash_nvram()
800 dma_free_coherent(&bp->pdev->dev, data_len, kmem, dma_handle); in bnxt_flash_nvram()
954 struct bnxt *bp = netdev_priv(dev); in nvm_get_dir_info() local
957 struct hwrm_nvm_get_dir_info_output *output = bp->hwrm_cmd_resp_addr; in nvm_get_dir_info()
959 bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_NVM_GET_DIR_INFO, -1, -1); in nvm_get_dir_info()
961 mutex_lock(&bp->hwrm_cmd_lock); in nvm_get_dir_info()
962 rc = _hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT); in nvm_get_dir_info()
967 mutex_unlock(&bp->hwrm_cmd_lock); in nvm_get_dir_info()
981 struct bnxt *bp = netdev_priv(dev); in bnxt_get_nvram_directory() local
1004 buf = dma_alloc_coherent(&bp->pdev->dev, buflen, &dma_handle, in bnxt_get_nvram_directory()
1011 bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_NVM_GET_DIR_ENTRIES, -1, -1); in bnxt_get_nvram_directory()
1013 rc = hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT); in bnxt_get_nvram_directory()
1016 dma_free_coherent(&bp->pdev->dev, buflen, buf, dma_handle); in bnxt_get_nvram_directory()
1023 struct bnxt *bp = netdev_priv(dev); in bnxt_get_nvram_item() local
1029 buf = dma_alloc_coherent(&bp->pdev->dev, length, &dma_handle, in bnxt_get_nvram_item()
1036 bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_NVM_READ, -1, -1); in bnxt_get_nvram_item()
1042 rc = hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT); in bnxt_get_nvram_item()
1045 dma_free_coherent(&bp->pdev->dev, length, buf, dma_handle); in bnxt_get_nvram_item()
1072 struct bnxt *bp = netdev_priv(dev); in bnxt_erase_nvram_directory() local
1075 bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_NVM_ERASE_DIR_ENTRY, -1, -1); in bnxt_erase_nvram_directory()
1077 return hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT); in bnxt_erase_nvram_directory()
1084 struct bnxt *bp = netdev_priv(dev); in bnxt_set_eeprom() local
1088 if (!BNXT_PF(bp)) { in bnxt_set_eeprom()