• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/pci/

Lines Matching defs:iova

20 #include <linux/iova.h>
39 struct iova *curr_iova =
40 container_of(iovad->cached32_node, struct iova, node);
48 unsigned long limit_pfn, struct iova *new)
56 __cached_rbnode_delete_update(struct iova_domain *iovad, struct iova *free)
58 struct iova *cached_iova;
64 cached_iova = container_of(curr, struct iova, node);
87 struct iova *new, bool size_aligned)
100 struct iova *curr_iova = container_of(curr, struct iova, node);
146 struct iova *this = container_of(*entry,
147 struct iova, node);
171 iova_insert_rbtree(struct rb_root *root, struct iova *iova)
176 struct iova *this = container_of(*new, struct iova, node);
179 if (iova->pfn_lo < this->pfn_lo)
181 else if (iova->pfn_lo > this->pfn_lo)
187 rb_link_node(&iova->node, parent, new);
188 rb_insert_color(&iova->node, root);
192 * alloc_iova - allocates an iova
193 * @iovad - iova domain in question
197 * This function allocates an iova in the range limit_pfn to IOVA_START_PFN
199 * flag is set then the allocated address iova->pfn_lo will be naturally
202 struct iova *
207 struct iova *new_iova;
232 * find_iova - find's an iova for a given pfn
233 * @iovad - iova domain in question.
235 * This function finds and returns an iova belonging to the
238 struct iova *find_iova(struct iova_domain *iovad, unsigned long pfn)
247 struct iova *iova = container_of(node, struct iova, node);
249 /* If pfn falls within iova's range, return iova */
250 if ((pfn >= iova->pfn_lo) && (pfn <= iova->pfn_hi)) {
252 /* We are not holding the lock while this iova
256 * reference a particular iova and hence no conflict.
258 return iova;
261 if (pfn < iova->pfn_lo)
263 else if (pfn > iova->pfn_lo)
272 * __free_iova - frees the given iova
273 * @iovad: iova domain in question.
274 * @iova: iova in question.
275 * Frees the given iova belonging to the giving domain
278 __free_iova(struct iova_domain *iovad, struct iova *iova)
283 __cached_rbnode_delete_update(iovad, iova);
284 rb_erase(&iova->node, &iovad->rbroot);
286 free_iova_mem(iova);
290 * free_iova - finds and frees the iova for a given pfn
291 * @iovad: - iova domain in question.
293 * This functions finds an iova for a given pfn and then
294 * frees the iova from that domain.
299 struct iova *iova = find_iova(iovad, pfn);
300 if (iova)
301 __free_iova(iovad, iova);
306 * put_iova_domain - destroys the iova doamin
307 * @iovad: - iova domain in question.
308 * All the iova's in that domain are destroyed.
318 struct iova *iova = container_of(node, struct iova, node);
320 free_iova_mem(iova);
330 struct iova *iova = container_of(node, struct iova, node);
332 if ((pfn_lo <= iova->pfn_hi) && (pfn_hi >= iova->pfn_lo))
337 static struct iova *
341 struct iova *iova;
343 iova = alloc_iova_mem();
344 if (!iova)
345 return iova;
347 iova->pfn_hi = pfn_hi;
348 iova->pfn_lo = pfn_lo;
349 iova_insert_rbtree(&iovad->rbroot, iova);
350 return iova;
354 __adjust_overlap_range(struct iova *iova,
357 if (*pfn_lo < iova->pfn_lo)
358 iova->pfn_lo = *pfn_lo;
359 if (*pfn_hi > iova->pfn_hi)
360 *pfn_lo = iova->pfn_hi + 1;
364 * reserve_iova - reserves an iova in the given range
365 * @iovad: - iova domain pointer
371 struct iova *
377 struct iova *iova;
383 iova = container_of(node, struct iova, node);
384 __adjust_overlap_range(iova, &pfn_lo, &pfn_hi);
385 if ((pfn_lo >= iova->pfn_lo) &&
386 (pfn_hi <= iova->pfn_hi))
397 iova = __insert_new_range(iovad, pfn_lo, pfn_hi);
401 return iova;
408 * This function copies reserved iova's from one doamin to
419 struct iova *iova = container_of(node, struct iova, node);
420 struct iova *new_iova;
421 new_iova = reserve_iova(to, iova->pfn_lo, iova->pfn_hi);
423 printk(KERN_ERR "Reserve iova range %lx@%lx failed\n",
424 iova->pfn_lo, iova->pfn_lo);