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

« back to all changes in this revision

Viewing changes to ubuntu/rtl8192se/rtllib/rtl819x_BAProc.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
 * This program is distributed in the hope that it will be useful, but WITHOUT
 
5
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 
6
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 
7
 * more details.
 
8
 *
 
9
 * You should have received a copy of the GNU General Public License along with
 
10
 * this program; if not, write to the Free Software Foundation, Inc.,
 
11
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
 
12
 *
 
13
 * The full GNU General Public License is included in this distribution in the
 
14
 * file called LICENSE.
 
15
 *
 
16
 * Contact Information:
 
17
 * wlanfae <wlanfae@realtek.com>
 
18
******************************************************************************/
 
19
#include "rtllib.h"
 
20
#include "rtl819x_BA.h"
 
21
#ifdef RTK_DMP_PLATFORM
 
22
#include <linux/usb_setting.h> 
 
23
#endif
 
24
 
 
25
void ActivateBAEntry(struct rtllib_device* ieee, PBA_RECORD pBA, u16 Time)
 
26
{
 
27
        pBA->bValid = true;
 
28
        if(Time != 0)
 
29
                mod_timer(&pBA->Timer, jiffies + MSECS(Time));
 
30
}
 
31
 
 
32
void DeActivateBAEntry( struct rtllib_device* ieee, PBA_RECORD pBA)
 
33
{
 
34
        pBA->bValid = false;
 
35
        del_timer_sync(&pBA->Timer);
 
36
}
 
37
u8 TxTsDeleteBA( struct rtllib_device* ieee, PTX_TS_RECORD      pTxTs)
 
38
{
 
39
        PBA_RECORD              pAdmittedBa = &pTxTs->TxAdmittedBARecord;  
 
40
        PBA_RECORD              pPendingBa = &pTxTs->TxPendingBARecord;
 
41
        u8                      bSendDELBA = false;
 
42
 
 
43
        if(pPendingBa->bValid)
 
44
        {
 
45
                DeActivateBAEntry(ieee, pPendingBa);
 
46
                bSendDELBA = true;
 
47
        }
 
48
 
 
49
        if(pAdmittedBa->bValid)
 
50
        {
 
51
                DeActivateBAEntry(ieee, pAdmittedBa);
 
52
                bSendDELBA = true;
 
53
        }
 
54
 
 
55
        return bSendDELBA;
 
56
}
 
57
 
 
58
u8 RxTsDeleteBA( struct rtllib_device* ieee, PRX_TS_RECORD      pRxTs)
 
59
{
 
60
        PBA_RECORD              pBa = &pRxTs->RxAdmittedBARecord;
 
61
        u8                      bSendDELBA = false;
 
62
 
 
63
        if(pBa->bValid)
 
64
        {
 
65
                DeActivateBAEntry(ieee, pBa);
 
66
                bSendDELBA = true;
 
67
        }
 
68
 
 
69
        return bSendDELBA;
 
70
}
 
71
 
 
72
void ResetBaEntry( PBA_RECORD pBA)
 
73
{
 
74
        pBA->bValid                     = false;
 
75
        pBA->BaParamSet.shortData       = 0;
 
76
        pBA->BaTimeoutValue             = 0;
 
77
        pBA->DialogToken                = 0;
 
78
        pBA->BaStartSeqCtrl.ShortData   = 0;
 
79
}
 
80
static struct sk_buff* rtllib_ADDBA(struct rtllib_device* ieee, u8* Dst, PBA_RECORD pBA, u16 StatusCode, u8 type)
 
