dect
/
linux-2.6
Archived
13
0
Fork 0
Commit Graph

349 Commits

Author SHA1 Message Date
Al Viro d36b691077 misc latin1 to utf8 conversions
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-01-02 13:04:55 +01:00
Kevin McKinney 221fd753dd Staging: bcm: Fix an invalid dereference to a kmalloc in IOCTL_BCM_BULK_WRM
Variable IoBuffer.InputLength is chosen from userspace,
and can therefore be less than the intended size. In this
case,the memory from the kmalloc call is eventually cast
to a PBULKWRM_BUFFER. If the IoBuffer.InputLength does not
meet the minimum size of PBULKWRM_BUFFER, then we will get
a kernel Oops. To resolve this issue, this patch verifies
IoBuffer.InputLength meets the minimum size before invoking
the kmalloc call.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-22 13:32:45 -08:00
Kevin McKinney b72a7c859e Staging: bcm: Fix information leak in IOCTL_BCM_GET_DRIVER_VERSION
This ioctl, IOCTL_BCM_GET_DRIVER_VERSION, is
responsible for sending the driver version
to userspace. However, the requested size stored
in IoBuffer.OutputLength may be incorrect.
Therefore, we altered the code to send the
exact length of the version, plus one for the
null character.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-22 13:32:45 -08:00
Johannes Tenschert 641b4bb5f1 staging: bcm: HandleControlPacket.c: breaking of long lines
Signed-off-by: Johannes Tenschert <Johannes.Tenschert@informatik.stud.uni-erlangen.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-12 16:49:26 -08:00
Johannes Tenschert 8b34a1fb1e staging: bcm: HandleControlPacket.c: fix parens/braces
Signed-off-by: Johannes Tenschert <Johannes.Tenschert@informatik.stud.uni-erlangen.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-12 16:49:25 -08:00
Johannes Tenschert 77eb7585db staging: bcm: HandleControlPacket.c: fix comments
Signed-off-by: Johannes Tenschert <Johannes.Tenschert@informatik.stud.uni-erlangen.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-12 16:49:24 -08:00
Johannes Tenschert efa6f862d3 staging: bcm: HandleControlPacket.c: fix indentation
Signed-off-by: Johannes Tenschert <Johannes.Tenschert@informatik.stud.uni-erlangen.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-12 16:49:24 -08:00
Johannes Tenschert dd751d2a2b staging: bcm: HandleControlPacket.c: fix whitespaces
Signed-off-by: Johannes Tenschert <Johannes.Tenschert@informatik.stud.uni-erlangen.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-12 16:49:23 -08:00
Johannes Tenschert 4219001fc9 staging: bcm: led_control.c: breaking of long lines
Signed-off-by: Johannes Tenschert <Johannes.Tenschert@informatik.stud.uni-erlangen.de>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-08 12:43:41 -08:00
Johannes Tenschert d9ce353a5f staging: bcm: led_control.c: fix parens/braces
Signed-off-by: Johannes Tenschert <Johannes.Tenschert@informatik.stud.uni-erlangen.de>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-08 12:43:40 -08:00
Johannes Tenschert f5d8c26a14 staging: bcm: led_control.c: fix comments
Signed-off-by: Johannes Tenschert <Johannes.Tenschert@informatik.stud.uni-erlangen.de>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-08 12:43:40 -08:00
Johannes Tenschert 34e98e72f9 staging: bcm: led_control.c: fix indentation
Signed-off-by: Johannes Tenschert <Johannes.Tenschert@informatik.stud.uni-erlangen.de>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-08 12:43:39 -08:00
Johannes Tenschert c1eb22d0f3 staging: bcm: led_control.c: fix whitespaces
Signed-off-by: Johannes Tenschert <Johannes.Tenschert@informatik.stud.uni-erlangen.de>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-08 12:43:39 -08:00
Kevin McKinney d3a21c3c4b Staging: bcm: Alter return value for copy_to/from_user() to "return -EFAULT" when an error occurs.
In this clean up patch, I altered functions: copy_to/
from_user() to return -EFAULT when an error occurs.
I also replaced break statements when an error occurs
from copy_to/from_user() with direct returns of -EFAULT.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-08 12:42:16 -08:00
Kevin McKinney 6561f91d68 Staging: bcm: Alter code to move error handling closer to the calls; and remove white space, IOCTL_BCM_NVM_WRITE.
This is a clean up patch for IOCTL_BCM_NVM_WRITE
that replaces the assignment of the Status
variable with direct returns of the error code,
replaces the break statements with direct returns,
and removes a white space.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-08 12:42:16 -08:00
Kevin McKinney 09468b0392 Staging: bcm: Fix double free of 'pReadData' in IOCTL_BCM_NVM_WRITE.
This patch fixes a memory error in ioctl,
IOCTL_BCM_NVM_WRITE. While copying data to
user space, if an error occurs, pReadData
is freed. Then, at the end of the ioctl,
pReadData was being freed again.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-08 12:42:15 -08:00
Kevin McKinney 19a177e6fb Staging: bcm: Reverse semaphore locking in IOCTL_BCM_BUFFER_DOWNLOAD_STOP.
This patch reorders the semaphore locking.
It makes better sense to first evaluate
fw_download_sema semaphore then
NVMRdmWrmLocl semaphore. The
fw_download_sema is suppose to be
acquired in the START ioctl.  If this is
not true, then it does not make sense
to continue.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-29 10:09:52 +09:00
Kevin McKinney 8fbebb091a Staging: bcm: Alter code to move error handling closer to the calls.
This is a cleanup patch. I've shuffled the code around to
move the error handling closer to the calls. I've removed
some indent levels. I've replaced break statements with
direct returns.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-29 10:09:52 +09:00
Kevin McKinney fef5675ecb Staging: bcm: Clean up patch that calls semaphore down_trylock directly.
This patch evaluates/calls the down_trylock locking
function directly, instead of storing the results
in a variable and evaluating the variable. These
changes were made in:
IOCTL_BCM_BUFFER_DOWNLOAD_STOP and
IOCTL_BCM_BUFFER_DOWNLOAD_START.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-29 10:09:52 +09:00
Kevin McKinney d9f26a6689 Staging: bcm: Fix semaphore locking error when downloading firmware.
This patch releases semaphore locks when
an error occurrs while attempting to
download firmware for the bcm driver.
When downloading firmware for this driver,
a process is expected to call
the following ioctl's in this order:
(1)IOCTL_BCM_BUFFER_DOWNLOAD_START,
(2)IOCTL_BCM_BUFFER_DOWNLOAD, and (3)
IOCTL_BCM_BUFFER_DOWNLOAD_STOP.
Semaphore, “Adapter->fw_download_sema” is
expected to be acquired in the first ioctl,
IOCTL_BCM_BUFFER_DOWNLOAD_START, and it should
block until IOCTL_BCM_BUFFER_DOWNLOAD_STOP
is called.  In this case, if an error
occurred before STOP finished, the semaphore
"Adapter->fw_download_sema" was not being released.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:14:48 -08:00
Kevin McKinney abe33fc093 Staging: bcm: Fix semaphore locking bug in, IOCTL_BCM_BUFFER_DOWNLOAD
In this ioctl, we are testing to see if the lock is held.
If it is not held, that means this ioctl used incorrectly.
Therefore, we do not want to take the lock ourselves here.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:14:48 -08:00
Kevin McKinney 77121d52a4 Staging: bcm: Remove unnecessary "do while" statement in, IOCTL_BCM_BUFFER_DOWNLOAD
This patch removes a superfluous "do while"
statement in IOCTL_BCM_BUFFER_DOWNLOAD.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:14:48 -08:00
Kevin McKinney 51935d2259 Staging: bcm: Clean up code in ioctl: IOCTL_BCM_EEPROM_REGISTER_READ
This patch verifies two conditions before executing
a kmalloc call. First, it checks to see that
IoBuffer.OutputLength is not greater than an
unsigned short. If so, an invalid value may be
returned. The second change is a check to make
sure IoBuffer.OutputLength is not equal to
zero. Which simply keeps this code inline with
the other ioctl, IOCTL_BCM_REGISTER_READ_PRIVATE.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:13:33 -08:00
Kevin McKinney 41c7b7c0fa Staging: bcm: Fix information leak in ioctl: IOCTL_BCM_REGISTER_READ_PRIVATE, IOCTL_BCM_EEPROM_REGISTER_READ
This patch fixes an information leak in ioctl
IOCTL_BCM_REGISTER_READ_PRIVATE and
IOCTL_BCM_EEPROM_REGISTER_READ when determining
the number of bytes to copy to user space.  Function,
usb_control_msg, returns the correct number of
bytes from the hardware.  Instead of using
this value, we were using a value derived from
user space. In this case, this value could be more
than the hardware allocated.  Therefore, this
patch copies the proper number of bytes from
the hardware, and uses this value as the maximum
number of bytes for user space.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:11:58 -08:00
Diego F. Marfil 57bfa9d417 Staging: bcm: hostmibs: Added temporary variable to shorten lines
Signed-off-by: Diego F. Marfil <diegomarfil@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:11:12 -08:00
Diego F. Marfil 94abda9837 Staging: bcm: hostmibs: White spaces and indentation fixes.
Signed-off-by: Diego F. Marfil <diegomarfil@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:11:11 -08:00
Diego F. Marfil ed8e9bb7e0 Staging: bcm: hostmibs: C99 comments replaced
Signed-off-by: Diego F. Marfil <diegomarfil@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:11:11 -08:00
Kevin McKinney a86581829f Staging: bcm: Fix three initialization errors in InterfaceDld.c
This patch fixes three initialization errors.
One is an incorrect initialization of a static
variable. The other two are incorrect
initializations in an if statement. These
errors were found by checkpatch.pl.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-23 10:16:34 +02:00
Kevin McKinney a5e4b81e27 Staging: bcm: Fix coding style issues in InterfaceDld.c
This patch fixes multiple coding style issues in file,
InterfaceDld.c, found by checkpatch.pl.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-23 10:16:34 +02:00
Kevin McKinney 54ced00639 Staging: bcm: Fix coding style issues in InterfaceMisc.c
This patch cleans up several code style issues found
in InterfaceMisc.c reported by checkpatch.pl.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-11 10:18:58 -06:00
Kevin McKinney ca45e70029 Staging: bcm: Remove assignment from if conditions reported by checkpatch.pl
This patch removes an assignment from three if
conditions.  In all three cases, the line of code was
attempting to allocate memory, and check
if the memory was allocated in the if statement.
This issue was reported by checkpatch.pl.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-11 10:18:57 -06:00
Kevin McKinney f969f84ed9 Staging: bcm: Fix coding style issues reported by checkpatch.pl
This patch cleans up several code style issues found
in InterfaceInit.c reported by checkpatch.pl.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-11 10:18:57 -06:00
Kevin McKinney d491061b98 Staging: bcm: Fix assignment issue in if statement reported by checkpatch.pl.
This patch fixes an error where an assignment "="
was being used in an if statement to determine if
Firmware was downloaded. This patch removes that
assignment, and places it above the if statement.
The if statement then evaluates the status to
verify if "0" successful, or != 0 failure.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-11 10:18:21 -06:00
Kevin McKinney 9d4f1d0c9d Staging: bcm: Remove assignment in if condition reported by checkpatch.pl
There is a case where an assignment was being done
in an if condition. This patch removes the assignment
from the if condition and places the assignment above
the if statement; thereby improving the readability of
the code.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-11 10:18:21 -06:00
Kevin McKinney a8a1cdd6d4 Staging: bcm: Replace dated variable __FUNCTION__ reported by checkpatch.pl
This patch replaces the obsolete variable, __FUNCTION__, that
holds the name of the current function with variable, __func__.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-11 10:18:21 -06:00
Kevin McKinney 6a4ef5f9b3 Staging: bcm: Fix coding style issues reported by checkpatch.pl
This patch cleans up several hundred code style issues found
in Misc.c reported by checkpatch.pl.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-11 10:18:20 -06:00
Kevin McKinney 2505aa6ce4 Staging: bcm: Alter LOC for readability/understandability purposes
This patch alters a line of code to make it more readable
and easier to understand. The purpose of the original line
of code was to compute the amount of memory to request from
kmalloc. This mulit-step algorithm was being done in one
line of code, thus making it more difficult to understand.
Therefore, I split this algorithm into three logical steps.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-29 17:34:51 -07:00
Kevin McKinney 0a2cc4977f Staging: bcm: Add min/max restrictions for IOCTL_BCM_REGISTER_READ_PRIVATE
This patch fixes two issues within bcm/Bcmchar.c. The
first condition in the or statement checks if variable
IoBuffer.OutputLength, defined from user space, is
greater than the maximum value allowed for an
unsigned short. IoBuffer.OutputLength is then used
in a kmalloc call to return a pointer to memory. If
this size is greater than an unsigned short, it
becomes useless. The second condition in the or statement
checks if the same variable, IoBuffer.OutputLength is
equal to zero before invoking the kmalloc call. In
this case, if a zero size is sent to kmalloc, a valid
pointer to memory is returned instead of the expected NULL.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-29 17:34:51 -07:00
Marcos Paulo de Souza 43664e14a0 drivers/staging/bcm/InterfaceDld.c: Fix checkpatch warnings
In the source file there are a lot of warnings. I will send it in parts to be more easy to
review. All the changes in this file its just alignment, and things like that.

