Lines Matching full: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()
629 const u8 *dat, int len) in j1939_tp_tx_dat() argument
639 skb_put_data(skb, dat, len); in j1939_tp_tx_dat()
648 bool swap_src_dst, pgn_t pgn, const u8 *dat) in j1939_xtp_do_tx_ctl() argument
661 memcpy(skdat, dat, 5); in j1939_xtp_do_tx_ctl()
670 bool swap_src_dst, const u8 *dat) in j1939_tp_tx_ctl() argument
676 session->skcb.addr.pgn, dat); in j1939_tp_tx_ctl()
685 u8 dat[5]; in j1939_xtp_tx_abort() local
690 memset(dat, 0xff, sizeof(dat)); in j1939_xtp_tx_abort()
691 dat[0] = J1939_TP_CMD_ABORT; in j1939_xtp_tx_abort()
692 dat[1] = err; in j1939_xtp_tx_abort()
693 return j1939_xtp_do_tx_ctl(priv, re_skcb, swap_src_dst, pgn, dat); in j1939_xtp_tx_abort()
714 u8 dat[8]; in j1939_session_tx_rts() local
717 memset(dat, 0xff, sizeof(dat)); in j1939_session_tx_rts()
719 dat[1] = (session->total_message_size >> 0); in j1939_session_tx_rts()
720 dat[2] = (session->total_message_size >> 8); in j1939_session_tx_rts()
721 dat[3] = session->pkt.total; in j1939_session_tx_rts()
724 dat[0] = J1939_ETP_CMD_RTS; in j1939_session_tx_rts()
725 dat[1] = (session->total_message_size >> 0); in j1939_session_tx_rts()
726 dat[2] = (session->total_message_size >> 8); in j1939_session_tx_rts()
727 dat[3] = (session->total_message_size >> 16); in j1939_session_tx_rts()
728 dat[4] = (session->total_message_size >> 24); in j1939_session_tx_rts()
730 dat[0] = J1939_TP_CMD_BAM; in j1939_session_tx_rts()
734 dat[0] = J1939_TP_CMD_RTS; in j1939_session_tx_rts()
735 dat[4] = dat[3]; in j1939_session_tx_rts()
738 if (dat[0] == session->last_txcmd) in j1939_session_tx_rts()
742 ret = j1939_tp_tx_ctl(session, false, dat); in j1939_session_tx_rts()
746 session->last_txcmd = dat[0]; in j1939_session_tx_rts()
747 if (dat[0] == J1939_TP_CMD_BAM) { in j1939_session_tx_rts()
762 u8 dat[8]; in j1939_session_tx_dpo() local
765 memset(dat, 0xff, sizeof(dat)); in j1939_session_tx_dpo()
767 dat[0] = J1939_ETP_CMD_DPO; in j1939_session_tx_dpo()
770 dat[1] = session->pkt.last - session->pkt.tx_acked; in j1939_session_tx_dpo()
771 dat[2] = (pkt >> 0); in j1939_session_tx_dpo()
772 dat[3] = (pkt >> 8); in j1939_session_tx_dpo()
773 dat[4] = (pkt >> 16); in j1939_session_tx_dpo()
775 ret = j1939_tp_tx_ctl(session, false, dat); in j1939_session_tx_dpo()
779 session->last_txcmd = dat[0]; in j1939_session_tx_dpo()
797 u8 dat[8]; in j1939_session_tx_dat() local
814 dat[0] = session->pkt.tx - session->pkt.dpo + 1; in j1939_session_tx_dat()
834 memcpy(&dat[1], &tpdat[offset], len); in j1939_session_tx_dat()
835 ret = j1939_tp_tx_dat(session, dat, len + 1); in j1939_session_tx_dat()
913 u8 dat[8]; in j1939_session_tx_cts() local
920 memset(dat, 0xff, sizeof(dat)); in j1939_session_tx_cts()
924 dat[0] = J1939_ETP_CMD_CTS; in j1939_session_tx_cts()
925 dat[1] = len; in j1939_session_tx_cts()
926 dat[2] = (pkt >> 0); in j1939_session_tx_cts()
927 dat[3] = (pkt >> 8); in j1939_session_tx_cts()
928 dat[4] = (pkt >> 16); in j1939_session_tx_cts()
930 dat[0] = J1939_TP_CMD_CTS; in j1939_session_tx_cts()
931 dat[1] = len; in j1939_session_tx_cts()
932 dat[2] = session->pkt.rx + 1; in j1939_session_tx_cts()
935 if (dat[0] == session->last_txcmd) in j1939_session_tx_cts()
939 ret = j1939_tp_tx_ctl(session, true, dat); in j1939_session_tx_cts()
945 session->last_txcmd = dat[0]; in j1939_session_tx_cts()
956 u8 dat[8]; in j1939_session_tx_eoma() local
962 memset(dat, 0xff, sizeof(dat)); in j1939_session_tx_eoma()
965 dat[0] = J1939_ETP_CMD_EOMA; in j1939_session_tx_eoma()
966 dat[1] = session->total_message_size >> 0; in j1939_session_tx_eoma()
967 dat[2] = session->total_message_size >> 8; in j1939_session_tx_eoma()
968 dat[3] = session->total_message_size >> 16; in j1939_session_tx_eoma()
969 dat[4] = session->total_message_size >> 24; in j1939_session_tx_eoma()
971 dat[0] = J1939_TP_CMD_EOMA; in j1939_session_tx_eoma()
972 dat[1] = session->total_message_size; in j1939_session_tx_eoma()
973 dat[2] = session->total_message_size >> 8; in j1939_session_tx_eoma()
974 dat[3] = session->pkt.total; in j1939_session_tx_eoma()
977 if (dat[0] == session->last_txcmd) in j1939_session_tx_eoma()
981 ret = j1939_tp_tx_ctl(session, true, dat); in j1939_session_tx_eoma()
985 session->last_txcmd = dat[0]; in j1939_session_tx_eoma()
1367 const u8 *dat; in j1939_xtp_rx_eoma_one() local
1373 dat = skb->data; in j1939_xtp_rx_eoma_one()
1376 len = j1939_etp_ctl_to_size(dat); in j1939_xtp_rx_eoma_one()
1378 len = j1939_tp_ctl_to_size(dat); in j1939_xtp_rx_eoma_one()
1416 const u8 *dat; in j1939_xtp_rx_cts_one() local
1418 dat = skb->data; in j1939_xtp_rx_cts_one()
1425 if (session->last_cmd == dat[0]) { in j1939_xtp_rx_cts_one()
1431 pkt = j1939_etp_ctl_to_packet(dat); in j1939_xtp_rx_cts_one()
1433 pkt = dat[2]; in j1939_xtp_rx_cts_one()
1437 else if (dat[1] > session->pkt.block /* 0xff for etp */) in j1939_xtp_rx_cts_one()
1443 session->pkt.last = session->pkt.tx_acked + dat[1]; in j1939_xtp_rx_cts_one()
1450 session->last_cmd = dat[0]; in j1939_xtp_rx_cts_one()
1451 if (dat[1]) { in j1939_xtp_rx_cts_one()
1592 const u8 *dat; in j1939_xtp_rx_rts_session_new() local
1598 dat = skb->data; in j1939_xtp_rx_rts_session_new()
1599 pgn = j1939_xtp_ctl_to_pgn(dat); in j1939_xtp_rx_rts_session_new()
1606 len = j1939_etp_ctl_to_size(dat); in j1939_xtp_rx_rts_session_new()
1614 len = j1939_tp_ctl_to_size(dat); in j1939_xtp_rx_rts_session_new()
1639 if (dat[3] != session->pkt.total) in j1939_xtp_rx_rts_session_new()
1642 dat[3]); in j1939_xtp_rx_rts_session_new()
1643 session->pkt.total = dat[3]; in j1939_xtp_rx_rts_session_new()
1644 session->pkt.block = min(dat[3], dat[4]); in j1939_xtp_rx_rts_session_new()
1764 const u8 *dat = skb->data; in j1939_xtp_rx_dpo_one() local
1773 session->last_cmd = dat[0]; in j1939_xtp_rx_dpo_one()
1805 const u8 *dat; in j1939_xtp_rx_dat_one() local
1815 dat = skb->data; in j1939_xtp_rx_dat_one()
1841 packet = (dat[0] - 1 + session->pkt.dpo); in j1939_xtp_rx_dat_one()
1869 memcpy(&tpdat[offset], &dat[1], nbytes); in j1939_xtp_rx_dat_one()
1873 err = memcmp(&tpdat[offset], &dat[1], nbytes); in j1939_xtp_rx_dat_one()
1878 nbytes, &dat[1], in j1939_xtp_rx_dat_one()