Commit graph

75 commits

Author SHA1 Message Date
Pritthijit Nath
95897fdf1f staging: vt6656: Fixed issue with alignment in rf.c
This change fixes a checkpatch CHECK style issue for "Alignment should
match open parenthesis".

Signed-off-by: Pritthijit Nath <pritthijit.nath@icloud.com>
Link: https://lore.kernel.org/r/20210211213715.7386-1-pritthijit.nath@icloud.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-02-12 09:47:13 +01:00
Oscar Carter
8a01032e02 staging: vt6656: Remove logically dead code
In the start of the "vnt_rf_set_txpower" function the "power" variable
is set at most to VNT_RF_MAX_POWER (hex = 0x3f, dec = 63). Then, in the
switch statement there are four comparisons with the "power" variable
against AL7230_PWR_IDX_LEN (dec = 64), VT3226_PWR_IDX_LEN (dec = 64),
VT3342_PWR_IDX_LEN (dec = 64). Due to all the commented comparisons are
to check if the "power" variable is "greater than or equal" to 64, this
never happens. So, remove the logically dead code.

Also, remove all the defines that are no longer required.

Addresses-Coverity-ID: 1230228 ("Logically dead code")
Fixes: f53d9f12c5 ("staging: vt6656: rf.c additional power.")
Signed-off-by: Oscar Carter <oscar.carter@gmx.com>
Link: https://lore.kernel.org/r/20200510090950.7633-1-oscar.carter@gmx.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-13 13:58:44 +02:00
Oscar Carter
ae22020487 staging: vt6656: Refactor the vnt_rf_table_download function
Create a constant array of struct vnt_table_info type elements with the
necessary info (address and length) about all the rf tables for every rf
type.

In every case of the "switch" statement replace the hardcoded info about
these tables with and index to the new constant array. Moreover, use
this array index to extract the necessary info in every call to the
vnt_control_out_* functions.

Check if this index has been set and return without error otherwise.
So, avoid the execution of code that previously did nothing due to
lengths with values of zero for some rf types.

Also remove all the variables that are now unused.

This way reduce the stack footprint, and make the code more clear.

Signed-off-by: Oscar Carter <oscar.carter@gmx.com>
Link: https://lore.kernel.org/r/20200429153838.7216-1-oscar.carter@gmx.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-05 12:26:44 +02:00
Oscar Carter
10b674be0a staging: vt6656: Remove duplicate code in vnt_rf_table_download
Replace three while loops with three calls to the vnt_control_out_blocks
function. This way avoid repeat a functionality that already exists.

Also remove the variables that now are not used.

Signed-off-by: Oscar Carter <oscar.carter@gmx.com>
Link: https://lore.kernel.org/r/20200425151747.8199-4-oscar.carter@gmx.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-28 14:26:29 +02:00
Oscar Carter
d78b62c3ea staging: vt6656: Use return instead of goto
Replace the "goto" statements with a direct "return ret" as the jump
label only returns the ret variable.

Also, remove the unnecessary variable initialization because the ret
variable is set a few lines later.

Signed-off-by: Oscar Carter <oscar.carter@gmx.com>
Link: https://lore.kernel.org/r/20200425151747.8199-3-oscar.carter@gmx.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-28 14:26:29 +02:00
Oscar Carter
8a5baa66b0 staging: vt6656: Remove the local variable "array"
Remove the local variable "array" and all the memcpy function calls
because this copy operation from different arrays to this variable is
unnecessary.

The vnt_control_out function already does a kmemdup copy of its const
char *buffer argument and this was made unnecessary by:

commit 12ecd24ef9
("staging: vt6656: use off stack for out buffer USB transfers.")
Author: Malcolm Priestley <tvboxspy@gmail.com>
Date:   Sat Apr 22 11:14:57 2017 +0100

    staging: vt6656: use off stack for out buffer USB transfers.

    Since 4.9 mandated USB buffers be heap allocated this causes the driver
    to fail.

    Since there is a wide range of buffer sizes use kmemdup to create
    allocated buffer.

So, the same result can be achieved using the arrays directly.

Signed-off-by: Oscar Carter <oscar.carter@gmx.com>
Link: https://lore.kernel.org/r/20200425151747.8199-2-oscar.carter@gmx.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-28 14:26:29 +02:00
Oscar Carter
345f2d84dd staging: vt6656: Add formula to the vnt_rf_addpower function
Use a formula to calculate the return value of the vnt_rf_addpower
function instead of the "if" statement with literal values for every
case.

Signed-off-by: Oscar Carter <oscar.carter@gmx.com>
Link: https://lore.kernel.org/r/20200425141514.5528-1-oscar.carter@gmx.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-28 14:19:13 +02:00
Oscar Carter
f823cce279 staging: vt6656: Return error code in vnt_rf_write_embedded function
Use the error code returned by the vnt_control_out function as the
returned value of the vnt_rf_write_embedded function instead of a
boolean value.

