Lines Matching refs:mbx
117 static void nicvf_write_to_mbx(struct nicvf *nic, union nic_mbx *mbx) in nicvf_write_to_mbx() argument
119 u64 *msg = (u64 *)mbx; in nicvf_write_to_mbx()
125 int nicvf_send_msg_to_pf(struct nicvf *nic, union nic_mbx *mbx) in nicvf_send_msg_to_pf() argument
133 nicvf_write_to_mbx(nic, mbx); in nicvf_send_msg_to_pf()
146 (mbx->msg.msg & 0xFF), nic->vf_id); in nicvf_send_msg_to_pf()
158 union nic_mbx mbx = {}; in nicvf_check_pf_ready() local
160 mbx.msg.msg = NIC_MBOX_MSG_READY; in nicvf_check_pf_ready()
161 if (nicvf_send_msg_to_pf(nic, &mbx)) { in nicvf_check_pf_ready()
180 union nic_mbx mbx = {}; in nicvf_handle_mbx_intr() local
186 mbx_data = (u64 *)&mbx; in nicvf_handle_mbx_intr()
194 netdev_dbg(nic->netdev, "Mbox message: msg: 0x%x\n", mbx.msg.msg); in nicvf_handle_mbx_intr()
195 switch (mbx.msg.msg) { in nicvf_handle_mbx_intr()
198 nic->vf_id = mbx.nic_cfg.vf_id & 0x7F; in nicvf_handle_mbx_intr()
199 nic->tns_mode = mbx.nic_cfg.tns_mode & 0x7F; in nicvf_handle_mbx_intr()
200 nic->node = mbx.nic_cfg.node_id; in nicvf_handle_mbx_intr()
203 mbx.nic_cfg.mac_addr); in nicvf_handle_mbx_intr()
204 nic->sqs_mode = mbx.nic_cfg.sqs_mode; in nicvf_handle_mbx_intr()
205 nic->loopback_supported = mbx.nic_cfg.loopback_supported; in nicvf_handle_mbx_intr()
217 nic->rss_info.rss_size = mbx.rss_size.ind_tbl_size; in nicvf_handle_mbx_intr()
221 nicvf_read_bgx_stats(nic, &mbx.bgx_stats); in nicvf_handle_mbx_intr()
226 nic->link_up = mbx.link_status.link_up; in nicvf_handle_mbx_intr()
227 nic->duplex = mbx.link_status.duplex; in nicvf_handle_mbx_intr()
228 nic->speed = mbx.link_status.speed; in nicvf_handle_mbx_intr()
244 nic->sqs_count = mbx.sqs_alloc.qs_count; in nicvf_handle_mbx_intr()
251 nic->snicvf[mbx.nicvf.sqs_id] = in nicvf_handle_mbx_intr()
252 (struct nicvf *)mbx.nicvf.nicvf; in nicvf_handle_mbx_intr()
260 nic->pnicvf = (struct nicvf *)mbx.nicvf.nicvf; in nicvf_handle_mbx_intr()
265 "Invalid message from PF, msg 0x%x\n", mbx.msg.msg); in nicvf_handle_mbx_intr()
273 union nic_mbx mbx = {}; in nicvf_hw_set_mac_addr() local
275 mbx.mac.msg = NIC_MBOX_MSG_SET_MAC; in nicvf_hw_set_mac_addr()
276 mbx.mac.vf_id = nic->vf_id; in nicvf_hw_set_mac_addr()
277 ether_addr_copy(mbx.mac.mac_addr, netdev->dev_addr); in nicvf_hw_set_mac_addr()
279 return nicvf_send_msg_to_pf(nic, &mbx); in nicvf_hw_set_mac_addr()
284 union nic_mbx mbx = {}; in nicvf_config_cpi() local
286 mbx.cpi_cfg.msg = NIC_MBOX_MSG_CPI_CFG; in nicvf_config_cpi()
287 mbx.cpi_cfg.vf_id = nic->vf_id; in nicvf_config_cpi()
288 mbx.cpi_cfg.cpi_alg = nic->cpi_alg; in nicvf_config_cpi()
289 mbx.cpi_cfg.rq_cnt = nic->qs->rq_cnt; in nicvf_config_cpi()
291 nicvf_send_msg_to_pf(nic, &mbx); in nicvf_config_cpi()
296 union nic_mbx mbx = {}; in nicvf_get_rss_size() local
298 mbx.rss_size.msg = NIC_MBOX_MSG_RSS_SIZE; in nicvf_get_rss_size()
299 mbx.rss_size.vf_id = nic->vf_id; in nicvf_get_rss_size()
300 nicvf_send_msg_to_pf(nic, &mbx); in nicvf_get_rss_size()
305 union nic_mbx mbx = {}; in nicvf_config_rss() local
310 mbx.rss_cfg.vf_id = nic->vf_id; in nicvf_config_rss()
311 mbx.rss_cfg.hash_bits = rss->hash_bits; in nicvf_config_rss()
313 mbx.rss_cfg.tbl_offset = nextq; in nicvf_config_rss()
314 mbx.rss_cfg.tbl_len = min(ind_tbl_len, in nicvf_config_rss()
316 mbx.rss_cfg.msg = mbx.rss_cfg.tbl_offset ? in nicvf_config_rss()
319 for (i = 0; i < mbx.rss_cfg.tbl_len; i++) in nicvf_config_rss()
320 mbx.rss_cfg.ind_tbl[i] = rss->ind_tbl[nextq++]; in nicvf_config_rss()
322 nicvf_send_msg_to_pf(nic, &mbx); in nicvf_config_rss()
324 ind_tbl_len -= mbx.rss_cfg.tbl_len; in nicvf_config_rss()
379 union nic_mbx mbx = {}; in nicvf_request_sqs() local
388 mbx.sqs_alloc.msg = NIC_MBOX_MSG_ALLOC_SQS; in nicvf_request_sqs()
389 mbx.sqs_alloc.vf_id = nic->vf_id; in nicvf_request_sqs()
390 mbx.sqs_alloc.qs_count = nic->sqs_count; in nicvf_request_sqs()
391 if (nicvf_send_msg_to_pf(nic, &mbx)) { in nicvf_request_sqs()
408 mbx.nicvf.msg = NIC_MBOX_MSG_SNICVF_PTR; in nicvf_request_sqs()
409 mbx.nicvf.vf_id = nic->vf_id; in nicvf_request_sqs()
410 mbx.nicvf.sqs_id = sqs; in nicvf_request_sqs()
411 nicvf_send_msg_to_pf(nic, &mbx); in nicvf_request_sqs()
449 union nic_mbx mbx = {}; in nicvf_send_vf_struct() local
451 mbx.nicvf.msg = NIC_MBOX_MSG_NICVF_PTR; in nicvf_send_vf_struct()
452 mbx.nicvf.sqs_mode = nic->sqs_mode; in nicvf_send_vf_struct()
453 mbx.nicvf.nicvf = (u64)nic; in nicvf_send_vf_struct()
454 nicvf_send_msg_to_pf(nic, &mbx); in nicvf_send_vf_struct()
459 union nic_mbx mbx = {}; in nicvf_get_primary_vf_struct() local
461 mbx.nicvf.msg = NIC_MBOX_MSG_PNICVF_PTR; in nicvf_get_primary_vf_struct()
462 nicvf_send_msg_to_pf(nic, &mbx); in nicvf_get_primary_vf_struct()
487 union nic_mbx mbx = {}; in nicvf_init_resources() local
489 mbx.msg.msg = NIC_MBOX_MSG_CFG_DONE; in nicvf_init_resources()
503 nicvf_write_to_mbx(nic, &mbx); in nicvf_init_resources()
1053 union nic_mbx mbx = {}; in nicvf_stop() local
1055 mbx.msg.msg = NIC_MBOX_MSG_SHUTDOWN; in nicvf_stop()
1056 nicvf_send_msg_to_pf(nic, &mbx); in nicvf_stop()
1235 union nic_mbx mbx = {}; in nicvf_update_hw_max_frs() local
1237 mbx.frs.msg = NIC_MBOX_MSG_SET_MAX_FRS; in nicvf_update_hw_max_frs()
1238 mbx.frs.max_frs = mtu; in nicvf_update_hw_max_frs()
1239 mbx.frs.vf_id = nic->vf_id; in nicvf_update_hw_max_frs()
1241 return nicvf_send_msg_to_pf(nic, &mbx); in nicvf_update_hw_max_frs()
1285 union nic_mbx mbx = {}; in nicvf_update_lmac_stats() local
1290 mbx.bgx_stats.msg = NIC_MBOX_MSG_BGX_STATS; in nicvf_update_lmac_stats()
1291 mbx.bgx_stats.vf_id = nic->vf_id; in nicvf_update_lmac_stats()
1293 mbx.bgx_stats.rx = 1; in nicvf_update_lmac_stats()
1295 mbx.bgx_stats.idx = stat; in nicvf_update_lmac_stats()
1296 if (nicvf_send_msg_to_pf(nic, &mbx)) in nicvf_update_lmac_stats()
1304 mbx.bgx_stats.rx = 0; in nicvf_update_lmac_stats()
1306 mbx.bgx_stats.idx = stat; in nicvf_update_lmac_stats()
1307 if (nicvf_send_msg_to_pf(nic, &mbx)) in nicvf_update_lmac_stats()
1409 union nic_mbx mbx = {}; in nicvf_config_loopback() local
1411 mbx.lbk.msg = NIC_MBOX_MSG_LOOPBACK; in nicvf_config_loopback()
1412 mbx.lbk.vf_id = nic->vf_id; in nicvf_config_loopback()
1413 mbx.lbk.enable = (features & NETIF_F_LOOPBACK) != 0; in nicvf_config_loopback()
1415 return nicvf_send_msg_to_pf(nic, &mbx); in nicvf_config_loopback()