Merge branch 'staging-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh...
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 26 Jul 2011 06:26:34 +0000 (23:26 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 26 Jul 2011 06:26:34 +0000 (23:26 -0700)
* '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

23 files changed:
1  2 
Documentation/feature-removal-schedule.txt
MAINTAINERS
drivers/staging/ath6kl/os/linux/include/ar6000_drv.h
drivers/staging/bcm/headers.h
drivers/staging/brcm80211/brcmfmac/dhd_linux.c
drivers/staging/brcm80211/brcmsmac/mac80211_if.c
drivers/staging/brcm80211/brcmsmac/mac80211_if.h
drivers/staging/gma500/psb_intel_display.c
drivers/staging/hv/hv_mouse.c
drivers/staging/lirc/lirc_zilog.c
drivers/staging/rtl8187se/ieee80211/ieee80211.h
drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c
drivers/staging/rtl8192e/ieee80211/ieee80211.h
drivers/staging/rtl8192e/ieee80211/ieee80211_module.c
drivers/staging/rtl8192e/r8192E.h
drivers/staging/rtl8192e/r8192E_core.c
drivers/staging/rtl8192u/ieee80211/ieee80211.h
drivers/staging/rtl8192u/ieee80211/ieee80211_module.c
drivers/staging/rtl8192u/r8192U_core.c
drivers/staging/rtl8712/osdep_service.h
drivers/staging/sep/sep_driver.c
drivers/staging/wlags49_h2/wl_internal.h
drivers/usb/storage/Kconfig

@@@ -184,7 -184,7 +184,7 @@@ Why:       /proc/<pid>/oom_adj allows userspa
  
        A much more powerful interface, /proc/<pid>/oom_score_adj, was
        introduced with the oom killer rewrite that allows users to increase or
 -      decrease the badness() score linearly.  This interface will replace
 +      decrease the badness score linearly.  This interface will replace
        /proc/<pid>/oom_adj.
  
        A warning will be emitted to the kernel log if an application uses this
  
  ---------------------------
  
- What: CS5535/CS5536 obsolete GPIO driver
- When: June 2011
- Files:        drivers/staging/cs5535_gpio/*
- Check:        drivers/staging/cs5535_gpio/cs5535_gpio.c
- Why:  A newer driver replaces this; it is drivers/gpio/cs5535-gpio.c, and
-       integrates with the Linux GPIO subsystem.  The old driver has been
-       moved to staging, and will be removed altogether around 3.0.
-       Please test the new driver, and ensure that the functionality you
-       need and any bugfixes from the old driver are available in the new
-       one.
- Who:  Andres Salomon <dilinger@queued.net>
- --------------------------
  What: remove EXPORT_SYMBOL(kernel_thread)
  When: August 2006
  Files:        arch/*/kernel/*_ksyms.c
@@@ -294,7 -280,7 +280,7 @@@ When:      The schedule was July 2008, but i
  Why:  The support code for the old firmware hurts code readability/maintainability
        and slightly hurts runtime performance. Bugfixes for the old firmware
        are not provided by Broadcom anymore.
 -Who:  Michael Buesch <mb@bu3sch.de>
 +Who:  Michael Buesch <m@bues.ch>
  
  ---------------------------
  
@@@ -430,7 -416,7 +416,7 @@@ Who:       Avi Kivity <avi@redhat.com
  ----------------------------
  
  What: iwlwifi 50XX module parameters
 -When: 2.6.40
 +When: 3.0
  Why:  The "..50" modules parameters were used to configure 5000 series and
        up devices; different set of module parameters also available for 4965
        with same functionalities. Consolidate both set into single place
@@@ -441,7 -427,7 +427,7 @@@ Who:       Wey-Yi Guy <wey-yi.w.guy@intel.com
  ----------------------------
  
  What: iwl4965 alias support
 -When: 2.6.40
 +When: 3.0
  Why:  Internal alias support has been present in module-init-tools for some
        time, the MODULE_ALIAS("iwl4965") boilerplate aliases can be removed
        with no impact.
@@@ -482,7 -468,7 +468,7 @@@ Who:       FUJITA Tomonori <fujita.tomonori@l
  ----------------------------
  
  What: iwlwifi disable_hw_scan module parameters
 -When: 2.6.40
 +When: 3.0
  Why:  Hareware scan is the prefer method for iwlwifi devices for
        scanning operation. Remove software scan support for all the
        iwlwifi devices.
@@@ -491,6 -477,26 +477,6 @@@ Who:      Wey-Yi Guy <wey-yi.w.guy@intel.com
  
  ----------------------------
  
 -What:   access to nfsd auth cache through sys_nfsservctl or '.' files
 -        in the 'nfsd' filesystem.
 -When:   2.6.40
 -Why:    This is a legacy interface which have been replaced by a more
 -        dynamic cache.  Continuing to maintain this interface is an
 -        unnecessary burden.
 -Who:    NeilBrown <neilb@suse.de>
 -
 -----------------------------
 -
 -What: cancel_rearming_delayed_work[queue]()
 -When: 2.6.39
 -
 -Why:  The functions have been superceded by cancel_delayed_work_sync()
 -      quite some time ago.  The conversion is trivial and there is no
 -      in-kernel user left.
 -Who:  Tejun Heo <tj@kernel.org>
 -
 -----------------------------
 -
  What: Legacy, non-standard chassis intrusion detection interface.
  When: June 2011
  Why:  The adm9240, w83792d and w83793 hardware monitoring drivers have
@@@ -508,6 -514,22 +494,6 @@@ Files:    net/netfilter/xt_connlimit.
  
  ----------------------------
  
 -What: noswapaccount kernel command line parameter
 -When: 2.6.40
 -Why:  The original implementation of memsw feature enabled by
 -      CONFIG_CGROUP_MEM_RES_CTLR_SWAP could be disabled by the noswapaccount
 -      kernel parameter (introduced in 2.6.29-rc1). Later on, this decision
 -      turned out to be not ideal because we cannot have the feature compiled
 -      in and disabled by default and let only interested to enable it
 -      (e.g. general distribution kernels might need it). Therefore we have
 -      added swapaccount[=0|1] parameter (introduced in 2.6.37) which provides
 -      the both possibilities. If we remove noswapaccount we will have
 -      less command line parameters with the same functionality and we
 -      can also cleanup the parameter handling a bit ().
 -Who:  Michal Hocko <mhocko@suse.cz>
 -
 -----------------------------
 -
  What: ipt_addrtype match include file
  When: 2012
  Why:  superseded by xt_addrtype
@@@ -526,7 -548,7 +512,7 @@@ Who:       Jean Delvare <khali@linux-fr.org
  ----------------------------
  
  What: Support for UVCIOC_CTRL_ADD in the uvcvideo driver
 -When: 2.6.42
 +When: 3.2
  Why:  The information passed to the driver by this ioctl is now queried
        dynamically from the device.
  Who:  Laurent Pinchart <laurent.pinchart@ideasonboard.com>
  ----------------------------
  
  What: Support for UVCIOC_CTRL_MAP_OLD in the uvcvideo driver
 -When: 2.6.42
 +When: 3.2
  Why:  Used only by applications compiled against older driver versions.
        Superseded by UVCIOC_CTRL_MAP which supports V4L2 menu controls.
  Who:  Laurent Pinchart <laurent.pinchart@ideasonboard.com>
  ----------------------------
  
  What: Support for UVCIOC_CTRL_GET and UVCIOC_CTRL_SET in the uvcvideo driver
 -When: 2.6.42
 +When: 3.2
  Why:  Superseded by the UVCIOC_CTRL_QUERY ioctl.
  Who:  Laurent Pinchart <laurent.pinchart@ideasonboard.com>
  
  ----------------------------
 +
 +What: For VIDIOC_S_FREQUENCY the type field must match the device node's type.
 +      If not, return -EINVAL.
 +When: 3.2
 +Why:  It makes no sense to switch the tuner to radio mode by calling
 +      VIDIOC_S_FREQUENCY on a video node, or to switch the tuner to tv mode by
 +      calling VIDIOC_S_FREQUENCY on a radio node. This is the first step of a
 +      move to more consistent handling of tv and radio tuners.
 +Who:  Hans Verkuil <hans.verkuil@cisco.com>
 +
 +----------------------------
 +
 +What: Opening a radio device node will no longer automatically switch the
 +      tuner mode from tv to radio.
 +When: 3.3
 +Why:  Just opening a V4L device should not change the state of the hardware
 +      like that. It's very unexpected and against the V4L spec. Instead, you
 +      switch to radio mode by calling VIDIOC_S_FREQUENCY. This is the second
 +      and last step of the move to consistent handling of tv and radio tuners.
 +Who:  Hans Verkuil <hans.verkuil@cisco.com>
 +
 +----------------------------
 +
 +What: g_file_storage driver
 +When: 3.8
 +Why:  This driver has been superseded by g_mass_storage.
 +Who:  Alan Stern <stern@rowland.harvard.edu>
 +
 +----------------------------
diff --combined MAINTAINERS
@@@ -1,5 -1,4 +1,5 @@@
  
 +
        List of maintainers and how to submit kernel changes
  
  Please try to follow the guidelines below.  This will make things
@@@ -534,8 -533,6 +534,8 @@@ L: device-drivers-devel@blackfin.uclinu
  L:    alsa-devel@alsa-project.org (moderated for non-subscribers)
  W:    http://wiki.analog.com/
  S:    Supported
 +F:    sound/soc/codecs/adau*
 +F:    sound/soc/codecs/adav*
  F:    sound/soc/codecs/ad1*
  F:    sound/soc/codecs/ssm*
  
@@@ -597,16 -594,6 +597,16 @@@ S:       Maintaine
  F:    arch/arm/lib/floppydma.S
  F:    arch/arm/include/asm/floppy.h
  
 +ARM PMU PROFILING AND DEBUGGING
 +M:    Will Deacon <will.deacon@arm.com>
 +S:    Maintained
 +F:    arch/arm/kernel/perf_event*
 +F:    arch/arm/oprofile/common.c
 +F:    arch/arm/kernel/pmu.c
 +F:    arch/arm/include/asm/pmu.h
 +F:    arch/arm/kernel/hw_breakpoint.c
 +F:    arch/arm/include/asm/hw_breakpoint.h
 +
  ARM PORT
  M:    Russell King <linux@arm.linux.org.uk>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
@@@ -696,7 -683,7 +696,7 @@@ T: git git://git.infradead.org/users/cb
  
  ARM/CIRRUS LOGIC EP93XX ARM ARCHITECTURE
  M:    Hartley Sweeten <hsweeten@visionengravers.com>
 -M:    Ryan Mallon <ryan@bluewatersys.com>
 +M:    Ryan Mallon <rmallon@gmail.com>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  S:    Maintained
  F:    arch/arm/mach-ep93xx/
@@@ -1546,19 -1533,14 +1546,20 @@@ F:   drivers/net/tg3.
  BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER
  M:    Brett Rudley <brudley@broadcom.com>
  M:    Henry Ptasinski <henryp@broadcom.com>
- M:    Dowan Kim <dowan@broadcom.com>
  M:    Roland Vossen <rvossen@broadcom.com>
  M:    Arend van Spriel <arend@broadcom.com>
+ M:    Franky (Zhenhui) Lin <frankyl@broadcom.com>
+ M:    Kan Yan <kanyan@broadcom.com>
  L:    linux-wireless@vger.kernel.org
  S:    Supported
  F:    drivers/staging/brcm80211/
  
 +BROADCOM BNX2FC 10 GIGABIT FCOE DRIVER
 +M:    Bhanu Prakash Gollapudi <bprakash@broadcom.com>
 +L:    linux-scsi@vger.kernel.org
 +S:    Supported
 +F:    drivers/scsi/bnx2fc/
 +
  BROCADE BFA FC SCSI DRIVER
  M:    Jing Huang <huangj@brocade.com>
  L:    linux-scsi@vger.kernel.org
@@@ -1588,7 -1570,7 +1589,7 @@@ F:      Documentation/sound/alsa/Bt87x.tx
  F:    sound/pci/bt87x.c
  
  BT8XXGPIO DRIVER
 -M:    Michael Buesch <mb@bu3sch.de>
 +M:    Michael Buesch <m@bues.ch>
  W:    http://bu3sch.de/btgpio.php
  S:    Maintained
  F:    drivers/gpio/bt8xxgpio.c
@@@ -1781,8 -1763,7 +1782,8 @@@ F:      include/linux/clk.
  
  CISCO FCOE HBA DRIVER
  M:    Abhijeet Joglekar <abjoglek@cisco.com>
 -M:    Joe Eykholt <jeykholt@cisco.com>
 +M:    Venkata Siva Vijayendra Bhamidipati <vbhamidi@cisco.com>
 +M:    Brian Uchino <buchino@cisco.com>
  L:    linux-scsi@vger.kernel.org
  S:    Supported
  F:    drivers/scsi/fnic/
@@@ -2217,7 -2198,7 +2218,7 @@@ F:      drivers/acpi/dock.
  DOCUMENTATION
  M:    Randy Dunlap <rdunlap@xenotime.net>
  L:    linux-doc@vger.kernel.org
 -T:    quilt oss.oracle.com/~rdunlap/kernel-doc-patches/current/
 +T:    quilt http://userweb.kernel.org/~rdunlap/kernel-doc-patches/current/
  S:    Maintained
  F:    Documentation/
  
@@@ -3012,7 -2993,7 +3013,7 @@@ F:      kernel/hrtimer.
  F:    kernel/time/clockevents.c
  F:    kernel/time/tick*.*
  F:    kernel/time/timer_*.c
 -F:    include/linux/clockevents.h
 +F:    include/linux/clockchips.h
  F:    include/linux/hrtimer.h
  
  HIGH-SPEED SCC DRIVER FOR AX.25
@@@ -3435,9 -3416,10 +3436,9 @@@ S:     Maintaine
  F:    drivers/net/ipg.*
  
  IPATH DRIVER
 -M:    Ralph Campbell <infinipath@qlogic.com>
 +M:    Mike Marciniszyn <infinipath@qlogic.com>
  L:    linux-rdma@vger.kernel.org
 -T:    git git://git.qlogic.com/ipath-linux-2.6
 -S:    Supported
 +S:    Maintained
  F:    drivers/infiniband/hw/ipath/
  
  IPMI SUBSYSTEM
@@@ -3895,7 -3877,7 +3896,7 @@@ F:      arch/powerpc/platforms/512x
  F:    arch/powerpc/platforms/52xx/
  
  LINUX FOR POWERPC EMBEDDED PPC4XX
 -M:    Josh Boyer <jwboyer@linux.vnet.ibm.com>
 +M:    Josh Boyer <jwboyer@gmail.com>
  M:    Matt Porter <mporter@kernel.crashing.org>
  W:    http://www.penguinppc.org/
  L:    linuxppc-dev@lists.ozlabs.org
@@@ -3927,7 -3909,6 +3928,7 @@@ W:      http://www.penguinppc.org
  L:    linuxppc-dev@lists.ozlabs.org
  S:    Maintained
  F:    arch/powerpc/platforms/83xx/
 +F:    arch/powerpc/platforms/85xx/
  
  LINUX FOR POWERPC PA SEMI PWRFICIENT
  M:    Olof Johansson <olof@lixom.net>
@@@ -3961,13 -3942,6 +3962,13 @@@ L:    lm-sensors@lm-sensors.or
  S:    Maintained
  F:    drivers/hwmon/lm73.c
  
 +LM78 HARDWARE MONITOR DRIVER
 +M:    Jean Delvare <khali@linux-fr.org>
 +L:    lm-sensors@lm-sensors.org
 +S:    Maintained
 +F:    Documentation/hwmon/lm78
 +F:    drivers/hwmon/lm78.c
 +
  LM83 HARDWARE MONITOR DRIVER
  M:    Jean Delvare <khali@linux-fr.org>
  L:    lm-sensors@lm-sensors.org
@@@ -4114,12 -4088,6 +4115,12 @@@ S:    Maintaine
  F:    drivers/net/mv643xx_eth.*
  F:    include/linux/mv643xx.h
  
 +MARVELL MWIFIEX WIRELESS DRIVER
 +M:    Bing Zhao <bzhao@marvell.com>
 +L:    linux-wireless@vger.kernel.org
 +S:    Maintained
 +F:    drivers/net/wireless/mwifiex/
 +
  MARVELL MWL8K WIRELESS DRIVER
  M:    Lennert Buytenhek <buytenh@wantstofly.org>
  L:    linux-wireless@vger.kernel.org
@@@ -4312,8 -4280,8 +4313,8 @@@ S:      Maintaine
  F:    drivers/usb/musb/
  
  MYRICOM MYRI-10G 10GbE DRIVER (MYRI10GE)
 +M:    Jon Mason <mason@myri.com>
  M:    Andrew Gallatin <gallatin@myri.com>
 -M:    Brice Goglin <brice@myri.com>
  L:    netdev@vger.kernel.org
  W:    http://www.myri.com/scs/download-Myri10GE.html
  S:    Supported
@@@ -4607,8 -4575,9 +4608,8 @@@ S:      Maintaine
  F:    drivers/mmc/host/omap.c
  
  OMAP HS MMC SUPPORT
 -M:    Madhusudhan Chikkature <madhu.cr@ti.com>
  L:    linux-omap@vger.kernel.org
 -S:    Maintained
 +S:    Orphan
  F:    drivers/mmc/host/omap_hsmmc.c
  
  OMAP RANDOM NUMBER GENERATOR SUPPORT
@@@ -4702,14 -4671,6 +4703,14 @@@ F:    drivers/o
  F:    include/linux/of*.h
  K:    of_get_property
  
 +OPENRISC ARCHITECTURE
 +M:    Jonas Bonn <jonas@southpole.se>
 +W:    http://openrisc.net
 +L:    linux@lists.openrisc.net
 +S:    Maintained
 +T:    git git://openrisc.net/~jonas/linux
 +F:    arch/openrisc
 +
  OPL4 DRIVER
  M:    Clemens Ladisch <clemens@ladisch.de>
  L:    alsa-devel@alsa-project.org (moderated for non-subscribers)
@@@ -5022,7 -4983,7 +5023,7 @@@ F:      drivers/power/power_supply
  
  PNP SUPPORT
  M:    Adam Belay <abelay@mit.edu>
 -M:    Bjorn Helgaas <bjorn.helgaas@hp.com>
 +M:    Bjorn Helgaas <bhelgaas@google.com>
  S:    Maintained
  F:    drivers/pnp/
  
@@@ -5182,12 -5143,6 +5183,12 @@@ M:    Robert Jarzmik <robert.jarzmik@free.
  L:    rtc-linux@googlegroups.com
  S:    Maintained
  
 +QIB DRIVER
 +M:    Mike Marciniszyn <infinipath@qlogic.com>
 +L:    linux-rdma@vger.kernel.org
 +S:    Supported
 +F:    drivers/infiniband/hw/qib/
 +
  QLOGIC QLA1280 SCSI DRIVER
  M:    Michael Reed <mdr@sgi.com>
  L:    linux-scsi@vger.kernel.org
@@@ -5349,13 -5304,6 +5350,13 @@@ L:    reiserfs-devel@vger.kernel.or
  S:    Supported
  F:    fs/reiserfs/
  
 +REGISTER MAP ABSTRACTION
 +M:    Mark Brown <broonie@opensource.wolfsonmicro.com>
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git
 +S:    Supported
 +F:    drivers/base/regmap/
 +F:    include/linux/regmap.h
 +
  RFKILL
  M:    Johannes Berg <johannes@sipsolutions.net>
  L:    linux-wireless@vger.kernel.org
@@@ -5918,7 -5866,7 +5919,7 @@@ S:      Maintaine
  F:    drivers/net/sonic.*
  
  SONICS SILICON BACKPLANE DRIVER (SSB)
 -M:    Michael Buesch <mb@bu3sch.de>
 +M:    Michael Buesch <m@bues.ch>
  L:    netdev@vger.kernel.org
  S:    Maintained
  F:    drivers/ssb/
@@@ -6092,6 -6040,145 +6093,145 @@@ L:  devel@driverdev.osuosl.or
  S:    Maintained
  F:    drivers/staging/
  
+ STAGING - AGERE HERMES II and II.5 WIRELESS DRIVERS
+ M:    Henk de Groot <pe1dnn@amsat.org>
+ S:    Odd Fixes
+ F:    drivers/staging/wlags49_h2/
+ F:    drivers/staging/wlags49_h25/
+ STAGING - ASUS OLED
+ M:    Jakub Schmidtke <sjakub@gmail.com>
+ S:    Odd Fixes
+ F:    drivers/staging/asus_oled/
+ STAGING - ATHEROS ATH6KL WIRELESS DRIVER
+ M:    Luis R. Rodriguez <mcgrof@gmail.com>
+ M:    Naveen Singh <nsingh@atheros.com>
+ S:    Odd Fixes
+ F:    drivers/staging/ath6kl/
+ STAGING - COMEDI
+ M:    Ian Abbott <abbotti@mev.co.uk>
+ M:    Mori Hess <fmhess@users.sourceforge.net>
+ S:    Odd Fixes
+ F:    drivers/staging/comedi/
+ STAGING - CRYSTAL HD VIDEO DECODER
+ M:    Naren Sankar <nsankar@broadcom.com>
+ M:    Jarod Wilson <jarod@wilsonet.com>
+ M:    Scott Davilla <davilla@4pi.com>
+ M:    Manu Abraham <abraham.manu@gmail.com>
+ S:    Odd Fixes
+ F:    drivers/staging/crystalhd/
+ STAGING - CYPRESS WESTBRIDGE SUPPORT
+ M:    David Cross <david.cross@cypress.com>
+ S:    Odd Fixes
+ F:    drivers/staging/westbridge/
+ STAGING - ECHO CANCELLER
+ M:    Steve Underwood <steveu@coppice.org>
+ M:    David Rowe <david@rowetel.com>
+ S:    Odd Fixes
+ F:    drivers/staging/echo/
+ STAGING - FLARION FT1000 DRIVERS
+ M:    Marek Belisko <marek.belisko@gmail.com>
+ S:    Odd Fixes
+ F:    drivers/staging/ft1000/
+ STAGING - FRONTIER TRANZPORT AND ALPHATRACK
+ M:    David Täht <d@teklibre.com>
+ S:    Odd Fixes
+ F:    drivers/staging/frontier/
+ STAGING - HYPER-V (MICROSOFT)
+ M:    Hank Janssen <hjanssen@microsoft.com>
+ M:    Haiyang Zhang <haiyangz@microsoft.com>
+ S:    Odd Fixes
+ F:    drivers/staging/hv/
+ STAGING - INDUSTRIAL IO
+ M:    Jonathan Cameron <jic23@cam.ac.uk>
+ L:    linux-iio@vger.kernel.org
+ S:    Odd Fixes
+ F:    drivers/staging/iio/
+ STAGING - LIRC (LINUX INFRARED REMOTE CONTROL) DRIVERS
+ M:    Jarod Wilson <jarod@wilsonet.com>
+ W:    http://www.lirc.org/
+ S:    Odd Fixes
+ F:    drivers/staging/lirc/
+ STAGING - OLPC SECONDARY DISPLAY CONTROLLER (DCON)
+ M:    Andres Salomon <dilinger@queued.net>
+ M:    Chris Ball <cjb@laptop.org>
+ M:    Jon Nettleton <jon.nettleton@gmail.com>
+ W:    http://wiki.laptop.org/go/DCON
+ S:    Odd Fixes
+ F:    drivers/staging/olpc_dcon/
+ STAGING - PARALLEL LCD/KEYPAD PANEL DRIVER
+ M:    Willy Tarreau <willy@meta-x.org>
+ S:    Odd Fixes
+ F:    drivers/staging/panel/
+ STAGING - REALTEK RTL8712U DRIVERS
+ M:    Larry Finger <Larry.Finger@lwfinger.net>
+ M:    Florian Schilhabel <florian.c.schilhabel@googlemail.com>.
+ S:    Odd Fixes
+ F:    drivers/staging/rtl8712/
+ STAGING - SILICON MOTION SM7XX FRAME BUFFER DRIVER
+ M:    Teddy Wang <teddy.wang@siliconmotion.com.cn>
+ S:    Odd Fixes
+ F:    drivers/staging/sm7xx/
+ STAGING - SOFTLOGIC 6x10 MPEG CODEC
+ M:    Ben Collins <bcollins@bluecherry.net>
+ S:    Odd Fixes
+ F:    drivers/staging/solo6x10/
+ STAGING - SPEAKUP CONSOLE SPEECH DRIVER
+ M:    William Hubbs <w.d.hubbs@gmail.com>
+ M:    Chris Brannon <chris@the-brannons.com>
+ M:    Kirk Reiser <kirk@braille.uwo.ca>
+ M:    Samuel Thibault <samuel.thibault@ens-lyon.org>
+ L:    speakup@braille.uwo.ca
+ W:    http://www.linux-speakup.org/
+ S:    Odd Fixes
+ F:    drivers/staging/speakup/
+ STAGING - TI DSP BRIDGE DRIVERS
+ M:    Omar Ramirez Luna <omar.ramirez@ti.com>
+ S:    Odd Fixes
+ F:    drivers/staging/tidspbridge/
+ STAGING - TRIDENT TVMASTER TMxxxx USB VIDEO CAPTURE DRIVERS
+ L:    linux-media@vger.kernel.org
+ S:    Odd Fixes
+ F:    drivers/staging/tm6000/
+ STAGING - USB ENE SM/MS CARD READER DRIVER
+ M:    Al Cho <acho@novell.com>
+ S:    Odd Fixes
+ F:    drivers/staging/keucr/
+ STAGING - VIA VT665X DRIVERS
+ M:    Forest Bond <forest@alittletooquiet.net>
+ S:    Odd Fixes
+ F:    drivers/staging/vt665?/
+ STAGING - WINBOND IS89C35 WLAN USB DRIVER
+ M:    Pavel Machek <pavel@ucw.cz>
+ S:    Odd Fixes
+ F:    drivers/staging/winbond/
+ STAGING - XGI Z7,Z9,Z11 PCI DISPLAY DRIVER
+ M:    Arnaud Patard <apatard@mandriva.com>
+ S:    Odd Fixes
+ F:    drivers/staging/xgifb/
  STARFIRE/DURALAN NETWORK DRIVER
  M:    Ion Badulescu <ionut@badula.org>
  S:    Odd Fixes
@@@ -6285,14 -6372,9 +6425,14 @@@ F:    drivers/char/toshiba.
  F:    include/linux/toshiba.h
  
  TMIO MMC DRIVER
 +M:    Guennadi Liakhovetski <g.liakhovetski@gmx.de>
  M:    Ian Molton <ian@mnementh.co.uk>
 +L:    linux-mmc@vger.kernel.org
  S:    Maintained
 -F:    drivers/mmc/host/tmio_mmc.*
 +F:    drivers/mmc/host/tmio_mmc*
 +F:    drivers/mmc/host/sh_mobile_sdhi.c
 +F:    include/linux/mmc/tmio.h
 +F:    include/linux/mmc/sh_mobile_sdhi.h
  
  TMPFS (SHMEM FILESYSTEM)
  M:    Hugh Dickins <hughd@google.com>
@@@ -6369,7 -6451,7 +6509,7 @@@ F:      drivers/scsi/u14-34f.
  
  UBI FILE SYSTEM (UBIFS)
  M:    Artem Bityutskiy <dedekind1@gmail.com>
 -M:    Adrian Hunter <adrian.hunter@nokia.com>
 +M:    Adrian Hunter <adrian.hunter@intel.com>
  L:    linux-mtd@lists.infradead.org
  T:    git git://git.infradead.org/ubifs-2.6.git
  W:    http://www.linux-mtd.infradead.org/doc/ubifs.html
@@@ -6594,13 -6676,6 +6734,6 @@@ W:     http://pegasus2.sourceforge.net
  S:    Maintained
  F:    drivers/net/usb/rtl8150.c
  
- USB SE401 DRIVER
- L:    linux-usb@vger.kernel.org
- W:    http://www.chello.nl/~j.vreeken/se401/
- S:    Orphan
- F:    Documentation/video4linux/se401.txt
- F:    drivers/staging/se401/
  USB SERIAL BELKIN F5U103 DRIVER
  M:    William Greathouse <wgreathouse@smva.com>
  L:    linux-usb@vger.kernel.org
@@@ -6791,7 -6866,6 +6924,7 @@@ F:      fs/fat
  VIDEOBUF2 FRAMEWORK
  M:    Pawel Osciak <pawel@osciak.com>
  M:    Marek Szyprowski <m.szyprowski@samsung.com>
 +M:    Kyungmin Park <kyungmin.park@samsung.com>
  L:    linux-media@vger.kernel.org
  S:    Maintained
  F:    drivers/media/video/videobuf2-*
@@@ -6986,9 -7060,9 +7119,9 @@@ S:      Maintaine
  F:    drivers/input/misc/wistron_btns.c
  
  WL1251 WIRELESS DRIVER
 -M:    Kalle Valo <kvalo@adurom.com>
 +M:    Luciano Coelho <coelho@ti.com>
  L:    linux-wireless@vger.kernel.org
 -W:    http://wireless.kernel.org
 +W:    http://wireless.kernel.org/en/users/Drivers/wl1251
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-testing.git
  S:    Maintained
  F:    drivers/net/wireless/wl1251/*
@@@ -52,6 -52,7 +52,6 @@@
  #include "aggr_recv_api.h"
  #include <host_version.h>
  #include <linux/rtnetlink.h>
 -#include <linux/init.h>
  #include <linux/moduleparam.h>
  #include "ar6000_api.h"
  #ifdef CONFIG_HOST_TCMD_SUPPORT
@@@ -545,15 -546,9 +545,9 @@@ struct ar6_softc 
      s8 arMaxRetries;
      u8 arPhyCapability;
  #ifdef CONFIG_HOST_TCMD_SUPPORT
-     u8 tcmdRxReport;
-     u32 tcmdRxTotalPkt;
-     s32 tcmdRxRssi;
-     u32 tcmdPm;
      u32 arTargetMode;
-     u32 tcmdRxcrcErrPkt;
-     u32 tcmdRxsecErrPkt;
-     u16 tcmdRateCnt[TCMD_MAX_RATES];
-     u16 tcmdRateCntShortGuard[TCMD_MAX_RATES];
+     void *tcmd_rx_report;
+     int tcmd_rx_report_len;
  #endif
      AR6000_WLAN_STATE       arWlanState;
      struct ar_node_mapping  arNodeMap[MAX_NODE_NUM];
      void                    *arApDev;
  #endif
      u8 arAutoAuthStage;
+       u8 *fw_otp;
+       size_t fw_otp_len;
+       u8 *fw;
+       size_t fw_len;
+       u8 *fw_patch;
+       size_t fw_patch_len;
+       u8 *fw_data;
+       size_t fw_data_len;
  };
  
  #ifdef CONFIG_AP_VIRTUAL_ADAPTER_SUPPORT
  #include <linux/file.h>
  #include <linux/string.h>
  #include <linux/etherdevice.h>
 -#include <net/ip.h>
  #include <linux/wait.h>
  #include <linux/proc_fs.h>
  #include <linux/interrupt.h>
- #include <linux/version.h>
 -
  #include <linux/stddef.h>
 -#include <linux/kernel.h>
  #include <linux/stat.h>
  #include <linux/fcntl.h>
  #include <linux/unistd.h>
  #include <linux/sched.h>
  #include <linux/mm.h>
  #include <linux/pagemap.h>
 -#include <asm/uaccess.h>
  #include <linux/kthread.h>
  #include <linux/tcp.h>
  #include <linux/udp.h>
  #include <linux/usb.h>
 +#include <asm/uaccess.h>
 +#include <net/ip.h>
  
  #include "Typedefs.h"
  #include "Version.h"
@@@ -59,6 -60,7 +58,6 @@@
  #include "Queue.h"
  #include "vendorspecificextn.h"
  
 -
  #include "InterfaceMacros.h"
  #include "InterfaceAdapter.h"
  #include "InterfaceIsr.h"
@@@ -14,9 -14,6 +14,6 @@@
   * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
   */
  
- #ifdef CONFIG_WIFI_CONTROL_FUNC
- #include <linux/platform_device.h>
- #endif
  #include <linux/init.h>
  #include <linux/kernel.h>
  #include <linux/kthread.h>
  #include <linux/fcntl.h>
  #include <linux/fs.h>
  #include <linux/uaccess.h>
- #include <bcmdefs.h>
- #include <bcmutils.h>
- #include <dngl_stats.h>
- #include <dhd.h>
- #include <dhd_bus.h>
- #include <dhd_proto.h>
- #include <dhd_dbg.h>
- #include <wl_cfg80211.h>
- #define EPI_VERSION_STR               "4.218.248.5"
- #define ETH_P_BRCM                    0x886c
- #if defined(CUSTOMER_HW2) && defined(CONFIG_WIFI_CONTROL_FUNC)
- #include <linux/wifi_tiwlan.h>
- struct semaphore wifi_control_sem;
- struct dhd_bus *g_bus;
- static struct wifi_platform_data *wifi_control_data;
- static struct resource *wifi_irqres;
- int wifi_get_irq_number(unsigned long *irq_flags_ptr)
- {
-       if (wifi_irqres) {
-               *irq_flags_ptr = wifi_irqres->flags & IRQF_TRIGGER_MASK;
-               return (int)wifi_irqres->start;
-       }
- #ifdef CUSTOM_OOB_GPIO_NUM
-       return CUSTOM_OOB_GPIO_NUM;
- #else
-       return -1;
- #endif
- }
- int wifi_set_carddetect(int on)
- {
-       printk(KERN_ERR "%s = %d\n", __func__, on);
-       if (wifi_control_data && wifi_control_data->set_carddetect)
-               wifi_control_data->set_carddetect(on);
-       return 0;
- }
- int wifi_set_power(int on, unsigned long msec)
- {
-       printk(KERN_ERR "%s = %d\n", __func__, on);
-       if (wifi_control_data && wifi_control_data->set_power)
-               wifi_control_data->set_power(on);
-       if (msec)
-               mdelay(msec);
-       return 0;
- }
- int wifi_set_reset(int on, unsigned long msec)
- {
-       printk(KERN_ERR "%s = %d\n", __func__, on);
-       if (wifi_control_data && wifi_control_data->set_reset)
-               wifi_control_data->set_reset(on);
-       if (msec)
-               mdelay(msec);
-       return 0;
- }
- static int wifi_probe(struct platform_device *pdev)
- {
-       struct wifi_platform_data *wifi_ctrl =
-           (struct wifi_platform_data *)(pdev->dev.platform_data);
-       printk(KERN_ERR "## %s\n", __func__);
-       wifi_irqres =
-           platform_get_resource_byname(pdev, IORESOURCE_IRQ,
-                                        "bcm4329_wlan_irq");
-       wifi_control_data = wifi_ctrl;
-       wifi_set_power(1, 0);   /* Power On */
-       wifi_set_carddetect(1); /* CardDetect (0->1) */
-       up(&wifi_control_sem);
-       return 0;
- }
- static int wifi_remove(struct platform_device *pdev)
- {
-       struct wifi_platform_data *wifi_ctrl =
-           (struct wifi_platform_data *)(pdev->dev.platform_data);
-       printk(KERN_ERR "## %s\n", __func__);
-       wifi_control_data = wifi_ctrl;
-       wifi_set_carddetect(0); /* CardDetect (1->0) */
-       wifi_set_power(0, 0);   /* Power Off */
-       up(&wifi_control_sem);
-       return 0;
- }
- static int wifi_suspend(struct platform_device *pdev, pm_message_t state)
- {
-       DHD_TRACE(("##> %s\n", __func__));
-       return 0;
- }
- static int wifi_resume(struct platform_device *pdev)
- {
-       DHD_TRACE(("##> %s\n", __func__));
-       return 0;
- }
- static struct platform_driver wifi_device = {
-       .probe = wifi_probe,
-       .remove = wifi_remove,
-       .suspend = wifi_suspend,
-       .resume = wifi_resume,
-       .driver = {
-                  .name = KBUILD_MODNAME,
-                  }
- };
- int wifi_add_dev(void)
- {
-       DHD_TRACE(("## Calling platform_driver_register\n"));
-       return platform_driver_register(&wifi_device);
- }
- void wifi_del_dev(void)
- {
-       DHD_TRACE(("## Unregister platform_driver_register\n"));
-       platform_driver_unregister(&wifi_device);
- }
- #endif        /* defined(CUSTOMER_HW2) && defined(CONFIG_WIFI_CONTROL_FUNC) */
 +#include <linux/interrupt.h>
 +#include <linux/hardirq.h>
+ #include <net/cfg80211.h>
+ #include <defs.h>
+ #include <brcmu_utils.h>
+ #include <brcmu_wifi.h>
+ #include "dhd.h"
+ #include "dhd_bus.h"
+ #include "dhd_proto.h"
+ #include "dhd_dbg.h"
+ #include "wl_cfg80211.h"
+ #include "bcmchip.h"
  
  #if defined(CONFIG_PM_SLEEP)
  #include <linux/suspend.h>
- atomic_t dhd_mmc_suspend;
- DECLARE_WAIT_QUEUE_HEAD(dhd_dpc_wait);
+ atomic_t brcmf_mmc_suspend;
  #endif        /*  defined(CONFIG_PM_SLEEP) */
  
- #if defined(OOB_INTR_ONLY)
- extern void dhd_enable_oob_intr(struct dhd_bus *bus, bool enable);
- #endif        /* defined(OOB_INTR_ONLY) */
  MODULE_AUTHOR("Broadcom Corporation");
  MODULE_DESCRIPTION("Broadcom 802.11n wireless LAN fullmac driver.");
  MODULE_SUPPORTED_DEVICE("Broadcom 802.11n WLAN fullmac cards");
  MODULE_LICENSE("Dual BSD/GPL");
  
- #define DRV_MODULE_NAME "brcmfmac"
- /* Linux wireless extension support */
- #if defined(CONFIG_WIRELESS_EXT)
- #include <wl_iw.h>
- extern wl_iw_extra_params_t g_wl_iw_params;
- #endif                /* defined(CONFIG_WIRELESS_EXT) */
- #if defined(CONFIG_HAS_EARLYSUSPEND)
- #include <linux/earlysuspend.h>
- extern int dhdcdc_set_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf,
-                           uint len);
- #endif                /* defined(CONFIG_HAS_EARLYSUSPEND) */
- #ifdef PKT_FILTER_SUPPORT
- extern void dhd_pktfilter_offload_set(dhd_pub_t *dhd, char *arg);
- extern void dhd_pktfilter_offload_enable(dhd_pub_t *dhd, char *arg, int enable,
-                                        int master_mode);
- #endif
  
  /* Interface control information */
