Lines Matching refs:p
16 struct dma_desc *p, void __iomem *ioaddr) in ndesc_get_tx_status() argument
18 unsigned int tdes0 = le32_to_cpu(p->des0); in ndesc_get_tx_status()
19 unsigned int tdes1 = le32_to_cpu(p->des1); in ndesc_get_tx_status()
60 static int ndesc_get_tx_len(struct dma_desc *p) in ndesc_get_tx_len() argument
62 return (le32_to_cpu(p->des1) & RDES1_BUFFER1_SIZE_MASK); in ndesc_get_tx_len()
70 struct dma_desc *p) in ndesc_get_rx_status() argument
73 unsigned int rdes0 = le32_to_cpu(p->des0); in ndesc_get_rx_status()
118 static void ndesc_init_rx_desc(struct dma_desc *p, int disable_rx_ic, int mode, in ndesc_init_rx_desc() argument
123 p->des0 |= cpu_to_le32(RDES0_OWN); in ndesc_init_rx_desc()
126 p->des1 |= cpu_to_le32(bfsize1 & RDES1_BUFFER1_SIZE_MASK); in ndesc_init_rx_desc()
129 ndesc_rx_set_on_chain(p, end); in ndesc_init_rx_desc()
131 ndesc_rx_set_on_ring(p, end, bfsize); in ndesc_init_rx_desc()
134 p->des1 |= cpu_to_le32(RDES1_DISABLE_IC); in ndesc_init_rx_desc()
137 static void ndesc_init_tx_desc(struct dma_desc *p, int mode, int end) in ndesc_init_tx_desc() argument
139 p->des0 &= cpu_to_le32(~TDES0_OWN); in ndesc_init_tx_desc()
141 ndesc_tx_set_on_chain(p); in ndesc_init_tx_desc()
143 ndesc_end_tx_desc_on_ring(p, end); in ndesc_init_tx_desc()
146 static int ndesc_get_tx_owner(struct dma_desc *p) in ndesc_get_tx_owner() argument
148 return (le32_to_cpu(p->des0) & TDES0_OWN) >> 31; in ndesc_get_tx_owner()
151 static void ndesc_set_tx_owner(struct dma_desc *p) in ndesc_set_tx_owner() argument
153 p->des0 |= cpu_to_le32(TDES0_OWN); in ndesc_set_tx_owner()
156 static void ndesc_set_rx_owner(struct dma_desc *p, int disable_rx_ic) in ndesc_set_rx_owner() argument
158 p->des0 |= cpu_to_le32(RDES0_OWN); in ndesc_set_rx_owner()
161 static int ndesc_get_tx_ls(struct dma_desc *p) in ndesc_get_tx_ls() argument
163 return (le32_to_cpu(p->des1) & TDES1_LAST_SEGMENT) >> 30; in ndesc_get_tx_ls()
166 static void ndesc_release_tx_desc(struct dma_desc *p, int mode) in ndesc_release_tx_desc() argument
168 int ter = (le32_to_cpu(p->des1) & TDES1_END_RING) >> 25; in ndesc_release_tx_desc()
170 memset(p, 0, offsetof(struct dma_desc, des2)); in ndesc_release_tx_desc()
172 ndesc_tx_set_on_chain(p); in ndesc_release_tx_desc()
174 ndesc_end_tx_desc_on_ring(p, ter); in ndesc_release_tx_desc()
177 static void ndesc_prepare_tx_desc(struct dma_desc *p, int is_fs, int len, in ndesc_prepare_tx_desc() argument
181 unsigned int tdes1 = le32_to_cpu(p->des1); in ndesc_prepare_tx_desc()
196 p->des1 = cpu_to_le32(tdes1); in ndesc_prepare_tx_desc()
199 norm_set_tx_desc_len_on_chain(p, len); in ndesc_prepare_tx_desc()
201 norm_set_tx_desc_len_on_ring(p, len); in ndesc_prepare_tx_desc()
204 p->des0 |= cpu_to_le32(TDES0_OWN); in ndesc_prepare_tx_desc()
207 static void ndesc_set_tx_ic(struct dma_desc *p) in ndesc_set_tx_ic() argument
209 p->des1 |= cpu_to_le32(TDES1_INTERRUPT); in ndesc_set_tx_ic()
212 static int ndesc_get_rx_frame_len(struct dma_desc *p, int rx_coe_type) in ndesc_get_rx_frame_len() argument
225 return (((le32_to_cpu(p->des0) & RDES0_FRAME_LEN_MASK) in ndesc_get_rx_frame_len()
231 static void ndesc_enable_tx_timestamp(struct dma_desc *p) in ndesc_enable_tx_timestamp() argument
233 p->des1 |= cpu_to_le32(TDES1_TIME_STAMP_ENABLE); in ndesc_enable_tx_timestamp()
236 static int ndesc_get_tx_timestamp_status(struct dma_desc *p) in ndesc_get_tx_timestamp_status() argument
238 return (le32_to_cpu(p->des0) & TDES0_TIME_STAMP_STATUS) >> 17; in ndesc_get_tx_timestamp_status()
243 struct dma_desc *p = (struct dma_desc *)desc; in ndesc_get_timestamp() local
246 ns = le32_to_cpu(p->des2); in ndesc_get_timestamp()
248 ns += le32_to_cpu(p->des3) * 1000000000ULL; in ndesc_get_timestamp()
255 struct dma_desc *p = (struct dma_desc *)desc; in ndesc_get_rx_timestamp_status() local
257 if ((le32_to_cpu(p->des2) == 0xffffffff) && in ndesc_get_rx_timestamp_status()
258 (le32_to_cpu(p->des3) == 0xffffffff)) in ndesc_get_rx_timestamp_status()
268 struct dma_desc *p = (struct dma_desc *)head; in ndesc_display_ring() local
276 dma_addr = dma_rx_phy + i * sizeof(*p); in ndesc_display_ring()
278 x = *(u64 *)p; in ndesc_display_ring()
282 p->des2, p->des3); in ndesc_display_ring()
283 p++; in ndesc_display_ring()
288 static void ndesc_set_addr(struct dma_desc *p, dma_addr_t addr) in ndesc_set_addr() argument
290 p->des2 = cpu_to_le32(addr); in ndesc_set_addr()
293 static void ndesc_clear(struct dma_desc *p) in ndesc_clear() argument
295 p->des2 = 0; in ndesc_clear()