Commit graph

50 commits

Author SHA1 Message Date
Dan Carpenter
2d98bb22c3 Staging: rc2860: return -EFAULT on copy_to_user errors
copy_to_user() returns the number of bytes remaining but we want to
return a negative error code.  This is in the ioctl handler and the
error code gets passed to userspace.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-04 13:38:58 -07:00
Julia Lawall
8f18604e6f Staging: drop redundant memset
The region set by the call to memset is immediately overwritten by the
subsequent call to memcpy.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression e1,e2,e3,e4;
@@

- memset(e1,e2,e3);
  memcpy(e1,e4,e3);
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11 11:35:34 -07:00
Dan Carpenter
4dbb8e57c1 staging: rt2860: off by one errors
The code is trying to say that if the offset is higher than the max it
should be set to the max, but there is an off by one bug and it sets it
one passed the end of the array.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11 11:35:33 -07:00
Roel Kluin
a2c3fdb996 Staging: rt2860/sta_ioctl.c: Two branches the same in rt_ioctl_giwscan()
Regardless of the condition, the branches execute the same code

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:48 -08:00
Sebastian Dalfuß
06aea994cf Staging: rt2860: reduce superfluous exclamation marks
This removes superfluous exclamation marks from strings and comments, and
also three spelling typos.

Signed-off-by: Sebastian Dalfuß <sd@sedf.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11 12:23:19 -08:00
Bartlomiej Zolnierkiewicz
62eb734b49 Staging: rt28x0: remove typedefs (part three)
Remove misc typedefs.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11 12:23:16 -08:00
Bartlomiej Zolnierkiewicz
8a10a54656 Staging: rt28x0: remove typedefs (part two)
Remove typedefs from rt_linux.h and rtmp_usb.h.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11 12:23:15 -08:00
Bartlomiej Zolnierkiewicz
51126deb20 Staging: rt28x0: remove typedefs (part one)
Remove typedefs from rtmp_type.h.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11 12:23:15 -08:00
Bartlomiej Zolnierkiewicz
9f548a2a3d Staging: rt28x0: fix comments in *.c files
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11 12:23:14 -08:00
Bartlomiej Zolnierkiewicz
66cd8d6ec9 Staging: rt28x0: run *.c files through Lindent
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11 12:23:13 -08:00
Bartlomiej Zolnierkiewicz
4c96e89320 Staging: rt28x0: remove private WEXT handlers
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11 12:23:11 -08:00
Bartlomiej Zolnierkiewicz
725fef147b Staging: rt28x0: remove private RTPRIV_IOCTL_GSITESURVEY ioctl
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11 12:23:11 -08:00
Bartlomiej Zolnierkiewicz
468d0c507b Staging: rt28x0: remove private RTPRIV_IOCTL_SET ioctl
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11 12:23:11 -08:00
Bartlomiej Zolnierkiewicz
e44fd1cfde Staging: rt2860: add RT3090 chipset support
Add support for RT3090 chipset
(based on 2009_0612_RT3090_Linux_STA_V2.1.0.0_DPO).

Tested with RT2860.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11 12:21:45 -08:00
Bartlomiej Zolnierkiewicz
ca97b83888 Staging: rt28x0: updates from vendor's V2.1.0.0 drivers
Port changes from:

* 2009_0420_RT2860_Linux_STA_V2.1.0.0
* 2009_0302_RT2870_Linux_STA_v2.1.0.0
* 2009_0525_RT3070_Linux_STA_v2.1.1.0

to in-kernel drivers.


From the RT2860 driver release note:

[2.1.0.0]
1. New generation schema for multiple OS porting
2. Fixed Ad-hoc ping failed in noisy environment. (Probe Response has too
    many retry packet then cause "not enough space in MgmtRing")
