Lines Matching defs:offset
79 __le16 offset;
192 if (mem->offset > offset_max ||
193 ipa->mem_offset > offset_max - mem->offset) {
194 dev_err(dev, "%s table region offset too large\n", table);
196 ipa->mem_offset, mem->offset, offset_max);
211 u32 offset;
214 /* In ipa_cmd_hdr_init_local_add() we record the offset and size of
216 * the offset and size fit in the fields that need to hold them, and
226 offset = mem->offset;
229 /* Make sure the offset fits in the IPA command */
230 if (offset > offset_max || ipa->mem_offset > offset_max - offset) {
231 dev_err(dev, "header table region offset too large\n");
233 ipa->mem_offset, offset, offset_max);
254 /* Indicate whether an offset can be used with a register_write command */
256 const char *name, u32 offset)
263 /* The maximum offset in a register_write immediate command depends
264 * on the version of IPA. A 16 bit offset is always supported,
268 bit_count = BITS_PER_BYTE * sizeof(payload->offset);
274 /* Make sure the offset can be represented by the field(s)
275 * that holds it. Also make sure the offset is not outside
278 if (offset > offset_max || ipa->mem_offset > offset_max - offset) {
279 dev_err(dev, "%s offset too large 0x%04x + 0x%04x > 0x%04x)\n",
280 name, ipa->mem_offset, offset, offset_max);
292 u32 offset;
295 * offset will fit in a register write IPA immediate command.
303 offset = reg_offset(reg);
305 if (!ipa_cmd_register_write_offset_valid(ipa, name, offset))
313 * worst case (highest endpoint number) offset of that endpoint
317 offset = reg_n_offset(reg, IPA_ENDPOINT_COUNT - 1);
319 if (!ipa_cmd_register_write_offset_valid(ipa, name, offset))
361 enum ipa_cmd_opcode opcode, u16 size, u32 offset,
371 /* Record the non-hash table offset and size */
372 offset += ipa->mem_offset;
373 val = u64_encode_bits(offset, IP_FLTRT_FLAGS_NHASH_ADDR_FMASK);
376 /* The hash table offset and address are zero if its size is 0 */
378 /* Record the hash table offset and size */
400 void ipa_cmd_hdr_init_local_add(struct gsi_trans *trans, u32 offset, u16 size,
410 offset += ipa->mem_offset;
422 flags |= u32_encode_bits(offset, HDR_INIT_LOCAL_FLAGS_HDR_ADDR_FMASK);
429 void ipa_cmd_register_write_add(struct gsi_trans *trans, u32 offset, u32 value,
445 * also supports a larger offset by encoding additional high-order
458 /* Extract the high 4 bits from the offset */
459 offset_high = (u16)u32_get_bits(offset, GENMASK(19, 16));
460 offset &= (1 << 16) - 1;
477 payload->offset = cpu_to_le16((u16)offset);
511 void ipa_cmd_dma_shared_mem_add(struct gsi_trans *trans, u32 offset, u16 size,
521 /* size and offset must fit in 16 bit fields */
524 WARN_ON(offset > U16_MAX || ipa->mem_offset > U16_MAX - offset);
526 offset += ipa->mem_offset;
535 payload->local_addr = cpu_to_le16(offset);