81
{
 
82
        struct sk_buff *skb = NULL;
 
83
         struct rtllib_hdr_3addr* BAReq = NULL;
 
84
        u8* tag = NULL;
 
85
        u16 tmp = 0;
 
86
        u16 len = ieee->tx_headroom + 9;
 
87
        RTLLIB_DEBUG(RTLLIB_DL_TRACE | RTLLIB_DL_BA, "========>%s(), frame(%d) sentd to:"MAC_FMT", ieee->dev:%p\n", __FUNCTION__, type, MAC_ARG(Dst), ieee->dev);
 
88
        if (pBA == NULL||ieee == NULL)
 
89
        {
 
90
                RTLLIB_DEBUG(RTLLIB_DL_ERR, "pBA(%p) is NULL or ieee(%p) is NULL\n", pBA, ieee);
 
91
                return NULL;
 
92
        }
 
93
#ifdef USB_USE_ALIGNMENT
 
94
        u32 Tmpaddr=0;
 
95
        int alignment=0;
 
96
        skb = dev_alloc_skb(len + sizeof( struct rtllib_hdr_3addr) + USB_512B_ALIGNMENT_SIZE); 
 
97
#else
 
98
        skb = dev_alloc_skb(len + sizeof( struct rtllib_hdr_3addr)); 
 
99
#endif
 
100
        if (skb == NULL)
 
101
        {
 
102
                RTLLIB_DEBUG(RTLLIB_DL_ERR, "can't alloc skb for ADDBA_REQ\n");
 
103
                return NULL;
 
104
        }
 
105
 
 
106
        memset(skb->data, 0, sizeof( struct rtllib_hdr_3addr));         
 
107
 
 
108
#ifdef USB_USE_ALIGNMENT
 
109
        Tmpaddr = (u32)skb->data;
 
110
        alignment = Tmpaddr & 0x1ff;
 
111
        skb_reserve(skb,(USB_512B_ALIGNMENT_SIZE - alignment));
 
112
#endif
 
113
 
 
114
        skb_reserve(skb, ieee->tx_headroom);
 
115
 
 
116
        BAReq = ( struct rtllib_hdr_3addr *) skb_put(skb,sizeof( struct rtllib_hdr_3addr));
 
117
 
 
118
        memcpy(BAReq->addr1, Dst, ETH_ALEN);
 
119
        memcpy(BAReq->addr2, ieee->dev->dev_addr, ETH_ALEN);
 
120
 
 
121
        memcpy(BAReq->addr3, ieee->current_network.bssid, ETH_ALEN);
 
122
 
 
123
        BAReq->frame_ctl = cpu_to_le16(RTLLIB_STYPE_MANAGE_ACT); 
 
124
 
 
125
        tag = (u8*)skb_put(skb, 9);
 
126
        *tag ++= ACT_CAT_BA;  
 
127
        *tag ++= type;
 
128
        *tag ++= pBA->DialogToken;
 
129
 
 
130
        if (ACT_ADDBARSP == type)
 
131
        {
 
132
                printk("====>to send ADDBARSP\n");
 
133
                tmp = cpu_to_le16(StatusCode);
 
134
                memcpy(tag, (u8*)&tmp, 2);
 
135
                tag += 2;       
 
136
        }
 
137
        tmp = cpu_to_le16(pBA->BaParamSet.shortData);
 
138
        memcpy(tag, (u8*)&tmp, 2);
 
139
        tag += 2;
 
140
        tmp = cpu_to_le16(pBA->BaTimeoutValue);
 
141
        memcpy(tag, (u8*)&tmp, 2);
 
142
        tag += 2;
 
143
        
 
144
        if (ACT_ADDBAREQ == type)
 
145
        {
 
146
                memcpy(tag,(u8*)&(pBA->BaStartSeqCtrl), 2);
 
147
                tag += 2;
 
148
        }
 
149
        
 
150
        RTLLIB_DEBUG_DATA(RTLLIB_DL_DATA|RTLLIB_DL_BA, skb->data, skb->len);
 
151
        return skb;
 
152
}
 
153
 
 
154
static struct sk_buff* rtllib_DELBA(
 
155
        struct rtllib_device* ieee,
 
156
        u8*                      dst,
 
157
        PBA_RECORD               pBA,
 
158
        TR_SELECT                TxRxSelect,
 
159
        u16                      ReasonCode
 
160
        )
 