3. Fixed WPA(2)PSK issue when group cipher of AP is WEP40 or WEP104.
4. Modified iwpriv ra0 get_site_survey:
	In scan list result: Security shows "NONE" when AP is OPEN/NONE,
	shows "WEP" when AP is OPEN/WEP or SHARED/WEP, shows
	"WPAPSK(WPA2PSK)/TKIP(AES)" when AP is WPAPSK(WPA2PSK)/TKIP(AES)
	shows "WPA(WPA2)/TKIP(AES)" when AP is WPA(WPA2)/TKIP(AES)
5. Support kthread.
6. Add New A band channel list region 15 contains the whole channels in
   the A band region 4 and the new CE channel 167,169,171,173
7. Add New IEEE802.11r functionality.
8. Fixed WPA2-Enterprise failed when AP reboot or turn off then turn on.
9. Fixed STA cannot connect to 11B only AP when the setting of is PHY_11GN.


From the RT2870 driver release note:

[V2.1.0.0]
1. New generation schema for multiple OS porting.
2. Fixed Ad-hoc ping failed in noisy environment. (Probe Response has too
   many retry packet then cause "not enough space in MgmtRing").
3. Fixed WPS failed with D-Link DIR-628 in 5GHz.
4. Change FastRoaming in DAT file to AutoRoaming.
5. Support kthread.
6. Add New A band channel list region 15 contains the whole channels in
   the A band region and the new CE channel 167,169,171,173.
7. New IEEE802.11r functionality.


From the RT3070 driver release note:

Version V2.1.1.0
       1. Linux kernel 2.6.29 support.
       2. Fix eFuse write from BIN file bug.

Version 2.1.0.0
       1. New generation schema for multiple OS porting
       2. Fixed Ad-hoc ping failed in noisy environment.
       3. Modified iwpriv ra0 get_site_survey:
       4. Change FastRoaming in DAT file to AutoRoaming.
       5. Support kthread.
       6. New IEEE802.11r functionality.


Tested with RT2860 and RT3070 chipsets.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11 12:21:44 -08:00
Roel Kluin
8f679185a3 Staging: rt2860: Fix test in rt_ioctl_siwfrag()
The test always evaluated to true.

MIN_FRAG_THRESHOLD is defined 256,
MAX_FRAG_THRESHOLD is defined 2346

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:02:24 -07:00
Bartlomiej Zolnierkiewicz
5cc86f28ca Staging: rt2870: add eFuse support
rt3070:
* remove unused bEEPROMFile field from RTMP_ADAPTER

