Lines Matching refs:priv
24 int msgdma_initialize(struct altera_tse_private *priv) in msgdma_initialize() argument
29 void msgdma_uninitialize(struct altera_tse_private *priv) in msgdma_uninitialize() argument
33 void msgdma_start_rxdma(struct altera_tse_private *priv) in msgdma_start_rxdma() argument
37 void msgdma_reset(struct altera_tse_private *priv) in msgdma_reset() argument
42 csrwr32(MSGDMA_CSR_STAT_MASK, priv->rx_dma_csr, in msgdma_reset()
44 csrwr32(MSGDMA_CSR_CTL_RESET, priv->rx_dma_csr, in msgdma_reset()
49 if (tse_bit_is_clear(priv->rx_dma_csr, msgdma_csroffs(status), in msgdma_reset()
56 netif_warn(priv, drv, priv->dev, in msgdma_reset()
60 csrwr32(MSGDMA_CSR_STAT_MASK, priv->rx_dma_csr, msgdma_csroffs(status)); in msgdma_reset()
63 csrwr32(MSGDMA_CSR_STAT_MASK, priv->tx_dma_csr, in msgdma_reset()
66 csrwr32(MSGDMA_CSR_CTL_RESET, priv->tx_dma_csr, in msgdma_reset()
71 if (tse_bit_is_clear(priv->tx_dma_csr, msgdma_csroffs(status), in msgdma_reset()
78 netif_warn(priv, drv, priv->dev, in msgdma_reset()
82 csrwr32(MSGDMA_CSR_STAT_MASK, priv->tx_dma_csr, msgdma_csroffs(status)); in msgdma_reset()
85 void msgdma_disable_rxirq(struct altera_tse_private *priv) in msgdma_disable_rxirq() argument
87 tse_clear_bit(priv->rx_dma_csr, msgdma_csroffs(control), in msgdma_disable_rxirq()
91 void msgdma_enable_rxirq(struct altera_tse_private *priv) in msgdma_enable_rxirq() argument
93 tse_set_bit(priv->rx_dma_csr, msgdma_csroffs(control), in msgdma_enable_rxirq()
97 void msgdma_disable_txirq(struct altera_tse_private *priv) in msgdma_disable_txirq() argument
99 tse_clear_bit(priv->tx_dma_csr, msgdma_csroffs(control), in msgdma_disable_txirq()
103 void msgdma_enable_txirq(struct altera_tse_private *priv) in msgdma_enable_txirq() argument
105 tse_set_bit(priv->tx_dma_csr, msgdma_csroffs(control), in msgdma_enable_txirq()
109 void msgdma_clear_rxirq(struct altera_tse_private *priv) in msgdma_clear_rxirq() argument
111 csrwr32(MSGDMA_CSR_STAT_IRQ, priv->rx_dma_csr, msgdma_csroffs(status)); in msgdma_clear_rxirq()
114 void msgdma_clear_txirq(struct altera_tse_private *priv) in msgdma_clear_txirq() argument
116 csrwr32(MSGDMA_CSR_STAT_IRQ, priv->tx_dma_csr, msgdma_csroffs(status)); in msgdma_clear_txirq()
120 int msgdma_tx_buffer(struct altera_tse_private *priv, struct tse_buffer *buffer) in msgdma_tx_buffer() argument
122 csrwr32(lower_32_bits(buffer->dma_addr), priv->tx_dma_desc, in msgdma_tx_buffer()
124 csrwr32(upper_32_bits(buffer->dma_addr), priv->tx_dma_desc, in msgdma_tx_buffer()
126 csrwr32(0, priv->tx_dma_desc, msgdma_descroffs(write_addr_lo)); in msgdma_tx_buffer()
127 csrwr32(0, priv->tx_dma_desc, msgdma_descroffs(write_addr_hi)); in msgdma_tx_buffer()
128 csrwr32(buffer->len, priv->tx_dma_desc, msgdma_descroffs(len)); in msgdma_tx_buffer()
129 csrwr32(0, priv->tx_dma_desc, msgdma_descroffs(burst_seq_num)); in msgdma_tx_buffer()
130 csrwr32(MSGDMA_DESC_TX_STRIDE, priv->tx_dma_desc, in msgdma_tx_buffer()
132 csrwr32(MSGDMA_DESC_CTL_TX_SINGLE, priv->tx_dma_desc, in msgdma_tx_buffer()
137 u32 msgdma_tx_completions(struct altera_tse_private *priv) in msgdma_tx_completions() argument
144 inuse = csrrd32(priv->tx_dma_csr, msgdma_csroffs(rw_fill_level)) in msgdma_tx_completions()
148 ready = priv->tx_prod - priv->tx_cons - inuse - 1; in msgdma_tx_completions()
151 status = csrrd32(priv->tx_dma_csr, msgdma_csroffs(status)); in msgdma_tx_completions()
153 ready = priv->tx_prod - priv->tx_cons - 1; in msgdma_tx_completions()
155 ready = priv->tx_prod - priv->tx_cons; in msgdma_tx_completions()
162 void msgdma_add_rx_desc(struct altera_tse_private *priv, in msgdma_add_rx_desc() argument
165 u32 len = priv->rx_dma_buf_sz; in msgdma_add_rx_desc()
174 csrwr32(0, priv->rx_dma_desc, msgdma_descroffs(read_addr_lo)); in msgdma_add_rx_desc()
175 csrwr32(0, priv->rx_dma_desc, msgdma_descroffs(read_addr_hi)); in msgdma_add_rx_desc()
176 csrwr32(lower_32_bits(dma_addr), priv->rx_dma_desc, in msgdma_add_rx_desc()
178 csrwr32(upper_32_bits(dma_addr), priv->rx_dma_desc, in msgdma_add_rx_desc()
180 csrwr32(len, priv->rx_dma_desc, msgdma_descroffs(len)); in msgdma_add_rx_desc()
181 csrwr32(0, priv->rx_dma_desc, msgdma_descroffs(burst_seq_num)); in msgdma_add_rx_desc()
182 csrwr32(0x00010001, priv->rx_dma_desc, msgdma_descroffs(stride)); in msgdma_add_rx_desc()
183 csrwr32(control, priv->rx_dma_desc, msgdma_descroffs(control)); in msgdma_add_rx_desc()
189 u32 msgdma_rx_status(struct altera_tse_private *priv) in msgdma_rx_status() argument
195 if (csrrd32(priv->rx_dma_csr, msgdma_csroffs(resp_fill_level)) in msgdma_rx_status()
197 pktlength = csrrd32(priv->rx_dma_resp, in msgdma_rx_status()
199 pktstatus = csrrd32(priv->rx_dma_resp, in msgdma_rx_status()