Lines Matching refs:msg_head

363 	struct bcm_msg_head msg_head;  in bcm_tx_timeout_tsklet()  local
371 msg_head.opcode = TX_EXPIRED; in bcm_tx_timeout_tsklet()
372 msg_head.flags = op->flags; in bcm_tx_timeout_tsklet()
373 msg_head.count = op->count; in bcm_tx_timeout_tsklet()
374 msg_head.ival1 = op->ival1; in bcm_tx_timeout_tsklet()
375 msg_head.ival2 = op->ival2; in bcm_tx_timeout_tsklet()
376 msg_head.can_id = op->can_id; in bcm_tx_timeout_tsklet()
377 msg_head.nframes = 0; in bcm_tx_timeout_tsklet()
379 bcm_send_to_user(op, &msg_head, NULL, 0); in bcm_tx_timeout_tsklet()
526 struct bcm_msg_head msg_head; in bcm_rx_timeout_tsklet() local
529 msg_head.opcode = RX_TIMEOUT; in bcm_rx_timeout_tsklet()
530 msg_head.flags = op->flags; in bcm_rx_timeout_tsklet()
531 msg_head.count = op->count; in bcm_rx_timeout_tsklet()
532 msg_head.ival1 = op->ival1; in bcm_rx_timeout_tsklet()
533 msg_head.ival2 = op->ival2; in bcm_rx_timeout_tsklet()
534 msg_head.can_id = op->can_id; in bcm_rx_timeout_tsklet()
535 msg_head.nframes = 0; in bcm_rx_timeout_tsklet()
537 bcm_send_to_user(op, &msg_head, NULL, 0); in bcm_rx_timeout_tsklet()
805 static int bcm_read_op(struct list_head *ops, struct bcm_msg_head *msg_head, in bcm_read_op() argument
808 struct bcm_op *op = bcm_find_op(ops, msg_head->can_id, ifindex); in bcm_read_op()
814 msg_head->flags = op->flags; in bcm_read_op()
815 msg_head->count = op->count; in bcm_read_op()
816 msg_head->ival1 = op->ival1; in bcm_read_op()
817 msg_head->ival2 = op->ival2; in bcm_read_op()
818 msg_head->nframes = op->nframes; in bcm_read_op()
820 bcm_send_to_user(op, msg_head, op->frames, 0); in bcm_read_op()
828 static int bcm_tx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg, in bcm_tx_setup() argument
841 if (msg_head->nframes < 1 || msg_head->nframes > MAX_NFRAMES) in bcm_tx_setup()
845 op = bcm_find_op(&bo->tx_ops, msg_head->can_id, ifindex); in bcm_tx_setup()
855 if (msg_head->nframes > op->nframes) in bcm_tx_setup()
859 for (i = 0; i < msg_head->nframes; i++) { in bcm_tx_setup()
868 if (msg_head->flags & TX_CP_CAN_ID) { in bcm_tx_setup()
870 op->frames[i].can_id = msg_head->can_id; in bcm_tx_setup()
881 op->can_id = msg_head->can_id; in bcm_tx_setup()
884 if (msg_head->nframes > 1) { in bcm_tx_setup()
885 op->frames = kmalloc(msg_head->nframes * CFSIZ, in bcm_tx_setup()
894 for (i = 0; i < msg_head->nframes; i++) { in bcm_tx_setup()
907 if (msg_head->flags & TX_CP_CAN_ID) { in bcm_tx_setup()
909 op->frames[i].can_id = msg_head->can_id; in bcm_tx_setup()
936 if (op->nframes != msg_head->nframes) { in bcm_tx_setup()
937 op->nframes = msg_head->nframes; in bcm_tx_setup()
944 op->flags = msg_head->flags; in bcm_tx_setup()
953 op->count = msg_head->count; in bcm_tx_setup()
954 op->ival1 = msg_head->ival1; in bcm_tx_setup()
955 op->ival2 = msg_head->ival2; in bcm_tx_setup()
956 op->kt_ival1 = timeval_to_ktime(msg_head->ival1); in bcm_tx_setup()
957 op->kt_ival2 = timeval_to_ktime(msg_head->ival2); in bcm_tx_setup()
979 return msg_head->nframes * CFSIZ + MHSIZ; in bcm_tx_setup()
985 static int bcm_rx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg, in bcm_rx_setup() argument
993 if ((msg_head->flags & RX_FILTER_ID) || (!(msg_head->nframes))) { in bcm_rx_setup()
995 msg_head->flags |= RX_FILTER_ID; in bcm_rx_setup()
997 msg_head->nframes = 0; in bcm_rx_setup()
1001 if (msg_head->nframes > MAX_NFRAMES + 1) in bcm_rx_setup()
1004 if ((msg_head->flags & RX_RTR_FRAME) && in bcm_rx_setup()
1005 ((msg_head->nframes != 1) || in bcm_rx_setup()
1006 (!(msg_head->can_id & CAN_RTR_FLAG)))) in bcm_rx_setup()
1010 op = bcm_find_op(&bo->rx_ops, msg_head->can_id, ifindex); in bcm_rx_setup()
1019 if (msg_head->nframes > op->nframes) in bcm_rx_setup()
1022 if (msg_head->nframes) { in bcm_rx_setup()
1025 msg_head->nframes * CFSIZ); in bcm_rx_setup()
1030 memset(op->last_frames, 0, msg_head->nframes * CFSIZ); in bcm_rx_setup()
1033 op->nframes = msg_head->nframes; in bcm_rx_setup()
1044 op->can_id = msg_head->can_id; in bcm_rx_setup()
1045 op->nframes = msg_head->nframes; in bcm_rx_setup()
1047 if (msg_head->nframes > 1) { in bcm_rx_setup()
1049 op->frames = kmalloc(msg_head->nframes * CFSIZ, in bcm_rx_setup()
1057 op->last_frames = kzalloc(msg_head->nframes * CFSIZ, in bcm_rx_setup()
1070 if (msg_head->nframes) { in bcm_rx_setup()
1072 msg_head->nframes * CFSIZ); in bcm_rx_setup()
1114 op->flags = msg_head->flags; in bcm_rx_setup()
1135 op->ival1 = msg_head->ival1; in bcm_rx_setup()
1136 op->ival2 = msg_head->ival2; in bcm_rx_setup()
1137 op->kt_ival1 = timeval_to_ktime(msg_head->ival1); in bcm_rx_setup()
1138 op->kt_ival2 = timeval_to_ktime(msg_head->ival2); in bcm_rx_setup()
1186 return msg_head->nframes * CFSIZ + MHSIZ; in bcm_rx_setup()
1241 struct bcm_msg_head msg_head; in bcm_sendmsg() local
1284 ret = memcpy_from_msg((u8 *)&msg_head, msg, MHSIZ); in bcm_sendmsg()
1290 switch (msg_head.opcode) { in bcm_sendmsg()
1293 ret = bcm_tx_setup(&msg_head, msg, ifindex, sk); in bcm_sendmsg()
1297 ret = bcm_rx_setup(&msg_head, msg, ifindex, sk); in bcm_sendmsg()
1301 if (bcm_delete_tx_op(&bo->tx_ops, msg_head.can_id, ifindex)) in bcm_sendmsg()
1308 if (bcm_delete_rx_op(&bo->rx_ops, msg_head.can_id, ifindex)) in bcm_sendmsg()
1316 msg_head.opcode = TX_STATUS; in bcm_sendmsg()
1317 ret = bcm_read_op(&bo->tx_ops, &msg_head, ifindex); in bcm_sendmsg()
1322 msg_head.opcode = RX_STATUS; in bcm_sendmsg()
1323 ret = bcm_read_op(&bo->rx_ops, &msg_head, ifindex); in bcm_sendmsg()
1328 if ((msg_head.nframes != 1) || (size != CFSIZ + MHSIZ)) in bcm_sendmsg()