Lines Matching +full:fails +full:- +full:without +full:- +full:test +full:- +full:cd

1 /* SPDX-License-Identifier: GPL-2.0-only */
11 * Author: Joerg-Stephan Vogt <jsvogt@de.ibm.com>
42 #define GENWQE_DDCB_MAX 32 /* DDCBs on the work-queue */
62 #define PCI_SUBSYSTEM_ID_GENWQE5 0x035f /* Genwqe A5 Subsystem-ID */
63 #define PCI_SUBSYSTEM_ID_GENWQE5_NEW 0x044b /* Genwqe A5 Subsystem-ID */
67 #define PCI_SUBSYSTEM_ID_GENWQE5_SRIOV 0x0000 /* Genwqe A5 Subsystem-ID */
73 * struct genwqe_reg - Genwqe data dump functionality
82 * enum genwqe_dbg_type - Specify chip unit to dump/debug
99 #define GENWQE_INJECT_HARDWARE_FAILURE 0x00000001 /* injects -1 reg reads */
107 * Error-handling in case of card malfunction
108 * ------------------------------------------
120 * All functions accessing the card device return either -EIO or -ENODEV
140 * -------------
142 * To test the internal driver recovery the following command can be used:
143 * sudo sh -c 'echo 0xfffff > /sys/class/genwqe/genwqe0_card/err_inject'
148 * struct dma_mapping_type - Mapping type definition
151 * this we need to pin/swap-in the memory and request a DMA address
161 * struct dma_mapping - Information about memory mappings done by the driver
166 void *u_vaddr; /* user-space vaddr/non-aligned */
167 void *k_vaddr; /* kernel-space vaddr/non-aligned */
184 m->type = type; in genwqe_mapping_init()
185 m->write = 1; /* Assume the maps we create are R/W */ in genwqe_mapping_init()
189 * struct ddcb_queue - DDCB queue data
196 * @return_on_busy: Number of -EBUSY returns on full queue
214 unsigned int return_on_busy; /* how many times -EBUSY? */
249 * struct genwqe_dev - GenWQE device information
258 * @mmio: Base address of 64-bit register space
272 int card_idx; /* card index 0..CARD_NO_MAX-1 */
301 void __iomem *mmio; /* BAR-0 MMIO start */
320 int skip_recovery; /* circumvention if recovery fails */
325 * enum genwqe_requ_state - State of a DDCB execution request
336 * struct genwqe_sgl - Scatter gather list describing user-space memory
340 * @user_addr: user-space address of memory area
341 * @user_size: size of user-space memory area
351 void __user *user_addr; /* user-space base-address */
368 int genwqe_alloc_sync_sgl(struct genwqe_dev *cd, struct genwqe_sgl *sgl,
371 int genwqe_setup_sgl(struct genwqe_dev *cd, struct genwqe_sgl *sgl,
374 int genwqe_free_sync_sgl(struct genwqe_dev *cd, struct genwqe_sgl *sgl);
377 * struct ddcb_requ - Kernel internal representation of the DDCB request
395 * struct genwqe_file - Information for open GenWQE devices
398 struct genwqe_dev *cd; member
413 int genwqe_setup_service_layer(struct genwqe_dev *cd); /* for PF only */
414 int genwqe_finish_queue(struct genwqe_dev *cd);
415 int genwqe_release_service_layer(struct genwqe_dev *cd);
418 * genwqe_get_slu_id() - Read Service Layer Unit Id
424 static inline int genwqe_get_slu_id(struct genwqe_dev *cd) in genwqe_get_slu_id() argument
426 return (int)((cd->slu_unitcfg >> 32) & 0xff); in genwqe_get_slu_id()
429 int genwqe_ddcbs_in_flight(struct genwqe_dev *cd);
431 u8 genwqe_card_type(struct genwqe_dev *cd);
432 int genwqe_card_reset(struct genwqe_dev *cd);
433 int genwqe_set_interrupt_capability(struct genwqe_dev *cd, int count);
434 void genwqe_reset_interrupt_capability(struct genwqe_dev *cd);
436 int genwqe_device_create(struct genwqe_dev *cd);
437 int genwqe_device_remove(struct genwqe_dev *cd);
440 void genwqe_init_debugfs(struct genwqe_dev *cd);
441 void genqwe_exit_debugfs(struct genwqe_dev *cd);
443 int genwqe_read_softreset(struct genwqe_dev *cd);
446 int genwqe_recovery_on_fatal_gfir_required(struct genwqe_dev *cd);
447 int genwqe_flash_readback_fails(struct genwqe_dev *cd);
450 * genwqe_write_vreg() - Write register in VF window
451 * @cd: genwqe device
456 int genwqe_write_vreg(struct genwqe_dev *cd, u32 reg, u64 val, int func);
459 * genwqe_read_vreg() - Read register in VF window
460 * @cd: genwqe device
466 u64 genwqe_read_vreg(struct genwqe_dev *cd, u32 reg, int func);
469 int genwqe_ffdc_buff_size(struct genwqe_dev *cd, int unit_id);
470 int genwqe_ffdc_buff_read(struct genwqe_dev *cd, int unit_id,
472 int genwqe_read_ffdc_regs(struct genwqe_dev *cd, struct genwqe_reg *regs,
474 int genwqe_ffdc_dump_dma(struct genwqe_dev *cd,
477 int genwqe_init_debug_data(struct genwqe_dev *cd,
481 int genwqe_read_app_id(struct genwqe_dev *cd, char *app_name, int len);
484 int genwqe_user_vmap(struct genwqe_dev *cd, struct dma_mapping *m,
487 int genwqe_user_vunmap(struct genwqe_dev *cd, struct dma_mapping *m);
493 return m->size != 0; in dma_mapping_used()
497 * __genwqe_execute_ddcb() - Execute DDCB request with addr translation
502 * user-space buffers, inclusive page pinning and scatter gather list
505 int __genwqe_execute_ddcb(struct genwqe_dev *cd,
509 * __genwqe_execute_raw_ddcb() - Execute DDCB request without addr translation
517 int __genwqe_execute_raw_ddcb(struct genwqe_dev *cd,
520 int __genwqe_enqueue_ddcb(struct genwqe_dev *cd,
524 int __genwqe_wait_ddcb(struct genwqe_dev *cd, struct ddcb_requ *req);
525 int __genwqe_purge_ddcb(struct genwqe_dev *cd, struct ddcb_requ *req);
528 int __genwqe_writeq(struct genwqe_dev *cd, u64 byte_offs, u64 val);
529 u64 __genwqe_readq(struct genwqe_dev *cd, u64 byte_offs);
530 int __genwqe_writel(struct genwqe_dev *cd, u64 byte_offs, u32 val);
531 u32 __genwqe_readl(struct genwqe_dev *cd, u64 byte_offs);
533 void *__genwqe_alloc_consistent(struct genwqe_dev *cd, size_t size,
535 void __genwqe_free_consistent(struct genwqe_dev *cd, size_t size,
539 int genwqe_base_clock_frequency(struct genwqe_dev *cd);
542 void genwqe_stop_traps(struct genwqe_dev *cd);
543 void genwqe_start_traps(struct genwqe_dev *cd);
546 bool genwqe_need_err_masking(struct genwqe_dev *cd);
549 * genwqe_is_privileged() - Determine operation mode for PCI function
566 * if (pci_dev->is_virtfn)
567 * cd->is_privileged = 0;
569 * cd->is_privileged = (__genwqe_readq(cd, IO_SLU_BITSTREAM)
572 static inline int genwqe_is_privileged(struct genwqe_dev *cd) in genwqe_is_privileged() argument
574 return cd->is_privileged; in genwqe_is_privileged()