@@ -568,6 +568,7 @@ struct device_dma_parameters {
* sg limitations.
*/
unsigned int max_segment_size;
+ unsigned int max_segment_count; /* zero for unlimited */
unsigned long segment_boundary_mask;
};
@@ -111,6 +111,22 @@ static inline unsigned int dma_set_max_seg_size(struct device *dev,
return -EIO;
}
+static inline unsigned int dma_get_max_seg_count(struct device *dev)
+{
+ return dev->dma_parms ? dev->dma_parms->max_segment_count : 0;
+}
+
+static inline int dma_set_max_seg_count(struct device *dev,
+ unsigned int count)
+{
+ if (dev->dma_parms) {
+ dev->dma_parms->max_segment_count = count;
+ return 0;
+ } else
+ return -EIO;
+}
+
+
static inline unsigned long dma_get_seg_boundary(struct device *dev)
{
return dev->dma_parms ?