Then, fix all vnt_rf_write_embedded calls removing the "and" operations
and replace with a direct assignment to the ret variable and add a check
condition after every call.

Also replace the boolean values true or false in the vnt_rf_set_txpower
function to 0 or error code EINVAL to follow the coding style guide.

The vnt_rf_set_txpower function is called only in the vnt_rf_setpower
function that already returns error codes. The calls to this function
(vnt_rf_set_txpower) not use the returned values, so they not need to be
fixed.

Signed-off-by: Oscar Carter <oscar.carter@gmx.com>
Link: https://lore.kernel.org/r/20200414153849.5785-2-oscar.carter@gmx.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-16 12:54:25 +02:00
Malcolm Priestley
463288b981 staging: vt6556: vnt_rf_setpower convert to use ieee80211_channel.
ieee80211_channel contains all the necessary information to change
power according to tx mode required.

vnt_rf_setpower is moved and so that vnt_rf_set_txpower the only
caller becomes static.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Link: https://lore.kernel.org/r/9eab9af8-fde9-1dc6-fced-95c7a36ecc01@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 14:53:21 +02:00
Malcolm Priestley
5035fc5915 staging: vt6656: replace al2230_power_table array with formula.
The power table can replaced with calculation 0x0404090 | (power << 12)
removing array and length macro.

variable power never goes beyond the maximum setting.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Link: https://lore.kernel.org/r/e277409a-4509-d09c-515d-59b952f8310d@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 08:55:28 +02:00
Quentin Deslandes
7156f7d9c3 staging: vt6656: avoid discarding called function's return code
Change some of the driver's functions in order to handle error codes
instead of discarding them. These function now returns 0 on success and
a negative errno value on error.

Signed-off-by: Quentin Deslandes <quentin.deslandes@itdev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-21 08:25:03 +02:00
Greg Kroah-Hartman
dd41dab5d5 staging: vt6656: Remove redundant license text
Now that the SPDX tag is in all vt6656 files, that identifies the
license in a specific and legally-defined manner.  So the extra GPL text
wording can be removed as it is no longer needed at all.

This is done on a quest to remove the 700+ different ways that files in
the kernel describe the GPL license text.  And there's unneeded stuff
like the address (sometimes incorrect) for the FSF which is never
needed.

No copyright headers or other non-license-description text was removed.

Cc: Forest Bond <forest@alittletooquiet.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-28 13:20:47 +01:00
Greg Kroah-Hartman
6b4c6ce892 staging: vt6656: add SPDX identifiers to all vt6656 driver files
It's good to have SPDX identifiers in all files to make it easier to
audit the kernel tree for correct licenses.

Update the vt6656 driver files with the correct SPDX license identifier
based on the license text in the file itself.  The SPDX identifier is a
legally binding shorthand, which can be used instead of the full boiler
plate text.

This work is based on a script and data from Thomas Gleixner, Philippe
Ombredanne, and Kate Stewart.

Cc: Forest Bond <forest@alittletooquiet.net>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Kate Stewart <kstewart@linuxfoundation.org>
Cc: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-28 13:20:47 +01:00
Simon Sandström
3781f88786 staging: vt6656: Align function parameters
Fixes checkpatch.pl warnings "Alignment should match open parenthesis".

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-07-16 08:41:02 +02:00
Simon Sandström
f21997572c staging: vt6656: Add spaces between operators
Fixes checkpatch.pl warnings "spaces preferred around that <operator>".

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-07-16 08:41:02 +02:00
Dan Cashman
38ca74e58f staging: vt6656: Split arguments to avoid 80-char violation in rf.c
Wrap arguments of call to vnt_control_out() to avoid exceeding 80
character limit, but maintain alignment.

Signed-off-by: Daniel Cashman <dan.a.cashman@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-08 12:51:23 +02:00
Dan Cashman
04a218becb staging: vt6656: Replace embedded function name with __func__ in rf.c
Change embedded function name in vnt_rf_set_txpower with %s format with
__func__ argument to make it consistent with other part of if-else and
kernel coding style standards as reported by checkpatch.

Signed-off-by: Daniel Cashman <dan.a.cashman@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-08 12:51:23 +02:00
Dan Cashman
a4dc9bd6a3 staging: vt6656: convert spaces to tabs for rf.c
Address checkpatch errors encountered in rf.c by removing use of spaces
and replacing with properly aligned tabs.

