Lines Matching refs:desc
50 static int altera_validate(Altera_desc *desc, const char *fn) in altera_validate() argument
52 if (!desc) { in altera_validate()
57 if ((desc->family < min_altera_type) || in altera_validate()
58 (desc->family > max_altera_type)) { in altera_validate()
59 printf("%s: Invalid family type, %d\n", fn, desc->family); in altera_validate()
63 if ((desc->iface < min_altera_iface_type) || in altera_validate()
64 (desc->iface > max_altera_iface_type)) { in altera_validate()
65 printf("%s: Invalid Interface type, %d\n", fn, desc->iface); in altera_validate()
69 if (!desc->size) { in altera_validate()
78 altera_desc_to_fpga(Altera_desc *desc, const char *fn) in altera_desc_to_fpga() argument
82 if (altera_validate(desc, fn)) { in altera_desc_to_fpga()
88 if (desc->family == altera_fpga[i].family) in altera_desc_to_fpga()
93 printf("%s: Unsupported family type, %d\n", fn, desc->family); in altera_desc_to_fpga()
100 int altera_load(Altera_desc *desc, const void *buf, size_t bsize) in altera_load() argument
102 const struct altera_fpga *fpga = altera_desc_to_fpga(desc, __func__); in altera_load()
110 return fpga->load(desc, buf, bsize); in altera_load()
114 int altera_dump(Altera_desc *desc, const void *buf, size_t bsize) in altera_dump() argument
116 const struct altera_fpga *fpga = altera_desc_to_fpga(desc, __func__); in altera_dump()
124 return fpga->dump(desc, buf, bsize); in altera_dump()
128 int altera_info(Altera_desc *desc) in altera_info() argument
130 const struct altera_fpga *fpga = altera_desc_to_fpga(desc, __func__); in altera_info()
138 switch (desc->iface) { in altera_info()
165 printf("Unsupported interface type, %d\n", desc->iface); in altera_info()
170 desc->size, desc->cookie, desc->cookie); in altera_info()
172 if (desc->iface_fns) { in altera_info()
173 printf("Device Function Table @ 0x%p\n", desc->iface_fns); in altera_info()
175 fpga->info(desc); in altera_info()