[PATCH v2 2/5] Add the power save control framework and debugfs entry

Olof Johansson dev at skyshaper.net
Mon Jul 8 14:24:12 EDT 2013


On Mon, Jul 8, 2013 at 6:43 PM,  <dreamfly281 at gmail.com> wrote:
> From: Yanbo Li <yanbol at qti.qualcomm.com>
> +static ssize_t read_file_bool_bmps(struct file *file, char __user *user_buf,
> +                                  size_t count, loff_t *ppos)
> +{
> +       struct wcn36xx *wcn = file->private_data;
> +       char buf[3];
> +
> +       if (wcn->pw_state == WCN36XX_BMPS)
> +               buf[0] = '1';
> +       else
> +               buf[0] = '0';
> +       buf[1] = '\n';
> +       buf[2] = 0x00;
> +       return simple_read_from_buffer(user_buf, count, ppos, buf, 2);
> +}
Why not just write the pw_state instead? I doubt we will have more
than 255 power states so just casting it should be fine =)

>  #define DRIVER_PREFIX "wcn36xx: "
> @@ -171,6 +172,9 @@ struct wcn36xx {
>
>         struct sk_buff          *tx_ack_skb;
>
> +       /* Power management */
> +       enum wcn36xx_power_state     pw_state;
Shouldn't this be added to the vif struct instead of as a global?

Cheers
--
Olof



More information about the wcn36xx mailing list