Lines Matching refs:p

30 			       struct dma_desc *p, void __iomem *ioaddr)  in ndesc_get_tx_status()  argument
35 if (unlikely(p->des01.tx.error_summary)) { in ndesc_get_tx_status()
36 if (unlikely(p->des01.tx.underflow_error)) { in ndesc_get_tx_status()
40 if (unlikely(p->des01.tx.no_carrier)) { in ndesc_get_tx_status()
44 if (unlikely(p->des01.tx.loss_carrier)) { in ndesc_get_tx_status()
48 if (unlikely((p->des01.tx.excessive_deferral) || in ndesc_get_tx_status()
49 (p->des01.tx.excessive_collisions) || in ndesc_get_tx_status()
50 (p->des01.tx.late_collision))) in ndesc_get_tx_status()
51 stats->collisions += p->des01.tx.collision_count; in ndesc_get_tx_status()
55 if (p->des01.etx.vlan_frame) in ndesc_get_tx_status()
58 if (unlikely(p->des01.tx.deferred)) in ndesc_get_tx_status()
64 static int ndesc_get_tx_len(struct dma_desc *p) in ndesc_get_tx_len() argument
66 return p->des01.tx.buffer1_size; in ndesc_get_tx_len()
74 struct dma_desc *p) in ndesc_get_rx_status() argument
79 if (unlikely(p->des01.rx.last_descriptor == 0)) { in ndesc_get_rx_status()
86 if (unlikely(p->des01.rx.error_summary)) { in ndesc_get_rx_status()
87 if (unlikely(p->des01.rx.descriptor_error)) in ndesc_get_rx_status()
89 if (unlikely(p->des01.rx.sa_filter_fail)) in ndesc_get_rx_status()
91 if (unlikely(p->des01.rx.overflow_error)) in ndesc_get_rx_status()
93 if (unlikely(p->des01.rx.ipc_csum_error)) in ndesc_get_rx_status()
95 if (unlikely(p->des01.rx.collision)) { in ndesc_get_rx_status()
99 if (unlikely(p->des01.rx.crc_error)) { in ndesc_get_rx_status()
105 if (unlikely(p->des01.rx.dribbling)) in ndesc_get_rx_status()
108 if (unlikely(p->des01.rx.length_error)) { in ndesc_get_rx_status()
112 if (unlikely(p->des01.rx.mii_error)) { in ndesc_get_rx_status()
117 if (p->des01.rx.vlan_tag) in ndesc_get_rx_status()
123 static void ndesc_init_rx_desc(struct dma_desc *p, int disable_rx_ic, int mode, in ndesc_init_rx_desc() argument
126 p->des01.all_flags = 0; in ndesc_init_rx_desc()
127 p->des01.rx.own = 1; in ndesc_init_rx_desc()
128 p->des01.rx.buffer1_size = BUF_SIZE_2KiB - 1; in ndesc_init_rx_desc()
131 ndesc_rx_set_on_chain(p, end); in ndesc_init_rx_desc()
133 ndesc_rx_set_on_ring(p, end); in ndesc_init_rx_desc()
136 p->des01.rx.disable_ic = 1; in ndesc_init_rx_desc()
139 static void ndesc_init_tx_desc(struct dma_desc *p, int mode, int end) in ndesc_init_tx_desc() argument
141 p->des01.all_flags = 0; in ndesc_init_tx_desc()
143 ndesc_tx_set_on_chain(p, end); in ndesc_init_tx_desc()
145 ndesc_tx_set_on_ring(p, end); in ndesc_init_tx_desc()
148 static int ndesc_get_tx_owner(struct dma_desc *p) in ndesc_get_tx_owner() argument
150 return p->des01.tx.own; in ndesc_get_tx_owner()
153 static int ndesc_get_rx_owner(struct dma_desc *p) in ndesc_get_rx_owner() argument
155 return p->des01.rx.own; in ndesc_get_rx_owner()
158 static void ndesc_set_tx_owner(struct dma_desc *p) in ndesc_set_tx_owner() argument
160 p->des01.tx.own = 1; in ndesc_set_tx_owner()
163 static void ndesc_set_rx_owner(struct dma_desc *p) in ndesc_set_rx_owner() argument
165 p->des01.rx.own = 1; in ndesc_set_rx_owner()
168 static int ndesc_get_tx_ls(struct dma_desc *p) in ndesc_get_tx_ls() argument
170 return p->des01.tx.last_segment; in ndesc_get_tx_ls()
173 static void ndesc_release_tx_desc(struct dma_desc *p, int mode) in ndesc_release_tx_desc() argument
175 int ter = p->des01.tx.end_ring; in ndesc_release_tx_desc()
177 memset(p, 0, offsetof(struct dma_desc, des2)); in ndesc_release_tx_desc()
179 ndesc_end_tx_desc_on_chain(p, ter); in ndesc_release_tx_desc()
181 ndesc_end_tx_desc_on_ring(p, ter); in ndesc_release_tx_desc()
184 static void ndesc_prepare_tx_desc(struct dma_desc *p, int is_fs, int len, in ndesc_prepare_tx_desc() argument
187 p->des01.tx.first_segment = is_fs; in ndesc_prepare_tx_desc()
189 norm_set_tx_desc_len_on_chain(p, len); in ndesc_prepare_tx_desc()
191 norm_set_tx_desc_len_on_ring(p, len); in ndesc_prepare_tx_desc()
194 p->des01.tx.checksum_insertion = cic_full; in ndesc_prepare_tx_desc()
197 static void ndesc_clear_tx_ic(struct dma_desc *p) in ndesc_clear_tx_ic() argument
199 p->des01.tx.interrupt = 0; in ndesc_clear_tx_ic()
202 static void ndesc_close_tx_desc(struct dma_desc *p) in ndesc_close_tx_desc() argument
204 p->des01.tx.last_segment = 1; in ndesc_close_tx_desc()
205 p->des01.tx.interrupt = 1; in ndesc_close_tx_desc()
208 static int ndesc_get_rx_frame_len(struct dma_desc *p, int rx_coe_type) in ndesc_get_rx_frame_len() argument
216 return p->des01.rx.frame_length - 2; in ndesc_get_rx_frame_len()
218 return p->des01.rx.frame_length; in ndesc_get_rx_frame_len()
221 static void ndesc_enable_tx_timestamp(struct dma_desc *p) in ndesc_enable_tx_timestamp() argument
223 p->des01.tx.time_stamp_enable = 1; in ndesc_enable_tx_timestamp()
226 static int ndesc_get_tx_timestamp_status(struct dma_desc *p) in ndesc_get_tx_timestamp_status() argument
228 return p->des01.tx.time_stamp_status; in ndesc_get_tx_timestamp_status()
233 struct dma_desc *p = (struct dma_desc *)desc; in ndesc_get_timestamp() local
236 ns = p->des2; in ndesc_get_timestamp()
238 ns += p->des3 * 1000000000ULL; in ndesc_get_timestamp()
245 struct dma_desc *p = (struct dma_desc *)desc; in ndesc_get_rx_timestamp_status() local
247 if ((p->des2 == 0xffffffff) && (p->des3 == 0xffffffff)) in ndesc_get_rx_timestamp_status()