EXPORT_SYMBOL(drm_get_resource_len);
 
 static struct drm_map_list *drm_find_matching_map(struct drm_device *dev,
-                                            drm_local_map_t *map)
+                                                 struct drm_local_map *map)
 {
        struct drm_map_list *entry;
        list_for_each_entry(entry, &dev->maplist, head) {
 }
 
 /**
- * Ioctl to specify a range of memory that is available for mapping by a non-root process.
- *
- * \param inode device inode.
- * \param file_priv DRM file private.
- * \param cmd command.
- * \param arg pointer to a drm_map structure.
- * \return zero on success or a negative value on error.
+ * Core function to create a range of memory available for mapping by a
+ * non-root process.
  *
  * Adjusts the memory offset to its absolute value according to the mapping
  * type.  Adds the map to the map list drm_device::maplist. Adds MTRR's where
                           enum drm_map_flags flags,
                           struct drm_map_list ** maplist)
 {
-       struct drm_map *map;
+       struct drm_local_map *map;
        struct drm_map_list *list;
        drm_dma_handle_t *dmah;
        unsigned long user_token;
 
 int drm_addmap(struct drm_device * dev, unsigned int offset,
               unsigned int size, enum drm_map_type type,
-              enum drm_map_flags flags, drm_local_map_t ** map_ptr)
+              enum drm_map_flags flags, struct drm_local_map ** map_ptr)
 {
        struct drm_map_list *list;
        int rc;
 
 EXPORT_SYMBOL(drm_addmap);
 
+/**
+ * Ioctl to specify a range of memory that is available for mapping by a
+ * non-root process.
+ *
+ * \param inode device inode.
+ * \param file_priv DRM file private.
+ * \param cmd command.
+ * \param arg pointer to a drm_map structure.
+ * \return zero on success or a negative value on error.
+ *
+ */
 int drm_addmap_ioctl(struct drm_device *dev, void *data,
                     struct drm_file *file_priv)
 {
  * Remove a map private from list and deallocate resources if the mapping
  * isn't in use.
  *
- * \param inode device inode.
- * \param file_priv DRM file private.
- * \param cmd command.
- * \param arg pointer to a struct drm_map structure.
- * \return zero on success or a negative value on error.
- *
  * Searches the map on drm_device::maplist, removes it from the list, see if
  * its being used, and free any associate resource (such as MTRR's) if it's not
  * being on use.
  *
  * \sa drm_addmap
  */
-int drm_rmmap_locked(struct drm_device *dev, drm_local_map_t *map)
+int drm_rmmap_locked(struct drm_device *dev, struct drm_local_map *map)
 {
        struct drm_map_list *r_list = NULL, *list_t;
        drm_dma_handle_t dmah;
 }
 EXPORT_SYMBOL(drm_rmmap_locked);
 
-int drm_rmmap(struct drm_device *dev, drm_local_map_t *map)
+int drm_rmmap(struct drm_device *dev, struct drm_local_map *map)
 {
        int ret;
 
  * One use case might be after addmap is allowed for normal users for SHM and
  * gets used by drivers that the server doesn't need to care about.  This seems
  * unlikely.
+ *
+ * \param inode device inode.
+ * \param file_priv DRM file private.
+ * \param cmd command.
+ * \param arg pointer to a struct drm_map structure.
+ * \return zero on success or a negative value on error.
  */
 int drm_rmmap_ioctl(struct drm_device *dev, void *data,
                    struct drm_file *file_priv)
 {
        struct drm_map *request = data;
-       drm_local_map_t *map = NULL;
+       struct drm_local_map *map = NULL;
        struct drm_map_list *r_list;
        int ret;
 
                        && (dma->flags & _DRM_DMA_USE_SG))
                    || (drm_core_check_feature(dev, DRIVER_FB_DMA)
                        && (dma->flags & _DRM_DMA_USE_FB))) {
-                       struct drm_map *map = dev->agp_buffer_map;
+                       struct drm_local_map *map = dev->agp_buffer_map;
                        unsigned long token = dev->agp_buffer_token;
 
                        if (!map) {
 
                    struct drm_file *file_priv)
 {
        struct drm_ctx_priv_map *request = data;
-       struct drm_map *map;
+       struct drm_local_map *map;
        struct drm_map_list *_entry;
 
        mutex_lock(&dev->struct_mutex);
                    struct drm_file *file_priv)
 {
        struct drm_ctx_priv_map *request = data;
-       struct drm_map *map = NULL;
+       struct drm_local_map *map = NULL;
        struct drm_map_list *r_list = NULL;
 
        mutex_lock(&dev->struct_mutex);
 
 
 EXPORT_SYMBOL(drm_ioctl);
 
-drm_local_map_t *drm_getsarea(struct drm_device *dev)
+struct drm_local_map *drm_getsarea(struct drm_device *dev)
 {
        struct drm_map_list *entry;
 
 
        struct drm_file *priv = filp->private_data;
        struct drm_device *dev = priv->minor->dev;
        struct drm_gem_mm *mm = dev->mm_private;
-       struct drm_map *map = NULL;
+       struct drm_local_map *map = NULL;
        struct drm_gem_object *obj;
        struct drm_hash_item *hash;
        unsigned long prot;
 
 
 #endif                         /* debug_memory */
 
-void drm_core_ioremap(struct drm_map *map, struct drm_device *dev)
+void drm_core_ioremap(struct drm_local_map *map, struct drm_device *dev)
 {
        if (drm_core_has_AGP(dev) &&
            dev->agp && dev->agp->cant_use_aperture && map->type == _DRM_AGP)
 }
 EXPORT_SYMBOL(drm_core_ioremap);
 
-void drm_core_ioremap_wc(struct drm_map *map, struct drm_device *dev)
+void drm_core_ioremap_wc(struct drm_local_map *map, struct drm_device *dev)
 {
        if (drm_core_has_AGP(dev) &&
            dev->agp && dev->agp->cant_use_aperture && map->type == _DRM_AGP)
 }
 EXPORT_SYMBOL(drm_core_ioremap_wc);
 
-void drm_core_ioremapfree(struct drm_map *map, struct drm_device *dev)
+void drm_core_ioremapfree(struct drm_local_map *map, struct drm_device *dev)
 {
        if (!map->handle || !map->size)
                return;
 
        struct drm_minor *minor = (struct drm_minor *) data;
        struct drm_device *dev = minor->dev;
        int len = 0;
-       struct drm_map *map;
+       struct drm_local_map *map;
        struct drm_map_list *r_list;
 
        /* Hardcoded from _DRM_FRAME_BUFFER,
 
 {
        struct drm_file *priv = vma->vm_file->private_data;
        struct drm_device *dev = priv->minor->dev;
-       struct drm_map *map = NULL;
+       struct drm_local_map *map = NULL;
        struct drm_map_list *r_list;
        struct drm_hash_item *hash;
 
  */
 static int drm_do_vm_shm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
 {
-       struct drm_map *map = (struct drm_map *) vma->vm_private_data;
+       struct drm_local_map *map = vma->vm_private_data;
        unsigned long offset;
        unsigned long i;
        struct page *page;
        struct drm_file *priv = vma->vm_file->private_data;
        struct drm_device *dev = priv->minor->dev;
        struct drm_vma_entry *pt, *temp;
-       struct drm_map *map;
+       struct drm_local_map *map;
        struct drm_map_list *r_list;
        int found_maps = 0;
 
  */
 static int drm_do_vm_sg_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
 {
-       struct drm_map *map = (struct drm_map *) vma->vm_private_data;
+       struct drm_local_map *map = vma->vm_private_data;
        struct drm_file *priv = vma->vm_file->private_data;
        struct drm_device *dev = priv->minor->dev;
        struct drm_sg_mem *entry = dev->sg;
        return 0;
 }
 
-unsigned long drm_core_get_map_ofs(struct drm_map * map)
+unsigned long drm_core_get_map_ofs(struct drm_local_map * map)
 {
        return map->offset;
 }
 {
        struct drm_file *priv = filp->private_data;
        struct drm_device *dev = priv->minor->dev;
-       struct drm_map *map = NULL;
+       struct drm_local_map *map = NULL;
        unsigned long offset = 0;
        struct drm_hash_item *hash;
 
 
 } drm_i810_ring_buffer_t;
 
 typedef struct drm_i810_private {
-       struct drm_map *sarea_map;
-       struct drm_map *mmio_map;
+       struct drm_local_map *sarea_map;
+       struct drm_local_map *mmio_map;
 
        drm_i810_sarea_t *sarea_priv;
        drm_i810_ring_buffer_t ring;
 
 } drm_i830_ring_buffer_t;
 
 typedef struct drm_i830_private {
-       struct drm_map *sarea_map;
-       struct drm_map *mmio_map;
+       struct drm_local_map *sarea_map;
+       struct drm_local_map *mmio_map;
 
        drm_i830_sarea_t *sarea_priv;
        drm_i830_ring_buffer_t ring;
 
        struct drm_gem_mm *mm = dev->mm_private;
        struct drm_i915_gem_object *obj_priv = obj->driver_private;
        struct drm_map_list *list;
-       struct drm_map *map;
+       struct drm_local_map *map;
        int ret = 0;
 
        /* Set the object up for mmap'ing */
 
 };
 
 
+/**
+ * Kernel side of a mapping
+ */
+struct drm_local_map {
+       unsigned long offset;    /**< Requested physical address (0 for SAREA)*/
+       unsigned long size;      /**< Requested physical size (bytes) */
+       enum drm_map_type type;  /**< Type of memory to map */
+       enum drm_map_flags flags;        /**< Flags */
+       void *handle;            /**< User-space: "Handle" to pass to mmap() */
+                                /**< Kernel-space: kernel-virtual address */
+       int mtrr;                /**< MTRR slot used */
+};
+
+typedef struct drm_local_map drm_local_map_t;
+
 /**
  * Mappings list
  */
 struct drm_map_list {
        struct list_head head;          /**< list head */
        struct drm_hash_item hash;
-       struct drm_map *map;                    /**< mapping */
+       struct drm_local_map *map;      /**< mapping */
        uint64_t user_token;
        struct drm_master *master;
        struct drm_mm_node *file_offset_node;   /**< fake offset */
 };
 
-typedef struct drm_map drm_local_map_t;
-
 /**
  * Context handle list
  */
        dma_addr_t bus_addr;
        dma_addr_t table_mask;
        struct drm_dma_handle *table_handle;
-       drm_local_map_t mapping;
+       struct drm_local_map mapping;
        int table_size;
 };
 
                                        struct drm_file *file_priv);
        void (*reclaim_buffers_idlelocked) (struct drm_device *dev,
                                            struct drm_file *file_priv);
-       unsigned long (*get_map_ofs) (struct drm_map * map);
+       unsigned long (*get_map_ofs) (struct drm_local_map * map);
        unsigned long (*get_reg_ofs) (struct drm_device *dev);
        void (*set_version) (struct drm_device *dev,
                             struct drm_set_version *sv);
        sigset_t sigmask;
 
        struct drm_driver *driver;
-       drm_local_map_t *agp_buffer_map;
+       struct drm_local_map *agp_buffer_map;
        unsigned int agp_buffer_token;
        struct drm_minor *control;              /**< Control node for card */
        struct drm_minor *primary;              /**< render type primary screen head */
 extern int drm_mmap(struct file *filp, struct vm_area_struct *vma);
 extern int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma);
 extern void drm_vm_open_locked(struct vm_area_struct *vma);
-extern unsigned long drm_core_get_map_ofs(struct drm_map * map);
+extern unsigned long drm_core_get_map_ofs(struct drm_local_map * map);
 extern unsigned long drm_core_get_reg_ofs(struct drm_device *dev);
 extern unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait);
 
 extern int drm_addbufs_pci(struct drm_device *dev, struct drm_buf_desc * request);
 extern int drm_addmap(struct drm_device *dev, unsigned int offset,
                      unsigned int size, enum drm_map_type type,
-                     enum drm_map_flags flags, drm_local_map_t ** map_ptr);
+                     enum drm_map_flags flags, struct drm_local_map **map_ptr);
 extern int drm_addmap_ioctl(struct drm_device *dev, void *data,
                            struct drm_file *file_priv);
-extern int drm_rmmap(struct drm_device *dev, drm_local_map_t *map);
-extern int drm_rmmap_locked(struct drm_device *dev, drm_local_map_t *map);
+extern int drm_rmmap(struct drm_device *dev, struct drm_local_map *map);
+extern int drm_rmmap_locked(struct drm_device *dev, struct drm_local_map *map);
 extern int drm_rmmap_ioctl(struct drm_device *dev, void *data,
                           struct drm_file *file_priv);
 extern int drm_addbufs(struct drm_device *dev, void *data,
 
 extern struct idr drm_minors_idr;
 
-extern drm_local_map_t *drm_getsarea(struct drm_device *dev);
+extern struct drm_local_map *drm_getsarea(struct drm_device *dev);
 
                                /* Proc support (drm_proc.h) */
 extern int drm_proc_init(struct drm_minor *minor, int minor_id,
 void drm_gem_open(struct drm_device *dev, struct drm_file *file_private);
 void drm_gem_release(struct drm_device *dev, struct drm_file *file_private);
 
-extern void drm_core_ioremap(struct drm_map *map, struct drm_device *dev);
-extern void drm_core_ioremap_wc(struct drm_map *map, struct drm_device *dev);
-extern void drm_core_ioremapfree(struct drm_map *map, struct drm_device *dev);
+extern void drm_core_ioremap(struct drm_local_map *map, struct drm_device *dev);
+extern void drm_core_ioremap_wc(struct drm_local_map *map, struct drm_device *dev);
+extern void drm_core_ioremapfree(struct drm_local_map *map, struct drm_device *dev);
 
-static __inline__ struct drm_map *drm_core_findmap(struct drm_device *dev,
-                                                  unsigned int token)
+static __inline__ struct drm_local_map *drm_core_findmap(struct drm_device *dev,
+                                                        unsigned int token)
 {
        struct drm_map_list *_entry;
        list_for_each_entry(_entry, &dev->maplist, head)
        return pci_find_capability(dev->pdev, PCI_CAP_ID_EXP);
 }
 
-static __inline__ void drm_core_dropmap(struct drm_map *map)
+static __inline__ void drm_core_dropmap(struct drm_local_map *map)
 {
 }