rt2870:
* propagate eFuse support from rt3070

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:02:23 -07:00
Bartlomiej Zolnierkiewicz
940911da24 Staging: rt2870: remove SHOW_ADHOC_ENTRY_INFO support
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:02:23 -07:00
Bartlomiej Zolnierkiewicz
6e87be5d6a Staging: rt28x0: rt_ioctl_siwencode() fixes
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:02:22 -07:00
Bartlomiej Zolnierkiewicz
118d67df58 Staging: rt28x0: add SIOCGIWNAME support to rt_ioctl_giwscan()
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:02:22 -07:00
Bartlomiej Zolnierkiewicz
3cf830a1db Staging: rt3070: WEP fixes
Propagate WEP fixes from rt28[67]0 to rt3070.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:02:21 -07:00
Bartlomiej Zolnierkiewicz
881abc9d22 Staging: rtxxx0: remove private ioctls
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:02:20 -07:00
Bartlomiej Zolnierkiewicz
a59601e4e7 Staging: rtxxx0: remove private debugging ioctls
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:02:19 -07:00
Bartlomiej Zolnierkiewicz
2497322e37 Staging: rtxxx0: remove dead virtual adapter support
* remove dead virtual adapter support
* remove needless rt28xx_ioctl() wrapper
* remove superfluous NULL checks

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:02:19 -07:00
Bartlomiej Zolnierkiewicz
37843390d1 Staging: rtxxx0: remove superfluous RT30xx ifdefs
* add !RT30xx version of IS_RT3090() macro
* remove superfluous RT30xx ifdefs
* unify RT30xx and !RT30xx code where possible
* kill RT28XX_UPDATE_PROTECT() macro
* remove needless variable initializations
* kill some needless function prototypes

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:02:19 -07:00
Bartlomiej Zolnierkiewicz
20e3c65381 Staging: rtxxx0: remove support for older wireless extensions
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:02:18 -07:00
Alexander Beregalov
e82bf85ec9 Staging: rt2860: remove dependency on WIRELESS_EXT version
As the driver is in mainline now we can remove such dependencies.
WIRELESS_EXT is 22 now.

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:02:06 -07:00
Marcin Slusarz
b8bc58c5fb Staging: rt*: don't confuse user of rt3070 driver with rt2870 strings
Original author didn't bother to change strings for rt3070 driver. Fix it.

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Acked-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:01:40 -07:00
Bartlomiej Zolnierkiewicz
3a32ed12b6 Staging: rt2860: prepare for rt28[67]0/*.[ch] merge
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:50 -07:00
Bartlomiej Zolnierkiewicz
5a911fd648 Staging: rt2860: remove dead CONFIG_AP_SUPPORT code
Then remove no longer needed IF_DEV_CONFIG_OPMODE_ON_[AP,STA]() macros.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:48 -07:00
Bartlomiej Zolnierkiewicz
1623267ab4 Staging: rt2860: remove DOT11_N_SUPPORT ifdefs
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:48 -07:00
Bartlomiej Zolnierkiewicz
e08bae5ab2 Staging: rt2860: remove WPA_SUPPLICANT_SUPPORT ifdefs
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:47 -07:00
Bartlomiej Zolnierkiewicz
2684d16649 Staging: rt2860: remove NATIVE_WPA_SUPPLICANT_SUPPORT ifdefs
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:47 -07:00
Bartlomiej Zolnierkiewicz
37f9be32f7 Staging: rt2860: remove dead SNMP_SUPPORT code
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:44 -07:00
Bartlomiej Zolnierkiewicz
d439c37872 Staging: rt2860: remove dead EXT_BUILD_CHANNEL_LIST code
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:44 -07:00
Bartlomiej Zolnierkiewicz
0aa7c8ddc0 Staging: rt2860: remove dead QOS_DLS_SUPPORT code
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:44 -07:00
Bartlomiej Zolnierkiewicz
72888d31af Staging: rt2860: remove dead MULTIPLE_CARD_SUPPORT code
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:43 -07:00
Bartlomiej Zolnierkiewicz
715cb0a4d0 Staging: rt2860: remove dead CARRIER_DETECTION_SUPPORT code
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:43 -07:00
Bartlomiej Zolnierkiewicz
063f22af9d Staging: rt2860: remove dead RALINK_ATE code
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:42 -07:00
Bartlomiej Zolnierkiewicz
87502c14fe Staging: rt2860: remove dead CONFIG_APSTA_MIXED_SUPPORT code
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:41 -07:00
Bartlomiej Zolnierkiewicz
27eff3bf2c Staging: rt2860: remove IWE_STREAM_ADD_*() macros
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:39 -07:00
Anders Kaseorg
32c976bca4 Staging: rt2860: Don't call sprintf() with overlapping input and output.
The use of sprintf() to append to a buffer, as in
  sprintf(buf, "%sEntry: %d\n", buf, i)
is not valid according to C99 ("If copying takes place between objects
that overlap, the behavior is undefined.").  It breaks at least in
userspace under gcc -D_FORTIFY_SOURCE.  Replace this construct with
  sprintf(buf + strlen(buf), "Entry: %d\n", i)

This patch was automatically generated using
  perl -0pe 's/(sprintf\s*\(\s*([^,]*))(\s*,\s*")%s((?:[^"\\]|\\.)*"\s*,)\s*\2\s*,/$1 + strlen($2)$3$4/g'
  perl -0pe 's/(snprintf\s*\(\s*([^,]*))(\s*,[^,]*?)(\s*,\s*")%s((?:[^"\\]|\\.)*"\s*,)\s*\2\s*,/$1 + strlen($2)$3 - strlen($2)$4$5/g'

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:36 -07:00
Mark Einon
bdc0a1739f Staging: rt2860: Remove dependency on CFLAG RT2860
Removed the CFLAG RT2860 from Makefile and dependency on it in the driver code.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-04-03 14:53:31 -07:00
Mark Einon
f72c4bf5e1 Staging: rt2860: Fix remaining build warnings
Fixed remaining four build warnings in drivers/staging/rt2860/:

drivers/staging/rt2860/common/mlme.c:900: warning: format ‘%d’ expects type ‘int’, but argument 2 has type ‘ULONG’
drivers/staging/rt2860/common/rtmp_init.c:2049: warning: ‘Value’ may be used uninitialized in this function
drivers/staging/rt2860/sta_ioctl.c:361: warning: ‘return’ with a value, in function returning void
drivers/staging/rt2860/sta_ioctl.c:2468: warning: ‘return’ with a value, in function returning void

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-04-03 14:53:31 -07:00
Adam McDaniel
ed291e8051 Staging: rt2860: Ported v1.7.1.1 changes into v1.8.0.0, becoming v1.8.1.1
Staging: rt2860: Ported v1.7.1.1 changes into v1.8.0.0, becoming v1.8.1.1

When RaLink released rt2860 v1.7.0.0, it lacked proper support for both WEP
and WPA/WPA2 encryption. Either was possible, but the module had to be
compiled to support only one or the other, never both.

Since the EeePC was the most common device with this hardware (and these
users were complaining to RaLink that WPA/WPA2 encryption didn't work)
RaLink released a fix as an "eeepc-specific" version of this driver, v1.7.1.1

Unfortunately, when v1.8.0.0 was released, this WPA/WPA2 fix was never
included.

What complicates things further is that RaLink has no interest in
continuing work on this Linux driver for their hardware.

This commit ports the changes introduced in v1.7.1.1 into the v1.8.0.0
release, upgrading the kernel's module to v1.8.1.1

Signed-off-by: Adam McDaniel <adam@array.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-04-03 14:53:31 -07:00
Pekka Enberg
7f20a18d18 Staging: rt2860: remove kernel version compatibility wrappers
The driver is in mainline now so there's no point in keeping the
kernel version compatibility wrappers around.

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-04-03 14:53:30 -07:00
Julia Lawall
7034ca4dda Staging: rt2860,rt2870: Correct use of ! and &
IW_ENCODE_MODE is 0xF000 and thus !erq->flags & IW_ENCODE_MODE is always 0.
I assume that !(erq->flags & IW_ENCODE_MODE) was intended.

The semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@@ expression E; constant C; @@
(
  !E & !C
|
- !E & C
+ !(E & C)
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-04-03 14:53:30 -07:00
Harvey Harrison
d599edcaea staging: __FUNCTION__ is gcc-specific, use __func__
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-07 15:48:54 -08:00
Greg Kroah-Hartman
739b797941 Staging: rt2860: fix up netdev->priv usage
Now that netdev->priv is removed, fix the driver to use netdev->ml_priv
like it always should have been doing.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-06 13:52:12 -08:00
Greg Kroah-Hartman
9198099052 Staging: add rt2860 wireless driver
This is the Ralink RT2860 driver from the company that does horrible
things like reading a config file from /etc.  However, the driver that
is currently under development from the wireless development community
is not working at all yet, so distros and users are using this version
instead (quite common hardware on a lot of netbook machines).

So here is this driver, for now, until the wireless developers get a
"clean" version into the main tree, or until this version is cleaned up
sufficiently to move out of the staging tree.

Ported to the Linux build system and cleaned up a bit already by me.

Cc: Linux wireless <linux-wireless@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-06 13:52:11 -08:00