~ubuntu-branches/ubuntu/lucid/linux-mvl-dove/lucid

« back to all changes in this revision

Viewing changes to ubuntu/rtl8192se/rtl_mesh.c

  • Committer: Bazaar Package Importer
  • Author(s): Andy Whitcroft, Andy Whitcroft, Eric Miao, Saeed Bishara, Tony Lindgren, Upstream Kernel Changes, Ubuntu: 2.6.32-16.24, Ubuntu: 2.6.32-16.23, Ubuntu: 2.6.32-15.22, Ubuntu: 2.6.32-15.21, Ubuntu: 2.6.32-14.20
  • Date: 2010-03-08 15:26:14 UTC
  • Revision ID: james.westby@ubuntu.com-20100308152614-wawwjda2b5xh0qth
Tags: 2.6.32-202.12
[ Andy Whitcroft ]

* rebase to Ubuntu-2.6.32-16.24
* [Config] updateconfigs following rebase to Ubuntu-2.6.32-16.24
* [Config] updateconfigs following rebase to Ubuntu-2.6.32-16.24
* lintian -- update debhelper package version dependancy
* lintian -- fix ghostscript dependancy
* lintian -- add required misc:Depends
* rename the debug packages to match archive standard
  - LP: #527837

[ Eric Miao ]

* SAUCE: dove: disable conflicting v6 cache fns in zImage head.S
* [Config]: CONFIG_KEXEC=y and CONFIG_ATAGS_PROC=y
* [Config]: update configs for latest Marvell patchset
* [Config]: disable OABI_COMPAT
  - LP: #534277

[ Saeed Bishara ]

* SAUCE: arm: invalidate TLBs when enabling mmu
* SAUCE: arm: disable L2 cache in the v7 finish function

[ Tony Lindgren ]

* SAUCE: arm: Fix init_atags_procfs() to check tag->hdr.size

[ Upstream Kernel Changes ]

* Revert "printk: remove unused code from kernel/printk.c"
* Revert "Save thread registers in coredumps" Because this patch is
  already in the kernel.
* Revert "dove: enable cpu mode (v6/v7) in run-time detection"
* Revert "ARM: provide the cpu_match function to PJ4"
* Revert "ARM: introduce the cpu_match function to the proc_info"
* ARM: 5884/1: arm: Fix DCC console for v7
* ARM: 5885/1: arm: Flush TLB entries in setup_mm_for_reboot()
* ARM: 5886/1: arm: Fix cpu_proc_fin() for proc-v7.S and make kexec work
* ARM: 5888/1: arm: Update comments in cacheflush.h and remove
  unnecessary V6 and V7 comments
* rt5630: fix codec->hw_read function
* mm: Check if any page in a pageblock is reserved before marking it
  MIGRATE_RESERVE
* Add build option to to set the default panic timeout.
* sched: Enable might_sleep before initializing drivers.
* Add code to prevent system calls from being restarted muliple times
  before returning from the kernel.
* Save thread registers in coredumps
* armv6 dcc tty driver
* PM: Add wake lock api.
* PM: Add early suspend api.
* PM: Implement wakelock api.
* PM: Implement early suspend api
* PM: Add user-space wake lock api.
* PM: wakelock: Abort task freezing if a wake lock is held.
* PM: earlysuspend: Add console switch when user requested sleep state
  changes.
* PM: earlysuspend: Removing dependence on console.
* rtc: Add android alarm driver.
* rtc: Try to prevent RTC errors from accumulating.
* switch: switch class and GPIO drivers.
* pmem: Add pmem driver
* Add android_aid.h
* ashmem for 2.6.27.
* Add missing conflict codes for 0079-ashmem-for-2.6.27.patch
* Paranoid network.
* net: socket ioctl to reset connections matching local address
* sysfs_net_ipv4: Add sysfs-based knobs for controlling TCP window size
* uidstat: Adding uid stat driver to collect network statistics.
* adding conflict patch codes for
  0083-uidstat-Adding-uid-stat-driver-to-collect-network-s.patch
* FAT: Add new ioctl VFAT_IOCTL_GET_VOLUME_ID for reading the volume ID.
* Grants system server access to /proc/<pid>/oom_adj for Android
  applications.
* Input: Generic GPIO Input device.
* add missing conflict code for
  0086-Input-Generic-GPIO-Input-device.patch
* Input: Hold wake lock while event queue is not empty.
* Input: Use monotonic time for event time stamps.
* Input: synaptics_i2c_rmi: Driver for Synaptics Touchscreens using RMI
  over I2C.
* input: Add keyreset driver.
* mmc: Add status IRQ and status callback function to mmc platform data
* mmc: sd: Add new CONFIG_MMC_PARANOID_SD_INIT for enabling retries
  during SD detection
* mmc: Add concept of an 'embedded' SDIO device.
* trout: Add functions for WiFi
* mmc: Add new API call 'sdio_reset_comm' for resetting communication
  with an SDIO device
* mmc: sd: When resuming, try a little harder to init the card
* mmc: mmcblk: Add new feature 'CONFIG_MMC_BLOCK_PARANOID_RESUME'
* mmc: sd: Add retries in re-detection
* android_usb: Composite USB gadget driver for android.
* rfkill: Introduce CONFIG_RFKILL_PM and use instead of CONFIG_PM to
  power down
* tiwlan: Add abstract wifi control functions support
* android: Add android config documentation to boot framework.
* block: block_dump: Add number of sectors to debug output
* fs: block_dump: Don't display inode changes if block_dump < 2
* regenerated code for
  0107-mmc-core-Hold-a-wake-lock-accross-delayed-work-m.patch