Signed-off-by: Marcos Paulo de Souza <marcos.mage@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-26 17:43:43 -07:00
Kevin McKinney e228b7426e Staging: bcm: Add size maximum size restrictions for IOCTL_IDLE_REQ
In the first alteration, the MAX_CNTL_PKT_SIZE is the
maximum size of the control packet in ->Adapter->txctlpacket[]
which is defined in InitAdapter(). This caps the size of
kmalloc memory allocation. In the second change, this max
cap fixes a potential memory corruption bug when subsequent
memset and memcpy calls are invoked.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-19 10:46:17 -07:00
Kevin McKinney 5ac5bd8754 Staging: bcm: Add size minimum size restrictions for IOCTL_IDLE_REQ
If IoBuffer.InputLength is zero then this will cause an Oops when
we dereference the ZERO_SIZE_PTR.  Or if it's smaller than
sizeof(struct link_request) then we would get memory corruption
when we set ->PLength in CopyBufferToControlPacket().

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-19 10:46:17 -07:00
Ben Wright 0118885849 Staging: bcm: Macros: Fixed multiple coding style violations.
Fixed multiple indentation issues.

Signed-off-by: Benjamin James Wright <bwright.au@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23 15:21:23 -07:00
Julia Lawall e5969d5574 drivers/staging/bcm/nvm.c: add missing kfree
Buff is only used as a temporary buffer within the function, so it should
be freed before leaving the function in an error case.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@exists@
local idexpression x;
statement S,S1;
expression E;
identifier fl;
expression *ptr != NULL;
@@

