Commit graph

140 commits

Author SHA1 Message Date
Georgiana Rodica Chelu 7b170bacbb staging: rtl8188eu: core: rtw_xmit: Use macros instead of constants
Replace the 0x888e with ETH_P_PAE and 0x0806 with ETH_P_ARP.
These macros can be found in drivers/staging/rtl8192e/rtllib.h

Hexadecimal numbers are not case sensitive,
therefore 0x888e is equal with 0x888E.

The modifications improve the readability of the code.

Signed-off-by: Georgiana Rodica Chelu <georgiana.chelu93@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-02 17:26:57 +02:00
Binoy Jayan 38bee763bd rtl8192e: Replace semaphore ips_sem with mutex
The semaphore 'ips_sem' in the rtl8192e is a simple mutex, so it should
be written as one. Semaphores are going away in the future.

Signed-off-by: Binoy Jayan <binoy.jayan@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21 18:22:31 +02:00
Binoy Jayan be10ceea4f rtl8192e: Replace semaphore scan_sem with mutex
The semaphore 'scan_sem' in the rtl8192e is a simple mutex, so it should
be written as one. Semaphores are going away in the future.

Signed-off-by: Binoy Jayan <binoy.jayan@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21 18:22:31 +02:00
Binoy Jayan 9afa937047 rtl8192e: rtllib_device: Replace semaphore wx_sem with mutex
The semaphore 'wx_sem' in the rtllib_device is a simple mutex,
so it should be written as one. Semaphores are going away in the future.

Signed-off-by: Binoy Jayan <binoy.jayan@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21 18:22:31 +02:00
Amitoj Kaur Chawla 354605f4e6 staging: rtl8192e: Remove create_workqueue()
With conccurency managed workqueues, use of dedicated workqueues can
be replaced by system_wq. Drop wq by using system_wq.

Since there are multiple work items per rtllib but they do not need to
be ordered, increase of concurrency by switching to system_wq should
not break anything.

All work items are sync canceled on rtllib_stop_protocol() so it is
guaranteed that no work is running when rtl92e_disable/reset/restart
functions are called.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Geliang Tang be53a0d53c staging: rtl8192e: use to_delayed_work
Use to_delayed_work() instead of open-coding it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 20:01:45 -08:00
Joe Perches ee233d3e19 staging: rtl8192e: Remove unnecessary externs
Using 'extern' is not necessary for function prototypes.

Miscellanea:

o Reflow alignments

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-14 18:51:56 -07:00
Mateusz Kulikowski 6957248f48 staging: rtl8192e: rtllib_softmac: Make functions static
Make as many functions as possible static in rtllib_softmac.c.

The following functions were affected:
- rtllib_sta_wakeup
- rtllib_TURBO_Info
- rtllib_get_beacon_
- rtllib_send_probe_requests
- rtllib_update_active_chan_map
- rtllib_softmac_scan_syncro

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-14 22:43:31 -07:00
Mateusz Kulikowski ed43603369 staging: rtl8192e: Make rtllib_rx_mgt() static
Function is not referenced outside of rtllib_rx.c

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-14 22:43:31 -07:00
Mateusz Kulikowski 511998ea5b staging: rtl8192e: rtllib_tx: Make functions static
Make as many functions as possible static in rtllib_tx.c.

The following functions were affected:
- rtllib_xmit_inter
- rtllib_query_seqnum
- rtllib_put_snap

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-14 22:43:31 -07:00
Mateusz Kulikowski e0c84c1c1f staging: rtl8192e: rtllib_HTProc: Make functions static
Make as many functions as possible static in rtllib_HTProc.c.

