Rename this name to 'mite_ring' to help shorten the long lines.
In the ni_660x driver, also shorten the private data member 'mite_rings'
to simply 'ring'.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
}
EXPORT_SYMBOL_GPL(mite_detach);
-struct mite_dma_descriptor_ring *mite_alloc_ring(struct mite *mite)
+struct mite_ring *mite_alloc_ring(struct mite *mite)
{
- struct mite_dma_descriptor_ring *ring =
- kmalloc(sizeof(struct mite_dma_descriptor_ring), GFP_KERNEL);
+ struct mite_ring *ring;
+ ring = kmalloc(sizeof(*ring), GFP_KERNEL);
if (!ring)
return NULL;
ring->hw_dev = get_device(&mite->pcidev->dev);
};
EXPORT_SYMBOL_GPL(mite_alloc_ring);
-void mite_free_ring(struct mite_dma_descriptor_ring *ring)
+void mite_free_ring(struct mite_ring *ring)
{
if (ring) {
if (ring->descriptors) {
};
EXPORT_SYMBOL_GPL(mite_free_ring);
-struct mite_channel *
-mite_request_channel_in_range(struct mite *mite,
- struct mite_dma_descriptor_ring *ring,
- unsigned int min_channel,
- unsigned int max_channel)
+struct mite_channel *mite_request_channel_in_range(struct mite *mite,
+ struct mite_ring *ring,
+ unsigned int min_channel,
+ unsigned int max_channel)
{
int i;
unsigned long flags;
/**************************************/
-int mite_buf_change(struct mite_dma_descriptor_ring *ring,
+int mite_buf_change(struct mite_ring *ring,
struct comedi_subdevice *s)
{
struct comedi_async *async = s->async;
* DMA data buffer. A command may call this function later to re-initialize and
* shorten the amount of memory that will be transferred.
*/
-int mite_init_ring_descriptors(struct mite_dma_descriptor_ring *ring,
+int mite_init_ring_descriptors(struct mite_ring *ring,
struct comedi_subdevice *s,
unsigned int nbytes)
{
u32 dar;
};
-struct mite_dma_descriptor_ring {
+struct mite_ring {
struct device *hw_dev;
unsigned int n_links;
struct mite_dma_desc *descriptors;
unsigned int channel;
int dir;
int done;
- struct mite_dma_descriptor_ring *ring;
+ struct mite_ring *ring;
};
struct mite {
}
void mite_detach(struct mite *);
-struct mite_dma_descriptor_ring *mite_alloc_ring(struct mite *);
-void mite_free_ring(struct mite_dma_descriptor_ring *ring);
-struct mite_channel *
-mite_request_channel_in_range(struct mite *,
- struct mite_dma_descriptor_ring *ring,
- unsigned int min_channel,
- unsigned int max_channel);
-static inline struct mite_channel *
-mite_request_channel(struct mite *mite,
- struct mite_dma_descriptor_ring *ring)
+struct mite_ring *mite_alloc_ring(struct mite *);
+void mite_free_ring(struct mite_ring *ring);
+struct mite_channel *mite_request_channel_in_range(struct mite *,
+ struct mite_ring *,
+ unsigned int min_channel,
+ unsigned int max_channel);
+
+static inline struct mite_channel *mite_request_channel(struct mite *mite,
+ struct mite_ring *ring)
{
return mite_request_channel_in_range(mite, ring, 0,
mite->num_channels - 1);
void mite_prep_dma(struct mite_channel *mite_chan,
unsigned int num_device_bits, unsigned int num_memory_bits);
-int mite_buf_change(struct mite_dma_descriptor_ring *ring,
- struct comedi_subdevice *s);
-int mite_init_ring_descriptors(struct mite_dma_descriptor_ring *ring,
- struct comedi_subdevice *s,
+int mite_buf_change(struct mite_ring *, struct comedi_subdevice *);
+int mite_init_ring_descriptors(struct mite_ring *, struct comedi_subdevice *,
unsigned int nbytes);
/*
struct ni_660x_private {
struct mite *mite;
struct ni_gpct_device *counter_dev;
- struct mite_dma_descriptor_ring
- *mite_rings[NI660X_MAX_CHIPS][NI660X_COUNTERS_PER_CHIP];
+ struct mite_ring *ring[NI660X_MAX_CHIPS][NI660X_COUNTERS_PER_CHIP];
/* protects mite channel request/release */
spinlock_t mite_channel_lock;
/* prevents races between interrupt and comedi_poll */
enum comedi_io_direction direction)
{
struct ni_660x_private *devpriv = dev->private;
- struct mite_dma_descriptor_ring *ring;
+ struct mite_ring *ring;
struct mite_channel *mite_chan;
unsigned long flags;
spin_lock_irqsave(&devpriv->mite_channel_lock, flags);
- ring = devpriv->mite_rings[counter->chip_index][counter->counter_index];
+ ring = devpriv->ring[counter->chip_index][counter->counter_index];
mite_chan = mite_request_channel(devpriv->mite, ring);
if (!mite_chan) {
spin_unlock_irqrestore(&devpriv->mite_channel_lock, flags);
{
struct ni_660x_private *devpriv = dev->private;
struct ni_gpct *counter = s->private;
- struct mite_dma_descriptor_ring *ring;
+ struct mite_ring *ring;
int ret;
- ring = devpriv->mite_rings[counter->chip_index][counter->counter_index];
+ ring = devpriv->ring[counter->chip_index][counter->counter_index];
ret = mite_buf_change(ring, s);
if (ret < 0)
return ret;
for (i = 0; i < board->n_chips; ++i) {
for (j = 0; j < NI660X_COUNTERS_PER_CHIP; ++j) {
- devpriv->mite_rings[i][j] =
- mite_alloc_ring(devpriv->mite);
- if (!devpriv->mite_rings[i][j])
+ devpriv->ring[i][j] = mite_alloc_ring(devpriv->mite);
+ if (!devpriv->ring[i][j])
return -ENOMEM;
}
}
for (i = 0; i < board->n_chips; ++i) {
for (j = 0; j < NI660X_COUNTERS_PER_CHIP; ++j)
- mite_free_ring(devpriv->mite_rings[i][j]);
+ mite_free_ring(devpriv->ring[i][j]);
}
}
return devpriv->clock_ns * (timer + 1);
}
-static void ni_cmd_set_mite_transfer(struct mite_dma_descriptor_ring *ring,
+static void ni_cmd_set_mite_transfer(struct mite_ring *ring,
struct comedi_subdevice *sdev,
const struct comedi_cmd *cmd,
unsigned int max_count) {
int dio;
unsigned short OpModeBits;
struct mite_channel *di_mite_chan;
- struct mite_dma_descriptor_ring *di_mite_ring;
+ struct mite_ring *di_mite_ring;
spinlock_t mite_channel_lock;
};
struct mite_channel *ai_mite_chan;
struct mite_channel *ao_mite_chan;
struct mite_channel *cdo_mite_chan;
- struct mite_dma_descriptor_ring *ai_mite_ring;
- struct mite_dma_descriptor_ring *ao_mite_ring;
- struct mite_dma_descriptor_ring *cdo_mite_ring;
- struct mite_dma_descriptor_ring *gpct_mite_ring[NUM_GPCT];
+ struct mite_ring *ai_mite_ring;
+ struct mite_ring *ao_mite_ring;
+ struct mite_ring *cdo_mite_ring;
+ struct mite_ring *gpct_mite_ring[NUM_GPCT];
/* ni_pcimio board type flags (based on the boardinfo reg_type) */
unsigned int is_m_series:1;