161
{
 
162
        DELBA_PARAM_SET DelbaParamSet;
 
163
        struct sk_buff *skb = NULL;
 
164
         struct rtllib_hdr_3addr* Delba = NULL;
 
165
        u8* tag = NULL;
 
166
        u16 tmp = 0;
 
167
        u16 len = 6 + ieee->tx_headroom;        
 
168
 
 
169
        if (net_ratelimit())
 
170
        RTLLIB_DEBUG(RTLLIB_DL_TRACE | RTLLIB_DL_BA, "========>%s(), ReasonCode(%d) sentd to:"MAC_FMT"\n", __FUNCTION__, ReasonCode, MAC_ARG(dst));
 
171
 
 
172
        memset(&DelbaParamSet, 0, 2);
 
173
 
 
174
        DelbaParamSet.field.Initiator   = (TxRxSelect==TX_DIR)?1:0;
 
175
        DelbaParamSet.field.TID = pBA->BaParamSet.field.TID;
 
176
        
 
177
#ifdef USB_USE_ALIGNMENT
 
178
        u32 Tmpaddr=0;
 
179
        int alignment=0;
 
180
        skb = dev_alloc_skb(len + sizeof( struct rtllib_hdr_3addr) + USB_512B_ALIGNMENT_SIZE); 
 
181
#else   
 
182
        skb = dev_alloc_skb(len + sizeof( struct rtllib_hdr_3addr)); 
 
183
#endif
 
184
        if (skb == NULL)
 
185
        {
 
186
                RTLLIB_DEBUG(RTLLIB_DL_ERR, "can't alloc skb for ADDBA_REQ\n");
 
187
                return NULL;
 
188
        }
 
189
 
 
190
#ifdef USB_USE_ALIGNMENT
 
191
        Tmpaddr = (u32)skb->data;
 
192
        alignment = Tmpaddr & 0x1ff;
 
193
        skb_reserve(skb,(USB_512B_ALIGNMENT_SIZE - alignment));
 
194
#endif
 
195
        skb_reserve(skb, ieee->tx_headroom);
 
196
        
 
197
        Delba = ( struct rtllib_hdr_3addr *) skb_put(skb,sizeof( struct rtllib_hdr_3addr));
 
198
 
 
199
        memcpy(Delba->addr1, dst, ETH_ALEN);
 
200
        memcpy(Delba->addr2, ieee->dev->dev_addr, ETH_ALEN);
 
201
        memcpy(Delba->addr3, ieee->current_network.bssid, ETH_ALEN);
 
202
        Delba->frame_ctl = cpu_to_le16(RTLLIB_STYPE_MANAGE_ACT); 
 
203
        
 
204
        tag = (u8*)skb_put(skb, 6);     
 
205
 
 
206
        *tag ++= ACT_CAT_BA;  
 
207
        *tag ++= ACT_DELBA;
 
208
 
 
209
        tmp = cpu_to_le16(DelbaParamSet.shortData);
 
210
        memcpy(tag, (u8*)&tmp, 2);
 
211
        tag += 2;
 
212
        tmp = cpu_to_le16(ReasonCode);
 
213
        memcpy(tag, (u8*)&tmp, 2);
 
214
        tag += 2;
 
215
 
 
216
        RTLLIB_DEBUG_DATA(RTLLIB_DL_DATA|RTLLIB_DL_BA, skb->data, skb->len);
 
217
        if (net_ratelimit())
 
218
        RTLLIB_DEBUG(RTLLIB_DL_TRACE | RTLLIB_DL_BA, "<=====%s()\n", __FUNCTION__);
 
219
        return skb;
 
220
}
 
221
 
 
222
void rtllib_send_ADDBAReq(struct rtllib_device* ieee, u8*       dst, PBA_RECORD pBA)
 
223
{
 
224
        struct sk_buff *skb = NULL;
 
225
        skb = rtllib_ADDBA(ieee, dst, pBA, 0, ACT_ADDBAREQ); 
 
226
 
 
227
        if (skb)
 
228
        {
 
229
                printk("====>to send ADDBAREQ!!!!!\n");
 
230
                softmac_mgmt_xmit(skb, ieee);
 
231
        }
 
232
        else
 
233
        {
 
234
                RTLLIB_DEBUG(RTLLIB_DL_ERR, "alloc skb error in function %s()\n", __FUNCTION__);
 
235
        }
 
236
        return;
 
237
}
 
238
 
 
239
void rtllib_send_ADDBARsp(struct rtllib_device* ieee, u8* dst, PBA_RECORD pBA, u16 StatusCode) 
 
240
{
 
241
        struct sk_buff *skb = NULL;
 
242
        skb = rtllib_ADDBA(ieee, dst, pBA, StatusCode, ACT_ADDBARSP); 
 
243
        if (skb)
 
244
        {
 
245
                softmac_mgmt_xmit(skb, ieee);
 
246
        }
 
247
        else
 
248
        {
 
249
                RTLLIB_DEBUG(RTLLIB_DL_ERR, "alloc skb error in function %s()\n", __FUNCTION__);
 
250
        }
 
251
 
 
252
        return;
 
253
 
 
254
}
 