* mmc: sd: Remove debugging printk
* printk: Fix log_buf_copy termination.
* kernel_debugger_core: add interrupt-context debugger core
* kernel_debugger_core: Add sysrq command.
* pmem: Add include sched.h to fix compile errors
* net: Fix compilation of the IPv6 module
* ashmem: Don't install fault handler for private mmaps.
* ashmem: Add common prefix to name reported in /proc/pid/maps
* net: add PPP on L2TP Access Concentrator (PPPoLAC) driver.
* cgroup: Add generic cgroup subsystem permission checks.
* add missing conflict codes for
  0124-cgroup-Add-generic-cgroup-subsystem-permission-chec.patch
* nohz: Fix ondemand governor not always ramping up on 100% load.
* usb: gadget: android: Allow usb charging to draw up to 500mA instead of
  250.
* regnerate patch for
  0127-futex-Restore-one-of-the-fast-paths-eliminated-by-3.patch
* Optionally flush entire dcache from v6_dma_flush_range
* net: add PPP on PPTP Network Server (PPPoPNS) driver.
* sdio: fix sdio_reset_comm() error path
* net: Fix a bitmask in PPPoPNS and rename constants in PPPoPNS and
  PPPoLAC.
* net: Fix a potential deadlock while releasing PPPoLAC/PPPoPNS socket.
* ashmem: don't require a page aligned size
* security: Add AID_NET_RAW and AID_NET_ADMIN capability check in
  cap_capable().
* net: Replace AID_NET_RAW checks with capable(CAP_NET_RAW).
* net: Force PPPoLAC and PPPoPNS to bind an interface before creating PPP
  channel.
* Add default configuration for Android
* Sync with the newest dove_defconfig
* Turn off TLS feature for android in v7
* Fix compiling error for lowmemorykiller
* Fix Compiling error for shmem
* Temporary disable pm_suspend call.
* Fix crash error for shmem
* Fix met compiling errors from 2.6.31 kernel to 2.6.32 kernel.
* Sync up with 2.6.32.2's dove_defconfig
* cesa: add address decoding windows initialization code
* Refine comments and algorithm for easier to understand LCD's HW RGB
  format.
* PM: runtime support for V6 or V7 mode
* Remove all Z0 specific code
* dove: remove remaning Z0 stuff
* Add auto-calibration
* fix compilation error (kernel/power/Makefile)
* update dove_avng_y1_defconfig
* dovefb: clean up CONFIG_DOVEFB_SINGLE_DISPLAY_ACCURATE_PCLK
* 1. fill initial data for dcon. 2. refine backlight driver interface.
* 1. add clock disable and enable interface 2. refine changing LCD source
  clock implementation.
* Fill backlight driver platform data
* 1. apply Tawfik's patch to hook fb_blank event. 2. add LCD power on and
  off interface.
* Refine backlight interface more portable
* 1. Refine dcon power management feature 2. Implement sysfs interfaces.
* 1. Fix blank function setting to wrong mode when suspend. 2. Add SRAM
  power down interface.
* remove compiling warning.
* dove: remove another DOVE_REV_Z0 stuff
* dove: sync dove_defconfig with latest patches
* dove: fix compilation warning in pm.c
* Adds ADI9889 HDMI transmitter support
* Dove: Add Video Plug support
* MPP changes for Dove -
* Swap R&B for Video plug on video overlay Unclear why this is required,
  but it solves color bitmapping. Keep now for Video plug but requires
  more research
* 1. Remove testing code. 2. disable dumb interface as well when receives
  FB_BLANK.
* Dove nand: add support for Two CS for the DB board
* Dove nand: Add support for "cmdlinepart" option Add support for
  "cmdlinepart" option in kernel command line dove-nand should be used as
  the NAND HAL device name. example: mtdparts=dove-nand:1g(swap),-(root)
* dove: use dove_cesa_addr_dec_data instead of dove_eth_addr_dec_data for
  cesa driver
* dovefb: fix compilation error when mv_spi is disabled
* Dove: remove gpu_size, vmeta_size and pvt_size kernel command line
  parameters from code as they have no effect because fixup function is
  called before parse_cmdline function ( see arch/arm/kernel/setup.c )
* VMeta PM func: 1. Power on the VMeta only when VMeta was been used 2.
  Support suspend/resume when VMeta was been used (also need user space
  player support)
* Add a watch dog timer for Vmeta suspend/resume func
* Dove NAND: fix double byte command on writing small pages
* Change Vmeta PM clock control to using Linux clock framework
* Disable the Vmtea clock/power as default
* Fix MMC/SD cannot be detected issue due to merge upgraded from .31 to
  .32 Signed-off-by: Steve Guo <steve.guo@marvell.com>
* dove: disable some andriod features
* dove: fix crash in shmem
* PM: Debugger Reset Workaround in Deep-Idle
* dove: increase BOOT_PARAMS_SIZE for dram params
* Add support for AV-D1 X0 board and modify ADI9889 driver to fit Linux
  coding style
* remove android config from dove_defconfig
* update dove_avng_y1_defconfig
* Fixed AC97 read error issue. Modified SOC sound control items.
* update dove_avng_x0_defconfig : Disable CONFIG_DOVE_DEBUGGER_MODE_V6
* dove: enable UBIFS extended features and advanced compression
* crypt: update ocf to latest release
* dove: enable kexec support
* sound: rt5623 codec: deprecate hw_read and fix driver name
* dove: use updated i2s codec name
* dove: fix dai structure for avengers boards.
* dove: delete the i2c-dummy.c driver which is not used by any system
* sound: rename cs42l51 codec i2c driver from i2s_i2c to cs42l51
* sound: change rt5630 name from i2s_i2c to rt5630
* dove: configure pm mpps for new revision of avengers board
* dove: change power button code to KEY_SLEEP
* Add more resolution support in kernel driver according VGA timing spec
* LCD: disabled CONFIG_DOVEFB_SINGLE_DISPLAY_ACCURATE_PCLK and instead
  disabled accurate clock option in runtime if both LCD units are
  enabled; this will enable using the same uImage for dual and non-dual
  mode.
