Lines Matching refs:mthd
39 shadow_fetch(struct nvkm_bios *bios, struct shadow *mthd, u32 upto) in shadow_fetch() argument
43 void *data = mthd->data; in shadow_fetch()
45 u32 read = mthd->func->read(data, start, limit - start, bios); in shadow_fetch()
52 shadow_image(struct nvkm_bios *bios, int idx, u32 offset, struct shadow *mthd) in shadow_image() argument
58 if (mthd->func->no_pcir) { in shadow_image()
61 image.size = mthd->func->size(mthd->data); in shadow_image()
64 if (!shadow_fetch(bios, mthd, offset + 0x1000)) { in shadow_image()
78 if (!shadow_fetch(bios, mthd, image.base + image.size)) { in shadow_image()
85 if (!mthd->func->ignore_checksum && in shadow_image()
89 if (!mthd->func->require_checksum) { in shadow_image()
90 if (mthd->func->rw) in shadow_image()
105 score += shadow_image(bios, idx + 1, offset + image.size, mthd); in shadow_image()
110 shadow_method(struct nvkm_bios *bios, struct shadow *mthd, const char *name) in shadow_method() argument
112 const struct nvbios_source *func = mthd->func; in shadow_method()
117 mthd->data = func->init(bios, name); in shadow_method()
118 if (IS_ERR(mthd->data)) { in shadow_method()
119 mthd->data = NULL; in shadow_method()
123 mthd->score = shadow_image(bios, 0, 0, mthd); in shadow_method()
125 func->fini(mthd->data); in shadow_method()
126 nvkm_debug(subdev, "scored %d\n", mthd->score); in shadow_method()
127 mthd->data = bios->data; in shadow_method()
128 mthd->size = bios->size; in shadow_method()
132 return mthd->score; in shadow_method()
180 }, *mthd, *best = NULL; in nvbios_shadow() local
190 for (mthd = mthds; mthd->func; mthd++) { in nvbios_shadow()
191 if (mthd->func->name && in nvbios_shadow()
192 !strcasecmp(source, mthd->func->name)) { in nvbios_shadow()
193 best = mthd; in nvbios_shadow()
194 if (shadow_method(bios, mthd, NULL)) in nvbios_shadow()
200 if (!best && (best = mthd)) { in nvbios_shadow()
201 mthd->func = &shadow_fw; in nvbios_shadow()
202 shadow_method(bios, mthd, source); in nvbios_shadow()
203 mthd->func = NULL; in nvbios_shadow()
215 for (mthd = mthds, best = mthd; mthd->func; mthd++) { in nvbios_shadow()
216 if (!mthd->skip || best->score < mthd->skip) { in nvbios_shadow()
217 if (shadow_method(bios, mthd, NULL)) { in nvbios_shadow()
218 if (mthd->score > best->score) in nvbios_shadow()
219 best = mthd; in nvbios_shadow()
226 for (mthd = mthds; mthd->func; mthd++) { in nvbios_shadow()
227 if (mthd != best) in nvbios_shadow()
228 kfree(mthd->data); in nvbios_shadow()