Lines Matching refs:msg_head

369 	struct bcm_msg_head msg_head;  in bcm_tx_timeout_tsklet()  local
377 msg_head.opcode = TX_EXPIRED; in bcm_tx_timeout_tsklet()
378 msg_head.flags = op->flags; in bcm_tx_timeout_tsklet()
379 msg_head.count = op->count; in bcm_tx_timeout_tsklet()
380 msg_head.ival1 = op->ival1; in bcm_tx_timeout_tsklet()
381 msg_head.ival2 = op->ival2; in bcm_tx_timeout_tsklet()
382 msg_head.can_id = op->can_id; in bcm_tx_timeout_tsklet()
383 msg_head.nframes = 0; in bcm_tx_timeout_tsklet()
385 bcm_send_to_user(op, &msg_head, NULL, 0); in bcm_tx_timeout_tsklet()
535 struct bcm_msg_head msg_head; in bcm_rx_timeout_tsklet() local
538 msg_head.opcode = RX_TIMEOUT; in bcm_rx_timeout_tsklet()
539 msg_head.flags = op->flags; in bcm_rx_timeout_tsklet()
540 msg_head.count = op->count; in bcm_rx_timeout_tsklet()
541 msg_head.ival1 = op->ival1; in bcm_rx_timeout_tsklet()
542 msg_head.ival2 = op->ival2; in bcm_rx_timeout_tsklet()
543 msg_head.can_id = op->can_id; in bcm_rx_timeout_tsklet()
544 msg_head.nframes = 0; in bcm_rx_timeout_tsklet()
546 bcm_send_to_user(op, &msg_head, NULL, 0); in bcm_rx_timeout_tsklet()
836 static int bcm_read_op(struct list_head *ops, struct bcm_msg_head *msg_head, in bcm_read_op() argument
839 struct bcm_op *op = bcm_find_op(ops, msg_head, ifindex); in bcm_read_op()
845 msg_head->flags = op->flags; in bcm_read_op()
846 msg_head->count = op->count; in bcm_read_op()
847 msg_head->ival1 = op->ival1; in bcm_read_op()
848 msg_head->ival2 = op->ival2; in bcm_read_op()
849 msg_head->nframes = op->nframes; in bcm_read_op()
851 bcm_send_to_user(op, msg_head, op->frames, 0); in bcm_read_op()
859 static int bcm_tx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg, in bcm_tx_setup() argument
873 if (msg_head->nframes < 1 || msg_head->nframes > MAX_NFRAMES) in bcm_tx_setup()
877 op = bcm_find_op(&bo->tx_ops, msg_head, ifindex); in bcm_tx_setup()
886 if (msg_head->nframes > op->nframes) in bcm_tx_setup()
890 for (i = 0; i < msg_head->nframes; i++) { in bcm_tx_setup()
906 if (msg_head->flags & TX_CP_CAN_ID) { in bcm_tx_setup()
908 cf->can_id = msg_head->can_id; in bcm_tx_setup()
911 op->flags = msg_head->flags; in bcm_tx_setup()
920 op->can_id = msg_head->can_id; in bcm_tx_setup()
921 op->cfsiz = CFSIZ(msg_head->flags); in bcm_tx_setup()
922 op->flags = msg_head->flags; in bcm_tx_setup()
925 if (msg_head->nframes > 1) { in bcm_tx_setup()
926 op->frames = kmalloc_array(msg_head->nframes, in bcm_tx_setup()
936 for (i = 0; i < msg_head->nframes; i++) { in bcm_tx_setup()
956 if (msg_head->flags & TX_CP_CAN_ID) { in bcm_tx_setup()
958 cf->can_id = msg_head->can_id; in bcm_tx_setup()
985 if (op->nframes != msg_head->nframes) { in bcm_tx_setup()
986 op->nframes = msg_head->nframes; in bcm_tx_setup()
1000 op->count = msg_head->count; in bcm_tx_setup()
1001 op->ival1 = msg_head->ival1; in bcm_tx_setup()
1002 op->ival2 = msg_head->ival2; in bcm_tx_setup()
1003 op->kt_ival1 = bcm_timeval_to_ktime(msg_head->ival1); in bcm_tx_setup()
1004 op->kt_ival2 = bcm_timeval_to_ktime(msg_head->ival2); in bcm_tx_setup()
1026 return msg_head->nframes * op->cfsiz + MHSIZ; in bcm_tx_setup()
1032 static int bcm_rx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg, in bcm_rx_setup() argument
1040 if ((msg_head->flags & RX_FILTER_ID) || (!(msg_head->nframes))) { in bcm_rx_setup()
1042 msg_head->flags |= RX_FILTER_ID; in bcm_rx_setup()
1044 msg_head->nframes = 0; in bcm_rx_setup()
1048 if (msg_head->nframes > MAX_NFRAMES + 1) in bcm_rx_setup()
1051 if ((msg_head->flags & RX_RTR_FRAME) && in bcm_rx_setup()
1052 ((msg_head->nframes != 1) || in bcm_rx_setup()
1053 (!(msg_head->can_id & CAN_RTR_FLAG)))) in bcm_rx_setup()
1057 op = bcm_find_op(&bo->rx_ops, msg_head, ifindex); in bcm_rx_setup()
1066 if (msg_head->nframes > op->nframes) in bcm_rx_setup()
1069 if (msg_head->nframes) { in bcm_rx_setup()
1072 msg_head->nframes * op->cfsiz); in bcm_rx_setup()
1077 memset(op->last_frames, 0, msg_head->nframes * op->cfsiz); in bcm_rx_setup()
1080 op->nframes = msg_head->nframes; in bcm_rx_setup()
1081 op->flags = msg_head->flags; in bcm_rx_setup()
1092 op->can_id = msg_head->can_id; in bcm_rx_setup()
1093 op->nframes = msg_head->nframes; in bcm_rx_setup()
1094 op->cfsiz = CFSIZ(msg_head->flags); in bcm_rx_setup()
1095 op->flags = msg_head->flags; in bcm_rx_setup()
1097 if (msg_head->nframes > 1) { in bcm_rx_setup()
1099 op->frames = kmalloc_array(msg_head->nframes, in bcm_rx_setup()
1108 op->last_frames = kcalloc(msg_head->nframes, in bcm_rx_setup()
1122 if (msg_head->nframes) { in bcm_rx_setup()
1124 msg_head->nframes * op->cfsiz); in bcm_rx_setup()
1187 op->ival1 = msg_head->ival1; in bcm_rx_setup()
1188 op->ival2 = msg_head->ival2; in bcm_rx_setup()
1189 op->kt_ival1 = bcm_timeval_to_ktime(msg_head->ival1); in bcm_rx_setup()
1190 op->kt_ival2 = bcm_timeval_to_ktime(msg_head->ival2); in bcm_rx_setup()
1239 return msg_head->nframes * op->cfsiz + MHSIZ; in bcm_rx_setup()
1295 struct bcm_msg_head msg_head; in bcm_sendmsg() local
1307 ret = memcpy_from_msg((u8 *)&msg_head, msg, MHSIZ); in bcm_sendmsg()
1311 cfsiz = CFSIZ(msg_head.flags); in bcm_sendmsg()
1348 switch (msg_head.opcode) { in bcm_sendmsg()
1351 ret = bcm_tx_setup(&msg_head, msg, ifindex, sk); in bcm_sendmsg()
1355 ret = bcm_rx_setup(&msg_head, msg, ifindex, sk); in bcm_sendmsg()
1359 if (bcm_delete_tx_op(&bo->tx_ops, &msg_head, ifindex)) in bcm_sendmsg()
1366 if (bcm_delete_rx_op(&bo->rx_ops, &msg_head, ifindex)) in bcm_sendmsg()
1374 msg_head.opcode = TX_STATUS; in bcm_sendmsg()
1375 ret = bcm_read_op(&bo->tx_ops, &msg_head, ifindex); in bcm_sendmsg()
1380 msg_head.opcode = RX_STATUS; in bcm_sendmsg()
1381 ret = bcm_read_op(&bo->rx_ops, &msg_head, ifindex); in bcm_sendmsg()
1386 if ((msg_head.nframes != 1) || (size != cfsiz + MHSIZ)) in bcm_sendmsg()