* 1. fill initial data for dcon. 2. refine backlight driver interface.
* dove: cleanup gpu_size kernel parameter
* pcie - add option to disable scan by command line parameter
* PM: add FB notifier to manage Book/Deep-Idle toggeling
* ARM: Ensure ARMv6/7 mm files are built using appropriate assembler
  options
* kirkwood: fix compilation errors
* dove: disable highmem and enable CONFIG_VMSPLIT_2G
* dove: set SKB_HEADROOM to 32 instead of 16
* bmm: export outer_cache
* dove: add missing pj4 name entries
* Fix thread stack overflow caused by Dove NAND HAL driver
* Remove unused include file and declaration
* Roll back wait for vsync mechanism to wait_event_interruptable_timeout
  and give timeout delay from 40ms to 4ms.
* dovefb: remove another DOVE_REV_Z0 stuff
* mv643xx_eth: don't include cache padding in rx desc buffer size
* fix build error introduced by add missing conflict codes for
  0124-cgroup-Add-generic-cgroup-subsystem-permission-chec.patch
* crypto: add openssl patch for user space to utilize the cesa engine
* crypto: update openswan patch for version 2.6.24
* dove: add device driver for the GPU gc600 engine
* Marvell Buffer Management Module for VPU & GPU memory buffer maintain
* BMM: split VPU & GPU to choice use BMM or not
* dove: enable building the bmm driver as module
* cesa: remove patch for openswan version 2.6.18
* Configure new LCD register for upcoming DOVE A0 Chip
* fix pixclk when under interlaced mode
* Not to power off LCD SRAM when system blanks screen.
* dvs: make dvs_enable variable depend on board, and change the default
  to enable instead of disable on Dove DB board.

[ Ubuntu: 2.6.32-16.24 ]

* armel -- perf userspace does not support arm
* ia64 -- libelf-dev/binutils-dev to not provide necessary libraries

[ Ubuntu: 2.6.32-16.23 ]

* SAUCE: PM report driver and device suspend/resume times -- move config
* update to standards version 3.8.4.0
* printenv -- expose all of the package selectors
* source package -- cleanup source content control
* doc package -- ensure we do build package content on buildd
* lintian -- correct the address in the debian/copyright
* lintian -- update debhelper package version dependancy
* lintian -- fix ghostscript dependancy
* lintian -- add required misc:Depends
* lintian -- move our debhelper compat level to debian/compat
* perf -- build the kernel carried tools
* perf -- add linux-tools carrying the version switches and manuals
* SAUCE: fix up Kconfig for staging drivers
* [Config] enable NOUVEAU etc following drm backport
* update DRM to mainline v2.6.33
* [Config] Remove AppArmor config options that no longer exist (ports)
* [Config] updateportsconfigs following drm update
* ubuntu: AppArmor -- update to mainline 2010-03-04
* SAUCE: AppArmor: Reintroduce AppArmor 2.4 compatibility
* SAUCE: AppArmor: replace strim with strstrip for 2.6.32 kernels
* [Config] Remove AppArmor config options that no longer exist
* ubuntu: rtl8192se -- version 2010-0115,0014
  - LP: #530275
* [Config] added CONFIG_RTL8192SE module.
  - LP: #530275
* [Config] Added vmw_pvscsi to d-i/scsi-modules
  - LP: #531017
* [Upstream] netfilter: xt_recent: Add an entry reaper
* Revert "KVM: x86 emulator: Check CPL level during privilege instruction
  emulation"
* Revert "KVM: x86 emulator: Fix popf emulation"
* Revert "KVM: x86 emulator: Check IOPL level during io instruction
  emulation"
* Revert "KVM: x86 emulator: Add Virtual-8086 mode of emulation"
* Revert "KVM: fix memory access during x86 emulation."
* Add vlan (8021.Q) module package for d-i.
* (pre-stable) drm/i915: blacklist lid status: Sony VGN-BX196VP, Dell
  Inspiron 700m
  - LP: #515246
* [Upstream] docbook: need xmldoclinks for all doc types
* x86: set_personality_ia32() misses force_personality32
* lib: Introduce generic list_sort function
* drm/nv50: Implement ctxprog/state generation.
* drm/nv50: Remove redundant/incorrect ctxvals initialisation.
* (pre-stable) drm/i915: blacklist lid status: Sony VGN-BX196VP, Dell
  Inspiron 700m
  - LP: #515246

[ Ubuntu: 2.6.32-15.22 ]

* Revert "[Config] added new config option CONFIG_SR_REPORT_TIME_LIMIT"
* Revert "SAUCE: PM report driver and device suspend/resume times."
* [Config] set CONFIG_SR_REPORT_TIME_LIMIT
* SAUCE: PM report driver and device suspend/resume times.

[ Ubuntu: 2.6.32-15.21 ]

* Revert "(pre-stable) drm/i915: Increase fb alignment to 64k"
* Revert "[Config] lenovo-sl-laptop -- enable"
* Revert "ubuntu: lenovo-sl-laptop -- git tip (b19a08f81f)"
* armel -- cramfs module will no longer be built
* d-i -- make all modules optional
* rename the debug packages to match archive standard
  - LP: #527837
