Lines Matching defs:ioat_chan
23 #define to_dev(ioat_chan) (&(ioat_chan)->ioat_dma->pdev->dev)
24 #define to_pdev(ioat_chan) ((ioat_chan)->ioat_dma->pdev)
220 __dump_desc_dbg(struct ioatdma_chan *ioat_chan, struct ioat_dma_descriptor *hw,
223 struct device *dev = to_dev(ioat_chan);
241 static inline u64 ioat_chansts(struct ioatdma_chan *ioat_chan)
243 return readq(ioat_chan->reg_base + IOAT_CHANSTS_OFFSET);
251 static inline u32 ioat_chanerr(struct ioatdma_chan *ioat_chan)
253 return readl(ioat_chan->reg_base + IOAT_CHANERR_OFFSET);
256 static inline void ioat_suspend(struct ioatdma_chan *ioat_chan)
258 u8 ver = ioat_chan->ioat_dma->version;
261 ioat_chan->reg_base + IOAT_CHANCMD_OFFSET(ver));
264 static inline void ioat_reset(struct ioatdma_chan *ioat_chan)
266 u8 ver = ioat_chan->ioat_dma->version;
269 ioat_chan->reg_base + IOAT_CHANCMD_OFFSET(ver));
272 static inline bool ioat_reset_pending(struct ioatdma_chan *ioat_chan)
274 u8 ver = ioat_chan->ioat_dma->version;
277 cmd = readb(ioat_chan->reg_base + IOAT_CHANCMD_OFFSET(ver));
308 static inline u32 ioat_ring_size(struct ioatdma_chan *ioat_chan)
310 return 1 << ioat_chan->alloc_order;
314 static inline u16 ioat_ring_active(struct ioatdma_chan *ioat_chan)
316 return CIRC_CNT(ioat_chan->head, ioat_chan->tail,
317 ioat_ring_size(ioat_chan));
321 static inline u16 ioat_ring_pending(struct ioatdma_chan *ioat_chan)
323 return CIRC_CNT(ioat_chan->head, ioat_chan->issued,
324 ioat_ring_size(ioat_chan));
327 static inline u32 ioat_ring_space(struct ioatdma_chan *ioat_chan)
329 return ioat_ring_size(ioat_chan) - ioat_ring_active(ioat_chan);
333 ioat_xferlen_to_descs(struct ioatdma_chan *ioat_chan, size_t len)
335 u16 num_descs = len >> ioat_chan->xfercap_log;
337 num_descs += !!(len & ((1 << ioat_chan->xfercap_log) - 1));
342 ioat_get_ring_ent(struct ioatdma_chan *ioat_chan, u16 idx)
344 return ioat_chan->ring[idx & (ioat_ring_size(ioat_chan) - 1)];
348 ioat_set_chainaddr(struct ioatdma_chan *ioat_chan, u64 addr)
351 ioat_chan->reg_base + IOAT2_CHAINADDR_OFFSET_LOW);
353 ioat_chan->reg_base + IOAT2_CHAINADDR_OFFSET_HIGH);
390 void ioat_start_null_desc(struct ioatdma_chan *ioat_chan);
392 int ioat_reset_hw(struct ioatdma_chan *ioat_chan);
398 int ioat_check_space_lock(struct ioatdma_chan *ioat_chan, int num_descs);
407 void ioat_stop(struct ioatdma_chan *ioat_chan);