255
 
 
256
void rtllib_send_DELBA(struct rtllib_device* ieee, u8* dst, PBA_RECORD pBA, TR_SELECT TxRxSelect, u16 ReasonCode)
 
257
{
 
258
        struct sk_buff *skb = NULL;
 
259
        skb = rtllib_DELBA(ieee, dst, pBA, TxRxSelect, ReasonCode); 
 
260
        if (skb)
 
261
        {
 
262
                softmac_mgmt_xmit(skb, ieee);
 
263
        }
 
264
        else
 
265
        {
 
266
                RTLLIB_DEBUG(RTLLIB_DL_ERR, "alloc skb error in function %s()\n", __FUNCTION__);
 
267
        }
 
268
        return ;
 
269
}
 
270
 
 
271
int rtllib_rx_ADDBAReq( struct rtllib_device* ieee, struct sk_buff *skb)
 
272
{
 
273
         struct rtllib_hdr_3addr* req = NULL;
 
274
        u16 rc = 0;
 
275
        u8 * dst = NULL, *pDialogToken = NULL, *tag = NULL;
 
276
        PBA_RECORD pBA = NULL;
 
277
        PBA_PARAM_SET   pBaParamSet = NULL;
 
278
        u16* pBaTimeoutVal = NULL;
 
279
        PSEQUENCE_CONTROL pBaStartSeqCtrl = NULL;
 
280
        PRX_TS_RECORD   pTS = NULL;     
 
281
 
 
282
        if (skb->len < sizeof( struct rtllib_hdr_3addr) + 9)
 
283
        {
 
284
                RTLLIB_DEBUG(RTLLIB_DL_ERR, " Invalid skb len in BAREQ(%d / %d)\n",(int)skb->len,       (int)(sizeof( struct rtllib_hdr_3addr) + 9));
 
285
                return -1;
 
286
        }
 
287
 
 
288
        RTLLIB_DEBUG_DATA(RTLLIB_DL_DATA|RTLLIB_DL_BA, skb->data, skb->len);
 
289
        
 
290
        req = ( struct rtllib_hdr_3addr*) skb->data;
 
291
        tag = (u8*)req;
 
292
        dst = (u8*)(&req->addr2[0]);
 
293
        tag += sizeof( struct rtllib_hdr_3addr);
 
294
        pDialogToken = tag + 2;  
 
295
        pBaParamSet = (PBA_PARAM_SET)(tag + 3);   
 
296
        pBaTimeoutVal = (u16*)(tag + 5); 
 
297
        pBaStartSeqCtrl = (PSEQUENCE_CONTROL)(req + 7);
 
298
        
 
299
        printk("====>rx ADDBAREQ from :"MAC_FMT"\n", MAC_ARG(dst));     
 
300
        if(
 
301
#ifdef _RTL8192_EXT_PATCH_
 
302
                (ieee->current_network.qos_data.active == 0 && ieee->current_mesh_network.qos_data.active==0) ||
 
303
#else
 
304
                ieee->current_network.qos_data.active == 0  ||
 
305
#endif  
 
306
                (ieee->pHTInfo->bCurrentHTSupport == false) ||
 
307
                (ieee->pHTInfo->IOTAction & HT_IOT_ACT_REJECT_ADDBA_REQ)) 
 
308
        {
 
309
                rc = ADDBA_STATUS_REFUSED;
 
310
                RTLLIB_DEBUG(RTLLIB_DL_ERR, "Failed to reply on ADDBA_REQ as some capability is not ready(%d, %d)\n", ieee->current_network.qos_data.active, ieee->pHTInfo->bCurrentHTSupport);
 
311
                goto OnADDBAReq_Fail;
 
312
        }
 
313
        if(     !GetTs(
 
314
                        ieee, 
 
315
                        (PTS_COMMON_INFO*)(&pTS), 
 
316
                        dst, 
 
317
                        (u8)(pBaParamSet->field.TID), 
 
318
                        RX_DIR,
 
319
                        true)   )
 
320
        {
 
321
                rc = ADDBA_STATUS_REFUSED;
 
322
                RTLLIB_DEBUG(RTLLIB_DL_ERR, "can't get TS in %s()\n", __FUNCTION__);
 
323
                goto OnADDBAReq_Fail;
 
324
        }
 
325
        pBA = &pTS->RxAdmittedBARecord;
 
326
 
 
327
        if(pBaParamSet->field.BAPolicy == BA_POLICY_DELAYED)
 
328
        {
 
329
                rc = ADDBA_STATUS_INVALID_PARAM;
 
330
                RTLLIB_DEBUG(RTLLIB_DL_ERR, "BA Policy is not correct in %s()\n", __FUNCTION__);
 
331
                goto OnADDBAReq_Fail;
 
332
        }
 
333
 
 
334
 
 
335
        rtllib_FlushRxTsPendingPkts(ieee, pTS);
 
336
        
 
337
        DeActivateBAEntry(ieee, pBA);   
 
338
        pBA->DialogToken = *pDialogToken;
 
339
        pBA->BaParamSet = *pBaParamSet;
 
340
        pBA->BaTimeoutValue = *pBaTimeoutVal;
 
341
        pBA->BaStartSeqCtrl = *pBaStartSeqCtrl;
 
342
        
 
343
        if (ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev)||
 
344
        (ieee->pHTInfo->IOTAction & HT_IOT_ACT_ALLOW_PEER_AGG_ONE_PKT))
 