* lenovo-sl-laptop is no longer built
* Disable 4MB page tables for Atom, work around errata AAE44
  - LP: #523112
* ubuntu: dm-raid4-5: Depend on XOR_BLOCKS
* ubuntu: fsam7400: Depend on CHECK_SIGNATURE
* SAUCE: drm/i915: don't change DRM configuration when releasing load
  detect pipe
  - LP: #488328
* [Config] armel Update versatile initrd configs
  - LP: #524893
* SAUCE: [um] Don't use nx_enabled under UML
  - LP: #524849
* [Config] added new config option CONFIG_SR_REPORT_TIME_LIMIT
* SAUCE: v3 - Add Dell Business Class Netbook LED driver
* SAUCE: PM report driver and device suspend/resume times.
* Revert "[Upstream] e1000e: enhance frame fragment detection"
  - CVE-2009-4538
* Revert "[Upstream] e1000: enhance frame fragment detection"
  - CVE-2009-4536
* [Config] Enabled CONFIG_LEDS_DELL_NETBOOKS=m
* SAUCE: (pre-stable) netfilter: xt_recent: fix buffer overflow
* SAUCE: (pre-stable) netfilter: xt_recent: fix false match
* Revert "(pre-stable) eCryptfs: Add getattr function"
* Fix potential crash with sys_move_pages
* futex_lock_pi() key refcnt fix
* futex: Handle user space corruption gracefully
* futex: Handle futex value corruption gracefully
* Fix race in tty_fasync() properly
* hwmon: (w83781d) Request I/O ports individually for probing
* hwmon: (lm78) Request I/O ports individually for probing
* hwmon: (adt7462) Wrong ADT7462_VOLT_COUNT
* ALSA: ctxfi - fix PTP address initialization
* drm/i915: disable hotplug detect before Ironlake CRT detect
* drm/i915: enable self-refresh on 965
* drm/i915: Disable SR when more than one pipe is enabled
* drm/i915: Fix DDC on some systems by clearing BIOS GMBUS setup.
* drm/i915: Add HP nx9020/SamsungSX20S to ACPI LID quirk list
* drm/i915: Fix the incorrect DMI string for Samsung SX20S laptop
* drm/i915: Add MALATA PC-81005 to ACPI LID quirk list
* usb: r8a66597-hcd: Flush the D-cache for the pipe-in transfer buffers.
* i2c-tiny-usb: Fix on big-endian systems
* drm/i915: handle FBC and self-refresh better
* drm/i915: Increase fb alignment to 64k
* drm/i915: Update write_domains on active list after flush.
* regulator: Fix display of null constraints for regulators
* ALSA: hda-intel: Avoid divide by zero crash
* CPUFREQ: Fix use after free of struct powernow_k8_data
* freeze_bdev: don't deactivate successfully frozen MS_RDONLY sb
* cciss: Make cciss_seq_show handle holes in the h->drv[] array
* ioat: fix infinite timeout checking in ioat2_quiesce
* resource: add helpers for fetching rlimits
* fs/exec.c: restrict initial stack space expansion to rlimit
* cifs: fix length calculation for converted unicode readdir names
* NFS: Fix a reference leak in nfs_wb_cancel_page()
* NFS: Try to commit unstable writes in nfs_release_page()
* NFSv4: Don't allow posix locking against servers that don't support it
* NFSv4: Ensure that the NFSv4 locking can recover from stateid errors
* NFS: Fix an Oops when truncating a file
* NFS: Fix a umount race
* NFS: Fix a bug in nfs_fscache_release_page()
* NFS: Fix the mapping of the NFSERR_SERVERFAULT error
* md: fix 'degraded' calculation when starting a reshape.
* V4L/DVB: dvb-core: fix initialization of feeds list in demux filter
* Export the symbol of getboottime and mmonotonic_to_bootbased
* kvmclock: count total_sleep_time when updating guest clock
* KVM: PIT: control word is write-only
* tpm_infineon: fix suspend/resume handler for pnp_driver
* amd64_edac: Do not falsely trigger kerneloops
* netfilter: nf_conntrack: fix memory corruption with multiple namespaces
* netfilter: nf_conntrack: per netns nf_conntrack_cachep
* netfilter: nf_conntrack: restrict runtime expect hashsize modifications
* netfilter: xtables: compat out of scope fix
* netfilter: nf_conntrack: fix hash resizing with namespaces
* drm/i915: remove full registers dump debug
* drm/i915: add i915_lp_ring_sync helper
* drm/i915: Don't wait interruptible for possible plane buffer flush
* dasd: remove strings from s390dbf
* crypto: padlock-sha - Add import/export support
* wmi: Free the allocated acpi objects through wmi_get_event_data
* dell-wmi, hp-wmi, msi-wmi: check wmi_get_event_data() return value
* /dev/mem: introduce size_inside_page()
* devmem: check vmalloc address on kmem read/write
* devmem: fix kmem write bug on memory holes
* SCSI: mptfusion : mptscsih_abort return value should be SUCCESS instead
  of value 0.