Signed-off-by: Daniel Cashman <dan.a.cashman@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-08 12:51:23 +02:00
Arushi Singhal
8129306658 staging: vt6656: Alignment should match open parenthesis
Fix checkpatch issues: "CHECK: Alignment should match open parenthesis"

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-16 10:23:09 -08:00
Vijai Kumar K
354872712e staging: vt6656: Fix coding style warnings on Block comments
Fix checkpatch.pl warnings related to Block comments in
staging/vt6656/rf.c file.

Signed-off-by: Vijai Kumar K <vijaikumar.kanagarajan@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-21 11:13:14 +01:00
Elise Lennion
596f144943 staging: vt6656: Remove unnecessary parentheses.
The removed parentheses are unnecessary and don't add readability.

Found using Coccinelle semantic patch:
@@ expression e, e1, e2; @@
e +=
(
        (e1 == e2)
|
-       (e1)
+       e1
)

@@ expression e, e1, e2; @@
e =
(
        (e1 == e2)
|
-       (e1)
+       e1
)

Signed-off-by: Elise Lennion <elise.lennion@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-24 15:35:03 +02:00
Rehas Sachdeva
dcf8343d54 staging: vt6656: Remove unnecessary parentheses
This patch removes the following checkpatch.pl warnings:
Unnecessary parentheses around al7230_init_table_amode[0][0]
Unnecessary parentheses around al7230_channel_table2[0][0]

Signed-off-by: Rehas Sachdeva <aquannie@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-10 19:21:18 -08:00
Othmar Pasteka
a85994d546 staging: vt6656: remove address from GPL text
Cleanup errors from checkpatch.pl.

Signed-off-by: Othmar Pasteka <pasteka@kabsi.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-11-19 16:53:09 -08:00
Malcolm Priestley
163fe301b9 staging: vt6656: vnt_rf_setpower: fix missing rate RATE_12M
When the driver sets this rate a power of zero value is set causing
data flow stoppage until another rate is tried.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Cc: <stable@vger.kernel.org> # v3.17+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-09 11:31:54 +01:00
Rajbinder Brar
3b9999ec18 Staging: vt6656: Merge two lines of code into one
This patch merges an assignment with an immediately following return of
the assigned variable. The following Coccinelle semantic patch was used
to make this transformation:

@@
expression ret;
identifier f;
@@

-ret=
+return
	f(...);
-return ret;

A variable that became unused due to this transformation was also
removed.

Signed-off-by: Rajbinder Brar <brar.rajbinder@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23 13:42:54 -07:00
Malcolm Priestley
5a97491c33 staging: vt6656: struct vnt_private rf power table remove camel case
Camel case changes
byCCKPwr -> cck_pwr
byOFDMPwrG -> ofdm_pwr_g
byOFDMPwrA -> ofdm_pwr_a
byCurPwr -> power
abyCCKPwrTbl -> cck_pwr_tbl
abyOFDMPwrTbl -> ofdm_pwr_tbl
abyOFDMAPwrTbl -> ofdm_a_pwr_tbl

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-21 12:16:28 -07:00
Malcolm Priestley
125cfc6344 staging: vt6656: struct vnt_private rename uCurrRSSI to current_rssi
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-21 12:11:58 -07:00
Malcolm Priestley
6242ecaeb6 staging: vt6656: struct vnt_private replace byRFType with rf_type
Remove camel case

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-21 12:11:56 -07:00
Malcolm Priestley
ef13cfb4dc staging: vt6656: rf.c cleanup comments
named comments are already referenced in revision history
in high-level comment.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-12 13:28:28 -07:00
Malcolm Priestley
f1c840d55b staging: vt6656: vnt_rf_write_embedded add reg length and IFREGCTL_REGW
The rf register always have  *_REG_LEN and IFREGCTL_REGW macros added.

*_REG_LEN is always 23(0x17) replace them with VNT_RF_REG_LEN.

Remove *_REG_LEN and IFREGCTL_REGW from tables and vnt_rf_set_txpower and
apply VNT_RF_REG_LEN and IFREGCTL_REGW in vnt_rf_write_embedded

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-12 13:28:27 -07:00
Malcolm Priestley
0e2b6fe1f4 staging: vt6656: rf.c remove dead code RFaby11aChannelIndex
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-12 13:28:27 -07:00
Malcolm Priestley
77bdc0a5c6 staging: vt6656: rf.c clean up channel and power tables
Remove comments to channel number execpt where there is a
change to 5gHz channel 15

named comments are already referenced in revision history
in high-level comment.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-12 13:28:27 -07:00
Malcolm Priestley
89daee6ff5 staging: vt6656: vnt_rf_setpower rate <= RATE_11M check array bound
decrement channel by one and check array bound.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-08 16:03:57 -07:00
Malcolm Priestley
72183c6b0c staging: vt6656: vnt_rf_set_txpower use power for priv->byCurPwr
The byCurPwr value can change state while in another thread,.

