Lines Matching refs:ae

212 static int isotp_send_fc(struct sock *sk, int ae, u8 flowstatus)  in isotp_send_fc()  argument
246 ncf->len = ae + FC_CONTENT_SZ; in isotp_send_fc()
249 ncf->data[ae] = N_PCI_FC | flowstatus; in isotp_send_fc()
250 ncf->data[ae + 1] = so->rxfc.bs; in isotp_send_fc()
251 ncf->data[ae + 2] = so->rxfc.stmin; in isotp_send_fc()
253 if (ae) in isotp_send_fc()
361 static int isotp_rcv_fc(struct isotp_sock *so, struct canfd_frame *cf, int ae) in isotp_rcv_fc() argument
371 if ((cf->len < ae + FC_CONTENT_SZ) || in isotp_rcv_fc()
373 check_pad(so, cf, ae + FC_CONTENT_SZ, so->opt.rxpad_content))) { in isotp_rcv_fc()
386 so->txfc.bs = cf->data[ae + 1]; in isotp_rcv_fc()
387 so->txfc.stmin = cf->data[ae + 2]; in isotp_rcv_fc()
411 switch (cf->data[ae] & 0x0F) { in isotp_rcv_fc()
475 static int isotp_rcv_ff(struct sock *sk, struct canfd_frame *cf, int ae) in isotp_rcv_ff() argument
493 so->rx.len = (cf->data[ae] & 0x0F) << 8; in isotp_rcv_ff()
494 so->rx.len += cf->data[ae + 1]; in isotp_rcv_ff()
501 so->rx.len = cf->data[ae + 2] << 24; in isotp_rcv_ff()
502 so->rx.len += cf->data[ae + 3] << 16; in isotp_rcv_ff()
503 so->rx.len += cf->data[ae + 4] << 8; in isotp_rcv_ff()
504 so->rx.len += cf->data[ae + 5]; in isotp_rcv_ff()
511 if (so->rx.len + ae + off + ff_pci_sz < so->rx.ll_dl) in isotp_rcv_ff()
526 isotp_send_fc(sk, ae, ISOTP_FC_OVFLW); in isotp_rcv_ff()
532 for (i = ae + ff_pci_sz; i < so->rx.ll_dl; i++) in isotp_rcv_ff()
544 isotp_send_fc(sk, ae, ISOTP_FC_CTS); in isotp_rcv_ff()
548 static int isotp_rcv_cf(struct sock *sk, struct canfd_frame *cf, int ae, in isotp_rcv_cf() argument
576 if (so->rx.len - so->rx.idx > so->rx.ll_dl - ae - N_PCI_SZ) in isotp_rcv_cf()
580 if ((cf->data[ae] & 0x0F) != so->rx.sn) { in isotp_rcv_cf()
593 for (i = ae + N_PCI_SZ; i < cf->len; i++) { in isotp_rcv_cf()
638 isotp_send_fc(sk, ae, ISOTP_FC_CTS); in isotp_rcv_cf()
647 int ae = (so->opt.flags & CAN_ISOTP_EXTEND_ADDR) ? 1 : 0; in isotp_rcv() local
659 if (ae && cf->data[0] != so->opt.rx_ext_address) in isotp_rcv()
662 n_pci_type = cf->data[ae] & 0xF0; in isotp_rcv()
680 isotp_rcv_fc(so, cf, ae); in isotp_rcv()
692 sf_dl = cf->data[ae] & 0x0F; in isotp_rcv()
695 isotp_rcv_sf(sk, cf, SF_PCI_SZ4 + ae, skb, sf_dl); in isotp_rcv()
707 isotp_rcv_sf(sk, cf, SF_PCI_SZ8 + ae, skb, in isotp_rcv()
708 cf->data[SF_PCI_SZ4 + ae]); in isotp_rcv()
715 isotp_rcv_ff(sk, cf, ae); in isotp_rcv()
720 isotp_rcv_cf(sk, cf, ae, skb); in isotp_rcv()
729 int ae, int off) in isotp_fill_dataframe() argument
731 int pcilen = N_PCI_SZ + ae + off; in isotp_fill_dataframe()
755 if (ae) in isotp_fill_dataframe()
766 int ae = (so->opt.flags & CAN_ISOTP_EXTEND_ADDR) ? 1 : 0; in isotp_send_cframe() local
786 isotp_fill_dataframe(cf, so, ae, 0); in isotp_send_cframe()
789 cf->data[ae] = N_PCI_CF | so->tx.sn++; in isotp_send_cframe()
817 int ae) in isotp_create_fframe() argument
824 if (ae) in isotp_create_fframe()
830 cf->data[ae] = N_PCI_FF; in isotp_create_fframe()
831 cf->data[ae + 1] = 0; in isotp_create_fframe()
832 cf->data[ae + 2] = (u8)(so->tx.len >> 24) & 0xFFU; in isotp_create_fframe()
833 cf->data[ae + 3] = (u8)(so->tx.len >> 16) & 0xFFU; in isotp_create_fframe()
834 cf->data[ae + 4] = (u8)(so->tx.len >> 8) & 0xFFU; in isotp_create_fframe()
835 cf->data[ae + 5] = (u8)so->tx.len & 0xFFU; in isotp_create_fframe()
839 cf->data[ae] = (u8)(so->tx.len >> 8) | N_PCI_FF; in isotp_create_fframe()
840 cf->data[ae + 1] = (u8)so->tx.len & 0xFFU; in isotp_create_fframe()
845 for (i = ae + ff_pci_sz; i < so->tx.ll_dl; i++) in isotp_create_fframe()
942 int ae = (so->opt.flags & CAN_ISOTP_EXTEND_ADDR) ? 1 : 0; in isotp_sendmsg() local
985 (size > so->tx.ll_dl - SF_PCI_SZ4 - ae - off)) { in isotp_sendmsg()
1022 if (size <= so->tx.ll_dl - SF_PCI_SZ4 - ae - off) { in isotp_sendmsg()
1032 if (size <= CAN_MAX_DLEN - SF_PCI_SZ4 - ae) in isotp_sendmsg()
1035 isotp_fill_dataframe(cf, so, ae, off); in isotp_sendmsg()
1038 cf->data[ae] = N_PCI_SF; in isotp_sendmsg()
1042 cf->data[SF_PCI_SZ4 + ae] = size; in isotp_sendmsg()
1044 cf->data[ae] |= size; in isotp_sendmsg()
1051 isotp_create_fframe(cf, so, ae); in isotp_sendmsg()