Lines Matching refs:msg_head

368 	struct bcm_msg_head msg_head;  in bcm_tx_timeout_tsklet()  local
376 msg_head.opcode = TX_EXPIRED; in bcm_tx_timeout_tsklet()
377 msg_head.flags = op->flags; in bcm_tx_timeout_tsklet()
378 msg_head.count = op->count; in bcm_tx_timeout_tsklet()
379 msg_head.ival1 = op->ival1; in bcm_tx_timeout_tsklet()
380 msg_head.ival2 = op->ival2; in bcm_tx_timeout_tsklet()
381 msg_head.can_id = op->can_id; in bcm_tx_timeout_tsklet()
382 msg_head.nframes = 0; in bcm_tx_timeout_tsklet()
384 bcm_send_to_user(op, &msg_head, NULL, 0); in bcm_tx_timeout_tsklet()
531 struct bcm_msg_head msg_head; in bcm_rx_timeout_tsklet() local
534 msg_head.opcode = RX_TIMEOUT; in bcm_rx_timeout_tsklet()
535 msg_head.flags = op->flags; in bcm_rx_timeout_tsklet()
536 msg_head.count = op->count; in bcm_rx_timeout_tsklet()
537 msg_head.ival1 = op->ival1; in bcm_rx_timeout_tsklet()
538 msg_head.ival2 = op->ival2; in bcm_rx_timeout_tsklet()
539 msg_head.can_id = op->can_id; in bcm_rx_timeout_tsklet()
540 msg_head.nframes = 0; in bcm_rx_timeout_tsklet()
542 bcm_send_to_user(op, &msg_head, NULL, 0); in bcm_rx_timeout_tsklet()
810 static int bcm_read_op(struct list_head *ops, struct bcm_msg_head *msg_head, in bcm_read_op() argument
813 struct bcm_op *op = bcm_find_op(ops, msg_head->can_id, ifindex); in bcm_read_op()
819 msg_head->flags = op->flags; in bcm_read_op()
820 msg_head->count = op->count; in bcm_read_op()
821 msg_head->ival1 = op->ival1; in bcm_read_op()
822 msg_head->ival2 = op->ival2; in bcm_read_op()
823 msg_head->nframes = op->nframes; in bcm_read_op()
825 bcm_send_to_user(op, msg_head, op->frames, 0); in bcm_read_op()
833 static int bcm_tx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg, in bcm_tx_setup() argument
846 if (msg_head->nframes < 1 || msg_head->nframes > MAX_NFRAMES) in bcm_tx_setup()
850 op = bcm_find_op(&bo->tx_ops, msg_head->can_id, ifindex); in bcm_tx_setup()
860 if (msg_head->nframes > op->nframes) in bcm_tx_setup()
864 for (i = 0; i < msg_head->nframes; i++) { in bcm_tx_setup()
873 if (msg_head->flags & TX_CP_CAN_ID) { in bcm_tx_setup()
875 op->frames[i].can_id = msg_head->can_id; in bcm_tx_setup()
886 op->can_id = msg_head->can_id; in bcm_tx_setup()
889 if (msg_head->nframes > 1) { in bcm_tx_setup()
890 op->frames = kmalloc(msg_head->nframes * CFSIZ, in bcm_tx_setup()
899 for (i = 0; i < msg_head->nframes; i++) { in bcm_tx_setup()
912 if (msg_head->flags & TX_CP_CAN_ID) { in bcm_tx_setup()
914 op->frames[i].can_id = msg_head->can_id; in bcm_tx_setup()
941 if (op->nframes != msg_head->nframes) { in bcm_tx_setup()
942 op->nframes = msg_head->nframes; in bcm_tx_setup()
949 op->flags = msg_head->flags; in bcm_tx_setup()
958 op->count = msg_head->count; in bcm_tx_setup()
959 op->ival1 = msg_head->ival1; in bcm_tx_setup()
960 op->ival2 = msg_head->ival2; in bcm_tx_setup()
961 op->kt_ival1 = bcm_timeval_to_ktime(msg_head->ival1); in bcm_tx_setup()
962 op->kt_ival2 = bcm_timeval_to_ktime(msg_head->ival2); in bcm_tx_setup()
984 return msg_head->nframes * CFSIZ + MHSIZ; in bcm_tx_setup()
990 static int bcm_rx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg, in bcm_rx_setup() argument
998 if ((msg_head->flags & RX_FILTER_ID) || (!(msg_head->nframes))) { in bcm_rx_setup()
1000 msg_head->flags |= RX_FILTER_ID; in bcm_rx_setup()
1002 msg_head->nframes = 0; in bcm_rx_setup()
1006 if (msg_head->nframes > MAX_NFRAMES + 1) in bcm_rx_setup()
1009 if ((msg_head->flags & RX_RTR_FRAME) && in bcm_rx_setup()
1010 ((msg_head->nframes != 1) || in bcm_rx_setup()
1011 (!(msg_head->can_id & CAN_RTR_FLAG)))) in bcm_rx_setup()
1015 op = bcm_find_op(&bo->rx_ops, msg_head->can_id, ifindex); in bcm_rx_setup()
1024 if (msg_head->nframes > op->nframes) in bcm_rx_setup()
1027 if (msg_head->nframes) { in bcm_rx_setup()
1030 msg_head->nframes * CFSIZ); in bcm_rx_setup()
1035 memset(op->last_frames, 0, msg_head->nframes * CFSIZ); in bcm_rx_setup()
1038 op->nframes = msg_head->nframes; in bcm_rx_setup()
1049 op->can_id = msg_head->can_id; in bcm_rx_setup()
1050 op->nframes = msg_head->nframes; in bcm_rx_setup()
1052 if (msg_head->nframes > 1) { in bcm_rx_setup()
1054 op->frames = kmalloc(msg_head->nframes * CFSIZ, in bcm_rx_setup()
1062 op->last_frames = kzalloc(msg_head->nframes * CFSIZ, in bcm_rx_setup()
1075 if (msg_head->nframes) { in bcm_rx_setup()
1077 msg_head->nframes * CFSIZ); in bcm_rx_setup()
1119 op->flags = msg_head->flags; in bcm_rx_setup()
1140 op->ival1 = msg_head->ival1; in bcm_rx_setup()
1141 op->ival2 = msg_head->ival2; in bcm_rx_setup()
1142 op->kt_ival1 = bcm_timeval_to_ktime(msg_head->ival1); in bcm_rx_setup()
1143 op->kt_ival2 = bcm_timeval_to_ktime(msg_head->ival2); in bcm_rx_setup()
1191 return msg_head->nframes * CFSIZ + MHSIZ; in bcm_rx_setup()
1246 struct bcm_msg_head msg_head; in bcm_sendmsg() local
1289 ret = memcpy_from_msg((u8 *)&msg_head, msg, MHSIZ); in bcm_sendmsg()
1295 switch (msg_head.opcode) { in bcm_sendmsg()
1298 ret = bcm_tx_setup(&msg_head, msg, ifindex, sk); in bcm_sendmsg()
1302 ret = bcm_rx_setup(&msg_head, msg, ifindex, sk); in bcm_sendmsg()
1306 if (bcm_delete_tx_op(&bo->tx_ops, msg_head.can_id, ifindex)) in bcm_sendmsg()
1313 if (bcm_delete_rx_op(&bo->rx_ops, msg_head.can_id, ifindex)) in bcm_sendmsg()
1321 msg_head.opcode = TX_STATUS; in bcm_sendmsg()
1322 ret = bcm_read_op(&bo->tx_ops, &msg_head, ifindex); in bcm_sendmsg()
1327 msg_head.opcode = RX_STATUS; in bcm_sendmsg()
1328 ret = bcm_read_op(&bo->rx_ops, &msg_head, ifindex); in bcm_sendmsg()
1333 if ((msg_head.nframes != 1) || (size != CFSIZ + MHSIZ)) in bcm_sendmsg()