x = \(kmalloc\|kzalloc\|kcalloc\)(...);
...
if (x == NULL) S
<... when != x
     when != if (...) { <+...kfree(x)...+> }
     when any
     when != true x == NULL
x->fl
...>
(
if (x == NULL) S1
|
if (...) { ... when != x
               when forall
(
 return \(0\|<+...x...+>\|ptr\);
|
* return ...;
)
}
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23 15:20:53 -07:00
Kevin McKinney 1dc634772b Staging: bcm: Fix memory leak reported during compile.
This patch fixes a potential memory leak were temp_buff buffer
is not being freed when a certain condition is true.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Reviewed-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23 15:20:53 -07:00
Kevin McKinney fbfcdf254d Staging: bcm: Fix a coding style error reported by checkpatch.pl
Tool checkpatch.pl reported the following error: extern struct class *bcm_class;"
declaration not allowed in .c files. Therefore, I move this declaration into
the header "headers.h" file.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Reviewed-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23 15:20:52 -07:00
Kevin McKinney 6c15e002f9 staging: bcm: fix coding style warnings and errors reported by checkpatch.pl tool
Staging: bcm: Fix coding style errors reported by checkpatch.pl

Fix multiple warnings and errors reported by checkpatch.pl

Signed-off-by: Kevin McKinney<klmckinney1@gmail.com>
Reviewed-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23 15:20:52 -07:00
Linus Torvalds 1380516599 Merge branch 'staging-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6
* 'staging-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6: (741 commits)
  staging:iio:meter:ade7753 should be 16 bit read not 8 bit for mode register.
  staging:iio:kfifo_buf fix double initialization of the ring device structure.
  staging:iio:accel:lis3l02dq: fix incorrect pointer passed to spi_set_drvdata.
  staging:iio:imu fix missing register table index for some channels
  spectra: enable device before poking it
  staging: rts_pstor: Fix a miswriting
  staging/lirc_bt829: Return -ENODEV when no hardware is found.
  staging/lirc_parallel: remove pointless prototypes.
  staging/lirc_parallel: fix panic on rmmod
  staging:iio:adc:ad7476: Incorrect pointer into spi_set_drvdata.
  Staging: zram: Fix kunmapping order
  Revert "gma500: Fix dependencies"
  gma500: Add medfield header
  gma500: wire up the mrst i2c bus from chip_info
  gma500: Fix DPU build
  gma500: Clean up the DPU config and make it runtime
  gma500: resync with Medfield progress
  gma500: Use the mrst helpers and power control for mode commit
  gma500@ Fix backlight range error
  gma500: More Moorestown muddle meddling means MM maybe might modeset
  ...

Fix up fairly trivial conflicts all over, mostly due to header file
cleanup conflicts, but some deleted files and some just context changes:
 - Documentation/feature-removal-schedule.txt
 - drivers/staging/bcm/headers.h
 - drivers/staging/brcm80211/brcmfmac/dhd_linux.c
 - drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
 - drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
 - drivers/staging/brcm80211/brcmfmac/wl_iw.c
 - drivers/staging/et131x/et131x_netdev.c
 - drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c
 - drivers/staging/rtl8192e/r8192E.h
 - drivers/staging/usbip/userspace/src/utils.h
2011-07-25 23:26:34 -07:00
Chris Forbes 49184c5d33 drivers: staging: bcm: sort: kill handrolled bubblesort
Replaced the handrolled bubblesort with the kernel's sort() function.
Makes things considerably smaller & clearer.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 20:36:37 -07:00
Jesper Juhl bb69f192ca Remove unneeded version.h include from drivers/staging/bcm/headers.h
It was pointed out by 'make versioncheck' that a include of
linux/version.h is not needed in drivers/staging/bcm/headers.h .
This patch removes it.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 10:39:40 -07:00
Joe Perches ceeb6fec70 staging: Fix recieve/receive typos
Just spelling fixes.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28 14:54:17 -07:00
Greg Dietsche c5274ab097 staging: remove unnecessary code
Compile tested.
remove unnecessary code that matches this coccinelle pattern
	if (...)
		return ret;
	return ret;

Signed-off-by: Greg Dietsche <Gregory.Dietsche@cuw.edu>
Acked-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28 13:13:42 -07:00
Vitaliy Ivanov e44ba033c5 treewide: remove duplicate includes
Many stupid corrections of duplicated includes based on the output of
scripts/checkincludes.pl.

Signed-off-by: Vitaliy Ivanov <vitalivanov@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-06-20 16:08:19 +02:00
Lucas De Marchi 25985edced Fix common misspellings
Fixes generated by 'codespell' and manually reviewed.

Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
2011-03-31 11:26:23 -03:00
Ilia Mirkin 23c3298687 staging: bcm: Remove NULL check before kfree
This patch was generated by the following semantic patch:
// <smpl>
@@ expression E; @@
- if (E != NULL) { kfree(E); }
+ kfree(E);

@@ expression E; @@
- if (E != NULL) { kfree(E); E = NULL; }
+ kfree(E);
+ E = NULL;
// </smpl>

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-14 11:57:30 -07:00
Alexander Beregalov f4a0e6b135 staging: bcm: optimize kmalloc to kzalloc
Use kzalloc rather than kmalloc followed by memset with 0.
Found by coccinelle.

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-09 15:54:31 -08:00
Vinay Sawal 00b6fb2e31 Staging: bcm: Bcmnet: fixed checkpatch script reported issues
Fixed all issues reported by checkpatch script on this file.

Signed-off-by: Vinay Sawal <vinaysawal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-09 15:54:30 -08:00
Justin P. Mattock a0fe6029bc drivers:staging:bcm:CmHost.c Remove one to many n's in a word.
The Patch below removes one to many "n's" in a word..

Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
CC: Greg Kroah-Hartman <gregkh@suse.de>
CC: Stephen Hemminger <shemminger@vyatta.com>
CC: devel@driverdev.osuosl.org
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-28 19:00:29 -08:00
Javier Martinez Canillas 78acd58746 Staging: bcm: Bcmchar: Fix some checkpatch errors
Signed-off-by: Javier Martinez Canillas <martinez.javier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-18 13:21:56 -08:00
Javier Martinez Canillas 7227ba0647 Staging: bcm: Bcmchar: Fix style issues on bcm_char_read()
Signed-off-by: Javier Martinez Canillas <martinez.javier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-18 13:21:56 -08:00
Javier Martinez Canillas a7d3976edc Staging: bcm: Bcmchar: Fix style issues on bcm_char_release()
Signed-off-by: Javier Martinez Canillas <martinez.javier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-18 13:21:55 -08:00
Javier Martinez Canillas 1e1233234e Staging: bcm: Bcmchar: Fix style issues on bcm_char_open()
Signed-off-by: Javier Martinez Canillas <martinez.javier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-18 13:21:55 -08:00
Javier Martinez Canillas 00719fab9f Staging: bcm: Check correct user provided length and fix error code returned
bcm driver copies a buffer length provided by userpace without checking it.

RxCntrlMsgBitMask is of type unsigned long so only makes sense to copy
sizeof(unsigned long) bytes.

Also, copy_from_user() returns the number of bytes that could not be copied.
The driver is returning that value as error code instead of -EFAULT.

This patch solves both issues.

Signed-off-by: Javier Martinez Canillas <martinez.javier@gmail.com>
Cc: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-04 13:01:02 -08:00
Andres Salomon e6f597a142 staging: fix build failure in bcm driver
While building latest Linus git, I hit the following:

    CC [M]  drivers/staging/bcm/Qos.o
  drivers/staging/bcm/Qos.c: In function ‘PruneQueue’:
  drivers/staging/bcm/Qos.c:367: error: ‘struct netdev_queue’ has no member named ‘tx_dropped’
  drivers/staging/bcm/Qos.c: In function ‘flush_all_queues’:
  drivers/staging/bcm/Qos.c:416: error: ‘struct netdev_queue’ has no member named ‘tx_dropped’
  make[5]: *** [drivers/staging/bcm/Qos.o] Error 1
  make[4]: *** [drivers/staging/bcm] Error 2
  make[3]: *** [drivers/staging] Error 2

As well as:

    CC [M]  drivers/staging/bcm/Transmit.o
  drivers/staging/bcm/Transmit.c: In function ‘SetupNextSend’:
  drivers/staging/bcm/Transmit.c:163: error: ‘struct netdev_queue’ has no member named ‘tx_bytes’
  drivers/staging/bcm/Transmit.c:164: error: ‘struct netdev_queue’ has no member named ‘tx_packets’
  make[2]: *** [drivers/staging/bcm/Transmit.o] Error 1

tx_dropped/tx_bytes_tx_packets were removed in commit 1ac9ad13.  This patch
converts bcm to use net_device_stats instead of netdev_queue.

Acked-by: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Andres Salomon <dilinger@queued.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-01-17 17:39:39 -08:00
Linus Torvalds 949f6711b8 Merge branch 'staging-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6
* 'staging-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6: (510 commits)
  staging: speakup: fix failure handling
  staging: usbip: remove double giveback of URB
  Staging: batman-adv: Remove batman-adv from staging
  Staging: hv: Use only one txf buffer per channel and kmalloc/GFP_KERNEL on initialize
  staging: hv: remove unneeded osd_schedule_callback
  staging: hv: convert channel_mgmt.c to not call osd_schedule_callback
  staging: hv: convert vmbus_on_msg_dpc to not call osd_schedule_callback
  staging: brcm80211: Fix WL_<type> logging macros
  Staging: IIO: DDS: AD9833 / AD9834 driver
  Staging: IIO: dds.h convenience macros
  Staging: IIO: Direct digital synthesis abi documentation
  staging: brcm80211: Convert ETHER_TYPE_802_1X to ETH_P_PAE
  staging: brcm80211: Remove unused ETHER_TYPE_<foo> #defines
  staging: brcm80211: Remove ETHER_HDR_LEN, use ETH_HLEN
  staging: brcm80211: Convert ETHER_ADDR_LEN to ETH_ALEN
  staging: brcm80211: Convert ETHER_IS<FOO> to is_<foo>_ether_addr
  staging: brcm80211: Remove unused ether_<foo> #defines and struct
  staging: brcm80211: Convert ETHER_IS_MULTI to is_multicast_ether_addr
  staging: brcm80211: Remove unused #defines ETHER_<foo>_LOCALADDR
  Staging: comedi: Fix checkpatch.pl issues in file s526.c
  ...

Fix up trivial conflict in drivers/video/udlfb.c
2011-01-10 16:04:53 -08:00
Greg Kroah-Hartman 36facadd9e Merge branch 'usb-next' into musb-merge
* usb-next: (132 commits)
  USB: uas: Use GFP_NOIO instead of GFP_KERNEL in I/O submission path
  USB: uas: Ensure we only bind to a UAS interface
  USB: uas: Rename sense pipe and sense urb to status pipe and status urb
  USB: uas: Use kzalloc instead of kmalloc
  USB: uas: Fix up the Sense IU
  usb: musb: core: kill unneeded #include's
  DA8xx: assign name to MUSB IRQ resource
  usb: gadget: g_ncm added
  usb: gadget: f_ncm.c added
  usb: gadget: u_ether: prepare for NCM
  usb: pch_udc: Fix setup transfers with data out
  usb: pch_udc: Fix compile error, warnings and checkpatch warnings
  usb: add ab8500 usb transceiver driver
  USB: gadget: Implement runtime PM for MSM bus glue driver
  USB: gadget: Implement runtime PM for ci13xxx gadget
  USB: gadget: Add USB controller driver for MSM SoC
  USB: gadget: Introduce ci13xxx_udc_driver struct
  USB: gadget: Initialize ci13xxx gadget device's coherent DMA mask
  USB: gadget: Fix "scheduling while atomic" bugs in ci13xxx_udc
  USB: gadget: Separate out PCI bus code from ci13xxx_udc
  ...
2010-12-16 10:05:06 -08:00
Dan Carpenter 37db526463 Staging: Beceem: more checkpatch.pl changes to InterfaceInit.c
The only checkpatch.pl issues remaining still remaining are line length
complaints.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-06 16:09:45 -08:00
Dan Carpenter 07a7f68800 Staging: Beceem: improve debug printk statements
These are just small changes.  Some grammar and wording changes.  I added
new lines to the end of all the print statements.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-06 16:09:45 -08:00
Dan Carpenter 6b74705e15 Staging: Beceem: use after free in bcm_exit()
We can't call class_destroy() until after the driver has been deregistered.
It leads to a NULL deref on module unload.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-06 16:09:45 -08:00
Dan Carpenter cd0b0ebfbe Staging: Beceem: remove old kernel compatibility code
This drops compatability for everything from 2.4 to 2.6.35.  Now it only
works on the latest kernel.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-06 16:09:45 -08:00
Dan Carpenter c2a0b162db Staging: Beceem: white space changes to InterfaceInit.c
This patch only changes:
1) spaces, tabs, and newline characters.
2) comment styles.

