Re: [PATCH 12/39] wimax: API call to reset a WiMAX device

Johannes Berg
2008-11-27T09:59:16Z

[-- Attachment #1: Type: text/plain, Size: 1225 bytes --]

On Wed, 2008-11-26 at 15:07 -0800, Inaky Perez-Gonzalez wrote:
> Provides wimax_reset() for the kernel to reset a wimax device as
> needed.
>
> Exports wimax_reset() over generic netlink to user space.

> +struct genl_ops wimax_gnl_reset = {
> + .cmd = WIMAX_GNL_OP_RESET,
> + .flags = 0,

permission check again

> + /* Execute the operation and send the result back to user space */
> + result = wimax_reset(wimax_dev);
> + result2 = wimax_gnl_send_rp_result(wimax_dev, info, result);
> + if (result2 < 0)
> + dev_err(dev, "WIMAX_GNL_RESET: can't send result %d to "
> + "userspace: %d\n", result, result2);
> + result = 0;
> + dev_put(wimax_dev->net_dev);
> +error_no_wimax_dev:
> +error_perm:
> + d_fnend(3, NULL, "(skb %p info %p) = %d\n", skb, info, result);
> + return result;

This is strange. Can you show your corresponding userspace code? It
shouldn't be necessary with generic netlink to explicitly send the
result, if you just return the result from wimax_reset() it'll be part
of the ACK message and thus already be relayed to userspace. I think
you're not using genl correctly here.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]