typedef struct dhd_if {
-       struct dhd_info *info;  /* back pointer to dhd_info */
struct brcmf_if {
+       struct brcmf_info *info;        /* back pointer to brcmf_info */
        /* OS/stack specifics */
        struct net_device *net;
        struct net_device_stats stats;
        bool attached;          /* Delayed attachment when unset */
        bool txflowcontrol;     /* Per interface flow control indicator */
        char name[IFNAMSIZ];    /* linux interface name */
- } dhd_if_t;
+ };
  
  /* Local private structure (extension of pub) */
- typedef struct dhd_info {
- #if defined(CONFIG_WIRELESS_EXT)
-       wl_iw_t iw;             /* wireless extensions state (must be first) */
- #endif                                /* defined(CONFIG_WIRELESS_EXT) */
-       dhd_pub_t pub;
+ struct brcmf_info {
+       struct brcmf_pub pub;
  
        /* OS/stack specifics */
-       dhd_if_t *iflist[DHD_MAX_IFS];
+       struct brcmf_if *iflist[BRCMF_MAX_IFS];
  
        struct semaphore proto_sem;
        wait_queue_head_t ioctl_resp_wait;
-       struct timer_list timer;
-       bool wd_timer_valid;
-       struct tasklet_struct tasklet;
-       spinlock_t sdlock;
-       spinlock_t txqlock;
-       /* Thread based operation */
-       bool threads_only;
-       struct semaphore sdsem;
-       struct task_struct *watchdog_tsk;
-       struct semaphore watchdog_sem;
-       struct task_struct *dpc_tsk;
-       struct semaphore dpc_sem;
  
        /* Thread to issue ioctl for multicast */
        struct task_struct *sysioc_tsk;
        bool set_multicast;
        bool set_macaddress;
        u8 macvalue[ETH_ALEN];
-       wait_queue_head_t ctrl_wait;
        atomic_t pend_8021x_cnt;
- #ifdef CONFIG_HAS_EARLYSUSPEND
-       struct early_suspend early_suspend;
- #endif                                /* CONFIG_HAS_EARLYSUSPEND */
- } dhd_info_t;
- /* Definitions to provide path to the firmware and nvram
-  * example nvram_path[MOD_PARAM_PATHLEN]="/projects/wlan/nvram.txt"
-  */
- char firmware_path[MOD_PARAM_PATHLEN];
- char nvram_path[MOD_PARAM_PATHLEN];
- /* load firmware and/or nvram values from the filesystem */
- module_param_string(firmware_path, firmware_path, MOD_PARAM_PATHLEN, 0);
- module_param_string(nvram_path, nvram_path, MOD_PARAM_PATHLEN, 0);
+ };
  
  /* Error bits */
- module_param(dhd_msg_level, int, 0);
+ module_param(brcmf_msg_level, int, 0);
  
  /* Spawn a thread for system ioctls (set mac, set mcast) */
- uint dhd_sysioc = true;
- module_param(dhd_sysioc, uint, 0);
- /* Watchdog interval */
- uint dhd_watchdog_ms = 10;
- module_param(dhd_watchdog_ms, uint, 0);
- #ifdef DHD_DEBUG
- /* Console poll interval */
- uint dhd_console_ms;
- module_param(dhd_console_ms, uint, 0);
- #endif                                /* DHD_DEBUG */
+ uint brcmf_sysioc = true;
+ module_param(brcmf_sysioc, uint, 0);
  
  /* ARP offload agent mode : Enable ARP Host Auto-Reply
  and ARP Peer Auto-Reply */
- uint dhd_arp_mode = 0xb;
- module_param(dhd_arp_mode, uint, 0);
+ uint brcmf_arp_mode = 0xb;
+ module_param(brcmf_arp_mode, uint, 0);
  
  /* ARP offload enable */
- uint dhd_arp_enable = true;
- module_param(dhd_arp_enable, uint, 0);
+ uint brcmf_arp_enable = true;
+ module_param(brcmf_arp_enable, uint, 0);
  
  /* Global Pkt filter enable control */
- uint dhd_pkt_filter_enable = true;
- module_param(dhd_pkt_filter_enable, uint, 0);
+ uint brcmf_pkt_filter_enable = true;
+ module_param(brcmf_pkt_filter_enable, uint, 0);
  
  /*  Pkt filter init setup */
- uint dhd_pkt_filter_init;
- module_param(dhd_pkt_filter_init, uint, 0);
+ uint brcmf_pkt_filter_init;
+ module_param(brcmf_pkt_filter_init, uint, 0);
  
  /* Pkt filter mode control */
- uint dhd_master_mode = true;
- module_param(dhd_master_mode, uint, 1);
- /* Watchdog thread priority, -1 to use kernel timer */
- int dhd_watchdog_prio = 97;
- module_param(dhd_watchdog_prio, int, 0);
- /* DPC thread priority, -1 to use tasklet */
- int dhd_dpc_prio = 98;
- module_param(dhd_dpc_prio, int, 0);
+ uint brcmf_master_mode = true;
+ module_param(brcmf_master_mode, uint, 0);
  
- /* DPC thread priority, -1 to use tasklet */
- extern int dhd_dongle_memsize;
- module_param(dhd_dongle_memsize, int, 0);
+ module_param(brcmf_dongle_memsize, int, 0);
  
  /* Contorl fw roaming */
- #ifdef CUSTOMER_HW2
- uint dhd_roam;
- #else
- uint dhd_roam = 1;
- #endif
+ uint brcmf_roam = 1;
  
  /* Control radio state */
- uint dhd_radio_up = 1;
+ uint brcmf_radio_up = 1;
  
  /* Network inteface name */
  char iface_name[IFNAMSIZ] = "wlan";
@@@ -333,252 -128,58 +130,58 @@@ module_param_string(iface_name, iface_n
  /* The following are specific to the SDIO dongle */
  
  /* IOCTL response timeout */
- int dhd_ioctl_timeout_msec = IOCTL_RESP_TIMEOUT;
+ int brcmf_ioctl_timeout_msec = IOCTL_RESP_TIMEOUT;
  
  /* Idle timeout for backplane clock */
- int dhd_idletime = DHD_IDLETIME_TICKS;
- module_param(dhd_idletime, int, 0);
+ int brcmf_idletime = BRCMF_IDLETIME_TICKS;
+ module_param(brcmf_idletime, int, 0);
  
  /* Use polling */
- uint dhd_poll = false;
- module_param(dhd_poll, uint, 0);
- /* Use cfg80211 */
- uint dhd_cfg80211 = true;
- module_param(dhd_cfg80211, uint, 0);
+ uint brcmf_poll;
+ module_param(brcmf_poll, uint, 0);
  
  /* Use interrupts */
- uint dhd_intr = true;
- module_param(dhd_intr, uint, 0);
+ uint brcmf_intr = true;
+ module_param(brcmf_intr, uint, 0);
  
  /* SDIO Drive Strength (in milliamps) */
- uint dhd_sdiod_drive_strength = 6;
- module_param(dhd_sdiod_drive_strength, uint, 0);
+ uint brcmf_sdiod_drive_strength = 6;
+ module_param(brcmf_sdiod_drive_strength, uint, 0);
  
  /* Tx/Rx bounds */
- extern uint dhd_txbound;
- extern uint dhd_rxbound;
- module_param(dhd_txbound, uint, 0);
- module_param(dhd_rxbound, uint, 0);
- /* Deferred transmits */
- extern uint dhd_deferred_tx;
- module_param(dhd_deferred_tx, uint, 0);
+ module_param(brcmf_txbound, uint, 0);
+ module_param(brcmf_rxbound, uint, 0);
  
  #ifdef SDTEST
  /* Echo packet generator (pkts/s) */
- uint dhd_pktgen;
- module_param(dhd_pktgen, uint, 0);
+ uint brcmf_pktgen;
+ module_param(brcmf_pktgen, uint, 0);
  
  /* Echo packet len (0 => sawtooth, max 2040) */
- uint dhd_pktgen_len;
- module_param(dhd_pktgen_len, uint, 0);
- #endif
- #define FAVORITE_WIFI_CP      (!!dhd_cfg80211)
- #define IS_CFG80211_FAVORITE() FAVORITE_WIFI_CP
- #define DBG_CFG80211_GET() ((dhd_cfg80211 & WL_DBG_MASK) >> 1)
- #define NO_FW_REQ() (dhd_cfg80211 & 0x80)
- /* Version string to report */
- #ifdef DHD_DEBUG
- #define DHD_COMPILED "\nCompiled in " SRCBASE
- #else
- #define DHD_COMPILED
+ uint brcmf_pktgen_len;
+ module_param(brcmf_pktgen_len, uint, 0);
  #endif
  
- static void dhd_dpc(unsigned long data);
- /* forward decl */
- extern int dhd_wait_pend8021x(struct net_device *dev);
- #ifdef TOE
- #ifndef BDC
- #error TOE requires BDC
- #endif                                /* !BDC */
- static int dhd_toe_get(dhd_info_t *dhd, int idx, u32 *toe_ol);
- static int dhd_toe_set(dhd_info_t *dhd, int idx, u32 toe_ol);
- #endif                                /* TOE */
- static int dhd_wl_host_event(dhd_info_t *dhd, int *ifidx, void *pktdata,
-                            wl_event_msg_t *event_ptr, void **data_ptr);
- #if defined(CONFIG_PM_SLEEP)
- static int dhd_sleep_pm_callback(struct notifier_block *nfb,
-                                unsigned long action, void *ignored)
- {
-       switch (action) {
-       case PM_HIBERNATION_PREPARE:
-       case PM_SUSPEND_PREPARE:
-               atomic_set(&dhd_mmc_suspend, true);
-               return NOTIFY_OK;
-       case PM_POST_HIBERNATION:
-       case PM_POST_SUSPEND:
-               atomic_set(&dhd_mmc_suspend, false);
-               return NOTIFY_OK;
-       }
-       return 0;
- }
- static struct notifier_block dhd_sleep_pm_notifier = {
-       .notifier_call = dhd_sleep_pm_callback,
-       .priority = 0
- };
- extern int register_pm_notifier(struct notifier_block *nb);
- extern int unregister_pm_notifier(struct notifier_block *nb);
- #endif        /* defined(CONFIG_PM_SLEEP) */
-       /* && defined(DHD_GPL) */
- static void dhd_set_packet_filter(int value, dhd_pub_t *dhd)
- {
- #ifdef PKT_FILTER_SUPPORT
-       DHD_TRACE(("%s: %d\n", __func__, value));
-       /* 1 - Enable packet filter, only allow unicast packet to send up */
-       /* 0 - Disable packet filter */
-       if (dhd_pkt_filter_enable) {
-               int i;
-               for (i = 0; i < dhd->pktfilter_count; i++) {
-                       dhd_pktfilter_offload_set(dhd, dhd->pktfilter[i]);
-                       dhd_pktfilter_offload_enable(dhd, dhd->pktfilter[i],
-                                                    value, dhd_master_mode);
-               }
-       }
- #endif
- }
- #if defined(CONFIG_HAS_EARLYSUSPEND)
- static int dhd_set_suspend(int value, dhd_pub_t *dhd)
- {
-       int power_mode = PM_MAX;
-       /* wl_pkt_filter_enable_t       enable_parm; */
-       char iovbuf[32];
-       int bcn_li_dtim = 3;
- #ifdef CUSTOMER_HW2
-       uint roamvar = 1;
- #endif                                /* CUSTOMER_HW2 */
-       DHD_TRACE(("%s: enter, value = %d in_suspend=%d\n",
-                  __func__, value, dhd->in_suspend));
-       if (dhd && dhd->up) {
-               if (value && dhd->in_suspend) {
-                       /* Kernel suspended */
-                       DHD_TRACE(("%s: force extra Suspend setting\n",
-                                  __func__));
-                       dhdcdc_set_ioctl(dhd, 0, WLC_SET_PM,
-                                        (char *)&power_mode,
-                                        sizeof(power_mode));
-                       /* Enable packet filter, only allow unicast
-                                packet to send up */
-                       dhd_set_packet_filter(1, dhd);
-                       /* if dtim skip setup as default force it
-                        * to wake each third dtim
-                        * for better power saving.
-                        * Note that side effect is chance to miss BC/MC
-                        * packet
-                        */
-                       if ((dhd->dtim_skip == 0) || (dhd->dtim_skip == 1))
-                               bcn_li_dtim = 3;
-                       else
-                               bcn_li_dtim = dhd->dtim_skip;
-                       bcm_mkiovar("bcn_li_dtim", (char *)&bcn_li_dtim,
-                                   4, iovbuf, sizeof(iovbuf));
-                       dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf,
-                                        sizeof(iovbuf));
- #ifdef CUSTOMER_HW2
-                       /* Disable build-in roaming to allowed \
-                        * supplicant to take of romaing
-                        */
-                       bcm_mkiovar("roam_off", (char *)&roamvar, 4,
-                                   iovbuf, sizeof(iovbuf));
-                       dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf,
-                                        sizeof(iovbuf));
- #endif                                /* CUSTOMER_HW2 */
-               } else {
-                       /* Kernel resumed  */
-                       DHD_TRACE(("%s: Remove extra suspend setting\n",
-                                  __func__));
-                       power_mode = PM_FAST;
-                       dhdcdc_set_ioctl(dhd, 0, WLC_SET_PM,
-                                        (char *)&power_mode,
-                                        sizeof(power_mode));
-                       /* disable pkt filter */
-                       dhd_set_packet_filter(0, dhd);
-                       /* restore pre-suspend setting for dtim_skip */
-                       bcm_mkiovar("bcn_li_dtim", (char *)&dhd->dtim_skip,
-                                   4, iovbuf, sizeof(iovbuf));
-                       dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf,
-                                        sizeof(iovbuf));
- #ifdef CUSTOMER_HW2
-                       roamvar = 0;
-                       bcm_mkiovar("roam_off", (char *)&roamvar, 4, iovbuf,
-                                   sizeof(iovbuf));
-                       dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf,
-                                        sizeof(iovbuf));
- #endif                                /* CUSTOMER_HW2 */
-               }
-       }
-       return 0;
- }
- static void dhd_suspend_resume_helper(struct dhd_info *dhd, int val)
- {
-       dhd_pub_t *dhdp = &dhd->pub;
-       dhd_os_proto_block(dhdp);
-       /* Set flag when early suspend was called */
-       dhdp->in_suspend = val;
-       if (!dhdp->suspend_disable_flag)
-               dhd_set_suspend(val, dhdp);
-       dhd_os_proto_unblock(dhdp);
- }
- static void dhd_early_suspend(struct early_suspend *h)
- {
-       struct dhd_info *dhd = container_of(h, struct dhd_info, early_suspend);
-       DHD_TRACE(("%s: enter\n", __func__));
-       if (dhd)
-               dhd_suspend_resume_helper(dhd, 1);
- }
- static void dhd_late_resume(struct early_suspend *h)
- {
-       struct dhd_info *dhd = container_of(h, struct dhd_info, early_suspend);
-       DHD_TRACE(("%s: enter\n", __func__));
-       if (dhd)
-               dhd_suspend_resume_helper(dhd, 0);
- }
- #endif                                /* defined(CONFIG_HAS_EARLYSUSPEND) */
+ static int brcmf_toe_get(struct brcmf_info *drvr_priv, int idx, u32 *toe_ol);
+ static int brcmf_toe_set(struct brcmf_info *drvr_priv, int idx, u32 toe_ol);
+ static int brcmf_host_event(struct brcmf_info *drvr_priv, int *ifidx, void *pktdata,
+                           struct brcmf_event_msg *event_ptr,
+                           void **data_ptr);
  
  /*
   * Generalized timeout mechanism.  Uses spin sleep with exponential
   * back-off until
   * the sleep time reaches one jiffy, then switches over to task delay.  Usage:
   *
-  *      dhd_timeout_start(&tmo, usec);
-  *      while (!dhd_timeout_expired(&tmo))
+  *      brcmf_timeout_start(&tmo, usec);
+  *      while (!brcmf_timeout_expired(&tmo))
   *              if (poll_something())
   *                      break;
-  *      if (dhd_timeout_expired(&tmo))
+  *      if (brcmf_timeout_expired(&tmo))
   *              fatal();
   */
  
- void dhd_timeout_start(dhd_timeout_t *tmo, uint usec)
+ void brcmf_timeout_start(struct brcmf_timeout *tmo, uint usec)
  {
        tmo->limit = usec;
        tmo->increment = 0;
        tmo->tick = 1000000 / HZ;
  }
  