The following functions were affected:
- HTMcsToDataRate
- HTFilterMCSRate

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-14 22:43:30 -07:00
Mateusz Kulikowski 18e2daa858 staging: rtl8192e: Remove unused rtllib_device::freq_band
Member is never referenced.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-14 22:43:29 -07:00
Mateusz Kulikowski 9b3fcf2bbf staging: rtl8192e: Remove unused ether_header structure
Structure is not used in the driver.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-14 22:43:29 -07:00
Mateusz Kulikowski e93c18c723 staging: rtl8192e: Remove rtllib_stats structure
Two remaining fields of rtllib_stats are only incremented, but
never read.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-14 22:43:29 -07:00
Mateusz Kulikowski 1184b4ade8 staging: rtl8192e: Remove unused fields from rtllib_stats
None of them are used in the driver.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-14 22:43:29 -07:00
Mateusz Kulikowski 9efe891d01 staging: rtl8192e: Remove unused defines
Remove most of unused defines (excluding phyreg/hw registers).

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-14 22:43:29 -07:00
Mateusz Kulikowski 47eae6ddd9 staging: rtl8192e: Remove rtllib_device::agregation
Variable is always true; Resolve condition where it is used
(and change indentation of conditional expression).

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-17 21:37:21 -07:00
Mateusz Kulikowski 0941f87fd5 staging: rtl8192e: Remove softmac_hint11d_wq queue
This queue is never used, and function handler is empty

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-17 21:37:21 -07:00
Mateusz Kulikowski 48eb2b7ea6 staging: rtl8192e: Remove unused rtllib_device members
Delete several members of rtllib_device including
their initializers if needed.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-17 21:37:21 -07:00
Mateusz Kulikowski 6898f7d1ea staging: rtl8192e: Remove rt_pwr_save_ctrl members
Following members were removed:
- tmpJoinAction
- tmpSuppRateBuf
- bTmpIbpm

As a consequence several unused defines/enums/structs were
also removed from rtllib.h

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-17 21:35:02 -07:00
Mateusz Kulikowski 7f5678ee53 staging: rtl8192e: Remove rtllib_network::last_associate
Variable was initialized and never used.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-17 21:35:02 -07:00
Mateusz Kulikowski 814732423f staging: rtl8192e: Remove WIRELESS_EXT checks
Current WIRELESS_EXT version is at least 22.
Resolve ifdefs and delete dead code.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-17 21:35:02 -07:00
Mateusz Kulikowski d12bc89af1 staging: rtl8192e: Remove rtllib_device::get_nic_desc_num()
This function/callback was initialized and never called.
rtl8192_get_nic_desc_num() function that was default
implementation was also removed.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-17 21:35:02 -07:00
Mateusz Kulikowski 0992510c7a staging: rtl8192e: Remove rtllib_wx_get_encode_ext()
This function was declared but never unused.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-17 21:35:02 -07:00
Mateusz Kulikowski 79b7d693d5 staging: rtl8192e: Remove rtllib_is_shortslot()
This function was declared but never unused.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-17 21:35:02 -07:00
Mateusz Kulikowski 4b2f218471 staging: rtl8192e: Remove rtllib_wake_queue()
This function was declared but never unused.
Also remove dequeue_mgmt() and rtllib_resume_tx() that are
no longer used.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-17 21:35:02 -07:00
Mateusz Kulikowski f525984660 staging: rtl8192e: Remove rtllib_stop_queue()
This function was declared but never unused.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-17 21:35:02 -07:00
Mateusz Kulikowski 5c3ea2f5b9 staging: rtl8192e: Remove ENABLE_LOCK_DEBUG reference
ENABLE_LOCK_DEBUG macro was never set, so condition that used
it can be resolved manually.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-17 21:35:02 -07:00
Mateusz Kulikowski b27c7160c5 staging: rtl8192e: Remove unused code in rtllib.h
Delete macros, structure members and declarations etc. that are not
referenced anywhere in code.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-17 21:35:01 -07:00
Mateusz Kulikowski 0beee3ba61 staging: rtl8192e: Remove unimplemented iwpriv handlers
Remove the following private variables:
- force_mic_error - changes force_mic_error that is not used
- radio - changes sw_radio_on that is not used
- adhoc_peer_list - unimplemented
- firm_ver - unimplemented

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-01 06:33:22 +09:00
Mateusz Kulikowski db65e4aaf5 staging: rtl8192e: Remove remains of RTLLIB_*_DEBUG() (including proc entry)
Remove rest of rtllib "debug" system - it is no longer used -
proper netdev_* functions are used in most cases.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-01 06:33:21 +09:00
Mateusz Kulikowski 7232141526 staging: rtl8192e: Remove RTLLIB_DEBUG_DATA()
Use print_hex_dump_bytes() if VERBOSE_DEBUG is enabled.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-01 06:32:02 +09:00
Mateusz Kulikowski b94436b5d5 staging: rtl8192e: Remove RTLLIB_DEBUG()
- Use netdev_dbg or netdev_vdbg instead of RTLLIB_DEBUG()
- Reformat some messages for better readability
- Remove RTLLIB_DEBUG messages that make no sense

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-01 06:32:02 +09:00
Mateusz Kulikowski def16d2ee9 staging: rtl8192e: Remove RTLLIB_DEBUG_INFO()
Use pr_debug() instead.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-01 06:32:01 +09:00
Mateusz Kulikowski e9fea2ecb0 staging: rtl8192e: Remove RTLLIB_DEBUG_MGMT()
- Use netdev_dbg() instead of RTLLIB_DEBUG_MGMT()
- Remove RTLLIB_DEBUG_MGMT()
- Pass net_device to auth_parse(), auth_rq_parse() and assoc_rq_parse()
- Remove duplicated messages

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-01 06:32:01 +09:00
Mateusz Kulikowski 8f90dfbf64 staging: rtl8192e: Remove RTLLIB_DEBUG_QOS()
- Pass extra argument (rtllib_device) to rtllib_parse_qos_info_param_IE()
  and update_network()
