Lines Matching refs:p
23 static void sxgbe_init_tx_desc(struct sxgbe_tx_norm_desc *p) in sxgbe_init_tx_desc() argument
25 p->tdes23.tx_rd_des23.own_bit = 0; in sxgbe_init_tx_desc()
28 static void sxgbe_tx_desc_enable_tse(struct sxgbe_tx_norm_desc *p, u8 is_tse, in sxgbe_tx_desc_enable_tse() argument
32 p->tdes23.tx_rd_des23.tse_bit = is_tse; in sxgbe_tx_desc_enable_tse()
33 p->tdes23.tx_rd_des23.buf1_size = total_hdr_len; in sxgbe_tx_desc_enable_tse()
34 p->tdes23.tx_rd_des23.tcp_hdr_len = tcp_hdr_len / 4; in sxgbe_tx_desc_enable_tse()
35 p->tdes23.tx_rd_des23.tx_pkt_len.tcp_payload_len = tcp_payload_len; in sxgbe_tx_desc_enable_tse()
39 static void sxgbe_prepare_tx_desc(struct sxgbe_tx_norm_desc *p, u8 is_fd, in sxgbe_prepare_tx_desc() argument
42 p->tdes23.tx_rd_des23.first_desc = is_fd; in sxgbe_prepare_tx_desc()
43 p->tdes23.tx_rd_des23.buf1_size = buf1_len; in sxgbe_prepare_tx_desc()
45 p->tdes23.tx_rd_des23.tx_pkt_len.pkt_len.total_pkt_len = pkt_len; in sxgbe_prepare_tx_desc()
48 p->tdes23.tx_rd_des23.cksum_ctl = cic_full; in sxgbe_prepare_tx_desc()
52 static void sxgbe_tx_vlanctl_desc(struct sxgbe_tx_norm_desc *p, int vlan_ctl) in sxgbe_tx_vlanctl_desc() argument
54 p->tdes23.tx_rd_des23.vlan_tag_ctl = vlan_ctl; in sxgbe_tx_vlanctl_desc()
58 static void sxgbe_set_tx_owner(struct sxgbe_tx_norm_desc *p) in sxgbe_set_tx_owner() argument
60 p->tdes23.tx_rd_des23.own_bit = 1; in sxgbe_set_tx_owner()
64 static int sxgbe_get_tx_owner(struct sxgbe_tx_norm_desc *p) in sxgbe_get_tx_owner() argument
66 return p->tdes23.tx_rd_des23.own_bit; in sxgbe_get_tx_owner()
70 static void sxgbe_close_tx_desc(struct sxgbe_tx_norm_desc *p) in sxgbe_close_tx_desc() argument
72 p->tdes23.tx_rd_des23.last_desc = 1; in sxgbe_close_tx_desc()
73 p->tdes23.tx_rd_des23.int_on_com = 1; in sxgbe_close_tx_desc()
77 static void sxgbe_release_tx_desc(struct sxgbe_tx_norm_desc *p) in sxgbe_release_tx_desc() argument
79 memset(p, 0, sizeof(*p)); in sxgbe_release_tx_desc()
85 static void sxgbe_clear_tx_ic(struct sxgbe_tx_norm_desc *p) in sxgbe_clear_tx_ic() argument
87 p->tdes23.tx_rd_des23.int_on_com = 0; in sxgbe_clear_tx_ic()
91 static int sxgbe_get_tx_ls(struct sxgbe_tx_norm_desc *p) in sxgbe_get_tx_ls() argument
93 return p->tdes23.tx_rd_des23.last_desc; in sxgbe_get_tx_ls()
97 static int sxgbe_get_tx_len(struct sxgbe_tx_norm_desc *p) in sxgbe_get_tx_len() argument
99 return p->tdes23.tx_rd_des23.buf1_size; in sxgbe_get_tx_len()
103 static void sxgbe_tx_enable_tstamp(struct sxgbe_tx_norm_desc *p) in sxgbe_tx_enable_tstamp() argument
105 p->tdes23.tx_rd_des23.timestmp_enable = 1; in sxgbe_tx_enable_tstamp()
109 static int sxgbe_get_tx_timestamp_status(struct sxgbe_tx_norm_desc *p) in sxgbe_get_tx_timestamp_status() argument
111 return p->tdes23.tx_rd_des23.timestmp_enable; in sxgbe_get_tx_timestamp_status()
115 static void sxgbe_tx_ctxt_desc_set_ctxt(struct sxgbe_tx_ctxt_desc *p) in sxgbe_tx_ctxt_desc_set_ctxt() argument
117 p->ctxt_bit = 1; in sxgbe_tx_ctxt_desc_set_ctxt()
121 static void sxgbe_tx_ctxt_desc_set_owner(struct sxgbe_tx_ctxt_desc *p) in sxgbe_tx_ctxt_desc_set_owner() argument
123 p->own_bit = 1; in sxgbe_tx_ctxt_desc_set_owner()
127 static int sxgbe_tx_ctxt_desc_get_owner(struct sxgbe_tx_ctxt_desc *p) in sxgbe_tx_ctxt_desc_get_owner() argument
129 return p->own_bit; in sxgbe_tx_ctxt_desc_get_owner()
133 static void sxgbe_tx_ctxt_desc_set_mss(struct sxgbe_tx_ctxt_desc *p, u16 mss) in sxgbe_tx_ctxt_desc_set_mss() argument
135 p->maxseg_size = mss; in sxgbe_tx_ctxt_desc_set_mss()
139 static int sxgbe_tx_ctxt_desc_get_mss(struct sxgbe_tx_ctxt_desc *p) in sxgbe_tx_ctxt_desc_get_mss() argument
141 return p->maxseg_size; in sxgbe_tx_ctxt_desc_get_mss()
145 static void sxgbe_tx_ctxt_desc_set_tcmssv(struct sxgbe_tx_ctxt_desc *p) in sxgbe_tx_ctxt_desc_set_tcmssv() argument
147 p->tcmssv = 1; in sxgbe_tx_ctxt_desc_set_tcmssv()
151 static void sxgbe_tx_ctxt_desc_reset_ostc(struct sxgbe_tx_ctxt_desc *p) in sxgbe_tx_ctxt_desc_reset_ostc() argument
153 p->ostc = 0; in sxgbe_tx_ctxt_desc_reset_ostc()
157 static void sxgbe_tx_ctxt_desc_set_ivlantag(struct sxgbe_tx_ctxt_desc *p, in sxgbe_tx_ctxt_desc_set_ivlantag() argument
162 p->ivlan_tag_valid = is_ivlanvalid; in sxgbe_tx_ctxt_desc_set_ivlantag()
163 p->ivlan_tag = ivlan_tag; in sxgbe_tx_ctxt_desc_set_ivlantag()
164 p->ivlan_tag_ctl = ivlan_ctl; in sxgbe_tx_ctxt_desc_set_ivlantag()
169 static int sxgbe_tx_ctxt_desc_get_ivlantag(struct sxgbe_tx_ctxt_desc *p) in sxgbe_tx_ctxt_desc_get_ivlantag() argument
171 return p->ivlan_tag; in sxgbe_tx_ctxt_desc_get_ivlantag()
175 static void sxgbe_tx_ctxt_desc_set_vlantag(struct sxgbe_tx_ctxt_desc *p, in sxgbe_tx_ctxt_desc_set_vlantag() argument
179 p->vltag_valid = is_vlanvalid; in sxgbe_tx_ctxt_desc_set_vlantag()
180 p->vlan_tag = vlan_tag; in sxgbe_tx_ctxt_desc_set_vlantag()
185 static int sxgbe_tx_ctxt_desc_get_vlantag(struct sxgbe_tx_ctxt_desc *p) in sxgbe_tx_ctxt_desc_get_vlantag() argument
187 return p->vlan_tag; in sxgbe_tx_ctxt_desc_get_vlantag()
191 static void sxgbe_tx_ctxt_desc_set_tstamp(struct sxgbe_tx_ctxt_desc *p, in sxgbe_tx_ctxt_desc_set_tstamp() argument
195 p->ostc = ostc_enable; in sxgbe_tx_ctxt_desc_set_tstamp()
196 p->tstamp_lo = (u32) tstamp; in sxgbe_tx_ctxt_desc_set_tstamp()
197 p->tstamp_hi = (u32) (tstamp>>32); in sxgbe_tx_ctxt_desc_set_tstamp()
201 static void sxgbe_tx_ctxt_desc_close(struct sxgbe_tx_ctxt_desc *p) in sxgbe_tx_ctxt_desc_close() argument
203 p->own_bit = 1; in sxgbe_tx_ctxt_desc_close()
207 static int sxgbe_tx_ctxt_desc_get_cde(struct sxgbe_tx_ctxt_desc *p) in sxgbe_tx_ctxt_desc_get_cde() argument
209 return p->ctxt_desc_err; in sxgbe_tx_ctxt_desc_get_cde()
213 static void sxgbe_init_rx_desc(struct sxgbe_rx_norm_desc *p, int disable_rx_ic, in sxgbe_init_rx_desc() argument
216 p->rdes23.rx_rd_des23.own_bit = 1; in sxgbe_init_rx_desc()
218 p->rdes23.rx_rd_des23.int_on_com = disable_rx_ic; in sxgbe_init_rx_desc()
222 static int sxgbe_get_rx_owner(struct sxgbe_rx_norm_desc *p) in sxgbe_get_rx_owner() argument
224 return p->rdes23.rx_rd_des23.own_bit; in sxgbe_get_rx_owner()
228 static void sxgbe_set_rx_owner(struct sxgbe_rx_norm_desc *p) in sxgbe_set_rx_owner() argument
230 p->rdes23.rx_rd_des23.own_bit = 1; in sxgbe_set_rx_owner()
234 static void sxgbe_set_rx_int_on_com(struct sxgbe_rx_norm_desc *p) in sxgbe_set_rx_int_on_com() argument
236 p->rdes23.rx_rd_des23.int_on_com = 1; in sxgbe_set_rx_int_on_com()
240 static int sxgbe_get_rx_frame_len(struct sxgbe_rx_norm_desc *p) in sxgbe_get_rx_frame_len() argument
242 return p->rdes23.rx_wb_des23.pkt_len; in sxgbe_get_rx_frame_len()
246 static int sxgbe_get_rx_fd_status(struct sxgbe_rx_norm_desc *p) in sxgbe_get_rx_fd_status() argument
248 return p->rdes23.rx_wb_des23.first_desc; in sxgbe_get_rx_fd_status()
252 static int sxgbe_get_rx_ld_status(struct sxgbe_rx_norm_desc *p) in sxgbe_get_rx_ld_status() argument
254 return p->rdes23.rx_wb_des23.last_desc; in sxgbe_get_rx_ld_status()
259 static int sxgbe_rx_wbstatus(struct sxgbe_rx_norm_desc *p, in sxgbe_rx_wbstatus() argument
265 if (p->rdes23.rx_wb_des23.err_summary) { in sxgbe_rx_wbstatus()
266 switch (p->rdes23.rx_wb_des23.err_l2_type) { in sxgbe_rx_wbstatus()
300 switch (p->rdes23.rx_wb_des23.err_l2_type) { in sxgbe_rx_wbstatus()
347 switch (p->rdes23.rx_wb_des23.layer34_pkt_type) { in sxgbe_rx_wbstatus()
381 if (p->rdes23.rx_wb_des23.vlan_filter_match) in sxgbe_rx_wbstatus()
384 if (p->rdes23.rx_wb_des23.sa_filter_fail) { in sxgbe_rx_wbstatus()
388 if (p->rdes23.rx_wb_des23.da_filter_fail) { in sxgbe_rx_wbstatus()
392 if (p->rdes23.rx_wb_des23.hash_filter_pass) in sxgbe_rx_wbstatus()
395 if (p->rdes23.rx_wb_des23.l3_filter_match) in sxgbe_rx_wbstatus()
398 if (p->rdes23.rx_wb_des23.l4_filter_match) in sxgbe_rx_wbstatus()
405 static int sxgbe_get_rx_ctxt_owner(struct sxgbe_rx_ctxt_desc *p) in sxgbe_get_rx_ctxt_owner() argument
407 return p->own_bit; in sxgbe_get_rx_ctxt_owner()
411 static void sxgbe_set_ctxt_rx_owner(struct sxgbe_rx_ctxt_desc *p) in sxgbe_set_ctxt_rx_owner() argument
413 p->own_bit = 1; in sxgbe_set_ctxt_rx_owner()
418 static void sxgbe_rx_ctxt_wbstatus(struct sxgbe_rx_ctxt_desc *p, in sxgbe_rx_ctxt_wbstatus() argument
421 if (p->tstamp_dropped) in sxgbe_rx_ctxt_wbstatus()
425 if (p->ptp_msgtype == RX_NO_PTP) in sxgbe_rx_ctxt_wbstatus()
427 else if (p->ptp_msgtype == RX_PTP_SYNC) in sxgbe_rx_ctxt_wbstatus()
429 else if (p->ptp_msgtype == RX_PTP_FOLLOW_UP) in sxgbe_rx_ctxt_wbstatus()
431 else if (p->ptp_msgtype == RX_PTP_DELAY_REQ) in sxgbe_rx_ctxt_wbstatus()
433 else if (p->ptp_msgtype == RX_PTP_DELAY_RESP) in sxgbe_rx_ctxt_wbstatus()
435 else if (p->ptp_msgtype == RX_PTP_PDELAY_REQ) in sxgbe_rx_ctxt_wbstatus()
437 else if (p->ptp_msgtype == RX_PTP_PDELAY_RESP) in sxgbe_rx_ctxt_wbstatus()
439 else if (p->ptp_msgtype == RX_PTP_PDELAY_FOLLOW_UP) in sxgbe_rx_ctxt_wbstatus()
441 else if (p->ptp_msgtype == RX_PTP_ANNOUNCE) in sxgbe_rx_ctxt_wbstatus()
443 else if (p->ptp_msgtype == RX_PTP_MGMT) in sxgbe_rx_ctxt_wbstatus()
445 else if (p->ptp_msgtype == RX_PTP_SIGNAL) in sxgbe_rx_ctxt_wbstatus()
447 else if (p->ptp_msgtype == RX_PTP_RESV_MSG) in sxgbe_rx_ctxt_wbstatus()
452 static int sxgbe_get_rx_ctxt_tstamp_status(struct sxgbe_rx_ctxt_desc *p) in sxgbe_get_rx_ctxt_tstamp_status() argument
454 if ((p->tstamp_hi == 0xffffffff) && (p->tstamp_lo == 0xffffffff)) { in sxgbe_get_rx_ctxt_tstamp_status()
459 return p->tstamp_available; in sxgbe_get_rx_ctxt_tstamp_status()
463 static u64 sxgbe_get_rx_timestamp(struct sxgbe_rx_ctxt_desc *p) in sxgbe_get_rx_timestamp() argument
467 ns = p->tstamp_lo; in sxgbe_get_rx_timestamp()
468 ns |= ((u64)p->tstamp_hi) << 32; in sxgbe_get_rx_timestamp()