Lines Matching refs:mbx
119 static void nicvf_write_to_mbx(struct nicvf *nic, union nic_mbx *mbx) in nicvf_write_to_mbx() argument
121 u64 *msg = (u64 *)mbx; in nicvf_write_to_mbx()
127 int nicvf_send_msg_to_pf(struct nicvf *nic, union nic_mbx *mbx) in nicvf_send_msg_to_pf() argument
137 nicvf_write_to_mbx(nic, mbx); in nicvf_send_msg_to_pf()
145 (mbx->msg.msg & 0xFF), nic->vf_id); in nicvf_send_msg_to_pf()
155 (mbx->msg.msg & 0xFF), nic->vf_id); in nicvf_send_msg_to_pf()
169 union nic_mbx mbx = {}; in nicvf_check_pf_ready() local
171 mbx.msg.msg = NIC_MBOX_MSG_READY; in nicvf_check_pf_ready()
172 if (nicvf_send_msg_to_pf(nic, &mbx)) { in nicvf_check_pf_ready()
183 union nic_mbx mbx = {}; in nicvf_send_cfg_done() local
185 mbx.msg.msg = NIC_MBOX_MSG_CFG_DONE; in nicvf_send_cfg_done()
186 if (nicvf_send_msg_to_pf(nic, &mbx)) { in nicvf_send_cfg_done()
202 union nic_mbx mbx = {}; in nicvf_handle_mbx_intr() local
208 mbx_data = (u64 *)&mbx; in nicvf_handle_mbx_intr()
216 netdev_dbg(nic->netdev, "Mbox message: msg: 0x%x\n", mbx.msg.msg); in nicvf_handle_mbx_intr()
217 switch (mbx.msg.msg) { in nicvf_handle_mbx_intr()
220 nic->vf_id = mbx.nic_cfg.vf_id & 0x7F; in nicvf_handle_mbx_intr()
221 nic->tns_mode = mbx.nic_cfg.tns_mode & 0x7F; in nicvf_handle_mbx_intr()
222 nic->node = mbx.nic_cfg.node_id; in nicvf_handle_mbx_intr()
224 eth_hw_addr_set(nic->netdev, mbx.nic_cfg.mac_addr); in nicvf_handle_mbx_intr()
225 nic->sqs_mode = mbx.nic_cfg.sqs_mode; in nicvf_handle_mbx_intr()
226 nic->loopback_supported = mbx.nic_cfg.loopback_supported; in nicvf_handle_mbx_intr()
238 nic->rss_info.rss_size = mbx.rss_size.ind_tbl_size; in nicvf_handle_mbx_intr()
242 nicvf_read_bgx_stats(nic, &mbx.bgx_stats); in nicvf_handle_mbx_intr()
247 if (nic->link_up != mbx.link_status.link_up) { in nicvf_handle_mbx_intr()
248 nic->link_up = mbx.link_status.link_up; in nicvf_handle_mbx_intr()
249 nic->duplex = mbx.link_status.duplex; in nicvf_handle_mbx_intr()
250 nic->speed = mbx.link_status.speed; in nicvf_handle_mbx_intr()
251 nic->mac_type = mbx.link_status.mac_type; in nicvf_handle_mbx_intr()
268 nic->sqs_count = mbx.sqs_alloc.qs_count; in nicvf_handle_mbx_intr()
275 nic->snicvf[mbx.nicvf.sqs_id] = in nicvf_handle_mbx_intr()
276 (struct nicvf *)mbx.nicvf.nicvf; in nicvf_handle_mbx_intr()
284 nic->pnicvf = (struct nicvf *)mbx.nicvf.nicvf; in nicvf_handle_mbx_intr()
288 nic->pfc.autoneg = mbx.pfc.autoneg; in nicvf_handle_mbx_intr()
289 nic->pfc.fc_rx = mbx.pfc.fc_rx; in nicvf_handle_mbx_intr()
290 nic->pfc.fc_tx = mbx.pfc.fc_tx; in nicvf_handle_mbx_intr()
295 "Invalid message from PF, msg 0x%x\n", mbx.msg.msg); in nicvf_handle_mbx_intr()
303 union nic_mbx mbx = {}; in nicvf_hw_set_mac_addr() local
305 mbx.mac.msg = NIC_MBOX_MSG_SET_MAC; in nicvf_hw_set_mac_addr()
306 mbx.mac.vf_id = nic->vf_id; in nicvf_hw_set_mac_addr()
307 ether_addr_copy(mbx.mac.mac_addr, netdev->dev_addr); in nicvf_hw_set_mac_addr()
309 return nicvf_send_msg_to_pf(nic, &mbx); in nicvf_hw_set_mac_addr()
314 union nic_mbx mbx = {}; in nicvf_config_cpi() local
316 mbx.cpi_cfg.msg = NIC_MBOX_MSG_CPI_CFG; in nicvf_config_cpi()
317 mbx.cpi_cfg.vf_id = nic->vf_id; in nicvf_config_cpi()
318 mbx.cpi_cfg.cpi_alg = nic->cpi_alg; in nicvf_config_cpi()
319 mbx.cpi_cfg.rq_cnt = nic->qs->rq_cnt; in nicvf_config_cpi()
321 nicvf_send_msg_to_pf(nic, &mbx); in nicvf_config_cpi()
326 union nic_mbx mbx = {}; in nicvf_get_rss_size() local
328 mbx.rss_size.msg = NIC_MBOX_MSG_RSS_SIZE; in nicvf_get_rss_size()
329 mbx.rss_size.vf_id = nic->vf_id; in nicvf_get_rss_size()
330 nicvf_send_msg_to_pf(nic, &mbx); in nicvf_get_rss_size()
335 union nic_mbx mbx = {}; in nicvf_config_rss() local
340 mbx.rss_cfg.vf_id = nic->vf_id; in nicvf_config_rss()
341 mbx.rss_cfg.hash_bits = rss->hash_bits; in nicvf_config_rss()
343 mbx.rss_cfg.tbl_offset = nextq; in nicvf_config_rss()
344 mbx.rss_cfg.tbl_len = min(ind_tbl_len, in nicvf_config_rss()
346 mbx.rss_cfg.msg = mbx.rss_cfg.tbl_offset ? in nicvf_config_rss()
349 for (i = 0; i < mbx.rss_cfg.tbl_len; i++) in nicvf_config_rss()
350 mbx.rss_cfg.ind_tbl[i] = rss->ind_tbl[nextq++]; in nicvf_config_rss()
352 nicvf_send_msg_to_pf(nic, &mbx); in nicvf_config_rss()
354 ind_tbl_len -= mbx.rss_cfg.tbl_len; in nicvf_config_rss()
403 union nic_mbx mbx = {}; in nicvf_request_sqs() local
412 mbx.sqs_alloc.msg = NIC_MBOX_MSG_ALLOC_SQS; in nicvf_request_sqs()
413 mbx.sqs_alloc.vf_id = nic->vf_id; in nicvf_request_sqs()
414 mbx.sqs_alloc.qs_count = nic->sqs_count; in nicvf_request_sqs()
415 if (nicvf_send_msg_to_pf(nic, &mbx)) { in nicvf_request_sqs()
434 mbx.nicvf.msg = NIC_MBOX_MSG_SNICVF_PTR; in nicvf_request_sqs()
435 mbx.nicvf.vf_id = nic->vf_id; in nicvf_request_sqs()
436 mbx.nicvf.sqs_id = sqs; in nicvf_request_sqs()
437 nicvf_send_msg_to_pf(nic, &mbx); in nicvf_request_sqs()
475 union nic_mbx mbx = {}; in nicvf_send_vf_struct() local
477 mbx.nicvf.msg = NIC_MBOX_MSG_NICVF_PTR; in nicvf_send_vf_struct()
478 mbx.nicvf.sqs_mode = nic->sqs_mode; in nicvf_send_vf_struct()
479 mbx.nicvf.nicvf = (u64)nic; in nicvf_send_vf_struct()
480 nicvf_send_msg_to_pf(nic, &mbx); in nicvf_send_vf_struct()
485 union nic_mbx mbx = {}; in nicvf_get_primary_vf_struct() local
487 mbx.nicvf.msg = NIC_MBOX_MSG_PNICVF_PTR; in nicvf_get_primary_vf_struct()
488 nicvf_send_msg_to_pf(nic, &mbx); in nicvf_get_primary_vf_struct()
1330 union nic_mbx mbx = {}; in nicvf_stop() local
1338 mbx.msg.msg = NIC_MBOX_MSG_SHUTDOWN; in nicvf_stop()
1339 nicvf_send_msg_to_pf(nic, &mbx); in nicvf_stop()
1418 union nic_mbx mbx = {}; in nicvf_config_hw_rx_tstamp() local
1420 mbx.ptp.msg = NIC_MBOX_MSG_PTP_CFG; in nicvf_config_hw_rx_tstamp()
1421 mbx.ptp.enable = enable; in nicvf_config_hw_rx_tstamp()
1423 return nicvf_send_msg_to_pf(nic, &mbx); in nicvf_config_hw_rx_tstamp()
1428 union nic_mbx mbx = {}; in nicvf_update_hw_max_frs() local
1430 mbx.frs.msg = NIC_MBOX_MSG_SET_MAX_FRS; in nicvf_update_hw_max_frs()
1431 mbx.frs.max_frs = mtu; in nicvf_update_hw_max_frs()
1432 mbx.frs.vf_id = nic->vf_id; in nicvf_update_hw_max_frs()
1434 return nicvf_send_msg_to_pf(nic, &mbx); in nicvf_update_hw_max_frs()
1442 union nic_mbx mbx = {}; in nicvf_link_status_check_task() local
1443 mbx.msg.msg = NIC_MBOX_MSG_BGX_LINK_CHANGE; in nicvf_link_status_check_task()
1444 nicvf_send_msg_to_pf(nic, &mbx); in nicvf_link_status_check_task()
1628 union nic_mbx mbx = {}; in nicvf_update_lmac_stats() local
1633 mbx.bgx_stats.msg = NIC_MBOX_MSG_BGX_STATS; in nicvf_update_lmac_stats()
1634 mbx.bgx_stats.vf_id = nic->vf_id; in nicvf_update_lmac_stats()
1636 mbx.bgx_stats.rx = 1; in nicvf_update_lmac_stats()
1638 mbx.bgx_stats.idx = stat; in nicvf_update_lmac_stats()
1639 if (nicvf_send_msg_to_pf(nic, &mbx)) in nicvf_update_lmac_stats()
1647 mbx.bgx_stats.rx = 0; in nicvf_update_lmac_stats()
1649 mbx.bgx_stats.idx = stat; in nicvf_update_lmac_stats()
1650 if (nicvf_send_msg_to_pf(nic, &mbx)) in nicvf_update_lmac_stats()
1765 union nic_mbx mbx = {}; in nicvf_config_loopback() local
1767 mbx.lbk.msg = NIC_MBOX_MSG_LOOPBACK; in nicvf_config_loopback()
1768 mbx.lbk.vf_id = nic->vf_id; in nicvf_config_loopback()
1769 mbx.lbk.enable = (features & NETIF_F_LOOPBACK) != 0; in nicvf_config_loopback()
1771 return nicvf_send_msg_to_pf(nic, &mbx); in nicvf_config_loopback()
1974 union nic_mbx mbx = {}; in __nicvf_set_rx_mode_task() local
1984 mbx.xcast.msg = NIC_MBOX_MSG_RESET_XCAST; in __nicvf_set_rx_mode_task()
1985 if (nicvf_send_msg_to_pf(nic, &mbx) < 0) in __nicvf_set_rx_mode_task()
1992 mbx.xcast.msg = NIC_MBOX_MSG_ADD_MCAST; in __nicvf_set_rx_mode_task()
1993 mbx.xcast.mac = 0; in __nicvf_set_rx_mode_task()
1994 if (nicvf_send_msg_to_pf(nic, &mbx) < 0) in __nicvf_set_rx_mode_task()
2002 mbx.xcast.msg = NIC_MBOX_MSG_ADD_MCAST; in __nicvf_set_rx_mode_task()
2003 mbx.xcast.mac = mc_addrs->mc[idx]; in __nicvf_set_rx_mode_task()
2004 if (nicvf_send_msg_to_pf(nic, &mbx) < 0) in __nicvf_set_rx_mode_task()
2010 mbx.xcast.msg = NIC_MBOX_MSG_SET_XCAST; in __nicvf_set_rx_mode_task()
2011 mbx.xcast.mode = mode; in __nicvf_set_rx_mode_task()
2013 nicvf_send_msg_to_pf(nic, &mbx); in __nicvf_set_rx_mode_task()