345
        pBA->BaParamSet.field.BufferSize = 1;
 
346
        else
 
347
        pBA->BaParamSet.field.BufferSize = 32;
 
348
        
 
349
        ActivateBAEntry(ieee, pBA, 0);
 
350
        rtllib_send_ADDBARsp(ieee, dst, pBA, ADDBA_STATUS_SUCCESS);
 
351
 
 
352
        return 0;
 
353
        
 
354
OnADDBAReq_Fail:
 
355
        {
 
356
                BA_RECORD       BA;
 
357
                BA.BaParamSet = *pBaParamSet;
 
358
                BA.BaTimeoutValue = *pBaTimeoutVal;
 
359
                BA.DialogToken = *pDialogToken;
 
360
                BA.BaParamSet.field.BAPolicy = BA_POLICY_IMMEDIATE;
 
361
                rtllib_send_ADDBARsp(ieee, dst, &BA, rc);
 
362
                return 0; 
 
363
        }
 
364
 
 
365
}
 
366
 
 
367
int rtllib_rx_ADDBARsp( struct rtllib_device* ieee, struct sk_buff *skb)
 
368
{
 
369
         struct rtllib_hdr_3addr* rsp = NULL;
 
370
        PBA_RECORD              pPendingBA, pAdmittedBA;
 
371
        PTX_TS_RECORD           pTS = NULL;
 
372
        u8* dst = NULL, *pDialogToken = NULL, *tag = NULL;
 
373
        u16* pStatusCode = NULL, *pBaTimeoutVal = NULL;
 
374
        PBA_PARAM_SET           pBaParamSet = NULL;
 
375
        u16                     ReasonCode;
 
376
 
 
377
        if (skb->len < sizeof( struct rtllib_hdr_3addr) + 9)
 
378
        {
 
379
                RTLLIB_DEBUG(RTLLIB_DL_ERR, " Invalid skb len in BARSP(%d / %d)\n", (int)skb->len,      (int)(sizeof( struct rtllib_hdr_3addr) + 9));
 
380
                return -1;
 
381
        }
 
382
        rsp = ( struct rtllib_hdr_3addr*)skb->data;
 
383
        tag = (u8*)rsp;
 
384
        dst = (u8*)(&rsp->addr2[0]);
 
385
        tag += sizeof( struct rtllib_hdr_3addr);
 
386
        pDialogToken = tag + 2;
 
387
        pStatusCode = (u16*)(tag + 3);
 
388
        pBaParamSet = (PBA_PARAM_SET)(tag + 5);
 
389
        pBaTimeoutVal = (u16*)(tag + 7);
 
390
 
 
391
        printk("====>rx ADDBARSP from :"MAC_FMT"\n", MAC_ARG(dst));     
 
392
        if(     
 
393
#ifdef _RTL8192_EXT_PATCH_
 
394
                (ieee->current_network.qos_data.active == 0 && ieee->current_mesh_network.qos_data.active==0) ||
 
395
#else
 
396
                ieee->current_network.qos_data.active == 0  ||
 
397
#endif  
 
398
                ieee->pHTInfo->bCurrentHTSupport == false ||
 
399
                ieee->pHTInfo->bCurrentAMPDUEnable == false )
 
400
        {
 
401
                RTLLIB_DEBUG(RTLLIB_DL_ERR, "reject to ADDBA_RSP as some capability is not ready(%d, %d, %d)\n",ieee->current_network.qos_data.active, ieee->pHTInfo->bCurrentHTSupport, ieee->pHTInfo->bCurrentAMPDUEnable);
 
402
                ReasonCode = DELBA_REASON_UNKNOWN_BA;
 
403
                goto OnADDBARsp_Reject;
 
404
        }
 
405
 
 
406
        
 
407
        if (!GetTs(
 
408
                        ieee, 
 
409
                        (PTS_COMMON_INFO*)(&pTS), 
 
410
                        dst, 
 
411
                        (u8)(pBaParamSet->field.TID), 
 
412
                        TX_DIR,
 
413
                        false)  )
 
414
        {
 
415
                RTLLIB_DEBUG(RTLLIB_DL_ERR, "can't get TS in %s()\n", __FUNCTION__);
 
416
                ReasonCode = DELBA_REASON_UNKNOWN_BA;
 
417
                goto OnADDBARsp_Reject;
 
418
        }
 
419
        
 
420
        pTS->bAddBaReqInProgress = false;
 
421
        pPendingBA = &pTS->TxPendingBARecord;
 
422
        pAdmittedBA = &pTS->TxAdmittedBARecord;
 
423
 
 
424
 
 
425
        if((pAdmittedBA->bValid==true))
 
426
        {
 
427
                RTLLIB_DEBUG(RTLLIB_DL_BA, "OnADDBARsp(): Recv ADDBA Rsp. Drop because already admit it! \n");
 
428
                return -1;
 
429
        }
 
430
        else if((pPendingBA->bValid == false) ||(*pDialogToken != pPendingBA->DialogToken))
 
431
        {
 
432
                RTLLIB_DEBUG(RTLLIB_DL_ERR,  "OnADDBARsp(): Recv ADDBA Rsp. BA invalid, DELBA! \n");
 
433
                ReasonCode = DELBA_REASON_UNKNOWN_BA;
 
434
                goto OnADDBARsp_Reject;
 
435
        }
 
436
        else
 
437
        {
 
438
                RTLLIB_DEBUG(RTLLIB_DL_BA, "OnADDBARsp(): Recv ADDBA Rsp. BA is admitted! Status code:%X\n", *pStatusCode);
 
439
                DeActivateBAEntry(ieee, pPendingBA);
 
440
        }
 
441
 
 
442
 
 
443
        if(*pStatusCode == ADDBA_STATUS_SUCCESS)
 
444
        {
 
445
                if(pBaParamSet->field.BAPolicy == BA_POLICY_DELAYED)
 
446
                {
 
447
                        pTS->bAddBaReqDelayed = true;
 
448
                        DeActivateBAEntry(ieee, pAdmittedBA);
 
449
                        ReasonCode = DELBA_REASON_END_BA;
 
450
                        goto OnADDBARsp_Reject;
 
451
                }
 
452
 
 
453
 
 
454
                pAdmittedBA->DialogToken = *pDialogToken;
 
455
                pAdmittedBA->BaTimeoutValue = *pBaTimeoutVal;
 
456
                pAdmittedBA->BaStartSeqCtrl = pPendingBA->BaStartSeqCtrl;
 
457
                pAdmittedBA->BaParamSet = *pBaParamSet;
 
458
                DeActivateBAEntry(ieee, pAdmittedBA);
 
459
                ActivateBAEntry(ieee, pAdmittedBA, *pBaTimeoutVal);
 
460
        } else {
 
461
                pTS->bAddBaReqDelayed = true;
 
462
                pTS->bDisable_AddBa = true;
 
463
                ReasonCode = DELBA_REASON_END_BA;
 
464
                goto OnADDBARsp_Reject;
 
465
        }
 
466
 
 
467
        return 0;
 
468
 
 
469
OnADDBARsp_Reject:
 
470
        {
 
471
                BA_RECORD       BA;
 
472
                BA.BaParamSet = *pBaParamSet;
 
473
                rtllib_send_DELBA(ieee, dst, &BA, TX_DIR, ReasonCode);
 
474
                return 0;
 
475
        }
 
476
        
 
477
}
 
