Lines Matching +full:0 +full:x20020000
114 MODULE_PARM_DESC(mrrs, " Force Max Read Req Size (0..3) (for debug)");
135 BCM57710 = 0,
274 { 0 }
400 DP(msglvl, "DMAE: opcode 0x%08x\n" in bnx2x_dp_dmae()
402 "comp_addr [%x:%08x], comp_val 0x%08x\n", in bnx2x_dp_dmae()
408 DP(msglvl, "DMAE: opcode 0x%08x\n" in bnx2x_dp_dmae()
410 "comp_addr [%x:%08x], comp_val 0x%08x\n", in bnx2x_dp_dmae()
418 DP(msglvl, "DMAE: opcode 0x%08x\n" in bnx2x_dp_dmae()
420 "comp_addr [%x:%08x], comp_val 0x%08x\n", in bnx2x_dp_dmae()
426 DP(msglvl, "DMAE: opcode 0x%08x\n" in bnx2x_dp_dmae()
428 "comp_addr [%x:%08x], comp_val 0x%08x\n", in bnx2x_dp_dmae()
436 DP(msglvl, "DMAE: opcode 0x%08x\n" in bnx2x_dp_dmae()
438 "comp_addr [%x:%08x] comp_val 0x%08x\n", in bnx2x_dp_dmae()
443 DP(msglvl, "DMAE: opcode 0x%08x\n" in bnx2x_dp_dmae()
445 "comp_addr [%x:%08x] comp_val 0x%08x\n", in bnx2x_dp_dmae()
452 for (i = 0; i < (sizeof(struct dmae_command)/4); i++) in bnx2x_dp_dmae()
453 DP(msglvl, "DMAE RAW [%02d]: 0x%08x\n", in bnx2x_dp_dmae()
464 for (i = 0; i < (sizeof(struct dmae_command)/4); i++) { in bnx2x_post_dmae()
484 u32 opcode = 0; in bnx2x_dmae_opcode()
510 memset(dmae, 0, sizeof(struct dmae_command)); in bnx2x_prep_dmae_with_comp()
527 int rc = 0; in bnx2x_issue_dmae_with_comp()
539 *comp = 0; in bnx2x_issue_dmae_with_comp()
577 u32 *data = bnx2x_sp(bp, wb_data[0]); in bnx2x_write_dmae()
593 dmae.dst_addr_hi = 0; in bnx2x_write_dmae()
612 u32 *data = bnx2x_sp(bp, wb_data[0]); in bnx2x_read_dmae()
616 for (i = 0; i < len32; i++) in bnx2x_read_dmae()
619 for (i = 0; i < len32; i++) in bnx2x_read_dmae()
630 dmae.src_addr_hi = 0; in bnx2x_read_dmae()
649 int offset = 0; in bnx2x_write_dmae_phys_len()
695 int i, j, rc = 0; in bnx2x_mc_assert()
721 BNX2X_ERR("%s_ASSERT_LIST_INDEX 0x%x\n", in bnx2x_mc_assert()
725 for (i = 0; i < STROM_ASSERT_ARRAY_SIZE; i++) { in bnx2x_mc_assert()
727 for (j = 0; j < REGS_IN_ENTRY; j++) in bnx2x_mc_assert()
735 if (regs[0] != COMMON_ASM_INVALID_ASSERT_OPCODE) { in bnx2x_mc_assert()
736 BNX2X_ERR("%s_ASSERT_INDEX 0x%x = 0x%08x 0x%08x 0x%08x 0x%08x\n", in bnx2x_mc_assert()
738 regs[2], regs[1], regs[0]); in bnx2x_mc_assert()
757 #define MCPR_TRACE_BUFFER_SIZE (0x800)
759 (CHIP_IS_E1(bp) ? 0x10000 : (CHIP_IS_E1H(bp) ? 0x20000 : 0x28000))
773 (bp->common.bc_ver & 0xff0000) >> 16, in bnx2x_fw_dump_lvl()
774 (bp->common.bc_ver & 0xff00) >> 8, in bnx2x_fw_dump_lvl()
775 (bp->common.bc_ver & 0xff)); in bnx2x_fw_dump_lvl()
784 BNX2X_ERR("%s" "MCP PC at 0x%x\n", lvl, val); in bnx2x_fw_dump_lvl()
786 if (BP_PATH(bp) == 0) in bnx2x_fw_dump_lvl()
812 mark = MCPR_SCRATCH_BASE(bp) + ((mark + 0x3) & ~0x3) - 0x08000000; in bnx2x_fw_dump_lvl()
817 printk("%s" "begin fw dump (mark 0x%x)\n", lvl, mark); in bnx2x_fw_dump_lvl()
822 for (offset = mark; offset < trace_shmem_base; offset += 0x8*4) { in bnx2x_fw_dump_lvl()
823 for (word = 0; word < 8; word++) in bnx2x_fw_dump_lvl()
825 data[8] = 0x0; in bnx2x_fw_dump_lvl()
830 for (offset = addr + 4; offset <= mark; offset += 0x8*4) { in bnx2x_fw_dump_lvl()
831 for (word = 0; word < 8; word++) in bnx2x_fw_dump_lvl()
833 data[8] = 0x0; in bnx2x_fw_dump_lvl()
859 REG_WR(bp, HC_REG_INT_MASK + port*4, 0); in bnx2x_hc_int_disable()
871 "write %x to HC %d (addr 0x%x)\n", in bnx2x_hc_int_disable()
909 u16 start = 0, end = 0; in bnx2x_panic_dump()
927 …BNX2X_ERR("def_idx(0x%x) def_att_idx(0x%x) attn_state(0x%x) spq_prod_idx(0x%x) next_stats_cnt(0… in bnx2x_panic_dump()
930 BNX2X_ERR("DSB: attn bits(0x%x) ack(0x%x) id(0x%x) idx(0x%x)\n", in bnx2x_panic_dump()
936 for (i = 0; i < HC_SP_SB_MAX_INDICES; i++) in bnx2x_panic_dump()
937 pr_cont("0x%x%s", in bnx2x_panic_dump()
944 for (i = 0; i < data_size; i++) in bnx2x_panic_dump()
949 …pr_cont("igu_sb_id(0x%x) igu_seg_id(0x%x) pf_id(0x%x) vnic_id(0x%x) vf_id(0x%x) vf_valid (0x%x… in bnx2x_panic_dump()
983 …BNX2X_ERR("fp%d: rx_bd_prod(0x%x) rx_bd_cons(0x%x) rx_comp_prod(0x%x) rx_comp_cons(0x%x) *rx_c… in bnx2x_panic_dump()
987 BNX2X_ERR(" rx_sge_prod(0x%x) last_max_sge(0x%x) fp_hc_idx(0x%x)\n", in bnx2x_panic_dump()
1002 …BNX2X_ERR("fp%d: tx_pkt_prod(0x%x) tx_pkt_cons(0x%x) tx_bd_prod(0x%x) tx_bd_cons(0x%x) *tx_con… in bnx2x_panic_dump()
1018 for (j = 0; j < HC_SB_MAX_SM; j++) in bnx2x_panic_dump()
1019 pr_cont("0x%x%s", in bnx2x_panic_dump()
1024 for (j = 0; j < loop; j++) in bnx2x_panic_dump()
1025 pr_cont("0x%x%s", in bnx2x_panic_dump()
1042 for (j = 0; j < data_size; j++) in bnx2x_panic_dump()
1048 …pr_cont("pf_id(0x%x) vf_id(0x%x) vf_valid(0x%x) vnic_id(0x%x) same_igu_sb_1b(0x%x) state(0x%x)\… in bnx2x_panic_dump()
1056 …pr_cont("pf_id(0x%x) vf_id(0x%x) vf_valid(0x%x) vnic_id(0x%x) same_igu_sb_1b(0x%x) state(0x%x)\… in bnx2x_panic_dump()
1066 for (j = 0; j < HC_SB_MAX_SM; j++) { in bnx2x_panic_dump()
1067 …pr_cont("SM[%d] __flags (0x%x) igu_sb_id (0x%x) igu_seg_id(0x%x) time_to_expire (0x%x) timer_valu… in bnx2x_panic_dump()
1076 for (j = 0; j < loop; j++) { in bnx2x_panic_dump()
1077 pr_cont("INDEX[%d] flags (0x%x) timeout (0x%x)\n", j, in bnx2x_panic_dump()
1087 for (i = 0; i < NUM_EQ_DESC; i++) { in bnx2x_panic_dump()
1094 data[0], data[1], data[2]); in bnx2x_panic_dump()
1116 i, j, rx_bd[1], rx_bd[0], sw_bd->data); in bnx2x_panic_dump()
1126 i, j, rx_sge[1], rx_sge[0], sw_page->page); in bnx2x_panic_dump()
1135 i, j, cqe[0], cqe[1], cqe[2], cqe[3]); in bnx2x_panic_dump()
1172 i, cos, j, tx_bd[0], tx_bd[1], in bnx2x_panic_dump()
1299 u32 val = bnx2x_flr_clnup_reg_poll(bp, reg, 0, poll_cnt); in bnx2x_flr_clnup_poll_hw_counter()
1300 if (val != 0) { in bnx2x_flr_clnup_poll_hw_counter()
1304 return 0; in bnx2x_flr_clnup_poll_hw_counter()
1323 {0, (CHIP_IS_E3B0(bp)) ? in bnx2x_tx_hw_flushed()
1344 {0, (CHIP_IS_E3B0(bp)) ? in bnx2x_tx_hw_flushed()
1376 for (i = 0; i < ARRAY_SIZE(cmd_regs); i++) in bnx2x_tx_hw_flushed()
1380 for (i = 0; i < ARRAY_SIZE(buf_regs); i++) in bnx2x_tx_hw_flushed()
1395 u32 op_gen_command = 0; in bnx2x_send_final_clnup()
1400 BNX2X_ERR("Cleanup complete was not 0 before sending\n"); in bnx2x_send_final_clnup()
1420 REG_WR(bp, comp_addr, 0); in bnx2x_send_final_clnup()
1422 return 0; in bnx2x_send_final_clnup()
1477 return 0; in bnx2x_poll_hw_usage_counters()
1485 DP(BNX2X_MSG_SP, "CFC_REG_WEAK_ENABLE_PF is 0x%x\n", val); in bnx2x_hw_enable_status()
1488 DP(BNX2X_MSG_SP, "PBF_REG_DISABLE_PF is 0x%x\n", val); in bnx2x_hw_enable_status()
1491 DP(BNX2X_MSG_SP, "IGU_REG_PCI_PF_MSI_EN is 0x%x\n", val); in bnx2x_hw_enable_status()
1494 DP(BNX2X_MSG_SP, "IGU_REG_PCI_PF_MSIX_EN is 0x%x\n", val); in bnx2x_hw_enable_status()
1497 DP(BNX2X_MSG_SP, "IGU_REG_PCI_PF_MSIX_FUNC_MASK is 0x%x\n", val); in bnx2x_hw_enable_status()
1500 DP(BNX2X_MSG_SP, "PGLUE_B_REG_SHADOW_BME_PF_7_0_CLR is 0x%x\n", val); in bnx2x_hw_enable_status()
1503 DP(BNX2X_MSG_SP, "PGLUE_B_REG_FLR_REQUEST_PF_7_0_CLR is 0x%x\n", val); in bnx2x_hw_enable_status()
1506 DP(BNX2X_MSG_SP, "PGLUE_B_REG_INTERNAL_PFID_ENABLE_MASTER is 0x%x\n", in bnx2x_hw_enable_status()
1551 return 0; in bnx2x_pf_flr_clnup()
1583 "write %x to HC %d (addr 0x%x)\n", val, port, addr); in bnx2x_hc_int_enable()
1592 REG_WR(bp, HC_REG_INT_MASK + port*4, 0x1FFFF); in bnx2x_hc_int_enable()
1595 "write %x to HC %d (addr 0x%x) mode %s\n", val, port, addr, in bnx2x_hc_int_enable()
1607 val = (0xee0f | (1 << (BP_VN(bp) + 4))); in bnx2x_hc_int_enable()
1610 val |= 0x1100; in bnx2x_hc_int_enable()
1612 val = 0xffff; in bnx2x_hc_int_enable()
1656 DP(NETIF_MSG_IFUP, "write 0x%x to IGU mode %s\n", in bnx2x_igu_int_enable()
1668 val = (0xee0f | (1 << (BP_VN(bp) + 4))); in bnx2x_igu_int_enable()
1671 val |= 0x1100; in bnx2x_igu_int_enable()
1673 val = 0xffff; in bnx2x_igu_int_enable()
1689 int msix = (bp->flags & USING_MSIX_FLAG) ? 1 : 0; in bnx2x_int_disable_sync()
1698 synchronize_irq(bp->msix_table[0].vector); in bnx2x_int_disable_sync()
1733 "resource(0x%x) > HW_LOCK_MAX_RESOURCE_VALUE(0x%x)\n", in bnx2x_trylock_hw_lock()
1801 return queue_delayed_work(bnx2x_wq, &bp->sp_task, 0); in bnx2x_schedule_sp_task()
1921 if (unlikely(status == 0)) { in bnx2x_interrupt()
1925 DP(NETIF_MSG_INTR, "got an interrupt status 0x%x\n", status); in bnx2x_interrupt()
1935 mask = 0x2 << (fp->index + CNIC_SUPPORT(bp)); in bnx2x_interrupt()
1947 mask = 0x2; in bnx2x_interrupt()
1948 if (status & (mask | 0x1)) { in bnx2x_interrupt()
1962 if (unlikely(status & 0x1)) { in bnx2x_interrupt()
1969 status &= ~0x1; in bnx2x_interrupt()
1975 DP(NETIF_MSG_INTR, "got an unknown interrupt! (status 0x%x)\n", in bnx2x_interrupt()
1997 BNX2X_ERR("resource(0x%x) > HW_LOCK_MAX_RESOURCE_VALUE(0x%x)\n", in bnx2x_acquire_hw_lock()
2012 BNX2X_ERR("lock_status 0x%x resource_bit 0x%x\n", in bnx2x_acquire_hw_lock()
2018 for (cnt = 0; cnt < 1000; cnt++) { in bnx2x_acquire_hw_lock()
2023 return 0; in bnx2x_acquire_hw_lock()
2045 BNX2X_ERR("resource(0x%x) > HW_LOCK_MAX_RESOURCE_VALUE(0x%x)\n", in bnx2x_release_hw_lock()
2060 BNX2X_ERR("lock_status 0x%x resource_bit 0x%x. Unlock was called but lock wasn't taken!\n", in bnx2x_release_hw_lock()
2066 return 0; in bnx2x_release_hw_lock()
2075 (gpio_port ? MISC_REGISTERS_GPIO_PORT_SHIFT : 0); in bnx2x_get_gpio()
2092 value = 0; in bnx2x_get_gpio()
2103 (gpio_port ? MISC_REGISTERS_GPIO_PORT_SHIFT : 0); in bnx2x_set_gpio()
2150 return 0; in bnx2x_set_gpio()
2155 u32 gpio_reg = 0; in bnx2x_set_mult_gpio()
2156 int rc = 0; in bnx2x_set_mult_gpio()
2169 DP(NETIF_MSG_LINK, "Set GPIO 0x%x -> output low\n", pins); in bnx2x_set_mult_gpio()
2175 DP(NETIF_MSG_LINK, "Set GPIO 0x%x -> output high\n", pins); in bnx2x_set_mult_gpio()
2181 DP(NETIF_MSG_LINK, "Set GPIO 0x%x -> input\n", pins); in bnx2x_set_mult_gpio()
2192 if (rc == 0) in bnx2x_set_mult_gpio()
2206 (gpio_port ? MISC_REGISTERS_GPIO_PORT_SHIFT : 0); in bnx2x_set_gpio_int()
2245 return 0; in bnx2x_set_gpio_int()
2254 BNX2X_ERR("Invalid SPIO 0x%x\n", spio); in bnx2x_set_spio()
2264 DP(NETIF_MSG_HW, "Set SPIO 0x%x -> output low\n", spio); in bnx2x_set_spio()
2271 DP(NETIF_MSG_HW, "Set SPIO 0x%x -> output high\n", spio); in bnx2x_set_spio()
2278 DP(NETIF_MSG_HW, "Set SPIO 0x%x -> input\n", spio); in bnx2x_set_spio()
2290 return 0; in bnx2x_set_spio()
2329 u32 pause_enabled = 0; in bnx2x_init_dropless_fc()
2389 queue_delayed_work(bnx2x_wq, &bp->period_task, 0); in bnx2x_initial_phy_init()
2430 u8 rc = 0; in bnx2x_link_test()
2448 0 - if all the min_rates are 0.
2465 vn_min_rate = 0; in bnx2x_calc_vn_min()
2470 all_zero = 0; in bnx2x_calc_vn_min()
2497 vn_max_rate = 0; in bnx2x_calc_vn_max()
2563 memset(&input, 0, sizeof(struct cmng_init_input)); in bnx2x_cmng_fns_init()
2574 /* vn_weight_sum and enable fairness if not 0 */ in bnx2x_cmng_fns_init()
2656 memset(&(pstats->mac_stx[0]), 0, in bnx2x_link_attn()
2689 bp->port.supported[0] |= (SUPPORTED_10baseT_Half | in bnx2x__link_status_update()
2701 bp->port.advertising[0] = bp->port.supported[0]; in bnx2x__link_status_update()
2705 bp->link_params.req_duplex[0] = DUPLEX_FULL; in bnx2x__link_status_update()
2706 bp->link_params.req_flow_ctrl[0] = BNX2X_FLOW_CTRL_NONE; in bnx2x__link_status_update()
2707 bp->link_params.req_line_speed[0] = SPEED_10000; in bnx2x__link_status_update()
2708 bp->link_params.speed_cap_mask[0] = 0x7f0000; in bnx2x__link_status_update()
2750 if (bnx2x_func_state_change(bp, &func_params) < 0) in bnx2x_afex_func_update()
2751 bnx2x_fw_command(bp, DRV_MSG_CODE_AFEX_VIFSET_ACK, 0); in bnx2x_afex_func_update()
2753 return 0; in bnx2x_afex_func_update()
2767 BNX2X_ERR("BUG! afex_handle_vif_list_cmd invalid type 0x%x\n", in bnx2x_afex_handle_vif_list_cmd()
2777 (cmd_type == VIF_LIST_RULE_GET) ? 0 : func_bit_map; in bnx2x_afex_handle_vif_list_cmd()
2778 update_params->func_to_clear = 0; in bnx2x_afex_handle_vif_list_cmd()
2788 if (rc < 0) in bnx2x_afex_handle_vif_list_cmd()
2789 bnx2x_fw_command(bp, drv_msg_code, 0); in bnx2x_afex_handle_vif_list_cmd()
2791 return 0; in bnx2x_afex_handle_vif_list_cmd()
2809 "afex: got MCP req LISTGET_REQ for vifid 0x%x\n", vifid); in bnx2x_handle_afex_cmd()
2810 bnx2x_afex_handle_vif_list_cmd(bp, VIF_LIST_RULE_GET, vifid, 0); in bnx2x_handle_afex_cmd()
2817 "afex: got MCP req LISTSET_REQ for vifid 0x%x addrs 0x%x\n", in bnx2x_handle_afex_cmd()
2830 "afex: got MCP req STATSGET_REQ, write to addr 0x%x\n", in bnx2x_handle_afex_cmd()
2836 for (i = 0; i < (sizeof(struct afex_stats)/sizeof(u32)); i++) in bnx2x_handle_afex_cmd()
2841 bnx2x_fw_command(bp, DRV_MSG_CODE_AFEX_STATSGET_ACK, 0); in bnx2x_handle_afex_cmd()
2848 "afex: got MCP req VIFSET_REQ, mf_config 0x%x\n", in bnx2x_handle_afex_cmd()
2907 bnx2x_afex_func_update(bp, 0xFFFF, 0, 0); in bnx2x_handle_afex_cmd()
2920 memset(&func_params, 0, sizeof(struct bnx2x_func_state_params)); in bnx2x_handle_update_svid_cmd()
2952 if (bnx2x_func_state_change(bp, &func_params) < 0) { in bnx2x_handle_update_svid_cmd()
2964 bnx2x_fw_command(bp, DRV_MSG_CODE_OEM_UPDATE_SVID_OK, 0); in bnx2x_handle_update_svid_cmd()
2967 bnx2x_fw_command(bp, DRV_MSG_CODE_OEM_UPDATE_SVID_FAILURE, 0); in bnx2x_handle_update_svid_cmd()
2985 queue_delayed_work(bnx2x_wq, &bp->period_task, 0); in bnx2x_pmf_update()
2990 val = (0xff0f | (1 << (BP_VN(bp) + 4))); in bnx2x_pmf_update()
3015 u32 rc = 0; in bnx2x_fw_command()
3024 DP(BNX2X_MSG_MCP, "wrote command (%x) to FW MB param 0x%08x\n", in bnx2x_fw_command()
3046 rc = 0; in bnx2x_fw_command()
3068 struct tstorm_eth_function_common_config tcfg = {0}; in bnx2x_func_init()
3098 unsigned long flags = 0; in bnx2x_get_common_flags()
3129 unsigned long flags = 0; in bnx2x_get_q_flags()
3185 u8 max_sge = 0; in bnx2x_pf_rx_q_prep()
3186 u16 sge_sz = 0; in bnx2x_pf_rx_q_prep()
3187 u16 tpa_agg_size = 0; in bnx2x_pf_rx_q_prep()
3203 sge_sz = (u16)min_t(u32, SGE_PAGES, 0xffff); in bnx2x_pf_rx_q_prep()
3282 txq_init->tss_leading_cl_id = bnx2x_fp(bp, 0, cl_id); in bnx2x_pf_tx_q_prep()
3292 struct bnx2x_func_init_params func_init = {0}; in bnx2x_pf_init()
3293 struct event_ring_data eq_data = { {0} }; in bnx2x_pf_init()
3301 BP_FUNC(bp) : BP_VN(bp))*4, 0); in bnx2x_pf_init()
3307 BP_FUNC(bp) : BP_VN(bp))*4, 0); in bnx2x_pf_init()
3318 memset(&(bp->cmng), 0, sizeof(struct cmng_struct_per_port)); in bnx2x_pf_init()
3348 REG_WR(bp, NIG_REG_LLH0_FUNC_EN + port*8, 0); in bnx2x_e1h_disable()
3388 for (i = 0; i < DRV_INFO_ETH_STAT_NUM_MACS_REQUIRED; i++) in bnx2x_drv_info_ether_stat()
3389 memset(ether_stat->mac_local + i, 0, in bnx2x_drv_info_ether_stat()
3390 sizeof(ether_stat->mac_local[0])); in bnx2x_drv_info_ether_stat()
3391 mac_obj->get_n_elements(bp, &bp->sp_objs[0].mac_obj, in bnx2x_drv_info_ether_stat()
3402 ether_stat->promiscuous_mode = (bp->dev->flags & IFF_PROMISC) ? 1 : 0; in bnx2x_drv_info_ether_stat()
3408 ether_stat->vf_cnt = IS_SRIOV(bp) ? bp->vfdb->sriov.nr_virtfn : 0; in bnx2x_drv_info_ether_stat()
3560 bnx2x_fw_command(bp, DRV_MSG_CODE_SET_MF_BW_ACK, 0); in bnx2x_set_mf_bw()
3566 bnx2x_fw_command(bp, DRV_MSG_CODE_EEE_RESULTS_ACK, 0); in bnx2x_handle_eee_event()
3581 bnx2x_fw_command(bp, DRV_MSG_CODE_DRV_INFO_NACK, 0); in bnx2x_handle_drv_info_req()
3591 memset(&bp->slowpath->drv_info_to_mcp, 0, in bnx2x_handle_drv_info_req()
3606 bnx2x_fw_command(bp, DRV_MSG_CODE_DRV_INFO_NACK, 0); in bnx2x_handle_drv_info_req()
3618 bnx2x_fw_command(bp, DRV_MSG_CODE_DRV_INFO_ACK, 0); in bnx2x_handle_drv_info_req()
3629 for (wait = 0; wait < BNX2X_UPDATE_DRV_INFO_IND_COUNT; wait++) { in bnx2x_handle_drv_info_req()
3655 int i = 0; in bnx2x_update_mng_version_utility()
3659 &vals[0], &vals[1], &vals[2], &vals[3]); in bnx2x_update_mng_version_utility()
3660 if (i > 0) in bnx2x_update_mng_version_utility()
3661 vals[0] -= '0'; in bnx2x_update_mng_version_utility()
3664 &vals[0], &vals[1], &vals[2], &vals[3]); in bnx2x_update_mng_version_utility()
3668 vals[i++] = 0; in bnx2x_update_mng_version_utility()
3670 return (vals[0] << 24) | (vals[1] << 16) | (vals[2] << 8) | vals[3]; in bnx2x_update_mng_version_utility()
3698 memset(&bp->slowpath->drv_info_to_mcp, 0, in bnx2x_update_mng_version()
3704 memset(&bp->slowpath->drv_info_to_mcp, 0, in bnx2x_update_mng_version()
3766 DP(BNX2X_MSG_MCP, "oem_event 0x%x\n", event); in bnx2x_oem_event()
3798 bnx2x_fw_command(bp, cmd_fail, 0); in bnx2x_oem_event()
3800 bnx2x_fw_command(bp, cmd_ok, 0); in bnx2x_oem_event()
3810 bp->spq_prod_idx = 0; in bnx2x_sp_get_next()
3935 …"SPQE[%x] (%x:%x) (cmd, common?) (%d,%d) hw_cid %x data (%x:%x) type(0x%x) left (CQ, EQ) (%x,%x… in bnx2x_sp_post()
3944 return 0; in bnx2x_sp_post()
3951 int rc = 0; in bnx2x_acquire_alr()
3954 for (j = 0; j < 1000; j++) { in bnx2x_acquire_alr()
3973 REG_WR(bp, MCP_REG_MCPR_ACCESS_LOCK, 0); in bnx2x_release_alr()
3976 #define BNX2X_DEF_SB_ATT_IDX 0x0001
3977 #define BNX2X_DEF_SB_IDX 0x0002
3982 u16 rc = 0; in bnx2x_update_dsb_idx()
4012 u32 nig_mask = 0; in bnx2x_attn_int_asserted()
4023 aeu_mask &= ~(asserted & 0x3ff); in bnx2x_attn_int_asserted()
4045 REG_WR(bp, nig_int_mask_addr, 0); in bnx2x_attn_int_asserted()
4064 if (port == 0) { in bnx2x_attn_int_asserted()
4067 REG_WR(bp, MISC_REG_AEU_GENERAL_ATTN_1, 0x0); in bnx2x_attn_int_asserted()
4071 REG_WR(bp, MISC_REG_AEU_GENERAL_ATTN_2, 0x0); in bnx2x_attn_int_asserted()
4075 REG_WR(bp, MISC_REG_AEU_GENERAL_ATTN_3, 0x0); in bnx2x_attn_int_asserted()
4080 REG_WR(bp, MISC_REG_AEU_GENERAL_ATTN_4, 0x0); in bnx2x_attn_int_asserted()
4084 REG_WR(bp, MISC_REG_AEU_GENERAL_ATTN_5, 0x0); in bnx2x_attn_int_asserted()
4088 REG_WR(bp, MISC_REG_AEU_GENERAL_ATTN_6, 0x0); in bnx2x_attn_int_asserted()
4100 DP(NETIF_MSG_HW, "about to mask 0x%08x at %s addr 0x%x\n", asserted, in bnx2x_attn_int_asserted()
4110 u32 cnt = 0, igu_acked; in bnx2x_attn_int_asserted()
4114 } while (((igu_acked & ATTN_NIG_FOR_FUNC) == 0) && in bnx2x_attn_int_asserted()
4148 bnx2x_schedule_sp_rtnl(bp, BNX2X_SP_RTNL_FAN_FAILURE, 0); in bnx2x_fan_failure()
4185 BNX2X_ERR("FATAL HW block attention set0 0x%x\n", in bnx2x_attn_int_deasserted0()
4198 BNX2X_ERR("DB hw attention 0x%x\n", val); in bnx2x_attn_int_deasserted1()
4200 if (val & 0x2) in bnx2x_attn_int_deasserted1()
4216 BNX2X_ERR("FATAL HW block attention set1 0x%x\n", in bnx2x_attn_int_deasserted1()
4229 BNX2X_ERR("CFC hw attention 0x%x\n", val); in bnx2x_attn_int_deasserted2()
4231 if (val & 0x2) in bnx2x_attn_int_deasserted2()
4237 BNX2X_ERR("PXP hw attention-0 0x%x\n", val); in bnx2x_attn_int_deasserted2()
4239 if (val & 0x18000) in bnx2x_attn_int_deasserted2()
4244 BNX2X_ERR("PXP hw attention-1 0x%x\n", val); in bnx2x_attn_int_deasserted2()
4260 BNX2X_ERR("FATAL HW block attention set2 0x%x\n", in bnx2x_attn_int_deasserted2()
4275 REG_WR(bp, MISC_REG_AEU_GENERAL_ATTN_12 + func*4, 0); in bnx2x_attn_int_deasserted3()
4298 if ((bp->port.pmf == 0) && (val & DRV_STATUS_PMF)) in bnx2x_attn_int_deasserted3()
4303 bp->dcbx_enabled > 0) in bnx2x_attn_int_deasserted3()
4315 BNX2X_SP_RTNL_UPDATE_SVID, 0); in bnx2x_attn_int_deasserted3()
4336 REG_WR(bp, MISC_REG_AEU_GENERAL_ATTN_10, 0); in bnx2x_attn_int_deasserted3()
4337 REG_WR(bp, MISC_REG_AEU_GENERAL_ATTN_9, 0); in bnx2x_attn_int_deasserted3()
4338 REG_WR(bp, MISC_REG_AEU_GENERAL_ATTN_8, 0); in bnx2x_attn_int_deasserted3()
4339 REG_WR(bp, MISC_REG_AEU_GENERAL_ATTN_7, 0); in bnx2x_attn_int_deasserted3()
4345 REG_WR(bp, MISC_REG_AEU_GENERAL_ATTN_11, 0); in bnx2x_attn_int_deasserted3()
4349 BNX2X_ERR("Unknown HW assert! (attn 0x%x)\n", attn); in bnx2x_attn_int_deasserted3()
4353 BNX2X_ERR("LATCHED attention 0x%08x (masked)\n", attn); in bnx2x_attn_int_deasserted3()
4355 val = CHIP_IS_E1(bp) ? 0 : in bnx2x_attn_int_deasserted3()
4357 BNX2X_ERR("GRC time-out 0x%08x\n", val); in bnx2x_attn_int_deasserted3()
4360 val = CHIP_IS_E1(bp) ? 0 : in bnx2x_attn_int_deasserted3()
4362 BNX2X_ERR("GRC reserved 0x%08x\n", val); in bnx2x_attn_int_deasserted3()
4364 REG_WR(bp, MISC_REG_AEU_CLR_LATCH_SIGNAL, 0x7ff); in bnx2x_attn_int_deasserted3()
4370 * 0-7 - Engine0 load counter.
4384 #define BNX2X_PATH0_LOAD_CNT_MASK 0x000000ff
4385 #define BNX2X_PATH0_LOAD_CNT_SHIFT 0
4386 #define BNX2X_PATH1_LOAD_CNT_MASK 0x0000ff00
4388 #define BNX2X_PATH0_RST_IN_PROG_BIT 0x00010000
4389 #define BNX2X_PATH1_RST_IN_PROG_BIT 0x00020000
4390 #define BNX2X_GLOBAL_RESET_BIT 0x00040000
4429 DP(NETIF_MSG_HW, "GEN_REG_VAL=0x%08x\n", val); in bnx2x_reset_is_global()
4502 DP(NETIF_MSG_IFUP, "Old GEN_REG_VAL=0x%08x\n", val); in bnx2x_set_pf_load()
4539 DP(NETIF_MSG_IFDOWN, "Old GEN_REG_VAL=0x%08x\n", val); in bnx2x_clear_pf_load()
4555 return val1 != 0; in bnx2x_clear_pf_load()
4571 DP(NETIF_MSG_HW | NETIF_MSG_IFUP, "GLOB_REG=0x%08x\n", val); in bnx2x_get_load_status()
4575 DP(NETIF_MSG_HW | NETIF_MSG_IFUP, "load mask for engine %d = 0x%x\n", in bnx2x_get_load_status()
4578 return val != 0; in bnx2x_get_load_status()
4583 pr_cont(" [0x%08x] ", REG_RD(bp, reg)); in _print_parity()
4600 for (i = 0; sig; i++) { in bnx2x_check_blocks_with_parity0()
4601 cur_bit = (0x1UL << i); in bnx2x_check_blocks_with_parity0()
4665 for (i = 0; sig; i++) { in bnx2x_check_blocks_with_parity1()
4666 cur_bit = (0x1UL << i); in bnx2x_check_blocks_with_parity1()
4808 for (i = 0; sig; i++) { in bnx2x_check_blocks_with_parity2()
4809 cur_bit = (0x1UL << i); in bnx2x_check_blocks_with_parity2()
4881 for (i = 0; sig; i++) { in bnx2x_check_blocks_with_parity3()
4882 cur_bit = (0x1UL << i); in bnx2x_check_blocks_with_parity3()
4931 for (i = 0; sig; i++) { in bnx2x_check_blocks_with_parity4()
4932 cur_bit = (0x1UL << i); in bnx2x_check_blocks_with_parity4()
4963 if ((sig[0] & HW_PRTY_ASSERT_SET_0) || in bnx2x_parity_attn()
4968 int par_num = 0; in bnx2x_parity_attn()
4971 "[0]:0x%08x [1]:0x%08x [2]:0x%08x [3]:0x%08x [4]:0x%08x\n", in bnx2x_parity_attn()
4972 sig[0] & HW_PRTY_ASSERT_SET_0, in bnx2x_parity_attn()
4978 if (((sig[0] & HW_PRTY_ASSERT_SET_0) || in bnx2x_parity_attn()
4990 sig[0] & HW_PRTY_ASSERT_SET_0, &par_num, print); in bnx2x_parity_attn()
5016 struct attn_route attn = { {0} }; in bnx2x_chk_parity_attn()
5019 attn.sig[0] = REG_RD(bp, in bnx2x_chk_parity_attn()
5054 BNX2X_ERR("PGLUE hw attention 0x%x\n", val); in bnx2x_attn_int_deasserted4()
5078 BNX2X_ERR("ATC hw attention 0x%x\n", val); in bnx2x_attn_int_deasserted4()
5095 BNX2X_ERR("FATAL parity attention set4 0x%x\n", in bnx2x_attn_int_deasserted4()
5118 schedule_delayed_work(&bp->sp_rtnl_task, 0); in bnx2x_attn_int_deasserted()
5131 attn.sig[0] = REG_RD(bp, MISC_REG_AEU_AFTER_INVERT_1_FUNC_0 + port*4); in bnx2x_attn_int_deasserted()
5139 attn.sig[4] = 0; in bnx2x_attn_int_deasserted()
5142 attn.sig[0], attn.sig[1], attn.sig[2], attn.sig[3], attn.sig[4]); in bnx2x_attn_int_deasserted()
5144 for (index = 0; index < MAX_DYNAMIC_ATTN_GRPS; index++) { in bnx2x_attn_int_deasserted()
5150 group_mask->sig[0], group_mask->sig[1], in bnx2x_attn_int_deasserted()
5163 attn.sig[0] & group_mask->sig[0]); in bnx2x_attn_int_deasserted()
5176 DP(NETIF_MSG_HW, "about to mask 0x%08x at %s addr 0x%x\n", val, in bnx2x_attn_int_deasserted()
5191 aeu_mask |= (deasserted & 0x3ff); in bnx2x_attn_int_deasserted()
5264 return 0; in bnx2x_cnic_handle_cfc_del()
5272 memset(&rparam, 0, sizeof(rparam)); in bnx2x_handle_mcast_eqe()
5284 if (rc < 0) in bnx2x_handle_mcast_eqe()
5295 unsigned long ramrod_flags = 0; in bnx2x_handle_classification_eqe()
5296 int rc = 0; in bnx2x_handle_classification_eqe()
5325 BNX2X_ERR("Unsupported classification command: 0x%x\n", echo); in bnx2x_handle_classification_eqe()
5331 if (rc < 0) in bnx2x_handle_classification_eqe()
5333 else if (rc > 0) in bnx2x_handle_classification_eqe()
5363 "afex: ramrod completed VIF LIST_GET, addrs 0x%x\n", in bnx2x_after_afex_vif_lists()
5370 bnx2x_fw_command(bp, DRV_MSG_CODE_AFEX_LISTSET_ACK, 0); in bnx2x_after_afex_vif_lists()
5393 /* in access mode mark mask and value are 0 to strip all vlans */ in bnx2x_after_function_update()
5395 q_update_params->silent_removal_value = 0; in bnx2x_after_function_update()
5396 q_update_params->silent_removal_mask = 0; in bnx2x_after_function_update()
5410 if (rc < 0) in bnx2x_after_function_update()
5429 if (rc < 0) in bnx2x_after_function_update()
5435 bnx2x_fw_command(bp, DRV_MSG_CODE_AFEX_VIFSET_ACK, 0); in bnx2x_after_function_update()
5457 int rc, spqe_cnt = 0; in bnx2x_eq_int()
5464 /* The hw_cos range is 1-255, 257 - the sw_cons range is 0-254, 256. in bnx2x_eq_int()
5571 bnx2x_schedule_sp_rtnl(bp, cmd, 0); in bnx2x_eq_int()
5653 BNX2X_ERR("Unknown EQ event %d, bp->state 0x%x\n", in bnx2x_eq_int()
5686 DP(BNX2X_MSG_SP, "setting interrupt_occurred to 0\n"); in bnx2x_sp_task()
5687 atomic_set(&bp->interrupt_occurred, 0); in bnx2x_sp_task()
5720 "got an unknown interrupt! (status 0x%x)\n", status); in bnx2x_sp_task()
5731 bnx2x_fw_command(bp, DRV_MSG_CODE_AFEX_VIFSET_ACK, 0); in bnx2x_sp_task()
5740 bnx2x_ack_sb(bp, bp->igu_dsb_id, USTORM_ID, 0, in bnx2x_msix_sp_int()
5741 IGU_INT_DISABLE, 0); in bnx2x_msix_sp_int()
5800 BNX2X_ERR("MFW seems hanged: drv_pulse (0x%x) != mcp_pulse (0x%x)\n", in bnx2x_timer()
5826 for (i = 0; i < len; i += 4) in bnx2x_fill()
5829 for (i = 0; i < len; i++) in bnx2x_fill()
5840 for (index = 0; index < data_size; index++) in bnx2x_wr_fp_sb_data()
5850 u32 data_size = 0; in bnx2x_zero_fp_sb()
5856 memset(&sb_data_e2, 0, sizeof(struct hc_status_block_data_e2)); in bnx2x_zero_fp_sb()
5862 memset(&sb_data_e1x, 0, in bnx2x_zero_fp_sb()
5872 CSTORM_STATUS_BLOCK_OFFSET(fw_sb_id), 0, in bnx2x_zero_fp_sb()
5875 CSTORM_SYNC_BLOCK_OFFSET(fw_sb_id), 0, in bnx2x_zero_fp_sb()
5885 for (i = 0; i < sizeof(struct hc_sp_status_block_data)/sizeof(u32); i++) in bnx2x_wr_sp_sb_data()
5896 memset(&sp_sb_data, 0, sizeof(struct hc_sp_status_block_data)); in bnx2x_zero_sp_sb()
5904 CSTORM_SP_STATUS_BLOCK_OFFSET(func), 0, in bnx2x_zero_sp_sb()
5907 CSTORM_SP_SYNC_BLOCK_OFFSET(func), 0, in bnx2x_zero_sp_sb()
5916 hc_sm->timer_value = 0xFF; in bnx2x_setup_ndsb_state_machine()
5917 hc_sm->time_to_expire = 0xFFFFFFFF; in bnx2x_setup_ndsb_state_machine()
5968 memset(&sb_data_e2, 0, sizeof(struct hc_status_block_data_e2)); in bnx2x_init_sb()
5982 memset(&sb_data_e1x, 0, in bnx2x_init_sb()
5986 sb_data_e1x.common.p_func.vf_id = 0xff; in bnx2x_init_sb()
6037 memset(&sp_sb_data, 0, sizeof(struct hc_sp_status_block_data)); in bnx2x_init_def_sb()
6052 bp->attn_state = 0; in bnx2x_init_def_sb()
6058 for (index = 0; index < MAX_DYNAMIC_ATTN_GRPS; index++) { in bnx2x_init_def_sb()
6060 /* take care of sig[0]..sig[4] */ in bnx2x_init_def_sb()
6061 for (sindex = 0; sindex < 4; sindex++) in bnx2x_init_def_sb()
6063 REG_RD(bp, reg_offset + sindex*0x4 + 0x10*index); in bnx2x_init_def_sb()
6072 reg_offset_en5 + 0x4*index); in bnx2x_init_def_sb()
6074 bp->attn_group[index].sig[4] = 0; in bnx2x_init_def_sb()
6101 sp_sb_data.p_func.vf_id = 0xff; in bnx2x_init_def_sb()
6105 bnx2x_ack_sb(bp, bp->igu_dsb_id, USTORM_ID, 0, IGU_INT_ENABLE, 0); in bnx2x_init_def_sb()
6122 bp->spq_prod_idx = 0; in bnx2x_init_sp_ring()
6142 bp->eq_cons = 0; in bnx2x_init_eq_ring()
6160 memset(&ramrod_param, 0, sizeof(ramrod_param)); in bnx2x_set_q_rx_mode()
6163 ramrod_param.cid = 0; in bnx2x_set_q_rx_mode()
6183 if (rc < 0) { in bnx2x_set_q_rx_mode()
6188 return 0; in bnx2x_set_q_rx_mode()
6196 *rx_accept_flags = 0; in bnx2x_fill_accept_flags()
6197 *tx_accept_flags = 0; in bnx2x_fill_accept_flags()
6266 return 0; in bnx2x_fill_accept_flags()
6272 unsigned long rx_mode_flags = 0, ramrod_flags = 0; in bnx2x_set_storm_rx_mode()
6273 unsigned long rx_accept_flags = 0, tx_accept_flags = 0; in bnx2x_set_storm_rx_mode()
6299 for (i = 0; i < (USTORM_AGG_DATA_SIZE >> 2); i++) in bnx2x_init_internal_common()
6301 USTORM_AGG_DATA_OFFSET + i * 4, 0); in bnx2x_init_internal_common()
6327 BNX2X_ERR("Unknown load_code (0x%x) from MCP\n", load_code); in bnx2x_init_internal()
6354 unsigned long q_type = 0; in bnx2x_init_eth_fp()
6355 u32 cids[BNX2X_MULTI_TX_COS] = { 0 }; in bnx2x_init_eth_fp()
6423 *txdata->tx_cons_sb = cpu_to_le16(0); in bnx2x_init_tx_ring_one()
6426 txdata->tx_db.data.zero_fill1 = 0; in bnx2x_init_tx_ring_one()
6427 txdata->tx_db.data.prod = 0; in bnx2x_init_tx_ring_one()
6429 txdata->tx_pkt_prod = 0; in bnx2x_init_tx_ring_one()
6430 txdata->tx_pkt_cons = 0; in bnx2x_init_tx_ring_one()
6431 txdata->tx_bd_prod = 0; in bnx2x_init_tx_ring_one()
6432 txdata->tx_bd_cons = 0; in bnx2x_init_tx_ring_one()
6433 txdata->tx_pkt = 0; in bnx2x_init_tx_ring_one()
6441 bnx2x_init_tx_ring_one(bp->fp[i].txdata_ptr[0]); in bnx2x_init_tx_rings_cnic()
6457 unsigned long q_type = 0; in bnx2x_init_fcoe_fp()
6466 bnx2x_init_txdata(bp, bnx2x_fcoe(bp, txdata_ptr[0]), in bnx2x_init_fcoe_fp()
6575 return 0; in bnx2x_gunzip_init()
6611 if ((zbuf[0] != 0x1f) || (zbuf[1] != 0x8b) || (zbuf[2] != Z_DEFLATED)) { in bnx2x_gunzip()
6618 #define FNAME 0x8 in bnx2x_gunzip()
6621 while ((zbuf[n++] != 0) && (n < len)); in bnx2x_gunzip()
6638 if (bp->gunzip_outlen & 0x3) in bnx2x_gunzip()
6647 return 0; in bnx2x_gunzip()
6664 wb_write[0] = 0x55555555; in bnx2x_lb_pckt()
6665 wb_write[1] = 0x55555555; in bnx2x_lb_pckt()
6666 wb_write[2] = 0x20; /* SOP */ in bnx2x_lb_pckt()
6670 wb_write[0] = 0x09000000; in bnx2x_lb_pckt()
6671 wb_write[1] = 0x55555555; in bnx2x_lb_pckt()
6672 wb_write[2] = 0x10; /* EOP, eop_bvalid = 0 */ in bnx2x_lb_pckt()
6684 u32 val = 0; in bnx2x_int_mem_test()
6694 REG_WR(bp, TSDM_REG_ENABLE_IN1, 0x0); in bnx2x_int_mem_test()
6695 REG_WR(bp, TCM_REG_PRS_IFEN, 0x0); in bnx2x_int_mem_test()
6696 REG_WR(bp, CFC_REG_DEBUG0, 0x1); in bnx2x_int_mem_test()
6697 REG_WR(bp, NIG_REG_PRS_REQ_IN_EN, 0x0); in bnx2x_int_mem_test()
6699 /* Write 0 to parser credits for CFC search request */ in bnx2x_int_mem_test()
6700 REG_WR(bp, PRS_REG_CFC_SEARCH_INITIAL_CREDIT, 0x0); in bnx2x_int_mem_test()
6706 /* Wait until NIG register shows 1 packet of size 0x10 */ in bnx2x_int_mem_test()
6711 val = *bnx2x_sp(bp, wb_data[0]); in bnx2x_int_mem_test()
6712 if (val == 0x10) in bnx2x_int_mem_test()
6718 if (val != 0x10) { in bnx2x_int_mem_test()
6719 BNX2X_ERR("NIG timeout val = 0x%x\n", val); in bnx2x_int_mem_test()
6733 if (val != 0x1) { in bnx2x_int_mem_test()
6734 BNX2X_ERR("PRS timeout val = 0x%x\n", val); in bnx2x_int_mem_test()
6739 REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_1_CLEAR, 0x03); in bnx2x_int_mem_test()
6741 REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_1_SET, 0x03); in bnx2x_int_mem_test()
6749 REG_WR(bp, TSDM_REG_ENABLE_IN1, 0x0); in bnx2x_int_mem_test()
6750 REG_WR(bp, TCM_REG_PRS_IFEN, 0x0); in bnx2x_int_mem_test()
6751 REG_WR(bp, CFC_REG_DEBUG0, 0x1); in bnx2x_int_mem_test()
6752 REG_WR(bp, NIG_REG_PRS_REQ_IN_EN, 0x0); in bnx2x_int_mem_test()
6754 /* Write 0 to parser credits for CFC search request */ in bnx2x_int_mem_test()
6755 REG_WR(bp, PRS_REG_CFC_SEARCH_INITIAL_CREDIT, 0x0); in bnx2x_int_mem_test()
6758 for (i = 0; i < 10; i++) in bnx2x_int_mem_test()
6762 packets of size 11*0x10 = 0xb0 */ in bnx2x_int_mem_test()
6767 val = *bnx2x_sp(bp, wb_data[0]); in bnx2x_int_mem_test()
6768 if (val == 0xb0) in bnx2x_int_mem_test()
6774 if (val != 0xb0) { in bnx2x_int_mem_test()
6775 BNX2X_ERR("NIG timeout val = 0x%x\n", val); in bnx2x_int_mem_test()
6782 BNX2X_ERR("PRS timeout val = 0x%x\n", val); in bnx2x_int_mem_test()
6785 REG_WR(bp, PRS_REG_CFC_SEARCH_INITIAL_CREDIT, 0x1); in bnx2x_int_mem_test()
6789 /* Wait until NIG register shows 1 packet of size 0x10 */ in bnx2x_int_mem_test()
6792 BNX2X_ERR("PRS timeout val = 0x%x\n", val); in bnx2x_int_mem_test()
6795 for (i = 0; i < 11; i++) in bnx2x_int_mem_test()
6804 REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_1_CLEAR, 0x03); in bnx2x_int_mem_test()
6806 REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_1_SET, 0x03); in bnx2x_int_mem_test()
6815 REG_WR(bp, TSDM_REG_ENABLE_IN1, 0x7fffffff); in bnx2x_int_mem_test()
6816 REG_WR(bp, TCM_REG_PRS_IFEN, 0x1); in bnx2x_int_mem_test()
6817 REG_WR(bp, CFC_REG_DEBUG0, 0x0); in bnx2x_int_mem_test()
6818 REG_WR(bp, NIG_REG_PRS_REQ_IN_EN, 0x1); in bnx2x_int_mem_test()
6822 return 0; /* OK */ in bnx2x_int_mem_test()
6829 REG_WR(bp, PXP_REG_PXP_INT_MASK_0, 0); in bnx2x_enable_blocks_attention()
6831 REG_WR(bp, PXP_REG_PXP_INT_MASK_1, 0x40); in bnx2x_enable_blocks_attention()
6833 REG_WR(bp, PXP_REG_PXP_INT_MASK_1, 0); in bnx2x_enable_blocks_attention()
6834 REG_WR(bp, DORQ_REG_DORQ_INT_MASK, 0); in bnx2x_enable_blocks_attention()
6835 REG_WR(bp, CFC_REG_CFC_INT_MASK, 0); in bnx2x_enable_blocks_attention()
6842 REG_WR(bp, BRB1_REG_BRB1_INT_MASK, 0xFC00); in bnx2x_enable_blocks_attention()
6843 REG_WR(bp, QM_REG_QM_INT_MASK, 0); in bnx2x_enable_blocks_attention()
6844 REG_WR(bp, TM_REG_TM_INT_MASK, 0); in bnx2x_enable_blocks_attention()
6845 REG_WR(bp, XSDM_REG_XSDM_INT_MASK_0, 0); in bnx2x_enable_blocks_attention()
6846 REG_WR(bp, XSDM_REG_XSDM_INT_MASK_1, 0); in bnx2x_enable_blocks_attention()
6847 REG_WR(bp, XCM_REG_XCM_INT_MASK, 0); in bnx2x_enable_blocks_attention()
6848 /* REG_WR(bp, XSEM_REG_XSEM_INT_MASK_0, 0); */ in bnx2x_enable_blocks_attention()
6849 /* REG_WR(bp, XSEM_REG_XSEM_INT_MASK_1, 0); */ in bnx2x_enable_blocks_attention()
6850 REG_WR(bp, USDM_REG_USDM_INT_MASK_0, 0); in bnx2x_enable_blocks_attention()
6851 REG_WR(bp, USDM_REG_USDM_INT_MASK_1, 0); in bnx2x_enable_blocks_attention()
6852 REG_WR(bp, UCM_REG_UCM_INT_MASK, 0); in bnx2x_enable_blocks_attention()
6853 /* REG_WR(bp, USEM_REG_USEM_INT_MASK_0, 0); */ in bnx2x_enable_blocks_attention()
6854 /* REG_WR(bp, USEM_REG_USEM_INT_MASK_1, 0); */ in bnx2x_enable_blocks_attention()
6855 REG_WR(bp, GRCBASE_UPB + PB_REG_PB_INT_MASK, 0); in bnx2x_enable_blocks_attention()
6856 REG_WR(bp, CSDM_REG_CSDM_INT_MASK_0, 0); in bnx2x_enable_blocks_attention()
6857 REG_WR(bp, CSDM_REG_CSDM_INT_MASK_1, 0); in bnx2x_enable_blocks_attention()
6858 REG_WR(bp, CCM_REG_CCM_INT_MASK, 0); in bnx2x_enable_blocks_attention()
6859 /* REG_WR(bp, CSEM_REG_CSEM_INT_MASK_0, 0); */ in bnx2x_enable_blocks_attention()
6860 /* REG_WR(bp, CSEM_REG_CSEM_INT_MASK_1, 0); */ in bnx2x_enable_blocks_attention()
6870 REG_WR(bp, TSDM_REG_TSDM_INT_MASK_0, 0); in bnx2x_enable_blocks_attention()
6871 REG_WR(bp, TSDM_REG_TSDM_INT_MASK_1, 0); in bnx2x_enable_blocks_attention()
6872 REG_WR(bp, TCM_REG_TCM_INT_MASK, 0); in bnx2x_enable_blocks_attention()
6873 /* REG_WR(bp, TSEM_REG_TSEM_INT_MASK_0, 0); */ in bnx2x_enable_blocks_attention()
6877 REG_WR(bp, TSEM_REG_TSEM_INT_MASK_1, 0x07ff); in bnx2x_enable_blocks_attention()
6879 REG_WR(bp, CDU_REG_CDU_INT_MASK, 0); in bnx2x_enable_blocks_attention()
6880 REG_WR(bp, DMAE_REG_DMAE_INT_MASK, 0); in bnx2x_enable_blocks_attention()
6881 /* REG_WR(bp, MISC_REG_MISC_INT_MASK, 0); */ in bnx2x_enable_blocks_attention()
6882 REG_WR(bp, PBF_REG_PBF_INT_MASK, 0x18); /* bit 3,4 masked */ in bnx2x_enable_blocks_attention()
6887 u32 val = 0x1400; in bnx2x_reset_common()
6891 0xd3ffff7f); in bnx2x_reset_common()
6903 bp->dmae_ready = 0; in bnx2x_setup_dmae()
6913 DP(NETIF_MSG_HW, "read 0x%x from devctl\n", devctl); in bnx2x_init_pxp()
6934 is_required = 0; in bnx2x_setup_fan_failure_detection()
6958 if (is_required == 0) in bnx2x_setup_fan_failure_detection()
6981 REG_WR(bp, PGLUE_B_REG_INTERNAL_PFID_ENABLE_MASTER, 0); in bnx2x_pf_disable()
6982 REG_WR(bp, CFC_REG_WEAK_ENABLE_PF, 0); in bnx2x_pf_disable()
6992 shmem_base[0] = bp->common.shmem_base; in bnx2x__common_init_phy()
6993 shmem2_base[0] = bp->common.shmem2_base; in bnx2x__common_init_phy()
7014 /* make sure this value is 0 */ in bnx2x_config_endianity()
7015 REG_WR(bp, PXP2_REG_RQ_HC_ENDIAN_M, 0); in bnx2x_config_endianity()
7028 bnx2x_config_endianity(bp, 0); in bnx2x_set_endianity()
7034 bnx2x_config_endianity(bp, 0); in bnx2x_reset_endianity()
7055 REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_1_SET, 0xffffffff); in bnx2x_init_hw_common()
7057 val = 0xfffc; in bnx2x_init_hw_common()
7075 * for all functions on the given path, this means 0,2,4,6 for in bnx2x_init_hw_common()
7076 * path 0 and 1,3,5,7 for path 1 in bnx2x_init_hw_common()
7098 REG_WR(bp, PXP_REG_PXP_INT_MASK_0, 0); in bnx2x_init_hw_common()
7107 REG_WR(bp, PXP2_REG_PGL_TAGS_LIMIT, 0x1); in bnx2x_init_hw_common()
7124 * have entries with value "0" and valid bit on. in bnx2x_init_hw_common()
7141 * it will write "0" to the following registers of in bnx2x_init_hw_common()
7143 * REG_WR(pdev, PGLUE_B_REG_INTERNAL_PFID_ENABLE_MASTER, 0); in bnx2x_init_hw_common()
7144 * REG_WR(pdev, CFC_REG_WEAK_ENABLE_PF,0); in bnx2x_init_hw_common()
7145 * REG_WR(pdev, CFC_REG_STRONG_ENABLE_PF,0); in bnx2x_init_hw_common()
7168 * b. Polling for scan_on=0 for that PF. in bnx2x_init_hw_common()
7193 memset(&ilt_cli, 0, sizeof(struct ilt_client_info)); in bnx2x_init_hw_common()
7194 memset(&ilt, 0, sizeof(struct bnx2x_ilt)); in bnx2x_init_hw_common()
7197 ilt_cli.start = 0; in bnx2x_init_hw_common()
7221 REG_WR(bp, PXP2_REG_RQ_DISABLE_INPUTS, 0); in bnx2x_init_hw_common()
7222 REG_WR(bp, PXP2_REG_RD_DISABLE_INPUTS, 0); in bnx2x_init_hw_common()
7226 (CHIP_REV_IS_FPGA(bp) ? 400 : 0); in bnx2x_init_hw_common()
7249 bnx2x_init_fill(bp, TSEM_REG_PRAM, 0, 8, 1); in bnx2x_init_hw_common()
7271 REG_WR(bp, QM_REG_SOFT_RESET, 0); in bnx2x_init_hw_common()
7280 REG_WR(bp, DORQ_REG_DORQ_INT_MASK, 0); in bnx2x_init_hw_common()
7285 REG_WR(bp, PRS_REG_A_PRSU_20, 0xf); in bnx2x_init_hw_common()
7295 REG_WR(bp, PRS_REG_HDRS_AFTER_BASIC, 0xE); in bnx2x_init_hw_common()
7296 REG_WR(bp, PRS_REG_MUST_HAVE_HDRS, 0xA); in bnx2x_init_hw_common()
7297 REG_WR(bp, PRS_REG_HDRS_AFTER_TAG_0, 0x6); in bnx2x_init_hw_common()
7298 REG_WR(bp, PRS_REG_TAG_ETHERTYPE_0, 0x8926); in bnx2x_init_hw_common()
7299 REG_WR(bp, PRS_REG_TAG_LEN_0, 0x4); in bnx2x_init_hw_common()
7333 0x80000000); in bnx2x_init_hw_common()
7335 0x80000000); in bnx2x_init_hw_common()
7346 REG_WR(bp, PBF_REG_HDRS_AFTER_BASIC, 0xE); in bnx2x_init_hw_common()
7347 REG_WR(bp, PBF_REG_MUST_HAVE_HDRS, 0xA); in bnx2x_init_hw_common()
7348 REG_WR(bp, PBF_REG_HDRS_AFTER_TAG_0, 0x6); in bnx2x_init_hw_common()
7349 REG_WR(bp, PBF_REG_TAG_ETHERTYPE_0, 0x8926); in bnx2x_init_hw_common()
7350 REG_WR(bp, PBF_REG_TAG_LEN_0, 0x4); in bnx2x_init_hw_common()
7362 REG_WR(bp, SRC_REG_KEYSEARCH_0, 0x63285672); in bnx2x_init_hw_common()
7363 REG_WR(bp, SRC_REG_KEYSEARCH_1, 0x24b8f2cc); in bnx2x_init_hw_common()
7364 REG_WR(bp, SRC_REG_KEYSEARCH_2, 0x223aef9b); in bnx2x_init_hw_common()
7365 REG_WR(bp, SRC_REG_KEYSEARCH_3, 0x26001e3a); in bnx2x_init_hw_common()
7366 REG_WR(bp, SRC_REG_KEYSEARCH_4, 0x7ae91116); in bnx2x_init_hw_common()
7367 REG_WR(bp, SRC_REG_KEYSEARCH_5, 0x5ce5230b); in bnx2x_init_hw_common()
7368 REG_WR(bp, SRC_REG_KEYSEARCH_6, 0x298d8adf); in bnx2x_init_hw_common()
7369 REG_WR(bp, SRC_REG_KEYSEARCH_7, 0x6eb0ff09); in bnx2x_init_hw_common()
7370 REG_WR(bp, SRC_REG_KEYSEARCH_8, 0x1830f82f); in bnx2x_init_hw_common()
7371 REG_WR(bp, SRC_REG_KEYSEARCH_9, 0x01e46be7); in bnx2x_init_hw_common()
7373 REG_WR(bp, SRC_REG_SOFT_RST, 0); in bnx2x_init_hw_common()
7382 val = (4 << 24) + (0 << 12) + 1024; in bnx2x_init_hw_common()
7386 REG_WR(bp, CFC_REG_INIT_REG, 0x7FF); in bnx2x_init_hw_common()
7388 REG_WR(bp, CFC_REG_CFC_INT_MASK, 0); in bnx2x_init_hw_common()
7391 REG_WR(bp, CFC_REG_DEBUG0, 0x20020000); in bnx2x_init_hw_common()
7396 REG_WR(bp, IGU_REG_RESET_MEMORIES, 0x36); in bnx2x_init_hw_common()
7402 REG_WR(bp, 0x2814, 0xffffffff); in bnx2x_init_hw_common()
7403 REG_WR(bp, 0x3820, 0xffffffff); in bnx2x_init_hw_common()
7448 REG_WR(bp, CFC_REG_DEBUG0, 0); in bnx2x_init_hw_common()
7454 val = *bnx2x_sp(bp, wb_data[0]); in bnx2x_init_hw_common()
7457 if ((val == 0) && bnx2x_int_mem_test(bp)) { in bnx2x_init_hw_common()
7480 return 0; in bnx2x_init_hw_common()
7499 return 0; in bnx2x_init_hw_common_chip()
7511 REG_WR(bp, NIG_REG_MASK_INTERRUPT_PORT0 + port*4, 0); in bnx2x_init_hw_port()
7559 ((val % 64) ? 1 : 0); in bnx2x_init_hw_port()
7579 PRS_REG_HDRS_AFTER_BASIC_PORT_0, 0xE); in bnx2x_init_hw_port()
7582 PRS_REG_HDRS_AFTER_TAG_0_PORT_0, 0x6); in bnx2x_init_hw_port()
7585 PRS_REG_MUST_HAVE_HDRS_PORT_0, 0xA); in bnx2x_init_hw_port()
7615 REG_WR(bp, PBF_REG_P0_PAUSE_ENABLE + port*4, 0); in bnx2x_init_hw_port()
7625 REG_WR(bp, PBF_REG_INIT_P0 + port*4, 0); in bnx2x_init_hw_port()
7635 REG_WR(bp, HC_REG_LEADING_EDGE_0 + port*8, 0); in bnx2x_init_hw_port()
7636 REG_WR(bp, HC_REG_TRAILING_EDGE_0 + port*8, 0); in bnx2x_init_hw_port()
7644 * - SF mode: bits 3-7 are masked. Only bits 0-2 are in use in bnx2x_init_hw_port()
7645 * - MF mode: bit 3 is masked. Bits 0-2 are in use as in SF in bnx2x_init_hw_port()
7647 val = IS_MF(bp) ? 0xF7 : 0x7; in bnx2x_init_hw_port()
7649 val |= CHIP_IS_E1(bp) ? 0 : 0x10; in bnx2x_init_hw_port()
7672 NIG_REG_P0_HDRS_AFTER_BASIC, 0xE); in bnx2x_init_hw_port()
7688 /* 0x2 disable mf_ov, 0x1 enable */ in bnx2x_init_hw_port()
7690 (IS_MF_SD(bp) ? 0x1 : 0x2)); in bnx2x_init_hw_port()
7693 val = 0; in bnx2x_init_hw_port()
7708 REG_WR(bp, NIG_REG_LLFC_ENABLE_0 + port*4, 0); in bnx2x_init_hw_port()
7709 REG_WR(bp, NIG_REG_LLFC_OUT_EN_0 + port*4, 0); in bnx2x_init_hw_port()
7727 return 0; in bnx2x_init_hw_port()
7740 wb_write[0] = ONCHIP_ADDR1(addr); in bnx2x_ilt_wr()
7752 u32 func_encode = func | (is_pf ? 1 : 0) << IGU_FID_ENCODE_IS_PF_SHIFT; in bnx2x_igu_clear_sb_gen()
7768 DP(NETIF_MSG_HW, "write 0x%08x to IGU(via GRC) addr 0x%x\n", in bnx2x_igu_clear_sb_gen()
7772 DP(NETIF_MSG_HW, "write 0x%08x to IGU(via GRC) addr 0x%x\n", in bnx2x_igu_clear_sb_gen()
7797 bnx2x_ilt_wr(bp, i, 0); in bnx2x_clear_func_ilt()
7837 int vlan_en = 0, mac_en[NUM_MACS]; in bnx2x_reset_nic_mode()
7841 bnx2x_set_rx_filter(&bp->link_params, 0); in bnx2x_reset_nic_mode()
7846 NIG_REG_LLH0_FUNC_EN, 0); in bnx2x_reset_nic_mode()
7847 for (i = 0; i < NUM_MACS; i++) { in bnx2x_reset_nic_mode()
7855 (NIG_REG_LLH0_FUNC_MEM_ENABLE + 4 * i), 0); in bnx2x_reset_nic_mode()
7861 NIG_REG_P1_TX_MNG_HOST_ENABLE, 0); in bnx2x_reset_nic_mode()
7875 REG_WR(bp, PRS_REG_NIC_MODE, 0); in bnx2x_reset_nic_mode()
7883 for (i = 0; i < NUM_MACS; i++) { in bnx2x_reset_nic_mode()
7896 rc = bnx2x_func_switch_update(bp, 0); in bnx2x_reset_nic_mode()
7903 return 0; in bnx2x_reset_nic_mode()
7923 return 0; in bnx2x_init_hw_func_cnic()
7980 /* since BNX2X_FIRST_VF_CID > 0 the PF L2 cids precedes in bnx2x_init_hw_func()
7984 for (i = 0; i < L2_ILT_LINES(bp); i++) { in bnx2x_init_hw_func()
7995 REG_WR(bp, PRS_REG_NIC_MODE, 0); in bnx2x_init_hw_func()
8075 REG_WR(bp, PBF_REG_DISABLE_PF, 0); in bnx2x_init_hw_func()
8097 REG_WR(bp, MISC_REG_AEU_GENERAL_ATTN_12 + func*4, 0); in bnx2x_init_hw_func()
8099 REG_WR(bp, HC_REG_LEADING_EDGE_0 + port*8, 0); in bnx2x_init_hw_func()
8100 REG_WR(bp, HC_REG_TRAILING_EDGE_0 + port*8, 0); in bnx2x_init_hw_func()
8107 REG_WR(bp, MISC_REG_AEU_GENERAL_ATTN_12 + func*4, 0); in bnx2x_init_hw_func()
8110 REG_WR(bp, IGU_REG_LEADING_EDGE_LATCH, 0); in bnx2x_init_hw_func()
8111 REG_WR(bp, IGU_REG_TRAILING_EDGE_LATCH, 0); in bnx2x_init_hw_func()
8117 int dsb_idx = 0; in bnx2x_init_hw_func()
8120 * E2 mode: address 0-135 match to the mapping memory; in bnx2x_init_hw_func()
8131 * NDSB (PF0 - 0-31; PF1 - 32-63 and so on). The last 20 in bnx2x_init_hw_func()
8141 for (sb_idx = 0; sb_idx < bp->igu_sb_cnt; sb_idx++) { in bnx2x_init_hw_func()
8145 for (i = 0; i < num_segs; i++) { in bnx2x_init_hw_func()
8148 REG_WR(bp, addr, 0); in bnx2x_init_hw_func()
8150 /* send consumer update with value 0 */ in bnx2x_init_hw_func()
8152 USTORM_ID, 0, IGU_INT_NOP, 1); in bnx2x_init_hw_func()
8174 for (i = 0; i < (num_segs * E1HVN_MAX); in bnx2x_init_hw_func()
8178 REG_WR(bp, addr, 0); in bnx2x_init_hw_func()
8180 /* send consumer update with 0 */ in bnx2x_init_hw_func()
8183 USTORM_ID, 0, IGU_INT_NOP, 1); in bnx2x_init_hw_func()
8185 CSTORM_ID, 0, IGU_INT_NOP, 1); in bnx2x_init_hw_func()
8187 XSTORM_ID, 0, IGU_INT_NOP, 1); in bnx2x_init_hw_func()
8189 TSTORM_ID, 0, IGU_INT_NOP, 1); in bnx2x_init_hw_func()
8191 ATTENTION_ID, 0, IGU_INT_NOP, 1); in bnx2x_init_hw_func()
8194 USTORM_ID, 0, IGU_INT_NOP, 1); in bnx2x_init_hw_func()
8196 ATTENTION_ID, 0, IGU_INT_NOP, 1); in bnx2x_init_hw_func()
8202 REG_WR(bp, IGU_REG_SB_INT_BEFORE_MASK_LSB, 0); in bnx2x_init_hw_func()
8203 REG_WR(bp, IGU_REG_SB_INT_BEFORE_MASK_MSB, 0); in bnx2x_init_hw_func()
8204 REG_WR(bp, IGU_REG_SB_MASK_LSB, 0); in bnx2x_init_hw_func()
8205 REG_WR(bp, IGU_REG_SB_MASK_MSB, 0); in bnx2x_init_hw_func()
8206 REG_WR(bp, IGU_REG_PBA_STATUS_LSB, 0); in bnx2x_init_hw_func()
8207 REG_WR(bp, IGU_REG_PBA_STATUS_MSB, 0); in bnx2x_init_hw_func()
8212 REG_WR(bp, 0x2114, 0xffffffff); in bnx2x_init_hw_func()
8213 REG_WR(bp, 0x2120, 0xffffffff); in bnx2x_init_hw_func()
8225 "Hmmm... Parity errors in HC block during function init (0x%x)!\n", in bnx2x_init_hw_func()
8254 return 0; in bnx2x_init_hw_func()
8287 for (i = 0; i < L2_ILT_LINES(bp); i++) in bnx2x_free_mem()
8333 return 0; in bnx2x_alloc_mem_cnic()
8377 for (i = 0, allocated = 0; allocated < context_size; i++) { in bnx2x_alloc_mem()
8408 return 0; in bnx2x_alloc_mem()
8427 memset(&ramrod_param, 0, sizeof(ramrod_param)); in bnx2x_set_mac_one()
8451 rc = 0; in bnx2x_set_mac_one()
8452 } else if (rc < 0) in bnx2x_set_mac_one()
8465 memset(&ramrod_param, 0, sizeof(ramrod_param)); in bnx2x_set_vlan_one()
8487 rc = 0; in bnx2x_set_vlan_one()
8488 } else if (rc < 0) { in bnx2x_set_vlan_one()
8503 bp->vlan_cnt = 0; in bnx2x_clear_vlan_info()
8508 struct bnx2x_vlan_mac_obj *vlan_obj = &bp->sp_objs[0].vlan_obj; in bnx2x_del_all_vlans()
8509 unsigned long ramrod_flags = 0, vlan_flags = 0; in bnx2x_del_all_vlans()
8520 return 0; in bnx2x_del_all_vlans()
8528 unsigned long ramrod_flags = 0, vlan_mac_flags = 0; in bnx2x_del_all_macs()
8538 if (rc < 0) in bnx2x_del_all_macs()
8547 unsigned long ramrod_flags = 0; in bnx2x_set_eth_mac()
8563 return bnx2x_setup_queue(bp, &bp->fp[0], true); in bnx2x_setup_leading()
8565 return bnx2x_vfpf_setup_q(bp, &bp->fp[0], true); in bnx2x_setup_leading()
8577 int rc = 0; in bnx2x_set_int_mode()
8591 return 0; in bnx2x_set_int_mode()
8616 return 0; in bnx2x_set_int_mode()
8631 u16 line = 0; in bnx2x_ilt_set_info()
8648 DP(NETIF_MSG_IFUP, "ilt client[CDU]: start %d, end %d, psz 0x%x, flags 0x%x, hw psz %d\n", in bnx2x_ilt_set_info()
8660 ilt_client->flags = 0; in bnx2x_ilt_set_info()
8670 "ilt client[QM]: start %d, end %d, psz 0x%x, flags 0x%x, hw psz %d\n", in bnx2x_ilt_set_info()
8683 ilt_client->flags = 0; in bnx2x_ilt_set_info()
8689 "ilt client[SRC]: start %d, end %d, psz 0x%x, flags 0x%x, hw psz %d\n", in bnx2x_ilt_set_info()
8700 ilt_client->flags = 0; in bnx2x_ilt_set_info()
8706 "ilt client[TM]: start %d, end %d, psz 0x%x, flags 0x%x, hw psz %d\n", in bnx2x_ilt_set_info()
8747 (1000000 / bp->rx_ticks) : 0; in bnx2x_pf_q_prep_init()
8749 (1000000 / bp->tx_ticks) : 0; in bnx2x_pf_q_prep_init()
8784 memset(tx_only_params, 0, sizeof(*tx_only_params)); in bnx2x_setup_tx_only()
8837 bnx2x_ack_sb(bp, fp->igu_sb_id, USTORM_ID, 0, in bnx2x_setup_queue()
8838 IGU_INT_ENABLE, 0); in bnx2x_setup_queue()
8860 memset(setup_params, 0, sizeof(*setup_params)); in bnx2x_setup_queue()
8932 memset(&q_params.params.terminate, 0, in bnx2x_stop_queue()
8942 memset(&q_params.params.cfc_del, 0, in bnx2x_stop_queue()
8958 memset(&q_params.params.terminate, 0, in bnx2x_stop_queue()
8966 memset(&q_params.params.cfc_del, 0, in bnx2x_stop_queue()
8979 REG_WR8(bp, BAR_XSTRORM_INTMEM + XSTORM_FUNC_EN_OFFSET(func), 0); in bnx2x_reset_func()
8980 REG_WR8(bp, BAR_CSTRORM_INTMEM + CSTORM_FUNC_EN_OFFSET(func), 0); in bnx2x_reset_func()
8981 REG_WR8(bp, BAR_TSTRORM_INTMEM + TSTORM_FUNC_EN_OFFSET(func), 0); in bnx2x_reset_func()
8982 REG_WR8(bp, BAR_USTRORM_INTMEM + USTORM_FUNC_EN_OFFSET(func), 0); in bnx2x_reset_func()
9003 for (i = 0; i < XSTORM_SPQ_DATA_SIZE / 4; i++) in bnx2x_reset_func()
9005 0); in bnx2x_reset_func()
9009 REG_WR(bp, HC_REG_LEADING_EDGE_0 + port*8, 0); in bnx2x_reset_func()
9010 REG_WR(bp, HC_REG_TRAILING_EDGE_0 + port*8, 0); in bnx2x_reset_func()
9012 REG_WR(bp, IGU_REG_LEADING_EDGE_LATCH, 0); in bnx2x_reset_func()
9013 REG_WR(bp, IGU_REG_TRAILING_EDGE_LATCH, 0); in bnx2x_reset_func()
9018 REG_WR(bp, TM_REG_EN_LINEAR0_TIMER + port*4, 0); in bnx2x_reset_func()
9023 for (i = 0; i < 200; i++) { in bnx2x_reset_func()
9038 memset(&ilt_cli, 0, sizeof(struct ilt_client_info)); in bnx2x_reset_func()
9039 ilt_cli.start = 0; in bnx2x_reset_func()
9043 bnx2x_ilt_boundry_init_op(bp, &ilt_cli, 0, INITOP_CLEAR); in bnx2x_reset_func()
9050 bp->dmae_ready = 0; in bnx2x_reset_func()
9061 REG_WR(bp, NIG_REG_MASK_INTERRUPT_PORT0 + port*4, 0); in bnx2x_reset_port()
9064 REG_WR(bp, NIG_REG_LLH0_BRB1_DRV_MASK + port*4, 0x0); in bnx2x_reset_port()
9067 NIG_REG_LLH0_BRB1_NOT_MCP), 0x0); in bnx2x_reset_port()
9070 REG_WR(bp, MISC_REG_AEU_MASK_ATTN_FUNC_0 + port*4, 0); in bnx2x_reset_port()
9124 return 0; in bnx2x_func_stop()
9137 u32 reset_code = 0; in bnx2x_send_unload_req()
9155 * preserve entry 0 which is used by the PMF in bnx2x_send_unload_req()
9159 val = (mac_addr[0] << 8) | mac_addr[1]; in bnx2x_send_unload_req()
9178 reset_code = bnx2x_fw_command(bp, reset_code, 0); in bnx2x_send_unload_req()
9183 path, bnx2x_load_count[path][0], bnx2x_load_count[path][1], in bnx2x_send_unload_req()
9185 bnx2x_load_count[path][0]--; in bnx2x_send_unload_req()
9188 path, bnx2x_load_count[path][0], bnx2x_load_count[path][1], in bnx2x_send_unload_req()
9190 if (bnx2x_load_count[path][0] == 0) in bnx2x_send_unload_req()
9192 else if (bnx2x_load_count[path][1 + port] == 0) in bnx2x_send_unload_req()
9209 u32 reset_param = keep_link ? DRV_MSG_CODE_UNLOAD_SKIP_LINK_RESET : 0; in bnx2x_send_unload_done()
9219 int msix = (bp->flags & USING_MSIX_FLAG) ? 1 : 0; in bnx2x_func_wait_started()
9222 return 0; in bnx2x_func_wait_started()
9240 synchronize_irq(bp->msix_table[0].vector); in bnx2x_func_wait_started()
9280 return 0; in bnx2x_func_wait_started()
9289 NIG_REG_P0_LLH_PTP_TO_HOST, 0x0); in bnx2x_disable_ptp()
9293 NIG_REG_P0_LLH_PTP_PARAM_MASK, 0x7FF); in bnx2x_disable_ptp()
9295 NIG_REG_P0_LLH_PTP_RULE_MASK, 0x3FFF); in bnx2x_disable_ptp()
9297 NIG_REG_P0_TLLH_PTP_PARAM_MASK, 0x7FF); in bnx2x_disable_ptp()
9299 NIG_REG_P0_TLLH_PTP_RULE_MASK, 0x3FFF); in bnx2x_disable_ptp()
9303 NIG_REG_P0_PTP_EN, 0x0); in bnx2x_disable_ptp()
9328 int i, rc = 0; in bnx2x_chip_cleanup()
9349 rc = bnx2x_del_all_macs(bp, &bp->sp_objs[0].mac_obj, BNX2X_ETH_MAC, in bnx2x_chip_cleanup()
9351 if (rc < 0) in bnx2x_chip_cleanup()
9355 rc = bnx2x_del_all_macs(bp, &bp->sp_objs[0].mac_obj, BNX2X_UC_LIST_MAC, in bnx2x_chip_cleanup()
9357 if (rc < 0) in bnx2x_chip_cleanup()
9368 if (rc < 0) in bnx2x_chip_cleanup()
9374 REG_WR(bp, NIG_REG_LLH0_FUNC_EN + port*8, 0); in bnx2x_chip_cleanup()
9390 if (rc < 0) in bnx2x_chip_cleanup()
9440 if (!bnx2x_wait_sp_comp(bp, ~0x0UL)) in bnx2x_chip_cleanup()
9504 val &= ~(0x300); in bnx2x_disable_close_the_gate()
9553 #define SHARED_MF_CLP_MAGIC 0x80000000 /* `magic' bit */
9602 if (shmem > 0) in bnx2x_reset_mcp_prep()
9603 REG_WR(bp, shmem + validity_offset, 0); in bnx2x_reset_mcp_prep()
9629 int cnt = 0; in bnx2x_init_shmem()
9630 u32 val = 0; in bnx2x_init_shmem()
9635 /* If we read all 0xFFs, means we are in PCI error state and in bnx2x_init_shmem()
9638 if (bp->common.shmem_base == 0xFFFFFFFF) { in bnx2x_init_shmem()
9646 return 0; in bnx2x_init_shmem()
9672 REG_WR(bp, PXP2_REG_RD_START_INIT, 0); in bnx2x_pxp_prep()
9673 REG_WR(bp, PXP2_REG_RQ_RBC_DONE, 0); in bnx2x_pxp_prep()
9737 reset_mask1 = 0xffffffff; in bnx2x_process_kill_chip_reset()
9740 reset_mask2 = 0xffff; in bnx2x_process_kill_chip_reset()
9742 reset_mask2 = 0x1ffff; in bnx2x_process_kill_chip_reset()
9744 reset_mask2 = 0xfffff; in bnx2x_process_kill_chip_reset()
9746 reset_mask2 = 0x3ffffff; in bnx2x_process_kill_chip_reset()
9788 * It should get cleared in no more than 1s. Returns 0 if
9794 u32 pend_bits = 0; in bnx2x_er_poll_igu_vq()
9799 if (pend_bits == 0) in bnx2x_er_poll_igu_vq()
9803 } while (cnt-- > 0); in bnx2x_er_poll_igu_vq()
9805 if (cnt <= 0) { in bnx2x_er_poll_igu_vq()
9811 return 0; in bnx2x_er_poll_igu_vq()
9817 u32 val = 0; in bnx2x_process_kill()
9819 u32 tags_63_32 = 0; in bnx2x_process_kill()
9831 if ((sr_cnt == 0x7e) && (blk_cnt == 0xa0) && in bnx2x_process_kill()
9832 ((port_is_idle_0 & 0x1) == 0x1) && in bnx2x_process_kill()
9833 ((port_is_idle_1 & 0x1) == 0x1) && in bnx2x_process_kill()
9834 (pgl_exp_rom2 == 0xffffffff) && in bnx2x_process_kill()
9835 (!CHIP_IS_E3(bp) || (tags_63_32 == 0xffffffff))) in bnx2x_process_kill()
9838 } while (cnt-- > 0); in bnx2x_process_kill()
9840 if (cnt <= 0) { in bnx2x_process_kill()
9842 …BNX2X_ERR("sr_cnt=0x%08x, blk_cnt=0x%08x, port_is_idle_0=0x%08x, port_is_idle_1=0x%08x, pgl_exp_ro… in bnx2x_process_kill()
9860 REG_WR(bp, MISC_REG_UNPREPARED, 0); in bnx2x_process_kill()
9883 REG_WR(bp, PGLUE_B_REG_LATCHED_ERRORS_CLR, 0x7f); in bnx2x_process_kill()
9898 return 0; in bnx2x_process_kill()
9903 int rc = 0; in bnx2x_leader_reset()
9924 load_code = bnx2x_fw_command(bp, DRV_MSG_CODE_LOAD_DONE, 0); in bnx2x_leader_reset()
9951 bnx2x_fw_command(bp, DRV_MSG_CODE_UNLOAD_REQ_WOL_MCP, 0); in bnx2x_leader_reset()
9952 bnx2x_fw_command(bp, DRV_MSG_CODE_UNLOAD_DONE, 0); in bnx2x_leader_reset()
9955 bp->is_leader = 0; in bnx2x_leader_reset()
9994 for (vf_idx = 0; vf_idx < bp->requested_nr_virtfn; vf_idx++) { in bnx2x_parity_recover()
10041 int other_engine = BP_PATH(bp) ? 0 : 1; in bnx2x_parity_recover()
10154 u16 vxlan_port = 0, geneve_port = 0; in bnx2x_udp_port_update()
10186 BNX2X_ERR("failed to set UDP dst port to %04x %04x (rc = 0x%x)\n", in bnx2x_udp_port_update()
10201 udp_tunnel_nic_get_port(netdev, table, 0, &ti); in bnx2x_udp_tunnel_sync()
10243 bp->sp_rtnl_state = 0; in bnx2x_sp_rtnl_task()
10263 bp->sp_rtnl_state = 0; in bnx2x_sp_rtnl_task()
10267 bp->link_vars.link_up = 0; in bnx2x_sp_rtnl_task()
10408 REG_WR(bp, vals->umac_addr[port], 0); in bnx2x_prev_unload_close_umac()
10421 memset(vals, 0, sizeof(*vals)); in bnx2x_prev_unload_close_mac()
10442 wb_data[0] = REG_RD(bp, base_addr + offset); in bnx2x_prev_unload_close_mac()
10443 wb_data[1] = REG_RD(bp, base_addr + offset + 0x4); in bnx2x_prev_unload_close_mac()
10445 vals->bmac_val[0] = wb_data[0]; in bnx2x_prev_unload_close_mac()
10447 wb_data[0] &= ~BMAC_CONTROL_RX_ENABLE; in bnx2x_prev_unload_close_mac()
10448 REG_WR(bp, vals->bmac_addr, wb_data[0]); in bnx2x_prev_unload_close_mac()
10449 REG_WR(bp, vals->bmac_addr + 0x4, wb_data[1]); in bnx2x_prev_unload_close_mac()
10454 REG_WR(bp, vals->emac_addr, 0); in bnx2x_prev_unload_close_mac()
10467 REG_WR(bp, vals->xmac_addr, 0); in bnx2x_prev_unload_close_mac()
10471 mac_stopped |= bnx2x_prev_unload_close_umac(bp, 0, in bnx2x_prev_unload_close_mac()
10481 #define BNX2X_PREV_UNDI_PROD_ADDR(p) (BAR_TSTRORM_INTMEM + 0x1508 + ((p) << 4))
10483 0x1848 + ((f) << 4))
10484 #define BNX2X_PREV_UNDI_RCQ(val) ((val) & 0xffff)
10485 #define BNX2X_PREV_UNDI_BD(val) ((val) >> 16 & 0xffff)
10488 #define BCM_5710_UNDI_FW_MF_MAJOR (0x07)
10489 #define BCM_5710_UNDI_FW_MF_MINOR (0x08)
10490 #define BCM_5710_UNDI_FW_MF_VERS (0x05)
10495 * it initializes CID offset for normal bell to 0x7 in bnx2x_prev_is_after_undi()
10501 if (REG_RD(bp, DORQ_REG_NORM_CID_OFST) == 0x7) { in bnx2x_prev_is_after_undi()
10526 BNX2X_DEV_INFO("UNDI producer [%d/%d][%08x] rings bd -> 0x%04x, rcq -> 0x%04x\n", in bnx2x_prev_unload_undi_inc()
10539 return 0; in bnx2x_prev_mcp_done()
10570 rc = 0; in bnx2x_prev_path_mark_eeh()
10640 tmp_list->aer = 0; in bnx2x_prev_mark_path()
10643 return 0; in bnx2x_prev_mark_path()
10657 tmp_list->aer = 0; in bnx2x_prev_mark_path()
10658 tmp_list->undi = after_undi ? (1 << BP_PORT(bp)) : 0; in bnx2x_prev_mark_path()
10685 BNX2X_ERR("FLR not supported by BC_VER: 0x%x\n", in bnx2x_do_flr()
10694 bnx2x_fw_command(bp, DRV_MSG_CODE_INITIATE_FLR, 0); in bnx2x_do_flr()
10696 return 0; in bnx2x_do_flr()
10730 return 0; in bnx2x_prev_unload_uncommon()
10746 u32 reset_reg, tmp_reg = 0, rc; in bnx2x_prev_unload_common()
10756 memset(&mac_vals, 0, sizeof(mac_vals)); in bnx2x_prev_unload_common()
10771 bnx2x_set_rx_filter(&bp->link_params, 0); in bnx2x_prev_unload_common()
10773 bnx2x_set_rx_filter(&bp->link_params, 0); in bnx2x_prev_unload_common()
10780 REG_WR(bp, DORQ_REG_NORM_CID_OFST, 0); in bnx2x_prev_unload_common()
10786 REG_WR(bp, PGLUE_B_REG_INTERNAL_PFID_ENABLE_MASTER, 0); in bnx2x_prev_unload_common()
10797 BNX2X_DEV_INFO("BRB still has 0x%08x\n", tmp_reg); in bnx2x_prev_unload_common()
10821 if (mac_vals.umac_addr[0]) in bnx2x_prev_unload_common()
10822 REG_WR(bp, mac_vals.umac_addr[0], mac_vals.umac_val[0]); in bnx2x_prev_unload_common()
10828 REG_WR(bp, mac_vals.bmac_addr, mac_vals.bmac_val[0]); in bnx2x_prev_unload_common()
10866 REG_WR(bp, hw_lock_reg, 0xffffffff); in bnx2x_prev_unload()
10876 int aer = 0; in bnx2x_prev_unload()
10878 fw = bnx2x_fw_command(bp, DRV_MSG_CODE_UNLOAD_REQ_WOL_DIS, 0); in bnx2x_prev_unload()
10930 /* chip num:16-31, rev:12-15, metal:4-11, bond_id:0-3 */ in bnx2x_get_common_hwinfo()
10932 id = ((val & 0xffff) << 16); in bnx2x_get_common_hwinfo()
10934 id |= ((val & 0xf) << 12); in bnx2x_get_common_hwinfo()
10936 /* Metal is read from PCI regs, but we can't access >=0x400 from in bnx2x_get_common_hwinfo()
10940 id |= (((val >> 24) & 0xf) << 4); in bnx2x_get_common_hwinfo()
10942 id |= (val & 0xf); in bnx2x_get_common_hwinfo()
10949 (bp->common.chip_id & 0x0000FFFF); in bnx2x_get_common_hwinfo()
10952 (bp->common.chip_id & 0x0000FFFF); in bnx2x_get_common_hwinfo()
10953 bp->common.chip_id |= 0x1; in bnx2x_get_common_hwinfo()
10961 if ((val & 1) == 0) in bnx2x_get_common_hwinfo()
10971 bp->pfid = (bp->pf_num >> 1); /* 0..3 */ in bnx2x_get_common_hwinfo()
10973 bp->pfid = (bp->pf_num & 0x6); /* 0, 2, 4, 6 */ in bnx2x_get_common_hwinfo()
10976 bp->pfid = bp->pf_num; /* 0..7 */ in bnx2x_get_common_hwinfo()
10982 BNX2X_DEV_INFO("chip ID is 0x%x\n", id); in bnx2x_get_common_hwinfo()
10984 val = (REG_RD(bp, 0x2874) & 0x55); in bnx2x_get_common_hwinfo()
10985 if ((bp->common.chip_id & 0x1) || in bnx2x_get_common_hwinfo()
10986 (CHIP_IS_E1(bp) && val) || (CHIP_IS_E1H(bp) && (val == 0x55))) { in bnx2x_get_common_hwinfo()
10994 BNX2X_DEV_INFO("flash_size 0x%x (%d)\n", in bnx2x_get_common_hwinfo()
11012 bp->link_params.lfa_base = 0; in bnx2x_get_common_hwinfo()
11013 BNX2X_DEV_INFO("shmem offset 0x%x shmem2 offset 0x%x\n", in bnx2x_get_common_hwinfo()
11023 BNX2X_DEV_INFO("hw_config 0x%08x\n", bp->common.hw_config); in bnx2x_get_common_hwinfo()
11029 bp->link_params.feature_config_flags = 0; in bnx2x_get_common_hwinfo()
11049 FEATURE_CONFIG_BC_SUPPORTS_OPT_MDL_VRFY : 0; in bnx2x_get_common_hwinfo()
11053 FEATURE_CONFIG_BC_SUPPORTS_DUAL_PHY_OPT_MDL_VRFY : 0; in bnx2x_get_common_hwinfo()
11056 FEATURE_CONFIG_BC_SUPPORTS_AFEX : 0; in bnx2x_get_common_hwinfo()
11059 FEATURE_CONFIG_BC_SUPPORTS_SFP_TX_DISABLED : 0; in bnx2x_get_common_hwinfo()
11063 FEATURE_CONFIG_MT_SUPPORT : 0; in bnx2x_get_common_hwinfo()
11066 BC_SUPPORTS_PFC_STATS : 0; in bnx2x_get_common_hwinfo()
11069 BC_SUPPORTS_FCOE_FEATURES : 0; in bnx2x_get_common_hwinfo()
11072 BC_SUPPORTS_DCBX_MSG_NON_PMF : 0; in bnx2x_get_common_hwinfo()
11075 BC_SUPPORTS_RMMOD_CMD : 0; in bnx2x_get_common_hwinfo()
11096 bp->flags |= (pmc & PCI_PM_CAP_PME_D3cold) ? 0 : NO_WOL_FLAG; in bnx2x_get_common_hwinfo()
11118 u8 fid, igu_sb_cnt = 0; in bnx2x_get_igu_cam_info()
11120 bp->igu_base_sb = 0xff; in bnx2x_get_igu_cam_info()
11130 return 0; in bnx2x_get_igu_cam_info()
11134 for (igu_sb_id = 0; igu_sb_id < IGU_REG_MAPPING_MEMORY_SIZE; in bnx2x_get_igu_cam_info()
11143 if (IGU_VEC(val) == 0) in bnx2x_get_igu_cam_info()
11147 if (bp->igu_base_sb == 0xff) in bnx2x_get_igu_cam_info()
11164 if (igu_sb_cnt == 0) { in bnx2x_get_igu_cam_info()
11169 return 0; in bnx2x_get_igu_cam_info()
11174 int cfg_size = 0, idx, port = BP_PORT(bp); in bnx2x_link_settings_supported()
11177 bp->port.supported[0] = 0; in bnx2x_link_settings_supported()
11178 bp->port.supported[1] = 0; in bnx2x_link_settings_supported()
11181 bp->port.supported[0] = bp->link_params.phy[INT_PHY].supported; in bnx2x_link_settings_supported()
11185 bp->port.supported[0] = bp->link_params.phy[EXT_PHY1].supported; in bnx2x_link_settings_supported()
11193 bp->port.supported[0] = in bnx2x_link_settings_supported()
11196 bp->port.supported[0] = in bnx2x_link_settings_supported()
11205 if (!(bp->port.supported[0] || bp->port.supported[1])) { in bnx2x_link_settings_supported()
11206 BNX2X_ERR("NVRAM config error. BAD phy config. PHY1 config 0x%x, PHY2 config 0x%x\n", in bnx2x_link_settings_supported()
11220 bp, NIG_REG_SERDES0_CTRL_PHY_ADDR + port*0x10); in bnx2x_link_settings_supported()
11224 bp, NIG_REG_XGXS0_CTRL_PHY_ADDR + port*0x18); in bnx2x_link_settings_supported()
11227 BNX2X_ERR("BAD switch_cfg link_config 0x%x\n", in bnx2x_link_settings_supported()
11228 bp->port.link_config[0]); in bnx2x_link_settings_supported()
11232 BNX2X_DEV_INFO("phy_addr 0x%x\n", bp->port.phy_addr); in bnx2x_link_settings_supported()
11234 for (idx = 0; idx < cfg_size; idx++) { in bnx2x_link_settings_supported()
11269 BNX2X_DEV_INFO("supported 0x%x 0x%x\n", bp->port.supported[0], in bnx2x_link_settings_supported()
11275 u32 link_config, idx, cfg_size = 0; in bnx2x_link_settings_requested()
11276 bp->port.advertising[0] = 0; in bnx2x_link_settings_requested()
11277 bp->port.advertising[1] = 0; in bnx2x_link_settings_requested()
11287 for (idx = 0; idx < cfg_size; idx++) { in bnx2x_link_settings_requested()
11321 BNX2X_ERR("NVRAM config error. Invalid link_config 0x%x speed_cap_mask 0x%x\n", in bnx2x_link_settings_requested()
11338 BNX2X_ERR("NVRAM config error. Invalid link_config 0x%x speed_cap_mask 0x%x\n", in bnx2x_link_settings_requested()
11354 BNX2X_ERR("NVRAM config error. Invalid link_config 0x%x speed_cap_mask 0x%x\n", in bnx2x_link_settings_requested()
11372 BNX2X_ERR("NVRAM config error. Invalid link_config 0x%x speed_cap_mask 0x%x\n", in bnx2x_link_settings_requested()
11394 BNX2X_ERR("NVRAM config error. Invalid link_config 0x%x speed_cap_mask 0x%x\n", in bnx2x_link_settings_requested()
11410 BNX2X_ERR("NVRAM config error. Invalid link_config 0x%x speed_cap_mask 0x%x\n", in bnx2x_link_settings_requested()
11433 BNX2X_ERR("NVRAM config error. Invalid link_config 0x%x speed_cap_mask 0x%x\n", in bnx2x_link_settings_requested()
11444 BNX2X_ERR("NVRAM config error. BAD link speed link_config 0x%x\n", in bnx2x_link_settings_requested()
11464 BNX2X_DEV_INFO("req_line_speed %d req_duplex %d req_flow_ctrl 0x%x advertising 0x%x\n", in bnx2x_link_settings_requested()
11492 bp->link_params.speed_cap_mask[0] = in bnx2x_get_port_hwinfo()
11500 bp->port.link_config[0] = in bnx2x_get_port_hwinfo()
11522 BNX2X_DEV_INFO("lane_config 0x%08x speed_cap_mask0 0x%08x link_config0 0x%08x\n", in bnx2x_get_port_hwinfo()
11524 bp->link_params.speed_cap_mask[0], in bnx2x_get_port_hwinfo()
11525 bp->port.link_config[0]); in bnx2x_get_port_hwinfo()
11527 bp->link_params.switch_cfg = (bp->port.link_config[0] & in bnx2x_get_port_hwinfo()
11560 bp->link_params.eee_mode = 0; in bnx2x_get_port_hwinfo()
11581 BNX2X_DEV_INFO("max_iscsi_conn 0x%x\n", in bnx2x_get_iscsi_info()
11609 u8 count = 0; in bnx2x_shared_fcoe_funcs()
11637 for (port = 0; port < port_cnt; port++) { in bnx2x_shared_fcoe_funcs()
11706 BNX2X_DEV_INFO("max_fcoe_conn 0x%x\n", bp->cnic_eth_dev.max_fcoe_conn); in bnx2x_get_fcoe_info()
11900 if (val != 0xffff) { in validate_set_si_mode()
11912 u32 val = 0, val2 = 0; in bnx2x_get_hwinfo()
11913 int rc = 0; in bnx2x_get_hwinfo()
11916 if (REG_RD(bp, MISC_REG_CHIP_NUM) == 0xffffffff) { in bnx2x_get_hwinfo()
11931 bp->igu_base_sb = 0; in bnx2x_get_hwinfo()
11947 REG_WR(bp, IGU_REG_RESET_MEMORIES, 0x7f); in bnx2x_get_hwinfo()
11996 bp->mf_ov = 0; in bnx2x_get_hwinfo()
11997 bp->mf_mode = 0; in bnx2x_get_hwinfo()
11998 bp->mf_sub_mode = 0; in bnx2x_get_hwinfo()
12002 BNX2X_DEV_INFO("shmem2base 0x%x, size %d, mfcfg offset %d\n", in bnx2x_get_hwinfo()
12033 mac_upper) != 0xffff) && in bnx2x_get_hwinfo()
12088 bp->mf_config[vn] = 0; in bnx2x_get_hwinfo()
12102 bp->mf_config[vn] = 0; in bnx2x_get_hwinfo()
12103 BNX2X_DEV_INFO("unknown extended MF mode 0x%x\n", in bnx2x_get_hwinfo()
12109 bp->mf_config[vn] = 0; in bnx2x_get_hwinfo()
12110 BNX2X_DEV_INFO("unknown MF mode 0x%x\n", val); in bnx2x_get_hwinfo()
12125 BNX2X_DEV_INFO("MF OV for func %d is %d (0x%04x)\n", in bnx2x_get_hwinfo()
12197 memset(bp->fw_ver, 0, sizeof(bp->fw_ver)); in bnx2x_read_fwinfo()
12205 if (rodi < 0 || kw_len != VENDOR_ID_LEN) in bnx2x_read_fwinfo()
12214 if (rodi >= 0 && kw_len < sizeof(bp->fw_ver)) { in bnx2x_read_fwinfo()
12225 u32 flags = 0; in bnx2x_set_modes_bitmap()
12313 BNX2X_DEV_INFO("fw_seq 0x%08x\n", bp->fw_seq); in bnx2x_init_bp()
12325 if (BP_NOMCP(bp) && (func == 0)) in bnx2x_init_bp()
12346 bp->tx_ring_size = IS_MF_STORAGE_ONLY(bp) ? 0 : MAX_TX_AVAIL; in bnx2x_init_bp()
12356 timer_setup(&bp->timer, bnx2x_timer, 0); in bnx2x_init_bp()
12434 int other_engine = BP_PATH(bp) ? 0 : 1; in bnx2x_open()
12473 } while (0); in bnx2x_open()
12482 return 0; in bnx2x_open()
12493 return 0; in bnx2x_close()
12527 int offset = 0; in bnx2x_init_mcast_macs_list()
12548 offset = 0; in bnx2x_init_mcast_macs_list()
12551 return 0; in bnx2x_init_mcast_macs_list()
12559 * We will use zero (0) as a MAC type for these MACs.
12567 unsigned long ramrod_flags = 0; in bnx2x_set_uc_list()
12571 if (rc < 0) { in bnx2x_set_uc_list()
12583 rc = 0; in bnx2x_set_uc_list()
12585 } else if (rc < 0) { in bnx2x_set_uc_list()
12604 int rc = 0; in bnx2x_set_mc_list_e1x()
12610 if (rc < 0) { in bnx2x_set_mc_list_e1x()
12624 if (rc < 0) in bnx2x_set_mc_list_e1x()
12639 int rc = 0; in bnx2x_set_mc_list()
12655 if (rc < 0) in bnx2x_set_mc_list()
12663 if (rc < 0) in bnx2x_set_mc_list()
12703 if (bnx2x_set_mc_list(bp) < 0) in bnx2x_set_rx_mode_inner()
12708 if (bnx2x_set_uc_list(bp) < 0) in bnx2x_set_rx_mode_inner()
12716 BNX2X_SP_RTNL_VFPF_MCAST, 0); in bnx2x_set_rx_mode_inner()
12753 DP(NETIF_MSG_LINK, "mdio_read: prtad 0x%x, devad 0x%x, addr 0x%x\n", in bnx2x_mdio_read()
12762 DP(NETIF_MSG_LINK, "mdio_read_val 0x%x rc = 0x%x\n", value, rc); in bnx2x_mdio_read()
12777 "mdio_write: prtad 0x%x, devad 0x%x, addr 0x%x, value 0x%x\n", in bnx2x_mdio_write()
12802 DP(NETIF_MSG_LINK, "ioctl: phy id 0x%x, reg 0x%x, val_in 0x%x\n", in bnx2x_ioctl()
12820 return 0; in bnx2x_validate_addr()
12834 return 0; in bnx2x_get_phys_port_id()
12868 unsigned long ramrod_flags = 0; in __bnx2x_vlan_configure_vid()
12883 int rc = 0; in bnx2x_vlan_configure_vid_list()
12904 return 0; in bnx2x_vlan_configure_vid_list()
12931 return 0; in bnx2x_vlan_reconfigure_vid()
12952 return 0; in bnx2x_vlan_rx_add_vid()
12960 int rc = 0; in bnx2x_vlan_rx_kill_vid()
13027 if (dma_set_mask_and_coherent(dev, DMA_BIT_MASK(64)) != 0 && in bnx2x_set_coherency_mask()
13028 dma_set_mask_and_coherent(dev, DMA_BIT_MASK(32)) != 0) { in bnx2x_set_coherency_mask()
13033 return 0; in bnx2x_set_coherency_mask()
13065 if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) { in bnx2x_init_dev()
13117 dev->mem_start = pci_resource_start(pdev, 0); in bnx2x_init_dev()
13119 dev->mem_end = pci_resource_end(pdev, 0); in bnx2x_init_dev()
13123 bp->regview = pci_ioremap_bar(pdev, 0); in bnx2x_init_dev()
13166 REG_WR(bp, PXP2_REG_PGL_ADDR_88_F0, 0); in bnx2x_init_dev()
13167 REG_WR(bp, PXP2_REG_PGL_ADDR_8C_F0, 0); in bnx2x_init_dev()
13168 REG_WR(bp, PXP2_REG_PGL_ADDR_90_F0, 0); in bnx2x_init_dev()
13169 REG_WR(bp, PXP2_REG_PGL_ADDR_94_F0, 0); in bnx2x_init_dev()
13172 REG_WR(bp, PXP2_REG_PGL_ADDR_88_F1, 0); in bnx2x_init_dev()
13173 REG_WR(bp, PXP2_REG_PGL_ADDR_8C_F1, 0); in bnx2x_init_dev()
13174 REG_WR(bp, PXP2_REG_PGL_ADDR_90_F1, 0); in bnx2x_init_dev()
13175 REG_WR(bp, PXP2_REG_PGL_ADDR_94_F1, 0); in bnx2x_init_dev()
13251 bp->mdio.mmds = 0; in bnx2x_init_dev()
13257 return 0; in bnx2x_init_dev()
13290 for (i = 0; i < sizeof(*fw_hdr) / sizeof(*sections); i++) { in bnx2x_check_firmware()
13304 for (i = 0; i < be32_to_cpu(fw_hdr->init_ops_offsets.len) / 2; i++) { in bnx2x_check_firmware()
13314 if ((fw_ver[0] != BCM_5710_FW_MAJOR_VERSION) || in bnx2x_check_firmware()
13319 fw_ver[0], fw_ver[1], fw_ver[2], fw_ver[3], in bnx2x_check_firmware()
13327 return 0; in bnx2x_check_firmware()
13336 for (i = 0; i < n/4; i++) in be32_to_cpu_n()
13350 for (i = 0, j = 0; i < n/8; i++, j += 2) { in bnx2x_prep_ops()
13352 target[i].op = (tmp >> 24) & 0xff; in bnx2x_prep_ops()
13353 target[i].offset = tmp & 0xffffff; in bnx2x_prep_ops()
13367 for (i = 0, j = 0; i < n/sizeof(struct iro); i++) { in bnx2x_prep_iro()
13371 target[i].m1 = (tmp >> 16) & 0xffff; in bnx2x_prep_iro()
13372 target[i].m2 = tmp & 0xffff; in bnx2x_prep_iro()
13375 target[i].m3 = (tmp >> 16) & 0xffff; in bnx2x_prep_iro()
13376 target[i].size = tmp & 0xffff; in bnx2x_prep_iro()
13387 for (i = 0; i < n/2; i++) in be16_to_cpu_n()
13399 } while (0)
13408 return 0; in bnx2x_init_firmware()
13469 return 0; in bnx2x_init_firmware()
13546 u16 control = 0; in bnx2x_get_num_non_def_sbs()
13621 #define tsgen_ctrl 0x0
13622 #define tsgen_freecount 0x10
13623 #define tsgen_synctime_t0 0x20
13624 #define tsgen_offset_t0 0x28
13625 #define tsgen_drift_t0 0x30
13626 #define tsgen_synctime_t1 0x58
13627 #define tsgen_offset_t1 0x60
13628 #define tsgen_drift_t1 0x68
13662 int best_dif = BNX2X_MAX_PHC_DRIFT, best_period = 0, best_val = 0; in bnx2x_ptp_adjfreq()
13672 if (ppb < 0) { in bnx2x_ptp_adjfreq()
13674 drift_dir = 0; in bnx2x_ptp_adjfreq()
13677 if (ppb == 0) { in bnx2x_ptp_adjfreq()
13679 best_period = 0x1FFFFFF; in bnx2x_ptp_adjfreq()
13687 for (val = 0; val <= 31; val++) { in bnx2x_ptp_adjfreq()
13688 if ((val & 0x7) == 0) in bnx2x_ptp_adjfreq()
13692 if (period1 != 0) in bnx2x_ptp_adjfreq()
13696 if (dif1 < 0) in bnx2x_ptp_adjfreq()
13699 if (dif2 < 0) in bnx2x_ptp_adjfreq()
13721 return 0; in bnx2x_ptp_adjfreq()
13738 return 0; in bnx2x_ptp_adjtime()
13758 return 0; in bnx2x_ptp_gettime()
13780 return 0; in bnx2x_ptp_settime()
13799 bp->ptp_clock_info.n_alarm = 0; in bnx2x_register_phc()
13800 bp->ptp_clock_info.n_ext_ts = 0; in bnx2x_register_phc()
13801 bp->ptp_clock_info.n_per_out = 0; in bnx2x_register_phc()
13802 bp->ptp_clock_info.pps = 0; in bnx2x_register_phc()
13832 ktime_t fw_ready_time = ktime_set(5, 0); in bnx2x_init_one()
13847 if (max_cos_est < 0) in bnx2x_init_one()
13850 cnic_cnt = is_vf ? 0 : 1; in bnx2x_init_one()
13855 max_non_def_sbs += is_vf ? 1 : 0; in bnx2x_init_one()
13878 bp->flags = 0; in bnx2x_init_one()
13891 if (rc < 0) { in bnx2x_init_one()
13998 return 0; in bnx2x_init_one()
14042 bnx2x_fw_command(bp, DRV_MSG_CODE_RMMOD, 0); in __bnx2x_remove()
14157 return 0; in bnx2x_eeh_nic_unload()
14251 bp->sp_state = 0; in bnx2x_io_slot_reset()
14252 bp->port.pmf = 0; in bnx2x_io_slot_reset()
14402 * Return 0 if success, -ENODEV if ramrod doesn't return.
14406 unsigned long ramrod_flags = 0; in bnx2x_set_iscsi_eth_mac_addr()
14434 >> SPE_HDR_CMD_ID_SHIFT) & 0xff; in bnx2x_cnic_sp_post()
14517 for (i = 0; i < count; i++) { in bnx2x_cnic_sp_queue()
14542 bnx2x_cnic_sp_post(bp, 0); in bnx2x_cnic_sp_queue()
14550 int rc = 0; in bnx2x_cnic_ctl_send()
14565 int rc = 0; in bnx2x_cnic_ctl_send_bh()
14581 struct cnic_ctl_info ctl = {0}; in bnx2x_cnic_notify()
14590 struct cnic_ctl_info ctl = {0}; in bnx2x_cnic_cfc_comp()
14598 bnx2x_cnic_sp_post(bp, 0); in bnx2x_cnic_cfc_comp()
14608 unsigned long accept_flags = 0, ramrod_flags = 0; in bnx2x_set_iscsi_eth_rx_mode()
14636 bnx2x_set_q_rx_mode(bp, cl_id, 0, accept_flags, 0, in bnx2x_set_iscsi_eth_rx_mode()
14644 int rc = 0; in bnx2x_drv_ctl()
14665 unsigned long sp_bits = 0; in bnx2x_drv_ctl()
14702 unsigned long sp_bits = 0; in bnx2x_drv_ctl()
14763 for (i = 0; i < sizeof(struct fcoe_capabilities); in bnx2x_drv_ctl()
14768 bnx2x_schedule_sp_rtnl(bp, BNX2X_SP_RTNL_GET_DRV_VERSION, 0); in bnx2x_drv_ctl()
14786 bnx2x_schedule_sp_rtnl(bp, BNX2X_SP_RTNL_GET_DRV_VERSION, 0); in bnx2x_drv_ctl()
14829 if (!SHMEM2_HAS(bp, fc_npiv_nvram_tbl_addr[0])) in bnx2x_get_fc_npiv()
14865 BNX2X_ERR("FC-NPIV table with bad length 0x%08x\n", in bnx2x_get_fc_npiv()
14869 DP(BNX2X_MSG_MCP, "Read 0x%08x entries from NVRAM\n", in bnx2x_get_fc_npiv()
14875 for (i = 0; i < cnic_tbl->count; i++) { in bnx2x_get_fc_npiv()
14880 rc = 0; in bnx2x_get_fc_npiv()
14892 cp->irq_arr[0].irq_flags |= CNIC_IRQ_FL_MSIX; in bnx2x_setup_cnic_irq_info()
14893 cp->irq_arr[0].vector = bp->msix_table[1].vector; in bnx2x_setup_cnic_irq_info()
14896 cp->irq_arr[0].irq_flags &= ~CNIC_IRQ_FL_MSIX; in bnx2x_setup_cnic_irq_info()
14899 cp->irq_arr[0].status_blk = (void *)bp->cnic_sb.e2_sb; in bnx2x_setup_cnic_irq_info()
14901 cp->irq_arr[0].status_blk = (void *)bp->cnic_sb.e1x_sb; in bnx2x_setup_cnic_irq_info()
14903 cp->irq_arr[0].status_blk_num = bnx2x_cnic_fw_sb_id(bp); in bnx2x_setup_cnic_irq_info()
14904 cp->irq_arr[0].status_blk_num2 = bnx2x_cnic_igu_sb_id(bp); in bnx2x_setup_cnic_irq_info()
14967 bp->cnic_spq_pending = 0; in bnx2x_register_cnic()
14968 bp->cnic_kwq_pending = 0; in bnx2x_register_cnic()
14972 cp->num_irq = 0; in bnx2x_register_cnic()
14981 bnx2x_schedule_sp_rtnl(bp, BNX2X_SP_RTNL_GET_DRV_VERSION, 0); in bnx2x_register_cnic()
14983 return 0; in bnx2x_register_cnic()
14992 cp->drv_state = 0; in bnx2x_unregister_cnic()
15000 return 0; in bnx2x_unregister_cnic()
15070 * When pretending to be PF, the pretend value is the function number 0...7
15085 return 0; in bnx2x_pretend_func()
15101 for (i = 0; i < 10; i++) { in bnx2x_ptp_task()
15105 if (val_seq & 0x10000) { in bnx2x_ptp_task()
15121 NIG_REG_P0_TLLH_PTP_BUF_SEQID, 0x10000); in bnx2x_ptp_task()
15124 memset(&shhwtstamps, 0, sizeof(shhwtstamps)); in bnx2x_ptp_task()
15154 NIG_REG_P0_LLH_PTP_HOST_BUF_SEQID, 0x10000); in bnx2x_set_rx_ts()
15175 phc_cycles = (phc_cycles << 32) + wb_data[0]; in bnx2x_cyclecounter_read()
15184 memset(&bp->cyclecounter, 0, sizeof(bp->cyclecounter)); in bnx2x_init_cyclecounter()
15187 bp->cyclecounter.shift = 0; in bnx2x_init_cyclecounter()
15217 memset(&q_params, 0, sizeof(q_params)); in bnx2x_enable_ptp_packets()
15240 return 0; in bnx2x_enable_ptp_packets()
15243 #define BNX2X_P2P_DETECT_PARAM_MASK 0x5F5
15244 #define BNX2X_P2P_DETECT_RULE_MASK 0x3DBB
15245 #define BNX2X_PTP_TX_ON_PARAM_MASK (BNX2X_P2P_DETECT_PARAM_MASK & 0x6AA)
15246 #define BNX2X_PTP_TX_ON_RULE_MASK (BNX2X_P2P_DETECT_RULE_MASK & 0x3EEE)
15247 #define BNX2X_PTP_V1_L4_PARAM_MASK (BNX2X_P2P_DETECT_PARAM_MASK & 0x7EE)
15248 #define BNX2X_PTP_V1_L4_RULE_MASK (BNX2X_P2P_DETECT_RULE_MASK & 0x3FFE)
15249 #define BNX2X_PTP_V2_L4_PARAM_MASK (BNX2X_P2P_DETECT_PARAM_MASK & 0x7EA)
15250 #define BNX2X_PTP_V2_L4_RULE_MASK (BNX2X_P2P_DETECT_RULE_MASK & 0x3FEE)
15251 #define BNX2X_PTP_V2_L2_PARAM_MASK (BNX2X_P2P_DETECT_PARAM_MASK & 0x6BF)
15252 #define BNX2X_PTP_V2_L2_RULE_MASK (BNX2X_P2P_DETECT_RULE_MASK & 0x3EFF)
15253 #define BNX2X_PTP_V2_PARAM_MASK (BNX2X_P2P_DETECT_PARAM_MASK & 0x6AA)
15254 #define BNX2X_PTP_V2_RULE_MASK (BNX2X_P2P_DETECT_RULE_MASK & 0x3EEE)
15263 return 0; in bnx2x_configure_ptp_filters()
15335 NIG_REG_P0_LLH_PTP_TO_HOST, 0x1); in bnx2x_configure_ptp_filters()
15337 return 0; in bnx2x_configure_ptp_filters()
15369 -EFAULT : 0; in bnx2x_hwtstamp_ioctl()
15380 NIG_REG_P0_LLH_PTP_PARAM_MASK, 0x7FF); in bnx2x_configure_ptp()
15382 NIG_REG_P0_LLH_PTP_RULE_MASK, 0x3FFF); in bnx2x_configure_ptp()
15384 NIG_REG_P0_TLLH_PTP_PARAM_MASK, 0x7FF); in bnx2x_configure_ptp()
15386 NIG_REG_P0_TLLH_PTP_RULE_MASK, 0x3FFF); in bnx2x_configure_ptp()
15390 NIG_REG_P0_LLH_PTP_TO_HOST, 0x0); in bnx2x_configure_ptp()
15394 NIG_REG_P0_PTP_EN, 0x3F); in bnx2x_configure_ptp()
15397 wb_data[0] = 0; in bnx2x_configure_ptp()
15398 wb_data[1] = 0; in bnx2x_configure_ptp()
15410 NIG_REG_P0_LLH_PTP_HOST_BUF_SEQID, 0x10000); in bnx2x_configure_ptp()
15412 NIG_REG_P0_TLLH_PTP_BUF_SEQID, 0x10000); in bnx2x_configure_ptp()
15414 return 0; in bnx2x_configure_ptp()