* sh: Couple kernel and user write page perm bits for CONFIG_X2TLB
* ALSA: hda - use WARN_ON_ONCE() for zero-division detection
* dst: call cond_resched() in dst_gc_task()
* ALSA: hda - Improved MacBook (Pro) 5,1 / 5,2 support
* befs: fix leak
* rtc-fm3130: add missing braces
* Call flush_dcache_page after PIO data transfers in libata-sff.c
* ahci: add Acer G725 to broken suspend list
* pktgen: Fix freezing problem
* x86/amd-iommu: Fix IOMMU-API initialization for iommu=pt
* x86/amd-iommu: Fix deassignment of a device from the pt_domain
* x86: Re-get cfg_new in case reuse/move irq_desc
* Staging: fix rtl8187se compilation errors with mac80211
* ALSA: usb-audio - Avoid Oops after disconnect
* serial: 8250: add serial transmitter fully empty test
* sysfs: sysfs_sd_setattr set iattrs unconditionally
* class: Free the class private data in class_release
* USB: usbfs: only copy the actual data received
* USB: usbfs: properly clean up the as structure on error paths
* rtl8187: Add new device ID
* ACPI: Add NULL pointer check in acpi_bus_start
* ACPI: fix High cpu temperature with 2.6.32
* drm/radeon/kms: use udelay for short delays
* NFS: Too many GETATTR and ACCESS calls after direct I/O
* eCryptfs: Add getattr function
* b43: Fix throughput regression
* ath9k: Fix sequence numbers for PAE frames
* mac80211: Fix probe request filtering in IBSS mode
* iwlwifi: Fix to set correct ht configuration
* dm stripe: avoid divide by zero with invalid stripe count
* dm log: userspace fix overhead_size calcuations
* Linux 2.6.32.9
* sfc: Fix SFE4002 initialisation
* sfc: Fix sign of efx_mcdi_poll_reboot() error in efx_mcdi_poll()
* sfc: SFE4002/SFN4112F: Widen temperature and voltage tolerances
* (pre-stable) HID: handle joysticks with large number of buttons
  - LP: #492056
* (pre-stable) HID: extend mask for BUTTON usage page
  - LP: #492056
* PM: Measure device suspend and resume times
* e1000: enhance frame fragment detection
  - CVE-2009-4536
* e1000e: enhance frame fragment detection
  - CVE-2009-4538
* KVM: fix memory access during x86 emulation.
  - CVE-2010-0306
* KVM: x86 emulator: Add Virtual-8086 mode of emulation
  - CVE-2010-0306
* KVM: x86 emulator: Check IOPL level during io instruction emulation
  - CVE-2010-0306
* KVM: x86 emulator: Fix popf emulation
  - CVE-2010-0306
* KVM: x86 emulator: Check CPL level during privilege instruction
  emulation
  - CVE-2010-0306
* Input: wacom - ensure the device is initialized properly upon resume
* Input: wacom - add defines for packet lengths of various devices
* Input: wacom - add support for new LCD tablets
  - LP: #516777

[ Ubuntu: 2.6.32-14.20 ]

* rebuild following the GCC update to match compiler for out of tree modules
* Revert "[Config] drbd -- enable"
* Revert "ubuntu: drbd -- version 8.3.1"
* SAUCE: khubd -- switch USB product/manufacturer/serial handling to RCU
  - LP: #510937

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/******************************************************************************
 
2
 * Copyright(c) 2008 - 2010 Realtek Corporation. All rights reserved.
 
3
 *
 
4
 * Based on the r8180 driver, which is:
 
5
 * Copyright 2004-2005 Andrea Merello <andreamrl@tiscali.it>, et al.
 
6
 * This program is free software; you can redistribute it and/or modify it
 
7
 * under the terms of version 2 of the GNU General Public License as
 
8
 * published by the Free Software Foundation.
 
9
 *
 
10
 * This program is distributed in the hope that it will be useful, but WITHOUT
 
11
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 
12
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 
13
 * more details.
 
14
 *
 
15
 * You should have received a copy of the GNU General Public License along with
 
16
 * this program; if not, write to the Free Software Foundation, Inc.,
 
17
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
 
18
 *
 
19
 * The full GNU General Public License is included in this distribution in the
 
20
 * file called LICENSE.
 
21
 *
 
22
 * Contact Information:
 
23
 * wlanfae <wlanfae@realtek.com>
 
24
******************************************************************************/
 
25
#ifdef _RTL8192_EXT_PATCH_
 
26
 
 
27
#include <asm/uaccess.h>
 
28
#include <linux/pci.h>
 
29
 
 
30
#include "rtl_wx.h"
 
31
#include "rtl_core.h"
 
32
#include "rtl_dm.h"
 
33
#include "rtl8192s/r8192S_phy.h"
 
34
#include "rtl8192s/r8192S_phyreg.h"
 
35
#include "rtl8192s/r8192S_rtl6052.h"
 
36
#include "rtl8192s/r8192S_Efuse.h"
 
37
#include "../../mshclass/msh_class.h"
 
38
 
 
39
int meshdev_up(struct net_device *meshdev,bool is_silent_reset)
 