478
 
 
479
int rtllib_rx_DELBA(struct rtllib_device* ieee,struct sk_buff *skb)
 
480
{
 
481
         struct rtllib_hdr_3addr* delba = NULL;
 
482
        PDELBA_PARAM_SET        pDelBaParamSet = NULL;
 
483
        u16*                    pReasonCode = NULL;
 
484
        u8*                     dst = NULL;
 
485
 
 
486
        if (skb->len < sizeof( struct rtllib_hdr_3addr) + 6)
 
487
        {
 
488
                RTLLIB_DEBUG(RTLLIB_DL_ERR, " Invalid skb len in DELBA(%d / %d)\n", (int)skb->len,      (int)(sizeof( struct rtllib_hdr_3addr) + 6));
 
489
                return -1;
 
490
        }
 
491
        
 
492
        if(
 
493
#ifdef _RTL8192_EXT_PATCH_
 
494
                (ieee->current_network.qos_data.active == 0 && ieee->current_mesh_network.qos_data.active==0) ||
 
495
#else
 
496
                ieee->current_network.qos_data.active == 0  ||
 
497
#endif  
 
498
                ieee->pHTInfo->bCurrentHTSupport == false )
 
499
        {
 
500
                RTLLIB_DEBUG(RTLLIB_DL_ERR, "received DELBA while QOS or HT is not supported(%d, %d)\n",ieee->current_network.qos_data.active, ieee->pHTInfo->bCurrentHTSupport);
 
501
                return -1;
 
502
        }
 
503
        
 
504
        RTLLIB_DEBUG_DATA(RTLLIB_DL_DATA|RTLLIB_DL_BA, skb->data, skb->len);
 
505
        delba = ( struct rtllib_hdr_3addr*)skb->data;
 
506
        dst = (u8*)(&delba->addr2[0]);
 
507
        delba += sizeof( struct rtllib_hdr_3addr);
 
508
        pDelBaParamSet = (PDELBA_PARAM_SET)(delba+2);
 
509
        pReasonCode = (u16*)(delba+4);
 
510
 
 
511
        if(pDelBaParamSet->field.Initiator == 1)
 
512
        {
 
513
                PRX_TS_RECORD   pRxTs;
 
514
 
 
515
                if( !GetTs(
 
516
                                ieee, 
 
517
                                (PTS_COMMON_INFO*)&pRxTs, 
 
518
                                dst, 
 
519
                                (u8)pDelBaParamSet->field.TID, 
 
520
                                RX_DIR,
 
521
                                false)  )
 
522
                {
 
523
                        RTLLIB_DEBUG(RTLLIB_DL_ERR,  "can't get TS for RXTS in %s().dsf:"MAC_FMT" TID:%d\n", __FUNCTION__, MAC_ARG(dst), (u8)pDelBaParamSet->field.TID);
 
524
                        return -1;
 
525
                }
 
526
                
 
527
                RxTsDeleteBA(ieee, pRxTs);
 
528
        }
 
529
        else
 
530
        {
 
531
                PTX_TS_RECORD   pTxTs;
 
532
 
 
533
                if(!GetTs(
 
534
                        ieee, 
 
535
                        (PTS_COMMON_INFO*)&pTxTs, 
 
536
                        dst, 
 
537
                        (u8)pDelBaParamSet->field.TID, 
 
538
                        TX_DIR,
 
539
                        false)  )
 
540
                {
 
541
                        RTLLIB_DEBUG(RTLLIB_DL_ERR,  "can't get TS for TXTS in %s()\n", __FUNCTION__);
 
542
                        return -1;
 
543
                }
 
544
                
 
545
                pTxTs->bUsingBa = false;
 
546
                pTxTs->bAddBaReqInProgress = false;
 
547
                pTxTs->bAddBaReqDelayed = false;
 
548
                del_timer_sync(&pTxTs->TsAddBaTimer);
 
549
                TxTsDeleteBA(ieee, pTxTs);
 
550
        }
 
551
        return 0;
 
552
}
 
