gasket_dev 247 drivers/staging/gasket/apex_driver.c static int apex_get_status(struct gasket_dev *gasket_dev) gasket_dev 254 drivers/staging/gasket/apex_driver.c static int apex_enter_reset(struct gasket_dev *gasket_dev) gasket_dev 265 drivers/staging/gasket/apex_driver.c gasket_read_modify_write_64(gasket_dev, APEX_BAR_INDEX, gasket_dev 270 drivers/staging/gasket/apex_driver.c gasket_dev_write_64(gasket_dev, 1, APEX_BAR_INDEX, gasket_dev 274 drivers/staging/gasket/apex_driver.c if (gasket_wait_with_reschedule(gasket_dev, APEX_BAR_INDEX, gasket_dev 277 drivers/staging/gasket/apex_driver.c dev_err(gasket_dev->dev, gasket_dev 284 drivers/staging/gasket/apex_driver.c gasket_read_modify_write_32(gasket_dev, APEX_BAR_INDEX, gasket_dev 288 drivers/staging/gasket/apex_driver.c gasket_read_modify_write_32(gasket_dev, APEX_BAR_INDEX, gasket_dev 292 drivers/staging/gasket/apex_driver.c gasket_read_modify_write_32(gasket_dev, APEX_BAR_INDEX, gasket_dev 296 drivers/staging/gasket/apex_driver.c if (gasket_wait_with_reschedule(gasket_dev, APEX_BAR_INDEX, gasket_dev 299 drivers/staging/gasket/apex_driver.c dev_err(gasket_dev->dev, gasket_dev 309 drivers/staging/gasket/apex_driver.c static int apex_quit_reset(struct gasket_dev *gasket_dev) gasket_dev 322 drivers/staging/gasket/apex_driver.c gasket_read_modify_write_32(gasket_dev, APEX_BAR_INDEX, gasket_dev 330 drivers/staging/gasket/apex_driver.c gasket_read_modify_write_32(gasket_dev, APEX_BAR_INDEX, gasket_dev 338 drivers/staging/gasket/apex_driver.c gasket_read_modify_write_32(gasket_dev, APEX_BAR_INDEX, gasket_dev 342 drivers/staging/gasket/apex_driver.c if (gasket_wait_with_reschedule(gasket_dev, APEX_BAR_INDEX, gasket_dev 345 drivers/staging/gasket/apex_driver.c dev_err(gasket_dev->dev, gasket_dev 352 drivers/staging/gasket/apex_driver.c if (gasket_wait_with_reschedule(gasket_dev, APEX_BAR_INDEX, gasket_dev 356 drivers/staging/gasket/apex_driver.c dev_err(gasket_dev->dev, gasket_dev 363 drivers/staging/gasket/apex_driver.c val0 = gasket_dev_read_32(gasket_dev, APEX_BAR_INDEX, gasket_dev 366 drivers/staging/gasket/apex_driver.c gasket_read_modify_write_32(gasket_dev, gasket_dev 371 drivers/staging/gasket/apex_driver.c val1 = gasket_dev_read_32(gasket_dev, APEX_BAR_INDEX, gasket_dev 373 drivers/staging/gasket/apex_driver.c dev_dbg(gasket_dev->dev, gasket_dev 376 drivers/staging/gasket/apex_driver.c val0 = gasket_dev_read_32(gasket_dev, APEX_BAR_INDEX, gasket_dev 379 drivers/staging/gasket/apex_driver.c gasket_read_modify_write_32(gasket_dev, APEX_BAR_INDEX, gasket_dev 383 drivers/staging/gasket/apex_driver.c val1 = gasket_dev_read_32(gasket_dev, APEX_BAR_INDEX, gasket_dev 385 drivers/staging/gasket/apex_driver.c dev_dbg(gasket_dev->dev, "Allow HW clock gating 0x%x -> 0x%x\n", gasket_dev 393 drivers/staging/gasket/apex_driver.c static int apex_device_cleanup(struct gasket_dev *gasket_dev) gasket_dev 399 drivers/staging/gasket/apex_driver.c hib_error = gasket_dev_read_64(gasket_dev, APEX_BAR_INDEX, gasket_dev 401 drivers/staging/gasket/apex_driver.c scalar_error = gasket_dev_read_64(gasket_dev, APEX_BAR_INDEX, gasket_dev 404 drivers/staging/gasket/apex_driver.c dev_dbg(gasket_dev->dev, gasket_dev 406 drivers/staging/gasket/apex_driver.c __func__, gasket_dev, hib_error, scalar_error); gasket_dev 409 drivers/staging/gasket/apex_driver.c ret = apex_enter_reset(gasket_dev); gasket_dev 415 drivers/staging/gasket/apex_driver.c static bool is_gcb_in_reset(struct gasket_dev *gasket_dev) gasket_dev 417 drivers/staging/gasket/apex_driver.c u32 val = gasket_dev_read_32(gasket_dev, APEX_BAR_INDEX, gasket_dev 425 drivers/staging/gasket/apex_driver.c static int apex_reset(struct gasket_dev *gasket_dev) gasket_dev 432 drivers/staging/gasket/apex_driver.c if (!is_gcb_in_reset(gasket_dev)) { gasket_dev 436 drivers/staging/gasket/apex_driver.c dev_dbg(gasket_dev->dev, "%s: toggle reset\n", __func__); gasket_dev 438 drivers/staging/gasket/apex_driver.c ret = apex_enter_reset(gasket_dev); gasket_dev 442 drivers/staging/gasket/apex_driver.c return apex_quit_reset(gasket_dev); gasket_dev 455 drivers/staging/gasket/apex_driver.c static long apex_clock_gating(struct gasket_dev *gasket_dev, gasket_dev 466 drivers/staging/gasket/apex_driver.c dev_dbg(gasket_dev->dev, "%s %llu\n", __func__, ibuf.enable); gasket_dev 470 drivers/staging/gasket/apex_driver.c gasket_read_modify_write_32(gasket_dev, APEX_BAR_INDEX, gasket_dev 473 drivers/staging/gasket/apex_driver.c gasket_read_modify_write_32(gasket_dev, APEX_BAR_INDEX, gasket_dev 478 drivers/staging/gasket/apex_driver.c gasket_read_modify_write_32(gasket_dev, APEX_BAR_INDEX, gasket_dev 481 drivers/staging/gasket/apex_driver.c gasket_read_modify_write_32(gasket_dev, APEX_BAR_INDEX, gasket_dev 491 drivers/staging/gasket/apex_driver.c struct gasket_dev *gasket_dev = filp->private_data; gasket_dev 498 drivers/staging/gasket/apex_driver.c return apex_clock_gating(gasket_dev, argp); gasket_dev 509 drivers/staging/gasket/apex_driver.c struct gasket_dev *gasket_dev; gasket_dev 515 drivers/staging/gasket/apex_driver.c gasket_dev = gasket_sysfs_get_device_data(device); gasket_dev 516 drivers/staging/gasket/apex_driver.c if (!gasket_dev) { gasket_dev 524 drivers/staging/gasket/apex_driver.c gasket_sysfs_put_device_data(device, gasket_dev); gasket_dev 529 drivers/staging/gasket/apex_driver.c gpt = gasket_dev->page_table[0]; gasket_dev 541 drivers/staging/gasket/apex_driver.c dev_dbg(gasket_dev->dev, "Unknown attribute: %s\n", gasket_dev 549 drivers/staging/gasket/apex_driver.c gasket_sysfs_put_device_data(device, gasket_dev); gasket_dev 564 drivers/staging/gasket/apex_driver.c static int apex_device_open_cb(struct gasket_dev *gasket_dev) gasket_dev 566 drivers/staging/gasket/apex_driver.c return gasket_reset_nolock(gasket_dev); gasket_dev 579 drivers/staging/gasket/apex_driver.c struct gasket_dev *gasket_dev; gasket_dev 589 drivers/staging/gasket/apex_driver.c ret = gasket_pci_add_device(pci_dev, &gasket_dev); gasket_dev 596 drivers/staging/gasket/apex_driver.c pci_set_drvdata(pci_dev, gasket_dev); gasket_dev 597 drivers/staging/gasket/apex_driver.c apex_reset(gasket_dev); gasket_dev 601 drivers/staging/gasket/apex_driver.c gasket_dev_read_64(gasket_dev, APEX_BAR_INDEX, gasket_dev 604 drivers/staging/gasket/apex_driver.c gasket_dev_read_64(gasket_dev, APEX_BAR_INDEX, gasket_dev 614 drivers/staging/gasket/apex_driver.c dev_err(gasket_dev->dev, "Page table init timed out\n"); gasket_dev 616 drivers/staging/gasket/apex_driver.c dev_err(gasket_dev->dev, "MSI-X table init timed out\n"); gasket_dev 621 drivers/staging/gasket/apex_driver.c ret = gasket_sysfs_create_entries(gasket_dev->dev_info.device, gasket_dev 626 drivers/staging/gasket/apex_driver.c ret = gasket_enable_device(gasket_dev); gasket_dev 634 drivers/staging/gasket/apex_driver.c apex_enter_reset(gasket_dev); gasket_dev 646 drivers/staging/gasket/apex_driver.c struct gasket_dev *gasket_dev = pci_get_drvdata(pci_dev); gasket_dev 648 drivers/staging/gasket/apex_driver.c gasket_disable_device(gasket_dev); gasket_dev 55 drivers/staging/gasket/gasket_core.c struct gasket_dev *devs[GASKET_DEV_MAX]; gasket_dev 107 drivers/staging/gasket/gasket_core.c check_and_invoke_callback(struct gasket_dev *gasket_dev, gasket_dev 108 drivers/staging/gasket/gasket_core.c int (*cb_function)(struct gasket_dev *)) gasket_dev 113 drivers/staging/gasket/gasket_core.c mutex_lock(&gasket_dev->mutex); gasket_dev 114 drivers/staging/gasket/gasket_core.c ret = cb_function(gasket_dev); gasket_dev 115 drivers/staging/gasket/gasket_core.c mutex_unlock(&gasket_dev->mutex); gasket_dev 122 drivers/staging/gasket/gasket_core.c gasket_check_and_invoke_callback_nolock(struct gasket_dev *gasket_dev, gasket_dev 123 drivers/staging/gasket/gasket_core.c int (*cb_function)(struct gasket_dev *)) gasket_dev 128 drivers/staging/gasket/gasket_core.c ret = cb_function(gasket_dev); gasket_dev 187 drivers/staging/gasket/gasket_core.c struct device *parent, struct gasket_dev **pdev) gasket_dev 192 drivers/staging/gasket/gasket_core.c struct gasket_dev *gasket_dev; gasket_dev 204 drivers/staging/gasket/gasket_core.c gasket_dev = *pdev = kzalloc(sizeof(*gasket_dev), GFP_KERNEL); gasket_dev 205 drivers/staging/gasket/gasket_core.c if (!gasket_dev) { gasket_dev 209 drivers/staging/gasket/gasket_core.c internal_desc->devs[dev_idx] = gasket_dev; gasket_dev 211 drivers/staging/gasket/gasket_core.c mutex_init(&gasket_dev->mutex); gasket_dev 213 drivers/staging/gasket/gasket_core.c gasket_dev->internal_desc = internal_desc; gasket_dev 214 drivers/staging/gasket/gasket_core.c gasket_dev->dev_idx = dev_idx; gasket_dev 215 drivers/staging/gasket/gasket_core.c snprintf(gasket_dev->kobj_name, GASKET_NAME_MAX, "%s", parent_name); gasket_dev 216 drivers/staging/gasket/gasket_core.c gasket_dev->dev = get_device(parent); gasket_dev 218 drivers/staging/gasket/gasket_core.c gasket_dev->num_page_tables = driver_desc->num_page_tables; gasket_dev 223 drivers/staging/gasket/gasket_core.c dev_info = &gasket_dev->dev_info; gasket_dev 225 drivers/staging/gasket/gasket_core.c gasket_dev->dev_idx); gasket_dev 228 drivers/staging/gasket/gasket_core.c gasket_dev->dev_idx); gasket_dev 231 drivers/staging/gasket/gasket_core.c gasket_dev, dev_info->name); gasket_dev 234 drivers/staging/gasket/gasket_core.c dev_info->gasket_dev_ptr = gasket_dev; gasket_dev 241 drivers/staging/gasket/gasket_core.c static void gasket_free_dev(struct gasket_dev *gasket_dev) gasket_dev 243 drivers/staging/gasket/gasket_core.c struct gasket_internal_desc *internal_desc = gasket_dev->internal_desc; gasket_dev 246 drivers/staging/gasket/gasket_core.c internal_desc->devs[gasket_dev->dev_idx] = NULL; gasket_dev 248 drivers/staging/gasket/gasket_core.c put_device(gasket_dev->dev); gasket_dev 249 drivers/staging/gasket/gasket_core.c kfree(gasket_dev); gasket_dev 258 drivers/staging/gasket/gasket_core.c static int gasket_map_pci_bar(struct gasket_dev *gasket_dev, int bar_num) gasket_dev 260 drivers/staging/gasket/gasket_core.c struct gasket_internal_desc *internal_desc = gasket_dev->internal_desc; gasket_dev 278 drivers/staging/gasket/gasket_core.c gasket_dev->bar_data[bar_num].phys_base = gasket_dev 279 drivers/staging/gasket/gasket_core.c (ulong)pci_resource_start(gasket_dev->pci_dev, bar_num); gasket_dev 280 drivers/staging/gasket/gasket_core.c if (!gasket_dev->bar_data[bar_num].phys_base) { gasket_dev 281 drivers/staging/gasket/gasket_core.c dev_err(gasket_dev->dev, "Cannot get BAR%u base address\n", gasket_dev 286 drivers/staging/gasket/gasket_core.c gasket_dev->bar_data[bar_num].length_bytes = gasket_dev 287 drivers/staging/gasket/gasket_core.c (ulong)pci_resource_len(gasket_dev->pci_dev, bar_num); gasket_dev 288 drivers/staging/gasket/gasket_core.c if (gasket_dev->bar_data[bar_num].length_bytes < desc_bytes) { gasket_dev 289 drivers/staging/gasket/gasket_core.c dev_err(gasket_dev->dev, gasket_dev 291 drivers/staging/gasket/gasket_core.c bar_num, gasket_dev->bar_data[bar_num].length_bytes, gasket_dev 296 drivers/staging/gasket/gasket_core.c if (!request_mem_region(gasket_dev->bar_data[bar_num].phys_base, gasket_dev 297 drivers/staging/gasket/gasket_core.c gasket_dev->bar_data[bar_num].length_bytes, gasket_dev 298 drivers/staging/gasket/gasket_core.c gasket_dev->dev_info.name)) { gasket_dev 299 drivers/staging/gasket/gasket_core.c dev_err(gasket_dev->dev, gasket_dev 301 drivers/staging/gasket/gasket_core.c bar_num, &gasket_dev->pci_dev->resource[bar_num]); gasket_dev 305 drivers/staging/gasket/gasket_core.c gasket_dev->bar_data[bar_num].virt_base = gasket_dev 306 drivers/staging/gasket/gasket_core.c ioremap_nocache(gasket_dev->bar_data[bar_num].phys_base, gasket_dev 307 drivers/staging/gasket/gasket_core.c gasket_dev->bar_data[bar_num].length_bytes); gasket_dev 308 drivers/staging/gasket/gasket_core.c if (!gasket_dev->bar_data[bar_num].virt_base) { gasket_dev 309 drivers/staging/gasket/gasket_core.c dev_err(gasket_dev->dev, gasket_dev 311 drivers/staging/gasket/gasket_core.c bar_num, &gasket_dev->pci_dev->resource[bar_num]); gasket_dev 316 drivers/staging/gasket/gasket_core.c dma_set_mask(&gasket_dev->pci_dev->dev, DMA_BIT_MASK(64)); gasket_dev 317 drivers/staging/gasket/gasket_core.c dma_set_coherent_mask(&gasket_dev->pci_dev->dev, DMA_BIT_MASK(64)); gasket_dev 322 drivers/staging/gasket/gasket_core.c iounmap(gasket_dev->bar_data[bar_num].virt_base); gasket_dev 323 drivers/staging/gasket/gasket_core.c release_mem_region(gasket_dev->bar_data[bar_num].phys_base, gasket_dev 324 drivers/staging/gasket/gasket_core.c gasket_dev->bar_data[bar_num].length_bytes); gasket_dev 333 drivers/staging/gasket/gasket_core.c static void gasket_unmap_pci_bar(struct gasket_dev *dev, int bar_num) gasket_dev 370 drivers/staging/gasket/gasket_core.c struct gasket_dev *gasket_dev) gasket_dev 375 drivers/staging/gasket/gasket_core.c ret = gasket_map_pci_bar(gasket_dev, i); gasket_dev 386 drivers/staging/gasket/gasket_core.c gasket_unmap_pci_bar(gasket_dev, i); gasket_dev 392 drivers/staging/gasket/gasket_core.c static void gasket_cleanup_pci(struct gasket_dev *gasket_dev) gasket_dev 397 drivers/staging/gasket/gasket_core.c gasket_unmap_pci_bar(gasket_dev, i); gasket_dev 401 drivers/staging/gasket/gasket_core.c static int gasket_get_hw_status(struct gasket_dev *gasket_dev) gasket_dev 406 drivers/staging/gasket/gasket_core.c gasket_dev->internal_desc->driver_desc; gasket_dev 408 drivers/staging/gasket/gasket_core.c status = gasket_check_and_invoke_callback_nolock(gasket_dev, gasket_dev 411 drivers/staging/gasket/gasket_core.c dev_dbg(gasket_dev->dev, "Hardware reported status %d.\n", gasket_dev 416 drivers/staging/gasket/gasket_core.c status = gasket_interrupt_system_status(gasket_dev); gasket_dev 418 drivers/staging/gasket/gasket_core.c dev_dbg(gasket_dev->dev, gasket_dev 424 drivers/staging/gasket/gasket_core.c status = gasket_page_table_system_status(gasket_dev->page_table[i]); gasket_dev 426 drivers/staging/gasket/gasket_core.c dev_dbg(gasket_dev->dev, gasket_dev 472 drivers/staging/gasket/gasket_core.c struct gasket_dev *gasket_dev; gasket_dev 477 drivers/staging/gasket/gasket_core.c gasket_dev = gasket_sysfs_get_device_data(device); gasket_dev 478 drivers/staging/gasket/gasket_core.c if (!gasket_dev) { gasket_dev 486 drivers/staging/gasket/gasket_core.c gasket_sysfs_put_device_data(device, gasket_dev); gasket_dev 490 drivers/staging/gasket/gasket_core.c driver_desc = gasket_dev->internal_desc->driver_desc; gasket_dev 521 drivers/staging/gasket/gasket_core.c gasket_dev->internal_desc->driver_desc->driver_version); gasket_dev 529 drivers/staging/gasket/gasket_core.c gasket_dev->internal_desc->driver_desc->name); gasket_dev 533 drivers/staging/gasket/gasket_core.c gasket_dev->hardware_revision); gasket_dev 536 drivers/staging/gasket/gasket_core.c ret = snprintf(buf, PAGE_SIZE, "%s\n", gasket_dev->kobj_name); gasket_dev 540 drivers/staging/gasket/gasket_core.c gasket_num_name_lookup(gasket_dev->status, gasket_dev 545 drivers/staging/gasket/gasket_core.c gasket_dev->dev_info.ownership.is_owned); gasket_dev 549 drivers/staging/gasket/gasket_core.c gasket_dev->dev_info.ownership.owner); gasket_dev 553 drivers/staging/gasket/gasket_core.c gasket_dev->dev_info.ownership.write_open_count); gasket_dev 556 drivers/staging/gasket/gasket_core.c ret = snprintf(buf, PAGE_SIZE, "%d\n", gasket_dev->reset_count); gasket_dev 568 drivers/staging/gasket/gasket_core.c dev_dbg(gasket_dev->dev, "Unknown attribute: %s\n", gasket_dev 575 drivers/staging/gasket/gasket_core.c gasket_sysfs_put_device_data(device, gasket_dev); gasket_dev 625 drivers/staging/gasket/gasket_core.c void gasket_disable_device(struct gasket_dev *gasket_dev) gasket_dev 628 drivers/staging/gasket/gasket_core.c gasket_dev->internal_desc->driver_desc; gasket_dev 632 drivers/staging/gasket/gasket_core.c if (gasket_dev->dev_info.cdev_added) gasket_dev 633 drivers/staging/gasket/gasket_core.c cdev_del(&gasket_dev->dev_info.cdev); gasket_dev 635 drivers/staging/gasket/gasket_core.c gasket_dev->status = GASKET_STATUS_DEAD; gasket_dev 637 drivers/staging/gasket/gasket_core.c gasket_interrupt_cleanup(gasket_dev); gasket_dev 640 drivers/staging/gasket/gasket_core.c if (gasket_dev->page_table[i]) { gasket_dev 641 drivers/staging/gasket/gasket_core.c gasket_page_table_reset(gasket_dev->page_table[i]); gasket_dev 642 drivers/staging/gasket/gasket_core.c gasket_page_table_cleanup(gasket_dev->page_table[i]); gasket_dev 675 drivers/staging/gasket/gasket_core.c static bool gasket_mmap_has_permissions(struct gasket_dev *gasket_dev, gasket_dev 685 drivers/staging/gasket/gasket_core.c if (gasket_dev->status != GASKET_STATUS_ALIVE) { gasket_dev 686 drivers/staging/gasket/gasket_core.c dev_dbg(gasket_dev->dev, "Device is dead.\n"); gasket_dev 694 drivers/staging/gasket/gasket_core.c dev_dbg(gasket_dev->dev, gasket_dev 703 drivers/staging/gasket/gasket_core.c !gasket_owned_by_current_tgid(&gasket_dev->dev_info)) { gasket_dev 704 drivers/staging/gasket/gasket_core.c dev_dbg(gasket_dev->dev, gasket_dev 732 drivers/staging/gasket/gasket_core.c static int gasket_get_bar_index(const struct gasket_dev *gasket_dev, gasket_dev 738 drivers/staging/gasket/gasket_core.c driver_desc = gasket_dev->internal_desc->driver_desc; gasket_dev 835 drivers/staging/gasket/gasket_core.c static int gasket_mm_vma_bar_offset(const struct gasket_dev *gasket_dev, gasket_dev 842 drivers/staging/gasket/gasket_core.c gasket_dev->internal_desc->driver_desc; gasket_dev 846 drivers/staging/gasket/gasket_core.c bar_index = gasket_get_bar_index(gasket_dev, raw_offset); gasket_dev 848 drivers/staging/gasket/gasket_core.c dev_err(gasket_dev->dev, gasket_dev 860 drivers/staging/gasket/gasket_core.c int gasket_mm_unmap_region(const struct gasket_dev *gasket_dev, gasket_dev 872 drivers/staging/gasket/gasket_core.c ret = gasket_mm_vma_bar_offset(gasket_dev, vma, &bar_offset); gasket_dev 896 drivers/staging/gasket/gasket_core.c do_map_region(const struct gasket_dev *gasket_dev, struct vm_area_struct *vma, gasket_dev 905 drivers/staging/gasket/gasket_core.c gasket_dev->internal_desc->driver_desc; gasket_dev 913 drivers/staging/gasket/gasket_core.c ret = gasket_mm_vma_bar_offset(gasket_dev, vma, &bar_offset); gasket_dev 926 drivers/staging/gasket/gasket_core.c gasket_get_bar_index(gasket_dev, gasket_dev 933 drivers/staging/gasket/gasket_core.c phys_base = gasket_dev->bar_data[bar_index].phys_base + phys_offset; gasket_dev 947 drivers/staging/gasket/gasket_core.c dev_err(gasket_dev->dev, gasket_dev 959 drivers/staging/gasket/gasket_core.c if (gasket_mm_unmap_region(gasket_dev, vma, mappable_region)) gasket_dev 960 drivers/staging/gasket/gasket_core.c dev_err(gasket_dev->dev, gasket_dev 969 drivers/staging/gasket/gasket_core.c static int gasket_mmap_coherent(struct gasket_dev *gasket_dev, gasket_dev 973 drivers/staging/gasket/gasket_core.c gasket_dev->internal_desc->driver_desc; gasket_dev 979 drivers/staging/gasket/gasket_core.c gasket_dev->coherent_buffer.length_bytes) { gasket_dev 985 drivers/staging/gasket/gasket_core.c if (!gasket_mmap_has_permissions(gasket_dev, vma, permissions)) { gasket_dev 986 drivers/staging/gasket/gasket_core.c dev_err(gasket_dev->dev, "Permission checking failed.\n"); gasket_dev 994 drivers/staging/gasket/gasket_core.c (gasket_dev->coherent_buffer.phys_base) >> gasket_dev 997 drivers/staging/gasket/gasket_core.c dev_err(gasket_dev->dev, "Error remapping PFN range err=%d.\n", gasket_dev 1006 drivers/staging/gasket/gasket_core.c gasket_set_user_virt(gasket_dev, requested_length, gasket_dev 1007 drivers/staging/gasket/gasket_core.c gasket_dev->coherent_buffer.phys_base, gasket_dev 1022 drivers/staging/gasket/gasket_core.c struct gasket_dev *gasket_dev = (struct gasket_dev *)filp->private_data; gasket_dev 1028 drivers/staging/gasket/gasket_core.c driver_desc = gasket_dev->internal_desc->driver_desc; gasket_dev 1031 drivers/staging/gasket/gasket_core.c dev_err(gasket_dev->dev, gasket_dev 1042 drivers/staging/gasket/gasket_core.c trace_gasket_mmap_entry(gasket_dev->dev_info.name, raw_offset, gasket_dev 1049 drivers/staging/gasket/gasket_core.c bar_index = gasket_get_bar_index(gasket_dev, raw_offset); gasket_dev 1052 drivers/staging/gasket/gasket_core.c dev_err(gasket_dev->dev, gasket_dev 1059 drivers/staging/gasket/gasket_core.c dev_err(gasket_dev->dev, gasket_dev 1066 drivers/staging/gasket/gasket_core.c vma->vm_private_data = gasket_dev; gasket_dev 1069 drivers/staging/gasket/gasket_core.c return gasket_mmap_coherent(gasket_dev, vma); gasket_dev 1079 drivers/staging/gasket/gasket_core.c if (!gasket_mmap_has_permissions(gasket_dev, vma, permissions)) { gasket_dev 1080 drivers/staging/gasket/gasket_core.c dev_err(gasket_dev->dev, "Permission checking failed.\n"); gasket_dev 1086 drivers/staging/gasket/gasket_core.c ret = driver_desc->get_mappable_regions_cb(gasket_dev, gasket_dev 1093 drivers/staging/gasket/gasket_core.c if (!gasket_mmap_has_permissions(gasket_dev, vma, gasket_dev 1095 drivers/staging/gasket/gasket_core.c dev_err(gasket_dev->dev, gasket_dev 1112 drivers/staging/gasket/gasket_core.c dev_err(gasket_dev->dev, "No mappable regions returned!\n"); gasket_dev 1119 drivers/staging/gasket/gasket_core.c map_status = do_map_region(gasket_dev, vma, &map_regions[i]); gasket_dev 1135 drivers/staging/gasket/gasket_core.c dev_err(gasket_dev->dev, gasket_dev 1148 drivers/staging/gasket/gasket_core.c if (gasket_mm_unmap_region(gasket_dev, vma, gasket_dev 1150 drivers/staging/gasket/gasket_core.c dev_err(gasket_dev->dev, "Error unmapping range %d.\n", gasket_dev 1170 drivers/staging/gasket/gasket_core.c struct gasket_dev *gasket_dev; gasket_dev 1179 drivers/staging/gasket/gasket_core.c gasket_dev = dev_info->gasket_dev_ptr; gasket_dev 1180 drivers/staging/gasket/gasket_core.c driver_desc = gasket_dev->internal_desc->driver_desc; gasket_dev 1183 drivers/staging/gasket/gasket_core.c filp->private_data = gasket_dev; gasket_dev 1186 drivers/staging/gasket/gasket_core.c dev_dbg(gasket_dev->dev, gasket_dev 1194 drivers/staging/gasket/gasket_core.c dev_dbg(gasket_dev->dev, "Allowing read-only opening.\n"); gasket_dev 1198 drivers/staging/gasket/gasket_core.c mutex_lock(&gasket_dev->mutex); gasket_dev 1200 drivers/staging/gasket/gasket_core.c dev_dbg(gasket_dev->dev, gasket_dev 1207 drivers/staging/gasket/gasket_core.c dev_err(gasket_dev->dev, gasket_dev 1210 drivers/staging/gasket/gasket_core.c mutex_unlock(&gasket_dev->mutex); gasket_dev 1216 drivers/staging/gasket/gasket_core.c ret = gasket_check_and_invoke_callback_nolock(gasket_dev, gasket_dev 1219 drivers/staging/gasket/gasket_core.c dev_err(gasket_dev->dev, gasket_dev 1221 drivers/staging/gasket/gasket_core.c mutex_unlock(&gasket_dev->mutex); gasket_dev 1226 drivers/staging/gasket/gasket_core.c dev_dbg(gasket_dev->dev, "Device owner is now tgid %u\n", gasket_dev 1232 drivers/staging/gasket/gasket_core.c dev_dbg(gasket_dev->dev, "New open count (owning tgid %u): %d\n", gasket_dev 1235 drivers/staging/gasket/gasket_core.c mutex_unlock(&gasket_dev->mutex); gasket_dev 1249 drivers/staging/gasket/gasket_core.c struct gasket_dev *gasket_dev; gasket_dev 1258 drivers/staging/gasket/gasket_core.c gasket_dev = dev_info->gasket_dev_ptr; gasket_dev 1259 drivers/staging/gasket/gasket_core.c driver_desc = gasket_dev->internal_desc->driver_desc; gasket_dev 1262 drivers/staging/gasket/gasket_core.c mutex_lock(&gasket_dev->mutex); gasket_dev 1264 drivers/staging/gasket/gasket_core.c dev_dbg(gasket_dev->dev, gasket_dev 1269 drivers/staging/gasket/gasket_core.c dev_dbg(gasket_dev->dev, "Current open count (owning tgid %u): %d\n", gasket_dev 1275 drivers/staging/gasket/gasket_core.c dev_dbg(gasket_dev->dev, "Device is now free\n"); gasket_dev 1280 drivers/staging/gasket/gasket_core.c driver_desc->device_reset_cb(gasket_dev); gasket_dev 1283 drivers/staging/gasket/gasket_core.c gasket_page_table_unmap_all(gasket_dev->page_table[i]); gasket_dev 1284 drivers/staging/gasket/gasket_core.c gasket_page_table_garbage_collect(gasket_dev->page_table[i]); gasket_dev 1285 drivers/staging/gasket/gasket_core.c gasket_free_coherent_memory_all(gasket_dev, i); gasket_dev 1289 drivers/staging/gasket/gasket_core.c gasket_check_and_invoke_callback_nolock(gasket_dev, gasket_dev 1294 drivers/staging/gasket/gasket_core.c dev_dbg(gasket_dev->dev, "New open count (owning tgid %u): %d\n", gasket_dev 1296 drivers/staging/gasket/gasket_core.c mutex_unlock(&gasket_dev->mutex); gasket_dev 1309 drivers/staging/gasket/gasket_core.c struct gasket_dev *gasket_dev; gasket_dev 1314 drivers/staging/gasket/gasket_core.c gasket_dev = (struct gasket_dev *)filp->private_data; gasket_dev 1315 drivers/staging/gasket/gasket_core.c driver_desc = gasket_dev->internal_desc->driver_desc; gasket_dev 1317 drivers/staging/gasket/gasket_core.c dev_dbg(gasket_dev->dev, gasket_dev 1332 drivers/staging/gasket/gasket_core.c dev_dbg(gasket_dev->dev, "Received unknown ioctl 0x%x\n", cmd); gasket_dev 1350 drivers/staging/gasket/gasket_core.c int gasket_enable_device(struct gasket_dev *gasket_dev) gasket_dev 1355 drivers/staging/gasket/gasket_core.c gasket_dev->internal_desc->driver_desc; gasket_dev 1357 drivers/staging/gasket/gasket_core.c ret = gasket_interrupt_init(gasket_dev); gasket_dev 1359 drivers/staging/gasket/gasket_core.c dev_err(gasket_dev->dev, gasket_dev 1361 drivers/staging/gasket/gasket_core.c gasket_interrupt_cleanup(gasket_dev); gasket_dev 1366 drivers/staging/gasket/gasket_core.c dev_dbg(gasket_dev->dev, "Initializing page table %d.\n", gasket_dev 1368 drivers/staging/gasket/gasket_core.c ret = gasket_page_table_init(&gasket_dev->page_table[tbl_idx], gasket_dev 1369 drivers/staging/gasket/gasket_core.c &gasket_dev->bar_data[driver_desc->page_table_bar_index], gasket_dev 1371 drivers/staging/gasket/gasket_core.c gasket_dev->dev, gasket_dev 1372 drivers/staging/gasket/gasket_core.c gasket_dev->pci_dev); gasket_dev 1374 drivers/staging/gasket/gasket_core.c dev_err(gasket_dev->dev, gasket_dev 1383 drivers/staging/gasket/gasket_core.c gasket_page_table_reset(gasket_dev->page_table[tbl_idx]); gasket_dev 1390 drivers/staging/gasket/gasket_core.c ret = check_and_invoke_callback(gasket_dev, gasket_dev 1393 drivers/staging/gasket/gasket_core.c dev_err(gasket_dev->dev, gasket_dev 1397 drivers/staging/gasket/gasket_core.c gasket_dev->hardware_revision = ret; gasket_dev 1400 drivers/staging/gasket/gasket_core.c gasket_dev->status = gasket_get_hw_status(gasket_dev); gasket_dev 1401 drivers/staging/gasket/gasket_core.c if (gasket_dev->status == GASKET_STATUS_DEAD) gasket_dev 1402 drivers/staging/gasket/gasket_core.c dev_err(gasket_dev->dev, "Device reported as unhealthy.\n"); gasket_dev 1404 drivers/staging/gasket/gasket_core.c ret = gasket_add_cdev(&gasket_dev->dev_info, &gasket_file_ops, gasket_dev 1415 drivers/staging/gasket/gasket_core.c struct gasket_dev **gasket_devp) gasket_dev 1418 drivers/staging/gasket/gasket_core.c struct gasket_dev *gasket_dev; gasket_dev 1422 drivers/staging/gasket/gasket_core.c ret = gasket_alloc_dev(internal_desc, parent_dev, &gasket_dev); gasket_dev 1425 drivers/staging/gasket/gasket_core.c if (IS_ERR(gasket_dev->dev_info.device)) { gasket_dev 1427 drivers/staging/gasket/gasket_core.c driver_desc->name, gasket_dev->dev_info.name, gasket_dev 1428 drivers/staging/gasket/gasket_core.c PTR_ERR(gasket_dev->dev_info.device)); gasket_dev 1433 drivers/staging/gasket/gasket_core.c ret = gasket_sysfs_create_mapping(gasket_dev->dev_info.device, gasket_dev 1434 drivers/staging/gasket/gasket_core.c gasket_dev); gasket_dev 1438 drivers/staging/gasket/gasket_core.c ret = gasket_sysfs_create_entries(gasket_dev->dev_info.device, gasket_dev 1443 drivers/staging/gasket/gasket_core.c *gasket_devp = gasket_dev; gasket_dev 1447 drivers/staging/gasket/gasket_core.c gasket_sysfs_remove_mapping(gasket_dev->dev_info.device); gasket_dev 1449 drivers/staging/gasket/gasket_core.c device_destroy(internal_desc->class, gasket_dev->dev_info.devt); gasket_dev 1451 drivers/staging/gasket/gasket_core.c gasket_free_dev(gasket_dev); gasket_dev 1456 drivers/staging/gasket/gasket_core.c struct gasket_dev *gasket_dev) gasket_dev 1458 drivers/staging/gasket/gasket_core.c gasket_sysfs_remove_mapping(gasket_dev->dev_info.device); gasket_dev 1459 drivers/staging/gasket/gasket_core.c device_destroy(internal_desc->class, gasket_dev->dev_info.devt); gasket_dev 1460 drivers/staging/gasket/gasket_core.c gasket_free_dev(gasket_dev); gasket_dev 1472 drivers/staging/gasket/gasket_core.c struct gasket_dev **gasket_devp) gasket_dev 1476 drivers/staging/gasket/gasket_core.c struct gasket_dev *gasket_dev; gasket_dev 1491 drivers/staging/gasket/gasket_core.c ret = __gasket_add_device(parent, internal_desc, &gasket_dev); gasket_dev 1495 drivers/staging/gasket/gasket_core.c gasket_dev->pci_dev = pci_dev; gasket_dev 1496 drivers/staging/gasket/gasket_core.c ret = gasket_setup_pci(pci_dev, gasket_dev); gasket_dev 1504 drivers/staging/gasket/gasket_core.c ret = sysfs_create_link(&gasket_dev->dev_info.device->kobj, gasket_dev 1507 drivers/staging/gasket/gasket_core.c dev_err(gasket_dev->dev, gasket_dev 1512 drivers/staging/gasket/gasket_core.c *gasket_devp = gasket_dev; gasket_dev 1516 drivers/staging/gasket/gasket_core.c gasket_cleanup_pci(gasket_dev); gasket_dev 1517 drivers/staging/gasket/gasket_core.c __gasket_remove_device(internal_desc, gasket_dev); gasket_dev 1527 drivers/staging/gasket/gasket_core.c struct gasket_dev *gasket_dev = NULL; gasket_dev 1542 drivers/staging/gasket/gasket_core.c gasket_dev = internal_desc->devs[i]; gasket_dev 1548 drivers/staging/gasket/gasket_core.c if (!gasket_dev) gasket_dev 1551 drivers/staging/gasket/gasket_core.c dev_dbg(gasket_dev->dev, "remove %s PCI gasket device\n", gasket_dev 1554 drivers/staging/gasket/gasket_core.c gasket_cleanup_pci(gasket_dev); gasket_dev 1555 drivers/staging/gasket/gasket_core.c __gasket_remove_device(internal_desc, gasket_dev); gasket_dev 1585 drivers/staging/gasket/gasket_core.c int gasket_reset(struct gasket_dev *gasket_dev) gasket_dev 1589 drivers/staging/gasket/gasket_core.c mutex_lock(&gasket_dev->mutex); gasket_dev 1590 drivers/staging/gasket/gasket_core.c ret = gasket_reset_nolock(gasket_dev); gasket_dev 1591 drivers/staging/gasket/gasket_core.c mutex_unlock(&gasket_dev->mutex); gasket_dev 1596 drivers/staging/gasket/gasket_core.c int gasket_reset_nolock(struct gasket_dev *gasket_dev) gasket_dev 1602 drivers/staging/gasket/gasket_core.c driver_desc = gasket_dev->internal_desc->driver_desc; gasket_dev 1606 drivers/staging/gasket/gasket_core.c ret = driver_desc->device_reset_cb(gasket_dev); gasket_dev 1608 drivers/staging/gasket/gasket_core.c dev_dbg(gasket_dev->dev, "Device reset cb returned %d.\n", gasket_dev 1615 drivers/staging/gasket/gasket_core.c gasket_page_table_reset(gasket_dev->page_table[i]); gasket_dev 1617 drivers/staging/gasket/gasket_core.c ret = gasket_interrupt_reinit(gasket_dev); gasket_dev 1619 drivers/staging/gasket/gasket_core.c dev_dbg(gasket_dev->dev, "Unable to reinit interrupts: %d.\n", gasket_dev 1625 drivers/staging/gasket/gasket_core.c gasket_dev->status = gasket_get_hw_status(gasket_dev); gasket_dev 1626 drivers/staging/gasket/gasket_core.c if (gasket_dev->status == GASKET_STATUS_DEAD) { gasket_dev 1627 drivers/staging/gasket/gasket_core.c dev_dbg(gasket_dev->dev, "Device reported as dead.\n"); gasket_dev 1636 drivers/staging/gasket/gasket_core.c gasket_get_ioctl_permissions_cb(struct gasket_dev *gasket_dev) gasket_dev 1638 drivers/staging/gasket/gasket_core.c return gasket_dev->internal_desc->driver_desc->ioctl_permissions_cb; gasket_dev 1645 drivers/staging/gasket/gasket_core.c const struct gasket_driver_desc *gasket_get_driver_desc(struct gasket_dev *dev) gasket_dev 1653 drivers/staging/gasket/gasket_core.c struct device *gasket_get_device(struct gasket_dev *dev) gasket_dev 1671 drivers/staging/gasket/gasket_core.c int gasket_wait_with_reschedule(struct gasket_dev *gasket_dev, int bar, gasket_dev 1679 drivers/staging/gasket/gasket_core.c tmp = gasket_dev_read_64(gasket_dev, bar, offset); gasket_dev 1685 drivers/staging/gasket/gasket_core.c dev_dbg(gasket_dev->dev, "%s timeout: reg %llx timeout (%llu ms)\n", gasket_dev 1730 drivers/staging/gasket/gasket_core.c memset(internal->devs, 0, sizeof(struct gasket_dev *) * GASKET_DEV_MAX); gasket_dev 167 drivers/staging/gasket/gasket_core.h struct gasket_dev *gasket_dev_ptr; gasket_dev 409 drivers/staging/gasket/gasket_core.h int (*device_open_cb)(struct gasket_dev *dev); gasket_dev 420 drivers/staging/gasket/gasket_core.h int (*device_release_cb)(struct gasket_dev *gasket_dev, gasket_dev 434 drivers/staging/gasket/gasket_core.h int (*device_close_cb)(struct gasket_dev *dev); gasket_dev 449 drivers/staging/gasket/gasket_core.h int (*get_mappable_regions_cb)(struct gasket_dev *gasket_dev, gasket_dev 488 drivers/staging/gasket/gasket_core.h int (*device_status_cb)(struct gasket_dev *dev); gasket_dev 497 drivers/staging/gasket/gasket_core.h int (*hardware_revision_cb)(struct gasket_dev *dev); gasket_dev 507 drivers/staging/gasket/gasket_core.h int (*device_reset_cb)(struct gasket_dev *dev); gasket_dev 531 drivers/staging/gasket/gasket_core.h struct gasket_dev **gasket_devp); gasket_dev 536 drivers/staging/gasket/gasket_core.h int gasket_enable_device(struct gasket_dev *gasket_dev); gasket_dev 539 drivers/staging/gasket/gasket_core.h void gasket_disable_device(struct gasket_dev *gasket_dev); gasket_dev 549 drivers/staging/gasket/gasket_core.h int gasket_reset(struct gasket_dev *gasket_dev); gasket_dev 550 drivers/staging/gasket/gasket_core.h int gasket_reset_nolock(struct gasket_dev *gasket_dev); gasket_dev 558 drivers/staging/gasket/gasket_core.h int gasket_mm_unmap_region(const struct gasket_dev *gasket_dev, gasket_dev 567 drivers/staging/gasket/gasket_core.h gasket_get_ioctl_permissions_cb(struct gasket_dev *gasket_dev); gasket_dev 579 drivers/staging/gasket/gasket_core.h static inline ulong gasket_dev_read_64(struct gasket_dev *gasket_dev, int bar, gasket_dev 582 drivers/staging/gasket/gasket_core.h return readq_relaxed(&gasket_dev->bar_data[bar].virt_base[location]); gasket_dev 585 drivers/staging/gasket/gasket_core.h static inline void gasket_dev_write_64(struct gasket_dev *dev, u64 value, gasket_dev 591 drivers/staging/gasket/gasket_core.h static inline void gasket_dev_write_32(struct gasket_dev *dev, u32 value, gasket_dev 597 drivers/staging/gasket/gasket_core.h static inline u32 gasket_dev_read_32(struct gasket_dev *dev, int bar, gasket_dev 603 drivers/staging/gasket/gasket_core.h static inline void gasket_read_modify_write_64(struct gasket_dev *dev, int bar, gasket_dev 615 drivers/staging/gasket/gasket_core.h static inline void gasket_read_modify_write_32(struct gasket_dev *dev, int bar, gasket_dev 628 drivers/staging/gasket/gasket_core.h const struct gasket_driver_desc *gasket_get_driver_desc(struct gasket_dev *dev); gasket_dev 631 drivers/staging/gasket/gasket_core.h struct device *gasket_get_device(struct gasket_dev *dev); gasket_dev 634 drivers/staging/gasket/gasket_core.h int gasket_wait_with_reschedule(struct gasket_dev *gasket_dev, int bar, gasket_dev 75 drivers/staging/gasket/gasket_interrupt.c static void gasket_interrupt_setup(struct gasket_dev *gasket_dev) gasket_dev 82 drivers/staging/gasket/gasket_interrupt.c gasket_dev->interrupt_data; gasket_dev 85 drivers/staging/gasket/gasket_interrupt.c dev_dbg(gasket_dev->dev, "Interrupt data is not initialized\n"); gasket_dev 89 drivers/staging/gasket/gasket_interrupt.c dev_dbg(gasket_dev->dev, "Running interrupt setup\n"); gasket_dev 99 drivers/staging/gasket/gasket_interrupt.c dev_dbg(gasket_dev->dev, gasket_dev 121 drivers/staging/gasket/gasket_interrupt.c dev_dbg(gasket_dev->dev, gasket_dev 128 drivers/staging/gasket/gasket_interrupt.c value = gasket_dev_read_64(gasket_dev, gasket_dev 135 drivers/staging/gasket/gasket_interrupt.c gasket_dev_write_64(gasket_dev, value, gasket_dev 233 drivers/staging/gasket/gasket_interrupt.c static void force_msix_interrupt_unmasking(struct gasket_dev *gasket_dev) gasket_dev 239 drivers/staging/gasket/gasket_interrupt.c for (i = 0; i < gasket_dev->interrupt_data->num_configured; i++) { gasket_dev 244 drivers/staging/gasket/gasket_interrupt.c gasket_dev_read_32(gasket_dev, gasket_dev 245 drivers/staging/gasket/gasket_interrupt.c gasket_dev->interrupt_data->interrupt_bar_index, gasket_dev 250 drivers/staging/gasket/gasket_interrupt.c gasket_dev_write_32(gasket_dev, 0, gasket_dev 251 drivers/staging/gasket/gasket_interrupt.c gasket_dev->interrupt_data->interrupt_bar_index, gasket_dev 265 drivers/staging/gasket/gasket_interrupt.c struct gasket_dev *gasket_dev; gasket_dev 269 drivers/staging/gasket/gasket_interrupt.c gasket_dev = gasket_sysfs_get_device_data(device); gasket_dev 270 drivers/staging/gasket/gasket_interrupt.c if (!gasket_dev) { gasket_dev 278 drivers/staging/gasket/gasket_interrupt.c gasket_sysfs_put_device_data(device, gasket_dev); gasket_dev 284 drivers/staging/gasket/gasket_interrupt.c interrupt_data = gasket_dev->interrupt_data; gasket_dev 298 drivers/staging/gasket/gasket_interrupt.c dev_dbg(gasket_dev->dev, "Unknown attribute: %s\n", gasket_dev 305 drivers/staging/gasket/gasket_interrupt.c gasket_sysfs_put_device_data(device, gasket_dev); gasket_dev 315 drivers/staging/gasket/gasket_interrupt.c int gasket_interrupt_init(struct gasket_dev *gasket_dev) gasket_dev 320 drivers/staging/gasket/gasket_interrupt.c gasket_get_driver_desc(gasket_dev); gasket_dev 325 drivers/staging/gasket/gasket_interrupt.c gasket_dev->interrupt_data = interrupt_data; gasket_dev 328 drivers/staging/gasket/gasket_interrupt.c interrupt_data->pci_dev = gasket_dev->pci_dev; gasket_dev 357 drivers/staging/gasket/gasket_interrupt.c force_msix_interrupt_unmasking(gasket_dev); gasket_dev 368 drivers/staging/gasket/gasket_interrupt.c dev_warn(gasket_dev->dev, gasket_dev 373 drivers/staging/gasket/gasket_interrupt.c gasket_interrupt_setup(gasket_dev); gasket_dev 374 drivers/staging/gasket/gasket_interrupt.c gasket_sysfs_create_entries(gasket_dev->dev_info.device, gasket_dev 396 drivers/staging/gasket/gasket_interrupt.c int gasket_interrupt_reinit(struct gasket_dev *gasket_dev) gasket_dev 400 drivers/staging/gasket/gasket_interrupt.c if (!gasket_dev->interrupt_data) { gasket_dev 401 drivers/staging/gasket/gasket_interrupt.c dev_dbg(gasket_dev->dev, gasket_dev 406 drivers/staging/gasket/gasket_interrupt.c switch (gasket_dev->interrupt_data->type) { gasket_dev 408 drivers/staging/gasket/gasket_interrupt.c gasket_interrupt_msix_cleanup(gasket_dev->interrupt_data); gasket_dev 409 drivers/staging/gasket/gasket_interrupt.c ret = gasket_interrupt_msix_init(gasket_dev->interrupt_data); gasket_dev 412 drivers/staging/gasket/gasket_interrupt.c force_msix_interrupt_unmasking(gasket_dev); gasket_dev 423 drivers/staging/gasket/gasket_interrupt.c dev_warn(gasket_dev->dev, "Couldn't reinit interrupts: %d\n", gasket_dev 428 drivers/staging/gasket/gasket_interrupt.c gasket_interrupt_setup(gasket_dev); gasket_dev 434 drivers/staging/gasket/gasket_interrupt.c int gasket_interrupt_reset_counts(struct gasket_dev *gasket_dev) gasket_dev 436 drivers/staging/gasket/gasket_interrupt.c dev_dbg(gasket_dev->dev, "Clearing interrupt counts\n"); gasket_dev 437 drivers/staging/gasket/gasket_interrupt.c memset(gasket_dev->interrupt_data->interrupt_counts, 0, gasket_dev 438 drivers/staging/gasket/gasket_interrupt.c gasket_dev->interrupt_data->num_interrupts * gasket_dev 439 drivers/staging/gasket/gasket_interrupt.c sizeof(*gasket_dev->interrupt_data->interrupt_counts)); gasket_dev 444 drivers/staging/gasket/gasket_interrupt.c void gasket_interrupt_cleanup(struct gasket_dev *gasket_dev) gasket_dev 447 drivers/staging/gasket/gasket_interrupt.c gasket_dev->interrupt_data; gasket_dev 467 drivers/staging/gasket/gasket_interrupt.c gasket_dev->interrupt_data = NULL; gasket_dev 470 drivers/staging/gasket/gasket_interrupt.c int gasket_interrupt_system_status(struct gasket_dev *gasket_dev) gasket_dev 472 drivers/staging/gasket/gasket_interrupt.c if (!gasket_dev->interrupt_data) { gasket_dev 473 drivers/staging/gasket/gasket_interrupt.c dev_dbg(gasket_dev->dev, "Interrupt data is null\n"); gasket_dev 477 drivers/staging/gasket/gasket_interrupt.c if (gasket_dev->interrupt_data->num_configured != gasket_dev 478 drivers/staging/gasket/gasket_interrupt.c gasket_dev->interrupt_data->num_interrupts) { gasket_dev 479 drivers/staging/gasket/gasket_interrupt.c dev_dbg(gasket_dev->dev, gasket_dev 28 drivers/staging/gasket/gasket_interrupt.h int gasket_interrupt_init(struct gasket_dev *gasket_dev); gasket_dev 36 drivers/staging/gasket/gasket_interrupt.h void gasket_interrupt_cleanup(struct gasket_dev *gasket_dev); gasket_dev 46 drivers/staging/gasket/gasket_interrupt.h int gasket_interrupt_reinit(struct gasket_dev *gasket_dev); gasket_dev 54 drivers/staging/gasket/gasket_interrupt.h int gasket_interrupt_reset_counts(struct gasket_dev *gasket_dev); gasket_dev 93 drivers/staging/gasket/gasket_interrupt.h int gasket_interrupt_system_status(struct gasket_dev *gasket_dev); gasket_dev 27 drivers/staging/gasket/gasket_ioctl.c static int gasket_set_event_fd(struct gasket_dev *gasket_dev, gasket_dev 38 drivers/staging/gasket/gasket_ioctl.c gasket_dev->interrupt_data, die.interrupt, die.event_fd); gasket_dev 42 drivers/staging/gasket/gasket_ioctl.c static int gasket_read_page_table_size(struct gasket_dev *gasket_dev, gasket_dev 51 drivers/staging/gasket/gasket_ioctl.c if (ibuf.page_table_index >= gasket_dev->num_page_tables) gasket_dev 55 drivers/staging/gasket/gasket_ioctl.c gasket_dev->page_table[ibuf.page_table_index]); gasket_dev 68 drivers/staging/gasket/gasket_ioctl.c static int gasket_read_simple_page_table_size(struct gasket_dev *gasket_dev, gasket_dev 77 drivers/staging/gasket/gasket_ioctl.c if (ibuf.page_table_index >= gasket_dev->num_page_tables) gasket_dev 81 drivers/staging/gasket/gasket_ioctl.c gasket_page_table_num_simple_entries(gasket_dev->page_table[ibuf.page_table_index]); gasket_dev 94 drivers/staging/gasket/gasket_ioctl.c static int gasket_partition_page_table(struct gasket_dev *gasket_dev, gasket_dev 108 drivers/staging/gasket/gasket_ioctl.c if (ibuf.page_table_index >= gasket_dev->num_page_tables) gasket_dev 111 drivers/staging/gasket/gasket_ioctl.c gasket_dev->page_table[ibuf.page_table_index]); gasket_dev 114 drivers/staging/gasket/gasket_ioctl.c dev_dbg(gasket_dev->dev, gasket_dev 120 drivers/staging/gasket/gasket_ioctl.c mutex_lock(&gasket_dev->mutex); gasket_dev 123 drivers/staging/gasket/gasket_ioctl.c gasket_dev->page_table[ibuf.page_table_index], ibuf.size); gasket_dev 124 drivers/staging/gasket/gasket_ioctl.c mutex_unlock(&gasket_dev->mutex); gasket_dev 130 drivers/staging/gasket/gasket_ioctl.c static int gasket_map_buffers(struct gasket_dev *gasket_dev, gasket_dev 142 drivers/staging/gasket/gasket_ioctl.c if (ibuf.page_table_index >= gasket_dev->num_page_tables) gasket_dev 145 drivers/staging/gasket/gasket_ioctl.c if (gasket_page_table_are_addrs_bad(gasket_dev->page_table[ibuf.page_table_index], gasket_dev 150 drivers/staging/gasket/gasket_ioctl.c return gasket_page_table_map(gasket_dev->page_table[ibuf.page_table_index], gasket_dev 156 drivers/staging/gasket/gasket_ioctl.c static int gasket_unmap_buffers(struct gasket_dev *gasket_dev, gasket_dev 168 drivers/staging/gasket/gasket_ioctl.c if (ibuf.page_table_index >= gasket_dev->num_page_tables) gasket_dev 171 drivers/staging/gasket/gasket_ioctl.c if (gasket_page_table_is_dev_addr_bad(gasket_dev->page_table[ibuf.page_table_index], gasket_dev 175 drivers/staging/gasket/gasket_ioctl.c gasket_page_table_unmap(gasket_dev->page_table[ibuf.page_table_index], gasket_dev 185 drivers/staging/gasket/gasket_ioctl.c static int gasket_config_coherent_allocator(struct gasket_dev *gasket_dev, gasket_dev 198 drivers/staging/gasket/gasket_ioctl.c if (ibuf.page_table_index >= gasket_dev->num_page_tables) gasket_dev 205 drivers/staging/gasket/gasket_ioctl.c ret = gasket_free_coherent_memory(gasket_dev, ibuf.size, gasket_dev 209 drivers/staging/gasket/gasket_ioctl.c ret = gasket_alloc_coherent_memory(gasket_dev, ibuf.size, gasket_dev 226 drivers/staging/gasket/gasket_ioctl.c struct gasket_dev *gasket_dev = (struct gasket_dev *)filp->private_data; gasket_dev 228 drivers/staging/gasket/gasket_ioctl.c alive = (gasket_dev->status == GASKET_STATUS_ALIVE); gasket_dev 230 drivers/staging/gasket/gasket_ioctl.c dev_dbg(gasket_dev->dev, "%s alive %d status %d\n", gasket_dev 231 drivers/staging/gasket/gasket_ioctl.c __func__, alive, gasket_dev->status); gasket_dev 272 drivers/staging/gasket/gasket_ioctl.c struct gasket_dev *gasket_dev; gasket_dev 277 drivers/staging/gasket/gasket_ioctl.c gasket_dev = (struct gasket_dev *)filp->private_data; gasket_dev 278 drivers/staging/gasket/gasket_ioctl.c trace_gasket_ioctl_entry(gasket_dev->dev_info.name, cmd); gasket_dev 280 drivers/staging/gasket/gasket_ioctl.c ioctl_permissions_cb = gasket_get_ioctl_permissions_cb(gasket_dev); gasket_dev 292 drivers/staging/gasket/gasket_ioctl.c dev_dbg(gasket_dev->dev, "ioctl cmd=%x noperm\n", cmd); gasket_dev 303 drivers/staging/gasket/gasket_ioctl.c retval = gasket_reset(gasket_dev); gasket_dev 306 drivers/staging/gasket/gasket_ioctl.c retval = gasket_set_event_fd(gasket_dev, argp); gasket_dev 311 drivers/staging/gasket/gasket_ioctl.c gasket_interrupt_clear_eventfd(gasket_dev->interrupt_data, gasket_dev 316 drivers/staging/gasket/gasket_ioctl.c retval = gasket_partition_page_table(gasket_dev, argp); gasket_dev 319 drivers/staging/gasket/gasket_ioctl.c trace_gasket_ioctl_integer_data(gasket_dev->num_page_tables); gasket_dev 320 drivers/staging/gasket/gasket_ioctl.c if (copy_to_user(argp, &gasket_dev->num_page_tables, gasket_dev 327 drivers/staging/gasket/gasket_ioctl.c retval = gasket_read_page_table_size(gasket_dev, argp); gasket_dev 330 drivers/staging/gasket/gasket_ioctl.c retval = gasket_read_simple_page_table_size(gasket_dev, argp); gasket_dev 333 drivers/staging/gasket/gasket_ioctl.c retval = gasket_map_buffers(gasket_dev, argp); gasket_dev 336 drivers/staging/gasket/gasket_ioctl.c retval = gasket_config_coherent_allocator(gasket_dev, argp); gasket_dev 339 drivers/staging/gasket/gasket_ioctl.c retval = gasket_unmap_buffers(gasket_dev, argp); gasket_dev 344 drivers/staging/gasket/gasket_ioctl.c retval = gasket_interrupt_reset_counts(gasket_dev); gasket_dev 351 drivers/staging/gasket/gasket_ioctl.c dev_dbg(gasket_dev->dev, gasket_dev 1226 drivers/staging/gasket/gasket_page_table.c int gasket_set_user_virt(struct gasket_dev *gasket_dev, u64 size, gasket_dev 1238 drivers/staging/gasket/gasket_page_table.c pg_tbl = gasket_dev->page_table[0]; gasket_dev 1240 drivers/staging/gasket/gasket_page_table.c dev_dbg(gasket_dev->dev, "%s: invalid page table index\n", gasket_dev 1252 drivers/staging/gasket/gasket_page_table.c int gasket_alloc_coherent_memory(struct gasket_dev *gasket_dev, u64 size, gasket_dev 1260 drivers/staging/gasket/gasket_page_table.c gasket_get_driver_desc(gasket_dev); gasket_dev 1262 drivers/staging/gasket/gasket_page_table.c if (!gasket_dev->page_table[index]) gasket_dev 1268 drivers/staging/gasket/gasket_page_table.c mem = dma_alloc_coherent(gasket_get_device(gasket_dev), gasket_dev 1273 drivers/staging/gasket/gasket_page_table.c gasket_dev->page_table[index]->num_coherent_pages = num_pages; gasket_dev 1276 drivers/staging/gasket/gasket_page_table.c gasket_dev->page_table[index]->coherent_pages = gasket_dev 1278 drivers/staging/gasket/gasket_page_table.c sizeof(*gasket_dev->page_table[index]->coherent_pages), gasket_dev 1280 drivers/staging/gasket/gasket_page_table.c if (!gasket_dev->page_table[index]->coherent_pages) gasket_dev 1283 drivers/staging/gasket/gasket_page_table.c gasket_dev->coherent_buffer.length_bytes = gasket_dev 1285 drivers/staging/gasket/gasket_page_table.c gasket_dev->coherent_buffer.phys_base = handle; gasket_dev 1286 drivers/staging/gasket/gasket_page_table.c gasket_dev->coherent_buffer.virt_base = mem; gasket_dev 1290 drivers/staging/gasket/gasket_page_table.c gasket_dev->page_table[index]->coherent_pages[j].paddr = gasket_dev 1292 drivers/staging/gasket/gasket_page_table.c gasket_dev->page_table[index]->coherent_pages[j].kernel_virt = gasket_dev 1300 drivers/staging/gasket/gasket_page_table.c dma_free_coherent(gasket_get_device(gasket_dev), gasket_dev 1302 drivers/staging/gasket/gasket_page_table.c gasket_dev->coherent_buffer.length_bytes = 0; gasket_dev 1303 drivers/staging/gasket/gasket_page_table.c gasket_dev->coherent_buffer.virt_base = NULL; gasket_dev 1304 drivers/staging/gasket/gasket_page_table.c gasket_dev->coherent_buffer.phys_base = 0; gasket_dev 1307 drivers/staging/gasket/gasket_page_table.c kfree(gasket_dev->page_table[index]->coherent_pages); gasket_dev 1308 drivers/staging/gasket/gasket_page_table.c gasket_dev->page_table[index]->coherent_pages = NULL; gasket_dev 1309 drivers/staging/gasket/gasket_page_table.c gasket_dev->page_table[index]->num_coherent_pages = 0; gasket_dev 1314 drivers/staging/gasket/gasket_page_table.c int gasket_free_coherent_memory(struct gasket_dev *gasket_dev, u64 size, gasket_dev 1319 drivers/staging/gasket/gasket_page_table.c if (!gasket_dev->page_table[index]) gasket_dev 1322 drivers/staging/gasket/gasket_page_table.c driver_desc = gasket_get_driver_desc(gasket_dev); gasket_dev 1327 drivers/staging/gasket/gasket_page_table.c if (gasket_dev->coherent_buffer.length_bytes) { gasket_dev 1328 drivers/staging/gasket/gasket_page_table.c dma_free_coherent(gasket_get_device(gasket_dev), gasket_dev 1329 drivers/staging/gasket/gasket_page_table.c gasket_dev->coherent_buffer.length_bytes, gasket_dev 1330 drivers/staging/gasket/gasket_page_table.c gasket_dev->coherent_buffer.virt_base, gasket_dev 1331 drivers/staging/gasket/gasket_page_table.c gasket_dev->coherent_buffer.phys_base); gasket_dev 1332 drivers/staging/gasket/gasket_page_table.c gasket_dev->coherent_buffer.length_bytes = 0; gasket_dev 1333 drivers/staging/gasket/gasket_page_table.c gasket_dev->coherent_buffer.virt_base = NULL; gasket_dev 1334 drivers/staging/gasket/gasket_page_table.c gasket_dev->coherent_buffer.phys_base = 0; gasket_dev 1337 drivers/staging/gasket/gasket_page_table.c kfree(gasket_dev->page_table[index]->coherent_pages); gasket_dev 1338 drivers/staging/gasket/gasket_page_table.c gasket_dev->page_table[index]->coherent_pages = NULL; gasket_dev 1339 drivers/staging/gasket/gasket_page_table.c gasket_dev->page_table[index]->num_coherent_pages = 0; gasket_dev 1345 drivers/staging/gasket/gasket_page_table.c void gasket_free_coherent_memory_all(struct gasket_dev *gasket_dev, u64 index) gasket_dev 1347 drivers/staging/gasket/gasket_page_table.c if (!gasket_dev->page_table[index]) gasket_dev 1350 drivers/staging/gasket/gasket_page_table.c if (gasket_dev->coherent_buffer.length_bytes) { gasket_dev 1351 drivers/staging/gasket/gasket_page_table.c dma_free_coherent(gasket_get_device(gasket_dev), gasket_dev 1352 drivers/staging/gasket/gasket_page_table.c gasket_dev->coherent_buffer.length_bytes, gasket_dev 1353 drivers/staging/gasket/gasket_page_table.c gasket_dev->coherent_buffer.virt_base, gasket_dev 1354 drivers/staging/gasket/gasket_page_table.c gasket_dev->coherent_buffer.phys_base); gasket_dev 1355 drivers/staging/gasket/gasket_page_table.c gasket_dev->coherent_buffer.length_bytes = 0; gasket_dev 1356 drivers/staging/gasket/gasket_page_table.c gasket_dev->coherent_buffer.virt_base = NULL; gasket_dev 1357 drivers/staging/gasket/gasket_page_table.c gasket_dev->coherent_buffer.phys_base = 0; gasket_dev 224 drivers/staging/gasket/gasket_page_table.h int gasket_alloc_coherent_memory(struct gasket_dev *gasket_dev, uint64_t size, gasket_dev 227 drivers/staging/gasket/gasket_page_table.h int gasket_free_coherent_memory(struct gasket_dev *gasket_dev, uint64_t size, gasket_dev 231 drivers/staging/gasket/gasket_page_table.h void gasket_free_coherent_memory_all(struct gasket_dev *gasket_dev, gasket_dev 246 drivers/staging/gasket/gasket_page_table.h int gasket_set_user_virt(struct gasket_dev *gasket_dev, uint64_t size, gasket_dev 23 drivers/staging/gasket/gasket_sysfs.c struct gasket_dev *gasket_dev; gasket_dev 116 drivers/staging/gasket/gasket_sysfs.c mapping->gasket_dev = NULL; gasket_dev 153 drivers/staging/gasket/gasket_sysfs.c struct gasket_dev *gasket_dev) gasket_dev 208 drivers/staging/gasket/gasket_sysfs.c mapping->gasket_dev = gasket_dev; gasket_dev 271 drivers/staging/gasket/gasket_sysfs.c struct gasket_dev *gasket_sysfs_get_device_data(struct device *device) gasket_dev 280 drivers/staging/gasket/gasket_sysfs.c return mapping->gasket_dev; gasket_dev 284 drivers/staging/gasket/gasket_sysfs.c void gasket_sysfs_put_device_data(struct device *device, struct gasket_dev *dev) gasket_dev 351 drivers/staging/gasket/gasket_sysfs.c struct gasket_dev *gasket_dev; gasket_dev 372 drivers/staging/gasket/gasket_sysfs.c gasket_dev = mapping->gasket_dev; gasket_dev 373 drivers/staging/gasket/gasket_sysfs.c if (!gasket_dev) { gasket_dev 384 drivers/staging/gasket/gasket_sysfs.c gasket_dev_write_64(gasket_dev, parsed_value, gasket_dev 389 drivers/staging/gasket/gasket_sysfs.c gasket_attr->write_callback(gasket_dev, gasket_attr, gasket_dev 67 drivers/staging/gasket/gasket_sysfs.h void (*write_callback)(struct gasket_dev *dev, gasket_dev 98 drivers/staging/gasket/gasket_sysfs.h struct gasket_dev *gasket_dev); gasket_dev 133 drivers/staging/gasket/gasket_sysfs.h struct gasket_dev *gasket_sysfs_get_device_data(struct device *device); gasket_dev 141 drivers/staging/gasket/gasket_sysfs.h struct gasket_dev *gasket_dev);