Lines Matching full:ae

213 static int isotp_send_fc(struct sock *sk, int ae, u8 flowstatus)  in isotp_send_fc()  argument
247 ncf->len = ae + FC_CONTENT_SZ; in isotp_send_fc()
250 ncf->data[ae] = N_PCI_FC | flowstatus; in isotp_send_fc()
251 ncf->data[ae + 1] = so->rxfc.bs; in isotp_send_fc()
252 ncf->data[ae + 2] = so->rxfc.stmin; in isotp_send_fc()
254 if (ae) in isotp_send_fc()
362 static int isotp_rcv_fc(struct isotp_sock *so, struct canfd_frame *cf, int ae) in isotp_rcv_fc() argument
372 if ((cf->len < ae + FC_CONTENT_SZ) || in isotp_rcv_fc()
374 check_pad(so, cf, ae + FC_CONTENT_SZ, so->opt.rxpad_content))) { in isotp_rcv_fc()
388 so->txfc.bs = cf->data[ae + 1]; in isotp_rcv_fc()
389 so->txfc.stmin = cf->data[ae + 2]; in isotp_rcv_fc()
413 switch (cf->data[ae] & 0x0F) { in isotp_rcv_fc()
477 static int isotp_rcv_ff(struct sock *sk, struct canfd_frame *cf, int ae) in isotp_rcv_ff() argument
495 so->rx.len = (cf->data[ae] & 0x0F) << 8; in isotp_rcv_ff()
496 so->rx.len += cf->data[ae + 1]; in isotp_rcv_ff()
503 so->rx.len = cf->data[ae + 2] << 24; in isotp_rcv_ff()
504 so->rx.len += cf->data[ae + 3] << 16; in isotp_rcv_ff()
505 so->rx.len += cf->data[ae + 4] << 8; in isotp_rcv_ff()
506 so->rx.len += cf->data[ae + 5]; in isotp_rcv_ff()
513 if (so->rx.len + ae + off + ff_pci_sz < so->rx.ll_dl) in isotp_rcv_ff()
528 isotp_send_fc(sk, ae, ISOTP_FC_OVFLW); in isotp_rcv_ff()
534 for (i = ae + ff_pci_sz; i < so->rx.ll_dl; i++) in isotp_rcv_ff()
546 isotp_send_fc(sk, ae, ISOTP_FC_CTS); in isotp_rcv_ff()
550 static int isotp_rcv_cf(struct sock *sk, struct canfd_frame *cf, int ae, in isotp_rcv_cf() argument
578 if (so->rx.len - so->rx.idx > so->rx.ll_dl - ae - N_PCI_SZ) in isotp_rcv_cf()
582 if ((cf->data[ae] & 0x0F) != so->rx.sn) { in isotp_rcv_cf()
595 for (i = ae + N_PCI_SZ; i < cf->len; i++) { in isotp_rcv_cf()
640 isotp_send_fc(sk, ae, ISOTP_FC_CTS); in isotp_rcv_cf()
649 int ae = (so->opt.flags & CAN_ISOTP_EXTEND_ADDR) ? 1 : 0; in isotp_rcv() local
661 if (ae && cf->data[0] != so->opt.rx_ext_address) in isotp_rcv()
664 n_pci_type = cf->data[ae] & 0xF0; in isotp_rcv()
682 isotp_rcv_fc(so, cf, ae); in isotp_rcv()
694 sf_dl = cf->data[ae] & 0x0F; in isotp_rcv()
697 isotp_rcv_sf(sk, cf, SF_PCI_SZ4 + ae, skb, sf_dl); in isotp_rcv()
709 isotp_rcv_sf(sk, cf, SF_PCI_SZ8 + ae, skb, in isotp_rcv()
710 cf->data[SF_PCI_SZ4 + ae]); in isotp_rcv()
717 isotp_rcv_ff(sk, cf, ae); in isotp_rcv()
722 isotp_rcv_cf(sk, cf, ae, skb); in isotp_rcv()
731 int ae, int off) in isotp_fill_dataframe() argument
733 int pcilen = N_PCI_SZ + ae + off; in isotp_fill_dataframe()
757 if (ae) in isotp_fill_dataframe()
768 int ae = (so->opt.flags & CAN_ISOTP_EXTEND_ADDR) ? 1 : 0; in isotp_send_cframe() local
788 isotp_fill_dataframe(cf, so, ae, 0); in isotp_send_cframe()
791 cf->data[ae] = N_PCI_CF | so->tx.sn++; in isotp_send_cframe()
819 int ae) in isotp_create_fframe() argument
826 if (ae) in isotp_create_fframe()
832 cf->data[ae] = N_PCI_FF; in isotp_create_fframe()
833 cf->data[ae + 1] = 0; in isotp_create_fframe()
834 cf->data[ae + 2] = (u8)(so->tx.len >> 24) & 0xFFU; in isotp_create_fframe()
835 cf->data[ae + 3] = (u8)(so->tx.len >> 16) & 0xFFU; in isotp_create_fframe()
836 cf->data[ae + 4] = (u8)(so->tx.len >> 8) & 0xFFU; in isotp_create_fframe()
837 cf->data[ae + 5] = (u8)so->tx.len & 0xFFU; in isotp_create_fframe()
841 cf->data[ae] = (u8)(so->tx.len >> 8) | N_PCI_FF; in isotp_create_fframe()
842 cf->data[ae + 1] = (u8)so->tx.len & 0xFFU; in isotp_create_fframe()
846 /* add first data bytes depending on ae */ in isotp_create_fframe()
847 for (i = ae + ff_pci_sz; i < so->tx.ll_dl; i++) in isotp_create_fframe()
944 int ae = (so->opt.flags & CAN_ISOTP_EXTEND_ADDR) ? 1 : 0; in isotp_sendmsg() local
987 (size > so->tx.ll_dl - SF_PCI_SZ4 - ae - off)) { in isotp_sendmsg()
1024 if (size <= so->tx.ll_dl - SF_PCI_SZ4 - ae - off) { in isotp_sendmsg()
1034 if (size <= CAN_MAX_DLEN - SF_PCI_SZ4 - ae) in isotp_sendmsg()
1037 isotp_fill_dataframe(cf, so, ae, off); in isotp_sendmsg()
1040 cf->data[ae] = N_PCI_SF; in isotp_sendmsg()
1044 cf->data[SF_PCI_SZ4 + ae] = size; in isotp_sendmsg()
1046 cf->data[ae] |= size; in isotp_sendmsg()
1053 isotp_create_fframe(cf, so, ae); in isotp_sendmsg()