/linux-4.4.14/net/can/ |
H A D | bcm.c | 368 struct bcm_msg_head msg_head; bcm_tx_timeout_tsklet() local 376 msg_head.opcode = TX_EXPIRED; bcm_tx_timeout_tsklet() 377 msg_head.flags = op->flags; bcm_tx_timeout_tsklet() 378 msg_head.count = op->count; bcm_tx_timeout_tsklet() 379 msg_head.ival1 = op->ival1; bcm_tx_timeout_tsklet() 380 msg_head.ival2 = op->ival2; bcm_tx_timeout_tsklet() 381 msg_head.can_id = op->can_id; bcm_tx_timeout_tsklet() 382 msg_head.nframes = 0; bcm_tx_timeout_tsklet() 384 bcm_send_to_user(op, &msg_head, NULL, 0); bcm_tx_timeout_tsklet() 531 struct bcm_msg_head msg_head; bcm_rx_timeout_tsklet() local 534 msg_head.opcode = RX_TIMEOUT; bcm_rx_timeout_tsklet() 535 msg_head.flags = op->flags; bcm_rx_timeout_tsklet() 536 msg_head.count = op->count; bcm_rx_timeout_tsklet() 537 msg_head.ival1 = op->ival1; bcm_rx_timeout_tsklet() 538 msg_head.ival2 = op->ival2; bcm_rx_timeout_tsklet() 539 msg_head.can_id = op->can_id; bcm_rx_timeout_tsklet() 540 msg_head.nframes = 0; bcm_rx_timeout_tsklet() 542 bcm_send_to_user(op, &msg_head, NULL, 0); bcm_rx_timeout_tsklet() 810 static int bcm_read_op(struct list_head *ops, struct bcm_msg_head *msg_head, bcm_read_op() argument 813 struct bcm_op *op = bcm_find_op(ops, msg_head->can_id, ifindex); bcm_read_op() 818 /* put current values into msg_head */ bcm_read_op() 819 msg_head->flags = op->flags; bcm_read_op() 820 msg_head->count = op->count; bcm_read_op() 821 msg_head->ival1 = op->ival1; bcm_read_op() 822 msg_head->ival2 = op->ival2; bcm_read_op() 823 msg_head->nframes = op->nframes; bcm_read_op() 825 bcm_send_to_user(op, msg_head, op->frames, 0); bcm_read_op() 833 static int bcm_tx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg, bcm_tx_setup() argument 846 if (msg_head->nframes < 1 || msg_head->nframes > MAX_NFRAMES) bcm_tx_setup() 850 op = bcm_find_op(&bo->tx_ops, msg_head->can_id, ifindex); bcm_tx_setup() 860 if (msg_head->nframes > op->nframes) bcm_tx_setup() 864 for (i = 0; i < msg_head->nframes; i++) { bcm_tx_setup() 873 if (msg_head->flags & TX_CP_CAN_ID) { bcm_tx_setup() 875 op->frames[i].can_id = msg_head->can_id; bcm_tx_setup() 886 op->can_id = msg_head->can_id; bcm_tx_setup() 889 if (msg_head->nframes > 1) { bcm_tx_setup() 890 op->frames = kmalloc(msg_head->nframes * CFSIZ, bcm_tx_setup() 899 for (i = 0; i < msg_head->nframes; i++) { bcm_tx_setup() 912 if (msg_head->flags & TX_CP_CAN_ID) { bcm_tx_setup() 914 op->frames[i].can_id = msg_head->can_id; bcm_tx_setup() 939 } /* if ((op = bcm_find_op(&bo->tx_ops, msg_head->can_id, ifindex))) */ bcm_tx_setup() 941 if (op->nframes != msg_head->nframes) { bcm_tx_setup() 942 op->nframes = msg_head->nframes; bcm_tx_setup() 949 op->flags = msg_head->flags; bcm_tx_setup() 958 op->count = msg_head->count; bcm_tx_setup() 959 op->ival1 = msg_head->ival1; bcm_tx_setup() 960 op->ival2 = msg_head->ival2; bcm_tx_setup() 961 op->kt_ival1 = bcm_timeval_to_ktime(msg_head->ival1); bcm_tx_setup() 962 op->kt_ival2 = bcm_timeval_to_ktime(msg_head->ival2); bcm_tx_setup() 984 return msg_head->nframes * CFSIZ + MHSIZ; bcm_tx_setup() 990 static int bcm_rx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg, bcm_rx_setup() argument 998 if ((msg_head->flags & RX_FILTER_ID) || (!(msg_head->nframes))) { bcm_rx_setup() 1000 msg_head->flags |= RX_FILTER_ID; bcm_rx_setup() 1002 msg_head->nframes = 0; bcm_rx_setup() 1006 if (msg_head->nframes > MAX_NFRAMES + 1) bcm_rx_setup() 1009 if ((msg_head->flags & RX_RTR_FRAME) && bcm_rx_setup() 1010 ((msg_head->nframes != 1) || bcm_rx_setup() 1011 (!(msg_head->can_id & CAN_RTR_FLAG)))) bcm_rx_setup() 1015 op = bcm_find_op(&bo->rx_ops, msg_head->can_id, ifindex); bcm_rx_setup() 1024 if (msg_head->nframes > op->nframes) bcm_rx_setup() 1027 if (msg_head->nframes) { bcm_rx_setup() 1030 msg_head->nframes * CFSIZ); bcm_rx_setup() 1035 memset(op->last_frames, 0, msg_head->nframes * CFSIZ); bcm_rx_setup() 1038 op->nframes = msg_head->nframes; bcm_rx_setup() 1049 op->can_id = msg_head->can_id; bcm_rx_setup() 1050 op->nframes = msg_head->nframes; bcm_rx_setup() 1052 if (msg_head->nframes > 1) { bcm_rx_setup() 1054 op->frames = kmalloc(msg_head->nframes * CFSIZ, bcm_rx_setup() 1062 op->last_frames = kzalloc(msg_head->nframes * CFSIZ, bcm_rx_setup() 1075 if (msg_head->nframes) { bcm_rx_setup() 1077 msg_head->nframes * CFSIZ); bcm_rx_setup() 1116 } /* if ((op = bcm_find_op(&bo->rx_ops, msg_head->can_id, ifindex))) */ bcm_rx_setup() 1119 op->flags = msg_head->flags; bcm_rx_setup() 1140 op->ival1 = msg_head->ival1; bcm_rx_setup() 1141 op->ival2 = msg_head->ival2; bcm_rx_setup() 1142 op->kt_ival1 = bcm_timeval_to_ktime(msg_head->ival1); bcm_rx_setup() 1143 op->kt_ival2 = bcm_timeval_to_ktime(msg_head->ival2); bcm_rx_setup() 1191 return msg_head->nframes * CFSIZ + MHSIZ; bcm_rx_setup() 1246 struct bcm_msg_head msg_head; bcm_sendmsg() local 1289 ret = memcpy_from_msg((u8 *)&msg_head, msg, MHSIZ); bcm_sendmsg() 1295 switch (msg_head.opcode) { bcm_sendmsg() 1298 ret = bcm_tx_setup(&msg_head, msg, ifindex, sk); bcm_sendmsg() 1302 ret = bcm_rx_setup(&msg_head, msg, ifindex, sk); bcm_sendmsg() 1306 if (bcm_delete_tx_op(&bo->tx_ops, msg_head.can_id, ifindex)) bcm_sendmsg() 1313 if (bcm_delete_rx_op(&bo->rx_ops, msg_head.can_id, ifindex)) bcm_sendmsg() 1320 /* reuse msg_head for the reply to TX_READ */ bcm_sendmsg() 1321 msg_head.opcode = TX_STATUS; bcm_sendmsg() 1322 ret = bcm_read_op(&bo->tx_ops, &msg_head, ifindex); bcm_sendmsg() 1326 /* reuse msg_head for the reply to RX_READ */ bcm_sendmsg() 1327 msg_head.opcode = RX_STATUS; bcm_sendmsg() 1328 ret = bcm_read_op(&bo->rx_ops, &msg_head, ifindex); bcm_sendmsg() 1333 if ((msg_head.nframes != 1) || (size != CFSIZ + MHSIZ)) bcm_sendmsg()
|
/linux-4.4.14/net/hsr/ |
H A D | hsr_netlink.c | 151 void *msg_head; hsr_nl_ringerror() local 159 msg_head = genlmsg_put(skb, 0, 0, &hsr_genl_family, 0, HSR_C_RING_ERROR); hsr_nl_ringerror() 160 if (!msg_head) hsr_nl_ringerror() 171 genlmsg_end(skb, msg_head); hsr_nl_ringerror() 192 void *msg_head; hsr_nl_nodedown() local 200 msg_head = genlmsg_put(skb, 0, 0, &hsr_genl_family, 0, HSR_C_NODE_DOWN); hsr_nl_nodedown() 201 if (!msg_head) hsr_nl_nodedown() 209 genlmsg_end(skb, msg_head); hsr_nl_nodedown() 241 void *msg_head; hsr_get_node_status() local 278 msg_head = genlmsg_put(skb_out, NETLINK_CB(skb_in).portid, hsr_get_node_status() 281 if (!msg_head) { hsr_get_node_status() 348 genlmsg_end(skb_out, msg_head); hsr_get_node_status() 375 void *msg_head; hsr_get_node_list() local 404 msg_head = genlmsg_put(skb_out, NETLINK_CB(skb_in).portid, hsr_get_node_list() 407 if (!msg_head) { hsr_get_node_list() 430 genlmsg_end(skb_out, msg_head); hsr_get_node_list()
|
/linux-4.4.14/fs/quota/ |
H A D | netlink.c | 49 void *msg_head; quota_send_warning() local 63 msg_head = genlmsg_put(skb, 0, atomic_add_return(1, &seq), quota_send_warning() 65 if (!msg_head) { quota_send_warning() 90 genlmsg_end(skb, msg_head); quota_send_warning()
|
/linux-4.4.14/drivers/net/wireless/ |
H A D | mac80211_hwsim.c | 959 void *msg_head; mac80211_hwsim_tx_frame_nl() local 979 msg_head = genlmsg_put(skb, 0, 0, &hwsim_genl_family, 0, mac80211_hwsim_tx_frame_nl() 981 if (msg_head == NULL) { mac80211_hwsim_tx_frame_nl() 982 printk(KERN_DEBUG "mac80211_hwsim: problem with msg_head\n"); mac80211_hwsim_tx_frame_nl() 1024 genlmsg_end(skb, msg_head); mac80211_hwsim_tx_frame_nl()
|