summaryrefslogtreecommitdiff
path: root/drivers/staging/vt6656/key.c
AgeCommit message (Collapse)Author
2021-08-28staging: vt6656: Remove filenames in filesAldas Taraškevičius
checkpatch.pl warning: It's generally not useful to have the filename in the file Remove the filenames. Signed-off-by: Aldas Taraškevičius <aldas60@gmail.com> Link: https://lore.kernel.org/r/20210827163203.4100-1-aldas60@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-10staging: vt6655: Use fallthrough pseudo-keywordGustavo A. R. Silva
Replace the existing /* fall through */ comments and its variants with the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary fall-through markings when it is the case. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org> Link: https://lore.kernel.org/r/20200707194350.GA3255@embeddedor Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-05staging: vt6656: return all key calls to mac80211 stack.Malcolm Priestley
vnt_mac_set_keyentry can return USB calls so return them to mac80211. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Link: https://lore.kernel.org/r/f1be8ba0-9513-55cb-de9d-dcd4341e5b78@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-05staging: vt6656 remove vnt_mac_disable_keyentry callsMalcolm Priestley
It is not necessary to disable all the keys mac80211 will have removed any existing keys that were used. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Link: https://lore.kernel.org/r/844df68d-08e2-7672-524f-42b918e300c1@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-05staging: vt6656: vnt_set_keymode simplify key modes.Malcolm Priestley
Unused macros and onfly_latch are removed and others contain to actual key_type value is or-ed with key_mode. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Link: https://lore.kernel.org/r/0eb6f5bb-f756-ab1d-5b63-db9b0dc422da@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-23staging: vt6656: Fix pairwise key entry save.Malcolm Priestley
The problem is that the group key was saved as VNT_KEY_DEFAULTKEY was over written by the VNT_KEY_GROUP_ADDRESS index. mac80211 could not clear the mac_addr in the default key. The VNT_KEY_DEFAULTKEY is not necesscary so remove it and set as VNT_KEY_GROUP_ADDRESS. mac80211 can clear any key using vnt_mac_disable_keyentry. Fixes: f9ef05ce13e4 ("staging: vt6656: Fix pairwise key for non station modes") Cc: stable <stable@vger.kernel.org> Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Link: https://lore.kernel.org/r/da2f7e7f-1658-1320-6eee-0f55770ca391@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-09staging: vt6656: Fix return for unsupported cipher modes.Malcolm Priestley
mac80211 expect to see -EOPNOTSUPP on unsupported ciphers so these can be done on stack. correct all the returns to do this. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Link: https://lore.kernel.org/r/b65a3b23-735f-f679-0f16-a54c3266b5ae@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-19staging: vt6656: key: Mark expected switch fall-throughsGustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. This patch fixes the following warnings: drivers/staging/vt6656/key.c: In function ‘vnt_set_keymode’: drivers/staging/vt6656/key.c:70:19: warning: this statement may fall through [-Wimplicit-fallthrough=] key->hw_key_idx = entry; ~~~~~~~~~~~~~~~~^~~~~~~ drivers/staging/vt6656/key.c:71:2: note: here case VNT_KEY_ALLGROUP: ^~~~ drivers/staging/vt6656/key.c:73:6: warning: this statement may fall through [-Wimplicit-fallthrough=] if (onfly_latch) ^ drivers/staging/vt6656/key.c:75:2: note: here case VNT_KEY_GROUP_ADDRESS: ^~~~ drivers/staging/vt6656/key.c:76:12: warning: this statement may fall through [-Wimplicit-fallthrough=] key_mode |= mode; ~~~~~~~~~^~~~~~~ drivers/staging/vt6656/key.c:77:2: note: here case VNT_KEY_GROUP: ^~~~ Warning level 3 was used: -Wimplicit-fallthrough=3 This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough. Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-28staging: vt6656: Remove redundant license textGreg Kroah-Hartman
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-28staging: vt6656: add SPDX identifiers to all vt6656 driver filesGreg Kroah-Hartman
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-01-10staging:vt6656:key.c Aligned code with open parenthesisScott Matheina
Fixed Alignment should match open parenthesis checkpatch CHECK Signed-off-by: Scott Matheina <scott@matheina.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-11-19staging: vt6656: remove address from GPL textOthmar Pasteka
Cleanup errors from checkpatch.pl. Signed-off-by: Othmar Pasteka <pasteka@kabsi.at> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-11-15staging: vt6656: Do not use multiple blank lines.Burcin Akalin
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>
2014-09-23Staging: vt6656: Merges two lines of code and removes unused variableMahati Chamarthy
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: Mahati Chamarthy <mahati.chamarthy@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-21staging: vt6656: struct vnt_private rename byLocalID to local_idMalcolm Priestley
Removing camel case Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-11staging: vt6656: Fix pairwise key for non station modesMalcolm Priestley
patch 'vnt_set_keymode don't save pairwise key entry' caused a slight regression in access point mode Only don't save in station mode. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-08staging: vt6656: vnt_set_keymode don't save pairwise key entry.Malcolm Priestley
The device refuses to associate to older access points even though in the logs it appears to be associated in tkip or ccmp mode. Clear bit from key_entry_inuse in pairwise key so the entry is over written by group address. This doesn't seem to make any difference to newer access points and is a temporary fix until a better solution is found. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-26staging: vt6656: dead code remove old key functionsMalcolm Priestley
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-26staging: vt6656: mac80211 conversion: add key functionsMalcolm Priestley
Create vnt_key_init_table to replace KeyvInitTable. Create vnt_set_keymode to handle key setting operations with five different modes VNT_KEY_DEFAULTKEY, VNT_KEY_GROUP_ADDRESS, VNT_KEY_ALLGROUP, VNT_KEY_GROUP and VNT_KEY_PAIRWISE. VNT_KEY_ONFLY and VNT_KEY_ONFLY_ALL are for when key latching in driver is not required. Create vnt_set_keys to handle mac80211 key cipher modes, four modes are supported WLAN_CIPHER_SUITE_WEP40, WLAN_CIPHER_SUITE_WEP104, WLAN_CIPHER_SUITE_TKIP and WLAN_CIPHER_SUITE_CCMP. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-19staging: vt6656: rename MACvSetKeyEntry to vnt_mac_set_keyentryMalcolm Priestley
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-19staging: vt6656: rename MACvDisableKeyEntry to vnt_mac_disable_keyentryMalcolm Priestley
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-26staging: vt6656: dead code remove control.c/hMalcolm Priestley
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-26staging: vt6656: rename PIPEnsControlOut/CONTROLnsRequestOut to vnt_control_outMalcolm Priestley
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-26staging: vt6656: MACvSetKeyEntry change u32 pdwKey to u8 pointerMalcolm Priestley
Change pdwKey u32 pointer to key u8 pointer. Callers are already u8 remove u32 pointer cast. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-18staging: vt6656: rndis.h move all to device.hMalcolm Priestley
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-15staging: vt6656: lock changes: Remove spin locks.Malcolm Priestley
Remove atomic paths to usbpipe.c PIPEnsControlOut and PIPEnsControlIn Remove from PIPEnsControlOut PIPEnsControlIn BSSvSecondCallBack vt6656_hostap_ioctl iwctl_siwmode iwctl_siwencode iwctl_siwpower iwctl_siwencodeext KeyvInitTable device_init_registers device_open device_close Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-17Staging: Convert uses of compare_ether_addr to ether_addr_equalJoe Perches
Preliminary to removing compare_ether_addr altogether: Use the new bool function ether_addr_equal to add some clarity and reduce the likelihood for misuse of compare_ether_addr for sorting. Additionally: Used is_zero_ether_addr, removed now unused variable Converted uses of &foo[0] to foo Done via cocci script: (and a little typing) $ cat compare_ether_addr.cocci @@ expression a,b; @@ - !compare_ether_addr(a, b) + ether_addr_equal(a, b) @@ expression a,b; @@ - compare_ether_addr(a, b) + !ether_addr_equal(a, b) @@ expression a,b; @@ - !ether_addr_equal(a, b) == 0 + ether_addr_equal(a, b) @@ expression a,b; @@ - !ether_addr_equal(a, b) != 0 + !ether_addr_equal(a, b) @@ expression a,b; @@ - ether_addr_equal(a, b) == 0 + !ether_addr_equal(a, b) @@ expression a,b; @@ - ether_addr_equal(a, b) != 0 + ether_addr_equal(a, b) @@ expression a,b; @@ - !!ether_addr_equal(a, b) + ether_addr_equal(a, b) Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-28staging: vt6656: remove consecutive newlinesAndres More
Several sed -i '/^$/{ N /^\n$/ D }' drivers/staging/vt6656/*.[ch] Signed-off-by: Andres More <more.andres@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-26staging: vt6656: remove unused functionsAndres More
Removed defined symbols not being used elsewhere. Only compile tested. Signed-off-by: Andres More <more.andres@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-25staging: vt6656: remove code placeholdersAndres More
Removed comments from coding template. sed -i '/^\/\*---/d' drivers/staging/vt6656/*.[ch] Signed-off-by: Andres More <more.andres@gmail.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-11staging: vt6656: replaced custom DWORD definition with u32Andres More
Checkpatch findings were not resolved. sed -i 's/\bDWORD\b/u32/g' drivers/staging/vt6656/*.[ch] sed -i 's/\bPDWORD\b/u32 */g' drivers/staging/vt6656/*.[ch] Signed-off-by: Andres More <more.andres@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-11staging: vt6656: replaced custom BYTE definition with u8Andres More
Checkpatch findings were not resolved, only direct replacement. sed -i 's/\bBYTE\b/u8/g' drivers/staging/vt6656/*.[ch] sed -i 's/\bPBYTE\b/u8 */g' drivers/staging/vt6656/*.[ch] Signed-off-by: Andres More <more.andres@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15staging: vt6656: replaced custom TRUE definition with trueAndres More
Checkpatch findings were not resolved, just direct replacement. sed -i 's/\bTRUE\b/true/g' drivers/staging/vt6656/*.[ch] Signed-off-by: Andres More <more.andres@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15staging: vt6656: replaced custom FALSE definition with falseAndres More
Checkpatch findings were not resolved, just direct replacement. sed -i 's/\bFALSE\b/false/g' drivers/staging/vt6656/*.[ch] Signed-off-by: Andres More <more.andres@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-07staging: vt6656: iwctl/key/rf use new structures.Malcolm Priestley
This patch cleans up function declarations, definitions and local variables were appropriate replacing types defined in "ttype.h" with linux/types.h Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-07staging: vt6656: Remove QWORD from source and replace with u64.Malcolm Priestley
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26staging: vt6656: fix headers and add cfg80211.Malcolm Priestley
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-13staging: vt6656: 64bit fixes: key.c/h change unsigned long to u32Malcolm Priestley
Fixes long issues. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-13staging: vt6656: 64 bit fixes: fix long warning messages.Malcolm Priestley
Fixes long warning messages from patch [PATCH 08/14] staging: vt6656: 64 bit fixes : correct all type sizes Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-04staging "vt6656" Fix typos in comments, and in a printk message.Justin P. Mattock
Signed-off-by: Justin P. Mattock <justinmattock@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-10Staging: vt6655-6: check keysize before memcpy()Dan Carpenter
We need to check the we don't copy too much memory. This comes from a copy_from_user() in the ioctl. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2010-08-31staging: vt6656: resolved checkpatch findingLuis Bosch
Added spaces in for loop arguments. Signed-off-by: Luis Bosch <luis.bosch@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-24staging: vt6656: replace IS_ETH_ADDRESS_EQUAL with compare_ether_addrAndres More
Code cleanup, removed custom macro to compare Ethernet addresses. Some checkpatch warnings on indentation were not resolved. The return value of compare_ether_addr was reversed, something to consider. Signed-off-by: Andres More <more.andres@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-23Staging: vt6656: replaced IS_BROADCAST_ADDRESS with is_broadcast_ether_addrAndres More
Replaced and removed the custom definition. Minor checkpatch warnings on long lines and indentation were not cleared. Signed-off-by: Andres More <more.andres@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18Staging: vt6656: code cleanup, fixed 'for' statementsAndres More
Resolved checkpatch findings, but some long lines warnings. ERROR: space required before the open parenthesis '(' ERROR: spaces required around that Signed-off-by: Andres More <more.andres@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-18Staging: vt6656: removed custom UCHAR/USHORT/UINT/ULONG/ULONGLONG typedefsAndres More
Cleared all checkpatch warnings but 'do not add new typedefs' ones. Signed-off-by: Andres More <more.andres@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11Staging: vt6656: code cleanup, removed OUT definitionAndres More
Remoted empty OUT define in ttype.h and its usage across the code. Signed-off-by: Andres More <more.andres@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11Staging: vt6656: removed VOID/PVOID definitionsAndres More
Warnings about the usage of externs in .c files were not resolved here. Signed-off-by: Andres More <more.andres@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11Staging: vt6656: Removed IN definitionAndres More
Code cleanup, removed empty IN definition used to denote input parameters. Signed-off-by: Andres More <more.andres@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11Staging: vt6656: incorporated ETH_ALEN macro instead of custom oneAndres More
Replaced custom U_ETHER_ADDR_LEN by ETH_ALEN from <linux/if_ether.h>. Resolved checkpatch findings on the changed lines, mostly indentation. Signed-off-by: Andres More <more.andres@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>