Commit graph

818 commits

Author SHA1 Message Date
Mateusz Kulikowski a5c06ad83b staging: rtl8192e: Replace ?: with min_t
Replace :? with min_t for readability. Remove check that is always false.

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 a94aa9adb6 staging: rtl8192e: Replace ?: with max_t
Improve readability and make checkpatch happy.

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 2b2215af34 staging: rtl8192e: Remove unused rtl_crypto.h
This header is not used - remove it to make driver code smaller.

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 7c3d257916 staging: rtl8192e: Fix OOM_MESSAGE warnings
Remove alloc failed messages where not needed to make checkpatch.pl happy.

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 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 310852327a staging: rtl8192e: Fix LONG_LING in rtllib_parse_info_param()
Take out MIFE_TYPE_HT_CAP processing into separate function -
rtllib_parse_mfie_ht_cap()

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 35e33b0468 staging: rtl8192e: Fix LONG_LINE warnings
Fix most of simple LONG_LINE warnings. None of the changes should affect
behaviour of code, so several modifications are included in this patch:
- Code is reindented where needed
- Local variable names are compacted (priv -> p)
- Unnecessary casts are removed
- Nested ifs are replaced with logical and
- a = b = c = d expressions are split
- Replace if/then series with clamp_t()
- Removed unneeded scopes

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 7bdfaa0abf staging: rtl8192e: Fix PREFER_PR_LEVEL warnings
Fix most of remaining PREFER_PR_LEVEL warnings in rtllib.
Replace printk() with netdev_* if possible, pr_* in other 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 ca93dcba3a staging: rtl8192e: Remove assert() macro
Assert macro printed warning message (and was used once).
Remove it, and add netdev_warn() in place where it was called.

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 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 ad5c8e0586 staging: rtl8192e: Simplify rtllib_process_probe_response()
- Extract frame_ctl once and use it as variable.
- Drop endian conversion in is_beacon() function
  (used in simplified function only)
- Simplify debug messages
- Invert STYPE checks in debug messages - it is valid
  as only BEACON and PROBE_RESP are allowed

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 11e672c3e2 staging: rtl8192e: Replace RTLLIB_DEBUG(DL_ERR) with netdev_*()
Replace all RTLLIB_DEBUG(RTLLIB_DL_ERR, *) calls with netdev_err()
for errors that really should be reported to user.
Use netdev_warn() for the rest.
Rephrase some of the messages to make them more readable/compact.

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 1af35de29f staging: rtl8192e: Remove rtllib_crypt.[ch]
It is neither compiled nor used in rtl8192e.

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 c2f8b4ab8c staging: rtl8192e: Replace memcmp() with ether_addr_equal()
Use dedicated macro to compare ethernet addresses in probe_rq_parse().

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
Mateusz Kulikowski 80d2579d86 staging: rtl8192e: Fix DEEP_INDENTATION warning in rtllib_parse_info_param()
Move MFIE_TYPE_GENERIC handler to rtllib_parse_mife_generic() function.
Code was not altered significantly, therefore in some places it generates
LONG_LINE checkpatch.pl warnings.

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
Mateusz Kulikowski b57ceb19ab staging: rtl8192e: Fix PREFER_ETHER_ADDR_COPY warnings
Replace memcpy() with ether_addr_copy() where possible to make
checkpatch.pl happy.
Change was target tested (download 1Mb file over WPA2 network)
with BUG trap for unaligned addresses 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
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
Mateusz Kulikowski c7ddc288eb staging: rtl8192e: accept const MAC address
Make set_swcam, setKey and rtllib_probe_resp parameter (MAC address)
const.

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
Arno Tiemersma 640f7d6938 staging: rtl8192e: Change cpu_to_le16 to le16_to_cpu
Since the function auth_parse returns a u16, and
struct rtllib_authentication.status is defined as an __le16, it seems
that

	return cpu_to_le16(a->status);

should be

	return le16_to_cpu(a->status);

This change silences the following sparse warnings:
drivers/staging/rtl8192e/rtllib_softmac.c:1817:16:
 warning: cast from restricted __le16
drivers/staging/rtl8192e/rtllib_softmac.c:1817:16:
 warning: incorrect type in return expression (different base types)
drivers/staging/rtl8192e/rtllib_softmac.c:1817:16:
    expected unsigned short
drivers/staging/rtl8192e/rtllib_softmac.c:1817:16:
    got restricted __le16 [usertype] <noident>

Signed-off-by: Arno Tiemersma <arno.tiemersma@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-10 15:00:41 +02:00
Gujulan Elango, Hari Prasath (H.) e32e192814 staging: rtl8192e: use time_before() macro
This patch replaces the condition check for time elapsed with a
simplified time_before() macro