- Replace RTLLIB_DEBUG_QOS() with netdev_dbg()
- Remove RTLLIB_DEBUG_QOS()

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-01 06:32:01 +09:00
Mateusz Kulikowski e77c752f39 staging: rtl8192e: Remove RTLLIB_DEBUG_(FRAG|EAP|DROP|STATE|TX|RX)()
Use netdev_dbg() instead.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-01 06:32:00 +09:00
Mateusz Kulikowski 521a9cbdb2 staging: rtl8192e: Remove RTLLIB_DEBUG_SCAN()
Use netdev_dbg() instead, remove duplicated logs.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-01 06:32:00 +09:00
Mateusz Kulikowski c6a91aba25 staging: rtl8192e: Remove RTLLIB_DEBUG_WX()
Use netdev_dbg() instead of RTLLIB_DEBUG_WX().
Rewrite some messages to be more readable.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-01 06:32:00 +09:00
Mateusz Kulikowski f0dddb1d02 staging: rtl8192e: Remove RTLLIB_ERROR() and RTLLIB_WARNING()
Use pr_* where needed (rtllib init code).

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-01 06:32:00 +09:00
Mateusz Kulikowski 06c1110728 staging: rtl8192e: Make ethernet addresses properly aligned
Reorder ethernet addresses allocated on stack or in non-packed
structures to keep them aligned(2).
Use ETH_ALEN as array length in places where it was hardcoded to 6.

Alignment verified using pahole where possible and target-tested
with BUG_ON() trap in ether_addr_copy.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-01 06:31:59 +09:00
Paul Gortmaker acd442db05 rtl8192e: delete local copy of iee80211 reason codes.
This driver has a copy of the standard reason codes from the file
<linux/ieee80211.h> but with slightly different name fields.

Delete the local copy and remap the only two use cases onto the names
used by the global implementation with the same values.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08 09:24:15 +02:00
Mateusz Kulikowski 14b40d9288 staging: rtl8192e: Comment cleanup (style/format)
- Multiline comments use "network subsystem comment style"
- Merge short multiline comments
- Remove empty comments
- Remove function name comment at the end of small (<1 screen) functions
- Reformat 802.11 data frame format to use spaces and network format

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-03 15:29:31 +02:00
Mateusz Kulikowski 61dbdf36f2 staging: rtl8192e: Fix PRINTK_WITHOUT_KERN_LEVEL warnings
Replace custom hex dumping function with print_hex_dump_bytes()
to make checkpatch.pl happy

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-03 15:29:30 +02:00
Mateusz Kulikowski b2e70746e9 staging: rtl8192e: remove unused EXPORT_SYMBOL_RSL macro
This macro caused checkpatch.pl warning and is not used.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-03 15:29:30 +02:00
Mateusz Kulikowski e48617a48c staging: rtl8192e: remove eqMacAddr macro
Remove eqMacAddr macro and replace it with ether_addr_equal_unaligned()

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-20 13:14:00 +01:00
Mateusz Kulikowski 34fff6db29 staging: rtl8192e: rtllib.h: remove duplicated container_of
This macro is already defined in kernel.h - there is no need to redefine it.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-20 13:13:59 +01:00
Mateusz Kulikowski 7e4eb9fdf2 staging: rtl8192e: remove unused macros
Several (unused) macros were removed from driver.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-20 13:13:59 +01:00
Mateusz Kulikowski 7527cf3710 staging: rtl8192e: remove dead code
Remove commented-out unions and enum.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-20 13:13:59 +01:00
Mateusz Kulikowski d69d20549b staging: rtl8192e: fix coding style warnings (printk -> netdev_*)
Use netdev_*, dev_* or pr_* instead of printk where possible.
KERN_DEBUG messages are left intact as pr_dbg has different behaviour.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-20 13:13:59 +01:00