74 #include <linux/device.h>
75 #include <linux/slab.h>
77 #include <linux/netdevice.h>
80 #include <linux/export.h>
84 #define D_SUBMODULE op_msg
126 struct device *
dev = wimax_dev_to_dev(wimax_dev);
131 msg_size = nla_total_size(size)
132 + nla_total_size(
sizeof(
u32))
133 + (pipe_name ? nla_total_size(
strlen(pipe_name)) : 0);
135 skb = genlmsg_new(msg_size, gfp_flags);
140 if (genl_msg ==
NULL) {
141 dev_err(dev,
"no memory to create generic netlink message\n");
142 goto error_genlmsg_put;
147 dev_err(dev,
"no memory to add ifindex attribute\n");
154 dev_err(dev,
"no memory to add pipe_name attribute\n");
160 dev_err(dev,
"no memory to add payload (msg %p size %zu) in "
161 "attribute: %d\n", msg, size, result);
164 genlmsg_end(skb, genl_msg);
171 return ERR_PTR(result);
195 *size = nla_len(
nla);
196 return nla_data(
nla);
217 return nla_data(
nla);
275 struct device *
dev = wimax_dev_to_dev(wimax_dev);
280 d_printf(1, dev,
"CTX: wimax msg, %zu bytes\n", size);
281 d_dump(2, dev, msg, size);
283 d_printf(1, dev,
"CTX: genl multicast done\n");
317 result = PTR_ERR(skb);
360 goto error_no_wimax_dev;
364 if (wimax_dev ==
NULL)
365 goto error_no_wimax_dev;
366 dev = wimax_dev_to_dev(wimax_dev);
371 dev_err(dev,
"WIMAX_GNL_MSG_FROM_USER: can't find MSG_DATA "
382 size_t attr_len =
nla_len(attr);
386 if (pipe_name ==
NULL)
388 pipe_name[attr_len] = 0;
391 result = wimax_dev_is_ready(wimax_dev);
395 goto error_not_ready;
401 "CRX: nlmsghdr len %u type %u flags 0x%04x seq 0x%x pid %u\n",
404 d_printf(1, dev,
"CRX: wimax message %zu bytes\n", msg_len);
405 d_dump(2, dev, msg_buf, msg_len);
408 msg_buf, msg_len, info);
417 d_fnend(3,
NULL,
"(skb %p info %p) = %d\n", skb, info, result);
429 .policy = wimax_gnl_msg_policy,
430 .doit = wimax_gnl_doit_msg_from_user,