Search Linux Wireless

Re: [PATCH 4/4] brcmfmac: add a variable for packet forwarding condition

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

 



Wright Feng <wright.feng@xxxxxxxxxxx> writes:

> From: Ting-Ying Li <tingying.li@xxxxxxxxxxx>
>
> When the "ap_isolate" function is not set by the host,
> host-based packet forwarding will be enabled if the packet
> forwarding mechanism is not offloaded to the lower layer.
>
> Signed-off-by: Ting-Ying Li <tingying.li@xxxxxxxxxxx>
> Signed-off-by: Chi-hsien Lin <chi-hsien.lin@xxxxxxxxxxx>

[...]

> +	/* Get ap_isolate value from firmware to detemine whether fmac */
> +	/* driver supports packet forwarding. */
> +	if (brcmf_fil_iovar_int_get(ifp, "ap_isolate", &val) == 0) {
> +		ifp->fmac_pkt_fwd_en =
> +			((params->ap_isolate == 0) && (val == 1)) ?
> +			true : false;
> +	} else {
> +		brcmf_err("get ap_isolate iovar failed: ret=%d\n", ret);
> +		ifp->fmac_pkt_fwd_en = false;
> +	}

This is hard to read, you can simplify it to:

if (brcmf_fil_iovar_int_get(ifp, "ap_isolate", &val) == 0 &&
    params->ap_isolate == 0 &&
    val == 1) {
	ifp->fmac_pkt_fwd_en = true;
} else {
	brcmf_err("get ap_isolate iovar failed: ret=%d\n", ret);
	ifp->fmac_pkt_fwd_en = false;
}


-- 
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches



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

  Powered by Linux