553
 
 
554
void
 
555
TsInitAddBA(
 
556
        struct rtllib_device* ieee,
 
557
        PTX_TS_RECORD   pTS,
 
558
        u8              Policy,
 
559
        u8              bOverwritePending
 
560
        )
 
561
{
 
562
        PBA_RECORD                      pBA = &pTS->TxPendingBARecord;
 
563
 
 
564
        if(pBA->bValid==true && bOverwritePending==false)
 
565
                return;
 
566
 
 
567
        DeActivateBAEntry(ieee, pBA);
 
568
        
 
569
        pBA->DialogToken++;                                             
 
570
        pBA->BaParamSet.field.AMSDU_Support = 0;        
 
571
        pBA->BaParamSet.field.BAPolicy = Policy;        
 
572
        pBA->BaParamSet.field.TID = pTS->TsCommonInfo.TSpec.f.TSInfo.field.ucTSID;      
 
573
        pBA->BaParamSet.field.BufferSize = 32;          
 
574
        pBA->BaTimeoutValue = 0;                                        
 
575
        pBA->BaStartSeqCtrl.field.SeqNum = (pTS->TxCurSeq + 3) % 4096;  
 
576
 
 
577
        ActivateBAEntry(ieee, pBA, BA_SETUP_TIMEOUT);
 
578
 
 
579
        rtllib_send_ADDBAReq(ieee, pTS->TsCommonInfo.Addr, pBA);
 
580
}
 