40
{
 
41
        struct meshdev_priv * mpriv = (struct meshdev_priv *)netdev_priv_rsl(meshdev);
 
42
        struct rtllib_device *ieee = mpriv->rtllib;
 
43
        PRT_POWER_SAVE_CONTROL pPSC = (PRT_POWER_SAVE_CONTROL)(&(mpriv->priv->rtllib->PowerSaveControl));
 
44
        bool init_status;
 
45
        struct net_device *dev = ieee->dev; 
 
46
        RT_TRACE(COMP_DOWN, "==========>%s()\n", __FUNCTION__);
 
47
 
 
48
        mpriv->rtllib->iw_mode = IW_MODE_MESH;   
 
49
        if(mpriv->priv->mesh_up){
 
50
                RT_TRACE(COMP_INIT,"%s():mesh is up,return\n",__FUNCTION__);
 
51
                return -1;
 
52
        }
 
53
#ifdef RTL8192SE        
 
54
        mpriv->priv->ReceiveConfig =
 
55
        RCR_APPFCS | RCR_APWRMGT | /*RCR_ADD3 |*/
 
56
        RCR_AMF | RCR_ADF | RCR_APP_MIC | RCR_APP_ICV |
 
57
       RCR_AICV | RCR_ACRC32    |                               
 
58
        RCR_AB          | RCR_AM                |                               
 
59
        RCR_APM         |                                                               
 
60
        /*RCR_AAP               |*/                                                     
 
61
        RCR_APP_PHYST_STAFF | RCR_APP_PHYST_RXFF |      
 
62
        (mpriv->priv->EarlyRxThreshold<<RCR_FIFO_OFFSET)       ;
 
63
 
 
64
#else
 
65
        mpriv->priv->ReceiveConfig = RCR_ADD3  |
 
66
                RCR_AMF | RCR_ADF |             
 
67
                RCR_AICV |                      
 
68
                RCR_AB | RCR_AM | RCR_APM |     
 
69
                RCR_AAP | ((u32)7<<RCR_MXDMA_OFFSET) |
 
70
                ((u32)7 << RCR_FIFO_OFFSET) | RCR_ONLYERLPKT;
 
71
 
 
72
#endif
 
73
 
 
74
        if(!mpriv->priv->up) {
 
75
                RT_TRACE(COMP_INIT, "Bringing up iface");
 
76
                mpriv->priv->bfirst_init = true;
 
77
                init_status = mpriv->priv->ops->initialize_adapter(dev);
 
78
                if(init_status != true) {
 
79
                        RT_TRACE(COMP_ERR,"ERR!!! %s(): initialization is failed!\n",__FUNCTION__);
 
80
                        return -1;
 
81
                }
 
82
                RT_TRACE(COMP_INIT, "start adapter finished\n");
 
83
                RT_CLEAR_PS_LEVEL(pPSC, RT_RF_OFF_LEVL_HALT_NIC);
 
84
                printk("==>%s():priv->up is 0\n",__FUNCTION__);
 
85
                mpriv->rtllib->ieee_up=1;               
 
86
                mpriv->priv->bfirst_init = false;
 
87
#ifdef ENABLE_GPIO_RADIO_CTL
 
88
                if(mpriv->priv->polling_timer_on == 0){
 
89
                        check_rfctrl_gpio_timer((unsigned long)dev);
 
90
                }
 
91
#endif
 
92
                mpriv->rtllib->current_network.channel = INIT_DEFAULT_CHAN;
 
93
                mpriv->rtllib->current_mesh_network.channel = INIT_DEFAULT_CHAN;
 
94
                if((mpriv->priv->mshobj->ext_patch_r819x_wx_set_mesh_chan) && (!is_silent_reset))
 
95
                        mpriv->priv->mshobj->ext_patch_r819x_wx_set_mesh_chan(dev,INIT_DEFAULT_CHAN);          
 
96
                if((mpriv->priv->mshobj->ext_patch_r819x_wx_set_channel) && (!is_silent_reset))
 
97
                {
 
98
                        mpriv->priv->mshobj->ext_patch_r819x_wx_set_channel(mpriv->rtllib, INIT_DEFAULT_CHAN);
 
99
                }
 
100
                printk("%s():set chan %d\n",__FUNCTION__,INIT_DEFAULT_CHAN);
 
101
                mpriv->rtllib->set_chan(dev, INIT_DEFAULT_CHAN);
 
102
                dm_InitRateAdaptiveMask(dev);
 
103
                watch_dog_timer_callback((unsigned long) dev);
 
104
        
 
105
        } else {
 
106
                rtllib_stop_scan(ieee);
 
107
                msleep(1000);
 
108
        }
 
109
        if(!ieee->mesh_started) {
 
110
#ifdef RTL8192E
 
111
            if(ieee->eRFPowerState!=eRfOn)
 
112
                MgntActSet_RF_State(dev, eRfOn, ieee->RfOffReason);     
 
113
#endif
 
114
            if(mpriv->priv->mshobj && mpriv->priv->mshobj->ext_patch_rtl819x_up )
 
115
                mpriv->priv->mshobj->ext_patch_rtl819x_up(mpriv->priv->mshobj);
 
116
 
 
117
 
 
118
            if(!netif_queue_stopped(meshdev))
 
119
                netif_start_queue(meshdev);
 
120
            else
 
121
                netif_wake_queue(meshdev);
 
122
 
 
123
            rtllib_reset_queue(ieee);
 
124
        }
 
125
                
 
126
        mpriv->priv->mesh_up = 1;
 
127
 
 
128
        RT_TRACE(COMP_DOWN, "<==========%s()\n", __FUNCTION__);
 
129
        return 0;
 
130
}
 
131
 
 
132
int meshdev_down(struct net_device *meshdev)
 