The compiled object file is the same before and after except for line
number changes.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-06 16:09:44 -08:00
Dan Carpenter 2a314742d3 Staging: Beceem: use lower case "int" instead of "INT"
This patch changes:
	INT => int
	ULONG => unsigned long
	VOID => void

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-06 16:09:44 -08:00
Dan Carpenter 85c0b1760a Staging: Beceem: add USB id for BCSM250 Mobile WiMAX
Signed-off-by: Dan Carpenter <error27@gmail.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-06 16:09:43 -08:00
Alan Stern 2f15744c1d USB: fix leftover references to udev->autosuspend_delay
This patch (as1436) takes care of leftover references to
udev->autosuspend_delay that didn't get removed during the earlier
conversion to the runtime-PM autosuspend API.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-17 13:24:47 -08:00
Dan Carpenter 2e31613901 Staging: bcm: signedness bug in InitCardAndDownloadFirmware()
status is used to store negative error codes throughout.  The only place
where this is a runtime bug is if create_worker_threads() fails.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-16 12:31:50 -08:00
Dan Carpenter f05321cca5 Staging: bcm: signedness bug in StoreSFParam()
wrm() returns negative error codes so "ret" needs to be signed here.
There was place where wrm() returned positive EACCES instead of
negative -EACCES so I fixed that as well.  Also a few checkpatch.pl
issues.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-16 12:31:50 -08:00
Joe Perches 859171ca92 drivers/staging: Remove unnecessary semicolons
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-16 12:06:47 -08:00
Greg Kroah-Hartman 491acf0032 Staging: Merge 2.6.37-rc2 into staging-next
This was necessary in order  to resolve some conflicts that happened
between -rc1 and -rc2 with the following files:
	drivers/staging/bcm/Bcmchar.c
	drivers/staging/intel_sst/intel_sst_app_interface.c

