Lines Matching refs:desc

229 	struct rswitch_ext_ts_desc *desc = &gq->rx_ring[gq->dirty];  in rswitch_is_queue_rxed()  local
231 if ((desc->desc.die_dt & DT_MASK) != DT_FEMPTY) in rswitch_is_queue_rxed()
352 static void rswitch_desc_set_dptr(struct rswitch_desc *desc, dma_addr_t addr) in rswitch_desc_set_dptr() argument
354 desc->dptrl = cpu_to_le32(lower_32_bits(addr)); in rswitch_desc_set_dptr()
355 desc->dptrh = upper_32_bits(addr) & 0xff; in rswitch_desc_set_dptr()
358 static dma_addr_t rswitch_desc_get_dptr(const struct rswitch_desc *desc) in rswitch_desc_get_dptr() argument
360 return __le32_to_cpu(desc->dptrl) | (u64)(desc->dptrh) << 32; in rswitch_desc_get_dptr()
368 struct rswitch_ext_desc *desc; in rswitch_gwca_queue_format() local
374 for (i = 0, desc = gq->tx_ring; i < gq->ring_size; i++, desc++) { in rswitch_gwca_queue_format()
383 desc->desc.info_ds = cpu_to_le16(RSWITCH_DESC_BUF_SIZE); in rswitch_gwca_queue_format()
384 rswitch_desc_set_dptr(&desc->desc, dma_addr); in rswitch_gwca_queue_format()
385 desc->desc.die_dt = DT_FEMPTY | DIE; in rswitch_gwca_queue_format()
387 desc->desc.die_dt = DT_EEMPTY | DIE; in rswitch_gwca_queue_format()
390 rswitch_desc_set_dptr(&desc->desc, gq->ring_dma); in rswitch_gwca_queue_format()
391 desc->desc.die_dt = DT_LINKFIX; in rswitch_gwca_queue_format()
404 for (desc = gq->tx_ring; i-- > 0; desc++) { in rswitch_gwca_queue_format()
405 dma_addr = rswitch_desc_get_dptr(&desc->desc); in rswitch_gwca_queue_format()
419 struct rswitch_ts_desc *desc; in rswitch_gwca_ts_queue_fill() local
424 desc = &gq->ts_ring[index]; in rswitch_gwca_ts_queue_fill()
425 desc->desc.die_dt = DT_FEMPTY_ND | DIE; in rswitch_gwca_ts_queue_fill()
435 struct rswitch_ext_ts_desc *desc; in rswitch_gwca_queue_ext_ts_fill() local
441 desc = &gq->rx_ring[index]; in rswitch_gwca_queue_ext_ts_fill()
450 desc->desc.info_ds = cpu_to_le16(RSWITCH_DESC_BUF_SIZE); in rswitch_gwca_queue_ext_ts_fill()
451 rswitch_desc_set_dptr(&desc->desc, dma_addr); in rswitch_gwca_queue_ext_ts_fill()
453 desc->desc.die_dt = DT_FEMPTY | DIE; in rswitch_gwca_queue_ext_ts_fill()
454 desc->info1 = cpu_to_le64(INFO1_SPN(rdev->etha->index)); in rswitch_gwca_queue_ext_ts_fill()
456 desc->desc.die_dt = DT_EEMPTY | DIE; in rswitch_gwca_queue_ext_ts_fill()
466 desc = &gq->rx_ring[index]; in rswitch_gwca_queue_ext_ts_fill()
467 dma_addr = rswitch_desc_get_dptr(&desc->desc); in rswitch_gwca_queue_ext_ts_fill()
481 struct rswitch_ext_ts_desc *desc; in rswitch_gwca_queue_ext_ts_format() local
490 desc = &gq->rx_ring[gq->ring_size]; /* Last */ in rswitch_gwca_queue_ext_ts_format()
491 rswitch_desc_set_dptr(&desc->desc, gq->ring_dma); in rswitch_gwca_queue_ext_ts_format()
492 desc->desc.die_dt = DT_LINKFIX; in rswitch_gwca_queue_ext_ts_format()
535 struct rswitch_ts_desc *desc; in rswitch_gwca_ts_queue_alloc() local
546 desc = &gq->ts_ring[gq->ring_size]; in rswitch_gwca_ts_queue_alloc()
547 desc->desc.die_dt = DT_LINKFIX; in rswitch_gwca_ts_queue_alloc()
548 rswitch_desc_set_dptr(&desc->desc, gq->ring_dma); in rswitch_gwca_ts_queue_alloc()
717 struct rswitch_ext_ts_desc *desc; in rswitch_rx() local
731 desc = &gq->rx_ring[gq->cur]; in rswitch_rx()
732 while ((desc->desc.die_dt & DT_MASK) != DT_FEMPTY) { in rswitch_rx()
734 pkt_len = le16_to_cpu(desc->desc.info_ds) & RX_DS; in rswitch_rx()
735 dma_addr = rswitch_desc_get_dptr(&desc->desc); in rswitch_rx()
751 ts.tv_sec = __le32_to_cpu(desc->ts_sec); in rswitch_rx()
752 ts.tv_nsec = __le32_to_cpu(desc->ts_nsec & cpu_to_le32(0x3fffffff)); in rswitch_rx()
763 desc = &gq->rx_ring[gq->cur]; in rswitch_rx()
792 struct rswitch_ext_desc *desc; in rswitch_tx_free() local
795 desc = &gq->tx_ring[gq->dirty]; in rswitch_tx_free()
796 while ((desc->desc.die_dt & DT_MASK) == DT_FEMPTY) { in rswitch_tx_free()
810 desc->desc.die_dt = DT_EEMPTY; in rswitch_tx_free()
812 desc = &gq->tx_ring[gq->dirty]; in rswitch_tx_free()
937 struct rswitch_ts_desc *desc; in rswitch_ts() local
944 desc = &gq->ts_ring[gq->cur]; in rswitch_ts()
945 while ((desc->desc.die_dt & DT_MASK) != DT_FEMPTY_ND) { in rswitch_ts()
948 port = TS_DESC_DPN(__le32_to_cpu(desc->desc.dptrl)); in rswitch_ts()
953 tag = TS_DESC_TSUN(__le32_to_cpu(desc->desc.dptrl)); in rswitch_ts()
964 ts.tv_sec = __le32_to_cpu(desc->ts_sec); in rswitch_ts()
965 ts.tv_nsec = __le32_to_cpu(desc->ts_nsec & cpu_to_le32(0x3fffffff)); in rswitch_ts()
972 desc = &gq->ts_ring[gq->cur]; in rswitch_ts()
1546 struct rswitch_ext_desc *desc) in rswitch_ext_desc_set_info1() argument
1548 desc->info1 = cpu_to_le64(INFO1_DV(BIT(rdev->etha->index)) | in rswitch_ext_desc_set_info1()
1561 desc->info1 |= cpu_to_le64(INFO1_TSUN(tag) | INFO1_TXC); in rswitch_ext_desc_set_info1()
1571 struct rswitch_ext_desc *desc, in rswitch_ext_desc_set() argument
1574 rswitch_desc_set_dptr(&desc->desc, dma_addr); in rswitch_ext_desc_set()
1575 desc->desc.info_ds = cpu_to_le16(len); in rswitch_ext_desc_set()
1576 if (!rswitch_ext_desc_set_info1(rdev, skb, desc)) in rswitch_ext_desc_set()
1581 desc->desc.die_dt = die_dt; in rswitch_ext_desc_set()
1617 struct rswitch_ext_desc *desc; in rswitch_start_xmit() local
1643 desc = &gq->tx_ring[rswitch_next_queue_index(gq, true, i)]; in rswitch_start_xmit()
1647 if (!rswitch_ext_desc_set(rdev, skb, desc, dma_addr, len, die_dt)) in rswitch_start_xmit()