Lines Matching full:bmc
39 bool bmc; member
54 struct astlpc_endpoint bmc; member
78 uint8_t flag = mmio->bmc ? KCS_STATUS_IBF : KCS_STATUS_OBF; in mctp_astlpc_mmio_kcs_read()
96 uint8_t flag = mmio->bmc ? KCS_STATUS_OBF : KCS_STATUS_IBF; in mctp_astlpc_mmio_kcs_write()
179 ep->mmio.bmc = (mode == MCTP_BINDING_ASTLPC_MODE_BMC); in endpoint_init()
208 /* BMC initialisation */ in network_init()
209 rc = endpoint_init(&ctx->bmc, 8, MCTP_BINDING_ASTLPC_MODE_BMC, MCTP_BTU, in network_init()
219 /* BMC processes host channel init request, alerts host */ in network_init()
220 mctp_astlpc_poll(ctx->bmc.astlpc); in network_init()
231 endpoint_destroy(&ctx->bmc); in network_destroy()
261 /* BMC sends a message */ in astlpc_test_packetised_message_bmc_to_host()
262 rc = mctp_message_tx(ctx.bmc.mctp, 9, MCTP_MESSAGE_TO_SRC, 0, msg, in astlpc_test_packetised_message_bmc_to_host()
269 /* BMC dequeues ownership hand-over and sends the queued packet */ in astlpc_test_packetised_message_bmc_to_host()
270 rc = mctp_astlpc_poll(ctx.bmc.astlpc); in astlpc_test_packetised_message_bmc_to_host()
277 astlpc_assert_tx_packet(&ctx.bmc, &msg[MCTP_BTU], MCTP_BTU); in astlpc_test_packetised_message_bmc_to_host()
301 mctp_set_rx_all(ctx.bmc.mctp, astlpc_test_rx_message, &ctx); in astlpc_test_simple_message_host_to_bmc()
312 /* BMC receives the single-packet message */ in astlpc_test_simple_message_host_to_bmc()
313 mctp_astlpc_poll(ctx.bmc.astlpc); in astlpc_test_simple_message_host_to_bmc()
316 /* BMC returns Tx area ownership to Host */ in astlpc_test_simple_message_host_to_bmc()
345 /* BMC sends the single-packet message */ in astlpc_test_simple_message_bmc_to_host()
346 rc = mctp_message_tx(ctx.bmc.mctp, 9, MCTP_MESSAGE_TO_SRC, tag, msg, in astlpc_test_simple_message_bmc_to_host()
352 astlpc_assert_tx_packet(&ctx.bmc, &msg[0], MCTP_BTU); in astlpc_test_simple_message_bmc_to_host()
358 /* Host returns Rx area ownership to BMC */ in astlpc_test_simple_message_bmc_to_host()
363 /* BMC dequeues ownership hand-over and sends the queued packet */ in astlpc_test_simple_message_bmc_to_host()
364 rc = mctp_astlpc_poll(ctx.bmc.astlpc); in astlpc_test_simple_message_bmc_to_host()
391 /* Start-up should fail as we haven't initialised the BMC */ in astlpc_test_host_before_bmc()
442 struct astlpc_endpoint bmc, host; in astlpc_test_version_host_fails_negotiation() local
452 /* BMC initialisation */ in astlpc_test_version_host_fails_negotiation()
453 rc = endpoint_init(&bmc, 8, MCTP_BINDING_ASTLPC_MODE_BMC, MCTP_BTU, in astlpc_test_version_host_fails_negotiation()
457 /* Now the BMC is initialised, break its version announcement */ in astlpc_test_version_host_fails_negotiation()
466 endpoint_destroy(&bmc); in astlpc_test_version_host_fails_negotiation()
473 struct astlpc_endpoint bmc, host; in astlpc_test_version_bmc_fails_negotiation() local
483 /* BMC initialisation */ in astlpc_test_version_bmc_fails_negotiation()
484 rc = endpoint_init(&bmc, 8, MCTP_BINDING_ASTLPC_MODE_BMC, MCTP_BTU, in astlpc_test_version_bmc_fails_negotiation()
497 /* Poll the BMC to detect the broken host version */ in astlpc_test_version_bmc_fails_negotiation()
498 mctp_astlpc_poll(bmc.astlpc); in astlpc_test_version_bmc_fails_negotiation()
505 endpoint_destroy(&bmc); in astlpc_test_version_bmc_fails_negotiation()
512 struct astlpc_endpoint bmc, host; in astlpc_test_simple_init() local
521 /* BMC initialisation */ in astlpc_test_simple_init()
522 rc = endpoint_init(&bmc, 8, MCTP_BINDING_ASTLPC_MODE_BMC, MCTP_BTU, in astlpc_test_simple_init()
526 /* Verify the BMC binding was initialised */ in astlpc_test_simple_init()
538 /* BMC receives host channel init request */ in astlpc_test_simple_init()
539 mctp_astlpc_poll(bmc.astlpc); in astlpc_test_simple_init()
541 /* BMC sends init response */ in astlpc_test_simple_init()
549 endpoint_destroy(&bmc); in astlpc_test_simple_init()
570 /* BMC initialisation */ in astlpc_test_simple_indirect_message_bmc_to_host()
571 ctx.bmc.mmio.bmc = true; in astlpc_test_simple_indirect_message_bmc_to_host()
572 ctx.bmc.mctp = mctp_init(); in astlpc_test_simple_indirect_message_bmc_to_host()
573 assert(ctx.bmc.mctp); in astlpc_test_simple_indirect_message_bmc_to_host()
574 ctx.bmc.mmio.kcs = &kcs; in astlpc_test_simple_indirect_message_bmc_to_host()
575 ctx.bmc.mmio.lpc = ctx.lpc_mem; in astlpc_test_simple_indirect_message_bmc_to_host()
576 ctx.bmc.mmio.lpc_size = LPC_WIN_SIZE; in astlpc_test_simple_indirect_message_bmc_to_host()
577 ctx.bmc.astlpc = in astlpc_test_simple_indirect_message_bmc_to_host()
579 &astlpc_indirect_mmio_ops, &ctx.bmc.mmio); in astlpc_test_simple_indirect_message_bmc_to_host()
580 mctp_register_bus(ctx.bmc.mctp, &ctx.bmc.astlpc->binding, 8); in astlpc_test_simple_indirect_message_bmc_to_host()
583 ctx.host.mmio.bmc = false; in astlpc_test_simple_indirect_message_bmc_to_host()
594 /* BMC processes host channel init request, alerts host */ in astlpc_test_simple_indirect_message_bmc_to_host()
595 mctp_astlpc_poll(ctx.bmc.astlpc); in astlpc_test_simple_indirect_message_bmc_to_host()
604 /* BMC sends the single-packet message */ in astlpc_test_simple_indirect_message_bmc_to_host()
605 rc = mctp_message_tx(ctx.bmc.mctp, 9, MCTP_MESSAGE_TO_SRC, tag, msg, in astlpc_test_simple_indirect_message_bmc_to_host()
614 /* BMC dequeues ownership hand-over and sends the queued packet */ in astlpc_test_simple_indirect_message_bmc_to_host()
615 rc = mctp_astlpc_poll(ctx.bmc.astlpc); in astlpc_test_simple_indirect_message_bmc_to_host()
640 /* Clear bmc-ready */ in astlpc_test_host_tx_bmc_gone()
641 endpoint_destroy(&ctx.bmc); in astlpc_test_host_tx_bmc_gone()
643 /* Host detects that the BMC is disabled */ in astlpc_test_host_tx_bmc_gone()
653 /* BMC comes back */ in astlpc_test_host_tx_bmc_gone()
654 rc = endpoint_init(&ctx.bmc, 8, MCTP_BINDING_ASTLPC_MODE_BMC, MCTP_BTU, in astlpc_test_host_tx_bmc_gone()
657 mctp_set_rx_all(ctx.bmc.mctp, astlpc_test_rx_message, &ctx); in astlpc_test_host_tx_bmc_gone()
662 /* BMC handles channel init */ in astlpc_test_host_tx_bmc_gone()
663 mctp_astlpc_poll(ctx.bmc.astlpc); in astlpc_test_host_tx_bmc_gone()
668 /* BMC receives the single-packet message */ in astlpc_test_host_tx_bmc_gone()
669 mctp_astlpc_poll(ctx.bmc.astlpc); in astlpc_test_host_tx_bmc_gone()
677 struct astlpc_endpoint bmc; in astlpc_test_poll_not_ready() local
686 /* BMC initialisation */ in astlpc_test_poll_not_ready()
687 rc = endpoint_init(&bmc, 8, MCTP_BINDING_ASTLPC_MODE_BMC, MCTP_BTU, in astlpc_test_poll_not_ready()
692 rc = mctp_astlpc_poll(bmc.astlpc); in astlpc_test_poll_not_ready()
697 endpoint_destroy(&bmc); in astlpc_test_poll_not_ready()
703 struct astlpc_endpoint bmc; in astlpc_test_undefined_command() local
712 /* BMC initialisation */ in astlpc_test_undefined_command()
713 rc = endpoint_init(&bmc, 8, MCTP_BINDING_ASTLPC_MODE_BMC, MCTP_BTU, in astlpc_test_undefined_command()
722 rc = mctp_astlpc_poll(bmc.astlpc); in astlpc_test_undefined_command()
727 endpoint_destroy(&bmc); in astlpc_test_undefined_command()
858 struct astlpc_endpoint bmc, host; in astlpc_test_buffers_bad_host_proposal() local
868 /* BMC initialisation */ in astlpc_test_buffers_bad_host_proposal()
869 rc = endpoint_init(&bmc, 8, MCTP_BINDING_ASTLPC_MODE_BMC, MCTP_BTU, in astlpc_test_buffers_bad_host_proposal()
880 * something before polling the BMC in astlpc_test_buffers_bad_host_proposal()
885 mctp_astlpc_poll(bmc.astlpc); in astlpc_test_buffers_bad_host_proposal()
887 /* Make sure the BMC has not set the channel to active */ in astlpc_test_buffers_bad_host_proposal()
891 endpoint_destroy(&bmc); in astlpc_test_buffers_bad_host_proposal()
897 struct astlpc_endpoint bmc, host; in astlpc_test_buffers_bad_bmc_proposal() local
907 /* BMC initialisation */ in astlpc_test_buffers_bad_bmc_proposal()
908 rc = endpoint_init(&bmc, 8, MCTP_BINDING_ASTLPC_MODE_BMC, MCTP_BTU, in astlpc_test_buffers_bad_bmc_proposal()
913 * Now that the BMC has initialised the control area, break something in astlpc_test_buffers_bad_bmc_proposal()
925 endpoint_destroy(&bmc); in astlpc_test_buffers_bad_bmc_proposal()
931 struct astlpc_endpoint bmc, host; in astlpc_test_buffers_bad_bmc_negotiation() local
941 /* BMC initialisation */ in astlpc_test_buffers_bad_bmc_negotiation()
942 rc = endpoint_init(&bmc, 8, MCTP_BINDING_ASTLPC_MODE_BMC, MCTP_BTU, in astlpc_test_buffers_bad_bmc_negotiation()
951 mctp_astlpc_poll(bmc.astlpc); in astlpc_test_buffers_bad_bmc_negotiation()
954 * Now that the BMC has initialised the control area, break something in astlpc_test_buffers_bad_bmc_negotiation()
964 endpoint_destroy(&bmc); in astlpc_test_buffers_bad_bmc_negotiation()
982 host.mmio.bmc = false; in astlpc_test_buffers_bad_host_init()
999 struct astlpc_endpoint bmc, host; in astlpc_test_negotiate_increased_mtu() local
1008 /* BMC initialisation */ in astlpc_test_negotiate_increased_mtu()
1009 rc = endpoint_init(&bmc, 8, MCTP_BINDING_ASTLPC_MODE_BMC, 3 * MCTP_BTU, in astlpc_test_negotiate_increased_mtu()
1018 rc = mctp_astlpc_poll(bmc.astlpc); in astlpc_test_negotiate_increased_mtu()
1025 endpoint_destroy(&bmc); in astlpc_test_negotiate_increased_mtu()
1031 struct astlpc_endpoint bmc, host; in astlpc_test_negotiate_mtu_low_high() local
1041 /* BMC initialisation */ in astlpc_test_negotiate_mtu_low_high()
1043 rc = endpoint_init(&bmc, 8, MCTP_BINDING_ASTLPC_MODE_BMC, bmtu, &kcs, in astlpc_test_negotiate_mtu_low_high()
1054 rc = mctp_astlpc_poll(bmc.astlpc); in astlpc_test_negotiate_mtu_low_high()
1077 rc = mctp_astlpc_poll(bmc.astlpc); in astlpc_test_negotiate_mtu_low_high()
1088 endpoint_destroy(&bmc); in astlpc_test_negotiate_mtu_low_high()
1094 struct astlpc_endpoint *bmc, *host; in astlpc_test_send_large_packet() local
1102 bmc = &ctx.bmc; in astlpc_test_send_large_packet()
1108 /* BMC initialisation */ in astlpc_test_send_large_packet()
1109 rc = endpoint_init(bmc, 8, MCTP_BINDING_ASTLPC_MODE_BMC, 8192, &kcs, in astlpc_test_send_large_packet()
1119 mctp_set_rx_all(bmc->mctp, astlpc_test_rx_message, &ctx); in astlpc_test_send_large_packet()
1121 rc = mctp_astlpc_poll(bmc->astlpc); in astlpc_test_send_large_packet()
1135 rc = mctp_astlpc_poll(bmc->astlpc); in astlpc_test_send_large_packet()
1139 rc = mctp_astlpc_poll(bmc->astlpc); in astlpc_test_send_large_packet()
1148 endpoint_destroy(bmc); in astlpc_test_send_large_packet()
1167 /* BMC initialisation */ in astlpc_test_negotiate_mtu_high_low()
1169 rc = endpoint_init(&ctx.bmc, 8, MCTP_BINDING_ASTLPC_MODE_BMC, bmtu, in astlpc_test_negotiate_mtu_high_low()
1184 /* Startup BMC and host interfaces */ in astlpc_test_negotiate_mtu_high_low()
1185 rc = mctp_astlpc_poll(ctx.bmc.astlpc); in astlpc_test_negotiate_mtu_high_low()
1190 rc = mctp_message_tx(ctx.bmc.mctp, 9, MCTP_MESSAGE_TO_DST, tag, msg, in astlpc_test_negotiate_mtu_high_low()
1192 rc = mctp_astlpc_poll(ctx.bmc.astlpc); in astlpc_test_negotiate_mtu_high_low()
1214 rc = mctp_astlpc_poll(ctx.bmc.astlpc); in astlpc_test_negotiate_mtu_high_low()
1221 rc = mctp_message_tx(ctx.bmc.mctp, 9, MCTP_MESSAGE_TO_DST, tag, msg, in astlpc_test_negotiate_mtu_high_low()
1223 while (!mctp_astlpc_tx_done(ctx.bmc.astlpc)) { in astlpc_test_negotiate_mtu_high_low()
1224 rc = mctp_astlpc_poll(ctx.bmc.astlpc); in astlpc_test_negotiate_mtu_high_low()
1232 /* Ensure buffer ownership is returned to the BMC and the BMC Tx queue is processed */ in astlpc_test_negotiate_mtu_high_low()
1233 rc = mctp_astlpc_poll(ctx.bmc.astlpc); in astlpc_test_negotiate_mtu_high_low()
1242 endpoint_destroy(&ctx.bmc); in astlpc_test_negotiate_mtu_high_low()
1248 struct astlpc_endpoint *bmc; in astlpc_test_tx_before_channel_init() local
1256 bmc = &ctx.bmc; in astlpc_test_tx_before_channel_init()
1262 /* BMC initialisation */ in astlpc_test_tx_before_channel_init()
1263 rc = endpoint_init(bmc, 8, MCTP_BINDING_ASTLPC_MODE_BMC, 0, &kcs, in astlpc_test_tx_before_channel_init()
1276 mctp_message_tx(bmc->mctp, 9, MCTP_MESSAGE_TO_SRC, tag, msg, in astlpc_test_tx_before_channel_init()
1280 endpoint_destroy(bmc); in astlpc_test_tx_before_channel_init()
1303 mctp_set_rx_all(ctx.bmc.mctp, astlpc_test_rx_message, &ctx); in astlpc_test_corrupt_host_tx()
1322 /* BMC receives the single-packet message */ in astlpc_test_corrupt_host_tx()
1323 mctp_astlpc_poll(ctx.bmc.astlpc); in astlpc_test_corrupt_host_tx()
1326 /* BMC returns Tx area ownership to Host */ in astlpc_test_corrupt_host_tx()
1359 /* BMC sends the single-packet message */ in astlpc_test_corrupt_bmc_tx()
1360 rc = mctp_message_tx(ctx.bmc.mctp, 9, MCTP_MESSAGE_TO_SRC, tag, msg, in astlpc_test_corrupt_bmc_tx()
1366 /* Check that the BMC sent a fully-formed packet */ in astlpc_test_corrupt_bmc_tx()
1367 astlpc_assert_tx_packet(&ctx.bmc, &msg[0], MCTP_BTU); in astlpc_test_corrupt_bmc_tx()
1381 /* Host returns Rx area ownership to BMC */ in astlpc_test_corrupt_bmc_tx()
1386 /* BMC dequeues ownership hand-over */ in astlpc_test_corrupt_bmc_tx()
1387 rc = mctp_astlpc_poll(ctx.bmc.astlpc); in astlpc_test_corrupt_bmc_tx()
1405 * Fill the KCS transmit buffer by sending a message from the BMC to the host without in astlpc_test_async_exchange()
1408 mctp_message_tx(ctx.bmc.mctp, 9, MCTP_MESSAGE_TO_SRC, tag, msg, in astlpc_test_async_exchange()
1412 * Assert that we're still listening for in-bound messages on the BMC in astlpc_test_async_exchange()
1414 mctp_astlpc_init_pollfd(ctx.bmc.astlpc, &pollfd); in astlpc_test_async_exchange()
1419 * Send a message from the host to the BMC and dequeue the message on the BMC, triggering a in astlpc_test_async_exchange()
1424 mctp_astlpc_poll(ctx.bmc.astlpc); in astlpc_test_async_exchange()
1427 * Assert that the BMC has to wait for the host to dequeue the ownership transfer command in astlpc_test_async_exchange()
1430 mctp_astlpc_init_pollfd(ctx.bmc.astlpc, &pollfd); in astlpc_test_async_exchange()
1441 * Emulate a POLLOUT event on the BMC side in astlpc_test_async_exchange()
1443 mctp_astlpc_poll(ctx.bmc.astlpc); in astlpc_test_async_exchange()
1446 * Assert that we're again listening for in-bound messages on the BMC. in astlpc_test_async_exchange()
1448 mctp_astlpc_init_pollfd(ctx.bmc.astlpc, &pollfd); in astlpc_test_async_exchange()