Jerome Marchand [Fri, 10 Jun 2011 13:28:49 +0000 (15:28 +0200)]
Staging: zram: Replace mutex lock by a R/W semaphore
Currently, nothing protects zram table from concurrent access.
For instance, ZRAM_UNCOMPRESSED bit can be cleared by zram_free_page()
called from a concurrent write between the time ZRAM_UNCOMPRESSED has
been set and the time it is tested to unmap KM_USER0 in
zram_bvec_write(). This ultimately leads to kernel panic.
Also, a read request can occurs when the page has been freed by a
running write request and before it has been updated, leading to
zero filled block being incorrectly read and "Read before write"
error message.
This patch replace the current mutex by a rw_semaphore. It extends
the protection to zram table (currently, only compression buffers are
protected) and read requests (currently, only write requests are
protected).
Jerome Marchand [Fri, 10 Jun 2011 13:28:48 +0000 (15:28 +0200)]
Staging: zram: allow partial page operations
Commit 7b19b8d45b216ff3186f066b31937bdbde066f08 (zram: Prevent overflow
in logical block size) introduced ZRAM_LOGICAL_BLOCK_SIZE constant to
prevent overflow of logical block size on 64k page kernel.
However, the current implementation of zram only allow operation on block
of the same size as a page. That makes theorically legit 4k requests fail
on 64k page kernel.
This patch makes zram allow operation on partial pages. Basically, it
means we still do operations on full pages internally, but only copy the
relevent segments from/to the user memory.
This patch refactor the code of zram_read/write() functions. It does
not removes a lot of duplicate code alone, but is mostly a helper for
the third patch of this series (Staging: zram: allow partial page
operations).
The message has been deleted, the driver requires no special action on this
particular event (). See: https://bugzilla.kernel.org/show_bug.cgi?id=38162
Reported-by: David Hill <hilld@binarystorm.net> Signed-off-by: Roland Vossen <rvossen@broadcom.com> Reviewed-by: Arend van Spriel <arend@broadcom.com> Reviewed-by: Franky Lin <frankyl@broadcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Arend van Spriel [Wed, 29 Jun 2011 23:47:50 +0000 (16:47 -0700)]
staging: brcm80211: rename structure definitions in dhd.h
Structure definitions in dhd.h have been prefixed with brcmf_ for
consistent naming in fullmac driver and typedef of these structures
has been removed.
Signed-off-by: Arend van Spriel <arend@broadcom.com> Reviewed-by: Roland Vossen <rvossen@broadcom.com> Reviewed-by: Franky Lin <frankyl@broadcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Arend van Spriel [Wed, 29 Jun 2011 23:47:48 +0000 (16:47 -0700)]
staging: brcm80211: rename function variables
The fullmac driver uses dhd as variable name for the driver instance
in a number of functions. This has been changed to a more generic name
as the dhd is not meaningful (broadcom internal name).
Signed-off-by: Arend van Spriel <arend@broadcom.com> Reviewed-by: Roland Vossen <rvossen@broadcom.com> Reviewed-by: Franky Lin <frankyl@broadcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Franky Lin [Wed, 29 Jun 2011 23:47:47 +0000 (16:47 -0700)]
staging: brcm80211: clean up firmware download code in fullmac
In brcmfmac the firmware download related code scatter all around.
And some old dead code which is not following the standard firmware
routine is still present. This patch limits the firmware download
related code only in dhd_sdio.c and removes the rest.
Signed-off-by: Franky Lin <frankyl@broadcom.com> Reviewed-by: Roland Vossen <rvossen@broadcom.com> Reviewed-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Franky Lin [Wed, 29 Jun 2011 23:47:41 +0000 (16:47 -0700)]
staging: brcm80211: move sdio related suspend/resume code to bus interface layer
In fullmac some SDIO configurations should be done in suspend/resume
routine. It was placed under pm ops in wl_cfg80211.c which is
inappropriate. This patchs move them to sdio layer.
Signed-off-by: Arend van Spriel <arend@broadcom.com> Reviewed-by: Roland Vossen <rvossen@broadcom.com> Reviewed-by: Franky Lin <frankyl@broadcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Arend van Spriel [Wed, 29 Jun 2011 23:47:37 +0000 (16:47 -0700)]
staging: brcm80211: remove custom gpio support code
The custom gpio code is intended for hardware platform for specific
customers and require supporting functionality not included in the
fullmac driver. The fullmac driver does not need this so it has been
removed.
Signed-off-by: Arend van Spriel <arend@broadcom.com> Reviewed-by: Roland Vossen <rvossen@broadcom.com> Reviewed-by: Franky Lin <frankyl@broadcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Arend van Spriel [Wed, 29 Jun 2011 23:47:35 +0000 (16:47 -0700)]
staging: brcm80211: replace DHD_DEBUG macro with BCMDBG
The common Makefile for both brcm80211 drivers defines the macro
BCMDBG upon select Kconfig item BRCMDBG. The fullmac source add
another macro DHD_DEBUG with the same meaning. This is removed
and all conditional code now checks for BCMDBG definition.
Signed-off-by: Arend van Spriel <arend@broadcom.com> Reviewed-by: Roland Vossen <rvossen@broadcom.com> Reviewed-by: Franky Lin <frankyl@broadcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
The fullmac driver is always needing the code conditionalized with
MMC_SDIO_ABORT macro so the macro has been removed and the code
is always compiled in.
Signed-off-by: Arend van Spriel <arend@broadcom.com> Reviewed-by: Roland Vossen <rvossen@broadcom.com> Reviewed-by: Franky Lin <frankyl@broadcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Roland Vossen [Wed, 29 Jun 2011 23:47:12 +0000 (16:47 -0700)]
staging: brcm80211: removed BDC defines
Code cleanup. BDC (Broadcom Device Class) protocol extension is used on top
of the USB related CDC (Communication Device Class) definition. BDC is always
used, so the #ifdefs were redundant.
Signed-off-by: Roland Vossen <rvossen@broadcom.com> Reviewed-by: Arend van Spriel <arend@broadcom.com> Reviewed-by: Franky Lin <frankyl@broadcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Arend van Spriel [Wed, 29 Jun 2011 23:47:10 +0000 (16:47 -0700)]
staging: brcm80211: rename fullmac functions
The function provided by dhd_linux.c have been renamed to make
the naming throughout the driver more consistent and remove
Broadcom specific acronyms which are not meaningful.
Signed-off-by: Arend van Spriel <arend@broadcom.com> Reviewed-by: Roland Vossen <rvossen@broadcom.com> Reviewed-by: Franky Lin <frankyl@broadcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Arend van Spriel [Wed, 29 Jun 2011 23:47:09 +0000 (16:47 -0700)]
staging: brcm80211: remove unnecessary abstraction for scheduler
The source dhd_linux_sched.c provided function setScheduler, but it
simply calls sched_setscheduler() linux function. The setScheduler()
function has been removed.
Signed-off-by: Arend van Spriel <arend@broadcom.com> Reviewed-by: Roland Vossen <rvossen@broadcom.com> Reviewed-by: Franky Lin <frankyl@broadcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Arend van Spriel [Wed, 29 Jun 2011 23:47:06 +0000 (16:47 -0700)]
staging: brcm80211: replace macro BCM_MSG_IFNAME_MAX with IFNAMSIZ
In dhd.h the macro BCM_MSG_IFNAME_MAX was defined and used. As this
is used to carry the interface name we might as well use IFNAMSIZ
which results in the same size.
Signed-off-by: Arend van Spriel <arend@broadcom.com> Reviewed-by: Roland Vossen <rvossen@broadcom.com> Reviewed-by: Franky Lin <frankyl@broadcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Arend van Spriel [Wed, 29 Jun 2011 23:47:03 +0000 (16:47 -0700)]
staging: brcm80211: rename functions and variables in dhd_common.c
The naming convention of the drivers is to be made consistent. This
commit fixes the function in dhd_common.c and use the new names from
the calling code.
Signed-off-by: Arend van Spriel <arend@broadcom.com> Reviewed-by: Roland Vossen <rvossen@broadcom.com> Reviewed-by: Franky Lin <frankyl@broadcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Arend van Spriel [Wed, 29 Jun 2011 23:47:02 +0000 (16:47 -0700)]
staging: brcm80211: remove extern function prototypes from c files
It is not recommended to specify function prototypes in c sources
using the extern keyword. Several occurrences have been removed or
placed in a header file or simply removed as it was already present
in a header file.
Signed-off-by: Arend van Spriel <arend@broadcom.com> Reviewed-by: Roland Vossen <rvossen@broadcom.com> Reviewed-by: Franky Lin <frankyl@broadcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Roland Vossen [Wed, 29 Jun 2011 23:46:59 +0000 (16:46 -0700)]
staging: brcm80211: replaced prefix of SDIO related functions
Code cleanup. Prefixed functions with brcmf_ for unique namespace. In addition
to that, prefix has been changed to categorize functions depending on their
place in the drivers SDIO stack.
Signed-off-by: Roland Vossen <rvossen@broadcom.com> Reviewed-by: Arend van Spriel <arend@broadcom.com> Reviewed-by: Franky Lin <frankyl@broadcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Arend van Spriel [Wed, 29 Jun 2011 23:46:58 +0000 (16:46 -0700)]
staging: brcm80211: remove wireless extensions support from brcmfmac
The brcmfmac driver contained functions for wireless extensions
support. However, brcmfmac is intended to be a cfg80211 driver
so all the entire source file is obsolete.
Signed-off-by: Arend van Spriel <arend@broadcom.com> Reviewed-by: Roland Vossen <rvossen@broadcom.com> Reviewed-by: Franky Lin <frankyl@broadcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
The calls in dhd_sdio.c to bcmsdh_recv_buf() function passed a wrong
handle. The parameter in the function prototype was typed as void
pointer so compiler could not detect. This patch makes the type
explicit and fixes the calls to the function.
Signed-off-by: Arend van Spriel <arend@broadcom.com> Reviewed-by: Roland Vossen <rvossen@broadcom.com> Reviewed-by: Franky Lin <frankyl@broadcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Henry Ptasinski [Wed, 29 Jun 2011 23:46:52 +0000 (16:46 -0700)]
staging: brcm80211: cleanup whitespace errors
Cleanup remaining whitespace errors:
- space before tabs
- spaces at the start of a line
- space between function name and open parenthesis '('
- unnecessary whitespace before a quoted newline
Signed-off-by: Henry Ptasinski <henryp@broadcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Roland Vossen [Wed, 29 Jun 2011 23:46:48 +0000 (16:46 -0700)]
staging: brcm80211: Changed comments
Code cleanup. BCM4321 is not supported by this driver. Removed 'XXX' in
comments since they do not signal a critical issue to be patched. Removed
FIXME in comment since it signalled a problem in the Minstrel algorithm,
not in our driver.
Signed-off-by: Roland Vossen <rvossen@broadcom.com> Reviewed-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Arend van Spriel [Wed, 29 Jun 2011 23:46:44 +0000 (16:46 -0700)]
staging: brcm80211: move assert function to dhd_linux.c
The source file wl_iw.c is primarily intended to provide wireless
extensions functionality, which is to be removed from the driver.
The assert function is moved to another source file.
Signed-off-by: Arend van Spriel <arend@broadcom.com> Reviewed-by: Roland Vossen <rvossen@broadcom.com> Reviewed-by: Franky Lin <frankyl@broadcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>