133
{
 
134
        struct meshdev_priv * mpriv = (struct meshdev_priv *)netdev_priv_rsl(meshdev);
 
135
        struct rtllib_device *ieee = mpriv->rtllib;
 
136
        struct r8192_priv *priv = (void*)ieee->priv;
 
137
        struct net_device *dev = ieee->dev;
 
138
        unsigned long flags = 0;
 
139
        u8 RFInProgressTimeOut = 0;
 
140
        if(priv->mesh_up == 0) {
 
141
                RT_TRACE(COMP_ERR,"%s():ERR!!! mesh is already down\n",__FUNCTION__)
 
142
                return -1;
 
143
        }
 
144
 
 
145
        RT_TRACE(COMP_DOWN, "==========>%s()\n", __FUNCTION__);
 
146
        
 
147
        if (netif_running(meshdev)) {
 
148
                netif_stop_queue(meshdev);
 
149
        }
 
150
 
 
151
        if(!priv->up)
 
152
        {
 
153
                printk("===>%s():priv->up is 0\n",__FUNCTION__);
 
154
                priv->bDriverIsGoingToUnload = true;    
 
155
                ieee->ieee_up = 0;  
 
156
                rtl8192_irq_disable(dev);
 
157
                rtl8192_cancel_deferred_work(priv);
 
158
#ifndef RTL8190P
 
159
                cancel_delayed_work(&priv->rtllib->hw_wakeup_wq);
 
160
#endif
 
161
                deinit_hal_dm(dev);
 
162
                del_timer_sync(&priv->watch_dog_timer); 
 
163
 
 
164
                rtllib_softmac_stop_protocol(ieee, 1, true);
 
165
                SPIN_LOCK_PRIV_RFPS(&priv->rf_ps_lock);
 
166
                while(priv->RFChangeInProgress)
 
167
                {
 
168
                        SPIN_UNLOCK_PRIV_RFPS(&priv->rf_ps_lock);
 
169
                        if(RFInProgressTimeOut > 100)
 
170
                        {
 
171
                                SPIN_LOCK_PRIV_RFPS(&priv->rf_ps_lock);
 
172
                                break;
 
173
                        }
 
174
                        printk("===>%s():RF is in progress, need to wait until rf chang is done.\n",__FUNCTION__);
 
175
                        mdelay(1);
 
176
                        RFInProgressTimeOut ++;
 
177
                        SPIN_LOCK_PRIV_RFPS(&priv->rf_ps_lock);
 
178
                }
 
179
                printk("=====>%s(): priv->RFChangeInProgress = true\n",__FUNCTION__);
 
180
                priv->RFChangeInProgress = true;
 
181
                SPIN_UNLOCK_PRIV_RFPS(&priv->rf_ps_lock);
 
182
                priv->ops->stop_adapter(dev, false);
 
183
                SPIN_LOCK_PRIV_RFPS(&priv->rf_ps_lock);
 
184
                printk("=====>%s(): priv->RFChangeInProgress = false\n",__FUNCTION__);
 
185
                priv->RFChangeInProgress = false;
 
186
                SPIN_UNLOCK_PRIV_RFPS(&priv->rf_ps_lock);
 
187
                udelay(100);
 
188
                memset(&priv->rtllib->current_network, 0 , offsetof(struct rtllib_network, list));
 
189
                priv->rtllib->current_network.channel = INIT_DEFAULT_CHAN;
 
190
#ifdef CONFIG_ASPM_OR_D3
 
191
                RT_ENABLE_ASPM(dev);
 
192
#endif
 
193
                memset(&ieee->current_mesh_network, 0 , offsetof(struct rtllib_network, list));
 
194
                priv->rtllib->current_mesh_network.channel = INIT_DEFAULT_CHAN;
 
195
                ieee->mesh_state = RTLLIB_NOLINK;
 
196
        } else {
 
197
                rtllib_softmac_stop_protocol(ieee, 1, true);
 
198
                memset(&ieee->current_mesh_network, 0 , offsetof(struct rtllib_network, list));
 
199
                if((ieee->current_network.channel > 0) && (ieee->current_network.channel < 15))
 
200
                        priv->rtllib->current_mesh_network.channel = ieee->current_network.channel;
 
201
                else
 
202
                        priv->rtllib->current_mesh_network.channel = INIT_DEFAULT_CHAN;
 
203
                printk("============>%s():priv->rtllib->current_mesh_network.channel is %d,ieee->current_network.channel is %d\n",__FUNCTION__,priv->rtllib->current_mesh_network.channel,ieee->current_network.channel);
 
204
                                
 
205
                ieee->mesh_state = RTLLIB_NOLINK;
 
206
                ieee->iw_mode = IW_MODE_INFRA;
 
207
        }
 
208
        priv->mesh_up = 0;  
 
209
        RT_TRACE(COMP_DOWN, "<==========%s()\n", __FUNCTION__);
 
210
 
 
211
        return 0;
 
212
}
 
213
 
 
214
static int meshdev_open(struct net_device *meshdev)
 
215
{
 
216
        struct meshdev_priv * mpriv = (struct meshdev_priv *)netdev_priv_rsl(meshdev);
 
217
        struct rtllib_device *ieee = mpriv->rtllib;
 
218
        struct r8192_priv *priv = (void*)ieee->priv;
 
219
        int ret;
 
220
        
 
221
        SEM_DOWN_PRIV_WX(&priv->wx_sem);        
 
222
        ret = meshdev_up(meshdev,false);
 
223
        SEM_UP_PRIV_WX(&priv->wx_sem);  
 
224
 
 
225
        return ret;
 
226
}
 
227
 
 
228
static int meshdev_close(struct net_device *meshdev)
 
229
{
 
230
        struct meshdev_priv * mpriv = (struct meshdev_priv *)netdev_priv_rsl(meshdev);
 
231
        struct rtllib_device *ieee = mpriv->rtllib;
 
232
        struct r8192_priv *priv = (void *)ieee->priv;
 
233
        int ret;
 
234
        
 
235
        SEM_DOWN_PRIV_WX(&priv->wx_sem);        
 
236
        ret = meshdev_down(meshdev);
 
237
        SEM_UP_PRIV_WX(&priv->wx_sem);  
 
238
        
 
239
        return ret;
 
240
}
 
241
 
 
242
extern int meshdev_wx_mesh(struct net_device *meshdev, 
 
243
                               struct iw_request_info *info, 
 
244
                               union iwreq_data *wrqu, char *extra);
 
245
static int meshdev_ioctl(struct net_device *meshdev, struct ifreq *rq, int cmd)
 