All should be resolved now.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-16 10:44:50 -08:00
Jesper Juhl 3701befc44 Staging, bcm: Remove unnecessary casts of void ptr returning alloc function return values
Here's a patch against a copy of linux-next that I just cloned.

Don't pointlessly cast pointers returned by allocation functions that
return void pointers which are implicitly converted.
For drivers/staging/bcm/

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-10 16:28:31 -08:00
Alejandro R. Sedeño 16618c20e1 Staging: beceem: Move ZTE TU25's USB id to the beceem module
Signed-off-by: Alejandro R. Sedeño <asedeno@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-10 16:28:30 -08:00
Alejandro R. Sedeño b706113f14 Staging: beceem: Use 32-bit integers for hardware register values
Switching to UINT because that's what the rest of this codebase uses.

Signed-off-by: Alejandro R. Sedeño <asedeno@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-10 16:28:30 -08:00
Dan Carpenter eccbf04a90 Staging: bcm: use get_user() to access user pointers
This fixes some places that dereference user pointers directly instead
of using get_user().

Please especially check my changes to IOCTL_BCM_GET_CURRENT_STATUS.  The
original code modified the struct which "arg" was pointing to.  I think
this was a bug in the original code and that we only wanted to write to
the OutputBuffer. Also with the original code you could read as much
memory as you wanted so I had to put a cap on OutputLength.  The only
value of OutputLength that makes sense is sizeof(LINK_STATE) so now if
OutputLength is not sizeof(LINK_STATE) it returns -EINVAL.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-09 13:32:36 -08:00
Stephen Hemminger 2932af344a beceem: update TODO list
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 14:18:16 -04:00
Stephen Hemminger 349fa79498 beceem: dump control packet information
Add control packet information is useful for debugging.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 14:10:41 -04:00
Stephen Hemminger 4ea4f7a0d3 beceem: change startup messages
Change the regsister/unregister routines to generate better
messages, and control arrival of new frames when USB device is
unplugged.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 14:06:24 -04:00
Stephen Hemminger 9c5d77009d beceem: don't overrun user buffer on read
Serious bug in original code, if app reads 10 bytes but 20 byte msg
received memory would get overwritten.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 13:59:01 -04:00
Stephen Hemminger 5cf084f44a beceem: eliminate unused bcm_jiffies
Unused, unneeded, and bogus.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 13:57:35 -04:00
Stephen Hemminger 78afa9990f beceem: fix definition of VLAN header type
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 13:54:21 -04:00
Stephen Hemminger cacd92222d beceem: statistics and transmit queue changes
Use standard network statistics variables and routines.
Transmit counters are per queue, and skb mapping is already in
skb and does not need to be recomputed. Move SearchVcId to only
place it is used.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 13:53:30 -04:00
Stephen Hemminger b5ebd85b2b beceem: do classification even if device is offline
Since classification and queue control are separate, allow
classification even if device is down now; this avoids races
on startup/shutdown.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 12:37:52 -04:00
Stephen Hemminger 429a5908fe beceem: off by one on queue index
The driver allocates 18 queues (0..16) are for traffic, and 17
is a bit bucket.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 12:37:48 -04:00
Stephen Hemminger 9dd47ee7dd beceem: make local functions static
Use namespace tool from kernel scripts to identify dead code and
functions that should be static.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 12:37:05 -04:00
Stephen Hemminger 4540055492 beceem: remove unused code to dump header
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 12:26:08 -04:00
Stephen Hemminger ac1b1ae7f8 beceem: transmit code cleanup
Eliminate global variable in transmit path
The Leader can be on the stack, and get rid of unnecessary timeval.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 12:20:09 -04:00
Stephen Hemminger 1da9badcf0 beceem: allow multicast/broadcast
Even though wimax isn't really a broadcast medium, pretend it is.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 12:19:02 -04:00
Stephen Hemminger 9ec4475bf1 beceem: debug message format changes
Add more debug messages and make them similar to other drivers

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 12:18:36 -04:00
Stephen Hemminger e4d46254da beceem: use get_seconds for elapsed time
get_seconds is lower overhead and fine if all driver wants to do
is keep track of seconds.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 12:14:26 -04:00
Stephen Hemminger 2d08748ae5 beceem: module initialization
Get rid of boot messages and put in correct place.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 12:14:01 -04:00
Stephen Hemminger 4fd64dd0c1 beceem: add network device message level control
Provide standard interface to control verbosity of debug messages

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 12:12:31 -04:00
Stephen Hemminger e39e3be66e beceem: change format of debug message
Statistic point is now u32 (like it has to be).

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 12:06:44 -04:00
Stephen Hemminger 3349d95b3f beceem: clean up adapter structure
Remove dead fields, change fields that only have true/false to boolean;
and rearrange to save space.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 12:06:39 -04:00
Stephen Hemminger 9e0a3169a3 beceem: create class on module installation
First step to supporting multiple devices, create device class
when module is initialized.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 10:24:16 -04:00
Stephen Hemminger 46c3790eb5 beceem: convert to kernel coding style
Change indentation etc, to conform to acceptable kernel style

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 10:16:29 -04:00
Stephen Hemminger 5afb5145a1 beceem: remove useless debug function entry messages
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 10:07:20 -04:00
Stephen Hemminger 957ea3b570 beceem: remove problematic debug print messages
Not worth bothering to change printf format of messages which
are basically noise.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 10:05:34 -04:00
Stephen Hemminger 032100f652 beceem: remove unnecessary usb class
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 10:03:29 -04:00
Stephen Hemminger ada692b09f beceem: fix character device ioctl
Sparse caught several places where ioctl interface was incorrectly using user
memory. Fix all the ioctl cases for casting and __user annotation.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 09:55:08 -04:00
Stephen Hemminger c5ebe2278b beceem: fix printf format strings
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 09:54:53 -04:00
Stephen Hemminger 0980f2e814 beceem: reserve one queue for bit-bucket
This preserves the semantics of the original driver (unclassified packets
are dropped), but does it in a clean way; and fixes crash when packet
is sent to offline device.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 09:54:47 -04:00
Stephen Hemminger 3644c1a2f1 beceem: remove dead code
Remove commented out with '#if 0'

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 09:54:43 -04:00
Stephen Hemminger 9371105816 beceem: support multiple queues
Current kernels have multi-queue support which can be used by
this device. This has the advantage that a single type of traffic
will not block other types.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 09:54:39 -04:00
Stephen Hemminger 20f48653fc beceem: get rid of unnecessary inline usage
Many routines were tagged with inline_ but GCC does a better
job of deciding this.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 09:54:35 -04:00
Stephen Hemminger 26a0e39ac8 beceem: fold unregister_netdevice into AdapterFree
The function unregister_netdevice only called unregister_netdev.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 09:54:31 -04:00
Stephen Hemminger 7441698fe9 beceem: remove ARP spoofing
Linux support NOARP flag, so the whole Arp spoofing routines
are not needed.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 09:53:58 -04:00
Stephen Hemminger 6ba8fe77dd beceem: print better message on bad ioctl
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 09:52:42 -04:00
Stephen Hemminger e614e28eac beceem: remove indirection to Adapter structure
Allocate Adapter structure as part of network device.