581
 
 
582
void
 
583
TsInitDelBA( struct rtllib_device* ieee, PTS_COMMON_INFO pTsCommonInfo, TR_SELECT TxRxSelect)
 
584
{
 
585
 
 
586
        if(TxRxSelect == TX_DIR)
 
587
        {
 
588
                PTX_TS_RECORD   pTxTs = (PTX_TS_RECORD)pTsCommonInfo;
 
589
 
 
590
                if(TxTsDeleteBA(ieee, pTxTs))
 
591
                        rtllib_send_DELBA(
 
592
                                ieee, 
 
593
                                pTsCommonInfo->Addr, 
 
594
                                (pTxTs->TxAdmittedBARecord.bValid)?(&pTxTs->TxAdmittedBARecord):(&pTxTs->TxPendingBARecord), 
 
595
                                TxRxSelect, 
 
596
                                DELBA_REASON_END_BA);
 
597
        }
 
598
        else if(TxRxSelect == RX_DIR)
 
599
        {
 
600
                PRX_TS_RECORD   pRxTs = (PRX_TS_RECORD)pTsCommonInfo;
 
601
                if(RxTsDeleteBA(ieee, pRxTs))
 
602
                        rtllib_send_DELBA(
 
603
                                ieee, 
 
604
                                pTsCommonInfo->Addr, 
 
605
                                &pRxTs->RxAdmittedBARecord, 
 
606
                                TxRxSelect, 
 
607
                                DELBA_REASON_END_BA     );
 
608
        }
 
609
}
 
610
void BaSetupTimeOut(unsigned long data)
 
611
{
 
612
        PTX_TS_RECORD   pTxTs = (PTX_TS_RECORD)data;
 
613
 
 
614
        pTxTs->bAddBaReqInProgress = false;
 
615
        pTxTs->bAddBaReqDelayed = true;
 
616
        pTxTs->TxPendingBARecord.bValid = false;
 
617
}
 
618
 
 
619
void TxBaInactTimeout(unsigned long data)
 
620
{
 
621
        PTX_TS_RECORD   pTxTs = (PTX_TS_RECORD)data;
 
622
        struct rtllib_device *ieee = container_of(pTxTs, struct rtllib_device, TxTsRecord[pTxTs->num]);
 
623
        TxTsDeleteBA(ieee, pTxTs);
 
624
        rtllib_send_DELBA(
 
625
                ieee, 
 
626
                pTxTs->TsCommonInfo.Addr, 
 
627
                &pTxTs->TxAdmittedBARecord,
 
628
                TX_DIR, 
 
629
                DELBA_REASON_TIMEOUT);
 
630
}
 
631
 
 
632
void RxBaInactTimeout(unsigned long data)
 
633
{
 
634
        PRX_TS_RECORD   pRxTs = (PRX_TS_RECORD)data;
 
635
        struct rtllib_device *ieee = container_of(pRxTs, struct rtllib_device, RxTsRecord[pRxTs->num]);
 
636
        
 
637
        RxTsDeleteBA(ieee, pRxTs);
 
638
        rtllib_send_DELBA(
 
639
                ieee, 
 
640
                pRxTs->TsCommonInfo.Addr, 
 
641
                &pRxTs->RxAdmittedBARecord,
 
642
                RX_DIR, 
 
643
                DELBA_REASON_TIMEOUT);
 
644
        return ;
 
645
}
 
646