Lines Matching refs:dat

441 static inline pgn_t j1939_xtp_ctl_to_pgn(const u8 *dat)  in j1939_xtp_ctl_to_pgn()  argument
445 pgn = (dat[7] << 16) | (dat[6] << 8) | (dat[5] << 0); in j1939_xtp_ctl_to_pgn()
451 static inline unsigned int j1939_tp_ctl_to_size(const u8 *dat) in j1939_tp_ctl_to_size() argument
453 return (dat[2] << 8) + (dat[1] << 0); in j1939_tp_ctl_to_size()
456 static inline unsigned int j1939_etp_ctl_to_packet(const u8 *dat) in j1939_etp_ctl_to_packet() argument
458 return (dat[4] << 16) | (dat[3] << 8) | (dat[2] << 0); in j1939_etp_ctl_to_packet()
461 static inline unsigned int j1939_etp_ctl_to_size(const u8 *dat) in j1939_etp_ctl_to_size() argument
463 return (dat[4] << 24) | (dat[3] << 16) | in j1939_etp_ctl_to_size()
464 (dat[2] << 8) | (dat[1] << 0); in j1939_etp_ctl_to_size()
632 const u8 *dat, int len) in j1939_tp_tx_dat() argument
642 skb_put_data(skb, dat, len); in j1939_tp_tx_dat()
651 bool swap_src_dst, pgn_t pgn, const u8 *dat) in j1939_xtp_do_tx_ctl() argument
664 memcpy(skdat, dat, 5); in j1939_xtp_do_tx_ctl()
673 bool swap_src_dst, const u8 *dat) in j1939_tp_tx_ctl() argument
679 session->skcb.addr.pgn, dat); in j1939_tp_tx_ctl()
688 u8 dat[5]; in j1939_xtp_tx_abort() local
693 memset(dat, 0xff, sizeof(dat)); in j1939_xtp_tx_abort()
694 dat[0] = J1939_TP_CMD_ABORT; in j1939_xtp_tx_abort()
695 dat[1] = err; in j1939_xtp_tx_abort()
696 return j1939_xtp_do_tx_ctl(priv, re_skcb, swap_src_dst, pgn, dat); in j1939_xtp_tx_abort()
717 u8 dat[8]; in j1939_session_tx_rts() local
720 memset(dat, 0xff, sizeof(dat)); in j1939_session_tx_rts()
722 dat[1] = (session->total_message_size >> 0); in j1939_session_tx_rts()
723 dat[2] = (session->total_message_size >> 8); in j1939_session_tx_rts()
724 dat[3] = session->pkt.total; in j1939_session_tx_rts()
727 dat[0] = J1939_ETP_CMD_RTS; in j1939_session_tx_rts()
728 dat[1] = (session->total_message_size >> 0); in j1939_session_tx_rts()
729 dat[2] = (session->total_message_size >> 8); in j1939_session_tx_rts()
730 dat[3] = (session->total_message_size >> 16); in j1939_session_tx_rts()
731 dat[4] = (session->total_message_size >> 24); in j1939_session_tx_rts()
733 dat[0] = J1939_TP_CMD_BAM; in j1939_session_tx_rts()
737 dat[0] = J1939_TP_CMD_RTS; in j1939_session_tx_rts()
738 dat[4] = dat[3]; in j1939_session_tx_rts()
741 if (dat[0] == session->last_txcmd) in j1939_session_tx_rts()
745 ret = j1939_tp_tx_ctl(session, false, dat); in j1939_session_tx_rts()
749 session->last_txcmd = dat[0]; in j1939_session_tx_rts()
750 if (dat[0] == J1939_TP_CMD_BAM) { in j1939_session_tx_rts()
765 u8 dat[8]; in j1939_session_tx_dpo() local
768 memset(dat, 0xff, sizeof(dat)); in j1939_session_tx_dpo()
770 dat[0] = J1939_ETP_CMD_DPO; in j1939_session_tx_dpo()
773 dat[1] = session->pkt.last - session->pkt.tx_acked; in j1939_session_tx_dpo()
774 dat[2] = (pkt >> 0); in j1939_session_tx_dpo()
775 dat[3] = (pkt >> 8); in j1939_session_tx_dpo()
776 dat[4] = (pkt >> 16); in j1939_session_tx_dpo()
778 ret = j1939_tp_tx_ctl(session, false, dat); in j1939_session_tx_dpo()
782 session->last_txcmd = dat[0]; in j1939_session_tx_dpo()
800 u8 dat[8]; in j1939_session_tx_dat() local
817 dat[0] = session->pkt.tx - session->pkt.dpo + 1; in j1939_session_tx_dat()
837 memcpy(&dat[1], &tpdat[offset], len); in j1939_session_tx_dat()
838 ret = j1939_tp_tx_dat(session, dat, len + 1); in j1939_session_tx_dat()
916 u8 dat[8]; in j1939_session_tx_cts() local
923 memset(dat, 0xff, sizeof(dat)); in j1939_session_tx_cts()
927 dat[0] = J1939_ETP_CMD_CTS; in j1939_session_tx_cts()
928 dat[1] = len; in j1939_session_tx_cts()
929 dat[2] = (pkt >> 0); in j1939_session_tx_cts()
930 dat[3] = (pkt >> 8); in j1939_session_tx_cts()
931 dat[4] = (pkt >> 16); in j1939_session_tx_cts()
933 dat[0] = J1939_TP_CMD_CTS; in j1939_session_tx_cts()
934 dat[1] = len; in j1939_session_tx_cts()
935 dat[2] = session->pkt.rx + 1; in j1939_session_tx_cts()
938 if (dat[0] == session->last_txcmd) in j1939_session_tx_cts()
942 ret = j1939_tp_tx_ctl(session, true, dat); in j1939_session_tx_cts()
948 session->last_txcmd = dat[0]; in j1939_session_tx_cts()
959 u8 dat[8]; in j1939_session_tx_eoma() local
965 memset(dat, 0xff, sizeof(dat)); in j1939_session_tx_eoma()
968 dat[0] = J1939_ETP_CMD_EOMA; in j1939_session_tx_eoma()
969 dat[1] = session->total_message_size >> 0; in j1939_session_tx_eoma()
970 dat[2] = session->total_message_size >> 8; in j1939_session_tx_eoma()
971 dat[3] = session->total_message_size >> 16; in j1939_session_tx_eoma()
972 dat[4] = session->total_message_size >> 24; in j1939_session_tx_eoma()
974 dat[0] = J1939_TP_CMD_EOMA; in j1939_session_tx_eoma()
975 dat[1] = session->total_message_size; in j1939_session_tx_eoma()
976 dat[2] = session->total_message_size >> 8; in j1939_session_tx_eoma()
977 dat[3] = session->pkt.total; in j1939_session_tx_eoma()
980 if (dat[0] == session->last_txcmd) in j1939_session_tx_eoma()
984 ret = j1939_tp_tx_ctl(session, true, dat); in j1939_session_tx_eoma()
988 session->last_txcmd = dat[0]; in j1939_session_tx_eoma()
1370 const u8 *dat; in j1939_xtp_rx_eoma_one() local
1376 dat = skb->data; in j1939_xtp_rx_eoma_one()
1379 len = j1939_etp_ctl_to_size(dat); in j1939_xtp_rx_eoma_one()
1381 len = j1939_tp_ctl_to_size(dat); in j1939_xtp_rx_eoma_one()
1419 const u8 *dat; in j1939_xtp_rx_cts_one() local
1421 dat = skb->data; in j1939_xtp_rx_cts_one()
1428 if (session->last_cmd == dat[0]) { in j1939_xtp_rx_cts_one()
1434 pkt = j1939_etp_ctl_to_packet(dat); in j1939_xtp_rx_cts_one()
1436 pkt = dat[2]; in j1939_xtp_rx_cts_one()
1440 else if (dat[1] > session->pkt.block /* 0xff for etp */) in j1939_xtp_rx_cts_one()
1446 session->pkt.last = session->pkt.tx_acked + dat[1]; in j1939_xtp_rx_cts_one()
1453 session->last_cmd = dat[0]; in j1939_xtp_rx_cts_one()
1454 if (dat[1]) { in j1939_xtp_rx_cts_one()
1595 const u8 *dat; in j1939_xtp_rx_rts_session_new() local
1601 dat = skb->data; in j1939_xtp_rx_rts_session_new()
1602 pgn = j1939_xtp_ctl_to_pgn(dat); in j1939_xtp_rx_rts_session_new()
1609 len = j1939_etp_ctl_to_size(dat); in j1939_xtp_rx_rts_session_new()
1617 len = j1939_tp_ctl_to_size(dat); in j1939_xtp_rx_rts_session_new()
1642 if (dat[3] != session->pkt.total) in j1939_xtp_rx_rts_session_new()
1645 dat[3]); in j1939_xtp_rx_rts_session_new()
1646 session->pkt.total = dat[3]; in j1939_xtp_rx_rts_session_new()
1647 session->pkt.block = min(dat[3], dat[4]); in j1939_xtp_rx_rts_session_new()
1767 const u8 *dat = skb->data; in j1939_xtp_rx_dpo_one() local
1776 session->last_cmd = dat[0]; in j1939_xtp_rx_dpo_one()
1808 const u8 *dat; in j1939_xtp_rx_dat_one() local
1818 dat = skb->data; in j1939_xtp_rx_dat_one()
1844 packet = (dat[0] - 1 + session->pkt.dpo); in j1939_xtp_rx_dat_one()
1872 memcpy(&tpdat[offset], &dat[1], nbytes); in j1939_xtp_rx_dat_one()
1876 err = memcmp(&tpdat[offset], &dat[1], nbytes); in j1939_xtp_rx_dat_one()
1881 nbytes, &dat[1], in j1939_xtp_rx_dat_one()