Signed-off-by: Stephen Hemminber <shemminger@vyatta.com>
2010-11-01 09:52:14 -04:00
Stephen Hemminger 2515ab628f beceem: Add proper carrier and link management
Start with carrier off.
Don't track up/down status in driver private flag.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 09:50:29 -04:00
Stephen Hemminger d7affd0f58 beceem: reduce transmit queue len
Reduce transmit queue length to avoid excess buffering

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 09:50:23 -04:00
Stephen Hemminger 9c6e9aa830 beceem: remove dead code
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 09:50:16 -04:00
Stephen Hemminger d21d6dde02 beceem: add ethtool support
This adds basic ethtool support to get driver info and settings

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 09:50:06 -04:00
Stephen Hemminger 71e253b169 beceem: make transmit thread interruptible
Kernel complains loudly if thread does long uninterruptible sleep.
Also, dont wake up every 10ms even if no data present (wastes power).

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 09:49:30 -04:00
Stephen Hemminger de85f98589 beceem: name threads with device name
This is the convention used by Intel Wimax

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 09:42:56 -04:00
Stephen Hemminger 082e889b47 beceem: remove OS wrapper library
Use native kernel functions for kmalloc/kfree directly

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 09:35:21 -04:00
Stephen Hemminger c5113e3c11 beceem: use kernel print_hex_dump function
No longer need special hex dump routine

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 09:30:59 -04:00
Stephen Hemminger 0ad008fcbc beceem: cleanup network device setup
Change how network device is setup:
* set pointer to device object so sysfs has eth0/device symlink
* set network device type
* eliminate all the compatiablity with older kernels.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-10-29 20:45:12 -07:00
Stephen Hemminger 92bc60580e beceem: get rid of OS dependent data structure
The only part of this structure still used was the network
device stats, and in recent kernel these are available in
network device itself.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-10-29 20:45:01 -07:00
Stephen Hemminger 2b5e625882 beceem: eliminate dead code
Get rid of empty header file and unused declarations

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-10-29 20:44:57 -07:00
Stephen Hemminger d52db0b4b3 beceem: eliminate network registered state variable
Just use presence of pointer

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-10-29 20:44:52 -07:00
Stephen Hemminger 3705a843bd beceem: remove bogus network device notifier
Network device should not be messing with refcounts directly.
See Documentation/networking/netdevices.txt

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-10-29 20:44:47 -07:00
Stephen Hemminger 2564a148d5 beceem: cleanup debug level infrastructure
Add module parameter to control debug level and do code cleanup
The whole debug stuff should eventually be removed.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-10-29 20:44:41 -07:00
Stephen Hemminger 047a5f2b50 beceem: eliminate unused USB stubs
USB layer does not require these reset function stubs

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-10-29 20:43:37 -07:00
Stephen Hemminger 5abe61ade9 beceem: remove version ifdef's
Remove code to support older kernel API's

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-10-29 20:43:32 -07:00
Stephen Hemminger 91d29ee1a8 beceem: remove ifdef's
There were a lot of ifdef's for driver options which have no
configuration options.  Choose the current value and remove the
ifdef.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-10-29 20:43:28 -07:00
Stephen Hemminger 2e44f765df beceem: add module information
Add description and version information to the driver.
Make USB device table exported as alias so device will be
autoloaded. Get rid of useless noise message on boot.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-10-29 20:43:23 -07:00
Greg Kroah-Hartman eebfc6055a Staging: bcm: fix up network device reference counting
The way network devices are reference counted does not include poking
around in the reference count itself.  This breaks when the reference
count is changed to be a different type.  Fix the driver to do the
proper function calls instead.

