Lines Matching full:msg
179 } msg; member
224 struct esd_usb_msg *msg) in esd_usb_rx_event() argument
229 u32 id = le32_to_cpu(msg->msg.rx.id) & ESD_IDMASK; in esd_usb_rx_event()
232 u8 state = msg->msg.rx.data[0]; in esd_usb_rx_event()
233 u8 ecc = msg->msg.rx.data[1]; in esd_usb_rx_event()
234 u8 rxerr = msg->msg.rx.data[2]; in esd_usb_rx_event()
235 u8 txerr = msg->msg.rx.data[3]; in esd_usb_rx_event()
239 msg->msg.rx.dlc, state, ecc, rxerr, txerr); in esd_usb_rx_event()
315 struct esd_usb_msg *msg) in esd_usb_rx_can_msg() argument
326 id = le32_to_cpu(msg->msg.rx.id); in esd_usb_rx_can_msg()
329 esd_usb_rx_event(priv, msg); in esd_usb_rx_can_msg()
338 can_frame_set_cc_len(cf, msg->msg.rx.dlc & ~ESD_RTR, in esd_usb_rx_can_msg()
344 if (msg->msg.rx.dlc & ESD_RTR) { in esd_usb_rx_can_msg()
348 cf->data[i] = msg->msg.rx.data[i]; in esd_usb_rx_can_msg()
359 struct esd_usb_msg *msg) in esd_usb_tx_done_msg() argument
368 context = &priv->tx_contexts[msg->msg.txdone.hnd & (MAX_TX_URBS - 1)]; in esd_usb_tx_done_msg()
370 if (!msg->msg.txdone.status) { in esd_usb_tx_done_msg()
410 struct esd_usb_msg *msg; in esd_usb_read_bulk_callback() local
412 msg = (struct esd_usb_msg *)(urb->transfer_buffer + pos); in esd_usb_read_bulk_callback()
414 switch (msg->msg.hdr.cmd) { in esd_usb_read_bulk_callback()
416 if (msg->msg.rx.net >= dev->net_count) { in esd_usb_read_bulk_callback()
421 esd_usb_rx_can_msg(dev->nets[msg->msg.rx.net], msg); in esd_usb_read_bulk_callback()
425 if (msg->msg.txdone.net >= dev->net_count) { in esd_usb_read_bulk_callback()
430 esd_usb_tx_done_msg(dev->nets[msg->msg.txdone.net], in esd_usb_read_bulk_callback()
431 msg); in esd_usb_read_bulk_callback()
435 pos += msg->msg.hdr.len << 2; in esd_usb_read_bulk_callback()
522 static int esd_usb_send_msg(struct esd_usb *dev, struct esd_usb_msg *msg) in esd_usb_send_msg() argument
528 msg, in esd_usb_send_msg()
529 msg->msg.hdr.len << 2, in esd_usb_send_msg()
535 struct esd_usb_msg *msg) in esd_usb_wait_msg() argument
541 msg, in esd_usb_wait_msg()
542 sizeof(*msg), in esd_usb_wait_msg()
623 struct esd_usb_msg *msg; in esd_usb_start() local
626 msg = kmalloc(sizeof(*msg), GFP_KERNEL); in esd_usb_start()
627 if (!msg) { in esd_usb_start()
644 msg->msg.hdr.cmd = CMD_IDADD; in esd_usb_start()
645 msg->msg.hdr.len = 2 + ESD_MAX_ID_SEGMENT; in esd_usb_start()
646 msg->msg.filter.net = priv->index; in esd_usb_start()
647 msg->msg.filter.option = ESD_ID_ENABLE; /* start with segment 0 */ in esd_usb_start()
649 msg->msg.filter.mask[i] = cpu_to_le32(0xffffffff); in esd_usb_start()
651 msg->msg.filter.mask[ESD_MAX_ID_SEGMENT] = cpu_to_le32(0x00000001); in esd_usb_start()
653 err = esd_usb_send_msg(dev, msg); in esd_usb_start()
669 kfree(msg); in esd_usb_start()
727 struct esd_usb_msg *msg; in esd_usb_start_xmit() local
754 msg = (struct esd_usb_msg *)buf; in esd_usb_start_xmit()
756 msg->msg.hdr.len = 3; /* minimal length */ in esd_usb_start_xmit()
757 msg->msg.hdr.cmd = CMD_CAN_TX; in esd_usb_start_xmit()
758 msg->msg.tx.net = priv->index; in esd_usb_start_xmit()
759 msg->msg.tx.dlc = can_get_cc_dlc(cf, priv->can.ctrlmode); in esd_usb_start_xmit()
760 msg->msg.tx.id = cpu_to_le32(cf->can_id & CAN_ERR_MASK); in esd_usb_start_xmit()
763 msg->msg.tx.dlc |= ESD_RTR; in esd_usb_start_xmit()
766 msg->msg.tx.id |= cpu_to_le32(ESD_EXTID); in esd_usb_start_xmit()
769 msg->msg.tx.data[i] = cf->data[i]; in esd_usb_start_xmit()
771 msg->msg.hdr.len += (cf->len + 3) >> 2; in esd_usb_start_xmit()
791 msg->msg.tx.hnd = 0x80000000 | i; /* returned in TX done message */ in esd_usb_start_xmit()
794 msg->msg.hdr.len << 2, in esd_usb_start_xmit()
848 struct esd_usb_msg *msg; in esd_usb_close() local
851 msg = kmalloc(sizeof(*msg), GFP_KERNEL); in esd_usb_close()
852 if (!msg) in esd_usb_close()
856 msg->msg.hdr.cmd = CMD_IDADD; in esd_usb_close()
857 msg->msg.hdr.len = 2 + ESD_MAX_ID_SEGMENT; in esd_usb_close()
858 msg->msg.filter.net = priv->index; in esd_usb_close()
859 msg->msg.filter.option = ESD_ID_ENABLE; /* start with segment 0 */ in esd_usb_close()
861 msg->msg.filter.mask[i] = 0; in esd_usb_close()
862 if (esd_usb_send_msg(priv->usb, msg) < 0) in esd_usb_close()
866 msg->msg.hdr.len = 2; in esd_usb_close()
867 msg->msg.hdr.cmd = CMD_SETBAUD; in esd_usb_close()
868 msg->msg.setbaud.net = priv->index; in esd_usb_close()
869 msg->msg.setbaud.rsvd = 0; in esd_usb_close()
870 msg->msg.setbaud.baud = cpu_to_le32(ESD_USB_NO_BAUDRATE); in esd_usb_close()
871 if (esd_usb_send_msg(priv->usb, msg) < 0) in esd_usb_close()
880 kfree(msg); in esd_usb_close()
912 struct esd_usb_msg *msg; in esd_usb2_set_bittiming() local
939 msg = kmalloc(sizeof(*msg), GFP_KERNEL); in esd_usb2_set_bittiming()
940 if (!msg) in esd_usb2_set_bittiming()
943 msg->msg.hdr.len = 2; in esd_usb2_set_bittiming()
944 msg->msg.hdr.cmd = CMD_SETBAUD; in esd_usb2_set_bittiming()
945 msg->msg.setbaud.net = priv->index; in esd_usb2_set_bittiming()
946 msg->msg.setbaud.rsvd = 0; in esd_usb2_set_bittiming()
947 msg->msg.setbaud.baud = cpu_to_le32(canbtr); in esd_usb2_set_bittiming()
951 err = esd_usb_send_msg(priv->usb, msg); in esd_usb2_set_bittiming()
953 kfree(msg); in esd_usb2_set_bittiming()
1058 struct esd_usb_msg *msg; in esd_usb_probe() local
1073 msg = kmalloc(sizeof(*msg), GFP_KERNEL); in esd_usb_probe()
1074 if (!msg) { in esd_usb_probe()
1080 msg->msg.hdr.cmd = CMD_VERSION; in esd_usb_probe()
1081 msg->msg.hdr.len = 2; in esd_usb_probe()
1082 msg->msg.version.rsvd = 0; in esd_usb_probe()
1083 msg->msg.version.flags = 0; in esd_usb_probe()
1084 msg->msg.version.drv_version = 0; in esd_usb_probe()
1086 err = esd_usb_send_msg(dev, msg); in esd_usb_probe()
1092 err = esd_usb_wait_msg(dev, msg); in esd_usb_probe()
1098 dev->net_count = (int)msg->msg.version_reply.nets; in esd_usb_probe()
1099 dev->version = le32_to_cpu(msg->msg.version_reply.version); in esd_usb_probe()
1118 kfree(msg); in esd_usb_probe()