- int dhd_timeout_expired(dhd_timeout_t *tmo)
+ int brcmf_timeout_expired(struct brcmf_timeout *tmo)
  {
        /* Does nothing the first call */
        if (tmo->increment == 0) {
        return 0;
  }
  
- static int dhd_net2idx(dhd_info_t *dhd, struct net_device *net)
+ static int brcmf_net2idx(struct brcmf_info *drvr_priv, struct net_device *net)
  {
        int i = 0;
  
-       ASSERT(dhd);
-       while (i < DHD_MAX_IFS) {
-               if (dhd->iflist[i] && (dhd->iflist[i]->net == net))
+       while (i < BRCMF_MAX_IFS) {
+               if (drvr_priv->iflist[i] && (drvr_priv->iflist[i]->net == net))
                        return i;
                i++;
        }
  
-       return DHD_BAD_IF;
+       return BRCMF_BAD_IF;
  }
  
- int dhd_ifname2idx(dhd_info_t *dhd, char *name)
+ int brcmf_ifname2idx(struct brcmf_info *drvr_priv, char *name)
  {
-       int i = DHD_MAX_IFS;
-       ASSERT(dhd);
+       int i = BRCMF_MAX_IFS;
  
        if (name == NULL || *name == '\0')
                return 0;
  
        while (--i > 0)
-               if (dhd->iflist[i]
-                   && !strncmp(dhd->iflist[i]->name, name, IFNAMSIZ))
+               if (drvr_priv->iflist[i]
+                   && !strncmp(drvr_priv->iflist[i]->name, name, IFNAMSIZ))
                        break;
  
-       DHD_TRACE(("%s: return idx %d for \"%s\"\n", __func__, i, name));
+       BRCMF_TRACE(("%s: return idx %d for \"%s\"\n", __func__, i, name));
  
        return i;               /* default - the primary interface */
  }
  
- char *dhd_ifname(dhd_pub_t *dhdp, int ifidx)
+ char *brcmf_ifname(struct brcmf_pub *drvr, int ifidx)
  {
-       dhd_info_t *dhd = (dhd_info_t *) dhdp->info;
-       ASSERT(dhd);
+       struct brcmf_info *drvr_priv = drvr->info;
  
-       if (ifidx < 0 || ifidx >= DHD_MAX_IFS) {
-               DHD_ERROR(("%s: ifidx %d out of range\n", __func__, ifidx));
+       if (ifidx < 0 || ifidx >= BRCMF_MAX_IFS) {
+               BRCMF_ERROR(("%s: ifidx %d out of range\n", __func__, ifidx));
                return "<if_bad>";
        }
  
-       if (dhd->iflist[ifidx] == NULL) {
-               DHD_ERROR(("%s: null i/f %d\n", __func__, ifidx));
+       if (drvr_priv->iflist[ifidx] == NULL) {
+               BRCMF_ERROR(("%s: null i/f %d\n", __func__, ifidx));
                return "<if_null>";
        }
  
-       if (dhd->iflist[ifidx]->net)
-               return dhd->iflist[ifidx]->net->name;
+       if (drvr_priv->iflist[ifidx]->net)
+               return drvr_priv->iflist[ifidx]->net->name;
  
        return "<if_none>";
  }
  
- static void _dhd_set_multicast_list(dhd_info_t *dhd, int ifidx)
+ static void _brcmf_set_multicast_list(struct brcmf_info *drvr_priv, int ifidx)
  {
        struct net_device *dev;
        struct netdev_hw_addr *ha;
        u32 allmulti, cnt;
  
-       wl_ioctl_t ioc;
+       struct brcmf_ioctl ioc;
        char *buf, *bufp;
        uint buflen;
        int ret;
  
-       ASSERT(dhd && dhd->iflist[ifidx]);
-       dev = dhd->iflist[ifidx]->net;
+       dev = drvr_priv->iflist[ifidx]->net;
        cnt = netdev_mc_count(dev);
  
        /* Determine initial value of allmulti flag */
        buflen = sizeof("mcast_list") + sizeof(cnt) + (cnt * ETH_ALEN);
        bufp = buf = kmalloc(buflen, GFP_ATOMIC);
        if (!bufp) {
-               DHD_ERROR(("%s: out of memory for mcast_list, cnt %d\n",
-                          dhd_ifname(&dhd->pub, ifidx), cnt));
+               BRCMF_ERROR(("%s: out of memory for mcast_list, cnt %d\n",
+                            brcmf_ifname(&drvr_priv->pub, ifidx), cnt));
                return;
        }
  
        }
  
        memset(&ioc, 0, sizeof(ioc));
-       ioc.cmd = WLC_SET_VAR;
+       ioc.cmd = BRCMF_C_SET_VAR;
        ioc.buf = buf;
        ioc.len = buflen;
        ioc.set = true;
  
-       ret = dhd_prot_ioctl(&dhd->pub, ifidx, &ioc, ioc.buf, ioc.len);
+       ret = brcmf_proto_ioctl(&drvr_priv->pub, ifidx, &ioc, ioc.buf, ioc.len);
        if (ret < 0) {
-               DHD_ERROR(("%s: set mcast_list failed, cnt %d\n",
-                          dhd_ifname(&dhd->pub, ifidx), cnt));
+               BRCMF_ERROR(("%s: set mcast_list failed, cnt %d\n",
+                            brcmf_ifname(&drvr_priv->pub, ifidx), cnt));
                allmulti = cnt ? true : allmulti;
        }
  
        buflen = sizeof("allmulti") + sizeof(allmulti);
        buf = kmalloc(buflen, GFP_ATOMIC);
        if (!buf) {
-               DHD_ERROR(("%s: out of memory for allmulti\n",
-                          dhd_ifname(&dhd->pub, ifidx)));
+               BRCMF_ERROR(("%s: out of memory for allmulti\n",
+                            brcmf_ifname(&drvr_priv->pub, ifidx)));
                return;
        }
        allmulti = cpu_to_le32(allmulti);
  
-       if (!bcm_mkiovar
+       if (!brcmu_mkiovar
            ("allmulti", (void *)&allmulti, sizeof(allmulti), buf, buflen)) {
-               DHD_ERROR(("%s: mkiovar failed for allmulti, datalen %d "
-                       "buflen %u\n", dhd_ifname(&dhd->pub, ifidx),
-                       (int)sizeof(allmulti), buflen));
+               BRCMF_ERROR(("%s: mkiovar failed for allmulti, datalen %d "
+                            "buflen %u\n",
+                            brcmf_ifname(&drvr_priv->pub, ifidx),
+                            (int)sizeof(allmulti), buflen));
                kfree(buf);
                return;
        }
  
        memset(&ioc, 0, sizeof(ioc));
-       ioc.cmd = WLC_SET_VAR;
+       ioc.cmd = BRCMF_C_SET_VAR;
        ioc.buf = buf;
        ioc.len = buflen;
        ioc.set = true;
  
-       ret = dhd_prot_ioctl(&dhd->pub, ifidx, &ioc, ioc.buf, ioc.len);
+       ret = brcmf_proto_ioctl(&drvr_priv->pub, ifidx, &ioc, ioc.buf, ioc.len);
        if (ret < 0) {
-               DHD_ERROR(("%s: set allmulti %d failed\n",
-                          dhd_ifname(&dhd->pub, ifidx),
-                          le32_to_cpu(allmulti)));
+               BRCMF_ERROR(("%s: set allmulti %d failed\n",
+                            brcmf_ifname(&drvr_priv->pub, ifidx),
+                            le32_to_cpu(allmulti)));
        }
  
        kfree(buf);
        allmulti = cpu_to_le32(allmulti);
  
        memset(&ioc, 0, sizeof(ioc));
-       ioc.cmd = WLC_SET_PROMISC;
+       ioc.cmd = BRCMF_C_SET_PROMISC;
        ioc.buf = &allmulti;
        ioc.len = sizeof(allmulti);
        ioc.set = true;
  
-       ret = dhd_prot_ioctl(&dhd->pub, ifidx, &ioc, ioc.buf, ioc.len);
+       ret = brcmf_proto_ioctl(&drvr_priv->pub, ifidx, &ioc, ioc.buf, ioc.len);
        if (ret < 0) {
-               DHD_ERROR(("%s: set promisc %d failed\n",
-                          dhd_ifname(&dhd->pub, ifidx),
-                          le32_to_cpu(allmulti)));
+               BRCMF_ERROR(("%s: set promisc %d failed\n",
+                            brcmf_ifname(&drvr_priv->pub, ifidx),
+                            le32_to_cpu(allmulti)));
        }
  }
  
- static int
- _dhd_set_mac_address(dhd_info_t *dhd, int ifidx, u8 *addr)
+ static int _brcmf_set_mac_address(struct brcmf_info *drvr_priv, int ifidx, u8 *addr)
  {
        char buf[32];
-       wl_ioctl_t ioc;
+       struct brcmf_ioctl ioc;
        int ret;
  
-       DHD_TRACE(("%s enter\n", __func__));
-       if (!bcm_mkiovar
+       BRCMF_TRACE(("%s enter\n", __func__));
+       if (!brcmu_mkiovar
            ("cur_etheraddr", (char *)addr, ETH_ALEN, buf, 32)) {
-               DHD_ERROR(("%s: mkiovar failed for cur_etheraddr\n",
-                          dhd_ifname(&dhd->pub, ifidx)));
+               BRCMF_ERROR(("%s: mkiovar failed for cur_etheraddr\n",
+                            brcmf_ifname(&drvr_priv->pub, ifidx)));
                return -1;
        }
        memset(&ioc, 0, sizeof(ioc));
-       ioc.cmd = WLC_SET_VAR;
+       ioc.cmd = BRCMF_C_SET_VAR;
        ioc.buf = buf;
        ioc.len = 32;
        ioc.set = true;
  
-       ret = dhd_prot_ioctl(&dhd->pub, ifidx, &ioc, ioc.buf, ioc.len);
+       ret = brcmf_proto_ioctl(&drvr_priv->pub, ifidx, &ioc, ioc.buf, ioc.len);
        if (ret < 0) {
-               DHD_ERROR(("%s: set cur_etheraddr failed\n",
-                          dhd_ifname(&dhd->pub, ifidx)));
+               BRCMF_ERROR(("%s: set cur_etheraddr failed\n",
+                            brcmf_ifname(&drvr_priv->pub, ifidx)));
        } else {
-               memcpy(dhd->iflist[ifidx]->net->dev_addr, addr, ETH_ALEN);
+               memcpy(drvr_priv->iflist[ifidx]->net->dev_addr, addr, ETH_ALEN);
        }
  
        return ret;
  extern struct net_device *ap_net_dev;
  #endif
  
- static void dhd_op_if(dhd_if_t *ifp)
+ /* Virtual interfaces only ((ifp && ifp->info && ifp->idx == true) */
+ static void brcmf_op_if(struct brcmf_if *ifp)
  {
-       dhd_info_t *dhd;
+       struct brcmf_info *drvr_priv;
        int ret = 0, err = 0;
  
-       ASSERT(ifp && ifp->info && ifp->idx);   /* Virtual interfaces only */
-       dhd = ifp->info;
+       drvr_priv = ifp->info;
  
-       DHD_TRACE(("%s: idx %d, state %d\n", __func__, ifp->idx, ifp->state));
+       BRCMF_TRACE(("%s: idx %d, state %d\n", __func__, ifp->idx, ifp->state));
  
        switch (ifp->state) {
-       case WLC_E_IF_ADD:
+       case BRCMF_E_IF_ADD:
                /*
                 * Delete the existing interface before overwriting it
-                * in case we missed the WLC_E_IF_DEL event.
+                * in case we missed the BRCMF_E_IF_DEL event.
                 */
                if (ifp->net != NULL) {
-                       DHD_ERROR(("%s: ERROR: netdev:%s already exists, "
-                       "try free & unregister\n",
-                       __func__, ifp->net->name));
+                       BRCMF_ERROR(("%s: ERROR: netdev:%s already exists, "
+                                    "try free & unregister\n",
+                                    __func__, ifp->net->name));
                        netif_stop_queue(ifp->net);
                        unregister_netdev(ifp->net);
                        free_netdev(ifp->net);
                }
                /* Allocate etherdev, including space for private structure */
-               ifp->net = alloc_etherdev(sizeof(dhd));
+               ifp->net = alloc_etherdev(sizeof(drvr_priv));
                if (!ifp->net) {
-                       DHD_ERROR(("%s: OOM - alloc_etherdev\n", __func__));
+                       BRCMF_ERROR(("%s: OOM - alloc_etherdev\n", __func__));
                        ret = -ENOMEM;
                }
                if (ret == 0) {
                        strcpy(ifp->net->name, ifp->name);
-                       memcpy(netdev_priv(ifp->net), &dhd, sizeof(dhd));
-                       err = dhd_net_attach(&dhd->pub, ifp->idx);
+                       memcpy(netdev_priv(ifp->net), &drvr_priv, sizeof(drvr_priv));
+                       err = brcmf_net_attach(&drvr_priv->pub, ifp->idx);
                        if (err != 0) {
-                               DHD_ERROR(("%s: dhd_net_attach failed, "
-                                       "err %d\n",
-                                       __func__, err));
+                               BRCMF_ERROR(("%s: brcmf_net_attach failed, "
+                                            "err %d\n",
+                                            __func__, err));
                                ret = -EOPNOTSUPP;
                        } else {
  #ifdef SOFTAP
                                         wl0.1 is ready */
                                up(&ap_eth_sema);
  #endif
-                               DHD_TRACE(("\n ==== pid:%x, net_device for "
-                                       "if:%s created ===\n\n",
-                                       current->pid, ifp->net->name));
+                               BRCMF_TRACE(("\n ==== pid:%x, net_device for "
+                                            "if:%s created ===\n\n",
+                                            current->pid, ifp->net->name));
                                ifp->state = 0;
                        }
                }
                break;
-       case WLC_E_IF_DEL:
+       case BRCMF_E_IF_DEL:
                if (ifp->net != NULL) {
-                       DHD_TRACE(("\n%s: got 'WLC_E_IF_DEL' state\n",
-                                  __func__));
+                       BRCMF_TRACE(("\n%s: got 'WLC_E_IF_DEL' state\n",
+                                    __func__));
                        netif_stop_queue(ifp->net);
                        unregister_netdev(ifp->net);
-                       ret = DHD_DEL_IF;       /* Make sure the free_netdev()
+                       ret = BRCMF_DEL_IF;     /* Make sure the free_netdev()
                                                         is called */
                }
                break;
        default:
-               DHD_ERROR(("%s: bad op %d\n", __func__, ifp->state));
-               ASSERT(!ifp->state);
+               BRCMF_ERROR(("%s: bad op %d\n", __func__, ifp->state));
                break;
        }
  
                if (ifp->net)
                        free_netdev(ifp->net);
  
-               dhd->iflist[ifp->idx] = NULL;
+               drvr_priv->iflist[ifp->idx] = NULL;
                kfree(ifp);
  #ifdef SOFTAP
                if (ifp->net == ap_net_dev)
        }
  }
  
- static int _dhd_sysioc_thread(void *data)
+ static int _brcmf_sysioc_thread(void *data)
  {
-       dhd_info_t *dhd = (dhd_info_t *) data;
+       struct brcmf_info *drvr_priv = (struct brcmf_info *) data;
        int i;
  #ifdef SOFTAP
        bool in_ap = false;
  
        allow_signal(SIGTERM);
  
-       while (down_interruptible(&dhd->sysioc_sem) == 0) {
+       while (down_interruptible(&drvr_priv->sysioc_sem) == 0) {
                if (kthread_should_stop())
                        break;
-               for (i = 0; i < DHD_MAX_IFS; i++) {
-                       if (dhd->iflist[i]) {
+               for (i = 0; i < BRCMF_MAX_IFS; i++) {
+                       struct brcmf_if *ifentry = drvr_priv->iflist[i];
+                       if (ifentry) {
  #ifdef SOFTAP
                                in_ap = (ap_net_dev != NULL);
  #endif                                /* SOFTAP */
-                               if (dhd->iflist[i]->state)
-                                       dhd_op_if(dhd->iflist[i]);
+                               if (ifentry->state)
+                                       brcmf_op_if(ifentry);
  #ifdef SOFTAP
-                               if (dhd->iflist[i] == NULL) {
-                                       DHD_TRACE(("\n\n %s: interface %d "
-                                               "removed!\n", __func__, i));
+                               if (drvr_priv->iflist[i] == NULL) {
+                                       BRCMF_TRACE(("\n\n %s: interface %d "
+                                                    "removed!\n", __func__,
+                                                    i));
                                        continue;
                                }
  
-                               if (in_ap && dhd->set_macaddress) {
-                                       DHD_TRACE(("attempt to set MAC for %s "
-                                               "in AP Mode," "blocked. \n",
-                                               dhd->iflist[i]->net->name));
-                                       dhd->set_macaddress = false;
+                               if (in_ap && drvr_priv->set_macaddress) {
+                                       BRCMF_TRACE(("attempt to set MAC for"
+                                                    " %s in AP Mode,"
+                                                    " blocked.\n",
+                                                    ifentry->net->name));
+                                       drvr_priv->set_macaddress = false;
                                        continue;
                                }
  
-                               if (in_ap && dhd->set_multicast) {
-                                       DHD_TRACE(("attempt to set MULTICAST list for %s" "in AP Mode, blocked. \n",
-                                               dhd->iflist[i]->net->name));
-                                       dhd->set_multicast = false;
+                               if (in_ap && drvr_priv->set_multicast) {
+                                       BRCMF_TRACE(("attempt to set MULTICAST "
+                                                    "list for %s in AP Mode, "
+                                                    "blocked.\n",
+                                                    ifentry->net->name));
+                                       drvr_priv->set_multicast = false;
                                        continue;
                                }
  #endif                                /* SOFTAP */
-                               if (dhd->set_multicast) {
-                                       dhd->set_multicast = false;
-                                       _dhd_set_multicast_list(dhd, i);
+                               if (drvr_priv->set_multicast) {
+                                       drvr_priv->set_multicast = false;
+                                       _brcmf_set_multicast_list(drvr_priv, i);
                                }
-                               if (dhd->set_macaddress) {
-                                       dhd->set_macaddress = false;
-                                       _dhd_set_mac_address(dhd, i,
-                                                            dhd->macvalue);
+                               if (drvr_priv->set_macaddress) {
+                                       drvr_priv->set_macaddress = false;
+                                       _brcmf_set_mac_address(drvr_priv, i,
+                                               drvr_priv->macvalue);
                                }
                        }
                }
        return 0;
  }
  
- static int dhd_set_mac_address(struct net_device *dev, void *addr)
+ static int brcmf_netdev_set_mac_address(struct net_device *dev, void *addr)
  {
        int ret = 0;
  
-       dhd_info_t *dhd = *(dhd_info_t **) netdev_priv(dev);
+       struct brcmf_info *drvr_priv = *(struct brcmf_info **) netdev_priv(dev);
        struct sockaddr *sa = (struct sockaddr *)addr;
        int ifidx;
  
-       ifidx = dhd_net2idx(dhd, dev);
-       if (ifidx == DHD_BAD_IF)
+       ifidx = brcmf_net2idx(drvr_priv, dev);
+       if (ifidx == BRCMF_BAD_IF)
                return -1;
  
-       ASSERT(dhd->sysioc_tsk);
-       memcpy(&dhd->macvalue, sa->sa_data, ETH_ALEN);
-       dhd->set_macaddress = true;
-       up(&dhd->sysioc_sem);
+       memcpy(&drvr_priv->macvalue, sa->sa_data, ETH_ALEN);
+       drvr_priv->set_macaddress = true;
+       up(&drvr_priv->sysioc_sem);
  
        return ret;
  }
  
- static void dhd_set_multicast_list(struct net_device *dev)
+ static void brcmf_netdev_set_multicast_list(struct net_device *dev)
  {
-       dhd_info_t *dhd = *(dhd_info_t **) netdev_priv(dev);
+       struct brcmf_info *drvr_priv = *(struct brcmf_info **) netdev_priv(dev);
        int ifidx;
  
-       ifidx = dhd_net2idx(dhd, dev);
-       if (ifidx == DHD_BAD_IF)
+       ifidx = brcmf_net2idx(drvr_priv, dev);
+       if (ifidx == BRCMF_BAD_IF)
                return;
  
-       ASSERT(dhd->sysioc_tsk);
-       dhd->set_multicast = true;
-       up(&dhd->sysioc_sem);
+       drvr_priv->set_multicast = true;
+       up(&drvr_priv->sysioc_sem);
  }
  
- int dhd_sendpkt(dhd_pub_t *dhdp, int ifidx, struct sk_buff *pktbuf)
+ int brcmf_sendpkt(struct brcmf_pub *drvr, int ifidx, struct sk_buff *pktbuf)
  {
-       int ret;
-       dhd_info_t *dhd = (dhd_info_t *) (dhdp->info);
+       struct brcmf_info *drvr_priv = drvr->info;
  
        /* Reject if down */
-       if (!dhdp->up || (dhdp->busstate == DHD_BUS_DOWN))
+       if (!drvr->up || (drvr->busstate == BRCMF_BUS_DOWN))
                return -ENODEV;
  
        /* Update multicast statistic */
                struct ethhdr *eh = (struct ethhdr *)pktdata;
  
                if (is_multicast_ether_addr(eh->h_dest))
-                       dhdp->tx_multicast++;
+                       drvr->tx_multicast++;
                if (ntohs(eh->h_proto) == ETH_P_PAE)
-                       atomic_inc(&dhd->pend_8021x_cnt);
+                       atomic_inc(&drvr_priv->pend_8021x_cnt);
        }
  
        /* If the protocol uses a data header, apply it */
-       dhd_prot_hdrpush(dhdp, ifidx, pktbuf);
+       brcmf_proto_hdrpush(drvr, ifidx, pktbuf);
  
        /* Use bus module to send data frame */
- #ifdef BCMDBUS
-       ret = dbus_send_pkt(dhdp->dbus, pktbuf, NULL /* pktinfo */);
- #else
-       ret = dhd_bus_txdata(dhdp->bus, pktbuf);
- #endif                                /* BCMDBUS */
-       return ret;
- }
- static inline void *
- osl_pkt_frmnative(struct sk_buff *skb)
- {
-       return (void *)skb;
- }
- #define PKTFRMNATIVE(osh, skb)        \
-       osl_pkt_frmnative((struct sk_buff *)(skb))
- static inline struct sk_buff *
- osl_pkt_tonative(void *pkt)
- {
-       return (struct sk_buff *)pkt;
+       return brcmf_sdbrcm_bus_txdata(drvr->bus, pktbuf);
  }
- #define PKTTONATIVE(osh, pkt) \
-       osl_pkt_tonative((pkt))
  
- static int dhd_start_xmit(struct sk_buff *skb, struct net_device *net)
+ static int brcmf_netdev_start_xmit(struct sk_buff *skb, struct net_device *net)
  {
        int ret;
-       void *pktbuf;
-       dhd_info_t *dhd = *(dhd_info_t **) netdev_priv(net);
+       struct brcmf_info *drvr_priv = *(struct brcmf_info **) netdev_priv(net);
        int ifidx;
  
-       DHD_TRACE(("%s: Enter\n", __func__));
+       BRCMF_TRACE(("%s: Enter\n", __func__));
  
        /* Reject if down */
-       if (!dhd->pub.up || (dhd->pub.busstate == DHD_BUS_DOWN)) {
-               DHD_ERROR(("%s: xmit rejected pub.up=%d busstate=%d\n",
-                          __func__, dhd->pub.up, dhd->pub.busstate));
+       if (!drvr_priv->pub.up || (drvr_priv->pub.busstate == BRCMF_BUS_DOWN)) {
+               BRCMF_ERROR(("%s: xmit rejected pub.up=%d busstate=%d\n",
+                            __func__, drvr_priv->pub.up,
+                            drvr_priv->pub.busstate));
                netif_stop_queue(net);
                return -ENODEV;
        }
  
-       ifidx = dhd_net2idx(dhd, net);
-       if (ifidx == DHD_BAD_IF) {
-               DHD_ERROR(("%s: bad ifidx %d\n", __func__, ifidx));
+       ifidx = brcmf_net2idx(drvr_priv, net);
+       if (ifidx == BRCMF_BAD_IF) {
+               BRCMF_ERROR(("%s: bad ifidx %d\n", __func__, ifidx));
                netif_stop_queue(net);
                return -ENODEV;
        }
  
        /* Make sure there's enough room for any header */
-       if (skb_headroom(skb) < dhd->pub.hdrlen) {
+       if (skb_headroom(skb) < drvr_priv->pub.hdrlen) {
                struct sk_buff *skb2;
  
-               DHD_INFO(("%s: insufficient headroom\n",
-                         dhd_ifname(&dhd->pub, ifidx)));
-               dhd->pub.tx_realloc++;
-               skb2 = skb_realloc_headroom(skb, dhd->pub.hdrlen);
+               BRCMF_INFO(("%s: insufficient headroom\n",
+                           brcmf_ifname(&drvr_priv->pub, ifidx)));
+               drvr_priv->pub.tx_realloc++;
+               skb2 = skb_realloc_headroom(skb, drvr_priv->pub.hdrlen);
                dev_kfree_skb(skb);
                skb = skb2;
                if (skb == NULL) {
-                       DHD_ERROR(("%s: skb_realloc_headroom failed\n",
-                                  dhd_ifname(&dhd->pub, ifidx)));
+                       BRCMF_ERROR(("%s: skb_realloc_headroom failed\n",
+                                    brcmf_ifname(&drvr_priv->pub, ifidx)));
                        ret = -ENOMEM;
                        goto done;
                }
        }
  
-       /* Convert to packet */
-       pktbuf = PKTFRMNATIVE(dhd->pub.osh, skb);
-       if (!pktbuf) {
-               DHD_ERROR(("%s: PKTFRMNATIVE failed\n",
-                          dhd_ifname(&dhd->pub, ifidx)));
-               dev_kfree_skb_any(skb);
-               ret = -ENOMEM;
-               goto done;
-       }
-       ret = dhd_sendpkt(&dhd->pub, ifidx, pktbuf);
+       ret = brcmf_sendpkt(&drvr_priv->pub, ifidx, skb);
  
  done:
        if (ret)
-               dhd->pub.dstats.tx_dropped++;
+               drvr_priv->pub.dstats.tx_dropped++;
        else
-               dhd->pub.tx_packets++;
+               drvr_priv->pub.tx_packets++;
  
        /* Return ok: we always eat the packet */
        return 0;
  }
  
- void dhd_txflowcontrol(dhd_pub_t *dhdp, int ifidx, bool state)
+ void brcmf_txflowcontrol(struct brcmf_pub *drvr, int ifidx, bool state)
  {
        struct net_device *net;
-       dhd_info_t *dhd = dhdp->info;
+       struct brcmf_info *drvr_priv = drvr->info;
  
-       DHD_TRACE(("%s: Enter\n", __func__));
+       BRCMF_TRACE(("%s: Enter\n", __func__));
  
-       dhdp->txoff = state;
-       ASSERT(dhd && dhd->iflist[ifidx]);
-       net = dhd->iflist[ifidx]->net;
+       drvr->txoff = state;
+       net = drvr_priv->iflist[ifidx]->net;
        if (state == ON)
                netif_stop_queue(net);
        else
                netif_wake_queue(net);
  }
  
- void dhd_rx_frame(dhd_pub_t *dhdp, int ifidx, struct sk_buff *pktbuf,
+ void brcmf_rx_frame(struct brcmf_pub *drvr, int ifidx, struct sk_buff *skb,
                  int numpkt)
  {
-       dhd_info_t *dhd = (dhd_info_t *) dhdp->info;
-       struct sk_buff *skb;
+       struct brcmf_info *drvr_priv = drvr->info;
        unsigned char *eth;
        uint len;
        void *data;
        struct sk_buff *pnext, *save_pktbuf;
        int i;
-       dhd_if_t *ifp;
-       wl_event_msg_t event;
-       DHD_TRACE(("%s: Enter\n", __func__));
+       struct brcmf_if *ifp;
+       struct brcmf_event_msg event;
  
-       save_pktbuf = pktbuf;
+       BRCMF_TRACE(("%s: Enter\n", __func__));
  
-       for (i = 0; pktbuf && i < numpkt; i++, pktbuf = pnext) {
+       save_pktbuf = skb;
  
-               pnext = pktbuf->next;
-               pktbuf->next = NULL;
+       for (i = 0; skb && i < numpkt; i++, skb = pnext) {
  
-               skb = PKTTONATIVE(dhdp->osh, pktbuf);
+               pnext = skb->next;
+               skb->next = NULL;
  
                /* Get the protocol, maintain skb around eth_type_trans()
                 * The main reason for this hack is for the limitation of
                eth = skb->data;
                len = skb->len;
  
-               ifp = dhd->iflist[ifidx];
+               ifp = drvr_priv->iflist[ifidx];
                if (ifp == NULL)
-                       ifp = dhd->iflist[0];
+                       ifp = drvr_priv->iflist[0];
  
-               ASSERT(ifp);
                skb->dev = ifp->net;
                skb->protocol = eth_type_trans(skb, skb->dev);
  
                if (skb->pkt_type == PACKET_MULTICAST)
-                       dhd->pub.rx_multicast++;
+                       drvr_priv->pub.rx_multicast++;
  
                skb->data = eth;
                skb->len = len;
                skb_pull(skb, ETH_HLEN);
  
                /* Process special event packets and then discard them */
-               if (ntohs(skb->protocol) == ETH_P_BRCM)
-                       dhd_wl_host_event(dhd, &ifidx,
+               if (ntohs(skb->protocol) == ETH_P_LINK_CTL)
+                       brcmf_host_event(drvr_priv, &ifidx,
                                          skb_mac_header(skb),
                                          &event, &data);
  
-               ASSERT(ifidx < DHD_MAX_IFS && dhd->iflist[ifidx]);
-               if (dhd->iflist[ifidx] && !dhd->iflist[ifidx]->state)
-                       ifp = dhd->iflist[ifidx];
+               if (drvr_priv->iflist[ifidx] &&
+                   !drvr_priv->iflist[ifidx]->state)
+                       ifp = drvr_priv->iflist[ifidx];
  
                if (ifp->net)
                        ifp->net->last_rx = jiffies;
  
-               dhdp->dstats.rx_bytes += skb->len;
-               dhdp->rx_packets++;     /* Local count */
+               drvr->dstats.rx_bytes += skb->len;
+               drvr->rx_packets++;     /* Local count */
  
                if (in_interrupt()) {
                        netif_rx(skb);
        }
  }
  
- void dhd_event(struct dhd_info *dhd, char *evpkt, int evlen, int ifidx)
- {
-       /* Linux version has nothing to do */
-       return;
- }
- void dhd_txcomplete(dhd_pub_t *dhdp, struct sk_buff *txp, bool success)
+ void brcmf_txcomplete(struct brcmf_pub *drvr, struct sk_buff *txp, bool success)
  {
        uint ifidx;
-       dhd_info_t *dhd = (dhd_info_t *) (dhdp->info);
+       struct brcmf_info *drvr_priv = drvr->info;
        struct ethhdr *eh;
        u16 type;
  
-       dhd_prot_hdrpull(dhdp, &ifidx, txp);
+       brcmf_proto_hdrpull(drvr, &ifidx, txp);
  
        eh = (struct ethhdr *)(txp->data);
        type = ntohs(eh->h_proto);
  
        if (type == ETH_P_PAE)
-               atomic_dec(&dhd->pend_8021x_cnt);
+               atomic_dec(&drvr_priv->pend_8021x_cnt);
  
  }
  
- static struct net_device_stats *dhd_get_stats(struct net_device *net)
+ static struct net_device_stats *brcmf_netdev_get_stats(struct net_device *net)
  {
-       dhd_info_t *dhd = *(dhd_info_t **) netdev_priv(net);
-       dhd_if_t *ifp;
+       struct brcmf_info *drvr_priv = *(struct brcmf_info **) netdev_priv(net);
+       struct brcmf_if *ifp;
        int ifidx;
  
-       DHD_TRACE(("%s: Enter\n", __func__));
+       BRCMF_TRACE(("%s: Enter\n", __func__));
  
-       ifidx = dhd_net2idx(dhd, net);
-       if (ifidx == DHD_BAD_IF)
+       ifidx = brcmf_net2idx(drvr_priv, net);
+       if (ifidx == BRCMF_BAD_IF)
                return NULL;
  
-       ifp = dhd->iflist[ifidx];
-       ASSERT(dhd && ifp);
+       ifp = drvr_priv->iflist[ifidx];
  
-       if (dhd->pub.up) {
+       if (drvr_priv->pub.up) {
                /* Use the protocol to get dongle stats */
-               dhd_prot_dstats(&dhd->pub);
+               brcmf_proto_dstats(&drvr_priv->pub);
        }
  
        /* Copy dongle stats to net device stats */
-       ifp->stats.rx_packets = dhd->pub.dstats.rx_packets;
-       ifp->stats.tx_packets = dhd->pub.dstats.tx_packets;
-       ifp->stats.rx_bytes = dhd->pub.dstats.rx_bytes;
-       ifp->stats.tx_bytes = dhd->pub.dstats.tx_bytes;
-       ifp->stats.rx_errors = dhd->pub.dstats.rx_errors;
-       ifp->stats.tx_errors = dhd->pub.dstats.tx_errors;
-       ifp->stats.rx_dropped = dhd->pub.dstats.rx_dropped;
-       ifp->stats.tx_dropped = dhd->pub.dstats.tx_dropped;
-       ifp->stats.multicast = dhd->pub.dstats.multicast;
+       ifp->stats.rx_packets = drvr_priv->pub.dstats.rx_packets;
+       ifp->stats.tx_packets = drvr_priv->pub.dstats.tx_packets;
+       ifp->stats.rx_bytes = drvr_priv->pub.dstats.rx_bytes;
+       ifp->stats.tx_bytes = drvr_priv->pub.dstats.tx_bytes;
+       ifp->stats.rx_errors = drvr_priv->pub.dstats.rx_errors;
+       ifp->stats.tx_errors = drvr_priv->pub.dstats.tx_errors;
+       ifp->stats.rx_dropped = drvr_priv->pub.dstats.rx_dropped;
+       ifp->stats.tx_dropped = drvr_priv->pub.dstats.tx_dropped;
+       ifp->stats.multicast = drvr_priv->pub.dstats.multicast;
  
        return &ifp->stats;
  }
  
- static int dhd_watchdog_thread(void *data)
- {
-       dhd_info_t *dhd = (dhd_info_t *) data;
-       /* This thread doesn't need any user-level access,
-        * so get rid of all our resources
-        */
- #ifdef DHD_SCHED
-       if (dhd_watchdog_prio > 0) {
-               struct sched_param param;
-               param.sched_priority = (dhd_watchdog_prio < MAX_RT_PRIO) ?
-                   dhd_watchdog_prio : (MAX_RT_PRIO - 1);
-               setScheduler(current, SCHED_FIFO, &param);
-       }
- #endif                                /* DHD_SCHED */
-       allow_signal(SIGTERM);
-       /* Run until signal received */
-       while (1) {
-               if (kthread_should_stop())
-                       break;
-               if (down_interruptible(&dhd->watchdog_sem) == 0) {
-                       if (dhd->pub.dongle_reset == false) {
-                               /* Call the bus module watchdog */
-                               dhd_bus_watchdog(&dhd->pub);
-                       }
-                       /* Count the tick for reference */
-                       dhd->pub.tickcnt++;
-               } else
-                       break;
-       }
-       return 0;
- }
- static void dhd_watchdog(unsigned long data)
- {
-       dhd_info_t *dhd = (dhd_info_t *) data;
-       if (dhd->watchdog_tsk) {
-               up(&dhd->watchdog_sem);
-               /* Reschedule the watchdog */
-               if (dhd->wd_timer_valid) {
-                       mod_timer(&dhd->timer,
-                                 jiffies + dhd_watchdog_ms * HZ / 1000);
-               }
-               return;
-       }
-       /* Call the bus module watchdog */
-       dhd_bus_watchdog(&dhd->pub);
-       /* Count the tick for reference */
-       dhd->pub.tickcnt++;
-       /* Reschedule the watchdog */
-       if (dhd->wd_timer_valid)
-               mod_timer(&dhd->timer, jiffies + dhd_watchdog_ms * HZ / 1000);
- }
- static int dhd_dpc_thread(void *data)
- {
-       dhd_info_t *dhd = (dhd_info_t *) data;
-       /* This thread doesn't need any user-level access,
-        * so get rid of all our resources
-        */
- #ifdef DHD_SCHED
-       if (dhd_dpc_prio > 0) {
-               struct sched_param param;
-               param.sched_priority =
-                   (dhd_dpc_prio <
-                    MAX_RT_PRIO) ? dhd_dpc_prio : (MAX_RT_PRIO - 1);
-               setScheduler(current, SCHED_FIFO, &param);
-       }
- #endif                                /* DHD_SCHED */
-       allow_signal(SIGTERM);
-       /* Run until signal received */
-       while (1) {
-               if (kthread_should_stop())
-                       break;
-               if (down_interruptible(&dhd->dpc_sem) == 0) {
-                       /* Call bus dpc unless it indicated down
-                                (then clean stop) */
-                       if (dhd->pub.busstate != DHD_BUS_DOWN) {
-                               if (dhd_bus_dpc(dhd->pub.bus)) {
-                                       up(&dhd->dpc_sem);
-                               }
-                       } else {
-                               dhd_bus_stop(dhd->pub.bus, true);
-                       }
-               } else
-                       break;
-       }
-       return 0;
- }
- static void dhd_dpc(unsigned long data)
- {
-       dhd_info_t *dhd;
-       dhd = (dhd_info_t *) data;
-       /* Call bus dpc unless it indicated down (then clean stop) */
-       if (dhd->pub.busstate != DHD_BUS_DOWN) {
-               if (dhd_bus_dpc(dhd->pub.bus))
-                       tasklet_schedule(&dhd->tasklet);
-       } else {
-               dhd_bus_stop(dhd->pub.bus, true);
-       }
- }
- void dhd_sched_dpc(dhd_pub_t *dhdp)
- {
-       dhd_info_t *dhd = (dhd_info_t *) dhdp->info;
-       if (dhd->dpc_tsk) {
-               up(&dhd->dpc_sem);
-               return;
-       }
-       tasklet_schedule(&dhd->tasklet);
- }
- #ifdef TOE
  /* Retrieve current toe component enables, which are kept
         as a bitmap in toe_ol iovar */
- static int dhd_toe_get(dhd_info_t *dhd, int ifidx, u32 *toe_ol)
+ static int brcmf_toe_get(struct brcmf_info *drvr_priv, int ifidx, u32 *toe_ol)
  {
-       wl_ioctl_t ioc;
+       struct brcmf_ioctl ioc;
        char buf[32];
        int ret;
  
        memset(&ioc, 0, sizeof(ioc));
  
-       ioc.cmd = WLC_GET_VAR;
+       ioc.cmd = BRCMF_C_GET_VAR;
        ioc.buf = buf;
        ioc.len = (uint) sizeof(buf);
        ioc.set = false;
  
        strcpy(buf, "toe_ol");
-       ret = dhd_prot_ioctl(&dhd->pub, ifidx, &ioc, ioc.buf, ioc.len);
+       ret = brcmf_proto_ioctl(&drvr_priv->pub, ifidx, &ioc, ioc.buf, ioc.len);
        if (ret < 0) {
                /* Check for older dongle image that doesn't support toe_ol */
                if (ret == -EIO) {
-                       DHD_ERROR(("%s: toe not supported by device\n",
-                                  dhd_ifname(&dhd->pub, ifidx)));
+                       BRCMF_ERROR(("%s: toe not supported by device\n",
+                                    brcmf_ifname(&drvr_priv->pub, ifidx)));
                        return -EOPNOTSUPP;
                }
  
-               DHD_INFO(("%s: could not get toe_ol: ret=%d\n",
-                         dhd_ifname(&dhd->pub, ifidx), ret));
+               BRCMF_INFO(("%s: could not get toe_ol: ret=%d\n",
+                           brcmf_ifname(&drvr_priv->pub, ifidx), ret));
                return ret;
        }
  
  
  /* Set current toe component enables in toe_ol iovar,
         and set toe global enable iovar */
- static int dhd_toe_set(dhd_info_t *dhd, int ifidx, u32 toe_ol)
+ static int brcmf_toe_set(struct brcmf_info *drvr_priv, int ifidx, u32 toe_ol)
  {
-       wl_ioctl_t ioc;
+       struct brcmf_ioctl ioc;
        char buf[32];
        int toe, ret;
  
        memset(&ioc, 0, sizeof(ioc));
  
-       ioc.cmd = WLC_SET_VAR;
+       ioc.cmd = BRCMF_C_SET_VAR;
        ioc.buf = buf;
        ioc.len = (uint) sizeof(buf);
        ioc.set = true;
        strcpy(buf, "toe_ol");
        memcpy(&buf[sizeof("toe_ol")], &toe_ol, sizeof(u32));
  
-       ret = dhd_prot_ioctl(&dhd->pub, ifidx, &ioc, ioc.buf, ioc.len);
+       ret = brcmf_proto_ioctl(&drvr_priv->pub, ifidx, &ioc, ioc.buf, ioc.len);
        if (ret < 0) {
-               DHD_ERROR(("%s: could not set toe_ol: ret=%d\n",
-                          dhd_ifname(&dhd->pub, ifidx), ret));
+               BRCMF_ERROR(("%s: could not set toe_ol: ret=%d\n",
+                            brcmf_ifname(&drvr_priv->pub, ifidx), ret));
                return ret;
        }
  
        strcpy(buf, "toe");
        memcpy(&buf[sizeof("toe")], &toe, sizeof(u32));
  
-       ret = dhd_prot_ioctl(&dhd->pub, ifidx, &ioc, ioc.buf, ioc.len);
+       ret = brcmf_proto_ioctl(&drvr_priv->pub, ifidx, &ioc, ioc.buf, ioc.len);
        if (ret < 0) {
-               DHD_ERROR(("%s: could not set toe: ret=%d\n",
-                          dhd_ifname(&dhd->pub, ifidx), ret));
+               BRCMF_ERROR(("%s: could not set toe: ret=%d\n",
+                            brcmf_ifname(&drvr_priv->pub, ifidx), ret));
                return ret;
        }
  
        return 0;
  }
- #endif                                /* TOE */
  
- static void dhd_ethtool_get_drvinfo(struct net_device *net,
+ static void brcmf_ethtool_get_drvinfo(struct net_device *net,
                                    struct ethtool_drvinfo *info)
  {
-       dhd_info_t *dhd = *(dhd_info_t **) netdev_priv(net);
+       struct brcmf_info *drvr_priv = *(struct brcmf_info **) netdev_priv(net);
  
-       sprintf(info->driver, DRV_MODULE_NAME);
-       sprintf(info->version, "%lu", dhd->pub.drv_version);
-       sprintf(info->fw_version, "%s", wl_cfg80211_get_fwname());
-       sprintf(info->bus_info, "%s", dev_name(&wl_cfg80211_get_sdio_func()->dev));
+       sprintf(info->driver, KBUILD_MODNAME);
+       sprintf(info->version, "%lu", drvr_priv->pub.drv_version);
+       sprintf(info->fw_version, "%s", BCM4329_FW_NAME);
+       sprintf(info->bus_info, "%s",
+               dev_name(&brcmf_cfg80211_get_sdio_func()->dev));
  }
  
- struct ethtool_ops dhd_ethtool_ops = {
-       .get_drvinfo = dhd_ethtool_get_drvinfo
+ struct ethtool_ops brcmf_ethtool_ops = {
+       .get_drvinfo = brcmf_ethtool_get_drvinfo
  };
  
- static int dhd_ethtool(dhd_info_t *dhd, void *uaddr)
+ static int brcmf_ethtool(struct brcmf_info *drvr_priv, void *uaddr)
  {
        struct ethtool_drvinfo info;
        char drvname[sizeof(info.driver)];
        u32 cmd;
- #ifdef TOE
        struct ethtool_value edata;
        u32 toe_cmpnt, csum_dir;
        int ret;
- #endif
  
-       DHD_TRACE(("%s: Enter\n", __func__));
+       BRCMF_TRACE(("%s: Enter\n", __func__));
  
        /* all ethtool calls start with a cmd word */
        if (copy_from_user(&cmd, uaddr, sizeof(u32)))
                memset(&info, 0, sizeof(info));
                info.cmd = cmd;
  
-               /* if dhd requested, identify ourselves */
+               /* if requested, identify ourselves */
                if (strcmp(drvname, "?dhd") == 0) {
                        sprintf(info.driver, "dhd");
-                       strcpy(info.version, EPI_VERSION_STR);
+                       strcpy(info.version, BRCMF_VERSION_STR);
                }
  
                /* otherwise, require dongle to be up */
-               else if (!dhd->pub.up) {
-                       DHD_ERROR(("%s: dongle is not up\n", __func__));
+               else if (!drvr_priv->pub.up) {
+                       BRCMF_ERROR(("%s: dongle is not up\n", __func__));
                        return -ENODEV;
                }
  
                /* finally, report dongle driver type */
-               else if (dhd->pub.iswl)
+               else if (drvr_priv->pub.iswl)
                        sprintf(info.driver, "wl");
                else
                        sprintf(info.driver, "xx");
  
-               sprintf(info.version, "%lu", dhd->pub.drv_version);
+               sprintf(info.version, "%lu", drvr_priv->pub.drv_version);
                if (copy_to_user(uaddr, &info, sizeof(info)))
                        return -EFAULT;
-               DHD_CTL(("%s: given %*s, returning %s\n", __func__,
-                        (int)sizeof(drvname), drvname, info.driver));
+               BRCMF_CTL(("%s: given %*s, returning %s\n", __func__,
+                          (int)sizeof(drvname), drvname, info.driver));
                break;
  
- #ifdef TOE
                /* Get toe offload components from dongle */
        case ETHTOOL_GRXCSUM:
        case ETHTOOL_GTXCSUM:
-               ret = dhd_toe_get(dhd, 0, &toe_cmpnt);
+               ret = brcmf_toe_get(drvr_priv, 0, &toe_cmpnt);
                if (ret < 0)
                        return ret;
  
                        return -EFAULT;
  
                /* Read the current settings, update and write back */
-               ret = dhd_toe_get(dhd, 0, &toe_cmpnt);
+               ret = brcmf_toe_get(drvr_priv, 0, &toe_cmpnt);
                if (ret < 0)
                        return ret;
  
                else
                        toe_cmpnt &= ~csum_dir;
  
-               ret = dhd_toe_set(dhd, 0, toe_cmpnt);
+               ret = brcmf_toe_set(drvr_priv, 0, toe_cmpnt);
                if (ret < 0)
                        return ret;
  
                /* If setting TX checksum mode, tell Linux the new mode */
                if (cmd == ETHTOOL_STXCSUM) {
                        if (edata.data)
-                               dhd->iflist[0]->net->features |=
+                               drvr_priv->iflist[0]->net->features |=
                                    NETIF_F_IP_CSUM;
                        else
-                               dhd->iflist[0]->net->features &=
+                               drvr_priv->iflist[0]->net->features &=
                                    ~NETIF_F_IP_CSUM;
                }
  
                break;
- #endif                                /* TOE */
  
        default:
                return -EOPNOTSUPP;
        return 0;
  }
  
- static int dhd_ioctl_entry(struct net_device *net, struct ifreq *ifr, int cmd)
+ static int brcmf_netdev_ioctl_entry(struct net_device *net, struct ifreq *ifr,
+                                   int cmd)
  {
-       dhd_info_t *dhd = *(dhd_info_t **) netdev_priv(net);
-       dhd_ioctl_t ioc;
+       struct brcmf_info *drvr_priv = *(struct brcmf_info **) netdev_priv(net);
+       struct brcmf_c_ioctl ioc;
        int bcmerror = 0;
        int buflen = 0;
        void *buf = NULL;
        int ifidx;
        bool is_set_key_cmd;
  
-       ifidx = dhd_net2idx(dhd, net);
-       DHD_TRACE(("%s: ifidx %d, cmd 0x%04x\n", __func__, ifidx, cmd));
+       ifidx = brcmf_net2idx(drvr_priv, net);
+       BRCMF_TRACE(("%s: ifidx %d, cmd 0x%04x\n", __func__, ifidx, cmd));
  
-       if (ifidx == DHD_BAD_IF)
+       if (ifidx == BRCMF_BAD_IF)
                return -1;
  
- #if defined(CONFIG_WIRELESS_EXT)
-       /* linux wireless extensions */
-       if ((cmd >= SIOCIWFIRST) && (cmd <= SIOCIWLAST)) {
-               /* may recurse, do NOT lock */
-               return wl_iw_ioctl(net, ifr, cmd);
-       }
- #endif                                /* defined(CONFIG_WIRELESS_EXT) */
        if (cmd == SIOCETHTOOL)
-               return dhd_ethtool(dhd, (void *)ifr->ifr_data);
+               return brcmf_ethtool(drvr_priv, (void *)ifr->ifr_data);
  
        if (cmd != SIOCDEVPRIVATE)
                return -EOPNOTSUPP;
        memset(&ioc, 0, sizeof(ioc));
  
        /* Copy the ioc control structure part of ioctl request */
-       if (copy_from_user(&ioc, ifr->ifr_data, sizeof(wl_ioctl_t))) {
+       if (copy_from_user(&ioc, ifr->ifr_data, sizeof(struct brcmf_ioctl))) {
                bcmerror = -EINVAL;
                goto done;
        }
  
        /* Copy out any buffer passed */
        if (ioc.buf) {
-               buflen = min_t(int, ioc.len, DHD_IOCTL_MAXLEN);
+               buflen = min_t(int, ioc.len, BRCMF_IOCTL_MAXLEN);
                /* optimization for direct ioctl calls from kernel */
                /*
                   if (segment_eq(get_fs(), KERNEL_DS)) {
                }
        }
  
-       /* To differentiate between wl and dhd read 4 more byes */
-       if ((copy_from_user(&driver, (char *)ifr->ifr_data + sizeof(wl_ioctl_t),
-                           sizeof(uint)) != 0)) {
+       /* To differentiate read 4 more byes */
+       if ((copy_from_user(&driver, (char *)ifr->ifr_data +
+                           sizeof(struct brcmf_ioctl), sizeof(uint)) != 0)) {
                bcmerror = -EINVAL;
                goto done;
        }
                goto done;
        }
  
-       /* check for local dhd ioctl and handle it */
-       if (driver == DHD_IOCTL_MAGIC) {
-               bcmerror = dhd_ioctl((void *)&dhd->pub, &ioc, buf, buflen);
+       /* check for local brcmf ioctl and handle it */
+       if (driver == BRCMF_IOCTL_MAGIC) {
+               bcmerror = brcmf_c_ioctl((void *)&drvr_priv->pub, &ioc, buf, buflen);
                if (bcmerror)
-                       dhd->pub.bcmerror = bcmerror;
+                       drvr_priv->pub.bcmerror = bcmerror;
                goto done;
        }
  
        /* send to dongle (must be up, and wl) */
-       if ((dhd->pub.busstate != DHD_BUS_DATA)) {
-               DHD_ERROR(("%s DONGLE_DOWN,__func__\n", __func__));
+       if ((drvr_priv->pub.busstate != BRCMF_BUS_DATA)) {
+               BRCMF_ERROR(("%s DONGLE_DOWN,__func__\n", __func__));
                bcmerror = -EIO;
                goto done;
        }
  
-       if (!dhd->pub.iswl) {
+       if (!drvr_priv->pub.iswl) {
                bcmerror = -EIO;
                goto done;
        }
  
-       /* Intercept WLC_SET_KEY IOCTL - serialize M4 send and set key IOCTL to
-        * prevent M4 encryption.
+       /*
+        * Intercept BRCMF_C_SET_KEY IOCTL - serialize M4 send and
+        * set key IOCTL to prevent M4 encryption.
         */
-       is_set_key_cmd = ((ioc.cmd == WLC_SET_KEY) ||
-                         ((ioc.cmd == WLC_SET_VAR) &&
+       is_set_key_cmd = ((ioc.cmd == BRCMF_C_SET_KEY) ||
+                         ((ioc.cmd == BRCMF_C_SET_VAR) &&
                           !(strncmp("wsec_key", ioc.buf, 9))) ||
-                         ((ioc.cmd == WLC_SET_VAR) &&
+                         ((ioc.cmd == BRCMF_C_SET_VAR) &&
                           !(strncmp("bsscfg:wsec_key", ioc.buf, 15))));
        if (is_set_key_cmd)
-               dhd_wait_pend8021x(net);
+               brcmf_netdev_wait_pend8021x(net);
  
        bcmerror =
-           dhd_prot_ioctl(&dhd->pub, ifidx, (wl_ioctl_t *)&ioc, buf, buflen);
+           brcmf_proto_ioctl(&drvr_priv->pub, ifidx, (struct brcmf_ioctl *)&ioc,
+                             buf, buflen);
  
  done:
        if (!bcmerror && buf && ioc.buf) {
        return bcmerror;
  }
  
- static int dhd_stop(struct net_device *net)
+ static int brcmf_netdev_stop(struct net_device *net)
  {
  #if !defined(IGNORE_ETH0_DOWN)
-       dhd_info_t *dhd = *(dhd_info_t **) netdev_priv(net);
+       struct brcmf_info *drvr_priv = *(struct brcmf_info **) netdev_priv(net);
  
-       DHD_TRACE(("%s: Enter\n", __func__));
-       if (IS_CFG80211_FAVORITE()) {
-               wl_cfg80211_down();
-       }
-       if (dhd->pub.up == 0)
+       BRCMF_TRACE(("%s: Enter\n", __func__));
+       brcmf_cfg80211_down();
+       if (drvr_priv->pub.up == 0)
                return 0;
  
        /* Set state and stop OS transmissions */
-       dhd->pub.up = 0;
+       drvr_priv->pub.up = 0;
        netif_stop_queue(net);
  #else
-       DHD_ERROR(("BYPASS %s:due to BRCM compilation : under investigation\n",
-               __func__));
+       BRCMF_ERROR(("BYPASS %s:due to BRCM compilation: under investigation\n",
+                    __func__));
  #endif                                /* !defined(IGNORE_ETH0_DOWN) */
  
        return 0;
  }
  
- static int dhd_open(struct net_device *net)
+ static int brcmf_netdev_open(struct net_device *net)
  {
-       dhd_info_t *dhd = *(dhd_info_t **) netdev_priv(net);
- #ifdef TOE
+       struct brcmf_info *drvr_priv = *(struct brcmf_info **) netdev_priv(net);
        u32 toe_ol;
- #endif
-       int ifidx = dhd_net2idx(dhd, net);
+       int ifidx = brcmf_net2idx(drvr_priv, net);
        s32 ret = 0;
  
-       DHD_TRACE(("%s: ifidx %d\n", __func__, ifidx));
+       BRCMF_TRACE(("%s: ifidx %d\n", __func__, ifidx));
  
        if (ifidx == 0) {       /* do it only for primary eth0 */
  
                /* try to bring up bus */
-               ret = dhd_bus_start(&dhd->pub);
+               ret = brcmf_bus_start(&drvr_priv->pub);
                if (ret != 0) {
-                       DHD_ERROR(("%s: failed with code %d\n", __func__, ret));
+                       BRCMF_ERROR(("%s: failed with code %d\n",
+                                    __func__, ret));
                        return -1;
                }
-               atomic_set(&dhd->pend_8021x_cnt, 0);
+               atomic_set(&drvr_priv->pend_8021x_cnt, 0);
  
-               memcpy(net->dev_addr, dhd->pub.mac, ETH_ALEN);
+               memcpy(net->dev_addr, drvr_priv->pub.mac, ETH_ALEN);
  
- #ifdef TOE
                /* Get current TOE mode from dongle */
-               if (dhd_toe_get(dhd, ifidx, &toe_ol) >= 0
+               if (brcmf_toe_get(drvr_priv, ifidx, &toe_ol) >= 0
                    && (toe_ol & TOE_TX_CSUM_OL) != 0)
-                       dhd->iflist[ifidx]->net->features |= NETIF_F_IP_CSUM;
+                       drvr_priv->iflist[ifidx]->net->features |=
+                               NETIF_F_IP_CSUM;
                else
-                       dhd->iflist[ifidx]->net->features &= ~NETIF_F_IP_CSUM;
- #endif
+                       drvr_priv->iflist[ifidx]->net->features &=
+                               ~NETIF_F_IP_CSUM;
        }
        /* Allow transmit calls */
        netif_start_queue(net);
-       dhd->pub.up = 1;
-       if (IS_CFG80211_FAVORITE()) {
-               if (unlikely(wl_cfg80211_up())) {
-                       DHD_ERROR(("%s: failed to bring up cfg80211\n",
-                                  __func__));
-                       return -1;
-               }
+       drvr_priv->pub.up = 1;
+       if (unlikely(brcmf_cfg80211_up())) {
+               BRCMF_ERROR(("%s: failed to bring up cfg80211\n",
+                            __func__));
+               return -1;
        }
  
        return ret;
  }
  
  int
dhd_add_if(dhd_info_t *dhd, int ifidx, void *handle, char *name,
brcmf_add_if(struct brcmf_info *drvr_priv, int ifidx, void *handle, char *name,
           u8 *mac_addr, u32 flags, u8 bssidx)
  {
-       dhd_if_t *ifp;
-       DHD_TRACE(("%s: idx %d, handle->%p\n", __func__, ifidx, handle));
+       struct brcmf_if *ifp;
  
-       ASSERT(dhd && (ifidx < DHD_MAX_IFS));
+       BRCMF_TRACE(("%s: idx %d, handle->%p\n", __func__, ifidx, handle));
  
-       ifp = dhd->iflist[ifidx];
-       if (!ifp && !(ifp = kmalloc(sizeof(dhd_if_t), GFP_ATOMIC))) {
-               DHD_ERROR(("%s: OOM - dhd_if_t\n", __func__));
-               return -ENOMEM;
+       ifp = drvr_priv->iflist[ifidx];
+       if (!ifp) {
+               ifp = kmalloc(sizeof(struct brcmf_if), GFP_ATOMIC);
+               if (!ifp) {
+                       BRCMF_ERROR(("%s: OOM - struct brcmf_if\n", __func__));
+                       return -ENOMEM;
+               }
        }
  
-       memset(ifp, 0, sizeof(dhd_if_t));
-       ifp->info = dhd;
-       dhd->iflist[ifidx] = ifp;
+       memset(ifp, 0, sizeof(struct brcmf_if));
+       ifp->info = drvr_priv;
+       drvr_priv->iflist[ifidx] = ifp;
        strlcpy(ifp->name, name, IFNAMSIZ);
        if (mac_addr != NULL)
                memcpy(&ifp->mac_addr, mac_addr, ETH_ALEN);
  
        if (handle == NULL) {
-               ifp->state = WLC_E_IF_ADD;
+               ifp->state = BRCMF_E_IF_ADD;
                ifp->idx = ifidx;
-               ASSERT(dhd->sysioc_tsk);
-               up(&dhd->sysioc_sem);
+               up(&drvr_priv->sysioc_sem);
        } else
                ifp->net = (struct net_device *)handle;
  
        return 0;
  }
  
- void dhd_del_if(dhd_info_t *dhd, int ifidx)
+ void brcmf_del_if(struct brcmf_info *drvr_priv, int ifidx)
  {
-       dhd_if_t *ifp;
+       struct brcmf_if *ifp;
  
-       DHD_TRACE(("%s: idx %d\n", __func__, ifidx));
+       BRCMF_TRACE(("%s: idx %d\n", __func__, ifidx));
  
-       ASSERT(dhd && ifidx && (ifidx < DHD_MAX_IFS));
-       ifp = dhd->iflist[ifidx];
+       ifp = drvr_priv->iflist[ifidx];
        if (!ifp) {
-               DHD_ERROR(("%s: Null interface\n", __func__));
+               BRCMF_ERROR(("%s: Null interface\n", __func__));
                return;
        }
  
-       ifp->state = WLC_E_IF_DEL;
+       ifp->state = BRCMF_E_IF_DEL;
        ifp->idx = ifidx;
-       ASSERT(dhd->sysioc_tsk);
-       up(&dhd->sysioc_sem);
+       up(&drvr_priv->sysioc_sem);
  }
  
dhd_pub_t *dhd_attach(struct dhd_bus *bus, uint bus_hdrlen)
struct brcmf_pub *brcmf_attach(struct brcmf_bus *bus, uint bus_hdrlen)
  {
-       dhd_info_t *dhd = NULL;
+       struct brcmf_info *drvr_priv = NULL;
        struct net_device *net;
  
-       DHD_TRACE(("%s: Enter\n", __func__));
-       /* updates firmware nvram path if it was provided as module
-                paramters */
-       if ((firmware_path != NULL) && (firmware_path[0] != '\0'))
-               strcpy(fw_path, firmware_path);
-       if ((nvram_path != NULL) && (nvram_path[0] != '\0'))
-               strcpy(nv_path, nvram_path);
+       BRCMF_TRACE(("%s: Enter\n", __func__));
  
        /* Allocate etherdev, including space for private structure */
-       net = alloc_etherdev(sizeof(dhd));
+       net = alloc_etherdev(sizeof(drvr_priv));
        if (!net) {
-               DHD_ERROR(("%s: OOM - alloc_etherdev\n", __func__));
+               BRCMF_ERROR(("%s: OOM - alloc_etherdev\n", __func__));
                goto fail;
        }
  
-       /* Allocate primary dhd_info */
-       dhd = kzalloc(sizeof(dhd_info_t), GFP_ATOMIC);
-       if (!dhd) {
-               DHD_ERROR(("%s: OOM - alloc dhd_info\n", __func__));
+       /* Allocate primary brcmf_info */
+       drvr_priv = kzalloc(sizeof(struct brcmf_info), GFP_ATOMIC);
+       if (!drvr_priv) {
+               BRCMF_ERROR(("%s: OOM - alloc brcmf_info\n", __func__));
                goto fail;
        }
  
        /*
-        * Save the dhd_info into the priv
+        * Save the brcmf_info into the priv
         */
-       memcpy(netdev_priv(net), &dhd, sizeof(dhd));
+       memcpy(netdev_priv(net), &drvr_priv, sizeof(drvr_priv));
  
        /* Set network interface name if it was provided as module parameter */
        if (iface_name[0]) {
                        strcat(net->name, "%d");
        }
  
-       if (dhd_add_if(dhd, 0, (void *)net, net->name, NULL, 0, 0) ==
-           DHD_BAD_IF)
+       if (brcmf_add_if(drvr_priv, 0, (void *)net, net->name, NULL, 0, 0) ==
+           BRCMF_BAD_IF)
                goto fail;
  
        net->netdev_ops = NULL;
-       sema_init(&dhd->proto_sem, 1);
+       sema_init(&drvr_priv->proto_sem, 1);
        /* Initialize other structure content */
-       init_waitqueue_head(&dhd->ioctl_resp_wait);
-       init_waitqueue_head(&dhd->ctrl_wait);
-       /* Initialize the spinlocks */
-       spin_lock_init(&dhd->sdlock);
-       spin_lock_init(&dhd->txqlock);
+       init_waitqueue_head(&drvr_priv->ioctl_resp_wait);
  
        /* Link to info module */
-       dhd->pub.info = dhd;
+       drvr_priv->pub.info = drvr_priv;
  
        /* Link to bus module */
-       dhd->pub.bus = bus;
-       dhd->pub.hdrlen = bus_hdrlen;
+       drvr_priv->pub.bus = bus;
+       drvr_priv->pub.hdrlen = bus_hdrlen;
  
        /* Attach and link in the protocol */
-       if (dhd_prot_attach(&dhd->pub) != 0) {
-               DHD_ERROR(("dhd_prot_attach failed\n"));
+       if (brcmf_proto_attach(&drvr_priv->pub) != 0) {
+               BRCMF_ERROR(("brcmf_prot_attach failed\n"));
                goto fail;
        }
- #if defined(CONFIG_WIRELESS_EXT)
-       /* Attach and link in the iw */
-       if (wl_iw_attach(net, (void *)&dhd->pub) != 0) {
-               DHD_ERROR(("wl_iw_attach failed\n"));
-               goto fail;
-       }
- #endif        /* defined(CONFIG_WIRELESS_EXT) */
  
        /* Attach and link in the cfg80211 */
-       if (IS_CFG80211_FAVORITE()) {
-               if (unlikely(wl_cfg80211_attach(net, &dhd->pub))) {
-                       DHD_ERROR(("wl_cfg80211_attach failed\n"));
-                       goto fail;
-               }
-               if (!NO_FW_REQ()) {
-                       strcpy(fw_path, wl_cfg80211_get_fwname());
-                       strcpy(nv_path, wl_cfg80211_get_nvramname());
-               }
-       }
-       /* Set up the watchdog timer */
-       init_timer(&dhd->timer);
-       dhd->timer.data = (unsigned long) dhd;
-       dhd->timer.function = dhd_watchdog;
-       /* Initialize thread based operation and lock */
-       sema_init(&dhd->sdsem, 1);
-       if ((dhd_watchdog_prio >= 0) && (dhd_dpc_prio >= 0))
-               dhd->threads_only = true;
-       else
-               dhd->threads_only = false;
-       if (dhd_dpc_prio >= 0) {
-               /* Initialize watchdog thread */
-               sema_init(&dhd->watchdog_sem, 0);
-               dhd->watchdog_tsk = kthread_run(dhd_watchdog_thread, dhd,
-                                               "dhd_watchdog");
-               if (IS_ERR(dhd->watchdog_tsk)) {
-                       printk(KERN_WARNING
-                               "dhd_watchdog thread failed to start\n");
-                       dhd->watchdog_tsk = NULL;
-               }
-       } else {
-               dhd->watchdog_tsk = NULL;
-       }
-       /* Set up the bottom half handler */
-       if (dhd_dpc_prio >= 0) {
-               /* Initialize DPC thread */
-               sema_init(&dhd->dpc_sem, 0);
-               dhd->dpc_tsk = kthread_run(dhd_dpc_thread, dhd, "dhd_dpc");
-               if (IS_ERR(dhd->dpc_tsk)) {
-                       printk(KERN_WARNING
-                               "dhd_dpc thread failed to start\n");
-                       dhd->dpc_tsk = NULL;
-               }
-       } else {
-               tasklet_init(&dhd->tasklet, dhd_dpc, (unsigned long) dhd);
-               dhd->dpc_tsk = NULL;
+       if (unlikely(brcmf_cfg80211_attach(net, &drvr_priv->pub))) {
+               BRCMF_ERROR(("wl_cfg80211_attach failed\n"));
+               goto fail;
        }
  
-       if (dhd_sysioc) {
-               sema_init(&dhd->sysioc_sem, 0);
-               dhd->sysioc_tsk = kthread_run(_dhd_sysioc_thread, dhd,
-                                               "_dhd_sysioc");
-               if (IS_ERR(dhd->sysioc_tsk)) {
+       if (brcmf_sysioc) {
+               sema_init(&drvr_priv->sysioc_sem, 0);
+               drvr_priv->sysioc_tsk = kthread_run(_brcmf_sysioc_thread, drvr_priv,
+                                               "_brcmf_sysioc");
+               if (IS_ERR(drvr_priv->sysioc_tsk)) {
                        printk(KERN_WARNING
-                               "_dhd_sysioc thread failed to start\n");
-                       dhd->sysioc_tsk = NULL;
+                               "_brcmf_sysioc thread failed to start\n");
+                       drvr_priv->sysioc_tsk = NULL;
                }
        } else
-               dhd->sysioc_tsk = NULL;
+               drvr_priv->sysioc_tsk = NULL;
  
        /*
-        * Save the dhd_info into the priv
+        * Save the brcmf_info into the priv
         */
-       memcpy(netdev_priv(net), &dhd, sizeof(dhd));
+       memcpy(netdev_priv(net), &drvr_priv, sizeof(drvr_priv));
  
- #if defined(CUSTOMER_HW2) && defined(CONFIG_WIFI_CONTROL_FUNC)
-       g_bus = bus;
- #endif
  #if defined(CONFIG_PM_SLEEP)
-       atomic_set(&dhd_mmc_suspend, false);
-       if (!IS_CFG80211_FAVORITE())
-               register_pm_notifier(&dhd_sleep_pm_notifier);
+       atomic_set(&brcmf_mmc_suspend, false);
  #endif        /* defined(CONFIG_PM_SLEEP) */
-       /* && defined(DHD_GPL) */
-       /* Init lock suspend to prevent kernel going to suspend */
- #ifdef CONFIG_HAS_EARLYSUSPEND
-       dhd->early_suspend.level = EARLY_SUSPEND_LEVEL_BLANK_SCREEN + 20;
-       dhd->early_suspend.suspend = dhd_early_suspend;
-       dhd->early_suspend.resume = dhd_late_resume;
-       register_early_suspend(&dhd->early_suspend);
- #endif
-       return &dhd->pub;
+       return &drvr_priv->pub;
  
  fail:
        if (net)
                free_netdev(net);
-       if (dhd)
-               dhd_detach(&dhd->pub);
+       if (drvr_priv)
+               brcmf_detach(&drvr_priv->pub);
  
        return NULL;
  }
  
- int dhd_bus_start(dhd_pub_t *dhdp)
+ int brcmf_bus_start(struct brcmf_pub *drvr)
  {
        int ret = -1;
-       dhd_info_t *dhd = (dhd_info_t *) dhdp->info;
- #ifdef EMBEDDED_PLATFORM
-       char iovbuf[WL_EVENTING_MASK_LEN + 12]; /*  Room for "event_msgs" +
-                                                '\0' + bitvec  */
- #endif                                /* EMBEDDED_PLATFORM */
-       ASSERT(dhd);
-       DHD_TRACE(("%s:\n", __func__));
-       /* try to download image and nvram to the dongle */
-       if (dhd->pub.busstate == DHD_BUS_DOWN) {
-               if (!(dhd_bus_download_firmware(dhd->pub.bus,
-                                               fw_path, nv_path))) {
-                       DHD_ERROR(("%s: dhdsdio_probe_download failed. "
-                               "firmware = %s nvram = %s\n",
-                               __func__, fw_path, nv_path));
-                       return -1;
-               }
-       }
+       struct brcmf_info *drvr_priv = drvr->info;
+       /* Room for "event_msgs" + '\0' + bitvec */
+       char iovbuf[BRCMF_EVENTING_MASK_LEN + 12];
  
-       /* Start the watchdog timer */
-       dhd->pub.tickcnt = 0;
-       dhd_os_wd_timer(&dhd->pub, dhd_watchdog_ms);
+       BRCMF_TRACE(("%s:\n", __func__));
  
        /* Bring up the bus */
-       ret = dhd_bus_init(&dhd->pub, true);
+       ret = brcmf_sdbrcm_bus_init(&drvr_priv->pub, true);
        if (ret != 0) {
-               DHD_ERROR(("%s, dhd_bus_init failed %d\n", __func__, ret));
+               BRCMF_ERROR(("%s, brcmf_sdbrcm_bus_init failed %d\n", __func__,
+                            ret));
                return ret;
        }
- #if defined(OOB_INTR_ONLY)
-       /* Host registration for OOB interrupt */
-       if (bcmsdh_register_oob_intr(dhdp)) {
-               del_timer_sync(&dhd->timer);
-               dhd->wd_timer_valid = false;
-               DHD_ERROR(("%s Host failed to resgister for OOB\n", __func__));
-               return -ENODEV;
-       }
-       /* Enable oob at firmware */
-       dhd_enable_oob_intr(dhd->pub.bus, true);
- #endif                                /* defined(OOB_INTR_ONLY) */
  
        /* If bus is not ready, can't come up */
-       if (dhd->pub.busstate != DHD_BUS_DATA) {
-               del_timer_sync(&dhd->timer);
-               dhd->wd_timer_valid = false;
-               DHD_ERROR(("%s failed bus is not ready\n", __func__));
+       if (drvr_priv->pub.busstate != BRCMF_BUS_DATA) {
+               BRCMF_ERROR(("%s failed bus is not ready\n", __func__));
                return -ENODEV;
        }
- #ifdef EMBEDDED_PLATFORM
-       bcm_mkiovar("event_msgs", dhdp->eventmask, WL_EVENTING_MASK_LEN, iovbuf,
-                   sizeof(iovbuf));
-       dhdcdc_query_ioctl(dhdp, 0, WLC_GET_VAR, iovbuf, sizeof(iovbuf));
-       memcpy(dhdp->eventmask, iovbuf, WL_EVENTING_MASK_LEN);
-       setbit(dhdp->eventmask, WLC_E_SET_SSID);
-       setbit(dhdp->eventmask, WLC_E_PRUNE);
-       setbit(dhdp->eventmask, WLC_E_AUTH);
-       setbit(dhdp->eventmask, WLC_E_REASSOC);
-       setbit(dhdp->eventmask, WLC_E_REASSOC_IND);
-       setbit(dhdp->eventmask, WLC_E_DEAUTH_IND);
-       setbit(dhdp->eventmask, WLC_E_DISASSOC_IND);
-       setbit(dhdp->eventmask, WLC_E_DISASSOC);
-       setbit(dhdp->eventmask, WLC_E_JOIN);
-       setbit(dhdp->eventmask, WLC_E_ASSOC_IND);
-       setbit(dhdp->eventmask, WLC_E_PSK_SUP);
-       setbit(dhdp->eventmask, WLC_E_LINK);
-       setbit(dhdp->eventmask, WLC_E_NDIS_LINK);
-       setbit(dhdp->eventmask, WLC_E_MIC_ERROR);
-       setbit(dhdp->eventmask, WLC_E_PMKID_CACHE);
-       setbit(dhdp->eventmask, WLC_E_TXFAIL);
-       setbit(dhdp->eventmask, WLC_E_JOIN_START);
-       setbit(dhdp->eventmask, WLC_E_SCAN_COMPLETE);
- #ifdef PNO_SUPPORT
-       setbit(dhdp->eventmask, WLC_E_PFN_NET_FOUND);
- #endif                                /* PNO_SUPPORT */
+       brcmu_mkiovar("event_msgs", drvr->eventmask, BRCMF_EVENTING_MASK_LEN,
+                     iovbuf, sizeof(iovbuf));
+       brcmf_proto_cdc_query_ioctl(drvr, 0, BRCMF_C_GET_VAR, iovbuf,
+                                   sizeof(iovbuf));
+       memcpy(drvr->eventmask, iovbuf, BRCMF_EVENTING_MASK_LEN);
+       setbit(drvr->eventmask, BRCMF_E_SET_SSID);
+       setbit(drvr->eventmask, BRCMF_E_PRUNE);
+       setbit(drvr->eventmask, BRCMF_E_AUTH);
+       setbit(drvr->eventmask, BRCMF_E_REASSOC);
+       setbit(drvr->eventmask, BRCMF_E_REASSOC_IND);
+       setbit(drvr->eventmask, BRCMF_E_DEAUTH_IND);
+       setbit(drvr->eventmask, BRCMF_E_DISASSOC_IND);
+       setbit(drvr->eventmask, BRCMF_E_DISASSOC);
+       setbit(drvr->eventmask, BRCMF_E_JOIN);
+       setbit(drvr->eventmask, BRCMF_E_ASSOC_IND);
+       setbit(drvr->eventmask, BRCMF_E_PSK_SUP);
+       setbit(drvr->eventmask, BRCMF_E_LINK);
+       setbit(drvr->eventmask, BRCMF_E_NDIS_LINK);
+       setbit(drvr->eventmask, BRCMF_E_MIC_ERROR);
+       setbit(drvr->eventmask, BRCMF_E_PMKID_CACHE);
+       setbit(drvr->eventmask, BRCMF_E_TXFAIL);
+       setbit(drvr->eventmask, BRCMF_E_JOIN_START);
+       setbit(drvr->eventmask, BRCMF_E_SCAN_COMPLETE);
  
  /* enable dongle roaming event */
  
-       dhdp->pktfilter_count = 1;
+       drvr->pktfilter_count = 1;
        /* Setup filter to allow only unicast */
-       dhdp->pktfilter[0] = "100 0 0 0 0x01 0x00";
- #endif                                /* EMBEDDED_PLATFORM */
+       drvr->pktfilter[0] = "100 0 0 0 0x01 0x00";
  
        /* Bus is ready, do any protocol initialization */
-       ret = dhd_prot_init(&dhd->pub);
+       ret = brcmf_proto_init(&drvr_priv->pub);
        if (ret < 0)
                return ret;
  
        return 0;
  }
  
- int
- dhd_iovar(dhd_pub_t *pub, int ifidx, char *name, char *cmd_buf, uint cmd_len,
-         int set)
- {
-       char buf[strlen(name) + 1 + cmd_len];
-       int len = sizeof(buf);
-       wl_ioctl_t ioc;
-       int ret;
-       len = bcm_mkiovar(name, cmd_buf, cmd_len, buf, len);
-       memset(&ioc, 0, sizeof(ioc));
-       ioc.cmd = set ? WLC_SET_VAR : WLC_GET_VAR;
-       ioc.buf = buf;
-       ioc.len = len;
-       ioc.set = set;
-       ret = dhd_prot_ioctl(pub, ifidx, &ioc, ioc.buf, ioc.len);
-       if (!set && ret >= 0)
-               memcpy(cmd_buf, buf, cmd_len);
-       return ret;
- }
- static struct net_device_ops dhd_ops_pri = {
-       .ndo_open = dhd_open,
-       .ndo_stop = dhd_stop,
-       .ndo_get_stats = dhd_get_stats,
-       .ndo_do_ioctl = dhd_ioctl_entry,
-       .ndo_start_xmit = dhd_start_xmit,
-       .ndo_set_mac_address = dhd_set_mac_address,
-       .ndo_set_multicast_list = dhd_set_multicast_list
+ static struct net_device_ops brcmf_netdev_ops_pri = {
+       .ndo_open = brcmf_netdev_open,
+       .ndo_stop = brcmf_netdev_stop,
+       .ndo_get_stats = brcmf_netdev_get_stats,
+       .ndo_do_ioctl = brcmf_netdev_ioctl_entry,
+       .ndo_start_xmit = brcmf_netdev_start_xmit,
+       .ndo_set_mac_address = brcmf_netdev_set_mac_address,
+       .ndo_set_multicast_list = brcmf_netdev_set_multicast_list
  };
  
- int dhd_net_attach(dhd_pub_t *dhdp, int ifidx)
+ int brcmf_net_attach(struct brcmf_pub *drvr, int ifidx)
  {
-       dhd_info_t *dhd = (dhd_info_t *) dhdp->info;
+       struct brcmf_info *drvr_priv = drvr->info;
        struct net_device *net;
        u8 temp_addr[ETH_ALEN] = {
                0x00, 0x90, 0x4c, 0x11, 0x22, 0x33};
  
-       DHD_TRACE(("%s: ifidx %d\n", __func__, ifidx));
-       ASSERT(dhd && dhd->iflist[ifidx]);
+       BRCMF_TRACE(("%s: ifidx %d\n", __func__, ifidx));
  
-       net = dhd->iflist[ifidx]->net;
-       ASSERT(net);
-       ASSERT(!net->netdev_ops);
-       net->netdev_ops = &dhd_ops_pri;
+       net = drvr_priv->iflist[ifidx]->net;
+       net->netdev_ops = &brcmf_netdev_ops_pri;
  
        /*
         * We have to use the primary MAC for virtual interfaces
         */
        if (ifidx != 0) {
                /* for virtual interfaces use the primary MAC  */
-               memcpy(temp_addr, dhd->pub.mac, ETH_ALEN);
+               memcpy(temp_addr, drvr_priv->pub.mac, ETH_ALEN);
  
        }
  
        if (ifidx == 1) {
-               DHD_TRACE(("%s ACCESS POINT MAC: \n", __func__));
+               BRCMF_TRACE(("%s ACCESS POINT MAC:\n", __func__));
                /*  ACCESSPOINT INTERFACE CASE */
                temp_addr[0] |= 0X02;   /* set bit 2 ,
                         - Locally Administered address  */
  
        }
-       net->hard_header_len = ETH_HLEN + dhd->pub.hdrlen;
-       net->ethtool_ops = &dhd_ethtool_ops;
+       net->hard_header_len = ETH_HLEN + drvr_priv->pub.hdrlen;
+       net->ethtool_ops = &brcmf_ethtool_ops;
  
-       dhd->pub.rxsz = net->mtu + net->hard_header_len + dhd->pub.hdrlen;
+       drvr_priv->pub.rxsz = net->mtu + net->hard_header_len +
+                               drvr_priv->pub.hdrlen;
  
        memcpy(net->dev_addr, temp_addr, ETH_ALEN);
  
        if (register_netdev(net) != 0) {
-               DHD_ERROR(("%s: couldn't register the net device\n",
-                       __func__));
+               BRCMF_ERROR(("%s: couldn't register the net device\n",
+                            __func__));
                goto fail;
        }
  
-       DHD_INFO(("%s: Broadcom Dongle Host Driver\n", net->name));
+       BRCMF_INFO(("%s: Broadcom Dongle Host Driver\n", net->name));
  
        return 0;
  
        return -EBADE;
  }
  
void dhd_bus_detach(dhd_pub_t *dhdp)
static void brcmf_bus_detach(struct brcmf_pub *drvr)
  {
-       dhd_info_t *dhd;
+       struct brcmf_info *drvr_priv;
  
-       DHD_TRACE(("%s: Enter\n", __func__));
+       BRCMF_TRACE(("%s: Enter\n", __func__));
  
-       if (dhdp) {
-               dhd = (dhd_info_t *) dhdp->info;
-               if (dhd) {
+       if (drvr) {
+               drvr_priv = drvr->info;
+               if (drvr_priv) {
                        /* Stop the protocol module */
-                       dhd_prot_stop(&dhd->pub);
+                       brcmf_proto_stop(&drvr_priv->pub);
  
                        /* Stop the bus module */
-                       dhd_bus_stop(dhd->pub.bus, true);
- #if defined(OOB_INTR_ONLY)
-                       bcmsdh_unregister_oob_intr();
- #endif                                /* defined(OOB_INTR_ONLY) */
-                       /* Clear the watchdog timer */
-                       del_timer_sync(&dhd->timer);
-                       dhd->wd_timer_valid = false;
+                       brcmf_sdbrcm_bus_stop(drvr_priv->pub.bus, true);
                }
        }
  }
  
- void dhd_detach(dhd_pub_t *dhdp)
+ void brcmf_detach(struct brcmf_pub *drvr)
  {
-       dhd_info_t *dhd;
+       struct brcmf_info *drvr_priv;
  
-       DHD_TRACE(("%s: Enter\n", __func__));
+       BRCMF_TRACE(("%s: Enter\n", __func__));
  
-       if (dhdp) {
-               dhd = (dhd_info_t *) dhdp->info;
-               if (dhd) {
-                       dhd_if_t *ifp;
+       if (drvr) {
+               drvr_priv = drvr->info;
+               if (drvr_priv) {
+                       struct brcmf_if *ifp;
                        int i;
  
- #if defined(CONFIG_HAS_EARLYSUSPEND)
-                       if (dhd->early_suspend.suspend)
-                               unregister_early_suspend(&dhd->early_suspend);
- #endif                                /* defined(CONFIG_HAS_EARLYSUSPEND) */
-                       for (i = 1; i < DHD_MAX_IFS; i++)
-                               if (dhd->iflist[i])
-                                       dhd_del_if(dhd, i);
+                       for (i = 1; i < BRCMF_MAX_IFS; i++)
+                               if (drvr_priv->iflist[i])
+                                       brcmf_del_if(drvr_priv, i);
  
-                       ifp = dhd->iflist[0];
-                       ASSERT(ifp);
-                       if (ifp->net->netdev_ops == &dhd_ops_pri) {
-                               dhd_stop(ifp->net);
+                       ifp = drvr_priv->iflist[0];
+                       if (ifp->net->netdev_ops == &brcmf_netdev_ops_pri) {
+                               brcmf_netdev_stop(ifp->net);
                                unregister_netdev(ifp->net);
                        }
  
-                       if (dhd->watchdog_tsk) {
-                               send_sig(SIGTERM, dhd->watchdog_tsk, 1);
-                               kthread_stop(dhd->watchdog_tsk);
-                               dhd->watchdog_tsk = NULL;
+                       if (drvr_priv->sysioc_tsk) {
+                               send_sig(SIGTERM, drvr_priv->sysioc_tsk, 1);
+                               kthread_stop(drvr_priv->sysioc_tsk);
+                               drvr_priv->sysioc_tsk = NULL;
                        }
  
-                       if (dhd->dpc_tsk) {
-                               send_sig(SIGTERM, dhd->dpc_tsk, 1);
-                               kthread_stop(dhd->dpc_tsk);
-                               dhd->dpc_tsk = NULL;
-                       } else
-                               tasklet_kill(&dhd->tasklet);
-                       if (dhd->sysioc_tsk) {
-                               send_sig(SIGTERM, dhd->sysioc_tsk, 1);
-                               kthread_stop(dhd->sysioc_tsk);
-                               dhd->sysioc_tsk = NULL;
-                       }
+                       brcmf_bus_detach(drvr);
  
-                       dhd_bus_detach(dhdp);
+                       if (drvr->prot)
+                               brcmf_proto_detach(drvr);
  
-                       if (dhdp->prot)
-                               dhd_prot_detach(dhdp);
+                       brcmf_cfg80211_detach();
  
- #if defined(CONFIG_WIRELESS_EXT)
-                       wl_iw_detach();
- #endif                                /* (CONFIG_WIRELESS_EXT) */
-                       if (IS_CFG80211_FAVORITE())
-                               wl_cfg80211_detach();
- #if defined(CONFIG_PM_SLEEP)
-                       if (!IS_CFG80211_FAVORITE())
-                               unregister_pm_notifier(&dhd_sleep_pm_notifier);
- #endif        /* defined(CONFIG_PM_SLEEP) */
-                       /* && defined(DHD_GPL) */
                        free_netdev(ifp->net);
                        kfree(ifp);
-                       kfree(dhd);
+                       kfree(drvr_priv);
                }
        }
  }
  
- static void __exit dhd_module_cleanup(void)
+ static void __exit brcmf_module_cleanup(void)
  {
-       DHD_TRACE(("%s: Enter\n", __func__));
+       BRCMF_TRACE(("%s: Enter\n", __func__));
  
-       dhd_bus_unregister();
- #if defined(CUSTOMER_HW2) && defined(CONFIG_WIFI_CONTROL_FUNC)
-       wifi_del_dev();
- #endif
-       /* Call customer gpio to turn off power with WL_REG_ON signal */
-       dhd_customer_gpio_wlan_ctrl(WLAN_POWER_OFF);
+       brcmf_bus_unregister();
  }
  
- static int __init dhd_module_init(void)
+ static int __init brcmf_module_init(void)
  {
        int error;
  
-       DHD_TRACE(("%s: Enter\n", __func__));
+       BRCMF_TRACE(("%s: Enter\n", __func__));
  
-       /* Sanity check on the module parameters */
-       do {
-               /* Both watchdog and DPC as tasklets are ok */
-               if ((dhd_watchdog_prio < 0) && (dhd_dpc_prio < 0))
-                       break;
-               /* If both watchdog and DPC are threads, TX must be deferred */
-               if ((dhd_watchdog_prio >= 0) && (dhd_dpc_prio >= 0)
-                   && dhd_deferred_tx)
-                       break;
-               DHD_ERROR(("Invalid module parameters.\n"));
-               return -EINVAL;
-       } while (0);
-       /* Call customer gpio to turn on power with WL_REG_ON signal */
-       dhd_customer_gpio_wlan_ctrl(WLAN_POWER_ON);
- #if defined(CUSTOMER_HW2) && defined(CONFIG_WIFI_CONTROL_FUNC)
-       sema_init(&wifi_control_sem, 0);
-       error = wifi_add_dev();
-       if (error) {
-               DHD_ERROR(("%s: platform_driver_register failed\n", __func__));
-               goto failed;
-       }
-       /* Waiting callback after platform_driver_register is done or
-                exit with error */
-       if (down_timeout(&wifi_control_sem, msecs_to_jiffies(1000)) != 0) {
-               printk(KERN_ERR "%s: platform_driver_register timeout\n",
-                       __func__);
-               /* remove device */
-               wifi_del_dev();
-               goto failed;
-       }
- #endif        /* #if defined(CUSTOMER_HW2) && defined(CONFIG_WIFI_CONTROL_FUNC) */
-       error = dhd_bus_register();
+       error = brcmf_bus_register();
  
        if (error) {
-               DHD_ERROR(("%s: sdio_register_driver failed\n", __func__));
+               BRCMF_ERROR(("%s: brcmf_bus_register failed\n", __func__));
                goto failed;
        }
-       return error;
+       return 0;
  
  failed:
-       /* turn off power and exit */
-       dhd_customer_gpio_wlan_ctrl(WLAN_POWER_OFF);
        return -EINVAL;
  }
  
- module_init(dhd_module_init);
- module_exit(dhd_module_cleanup);
+ module_init(brcmf_module_init);
+ module_exit(brcmf_module_cleanup);
  
- /*
-  * OS specific functions required to implement DHD driver in OS independent way
-  */
- int dhd_os_proto_block(dhd_pub_t *pub)
+ int brcmf_os_proto_block(struct brcmf_pub *drvr)
  {
-       dhd_info_t *dhd = (dhd_info_t *) (pub->info);
+       struct brcmf_info *drvr_priv = drvr->info;
  
-       if (dhd) {
-               down(&dhd->proto_sem);
+       if (drvr_priv) {
+               down(&drvr_priv->proto_sem);
                return 1;
        }
        return 0;
  }
  
- int dhd_os_proto_unblock(dhd_pub_t *pub)
+ int brcmf_os_proto_unblock(struct brcmf_pub *drvr)
  {
-       dhd_info_t *dhd = (dhd_info_t *) (pub->info);
+       struct brcmf_info *drvr_priv = drvr->info;
  
-       if (dhd) {
-               up(&dhd->proto_sem);
+       if (drvr_priv) {
+               up(&drvr_priv->proto_sem);
                return 1;
        }
  
        return 0;
  }
  
- unsigned int dhd_os_get_ioctl_resp_timeout(void)
+ unsigned int brcmf_os_get_ioctl_resp_timeout(void)
  {
-       return (unsigned int)dhd_ioctl_timeout_msec;
+       return (unsigned int)brcmf_ioctl_timeout_msec;
  }
  
- void dhd_os_set_ioctl_resp_timeout(unsigned int timeout_msec)
+ void brcmf_os_set_ioctl_resp_timeout(unsigned int timeout_msec)
  {
-       dhd_ioctl_timeout_msec = (int)timeout_msec;
+       brcmf_ioctl_timeout_msec = (int)timeout_msec;
  }
  
- int dhd_os_ioctl_resp_wait(dhd_pub_t *pub, uint *condition, bool *pending)
+ int brcmf_os_ioctl_resp_wait(struct brcmf_pub *drvr, uint *condition,
+                            bool *pending)
  {
-       dhd_info_t *dhd = (dhd_info_t *) (pub->info);
+       struct brcmf_info *drvr_priv = drvr->info;
        DECLARE_WAITQUEUE(wait, current);
-       int timeout = dhd_ioctl_timeout_msec;
+       int timeout = brcmf_ioctl_timeout_msec;
  
        /* Convert timeout in millsecond to jiffies */
        timeout = timeout * HZ / 1000;
  
        /* Wait until control frame is available */
-       add_wait_queue(&dhd->ioctl_resp_wait, &wait);
+       add_wait_queue(&drvr_priv->ioctl_resp_wait, &wait);
        set_current_state(TASK_INTERRUPTIBLE);
  
        while (!(*condition) && (!signal_pending(current) && timeout))
                *pending = true;
  
        set_current_state(TASK_RUNNING);
-       remove_wait_queue(&dhd->ioctl_resp_wait, &wait);
+       remove_wait_queue(&drvr_priv->ioctl_resp_wait, &wait);
  
        return timeout;
  }
  
- int dhd_os_ioctl_resp_wake(dhd_pub_t *pub)
+ int brcmf_os_ioctl_resp_wake(struct brcmf_pub *drvr)
  {
-       dhd_info_t *dhd = (dhd_info_t *) (pub->info);
+       struct brcmf_info *drvr_priv = drvr->info;
  
-       if (waitqueue_active(&dhd->ioctl_resp_wait))
-               wake_up_interruptible(&dhd->ioctl_resp_wait);
+       if (waitqueue_active(&drvr_priv->ioctl_resp_wait))
+               wake_up_interruptible(&drvr_priv->ioctl_resp_wait);
  
        return 0;
  }
  
- void dhd_os_wd_timer(void *bus, uint wdtick)
- {
-       dhd_pub_t *pub = bus;
-       static uint save_dhd_watchdog_ms;
-       dhd_info_t *dhd = (dhd_info_t *) pub->info;
-       /* don't start the wd until fw is loaded */
-       if (pub->busstate == DHD_BUS_DOWN)
-               return;
-       /* Totally stop the timer */
-       if (!wdtick && dhd->wd_timer_valid == true) {
-               del_timer_sync(&dhd->timer);
-               dhd->wd_timer_valid = false;
-               save_dhd_watchdog_ms = wdtick;
-               return;
-       }
-       if (wdtick) {
-               dhd_watchdog_ms = (uint) wdtick;
-               if (save_dhd_watchdog_ms != dhd_watchdog_ms) {
-                       if (dhd->wd_timer_valid == true)
-                               /* Stop timer and restart at new value */
-                               del_timer_sync(&dhd->timer);
-                       /* Create timer again when watchdog period is
-                          dynamically changed or in the first instance
-                        */
-                       dhd->timer.expires =
-                           jiffies + dhd_watchdog_ms * HZ / 1000;
-                       add_timer(&dhd->timer);
-               } else {
-                       /* Re arm the timer, at last watchdog period */
-                       mod_timer(&dhd->timer,
-                                 jiffies + dhd_watchdog_ms * HZ / 1000);
-               }
-               dhd->wd_timer_valid = true;
-               save_dhd_watchdog_ms = wdtick;
-       }
- }
- void *dhd_os_open_image(char *filename)
- {
-       struct file *fp;
-       if (IS_CFG80211_FAVORITE() && !NO_FW_REQ())
-               return wl_cfg80211_request_fw(filename);
-       fp = filp_open(filename, O_RDONLY, 0);
-       /*
-        * 2.6.11 (FC4) supports filp_open() but later revs don't?
-        * Alternative:
-        * fp = open_namei(AT_FDCWD, filename, O_RD, 0);
-        * ???
-        */
-       if (IS_ERR(fp))
-               fp = NULL;
-       return fp;
- }
- int dhd_os_get_image_block(char *buf, int len, void *image)
- {
-       struct file *fp = (struct file *)image;
-       int rdlen;
-       if (IS_CFG80211_FAVORITE() && !NO_FW_REQ())
-               return wl_cfg80211_read_fw(buf, len);
-       if (!image)
-               return 0;
-       rdlen = kernel_read(fp, fp->f_pos, buf, len);
-       if (rdlen > 0)
-               fp->f_pos += rdlen;
-       return rdlen;
- }
- void dhd_os_close_image(void *image)
- {
-       if (IS_CFG80211_FAVORITE() && !NO_FW_REQ())
-               return wl_cfg80211_release_fw();
-       if (image)
-               filp_close((struct file *)image, NULL);
- }
- void dhd_os_sdlock(dhd_pub_t *pub)
- {
-       dhd_info_t *dhd;
-       dhd = (dhd_info_t *) (pub->info);
-       if (dhd->threads_only)
-               down(&dhd->sdsem);
-       else
-               spin_lock_bh(&dhd->sdlock);
- }
- void dhd_os_sdunlock(dhd_pub_t *pub)
- {
-       dhd_info_t *dhd;
-       dhd = (dhd_info_t *) (pub->info);
-       if (dhd->threads_only)
-               up(&dhd->sdsem);
-       else
-               spin_unlock_bh(&dhd->sdlock);
- }
- void dhd_os_sdlock_txq(dhd_pub_t *pub)
- {
-       dhd_info_t *dhd;
-       dhd = (dhd_info_t *) (pub->info);
-       spin_lock_bh(&dhd->txqlock);
- }
- void dhd_os_sdunlock_txq(dhd_pub_t *pub)
- {
-       dhd_info_t *dhd;
-       dhd = (dhd_info_t *) (pub->info);
-       spin_unlock_bh(&dhd->txqlock);
- }
- void dhd_os_sdlock_rxq(dhd_pub_t *pub)
- {
- }
- void dhd_os_sdunlock_rxq(dhd_pub_t *pub)
- {
- }
- void dhd_os_sdtxlock(dhd_pub_t *pub)
- {
-       dhd_os_sdlock(pub);
- }
- void dhd_os_sdtxunlock(dhd_pub_t *pub)
- {
-       dhd_os_sdunlock(pub);
- }
- static int
- dhd_wl_host_event(dhd_info_t *dhd, int *ifidx, void *pktdata,
-                 wl_event_msg_t *event, void **data)
+ static int brcmf_host_event(struct brcmf_info *drvr_priv, int *ifidx, void *pktdata,
+                           struct brcmf_event_msg *event, void **data)
  {
        int bcmerror = 0;
  
-       ASSERT(dhd != NULL);
-       bcmerror = wl_host_event(dhd, ifidx, pktdata, event, data);
+       bcmerror = brcmf_c_host_event(drvr_priv, ifidx, pktdata, event, data);
        if (bcmerror != 0)
                return bcmerror;
  
- #if defined(CONFIG_WIRELESS_EXT)
-       if (!IS_CFG80211_FAVORITE()) {
-               if ((dhd->iflist[*ifidx] == NULL)
-                   || (dhd->iflist[*ifidx]->net == NULL)) {
-                       DHD_ERROR(("%s Exit null pointer\n", __func__));
-                       return bcmerror;
-               }
-               if (dhd->iflist[*ifidx]->net)
-                       wl_iw_event(dhd->iflist[*ifidx]->net, event, *data);
-       }
- #endif                                /* defined(CONFIG_WIRELESS_EXT)  */
-       if (IS_CFG80211_FAVORITE()) {
-               ASSERT(dhd->iflist[*ifidx] != NULL);
-               ASSERT(dhd->iflist[*ifidx]->net != NULL);
-               if (dhd->iflist[*ifidx]->net)
-                       wl_cfg80211_event(dhd->iflist[*ifidx]->net, event,
-                                         *data);
-       }
+       if (drvr_priv->iflist[*ifidx]->net)
+               brcmf_cfg80211_event(drvr_priv->iflist[*ifidx]->net,
+                                    event, *data);
  
        return bcmerror;
  }
  
- /* send up locally generated event */
- void dhd_sendup_event(dhd_pub_t *dhdp, wl_event_msg_t *event, void *data)
- {
-       switch (be32_to_cpu(event->event_type)) {
-       default:
-               break;
-       }
- }
- void dhd_wait_for_event(dhd_pub_t *dhd, bool *lockvar)
+ int brcmf_netdev_reset(struct net_device *dev, u8 flag)
  {
-       struct dhd_info *dhdinfo = dhd->info;
-       dhd_os_sdunlock(dhd);
-       wait_event_interruptible_timeout(dhdinfo->ctrl_wait,
-                                        (*lockvar == false), HZ * 2);
-       dhd_os_sdlock(dhd);
-       return;
- }
+       struct brcmf_info *drvr_priv = *(struct brcmf_info **)netdev_priv(dev);
  
- void dhd_wait_event_wakeup(dhd_pub_t *dhd)
- {
-       struct dhd_info *dhdinfo = dhd->info;
-       if (waitqueue_active(&dhdinfo->ctrl_wait))
-               wake_up_interruptible(&dhdinfo->ctrl_wait);
-       return;
- }
- int dhd_dev_reset(struct net_device *dev, u8 flag)
- {
-       dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
-       /* Turning off watchdog */
-       if (flag)
-               dhd_os_wd_timer(&dhd->pub, 0);
-       dhd_bus_devreset(&dhd->pub, flag);
-       /* Turning on watchdog back */
-       if (!flag)
-               dhd_os_wd_timer(&dhd->pub, dhd_watchdog_ms);
-       DHD_ERROR(("%s:  WLAN OFF DONE\n", __func__));
+       brcmf_bus_devreset(&drvr_priv->pub, flag);
  
        return 1;
  }
  
- int net_os_set_suspend_disable(struct net_device *dev, int val)
- {
-       dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
-       int ret = 0;
-       if (dhd) {
-               ret = dhd->pub.suspend_disable_flag;
-               dhd->pub.suspend_disable_flag = val;
-       }
-       return ret;
- }
- int net_os_set_suspend(struct net_device *dev, int val)
+ static int brcmf_get_pend_8021x_cnt(struct brcmf_info *drvr_priv)
  {
-       int ret = 0;
- #if defined(CONFIG_HAS_EARLYSUSPEND)
-       dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
-       if (dhd) {
-               dhd_os_proto_block(&dhd->pub);
-               ret = dhd_set_suspend(val, &dhd->pub);
-               dhd_os_proto_unblock(&dhd->pub);
-       }
- #endif                /* defined(CONFIG_HAS_EARLYSUSPEND) */
-       return ret;
- }
- int net_os_set_dtim_skip(struct net_device *dev, int val)
- {
-       dhd_info_t *dhd = *(dhd_info_t **) netdev_priv(dev);
-       if (dhd)
-               dhd->pub.dtim_skip = val;
-       return 0;
- }
- int net_os_set_packet_filter(struct net_device *dev, int val)
- {
-       dhd_info_t *dhd = *(dhd_info_t **) netdev_priv(dev);
-       int ret = 0;
-       /* Packet filtering is set only if we still in early-suspend and
-        * we need either to turn it ON or turn it OFF
-        * We can always turn it OFF in case of early-suspend, but we turn it
-        * back ON only if suspend_disable_flag was not set
-        */
-       if (dhd && dhd->pub.up) {
-               dhd_os_proto_block(&dhd->pub);
-               if (dhd->pub.in_suspend) {
-                       if (!val || (val && !dhd->pub.suspend_disable_flag))
-                               dhd_set_packet_filter(val, &dhd->pub);
-               }
-               dhd_os_proto_unblock(&dhd->pub);
-       }
-       return ret;
- }
- void dhd_dev_init_ioctl(struct net_device *dev)
- {
-       dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
-       dhd_preinit_ioctls(&dhd->pub);
- }
- #ifdef PNO_SUPPORT
- /* Linux wrapper to call common dhd_pno_clean */
- int dhd_dev_pno_reset(struct net_device *dev)
- {
-       dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
-       return dhd_pno_clean(&dhd->pub);
- }
- /* Linux wrapper to call common dhd_pno_enable */
- int dhd_dev_pno_enable(struct net_device *dev, int pfn_enabled)
- {
-       dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
-       return dhd_pno_enable(&dhd->pub, pfn_enabled);
- }
- /* Linux wrapper to call common dhd_pno_set */
- int
- dhd_dev_pno_set(struct net_device *dev, wlc_ssid_t *ssids_local, int nssid,
-               unsigned char scan_fr)
- {
-       dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
-       return dhd_pno_set(&dhd->pub, ssids_local, nssid, scan_fr);
- }
- /* Linux wrapper to get  pno status */
- int dhd_dev_get_pno_status(struct net_device *dev)
- {
-       dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
-       return dhd_pno_get_status(&dhd->pub);
- }
- #endif                                /* PNO_SUPPORT */
- static int dhd_get_pend_8021x_cnt(dhd_info_t *dhd)
- {
-       return atomic_read(&dhd->pend_8021x_cnt);
+       return atomic_read(&drvr_priv->pend_8021x_cnt);
  }
  
  #define MAX_WAIT_FOR_8021X_TX 10
  
- int dhd_wait_pend8021x(struct net_device *dev)
+ int brcmf_netdev_wait_pend8021x(struct net_device *dev)
  {
-       dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
+       struct brcmf_info *drvr_priv = *(struct brcmf_info **)netdev_priv(dev);
        int timeout = 10 * HZ / 1000;
        int ntimes = MAX_WAIT_FOR_8021X_TX;
-       int pend = dhd_get_pend_8021x_cnt(dhd);
+       int pend = brcmf_get_pend_8021x_cnt(drvr_priv);
  
        while (ntimes && pend) {
                if (pend) {
                        set_current_state(TASK_RUNNING);
                        ntimes--;
                }
-               pend = dhd_get_pend_8021x_cnt(dhd);
+               pend = brcmf_get_pend_8021x_cnt(drvr_priv);
        }
        return pend;
  }
  
- void wl_os_wd_timer(struct net_device *ndev, uint wdtick)
- {
-       dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(ndev);
-       dhd_os_wd_timer(&dhd->pub, wdtick);
- }
- #ifdef DHD_DEBUG
- int write_to_file(dhd_pub_t *dhd, u8 *buf, int size)
+ #ifdef BCMDBG
+ int brcmf_write_to_file(struct brcmf_pub *drvr, u8 *buf, int size)
  {
        int ret = 0;
        struct file *fp;
        /* open file to write */
        fp = filp_open("/tmp/mem_dump", O_WRONLY | O_CREAT, 0640);
        if (!fp) {
-               DHD_ERROR(("%s: open file error\n", __func__));
+               BRCMF_ERROR(("%s: open file error\n", __func__));
                ret = -1;
                goto exit;
        }
@@@ -2861,4 -1731,4 +1733,4 @@@ exit
  
        return ret;
  }
- #endif                                /* DHD_DEBUG */
+ #endif                                /* BCMDBG */
  
  #define __UNDEF_NO_VERSION__
  
- #include <linux/kernel.h>
  #include <linux/etherdevice.h>
- #include <linux/types.h>
- #include <linux/pci_ids.h>
- #include <linux/module.h>
  #include <linux/pci.h>
  #include <linux/sched.h>
  #include <linux/firmware.h>
 +#include <linux/interrupt.h>
  #include <net/mac80211.h>
- #include <proto/802.11.h>
- #include <bcmdefs.h>
- #include <bcmwifi.h>
- #include <bcmutils.h>
- #include <bcmnvram.h>
- #include <pcicfg.h>
- #include <wlioctl.h>
- #include <sbhnddma.h>
- #include "phy/wlc_phy_int.h"
+ #include <defs.h>
+ #include "nicpci.h"
+ #include "phy/phy_int.h"
  #include "d11.h"
- #include "wlc_types.h"
- #include "wlc_cfg.h"
- #include "phy/phy_version.h"
- #include "wlc_key.h"
- #include "wlc_channel.h"
- #include "wlc_scb.h"
- #include "wlc_pub.h"
- #include "wl_dbg.h"
- #include "wl_export.h"
- #include "wl_ucode.h"
- #include "wl_mac80211.h"
+ #include "channel.h"
+ #include "scb.h"
+ #include "pub.h"
+ #include "ucode_loader.h"
+ #include "mac80211_if.h"
  
  #define N_TX_QUEUES   4 /* #tx queues on mac80211<->driver interface */
  
- static void wl_timer(unsigned long data);
- static void _wl_timer(struct wl_timer *t);
+ #define LOCK(wl)      spin_lock_bh(&(wl)->lock)
+ #define UNLOCK(wl)    spin_unlock_bh(&(wl)->lock)
+ /* locking from inside brcms_isr */
+ #define ISR_LOCK(wl, flags)\
+       do {\
+               spin_lock(&(wl)->isr_lock);\
+               (void)(flags); } \
+       while (0)
+ #define ISR_UNLOCK(wl, flags)\
+       do {\
+               spin_unlock(&(wl)->isr_lock);\
+               (void)(flags); } \
+       while (0)
+ /* locking under LOCK() to synchronize with brcms_isr */
+ #define INT_LOCK(wl, flags)   spin_lock_irqsave(&(wl)->isr_lock, flags)
+ #define INT_UNLOCK(wl, flags) spin_unlock_irqrestore(&(wl)->isr_lock, flags)
+ static void brcms_timer(unsigned long data);
+ static void _brcms_timer(struct brcms_timer *t);
  
  
  static int ieee_hw_init(struct ieee80211_hw *hw);
@@@ -70,22 -71,20 +72,20 @@@ static int wl_linux_watchdog(void *ctx)
        FIF_OTHER_BSS | \
        FIF_BCN_PRBRESP_PROMISC)
  
- static int wl_found;
+ static int n_adapters_found;
  
- #define WL_DEV_IF(dev)                ((struct wl_if *)netdev_priv(dev))
- #define       WL_INFO(dev)            ((struct wl_info *)(WL_DEV_IF(dev)->wl))
- static int wl_request_fw(struct wl_info *wl, struct pci_dev *pdev);
- static void wl_release_fw(struct wl_info *wl);
+ static int brcms_request_fw(struct brcms_info *wl, struct pci_dev *pdev);
+ static void brcms_release_fw(struct brcms_info *wl);
  
  /* local prototypes */
- static void wl_dpc(unsigned long data);
- static irqreturn_t wl_isr(int irq, void *dev_id);
+ static void brcms_dpc(unsigned long data);
+ static irqreturn_t brcms_isr(int irq, void *dev_id);
  
- static int __devinit wl_pci_probe(struct pci_dev *pdev,
+ static int __devinit brcms_pci_probe(struct pci_dev *pdev,
                                  const struct pci_device_id *ent);
- static void wl_remove(struct pci_dev *pdev);
- static void wl_free(struct wl_info *wl);
- static void wl_set_basic_rate(struct wl_rateset *rs, u16 rate, bool is_br);
+ static void brcms_remove(struct pci_dev *pdev);
+ static void brcms_free(struct brcms_info *wl);
+ static void brcms_set_basic_rate(struct wl_rateset *rs, u16 rate, bool is_br);
  
  MODULE_AUTHOR("Broadcom Corporation");
  MODULE_DESCRIPTION("Broadcom 802.11n wireless LAN driver.");
@@@ -93,14 -92,16 +93,16 @@@ MODULE_SUPPORTED_DEVICE("Broadcom 802.1
  MODULE_LICENSE("Dual BSD/GPL");
  
  /* recognized PCI IDs */
- static struct pci_device_id wl_id_table[] = {
+ static DEFINE_PCI_DEVICE_TABLE(brcms_pci_id_table) = {
        {PCI_VENDOR_ID_BROADCOM, 0x4357, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},      /* 43225 2G */
        {PCI_VENDOR_ID_BROADCOM, 0x4353, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},      /* 43224 DUAL */
        {PCI_VENDOR_ID_BROADCOM, 0x4727, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},      /* 4313 DUAL */
+       /* 43224 Ven */
+       {PCI_VENDOR_ID_BROADCOM, 0x0576, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
        {0}
  };
  
- MODULE_DEVICE_TABLE(pci, wl_id_table);
+ MODULE_DEVICE_TABLE(pci, brcms_pci_id_table);
  
  #ifdef BCMDBG
  static int msglevel = 0xdeadbeef;
@@@ -113,88 -114,89 +115,89 @@@ module_param(phymsglevel, int, 0)
  #define WL_TO_HW(wl)    (wl->pub->ieee_hw)
  
  /* MAC80211 callback functions */
- static int wl_ops_start(struct ieee80211_hw *hw);
- static void wl_ops_stop(struct ieee80211_hw *hw);
- static int wl_ops_add_interface(struct ieee80211_hw *hw,
+ static int brcms_ops_start(struct ieee80211_hw *hw);
+ static void brcms_ops_stop(struct ieee80211_hw *hw);
+ static int brcms_ops_add_interface(struct ieee80211_hw *hw,
                                struct ieee80211_vif *vif);
- static void wl_ops_remove_interface(struct ieee80211_hw *hw,
+ static void brcms_ops_remove_interface(struct ieee80211_hw *hw,
                                    struct ieee80211_vif *vif);
- static int wl_ops_config(struct ieee80211_hw *hw, u32 changed);
- static void wl_ops_bss_info_changed(struct ieee80211_hw *hw,
+ static int brcms_ops_config(struct ieee80211_hw *hw, u32 changed);
+ static void brcms_ops_bss_info_changed(struct ieee80211_hw *hw,
                                    struct ieee80211_vif *vif,
                                    struct ieee80211_bss_conf *info,
                                    u32 changed);
- static void wl_ops_configure_filter(struct ieee80211_hw *hw,
+ static void brcms_ops_configure_filter(struct ieee80211_hw *hw,
                                    unsigned int changed_flags,
                                    unsigned int *total_flags, u64 multicast);
- static int wl_ops_set_tim(struct ieee80211_hw *hw, struct ieee80211_sta *sta,
+ static int brcms_ops_set_tim(struct ieee80211_hw *hw, struct ieee80211_sta *sta,
                          bool set);
- static void wl_ops_sw_scan_start(struct ieee80211_hw *hw);
- static void wl_ops_sw_scan_complete(struct ieee80211_hw *hw);
- static void wl_ops_set_tsf(struct ieee80211_hw *hw, u64 tsf);
- static int wl_ops_get_stats(struct ieee80211_hw *hw,
+ static void brcms_ops_sw_scan_start(struct ieee80211_hw *hw);
+ static void brcms_ops_sw_scan_complete(struct ieee80211_hw *hw);
+ static void brcms_ops_set_tsf(struct ieee80211_hw *hw, u64 tsf);
+ static int brcms_ops_get_stats(struct ieee80211_hw *hw,
                            struct ieee80211_low_level_stats *stats);
- static void wl_ops_sta_notify(struct ieee80211_hw *hw,
+ static void brcms_ops_sta_notify(struct ieee80211_hw *hw,
                              struct ieee80211_vif *vif,
                              enum sta_notify_cmd cmd,
                              struct ieee80211_sta *sta);
- static int wl_ops_conf_tx(struct ieee80211_hw *hw, u16 queue,
+ static int brcms_ops_conf_tx(struct ieee80211_hw *hw, u16 queue,
                          const struct ieee80211_tx_queue_params *params);
- static u64 wl_ops_get_tsf(struct ieee80211_hw *hw);
- static int wl_ops_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
+ static u64 brcms_ops_get_tsf(struct ieee80211_hw *hw);
+ static int brcms_ops_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
                      struct ieee80211_sta *sta);
- static int wl_ops_sta_remove(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
-                        struct ieee80211_sta *sta);
- static int wl_ops_ampdu_action(struct ieee80211_hw *hw,
+ static int brcms_ops_sta_remove(struct ieee80211_hw *hw,
+                               struct ieee80211_vif *vif,
+                               struct ieee80211_sta *sta);
+ static int brcms_ops_ampdu_action(struct ieee80211_hw *hw,
                               struct ieee80211_vif *vif,
                               enum ieee80211_ampdu_mlme_action action,
                               struct ieee80211_sta *sta, u16 tid, u16 *ssn,
                               u8 buf_size);
- static void wl_ops_rfkill_poll(struct ieee80211_hw *hw);
- static void wl_ops_flush(struct ieee80211_hw *hw, bool drop);
+ static void brcms_ops_rfkill_poll(struct ieee80211_hw *hw);
+ static void brcms_ops_flush(struct ieee80211_hw *hw, bool drop);
  
- static void wl_ops_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
+ static void brcms_ops_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
  {
-       struct wl_info *wl = hw->priv;
+       struct brcms_info *wl = hw->priv;
  
-       WL_LOCK(wl);
+       LOCK(wl);
        if (!wl->pub->up) {
                wiphy_err(wl->wiphy, "ops->tx called while down\n");
                kfree_skb(skb);
                goto done;
        }
-       wlc_sendpkt_mac80211(wl->wlc, skb, hw);
+       brcms_c_sendpkt_mac80211(wl->wlc, skb, hw);
   done:
-       WL_UNLOCK(wl);
+       UNLOCK(wl);
  }
  
- static int wl_ops_start(struct ieee80211_hw *hw)
+ static int brcms_ops_start(struct ieee80211_hw *hw)
  {
-       struct wl_info *wl = hw->priv;
+       struct brcms_info *wl = hw->priv;
        bool blocked;
        /*
          struct ieee80211_channel *curchan = hw->conf.channel;
        */
  
        ieee80211_wake_queues(hw);
-       WL_LOCK(wl);
-       blocked = wl_rfkill_set_hw_state(wl);
-       WL_UNLOCK(wl);
+       LOCK(wl);
+       blocked = brcms_rfkill_set_hw_state(wl);
+       UNLOCK(wl);
        if (!blocked)
                wiphy_rfkill_stop_polling(wl->pub->ieee_hw->wiphy);
  
        return 0;
  }
  
- static void wl_ops_stop(struct ieee80211_hw *hw)
+ static void brcms_ops_stop(struct ieee80211_hw *hw)
  {
        ieee80211_stop_queues(hw);
  }
  
  static int
wl_ops_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
brcms_ops_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
  {
-       struct wl_info *wl;
+       struct brcms_info *wl;
        int err;
  
        /* Just STA for now */
        }
  
        wl = HW_TO_WL(hw);
-       WL_LOCK(wl);
-       err = wl_up(wl);
-       WL_UNLOCK(wl);
+       LOCK(wl);
+       err = brcms_up(wl);
+       UNLOCK(wl);
  
        if (err != 0) {
-               wiphy_err(hw->wiphy, "%s: wl_up() returned %d\n", __func__,
+               wiphy_err(hw->wiphy, "%s: brcms_up() returned %d\n", __func__,
                          err);
        }
        return err;
  }
  
  static void
wl_ops_remove_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
brcms_ops_remove_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
  {
-       struct wl_info *wl;
+       struct brcms_info *wl;
  
        wl = HW_TO_WL(hw);
  
        /* put driver in down state */
-       WL_LOCK(wl);
-       wl_down(wl);
-       WL_UNLOCK(wl);
+       LOCK(wl);
+       brcms_down(wl);
+       UNLOCK(wl);
  }
  
  /*
@@@ -240,13 -242,13 +243,13 @@@ static in
  ieee_set_channel(struct ieee80211_hw *hw, struct ieee80211_channel *chan,
                 enum nl80211_channel_type type)
  {
-       struct wl_info *wl = HW_TO_WL(hw);
+       struct brcms_info *wl = HW_TO_WL(hw);
        int err = 0;
  
        switch (type) {
        case NL80211_CHAN_HT20:
        case NL80211_CHAN_NO_HT:
-               err = wlc_set(wl->wlc, WLC_SET_CHANNEL, chan->hw_value);
+               err = brcms_c_set(wl->wlc, BRCM_SET_CHANNEL, chan->hw_value);
                break;
        case NL80211_CHAN_HT40MINUS:
        case NL80211_CHAN_HT40PLUS:
        return err;
  }
  
- static int wl_ops_config(struct ieee80211_hw *hw, u32 changed)
+ static int brcms_ops_config(struct ieee80211_hw *hw, u32 changed)
  {
        struct ieee80211_conf *conf = &hw->conf;
-       struct wl_info *wl = HW_TO_WL(hw);
+       struct brcms_info *wl = HW_TO_WL(hw);
        int err = 0;
        int new_int;
        struct wiphy *wiphy = hw->wiphy;
  
-       WL_LOCK(wl);
+       LOCK(wl);
        if (changed & IEEE80211_CONF_CHANGE_LISTEN_INTERVAL) {
-               if (wlc_iovar_setint
-                   (wl->wlc, "bcn_li_bcn", conf->listen_interval)) {
+               if (brcms_c_set_par(wl->wlc, IOV_BCN_LI_BCN,
+                                   conf->listen_interval) < 0) {
                        wiphy_err(wiphy, "%s: Error setting listen_interval\n",
                                  __func__);
                        err = -EIO;
                        goto config_out;
                }
-               wlc_iovar_getint(wl->wlc, "bcn_li_bcn", &new_int);
+               brcms_c_get_par(wl->wlc, IOV_BCN_LI_BCN, &new_int);
        }
        if (changed & IEEE80211_CONF_CHANGE_MONITOR)
                wiphy_err(wiphy, "%s: change monitor mode: %s (implement)\n",
                          "true" : "false");
  
        if (changed & IEEE80211_CONF_CHANGE_POWER) {
-               if (wlc_iovar_setint
-                   (wl->wlc, "qtxpower", conf->power_level * 4)) {
+               if (brcms_c_set_par(wl->wlc, IOV_QTXPOWER,
+                                   conf->power_level * 4) < 0) {
                        wiphy_err(wiphy, "%s: Error setting power_level\n",
                                  __func__);
                        err = -EIO;
                        goto config_out;
                }
-               wlc_iovar_getint(wl->wlc, "qtxpower", &new_int);
+               brcms_c_get_par(wl->wlc, IOV_QTXPOWER, &new_int);
                if (new_int != (conf->power_level * 4))
                        wiphy_err(wiphy, "%s: Power level req != actual, %d %d"
                                  "\n", __func__, conf->power_level * 4,
                err = ieee_set_channel(hw, conf->channel, conf->channel_type);
        }
        if (changed & IEEE80211_CONF_CHANGE_RETRY_LIMITS) {
-               if (wlc_set
-                   (wl->wlc, WLC_SET_SRL,
+               if (brcms_c_set
+                   (wl->wlc, BRCM_SET_SRL,
                     conf->short_frame_max_tx_count) < 0) {
                        wiphy_err(wiphy, "%s: Error setting srl\n", __func__);
                        err = -EIO;
                        goto config_out;
                }
-               if (wlc_set(wl->wlc, WLC_SET_LRL, conf->long_frame_max_tx_count)
-                   < 0) {
+               if (brcms_c_set(wl->wlc, BRCM_SET_LRL,
+                               conf->long_frame_max_tx_count) < 0) {
                        wiphy_err(wiphy, "%s: Error setting lrl\n", __func__);
                        err = -EIO;
                        goto config_out;
        }
  
   config_out:
-       WL_UNLOCK(wl);
+       UNLOCK(wl);
        return err;
  }
  
  static void
wl_ops_bss_info_changed(struct ieee80211_hw *hw,
brcms_ops_bss_info_changed(struct ieee80211_hw *hw,
                        struct ieee80211_vif *vif,
                        struct ieee80211_bss_conf *info, u32 changed)
  {
-       struct wl_info *wl = HW_TO_WL(hw);
+       struct brcms_info *wl = HW_TO_WL(hw);
        struct wiphy *wiphy = hw->wiphy;
        int val;
  
                 */
                wiphy_err(wiphy, "%s: %s: %sassociated\n", KBUILD_MODNAME,
                          __func__, info->assoc ? "" : "dis");
-               WL_LOCK(wl);
-               wlc_associate_upd(wl->wlc, info->assoc);
-               WL_UNLOCK(wl);
+               LOCK(wl);
+               brcms_c_associate_upd(wl->wlc, info->assoc);
+               UNLOCK(wl);
        }
        if (changed & BSS_CHANGED_ERP_SLOT) {
                /* slot timing changed */
                        val = 1;
                else
                        val = 0;
-               WL_LOCK(wl);
-               wlc_set(wl->wlc, WLC_SET_SHORTSLOT_OVERRIDE, val);
-               WL_UNLOCK(wl);
+               LOCK(wl);
+               brcms_c_set(wl->wlc, BRCMS_SET_SHORTSLOT_OVERRIDE, val);
+               UNLOCK(wl);
        }
  
        if (changed & BSS_CHANGED_HT) {
                /* 802.11n parameters changed */
                u16 mode = info->ht_operation_mode;
  
-               WL_LOCK(wl);
-               wlc_protection_upd(wl->wlc, WLC_PROT_N_CFG,
+               LOCK(wl);
+               brcms_c_protection_upd(wl->wlc, BRCMS_PROT_N_CFG,
                        mode & IEEE80211_HT_OP_MODE_PROTECTION);
-               wlc_protection_upd(wl->wlc, WLC_PROT_N_NONGF,
+               brcms_c_protection_upd(wl->wlc, BRCMS_PROT_N_NONGF,
                        mode & IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT);
-               wlc_protection_upd(wl->wlc, WLC_PROT_N_OBSS,
+               brcms_c_protection_upd(wl->wlc, BRCMS_PROT_N_OBSS,
                        mode & IEEE80211_HT_OP_MODE_NON_HT_STA_PRSNT);
-               WL_UNLOCK(wl);
+               UNLOCK(wl);
        }
        if (changed & BSS_CHANGED_BASIC_RATES) {
                struct ieee80211_supported_band *bi;
                int error;
  
                /* retrieve the current rates */
-               WL_LOCK(wl);
-               error = wlc_ioctl(wl->wlc, WLC_GET_CURR_RATESET,
+               LOCK(wl);
+               error = brcms_c_ioctl(wl->wlc, BRCM_GET_CURR_RATESET,
                                  &rs, sizeof(rs), NULL);
-               WL_UNLOCK(wl);
+               UNLOCK(wl);
                if (error) {
                        wiphy_err(wiphy, "%s: retrieve rateset failed: %d\n",
                                  __func__, error);
                        return;
                }
                br_mask = info->basic_rates;
-               bi = hw->wiphy->bands[wlc_get_curband(wl->wlc)];
+               bi = hw->wiphy->bands[brcms_c_get_curband(wl->wlc)];
                for (i = 0; i < bi->n_bitrates; i++) {
                        /* convert to internal rate value */
                        rate = (bi->bitrates[i].bitrate << 1) / 10;
  
                        /* set/clear basic rate flag */
-                       wl_set_basic_rate(&rs, rate, br_mask & 1);
+                       brcms_set_basic_rate(&rs, rate, br_mask & 1);
                        br_mask >>= 1;
                }
  
                /* update the rate set */
-               WL_LOCK(wl);
-               wlc_ioctl(wl->wlc, WLC_SET_RATESET, &rs, sizeof(rs), NULL);
-               WL_UNLOCK(wl);
+               LOCK(wl);
+               brcms_c_ioctl(wl->wlc, BRCM_SET_RATESET, &rs, sizeof(rs), NULL);
+               UNLOCK(wl);
        }
        if (changed & BSS_CHANGED_BEACON_INT) {
                /* Beacon interval changed */
-               WL_LOCK(wl);
-               wlc_set(wl->wlc, WLC_SET_BCNPRD, info->beacon_int);
-               WL_UNLOCK(wl);
+               LOCK(wl);
+               brcms_c_set(wl->wlc, BRCM_SET_BCNPRD, info->beacon_int);
+               UNLOCK(wl);
        }
        if (changed & BSS_CHANGED_BSSID) {
                /* BSSID changed, for whatever reason (IBSS and managed mode) */
-               WL_LOCK(wl);
-               wlc_set_addrmatch(wl->wlc, RCM_BSSID_OFFSET,
+               LOCK(wl);
+               brcms_c_set_addrmatch(wl->wlc, RCM_BSSID_OFFSET,
                                  info->bssid);
-               WL_UNLOCK(wl);
+               UNLOCK(wl);
        }
        if (changed & BSS_CHANGED_BEACON) {
                /* Beacon data changed, retrieve new beacon (beaconing modes) */
                wiphy_err(wiphy, "%s: qos enabled: %s (implement)\n", __func__,
                          info->qos ? "true" : "false");
        }
-       if (changed & BSS_CHANGED_IDLE) {
-               /* Idle changed for this BSS/interface */
-               wiphy_err(wiphy, "%s: BSS idle: %s (implement)\n", __func__,
-                         info->idle ? "true" : "false");
-       }
        return;
  }
  
  static void
wl_ops_configure_filter(struct ieee80211_hw *hw,
brcms_ops_configure_filter(struct ieee80211_hw *hw,
                        unsigned int changed_flags,
                        unsigned int *total_flags, u64 multicast)
  {
-       struct wl_info *wl = hw->priv;
+       struct brcms_info *wl = hw->priv;
        struct wiphy *wiphy = hw->wiphy;
  
        changed_flags &= MAC_FILTERS;
        if (changed_flags & FIF_OTHER_BSS)
                wiphy_err(wiphy, "FIF_OTHER_BSS\n");
        if (changed_flags & FIF_BCN_PRBRESP_PROMISC) {
-               WL_LOCK(wl);
+               LOCK(wl);
                if (*total_flags & FIF_BCN_PRBRESP_PROMISC) {
                        wl->pub->mac80211_state |= MAC80211_PROMISC_BCNS;
-                       wlc_mac_bcn_promisc_change(wl->wlc, 1);
+                       brcms_c_mac_bcn_promisc_change(wl->wlc, 1);
                } else {
-                       wlc_mac_bcn_promisc_change(wl->wlc, 0);
+                       brcms_c_mac_bcn_promisc_change(wl->wlc, 0);
                        wl->pub->mac80211_state &= ~MAC80211_PROMISC_BCNS;
                }
-               WL_UNLOCK(wl);
+               UNLOCK(wl);
        }
        return;
  }
  
  static int
wl_ops_set_tim(struct ieee80211_hw *hw, struct ieee80211_sta *sta, bool set)
brcms_ops_set_tim(struct ieee80211_hw *hw, struct ieee80211_sta *sta, bool set)
  {
        return 0;
  }
  
- static void wl_ops_sw_scan_start(struct ieee80211_hw *hw)
+ static void brcms_ops_sw_scan_start(struct ieee80211_hw *hw)
  {
-       struct wl_info *wl = hw->priv;
-       WL_LOCK(wl);
-       wlc_scan_start(wl->wlc);
-       WL_UNLOCK(wl);
+       struct brcms_info *wl = hw->priv;
+       LOCK(wl);
+       brcms_c_scan_start(wl->wlc);
+       UNLOCK(wl);
        return;
  }
  
- static void wl_ops_sw_scan_complete(struct ieee80211_hw *hw)
+ static void brcms_ops_sw_scan_complete(struct ieee80211_hw *hw)
  {
-       struct wl_info *wl = hw->priv;
-       WL_LOCK(wl);
-       wlc_scan_stop(wl->wlc);
-       WL_UNLOCK(wl);
+       struct brcms_info *wl = hw->priv;
+       LOCK(wl);
+       brcms_c_scan_stop(wl->wlc);
+       UNLOCK(wl);
        return;
  }
  
- static void wl_ops_set_tsf(struct ieee80211_hw *hw, u64 tsf)
+ static void brcms_ops_set_tsf(struct ieee80211_hw *hw, u64 tsf)
  {
        wiphy_err(hw->wiphy, "%s: Enter\n", __func__);
        return;
  }
  
  static int
wl_ops_get_stats(struct ieee80211_hw *hw,
brcms_ops_get_stats(struct ieee80211_hw *hw,
                 struct ieee80211_low_level_stats *stats)
  {
-       struct wl_info *wl = hw->priv;
+       struct brcms_info *wl = hw->priv;
        struct wl_cnt *cnt;
  
-       WL_LOCK(wl);
+       LOCK(wl);
        cnt = wl->pub->_cnt;
        stats->dot11ACKFailureCount = 0;
        stats->dot11RTSFailureCount = 0;
        stats->dot11FCSErrorCount = 0;
        stats->dot11RTSSuccessCount = 0;
-       WL_UNLOCK(wl);
+       UNLOCK(wl);
        return 0;
  }
  
  static void
wl_ops_sta_notify(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
brcms_ops_sta_notify(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
                  enum sta_notify_cmd cmd, struct ieee80211_sta *sta)
  {
        switch (cmd) {
  }
  
  static int
wl_ops_conf_tx(struct ieee80211_hw *hw, u16 queue,
brcms_ops_conf_tx(struct ieee80211_hw *hw, u16 queue,
               const struct ieee80211_tx_queue_params *params)
  {
-       struct wl_info *wl = hw->priv;
+       struct brcms_info *wl = hw->priv;
  
-       WL_LOCK(wl);
-       wlc_wme_setparams(wl->wlc, queue, params, true);
-       WL_UNLOCK(wl);
+       LOCK(wl);
+       brcms_c_wme_setparams(wl->wlc, queue, params, true);
+       UNLOCK(wl);
  
        return 0;
  }
  
- static u64 wl_ops_get_tsf(struct ieee80211_hw *hw)
+ static u64 brcms_ops_get_tsf(struct ieee80211_hw *hw)
  {
        wiphy_err(hw->wiphy, "%s: Enter\n", __func__);
        return 0;
  }
  
  static int
wl_ops_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
brcms_ops_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
               struct ieee80211_sta *sta)
  {
        struct scb *scb;
  
        int i;
-       struct wl_info *wl = hw->priv;
+       struct brcms_info *wl = hw->priv;
  
        /* Init the scb */
        scb = (struct scb *)sta->drv_priv;
        wl->pub->global_ampdu = &(scb->scb_ampdu);
        wl->pub->global_ampdu->scb = scb;
        wl->pub->global_ampdu->max_pdu = 16;
-       bcm_pktq_init(&scb->scb_ampdu.txq, AMPDU_MAX_SCB_TID,
+       brcmu_pktq_init(&scb->scb_ampdu.txq, AMPDU_MAX_SCB_TID,
                  AMPDU_MAX_SCB_TID * PKTQ_LEN_DEFAULT);
  
        sta->ht_cap.ht_supported = true;
  }
  
  static int
wl_ops_sta_remove(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
brcms_ops_sta_remove(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
                  struct ieee80211_sta *sta)
  {
        return 0;
  }
  
  static int
wl_ops_ampdu_action(struct ieee80211_hw *hw,
brcms_ops_ampdu_action(struct ieee80211_hw *hw,
                    struct ieee80211_vif *vif,
                    enum ieee80211_ampdu_mlme_action action,
                    struct ieee80211_sta *sta, u16 tid, u16 *ssn,
                    u8 buf_size)
  {
        struct scb *scb = (struct scb *)sta->drv_priv;
-       struct wl_info *wl = hw->priv;
+       struct brcms_info *wl = hw->priv;
        int status;
  
        if (WARN_ON(scb->magic != SCB_MAGIC))
        case IEEE80211_AMPDU_RX_STOP:
                break;
        case IEEE80211_AMPDU_TX_START:
-               WL_LOCK(wl);
-               status = wlc_aggregatable(wl->wlc, tid);
-               WL_UNLOCK(wl);
+               LOCK(wl);
+               status = brcms_c_aggregatable(wl->wlc, tid);
+               UNLOCK(wl);
                if (!status) {
                        wiphy_err(wl->wiphy, "START: tid %d is not agg\'able\n",
                                  tid);
                        return -EINVAL;
                }
-               /* XXX: Use the starting sequence number provided ... */
+               /* Future improvement: Use the starting sequence number provided ... */
                *ssn = 0;
                ieee80211_start_tx_ba_cb_irqsafe(vif, sta->addr, tid);
                break;
  
        case IEEE80211_AMPDU_TX_STOP:
-               WL_LOCK(wl);
-               wlc_ampdu_flush(wl->wlc, sta, tid);
-               WL_UNLOCK(wl);
+               LOCK(wl);
+               brcms_c_ampdu_flush(wl->wlc, sta, tid);
+               UNLOCK(wl);
                ieee80211_stop_tx_ba_cb_irqsafe(vif, sta->addr, tid);
                break;
        case IEEE80211_AMPDU_TX_OPERATIONAL:
-               /* Not sure what to do here */
+               /*
+                * BA window size from ADDBA response ('buf_size') defines how
+                * many outstanding MPDUs are allowed for the BA stream by
+                * recipient and traffic class. 'ampdu_factor' gives maximum
+                * AMPDU size.
+                */
+               LOCK(wl);
+               brcms_c_ampdu_tx_operational(wl->wlc, tid, buf_size,
+                       (1 << (IEEE80211_HT_MAX_AMPDU_FACTOR +
+                        sta->ht_cap.ampdu_factor)) - 1);
+               UNLOCK(wl);
                /* Power save wakeup */
                break;
        default:
        return 0;
  }
  
- static void wl_ops_rfkill_poll(struct ieee80211_hw *hw)
+ static void brcms_ops_rfkill_poll(struct ieee80211_hw *hw)
  {
-       struct wl_info *wl = HW_TO_WL(hw);
+       struct brcms_info *wl = HW_TO_WL(hw);
        bool blocked;
  
-       WL_LOCK(wl);
-       blocked = wlc_check_radio_disabled(wl->wlc);
-       WL_UNLOCK(wl);
+       LOCK(wl);
+       blocked = brcms_c_check_radio_disabled(wl->wlc);
+       UNLOCK(wl);
  
        wiphy_rfkill_set_hw_state(wl->pub->ieee_hw->wiphy, blocked);
  }
  
- static void wl_ops_flush(struct ieee80211_hw *hw, bool drop)
+ static void brcms_ops_flush(struct ieee80211_hw *hw, bool drop)
  {
-       struct wl_info *wl = HW_TO_WL(hw);
+       struct brcms_info *wl = HW_TO_WL(hw);
  
        no_printk("%s: drop = %s\n", __func__, drop ? "true" : "false");
  
        /* wait for packet queue and dma fifos to run empty */
-       WL_LOCK(wl);
-       wlc_wait_for_tx_completion(wl->wlc, drop);
-       WL_UNLOCK(wl);
+       LOCK(wl);
+       brcms_c_wait_for_tx_completion(wl->wlc, drop);
+       UNLOCK(wl);
  }
  
- static const struct ieee80211_ops wl_ops = {
-       .tx = wl_ops_tx,
-       .start = wl_ops_start,
-       .stop = wl_ops_stop,
-       .add_interface = wl_ops_add_interface,
-       .remove_interface = wl_ops_remove_interface,
-       .config = wl_ops_config,
-       .bss_info_changed = wl_ops_bss_info_changed,
-       .configure_filter = wl_ops_configure_filter,
-       .set_tim = wl_ops_set_tim,
-       .sw_scan_start = wl_ops_sw_scan_start,
-       .sw_scan_complete = wl_ops_sw_scan_complete,
-       .set_tsf = wl_ops_set_tsf,
-       .get_stats = wl_ops_get_stats,
-       .sta_notify = wl_ops_sta_notify,
-       .conf_tx = wl_ops_conf_tx,
-       .get_tsf = wl_ops_get_tsf,
-       .sta_add = wl_ops_sta_add,
-       .sta_remove = wl_ops_sta_remove,
-       .ampdu_action = wl_ops_ampdu_action,
-       .rfkill_poll = wl_ops_rfkill_poll,
-       .flush = wl_ops_flush,
+ static const struct ieee80211_ops brcms_ops = {
+       .tx = brcms_ops_tx,
+       .start = brcms_ops_start,
+       .stop = brcms_ops_stop,
+       .add_interface = brcms_ops_add_interface,
+       .remove_interface = brcms_ops_remove_interface,
+       .config = brcms_ops_config,
+       .bss_info_changed = brcms_ops_bss_info_changed,
+       .configure_filter = brcms_ops_configure_filter,
+       .set_tim = brcms_ops_set_tim,
+       .sw_scan_start = brcms_ops_sw_scan_start,
+       .sw_scan_complete = brcms_ops_sw_scan_complete,
+       .set_tsf = brcms_ops_set_tsf,
+       .get_stats = brcms_ops_get_stats,
+       .sta_notify = brcms_ops_sta_notify,
+       .conf_tx = brcms_ops_conf_tx,
+       .get_tsf = brcms_ops_get_tsf,
+       .sta_add = brcms_ops_sta_add,
+       .sta_remove = brcms_ops_sta_remove,
+       .ampdu_action = brcms_ops_ampdu_action,
+       .rfkill_poll = brcms_ops_rfkill_poll,
+       .flush = brcms_ops_flush,
  };
  
  /*
-  * is called in wl_pci_probe() context, therefore no locking required.
+  * is called in brcms_pci_probe() context, therefore no locking required.
   */
- static int wl_set_hint(struct wl_info *wl, char *abbrev)
+ static int brcms_set_hint(struct brcms_info *wl, char *abbrev)
  {
        return regulatory_hint(wl->pub->ieee_hw->wiphy, abbrev);
  }
   * Attach to the WL device identified by vendor and device parameters.
   * regs is a host accessible memory address pointing to WL device registers.
   *
-  * wl_attach is not defined as static because in the case where no bus
+  * brcms_attach is not defined as static because in the case where no bus
   * is defined, wl_attach will never be called, and thus, gcc will issue
   * a warning that this function is defined but not used if we declare
   * it as static.
   *
   *
-  * is called in wl_pci_probe() context, therefore no locking required.
+  * is called in brcms_pci_probe() context, therefore no locking required.
   */
- static struct wl_info *wl_attach(u16 vendor, u16 device, unsigned long regs,
+ static struct brcms_info *brcms_attach(u16 vendor, u16 device,
+                                      unsigned long regs,
                            uint bustype, void *btparam, uint irq)
  {
-       struct wl_info *wl = NULL;
+       struct brcms_info *wl = NULL;
        int unit, err;
        unsigned long base_addr;
        struct ieee80211_hw *hw;
        u8 perm[ETH_ALEN];
  
-       unit = wl_found;
+       unit = n_adapters_found;
        err = 0;
  
        if (unit < 0) {
        atomic_set(&wl->callbacks, 0);
  
        /* setup the bottom half handler */
-       tasklet_init(&wl->tasklet, wl_dpc, (unsigned long) wl);
+       tasklet_init(&wl->tasklet, brcms_dpc, (unsigned long) wl);
  
  
  
        base_addr = regs;
  
-       if (bustype == PCI_BUS) {
-               wl->piomode = false;
-       } else if (bustype == RPC_BUS) {
+       if (bustype == PCI_BUS || bustype == RPC_BUS) {
                /* Do nothing */
        } else {
                bustype = PCI_BUS;
        spin_lock_init(&wl->isr_lock);
  
        /* prepare ucode */
-       if (wl_request_fw(wl, (struct pci_dev *)btparam) < 0) {
+       if (brcms_request_fw(wl, (struct pci_dev *)btparam) < 0) {
                wiphy_err(wl->wiphy, "%s: Failed to find firmware usually in "
                          "%s\n", KBUILD_MODNAME, "/lib/firmware/brcm");
-               wl_release_fw(wl);
-               wl_remove((struct pci_dev *)btparam);
+               brcms_release_fw(wl);
+               brcms_remove((struct pci_dev *)btparam);
                return NULL;
        }
  
        /* common load-time initialization */
-       wl->wlc = wlc_attach((void *)wl, vendor, device, unit, wl->piomode,
+       wl->wlc = brcms_c_attach((void *)wl, vendor, device, unit, false,
                             wl->regsva, wl->bcm_bustype, btparam, &err);
-       wl_release_fw(wl);
+       brcms_release_fw(wl);
        if (!wl->wlc) {
-               wiphy_err(wl->wiphy, "%s: wlc_attach() failed with code %d\n",
+               wiphy_err(wl->wiphy, "%s: attach() failed with code %d\n",
                          KBUILD_MODNAME, err);
                goto fail;
        }
-       wl->pub = wlc_pub(wl->wlc);
+       wl->pub = brcms_c_pub(wl->wlc);
  
        wl->pub->ieee_hw = hw;
  
-       if (wlc_iovar_setint(wl->wlc, "mpc", 0)) {
+       if (brcms_c_set_par(wl->wlc, IOV_MPC, 0) < 0) {
                wiphy_err(wl->wiphy, "wl%d: Error setting MPC variable to 0\n",
                          unit);
        }
  
        /* register our interrupt handler */
-       if (request_irq(irq, wl_isr, IRQF_SHARED, KBUILD_MODNAME, wl)) {
+       if (request_irq(irq, brcms_isr, IRQF_SHARED, KBUILD_MODNAME, wl)) {
                wiphy_err(wl->wiphy, "wl%d: request_irq() failed\n", unit);
                goto fail;
        }
        wl->irq = irq;
  
        /* register module */
-       wlc_module_register(wl->pub, NULL, "linux", wl, NULL, wl_linux_watchdog,
-                           NULL);
+       brcms_c_module_register(wl->pub, "linux", wl, wl_linux_watchdog, NULL);
  
        if (ieee_hw_init(hw)) {
                wiphy_err(wl->wiphy, "wl%d: %s: ieee_hw_init failed!\n", unit,
        }
  
        if (wl->pub->srom_ccode[0])
-               err = wl_set_hint(wl, wl->pub->srom_ccode);
+               err = brcms_set_hint(wl, wl->pub->srom_ccode);
        else
-               err = wl_set_hint(wl, "US");
+               err = brcms_set_hint(wl, "US");
        if (err) {
                wiphy_err(wl->wiphy, "%s: regulatory_hint failed, status %d\n",
                          __func__, err);
        }
  
-       wl_found++;
+       n_adapters_found++;
        return wl;
  
  fail:
-       wl_free(wl);
+       brcms_free(wl);
        return NULL;
  }
  
        .max_power = 19, \
  }
  
- static struct ieee80211_channel wl_2ghz_chantable[] = {
+ static struct ieee80211_channel brcms_2ghz_chantable[] = {
        CHAN2GHZ(1, 2412, IEEE80211_CHAN_NO_HT40MINUS),
        CHAN2GHZ(2, 2417, IEEE80211_CHAN_NO_HT40MINUS),
        CHAN2GHZ(3, 2422, IEEE80211_CHAN_NO_HT40MINUS),
        .max_power = 21, \
  }
  
- static struct ieee80211_channel wl_5ghz_nphy_chantable[] = {
+ static struct ieee80211_channel brcms_5ghz_nphy_chantable[] = {
        /* UNII-1 */
        CHAN5GHZ(36, IEEE80211_CHAN_NO_HT40MINUS),
        CHAN5GHZ(40, IEEE80211_CHAN_NO_HT40PLUS),
        .hw_value = (rate100m / 5), \
  }
  
- static struct ieee80211_rate wl_legacy_ratetable[] = {
+ static struct ieee80211_rate legacy_ratetable[] = {
        RATE(10, 0),
        RATE(20, IEEE80211_RATE_SHORT_PREAMBLE),
        RATE(55, IEEE80211_RATE_SHORT_PREAMBLE),
        RATE(540, 0),
  };
  
- static struct ieee80211_supported_band wl_band_2GHz_nphy = {
+ static struct ieee80211_supported_band brcms_band_2GHz_nphy = {
        .band = IEEE80211_BAND_2GHZ,
-       .channels = wl_2ghz_chantable,
-       .n_channels = ARRAY_SIZE(wl_2ghz_chantable),
-       .bitrates = wl_legacy_ratetable,
-       .n_bitrates = ARRAY_SIZE(wl_legacy_ratetable),
+       .channels = brcms_2ghz_chantable,
+       .n_channels = ARRAY_SIZE(brcms_2ghz_chantable),
+       .bitrates = legacy_ratetable,
+       .n_bitrates = ARRAY_SIZE(legacy_ratetable),
        .ht_cap = {
                   /* from include/linux/ieee80211.h */
                   .cap = IEEE80211_HT_CAP_GRN_FLD |
                   }
  };
  
- static struct ieee80211_supported_band wl_band_5GHz_nphy = {
+ static struct ieee80211_supported_band brcms_band_5GHz_nphy = {
        .band = IEEE80211_BAND_5GHZ,
-       .channels = wl_5ghz_nphy_chantable,
-       .n_channels = ARRAY_SIZE(wl_5ghz_nphy_chantable),
-       .bitrates = wl_legacy_ratetable + 4,
-       .n_bitrates = ARRAY_SIZE(wl_legacy_ratetable) - 4,
+       .channels = brcms_5ghz_nphy_chantable,
+       .n_channels = ARRAY_SIZE(brcms_5ghz_nphy_chantable),
+       .bitrates = legacy_ratetable + 4,
+       .n_bitrates = ARRAY_SIZE(legacy_ratetable) - 4,
        .ht_cap = {
                   /* use IEEE80211_HT_CAP_* from include/linux/ieee80211.h */
                   .cap = IEEE80211_HT_CAP_GRN_FLD | IEEE80211_HT_CAP_SGI_20 | IEEE80211_HT_CAP_SGI_40 | IEEE80211_HT_CAP_40MHZ_INTOLERANT,     /* No 40 mhz yet */
  };
  
  /*
-  * is called in wl_pci_probe() context, therefore no locking required.
+  * is called in brcms_pci_probe() context, therefore no locking required.
   */
  static int ieee_hw_rate_init(struct ieee80211_hw *hw)
  {
-       struct wl_info *wl = HW_TO_WL(hw);
+       struct brcms_info *wl = HW_TO_WL(hw);
        int has_5g;
        char phy_list[4];
  
        hw->wiphy->bands[IEEE80211_BAND_2GHZ] = NULL;
        hw->wiphy->bands[IEEE80211_BAND_5GHZ] = NULL;
  
-       if (wlc_get(wl->wlc, WLC_GET_PHYLIST, (int *)&phy_list) < 0) {
+       if (brcms_c_get(wl->wlc, BRCM_GET_PHYLIST, (int *)&phy_list) < 0)
                wiphy_err(hw->wiphy, "Phy list failed\n");
-       }
  
        if (phy_list[0] == 'n' || phy_list[0] == 'c') {
                if (phy_list[0] == 'c') {
                        /* Single stream */
-                       wl_band_2GHz_nphy.ht_cap.mcs.rx_mask[1] = 0;
-                       wl_band_2GHz_nphy.ht_cap.mcs.rx_highest = 72;
+                       brcms_band_2GHz_nphy.ht_cap.mcs.rx_mask[1] = 0;
+                       brcms_band_2GHz_nphy.ht_cap.mcs.rx_highest = 72;
                }
-               hw->wiphy->bands[IEEE80211_BAND_2GHZ] = &wl_band_2GHz_nphy;
+               hw->wiphy->bands[IEEE80211_BAND_2GHZ] = &brcms_band_2GHz_nphy;
        } else {
                return -EPERM;
        }
                has_5g++;
                if (phy_list[0] == 'n' || phy_list[0] == 'c') {
                        hw->wiphy->bands[IEEE80211_BAND_5GHZ] =
-                           &wl_band_5GHz_nphy;
+                           &brcms_band_5GHz_nphy;
                } else {
                        return -EPERM;
                }
  }
  
  /*
-  * is called in wl_pci_probe() context, therefore no locking required.
+  * is called in brcms_pci_probe() context, therefore no locking required.
   */
  static int ieee_hw_init(struct ieee80211_hw *hw)
  {
            | IEEE80211_HW_REPORTS_TX_ACK_STATUS
            | IEEE80211_HW_AMPDU_AGGREGATION;
  
-       hw->extra_tx_headroom = wlc_get_header_len();
+       hw->extra_tx_headroom = brcms_c_get_header_len();
        hw->queues = N_TX_QUEUES;
-       /* FIXME: this doesn't seem to be used properly in minstrel_ht.
-        * mac80211/status.c:ieee80211_tx_status() checks this value,
-        * but mac80211/rc80211_minstrel_ht.c:minstrel_ht_get_rate()
-        * appears to always set 3 rates
-        */
        hw->max_rates = 2;      /* Primary rate and 1 fallback rate */
  
        hw->channel_change_time = 7 * 1000;     /* channel change time is dependent on chip and band  */
   * determines if a device is a WL device, and if so, attaches it.
   *
   * This function determines if a device pointed to by pdev is a WL device,
-  * and if so, performs a wl_attach() on it.
+  * and if so, performs a brcms_attach() on it.
   *
   * Perimeter lock is initialized in the course of this function.
   */
  static int __devinit
wl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
brcms_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
  {
        int rc;
-       struct wl_info *wl;
+       struct brcms_info *wl;
        struct ieee80211_hw *hw;
        u32 val;
  
               PCI_FUNC(pdev->devfn), pdev->irq);
  
        if ((pdev->vendor != PCI_VENDOR_ID_BROADCOM) ||
-           (((pdev->device & 0xff00) != 0x4300) &&
+           ((pdev->device != 0x0576) &&
+            ((pdev->device & 0xff00) != 0x4300) &&
             ((pdev->device & 0xff00) != 0x4700) &&
             ((pdev->device < 43000) || (pdev->device > 43999))))
                return -ENODEV;
        if ((val & 0x0000ff00) != 0)
                pci_write_config_dword(pdev, 0x40, val & 0xffff00ff);
  
-       hw = ieee80211_alloc_hw(sizeof(struct wl_info), &wl_ops);
+       hw = ieee80211_alloc_hw(sizeof(struct brcms_info), &brcms_ops);
        if (!hw) {
                pr_err("%s: ieee80211_alloc_hw failed\n", __func__);
                return -ENOMEM;
  
        memset(hw->priv, 0, sizeof(*wl));
  
-       wl = wl_attach(pdev->vendor, pdev->device, pci_resource_start(pdev, 0),
-                      PCI_BUS, pdev, pdev->irq);
+       wl = brcms_attach(pdev->vendor, pdev->device,
+                         pci_resource_start(pdev, 0), PCI_BUS, pdev,
+                         pdev->irq);
  
        if (!wl) {
-               pr_err("%s: %s: wl_attach failed!\n", KBUILD_MODNAME,
+               pr_err("%s: %s: brcms_attach failed!\n", KBUILD_MODNAME,
                       __func__);
                return -ENODEV;
        }
        return 0;
  }
  
- static int wl_suspend(struct pci_dev *pdev, pm_message_t state)
+ static int brcms_suspend(struct pci_dev *pdev, pm_message_t state)
  {
-       struct wl_info *wl;
+       struct brcms_info *wl;
        struct ieee80211_hw *hw;
  
        hw = pci_get_drvdata(pdev);
        wl = HW_TO_WL(hw);
        if (!wl) {
                wiphy_err(wl->wiphy,
-                         "wl_suspend: pci_get_drvdata failed\n");
+                         "brcms_suspend: pci_get_drvdata failed\n");
                return -ENODEV;
        }
  
        /* only need to flag hw is down for proper resume */
-       WL_LOCK(wl);
+       LOCK(wl);
        wl->pub->hw_up = false;
-       WL_UNLOCK(wl);
+       UNLOCK(wl);
  
        pci_save_state(pdev);
        pci_disable_device(pdev);
        return pci_set_power_state(pdev, PCI_D3hot);
  }
  
- static int wl_resume(struct pci_dev *pdev)
+ static int brcms_resume(struct pci_dev *pdev)
  {
-       struct wl_info *wl;
+       struct brcms_info *wl;
        struct ieee80211_hw *hw;
        int err = 0;
        u32 val;
        wl = HW_TO_WL(hw);
        if (!wl) {
                wiphy_err(wl->wiphy,
-                         "wl: wl_resume: pci_get_drvdata failed\n");
+                         "wl: brcms_resume: pci_get_drvdata failed\n");
                return -ENODEV;
        }
  
  
        /*
        *  done. driver will be put in up state
-       *  in wl_ops_add_interface() call.
+       *  in brcms_ops_add_interface() call.
        */
        return err;
  }
  
  /*
- * called from both kernel as from wl_*()
+ * called from both kernel as from this kernel module.
  * precondition: perimeter lock is not acquired.
  */
- static void wl_remove(struct pci_dev *pdev)
+ static void brcms_remove(struct pci_dev *pdev)
  {
-       struct wl_info *wl;
+       struct brcms_info *wl;
        struct ieee80211_hw *hw;
        int status;
  
        hw = pci_get_drvdata(pdev);
        wl = HW_TO_WL(hw);
        if (!wl) {
-               pr_err("wl: wl_remove: pci_get_drvdata failed\n");
+               pr_err("wl: brcms_remove: pci_get_drvdata failed\n");
                return;
        }
  
-       WL_LOCK(wl);
-       status = wlc_chipmatch(pdev->vendor, pdev->device);
-       WL_UNLOCK(wl);
+       LOCK(wl);
+       status = brcms_c_chipmatch(pdev->vendor, pdev->device);
+       UNLOCK(wl);
        if (!status) {
-               wiphy_err(wl->wiphy, "wl: wl_remove: wlc_chipmatch failed\n");
+               wiphy_err(wl->wiphy, "wl: brcms_remove: chipmatch "
+                                    "failed\n");
                return;
        }
        if (wl->wlc) {
                wiphy_rfkill_set_hw_state(wl->pub->ieee_hw->wiphy, false);
                wiphy_rfkill_stop_polling(wl->pub->ieee_hw->wiphy);
                ieee80211_unregister_hw(hw);
-               WL_LOCK(wl);
-               wl_down(wl);
-               WL_UNLOCK(wl);
+               LOCK(wl);
+               brcms_down(wl);
+               UNLOCK(wl);
        }
        pci_disable_device(pdev);
  
-       wl_free(wl);
+       brcms_free(wl);
  
        pci_set_drvdata(pdev, NULL);
        ieee80211_free_hw(hw);
  }
  
- static struct pci_driver wl_pci_driver = {
+ static struct pci_driver brcms_pci_driver = {
        .name     = KBUILD_MODNAME,
-       .probe    = wl_pci_probe,
-       .suspend  = wl_suspend,
-       .resume   = wl_resume,
-       .remove   = __devexit_p(wl_remove),
-       .id_table = wl_id_table,
+       .probe    = brcms_pci_probe,
+       .suspend  = brcms_suspend,
+       .resume   = brcms_resume,
+       .remove   = __devexit_p(brcms_remove),
+       .id_table = brcms_pci_id_table,
  };
  
  /**
   * This is the main entry point for the WL driver.
   *
   * This function determines if a device pointed to by pdev is a WL device,
-  * and if so, performs a wl_attach() on it.
+  * and if so, performs a brcms_attach() on it.
   *
   */
- static int __init wl_module_init(void)
+ static int __init brcms_module_init(void)
  {
        int error = -ENODEV;
  
  #ifdef BCMDBG
        if (msglevel != 0xdeadbeef)
-               wl_msg_level = msglevel;
-       else {
-               char *var = getvar(NULL, "wl_msglevel");
-               if (var) {
-                       unsigned long value;
-                       (void)strict_strtoul(var, 0, &value);
-                       wl_msg_level = value;
-               }
-       }
+               brcm_msg_level = msglevel;
        if (phymsglevel != 0xdeadbeef)
                phyhal_msg_level = phymsglevel;
-       else {
-               char *var = getvar(NULL, "phy_msglevel");
-               if (var) {
-                       unsigned long value;
-                       (void)strict_strtoul(var, 0, &value);
-                       phyhal_msg_level = value;
-               }
-       }
  #endif                                /* BCMDBG */
  
-       error = pci_register_driver(&wl_pci_driver);
+       error = pci_register_driver(&brcms_pci_driver);
        if (!error)
                return 0;
  
   * system.
   *
   */
- static void __exit wl_module_exit(void)
+ static void __exit brcms_module_exit(void)
  {
-       pci_unregister_driver(&wl_pci_driver);
+       pci_unregister_driver(&brcms_pci_driver);
  
  }
  
- module_init(wl_module_init);
- module_exit(wl_module_exit);
+ module_init(brcms_module_init);
+ module_exit(brcms_module_exit);
  
  /**
   * This function frees the WL per-device resources.
   * precondition: can both be called locked and unlocked
   *
   */
- static void wl_free(struct wl_info *wl)
+ static void brcms_free(struct brcms_info *wl)
  {
-       struct wl_timer *t, *next;
+       struct brcms_timer *t, *next;
  
        /* free ucode data */
        if (wl->fw.fw_cnt)
-               wl_ucode_data_free();
+               brcms_ucode_data_free();
        if (wl->irq)
                free_irq(wl->irq, wl);
  
        tasklet_kill(&wl->tasklet);
  
        if (wl->pub) {
-               wlc_module_unregister(wl->pub, "linux", wl);
+               brcms_c_module_unregister(wl->pub, "linux", wl);
        }
  
        /* free common resources */
        if (wl->wlc) {
-               wlc_detach(wl->wlc);
+               brcms_c_detach(wl->wlc);
                wl->wlc = NULL;
                wl->pub = NULL;
        }
  }
  
  /* flags the given rate in rateset as requested */
- static void wl_set_basic_rate(struct wl_rateset *rs, u16 rate, bool is_br)
+ static void brcms_set_basic_rate(struct wl_rateset *rs, u16 rate, bool is_br)
  {
        u32 i;
  
                        continue;
  
                if (is_br)
-                       rs->rates[i] |= WLC_RATE_FLAG;
+                       rs->rates[i] |= BRCMS_RATE_FLAG;
                else
-                       rs->rates[i] &= WLC_RATE_MASK;
+                       rs->rates[i] &= BRCMS_RATE_MASK;
                return;
        }
  }
  /*
   * precondition: perimeter lock has been acquired
   */
- void wl_txflowcontrol(struct wl_info *wl, struct wl_if *wlif, bool state,
-                     int prio)
+ void brcms_txflowcontrol(struct brcms_info *wl, struct brcms_if *wlif,
+                        bool state, int prio)
  {
        wiphy_err(wl->wiphy, "Shouldn't be here %s\n", __func__);
  }
  /*
   * precondition: perimeter lock has been acquired
   */
- void wl_init(struct wl_info *wl)
+ void brcms_init(struct brcms_info *wl)
  {
        BCMMSG(WL_TO_HW(wl)->wiphy, "wl%d\n", wl->pub->unit);
-       wl_reset(wl);
+       brcms_reset(wl);
  
-       wlc_init(wl->wlc);
+       brcms_c_init(wl->wlc);
  }
  
  /*
   * precondition: perimeter lock has been acquired
   */
- uint wl_reset(struct wl_info *wl)
+ uint brcms_reset(struct brcms_info *wl)
  {
        BCMMSG(WL_TO_HW(wl)->wiphy, "wl%d\n", wl->pub->unit);
-       wlc_reset(wl->wlc);
+       brcms_c_reset(wl->wlc);
  
        /* dpc will not be rescheduled */
        wl->resched = 0;
   * These are interrupt on/off entry points. Disable interrupts
   * during interrupt state transition.
   */
- void wl_intrson(struct wl_info *wl)
+ void brcms_intrson(struct brcms_info *wl)
  {
        unsigned long flags;
  
        INT_LOCK(wl, flags);
-       wlc_intrson(wl->wlc);
+       brcms_c_intrson(wl->wlc);
        INT_UNLOCK(wl, flags);
  }
  
  /*
   * precondition: perimeter lock has been acquired
   */
- bool wl_alloc_dma_resources(struct wl_info *wl, uint addrwidth)
+ bool wl_alloc_dma_resources(struct brcms_info *wl, uint addrwidth)
  {
        return true;
  }
  
- u32 wl_intrsoff(struct wl_info *wl)
+ u32 brcms_intrsoff(struct brcms_info *wl)
  {
        unsigned long flags;
        u32 status;
  
        INT_LOCK(wl, flags);
-       status = wlc_intrsoff(wl->wlc);
+       status = brcms_c_intrsoff(wl->wlc);
        INT_UNLOCK(wl, flags);
        return status;
  }
  
- void wl_intrsrestore(struct wl_info *wl, u32 macintmask)
+ void brcms_intrsrestore(struct brcms_info *wl, u32 macintmask)
  {
        unsigned long flags;
  
        INT_LOCK(wl, flags);
-       wlc_intrsrestore(wl->wlc, macintmask);
+       brcms_c_intrsrestore(wl->wlc, macintmask);
        INT_UNLOCK(wl, flags);
  }
  
  /*
   * precondition: perimeter lock has been acquired
   */
- int wl_up(struct wl_info *wl)
+ int brcms_up(struct brcms_info *wl)
  {
        int error = 0;
  
        if (wl->pub->up)
                return 0;
  
-       error = wlc_up(wl->wlc);
+       error = brcms_c_up(wl->wlc);
  
        return error;
  }
  /*
   * precondition: perimeter lock has been acquired
   */
- void wl_down(struct wl_info *wl)
+ void brcms_down(struct brcms_info *wl)
  {
        uint callbacks, ret_val = 0;
  
        /* call common down function */
-       ret_val = wlc_down(wl->wlc);
+       ret_val = brcms_c_down(wl->wlc);
        callbacks = atomic_read(&wl->callbacks) - ret_val;
  
        /* wait for down callbacks to complete */
-       WL_UNLOCK(wl);
+       UNLOCK(wl);
  
        /* For HIGH_only driver, it's important to actually schedule other work,
         * not just spin wait since everything runs at schedule level
         */
        SPINWAIT((atomic_read(&wl->callbacks) > callbacks), 100 * 1000);
  
-       WL_LOCK(wl);
+       LOCK(wl);
  }
  
- static irqreturn_t wl_isr(int irq, void *dev_id)
+ static irqreturn_t brcms_isr(int irq, void *dev_id)
  {
-       struct wl_info *wl;
+       struct brcms_info *wl;
        bool ours, wantdpc;
        unsigned long flags;
  
-       wl = (struct wl_info *) dev_id;
+       wl = (struct brcms_info *) dev_id;
  
-       WL_ISRLOCK(wl, flags);
+       ISR_LOCK(wl, flags);
  
        /* call common first level interrupt handler */
-       ours = wlc_isr(wl->wlc, &wantdpc);
+       ours = brcms_c_isr(wl->wlc, &wantdpc);
        if (ours) {
                /* if more to do... */
                if (wantdpc) {
                }
        }
  
-       WL_ISRUNLOCK(wl, flags);
+       ISR_UNLOCK(wl, flags);
  
        return IRQ_RETVAL(ours);
  }
  
- static void wl_dpc(unsigned long data)
+ static void brcms_dpc(unsigned long data)
  {
-       struct wl_info *wl;
+       struct brcms_info *wl;
  
-       wl = (struct wl_info *) data;
+       wl = (struct brcms_info *) data;
  
-       WL_LOCK(wl);
+       LOCK(wl);
  
        /* call the common second level interrupt handler */
        if (wl->pub->up) {
                        unsigned long flags;
  
                        INT_LOCK(wl, flags);
-                       wlc_intrsupd(wl->wlc);
+                       brcms_c_intrsupd(wl->wlc);
                        INT_UNLOCK(wl, flags);
                }
  
-               wl->resched = wlc_dpc(wl->wlc, true);
+               wl->resched = brcms_c_dpc(wl->wlc, true);
        }
  
-       /* wlc_dpc() may bring the driver down */
+       /* brcms_c_dpc() may bring the driver down */
        if (!wl->pub->up)
                goto done;
  
                tasklet_schedule(&wl->tasklet);
        else {
                /* re-enable interrupts */
-               wl_intrson(wl);
+               brcms_intrson(wl);
        }
  
   done:
-       WL_UNLOCK(wl);
+       UNLOCK(wl);
  }
  
  /*
   * is called by the kernel from software irq context
   */
- static void wl_timer(unsigned long data)
+ static void brcms_timer(unsigned long data)
  {
-       _wl_timer((struct wl_timer *) data);
+       _brcms_timer((struct brcms_timer *) data);
  }
  
  /*
  * precondition: perimeter lock is not acquired
   */
- static void _wl_timer(struct wl_timer *t)
+ static void _brcms_timer(struct brcms_timer *t)
  {
-       WL_LOCK(t->wl);
+       LOCK(t->wl);
  
        if (t->set) {
                if (t->periodic) {
  
        atomic_dec(&t->wl->callbacks);
  
-       WL_UNLOCK(t->wl);
+       UNLOCK(t->wl);
  }
  
  /*
   *
   * precondition: perimeter lock has been acquired
   */
- struct wl_timer *wl_init_timer(struct wl_info *wl, void (*fn) (void *arg),
-                              void *arg, const char *name)
+ struct brcms_timer *brcms_init_timer(struct brcms_info *wl,
+                                    void (*fn) (void *arg),
+                                    void *arg, const char *name)
  {
-       struct wl_timer *t;
+       struct brcms_timer *t;
  
-       t = kzalloc(sizeof(struct wl_timer), GFP_ATOMIC);
+       t = kzalloc(sizeof(struct brcms_timer), GFP_ATOMIC);
        if (!t) {
-               wiphy_err(wl->wiphy, "wl%d: wl_init_timer: out of memory\n",
+               wiphy_err(wl->wiphy, "wl%d: brcms_init_timer: out of memory\n",
                          wl->pub->unit);
                return 0;
        }
  
        init_timer(&t->timer);
        t->timer.data = (unsigned long) t;
-       t->timer.function = wl_timer;
+       t->timer.function = brcms_timer;
        t->wl = wl;
        t->fn = fn;
        t->arg = arg;
   *
   * precondition: perimeter lock has been acquired
   */
- void wl_add_timer(struct wl_info *wl, struct wl_timer *t, uint ms, int periodic)
+ void brcms_add_timer(struct brcms_info *wl, struct brcms_timer *t, uint ms,
+                    int periodic)
  {
  #ifdef BCMDBG
        if (t->set) {
   *
   * precondition: perimeter lock has been acquired
   */
- bool wl_del_timer(struct wl_info *wl, struct wl_timer *t)
+ bool brcms_del_timer(struct brcms_info *wl, struct brcms_timer *t)
  {
        if (t->set) {
                t->set = false;
  /*
   * precondition: perimeter lock has been acquired
   */
- void wl_free_timer(struct wl_info *wl, struct wl_timer *t)
+ void brcms_free_timer(struct brcms_info *wl, struct brcms_timer *t)
  {
-       struct wl_timer *tmp;
+       struct brcms_timer *tmp;
  
        /* delete the timer in case it is active */
-       wl_del_timer(wl, t);
+       brcms_del_timer(wl, t);
  
        if (wl->timers == t) {
                wl->timers = wl->timers->next;
@@@ -1735,13 -1720,13 +1721,13 @@@ static int wl_linux_watchdog(void *ctx
        return 0;
  }
  
- struct wl_fw_hdr {
+ struct firmware_hdr {
        u32 offset;
        u32 len;
        u32 idx;
  };
  
- char *wl_firmwares[WL_MAX_FW] = {
+ char *brcms_firmwares[MAX_FW_IMAGES] = {
        "brcm/bcm43xx",
        NULL
  };
  /*
   * precondition: perimeter lock has been acquired
   */
- int wl_ucode_init_buf(struct wl_info *wl, void **pbuf, u32 idx)
+ int brcms_ucode_init_buf(struct brcms_info *wl, void **pbuf, u32 idx)
  {
        int i, entry;
        const u8 *pdata;
-       struct wl_fw_hdr *hdr;
+       struct firmware_hdr *hdr;
        for (i = 0; i < wl->fw.fw_cnt; i++) {
-               hdr = (struct wl_fw_hdr *)wl->fw.fw_hdr[i]->data;
+               hdr = (struct firmware_hdr *)wl->fw.fw_hdr[i]->data;
                for (entry = 0; entry < wl->fw.hdr_num_entries[i];
                     entry++, hdr++) {
                        if (hdr->idx == idx) {
@@@ -1779,16 -1764,16 +1765,16 @@@ fail
  }
  
  /*
-  * Precondition: Since this function is called in wl_pci_probe() context,
+  * Precondition: Since this function is called in brcms_pci_probe() context,
   * no locking is required.
   */
- int wl_ucode_init_uint(struct wl_info *wl, u32 *data, u32 idx)
+ int brcms_ucode_init_uint(struct brcms_info *wl, u32 *data, u32 idx)
  {
        int i, entry;
        const u8 *pdata;
-       struct wl_fw_hdr *hdr;
+       struct firmware_hdr *hdr;
        for (i = 0; i < wl->fw.fw_cnt; i++) {
-               hdr = (struct wl_fw_hdr *)wl->fw.fw_hdr[i]->data;
+               hdr = (struct firmware_hdr *)wl->fw.fw_hdr[i]->data;
                for (entry = 0; entry < wl->fw.hdr_num_entries[i];
                     entry++, hdr++) {
                        if (hdr->idx == idx) {
  }
  
  /*
-  * Precondition: Since this function is called in wl_pci_probe() context,
+  * Precondition: Since this function is called in brcms_pci_probe() context,
   * no locking is required.
   */
- static int wl_request_fw(struct wl_info *wl, struct pci_dev *pdev)
+ static int brcms_request_fw(struct brcms_info *wl, struct pci_dev *pdev)
  {
        int status;
        struct device *device = &pdev->dev;
        char fw_name[100];
        int i;
  
-       memset((void *)&wl->fw, 0, sizeof(struct wl_firmware));
-       for (i = 0; i < WL_MAX_FW; i++) {
-               if (wl_firmwares[i] == NULL)
+       memset((void *)&wl->fw, 0, sizeof(struct brcms_firmware));
+       for (i = 0; i < MAX_FW_IMAGES; i++) {
+               if (brcms_firmwares[i] == NULL)
                        break;
-               sprintf(fw_name, "%s-%d.fw", wl_firmwares[i],
+               sprintf(fw_name, "%s-%d.fw", brcms_firmwares[i],
                        UCODE_LOADER_API_VER);
                status = request_firmware(&wl->fw.fw_bin[i], fw_name, device);
                if (status) {
                                  KBUILD_MODNAME, fw_name);
                        return status;
                }
-               sprintf(fw_name, "%s_hdr-%d.fw", wl_firmwares[i],
+               sprintf(fw_name, "%s_hdr-%d.fw", brcms_firmwares[i],
                        UCODE_LOADER_API_VER);
                status = request_firmware(&wl->fw.fw_hdr[i], fw_name, device);
                if (status) {
                        return status;
                }
                wl->fw.hdr_num_entries[i] =
-                   wl->fw.fw_hdr[i]->size / (sizeof(struct wl_fw_hdr));
+                   wl->fw.fw_hdr[i]->size / (sizeof(struct firmware_hdr));
        }
        wl->fw.fw_cnt = i;
-       return wl_ucode_data_init(wl);
+       return brcms_ucode_data_init(wl);
  }
  
  /*
   * precondition: can both be called locked and unlocked
   */
- void wl_ucode_free_buf(void *p)
+ void brcms_ucode_free_buf(void *p)
  {
        kfree(p);
  }
  
  /*
-  * Precondition: Since this function is called in wl_pci_probe() context,
+  * Precondition: Since this function is called in brcms_pci_probe() context,
   * no locking is required.
   */
- static void wl_release_fw(struct wl_info *wl)
+ static void brcms_release_fw(struct brcms_info *wl)
  {
        int i;
-       for (i = 0; i < WL_MAX_FW; i++) {
+       for (i = 0; i < MAX_FW_IMAGES; i++) {
                release_firmware(wl->fw.fw_bin[i]);
                release_firmware(wl->fw.fw_hdr[i]);
        }
  /*
   * checks validity of all firmware images loaded from user space
   *
-  * Precondition: Since this function is called in wl_pci_probe() context,
+  * Precondition: Since this function is called in brcms_pci_probe() context,
   * no locking is required.
   */
- int wl_check_firmwares(struct wl_info *wl)
+ int brcms_check_firmwares(struct brcms_info *wl)
  {
        int i;
        int entry;
        int rc = 0;
        const struct firmware *fw;
        const struct firmware *fw_hdr;
-       struct wl_fw_hdr *ucode_hdr;
-       for (i = 0; i < WL_MAX_FW && rc == 0; i++) {
+       struct firmware_hdr *ucode_hdr;
+       for (i = 0; i < MAX_FW_IMAGES && rc == 0; i++) {
                fw =  wl->fw.fw_bin[i];
                fw_hdr = wl->fw.fw_hdr[i];
                if (fw == NULL && fw_hdr == NULL) {
                        wiphy_err(wl->wiphy, "%s: invalid bin/hdr fw\n",
                                  __func__);
                        rc = -EBADF;
-               } else if (fw_hdr->size % sizeof(struct wl_fw_hdr)) {
+               } else if (fw_hdr->size % sizeof(struct firmware_hdr)) {
                        wiphy_err(wl->wiphy, "%s: non integral fw hdr file "
                                "size %zu/%zu\n", __func__, fw_hdr->size,
-                               sizeof(struct wl_fw_hdr));
+                               sizeof(struct firmware_hdr));
                        rc = -EBADF;
                } else if (fw->size < MIN_FW_SIZE || fw->size > MAX_FW_SIZE) {
                        wiphy_err(wl->wiphy, "%s: out of bounds fw file size "
                        rc = -EBADF;
                } else {
                        /* check if ucode section overruns firmware image */
-                       ucode_hdr = (struct wl_fw_hdr *)fw_hdr->data;
+                       ucode_hdr = (struct firmware_hdr *)fw_hdr->data;
                        for (entry = 0; entry < wl->fw.hdr_num_entries[i] &&
                             !rc; entry++, ucode_hdr++) {
                                if (ucode_hdr->offset + ucode_hdr->len >
  /*
   * precondition: perimeter lock has been acquired
   */
- bool wl_rfkill_set_hw_state(struct wl_info *wl)
+ bool brcms_rfkill_set_hw_state(struct brcms_info *wl)
  {
-       bool blocked = wlc_check_radio_disabled(wl->wlc);
+       bool blocked = brcms_c_check_radio_disabled(wl->wlc);
  
-       WL_UNLOCK(wl);
+       UNLOCK(wl);
        wiphy_rfkill_set_hw_state(wl->pub->ieee_hw->wiphy, blocked);
        if (blocked)
                wiphy_rfkill_start_polling(wl->pub->ieee_hw->wiphy);
-       WL_LOCK(wl);
+       LOCK(wl);
        return blocked;
  }
  
  /*
   * precondition: perimeter lock has been acquired
   */
- void wl_msleep(struct wl_info *wl, uint ms)
+ void brcms_msleep(struct brcms_info *wl, uint ms)
  {
-       WL_UNLOCK(wl);
+       UNLOCK(wl);
        msleep(ms);
-       WL_LOCK(wl);
+       LOCK(wl);
  }
   * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
   */
  
- #ifndef _wl_mac80211_h_
- #define _wl_mac80211_h_
+ #ifndef _BRCM_MAC80211_IF_H_
+ #define _BRCM_MAC80211_IF_H_
+ #include <linux/timer.h>
+ #include <linux/interrupt.h>
+ /* softmac ioctl definitions */
+ #define BRCMS_SET_SHORTSLOT_OVERRIDE          146
  
 +#include <linux/interrupt.h>
 +
  /* BMAC Note: High-only driver is no longer working in softirq context as it needs to block and
   * sleep so perimeter lock has to be a semaphore instead of spinlock. This requires timers to be
   * submitted to workqueue instead of being on kernel timer
   */
- struct wl_timer {
+ struct brcms_timer {
        struct timer_list timer;
-       struct wl_info *wl;
+       struct brcms_info *wl;
        void (*fn) (void *);
        void *arg;              /* argument to fn */
        uint ms;
        bool periodic;
        bool set;
-       struct wl_timer *next;
+       struct brcms_timer *next;
  #ifdef BCMDBG
        char *name;             /* Description of the timer */
  #endif
  };
  
- struct wl_if {
+ struct brcms_if {
        uint subunit;           /* WDS/BSS unit */
        struct pci_dev *pci_dev;
  };
  
- #define WL_MAX_FW             4
- struct wl_firmware {
+ #define MAX_FW_IMAGES         4
+ struct brcms_firmware {
        u32 fw_cnt;
-       const struct firmware *fw_bin[WL_MAX_FW];
-       const struct firmware *fw_hdr[WL_MAX_FW];
-       u32 hdr_num_entries[WL_MAX_FW];
+       const struct firmware *fw_bin[MAX_FW_IMAGES];
+       const struct firmware *fw_hdr[MAX_FW_IMAGES];
+       u32 hdr_num_entries[MAX_FW_IMAGES];
  };
  
- struct wl_info {
-       struct wlc_pub *pub;            /* pointer to public wlc state */
+ struct brcms_info {
+       struct brcms_pub *pub;          /* pointer to public wlc state */
        void *wlc;              /* pointer to private common os-independent data */
        u32 magic;
  
  
        spinlock_t lock;        /* per-device perimeter lock */
        spinlock_t isr_lock;    /* per-device ISR synchronization lock */
+       /* bus type and regsva for unmap in brcms_free() */
        uint bcm_bustype;       /* bus type */
-       bool piomode;           /* set from insmod argument */
        void *regsva;           /* opaque chip registers virtual address */
+       /* timer related fields */
        atomic_t callbacks;     /* # outstanding callback functions */
-       struct wl_timer *timers;        /* timer cleanup queue */
+       struct brcms_timer *timers;     /* timer cleanup queue */
        struct tasklet_struct tasklet;  /* dpc tasklet */
        bool resched;           /* dpc needs to be and is rescheduled */
  #ifdef LINUXSTA_PS
        u32 pci_psstate[16];    /* pci ps-state save/restore */
  #endif
-       struct wl_firmware fw;
+       struct brcms_firmware fw;
        struct wiphy *wiphy;
  };
  
- #define WL_LOCK(wl)   spin_lock_bh(&(wl)->lock)
- #define WL_UNLOCK(wl) spin_unlock_bh(&(wl)->lock)
- /* locking from inside wl_isr */
- #define WL_ISRLOCK(wl, flags) do {spin_lock(&(wl)->isr_lock); (void)(flags); } while (0)
- #define WL_ISRUNLOCK(wl, flags) do {spin_unlock(&(wl)->isr_lock); (void)(flags); } while (0)
+ /* misc callbacks */
+ extern void brcms_init(struct brcms_info *wl);
+ extern uint brcms_reset(struct brcms_info *wl);
+ extern void brcms_intrson(struct brcms_info *wl);
+ extern u32 brcms_intrsoff(struct brcms_info *wl);
+ extern void brcms_intrsrestore(struct brcms_info *wl, u32 macintmask);
+ extern int brcms_up(struct brcms_info *wl);
+ extern void brcms_down(struct brcms_info *wl);
+ extern void brcms_txflowcontrol(struct brcms_info *wl, struct brcms_if *wlif,
+                               bool state, int prio);
+ extern bool wl_alloc_dma_resources(struct brcms_info *wl, uint dmaddrwidth);
+ extern bool brcms_rfkill_set_hw_state(struct brcms_info *wl);
  
- /* locking under WL_LOCK() to synchronize with wl_isr */
- #define INT_LOCK(wl, flags)   spin_lock_irqsave(&(wl)->isr_lock, flags)
- #define INT_UNLOCK(wl, flags) spin_unlock_irqrestore(&(wl)->isr_lock, flags)
+ /* timer functions */
+ extern struct brcms_timer *brcms_init_timer(struct brcms_info *wl,
+                                     void (*fn) (void *arg), void *arg,
+                                     const char *name);
+ extern void brcms_free_timer(struct brcms_info *wl, struct brcms_timer *timer);
+ extern void brcms_add_timer(struct brcms_info *wl, struct brcms_timer *timer,
+                           uint ms, int periodic);
+ extern bool brcms_del_timer(struct brcms_info *wl, struct brcms_timer *timer);
+ extern void brcms_msleep(struct brcms_info *wl, uint ms);
  
- #endif                                /* _wl_mac80211_h_ */
+ #endif                                /* _BRCM_MAC80211_IF_H_ */
@@@ -1,5 -1,5 +1,5 @@@
  /*
-  * Copyright Ã‚© 2006-2007 Intel Corporation
+  * Copyright Ã‚© 2006-2011 Intel Corporation
   *
   * This program is free software; you can redistribute it and/or modify it
   * under the terms and conditions of the GNU General Public License,
  #include <linux/pm_runtime.h>
  
  #include <drm/drmP.h>
- #include "psb_fb.h"
+ #include "framebuffer.h"
  #include "psb_drv.h"
  #include "psb_intel_drv.h"
  #include "psb_intel_reg.h"
  #include "psb_intel_display.h"
- #include "psb_powermgmt.h"
+ #include "power.h"
  
+ #include "mdfld_output.h"
  
  struct psb_intel_clock_t {
        /* given values */
@@@ -331,7 -332,7 +332,7 @@@ static bool psb_intel_find_best_PLL(str
  void psb_intel_wait_for_vblank(struct drm_device *dev)
  {
        /* Wait for 20ms, i.e. one cycle at 50hz. */
 -      udelay(20000);
 +      mdelay(20);
  }
  
  int psb_intel_pipe_set_base(struct drm_crtc *crtc,
        u32 dspcntr;
        int ret = 0;
  
-       PSB_DEBUG_ENTRY("\n");
+       if (!gma_power_begin(dev, true))
+               return 0;
  
        /* no fb bound */
        if (!crtc->fb) {
-               DRM_DEBUG("No FB bound\n");
-               return 0;
+               dev_dbg(dev->dev, "No FB bound\n");
+               goto psb_intel_pipe_cleaner;
        }
  
-       if (!gma_power_begin(dev, true))
-               return 0;
        /* We are displaying this buffer, make sure it is actually loaded
           into the GTT */
        ret = psb_gtt_pin(psbfb->gtt);
                dspcntr |= DISPPLANE_32BPP_NO_ALPHA;
                break;
        default:
-               DRM_ERROR("Unknown color depth\n");
+               dev_err(dev->dev, "Unknown color depth\n");
                ret = -EINVAL;
                psb_gtt_unpin(psbfb->gtt);
                goto psb_intel_pipe_set_base_exit;
        REG_WRITE(dspcntr_reg, dspcntr);
  
  
-       DRM_DEBUG("Writing base %08lX %08lX %d %d\n", start, offset, x, y);
        if (0 /* FIXMEAC - check what PSB needs */) {
                REG_WRITE(dspbase, offset);
                REG_READ(dspbase);
                REG_READ(dspbase);
        }
  
+ psb_intel_pipe_cleaner:
        /* If there was a previous display we can now unpin it */
        if (old_fb)
                psb_gtt_unpin(to_psb_fb(old_fb)->gtt);
@@@ -588,6 -587,7 +587,7 @@@ static int psb_intel_crtc_mode_set(stru
  {
        struct drm_device *dev = crtc->dev;
        struct psb_intel_crtc *psb_intel_crtc = to_psb_intel_crtc(crtc);
+       struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private;
        int pipe = psb_intel_crtc->pipe;
        int fp_reg = (pipe == 0) ? FPA0 : FPB0;
        int dpll_reg = (pipe == 0) ? DPLL_A : DPLL_B;
        struct drm_mode_config *mode_config = &dev->mode_config;
        struct drm_connector *connector;
  
+       /* No scan out no play */
+       if (crtc->fb == NULL) {
+               crtc_funcs->mode_set_base(crtc, x, y, old_fb);
+               return 0;
+       }
        list_for_each_entry(connector, &mode_config->connector_list, head) {
                struct psb_intel_output *psb_intel_output =
                    to_psb_intel_output(connector);
        ok = psb_intel_find_best_PLL(crtc, adjusted_mode->clock, refclk,
                                 &clock);
        if (!ok) {
-               DRM_ERROR("Couldn't find PLL settings for mode!\n");
+               dev_err(dev->dev, "Couldn't find PLL settings for mode!\n");
                return 0;
        }
  
        if (psb_intel_panel_fitter_pipe(dev) == pipe)
                REG_WRITE(PFIT_CONTROL, 0);
  
-       DRM_DEBUG("Mode for pipe %c:\n", pipe == 0 ? 'A' : 'B');
        drm_mode_debug_printmodeline(mode);
  
        if (dpll & DPLL_VCO_ENABLE) {
        if (is_lvds) {
                u32 lvds = REG_READ(LVDS);
  
-               lvds |=
-                   LVDS_PORT_EN | LVDS_A0A2_CLKA_POWER_UP |
-                   LVDS_PIPEB_SELECT;
+               lvds &= ~LVDS_PIPEB_SELECT;
+               if (pipe == 1)
+                       lvds |= LVDS_PIPEB_SELECT;
+               lvds |= LVDS_PORT_EN | LVDS_A0A2_CLKA_POWER_UP;
                /* Set the B0-B3 data pairs corresponding to
                 * whether we're going to
                 * set the DPLLs for dual-channel mode or not.
                 */
+               lvds &= ~(LVDS_B0B3_POWER_UP | LVDS_CLKB_POWER_UP);
                if (clock.p2 == 7)
                        lvds |= LVDS_B0B3_POWER_UP | LVDS_CLKB_POWER_UP;
-               else
-                       lvds &= ~(LVDS_B0B3_POWER_UP | LVDS_CLKB_POWER_UP);
  
                /* It would be nice to set 24 vs 18-bit mode (LVDS_A3_POWER_UP)
                 * appropriately here, but we need to look more
        REG_WRITE(dspcntr_reg, dspcntr);
  
        /* Flush the plane changes */
-       {
-               struct drm_crtc_helper_funcs *crtc_funcs =
-                   crtc->helper_private;
-               crtc_funcs->mode_set_base(crtc, x, y, old_fb);
-       }
+       crtc_funcs->mode_set_base(crtc, x, y, old_fb);
  
        psb_intel_wait_for_vblank(dev);
  
@@@ -820,7 -822,7 +822,7 @@@ void psb_intel_crtc_load_lut(struct drm
                palreg = PALETTE_C;
                break;
        default:
-               DRM_ERROR("Illegal Pipe Number.\n");
+               dev_err(dev->dev, "Illegal Pipe Number.\n");
                return;
        }
  
@@@ -863,10 -865,8 +865,8 @@@ static void psb_intel_crtc_save(struct 
        uint32_t paletteReg;
        int i;
  
-       DRM_DEBUG("\n");
        if (!crtc_state) {
-               DRM_DEBUG("No CRTC state found\n");
+               dev_err(dev->dev, "No CRTC state found\n");
                return;
        }
  
  
        crtc_state->saveDSPBASE = REG_READ(pipeA ? DSPABASE : DSPBBASE);
  
-       DRM_DEBUG("(%x %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x)\n",
-                       crtc_state->saveDSPCNTR,
-                       crtc_state->savePIPECONF,
-                       crtc_state->savePIPESRC,
-                       crtc_state->saveFP0,
-                       crtc_state->saveFP1,
-                       crtc_state->saveDPLL,
-                       crtc_state->saveHTOTAL,
-                       crtc_state->saveHBLANK,
-                       crtc_state->saveHSYNC,
-                       crtc_state->saveVTOTAL,
-                       crtc_state->saveVBLANK,
-                       crtc_state->saveVSYNC,
-                       crtc_state->saveDSPSTRIDE,
-                       crtc_state->saveDSPSIZE,
-                       crtc_state->saveDSPPOS,
-                       crtc_state->saveDSPBASE
-               );
        paletteReg = pipeA ? PALETTE_A : PALETTE_B;
        for (i = 0; i < 256; ++i)
                crtc_state->savePalette[i] = REG_READ(paletteReg + (i << 2));
@@@ -929,60 -910,15 +910,15 @@@ static void psb_intel_crtc_restore(stru
        uint32_t paletteReg;
        int i;
  
-       DRM_DEBUG("\n");
        if (!crtc_state) {
-               DRM_DEBUG("No crtc state\n");
+               dev_err(dev->dev, "No crtc state\n");
                return;
        }
  
-       DRM_DEBUG(
-               "current:(%x %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x)\n",
-               REG_READ(pipeA ? DSPACNTR : DSPBCNTR),
-               REG_READ(pipeA ? PIPEACONF : PIPEBCONF),
-               REG_READ(pipeA ? PIPEASRC : PIPEBSRC),
-               REG_READ(pipeA ? FPA0 : FPB0),
-               REG_READ(pipeA ? FPA1 : FPB1),
-               REG_READ(pipeA ? DPLL_A : DPLL_B),
-               REG_READ(pipeA ? HTOTAL_A : HTOTAL_B),
-               REG_READ(pipeA ? HBLANK_A : HBLANK_B),
-               REG_READ(pipeA ? HSYNC_A : HSYNC_B),
-               REG_READ(pipeA ? VTOTAL_A : VTOTAL_B),
-               REG_READ(pipeA ? VBLANK_A : VBLANK_B),
-               REG_READ(pipeA ? VSYNC_A : VSYNC_B),
-               REG_READ(pipeA ? DSPASTRIDE : DSPBSTRIDE),
-               REG_READ(pipeA ? DSPASIZE : DSPBSIZE),
-               REG_READ(pipeA ? DSPAPOS : DSPBPOS),
-               REG_READ(pipeA ? DSPABASE : DSPBBASE)
-               );
-       DRM_DEBUG(
-               "saved: (%x %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x)\n",
-               crtc_state->saveDSPCNTR,
-               crtc_state->savePIPECONF,
-               crtc_state->savePIPESRC,
-               crtc_state->saveFP0,
-               crtc_state->saveFP1,
-               crtc_state->saveDPLL,
-               crtc_state->saveHTOTAL,
-               crtc_state->saveHBLANK,
-               crtc_state->saveHSYNC,
-               crtc_state->saveVTOTAL,
-               crtc_state->saveVBLANK,
-               crtc_state->saveVSYNC,
-               crtc_state->saveDSPSTRIDE,
-               crtc_state->saveDSPSIZE,
-               crtc_state->saveDSPPOS,
-               crtc_state->saveDSPBASE
-               );
        if (crtc_state->saveDPLL & DPLL_VCO_ENABLE) {
                REG_WRITE(pipeA ? DPLL_A : DPLL_B,
                        crtc_state->saveDPLL & ~DPLL_VCO_ENABLE);
                REG_READ(pipeA ? DPLL_A : DPLL_B);
-               DRM_DEBUG("write dpll: %x\n",
-                               REG_READ(pipeA ? DPLL_A : DPLL_B));
                udelay(150);
        }
  
@@@ -1039,11 -975,8 +975,8 @@@ static int psb_intel_crtc_cursor_set(st
        struct drm_gem_object *obj;
        int ret;
  
-       DRM_DEBUG("\n");
        /* if we want to turn of the cursor ignore width and height */
        if (!handle) {
-               DRM_DEBUG("cursor off\n");
                /* turn off the cursor */
                temp = CURSOR_MODE_DISABLE;
  
  
        /* Currently we only support 64x64 cursors */
        if (width != 64 || height != 64) {
-               DRM_ERROR("we currently only support 64x64 cursors\n");
+               dev_dbg(dev->dev, "we currently only support 64x64 cursors\n");
                return -EINVAL;
        }
  
                return -ENOENT;
  
        if (obj->size < width * height * 4) {
-               DRM_ERROR("buffer is to small\n");
+               dev_dbg(dev->dev, "buffer is to small\n");
                return -ENOMEM;
        }
  
        /* Pin the memory into the GTT */
        ret = psb_gtt_pin(gt);
        if (ret) {
-               DRM_ERROR("Can not pin down handle 0x%x\n", handle);
+               dev_err(dev->dev, "Can not pin down handle 0x%x\n", handle);
                return ret;
        }
  
        }
  
        /* unpin the old bo */
-       if (psb_intel_crtc->cursor_obj && psb_intel_crtc->cursor_obj != obj) {
+       if (psb_intel_crtc->cursor_obj) {
                gt = container_of(psb_intel_crtc->cursor_obj,
                                                        struct gtt_range, gem);
                psb_gtt_unpin(gt);
                drm_gem_object_unreference(psb_intel_crtc->cursor_obj);
                psb_intel_crtc->cursor_obj = obj;
        }
        return 0;
  }
  
@@@ -1148,7 -1080,7 +1080,7 @@@ static int psb_intel_crtc_cursor_move(s
        return 0;
  }
  
static void psb_intel_crtc_gamma_set(struct drm_crtc *crtc, u16 *red,
+ void psb_intel_crtc_gamma_set(struct drm_crtc *crtc, u16 *red,
                         u16 *green, u16 *blue, uint32_t type, uint32_t size)
  {
        struct psb_intel_crtc *psb_intel_crtc = to_psb_intel_crtc(crtc);
@@@ -1309,7 -1241,7 +1241,7 @@@ struct drm_display_mode *psb_intel_crtc
        return mode;
  }
  
static void psb_intel_crtc_destroy(struct drm_crtc *crtc)
+ void psb_intel_crtc_destroy(struct drm_crtc *crtc)
  {
        struct psb_intel_crtc *psb_intel_crtc = to_psb_intel_crtc(crtc);
        struct gtt_range *gt;
        kfree(psb_intel_crtc);
  }
  
static const struct drm_crtc_helper_funcs psb_intel_helper_funcs = {
+ const struct drm_crtc_helper_funcs psb_intel_helper_funcs = {
        .dpms = psb_intel_crtc_dpms,
        .mode_fixup = psb_intel_crtc_mode_fixup,
        .mode_set = psb_intel_crtc_mode_set,
@@@ -1346,6 -1278,19 +1278,19 @@@ const struct drm_crtc_funcs psb_intel_c
        .destroy = psb_intel_crtc_destroy,
  };
  
+ /*
+  * Set the default value of cursor control and base register
+  * to zero. This is a workaround for h/w defect on Oaktrail
+  */
+ static void psb_intel_cursor_init(struct drm_device *dev, int pipe)
+ {
+       u32 control[3] = { CURACNTR, CURBCNTR, CURCCNTR };
+       u32 base[3] = { CURABASE, CURBBASE, CURCBASE };
+       REG_WRITE(control[pipe], 0);
+       REG_WRITE(base[pipe], 0);
+ }
  void psb_intel_crtc_init(struct drm_device *dev, int pipe,
                     struct psb_intel_mode_device *mode_dev)
  {
        int i;
        uint16_t *r_base, *g_base, *b_base;
  
-       PSB_DEBUG_ENTRY("\n");
        /* We allocate a extra array of drm_connector pointers
         * for fbdev after the crtc */
        psb_intel_crtc =
        psb_intel_crtc->crtc_state =
                kzalloc(sizeof(struct psb_intel_crtc_state), GFP_KERNEL);
        if (!psb_intel_crtc->crtc_state) {
-               DRM_INFO("Crtc state error: No memory\n");
+               dev_err(dev->dev, "Crtc state error: No memory\n");
                kfree(psb_intel_crtc);
                return;
        }
  
-       drm_crtc_init(dev, &psb_intel_crtc->base, &psb_intel_crtc_funcs);
+       /* Set the CRTC operations from the chip specific data */
+       drm_crtc_init(dev, &psb_intel_crtc->base, dev_priv->ops->crtc_funcs);
  
        drm_mode_crtc_set_gamma_size(&psb_intel_crtc->base, 256);
        psb_intel_crtc->pipe = pipe;
        psb_intel_crtc->mode_dev = mode_dev;
        psb_intel_crtc->cursor_addr = 0;
  
-       if (IS_MRST(dev))
-               drm_crtc_helper_add(&psb_intel_crtc->base,
-                                   &mrst_helper_funcs);
-       else
-               drm_crtc_helper_add(&psb_intel_crtc->base,
-                                   &psb_intel_helper_funcs);
+       drm_crtc_helper_add(&psb_intel_crtc->base,
+                                               dev_priv->ops->crtc_helper);
  
        /* Setup the array of drm_connector pointer array */
        psb_intel_crtc->mode_set.crtc = &psb_intel_crtc->base;
        psb_intel_crtc->mode_set.connectors =
            (struct drm_connector **) (psb_intel_crtc + 1);
        psb_intel_crtc->mode_set.num_connectors = 0;
+       psb_intel_cursor_init(dev, pipe);
  }
  
  int psb_intel_get_pipe_from_crtc_id(struct drm_device *dev, void *data,
        struct psb_intel_crtc *crtc;
  
        if (!dev_priv) {
-               DRM_ERROR("called with no initialization\n");
+               dev_err(dev->dev, "called with no initialization\n");
                return -EINVAL;
        }
  
                        DRM_MODE_OBJECT_CRTC);
  
        if (!drmmode_obj) {
-               DRM_ERROR("no such CRTC id\n");
+               dev_err(dev->dev, "no such CRTC id\n");
                return -EINVAL;
        }
  
@@@ -24,6 -24,7 +24,6 @@@
  #include <linux/hiddev.h>
  #include <linux/pci.h>
  #include <linux/dmi.h>
 -#include <linux/delay.h>
  
  #include "hyperv.h"
  
@@@ -935,7 -936,6 +935,6 @@@ static int __init mousevsc_init(void
               sizeof(struct hv_guid));
  
        drv->driver.name = driver_name;
-       drv->name = driver_name;
  
        /* The driver belongs to vmbus */
        vmbus_child_driver_register(&drv->driver);
@@@ -39,8 -39,6 +39,6 @@@
   *
   */
  
- #include <linux/version.h>
  #include <linux/module.h>
  #include <linux/kmod.h>
  #include <linux/kernel.h>
@@@ -475,14 -473,14 +473,14 @@@ static int lirc_thread(void *arg
        dprintk("poll thread started\n");
  
        while (!kthread_should_stop()) {
 +              set_current_state(TASK_INTERRUPTIBLE);
 +
                /* if device not opened, we can sleep half a second */
                if (atomic_read(&ir->open_count) == 0) {
                        schedule_timeout(HZ/2);
                        continue;
                }
  
 -              set_current_state(TASK_INTERRUPTIBLE);
 -
                /*
                 * This is ~113*2 + 24 + jitter (2*repeat gap + code length).
                 * We use this interval as the chip resets every time you poll
  #define IEEE80211_H
  #include <linux/if_ether.h> /* ETH_ALEN */
  #include <linux/kernel.h>   /* ARRAY_SIZE */
- #include <linux/version.h>
  #include <linux/jiffies.h>
  #include <linux/timer.h>
  #include <linux/sched.h>
  #include <linux/semaphore.h>
  #include <linux/wireless.h>
  #include <linux/ieee80211.h>
 +#include <linux/interrupt.h>
  
  #define KEY_TYPE_NA           0x0
  #define KEY_TYPE_WEP40                0x1
@@@ -19,8 -19,6 +19,7 @@@
  #include <linux/random.h>
  #include <linux/delay.h>
  #include <linux/slab.h>
- #include <linux/version.h>
 +#include <linux/interrupt.h>
  #include <asm/uaccess.h>
  
  #include "dot11d.h"
@@@ -822,7 -820,7 +821,7 @@@ static struct sk_buff* ieee80211_probe_
                cpu_to_le16(ieee->current_network.capability & WLAN_CAPABILITY_IBSS);
  
        if(ieee->short_slot && (ieee->current_network.capability & WLAN_CAPABILITY_SHORT_SLOT))
-               cpu_to_le16((beacon_buf->capability |= WLAN_CAPABILITY_SHORT_SLOT));
+               beacon_buf->capability |= cpu_to_le16(WLAN_CAPABILITY_SHORT_SLOT);
  
        crypt = ieee->crypt[ieee->tx_keyidx];
  
@@@ -2569,11 -2567,8 +2568,8 @@@ void ieee80211_softmac_init(struct ieee
        ieee->beacon_timer.data = (unsigned long) ieee;
        ieee->beacon_timer.function = ieee80211_send_beacon_cb;
  
- #ifdef PF_SYNCTHREAD
-       ieee->wq = create_workqueue(DRV_NAME,0);
- #else
        ieee->wq = create_workqueue(DRV_NAME);
- #endif
        INIT_DELAYED_WORK(&ieee->start_ibss_wq,(void*) ieee80211_start_ibss_wq);
        INIT_WORK(&ieee->associate_complete_wq,(void*) ieee80211_associate_complete_wq);
        INIT_WORK(&ieee->associate_procedure_wq,(void*) ieee80211_associate_procedure_wq);
  #define IEEE80211_H
  #include <linux/if_ether.h> /* ETH_ALEN */
  #include <linux/kernel.h>   /* ARRAY_SIZE */
- #include <linux/version.h>
  #include <linux/module.h>
  #include <linux/jiffies.h>
  #include <linux/timer.h>
  #include <linux/sched.h>
  #include <linux/semaphore.h>
 +#include <linux/interrupt.h>
  
  #include <linux/delay.h>
  #include <linux/wireless.h>
@@@ -45,7 -45,6 +45,6 @@@
  #include <linux/slab.h>
  #include <linux/tcp.h>
  #include <linux/types.h>
- #include <linux/version.h>
  #include <linux/wireless.h>
  #include <linux/etherdevice.h>
  #include <asm/uaccess.h>
@@@ -311,7 -310,7 +310,7 @@@ int __init ieee80211_rtl_init(void
        }
  
        ieee80211_debug_level = debug;
 -      ieee80211_proc = create_proc_entry(DRV_NAME, S_IFDIR, init_net.proc_net);
 +      ieee80211_proc = proc_mkdir(DRV_NAME, init_net.proc_net);
        if (ieee80211_proc == NULL) {
                IEEE80211_ERROR("Unable to create " DRV_NAME
                                " proc directory\n");
@@@ -35,8 -35,6 +35,7 @@@
  #include <linux/proc_fs.h>    // Necessary because we use the proc fs
  #include <linux/if_arp.h>
  #include <linux/random.h>
- #include <linux/version.h>
 +#include <linux/interrupt.h>
  #include <asm/io.h>
  #include "ieee80211/rtl819x_HT.h"
  #include "ieee80211/ieee80211.h"
@@@ -27,8 -27,6 +27,8 @@@
  
  #include <linux/vmalloc.h>
  #include <linux/slab.h>
 +#include <linux/interrupt.h>
 +#include <linux/hardirq.h>
  #include <asm/uaccess.h>
  #include "r8192E_hw.h"
  #include "r8192E.h"
@@@ -508,7 -506,7 +508,7 @@@ static int proc_get_stats_rx(char *page
  static void rtl8192_proc_module_init(void)
  {
        RT_TRACE(COMP_INIT, "Initializing proc filesystem\n");
 -      rtl8192_proc=create_proc_entry(RTL819xE_MODULE_NAME, S_IFDIR, init_net.proc_net);
 +      rtl8192_proc = proc_mkdir(RTL819xE_MODULE_NAME, init_net.proc_net);
  }
  
  
@@@ -540,7 -538,9 +540,7 @@@ static void rtl8192_proc_init_one(struc
        struct net_device *dev = priv->ieee80211->dev;
        struct proc_dir_entry *e;
  
 -      priv->dir_dev = create_proc_entry(dev->name,
 -                                        S_IFDIR | S_IRUGO | S_IXUGO,
 -                                        rtl8192_proc);
 +      priv->dir_dev = proc_mkdir(dev->name, rtl8192_proc);
        if (!priv->dir_dev) {
                RT_TRACE(COMP_ERR, "Unable to initialize /proc/net/rtl8192/%s\n",
                      dev->name);
@@@ -4532,6 -4532,7 +4532,7 @@@ static int __devinit rtl8192_pci_probe(
        u8 unit = 0;
        int ret = -ENODEV;
        unsigned long pmem_start, pmem_len, pmem_flags;
+       u8 revisionid;
  
        RT_TRACE(COMP_INIT,"Configuring chip resources\n");
  
           pci_write_config_byte(pdev, 0x41, 0x00);
  
  
+       pci_read_config_byte(pdev, 0x08, &revisionid);
+       /* If the revisionid is 0x10, the device uses rtl8192se. */
+       if (pdev->device == 0x8192 && revisionid == 0x10)
+               goto fail1;
        pci_read_config_byte(pdev, 0x05, &unit);
        pci_write_config_byte(pdev, 0x05, unit & (~0x04));
  
  #define IEEE80211_H
  #include <linux/if_ether.h> /* ETH_ALEN */
  #include <linux/kernel.h>   /* ARRAY_SIZE */
- #include <linux/version.h>
  #include <linux/module.h>
  #include <linux/jiffies.h>
  #include <linux/timer.h>
  #include <linux/sched.h>
  #include <linux/semaphore.h>
 +#include <linux/interrupt.h>
  
  #include <linux/delay.h>
  #include <linux/wireless.h>
@@@ -46,7 -46,6 +46,6 @@@
  #include <linux/slab.h>
  #include <linux/tcp.h>
  #include <linux/types.h>
- #include <linux/version.h>
  #include <linux/wireless.h>
  #include <linux/etherdevice.h>
  #include <asm/uaccess.h>
@@@ -283,7 -282,7 +282,7 @@@ int __init ieee80211_debug_init(void
  
        ieee80211_debug_level = debug;
  
 -      ieee80211_proc = create_proc_entry(DRV_NAME, S_IFDIR, init_net.proc_net);
 +      ieee80211_proc = proc_mkdir(DRV_NAME, init_net.proc_net);
        if (ieee80211_proc == NULL) {
                IEEE80211_ERROR("Unable to create " DRV_NAME
                                " proc directory\n");
@@@ -671,7 -671,7 +671,7 @@@ static int proc_get_stats_rx(char *page
  void rtl8192_proc_module_init(void)
  {
        RT_TRACE(COMP_INIT, "Initializing proc filesystem");
 -      rtl8192_proc=create_proc_entry(RTL819xU_MODULE_NAME, S_IFDIR, init_net.proc_net);
 +      rtl8192_proc = proc_mkdir(RTL819xU_MODULE_NAME, init_net.proc_net);
  }
  
  
@@@ -706,7 -706,9 +706,7 @@@ void rtl8192_proc_init_one(struct net_d
  {
        struct proc_dir_entry *e;
        struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev);
 -      priv->dir_dev = create_proc_entry(dev->name,
 -                                        S_IFDIR | S_IRUGO | S_IXUGO,
 -                                        rtl8192_proc);
 +      priv->dir_dev = proc_mkdir(dev->name, rtl8192_proc);
        if (!priv->dir_dev) {
                RT_TRACE(COMP_ERR, "Unable to initialize /proc/net/rtl8192/%s\n",
                      dev->name);
@@@ -2850,11 -2852,7 +2850,7 @@@ static void rtl8192_init_priv_task(stru
  {
        struct r8192_priv *priv = ieee80211_priv(dev);
  
- #ifdef PF_SYNCTHREAD
-       priv->priv_wq = create_workqueue(DRV_NAME,0);
- #else
        priv->priv_wq = create_workqueue(DRV_NAME);
- #endif
  
        INIT_WORK(&priv->reset_wq, rtl8192_restart);
  
@@@ -5,9 -5,7 +5,7 @@@
  #define _FAIL         0
  
  #include "basic_types.h"
- #include <linux/version.h>
  #include <linux/spinlock.h>
  #include <linux/semaphore.h>
  #include <linux/sem.h>
  #include <linux/netdevice.h>
@@@ -22,6 -20,7 +20,6 @@@
  #include <linux/module.h>
  #include <linux/sched.h>
  #include <linux/kref.h>
 -#include <linux/netdevice.h>
  #include <linux/skbuff.h>
  #include <linux/usb.h>
  #include <linux/usb/ch9.h>
@@@ -29,7 -28,7 +27,7 @@@
  #include <linux/circ_buf.h>
  #include <linux/uaccess.h>
  #include <asm/byteorder.h>
- #include <asm/atomic.h>
+ #include <linux/atomic.h>
  #include <linux/wireless.h>
  #include <linux/rtnetlink.h>
  #include "ethernet.h"
@@@ -235,7 -234,5 +233,5 @@@ static inline u32 _RND512(u32 sz
        return ((sz >> 9) + ((sz & 511) ? 1 : 0)) << 9;
  }
  
- #define STRUCT_PACKED __attribute__ ((packed))
  #endif
  
@@@ -50,6 -50,7 +50,6 @@@
  #include <linux/interrupt.h>
  #include <linux/pagemap.h>
  #include <asm/cacheflush.h>
 -#include <linux/sched.h>
  #include <linux/delay.h>
  #include <linux/jiffies.h>
  #include <linux/rar_register.h>
@@@ -200,7 -201,7 +200,7 @@@ static int sep_singleton_release(struc
  }
  
  /**
-  *    sep_request_daemonopen - request daemon open method
+  *    sep_request_daemon_open - request daemon open method
   *    @inode: inode of SEP device
   *    @filp: file handle to SEP device
   *
@@@ -1101,9 -1102,9 +1101,9 @@@ static int sep_lock_user_pages(struct s
                        "lli_array[%x].bus_address is "
                        "%08lx, lli_array[%x].block_size is %x\n",
                        num_pages - 1,
-                       (unsigned long)lli_array[num_pages -1].bus_address,
+                       (unsigned long)lli_array[num_pages - 1].bus_address,
                        num_pages - 1,
-                       lli_array[num_pages -1].block_size);
+                       lli_array[num_pages - 1].block_size);
        }
  
        /* Set output params according to the in_out flag */
@@@ -67,7 -67,6 +67,6 @@@
  /*******************************************************************************
   *  include files
   ******************************************************************************/
- #include <linux/version.h>
  #ifdef BUS_PCMCIA
  #include <pcmcia/cistpl.h>
  #include <pcmcia/cisreg.h>
@@@ -990,7 -989,14 +989,7 @@@ struct wl_privat
  #endif // USE_WDS
  }; // wl_private
  
 -#ifdef HAVE_NETDEV_PRIV
  #define wl_priv(dev) ((struct wl_private *) netdev_priv(dev))
 -#else
 -extern inline struct wl_private *wl_priv(struct net_device *dev)
 -{
 -    return dev->priv;
 -}
 -#endif
  
  /********************************************************************/
  /* Locking and synchronization functions                            */
@@@ -40,10 -40,6 +40,10 @@@ config USB_STORAGE_REALTE
  
          If this driver is compiled as a module, it will be named ums-realtek.
  
 +config REALTEK_AUTOPM
 +      bool "Realtek Card Reader autosuspend support"
 +      depends on USB_STORAGE_REALTEK && CONFIG_PM_RUNTIME
 +      default y
  
  config USB_STORAGE_DATAFAB
        tristate "Datafab Compact Flash Reader support"
@@@ -191,8 -187,8 +191,8 @@@ config USB_STORAGE_ENE_UB625
        depends on USB && SCSI
        depends on USB_STORAGE
        ---help---
-         Say Y here if you wish to control a ENE SD Card reader.
-         To use SM/MS card, please build driver/staging/keucr/keucr.ko
+         Say Y here if you wish to control a ENE SD/MS Card reader.
+         To use SM card, please build driver/staging/keucr/keucr.ko
  
          This option depends on 'SCSI' support being enabled, but you
          probably also need 'SCSI device support: SCSI disk support'