summaryrefslogtreecommitdiffstats
path: root/drivers/staging/vt6656/card.c
Commit message (Collapse)AuthorAgeFilesLines
* staging: vt6656: remove difs / sifs adjustments.Malcolm Priestley2020-05-131-32/+0
| | | | | | | | | Now mac89211 is doing frame timing in rxtx these vendor adjustments need to be removed. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Link: https://lore.kernel.org/r/034e445c-b245-52c4-c855-431b9783bcff@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vt6656: Refactor the vnt_set_bss_mode functionOscar Carter2020-05-051-37/+31
| | | | | | | | | | | | | | Remove all the duplicate code in the "if, else if, else" statements as all the branches in every "if" are almost the same. The only difference between branches is some value. So, use variables instead of repeat code. Also, remove the unnecessary casting to u8 type because the "priv->bb_type" variable is already an u8 tpe. Signed-off-by: Oscar Carter <oscar.carter@gmx.com> Link: https://lore.kernel.org/r/20200429152307.5871-3-oscar.carter@gmx.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vt6656: Check the return values in vnt_set_bss_mode functionOscar Carter2020-05-051-7/+14
| | | | | | | | | | | | | Check the return value of all the functions that return zero if successful or a negative error code on failure inside the function vnt_set_bss_mode. Also, remove the unnecessary variable initialization as this variable is set a few lines later. Signed-off-by: Oscar Carter <oscar.carter@gmx.com> Link: https://lore.kernel.org/r/20200429152307.5871-2-oscar.carter@gmx.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vt6656: Remove functions' documentationOscar Carter2020-04-281-79/+0
| | | | | | | | | | Remove the functions' documentation as the names of the functions are clear enought. Also, the actual documentation it's not correct in all cases. Signed-off-by: Oscar Carter <oscar.carter@gmx.com> Link: https://lore.kernel.org/r/20200425134257.4502-3-oscar.carter@gmx.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vt6656: Check the return value of vnt_control_out_* callsOscar Carter2020-04-281-35/+62
| | | | | | | | | | | | | | Check the return value of vnt_control_out_* function calls. When necessary modify the function prototype to be able to return the new checked error code. It's safe to modify all the function prototypes without fix the call because the only change is the return value from void to int. If before the call didn't check the return value, now neither. Signed-off-by: Oscar Carter <oscar.carter@gmx.com> Link: https://lore.kernel.org/r/20200425134257.4502-2-oscar.carter@gmx.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vt6656: Use fls instead of for loop in vnt_update_top_ratesOscar Carter2020-04-231-22/+6
| | | | | | | | | | | | | | | | | | Replace the for loops of the vnt_update_top_rates function by the fls function. The purpose of the two for loops is to find the most significant bit set in a range of bits. So, they can be replace by the fls function (find last set) with a previous mask to define the range. This way avoid the iteration over unnecessary for loops. The header "linux/bits.h" can be remove as it is included in the header "linux/bitops.h". Signed-off-by: Oscar Carter <oscar.carter@gmx.com> Link: https://lore.kernel.org/r/20200420155246.4925-1-oscar.carter@gmx.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vt6656: Refactor the vnt_ofdm_min_rate functionOscar Carter2020-04-231-9/+2
| | | | | | | | | | | | | | | | | | | Replace the for loop by a ternary operator whose condition is an AND bitmask against the priv->basic_rates variable. The purpose of the for loop was to check if any of bits from RATE_54M to RATE_6M was set, but it's not necessary to check every individual bit. The same result can be achieved using only one single mask which comprises all the commented bits. This way avoid the iteration over an unnecessary for loop. Also change the return type to bool because it's the type that this function returns. Signed-off-by: Oscar Carter <oscar.carter@gmx.com> Link: https://lore.kernel.org/r/20200418134553.6415-1-oscar.carter@gmx.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vt6656: Use BIT() macro instead of bit shift operatorOscar Carter2020-04-161-2/+2
| | | | | | | | | | | | Use the BIT() macro instead of the bit left shift operator. So the code is more clear. It's safe to remove the casting to u16 type because the value obtained never exceeds 16 bits. So the casting is unnecessary. Signed-off-by: Oscar Carter <oscar.carter@gmx.com> Link: https://lore.kernel.org/r/20200414153849.5785-3-oscar.carter@gmx.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vt6656: formulate rspinf values into tablesMalcolm Priestley2020-04-131-156/+40
| | | | | | | | | | | | | | Four tables can be extracted from RSPINF_A_* based on BB_TYPE_11A or else being GB rates. Preamble short or long tables from fixed size len of 14 for RSPINF_B rates. Remove function vnt_calculate_ofdm_rate and replace with the tables calling RSPINF_A and RSPINF_B separately. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Link: https://lore.kernel.org/r/addca9e1-9ea2-59ee-dec9-3afb3c731c2e@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vt6656: set all cck rates to default.Malcolm Priestley2020-04-131-34/+4
| | | | | | | | | | | mac80211 rate control decides which cck rates to use so all of them should be set enabled at the appropriate bit rate. This means vnt_get_cck_rate is no longer required. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Link: https://lore.kernel.org/r/dec847da-5bad-1920-f275-741f7f704fb3@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vt6656: set all ofdm rates to defaultMalcolm Priestley2020-04-131-50/+4
| | | | | | | | | | | mac80211 rate control decides which odfm rates to use so all of them should be set enabled at the appropriate bit rate. This means vnt_get_ofdm_rate is no longer required. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Link: https://lore.kernel.org/r/9a52d7f4-dd3e-efdc-eef8-bb794f7dea6d@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vt6656: add error code handling to unused variableJohn B. Wyatt IV2020-04-131-8/+12
| | | | | | | | | | | | | | | Add error code handling to unused 'ret' variable that was never used. Return an error code from functions called within vnt_radio_power_on. Issue reported by coccinelle (coccicheck). Suggested-by: Quentin Deslandes <quentin.deslandes@itdev.co.uk> Suggested-by: Stefano Brivio <sbrivio@redhat.com> Reviewed-by: Quentin Deslandes <quentin.deslandes@itdev.co.uk> Signed-off-by: John B. Wyatt IV <jbwyatt4@gmail.com> Reviewed-by: Stefano Brivio <sbrivio@redhat.com> Link: https://lore.kernel.org/r/20200330233900.36938-1-jbwyatt4@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vt6656: Use BIT() macro in vnt_mac_reg_bits_* functionsOscar Carter2020-03-211-1/+3
| | | | | | | | | | The last parameter in the functions vnt_mac_reg_bits_on and vnt_mac_reg_bits_off defines the bits to set or unset. So, it's more clear to use the BIT() macro instead of an hexadecimal value. Signed-off-by: Oscar Carter <oscar.carter@gmx.com> Link: https://lore.kernel.org/r/20200320181326.12156-1-oscar.carter@gmx.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vt6656: remove bool from vnt_radio_power_on retMalcolm Priestley2020-01-031-1/+1
| | | | | | | | The driver uses logical only error checking a bool true would flag error. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Link: https://lore.kernel.org/r/cc52b67c-9ef8-3e57-815a-44d10701919e@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vt6656: fix indentation on break statementColin Ian King2019-06-201-1/+1
| | | | | | | | The break statement is indented one level too deep, fix this. Signed-off-by: Colin Ian King <colin.king@canonical.com> Reviewed-by: Quentin Deslandes <quentin.deslandes@itdev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vt6656: avoid discarding called function's return codeQuentin Deslandes2019-05-211-6/+14
| | | | | | | | | 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>
* staging: vt6656: Remove redundant license textGreg Kroah-Hartman2017-11-281-11/+0
| | | | | | | | | | | | | | | | 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>
* staging: vt6656: add SPDX identifiers to all vt6656 driver filesGreg Kroah-Hartman2017-11-281-0/+1
| | | | | | | | | | | | | | | | | | | 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>
* staging: vt6656: card: mark expected switch fall-throughsGustavo A. R. Silva2017-10-181-0/+2
| | | | | | | | In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vt6656: vnt_update_ifs set max_min based on short slot time.Malcolm Priestley2017-05-151-23/+6
| | | | | | | | | | | Short slot time is controlled by mac80211 so there is no need to find odfm rates. Merge PK_TYPE_11B and PK_TYPE_11GA & PK_TYPE_11GB into one else and switch on short slot time. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vt6656: Compress return logic into one line.Elise Lennion2016-10-171-10/+1
| | | | | | | | | | | | | | | | | | | | | | | Compress the return logic into one line avoids unnecessary variable declarations. In this case it also makes it easier to understand the function. Coccinelle was used to find this return statement. However, additional compressions were done to make the function clearer. Semantic patch: @@ local idexpression ret; expression e; @@ -ret = +return e; -return ret; Signed-off-by: Elise Lennion <elise.lennion@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging:vt6656:card.c: fix block comments should align the * on each lineMikhail Golubev2016-10-161-2/+2
| | | | | | | Block comments should align the * on each line as reported by checkpatch.pl Signed-off-by: Mikhail Golubev <golubev.mikhail@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging:vt6656:card.c: fix camel case issueRithvik Patibandla2016-08-211-3/+3
| | | | | | | Fix "Avoid camel case" issue thrown by checkpatch.pl Signed-off-by: Rithvik Patibandla <rithvikp98@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging:vt6656:card.c: fix blank line issueRithvik Patibandla2016-08-211-0/+1
| | | | | | | | Fix "Please use a blank line after function declaration" check thrown by checkpatch.pl Signed-off-by: Rithvik Patibandla <rithvikp98@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging:vt6656:card.c: fix blank lines issueRithvik Patibandla2016-08-211-5/+0
| | | | | | | | Fix "Blank lines aren't necessary after an open brace" check thrown by checkpatch.pl Signed-off-by: Rithvik Patibandla <rithvikp98@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging:vt6656:card.c:fix alignment checksRithvik Patibandla2016-08-211-30/+30
| | | | | | | | Fix "Alignment should match with open paranthesis" check thrown by checkpatch.pl Signed-off-by: Rithvik Patibandla <rithvikp98@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging:vt6656:card.c:Fix comment block issueRithvik Patibandla2016-08-211-1/+2
| | | | | | | | Fix "Block comments use * on subsequent lines" and "Block comments use */ on trailing lines" warnings thrown by checkpatch.pl Signed-off-by: Rithvik Patibandla <rithvikp98@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vt6656: remove address from GPL textOthmar Pasteka2015-11-191-3/+0
| | | | | | | Cleanup errors from checkpatch.pl. Signed-off-by: Othmar Pasteka <pasteka@kabsi.at> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vt6656: Do not use multiple blank lines.Burcin Akalin2015-10-271-1/+0
| | | | | | | | Remove multiple blank lines. Problem found using checkpatch.pl "CHECK: Please don't use multiple blank lines" Signed-off-by: Burcin Akalin <brcnakalin@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vt6656: Add space around '|'Burcin Akalin2015-10-271-1/+1
| | | | | | | | | Add space around operator '|'. Problem found using checkpatch.pl CHECK: spaces preferred around that '|' (ctx:VxV) Signed-off-by: Burcin Akalin <brcnakalin@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vt6656: Prefer using BIT MacroAmitoj Kaur Chawla2015-10-161-1/+1
| | | | | | | | | | | | | Replace bit shifting on 1 with the BIT(x) Macro The semantic patch used to find this is: @@ int g; @@ -(1 << g) +BIT(g) Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vt6656: Remove useless initialisationAmitoj Kaur Chawla2015-10-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Remove intialisation of a variable that is immediately reassigned. The semantic patch used to find this is: // <smpl> @@ type T; identifier x; constant C; expression e; @@ T x - = C ; x = e; // </smpl> Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vt6656: Boolean tests don't need comparisons.Abdul Hussain2015-06-171-1/+1
| | | | | | | This patch remove true and false from boolean tests. Signed-off-by: Abdul Hussain <habdul@visteon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: vt6656: Fixed typo in a macro nameGustavo A. R. Silva2015-01-121-1/+1
| | | | | | | Fixed typo in a macro name in card.c and device.h files. Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vt6656: remove unnecessary else after returnTapasweni Pathak2014-09-231-2/+1
| | | | | | | | This patch fixes checkpatch.pl warning in files of vt6656 WARNING: else is not generally useful after a break or return Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vt6656: remove comments of old functions nolonger present.Malcolm Priestley2014-07-271-6/+0
| | | | | Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vt6656: remove return from all void functionsMalcolm Priestley2014-07-271-4/+0
| | | | | Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vt6656: struct vnt_private replace abyBBVGA with bb_vgaMalcolm Priestley2014-07-211-9/+9
| | | | | | | Removing type prefix and camel case. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vt6656: struct vnt_private replace bShortSlotTime with short_slot_timeMalcolm Priestley2014-07-211-1/+1
| | | | | | | Removing type prefix and camel case Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vt6656: struct vnt_private replace byTopCCKBasicRate with ↵Malcolm Priestley2014-07-211-1/+1
| | | | | | | | | top_cck_basic_rate Removing type prefix and camel case. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vt6656: struct vnt_private replace byTopOFDMBasicRate with ↵Malcolm Priestley2014-07-211-1/+1
| | | | | | | | | top_ofdm_basic_rate Removing type prefix and camel case. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vt6656: struct vnt_private replace wBasicRate with basic_ratesMalcolm Priestley2014-07-211-7/+7
| | | | | | | The same name as in struct ieee80211_bss_conf Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vt6656: struct vnt_private replace byPacketType with packet_typeMalcolm Priestley2014-07-211-3/+3
| | | | | | | Removing type prefix and camel case. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vt6656: struct vnt_private replace byBBType with bb_typeMalcolm Priestley2014-07-211-12/+12
| | | | | | | Removing type prefix and camel case. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vt6656: struct vnt_private remove camel case IFS namesMalcolm Priestley2014-07-211-23/+23
| | | | | | | | | | | Camel case changes uSIFS -> sifs uDIFS -> difs uEIFS -> eifs uSlot -> slot Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vt6656: struct vnt_private remove uCwMin/uCwMaxMalcolm Priestley2014-07-211-8/+2
| | | | | | | Although set these variables are not used. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vt6656: struct vnt_private rename qwCurrTSF to current_tsfMalcolm Priestley2014-07-211-2/+2
| | | | | Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vt6656: struct vnt_private replace byRFType with rf_typeMalcolm Priestley2014-07-211-6/+6
| | | | | | | Remove camel case Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vt6656: put radio power off and on into correct state every time.Malcolm Priestley2014-07-181-3/+4
| | | | | | | | | | | | | When radio is off bit GPIO3_INTMD should be on and off when radio is on. Add these to the tail of vnt_radio_power_off and vnt_radio_power_on and remove variable bHWRadioOff. In device_init_registers just check GPIO3_DATA are in correct state and always power on. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vt6656: struct vnt_private remove unused variable bRadioOffMalcolm Priestley2014-07-181-4/+0
| | | | | | | The variable flips from true to false but does nothing Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>