guest.c (14baf4d9c739e6e69150512d2eb23c71fffcc192) guest.c (4752876c71701b7663a5ded789058ab2c05f7d0f)
1/*
2 * Copyright 2015 IBM Corp.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 */

--- 582 unchanged lines hidden (view full) ---

591 return rc;
592}
593
594static int guest_afu_check_and_enable(struct cxl_afu *afu)
595{
596 return 0;
597}
598
1/*
2 * Copyright 2015 IBM Corp.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 */

--- 582 unchanged lines hidden (view full) ---

591 return rc;
592}
593
594static int guest_afu_check_and_enable(struct cxl_afu *afu)
595{
596 return 0;
597}
598
599static bool guest_support_attributes(const char *attr_name,
600 enum cxl_attrs type)
601{
602 switch (type) {
603 case CXL_ADAPTER_ATTRS:
604 if ((strcmp(attr_name, "base_image") == 0) ||
605 (strcmp(attr_name, "load_image_on_perst") == 0) ||
606 (strcmp(attr_name, "perst_reloads_same_image") == 0) ||
607 (strcmp(attr_name, "image_loaded") == 0))
608 return false;
609 break;
610 case CXL_AFU_MASTER_ATTRS:
611 if ((strcmp(attr_name, "pp_mmio_off") == 0))
612 return false;
613 break;
614 case CXL_AFU_ATTRS:
615 break;
616 default:
617 break;
618 }
619
620 return true;
621}
622
599static int activate_afu_directed(struct cxl_afu *afu)
600{
601 int rc;
602
603 dev_info(&afu->dev, "Activating AFU(%d) directed mode\n", afu->slice);
604
605 afu->current_mode = CXL_MODE_DIRECTED;
606

--- 324 unchanged lines hidden (view full) ---

931 .alloc_irq_ranges = guest_alloc_irq_ranges,
932 .release_irq_ranges = guest_release_irq_ranges,
933 .setup_irq = NULL,
934 .handle_psl_slice_error = guest_handle_psl_slice_error,
935 .psl_interrupt = guest_psl_irq,
936 .ack_irq = guest_ack_irq,
937 .attach_process = guest_attach_process,
938 .detach_process = guest_detach_process,
623static int activate_afu_directed(struct cxl_afu *afu)
624{
625 int rc;
626
627 dev_info(&afu->dev, "Activating AFU(%d) directed mode\n", afu->slice);
628
629 afu->current_mode = CXL_MODE_DIRECTED;
630

--- 324 unchanged lines hidden (view full) ---

955 .alloc_irq_ranges = guest_alloc_irq_ranges,
956 .release_irq_ranges = guest_release_irq_ranges,
957 .setup_irq = NULL,
958 .handle_psl_slice_error = guest_handle_psl_slice_error,
959 .psl_interrupt = guest_psl_irq,
960 .ack_irq = guest_ack_irq,
961 .attach_process = guest_attach_process,
962 .detach_process = guest_detach_process,
963 .support_attributes = guest_support_attributes,
939 .link_ok = guest_link_ok,
940 .release_afu = guest_release_afu,
941 .afu_read_err_buffer = guest_afu_read_err_buffer,
942 .afu_check_and_enable = guest_afu_check_and_enable,
943 .afu_activate_mode = guest_afu_activate_mode,
944 .afu_deactivate_mode = guest_afu_deactivate_mode,
945 .afu_reset = guest_afu_reset,
946 .afu_cr_read8 = guest_afu_cr_read8,
947 .afu_cr_read16 = guest_afu_cr_read16,
948 .afu_cr_read32 = guest_afu_cr_read32,
949 .afu_cr_read64 = guest_afu_cr_read64,
950};
964 .link_ok = guest_link_ok,
965 .release_afu = guest_release_afu,
966 .afu_read_err_buffer = guest_afu_read_err_buffer,
967 .afu_check_and_enable = guest_afu_check_and_enable,
968 .afu_activate_mode = guest_afu_activate_mode,
969 .afu_deactivate_mode = guest_afu_deactivate_mode,
970 .afu_reset = guest_afu_reset,
971 .afu_cr_read8 = guest_afu_cr_read8,
972 .afu_cr_read16 = guest_afu_cr_read16,
973 .afu_cr_read32 = guest_afu_cr_read32,
974 .afu_cr_read64 = guest_afu_cr_read64,
975};