• Home
  • Raw
  • Download

Lines Matching refs:ipa

149 ipa_table_valid_one(struct ipa *ipa, enum ipa_mem_id mem_id, bool route)  in ipa_table_valid_one()  argument
151 const struct ipa_mem *mem = ipa_mem_find(ipa, mem_id); in ipa_table_valid_one()
152 struct device *dev = &ipa->pdev->dev; in ipa_table_valid_one()
160 if (!ipa_cmd_table_valid(ipa, mem, route)) in ipa_table_valid_one()
168 if (ipa_table_hash_support(ipa) && !mem->size) in ipa_table_valid_one()
178 bool ipa_table_valid(struct ipa *ipa) in ipa_table_valid() argument
182 valid = ipa_table_valid_one(ipa, IPA_MEM_V4_FILTER, false); in ipa_table_valid()
183 valid = valid && ipa_table_valid_one(ipa, IPA_MEM_V6_FILTER, false); in ipa_table_valid()
184 valid = valid && ipa_table_valid_one(ipa, IPA_MEM_V4_ROUTE, true); in ipa_table_valid()
185 valid = valid && ipa_table_valid_one(ipa, IPA_MEM_V6_ROUTE, true); in ipa_table_valid()
187 if (!ipa_table_hash_support(ipa)) in ipa_table_valid()
190 valid = valid && ipa_table_valid_one(ipa, IPA_MEM_V4_FILTER_HASHED, in ipa_table_valid()
192 valid = valid && ipa_table_valid_one(ipa, IPA_MEM_V6_FILTER_HASHED, in ipa_table_valid()
194 valid = valid && ipa_table_valid_one(ipa, IPA_MEM_V4_ROUTE_HASHED, in ipa_table_valid()
196 valid = valid && ipa_table_valid_one(ipa, IPA_MEM_V6_ROUTE_HASHED, in ipa_table_valid()
202 bool ipa_filter_map_valid(struct ipa *ipa, u32 filter_map) in ipa_filter_map_valid() argument
204 struct device *dev = &ipa->pdev->dev; in ipa_filter_map_valid()
225 static dma_addr_t ipa_table_addr(struct ipa *ipa, bool filter_mask, u16 count) in ipa_table_addr() argument
237 return ipa->table_addr + skip * sizeof(*ipa->table_virt); in ipa_table_addr()
243 struct ipa *ipa = container_of(trans->gsi, struct ipa, gsi); in ipa_table_reset_add() local
244 const struct ipa_mem *mem = ipa_mem_find(ipa, mem_id); in ipa_table_reset_add()
258 addr = ipa_table_addr(ipa, false, count); in ipa_table_reset_add()
268 ipa_filter_reset_table(struct ipa *ipa, enum ipa_mem_id mem_id, bool modem) in ipa_filter_reset_table() argument
270 u32 ep_mask = ipa->filter_map; in ipa_filter_reset_table()
275 trans = ipa_cmd_trans_alloc(ipa, count); in ipa_filter_reset_table()
277 dev_err(&ipa->pdev->dev, in ipa_filter_reset_table()
290 endpoint = &ipa->endpoint[endpoint_id]; in ipa_filter_reset_table()
306 static int ipa_filter_reset(struct ipa *ipa, bool modem) in ipa_filter_reset() argument
310 ret = ipa_filter_reset_table(ipa, IPA_MEM_V4_FILTER, modem); in ipa_filter_reset()
314 ret = ipa_filter_reset_table(ipa, IPA_MEM_V4_FILTER_HASHED, modem); in ipa_filter_reset()
318 ret = ipa_filter_reset_table(ipa, IPA_MEM_V6_FILTER, modem); in ipa_filter_reset()
321 ret = ipa_filter_reset_table(ipa, IPA_MEM_V6_FILTER_HASHED, modem); in ipa_filter_reset()
330 static int ipa_route_reset(struct ipa *ipa, bool modem) in ipa_route_reset() argument
336 trans = ipa_cmd_trans_alloc(ipa, 4); in ipa_route_reset()
338 dev_err(&ipa->pdev->dev, in ipa_route_reset()
365 void ipa_table_reset(struct ipa *ipa, bool modem) in ipa_table_reset() argument
367 struct device *dev = &ipa->pdev->dev; in ipa_table_reset()
374 ret = ipa_filter_reset(ipa, modem); in ipa_table_reset()
379 ret = ipa_route_reset(ipa, modem); in ipa_table_reset()
385 int ipa_table_hash_flush(struct ipa *ipa) in ipa_table_hash_flush() argument
387 u32 offset = ipa_reg_filt_rout_hash_flush_offset(ipa->version); in ipa_table_hash_flush()
391 if (!ipa_table_hash_support(ipa)) in ipa_table_hash_flush()
394 trans = ipa_cmd_trans_alloc(ipa, 1); in ipa_table_hash_flush()
396 dev_err(&ipa->pdev->dev, "no transaction for hash flush\n"); in ipa_table_hash_flush()
415 struct ipa *ipa = container_of(trans->gsi, struct ipa, gsi); in ipa_table_init_add() local
416 const struct ipa_mem *hash_mem = ipa_mem_find(ipa, hash_mem_id); in ipa_table_init_add()
417 const struct ipa_mem *mem = ipa_mem_find(ipa, mem_id); in ipa_table_init_add()
432 count = 1 + hweight32(ipa->filter_map); in ipa_table_init_add()
441 addr = ipa_table_addr(ipa, filter, count); in ipa_table_init_add()
442 hash_addr = ipa_table_addr(ipa, filter, hash_count); in ipa_table_init_add()
448 int ipa_table_setup(struct ipa *ipa) in ipa_table_setup() argument
452 trans = ipa_cmd_trans_alloc(ipa, 4); in ipa_table_setup()
454 dev_err(&ipa->pdev->dev, "no transaction for table setup\n"); in ipa_table_setup()
490 val = ioread32(endpoint->ipa->reg_virt + offset); in ipa_filter_tuple_zero()
495 iowrite32(val, endpoint->ipa->reg_virt + offset); in ipa_filter_tuple_zero()
499 static void ipa_filter_config(struct ipa *ipa, bool modem) in ipa_filter_config() argument
502 u32 ep_mask = ipa->filter_map; in ipa_filter_config()
504 if (!ipa_table_hash_support(ipa)) in ipa_filter_config()
513 endpoint = &ipa->endpoint[endpoint_id]; in ipa_filter_config()
532 static void ipa_route_tuple_zero(struct ipa *ipa, u32 route_id) in ipa_route_tuple_zero() argument
537 val = ioread32(ipa->reg_virt + offset); in ipa_route_tuple_zero()
542 iowrite32(val, ipa->reg_virt + offset); in ipa_route_tuple_zero()
546 static void ipa_route_config(struct ipa *ipa, bool modem) in ipa_route_config() argument
550 if (!ipa_table_hash_support(ipa)) in ipa_route_config()
555 ipa_route_tuple_zero(ipa, route_id); in ipa_route_config()
559 void ipa_table_config(struct ipa *ipa) in ipa_table_config() argument
561 ipa_filter_config(ipa, false); in ipa_table_config()
562 ipa_filter_config(ipa, true); in ipa_table_config()
563 ipa_route_config(ipa, false); in ipa_table_config()
564 ipa_route_config(ipa, true); in ipa_table_config()
605 int ipa_table_init(struct ipa *ipa) in ipa_table_init() argument
608 struct device *dev = &ipa->pdev->dev; in ipa_table_init()
627 ipa->table_virt = virt; in ipa_table_init()
628 ipa->table_addr = addr; in ipa_table_init()
638 *virt++ = cpu_to_le64((u64)ipa->filter_map << 1); in ipa_table_init()
648 void ipa_table_exit(struct ipa *ipa) in ipa_table_exit() argument
651 struct device *dev = &ipa->pdev->dev; in ipa_table_exit()
656 dma_free_coherent(dev, size, ipa->table_virt, ipa->table_addr); in ipa_table_exit()
657 ipa->table_addr = 0; in ipa_table_exit()
658 ipa->table_virt = NULL; in ipa_table_exit()