Cc: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-28 09:54:23 -07:00
Dan Carpenter 370adc7cb0 Staging: bcm: silence off by one warning
"status" is used as an index into the Adapter->PackInfo[] array, which
has NO_OF_QUEUES elements.

This code actually works OK.  The SearchSfid() function always returns
a valid index or it returns NO_OF_QUEUES + 1.  But it looks sloppy and
it makes the static checkers complain.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-08 07:29:57 -07:00
Dan Carpenter 02339374cf Staging: bcm: remove unneeded NULL check
The error handling here is wrong.  If psIntfAdapter were NULL then we
would have a NULL dereference in the debug output on the error path.
But this function is only called from usbbcm_device_probe() when
psIntfAdapter is non-NULL.

Since the check isn't needed and I removed it instead of fixing it.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-08 07:29:56 -07:00
Dan Carpenter ef5d205645 Staging: bcm: return -EFAULT on copy_to_user() errors
bcm/InterfaceDld.c had a couple places which returned the number of
bytes remaining instead of -EFAULT.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-08 07:29:56 -07:00
Dan Carpenter acedadfae5 Staging: bcm: dereferencing before checking
I moved the check to see if "Adapter" was null in front of the
dereference.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-08 07:29:55 -07:00
Dan Carpenter 055a1eda5f Staging: bcm: mocro expansion bug
The WIMAX_MAX_MTU macro is used in drivers/staging/bcm/CmHost.c like
this:

    if (Adapter->PackInfo[uiSearchRuleIndex].uiMaxBucketSize < WIMAX_MAX_MTU * 8)

