Search Linux Wireless

Re: [PATCH V2 iw] add "channels" PHY command listing frequencies with more details

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2016-05-31 at 18:28 +0200, Rafał Miłecki wrote:
> 
> +static int print_channels_handler(struct nl_msg *msg, void *arg)
> +{
> +	struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg));
> +

extra blank line

> +	struct nlattr *tb_msg[NL80211_ATTR_MAX + 1];
> +	struct nlattr *tb_band[NL80211_BAND_ATTR_MAX + 1];
> +	struct nlattr *tb_freq[NL80211_FREQUENCY_ATTR_MAX + 1];
> +	struct nlattr *nl_band;
> +	struct nlattr *nl_freq;
> +	int rem_band, rem_freq;
> +	static int last_band = -1;
> +	static bool width_40, width_80, width_160;

You shouldn't make them static - make a little struct containing them,
and pass it as "arg"


> +static int handle_channels(struct nl80211_state *state, struct
> nl_msg *msg,
> +			   int argc, char **argv, enum id_input id)
> +{

struct ... xyz = {};

> +	nla_put_flag(msg, NL80211_ATTR_SPLIT_WIPHY_DUMP);
> +	nlmsg_hdr(msg)->nlmsg_flags |= NLM_F_DUMP;
> +
> +	register_handler(print_channels_handler, NULL);

register_handler(..., &xyz);

johannes

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux