Lines Matching refs:pdr

75 struct pdr {  struct
110 pdr_id(const struct pdr *pdr) in pdr_id() argument
112 return le32_to_cpu(pdr->id); in pdr_id()
116 pdr_addr(const struct pdr *pdr) in pdr_addr() argument
118 return le32_to_cpu(pdr->addr); in pdr_addr()
122 pdr_len(const struct pdr *pdr) in pdr_len() argument
124 return le32_to_cpu(pdr->len); in pdr_len()
148 static const struct pdr *
149 hermes_find_pdr(const struct pdr *first_pdr, u32 record_id, const void *end) in hermes_find_pdr()
151 const struct pdr *pdr = first_pdr; in hermes_find_pdr() local
153 end -= sizeof(struct pdr); in hermes_find_pdr()
155 while (((void *) pdr <= end) && in hermes_find_pdr()
156 (pdr_id(pdr) != PDI_END)) { in hermes_find_pdr()
162 if (pdr_len(pdr) < 2) in hermes_find_pdr()
166 if (pdr_id(pdr) == record_id) in hermes_find_pdr()
167 return pdr; in hermes_find_pdr()
169 pdr = (struct pdr *) pdr->next; in hermes_find_pdr()
196 hermes_plug_pdi(struct hermes *hw, const struct pdr *first_pdr, in hermes_plug_pdi()
199 const struct pdr *pdr; in hermes_plug_pdi() local
202 pdr = hermes_find_pdr(first_pdr, pdi_id(pdi), pdr_end); in hermes_plug_pdi()
205 if (!pdr) in hermes_plug_pdi()
209 if (pdi_len(pdi) != pdr_len(pdr)) in hermes_plug_pdi()
213 hw->ops->program(hw, pdi->data, pdr_addr(pdr), pdi_len(pdi)); in hermes_plug_pdi()
231 const struct pdr *pdr; in hermes_apply_pda() local
233 pdr = (const struct pdr *) first_pdr; in hermes_apply_pda()
240 ret = hermes_plug_pdi(hw, pdr, pdi, pdr_end); in hermes_apply_pda()
396 const struct pdr *pdr = (const struct pdr *) first_pdr; in hermes_apply_pda_with_defaults() local
403 pdr_end -= sizeof(struct pdr); in hermes_apply_pda_with_defaults()
405 while (((void *) pdr <= pdr_end) && in hermes_apply_pda_with_defaults()
406 (pdr_id(pdr) != PDI_END)) { in hermes_apply_pda_with_defaults()
413 if (pdr_len(pdr) < 2) in hermes_apply_pda_with_defaults()
415 record_id = pdr_id(pdr); in hermes_apply_pda_with_defaults()
466 if ((pdi_len(pdi) == pdr_len(pdr)) && in hermes_apply_pda_with_defaults()
469 hw->ops->program(hw, pdi->data, pdr_addr(pdr), in hermes_apply_pda_with_defaults()
474 pdr++; in hermes_apply_pda_with_defaults()