Signed-off-by: Hari Prasath Gujulan Elango <hgujulan@visteon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-10 15:00:41 +02:00
Gujulan Elango, Hari Prasath (H.) b68cecbedd staging: rtl8192e: Use time_after macro
This patch replaces a condition check for time elapsed with a
simple time_after macro

Signed-off-by: Hari Prasath Gujulan Elango <hgujulan@visteon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-10 15:00:40 +02:00
Gujulan Elango, Hari Prasath (H.) 94e057d7c4 staging: rtl8192e: fix wrong assignment
This patch addresses a spatch warning on assigning a negative
value to a unsigned integer.Similar patch has been submitted by
Larry Finger earlier to silence the same spatch warning in another
file.

Signed-off-by: Hari Prasath Gujulan Elango <hgujulan@visteon.com>
Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-10 15:00:40 +02: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 a569f22007 staging: rtl8192e: Fix DeviceID in rtl8192_pci_findadapter()
rtl8192_pci_findadapter() was looking for invalid DeviceID (0x8172),
instead of proper for rtl8192e/se devices (0x8192)

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08 09:24:07 +02:00
Mateusz Kulikowski eae10b8ea5 staging: rtl8192e: Fix DEEP_INDENTATION warnings in rtl_dm.c
Separate parts of dm_TXPowerTrackingCallback_TSSI() into two new functions:
- dm_tx_update_tssi_weak_signal()
- dm_tx_update_tssi_strong_signal()

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08 09:24:07 +02:00
Mateusz Kulikowski fbb052f9fe staging: rtl8192e: Fix DEEP_INDENTATION warnings in rtllib_parse_info_param()
- Replace ?: with min_t
- Remove condition that is always true

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08 09:24:07 +02:00
Mateusz Kulikowski 867ebbaebc staging: rtl8192e: Fix LINE_SPACING warning
Trivial fix - add newline in dm_InitializeTXPowerTracking_TSSI()

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08 09:24:06 +02:00
Mateusz Kulikowski 20b7ec0990 staging: rtl8192e: Remove bb tx gains from r8192_priv
r8192_priv structure had 2 big arrays with tx gain register values:
- cck_txbbgain_table
- cck_txbbgain_ch14_table
- txbbgain_table

This arrays were read-only - filled in driver init code and look
like firmware/chip-specific.

This patch removes them from r8192_priv and puts them in (global) variables.

tx_bb_gain is also flattened - register values are stored in array;
Amplification value can be calculated using dm_tx_bb_gain_idx_to_amplify().

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08 09:24:06 +02:00
Mateusz Kulikowski f669228512 staging: rtl8192e: Fix SPACING errors
Fix several SPACING errors to make checkpatch happy.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08 09:24:06 +02:00
Mateusz Kulikowski aedd45dfd2 staging: rtl8192e: remove r819xE_phyreg.h
This file is not used and its contents are duplicated in r8192E_phyreg.h.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08 09:24:06 +02:00
Mateusz Kulikowski 27a3071c6d staging: rtl8192e: Copy comments from r819XE_phyreg.h to r8192E_phyreg.h
Both files have the same contents (with the exception of comments).
One of them will not survive future commits.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08 09:24:05 +02:00
Mateusz Kulikowski 7b7b0c9bbc staging: rtl8192e: Fix SPACE_BEFORE_TAB warnings
Reformat r8192E_phyreg.h to make checkpatch happy.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08 09:24:05 +02:00
Mateusz Kulikowski 8852112e1c staging: rtl8192e: Remove dead code
Remove commented-out code

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 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 e725fb6f81 staging: rtl8192e: Fix indentation in rtllib_rx_auth_resp()
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 f7567e2070 staging: rtl8192e: Decrease nesting of rtllib_rx_auth_resp()
Return from rtllib_rx_auth_resp() if auth_parse() fails.

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 e8f05b0b01 staging: rtl8192e: Divide rtllib_rx_auth()
Move authentication response processing to rtllib_rx_auth_resp() function.
No logic is affected.

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 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 ff28b74c1c staging: rtl8192e: Fix DO_WHILE_MACRO_WITH_TRAILING_SEMICOLON warning
Fix 'do {} while (0) macros should not be semicolon terminated'
checkpatch.pl warning

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 bec027ea38 staging: rtl8192e: Fix BRACES warning
Fix 'braces {} are not necessary for single statement blocks'
checkpatch.pl warning

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 e2ac043118 staging: rtl8192e: Fix LINE_CONTINUATIONS warning
Fix 'Avoid unnecessary line continuations' checkpatch.pl warning

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