246
{
 
247
        struct iwreq *wrq = (struct iwreq *)rq;
 
248
        int ret = -1;
 
249
        if(cmd == 0x8BEE)
 
250
        {
 
251
                ret = meshdev_wx_mesh(meshdev, NULL, &(wrq->u), wrq->u.data.pointer);
 
252
        }
 
253
        return ret;
 
254
}
 
255
 
 
256
struct net_device_stats *meshdev_stats(struct net_device *meshdev)
 
257
{
 
258
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 
 
259
        return &((struct meshdev_priv*)netdev_priv(meshdev))->stats;
 
260
#else
 
261
        return &((struct meshdev_priv*)meshdev->priv)->stats;
 
262
#endif
 
263
}
 
264
 
 
265
static int meshdev_tx(struct sk_buff *skb, struct net_device *meshdev)
 
266
{
 
267
        struct meshdev_priv *mpriv = (struct meshdev_priv *)netdev_priv_rsl(meshdev);
 
268
        struct rtllib_device * ieee = mpriv->rtllib;
 
269
        struct net_device *dev = ieee->dev;
 
270
 
 
271
        memset(skb->cb,0,sizeof(skb->cb));
 
272
        
 
273
        return rtllib_mesh_xmit(skb, dev);      
 
274
}
 
275
 
 
276
static void meshdev_tx_timeout(struct net_device *meshdev)
 
277
{
 
278
        struct meshdev_priv *mpriv = (struct meshdev_priv *)netdev_priv_rsl(meshdev);
 
279
        struct rtllib_device * ieee = mpriv->rtllib;
 
280
        struct net_device *dev = ieee->dev;
 
281
 
 
282
        tx_timeout(dev);        
 
283
}
 
284
 
 
285
#ifdef HAVE_NET_DEVICE_OPS
 
286
static const struct net_device_ops mesh_netdev_ops = {
 
287
        .ndo_open = meshdev_open,
 
288
        .ndo_stop = meshdev_close,
 
289
        .ndo_get_stats = meshdev_stats,
 
290
        .ndo_tx_timeout = meshdev_tx_timeout,
 
291
        .ndo_do_ioctl = meshdev_ioctl,
 
292
        .ndo_start_xmit = meshdev_tx,
 
293
};
 
294
#endif
 
295
 
 
296
void meshdev_init(struct net_device* meshdev)
 
297
{
 
298
        struct meshdev_priv *mpriv;
 
299
        ether_setup(meshdev);
 
300
 
 
301
#ifdef HAVE_NET_DEVICE_OPS
 
302
        meshdev->netdev_ops = &mesh_netdev_ops;
 
303
#else   
 
304
        meshdev->open = meshdev_open;
 
305
        meshdev->stop = meshdev_close;
 
306
        meshdev->tx_timeout = meshdev_tx_timeout;
 
307
        meshdev->do_ioctl = meshdev_ioctl;
 
308
        meshdev->get_stats = meshdev_stats;
 
309
        meshdev->hard_start_xmit = meshdev_tx;
 
310
#endif  
 
311
        meshdev->wireless_handlers = &meshdev_wx_handlers_def;
 
312
        meshdev->destructor = free_netdev;
 
313
        meshdev->watchdog_timeo = HZ*3; 
 
314
        meshdev->type = ARPHRD_ETHER; 
 
315
        memset(meshdev->broadcast,0xFF, ETH_ALEN);
 
316
        
 
317
        meshdev->watchdog_timeo = 3 * HZ;
 
318
 
 
319
        mpriv = (struct meshdev_priv *)netdev_priv_rsl(meshdev);
 
320
        memset(mpriv, 0, sizeof(struct meshdev_priv));
 
321
 
 
322
        return;
 
323
}
 
324
 
 
325
int meshdev_update_ext_chnl_offset_as_client(void *data)
 
326
{
 
327
        struct rtllib_device *ieee = container_of_work_rsl(data, struct rtllib_device,
 
328
                        ext_update_extchnloffset_wq);
 
329
        struct r8192_priv *priv = (void *)ieee->priv;
 
330
        struct net_device *dev = ieee->dev;
 
331
        struct mshclass *mshobj= priv->mshobj;
 
332
        u8 updateBW = 0;
 
333
        u8 bserverHT = 0;
 
334
 
 
335
        updateBW=mshobj->ext_patch_r819x_wx_update_beacon(dev,&bserverHT);
 
336
        printk("$$$$$$ Cur_networ.chan=%d, cur_mesh_net.chan=%d,bserverHT=%d\n",
 
337
                        ieee->current_network.channel,ieee->current_mesh_network.channel,bserverHT);
 
338
        if (updateBW == 1) {
 
339
                if (bserverHT == 0) {
 
340
                        printk("===>server is not HT supported,set 20M\n");
 
341
                        HTSetConnectBwMode(ieee, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT);  
 
342
                } else {
 
343
                        printk("===>updateBW is 1,bCurBW40MHz is %d,ieee->serverExtChlOffset is %d\n",
 
344
                                        ieee->pHTInfo->bCurBW40MHz,ieee->serverExtChlOffset);
 
345
                        if (ieee->pHTInfo->bCurBW40MHz)
 
346
                                HTSetConnectBwMode(ieee, HT_CHANNEL_WIDTH_20_40, ieee->serverExtChlOffset);  
 
347
                        else
 
348
                                HTSetConnectBwMode(ieee, HT_CHANNEL_WIDTH_20, ieee->serverExtChlOffset);  
 
349
                }
 
350
        } else {
 
351
                printk("===>there is no same hostname server, ERR!!!\n");
 
352
                return -1;
 
353
        }
 
354
        return 0;
 
355
}
 
356
 
 
357
#endif