oct 39 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c void cn23xx_dump_pf_initialized_regs(struct octeon_device *oct) oct 43 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c struct octeon_cn23xx_pf *cn23xx = (struct octeon_cn23xx_pf *)oct->chip; oct 46 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_dbg(&oct->pci_dev->dev, "%s[%llx] : 0x%llx\n", oct 48 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c CVM_CAST64(octeon_read_csr64(oct, CN23XX_WIN_WR_MASK_REG))); oct 49 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_dbg(&oct->pci_dev->dev, "%s[%llx] : 0x%016llx\n", oct 51 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c CVM_CAST64(octeon_read_csr64(oct, CN23XX_SLI_SCRATCH1))); oct 52 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_dbg(&oct->pci_dev->dev, "%s[%llx] : 0x%016llx\n", oct 54 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c lio_pci_readq(oct, CN23XX_RST_SOFT_RST)); oct 57 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_dbg(&oct->pci_dev->dev, "%s[%llx] : 0x%016llx\n", oct 59 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c lio_pci_readq(oct, CN23XX_DPI_DMA_CONTROL)); oct 62 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_dbg(&oct->pci_dev->dev, "%s(%d)[%llx] : 0x%016llx\n", oct 65 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c lio_pci_readq(oct, CN23XX_DPI_DMA_ENG_ENB(i))); oct 66 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_dbg(&oct->pci_dev->dev, "%s(%d)[%llx] : 0x%016llx\n", oct 69 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c lio_pci_readq(oct, CN23XX_DPI_DMA_ENG_BUF(i))); oct 72 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_dbg(&oct->pci_dev->dev, "%s[%llx] : 0x%016llx\n", "CN23XX_DPI_CTL", oct 73 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c CN23XX_DPI_CTL, lio_pci_readq(oct, CN23XX_DPI_CTL)); oct 76 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c pci_read_config_dword(oct->pci_dev, CN23XX_CONFIG_PCIE_DEVCTL, ®val); oct 77 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_dbg(&oct->pci_dev->dev, "%s[%llx] : 0x%016llx\n", oct 81 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_dbg(&oct->pci_dev->dev, "%s(%d)[%llx] : 0x%016llx\n", oct 82 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c "CN23XX_DPI_SLI_PRTX_CFG", oct->pcie_port, oct 83 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c CN23XX_DPI_SLI_PRTX_CFG(oct->pcie_port), oct 84 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c lio_pci_readq(oct, CN23XX_DPI_SLI_PRTX_CFG(oct->pcie_port))); oct 87 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_dbg(&oct->pci_dev->dev, "%s(%d)[%llx] : 0x%016llx\n", oct 88 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c "CN23XX_SLI_S2M_PORTX_CTL", oct->pcie_port, oct 89 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c CVM_CAST64(CN23XX_SLI_S2M_PORTX_CTL(oct->pcie_port)), oct 91 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct, CN23XX_SLI_S2M_PORTX_CTL(oct->pcie_port)))); oct 93 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_dbg(&oct->pci_dev->dev, "%s[%llx] : 0x%016llx\n", oct 95 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c (u64)octeon_read_csr64(oct, CN23XX_SLI_PKT_IOQ_RING_RST)); oct 99 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_dbg(&oct->pci_dev->dev, "%s(%d)[%llx] : 0x%016llx\n", oct 101 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c CVM_CAST64(CN23XX_SLI_PKT_MAC_RINFO64(i, oct->pf_num)), oct 103 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c (oct, CN23XX_SLI_PKT_MAC_RINFO64 oct 104 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c (i, oct->pf_num)))); oct 109 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_dbg(&oct->pci_dev->dev, "%s(%d)[%llx] : 0x%016llx\n", oct 113 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c (oct, CN23XX_SLI_IQ_PKT_CONTROL64(i)))); oct 117 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_dbg(&oct->pci_dev->dev, "%s[%llx] : 0x%016llx\n", oct 119 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c CVM_CAST64(octeon_read_csr64(oct, CN23XX_SLI_OQ_WMARK))); oct 122 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_dbg(&oct->pci_dev->dev, "%s(%d)[%llx] : 0x%016llx\n", oct 126 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct, CN23XX_SLI_OQ_PKT_CONTROL(i)))); oct 127 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_dbg(&oct->pci_dev->dev, "%s(%d)[%llx] : 0x%016llx\n", oct 131 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct, CN23XX_SLI_OQ_PKT_INT_LEVELS(i)))); oct 135 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_dbg(&oct->pci_dev->dev, "%s[%llx] : 0x%016llx\n", oct 140 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_dbg(&oct->pci_dev->dev, "%s[%llx] : 0x%016llx\n", oct 147 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_dbg(&oct->pci_dev->dev, "%s(%d)[%llx] : 0x%016llx\n", oct 151 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct, CN23XX_SLI_IQ_BASE_ADDR64(i)))); oct 152 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_dbg(&oct->pci_dev->dev, "%s(%d)[%llx] : 0x%016llx\n", oct 156 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c (oct, CN23XX_SLI_IQ_SIZE(i)))); oct 157 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_dbg(&oct->pci_dev->dev, "%s(%d)[%llx] : 0x%016llx\n", oct 161 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct, CN23XX_SLI_IQ_DOORBELL(i)))); oct 162 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_dbg(&oct->pci_dev->dev, "%s(%d)[%llx] : 0x%016llx\n", oct 166 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct, CN23XX_SLI_IQ_INSTR_COUNT64(i)))); oct 171 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_dbg(&oct->pci_dev->dev, "%s(%d)[%llx] : 0x%016llx\n", oct 175 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct, CN23XX_SLI_OQ_BASE_ADDR64(i)))); oct 176 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_dbg(&oct->pci_dev->dev, "%s(%d)[%llx] : 0x%016llx\n", oct 180 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c (oct, CN23XX_SLI_OQ_SIZE(i)))); oct 181 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_dbg(&oct->pci_dev->dev, "%s(%d)[%llx] : 0x%016llx\n", oct 185 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct, CN23XX_SLI_OQ_BUFF_INFO_SIZE(i)))); oct 186 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_dbg(&oct->pci_dev->dev, "%s(%d)[%llx] : 0x%016llx\n", oct 190 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct, CN23XX_SLI_OQ_PKTS_SENT(i)))); oct 191 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_dbg(&oct->pci_dev->dev, "%s(%d)[%llx] : 0x%016llx\n", oct 195 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct, CN23XX_SLI_OQ_PKTS_CREDIT(i)))); oct 198 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_dbg(&oct->pci_dev->dev, "%s[%llx] : 0x%016llx\n", oct 201 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c CVM_CAST64(octeon_read_csr64(oct, CN23XX_SLI_PKT_TIME_INT))); oct 202 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_dbg(&oct->pci_dev->dev, "%s[%llx] : 0x%016llx\n", oct 205 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c CVM_CAST64(octeon_read_csr64(oct, CN23XX_SLI_PKT_CNT_INT))); oct 208 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c static int cn23xx_pf_soft_reset(struct octeon_device *oct) oct 210 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c octeon_write_csr64(oct, CN23XX_WIN_WR_MASK_REG, 0xFF); oct 212 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_dbg(&oct->pci_dev->dev, "OCTEON[%d]: BIST enabled for CN23XX soft reset\n", oct 213 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->octeon_id); oct 215 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c octeon_write_csr64(oct, CN23XX_SLI_SCRATCH1, 0x1234ULL); oct 218 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c lio_pci_readq(oct, CN23XX_RST_SOFT_RST); oct 219 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c lio_pci_writeq(oct, 1, CN23XX_RST_SOFT_RST); oct 224 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c if (octeon_read_csr64(oct, CN23XX_SLI_SCRATCH1)) { oct 225 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_err(&oct->pci_dev->dev, "OCTEON[%d]: Soft reset failed\n", oct 226 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->octeon_id); oct 230 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_dbg(&oct->pci_dev->dev, "OCTEON[%d]: Reset completed\n", oct 231 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->octeon_id); oct 234 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c octeon_write_csr64(oct, CN23XX_WIN_WR_MASK_REG, 0xFF); oct 239 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c static void cn23xx_enable_error_reporting(struct octeon_device *oct) oct 244 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c pci_read_config_dword(oct->pci_dev, CN23XX_CONFIG_PCIE_DEVCTL, ®val); oct 248 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c pci_read_config_dword(oct->pci_dev, oct 251 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c pci_read_config_dword(oct->pci_dev, oct 254 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_err(&oct->pci_dev->dev, "PCI-E Fatal error detected;\n" oct 264 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_dbg(&oct->pci_dev->dev, "OCTEON[%d]: Enabling PCI-E error reporting..\n", oct 265 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->octeon_id); oct 266 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c pci_write_config_dword(oct->pci_dev, CN23XX_CONFIG_PCIE_DEVCTL, regval); oct 269 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c static u32 cn23xx_coprocessor_clock(struct octeon_device *oct) oct 276 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c return (((lio_pci_readq(oct, CN23XX_RST_BOOT) >> 24) & 0x3f) * 50); oct 279 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c u32 cn23xx_pf_get_oq_ticks(struct octeon_device *oct, u32 time_intr_in_us) oct 282 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c u32 oqticks_per_us = cn23xx_coprocessor_clock(oct); oct 284 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->pfvf_hsword.coproc_tics_per_us = oqticks_per_us; oct 301 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c static void cn23xx_setup_global_mac_regs(struct octeon_device *oct) oct 303 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c u16 mac_no = oct->pcie_port; oct 304 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c u16 pf_num = oct->pf_num; oct 310 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_dbg(&oct->pci_dev->dev, "%s:Using pcie port %d\n", oct 315 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c octeon_read_csr64(oct, CN23XX_SLI_PKT_MAC_RINFO64(mac_no, pf_num)); oct 317 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c if (oct->rev_id == OCTEON_CN23XX_REV_1_1) { oct 327 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c (oct->sriov_info.trs << CN23XX_PKT_MAC_CTL_RINFO_TRS_BIT_POS); oct 329 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c temp = oct->sriov_info.rings_per_vf & 0xff; oct 333 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c temp = oct->sriov_info.max_vfs & 0xff; oct 337 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c octeon_write_csr64(oct, CN23XX_SLI_PKT_MAC_RINFO64(mac_no, pf_num), oct 340 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_dbg(&oct->pci_dev->dev, "SLI_PKT_MAC(%d)_PF(%d)_RINFO : 0x%016llx\n", oct 342 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c (oct, CN23XX_SLI_PKT_MAC_RINFO64(mac_no, pf_num))); oct 345 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c static int cn23xx_reset_io_queues(struct octeon_device *oct) oct 352 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c srn = oct->sriov_info.pf_srn; oct 353 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c ern = srn + oct->sriov_info.num_pf_rings; oct 361 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c d64 = octeon_read_csr64(oct, CN23XX_SLI_IQ_PKT_CONTROL64(q_no)); oct 363 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c octeon_write_csr64(oct, CN23XX_SLI_IQ_PKT_CONTROL64(q_no), d64); oct 368 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c u64 reg_val = octeon_read_csr64(oct, oct 374 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct, CN23XX_SLI_IQ_PKT_CONTROL64(q_no))); oct 377 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_err(&oct->pci_dev->dev, oct 384 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c octeon_write_csr64(oct, CN23XX_SLI_IQ_PKT_CONTROL64(q_no), oct 388 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct, CN23XX_SLI_IQ_PKT_CONTROL64(q_no))); oct 390 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_err(&oct->pci_dev->dev, oct 400 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c static int cn23xx_pf_setup_global_input_regs(struct octeon_device *oct) oct 402 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c struct octeon_cn23xx_pf *cn23xx = (struct octeon_cn23xx_pf *)oct->chip; oct 409 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c pf_num = oct->pf_num; oct 411 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c srn = oct->sriov_info.pf_srn; oct 412 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c ern = srn + oct->sriov_info.num_pf_rings; oct 414 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c if (cn23xx_reset_io_queues(oct)) oct 423 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c reg_val = oct->pcie_port << CN23XX_PKT_INPUT_CTL_MAC_NUM_POS; oct 426 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c if (q_no < oct->sriov_info.pf_srn) { oct 427 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c vf_num = q_no / oct->sriov_info.rings_per_vf; oct 436 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c octeon_write_csr64(oct, CN23XX_SLI_IQ_PKT_CONTROL64(q_no), oct 446 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c iq = oct->instr_queue[q_no]; oct 450 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c inst_cnt_reg = (u8 *)oct->mmio[0].hw_addr + oct 454 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c octeon_read_csr64(oct, CN23XX_SLI_IQ_PKT_CONTROL64(q_no)); oct 458 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c octeon_write_csr64(oct, CN23XX_SLI_IQ_PKT_CONTROL64(q_no), oct 475 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c static void cn23xx_pf_setup_global_output_regs(struct octeon_device *oct) oct 481 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c struct octeon_cn23xx_pf *cn23xx = (struct octeon_cn23xx_pf *)oct->chip; oct 483 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c srn = oct->sriov_info.pf_srn; oct 484 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c ern = srn + oct->sriov_info.num_pf_rings; oct 487 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c octeon_write_csr64(oct, CN23XX_SLI_OQ_WMARK, 32); oct 490 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c octeon_write_csr64(oct, CN23XX_SLI_OQ_WMARK, 0); oct 494 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c reg_val = octeon_read_csr(oct, CN23XX_SLI_OQ_PKT_CONTROL(q_no)); oct 527 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c octeon_write_csr(oct, CN23XX_SLI_OQ_PKT_CONTROL(q_no), reg_val); oct 535 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct, (u32)CFG_GET_OQ_INTR_TIME(cn23xx->conf)); oct 537 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c octeon_write_csr64(oct, CN23XX_SLI_OQ_PKT_INT_LEVELS(q_no), oct 543 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c writeq(0x40, (u8 *)oct->mmio[0].hw_addr + CN23XX_SLI_OQ_WMARK); oct 549 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c if ((oct->rev_id == OCTEON_CN23XX_REV_1_0) || oct 550 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c (oct->rev_id == OCTEON_CN23XX_REV_1_1)) oct 551 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c writeq(readq((u8 *)oct->mmio[0].hw_addr + oct 553 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c (u8 *)oct->mmio[0].hw_addr + CN23XX_SLI_GBL_CONTROL); oct 556 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c if (oct->pf_num) oct 558 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c (u8 *)oct->mmio[0].hw_addr + CN23XX_SLI_OUT_BP_EN2_W1S); oct 561 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c (u8 *)oct->mmio[0].hw_addr + CN23XX_SLI_OUT_BP_EN_W1S); oct 564 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c static int cn23xx_setup_pf_device_regs(struct octeon_device *oct) oct 566 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c cn23xx_enable_error_reporting(oct); oct 569 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c cn23xx_setup_global_mac_regs(oct); oct 571 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c if (cn23xx_pf_setup_global_input_regs(oct)) oct 574 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c cn23xx_pf_setup_global_output_regs(oct); oct 579 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c octeon_write_csr64(oct, CN23XX_SLI_WINDOW_CTL, oct 583 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c octeon_write_csr64(oct, CN23XX_SLI_PKT_IN_JABBER, CN23XX_INPUT_JABBER); oct 587 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c static void cn23xx_setup_iq_regs(struct octeon_device *oct, u32 iq_no) oct 589 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c struct octeon_instr_queue *iq = oct->instr_queue[iq_no]; oct 592 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c iq_no += oct->sriov_info.pf_srn; oct 595 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c octeon_write_csr64(oct, CN23XX_SLI_IQ_BASE_ADDR64(iq_no), oct 597 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c octeon_write_csr(oct, CN23XX_SLI_IQ_SIZE(iq_no), iq->max_count); oct 603 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c (u8 *)oct->mmio[0].hw_addr + CN23XX_SLI_IQ_DOORBELL(iq_no); oct 605 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c (u8 *)oct->mmio[0].hw_addr + CN23XX_SLI_IQ_INSTR_COUNT64(iq_no); oct 606 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_dbg(&oct->pci_dev->dev, "InstQ[%d]:dbell reg @ 0x%p instcnt_reg @ 0x%p\n", oct 614 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c if (oct->msix_on) { oct 628 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c static void cn23xx_setup_oq_regs(struct octeon_device *oct, u32 oq_no) oct 631 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c struct octeon_droq *droq = oct->droq[oq_no]; oct 632 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c struct octeon_cn23xx_pf *cn23xx = (struct octeon_cn23xx_pf *)oct->chip; oct 636 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oq_no += oct->sriov_info.pf_srn; oct 638 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c octeon_write_csr64(oct, CN23XX_SLI_OQ_BASE_ADDR64(oq_no), oct 640 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c octeon_write_csr(oct, CN23XX_SLI_OQ_SIZE(oq_no), droq->max_count); oct 642 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c octeon_write_csr(oct, CN23XX_SLI_OQ_BUFF_INFO_SIZE(oq_no), oct 647 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c (u8 *)oct->mmio[0].hw_addr + CN23XX_SLI_OQ_PKTS_SENT(oq_no); oct 649 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c (u8 *)oct->mmio[0].hw_addr + CN23XX_SLI_OQ_PKTS_CREDIT(oq_no); oct 651 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c if (!oct->msix_on) { oct 655 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c octeon_read_csr(oct, CN23XX_SLI_OQ_PKT_CONTROL(oq_no)); oct 657 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c octeon_write_csr(oct, CN23XX_SLI_OQ_PKT_CONTROL(oq_no), oct 663 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c octeon_read_csr(oct, CN23XX_SLI_OQ_PKT_CONTROL(oq_no)); oct 665 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c octeon_write_csr(oct, CN23XX_SLI_OQ_PKT_CONTROL(oq_no), oct 669 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct, (u32)CFG_GET_OQ_INTR_TIME(cn23xx->conf)); oct 673 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct, CN23XX_SLI_OQ_PKT_INT_LEVELS(oq_no), oct 682 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c struct octeon_device *oct = mbox->oct_dev; oct 686 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c if (oct->rev_id < OCTEON_CN23XX_REV_1_1) { oct 691 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c for (i = 0; i < oct->sriov_info.num_vfs_alloced; i++) { oct 692 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c q_no = i * oct->sriov_info.rings_per_vf; oct 694 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c val64 = readq(oct->mbox[q_no]->mbox_write_reg); oct 697 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c if (octeon_mbox_read(oct->mbox[q_no])) oct 699 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->mbox[q_no]); oct 709 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c static int cn23xx_setup_pf_mbox(struct octeon_device *oct) oct 712 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c u16 mac_no = oct->pcie_port; oct 713 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c u16 pf_num = oct->pf_num; oct 716 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c if (!oct->sriov_info.max_vfs) oct 719 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c for (i = 0; i < oct->sriov_info.max_vfs; i++) { oct 720 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c q_no = i * oct->sriov_info.rings_per_vf; oct 730 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c mbox->oct_dev = oct; oct 737 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c mbox->mbox_int_reg = (u8 *)oct->mmio[0].hw_addr + oct 741 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c mbox->mbox_write_reg = (u8 *)oct->mmio[0].hw_addr + oct 745 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c mbox->mbox_read_reg = (u8 *)oct->mmio[0].hw_addr + oct 753 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->mbox[q_no] = mbox; oct 758 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c if (oct->rev_id < OCTEON_CN23XX_REV_1_1) oct 759 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c schedule_delayed_work(&oct->mbox[0]->mbox_poll_wk.work, oct 767 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c vfree(oct->mbox[i]); oct 773 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c static int cn23xx_free_pf_mbox(struct octeon_device *oct) oct 777 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c if (!oct->sriov_info.max_vfs) oct 780 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c for (i = 0; i < oct->sriov_info.max_vfs; i++) { oct 781 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c q_no = i * oct->sriov_info.rings_per_vf; oct 783 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c &oct->mbox[q_no]->mbox_poll_wk.work); oct 784 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c vfree(oct->mbox[q_no]); oct 790 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c static int cn23xx_enable_io_queues(struct octeon_device *oct) oct 796 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c srn = oct->sriov_info.pf_srn; oct 797 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c ern = srn + oct->num_iqs; oct 801 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c if (oct->io_qmask.iq64B & BIT_ULL(q_no - srn)) { oct 803 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct, CN23XX_SLI_IQ_PKT_CONTROL64(q_no)); oct 806 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct, CN23XX_SLI_IQ_PKT_CONTROL64(q_no), reg_val); oct 810 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c if (oct->io_qmask.iq & BIT_ULL(q_no - srn)) { oct 815 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct, CN23XX_SLI_IQ_PKT_CONTROL64(q_no)); oct 823 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct, oct 827 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_err(&oct->pci_dev->dev, oct 834 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct, CN23XX_SLI_IQ_PKT_CONTROL64(q_no), oct 838 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct, CN23XX_SLI_IQ_PKT_CONTROL64(q_no)); oct 840 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_err(&oct->pci_dev->dev, oct 847 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct, CN23XX_SLI_IQ_PKT_CONTROL64(q_no)); oct 850 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct, CN23XX_SLI_IQ_PKT_CONTROL64(q_no), reg_val); oct 856 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c if (oct->io_qmask.oq & BIT_ULL(q_no - srn)) { oct 858 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct, CN23XX_SLI_OQ_PKT_CONTROL(q_no)); oct 860 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c octeon_write_csr(oct, CN23XX_SLI_OQ_PKT_CONTROL(q_no), oct 867 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c static void cn23xx_disable_io_queues(struct octeon_device *oct) oct 874 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c srn = oct->sriov_info.pf_srn; oct 875 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c ern = srn + oct->num_iqs; oct 883 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct, CN23XX_SLI_IQ_PKT_CONTROL64(q_no))); oct 887 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c octeon_write_csr64(oct, CN23XX_SLI_IQ_PKT_CONTROL64(q_no), oct 894 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct, CN23XX_SLI_PKT_IOQ_RING_RST)); oct 897 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct, CN23XX_SLI_PKT_IOQ_RING_RST)); oct 902 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c octeon_write_csr(oct, CN23XX_SLI_IQ_DOORBELL(q_no), 0xFFFFFFFF); oct 903 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c while (octeon_read_csr64(oct, CN23XX_SLI_IQ_DOORBELL(q_no)) && oct 918 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct, CN23XX_SLI_PKT_IOQ_RING_RST)); oct 921 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct, CN23XX_SLI_PKT_IOQ_RING_RST)); oct 926 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c octeon_write_csr(oct, CN23XX_SLI_OQ_PKTS_CREDIT(q_no), oct 928 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c while (octeon_read_csr64(oct, oct 936 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct, CN23XX_SLI_OQ_PKTS_SENT(q_no))); oct 937 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c octeon_write_csr(oct, CN23XX_SLI_OQ_PKTS_SENT(q_no), oct 945 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c struct octeon_device *oct = ioq_vector->oct_dev; oct 948 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c struct octeon_droq *droq = oct->droq[ioq_vector->droq_index]; oct 950 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_dbg(&oct->pci_dev->dev, "In %s octeon_dev @ %p\n", __func__, oct); oct 953 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_err(&oct->pci_dev->dev, "23XX bringup FIXME: oct pfnum:%d ioq_vector->ioq_num :%d droq is NULL\n", oct 954 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->pf_num, ioq_vector->ioq_num); oct 984 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c static void cn23xx_handle_pf_mbox_intr(struct octeon_device *oct) oct 990 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c mbox_int_val = readq(oct->mbox[0]->mbox_int_reg); oct 992 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c for (i = 0; i < oct->sriov_info.num_vfs_alloced; i++) { oct 993 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c q_no = i * oct->sriov_info.rings_per_vf; oct 997 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->mbox[0]->mbox_int_reg); oct 998 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c if (octeon_mbox_read(oct->mbox[q_no])) { oct 999 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c work = &oct->mbox[q_no]->mbox_poll_wk.work; oct 1009 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c struct octeon_device *oct = (struct octeon_device *)dev; oct 1010 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c struct octeon_cn23xx_pf *cn23xx = (struct octeon_cn23xx_pf *)oct->chip; oct 1013 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_dbg(&oct->pci_dev->dev, "In %s octeon_dev @ %p\n", __func__, oct); oct 1016 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->int_status = 0; oct 1019 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_err(&oct->pci_dev->dev, "OCTEON[%d]: Error Intr: 0x%016llx\n", oct 1020 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->octeon_id, CVM_CAST64(intr64)); oct 1024 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c cn23xx_handle_pf_mbox_intr(oct); oct 1026 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c if (oct->msix_on != LIO_FLAG_MSIX_ENABLED) { oct 1028 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->int_status |= OCT_DEV_INTR_PKT_DATA; oct 1032 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->int_status |= OCT_DEV_INTR_DMA0_FORCE; oct 1034 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->int_status |= OCT_DEV_INTR_DMA1_FORCE; oct 1042 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c static void cn23xx_bar1_idx_setup(struct octeon_device *oct, u64 core_addr, oct 1050 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct, CN23XX_PEM_BAR1_INDEX_REG(oct->pcie_port, idx)); oct 1052 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c lio_pci_writeq(oct, (READ_ONCE(bar1) & 0xFFFFFFFEULL), oct 1053 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c CN23XX_PEM_BAR1_INDEX_REG(oct->pcie_port, idx)); oct 1055 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct, CN23XX_PEM_BAR1_INDEX_REG(oct->pcie_port, idx)); oct 1063 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c lio_pci_writeq(oct, (((core_addr >> 22) << 4) | PCI_BAR1_MASK), oct 1064 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c CN23XX_PEM_BAR1_INDEX_REG(oct->pcie_port, idx)); oct 1067 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct, CN23XX_PEM_BAR1_INDEX_REG(oct->pcie_port, idx))); oct 1070 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c static void cn23xx_bar1_idx_write(struct octeon_device *oct, u32 idx, u32 mask) oct 1072 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c lio_pci_writeq(oct, mask, oct 1073 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c CN23XX_PEM_BAR1_INDEX_REG(oct->pcie_port, idx)); oct 1076 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c static u32 cn23xx_bar1_idx_read(struct octeon_device *oct, u32 idx) oct 1079 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct, CN23XX_PEM_BAR1_INDEX_REG(oct->pcie_port, idx)); oct 1103 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c static void cn23xx_enable_pf_interrupt(struct octeon_device *oct, u8 intr_flag) oct 1105 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c struct octeon_cn23xx_pf *cn23xx = (struct octeon_cn23xx_pf *)oct->chip; oct 1117 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c (oct->sriov_info.max_vfs > 0)) { oct 1118 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c if (oct->rev_id >= OCTEON_CN23XX_REV_1_1) { oct 1126 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c static void cn23xx_disable_pf_interrupt(struct octeon_device *oct, u8 intr_flag) oct 1128 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c struct octeon_cn23xx_pf *cn23xx = (struct octeon_cn23xx_pf *)oct->chip; oct 1139 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c (oct->sriov_info.max_vfs > 0)) { oct 1140 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c if (oct->rev_id >= OCTEON_CN23XX_REV_1_1) { oct 1148 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c static void cn23xx_get_pcie_qlmport(struct octeon_device *oct) oct 1150 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->pcie_port = (octeon_read_csr(oct, CN23XX_SLI_MAC_NUMBER)) & 0xff; oct 1152 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_dbg(&oct->pci_dev->dev, "OCTEON: CN23xx uses PCIE Port %d\n", oct 1153 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->pcie_port); oct 1156 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c static int cn23xx_get_pf_num(struct octeon_device *oct) oct 1165 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c if (pci_read_config_dword(oct->pci_dev, CN23XX_PCIE_SRIOV_FDL, oct 1167 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->pf_num = ((fdl_bit >> CN23XX_PCIE_SRIOV_FDL_BIT_POS) & oct 1177 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c pkt0_in_ctl = octeon_read_csr64(oct, oct 1181 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c mac = (octeon_read_csr(oct, CN23XX_SLI_MAC_NUMBER)) & 0xff; oct 1184 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c d64 = octeon_read_csr64(oct, oct 1188 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_err(&oct->pci_dev->dev, oct 1191 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->pf_num = pfnum; oct 1194 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_err(&oct->pci_dev->dev, oct 1202 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c static void cn23xx_setup_reg_address(struct octeon_device *oct) oct 1204 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c u8 __iomem *bar0_pciaddr = oct->mmio[0].hw_addr; oct 1205 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c struct octeon_cn23xx_pf *cn23xx = (struct octeon_cn23xx_pf *)oct->chip; oct 1207 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->reg_list.pci_win_wr_addr_hi = oct 1209 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->reg_list.pci_win_wr_addr_lo = oct 1211 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->reg_list.pci_win_wr_addr = oct 1214 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->reg_list.pci_win_rd_addr_hi = oct 1216 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->reg_list.pci_win_rd_addr_lo = oct 1218 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->reg_list.pci_win_rd_addr = oct 1221 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->reg_list.pci_win_wr_data_hi = oct 1223 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->reg_list.pci_win_wr_data_lo = oct 1225 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->reg_list.pci_win_wr_data = oct 1228 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->reg_list.pci_win_rd_data_hi = oct 1230 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->reg_list.pci_win_rd_data_lo = oct 1232 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->reg_list.pci_win_rd_data = oct 1235 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c cn23xx_get_pcie_qlmport(oct); oct 1238 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c if (!oct->msix_on) oct 1240 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c if (oct->rev_id >= OCTEON_CN23XX_REV_1_1) oct 1245 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c CN23XX_SLI_MAC_PF_INT_SUM64(oct->pcie_port, oct->pf_num); oct 1248 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c CN23XX_SLI_MAC_PF_INT_ENB64(oct->pcie_port, oct->pf_num); oct 1251 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c int cn23xx_sriov_config(struct octeon_device *oct) oct 1253 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c struct octeon_cn23xx_pf *cn23xx = (struct octeon_cn23xx_pf *)oct->chip; oct 1259 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c (struct octeon_config *)oct_get_config_info(oct, LIO_23XX); oct 1260 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c switch (oct->rev_id) { oct 1275 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c if (oct->sriov_info.num_pf_rings) oct 1276 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c num_pf_rings = oct->sriov_info.num_pf_rings; oct 1294 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->sriov_info.trs = total_rings; oct 1295 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->sriov_info.max_vfs = max_vfs; oct 1296 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->sriov_info.rings_per_vf = rings_per_vf; oct 1297 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->sriov_info.pf_srn = pf_srn; oct 1298 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->sriov_info.num_pf_rings = num_pf_rings; oct 1299 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_notice(&oct->pci_dev->dev, "trs:%d max_vfs:%d rings_per_vf:%d pf_srn:%d num_pf_rings:%d\n", oct 1300 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->sriov_info.trs, oct->sriov_info.max_vfs, oct 1301 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->sriov_info.rings_per_vf, oct->sriov_info.pf_srn, oct 1302 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->sriov_info.num_pf_rings); oct 1304 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->sriov_info.sriov_enabled = 0; oct 1309 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c int setup_cn23xx_octeon_pf_device(struct octeon_device *oct) oct 1314 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c pci_read_config_dword(oct->pci_dev, PCI_BASE_ADDRESS_0, &data32); oct 1316 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c pci_read_config_dword(oct->pci_dev, PCI_BASE_ADDRESS_1, &data32); oct 1318 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c pci_read_config_dword(oct->pci_dev, PCI_BASE_ADDRESS_2, &data32); oct 1320 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c pci_read_config_dword(oct->pci_dev, PCI_BASE_ADDRESS_3, &data32); oct 1325 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_err(&oct->pci_dev->dev, "device BAR0 unassigned\n"); oct 1327 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_err(&oct->pci_dev->dev, "device BAR1 unassigned\n"); oct 1331 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c if (octeon_map_pci_barx(oct, 0, 0)) oct 1334 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c if (octeon_map_pci_barx(oct, 1, MAX_BAR1_IOREMAP_SIZE)) { oct 1335 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_err(&oct->pci_dev->dev, "%s CN23XX BAR1 map failed\n", oct 1337 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c octeon_unmap_pci_barx(oct, 0); oct 1341 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c if (cn23xx_get_pf_num(oct) != 0) oct 1344 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c if (cn23xx_sriov_config(oct)) { oct 1345 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c octeon_unmap_pci_barx(oct, 0); oct 1346 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c octeon_unmap_pci_barx(oct, 1); oct 1350 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c octeon_write_csr64(oct, CN23XX_SLI_MAC_CREDIT_CNT, 0x3F802080802080ULL); oct 1352 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->fn_list.setup_iq_regs = cn23xx_setup_iq_regs; oct 1353 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->fn_list.setup_oq_regs = cn23xx_setup_oq_regs; oct 1354 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->fn_list.setup_mbox = cn23xx_setup_pf_mbox; oct 1355 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->fn_list.free_mbox = cn23xx_free_pf_mbox; oct 1357 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->fn_list.process_interrupt_regs = cn23xx_interrupt_handler; oct 1358 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->fn_list.msix_interrupt_handler = cn23xx_pf_msix_interrupt_handler; oct 1360 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->fn_list.soft_reset = cn23xx_pf_soft_reset; oct 1361 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->fn_list.setup_device_regs = cn23xx_setup_pf_device_regs; oct 1362 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->fn_list.update_iq_read_idx = cn23xx_update_read_index; oct 1364 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->fn_list.bar1_idx_setup = cn23xx_bar1_idx_setup; oct 1365 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->fn_list.bar1_idx_write = cn23xx_bar1_idx_write; oct 1366 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->fn_list.bar1_idx_read = cn23xx_bar1_idx_read; oct 1368 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->fn_list.enable_interrupt = cn23xx_enable_pf_interrupt; oct 1369 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->fn_list.disable_interrupt = cn23xx_disable_pf_interrupt; oct 1371 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->fn_list.enable_io_queues = cn23xx_enable_io_queues; oct 1372 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->fn_list.disable_io_queues = cn23xx_disable_io_queues; oct 1374 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c cn23xx_setup_reg_address(oct); oct 1376 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c oct->coproc_clock_rate = 1000000ULL * cn23xx_coprocessor_clock(oct); oct 1381 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c int validate_cn23xx_pf_config_info(struct octeon_device *oct, oct 1385 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_err(&oct->pci_dev->dev, "%s: Num IQ (%d) exceeds Max (%d)\n", oct 1392 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_err(&oct->pci_dev->dev, "%s: Num OQ (%d) exceeds Max (%d)\n", oct 1400 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_err(&oct->pci_dev->dev, "%s: Invalid instr type for IQ\n", oct 1406 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_err(&oct->pci_dev->dev, "%s: Invalid parameter for OQ\n", oct 1412 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_err(&oct->pci_dev->dev, "%s: Invalid parameter for OQ\n", oct 1420 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c int cn23xx_fw_loaded(struct octeon_device *oct) oct 1432 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c if (atomic_read(oct->adapter_refcount) > 1) oct 1435 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c val = octeon_read_csr64(oct, CN23XX_SLI_SCRATCH2); oct 1439 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c void cn23xx_tell_vf_its_macaddr_changed(struct octeon_device *oct, int vfidx, oct 1442 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c if (oct->sriov_info.vf_drv_loaded_mask & BIT_ULL(vfidx)) { oct 1455 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c mbox_cmd.q_no = vfidx * oct->sriov_info.rings_per_vf; oct 1456 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c octeon_mbox_write(oct, &mbox_cmd); oct 1461 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c cn23xx_get_vf_stats_callback(struct octeon_device *oct, oct 1470 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c int cn23xx_get_vf_stats(struct octeon_device *oct, int vfidx, oct 1478 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c if (!(oct->sriov_info.vf_drv_loaded_mask & (1ULL << vfidx))) oct 1489 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c mbox_cmd.q_no = vfidx * oct->sriov_info.rings_per_vf; oct 1497 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c octeon_mbox_write(oct, &mbox_cmd); oct 1505 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c octeon_mbox_cancel(oct, 0); oct 1506 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c dev_err(&oct->pci_dev->dev, "Unable to get stats from VF-%d, timedout\n", oct 55 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.h int setup_cn23xx_octeon_pf_device(struct octeon_device *oct); oct 57 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.h int validate_cn23xx_pf_config_info(struct octeon_device *oct, oct 60 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.h u32 cn23xx_pf_get_oq_ticks(struct octeon_device *oct, u32 time_intr_in_us); oct 62 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.h void cn23xx_dump_pf_initialized_regs(struct octeon_device *oct); oct 64 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.h int cn23xx_sriov_config(struct octeon_device *oct); oct 66 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.h int cn23xx_fw_loaded(struct octeon_device *oct); oct 68 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.h void cn23xx_tell_vf_its_macaddr_changed(struct octeon_device *oct, int vfidx, oct 71 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.h int cn23xx_get_vf_stats(struct octeon_device *oct, int ifidx, oct 30 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c u32 cn23xx_vf_get_oq_ticks(struct octeon_device *oct, u32 time_intr_in_us) oct 33 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c u32 oqticks_per_us = (u32)oct->pfvf_hsword.coproc_tics_per_us; oct 50 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c static int cn23xx_vf_reset_io_queues(struct octeon_device *oct, u32 num_queues) oct 59 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c d64 = octeon_read_csr64(oct, oct 62 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c octeon_write_csr64(oct, CN23XX_VF_SLI_IQ_PKT_CONTROL64(q_no), oct 68 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c u64 reg_val = octeon_read_csr64(oct, oct 74 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c oct, CN23XX_VF_SLI_IQ_PKT_CONTROL64(q_no))); oct 78 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c dev_err(&oct->pci_dev->dev, oct 85 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c octeon_write_csr64(oct, CN23XX_VF_SLI_IQ_PKT_CONTROL64(q_no), oct 89 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c oct, CN23XX_VF_SLI_IQ_PKT_CONTROL64(q_no))); oct 91 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c dev_err(&oct->pci_dev->dev, oct 101 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c static int cn23xx_vf_setup_global_input_regs(struct octeon_device *oct) oct 103 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c struct octeon_cn23xx_vf *cn23xx = (struct octeon_cn23xx_vf *)oct->chip; oct 108 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c if (cn23xx_vf_reset_io_queues(oct, oct->sriov_info.rings_per_vf)) oct 111 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c for (q_no = 0; q_no < (oct->sriov_info.rings_per_vf); q_no++) { oct 114 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c octeon_write_csr64(oct, CN23XX_VF_SLI_IQ_DOORBELL(q_no), oct 116 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c iq = oct->instr_queue[q_no]; oct 121 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c inst_cnt_reg = (u8 *)oct->mmio[0].hw_addr + oct 124 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c d64 = octeon_read_csr64(oct, oct 129 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c octeon_write_csr64(oct, CN23XX_VF_SLI_IQ_INSTR_COUNT64(q_no), oct 135 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c octeon_write_csr64(oct, CN23XX_VF_SLI_IQ_PKT_CONTROL64(q_no), oct 151 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c static void cn23xx_vf_setup_global_output_regs(struct octeon_device *oct) oct 156 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c for (q_no = 0; q_no < (oct->sriov_info.rings_per_vf); q_no++) { oct 157 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c octeon_write_csr(oct, CN23XX_VF_SLI_OQ_PKTS_CREDIT(q_no), oct 161 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c octeon_read_csr(oct, CN23XX_VF_SLI_OQ_PKTS_SENT(q_no)); oct 166 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c octeon_read_csr(oct, CN23XX_VF_SLI_OQ_PKT_CONTROL(q_no)); oct 197 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c octeon_write_csr(oct, CN23XX_VF_SLI_OQ_PKT_CONTROL(q_no), oct 202 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c static int cn23xx_setup_vf_device_regs(struct octeon_device *oct) oct 204 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c if (cn23xx_vf_setup_global_input_regs(oct)) oct 207 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c cn23xx_vf_setup_global_output_regs(oct); oct 212 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c static void cn23xx_setup_vf_iq_regs(struct octeon_device *oct, u32 iq_no) oct 214 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c struct octeon_instr_queue *iq = oct->instr_queue[iq_no]; oct 218 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c octeon_write_csr64(oct, CN23XX_VF_SLI_IQ_BASE_ADDR64(iq_no), oct 220 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c octeon_write_csr(oct, CN23XX_VF_SLI_IQ_SIZE(iq_no), iq->max_count); oct 226 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c (u8 *)oct->mmio[0].hw_addr + CN23XX_VF_SLI_IQ_DOORBELL(iq_no); oct 228 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c (u8 *)oct->mmio[0].hw_addr + CN23XX_VF_SLI_IQ_INSTR_COUNT64(iq_no); oct 229 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c dev_dbg(&oct->pci_dev->dev, "InstQ[%d]:dbell reg @ 0x%p instcnt_reg @ 0x%p\n", oct 237 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c if (oct->msix_on) { oct 245 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c static void cn23xx_setup_vf_oq_regs(struct octeon_device *oct, u32 oq_no) oct 247 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c struct octeon_droq *droq = oct->droq[oq_no]; oct 249 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c octeon_write_csr64(oct, CN23XX_VF_SLI_OQ_BASE_ADDR64(oq_no), oct 251 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c octeon_write_csr(oct, CN23XX_VF_SLI_OQ_SIZE(oq_no), droq->max_count); oct 253 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c octeon_write_csr(oct, CN23XX_VF_SLI_OQ_BUFF_INFO_SIZE(oq_no), oct 258 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c (u8 *)oct->mmio[0].hw_addr + CN23XX_VF_SLI_OQ_PKTS_SENT(oq_no); oct 260 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c (u8 *)oct->mmio[0].hw_addr + CN23XX_VF_SLI_OQ_PKTS_CREDIT(oq_no); oct 271 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c static int cn23xx_free_vf_mbox(struct octeon_device *oct) oct 273 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c cancel_delayed_work_sync(&oct->mbox[0]->mbox_poll_wk.work); oct 274 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c vfree(oct->mbox[0]); oct 278 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c static int cn23xx_setup_vf_mbox(struct octeon_device *oct) oct 290 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c mbox->oct_dev = oct; oct 298 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c (u8 *)oct->mmio[0].hw_addr + CN23XX_VF_SLI_PKT_MBOX_INT(0); oct 301 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c (u8 *)oct->mmio[0].hw_addr + CN23XX_SLI_PKT_PF_VF_MBOX_SIG(0, 0); oct 304 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c (u8 *)oct->mmio[0].hw_addr + CN23XX_SLI_PKT_PF_VF_MBOX_SIG(0, 1); oct 311 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c oct->mbox[0] = mbox; oct 318 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c static int cn23xx_enable_vf_io_queues(struct octeon_device *oct) oct 322 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c for (q_no = 0; q_no < oct->num_iqs; q_no++) { oct 326 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c if (oct->io_qmask.iq64B & BIT_ULL(q_no)) { oct 328 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c oct, CN23XX_VF_SLI_IQ_PKT_CONTROL64(q_no)); oct 331 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c oct, CN23XX_VF_SLI_IQ_PKT_CONTROL64(q_no), reg_val); oct 335 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c if (oct->io_qmask.iq & BIT_ULL(q_no)) { oct 337 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c oct, CN23XX_VF_SLI_IQ_PKT_CONTROL64(q_no)); oct 340 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c oct, CN23XX_VF_SLI_IQ_PKT_CONTROL64(q_no), reg_val); oct 343 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c for (q_no = 0; q_no < oct->num_oqs; q_no++) { oct 347 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c if (oct->io_qmask.oq & BIT_ULL(q_no)) { oct 349 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c oct, CN23XX_VF_SLI_OQ_PKT_CONTROL(q_no)); oct 352 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c oct, CN23XX_VF_SLI_OQ_PKT_CONTROL(q_no), reg_val); oct 359 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c static void cn23xx_disable_vf_io_queues(struct octeon_device *oct) oct 361 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c u32 num_queues = oct->num_iqs; oct 366 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c if (num_queues < oct->num_oqs) oct 367 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c num_queues = oct->num_oqs; oct 369 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c cn23xx_vf_reset_io_queues(oct, num_queues); oct 372 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c void cn23xx_vf_ask_pf_to_do_flr(struct octeon_device *oct) oct 387 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c octeon_mbox_write(oct, &mbox_cmd); oct 390 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c static void octeon_pfvf_hs_callback(struct octeon_device *oct, oct 396 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c memcpy((uint8_t *)&oct->pfvf_hsword, cmd->msg.s.params, oct 406 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c int cn23xx_octeon_pfvf_handshake(struct octeon_device *oct) oct 416 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c dev_dbg(&oct->pci_dev->dev, "requesting info from pf\n"); oct 436 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c octeon_mbox_write(oct, &mbox_cmd); oct 446 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c dev_err(&oct->pci_dev->dev, "octeon_pfvf_handshake timeout\n"); oct 450 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c for (q_no = 0 ; q_no < oct->num_iqs ; q_no++) oct 451 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c oct->instr_queue[q_no]->txpciq.s.pkind = oct->pfvf_hsword.pkind; oct 456 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c dev_err(&oct->pci_dev->dev, oct 462 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c dev_dbg(&oct->pci_dev->dev, oct 466 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c dev_dbg(&oct->pci_dev->dev, "got data from pf pkind is %d\n", oct 467 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c oct->pfvf_hsword.pkind); oct 474 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c struct octeon_device *oct = ioq_vector->oct_dev; oct 479 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c mbox_int_val = readq(oct->mbox[0]->mbox_int_reg); oct 480 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c writeq(mbox_int_val, oct->mbox[0]->mbox_int_reg); oct 481 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c if (octeon_mbox_read(oct->mbox[0])) oct 482 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c schedule_delayed_work(&oct->mbox[0]->mbox_poll_wk.work, oct 490 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c struct octeon_device *oct = ioq_vector->oct_dev; oct 491 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c struct octeon_droq *droq = oct->droq[ioq_vector->droq_index]; oct 495 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c dev_dbg(&oct->pci_dev->dev, "In %s octeon_dev @ %p\n", __func__, oct); oct 544 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c static void cn23xx_enable_vf_interrupt(struct octeon_device *oct, u8 intr_flag) oct 546 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c struct octeon_cn23xx_vf *cn23xx = (struct octeon_cn23xx_vf *)oct->chip; oct 550 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c for (q_no = 0; q_no < oct->num_oqs; q_no++) { oct 555 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c oct, (u32)CFG_GET_OQ_INTR_TIME(cn23xx->conf)); oct 558 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c oct, CN23XX_VF_SLI_OQ_PKT_INT_LEVELS(q_no), oct 565 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c for (q_no = 0; q_no < oct->num_oqs; q_no++) { oct 568 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c oct, CN23XX_VF_SLI_IQ_INSTR_COUNT64(q_no), oct 570 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c oct, CN23XX_VF_SLI_IQ_INSTR_COUNT64(q_no)) & oct 579 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c oct, CN23XX_VF_SLI_PKT_MBOX_INT(0), oct 580 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c (octeon_read_csr64(oct, CN23XX_VF_SLI_PKT_MBOX_INT(0)) | oct 585 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c static void cn23xx_disable_vf_interrupt(struct octeon_device *oct, u8 intr_flag) oct 590 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c for (q_no = 0; q_no < oct->num_oqs; q_no++) { oct 593 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c oct, CN23XX_VF_SLI_OQ_PKT_INT_LEVELS(q_no), oct 598 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c for (q_no = 0; q_no < oct->num_oqs; q_no++) { oct 600 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c oct, CN23XX_VF_SLI_IQ_INSTR_COUNT64(q_no), oct 602 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c oct, CN23XX_VF_SLI_IQ_INSTR_COUNT64(q_no)) & oct 610 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c oct, CN23XX_VF_SLI_PKT_MBOX_INT(0), oct 611 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c (octeon_read_csr64(oct, CN23XX_VF_SLI_PKT_MBOX_INT(0)) & oct 616 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c int cn23xx_setup_octeon_vf_device(struct octeon_device *oct) oct 618 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c struct octeon_cn23xx_vf *cn23xx = (struct octeon_cn23xx_vf *)oct->chip; oct 622 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c if (octeon_map_pci_barx(oct, 0, 0)) oct 626 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c reg_val = octeon_read_csr64(oct, CN23XX_VF_SLI_IQ_PKT_CONTROL64(0)); oct 628 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c oct->pf_num = (reg_val >> CN23XX_PKT_INPUT_CTL_PF_NUM_POS) & oct 630 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c oct->vf_num = (reg_val >> CN23XX_PKT_INPUT_CTL_VF_NUM_POS) & oct 637 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c cn23xx->conf = oct_get_config_info(oct, LIO_23XX); oct 639 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c dev_err(&oct->pci_dev->dev, "%s No Config found for CN23XX\n", oct 641 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c octeon_unmap_pci_barx(oct, 0); oct 645 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c if (oct->sriov_info.rings_per_vf > rings_per_vf) { oct 646 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c dev_warn(&oct->pci_dev->dev, oct 648 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c oct->sriov_info.rings_per_vf, rings_per_vf, oct 650 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c oct->sriov_info.rings_per_vf = rings_per_vf; oct 653 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c dev_warn(&oct->pci_dev->dev, oct 658 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c oct->sriov_info.rings_per_vf = oct 661 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c oct->sriov_info.rings_per_vf = rings_per_vf; oct 665 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c oct->fn_list.setup_iq_regs = cn23xx_setup_vf_iq_regs; oct 666 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c oct->fn_list.setup_oq_regs = cn23xx_setup_vf_oq_regs; oct 667 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c oct->fn_list.setup_mbox = cn23xx_setup_vf_mbox; oct 668 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c oct->fn_list.free_mbox = cn23xx_free_vf_mbox; oct 670 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c oct->fn_list.msix_interrupt_handler = cn23xx_vf_msix_interrupt_handler; oct 672 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c oct->fn_list.setup_device_regs = cn23xx_setup_vf_device_regs; oct 673 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c oct->fn_list.update_iq_read_idx = cn23xx_update_read_index; oct 675 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c oct->fn_list.enable_interrupt = cn23xx_enable_vf_interrupt; oct 676 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c oct->fn_list.disable_interrupt = cn23xx_disable_vf_interrupt; oct 678 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c oct->fn_list.enable_io_queues = cn23xx_enable_vf_io_queues; oct 679 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c oct->fn_list.disable_io_queues = cn23xx_disable_vf_io_queues; oct 39 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.h void cn23xx_vf_ask_pf_to_do_flr(struct octeon_device *oct); oct 41 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.h int cn23xx_octeon_pfvf_handshake(struct octeon_device *oct); oct 43 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.h int cn23xx_setup_octeon_vf_device(struct octeon_device *oct); oct 45 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.h u32 cn23xx_vf_get_oq_ticks(struct octeon_device *oct, u32 time_intr_in_us); oct 47 drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.h void cn23xx_dump_vf_initialized_regs(struct octeon_device *oct); oct 29 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c int lio_cn6xxx_soft_reset(struct octeon_device *oct) oct 31 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c octeon_write_csr64(oct, CN6XXX_WIN_WR_MASK_REG, 0xFF); oct 33 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c dev_dbg(&oct->pci_dev->dev, "BIST enabled for soft reset\n"); oct 35 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c lio_pci_writeq(oct, 1, CN6XXX_CIU_SOFT_BIST); oct 36 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c octeon_write_csr64(oct, CN6XXX_SLI_SCRATCH1, 0x1234ULL); oct 38 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c lio_pci_readq(oct, CN6XXX_CIU_SOFT_RST); oct 39 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c lio_pci_writeq(oct, 1, CN6XXX_CIU_SOFT_RST); oct 44 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c if (octeon_read_csr64(oct, CN6XXX_SLI_SCRATCH1)) { oct 45 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c dev_err(&oct->pci_dev->dev, "Soft reset failed\n"); oct 49 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c dev_dbg(&oct->pci_dev->dev, "Reset completed\n"); oct 50 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c octeon_write_csr64(oct, CN6XXX_WIN_WR_MASK_REG, 0xFF); oct 55 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c void lio_cn6xxx_enable_error_reporting(struct octeon_device *oct) oct 59 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c pci_read_config_dword(oct->pci_dev, CN6XXX_PCIE_DEVCTL, &val); oct 61 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c dev_err(&oct->pci_dev->dev, "PCI-E Link error detected: 0x%08x\n", oct 67 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c dev_dbg(&oct->pci_dev->dev, "Enabling PCI-E error reporting..\n"); oct 68 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c pci_write_config_dword(oct->pci_dev, CN6XXX_PCIE_DEVCTL, val); oct 71 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c void lio_cn6xxx_setup_pcie_mps(struct octeon_device *oct, oct 78 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c pci_read_config_dword(oct->pci_dev, CN6XXX_PCIE_DEVCTL, &val); oct 85 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c pci_write_config_dword(oct->pci_dev, CN6XXX_PCIE_DEVCTL, val); oct 89 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c r64 = lio_pci_readq(oct, CN6XXX_DPI_SLI_PRTX_CFG(oct->pcie_port)); oct 91 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c lio_pci_writeq(oct, r64, CN6XXX_DPI_SLI_PRTX_CFG(oct->pcie_port)); oct 94 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c void lio_cn6xxx_setup_pcie_mrrs(struct octeon_device *oct, oct 101 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c pci_read_config_dword(oct->pci_dev, CN6XXX_PCIE_DEVCTL, &val); oct 108 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c pci_write_config_dword(oct->pci_dev, CN6XXX_PCIE_DEVCTL, val); oct 112 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c r64 = octeon_read_csr64(oct, CN6XXX_SLI_S2M_PORTX_CTL(oct->pcie_port)); oct 114 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c octeon_write_csr64(oct, CN6XXX_SLI_S2M_PORTX_CTL(oct->pcie_port), r64); oct 117 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c r64 = lio_pci_readq(oct, CN6XXX_DPI_SLI_PRTX_CFG(oct->pcie_port)); oct 119 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c lio_pci_writeq(oct, r64, CN6XXX_DPI_SLI_PRTX_CFG(oct->pcie_port)); oct 122 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c u32 lio_cn6xxx_coprocessor_clock(struct octeon_device *oct) oct 127 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c return ((lio_pci_readq(oct, CN6XXX_MIO_RST_BOOT) >> 24) & 0x3f) * 50; oct 130 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c u32 lio_cn6xxx_get_oq_ticks(struct octeon_device *oct, oct 134 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c u32 oqticks_per_us = lio_cn6xxx_coprocessor_clock(oct); oct 155 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c void lio_cn6xxx_setup_global_input_regs(struct octeon_device *oct) oct 158 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c octeon_write_csr(oct, CN6XXX_SLI_PKT_INPUT_CONTROL, oct 162 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c octeon_write_csr64(oct, CN6XXX_SLI_PKT_INSTR_RD_SIZE, oct 166 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c octeon_write_csr64(oct, CN6XXX_SLI_IN_PCIE_PORT, oct 167 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c (oct->pcie_port * 0x5555555555555555ULL)); oct 170 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c static void lio_cn66xx_setup_pkt_ctl_regs(struct octeon_device *oct) oct 174 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c struct octeon_cn6xxx *cn6xxx = (struct octeon_cn6xxx *)oct->chip; oct 176 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c pktctl = octeon_read_csr64(oct, CN6XXX_SLI_PKT_CTL); oct 190 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c octeon_write_csr64(oct, CN6XXX_SLI_PKT_CTL, pktctl); oct 193 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c void lio_cn6xxx_setup_global_output_regs(struct octeon_device *oct) oct 196 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c struct octeon_cn6xxx *cn6xxx = (struct octeon_cn6xxx *)oct->chip; oct 199 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c octeon_write_csr64(oct, CN6XXX_SLI_PKT_PCIE_PORT64, oct 200 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c (oct->pcie_port * 0x5555555555555555ULL)); oct 203 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c octeon_write_csr64(oct, CN6XXX_SLI_OQ_WMARK, 32); oct 206 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c octeon_write_csr64(oct, CN6XXX_SLI_OQ_WMARK, 0); oct 210 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c octeon_write_csr(oct, CN6XXX_SLI_PKT_OUT_BMODE, 0); oct 215 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c octeon_write_csr(oct, CN6XXX_SLI_PKT_DPADDR, 0xFFFFFFFF); oct 220 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c octeon_write_csr(oct, CN6XXX_SLI_PKT_SLIST_ROR, 0); oct 221 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c octeon_write_csr(oct, CN6XXX_SLI_PKT_SLIST_NS, 0); oct 225 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c octeon_write_csr64(oct, CN6XXX_SLI_PKT_SLIST_ES64, oct 228 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c octeon_write_csr64(oct, CN6XXX_SLI_PKT_SLIST_ES64, 0ULL); oct 232 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c octeon_write_csr(oct, CN6XXX_SLI_PKT_DATA_OUT_ROR, 0); oct 233 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c octeon_write_csr(oct, CN6XXX_SLI_PKT_DATA_OUT_NS, 0); oct 234 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c octeon_write_csr64(oct, CN6XXX_SLI_PKT_DATA_OUT_ES64, oct 238 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c octeon_write_csr(oct, CN6XXX_SLI_OQ_INT_LEVEL_PKTS, oct 241 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c lio_cn6xxx_get_oq_ticks(oct, (u32) oct 244 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c octeon_write_csr(oct, CN6XXX_SLI_OQ_INT_LEVEL_TIME, time_threshold); oct 247 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c static int lio_cn6xxx_setup_device_regs(struct octeon_device *oct) oct 249 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c lio_cn6xxx_setup_pcie_mps(oct, PCIE_MPS_DEFAULT); oct 250 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c lio_cn6xxx_setup_pcie_mrrs(oct, PCIE_MRRS_512B); oct 251 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c lio_cn6xxx_enable_error_reporting(oct); oct 253 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c lio_cn6xxx_setup_global_input_regs(oct); oct 254 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c lio_cn66xx_setup_pkt_ctl_regs(oct); oct 255 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c lio_cn6xxx_setup_global_output_regs(oct); oct 260 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c octeon_write_csr64(oct, CN6XXX_SLI_WINDOW_CTL, 0x200000ULL); oct 264 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c void lio_cn6xxx_setup_iq_regs(struct octeon_device *oct, u32 iq_no) oct 266 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c struct octeon_instr_queue *iq = oct->instr_queue[iq_no]; oct 268 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c octeon_write_csr64(oct, CN6XXX_SLI_IQ_PKT_INSTR_HDR64(iq_no), 0); oct 271 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c octeon_write_csr64(oct, CN6XXX_SLI_IQ_BASE_ADDR64(iq_no), oct 273 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c octeon_write_csr(oct, CN6XXX_SLI_IQ_SIZE(iq_no), iq->max_count); oct 278 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c iq->doorbell_reg = oct->mmio[0].hw_addr + CN6XXX_SLI_IQ_DOORBELL(iq_no); oct 279 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c iq->inst_cnt_reg = oct->mmio[0].hw_addr oct 281 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c dev_dbg(&oct->pci_dev->dev, "InstQ[%d]:dbell reg @ 0x%p instcnt_reg @ 0x%p\n", oct 290 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c static void lio_cn66xx_setup_iq_regs(struct octeon_device *oct, u32 iq_no) oct 292 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c lio_cn6xxx_setup_iq_regs(oct, iq_no); oct 297 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c octeon_write_csr64(oct, CN66XX_SLI_IQ_BP64(iq_no), oct 301 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c void lio_cn6xxx_setup_oq_regs(struct octeon_device *oct, u32 oq_no) oct 304 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c struct octeon_droq *droq = oct->droq[oq_no]; oct 306 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c octeon_write_csr64(oct, CN6XXX_SLI_OQ_BASE_ADDR64(oq_no), oct 308 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c octeon_write_csr(oct, CN6XXX_SLI_OQ_SIZE(oq_no), droq->max_count); oct 310 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c octeon_write_csr(oct, CN6XXX_SLI_OQ_BUFF_INFO_SIZE(oq_no), oct 315 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c oct->mmio[0].hw_addr + CN6XXX_SLI_OQ_PKTS_SENT(oq_no); oct 317 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c oct->mmio[0].hw_addr + CN6XXX_SLI_OQ_PKTS_CREDIT(oq_no); oct 320 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c intr = octeon_read_csr(oct, CN6XXX_SLI_PKT_TIME_INT_ENB); oct 322 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c octeon_write_csr(oct, CN6XXX_SLI_PKT_TIME_INT_ENB, intr); oct 325 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c intr = octeon_read_csr(oct, CN6XXX_SLI_PKT_CNT_INT_ENB); oct 327 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c octeon_write_csr(oct, CN6XXX_SLI_PKT_CNT_INT_ENB, intr); oct 330 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c int lio_cn6xxx_enable_io_queues(struct octeon_device *oct) oct 334 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c mask = octeon_read_csr(oct, CN6XXX_SLI_PKT_INSTR_SIZE); oct 335 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c mask |= oct->io_qmask.iq64B; oct 336 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c octeon_write_csr(oct, CN6XXX_SLI_PKT_INSTR_SIZE, mask); oct 338 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c mask = octeon_read_csr(oct, CN6XXX_SLI_PKT_INSTR_ENB); oct 339 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c mask |= oct->io_qmask.iq; oct 340 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c octeon_write_csr(oct, CN6XXX_SLI_PKT_INSTR_ENB, mask); oct 342 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c mask = octeon_read_csr(oct, CN6XXX_SLI_PKT_OUT_ENB); oct 343 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c mask |= oct->io_qmask.oq; oct 344 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c octeon_write_csr(oct, CN6XXX_SLI_PKT_OUT_ENB, mask); oct 349 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c void lio_cn6xxx_disable_io_queues(struct octeon_device *oct) oct 356 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c mask = octeon_read_csr(oct, CN6XXX_SLI_PKT_INSTR_ENB); oct 357 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c mask ^= oct->io_qmask.iq; oct 358 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c octeon_write_csr(oct, CN6XXX_SLI_PKT_INSTR_ENB, mask); oct 361 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c mask = (u32)oct->io_qmask.iq; oct 362 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c d32 = octeon_read_csr(oct, CN6XXX_SLI_PORT_IN_RST_IQ); oct 364 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c d32 = octeon_read_csr(oct, CN6XXX_SLI_PORT_IN_RST_IQ); oct 369 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c for (i = 0; i < MAX_OCTEON_INSTR_QUEUES(oct); i++) { oct 370 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c if (!(oct->io_qmask.iq & BIT_ULL(i))) oct 372 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c octeon_write_csr(oct, CN6XXX_SLI_IQ_DOORBELL(i), 0xFFFFFFFF); oct 373 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c d32 = octeon_read_csr(oct, CN6XXX_SLI_IQ_DOORBELL(i)); oct 377 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c mask = octeon_read_csr(oct, CN6XXX_SLI_PKT_OUT_ENB); oct 378 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c mask ^= oct->io_qmask.oq; oct 379 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c octeon_write_csr(oct, CN6XXX_SLI_PKT_OUT_ENB, mask); oct 383 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c mask = (u32)oct->io_qmask.oq; oct 384 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c d32 = octeon_read_csr(oct, CN6XXX_SLI_PORT_IN_RST_OQ); oct 386 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c d32 = octeon_read_csr(oct, CN6XXX_SLI_PORT_IN_RST_OQ); oct 392 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c for (i = 0; i < MAX_OCTEON_OUTPUT_QUEUES(oct); i++) { oct 393 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c if (!(oct->io_qmask.oq & BIT_ULL(i))) oct 395 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c octeon_write_csr(oct, CN6XXX_SLI_OQ_PKTS_CREDIT(i), 0xFFFFFFFF); oct 396 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c d32 = octeon_read_csr(oct, CN6XXX_SLI_OQ_PKTS_CREDIT(i)); oct 398 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c d32 = octeon_read_csr(oct, CN6XXX_SLI_OQ_PKTS_SENT(i)); oct 399 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c octeon_write_csr(oct, CN6XXX_SLI_OQ_PKTS_SENT(i), d32); oct 402 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c d32 = octeon_read_csr(oct, CN6XXX_SLI_PKT_CNT_INT); oct 404 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c octeon_write_csr(oct, CN6XXX_SLI_PKT_CNT_INT, d32); oct 406 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c d32 = octeon_read_csr(oct, CN6XXX_SLI_PKT_TIME_INT); oct 408 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c octeon_write_csr(oct, CN6XXX_SLI_PKT_TIME_INT, d32); oct 412 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c lio_cn6xxx_bar1_idx_setup(struct octeon_device *oct, oct 420 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c bar1 = lio_pci_readq(oct, CN6XXX_BAR1_REG(idx, oct->pcie_port)); oct 421 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c lio_pci_writeq(oct, (bar1 & 0xFFFFFFFEULL), oct 422 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c CN6XXX_BAR1_REG(idx, oct->pcie_port)); oct 423 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c bar1 = lio_pci_readq(oct, CN6XXX_BAR1_REG(idx, oct->pcie_port)); oct 430 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c lio_pci_writeq(oct, (((core_addr >> 22) << 4) | PCI_BAR1_MASK), oct 431 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c CN6XXX_BAR1_REG(idx, oct->pcie_port)); oct 433 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c bar1 = lio_pci_readq(oct, CN6XXX_BAR1_REG(idx, oct->pcie_port)); oct 436 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c void lio_cn6xxx_bar1_idx_write(struct octeon_device *oct, oct 440 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c lio_pci_writeq(oct, mask, CN6XXX_BAR1_REG(idx, oct->pcie_port)); oct 443 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c u32 lio_cn6xxx_bar1_idx_read(struct octeon_device *oct, u32 idx) oct 445 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c return (u32)lio_pci_readq(oct, CN6XXX_BAR1_REG(idx, oct->pcie_port)); oct 470 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c void lio_cn6xxx_enable_interrupt(struct octeon_device *oct, oct 473 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c struct octeon_cn6xxx *cn6xxx = (struct octeon_cn6xxx *)oct->chip; oct 480 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c void lio_cn6xxx_disable_interrupt(struct octeon_device *oct, oct 483 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c struct octeon_cn6xxx *cn6xxx = (struct octeon_cn6xxx *)oct->chip; oct 489 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c static void lio_cn6xxx_get_pcie_qlmport(struct octeon_device *oct) oct 494 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c oct->pcie_port = octeon_read_csr(oct, CN6XXX_SLI_MAC_NUMBER) & 0xff; oct 496 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c dev_dbg(&oct->pci_dev->dev, "Using PCIE Port %d\n", oct->pcie_port); oct 500 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c lio_cn6xxx_process_pcie_error_intr(struct octeon_device *oct, u64 intr64) oct 502 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c dev_err(&oct->pci_dev->dev, "Error Intr: 0x%016llx\n", oct 506 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c static int lio_cn6xxx_process_droq_intr_regs(struct octeon_device *oct) oct 513 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c droq_cnt_enb = octeon_read_csr(oct, CN6XXX_SLI_PKT_CNT_INT_ENB); oct 514 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c droq_cnt_mask = octeon_read_csr(oct, CN6XXX_SLI_PKT_CNT_INT); oct 517 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c droq_time_mask = octeon_read_csr(oct, CN6XXX_SLI_PKT_TIME_INT); oct 518 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c droq_int_enb = octeon_read_csr(oct, CN6XXX_SLI_PKT_TIME_INT_ENB); oct 521 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c droq_mask &= oct->io_qmask.oq; oct 523 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c oct->droq_intr = 0; oct 525 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c for (oq_no = 0; oq_no < MAX_OCTEON_OUTPUT_QUEUES(oct); oq_no++) { oct 529 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c droq = oct->droq[oq_no]; oct 532 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c oct->droq_intr |= BIT_ULL(oq_no); oct 538 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c (struct octeon_cn6xxx *)oct->chip; oct 544 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c value = octeon_read_csr(oct, reg); oct 546 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c octeon_write_csr(oct, reg, value); oct 548 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c value = octeon_read_csr(oct, reg); oct 550 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c octeon_write_csr(oct, reg, value); oct 557 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c droq_time_mask &= oct->io_qmask.oq; oct 558 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c droq_cnt_mask &= oct->io_qmask.oq; oct 562 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c octeon_write_csr(oct, CN6XXX_SLI_PKT_TIME_INT, droq_time_mask); oct 565 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c octeon_write_csr(oct, CN6XXX_SLI_PKT_CNT_INT, droq_cnt_mask); oct 572 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c struct octeon_device *oct = (struct octeon_device *)dev; oct 573 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c struct octeon_cn6xxx *cn6xxx = (struct octeon_cn6xxx *)oct->chip; oct 585 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c oct->int_status = 0; oct 588 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c lio_cn6xxx_process_pcie_error_intr(oct, intr64); oct 591 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c lio_cn6xxx_process_droq_intr_regs(oct); oct 592 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c oct->int_status |= OCT_DEV_INTR_PKT_DATA; oct 596 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c oct->int_status |= OCT_DEV_INTR_DMA0_FORCE; oct 599 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c oct->int_status |= OCT_DEV_INTR_DMA1_FORCE; oct 607 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c void lio_cn6xxx_setup_reg_address(struct octeon_device *oct, oct 611 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c u8 __iomem *bar0_pciaddr = oct->mmio[0].hw_addr; oct 642 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c lio_cn6xxx_get_pcie_qlmport(oct); oct 647 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c bar0_pciaddr + CN6XXX_SLI_INT_ENB64(oct->pcie_port); oct 650 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c int lio_setup_cn66xx_octeon_device(struct octeon_device *oct) oct 652 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c struct octeon_cn6xxx *cn6xxx = (struct octeon_cn6xxx *)oct->chip; oct 654 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c if (octeon_map_pci_barx(oct, 0, 0)) oct 657 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c if (octeon_map_pci_barx(oct, 1, MAX_BAR1_IOREMAP_SIZE)) { oct 658 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c dev_err(&oct->pci_dev->dev, "%s CN66XX BAR1 map failed\n", oct 660 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c octeon_unmap_pci_barx(oct, 0); oct 666 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c oct->fn_list.setup_iq_regs = lio_cn66xx_setup_iq_regs; oct 667 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c oct->fn_list.setup_oq_regs = lio_cn6xxx_setup_oq_regs; oct 669 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c oct->fn_list.soft_reset = lio_cn6xxx_soft_reset; oct 670 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c oct->fn_list.setup_device_regs = lio_cn6xxx_setup_device_regs; oct 671 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c oct->fn_list.update_iq_read_idx = lio_cn6xxx_update_read_index; oct 673 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c oct->fn_list.bar1_idx_setup = lio_cn6xxx_bar1_idx_setup; oct 674 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c oct->fn_list.bar1_idx_write = lio_cn6xxx_bar1_idx_write; oct 675 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c oct->fn_list.bar1_idx_read = lio_cn6xxx_bar1_idx_read; oct 677 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c oct->fn_list.process_interrupt_regs = lio_cn6xxx_process_interrupt_regs; oct 678 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c oct->fn_list.enable_interrupt = lio_cn6xxx_enable_interrupt; oct 679 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c oct->fn_list.disable_interrupt = lio_cn6xxx_disable_interrupt; oct 681 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c oct->fn_list.enable_io_queues = lio_cn6xxx_enable_io_queues; oct 682 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c oct->fn_list.disable_io_queues = lio_cn6xxx_disable_io_queues; oct 684 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c lio_cn6xxx_setup_reg_address(oct, oct->chip, &oct->reg_list); oct 687 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c oct_get_config_info(oct, LIO_210SV); oct 689 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c dev_err(&oct->pci_dev->dev, "%s No Config found for CN66XX\n", oct 691 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c octeon_unmap_pci_barx(oct, 0); oct 692 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c octeon_unmap_pci_barx(oct, 1); oct 696 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c oct->coproc_clock_rate = 1000000ULL * lio_cn6xxx_coprocessor_clock(oct); oct 701 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c int lio_validate_cn6xxx_config_info(struct octeon_device *oct, oct 705 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c dev_err(&oct->pci_dev->dev, "%s: Num IQ (%d) exceeds Max (%d)\n", oct 712 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c dev_err(&oct->pci_dev->dev, "%s: Num OQ (%d) exceeds Max (%d)\n", oct 720 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c dev_err(&oct->pci_dev->dev, "%s: Invalid instr type for IQ\n", oct 725 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c dev_err(&oct->pci_dev->dev, "%s: Invalid parameter for OQ\n", oct 731 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c dev_err(&oct->pci_dev->dev, "%s: No Time Interrupt for OQ\n", oct 68 drivers/net/ethernet/cavium/liquidio/cn66xx_device.h int lio_cn6xxx_soft_reset(struct octeon_device *oct); oct 69 drivers/net/ethernet/cavium/liquidio/cn66xx_device.h void lio_cn6xxx_enable_error_reporting(struct octeon_device *oct); oct 70 drivers/net/ethernet/cavium/liquidio/cn66xx_device.h void lio_cn6xxx_setup_pcie_mps(struct octeon_device *oct, oct 72 drivers/net/ethernet/cavium/liquidio/cn66xx_device.h void lio_cn6xxx_setup_pcie_mrrs(struct octeon_device *oct, oct 74 drivers/net/ethernet/cavium/liquidio/cn66xx_device.h void lio_cn6xxx_setup_global_input_regs(struct octeon_device *oct); oct 75 drivers/net/ethernet/cavium/liquidio/cn66xx_device.h void lio_cn6xxx_setup_global_output_regs(struct octeon_device *oct); oct 76 drivers/net/ethernet/cavium/liquidio/cn66xx_device.h void lio_cn6xxx_setup_iq_regs(struct octeon_device *oct, u32 iq_no); oct 77 drivers/net/ethernet/cavium/liquidio/cn66xx_device.h void lio_cn6xxx_setup_oq_regs(struct octeon_device *oct, u32 oq_no); oct 78 drivers/net/ethernet/cavium/liquidio/cn66xx_device.h int lio_cn6xxx_enable_io_queues(struct octeon_device *oct); oct 79 drivers/net/ethernet/cavium/liquidio/cn66xx_device.h void lio_cn6xxx_disable_io_queues(struct octeon_device *oct); oct 81 drivers/net/ethernet/cavium/liquidio/cn66xx_device.h void lio_cn6xxx_bar1_idx_setup(struct octeon_device *oct, u64 core_addr, oct 83 drivers/net/ethernet/cavium/liquidio/cn66xx_device.h void lio_cn6xxx_bar1_idx_write(struct octeon_device *oct, u32 idx, u32 mask); oct 84 drivers/net/ethernet/cavium/liquidio/cn66xx_device.h u32 lio_cn6xxx_bar1_idx_read(struct octeon_device *oct, u32 idx); oct 87 drivers/net/ethernet/cavium/liquidio/cn66xx_device.h void lio_cn6xxx_enable_interrupt(struct octeon_device *oct, u8 unused); oct 88 drivers/net/ethernet/cavium/liquidio/cn66xx_device.h void lio_cn6xxx_disable_interrupt(struct octeon_device *oct, u8 unused); oct 89 drivers/net/ethernet/cavium/liquidio/cn66xx_device.h void cn6xxx_get_pcie_qlmport(struct octeon_device *oct); oct 90 drivers/net/ethernet/cavium/liquidio/cn66xx_device.h void lio_cn6xxx_setup_reg_address(struct octeon_device *oct, void *chip, oct 92 drivers/net/ethernet/cavium/liquidio/cn66xx_device.h u32 lio_cn6xxx_coprocessor_clock(struct octeon_device *oct); oct 93 drivers/net/ethernet/cavium/liquidio/cn66xx_device.h u32 lio_cn6xxx_get_oq_ticks(struct octeon_device *oct, u32 time_intr_in_us); oct 94 drivers/net/ethernet/cavium/liquidio/cn66xx_device.h int lio_setup_cn66xx_octeon_device(struct octeon_device *oct); oct 95 drivers/net/ethernet/cavium/liquidio/cn66xx_device.h int lio_validate_cn6xxx_config_info(struct octeon_device *oct, oct 30 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c static void lio_cn68xx_set_dpi_regs(struct octeon_device *oct) oct 35 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c lio_pci_writeq(oct, CN6XXX_DPI_DMA_CTL_MASK, CN6XXX_DPI_DMA_CONTROL); oct 36 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c dev_dbg(&oct->pci_dev->dev, "DPI_DMA_CONTROL: 0x%016llx\n", oct 37 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c lio_pci_readq(oct, CN6XXX_DPI_DMA_CONTROL)); oct 44 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c lio_pci_writeq(oct, 0, CN6XXX_DPI_DMA_ENG_ENB(i)); oct 45 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c lio_pci_writeq(oct, fifo_sizes[i], CN6XXX_DPI_DMA_ENG_BUF(i)); oct 46 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c dev_dbg(&oct->pci_dev->dev, "DPI_ENG_BUF%d: 0x%016llx\n", i, oct 47 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c lio_pci_readq(oct, CN6XXX_DPI_DMA_ENG_BUF(i))); oct 54 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c lio_pci_writeq(oct, 1, CN6XXX_DPI_CTL); oct 55 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c dev_dbg(&oct->pci_dev->dev, "DPI_CTL: 0x%016llx\n", oct 56 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c lio_pci_readq(oct, CN6XXX_DPI_CTL)); oct 59 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c static int lio_cn68xx_soft_reset(struct octeon_device *oct) oct 61 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c lio_cn6xxx_soft_reset(oct); oct 62 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c lio_cn68xx_set_dpi_regs(oct); oct 67 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c static void lio_cn68xx_setup_pkt_ctl_regs(struct octeon_device *oct) oct 69 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c struct octeon_cn6xxx *cn68xx = (struct octeon_cn6xxx *)oct->chip; oct 72 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c pktctl = octeon_read_csr64(oct, CN6XXX_SLI_PKT_CTL); oct 75 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c max_oqs = CFG_GET_OQ_MAX_Q(CHIP_CONF(oct, cn6xxx)); oct 76 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c tx_pipe = octeon_read_csr64(oct, CN68XX_SLI_TX_PIPE); oct 79 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c octeon_write_csr64(oct, CN68XX_SLI_TX_PIPE, tx_pipe); oct 86 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c octeon_write_csr64(oct, CN6XXX_SLI_PKT_CTL, pktctl); oct 89 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c static int lio_cn68xx_setup_device_regs(struct octeon_device *oct) oct 91 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c lio_cn6xxx_setup_pcie_mps(oct, PCIE_MPS_DEFAULT); oct 92 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c lio_cn6xxx_setup_pcie_mrrs(oct, PCIE_MRRS_256B); oct 93 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c lio_cn6xxx_enable_error_reporting(oct); oct 95 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c lio_cn6xxx_setup_global_input_regs(oct); oct 96 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c lio_cn68xx_setup_pkt_ctl_regs(oct); oct 97 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c lio_cn6xxx_setup_global_output_regs(oct); oct 102 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c octeon_write_csr64(oct, CN6XXX_SLI_WINDOW_CTL, 0x200000ULL); oct 107 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c static inline void lio_cn68xx_vendor_message_fix(struct octeon_device *oct) oct 112 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c pci_read_config_dword(oct->pci_dev, CN6XXX_PCIE_FLTMSK, &val); oct 114 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c pci_write_config_dword(oct->pci_dev, CN6XXX_PCIE_FLTMSK, val); oct 117 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c static int lio_is_210nv(struct octeon_device *oct) oct 119 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c u64 mio_qlm4_cfg = lio_pci_readq(oct, CN6XXX_MIO_QLM4_CFG); oct 124 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c int lio_setup_cn68xx_octeon_device(struct octeon_device *oct) oct 126 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c struct octeon_cn6xxx *cn68xx = (struct octeon_cn6xxx *)oct->chip; oct 129 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c if (octeon_map_pci_barx(oct, 0, 0)) oct 132 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c if (octeon_map_pci_barx(oct, 1, MAX_BAR1_IOREMAP_SIZE)) { oct 133 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c dev_err(&oct->pci_dev->dev, "%s CN68XX BAR1 map failed\n", oct 135 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c octeon_unmap_pci_barx(oct, 0); oct 141 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c oct->fn_list.setup_iq_regs = lio_cn6xxx_setup_iq_regs; oct 142 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c oct->fn_list.setup_oq_regs = lio_cn6xxx_setup_oq_regs; oct 144 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c oct->fn_list.process_interrupt_regs = lio_cn6xxx_process_interrupt_regs; oct 145 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c oct->fn_list.soft_reset = lio_cn68xx_soft_reset; oct 146 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c oct->fn_list.setup_device_regs = lio_cn68xx_setup_device_regs; oct 147 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c oct->fn_list.update_iq_read_idx = lio_cn6xxx_update_read_index; oct 149 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c oct->fn_list.bar1_idx_setup = lio_cn6xxx_bar1_idx_setup; oct 150 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c oct->fn_list.bar1_idx_write = lio_cn6xxx_bar1_idx_write; oct 151 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c oct->fn_list.bar1_idx_read = lio_cn6xxx_bar1_idx_read; oct 153 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c oct->fn_list.enable_interrupt = lio_cn6xxx_enable_interrupt; oct 154 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c oct->fn_list.disable_interrupt = lio_cn6xxx_disable_interrupt; oct 156 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c oct->fn_list.enable_io_queues = lio_cn6xxx_enable_io_queues; oct 157 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c oct->fn_list.disable_io_queues = lio_cn6xxx_disable_io_queues; oct 159 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c lio_cn6xxx_setup_reg_address(oct, oct->chip, &oct->reg_list); oct 162 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c if (lio_is_210nv(oct)) oct 166 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c oct_get_config_info(oct, card_type); oct 168 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c dev_err(&oct->pci_dev->dev, "%s No Config found for CN68XX %s\n", oct 172 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c octeon_unmap_pci_barx(oct, 0); oct 173 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c octeon_unmap_pci_barx(oct, 1); oct 177 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c oct->coproc_clock_rate = 1000000ULL * lio_cn6xxx_coprocessor_clock(oct); oct 179 drivers/net/ethernet/cavium/liquidio/cn68xx_device.c lio_cn68xx_vendor_message_fix(oct); oct 25 drivers/net/ethernet/cavium/liquidio/cn68xx_device.h int lio_setup_cn68xx_octeon_device(struct octeon_device *oct); oct 79 drivers/net/ethernet/cavium/liquidio/lio_core.c int lio_setup_glists(struct octeon_device *oct, struct lio *lio, int num_iqs) oct 114 drivers/net/ethernet/cavium/liquidio/lio_core.c int numa_node = dev_to_node(&oct->pci_dev->dev); oct 121 drivers/net/ethernet/cavium/liquidio/lio_core.c lio_dma_alloc(oct, oct 159 drivers/net/ethernet/cavium/liquidio/lio_core.c struct octeon_device *oct = lio->oct_dev; oct 174 drivers/net/ethernet/cavium/liquidio/lio_core.c dev_err(&oct->pci_dev->dev, "Feature change failed in core (ret: 0x%x)\n", oct 254 drivers/net/ethernet/cavium/liquidio/lio_core.c struct octeon_device *oct = lio->oct_dev; oct 295 drivers/net/ethernet/cavium/liquidio/lio_core.c dev_info(&oct->pci_dev->dev, "%s LRO Enabled\n", netdev->name); oct 299 drivers/net/ethernet/cavium/liquidio/lio_core.c dev_info(&oct->pci_dev->dev, "%s LRO Disabled\n", oct 304 drivers/net/ethernet/cavium/liquidio/lio_core.c dev_info(&oct->pci_dev->dev, "%s Firmware debug enabled\n", oct 309 drivers/net/ethernet/cavium/liquidio/lio_core.c dev_info(&oct->pci_dev->dev, "%s Firmware debug disabled\n", oct 315 drivers/net/ethernet/cavium/liquidio/lio_core.c dev_info(&oct->pci_dev->dev, oct 318 drivers/net/ethernet/cavium/liquidio/lio_core.c dev_info(&oct->pci_dev->dev, oct 323 drivers/net/ethernet/cavium/liquidio/lio_core.c dev_info(&oct->pci_dev->dev, "%s VLAN filter %d added\n", oct 328 drivers/net/ethernet/cavium/liquidio/lio_core.c dev_info(&oct->pci_dev->dev, "%s VLAN filter %d removed\n", oct 333 drivers/net/ethernet/cavium/liquidio/lio_core.c dev_info(&oct->pci_dev->dev, "%s settings changed\n", oct 392 drivers/net/ethernet/cavium/liquidio/lio_core.c dev_err(&oct->pci_dev->dev, "%s Unknown cmd %d\n", __func__, oct 397 drivers/net/ethernet/cavium/liquidio/lio_core.c void octeon_pf_changed_vf_macaddr(struct octeon_device *oct, u8 *mac) oct 405 drivers/net/ethernet/cavium/liquidio/lio_core.c netdev = oct->props[0].netdev; oct 420 drivers/net/ethernet/cavium/liquidio/lio_core.c dev_info(&oct->pci_dev->dev, oct 428 drivers/net/ethernet/cavium/liquidio/lio_core.c void octeon_schedule_rxq_oom_work(struct octeon_device *oct, oct 431 drivers/net/ethernet/cavium/liquidio/lio_core.c struct net_device *netdev = oct->props[0].netdev; oct 443 drivers/net/ethernet/cavium/liquidio/lio_core.c struct octeon_device *oct = lio->oct_dev; oct 445 drivers/net/ethernet/cavium/liquidio/lio_core.c struct octeon_droq *droq = oct->droq[q_no]; oct 451 drivers/net/ethernet/cavium/liquidio/lio_core.c octeon_schedule_rxq_oom_work(oct, droq); oct 457 drivers/net/ethernet/cavium/liquidio/lio_core.c struct octeon_device *oct = lio->oct_dev; oct 461 drivers/net/ethernet/cavium/liquidio/lio_core.c for (q = 0; q < oct->num_oqs; q++) { oct 467 drivers/net/ethernet/cavium/liquidio/lio_core.c dev_err(&oct->pci_dev->dev, "unable to create cavium rxq oom status wq\n"); oct 483 drivers/net/ethernet/cavium/liquidio/lio_core.c struct octeon_device *oct = lio->oct_dev; oct 487 drivers/net/ethernet/cavium/liquidio/lio_core.c for (q_no = 0; q_no < oct->num_oqs; q_no++) { oct 499 drivers/net/ethernet/cavium/liquidio/lio_core.c static void lio_update_txq_status(struct octeon_device *oct, int iq_num) oct 501 drivers/net/ethernet/cavium/liquidio/lio_core.c struct octeon_instr_queue *iq = oct->instr_queue[iq_num]; oct 505 drivers/net/ethernet/cavium/liquidio/lio_core.c netdev = oct->props[iq->ifidx].netdev; oct 516 drivers/net/ethernet/cavium/liquidio/lio_core.c (!octnet_iq_is_full(oct, iq_num))) { oct 531 drivers/net/ethernet/cavium/liquidio/lio_core.c static int octeon_setup_droq(struct octeon_device *oct, int q_no, int num_descs, oct 536 drivers/net/ethernet/cavium/liquidio/lio_core.c dev_dbg(&oct->pci_dev->dev, "Creating Droq: %d\n", q_no); oct 538 drivers/net/ethernet/cavium/liquidio/lio_core.c ret_val = octeon_create_droq(oct, q_no, num_descs, desc_size, app_ctx); oct 543 drivers/net/ethernet/cavium/liquidio/lio_core.c dev_dbg(&oct->pci_dev->dev, "Using default droq %d\n", q_no); oct 548 drivers/net/ethernet/cavium/liquidio/lio_core.c octeon_set_droq_pkt_op(oct, q_no, 1); oct 553 drivers/net/ethernet/cavium/liquidio/lio_core.c writel(oct->droq[q_no]->max_count, oct->droq[q_no]->pkts_credit_reg); oct 586 drivers/net/ethernet/cavium/liquidio/lio_core.c struct octeon_device *oct = lio->oct_dev; oct 627 drivers/net/ethernet/cavium/liquidio/lio_core.c if (oct->ptp_enable) { oct 719 drivers/net/ethernet/cavium/liquidio/lio_core.c struct octeon_device *oct; oct 723 drivers/net/ethernet/cavium/liquidio/lio_core.c oct = droq->oct_dev; oct 725 drivers/net/ethernet/cavium/liquidio/lio_core.c if (OCTEON_CN23XX_PF(oct) || OCTEON_CN23XX_VF(oct) || oct 747 drivers/net/ethernet/cavium/liquidio/lio_core.c struct octeon_device *oct; oct 753 drivers/net/ethernet/cavium/liquidio/lio_core.c oct = droq->oct_dev; oct 757 drivers/net/ethernet/cavium/liquidio/lio_core.c work_done = octeon_droq_process_poll_pkts(oct, droq, budget); oct 760 drivers/net/ethernet/cavium/liquidio/lio_core.c iq = oct->instr_queue[iq_no]; oct 767 drivers/net/ethernet/cavium/liquidio/lio_core.c tx_done = octeon_flush_iq(oct, iq, budget); oct 774 drivers/net/ethernet/cavium/liquidio/lio_core.c lio_update_txq_status(oct, iq_no); oct 776 drivers/net/ethernet/cavium/liquidio/lio_core.c dev_err(&oct->pci_dev->dev, "%s: iq (%d) num invalid\n", oct 908 drivers/net/ethernet/cavium/liquidio/lio_core.c struct octeon_device *oct = droq->oct_dev; oct 910 drivers/net/ethernet/cavium/liquidio/lio_core.c (struct octeon_device_priv *)oct->priv; oct 916 drivers/net/ethernet/cavium/liquidio/lio_core.c if (OCTEON_CN23XX_VF(oct)) oct 917 drivers/net/ethernet/cavium/liquidio/lio_core.c dev_err(&oct->pci_dev->dev, oct 934 drivers/net/ethernet/cavium/liquidio/lio_core.c struct octeon_device *oct = ioq_vector->oct_dev; oct 935 drivers/net/ethernet/cavium/liquidio/lio_core.c struct octeon_droq *droq = oct->droq[ioq_vector->droq_index]; oct 938 drivers/net/ethernet/cavium/liquidio/lio_core.c ret = oct->fn_list.msix_interrupt_handler(ioq_vector); oct 950 drivers/net/ethernet/cavium/liquidio/lio_core.c static void liquidio_schedule_droq_pkt_handlers(struct octeon_device *oct) oct 953 drivers/net/ethernet/cavium/liquidio/lio_core.c (struct octeon_device_priv *)oct->priv; oct 957 drivers/net/ethernet/cavium/liquidio/lio_core.c if (oct->int_status & OCT_DEV_INTR_PKT_DATA) { oct 958 drivers/net/ethernet/cavium/liquidio/lio_core.c for (oq_no = 0; oq_no < MAX_OCTEON_OUTPUT_QUEUES(oct); oct 960 drivers/net/ethernet/cavium/liquidio/lio_core.c if (!(oct->droq_intr & BIT_ULL(oq_no))) oct 963 drivers/net/ethernet/cavium/liquidio/lio_core.c droq = oct->droq[oq_no]; oct 984 drivers/net/ethernet/cavium/liquidio/lio_core.c struct octeon_device *oct = (struct octeon_device *)dev; oct 988 drivers/net/ethernet/cavium/liquidio/lio_core.c oct->fn_list.disable_interrupt(oct, OCTEON_ALL_INTR); oct 990 drivers/net/ethernet/cavium/liquidio/lio_core.c ret = oct->fn_list.process_interrupt_regs(oct); oct 993 drivers/net/ethernet/cavium/liquidio/lio_core.c liquidio_schedule_droq_pkt_handlers(oct); oct 996 drivers/net/ethernet/cavium/liquidio/lio_core.c if (!(atomic_read(&oct->status) == OCT_DEV_IN_RESET)) oct 997 drivers/net/ethernet/cavium/liquidio/lio_core.c oct->fn_list.enable_interrupt(oct, OCTEON_ALL_INTR); oct 1008 drivers/net/ethernet/cavium/liquidio/lio_core.c int octeon_setup_interrupt(struct octeon_device *oct, u32 num_ioqs) oct 1018 drivers/net/ethernet/cavium/liquidio/lio_core.c if (oct->msix_on) { oct 1019 drivers/net/ethernet/cavium/liquidio/lio_core.c oct->num_msix_irqs = num_ioqs; oct 1020 drivers/net/ethernet/cavium/liquidio/lio_core.c if (OCTEON_CN23XX_PF(oct)) { oct 1026 drivers/net/ethernet/cavium/liquidio/lio_core.c oct->num_msix_irqs += 1; oct 1027 drivers/net/ethernet/cavium/liquidio/lio_core.c } else if (OCTEON_CN23XX_VF(oct)) { oct 1032 drivers/net/ethernet/cavium/liquidio/lio_core.c oct->irq_name_storage = oct 1034 drivers/net/ethernet/cavium/liquidio/lio_core.c if (!oct->irq_name_storage) { oct 1035 drivers/net/ethernet/cavium/liquidio/lio_core.c dev_err(&oct->pci_dev->dev, "Irq name storage alloc failed...\n"); oct 1039 drivers/net/ethernet/cavium/liquidio/lio_core.c queue_irq_names = oct->irq_name_storage; oct 1041 drivers/net/ethernet/cavium/liquidio/lio_core.c if (OCTEON_CN23XX_PF(oct)) oct 1045 drivers/net/ethernet/cavium/liquidio/lio_core.c oct->msix_entries = kcalloc(oct->num_msix_irqs, oct 1048 drivers/net/ethernet/cavium/liquidio/lio_core.c if (!oct->msix_entries) { oct 1049 drivers/net/ethernet/cavium/liquidio/lio_core.c dev_err(&oct->pci_dev->dev, "Memory Alloc failed...\n"); oct 1050 drivers/net/ethernet/cavium/liquidio/lio_core.c kfree(oct->irq_name_storage); oct 1051 drivers/net/ethernet/cavium/liquidio/lio_core.c oct->irq_name_storage = NULL; oct 1055 drivers/net/ethernet/cavium/liquidio/lio_core.c msix_entries = (struct msix_entry *)oct->msix_entries; oct 1060 drivers/net/ethernet/cavium/liquidio/lio_core.c if (OCTEON_CN23XX_PF(oct)) { oct 1061 drivers/net/ethernet/cavium/liquidio/lio_core.c for (i = 0; i < oct->num_msix_irqs - 1; i++) oct 1063 drivers/net/ethernet/cavium/liquidio/lio_core.c oct->sriov_info.pf_srn + i; oct 1065 drivers/net/ethernet/cavium/liquidio/lio_core.c msix_entries[oct->num_msix_irqs - 1].entry = oct 1066 drivers/net/ethernet/cavium/liquidio/lio_core.c oct->sriov_info.trs; oct 1067 drivers/net/ethernet/cavium/liquidio/lio_core.c } else if (OCTEON_CN23XX_VF(oct)) { oct 1068 drivers/net/ethernet/cavium/liquidio/lio_core.c for (i = 0; i < oct->num_msix_irqs; i++) oct 1072 drivers/net/ethernet/cavium/liquidio/lio_core.c oct->pci_dev, msix_entries, oct 1073 drivers/net/ethernet/cavium/liquidio/lio_core.c oct->num_msix_irqs, oct 1074 drivers/net/ethernet/cavium/liquidio/lio_core.c oct->num_msix_irqs); oct 1076 drivers/net/ethernet/cavium/liquidio/lio_core.c dev_err(&oct->pci_dev->dev, "unable to Allocate MSI-X interrupts\n"); oct 1077 drivers/net/ethernet/cavium/liquidio/lio_core.c kfree(oct->msix_entries); oct 1078 drivers/net/ethernet/cavium/liquidio/lio_core.c oct->msix_entries = NULL; oct 1079 drivers/net/ethernet/cavium/liquidio/lio_core.c kfree(oct->irq_name_storage); oct 1080 drivers/net/ethernet/cavium/liquidio/lio_core.c oct->irq_name_storage = NULL; oct 1084 drivers/net/ethernet/cavium/liquidio/lio_core.c dev_dbg(&oct->pci_dev->dev, "OCTEON: Enough MSI-X interrupts are allocated...\n"); oct 1086 drivers/net/ethernet/cavium/liquidio/lio_core.c num_ioq_vectors = oct->num_msix_irqs; oct 1088 drivers/net/ethernet/cavium/liquidio/lio_core.c if (OCTEON_CN23XX_PF(oct)) { oct 1092 drivers/net/ethernet/cavium/liquidio/lio_core.c "LiquidIO%u-pf%u-aux", oct->octeon_id, oct 1093 drivers/net/ethernet/cavium/liquidio/lio_core.c oct->pf_num); oct 1097 drivers/net/ethernet/cavium/liquidio/lio_core.c aux_irq_name, oct); oct 1099 drivers/net/ethernet/cavium/liquidio/lio_core.c dev_err(&oct->pci_dev->dev, oct 1102 drivers/net/ethernet/cavium/liquidio/lio_core.c pci_disable_msix(oct->pci_dev); oct 1103 drivers/net/ethernet/cavium/liquidio/lio_core.c kfree(oct->msix_entries); oct 1104 drivers/net/ethernet/cavium/liquidio/lio_core.c kfree(oct->irq_name_storage); oct 1105 drivers/net/ethernet/cavium/liquidio/lio_core.c oct->irq_name_storage = NULL; oct 1106 drivers/net/ethernet/cavium/liquidio/lio_core.c oct->msix_entries = NULL; oct 1111 drivers/net/ethernet/cavium/liquidio/lio_core.c if (OCTEON_CN23XX_PF(oct)) oct 1114 drivers/net/ethernet/cavium/liquidio/lio_core.c oct->octeon_id, oct->pf_num, i); oct 1116 drivers/net/ethernet/cavium/liquidio/lio_core.c if (OCTEON_CN23XX_VF(oct)) oct 1119 drivers/net/ethernet/cavium/liquidio/lio_core.c oct->octeon_id, oct->vf_num, i); oct 1124 drivers/net/ethernet/cavium/liquidio/lio_core.c &oct->ioq_vector[i]); oct 1127 drivers/net/ethernet/cavium/liquidio/lio_core.c dev_err(&oct->pci_dev->dev, oct 1132 drivers/net/ethernet/cavium/liquidio/lio_core.c oct); oct 1141 drivers/net/ethernet/cavium/liquidio/lio_core.c &oct->ioq_vector[i]); oct 1143 drivers/net/ethernet/cavium/liquidio/lio_core.c pci_disable_msix(oct->pci_dev); oct 1144 drivers/net/ethernet/cavium/liquidio/lio_core.c kfree(oct->msix_entries); oct 1145 drivers/net/ethernet/cavium/liquidio/lio_core.c kfree(oct->irq_name_storage); oct 1146 drivers/net/ethernet/cavium/liquidio/lio_core.c oct->irq_name_storage = NULL; oct 1147 drivers/net/ethernet/cavium/liquidio/lio_core.c oct->msix_entries = NULL; oct 1150 drivers/net/ethernet/cavium/liquidio/lio_core.c oct->ioq_vector[i].vector = msix_entries[i].vector; oct 1153 drivers/net/ethernet/cavium/liquidio/lio_core.c &oct->ioq_vector[i].affinity_mask oct 1156 drivers/net/ethernet/cavium/liquidio/lio_core.c dev_dbg(&oct->pci_dev->dev, "OCTEON[%d]: MSI-X enabled\n", oct 1157 drivers/net/ethernet/cavium/liquidio/lio_core.c oct->octeon_id); oct 1159 drivers/net/ethernet/cavium/liquidio/lio_core.c err = pci_enable_msi(oct->pci_dev); oct 1161 drivers/net/ethernet/cavium/liquidio/lio_core.c dev_warn(&oct->pci_dev->dev, "Reverting to legacy interrupts. Error: %d\n", oct 1164 drivers/net/ethernet/cavium/liquidio/lio_core.c oct->flags |= LIO_FLAG_MSI_ENABLED; oct 1167 drivers/net/ethernet/cavium/liquidio/lio_core.c oct->irq_name_storage = kcalloc(1, INTRNAMSIZ, GFP_KERNEL); oct 1168 drivers/net/ethernet/cavium/liquidio/lio_core.c if (!oct->irq_name_storage) oct 1171 drivers/net/ethernet/cavium/liquidio/lio_core.c queue_irq_names = oct->irq_name_storage; oct 1173 drivers/net/ethernet/cavium/liquidio/lio_core.c if (OCTEON_CN23XX_PF(oct)) oct 1176 drivers/net/ethernet/cavium/liquidio/lio_core.c oct->octeon_id, oct->pf_num, 0); oct 1178 drivers/net/ethernet/cavium/liquidio/lio_core.c if (OCTEON_CN23XX_VF(oct)) oct 1181 drivers/net/ethernet/cavium/liquidio/lio_core.c oct->octeon_id, oct->vf_num, 0); oct 1183 drivers/net/ethernet/cavium/liquidio/lio_core.c irqret = request_irq(oct->pci_dev->irq, oct 1186 drivers/net/ethernet/cavium/liquidio/lio_core.c &queue_irq_names[IRQ_NAME_OFF(0)], oct); oct 1188 drivers/net/ethernet/cavium/liquidio/lio_core.c if (oct->flags & LIO_FLAG_MSI_ENABLED) oct 1189 drivers/net/ethernet/cavium/liquidio/lio_core.c pci_disable_msi(oct->pci_dev); oct 1190 drivers/net/ethernet/cavium/liquidio/lio_core.c dev_err(&oct->pci_dev->dev, "Request IRQ failed with code: %d\n", oct 1192 drivers/net/ethernet/cavium/liquidio/lio_core.c kfree(oct->irq_name_storage); oct 1193 drivers/net/ethernet/cavium/liquidio/lio_core.c oct->irq_name_storage = NULL; oct 1207 drivers/net/ethernet/cavium/liquidio/lio_core.c struct octeon_device *oct = lio->oct_dev; oct 1213 drivers/net/ethernet/cavium/liquidio/lio_core.c octeon_alloc_soft_command(oct, OCTNET_CMD_SIZE, 16, 0); oct 1233 drivers/net/ethernet/cavium/liquidio/lio_core.c octeon_prepare_soft_command(oct, sc, OPCODE_NIC, oct 1236 drivers/net/ethernet/cavium/liquidio/lio_core.c ret = octeon_send_soft_command(oct, sc); oct 1239 drivers/net/ethernet/cavium/liquidio/lio_core.c octeon_free_soft_command(oct, sc); oct 1245 drivers/net/ethernet/cavium/liquidio/lio_core.c ret = wait_for_sc_completion_timeout(oct, sc, 0); oct 1261 drivers/net/ethernet/cavium/liquidio/lio_core.c int lio_wait_for_clean_oq(struct octeon_device *oct) oct 1269 drivers/net/ethernet/cavium/liquidio/lio_core.c for (idx = 0; idx < MAX_OCTEON_OUTPUT_QUEUES(oct); idx++) { oct 1270 drivers/net/ethernet/cavium/liquidio/lio_core.c if (!(oct->io_qmask.oq & BIT_ULL(idx))) oct 1273 drivers/net/ethernet/cavium/liquidio/lio_core.c atomic_read(&oct->droq[idx]->pkts_pending); oct 1516 drivers/net/ethernet/cavium/liquidio/lio_core.c struct octeon_device *oct = lio->oct_dev; oct 1523 drivers/net/ethernet/cavium/liquidio/lio_core.c if (oct->speed_setting == speed) oct 1526 drivers/net/ethernet/cavium/liquidio/lio_core.c if (!OCTEON_CN23XX_PF(oct)) { oct 1527 drivers/net/ethernet/cavium/liquidio/lio_core.c dev_err(&oct->pci_dev->dev, "%s: SET SPEED only for PF\n", oct 1532 drivers/net/ethernet/cavium/liquidio/lio_core.c sc = octeon_alloc_soft_command(oct, OCTNET_CMD_SIZE, oct 1553 drivers/net/ethernet/cavium/liquidio/lio_core.c octeon_prepare_soft_command(oct, sc, OPCODE_NIC, oct 1556 drivers/net/ethernet/cavium/liquidio/lio_core.c retval = octeon_send_soft_command(oct, sc); oct 1558 drivers/net/ethernet/cavium/liquidio/lio_core.c dev_info(&oct->pci_dev->dev, "Failed to send soft command\n"); oct 1559 drivers/net/ethernet/cavium/liquidio/lio_core.c octeon_free_soft_command(oct, sc); oct 1563 drivers/net/ethernet/cavium/liquidio/lio_core.c retval = wait_for_sc_completion_timeout(oct, sc, 0); oct 1570 drivers/net/ethernet/cavium/liquidio/lio_core.c dev_err(&oct->pci_dev->dev, "%s failed, retval=%d\n", oct 1579 drivers/net/ethernet/cavium/liquidio/lio_core.c dev_err(&oct->pci_dev->dev, oct 1584 drivers/net/ethernet/cavium/liquidio/lio_core.c oct->speed_setting = var; oct 1593 drivers/net/ethernet/cavium/liquidio/lio_core.c struct octeon_device *oct = lio->oct_dev; oct 1599 drivers/net/ethernet/cavium/liquidio/lio_core.c sc = octeon_alloc_soft_command(oct, OCTNET_CMD_SIZE, oct 1619 drivers/net/ethernet/cavium/liquidio/lio_core.c octeon_prepare_soft_command(oct, sc, OPCODE_NIC, oct 1622 drivers/net/ethernet/cavium/liquidio/lio_core.c retval = octeon_send_soft_command(oct, sc); oct 1624 drivers/net/ethernet/cavium/liquidio/lio_core.c dev_info(&oct->pci_dev->dev, "Failed to send soft command\n"); oct 1625 drivers/net/ethernet/cavium/liquidio/lio_core.c octeon_free_soft_command(oct, sc); oct 1628 drivers/net/ethernet/cavium/liquidio/lio_core.c retval = wait_for_sc_completion_timeout(oct, sc, 0); oct 1634 drivers/net/ethernet/cavium/liquidio/lio_core.c dev_err(&oct->pci_dev->dev, oct 1641 drivers/net/ethernet/cavium/liquidio/lio_core.c oct->speed_setting = var; oct 1646 drivers/net/ethernet/cavium/liquidio/lio_core.c if (oct->subsystem_id == oct 1648 drivers/net/ethernet/cavium/liquidio/lio_core.c oct->subsystem_id == oct 1650 drivers/net/ethernet/cavium/liquidio/lio_core.c oct->no_speed_setting = 1; oct 1651 drivers/net/ethernet/cavium/liquidio/lio_core.c oct->speed_setting = 25; oct 1653 drivers/net/ethernet/cavium/liquidio/lio_core.c oct->speed_setting = 10; oct 1668 drivers/net/ethernet/cavium/liquidio/lio_core.c struct octeon_device *oct; oct 1673 drivers/net/ethernet/cavium/liquidio/lio_core.c oct = lio->oct_dev; oct 1675 drivers/net/ethernet/cavium/liquidio/lio_core.c if (oct->props[lio->ifidx].fec == on_off) oct 1678 drivers/net/ethernet/cavium/liquidio/lio_core.c if (!OCTEON_CN23XX_PF(oct)) { oct 1679 drivers/net/ethernet/cavium/liquidio/lio_core.c dev_err(&oct->pci_dev->dev, "%s: SET FEC only for PF\n", oct 1684 drivers/net/ethernet/cavium/liquidio/lio_core.c if (oct->speed_boot != 25) { oct 1685 drivers/net/ethernet/cavium/liquidio/lio_core.c dev_err(&oct->pci_dev->dev, oct 1690 drivers/net/ethernet/cavium/liquidio/lio_core.c sc = octeon_alloc_soft_command(oct, OCTNET_CMD_SIZE, oct 1693 drivers/net/ethernet/cavium/liquidio/lio_core.c dev_err(&oct->pci_dev->dev, oct 1714 drivers/net/ethernet/cavium/liquidio/lio_core.c octeon_prepare_soft_command(oct, sc, OPCODE_NIC, oct 1717 drivers/net/ethernet/cavium/liquidio/lio_core.c retval = octeon_send_soft_command(oct, sc); oct 1719 drivers/net/ethernet/cavium/liquidio/lio_core.c dev_info(&oct->pci_dev->dev, "Failed to send soft command\n"); oct 1720 drivers/net/ethernet/cavium/liquidio/lio_core.c octeon_free_soft_command(oct, sc); oct 1724 drivers/net/ethernet/cavium/liquidio/lio_core.c retval = wait_for_sc_completion_timeout(oct, sc, 0); oct 1731 drivers/net/ethernet/cavium/liquidio/lio_core.c dev_err(&oct->pci_dev->dev, oct 1734 drivers/net/ethernet/cavium/liquidio/lio_core.c oct->props[lio->ifidx].fec = var; oct 1736 drivers/net/ethernet/cavium/liquidio/lio_core.c oct->props[lio->ifidx].fec = 1; oct 1738 drivers/net/ethernet/cavium/liquidio/lio_core.c oct->props[lio->ifidx].fec = 0; oct 1743 drivers/net/ethernet/cavium/liquidio/lio_core.c if (oct->props[lio->ifidx].fec != oct 1744 drivers/net/ethernet/cavium/liquidio/lio_core.c oct->props[lio->ifidx].fec_boot) { oct 1745 drivers/net/ethernet/cavium/liquidio/lio_core.c dev_dbg(&oct->pci_dev->dev, oct 1747 drivers/net/ethernet/cavium/liquidio/lio_core.c oct->props[lio->ifidx].fec ? "on" : "off"); oct 1757 drivers/net/ethernet/cavium/liquidio/lio_core.c struct octeon_device *oct; oct 1762 drivers/net/ethernet/cavium/liquidio/lio_core.c oct = lio->oct_dev; oct 1764 drivers/net/ethernet/cavium/liquidio/lio_core.c sc = octeon_alloc_soft_command(oct, OCTNET_CMD_SIZE, oct 1783 drivers/net/ethernet/cavium/liquidio/lio_core.c octeon_prepare_soft_command(oct, sc, OPCODE_NIC, oct 1786 drivers/net/ethernet/cavium/liquidio/lio_core.c retval = octeon_send_soft_command(oct, sc); oct 1788 drivers/net/ethernet/cavium/liquidio/lio_core.c dev_info(&oct->pci_dev->dev, oct 1790 drivers/net/ethernet/cavium/liquidio/lio_core.c octeon_free_soft_command(oct, sc); oct 1794 drivers/net/ethernet/cavium/liquidio/lio_core.c retval = wait_for_sc_completion_timeout(oct, sc, 0); oct 1801 drivers/net/ethernet/cavium/liquidio/lio_core.c oct->props[lio->ifidx].fec = 1; oct 1803 drivers/net/ethernet/cavium/liquidio/lio_core.c oct->props[lio->ifidx].fec = 0; oct 1807 drivers/net/ethernet/cavium/liquidio/lio_core.c if (oct->props[lio->ifidx].fec != oct 1808 drivers/net/ethernet/cavium/liquidio/lio_core.c oct->props[lio->ifidx].fec_boot) { oct 1809 drivers/net/ethernet/cavium/liquidio/lio_core.c dev_dbg(&oct->pci_dev->dev, oct 1811 drivers/net/ethernet/cavium/liquidio/lio_core.c oct->props[lio->ifidx].fec ? "on" : "off"); oct 218 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c struct octeon_device *oct = lio->oct_dev; oct 246 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c dev_dbg(&oct->pci_dev->dev, "ecmd->base.transceiver is XCVR_EXTERNAL\n"); oct 249 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c dev_err(&oct->pci_dev->dev, "Unknown link interface mode: %d\n", oct 259 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if (oct->subsystem_id == OCTEON_CN2350_25GB_SUBSYS_ID || oct 260 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c oct->subsystem_id == OCTEON_CN2360_25GB_SUBSYS_ID) { oct 261 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if (OCTEON_CN23XX_PF(oct)) { oct 269 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if (oct->no_speed_setting == 0) { oct 281 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if (oct->no_speed_setting == 0) { oct 285 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c oct->speed_setting = 25; oct 288 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if (oct->speed_setting == 10) { oct 299 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if (oct->speed_setting == 25) { oct 311 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if (oct->no_speed_setting) oct 319 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if (oct->props[lio->ifidx].fec == 1) { oct 399 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c struct octeon_device *oct; oct 401 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c oct = lio->oct_dev; oct 405 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if (!(oct->subsystem_id == OCTEON_CN2350_25GB_SUBSYS_ID || oct 406 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c oct->subsystem_id == OCTEON_CN2360_25GB_SUBSYS_ID)) oct 409 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if (oct->no_speed_setting) { oct 410 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c dev_err(&oct->pci_dev->dev, "%s: Changing speed is not supported\n", oct 422 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if ((oct->speed_boot == speed / 1000) && oct 423 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c oct->speed_boot == oct->speed_setting) oct 428 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c dev_dbg(&oct->pci_dev->dev, "Port speed is set to %dG\n", oct 429 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c oct->speed_setting); oct 438 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c struct octeon_device *oct; oct 441 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c oct = lio->oct_dev; oct 446 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c strncpy(drvinfo->fw_version, oct->fw_info.liquidio_firmware_version, oct 448 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c strncpy(drvinfo->bus_info, pci_name(oct->pci_dev), 32); oct 454 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c struct octeon_device *oct; oct 458 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c oct = lio->oct_dev; oct 463 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c strncpy(drvinfo->fw_version, oct->fw_info.liquidio_firmware_version, oct 465 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c strncpy(drvinfo->bus_info, pci_name(oct->pci_dev), 32); oct 472 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c struct octeon_device *oct = lio->oct_dev; oct 488 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c dev_err(&oct->pci_dev->dev, "Failed to send Queue reset command (ret: 0x%x)\n", oct 501 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c struct octeon_device *oct = lio->oct_dev; oct 505 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if (OCTEON_CN6XXX(oct)) { oct 506 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c struct octeon_config *conf6x = CHIP_CONF(oct, cn6xxx); oct 512 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c } else if (OCTEON_CN23XX_PF(oct)) { oct 513 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if (oct->sriov_info.sriov_enabled) { oct 517 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c CHIP_CONF(oct, cn23xx_pf); oct 521 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c combined_count = oct->num_iqs; oct 522 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c } else if (OCTEON_CN23XX_VF(oct)) { oct 526 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c reg_val = octeon_read_csr64(oct, ctrl); oct 529 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c combined_count = oct->num_iqs; oct 541 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c lio_irq_reallocate_irqs(struct octeon_device *oct, uint32_t num_ioqs) oct 547 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if (!oct->msix_on) oct 553 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c oct->fn_list.disable_interrupt(oct, OCTEON_ALL_INTR); oct 555 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if (oct->msix_on) { oct 556 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if (OCTEON_CN23XX_PF(oct)) oct 557 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c num_msix_irqs = oct->num_msix_irqs - 1; oct 558 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c else if (OCTEON_CN23XX_VF(oct)) oct 559 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c num_msix_irqs = oct->num_msix_irqs; oct 561 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c msix_entries = (struct msix_entry *)oct->msix_entries; oct 563 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if (oct->ioq_vector[i].vector) { oct 568 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c &oct->ioq_vector[i]); oct 569 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c oct->ioq_vector[i].vector = 0; oct 574 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if (OCTEON_CN23XX_PF(oct)) oct 575 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c free_irq(msix_entries[i].vector, oct); oct 577 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c pci_disable_msix(oct->pci_dev); oct 578 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c kfree(oct->msix_entries); oct 579 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c oct->msix_entries = NULL; oct 582 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c kfree(oct->irq_name_storage); oct 583 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c oct->irq_name_storage = NULL; oct 585 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if (octeon_allocate_ioq_vector(oct, num_ioqs)) { oct 586 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c dev_err(&oct->pci_dev->dev, "OCTEON: ioq vector allocation failed\n"); oct 590 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if (octeon_setup_interrupt(oct, num_ioqs)) { oct 591 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c dev_info(&oct->pci_dev->dev, "Setup interrupt failed\n"); oct 596 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c oct->fn_list.enable_interrupt(oct, OCTEON_ALL_INTR); oct 607 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c struct octeon_device *oct = lio->oct_dev; oct 610 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if (strcmp(oct->fw_info.liquidio_firmware_version, "1.6.1") < 0) { oct 611 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c dev_err(&oct->pci_dev->dev, "Minimum firmware version required is 1.6.1\n"); oct 621 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if (OCTEON_CN23XX_PF(oct)) { oct 622 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if (oct->sriov_info.sriov_enabled) { oct 626 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c CHIP_CONF(oct, oct 632 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c } else if (OCTEON_CN23XX_VF(oct)) { oct 636 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c reg_val = octeon_read_csr64(oct, ctrl); oct 646 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if (combined_count == oct->num_iqs) oct 707 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c struct octeon_device *oct = lio->oct_dev; oct 723 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c dev_err(&oct->pci_dev->dev, oct 734 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c struct octeon_device *oct = lio->oct_dev; oct 749 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c dev_err(&oct->pci_dev->dev, oct 833 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c struct octeon_device *oct = lio->oct_dev; oct 839 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c cur_ver = OCT_FW_VER(oct->fw_info.ver.maj, oct 840 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c oct->fw_info.ver.min, oct 841 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c oct->fw_info.ver.rev); oct 845 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if (oct->chip_id == OCTEON_CN66XX) { oct 850 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c } else if (oct->chip_id == OCTEON_CN68XX) { oct 878 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c } else if (oct->chip_id == OCTEON_CN23XX_PF_VID) { oct 891 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if (oct->chip_id == OCTEON_CN23XX_PF_VID && oct 895 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c else if (oct->chip_id == OCTEON_CN66XX) oct 904 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if (oct->chip_id == OCTEON_CN23XX_PF_VID && oct 908 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c else if (oct->chip_id == OCTEON_CN66XX) oct 917 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if (oct->chip_id == OCTEON_CN66XX) { oct 920 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c } else if (oct->chip_id == OCTEON_CN68XX) { oct 933 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c } else if (oct->chip_id == OCTEON_CN23XX_PF_VID) { oct 954 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c struct octeon_device *oct = lio->oct_dev; oct 961 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if (OCTEON_CN6XXX(oct)) { oct 962 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c struct octeon_config *conf6x = CHIP_CONF(oct, cn6xxx); oct 968 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c } else if (OCTEON_CN23XX_PF(oct) || OCTEON_CN23XX_VF(oct)) { oct 971 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c rx_pending = oct->droq[0]->max_count; oct 972 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c tx_pending = oct->instr_queue[0]->max_count; oct 987 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c struct octeon_device *oct = lio->oct_dev; oct 1000 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c octeon_alloc_soft_command(oct, data_size, oct 1003 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c dev_err(&oct->pci_dev->dev, "%s: Failed to allocate soft command\n", oct 1015 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c ifidx_or_pfnum = oct->pf_num; oct 1018 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if_cfg.s.num_iqueues = oct->sriov_info.num_pf_rings; oct 1019 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if_cfg.s.num_oqueues = oct->sriov_info.num_pf_rings; oct 1020 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if_cfg.s.base_queue = oct->sriov_info.pf_srn; oct 1021 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if_cfg.s.gmx_port_id = oct->pf_num; oct 1024 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c octeon_prepare_soft_command(oct, sc, OPCODE_NIC, oct 1031 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c retval = octeon_send_soft_command(oct, sc); oct 1033 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c dev_err(&oct->pci_dev->dev, oct 1036 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c octeon_free_soft_command(oct, sc); oct 1040 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c retval = wait_for_sc_completion_timeout(oct, sc, 0); oct 1046 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c dev_err(&oct->pci_dev->dev, oct 1074 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c dev_info(&oct->pci_dev->dev, "Queue count updated to %d\n", oct 1085 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c struct octeon_device *oct = lio->oct_dev; oct 1092 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if (wait_for_pending_requests(oct)) oct 1093 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c dev_err(&oct->pci_dev->dev, "There were pending requests\n"); oct 1095 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if (lio_wait_for_instr_fetch(oct)) oct 1096 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c dev_err(&oct->pci_dev->dev, "IQ had pending instructions\n"); oct 1098 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if (octeon_set_io_queues_off(oct)) { oct 1099 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c dev_err(&oct->pci_dev->dev, "Setting io queues off failed\n"); oct 1106 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c oct->fn_list.disable_io_queues(oct); oct 1111 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if (num_qs != oct->num_iqs) { oct 1114 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c dev_err(&oct->pci_dev->dev, oct 1121 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c dev_err(&oct->pci_dev->dev, oct 1146 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if ((OCTEON_CN23XX_PF(oct)) && !oct->sriov_info.sriov_enabled) oct 1147 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c oct->fn_list.free_mbox(oct); oct 1150 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c for (i = 0; i < MAX_OCTEON_OUTPUT_QUEUES(oct); i++) { oct 1151 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if (!(oct->io_qmask.oq & BIT_ULL(i))) oct 1153 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c octeon_delete_droq(oct, i); oct 1156 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c for (i = 0; i < MAX_OCTEON_INSTR_QUEUES(oct); i++) { oct 1157 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if (!(oct->io_qmask.iq & BIT_ULL(i))) oct 1159 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c octeon_delete_instr_queue(oct, i); oct 1164 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if ((OCTEON_CN23XX_PF(oct)) && oct 1165 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c !oct->sriov_info.sriov_enabled) { oct 1166 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c oct->sriov_info.num_pf_rings = num_qs; oct 1167 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if (cn23xx_sriov_config(oct)) { oct 1168 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c dev_err(&oct->pci_dev->dev, oct 1173 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c num_qs = oct->sriov_info.num_pf_rings; oct 1177 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if (oct->fn_list.setup_device_regs(oct)) { oct 1178 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c dev_err(&oct->pci_dev->dev, "Failed to configure device registers\n"); oct 1186 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if (octeon_setup_instr_queues(oct)) oct 1189 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if (octeon_setup_output_queues(oct)) oct 1193 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if (OCTEON_CN23XX_PF(oct) && !oct->sriov_info.sriov_enabled) { oct 1194 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if (oct->fn_list.setup_mbox(oct)) { oct 1195 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c dev_err(&oct->pci_dev->dev, "Mailbox setup failed\n"); oct 1203 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if (lio_irq_reallocate_irqs(oct, num_qs)) { oct 1204 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c dev_err(&oct->pci_dev->dev, "IRQs could not be allocated\n"); oct 1209 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if (oct->fn_list.enable_io_queues(oct)) { oct 1210 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c dev_err(&oct->pci_dev->dev, "Failed to enable input/output queues\n"); oct 1214 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c for (i = 0; i < oct->num_oqs; i++) oct 1215 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c writel(oct->droq[i]->max_count, oct 1216 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c oct->droq[i]->pkts_credit_reg); oct 1222 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if (OCTEON_CN23XX_PF(oct) && !oct->sriov_info.sriov_enabled) { oct 1229 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if (liquidio_setup_io_queues(oct, 0, num_qs, num_qs)) { oct 1230 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c dev_err(&oct->pci_dev->dev, "I/O queues creation failed\n"); oct 1235 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if (lio_setup_glists(oct, lio, num_qs)) { oct 1236 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c dev_err(&oct->pci_dev->dev, "Gather list allocation failed\n"); oct 1241 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c dev_err(&oct->pci_dev->dev, "lio_setup_rx_oom_poll_fn failed\n"); oct 1248 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if (oct->sriov_info.sriov_enabled || OCTEON_CN23XX_VF(oct)) oct 1261 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c struct octeon_device *oct = lio->oct_dev; oct 1264 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if (!OCTEON_CN23XX_PF(oct) && !OCTEON_CN23XX_VF(oct)) oct 1275 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c rx_count_old = oct->droq[0]->max_count; oct 1276 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c tx_count_old = oct->instr_queue[0]->max_count; oct 1290 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c CFG_SET_NUM_TX_DESCS_NIC_IF(octeon_get_conf(oct), lio->ifidx, oct 1293 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c CFG_SET_NUM_RX_DESCS_NIC_IF(octeon_get_conf(oct), lio->ifidx, oct 1296 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if (lio_reset_queues(netdev, oct->num_iqs)) oct 1308 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c CFG_SET_NUM_TX_DESCS_NIC_IF(octeon_get_conf(oct), lio->ifidx, oct 1311 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c CFG_SET_NUM_RX_DESCS_NIC_IF(octeon_get_conf(oct), lio->ifidx, oct 1353 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c struct octeon_device *oct = lio->oct_dev; oct 1357 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c pause->tx_pause = oct->tx_pause; oct 1358 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c pause->rx_pause = oct->rx_pause; oct 1368 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c struct octeon_device *oct = lio->oct_dev; oct 1374 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if (oct->chip_id != OCTEON_CN23XX_PF_VID) oct 1413 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c dev_err(&oct->pci_dev->dev, oct 1418 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c oct->rx_pause = pause->rx_pause; oct 1419 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c oct->tx_pause = pause->tx_pause; oct 2115 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c struct octeon_device *oct = lio->oct_dev; oct 2122 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c switch (oct->chip_id) { oct 2126 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c intr_coal->rx_coalesce_usecs = oct->rx_coalesce_usecs; oct 2128 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c oct->rx_max_coalesced_frames; oct 2132 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c oct->tx_max_coalesced_frames; oct 2138 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c (struct octeon_cn6xxx *)oct->chip; oct 2146 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c iq = oct->instr_queue[lio->linfo.txpciq[0].s.q_no]; oct 2172 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if ((OCTEON_CN23XX_PF(oct) || OCTEON_CN23XX_VF(oct)) && oct 2223 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c struct octeon_device *oct = lio->oct_dev; oct 2227 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c switch (oct->chip_id) { oct 2231 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c (struct octeon_cn6xxx *)oct->chip; oct 2238 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c octeon_write_csr(oct, CN6XXX_SLI_OQ_INT_LEVEL_PKTS, oct 2251 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c for (q_no = 0; q_no < oct->num_oqs; q_no++) { oct 2252 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c q_no += oct->sriov_info.pf_srn; oct 2254 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c oct, CN23XX_SLI_OQ_PKT_INT_LEVELS(q_no), oct 2256 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c oct, CN23XX_SLI_OQ_PKT_INT_LEVELS(q_no)) & oct 2262 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c oct->rx_max_coalesced_frames = rx_max_coalesced_frames; oct 2273 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c for (q_no = 0; q_no < oct->num_oqs; q_no++) { oct 2275 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c oct, CN23XX_VF_SLI_OQ_PKT_INT_LEVELS(q_no), oct 2277 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c oct, CN23XX_VF_SLI_OQ_PKT_INT_LEVELS(q_no)) & oct 2283 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c oct->rx_max_coalesced_frames = rx_max_coalesced_frames; oct 2296 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c struct octeon_device *oct = lio->oct_dev; oct 2300 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c switch (oct->chip_id) { oct 2304 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c (struct octeon_cn6xxx *)oct->chip; oct 2310 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c time_threshold = lio_cn6xxx_get_oq_ticks(oct, oct 2312 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c octeon_write_csr(oct, oct 2328 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c cn23xx_pf_get_oq_ticks(oct, (u32)rx_coalesce_usecs); oct 2329 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c for (q_no = 0; q_no < oct->num_oqs; q_no++) { oct 2330 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c q_no += oct->sriov_info.pf_srn; oct 2331 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c octeon_write_csr64(oct, oct 2338 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c oct->rx_coalesce_usecs = rx_coalesce_usecs; oct 2351 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c cn23xx_vf_get_oq_ticks(oct, (u32)rx_coalesce_usecs); oct 2352 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c for (q_no = 0; q_no < oct->num_oqs; q_no++) { oct 2354 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c oct, CN23XX_VF_SLI_OQ_PKT_INT_LEVELS(q_no), oct 2360 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c oct->rx_coalesce_usecs = rx_coalesce_usecs; oct 2375 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c struct octeon_device *oct = lio->oct_dev; oct 2381 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c switch (oct->chip_id) { oct 2395 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c for (q_no = 0; q_no < oct->num_iqs; q_no++) { oct 2396 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c inst_cnt_reg = (oct->instr_queue[q_no])->inst_cnt_reg; oct 2406 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c oct->tx_max_coalesced_frames = iq_intr_pkt; oct 2420 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c struct octeon_device *oct = lio->oct_dev; oct 2425 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c switch (oct->chip_id) { oct 2434 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c oct->instr_queue[q_no]->fill_threshold = oct 2438 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c dev_err(&oct->pci_dev->dev, oct 2454 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c intrmod.rx_frames = CFG_GET_OQ_INTR_PKT(octeon_get_conf(oct)); oct 2455 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c intrmod.rx_usecs = CFG_GET_OQ_INTR_TIME(octeon_get_conf(oct)); oct 2456 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c intrmod.tx_frames = CFG_GET_IQ_INTR_PKT(octeon_get_conf(oct)); oct 2469 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c oct->rx_coalesce_usecs = oct 2470 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c CFG_GET_OQ_INTR_TIME(octeon_get_conf(oct)); oct 2471 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c oct->rx_max_coalesced_frames = oct 2472 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c CFG_GET_OQ_INTR_PKT(octeon_get_conf(oct)); oct 2480 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c oct->tx_max_coalesced_frames = oct 2481 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c CFG_GET_IQ_INTR_PKT(octeon_get_conf(oct)); oct 2525 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c struct octeon_device *oct = lio->oct_dev; oct 2527 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c switch (oct->chip_id) { oct 2537 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c static int cn23xx_read_csr_reg(char *s, struct octeon_device *oct) oct 2540 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c u8 pf_num = oct->pf_num; oct 2549 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c reg = CN23XX_SLI_PKT_MAC_RINFO64(oct->pcie_port, oct->pf_num); oct 2552 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c reg, oct->pcie_port, oct->pf_num, oct 2553 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c (u64)octeon_read_csr64(oct, reg)); oct 2556 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c reg = CN23XX_SLI_MAC_PF_INT_ENB64(oct->pcie_port, oct->pf_num); oct 2559 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c reg, oct->pcie_port, oct->pf_num, oct 2560 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c (u64)octeon_read_csr64(oct, reg)); oct 2563 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c reg = CN23XX_SLI_MAC_PF_INT_SUM64(oct->pcie_port, oct->pf_num); oct 2566 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c reg, oct->pcie_port, oct->pf_num, oct 2567 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c (u64)octeon_read_csr64(oct, reg)); oct 2572 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c (u64)octeon_read_csr64(oct, reg)); oct 2575 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c reg = 0x27300 + oct->pcie_port * CN23XX_MAC_INT_OFFSET + oct 2576 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c (oct->pf_num) * CN23XX_PF_INT_OFFSET; oct 2579 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c oct->pcie_port, oct->pf_num, (u64)octeon_read_csr64(oct, reg)); oct 2582 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c reg = 0x27200 + oct->pcie_port * CN23XX_MAC_INT_OFFSET + oct 2583 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c (oct->pf_num) * CN23XX_PF_INT_OFFSET; oct 2586 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c reg, oct->pcie_port, oct->pf_num, oct 2587 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c (u64)octeon_read_csr64(oct, reg)); oct 2592 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c (u64)octeon_read_csr64(oct, reg)); oct 2597 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c (u64)octeon_read_csr64(oct, reg)); oct 2602 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c (u64)octeon_read_csr64(oct, reg)); oct 2607 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c reg, (u64)octeon_read_csr64(oct, reg)); oct 2612 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c (u64)octeon_read_csr64(oct, reg)); oct 2618 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c (u64)octeon_read_csr64(oct, reg)); oct 2623 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c reg, (u64)octeon_read_csr64(oct, reg)); oct 2631 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c reg, (u64)octeon_read_csr64(oct, reg)); oct 2637 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c reg, (u64)octeon_read_csr64(oct, reg)); oct 2644 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c reg, i, (u64)octeon_read_csr64(oct, reg)); oct 2652 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c reg, i, (u64)octeon_read_csr64(oct, reg)); oct 2660 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c reg, i, (u64)octeon_read_csr64(oct, reg)); oct 2668 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c reg, i, (u64)octeon_read_csr64(oct, reg)); oct 2677 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c reg, i, (u64)octeon_read_csr64(oct, reg)); oct 2685 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c reg, i, (u64)octeon_read_csr64(oct, reg)); oct 2693 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c reg, i, (u64)octeon_read_csr64(oct, reg)); oct 2700 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c reg, i, (u64)octeon_read_csr64(oct, reg)); oct 2708 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c reg, i, (u64)octeon_read_csr64(oct, reg)); oct 2716 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c reg, i, (u64)octeon_read_csr64(oct, reg)); oct 2725 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c i, (u64)octeon_read_csr64(oct, reg)); oct 2734 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c reg, i, (u64)octeon_read_csr64(oct, reg)); oct 2743 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c reg, i, (u64)octeon_read_csr64(oct, reg)); oct 2751 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c reg, i, (u64)octeon_read_csr64(oct, reg)); oct 2757 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c static int cn23xx_vf_read_csr_reg(char *s, struct octeon_device *oct) oct 2767 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c for (i = 0; i < (oct->sriov_info.rings_per_vf); i++) { oct 2771 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c reg, i, (u64)octeon_read_csr64(oct, reg)); oct 2774 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c for (i = 0; i < (oct->sriov_info.rings_per_vf); i++) { oct 2778 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c reg, i, (u64)octeon_read_csr64(oct, reg)); oct 2781 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c for (i = 0; i < (oct->sriov_info.rings_per_vf); i++) { oct 2785 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c reg, i, (u64)octeon_read_csr64(oct, reg)); oct 2788 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c for (i = 0; i < (oct->sriov_info.rings_per_vf); i++) { oct 2792 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c reg, i, (u64)octeon_read_csr64(oct, reg)); oct 2795 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c for (i = 0; i < (oct->sriov_info.rings_per_vf); i++) { oct 2799 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c reg, i, (u64)octeon_read_csr64(oct, reg)); oct 2802 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c for (i = 0; i < (oct->sriov_info.rings_per_vf); i++) { oct 2806 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c reg, i, (u64)octeon_read_csr64(oct, reg)); oct 2809 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c for (i = 0; i < (oct->sriov_info.rings_per_vf); i++) { oct 2813 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c reg, i, (u64)octeon_read_csr64(oct, reg)); oct 2816 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c for (i = 0; i < (oct->sriov_info.rings_per_vf); i++) { oct 2819 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c reg, i, (u64)octeon_read_csr64(oct, reg)); oct 2822 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c for (i = 0; i < (oct->sriov_info.rings_per_vf); i++) { oct 2826 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c reg, i, (u64)octeon_read_csr64(oct, reg)); oct 2829 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c for (i = 0; i < (oct->sriov_info.rings_per_vf); i++) { oct 2833 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c reg, i, (u64)octeon_read_csr64(oct, reg)); oct 2836 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c for (i = 0; i < (oct->sriov_info.rings_per_vf); i++) { oct 2840 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c reg, i, (u64)octeon_read_csr64(oct, reg)); oct 2843 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c for (i = 0; i < (oct->sriov_info.rings_per_vf); i++) { oct 2847 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c reg, i, (u64)octeon_read_csr64(oct, reg)); oct 2850 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c for (i = 0; i < (oct->sriov_info.rings_per_vf); i++) { oct 2854 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c reg, i, (u64)octeon_read_csr64(oct, reg)); oct 2857 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c for (i = 0; i < (oct->sriov_info.rings_per_vf); i++) { oct 2861 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c reg, i, (u64)octeon_read_csr64(oct, reg)); oct 2864 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c for (i = 0; i < (oct->sriov_info.rings_per_vf); i++) { oct 2868 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c reg, i, (u64)octeon_read_csr64(oct, reg)); oct 2874 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c static int cn6xxx_read_csr_reg(char *s, struct octeon_device *oct) oct 2884 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c CN6XXX_WIN_WR_ADDR_LO, octeon_read_csr(oct, reg)); oct 2887 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c CN6XXX_WIN_WR_ADDR_HI, octeon_read_csr(oct, reg)); oct 2890 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c CN6XXX_WIN_RD_ADDR_LO, octeon_read_csr(oct, reg)); oct 2893 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c CN6XXX_WIN_RD_ADDR_HI, octeon_read_csr(oct, reg)); oct 2896 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c CN6XXX_WIN_WR_DATA_LO, octeon_read_csr(oct, reg)); oct 2899 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c CN6XXX_WIN_WR_DATA_HI, octeon_read_csr(oct, reg)); oct 2902 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c octeon_read_csr(oct, CN6XXX_WIN_WR_MASK_REG)); oct 2906 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c CN6XXX_SLI_INT_ENB64_PORT0, octeon_read_csr(oct, oct 2910 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c octeon_read_csr(oct, CN6XXX_SLI_INT_ENB64_PORT1)); oct 2912 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c octeon_read_csr(oct, CN6XXX_SLI_INT_SUM64)); oct 2915 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c for (i = 0; i < oct->num_oqs; i++) { oct 2918 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c reg, i, octeon_read_csr(oct, reg)); oct 2921 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c reg, i, octeon_read_csr(oct, reg)); oct 2925 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c reg, octeon_read_csr(oct, reg)); oct 2928 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c reg, octeon_read_csr(oct, reg)); oct 2936 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c reg, i, octeon_read_csr(oct, reg)); oct 2939 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c reg, i, octeon_read_csr(oct, reg)); oct 2946 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c octeon_read_csr(oct, CN6XXX_DMA_CNT(0))); oct 2949 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c CN6XXX_DMA_PKT_INT_LEVEL(0), octeon_read_csr(oct, reg)); oct 2953 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c octeon_read_csr(oct, reg)); oct 2957 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c octeon_read_csr(oct, CN6XXX_DMA_CNT(1))); oct 2961 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c octeon_read_csr(oct, reg)); oct 2965 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c octeon_read_csr(oct, reg)); oct 2972 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c reg = lio_pci_readq(oct, CN6XXX_BAR1_REG(i, oct->pcie_port)); oct 2974 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c CN6XXX_BAR1_REG(i, oct->pcie_port), i, reg); oct 2980 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c static int cn6xxx_read_config_reg(char *s, struct octeon_device *oct) oct 2991 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c pci_read_config_dword(oct->pci_dev, (i * 4), &val); oct 2997 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c pci_read_config_dword(oct->pci_dev, (i * 4), &val); oct 3011 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c struct octeon_device *oct = lio->oct_dev; oct 3015 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c switch (oct->chip_id) { oct 3018 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c len += cn23xx_read_csr_reg(regbuf + len, oct); oct 3022 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c len += cn23xx_vf_read_csr_reg(regbuf + len, oct); oct 3027 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c len += cn6xxx_read_csr_reg(regbuf + len, oct); oct 3028 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c len += cn6xxx_read_config_reg(regbuf + len, oct); oct 3031 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c dev_err(&oct->pci_dev->dev, "%s Unknown chipid: %d\n", oct 3032 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c __func__, oct->chip_id); oct 3057 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c struct octeon_device *oct = lio->oct_dev; oct 3062 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if (oct->subsystem_id == OCTEON_CN2350_25GB_SUBSYS_ID || oct 3063 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c oct->subsystem_id == OCTEON_CN2360_25GB_SUBSYS_ID) { oct 3064 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if (oct->no_speed_setting == 1) oct 3069 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if (oct->props[lio->ifidx].fec == 1) oct 3082 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c struct octeon_device *oct = lio->oct_dev; oct 3084 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if (oct->subsystem_id == OCTEON_CN2350_25GB_SUBSYS_ID || oct 3085 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c oct->subsystem_id == OCTEON_CN2360_25GB_SUBSYS_ID) { oct 3086 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if (oct->no_speed_setting == 1) oct 3157 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c struct octeon_device *oct = lio->oct_dev; oct 3159 drivers/net/ethernet/cavium/liquidio/lio_ethtool.c if (OCTEON_CN23XX_VF(oct)) oct 151 drivers/net/ethernet/cavium/liquidio/lio_main.c static int octeon_dbg_console_print(struct octeon_device *oct, u32 console_num, oct 169 drivers/net/ethernet/cavium/liquidio/lio_main.c struct octeon_device *oct = (struct octeon_device *)pdev; oct 171 drivers/net/ethernet/cavium/liquidio/lio_main.c (struct octeon_device_priv *)oct->priv; oct 173 drivers/net/ethernet/cavium/liquidio/lio_main.c for (q_no = 0; q_no < MAX_OCTEON_OUTPUT_QUEUES(oct); q_no++) { oct 174 drivers/net/ethernet/cavium/liquidio/lio_main.c if (!(oct->io_qmask.oq & BIT_ULL(q_no))) oct 176 drivers/net/ethernet/cavium/liquidio/lio_main.c reschedule |= octeon_droq_process_packets(oct, oct->droq[q_no], oct 178 drivers/net/ethernet/cavium/liquidio/lio_main.c lio_enable_irq(oct->droq[q_no], NULL); oct 180 drivers/net/ethernet/cavium/liquidio/lio_main.c if (OCTEON_CN23XX_PF(oct) && oct->msix_on) { oct 184 drivers/net/ethernet/cavium/liquidio/lio_main.c int adjusted_q_no = q_no + oct->sriov_info.pf_srn; oct 187 drivers/net/ethernet/cavium/liquidio/lio_main.c oct, CN23XX_SLI_OQ_PKT_INT_LEVELS(adjusted_q_no), oct 190 drivers/net/ethernet/cavium/liquidio/lio_main.c oct, CN23XX_SLI_OQ_PKTS_SENT(adjusted_q_no), 0); oct 198 drivers/net/ethernet/cavium/liquidio/lio_main.c static int lio_wait_for_oq_pkts(struct octeon_device *oct) oct 201 drivers/net/ethernet/cavium/liquidio/lio_main.c (struct octeon_device_priv *)oct->priv; oct 208 drivers/net/ethernet/cavium/liquidio/lio_main.c for (i = 0; i < MAX_OCTEON_OUTPUT_QUEUES(oct); i++) { oct 209 drivers/net/ethernet/cavium/liquidio/lio_main.c if (!(oct->io_qmask.oq & BIT_ULL(i))) oct 211 drivers/net/ethernet/cavium/liquidio/lio_main.c pkt_cnt += octeon_droq_check_hw_for_pkts(oct->droq[i]); oct 229 drivers/net/ethernet/cavium/liquidio/lio_main.c static void force_io_queues_off(struct octeon_device *oct) oct 231 drivers/net/ethernet/cavium/liquidio/lio_main.c if ((oct->chip_id == OCTEON_CN66XX) || oct 232 drivers/net/ethernet/cavium/liquidio/lio_main.c (oct->chip_id == OCTEON_CN68XX)) { oct 234 drivers/net/ethernet/cavium/liquidio/lio_main.c octeon_write_csr(oct, CN6XXX_SLI_PKT_INSTR_ENB, 0); oct 237 drivers/net/ethernet/cavium/liquidio/lio_main.c octeon_write_csr(oct, CN6XXX_SLI_PKT_OUT_ENB, 0); oct 245 drivers/net/ethernet/cavium/liquidio/lio_main.c static inline void pcierror_quiesce_device(struct octeon_device *oct) oct 253 drivers/net/ethernet/cavium/liquidio/lio_main.c force_io_queues_off(oct); oct 258 drivers/net/ethernet/cavium/liquidio/lio_main.c if (wait_for_pending_requests(oct)) oct 259 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_err(&oct->pci_dev->dev, "There were pending requests\n"); oct 262 drivers/net/ethernet/cavium/liquidio/lio_main.c for (i = 0; i < MAX_OCTEON_INSTR_QUEUES(oct); i++) { oct 265 drivers/net/ethernet/cavium/liquidio/lio_main.c if (!(oct->io_qmask.iq & BIT_ULL(i))) oct 267 drivers/net/ethernet/cavium/liquidio/lio_main.c iq = oct->instr_queue[i]; oct 275 drivers/net/ethernet/cavium/liquidio/lio_main.c lio_process_iq_request_list(oct, iq, 0); oct 281 drivers/net/ethernet/cavium/liquidio/lio_main.c lio_process_ordered_list(oct, 1); oct 310 drivers/net/ethernet/cavium/liquidio/lio_main.c static void stop_pci_io(struct octeon_device *oct) oct 313 drivers/net/ethernet/cavium/liquidio/lio_main.c atomic_set(&oct->status, OCT_DEV_IN_RESET); oct 315 drivers/net/ethernet/cavium/liquidio/lio_main.c pci_disable_device(oct->pci_dev); oct 318 drivers/net/ethernet/cavium/liquidio/lio_main.c oct->fn_list.disable_interrupt(oct, OCTEON_ALL_INTR); oct 320 drivers/net/ethernet/cavium/liquidio/lio_main.c pcierror_quiesce_device(oct); oct 323 drivers/net/ethernet/cavium/liquidio/lio_main.c free_irq(oct->pci_dev->irq, oct); oct 325 drivers/net/ethernet/cavium/liquidio/lio_main.c if (oct->flags & LIO_FLAG_MSI_ENABLED) oct 326 drivers/net/ethernet/cavium/liquidio/lio_main.c pci_disable_msi(oct->pci_dev); oct 328 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_dbg(&oct->pci_dev->dev, "Device state is now %s\n", oct 329 drivers/net/ethernet/cavium/liquidio/lio_main.c lio_get_state_string(&oct->status)); oct 332 drivers/net/ethernet/cavium/liquidio/lio_main.c cleanup_aer_uncorrect_error_status(oct->pci_dev); oct 346 drivers/net/ethernet/cavium/liquidio/lio_main.c struct octeon_device *oct = pci_get_drvdata(pdev); oct 350 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_err(&oct->pci_dev->dev, "Non-correctable non-fatal error reported:\n"); oct 351 drivers/net/ethernet/cavium/liquidio/lio_main.c cleanup_aer_uncorrect_error_status(oct->pci_dev); oct 356 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_err(&oct->pci_dev->dev, "Non-correctable FATAL reported by PCI AER driver\n"); oct 357 drivers/net/ethernet/cavium/liquidio/lio_main.c stop_pci_io(oct); oct 562 drivers/net/ethernet/cavium/liquidio/lio_main.c struct octeon_device *oct = lio->oct_dev; oct 567 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_err(&oct->pci_dev->dev, "unable to create cavium link status wq\n"); oct 601 drivers/net/ethernet/cavium/liquidio/lio_main.c struct octeon_device *oct = lio->oct_dev; oct 603 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_dbg(&oct->pci_dev->dev, "%s: lio->linfo.link.u64=%llx, ls->u64=%llx\n", oct 612 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_dbg(&oct->pci_dev->dev, "%s: link_up", __func__); oct 616 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_dbg(&oct->pci_dev->dev, "%s: link_off", __func__); oct 626 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_warn(&oct->pci_dev->dev, oct 645 drivers/net/ethernet/cavium/liquidio/lio_main.c struct octeon_device *oct = lio->oct_dev; oct 651 drivers/net/ethernet/cavium/liquidio/lio_main.c sc = octeon_alloc_soft_command(oct, sizeof(struct lio_time), 16, 0); oct 653 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_err(&oct->pci_dev->dev, oct 667 drivers/net/ethernet/cavium/liquidio/lio_main.c octeon_prepare_soft_command(oct, sc, OPCODE_NIC, oct 673 drivers/net/ethernet/cavium/liquidio/lio_main.c ret = octeon_send_soft_command(oct, sc); oct 675 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_err(&oct->pci_dev->dev, oct 677 drivers/net/ethernet/cavium/liquidio/lio_main.c octeon_free_soft_command(oct, sc); oct 696 drivers/net/ethernet/cavium/liquidio/lio_main.c struct octeon_device *oct = lio->oct_dev; oct 701 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_err(&oct->pci_dev->dev, "Unable to create wq to update octeon time\n"); oct 731 drivers/net/ethernet/cavium/liquidio/lio_main.c static struct octeon_device *get_other_octeon_device(struct octeon_device *oct) oct 735 drivers/net/ethernet/cavium/liquidio/lio_main.c other_oct = lio_get_device(oct->octeon_id + 1); oct 740 drivers/net/ethernet/cavium/liquidio/lio_main.c oct_busnum = oct->pci_dev->bus->number; oct 746 drivers/net/ethernet/cavium/liquidio/lio_main.c oct_slot = PCI_SLOT(oct->pci_dev->devfn); oct 757 drivers/net/ethernet/cavium/liquidio/lio_main.c static void disable_all_vf_links(struct octeon_device *oct) oct 762 drivers/net/ethernet/cavium/liquidio/lio_main.c if (!oct) oct 765 drivers/net/ethernet/cavium/liquidio/lio_main.c max_vfs = oct->sriov_info.max_vfs; oct 767 drivers/net/ethernet/cavium/liquidio/lio_main.c for (i = 0; i < oct->ifcount; i++) { oct 768 drivers/net/ethernet/cavium/liquidio/lio_main.c netdev = oct->props[i].netdev; oct 783 drivers/net/ethernet/cavium/liquidio/lio_main.c struct octeon_device *oct = param; oct 799 drivers/net/ethernet/cavium/liquidio/lio_main.c (u16)octeon_read_csr64(oct, CN23XX_SLI_SCRATCH2); oct 804 drivers/net/ethernet/cavium/liquidio/lio_main.c WRITE_ONCE(oct->cores_crashed, true); oct 805 drivers/net/ethernet/cavium/liquidio/lio_main.c other_oct = get_other_octeon_device(oct); oct 818 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_err(&oct->pci_dev->dev, oct 828 drivers/net/ethernet/cavium/liquidio/lio_main.c disable_all_vf_links(oct); oct 833 drivers/net/ethernet/cavium/liquidio/lio_main.c vfs_mask1 = READ_ONCE(oct->sriov_info.vf_drv_loaded_mask); oct 952 drivers/net/ethernet/cavium/liquidio/lio_main.c static void octeon_pci_flr(struct octeon_device *oct) oct 956 drivers/net/ethernet/cavium/liquidio/lio_main.c pci_save_state(oct->pci_dev); oct 958 drivers/net/ethernet/cavium/liquidio/lio_main.c pci_cfg_access_lock(oct->pci_dev); oct 961 drivers/net/ethernet/cavium/liquidio/lio_main.c pci_write_config_word(oct->pci_dev, PCI_COMMAND, oct 964 drivers/net/ethernet/cavium/liquidio/lio_main.c rc = __pci_reset_function_locked(oct->pci_dev); oct 967 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_err(&oct->pci_dev->dev, "Error %d resetting PCI function %d\n", oct 968 drivers/net/ethernet/cavium/liquidio/lio_main.c rc, oct->pf_num); oct 970 drivers/net/ethernet/cavium/liquidio/lio_main.c pci_cfg_access_unlock(oct->pci_dev); oct 972 drivers/net/ethernet/cavium/liquidio/lio_main.c pci_restore_state(oct->pci_dev); oct 980 drivers/net/ethernet/cavium/liquidio/lio_main.c static void octeon_destroy_resources(struct octeon_device *oct) oct 985 drivers/net/ethernet/cavium/liquidio/lio_main.c (struct octeon_device_priv *)oct->priv; oct 989 drivers/net/ethernet/cavium/liquidio/lio_main.c switch (atomic_read(&oct->status)) { oct 994 drivers/net/ethernet/cavium/liquidio/lio_main.c atomic_set(&oct->status, OCT_DEV_IN_RESET); oct 996 drivers/net/ethernet/cavium/liquidio/lio_main.c oct->app_mode = CVM_DRV_INVALID_APP; oct 997 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_dbg(&oct->pci_dev->dev, "Device state is now %s\n", oct 998 drivers/net/ethernet/cavium/liquidio/lio_main.c lio_get_state_string(&oct->status)); oct 1008 drivers/net/ethernet/cavium/liquidio/lio_main.c octeon_remove_consoles(oct); oct 1012 drivers/net/ethernet/cavium/liquidio/lio_main.c if (lio_wait_for_instr_fetch(oct)) oct 1013 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_err(&oct->pci_dev->dev, "IQ had pending instructions\n"); oct 1015 drivers/net/ethernet/cavium/liquidio/lio_main.c if (wait_for_pending_requests(oct)) oct 1016 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_err(&oct->pci_dev->dev, "There were pending requests\n"); oct 1022 drivers/net/ethernet/cavium/liquidio/lio_main.c oct->fn_list.disable_io_queues(oct); oct 1024 drivers/net/ethernet/cavium/liquidio/lio_main.c if (lio_wait_for_oq_pkts(oct)) oct 1025 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_err(&oct->pci_dev->dev, "OQ had pending packets\n"); oct 1030 drivers/net/ethernet/cavium/liquidio/lio_main.c for (i = 0; i < MAX_OCTEON_INSTR_QUEUES(oct); i++) { oct 1033 drivers/net/ethernet/cavium/liquidio/lio_main.c if (!(oct->io_qmask.iq & BIT_ULL(i))) oct 1035 drivers/net/ethernet/cavium/liquidio/lio_main.c iq = oct->instr_queue[i]; oct 1043 drivers/net/ethernet/cavium/liquidio/lio_main.c lio_process_iq_request_list(oct, iq, 0); oct 1048 drivers/net/ethernet/cavium/liquidio/lio_main.c lio_process_ordered_list(oct, 1); oct 1049 drivers/net/ethernet/cavium/liquidio/lio_main.c octeon_free_sc_done_list(oct); oct 1050 drivers/net/ethernet/cavium/liquidio/lio_main.c octeon_free_sc_zombie_list(oct); oct 1055 drivers/net/ethernet/cavium/liquidio/lio_main.c oct->fn_list.disable_interrupt(oct, OCTEON_ALL_INTR); oct 1057 drivers/net/ethernet/cavium/liquidio/lio_main.c if (oct->msix_on) { oct 1058 drivers/net/ethernet/cavium/liquidio/lio_main.c msix_entries = (struct msix_entry *)oct->msix_entries; oct 1059 drivers/net/ethernet/cavium/liquidio/lio_main.c for (i = 0; i < oct->num_msix_irqs - 1; i++) { oct 1060 drivers/net/ethernet/cavium/liquidio/lio_main.c if (oct->ioq_vector[i].vector) { oct 1066 drivers/net/ethernet/cavium/liquidio/lio_main.c &oct->ioq_vector[i]); oct 1067 drivers/net/ethernet/cavium/liquidio/lio_main.c oct->ioq_vector[i].vector = 0; oct 1071 drivers/net/ethernet/cavium/liquidio/lio_main.c free_irq(msix_entries[i].vector, oct); oct 1073 drivers/net/ethernet/cavium/liquidio/lio_main.c pci_disable_msix(oct->pci_dev); oct 1074 drivers/net/ethernet/cavium/liquidio/lio_main.c kfree(oct->msix_entries); oct 1075 drivers/net/ethernet/cavium/liquidio/lio_main.c oct->msix_entries = NULL; oct 1078 drivers/net/ethernet/cavium/liquidio/lio_main.c free_irq(oct->pci_dev->irq, oct); oct 1080 drivers/net/ethernet/cavium/liquidio/lio_main.c if (oct->flags & LIO_FLAG_MSI_ENABLED) oct 1081 drivers/net/ethernet/cavium/liquidio/lio_main.c pci_disable_msi(oct->pci_dev); oct 1084 drivers/net/ethernet/cavium/liquidio/lio_main.c kfree(oct->irq_name_storage); oct 1085 drivers/net/ethernet/cavium/liquidio/lio_main.c oct->irq_name_storage = NULL; oct 1089 drivers/net/ethernet/cavium/liquidio/lio_main.c if (OCTEON_CN23XX_PF(oct)) oct 1090 drivers/net/ethernet/cavium/liquidio/lio_main.c octeon_free_ioq_vector(oct); oct 1094 drivers/net/ethernet/cavium/liquidio/lio_main.c if (OCTEON_CN23XX_PF(oct)) oct 1095 drivers/net/ethernet/cavium/liquidio/lio_main.c oct->fn_list.free_mbox(oct); oct 1102 drivers/net/ethernet/cavium/liquidio/lio_main.c for (i = 0; i < MAX_OCTEON_OUTPUT_QUEUES(oct); i++) { oct 1103 drivers/net/ethernet/cavium/liquidio/lio_main.c if (!(oct->io_qmask.oq & BIT_ULL(i))) oct 1105 drivers/net/ethernet/cavium/liquidio/lio_main.c octeon_delete_droq(oct, i); oct 1113 drivers/net/ethernet/cavium/liquidio/lio_main.c handshake[oct->octeon_id].init_ok = 0; oct 1114 drivers/net/ethernet/cavium/liquidio/lio_main.c complete(&handshake[oct->octeon_id].init); oct 1115 drivers/net/ethernet/cavium/liquidio/lio_main.c handshake[oct->octeon_id].started_ok = 0; oct 1116 drivers/net/ethernet/cavium/liquidio/lio_main.c complete(&handshake[oct->octeon_id].started); oct 1122 drivers/net/ethernet/cavium/liquidio/lio_main.c octeon_delete_response_list(oct); oct 1126 drivers/net/ethernet/cavium/liquidio/lio_main.c for (i = 0; i < MAX_OCTEON_INSTR_QUEUES(oct); i++) { oct 1127 drivers/net/ethernet/cavium/liquidio/lio_main.c if (!(oct->io_qmask.iq & BIT_ULL(i))) oct 1129 drivers/net/ethernet/cavium/liquidio/lio_main.c octeon_delete_instr_queue(oct, i); oct 1132 drivers/net/ethernet/cavium/liquidio/lio_main.c if (oct->sriov_info.sriov_enabled) oct 1133 drivers/net/ethernet/cavium/liquidio/lio_main.c pci_disable_sriov(oct->pci_dev); oct 1137 drivers/net/ethernet/cavium/liquidio/lio_main.c octeon_free_sc_buffer_pool(oct); oct 1141 drivers/net/ethernet/cavium/liquidio/lio_main.c octeon_delete_dispatch_list(oct); oct 1142 drivers/net/ethernet/cavium/liquidio/lio_main.c cancel_delayed_work_sync(&oct->nic_poll_work.work); oct 1146 drivers/net/ethernet/cavium/liquidio/lio_main.c refcount = octeon_deregister_device(oct); oct 1154 drivers/net/ethernet/cavium/liquidio/lio_main.c if (atomic_read(oct->adapter_fw_state) == FW_IS_PRELOADED) oct 1155 drivers/net/ethernet/cavium/liquidio/lio_main.c octeon_pci_flr(oct); oct 1156 drivers/net/ethernet/cavium/liquidio/lio_main.c else if (OCTEON_CN6XXX(oct) || !refcount) oct 1157 drivers/net/ethernet/cavium/liquidio/lio_main.c oct->fn_list.soft_reset(oct); oct 1159 drivers/net/ethernet/cavium/liquidio/lio_main.c octeon_unmap_pci_barx(oct, 0); oct 1160 drivers/net/ethernet/cavium/liquidio/lio_main.c octeon_unmap_pci_barx(oct, 1); oct 1164 drivers/net/ethernet/cavium/liquidio/lio_main.c pci_clear_master(oct->pci_dev); oct 1166 drivers/net/ethernet/cavium/liquidio/lio_main.c pci_disable_device(oct->pci_dev); oct 1186 drivers/net/ethernet/cavium/liquidio/lio_main.c struct octeon_device *oct = (struct octeon_device *)lio->oct_dev; oct 1189 drivers/net/ethernet/cavium/liquidio/lio_main.c if (oct->props[lio->ifidx].rx_on == start_stop) oct 1193 drivers/net/ethernet/cavium/liquidio/lio_main.c octeon_alloc_soft_command(oct, OCTNET_CMD_SIZE, oct 1211 drivers/net/ethernet/cavium/liquidio/lio_main.c octeon_prepare_soft_command(oct, sc, OPCODE_NIC, oct 1217 drivers/net/ethernet/cavium/liquidio/lio_main.c retval = octeon_send_soft_command(oct, sc); oct 1220 drivers/net/ethernet/cavium/liquidio/lio_main.c octeon_free_soft_command(oct, sc); oct 1226 drivers/net/ethernet/cavium/liquidio/lio_main.c retval = wait_for_sc_completion_timeout(oct, sc, 0); oct 1230 drivers/net/ethernet/cavium/liquidio/lio_main.c oct->props[lio->ifidx].rx_on = start_stop; oct 1243 drivers/net/ethernet/cavium/liquidio/lio_main.c static void liquidio_destroy_nic_device(struct octeon_device *oct, int ifidx) oct 1245 drivers/net/ethernet/cavium/liquidio/lio_main.c struct net_device *netdev = oct->props[ifidx].netdev; oct 1247 drivers/net/ethernet/cavium/liquidio/lio_main.c (struct octeon_device_priv *)oct->priv; oct 1252 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_err(&oct->pci_dev->dev, "%s No netdevice ptr for index %d\n", oct 1259 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_dbg(&oct->pci_dev->dev, "NIC device cleanup\n"); oct 1264 drivers/net/ethernet/cavium/liquidio/lio_main.c if (oct->props[lio->ifidx].napi_enabled == 1) { oct 1268 drivers/net/ethernet/cavium/liquidio/lio_main.c oct->props[lio->ifidx].napi_enabled = 0; oct 1270 drivers/net/ethernet/cavium/liquidio/lio_main.c if (OCTEON_CN23XX_PF(oct)) oct 1271 drivers/net/ethernet/cavium/liquidio/lio_main.c oct->droq[0]->ops.poll_mode = 0; oct 1292 drivers/net/ethernet/cavium/liquidio/lio_main.c oct->props[ifidx].gmxport = -1; oct 1294 drivers/net/ethernet/cavium/liquidio/lio_main.c oct->props[ifidx].netdev = NULL; oct 1301 drivers/net/ethernet/cavium/liquidio/lio_main.c static int liquidio_stop_nic_module(struct octeon_device *oct) oct 1306 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_dbg(&oct->pci_dev->dev, "Stopping network interfaces\n"); oct 1307 drivers/net/ethernet/cavium/liquidio/lio_main.c if (!oct->ifcount) { oct 1308 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_err(&oct->pci_dev->dev, "Init for Octeon was not completed\n"); oct 1312 drivers/net/ethernet/cavium/liquidio/lio_main.c spin_lock_bh(&oct->cmd_resp_wqlock); oct 1313 drivers/net/ethernet/cavium/liquidio/lio_main.c oct->cmd_resp_state = OCT_DRV_OFFLINE; oct 1314 drivers/net/ethernet/cavium/liquidio/lio_main.c spin_unlock_bh(&oct->cmd_resp_wqlock); oct 1316 drivers/net/ethernet/cavium/liquidio/lio_main.c lio_vf_rep_destroy(oct); oct 1318 drivers/net/ethernet/cavium/liquidio/lio_main.c for (i = 0; i < oct->ifcount; i++) { oct 1319 drivers/net/ethernet/cavium/liquidio/lio_main.c lio = GET_LIO(oct->props[i].netdev); oct 1320 drivers/net/ethernet/cavium/liquidio/lio_main.c for (j = 0; j < oct->num_oqs; j++) oct 1321 drivers/net/ethernet/cavium/liquidio/lio_main.c octeon_unregister_droq_ops(oct, oct 1325 drivers/net/ethernet/cavium/liquidio/lio_main.c for (i = 0; i < oct->ifcount; i++) oct 1326 drivers/net/ethernet/cavium/liquidio/lio_main.c liquidio_destroy_nic_device(oct, i); oct 1328 drivers/net/ethernet/cavium/liquidio/lio_main.c if (oct->devlink) { oct 1329 drivers/net/ethernet/cavium/liquidio/lio_main.c devlink_unregister(oct->devlink); oct 1330 drivers/net/ethernet/cavium/liquidio/lio_main.c devlink_free(oct->devlink); oct 1331 drivers/net/ethernet/cavium/liquidio/lio_main.c oct->devlink = NULL; oct 1334 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_dbg(&oct->pci_dev->dev, "Network interfaces stopped\n"); oct 1375 drivers/net/ethernet/cavium/liquidio/lio_main.c static int octeon_chip_specific_setup(struct octeon_device *oct) oct 1381 drivers/net/ethernet/cavium/liquidio/lio_main.c pci_read_config_dword(oct->pci_dev, 0, &dev_id); oct 1382 drivers/net/ethernet/cavium/liquidio/lio_main.c pci_read_config_dword(oct->pci_dev, 8, &rev_id); oct 1383 drivers/net/ethernet/cavium/liquidio/lio_main.c oct->rev_id = rev_id & 0xff; oct 1387 drivers/net/ethernet/cavium/liquidio/lio_main.c oct->chip_id = OCTEON_CN68XX; oct 1388 drivers/net/ethernet/cavium/liquidio/lio_main.c ret = lio_setup_cn68xx_octeon_device(oct); oct 1393 drivers/net/ethernet/cavium/liquidio/lio_main.c oct->chip_id = OCTEON_CN66XX; oct 1394 drivers/net/ethernet/cavium/liquidio/lio_main.c ret = lio_setup_cn66xx_octeon_device(oct); oct 1399 drivers/net/ethernet/cavium/liquidio/lio_main.c oct->chip_id = OCTEON_CN23XX_PF_VID; oct 1400 drivers/net/ethernet/cavium/liquidio/lio_main.c ret = setup_cn23xx_octeon_pf_device(oct); oct 1405 drivers/net/ethernet/cavium/liquidio/lio_main.c pci_sriov_set_totalvfs(oct->pci_dev, oct 1406 drivers/net/ethernet/cavium/liquidio/lio_main.c oct->sriov_info.max_vfs); oct 1413 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_err(&oct->pci_dev->dev, "Unknown device found (dev_id: %x)\n", oct 1418 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_info(&oct->pci_dev->dev, "%s PASS%d.%d %s Version: %s\n", s, oct 1419 drivers/net/ethernet/cavium/liquidio/lio_main.c OCTEON_MAJOR_REV(oct), oct 1420 drivers/net/ethernet/cavium/liquidio/lio_main.c OCTEON_MINOR_REV(oct), oct 1421 drivers/net/ethernet/cavium/liquidio/lio_main.c octeon_get_conf(oct)->card_name, oct 1431 drivers/net/ethernet/cavium/liquidio/lio_main.c static int octeon_pci_os_setup(struct octeon_device *oct) oct 1434 drivers/net/ethernet/cavium/liquidio/lio_main.c if (pci_enable_device(oct->pci_dev)) { oct 1435 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_err(&oct->pci_dev->dev, "pci_enable_device failed\n"); oct 1439 drivers/net/ethernet/cavium/liquidio/lio_main.c if (dma_set_mask_and_coherent(&oct->pci_dev->dev, DMA_BIT_MASK(64))) { oct 1440 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_err(&oct->pci_dev->dev, "Unexpected DMA device capability\n"); oct 1441 drivers/net/ethernet/cavium/liquidio/lio_main.c pci_disable_device(oct->pci_dev); oct 1446 drivers/net/ethernet/cavium/liquidio/lio_main.c pci_set_master(oct->pci_dev); oct 1563 drivers/net/ethernet/cavium/liquidio/lio_main.c struct octeon_device *oct = (struct octeon_device *)lio->oct_dev; oct 1578 drivers/net/ethernet/cavium/liquidio/lio_main.c do_div(delta, oct->coproc_clock_rate); oct 1581 drivers/net/ethernet/cavium/liquidio/lio_main.c comp = lio_pci_readq(oct, CN6XXX_MIO_PTP_CLOCK_COMP); oct 1586 drivers/net/ethernet/cavium/liquidio/lio_main.c lio_pci_writeq(oct, comp, CN6XXX_MIO_PTP_CLOCK_COMP); oct 1620 drivers/net/ethernet/cavium/liquidio/lio_main.c struct octeon_device *oct = (struct octeon_device *)lio->oct_dev; oct 1623 drivers/net/ethernet/cavium/liquidio/lio_main.c ns = lio_pci_readq(oct, CN6XXX_MIO_PTP_CLOCK_HI); oct 1643 drivers/net/ethernet/cavium/liquidio/lio_main.c struct octeon_device *oct = (struct octeon_device *)lio->oct_dev; oct 1648 drivers/net/ethernet/cavium/liquidio/lio_main.c lio_pci_writeq(oct, ns, CN6XXX_MIO_PTP_CLOCK_HI); oct 1676 drivers/net/ethernet/cavium/liquidio/lio_main.c struct octeon_device *oct = (struct octeon_device *)lio->oct_dev; oct 1696 drivers/net/ethernet/cavium/liquidio/lio_main.c &oct->pci_dev->dev); oct 1706 drivers/net/ethernet/cavium/liquidio/lio_main.c static void liquidio_ptp_init(struct octeon_device *oct) oct 1711 drivers/net/ethernet/cavium/liquidio/lio_main.c do_div(clock_comp, oct->coproc_clock_rate); oct 1712 drivers/net/ethernet/cavium/liquidio/lio_main.c lio_pci_writeq(oct, clock_comp, CN6XXX_MIO_PTP_CLOCK_COMP); oct 1715 drivers/net/ethernet/cavium/liquidio/lio_main.c cfg = lio_pci_readq(oct, CN6XXX_MIO_PTP_CLOCK_CFG); oct 1716 drivers/net/ethernet/cavium/liquidio/lio_main.c lio_pci_writeq(oct, cfg | 0x01, CN6XXX_MIO_PTP_CLOCK_CFG); oct 1725 drivers/net/ethernet/cavium/liquidio/lio_main.c static int load_firmware(struct octeon_device *oct) oct 1740 drivers/net/ethernet/cavium/liquidio/lio_main.c octeon_get_conf(oct)->card_name, tmp_fw_type, oct 1743 drivers/net/ethernet/cavium/liquidio/lio_main.c ret = request_firmware(&fw, fw_name, &oct->pci_dev->dev); oct 1745 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_err(&oct->pci_dev->dev, "Request firmware failed. Could not find file %s.\n", oct 1751 drivers/net/ethernet/cavium/liquidio/lio_main.c ret = octeon_download_firmware(oct, fw->data, fw->size); oct 1782 drivers/net/ethernet/cavium/liquidio/lio_main.c struct octeon_device *oct = lio->oct_dev; oct 1787 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_err(&oct->pci_dev->dev, "unable to create cavium txq status wq\n"); oct 1815 drivers/net/ethernet/cavium/liquidio/lio_main.c struct octeon_device *oct = lio->oct_dev; oct 1817 drivers/net/ethernet/cavium/liquidio/lio_main.c (struct octeon_device_priv *)oct->priv; oct 1820 drivers/net/ethernet/cavium/liquidio/lio_main.c if (oct->props[lio->ifidx].napi_enabled == 0) { oct 1826 drivers/net/ethernet/cavium/liquidio/lio_main.c oct->props[lio->ifidx].napi_enabled = 1; oct 1828 drivers/net/ethernet/cavium/liquidio/lio_main.c if (OCTEON_CN23XX_PF(oct)) oct 1829 drivers/net/ethernet/cavium/liquidio/lio_main.c oct->droq[0]->ops.poll_mode = 1; oct 1832 drivers/net/ethernet/cavium/liquidio/lio_main.c if (oct->ptp_enable) oct 1837 drivers/net/ethernet/cavium/liquidio/lio_main.c if (OCTEON_CN23XX_PF(oct)) { oct 1838 drivers/net/ethernet/cavium/liquidio/lio_main.c if (!oct->msix_on) oct 1862 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_info(&oct->pci_dev->dev, "%s interface is opened\n", oct 1875 drivers/net/ethernet/cavium/liquidio/lio_main.c struct octeon_device *oct = lio->oct_dev; oct 1877 drivers/net/ethernet/cavium/liquidio/lio_main.c (struct octeon_device_priv *)oct->priv; oct 1897 drivers/net/ethernet/cavium/liquidio/lio_main.c if (OCTEON_CN23XX_PF(oct)) { oct 1898 drivers/net/ethernet/cavium/liquidio/lio_main.c if (!oct->msix_on) oct 1912 drivers/net/ethernet/cavium/liquidio/lio_main.c if (lio_wait_for_clean_oq(oct)) oct 1916 drivers/net/ethernet/cavium/liquidio/lio_main.c if (oct->props[lio->ifidx].napi_enabled == 1) { oct 1920 drivers/net/ethernet/cavium/liquidio/lio_main.c oct->props[lio->ifidx].napi_enabled = 0; oct 1922 drivers/net/ethernet/cavium/liquidio/lio_main.c if (OCTEON_CN23XX_PF(oct)) oct 1923 drivers/net/ethernet/cavium/liquidio/lio_main.c oct->droq[0]->ops.poll_mode = 0; oct 1928 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_info(&oct->pci_dev->dev, "%s interface is stopped\n", netdev->name); oct 1973 drivers/net/ethernet/cavium/liquidio/lio_main.c struct octeon_device *oct = lio->oct_dev; oct 2009 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_err(&oct->pci_dev->dev, "DEVFLAGS change failed in core (ret: 0x%x)\n", oct 2022 drivers/net/ethernet/cavium/liquidio/lio_main.c struct octeon_device *oct = lio->oct_dev; oct 2044 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_err(&oct->pci_dev->dev, "MAC Address change failed\n"); oct 2049 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_err(&oct->pci_dev->dev, oct 2066 drivers/net/ethernet/cavium/liquidio/lio_main.c struct octeon_device *oct; oct 2072 drivers/net/ethernet/cavium/liquidio/lio_main.c oct = lio->oct_dev; oct 2077 drivers/net/ethernet/cavium/liquidio/lio_main.c for (i = 0; i < oct->num_iqs; i++) { oct 2079 drivers/net/ethernet/cavium/liquidio/lio_main.c iq_stats = &oct->instr_queue[iq_no]->stats; oct 2093 drivers/net/ethernet/cavium/liquidio/lio_main.c for (i = 0; i < oct->num_oqs; i++) { oct 2095 drivers/net/ethernet/cavium/liquidio/lio_main.c oq_stats = &oct->droq[oq_no]->stats; oct 2108 drivers/net/ethernet/cavium/liquidio/lio_main.c lstats->multicast = oct->link_stats.fromwire.fw_total_mcast; oct 2109 drivers/net/ethernet/cavium/liquidio/lio_main.c lstats->collisions = oct->link_stats.fromhost.total_collisions; oct 2112 drivers/net/ethernet/cavium/liquidio/lio_main.c lstats->rx_length_errors = oct->link_stats.fromwire.l2_err; oct 2114 drivers/net/ethernet/cavium/liquidio/lio_main.c lstats->rx_crc_errors = oct->link_stats.fromwire.fcs_err; oct 2116 drivers/net/ethernet/cavium/liquidio/lio_main.c lstats->rx_frame_errors = oct->link_stats.fromwire.frame_err; oct 2118 drivers/net/ethernet/cavium/liquidio/lio_main.c lstats->rx_fifo_errors = oct->link_stats.fromwire.fifo_err; oct 2124 drivers/net/ethernet/cavium/liquidio/lio_main.c lstats->tx_aborted_errors = oct->link_stats.fromhost.fw_err_pko; oct 2125 drivers/net/ethernet/cavium/liquidio/lio_main.c lstats->tx_carrier_errors = oct->link_stats.fromhost.fw_err_link; oct 2126 drivers/net/ethernet/cavium/liquidio/lio_main.c lstats->tx_fifo_errors = oct->link_stats.fromhost.fifo_err; oct 2216 drivers/net/ethernet/cavium/liquidio/lio_main.c static void handle_timestamp(struct octeon_device *oct, oct 2229 drivers/net/ethernet/cavium/liquidio/lio_main.c oct = lio->oct_dev; oct 2233 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_err(&oct->pci_dev->dev, "Tx timestamp instruction failed. Status: %llx\n", oct 2251 drivers/net/ethernet/cavium/liquidio/lio_main.c octeon_free_soft_command(oct, sc); oct 2260 drivers/net/ethernet/cavium/liquidio/lio_main.c static inline int send_nic_timestamp_pkt(struct octeon_device *oct, oct 2273 drivers/net/ethernet/cavium/liquidio/lio_main.c sc = octeon_alloc_soft_command_resp(oct, &ndata->cmd, oct 2278 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_err(&oct->pci_dev->dev, "No memory for timestamped data packet\n"); oct 2291 drivers/net/ethernet/cavium/liquidio/lio_main.c if (OCTEON_CN23XX_PF(oct)) oct 2300 drivers/net/ethernet/cavium/liquidio/lio_main.c retval = octeon_send_command(oct, sc->iq_no, ring_doorbell, &sc->cmd, oct 2304 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_err(&oct->pci_dev->dev, "timestamp data packet failed status: %x\n", oct 2306 drivers/net/ethernet/cavium/liquidio/lio_main.c octeon_free_soft_command(oct, sc); oct 2326 drivers/net/ethernet/cavium/liquidio/lio_main.c struct octeon_device *oct; oct 2337 drivers/net/ethernet/cavium/liquidio/lio_main.c oct = lio->oct_dev; oct 2339 drivers/net/ethernet/cavium/liquidio/lio_main.c q_idx = skb_iq(oct, skb); oct 2343 drivers/net/ethernet/cavium/liquidio/lio_main.c stats = &oct->instr_queue[iq_no]->stats; oct 2372 drivers/net/ethernet/cavium/liquidio/lio_main.c if (octnet_iq_is_full(oct, ndata.q_no)) { oct 2404 drivers/net/ethernet/cavium/liquidio/lio_main.c octnet_prepare_pci_cmd(oct, &ndata.cmd, &cmdsetup, tag); oct 2407 drivers/net/ethernet/cavium/liquidio/lio_main.c dptr = dma_map_single(&oct->pci_dev->dev, oct 2411 drivers/net/ethernet/cavium/liquidio/lio_main.c if (dma_mapping_error(&oct->pci_dev->dev, dptr)) { oct 2412 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_err(&oct->pci_dev->dev, "%s DMA mapping error 1\n", oct 2418 drivers/net/ethernet/cavium/liquidio/lio_main.c if (OCTEON_CN23XX_PF(oct)) oct 2443 drivers/net/ethernet/cavium/liquidio/lio_main.c octnet_prepare_pci_cmd(oct, &ndata.cmd, &cmdsetup, tag); oct 2447 drivers/net/ethernet/cavium/liquidio/lio_main.c g->sg[0].ptr[0] = dma_map_single(&oct->pci_dev->dev, oct 2451 drivers/net/ethernet/cavium/liquidio/lio_main.c if (dma_mapping_error(&oct->pci_dev->dev, g->sg[0].ptr[0])) { oct 2452 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_err(&oct->pci_dev->dev, "%s DMA mapping error 2\n", oct 2465 drivers/net/ethernet/cavium/liquidio/lio_main.c skb_frag_dma_map(&oct->pci_dev->dev, oct 2469 drivers/net/ethernet/cavium/liquidio/lio_main.c if (dma_mapping_error(&oct->pci_dev->dev, oct 2471 drivers/net/ethernet/cavium/liquidio/lio_main.c dma_unmap_single(&oct->pci_dev->dev, oct 2477 drivers/net/ethernet/cavium/liquidio/lio_main.c dma_unmap_page(&oct->pci_dev->dev, oct 2482 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_err(&oct->pci_dev->dev, "%s DMA mapping error 3\n", oct 2494 drivers/net/ethernet/cavium/liquidio/lio_main.c if (OCTEON_CN23XX_PF(oct)) oct 2504 drivers/net/ethernet/cavium/liquidio/lio_main.c if (OCTEON_CN23XX_PF(oct)) { oct 2527 drivers/net/ethernet/cavium/liquidio/lio_main.c status = send_nic_timestamp_pkt(oct, &ndata, finfo, xmit_more); oct 2529 drivers/net/ethernet/cavium/liquidio/lio_main.c status = octnet_send_nic_data_pkt(oct, &ndata, xmit_more); oct 2553 drivers/net/ethernet/cavium/liquidio/lio_main.c dma_unmap_single(&oct->pci_dev->dev, dptr, oct 2556 drivers/net/ethernet/cavium/liquidio/lio_main.c octeon_ring_doorbell_locked(oct, iq_no); oct 2583 drivers/net/ethernet/cavium/liquidio/lio_main.c struct octeon_device *oct = lio->oct_dev; oct 2598 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_err(&oct->pci_dev->dev, "Add VLAN filter failed in core (ret: 0x%x)\n", oct 2612 drivers/net/ethernet/cavium/liquidio/lio_main.c struct octeon_device *oct = lio->oct_dev; oct 2627 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_err(&oct->pci_dev->dev, "Del VLAN filter failed in core (ret: 0x%x)\n", oct 2646 drivers/net/ethernet/cavium/liquidio/lio_main.c struct octeon_device *oct = lio->oct_dev; oct 2661 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_err(&oct->pci_dev->dev, oct 2682 drivers/net/ethernet/cavium/liquidio/lio_main.c struct octeon_device *oct = lio->oct_dev; oct 2698 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_err(&oct->pci_dev->dev, oct 2823 drivers/net/ethernet/cavium/liquidio/lio_main.c struct octeon_device *oct = lio->oct_dev; oct 2830 drivers/net/ethernet/cavium/liquidio/lio_main.c if (vfidx < 0 || vfidx >= oct->sriov_info.max_vfs) oct 2851 drivers/net/ethernet/cavium/liquidio/lio_main.c oct->sriov_info.vf_macaddr[vfidx] = nctrl.udd[0]; oct 2853 drivers/net/ethernet/cavium/liquidio/lio_main.c ret = octnet_send_nic_ctrl_pkt(oct, &nctrl); oct 2863 drivers/net/ethernet/cavium/liquidio/lio_main.c struct octeon_device *oct = lio->oct_dev; oct 2866 drivers/net/ethernet/cavium/liquidio/lio_main.c if (vfidx < 0 || vfidx >= oct->sriov_info.num_vfs_alloced) oct 2871 drivers/net/ethernet/cavium/liquidio/lio_main.c cn23xx_tell_vf_its_macaddr_changed(oct, vfidx, mac); oct 2880 drivers/net/ethernet/cavium/liquidio/lio_main.c struct octeon_device *oct = lio->oct_dev; oct 2884 drivers/net/ethernet/cavium/liquidio/lio_main.c if (!(oct->fw_info.app_cap_flags & LIQUIDIO_SPOOFCHK_CAP)) { oct 2890 drivers/net/ethernet/cavium/liquidio/lio_main.c if (vfidx < 0 || vfidx >= oct->sriov_info.num_vfs_alloced) { oct 2896 drivers/net/ethernet/cavium/liquidio/lio_main.c if (oct->sriov_info.vf_spoofchk[vfidx]) oct 2900 drivers/net/ethernet/cavium/liquidio/lio_main.c if (!oct->sriov_info.vf_spoofchk[vfidx]) oct 2916 drivers/net/ethernet/cavium/liquidio/lio_main.c retval = octnet_send_nic_ctrl_pkt(oct, &nctrl); oct 2925 drivers/net/ethernet/cavium/liquidio/lio_main.c oct->sriov_info.vf_spoofchk[vfidx] = enable; oct 2936 drivers/net/ethernet/cavium/liquidio/lio_main.c struct octeon_device *oct = lio->oct_dev; oct 2941 drivers/net/ethernet/cavium/liquidio/lio_main.c if (vfidx < 0 || vfidx >= oct->sriov_info.num_vfs_alloced) oct 2955 drivers/net/ethernet/cavium/liquidio/lio_main.c if (oct->sriov_info.vf_vlantci[vfidx] == vlantci) oct 2972 drivers/net/ethernet/cavium/liquidio/lio_main.c ret = octnet_send_nic_ctrl_pkt(oct, &nctrl); oct 2979 drivers/net/ethernet/cavium/liquidio/lio_main.c oct->sriov_info.vf_vlantci[vfidx] = vlantci; oct 2988 drivers/net/ethernet/cavium/liquidio/lio_main.c struct octeon_device *oct = lio->oct_dev; oct 2991 drivers/net/ethernet/cavium/liquidio/lio_main.c if (vfidx < 0 || vfidx >= oct->sriov_info.num_vfs_alloced) oct 2997 drivers/net/ethernet/cavium/liquidio/lio_main.c macaddr = 2 + (u8 *)&oct->sriov_info.vf_macaddr[vfidx]; oct 2999 drivers/net/ethernet/cavium/liquidio/lio_main.c ivi->vlan = oct->sriov_info.vf_vlantci[vfidx] & VLAN_VID_MASK; oct 3000 drivers/net/ethernet/cavium/liquidio/lio_main.c ivi->qos = oct->sriov_info.vf_vlantci[vfidx] >> VLAN_PRIO_SHIFT; oct 3001 drivers/net/ethernet/cavium/liquidio/lio_main.c if (oct->sriov_info.trusted_vf.active && oct 3002 drivers/net/ethernet/cavium/liquidio/lio_main.c oct->sriov_info.trusted_vf.id == vfidx) oct 3006 drivers/net/ethernet/cavium/liquidio/lio_main.c ivi->linkstate = oct->sriov_info.vf_linkstate[vfidx]; oct 3007 drivers/net/ethernet/cavium/liquidio/lio_main.c ivi->spoofchk = oct->sriov_info.vf_spoofchk[vfidx]; oct 3016 drivers/net/ethernet/cavium/liquidio/lio_main.c struct octeon_device *oct = lio->oct_dev; oct 3020 drivers/net/ethernet/cavium/liquidio/lio_main.c sc = octeon_alloc_soft_command(oct, 0, 16, 0); oct 3027 drivers/net/ethernet/cavium/liquidio/lio_main.c octeon_prepare_soft_command(oct, sc, OPCODE_NIC, oct 3034 drivers/net/ethernet/cavium/liquidio/lio_main.c retval = octeon_send_soft_command(oct, sc); oct 3036 drivers/net/ethernet/cavium/liquidio/lio_main.c octeon_free_soft_command(oct, sc); oct 3040 drivers/net/ethernet/cavium/liquidio/lio_main.c retval = wait_for_sc_completion_timeout(oct, sc, 0); oct 3054 drivers/net/ethernet/cavium/liquidio/lio_main.c struct octeon_device *oct = lio->oct_dev; oct 3056 drivers/net/ethernet/cavium/liquidio/lio_main.c if (strcmp(oct->fw_info.liquidio_firmware_version, "1.7.1") < 0) { oct 3061 drivers/net/ethernet/cavium/liquidio/lio_main.c if (vfidx < 0 || vfidx >= oct->sriov_info.num_vfs_alloced) { oct 3069 drivers/net/ethernet/cavium/liquidio/lio_main.c if (oct->sriov_info.trusted_vf.active && oct 3070 drivers/net/ethernet/cavium/liquidio/lio_main.c oct->sriov_info.trusted_vf.id == vfidx) oct 3073 drivers/net/ethernet/cavium/liquidio/lio_main.c if (oct->sriov_info.trusted_vf.active) { oct 3080 drivers/net/ethernet/cavium/liquidio/lio_main.c if (!oct->sriov_info.trusted_vf.active) oct 3086 drivers/net/ethernet/cavium/liquidio/lio_main.c oct->sriov_info.trusted_vf.id = vfidx; oct 3087 drivers/net/ethernet/cavium/liquidio/lio_main.c oct->sriov_info.trusted_vf.active = true; oct 3089 drivers/net/ethernet/cavium/liquidio/lio_main.c oct->sriov_info.trusted_vf.active = false; oct 3106 drivers/net/ethernet/cavium/liquidio/lio_main.c struct octeon_device *oct = lio->oct_dev; oct 3110 drivers/net/ethernet/cavium/liquidio/lio_main.c if (vfidx < 0 || vfidx >= oct->sriov_info.num_vfs_alloced) oct 3113 drivers/net/ethernet/cavium/liquidio/lio_main.c if (oct->sriov_info.vf_linkstate[vfidx] == linkstate) oct 3125 drivers/net/ethernet/cavium/liquidio/lio_main.c ret = octnet_send_nic_ctrl_pkt(oct, &nctrl); oct 3128 drivers/net/ethernet/cavium/liquidio/lio_main.c oct->sriov_info.vf_linkstate[vfidx] = linkstate; oct 3139 drivers/net/ethernet/cavium/liquidio/lio_main.c struct octeon_device *oct; oct 3142 drivers/net/ethernet/cavium/liquidio/lio_main.c oct = priv->oct; oct 3144 drivers/net/ethernet/cavium/liquidio/lio_main.c *mode = oct->eswitch_mode; oct 3154 drivers/net/ethernet/cavium/liquidio/lio_main.c struct octeon_device *oct; oct 3158 drivers/net/ethernet/cavium/liquidio/lio_main.c oct = priv->oct; oct 3160 drivers/net/ethernet/cavium/liquidio/lio_main.c if (!(oct->fw_info.app_cap_flags & LIQUIDIO_SWITCHDEV_CAP)) oct 3163 drivers/net/ethernet/cavium/liquidio/lio_main.c if (oct->eswitch_mode == mode) oct 3168 drivers/net/ethernet/cavium/liquidio/lio_main.c oct->eswitch_mode = mode; oct 3169 drivers/net/ethernet/cavium/liquidio/lio_main.c ret = lio_vf_rep_create(oct); oct 3173 drivers/net/ethernet/cavium/liquidio/lio_main.c lio_vf_rep_destroy(oct); oct 3174 drivers/net/ethernet/cavium/liquidio/lio_main.c oct->eswitch_mode = mode; oct 3194 drivers/net/ethernet/cavium/liquidio/lio_main.c struct octeon_device *oct = lio->oct_dev; oct 3196 drivers/net/ethernet/cavium/liquidio/lio_main.c if (oct->eswitch_mode != DEVLINK_ESWITCH_MODE_SWITCHDEV) oct 3209 drivers/net/ethernet/cavium/liquidio/lio_main.c struct octeon_device *oct = lio->oct_dev; oct 3213 drivers/net/ethernet/cavium/liquidio/lio_main.c if (vfidx < 0 || vfidx >= oct->sriov_info.num_vfs_alloced) oct 3217 drivers/net/ethernet/cavium/liquidio/lio_main.c ret = cn23xx_get_vf_stats(oct, vfidx, &stats); oct 3307 drivers/net/ethernet/cavium/liquidio/lio_main.c struct octeon_device *oct = (struct octeon_device *)buf; oct 3314 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_err(&oct->pci_dev->dev, "Malformed NIC_INFO, len=%d, ifidx=%d\n", oct 3325 drivers/net/ethernet/cavium/liquidio/lio_main.c for (i = 0; i < oct->ifcount; i++) { oct 3326 drivers/net/ethernet/cavium/liquidio/lio_main.c if (oct->props[i].gmxport == gmxport) { oct 3327 drivers/net/ethernet/cavium/liquidio/lio_main.c update_link_status(oct->props[i].netdev, ls); oct 3775 drivers/net/ethernet/cavium/liquidio/lio_main.c lio_devlink->oct = octeon_dev; oct 3803 drivers/net/ethernet/cavium/liquidio/lio_main.c static int octeon_enable_sriov(struct octeon_device *oct) oct 3805 drivers/net/ethernet/cavium/liquidio/lio_main.c unsigned int num_vfs_alloced = oct->sriov_info.num_vfs_alloced; oct 3810 drivers/net/ethernet/cavium/liquidio/lio_main.c if (OCTEON_CN23XX_PF(oct) && num_vfs_alloced) { oct 3811 drivers/net/ethernet/cavium/liquidio/lio_main.c err = pci_enable_sriov(oct->pci_dev, oct 3812 drivers/net/ethernet/cavium/liquidio/lio_main.c oct->sriov_info.num_vfs_alloced); oct 3814 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_err(&oct->pci_dev->dev, oct 3817 drivers/net/ethernet/cavium/liquidio/lio_main.c oct->sriov_info.num_vfs_alloced = 0; oct 3820 drivers/net/ethernet/cavium/liquidio/lio_main.c oct->sriov_info.sriov_enabled = 1; oct 3830 drivers/net/ethernet/cavium/liquidio/lio_main.c (vfdev->physfn == oct->pci_dev)) { oct 3831 drivers/net/ethernet/cavium/liquidio/lio_main.c oct->sriov_info.dpiring_to_vfpcidev_lut[u] = oct 3833 drivers/net/ethernet/cavium/liquidio/lio_main.c u += oct->sriov_info.rings_per_vf; oct 3843 drivers/net/ethernet/cavium/liquidio/lio_main.c static int lio_pci_sriov_disable(struct octeon_device *oct) oct 3847 drivers/net/ethernet/cavium/liquidio/lio_main.c if (pci_vfs_assigned(oct->pci_dev)) { oct 3848 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_err(&oct->pci_dev->dev, "VFs are still assigned to VMs.\n"); oct 3852 drivers/net/ethernet/cavium/liquidio/lio_main.c pci_disable_sriov(oct->pci_dev); oct 3856 drivers/net/ethernet/cavium/liquidio/lio_main.c oct->sriov_info.dpiring_to_vfpcidev_lut[u] = NULL; oct 3857 drivers/net/ethernet/cavium/liquidio/lio_main.c u += oct->sriov_info.rings_per_vf; oct 3860 drivers/net/ethernet/cavium/liquidio/lio_main.c oct->sriov_info.num_vfs_alloced = 0; oct 3861 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_info(&oct->pci_dev->dev, "oct->pf_num:%d disabled VFs\n", oct 3862 drivers/net/ethernet/cavium/liquidio/lio_main.c oct->pf_num); oct 3869 drivers/net/ethernet/cavium/liquidio/lio_main.c struct octeon_device *oct = pci_get_drvdata(dev); oct 3872 drivers/net/ethernet/cavium/liquidio/lio_main.c if ((num_vfs == oct->sriov_info.num_vfs_alloced) && oct 3873 drivers/net/ethernet/cavium/liquidio/lio_main.c (oct->sriov_info.sriov_enabled)) { oct 3874 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_info(&oct->pci_dev->dev, "oct->pf_num:%d already enabled num_vfs:%d\n", oct 3875 drivers/net/ethernet/cavium/liquidio/lio_main.c oct->pf_num, num_vfs); oct 3880 drivers/net/ethernet/cavium/liquidio/lio_main.c lio_vf_rep_destroy(oct); oct 3881 drivers/net/ethernet/cavium/liquidio/lio_main.c ret = lio_pci_sriov_disable(oct); oct 3882 drivers/net/ethernet/cavium/liquidio/lio_main.c } else if (num_vfs > oct->sriov_info.max_vfs) { oct 3883 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_err(&oct->pci_dev->dev, oct 3885 drivers/net/ethernet/cavium/liquidio/lio_main.c oct->sriov_info.max_vfs, num_vfs); oct 3888 drivers/net/ethernet/cavium/liquidio/lio_main.c oct->sriov_info.num_vfs_alloced = num_vfs; oct 3889 drivers/net/ethernet/cavium/liquidio/lio_main.c ret = octeon_enable_sriov(oct); oct 3890 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_info(&oct->pci_dev->dev, "oct->pf_num:%d num_vfs:%d\n", oct 3891 drivers/net/ethernet/cavium/liquidio/lio_main.c oct->pf_num, num_vfs); oct 3892 drivers/net/ethernet/cavium/liquidio/lio_main.c ret = lio_vf_rep_create(oct); oct 3894 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_info(&oct->pci_dev->dev, oct 3909 drivers/net/ethernet/cavium/liquidio/lio_main.c static int liquidio_init_nic_module(struct octeon_device *oct) oct 3912 drivers/net/ethernet/cavium/liquidio/lio_main.c int num_nic_ports = CFG_GET_NUM_NIC_PORTS(octeon_get_conf(oct)); oct 3914 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_dbg(&oct->pci_dev->dev, "Initializing network interfaces\n"); oct 3920 drivers/net/ethernet/cavium/liquidio/lio_main.c oct->ifcount = num_nic_ports; oct 3922 drivers/net/ethernet/cavium/liquidio/lio_main.c memset(oct->props, 0, sizeof(struct octdev_props) * num_nic_ports); oct 3925 drivers/net/ethernet/cavium/liquidio/lio_main.c oct->props[i].gmxport = -1; oct 3927 drivers/net/ethernet/cavium/liquidio/lio_main.c retval = setup_nic_devices(oct); oct 3929 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_err(&oct->pci_dev->dev, "Setup NIC devices failed\n"); oct 3936 drivers/net/ethernet/cavium/liquidio/lio_main.c if (!oct->octeon_id && oct 3937 drivers/net/ethernet/cavium/liquidio/lio_main.c oct->fw_info.app_cap_flags & LIQUIDIO_SWITCHDEV_CAP) { oct 3940 drivers/net/ethernet/cavium/liquidio/lio_main.c liquidio_stop_nic_module(oct); oct 3945 drivers/net/ethernet/cavium/liquidio/lio_main.c liquidio_ptp_init(oct); oct 3947 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_dbg(&oct->pci_dev->dev, "Network interfaces ready\n"); oct 3953 drivers/net/ethernet/cavium/liquidio/lio_main.c oct->ifcount = 0; oct 3965 drivers/net/ethernet/cavium/liquidio/lio_main.c struct octeon_device *oct; oct 3968 drivers/net/ethernet/cavium/liquidio/lio_main.c oct = (struct octeon_device *)wk->ctxptr; oct 3970 drivers/net/ethernet/cavium/liquidio/lio_main.c if (atomic_read(&oct->status) == OCT_DEV_RUNNING) oct 3978 drivers/net/ethernet/cavium/liquidio/lio_main.c if (atomic_read(&oct->status) != OCT_DEV_CORE_OK) { oct 3979 drivers/net/ethernet/cavium/liquidio/lio_main.c schedule_delayed_work(&oct->nic_poll_work.work, oct 3984 drivers/net/ethernet/cavium/liquidio/lio_main.c atomic_set(&oct->status, OCT_DEV_RUNNING); oct 3986 drivers/net/ethernet/cavium/liquidio/lio_main.c if (oct->app_mode && oct->app_mode == CVM_DRV_NIC_APP) { oct 3987 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_dbg(&oct->pci_dev->dev, "Starting NIC module\n"); oct 3989 drivers/net/ethernet/cavium/liquidio/lio_main.c if (liquidio_init_nic_module(oct)) oct 3990 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_err(&oct->pci_dev->dev, "NIC initialization failed\n"); oct 3992 drivers/net/ethernet/cavium/liquidio/lio_main.c handshake[oct->octeon_id].started_ok = 1; oct 3994 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_err(&oct->pci_dev->dev, oct 3996 drivers/net/ethernet/cavium/liquidio/lio_main.c oct->app_mode); oct 3999 drivers/net/ethernet/cavium/liquidio/lio_main.c complete(&handshake[oct->octeon_id].started); oct 4005 drivers/net/ethernet/cavium/liquidio/lio_main.c struct octeon_device *oct = (struct octeon_device *)buf; oct 4019 drivers/net/ethernet/cavium/liquidio/lio_main.c cores_crashed = READ_ONCE(oct->cores_crashed); oct 4022 drivers/net/ethernet/cavium/liquidio/lio_main.c if (!(oct->sriov_info.vf_drv_loaded_mask & BIT_ULL(vf_idx))) { oct 4023 drivers/net/ethernet/cavium/liquidio/lio_main.c oct->sriov_info.vf_drv_loaded_mask |= BIT_ULL(vf_idx); oct 4024 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_info(&oct->pci_dev->dev, oct 4030 drivers/net/ethernet/cavium/liquidio/lio_main.c if (oct->sriov_info.vf_drv_loaded_mask & BIT_ULL(vf_idx)) { oct 4031 drivers/net/ethernet/cavium/liquidio/lio_main.c oct->sriov_info.vf_drv_loaded_mask &= ~BIT_ULL(vf_idx); oct 4032 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_info(&oct->pci_dev->dev, oct 4040 drivers/net/ethernet/cavium/liquidio/lio_main.c oct->sriov_info.vf_macaddr[vf_idx] = data[1]; oct 4041 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_info(&oct->pci_dev->dev, oct 4346 drivers/net/ethernet/cavium/liquidio/lio_main.c static int octeon_dbg_console_print(struct octeon_device *oct, u32 console_num, oct 4350 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_info(&oct->pci_dev->dev, "%u: %s%s\n", console_num, prefix, oct 4353 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_info(&oct->pci_dev->dev, "%u: %s\n", console_num, prefix); oct 4355 drivers/net/ethernet/cavium/liquidio/lio_main.c dev_info(&oct->pci_dev->dev, "%u: %s\n", console_num, suffix); oct 71 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c static int octeon_device_init(struct octeon_device *oct); oct 74 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c static int lio_wait_for_oq_pkts(struct octeon_device *oct) oct 77 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c (struct octeon_device_priv *)oct->priv; oct 85 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c for (i = 0; i < MAX_OCTEON_OUTPUT_QUEUES(oct); i++) { oct 86 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c if (!(oct->io_qmask.oq & BIT_ULL(i))) oct 88 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c pkt_cnt += octeon_droq_check_hw_for_pkts(oct->droq[i]); oct 106 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c static void pcierror_quiesce_device(struct octeon_device *oct) oct 118 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c if (wait_for_pending_requests(oct)) oct 119 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c dev_err(&oct->pci_dev->dev, "There were pending requests\n"); oct 122 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c for (i = 0; i < MAX_OCTEON_INSTR_QUEUES(oct); i++) { oct 125 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c if (!(oct->io_qmask.iq & BIT_ULL(i))) oct 127 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c iq = oct->instr_queue[i]; oct 135 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c lio_process_iq_request_list(oct, iq, 0); oct 141 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c lio_process_ordered_list(oct, 1); oct 170 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c static void stop_pci_io(struct octeon_device *oct) oct 176 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c atomic_set(&oct->status, OCT_DEV_IN_RESET); oct 178 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c for (i = 0; i < oct->ifcount; i++) oct 179 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c netif_device_detach(oct->props[i].netdev); oct 182 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c oct->fn_list.disable_interrupt(oct, OCTEON_ALL_INTR); oct 184 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c pcierror_quiesce_device(oct); oct 185 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c if (oct->msix_on) { oct 186 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c msix_entries = (struct msix_entry *)oct->msix_entries; oct 187 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c for (i = 0; i < oct->num_msix_irqs; i++) { oct 192 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c &oct->ioq_vector[i]); oct 194 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c pci_disable_msix(oct->pci_dev); oct 195 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c kfree(oct->msix_entries); oct 196 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c oct->msix_entries = NULL; oct 197 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c octeon_free_ioq_vector(oct); oct 199 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c dev_dbg(&oct->pci_dev->dev, "Device state is now %s\n", oct 200 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c lio_get_state_string(&oct->status)); oct 203 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c cleanup_aer_uncorrect_error_status(oct->pci_dev); oct 205 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c pci_disable_device(oct->pci_dev); oct 219 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c struct octeon_device *oct = pci_get_drvdata(pdev); oct 223 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c dev_err(&oct->pci_dev->dev, "Non-correctable non-fatal error reported:\n"); oct 224 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c cleanup_aer_uncorrect_error_status(oct->pci_dev); oct 229 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c dev_err(&oct->pci_dev->dev, "Non-correctable FATAL reported by PCI AER driver\n"); oct 230 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c stop_pci_io(oct); oct 306 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c struct octeon_device *oct = lio->oct_dev; oct 311 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c dev_err(&oct->pci_dev->dev, "unable to create cavium link status wq\n"); oct 344 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c struct octeon_device *oct = lio->oct_dev; oct 361 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c dev_info(&oct->pci_dev->dev, oct 368 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c dev_warn(&oct->pci_dev->dev, oct 423 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c static void octeon_pci_flr(struct octeon_device *oct) oct 425 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c pci_save_state(oct->pci_dev); oct 427 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c pci_cfg_access_lock(oct->pci_dev); oct 430 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c pci_write_config_word(oct->pci_dev, PCI_COMMAND, oct 433 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c pcie_flr(oct->pci_dev); oct 435 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c pci_cfg_access_unlock(oct->pci_dev); oct 437 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c pci_restore_state(oct->pci_dev); oct 445 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c static void octeon_destroy_resources(struct octeon_device *oct) oct 448 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c (struct octeon_device_priv *)oct->priv; oct 452 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c switch (atomic_read(&oct->status)) { oct 456 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c atomic_set(&oct->status, OCT_DEV_IN_RESET); oct 458 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c oct->app_mode = CVM_DRV_INVALID_APP; oct 459 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c dev_dbg(&oct->pci_dev->dev, "Device state is now %s\n", oct 460 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c lio_get_state_string(&oct->status)); oct 468 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c if (lio_wait_for_instr_fetch(oct)) oct 469 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c dev_err(&oct->pci_dev->dev, "IQ had pending instructions\n"); oct 471 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c if (wait_for_pending_requests(oct)) oct 472 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c dev_err(&oct->pci_dev->dev, "There were pending requests\n"); oct 478 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c oct->fn_list.disable_io_queues(oct); oct 480 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c if (lio_wait_for_oq_pkts(oct)) oct 481 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c dev_err(&oct->pci_dev->dev, "OQ had pending packets\n"); oct 486 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c for (i = 0; i < MAX_OCTEON_INSTR_QUEUES(oct); i++) { oct 489 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c if (!(oct->io_qmask.iq & BIT_ULL(i))) oct 491 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c iq = oct->instr_queue[i]; oct 499 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c lio_process_iq_request_list(oct, iq, 0); oct 504 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c lio_process_ordered_list(oct, 1); oct 505 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c octeon_free_sc_done_list(oct); oct 506 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c octeon_free_sc_zombie_list(oct); oct 511 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c oct->fn_list.disable_interrupt(oct, OCTEON_ALL_INTR); oct 513 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c if (oct->msix_on) { oct 514 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c msix_entries = (struct msix_entry *)oct->msix_entries; oct 515 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c for (i = 0; i < oct->num_msix_irqs; i++) { oct 516 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c if (oct->ioq_vector[i].vector) { oct 521 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c &oct->ioq_vector[i]); oct 522 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c oct->ioq_vector[i].vector = 0; oct 525 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c pci_disable_msix(oct->pci_dev); oct 526 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c kfree(oct->msix_entries); oct 527 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c oct->msix_entries = NULL; oct 528 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c kfree(oct->irq_name_storage); oct 529 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c oct->irq_name_storage = NULL; oct 532 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c if (oct->pci_dev->reset_fn) oct 533 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c octeon_pci_flr(oct); oct 535 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c cn23xx_vf_ask_pf_to_do_flr(oct); oct 539 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c octeon_free_ioq_vector(oct); oct 543 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c oct->fn_list.free_mbox(oct); oct 549 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c for (i = 0; i < MAX_OCTEON_OUTPUT_QUEUES(oct); i++) { oct 550 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c if (!(oct->io_qmask.oq & BIT_ULL(i))) oct 552 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c octeon_delete_droq(oct, i); oct 557 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c octeon_delete_response_list(oct); oct 561 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c for (i = 0; i < MAX_OCTEON_INSTR_QUEUES(oct); i++) { oct 562 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c if (!(oct->io_qmask.iq & BIT_ULL(i))) oct 564 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c octeon_delete_instr_queue(oct, i); oct 569 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c octeon_free_sc_buffer_pool(oct); oct 573 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c octeon_delete_dispatch_list(oct); oct 574 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c cancel_delayed_work_sync(&oct->nic_poll_work.work); oct 578 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c octeon_unmap_pci_barx(oct, 0); oct 579 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c octeon_unmap_pci_barx(oct, 1); oct 583 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c pci_clear_master(oct->pci_dev); oct 585 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c pci_disable_device(oct->pci_dev); oct 603 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c struct octeon_device *oct = (struct octeon_device *)lio->oct_dev; oct 608 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c if (oct->props[lio->ifidx].rx_on == start_stop) oct 612 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c octeon_alloc_soft_command(oct, OCTNET_CMD_SIZE, oct 625 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c octeon_prepare_soft_command(oct, sc, OPCODE_NIC, oct 631 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c retval = octeon_send_soft_command(oct, sc); oct 634 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c octeon_free_soft_command(oct, sc); oct 639 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c retval = wait_for_sc_completion_timeout(oct, sc, 0); oct 643 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c oct->props[lio->ifidx].rx_on = start_stop; oct 656 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c static void liquidio_destroy_nic_device(struct octeon_device *oct, int ifidx) oct 658 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c struct net_device *netdev = oct->props[ifidx].netdev; oct 660 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c (struct octeon_device_priv *)oct->priv; oct 665 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c dev_err(&oct->pci_dev->dev, "%s No netdevice ptr for index %d\n", oct 672 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c dev_dbg(&oct->pci_dev->dev, "NIC device cleanup\n"); oct 677 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c if (oct->props[lio->ifidx].napi_enabled == 1) { oct 681 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c oct->props[lio->ifidx].napi_enabled = 0; oct 683 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c oct->droq[0]->ops.poll_mode = 0; oct 703 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c oct->props[ifidx].gmxport = -1; oct 705 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c oct->props[ifidx].netdev = NULL; oct 712 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c static int liquidio_stop_nic_module(struct octeon_device *oct) oct 717 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c dev_dbg(&oct->pci_dev->dev, "Stopping network interfaces\n"); oct 718 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c if (!oct->ifcount) { oct 719 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c dev_err(&oct->pci_dev->dev, "Init for Octeon was not completed\n"); oct 723 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c spin_lock_bh(&oct->cmd_resp_wqlock); oct 724 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c oct->cmd_resp_state = OCT_DRV_OFFLINE; oct 725 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c spin_unlock_bh(&oct->cmd_resp_wqlock); oct 727 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c for (i = 0; i < oct->ifcount; i++) { oct 728 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c lio = GET_LIO(oct->props[i].netdev); oct 729 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c for (j = 0; j < oct->num_oqs; j++) oct 730 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c octeon_unregister_droq_ops(oct, oct 734 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c for (i = 0; i < oct->ifcount; i++) oct 735 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c liquidio_destroy_nic_device(oct, i); oct 737 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c dev_dbg(&oct->pci_dev->dev, "Network interfaces stopped\n"); oct 771 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c static int octeon_pci_os_setup(struct octeon_device *oct) oct 775 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c if (!oct->pci_dev->physfn) oct 776 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c octeon_pci_flr(oct); oct 779 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c if (pci_enable_device(oct->pci_dev)) { oct 780 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c dev_err(&oct->pci_dev->dev, "pci_enable_device failed\n"); oct 784 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c if (dma_set_mask_and_coherent(&oct->pci_dev->dev, DMA_BIT_MASK(64))) { oct 785 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c dev_err(&oct->pci_dev->dev, "Unexpected DMA device capability\n"); oct 786 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c pci_disable_device(oct->pci_dev); oct 791 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c pci_set_master(oct->pci_dev); oct 908 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c struct octeon_device *oct = lio->oct_dev; oct 910 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c (struct octeon_device_priv *)oct->priv; oct 913 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c if (!oct->props[lio->ifidx].napi_enabled) { oct 919 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c oct->props[lio->ifidx].napi_enabled = 1; oct 921 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c oct->droq[0]->ops.poll_mode = 1; oct 940 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c dev_info(&oct->pci_dev->dev, "%s interface is opened\n", netdev->name); oct 952 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c struct octeon_device *oct = lio->oct_dev; oct 954 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c (struct octeon_device_priv *)oct->priv; oct 973 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c if (lio_wait_for_clean_oq(oct)) oct 977 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c if (oct->props[lio->ifidx].napi_enabled == 1) { oct 981 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c oct->props[lio->ifidx].napi_enabled = 0; oct 983 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c oct->droq[0]->ops.poll_mode = 0; oct 990 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c dev_info(&oct->pci_dev->dev, "%s interface is stopped\n", netdev->name); oct 1031 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c struct octeon_device *oct = lio->oct_dev; oct 1040 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c dev_err(&oct->pci_dev->dev, "too many MAC addresses in netdev uc list\n"); oct 1049 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c nctrl.ncmd.s.param1 = oct->vf_num; oct 1072 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c struct octeon_device *oct = lio->oct_dev; oct 1107 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c dev_err(&oct->pci_dev->dev, "DEVFLAGS change failed in core (ret: 0x%x)\n", oct 1122 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c struct octeon_device *oct = lio->oct_dev; oct 1150 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c dev_err(&oct->pci_dev->dev, "MAC Address change failed\n"); oct 1156 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c dev_err(&oct->pci_dev->dev, "MAC Address change failed: no permission\n"); oct 1171 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c struct octeon_device *oct; oct 1177 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c oct = lio->oct_dev; oct 1182 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c for (i = 0; i < oct->num_iqs; i++) { oct 1184 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c iq_stats = &oct->instr_queue[iq_no]->stats; oct 1198 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c for (i = 0; i < oct->num_oqs; i++) { oct 1200 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c oq_stats = &oct->droq[oq_no]->stats; oct 1213 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c lstats->multicast = oct->link_stats.fromwire.fw_total_mcast; oct 1216 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c lstats->rx_length_errors = oct->link_stats.fromwire.l2_err; oct 1218 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c lstats->rx_crc_errors = oct->link_stats.fromwire.fcs_err; oct 1220 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c lstats->rx_frame_errors = oct->link_stats.fromwire.frame_err; oct 1226 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c lstats->tx_aborted_errors = oct->link_stats.fromhost.fw_err_pko; oct 1227 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c lstats->tx_carrier_errors = oct->link_stats.fromhost.fw_err_link; oct 1307 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c static void handle_timestamp(struct octeon_device *oct, u32 status, void *buf) oct 1318 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c oct = lio->oct_dev; oct 1322 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c dev_err(&oct->pci_dev->dev, "Tx timestamp instruction failed. Status: %llx\n", oct 1340 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c octeon_free_soft_command(oct, sc); oct 1349 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c static int send_nic_timestamp_pkt(struct octeon_device *oct, oct 1362 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c sc = octeon_alloc_soft_command_resp(oct, &ndata->cmd, oct 1367 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c dev_err(&oct->pci_dev->dev, "No memory for timestamped data packet\n"); oct 1384 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c retval = octeon_send_command(oct, sc->iq_no, ring_doorbell, &sc->cmd, oct 1388 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c dev_err(&oct->pci_dev->dev, "timestamp data packet failed status: %x\n", oct 1390 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c octeon_free_soft_command(oct, sc); oct 1411 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c struct octeon_device *oct; oct 1422 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c oct = lio->oct_dev; oct 1428 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c stats = &oct->instr_queue[iq_no]->stats; oct 1455 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c if (octnet_iq_is_full(oct, ndata.q_no)) { oct 1483 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c octnet_prepare_pci_cmd(oct, &ndata.cmd, &cmdsetup, tag); oct 1485 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c dptr = dma_map_single(&oct->pci_dev->dev, oct 1489 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c if (dma_mapping_error(&oct->pci_dev->dev, dptr)) { oct 1490 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c dev_err(&oct->pci_dev->dev, "%s DMA mapping error 1\n", oct 1517 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c octnet_prepare_pci_cmd(oct, &ndata.cmd, &cmdsetup, tag); oct 1521 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c g->sg[0].ptr[0] = dma_map_single(&oct->pci_dev->dev, oct 1525 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c if (dma_mapping_error(&oct->pci_dev->dev, g->sg[0].ptr[0])) { oct 1526 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c dev_err(&oct->pci_dev->dev, "%s DMA mapping error 2\n", oct 1538 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c skb_frag_dma_map(&oct->pci_dev->dev, oct 1541 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c if (dma_mapping_error(&oct->pci_dev->dev, oct 1543 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c dma_unmap_single(&oct->pci_dev->dev, oct 1549 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c dma_unmap_page(&oct->pci_dev->dev, oct 1554 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c dev_err(&oct->pci_dev->dev, "%s DMA mapping error 3\n", oct 1590 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c status = send_nic_timestamp_pkt(oct, &ndata, finfo, xmit_more); oct 1592 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c status = octnet_send_nic_data_pkt(oct, &ndata, xmit_more); oct 1599 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c dev_err(&oct->pci_dev->dev, "Rcvd IQ_SEND_STOP signal; stopping IQ-%d\n", oct 1619 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c dma_unmap_single(&oct->pci_dev->dev, dptr, oct 1622 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c octeon_ring_doorbell_locked(oct, iq_no); oct 1649 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c struct octeon_device *oct = lio->oct_dev; oct 1664 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c dev_err(&oct->pci_dev->dev, "Add VLAN filter failed in core (ret: 0x%x)\n", oct 1677 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c struct octeon_device *oct = lio->oct_dev; oct 1692 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c dev_err(&oct->pci_dev->dev, "Del VLAN filter failed in core (ret: 0x%x)\n", oct 1711 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c struct octeon_device *oct = lio->oct_dev; oct 1726 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c dev_err(&oct->pci_dev->dev, "DEVFLAGS RXCSUM change failed in core (ret:0x%x)\n", oct 1746 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c struct octeon_device *oct = lio->oct_dev; oct 1762 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c dev_err(&oct->pci_dev->dev, oct 1883 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c struct octeon_device *oct = (struct octeon_device *)buf; oct 1890 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c dev_err(&oct->pci_dev->dev, "Malformed NIC_INFO, len=%d, ifidx=%d\n", oct 1902 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c for (i = 0; i < oct->ifcount; i++) { oct 1903 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c if (oct->props[i].gmxport == gmxport) { oct 1904 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c update_link_status(oct->props[i].netdev, ls); oct 2233 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c static int liquidio_init_nic_module(struct octeon_device *oct) oct 2238 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c dev_dbg(&oct->pci_dev->dev, "Initializing network interfaces\n"); oct 2243 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c oct->ifcount = num_nic_ports; oct 2244 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c memset(oct->props, 0, oct 2248 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c oct->props[i].gmxport = -1; oct 2250 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c retval = setup_nic_devices(oct); oct 2252 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c dev_err(&oct->pci_dev->dev, "Setup NIC devices failed\n"); oct 2256 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c dev_dbg(&oct->pci_dev->dev, "Network interfaces ready\n"); oct 2262 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c oct->ifcount = 0; oct 2271 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c static int octeon_device_init(struct octeon_device *oct) oct 2276 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c atomic_set(&oct->status, OCT_DEV_BEGIN_STATE); oct 2281 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c if (octeon_pci_os_setup(oct)) oct 2283 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c atomic_set(&oct->status, OCT_DEV_PCI_ENABLE_DONE); oct 2285 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c oct->chip_id = OCTEON_CN23XX_VF_VID; oct 2286 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c pci_read_config_dword(oct->pci_dev, 8, &rev_id); oct 2287 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c oct->rev_id = rev_id & 0xff; oct 2289 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c if (cn23xx_setup_octeon_vf_device(oct)) oct 2292 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c atomic_set(&oct->status, OCT_DEV_PCI_MAP_DONE); oct 2294 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c oct->app_mode = CVM_DRV_NIC_APP; oct 2299 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c if (octeon_init_dispatch_list(oct)) oct 2302 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c atomic_set(&oct->status, OCT_DEV_DISPATCH_INIT_DONE); oct 2304 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c if (octeon_set_io_queues_off(oct)) { oct 2305 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c dev_err(&oct->pci_dev->dev, "setting io queues off failed\n"); oct 2309 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c if (oct->fn_list.setup_device_regs(oct)) { oct 2310 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c dev_err(&oct->pci_dev->dev, "device registers configuration failed\n"); oct 2315 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c if (octeon_setup_sc_buffer_pool(oct)) { oct 2316 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c dev_err(&oct->pci_dev->dev, "sc buffer pool allocation failed\n"); oct 2319 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c atomic_set(&oct->status, OCT_DEV_SC_BUFF_POOL_INIT_DONE); oct 2322 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c if (octeon_setup_instr_queues(oct)) { oct 2323 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c dev_err(&oct->pci_dev->dev, "instruction queue initialization failed\n"); oct 2326 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c atomic_set(&oct->status, OCT_DEV_INSTR_QUEUE_INIT_DONE); oct 2331 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c if (octeon_setup_response_list(oct)) { oct 2332 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c dev_err(&oct->pci_dev->dev, "Response list allocation failed\n"); oct 2335 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c atomic_set(&oct->status, OCT_DEV_RESP_LIST_INIT_DONE); oct 2337 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c if (octeon_setup_output_queues(oct)) { oct 2338 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c dev_err(&oct->pci_dev->dev, "Output queue initialization failed\n"); oct 2341 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c atomic_set(&oct->status, OCT_DEV_DROQ_INIT_DONE); oct 2343 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c if (oct->fn_list.setup_mbox(oct)) { oct 2344 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c dev_err(&oct->pci_dev->dev, "Mailbox setup failed\n"); oct 2347 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c atomic_set(&oct->status, OCT_DEV_MBOX_SETUP_DONE); oct 2349 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c if (octeon_allocate_ioq_vector(oct, oct->sriov_info.rings_per_vf)) { oct 2350 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c dev_err(&oct->pci_dev->dev, "ioq vector allocation failed\n"); oct 2353 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c atomic_set(&oct->status, OCT_DEV_MSIX_ALLOC_VECTOR_DONE); oct 2355 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c dev_info(&oct->pci_dev->dev, "OCTEON_CN23XX VF Version: %s, %d ioqs\n", oct 2356 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c LIQUIDIO_VERSION, oct->sriov_info.rings_per_vf); oct 2359 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c if (octeon_setup_interrupt(oct, oct->sriov_info.rings_per_vf)) oct 2362 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c atomic_set(&oct->status, OCT_DEV_INTR_SET_DONE); oct 2372 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c oct->fn_list.enable_interrupt(oct, OCTEON_ALL_INTR); oct 2374 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c if (cn23xx_octeon_pfvf_handshake(oct)) oct 2382 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c oct->fn_list.enable_interrupt(oct, OCTEON_ALL_INTR); oct 2386 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c if (oct->fn_list.enable_io_queues(oct)) { oct 2387 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c dev_err(&oct->pci_dev->dev, "enabling io queues failed\n"); oct 2391 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c atomic_set(&oct->status, OCT_DEV_IO_QUEUES_DONE); oct 2393 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c atomic_set(&oct->status, OCT_DEV_HOST_OK); oct 2398 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c for (j = 0; j < oct->num_oqs; j++) oct 2399 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c writel(oct->droq[j]->max_count, oct->droq[j]->pkts_credit_reg); oct 2403 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c atomic_set(&oct->status, OCT_DEV_CORE_OK); oct 2405 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c atomic_set(&oct->status, OCT_DEV_RUNNING); oct 2407 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c if (liquidio_init_nic_module(oct)) oct 55 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c lio_vf_rep_send_soft_command(struct octeon_device *oct, oct 66 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c octeon_alloc_soft_command(oct, req_size, oct 82 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c octeon_prepare_soft_command(oct, sc, OPCODE_NIC, oct 85 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c err = octeon_send_soft_command(oct, sc); oct 89 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c err = wait_for_sc_completion_timeout(oct, sc, 0); oct 95 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c dev_err(&oct->pci_dev->dev, "VF rep send config failed\n"); oct 103 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c octeon_free_soft_command(oct, sc); oct 113 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c struct octeon_device *oct; oct 116 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c oct = vf_rep->oct; oct 123 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c ret = lio_vf_rep_send_soft_command(oct, &rep_cfg, oct 127 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c dev_err(&oct->pci_dev->dev, oct 146 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c struct octeon_device *oct; oct 149 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c oct = vf_rep->oct; oct 156 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c ret = lio_vf_rep_send_soft_command(oct, &rep_cfg, oct 160 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c dev_err(&oct->pci_dev->dev, oct 203 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c struct octeon_device *oct; oct 206 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c oct = vf_rep->oct; oct 213 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c ret = lio_vf_rep_send_soft_command(oct, &rep_cfg, oct 216 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c dev_err(&oct->pci_dev->dev, oct 231 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c struct octeon_device *oct = vf_rep->oct; oct 234 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c ret = snprintf(buf, len, "pf%dvf%d", oct->pf_num, oct 235 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c vf_rep->ifidx - oct->pf_num * 64 - 1); oct 243 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c lio_vf_rep_get_ndev(struct octeon_device *oct, int ifidx) oct 248 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c if (ifidx <= oct->pf_num * max_vfs || oct 249 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c ifidx >= oct->pf_num * max_vfs + max_vfs) oct 257 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c return oct->vf_rep_list.ndev[vf_id]; oct 261 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c lio_vf_rep_copy_packet(struct octeon_device *oct, oct 299 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c struct octeon_device *oct; oct 304 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c oct = lio_get_device(recv_pkt->octeon_id); oct 305 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c if (!oct) oct 312 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c vf_ndev = lio_vf_rep_get_ndev(oct, ifidx); oct 326 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c lio_vf_rep_copy_packet(oct, skb, recv_pkt->buffer_size[0]); oct 348 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c lio_vf_rep_packet_sent_callback(struct octeon_device *oct, oct 356 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c dma_unmap_single(&oct->pci_dev->dev, sc->dmadptr, oct 360 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c octeon_free_soft_command(oct, sc); oct 362 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c if (octnet_iq_is_full(oct, iq_no)) oct 374 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c struct octeon_device *oct = vf_rep->oct; oct 386 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c if (octnet_iq_is_full(vf_rep->oct, parent_lio->txq)) { oct 387 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c dev_err(&oct->pci_dev->dev, "VF rep: Device IQ full\n"); oct 393 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c octeon_alloc_soft_command(oct, 0, 16, 0); oct 395 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c dev_err(&oct->pci_dev->dev, "VF rep: Soft command alloc failed\n"); oct 401 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c dev_err(&oct->pci_dev->dev, "VF rep: nr_frags != 0. Dropping packet\n"); oct 402 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c octeon_free_soft_command(oct, sc); oct 406 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c sc->dmadptr = dma_map_single(&oct->pci_dev->dev, oct 408 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c if (dma_mapping_error(&oct->pci_dev->dev, sc->dmadptr)) { oct 409 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c dev_err(&oct->pci_dev->dev, "VF rep: DMA mapping failed\n"); oct 410 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c octeon_free_soft_command(oct, sc); oct 419 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c octeon_prepare_soft_command(oct, sc, OPCODE_NIC, OPCODE_NIC_VF_REP_PKT, oct 427 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c status = octeon_send_soft_command(oct, sc); oct 429 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c dma_unmap_single(&oct->pci_dev->dev, sc->dmadptr, oct 431 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c octeon_free_soft_command(oct, sc); oct 468 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c struct octeon_device *oct; oct 471 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c oct = vf_rep->oct; oct 477 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c ret = lio_vf_rep_send_soft_command(oct, &rep_cfg, sizeof(rep_cfg), oct 490 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c lio_vf_rep_create(struct octeon_device *oct) oct 496 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c if (oct->eswitch_mode != DEVLINK_ESWITCH_MODE_SWITCHDEV) oct 499 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c if (!oct->sriov_info.sriov_enabled) oct 502 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c num_vfs = oct->sriov_info.num_vfs_alloced; oct 504 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c oct->vf_rep_list.num_vfs = 0; oct 509 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c dev_err(&oct->pci_dev->dev, oct 522 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c vf_rep->oct = oct; oct 523 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c vf_rep->parent_ndev = oct->props[0].netdev; oct 524 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c vf_rep->ifidx = (oct->pf_num * 64) + i + 1; oct 529 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c dev_err(&oct->pci_dev->dev, "VF rep nerdev registration failed\n"); oct 543 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c oct->vf_rep_list.num_vfs++; oct 544 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c oct->vf_rep_list.ndev[i] = ndev; oct 547 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c if (octeon_register_dispatch_fn(oct, OPCODE_NIC, oct 549 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c lio_vf_rep_pkt_recv, oct)) { oct 550 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c dev_err(&oct->pci_dev->dev, "VF rep Dispatch func registration failed\n"); oct 558 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c for (i = 0; i < oct->vf_rep_list.num_vfs; i++) { oct 559 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c ndev = oct->vf_rep_list.ndev[i]; oct 560 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c oct->vf_rep_list.ndev[i] = NULL; oct 570 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c oct->vf_rep_list.num_vfs = 0; oct 576 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c lio_vf_rep_destroy(struct octeon_device *oct) oct 582 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c if (oct->eswitch_mode != DEVLINK_ESWITCH_MODE_SWITCHDEV) oct 585 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c if (!oct->sriov_info.sriov_enabled) oct 588 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c for (i = 0; i < oct->vf_rep_list.num_vfs; i++) { oct 589 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c ndev = oct->vf_rep_list.ndev[i]; oct 590 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c oct->vf_rep_list.ndev[i] = NULL; oct 603 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c oct->vf_rep_list.num_vfs = 0; oct 613 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c struct octeon_device *oct; oct 629 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c oct = vf_rep->oct; oct 632 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c dev_err(&oct->pci_dev->dev, oct 643 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c ret = lio_vf_rep_send_soft_command(oct, &rep_cfg, oct 646 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c dev_err(&oct->pci_dev->dev, oct 34 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.h struct octeon_device *oct; oct 45 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.h int lio_vf_rep_create(struct octeon_device *oct); oct 46 drivers/net/ethernet/cavium/liquidio/lio_vf_rep.h void lio_vf_rep_destroy(struct octeon_device *oct); oct 458 drivers/net/ethernet/cavium/liquidio/octeon_config.h #define MAX_OCTEON_INSTR_QUEUES(oct) \ oct 459 drivers/net/ethernet/cavium/liquidio/octeon_config.h (OCTEON_CN23XX_PF(oct) ? CN23XX_MAX_INPUT_QUEUES : \ oct 463 drivers/net/ethernet/cavium/liquidio/octeon_config.h #define MAX_OCTEON_OUTPUT_QUEUES(oct) \ oct 464 drivers/net/ethernet/cavium/liquidio/octeon_config.h (OCTEON_CN23XX_PF(oct) ? CN23XX_MAX_OUTPUT_QUEUES : \ oct 35 drivers/net/ethernet/cavium/liquidio/octeon_console.c static u64 cvmx_bootmem_phy_named_block_find(struct octeon_device *oct, oct 38 drivers/net/ethernet/cavium/liquidio/octeon_console.c static int octeon_console_read(struct octeon_device *oct, u32 console_num, oct 147 drivers/net/ethernet/cavium/liquidio/octeon_console.c static inline u64 __cvmx_bootmem_desc_get(struct octeon_device *oct, oct 155 drivers/net/ethernet/cavium/liquidio/octeon_console.c return octeon_read_device_mem32(oct, base); oct 157 drivers/net/ethernet/cavium/liquidio/octeon_console.c return octeon_read_device_mem64(oct, base); oct 173 drivers/net/ethernet/cavium/liquidio/octeon_console.c static void CVMX_BOOTMEM_NAMED_GET_NAME(struct octeon_device *oct, oct 179 drivers/net/ethernet/cavium/liquidio/octeon_console.c octeon_pci_read_core_mem(oct, addr, (u8 *)str, len); oct 195 drivers/net/ethernet/cavium/liquidio/octeon_console.c static int __cvmx_bootmem_check_version(struct octeon_device *oct, oct 201 drivers/net/ethernet/cavium/liquidio/octeon_console.c if (!oct->bootmem_desc_addr) oct 202 drivers/net/ethernet/cavium/liquidio/octeon_console.c oct->bootmem_desc_addr = oct 203 drivers/net/ethernet/cavium/liquidio/octeon_console.c octeon_read_device_mem64(oct, oct 206 drivers/net/ethernet/cavium/liquidio/octeon_console.c oct, oct->bootmem_desc_addr, oct 210 drivers/net/ethernet/cavium/liquidio/octeon_console.c oct, oct->bootmem_desc_addr, oct 214 drivers/net/ethernet/cavium/liquidio/octeon_console.c dev_dbg(&oct->pci_dev->dev, "%s: major_version=%d\n", __func__, oct 218 drivers/net/ethernet/cavium/liquidio/octeon_console.c dev_err(&oct->pci_dev->dev, "bootmem ver mismatch %d.%d addr:0x%llx\n", oct 220 drivers/net/ethernet/cavium/liquidio/octeon_console.c (long long)oct->bootmem_desc_addr); oct 228 drivers/net/ethernet/cavium/liquidio/octeon_console.c *__cvmx_bootmem_find_named_block_flags(struct octeon_device *oct, oct 232 drivers/net/ethernet/cavium/liquidio/octeon_console.c &oct->bootmem_named_block_desc; oct 233 drivers/net/ethernet/cavium/liquidio/octeon_console.c u64 named_addr = cvmx_bootmem_phy_named_block_find(oct, name, flags); oct 237 drivers/net/ethernet/cavium/liquidio/octeon_console.c oct, named_addr, oct 243 drivers/net/ethernet/cavium/liquidio/octeon_console.c desc->size = __cvmx_bootmem_desc_get(oct, named_addr, oct 252 drivers/net/ethernet/cavium/liquidio/octeon_console.c return &oct->bootmem_named_block_desc; oct 258 drivers/net/ethernet/cavium/liquidio/octeon_console.c static u64 cvmx_bootmem_phy_named_block_find(struct octeon_device *oct, oct 264 drivers/net/ethernet/cavium/liquidio/octeon_console.c if (!__cvmx_bootmem_check_version(oct, 3)) { oct 268 drivers/net/ethernet/cavium/liquidio/octeon_console.c oct, oct->bootmem_desc_addr, oct 274 drivers/net/ethernet/cavium/liquidio/octeon_console.c oct, oct->bootmem_desc_addr, oct 281 drivers/net/ethernet/cavium/liquidio/octeon_console.c oct, oct->bootmem_desc_addr, oct 291 drivers/net/ethernet/cavium/liquidio/octeon_console.c oct, named_addr, oct 305 drivers/net/ethernet/cavium/liquidio/octeon_console.c CVMX_BOOTMEM_NAMED_GET_NAME(oct, named_addr, oct 335 drivers/net/ethernet/cavium/liquidio/octeon_console.c static int octeon_named_block_find(struct octeon_device *oct, const char *name, oct 341 drivers/net/ethernet/cavium/liquidio/octeon_console.c named_block = __cvmx_bootmem_find_named_block_flags(oct, name, 0); oct 361 drivers/net/ethernet/cavium/liquidio/octeon_console.c int octeon_console_send_cmd(struct octeon_device *oct, char *cmd_str, oct 366 drivers/net/ethernet/cavium/liquidio/octeon_console.c dev_dbg(&oct->pci_dev->dev, "sending \"%s\" to bootloader\n", cmd_str); oct 369 drivers/net/ethernet/cavium/liquidio/octeon_console.c dev_err(&oct->pci_dev->dev, "Command string too long, max length is: %d\n", oct 374 drivers/net/ethernet/cavium/liquidio/octeon_console.c if (octeon_wait_for_bootloader(oct, wait_hundredths) != 0) { oct 375 drivers/net/ethernet/cavium/liquidio/octeon_console.c dev_err(&oct->pci_dev->dev, "Bootloader not ready for command.\n"); oct 381 drivers/net/ethernet/cavium/liquidio/octeon_console.c octeon_pci_write_core_mem(oct, BOOTLOADER_PCI_READ_BUFFER_DATA_ADDR, oct 383 drivers/net/ethernet/cavium/liquidio/octeon_console.c octeon_write_device_mem32(oct, BOOTLOADER_PCI_READ_BUFFER_LEN_ADDR, oct 385 drivers/net/ethernet/cavium/liquidio/octeon_console.c octeon_write_device_mem32(oct, BOOTLOADER_PCI_READ_BUFFER_OWNER_ADDR, oct 391 drivers/net/ethernet/cavium/liquidio/octeon_console.c if (octeon_wait_for_bootloader(oct, 200) != 0) { oct 393 drivers/net/ethernet/cavium/liquidio/octeon_console.c dev_err(&oct->pci_dev->dev, "Bootloader did not accept command.\n"); oct 400 drivers/net/ethernet/cavium/liquidio/octeon_console.c int octeon_wait_for_bootloader(struct octeon_device *oct, oct 403 drivers/net/ethernet/cavium/liquidio/octeon_console.c dev_dbg(&oct->pci_dev->dev, "waiting %d0 ms for bootloader\n", oct 406 drivers/net/ethernet/cavium/liquidio/octeon_console.c if (octeon_mem_access_ok(oct)) oct 410 drivers/net/ethernet/cavium/liquidio/octeon_console.c octeon_read_device_mem32(oct, oct 420 drivers/net/ethernet/cavium/liquidio/octeon_console.c static void octeon_console_handle_result(struct octeon_device *oct, oct 425 drivers/net/ethernet/cavium/liquidio/octeon_console.c console = &oct->console[console_num]; oct 432 drivers/net/ethernet/cavium/liquidio/octeon_console.c static void output_console_line(struct octeon_device *oct, oct 457 drivers/net/ethernet/cavium/liquidio/octeon_console.c (*console->print)(oct, (u32)console_num, oct 463 drivers/net/ethernet/cavium/liquidio/octeon_console.c (*console->print)(oct, (u32)console_num, oct 485 drivers/net/ethernet/cavium/liquidio/octeon_console.c struct octeon_device *oct = (struct octeon_device *)wk->ctxptr; oct 489 drivers/net/ethernet/cavium/liquidio/octeon_console.c console = &oct->console[console_num]; oct 498 drivers/net/ethernet/cavium/liquidio/octeon_console.c octeon_console_read(oct, console_num, console_buffer, oct 503 drivers/net/ethernet/cavium/liquidio/octeon_console.c octeon_console_handle_result(oct, console_num); oct 505 drivers/net/ethernet/cavium/liquidio/octeon_console.c output_console_line(oct, console, console_num, oct 509 drivers/net/ethernet/cavium/liquidio/octeon_console.c dev_err(&oct->pci_dev->dev, "Error reading console %u, ret=%d\n", oct 524 drivers/net/ethernet/cavium/liquidio/octeon_console.c output_console_line(oct, console, console_num, oct 534 drivers/net/ethernet/cavium/liquidio/octeon_console.c int octeon_init_consoles(struct octeon_device *oct) oct 539 drivers/net/ethernet/cavium/liquidio/octeon_console.c ret = octeon_mem_access_ok(oct); oct 541 drivers/net/ethernet/cavium/liquidio/octeon_console.c dev_err(&oct->pci_dev->dev, "Memory access not okay'\n"); oct 545 drivers/net/ethernet/cavium/liquidio/octeon_console.c ret = octeon_named_block_find(oct, OCTEON_PCI_CONSOLE_BLOCK_NAME, &addr, oct 548 drivers/net/ethernet/cavium/liquidio/octeon_console.c dev_err(&oct->pci_dev->dev, "Could not find console '%s'\n", oct 557 drivers/net/ethernet/cavium/liquidio/octeon_console.c oct->console_nb_info.bar1_index = BAR1_INDEX_STATIC_MAP; oct 558 drivers/net/ethernet/cavium/liquidio/octeon_console.c oct->fn_list.bar1_idx_setup(oct, addr, oct->console_nb_info.bar1_index, oct 560 drivers/net/ethernet/cavium/liquidio/octeon_console.c oct->console_nb_info.dram_region_base = addr oct 566 drivers/net/ethernet/cavium/liquidio/octeon_console.c oct->num_consoles = octeon_read_device_mem32(oct, oct 569 drivers/net/ethernet/cavium/liquidio/octeon_console.c oct->console_desc_addr = addr; oct 571 drivers/net/ethernet/cavium/liquidio/octeon_console.c dev_dbg(&oct->pci_dev->dev, "Initialized consoles. %d available\n", oct 572 drivers/net/ethernet/cavium/liquidio/octeon_console.c oct->num_consoles); oct 577 drivers/net/ethernet/cavium/liquidio/octeon_console.c static void octeon_get_uboot_version(struct octeon_device *oct) oct 591 drivers/net/ethernet/cavium/liquidio/octeon_console.c if (octeon_console_send_cmd(oct, "setenv stdout pci\n", 50)) { oct 596 drivers/net/ethernet/cavium/liquidio/octeon_console.c if (octeon_console_send_cmd(oct, "version\n", 1)) { oct 601 drivers/net/ethernet/cavium/liquidio/octeon_console.c console = &oct->console[console_num]; oct 610 drivers/net/ethernet/cavium/liquidio/octeon_console.c octeon_console_read(oct, oct 619 drivers/net/ethernet/cavium/liquidio/octeon_console.c octeon_console_handle_result(oct, console_num); oct 621 drivers/net/ethernet/cavium/liquidio/octeon_console.c dev_err(&oct->pci_dev->dev, "Error reading console %u, ret=%d\n", oct 632 drivers/net/ethernet/cavium/liquidio/octeon_console.c dev_dbg(&oct->pci_dev->dev, "%u: %s\n", oct 645 drivers/net/ethernet/cavium/liquidio/octeon_console.c dev_info(&oct->pci_dev->dev, "%s\n", uboot_ver); oct 650 drivers/net/ethernet/cavium/liquidio/octeon_console.c octeon_console_send_cmd(oct, "setenv stdout serial\n", 50); oct 653 drivers/net/ethernet/cavium/liquidio/octeon_console.c int octeon_add_console(struct octeon_device *oct, u32 console_num, oct 662 drivers/net/ethernet/cavium/liquidio/octeon_console.c if (console_num >= oct->num_consoles) { oct 663 drivers/net/ethernet/cavium/liquidio/octeon_console.c dev_err(&oct->pci_dev->dev, oct 665 drivers/net/ethernet/cavium/liquidio/octeon_console.c console_num, oct->num_consoles); oct 667 drivers/net/ethernet/cavium/liquidio/octeon_console.c console = &oct->console[console_num]; oct 671 drivers/net/ethernet/cavium/liquidio/octeon_console.c coreaddr = oct->console_desc_addr + console_num * 8 + oct 674 drivers/net/ethernet/cavium/liquidio/octeon_console.c console->addr = octeon_read_device_mem64(oct, coreaddr); oct 677 drivers/net/ethernet/cavium/liquidio/octeon_console.c console->buffer_size = octeon_read_device_mem32(oct, coreaddr); oct 681 drivers/net/ethernet/cavium/liquidio/octeon_console.c octeon_read_device_mem64(oct, coreaddr); oct 685 drivers/net/ethernet/cavium/liquidio/octeon_console.c octeon_read_device_mem64(oct, coreaddr); oct 688 drivers/net/ethernet/cavium/liquidio/octeon_console.c work = &oct->console_poll_work[console_num].work; oct 690 drivers/net/ethernet/cavium/liquidio/octeon_console.c octeon_get_uboot_version(oct); oct 693 drivers/net/ethernet/cavium/liquidio/octeon_console.c oct->console_poll_work[console_num].ctxptr = (void *)oct; oct 694 drivers/net/ethernet/cavium/liquidio/octeon_console.c oct->console_poll_work[console_num].ctxul = console_num; oct 702 drivers/net/ethernet/cavium/liquidio/octeon_console.c ret = octeon_console_send_cmd(oct, dbg_enb, 2000); oct 715 drivers/net/ethernet/cavium/liquidio/octeon_console.c void octeon_remove_consoles(struct octeon_device *oct) oct 720 drivers/net/ethernet/cavium/liquidio/octeon_console.c for (i = 0; i < oct->num_consoles; i++) { oct 721 drivers/net/ethernet/cavium/liquidio/octeon_console.c console = &oct->console[i]; oct 726 drivers/net/ethernet/cavium/liquidio/octeon_console.c cancel_delayed_work_sync(&oct->console_poll_work[i]. oct 734 drivers/net/ethernet/cavium/liquidio/octeon_console.c oct->num_consoles = 0; oct 758 drivers/net/ethernet/cavium/liquidio/octeon_console.c static int octeon_console_read(struct octeon_device *oct, u32 console_num, oct 765 drivers/net/ethernet/cavium/liquidio/octeon_console.c if (console_num >= oct->num_consoles) { oct 766 drivers/net/ethernet/cavium/liquidio/octeon_console.c dev_err(&oct->pci_dev->dev, "Attempted to read from disabled console %d\n", oct 771 drivers/net/ethernet/cavium/liquidio/octeon_console.c console = &oct->console[console_num]; oct 776 drivers/net/ethernet/cavium/liquidio/octeon_console.c rd_idx = octeon_read_device_mem32(oct, console->addr + oct 778 drivers/net/ethernet/cavium/liquidio/octeon_console.c wr_idx = octeon_read_device_mem32(oct, console->addr + oct 794 drivers/net/ethernet/cavium/liquidio/octeon_console.c octeon_pci_read_core_mem(oct, console->output_base_addr + rd_idx, oct 796 drivers/net/ethernet/cavium/liquidio/octeon_console.c octeon_write_device_mem32(oct, console->addr + oct 808 drivers/net/ethernet/cavium/liquidio/octeon_console.c int octeon_download_firmware(struct octeon_device *oct, const u8 *data, oct 821 drivers/net/ethernet/cavium/liquidio/octeon_console.c dev_err(&oct->pci_dev->dev, "Firmware file too small (%d < %d).\n", oct 830 drivers/net/ethernet/cavium/liquidio/octeon_console.c dev_err(&oct->pci_dev->dev, "Unrecognized firmware file.\n"); oct 838 drivers/net/ethernet/cavium/liquidio/octeon_console.c dev_err(&oct->pci_dev->dev, "Firmware CRC mismatch (0x%08x != 0x%08x).\n", oct 844 drivers/net/ethernet/cavium/liquidio/octeon_console.c dev_err(&oct->pci_dev->dev, "Unmatched firmware package type. Expected %s, got %s.\n", oct 851 drivers/net/ethernet/cavium/liquidio/octeon_console.c dev_err(&oct->pci_dev->dev, "Unmatched firmware version. Expected %s.x, got %s.\n", oct 858 drivers/net/ethernet/cavium/liquidio/octeon_console.c dev_err(&oct->pci_dev->dev, "Too many images in firmware file (%d).\n", oct 863 drivers/net/ethernet/cavium/liquidio/octeon_console.c dev_info(&oct->pci_dev->dev, "Firmware version: %s\n", h->version); oct 864 drivers/net/ethernet/cavium/liquidio/octeon_console.c snprintf(oct->fw_info.liquidio_firmware_version, 32, "LIQUIDIO: %s", oct 869 drivers/net/ethernet/cavium/liquidio/octeon_console.c dev_info(&oct->pci_dev->dev, "%s: Loading %d images\n", __func__, oct 876 drivers/net/ethernet/cavium/liquidio/octeon_console.c dev_info(&oct->pci_dev->dev, "Loading firmware %d at %llx\n", oct 889 drivers/net/ethernet/cavium/liquidio/octeon_console.c octeon_pci_write_core_mem(oct, load_addr, data, (u32)size); oct 911 drivers/net/ethernet/cavium/liquidio/octeon_console.c dev_err(&oct->pci_dev->dev, "Boot command buffer too small\n"); oct 917 drivers/net/ethernet/cavium/liquidio/octeon_console.c dev_info(&oct->pci_dev->dev, "Writing boot command: %s\n", oct 921 drivers/net/ethernet/cavium/liquidio/octeon_console.c ret = octeon_console_send_cmd(oct, h->bootcmd, 50); oct 923 drivers/net/ethernet/cavium/liquidio/octeon_console.c dev_info(&oct->pci_dev->dev, "Boot command send failed\n"); oct 569 drivers/net/ethernet/cavium/liquidio/octeon_device.c static void *__retrieve_octeon_config_info(struct octeon_device *oct, oct 572 drivers/net/ethernet/cavium/liquidio/octeon_device.c u32 oct_id = oct->octeon_id; oct 577 drivers/net/ethernet/cavium/liquidio/octeon_device.c if (oct->chip_id == OCTEON_CN66XX) { oct 579 drivers/net/ethernet/cavium/liquidio/octeon_device.c } else if ((oct->chip_id == OCTEON_CN68XX) && oct 582 drivers/net/ethernet/cavium/liquidio/octeon_device.c } else if ((oct->chip_id == OCTEON_CN68XX) && oct 585 drivers/net/ethernet/cavium/liquidio/octeon_device.c } else if (oct->chip_id == OCTEON_CN23XX_PF_VID) { oct 587 drivers/net/ethernet/cavium/liquidio/octeon_device.c } else if (oct->chip_id == OCTEON_CN23XX_VF_VID) { oct 597 drivers/net/ethernet/cavium/liquidio/octeon_device.c static int __verify_octeon_config_info(struct octeon_device *oct, void *conf) oct 599 drivers/net/ethernet/cavium/liquidio/octeon_device.c switch (oct->chip_id) { oct 602 drivers/net/ethernet/cavium/liquidio/octeon_device.c return lio_validate_cn6xxx_config_info(oct, conf); oct 613 drivers/net/ethernet/cavium/liquidio/octeon_device.c void *oct_get_config_info(struct octeon_device *oct, u16 card_type) oct 617 drivers/net/ethernet/cavium/liquidio/octeon_device.c conf = __retrieve_octeon_config_info(oct, card_type); oct 621 drivers/net/ethernet/cavium/liquidio/octeon_device.c if (__verify_octeon_config_info(oct, conf)) { oct 622 drivers/net/ethernet/cavium/liquidio/octeon_device.c dev_err(&oct->pci_dev->dev, "Configuration verification failed\n"); oct 645 drivers/net/ethernet/cavium/liquidio/octeon_device.c void octeon_free_device_mem(struct octeon_device *oct) oct 649 drivers/net/ethernet/cavium/liquidio/octeon_device.c for (i = 0; i < MAX_OCTEON_OUTPUT_QUEUES(oct); i++) { oct 650 drivers/net/ethernet/cavium/liquidio/octeon_device.c if (oct->io_qmask.oq & BIT_ULL(i)) oct 651 drivers/net/ethernet/cavium/liquidio/octeon_device.c vfree(oct->droq[i]); oct 654 drivers/net/ethernet/cavium/liquidio/octeon_device.c for (i = 0; i < MAX_OCTEON_INSTR_QUEUES(oct); i++) { oct 655 drivers/net/ethernet/cavium/liquidio/octeon_device.c if (oct->io_qmask.iq & BIT_ULL(i)) oct 656 drivers/net/ethernet/cavium/liquidio/octeon_device.c vfree(oct->instr_queue[i]); oct 659 drivers/net/ethernet/cavium/liquidio/octeon_device.c i = oct->octeon_id; oct 660 drivers/net/ethernet/cavium/liquidio/octeon_device.c vfree(oct); oct 669 drivers/net/ethernet/cavium/liquidio/octeon_device.c struct octeon_device *oct; oct 709 drivers/net/ethernet/cavium/liquidio/octeon_device.c oct = (struct octeon_device *)buf; oct 710 drivers/net/ethernet/cavium/liquidio/octeon_device.c oct->priv = (void *)(buf + octdevsize); oct 711 drivers/net/ethernet/cavium/liquidio/octeon_device.c oct->chip = (void *)(buf + octdevsize + priv_size); oct 712 drivers/net/ethernet/cavium/liquidio/octeon_device.c oct->dispatch.dlist = (struct octeon_dispatch *) oct 715 drivers/net/ethernet/cavium/liquidio/octeon_device.c return oct; oct 722 drivers/net/ethernet/cavium/liquidio/octeon_device.c struct octeon_device *oct = NULL; oct 731 drivers/net/ethernet/cavium/liquidio/octeon_device.c oct = octeon_allocate_device_mem(pci_id, priv_size); oct 732 drivers/net/ethernet/cavium/liquidio/octeon_device.c if (oct) { oct 734 drivers/net/ethernet/cavium/liquidio/octeon_device.c octeon_device[oct_idx] = oct; oct 739 drivers/net/ethernet/cavium/liquidio/octeon_device.c if (!oct) oct 742 drivers/net/ethernet/cavium/liquidio/octeon_device.c spin_lock_init(&oct->pci_win_lock); oct 743 drivers/net/ethernet/cavium/liquidio/octeon_device.c spin_lock_init(&oct->mem_access_lock); oct 745 drivers/net/ethernet/cavium/liquidio/octeon_device.c oct->octeon_id = oct_idx; oct 746 drivers/net/ethernet/cavium/liquidio/octeon_device.c snprintf(oct->device_name, sizeof(oct->device_name), oct 747 drivers/net/ethernet/cavium/liquidio/octeon_device.c "LiquidIO%d", (oct->octeon_id)); oct 749 drivers/net/ethernet/cavium/liquidio/octeon_device.c return oct; oct 760 drivers/net/ethernet/cavium/liquidio/octeon_device.c int octeon_register_device(struct octeon_device *oct, oct 765 drivers/net/ethernet/cavium/liquidio/octeon_device.c oct->loc.bus = bus; oct 766 drivers/net/ethernet/cavium/liquidio/octeon_device.c oct->loc.dev = dev; oct 767 drivers/net/ethernet/cavium/liquidio/octeon_device.c oct->loc.func = func; oct 769 drivers/net/ethernet/cavium/liquidio/octeon_device.c oct->adapter_refcount = &adapter_refcounts[oct->octeon_id]; oct 770 drivers/net/ethernet/cavium/liquidio/octeon_device.c atomic_set(oct->adapter_refcount, 0); oct 773 drivers/net/ethernet/cavium/liquidio/octeon_device.c oct->adapter_fw_state = &adapter_fw_states[oct->octeon_id]; oct 774 drivers/net/ethernet/cavium/liquidio/octeon_device.c atomic_set(oct->adapter_fw_state, FW_NEEDS_TO_BE_LOADED); oct 777 drivers/net/ethernet/cavium/liquidio/octeon_device.c for (idx = (int)oct->octeon_id - 1; idx >= 0; idx--) { oct 779 drivers/net/ethernet/cavium/liquidio/octeon_device.c dev_err(&oct->pci_dev->dev, oct 783 drivers/net/ethernet/cavium/liquidio/octeon_device.c atomic_inc(oct->adapter_refcount); oct 791 drivers/net/ethernet/cavium/liquidio/octeon_device.c oct->adapter_refcount = oct 793 drivers/net/ethernet/cavium/liquidio/octeon_device.c oct->adapter_fw_state = oct 800 drivers/net/ethernet/cavium/liquidio/octeon_device.c atomic_inc(oct->adapter_refcount); oct 801 drivers/net/ethernet/cavium/liquidio/octeon_device.c refcount = atomic_read(oct->adapter_refcount); oct 803 drivers/net/ethernet/cavium/liquidio/octeon_device.c dev_dbg(&oct->pci_dev->dev, "%s: %02x:%02x:%d refcount %u", __func__, oct 804 drivers/net/ethernet/cavium/liquidio/octeon_device.c oct->loc.bus, oct->loc.dev, oct->loc.func, refcount); oct 813 drivers/net/ethernet/cavium/liquidio/octeon_device.c int octeon_deregister_device(struct octeon_device *oct) oct 817 drivers/net/ethernet/cavium/liquidio/octeon_device.c atomic_dec(oct->adapter_refcount); oct 818 drivers/net/ethernet/cavium/liquidio/octeon_device.c refcount = atomic_read(oct->adapter_refcount); oct 820 drivers/net/ethernet/cavium/liquidio/octeon_device.c dev_dbg(&oct->pci_dev->dev, "%s: %04d:%02d:%d refcount %u", __func__, oct 821 drivers/net/ethernet/cavium/liquidio/octeon_device.c oct->loc.bus, oct->loc.dev, oct->loc.func, refcount); oct 827 drivers/net/ethernet/cavium/liquidio/octeon_device.c octeon_allocate_ioq_vector(struct octeon_device *oct, u32 num_ioqs) oct 836 drivers/net/ethernet/cavium/liquidio/octeon_device.c oct->ioq_vector = vzalloc(size); oct 837 drivers/net/ethernet/cavium/liquidio/octeon_device.c if (!oct->ioq_vector) oct 840 drivers/net/ethernet/cavium/liquidio/octeon_device.c ioq_vector = &oct->ioq_vector[i]; oct 841 drivers/net/ethernet/cavium/liquidio/octeon_device.c ioq_vector->oct_dev = oct; oct 844 drivers/net/ethernet/cavium/liquidio/octeon_device.c ioq_vector->mbox = oct->mbox[i]; oct 849 drivers/net/ethernet/cavium/liquidio/octeon_device.c if (oct->chip_id == OCTEON_CN23XX_PF_VID) oct 850 drivers/net/ethernet/cavium/liquidio/octeon_device.c ioq_vector->ioq_num = i + oct->sriov_info.pf_srn; oct 859 drivers/net/ethernet/cavium/liquidio/octeon_device.c octeon_free_ioq_vector(struct octeon_device *oct) oct 861 drivers/net/ethernet/cavium/liquidio/octeon_device.c vfree(oct->ioq_vector); oct 865 drivers/net/ethernet/cavium/liquidio/octeon_device.c int octeon_setup_instr_queues(struct octeon_device *oct) oct 870 drivers/net/ethernet/cavium/liquidio/octeon_device.c int numa_node = dev_to_node(&oct->pci_dev->dev); oct 872 drivers/net/ethernet/cavium/liquidio/octeon_device.c if (OCTEON_CN6XXX(oct)) oct 874 drivers/net/ethernet/cavium/liquidio/octeon_device.c CFG_GET_NUM_DEF_TX_DESCS(CHIP_CONF(oct, cn6xxx)); oct 875 drivers/net/ethernet/cavium/liquidio/octeon_device.c else if (OCTEON_CN23XX_PF(oct)) oct 876 drivers/net/ethernet/cavium/liquidio/octeon_device.c num_descs = CFG_GET_NUM_DEF_TX_DESCS(CHIP_CONF(oct, cn23xx_pf)); oct 877 drivers/net/ethernet/cavium/liquidio/octeon_device.c else if (OCTEON_CN23XX_VF(oct)) oct 878 drivers/net/ethernet/cavium/liquidio/octeon_device.c num_descs = CFG_GET_NUM_DEF_TX_DESCS(CHIP_CONF(oct, cn23xx_vf)); oct 880 drivers/net/ethernet/cavium/liquidio/octeon_device.c oct->num_iqs = 0; oct 882 drivers/net/ethernet/cavium/liquidio/octeon_device.c oct->instr_queue[0] = vzalloc_node(sizeof(*oct->instr_queue[0]), oct 884 drivers/net/ethernet/cavium/liquidio/octeon_device.c if (!oct->instr_queue[0]) oct 885 drivers/net/ethernet/cavium/liquidio/octeon_device.c oct->instr_queue[0] = oct 887 drivers/net/ethernet/cavium/liquidio/octeon_device.c if (!oct->instr_queue[0]) oct 889 drivers/net/ethernet/cavium/liquidio/octeon_device.c memset(oct->instr_queue[0], 0, sizeof(struct octeon_instr_queue)); oct 890 drivers/net/ethernet/cavium/liquidio/octeon_device.c oct->instr_queue[0]->q_index = 0; oct 891 drivers/net/ethernet/cavium/liquidio/octeon_device.c oct->instr_queue[0]->app_ctx = (void *)(size_t)0; oct 892 drivers/net/ethernet/cavium/liquidio/octeon_device.c oct->instr_queue[0]->ifidx = 0; oct 895 drivers/net/ethernet/cavium/liquidio/octeon_device.c txpciq.s.pkind = oct->pfvf_hsword.pkind; oct 898 drivers/net/ethernet/cavium/liquidio/octeon_device.c if (octeon_init_instr_queue(oct, txpciq, num_descs)) { oct 900 drivers/net/ethernet/cavium/liquidio/octeon_device.c vfree(oct->instr_queue[0]); oct 901 drivers/net/ethernet/cavium/liquidio/octeon_device.c oct->instr_queue[0] = NULL; oct 905 drivers/net/ethernet/cavium/liquidio/octeon_device.c oct->num_iqs++; oct 909 drivers/net/ethernet/cavium/liquidio/octeon_device.c int octeon_setup_output_queues(struct octeon_device *oct) oct 914 drivers/net/ethernet/cavium/liquidio/octeon_device.c int numa_node = dev_to_node(&oct->pci_dev->dev); oct 916 drivers/net/ethernet/cavium/liquidio/octeon_device.c if (OCTEON_CN6XXX(oct)) { oct 918 drivers/net/ethernet/cavium/liquidio/octeon_device.c CFG_GET_NUM_DEF_RX_DESCS(CHIP_CONF(oct, cn6xxx)); oct 920 drivers/net/ethernet/cavium/liquidio/octeon_device.c CFG_GET_DEF_RX_BUF_SIZE(CHIP_CONF(oct, cn6xxx)); oct 921 drivers/net/ethernet/cavium/liquidio/octeon_device.c } else if (OCTEON_CN23XX_PF(oct)) { oct 922 drivers/net/ethernet/cavium/liquidio/octeon_device.c num_descs = CFG_GET_NUM_DEF_RX_DESCS(CHIP_CONF(oct, cn23xx_pf)); oct 923 drivers/net/ethernet/cavium/liquidio/octeon_device.c desc_size = CFG_GET_DEF_RX_BUF_SIZE(CHIP_CONF(oct, cn23xx_pf)); oct 924 drivers/net/ethernet/cavium/liquidio/octeon_device.c } else if (OCTEON_CN23XX_VF(oct)) { oct 925 drivers/net/ethernet/cavium/liquidio/octeon_device.c num_descs = CFG_GET_NUM_DEF_RX_DESCS(CHIP_CONF(oct, cn23xx_vf)); oct 926 drivers/net/ethernet/cavium/liquidio/octeon_device.c desc_size = CFG_GET_DEF_RX_BUF_SIZE(CHIP_CONF(oct, cn23xx_vf)); oct 928 drivers/net/ethernet/cavium/liquidio/octeon_device.c oct->num_oqs = 0; oct 929 drivers/net/ethernet/cavium/liquidio/octeon_device.c oct->droq[0] = vzalloc_node(sizeof(*oct->droq[0]), numa_node); oct 930 drivers/net/ethernet/cavium/liquidio/octeon_device.c if (!oct->droq[0]) oct 931 drivers/net/ethernet/cavium/liquidio/octeon_device.c oct->droq[0] = vzalloc(sizeof(*oct->droq[0])); oct 932 drivers/net/ethernet/cavium/liquidio/octeon_device.c if (!oct->droq[0]) oct 935 drivers/net/ethernet/cavium/liquidio/octeon_device.c if (octeon_init_droq(oct, oq_no, num_descs, desc_size, NULL)) { oct 936 drivers/net/ethernet/cavium/liquidio/octeon_device.c vfree(oct->droq[oq_no]); oct 937 drivers/net/ethernet/cavium/liquidio/octeon_device.c oct->droq[oq_no] = NULL; oct 940 drivers/net/ethernet/cavium/liquidio/octeon_device.c oct->num_oqs++; oct 945 drivers/net/ethernet/cavium/liquidio/octeon_device.c int octeon_set_io_queues_off(struct octeon_device *oct) oct 949 drivers/net/ethernet/cavium/liquidio/octeon_device.c if (OCTEON_CN6XXX(oct)) { oct 950 drivers/net/ethernet/cavium/liquidio/octeon_device.c octeon_write_csr(oct, CN6XXX_SLI_PKT_INSTR_ENB, 0); oct 951 drivers/net/ethernet/cavium/liquidio/octeon_device.c octeon_write_csr(oct, CN6XXX_SLI_PKT_OUT_ENB, 0); oct 952 drivers/net/ethernet/cavium/liquidio/octeon_device.c } else if (oct->chip_id == OCTEON_CN23XX_VF_VID) { oct 959 drivers/net/ethernet/cavium/liquidio/octeon_device.c for (q_no = 0; q_no < oct->sriov_info.rings_per_vf; q_no++) { oct 961 drivers/net/ethernet/cavium/liquidio/octeon_device.c oct, CN23XX_VF_SLI_IQ_PKT_CONTROL64(q_no)); oct 967 drivers/net/ethernet/cavium/liquidio/octeon_device.c oct, CN23XX_SLI_IQ_PKT_CONTROL64(q_no)); oct 971 drivers/net/ethernet/cavium/liquidio/octeon_device.c dev_err(&oct->pci_dev->dev, oct 978 drivers/net/ethernet/cavium/liquidio/octeon_device.c octeon_write_csr64(oct, oct 983 drivers/net/ethernet/cavium/liquidio/octeon_device.c oct, CN23XX_SLI_IQ_PKT_CONTROL64(q_no)); oct 985 drivers/net/ethernet/cavium/liquidio/octeon_device.c dev_err(&oct->pci_dev->dev, oct 994 drivers/net/ethernet/cavium/liquidio/octeon_device.c void octeon_set_droq_pkt_op(struct octeon_device *oct, oct 1001 drivers/net/ethernet/cavium/liquidio/octeon_device.c if (OCTEON_CN6XXX(oct)) { oct 1002 drivers/net/ethernet/cavium/liquidio/octeon_device.c reg_val = octeon_read_csr(oct, CN6XXX_SLI_PKT_OUT_ENB); oct 1009 drivers/net/ethernet/cavium/liquidio/octeon_device.c octeon_write_csr(oct, CN6XXX_SLI_PKT_OUT_ENB, reg_val); oct 1013 drivers/net/ethernet/cavium/liquidio/octeon_device.c int octeon_init_dispatch_list(struct octeon_device *oct) oct 1017 drivers/net/ethernet/cavium/liquidio/octeon_device.c oct->dispatch.count = 0; oct 1020 drivers/net/ethernet/cavium/liquidio/octeon_device.c oct->dispatch.dlist[i].opcode = 0; oct 1021 drivers/net/ethernet/cavium/liquidio/octeon_device.c INIT_LIST_HEAD(&oct->dispatch.dlist[i].list); oct 1025 drivers/net/ethernet/cavium/liquidio/octeon_device.c octeon_register_reqtype_free_fn(oct, i, NULL); oct 1027 drivers/net/ethernet/cavium/liquidio/octeon_device.c spin_lock_init(&oct->dispatch.lock); oct 1032 drivers/net/ethernet/cavium/liquidio/octeon_device.c void octeon_delete_dispatch_list(struct octeon_device *oct) oct 1039 drivers/net/ethernet/cavium/liquidio/octeon_device.c spin_lock_bh(&oct->dispatch.lock); oct 1044 drivers/net/ethernet/cavium/liquidio/octeon_device.c dispatch = &oct->dispatch.dlist[i].list; oct 1050 drivers/net/ethernet/cavium/liquidio/octeon_device.c oct->dispatch.dlist[i].opcode = 0; oct 1053 drivers/net/ethernet/cavium/liquidio/octeon_device.c oct->dispatch.count = 0; oct 1055 drivers/net/ethernet/cavium/liquidio/octeon_device.c spin_unlock_bh(&oct->dispatch.lock); oct 1122 drivers/net/ethernet/cavium/liquidio/octeon_device.c octeon_register_dispatch_fn(struct octeon_device *oct, oct 1133 drivers/net/ethernet/cavium/liquidio/octeon_device.c spin_lock_bh(&oct->dispatch.lock); oct 1135 drivers/net/ethernet/cavium/liquidio/octeon_device.c if (oct->dispatch.dlist[idx].opcode == 0) { oct 1136 drivers/net/ethernet/cavium/liquidio/octeon_device.c oct->dispatch.dlist[idx].opcode = combined_opcode; oct 1137 drivers/net/ethernet/cavium/liquidio/octeon_device.c oct->dispatch.dlist[idx].dispatch_fn = fn; oct 1138 drivers/net/ethernet/cavium/liquidio/octeon_device.c oct->dispatch.dlist[idx].arg = fn_arg; oct 1139 drivers/net/ethernet/cavium/liquidio/octeon_device.c oct->dispatch.count++; oct 1140 drivers/net/ethernet/cavium/liquidio/octeon_device.c spin_unlock_bh(&oct->dispatch.lock); oct 1144 drivers/net/ethernet/cavium/liquidio/octeon_device.c spin_unlock_bh(&oct->dispatch.lock); oct 1149 drivers/net/ethernet/cavium/liquidio/octeon_device.c pfn = octeon_get_dispatch(oct, opcode, subcode); oct 1153 drivers/net/ethernet/cavium/liquidio/octeon_device.c dev_dbg(&oct->pci_dev->dev, oct 1158 drivers/net/ethernet/cavium/liquidio/octeon_device.c dev_err(&oct->pci_dev->dev, oct 1169 drivers/net/ethernet/cavium/liquidio/octeon_device.c spin_lock_bh(&oct->dispatch.lock); oct 1170 drivers/net/ethernet/cavium/liquidio/octeon_device.c list_add(&dispatch->list, &oct->dispatch.dlist[idx].list); oct 1171 drivers/net/ethernet/cavium/liquidio/octeon_device.c oct->dispatch.count++; oct 1172 drivers/net/ethernet/cavium/liquidio/octeon_device.c spin_unlock_bh(&oct->dispatch.lock); oct 1176 drivers/net/ethernet/cavium/liquidio/octeon_device.c octeon_get_dispatch_arg(oct, opcode, subcode) == fn_arg) oct 1179 drivers/net/ethernet/cavium/liquidio/octeon_device.c dev_err(&oct->pci_dev->dev, oct 1192 drivers/net/ethernet/cavium/liquidio/octeon_device.c struct octeon_device *oct = (struct octeon_device *)buf; oct 1197 drivers/net/ethernet/cavium/liquidio/octeon_device.c if (OCTEON_CN6XXX(oct)) oct 1199 drivers/net/ethernet/cavium/liquidio/octeon_device.c CFG_GET_NUM_NIC_PORTS(CHIP_CONF(oct, cn6xxx)); oct 1200 drivers/net/ethernet/cavium/liquidio/octeon_device.c else if (OCTEON_CN23XX_PF(oct)) oct 1202 drivers/net/ethernet/cavium/liquidio/octeon_device.c CFG_GET_NUM_NIC_PORTS(CHIP_CONF(oct, cn23xx_pf)); oct 1204 drivers/net/ethernet/cavium/liquidio/octeon_device.c if (atomic_read(&oct->status) >= OCT_DEV_RUNNING) { oct 1205 drivers/net/ethernet/cavium/liquidio/octeon_device.c dev_err(&oct->pci_dev->dev, "Received CORE OK when device state is 0x%x\n", oct 1206 drivers/net/ethernet/cavium/liquidio/octeon_device.c atomic_read(&oct->status)); oct 1214 drivers/net/ethernet/cavium/liquidio/octeon_device.c oct->app_mode = (u32)recv_pkt->rh.r_core_drv_init.app_mode; oct 1216 drivers/net/ethernet/cavium/liquidio/octeon_device.c oct->fw_info.max_nic_ports = oct 1218 drivers/net/ethernet/cavium/liquidio/octeon_device.c oct->fw_info.num_gmx_ports = oct 1222 drivers/net/ethernet/cavium/liquidio/octeon_device.c if (oct->fw_info.max_nic_ports < num_nic_ports) { oct 1223 drivers/net/ethernet/cavium/liquidio/octeon_device.c dev_err(&oct->pci_dev->dev, oct 1225 drivers/net/ethernet/cavium/liquidio/octeon_device.c num_nic_ports, oct->fw_info.max_nic_ports); oct 1228 drivers/net/ethernet/cavium/liquidio/octeon_device.c oct->fw_info.app_cap_flags = recv_pkt->rh.r_core_drv_init.app_cap_flags; oct 1229 drivers/net/ethernet/cavium/liquidio/octeon_device.c oct->fw_info.app_mode = (u32)recv_pkt->rh.r_core_drv_init.app_mode; oct 1230 drivers/net/ethernet/cavium/liquidio/octeon_device.c oct->pfvf_hsword.app_mode = (u32)recv_pkt->rh.r_core_drv_init.app_mode; oct 1232 drivers/net/ethernet/cavium/liquidio/octeon_device.c oct->pfvf_hsword.pkind = recv_pkt->rh.r_core_drv_init.pkind; oct 1234 drivers/net/ethernet/cavium/liquidio/octeon_device.c for (i = 0; i < oct->num_iqs; i++) oct 1235 drivers/net/ethernet/cavium/liquidio/octeon_device.c oct->instr_queue[i]->txpciq.s.pkind = oct->pfvf_hsword.pkind; oct 1237 drivers/net/ethernet/cavium/liquidio/octeon_device.c atomic_set(&oct->status, OCT_DEV_CORE_OK); oct 1239 drivers/net/ethernet/cavium/liquidio/octeon_device.c cs = &core_setup[oct->octeon_id]; oct 1242 drivers/net/ethernet/cavium/liquidio/octeon_device.c dev_dbg(&oct->pci_dev->dev, "Core setup bytes expected %u found %d\n", oct 1250 drivers/net/ethernet/cavium/liquidio/octeon_device.c strncpy(oct->boardinfo.name, cs->boardname, OCT_BOARD_NAME); oct 1251 drivers/net/ethernet/cavium/liquidio/octeon_device.c strncpy(oct->boardinfo.serial_number, cs->board_serial_number, oct 1256 drivers/net/ethernet/cavium/liquidio/octeon_device.c oct->boardinfo.major = cs->board_rev_major; oct 1257 drivers/net/ethernet/cavium/liquidio/octeon_device.c oct->boardinfo.minor = cs->board_rev_minor; oct 1259 drivers/net/ethernet/cavium/liquidio/octeon_device.c dev_info(&oct->pci_dev->dev, oct 1270 drivers/net/ethernet/cavium/liquidio/octeon_device.c int octeon_get_tx_qsize(struct octeon_device *oct, u32 q_no) oct 1273 drivers/net/ethernet/cavium/liquidio/octeon_device.c if (oct && (q_no < MAX_OCTEON_INSTR_QUEUES(oct)) && oct 1274 drivers/net/ethernet/cavium/liquidio/octeon_device.c (oct->io_qmask.iq & BIT_ULL(q_no))) oct 1275 drivers/net/ethernet/cavium/liquidio/octeon_device.c return oct->instr_queue[q_no]->max_count; oct 1280 drivers/net/ethernet/cavium/liquidio/octeon_device.c int octeon_get_rx_qsize(struct octeon_device *oct, u32 q_no) oct 1282 drivers/net/ethernet/cavium/liquidio/octeon_device.c if (oct && (q_no < MAX_OCTEON_OUTPUT_QUEUES(oct)) && oct 1283 drivers/net/ethernet/cavium/liquidio/octeon_device.c (oct->io_qmask.oq & BIT_ULL(q_no))) oct 1284 drivers/net/ethernet/cavium/liquidio/octeon_device.c return oct->droq[q_no]->max_count; oct 1289 drivers/net/ethernet/cavium/liquidio/octeon_device.c struct octeon_config *octeon_get_conf(struct octeon_device *oct) oct 1297 drivers/net/ethernet/cavium/liquidio/octeon_device.c if (OCTEON_CN6XXX(oct)) { oct 1299 drivers/net/ethernet/cavium/liquidio/octeon_device.c (struct octeon_config *)(CHIP_CONF(oct, cn6xxx)); oct 1300 drivers/net/ethernet/cavium/liquidio/octeon_device.c } else if (OCTEON_CN23XX_PF(oct)) { oct 1302 drivers/net/ethernet/cavium/liquidio/octeon_device.c (CHIP_CONF(oct, cn23xx_pf)); oct 1303 drivers/net/ethernet/cavium/liquidio/octeon_device.c } else if (OCTEON_CN23XX_VF(oct)) { oct 1305 drivers/net/ethernet/cavium/liquidio/octeon_device.c (CHIP_CONF(oct, cn23xx_vf)); oct 1326 drivers/net/ethernet/cavium/liquidio/octeon_device.c u64 lio_pci_readq(struct octeon_device *oct, u64 addr) oct 1332 drivers/net/ethernet/cavium/liquidio/octeon_device.c spin_lock_irqsave(&oct->pci_win_lock, flags); oct 1338 drivers/net/ethernet/cavium/liquidio/octeon_device.c if ((oct->chip_id == OCTEON_CN66XX) || oct 1339 drivers/net/ethernet/cavium/liquidio/octeon_device.c (oct->chip_id == OCTEON_CN68XX) || oct 1340 drivers/net/ethernet/cavium/liquidio/octeon_device.c (oct->chip_id == OCTEON_CN23XX_PF_VID)) oct 1342 drivers/net/ethernet/cavium/liquidio/octeon_device.c writel(addrhi, oct->reg_list.pci_win_rd_addr_hi); oct 1345 drivers/net/ethernet/cavium/liquidio/octeon_device.c val32 = readl(oct->reg_list.pci_win_rd_addr_hi); oct 1347 drivers/net/ethernet/cavium/liquidio/octeon_device.c writel(addr & 0xffffffff, oct->reg_list.pci_win_rd_addr_lo); oct 1348 drivers/net/ethernet/cavium/liquidio/octeon_device.c val32 = readl(oct->reg_list.pci_win_rd_addr_lo); oct 1350 drivers/net/ethernet/cavium/liquidio/octeon_device.c val64 = readq(oct->reg_list.pci_win_rd_data); oct 1352 drivers/net/ethernet/cavium/liquidio/octeon_device.c spin_unlock_irqrestore(&oct->pci_win_lock, flags); oct 1357 drivers/net/ethernet/cavium/liquidio/octeon_device.c void lio_pci_writeq(struct octeon_device *oct, oct 1364 drivers/net/ethernet/cavium/liquidio/octeon_device.c spin_lock_irqsave(&oct->pci_win_lock, flags); oct 1366 drivers/net/ethernet/cavium/liquidio/octeon_device.c writeq(addr, oct->reg_list.pci_win_wr_addr); oct 1369 drivers/net/ethernet/cavium/liquidio/octeon_device.c writel(val >> 32, oct->reg_list.pci_win_wr_data_hi); oct 1371 drivers/net/ethernet/cavium/liquidio/octeon_device.c val32 = readl(oct->reg_list.pci_win_wr_data_hi); oct 1373 drivers/net/ethernet/cavium/liquidio/octeon_device.c writel(val & 0xffffffff, oct->reg_list.pci_win_wr_data_lo); oct 1375 drivers/net/ethernet/cavium/liquidio/octeon_device.c spin_unlock_irqrestore(&oct->pci_win_lock, flags); oct 1378 drivers/net/ethernet/cavium/liquidio/octeon_device.c int octeon_mem_access_ok(struct octeon_device *oct) oct 1384 drivers/net/ethernet/cavium/liquidio/octeon_device.c if (OCTEON_CN23XX_PF(oct)) { oct 1385 drivers/net/ethernet/cavium/liquidio/octeon_device.c lmc0_reset_ctl = lio_pci_readq(oct, CN23XX_LMC0_RESET_CTL); oct 1389 drivers/net/ethernet/cavium/liquidio/octeon_device.c lmc0_reset_ctl = lio_pci_readq(oct, CN6XXX_LMC0_RESET_CTL); oct 1397 drivers/net/ethernet/cavium/liquidio/octeon_device.c int octeon_wait_for_ddr_init(struct octeon_device *oct, u32 *timeout) oct 1407 drivers/net/ethernet/cavium/liquidio/octeon_device.c ret = octeon_mem_access_ok(oct); oct 1437 drivers/net/ethernet/cavium/liquidio/octeon_device.c struct octeon_device *oct = NULL; oct 1444 drivers/net/ethernet/cavium/liquidio/octeon_device.c oct = droq->oct_dev; oct 1453 drivers/net/ethernet/cavium/liquidio/octeon_device.c oct = iq->oct_dev; oct 1458 drivers/net/ethernet/cavium/liquidio/octeon_device.c if (oct && (OCTEON_CN23XX_PF(oct) || OCTEON_CN23XX_VF(oct))) { oct 212 drivers/net/ethernet/cavium/liquidio/octeon_device.h typedef int (*octeon_console_print_fn)(struct octeon_device *oct, oct 423 drivers/net/ethernet/cavium/liquidio/octeon_device.h struct octeon_device *oct; oct 621 drivers/net/ethernet/cavium/liquidio/octeon_device.h #define OCTEON_CN6XXX(oct) ({ \ oct 622 drivers/net/ethernet/cavium/liquidio/octeon_device.h typeof(oct) _oct = (oct); \ oct 625 drivers/net/ethernet/cavium/liquidio/octeon_device.h #define OCTEON_CN23XX_PF(oct) ((oct)->chip_id == OCTEON_CN23XX_PF_VID) oct 626 drivers/net/ethernet/cavium/liquidio/octeon_device.h #define OCTEON_CN23XX_VF(oct) ((oct)->chip_id == OCTEON_CN23XX_VF_VID) oct 627 drivers/net/ethernet/cavium/liquidio/octeon_device.h #define CHIP_CONF(oct, TYPE) \ oct 628 drivers/net/ethernet/cavium/liquidio/octeon_device.h (((struct octeon_ ## TYPE *)((oct)->chip))->conf) oct 638 drivers/net/ethernet/cavium/liquidio/octeon_device.h void octeon_free_device_mem(struct octeon_device *oct); oct 655 drivers/net/ethernet/cavium/liquidio/octeon_device.h int octeon_register_device(struct octeon_device *oct, oct 662 drivers/net/ethernet/cavium/liquidio/octeon_device.h int octeon_deregister_device(struct octeon_device *oct); oct 715 drivers/net/ethernet/cavium/liquidio/octeon_device.h static inline u16 OCTEON_MAJOR_REV(struct octeon_device *oct) oct 717 drivers/net/ethernet/cavium/liquidio/octeon_device.h u16 rev = (oct->rev_id & 0xC) >> 2; oct 722 drivers/net/ethernet/cavium/liquidio/octeon_device.h static inline u16 OCTEON_MINOR_REV(struct octeon_device *oct) oct 724 drivers/net/ethernet/cavium/liquidio/octeon_device.h return oct->rev_id & 0x3; oct 737 drivers/net/ethernet/cavium/liquidio/octeon_device.h u64 lio_pci_readq(struct octeon_device *oct, u64 addr); oct 749 drivers/net/ethernet/cavium/liquidio/octeon_device.h void lio_pci_writeq(struct octeon_device *oct, u64 val, u64 addr); oct 770 drivers/net/ethernet/cavium/liquidio/octeon_device.h int octeon_mem_access_ok(struct octeon_device *oct); oct 782 drivers/net/ethernet/cavium/liquidio/octeon_device.h int octeon_wait_for_ddr_init(struct octeon_device *oct, oct 793 drivers/net/ethernet/cavium/liquidio/octeon_device.h int octeon_wait_for_bootloader(struct octeon_device *oct, oct 802 drivers/net/ethernet/cavium/liquidio/octeon_device.h int octeon_init_consoles(struct octeon_device *oct); oct 816 drivers/net/ethernet/cavium/liquidio/octeon_device.h int octeon_add_console(struct octeon_device *oct, u32 console_num, oct 820 drivers/net/ethernet/cavium/liquidio/octeon_device.h int octeon_console_write(struct octeon_device *oct, u32 console_num, oct 822 drivers/net/ethernet/cavium/liquidio/octeon_device.h int octeon_console_write_avail(struct octeon_device *oct, u32 console_num); oct 824 drivers/net/ethernet/cavium/liquidio/octeon_device.h int octeon_console_read_avail(struct octeon_device *oct, u32 console_num); oct 827 drivers/net/ethernet/cavium/liquidio/octeon_device.h void octeon_remove_consoles(struct octeon_device *oct); oct 838 drivers/net/ethernet/cavium/liquidio/octeon_device.h int octeon_console_send_cmd(struct octeon_device *oct, char *cmd_str, oct 851 drivers/net/ethernet/cavium/liquidio/octeon_device.h int octeon_download_firmware(struct octeon_device *oct, const u8 *data, oct 861 drivers/net/ethernet/cavium/liquidio/octeon_device.h int octeon_setup_instr_queues(struct octeon_device *oct); oct 868 drivers/net/ethernet/cavium/liquidio/octeon_device.h int octeon_setup_output_queues(struct octeon_device *oct); oct 870 drivers/net/ethernet/cavium/liquidio/octeon_device.h int octeon_get_tx_qsize(struct octeon_device *oct, u32 q_no); oct 872 drivers/net/ethernet/cavium/liquidio/octeon_device.h int octeon_get_rx_qsize(struct octeon_device *oct, u32 q_no); oct 877 drivers/net/ethernet/cavium/liquidio/octeon_device.h int octeon_set_io_queues_off(struct octeon_device *oct); oct 884 drivers/net/ethernet/cavium/liquidio/octeon_device.h void octeon_set_droq_pkt_op(struct octeon_device *oct, u32 q_no, u32 enable); oct 892 drivers/net/ethernet/cavium/liquidio/octeon_device.h void *oct_get_config_info(struct octeon_device *oct, u16 card_type); oct 897 drivers/net/ethernet/cavium/liquidio/octeon_device.h struct octeon_config *octeon_get_conf(struct octeon_device *oct); oct 899 drivers/net/ethernet/cavium/liquidio/octeon_device.h void octeon_free_ioq_vector(struct octeon_device *oct); oct 900 drivers/net/ethernet/cavium/liquidio/octeon_device.h int octeon_allocate_ioq_vector(struct octeon_device *oct, u32 num_ioqs); oct 140 drivers/net/ethernet/cavium/liquidio/octeon_droq.c octeon_droq_destroy_ring_buffers(struct octeon_device *oct, oct 152 drivers/net/ethernet/cavium/liquidio/octeon_droq.c lio_unmap_ring(oct->pci_dev, oct 167 drivers/net/ethernet/cavium/liquidio/octeon_droq.c octeon_droq_setup_ring_buffers(struct octeon_device *oct, oct 175 drivers/net/ethernet/cavium/liquidio/octeon_droq.c buf = recv_buffer_alloc(oct, &droq->recv_buf_list[i].pg_info); oct 178 drivers/net/ethernet/cavium/liquidio/octeon_droq.c dev_err(&oct->pci_dev->dev, "%s buffer alloc failed\n", oct 198 drivers/net/ethernet/cavium/liquidio/octeon_droq.c int octeon_delete_droq(struct octeon_device *oct, u32 q_no) oct 200 drivers/net/ethernet/cavium/liquidio/octeon_droq.c struct octeon_droq *droq = oct->droq[q_no]; oct 202 drivers/net/ethernet/cavium/liquidio/octeon_droq.c dev_dbg(&oct->pci_dev->dev, "%s[%d]\n", __func__, q_no); oct 204 drivers/net/ethernet/cavium/liquidio/octeon_droq.c octeon_droq_destroy_ring_buffers(oct, droq); oct 208 drivers/net/ethernet/cavium/liquidio/octeon_droq.c lio_dma_free(oct, (droq->max_count * OCT_DROQ_DESC_SIZE), oct 212 drivers/net/ethernet/cavium/liquidio/octeon_droq.c oct->io_qmask.oq &= ~(1ULL << q_no); oct 213 drivers/net/ethernet/cavium/liquidio/octeon_droq.c vfree(oct->droq[q_no]); oct 214 drivers/net/ethernet/cavium/liquidio/octeon_droq.c oct->droq[q_no] = NULL; oct 215 drivers/net/ethernet/cavium/liquidio/octeon_droq.c oct->num_oqs--; oct 220 drivers/net/ethernet/cavium/liquidio/octeon_droq.c int octeon_init_droq(struct octeon_device *oct, oct 229 drivers/net/ethernet/cavium/liquidio/octeon_droq.c int numa_node = dev_to_node(&oct->pci_dev->dev); oct 231 drivers/net/ethernet/cavium/liquidio/octeon_droq.c dev_dbg(&oct->pci_dev->dev, "%s[%d]\n", __func__, q_no); oct 233 drivers/net/ethernet/cavium/liquidio/octeon_droq.c droq = oct->droq[q_no]; oct 236 drivers/net/ethernet/cavium/liquidio/octeon_droq.c droq->oct_dev = oct; oct 245 drivers/net/ethernet/cavium/liquidio/octeon_droq.c if (OCTEON_CN6XXX(oct)) { oct 246 drivers/net/ethernet/cavium/liquidio/octeon_droq.c struct octeon_config *conf6x = CHIP_CONF(oct, cn6xxx); oct 251 drivers/net/ethernet/cavium/liquidio/octeon_droq.c } else if (OCTEON_CN23XX_PF(oct)) { oct 252 drivers/net/ethernet/cavium/liquidio/octeon_droq.c struct octeon_config *conf23 = CHIP_CONF(oct, cn23xx_pf); oct 256 drivers/net/ethernet/cavium/liquidio/octeon_droq.c } else if (OCTEON_CN23XX_VF(oct)) { oct 257 drivers/net/ethernet/cavium/liquidio/octeon_droq.c struct octeon_config *conf23 = CHIP_CONF(oct, cn23xx_vf); oct 269 drivers/net/ethernet/cavium/liquidio/octeon_droq.c droq->desc_ring = lio_dma_alloc(oct, desc_ring_size, oct 273 drivers/net/ethernet/cavium/liquidio/octeon_droq.c dev_err(&oct->pci_dev->dev, oct 278 drivers/net/ethernet/cavium/liquidio/octeon_droq.c dev_dbg(&oct->pci_dev->dev, "droq[%d]: desc_ring: virt: 0x%p, dma: %lx\n", oct 280 drivers/net/ethernet/cavium/liquidio/octeon_droq.c dev_dbg(&oct->pci_dev->dev, "droq[%d]: num_desc: %d\n", q_no, oct 291 drivers/net/ethernet/cavium/liquidio/octeon_droq.c dev_err(&oct->pci_dev->dev, "Output queue recv buf list alloc failed\n"); oct 295 drivers/net/ethernet/cavium/liquidio/octeon_droq.c if (octeon_droq_setup_ring_buffers(oct, droq)) oct 301 drivers/net/ethernet/cavium/liquidio/octeon_droq.c dev_dbg(&oct->pci_dev->dev, "DROQ INIT: max_empty_descs: %d\n", oct 307 drivers/net/ethernet/cavium/liquidio/octeon_droq.c oct->fn_list.setup_oq_regs(oct, q_no); oct 309 drivers/net/ethernet/cavium/liquidio/octeon_droq.c oct->io_qmask.oq |= BIT_ULL(q_no); oct 314 drivers/net/ethernet/cavium/liquidio/octeon_droq.c octeon_delete_droq(oct, q_no); oct 503 drivers/net/ethernet/cavium/liquidio/octeon_droq.c struct octeon_device *oct = droq->oct_dev; oct 508 drivers/net/ethernet/cavium/liquidio/octeon_droq.c desc_refilled = octeon_droq_refill(oct, droq); oct 531 drivers/net/ethernet/cavium/liquidio/octeon_droq.c octeon_droq_dispatch_pkt(struct octeon_device *oct, oct 542 drivers/net/ethernet/cavium/liquidio/octeon_droq.c disp_fn = octeon_get_dispatch(oct, (u16)rh->r.opcode, oct 545 drivers/net/ethernet/cavium/liquidio/octeon_droq.c rinfo = octeon_create_recv_info(oct, droq, cnt, droq->read_idx); oct 558 drivers/net/ethernet/cavium/liquidio/octeon_droq.c dev_err(&oct->pci_dev->dev, "DROQ: No dispatch function (opcode %u/%u)\n", oct 567 drivers/net/ethernet/cavium/liquidio/octeon_droq.c static inline void octeon_droq_drop_packets(struct octeon_device *oct, oct 585 drivers/net/ethernet/cavium/liquidio/octeon_droq.c dev_err(&oct->pci_dev->dev, "DROQ: In drop: pkt with len 0\n"); oct 596 drivers/net/ethernet/cavium/liquidio/octeon_droq.c octeon_droq_fast_process_packets(struct octeon_device *oct, oct 617 drivers/net/ethernet/cavium/liquidio/octeon_droq.c dev_err(&oct->pci_dev->dev, oct 635 drivers/net/ethernet/cavium/liquidio/octeon_droq.c buf_cnt = octeon_droq_dispatch_pkt(oct, droq, rh, info); oct 646 drivers/net/ethernet/cavium/liquidio/octeon_droq.c if (recv_buffer_recycle(oct, pg_info)) oct 693 drivers/net/ethernet/cavium/liquidio/octeon_droq.c droq->ops.fptr(oct->octeon_id, oct 704 drivers/net/ethernet/cavium/liquidio/octeon_droq.c int desc_refilled = octeon_droq_refill(oct, droq); oct 723 drivers/net/ethernet/cavium/liquidio/octeon_droq.c octeon_droq_drop_packets(oct, droq, (pkts_to_process - pkt)); oct 737 drivers/net/ethernet/cavium/liquidio/octeon_droq.c octeon_schedule_rxq_oom_work(oct, droq); oct 744 drivers/net/ethernet/cavium/liquidio/octeon_droq.c octeon_droq_process_packets(struct octeon_device *oct, oct 760 drivers/net/ethernet/cavium/liquidio/octeon_droq.c octeon_droq_fast_process_packets(oct, droq, pkt_count); oct 768 drivers/net/ethernet/cavium/liquidio/octeon_droq.c (oct, oct 786 drivers/net/ethernet/cavium/liquidio/octeon_droq.c octeon_droq_process_poll_pkts(struct octeon_device *oct, oct 806 drivers/net/ethernet/cavium/liquidio/octeon_droq.c octeon_droq_fast_process_packets(oct, droq, oct 818 drivers/net/ethernet/cavium/liquidio/octeon_droq.c (oct, oct 828 drivers/net/ethernet/cavium/liquidio/octeon_droq.c octeon_enable_irq(struct octeon_device *oct, u32 q_no) oct 830 drivers/net/ethernet/cavium/liquidio/octeon_droq.c switch (oct->chip_id) { oct 834 drivers/net/ethernet/cavium/liquidio/octeon_droq.c (struct octeon_cn6xxx *)oct->chip; oct 840 drivers/net/ethernet/cavium/liquidio/octeon_droq.c value = octeon_read_csr(oct, CN6XXX_SLI_PKT_TIME_INT_ENB); oct 842 drivers/net/ethernet/cavium/liquidio/octeon_droq.c octeon_write_csr(oct, CN6XXX_SLI_PKT_TIME_INT_ENB, value); oct 843 drivers/net/ethernet/cavium/liquidio/octeon_droq.c value = octeon_read_csr(oct, CN6XXX_SLI_PKT_CNT_INT_ENB); oct 845 drivers/net/ethernet/cavium/liquidio/octeon_droq.c octeon_write_csr(oct, CN6XXX_SLI_PKT_CNT_INT_ENB, value); oct 854 drivers/net/ethernet/cavium/liquidio/octeon_droq.c lio_enable_irq(oct->droq[q_no], oct->instr_queue[q_no]); oct 858 drivers/net/ethernet/cavium/liquidio/octeon_droq.c lio_enable_irq(oct->droq[q_no], oct->instr_queue[q_no]); oct 861 drivers/net/ethernet/cavium/liquidio/octeon_droq.c dev_err(&oct->pci_dev->dev, "%s Unknown Chip\n", __func__); oct 868 drivers/net/ethernet/cavium/liquidio/octeon_droq.c int octeon_register_droq_ops(struct octeon_device *oct, u32 q_no, oct 874 drivers/net/ethernet/cavium/liquidio/octeon_droq.c oct_cfg = octeon_get_conf(oct); oct 880 drivers/net/ethernet/cavium/liquidio/octeon_droq.c dev_err(&oct->pci_dev->dev, "%s: droq_ops pointer is NULL\n", oct 886 drivers/net/ethernet/cavium/liquidio/octeon_droq.c dev_err(&oct->pci_dev->dev, "%s: droq id (%d) exceeds MAX (%d)\n", oct 887 drivers/net/ethernet/cavium/liquidio/octeon_droq.c __func__, q_no, (oct->num_oqs - 1)); oct 891 drivers/net/ethernet/cavium/liquidio/octeon_droq.c droq = oct->droq[q_no]; oct 897 drivers/net/ethernet/cavium/liquidio/octeon_droq.c int octeon_unregister_droq_ops(struct octeon_device *oct, u32 q_no) oct 902 drivers/net/ethernet/cavium/liquidio/octeon_droq.c oct_cfg = octeon_get_conf(oct); oct 908 drivers/net/ethernet/cavium/liquidio/octeon_droq.c dev_err(&oct->pci_dev->dev, "%s: droq id (%d) exceeds MAX (%d)\n", oct 909 drivers/net/ethernet/cavium/liquidio/octeon_droq.c __func__, q_no, oct->num_oqs - 1); oct 913 drivers/net/ethernet/cavium/liquidio/octeon_droq.c droq = oct->droq[q_no]; oct 916 drivers/net/ethernet/cavium/liquidio/octeon_droq.c dev_info(&oct->pci_dev->dev, oct 928 drivers/net/ethernet/cavium/liquidio/octeon_droq.c int octeon_create_droq(struct octeon_device *oct, oct 933 drivers/net/ethernet/cavium/liquidio/octeon_droq.c int numa_node = dev_to_node(&oct->pci_dev->dev); oct 935 drivers/net/ethernet/cavium/liquidio/octeon_droq.c if (oct->droq[q_no]) { oct 936 drivers/net/ethernet/cavium/liquidio/octeon_droq.c dev_dbg(&oct->pci_dev->dev, "Droq already in use. Cannot create droq %d again\n", oct 951 drivers/net/ethernet/cavium/liquidio/octeon_droq.c octeon_set_droq_pkt_op(oct, q_no, 0); oct 952 drivers/net/ethernet/cavium/liquidio/octeon_droq.c oct->droq[q_no] = droq; oct 955 drivers/net/ethernet/cavium/liquidio/octeon_droq.c if (octeon_init_droq(oct, q_no, num_descs, desc_size, app_ctx)) { oct 956 drivers/net/ethernet/cavium/liquidio/octeon_droq.c vfree(oct->droq[q_no]); oct 957 drivers/net/ethernet/cavium/liquidio/octeon_droq.c oct->droq[q_no] = NULL; oct 961 drivers/net/ethernet/cavium/liquidio/octeon_droq.c oct->num_oqs++; oct 963 drivers/net/ethernet/cavium/liquidio/octeon_droq.c dev_dbg(&oct->pci_dev->dev, "%s: Total number of OQ: %d\n", __func__, oct 964 drivers/net/ethernet/cavium/liquidio/octeon_droq.c oct->num_oqs); oct 364 drivers/net/ethernet/cavium/liquidio/octeon_droq.h octeon_register_droq_ops(struct octeon_device *oct, oct 376 drivers/net/ethernet/cavium/liquidio/octeon_droq.h int octeon_unregister_droq_ops(struct octeon_device *oct, u32 q_no); oct 390 drivers/net/ethernet/cavium/liquidio/octeon_droq.h int octeon_register_dispatch_fn(struct octeon_device *oct, oct 395 drivers/net/ethernet/cavium/liquidio/octeon_droq.h void *octeon_get_dispatch_arg(struct octeon_device *oct, oct 402 drivers/net/ethernet/cavium/liquidio/octeon_droq.h int octeon_create_droq(struct octeon_device *oct, u32 q_no, oct 405 drivers/net/ethernet/cavium/liquidio/octeon_droq.h int octeon_droq_process_packets(struct octeon_device *oct, oct 409 drivers/net/ethernet/cavium/liquidio/octeon_droq.h int octeon_droq_process_poll_pkts(struct octeon_device *oct, oct 412 drivers/net/ethernet/cavium/liquidio/octeon_droq.h int octeon_enable_irq(struct octeon_device *oct, u32 q_no); oct 327 drivers/net/ethernet/cavium/liquidio/octeon_iq.h int octeon_setup_sc_buffer_pool(struct octeon_device *oct); oct 328 drivers/net/ethernet/cavium/liquidio/octeon_iq.h int octeon_free_sc_done_list(struct octeon_device *oct); oct 329 drivers/net/ethernet/cavium/liquidio/octeon_iq.h int octeon_free_sc_zombie_list(struct octeon_device *oct); oct 330 drivers/net/ethernet/cavium/liquidio/octeon_iq.h int octeon_free_sc_buffer_pool(struct octeon_device *oct); oct 332 drivers/net/ethernet/cavium/liquidio/octeon_iq.h octeon_alloc_soft_command(struct octeon_device *oct, oct 335 drivers/net/ethernet/cavium/liquidio/octeon_iq.h void octeon_free_soft_command(struct octeon_device *oct, oct 364 drivers/net/ethernet/cavium/liquidio/octeon_iq.h int lio_wait_for_instr_fetch(struct octeon_device *oct); oct 367 drivers/net/ethernet/cavium/liquidio/octeon_iq.h octeon_ring_doorbell_locked(struct octeon_device *oct, u32 iq_no); oct 370 drivers/net/ethernet/cavium/liquidio/octeon_iq.h octeon_register_reqtype_free_fn(struct octeon_device *oct, int reqtype, oct 374 drivers/net/ethernet/cavium/liquidio/octeon_iq.h lio_process_iq_request_list(struct octeon_device *oct, oct 377 drivers/net/ethernet/cavium/liquidio/octeon_iq.h int octeon_send_command(struct octeon_device *oct, u32 iq_no, oct 381 drivers/net/ethernet/cavium/liquidio/octeon_iq.h void octeon_dump_soft_command(struct octeon_device *oct, oct 384 drivers/net/ethernet/cavium/liquidio/octeon_iq.h void octeon_prepare_soft_command(struct octeon_device *oct, oct 390 drivers/net/ethernet/cavium/liquidio/octeon_iq.h int octeon_send_soft_command(struct octeon_device *oct, oct 393 drivers/net/ethernet/cavium/liquidio/octeon_iq.h int octeon_setup_iq(struct octeon_device *oct, int ifidx, oct 397 drivers/net/ethernet/cavium/liquidio/octeon_iq.h octeon_flush_iq(struct octeon_device *oct, struct octeon_instr_queue *iq, oct 131 drivers/net/ethernet/cavium/liquidio/octeon_mailbox.c int octeon_mbox_write(struct octeon_device *oct, oct 134 drivers/net/ethernet/cavium/liquidio/octeon_mailbox.c struct octeon_mbox *mbox = oct->mbox[mbox_cmd->q_no]; oct 209 drivers/net/ethernet/cavium/liquidio/octeon_mailbox.c static void get_vf_stats(struct octeon_device *oct, oct 214 drivers/net/ethernet/cavium/liquidio/octeon_mailbox.c for (i = 0; i < oct->num_iqs; i++) { oct 215 drivers/net/ethernet/cavium/liquidio/octeon_mailbox.c if (!oct->instr_queue[i]) oct 217 drivers/net/ethernet/cavium/liquidio/octeon_mailbox.c stats->tx_packets += oct->instr_queue[i]->stats.tx_done; oct 218 drivers/net/ethernet/cavium/liquidio/octeon_mailbox.c stats->tx_bytes += oct->instr_queue[i]->stats.tx_tot_bytes; oct 221 drivers/net/ethernet/cavium/liquidio/octeon_mailbox.c for (i = 0; i < oct->num_oqs; i++) { oct 222 drivers/net/ethernet/cavium/liquidio/octeon_mailbox.c if (!oct->droq[i]) oct 224 drivers/net/ethernet/cavium/liquidio/octeon_mailbox.c stats->rx_packets += oct->droq[i]->stats.rx_pkts_received; oct 225 drivers/net/ethernet/cavium/liquidio/octeon_mailbox.c stats->rx_bytes += oct->droq[i]->stats.rx_bytes_received; oct 239 drivers/net/ethernet/cavium/liquidio/octeon_mailbox.c struct octeon_device *oct = mbox->oct_dev; oct 243 drivers/net/ethernet/cavium/liquidio/octeon_mailbox.c dev_dbg(&oct->pci_dev->dev, "got vfactive sending data back\n"); oct 254 drivers/net/ethernet/cavium/liquidio/octeon_mailbox.c memcpy(mbox_cmd->msg.s.params, (uint8_t *)&oct->pfvf_hsword, 6); oct 256 drivers/net/ethernet/cavium/liquidio/octeon_mailbox.c octeon_mbox_write(oct, mbox_cmd); oct 260 drivers/net/ethernet/cavium/liquidio/octeon_mailbox.c dev_info(&oct->pci_dev->dev, oct 263 drivers/net/ethernet/cavium/liquidio/octeon_mailbox.c pcie_flr(oct->sriov_info.dpiring_to_vfpcidev_lut[mbox->q_no]); oct 267 drivers/net/ethernet/cavium/liquidio/octeon_mailbox.c if (OCTEON_CN23XX_VF(oct)) oct 268 drivers/net/ethernet/cavium/liquidio/octeon_mailbox.c octeon_pf_changed_vf_macaddr(oct, oct 273 drivers/net/ethernet/cavium/liquidio/octeon_mailbox.c dev_dbg(&oct->pci_dev->dev, "Got VF stats request. Sending data back\n"); oct 278 drivers/net/ethernet/cavium/liquidio/octeon_mailbox.c get_vf_stats(oct, (struct oct_vf_stats *)mbox_cmd->data); oct 279 drivers/net/ethernet/cavium/liquidio/octeon_mailbox.c octeon_mbox_write(oct, mbox_cmd); oct 354 drivers/net/ethernet/cavium/liquidio/octeon_mailbox.c int octeon_mbox_cancel(struct octeon_device *oct, int q_no) oct 356 drivers/net/ethernet/cavium/liquidio/octeon_mailbox.c struct octeon_mbox *mbox = oct->mbox[q_no]; oct 117 drivers/net/ethernet/cavium/liquidio/octeon_mailbox.h int octeon_mbox_write(struct octeon_device *oct, oct 120 drivers/net/ethernet/cavium/liquidio/octeon_mailbox.h int octeon_mbox_cancel(struct octeon_device *oct, int q_no); oct 72 drivers/net/ethernet/cavium/liquidio/octeon_main.h void octeon_pf_changed_vf_macaddr(struct octeon_device *oct, u8 *mac); oct 74 drivers/net/ethernet/cavium/liquidio/octeon_main.h void octeon_schedule_rxq_oom_work(struct octeon_device *oct, oct 92 drivers/net/ethernet/cavium/liquidio/octeon_main.h static inline void octeon_unmap_pci_barx(struct octeon_device *oct, int baridx) oct 94 drivers/net/ethernet/cavium/liquidio/octeon_main.h dev_dbg(&oct->pci_dev->dev, "Freeing PCI mapped regions for Bar%d\n", oct 97 drivers/net/ethernet/cavium/liquidio/octeon_main.h if (oct->mmio[baridx].done) oct 98 drivers/net/ethernet/cavium/liquidio/octeon_main.h iounmap(oct->mmio[baridx].hw_addr); oct 100 drivers/net/ethernet/cavium/liquidio/octeon_main.h if (oct->mmio[baridx].start) oct 101 drivers/net/ethernet/cavium/liquidio/octeon_main.h pci_release_region(oct->pci_dev, baridx * 2); oct 110 drivers/net/ethernet/cavium/liquidio/octeon_main.h static inline int octeon_map_pci_barx(struct octeon_device *oct, oct 115 drivers/net/ethernet/cavium/liquidio/octeon_main.h if (pci_request_region(oct->pci_dev, baridx * 2, DRV_NAME)) { oct 116 drivers/net/ethernet/cavium/liquidio/octeon_main.h dev_err(&oct->pci_dev->dev, "pci_request_region failed for bar %d\n", oct 121 drivers/net/ethernet/cavium/liquidio/octeon_main.h oct->mmio[baridx].start = pci_resource_start(oct->pci_dev, baridx * 2); oct 122 drivers/net/ethernet/cavium/liquidio/octeon_main.h oct->mmio[baridx].len = pci_resource_len(oct->pci_dev, baridx * 2); oct 124 drivers/net/ethernet/cavium/liquidio/octeon_main.h mapped_len = oct->mmio[baridx].len; oct 131 drivers/net/ethernet/cavium/liquidio/octeon_main.h oct->mmio[baridx].hw_addr = oct 132 drivers/net/ethernet/cavium/liquidio/octeon_main.h ioremap(oct->mmio[baridx].start, mapped_len); oct 133 drivers/net/ethernet/cavium/liquidio/octeon_main.h oct->mmio[baridx].mapped_len = mapped_len; oct 135 drivers/net/ethernet/cavium/liquidio/octeon_main.h dev_dbg(&oct->pci_dev->dev, "BAR%d start: 0x%llx mapped %u of %u bytes\n", oct 136 drivers/net/ethernet/cavium/liquidio/octeon_main.h baridx, oct->mmio[baridx].start, mapped_len, oct 137 drivers/net/ethernet/cavium/liquidio/octeon_main.h oct->mmio[baridx].len); oct 139 drivers/net/ethernet/cavium/liquidio/octeon_main.h if (!oct->mmio[baridx].hw_addr) { oct 140 drivers/net/ethernet/cavium/liquidio/octeon_main.h dev_err(&oct->pci_dev->dev, "error ioremap for bar %d\n", oct 144 drivers/net/ethernet/cavium/liquidio/octeon_main.h oct->mmio[baridx].done = 1; oct 149 drivers/net/ethernet/cavium/liquidio/octeon_main.h pci_release_region(oct->pci_dev, baridx * 2); oct 30 drivers/net/ethernet/cavium/liquidio/octeon_mem_ops.c octeon_toggle_bar1_swapmode(struct octeon_device *oct, u32 idx) oct 34 drivers/net/ethernet/cavium/liquidio/octeon_mem_ops.c mask = oct->fn_list.bar1_idx_read(oct, idx); oct 36 drivers/net/ethernet/cavium/liquidio/octeon_mem_ops.c oct->fn_list.bar1_idx_write(oct, idx, mask); oct 39 drivers/net/ethernet/cavium/liquidio/octeon_mem_ops.c #define octeon_toggle_bar1_swapmode(oct, idx) oct 43 drivers/net/ethernet/cavium/liquidio/octeon_mem_ops.c octeon_pci_fastwrite(struct octeon_device *oct, u8 __iomem *mapped_addr, oct 51 drivers/net/ethernet/cavium/liquidio/octeon_mem_ops.c octeon_toggle_bar1_swapmode(oct, MEMOPS_IDX); oct 60 drivers/net/ethernet/cavium/liquidio/octeon_mem_ops.c octeon_toggle_bar1_swapmode(oct, MEMOPS_IDX); oct 67 drivers/net/ethernet/cavium/liquidio/octeon_mem_ops.c octeon_pci_fastread(struct octeon_device *oct, u8 __iomem *mapped_addr, oct 75 drivers/net/ethernet/cavium/liquidio/octeon_mem_ops.c octeon_toggle_bar1_swapmode(oct, MEMOPS_IDX); oct 84 drivers/net/ethernet/cavium/liquidio/octeon_mem_ops.c octeon_toggle_bar1_swapmode(oct, MEMOPS_IDX); oct 93 drivers/net/ethernet/cavium/liquidio/octeon_mem_ops.c __octeon_pci_rw_core_mem(struct octeon_device *oct, u64 addr, oct 101 drivers/net/ethernet/cavium/liquidio/octeon_mem_ops.c static_mapping_base = oct->console_nb_info.dram_region_base; oct 105 drivers/net/ethernet/cavium/liquidio/octeon_mem_ops.c int bar1_index = oct->console_nb_info.bar1_index; oct 107 drivers/net/ethernet/cavium/liquidio/octeon_mem_ops.c mapped_addr = oct->mmio[1].hw_addr oct 112 drivers/net/ethernet/cavium/liquidio/octeon_mem_ops.c octeon_pci_fastread(oct, mapped_addr, hostbuf, len); oct 114 drivers/net/ethernet/cavium/liquidio/octeon_mem_ops.c octeon_pci_fastwrite(oct, mapped_addr, hostbuf, len); oct 119 drivers/net/ethernet/cavium/liquidio/octeon_mem_ops.c spin_lock_irqsave(&oct->mem_access_lock, flags); oct 122 drivers/net/ethernet/cavium/liquidio/octeon_mem_ops.c index_reg_val = oct->fn_list.bar1_idx_read(oct, MEMOPS_IDX); oct 124 drivers/net/ethernet/cavium/liquidio/octeon_mem_ops.c oct->fn_list.bar1_idx_setup(oct, addr, MEMOPS_IDX, 1); oct 125 drivers/net/ethernet/cavium/liquidio/octeon_mem_ops.c mapped_addr = oct->mmio[1].hw_addr oct 140 drivers/net/ethernet/cavium/liquidio/octeon_mem_ops.c octeon_pci_fastread(oct, mapped_addr, hostbuf, oct 143 drivers/net/ethernet/cavium/liquidio/octeon_mem_ops.c octeon_pci_fastwrite(oct, mapped_addr, hostbuf, oct 153 drivers/net/ethernet/cavium/liquidio/octeon_mem_ops.c oct->fn_list.bar1_idx_write(oct, MEMOPS_IDX, index_reg_val); oct 155 drivers/net/ethernet/cavium/liquidio/octeon_mem_ops.c spin_unlock_irqrestore(&oct->mem_access_lock, flags); oct 159 drivers/net/ethernet/cavium/liquidio/octeon_mem_ops.c octeon_pci_read_core_mem(struct octeon_device *oct, oct 164 drivers/net/ethernet/cavium/liquidio/octeon_mem_ops.c __octeon_pci_rw_core_mem(oct, coreaddr, buf, len, 1); oct 168 drivers/net/ethernet/cavium/liquidio/octeon_mem_ops.c octeon_pci_write_core_mem(struct octeon_device *oct, oct 173 drivers/net/ethernet/cavium/liquidio/octeon_mem_ops.c __octeon_pci_rw_core_mem(oct, coreaddr, (u8 *)buf, len, 0); oct 176 drivers/net/ethernet/cavium/liquidio/octeon_mem_ops.c u64 octeon_read_device_mem64(struct octeon_device *oct, u64 coreaddr) oct 180 drivers/net/ethernet/cavium/liquidio/octeon_mem_ops.c __octeon_pci_rw_core_mem(oct, coreaddr, (u8 *)&ret, 8, 1); oct 185 drivers/net/ethernet/cavium/liquidio/octeon_mem_ops.c u32 octeon_read_device_mem32(struct octeon_device *oct, u64 coreaddr) oct 189 drivers/net/ethernet/cavium/liquidio/octeon_mem_ops.c __octeon_pci_rw_core_mem(oct, coreaddr, (u8 *)&ret, 4, 1); oct 194 drivers/net/ethernet/cavium/liquidio/octeon_mem_ops.c void octeon_write_device_mem32(struct octeon_device *oct, u64 coreaddr, oct 199 drivers/net/ethernet/cavium/liquidio/octeon_mem_ops.c __octeon_pci_rw_core_mem(oct, coreaddr, (u8 *)&t, 4, 0); oct 36 drivers/net/ethernet/cavium/liquidio/octeon_mem_ops.h u64 octeon_read_device_mem64(struct octeon_device *oct, u64 core_addr); oct 44 drivers/net/ethernet/cavium/liquidio/octeon_mem_ops.h u32 octeon_read_device_mem32(struct octeon_device *oct, u64 core_addr); oct 52 drivers/net/ethernet/cavium/liquidio/octeon_mem_ops.h octeon_write_device_mem32(struct octeon_device *oct, oct 59 drivers/net/ethernet/cavium/liquidio/octeon_mem_ops.h octeon_pci_read_core_mem(struct octeon_device *oct, oct 67 drivers/net/ethernet/cavium/liquidio/octeon_mem_ops.h octeon_pci_write_core_mem(struct octeon_device *oct, oct 225 drivers/net/ethernet/cavium/liquidio/octeon_network.h int octeon_setup_interrupt(struct octeon_device *oct, u32 num_ioqs); oct 229 drivers/net/ethernet/cavium/liquidio/octeon_network.h int lio_wait_for_clean_oq(struct octeon_device *oct); oct 238 drivers/net/ethernet/cavium/liquidio/octeon_network.h int lio_setup_glists(struct octeon_device *oct, struct lio *lio, int num_qs); oct 260 drivers/net/ethernet/cavium/liquidio/octeon_network.h *recv_buffer_alloc(struct octeon_device *oct, oct 286 drivers/net/ethernet/cavium/liquidio/octeon_network.h pg_info->dma = dma_map_page(&oct->pci_dev->dev, page, 0, oct 290 drivers/net/ethernet/cavium/liquidio/octeon_network.h if (dma_mapping_error(&oct->pci_dev->dev, pg_info->dma)) { oct 331 drivers/net/ethernet/cavium/liquidio/octeon_network.h recv_buffer_recycle(struct octeon_device *oct, void *buf) oct 336 drivers/net/ethernet/cavium/liquidio/octeon_network.h dev_err(&oct->pci_dev->dev, "%s: pg_info->page NULL\n", oct 343 drivers/net/ethernet/cavium/liquidio/octeon_network.h dma_unmap_page(&oct->pci_dev->dev, oct 363 drivers/net/ethernet/cavium/liquidio/octeon_network.h *recv_buffer_reuse(struct octeon_device *oct, void *buf) oct 370 drivers/net/ethernet/cavium/liquidio/octeon_network.h dma_unmap_page(&oct->pci_dev->dev, oct 432 drivers/net/ethernet/cavium/liquidio/octeon_network.h #define lio_dma_alloc(oct, size, dma_addr) \ oct 433 drivers/net/ethernet/cavium/liquidio/octeon_network.h dma_alloc_coherent(&(oct)->pci_dev->dev, size, dma_addr, GFP_KERNEL) oct 434 drivers/net/ethernet/cavium/liquidio/octeon_network.h #define lio_dma_free(oct, size, virt_addr, dma_addr) \ oct 435 drivers/net/ethernet/cavium/liquidio/octeon_network.h dma_free_coherent(&(oct)->pci_dev->dev, size, virt_addr, dma_addr) oct 535 drivers/net/ethernet/cavium/liquidio/octeon_network.h static inline int wait_for_pending_requests(struct octeon_device *oct) oct 541 drivers/net/ethernet/cavium/liquidio/octeon_network.h &oct->response_list[OCTEON_ORDERED_SC_LIST] oct 602 drivers/net/ethernet/cavium/liquidio/octeon_network.h static inline int skb_iq(struct octeon_device *oct, struct sk_buff *skb) oct 604 drivers/net/ethernet/cavium/liquidio/octeon_network.h return skb->queue_mapping % oct->num_iqs; oct 30 drivers/net/ethernet/cavium/liquidio/octeon_nic.c octeon_alloc_soft_command_resp(struct octeon_device *oct, oct 41 drivers/net/ethernet/cavium/liquidio/octeon_nic.c octeon_alloc_soft_command(oct, 0, rdatasize, 0); oct 52 drivers/net/ethernet/cavium/liquidio/octeon_nic.c if (OCTEON_CN23XX_PF(oct) || OCTEON_CN23XX_VF(oct)) { oct 68 drivers/net/ethernet/cavium/liquidio/octeon_nic.c rdp->pcie_port = oct->pcie_port; oct 73 drivers/net/ethernet/cavium/liquidio/octeon_nic.c if (OCTEON_CN23XX_PF(oct) || OCTEON_CN23XX_VF(oct)) oct 83 drivers/net/ethernet/cavium/liquidio/octeon_nic.c int octnet_send_nic_data_pkt(struct octeon_device *oct, oct 89 drivers/net/ethernet/cavium/liquidio/octeon_nic.c return octeon_send_command(oct, ndata->q_no, ring_doorbell, &ndata->cmd, oct 95 drivers/net/ethernet/cavium/liquidio/octeon_nic.c *octnic_alloc_ctrl_pkt_sc(struct octeon_device *oct, oct 109 drivers/net/ethernet/cavium/liquidio/octeon_nic.c octeon_alloc_soft_command(oct, datasize, rdatasize, 0); oct 127 drivers/net/ethernet/cavium/liquidio/octeon_nic.c octeon_prepare_soft_command(oct, sc, OPCODE_NIC, OPCODE_NIC_CMD, oct 137 drivers/net/ethernet/cavium/liquidio/octeon_nic.c octnet_send_nic_ctrl_pkt(struct octeon_device *oct, oct 143 drivers/net/ethernet/cavium/liquidio/octeon_nic.c spin_lock_bh(&oct->cmd_resp_wqlock); oct 147 drivers/net/ethernet/cavium/liquidio/octeon_nic.c if ((oct->cmd_resp_state == OCT_DRV_OFFLINE) && oct 149 drivers/net/ethernet/cavium/liquidio/octeon_nic.c spin_unlock_bh(&oct->cmd_resp_wqlock); oct 150 drivers/net/ethernet/cavium/liquidio/octeon_nic.c dev_err(&oct->pci_dev->dev, oct 156 drivers/net/ethernet/cavium/liquidio/octeon_nic.c sc = octnic_alloc_ctrl_pkt_sc(oct, nctrl); oct 158 drivers/net/ethernet/cavium/liquidio/octeon_nic.c dev_err(&oct->pci_dev->dev, "%s soft command alloc failed\n", oct 160 drivers/net/ethernet/cavium/liquidio/octeon_nic.c spin_unlock_bh(&oct->cmd_resp_wqlock); oct 164 drivers/net/ethernet/cavium/liquidio/octeon_nic.c retval = octeon_send_soft_command(oct, sc); oct 166 drivers/net/ethernet/cavium/liquidio/octeon_nic.c octeon_free_soft_command(oct, sc); oct 167 drivers/net/ethernet/cavium/liquidio/octeon_nic.c dev_err(&oct->pci_dev->dev, "%s pf_num:%d soft command:%d send failed status: %x\n", oct 168 drivers/net/ethernet/cavium/liquidio/octeon_nic.c __func__, oct->pf_num, nctrl->ncmd.s.cmd, retval); oct 169 drivers/net/ethernet/cavium/liquidio/octeon_nic.c spin_unlock_bh(&oct->cmd_resp_wqlock); oct 173 drivers/net/ethernet/cavium/liquidio/octeon_nic.c spin_unlock_bh(&oct->cmd_resp_wqlock); oct 186 drivers/net/ethernet/cavium/liquidio/octeon_nic.c retval = wait_for_sc_completion_timeout(oct, sc, 0); oct 112 drivers/net/ethernet/cavium/liquidio/octeon_nic.h static inline int octnet_iq_is_full(struct octeon_device *oct, u32 q_no) oct 114 drivers/net/ethernet/cavium/liquidio/octeon_nic.h return ((u32)atomic_read(&oct->instr_queue[q_no]->instr_pending) oct 115 drivers/net/ethernet/cavium/liquidio/octeon_nic.h >= (oct->instr_queue[q_no]->max_count - 2)); oct 119 drivers/net/ethernet/cavium/liquidio/octeon_nic.h octnet_prepare_pci_cmd_o2(struct octeon_device *oct, oct 140 drivers/net/ethernet/cavium/liquidio/octeon_nic.h port = (int)oct->instr_queue[setup->s.iq_no]->txpciq.s.port; oct 173 drivers/net/ethernet/cavium/liquidio/octeon_nic.h octnet_prepare_pci_cmd_o3(struct octeon_device *oct, oct 191 drivers/net/ethernet/cavium/liquidio/octeon_nic.h ih3->pkind = oct->instr_queue[setup->s.iq_no]->txpciq.s.pkind; oct 206 drivers/net/ethernet/cavium/liquidio/octeon_nic.h pki_ih3->uqpg = oct->instr_queue[setup->s.iq_no]->txpciq.s.use_qpg; oct 208 drivers/net/ethernet/cavium/liquidio/octeon_nic.h port = (int)oct->instr_queue[setup->s.iq_no]->txpciq.s.port; oct 216 drivers/net/ethernet/cavium/liquidio/octeon_nic.h pki_ih3->qpg = oct->instr_queue[setup->s.iq_no]->txpciq.s.qpg; oct 243 drivers/net/ethernet/cavium/liquidio/octeon_nic.h octnet_prepare_pci_cmd(struct octeon_device *oct, union octeon_instr_64B *cmd, oct 246 drivers/net/ethernet/cavium/liquidio/octeon_nic.h if (OCTEON_CN6XXX(oct)) oct 247 drivers/net/ethernet/cavium/liquidio/octeon_nic.h octnet_prepare_pci_cmd_o2(oct, cmd, setup, tag); oct 249 drivers/net/ethernet/cavium/liquidio/octeon_nic.h octnet_prepare_pci_cmd_o3(oct, cmd, setup, tag); oct 263 drivers/net/ethernet/cavium/liquidio/octeon_nic.h octeon_alloc_soft_command_resp(struct octeon_device *oct, oct 274 drivers/net/ethernet/cavium/liquidio/octeon_nic.h int octnet_send_nic_data_pkt(struct octeon_device *oct, oct 285 drivers/net/ethernet/cavium/liquidio/octeon_nic.h octnet_send_nic_ctrl_pkt(struct octeon_device *oct, oct 39 drivers/net/ethernet/cavium/liquidio/request_manager.c static void __check_db_timeout(struct octeon_device *oct, u64 iq_no); oct 43 drivers/net/ethernet/cavium/liquidio/request_manager.c static inline int IQ_INSTR_MODE_64B(struct octeon_device *oct, int iq_no) oct 46 drivers/net/ethernet/cavium/liquidio/request_manager.c (struct octeon_instr_queue *)oct->instr_queue[iq_no]; oct 50 drivers/net/ethernet/cavium/liquidio/request_manager.c #define IQ_INSTR_MODE_32B(oct, iq_no) (!IQ_INSTR_MODE_64B(oct, iq_no)) oct 56 drivers/net/ethernet/cavium/liquidio/request_manager.c int octeon_init_instr_queue(struct octeon_device *oct, oct 65 drivers/net/ethernet/cavium/liquidio/request_manager.c int numa_node = dev_to_node(&oct->pci_dev->dev); oct 67 drivers/net/ethernet/cavium/liquidio/request_manager.c if (OCTEON_CN6XXX(oct)) oct 68 drivers/net/ethernet/cavium/liquidio/request_manager.c conf = &(CFG_GET_IQ_CFG(CHIP_CONF(oct, cn6xxx))); oct 69 drivers/net/ethernet/cavium/liquidio/request_manager.c else if (OCTEON_CN23XX_PF(oct)) oct 70 drivers/net/ethernet/cavium/liquidio/request_manager.c conf = &(CFG_GET_IQ_CFG(CHIP_CONF(oct, cn23xx_pf))); oct 71 drivers/net/ethernet/cavium/liquidio/request_manager.c else if (OCTEON_CN23XX_VF(oct)) oct 72 drivers/net/ethernet/cavium/liquidio/request_manager.c conf = &(CFG_GET_IQ_CFG(CHIP_CONF(oct, cn23xx_vf))); oct 75 drivers/net/ethernet/cavium/liquidio/request_manager.c dev_err(&oct->pci_dev->dev, "Unsupported Chip %x\n", oct 76 drivers/net/ethernet/cavium/liquidio/request_manager.c oct->chip_id); oct 82 drivers/net/ethernet/cavium/liquidio/request_manager.c iq = oct->instr_queue[iq_no]; oct 84 drivers/net/ethernet/cavium/liquidio/request_manager.c iq->oct_dev = oct; oct 86 drivers/net/ethernet/cavium/liquidio/request_manager.c iq->base_addr = lio_dma_alloc(oct, q_size, &iq->base_addr_dma); oct 88 drivers/net/ethernet/cavium/liquidio/request_manager.c dev_err(&oct->pci_dev->dev, "Cannot allocate memory for instr queue %d\n", oct 105 drivers/net/ethernet/cavium/liquidio/request_manager.c lio_dma_free(oct, q_size, iq->base_addr, iq->base_addr_dma); oct 106 drivers/net/ethernet/cavium/liquidio/request_manager.c dev_err(&oct->pci_dev->dev, "Alloc failed for IQ[%d] nr free list\n", oct 113 drivers/net/ethernet/cavium/liquidio/request_manager.c dev_dbg(&oct->pci_dev->dev, "IQ[%d]: base: %p basedma: %pad count: %d\n", oct 139 drivers/net/ethernet/cavium/liquidio/request_manager.c oct->io_qmask.iq |= BIT_ULL(iq_no); oct 142 drivers/net/ethernet/cavium/liquidio/request_manager.c oct->io_qmask.iq64B |= ((conf->instr_type == 64) << iq_no); oct 145 drivers/net/ethernet/cavium/liquidio/request_manager.c oct->fn_list.setup_iq_regs(oct, iq_no); oct 147 drivers/net/ethernet/cavium/liquidio/request_manager.c oct->check_db_wq[iq_no].wq = alloc_workqueue("check_iq_db", oct 150 drivers/net/ethernet/cavium/liquidio/request_manager.c if (!oct->check_db_wq[iq_no].wq) { oct 153 drivers/net/ethernet/cavium/liquidio/request_manager.c lio_dma_free(oct, q_size, iq->base_addr, iq->base_addr_dma); oct 154 drivers/net/ethernet/cavium/liquidio/request_manager.c dev_err(&oct->pci_dev->dev, "check db wq create failed for iq %d\n", oct 159 drivers/net/ethernet/cavium/liquidio/request_manager.c db_wq = &oct->check_db_wq[iq_no]; oct 162 drivers/net/ethernet/cavium/liquidio/request_manager.c db_wq->wk.ctxptr = oct; oct 169 drivers/net/ethernet/cavium/liquidio/request_manager.c int octeon_delete_instr_queue(struct octeon_device *oct, u32 iq_no) oct 172 drivers/net/ethernet/cavium/liquidio/request_manager.c struct octeon_instr_queue *iq = oct->instr_queue[iq_no]; oct 174 drivers/net/ethernet/cavium/liquidio/request_manager.c cancel_delayed_work_sync(&oct->check_db_wq[iq_no].wk.work); oct 175 drivers/net/ethernet/cavium/liquidio/request_manager.c destroy_workqueue(oct->check_db_wq[iq_no].wq); oct 177 drivers/net/ethernet/cavium/liquidio/request_manager.c if (OCTEON_CN6XXX(oct)) oct 179 drivers/net/ethernet/cavium/liquidio/request_manager.c CFG_GET_IQ_INSTR_TYPE(CHIP_CONF(oct, cn6xxx)); oct 180 drivers/net/ethernet/cavium/liquidio/request_manager.c else if (OCTEON_CN23XX_PF(oct)) oct 182 drivers/net/ethernet/cavium/liquidio/request_manager.c CFG_GET_IQ_INSTR_TYPE(CHIP_CONF(oct, cn23xx_pf)); oct 183 drivers/net/ethernet/cavium/liquidio/request_manager.c else if (OCTEON_CN23XX_VF(oct)) oct 185 drivers/net/ethernet/cavium/liquidio/request_manager.c CFG_GET_IQ_INSTR_TYPE(CHIP_CONF(oct, cn23xx_vf)); oct 191 drivers/net/ethernet/cavium/liquidio/request_manager.c lio_dma_free(oct, (u32)q_size, iq->base_addr, oct 193 drivers/net/ethernet/cavium/liquidio/request_manager.c oct->io_qmask.iq &= ~(1ULL << iq_no); oct 194 drivers/net/ethernet/cavium/liquidio/request_manager.c vfree(oct->instr_queue[iq_no]); oct 195 drivers/net/ethernet/cavium/liquidio/request_manager.c oct->instr_queue[iq_no] = NULL; oct 196 drivers/net/ethernet/cavium/liquidio/request_manager.c oct->num_iqs--; oct 203 drivers/net/ethernet/cavium/liquidio/request_manager.c int octeon_setup_iq(struct octeon_device *oct, oct 211 drivers/net/ethernet/cavium/liquidio/request_manager.c int numa_node = dev_to_node(&oct->pci_dev->dev); oct 213 drivers/net/ethernet/cavium/liquidio/request_manager.c if (oct->instr_queue[iq_no]) { oct 214 drivers/net/ethernet/cavium/liquidio/request_manager.c dev_dbg(&oct->pci_dev->dev, "IQ is in use. Cannot create the IQ: %d again\n", oct 216 drivers/net/ethernet/cavium/liquidio/request_manager.c oct->instr_queue[iq_no]->txpciq.u64 = txpciq.u64; oct 217 drivers/net/ethernet/cavium/liquidio/request_manager.c oct->instr_queue[iq_no]->app_ctx = app_ctx; oct 220 drivers/net/ethernet/cavium/liquidio/request_manager.c oct->instr_queue[iq_no] = oct 222 drivers/net/ethernet/cavium/liquidio/request_manager.c if (!oct->instr_queue[iq_no]) oct 223 drivers/net/ethernet/cavium/liquidio/request_manager.c oct->instr_queue[iq_no] = oct 225 drivers/net/ethernet/cavium/liquidio/request_manager.c if (!oct->instr_queue[iq_no]) oct 229 drivers/net/ethernet/cavium/liquidio/request_manager.c oct->instr_queue[iq_no]->q_index = q_index; oct 230 drivers/net/ethernet/cavium/liquidio/request_manager.c oct->instr_queue[iq_no]->app_ctx = app_ctx; oct 231 drivers/net/ethernet/cavium/liquidio/request_manager.c oct->instr_queue[iq_no]->ifidx = ifidx; oct 233 drivers/net/ethernet/cavium/liquidio/request_manager.c if (octeon_init_instr_queue(oct, txpciq, num_descs)) { oct 234 drivers/net/ethernet/cavium/liquidio/request_manager.c vfree(oct->instr_queue[iq_no]); oct 235 drivers/net/ethernet/cavium/liquidio/request_manager.c oct->instr_queue[iq_no] = NULL; oct 239 drivers/net/ethernet/cavium/liquidio/request_manager.c oct->num_iqs++; oct 240 drivers/net/ethernet/cavium/liquidio/request_manager.c if (oct->fn_list.enable_io_queues(oct)) { oct 241 drivers/net/ethernet/cavium/liquidio/request_manager.c octeon_delete_instr_queue(oct, iq_no); oct 248 drivers/net/ethernet/cavium/liquidio/request_manager.c int lio_wait_for_instr_fetch(struct octeon_device *oct) oct 255 drivers/net/ethernet/cavium/liquidio/request_manager.c for (i = 0; i < MAX_OCTEON_INSTR_QUEUES(oct); i++) { oct 256 drivers/net/ethernet/cavium/liquidio/request_manager.c if (!(oct->io_qmask.iq & BIT_ULL(i))) oct 259 drivers/net/ethernet/cavium/liquidio/request_manager.c atomic_read(&oct->instr_queue[i]->instr_pending); oct 261 drivers/net/ethernet/cavium/liquidio/request_manager.c __check_db_timeout(oct, i); oct 276 drivers/net/ethernet/cavium/liquidio/request_manager.c ring_doorbell(struct octeon_device *oct, struct octeon_instr_queue *iq) oct 278 drivers/net/ethernet/cavium/liquidio/request_manager.c if (atomic_read(&oct->status) == OCT_DEV_RUNNING) { oct 288 drivers/net/ethernet/cavium/liquidio/request_manager.c octeon_ring_doorbell_locked(struct octeon_device *oct, u32 iq_no) oct 292 drivers/net/ethernet/cavium/liquidio/request_manager.c iq = oct->instr_queue[iq_no]; oct 295 drivers/net/ethernet/cavium/liquidio/request_manager.c ring_doorbell(oct, iq); oct 348 drivers/net/ethernet/cavium/liquidio/request_manager.c octeon_register_reqtype_free_fn(struct octeon_device *oct, int reqtype, oct 352 drivers/net/ethernet/cavium/liquidio/request_manager.c dev_err(&oct->pci_dev->dev, "%s: Invalid reqtype: %d\n", oct 357 drivers/net/ethernet/cavium/liquidio/request_manager.c reqtype_free_fn[oct->octeon_id][reqtype] = fn; oct 372 drivers/net/ethernet/cavium/liquidio/request_manager.c lio_process_iq_request_list(struct octeon_device *oct, oct 375 drivers/net/ethernet/cavium/liquidio/request_manager.c struct cavium_wq *cwq = &oct->dma_comp_wq; oct 398 drivers/net/ethernet/cavium/liquidio/request_manager.c reqtype_free_fn[oct->octeon_id][reqtype](buf); oct 409 drivers/net/ethernet/cavium/liquidio/request_manager.c spin_lock_irqsave(&oct->response_list oct 411 drivers/net/ethernet/cavium/liquidio/request_manager.c atomic_inc(&oct->response_list oct 413 drivers/net/ethernet/cavium/liquidio/request_manager.c list_add_tail(&sc->node, &oct->response_list oct 415 drivers/net/ethernet/cavium/liquidio/request_manager.c spin_unlock_irqrestore(&oct->response_list oct 420 drivers/net/ethernet/cavium/liquidio/request_manager.c dev_err(&oct->pci_dev->dev, oct 440 drivers/net/ethernet/cavium/liquidio/request_manager.c if (atomic_read(&oct->response_list oct 449 drivers/net/ethernet/cavium/liquidio/request_manager.c octeon_flush_iq(struct octeon_device *oct, struct octeon_instr_queue *iq, oct 461 drivers/net/ethernet/cavium/liquidio/request_manager.c iq->octeon_read_index = oct->fn_list.update_iq_read_idx(iq); oct 470 drivers/net/ethernet/cavium/liquidio/request_manager.c lio_process_iq_request_list(oct, iq, oct 475 drivers/net/ethernet/cavium/liquidio/request_manager.c lio_process_iq_request_list(oct, iq, 0); oct 501 drivers/net/ethernet/cavium/liquidio/request_manager.c static void __check_db_timeout(struct octeon_device *oct, u64 iq_no) oct 506 drivers/net/ethernet/cavium/liquidio/request_manager.c if (!oct) oct 509 drivers/net/ethernet/cavium/liquidio/request_manager.c iq = oct->instr_queue[iq_no]; oct 523 drivers/net/ethernet/cavium/liquidio/request_manager.c octeon_flush_iq(oct, iq, 0); oct 534 drivers/net/ethernet/cavium/liquidio/request_manager.c struct octeon_device *oct = (struct octeon_device *)wk->ctxptr; oct 536 drivers/net/ethernet/cavium/liquidio/request_manager.c struct cavium_wq *db_wq = &oct->check_db_wq[iq_no]; oct 539 drivers/net/ethernet/cavium/liquidio/request_manager.c __check_db_timeout(oct, iq_no); oct 544 drivers/net/ethernet/cavium/liquidio/request_manager.c octeon_send_command(struct octeon_device *oct, u32 iq_no, oct 550 drivers/net/ethernet/cavium/liquidio/request_manager.c struct octeon_instr_queue *iq = oct->instr_queue[iq_no]; oct 563 drivers/net/ethernet/cavium/liquidio/request_manager.c INCR_INSTRQUEUE_PKT_COUNT(oct, iq_no, bytes_sent, datasize); oct 564 drivers/net/ethernet/cavium/liquidio/request_manager.c INCR_INSTRQUEUE_PKT_COUNT(oct, iq_no, instr_posted, 1); oct 568 drivers/net/ethernet/cavium/liquidio/request_manager.c ring_doorbell(oct, iq); oct 570 drivers/net/ethernet/cavium/liquidio/request_manager.c INCR_INSTRQUEUE_PKT_COUNT(oct, iq_no, instr_dropped, 1); oct 584 drivers/net/ethernet/cavium/liquidio/request_manager.c octeon_prepare_soft_command(struct octeon_device *oct, oct 602 drivers/net/ethernet/cavium/liquidio/request_manager.c oct_cfg = octeon_get_conf(oct); oct 604 drivers/net/ethernet/cavium/liquidio/request_manager.c if (OCTEON_CN23XX_PF(oct) || OCTEON_CN23XX_VF(oct)) { oct 607 drivers/net/ethernet/cavium/liquidio/request_manager.c ih3->pkind = oct->instr_queue[sc->iq_no]->txpciq.s.pkind; oct 615 drivers/net/ethernet/cavium/liquidio/request_manager.c oct->instr_queue[sc->iq_no]->txpciq.s.use_qpg; oct 620 drivers/net/ethernet/cavium/liquidio/request_manager.c oct->instr_queue[sc->iq_no]->txpciq.s.ctrl_qpg; oct 639 drivers/net/ethernet/cavium/liquidio/request_manager.c rdp->pcie_port = oct->pcie_port; oct 676 drivers/net/ethernet/cavium/liquidio/request_manager.c rdp->pcie_port = oct->pcie_port; oct 690 drivers/net/ethernet/cavium/liquidio/request_manager.c int octeon_send_soft_command(struct octeon_device *oct, oct 699 drivers/net/ethernet/cavium/liquidio/request_manager.c iq = oct->instr_queue[sc->iq_no]; oct 701 drivers/net/ethernet/cavium/liquidio/request_manager.c dev_err(&oct->pci_dev->dev, "Soft commands are not allowed on Queue %d\n", oct 703 drivers/net/ethernet/cavium/liquidio/request_manager.c INCR_INSTRQUEUE_PKT_COUNT(oct, sc->iq_no, instr_dropped, 1); oct 707 drivers/net/ethernet/cavium/liquidio/request_manager.c if (OCTEON_CN23XX_PF(oct) || OCTEON_CN23XX_VF(oct)) { oct 739 drivers/net/ethernet/cavium/liquidio/request_manager.c return (octeon_send_command(oct, sc->iq_no, 1, &sc->cmd, sc, oct 743 drivers/net/ethernet/cavium/liquidio/request_manager.c int octeon_setup_sc_buffer_pool(struct octeon_device *oct) oct 749 drivers/net/ethernet/cavium/liquidio/request_manager.c INIT_LIST_HEAD(&oct->sc_buf_pool.head); oct 750 drivers/net/ethernet/cavium/liquidio/request_manager.c spin_lock_init(&oct->sc_buf_pool.lock); oct 751 drivers/net/ethernet/cavium/liquidio/request_manager.c atomic_set(&oct->sc_buf_pool.alloc_buf_count, 0); oct 755 drivers/net/ethernet/cavium/liquidio/request_manager.c lio_dma_alloc(oct, oct 759 drivers/net/ethernet/cavium/liquidio/request_manager.c octeon_free_sc_buffer_pool(oct); oct 766 drivers/net/ethernet/cavium/liquidio/request_manager.c list_add_tail(&sc->node, &oct->sc_buf_pool.head); oct 772 drivers/net/ethernet/cavium/liquidio/request_manager.c int octeon_free_sc_done_list(struct octeon_device *oct) oct 779 drivers/net/ethernet/cavium/liquidio/request_manager.c done_sc_list = &oct->response_list[OCTEON_DONE_SC_LIST]; oct 780 drivers/net/ethernet/cavium/liquidio/request_manager.c zombie_sc_list = &oct->response_list[OCTEON_ZOMBIE_SC_LIST]; oct 785 drivers/net/ethernet/cavium/liquidio/request_manager.c sc_lists_lock = &oct->response_list[OCTEON_ORDERED_SC_LIST].lock; oct 801 drivers/net/ethernet/cavium/liquidio/request_manager.c octeon_free_soft_command(oct, sc); oct 811 drivers/net/ethernet/cavium/liquidio/request_manager.c int octeon_free_sc_zombie_list(struct octeon_device *oct) oct 818 drivers/net/ethernet/cavium/liquidio/request_manager.c zombie_sc_list = &oct->response_list[OCTEON_ZOMBIE_SC_LIST]; oct 819 drivers/net/ethernet/cavium/liquidio/request_manager.c sc_lists_lock = &oct->response_list[OCTEON_ORDERED_SC_LIST].lock; oct 827 drivers/net/ethernet/cavium/liquidio/request_manager.c octeon_free_soft_command(oct, sc); oct 835 drivers/net/ethernet/cavium/liquidio/request_manager.c int octeon_free_sc_buffer_pool(struct octeon_device *oct) oct 840 drivers/net/ethernet/cavium/liquidio/request_manager.c octeon_free_sc_zombie_list(oct); oct 842 drivers/net/ethernet/cavium/liquidio/request_manager.c spin_lock_bh(&oct->sc_buf_pool.lock); oct 844 drivers/net/ethernet/cavium/liquidio/request_manager.c list_for_each_safe(tmp, tmp2, &oct->sc_buf_pool.head) { oct 849 drivers/net/ethernet/cavium/liquidio/request_manager.c lio_dma_free(oct, sc->size, sc, sc->dma_addr); oct 852 drivers/net/ethernet/cavium/liquidio/request_manager.c INIT_LIST_HEAD(&oct->sc_buf_pool.head); oct 854 drivers/net/ethernet/cavium/liquidio/request_manager.c spin_unlock_bh(&oct->sc_buf_pool.lock); oct 859 drivers/net/ethernet/cavium/liquidio/request_manager.c struct octeon_soft_command *octeon_alloc_soft_command(struct octeon_device *oct, oct 876 drivers/net/ethernet/cavium/liquidio/request_manager.c spin_lock_bh(&oct->sc_buf_pool.lock); oct 878 drivers/net/ethernet/cavium/liquidio/request_manager.c if (list_empty(&oct->sc_buf_pool.head)) { oct 879 drivers/net/ethernet/cavium/liquidio/request_manager.c spin_unlock_bh(&oct->sc_buf_pool.lock); oct 883 drivers/net/ethernet/cavium/liquidio/request_manager.c list_for_each(tmp, &oct->sc_buf_pool.head) oct 888 drivers/net/ethernet/cavium/liquidio/request_manager.c atomic_inc(&oct->sc_buf_pool.alloc_buf_count); oct 890 drivers/net/ethernet/cavium/liquidio/request_manager.c spin_unlock_bh(&oct->sc_buf_pool.lock); oct 930 drivers/net/ethernet/cavium/liquidio/request_manager.c void octeon_free_soft_command(struct octeon_device *oct, oct 933 drivers/net/ethernet/cavium/liquidio/request_manager.c spin_lock_bh(&oct->sc_buf_pool.lock); oct 935 drivers/net/ethernet/cavium/liquidio/request_manager.c list_add_tail(&sc->node, &oct->sc_buf_pool.head); oct 937 drivers/net/ethernet/cavium/liquidio/request_manager.c atomic_dec(&oct->sc_buf_pool.alloc_buf_count); oct 939 drivers/net/ethernet/cavium/liquidio/request_manager.c spin_unlock_bh(&oct->sc_buf_pool.lock); oct 30 drivers/net/ethernet/cavium/liquidio/response_manager.c int octeon_setup_response_list(struct octeon_device *oct) oct 36 drivers/net/ethernet/cavium/liquidio/response_manager.c INIT_LIST_HEAD(&oct->response_list[i].head); oct 37 drivers/net/ethernet/cavium/liquidio/response_manager.c spin_lock_init(&oct->response_list[i].lock); oct 38 drivers/net/ethernet/cavium/liquidio/response_manager.c atomic_set(&oct->response_list[i].pending_req_count, 0); oct 40 drivers/net/ethernet/cavium/liquidio/response_manager.c spin_lock_init(&oct->cmd_resp_wqlock); oct 42 drivers/net/ethernet/cavium/liquidio/response_manager.c oct->dma_comp_wq.wq = alloc_workqueue("dma-comp", WQ_MEM_RECLAIM, 0); oct 43 drivers/net/ethernet/cavium/liquidio/response_manager.c if (!oct->dma_comp_wq.wq) { oct 44 drivers/net/ethernet/cavium/liquidio/response_manager.c dev_err(&oct->pci_dev->dev, "failed to create wq thread\n"); oct 48 drivers/net/ethernet/cavium/liquidio/response_manager.c cwq = &oct->dma_comp_wq; oct 50 drivers/net/ethernet/cavium/liquidio/response_manager.c cwq->wk.ctxptr = oct; oct 51 drivers/net/ethernet/cavium/liquidio/response_manager.c oct->cmd_resp_state = OCT_DRV_ONLINE; oct 56 drivers/net/ethernet/cavium/liquidio/response_manager.c void octeon_delete_response_list(struct octeon_device *oct) oct 58 drivers/net/ethernet/cavium/liquidio/response_manager.c cancel_delayed_work_sync(&oct->dma_comp_wq.wk.work); oct 59 drivers/net/ethernet/cavium/liquidio/response_manager.c destroy_workqueue(oct->dma_comp_wq.wq); oct 226 drivers/net/ethernet/cavium/liquidio/response_manager.c struct octeon_device *oct = (struct octeon_device *)wk->ctxptr; oct 227 drivers/net/ethernet/cavium/liquidio/response_manager.c struct cavium_wq *cwq = &oct->dma_comp_wq; oct 229 drivers/net/ethernet/cavium/liquidio/response_manager.c lio_process_ordered_list(oct, 0); oct 231 drivers/net/ethernet/cavium/liquidio/response_manager.c if (atomic_read(&oct->response_list