Lines Matching refs:mbx

133 static void nic_send_msg_to_vf(struct nicpf *nic, int vf, union nic_mbx *mbx)  in nic_send_msg_to_vf()  argument
136 u64 *msg = (u64 *)mbx; in nic_send_msg_to_vf()
160 union nic_mbx mbx = {}; in nic_mbx_send_ready() local
164 mbx.nic_cfg.msg = NIC_MBOX_MSG_READY; in nic_mbx_send_ready()
165 mbx.nic_cfg.vf_id = vf; in nic_mbx_send_ready()
167 mbx.nic_cfg.tns_mode = NIC_TNS_BYPASS_MODE; in nic_mbx_send_ready()
175 ether_addr_copy((u8 *)&mbx.nic_cfg.mac_addr, mac); in nic_mbx_send_ready()
177 mbx.nic_cfg.sqs_mode = (vf >= nic->num_vf_en) ? true : false; in nic_mbx_send_ready()
178 mbx.nic_cfg.node_id = nic->node; in nic_mbx_send_ready()
180 mbx.nic_cfg.loopback_supported = vf < nic->num_vf_en; in nic_mbx_send_ready()
182 nic_send_msg_to_vf(nic, vf, &mbx); in nic_mbx_send_ready()
190 union nic_mbx mbx = {}; in nic_mbx_send_ack() local
192 mbx.msg.msg = NIC_MBOX_MSG_ACK; in nic_mbx_send_ack()
193 nic_send_msg_to_vf(nic, vf, &mbx); in nic_mbx_send_ack()
202 union nic_mbx mbx = {}; in nic_mbx_send_nack() local
204 mbx.msg.msg = NIC_MBOX_MSG_NACK; in nic_mbx_send_nack()
205 nic_send_msg_to_vf(nic, vf, &mbx); in nic_mbx_send_nack()
234 union nic_mbx mbx = {}; in nic_get_bgx_stats() local
239 mbx.bgx_stats.msg = NIC_MBOX_MSG_BGX_STATS; in nic_get_bgx_stats()
240 mbx.bgx_stats.vf_id = bgx->vf_id; in nic_get_bgx_stats()
241 mbx.bgx_stats.rx = bgx->rx; in nic_get_bgx_stats()
242 mbx.bgx_stats.idx = bgx->idx; in nic_get_bgx_stats()
244 mbx.bgx_stats.stats = bgx_get_rx_stats(nic->node, bgx_idx, in nic_get_bgx_stats()
247 mbx.bgx_stats.stats = bgx_get_tx_stats(nic->node, bgx_idx, in nic_get_bgx_stats()
249 nic_send_msg_to_vf(nic, bgx->vf_id, &mbx); in nic_get_bgx_stats()
552 union nic_mbx mbx = {}; in nic_send_rss_size() local
554 mbx.rss_size.msg = NIC_MBOX_MSG_RSS_SIZE; in nic_send_rss_size()
555 mbx.rss_size.ind_tbl_size = nic->hw->rss_ind_tbl_size; in nic_send_rss_size()
556 nic_send_msg_to_vf(nic, vf, &mbx); in nic_send_rss_size()
698 union nic_mbx mbx = {}; in nic_send_pnicvf() local
700 mbx.nicvf.msg = NIC_MBOX_MSG_PNICVF_PTR; in nic_send_pnicvf()
701 mbx.nicvf.nicvf = nic->nicvf[nic->pqs_vf[sqs]]; in nic_send_pnicvf()
702 nic_send_msg_to_vf(nic, sqs, &mbx); in nic_send_pnicvf()
708 union nic_mbx mbx = {}; in nic_send_snicvf() local
711 mbx.nicvf.msg = NIC_MBOX_MSG_SNICVF_PTR; in nic_send_snicvf()
712 mbx.nicvf.sqs_id = nicvf->sqs_id; in nic_send_snicvf()
713 mbx.nicvf.nicvf = nic->nicvf[sqs_id]; in nic_send_snicvf()
714 nic_send_msg_to_vf(nic, nicvf->vf_id, &mbx); in nic_send_snicvf()
737 union nic_mbx mbx = {}; in nic_alloc_sqs() local
754 mbx.sqs_alloc.msg = NIC_MBOX_MSG_ALLOC_SQS; in nic_alloc_sqs()
755 mbx.sqs_alloc.vf_id = sqs->vf_id; in nic_alloc_sqs()
756 mbx.sqs_alloc.qs_count = alloc_qs; in nic_alloc_sqs()
757 nic_send_msg_to_vf(nic, sqs->vf_id, &mbx); in nic_alloc_sqs()
865 union nic_mbx mbx = {}; in nic_pause_frame() local
874 mbx.pfc.msg = NIC_MBOX_MSG_PFC; in nic_pause_frame()
875 mbx.pfc.autoneg = pfc.autoneg; in nic_pause_frame()
876 mbx.pfc.fc_rx = pfc.fc_rx; in nic_pause_frame()
877 mbx.pfc.fc_tx = pfc.fc_tx; in nic_pause_frame()
878 nic_send_msg_to_vf(nic, vf, &mbx); in nic_pause_frame()
929 union nic_mbx mbx = {}; in nic_link_status_get() local
933 mbx.link_status.msg = NIC_MBOX_MSG_BGX_LINK_CHANGE; in nic_link_status_get()
943 mbx.link_status.link_up = link.link_up; in nic_link_status_get()
944 mbx.link_status.duplex = link.duplex; in nic_link_status_get()
945 mbx.link_status.speed = link.speed; in nic_link_status_get()
946 mbx.link_status.mac_type = link.mac_type; in nic_link_status_get()
949 nic_send_msg_to_vf(nic, vf, &mbx); in nic_link_status_get()
955 union nic_mbx mbx = {}; in nic_handle_mbx_intr() local
965 mbx_data = (u64 *)&mbx; in nic_handle_mbx_intr()
974 __func__, mbx.msg.msg, vf); in nic_handle_mbx_intr()
975 switch (mbx.msg.msg) { in nic_handle_mbx_intr()
981 (mbx.qs.num << NIC_QS_ID_SHIFT); in nic_handle_mbx_intr()
982 cfg = mbx.qs.cfg; in nic_handle_mbx_intr()
993 (mbx.rq.qs_num << NIC_QS_ID_SHIFT) | in nic_handle_mbx_intr()
994 (mbx.rq.rq_num << NIC_Q_NUM_SHIFT); in nic_handle_mbx_intr()
995 nic_reg_write(nic, reg_addr, mbx.rq.cfg); in nic_handle_mbx_intr()
1008 (mbx.rq.qs_num << NIC_QS_ID_SHIFT) | in nic_handle_mbx_intr()
1009 (mbx.rq.rq_num << NIC_Q_NUM_SHIFT); in nic_handle_mbx_intr()
1010 nic_reg_write(nic, reg_addr, mbx.rq.cfg); in nic_handle_mbx_intr()
1017 (mbx.rq.qs_num << NIC_QS_ID_SHIFT) | in nic_handle_mbx_intr()
1018 (mbx.rq.rq_num << NIC_Q_NUM_SHIFT); in nic_handle_mbx_intr()
1019 nic_reg_write(nic, reg_addr, mbx.rq.cfg); in nic_handle_mbx_intr()
1023 (mbx.sq.qs_num << NIC_QS_ID_SHIFT) | in nic_handle_mbx_intr()
1024 (mbx.sq.sq_num << NIC_Q_NUM_SHIFT); in nic_handle_mbx_intr()
1025 nic_reg_write(nic, reg_addr, mbx.sq.cfg); in nic_handle_mbx_intr()
1026 nic_tx_channel_cfg(nic, mbx.qs.num, &mbx.sq); in nic_handle_mbx_intr()
1033 lmac = mbx.mac.vf_id; in nic_handle_mbx_intr()
1036 bgx_set_lmac_mac(nic->node, bgx, lmac, mbx.mac.mac_addr); in nic_handle_mbx_intr()
1039 ret = nic_update_hw_frs(nic, mbx.frs.max_frs, in nic_handle_mbx_intr()
1040 mbx.frs.vf_id); in nic_handle_mbx_intr()
1043 nic_config_cpi(nic, &mbx.cpi_cfg); in nic_handle_mbx_intr()
1050 nic_config_rss(nic, &mbx.rss_cfg); in nic_handle_mbx_intr()
1064 nic_alloc_sqs(nic, &mbx.sqs_alloc); in nic_handle_mbx_intr()
1067 nic->nicvf[vf] = mbx.nicvf.nicvf; in nic_handle_mbx_intr()
1073 nic_send_snicvf(nic, &mbx.nicvf); in nic_handle_mbx_intr()
1076 nic_get_bgx_stats(nic, &mbx.bgx_stats); in nic_handle_mbx_intr()
1079 ret = nic_config_loopback(nic, &mbx.lbk); in nic_handle_mbx_intr()
1082 ret = nic_reset_stat_counters(nic, vf, &mbx.reset_stat); in nic_handle_mbx_intr()
1085 nic_pause_frame(nic, vf, &mbx.pfc); in nic_handle_mbx_intr()
1088 nic_config_timestamp(nic, vf, &mbx.ptp); in nic_handle_mbx_intr()
1110 mbx.xcast.mac, in nic_handle_mbx_intr()
1122 bgx_set_xcast_mode(nic->node, bgx, lmac, mbx.xcast.mode); in nic_handle_mbx_intr()
1133 "Invalid msg from VF%d, msg 0x%x\n", vf, mbx.msg.msg); in nic_handle_mbx_intr()
1139 } else if (mbx.msg.msg != NIC_MBOX_MSG_READY) { in nic_handle_mbx_intr()
1141 mbx.msg.msg, vf); in nic_handle_mbx_intr()
1149 int mbx; in nic_mbx_intr_handler() local
1154 mbx = 0; in nic_mbx_intr_handler()
1156 mbx = 1; in nic_mbx_intr_handler()
1158 intr = nic_reg_read(nic, NIC_PF_MAILBOX_INT + (mbx << 3)); in nic_mbx_intr_handler()
1159 dev_dbg(&nic->pdev->dev, "PF interrupt Mbox%d 0x%llx\n", mbx, intr); in nic_mbx_intr_handler()
1163 vf + (mbx * NIC_VF_PER_MBX_REG)); in nic_mbx_intr_handler()
1166 (mbx * NIC_VF_PER_MBX_REG)); in nic_mbx_intr_handler()
1167 nic_clear_mbx_intr(nic, vf, mbx); in nic_mbx_intr_handler()