The multiplication by eight has precedence over the addition so the
macro needs parenthesis to work.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-08 07:29:55 -07:00
Dan Carpenter 785698e38d Staging: bcm: make major and minor signed
We assume that major is signed in register_control_device_interface().

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-08 07:29:54 -07:00
Dan Carpenter bf58bd66f6 Staging: bcm: return -EFAULT on copy_to_user() failures
There were a number of places in the bcm_char_ioctl() which returned the
number of bytes remaining to be copied instead of returning -EFAULT.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-08 07:29:54 -07:00
Tracey Dent 9a837af5fb Staging: bcm: Makefile: replace the use of <module>-objs with <module>-y
Changed <module>-objs to <module>-y in Makefile.

Signed-off-by: Tracey Dent <tdent48227@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-08 07:23:52 -07:00
Arnd Bergmann 44a17eff84 staging/bcm: add sparse annotations
This marks up the code where sparse complains in most cases.
Most of the changes are in the ioctl handling code, which
gets __user annotations, finding one unchecked user access.

The rest is mostly about marking functions static when they
are only used in one file.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-05 08:50:15 -07:00
Arnd Bergmann 9f1c75ac2d staging/bcm: fix most build warnings
This removes all warnings I get on a 64 bit build except
for those that look unfixable, where we convert a pointer
to a 32 bit integer and change its byte order!

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-05 08:50:15 -07:00
Arnd Bergmann d16044cf8c staging: make new character devices nonseekable
As a preparation for changing the default behaviour of llseek to no_llseek,
every file_operations structure should have a .llseek operation.

There are three new instances in staging now, which can all be changed
into no_llseek explicitly since the devices do not need to seek.

Add nonseekable_open where appropriate, to prevent pread/pwrite as well.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-05 08:50:14 -07:00
Joe Perches 03a6cddbb8 staging: Use static const char * const where possible
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-16 13:02:37 -07:00
Randy Dunlap 5fe1f1edb9 staging/bcm: fix build for CONFIG_PM not enabled
Handle build case of CONFIG_PM not being enabled.

drivers/staging/bcm/InterfaceInit.c:280: error: 'struct usb_device' has no member named 'autosuspend_delay'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-16 12:29:32 -07:00
Randy Dunlap 3e8acee461 staging/bcm: fix printk format warnings
Fix lots of printk format warnings in bcm.  Here is a sample of them:

drivers/staging/bcm/CmHost.c:1955: warning: format '%x' expects type 'unsigned int', but argument 3 has type 'long unsigned int'
drivers/staging/bcm/CmHost.c:1955: warning: format '%x' expects type 'unsigned int', but argument 2 has type 'long unsigned int'
drivers/staging/bcm/CmHost.c:1955: warning: format '%x' expects type 'unsigned int', but argument 3 has type 'long unsigned int'
drivers/staging/bcm/LeakyBucket.c:85: warning: format '%d' expects type 'int', but argument 4 has type 'long int'
drivers/staging/bcm/LeakyBucket.c:85: warning: format '%d' expects type 'int', but argument 3 has type 'long int'
drivers/staging/bcm/LeakyBucket.c:85: warning: format '%d' expects type 'int', but argument 4 has type 'long int'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-16 12:29:32 -07:00
Stephen Hemminger f8942e07a3 staging: Beeceem USB Wimax driver
The Sprint 4G network uses a Wimax dongle with Beecem
chipset. The driver is typical of out of tree drivers, but
maybe useful for people, and the hardware is readily available.

Here is a staging ready version (i.e warts and all)

0. Started with Rel_5.2.7.3P1_USB from Sprint4GDeveloperPack-1.1
1. Consolidated files in staging
2. Remove Dos cr/lf
3. Remove unnecessary ioctl from usbbcm_fops

Applied patches that were in the developer pack, surprising
there were ones for 2.6.35 already.

This is compile tested only, see TODO for what still needs
to be done.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-08 21:15:06 -07:00