Change to local variable power which is the last set value.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-08 16:03:57 -07:00
Malcolm Priestley
c6b16e197b staging: vt6656: remove dead code datarate
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-26 20:23:31 -04:00
Malcolm Priestley
a23d8a7032 staging: vt6656: mac80211 conversion: change vnt_rf_set_txpower
Remove old eScanState code and use.

priv->hw->conf.chandef.chan->hw_value to find current channel

Check hw_value for bounds of vt3226d0_lo_current_table

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-26 20:21:20 -04:00
Malcolm Priestley
5dda2528ef staging: vt6656: rf.c replace DBG_PRT debug messages
replace with dev_dbg

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-28 14:10:46 -07:00
Malcolm Priestley
c85a81b22d staging: vt6656: rf.c Fix typo error at3226*
In commit 78a650dc19
there was a typo error

abyVT3226_InitTable -> at3226_init_table
abyVT3226D0_InitTable -> at3226d0_init_table

Shoud be vt3226_init_table and vt3226d0_init_table

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-28 14:10:46 -07:00
Malcolm Priestley
c49d7550e5 staging: vt6656: rf.c rename RFbRFTableDownload to vnt_rf_table_download.
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-28 14:10:46 -07:00
Malcolm Priestley
21bba58ae1 staging: vt6656: rf.c/h rename RFvRSSITodBm to vnt_rf_rssi_to_dbm
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-28 14:10:46 -07:00
Malcolm Priestley
8543bb9c21 staging: vt6656: rf.c/h rename RFbRawSetPower to vnt_rf_set_txpower
Remove raw and use txpower.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-28 14:10:46 -07:00
Malcolm Priestley
4f5290ea3c staging: vt6656: rf.c/h rename RFbSetPower to vnt_rf_setpower
Removing camel case

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-28 14:10:46 -07:00
Malcolm Priestley
32c48cb8ba staging: vt6656: rf.c: rename IFRFbWriteEmbedded to vnt_rf_write_embedded
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-28 14:10:46 -07:00
Malcolm Priestley
d6df2bf2bf staging: vt6656: IFRFbWriteEmbedded remove camel case
Camel case changes
pDevice -> priv
dwData -> data
pbyData -> reg_data

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-28 14:10:46 -07:00
Malcolm Priestley
25d279d3b2 staging: vt6656: IFRFbWriteEmbedded use ARRAY_SIZE
Replace magic number with ARRAY_SIZE of pbyData

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-28 14:10:46 -07:00
Malcolm Priestley
62c8526d60 staging: vt6656: dead code remove control.c/h
Replace control.h headers with usbpipe.h

Also add to usbpipe.c its header

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-26 10:36:50 -07:00
Malcolm Priestley
1390b02a2f staging: vt6656: rename PIPEnsControlOut/CONTROLnsRequestOut to vnt_control_out
Rename all CONTROLnsRequestOut and remove macro from control.h

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-26 10:36:49 -07:00
Malcolm Priestley
60f8ce8dd6 staging: vt6656: rndis.h move all to device.h
Commands macros are common to all source files.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-18 09:58:30 -07:00
Malcolm Priestley
f53d9f12c5 staging: vt6656: rf.c additional power.
Provides extra power on weak RSSI.

The values orginate from the vendors driver.

It is applied later in RFbRawSetPower to simplify and check that it doesn't
exceed the max power.

Vendor driver VT6656_Linux_src_v1.21.03_x86_11.04.zip
http://www.viaembedded.com/servlet/downloadSvl?id=1890&download_file_id=14704
This is GPL-licensed code.

vendors code
...
if (pDevice->byRFType == RF_VT3226D0) {
	if (lRSSI == 0){
		lAdditionalPower = 7;
	}
	else if ((lRSSI < -60) && (lRSSI >= -65)){
		lAdditionalPower = 5;
		//lAdditionalPower = 9;
	}
	else if ((lRSSI < -65) && (lRSSI >= -70)){
		lAdditionalPower = 7;
		//lAdditionalPower = 9;
	}
	else if ((lRSSI < -70) && (lRSSI >= -80)){
		lAdditionalPower = 9;
		}
	else if (lRSSI < -80) {
		lAdditionalPower = 9;
	}
}
else {
	if (lRSSI == 0){
		lAdditionalPower = 7;
	}
	else if ((lRSSI < -70) && (lRSSI >= -75)){
		lAdditionalPower = 5;
	}
	else if ((lRSSI < -75) && (lRSSI >= -80)){
			lAdditionalPower = 7;
		}
		else if (lRSSI < -80) {
			lAdditionalPower = 9;
		}
	}

...

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-18 09:58:27 -07:00
Malcolm Priestley
c47b0a3453 staging: vt6656: Remove always 0 variable dwDiagRefCount
Remove > 0 code.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-25 12:41:43 -08:00