rwlock_t lock;
};
------static LIST_HEAD(dmabounce_devs);
------
#ifdef STATS
------static void print_alloc_stats(struct dmabounce_device_info *device_info)
++++++static ssize_t dmabounce_show(struct device *dev, struct device_attribute *attr,
++++++ char *buf)
{
------ printk(KERN_INFO
------ "%s: dmabounce: sbp: %lu, lbp: %lu, other: %lu, total: %lu\n",
------ device_info->dev->bus_id,
------ device_info->small.allocs, device_info->large.allocs,
++++++ struct dmabounce_device_info *device_info = dev->archdata.dmabounce;
++++++ return sprintf(buf, "%lu %lu %lu %lu %lu %lu\n",
++++++ device_info->small.allocs,
++++++ device_info->large.allocs,
device_info->total_allocs - device_info->small.allocs -
device_info->large.allocs,
------ device_info->total_allocs);
++++++ device_info->total_allocs,
++++++ device_info->map_op_count,
++++++ device_info->bounce_count);
}
------#endif
---- -
---- -/* find the given device in the dmabounce device list */
---- -static inline struct dmabounce_device_info *
---- -find_dmabounce_dev(struct device *dev)
---- -{
---- - struct dmabounce_device_info *d;
- /* find the given device in the dmabounce device list */
- static inline struct dmabounce_device_info *
- find_dmabounce_dev(struct device *dev)
- {
- struct dmabounce_device_info *d;
-
------ list_for_each_entry(d, &dmabounce_devs, node)
------ if (d->dev == dev)
------ return d;
------
------ return NULL;
------}
++++++static DEVICE_ATTR(dmabounce_stats, 0400, dmabounce_show, NULL);
++++++#endif
/* allocate a 'safe' buffer and keep track of it */