summaryrefs'>logtreecommitdiffstats
diff options
context:
space:
mode:
authorBertrand Jacquin <bertrand@jacquin.bzh>2019-05-14 21:19:46 +0100
committerBertrand Jacquin <bertrand@jacquin.bzh>2019-05-14 21:19:46 +0100
commit'>9f3b1742db3c58c9f796471753cec76e0ab0e8e6 ( ('>patch)
treedcaab10251ed5448d977ad0fc7ab4de16fb320e8
parent'>sys-kernel/stable-sources: Bump 5.0 ('>diff)
downloadetc-portage-patches-master.tar.gz
sys-kernel/stable-sources: Bump 5.1HEADmaster
--rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0001-arm-partially-revert-702b94bff3c50542a6e4ab9a4f4cef0.patch2
--rw-r--r--r--sys-kernel/boest-v5.1.1/raspberrypi/0002-Revert-rtc-pcf8523-properly-handle-oscillator-stop-b.patch2
--rw-r--r--r--sys-kernel/boest-v5.1.1/raspberrypi/0003-smsx95xx-fix-crimes-against-truesize.patch2
--rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0004-smsc95xx-Experimental-Enable-turbo_mode-and-packetsi.patch2
--rw-r--r--r--sys-kernel/boest-v5.1.1/raspberrypi/0005-Allow-mac-address-to-be-set-in-smsc95xx.patch22
-rw-rw-r--r--'>sys-kernel/boest-v5.1.1/raspberrypi/0006-Protect-__release_resource-against-resources-without.patch22
-rw-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0007-irq-bcm2836-Prevent-spurious-interrupts-and-trap-the.patch2
--rw-r--r--r--'>sys-kernel/boest-v5.1.1/raspberrypi/0008-irq-bcm2836-Avoid-Invalid-trigger-warning.patch2
--rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0009-irqchip-bcm2835-Add-FIQ-support.patch22
-rw-rw-r--r--'>sys-kernel/boest-v5.1.1/raspberrypi/0010-irqchip-irq-bcm2835-Add-2836-FIQ-support.patch22
--rw-r--r--'>sys-kernel/boest-v5.1.1/raspberrypi/0011-spi-spidev-Completely-disable-the-spidev-warning.patch22
--rw-r--r--r--sys-kernel/boest-v5.1.1/raspberrypi/0012-dmaengine-bcm2835-Load-driver-early-and-support-lega.patch2
--rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0013-firmware-Updated-mailbox-header.patch22
-rw-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0014-rtc-Add-SPI-alias-for-pcf2123-driver.patch2
--rw-r--r--r--sys-kernel/boest-v5.1.1/raspberrypi/0015-watchdog-bcm2835-Support-setting-reboot-partition.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0016-reboot-Use-power-off-rather-than-busy-spinning-when-.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0017-bcm-Make-RASPBERRYPI_POWER-depend-on-PM.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0018-Register-the-clocks-early-during-the-boot-process-so.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0019-bcm2835-rng-Avoid-initialising-if-already-enabled.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0020-clk-bcm2835-Mark-used-PLLs-and-dividers-CRITICAL.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0021-clk-bcm2835-Add-claim-clocks-property.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0022-clk-bcm2835-Read-max-core-clock-from-firmware.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0023-clk-bcm2835-Mark-GPIO-clocks-enabled-at-boot-as-crit.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0024-sound-Demote-deferral-errors-to-INFO-level.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0025-Update-vfpmodule.c.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0026-i2c-bcm2835-Add-debug-support.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0027-mm-Remove-the-PFN-busy-warning.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0028-ASoC-Add-prompt-for-ICS43432-codec.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0029-irqchip-irq-bcm2836-Remove-regmap-and-syscon-use.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0030-lan78xx-Enable-LEDs-and-auto-negotiation.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0031-amba_pl011-Don-t-use-DT-aliases-for-numbering.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0032-amba_pl011-Round-input-clock-up.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0033-amba_pl011-Insert-mb-for-correct-FIFO-handling.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0034-amba_pl011-Add-cts-event-workaround-DT-property.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0035-pinctrl-bcm2835-Set-base-to-0-give-expected-gpio-num.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0036-Main-bcm2708-bcm2709-linux-port.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0037-Add-dwc_otg-driver.patch6
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0038-bcm2708-framebuffer-driver.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0039-fbdev-add-FBIOCOPYAREA-ioctl.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0040-Speed-up-console-framebuffer-imageblit-function.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0041-dmaengine-Add-support-for-BCM2708.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0042-MMC-added-alternative-MMC-driver.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0043-Adding-bcm2835-sdhost-driver-and-an-overlay-to-enabl.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0044-vc_mem-Add-vc_mem-driver-for-querying-firmware-memor.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0045-vcsm-VideoCore-shared-memory-service-for-BCM2835.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0046-Add-dev-gpiomem-device-for-rootless-user-GPIO-access.patch18
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0047-Add-SMI-driver.patch35
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0048-MISC-bcm2835-smi-use-clock-manager-and-fix-reload-is.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0049-Add-SMI-NAND-driver.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0050-Revert-Add-SMI-NAND-driver.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0051-Add-cpufreq-driver.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0052-Add-Chris-Boot-s-i2c-driver.patch6
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0053-char-broadcom-Add-vcio-module.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0054-firmware-bcm2835-Support-ARCH_BCM270x.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0055-scripts-Add-mkknlimg-and-knlinfo-scripts-from-tools-.patch6
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0056-BCM2708-Add-core-Device-Tree-support.patch278
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0057-BCM270x_DT-Add-pwr_led-and-the-required-input-trigge.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0058-Added-Device-IDs-for-August-DVB-T-205.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0059-Improve-__copy_to_user-and-__copy_from_user-performa.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0060-gpio-poweroff-Allow-it-to-work-on-Raspberry-Pi.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0061-mfd-Add-Raspberry-Pi-Sense-HAT-core-driver.patch18
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0062-ASoC-Add-support-for-Rpi-DAC.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0063-Add-IQaudIO-Sound-Card-support-for-Raspberry-Pi.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0064-Added-support-for-HiFiBerry-DAC.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0065-Added-driver-for-HiFiBerry-Amp-amplifier-add-on-boar.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0066-Add-driver-for-rpi-proto.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0067-Add-Support-for-JustBoom-Audio-boards.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0068-New-AudioInjector.net-Pi-soundcard-with-low-jitter-a.patch13
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0069-New-driver-for-RRA-DigiDAC1-soundcard-using-WM8741-W.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0070-Add-support-for-Dion-Audio-LOCO-DAC-AMP-HAT.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0071-Allo-Piano-DAC-boards-Initial-2-channel-stereo-suppo.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0072-Add-support-for-Allo-Piano-DAC-2.1-plus-add-on-board.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0073-Add-support-for-Allo-Boss-DAC-add-on-board-for-Raspb.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0074-Support-for-Blokas-Labs-pisound-board.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0075-ASoC-Add-driver-for-Cirrus-Logic-Audio-Card.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0076-sound-Support-for-Dion-Audio-LOCO-V2-DAC-AMP-HAT.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0077-Add-support-for-Fe-Pi-audio-sound-card.-1867.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0078-Add-support-for-the-AudioInjector.net-Octo-sound-car.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0079-Driver-support-for-Google-voiceHAT-soundcard.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0080-Driver-and-overlay-for-Allo-Katana-DAC.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0081-ASoC-Add-generic-RPI-driver-for-simple-soundcards.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0082-ASoC-Add-Kconfig-and-Makefile-for-sound-soc-bcm.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0083-ASoC-Create-a-generic-Pi-Hat-WM8804-driver.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0084-rpi_display-add-backlight-driver-and-overlay.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0085-bcm2835-virtgpio-Virtual-GPIO-driver.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0086-net-Add-non-mainline-source-for-rtl8192cu-wlan.patch25197
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0087-OF-DT-Overlay-configfs-interface.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0088-brcm-adds-support-for-BCM43341-wifi.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0089-hci_h5-Don-t-send-conf_req-when-ACTIVE.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0090-config-Add-default-configs.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0091-Add-arm64-configuration-and-device-tree-differences..patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0092-ARM64-DWC_OTG-Port-dwc_otg-driver-to-ARM64.patch4
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0093-ARM64-Round-Robin-dispatch-IRQs-between-CPUs.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0094-ARM64-Force-hardware-emulation-of-deprecated-instruc.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0095-build-arm64-Add-rules-for-.dtbo-files-for-dts-overla.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0096-Revert-build-arm64-Add-rules-for-.dtbo-files-for-dts.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0097-cache-export-clean-and-invalidate.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0098-AXI-performance-monitor-driver-2222.patch11
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0099-mcp2515-Use-DT-supplied-interrupt-flags.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0100-cgroup-Disable-cgroup-memory-by-default.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0101-ARM-bcm2835-Set-Serial-number-and-Revision.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0102-dwc-otg-FIQ-Fix-bad-mode-in-data-abort-handler.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0103-ARM-Activate-FIQs-to-avoid-__irq_startup-warnings.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0104-serial-8250-bcm2835aux-suppress-EPROBE_DEFER.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0105-raspberrypi-firmware-Export-the-general-transaction-.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0106-drm-vc4-Add-a-mode-for-using-the-closed-firmware-for.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0107-drm-vc4-Name-the-primary-and-cursor-planes-in-fkms.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0108-drm-vc4-Add-DRM_DEBUG_ATOMIC-for-the-insides-of-fkms.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0109-drm-vc4-Fix-sending-of-page-flip-completion-events-i.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0110-drm-vc4-Add-support-for-setting-DPMS-in-firmwarekms.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0111-drm-vc4-Add-FB-modifier-support-to-firmwarekms.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0112-drm-vc4-Add-missing-enable-disable-vblank-handlers-i.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0113-vc4_fkms-Apply-firmware-overscan-offset-to-hardware-.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0114-drm-vc4-Fix-warning-about-vblank-interrupts-before-D.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0115-drm-vc4-Skip-SET_CURSOR_INFO-when-the-cursor-content.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0116-drm-vc4-Remove-duplicate-primary-cursor-fields-from-.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0117-vc4_firmware_kms-fix-build.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0118-gpu-vc4-fkms-Update-driver-to-not-use-plane-crtc.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0119-drm-vc4-Don-t-wait-for-vblank-on-fkms-cursor-updates.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0120-i2c-gpio-Also-set-bus-numbers-from-reg-property.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0121-added-capture_clear-option-to-pps-gpio-via-dtoverlay.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0122-lan78xx-Read-initial-EEE-status-from-DT.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0123-hid-Reduce-default-mouse-polling-interval-to-60Hz.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0124-Add-ability-to-export-gpio-used-by-gpio-poweroff.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0125-firmware-raspberrypi-Notify-firmware-of-a-reboot.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0126-irqchip-irq-bcm2835-Calc.-FIQ_START-at-boot-time.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0127-of-configfs-Use-of_overlay_fdt_apply-API-call.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0128-net-lan78xx-Disable-TCP-Segmentation-Offload-TSO.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0129-brcmfmac-Re-enable-firmware-roaming-support.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0130-lan78xx-Move-enabling-of-EEE-into-PHY-init-code.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0131-Add-rpi-poe-fan-driver.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0132-cxd2880-CXD2880_SPI_DRV-should-select-DVB_CXD2880-wi.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0133-vchiq_2835_arm-Implement-a-DMA-pool-for-small-bulk-t.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0134-hwmon-raspberrypi-Prevent-voltage-low-warnings-from-.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0135-firmware-raspberrypi-Add-backward-compatible-get_thr.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0136-sc16is7xx-Don-t-spin-if-no-data-received.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0137-drivers-thermal-step_wise-add-support-for-hysteresis.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0138-drivers-thermal-step_wise-avoid-throttling-at-hyster.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0139-Update-issue-templates-2736.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0140-gpiolib-Don-t-prevent-IRQ-usage-of-output-GPIOs.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0141-lan78xx-disable-interrupts-for-PHY-irqs.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0142-rpi-wm8804-soundcard-drop-PWRDN-register-writes.patch22
--rw-r--r--r--'>sys-kernel/boest-v5.1.1/raspberrypi/0143-rpi-wm8804-soundcard-configure-wm8804-clocks-only-on.patch22
-rw-rw-r--r--'>sys-kernel/boest-v5.1.1/raspberrypi/0144-net-lan78xx-Support-auto-downshift-to-100Mb-s.patch2
--rw-r--r--r--'>sys-kernel/boest-v5.1.1/raspberrypi/0145-ASoC-add-driver-for-3Dlab-Nano-soundcard-2758.patch2
--rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0146-staging-bcm2835-camera-Ensure-H264-header-bytes-get-.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0147-staging-bcm2835-camera-Check-the-error-for-REPEAT_SE.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0148-firmware-raspberrypi-Report-the-fw-variant-during-pr.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0149-firmware-raspberrypi-Report-the-fw-git-hash-during-p.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0150-arm64-dts-broadcom-Enable-fixups-for-overlays.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0151-bcm2835_smi-re-add-dereference-to-fix-DMA-transfers.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0152-lan78xx-Debounce-link-events-to-minimize-poll-storm.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0153-ASoC-Add-support-for-AudioSense-Pi-add-on-soundcard.patch11
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0154-spi-spi-bcm2835-Re-enable-HW-CS.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0155-spi-spi-bcm2835-Disable-forced-software-CS.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0156-Added-driver-for-the-HiFiBerry-DAC-ADC-2694.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0157-mfd-Add-rpi_sense_core-of-compatible-string.patch4
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0158-configs-Enable-the-AD193x-codecs.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0159-lan78xx-EEE-support-is-now-a-PHY-property.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0160-Revert-staging-vchiq-delete-vchiq_killable.h.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0161-Revert-staging-vchiq_2835_arm-quit-using-custom-down.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0162-Revert-staging-vchiq-switch-to-wait_for_completion_k.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0163-Revert-staging-vchiq-rework-remove_event-handling.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0164-Revert-staging-bcm2835-audio-Drop-DT-dependency.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0165-gpu-vc4_firmware_kms-Fix-up-64-bit-compile-warnings.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0166-bcm2835-dma-Add-support-for-per-channel-flags.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0167-drm-vc4-Programming-the-CTM-is-conditional-on-runnin.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0168-rtc-rv3028-Add-backup-switchover-mode-support.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0169-ASoC-tlv320aic32x4-Break-out-clock-setting-into-sepa.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0170-ASoC-tlv320aic32x4-Properly-Set-Processing-Blocks.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0171-ASoC-tlv320aic32x4-Model-PLL-in-CCF.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0172-ASoC-tlv320aic32x4-Model-CODEC_CLKIN-in-CCF.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0173-ASoC-tlv320aic32x4-Model-DAC-ADC-dividers-in-CCF.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0174-ASoC-tlv320aic32x4-Model-BDIV-divider-in-CCF.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0175-ASoC-tlv320aic32x4-Control-clock-gating-with-CCF.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0176-ASoC-tlv320aic32x4-Move-aosr-and-dosr-setting-to-sep.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0177-ASoC-tlv320aic32x4-Dynamically-Determine-Clocking.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0178-ASoC-tlv320aic32x4-Restructure-set_dai_sysclk.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0179-ASoC-tlv320aic32x4-Remove-mclk-references.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0180-ASoC-tlv320aic32x4-Allow-192000-Sample-Rate.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0181-ASoC-tlv320aic32x4-Only-enable-with-common-clock.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0182-Audiophonics-I-Sabre-9038Q2M-DAC-driver.patch6
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0183-ASoC-tlv320aic32x4-Update-copyright-and-use-SPDX-ide.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0184-ASoC-tlv320aic32x4-Add-Switch-for-Setting-Common-Mod.patch2
-rw-r--r--sys-kernel/boest-v5.1.1/raspberrypi/0185-ASoC-tlv320aic32x4-Add-Playback-PowerTune-Controls.patch2
-rw-r--r--sys-kernel/boest-v5.1.2/0001-patch-5.1-ja1.diff.patch2120
-rw-r--r--sys-kernel/boest-v5.1.2/0002-pool-2.6.25-tcp-timewait-20s.diff.patch27
-rw-r--r--sys-kernel/boest-v5.1.2/0003-pool-2.6.25-disable-tcp-debug.diff.patch25
-rw-r--r--sys-kernel/boest-v5.1.2/0004-TCP-add-a-sysctl-to-disable-simultaneous-connection-.patch142
-rw-r--r--sys-kernel/boest-v5.1.2/0005-pool-2.6.25-disable-kbdrate-at-boot.diff.patch34
-rw-r--r--sys-kernel/boest-v5.1.2/0006-Disable-CONFIG_PROCESSOR_SELECT-printk-s.patch45
-rw-r--r--sys-kernel/boest-v5.1.2/0007-This-patch-adds-support-for-a-restricted-user-contro.patch75
-rw-r--r--sys-kernel/boest-v5.1.2/0008-fs-Enable-link-security-restrictions-by-default.patch26
-rw-r--r--sys-kernel/boest-v5.1.2/0009-usb-storage-Disable-UAS-on-JMicron-SATA-enclosure.patch37
-rw-r--r--sys-kernel/boest-v5.1.2/0010-5.1-2600_enable-key-swapping-for-apple-mac.patch.patch125
-rw-r--r--sys-kernel/boest-v5.1.2/0011-5.1-4567_distro-Gentoo-Kconfig.patch.patch173
-rw-r--r--sys-kernel/boest-v5.1.2/0012-WARNING.patch565
l---------sys-kernel/stable-sources-5.1.21
198 files changed, 16282 insertions, 13068 deletions
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0001-arm-partially-revert-702b94bff3c50542a6e4ab9a4f4cef0.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0001-arm-partially-revert-702b94bff3c50542a6e4ab9a4f4cef0.patch
index 99dd3a33..fd15aa46 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0001-arm-partially-revert-702b94bff3c50542a6e4ab9a4f4cef0.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0001-arm-partially-revert-702b94bff3c50542a6e4ab9a4f4cef0.patch
@@ -1,4 +1,4 @@
-From a85a48f170d8ca4be05489f7c08440fdfed23a88 Mon Sep 17 00:00:00 2001
+From d4d5f5b1e77004dca51a49fa1720511cc8cf00a1 Mon Sep 17 00:00:00 2001
From: Dan Pasanen <dan.pasanen@gmail.com>
Date: Thu, 21 Sep 2017 09:55:42 -0500
Subject: [PATCH 001/185] arm: partially revert
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0002-Revert-rtc-pcf8523-properly-handle-oscillator-stop-b.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0002-Revert-rtc-pcf8523-properly-handle-oscillator-stop-b.patch
index b54d5072..b8c745db 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0002-Revert-rtc-pcf8523-properly-handle-oscillator-stop-b.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0002-Revert-rtc-pcf8523-properly-handle-oscillator-stop-b.patch
@@ -1,4 +1,4 @@
-From 3e80952340de5acb9650633e2dc4f0468444e99e Mon Sep 17 00:00:00 2001
+From 997c134fbb98cab37fd5ed20e8ee48922dcc1276 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Mon, 29 Oct 2018 14:45:45 +0000
Subject: [PATCH 002/185] Revert "rtc: pcf8523: properly handle oscillator stop
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0003-smsx95xx-fix-crimes-against-truesize.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0003-smsx95xx-fix-crimes-against-truesize.patch
index 380c388f..defb15f5 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0003-smsx95xx-fix-crimes-against-truesize.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0003-smsx95xx-fix-crimes-against-truesize.patch
@@ -1,4 +1,4 @@
-From dbbe485ba8a3cb95402b9a423a7fc0fd4dac58c9 Mon Sep 17 00:00:00 2001
+From bec63726bbfcc99b06d446195281c6e12cf4a22f Mon Sep 17 00:00:00 2001
From: Steve Glendinning <steve.glendinning@smsc.com>
Date: Thu, 19 Feb 2015 18:47:12 +0000
Subject: [PATCH 003/185] smsx95xx: fix crimes against truesize
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0004-smsc95xx-Experimental-Enable-turbo_mode-and-packetsi.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0004-smsc95xx-Experimental-Enable-turbo_mode-and-packetsi.patch
index 0c3bd6f1..840ad77f 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0004-smsc95xx-Experimental-Enable-turbo_mode-and-packetsi.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0004-smsc95xx-Experimental-Enable-turbo_mode-and-packetsi.patch
@@ -1,4 +1,4 @@
-From bc9e08d983b25131ed7b07c83a2e6579564dfb82 Mon Sep 17 00:00:00 2001
+From fc2a1e411397658adf8896049f02222963546281 Mon Sep 17 00:00:00 2001
From: Sam Nazarko <email@samnazarko.co.uk>
Date: Fri, 1 Apr 2016 17:27:21 +0100
Subject: [PATCH 004/185] smsc95xx: Experimental: Enable turbo_mode and
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0005-Allow-mac-address-to-be-set-in-smsc95xx.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0005-Allow-mac-address-to-be-set-in-smsc95xx.patch
index 400a7d1c..b1fac8bb 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0005-Allow-mac-address-to-be-set-in-smsc95xx.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0005-Allow-mac-address-to-be-set-in-smsc95xx.patch
@@ -1,4 +1,4 @@
-From 3844311bfed242be35b3181f1dce24c1ab4a8261 Mon Sep 17 00:00:00 2001
+From b921f59343fe44de2ed7030ed8c6113c45e71e0e Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Tue, 26 Mar 2013 17:26:38 +0000
Subject: [PATCH 005/185] Allow mac address to be set in smsc95xx
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0006-Protect-__release_resource-against-resources-without.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0006-Protect-__release_resource-against-resources-without.patch
index 2b8a1582..87e9341f 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0006-Protect-__release_resource-against-resources-without.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0006-Protect-__release_resource-against-resources-without.patch
@@ -1,4 +1,4 @@
-From b3d18c9fd4d6303968cf26a2dfc3f0d10e68fd4f Mon Sep 17 00:00:00 2001
+From 7466d3c89719bdbea2501caa4622fa1ef94ae093 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Fri, 13 Mar 2015 12:43:36 +0000
Subject: [PATCH 006/185] Protect __release_resource against resources without
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0007-irq-bcm2836-Prevent-spurious-interrupts-and-trap-the.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0007-irq-bcm2836-Prevent-spurious-interrupts-and-trap-the.patch
index 73a68179..7e44e21d 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0007-irq-bcm2836-Prevent-spurious-interrupts-and-trap-the.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0007-irq-bcm2836-Prevent-spurious-interrupts-and-trap-the.patch
@@ -1,4 +1,4 @@
-From 66cc96845cded65d926e07528802815ed6c8f3d5 Mon Sep 17 00:00:00 2001
+From 1353e12d39e3b150a54b525f2580c71c5bf0a519 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Fri, 4 Dec 2015 17:41:50 +0000
Subject: [PATCH 007/185] irq-bcm2836: Prevent spurious interrupts, and trap
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0008-irq-bcm2836-Avoid-Invalid-trigger-warning.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0008-irq-bcm2836-Avoid-Invalid-trigger-warning.patch
index be6d8f36..a02f8082 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0008-irq-bcm2836-Avoid-Invalid-trigger-warning.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0008-irq-bcm2836-Avoid-Invalid-trigger-warning.patch
@@ -1,4 +1,4 @@
-From 835f6e8d1bcb80c420b20681976771e0edfe2a37 Mon Sep 17 00:00:00 2001
+From 5d46e61e441e56a9ccc234c4a5785721e7e039bc Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Thu, 9 Feb 2017 14:33:30 +0000
Subject: [PATCH 008/185] irq-bcm2836: Avoid "Invalid trigger warning"
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0009-irqchip-bcm2835-Add-FIQ-support.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0009-irqchip-bcm2835-Add-FIQ-support.patch
index e3dcf052..c1f09cbd 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0009-irqchip-bcm2835-Add-FIQ-support.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0009-irqchip-bcm2835-Add-FIQ-support.patch
@@ -1,4 +1,4 @@
-From 83fac9874db9dd333f23efe250f8f5c857df93f1 Mon Sep 17 00:00:00 2001
+From 78ac0fdc2d2ee4e24445d9b9fbdf09704f216e2d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf@tronnes.org>
Date: Fri, 12 Jun 2015 19:01:05 +0200
Subject: [PATCH 009/185] irqchip: bcm2835: Add FIQ support
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0010-irqchip-irq-bcm2835-Add-2836-FIQ-support.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0010-irqchip-irq-bcm2835-Add-2836-FIQ-support.patch
index 6fec39b6..738a1a21 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0010-irqchip-irq-bcm2835-Add-2836-FIQ-support.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0010-irqchip-irq-bcm2835-Add-2836-FIQ-support.patch
@@ -1,4 +1,4 @@
-From 3d4c6857e4908e313374afca2ab76d53ec646d54 Mon Sep 17 00:00:00 2001
+From cc1513db41eef987a80c6ce203795e7a06c04901 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf@tronnes.org>
Date: Fri, 23 Oct 2015 16:26:55 +0200
Subject: [PATCH 010/185] irqchip: irq-bcm2835: Add 2836 FIQ support
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0011-spi-spidev-Completely-disable-the-spidev-warning.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0011-spi-spidev-Completely-disable-the-spidev-warning.patch
index ea65eba2..1ee9942b 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0011-spi-spidev-Completely-disable-the-spidev-warning.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0011-spi-spidev-Completely-disable-the-spidev-warning.patch
@@ -1,4 +1,4 @@
-From 91bafc356d9c47c9c29bc6c315f79206a1660c8c Mon Sep 17 00:00:00 2001
+From a6535479687721bf872e72903816cdf863c1210c Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Tue, 14 Jul 2015 10:26:09 +0100
Subject: [PATCH 011/185] spi: spidev: Completely disable the spidev warning
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0012-dmaengine-bcm2835-Load-driver-early-and-support-lega.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0012-dmaengine-bcm2835-Load-driver-early-and-support-lega.patch
index 059317e5..f2913ab3 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0012-dmaengine-bcm2835-Load-driver-early-and-support-lega.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0012-dmaengine-bcm2835-Load-driver-early-and-support-lega.patch
@@ -1,4 +1,4 @@
-From 0686654df18e1156e0a81c1e8305470650939db9 Mon Sep 17 00:00:00 2001
+From af840f0afa9e4f346b99308089320ca26522ccbf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf@tronnes.org>
Date: Sat, 3 Oct 2015 22:22:55 +0200
Subject: [PATCH 012/185] dmaengine: bcm2835: Load driver early and support
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0013-firmware-Updated-mailbox-header.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0013-firmware-Updated-mailbox-header.patch
index 2c072607..2e5f3bc3 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0013-firmware-Updated-mailbox-header.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0013-firmware-Updated-mailbox-header.patch
@@ -1,4 +1,4 @@
-From ab4735043e8756947c6480c404e019ae7816c05c Mon Sep 17 00:00:00 2001
+From ea4ee7a65c67cd719758f7689483be1a4d69d465 Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Mon, 25 Jan 2016 17:25:12 +0000
Subject: [PATCH 013/185] firmware: Updated mailbox header
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0014-rtc-Add-SPI-alias-for-pcf2123-driver.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0014-rtc-Add-SPI-alias-for-pcf2123-driver.patch
index dc807d1e..c57c9b9a 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0014-rtc-Add-SPI-alias-for-pcf2123-driver.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0014-rtc-Add-SPI-alias-for-pcf2123-driver.patch
@@ -1,4 +1,4 @@
-From e210d272bfed9c7cfc7159546bdf6681fb16a570 Mon Sep 17 00:00:00 2001
+From a1ebab770b18264cf09482be2f1c2b3668f2ed14 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Wed, 15 Jun 2016 16:48:41 +0100
Subject: [PATCH 014/185] rtc: Add SPI alias for pcf2123 driver
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0015-watchdog-bcm2835-Support-setting-reboot-partition.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0015-watchdog-bcm2835-Support-setting-reboot-partition.patch
index f67df2af..cc08c1ef 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0015-watchdog-bcm2835-Support-setting-reboot-partition.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0015-watchdog-bcm2835-Support-setting-reboot-partition.patch
@@ -1,4 +1,4 @@
-From 7f903a38ab966f8c24e7805f659ff45ea8305f90 Mon Sep 17 00:00:00 2001
+From 4241ebedc3a20801881b18c2bfde84eed4a29816 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf@tronnes.org>
Date: Fri, 7 Oct 2016 16:50:59 +0200
Subject: [PATCH 015/185] watchdog: bcm2835: Support setting reboot partition
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0016-reboot-Use-power-off-rather-than-busy-spinning-when-.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0016-reboot-Use-power-off-rather-than-busy-spinning-when-.patch
index 4d03199e..35ffb0c3 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0016-reboot-Use-power-off-rather-than-busy-spinning-when-.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0016-reboot-Use-power-off-rather-than-busy-spinning-when-.patch
@@ -1,4 +1,4 @@
-From 4118e44f94fff011a67587b17415bdb83f2b12d6 Mon Sep 17 00:00:00 2001
+From c8ee63c1845d22de42dc3b927b7d41ce9ec16bf3 Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Tue, 5 Apr 2016 19:40:12 +0100
Subject: [PATCH 016/185] reboot: Use power off rather than busy spinning when
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0017-bcm-Make-RASPBERRYPI_POWER-depend-on-PM.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0017-bcm-Make-RASPBERRYPI_POWER-depend-on-PM.patch
index 2d82eb1b..0d496daa 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0017-bcm-Make-RASPBERRYPI_POWER-depend-on-PM.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0017-bcm-Make-RASPBERRYPI_POWER-depend-on-PM.patch
@@ -1,4 +1,4 @@
-From caa2276393e083703618df4fd90df0687720f1c7 Mon Sep 17 00:00:00 2001
+From 71b3bb1e6ac03e8753d9485a34dbc27b510cd522 Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Wed, 9 Nov 2016 13:02:52 +0000
Subject: [PATCH 017/185] bcm: Make RASPBERRYPI_POWER depend on PM
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0018-Register-the-clocks-early-during-the-boot-process-so.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0018-Register-the-clocks-early-during-the-boot-process-so.patch
index e16f6e00..3260b933 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0018-Register-the-clocks-early-during-the-boot-process-so.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0018-Register-the-clocks-early-during-the-boot-process-so.patch
@@ -1,4 +1,4 @@
-From da89ee7a02b8ea340f3445533953955f91597d95 Mon Sep 17 00:00:00 2001
+From f5909494ef9aa73329fbe960ec518bfb5b146153 Mon Sep 17 00:00:00 2001
From: Martin Sperl <kernel@martin.sperl.org>
Date: Fri, 2 Sep 2016 16:45:27 +0100
Subject: [PATCH 018/185] Register the clocks early during the boot process, so
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0019-bcm2835-rng-Avoid-initialising-if-already-enabled.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0019-bcm2835-rng-Avoid-initialising-if-already-enabled.patch
index 13daa639..3516da67 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0019-bcm2835-rng-Avoid-initialising-if-already-enabled.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0019-bcm2835-rng-Avoid-initialising-if-already-enabled.patch
@@ -1,4 +1,4 @@
-From 8c3c384d9b13979e437de4db1969004c10d4a88e Mon Sep 17 00:00:00 2001
+From 268a0ead9185868127dfcd3f78ead2689df9a25c Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Tue, 6 Dec 2016 17:05:39 +0000
Subject: [PATCH 019/185] bcm2835-rng: Avoid initialising if already enabled
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0020-clk-bcm2835-Mark-used-PLLs-and-dividers-CRITICAL.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0020-clk-bcm2835-Mark-used-PLLs-and-dividers-CRITICAL.patch
index c4de1a51..e03fde27 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0020-clk-bcm2835-Mark-used-PLLs-and-dividers-CRITICAL.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0020-clk-bcm2835-Mark-used-PLLs-and-dividers-CRITICAL.patch
@@ -1,4 +1,4 @@
-From f125639ebf7121791445d7cc3d75bdcd6f9005fa Mon Sep 17 00:00:00 2001
+From 7d39a1b01f4e8f537e2f689f1857f6eac06ca02c Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Mon, 13 Feb 2017 17:20:08 +0000
Subject: [PATCH 020/185] clk-bcm2835: Mark used PLLs and dividers CRITICAL
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0021-clk-bcm2835-Add-claim-clocks-property.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0021-clk-bcm2835-Add-claim-clocks-property.patch
index c0c3674d..05b4141a 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0021-clk-bcm2835-Add-claim-clocks-property.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0021-clk-bcm2835-Add-claim-clocks-property.patch
@@ -1,4 +1,4 @@
-From 0a53d2a93022ef9c04217e12f8aa4e1fc756197f Mon Sep 17 00:00:00 2001
+From 8b9364ead333f8b8fc35b3c66e1f899a3c4b65ba Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Mon, 13 Feb 2017 17:20:08 +0000
Subject: [PATCH 021/185] clk-bcm2835: Add claim-clocks property
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0022-clk-bcm2835-Read-max-core-clock-from-firmware.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0022-clk-bcm2835-Read-max-core-clock-from-firmware.patch
index d0c2ef47..c5b43afa 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0022-clk-bcm2835-Read-max-core-clock-from-firmware.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0022-clk-bcm2835-Read-max-core-clock-from-firmware.patch
@@ -1,4 +1,4 @@
-From ac8fb249c01f01ab8f63f1188d08b6ddb6c14491 Mon Sep 17 00:00:00 2001
+From 3dd843da5b45bbdf43a8a86da8ed31db29645477 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Mon, 6 Mar 2017 09:06:18 +0000
Subject: [PATCH 022/185] clk-bcm2835: Read max core clock from firmware
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0023-clk-bcm2835-Mark-GPIO-clocks-enabled-at-boot-as-crit.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0023-clk-bcm2835-Mark-GPIO-clocks-enabled-at-boot-as-crit.patch
index 5aef270a..b473965c 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0023-clk-bcm2835-Mark-GPIO-clocks-enabled-at-boot-as-crit.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0023-clk-bcm2835-Mark-GPIO-clocks-enabled-at-boot-as-crit.patch
@@ -1,4 +1,4 @@
-From 7380ef215079d9ed80299210eac28e8a9b97aeb5 Mon Sep 17 00:00:00 2001
+From cf2afee6b347ad5d4c72bdaa0570493d9cd1286f Mon Sep 17 00:00:00 2001
From: Eric Anholt <eric@anholt.net>
Date: Mon, 9 May 2016 17:28:18 -0700
Subject: [PATCH 023/185] clk: bcm2835: Mark GPIO clocks enabled at boot as
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0024-sound-Demote-deferral-errors-to-INFO-level.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0024-sound-Demote-deferral-errors-to-INFO-level.patch
index cd18e163..c3ad8c37 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0024-sound-Demote-deferral-errors-to-INFO-level.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0024-sound-Demote-deferral-errors-to-INFO-level.patch
@@ -1,4 +1,4 @@
-From c9dd599c2118333570669cce8359d8bf28dd61f8 Mon Sep 17 00:00:00 2001
+From dd2e8b442bdfff44dc7ca99a6740af75a5824295 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Thu, 9 Feb 2017 14:36:44 +0000
Subject: [PATCH 024/185] sound: Demote deferral errors to INFO level
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0025-Update-vfpmodule.c.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0025-Update-vfpmodule.c.patch
index 15646c6e..2e9080ea 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0025-Update-vfpmodule.c.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0025-Update-vfpmodule.c.patch
@@ -1,4 +1,4 @@
-From e2550fd2b923c34581fe379355bc831d09d66029 Mon Sep 17 00:00:00 2001
+From b0d1cbb7b639cc83a3c4952368f523b76ba49cf1 Mon Sep 17 00:00:00 2001
From: Claggy3 <stephen.maclagan@hotmail.com>
Date: Sat, 11 Feb 2017 14:00:30 +0000
Subject: [PATCH 025/185] Update vfpmodule.c
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0026-i2c-bcm2835-Add-debug-support.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0026-i2c-bcm2835-Add-debug-support.patch
index 896dd092..df86dacd 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0026-i2c-bcm2835-Add-debug-support.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0026-i2c-bcm2835-Add-debug-support.patch
@@ -1,4 +1,4 @@
-From d81befb74af92d8e2b99af91e58573dadcb2e8f1 Mon Sep 17 00:00:00 2001
+From 24dd416eb07dc906e42350da69c43beb5bd3a991 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf@tronnes.org>
Date: Tue, 1 Nov 2016 15:15:41 +0100
Subject: [PATCH 026/185] i2c: bcm2835: Add debug support
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0027-mm-Remove-the-PFN-busy-warning.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0027-mm-Remove-the-PFN-busy-warning.patch
index 3655c1ad..f038d119 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0027-mm-Remove-the-PFN-busy-warning.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0027-mm-Remove-the-PFN-busy-warning.patch
@@ -1,4 +1,4 @@
-From d82373294acade79b2fa3c3fff8d883c630aca8c Mon Sep 17 00:00:00 2001
+From 015cd01a5261ab103aa7d397efdfde07afe46671 Mon Sep 17 00:00:00 2001
From: Eric Anholt <eric@anholt.net>
Date: Thu, 18 Dec 2014 16:07:15 -0800
Subject: [PATCH 027/185] mm: Remove the PFN busy warning
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0028-ASoC-Add-prompt-for-ICS43432-codec.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0028-ASoC-Add-prompt-for-ICS43432-codec.patch
index 66563569..f5302b3f 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0028-ASoC-Add-prompt-for-ICS43432-codec.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0028-ASoC-Add-prompt-for-ICS43432-codec.patch
@@ -1,4 +1,4 @@
-From 31136b29dfd9a206d2466aa13c977a39030454ad Mon Sep 17 00:00:00 2001
+From a2382df07a3c4199b67b99c10d83e2ff591c6dfc Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Thu, 23 Mar 2017 10:06:56 +0000
Subject: [PATCH 028/185] ASoC: Add prompt for ICS43432 codec
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0029-irqchip-irq-bcm2836-Remove-regmap-and-syscon-use.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0029-irqchip-irq-bcm2836-Remove-regmap-and-syscon-use.patch
index d9d95c19..edd1580e 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0029-irqchip-irq-bcm2836-Remove-regmap-and-syscon-use.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0029-irqchip-irq-bcm2836-Remove-regmap-and-syscon-use.patch
@@ -1,4 +1,4 @@
-From 61877a9c52de96edd3a15bb715e4d11cdcf4414b Mon Sep 17 00:00:00 2001
+From ae4aaa786229ca16a621afc75f34633849ac1bab Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Tue, 23 Jan 2018 16:52:45 +0000
Subject: [PATCH 029/185] irqchip: irq-bcm2836: Remove regmap and syscon use
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0030-lan78xx-Enable-LEDs-and-auto-negotiation.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0030-lan78xx-Enable-LEDs-and-auto-negotiation.patch
index 52ddb661..ff997479 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0030-lan78xx-Enable-LEDs-and-auto-negotiation.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0030-lan78xx-Enable-LEDs-and-auto-negotiation.patch
@@ -1,4 +1,4 @@
-From 5947d9f6cf0668cbd16b032b23b389847a22d998 Mon Sep 17 00:00:00 2001
+From 91a6f0a3a14cfccb9ae701cfa5f5b433d43db773 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Tue, 17 Oct 2017 15:04:29 +0100
Subject: [PATCH 030/185] lan78xx: Enable LEDs and auto-negotiation
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0031-amba_pl011-Don-t-use-DT-aliases-for-numbering.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0031-amba_pl011-Don-t-use-DT-aliases-for-numbering.patch
index df38ecaf..1f66dfca 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0031-amba_pl011-Don-t-use-DT-aliases-for-numbering.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0031-amba_pl011-Don-t-use-DT-aliases-for-numbering.patch
@@ -1,4 +1,4 @@
-From 50490bd6925a8634ccd26d700c3b0973ca47a01a Mon Sep 17 00:00:00 2001
+From 1541723da1e385380dd9e81f89625c3e9aecc30b Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Tue, 23 Feb 2016 17:26:48 +0000
Subject: [PATCH 031/185] amba_pl011: Don't use DT aliases for numbering
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0032-amba_pl011-Round-input-clock-up.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0032-amba_pl011-Round-input-clock-up.patch
index 4d16748b..c1006958 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0032-amba_pl011-Round-input-clock-up.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0032-amba_pl011-Round-input-clock-up.patch
@@ -1,4 +1,4 @@
-From 0191b53d72b5cd9006280e4a6659ba138ea67eb4 Mon Sep 17 00:00:00 2001
+From dc03bdbd5c13c2cacd9b27ac08dadff85f127d58 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Wed, 1 Mar 2017 16:07:39 +0000
Subject: [PATCH 032/185] amba_pl011: Round input clock up
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0033-amba_pl011-Insert-mb-for-correct-FIFO-handling.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0033-amba_pl011-Insert-mb-for-correct-FIFO-handling.patch
index f497d904..5f265536 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0033-amba_pl011-Insert-mb-for-correct-FIFO-handling.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0033-amba_pl011-Insert-mb-for-correct-FIFO-handling.patch
@@ -1,4 +1,4 @@
-From 195f81da0a0c4d88b3ab4c8b67890a88b08926a2 Mon Sep 17 00:00:00 2001
+From 737c18fba6ad665ea1a57e5f8980d1b97dc3c9b6 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Fri, 29 Sep 2017 10:32:19 +0100
Subject: [PATCH 033/185] amba_pl011: Insert mb() for correct FIFO handling
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0034-amba_pl011-Add-cts-event-workaround-DT-property.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0034-amba_pl011-Add-cts-event-workaround-DT-property.patch
index 3117df37..f1b9fb4a 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0034-amba_pl011-Add-cts-event-workaround-DT-property.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0034-amba_pl011-Add-cts-event-workaround-DT-property.patch
@@ -1,4 +1,4 @@
-From 2e6001c297a892206226e25d72ed864b4e7740b8 Mon Sep 17 00:00:00 2001
+From 9a5e6c60bb33afb7b5ef0984ce0fcad9e8a500e4 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Fri, 29 Sep 2017 10:32:19 +0100
Subject: [PATCH 034/185] amba_pl011: Add cts-event-workaround DT property
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0035-pinctrl-bcm2835-Set-base-to-0-give-expected-gpio-num.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0035-pinctrl-bcm2835-Set-base-to-0-give-expected-gpio-num.patch
index bf31b3d6..61017578 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0035-pinctrl-bcm2835-Set-base-to-0-give-expected-gpio-num.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0035-pinctrl-bcm2835-Set-base-to-0-give-expected-gpio-num.patch
@@ -1,4 +1,4 @@
-From 2b3dcd43338e2e79381470115a94619c44574d18 Mon Sep 17 00:00:00 2001
+From 6b63db22d3e56d6656f6a2bdcfde39cede7f5a0e Mon Sep 17 00:00:00 2001
From: notro <notro@tronnes.org>
Date: Thu, 10 Jul 2014 13:59:47 +0200
Subject: [PATCH 035/185] pinctrl-bcm2835: Set base to 0 give expected gpio
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0036-Main-bcm2708-bcm2709-linux-port.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0036-Main-bcm2708-bcm2709-linux-port.patch
index b98da3b6..7a93773b 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0036-Main-bcm2708-bcm2709-linux-port.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0036-Main-bcm2708-bcm2709-linux-port.patch
@@ -1,4 +1,4 @@
-From 5d5d8dcfe41978b13cdbbb810ef768838acd4481 Mon Sep 17 00:00:00 2001
+From 1fd65d6d666771d749db81ef0fde8792723ca9bb Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Sun, 12 May 2013 12:24:19 +0100
Subject: [PATCH 036/185] Main bcm2708/bcm2709 linux port
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0037-Add-dwc_otg-driver.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0037-Add-dwc_otg-driver.patch
index fd749714..a33ae11e 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0037-Add-dwc_otg-driver.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0037-Add-dwc_otg-driver.patch
@@ -1,4 +1,4 @@
-From 15a65afb365f4d0510736e37a591541a775d00ad Mon Sep 17 00:00:00 2001
+From 45df369ca0eaad287b4cebc16c2c91bd63321490 Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Wed, 1 May 2013 19:46:17 +0100
Subject: [PATCH 037/185] Add dwc_otg driver
@@ -43386,7 +43386,7 @@ index 000000000000..fb57db09378f
+#endif /* DWC_DEVICE_ONLY */
diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c
new file mode 100644
-index 000000000000..082159b64b34
+index 000000000000..c9fb1e4b67e4
--- /dev/null
+++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c
@@ -0,0 +1,2752 @@
@@ -46027,7 +46027,7 @@ index 000000000000..082159b64b34
+ break;
+
+ default:
-+ DWC_WARN("Unexpected state received on hc=%d fsm=%d on transfer to device %d ep 0x%x",
++ DWC_WARN("Unexpected state received on hc=%d fsm=%d on transfer to device %d ep 0x%x",
+ hc->hc_num, st->fsm, hc->dev_addr, hc->ep_num);
+ qtd->error_count++;
+ release_channel(hcd, hc, qtd, DWC_OTG_HC_XFER_NO_HALT_STATUS);
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0038-bcm2708-framebuffer-driver.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0038-bcm2708-framebuffer-driver.patch
index 723547c5..21e5ba24 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0038-bcm2708-framebuffer-driver.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0038-bcm2708-framebuffer-driver.patch
@@ -1,4 +1,4 @@
-From d0bf78410278f4a9953ae8f229fb852bb310342f Mon Sep 17 00:00:00 2001
+From cf8e767d5b94663f1344af58ce296a571721afec Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Wed, 17 Jun 2015 17:06:34 +0100
Subject: [PATCH 038/185] bcm2708 framebuffer driver
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0039-fbdev-add-FBIOCOPYAREA-ioctl.patch b/ b/sys-kernel/boest-v5.1.1/raspberrypi/0039-fbdev-add-FBIOCOPYAREA-ioctl.patch
index ea00262e..6ab155b6 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0039-fbdev-add-FBIOCOPYAREA-ioctl.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0039-fbdev-add-FBIOCOPYAREA-ioctl.patch
@@ -1,4 +1,4 @@
-From 0811b549bc4f0a4ccb9dddbf26468fae3ead6420 Mon Sep 17 00:00:00 2001
+From 207b57f326e8735741b106edf3b99bda7c214f26 Mon Sep 17 00:00:00 2001
From: Siarhei Siamashka <siarhei.siamashka@gmail.com>
Date: Mon, 17 Jun 2013 13:32:11 +0300
Subject: [PATCH 039/185] fbdev: add FBIOCOPYAREA ioctl
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0040-Speed-up-console-framebuffer-imageblit-function.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0040-Speed-up-console-framebuffer-imageblit-function.patch
index 825f99fb..8f8e8171 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0040-Speed-up-console-framebuffer-imageblit-function.patch
+++ b/'>sys-kernel/boest-v5.1.1/raspberrypi/0040-Speed-up-console-framebuffer-imageblit-function.patch
@@ -1,4 +1,4 @@
-From 3f59bd7ca11415f90379f8b232ccbac5d1cbcafb Mon Sep 17 00:00:00 2001
+From 84d656b287704a070aea3bda50dd9ae8a55d6c65 Mon Sep 17 00:00:00 2001
From: Harm Hanemaaijer <fgenfb@yahoo.com>
Date: Thu, 20 Jun 2013 20:21:39 +0200
Subject: [PATCH 040/185] Speed up console framebuffer imageblit function
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0041-dmaengine-Add-support-for-BCM2708.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0041-dmaengine-Add-support-for-BCM2708.patch
index ca04d4cb..0900ae68 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0041-dmaengine-Add-support-for-BCM2708.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0041-dmaengine-Add-support-for-BCM2708.patch
@@ -1,4 +1,4 @@
-From 25b784c4c3443928945b163cddc501f7732e8efc Mon Sep 17 00:00:00 2001
+From 0bdb97ff5a288e60fec6fffdb7cee093b79e191c Mon Sep 17 00:00:00 2001
From: Florian Meier <florian.meier@koalo.de>
Date: Fri, 22 Nov 2013 14:22:53 +0100
Subject: [PATCH 041/185] dmaengine: Add support for BCM2708
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0042-MMC-added-alternative-MMC-driver.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0042-MMC-added-alternative-MMC-driver.patch
index 7c902190..02c5e20d 100644
--- a/'>sys-kernel/boest-v5.1.1/raspberrypi/0042-MMC-added-alternative-MMC-driver.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0042-MMC-added-alternative-MMC-driver.patch
@@ -1,4 +1,4 @@
-From eb785a549d81da2f46b5f03146e324eb8e275602 Mon Sep 17 00:00:00 2001
+From 5b1e4082aac1560ac646118e1aef8f1d3a5855e1 Mon Sep 17 00:00:00 2001
From: gellert <gellert@raspberrypi.org>
Date: Fri, 15 Aug 2014 16:35:06 +0100
Subject: [PATCH 042/185] MMC: added alternative MMC driver
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0043-Adding-bcm2835-sdhost-driver-and-an-overlay-to-enabl.patch b/ b/sys-kernel/boest-v5.1.1/raspberrypi/0043-Adding-bcm2835-sdhost-driver-and-an-overlay-to-enabl.patch
index 1ba6a007..7f952fc9 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0043-Adding-bcm2835-sdhost-driver-and-an-overlay-to-enabl.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0043-Adding-bcm2835-sdhost-driver-and-an-overlay-to-enabl.patch
@@ -1,4 +1,4 @@
-From 8117240f011fafc2b8b0354bba9b2a8375db55c3 Mon Sep 17 00:00:00 2001
+From 4c9e56a8c327efd2c5a5208a5d91eb5937849b4e Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Wed, 25 Mar 2015 17:49:47 +0000
Subject: [PATCH 043/185] Adding bcm2835-sdhost driver, and an overlay to
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0044-vc_mem-Add-vc_mem-driver-for-querying-firmware-memor.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0044-vc_mem-Add-vc_mem-driver-for-querying-firmware-memor.patch
index 3fde8fb1..7c9c9fff 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0044-vc_mem-Add-vc_mem-driver-for-querying-firmware-memor.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0044-vc_mem-Add-vc_mem-driver-for-querying-firmware-memor.patch
@@ -1,4 +1,4 @@
-From 1d9551ea8c5b1bc4b34616280d07bbd868be2b48 Mon Sep 17 00:00:00 2001
+From a4cff129b527877a86174bd3cbec6486e46dc4c9 Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Fri, 28 Oct 2016 15:36:43 +0100
Subject: [PATCH 044/185] vc_mem: Add vc_mem driver for querying firmware
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0045-vcsm-VideoCore-shared-memory-service-for-BCM2835.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0045-vcsm-VideoCore-shared-memory-service-for-BCM2835.patch
index 52729274..0caa949c 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0045-vcsm-VideoCore-shared-memory-service-for-BCM2835.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0045-vcsm-VideoCore-shared-memory-service-for-BCM2835.patch
@@ -1,4 +1,4 @@
-From e69f92f2f133b4fdd06495dcb5adbba82d81e0e9 Mon Sep 17 00:00:00 2001
+From a01d7eb32adcb0c9473fac5f72214c7c7182e0ba Mon Sep 17 00:00:00 2001
From: Tim Gover <tgover@broadcom.com>
Date: Tue, 22 Jul 2014 15:41:04 +0100
Subject: [PATCH 045/185] vcsm: VideoCore shared memory service for BCM2835
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0046-Add-dev-gpiomem-device-for-rootless-user-GPIO-access.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0046-Add-dev-gpiomem-device-for-rootless-user-GPIO-access.patch
index 7876ddf0..f45fa489 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0046-Add-dev-gpiomem-device-for-rootless-user-GPIO-access.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0046-Add-dev-gpiomem-device-for-rootless-user-GPIO-access.patch
@@ -1,4 +1,4 @@
-From 1db72caf4fd92200071474a255f471d16fa49c69 Mon Sep 17 00:00:00 2001
+From 116ad4dc64ff88aad96f136700320f13fdf1b763 Mon Sep 17 00:00:00 2001
From: Luke Wren <luke@raspberrypi.org>
Date: Fri, 21 Aug 2015 23:14:48 +0100
Subject: [PATCH 046/185] Add /dev/gpiomem device for rootless user GPIO access
@@ -11,16 +11,16 @@ Build on ARCH_BCM2835, and fail to probe if no IO resource.
See: https://github.com/raspberrypi/linux/issues/1154
---
- drivers/char/broadcom/Kconfig | 9 +
- drivers/char/broadcom/Makefile | 3 +
+ drivers/char/broadcom/Kconfig | 8 +
+ drivers/char/broadcom/Makefile | 2 +
drivers/char/broadcom/bcm2835-gpiomem.c | 258 ++++++++++++++++++++++++
- 3 files changed, 270 insertions(+)
+ 3 files changed, 268 insertions(+)
diff --git a/drivers/char/broadcom/Kconfig b/drivers/char/broadcom/Kconfig
-index 2b6132d12b13..235704f2d916 100644
+index 2b6132d12b13..428a19f26fcb 100644
--- a/drivers/char/broadcom/Kconfig
+++ b/drivers/char/broadcom/Kconfig
-@@ -26,3 +26,12 @@ config BCM_VC_SM
+@@ -26,3 +26,11 @@ config BCM_VC_SM
help
Support for the VC shared memory on the Broadcom reference
design. Uses the VCHIQ stack.
@@ -32,17 +32,15 @@ index 2b6132d12b13..235704f2d916 100644
+ Provides users with root-free access to the GPIO registers
+ on the 2835. Calling mmap(/dev/gpiomem) will map the GPIO
+ register page to the user's pointer.
-+
diff --git a/drivers/char/broadcom/Makefile b/drivers/char/broadcom/Makefile
-index 419af4180deb..187a0b02f189 100644
+index 419af4180deb..788cb1304c6c 100644
--- a/drivers/char/broadcom/Makefile
+++ b/drivers/char/broadcom/Makefile
-@@ -1,2 +1,5 @@
+@@ -1,2 +1,4 @@
obj-$(CONFIG_BCM2708_VCMEM) += vc_mem.o
obj-$(CONFIG_BCM_VC_SM) += vc_sm/
+
+obj-$(CONFIG_BCM2835_DEVGPIOMEM)+= bcm2835-gpiomem.o
-+
diff --git a/drivers/char/broadcom/bcm2835-gpiomem.c b/drivers/char/broadcom/bcm2835-gpiomem.c
new file mode 100644
index 000000000000..f5e7f1ba8fb6
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0047-Add-SMI-driver.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0047-Add-SMI-driver.patch
index fec6893f..500a3962 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0047-Add-SMI-driver.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0047-Add-SMI-driver.patch
@@ -1,27 +1,27 @@
-From 99d52b123a6ca7ba56108f27bee35699c45dfa3c Mon Sep 17 00:00:00 2001
+From db16a8620880253c533a2a6bad168e8a3a9dda4b Mon Sep 17 00:00:00 2001
From: Luke Wren <wren6991@gmail.com>
Date: Sat, 5 Sep 2015 01:14:45 +0100
Subject: [PATCH 047/185] Add SMI driver
Signed-off-by: Luke Wren <wren6991@gmail.com>
---
- .../bindings/misc/brcm,bcm2835-smi-dev.txt | 17 +
- .../bindings/misc/brcm,bcm2835-smi.txt | 48 +
- drivers/char/broadcom/Kconfig | 8 +
- drivers/char/broadcom/Makefile | 2 +-
+ .../bindings/misc/brcm,bcm2835-smi-dev.txt | 15 +
+ .../bindings/misc/brcm,bcm2835-smi.txt | 47 +
+ drivers/char/broadcom/Kconfig | 9 +
+ drivers/char/broadcom/Makefile | 1 +
drivers/char/broadcom/bcm2835_smi_dev.c | 402 +++++++
drivers/misc/Kconfig | 8 +
drivers/misc/Makefile | 1 +
drivers/misc/bcm2835_smi.c | 985 ++++++++++++++++++
include/linux/broadcom/bcm2835_smi.h | 391 +++++++
- 9 files changed, 1861 insertions(+), 1 deletion(-)
+ 9 files changed, 1859 insertions(+)
diff --git a/Documentation/devicetree/bindings/misc/brcm,bcm2835-smi-dev.txt b/Documentation/devicetree/bindings/misc/brcm,bcm2835-smi-dev.txt
new file mode 100644
-index 000000000000..68cc8ebc3392
+index 000000000000..1347fdf5da93
--- /dev/null
+++ b/Documentation/devicetree/bindings/misc/brcm,bcm2835-smi-dev.txt
-@@ -0,0 +1,17 @@
+@@ -0,0 +1,15 @@
+* Broadcom BCM2835 SMI character device driver.
+
+SMI or secondary memory interface is a peripheral specific to certain Broadcom
@@ -37,14 +37,12 @@ index 000000000000..68cc8ebc3392
+
+Optional properties:
+- None.
-+
-+
diff --git a/Documentation/devicetree/bindings/misc/brcm,bcm2835-smi.txt b/Documentation/devicetree/bindings/misc/brcm,bcm2835-smi.txt
new file mode 100644
-index 000000000000..b76dc694f1ac
+index 000000000000..b2345aa9b8b3
--- /dev/null
+++ b/Documentation/devicetree/bindings/misc/brcm,bcm2835-smi.txt
-@@ -0,0 +1,48 @@
+@@ -0,0 +1,47 @@
+* Broadcom BCM2835 SMI driver.
+
+SMI or secondary memory interface is a peripheral specific to certain Broadcom
@@ -92,15 +90,15 @@ index 000000000000..b76dc694f1ac
+ generally active low signals */
+ brcm,pull = <2 2 2 2 2 2 0 0 0 0 0 0 0 0>;
+};
-+
diff --git a/drivers/char/broadcom/Kconfig b/drivers/char/broadcom/Kconfig
-index 235704f2d916..4ef0d7af2bc7 100644
+index 428a19f26fcb..4ef0d7af2bc7 100644
--- a/drivers/char/broadcom/Kconfig
+++ b/drivers/char/broadcom/Kconfig
-@@ -35,3 +35,11 @@ config BCM2835_DEVGPIOMEM
+@@ -34,3 +34,12 @@ config BCM2835_DEVGPIOMEM
+ Provides users with root-free access to the GPIO registers
on the 2835. Calling mmap(/dev/gpiomem) will map the GPIO
register page to the user's pointer.
-
++
+config BCM2835_SMI_DEV
+ tristate "Character device driver for BCM2835 Secondary Memory Interface"
+ depends on BCM2835_SMI
@@ -110,14 +108,13 @@ index 235704f2d916..4ef0d7af2bc7 100644
+ Broadcom's Secondary Memory interface. The low-level functionality is provided
+ by the SMI driver itself.
diff --git a/drivers/char/broadcom/Makefile b/drivers/char/broadcom/Makefile
-index 187a0b02f189..d0ad04f8e498 100644
+index 788cb1304c6c..d0ad04f8e498 100644
--- a/drivers/char/broadcom/Makefile
+++ b/drivers/char/broadcom/Makefile
-@@ -2,4 +2,4 @@ obj-$(CONFIG_BCM2708_VCMEM) += vc_mem.o
+@@ -2,3 +2,4 @@ obj-$(CONFIG_BCM2708_VCMEM) += vc_mem.o
obj-$(CONFIG_BCM_VC_SM) += vc_sm/
obj-$(CONFIG_BCM2835_DEVGPIOMEM)+= bcm2835-gpiomem.o
--
+obj-$(CONFIG_BCM2835_SMI_DEV) += bcm2835_smi_dev.o
diff --git a/drivers/char/broadcom/bcm2835_smi_dev.c b/drivers/char/broadcom/bcm2835_smi_dev.c
new file mode 100644
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0048-MISC-bcm2835-smi-use-clock-manager-and-fix-reload-is.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0048-MISC-bcm2835-smi-use-clock-manager-and-fix-reload-is.patch
index 81ba750b..87abd1a5 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0048-MISC-bcm2835-smi-use-clock-manager-and-fix-reload-is.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0048-MISC-bcm2835-smi-use-clock-manager-and-fix-reload-is.patch
@@ -1,4 +1,4 @@
-From c02f05e3618d8dbae4dbab2dfdfc1e17406b753e Mon Sep 17 00:00:00 2001
+From 633e0ecdcb4f978feb325137585338e375098c5f Mon Sep 17 00:00:00 2001
From: Martin Sperl <kernel@martin.sperl.org>
Date: Tue, 26 Apr 2016 14:59:21 +0000
Subject: [PATCH 048/185] MISC: bcm2835: smi: use clock manager and fix reload
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0049-Add-SMI-NAND-driver.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0049-Add-SMI-NAND-driver.patch
index e582735b..4e60f252 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0049-Add-SMI-NAND-driver.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0049-Add-SMI-NAND-driver.patch
@@ -1,4 +1,4 @@
-From b8241a7e5196db8a7615e95f128389969cb28d57 Mon Sep 17 00:00:00 2001
+From 5a2ff1ea7a28ba94bc13af9579e8c08e7f2e1a73 Mon Sep 17 00:00:00 2001
From: Luke Wren <wren6991@gmail.com>
Date: Sat, 5 Sep 2015 01:16:10 +0100
Subject: [PATCH 049/185] Add SMI NAND driver
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0050-Revert-Add-SMI-NAND-driver.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0050-Revert-Add-SMI-NAND-driver.patch
index 08a9f326..3367d196 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0050-Revert-Add-SMI-NAND-driver.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0050-Revert-Add-SMI-NAND-driver.patch
@@ -1,4 +1,4 @@
-From 60c1de7b499247b33c0622132d9b7ddf7a0c9fbb Mon Sep 17 00:00:00 2001
+From 6439f843af8762781dbeca2f9b60cc7294fd87e2 Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Mon, 12 Nov 2018 15:57:17 +0000
Subject: [PATCH 050/185] Revert "Add SMI NAND driver"
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0051-Add-cpufreq-driver.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0051-Add-cpufreq-driver.patch
index 09541e8f..51951d2a 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0051-Add-cpufreq-driver.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0051-Add-cpufreq-driver.patch
@@ -1,4 +1,4 @@
-From bc04d8365364517a8061996c028d4010fb68b6ff Mon Sep 17 00:00:00 2001
+From b896dc3877c4f66ddab3b675e9f0db9fd2017ad4 Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Wed, 3 Jul 2013 00:49:20 +0100
Subject: [PATCH 051/185] Add cpufreq driver
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0052-Add-Chris-Boot-s-i2c-driver.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0052-Add-Chris-Boot-s-i2c-driver.patch
index 873361d0..b2df7a52 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0052-Add-Chris-Boot-s-i2c-driver.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0052-Add-Chris-Boot-s-i2c-driver.patch
@@ -1,4 +1,4 @@
-From aab7d579bdf4242013b2305407caec61316268f4 Mon Sep 17 00:00:00 2001
+From 67f6e397edb9673b610685b059288492c5d08098 Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Wed, 17 Jun 2015 15:44:08 +0100
Subject: [PATCH 052/185] Add Chris Boot's i2c driver
@@ -148,7 +148,7 @@ index 5f0cb6915969..336431114a52 100644
diff --git a/drivers/i2c/busses/i2c-bcm2708.c b/drivers/i2c/busses/i2c-bcm2708.c
new file mode 100644
-index 000000000000..962f2e5c7455
+index 000000000000..837b0425fa82
--- /dev/null
+++ b/drivers/i2c/busses/i2c-bcm2708.c
@@ -0,0 +1,512 @@
@@ -588,7 +588,7 @@ index 000000000000..962f2e5c7455
+ clk_tout = 35/1000*baud; //35ms timeout as per SMBus specs.
+ if (clk_tout > 0xffff)
+ clk_tout = 0xffff;
-+
++
+ bi->cdiv = cdiv;
+ bi->clk_tout = clk_tout;
+
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0053-char-broadcom-Add-vcio-module.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0053-char-broadcom-Add-vcio-module.patch
index 196c6567..55532516 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0053-char-broadcom-Add-vcio-module.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0053-char-broadcom-Add-vcio-module.patch
@@ -1,4 +1,4 @@
-From fe2d2f91bed3da23c2d08797dc06a46221f460e1 Mon Sep 17 00:00:00 2001
+From d4f847d51019a6b3271b07b5d0d57bcc4b79a395 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf@tronnes.org>
Date: Fri, 26 Jun 2015 14:27:06 +0200
Subject: [PATCH 053/185] char: broadcom: Add vcio module
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0054-firmware-bcm2835-Support-ARCH_BCM270x.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0054-firmware-bcm2835-Support-ARCH_BCM270x.patch
index b19a4a17..4484cc10 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0054-firmware-bcm2835-Support-ARCH_BCM270x.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0054-firmware-bcm2835-Support-ARCH_BCM270x.patch
@@ -1,4 +1,4 @@
-From c518023348f9963302df98a409f72885c1c3db77 Mon Sep 17 00:00:00 2001
+From bb129fe5a9bcf1c44c7c26de388e753c0bcafbd2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf@tronnes.org>
Date: Fri, 26 Jun 2015 14:25:01 +0200
Subject: [PATCH 054/185] firmware: bcm2835: Support ARCH_BCM270x
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0055-scripts-Add-mkknlimg-and-knlinfo-scripts-from-tools-.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0055-scripts-Add-mkknlimg-and-knlinfo-scripts-from-tools-.patch
index 36b13d55..6d24cdaa 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0055-scripts-Add-mkknlimg-and-knlinfo-scripts-from-tools-.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0055-scripts-Add-mkknlimg-and-knlinfo-scripts-from-tools-.patch
@@ -1,4 +1,4 @@
-From 5180fd279684680768a2531e21a38c24bcc6e9b7 Mon Sep 17 00:00:00 2001
+From 5aae821c6116c0184c5a865235a1e2fb2d4359fe Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Mon, 11 May 2015 09:00:42 +0100
Subject: [PATCH 055/185] scripts: Add mkknlimg and knlinfo scripts from tools
@@ -92,7 +92,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
diff --git a/scripts/knlinfo b/scripts/knlinfo
new file mode 100755
-index 000000000000..263ec937eaa7
+index 000000000000..903cd6a244a8
--- /dev/null
+++ b/scripts/knlinfo
@@ -0,0 +1,171 @@
@@ -223,7 +223,7 @@ index 000000000000..263ec937eaa7
+ push @$atoms, [ $atom_type, $atom_data ];
+ }
+
-+ if (($$atoms[-1][0] eq "\x00\x00\x00\x00") &&
++ if (($$atoms[-1][0] eq "\x00\x00\x00\x00") &&
+ ($$atoms[-1][1] eq ""))
+ {
+ pop @$atoms;
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0056-BCM2708-Add-core-Device-Tree-support.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0056-BCM2708-Add-core-Device-Tree-support.patch
index c7cb6921..c13a31ab 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0056-BCM2708-Add-core-Device-Tree-support.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0056-BCM2708-Add-core-Device-Tree-support.patch
@@ -1,4 +1,4 @@
-From 03f9edfa76466bc3171a09744e0d9359ad12abf6 Mon Sep 17 00:00:00 2001
+From a014bc9c47a0bef05dac3d1a44a59182da525e2b Mon Sep 17 00:00:00 2001
From: notro <notro@tronnes.org>
Date: Wed, 9 Jul 2014 14:46:08 +0200
Subject: [PATCH 056/185] BCM2708: Add core Device Tree support
@@ -236,7 +236,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
.../overlays/akkordion-iqdacplus-overlay.dts | 49 +
.../allo-boss-dac-pcm512x-audio-overlay.dts | 59 +
.../dts/overlays/allo-digione-overlay.dts | 44 +
- .../allo-katana-dac-audio-overlay.dts | 57 +
+ .../allo-katana-dac-audio-overlay.dts | 56 +
.../allo-piano-dac-pcm512x-audio-overlay.dts | 54 +
...o-piano-dac-plus-pcm512x-audio-overlay.dts | 55 +
.../boot/dts/overlays/applepi-dac-overlay.dts | 57 +
@@ -295,19 +295,19 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
.../boot/dts/overlays/iqaudio-dac-overlay.dts | 46 +
.../dts/overlays/iqaudio-dacplus-overlay.dts | 49 +
.../iqaudio-digi-wm8804-audio-overlay.dts | 47 +
- .../dts/overlays/jedec-spi-nor-overlay.dts | 309 +++
+ .../dts/overlays/jedec-spi-nor-overlay.dts | 308 +++
.../dts/overlays/justboom-dac-overlay.dts | 46 +
.../dts/overlays/justboom-digi-overlay.dts | 41 +
.../arm/boot/dts/overlays/ltc294x-overlay.dts | 86 +
.../boot/dts/overlays/max98357a-overlay.dts | 84 +
.../boot/dts/overlays/mbed-dac-overlay.dts | 64 +
- .../boot/dts/overlays/mcp23017-overlay.dts | 62 +
- .../boot/dts/overlays/mcp23s17-overlay.dts | 732 ++++++
+ .../boot/dts/overlays/mcp23017-overlay.dts | 61 +
+ .../boot/dts/overlays/mcp23s17-overlay.dts | 731 ++++++
.../dts/overlays/mcp2515-can0-overlay.dts | 73 +
.../dts/overlays/mcp2515-can1-overlay.dts | 73 +
.../arm/boot/dts/overlays/mcp3008-overlay.dts | 205 ++
.../arm/boot/dts/overlays/mcp3202-overlay.dts | 205 ++
- .../arm/boot/dts/overlays/mcp342x-overlay.dts | 93 +
+ .../arm/boot/dts/overlays/mcp342x-overlay.dts | 92 +
.../dts/overlays/media-center-overlay.dts | 134 +
.../boot/dts/overlays/midi-uart0-overlay.dts | 36 +
.../boot/dts/overlays/midi-uart1-overlay.dts | 43 +
@@ -321,7 +321,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
.../dts/overlays/pi3-miniuart-bt-overlay.dts | 74 +
arch/arm/boot/dts/overlays/pibell-overlay.dts | 81 +
.../boot/dts/overlays/piscreen-overlay.dts | 102 +
- .../boot/dts/overlays/piscreen2r-overlay.dts | 106 +
+ .../boot/dts/overlays/piscreen2r-overlay.dts | 105 +
.../arm/boot/dts/overlays/pisound-overlay.dts | 120 +
.../arm/boot/dts/overlays/pitft22-overlay.dts | 69 +
.../overlays/pitft28-capacitive-overlay.dts | 91 +
@@ -365,13 +365,13 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
.../boot/dts/overlays/spi2-3cs-overlay.dts | 81 +
.../arm/boot/dts/overlays/ssd1306-overlay.dts | 36 +
.../dts/overlays/superaudioboard-overlay.dts | 73 +
- arch/arm/boot/dts/overlays/sx150x-overlay.dts | 1706 +++++++++++++
+ arch/arm/boot/dts/overlays/sx150x-overlay.dts | 1705 +++++++++++++
.../boot/dts/overlays/tinylcd35-overlay.dts | 222 ++
.../boot/dts/overlays/tpm-slb9670-overlay.dts | 44 +
arch/arm/boot/dts/overlays/uart0-overlay.dts | 33 +
arch/arm/boot/dts/overlays/uart1-overlay.dts | 38 +
arch/arm/boot/dts/overlays/udrc-overlay.dts | 128 +
- .../upstream-aux-interrupt-overlay.dts | 33 +
+ .../upstream-aux-interrupt-overlay.dts | 32 +
.../boot/dts/overlays/upstream-overlay.dts | 160 ++
.../dts/overlays/vc4-fkms-v3d-overlay.dts | 89 +
.../overlays/vc4-kms-kippah-7inch-overlay.dts | 43 +
@@ -382,7 +382,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
.../arm/boot/dts/overlays/wittypi-overlay.dts | 44 +
scripts/Makefile.dtbinst | 8 +-
scripts/Makefile.lib | 13 +
- 176 files changed, 16606 insertions(+), 4 deletions(-)
+ 176 files changed, 16598 insertions(+), 4 deletions(-)
diff --git a/.gitignore b/.gitignore
index a20ac26aa2f5..1e2890d08202 100644
@@ -4546,7 +4546,7 @@ index 000000000000..f9fbf938b062
+http://www.raspberrypi.org/documentation/configuration/device-tree.md
diff --git a/arch/arm/boot/dts/overlays/adau1977-adc-overlay.dts b/arch/arm/boot/dts/overlays/adau1977-adc-overlay.dts
new file mode 100644
-index 000000000000..1aaca71c1b67
+index 000000000000..f8c4f3a0f9fd
--- /dev/null
+++ b/arch/arm/boot/dts/overlays/adau1977-adc-overlay.dts
@@ -0,0 +1,40 @@
@@ -4556,22 +4556,22 @@ index 000000000000..1aaca71c1b67
+ +
+/ {
+ compatible = "brcm,bcm2708";
-+
++
+ fragment@0 {
-+ target = <&i2ci2c>;;
-+
++ target = <&i2c>;;
++
+ __overlay__ {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "okay";
-+
++
+ adau1977: codec@11 {
-+ compatible = "adi,adau1977";
-+ reg = <0x11>;
-+ reset-gpios = <&gpio 5 0>;
++ compatible = "adi,adau1977";
++ reg = <0x11>;
++ reset-gpios = <&gpio 5 0>;
+ AVDD-supply = <&vdd_3v3_reg>;
-+ };
-+ };
++ };
++ };
+ };
+
+ fragment@1 {
@@ -5128,10 +5128,10 @@ index 000000000000..101277a11a24
+};
diff --git a/arch/arm/boot/dts/overlays/allo-katana-dac-audio-overlay.dts b/arch/arm/boot/dts/overlays/allo-katana-dac-audio-overlay.dts
new file mode 100644
-index 000000000000..6dc4acf1f80c
+index 000000000000..b464fbd2989e
--- /dev/null
+++ b/arch/arm/boot/dts/overlays/allo-katana-dac-audio-overlay.dts
-@@ -0,0 +1,57 @@
+@@ -0,0 +1,56 @@
+/*
+ * Definitions for Allo Katana DAC boards
+ */
@@ -5188,7 +5188,6 @@ index 000000000000..6dc4acf1f80c
+ };
+ };
+};
-+
diff --git a/arch/arm/boot/dts/overlays/allo-piano-dac-pcm512x-audio-overlay.dts b/arch/arm/boot/dts/overlays/allo-piano-dac-pcm512x-audio-overlay.dts
new file mode 100644
index 000000000000..a5468d850a91
@@ -6724,13 +6723,13 @@ index 000000000000..9a9e9a0ca28c
+};
diff --git a/arch/arm/boot/dts/overlays/gpio-fan-overlay.dts b/arch/arm/boot/dts/overlays/gpio-fan-overlay.dts
new file mode 100644
-index 000000000000..d9b8b87d9c12
+index 000000000000..ede2b0dc933b
--- /dev/null
+++ b/arch/arm/boot/dts/overlays/gpio-fan-overlay.dts
@@ -0,0 +1,79 @@
+/*
+ * Overlay for the Raspberry Pi GPIO Fan @ BCM GPIO12.
-+ * References:
++ * References:
+ * - https://www.raspberrypi.org/forums/viewtopic.php?f=107&p=1367135#p1365084
+ *
+ * Optional parameters:
@@ -9029,7 +9028,7 @@ index 000000000000..30c356d6070c
+};
diff --git a/arch/arm/boot/dts/overlays/ilitek251x-overlay.dts b/arch/arm/boot/dts/overlays/ilitek251x-overlay.dts
new file mode 100644
-index 000000000000..fb1ccc314a29
+index 000000000000..177e97439911
--- /dev/null
+++ b/arch/arm/boot/dts/overlays/ilitek251x-overlay.dts
@@ -0,0 +1,45 @@
@@ -9040,9 +9039,9 @@ index 000000000000..fb1ccc314a29
+ / {
+ compatible = "brcm,bcm2708";
+
-+ fragment@0 {
++ fragment@0 {
+ target = <&gpio>;
-+ __overlay__ {
++ __overlay__ {
+ ili251x_pins: ili251x_pins {
+ brcm,pins = <4>; // interrupt
+ brcm,function = <0>; // in
@@ -9051,14 +9050,14 @@ index 000000000000..fb1ccc314a29
+ };
+ };
+
-+ fragment@1 {
++ fragment@1 {
+ target = <&i2c1>;
+ __overlay__ {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "okay";
+
-+ ili251x: ili251x@41 {
++ ili251x: ili251x@41 {
+ compatible = "ilitek,ili251x";
+ reg = <0x41>;
+ pinctrl-names = "default";
@@ -9071,7 +9070,7 @@ index 000000000000..fb1ccc314a29
+ };
+ };
+
-+ __overrides__ {
++ __overrides__ {
+ interrupt = <&ili251x_pins>,"brcm,pins:0",
+ <&ili251x>,"interrupts:0";
+ sizex = <&ili251x>,"touchscreen-size-x:0";
@@ -9240,10 +9239,10 @@ index 000000000000..b86e1e5edc89
+};
diff --git a/arch/arm/boot/dts/overlays/jedec-spi-nor-overlay.dts b/arch/arm/boot/dts/overlays/jedec-spi-nor-overlay.dts
new file mode 100644
-index 000000000000..279e22efc013
+index 000000000000..3ff0041929c9
--- /dev/null
+++ b/arch/arm/boot/dts/overlays/jedec-spi-nor-overlay.dts
-@@ -0,0 +1,309 @@
+@@ -0,0 +1,308 @@
+// Overlay for JEDEC SPI-NOR Flash Devices (aka m25p80)
+
+// dtparams:
@@ -9552,7 +9551,6 @@ index 000000000000..279e22efc013
+ flash-fastr-spi2-2 = <0>,"+7+15+23";
+ };
+};
-+
diff --git a/arch/arm/boot/dts/overlays/justboom-dac-overlay.dts b/arch/arm/boot/dts/overlays/justboom-dac-overlay.dts
new file mode 100644
index 000000000000..2b8dba0c231b
@@ -9654,7 +9652,7 @@ index 000000000000..1212e3ff591b
+};
diff --git a/arch/arm/boot/dts/overlays/ltc294x-overlay.dts b/arch/arm/boot/dts/overlays/ltc294x-overlay.dts
new file mode 100644
-index 000000000000..6d971f3649ca
+index 000000000000..04903802867b
--- /dev/null
+++ b/arch/arm/boot/dts/overlays/ltc294x-overlay.dts
@@ -0,0 +1,86 @@
@@ -9676,7 +9674,7 @@ index 000000000000..6d971f3649ca
+ compatible = "lltc,ltc2941";
+ reg = <0x64>;
+ lltc,resistor-sense = <50>;
-+ lltc,prescaler-exponent = <7>;
++ lltc,prescaler-exponent = <7>;
+ };
+ };
+ };
@@ -9692,7 +9690,7 @@ index 000000000000..6d971f3649ca
+ compatible = "lltc,ltc2942";
+ reg = <0x64>;
+ lltc,resistor-sense = <50>;
-+ lltc,prescaler-exponent = <7>;
++ lltc,prescaler-exponent = <7>;
+ };
+ };
+ };
@@ -9708,7 +9706,7 @@ index 000000000000..6d971f3649ca
+ compatible = "lltc,ltc2943";
+ reg = <0x64>;
+ lltc,resistor-sense = <50>;
-+ lltc,prescaler-exponent = <7>;
++ lltc,prescaler-exponent = <7>;
+ };
+ };
+ };
@@ -9724,7 +9722,7 @@ index 000000000000..6d971f3649ca
+ compatible = "lltc,ltc2944";
+ reg = <0x64>;
+ lltc,resistor-sense = <50>;
-+ lltc,prescaler-exponent = <7>;
++ lltc,prescaler-exponent = <7>;
+ };
+ };
+ };
@@ -9906,10 +9904,10 @@ index 000000000000..313563d6ed47
+};
diff --git a/arch/arm/boot/dts/overlays/mcp23017-overlay.dts b/arch/arm/boot/dts/overlays/mcp23017-overlay.dts
new file mode 100644
-index 000000000000..42f2d0f4ea66
+index 000000000000..f9e2a01784b2
--- /dev/null
+++ b/arch/arm/boot/dts/overlays/mcp23017-overlay.dts
-@@ -0,0 +1,62 @@
+@@ -0,0 +1,61 @@
+// Definitions for MCP23017 Gpio Extender from Microchip Semiconductor
+
+/dts-v1/;
@@ -9971,13 +9969,12 @@ index 000000000000..42f2d0f4ea66
+ mcp23008 = <0>,"=3";
+ };
+};
-+
diff --git a/arch/arm/boot/dts/overlays/mcp23s17-overlay.dts b/arch/arm/boot/dts/overlays/mcp23s17-overlay.dts
new file mode 100644
-index 000000000000..7dcbacb3cd00
+index 000000000000..4e719f45663c
--- /dev/null
+++ b/arch/arm/boot/dts/overlays/mcp23s17-overlay.dts
-@@ -0,0 +1,732 @@
+@@ -0,0 +1,731 @@
+// Overlay for MCP23S08/17 GPIO Extenders from Microchip Semiconductor
+
+// dtparams:
@@ -10075,11 +10072,11 @@ index 000000000000..7dcbacb3cd00
+ #size-cells = <0>;
+ mcp23s08_00: mcp23s08@0 {
+ compatible = "microchip,mcp23s08";
-+ gpio-controller;
-+ #gpio-cells = <2>;
-+ microchip,spi-present-mask = <0x00>; /* overwritten by mcp23s08-spi0-0-present parameter */
-+ reg = <0>;
-+ spi-max-frequency = <500000>;
++ gpio-controller;
++ #gpio-cells = <2>;
++ microchip,spi-present-mask = <0x00>; /* overwritten by mcp23s08-spi0-0-present parameter */
++ reg = <0>;
++ spi-max-frequency = <500000>;
+ status = "okay";
+ #interrupt-cells=<2>;
+ interrupts = <0 2>; /* 1st word overwritten by mcp23s08-spi0-0-int-gpio parameter */
@@ -10096,11 +10093,11 @@ index 000000000000..7dcbacb3cd00
+ #size-cells = <0>;
+ mcp23s08_01: mcp23s08@1 {
+ compatible = "microchip,mcp23s08";
-+ gpio-controller;
-+ #gpio-cells = <2>;
-+ microchip,spi-present-mask = <0x00>; /* overwritten by mcp23s08-spi0-1-present parameter */
-+ reg = <1>;
-+ spi-max-frequency = <500000>;
++ gpio-controller;
++ #gpio-cells = <2>;
++ microchip,spi-present-mask = <0x00>; /* overwritten by mcp23s08-spi0-1-present parameter */
++ reg = <1>;
++ spi-max-frequency = <500000>;
+ status = "okay";
+ #interrupt-cells=<2>;
+ interrupts = <0 2>; /* 1st word overwritten by mcp23s08-spi0-1-int-gpio parameter */
@@ -10117,11 +10114,11 @@ index 000000000000..7dcbacb3cd00
+ #size-cells = <0>;
+ mcp23s08_10: mcp23s08@0 {
+ compatible = "microchip,mcp23s08";
-+ gpio-controller;
-+ #gpio-cells = <2>;
-+ microchip,spi-present-mask = <0x00>; /* overwritten by mcp23s08-spi1-0-present parameter */
-+ reg = <0>;
-+ spi-max-frequency = <500000>;
++ gpio-controller;
++ #gpio-cells = <2>;
++ microchip,spi-present-mask = <0x00>; /* overwritten by mcp23s08-spi1-0-present parameter */
++ reg = <0>;
++ spi-max-frequency = <500000>;
+ status = "okay";
+ #interrupt-cells=<2>;
+ interrupts = <0 2>; /* 1st word overwritten by mcp23s08-spi1-0-int-gpio parameter */
@@ -10138,11 +10135,11 @@ index 000000000000..7dcbacb3cd00
+ #size-cells = <0>;
+ mcp23s08_11: mcp23s08@1 {
+ compatible = "microchip,mcp23s08";
-+ gpio-controller;
-+ #gpio-cells = <2>;
-+ microchip,spi-present-mask = <0x00>; /* overwritten by mcp23s08-spi1-1-present parameter */
-+ reg = <1>;
-+ spi-max-frequency = <500000>;
++ gpio-controller;
++ #gpio-cells = <2>;
++ microchip,spi-present-mask = <0x00>; /* overwritten by mcp23s08-spi1-1-present parameter */
++ reg = <1>;
++ spi-max-frequency = <500000>;
+ status = "okay";
+ #interrupt-cells=<2>;
+ interrupts = <0 2>; /* 1st word overwritten by mcp23s08-spi1-1-int-gpio parameter */
@@ -10159,11 +10156,11 @@ index 000000000000..7dcbacb3cd00
+ #size-cells = <0>;
+ mcp23s08_12: mcp23s08@2 {
+ compatible = "microchip,mcp23s08";
-+ gpio-controller;
-+ #gpio-cells = <2>;
-+ microchip,spi-present-mask = <0x00>; /* overwritten by mcp23s08-spi1-2-present parameter */
-+ reg = <2>;
-+ spi-max-frequency = <500000>;
++ gpio-controller;
++ #gpio-cells = <2>;
++ microchip,spi-present-mask = <0x00>; /* overwritten by mcp23s08-spi1-2-present parameter */
++ reg = <2>;
++ spi-max-frequency = <500000>;
+ status = "okay";
+ #interrupt-cells=<2>;
+ interrupts = <0 2>; /* 1st word overwritten by mcp23s08-spi1-2-int-gpio parameter */
@@ -10180,11 +10177,11 @@ index 000000000000..7dcbacb3cd00
+ #size-cells = <0>;
+ mcp23s08_20: mcp23s08@0 {
+ compatible = "microchip,mcp23s08";
-+ gpio-controller;
-+ #gpio-cells = <2>;
-+ microchip,spi-present-mask = <0x00>; /* overwritten by mcp23s08-spi2-0-present parameter */
-+ reg = <0>;
-+ spi-max-frequency = <500000>;
++ gpio-controller;
++ #gpio-cells = <2>;
++ microchip,spi-present-mask = <0x00>; /* overwritten by mcp23s08-spi2-0-present parameter */
++ reg = <0>;
++ spi-max-frequency = <500000>;
+ status = "okay";
+ #interrupt-cells=<2>;
+ interrupts = <0 2>; /* 1st word overwritten by mcp23s08-spi2-0-int-gpio parameter */
@@ -10201,11 +10198,11 @@ index 000000000000..7dcbacb3cd00
+ #size-cells = <0>;
+ mcp23s08_21: mcp23s08@1 {
+ compatible = "microchip,mcp23s08";
-+ gpio-controller;
-+ #gpio-cells = <2>;
-+ microchip,spi-present-mask = <0x00>; /* overwritten by mcp23s08-spi2-1-present parameter */
-+ reg = <1>;
-+ spi-max-frequency = <500000>;
++ gpio-controller;
++ #gpio-cells = <2>;
++ microchip,spi-present-mask = <0x00>; /* overwritten by mcp23s08-spi2-1-present parameter */
++ reg = <1>;
++ spi-max-frequency = <500000>;
+ status = "okay";
+ #interrupt-cells=<2>;
+ interrupts = <0 2>; /* 1st word overwritten by mcp23s08-spi2-1-int-gpio parameter */
@@ -10222,11 +10219,11 @@ index 000000000000..7dcbacb3cd00
+ #size-cells = <0>;
+ mcp23s08_22: mcp23s08@2 {
+ compatible = "microchip,mcp23s08";
-+ gpio-controller;
-+ #gpio-cells = <2>;
-+ microchip,spi-present-mask = <0x00>; /* overwritten by mcp23s08-spi2-2-present parameter */
-+ reg = <2>;
-+ spi-max-frequency = <500000>;
++ gpio-controller;
++ #gpio-cells = <2>;
++ microchip,spi-present-mask = <0x00>; /* overwritten by mcp23s08-spi2-2-present parameter */
++ reg = <2>;
++ spi-max-frequency = <500000>;
+ status = "okay";
+ #interrupt-cells=<2>;
+ interrupts = <0 2>; /* 1st word overwritten by mcp23s08-spi2-2-int-gpio parameter */
@@ -10243,11 +10240,11 @@ index 000000000000..7dcbacb3cd00
+ #size-cells = <0>;
+ mcp23s17_00: mcp23s17@0 {
+ compatible = "microchip,mcp23s17";
-+ gpio-controller;
-+ #gpio-cells = <2>;
-+ microchip,spi-present-mask = <0x00>; /* overwritten by mcp23s17-spi0-0-present parameter */
-+ reg = <0>;
-+ spi-max-frequency = <500000>;
++ gpio-controller;
++ #gpio-cells = <2>;
++ microchip,spi-present-mask = <0x00>; /* overwritten by mcp23s17-spi0-0-present parameter */
++ reg = <0>;
++ spi-max-frequency = <500000>;
+ status = "okay";
+ #interrupt-cells=<2>;
+ interrupts = <0 2>; /* 1st word overwritten by mcp23s17-spi0-0-int-gpio parameter */
@@ -10264,11 +10261,11 @@ index 000000000000..7dcbacb3cd00
+ #size-cells = <0>;
+ mcp23s17_01: mcp23s17@1 {
+ compatible = "microchip,mcp23s17";
-+ gpio-controller;
-+ #gpio-cells = <2>;
-+ microchip,spi-present-mask = <0x00>; /* overwritten by mcp23s17-spi0-1-present parameter */
-+ reg = <1>;
-+ spi-max-frequency = <500000>;
++ gpio-controller;
++ #gpio-cells = <2>;
++ microchip,spi-present-mask = <0x00>; /* overwritten by mcp23s17-spi0-1-present parameter */
++ reg = <1>;
++ spi-max-frequency = <500000>;
+ status = "okay";
+ #interrupt-cells=<2>;
+ interrupts = <0 2>; /* 1st word overwritten by mcp23s17-spi0-1-int-gpio parameter */
@@ -10285,11 +10282,11 @@ index 000000000000..7dcbacb3cd00
+ #size-cells = <0>;
+ mcp23s17_10: mcp23s17@0 {
+ compatible = "microchip,mcp23s17";
-+ gpio-controller;
-+ #gpio-cells = <2>;
-+ microchip,spi-present-mask = <0x00>; /* overwritten by mcp23s17-spi1-0-present parameter */
-+ reg = <0>;
-+ spi-max-frequency = <500000>;
++ gpio-controller;
++ #gpio-cells = <2>;
++ microchip,spi-present-mask = <0x00>; /* overwritten by mcp23s17-spi1-0-present parameter */
++ reg = <0>;
++ spi-max-frequency = <500000>;
+ status = "okay";
+ #interrupt-cells=<2>;
+ interrupts = <0 2>; /* 1st word overwritten by mcp23s17-spi1-0-int-gpio parameter */
@@ -10306,11 +10303,11 @@ index 000000000000..7dcbacb3cd00
+ #size-cells = <0>;
+ mcp23s17_11: mcp23s17@1 {
+ compatible = "microchip,mcp23s17";
-+ gpio-controller;
-+ #gpio-cells = <2>;
-+ microchip,spi-present-mask = <0x00>; /* overwritten by mcp23s17-spi1-1-present parameter */
-+ reg = <1>;
-+ spi-max-frequency = <500000>;
++ gpio-controller;
++ #gpio-cells = <2>;
++ microchip,spi-present-mask = <0x00>; /* overwritten by mcp23s17-spi1-1-present parameter */
++ reg = <1>;
++ spi-max-frequency = <500000>;
+ status = "okay";
+ #interrupt-cells=<2>;
+ interrupts = <0 2>; /* 1st word overwritten by mcp23s17-spi1-1-int-gpio parameter */
@@ -10327,11 +10324,11 @@ index 000000000000..7dcbacb3cd00
+ #size-cells = <0>;
+ mcp23s17_12: mcp23s17@2 {
+ compatible = "microchip,mcp23s17";
-+ gpio-controller;
-+ #gpio-cells = <2>;
-+ microchip,spi-present-mask = <0x00>; /* overwritten by mcp23s17-spi1-2-present parameter */
-+ reg = <2>;
-+ spi-max-frequency = <500000>;
++ gpio-controller;
++ #gpio-cells = <2>;
++ microchip,spi-present-mask = <0x00>; /* overwritten by mcp23s17-spi1-2-present parameter */
++ reg = <2>;
++ spi-max-frequency = <500000>;
+ status = "okay";
+ #interrupt-cells=<2>;
+ interrupts = <0 2>; /* 1st word overwritten by mcp23s17-spi1-2-int-gpio parameter */
@@ -10348,11 +10345,11 @@ index 000000000000..7dcbacb3cd00
+ #size-cells = <0>;
+ mcp23s17_20: mcp23s17@0 {
+ compatible = "microchip,mcp23s17";
-+ gpio-controller;
-+ #gpio-cells = <2>;
-+ microchip,spi-present-mask = <0x00>; /* overwritten by mcp23s17-spi2-0-present parameter */
-+ reg = <0>;
-+ spi-max-frequency = <500000>;
++ gpio-controller;
++ #gpio-cells = <2>;
++ microchip,spi-present-mask = <0x00>; /* overwritten by mcp23s17-spi2-0-present parameter */
++ reg = <0>;
++ spi-max-frequency = <500000>;
+ status = "okay";
+ #interrupt-cells=<2>;
+ interrupts = <0 2>; /* 1st word overwritten by mcp23s17-spi2-0-int-gpio parameter */
@@ -10369,11 +10366,11 @@ index 000000000000..7dcbacb3cd00
+ #size-cells = <0>;
+ mcp23s17_21: mcp23s17@1 {
+ compatible = "microchip,mcp23s17";
-+ gpio-controller;
-+ #gpio-cells = <2>;
-+ microchip,spi-present-mask = <0x00>; /* overwritten by mcp23s17-spi2-1-present parameter */
-+ reg = <1>;
-+ spi-max-frequency = <500000>;
++ gpio-controller;
++ #gpio-cells = <2>;
++ microchip,spi-present-mask = <0x00>; /* overwritten by mcp23s17-spi2-1-present parameter */
++ reg = <1>;
++ spi-max-frequency = <500000>;
+ status = "okay";
+ #interrupt-cells=<2>;
+ interrupts = <0 2>; /* 1st word overwritten by mcp23s17-spi2-1-int-gpio parameter */
@@ -10390,11 +10387,11 @@ index 000000000000..7dcbacb3cd00
+ #size-cells = <0>;
+ mcp23s17_22: mcp23s17@2 {
+ compatible = "microchip,mcp23s17";
-+ gpio-controller;
-+ #gpio-cells = <2>;
-+ microchip,spi-present-mask = <0x00>; /* overwritten by mcp23s17-spi2-2-present parameter */
-+ reg = <2>;
-+ spi-max-frequency = <500000>;
++ gpio-controller;
++ #gpio-cells = <2>;
++ microchip,spi-present-mask = <0x00>; /* overwritten by mcp23s17-spi2-2-present parameter */
++ reg = <2>;
++ spi-max-frequency = <500000>;
+ status = "okay";
+ #interrupt-cells=<2>;
+ interrupts = <0 2>; /* 1st word overwritten by mcp23s17-spi2-2-int-gpio parameter */
@@ -10709,7 +10706,6 @@ index 000000000000..7dcbacb3cd00
+ s17-spi2-2-int-gpio = <0>,"+31+47", <&spi2_2_int_pins>,"brcm,pins:0", <&mcp23s17_22>,"interrupts:0";
+ };
+};
-+
diff --git a/arch/arm/boot/dts/overlays/mcp2515-can0-overlay.dts b/arch/arm/boot/dts/overlays/mcp2515-can0-overlay.dts
new file mode 100755
index 000000000000..03eb5486fa9c
@@ -11292,10 +11288,10 @@ index 000000000000..9902c4614ea1
+};
diff --git a/arch/arm/boot/dts/overlays/mcp342x-overlay.dts b/arch/arm/boot/dts/overlays/mcp342x-overlay.dts
new file mode 100644
-index 000000000000..6ddd292d689a
+index 000000000000..00ae2f1730e5
--- /dev/null
+++ b/arch/arm/boot/dts/overlays/mcp342x-overlay.dts
-@@ -0,0 +1,93 @@
+@@ -0,0 +1,92 @@
+// Overlay for MCP3421-8 ADCs from Microchip Semiconductor
+
+/dts-v1/;
@@ -11388,10 +11384,9 @@ index 000000000000..6ddd292d689a
+ mcp3428 = <0>,"=8";
+ };
+};
-+
diff --git a/arch/arm/boot/dts/overlays/media-center-overlay.dts b/arch/arm/boot/dts/overlays/media-center-overlay.dts
new file mode 100644
-index 000000000000..ce4db35228e9
+index 000000000000..112769f80c3a
--- /dev/null
+++ b/arch/arm/boot/dts/overlays/media-center-overlay.dts
@@ -0,0 +1,134 @@
@@ -11513,7 +11508,7 @@ index 000000000000..ce4db35228e9
+ speed = <&rpidisplay>,"spi-max-frequency:0";
+ rotate = <&rpidisplay>,"rotate:0";
+ fps = <&rpidisplay>,"fps:0";
-+ debug = <&rpidisplay>,"debug:0",
++ debug = <&rpidisplay>,"debug:0",
+ <&lirc_rpi>,"rpi,debug:0";
+ xohms = <&rpidisplay_ts>,"ti,x-plate-ohms;0";
+ swapxy = <&rpidisplay_ts>,"ti,swap-xy?";
@@ -12307,10 +12302,10 @@ index 000000000000..40a1f295346e
+};
diff --git a/arch/arm/boot/dts/overlays/piscreen2r-overlay.dts b/arch/arm/boot/dts/overlays/piscreen2r-overlay.dts
new file mode 100644
-index 000000000000..9c0bed893057
+index 000000000000..d38a31a64a6e
--- /dev/null
+++ b/arch/arm/boot/dts/overlays/piscreen2r-overlay.dts
-@@ -0,0 +1,106 @@
+@@ -0,0 +1,105 @@
+ /*
+ * Device Tree overlay for PiScreen2 3.5" TFT with resistive touch by Ozzmaker.com
+ *
@@ -12416,7 +12411,6 @@ index 000000000000..9c0bed893057
+ xohms = <&piscreen2_ts>,"ti,x-plate-ohms;0";
+ };
+};
-+
diff --git a/arch/arm/boot/dts/overlays/pisound-overlay.dts b/arch/arm/boot/dts/overlays/pisound-overlay.dts
new file mode 100644
index 000000000000..0893717af4e0
@@ -13220,7 +13214,7 @@ index 000000000000..f2cdd991aa96
+};
diff --git a/arch/arm/boot/dts/overlays/rotary-encoder-overlay.dts b/arch/arm/boot/dts/overlays/rotary-encoder-overlay.dts
new file mode 100644
-index 000000000000..819f400a9054
+index 000000000000..a7a54aeedaf8
--- /dev/null
+++ b/arch/arm/boot/dts/overlays/rotary-encoder-overlay.dts
@@ -0,0 +1,59 @@
@@ -13259,7 +13253,7 @@ index 000000000000..819f400a9054
+ };
+ };
+
-+ };
++ };
+
+ __overrides__ {
+ pin_a = <&rotary>,"gpios:4",
@@ -15064,7 +15058,7 @@ index 000000000000..2cf677d59a7f
+};
diff --git a/arch/arm/boot/dts/overlays/superaudioboard-overlay.dts b/arch/arm/boot/dts/overlays/superaudioboard-overlay.dts
new file mode 100755
-index 000000000000..e625faeed7fb
+index 000000000000..9514e84b7ad5
--- /dev/null
+++ b/arch/arm/boot/dts/overlays/superaudioboard-overlay.dts
@@ -0,0 +1,73 @@
@@ -15120,7 +15114,7 @@ index 000000000000..e625faeed7fb
+ status = "okay";
+ };
+ };
-+
++
+ fragment@2 {
+ target = <&i2c1>;
+ __overlay__ {
@@ -15143,10 +15137,10 @@ index 000000000000..e625faeed7fb
+};
diff --git a/arch/arm/boot/dts/overlays/sx150x-overlay.dts b/arch/arm/boot/dts/overlays/sx150x-overlay.dts
new file mode 100644
-index 000000000000..0321b292c133
+index 000000000000..157d347b29f4
--- /dev/null
+++ b/arch/arm/boot/dts/overlays/sx150x-overlay.dts
-@@ -0,0 +1,1706 @@
+@@ -0,0 +1,1705 @@
+// Definitions for SX150x I2C GPIO Expanders from Semtech
+
+// dtparams:
@@ -16852,7 +16846,6 @@ index 000000000000..0321b292c133
+ sx1509-1-71-int-gpio = <0>,"+89+105", <&sx150x_1_71_pins>,"brcm,pins:0", <&sx1509_1_71>,"interrupts:0";
+ };
+};
-+
diff --git a/arch/arm/boot/dts/overlays/tinylcd35-overlay.dts b/arch/arm/boot/dts/overlays/tinylcd35-overlay.dts
new file mode 100644
index 000000000000..906b79de86bb
@@ -17350,10 +17343,10 @@ index 000000000000..f6c235a341a2
+};
diff --git a/arch/arm/boot/dts/overlays/upstream-aux-interrupt-overlay.dts b/arch/arm/boot/dts/overlays/upstream-aux-interrupt-overlay.dts
new file mode 100644
-index 000000000000..04e271b72a3a
+index 000000000000..8cdf30687af7
--- /dev/null
+++ b/arch/arm/boot/dts/overlays/upstream-aux-interrupt-overlay.dts
-@@ -0,0 +1,33 @@
+@@ -0,0 +1,32 @@
+// Overlay for missing AUX interrupt controller
+// Instead we bind all AUX devices to the generic AUX interrupt line
+/dts-v1/;
@@ -17386,7 +17379,6 @@ index 000000000000..04e271b72a3a
+ };
+ };
+};
-+
diff --git a/arch/arm/boot/dts/overlays/upstream-overlay.dts b/arch/arm/boot/dts/overlays/upstream-overlay.dts
new file mode 100644
index 000000000000..b597f863c4a8
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0057-BCM270x_DT-Add-pwr_led-and-the-required-input-trigge.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0057-BCM270x_DT-Add-pwr_led-and-the-required-input-trigge.patch
index eab1c57d..214cffc9 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0057-BCM270x_DT-Add-pwr_led-and-the-required-input-trigge.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0057-BCM270x_DT-Add-pwr_led-and-the-required-input-trigge.patch
@@ -1,4 +1,4 @@
-From b3e5f087469fa68be9b3e8a47a75e43de627a9a0 Mon Sep 17 00:00:00 2001
+From 4def728a1f295d70457d1764d9030767435d1234 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Fri, 6 Feb 2015 13:50:57 +0000
Subject: [PATCH 057/185] BCM270x_DT: Add pwr_led, and the required "input"
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0058-Added-Device-IDs-for-August-DVB-T-205.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0058-Added-Device-IDs-for-August-DVB-T-205.patch
index 7e0e791a..07899b70 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0058-Added-Device-IDs-for-August-DVB-T-205.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0058-Added-Device-IDs-for-August-DVB-T-205.patch
@@ -1,4 +1,4 @@
-From cb450c5c4baf9f2833a6d3e1331e0a33af420022 Mon Sep 17 00:00:00 2001
+From 0f3e0735036b9b7c09bf28b4cb6a774eccbf69e7 Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Wed, 3 Jul 2013 00:54:08 +0100
Subject: [PATCH 058/185] Added Device IDs for August DVB-T 205
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0059-Improve-__copy_to_user-and-__copy_from_user-performa.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0059-Improve-__copy_to_user-and-__copy_from_user-performa.patch
index 798b1f83..9e7003b4 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0059-Improve-__copy_to_user-and-__copy_from_user-performa.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0059-Improve-__copy_to_user-and-__copy_from_user-performa.patch
@@ -1,4 +1,4 @@
-From f4ab7815ab96b205e2729198bed3706198afe607 Mon Sep 17 00:00:00 2001
+From e6a188a11ad980b419c80c2e04f77c49ef0c6307 Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Mon, 28 Nov 2016 16:50:04 +0000
Subject: [PATCH 059/185] Improve __copy_to_user and __copy_from_user
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0060-gpio-poweroff-Allow-it-to-work-on-Raspberry-Pi.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0060-gpio-poweroff-Allow-it-to-work-on-Raspberry-Pi.patch
index 82aaed66..0b13acae 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0060-gpio-poweroff-Allow-it-to-work-on-Raspberry-Pi.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0060-gpio-poweroff-Allow-it-to-work-on-Raspberry-Pi.patch
@@ -1,4 +1,4 @@
-From 97dc41c376ed8954d0212bf955c3b0690a203e5e Mon Sep 17 00:00:00 2001
+From 2a0830bb15f3d18a14339491b5317774226defb5 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Thu, 25 Jun 2015 12:16:11 +0100
Subject: [PATCH 060/185] gpio-poweroff: Allow it to work on Raspberry Pi
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0061-mfd-Add-Raspberry-Pi-Sense-HAT-core-driver.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0061-mfd-Add-Raspberry-Pi-Sense-HAT-core-driver.patch
index 74b1c000..c61a1482 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0061-mfd-Add-Raspberry-Pi-Sense-HAT-core-driver.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0061-mfd-Add-Raspberry-Pi-Sense-HAT-core-driver.patch
@@ -1,4 +1,4 @@
-From 1fb1b5d2f76c4d7900abe6d778b863688bc348c9 Mon Sep 17 00:00:00 2001
+From 7a906ad062465128283728fe994a9a70e6841c11 Mon Sep 17 00:00:00 2001
From: Phil Elwell <pelwell@users.noreply.github.com>
Date: Tue, 14 Jul 2015 14:32:47 +0100
Subject: [PATCH 061/185] mfd: Add Raspberry Pi Sense HAT core driver
@@ -9,14 +9,14 @@ Subject: [PATCH 061/185] mfd: Add Raspberry Pi Sense HAT core driver
drivers/input/joystick/rpisense-js.c | 153 ++++++++++++
drivers/mfd/Kconfig | 8 +
drivers/mfd/Makefile | 2 +-
- drivers/mfd/rpisense-core.c | 157 ++++++++++++
+ drivers/mfd/rpisense-core.c | 156 ++++++++++++
drivers/video/fbdev/Kconfig | 13 +
drivers/video/fbdev/Makefile | 1 +
- drivers/video/fbdev/rpisense-fb.c | 293 +++++++++++++++++++++++
+ drivers/video/fbdev/rpisense-fb.c | 292 +++++++++++++++++++++++
include/linux/mfd/rpisense/core.h | 47 ++++
include/linux/mfd/rpisense/framebuffer.h | 32 +++
include/linux/mfd/rpisense/joystick.h | 35 +++
- 12 files changed, 749 insertions(+), 1 deletion(-)
+ 12 files changed, 747 insertions(+), 1 deletion(-)
diff --git a/drivers/input/joystick/Kconfig b/drivers/input/joystick/Kconfig
index d8f9c6e1fc08..212d8a69467d 100644
@@ -235,10 +235,10 @@ index b4569ed7f3f3..96c7b302c76f 100644
+obj-$(CONFIG_MFD_RPISENSE_CORE) += rpisense-core.o
diff --git a/drivers/mfd/rpisense-core.c b/drivers/mfd/rpisense-core.c
new file mode 100644
-index 000000000000..eea9312dc96a
+index 000000000000..715792b093c3
--- /dev/null
+++ b/drivers/mfd/rpisense-core.c
-@@ -0,0 +1,157 @@
+@@ -0,0 +1,156 @@
+/*
+ * Raspberry Pi Sense HAT core driver
+ * http://raspberrypi.org
@@ -395,7 +395,6 @@ index 000000000000..eea9312dc96a
+MODULE_DESCRIPTION("Raspberry Pi Sense HAT core driver");
+MODULE_AUTHOR("Serge Schneider <serge@raspberrypi.org>");
+MODULE_LICENSE("GPL");
-+
diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig
index 37015c996101..a446e095d151 100644
--- a/drivers/video/fbdev/Kconfig
@@ -434,10 +433,10 @@ index 77cab92f14a9..4e9e2c6b87ed 100644
obj-$(CONFIG_FB_VIRTUAL) += vfb.o
diff --git a/drivers/video/fbdev/rpisense-fb.c b/drivers/video/fbdev/rpisense-fb.c
new file mode 100644
-index 000000000000..26432a5a0b4b
+index 000000000000..b775edcae028
--- /dev/null
+++ b/drivers/video/fbdev/rpisense-fb.c
-@@ -0,0 +1,293 @@
+@@ -0,0 +1,292 @@
+/*
+ * Raspberry Pi Sense HAT framebuffer driver
+ * http://raspberrypi.org
@@ -730,7 +729,6 @@ index 000000000000..26432a5a0b4b
+MODULE_DESCRIPTION("Raspberry Pi Sense HAT framebuffer driver");
+MODULE_AUTHOR("Serge Schneider <serge@raspberrypi.org>");
+MODULE_LICENSE("GPL");
-+
diff --git a/include/linux/mfd/rpisense/core.h b/include/linux/mfd/rpisense/core.h
new file mode 100644
index 000000000000..4856aa3c8b06
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0062-ASoC-Add-support-for-Rpi-DAC.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0062-ASoC-Add-support-for-Rpi-DAC.patch
index 3c4294af..55ea2cc3 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0062-ASoC-Add-support-for-Rpi-DAC.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0062-ASoC-Add-support-for-Rpi-DAC.patch
@@ -1,4 +1,4 @@
-From fac6f34e7f32dd791978329ee5a4551f68ffe8f2 Mon Sep 17 00:00:00 2001
+From 4ce269867e6cd6426fa4bd1dfeb1bb33b6979214 Mon Sep 17 00:00:00 2001
From: Florian Meier <florian.meier@koalo.de>
Date: Mon, 25 Jan 2016 15:48:59 +0000
Subject: [PATCH 062/185] ASoC: Add support for Rpi-DAC
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0063-Add-IQaudIO-Sound-Card-support-for-Raspberry-Pi.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0063-Add-IQaudIO-Sound-Card-support-for-Raspberry-Pi.patch
index 60c4fd62..5bc4bd63 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0063-Add-IQaudIO-Sound-Card-support-for-Raspberry-Pi.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0063-Add-IQaudIO-Sound-Card-support-for-Raspberry-Pi.patch
@@ -1,4 +1,4 @@
-From 8af1ec1ef00abdcc001287567f604bc6e7fb3b8c Mon Sep 17 00:00:00 2001
+From e782af11b13a690ebf79f3b194371749907e690e Mon Sep 17 00:00:00 2001
From: Gordon Garrity <gordon@iqaudio.com>
Date: Sat, 8 Mar 2014 16:56:57 +0000
Subject: [PATCH 063/185] Add IQaudIO Sound Card support for Raspberry Pi
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0064-Added-support-for-HiFiBerry-DAC.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0064-Added-support-for-HiFiBerry-DAC.patch
index 9b5cf915..1688b6bc 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0064-Added-support-for-HiFiBerry-DAC.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0064-Added-support-for-HiFiBerry-DAC.patch
@@ -1,4 +1,4 @@
-From 2929b47cf2d0109b6d3fec344000ab961d103fec Mon Sep 17 00:00:00 2001
+From 506fb49a9844a5c0eb9acc36dc0204685f7d55d0 Mon Sep 17 00:00:00 2001
From: Daniel Matuschek <info@crazy-audio.com>
Date: Mon, 4 Aug 2014 10:06:56 +0200
Subject: [PATCH 064/185] Added support for HiFiBerry DAC+
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0065-Added-driver-for-HiFiBerry-Amp-amplifier-add-on-boar.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0065-Added-driver-for-HiFiBerry-Amp-amplifier-add-on-boar.patch
index 3d512e69..8f0629f2 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0065-Added-driver-for-HiFiBerry-Amp-amplifier-add-on-boar.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0065-Added-driver-for-HiFiBerry-Amp-amplifier-add-on-boar.patch
@@ -1,4 +1,4 @@
-From fd8f63355413bd6bf153991ab167ade152ff089d Mon Sep 17 00:00:00 2001
+From 400307fd073ea7f0c64609e2e55f5449d39f5755 Mon Sep 17 00:00:00 2001
From: Daniel Matuschek <info@crazy-audio.com>
Date: Mon, 4 Aug 2014 11:09:58 +0200
Subject: [PATCH 065/185] Added driver for HiFiBerry Amp amplifier add-on board
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0066-Add-driver-for-rpi-proto.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0066-Add-driver-for-rpi-proto.patch
index 53e896f3..9663d70e 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0066-Add-driver-for-rpi-proto.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0066-Add-driver-for-rpi-proto.patch
@@ -1,4 +1,4 @@
-From 55c63cf7b082ab2312e19ba0a75bf6523f7660b4 Mon Sep 17 00:00:00 2001
+From d061858e7d74f9691d808ddd80fdb8ea60bf5a2b Mon Sep 17 00:00:00 2001
From: Waldemar Brodkorb <wbrodkorb@conet.de>
Date: Wed, 25 Mar 2015 09:26:17 +0100
Subject: [PATCH 066/185] Add driver for rpi-proto
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0067-Add-Support-for-JustBoom-Audio-boards.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0067-Add-Support-for-JustBoom-Audio-boards.patch
index c2f9a8be..e44f86ce 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0067-Add-Support-for-JustBoom-Audio-boards.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0067-Add-Support-for-JustBoom-Audio-boards.patch
@@ -1,4 +1,4 @@
-From 3905fd4a62a915b09d8280358d45c607738d6db9 Mon Sep 17 00:00:00 2001
+From 85afb40caf4f60f7bdc9ecc6a39c7048f4ee70a9 Mon Sep 17 00:00:00 2001
From: Aaron Shaw <shawaj@gmail.com>
Date: Thu, 7 Apr 2016 21:26:21 +0100
Subject: [PATCH 067/185] Add Support for JustBoom Audio boards
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0068-New-AudioInjector.net-Pi-soundcard-with-low-jitter-a.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0068-New-AudioInjector.net-Pi-soundcard-with-low-jitter-a.patch
index 0bbb5dd4..d983ea6d 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0068-New-AudioInjector.net-Pi-soundcard-with-low-jitter-a.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0068-New-AudioInjector.net-Pi-soundcard-with-low-jitter-a.patch
@@ -1,4 +1,4 @@
-From 181e49cf2c102a30305f414a4c65818ba1a06db0 Mon Sep 17 00:00:00 2001
+From bf0de1e414a0c8afde272efff763dc11a8e81380 Mon Sep 17 00:00:00 2001
From: Matt Flax <flatmax@flatmax.org>
Date: Mon, 16 May 2016 21:36:31 +1000
Subject: [PATCH 068/185] New AudioInjector.net Pi soundcard with low jitter
@@ -13,15 +13,15 @@ Added support for headphones, microphone and bclk_ratio settings.
This patch adds headphone and microphone capability to the Audio Injector sound card. The patch also sets the bit clock ratio for use in the bcm2835-i2s driver. The bcm2835-i2s can't handle an 8 kHz sample rate when the bit clock is at 12 MHz because its register is only 10 bits wide which can't represent the ch2 offset of 1508. For that reason, the rate constraint is added.
---
- sound/soc/bcm/audioinjector-pi-soundcard.c | 185 +++++++++++++++++++++
- 1 file changed, 185 insertions(+)
+ sound/soc/bcm/audioinjector-pi-soundcard.c | 184 +++++++++++++++++++++
+ 1 file changed, 184 insertions(+)
diff --git a/sound/soc/bcm/audioinjector-pi-soundcard.c b/sound/soc/bcm/audioinjector-pi-soundcard.c
new file mode 100644
-index 000000000000..6fc42570a141
+index 000000000000..e26b67dfbb17
--- /dev/null
+++ b/sound/soc/bcm/audioinjector-pi-soundcard.c
-@@ -0,0 +1,185 @@
+@@ -0,0 +1,184 @@
+/*
+ * ASoC Driver for AudioInjector Pi add on soundcard
+ *
@@ -160,7 +160,7 @@ index 000000000000..6fc42570a141
+{
+ struct snd_soc_card *card = &snd_soc_audioinjector;
+ int ret;
-+
++
+ card->dev = &pdev->dev;
+
+ if (pdev->dev.of_node) {
@@ -206,4 +206,3 @@ index 000000000000..6fc42570a141
+MODULE_DESCRIPTION("AudioInjector.net Pi Soundcard");
+MODULE_LICENSE("GPL v2");
+MODULE_ALIAS("platform:audioinjector-pi-soundcard");
-+
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0069-New-driver-for-RRA-DigiDAC1-soundcard-using-WM8741-W.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0069-New-driver-for-RRA-DigiDAC1-soundcard-using-WM8741-W.patch
index 97b22def..d3fa456f 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0069-New-driver-for-RRA-DigiDAC1-soundcard-using-WM8741-W.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0069-New-driver-for-RRA-DigiDAC1-soundcard-using-WM8741-W.patch
@@ -1,4 +1,4 @@
-From b13751e20c4099d1fd04651657ca5b70b725176e Mon Sep 17 00:00:00 2001
+From f5833bb4c9417dec887a7557193aefa9a1da4117 Mon Sep 17 00:00:00 2001
From: escalator2015 <jmtasende@gmail.com>
Date: Tue, 24 May 2016 16:20:09 +0100
Subject: [PATCH 069/185] New driver for RRA DigiDAC1 soundcard using WM8741 +
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0070-Add-support-for-Dion-Audio-LOCO-DAC-AMP-HAT.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0070-Add-support-for-Dion-Audio-LOCO-DAC-AMP-HAT.patch
index 2609caae..ff4a2e25 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0070-Add-support-for-Dion-Audio-LOCO-DAC-AMP-HAT.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0070-Add-support-for-Dion-Audio-LOCO-DAC-AMP-HAT.patch
@@ -1,4 +1,4 @@
-From 9a3634ce8c0f89a26aae8bc1ef3c9bfc9ee72d90 Mon Sep 17 00:00:00 2001
+From 41ff2d4edfe5f1c08bd70120b25866b06a64e1c0 Mon Sep 17 00:00:00 2001
From: DigitalDreamtime <clive.messer@digitaldreamtime.co.uk>
Date: Sat, 2 Jul 2016 16:26:19 +0100
Subject: [PATCH 070/185] Add support for Dion Audio LOCO DAC-AMP HAT
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0071-Allo-Piano-DAC-boards-Initial-2-channel-stereo-suppo.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0071-Allo-Piano-DAC-boards-Initial-2-channel-stereo-suppo.patch
index 53de9346..19f7de82 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0071-Allo-Piano-DAC-boards-Initial-2-channel-stereo-suppo.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0071-Allo-Piano-DAC-boards-Initial-2-channel-stereo-suppo.patch
@@ -1,4 +1,4 @@
-From 8a687fcd2ca58ffee0dfcdfb8533f75de5d4c1a7 Mon Sep 17 00:00:00 2001
+From ff108b4a37e77c6d26da1fa45a495a0767b22687 Mon Sep 17 00:00:00 2001
From: Clive Messer <clive.m.messer@gmail.com>
Date: Mon, 19 Sep 2016 14:01:04 +0100
Subject: [PATCH 071/185] Allo Piano DAC boards: Initial 2 channel (stereo)
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0072-Add-support-for-Allo-Piano-DAC-2.1-plus-add-on-board.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0072-Add-support-for-Allo-Piano-DAC-2.1-plus-add-on-board.patch
index 2eca76af..988b1de9 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0072-Add-support-for-Allo-Piano-DAC-2.1-plus-add-on-board.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0072-Add-support-for-Allo-Piano-DAC-2.1-plus-add-on-board.patch
@@ -1,4 +1,4 @@
-From 1a042c65a24975525a148eb28ca20c54d068466e Mon Sep 17 00:00:00 2001
+From bc63b3b6bc2ec6435e59bd2e5c02bf6ce3e23ebe Mon Sep 17 00:00:00 2001
From: Raashid Muhammed <raashidmuhammed@zilogic.com>
Date: Mon, 27 Mar 2017 12:35:00 +0530
Subject: [PATCH 072/185] Add support for Allo Piano DAC 2.1 plus add-on board
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0073-Add-support-for-Allo-Boss-DAC-add-on-board-for-Raspb.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0073-Add-support-for-Allo-Boss-DAC-add-on-board-for-Raspb.patch
index a75e72b9..3f2e5d5f 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0073-Add-support-for-Allo-Boss-DAC-add-on-board-for-Raspb.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0073-Add-support-for-Allo-Boss-DAC-add-on-board-for-Raspb.patch
@@ -1,4 +1,4 @@
-From 501ddc49dd42996c1765e99c7f44d44ff3d5cce8 Mon Sep 17 00:00:00 2001
+From 7ee8b536c69329e932f162f260f09d3ddbbaca6d Mon Sep 17 00:00:00 2001
From: BabuSubashChandar <babuenir@gmail.com>
Date: Tue, 28 Mar 2017 20:04:42 +0530
Subject: [PATCH 073/185] Add support for Allo Boss DAC add-on board for
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0074-Support-for-Blokas-Labs-pisound-board.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0074-Support-for-Blokas-Labs-pisound-board.patch
index f5f20da9..a54f4752 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0074-Support-for-Blokas-Labs-pisound-board.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0074-Support-for-Blokas-Labs-pisound-board.patch
@@ -1,4 +1,4 @@
-From 25f891a981174ebb9c37fd04833b5249883f873f Mon Sep 17 00:00:00 2001
+From 44915ac764e62f96cc56e542a828227d89c823e1 Mon Sep 17 00:00:00 2001
From: gtrainavicius <gtrainavicius@users.noreply.github.com>
Date: Sun, 23 Oct 2016 12:06:53 +0300
Subject: [PATCH 074/185] Support for Blokas Labs pisound board
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0075-ASoC-Add-driver-for-Cirrus-Logic-Audio-Card.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0075-ASoC-Add-driver-for-Cirrus-Logic-Audio-Card.patch
index 5b63762a..07f9f734 100644
--- a/'>sys-kernel/boest-v5.1.1/raspberrypi/0075-ASoC-Add-driver-for-Cirrus-Logic-Audio-Card.patch
+++ b/'>sys-kernel/boest-v5.1.1/raspberrypi/0075-ASoC-Add-driver-for-Cirrus-Logic-Audio-Card.patch
@@ -1,4 +1,4 @@
-From 536050afa8faf0955471a78f13a776420c7e663a Mon Sep 17 00:00:00 2001
+From e151dd7106495b6723a5b5d825fb3748d14f18d3 Mon Sep 17 00:00:00 2001
From: Matthias Reichl <hias@horus.com>
Date: Sun, 22 Jan 2017 12:49:37 +0100
Subject: [PATCH 075/185] ASoC: Add driver for Cirrus Logic Audio Card
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0076-sound-Support-for-Dion-Audio-LOCO-V2-DAC-AMP-HAT.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0076-sound-Support-for-Dion-Audio-LOCO-V2-DAC-AMP-HAT.patch
index 1c521baf..f923329c 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0076-sound-Support-for-Dion-Audio-LOCO-V2-DAC-AMP-HAT.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0076-sound-Support-for-Dion-Audio-LOCO-V2-DAC-AMP-HAT.patch
@@ -1,4 +1,4 @@
-From 7237c94209f88e0b92b5eec3ef8ed964cb8b6ef0 Mon Sep 17 00:00:00 2001
+From 16de6dfef3dc724a3be95faa0b2a3b639ef3f987 Mon Sep 17 00:00:00 2001
From: Miquel <miquelblauw@hotmail.com>
Date: Fri, 24 Feb 2017 20:51:06 +0100
Subject: [PATCH 076/185] sound: Support for Dion Audio LOCO-V2 DAC-AMP HAT
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0077-Add-support-for-Fe-Pi-audio-sound-card.-1867.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0077-Add-support-for-Fe-Pi-audio-sound-card.-1867.patch
index 9ecd75db..b510f04f 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0077-Add-support-for-Fe-Pi-audio-sound-card.-1867.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0077-Add-support-for-Fe-Pi-audio-sound-card.-1867.patch
@@ -1,4 +1,4 @@
-From 039453d346886baeac4b3b031880914eba5bf77f Mon Sep 17 00:00:00 2001
+From 1f5d11be2bff09542d8b4eca15343b3e357ee486 Mon Sep 17 00:00:00 2001
From: Fe-Pi <fe-pi@cox.net>
Date: Wed, 1 Mar 2017 04:42:43 -0700
Subject: [PATCH 077/185] Add support for Fe-Pi audio sound card. (#1867)
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0078-Add-support-for-the-AudioInjector.net-Octo-sound-car.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0078-Add-support-for-the-AudioInjector.net-Octo-sound-car.patch
index 1d51e047..68521b29 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0078-Add-support-for-the-AudioInjector.net-Octo-sound-car.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0078-Add-support-for-the-AudioInjector.net-Octo-sound-car.patch
@@ -1,4 +1,4 @@
-From f489c63239a7620c16cfbf4cafca295c32b65458 Mon Sep 17 00:00:00 2001
+From e13b632cdac7214c907ab7dc6514ea9ac093b521 Mon Sep 17 00:00:00 2001
From: Matt Flax <flatmax@flatmax.org>
Date: Wed, 8 Mar 2017 20:04:13 +1100
Subject: [PATCH 078/185] Add support for the AudioInjector.net Octo sound card
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0079-Driver-support-for-Google-voiceHAT-soundcard.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0079-Driver-support-for-Google-voiceHAT-soundcard.patch
index 00238716..97d8947d 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0079-Driver-support-for-Google-voiceHAT-soundcard.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0079-Driver-support-for-Google-voiceHAT-soundcard.patch
@@ -1,4 +1,4 @@
-From 05cf09fbafedc722b90870cba45b5fcb9b4a3838 Mon Sep 17 00:00:00 2001
+From d3988cdd1fe418ed38227df4af48cd72e14b1073 Mon Sep 17 00:00:00 2001
From: Peter Malkin <petermalkin@google.com>
Date: Mon, 27 Mar 2017 16:38:21 -0700
Subject: [PATCH 079/185] Driver support for Google voiceHAT soundcard.
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0080-Driver-and-overlay-for-Allo-Katana-DAC.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0080-Driver-and-overlay-for-Allo-Katana-DAC.patch
index 47297b7e..fae85c63 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0080-Driver-and-overlay-for-Allo-Katana-DAC.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0080-Driver-and-overlay-for-Allo-Katana-DAC.patch
@@ -1,4 +1,4 @@
-From e2276c8d7b9de1832e73d470d1776db6fbc132e7 Mon Sep 17 00:00:00 2001
+From 1eebe1a9c25b86c9dd384c1a7357b9a6b9967f71 Mon Sep 17 00:00:00 2001
From: allocom <sparky-dev@allo.com>
Date: Thu, 19 Apr 2018 12:12:26 +0530
Subject: [PATCH 080/185] Driver and overlay for Allo Katana DAC
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0081-ASoC-Add-generic-RPI-driver-for-simple-soundcards.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0081-ASoC-Add-generic-RPI-driver-for-simple-soundcards.patch
index aa40ee4c..dadd94d9 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0081-ASoC-Add-generic-RPI-driver-for-simple-soundcards.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0081-ASoC-Add-generic-RPI-driver-for-simple-soundcards.patch
@@ -1,4 +1,4 @@
-From 4ad19b71b2bfd45221fc767ef0da0ff55eb7f946 Mon Sep 17 00:00:00 2001
+From caf598dda99e9b1863b5ce11bc705fb112b88656 Mon Sep 17 00:00:00 2001
From: Tim Gover <tim.gover@raspberrypi.org>
Date: Wed, 27 Jun 2018 15:59:12 +0100
Subject: [PATCH 081/185] ASoC: Add generic RPI driver for simple soundcards.
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0082-ASoC-Add-Kconfig-and-Makefile-for-sound-soc-bcm.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0082-ASoC-Add-Kconfig-and-Makefile-for-sound-soc-bcm.patch
index e9a2acb4..341d1510 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0082-ASoC-Add-Kconfig-and-Makefile-for-sound-soc-bcm.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0082-ASoC-Add-Kconfig-and-Makefile-for-sound-soc-bcm.patch
@@ -1,4 +1,4 @@
-From 962525cb2c3bd511443cf48f05c5496fc8136b8f Mon Sep 17 00:00:00 2001
+From c057437391b0f3ee527d041633026bf8c4da790c Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Mon, 3 Sep 2018 17:00:36 +0100
Subject: [PATCH 082/185] ASoC: Add Kconfig and Makefile for sound/soc/bcm
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0083-ASoC-Create-a-generic-Pi-Hat-WM8804-driver.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0083-ASoC-Create-a-generic-Pi-Hat-WM8804-driver.patch
index 27b0a21e..659c26cf 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0083-ASoC-Create-a-generic-Pi-Hat-WM8804-driver.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0083-ASoC-Create-a-generic-Pi-Hat-WM8804-driver.patch
@@ -1,4 +1,4 @@
-From d0c661ce387981bc2e010e00e309875506d9f310 Mon Sep 17 00:00:00 2001
+From 4da763146e2eb8e23841b770eb8940e901d428b2 Mon Sep 17 00:00:00 2001
From: Tim Gover <tim.gover@raspberrypi.org>
Date: Sat, 21 Jul 2018 20:07:46 +0100
Subject: [PATCH 083/185] ASoC: Create a generic Pi Hat WM8804 driver
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0084-rpi_display-add-backlight-driver-and-overlay.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0084-rpi_display-add-backlight-driver-and-overlay.patch
index 5070d70b..3c40b3e6 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0084-rpi_display-add-backlight-driver-and-overlay.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0084-rpi_display-add-backlight-driver-and-overlay.patch
@@ -1,4 +1,4 @@
-From 1d11391e40ee0306fc18ba98811a697a9a7f0df6 Mon Sep 17 00:00:00 2001
+From 0a7749c97dbc202f93233473f7ffe99bd0390179 Mon Sep 17 00:00:00 2001
From: P33M <P33M@github.com>
Date: Wed, 21 Oct 2015 14:55:21 +0100
Subject: [PATCH 084/185] rpi_display: add backlight driver and overlay
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0085-bcm2835-virtgpio-Virtual-GPIO-driver.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0085-bcm2835-virtgpio-Virtual-GPIO-driver.patch
index e2e9db7d..5df58adc 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0085-bcm2835-virtgpio-Virtual-GPIO-driver.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0085-bcm2835-virtgpio-Virtual-GPIO-driver.patch
@@ -1,4 +1,4 @@
-From 8ef3816bf5f548301ecf88d9faf09382ebb44a8a Mon Sep 17 00:00:00 2001
+From beb4a9e1bcc51ee0aad85e70ee1c1bb46c1a11c5 Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Tue, 23 Feb 2016 19:56:04 +0000
Subject: [PATCH 085/185] bcm2835-virtgpio: Virtual GPIO driver
diff --git a/sys-kernel/boest-v5.1.1/raspberrypi/0086-net-Add-non-mainline-source-for-rtl8192cu-wlan.patch b/sys-kernel/boest-v5.1.1/raspberrypi/0086-net-Add-non-mainline-source-for-rtl8192cu-wlan.patch
index 63154582..510260c7 100644
--- a/sys-kernel/boest-v5.1.1/raspberrypi/0086-net-Add-non-mainline-source-for-rtl8192cu-wlan.patch
+++ b/sys-kernel/boest-v5.1.1/raspberrypi/0086-net-Add-non-mainline-source-for-rtl8192cu-wlan.patch
@@ -1,4 +1,4 @@
-From 82530affcfb5268c9e5c6d6fec02e5434bdceed4 Mon Sep 17 00:00:00 2001
+From 972d2047296b7c9020afcd4144b11eef21206c5f Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Mon, 3 Sep 2012 17:10:23 +0100
Subject: [PATCH 086/185] net: Add non-mainline source for rtl8192cu wlan
@@ -8,179 +8,179 @@ https://github.com/pvaret/rtl8192cu-fixes
---
drivers/net/wireless/realtek/Kconfig | 1 +
drivers/net/wireless/realtek/Makefile | 1 +
- .../net/wireless/realtek/rtl8192cu/Kconfig | 9 +
- .../net/wireless/realtek/rtl8192cu/Makefile | 616 +
+ .../net/wireless/realtek/rtl8192cu/Kconfig | 8 +
+ .../net/wireless/realtek/rtl8192cu/Makefile | 615 +
drivers/net/wireless/realtek/rtl8192cu/clean | 5 +
- .../realtek/rtl8192cu/core/efuse/rtw_efuse.c | 1147 ++
- .../wireless/realtek/rtl8192cu/core/rtw_ap.c | 2943 ++++
+ .../realtek/rtl8192cu/core/efuse/rtw_efuse.c | 1145 ++
+ .../wireless/realtek/rtl8192cu/core/rtw_ap.c | 2942 ++++
.../realtek/rtl8192cu/core/rtw_br_ext.c | 1700 ++
- .../wireless/realtek/rtl8192cu/core/rtw_cmd.c | 3035 ++++
- .../realtek/rtl8192cu/core/rtw_debug.c | 1337 ++
- .../realtek/rtl8192cu/core/rtw_eeprom.c | 423 +
- .../realtek/rtl8192cu/core/rtw_ieee80211.c | 1916 +++
- .../wireless/realtek/rtl8192cu/core/rtw_io.c | 464 +
- .../realtek/rtl8192cu/core/rtw_ioctl_query.c | 196 +
+ .../wireless/realtek/rtl8192cu/core/rtw_cmd.c | 3034 ++++
+ .../realtek/rtl8192cu/core/rtw_debug.c | 1336 ++
+ .../realtek/rtl8192cu/core/rtw_eeprom.c | 422 +
+ .../realtek/rtl8192cu/core/rtw_ieee80211.c | 1915 +++
+ .../wireless/realtek/rtl8192cu/core/rtw_io.c | 462 +
+ .../realtek/rtl8192cu/core/rtw_ioctl_query.c | 195 +
.../realtek/rtl8192cu/core/rtw_ioctl_rtl.c | 1031 ++
- .../realtek/rtl8192cu/core/rtw_ioctl_set.c | 1494 ++
- .../wireless/realtek/rtl8192cu/core/rtw_iol.c | 263 +
- .../realtek/rtl8192cu/core/rtw_mlme.c | 3967 +++++
- .../realtek/rtl8192cu/core/rtw_mlme_ext.c | 13600 ++++++++++++++++
- .../wireless/realtek/rtl8192cu/core/rtw_mp.c | 1324 ++
- .../realtek/rtl8192cu/core/rtw_mp_ioctl.c | 2954 ++++
- .../wireless/realtek/rtl8192cu/core/rtw_p2p.c | 5370 ++++++
- .../realtek/rtl8192cu/core/rtw_pwrctrl.c | 1551 ++
- .../realtek/rtl8192cu/core/rtw_recv.c | 4306 +++++
- .../wireless/realtek/rtl8192cu/core/rtw_rf.c | 95 +
- .../realtek/rtl8192cu/core/rtw_security.c | 3115 ++++
- .../realtek/rtl8192cu/core/rtw_sreset.c | 352 +
- .../realtek/rtl8192cu/core/rtw_sta_mgt.c | 848 +
- .../realtek/rtl8192cu/core/rtw_tdls.c | 2941 ++++
- .../realtek/rtl8192cu/core/rtw_wlan_util.c | 2305 +++
- .../realtek/rtl8192cu/core/rtw_xmit.c | 4156 +++++
- .../realtek/rtl8192cu/hal/HalPwrSeqCmd.c | 177 +
- .../net/wireless/realtek/rtl8192cu/hal/dm.c | 314 +
+ .../realtek/rtl8192cu/core/rtw_ioctl_set.c | 1493 ++
+ .../wireless/realtek/rtl8192cu/core/rtw_iol.c | 262 +
+ .../realtek/rtl8192cu/core/rtw_mlme.c | 3966 +++++
+ .../realtek/rtl8192cu/core/rtw_mlme_ext.c | 13599 ++++++++++++++++
+ .../wireless/realtek/rtl8192cu/core/rtw_mp.c | 1323 ++
+ .../realtek/rtl8192cu/core/rtw_mp_ioctl.c | 2953 ++++
+ .../wireless/realtek/rtl8192cu/core/rtw_p2p.c | 5369 ++++++
+ .../realtek/rtl8192cu/core/rtw_pwrctrl.c | 1549 ++
+ .../realtek/rtl8192cu/core/rtw_recv.c | 4303 +++++
+ .../wireless/realtek/rtl8192cu/core/rtw_rf.c | 94 +
+ .../realtek/rtl8192cu/core/rtw_security.c | 3114 ++++
+ .../realtek/rtl8192cu/core/rtw_sreset.c | 351 +
+ .../realtek/rtl8192cu/core/rtw_sta_mgt.c | 847 +
+ .../realtek/rtl8192cu/core/rtw_tdls.c | 2940 ++++
+ .../realtek/rtl8192cu/core/rtw_wlan_util.c | 2304 +++
+ .../realtek/rtl8192cu/core/rtw_xmit.c | 4155 +++++
+ .../realtek/rtl8192cu/hal/HalPwrSeqCmd.c | 175 +
+ .../net/wireless/realtek/rtl8192cu/hal/dm.c | 313 +
.../net/wireless/realtek/rtl8192cu/hal/dm.h | 30 +
- .../wireless/realtek/rtl8192cu/hal/hal_com.c | 371 +
- .../wireless/realtek/rtl8192cu/hal/hal_intf.c | 546 +
- .../rtl8192cu/hal/rtl8192c/rtl8192c_cmd.c | 1159 ++
- .../rtl8192cu/hal/rtl8192c/rtl8192c_dm.c | 5058 ++++++
- .../hal/rtl8192c/rtl8192c_hal_init.c | 3628 +++++
+ .../wireless/realtek/rtl8192cu/hal/hal_com.c | 370 +
+ .../wireless/realtek/rtl8192cu/hal/hal_intf.c | 545 +
+ .../rtl8192cu/hal/rtl8192c/rtl8192c_cmd.c | 1154 ++
+ .../rtl8192cu/hal/rtl8192c/rtl8192c_dm.c | 5057 ++++++
+ .../hal/rtl8192c/rtl8192c_hal_init.c | 3627 +++++
.../rtl8192cu/hal/rtl8192c/rtl8192c_mp.c | 1207 ++
- .../rtl8192cu/hal/rtl8192c/rtl8192c_phycfg.c | 4841 ++++++
- .../rtl8192cu/hal/rtl8192c/rtl8192c_rf6052.c | 1031 ++
- .../rtl8192cu/hal/rtl8192c/rtl8192c_rxdesc.c | 876 +
- .../rtl8192cu/hal/rtl8192c/rtl8192c_sreset.c | 94 +
- .../rtl8192cu/hal/rtl8192c/rtl8192c_xmit.c | 63 +
- .../hal/rtl8192c/usb/Hal8192CUHWImg.c | 8758 ++++++++++
- .../hal/rtl8192c/usb/Hal8192CUHWImg_wowlan.c | 2564 +++
- .../hal/rtl8192c/usb/rtl8192cu_led.c | 2680 +++
- .../hal/rtl8192c/usb/rtl8192cu_recv.c | 229 +
- .../hal/rtl8192c/usb/rtl8192cu_xmit.c | 1150 ++
- .../rtl8192cu/hal/rtl8192c/usb/usb_halinit.c | 6261 +++++++
- .../rtl8192cu/hal/rtl8192c/usb/usb_ops_ce.c | 1207 ++
- .../hal/rtl8192c/usb/usb_ops_linux.c | 1536 ++
- .../rtl8192cu/hal/rtl8192c/usb/usb_ops_xp.c | 1265 ++
+ .../rtl8192cu/hal/rtl8192c/rtl8192c_phycfg.c | 4840 ++++++
+ .../rtl8192cu/hal/rtl8192c/rtl8192c_rf6052.c | 1030 ++
+ .../rtl8192cu/hal/rtl8192c/rtl8192c_rxdesc.c | 874 +
+ .../rtl8192cu/hal/rtl8192c/rtl8192c_sreset.c | 93 +
+ .../rtl8192cu/hal/rtl8192c/rtl8192c_xmit.c | 62 +
+ .../hal/rtl8192c/usb/Hal8192CUHWImg.c | 8757 ++++++++++
+ .../hal/rtl8192c/usb/Hal8192CUHWImg_wowlan.c | 2557 +++
+ .../hal/rtl8192c/usb/rtl8192cu_led.c | 2679 +++
+ .../hal/rtl8192c/usb/rtl8192cu_recv.c | 227 +
+ .../hal/rtl8192c/usb/rtl8192cu_xmit.c | 1149 ++
+ .../rtl8192cu/hal/rtl8192c/usb/usb_halinit.c | 6260 +++++++
+ .../rtl8192cu/hal/rtl8192c/usb/usb_ops_ce.c | 1205 ++
+ .../hal/rtl8192c/usb/usb_ops_linux.c | 1535 ++
+ .../rtl8192cu/hal/rtl8192c/usb/usb_ops_xp.c | 1264 ++
.../wireless/realtek/rtl8192cu/ifcfg-wlan0 | 4 +
.../rtl8192cu/include/Hal8192CEHWImg.h | 85 +
- .../rtl8192cu/include/Hal8192CPhyCfg.h | 428 +
- .../rtl8192cu/include/Hal8192CPhyReg.h | 1123 ++
+ .../rtl8192cu/include/Hal8192CPhyCfg.h | 427 +
+ .../rtl8192cu/include/Hal8192CPhyReg.h | 1122 ++
.../rtl8192cu/include/Hal8192CUHWImg.h | 105 +
- .../rtl8192cu/include/Hal8192CUHWImg_wowlan.h | 34 +
+ .../rtl8192cu/include/Hal8192CUHWImg_wowlan.h | 33 +
.../rtl8192cu/include/Hal8192DEHWImg.h | 66 +
- .../rtl8192cu/include/Hal8192DPhyCfg.h | 528 +
- .../rtl8192cu/include/Hal8192DPhyReg.h | 1171 ++
+ .../rtl8192cu/include/Hal8192DPhyCfg.h | 527 +
+ .../rtl8192cu/include/Hal8192DPhyReg.h | 1170 ++
.../rtl8192cu/include/Hal8192DUHWImg.h | 66 +
- .../rtl8192cu/include/Hal8192DUHWImg_wowlan.h | 30 +
+ .../rtl8192cu/include/Hal8192DUHWImg_wowlan.h | 29 +
.../realtek/rtl8192cu/include/HalPwrSeqCmd.h | 137 +
.../realtek/rtl8192cu/include/autoconf.h | 336 +
- .../realtek/rtl8192cu/include/basic_types.h | 321 +
+ .../realtek/rtl8192cu/include/basic_types.h | 320 +
.../rtl8192cu/include/byteorder/big_endian.h | 87 +
.../rtl8192cu/include/byteorder/generic.h | 212 +
.../include/byteorder/little_endian.h | 89 +
.../rtl8192cu/include/byteorder/swab.h | 140 +
.../rtl8192cu/include/byteorder/swabb.h | 156 +
.../realtek/rtl8192cu/include/circ_buf.h | 27 +
- .../realtek/rtl8192cu/include/cmd_osdep.h | 36 +
- .../realtek/rtl8192cu/include/drv_conf.h | 78 +
- .../realtek/rtl8192cu/include/drv_types.h | 662 +
+ .../realtek/rtl8192cu/include/cmd_osdep.h | 35 +
+ .../realtek/rtl8192cu/include/drv_conf.h | 77 +
+ .../realtek/rtl8192cu/include/drv_types.h | 661 +
.../realtek/rtl8192cu/include/drv_types_ce.h | 92 +
- .../rtl8192cu/include/drv_types_linux.h | 25 +
- .../rtl8192cu/include/drv_types_sdio.h | 70 +
- .../realtek/rtl8192cu/include/drv_types_xp.h | 95 +
+ .../rtl8192cu/include/drv_types_linux.h | 24 +
+ .../rtl8192cu/include/drv_types_sdio.h | 69 +
+ .../realtek/rtl8192cu/include/drv_types_xp.h | 94 +
.../realtek/rtl8192cu/include/ethernet.h | 41 +
.../realtek/rtl8192cu/include/h2clbk.h | 35 +
- .../realtek/rtl8192cu/include/hal_com.h | 146 +
- .../realtek/rtl8192cu/include/hal_intf.h | 432 +
- .../realtek/rtl8192cu/include/ieee80211.h | 1580 ++
- .../realtek/rtl8192cu/include/ieee80211_ext.h | 477 +
+ .../realtek/rtl8192cu/include/hal_com.h | 145 +
+ .../realtek/rtl8192cu/include/hal_intf.h | 431 +
+ .../realtek/rtl8192cu/include/ieee80211.h | 1579 ++
+ .../realtek/rtl8192cu/include/ieee80211_ext.h | 476 +
.../realtek/rtl8192cu/include/if_ether.h | 112 +
- .../rtl8192cu/include/ioctl_cfg80211.h | 184 +
+ .../rtl8192cu/include/ioctl_cfg80211.h | 183 +
.../wireless/realtek/rtl8192cu/include/ip.h | 141 +
.../rtl8192cu/include/linux/wireless.h | 90 +
- .../realtek/rtl8192cu/include/mlme_osdep.h | 40 +
+ .../realtek/rtl8192cu/include/mlme_osdep.h | 39 +
.../realtek/rtl8192cu/include/mp_custom_oid.h | 353 +
- .../realtek/rtl8192cu/include/nic_spec.h | 47 +
- .../rtl8192cu/include/osdep_ce_service.h | 171 +
- .../realtek/rtl8192cu/include/osdep_intf.h | 155 +
- .../realtek/rtl8192cu/include/osdep_service.h | 1821 +++
- .../realtek/rtl8192cu/include/pci_hal.h | 168 +
+ .../realtek/rtl8192cu/include/nic_spec.h | 46 +
+ .../rtl8192cu/include/osdep_ce_service.h | 170 +
+ .../realtek/rtl8192cu/include/osdep_intf.h | 154 +
+ .../realtek/rtl8192cu/include/osdep_service.h | 1819 +++
+ .../realtek/rtl8192cu/include/pci_hal.h | 167 +
.../realtek/rtl8192cu/include/pci_ops.h | 60 +
- .../realtek/rtl8192cu/include/pci_osintf.h | 33 +
- .../realtek/rtl8192cu/include/recv_osdep.h | 58 +
- .../realtek/rtl8192cu/include/rtl8192c_cmd.h | 153 +
- .../realtek/rtl8192cu/include/rtl8192c_dm.h | 516 +
- .../rtl8192cu/include/rtl8192c_event.h | 28 +
- .../realtek/rtl8192cu/include/rtl8192c_hal.h | 937 ++
- .../realtek/rtl8192cu/include/rtl8192c_led.h | 42 +
- .../realtek/rtl8192cu/include/rtl8192c_recv.h | 184 +
- .../realtek/rtl8192cu/include/rtl8192c_rf.h | 92 +
- .../realtek/rtl8192cu/include/rtl8192c_spec.h | 1865 +++
+ .../realtek/rtl8192cu/include/pci_osintf.h | 32 +
+ .../realtek/rtl8192cu/include/recv_osdep.h | 57 +
+ .../realtek/rtl8192cu/include/rtl8192c_cmd.h | 152 +
+ .../realtek/rtl8192cu/include/rtl8192c_dm.h | 515 +
+ .../rtl8192cu/include/rtl8192c_event.h | 26 +
+ .../realtek/rtl8192cu/include/rtl8192c_hal.h | 934 ++
+ .../realtek/rtl8192cu/include/rtl8192c_led.h | 41 +
+ .../realtek/rtl8192cu/include/rtl8192c_recv.h | 183 +
+ .../realtek/rtl8192cu/include/rtl8192c_rf.h | 91 +
+ .../realtek/rtl8192cu/include/rtl8192c_spec.h | 1864 +++
.../rtl8192cu/include/rtl8192c_sreset.h | 32 +
- .../realtek/rtl8192cu/include/rtl8192c_xmit.h | 129 +
- .../realtek/rtl8192cu/include/rtl8192d_cmd.h | 142 +
+ .../realtek/rtl8192cu/include/rtl8192c_xmit.h | 128 +
+ .../realtek/rtl8192cu/include/rtl8192d_cmd.h | 140 +
.../realtek/rtl8192cu/include/rtl8192d_dm.h | 420 +
- .../realtek/rtl8192cu/include/rtl8192d_hal.h | 1126 ++
- .../realtek/rtl8192cu/include/rtl8192d_led.h | 43 +
- .../realtek/rtl8192cu/include/rtl8192d_recv.h | 187 +
- .../realtek/rtl8192cu/include/rtl8192d_rf.h | 97 +
- .../realtek/rtl8192cu/include/rtl8192d_spec.h | 1841 +++
- .../realtek/rtl8192cu/include/rtl8192d_xmit.h | 145 +
- .../realtek/rtl8192cu/include/rtw_android.h | 90 +
- .../realtek/rtl8192cu/include/rtw_ap.h | 64 +
- .../realtek/rtl8192cu/include/rtw_br_ext.h | 76 +
- .../realtek/rtl8192cu/include/rtw_byteorder.h | 40 +
- .../realtek/rtl8192cu/include/rtw_cmd.h | 1167 ++
- .../realtek/rtl8192cu/include/rtw_debug.h | 538 +
+ .../realtek/rtl8192cu/include/rtl8192d_hal.h | 1125 ++
+ .../realtek/rtl8192cu/include/rtl8192d_led.h | 42 +
+ .../realtek/rtl8192cu/include/rtl8192d_recv.h | 186 +
+ .../realtek/rtl8192cu/include/rtl8192d_rf.h | 96 +
+ .../realtek/rtl8192cu/include/rtl8192d_spec.h | 1840 +++
+ .../realtek/rtl8192cu/include/rtl8192d_xmit.h | 144 +
+ .../realtek/rtl8192cu/include/rtw_android.h | 89 +
+ .../realtek/rtl8192cu/include/rtw_ap.h | 63 +
+ .../realtek/rtl8192cu/include/rtw_br_ext.h | 75 +
+ .../realtek/rtl8192cu/include/rtw_byteorder.h | 39 +
+ .../realtek/rtl8192cu/include/rtw_cmd.h | 1166 ++
+ .../realtek/rtl8192cu/include/rtw_debug.h | 537 +
.../realtek/rtl8192cu/include/rtw_eeprom.h | 152 +
- .../realtek/rtl8192cu/include/rtw_efuse.h | 124 +
- .../realtek/rtl8192cu/include/rtw_event.h | 154 +
- .../realtek/rtl8192cu/include/rtw_ht.h | 50 +
+ .../realtek/rtl8192cu/include/rtw_efuse.h | 123 +
+ .../realtek/rtl8192cu/include/rtw_event.h | 153 +
+ .../realtek/rtl8192cu/include/rtw_ht.h | 49 +
.../realtek/rtl8192cu/include/rtw_io.h | 504 +
- .../realtek/rtl8192cu/include/rtw_ioctl.h | 269 +
- .../rtl8192cu/include/rtw_ioctl_query.h | 36 +
+ .../realtek/rtl8192cu/include/rtw_ioctl.h | 268 +
+ .../rtl8192cu/include/rtw_ioctl_query.h | 35 +
.../realtek/rtl8192cu/include/rtw_ioctl_rtl.h | 83 +
- .../realtek/rtl8192cu/include/rtw_ioctl_set.h | 79 +
+ .../realtek/rtl8192cu/include/rtw_ioctl_set.h | 78 +
.../realtek/rtl8192cu/include/rtw_iol.h | 89 +
- .../realtek/rtl8192cu/include/rtw_led.h | 217 +
- .../realtek/rtl8192cu/include/rtw_mlme.h | 850 +
- .../realtek/rtl8192cu/include/rtw_mlme_ext.h | 963 ++
- .../realtek/rtl8192cu/include/rtw_mp.h | 712 +
- .../realtek/rtl8192cu/include/rtw_mp_ioctl.h | 596 +
- .../rtl8192cu/include/rtw_mp_phy_regdef.h | 1097 ++
- .../realtek/rtl8192cu/include/rtw_p2p.h | 161 +
+ .../realtek/rtl8192cu/include/rtw_led.h | 216 +
+ .../realtek/rtl8192cu/include/rtw_mlme.h | 849 +
+ .../realtek/rtl8192cu/include/rtw_mlme_ext.h | 962 ++
+ .../realtek/rtl8192cu/include/rtw_mp.h | 711 +
+ .../realtek/rtl8192cu/include/rtw_mp_ioctl.h | 595 +
+ .../rtl8192cu/include/rtw_mp_phy_regdef.h | 1096 ++
+ .../realtek/rtl8192cu/include/rtw_p2p.h | 160 +
.../realtek/rtl8192cu/include/rtw_pwrctrl.h | 362 +
- .../realtek/rtl8192cu/include/rtw_qos.h | 40 +
- .../realtek/rtl8192cu/include/rtw_recv.h | 731 +
- .../realtek/rtl8192cu/include/rtw_rf.h | 152 +
- .../realtek/rtl8192cu/include/rtw_security.h | 447 +
- .../realtek/rtl8192cu/include/rtw_sreset.h | 74 +
- .../realtek/rtl8192cu/include/rtw_tdls.h | 143 +
+ .../realtek/rtl8192cu/include/rtw_qos.h | 39 +
+ .../realtek/rtl8192cu/include/rtw_recv.h | 730 +
+ .../realtek/rtl8192cu/include/rtw_rf.h | 151 +
+ .../realtek/rtl8192cu/include/rtw_security.h | 446 +
+ .../realtek/rtl8192cu/include/rtw_sreset.h | 73 +
+ .../realtek/rtl8192cu/include/rtw_tdls.h | 142 +
.../realtek/rtl8192cu/include/rtw_version.h | 1 +
- .../realtek/rtl8192cu/include/rtw_xmit.h | 754 +
- .../realtek/rtl8192cu/include/sta_info.h | 432 +
- .../realtek/rtl8192cu/include/usb_hal.h | 37 +
- .../realtek/rtl8192cu/include/usb_ops.h | 110 +
- .../realtek/rtl8192cu/include/usb_ops_linux.h | 63 +
- .../realtek/rtl8192cu/include/usb_osintf.h | 38 +
+ .../realtek/rtl8192cu/include/rtw_xmit.h | 753 +
+ .../realtek/rtl8192cu/include/sta_info.h | 431 +
+ .../realtek/rtl8192cu/include/usb_hal.h | 36 +
+ .../realtek/rtl8192cu/include/usb_ops.h | 109 +
+ .../realtek/rtl8192cu/include/usb_ops_linux.h | 62 +
+ .../realtek/rtl8192cu/include/usb_osintf.h | 37 +
.../rtl8192cu/include/usb_vendor_req.h | 59 +
- .../wireless/realtek/rtl8192cu/include/wifi.h | 1248 ++
- .../realtek/rtl8192cu/include/wlan_bssdef.h | 703 +
- .../realtek/rtl8192cu/include/xmit_osdep.h | 95 +
- .../rtl8192cu/os_dep/linux/ioctl_cfg80211.c | 5589 +++++++
- .../rtl8192cu/os_dep/linux/ioctl_linux.c | 11909 ++++++++++++++
- .../rtl8192cu/os_dep/linux/mlme_linux.c | 653 +
- .../realtek/rtl8192cu/os_dep/linux/os_intfs.c | 2768 ++++
- .../realtek/rtl8192cu/os_dep/linux/pci_intf.c | 1997 +++
- .../rtl8192cu/os_dep/linux/pci_ops_linux.c | 24 +
- .../rtl8192cu/os_dep/linux/recv_linux.c | 461 +
- .../rtl8192cu/os_dep/linux/rtw_android.c | 843 +
- .../realtek/rtl8192cu/os_dep/linux/usb_intf.c | 1662 ++
- .../rtl8192cu/os_dep/linux/usb_ops_linux.c | 649 +
- .../rtl8192cu/os_dep/linux/xmit_linux.c | 421 +
- .../realtek/rtl8192cu/os_dep/osdep_service.c | 2300 +++
- drivers/net/wireless/realtek/rtl8192cu/runwpa | 20 +
+ .../wireless/realtek/rtl8192cu/include/wifi.h | 1247 ++
+ .../realtek/rtl8192cu/include/wlan_bssdef.h | 702 +
+ .../realtek/rtl8192cu/include/xmit_osdep.h | 94 +
+ .../rtl8192cu/os_dep/linux/ioctl_cfg80211.c | 5588 +++++++
+ .../rtl8192cu/os_dep/linux/ioctl_linux.c | 11908 ++++++++++++++
+ .../rtl8192cu/os_dep/linux/mlme_linux.c | 652 +
+ .../realtek/rtl8192cu/os_dep/linux/os_intfs.c | 2767 ++++
+ .../realtek/rtl8192cu/os_dep/linux/pci_intf.c | 1996 +++
+ .../rtl8192cu/os_dep/linux/pci_ops_linux.c | 21 +
+ .../rtl8192cu/os_dep/linux/recv_linux.c | 460 +
+ .../rtl8192cu/os_dep/linux/rtw_android.c | 842 +
+ .../realtek/rtl8192cu/os_dep/linux/usb_intf.c | 1661 ++
+ .../rtl8192cu/os_dep/linux/usb_ops_linux.c | 648 +
+ .../rtl8192cu/os_dep/linux/xmit_linux.c | 420 +
+ .../realtek/rtl8192cu/os_dep/osdep_service.c | 2299 +++
+ drivers/net/wireless/realtek/rtl8192cu/runwpa | 18 +
.../net/wireless/realtek/rtl8192cu/wlan0dhcp | 15 +
- 174 files changed, 171747 insertions(+)
+ 174 files changed, 171584 insertions(+)
diff --git a/drivers/net/wireless/realtek/Kconfig b/drivers/net/wireless/realtek/Kconfig
index 3db988e689d7..f28b4520b989 100644
@@ -207,10 +207,10 @@ index 9c78deb5eea9..e5407ed50833 100644
diff --git a/drivers/net/wireless/realtek/rtl8192cu/Kconfig b/drivers/net/wireless/realtek/rtl8192cu/Kconfig
new file mode 100644
-index 000000000000..cd7830bb9d5d
+index 000000000000..47d4465c83f3
--- /dev/null
+++ b/drivers/net/wireless/realtek/rtl8192cu/Kconfig
-@@ -0,0 +1,9 @@
+@@ -0,0 +1,8 @@
+config RTL8192CU
+ tristate "Realtek 8192C USB WiFi"
+ depends on MAC80211 && USB
@@ -219,13 +219,12 @@ index 000000000000..cd7830bb9d5d
+ select WEXT_PRIV
+ ---help---
+ This option adds the Realtek RTL8192CU USB device such as Edimax EW-7811Un.
-+
diff --git a/drivers/net/wireless/realtek/rtl8192cu/Makefile b/drivers/net/wireless/realtek/rtl8192cu/Makefile
new file mode 100644
-index 000000000000..c399011a3e37
+index 000000000000..bc137ab9f261
--- /dev/null
+++ b/drivers/net/wireless/realtek/rtl8192cu/Makefile
-@@ -0,0 +1,616 @@
+@@ -0,0 +1,615 @@
+EXTRA_CFLAGS += $(USER_EXTRA_CFLAGS)
+EXTRA_CFLAGS += -O1
+#EXTRA_CFLAGS += -O3
@@ -616,7 +615,7 @@ index 000000000000..c399011a3e37
+endif
+
+ifeq ($(CONFIG_PLATFORM_FS_MX61), y)
-+EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
++EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
+ARCH := arm
+CROSS_COMPILE := /home/share/CusEnv/FreeScale/arm-eabi-4.4.3/bin/arm-eabi-
+KSRC ?= /home/share/CusEnv/FreeScale/FS_kernel_env
@@ -841,7 +840,6 @@ index 000000000000..c399011a3e37
+ cd os_dep/linux ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
+ cd os_dep ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
+endif
-+
diff --git a/drivers/net/wireless/realtek/rtl8192cu/clean b/drivers/net/wireless/realtek/rtl8192cu/clean
new file mode 100644
index 000000000000..87664218b889
@@ -855,14 +853,14 @@ index 000000000000..87664218b889
+rmmod 8192de
diff --git a/drivers/net/wireless/realtek/rtl8192cu/core/efuse/rtw_efuse.c b/drivers/net/wireless/realtek/rtl8192cu/core/efuse/rtw_efuse.c
new file mode 100755
-index 000000000000..3d341accc9aa
+index 000000000000..c7f2b6705105
--- /dev/null
+++ b/drivers/net/wireless/realtek/rtl8192cu/core/efuse/rtw_efuse.c
-@@ -0,0 +1,1147 @@
+@@ -0,0 +1,1145 @@
+/******************************************************************************
+ *
+ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
-+ *
++ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
@@ -961,7 +959,7 @@ index 000000000000..3d341accc9aa
+/*-----------------------------------------------------------------------------
+ * Function: Efuse_PowerSwitch
+ *
-+ * Overview: When we want to enable write operation, we should change to
++ * Overview: When we want to enable write operation, we should change to
+ * pwr on state. When we stop write, we should switch to 500k mode
+ * and disable LDO 2.5V.
+ *
@@ -983,7 +981,7 @@ index 000000000000..3d341accc9aa
+ IN u8 PwrState)
+{
+ pAdapter->HalFunc.EfusePowerSwitch(pAdapter, bWrite, PwrState);
-+}
++}
+
+/*-----------------------------------------------------------------------------
+ * Function: efuse_GetCurrentSize
@@ -1040,9 +1038,9 @@ index 000000000000..3d341accc9aa
+VOID
+ReadEFuseByte(
+ PADAPTER Adapter,
-+ u16 _offset,
-+ u8 *pbuf,
-+ IN BOOLEAN bPseudoTest)
++ u16 _offset,
++ u8 *pbuf,
++ IN BOOLEAN bPseudoTest)
+{
+ u32 value32;
+ u8 readbyte;
@@ -1056,14 +1054,14 @@ index 000000000000..3d341accc9aa
+ }
+
+ //Write Address
-+ rtw_write8(Adapter, EFUSE_CTRL+1, (_offset & 0xff));
++ rtw_write8(Adapter, EFUSE_CTRL+1, (_offset & 0xff));
+ readbyte = rtw_read8(Adapter, EFUSE_CTRL+2);
-+ rtw_write8(Adapter, EFUSE_CTRL+2, ((_offset >> 8) & 0x03) | (readbyte & 0xfc));
++ rtw_write8(Adapter, EFUSE_CTRL+2, ((_offset >> 8) & 0x03) | (readbyte & 0xfc));
+
+ //Write bit 32 0
-+ readbyte = rtw_read8(Adapter, EFUSE_CTRL+3);
-+ rtw_write8(Adapter, EFUSE_CTRL+3, (readbyte & 0x7f));
-+
++ readbyte = rtw_read8(Adapter, EFUSE_CTRL+3);
++ rtw_write8(Adapter, EFUSE_CTRL+3, (readbyte & 0x7f));
++
+ //Check bit 32 read-ready
+ retry = 0;
+ value32 = rtw_read32(Adapter, EFUSE_CTRL);
@@ -1080,16 +1078,16 @@ index 000000000000..3d341accc9aa
+ // result will always stay on last data we read.
+ rtw_udelay_os(50);
+ value32 = rtw_read32(Adapter, EFUSE_CTRL);
-+
++
+ *pbuf = (u8)(value32 & 0xff);
+ //DBG_871X("ReadEFuseByte _offset:%08u, in %d ms\n",_offset ,rtw_get_passing_time_ms(start));
-+
++
+}
+
+
+//
+// Description:
-+// 1. Execute E-Fuse read byte operation according as map offset and
++// 1. Execute E-Fuse read byte operation according as map offset and
+// save to E-Fuse table.
+// 2. Refered from SD1 Richard.
+//
@@ -1156,8 +1154,8 @@ index 000000000000..3d341accc9aa
+ *
+ *---------------------------------------------------------------------------*/
+u8
-+EFUSE_Read1Byte(
-+ IN PADAPTER Adapter,
++EFUSE_Read1Byte(
++ IN PADAPTER Adapter,
+ IN u16 Address)
+{
+ u8 data;
@@ -1171,12 +1169,12 @@ index 000000000000..3d341accc9aa
+ if (Address < contentLen) //E-fuse 512Byte
+ {
+ //Write E-fuse Register address bit0~7
-+ temp = Address & 0xFF;
-+ rtw_write8(Adapter, EFUSE_CTRL+1, temp);
-+ Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+2);
++ temp = Address & 0xFF;
++ rtw_write8(Adapter, EFUSE_CTRL+1, temp);
++ Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+2);
+ //Write E-fuse Register address bit8~9
-+ temp = ((Address >> 8) & 0x03) | (Bytetemp & 0xFC);
-+ rtw_write8(Adapter, EFUSE_CTRL+2, temp);
++ temp = ((Address >> 8) & 0x03) | (Bytetemp & 0xFC);
++ rtw_write8(Adapter, EFUSE_CTRL+2, temp);
+
+ //Write 0x30[31]=0
+ Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+3);
@@ -1186,7 +1184,7 @@ index 000000000000..3d341accc9aa
+ //Wait Write-ready (0x30[31]=1)
+ Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+3);
+ while(!(Bytetemp & 0x80))
-+ {
++ {
+ Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+3);
+ k++;
+ if(k==1000)
@@ -1200,7 +1198,7 @@ index 000000000000..3d341accc9aa
+ }
+ else
+ return 0xFF;
-+
++
+}/* EFUSE_Read1Byte */
+
+/*-----------------------------------------------------------------------------
@@ -1220,14 +1218,14 @@ index 000000000000..3d341accc9aa
+ *
+ *---------------------------------------------------------------------------*/
+
-+void
-+EFUSE_Write1Byte(
-+ IN PADAPTER Adapter,
++void
++EFUSE_Write1Byte(
++ IN PADAPTER Adapter,
+ IN u16 Address,
+ IN u8 Value);
-+void
-+EFUSE_Write1Byte(
-+ IN PADAPTER Adapter,
++void
++EFUSE_Write1Byte(
++ IN PADAPTER Adapter,
+ IN u16 Address,
+ IN u8 Value)
+{
@@ -1244,13 +1242,13 @@ index 000000000000..3d341accc9aa
+ rtw_write8(Adapter, EFUSE_CTRL, Value);
+
+ //Write E-fuse Register address bit0~7
-+ temp = Address & 0xFF;
-+ rtw_write8(Adapter, EFUSE_CTRL+1, temp);
-+ Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+2);
-+
++ temp = Address & 0xFF;
++ rtw_write8(Adapter, EFUSE_CTRL+1, temp);
++ Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+2);
++
+ //Write E-fuse Register address bit8~9
-+ temp = ((Address >> 8) & 0x03) | (Bytetemp & 0xFC);
-+ rtw_write8(Adapter, EFUSE_CTRL+2, temp);
++ temp = ((Address >> 8) & 0x03) | (Bytetemp & 0xFC);
++ rtw_write8(Adapter, EFUSE_CTRL+2, temp);
+
+ //Write 0x30[31]=1
+ Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+3);
@@ -1261,7 +1259,7 @@ index 000000000000..3d341accc9aa
+ Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+3);
+ while(Bytetemp & 0x80)
+ {
-+ Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+3);
++ Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+3);
+ k++;
+ if(k==100)
+ {
@@ -1275,7 +1273,7 @@ index 000000000000..3d341accc9aa
+/* 11/16/2008 MH Read one byte from real Efuse. */
+u8
+efuse_OneByteRead(
-+ IN PADAPTER pAdapter,
++ IN PADAPTER pAdapter,
+ IN u16 addr,
+ IN u8 *data,
+ IN BOOLEAN bPseudoTest)
@@ -1289,35 +1287,35 @@ index 000000000000..3d341accc9aa
+ return bResult;
+ }
+ // -----------------e-fuse reg ctrl ---------------------------------
-+ //address
-+ rtw_write8(pAdapter, EFUSE_CTRL+1, (u8)(addr&0xff));
-+ rtw_write8(pAdapter, EFUSE_CTRL+2, ((u8)((addr>>8) &0x03) ) |
-+ (rtw_read8(pAdapter, EFUSE_CTRL+2)&0xFC ));
++ //address
++ rtw_write8(pAdapter, EFUSE_CTRL+1, (u8)(addr&0xff));
++ rtw_write8(pAdapter, EFUSE_CTRL+2, ((u8)((addr>>8) &0x03) ) |
++ (rtw_read8(pAdapter, EFUSE_CTRL+2)&0xFC ));
+
-+ rtw_write8(pAdapter, EFUSE_CTRL+3, 0x72);//read cmd
++ rtw_write8(pAdapter, EFUSE_CTRL+3, 0x72);//read cmd
+
+ while(!(0x80 &rtw_read8(pAdapter, EFUSE_CTRL+3))&&(tmpidx<100))
+ {
+ tmpidx++;
+ }
+ if(tmpidx<100)
-+ {
-+ *data=rtw_read8(pAdapter, EFUSE_CTRL);
++ {
++ *data=rtw_read8(pAdapter, EFUSE_CTRL);
+ bResult = _TRUE;
+ }
+ else
+ {
-+ *data = 0xff;
++ *data = 0xff;
+ bResult = _FALSE;
+ }
+ return bResult;
+}
-+
++
+/* 11/16/2008 MH Write one byte to reald Efuse. */
+u8
+efuse_OneByteWrite(
-+ IN PADAPTER pAdapter,
-+ IN u16 addr,
++ IN PADAPTER pAdapter,
++ IN u16 addr,
+ IN u8 data,
+ IN BOOLEAN bPseudoTest)
+{
@@ -1333,29 +1331,29 @@ index 000000000000..3d341accc9aa
+
+ //return 0;
+
-+ // -----------------e-fuse reg ctrl ---------------------------------
-+ //address
++ // -----------------e-fuse reg ctrl ---------------------------------
++ //address
+ rtw_write8(pAdapter, EFUSE_CTRL+1, (u8)(addr&0xff));
-+ rtw_write8(pAdapter, EFUSE_CTRL+2,
-+ (rtw_read8(pAdapter, EFUSE_CTRL+2)&0xFC )|(u8)((addr>>8)&0x03) );
-+ rtw_write8(pAdapter, EFUSE_CTRL, data);//data
++ rtw_write8(pAdapter, EFUSE_CTRL+2,
++ (rtw_read8(pAdapter, EFUSE_CTRL+2)&0xFC )|(u8)((addr>>8)&0x03) );
++ rtw_write8(pAdapter, EFUSE_CTRL, data);//data
+
+ rtw_write8(pAdapter, EFUSE_CTRL+3, 0xF2);//write cmd
-+
++
+ while((0x80 & rtw_read8(pAdapter, EFUSE_CTRL+3)) && (tmpidx<100) ){
+ tmpidx++;
+ }
-+
++
+ if(tmpidx<100)
-+ {
++ {
+ bResult = _TRUE;
+ }
+ else
-+ {
++ {
+ bResult = _FALSE;
-+ }
-+
-+ return bResult;
++ }
++
++ return bResult;
+}
+
+int
@@ -1371,8 +1369,8 @@ index 000000000000..3d341accc9aa
+ return ret;
+}
+
-+int
-+Efuse_PgPacketWrite(IN PADAPTER pAdapter,
++int
++Efuse_PgPacketWrite(IN PADAPTER pAdapter,
+ IN u8 offset,
+ IN u8 word_en,
+ IN u8 *data,
@@ -1406,7 +1404,7 @@ index 000000000000..3d341accc9aa
+efuse_WordEnableDataRead(IN u8 word_en,
+ IN u8 *sourdata,
+ IN u8 *targetdata)
-+{
++{
+ if (!(word_en&BIT(0)))
+ {
+ targetdata[0] = sourdata[0];
@@ -1433,14 +1431,14 @@ index 000000000000..3d341accc9aa
+u8
+Efuse_WordEnableDataWrite( IN PADAPTER pAdapter,
+ IN u16 efuse_addr,
-+ IN u8 word_en,
++ IN u8 word_en,
+ IN u8 *data,
+ IN BOOLEAN bPseudoTest)
+{
+ u8 ret=0;
+
+ ret = pAdapter->HalFunc.Efuse_WordEnableDataWrite(pAdapter, efuse_addr, word_en, data, bPseudoTest);
-+
++
+ return ret;
+}
+
@@ -1642,15 +1640,15 @@ index 000000000000..3d341accc9aa
+ * 11/11/2008 MHC Create Version 0.
+ *
+ *---------------------------------------------------------------------------*/
-+VOID
++VOID
+Efuse_ReadAllMap(
-+ IN PADAPTER pAdapter,
++ IN PADAPTER pAdapter,
+ IN u8 efuseType,
+ IN OUT u8 *Efuse,
+ IN BOOLEAN bPseudoTest);
-+VOID
++VOID
+Efuse_ReadAllMap(
-+ IN PADAPTER pAdapter,
++ IN PADAPTER pAdapter,
+ IN u8 efuseType,
+ IN OUT u8 *Efuse,
+ IN BOOLEAN bPseudoTest)
@@ -1826,19 +1824,19 @@ index 000000000000..3d341accc9aa
+ }
+ else
+ {
-+ #ifdef CONFIG_ADAPTOR_INFO_CACHING_FILE
++ #ifdef CONFIG_ADAPTOR_INFO_CACHING_FILE
+ if(_SUCCESS != retriveAdaptorInfoFile(pAdapter->registrypriv.adaptor_info_caching_file_path, pEEPROM)) {
+ #endif
-+
++
+ Efuse_ReadAllMap(pAdapter, efuseType, pEEPROM->efuse_eeprom_data, bPseudoTest);
-+
++
+ #ifdef CONFIG_ADAPTOR_INFO_CACHING_FILE
+ storeAdaptorInfoFile(pAdapter->registrypriv.adaptor_info_caching_file_path, pEEPROM);
+ }
+ #endif
+ }
+
-+ //PlatformMoveMemory((PVOID)&pHalData->EfuseMap[EFUSE_MODIFY_MAP][0],
++ //PlatformMoveMemory((PVOID)&pHalData->EfuseMap[EFUSE_MODIFY_MAP][0],
+ //(PVOID)&pHalData->EfuseMap[EFUSE_INIT_MAP][0], mapLen);
+}// EFUSE_ShadowMapUpdate
+
@@ -1872,7 +1870,7 @@ index 000000000000..3d341accc9aa
+ efuse_ShadowRead2Byte(pAdapter, Offset, (u16 *)Value);
+ else if (Type == 4)
+ efuse_ShadowRead4Byte(pAdapter, Offset, (u32 *)Value);
-+
++
+} // EFUSE_ShadowRead
+
+/*-----------------------------------------------------------------------------
@@ -1927,7 +1925,7 @@ index 000000000000..3d341accc9aa
+ )
+{
+ u8 i;
-+
++
+ _rtw_memset((PVOID)&fakeEfuseContent[0], 0xff, EFUSE_MAX_HW_SIZE);
+ _rtw_memset((PVOID)&fakeEfuseInitMap[0], 0xff, EFUSE_MAX_MAP_LEN);
+ _rtw_memset((PVOID)&fakeEfuseModifiedMap[0], 0xff, EFUSE_MAX_MAP_LEN);
@@ -1978,24 +1976,24 @@ index 000000000000..3d341accc9aa
+ int ret = _SUCCESS;
+ mm_segment_t oldfs;
+ struct file *fp;
-+
++
+ if(path && eeprom_priv) {
+
+ ret = rtw_retrive_from_file(path, eeprom_priv->efuse_eeprom_data, EEPROM_MAX_SIZE);
-+
++
+ if(ret == EEPROM_MAX_SIZE)
+ ret = _SUCCESS;
+ else
+ ret = _FAIL;
+
+ #if 0
-+ if(isAdaptorInfoFileValid()) {
++ if(isAdaptorInfoFileValid()) {
+ return 0;
+ } else {
+ return _FAIL;
+ }
+ #endif
-+
++
+ } else {
+ DBG_871X("%s NULL pointer\n",__FUNCTION__);
+ ret = _FAIL;
@@ -2004,18 +2002,16 @@ index 000000000000..3d341accc9aa
+}
+#endif //CONFIG_ADAPTOR_INFO_CACHING_FILE
+#endif //PLATFORM_LINUX
-+
-+
diff --git a/drivers/net/wireless/realtek/rtl8192cu/core/rtw_ap.c b/drivers/net/wireless/realtek/rtl8192cu/core/rtw_ap.c
new file mode 100755
-index 000000000000..14576dd191f3
+index 000000000000..e2403d2bc325
--- /dev/null
+++ b/drivers/net/wireless/realtek/rtl8192cu/core/rtw_ap.c
-@@ -0,0 +1,2943 @@
+@@ -0,0 +1,2942 @@
+/******************************************************************************
+ *
+ * Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved.
-+ *
++ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
@@ -2051,13 +2047,13 @@ index 000000000000..14576dd191f3
+{
+ struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
+ struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
-+ struct sta_priv *pstapriv = &padapter->stapriv;
++ struct sta_priv *pstapriv = &padapter->stapriv;
+ struct wlan_acl_pool *pacl_list = &pstapriv->acl_list;
-+
+
-+ _rtw_spinlock_init(&pmlmepriv->bcn_update_lock);
+
-+ //for ACL
++ _rtw_spinlock_init(&pmlmepriv->bcn_update_lock);
++
++ //for ACL
+ _rtw_init_queue(&pacl_list->acl_node_q);
+
+ //pmlmeext->bstart_bss = _FALSE;
@@ -2077,8 +2073,8 @@ index 000000000000..14576dd191f3
+ //stop_ap_mode(padapter);
+
+ pmlmepriv->update_bcn = _FALSE;
-+ pmlmeext->bstart_bss = _FALSE;
-+
++ pmlmeext->bstart_bss = _FALSE;
++
+ rtw_sta_flush(padapter);
+
+ pmlmeinfo->state = _HW_STATE_NOLINK_;
@@ -2087,14 +2083,14 @@ index 000000000000..14576dd191f3
+ rtw_free_all_stainfo(padapter);
+
+ //free bc/mc sta_info
-+ psta = rtw_get_bcmc_stainfo(padapter);
-+ _enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
++ psta = rtw_get_bcmc_stainfo(padapter);
++ _enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
+ rtw_free_stainfo(padapter, psta);
+ _exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
-+
++
+
+ _rtw_spinlock_free(&pmlmepriv->bcn_update_lock);
-+
++
+}
+
+static void update_BCNTIM(_adapter *padapter)
@@ -2106,26 +2102,26 @@ index 000000000000..14576dd191f3
+ unsigned char *pie = pnetwork_mlmeext->IEs;
+
+ //DBG_871X("%s\n", __FUNCTION__);
-+
++
+ //update TIM IE
+ //if(pstapriv->tim_bitmap)
+ if(_TRUE)
+ {
+ u8 *p, *dst_ie, *premainder_ie=NULL, *pbackup_remainder_ie=NULL;
+ u16 tim_bitmap_le;
-+ uint offset, tmp_len, tim_ielen, tim_ie_offset, remainder_ielen;
-+
++ uint offset, tmp_len, tim_ielen, tim_ie_offset, remainder_ielen;
++
+ tim_bitmap_le = cpu_to_le16(pstapriv->tim_bitmap);
+
+ p = rtw_get_ie(pie + _FIXED_IE_LENGTH_, _TIM_IE_, &tim_ielen, pnetwork_mlmeext->IELength - _FIXED_IE_LENGTH_);
+ if (p != NULL && tim_ielen>0)
+ {
+ tim_ielen += 2;
-+
++
+ premainder_ie = p+tim_ielen;
+
+ tim_ie_offset = (sint)(p -pie);
-+
++
+ remainder_ielen = pnetwork_mlmeext->IELength - tim_ie_offset - tim_ielen;
+
+ //append TIM IE from dst_ie offset
@@ -2135,7 +2131,7 @@ index 000000000000..14576dd191f3
+ {
+ tim_ielen = 0;
+
-+ //calucate head_len
++ //calucate head_len
+ offset = _FIXED_IE_LENGTH_;
+
+ /* get ssid_ie len */
@@ -2144,73 +2140,73 @@ index 000000000000..14576dd191f3
+ offset += tmp_len+2;
+
+ // get supported rates len
-+ p = rtw_get_ie(pie + _BEACON_IE_OFFSET_, _SUPPORTEDRATES_IE_, &tmp_len, (pnetwork_mlmeext->IELength - _BEACON_IE_OFFSET_));
-+ if (p != NULL)
-+ {
++ p = rtw_get_ie(pie + _BEACON_IE_OFFSET_, _SUPPORTEDRATES_IE_, &tmp_len, (pnetwork_mlmeext->IELength - _BEACON_IE_OFFSET_));
++ if (p != NULL)
++ {
+ offset += tmp_len+2;
+ }
+
-+ //DS Parameter Set IE, len=3
++ //DS Parameter Set IE, len=3
+ offset += 3;
+
+ premainder_ie = pie + offset;
+
-+ remainder_ielen = pnetwork_mlmeext->IELength - offset - tim_ielen;
++ remainder_ielen = pnetwork_mlmeext->IELength - offset - tim_ielen;
+
+ //append TIM IE from offset
+ dst_ie = pie + offset;
-+
++
+ }
+
-+
++
+ if(remainder_ielen>0)
+ {
+ pbackup_remainder_ie = rtw_malloc(remainder_ielen);
+ if(pbackup_remainder_ie && premainder_ie)
+ _rtw_memcpy(pbackup_remainder_ie, premainder_ie, remainder_ielen);
-+ }
++ }
+
+ *dst_ie++=_TIM_IE_;
+
-+ if((pstapriv->tim_bitmap&0xff00) && (pstapriv->tim_bitmap&0x00fc))
++ if((pstapriv->tim_bitmap&0xff00) && (pstapriv->tim_bitmap&0x00fc))
+ tim_ielen = 5;
+ else
+ tim_ielen = 4;
+
+ *dst_ie++= tim_ielen;
-+
++
+ *dst_ie++=0;//DTIM count
+ *dst_ie++=1;//DTIM peroid
-+
++
+ if(pstapriv->tim_bitmap&BIT(0))//for bc/mc frames
-+ *dst_ie++ = BIT(0);//bitmap ctrl
++ *dst_ie++ = BIT(0);//bitmap ctrl
+ else
+ *dst_ie++ = 0;
+
+ if(tim_ielen==4)
+ {
+ *dst_ie++ = *(u8*)&tim_bitmap_le;
-+ }
++ }
+ else if(tim_ielen==5)
+ {
+ _rtw_memcpy(dst_ie, &tim_bitmap_le, 2);
-+ dst_ie+=2;
-+ }
-+
++ dst_ie+=2;
++ }
++
+ //copy remainder IE
+ if(pbackup_remainder_ie)
+ {
+ _rtw_memcpy(dst_ie, pbackup_remainder_ie, remainder_ielen);
+
+ rtw_mfree(pbackup_remainder_ie, remainder_ielen);
-+ }
++ }
+
+ offset = (uint)(dst_ie - pie);
+ pnetwork_mlmeext->IELength = offset + remainder_ielen;
-+
++
+ }
+
-+#ifndef CONFIG_INTERRUPT_BASED_TXBCN
++#ifndef CONFIG_INTERRUPT_BASED_TXBCN
+#if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI)
+ set_tx_beacon_cmd(padapter);
+#endif
@@ -2251,11 +2247,11 @@ index 000000000000..14576dd191f3
+ if (p != NULL && ielen>0)
+ {
+ ielen += 2;
-+
++
+ premainder_ie = p+ielen;
+
+ ie_offset = (sint)(p -pie);
-+
++
+ remainder_ielen = pnetwork->IELength - ie_offset - ielen;
+
+ if(bmatch)
@@ -2302,11 +2298,11 @@ index 000000000000..14576dd191f3
+ if (p != NULL && ielen>0)
+ {
+ ielen += 2;
-+
++
+ premainder_ie = p+ielen;
+
+ ie_offset = (sint)(p -pie);
-+
++
+ remainder_ielen = pnetwork->IELength - ie_offset - ielen;
+
+ dst_ie = p;
@@ -2375,14 +2371,14 @@ index 000000000000..14576dd191f3
+ _irqL irqL;
+ _list *phead, *plist;
+ u8 updated = _FALSE;
-+ struct sta_info *psta=NULL;
++ struct sta_info *psta=NULL;
+ struct sta_priv *pstapriv = &padapter->stapriv;
+ u8 chk_alive_num = 0;
+ char chk_alive_list[NUM_STA];
+ int i;
+
+ _enter_critical_bh(&pstapriv->auth_list_lock, &irqL);
-+
++
+ phead = &pstapriv->auth_list;
+ plist = get_next(phead);
+
@@ -2393,41 +2389,41 @@ index 000000000000..14576dd191f3
+ , FUNC_NDEV_ARG(padapter->pnetdev), pstapriv->auth_list_cnt);
+ }
+ #endif
-+ while ((rtw_end_of_queue_search(phead, plist)) == _FALSE)
++ while ((rtw_end_of_queue_search(phead, plist)) == _FALSE)
+ {
+ psta = LIST_CONTAINOR(plist, struct sta_info, auth_list);
+ plist = get_next(plist);
-+
++
+ if(psta->expire_to>0)
+ {
+ psta->expire_to--;
+ if (psta->expire_to == 0)
-+ {
++ {
+ rtw_list_delete(&psta->auth_list);
+ pstapriv->auth_list_cnt--;
-+
++
+ DBG_871X("auth expire %02X%02X%02X%02X%02X%02X\n",
+ psta->hwaddr[0],psta->hwaddr[1],psta->hwaddr[2],psta->hwaddr[3],psta->hwaddr[4],psta->hwaddr[5]);
-+
++
+ _exit_critical_bh(&pstapriv->auth_list_lock, &irqL);
-+
-+ _enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
++
++ _enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
+ rtw_free_stainfo(padapter, psta);
-+ _exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
-+
++ _exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
++
+ _enter_critical_bh(&pstapriv->auth_list_lock, &irqL);
-+ }
-+ }
-+
++ }
++ }
++
+ }
+
+ _exit_critical_bh(&pstapriv->auth_list_lock, &irqL);
+
+ psta = NULL;
-+
++
+
+ _enter_critical_bh(&pstapriv->asoc_list_lock, &irqL);
-+
++
+ phead = &pstapriv->asoc_list;
+ plist = get_next(phead);
+
@@ -2442,7 +2438,7 @@ index 000000000000..14576dd191f3
+ {
+ psta = LIST_CONTAINOR(plist, struct sta_info, asoc_list);
+ plist = get_next(plist);
-+
++
+ if (chk_sta_is_alive(psta) || !psta->expire_to) {
+ psta->expire_to = pstapriv->expire_to;
+ psta->keep_alive_trycnt = 0;
@@ -2456,10 +2452,10 @@ index 000000000000..14576dd191f3
+#ifndef CONFIG_ACTIVE_KEEP_ALIVE_CHECK
+#ifdef CONFIG_TX_MCAST2UNI
+ if ( (psta->flags & WLAN_STA_HT) && (psta->htpriv.agg_enable_bitmap || psta->under_exist_checking) ) {
-+ // check sta by delba(addba) for 11n STA
++ // check sta by delba(addba) for 11n STA
+ // ToDo: use CCX report to check for all STAs
+ //DBG_871X("asoc check by DELBA/ADDBA! (pstapriv->expire_to=%d s)(psta->expire_to=%d s), [%02x, %d]\n", pstapriv->expire_to*2, psta->expire_to*2, psta->htpriv.agg_enable_bitmap, psta->under_exist_checking);
-+
++
+ if ( psta->expire_to <= (pstapriv->expire_to - 50 ) ) {
+ DBG_871X("asoc expire by DELBA/ADDBA! (%d s)\n", (pstapriv->expire_to-psta->expire_to)*2);
+ psta->under_exist_checking = 0;
@@ -2489,7 +2485,7 @@ index 000000000000..14576dd191f3
+
+ if (psta->state & WIFI_SLEEP_STATE) {
+ if (!(psta->state & WIFI_STA_ALIVE_CHK_STATE)) {
-+ //to check if alive by another methods if staion is at ps mode.
++ //to check if alive by another methods if staion is at ps mode.
+ psta->expire_to = pstapriv->expire_to;
+ psta->state |= WIFI_STA_ALIVE_CHK_STATE;
+
@@ -2521,7 +2517,7 @@ index 000000000000..14576dd191f3
+
+ DBG_871X("asoc expire "MAC_FMT", state=0x%x\n", MAC_ARG(psta->hwaddr), psta->state);
+ updated = ap_free_sta(padapter, psta, _FALSE, WLAN_REASON_DEAUTH_LEAVING);
-+ }
++ }
+ else
+ {
+ /* TODO: Aging mechanism to digest frames in sleep_q to avoid running out of xmitframe */
@@ -2551,12 +2547,12 @@ index 000000000000..14576dd191f3
+
+ /* issue null data to check sta alive*/
+ for (i = 0; i < chk_alive_num; i++) {
-+
++
+ int ret = _FAIL;
+
+ psta = rtw_get_stainfo_by_offset(pstapriv, chk_alive_list[i]);
+ if(!(psta->state &_FW_LINKED))
-+ continue;
++ continue;
+
+ if (psta->state & WIFI_SLEEP_STATE)
+ ret = issue_nulldata(padapter, psta->hwaddr, 0, 1, 50);
@@ -2601,24 +2597,24 @@ index 000000000000..14576dd191f3
+
+
+static void add_RATid(_adapter *padapter, struct sta_info *psta)
-+{
++{
+ int i;
+ u8 rf_type;
+ u32 init_rate=0;
+ unsigned char sta_band = 0, raid, shortGIrate = _FALSE;
-+ unsigned char limit;
++ unsigned char limit;
+ unsigned int tx_ra_bitmap=0;
+ struct ht_priv *psta_ht = NULL;
+ struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
-+ WLAN_BSSID_EX *pcur_network = (WLAN_BSSID_EX *)&pmlmepriv->cur_network.network;
++ WLAN_BSSID_EX *pcur_network = (WLAN_BSSID_EX *)&pmlmepriv->cur_network.network;
++
+
-+
+ if(psta)
+ psta_ht = &psta->htpriv;
+ else
+ return;
-+
-+ //b/g mode ra_bitmap
++
++ //b/g mode ra_bitmap
+ for (i=0; i<sizeof(psta->bssrateset); i++)
+ {
+ if (psta->bssrateset[i])
@@ -2626,7 +2622,7 @@ index 000000000000..14576dd191f3
+ }
+
+ //n mode ra_bitmap
-+ if(psta_ht->ht_option)
++ if(psta_ht->ht_option)
+ {
+ rtw_hal_get_hwreg(padapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type));
+ if(rf_type == RF_2T2R)
@@ -2658,8 +2654,8 @@ index 000000000000..14576dd191f3
+ Switch_1SS_Antenna(priv, 3);
+ }
+ }
-+ else// bg or 1R STA?
-+ {
++ else// bg or 1R STA?
++ {
+ if((priv->pmib->dot11BssType.net_work_type & WIRELESS_11N) && pstat->ht_cap_len && priv->pshare->has_2r_sta == 0)
+ {
+ if(rtw_read16(padapter, 0x102501f6) != 0x7777)
@@ -2670,10 +2666,10 @@ index 000000000000..14576dd191f3
+ }
+ }
+ }
-+
++
+ }
+
-+ if ((pstat->rssi_level < 1) || (pstat->rssi_level > 3))
++ if ((pstat->rssi_level < 1) || (pstat->rssi_level > 3))
+ {
+ if (pstat->rssi >= priv->pshare->rf_ft_var.raGoDownUpper)
+ pstat->rssi_level = 1;
@@ -2707,7 +2703,7 @@ index 000000000000..14576dd191f3
+ break;
+ }
+ }
-+ else
++ else
+ {
+ switch (pstat->rssi_level) {
+ case 1:
@@ -2748,7 +2744,7 @@ index 000000000000..14576dd191f3
+ break;
+ }
+ }
-+ else
++ else
+ {
+ pstat->tx_ra_bitmap &= 0x0000000d;
+ }
@@ -2759,7 +2755,7 @@ index 000000000000..14576dd191f3
+ if ((!(pstat->tx_ra_bitmap & 0x8000000) && (priv->pshare->has_2r_sta > 0) && (get_rf_mimo_mode(padapter) == RTL8712_RF_2T2R)) ||
+ (!(pstat->tx_ra_bitmap & 0x80000) && (get_rf_mimo_mode(padapter) != RTL8712_RF_2T2R)))
+ {
-+ pstat->tx_ra_bitmap &= ~BIT(28);
++ pstat->tx_ra_bitmap &= ~BIT(28);
+ }
+#endif
+
@@ -2778,23 +2774,23 @@ index 000000000000..14576dd191f3
+ sta_band |= WIRELESS_11B;
+ }
+
-+ raid = networktype_to_raid(sta_band);
++ raid = networktype_to_raid(sta_band);
+ init_rate = get_highest_rate_idx(tx_ra_bitmap&0x0fffffff)&0x3f;
-+
-+ if (psta->aid < NUM_STA)
++
++ if (psta->aid < NUM_STA)
+ {
+ u8 arg = 0;
+
+ arg = psta->mac_id&0x1f;
-+
++
+ arg |= BIT(7);//support entry 2~31
-+
++
+ if (shortGIrate==_TRUE)
+ arg |= BIT(5);
+
+ tx_ra_bitmap |= ((raid<<28)&0xf0000000);
+
-+ DBG_871X("%s=> mac_id:%d , raid:%d , bitmap=0x%x, arg=0x%x\n",
++ DBG_871X("%s=> mac_id:%d , raid:%d , bitmap=0x%x, arg=0x%x\n",
+ __FUNCTION__ , psta->mac_id, raid ,tx_ra_bitmap, arg);
+
+ //bitmap[0:27] = tx_rate_bitmap
@@ -2805,13 +2801,13 @@ index 000000000000..14576dd191f3
+
+ if (shortGIrate==_TRUE)
+ init_rate |= BIT(6);
-+
++
+ //set ra_id, init_rate
+ psta->raid = raid;
+ psta->init_rate = init_rate;
-+
++
+ }
-+ else
++ else
+ {
+ DBG_871X("station aid %d exceed the max number\n", psta->aid);
+ }
@@ -2823,19 +2819,19 @@ index 000000000000..14576dd191f3
+ _irqL irqL;
+ u32 init_rate=0;
+ unsigned char network_type, raid;
-+ int i, supportRateNum = 0;
++ int i, supportRateNum = 0;
+ unsigned int tx_ra_bitmap=0;
+ struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
-+ WLAN_BSSID_EX *pcur_network = (WLAN_BSSID_EX *)&pmlmepriv->cur_network.network;
++ WLAN_BSSID_EX *pcur_network = (WLAN_BSSID_EX *)&pmlmepriv->cur_network.network;
+ struct sta_info *psta = rtw_get_bcmc_stainfo(padapter);
+
+ if(psta)
+ {
+ psta->aid = 0;//default set to 0
-+ //psta->mac_id = psta->aid+4;
++ //psta->mac_id = psta->aid+4;
+ psta->mac_id = psta->aid + 1;
+
-+ psta->qos_option = 0;
++ psta->qos_option = 0;
+ psta->htpriv.ht_option = _FALSE;
+
+ psta->ieee8021x_blocked = 0;
@@ -2846,16 +2842,16 @@ index 000000000000..14576dd191f3
+
+ +
+
-+ //prepare for add_RATid
++ //prepare for add_RATid
+ supportRateNum = rtw_get_rateset_len((u8*)&pcur_network->SupportedRates);
+ network_type = rtw_check_network_type((u8*)&pcur_network->SupportedRates, supportRateNum, 1);
-+
++
+ _rtw_memcpy(psta->bssrateset, &pcur_network->SupportedRates, supportRateNum);
+ psta->bssratelen = supportRateNum;
+
-+ //b/g mode ra_bitmap
++ //b/g mode ra_bitmap
+ for (i=0; i<supportRateNum; i++)
-+ {
++ {
+ if (psta->bssrateset[i])
+ tx_ra_bitmap |= rtw_get_bit_value_from_ieee_value(psta->bssrateset[i]&0x7f);
+ }
@@ -2865,16 +2861,16 @@ index 000000000000..14576dd191f3
+ network_type = WIRELESS_11A;
+ tx_ra_bitmap = 0x150; // 6, 12, 24 Mbps
+ } else {
-+ //force to b mode
++ //force to b mode
+ network_type = WIRELESS_11B;
-+ tx_ra_bitmap = 0xf;
++ tx_ra_bitmap = 0xf;
+ }
+
+ //tx_ra_bitmap = update_basic_rate(pcur_network->SupportedRates, supportRateNum);
+
+ raid = networktype_to_raid(network_type);
+ init_rate = get_highest_rate_idx(tx_ra_bitmap&0x0fffffff)&0x3f;
-+
++
+ //DBG_871X("Add id %d val %08x to ratr for bmc sta\n", psta->aid, tx_ra_bitmap);
+
+ //if(pHalData->fw_ractrl == _TRUE)
@@ -2882,13 +2878,13 @@ index 000000000000..14576dd191f3
+ u8 arg = 0;
+
+ arg = psta->mac_id&0x1f;
-+
++
+ arg |= BIT(7);
-+
++
+ //if (shortGIrate==_TRUE)
+ // arg |= BIT(5);
-+
-+ tx_ra_bitmap |= ((raid<<28)&0xf0000000);
++
++ tx_ra_bitmap |= ((raid<<28)&0xf0000000);
+
+ DBG_871X("update_bmc_sta, mask=0x%x, arg=0x%x\n", tx_ra_bitmap, arg);
+
@@ -2896,14 +2892,14 @@ index 000000000000..14576dd191f3
+ //bitmap[28:31]= Rate Adaptive id
+ //arg[0:4] = macid
+ //arg[5] = Short GI
-+ rtw_hal_add_ra_tid(padapter, tx_ra_bitmap, arg);
-+
++ rtw_hal_add_ra_tid(padapter, tx_ra_bitmap, arg);
++
+ }
+
+ //set ra_id, init_rate
+ psta->raid = raid;
+ psta->init_rate = init_rate;
-+
++
+ _enter_critical_bh(&psta->lock, &irqL);
+ psta->state = _FW_LINKED;
+ _exit_critical_bh(&psta->lock, &irqL);
@@ -2913,18 +2909,18 @@ index 000000000000..14576dd191f3
+ {
+ DBG_871X("add_RATid_bmc_sta error!\n");
+ }
-+
++
+}
+
+//notes:
-+//AID: 1~MAX for sta and 0 for bc/mc in ap/adhoc mode
-+//MAC_ID = AID+1 for sta in ap/adhoc mode
++//AID: 1~MAX for sta and 0 for bc/mc in ap/adhoc mode
++//MAC_ID = AID+1 for sta in ap/adhoc mode
+//MAC_ID = 1 for bc/mc for sta/ap/adhoc
+//MAC_ID = 0 for bssid for sta/ap/adhoc
+//CAM_ID = //0~3 for default key, cmd_id=macid + 3, macid=aid+1;
+
+void update_sta_info_apmode(_adapter *padapter, struct sta_info *psta)
-+{
++{
+ _irqL irqL;
+ struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
+ struct security_priv *psecuritypriv = &padapter->securitypriv;
@@ -2936,19 +2932,19 @@ index 000000000000..14576dd191f3
+ //psta->intf_tag = 0;
+
+ //psta->mac_id = psta->aid+4;
-+ psta->mac_id = psta->aid+1;
-+
++ psta->mac_id = psta->aid+1;
++
+ if(psecuritypriv->dot11AuthAlgrthm==dot11AuthAlgrthm_8021X)
+ psta->ieee8021x_blocked = _TRUE;
+ else
+ psta->ieee8021x_blocked = _FALSE;
-+
++
+
+ //update sta's cap
-+
++
+ //ERP
+ VCS_update(padapter, psta);
-+
++
+ //HT related cap
+ if(phtpriv_sta->ht_option)
+ {
@@ -2967,16 +2963,16 @@ index 000000000000..14576dd191f3
+ //phtpriv_sta->bwmode = HT_CHANNEL_WIDTH_40;
+ phtpriv_sta->bwmode = pmlmeext->cur_bwmode;
+ phtpriv_sta->ch_offset = pmlmeext->cur_ch_offset;
-+
-+ }
++
++ }
+
+ psta->qos_option = _TRUE;
-+
++
+ }
+ else
+ {
+ phtpriv_sta->ampdu_enable = _FALSE;
-+
++
+ phtpriv_sta->sgi = _FALSE;
+ phtpriv_sta->bwmode = HT_CHANNEL_WIDTH_20;
+ phtpriv_sta->ch_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE;
@@ -2984,15 +2980,15 @@ index 000000000000..14576dd191f3
+
+ //Rx AMPDU
+ send_delba(padapter, 0, psta->hwaddr);// recipient
-+
++
+ //TX AMPDU
+ send_delba(padapter, 1, psta->hwaddr);// // originator
+ phtpriv_sta->agg_enable_bitmap = 0x0;//reset
+ phtpriv_sta->candidate_tid_bitmap = 0x0;//reset
-+
++
+
+ //todo: init other variables
-+
++
+ _rtw_memset((void*)&psta->sta_stats, 0, sizeof(struct stainfo_stats));
+
+
@@ -3003,7 +2999,7 @@ index 000000000000..14576dd191f3
+ _enter_critical_bh(&psta->lock, &irqL);
+ psta->state |= _FW_LINKED;
+ _exit_critical_bh(&psta->lock, &irqL);
-+
++
+
+}
+
@@ -3014,18 +3010,18 @@ index 000000000000..14576dd191f3
+ struct registry_priv *pregpriv = &padapter->registrypriv;
+ struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
+ struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
-+
++
+ DBG_871X("%s\n", __FUNCTION__);
-+
++
+
+ //handle A-MPDU parameter field
-+ /*
++ /*
+ AMPDU_para [1:0]:Max AMPDU Len => 0:8k , 1:16k, 2:32k, 3:64k
-+ AMPDU_para [4:2]:Min MPDU Start Spacing
++ AMPDU_para [4:2]:Min MPDU Start Spacing
+ */
-+ max_AMPDU_len = pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & 0x03;
-+
-+ min_MPDU_spacing = (pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & 0x1c) >> 2;
++ max_AMPDU_len = pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & 0x03;
++
++ min_MPDU_spacing = (pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & 0x1c) >> 2;
+
+ rtw_hal_set_hwreg(padapter, HW_VAR_AMPDU_MIN_SPACE, (u8 *)(&min_MPDU_spacing));
+
@@ -3058,11 +3054,11 @@ index 000000000000..14576dd191f3
+ u8 *p;
+ u8 val8, cur_channel, cur_bwmode, cur_ch_offset;
+ u16 bcn_interval;
-+ u32 acparm;
-+ int ie_len;
++ u32 acparm;
++ int ie_len;
+ struct registry_priv *pregpriv = &padapter->registrypriv;
+ struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
-+ struct security_priv* psecuritypriv=&(padapter->securitypriv);
++ struct security_priv* psecuritypriv=&(padapter->securitypriv);
+ WLAN_BSSID_EX *pnetwork = (WLAN_BSSID_EX *)&pmlmepriv->cur_network.network;
+ struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
+ struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
@@ -3075,13 +3071,13 @@ index 000000000000..14576dd191f3
+ u8 change_band = _FALSE;
+ //DBG_871X("%s\n", __FUNCTION__);
+
-+ bcn_interval = (u16)pnetwork->Configuration.BeaconPeriod;
++ bcn_interval = (u16)pnetwork->Configuration.BeaconPeriod;
+ cur_channel = pnetwork->Configuration.DSConfig;
+ cur_bwmode = HT_CHANNEL_WIDTH_20;;
+ cur_ch_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE;
-+
+
-+ //check if there is wps ie,
++
++ //check if there is wps ie,
+ //if there is wpsie in beacon, the hostapd will update beacon twice when stating hostapd,
+ //and at first time the security ie ( RSN/WPA IE) will not include in beacon.
+ if(NULL == rtw_get_wps_ie(pnetwork->IEs+_FIXED_IE_LENGTH_, pnetwork->IELength-_FIXED_IE_LENGTH_, NULL, NULL))
@@ -3104,18 +3100,18 @@ index 000000000000..14576dd191f3
+
+ update_hw_ht_param(padapter);
+ }
-+
++
+
+ if(pmlmepriv->cur_network.join_res != _TRUE) //setting only at first time
-+ {
++ {
+ //WEP Key will be set before this function, do not clear CAM.
+ if ((psecuritypriv->dot11PrivacyAlgrthm != _WEP40_) && (psecuritypriv->dot11PrivacyAlgrthm != _WEP104_))
+ flush_all_cam_entry(padapter); //clear CAM
-+ }
++ }
++
++ //set MSR to AP_Mode
++ Set_MSR(padapter, _HW_STATE_AP_);
+
-+ //set MSR to AP_Mode
-+ Set_MSR(padapter, _HW_STATE_AP_);
-+
+ //Set BSSID REG
+ rtw_hal_set_hwreg(padapter, HW_VAR_BSSID, pnetwork->MacAddress);
+
@@ -3151,8 +3147,8 @@ index 000000000000..14576dd191f3
+ //disable dynamic functions, such as high power, DIG
+ //Save_DM_Func_Flag(padapter);
+ //Switch_DM_Func(padapter, DYNAMIC_FUNC_DISABLE, _FALSE);
-+
-+#ifdef CONFIG_CONCURRENT_MODE
++
++#ifdef CONFIG_CONCURRENT_MODE
+ if(padapter->adapter_type > PRIMARY_ADAPTER)
+ {
+ if(rtw_buddy_adapter_up(padapter))
@@ -3161,22 +3157,22 @@ index 000000000000..14576dd191f3
+
+ //turn on dynamic functions on PRIMARY_ADAPTER, dynamic functions only runs at PRIMARY_ADAPTER
+ Switch_DM_Func(pbuddy_adapter, DYNAMIC_FUNC_DIG|DYNAMIC_FUNC_HP|DYNAMIC_FUNC_SS, _TRUE);
-+
++
+ rtw_hal_set_hwreg(pbuddy_adapter, HW_VAR_INITIAL_GAIN, (u8 *)(&initialgain));
+ }
+ }
+ else
+#endif
+ {
-+ //turn on dynamic functions
++ //turn on dynamic functions
+ Switch_DM_Func(padapter, DYNAMIC_FUNC_DIG|DYNAMIC_FUNC_HP|DYNAMIC_FUNC_SS, _TRUE);
+
+ rtw_hal_set_hwreg(padapter, HW_VAR_INITIAL_GAIN, (u8 *)(&initialgain));
-+ }
-+
++ }
++
+ }
+
-+ //set channel, bwmode
++ //set channel, bwmode
+ p = rtw_get_ie((pnetwork->IEs + sizeof(NDIS_802_11_FIXED_IEs)), _HT_ADD_INFO_IE_, &ie_len, (pnetwork->IELength - sizeof(NDIS_802_11_FIXED_IEs)));
+ if( p && ie_len)
+ {
@@ -3190,7 +3186,7 @@ index 000000000000..14576dd191f3
+ else
+ if( pregpriv->cbw40_enable & BIT(0) )
+ cbw40_enable = 1;
-+
++
+ if ((cbw40_enable) && (pht_info->infos[0] & BIT(2)))
+ {
+ //switch to the 40M Hz mode
@@ -3202,20 +3198,20 @@ index 000000000000..14576dd191f3
+ //pmlmeext->cur_ch_offset = HAL_PRIME_CHNL_OFFSET_LOWER;
+ cur_ch_offset = HAL_PRIME_CHNL_OFFSET_LOWER;
+ break;
-+
++
+ case 3:
+ //pmlmeext->cur_ch_offset = HAL_PRIME_CHNL_OFFSET_UPPER;
-+ cur_ch_offset = HAL_PRIME_CHNL_OFFSET_UPPER;
++ cur_ch_offset = HAL_PRIME_CHNL_OFFSET_UPPER;
+ break;
-+
++
+ default:
+ //pmlmeext->cur_ch_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE;
+ cur_ch_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE;
+ break;
-+ }
-+
++ }
++
+ }
-+
++
+ }
+
+#ifdef CONFIG_DUALMAC_CONCURRENT
@@ -3230,31 +3226,31 @@ index 000000000000..14576dd191f3
+ }
+ else if(check_buddy_fwstate(padapter, _FW_LINKED)==_TRUE)//only second adapter can enter AP Mode
+ {
-+ _adapter *pbuddy_adapter = padapter->pbuddy_adapter;
++ _adapter *pbuddy_adapter = padapter->pbuddy_adapter;
+ struct mlme_ext_priv *pbuddy_mlmeext = &pbuddy_adapter->mlmeextpriv;
-+
++
+ //To sync cur_channel/cur_bwmode/cur_ch_offset with primary adapter
+ DBG_871X("primary iface is at linked state, sync cur_channel/cur_bwmode/cur_ch_offset\n");
+ DBG_871X("primary adapter, CH=%d, BW=%d, offset=%d\n", pbuddy_mlmeext->cur_channel, pbuddy_mlmeext->cur_bwmode, pbuddy_mlmeext->cur_ch_offset);
+ DBG_871X("second adapter, CH=%d, BW=%d, offset=%d\n", cur_channel, cur_bwmode, cur_ch_offset);
-+
++
+ if((cur_channel <= 14 && pbuddy_mlmeext->cur_channel >= 36) ||
+ (cur_channel >= 36 && pbuddy_mlmeext->cur_channel <= 14))
+ change_band = _TRUE;
-+
++
+ cur_channel = pbuddy_mlmeext->cur_channel;
+ if(cur_bwmode == HT_CHANNEL_WIDTH_40)
+ {
+ if(pht_info)
+ pht_info->infos[0] &= ~(BIT(0)|BIT(1));
-+
++
+ if(pbuddy_mlmeext->cur_bwmode == HT_CHANNEL_WIDTH_40)
+ {
+ cur_ch_offset = pbuddy_mlmeext->cur_ch_offset;
+
+ //to update cur_ch_offset value in beacon
+ if(pht_info)
-+ {
++ {
+ switch(cur_ch_offset)
+ {
+ case HAL_PRIME_CHNL_OFFSET_LOWER:
@@ -3263,22 +3259,22 @@ index 000000000000..14576dd191f3
+ case HAL_PRIME_CHNL_OFFSET_UPPER:
+ pht_info->infos[0] |= 0x3;
+ break;
-+ case HAL_PRIME_CHNL_OFFSET_DONT_CARE:
-+ default:
-+ break;
++ case HAL_PRIME_CHNL_OFFSET_DONT_CARE:
++ default:
++ break;
+ }
-+ }
-+
++ }
++
+ }
+ else if(pbuddy_mlmeext->cur_bwmode == HT_CHANNEL_WIDTH_20)
+ {
+ cur_bwmode = HT_CHANNEL_WIDTH_20;
+ cur_ch_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE;
-+
++
+ if(cur_channel>0 && cur_channel<5)
+ {
+ if(pht_info)
-+ pht_info->infos[0] |= 0x1;
++ pht_info->infos[0] |= 0x1;
+
+ cur_bwmode = HT_CHANNEL_WIDTH_40;
+ cur_ch_offset = HAL_PRIME_CHNL_OFFSET_LOWER;
@@ -3288,30 +3284,30 @@ index 000000000000..14576dd191f3
+ {
+ if(pht_info)
+ pht_info->infos[0] |= 0x3;
-+
++
+ cur_bwmode = HT_CHANNEL_WIDTH_40;
+ cur_ch_offset = HAL_PRIME_CHNL_OFFSET_UPPER;
-+ }
++ }
+
+ set_channel_bwmode(padapter, cur_channel, cur_ch_offset, cur_bwmode);
+ }
-+
++
+ }
+
+ // to update channel value in beacon
-+ pnetwork->Configuration.DSConfig = cur_channel;
++ pnetwork->Configuration.DSConfig = cur_channel;
+ p = rtw_get_ie((pnetwork->IEs + sizeof(NDIS_802_11_FIXED_IEs)), _DSSET_IE_, &ie_len, (pnetwork->IELength - sizeof(NDIS_802_11_FIXED_IEs)));
+ if(p && ie_len>0)
+ *(p + 2) = cur_channel;
-+
++
+ if(pht_info)
+ pht_info->primary_channel = cur_channel;
-+
++
+ //set buddy adapter channel, bandwidth, offeset to current adapter
-+ pmlmeext->cur_channel = cur_channel;
++ pmlmeext->cur_channel = cur_channel;
+ pmlmeext->cur_bwmode = cur_bwmode;
+ pmlmeext->cur_ch_offset = cur_ch_offset;
-+
++
+ //buddy interface band is different from current interface, update ERP, support rate, ext support rate IE
+ if(change_band == _TRUE)
+ change_band_update_ie(padapter, pnetwork);
@@ -3323,7 +3319,7 @@ index 000000000000..14576dd191f3
+ DBG_871X("CH=%d, BW=%d, offset=%d\n", cur_channel, cur_bwmode, cur_ch_offset);
+
+ //
-+ pmlmeext->cur_channel = cur_channel;
++ pmlmeext->cur_channel = cur_channel;
+ pmlmeext->cur_bwmode = cur_bwmode;
+ pmlmeext->cur_ch_offset = cur_ch_offset;
+#endif //CONFIG_DUALMAC_CONCURRENT
@@ -3338,12 +3334,12 @@ index 000000000000..14576dd191f3
+
+ //udpate capability after cur_wireless_mode updated
+ update_capinfo(padapter, rtw_get_capability((WLAN_BSSID_EX *)pnetwork));
-+
++
+ //let pnetwork_mlmeext == pnetwork_mlme.
+ _rtw_memcpy(pnetwork_mlmeext, pnetwork, pnetwork->Length);
+
+#ifdef CONFIG_P2P
-+ _rtw_memcpy(pwdinfo->p2p_group_ssid, pnetwork->Ssid.Ssid, pnetwork->Ssid.SsidLength);
++ _rtw_memcpy(pwdinfo->p2p_group_ssid, pnetwork->Ssid.Ssid, pnetwork->Ssid.SsidLength);
+ pwdinfo->p2p_group_ssid_len = pnetwork->Ssid.SsidLength;
+#endif //CONFIG_P2P
+
@@ -3358,7 +3354,7 @@ index 000000000000..14576dd191f3
+ {
+ DBG_871X("issue_beacon, fail!\n");
+ }
-+#endif
++#endif
+#endif //!CONFIG_INTERRUPT_BASED_TXBCN
+
+ }
@@ -3366,9 +3362,9 @@ index 000000000000..14576dd191f3
+
+ //update bc/mc sta_info
+ update_bmc_sta(padapter);
-+
++
+ //pmlmeext->bstart_bss = _TRUE;
-+
++
+}
+
+int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
@@ -3380,19 +3376,19 @@ index 000000000000..14576dd191f3
+ struct sta_info *psta = NULL;
+ u16 cap, ht_cap=_FALSE;
+ uint ie_len = 0;
-+ int group_cipher, pairwise_cipher;
++ int group_cipher, pairwise_cipher;
+ u8 channel, network_type, supportRate[NDIS_802_11_LENGTH_RATES_EX];
+ int supportRateNum = 0;
+ u8 OUI1[] = {0x00, 0x50, 0xf2,0x01};
+ u8 wps_oui[4]={0x0,0x50,0xf2,0x04};
-+ u8 WMM_PARA_IE[] = {0x00, 0x50, 0xf2, 0x02, 0x01, 0x01};
-+ struct registry_priv *pregistrypriv = &padapter->registrypriv;
++ u8 WMM_PARA_IE[] = {0x00, 0x50, 0xf2, 0x02, 0x01, 0x01};
++ struct registry_priv *pregistrypriv = &padapter->registrypriv;
+ struct security_priv *psecuritypriv = &padapter->securitypriv;
+ struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
-+ WLAN_BSSID_EX *pbss_network = (WLAN_BSSID_EX *)&pmlmepriv->cur_network.network;
++ WLAN_BSSID_EX *pbss_network = (WLAN_BSSID_EX *)&pmlmepriv->cur_network.network;
+ struct sta_priv *pstapriv = &padapter->stapriv;
+ u8 *ie = pbss_network->IEs;
-+
++
+
+ /* SSID */
+ /* Supported rates */
@@ -3413,11 +3409,11 @@ index 000000000000..14576dd191f3
+
+ if(len>MAX_IE_SZ)
+ return _FAIL;
-+
++
+ pbss_network->IELength = len;
+
+ _rtw_memset(ie, 0, MAX_IE_SZ);
-+
++
+ _rtw_memcpy(ie, pbuf, pbss_network->IELength);
+
+
@@ -3427,12 +3423,12 @@ index 000000000000..14576dd191f3
+ pbss_network->Rssi = 0;
+
+ _rtw_memcpy(pbss_network->MacAddress, myid(&(padapter->eeprompriv)), ETH_ALEN);
-+
++
+ //beacon interval
+ p = rtw_get_beacon_interval_from_ie(ie);//ie + 8; // 8: TimeStamp, 2: Beacon Interval 2:Capability
+ //pbss_network->Configuration.BeaconPeriod = le16_to_cpu(*(unsigned short*)p);
+ pbss_network->Configuration.BeaconPeriod = RTW_GET_LE16(p);
-+
++
+ //capability
+ //cap = *(unsigned short *)rtw_get_capability_from_ie(ie);
+ //cap = le16_to_cpu(cap);
@@ -3445,7 +3441,7 @@ index 000000000000..14576dd191f3
+ _rtw_memset(&pbss_network->Ssid, 0, sizeof(NDIS_802_11_SSID));
+ _rtw_memcpy(pbss_network->Ssid.Ssid, (p + 2), ie_len);
+ pbss_network->Ssid.SsidLength = ie_len;
-+ }
++ }
+
+ //chnnel
+ channel = 0;
@@ -3456,23 +3452,23 @@ index 000000000000..14576dd191f3
+
+ pbss_network->Configuration.DSConfig = channel;
+
-+
++
+ _rtw_memset(supportRate, 0, NDIS_802_11_LENGTH_RATES_EX);
+ // get supported rates
-+ p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _SUPPORTEDRATES_IE_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_));
-+ if (p != NULL)
++ p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _SUPPORTEDRATES_IE_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_));
++ if (p != NULL)
+ {
-+ _rtw_memcpy(supportRate, p+2, ie_len);
++ _rtw_memcpy(supportRate, p+2, ie_len);
+ supportRateNum = ie_len;
+ }
-+
++
+ //get ext_supported rates
-+ p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _EXT_SUPPORTEDRATES_IE_, &ie_len, pbss_network->IELength - _BEACON_IE_OFFSET_);
++ p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _EXT_SUPPORTEDRATES_IE_, &ie_len, pbss_network->IELength - _BEACON_IE_OFFSET_);
+ if (p != NULL)
+ {
+ _rtw_memcpy(supportRate+supportRateNum, p+2, ie_len);
+ supportRateNum += ie_len;
-+
++
+ }
+
+ network_type = rtw_check_network_type(supportRate, supportRateNum, channel);
@@ -3498,14 +3494,14 @@ index 000000000000..14576dd191f3
+ //wpa2
+ group_cipher = 0; pairwise_cipher = 0;
+ psecuritypriv->wpa2_group_cipher = _NO_PRIVACY_;
-+ psecuritypriv->wpa2_pairwise_cipher = _NO_PRIVACY_;
-+ p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _RSN_IE_2_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_));
++ psecuritypriv->wpa2_pairwise_cipher = _NO_PRIVACY_;
++ p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _RSN_IE_2_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_));
+ if(p && ie_len>0)
+ {
+ if(rtw_parse_wpa2_ie(p, ie_len+2, &group_cipher, &pairwise_cipher) == _SUCCESS)
+ {
+ psecuritypriv->dot11AuthAlgrthm= dot11AuthAlgrthm_8021X;
-+
++
+ psecuritypriv->dot8021xalg = 1;//psk, todo:802.1x
+ psecuritypriv->wpa_psk |= BIT(1);
+
@@ -3514,60 +3510,60 @@ index 000000000000..14576dd191f3
+#if 0
+ switch(group_cipher)
+ {
-+ case WPA_CIPHER_NONE:
++ case WPA_CIPHER_NONE:
+ psecuritypriv->wpa2_group_cipher = _NO_PRIVACY_;
+ break;
-+ case WPA_CIPHER_WEP40:
++ case WPA_CIPHER_WEP40:
+ psecuritypriv->wpa2_group_cipher = _WEP40_;
+ break;
-+ case WPA_CIPHER_TKIP:
++ case WPA_CIPHER_TKIP:
+ psecuritypriv->wpa2_group_cipher = _TKIP_;
+ break;
-+ case WPA_CIPHER_CCMP:
-+ psecuritypriv->wpa2_group_cipher = _AES_;
++ case WPA_CIPHER_CCMP:
++ psecuritypriv->wpa2_group_cipher = _AES_;
+ break;
-+ case WPA_CIPHER_WEP104:
++ case WPA_CIPHER_WEP104:
+ psecuritypriv->wpa2_group_cipher = _WEP104_;
+ break;
+ }
+
+ switch(pairwise_cipher)
+ {
-+ case WPA_CIPHER_NONE:
++ case WPA_CIPHER_NONE:
+ psecuritypriv->wpa2_pairwise_cipher = _NO_PRIVACY_;
+ break;
-+ case WPA_CIPHER_WEP40:
++ case WPA_CIPHER_WEP40:
+ psecuritypriv->wpa2_pairwise_cipher = _WEP40_;
+ break;
-+ case WPA_CIPHER_TKIP:
++ case WPA_CIPHER_TKIP:
+ psecuritypriv->wpa2_pairwise_cipher = _TKIP_;
+ break;
-+ case WPA_CIPHER_CCMP:
++ case WPA_CIPHER_CCMP:
+ psecuritypriv->wpa2_pairwise_cipher = _AES_;
+ break;
-+ case WPA_CIPHER_WEP104:
++ case WPA_CIPHER_WEP104:
+ psecuritypriv->wpa2_pairwise_cipher = _WEP104_;
+ break;
+ }
-+#endif
++#endif
+ }
-+
++
+ }
+
+ //wpa
+ ie_len = 0;
+ group_cipher = 0; pairwise_cipher = 0;
+ psecuritypriv->wpa_group_cipher = _NO_PRIVACY_;
-+ psecuritypriv->wpa_pairwise_cipher = _NO_PRIVACY_;
++ psecuritypriv->wpa_pairwise_cipher = _NO_PRIVACY_;
+ for (p = ie + _BEACON_IE_OFFSET_; ;p += (ie_len + 2))
+ {
-+ p = rtw_get_ie(p, _SSN_IE_1_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_ - (ie_len + 2)));
++ p = rtw_get_ie(p, _SSN_IE_1_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_ - (ie_len + 2)));
+ if ((p) && (_rtw_memcmp(p+2, OUI1, 4)))
+ {
+ if(rtw_parse_wpa_ie(p, ie_len+2, &group_cipher, &pairwise_cipher) == _SUCCESS)
+ {
+ psecuritypriv->dot11AuthAlgrthm= dot11AuthAlgrthm_8021X;
-+
++
+ psecuritypriv->dot8021xalg = 1;//psk, todo:802.1x
+
+ psecuritypriv->wpa_psk |= BIT(0);
@@ -3578,53 +3574,53 @@ index 000000000000..14576dd191f3
+#if 0
+ switch(group_cipher)
+ {
-+ case WPA_CIPHER_NONE:
++ case WPA_CIPHER_NONE:
+ psecuritypriv->wpa_group_cipher = _NO_PRIVACY_;
+ break;
-+ case WPA_CIPHER_WEP40:
++ case WPA_CIPHER_WEP40:
+ psecuritypriv->wpa_group_cipher = _WEP40_;
+ break;
-+ case WPA_CIPHER_TKIP:
++ case WPA_CIPHER_TKIP:
+ psecuritypriv->wpa_group_cipher = _TKIP_;
+ break;
-+ case WPA_CIPHER_CCMP:
-+ psecuritypriv->wpa_group_cipher = _AES_;
++ case WPA_CIPHER_CCMP:
++ psecuritypriv->wpa_group_cipher = _AES_;
+ break;
-+ case WPA_CIPHER_WEP104:
++ case WPA_CIPHER_WEP104:
+ psecuritypriv->wpa_group_cipher = _WEP104_;
+ break;
+ }
+
+ switch(pairwise_cipher)
+ {
-+ case WPA_CIPHER_NONE:
++ case WPA_CIPHER_NONE:
+ psecuritypriv->wpa_pairwise_cipher = _NO_PRIVACY_;
+ break;
-+ case WPA_CIPHER_WEP40:
++ case WPA_CIPHER_WEP40:
+ psecuritypriv->wpa_pairwise_cipher = _WEP40_;
+ break;
-+ case WPA_CIPHER_TKIP:
++ case WPA_CIPHER_TKIP:
+ psecuritypriv->wpa_pairwise_cipher = _TKIP_;
+ break;
-+ case WPA_CIPHER_CCMP:
++ case WPA_CIPHER_CCMP:
+ psecuritypriv->wpa_pairwise_cipher = _AES_;
+ break;
-+ case WPA_CIPHER_WEP104:
++ case WPA_CIPHER_WEP104:
+ psecuritypriv->wpa_pairwise_cipher = _WEP104_;
+ break;
+ }
-+#endif
++#endif
+ }
+
+ break;
-+
++
+ }
-+
++
+ if ((p == NULL) || (ie_len == 0))
+ {
+ break;
+ }
-+
++
+ }
+
+ //wmm
@@ -3633,28 +3629,28 @@ index 000000000000..14576dd191f3
+ if(pregistrypriv->wmm_enable)
+ {
+ for (p = ie + _BEACON_IE_OFFSET_; ;p += (ie_len + 2))
-+ {
-+ p = rtw_get_ie(p, _VENDOR_SPECIFIC_IE_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_ - (ie_len + 2)));
-+ if((p) && _rtw_memcmp(p+2, WMM_PARA_IE, 6))
++ {
++ p = rtw_get_ie(p, _VENDOR_SPECIFIC_IE_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_ - (ie_len + 2)));
++ if((p) && _rtw_memcmp(p+2, WMM_PARA_IE, 6))
+ {
-+ pmlmepriv->qospriv.qos_option = 1;
++ pmlmepriv->qospriv.qos_option = 1;
+
+ *(p+8) |= BIT(7);//QoS Info, support U-APSD
-+
++
+ /* disable all ACM bits since the WMM admission control is not supported */
+ *(p + 10) &= ~BIT(4); /* BE */
+ *(p + 14) &= ~BIT(4); /* BK */
+ *(p + 18) &= ~BIT(4); /* VI */
+ *(p + 22) &= ~BIT(4); /* VO */
-+
-+ break;
++
++ break;
+ }
-+
++
+ if ((p == NULL) || (ie_len == 0))
+ {
+ break;
-+ }
-+ }
++ }
++ }
+ }
+
+ //parsing HT_CAP_IE
@@ -3666,34 +3662,34 @@ index 000000000000..14576dd191f3
+ struct rtw_ieee80211_ht_cap *pht_cap = (struct rtw_ieee80211_ht_cap *)(p+2);
+
+ pHT_caps_ie=p;
-+
-+
++
++
+ ht_cap = _TRUE;
+ network_type |= WIRELESS_11_24N;
+
-+
++
+ rtw_hal_get_hwreg(padapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type));
+
+ if((psecuritypriv->wpa_pairwise_cipher & WPA_CIPHER_CCMP) ||
+ (psecuritypriv->wpa2_pairwise_cipher & WPA_CIPHER_CCMP))
+ {
+ pht_cap->ampdu_params_info |= (IEEE80211_HT_CAP_AMPDU_DENSITY&(0x07<<2));
-+ }
++ }
+ else
+ {
-+ pht_cap->ampdu_params_info |= (IEEE80211_HT_CAP_AMPDU_DENSITY&0x00);
-+ }
++ pht_cap->ampdu_params_info |= (IEEE80211_HT_CAP_AMPDU_DENSITY&0x00);
++ }
+
+ pht_cap->ampdu_params_info |= (IEEE80211_HT_CAP_AMPDU_FACTOR & 0x03); //set Max Rx AMPDU size to 64K
+
+ if(rf_type == RF_1T1R)
-+ {
++ {
+ pht_cap->supp_mcs_set[0] = 0xff;
-+ pht_cap->supp_mcs_set[1] = 0x0;
++ pht_cap->supp_mcs_set[1] = 0x0;
+ }
+
-+ _rtw_memcpy(&pmlmepriv->htpriv.ht_cap, p+2, ie_len);
-+
++ _rtw_memcpy(&pmlmepriv->htpriv.ht_cap, p+2, ie_len);
++
+ }
+
+ //parsing HT_INFO_IE
@@ -3707,7 +3703,7 @@ index 000000000000..14576dd191f3
+ {
+ case WIRELESS_11B:
+ pbss_network->NetworkTypeInUse = Ndis802_11DS;
-+ break;
++ break;
+ case WIRELESS_11G:
+ case WIRELESS_11BG:
+ case WIRELESS_11G_24N:
@@ -3721,7 +3717,7 @@ index 000000000000..14576dd191f3
+ pbss_network->NetworkTypeInUse = Ndis802_11OFDM24;
+ break;
+ }
-+
++
+ pmlmepriv->cur_network.network_type = network_type;
+
+
@@ -3729,14 +3725,14 @@ index 000000000000..14576dd191f3
+#ifdef CONFIG_80211N_HT
+ if( (psecuritypriv->wpa2_pairwise_cipher&WPA_CIPHER_TKIP) ||
+ (psecuritypriv->wpa_pairwise_cipher&WPA_CIPHER_TKIP))
-+ {
++ {
+ //todo:
+ //ht_cap = _FALSE;
+ }
-+
-+ //ht_cap
++
++ //ht_cap
+ if(pregistrypriv->ht_enable && ht_cap==_TRUE)
-+ {
++ {
+ pmlmepriv->htpriv.ht_option = _TRUE;
+ pmlmepriv->qospriv.qos_option = 1;
+
@@ -3746,7 +3742,7 @@ index 000000000000..14576dd191f3
+ }
+
+ HT_caps_handler(padapter, (PNDIS_802_11_VARIABLE_IEs)pHT_caps_ie);
-+
++
+ HT_info_handler(padapter, (PNDIS_802_11_VARIABLE_IEs)pHT_info_ie);
+ }
+#endif
@@ -3756,23 +3752,23 @@ index 000000000000..14576dd191f3
+
+ //issue beacon to start bss network
+ start_bss_network(padapter, (u8*)pbss_network);
-+
++
+
+ //alloc sta_info for ap itself
+ psta = rtw_get_stainfo(&padapter->stapriv, pbss_network->MacAddress);
+ if(!psta)
+ {
+ psta = rtw_alloc_stainfo(&padapter->stapriv, pbss_network->MacAddress);
-+ if (psta == NULL)
-+ {
++ if (psta == NULL)
++ {
+ return _FAIL;
-+ }
-+ }
-+ psta->state |= WIFI_AP_STATE; //Aries, add,fix bug of flush_cam_entry at STOP AP mode , 0724
++ }
++ }
++ psta->state |= WIFI_AP_STATE; //Aries, add,fix bug of flush_cam_entry at STOP AP mode , 0724
+ rtw_indicate_connect( padapter);
+
+ pmlmepriv->cur_network.join_res = _TRUE;//for check if already set beacon
-+
++
+ //update bc/mc sta_info
+ //update_bmc_sta(padapter);
+
@@ -3799,19 +3795,19 @@ index 000000000000..14576dd191f3
+ struct rtw_wlan_acl_node *paclnode;
+ struct sta_priv *pstapriv = &padapter->stapriv;
+ struct wlan_acl_pool *pacl_list = &pstapriv->acl_list;
-+ _queue *pacl_node_q =&pacl_list->acl_node_q;
++ _queue *pacl_node_q =&pacl_list->acl_node_q;
+
-+ DBG_871X("%s(acl_num=%d)=" MAC_FMT "\n", __func__, pacl_list->num, MAC_ARG(addr));
++ DBG_871X("%s(acl_num=%d)=" MAC_FMT "\n", __func__, pacl_list->num, MAC_ARG(addr));
+
+ if((NUM_ACL-1) < pacl_list->num)
-+ return (-1);
++ return (-1);
+
+
+ _enter_critical_bh(&(pacl_node_q->lock), &irqL);
+
+ phead = get_list_head(pacl_node_q);
+ plist = get_next(phead);
-+
++
+ while ((rtw_end_of_queue_search(phead, plist)) == _FALSE)
+ {
+ paclnode = LIST_CONTAINOR(plist, struct rtw_wlan_acl_node, list);
@@ -3825,15 +3821,15 @@ index 000000000000..14576dd191f3
+ DBG_871X("%s, sta has been added\n", __func__);
+ break;
+ }
-+ }
++ }
+ }
-+
++
+ _exit_critical_bh(&(pacl_node_q->lock), &irqL);
+
+
+ if(added == _TRUE)
+ return ret;
-+
++
+
+ _enter_critical_bh(&(pacl_node_q->lock), &irqL);
+
@@ -3844,13 +3840,13 @@ index 000000000000..14576dd191f3
+ if(paclnode->valid == _FALSE)
+ {
+ _rtw_init_listhead(&paclnode->list);
-+
++
+ _rtw_memcpy(paclnode->addr, addr, ETH_ALEN);
-+
++
+ paclnode->valid = _TRUE;
+
+ rtw_list_insert_tail(&paclnode->list, get_list_head(pacl_node_q));
-+
++
+ pacl_list->num++;
+
+ break;
@@ -3858,7 +3854,7 @@ index 000000000000..14576dd191f3
+ }
+
+ DBG_871X("%s, acl_num=%d\n", __func__, pacl_list->num);
-+
++
+ _exit_critical_bh(&(pacl_node_q->lock), &irqL);
+
+ return ret;
@@ -3872,15 +3868,15 @@ index 000000000000..14576dd191f3
+ struct rtw_wlan_acl_node *paclnode;
+ struct sta_priv *pstapriv = &padapter->stapriv;
+ struct wlan_acl_pool *pacl_list = &pstapriv->acl_list;
-+ _queue *pacl_node_q =&pacl_list->acl_node_q;
++ _queue *pacl_node_q =&pacl_list->acl_node_q;
+
-+ DBG_871X("%s(acl_num=%d)=" MAC_FMT "\n", __func__, pacl_list->num, MAC_ARG(addr));
++ DBG_871X("%s(acl_num=%d)=" MAC_FMT "\n", __func__, pacl_list->num, MAC_ARG(addr));
+
+ _enter_critical_bh(&(pacl_node_q->lock), &irqL);
+
+ phead = get_list_head(pacl_node_q);
+ plist = get_next(phead);
-+
++
+ while ((rtw_end_of_queue_search(phead, plist)) == _FALSE)
+ {
+ paclnode = LIST_CONTAINOR(plist, struct rtw_wlan_acl_node, list);
@@ -3893,16 +3889,16 @@ index 000000000000..14576dd191f3
+ paclnode->valid = _FALSE;
+
+ rtw_list_delete(&paclnode->list);
-+
++
+ pacl_list->num--;
+ }
-+ }
++ }
+ }
-+
++
+ _exit_critical_bh(&(pacl_node_q->lock), &irqL);
+
+ DBG_871X("%s, acl_num=%d\n", __func__, pacl_list->num);
-+
++
+ return ret;
+
+}
@@ -3944,10 +3940,10 @@ index 000000000000..14576dd191f3
+ pIE->data[0] |= RTW_ERP_INFO_BARKER_PREAMBLE_MODE;
+ else
+ pIE->data[0] &= ~(RTW_ERP_INFO_BARKER_PREAMBLE_MODE);
-+
++
+ ERP_IE_handler(padapter, pIE);
+ }
-+
++
+}
+
+static void update_bcn_htcap_ie(_adapter *padapter)
@@ -3957,7 +3953,7 @@ index 000000000000..14576dd191f3
+}
+
+static void update_bcn_htinfo_ie(_adapter *padapter)
-+{
++{
+ DBG_871X("%s\n", __FUNCTION__);
+
+}
@@ -3977,7 +3973,7 @@ index 000000000000..14576dd191f3
+static void update_bcn_wmm_ie(_adapter *padapter)
+{
+ DBG_871X("%s\n", __FUNCTION__);
-+
++
+}
+
+static void update_bcn_wps_ie(_adapter *padapter)
@@ -3995,7 +3991,7 @@ index 000000000000..14576dd191f3
+ DBG_871X("%s\n", __FUNCTION__);
+
+ pwps_ie = rtw_get_wps_ie(ie+_FIXED_IE_LENGTH_, ielen-_FIXED_IE_LENGTH_, NULL, &wps_ielen);
-+
++
+ if(pwps_ie==NULL || wps_ielen==0)
+ return;
+
@@ -4012,7 +4008,7 @@ index 000000000000..14576dd191f3
+ _rtw_memcpy(pbackup_remainder_ie, premainder_ie, remainder_ielen);
+ }
+
-+
++
+ pwps_ie_src = pmlmepriv->wps_beacon_ie;
+ if(pwps_ie_src == NULL)
+ return;
@@ -4064,9 +4060,9 @@ index 000000000000..14576dd191f3
+ else
+ {
+ DBG_871X("unknown OUI type!\n");
-+ }
-+
-+
++ }
++
++
+}
+
+void update_beacon(_adapter *padapter, u8 ie_id, u8 *oui, u8 tx)
@@ -4075,7 +4071,7 @@ index 000000000000..14576dd191f3
+ struct mlme_priv *pmlmepriv;
+ struct mlme_ext_priv *pmlmeext;
+ //struct mlme_ext_info *pmlmeinfo;
-+
++
+ //DBG_871X("%s\n", __FUNCTION__);
+
+ if(!padapter)
@@ -4095,13 +4091,13 @@ index 000000000000..14576dd191f3
+ case 0xFF:
+
+ update_bcn_fixed_ie(padapter);//8: TimeStamp, 2: Beacon Interval 2:Capability
-+
++
+ break;
+
+ case _TIM_IE_:
-+
++
+ update_BCNTIM(padapter);
-+
++
+ break;
+
+ case _ERPINFO_IE_:
@@ -4113,7 +4109,7 @@ index 000000000000..14576dd191f3
+ case _HT_CAPABILITY_IE_:
+
+ update_bcn_htcap_ie(padapter);
-+
++
+ break;
+
+ case _RSN_IE_2_:
@@ -4121,28 +4117,28 @@ index 000000000000..14576dd191f3
+ update_bcn_rsn_ie(padapter);
+
+ break;
-+
++
+ case _HT_ADD_INFO_IE_:
+
+ update_bcn_htinfo_ie(padapter);
-+
++
+ break;
-+
++
+ case _VENDOR_SPECIFIC_IE_:
+
+ update_bcn_vendor_spec_ie(padapter, oui);
-+
++
+ break;
-+
++
+ default:
+ break;
+ }
+
+ pmlmepriv->update_bcn = _TRUE;
-+
-+ _exit_critical_bh(&pmlmepriv->bcn_update_lock, &irqL);
-+
-+#ifndef CONFIG_INTERRUPT_BASED_TXBCN
++
++ _exit_critical_bh(&pmlmepriv->bcn_update_lock, &irqL);
++
++#ifndef CONFIG_INTERRUPT_BASED_TXBCN
+#if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI)
+ if(tx)
+ {
@@ -4150,12 +4146,12 @@ index 000000000000..14576dd191f3
+ set_tx_beacon_cmd(padapter);
+ }
+#else
-+ {
-+ //PCI will issue beacon when BCN interrupt occurs.
++ {
++ //PCI will issue beacon when BCN interrupt occurs.
+ }
+#endif
+#endif //!CONFIG_INTERRUPT_BASED_TXBCN
-+
++
+}
+
+#ifdef CONFIG_80211N_HT
@@ -4179,9 +4175,9 @@ index 000000000000..14576dd191f3
+ struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
+ struct ht_priv *phtpriv_ap = &pmlmepriv->htpriv;
+
-+ if(pmlmepriv->htpriv.ht_option == _TRUE)
++ if(pmlmepriv->htpriv.ht_option == _TRUE)
+ return 0;
-+
++
+ //if (!iface->conf->ieee80211n || iface->conf->ht_op_mode_fixed)
+ // return 0;
+
@@ -4240,7 +4236,7 @@ index 000000000000..14576dd191f3
+ __FUNCTION__, pmlmepriv->ht_op_mode, op_mode_changes);
+
+ return op_mode_changes;
-+
++
+}
+
+#endif /* CONFIG_80211N_HT */
@@ -4252,27 +4248,27 @@ index 000000000000..14576dd191f3
+ {
+ _irqL irqL;
+ _list *phead, *plist;
-+ struct sta_info *psta=NULL;
++ struct sta_info *psta=NULL;
+ struct sta_priv *pstapriv = &padapter->stapriv;
-+
++
+ _enter_critical_bh(&pstapriv->asoc_list_lock, &irqL);
-+
++
+ phead = &pstapriv->asoc_list;
+ plist = get_next(phead);
-+
++
+ //check asoc_queue
-+ while ((rtw_end_of_queue_search(phead, plist)) == _FALSE)
++ while ((rtw_end_of_queue_search(phead, plist)) == _FALSE)
+ {
+ psta = LIST_CONTAINOR(plist, struct sta_info, asoc_list);
-+
++
+ plist = get_next(plist);
+
-+ VCS_update(padapter, psta);
++ VCS_update(padapter, psta);
+ }
+
+ _exit_critical_bh(&pstapriv->asoc_list_lock, &irqL);
+
-+ }
++ }
+
+}
+
@@ -4283,34 +4279,34 @@ index 000000000000..14576dd191f3
+ struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
+ struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
+
-+
++
+#if 0
+ if (!(psta->capability & WLAN_CAPABILITY_SHORT_PREAMBLE) &&
+ !psta->no_short_preamble_set) {
+ psta->no_short_preamble_set = 1;
+ pmlmepriv->num_sta_no_short_preamble++;
-+ if ((pmlmeext->cur_wireless_mode > WIRELESS_11B) &&
++ if ((pmlmeext->cur_wireless_mode > WIRELESS_11B) &&
+ (pmlmepriv->num_sta_no_short_preamble == 1))
+ ieee802_11_set_beacons(hapd->iface);
+ }
+#endif
+
+
-+ if(!(psta->flags & WLAN_STA_SHORT_PREAMBLE))
++ if(!(psta->flags & WLAN_STA_SHORT_PREAMBLE))
+ {
+ if(!psta->no_short_preamble_set)
+ {
+ psta->no_short_preamble_set = 1;
-+
++
+ pmlmepriv->num_sta_no_short_preamble++;
-+
-+ if ((pmlmeext->cur_wireless_mode > WIRELESS_11B) &&
-+ (pmlmepriv->num_sta_no_short_preamble == 1))
++
++ if ((pmlmeext->cur_wireless_mode > WIRELESS_11B) &&
++ (pmlmepriv->num_sta_no_short_preamble == 1))
+ {
+ beacon_updated = _TRUE;
+ update_beacon(padapter, 0xFF, NULL, _TRUE);
-+ }
-+
++ }
++
+ }
+ }
+ else
@@ -4318,16 +4314,16 @@ index 000000000000..14576dd191f3
+ if(psta->no_short_preamble_set)
+ {
+ psta->no_short_preamble_set = 0;
-+
++
+ pmlmepriv->num_sta_no_short_preamble--;
-+
-+ if ((pmlmeext->cur_wireless_mode > WIRELESS_11B) &&
-+ (pmlmepriv->num_sta_no_short_preamble == 0))
++
++ if ((pmlmeext->cur_wireless_mode > WIRELESS_11B) &&
++ (pmlmepriv->num_sta_no_short_preamble == 0))
+ {
+ beacon_updated = _TRUE;
+ update_beacon(padapter, 0xFF, NULL, _TRUE);
-+ }
-+
++ }
++
+ }
+ }
+
@@ -4345,32 +4341,32 @@ index 000000000000..14576dd191f3
+ if(!psta->nonerp_set)
+ {
+ psta->nonerp_set = 1;
-+
++
+ pmlmepriv->num_sta_non_erp++;
-+
++
+ if (pmlmepriv->num_sta_non_erp == 1)
+ {
+ beacon_updated = _TRUE;
+ update_beacon(padapter, _ERPINFO_IE_, NULL, _TRUE);
-+ }
++ }
+ }
-+
++
+ }
+ else
+ {
+ if(psta->nonerp_set)
+ {
+ psta->nonerp_set = 0;
-+
++
+ pmlmepriv->num_sta_non_erp--;
-+
++
+ if (pmlmepriv->num_sta_non_erp == 0)
+ {
+ beacon_updated = _TRUE;
+ update_beacon(padapter, _ERPINFO_IE_, NULL, _TRUE);
-+ }
++ }
+ }
-+
++
+ }
+
+
@@ -4390,16 +4386,16 @@ index 000000000000..14576dd191f3
+ if(!psta->no_short_slot_time_set)
+ {
+ psta->no_short_slot_time_set = 1;
-+
++
+ pmlmepriv->num_sta_no_short_slot_time++;
-+
++
+ if ((pmlmeext->cur_wireless_mode > WIRELESS_11B) &&
-+ (pmlmepriv->num_sta_no_short_slot_time == 1))
++ (pmlmepriv->num_sta_no_short_slot_time == 1))
+ {
+ beacon_updated = _TRUE;
+ update_beacon(padapter, 0xFF, NULL, _TRUE);
-+ }
-+
++ }
++
+ }
+ }
+ else
@@ -4407,24 +4403,24 @@ index 000000000000..14576dd191f3
+ if(psta->no_short_slot_time_set)
+ {
+ psta->no_short_slot_time_set = 0;
-+
++
+ pmlmepriv->num_sta_no_short_slot_time--;
-+
++
+ if ((pmlmeext->cur_wireless_mode > WIRELESS_11B) &&
-+ (pmlmepriv->num_sta_no_short_slot_time == 0))
++ (pmlmepriv->num_sta_no_short_slot_time == 0))
+ {
+ beacon_updated = _TRUE;
+ update_beacon(padapter, 0xFF, NULL, _TRUE);
-+ }
++ }
+ }
+ }
-+
++
+#ifdef CONFIG_80211N_HT
+ +
-+ if (psta->flags & WLAN_STA_HT)
++ if (psta->flags & WLAN_STA_HT)
+ {
+ u16 ht_capab = le16_to_cpu(psta->htpriv.ht_cap.cap_info);
-+
++++
+ DBG_871X("HT: STA " MAC_FMT " HT Capabilities "
+ "Info: 0x%04x\n", MAC_ARG(psta->hwaddr), ht_capab);
+
@@ -4432,7 +4428,7 @@ index 000000000000..14576dd191f3
+ psta->no_ht_set = 0;
+ pmlmepriv->num_sta_no_ht--;
+ }
-+
++
+ if ((ht_capab & IEEE80211_HT_CAP_GRN_FLD) == 0) {
+ if (!psta->no_ht_gf_set) {
+ psta->no_ht_gf_set = 1;
@@ -4443,7 +4439,7 @@ index 000000000000..14576dd191f3
+ __FUNCTION__, MAC_ARG(psta->hwaddr),
+ pmlmepriv->num_sta_ht_no_gf);
+ }
-+
++
+ if ((ht_capab & IEEE80211_HT_CAP_SUP_WIDTH) == 0) {
+ if (!psta->ht_20mhz_set) {
+ psta->ht_20mhz_set = 1;
@@ -4454,15 +4450,15 @@ index 000000000000..14576dd191f3
+ __FUNCTION__, MAC_ARG(psta->hwaddr),
+ pmlmepriv->num_sta_ht_20mhz);
+ }
-+
-+ }
-+ else
++
++ }
++ else
+ {
+ if (!psta->no_ht_set) {
+ psta->no_ht_set = 1;
+ pmlmepriv->num_sta_no_ht++;
+ }
-+ if(pmlmepriv->htpriv.ht_option == _TRUE) {
++ if(pmlmepriv->htpriv.ht_option == _TRUE) {
+ DBG_871X("%s STA " MAC_FMT
+ " - no HT, num of non-HT stations %d\n",
+ __FUNCTION__, MAC_ARG(psta->hwaddr),
@@ -4474,8 +4470,8 @@ index 000000000000..14576dd191f3
+ {
+ update_beacon(padapter, _HT_CAPABILITY_IE_, NULL, _FALSE);
+ update_beacon(padapter, _HT_ADD_INFO_IE_, NULL, _TRUE);
-+ }
-+
++ }
++
+#endif /* CONFIG_80211N_HT */
+
+ //update associcated stations cap.
@@ -4502,17 +4498,17 @@ index 000000000000..14576dd191f3
+ {
+ beacon_updated = _TRUE;
+ update_beacon(padapter, 0xFF, NULL, _TRUE);
-+ }
-+ }
++ }
++ }
+
+ if (psta->nonerp_set) {
-+ psta->nonerp_set = 0;
++ psta->nonerp_set = 0;
+ pmlmepriv->num_sta_non_erp--;
+ if (pmlmepriv->num_sta_non_erp == 0)
+ {
+ beacon_updated = _TRUE;
+ update_beacon(padapter, _ERPINFO_IE_, NULL, _TRUE);
-+ }
++ }
+ }
+
+ if (psta->no_short_slot_time_set) {
@@ -4523,9 +4519,9 @@ index 000000000000..14576dd191f3
+ {
+ beacon_updated = _TRUE;
+ update_beacon(padapter, 0xFF, NULL, _TRUE);
-+ }
++ }
+ }
-+
++
+#ifdef CONFIG_80211N_HT
+
+ if (psta->no_ht_gf_set) {
@@ -4548,7 +4544,7 @@ index 000000000000..14576dd191f3
+ update_beacon(padapter, _HT_CAPABILITY_IE_, NULL, _FALSE);
+ update_beacon(padapter, _HT_ADD_INFO_IE_, NULL, _TRUE);
+ }
-+
++
+#endif /* CONFIG_80211N_HT */
+
+ //update associcated stations cap.
@@ -4576,10 +4572,10 @@ index 000000000000..14576dd191f3
+#ifdef CONFIG_80211N_HT
+ //tear down Rx AMPDU
+ send_delba(padapter, 0, psta->hwaddr);// recipient
-+
++
+ //tear down TX AMPDU
+ send_delba(padapter, 1, psta->hwaddr);// // originator
-+
++
+#endif //CONFIG_80211N_HT
+
+ issue_deauth(padapter, psta->hwaddr, reason);
@@ -4619,10 +4615,10 @@ index 000000000000..14576dd191f3
+
+ beacon_updated = bss_cap_update_on_sta_leave(padapter, psta);
+
-+ _enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
++ _enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
+ rtw_free_stainfo(padapter, psta);
+ _exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
-+
++
+
+ return beacon_updated;
+
@@ -4632,8 +4628,8 @@ index 000000000000..14576dd191f3
+{
+ _irqL irqL;
+ _list *phead, *plist;
-+ int ret=0;
-+ struct sta_info *psta = NULL;
++ int ret=0;
++ struct sta_info *psta = NULL;
+ struct sta_priv *pstapriv = &padapter->stapriv;
+ struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
+ struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
@@ -4648,10 +4644,10 @@ index 000000000000..14576dd191f3
+ _enter_critical_bh(&pstapriv->asoc_list_lock, &irqL);
+ phead = &pstapriv->asoc_list;
+ plist = get_next(phead);
-+
++
+ /* for each sta in asoc_queue */
-+ while ((rtw_end_of_queue_search(phead, plist)) == _FALSE)
-+ {
++ while ((rtw_end_of_queue_search(phead, plist)) == _FALSE)
++ {
+ psta = LIST_CONTAINOR(plist, struct sta_info, asoc_list);
+ plist = get_next(plist);
+
@@ -4669,8 +4665,8 @@ index 000000000000..14576dd191f3
+{
+ _irqL irqL;
+ _list *phead, *plist;
-+ int ret=0;
-+ struct sta_info *psta = NULL;
++ int ret=0;
++ struct sta_info *psta = NULL;
+ struct sta_priv *pstapriv = &padapter->stapriv;
+ struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
+ struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
@@ -4690,7 +4686,7 @@ index 000000000000..14576dd191f3
+
+ while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) {
+ int stainfo_offset;
-+
++
+ psta = LIST_CONTAINOR(plist, struct sta_info, asoc_list);
+ plist = get_next(plist);
+
@@ -4723,40 +4719,40 @@ index 000000000000..14576dd191f3
+
+/* called > TSR LEVEL for USB or SDIO Interface*/
+void sta_info_update(_adapter *padapter, struct sta_info *psta)
-+{
++{
+ int flags = psta->flags;
+ struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
-+
-+
++
++
+ //update wmm cap.
+ if(WLAN_STA_WME&flags)
+ psta->qos_option = 1;
+ else
+ psta->qos_option = 0;
+
-+ if(pmlmepriv->qospriv.qos_option == 0)
++ if(pmlmepriv->qospriv.qos_option == 0)
+ psta->qos_option = 0;
+
-+
-+#ifdef CONFIG_80211N_HT
++
++#ifdef CONFIG_80211N_HT
+ //update 802.11n ht cap.
+ if(WLAN_STA_HT&flags)
+ {
+ psta->htpriv.ht_option = _TRUE;
-+ psta->qos_option = 1;
++ psta->qos_option = 1;
+ }
-+ else
++ else
+ {
+ psta->htpriv.ht_option = _FALSE;
+ }
-+
-+ if(pmlmepriv->htpriv.ht_option == _FALSE)
++
++ if(pmlmepriv->htpriv.ht_option == _FALSE)
+ psta->htpriv.ht_option = _FALSE;
-+#endif
++#endif
+
+
+ update_sta_info_apmode(padapter, psta);
-+
++
+
+}
+
@@ -4764,10 +4760,10 @@ index 000000000000..14576dd191f3
+void ap_sta_info_defer_update(_adapter *padapter, struct sta_info *psta)
+{
+ if(psta->state & _FW_LINKED)
-+ {
++ {
+ //add ratid
+ add_RATid(padapter, psta);
-+ }
++ }
+}
+
+/* restore hw setting from sw data structures */
@@ -4805,7 +4801,7 @@ index 000000000000..14576dd191f3
+ }
+
+ _enter_critical_bh(&pstapriv->asoc_list_lock, &irqL);
-+
++
+ phead = &pstapriv->asoc_list;
+ plist = get_next(phead);
+
@@ -4844,9 +4840,9 @@ index 000000000000..14576dd191f3
+ struct sta_priv *pstapriv = &padapter->stapriv;
+ struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
+ struct wlan_acl_pool *pacl_list = &pstapriv->acl_list;
-+
++
+ pmlmepriv->update_bcn = _FALSE;
-+
++
+ //init_mlme_ap_info(padapter);
+ pmlmeext->bstart_bss = _FALSE;
+
@@ -4859,13 +4855,13 @@ index 000000000000..14576dd191f3
+ pmlmepriv->num_sta_ht_no_gf = 0;
+
+ pmlmepriv->num_sta_no_ht = 0;
-+
++
+ pmlmepriv->num_sta_ht_20mhz = 0;
+
+ pmlmepriv->olbc = _FALSE;
+
+ pmlmepriv->olbc_ht = _FALSE;
-+
++
+#ifdef CONFIG_80211N_HT
+ pmlmepriv->ht_op_mode = 0;
+#endif
@@ -4873,20 +4869,20 @@ index 000000000000..14576dd191f3
+ for(i=0; i<NUM_STA; i++)
+ pstapriv->sta_aid[i] = NULL;
+
-+ pmlmepriv->wps_beacon_ie = NULL;
++ pmlmepriv->wps_beacon_ie = NULL;
+ pmlmepriv->wps_probe_resp_ie = NULL;
+ pmlmepriv->wps_assoc_resp_ie = NULL;
-+
++
+ pmlmepriv->p2p_beacon_ie = NULL;
+ pmlmepriv->p2p_probe_resp_ie = NULL;
+
-+
-+ //for ACL
++
++ //for ACL
+ _rtw_init_listhead(&(pacl_list->acl_node_q.queue));
+ pacl_list->num = 0;
+ pacl_list->mode = 0;
+ for(i = 0; i < NUM_ACL; i++)
-+ {
++ {
+ _rtw_init_listhead(&pacl_list->aclnode[i].list);
+ pacl_list->aclnode[i].valid = _FALSE;
+ }
@@ -4901,14 +4897,14 @@ index 000000000000..14576dd191f3
+ struct sta_info *psta=NULL;
+ struct sta_priv *pstapriv = &padapter->stapriv;
+ struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
-+ struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
++ struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
+ struct wlan_acl_pool *pacl_list = &pstapriv->acl_list;
-+ _queue *pacl_node_q =&pacl_list->acl_node_q;
++ _queue *pacl_node_q =&pacl_list->acl_node_q;
+
+ pmlmepriv->update_bcn = _FALSE;
+ pmlmeext->bstart_bss = _FALSE;
+ //_rtw_spinlock_free(&pmlmepriv->bcn_update_lock);
-+
++
+ //reset and init security priv , this can refine with rtw_reset_securitypriv
+ _rtw_memset((unsigned char *)&padapter->securitypriv, 0, sizeof (struct security_priv));
+ padapter->securitypriv.ndisauthtype = Ndis802_11AuthModeOpen;
@@ -4917,7 +4913,7 @@ index 000000000000..14576dd191f3
+ //for ACL
+ _enter_critical_bh(&(pacl_node_q->lock), &irqL);
+ phead = get_list_head(pacl_node_q);
-+ plist = get_next(phead);
++ plist = get_next(phead);
+ while ((rtw_end_of_queue_search(phead, plist)) == _FALSE)
+ {
+ paclnode = LIST_CONTAINOR(plist, struct rtw_wlan_acl_node, list);
@@ -4928,25 +4924,25 @@ index 000000000000..14576dd191f3
+ paclnode->valid = _FALSE;
+
+ rtw_list_delete(&paclnode->list);
-+
-+ pacl_list->num--;
-+ }
-+ }
++
++ pacl_list->num--;
++ }
++ }
+ _exit_critical_bh(&(pacl_node_q->lock), &irqL);
-+
++
+ DBG_871X("%s, free acl_node_queue, num=%d\n", __func__, pacl_list->num);
-+
++
+ rtw_sta_flush(padapter);
+
-+ //free_assoc_sta_resources
++ //free_assoc_sta_resources
+ rtw_free_all_stainfo(padapter);
-+
++
+ psta = rtw_get_bcmc_stainfo(padapter);
-+ _enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
++ _enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
+ rtw_free_stainfo(padapter, psta);
+ _exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
-+
-+ rtw_init_bcmc_stainfo(padapter);
++
++ rtw_init_bcmc_stainfo(padapter);
+
+ rtw_free_mlme_priv_ie_data(pmlmepriv);
+
@@ -4954,17 +4950,16 @@ index 000000000000..14576dd191f3
+
+#endif //CONFIG_NATIVEAP_MLME
+#endif //CONFIG_AP_MODE
-+
diff --git a/drivers/net/wireless/realtek/rtl8192cu/core/rtw_br_ext.c b/drivers/net/wireless/realtek/rtl8192cu/core/rtw_br_ext.c
new file mode 100755
-index 000000000000..2f84a38e2fdb
+index 000000000000..39289c970543
--- /dev/null
+++ b/drivers/net/wireless/realtek/rtl8192cu/core/rtw_br_ext.c
@@ -0,0 +1,1700 @@
+/******************************************************************************
+ *
+ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
-+ *
++ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
@@ -5195,10 +5190,10 @@ index 000000000000..2f84a38e2fdb
+{
+ while (len > 0) {
+ if (*data == tag && *(data+1) == len8b && len >= len8b*8)
-+ return data+2;
-+
-+ len -= (*(data+1))*8;
-+ data += (*(data+1))*8;
++ return data+2;
++
++ len -= (*(data+1))*8;
++ data += (*(data+1))*8;
+ }
+ return NULL;
+}
@@ -5208,16 +5203,16 @@ index 000000000000..2f84a38e2fdb
+{
+ struct icmp6hdr *icmphdr = (struct icmp6hdr *)data;
+ unsigned char *mac;
-+
-+ if (icmphdr->icmp6_type == NDISC_ROUTER_SOLICITATION) {
++
++ if (icmphdr->icmp6_type == NDISC_ROUTER_SOLICITATION) {
+ if (len >= 8) {
+ mac = scan_tlv(&data[8], len-8, 1, 1);
+ if (mac) {
+ _DEBUG_INFO("Router Solicitation, replace MAC From: %02x:%02x:%02x:%02x:%02x:%02x, To: %02x:%02x:%02x:%02x:%02x:%02x\n",
-+ mac[0],mac[1],mac[2],mac[3],mac[4],mac[5],
++ mac[0],mac[1],mac[2],mac[3],mac[4],mac[5],
+ replace_mac[0],replace_mac[1],replace_mac[2],replace_mac[3],replace_mac[4],replace_mac[5]);
-+ memcpy(mac, replace_mac, 6);
-+ return 1;
++ memcpy(mac, replace_mac, 6);
++ return 1;
+ }
+ }
+ }
@@ -5226,55 +5221,55 @@ index 000000000000..2f84a38e2fdb
+ mac = scan_tlv(&data[16], len-16, 1, 1);
+ if (mac) {
+ _DEBUG_INFO("Router Advertisement, replace MAC From: %02x:%02x:%02x:%02x:%02x:%02x, To: %02x:%02x:%02x:%02x:%02x:%02x\n",
-+ mac[0],mac[1],mac[2],mac[3],mac[4],mac[5],
++ mac[0],mac[1],mac[2],mac[3],mac[4],mac[5],
+ replace_mac[0],replace_mac[1],replace_mac[2],replace_mac[3],replace_mac[4],replace_mac[5]);
-+ memcpy(mac, replace_mac, 6);
-+ return 1;
++ memcpy(mac, replace_mac, 6);
++ return 1;
+ }
-+ }
++ }
+ }
+ else if (icmphdr->icmp6_type == NDISC_NEIGHBOUR_SOLICITATION) {
+ if (len >= 24) {
+ mac = scan_tlv(&data[24], len-24, 1, 1);
-+ if (mac) {
++ if (mac) {
+ _DEBUG_INFO("Neighbor Solicitation, replace MAC From: %02x:%02x:%02x:%02x:%02x:%02x, To: %02x:%02x:%02x:%02x:%02x:%02x\n",
-+ mac[0],mac[1],mac[2],mac[3],mac[4],mac[5],
++ mac[0],mac[1],mac[2],mac[3],mac[4],mac[5],
+ replace_mac[0],replace_mac[1],replace_mac[2],replace_mac[3],replace_mac[4],replace_mac[5]);
-+ memcpy(mac, replace_mac, 6);
-+ return 1;
++ memcpy(mac, replace_mac, 6);
++ return 1;
+ }
-+ }
++ }
+ }
+ else if (icmphdr->icmp6_type == NDISC_NEIGHBOUR_ADVERTISEMENT) {
+ if (len >= 24) {
+ mac = scan_tlv(&data[24], len-24, 2, 1);
+ if (mac) {
+ _DEBUG_INFO("Neighbor Advertisement, replace MAC From: %02x:%02x:%02x:%02x:%02x:%02x, To: %02x:%02x:%02x:%02x:%02x:%02x\n",
-+ mac[0],mac[1],mac[2],mac[3],mac[4],mac[5],
++ mac[0],mac[1],mac[2],mac[3],mac[4],mac[5],
+ replace_mac[0],replace_mac[1],replace_mac[2],replace_mac[3],replace_mac[4],replace_mac[5]);
-+ memcpy(mac, replace_mac, 6);
-+ return 1;
++ memcpy(mac, replace_mac, 6);
++ return 1;
+ }
-+ }
++ }
+ }
+ else if (icmphdr->icmp6_type == NDISC_REDIRECT) {
+ if (len >= 40) {
+ mac = scan_tlv(&data[40], len-40, 2, 1);
-+ if (mac) {
++ if (mac) {
+ _DEBUG_INFO("Redirect, replace MAC From: %02x:%02x:%02x:%02x:%02x:%02x, To: %02x:%02x:%02x:%02x:%02x:%02x\n",
-+ mac[0],mac[1],mac[2],mac[3],mac[4],mac[5],
++ mac[0],mac[1],mac[2],mac[3],mac[4],mac[5],
+ replace_mac[0],replace_mac[1],replace_mac[2],replace_mac[3],replace_mac[4],replace_mac[5]);
-+ memcpy(mac, replace_mac, 6);
-+ return 1;
++ memcpy(mac, replace_mac, 6);
++ return 1;
+ }
-+ }
-+ }
++ }
++ }
+ return 0;
+}
+
+
+static void convert_ipv6_mac_to_mc(struct sk_buff *skb)
-+{
++{
+ struct ipv6hdr *iph = (struct ipv6hdr *)(skb->data + ETH_HLEN);
+ unsigned char *dst_mac = skb->data;
+
@@ -5284,7 +5279,7 @@ index 000000000000..2f84a38e2fdb
+ dst_mac[0] = 0x33;
+ dst_mac[1] = 0x33;
+ memcpy(&dst_mac[2], &iph->daddr.s6_addr32[3], 4);
-+ #if defined(__LINUX_2_6__)
++ #if defined(__LINUX_2_6__)
+ /*modified by qinjunjie,warning:should not remove next line*/
+ skb->pkt_type = PACKET_MULTICAST;
+ #endif
@@ -5336,10 +5331,10 @@ index 000000000000..2f84a38e2fdb
+ networkAddr[6] ^ networkAddr[7] ^ networkAddr[8] ^ networkAddr[9] ^ networkAddr[10] ^
+ networkAddr[11] ^ networkAddr[12] ^ networkAddr[13] ^ networkAddr[14] ^ networkAddr[15] ^
+ networkAddr[16];
-+
++
+ return x & (NAT25_HASH_SIZE - 1);
+ }
-+#endif
++#endif
+ else
+ {
+ unsigned long x = 0;
@@ -5405,8 +5400,8 @@ index 000000000000..2f84a38e2fdb
+ atomic_inc(&db->use_count);
+
+#ifdef CL_IPV6_PASS
-+ DEBUG_INFO("NAT25: Lookup M:%02x%02x%02x%02x%02x%02x N:%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x"
-+ "%02x%02x%02x%02x%02x%02x\n",
++ DEBUG_INFO("NAT25: Lookup M:%02x%02x%02x%02x%02x%02x N:%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x"
++ "%02x%02x%02x%02x%02x%02x\n",
+ db->macAddr[0],
+ db->macAddr[1],
+ db->macAddr[2],
@@ -5430,7 +5425,7 @@ index 000000000000..2f84a38e2fdb
+ db->networkAddr[14],
+ db->networkAddr[15],
+ db->networkAddr[16]);
-+#else
++#else
+ DEBUG_INFO("NAT25: Lookup M:%02x%02x%02x%02x%02x%02x N:%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x\n",
+ db->macAddr[0],
+ db->macAddr[1],
@@ -5597,7 +5592,7 @@ index 000000000000..2f84a38e2fdb
+ int i;
+ _irqL irqL;
+ _enter_critical_bh(&priv->br_ext_lock, &irqL);
-+
++
+ for(i=0; i<NAT25_HASH_SIZE; i++)
+ {
+ struct nat25_network_db_entry *f;
@@ -5628,7 +5623,7 @@ index 000000000000..2f84a38e2fdb
+ int i;
+ _irqL irqL;
+ _enter_critical_bh(&priv->br_ext_lock, &irqL);
-+
++
+ //if(!priv->ethBrExtInfo.nat25_disable)
+ {
+ for (i=0; i<NAT25_HASH_SIZE; i++)
@@ -6387,13 +6382,13 @@ index 000000000000..2f84a38e2fdb
+ {
+ case NAT25_CHECK:
+ if (skb->data[0] & 1)
-+ return 0;
++ return 0;
+ return -1;
+
+ case NAT25_INSERT:
+ {
+ DEBUG_INFO("NAT25: Insert IP, SA=%4x:%4x:%4x:%4x:%4x:%4x:%4x:%4x,"
-+ " DA=%4x:%4x:%4x:%4x:%4x:%4x:%4x:%4x\n",
++ " DA=%4x:%4x:%4x:%4x:%4x:%4x:%4x:%4x\n",
+ iph->saddr.s6_addr16[0],iph->saddr.s6_addr16[1],iph->saddr.s6_addr16[2],iph->saddr.s6_addr16[3],
+ iph->saddr.s6_addr16[4],iph->saddr.s6_addr16[5],iph->saddr.s6_addr16[6],iph->saddr.s6_addr16[7],
+ iph->daddr.s6_addr16[0],iph->daddr.s6_addr16[1],iph->daddr.s6_addr16[2],iph->daddr.s6_addr16[3],
@@ -6404,10 +6399,10 @@ index 000000000000..2f84a38e2fdb
+ __nat25_db_network_insert(priv, skb->data+ETH_ALEN, networkAddr);
+ __nat25_db_print(priv);
+
-+ if (iph->nexthdr == IPPROTO_ICMPV6 &&
++ if (iph->nexthdr == IPPROTO_ICMPV6 &&
+ skb->len > (ETH_HLEN + sizeof(*iph) + 4)) {
-+ if (update_nd_link_layer_addr(skb->data + ETH_HLEN + sizeof(*iph),
-+ skb->len - ETH_HLEN - sizeof(*iph), GET_MY_HWADDR(priv))) {
++ if (update_nd_link_layer_addr(skb->data + ETH_HLEN + sizeof(*iph),
++ skb->len - ETH_HLEN - sizeof(*iph), GET_MY_HWADDR(priv))) {
+ struct icmp6hdr *hdr = (struct icmp6hdr *)(skb->data + ETH_HLEN + sizeof(*iph));
+ hdr->icmp6_cksum = 0;
+ hdr->icmp6_cksum = csum_ipv6_magic(&iph->saddr, &iph->daddr,
@@ -6415,26 +6410,26 @@ index 000000000000..2f84a38e2fdb
+ IPPROTO_ICMPV6,
+ csum_partial((__u8 *)hdr, iph->payload_len, 0));
+ }
-+ }
++ }
+ }
+ }
+ return 0;
+
+ case NAT25_LOOKUP:
+ DEBUG_INFO("NAT25: Lookup IP, SA=%4x:%4x:%4x:%4x:%4x:%4x:%4x:%4x,"
-+ " DA=%4x:%4x:%4x:%4x:%4x:%4x:%4x:%4x\n",
++ " DA=%4x:%4x:%4x:%4x:%4x:%4x:%4x:%4x\n",
+ iph->saddr.s6_addr16[0],iph->saddr.s6_addr16[1],iph->saddr.s6_addr16[2],iph->saddr.s6_addr16[3],
+ iph->saddr.s6_addr16[4],iph->saddr.s6_addr16[5],iph->saddr.s6_addr16[6],iph->saddr.s6_addr16[7],
+ iph->daddr.s6_addr16[0],iph->daddr.s6_addr16[1],iph->daddr.s6_addr16[2],iph->daddr.s6_addr16[3],
+ iph->daddr.s6_addr16[4],iph->daddr.s6_addr16[5],iph->daddr.s6_addr16[6],iph->daddr.s6_addr16[7]);
-+
++
+
+ __nat25_generate_ipv6_network_addr(networkAddr, (unsigned int *)&iph->daddr);
+ if (!__nat25_db_network_lookup_and_replace(priv, skb, networkAddr)) {
-+#ifdef SUPPORT_RX_UNI2MCAST
++#ifdef SUPPORT_RX_UNI2MCAST
+ if (iph->daddr.s6_addr[0] == 0xff)
-+ convert_ipv6_mac_to_mc(skb);
-+#endif
++ convert_ipv6_mac_to_mc(skb);
++#endif
+ }
+ return 0;
+
@@ -6495,12 +6490,12 @@ index 000000000000..2f84a38e2fdb
+ (*((unsigned short *)(skb->data+ETH_ALEN*2)) == __constant_htons(ETH_P_IP)) &&
+ !memcmp(priv->scdb_ip, skb->data+ETH_HLEN+16, 4)) {
+ memcpy(skb->data, priv->scdb_mac, ETH_ALEN);
-+
++
+ _exit_critical_bh(&priv->br_ext_lock, &irqL);
+ }
+ else {
+ _exit_critical_bh(&priv->br_ext_lock, &irqL);
-+
++
+ retval = nat25_db_handle(priv, skb, NAT25_LOOKUP);
+ }
+ }
@@ -6663,14 +6658,14 @@ index 000000000000..2f84a38e2fdb
+#endif // CONFIG_BR_EXT
diff --git a/drivers/net/wireless/realtek/rtl8192cu/core/rtw_cmd.c b/drivers/net/wireless/realtek/rtl8192cu/core/rtw_cmd.c
new file mode 100755
-index 000000000000..f906eb3489d1
+index 000000000000..2455304514c8
--- /dev/null
+++ b/drivers/net/wireless/realtek/rtl8192cu/core/rtw_cmd.c
-@@ -0,0 +1,3035 @@
+@@ -0,0 +1,3034 @@
+/******************************************************************************
+ *
+ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
-+ *
++ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
@@ -6706,47 +6701,47 @@ index 000000000000..f906eb3489d1
+sint _rtw_init_cmd_priv (struct cmd_priv *pcmdpriv)
+{
+ sint res=_SUCCESS;
-+
-+_func_enter_;
++
++_func_enter_;
+
+ _rtw_init_sema(&(pcmdpriv->cmd_queue_sema), 0);
+ //_rtw_init_sema(&(pcmdpriv->cmd_done_sema), 0);
+ _rtw_init_sema(&(pcmdpriv->terminate_cmdthread_sema), 0);
-+
-+
++
++
+ _rtw_init_queue(&(pcmdpriv->cmd_queue));
-+
++
+ //allocate DMA-able/Non-Page memory for cmd_buf and rsp_buf
-+
++
+ pcmdpriv->cmd_seq = 1;
-+
++
+ pcmdpriv->cmd_allocated_buf = rtw_zmalloc(MAX_CMDSZ + CMDBUFF_ALIGN_SZ);
-+
++
+ if (pcmdpriv->cmd_allocated_buf == NULL){
+ res= _FAIL;
+ goto exit;
+ }
-+
++
+ pcmdpriv->cmd_buf = pcmdpriv->cmd_allocated_buf + CMDBUFF_ALIGN_SZ - ( (SIZE_PTR)(pcmdpriv->cmd_allocated_buf) & (CMDBUFF_ALIGN_SZ-1));
-+
++
+ pcmdpriv->rsp_allocated_buf = rtw_zmalloc(MAX_RSPSZ + 4);
-+
++
+ if (pcmdpriv->rsp_allocated_buf == NULL){
+ res= _FAIL;
+ goto exit;
+ }
-+
++
+ pcmdpriv->rsp_buf = pcmdpriv->rsp_allocated_buf + 4 - ( (SIZE_PTR)(pcmdpriv->rsp_allocated_buf) & 3);
+
+ pcmdpriv->cmd_issued_cnt = pcmdpriv->cmd_done_cnt = pcmdpriv->rsp_cnt = 0;
+
+exit:
-+
-+_func_exit_;
++
++_func_exit_;
+
+ return res;
-+
-+}
++
++}
+
+#ifdef CONFIG_C2H_WK
+static void c2h_wk_callback(_workitem *work);
@@ -6755,15 +6750,15 @@ index 000000000000..f906eb3489d1
+{
+ sint res=_SUCCESS;
+
-+_func_enter_;
++_func_enter_;
+
+#ifdef CONFIG_H2CLBK
+ _rtw_init_sema(&(pevtpriv->lbkevt_done), 0);
+ pevtpriv->lbkevt_limit = 0;
+ pevtpriv->lbkevt_num = 0;
-+ pevtpriv->cmdevt_parm = NULL;
-+#endif
-+
++ pevtpriv->cmdevt_parm = NULL;
++#endif
++
+ //allocate DMA-able/Non-Page memory for cmd_buf and rsp_buf
+ ATOMIC_SET(&pevtpriv->event_seq, 0);
+ pevtpriv->evt_done_cnt = 0;
@@ -6773,17 +6768,17 @@ index 000000000000..f906eb3489d1
+ _rtw_init_sema(&(pevtpriv->evt_notify), 0);
+ _rtw_init_sema(&(pevtpriv->terminate_evtthread_sema), 0);
+
-+ pevtpriv->evt_allocated_buf = rtw_zmalloc(MAX_EVTSZ + 4);
++ pevtpriv->evt_allocated_buf = rtw_zmalloc(MAX_EVTSZ + 4);
+ if (pevtpriv->evt_allocated_buf == NULL){
+ res= _FAIL;
+ goto exit;
+ }
+ pevtpriv->evt_buf = pevtpriv->evt_allocated_buf + 4 - ((unsigned int)(pevtpriv->evt_allocated_buf) & 3);
-+
-+
++
++
+#ifdef CONFIG_SDIO_HCI
-+ pevtpriv->allocated_c2h_mem = rtw_zmalloc(C2H_MEM_SZ +4);
-+
++ pevtpriv->allocated_c2h_mem = rtw_zmalloc(C2H_MEM_SZ +4);
++
+ if (pevtpriv->allocated_c2h_mem == NULL){
+ res= _FAIL;
+ goto exit;
@@ -6793,7 +6788,7 @@ index 000000000000..f906eb3489d1
+ - ( (u32)(pevtpriv->allocated_c2h_mem) & 3);
+#ifdef PLATFORM_OS_XP
+ pevtpriv->pc2h_mdl= IoAllocateMdl((u8 *)pevtpriv->c2h_mem, C2H_MEM_SZ , FALSE, FALSE, NULL);
-+
++
+ if(pevtpriv->pc2h_mdl == NULL){
+ res= _FAIL;
+ goto exit;
@@ -6804,7 +6799,7 @@ index 000000000000..f906eb3489d1
+
+ _rtw_init_queue(&(pevtpriv->evt_queue));
+
-+exit:
++exit:
+
+#endif //end of CONFIG_EVENT_THREAD_MODE
+
@@ -6814,7 +6809,7 @@ index 000000000000..f906eb3489d1
+ pevtpriv->c2h_queue = rtw_cbuf_alloc(C2H_QUEUE_MAX_LEN+1);
+#endif
+
-+_func_exit_;
++_func_exit_;
+
+ return res;
+}
@@ -6851,7 +6846,7 @@ index 000000000000..f906eb3489d1
+
+ RT_TRACE(_module_rtl871x_cmd_c_,_drv_info_,("-_rtw_free_evt_priv \n"));
+
-+_func_exit_;
++_func_exit_;
+
+}
+
@@ -6867,17 +6862,17 @@ index 000000000000..f906eb3489d1
+
+ if (pcmdpriv->cmd_allocated_buf)
+ rtw_mfree(pcmdpriv->cmd_allocated_buf, MAX_CMDSZ + CMDBUFF_ALIGN_SZ);
-+
++
+ if (pcmdpriv->rsp_allocated_buf)
+ rtw_mfree(pcmdpriv->rsp_allocated_buf, MAX_RSPSZ + 4);
+ }
-+_func_exit_;
++_func_exit_;
+}
+
+/*
+Calling Context:
+
-+rtw_enqueue_cmd can only be called between kernel thread,
++rtw_enqueue_cmd can only be called between kernel thread,
+since only spin_lock is used.
+
+ISR/Call-Back functions can't call this sub-function.
@@ -6894,14 +6889,14 @@ index 000000000000..f906eb3489d1
+ goto exit;
+
+ //_enter_critical_bh(&queue->lock, &irqL);
-+ _enter_critical(&queue->lock, &irqL);
++ _enter_critical(&queue->lock, &irqL);
+
+ rtw_list_insert_tail(&obj->list, &queue->queue);
+
-+ //_exit_critical_bh(&queue->lock, &irqL);
++ //_exit_critical_bh(&queue->lock, &irqL);
+ _exit_critical(&queue->lock, &irqL);
+
-+exit:
++exit:
+
+_func_exit_;
+
@@ -6928,7 +6923,7 @@ index 000000000000..f906eb3489d1
+ //_exit_critical_bh(&(queue->lock), &irqL);
+ _exit_critical(&queue->lock, &irqL);
+
-+_func_exit_;
++_func_exit_;
+
+ return obj;
+}
@@ -6936,18 +6931,18 @@ index 000000000000..f906eb3489d1
+u32 rtw_init_cmd_priv(struct cmd_priv *pcmdpriv)
+{
+ u32 res;
-+_func_enter_;
++_func_enter_;
+ res = _rtw_init_cmd_priv (pcmdpriv);
-+_func_exit_;
-+ return res;
++_func_exit_;
++ return res;
+}
+
+u32 rtw_init_evt_priv (struct evt_priv *pevtpriv)
+{
+ int res;
-+_func_enter_;
++_func_enter_;
+ res = _rtw_init_evt_priv(pevtpriv);
-+_func_exit_;
++_func_exit_;
+ return res;
+}
+
@@ -6956,35 +6951,35 @@ index 000000000000..f906eb3489d1
+_func_enter_;
+ RT_TRACE(_module_rtl871x_cmd_c_,_drv_info_,("rtw_free_evt_priv\n"));
+ _rtw_free_evt_priv(pevtpriv);
-+_func_exit_;
-+}
++_func_exit_;
++}
+
+void rtw_free_cmd_priv (struct cmd_priv *pcmdpriv)
+{
+_func_enter_;
+ RT_TRACE(_module_rtl871x_cmd_c_,_drv_info_,("rtw_free_cmd_priv\n"));
+ _rtw_free_cmd_priv(pcmdpriv);
-+_func_exit_;
-+}
++_func_exit_;
++}
+
+int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj);
+int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj)
+{
+ u8 bAllow = _FALSE; //set to _TRUE to allow enqueuing cmd when hw_init_completed is _FALSE
-+
++
+ #ifdef SUPPORT_HW_RFOFF_DETECTED
+ //To decide allow or not
+ if( (pcmdpriv->padapter->pwrctrlpriv.bHWPwrPindetect)
+ &&(!pcmdpriv->padapter->registrypriv.usbss_enable)
-+ )
++ )
+ {
-+ if(cmd_obj->cmdcode == GEN_CMD_CODE(_Set_Drv_Extra) )
++ if(cmd_obj->cmdcode == GEN_CMD_CODE(_Set_Drv_Extra) )
+ {
-+ struct drvextra_cmd_parm *pdrvextra_cmd_parm = (struct drvextra_cmd_parm *)cmd_obj->parmbuf;
++ struct drvextra_cmd_parm *pdrvextra_cmd_parm = (struct drvextra_cmd_parm *)cmd_obj->parmbuf;
+ if(pdrvextra_cmd_parm->ec_id == POWER_SAVING_CTRL_WK_CID)
-+ {
++ {
+ //DBG_871X("==>enqueue POWER_SAVING_CTRL_WK_CID\n");
-+ bAllow = _TRUE;
++ bAllow = _TRUE;
+ }
+ }
+ }
@@ -7004,7 +6999,7 @@ index 000000000000..f906eb3489d1
+ //);
+
+ return _FAIL;
-+ }
++ }
+ return _SUCCESS;
+}
+
@@ -7014,9 +7009,9 @@ index 000000000000..f906eb3489d1
+{
+ int res = _FAIL;
+ PADAPTER padapter = pcmdpriv->padapter;
-+
-+_func_enter_;
-+
++
++_func_enter_;
++
+ if (cmd_obj == NULL) {
+ goto exit;
+ }
@@ -7027,7 +7022,7 @@ index 000000000000..f906eb3489d1
+ //change pcmdpriv to primary's pcmdpriv
+ if (padapter->adapter_type != PRIMARY_ADAPTER && padapter->pbuddy_adapter)
+ pcmdpriv = &(padapter->pbuddy_adapter->cmdpriv);
-+#endif
++#endif
+
+ if( _FAIL == (res=rtw_cmd_filter(pcmdpriv, cmd_obj)) ) {
+ rtw_free_cmd_obj(cmd_obj);
@@ -7038,9 +7033,9 @@ index 000000000000..f906eb3489d1
+
+ if(res == _SUCCESS)
+ _rtw_up_sema(&pcmdpriv->cmd_queue_sema);
-+
-+exit:
-+
++
++exit:
++
+_func_exit_;
+
+ return res;
@@ -7049,12 +7044,12 @@ index 000000000000..f906eb3489d1
+struct cmd_obj *rtw_dequeue_cmd(struct cmd_priv *pcmdpriv)
+{
+ struct cmd_obj *cmd_obj;
-+
-+_func_enter_;
++
++_func_enter_;
+
+ cmd_obj = _rtw_dequeue_cmd(&pcmdpriv->cmd_queue);
-+
-+_func_exit_;
++
++_func_exit_;
+ return cmd_obj;
+}
+
@@ -7063,7 +7058,7 @@ index 000000000000..f906eb3489d1
+_func_enter_;
+ pcmdpriv->cmd_done_cnt++;
+ //_rtw_up_sema(&(pcmdpriv->cmd_done_sema));
-+_func_exit_;
++_func_exit_;
+}
+
+void rtw_free_cmd_obj(struct cmd_obj *pcmd)
@@ -7074,21 +7069,21 @@ index 000000000000..f906eb3489d1
+ {
+ //free parmbuf in cmd_obj
+ rtw_mfree((unsigned char*)pcmd->parmbuf, pcmd->cmdsz);
-+ }
-+
++ }
++
+ if(pcmd->rsp!=NULL)
+ {
+ if(pcmd->rspsz!= 0)
+ {
+ //free rsp in cmd_obj
+ rtw_mfree((unsigned char*)pcmd->rsp, pcmd->rspsz);
-+ }
-+ }
++ }
++ }
+
+ //free cmd_obj
+ rtw_mfree((unsigned char*)pcmd, sizeof(struct cmd_obj));
-+
-+_func_exit_;
++
++_func_exit_;
+}
+
+void rtw_stop_cmd_thread(_adapter *adapter)
@@ -7111,7 +7106,7 @@ index 000000000000..f906eb3489d1
+ void (*pcmd_callback)(_adapter *dev, struct cmd_obj *pcmd);
+ _adapter *padapter = (_adapter *)context;
+ struct cmd_priv *pcmdpriv = &(padapter->cmdpriv);
-+
++
+_func_enter_;
+
+ thread_enter("RTW_CMD_THREAD");
@@ -7122,7 +7117,7 @@ index 000000000000..f906eb3489d1
+ pcmdpriv->stop_req = 0;
+ pcmdpriv->cmdthd_running=_TRUE;
+ _rtw_up_sema(&pcmdpriv->terminate_cmdthread_sema);
-+
++
+ RT_TRACE(_module_rtl871x_cmd_c_,_drv_info_,("start r871x rtw_cmd_thread !!!!\n"));
+
+ while(1)
@@ -7162,7 +7157,7 @@ index 000000000000..f906eb3489d1
+ if( _FAIL == rtw_cmd_filter(pcmdpriv, pcmd) )
+ {
+ pcmd->res = H2C_DROPPED;
-+ goto post_process;
++ goto post_process;
+ }
+
+ if( _FAIL == rtw_cmd_filter(pcmdpriv, pcmd) ) {
@@ -7229,7 +7224,7 @@ index 000000000000..f906eb3489d1
+
+ //DBG_871X("%s: leaving... drop cmdcode:%u\n", __FUNCTION__, pcmd->cmdcode);
+
-+ rtw_free_cmd_obj(pcmd);
++ rtw_free_cmd_obj(pcmd);
+ }while(1);
+
+ _rtw_up_sema(&pcmdpriv->terminate_cmdthread_sema);
@@ -7247,37 +7242,37 @@ index 000000000000..f906eb3489d1
+ _irqL irqL;
+ int res;
+ _queue *queue = &pevtpriv->evt_queue;
-+
-+_func_enter_;
+
-+ res = _SUCCESS;
++_func_enter_;
++
++ res = _SUCCESS;
+
+ if (obj == NULL) {
+ res = _FAIL;
+ goto exit;
-+ }
++ }
+
+ _enter_critical_bh(&queue->lock, &irqL);
+
+ rtw_list_insert_tail(&obj->list, &queue->queue);
-+
++
+ _exit_critical_bh(&queue->lock, &irqL);
+
+ //rtw_evt_notify_isr(pevtpriv);
+
+exit:
-+
-+_func_exit_;
+
-+ return res;
++_func_exit_;
++
++ return res;
+}
+
+struct evt_obj *rtw_dequeue_evt(_queue *queue)
+{
+ _irqL irqL;
+ struct evt_obj *pevtobj;
-+
-+_func_enter_;
++
++_func_enter_;
+
+ _enter_critical_bh(&queue->lock, &irqL);
+
@@ -7290,10 +7285,10 @@ index 000000000000..f906eb3489d1
+ }
+
+ _exit_critical_bh(&queue->lock, &irqL);
-+
-+_func_exit_;
+
-+ return pevtobj;
++_func_exit_;
++
++ return pevtobj;
+}
+
+void rtw_free_evt_obj(struct evt_obj *pevtobj)
@@ -7302,10 +7297,10 @@ index 000000000000..f906eb3489d1
+
+ if(pevtobj->parmbuf)
+ rtw_mfree((unsigned char*)pevtobj->parmbuf, pevtobj->evtsz);
-+
++
+ rtw_mfree((unsigned char*)pevtobj, sizeof(struct evt_obj));
-+
-+_func_exit_;
++
++_func_exit_;
+}
+
+void rtw_evt_notify_isr(struct evt_priv *pevtpriv)
@@ -7313,13 +7308,13 @@ index 000000000000..f906eb3489d1
+_func_enter_;
+ pevtpriv->evt_done_cnt++;
+ _rtw_up_sema(&(pevtpriv->evt_notify));
-+_func_exit_;
++_func_exit_;
+}
+#endif
+
+
+/*
-+u8 rtw_setstandby_cmd(unsigned char *adapter)
++u8 rtw_setstandby_cmd(unsigned char *adapter)
+*/
+u8 rtw_setstandby_cmd(_adapter *padapter, uint action)
+{
@@ -7328,16 +7323,16 @@ index 000000000000..f906eb3489d1
+ struct cmd_priv *pcmdpriv=&padapter->cmdpriv;
+
+ u8 ret = _SUCCESS;
-+
-+_func_enter_;
++
++_func_enter_;
+
+ ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
+ if (ph2c == NULL) {
+ ret = _FAIL;
+ goto exit;
+ }
-+
-+ psetusbsuspend = (struct usb_suspend_parm*)rtw_zmalloc(sizeof(struct usb_suspend_parm));
++
++ psetusbsuspend = (struct usb_suspend_parm*)rtw_zmalloc(sizeof(struct usb_suspend_parm));
+ if (psetusbsuspend == NULL) {
+ rtw_mfree((u8 *) ph2c, sizeof(struct cmd_obj));
+ ret = _FAIL;
@@ -7348,11 +7343,11 @@ index 000000000000..f906eb3489d1
+
+ init_h2fwcmd_w_parm_no_rsp(ph2c, psetusbsuspend, GEN_CMD_CODE(_SetUsbSuspend));
+
-+ ret = rtw_enqueue_cmd(pcmdpriv, ph2c);
-+
-+exit:
-+
-+_func_exit_;
++ ret = rtw_enqueue_cmd(pcmdpriv, ph2c);
++
++exit:
++
++_func_exit_;
+
+ return ret;
+}
@@ -7389,7 +7384,7 @@ index 000000000000..f906eb3489d1
+ if (ph2c == NULL)
+ return _FAIL;
+
-+ psurveyPara = (struct sitesurvey_parm*)rtw_zmalloc(sizeof(struct sitesurvey_parm));
++ psurveyPara = (struct sitesurvey_parm*)rtw_zmalloc(sizeof(struct sitesurvey_parm));
+ if (psurveyPara == NULL) {
+ rtw_mfree((unsigned char*) ph2c, sizeof(struct cmd_obj));
+ return _FAIL;
@@ -7444,7 +7439,7 @@ index 000000000000..f906eb3489d1
+ if (padapter->pbuddy_adapter == NULL )
+ goto full_scan_timeout;
+ if((padapter->pbuddy_adapter->mlmeextpriv.mlmext_info.state&0x03) == WIFI_FW_AP_STATE)
-+ _set_timer(&pmlmepriv->scan_to_timer,
++ _set_timer(&pmlmepriv->scan_to_timer,
+ SURVEY_TO * ( padapter->mlmeextpriv.max_chan_nums + ( padapter->mlmeextpriv.max_chan_nums / RTW_SCAN_NUM_OF_CH ) * RTW_STAY_AP_CH_MILLISECOND ) + 1000 );
+ else
+#endif //CONFIG_STA_MODE_SCAN_UNDER_AP_MODE
@@ -7458,7 +7453,7 @@ index 000000000000..f906eb3489d1
+ _clr_fwstate_(pmlmepriv, _FW_UNDER_SURVEY);
+ }
+
-+_func_exit_;
++_func_exit_;
+
+ return res;
+}
@@ -7470,7 +7465,7 @@ index 000000000000..f906eb3489d1
+ struct cmd_priv* pcmdpriv = &padapter->cmdpriv;
+ u8 res = _SUCCESS;
+
-+_func_enter_;
++_func_enter_;
+
+ ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
+ if (ph2c == NULL) {
@@ -7478,7 +7473,7 @@ index 000000000000..f906eb3489d1
+ goto exit;
+ }
+
-+ pbsetdataratepara = (struct setdatarate_parm*)rtw_zmalloc(sizeof(struct setdatarate_parm));
++ pbsetdataratepara = (struct setdatarate_parm*)rtw_zmalloc(sizeof(struct setdatarate_parm));
+ if (pbsetdataratepara == NULL) {
+ rtw_mfree((u8 *) ph2c, sizeof(struct cmd_obj));
+ res = _FAIL;
@@ -7515,7 +7510,7 @@ index 000000000000..f906eb3489d1
+ res= _FAIL;
+ goto exit;
+ }
-+ pssetbasicratepara = (struct setbasicrate_parm*)rtw_zmalloc(sizeof(struct setbasicrate_parm));
++ pssetbasicratepara = (struct setbasicrate_parm*)rtw_zmalloc(sizeof(struct setbasicrate_parm));
+
+ if (pssetbasicratepara == NULL) {
+ rtw_mfree((u8*) ph2c, sizeof(struct cmd_obj));
@@ -7525,19 +7520,19 @@ index 000000000000..f906eb3489d1
+
+ init_h2fwcmd_w_parm_no_rsp(ph2c, pssetbasicratepara, _SetBasicRate_CMD_);
+
-+ _rtw_memcpy(pssetbasicratepara->basicrates, rateset, NumRates);
++ _rtw_memcpy(pssetbasicratepara->basicrates, rateset, NumRates);
+
-+ res = rtw_enqueue_cmd(pcmdpriv, ph2c);
-+exit:
++ res = rtw_enqueue_cmd(pcmdpriv, ph2c);
++exit:
+
-+_func_exit_;
++_func_exit_;
+
+ return res;
+}
+
+
+/*
-+unsigned char rtw_setphy_cmd(unsigned char *adapter)
++unsigned char rtw_setphy_cmd(unsigned char *adapter)
+
+1. be called only after rtw_update_registrypriv_dev_network( ~) or mp testing program
+2. for AdHoc/Ap mode or mp mode?
@@ -7552,14 +7547,14 @@ index 000000000000..f906eb3489d1
+// struct registry_priv* pregistry_priv = &padapter->registrypriv;
+ u8 res=_SUCCESS;
+
-+_func_enter_;
++_func_enter_;
+
+ ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
+ if(ph2c==NULL){
+ res= _FAIL;
+ goto exit;
+ }
-+ psetphypara = (struct setphy_parm*)rtw_zmalloc(sizeof(struct setphy_parm));
++ psetphypara = (struct setphy_parm*)rtw_zmalloc(sizeof(struct setphy_parm));
+
+ if(psetphypara==NULL){
+ rtw_mfree((u8 *) ph2c, sizeof(struct cmd_obj));
@@ -7574,17 +7569,17 @@ index 000000000000..f906eb3489d1
+ psetphypara->modem = modem;
+ psetphypara->rfchannel = ch;
+
-+ res = rtw_enqueue_cmd(pcmdpriv, ph2c);
-+exit:
-+_func_exit_;
++ res = rtw_enqueue_cmd(pcmdpriv, ph2c);
++exit:
++_func_exit_;
+ return res;
+}
+
+u8 rtw_setbbreg_cmd(_adapter*padapter, u8 offset, u8 val)
-+{
++{
+ struct cmd_obj* ph2c;
+ struct writeBB_parm* pwritebbparm;
-+ struct cmd_priv *pcmdpriv=&padapter->cmdpriv;
++ struct cmd_priv *pcmdpriv=&padapter->cmdpriv;
+ u8 res=_SUCCESS;
+_func_enter_;
+ ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
@@ -7592,7 +7587,7 @@ index 000000000000..f906eb3489d1
+ res= _FAIL;
+ goto exit;
+ }
-+ pwritebbparm = (struct writeBB_parm*)rtw_zmalloc(sizeof(struct writeBB_parm));
++ pwritebbparm = (struct writeBB_parm*)rtw_zmalloc(sizeof(struct writeBB_parm));
+
+ if(pwritebbparm==NULL){
+ rtw_mfree((u8 *) ph2c, sizeof(struct cmd_obj));
@@ -7600,31 +7595,31 @@ index 000000000000..f906eb3489d1
+ goto exit;
+ }
+
-+ init_h2fwcmd_w_parm_no_rsp(ph2c, pwritebbparm, GEN_CMD_CODE(_SetBBReg));
++ init_h2fwcmd_w_parm_no_rsp(ph2c, pwritebbparm, GEN_CMD_CODE(_SetBBReg));
+
+ pwritebbparm->offset = offset;
+ pwritebbparm->value = val;
+
-+ res = rtw_enqueue_cmd(pcmdpriv, ph2c);
-+exit:
-+_func_exit_;
++ res = rtw_enqueue_cmd(pcmdpriv, ph2c);
++exit:
++_func_exit_;
+ return res;
+}
+
+u8 rtw_getbbreg_cmd(_adapter *padapter, u8 offset, u8 *pval)
-+{
++{
+ struct cmd_obj* ph2c;
+ struct readBB_parm* prdbbparm;
+ struct cmd_priv *pcmdpriv=&padapter->cmdpriv;
+ u8 res=_SUCCESS;
-+
++
+_func_enter_;
+ ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
+ if(ph2c==NULL){
+ res=_FAIL;
+ goto exit;
+ }
-+ prdbbparm = (struct readBB_parm*)rtw_zmalloc(sizeof(struct readBB_parm));
++ prdbbparm = (struct readBB_parm*)rtw_zmalloc(sizeof(struct readBB_parm));
+ +
+ if(prdbbparm ==NULL){
+ rtw_mfree((unsigned char *) ph2c, sizeof(struct cmd_obj));
@@ -7637,28 +7632,28 @@ index 000000000000..f906eb3489d1
+ ph2c->cmdsz = sizeof(struct readBB_parm);
+ ph2c->rsp = pval;
+ ph2c->rspsz = sizeof(struct readBB_rsp);
-+
++
+ prdbbparm ->offset = offset;
-+
-+ res = rtw_enqueue_cmd(pcmdpriv, ph2c);
++++
++ res = rtw_enqueue_cmd(pcmdpriv, ph2c);
+exit:
-+_func_exit_;
++_func_exit_;
+ return res;
+}
+
+u8 rtw_setrfreg_cmd(_adapter *padapter, u8 offset, u32 val)
-+{
++{
+ struct cmd_obj* ph2c;
+ struct writeRF_parm* pwriterfparm;
-+ struct cmd_priv *pcmdpriv=&padapter->cmdpriv;
++ struct cmd_priv *pcmdpriv=&padapter->cmdpriv;
+ u8 res=_SUCCESS;
+_func_enter_;
+ ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
+ if(ph2c==NULL){
-+ res= _FAIL;
++ res= _FAIL;
+ goto exit;
+ }
-+ pwriterfparm = (struct writeRF_parm*)rtw_zmalloc(sizeof(struct writeRF_parm));
++ pwriterfparm = (struct writeRF_parm*)rtw_zmalloc(sizeof(struct writeRF_parm));
+
+ if(pwriterfparm==NULL){
+ rtw_mfree((u8 *) ph2c, sizeof(struct cmd_obj));
@@ -7666,22 +7661,22 @@ index 000000000000..f906eb3489d1
+ goto exit;
+ }
+
-+ init_h2fwcmd_w_parm_no_rsp(ph2c, pwriterfparm, GEN_CMD_CODE(_SetRFReg));
++ init_h2fwcmd_w_parm_no_rsp(ph2c, pwriterfparm, GEN_CMD_CODE(_SetRFReg));
+
+ pwriterfparm->offset = offset;
+ pwriterfparm->value = val;
+
-+ res = rtw_enqueue_cmd(pcmdpriv, ph2c);
++ res = rtw_enqueue_cmd(pcmdpriv, ph2c);
+exit:
-+_func_exit_;
++_func_exit_;
+ return res;
+}
+
+u8 rtw_getrfreg_cmd(_adapter *padapter, u8 offset, u8 *pval)
-+{
++{
+ struct cmd_obj* ph2c;
+ struct readRF_parm* prdrfparm;
-+ struct cmd_priv *pcmdpriv=&padapter->cmdpriv;
++ struct cmd_priv *pcmdpriv=&padapter->cmdpriv;
+ u8 res=_SUCCESS;
+
+_func_enter_;
@@ -7692,7 +7687,7 @@ index 000000000000..f906eb3489d1
+ goto exit;
+ }
+
-+ prdrfparm = (struct readRF_parm*)rtw_zmalloc(sizeof(struct readRF_parm));
++ prdrfparm = (struct readRF_parm*)rtw_zmalloc(sizeof(struct readRF_parm));
+ if(prdrfparm ==NULL){
+ rtw_mfree((u8 *) ph2c, sizeof(struct cmd_obj));
+ res= _FAIL;
@@ -7705,40 +7700,40 @@ index 000000000000..f906eb3489d1
+ ph2c->cmdsz = sizeof(struct readRF_parm);
+ ph2c->rsp = pval;
+ ph2c->rspsz = sizeof(struct readRF_rsp);
-+
++
+ prdrfparm ->offset = offset;
-+
-+ res = rtw_enqueue_cmd(pcmdpriv, ph2c);
++
++ res = rtw_enqueue_cmd(pcmdpriv, ph2c);
+
+exit:
+
-+_func_exit_;
++_func_exit_;
+
+ return res;
+}
+
+void rtw_getbbrfreg_cmdrsp_callback(_adapter* padapter, struct cmd_obj *pcmd)
-+{
-+ _func_enter_;
-+
++{
++ _func_enter_;
++
+ //rtw_free_cmd_obj(pcmd);
+ rtw_mfree((unsigned char*) pcmd->parmbuf, pcmd->cmdsz);
+ rtw_mfree((unsigned char*) pcmd, sizeof(struct cmd_obj));
-+
-+#ifdef CONFIG_MP_INCLUDED
++
++#ifdef CONFIG_MP_INCLUDED
+ padapter->mppriv.workparam.bcompleted= _TRUE;
-+#endif
-+_func_exit_;
++#endif
++_func_exit_;
+}
+
+void rtw_readtssi_cmdrsp_callback(_adapter* padapter, struct cmd_obj *pcmd)
+{
-+ _func_enter_;
++ _func_enter_;
+
+ rtw_mfree((unsigned char*) pcmd->parmbuf, pcmd->cmdsz);
+ rtw_mfree((unsigned char*) pcmd, sizeof(struct cmd_obj));
-+
-+#ifdef CONFIG_MP_INCLUDED
++
++#ifdef CONFIG_MP_INCLUDED
+ padapter->mppriv.workparam.bcompleted= _TRUE;
+#endif
+
@@ -7758,11 +7753,11 @@ index 000000000000..f906eb3489d1
+ rtw_led_control(padapter, LED_CTL_START_TO_LINK);
+
+ if (pmlmepriv->assoc_ssid.SsidLength == 0){
-+ RT_TRACE(_module_rtl871x_cmd_c_,_drv_info_,(" createbss for Any SSid:%s\n",pmlmepriv->assoc_ssid.Ssid));
++ RT_TRACE(_module_rtl871x_cmd_c_,_drv_info_,(" createbss for Any SSid:%s\n",pmlmepriv->assoc_ssid.Ssid));
+ } else {
+ RT_TRACE(_module_rtl871x_cmd_c_,_drv_info_,(" createbss for SSid:%s\n", pmlmepriv->assoc_ssid.Ssid));
+ }
-+
++
+ pcmd = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
+ if(pcmd==NULL){
+ res= _FAIL;
@@ -7774,9 +7769,9 @@ index 000000000000..f906eb3489d1
+ pcmd->parmbuf = (unsigned char *)pdev_network;
+ pcmd->cmdsz = get_WLAN_BSSID_EX_sz((WLAN_BSSID_EX*)pdev_network);
+ pcmd->rsp = NULL;
-+ pcmd->rspsz = 0;
-+
-+ pdev_network->Length = pcmd->cmdsz;
++ pcmd->rspsz = 0;
++
++ pdev_network->Length = pcmd->cmdsz;
+
+#ifdef CONFIG_RTL8712
+ //notes: translate IELength & Length after assign the Length to cmdsz;
@@ -7785,11 +7780,11 @@ index 000000000000..f906eb3489d1
+ pdev_network->Ssid.SsidLength = cpu_to_le32(pdev_network->Ssid.SsidLength);
+#endif
+
-+ res = rtw_enqueue_cmd(pcmdpriv, pcmd);
++ res = rtw_enqueue_cmd(pcmdpriv, pcmd);
+
+exit:
+
-+_func_exit_;
++_func_exit_;
+
+ return res;
+}
@@ -7799,9 +7794,9 @@ index 000000000000..f906eb3489d1
+ struct cmd_obj* pcmd;
+ struct cmd_priv *pcmdpriv=&padapter->cmdpriv;
+ u8 res=_SUCCESS;
-+
++
+_func_enter_;
-+
++
+ pcmd = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
+ if(pcmd==NULL){
+ res= _FAIL;
@@ -7818,10 +7813,10 @@ index 000000000000..f906eb3489d1
+ res = rtw_enqueue_cmd(pcmdpriv, pcmd);
+
+exit:
-+
-+_func_exit_;
+
-+ return res;
++_func_exit_;
++
++ return res;
+}
+
+u8 rtw_joinbss_cmd(_adapter *padapter, struct wlan_network* pnetwork)
@@ -7856,12 +7851,12 @@ index 000000000000..f906eb3489d1
+ RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("rtw_joinbss_cmd: memory allocate for cmd_obj fail!!!\n"));
+ goto exit;
+ }
-+ /* // for IEs is pointer
-+ t_len = sizeof (ULONG) + sizeof (NDIS_802_11_MAC_ADDRESS) + 2 +
-+ sizeof (NDIS_802_11_SSID) + sizeof (ULONG) +
-+ sizeof (NDIS_802_11_RSSI) + sizeof (NDIS_802_11_NETWORK_TYPE) +
-+ sizeof (NDIS_802_11_CONFIGURATION) +
-+ sizeof (NDIS_802_11_NETWORK_INFRASTRUCTURE) +
++ /* // for IEs is pointer
++ t_len = sizeof (ULONG) + sizeof (NDIS_802_11_MAC_ADDRESS) + 2 +
++ sizeof (NDIS_802_11_SSID) + sizeof (ULONG) +
++ sizeof (NDIS_802_11_RSSI) + sizeof (NDIS_802_11_NETWORK_TYPE) +
++ sizeof (NDIS_802_11_CONFIGURATION) +
++ sizeof (NDIS_802_11_NETWORK_INFRASTRUCTURE) +
+ sizeof (NDIS_802_11_RATES_EX)+ sizeof(WLAN_PHY_INFO)+ sizeof (ULONG) + MAX_IE_SZ;
+ */
+ //for IEs is fix buf size
@@ -7894,18 +7889,18 @@ index 000000000000..f906eb3489d1
+ {
+ if(pcmd !=NULL)
+ rtw_mfree((unsigned char *)pcmd, sizeof(struct cmd_obj));
-+
++
+ res=_FAIL;
-+
++
+ RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("rtw_joinbss_cmd :psecnetwork==NULL!!!\n"));
-+
++
+ goto exit;
+ }
+
+ _rtw_memset(psecnetwork, 0, t_len);
+
+ _rtw_memcpy(psecnetwork, &pnetwork->network, get_WLAN_BSSID_EX_sz(&pnetwork->network));
-+
++
+ auth=&psecuritypriv->authenticator_ie[0];
+ psecuritypriv->authenticator_ie[0]=(unsigned char)psecnetwork->IELength;
+
@@ -7914,13 +7909,13 @@ index 000000000000..f906eb3489d1
+ } else {
+ _rtw_memcpy(&psecuritypriv->authenticator_ie[1], &psecnetwork->IEs[12], (256-1));
+ }
-+
++
+ psecnetwork->IELength = 0;
+ // Added by Albert 2009/02/18
+ // If the the driver wants to use the bssid to create the connection.
+ // If not, we have to copy the connecting AP's MAC address to it so that
+ // the driver just has the bssid information for PMKIDList searching.
-+
++
+ if ( pmlmepriv->assoc_by_bssid == _FALSE )
+ {
+ _rtw_memcpy( &pmlmepriv->assoc_bssid[ 0 ], &pnetwork->network.MacAddress[ 0 ], ETH_ALEN );
@@ -7930,23 +7925,23 @@ index 000000000000..f906eb3489d1
+
+
+ pqospriv->qos_option = 0;
-+
-+ if(pregistrypriv->wmm_enable)
-+ {
++
++ if(pregistrypriv->wmm_enable)
++ {
+ u32 tmp_len;
-+
-+ tmp_len = rtw_restruct_wmm_ie(padapter, &pnetwork->network.IEs[0], &psecnetwork->IEs[0], pnetwork->network.IELength, psecnetwork->IELength);
+
-+ if (psecnetwork->IELength != tmp_len)
++ tmp_len = rtw_restruct_wmm_ie(padapter, &pnetwork->network.IEs[0], &psecnetwork->IEs[0], pnetwork->network.IELength, psecnetwork->IELength);
++
++ if (psecnetwork->IELength != tmp_len)
+ {
+ psecnetwork->IELength = tmp_len;
+ pqospriv->qos_option = 1; //There is WMM IE in this corresp. beacon
+ }
-+ else
++ else
+ {
+ pqospriv->qos_option = 0;//There is no WMM IE in this corresp. beacon
-+ }
-+ }
++ }
++ }
+
+#ifdef CONFIG_80211N_HT
+ phtpriv->ht_option = _FALSE;
@@ -7960,7 +7955,7 @@ index 000000000000..f906eb3489d1
+ ( padapter->securitypriv.dot11PrivacyAlgrthm != _TKIP_ ))
+ {
+ //rtw_restructure_ht_ie
-+ rtw_restructure_ht_ie(padapter, &pnetwork->network.IEs[0], &psecnetwork->IEs[0],
++ rtw_restructure_ht_ie(padapter, &pnetwork->network.IEs[0], &psecnetwork->IEs[0],
+ pnetwork->network.IELength, &psecnetwork->IELength, (u8)psecnetwork->Configuration.DSConfig );
+ }
+ }
@@ -7981,11 +7976,11 @@ index 000000000000..f906eb3489d1
+ _rtw_memcpy(&psecuritypriv->supplicant_ie[1], &psecnetwork->IEs[0], (256-1));
+ }
+ #endif
-+
++
+ pcmd->cmdsz = get_WLAN_BSSID_EX_sz(psecnetwork);//get cmdsz before endian conversion
+
+#ifdef CONFIG_RTL8712
-+ //wlan_network endian conversion
++ //wlan_network endian conversion
+ psecnetwork->Length = cpu_to_le32(psecnetwork->Length);
+ psecnetwork->Ssid.SsidLength= cpu_to_le32(psecnetwork->Ssid.SsidLength);
+ psecnetwork->Privacy = cpu_to_le32(psecnetwork->Privacy);
@@ -7997,10 +7992,10 @@ index 000000000000..f906eb3489d1
+ psecnetwork->Configuration.FHConfig.DwellTime=cpu_to_le32(psecnetwork->Configuration.FHConfig.DwellTime);
+ psecnetwork->Configuration.FHConfig.HopPattern=cpu_to_le32(psecnetwork->Configuration.FHConfig.HopPattern);
+ psecnetwork->Configuration.FHConfig.HopSet=cpu_to_le32(psecnetwork->Configuration.FHConfig.HopSet);
-+ psecnetwork->Configuration.FHConfig.Length=cpu_to_le32(psecnetwork->Configuration.FHConfig.Length);
++ psecnetwork->Configuration.FHConfig.Length=cpu_to_le32(psecnetwork->Configuration.FHConfig.Length);
+ psecnetwork->Configuration.Length = cpu_to_le32(psecnetwork->Configuration.Length);
+ psecnetwork->InfrastructureMode = cpu_to_le32(psecnetwork->InfrastructureMode);
-+ psecnetwork->IELength = cpu_to_le32(psecnetwork->IELength);
++ psecnetwork->IELength = cpu_to_le32(psecnetwork->IELength);
+#endif
+
+ _rtw_init_listhead(&pcmd->list);
@@ -8012,7 +8007,7 @@ index 000000000000..f906eb3489d1
+ res = rtw_enqueue_cmd(pcmdpriv, pcmd);
+
+exit:
-+
++
+_func_exit_;
+
+ return res;
@@ -8056,7 +8051,7 @@ index 000000000000..f906eb3489d1
+
+exit:
+
-+_func_exit_;
++_func_exit_;
+
+ return res;
+}
@@ -8071,12 +8066,12 @@ index 000000000000..f906eb3489d1
+
+_func_enter_;
+
-+ ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
++ ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
+ if(ph2c==NULL){
+ res= _FALSE;
+ goto exit;
+ }
-+ psetop = (struct setopmode_parm*)rtw_zmalloc(sizeof(struct setopmode_parm));
++ psetop = (struct setopmode_parm*)rtw_zmalloc(sizeof(struct setopmode_parm));
+
+ if(psetop==NULL){
+ rtw_mfree((u8 *) ph2c, sizeof(struct cmd_obj));
@@ -8091,7 +8086,7 @@ index 000000000000..f906eb3489d1
+
+exit:
+
-+_func_exit_;
++_func_exit_;
+
+ return res;
+}
@@ -8102,7 +8097,7 @@ index 000000000000..f906eb3489d1
+ struct set_stakey_parm *psetstakey_para;
+ struct cmd_priv *pcmdpriv=&padapter->cmdpriv;
+ struct set_stakey_rsp *psetstakey_rsp = NULL;
-+
++
+ struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
+ struct security_priv *psecuritypriv = &padapter->securitypriv;
+ struct sta_info* sta = (struct sta_info* )psta;
@@ -8123,7 +8118,7 @@ index 000000000000..f906eb3489d1
+ goto exit;
+ }
+
-+ psetstakey_rsp = (struct set_stakey_rsp*)rtw_zmalloc(sizeof(struct set_stakey_rsp));
++ psetstakey_rsp = (struct set_stakey_rsp*)rtw_zmalloc(sizeof(struct set_stakey_rsp));
+ if(psetstakey_rsp == NULL){
+ rtw_mfree((u8 *) ph2c, sizeof(struct cmd_obj));
+ rtw_mfree((u8 *) psetstakey_para, sizeof(struct set_stakey_parm));
@@ -8136,9 +8131,9 @@ index 000000000000..f906eb3489d1
+ ph2c->rspsz = sizeof(struct set_stakey_rsp);
+
+ _rtw_memcpy(psetstakey_para->addr, sta->hwaddr,ETH_ALEN);
-+
++
+ if(check_fwstate(pmlmepriv, WIFI_STATION_STATE)){
-+#ifdef CONFIG_TDLS
++#ifdef CONFIG_TDLS
+ if(sta->tdls_sta_state&TDLS_LINKED_STATE)
+ psetstakey_para->algorithm=(u8)sta->dot118021XPrivacy;
+ else
@@ -8162,11 +8157,11 @@ index 000000000000..f906eb3489d1
+ //jeff: set this becasue at least sw key is ready
+ padapter->securitypriv.busetkipkey=_TRUE;
+
-+ res = rtw_enqueue_cmd(pcmdpriv, ph2c);
++ res = rtw_enqueue_cmd(pcmdpriv, ph2c);
+
+exit:
+
-+_func_exit_;
++_func_exit_;
+
+ return res;
+}
@@ -8176,7 +8171,7 @@ index 000000000000..f906eb3489d1
+ struct cmd_obj* ph2c;
+ struct set_stakey_parm *psetstakey_para;
+ struct cmd_priv *pcmdpriv=&padapter->cmdpriv;
-+ struct set_stakey_rsp *psetstakey_rsp = NULL;
++ struct set_stakey_rsp *psetstakey_rsp = NULL;
+ struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
+ struct security_priv *psecuritypriv = &padapter->securitypriv;
+ struct sta_info* sta = (struct sta_info* )psta;
@@ -8203,7 +8198,7 @@ index 000000000000..f906eb3489d1
+ goto exit;
+ }
+
-+ psetstakey_rsp = (struct set_stakey_rsp*)rtw_zmalloc(sizeof(struct set_stakey_rsp));
++ psetstakey_rsp = (struct set_stakey_rsp*)rtw_zmalloc(sizeof(struct set_stakey_rsp));
+ if(psetstakey_rsp == NULL){
+ rtw_mfree((u8 *) ph2c, sizeof(struct cmd_obj));
+ rtw_mfree((u8 *) psetstakey_para, sizeof(struct set_stakey_parm));
@@ -8220,14 +8215,14 @@ index 000000000000..f906eb3489d1
+ psetstakey_para->algorithm = _NO_PRIVACY_;
+
+ psetstakey_para->id = entry;
-+
-+ res = rtw_enqueue_cmd(pcmdpriv, ph2c);
-+
++
++ res = rtw_enqueue_cmd(pcmdpriv, ph2c);
++
+ }
-+
++
+exit:
+
-+_func_exit_;
++_func_exit_;
+
+ return res;
+}
@@ -8235,17 +8230,17 @@ index 000000000000..f906eb3489d1
+u8 rtw_setrttbl_cmd(_adapter *padapter, struct setratable_parm *prate_table)
+{
+ struct cmd_obj* ph2c;
-+ struct setratable_parm * psetrttblparm;
++ struct setratable_parm * psetrttblparm;
+ struct cmd_priv *pcmdpriv=&padapter->cmdpriv;
+ u8 res=_SUCCESS;
-+_func_enter_;
++_func_enter_;
+
+ ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
+ if(ph2c==NULL){
+ res= _FAIL;
+ goto exit;
+ }
-+ psetrttblparm = (struct setratable_parm*)rtw_zmalloc(sizeof(struct setratable_parm));
++ psetrttblparm = (struct setratable_parm*)rtw_zmalloc(sizeof(struct setratable_parm));
+
+ if(psetrttblparm==NULL){
+ rtw_mfree((unsigned char *) ph2c, sizeof(struct cmd_obj));
@@ -8257,9 +8252,9 @@ index 000000000000..f906eb3489d1
+
+ _rtw_memcpy(psetrttblparm,prate_table,sizeof(struct setratable_parm));
+
-+ res = rtw_enqueue_cmd(pcmdpriv, ph2c);
++ res = rtw_enqueue_cmd(pcmdpriv, ph2c);
+exit:
-+_func_exit_;
++_func_exit_;
+ return res;
+
+}
@@ -8267,17 +8262,17 @@ index 000000000000..f906eb3489d1
+u8 rtw_getrttbl_cmd(_adapter *padapter, struct getratable_rsp *pval)
+{
+ struct cmd_obj* ph2c;
-+ struct getratable_parm * pgetrttblparm;
++ struct getratable_parm * pgetrttblparm;
+ struct cmd_priv *pcmdpriv=&padapter->cmdpriv;
+ u8 res=_SUCCESS;
-+_func_enter_;
++_func_enter_;
+
+ ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
+ if(ph2c==NULL){
+ res= _FAIL;
+ goto exit;
+ }
-+ pgetrttblparm = (struct getratable_parm*)rtw_zmalloc(sizeof(struct getratable_parm));
++ pgetrttblparm = (struct getratable_parm*)rtw_zmalloc(sizeof(struct getratable_parm));
+
+ if(pgetrttblparm==NULL){
+ rtw_mfree((unsigned char *) ph2c, sizeof(struct cmd_obj));
@@ -8293,12 +8288,12 @@ index 000000000000..f906eb3489d1
+ ph2c->cmdsz = sizeof(struct getratable_parm);
+ ph2c->rsp = (u8*)pval;
+ ph2c->rspsz = sizeof(struct getratable_rsp);
-+
++
+ pgetrttblparm ->rsvd = 0x0;
-+
-+ res = rtw_enqueue_cmd(pcmdpriv, ph2c);
++
++ res = rtw_enqueue_cmd(pcmdpriv, ph2c);
+exit:
-+_func_exit_;
++_func_exit_;
+ return res;
+
+}
@@ -8307,12 +8302,12 @@ index 000000000000..f906eb3489d1
+{
+ struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
+ struct cmd_obj* ph2c;
-+ struct set_assocsta_parm *psetassocsta_para;
++ struct set_assocsta_parm *psetassocsta_para;
+ struct set_stakey_rsp *psetassocsta_rsp = NULL;
+
+ u8 res=_SUCCESS;
+
-+_func_enter_;
++_func_enter_;
+
+ ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
+ if(ph2c==NULL){
@@ -8327,7 +8322,7 @@ index 000000000000..f906eb3489d1
+ goto exit;
+ }
+
-+ psetassocsta_rsp = (struct set_stakey_rsp*)rtw_zmalloc(sizeof(struct set_assocsta_rsp));
++ psetassocsta_rsp = (struct set_stakey_rsp*)rtw_zmalloc(sizeof(struct set_assocsta_rsp));
+ if(psetassocsta_rsp==NULL){
+ rtw_mfree((u8 *) ph2c, sizeof(struct cmd_obj));
+ rtw_mfree((u8 *) psetassocsta_para, sizeof(struct set_assocsta_parm));
@@ -8339,12 +8334,12 @@ index 000000000000..f906eb3489d1
+ ph2c->rspsz = sizeof(struct set_assocsta_rsp);
+
+ _rtw_memcpy(psetassocsta_para->addr, mac_addr,ETH_ALEN);
-+
-+ res = rtw_enqueue_cmd(pcmdpriv, ph2c);
++
++ res = rtw_enqueue_cmd(pcmdpriv, ph2c);
+
+exit:
+
-+_func_exit_;
++_func_exit_;
+
+ return res;
+ }
@@ -8356,16 +8351,16 @@ index 000000000000..f906eb3489d1
+ struct addBaReq_parm *paddbareq_parm;
+
+ u8 res=_SUCCESS;
-+
-+_func_enter_;
+
-+ ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
++_func_enter_;
++
++ ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
+ if(ph2c==NULL){
+ res= _FAIL;
+ goto exit;
+ }
-+
-+ paddbareq_parm = (struct addBaReq_parm*)rtw_zmalloc(sizeof(struct addBaReq_parm));
++
++ paddbareq_parm = (struct addBaReq_parm*)rtw_zmalloc(sizeof(struct addBaReq_parm));
+ if(paddbareq_parm==NULL){
+ rtw_mfree((unsigned char *)ph2c, sizeof(struct cmd_obj));
+ res= _FAIL;
@@ -8379,11 +8374,11 @@ index 000000000000..f906eb3489d1
+
+ //DBG_871X("rtw_addbareq_cmd, tid=%d\n", tid);
+
-+ //rtw_enqueue_cmd(pcmdpriv, ph2c);
++ //rtw_enqueue_cmd(pcmdpriv, ph2c);
+ res = rtw_enqueue_cmd(pcmdpriv, ph2c);
-+
++
+exit:
-+
++
+_func_exit_;
+
+ return res;
@@ -8392,19 +8387,19 @@ index 000000000000..f906eb3489d1
+u8 rtw_reset_securitypriv_cmd(_adapter*padapter)
+{
+ struct cmd_obj* ph2c;
-+ struct drvextra_cmd_parm *pdrvextra_cmd_parm;
++ struct drvextra_cmd_parm *pdrvextra_cmd_parm;
+ struct cmd_priv *pcmdpriv=&padapter->cmdpriv;
+ u8 res=_SUCCESS;
-+
-+_func_enter_;
+
-+ ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
++_func_enter_;
++
++ ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
+ if(ph2c==NULL){
+ res= _FAIL;
+ goto exit;
+ }
-+
-+ pdrvextra_cmd_parm = (struct drvextra_cmd_parm*)rtw_zmalloc(sizeof(struct drvextra_cmd_parm));
++
++ pdrvextra_cmd_parm = (struct drvextra_cmd_parm*)rtw_zmalloc(sizeof(struct drvextra_cmd_parm));
+ if(pdrvextra_cmd_parm==NULL){
+ rtw_mfree((unsigned char *)ph2c, sizeof(struct cmd_obj));
+ res= _FAIL;
@@ -8417,12 +8412,12 @@ index 000000000000..f906eb3489d1
+
+ init_h2fwcmd_w_parm_no_rsp(ph2c, pdrvextra_cmd_parm, GEN_CMD_CODE(_Set_Drv_Extra));
+
-+
-+ //rtw_enqueue_cmd(pcmdpriv, ph2c);
++
++ //rtw_enqueue_cmd(pcmdpriv, ph2c);
+ res = rtw_enqueue_cmd(pcmdpriv, ph2c);
-+
++
+exit:
-+
++
+_func_exit_;
+
+ return res;
@@ -8432,19 +8427,19 @@ index 000000000000..f906eb3489d1
+u8 rtw_free_assoc_resources_cmd(_adapter*padapter)
+{
+ struct cmd_obj* ph2c;
-+ struct drvextra_cmd_parm *pdrvextra_cmd_parm;
++ struct drvextra_cmd_parm *pdrvextra_cmd_parm;
+ struct cmd_priv *pcmdpriv=&padapter->cmdpriv;
+ u8 res=_SUCCESS;
-+
-+_func_enter_;
+
-+ ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
++_func_enter_;
++
++ ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
+ if(ph2c==NULL){
+ res= _FAIL;
+ goto exit;
+ }
-+
-+ pdrvextra_cmd_parm = (struct drvextra_cmd_parm*)rtw_zmalloc(sizeof(struct drvextra_cmd_parm));
++
++ pdrvextra_cmd_parm = (struct drvextra_cmd_parm*)rtw_zmalloc(sizeof(struct drvextra_cmd_parm));
+ if(pdrvextra_cmd_parm==NULL){
+ rtw_mfree((unsigned char *)ph2c, sizeof(struct cmd_obj));
+ res= _FAIL;
@@ -8457,12 +8452,12 @@ index 000000000000..f906eb3489d1
+
+ init_h2fwcmd_w_parm_no_rsp(ph2c, pdrvextra_cmd_parm, GEN_CMD_CODE(_Set_Drv_Extra));
+
-+
-+ //rtw_enqueue_cmd(pcmdpriv, ph2c);
++
++ //rtw_enqueue_cmd(pcmdpriv, ph2c);
+ res = rtw_enqueue_cmd(pcmdpriv, ph2c);
-+
++
+exit:
-+
++
+_func_exit_;
+
+ return res;
@@ -8473,11 +8468,11 @@ index 000000000000..f906eb3489d1
+u8 rtw_dynamic_chk_wk_cmd(_adapter*padapter)
+{
+ struct cmd_obj* ph2c;
-+ struct drvextra_cmd_parm *pdrvextra_cmd_parm;
++ struct drvextra_cmd_parm *pdrvextra_cmd_parm;
+ struct cmd_priv *pcmdpriv=&padapter->cmdpriv;
+ u8 res=_SUCCESS;
-+
-+_func_enter_;
++
++_func_enter_;
+
+ if ((padapter->bDriverStopped == _TRUE)||(padapter->bSurpriseRemoved== _TRUE))
+ goto exit;
@@ -8488,13 +8483,13 @@ index 000000000000..f906eb3489d1
+ pcmdpriv = &(padapter->pbuddy_adapter->cmdpriv);
+#endif
+
-+ ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
++ ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
+ if(ph2c==NULL){
+ res= _FAIL;
+ goto exit;
+ }
-+
-+ pdrvextra_cmd_parm = (struct drvextra_cmd_parm*)rtw_zmalloc(sizeof(struct drvextra_cmd_parm));
++
++ pdrvextra_cmd_parm = (struct drvextra_cmd_parm*)rtw_zmalloc(sizeof(struct drvextra_cmd_parm));
+ if(pdrvextra_cmd_parm==NULL){
+ rtw_mfree((unsigned char *)ph2c, sizeof(struct cmd_obj));
+ res= _FAIL;
@@ -8507,12 +8502,12 @@ index 000000000000..f906eb3489d1
+
+ init_h2fwcmd_w_parm_no_rsp(ph2c, pdrvextra_cmd_parm, GEN_CMD_CODE(_Set_Drv_Extra));
+
-+
-+ //rtw_enqueue_cmd(pcmdpriv, ph2c);
++
++ //rtw_enqueue_cmd(pcmdpriv, ph2c);
+ res = rtw_enqueue_cmd(pcmdpriv, ph2c);
-+
++
+exit:
-+
++
+_func_exit_;
+
+ return res;
@@ -8559,7 +8554,7 @@ index 000000000000..f906eb3489d1
+ /* no need to enqueue, do the cmd hdl directly and free cmd parameter */
+ if( H2C_SUCCESS !=set_ch_hdl(padapter, (u8 *)set_ch_parm) )
+ res = _FAIL;
-+
++
+ rtw_mfree((u8 *)set_ch_parm, sizeof(*set_ch_parm));
+ }
+
@@ -8569,7 +8564,7 @@ index 000000000000..f906eb3489d1
+
+ DBG_871X(FUNC_NDEV_FMT" res:%u\n", FUNC_NDEV_ARG(padapter->pnetdev), res);
+
-+_func_exit_;
++_func_exit_;
+
+ return res;
+}
@@ -8618,17 +8613,17 @@ index 000000000000..f906eb3489d1
+ //no need to enqueue, do the cmd hdl directly and free cmd parameter
+ if( H2C_SUCCESS !=set_chplan_hdl(padapter, (unsigned char *)setChannelPlan_param) )
+ res = _FAIL;
-+
++
+ rtw_mfree((u8 *)setChannelPlan_param, sizeof(struct SetChannelPlan_param));
+ }
+
+ //do something based on res...
+ if(res == _SUCCESS)
+ padapter->mlmepriv.ChannelPlan = chplan;
-+
++
+exit:
+
-+_func_exit_;
++_func_exit_;
+
+ return res;
+}
@@ -8644,7 +8639,7 @@ index 000000000000..f906eb3489d1
+_func_enter_;
+
+ RT_TRACE(_module_rtl871x_cmd_c_, _drv_notice_, ("+rtw_led_blink_cmd\n"));
-+
++
+ pcmdobj = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
+ if(pcmdobj == NULL){
+ res=_FAIL;
@@ -8659,13 +8654,13 @@ index 000000000000..f906eb3489d1
+ }
+
+ ledBlink_param->pLed=pLed;
-+
++
+ init_h2fwcmd_w_parm_no_rsp(pcmdobj, ledBlink_param, GEN_CMD_CODE(_LedBlink));
+ res = rtw_enqueue_cmd(pcmdpriv, pcmdobj);
-+
++
+exit:
+
-+_func_exit_;
++_func_exit_;
+
+ return res;
+}
@@ -8682,7 +8677,7 @@ index 000000000000..f906eb3489d1
+_func_enter_;
+
+ RT_TRACE(_module_rtl871x_cmd_c_, _drv_notice_, ("+rtw_set_csa_cmd\n"));
-+
++
+ pcmdobj = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
+ if(pcmdobj == NULL){
+ res=_FAIL;
@@ -8697,13 +8692,13 @@ index 000000000000..f906eb3489d1
+ }
+
+ setChannelSwitch_param->new_ch_no=new_ch_no;
-+
++
+ init_h2fwcmd_w_parm_no_rsp(pcmdobj, setChannelSwitch_param, GEN_CMD_CODE(_SetChannelSwitch));
+ res = rtw_enqueue_cmd(pcmdpriv, pcmdobj);
-+
++
+exit:
+
-+_func_exit_;
++_func_exit_;
+
+ return res;
+}
@@ -8737,18 +8732,18 @@ index 000000000000..f906eb3489d1
+ }
+
+ _rtw_spinlock(&(padapter->tdlsinfo.cmd_lock));
-+ _rtw_memcpy(TDLSoption->addr, addr, 6);
++ _rtw_memcpy(TDLSoption->addr, addr, 6);
+ TDLSoption->option = option;
+ _rtw_spinunlock(&(padapter->tdlsinfo.cmd_lock));
+ init_h2fwcmd_w_parm_no_rsp(pcmdobj, TDLSoption, GEN_CMD_CODE(_TDLS));
+ res = rtw_enqueue_cmd(pcmdpriv, pcmdobj);
+
+#endif //CONFIG_TDLS
-+
++
+exit:
+
+
-+_func_exit_;
++_func_exit_;
+
+ return res;
+}
@@ -8771,7 +8766,7 @@ index 000000000000..f906eb3489d1
+ //
+ // Determine if our traffic is busy now
+ //
-+ if((check_fwstate(pmlmepriv, _FW_LINKED)== _TRUE)
++ if((check_fwstate(pmlmepriv, _FW_LINKED)== _TRUE)
+ /*&& !MgntInitAdapterInProgress(pMgntInfo)*/)
+ {
+
@@ -8871,19 +8866,19 @@ index 000000000000..f906eb3489d1
+ pmlmepriv->LinkDetectInfo.bHigherBusyTraffic = bHigherBusyTraffic;
+ pmlmepriv->LinkDetectInfo.bHigherBusyRxTraffic = bHigherBusyRxTraffic;
+ pmlmepriv->LinkDetectInfo.bHigherBusyTxTraffic = bHigherBusyTxTraffic;
-+
++
+}
+
+void dynamic_chk_wk_hdl(_adapter *padapter, u8 *pbuf, int sz);
+void dynamic_chk_wk_hdl(_adapter *padapter, u8 *pbuf, int sz)
+{
+ struct mlme_priv *pmlmepriv;
-+
++
+ if ((padapter->bDriverStopped == _TRUE)||(padapter->bSurpriseRemoved== _TRUE))
+ return;
+
+ if((void*)padapter != (void*)pbuf && padapter->pbuddy_adapter == NULL)
-+ return;
++ return;
+
+ padapter = (_adapter *)pbuf;
+
@@ -8895,25 +8890,25 @@ index 000000000000..f906eb3489d1
+#ifdef CONFIG_ACTIVE_KEEP_ALIVE_CHECK
+#ifdef CONFIG_AP_MODE
+ if(check_fwstate(pmlmepriv, WIFI_AP_STATE) == _TRUE)
-+ {
++ {
+ expire_timeout_chk(padapter);
+ }
+#endif
+#endif //CONFIG_ACTIVE_KEEP_ALIVE_CHECK
+
-+ #ifdef DBG_CONFIG_ERROR_DETECT
++ #ifdef DBG_CONFIG_ERROR_DETECT
+ rtw_hal_sreset_xmit_status_check(padapter);
-+ #endif
++ #endif
+
+ //if(check_fwstate(pmlmepriv, _FW_UNDER_LINKING|_FW_UNDER_SURVEY)==_FALSE)
+ {
-+ linked_status_chk(padapter);
++ linked_status_chk(padapter);
+ traffic_status_watchdog(padapter);
+ }
+
+ rtw_hal_dm_watchdog(padapter);
+
-+ //check_hw_pbc(padapter, pdrvextra_cmd->pbuf, pdrvextra_cmd->type_size);
++ //check_hw_pbc(padapter, pdrvextra_cmd->pbuf, pdrvextra_cmd->type_size);
+
+}
+
@@ -8925,7 +8920,7 @@ index 000000000000..f906eb3489d1
+ struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv;
+ struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
+ u8 mstatus;
-+
++
+_func_enter_;
+
+ if((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == _TRUE)
@@ -8973,11 +8968,11 @@ index 000000000000..f906eb3489d1
+u8 rtw_lps_ctrl_wk_cmd(_adapter*padapter, u8 lps_ctrl_type, u8 enqueue)
+{
+ struct cmd_obj *ph2c;
-+ struct drvextra_cmd_parm *pdrvextra_cmd_parm;
++ struct drvextra_cmd_parm *pdrvextra_cmd_parm;
+ struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
+ //struct pwrctrl_priv *pwrctrlpriv = &padapter->pwrctrlpriv;
+ u8 res = _SUCCESS;
-+
++
+_func_enter_;
+
+ //if(!pwrctrlpriv->bLeisurePs)
@@ -8990,13 +8985,13 @@ index 000000000000..f906eb3489d1
+
+ if(enqueue)
+ {
-+ ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
++ ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
+ if(ph2c==NULL){
+ res= _FAIL;
+ goto exit;
+ }
-+
-+ pdrvextra_cmd_parm = (struct drvextra_cmd_parm*)rtw_zmalloc(sizeof(struct drvextra_cmd_parm));
++
++ pdrvextra_cmd_parm = (struct drvextra_cmd_parm*)rtw_zmalloc(sizeof(struct drvextra_cmd_parm));
+ if(pdrvextra_cmd_parm==NULL){
+ rtw_mfree((unsigned char *)ph2c, sizeof(struct cmd_obj));
+ res= _FAIL;
@@ -9015,9 +9010,9 @@ index 000000000000..f906eb3489d1
+ {
+ lps_ctrl_wk_hdl(padapter, lps_ctrl_type);
+ }
-+
++
+exit:
-+
++
+_func_exit_;
+
+ return res;
@@ -9035,7 +9030,7 @@ index 000000000000..f906eb3489d1
+u8 rtw_antenna_select_cmd(_adapter*padapter, u8 antenna,u8 enqueue)
+{
+ struct cmd_obj *ph2c;
-+ struct drvextra_cmd_parm *pdrvextra_cmd_parm;
++ struct drvextra_cmd_parm *pdrvextra_cmd_parm;
+ struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
+ u8 bSupportAntDiv = _FALSE;
+ u8 res = _SUCCESS;
@@ -9046,7 +9041,7 @@ index 000000000000..f906eb3489d1
+
+ if(_TRUE == enqueue)
+ {
-+ ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
++ ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
+ if(ph2c==NULL){
+ res= _FAIL;
+ goto exit;
@@ -9103,7 +9098,7 @@ index 000000000000..f906eb3489d1
+ struct wifidirect_info *pwdinfo= &(padapter->wdinfo);
+ struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
+ u8 res = _SUCCESS;
-+
++
+_func_enter_;
+
+ if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
@@ -9111,13 +9106,13 @@ index 000000000000..f906eb3489d1
+ return res;
+ }
+
-+ ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
++ ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
+ if(ph2c==NULL){
+ res= _FAIL;
+ goto exit;
+ }
-+
-+ pdrvextra_cmd_parm = (struct drvextra_cmd_parm*)rtw_zmalloc(sizeof(struct drvextra_cmd_parm));
++
++ pdrvextra_cmd_parm = (struct drvextra_cmd_parm*)rtw_zmalloc(sizeof(struct drvextra_cmd_parm));
+ if(pdrvextra_cmd_parm==NULL){
+ rtw_mfree((unsigned char *)ph2c, sizeof(struct cmd_obj));
+ res= _FAIL;
@@ -9131,9 +9126,9 @@ index 000000000000..f906eb3489d1
+ init_h2fwcmd_w_parm_no_rsp(ph2c, pdrvextra_cmd_parm, GEN_CMD_CODE(_Set_Drv_Extra));
+
+ res = rtw_enqueue_cmd(pcmdpriv, ph2c);
-+
++
+exit:
-+
++
+_func_exit_;
+
+ return res;
@@ -9144,9 +9139,9 @@ index 000000000000..f906eb3489d1
+u8 rtw_ps_cmd(_adapter*padapter)
+{
+ struct cmd_obj *ppscmd;
-+ struct drvextra_cmd_parm *pdrvextra_cmd_parm;
++ struct drvextra_cmd_parm *pdrvextra_cmd_parm;
+ struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
-+
++
+ u8 res = _SUCCESS;
+_func_enter_;
+
@@ -9154,28 +9149,28 @@ index 000000000000..f906eb3489d1
+ if (padapter->adapter_type != PRIMARY_ADAPTER)
+ goto exit;
+#endif
-+
-+ ppscmd = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
++
++ ppscmd = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
+ if(ppscmd==NULL){
+ res= _FAIL;
+ goto exit;
+ }
-+
-+ pdrvextra_cmd_parm = (struct drvextra_cmd_parm*)rtw_zmalloc(sizeof(struct drvextra_cmd_parm));
++
++ pdrvextra_cmd_parm = (struct drvextra_cmd_parm*)rtw_zmalloc(sizeof(struct drvextra_cmd_parm));
+ if(pdrvextra_cmd_parm==NULL){
+ rtw_mfree((unsigned char *)ppscmd, sizeof(struct cmd_obj));
+ res= _FAIL;
+ goto exit;
+ }
+
-+ pdrvextra_cmd_parm->ec_id = POWER_SAVING_CTRL_WK_CID;
++ pdrvextra_cmd_parm->ec_id = POWER_SAVING_CTRL_WK_CID;
+ pdrvextra_cmd_parm->pbuf = NULL;
+ init_h2fwcmd_w_parm_no_rsp(ppscmd, pdrvextra_cmd_parm, GEN_CMD_CODE(_Set_Drv_Extra));
+
+ res = rtw_enqueue_cmd(pcmdpriv, ppscmd);
-+
++
+exit:
-+
++
+_func_exit_;
+
+ return res;
@@ -9202,36 +9197,36 @@ index 000000000000..f906eb3489d1
+ rtw_msleep_os(100);
+
+ cnt++;
-+
++
+ if(cnt>10)
-+ break;
++ break;
+ }
+
+ if(cnt<=10)
+ {
+ pstapriv->tim_bitmap &= ~BIT(0);
+ pstapriv->sta_dz_bitmap &= ~BIT(0);
-+
++
+ update_beacon(padapter, _TIM_IE_, NULL, _FALSE);
-+ }
-+ }
-+
++ }
++ }
++
+}
+
+u8 rtw_chk_hi_queue_cmd(_adapter*padapter)
+{
+ struct cmd_obj *ph2c;
-+ struct drvextra_cmd_parm *pdrvextra_cmd_parm;
++ struct drvextra_cmd_parm *pdrvextra_cmd_parm;
+ struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
+ u8 res = _SUCCESS;
-+
-+ ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
++
++ ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
+ if(ph2c==NULL){
+ res= _FAIL;
+ goto exit;
+ }
-+
-+ pdrvextra_cmd_parm = (struct drvextra_cmd_parm*)rtw_zmalloc(sizeof(struct drvextra_cmd_parm));
++
++ pdrvextra_cmd_parm = (struct drvextra_cmd_parm*)rtw_zmalloc(sizeof(struct drvextra_cmd_parm));
+ if(pdrvextra_cmd_parm==NULL){
+ rtw_mfree((unsigned char *)ph2c, sizeof(struct cmd_obj));
+ res= _FAIL;
@@ -9245,9 +9240,9 @@ index 000000000000..f906eb3489d1
+ init_h2fwcmd_w_parm_no_rsp(ph2c, pdrvextra_cmd_parm, GEN_CMD_CODE(_Set_Drv_Extra));
+
+ res = rtw_enqueue_cmd(pcmdpriv, ph2c);
-+
++
+exit:
-+
++
+ return res;
+
+}
@@ -9280,9 +9275,9 @@ index 000000000000..f906eb3489d1
+ init_h2fwcmd_w_parm_no_rsp(ph2c, pdrvextra_cmd_parm, GEN_CMD_CODE(_Set_Drv_Extra));
+
+ res = rtw_enqueue_cmd(pcmdpriv, ph2c);
-+
++
+exit:
-+
++
+ return res;
+}
+
@@ -9295,7 +9290,7 @@ index 000000000000..f906eb3489d1
+ /* No c2h event in cmd_obj, read c2h event before handling*/
+ if (c2h_evt_read(adapter, buf) == _SUCCESS) {
+ c2h_evt = (struct c2h_evt_hdr *)buf;
-+
++
+ if (filter && filter(c2h_evt->id) == _FALSE)
+ goto exit;
+
@@ -9340,7 +9335,7 @@ index 000000000000..f906eb3489d1
+ rtw_mfree((u8*)c2h_evt, 16);
+ continue;
+ }
-+
++
+ if (ccx_id_filter(c2h_evt->id) == _TRUE) {
+ /* Handle CCX report here */
+ rtw_hal_c2h_handler(adapter, c2h_evt);
@@ -9363,14 +9358,14 @@ index 000000000000..f906eb3489d1
+ return H2C_PARAMETERS_ERROR;
+
+ pdrvextra_cmd = (struct drvextra_cmd_parm*)pbuf;
-+
++
+ switch(pdrvextra_cmd->ec_id)
+ {
+ case DYNAMIC_CHK_WK_CID:
+ dynamic_chk_wk_hdl(padapter, pdrvextra_cmd->pbuf, pdrvextra_cmd->type_size);
+ break;
+ case POWER_SAVING_CTRL_WK_CID:
-+ power_saving_wk_hdl(padapter, pdrvextra_cmd->pbuf, pdrvextra_cmd->type_size);
++ power_saving_wk_hdl(padapter, pdrvextra_cmd->pbuf, pdrvextra_cmd->type_size);
+ break;
+#ifdef CONFIG_LPS
+ case LPS_CTRL_WK_CID:
@@ -9443,26 +9438,26 @@ index 000000000000..f906eb3489d1
+ else if (pcmd->res != H2C_SUCCESS) {
+ _set_timer(&pmlmepriv->scan_to_timer, 1);
+ RT_TRACE(_module_rtl871x_cmd_c_,_drv_err_,("\n ********Error: MgntActrtw_set_802_11_bssid_LIST_SCAN Fail ************\n\n."));
-+ }
++ }
+
+ // free cmd
+ rtw_free_cmd_obj(pcmd);
+
-+_func_exit_;
++_func_exit_;
+}
+void rtw_disassoc_cmd_callback(_adapter* padapter, struct cmd_obj *pcmd)
+{
+ _irqL irqL;
+ struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
-+
-+_func_enter_;
++
++_func_enter_;
+
+ if (pcmd->res != H2C_SUCCESS)
+ {
+ _enter_critical_bh(&pmlmepriv->lock, &irqL);
+ set_fwstate(pmlmepriv, _FW_LINKED);
+ _exit_critical_bh(&pmlmepriv->lock, &irqL);
-+
++
+ RT_TRACE(_module_rtl871x_cmd_c_,_drv_err_,("\n ***Error: disconnect_cmd_callback Fail ***\n."));
+
+ goto exit;
@@ -9474,10 +9469,10 @@ index 000000000000..f906eb3489d1
+
+ // free cmd
+ rtw_free_cmd_obj(pcmd);
-+
++
+exit:
-+
-+_func_exit_;
++
++_func_exit_;
+}
+
+
@@ -9485,7 +9480,7 @@ index 000000000000..f906eb3489d1
+{
+ struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
+
-+_func_enter_;
++_func_enter_;
+
+ if(pcmd->res == H2C_DROPPED)
+ {
@@ -9494,75 +9489,75 @@ index 000000000000..f906eb3489d1
+ _set_timer(&pmlmepriv->assoc_timer, 1);
+ }
+ else if(pcmd->res != H2C_SUCCESS)
-+ {
++ {
+ RT_TRACE(_module_rtl871x_cmd_c_,_drv_err_,("********Error:rtw_select_and_join_from_scanned_queue Wait Sema Fail ************\n"));
-+ _set_timer(&pmlmepriv->assoc_timer, 1);
++ _set_timer(&pmlmepriv->assoc_timer, 1);
+ }
-+
++
+ rtw_free_cmd_obj(pcmd);
-+
-+_func_exit_;
++
++_func_exit_;
+}
+
+void rtw_createbss_cmd_callback(_adapter *padapter, struct cmd_obj *pcmd)
-+{
++{
+ _irqL irqL;
+ u8 timer_cancelled;
+ struct sta_info *psta = NULL;
-+ struct wlan_network *pwlan = NULL;
-+ struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
++ struct wlan_network *pwlan = NULL;
++ struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
+ WLAN_BSSID_EX *pnetwork = (WLAN_BSSID_EX *)pcmd->parmbuf;
+ struct wlan_network *tgt_network = &(pmlmepriv->cur_network);
+
-+_func_enter_;
++_func_enter_;
+
+ if((pcmd->res != H2C_SUCCESS))
-+ {
++ {
+ RT_TRACE(_module_rtl871x_cmd_c_,_drv_err_,("\n ********Error: rtw_createbss_cmd_callback Fail ************\n\n."));
-+ _set_timer(&pmlmepriv->assoc_timer, 1 );
++ _set_timer(&pmlmepriv->assoc_timer, 1 );
+ }
-+
++
+ _cancel_timer(&pmlmepriv->assoc_timer, &timer_cancelled);
+
+#ifdef CONFIG_FW_MLMLE
+ //endian_convert
+ pnetwork->Length = le32_to_cpu(pnetwork->Length);
-+ pnetwork->Ssid.SsidLength = le32_to_cpu(pnetwork->Ssid.SsidLength);
++ pnetwork->Ssid.SsidLength = le32_to_cpu(pnetwork->Ssid.SsidLength);
+ pnetwork->Privacy =le32_to_cpu(pnetwork->Privacy);
+ pnetwork->Rssi = le32_to_cpu(pnetwork->Rssi);
-+ pnetwork->NetworkTypeInUse =le32_to_cpu(pnetwork->NetworkTypeInUse);
++ pnetwork->NetworkTypeInUse =le32_to_cpu(pnetwork->NetworkTypeInUse);
+ pnetwork->Configuration.ATIMWindow = le32_to_cpu(pnetwork->Configuration.ATIMWindow);
+ //pnetwork->Configuration.BeaconPeriod = le32_to_cpu(pnetwork->Configuration.BeaconPeriod);
+ pnetwork->Configuration.DSConfig =le32_to_cpu(pnetwork->Configuration.DSConfig);
+ pnetwork->Configuration.FHConfig.DwellTime=le32_to_cpu(pnetwork->Configuration.FHConfig.DwellTime);
+ pnetwork->Configuration.FHConfig.HopPattern=le32_to_cpu(pnetwork->Configuration.FHConfig.HopPattern);
+ pnetwork->Configuration.FHConfig.HopSet=le32_to_cpu(pnetwork->Configuration.FHConfig.HopSet);
-+ pnetwork->Configuration.FHConfig.Length=le32_to_cpu(pnetwork->Configuration.FHConfig.Length);
++ pnetwork->Configuration.FHConfig.Length=le32_to_cpu(pnetwork->Configuration.FHConfig.Length);
+ pnetwork->Configuration.Length = le32_to_cpu(pnetwork->Configuration.Length);
+ pnetwork->InfrastructureMode = le32_to_cpu(pnetwork->InfrastructureMode);
+ pnetwork->IELength = le32_to_cpu(pnetwork->IELength);
+#endif
-+
++
+ _enter_critical_bh(&pmlmepriv->lock, &irqL);
-+
-+
++
++
+ if(check_fwstate(pmlmepriv, WIFI_AP_STATE) )
+ {
+ psta = rtw_get_stainfo(&padapter->stapriv, pnetwork->MacAddress);
+ if(!psta)
+ {
+ psta = rtw_alloc_stainfo(&padapter->stapriv, pnetwork->MacAddress);
-+ if (psta == NULL)
-+ {
++ if (psta == NULL)
++ {
+ RT_TRACE(_module_rtl871x_cmd_c_,_drv_err_,("\nCan't alloc sta_info when createbss_cmd_callback\n"));
+ goto createbss_cmd_fail ;
+ }
-+ }
-+
++ }
++
+ rtw_indicate_connect( padapter);
+ }
+ else
-+ {
++ {
+ _irqL irqL;
+
+ pwlan = _rtw_alloc_network(pmlmepriv);
@@ -9576,13 +9571,13 @@ index 000000000000..f906eb3489d1
+ _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
+ goto createbss_cmd_fail;
+ }
-+ pwlan->last_scanned = rtw_get_current_time();
-+ }
++ pwlan->last_scanned = rtw_get_current_time();
++ }
+ else
+ {
+ rtw_list_insert_tail(&(pwlan->list), &pmlmepriv->scanned_queue.queue);
+ }
-+
++
+ pnetwork->Length = get_WLAN_BSSID_EX_sz(pnetwork);
+ _rtw_memcpy(&(pwlan->network), pnetwork, pnetwork->Length);
+ //pwlan->fixed = _TRUE;
@@ -9597,7 +9592,7 @@ index 000000000000..f906eb3489d1
+
+ _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
+
-+#if 0
++#if 0
+ if((pmlmepriv->fw_state) & WIFI_AP_STATE)
+ {
+ psta = rtw_alloc_stainfo(&padapter->stapriv, pnetwork->MacAddress);
@@ -9606,26 +9601,26 @@ index 000000000000..f906eb3489d1
+ RT_TRACE(_module_rtl871x_cmd_c_,_drv_err_,("\nCan't alloc sta_info when createbss_cmd_callback\n"));
+ goto createbss_cmd_fail ;
+ }
-+
++
+ rtw_indicate_connect( padapter);
+ }
+ else {
+
+ //rtw_indicate_disconnect(dev);
-+ }
++ }
+#endif
+ _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
+ // we will set _FW_LINKED when there is one more sat to join us (rtw_stassoc_event_callback)
-+
++
+ }
+
+createbss_cmd_fail:
-+
++
+ _exit_critical_bh(&pmlmepriv->lock, &irqL);
+
+ rtw_free_cmd_obj(pcmd);
-+
-+_func_exit_;
++
++_func_exit_;
+
+}
+
@@ -9633,85 +9628,84 @@ index 000000000000..f906eb3489d1
+
+void rtw_setstaKey_cmdrsp_callback(_adapter* padapter , struct cmd_obj *pcmd)
+{
-+
++
+ struct sta_priv * pstapriv = &padapter->stapriv;
+ struct set_stakey_rsp* psetstakey_rsp = (struct set_stakey_rsp*) (pcmd->rsp);
+ struct sta_info* psta = rtw_get_stainfo(pstapriv, psetstakey_rsp->addr);
+
-+_func_enter_;
++_func_enter_;
+
+ if(psta==NULL)
+ {
+ RT_TRACE(_module_rtl871x_cmd_c_,_drv_err_,("\nERROR: rtw_setstaKey_cmdrsp_callback => can't get sta_info \n\n"));
+ goto exit;
+ }
-+
++
+ //psta->aid = psta->mac_id = psetstakey_rsp->keyid; //CAM_ID(CAM_ENTRY)
-+
-+exit:
++
++exit:
+
+ rtw_free_cmd_obj(pcmd);
-+
-+_func_exit_;
++
++_func_exit_;
+
+}
+void rtw_setassocsta_cmdrsp_callback(_adapter* padapter, struct cmd_obj *pcmd)
+{
+ _irqL irqL;
+ struct sta_priv * pstapriv = &padapter->stapriv;
-+ struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
++ struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
+ struct set_assocsta_parm* passocsta_parm = (struct set_assocsta_parm*)(pcmd->parmbuf);
-+ struct set_assocsta_rsp* passocsta_rsp = (struct set_assocsta_rsp*) (pcmd->rsp);
++ struct set_assocsta_rsp* passocsta_rsp = (struct set_assocsta_rsp*) (pcmd->rsp);
+ struct sta_info* psta = rtw_get_stainfo(pstapriv, passocsta_parm->addr);
+
-+_func_enter_;
-+
++_func_enter_;
++
+ if(psta==NULL)
+ {
+ RT_TRACE(_module_rtl871x_cmd_c_,_drv_err_,("\nERROR: setassocsta_cmdrsp_callbac => can't get sta_info \n\n"));
+ goto exit;
+ }
-+
++
+ psta->aid = psta->mac_id = passocsta_rsp->cam_id;
+
+ _enter_critical_bh(&pmlmepriv->lock, &irqL);
+
-+ if ((check_fwstate(pmlmepriv, WIFI_MP_STATE) == _TRUE) && (check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == _TRUE))
++ if ((check_fwstate(pmlmepriv, WIFI_MP_STATE) == _TRUE) && (check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == _TRUE))
+ _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
+
-+ set_fwstate(pmlmepriv, _FW_LINKED);
++ set_fwstate(pmlmepriv, _FW_LINKED);
+ _exit_critical_bh(&pmlmepriv->lock, &irqL);
+
-+exit:
++exit:
+ rtw_free_cmd_obj(pcmd);
+
-+_func_exit_;
++_func_exit_;
+}
+
+void rtw_getrttbl_cmd_cmdrsp_callback(_adapter* padapter, struct cmd_obj *pcmd);
+void rtw_getrttbl_cmd_cmdrsp_callback(_adapter* padapter, struct cmd_obj *pcmd)
+{
-+_func_enter_;
-+
++_func_enter_;
++
+ rtw_free_cmd_obj(pcmd);
+#ifdef CONFIG_MP_INCLUDED
+ padapter->mppriv.workparam.bcompleted=_TRUE;
+#endif
+
-+_func_exit_;
++_func_exit_;
+
+}
-+
diff --git a/drivers/net/wireless/realtek/rtl8192cu/core/rtw_debug.c b/drivers/net/wireless/realtek/rtl8192cu/core/rtw_debug.c
new file mode 100755
-index 000000000000..f70fcb7b2cd1
+index 000000000000..2268c1aafd86
--- /dev/null
+++ b/drivers/net/wireless/realtek/rtl8192cu/core/rtw_debug.c
-@@ -0,0 +1,1337 @@
+@@ -0,0 +1,1336 @@
+/******************************************************************************
+ *
+ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
-+ *
++ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
@@ -9778,11 +9772,11 @@ index 000000000000..f70fcb7b2cd1
+ int *eof, void *data)
+{
+ struct net_device *dev = data;
-+
++
+ int len = 0;
+
+ len += snprintf(page + len, count - len, "%s\n", DRIVERVERSION);
-+
++
+ *eof = 1;
+ return len;
+}
@@ -9794,7 +9788,7 @@ index 000000000000..f70fcb7b2cd1
+ struct net_device *dev = data;
+ _adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
+ struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
-+
++
+ int len = 0;
+
+ len += snprintf(page + len, count - len,
@@ -9817,7 +9811,7 @@ index 000000000000..f70fcb7b2cd1
+ if (count < 1)
+ return -EFAULT;
+
-+ if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
++ if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
+
+ int num = sscanf(tmp, "%d ", &is_signal_dbg);
+
@@ -9827,16 +9821,16 @@ index 000000000000..f70fcb7b2cd1
+ printk("%d\n", GlobalDebugLevel);
+ }
+ }
-+
++
+ return count;
-+
++
+}
+
+#ifdef DBG_MEM_ALLOC
+int proc_get_mstat(char *page, char **start,
+ off_t offset, int count,
+ int *eof, void *data)
-+{
++{
+ int len = 0;
+
+ len += _rtw_mstat_dump(page+len, count-len);
@@ -9866,9 +9860,9 @@ index 000000000000..f70fcb7b2cd1
+ {
+ DBG_871X("argument size is less than 3\n");
+ return -EFAULT;
-+ }
++ }
+
-+ if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
++ if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
+
+ int num = sscanf(tmp, "%x %x %x", &addr, &val, &len);
+
@@ -9880,23 +9874,23 @@ index 000000000000..f70fcb7b2cd1
+ switch(len)
+ {
+ case 1:
-+ rtw_write8(padapter, addr, (u8)val);
++ rtw_write8(padapter, addr, (u8)val);
+ break;
+ case 2:
-+ rtw_write16(padapter, addr, (u16)val);
++ rtw_write16(padapter, addr, (u16)val);
+ break;
+ case 4:
-+ rtw_write32(padapter, addr, val);
++ rtw_write32(padapter, addr, val);
+ break;
+ default:
+ DBG_871X("error write length=%d", len);
+ break;
-+ }
-+
++ }
++
+ }
-+
++
+ return count;
-+
++
+}
+
+static u32 proc_get_read_addr=0xeeeeeeee;
@@ -9905,21 +9899,21 @@ index 000000000000..f70fcb7b2cd1
+int proc_get_read_reg(char *page, char **start,
+ off_t offset, int count,
+ int *eof, void *data)
-+{
++{
+ struct net_device *dev = data;
-+ _adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
-+
++ _adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
++
+ int len = 0;
+
+ if(proc_get_read_addr==0xeeeeeeee)
+ {
+ *eof = 1;
+ return len;
-+ }
++ }
+
+ switch(proc_get_read_len)
+ {
-+ case 1:
++ case 1:
+ len += snprintf(page + len, count - len, "rtw_read8(0x%x)=0x%x\n", proc_get_read_addr, rtw_read8(padapter, proc_get_read_addr));
+ break;
+ case 2:
@@ -9948,9 +9942,9 @@ index 000000000000..f70fcb7b2cd1
+ {
+ DBG_871X("argument size is less than 2\n");
+ return -EFAULT;
-+ }
++ }
+
-+ if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
++ if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
+
+ int num = sscanf(tmp, "%x %x", &addr, &len);
+
@@ -9960,10 +9954,10 @@ index 000000000000..f70fcb7b2cd1
+ }
+
+ proc_get_read_addr = addr;
-+
++
+ proc_get_read_len = len;
+ }
-+
++
+ return count;
+
+}
@@ -9975,11 +9969,11 @@ index 000000000000..f70fcb7b2cd1
+ struct net_device *dev = data;
+ _adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
+ struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
-+
++
+ int len = 0;
+
+ len += snprintf(page + len, count - len, "fwstate=0x%x\n", get_fwstate(pmlmepriv));
-+
++
+ *eof = 1;
+ return len;
+}
@@ -9989,15 +9983,15 @@ index 000000000000..f70fcb7b2cd1
+ int *eof, void *data)
+{
+ struct net_device *dev = data;
-+ _adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
++ _adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
+ struct security_priv *psecuritypriv = &padapter->securitypriv;
-+
++
+ int len = 0;
+
-+ len += snprintf(page + len, count - len, "auth_alg=0x%x, enc_alg=0x%x, auth_type=0x%x, enc_type=0x%x\n",
++ len += snprintf(page + len, count - len, "auth_alg=0x%x, enc_alg=0x%x, auth_type=0x%x, enc_type=0x%x\n",
+ psecuritypriv->dot11AuthAlgrthm, psecuritypriv->dot11PrivacyAlgrthm,
+ psecuritypriv->ndisauthtype, psecuritypriv->ndisencryptstatus);
-+
++
+ *eof = 1;
+ return len;
+}
@@ -10007,14 +10001,14 @@ index 000000000000..f70fcb7b2cd1
+ int *eof, void *data)
+{
+ struct net_device *dev = data;
-+ _adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
++ _adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
+ struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
+ struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
-+
++
+ int len = 0;
+
+ len += snprintf(page + len, count - len, "pmlmeinfo->state=0x%x\n", pmlmeinfo->state);
-+
++
+ *eof = 1;
+ return len;
+}
@@ -10026,11 +10020,11 @@ index 000000000000..f70fcb7b2cd1
+ struct net_device *dev = data;
+ _adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
+ struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
-+
++
+ int len = 0;
+
+ len += snprintf(page + len, count - len, "qos_option=%d\n", pmlmepriv->qospriv.qos_option);
-+
++
+ *eof = 1;
+ return len;
+
@@ -10043,11 +10037,11 @@ index 000000000000..f70fcb7b2cd1
+ struct net_device *dev = data;
+ _adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
+ struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
-+
++
+ int len = 0;
+
+ len += snprintf(page + len, count - len, "ht_option=%d\n", pmlmepriv->htpriv.ht_option);
-+
++
+ *eof = 1;
+ return len;
+}
@@ -10088,29 +10082,29 @@ index 000000000000..f70fcb7b2cd1
+ {
+ int i;
+ struct recv_reorder_ctrl *preorder_ctrl;
-+
-+ len += snprintf(page + len, count - len, "SSID=%s\n", cur_network->network.Ssid.Ssid);
++
++ len += snprintf(page + len, count - len, "SSID=%s\n", cur_network->network.Ssid.Ssid);
+ len += snprintf(page + len, count - len, "sta's macaddr:" MAC_FMT "\n", MAC_ARG(psta->hwaddr));
-+ len += snprintf(page + len, count - len, "cur_channel=%d, cur_bwmode=%d, cur_ch_offset=%d\n", pmlmeext->cur_channel, pmlmeext->cur_bwmode, pmlmeext->cur_ch_offset);
++ len += snprintf(page + len, count - len, "cur_channel=%d, cur_bwmode=%d, cur_ch_offset=%d\n", pmlmeext->cur_channel, pmlmeext->cur_bwmode, pmlmeext->cur_ch_offset);
+ len += snprintf(page + len, count - len, "rtsen=%d, cts2slef=%d\n", psta->rtsen, psta->cts2self);
-+ len += snprintf(page + len, count - len, "qos_en=%d, ht_en=%d, init_rate=%d\n", psta->qos_option, psta->htpriv.ht_option, psta->init_rate);
-+ len += snprintf(page + len, count - len, "state=0x%x, aid=%d, macid=%d, raid=%d\n", psta->state, psta->aid, psta->mac_id, psta->raid);
-+ len += snprintf(page + len, count - len, "bwmode=%d, ch_offset=%d, sgi=%d\n", psta->htpriv.bwmode, psta->htpriv.ch_offset, psta->htpriv.sgi);
-+ len += snprintf(page + len, count - len, "ampdu_enable = %d\n", psta->htpriv.ampdu_enable);
++ len += snprintf(page + len, count - len, "qos_en=%d, ht_en=%d, init_rate=%d\n", psta->qos_option, psta->htpriv.ht_option, psta->init_rate);
++ len += snprintf(page + len, count - len, "state=0x%x, aid=%d, macid=%d, raid=%d\n", psta->state, psta->aid, psta->mac_id, psta->raid);
++ len += snprintf(page + len, count - len, "bwmode=%d, ch_offset=%d, sgi=%d\n", psta->htpriv.bwmode, psta->htpriv.ch_offset, psta->htpriv.sgi);
++ len += snprintf(page + len, count - len, "ampdu_enable = %d\n", psta->htpriv.ampdu_enable);
+ len += snprintf(page + len, count - len, "agg_enable_bitmap=%x, candidate_tid_bitmap=%x\n", psta->htpriv.agg_enable_bitmap, psta->htpriv.candidate_tid_bitmap);
-+
++
+ for(i=0;i<16;i++)
-+ {
++ {
+ preorder_ctrl = &psta->recvreorder_ctrl[i];
+ if(preorder_ctrl->enable)
+ {
+ len += snprintf(page + len, count - len, "tid=%d, indicate_seq=%d\n", i, preorder_ctrl->indicate_seq);
+ }
-+ }
-+
++ }
++
+ }
+ else
-+ {
++ {
+ len += snprintf(page + len, count - len, "can't get sta's macaddr, cur_network's macaddr:" MAC_FMT "\n", MAC_ARG(cur_network->network.MacAddress));
+ }
+
@@ -10126,15 +10120,15 @@ index 000000000000..f70fcb7b2cd1
+ struct net_device *dev = data;
+ _adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
+ int len = 0;
-+
-+ len += snprintf(page + len, count - len, "bSurpriseRemoved=%d, bDriverStopped=%d\n",
++
++ len += snprintf(page + len, count - len, "bSurpriseRemoved=%d, bDriverStopped=%d\n",
+ padapter->bSurpriseRemoved, padapter->bDriverStopped);
+
+ *eof = 1;
+ return len;
+
+}
-+
++
+int proc_get_trx_info(char *page, char **start,
+ off_t offset, int count,
+ int *eof, void *data)
@@ -10147,7 +10141,7 @@ index 000000000000..f70fcb7b2cd1
+ struct dvobj_priv *pdvobj = adapter_to_dvobj(padapter);
+ struct hw_xmit *phwxmit;
+ int len = 0;
-+
++
+ len += snprintf(page + len, count - len, "free_xmitbuf_cnt=%d, free_xmitframe_cnt=%d"
+ ", free_ext_xmitbuf_cnt=%d, free_xframe_ext_cnt=%d"
+ ", free_recvframe_cnt=%d\n",
@@ -10167,7 +10161,7 @@ index 000000000000..f70fcb7b2cd1
+ len += snprintf(page + len, count - len, "continual_urb_error=%d\n", atomic_read(&pdvobj->continual_urb_error));
+#endif
+
-+ for(i = 0; i < 4; i++)
++ for(i = 0; i < 4; i++)
+ {
+ phwxmit = pxmitpriv->hwxmits + i;
+ len += snprintf(page + len, count - len, "%d, hwq.accnt=%d\n", i, phwxmit->accnt);
@@ -10177,8 +10171,8 @@ index 000000000000..f70fcb7b2cd1
+ return len;
+
+}
-+
-+
++
++
+
+int proc_get_mac_reg_dump1(char *page, char **start,
+ off_t offset, int count,
@@ -10192,10 +10186,10 @@ index 000000000000..f70fcb7b2cd1
+ len += snprintf(page + len, count - len, "\n======= MAC REG =======\n");
+
+ for(i=0x0;i<0x300;i+=4)
-+ {
++ {
+ if(j%4==1) len += snprintf(page + len, count - len,"0x%02x",i);
-+ len += snprintf(page + len, count - len," 0x%08x ",rtw_read32(padapter,i));
-+ if((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
++ len += snprintf(page + len, count - len," 0x%08x ",rtw_read32(padapter,i));
++ if((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
+ }
+
+ *eof = 1;
@@ -10215,12 +10209,12 @@ index 000000000000..f70fcb7b2cd1
+ len += snprintf(page + len, count - len, "\n======= MAC REG =======\n");
+ memset(page, 0, count);
+ for(i=0x300;i<0x600;i+=4)
-+ {
++ {
+ if(j%4==1) len += snprintf(page + len, count - len,"0x%02x",i);
-+ len += snprintf(page + len, count - len," 0x%08x ",rtw_read32(padapter,i));
-+ if((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
++ len += snprintf(page + len, count - len," 0x%08x ",rtw_read32(padapter,i));
++ if((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
+ }
-+
++
+ *eof = 1;
+ return len;
+
@@ -10238,10 +10232,10 @@ index 000000000000..f70fcb7b2cd1
+ len += snprintf(page + len, count - len, "\n======= MAC REG =======\n");
+
+ for(i=0x600;i<0x800;i+=4)
-+ {
++ {
+ if(j%4==1) len += snprintf(page + len, count - len,"0x%02x",i);
-+ len += snprintf(page + len, count - len," 0x%08x ",rtw_read32(padapter,i));
-+ if((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
++ len += snprintf(page + len, count - len," 0x%08x ",rtw_read32(padapter,i));
++ if((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
+ }
+
+ *eof = 1;
@@ -10254,19 +10248,19 @@ index 000000000000..f70fcb7b2cd1
+ int *eof, void *data)
+{
+ struct net_device *dev = data;
-+ _adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
++ _adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
+ int len = 0;
-+ int i,j=1;
++ int i,j=1;
+
-+ len += snprintf(page + len, count - len, "\n======= BB REG =======\n");
++ len += snprintf(page + len, count - len, "\n======= BB REG =======\n");
+ for(i=0x800;i<0xB00;i+=4)
+ {
-+ if(j%4==1) len += snprintf(page + len, count - len,"0x%02x",i);
-+ len += snprintf(page + len, count - len," 0x%08x ",rtw_read32(padapter,i));
-+ if((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
++ if(j%4==1) len += snprintf(page + len, count - len,"0x%02x",i);
++ len += snprintf(page + len, count - len," 0x%08x ",rtw_read32(padapter,i));
++ if((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
+ }
+ *eof = 1;
-+ return len;
++ return len;
+}
+
+int proc_get_bb_reg_dump2(char *page, char **start,
@@ -10274,19 +10268,19 @@ index 000000000000..f70fcb7b2cd1
+ int *eof, void *data)
+{
+ struct net_device *dev = data;
-+ _adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
++ _adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
+ int len = 0;
-+ int i,j=1;
++ int i,j=1;
+
-+ len += snprintf(page + len, count - len, "\n======= BB REG =======\n");
++ len += snprintf(page + len, count - len, "\n======= BB REG =======\n");
+ for(i=0xB00;i<0xE00;i+=4)
+ {
-+ if(j%4==1) len += snprintf(page + len, count - len,"0x%02x",i);
-+ len += snprintf(page + len, count - len," 0x%08x ",rtw_read32(padapter,i));
-+ if((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
++ if(j%4==1) len += snprintf(page + len, count - len,"0x%02x",i);
++ len += snprintf(page + len, count - len," 0x%08x ",rtw_read32(padapter,i));
++ if((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
+ }
+ *eof = 1;
-+ return len;
++ return len;
+}
+
+int proc_get_bb_reg_dump3(char *page, char **start,
@@ -10294,19 +10288,19 @@ index 000000000000..f70fcb7b2cd1
+ int *eof, void *data)
+{
+ struct net_device *dev = data;
-+ _adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
++ _adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
+ int len = 0;
-+ int i,j=1;
++ int i,j=1;
+
-+ len += snprintf(page + len, count - len, "\n======= BB REG =======\n");
++ len += snprintf(page + len, count - len, "\n======= BB REG =======\n");
+ for(i=0xE00;i<0x1000;i+=4)
+ {
-+ if(j%4==1) len += snprintf(page + len, count - len,"0x%02x",i);
-+ len += snprintf(page + len, count - len," 0x%08x ",rtw_read32(padapter,i));
-+ if((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
++ if(j%4==1) len += snprintf(page + len, count - len,"0x%02x",i);
++ len += snprintf(page + len, count - len," 0x%08x ",rtw_read32(padapter,i));
++ if((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
+ }
+ *eof = 1;
-+ return len;
++ return len;
+}
+
+int proc_get_rf_reg_dump1(char *page, char **start,
@@ -10318,21 +10312,21 @@ index 000000000000..f70fcb7b2cd1
+ int len = 0;
+ int i,j=1,path;
+ u32 value;
-+
++
+ len += snprintf(page + len, count - len, "\n======= RF REG =======\n");
+ path = 1;
+ len += snprintf(page + len, count - len, "\nRF_Path(%x)\n",path);
+ for(i=0;i<0xC0;i++)
-+ {
++ {
+ //value = PHY_QueryRFReg(padapter, (RF90_RADIO_PATH_E)path,i, bMaskDWord);
+ value =rtw_hal_read_rfreg(padapter, path, i, 0xffffffff);
+ if(j%4==1) len += snprintf(page + len, count - len, "0x%02x ",i);
+ len += snprintf(page + len, count - len, " 0x%08x ",value);
-+ if((j++)%4==0) len += snprintf(page + len, count - len, "\n");
++ if((j++)%4==0) len += snprintf(page + len, count - len, "\n");
+ }
+
+ *eof = 1;
-+ return len;
++ return len;
+}
+
+
@@ -10344,21 +10338,21 @@ index 000000000000..f70fcb7b2cd1
+ _adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
+ int len = 0;
+ int i,j=1,path;
-+ u32 value;
++ u32 value;
+
-+ len += snprintf(page + len, count - len, "\n======= RF REG =======\n");
++ len += snprintf(page + len, count - len, "\n======= RF REG =======\n");
+ path = 1;
+ len += snprintf(page + len, count - len, "\nRF_Path(%x)\n",path);
+ for(i=0xC0;i<0x100;i++)
-+ {
++ {
+ //value = PHY_QueryRFReg(padapter, (RF90_RADIO_PATH_E)path,i, bMaskDWord);
+ value =rtw_hal_read_rfreg(padapter, path, i, 0xffffffff);
+ if(j%4==1) len += snprintf(page + len, count - len, "0x%02x ",i);
+ len += snprintf(page + len, count - len, " 0x%08x ",value);
-+ if((j++)%4==0) len += snprintf(page + len, count - len, "\n");
++ if((j++)%4==0) len += snprintf(page + len, count - len, "\n");
+ }
+ *eof = 1;
-+ return len;
++ return len;
+}
+
+
@@ -10370,22 +10364,22 @@ index 000000000000..f70fcb7b2cd1
+ _adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
+ int len = 0;
+ int i,j=1,path;
-+ u32 value;
++ u32 value;
+
+ len += snprintf(page + len, count - len, "\n======= RF REG =======\n");
+ path = 2;
+ len += snprintf(page + len, count - len, "\nRF_Path(%x)\n",path);
+ for(i=0;i<0xC0;i++)
-+ {
++ {
+ //value = PHY_QueryRFReg(padapter, (RF90_RADIO_PATH_E)path,i, bMaskDWord);
+ value =rtw_hal_read_rfreg(padapter, path, i, 0xffffffff);
+ if(j%4==1) len += snprintf(page + len, count - len, "0x%02x ",i);
+ len += snprintf(page + len, count - len, " 0x%08x ",value);
-+ if((j++)%4==0) len += snprintf(page + len, count - len, "\n");
++ if((j++)%4==0) len += snprintf(page + len, count - len, "\n");
+ }
+
+ *eof = 1;
-+ return len;
++ return len;
+}
+
+
@@ -10403,7 +10397,7 @@ index 000000000000..f70fcb7b2cd1
+ path = 2;
+ len += snprintf(page + len, count - len, "\nRF_Path(%x)\n",path);
+ for(i=0xC0;i<0x100;i++)
-+ {
++ {
+ //value = PHY_QueryRFReg(padapter, (RF90_RADIO_PATH_E)path,i, bMaskDWord);
+ value =rtw_hal_read_rfreg(padapter, path, i, 0xffffffff);
+ if(j%4==1) len += snprintf(page + len, count - len, "0x%02x ",i);
@@ -10411,11 +10405,11 @@ index 000000000000..f70fcb7b2cd1
+ if((j++)%4==0) len += snprintf(page + len, count - len, "\n");
+ }
+ *eof = 1;
-+ return len;
++ return len;
+}
+
+
-+
++
+int proc_get_rx_signal(char *page, char **start,
+ off_t offset, int count,
+ int *eof, void *data)
@@ -10423,7 +10417,7 @@ index 000000000000..f70fcb7b2cd1
+ struct net_device *dev = data;
+ _adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
+ struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
-+
++
+ int len = 0;
+
+ len += snprintf(page + len, count - len,
@@ -10431,14 +10425,14 @@ index 000000000000..f70fcb7b2cd1
+ "rxpwdb:%d\n"
+ "signal_strength:%u\n"
+ "signal_qual:%u\n"
-+ "noise:%u\n",
++ "noise:%u\n",
+ padapter->recvpriv.rssi,
+ padapter->recvpriv.rxpwdb,
+ padapter->recvpriv.signal_strength,
+ padapter->recvpriv.signal_qual,
+ padapter->recvpriv.noise
+ );
-+
++
+ *eof = 1;
+ return len;
+}
@@ -10454,15 +10448,15 @@ index 000000000000..f70fcb7b2cd1
+ if (count < 1)
+ return -EFAULT;
+
-+ if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
++ if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
+
+ int num = sscanf(tmp, "%u %u", &is_signal_dbg, &signal_strength);
+
+ is_signal_dbg = is_signal_dbg==0?0:1;
-+
++
+ if(is_signal_dbg && num!=2)
+ return count;
-+
++
+ signal_strength = signal_strength>100?100:signal_strength;
+ signal_strength = signal_strength<0?0:signal_strength;
+
@@ -10473,11 +10467,11 @@ index 000000000000..f70fcb7b2cd1
+ DBG_871X("set %s %u\n", "DBG_SIGNAL_STRENGTH", signal_strength);
+ else
+ DBG_871X("set %s\n", "HW_SIGNAL_STRENGTH");
-+
++
+ }
-+
++
+ return count;
-+
++
+}
+
+int proc_get_ht_enable(char *page, char **start,
@@ -10487,9 +10481,9 @@ index 000000000000..f70fcb7b2cd1
+ struct net_device *dev = data;
+ _adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
+ struct registry_priv *pregpriv = &padapter->registrypriv;
-+
++
+ int len = 0;
-+
++
+ if(pregpriv)
+ len += snprintf(page + len, count - len,
+ "%d\n",
@@ -10512,7 +10506,7 @@ index 000000000000..f70fcb7b2cd1
+ if (count < 1)
+ return -EFAULT;
+
-+ if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
++ if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
+
+ int num = sscanf(tmp, "%d ", &mode);
+
@@ -10522,9 +10516,9 @@ index 000000000000..f70fcb7b2cd1
+ printk("ht_enable=%d\n", pregpriv->ht_enable);
+ }
+ }
-+
++
+ return count;
-+
++
+}
+
+
@@ -10535,9 +10529,9 @@ index 000000000000..f70fcb7b2cd1
+ struct net_device *dev = data;
+ _adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
+ struct registry_priv *pregpriv = &padapter->registrypriv;
-+
++
+ int len = 0;
-+
++
+ if(pregpriv)
+ len += snprintf(page + len, count - len,
+ "%d\n",
@@ -10560,7 +10554,7 @@ index 000000000000..f70fcb7b2cd1
+ if (count < 1)
+ return -EFAULT;
+
-+ if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
++ if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
+
+ int num = sscanf(tmp, "%d ", &mode);
+
@@ -10570,9 +10564,9 @@ index 000000000000..f70fcb7b2cd1
+ printk("cbw40_enable=%d\n", mode);
+ }
+ }
-+
++
+ return count;
-+
++
+}
+
+int proc_get_ampdu_enable(char *page, char **start,
@@ -10582,9 +10576,9 @@ index 000000000000..f70fcb7b2cd1
+ struct net_device *dev = data;
+ _adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
+ struct registry_priv *pregpriv = &padapter->registrypriv;
-+
++
+ int len = 0;
-+
++
+ if(pregpriv)
+ len += snprintf(page + len, count - len,
+ "%d\n",
@@ -10607,7 +10601,7 @@ index 000000000000..f70fcb7b2cd1
+ if (count < 1)
+ return -EFAULT;
+
-+ if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
++ if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
+
+ int num = sscanf(tmp, "%d ", &mode);
+
@@ -10617,9 +10611,9 @@ index 000000000000..f70fcb7b2cd1
+ printk("ampdu_enable=%d\n", mode);
+ }
+ }
-+
++
+ return count;
-+
++
+}
+
+
@@ -10629,9 +10623,9 @@ index 000000000000..f70fcb7b2cd1
+{
+ struct net_device *dev = data;
+ _adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
-+
++
+ int len = 0;
-+
++
+ if(padapter)
+ len += snprintf(page + len, count - len,
+ "%d %d\n",
@@ -10650,9 +10644,9 @@ index 000000000000..f70fcb7b2cd1
+ struct net_device *dev = data;
+ _adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
+ struct registry_priv *pregpriv = &padapter->registrypriv;
-+
++
+ int len = 0;
-+
++
+ if(pregpriv)
+ len += snprintf(page + len, count - len,
+ "%d\n",
@@ -10675,7 +10669,7 @@ index 000000000000..f70fcb7b2cd1
+ if (count < 1)
+ return -EFAULT;
+
-+ if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
++ if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
+
+ int num = sscanf(tmp, "%d ", &mode);
+
@@ -10685,9 +10679,9 @@ index 000000000000..f70fcb7b2cd1
+ printk("rx_stbc=%d\n", mode);
+ }
+ }
-+
++
+ return count;
-+
++
+}
+
+int proc_get_vid(char *page, char **start,
@@ -10699,14 +10693,14 @@ index 000000000000..f70fcb7b2cd1
+ u16 VID=0;
+ int len = 0;
+
-+ rtw_hal_get_hwreg(padapter, HW_VAR_VID, (u8 *)&VID);
++ rtw_hal_get_hwreg(padapter, HW_VAR_VID, (u8 *)&VID);
+ len += snprintf(page + len, count - len,
+ "%04x\n",
+ VID
+ );
+
+ *eof = 1;
-+ return len;
++ return len;
+}
+
+int proc_get_pid(char *page, char **start,
@@ -10715,17 +10709,17 @@ index 000000000000..f70fcb7b2cd1
+{
+ struct net_device *dev = data;
+ _adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
-+ u16 PID=0;
++ u16 PID=0;
+ int len = 0;
+
-+ rtw_hal_get_hwreg(padapter, HW_VAR_PID, (u8 *)&PID);
++ rtw_hal_get_hwreg(padapter, HW_VAR_PID, (u8 *)&PID);
+ len += snprintf(page + len, count - len,
+ "%04x\n",
+ PID
+ );
+
+ *eof = 1;
-+ return len;
++ return len;
+}
+
+int proc_get_rssi_disp(char *page, char **start,
@@ -10748,9 +10742,9 @@ index 000000000000..f70fcb7b2cd1
+ {
+ DBG_8192C("argument size is less than 1\n");
+ return -EFAULT;
-+ }
++ }
+
-+ if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
++ if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
+
+ int num = sscanf(tmp, "%x", &enable);
+
@@ -10758,25 +10752,25 @@ index 000000000000..f70fcb7b2cd1
+ DBG_8192C("invalid set_rssi_disp parameter!\n");
+ return count;
+ }
-+
++
+ if(enable)
-+ {
++ {
+ DBG_8192C("Turn On Rx RSSI Display Function\n");
-+ padapter->bRxRSSIDisplay = enable ;
++ padapter->bRxRSSIDisplay = enable ;
+ }
+ else
+ {
+ DBG_8192C("Turn Off Rx RSSI Display Function\n");
+ padapter->bRxRSSIDisplay = 0 ;
+ }
-+
++
+ }
-+
++
+ return count;
-+
-+}
+
-+
++}
++
++
+#ifdef CONFIG_AP_MODE
+
+int proc_get_all_sta_info(char *page, char **start,
@@ -10791,18 +10785,18 @@ index 000000000000..f70fcb7b2cd1
+ int i, j;
+ _list *plist, *phead;
+ struct recv_reorder_ctrl *preorder_ctrl;
-+ int len = 0;
-+
++ int len = 0;
++
+
+ len += snprintf(page + len, count - len, "sta_dz_bitmap=0x%x, tim_bitmap=0x%x\n", pstapriv->sta_dz_bitmap, pstapriv->tim_bitmap);
-+
++
+ _enter_critical_bh(&pstapriv->sta_hash_lock, &irqL);
+
+ for(i=0; i< NUM_STA; i++)
+ {
+ phead = &(pstapriv->sta_hash[i]);
+ plist = get_next(phead);
-+
++
+ while ((rtw_end_of_queue_search(phead, plist)) == _FALSE)
+ {
+ psta = LIST_CONTAINOR(plist, struct sta_info, hash_list);
@@ -10813,10 +10807,10 @@ index 000000000000..f70fcb7b2cd1
+ {
+ len += snprintf(page + len, count - len, "sta's macaddr:" MAC_FMT "\n", MAC_ARG(psta->hwaddr));
+ len += snprintf(page + len, count - len, "rtsen=%d, cts2slef=%d\n", psta->rtsen, psta->cts2self);
-+ len += snprintf(page + len, count - len, "qos_en=%d, ht_en=%d, init_rate=%d\n", psta->qos_option, psta->htpriv.ht_option, psta->init_rate);
-+ len += snprintf(page + len, count - len, "state=0x%x, aid=%d, macid=%d, raid=%d\n", psta->state, psta->aid, psta->mac_id, psta->raid);
-+ len += snprintf(page + len, count - len, "bwmode=%d, ch_offset=%d, sgi=%d\n", psta->htpriv.bwmode, psta->htpriv.ch_offset, psta->htpriv.sgi);
-+ len += snprintf(page + len, count - len, "ampdu_enable = %d\n", psta->htpriv.ampdu_enable);
++ len += snprintf(page + len, count - len, "qos_en=%d, ht_en=%d, init_rate=%d\n", psta->qos_option, psta->htpriv.ht_option, psta->init_rate);
++ len += snprintf(page + len, count - len, "state=0x%x, aid=%d, macid=%d, raid=%d\n", psta->state, psta->aid, psta->mac_id, psta->raid);
++ len += snprintf(page + len, count - len, "bwmode=%d, ch_offset=%d, sgi=%d\n", psta->htpriv.bwmode, psta->htpriv.ch_offset, psta->htpriv.sgi);
++ len += snprintf(page + len, count - len, "ampdu_enable = %d\n", psta->htpriv.ampdu_enable);
+ len += snprintf(page + len, count - len, "agg_enable_bitmap=%x, candidate_tid_bitmap=%x\n", psta->htpriv.agg_enable_bitmap, psta->htpriv.candidate_tid_bitmap);
+ len += snprintf(page + len, count - len, "sleepq_len=%d\n", psta->sleepq_len);
+ len += snprintf(page + len, count - len, "capability=0x%x\n", psta->capability);
@@ -10826,30 +10820,30 @@ index 000000000000..f70fcb7b2cd1
+ len += snprintf(page + len, count - len, "wpa2_pairwise_cipher=0x%x\n", psta->wpa2_pairwise_cipher);
+ len += snprintf(page + len, count - len, "qos_info=0x%x\n", psta->qos_info);
+ len += snprintf(page + len, count - len, "dot118021XPrivacy=0x%x\n", psta->dot118021XPrivacy);
-+
++
+ for(j=0;j<16;j++)
-+ {
++ {
+ preorder_ctrl = &psta->recvreorder_ctrl[j];
+ if(preorder_ctrl->enable)
+ {
+ len += snprintf(page + len, count - len, "tid=%d, indicate_seq=%d\n", j, preorder_ctrl->indicate_seq);
+ }
-+ }
-+
-+ }
-+
++ }
++
++ }
++
+ }
-+
++
+ }
-+
++
+ _exit_critical_bh(&pstapriv->sta_hash_lock, &irqL);
+
+ *eof = 1;
+ return len;
+
+}
-+
-+#endif
++
++#endif
+
+#ifdef DBG_MEMORY_LEAK
+#include <asm/atomic.h>
@@ -10860,12 +10854,12 @@ index 000000000000..f70fcb7b2cd1
+ off_t offset, int count,
+ int *eof, void *data)
+{
-+
++
+ int len = 0;
+
+ len += snprintf(page + len, count - len, "_malloc_cnt=%d\n", atomic_read(&_malloc_cnt));
+ len += snprintf(page + len, count - len, "_malloc_size=%d\n", atomic_read(&_malloc_size));
-+
++
+ *eof = 1;
+ return len;
+}
@@ -10887,8 +10881,8 @@ index 000000000000..f70fcb7b2cd1
+ index_24G = i;
+ if ( pmlmeext->channel_set[i].ChannelNum == 36)
+ index_5G = i;
-+ }
-+
++ }
++
+ for (i=0; pmlmeext->channel_set[i].ChannelNum !=0; i++) {
+ // 2.4G
+ if ( pmlmeext->channel_set[i].ChannelNum == 6 ) {
@@ -10919,11 +10913,11 @@ index 000000000000..f70fcb7b2cd1
+ }
+ }
+#if 1 // debug
-+ len += snprintf(page + len, count - len, "The rx cnt of channel %3d = %d\n",
++ len += snprintf(page + len, count - len, "The rx cnt of channel %3d = %d\n",
+ pmlmeext->channel_set[i].ChannelNum, pmlmeext->channel_set[i].rx_count);
+#endif
+ }
-+
++
+ len += snprintf(page + len, count - len, "best_channel_5G = %d\n", best_channel_5G);
+ len += snprintf(page + len, count - len, "best_channel_24G = %d\n", best_channel_24G);
+
@@ -10965,9 +10959,9 @@ index 000000000000..f70fcb7b2cd1
+ struct net_device *dev = data;
+ _adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
+ struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
-+
++
+ int len = 0;
-+
++
+ *eof = 1;
+ return len;
+}
@@ -10982,7 +10976,7 @@ index 000000000000..f70fcb7b2cd1
+ if (count < 1)
+ return -EFAULT;
+
-+ if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
++ if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
+
+ int num = sscanf(tmp, "%d", &trigger_point);
+
@@ -10991,9 +10985,9 @@ index 000000000000..f70fcb7b2cd1
+ else
+ sreset_set_trigger_point(padapter, trigger_point);
+ }
-+
++
+ return count;
-+
++
+}
+#endif /* DBG_CONFIG_ERROR_DETECT */
+
@@ -11038,23 +11032,22 @@ index 000000000000..f70fcb7b2cd1
+
+ dm_adaptivity_set_parm(padapter, (s8)TH_L2H_ini, TH_EDCCA_HL_diff, (s8)IGI_Base, (bool)ForceEDCCA, AdapEn_RSSI, IGI_LowerBound);
+ }
-+
++
+ return count;
+}
+#endif /* CONFIG_DM_ADAPTIVITY */
+
+#endif
-+
diff --git a/drivers/net/wireless/realtek/rtl8192cu/core/rtw_eeprom.c b/drivers/net/wireless/realtek/rtl8192cu/core/rtw_eeprom.c
new file mode 100755
-index 000000000000..fd07d64d8724
+index 000000000000..c0a6b541bf12
--- /dev/null
+++ b/drivers/net/wireless/realtek/rtl8192cu/core/rtw_eeprom.c
-@@ -0,0 +1,423 @@
+@@ -0,0 +1,422 @@
+/******************************************************************************
+ *
+ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
-+ *
++ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
@@ -11084,7 +11077,7 @@ index 000000000000..fd07d64d8724
+ rtw_udelay_os(CLOCK_RATE);
+
+_func_exit_;
-+
++
+}
+
+void down_clk(_adapter * padapter, u16 *x )
@@ -11093,7 +11086,7 @@ index 000000000000..fd07d64d8724
+ *x = *x & ~_EESK;
+ rtw_write8(padapter, EE_9346CR, (u8)*x);
+ rtw_udelay_os(CLOCK_RATE);
-+_func_exit_;
++_func_exit_;
+}
+
+void shift_out_bits(_adapter * padapter, u16 data, u16 count)
@@ -11131,14 +11124,14 @@ index 000000000000..fd07d64d8724
+ }
+ x &= ~_EEDI;
+ rtw_write8(padapter, EE_9346CR, (u8)x);
-+out:
-+_func_exit_;
++out:
++_func_exit_;
+}
+
+u16 shift_in_bits (_adapter * padapter)
+{
+ u16 x,d=0,i;
-+_func_enter_;
++_func_enter_;
+ if(padapter->bSurpriseRemoved==_TRUE){
+ RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
+ goto out;
@@ -11164,8 +11157,8 @@ index 000000000000..fd07d64d8724
+
+ down_clk(padapter, &x);
+ }
-+out:
-+_func_exit_;
++out:
++_func_exit_;
+
+ return d;
+}
@@ -11173,7 +11166,7 @@ index 000000000000..fd07d64d8724
+void standby(_adapter * padapter )
+{
+ u8 x;
-+_func_enter_;
++_func_enter_;
+ x = rtw_read8(padapter, EE_9346CR);
+
+ x &= ~(_EECS | _EESK);
@@ -11183,16 +11176,16 @@ index 000000000000..fd07d64d8724
+ x |= _EECS;
+ rtw_write8(padapter, EE_9346CR, x);
+ rtw_udelay_os(CLOCK_RATE);
-+_func_exit_;
++_func_exit_;
+}
+
+u16 wait_eeprom_cmd_done(_adapter* padapter)
+{
+ u8 x;
+ u16 i,res=_FALSE;
-+_func_enter_;
++_func_enter_;
+ standby(padapter );
-+ for (i=0; i<200; i++)
++ for (i=0; i<200; i++)
+ {
+ x = rtw_read8(padapter, EE_9346CR);
+ if (x & _EEDO){
@@ -11201,15 +11194,15 @@ index 000000000000..fd07d64d8724
+ }
+ rtw_udelay_os(CLOCK_RATE);
+ }
-+exit:
-+_func_exit_;
++exit:
++_func_exit_;
+ return res;
+}
+
+void eeprom_clean(_adapter * padapter)
+{
+ u16 x;
-+_func_enter_;
++_func_enter_;
+ if(padapter->bSurpriseRemoved==_TRUE){
+ RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
+ goto out;
@@ -11231,8 +11224,8 @@ index 000000000000..fd07d64d8724
+ goto out;
+ }
+ down_clk(padapter, &x);
-+out:
-+_func_exit_;
++out:
++_func_exit_;
+}
+
+void eeprom_write16(_adapter * padapter, u16 reg, u16 data)
@@ -11242,7 +11235,7 @@ index 000000000000..fd07d64d8724
+ u8 tmp8_ori,tmp8_new,tmp8_clk_ori,tmp8_clk_new;
+ tmp8_ori=rtw_read8(padapter, 0x102502f1);
+ tmp8_new=tmp8_ori & 0xf7;
-+ if(tmp8_ori != tmp8_new){
++ if(tmp8_ori != tmp8_new){
+ rtw_write8(padapter, 0x102502f1, tmp8_new);
+ RT_TRACE(_module_rtl871x_mp_ioctl_c_,_drv_err_,("====write 0x102502f1=====\n"));
+ }
@@ -11251,10 +11244,10 @@ index 000000000000..fd07d64d8724
+ if(tmp8_clk_new!=tmp8_clk_ori){
+ RT_TRACE(_module_rtl871x_mp_ioctl_c_,_drv_err_,("====write 0x10250003=====\n"));
+ rtw_write8(padapter, 0x10250003, tmp8_clk_new);
-+ }
++ }
+#endif
-+_func_enter_;
-+
++_func_enter_;
++
+ x = rtw_read8(padapter, EE_9346CR);
+
+ x &= ~(_EEDI | _EEDO | _EESK | _EEM0);
@@ -11262,12 +11255,12 @@ index 000000000000..fd07d64d8724
+ rtw_write8(padapter, EE_9346CR, x);
+
+ shift_out_bits(padapter, EEPROM_EWEN_OPCODE, 5);
-+
++++
+ if(padapter->EepromAddressSize==8) //CF+ and SDIO
+ shift_out_bits(padapter, 0, 6);
+ else //USB
+ shift_out_bits(padapter, 0, 4);
-+
++++
+ standby( padapter);
+ +
+// Commented out by rcnjko, 2004.0
@@ -11276,7 +11269,7 @@ index 000000000000..fd07d64d8724
+// shift_out_bits(Adapter, EEPROM_ERASE_OPCODE, 3);
+// shift_out_bits(Adapter, reg, Adapter->EepromAddressSize);
+//
-+// if (wait_eeprom_cmd_done(Adapter ) == FALSE)
++// if (wait_eeprom_cmd_done(Adapter ) == FALSE)
+// {
+// return;
+// }
@@ -11295,7 +11288,7 @@ index 000000000000..fd07d64d8724
+ // write the data to the selected EEPROM word.
+ shift_out_bits(padapter, data, 16);
+
-+ if (wait_eeprom_cmd_done(padapter ) == _FALSE)
++ if (wait_eeprom_cmd_done(padapter ) == _FALSE)
+ {
+
+ goto exit;
@@ -11307,7 +11300,7 @@ index 000000000000..fd07d64d8724
+ shift_out_bits(padapter, reg, 4);
+ +
+ eeprom_clean(padapter );
-+exit:
++exit:
+#ifdef CONFIG_RTL8712
+ if(tmp8_clk_new!=tmp8_clk_ori)
+ rtw_write8(padapter, 0x10250003, tmp8_clk_ori);
@@ -11315,7 +11308,7 @@ index 000000000000..fd07d64d8724
+ rtw_write8(padapter, 0x102502f1, tmp8_ori);
+
+#endif
-+_func_exit_;
++_func_exit_;
+ return;
+}
+
@@ -11328,7 +11321,7 @@ index 000000000000..fd07d64d8724
+ u8 tmp8_ori,tmp8_new,tmp8_clk_ori,tmp8_clk_new;
+ tmp8_ori= rtw_read8(padapter, 0x102502f1);
+ tmp8_new = tmp8_ori & 0xf7;
-+ if(tmp8_ori != tmp8_new){
++ if(tmp8_ori != tmp8_new){
+ rtw_write8(padapter, 0x102502f1, tmp8_new);
+ RT_TRACE(_module_rtl871x_mp_ioctl_c_,_drv_err_,("====write 0x102502f1=====\n"));
+ }
@@ -11337,9 +11330,9 @@ index 000000000000..fd07d64d8724
+ if(tmp8_clk_new!=tmp8_clk_ori){
+ RT_TRACE(_module_rtl871x_mp_ioctl_c_,_drv_err_,("====write 0x10250003=====\n"));
+ rtw_write8(padapter, 0x10250003, tmp8_clk_new);
-+ }
++ }
+#endif
-+_func_enter_;
++_func_enter_;
+
+ if(padapter->bSurpriseRemoved==_TRUE){
+ RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
@@ -11366,7 +11359,7 @@ index 000000000000..fd07d64d8724
+ data = shift_in_bits(padapter);
+
+ eeprom_clean(padapter);
-+out:
++out:
+#ifdef CONFIG_RTL8712
+ if(tmp8_clk_new!=tmp8_clk_ori)
+ rtw_write8(padapter, 0x10250003, tmp8_clk_ori);
@@ -11374,7 +11367,7 @@ index 000000000000..fd07d64d8724
+ rtw_write8(padapter, 0x102502f1, tmp8_ori);
+
+#endif
-+_func_exit_;
++_func_exit_;
+ return data;
+
+
@@ -11384,12 +11377,12 @@ index 000000000000..fd07d64d8724
+
+
+//From even offset
-+void eeprom_read_sz(_adapter * padapter, u16 reg, u8* data, u32 sz)
++void eeprom_read_sz(_adapter * padapter, u16 reg, u8* data, u32 sz)
+{
+
+ u16 x, data16;
+ u32 i;
-+_func_enter_;
++_func_enter_;
+ if(padapter->bSurpriseRemoved==_TRUE){
+ RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
+ goto out;
@@ -11416,12 +11409,12 @@ index 000000000000..fd07d64d8724
+ {
+ data16 = shift_in_bits(padapter);
+ data[i] = data16 & 0xff;
-+ data[i+1] = data16 >>8;
++ data[i+1] = data16 >>8;
+ }
+
+ eeprom_clean(padapter);
-+out:
-+_func_exit_;
++out:
++_func_exit_;
+
+
+
@@ -11433,7 +11426,7 @@ index 000000000000..fd07d64d8724
+{
+ u8 quotient, remainder, addr_2align_odd;
+ u16 reg, stmp , i=0, idx = 0;
-+_func_enter_;
++_func_enter_;
+ reg = (u16)(addr_off >> 1);
+ addr_2align_odd = (u8)(addr_off & 0x1);
+
@@ -11443,7 +11436,7 @@ index 000000000000..fd07d64d8724
+ rbuf[idx++] = (u8) ((stmp>>8)&0xff); //return hogh-part of the short
+ reg++; sz--;
+ }
-+
++
+ quotient = sz >> 1;
+ remainder = sz & 0x1;
+
@@ -11453,13 +11446,13 @@ index 000000000000..fd07d64d8724
+ rbuf[idx++] = (u8) (stmp&0xff);
+ rbuf[idx++] = (u8) ((stmp>>8)&0xff);
+ }
-+
++
+ reg = reg+i;
+ if(remainder){ //end of read at lower part of short : 0,2,4,6,...
+ stmp = eeprom_read16(padapter, reg);
-+ rbuf[idx] = (u8)(stmp & 0xff);
++ rbuf[idx] = (u8)(stmp & 0xff);
+ }
-+_func_exit_;
++_func_exit_;
+ return _TRUE;
+}
+
@@ -11468,22 +11461,21 @@ index 000000000000..fd07d64d8724
+VOID read_eeprom_content(_adapter * padapter)
+{
+
-+_func_enter_;
++_func_enter_;
+
+
-+_func_exit_;
++_func_exit_;
+}
-+
diff --git a/drivers/net/wireless/realtek/rtl8192cu/core/rtw_ieee80211.c b/drivers/net/wireless/realtek/rtl8192cu/core/rtw_ieee80211.c
new file mode 100755
-index 000000000000..f89ce4a00323
+index 000000000000..9470d72ac6a1
--- /dev/null
+++ b/drivers/net/wireless/realtek/rtl8192cu/core/rtw_ieee80211.c
-@@ -0,0 +1,1916 @@
+@@ -0,0 +1,1915 @@
+/******************************************************************************
+ *
+ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
-+ *
++ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
@@ -11529,16 +11521,16 @@ index 000000000000..f89ce4a00323
+u8 RSN_CIPHER_SUITE_CCMP[] = { 0x00, 0x0f, 0xac, 4 };
+u8 RSN_CIPHER_SUITE_WEP104[] = { 0x00, 0x0f, 0xac, 5 };
+//-----------------------------------------------------------
-+// for adhoc-master to generate ie and provide supported-rate to fw
++// for adhoc-master to generate ie and provide supported-rate to fw
+//-----------------------------------------------------------
+
-+static u8 WIFI_CCKRATES[] =
++static u8 WIFI_CCKRATES[] =
+{(IEEE80211_CCK_RATE_1MB | IEEE80211_BASIC_RATE_MASK),
+ (IEEE80211_CCK_RATE_2MB | IEEE80211_BASIC_RATE_MASK),
+ (IEEE80211_CCK_RATE_5MB | IEEE80211_BASIC_RATE_MASK),
+ (IEEE80211_CCK_RATE_11MB | IEEE80211_BASIC_RATE_MASK)};
+
-+static u8 WIFI_OFDMRATES[] =
++static u8 WIFI_OFDMRATES[] =
+{(IEEE80211_OFDM_RATE_6MB),
+ (IEEE80211_OFDM_RATE_9MB),
+ (IEEE80211_OFDM_RATE_12MB),
@@ -11563,17 +11555,17 @@ index 000000000000..f89ce4a00323
+}
+
+uint rtw_is_cckrates_included(u8 *rate)
-+{
-+ u32 i = 0;
++{
++ u32 i = 0;
+
+ while(rate[i]!=0)
-+ {
-+ if ( (((rate[i]) & 0x7f) == 2) || (((rate[i]) & 0x7f) == 4) ||
-+ (((rate[i]) & 0x7f) == 11) || (((rate[i]) & 0x7f) == 22) )
-+ return _TRUE;
++ {
++ if ( (((rate[i]) & 0x7f) == 2) || (((rate[i]) & 0x7f) == 4) ||
++ (((rate[i]) & 0x7f) == 11) || (((rate[i]) & 0x7f) == 22) )
++ return _TRUE;
+ i++;
+ }
-+
++
+ return _FALSE;
+}
+
@@ -11587,11 +11579,11 @@ index 000000000000..f89ce4a00323
+ if ( (((rate[i]) & 0x7f) != 2) && (((rate[i]) & 0x7f) != 4) &&
+ (((rate[i]) & 0x7f) != 11) && (((rate[i]) & 0x7f) != 22) )
+
-+ return _FALSE;
++ return _FALSE;
+
+ i++;
+ }
-+
++
+ return _TRUE;
+
+}
@@ -11604,17 +11596,17 @@ index 000000000000..f89ce4a00323
+ return WIRELESS_INVALID;
+ else
+ return WIRELESS_11A;
-+ }
++ }
+ else // could be pure B, pure G, or B/G
+ {
-+ if ((rtw_is_cckratesonly_included(rate)) == _TRUE)
++ if ((rtw_is_cckratesonly_included(rate)) == _TRUE)
+ return WIRELESS_11B;
+ else if((rtw_is_cckrates_included(rate)) == _TRUE)
+ return WIRELESS_11BG;
+ else
+ return WIRELESS_11G;
+ }
-+
++
+}
+
+u8 *rtw_set_fixed_ie(unsigned char *pbuf, unsigned int len, unsigned char *source,
@@ -11628,10 +11620,10 @@ index 000000000000..f89ce4a00323
+// rtw_set_ie will update frame length
+u8 *rtw_set_ie
+(
-+ u8 *pbuf,
-+ sint index,
++ u8 *pbuf,
++ sint index,
+ uint len,
-+ u8 *source,
++ u8 *source,
+ uint *frlen //frame length
+)
+{
@@ -11642,11 +11634,11 @@ index 000000000000..f89ce4a00323
+
+ if (len > 0)
+ _rtw_memcpy((void *)(pbuf + 2), (void *)source, len);
-+
++
+ *frlen = *frlen + (len + 2);
-+
++
+ return (pbuf + len + 2);
-+_func_exit_;
++_func_exit_;
+}
+
+inline u8 *rtw_set_ie_ch_switch(u8 *buf, u32 *buf_len, u8 ch_switch_mode,
@@ -11711,7 +11703,7 @@ index 000000000000..f89ce4a00323
+ u8 *p;
+_func_enter_;
+ if (limit < 1){
-+ _func_exit_;
++ _func_exit_;
+ return NULL;
+ }
+
@@ -11734,7 +11726,7 @@ index 000000000000..f89ce4a00323
+ if (i >= limit)
+ break;
+ }
-+_func_exit_;
++_func_exit_;
+ return NULL;
+}
+
@@ -11773,7 +11765,7 @@ index 000000000000..f89ce4a00323
+
+ if(ie)
+ _rtw_memcpy(ie, &in_ie[cnt], in_ie[cnt+1]+2);
-+
++
+ if(ielen)
+ *ielen = in_ie[cnt+1]+2;
+
@@ -11781,10 +11773,10 @@ index 000000000000..f89ce4a00323
+ }
+ else
+ {
-+ cnt+=in_ie[cnt+1]+2; //goto next
-+ }
++ cnt+=in_ie[cnt+1]+2; //goto next
++ }
+
-+ }
++ }
+
+ return target_ie;
+}
@@ -11807,7 +11799,7 @@ index 000000000000..f89ce4a00323
+ u32 target_ielen;
+ u8 *start;
+ uint search_len;
-+
++
+ if(!ies || !ies_len || *ies_len <= offset)
+ goto exit;
+
@@ -11820,7 +11812,7 @@ index 000000000000..f89ce4a00323
+ u8 buf[MAX_IE_SZ] = {0};
+ u8 *remain_ies = target_ie + target_ielen;
+ uint remain_len = search_len - (remain_ies - start);
-+
++
+ _rtw_memcpy(buf, remain_ies, remain_len);
+ _rtw_memcpy(target_ie, buf, remain_len);
+ *ies_len = *ies_len - target_ielen;
@@ -11836,25 +11828,25 @@ index 000000000000..f89ce4a00323
+ return ret;
+}
+
-+void rtw_set_supported_rate(u8* SupportedRates, uint mode)
++void rtw_set_supported_rate(u8* SupportedRates, uint mode)
+{
+_func_enter_;
+
+ _rtw_memset(SupportedRates, 0, NDIS_802_11_LENGTH_RATES_EX);
-+
++
+ switch (mode)
+ {
+ case WIRELESS_11B:
+ _rtw_memcpy(SupportedRates, WIFI_CCKRATES, IEEE80211_CCK_RATE_LEN);
+ break;
-+
++
+ case WIRELESS_11G:
+ case WIRELESS_11A:
+ case WIRELESS_11_5N:
+ case WIRELESS_11A_5N://Todo: no basic rate for ofdm ?
+ _rtw_memcpy(SupportedRates, WIFI_OFDMRATES, IEEE80211_NUM_OFDM_RATESLEN);
+ break;
-+
++
+ case WIRELESS_11BG:
+ case WIRELESS_11G_24N:
+ case WIRELESS_11_24N:
@@ -11862,26 +11854,26 @@ index 000000000000..f89ce4a00323
+ _rtw_memcpy(SupportedRates, WIFI_CCKRATES, IEEE80211_CCK_RATE_LEN);
+ _rtw_memcpy(SupportedRates + IEEE80211_CCK_RATE_LEN, WIFI_OFDMRATES, IEEE80211_NUM_OFDM_RATESLEN);
+ break;
-+
++
+ }
-+_func_exit_;
++_func_exit_;
+}
+
+uint rtw_get_rateset_len(u8 *rateset)
+{
+ uint i = 0;
-+_func_enter_;
++_func_enter_;
+ while(1)
+ {
+ if ((rateset[i]) == 0)
+ break;
-+
++
+ if (i > 12)
+ break;
-+
-+ i++;
++
++ i++;
+ }
-+_func_exit_;
++_func_exit_;
+ return i;
+}
+
@@ -11891,35 +11883,35 @@ index 000000000000..f89ce4a00323
+ int sz = 0, rateLen;
+ WLAN_BSSID_EX* pdev_network = &pregistrypriv->dev_network;
+ u8* ie = pdev_network->IEs;
-+
-+_func_enter_;
++
++_func_enter_;
+
+ //timestamp will be inserted by hardware
-+ sz += 8;
++ sz += 8;
+ ie += sz;
-+
++
+ //beacon interval : 2bytes
+ *(u16*)ie = cpu_to_le16((u16)pdev_network->Configuration.BeaconPeriod);//BCN_INTERVAL;
-+ sz += 2;
++ sz += 2;
+ ie += 2;
-+
++
+ //capability info
+ *(u16*)ie = 0;
-+
++
+ *(u16*)ie |= cpu_to_le16(cap_IBSS);
+
+ if(pregistrypriv->preamble == PREAMBLE_SHORT)
+ *(u16*)ie |= cpu_to_le16(cap_ShortPremble);
-+
++
+ if (pdev_network->Privacy)
+ *(u16*)ie |= cpu_to_le16(cap_Privacy);
-+
++
+ sz += 2;
+ ie += 2;
-+
++
+ //SSID
+ ie = rtw_set_ie(ie, _SSID_IE_, pdev_network->Ssid.SsidLength, pdev_network->Ssid.Ssid, &sz);
-+
++
+ //supported rates
+ if(pregistrypriv->wireless_mode == WIRELESS_11ABGN)
+ {
@@ -11932,9 +11924,9 @@ index 000000000000..f89ce4a00323
+ {
+ wireless_mode = pregistrypriv->wireless_mode;
+ }
-+
++
+ rtw_set_supported_rate(pdev_network->SupportedRates, wireless_mode) ;
-+
++
+ rateLen = rtw_get_rateset_len(pdev_network->SupportedRates);
+
+ if (rateLen > 8)
@@ -11952,17 +11944,17 @@ index 000000000000..f89ce4a00323
+
+
+ //IBSS Parameter Set
-+
++
+ ie = rtw_set_ie(ie, _IBSS_PARA_IE_, 2, (u8 *)&(pdev_network->Configuration.ATIMWindow), &sz);
+
+ if (rateLen > 8)
-+ {
++ {
+ ie = rtw_set_ie(ie, _EXT_SUPPORTEDRATES_IE_, (rateLen - 8), (pdev_network->SupportedRates + 8), &sz);
+ }
-+
-+
++
++
+ //HT Cap.
-+ if(((pregistrypriv->wireless_mode&WIRELESS_11_5N)||(pregistrypriv->wireless_mode&WIRELESS_11_24N))
++ if(((pregistrypriv->wireless_mode&WIRELESS_11_5N)||(pregistrypriv->wireless_mode&WIRELESS_11_24N))
+ && (pregistrypriv->ht_enable==_TRUE))
+ {
+ //todo:
@@ -11985,7 +11977,7 @@ index 000000000000..f89ce4a00323
+ unsigned char wpa_oui_type[] = {0x00, 0x50, 0xf2, 0x01};
+ u8 *pbuf = pie;
+
-+ while(1)
++ while(1)
+ {
+ pbuf = rtw_get_ie(pbuf, _WPA_IE_ID_, &len, limit);
+
@@ -12030,7 +12022,7 @@ index 000000000000..f89ce4a00323
+}
+
+unsigned char *rtw_get_wpa2_ie(unsigned char *pie, int *rsn_ie_len, int limit)
-+{
++{
+
+ return rtw_get_ie(pie, _WPA2_IE_ID_,rsn_ie_len, limit);
+
@@ -12080,68 +12072,68 @@ index 000000000000..f89ce4a00323
+ return _FAIL;
+ }
+
-+
++
+ if ((*wpa_ie != _WPA_IE_ID_) || (*(wpa_ie+1) != (u8)(wpa_ie_len - 2)) ||
+ (_rtw_memcmp(wpa_ie+2, RTW_WPA_OUI_TYPE, WPA_SELECTOR_LEN) != _TRUE) )
-+ {
++ {
+ return _FAIL;
+ }
+
+ pos = wpa_ie;
+
+ pos += 8;
-+ left = wpa_ie_len - 8;
++ left = wpa_ie_len - 8;
+
+
+ //group_cipher
+ if (left >= WPA_SELECTOR_LEN) {
+
+ *group_cipher = rtw_get_wpa_cipher_suite(pos);
-+
++
+ pos += WPA_SELECTOR_LEN;
+ left -= WPA_SELECTOR_LEN;
-+
-+ }
++
++ }
+ else if (left > 0)
+ {
+ RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("%s: ie length mismatch, %u too much", __FUNCTION__, left));
-+
++
+ return _FAIL;
+ }
+
+
+ //pairwise_cipher
+ if (left >= 2)
-+ {
-+ //count = le16_to_cpu(*(u16*)pos);
++ {
++ //count = le16_to_cpu(*(u16*)pos);
+ count = RTW_GET_LE16(pos);
+ pos += 2;
+ left -= 2;
-+
++
+ if (count == 0 || left < count * WPA_SELECTOR_LEN) {
+ RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("%s: ie count botch (pairwise), "
-+ "count %u left %u", __FUNCTION__, count, left));
++ "count %u left %u", __FUNCTION__, count, left));
+ return _FAIL;
+ }
-+
++
+ for (i = 0; i < count; i++)
+ {
+ *pairwise_cipher |= rtw_get_wpa_cipher_suite(pos);
-+
++
+ pos += WPA_SELECTOR_LEN;
+ left -= WPA_SELECTOR_LEN;
+ }
-+
-+ }
++
++ }
+ else if (left == 1)
+ {
+ RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("%s: ie too short (for key mgmt)", __FUNCTION__));
+ return _FAIL;
+ }
+
-+
++
+ return ret;
-+
++
+}
+
+int rtw_parse_wpa2_ie(u8* rsn_ie, int rsn_ie_len, int *group_cipher, int *pairwise_cipher)
@@ -12157,22 +12149,22 @@ index 000000000000..f89ce4a00323
+
+
+ if ((*rsn_ie!= _WPA2_IE_ID_) || (*(rsn_ie+1) != (u8)(rsn_ie_len - 2)))
-+ {
++ {
+ return _FAIL;
+ }
-+
++
+ pos = rsn_ie;
+ pos += 4;
-+ left = rsn_ie_len - 4;
++ left = rsn_ie_len - 4;
+
+ //group_cipher
+ if (left >= RSN_SELECTOR_LEN) {
+
+ *group_cipher = rtw_get_wpa2_cipher_suite(pos);
-+
++
+ pos += RSN_SELECTOR_LEN;
+ left -= RSN_SELECTOR_LEN;
-+
++
+ } else if (left > 0) {
+ RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("%s: ie length mismatch, %u too much", __FUNCTION__, left));
+ return _FAIL;
@@ -12180,7 +12172,7 @@ index 000000000000..f89ce4a00323
+
+ //pairwise_cipher
+ if (left >= 2)
-+ {
++ {
+ //count = le16_to_cpu(*(u16*)pos);
+ count = RTW_GET_LE16(pos);
+ pos += 2;
@@ -12188,29 +12180,29 @@ index 000000000000..f89ce4a00323
+
+ if (count == 0 || left < count * RSN_SELECTOR_LEN) {
+ RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("%s: ie count botch (pairwise), "
-+ "count %u left %u", __FUNCTION__, count, left));
++ "count %u left %u", __FUNCTION__, count, left));
+ return _FAIL;
+ }
-+
++
+ for (i = 0; i < count; i++)
-+ {
++ {
+ *pairwise_cipher |= rtw_get_wpa2_cipher_suite(pos);
-+
++
+ pos += RSN_SELECTOR_LEN;
+ left -= RSN_SELECTOR_LEN;
+ }
+
-+ }
++ }
+ else if (left == 1)
+ {
+ RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("%s: ie too short (for key mgmt)", __FUNCTION__));
-+
++
+ return _FAIL;
+ }
+
+
+ return ret;
-+
++
+}
+
+int rtw_get_sec_ie(u8 *in_ie,uint in_len,u8 *rsn_ie,u16 *rsn_len,u8 *wpa_ie,u16 *wpa_len)
@@ -12218,22 +12210,22 @@ index 000000000000..f89ce4a00323
+ u8 authmode, sec_idx, i;
+ u8 wpa_oui[4]={0x0,0x50,0xf2,0x01};
+ uint cnt;
-+
++
+_func_enter_;
+
+ //Search required WPA or WPA2 IE and copy to sec_ie[ ]
-+
++
+ cnt = (_TIMESTAMP_ + _BEACON_ITERVAL_ + _CAPABILITY_);
-+
++
+ sec_idx=0;
-+
++
+ while(cnt<in_len)
+ {
+ authmode=in_ie[cnt];
-+
++
+ if((authmode==_WPA_IE_ID_)&&(_rtw_memcmp(&in_ie[cnt+2], &wpa_oui[0],4)==_TRUE))
-+ {
-+ RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("\n rtw_get_wpa_ie: sec_idx=%d in_ie[cnt+1]+2=%d\n",sec_idx,in_ie[cnt+1]+2));
++ {
++ RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("\n rtw_get_wpa_ie: sec_idx=%d in_ie[cnt+1]+2=%d\n",sec_idx,in_ie[cnt+1]+2));
+
+ _rtw_memcpy(wpa_ie, &in_ie[cnt],in_ie[cnt+1]+2);
+
@@ -12248,7 +12240,7 @@ index 000000000000..f89ce4a00323
+ {
+ if(authmode==_WPA2_IE_ID_)
+ {
-+ RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("\n get_rsn_ie: sec_idx=%d in_ie[cnt+1]+2=%d\n",sec_idx,in_ie[cnt+1]+2));
++ RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("\n get_rsn_ie: sec_idx=%d in_ie[cnt+1]+2=%d\n",sec_idx,in_ie[cnt+1]+2));
+
+ _rtw_memcpy(rsn_ie, &in_ie[cnt],in_ie[cnt+1]+2);
+
@@ -12262,32 +12254,32 @@ index 000000000000..f89ce4a00323
+ else
+ {
+ cnt+=in_ie[cnt+1]+2; //get next
-+ }
++ }
+ }
-+
++
+ }
-+
++
+_func_exit_;
+
+ return (*rsn_len+*wpa_len);
-+
++
+}
+
+u8 rtw_is_wps_ie(u8 *ie_ptr, uint *wps_ielen)
-+{
++{
+ u8 match = _FALSE;
+ u8 eid, wps_oui[4]={0x0,0x50,0xf2,0x04};
-+
++
+ if(ie_ptr == NULL) return match;
-+
++
+ eid = ie_ptr[0];
-+
++
+ if((eid==_WPA_IE_ID_)&&(_rtw_memcmp(&ie_ptr[2], wps_oui, 4)==_TRUE))
-+ {
-+ //printk("==> found WPS_IE.....\n");
-+ *wps_ielen = ie_ptr[1]+2;
++ {
++ //printk("==> found WPS_IE.....\n");
++ *wps_ielen = ie_ptr[1]+2;
+ match=_TRUE;
-+ }
++ }
+ return match;
+}
+
@@ -12324,20 +12316,20 @@ index 000000000000..f89ce4a00323
+
+ if(wps_ie)
+ _rtw_memcpy(wps_ie, &in_ie[cnt], in_ie[cnt+1]+2);
-+
++
+ if(wps_ielen)
+ *wps_ielen = in_ie[cnt+1]+2;
-+
++
+ cnt+=in_ie[cnt+1]+2;
+
+ break;
+ }
+ else
+ {
-+ cnt+=in_ie[cnt+1]+2; //goto next
-+ }
++ cnt+=in_ie[cnt+1]+2; //goto next
++ }
+
-+ }
++ }
+
+ return wpsie_ptr;
+}
@@ -12369,33 +12361,33 @@ index 000000000000..f89ce4a00323
+
+ // 6 = 1(Element ID) + 1(Length) + 4(WPS OUI)
+ attr_ptr = wps_ie + 6; //goto first attr
-+
++
+ while(attr_ptr - wps_ie < wps_ielen)
+ {
+ // 4 = 2(Attribute ID) + 2(Length)
+ u16 attr_id = RTW_GET_BE16(attr_ptr);
+ u16 attr_data_len = RTW_GET_BE16(attr_ptr + 2);
+ u16 attr_len = attr_data_len + 4;
-+
++
+ //DBG_871X("%s attr_ptr:%p, id:%u, length:%u\n", __FUNCTION__, attr_ptr, attr_id, attr_data_len);
+ if( attr_id == target_attr_id )
+ {
+ target_attr_ptr = attr_ptr;
-+
++
+ if(buf_attr)
+ _rtw_memcpy(buf_attr, attr_ptr, attr_len);
-+
++
+ if(len_attr)
+ *len_attr = attr_len;
-+
++
+ break;
+ }
+ else
+ {
+ attr_ptr += attr_len; //goto next
-+ }
-+
-+ }
++ }
++
++ }
+
+ return target_attr_ptr;
+}
@@ -12417,7 +12409,7 @@ index 000000000000..f89ce4a00323
+
+ if(len_content)
+ *len_content = 0;
-+
++
+ attr_ptr = rtw_get_wps_attr(wps_ie, wps_ielen, target_attr_id, NULL, &attr_len);
+
+ if(attr_ptr && attr_len)
@@ -12528,7 +12520,7 @@ index 000000000000..f89ce4a00323
+ }
+
+ return 0;
-+
++
+}
+
+/**
@@ -12561,7 +12553,7 @@ index 000000000000..f89ce4a00323
+ DBG_871X("IEEE 802.11 element "
+ "parse failed (id=%d elen=%d "
+ "left=%lu)\n",
-+ id, elen, (unsigned long) left);
++ id, elen, (unsigned long) left);
+ }
+ return ParseFailed;
+ }
@@ -12663,7 +12655,7 @@ index 000000000000..f89ce4a00323
+ return ParseFailed;
+
+ return unknown ? ParseUnknown : ParseOK;
-+
++
+}
+
+static u8 key_char2num(u8 ch);
@@ -12701,7 +12693,7 @@ index 000000000000..f89ce4a00323
+{
+ u8 mac[ETH_ALEN];
+ if(mac_addr == NULL) return;
-+
++
+ if ( rtw_initmac )
+ { // Users specify the mac address
+ int jj,kk;
@@ -12716,7 +12708,7 @@ index 000000000000..f89ce4a00323
+ { // Use the mac address stored in the Efuse
+ _rtw_memcpy(mac, mac_addr, ETH_ALEN);
+ }
-+
++
+ if (((mac[0]==0xff) &&(mac[1]==0xff) && (mac[2]==0xff) &&
+ (mac[3]==0xff) && (mac[4]==0xff) &&(mac[5]==0xff)) ||
+ ((mac[0]==0x0) && (mac[1]==0x0) && (mac[2]==0x0) &&
@@ -12731,7 +12723,7 @@ index 000000000000..f89ce4a00323
+ // use default mac addresss
+ _rtw_memcpy(mac_addr, mac, ETH_ALEN);
+ DBG_871X("MAC Address from efuse error, assign default one !!!\n");
-+ }
++ }
+
+ DBG_871X("rtw_macaddr_cfg MAC Address = "MAC_FMT"\n", MAC_ARG(mac_addr));
+}
@@ -12739,7 +12731,7 @@ index 000000000000..f89ce4a00323
+void dump_ies(u8 *buf, u32 buf_len) {
+ u8* pos = (u8*)buf;
+ u8 id, len;
-+
++
+ while(pos-buf<=buf_len){
+ id = *pos;
+ len = *(pos+1);
@@ -12751,7 +12743,7 @@ index 000000000000..f89ce4a00323
+ dump_wps_ie(pos, len);
+
+ pos+=(2+len);
-+ }
++ }
+}
+
+void dump_wps_ie(u8 *ie, u32 ie_len) {
@@ -12761,7 +12753,7 @@ index 000000000000..f89ce4a00323
+
+ u8 *wps_ie;
+ uint wps_ielen;
-+
++
+ wps_ie = rtw_get_wps_ie(ie, ie_len, NULL, &wps_ielen);
+ if(wps_ie != ie || wps_ielen == 0)
+ return;
@@ -12774,7 +12766,7 @@ index 000000000000..f89ce4a00323
+ DBG_871X("%s ID:0x%04x, LEN:%u\n", __FUNCTION__, id, len);
+
+ pos+=(4+len);
-+ }
++ }
+}
+
+#ifdef CONFIG_P2P
@@ -12856,7 +12848,7 @@ index 000000000000..f89ce4a00323
+
+ u8 *p2p_ie;
+ uint p2p_ielen;
-+
++
+ p2p_ie = rtw_get_p2p_ie(ie, ie_len, NULL, &p2p_ielen);
+ if(p2p_ie != ie || p2p_ielen == 0)
+ return;
@@ -12869,7 +12861,7 @@ index 000000000000..f89ce4a00323
+ DBG_871X("%s ID:%u, LEN:%u\n", __FUNCTION__, id, len);
+
+ pos+=(3+len);
-+ }
++ }
+}
+
+/**
@@ -12902,7 +12894,7 @@ index 000000000000..f89ce4a00323
+ if( ( eid == _VENDOR_SPECIFIC_IE_ ) && ( _rtw_memcmp( &in_ie[cnt+2], p2p_oui, 4) == _TRUE ) )
+ {
+ p2p_ie_ptr = in_ie + cnt;
-+
++
+ if ( p2p_ie != NULL )
+ {
+ _rtw_memcpy( p2p_ie, &in_ie[ cnt ], in_ie[ cnt + 1 ] + 2 );
@@ -12912,17 +12904,17 @@ index 000000000000..f89ce4a00323
+ {
+ *p2p_ielen = in_ie[ cnt + 1 ] + 2;
+ }
-+
++
+ return p2p_ie_ptr;
+
+ break;
+ }
+ else
+ {
-+ cnt += in_ie[ cnt + 1 ] +2; //goto next
-+ }
-+
-+ }
++ cnt += in_ie[ cnt + 1 ] +2; //goto next
++ }
++
++ }
+
+ return NULL;
+
@@ -12955,33 +12947,33 @@ index 000000000000..f89ce4a00323
+
+ // 6 = 1(Element ID) + 1(Length) + 3 (OUI) + 1(OUI Type)
+ attr_ptr = p2p_ie + 6; //goto first attr
-+
++
+ while(attr_ptr - p2p_ie < p2p_ielen)
+ {
+ // 3 = 1(Attribute ID) + 2(Length)
+ u8 attr_id = *attr_ptr;
+ u16 attr_data_len = RTW_GET_LE16(attr_ptr + 1);
+ u16 attr_len = attr_data_len + 3;
-+
++
+ //DBG_871X("%s attr_ptr:%p, id:%u, length:%u\n", __FUNCTION__, attr_ptr, attr_id, attr_data_len);
+ if( attr_id == target_attr_id )
+ {
+ target_attr_ptr = attr_ptr;
-+
++
+ if(buf_attr)
+ _rtw_memcpy(buf_attr, attr_ptr, attr_len);
-+
++
+ if(len_attr)
+ *len_attr = attr_len;
-+
++
+ break;
+ }
+ else
+ {
+ attr_ptr += attr_len; //goto next
-+ }
-+
-+ }
++ }
++
++ }
+
+ return target_attr_ptr;
+}
@@ -13003,7 +12995,7 @@ index 000000000000..f89ce4a00323
+
+ if(len_content)
+ *len_content = 0;
-+
++
+ attr_ptr = rtw_get_p2p_attr(p2p_ie, p2p_ielen, target_attr_id, NULL, &attr_len);
+
+ if(attr_ptr && attr_len)
@@ -13021,19 +13013,19 @@ index 000000000000..f89ce4a00323
+}
+
+u32 rtw_set_p2p_attr_content(u8 *pbuf, u8 attr_id, u16 attr_len, u8 *pdata_attr)
-+{
++{
+ u32 a_len;
+
+ *pbuf = attr_id;
-+
++
+ //*(u16*)(pbuf + 1) = cpu_to_le16(attr_len);
+ RTW_PUT_LE16(pbuf + 1, attr_len);
+
+ if(pdata_attr)
-+ _rtw_memcpy(pbuf + 3, pdata_attr, attr_len);
-+
++ _rtw_memcpy(pbuf + 3, pdata_attr, attr_len);
++
+ a_len = attr_len + 3;
-+
++
+ return a_len;
+}
+
@@ -13084,8 +13076,8 @@ index 000000000000..f89ce4a00323
+ u8 *p2p_ie;
+ uint p2p_ielen, p2p_ielen_ori;
+ int cnt;
-+
-+ if( (p2p_ie=rtw_get_p2p_ie(bss_ex->IEs+_FIXED_IE_LENGTH_, bss_ex->IELength-_FIXED_IE_LENGTH_, NULL, &p2p_ielen_ori)) )
++
++ if( (p2p_ie=rtw_get_p2p_ie(bss_ex->IEs+_FIXED_IE_LENGTH_, bss_ex->IELength-_FIXED_IE_LENGTH_, NULL, &p2p_ielen_ori)) )
+ {
+ #if 0
+ if(rtw_get_p2p_attr(p2p_ie, p2p_ielen_ori, attr_id, NULL, NULL)) {
@@ -13096,7 +13088,7 @@ index 000000000000..f89ce4a00323
+
+ p2p_ielen=rtw_p2p_attr_remove(p2p_ie, p2p_ielen_ori, attr_id);
+ if(p2p_ielen != p2p_ielen_ori) {
-+
++
+ u8 *next_ie_ori = p2p_ie+p2p_ielen_ori;
+ u8 *next_ie = p2p_ie+p2p_ielen;
+ uint remain_len = bss_ex->IELength-(next_ie_ori-bss_ex->IEs);
@@ -13119,7 +13111,7 @@ index 000000000000..f89ce4a00323
+int rtw_get_wfd_ie(u8 *in_ie, int in_len, u8 *wfd_ie, uint *wfd_ielen)
+{
+ int match;
-+ uint cnt = 0;
++ uint cnt = 0;
+ u8 eid, wfd_oui[4]={0x50,0x6F,0x9A,0x0A};
+
+
@@ -13129,17 +13121,17 @@ index 000000000000..f89ce4a00323
+ {
+ return match;
+ }
-+
++
+ while(cnt<in_len)
+ {
+ eid = in_ie[cnt];
-+
++
+ if( ( eid == _VENDOR_SPECIFIC_IE_ ) && ( _rtw_memcmp( &in_ie[cnt+2], wfd_oui, 4) == _TRUE ) )
+ {
+ if ( wfd_ie != NULL )
+ {
+ _rtw_memcpy( wfd_ie, &in_ie[ cnt ], in_ie[ cnt + 1 ] + 2 );
-+
++
+ }
+ else
+ {
@@ -13148,12 +13140,12 @@ index 000000000000..f89ce4a00323
+ *wfd_ielen = 0;
+ }
+ }
-+
++
+ if ( wfd_ielen != NULL )
+ {
+ *wfd_ielen = in_ie[ cnt + 1 ] + 2;
+ }
-+
++
+ cnt += in_ie[ cnt + 1 ] + 2;
+
+ match = _TRUE;
@@ -13161,16 +13153,16 @@ index 000000000000..f89ce4a00323
+ }
+ else
+ {
-+ cnt += in_ie[ cnt + 1 ] +2; //goto next
-+ }
-+
-+ }
++ cnt += in_ie[ cnt + 1 ] +2; //goto next
++ }
++
++ }
+
+ if ( match == _TRUE )
+ {
+ match = cnt;
+ }
-+
++
+ return match;
+
+}
@@ -13180,7 +13172,7 @@ index 000000000000..f89ce4a00323
+int rtw_get_wfd_attr_content(u8 *wfd_ie, uint wfd_ielen, u8 target_attr_id ,u8 *attr_content, uint *attr_contentlen)
+{
+ int match;
-+ uint cnt = 0;
++ uint cnt = 0;
+ u8 attr_id, wfd_oui[4]={0x50,0x6F,0x9A,0x0A};
+
+
@@ -13196,18 +13188,18 @@ index 000000000000..f89ce4a00323
+ cnt = 6;
+ while( cnt < wfd_ielen )
+ {
-+ u16 attrlen = RTW_GET_BE16(wfd_ie + cnt + 1);
-+
++ u16 attrlen = RTW_GET_BE16(wfd_ie + cnt + 1);
++
+ attr_id = wfd_ie[cnt];
+ if( attr_id == target_attr_id )
+ {
+ // 3 -> 1 byte for attribute ID field, 2 bytes for length field
+ if(attr_content)
+ _rtw_memcpy( attr_content, &wfd_ie[ cnt + 3 ], attrlen );
-+
++
+ if(attr_contentlen)
+ *attr_contentlen = attrlen;
-+
++
+ cnt += attrlen + 3;
+
+ match = _TRUE;
@@ -13215,10 +13207,10 @@ index 000000000000..f89ce4a00323
+ }
+ else
+ {
-+ cnt += attrlen + 3; //goto next
-+ }
-+
-+ }
++ cnt += attrlen + 3; //goto next
++ }
++
++ }
+
+ return match;
+
@@ -13273,7 +13265,7 @@ index 000000000000..f89ce4a00323
+u16 rtw_mcs_rate(u8 rf_type, u8 bw_40MHz, u8 short_GI_20, u8 short_GI_40, unsigned char * MCS_rate)
+{
+ u16 max_rate = 0;
-+
++
+ if(rf_type == RF_1T1R)
+ {
+ if(MCS_rate[0] & BIT(7))
@@ -13395,13 +13387,12 @@ index 000000000000..f89ce4a00323
+ action = (action >= ACT_PUBLIC_MAX) ? ACT_PUBLIC_MAX : action;
+ return _action_public_str[action];
+}
-+
diff --git a/drivers/net/wireless/realtek/rtl8192cu/core/rtw_io.c b/drivers/net/wireless/realtek/rtl8192cu/core/rtw_io.c
new file mode 100755
-index 000000000000..4ffaa50d3c5d
+index 000000000000..3e8ee42fe798
--- /dev/null
+++ b/drivers/net/wireless/realtek/rtl8192cu/core/rtw_io.c
-@@ -0,0 +1,464 @@
+@@ -0,0 +1,462 @@
+/******************************************************************************
+ *
+ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
@@ -13533,7 +13524,7 @@ index 000000000000..4ffaa50d3c5d
+
+ ret = _write8(pintfhdl, addr, val);
+ _func_exit_;
-+
++
+ return RTW_STATUS_CODE(ret);
+}
+int _rtw_write16(_adapter *adapter, u32 addr, u16 val)
@@ -13638,7 +13629,7 @@ index 000000000000..4ffaa50d3c5d
+
+ if( (adapter->bDriverStopped ==_TRUE) || (adapter->bSurpriseRemoved == _TRUE))
+ {
-+ RT_TRACE(_module_rtl871x_io_c_, _drv_info_, ("rtw_read_mem:bDriverStopped(%d) OR bSurpriseRemoved(%d)", adapter->bDriverStopped, adapter->bSurpriseRemoved));
++ RT_TRACE(_module_rtl871x_io_c_, _drv_info_, ("rtw_read_mem:bDriverStopped(%d) OR bSurpriseRemoved(%d)", adapter->bDriverStopped, adapter->bSurpriseRemoved));
+ return;
+ }
+
@@ -13678,7 +13669,7 @@ index 000000000000..4ffaa50d3c5d
+
+ if( (adapter->bDriverStopped ==_TRUE) || (adapter->bSurpriseRemoved == _TRUE))
+ {
-+ RT_TRACE(_module_rtl871x_io_c_, _drv_info_, ("rtw_read_port:bDriverStopped(%d) OR bSurpriseRemoved(%d)", adapter->bDriverStopped, adapter->bSurpriseRemoved));
++ RT_TRACE(_module_rtl871x_io_c_, _drv_info_, ("rtw_read_port:bDriverStopped(%d) OR bSurpriseRemoved(%d)", adapter->bDriverStopped, adapter->bSurpriseRemoved));
+ return;
+ }
+
@@ -13714,7 +13705,7 @@ index 000000000000..4ffaa50d3c5d
+ _func_enter_;
+
+ _write_port = pintfhdl->io_ops._write_port;
-+
++
+ ret = _write_port(pintfhdl, addr, cnt, pmem);
+
+ _func_exit_;
@@ -13773,12 +13764,12 @@ index 000000000000..4ffaa50d3c5d
+
+u16 read_sniff_ranges[][2] = {
+ //{0x550, 0x551},
-+};
++};
+
+u16 write_sniff_ranges[][2] = {
+ //{0x550, 0x551},
+ //{0x4c, 0x4c},
-+};
++};
+
+int read_sniff_num = sizeof(read_sniff_ranges)/sizeof(u16)/2;
+int write_sniff_num = sizeof(write_sniff_ranges)/sizeof(u16)/2;
@@ -13790,7 +13781,7 @@ index 000000000000..4ffaa50d3c5d
+ if (addr + len > read_sniff_ranges[i][0] && addr <= read_sniff_ranges[i][1])
+ return _TRUE;
+ }
-+
++
+ return _FALSE;
+}
+
@@ -13801,7 +13792,7 @@ index 000000000000..4ffaa50d3c5d
+ if (addr + len > write_sniff_ranges[i][0] && addr <= write_sniff_ranges[i][1])
+ return _TRUE;
+ }
-+
++
+ return _FALSE;
+}
+
@@ -13818,7 +13809,7 @@ index 000000000000..4ffaa50d3c5d
+u16 dbg_rtw_read16(_adapter *adapter, u32 addr, const char *caller, const int line)
+{
+ u16 val = _rtw_read16(adapter, addr);
-+
++
+ if (match_read_sniff_ranges(addr, 2))
+ DBG_871X("DBG_IO %s:%d rtw_read16(0x%04x) return 0x%04x\n", caller, line, addr, val);
+
@@ -13828,7 +13819,7 @@ index 000000000000..4ffaa50d3c5d
+u32 dbg_rtw_read32(_adapter *adapter, u32 addr, const char *caller, const int line)
+{
+ u32 val = _rtw_read32(adapter, addr);
-+
++
+ if (match_read_sniff_ranges(addr, 4))
+ DBG_871X("DBG_IO %s:%d rtw_read32(0x%04x) return 0x%08x\n", caller, line, addr, val);
+
@@ -13839,21 +13830,21 @@ index 000000000000..4ffaa50d3c5d
+{
+ if (match_write_sniff_ranges(addr, 1))
+ DBG_871X("DBG_IO %s:%d rtw_write8(0x%04x, 0x%02x)\n", caller, line, addr, val);
-+
++
+ return _rtw_write8(adapter, addr, val);
+}
+int dbg_rtw_write16(_adapter *adapter, u32 addr, u16 val, const char *caller, const int line)
+{
+ if (match_write_sniff_ranges(addr, 2))
+ DBG_871X("DBG_IO %s:%d rtw_write16(0x%04x, 0x%04x)\n", caller, line, addr, val);
-+
++
+ return _rtw_write16(adapter, addr, val);
+}
+int dbg_rtw_write32(_adapter *adapter, u32 addr, u32 val, const char *caller, const int line)
+{
+ if (match_write_sniff_ranges(addr, 4))
+ DBG_871X("DBG_IO %s:%d rtw_write32(0x%04x, 0x%08x)\n", caller, line, addr, val);
-+
++
+ return _rtw_write32(adapter, addr, val);
+}
+int dbg_rtw_writeN(_adapter *adapter, u32 addr ,u32 length , u8 *data, const char *caller, const int line)
@@ -13864,18 +13855,16 @@ index 000000000000..4ffaa50d3c5d
+ return _rtw_writeN(adapter, addr, length, data);
+}
+#endif
-+
-+
diff --git a/drivers/net/wireless/realtek/rtl8192cu/core/rtw_ioctl_query.c b/drivers/net/wireless/realtek/rtl8192cu/core/rtw_ioctl_query.c
new file mode 100755
-index 000000000000..06018867e34d
+index 000000000000..a67b08dce3b2
--- /dev/null
+++ b/drivers/net/wireless/realtek/rtl8192cu/core/rtw_ioctl_query.c
-@@ -0,0 +1,196 @@
+@@ -0,0 +1,195 @@
+/******************************************************************************
+ *
+ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
-+ *
++ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
@@ -13911,23 +13900,23 @@ index 000000000000..06018867e34d
+ u32 * pulOutLen
+)
+{
-+ static NDIS_802_11_AUTHENTICATION_ENCRYPTION szAuthEnc[] =
++ static NDIS_802_11_AUTHENTICATION_ENCRYPTION szAuthEnc[] =
+ {
-+ {Ndis802_11AuthModeOpen, Ndis802_11EncryptionDisabled},
++ {Ndis802_11AuthModeOpen, Ndis802_11EncryptionDisabled},
+ {Ndis802_11AuthModeOpen, Ndis802_11Encryption1Enabled},
-+ {Ndis802_11AuthModeShared, Ndis802_11EncryptionDisabled},
++ {Ndis802_11AuthModeShared, Ndis802_11EncryptionDisabled},
+ {Ndis802_11AuthModeShared, Ndis802_11Encryption1Enabled},
-+ {Ndis802_11AuthModeWPA, Ndis802_11Encryption2Enabled},
++ {Ndis802_11AuthModeWPA, Ndis802_11Encryption2Enabled},
+ {Ndis802_11AuthModeWPA, Ndis802_11Encryption3Enabled},
-+ {Ndis802_11AuthModeWPAPSK, Ndis802_11Encryption2Enabled},
++ {Ndis802_11AuthModeWPAPSK, Ndis802_11Encryption2Enabled},
+ {Ndis802_11AuthModeWPAPSK, Ndis802_11Encryption3Enabled},
-+ {Ndis802_11AuthModeWPANone, Ndis802_11Encryption2Enabled},
++ {Ndis802_11AuthModeWPANone, Ndis802_11Encryption2Enabled},
+ {Ndis802_11AuthModeWPANone, Ndis802_11Encryption3Enabled},
-+ {Ndis802_11AuthModeWPA2, Ndis802_11Encryption2Enabled},
++ {Ndis802_11AuthModeWPA2, Ndis802_11Encryption2Enabled},
+ {Ndis802_11AuthModeWPA2, Ndis802_11Encryption3Enabled},
-+ {Ndis802_11AuthModeWPA2PSK, Ndis802_11Encryption2Enabled},
++ {Ndis802_11AuthModeWPA2PSK, Ndis802_11Encryption2Enabled},
+ {Ndis802_11AuthModeWPA2PSK, Ndis802_11Encryption3Enabled}
-+ };
++ };
+ static ULONG ulNumOfPairSupported = sizeof(szAuthEnc)/sizeof(NDIS_802_11_AUTHENTICATION_ENCRYPTION);
+ NDIS_802_11_CAPABILITY * pCap = (NDIS_802_11_CAPABILITY *)pucBuf;
+ u8* pucAuthEncryptionSupported = (u8*) pCap->AuthenticationEncryptionSupported;
@@ -13936,9 +13925,9 @@ index 000000000000..06018867e34d
+ pCap->Length = sizeof(NDIS_802_11_CAPABILITY);
+ if(ulNumOfPairSupported > 1 )
+ pCap->Length += (ulNumOfPairSupported-1) * sizeof(NDIS_802_11_AUTHENTICATION_ENCRYPTION);
-+
-+ pCap->Version = 2;
-+ pCap->NoOfPMKIDs = NUM_PMKID_CACHE;
++
++ pCap->Version = 2;
++ pCap->NoOfPMKIDs = NUM_PMKID_CACHE;
+ pCap->NoOfAuthEncryptPairsSupported = ulNumOfPairSupported;
+
+ if( sizeof (szAuthEnc) <= 240 ) // 240 = 256 - 4*4 // SecurityInfo.szCapability: only 256 bytes in size.
@@ -13960,7 +13949,7 @@ index 000000000000..06018867e34d
+ struct wlan_network *tgt_network;
+ struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
+ struct security_priv *psecuritypriv=&(padapter->securitypriv);
-+ WLAN_BSSID_EX *psecnetwork=(WLAN_BSSID_EX*)&(psecuritypriv->sec_bss);
++ WLAN_BSSID_EX *psecnetwork=(WLAN_BSSID_EX*)&(psecuritypriv->sec_bss);
+ u8 * pDest = (u8 *)pAssocInfo + sizeof(NDIS_802_11_ASSOCIATION_INFORMATION);
+ unsigned char i,*auth_ie,*supp_ie;
+
@@ -13973,7 +13962,7 @@ index 000000000000..06018867e34d
+ //------------------------------------------------------
+ // Req_1. AvailableRequestFixedIEs
+ if(psecnetwork!=NULL){
-+
++
+ pAssocInfo->AvailableRequestFixedIEs |= NDIS_802_11_AI_REQFI_CAPABILITIES|NDIS_802_11_AI_REQFI_CURRENTAPADDRESS;
+ pAssocInfo->RequestFixedIEs.Capabilities = (unsigned short)* & psecnetwork->IEs[10];
+ _rtw_memcpy(pAssocInfo->RequestFixedIEs.CurrentAPAddress,
@@ -13983,12 +13972,12 @@ index 000000000000..06018867e34d
+
+ if(check_fwstate( pmlmepriv, _FW_UNDER_LINKING|_FW_LINKED)==_TRUE)
+ {
-+
++
+ if(psecuritypriv->ndisauthtype>=Ndis802_11AuthModeWPA2)
+ pDest[0] =48; //RSN Information Element
-+ else
++ else
+ pDest[0] =221; //WPA(SSN) Information Element
-+
++
+ RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("\n Adapter->ndisauthtype==Ndis802_11AuthModeWPA)?0xdd:0x30 [%d]",pDest[0]));
+ supp_ie=&psecuritypriv->supplicant_ie[0];
+ for(i=0;i<supp_ie[0];i++)
@@ -13996,34 +13985,34 @@ index 000000000000..06018867e34d
+ RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("IEs [%d] = 0x%x \n\n", i,supp_ie[i]));
+ }
+
-+ i=13; //0~11 is fixed information element
++ i=13; //0~11 is fixed information element
+ RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("i= %d tgt_network->network.IELength=%d\n\n", i,(int)psecnetwork->IELength));
+ while((i<supp_ie[0]) && (i<256)){
+ if((unsigned char)supp_ie[i]==pDest[0]){
+ _rtw_memcpy((u8 *)(pDest),
-+ &supp_ie[i],
++ &supp_ie[i],
+ supp_ie[1+i]+2);
-+
++
+ break;
+ }
-+
++
+ i=i+supp_ie[i+1]+2;
+ if(supp_ie[1+i]==0)
+ i=i+1;
+ RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("iteration i=%d IEs [%d] = 0x%x \n\n", i,i,supp_ie[i+1]));
-+
++
+ }
-+
++
+ +
+ pAssocInfo->RequestIELength += (2 + supp_ie[1+i]);// (2 + psecnetwork->IEs[1+i]+4);
+
+ }
-+
++++
+ +
+ RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("\n psecnetwork != NULL,fwstate==_FW_UNDER_LINKING \n"));
+
+ }
-+
++++
+
+ //------------------------------------------------------
+ // Association Response related information
@@ -14051,33 +14040,32 @@ index 000000000000..06018867e34d
+ i=auth_ie[0]-12;
+ if(i>0){
+ _rtw_memcpy((u8 *)&pDest[0],&auth_ie[1],i);
-+ pAssocInfo->ResponseIELength =i;
++ pAssocInfo->ResponseIELength =i;
+ }
+
+
-+ pAssocInfo->OffsetResponseIEs = sizeof(NDIS_802_11_ASSOCIATION_INFORMATION) + pAssocInfo->RequestIELength;
++ pAssocInfo->OffsetResponseIEs = sizeof(NDIS_802_11_ASSOCIATION_INFORMATION) + pAssocInfo->RequestIELength;
+
+
+ RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("\n tgt_network != NULL,fwstate==_FW_LINKED \n"));
+ }
-+ }
++ }
+ RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("\n exit query_802_11_association_information \n"));
+_func_exit_;
+
+ return _TRUE;
+}
+#endif
-+
diff --git a/drivers/net/wireless/realtek/rtl8192cu/core/rtw_ioctl_rtl.c b/drivers/net/wireless/realtek/rtl8192cu/core/rtw_ioctl_rtl.c
new file mode 100755
-index 000000000000..31b4704d4347
+index 000000000000..4e663d7a6809
--- /dev/null
+++ b/drivers/net/wireless/realtek/rtl8192cu/core/rtw_ioctl_rtl.c
@@ -0,0 +1,1031 @@
+/******************************************************************************
+ *
+ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
-+ *
++ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
@@ -14137,7 +14125,7 @@ index 000000000000..31b4704d4347
+ {1, &oid_rt_get_preamble_mode_hdl}, //0x96
+ {1, &oid_null_function}, //0x97
+ {1, &oid_rt_get_ap_ip_hdl}, //0x98
-+ {1, &oid_rt_get_channelplan_hdl}, //0x99
++ {1, &oid_rt_get_channelplan_hdl}, //0x99
+ {1, &oid_rt_set_preamble_mode_hdl}, //0x9A
+ {1, &oid_rt_set_bcn_intvl_hdl}, //0x9B
+ {1, &oid_null_function}, //0x9C
@@ -14153,7 +14141,7 @@ index 000000000000..31b4704d4347
+ {1, &oid_null_function}, //0xA6
+ {1, &oid_rt_get_total_tx_bytes_hdl}, //0xA7
+ {1, &oid_rt_get_total_rx_bytes_hdl}, //0xA8
-+ {1, &oid_rt_current_tx_power_level_hdl}, //0xA9
++ {1, &oid_rt_current_tx_power_level_hdl}, //0xA9
+ {1, &oid_rt_get_enc_key_mismatch_count_hdl}, //0xAA
+ {1, &oid_rt_get_enc_key_match_count_hdl}, //0xAB
+ {1, &oid_rt_get_channel_hdl}, //0xAC
@@ -14169,7 +14157,7 @@ index 000000000000..31b4704d4347
+ {1, &oid_null_function}, //0xB6
+ {1, &oid_null_function}, //0xB7
+ {1, &oid_null_function}, //0xB8
-+ {1, &oid_null_function}, //0xB9
++ {1, &oid_null_function}, //0xB9
+ {1, &oid_null_function}, //0xBA
+ {1, &oid_rt_supported_wireless_mode_hdl}, //0xBB
+ {1, &oid_rt_get_channel_list_hdl}, //0xBC
@@ -14185,14 +14173,14 @@ index 000000000000..31b4704d4347
+ {1, &oid_null_function}, //0xC6
+ {1, &oid_null_function}, //0xC7
+ {1, &oid_null_function}, //0xC8
-+ {1, &oid_null_function}, //0xC9
++ {1, &oid_null_function}, //0xC9
+ {1, &oid_null_function}, //0xCA
+ {1, &oid_null_function}, //0xCB
+ {1, &oid_null_function}, //0xCC
+ {1, &oid_null_function}, //0xCD
+ {1, &oid_null_function}, //0xCE
+ {1, &oid_null_function}, //0xCF
-+
++
+};
+
+struct oid_obj_priv oid_rtl_seg_01_03[] =
@@ -14208,7 +14196,7 @@ index 000000000000..31b4704d4347
+
+struct oid_obj_priv oid_rtl_seg_01_11[] =
+{
-+ {1, &oid_null_function}, //0xC0 OID_RT_PRO_RX_FILTER
++ {1, &oid_null_function}, //0xC0 OID_RT_PRO_RX_FILTER
+ {1, &oid_null_function}, //0xC1 OID_CE_USB_WRITE_REGISTRY
+ {1, &oid_null_function}, //0xC2 OID_CE_USB_READ_REGISTRY
+ {1, &oid_null_function}, //0xC3 OID_RT_PRO_SET_INITIAL_GAIN
@@ -14216,10 +14204,10 @@ index 000000000000..31b4704d4347
+ {1, &oid_null_function}, //0xC5 OID_RT_PRO_SET_BB_RF_SHUTDOWN_MODE
+ {1, &oid_null_function}, //0xC6 OID_RT_PRO_SET_TX_CHARGE_PUMP
+ {1, &oid_null_function}, //0xC7 OID_RT_PRO_SET_RX_CHARGE_PUMP
-+ {1, &oid_rt_pro_rf_write_registry_hdl}, //0xC8
-+ {1, &oid_rt_pro_rf_read_registry_hdl}, //0xC9
++ {1, &oid_rt_pro_rf_write_registry_hdl}, //0xC8
++ {1, &oid_rt_pro_rf_read_registry_hdl}, //0xC9
+ {1, &oid_null_function} //0xCA OID_RT_PRO_QUERY_RF_TYPE
-+
++
+};
+
+struct oid_obj_priv oid_rtl_seg_03_00[] =
@@ -14230,11 +14218,11 @@ index 000000000000..31b4704d4347
+ {1, &oid_null_function}, //0x03
+ {1, &oid_rt_set_default_key_id_hdl}, //0x04
+
-+
++
+};
+
+
-+//************** oid_rtl_seg_01_01 section start **************
++//************** oid_rtl_seg_01_01 section start **************
+
+NDIS_STATUS oid_rt_pro_set_fw_dig_state_hdl(struct oid_par_priv* poid_par_priv)
+{
@@ -14242,28 +14230,28 @@ index 000000000000..31b4704d4347
+#if 0
+ PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context);
+ _irqL oldirql;
-+
++
+ _func_enter_;
-+
-+ if(poid_par_priv->type_of_oid != SET_OID)
++
++ if(poid_par_priv->type_of_oid != SET_OID)
+ {
+ status = NDIS_STATUS_NOT_ACCEPTED;
+ return status;
+ }
-+
++
+ _irqlevel_changed_(&oldirql,LOWER);
+ if(poid_par_priv->information_buf_len >= sizeof(struct setdig_parm))
+ {
-+ //DEBUG_ERR(("===> oid_rt_pro_set_fw_dig_state_hdl. type:0x%02x.\n",*((unsigned char*)poid_par_priv->information_buf )));
-+ if(!rtw_setfwdig_cmd(Adapter,*((unsigned char*)poid_par_priv->information_buf )))
++ //DEBUG_ERR(("===> oid_rt_pro_set_fw_dig_state_hdl. type:0x%02x.\n",*((unsigned char*)poid_par_priv->information_buf )));
++ if(!rtw_setfwdig_cmd(Adapter,*((unsigned char*)poid_par_priv->information_buf )))
+ {
+ status = NDIS_STATUS_NOT_ACCEPTED;
+ }
-+
++
+ }
+ else{
+ status = NDIS_STATUS_NOT_ACCEPTED;
-+ }
++ }
+ _irqlevel_changed_(&oldirql,RAISE);
+ _func_exit_;
+#endif
@@ -14277,29 +14265,29 @@ index 000000000000..31b4704d4347
+#if 0
+ PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context);
+ _irqL oldirql;
-+
-+ _func_enter_;
-+ if(poid_par_priv->type_of_oid != SET_OID)
++
++ _func_enter_;
++ if(poid_par_priv->type_of_oid != SET_OID)
+ {
+ status = NDIS_STATUS_NOT_ACCEPTED;
+ return status;
+ }
+
-+
++
+ _irqlevel_changed_(&oldirql,LOWER);
-+
++
+ if(poid_par_priv->information_buf_len >= sizeof(struct setra_parm))
+ {
-+ //DEBUG_ERR(("===> oid_rt_pro_set_fw_ra_state_hdl. type:0x%02x.\n",*((unsigned char*)poid_par_priv->information_buf )));
-+ if(!rtw_setfwra_cmd(Adapter,*((unsigned char*)poid_par_priv->information_buf )))
++ //DEBUG_ERR(("===> oid_rt_pro_set_fw_ra_state_hdl. type:0x%02x.\n",*((unsigned char*)poid_par_priv->information_buf )));
++ if(!rtw_setfwra_cmd(Adapter,*((unsigned char*)poid_par_priv->information_buf )))
+ {
+ status = NDIS_STATUS_NOT_ACCEPTED;
+ }
-+
++
+ }
+ else{
+ status = NDIS_STATUS_NOT_ACCEPTED;
-+ }
++ }
+ _irqlevel_changed_(&oldirql,RAISE);
+ _func_exit_;
+#endif
@@ -14316,7 +14304,7 @@ index 000000000000..31b4704d4347
+ {
+ status = NDIS_STATUS_NOT_ACCEPTED;
+ return status;
-+ }
++ }
+
+#if 0
+ if(pMgntInfo->mAssoc || pMgntInfo->mIbss)
@@ -14345,12 +14333,12 @@ index 000000000000..31b4704d4347
+ {
+ status = NDIS_STATUS_NOT_ACCEPTED;
+ return status;
-+ }
-+
++ }
++
+ if(poid_par_priv->information_buf_len >= sizeof(ULONG) )
-+ {
++ {
+ *(ULONG *)poid_par_priv->information_buf = padapter->recvpriv.rx_smallpacket_crcerr;
-+ *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
++ *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
+ }
+ else
+ {
@@ -14369,12 +14357,12 @@ index 000000000000..31b4704d4347
+ {
+ status = NDIS_STATUS_NOT_ACCEPTED;
+ return status;
-+ }
++ }
+
+ if(poid_par_priv->information_buf_len >= sizeof(ULONG) )
-+ {
++ {
+ *(ULONG *)poid_par_priv->information_buf = padapter->recvpriv.rx_middlepacket_crcerr;
-+ *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
++ *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
+ }
+ else
+ {
@@ -14394,12 +14382,12 @@ index 000000000000..31b4704d4347
+ {
+ status = NDIS_STATUS_NOT_ACCEPTED;
+ return status;
-+ }
++ }
+
+ if(poid_par_priv->information_buf_len >= sizeof(ULONG) )
-+ {
++ {
+ *(ULONG *)poid_par_priv->information_buf = padapter->recvpriv.rx_largepacket_crcerr;
-+ *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
++ *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
+ }
+ else
+ {
@@ -14420,7 +14408,7 @@ index 000000000000..31b4704d4347
+ {
+ status = NDIS_STATUS_NOT_ACCEPTED;
+ return status;
-+ }
++ }
+
+ return status;
+}
@@ -14433,7 +14421,7 @@ index 000000000000..31b4704d4347
+ {
+ status = NDIS_STATUS_NOT_ACCEPTED;
+ return status;
-+ }
++ }
+ *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
+ return status;
+}
@@ -14447,11 +14435,11 @@ index 000000000000..31b4704d4347
+ {
+ status = NDIS_STATUS_NOT_ACCEPTED;
+ return status;
-+ }
++ }
+ if(poid_par_priv->information_buf_len >= sizeof(ULONG) )
-+ {
++ {
+ *(u64 *)poid_par_priv->information_buf = padapter->recvpriv.rx_pkts + padapter->recvpriv.rx_drop;
-+ *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
++ *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
+ }
+ else
+ {
@@ -14471,7 +14459,7 @@ index 000000000000..31b4704d4347
+ {
+ status = NDIS_STATUS_NOT_ACCEPTED;
+ return status;
-+ }
++ }
+
+ return status;
+}
@@ -14484,7 +14472,7 @@ index 000000000000..31b4704d4347
+ {
+ status = NDIS_STATUS_NOT_ACCEPTED;
+ return status;
-+ }
++ }
+
+ return status;
+}
@@ -14509,7 +14497,7 @@ index 000000000000..31b4704d4347
+ {
+ status = NDIS_STATUS_INVALID_LENGTH ;
+ }
-+
++
+
+ return status;
+}
@@ -14523,7 +14511,7 @@ index 000000000000..31b4704d4347
+ {
+ status = NDIS_STATUS_NOT_ACCEPTED;
+ return status;
-+ }
++ }
+
+ return status;
+}
@@ -14532,23 +14520,23 @@ index 000000000000..31b4704d4347
+{
+ NDIS_STATUS status = NDIS_STATUS_SUCCESS;
+ PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
-+ ULONG preamblemode = 0 ;
-+
++ ULONG preamblemode = 0 ;
++
+ if(poid_par_priv->type_of_oid != QUERY_OID)
+ {
+ status = NDIS_STATUS_NOT_ACCEPTED;
+ return status;
-+ }
++ }
+ if(poid_par_priv->information_buf_len>= sizeof(ULONG))
-+ {
++ {
+ if(padapter->registrypriv.preamble == PREAMBLE_LONG)
+ preamblemode = 0;
+ else if (padapter->registrypriv.preamble == PREAMBLE_AUTO)
+ preamblemode = 1;
+ else if (padapter->registrypriv.preamble == PREAMBLE_SHORT)
+ preamblemode = 2;
-+
-+
++
++
+ *(ULONG *)poid_par_priv->information_buf = preamblemode ;
+ *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
+ }
@@ -14568,7 +14556,7 @@ index 000000000000..31b4704d4347
+ {
+ status = NDIS_STATUS_NOT_ACCEPTED;
+ return status;
-+ }
++ }
+
+ return status;
+}
@@ -14577,13 +14565,13 @@ index 000000000000..31b4704d4347
+{
+ NDIS_STATUS status = NDIS_STATUS_SUCCESS;
+ PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
-+ struct eeprom_priv* peeprompriv = &padapter->eeprompriv;
++ struct eeprom_priv* peeprompriv = &padapter->eeprompriv;
+
+ if(poid_par_priv->type_of_oid != QUERY_OID)
+ {
+ status = NDIS_STATUS_NOT_ACCEPTED;
+ return status;
-+ }
++ }
+ *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
+ *(u16 *)poid_par_priv->information_buf = peeprompriv->channel_plan ;
+
@@ -14593,14 +14581,14 @@ index 000000000000..31b4704d4347
+{
+ NDIS_STATUS status = NDIS_STATUS_SUCCESS;
+ PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
-+ struct eeprom_priv* peeprompriv = &padapter->eeprompriv;
-+
++ struct eeprom_priv* peeprompriv = &padapter->eeprompriv;
++
+ if(poid_par_priv->type_of_oid != SET_OID)
+ {
+ status = NDIS_STATUS_NOT_ACCEPTED;
+ return status;
-+ }
-+
++ }
++
+ peeprompriv->channel_plan = *(u16 *)poid_par_priv->information_buf ;
+
+ return status;
@@ -14616,24 +14604,24 @@ index 000000000000..31b4704d4347
+ status = NDIS_STATUS_NOT_ACCEPTED;
+ return status;
+ }
-+
++
+ if(poid_par_priv->information_buf_len>= sizeof(ULONG))
-+ {
++ {
+ preamblemode = *(ULONG *)poid_par_priv->information_buf ;
+ if( preamblemode == 0)
+ padapter->registrypriv.preamble = PREAMBLE_LONG;
+ else if (preamblemode==1 )
+ padapter->registrypriv.preamble = PREAMBLE_AUTO;
+ else if ( preamblemode==2 )
-+ padapter->registrypriv.preamble = PREAMBLE_SHORT;
-+
++ padapter->registrypriv.preamble = PREAMBLE_SHORT;
++
+ *(ULONG *)poid_par_priv->information_buf = preamblemode ;
+ *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
+ }
+ else
+ {
+ status = NDIS_STATUS_INVALID_LENGTH ;
-+ }
++ }
+
+ return status;
+}
@@ -14668,9 +14656,9 @@ index 000000000000..31b4704d4347
+ {
+ status = NDIS_STATUS_NOT_ACCEPTED;
+ return status;
-+ }
++ }
+ if(poid_par_priv->information_buf_len>= sizeof(ULONG))
-+ {
++ {
+ *(u64 *)poid_par_priv->information_buf = padapter->xmitpriv.tx_bytes;
+ *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
+ }
@@ -14678,7 +14666,7 @@ index 000000000000..31b4704d4347
+ {
+ status = NDIS_STATUS_INVALID_LENGTH ;
+ }
-+
++
+
+ return status;
+}
@@ -14722,7 +14710,7 @@ index 000000000000..31b4704d4347
+ {
+ status = NDIS_STATUS_NOT_ACCEPTED;
+ return status;
-+ }
++ }
+
+ return status;
+}
@@ -14735,7 +14723,7 @@ index 000000000000..31b4704d4347
+ {
+ status = NDIS_STATUS_NOT_ACCEPTED;
+ return status;
-+ }
++ }
+
+ return status;
+}
@@ -14753,7 +14741,7 @@ index 000000000000..31b4704d4347
+ {
+ status = NDIS_STATUS_NOT_ACCEPTED;
+ return status;
-+ }
++ }
+
+ if ( (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) ||
+ (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == _TRUE))
@@ -14763,7 +14751,7 @@ index 000000000000..31b4704d4347
+
+ channelnum = pnic_Config->DSConfig;
+ *(ULONG *)poid_par_priv->information_buf = channelnum;
-+
++
+ *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
+
+ _func_exit_;
@@ -14781,7 +14769,7 @@ index 000000000000..31b4704d4347
+ {
+ status = NDIS_STATUS_NOT_ACCEPTED;
+ return status;
-+ }
++ }
+
+ return status;
+}
@@ -14794,7 +14782,7 @@ index 000000000000..31b4704d4347
+ {
+ status = NDIS_STATUS_NOT_ACCEPTED;
+ return status;
-+ }
++ }
+
+ return status;
+}
@@ -14803,24 +14791,24 @@ index 000000000000..31b4704d4347
+ NDIS_STATUS status = NDIS_STATUS_SUCCESS;
+ PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
+ ULONG ulInfo = 0 ;
-+ //DEBUG_ERR(("<**********************oid_rt_supported_wireless_mode_hdl \n"));
++ //DEBUG_ERR(("<**********************oid_rt_supported_wireless_mode_hdl \n"));
+ if(poid_par_priv->type_of_oid != QUERY_OID)
+ {
+ status = NDIS_STATUS_NOT_ACCEPTED;
+ return status;
-+ }
++ }
+ if(poid_par_priv->information_buf_len >= sizeof(ULONG)){
+ ulInfo |= 0x0100; //WIRELESS_MODE_B
+ ulInfo |= 0x0200; //WIRELESS_MODE_G
+ ulInfo |= 0x0400; //WIRELESS_MODE_A
+
-+ *(ULONG *) poid_par_priv->information_buf = ulInfo;
-+ //DEBUG_ERR(("<===oid_rt_supported_wireless_mode %x\n",ulInfo));
++ *(ULONG *) poid_par_priv->information_buf = ulInfo;
++ //DEBUG_ERR(("<===oid_rt_supported_wireless_mode %x\n",ulInfo));
+ *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
+ }
+ else{
+ status = NDIS_STATUS_INVALID_LENGTH;
-+ }
++ }
+
+ return status;
+}
@@ -14833,7 +14821,7 @@ index 000000000000..31b4704d4347
+ {
+ status = NDIS_STATUS_NOT_ACCEPTED;
+ return status;
-+ }
++ }
+
+ return status;
+}
@@ -14846,7 +14834,7 @@ index 000000000000..31b4704d4347
+ {
+ status = NDIS_STATUS_NOT_ACCEPTED;
+ return status;
-+ }
++ }
+
+ return status;
+}
@@ -14875,7 +14863,7 @@ index 000000000000..31b4704d4347
+ {
+ status = NDIS_STATUS_NOT_ACCEPTED;
+ return status;
-+ }
++ }
+
+ return status;
+}
@@ -14887,9 +14875,9 @@ index 000000000000..31b4704d4347
+
+ return status;
+}
-+//************** oid_rtl_seg_01_01 section end **************
++//************** oid_rtl_seg_01_01 section end **************
+
-+//************** oid_rtl_seg_01_03 section start **************
++//************** oid_rtl_seg_01_03 section start **************
+NDIS_STATUS oid_rt_ap_get_associated_station_list_hdl(struct oid_par_priv* poid_par_priv)
+{
+ NDIS_STATUS status = NDIS_STATUS_SUCCESS;
@@ -14899,7 +14887,7 @@ index 000000000000..31b4704d4347
+ {
+ status = NDIS_STATUS_NOT_ACCEPTED;
+ return status;
-+ }
++ }
+
+ return status;
+}
@@ -14926,12 +14914,12 @@ index 000000000000..31b4704d4347
+ {
+ status = NDIS_STATUS_NOT_ACCEPTED;
+ return status;
-+ }
++ }
+
+ return status;
+}
+
-+//************** oid_rtl_seg_01_03 section end **************
++//************** oid_rtl_seg_01_03 section end **************
+
+//**************** oid_rtl_seg_01_11 section start ****************
+NDIS_STATUS oid_rt_pro_rf_write_registry_hdl(struct oid_par_priv* poid_par_priv)
@@ -14946,27 +14934,27 @@ index 000000000000..31b4704d4347
+ status = NDIS_STATUS_NOT_ACCEPTED;
+ return status;
+ }
-+
++
+ _irqlevel_changed_(&oldirql,LOWER);
+ if(poid_par_priv->information_buf_len== (sizeof(unsigned long)*3))
-+ {
++ {
+ //RegOffsetValue - The offset of RF register to write.
+ //RegDataWidth - The data width of RF register to write.
-+ //RegDataValue - The value to write.
++ //RegDataValue - The value to write.
+ //RegOffsetValue = *((unsigned long*)InformationBuffer);
-+ //RegDataWidth = *((unsigned long*)InformationBuffer+1);
-+ //RegDataValue = *((unsigned long*)InformationBuffer+2);
-+ if(!rtw_setrfreg_cmd(Adapter,
-+ *(unsigned char*)poid_par_priv->information_buf,
++ //RegDataWidth = *((unsigned long*)InformationBuffer+1);
++ //RegDataValue = *((unsigned long*)InformationBuffer+2);
++ if(!rtw_setrfreg_cmd(Adapter,
++ *(unsigned char*)poid_par_priv->information_buf,
+ (unsigned long)(*((unsigned long*)poid_par_priv->information_buf+2))))
+ {
+ status = NDIS_STATUS_NOT_ACCEPTED;
+ }
-+
++
+ }
+ else{
+ status = NDIS_STATUS_INVALID_LENGTH;
-+ }
++ }
+ _irqlevel_changed_(&oldirql,RAISE);
+ _func_exit_;
+
@@ -14987,8 +14975,8 @@ index 000000000000..31b4704d4347
+ {
+ status = NDIS_STATUS_NOT_ACCEPTED;
+ return status;
-+ }
-+
++ }
++
+ _irqlevel_changed_(&oldirql,LOWER);
+ if(poid_par_priv->information_buf_len== (sizeof(unsigned long)*3))
+ {
@@ -15002,24 +14990,24 @@ index 000000000000..31b4704d4347
+ Adapter->mppriv.act_in_progress = _TRUE;
+ Adapter->mppriv.workparam.bcompleted= _FALSE;
+ Adapter->mppriv.workparam.act_type = MPT_READ_RF;
-+ Adapter->mppriv.workparam.io_offset = *(unsigned long*)poid_par_priv->information_buf;
++ Adapter->mppriv.workparam.io_offset = *(unsigned long*)poid_par_priv->information_buf;
+ Adapter->mppriv.workparam.io_value = 0xcccccccc;
-+
++
+ //RegOffsetValue - The offset of RF register to read.
+ //RegDataWidth - The data width of RF register to read.
-+ //RegDataValue - The value to read.
++ //RegDataValue - The value to read.
+ //RegOffsetValue = *((unsigned long*)InformationBuffer);
-+ //RegDataWidth = *((unsigned long*)InformationBuffer+1);
-+ //RegDataValue = *((unsigned long*)InformationBuffer+2);
-+ if(!rtw_getrfreg_cmd(Adapter,
-+ *(unsigned char*)poid_par_priv->information_buf,
++ //RegDataWidth = *((unsigned long*)InformationBuffer+1);
++ //RegDataValue = *((unsigned long*)InformationBuffer+2);
++ if(!rtw_getrfreg_cmd(Adapter,
++ *(unsigned char*)poid_par_priv->information_buf,
+ (unsigned char*)&Adapter->mppriv.workparam.io_value))
+ {
+ status = NDIS_STATUS_NOT_ACCEPTED;
+ }
+ }
-+
-+
++
++
+ }
+ else {
+ status = NDIS_STATUS_INVALID_LENGTH;
@@ -15030,10 +15018,10 @@ index 000000000000..31b4704d4347
+ return status;
+}
+
-+//**************** oid_rtl_seg_01_11 section end****************
++//**************** oid_rtl_seg_01_11 section end****************
+
+
-+//************** oid_rtl_seg_03_00 section start **************
++//************** oid_rtl_seg_03_00 section start **************
+enum _CONNECT_STATE_{
+ CHECKINGSTATUS,
+ ASSOCIATED,
@@ -15049,21 +15037,21 @@ index 000000000000..31b4704d4347
+ struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
+
+ ULONG ulInfo;
-+
++
+ if(poid_par_priv->type_of_oid != QUERY_OID)
+ {
+ status = NDIS_STATUS_NOT_ACCEPTED;
+ return status;
-+ }
++ }
+
+ // nStatus==0 CheckingStatus
+ // nStatus==1 Associated
+ // nStatus==2 AdHocMode
+ // nStatus==3 NotAssociated
-+
++
+ if(check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == _TRUE)
+ ulInfo = CHECKINGSTATUS;
-+ else if(check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE)
++ else if(check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE)
+ ulInfo = ASSOCIATED;
+ else if(check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)== _TRUE)
+ ulInfo = ADHOCMODE;
@@ -15101,20 +15089,20 @@ index 000000000000..31b4704d4347
+ status = NDIS_STATUS_NOT_ACCEPTED;
+ return status;
+ }
-+
++
+ return status;
+}
-+//************** oid_rtl_seg_03_00 section end **************
++//************** oid_rtl_seg_03_00 section end **************
diff --git a/drivers/net/wireless/realtek/rtl8192cu/core/rtw_ioctl_set.c b/drivers/net/wireless/realtek/rtl8192cu/core/rtw_ioctl_set.c
new file mode 100755
-index 000000000000..564ff6eaebec
+index 000000000000..bf800ddf6681
--- /dev/null
+++ b/drivers/net/wireless/realtek/rtl8192cu/core/rtw_ioctl_set.c
-@@ -0,0 +1,1494 @@
+@@ -0,0 +1,1493 @@
+/******************************************************************************
+ *
+ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
-+ *
++ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
@@ -15163,7 +15151,7 @@ index 000000000000..564ff6eaebec
+ if (is_zero_mac_addr(bssid)
+ || is_broadcast_mac_addr(bssid)
+ || is_multicast_mac_addr(bssid)
-+ ) {
++ ) {
+ ret = _FALSE;
+ }
+
@@ -15175,7 +15163,7 @@ index 000000000000..564ff6eaebec
+ u8 i;
+ u8 ret=_TRUE;
+
-+_func_enter_;
++_func_enter_;
+
+ if (ssid->SsidLength > 32) {
+ RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("ssid length >32\n"));
@@ -15195,7 +15183,7 @@ index 000000000000..564ff6eaebec
+ }
+#endif /* CONFIG_VALIDATE_SSID */
+
-+exit:
++exit:
+
+_func_exit_;
+
@@ -15221,7 +15209,7 @@ index 000000000000..564ff6eaebec
+ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("\n rtw_do_join: phead = %p; plist = %p \n\n\n", phead, plist));
+
+ pmlmepriv->cur_network.join_res = -2;
-+
++
+ set_fwstate(pmlmepriv, _FW_UNDER_LINKING);
+
+ pmlmepriv->pscanned = plist;
@@ -15229,13 +15217,13 @@ index 000000000000..564ff6eaebec
+ pmlmepriv->to_join = _TRUE;
+
+ if(_rtw_queue_empty(queue)== _TRUE)
-+ {
++ {
+ _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
+ _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
-+
++
+ //when set_ssid/set_bssid for rtw_do_join(), but scanning queue is empty
-+ //we try to issue sitesurvey firstly
-+
++ //we try to issue sitesurvey firstly
++
+ if (pmlmepriv->LinkDetectInfo.bBusyTraffic ==_FALSE
+ || rtw_to_roaming(padapter) > 0
+ )
@@ -15246,10 +15234,10 @@ index 000000000000..564ff6eaebec
+ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("rtw_do_join(): site survey return error\n."));
+ }
+ }
-+
++
+ goto exit;
-+ }
-+ else
++ }
++ else
+ {
+ int select_ret;
+ _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
@@ -15264,60 +15252,60 @@ index 000000000000..564ff6eaebec
+ _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
+ rtw_indicate_connect(padapter);
+ }
-+ else
++ else
+ {
+ if(check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)==_TRUE)
+ {
+ // submit createbss_cmd to change to a ADHOC_MASTER
+
-+ //pmlmepriv->lock has been acquired by caller...
++ //pmlmepriv->lock has been acquired by caller...
+ WLAN_BSSID_EX *pdev_network = &(padapter->registrypriv.dev_network);
+
+ pmlmepriv->fw_state = WIFI_ADHOC_MASTER_STATE;
-+
++
+ pibss = padapter->registrypriv.dev_network.MacAddress;
+
+ _rtw_memset(&pdev_network->Ssid, 0, sizeof(NDIS_802_11_SSID));
+ _rtw_memcpy(&pdev_network->Ssid, &pmlmepriv->assoc_ssid, sizeof(NDIS_802_11_SSID));
-+
++
+ rtw_update_registrypriv_dev_network(padapter);
+
+ rtw_generate_random_ibss(pibss);
-+
++
+ if(rtw_createbss_cmd(padapter)!=_SUCCESS)
+ {
-+ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("***Error=>do_goin: rtw_createbss_cmd status FAIL*** \n "));
++ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("***Error=>do_goin: rtw_createbss_cmd status FAIL*** \n "));
+ ret = _FALSE;
+ goto exit;
+ }
+
-+ pmlmepriv->to_join = _FALSE;
++ pmlmepriv->to_join = _FALSE;
+
-+ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("***Error=> rtw_select_and_join_from_scanned_queue FAIL under STA_Mode*** \n "));
++ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("***Error=> rtw_select_and_join_from_scanned_queue FAIL under STA_Mode*** \n "));
+
-+ }
++ }
+ else
-+ {
-+ // can't associate ; reset under-linking
++ {
++ // can't associate ; reset under-linking
+ _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
+
-+#if 0
++#if 0
+ if((check_fwstate(pmlmepriv, WIFI_STATION_STATE) == _TRUE))
+ {
+ if(_rtw_memcmp(pmlmepriv->cur_network.network.Ssid.Ssid, pmlmepriv->assoc_ssid.Ssid, pmlmepriv->assoc_ssid.SsidLength))
-+ {
++ {
+ // for funk to do roaming
+ // funk will reconnect, but funk will not sitesurvey before reconnect
+ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("for funk to do roaming"));
+ if(pmlmepriv->sitesurveyctrl.traffic_busy==_FALSE)
+ rtw_sitesurvey_cmd(padapter, &pmlmepriv->assoc_ssid, 1, NULL, 0);
+ }
-+
-+ }
++
++ }
+#endif
+
+ //when set_ssid/set_bssid for rtw_do_join(), but there are no desired bss in scanning queue
-+ //we try to issue sitesurvey firstly
++ //we try to issue sitesurvey firstly
+ if(pmlmepriv->LinkDetectInfo.bBusyTraffic==_FALSE
+ || rtw_to_roaming(padapter) > 0
+ )
@@ -15326,7 +15314,7 @@ index 000000000000..564ff6eaebec
+ if( _SUCCESS!=(ret=rtw_sitesurvey_cmd(padapter, &pmlmepriv->assoc_ssid, 1, NULL, 0)) ){
+ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("do_join(): site survey return error\n."));
+ }
-+ }
++ }
+
+
+ }
@@ -15334,12 +15322,12 @@ index 000000000000..564ff6eaebec
+ }
+
+ }
-+
++
+exit:
-+
-+_func_exit_;
+
-+ return ret;
++_func_exit_;
++
++ return ret;
+}
+
+#ifdef PLATFORM_WINDOWS
@@ -15350,20 +15338,20 @@ index 000000000000..564ff6eaebec
+_func_enter_;
+
+ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("==>rtw_pnp_set_power_wakeup!!!\n"));
-+
++
+ res = rtw_setstandby_cmd(padapter, 0);
+
+ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("<==rtw_pnp_set_power_wakeup!!!\n"));
+
+_func_exit_;
-+
++
+ return res;
+}
+
+u8 rtw_pnp_set_power_sleep(_adapter* padapter)
+{
-+ u8 res=_SUCCESS;
-+
++ u8 res=_SUCCESS;
++
+_func_enter_;
+
+ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("==>rtw_pnp_set_power_sleep!!!\n"));
@@ -15393,18 +15381,18 @@ index 000000000000..564ff6eaebec
+ // 8711 CAM was not for En/Decrypt only
+ // so, we can't clear all keys.
+ // should we disable WPAcfg (ox0088) bit 1-2, instead of clear all CAM
-+
++
+ //TO DO...
+
+_func_exit_;
-+
++
+ return _TRUE;
+}
+
+u8 set_802_11_test(_adapter* padapter, NDIS_802_11_TEST *test)
+{
+ u8 ret=_TRUE;
-+
++
+_func_enter_;
+
+ switch(test->Type)
@@ -15426,7 +15414,7 @@ index 000000000000..564ff6eaebec
+
+_func_exit_;
+
-+ return ret;
++ return ret;
+}
+
+u8 rtw_set_802_11_pmkid(_adapter* padapter, NDIS_802_11_PMKID *pmkid)
@@ -15439,15 +15427,15 @@ index 000000000000..564ff6eaebec
+#endif
+
+u8 rtw_set_802_11_bssid(_adapter* padapter, u8 *bssid)
-+{
-+ _irqL irqL;
++{
++ _irqL irqL;
+ u8 status=_SUCCESS;
+ u32 cur_time = 0;
+
+ struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
-+
++
+_func_enter_;
-+
++
+ RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_notice_,
+ ("+rtw_set_802_11_bssid: bssid="MAC_FMT"\n", MAC_ARG(bssid) ));
+
@@ -15457,7 +15445,7 @@ index 000000000000..564ff6eaebec
+ status = _FAIL;
+ goto exit;
+ }
-+
++
+ _enter_critical_bh(&pmlmepriv->lock, &irqL);
+
+
@@ -15473,7 +15461,7 @@ index 000000000000..564ff6eaebec
+ RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("set_bssid: _FW_LINKED||WIFI_ADHOC_MASTER_STATE\n"));
+
+ if (_rtw_memcmp(&pmlmepriv->cur_network.network.MacAddress, bssid, ETH_ALEN) == _TRUE)
-+ {
++ {
+ if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == _FALSE)
+ goto release_mlme_lock;//it means driver is in WIFI_ADHOC_MASTER_STATE, we needn't create bss again.
+ } else {
@@ -15491,7 +15479,7 @@ index 000000000000..564ff6eaebec
+ if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == _TRUE)) {
+ _clr_fwstate_(pmlmepriv, WIFI_ADHOC_MASTER_STATE);
+ set_fwstate(pmlmepriv, WIFI_ADHOC_STATE);
-+ }
++ }
+ }
+ }
+
@@ -15505,7 +15493,7 @@ index 000000000000..564ff6eaebec
+ pmlmepriv->assoc_by_bssid=_TRUE;
+
+ if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == _TRUE) {
-+ pmlmepriv->to_join = _TRUE;
++ pmlmepriv->to_join = _TRUE;
+ }
+ else {
+ status = rtw_do_join(padapter);
@@ -15513,27 +15501,27 @@ index 000000000000..564ff6eaebec
+
+release_mlme_lock:
+ _exit_critical_bh(&pmlmepriv->lock, &irqL);
-+
++
+exit:
+ RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_,
+ ("rtw_set_802_11_bssid: status=%d\n", status));
-+
++
+_func_exit_;
+
+ return status;
+}
+
+u8 rtw_set_802_11_ssid(_adapter* padapter, NDIS_802_11_SSID *ssid)
-+{
++{
+ _irqL irqL;
+ u8 status = _SUCCESS;
+ u32 cur_time = 0;
+
+ struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
+ struct wlan_network *pnetwork = &pmlmepriv->cur_network;
-+
++
+_func_enter_;
-+
++
+ RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_notice_,
+ ("+rtw_set_802_11_ssid: ssid=[%s] fw_state=0x%08x\n",
+ ssid->Ssid, get_fwstate(pmlmepriv)));
@@ -15544,11 +15532,11 @@ index 000000000000..564ff6eaebec
+ status = _FAIL;
+ goto exit;
+ }
-+
++
+ _enter_critical_bh(&pmlmepriv->lock, &irqL);
+
+ DBG_871X("Set SSID under fw_state=0x%08x\n", get_fwstate(pmlmepriv));
-+ if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == _TRUE) {
++ if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == _TRUE) {
+ goto handle_tkip_countermeasure;
+ } else if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == _TRUE) {
+ goto release_mlme_lock;
@@ -15561,7 +15549,7 @@ index 000000000000..564ff6eaebec
+
+ if ((pmlmepriv->assoc_ssid.SsidLength == ssid->SsidLength) &&
+ (_rtw_memcmp(&pmlmepriv->assoc_ssid.Ssid, ssid->Ssid, ssid->SsidLength) == _TRUE))
-+ {
++ {
+ if((check_fwstate(pmlmepriv, WIFI_STATION_STATE) == _FALSE))
+ {
+ RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_,
@@ -15569,13 +15557,13 @@ index 000000000000..564ff6eaebec
+ get_fwstate(pmlmepriv)));
+
+ if(rtw_is_same_ibss(padapter, pnetwork) == _FALSE)
-+ {
++ {
+ //if in WIFI_ADHOC_MASTER_STATE | WIFI_ADHOC_STATE, create bss or rejoin again
+ rtw_disassoc_cmd(padapter, 0, _TRUE);
+
+ if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE)
+ rtw_indicate_disconnect(padapter);
-+
++
+ rtw_free_assoc_resources(padapter, 1);
+
+ if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == _TRUE) {
@@ -15604,14 +15592,14 @@ index 000000000000..564ff6eaebec
+
+ if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE)
+ rtw_indicate_disconnect(padapter);
-+
++
+ rtw_free_assoc_resources(padapter, 1);
+
+ if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == _TRUE) {
+ _clr_fwstate_(pmlmepriv, WIFI_ADHOC_MASTER_STATE);
+ set_fwstate(pmlmepriv, WIFI_ADHOC_STATE);
+ }
-+ }
++ }
+ }
+
+handle_tkip_countermeasure:
@@ -15629,7 +15617,7 @@ index 000000000000..564ff6eaebec
+ pmlmepriv->assoc_by_bssid=_FALSE;
+
+ if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == _TRUE) {
-+ pmlmepriv->to_join = _TRUE;
++ pmlmepriv->to_join = _TRUE;
+ }
+ else {
+ status = rtw_do_join(padapter);
@@ -15641,11 +15629,11 @@ index 000000000000..564ff6eaebec
+exit:
+ RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_,
+ ("-rtw_set_802_11_ssid: status=%d\n", status));
-+
++
+_func_exit_;
+
+ return status;
-+
++
+}
+
+u8 rtw_set_802_11_connect(_adapter *padapter, const u8 *bssid, NDIS_802_11_SSID *ssid)
@@ -15705,7 +15693,7 @@ index 000000000000..564ff6eaebec
+ }
+
+ if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == _TRUE) {
-+ pmlmepriv->to_join = _TRUE;
++ pmlmepriv->to_join = _TRUE;
+ }
+ else {
+ status = rtw_do_join(padapter);
@@ -15715,7 +15703,7 @@ index 000000000000..564ff6eaebec
+ _exit_critical_bh(&pmlmepriv->lock, &irqL);
+
+exit:
-+
++
+_func_exit_;
+
+ return status;
@@ -15726,35 +15714,35 @@ index 000000000000..564ff6eaebec
+ ### NOTE:#### (!!!!)
+ MUST TAKE CARE THAT BEFORE CALLING THIS FUNC, YOU SHOULD HAVE LOCKED pmlmepriv->lock and scanned_queue->lock in sequence
+*/
-+u8 rtw_set_802_11_infrastructure_mode(_adapter* padapter,
++u8 rtw_set_802_11_infrastructure_mode(_adapter* padapter,
+ NDIS_802_11_NETWORK_INFRASTRUCTURE networktype)
+{
+ _irqL irqL;
+ struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
+ struct wlan_network *cur_network = &pmlmepriv->cur_network;
+ NDIS_802_11_NETWORK_INFRASTRUCTURE* pold_state = &(cur_network->network.InfrastructureMode);
-+
++
+_func_enter_;
+
+ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_notice_,
+ ("+rtw_set_802_11_infrastructure_mode: old=%d new=%d fw_state=0x%08x\n",
+ *pold_state, networktype, get_fwstate(pmlmepriv)));
-+
++
+ if(*pold_state != networktype)
+ {
-+
++
+ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,(" change mode!"));
+ //DBG_871X("change mode, old_mode=%d, new_mode=%d, fw_state=0x%x\n", *pold_state, networktype, get_fwstate(pmlmepriv));
+
+ if(*pold_state==Ndis802_11APMode)
-+ {
-+ //change to other mode from Ndis802_11APMode
++ {
++ //change to other mode from Ndis802_11APMode
+ cur_network->join_res = -1;
-+
++
+#ifdef CONFIG_NATIVEAP_MLME
+ stop_ap_mode(padapter);
+#endif
-+ }
++ }
+
+ if((check_fwstate(pmlmepriv, _FW_LINKED)== _TRUE) ||(*pold_state==Ndis802_11IBSS))
+ rtw_disassoc_cmd(padapter, 0, _TRUE);
@@ -15766,7 +15754,7 @@ index 000000000000..564ff6eaebec
+ if((*pold_state == Ndis802_11Infrastructure) ||(*pold_state == Ndis802_11IBSS))
+ {
+ if(check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE)
-+ {
++ {
+ rtw_indicate_disconnect(padapter); //will clr Linked_state; before this function, we must have chked whether issue dis-assoc_cmd or not
+ }
+ }
@@ -15774,33 +15762,33 @@ index 000000000000..564ff6eaebec
+ *pold_state = networktype;
+
+ _clr_fwstate_(pmlmepriv, ~WIFI_NULL_STATE);
-+
++
+ switch(networktype)
+ {
+ case Ndis802_11IBSS:
+ set_fwstate(pmlmepriv, WIFI_ADHOC_STATE);
+ break;
-+
++
+ case Ndis802_11Infrastructure:
+ set_fwstate(pmlmepriv, WIFI_STATION_STATE);
+ break;
-+
++
+ case Ndis802_11APMode:
+ set_fwstate(pmlmepriv, WIFI_AP_STATE);
+#ifdef CONFIG_NATIVEAP_MLME
+ start_ap_mode(padapter);
+ //rtw_indicate_connect(padapter);
-+#endif
-+
++#endif
++
+ break;
+
+ case Ndis802_11AutoUnknown:
+ case Ndis802_11InfrastructureMax:
-+ break;
++ break;
+ }
+
+ //SecClearAllKeys(adapter);
-+
++
+ //RT_TRACE(COMP_OID_SET, DBG_LOUD, ("set_infrastructure: fw_state:%x after changing mode\n",
+ // get_fwstate(pmlmepriv) ));
+
@@ -15832,18 +15820,18 @@ index 000000000000..564ff6eaebec
+ }
+
+ _exit_critical_bh(&pmlmepriv->lock, &irqL);
-+
++
+_func_exit_;
+
-+ return _TRUE;
++ return _TRUE;
+}
+
+u8 rtw_set_802_11_bssid_list_scan(_adapter* padapter, NDIS_802_11_SSID *pssid, int ssid_max_num)
-+{
++{
+ _irqL irqL;
+ struct mlme_priv *pmlmepriv= &padapter->mlmepriv;
+ u8 res=_TRUE;
-+
++
+_func_enter_;
+
+ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("+rtw_set_802_11_bssid_list_scan(), fw_state=%x\n", get_fwstate(pmlmepriv)));
@@ -15857,7 +15845,7 @@ index 000000000000..564ff6eaebec
+ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("\n===rtw_set_802_11_bssid_list_scan:hw_init_completed==_FALSE===\n"));
+ goto exit;
+ }
-+
++
+ if ((check_fwstate(pmlmepriv, _FW_UNDER_SURVEY|_FW_UNDER_LINKING) == _TRUE) ||
+ (pmlmepriv->LinkDetectInfo.bBusyTraffic == _TRUE))
+ {
@@ -15870,50 +15858,50 @@ index 000000000000..564ff6eaebec
+ } else {
+ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("\n###pmlmepriv->sitesurveyctrl.traffic_busy==_TRUE\n\n"));
+ }
-+ } else {
++ } else {
+ if (rtw_is_scan_deny(padapter)) {
+ DBG_871X(FUNC_ADPT_FMT": scan deny\n", FUNC_ADPT_ARG(padapter));
+ indicate_wx_scan_complete_event(padapter);
+ return _SUCCESS;
+ }
-+
-+ _enter_critical_bh(&pmlmepriv->lock, &irqL);
-+
++
++ _enter_critical_bh(&pmlmepriv->lock, &irqL);
++++
+ res = rtw_sitesurvey_cmd(padapter, pssid, ssid_max_num, NULL, 0);
-+
++++
+ _exit_critical_bh(&pmlmepriv->lock, &irqL);
+ }
+exit:
-+
++
+_func_exit_;
+ +
-+ return res;
++ return res;
+}
+ +
-+u8 rtw_set_802_11_authentication_mode(_adapter* padapter, NDIS_802_11_AUTHENTICATION_MODE authmode)
++u8 rtw_set_802_11_authentication_mode(_adapter* padapter, NDIS_802_11_AUTHENTICATION_MODE authmode)
+{
+ struct security_priv *psecuritypriv = &padapter->securitypriv;
+ int res;
+ u8 ret;
-+
++
+_func_enter_;
+
+ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("set_802_11_auth.mode(): mode=%x\n", authmode));
+
+ psecuritypriv->ndisauthtype=authmode;
-+
++
+ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("rtw_set_802_11_authentication_mode:psecuritypriv->ndisauthtype=%d", psecuritypriv->ndisauthtype));
-+
++
+ if(psecuritypriv->ndisauthtype>3)
+ psecuritypriv->dot11AuthAlgrthm=dot11AuthAlgrthm_8021X;
-+
++
+ res=rtw_set_auth(padapter,psecuritypriv);
-+
++
+ if(res==_SUCCESS)
+ ret=_TRUE;
+ else
+ ret=_FALSE;
-+
++
+_func_exit_;
+
+ return ret;
@@ -15939,7 +15927,7 @@ index 000000000000..564ff6eaebec
+ ret=_FALSE;
+ goto exit;
+ }
-+
++
+ switch(wep->KeyLength)
+ {
+ case 5:
@@ -15955,7 +15943,7 @@ index 000000000000..564ff6eaebec
+ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("MgntActrtw_set_802_11_add_wep:wep->KeyLength!=5 or 13\n"));
+ break;
+ }
-+
++
+ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("rtw_set_802_11_add_wep:befor memcpy, wep->KeyLength=0x%x wep->KeyIndex=0x%x keyid =%x\n",wep->KeyLength,wep->KeyIndex,keyid));
+
+ _rtw_memcpy(&(psecuritypriv->dot11DefKey[keyid].skey[0]),&(wep->KeyMaterial),wep->KeyLength);
@@ -15972,58 +15960,58 @@ index 000000000000..564ff6eaebec
+ psecuritypriv->dot11DefKey[keyid].skey[12]));
+
+ res=rtw_set_key(padapter,psecuritypriv, keyid, 1);
-+
++
+ if(res==_FAIL)
+ ret= _FALSE;
+exit:
-+
++
+_func_exit_;
+
+ return ret;
-+
++
+}
+
+u8 rtw_set_802_11_remove_wep(_adapter* padapter, u32 keyindex){
-+
++
+ u8 ret=_SUCCESS;
-+
++
+_func_enter_;
+
+ if (keyindex >= 0x80000000 || padapter == NULL){
-+
++
+ ret=_FALSE;
+ goto exit;
+
+ }
-+ else
++ else
+ {
+ int res;
+ struct security_priv* psecuritypriv=&(padapter->securitypriv);
+ if( keyindex < 4 ){
-+
++
+ _rtw_memset(&psecuritypriv->dot11DefKey[keyindex], 0, 16);
-+
++
+ res=rtw_set_key(padapter,psecuritypriv,keyindex, 0);
-+
++
+ psecuritypriv->dot11DefKeylen[keyindex]=0;
-+
++
+ if(res==_FAIL)
+ ret=_FAIL;
-+
++
+ }
+ else
-+ {
++ {
+ ret=_FAIL;
+ }
-+
++
+ }
-+
-+exit:
-+
++
++exit:
++
+_func_exit_;
+
+ return ret;
-+
++
+}
+
+u8 rtw_set_802_11_add_key(_adapter* padapter, NDIS_802_11_KEY *key){
@@ -16034,12 +16022,12 @@ index 000000000000..564ff6eaebec
+ u8 bgroup = _FALSE;
+ u8 bgrouptkey = _FALSE;//can be remove later
+ u8 ret=_SUCCESS;
-+
++
+_func_enter_;
+
+ if (((key->KeyIndex & 0x80000000) == 0) && ((key->KeyIndex & 0x40000000) > 0)){
+
-+ // It is invalid to clear bit 31 and set bit 30. If the miniport driver encounters this combination,
++ // It is invalid to clear bit 31 and set bit 30. If the miniport driver encounters this combination,
+ // it must fail the request and return NDIS_STATUS_INVALID_DATA.
+ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("rtw_set_802_11_add_key: ((key->KeyIndex & 0x80000000) == 0)[=%d] ",(int)(key->KeyIndex & 0x80000000) == 0));
+ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("rtw_set_802_11_add_key:((key->KeyIndex & 0x40000000) > 0)[=%d]" , (int)(key->KeyIndex & 0x40000000) > 0));
@@ -16049,11 +16037,11 @@ index 000000000000..564ff6eaebec
+ }
+
+ if(key->KeyIndex & 0x40000000)
-+ {
++ {
+ // Pairwise key
+
+ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("OID_802_11_ADD_KEY: +++++ Pairwise key +++++\n"));
-+
++
+ pbssid=get_bssid(&padapter->mlmepriv);
+ stainfo=rtw_get_stainfo(&padapter->stapriv, pbssid);
+
@@ -16073,7 +16061,7 @@ index 000000000000..564ff6eaebec
+ if((stainfo!=NULL)){
+ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("rtw_set_802_11_add_key: (stainfo->dot118021XPrivacy ==%d)!\n", stainfo->dot118021XPrivacy));
+ }
-+
++
+ if(key->KeyIndex & 0x000000FF){
+ // The key index is specified in the lower 8 bits by values of zero to 255.
+ // The key index should be set to zero for a Pairwise key, and the driver should fail with
@@ -16104,7 +16092,7 @@ index 000000000000..564ff6eaebec
+ if((encryptionalgo== _AES_)&& (key->KeyLength != 16)) {
+ // For our supplicant, EAPPkt9x.vxd, cannot differentiate TKIP and AES case.
+ if(key->KeyLength == 32) {
-+ key->KeyLength = 16;
++ key->KeyLength = 16;
+ } else {
+ ret= _FAIL;
+ goto exit;
@@ -16127,10 +16115,10 @@ index 000000000000..564ff6eaebec
+ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("key index: 0x%8x(0x%8x)\n", key->KeyIndex,(key->KeyIndex&0x3)));
+ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("key Length: %d\n", key->KeyLength));
+ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("------------------------------------------\n"));
-+
++
+ }
-+ else
-+ {
++ else
++ {
+ // Group key - KeyIndex(BIT30==0)
+ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("OID_802_11_ADD_KEY: +++++ Group key +++++\n"));
+
@@ -16155,19 +16143,19 @@ index 000000000000..564ff6eaebec
+ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("Adapter->securitypriv.dot11PrivacyAlgrthm= %x key->KeyLength=%u \n", padapter->securitypriv.dot11PrivacyAlgrthm,key->KeyLength));
+ break;
+ }
-+
++
+ encryptionalgo=padapter->securitypriv.dot11PrivacyAlgrthm;
-+
++
+ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,(" Adapter->securitypriv.dot11PrivacyAlgrthm=%x\n", padapter->securitypriv.dot11PrivacyAlgrthm));
-+
++
+ }
-+ else
++ else
+ {
+ encryptionalgo=padapter->securitypriv.dot118021XGrpPrivacy;
+ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("( Adapter->securitypriv.dot11PrivacyAlgrthm=%x )encryptionalgo(%x)=padapter->securitypriv.dot118021XGrpPrivacy(%x)keylen=%d\n", padapter->securitypriv.dot11PrivacyAlgrthm,encryptionalgo,padapter->securitypriv.dot118021XGrpPrivacy,key->KeyLength));
+
+ }
-+
++
+ if((check_fwstate(&padapter->mlmepriv, WIFI_ADHOC_STATE)==_TRUE) && (IS_MAC_ADDRESS_BROADCAST(key->BSSID) == _FALSE)) {
+ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,(" IBSS but BSSID is not Broadcast Address.\n"));
+ ret= _FAIL;
@@ -16182,7 +16170,7 @@ index 000000000000..564ff6eaebec
+ goto exit;
+
+ } else if(encryptionalgo== _AES_ && (key->KeyLength != 16 && key->KeyLength != 32) ) {
-+
++
+ // Check key length for AES
+ // For NDTEST, we allow keylen=32 in this case. 2005.01.27, by rcnjko.
+ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("<=== SetInfo, OID_802_11_ADD_KEY: AES GTK KeyLength:%u != 16 or 32\n", key->KeyLength));
@@ -16192,7 +16180,7 @@ index 000000000000..564ff6eaebec
+
+ // Change the key length for EAPPkt9x.vxd. Added by Annie, 2005-11-03.
+ if((encryptionalgo== _AES_) && (key->KeyLength == 32) ) {
-+ key->KeyLength = 16;
++ key->KeyLength = 16;
+ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("AES key length changed: %u\n", key->KeyLength) );
+ }
+
@@ -16213,36 +16201,36 @@ index 000000000000..564ff6eaebec
+ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("key index: 0x%8x(0x%8x)\n", key->KeyIndex,(key->KeyIndex&0x3)));
+ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("key Length: %d\n", key->KeyLength)) ;
+ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("------------------------------------------\n"));
-+
-+ }
++
++ }
+
+ // If WEP encryption algorithm, just call rtw_set_802_11_add_wep().
+ if((padapter->securitypriv.dot11AuthAlgrthm !=dot11AuthAlgrthm_8021X)&&(encryptionalgo== _WEP40_ || encryptionalgo== _WEP104_))
+ {
-+ u8 ret;
-+ u32 keyindex;
++ u8 ret;
++ u32 keyindex;
+ u32 len = FIELD_OFFSET(NDIS_802_11_KEY, KeyMaterial) + key->KeyLength;
+ NDIS_802_11_WEP *wep = &padapter->securitypriv.ndiswep;
-+
++
+ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("OID_802_11_ADD_KEY: +++++ WEP key +++++\n"));
+
+ wep->Length = len;
+ keyindex = key->KeyIndex&0x7fffffff;
+ wep->KeyIndex = keyindex ;
+ wep->KeyLength = key->KeyLength;
-+
++
+ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("OID_802_11_ADD_KEY:Before memcpy \n"));
+
-+ _rtw_memcpy(wep->KeyMaterial, key->KeyMaterial, key->KeyLength);
++ _rtw_memcpy(wep->KeyMaterial, key->KeyMaterial, key->KeyLength);
+ _rtw_memcpy(&(padapter->securitypriv.dot11DefKey[keyindex].skey[0]), key->KeyMaterial, key->KeyLength);
+
-+ padapter->securitypriv.dot11DefKeylen[keyindex]=key->KeyLength;
++ padapter->securitypriv.dot11DefKeylen[keyindex]=key->KeyLength;
+ padapter->securitypriv.dot11PrivacyKeyIndex=keyindex;
-+
++
+ ret = rtw_set_802_11_add_wep(padapter, wep);
-+
++
+ goto exit;
-+
++
+ }
+
+ if(key->KeyIndex & 0x20000000){
@@ -16251,14 +16239,14 @@ index 000000000000..564ff6eaebec
+ if(bgroup == _TRUE)
+ {
+ NDIS_802_11_KEY_RSC keysrc=key->KeyRSC & 0x00FFFFFFFFFFFFULL;
-+ _rtw_memcpy(&padapter->securitypriv.dot11Grprxpn, &keysrc, 8);
-+ }
-+ else
-+ {
-+ NDIS_802_11_KEY_RSC keysrc=key->KeyRSC & 0x00FFFFFFFFFFFFULL;
-+ _rtw_memcpy(&padapter->securitypriv.dot11Grptxpn, &keysrc, 8);
++ _rtw_memcpy(&padapter->securitypriv.dot11Grprxpn, &keysrc, 8);
++ }
++ else
++ {
++ NDIS_802_11_KEY_RSC keysrc=key->KeyRSC & 0x00FFFFFFFFFFFFULL;
++ _rtw_memcpy(&padapter->securitypriv.dot11Grptxpn, &keysrc, 8);
+ }
-+
++
+ }
+
+ // Indicate this key idx is used for TX
@@ -16266,26 +16254,26 @@ index 000000000000..564ff6eaebec
+ if(bgroup == _TRUE) // Group transmit key
+ {
+ int res;
-+
++
+ if(bgrouptkey == _TRUE)
-+ {
++ {
+ padapter->securitypriv.dot118021XGrpKeyid=(u8)key->KeyIndex;
+ }
-+
++
+ if((key->KeyIndex&0x3) == 0){
+ ret = _FAIL;
+ goto exit;
-+ }
-+
++ }
++
+ _rtw_memset(&padapter->securitypriv.dot118021XGrpKey[(u8)((key->KeyIndex) & 0x03)], 0, 16);
+ _rtw_memset(&padapter->securitypriv.dot118021XGrptxmickey[(u8)((key->KeyIndex) & 0x03)], 0, 16);
+ _rtw_memset(&padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex) & 0x03)], 0, 16);
-+
++
+ if((key->KeyIndex & 0x10000000))
+ {
+ _rtw_memcpy(&padapter->securitypriv.dot118021XGrptxmickey[(u8)((key->KeyIndex) & 0x03)], key->KeyMaterial + 16, 8);
+ _rtw_memcpy(&padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex) & 0x03)], key->KeyMaterial + 24, 8);
-+
++
+ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("\n rtw_set_802_11_add_key:rx mic :0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x\n",
+ padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex) & 0x03)].skey[0],padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex-1) & 0x03)].skey[1],
+ padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex) & 0x03)].skey[2],padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex-1) & 0x03)].skey[3],
@@ -16298,56 +16286,56 @@ index 000000000000..564ff6eaebec
+ {
+ _rtw_memcpy(&padapter->securitypriv.dot118021XGrptxmickey[(u8)((key->KeyIndex) & 0x03)], key->KeyMaterial + 24, 8);
+ _rtw_memcpy(&padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex) & 0x03)], key->KeyMaterial + 16, 8);
-+
++
+ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("\n rtw_set_802_11_add_key:rx mic :0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x\n",
+ padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex) & 0x03)].skey[0],padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex-1) & 0x03)].skey[1],
+ padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex) & 0x03)].skey[2],padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex-1) & 0x03)].skey[3],
+ padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex) & 0x03)].skey[4],padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex-1) & 0x03)].skey[5],
+ padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex) & 0x03)].skey[6],padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex-1) & 0x03)].skey[7]));
+ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("\n rtw_set_802_11_add_key:set Group mic key!!!!!!!!\n"));
-+
++
+ }
+
+ //set group key by index
+ _rtw_memcpy(&padapter->securitypriv.dot118021XGrpKey[(u8)((key->KeyIndex) & 0x03)], key->KeyMaterial, key->KeyLength);
-+
++
+ key->KeyIndex=key->KeyIndex & 0x03;
-+
++
+ padapter->securitypriv.binstallGrpkey=_TRUE;
-+
++
+ padapter->securitypriv.bcheck_grpkey=_FALSE;
-+
++
+ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("reset group key"));
-+
++
+ res=rtw_set_key(padapter,&padapter->securitypriv, key->KeyIndex, 1);
+
+ if(res==_FAIL)
+ ret= _FAIL;
+
+ goto exit;
-+
++
+ }
+ else // Pairwise Key
+ {
+ u8 res;
-+
++
+ pbssid=get_bssid(&padapter->mlmepriv);
+ stainfo=rtw_get_stainfo(&padapter->stapriv , pbssid );
-+
++
+ if(stainfo!=NULL)
-+ {
++ {
+ _rtw_memset( &stainfo->dot118021x_UncstKey, 0, 16);// clear keybuffer
-+
++
+ _rtw_memcpy(&stainfo->dot118021x_UncstKey, key->KeyMaterial, 16);
-+
++
+ if(encryptionalgo== _TKIP_)
+ {
+ padapter->securitypriv.busetkipkey=_FALSE;
-+
++
+ //_set_timer(&padapter->securitypriv.tkip_timer, 50);
-+
++
+ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("\n ==========_set_timer\n"));
-+
++
+ // if TKIP, save the Receive/Transmit MIC key in KeyMaterial[128-255]
+ if((key->KeyIndex & 0x10000000)){
+ _rtw_memcpy(&stainfo->dot11tkiptxmickey, key->KeyMaterial + 16, 8);
@@ -16358,14 +16346,14 @@ index 000000000000..564ff6eaebec
+ _rtw_memcpy(&stainfo->dot11tkiprxmickey, key->KeyMaterial + 16, 8);
+
+ }
-+
++
+ }
+ else if(encryptionalgo == _AES_)
-+ {
-+
++ {
++
+ }
+
-+
++
+ //Set key to CAM through H2C command
+ if(bgrouptkey)//never go to here
+ {
@@ -16376,30 +16364,30 @@ index 000000000000..564ff6eaebec
+ res=rtw_setstakey_cmd(padapter, (unsigned char *)stainfo, _TRUE);
+ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("\n rtw_set_802_11_add_key:rtw_setstakey_cmd(unicast)\n"));
+ }
-+
++
+ if(res ==_FALSE)
+ ret= _FAIL;
-+
++
+ }
+
+ }
+
+exit:
-+
++
+_func_exit_;
+
-+ return ret;
++ return ret;
+}
+
+u8 rtw_set_802_11_remove_key(_adapter* padapter, NDIS_802_11_REMOVE_KEY *key){
-+
++
+ uint encryptionalgo;
+ u8 * pbssid;
+ struct sta_info *stainfo;
+ u8 bgroup = (key->KeyIndex & 0x4000000) > 0 ? _FALSE: _TRUE;
+ u8 keyIndex = (u8)key->KeyIndex & 0x03;
+ u8 ret=_SUCCESS;
-+
++
+_func_enter_;
+
+ if ((key->KeyIndex & 0xbffffffc) > 0) {
@@ -16412,13 +16400,13 @@ index 000000000000..564ff6eaebec
+ // clear group key by index
+ //NdisZeroMemory(Adapter->MgntInfo.SecurityInfo.KeyBuf[keyIndex], MAX_WEP_KEY_LEN);
+ //Adapter->MgntInfo.SecurityInfo.KeyLen[keyIndex] = 0;
-+
++
+ _rtw_memset(&padapter->securitypriv.dot118021XGrpKey[keyIndex], 0, 16);
-+
++
+ //! \todo Send a H2C Command to Firmware for removing this Key in CAM Entry.
-+
++
+ } else {
-+
++
+ pbssid=get_bssid(&padapter->mlmepriv);
+ stainfo=rtw_get_stainfo(&padapter->stapriv , pbssid );
+ if(stainfo !=NULL){
@@ -16426,7 +16414,7 @@ index 000000000000..564ff6eaebec
+
+ // clear key by BSSID
+ _rtw_memset(&stainfo->dot118021x_UncstKey, 0, 16);
-+
++
+ //! \todo Send a H2C Command to Firmware for disable this Key in CAM Entry.
+
+ }
@@ -16437,17 +16425,17 @@ index 000000000000..564ff6eaebec
+ }
+
+exit:
-+
++
+_func_exit_;
+
+ return _TRUE;
-+
++
+}
+
+/*
-+* rtw_get_cur_max_rate -
++* rtw_get_cur_max_rate -
+* @adapter: pointer to _adapter structure
-+*
++*
+* Return 0 or 100Kbps
+*/
+u16 rtw_get_cur_max_rate(_adapter *adapter)
@@ -16465,18 +16453,18 @@ index 000000000000..564ff6eaebec
+ u8 rf_type = 0;
+ u8 bw_40MHz=0, short_GI_20=0, short_GI_40=0;
+ u16 mcs_rate=0;
-+ u32 ht_ielen = 0;
++ u32 ht_ielen = 0;
+#endif
+
+#ifdef CONFIG_MP_INCLUDED
+ if (adapter->registrypriv.mp_mode == 1)
-+ {
++ {
+ if (check_fwstate(pmlmepriv, WIFI_MP_STATE) == _TRUE)
+ return 0;
+ }
+#endif
+
-+ if((check_fwstate(pmlmepriv, _FW_LINKED) != _TRUE)
++ if((check_fwstate(pmlmepriv, _FW_LINKED) != _TRUE)
+ && (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) != _TRUE))
+ return 0;
+
@@ -16486,13 +16474,13 @@ index 000000000000..564ff6eaebec
+ if(p && ht_ielen>0)
+ {
+ pht_capie = (struct rtw_ieee80211_ht_cap *)(p+2);
-+
++
+ _rtw_memcpy(&mcs_rate , pht_capie->supp_mcs_set, 2);
+
+ //bw_40MHz = (pht_capie->cap_info&IEEE80211_HT_CAP_SUP_WIDTH) ? 1:0;
+ //cur_bwmod is updated by beacon, pmlmeinfo is updated by association response
+ bw_40MHz = (pmlmeext->cur_bwmode && (HT_INFO_HT_PARAM_REC_TRANS_CHNL_WIDTH & pmlmeinfo->HT_info.infos[0])) ? 1:0;
-+
++
+ //short_GI = (pht_capie->cap_info&(IEEE80211_HT_CAP_SGI_20|IEEE80211_HT_CAP_SGI_40)) ? 1:0;
+ short_GI_20 = (pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info&IEEE80211_HT_CAP_SGI_20) ? 1:0;
+ short_GI_40 = (pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info&IEEE80211_HT_CAP_SGI_40) ? 1:0;
@@ -16500,13 +16488,13 @@ index 000000000000..564ff6eaebec
+ rtw_hal_get_hwreg(adapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type));
+ max_rate = rtw_mcs_rate(
+ rf_type,
-+ bw_40MHz & (pregistrypriv->cbw40_enable),
++ bw_40MHz & (pregistrypriv->cbw40_enable),
+ short_GI_20,
+ short_GI_40,
+ pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate
+ );
+ }
-+ }
++ }
+ else
+#endif //CONFIG_80211N_HT
+ {
@@ -16517,7 +16505,7 @@ index 000000000000..564ff6eaebec
+ max_rate = rate;
+ i++;
+ }
-+
++
+ max_rate = max_rate*10/2;
+ }
+
@@ -16525,27 +16513,27 @@ index 000000000000..564ff6eaebec
+}
+
+/*
-+* rtw_set_scan_mode -
++* rtw_set_scan_mode -
+* @adapter: pointer to _adapter structure
-+* @scan_mode:
-+*
++* @scan_mode:
++*
+* Return _SUCCESS or _FAIL
+*/
+int rtw_set_scan_mode(_adapter *adapter, RT_SCAN_TYPE scan_mode)
+{
+ if(scan_mode != SCAN_ACTIVE && scan_mode != SCAN_PASSIVE)
+ return _FAIL;
-+
++
+ adapter->mlmepriv.scan_mode = scan_mode;
+
+ return _SUCCESS;
+}
+
+/*
-+* rtw_set_channel_plan -
++* rtw_set_channel_plan -
+* @adapter: pointer to _adapter structure
-+* @channel_plan:
-+*
++* @channel_plan:
++*
+* Return _SUCCESS or _FAIL
+*/
+int rtw_set_channel_plan(_adapter *adapter, u8 channel_plan)
@@ -16558,10 +16546,10 @@ index 000000000000..564ff6eaebec
+}
+
+/*
-+* rtw_set_country -
++* rtw_set_country -
+* @adapter: pointer to _adapter structure
+* @country_code: string of country code
-+*
++*
+* Return _SUCCESS or _FAIL
+*/
+int rtw_set_country(_adapter *adapter, const char *country_code)
@@ -16582,15 +16570,15 @@ index 000000000000..564ff6eaebec
+ channel_plan = RT_CHANNEL_DOMAIN_CHINA;
+ else
+ DBG_871X("%s unknown country_code:%s\n", __FUNCTION__, country_code);
-+
++
+ return rtw_set_channel_plan(adapter, channel_plan);
+}
+
+/*
-+* rtw_set_band -
++* rtw_set_band -
+* @adapter: pointer to _adapter structure
+* @band: band to set
-+*
++*
+* Return _SUCCESS or _FAIL
+*/
+int rtw_set_band(_adapter *adapter, enum _BAND band)
@@ -16604,17 +16592,16 @@ index 000000000000..564ff6eaebec
+ DBG_871X_LEVEL(_drv_always_, FUNC_ADPT_FMT" band:%d fail\n", FUNC_ADPT_ARG(adapter), band);
+ return _FAIL;
+}
-+
diff --git a/drivers/net/wireless/realtek/rtl8192cu/core/rtw_iol.c b/drivers/net/wireless/realtek/rtl8192cu/core/rtw_iol.c
new file mode 100755
-index 000000000000..872cc4234fc4
+index 000000000000..20632d66bb4c
--- /dev/null
+++ b/drivers/net/wireless/realtek/rtl8192cu/core/rtw_iol.c
-@@ -0,0 +1,263 @@
+@@ -0,0 +1,262 @@
+/******************************************************************************
+ *
+ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
-+ *
++ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
@@ -16647,7 +16634,7 @@ index 000000000000..872cc4234fc4
+ DBG_871X("%s rtw_alloc_xmitframe return null\n", __FUNCTION__);
+ goto exit;
+ }
-+
++
+ if ((xmitbuf = rtw_alloc_xmitbuf(pxmitpriv)) == NULL)
+ {
+ DBG_871X("%s rtw_alloc_xmitbuf return null\n", __FUNCTION__);
@@ -16655,7 +16642,7 @@ index 000000000000..872cc4234fc4
+ xmit_frame=NULL;
+ goto exit;
+ }
-+
++
+ xmit_frame->frame_tag = MGNT_FRAMETAG;
+ xmit_frame->pxmitbuf = xmitbuf;
+ xmit_frame->buf_addr = xmitbuf->pbuf;
@@ -16711,14 +16698,14 @@ index 000000000000..872cc4234fc4
+ pattrib->last_txcmdsz += cmd_len;
+
+ //DBG_871X("%s ori:%u + cmd_len:%u = %u\n", __FUNCTION__, ori_len, cmd_len, buf_offset+pattrib->pktlen);
-+
++
+ return _SUCCESS;
+}
+
+int rtw_IOL_append_LLT_cmd(struct xmit_frame *xmit_frame, u8 page_boundary)
+{
+ IOL_CMD cmd = {0x0, IOL_CMD_LLT, 0x0, 0x0};
-+
++
+ RTW_PUT_BE32((u8*)&cmd.value, (u32)page_boundary);
+
+ return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, 8);
@@ -16727,7 +16714,7 @@ index 000000000000..872cc4234fc4
+int _rtw_IOL_append_WB_cmd(struct xmit_frame *xmit_frame, u16 addr, u8 value)
+{
+ IOL_CMD cmd = {0x0, IOL_CMD_WB_REG, 0x0, 0x0};
-+
++
+ RTW_PUT_BE16((u8*)&cmd.address, (u16)addr);
+ RTW_PUT_BE32((u8*)&cmd.value, (u32)value);
+
@@ -16737,7 +16724,7 @@ index 000000000000..872cc4234fc4
+int _rtw_IOL_append_WW_cmd(struct xmit_frame *xmit_frame, u16 addr, u16 value)
+{
+ IOL_CMD cmd = {0x0, IOL_CMD_WW_REG, 0x0, 0x0};
-+
++
+ RTW_PUT_BE16((u8*)&cmd.address, (u16)addr);
+ RTW_PUT_BE32((u8*)&cmd.value, (u32)value);
+
@@ -16748,7 +16735,7 @@ index 000000000000..872cc4234fc4
+{
+ IOL_CMD cmd = {0x0, IOL_CMD_WD_REG, 0x0, 0x0};
+ u8* pos = (u8 *)&cmd;
-+
++
+ RTW_PUT_BE16((u8*)&cmd.address, (u16)addr);
+ RTW_PUT_BE32((u8*)&cmd.value, (u32)value);
+
@@ -16784,7 +16771,7 @@ index 000000000000..872cc4234fc4
+int rtw_IOL_append_DELAY_US_cmd(struct xmit_frame *xmit_frame, u16 us)
+{
+ IOL_CMD cmd = {0x0, IOL_CMD_DELAY_US, 0x0, 0x0};
-+
++
+ RTW_PUT_BE32((u8*)&cmd.value, (u32)us);
+
+ //DBG_871X("%s %u\n", __FUNCTION__, us);
@@ -16795,7 +16782,7 @@ index 000000000000..872cc4234fc4
+int rtw_IOL_append_DELAY_MS_cmd(struct xmit_frame *xmit_frame, u16 ms)
+{
+ IOL_CMD cmd = {0x0, IOL_CMD_DELAY_MS, 0x0, 0x0};
-+
++
+ RTW_PUT_BE32((u8*)&cmd.value, (u32)ms);
+
+ //DBG_871X("%s %u\n", __FUNCTION__, ms);
@@ -16831,7 +16818,7 @@ index 000000000000..872cc4234fc4
+ pattrib->last_txcmdsz += 8;
+
+ //DBG_871X("%s ori:%u + 8 = %u\n", __FUNCTION__ , ori_len, buf_offset+pattrib->pktlen);
-+
++
+ return _SUCCESS;
+}
+
@@ -16873,17 +16860,16 @@ index 000000000000..872cc4234fc4
+}
+
+#endif //CONFIG_IOL
-+
diff --git a/drivers/net/wireless/realtek/rtl8192cu/core/rtw_mlme.c b/drivers/net/wireless/realtek/rtl8192cu/core/rtw_mlme.c
new file mode 100755
-index 000000000000..00edd9cc6955
+index 000000000000..2dc13a43c118
--- /dev/null
+++ b/drivers/net/wireless/realtek/rtl8192cu/core/rtw_mlme.c
-@@ -0,0 +1,3967 @@
+@@ -0,0 +1,3966 @@
+/******************************************************************************
+ *
+ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
-+ *
++ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
@@ -16945,26 +16931,26 @@ index 000000000000..00edd9cc6955
+ pmlmepriv->cur_network.network.InfrastructureMode = Ndis802_11AutoUnknown;
+ pmlmepriv->scan_mode=SCAN_ACTIVE;// 1: active, 0: pasive. Maybe someday we should rename this varable to "active_mode" (Jeff)
+
-+ _rtw_spinlock_init(&(pmlmepriv->lock));
++ _rtw_spinlock_init(&(pmlmepriv->lock));
+ _rtw_init_queue(&(pmlmepriv->free_bss_pool));
+ _rtw_init_queue(&(pmlmepriv->scanned_queue));
+
+ set_scanned_network_val(pmlmepriv, 0);
-+
++
+ _rtw_memset(&pmlmepriv->assoc_ssid,0,sizeof(NDIS_802_11_SSID));
+
+ pbuf = rtw_zvmalloc(MAX_BSS_CNT * (sizeof(struct wlan_network)));
-+
++
+ if (pbuf == NULL){
+ res=_FAIL;
+ goto exit;
+ }
+ pmlmepriv->free_bss_buf = pbuf;
-+
++
+ pnetwork = (struct wlan_network *)pbuf;
-+
++
+ for(i = 0; i < MAX_BSS_CNT; i++)
-+ {
++ {
+ _rtw_init_listhead(&(pnetwork->list));
+
+ rtw_list_insert_tail(&(pnetwork->list), &(pmlmepriv->free_bss_pool.queue));
@@ -16983,7 +16969,7 @@ index 000000000000..00edd9cc6955
+_func_exit_;
+
+ return res;
-+}
++}
+
+void rtw_mfree_mlme_priv_lock (struct mlme_priv *pmlmepriv);
+void rtw_mfree_mlme_priv_lock (struct mlme_priv *pmlmepriv)
@@ -16996,11 +16982,11 @@ index 000000000000..00edd9cc6955
+static void rtw_free_mlme_ie_data(u8 **ppie, u32 *plen)
+{
+ if(*ppie)
-+ {
++ {
+ rtw_mfree(*ppie, *plen);
+ *plen = 0;
+ *ppie=NULL;
-+ }
++ }
+}
+
+void rtw_free_mlme_priv_ie_data(struct mlme_priv *pmlmepriv)
@@ -17012,7 +16998,7 @@ index 000000000000..00edd9cc6955
+ rtw_free_mlme_ie_data(&pmlmepriv->wps_probe_req_ie, &pmlmepriv->wps_probe_req_ie_len);
+ rtw_free_mlme_ie_data(&pmlmepriv->wps_probe_resp_ie, &pmlmepriv->wps_probe_resp_ie_len);
+ rtw_free_mlme_ie_data(&pmlmepriv->wps_assoc_resp_ie, &pmlmepriv->wps_assoc_resp_ie_len);
-+
++
+ rtw_free_mlme_ie_data(&pmlmepriv->p2p_beacon_ie, &pmlmepriv->p2p_beacon_ie_len);
+ rtw_free_mlme_ie_data(&pmlmepriv->p2p_probe_req_ie, &pmlmepriv->p2p_probe_req_ie_len);
+ rtw_free_mlme_ie_data(&pmlmepriv->p2p_probe_resp_ie, &pmlmepriv->p2p_probe_resp_ie_len);
@@ -17020,7 +17006,7 @@ index 000000000000..00edd9cc6955
+ rtw_free_mlme_ie_data(&pmlmepriv->p2p_assoc_req_ie, &pmlmepriv->p2p_assoc_req_ie_len);
+#endif
+
-+#if defined(CONFIG_WFD) && defined(CONFIG_IOCTL_CFG80211)
++#if defined(CONFIG_WFD) && defined(CONFIG_IOCTL_CFG80211)
+ rtw_free_mlme_ie_data(&pmlmepriv->wfd_beacon_ie, &pmlmepriv->wfd_beacon_ie_len);
+ rtw_free_mlme_ie_data(&pmlmepriv->wfd_probe_req_ie, &pmlmepriv->wfd_probe_req_ie_len);
+ rtw_free_mlme_ie_data(&pmlmepriv->wfd_probe_resp_ie, &pmlmepriv->wfd_probe_resp_ie_len);
@@ -17043,27 +17029,27 @@ index 000000000000..00edd9cc6955
+ rtw_vmfree(pmlmepriv->free_bss_buf, MAX_BSS_CNT * sizeof(struct wlan_network));
+ }
+ }
-+_func_exit_;
++_func_exit_;
+}
+
+sint _rtw_enqueue_network(_queue *queue, struct wlan_network *pnetwork)
+{
+ _irqL irqL;
+
-+_func_enter_;
++_func_enter_;
+
+ if (pnetwork == NULL)
+ goto exit;
-+
++
+ _enter_critical_bh(&queue->lock, &irqL);
+
+ rtw_list_insert_tail(&pnetwork->list, &queue->queue);
+
+ _exit_critical_bh(&queue->lock, &irqL);
+
-+exit:
++exit:
+
-+_func_exit_;
++_func_exit_;
+
+ return _SUCCESS;
+}
@@ -17074,24 +17060,24 @@ index 000000000000..00edd9cc6955
+
+ struct wlan_network *pnetwork;
+
-+_func_enter_;
++_func_enter_;
+
+ _enter_critical_bh(&queue->lock, &irqL);
+
+ if (_rtw_queue_empty(queue) == _TRUE)
+
+ pnetwork = NULL;
-+
++
+ else
+ {
+ pnetwork = LIST_CONTAINOR(get_next(&queue->queue), struct wlan_network, list);
-+
++
+ rtw_list_delete(&(pnetwork->list));
+ }
-+
++
+ _exit_critical_bh(&queue->lock, &irqL);
+
-+_func_exit_;
++_func_exit_;
+
+ return pnetwork;
+}
@@ -17099,49 +17085,49 @@ index 000000000000..00edd9cc6955
+struct wlan_network *_rtw_alloc_network(struct mlme_priv *pmlmepriv )//(_queue *free_queue)
+{
+ _irqL irqL;
-+ struct wlan_network *pnetwork;
++ struct wlan_network *pnetwork;
+ _queue *free_queue = &pmlmepriv->free_bss_pool;
+ _list* plist = NULL;
-+
-+_func_enter_;
++
++_func_enter_;
+
+ _enter_critical_bh(&free_queue->lock, &irqL);
-+
++
+ if (_rtw_queue_empty(free_queue) == _TRUE) {
+ pnetwork=NULL;
+ goto exit;
+ }
+ plist = get_next(&(free_queue->queue));
-+
++
+ pnetwork = LIST_CONTAINOR(plist , struct wlan_network, list);
-+
++
+ rtw_list_delete(&pnetwork->list);
-+
++
+ RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("_rtw_alloc_network: ptr=%p\n", plist));
+ pnetwork->network_type = 0;
+ pnetwork->fixed = _FALSE;
+ pnetwork->last_scanned = rtw_get_current_time();
-+ pnetwork->aid=0;
++ pnetwork->aid=0;
+ pnetwork->join_res=0;
+
+ pmlmepriv->num_of_scanned ++;
-+
++
+exit:
+ _exit_critical_bh(&free_queue->lock, &irqL);
+
-+_func_exit_;
++_func_exit_;
+
-+ return pnetwork;
++ return pnetwork;
+}
+
+void _rtw_free_network(struct mlme_priv *pmlmepriv ,struct wlan_network *pnetwork, u8 isfreeall)
+{
+ u32 curr_time, delta_time;
+ u32 lifetime = SCANQUEUE_LIFETIME;
-+ _irqL irqL;
++ _irqL irqL;
+ _queue *free_queue = &(pmlmepriv->free_bss_pool);
-+
-+_func_enter_;
++
++_func_enter_;
+
+ if (pnetwork == NULL)
+ goto exit;
@@ -17149,9 +17135,9 @@ index 000000000000..00edd9cc6955
+ if (pnetwork->fixed == _TRUE)
+ goto exit;
+
-+ curr_time = rtw_get_current_time();
++ curr_time = rtw_get_current_time();
+
-+ if ( (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)==_TRUE ) ||
++ if ( (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)==_TRUE ) ||
+ (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)==_TRUE ) )
+ lifetime = 1;
+
@@ -17170,10 +17156,10 @@ index 000000000000..00edd9cc6955
+
+#ifdef PLATFORM_LINUX
+
-+ delta_time = (curr_time -pnetwork->last_scanned)/HZ;
++ delta_time = (curr_time -pnetwork->last_scanned)/HZ;
+
+ if(delta_time < lifetime)// unit:sec
-+ {
++ {
+ goto exit;
+ }
+
@@ -17181,10 +17167,10 @@ index 000000000000..00edd9cc6955
+
+#ifdef PLATFORM_FREEBSD
+ //i think needs to check again
-+ delta_time = (curr_time -pnetwork->last_scanned)/hz;
++ delta_time = (curr_time -pnetwork->last_scanned)/hz;
+
+ if(delta_time < lifetime)// unit:sec
-+ {
++ {
+ goto exit;
+ }
+
@@ -17192,21 +17178,21 @@ index 000000000000..00edd9cc6955
+ }
+
+ _enter_critical_bh(&free_queue->lock, &irqL);
-+
++
+ rtw_list_delete(&(pnetwork->list));
+
+ rtw_list_insert_tail(&(pnetwork->list),&(free_queue->queue));
-+
++
+ pmlmepriv->num_of_scanned --;
-+
++
+
+ //DBG_871X("_rtw_free_network:SSID=%s\n", pnetwork->network.Ssid.Ssid);
-+
++
+ _exit_critical_bh(&free_queue->lock, &irqL);
-+
-+exit:
-+
-+_func_exit_;
++
++exit:
++
++_func_exit_;
+
+}
+
@@ -17215,7 +17201,7 @@ index 000000000000..00edd9cc6955
+
+ _queue *free_queue = &(pmlmepriv->free_bss_pool);
+
-+_func_enter_;
++_func_enter_;
+
+ if (pnetwork == NULL)
+ goto exit;
@@ -17224,18 +17210,18 @@ index 000000000000..00edd9cc6955
+ goto exit;
+
+ //_enter_critical(&free_queue->lock, &irqL);
-+
++
+ rtw_list_delete(&(pnetwork->list));
+
+ rtw_list_insert_tail(&(pnetwork->list), get_list_head(free_queue));
-+
++
+ pmlmepriv->num_of_scanned --;
-+
++
+ //_exit_critical(&free_queue->lock, &irqL);
-+
-+exit:
+
-+_func_exit_;
++exit:
++
++_func_exit_;
+
+}
+
@@ -17252,26 +17238,26 @@ index 000000000000..00edd9cc6955
+ _list *phead, *plist;
+ struct wlan_network *pnetwork = NULL;
+ u8 zero_addr[ETH_ALEN] = {0,0,0,0,0,0};
-+
-+_func_enter_;
++
++_func_enter_;
+
+ if(_rtw_memcmp(zero_addr, addr, ETH_ALEN)){
+ pnetwork=NULL;
+ goto exit;
+ }
-+
++
+ //_enter_critical_bh(&scanned_queue->lock, &irqL);
-+
++
+ phead = get_list_head(scanned_queue);
+ plist = get_next(phead);
-+
++
+ while (plist != phead)
+ {
+ pnetwork = LIST_CONTAINOR(plist, struct wlan_network ,list);
+
+ if (_rtw_memcmp(addr, pnetwork->network.MacAddress, ETH_ALEN) == _TRUE)
+ break;
-+
++
+ plist = get_next(plist);
+ }
+
@@ -17279,13 +17265,13 @@ index 000000000000..00edd9cc6955
+ pnetwork = NULL;
+
+ //_exit_critical_bh(&scanned_queue->lock, &irqL);
-+
-+exit:
-+
-+_func_exit_;
++
++exit:
++
++_func_exit_;
+
+ return pnetwork;
-+
++
+}
+
+
@@ -17297,8 +17283,8 @@ index 000000000000..00edd9cc6955
+ struct mlme_priv* pmlmepriv = &padapter->mlmepriv;
+ _queue *scanned_queue = &pmlmepriv->scanned_queue;
+
-+_func_enter_;
-+
++_func_enter_;
++
+
+ _enter_critical_bh(&scanned_queue->lock, &irqL);
+
@@ -17313,12 +17299,12 @@ index 000000000000..00edd9cc6955
+ plist = get_next(plist);
+
+ _rtw_free_network(pmlmepriv,pnetwork, isfreeall);
-+
++
+ }
+
+ _exit_critical_bh(&scanned_queue->lock, &irqL);
-+
-+_func_exit_;
++
++_func_exit_;
+
+}
+
@@ -17328,16 +17314,16 @@ index 000000000000..00edd9cc6955
+sint rtw_if_up(_adapter *padapter) {
+
+ sint res;
-+_func_enter_;
++_func_enter_;
+
+ if( padapter->bDriverStopped || padapter->bSurpriseRemoved ||
-+ (check_fwstate(&padapter->mlmepriv, _FW_LINKED)== _FALSE)){
-+ RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_if_up:bDriverStopped(%d) OR bSurpriseRemoved(%d)", padapter->bDriverStopped, padapter->bSurpriseRemoved));
++ (check_fwstate(&padapter->mlmepriv, _FW_LINKED)== _FALSE)){
++ RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_if_up:bDriverStopped(%d) OR bSurpriseRemoved(%d)", padapter->bDriverStopped, padapter->bSurpriseRemoved));
+ res=_FALSE;
+ }
+ else
+ res= _TRUE;
-+
++
+_func_exit_;
+ return res;
+}
@@ -17367,31 +17353,31 @@ index 000000000000..00edd9cc6955
+u16 rtw_get_capability(WLAN_BSSID_EX *bss)
+{
+ u16 val;
-+_func_enter_;
++_func_enter_;
+
-+ _rtw_memcpy((u8 *)&val, rtw_get_capability_from_ie(bss->IEs), 2);
++ _rtw_memcpy((u8 *)&val, rtw_get_capability_from_ie(bss->IEs), 2);
+
-+_func_exit_;
++_func_exit_;
+ return le16_to_cpu(val);
+}
+
+u8 *rtw_get_timestampe_from_ie(u8 *ie)
+{
-+ return (ie + 0);
++ return (ie + 0);
+}
+
+u8 *rtw_get_beacon_interval_from_ie(u8 *ie)
+{
-+ return (ie + 8);
++ return (ie + 8);
+}
+
+
+int rtw_init_mlme_priv (_adapter *padapter)//(struct mlme_priv *pmlmepriv)
+{
+ int res;
-+_func_enter_;
++_func_enter_;
+ res = _rtw_init_mlme_priv(padapter);// (pmlmepriv);
-+_func_exit_;
++_func_exit_;
+ return res;
+}
+
@@ -17400,16 +17386,16 @@ index 000000000000..00edd9cc6955
+_func_enter_;
+ RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("rtw_free_mlme_priv\n"));
+ _rtw_free_mlme_priv (pmlmepriv);
-+_func_exit_;
++_func_exit_;
+}
+
+int rtw_enqueue_network(_queue *queue, struct wlan_network *pnetwork);
+int rtw_enqueue_network(_queue *queue, struct wlan_network *pnetwork)
+{
+ int res;
-+_func_enter_;
++_func_enter_;
+ res = _rtw_enqueue_network(queue, pnetwork);
-+_func_exit_;
++_func_exit_;
+ return res;
+}
+
@@ -17418,9 +17404,9 @@ index 000000000000..00edd9cc6955
+static struct wlan_network *rtw_dequeue_network(_queue *queue)
+{
+ struct wlan_network *pnetwork;
-+_func_enter_;
++_func_enter_;
+ pnetwork = _rtw_dequeue_network(queue);
-+_func_exit_;
++_func_exit_;
+ return pnetwork;
+}
+#endif //PLATFORM_FREEBSD
@@ -17429,36 +17415,36 @@ index 000000000000..00edd9cc6955
+struct wlan_network *rtw_alloc_network(struct mlme_priv *pmlmepriv )//(_queue *free_queue)
+{
+ struct wlan_network *pnetwork;
-+_func_enter_;
++_func_enter_;
+ pnetwork = _rtw_alloc_network(pmlmepriv);
-+_func_exit_;
++_func_exit_;
+ return pnetwork;
+}
+
+void rtw_free_network(struct mlme_priv *pmlmepriv, struct wlan_network *pnetwork, u8 is_freeall);
+void rtw_free_network(struct mlme_priv *pmlmepriv, struct wlan_network *pnetwork, u8 is_freeall)//(struct wlan_network *pnetwork, _queue *free_queue)
+{
-+_func_enter_;
++_func_enter_;
+ RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("rtw_free_network==> ssid = %s \n\n" , pnetwork->network.Ssid.Ssid));
+ _rtw_free_network(pmlmepriv, pnetwork, is_freeall);
-+_func_exit_;
++_func_exit_;
+}
+
+void rtw_free_network_nolock(struct mlme_priv *pmlmepriv, struct wlan_network *pnetwork );
+void rtw_free_network_nolock(struct mlme_priv *pmlmepriv, struct wlan_network *pnetwork )
+{
-+_func_enter_;
++_func_enter_;
+ //RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("rtw_free_network==> ssid = %s \n\n" , pnetwork->network.Ssid.Ssid));
+ _rtw_free_network_nolock(pmlmepriv, pnetwork);
-+_func_exit_;
++_func_exit_;
+}
+
+
+void rtw_free_network_queue(_adapter* dev, u8 isfreeall)
+{
-+_func_enter_;
++_func_enter_;
+ _rtw_free_network_queue(dev, isfreeall);
-+_func_exit_;
++_func_exit_;
+}
+
+/*
@@ -17492,9 +17478,9 @@ index 000000000000..00edd9cc6955
+ {
+ ret=_TRUE;
+ }
-+
++
+ return ret;
-+
++
+}
+
+inline int is_same_ess(WLAN_BSSID_EX *a, WLAN_BSSID_EX *b);
@@ -17502,24 +17488,24 @@ index 000000000000..00edd9cc6955
+{
+ //RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("(%s,%d)(%s,%d)\n",
+ // a->Ssid.Ssid,a->Ssid.SsidLength,b->Ssid.Ssid,b->Ssid.SsidLength));
-+ return (a->Ssid.SsidLength == b->Ssid.SsidLength)
++ return (a->Ssid.SsidLength == b->Ssid.SsidLength)
+ && _rtw_memcmp(a->Ssid.Ssid, b->Ssid.Ssid, a->Ssid.SsidLength)==_TRUE;
+}
+
+int is_same_network(WLAN_BSSID_EX *src, WLAN_BSSID_EX *dst)
+{
+ u16 s_cap, d_cap;
-+
-+_func_enter_;
++++
++_func_enter_;
+
+#ifdef PLATFORM_OS_XP
-+ if ( ((uint)dst) <= 0x7fffffff ||
-+ ((uint)src) <= 0x7fffffff ||
-+ ((uint)&s_cap) <= 0x7fffffff ||
-+ ((uint)&d_cap) <= 0x7fffffff)
++ if ( ((uint)dst) <= 0x7fffffff ||
++ ((uint)src) <= 0x7fffffff ||
++ ((uint)&s_cap) <= 0x7fffffff ||
++ ((uint)&d_cap) <= 0x7fffffff)
+ {
+ RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("\n@@@@ error address of dst\n"));
-+
++
+ KeBugCheckEx(0x87110000, (ULONG_PTR)dst, (ULONG_PTR)src,(ULONG_PTR)&s_cap, (ULONG_PTR)&d_cap);
+ +
+ return _FALSE;
@@ -17530,54 +17516,54 @@ index 000000000000..00edd9cc6955
+ _rtw_memcpy((u8 *)&s_cap, rtw_get_capability_from_ie(src->IEs), 2);
+ _rtw_memcpy((u8 *)&d_cap, rtw_get_capability_from_ie(dst->IEs), 2);
+
-+
++
+ s_cap = le16_to_cpu(s_cap);
+ d_cap = le16_to_cpu(d_cap);
-+
-+_func_exit_;
++
++_func_exit_;
+
+ return ((src->Ssid.SsidLength == dst->Ssid.SsidLength) &&
+ // (src->Configuration.DSConfig == dst->Configuration.DSConfig) &&
+ ( (_rtw_memcmp(src->MacAddress, dst->MacAddress, ETH_ALEN)) == _TRUE) &&
+ ( (_rtw_memcmp(src->Ssid.Ssid, dst->Ssid.Ssid, src->Ssid.SsidLength)) == _TRUE) &&
-+ ((s_cap & WLAN_CAPABILITY_IBSS) ==
++ ((s_cap & WLAN_CAPABILITY_IBSS) ==
+ (d_cap & WLAN_CAPABILITY_IBSS)) &&
-+ ((s_cap & WLAN_CAPABILITY_BSS) ==
++ ((s_cap & WLAN_CAPABILITY_BSS) ==
+ (d_cap & WLAN_CAPABILITY_BSS)));
-+
++
+}
+
+struct wlan_network * rtw_get_oldest_wlan_network(_queue *scanned_queue)
+{
+ _list *plist, *phead;
+
-+
++
+ struct wlan_network *pwlan = NULL;
+ struct wlan_network *oldest = NULL;
-+_func_enter_;
++_func_enter_;
+ phead = get_list_head(scanned_queue);
-+
++
+ plist = get_next(phead);
+
+ while(1)
+ {
-+
++
+ if (rtw_end_of_queue_search(phead,plist)== _TRUE)
+ break;
-+
++
+ pwlan= LIST_CONTAINOR(plist, struct wlan_network, list);
+
+ if(pwlan->fixed!=_TRUE)
-+ {
++ {
+ if (oldest == NULL ||time_after(oldest->last_scanned, pwlan->last_scanned))
+ oldest = pwlan;
+ }
-+
++
+ plist = get_next(plist);
+ }
-+_func_exit_;
++_func_exit_;
+ return oldest;
-+
++
+}
+
+static void update_network(WLAN_BSSID_EX *dst, WLAN_BSSID_EX *src,
@@ -17595,7 +17581,7 @@ index 000000000000..00edd9cc6955
+ u8 sq_final;
+ long rssi_final;
+
-+_func_enter_;
++_func_enter_;
+
+#ifdef CONFIG_ANTENNA_DIVERSITY
+ rtw_hal_antdiv_rssi_compared(padapter, dst, src); //this will update src.Rssi, need consider again
@@ -17634,7 +17620,7 @@ index 000000000000..00edd9cc6955
+ sq_final = dst->PhyInfo.SignalQuality;
+ rssi_final = dst->Rssi;
+ }
-+
++
+ }
+
+ if (update_ie)
@@ -17656,7 +17642,7 @@ index 000000000000..00edd9cc6955
+// DBG_871X("update_network: rssi=0x%lx dst->Rssi=%d ,dst->Rssi=0x%lx , src->Rssi=0x%lx",(dst->Rssi+src->Rssi)/2,dst->Rssi,dst->Rssi,src->Rssi);
+ if (check_fwstate(&padapter->mlmepriv, _FW_LINKED) && is_same_network(&(padapter->mlmepriv.cur_network.network), src))
+ {
-+
++
+ //DBG_871X("b:ssid=%s update_network: src->rssi=0x%d padapter->recvpriv.ui_rssi=%d\n",src->Ssid.Ssid,src->Rssi,padapter->recvpriv.signal);
+ if(padapter->recvpriv.signal_qual_data.total_num++ >= PHY_LINKQUALITY_SLID_WIN_MAX)
+ {
@@ -17664,9 +17650,9 @@ index 000000000000..00edd9cc6955
+ last_evm = padapter->recvpriv.signal_qual_data.elements[padapter->recvpriv.signal_qual_data.index];
+ padapter->recvpriv.signal_qual_data.total_val -= last_evm;
+ }
-+ padapter->recvpriv.signal_qual_data.total_val += query_rx_pwr_percentage(src->Rssi);
++ padapter->recvpriv.signal_qual_data.total_val += query_rx_pwr_percentage(src->Rssi);
+
-+ padapter->recvpriv.signal_qual_data.elements[padapter->recvpriv.signal_qual_data.index++] = query_rx_pwr_percentage(src->Rssi);
++ padapter->recvpriv.signal_qual_data.elements[padapter->recvpriv.signal_qual_data.index++] = query_rx_pwr_percentage(src->Rssi);
+ if(padapter->recvpriv.signal_qual_data.index >= PHY_LINKQUALITY_SLID_WIN_MAX)
+ padapter->recvpriv.signal_qual_data.index = 0;
+
@@ -17681,24 +17667,24 @@ index 000000000000..00edd9cc6955
+ else{
+// DBG_871X("ELSE:ssid=%s update_network: src->rssi=0x%d dst->rssi=%d\n",src->Ssid.Ssid,src->Rssi,dst->Rssi);
+ src->Rssi=(src->Rssi +dst->Rssi)/2;//dBM
-+ }
++ }
+
+// DBG_871X("a:update_network: src->rssi=0x%d padapter->recvpriv.ui_rssi=%d\n",src->Rssi,padapter->recvpriv.signal);
+
+#endif
+
-+_func_exit_;
++_func_exit_;
+}
+
+static void update_current_network(_adapter *adapter, WLAN_BSSID_EX *pnetwork)
+{
+ struct mlme_priv *pmlmepriv = &(adapter->mlmepriv);
-+
-+_func_enter_;
++
++_func_enter_;
+
+#ifdef PLATFORM_OS_XP
+ if ((unsigned long)(&(pmlmepriv->cur_network.network)) < 0x7ffffff)
-+ {
++ {
+ KeBugCheckEx(0x87111c1c, (ULONG_PTR)(&(pmlmepriv->cur_network.network)), 0, 0,0);
+ }
+#endif
@@ -17710,12 +17696,12 @@ index 000000000000..00edd9cc6955
+ //if(pmlmepriv->cur_network.network.IELength<= pnetwork->IELength)
+ {
+ update_network(&(pmlmepriv->cur_network.network), pnetwork,adapter, _TRUE);
-+ rtw_update_protection(adapter, (pmlmepriv->cur_network.network.IEs) + sizeof (NDIS_802_11_FIXED_IEs),
++ rtw_update_protection(adapter, (pmlmepriv->cur_network.network.IEs) + sizeof (NDIS_802_11_FIXED_IEs),
+ pmlmepriv->cur_network.network.IELength);
+ }
+ }
+
-+_func_exit_;
++_func_exit_;
+
+}
+
@@ -17766,12 +17752,12 @@ index 000000000000..00edd9cc6955
+ plist = get_next(plist);
+
+ }
-+
-+
++
++
+ /* If we didn't find a match, then get a new network slot to initialize
+ * with this beacon's information */
+ if (rtw_end_of_queue_search(phead,plist)== _TRUE) {
-+
++
+ if (_rtw_queue_empty(&(pmlmepriv->free_bss_pool)) == _TRUE) {
+ /* If there are no more slots, expire the oldest */
+ //list_del_init(&oldest->list);
@@ -17787,8 +17773,8 @@ index 000000000000..00edd9cc6955
+ pnetwork->fixed = _FALSE;
+ pnetwork->last_scanned = rtw_get_current_time();
+
-+ pnetwork->network_type = 0;
-+ pnetwork->aid=0;
++ pnetwork->network_type = 0;
++ pnetwork->aid=0;
+ pnetwork->join_res=0;
+
+ /* bss info not receving from the right channel */
@@ -17800,7 +17786,7 @@ index 000000000000..00edd9cc6955
+
+ pnetwork = rtw_alloc_network(pmlmepriv); // will update scan_time
+
-+ if(pnetwork==NULL){
++ if(pnetwork==NULL){
+ RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("\n\n\nsomething wrong here\n\n\n"));
+ goto exit;
+ }
@@ -17819,13 +17805,13 @@ index 000000000000..00edd9cc6955
+ if (pnetwork->network.PhyInfo.SignalQuality == 101)
+ pnetwork->network.PhyInfo.SignalQuality = 0;
+
-+ rtw_list_insert_tail(&(pnetwork->list),&(queue->queue));
++ rtw_list_insert_tail(&(pnetwork->list),&(queue->queue));
+
+ }
+ }
+ else {
+ /* we have an entry and we are going to update it. But this entry may
-+ * be already expired. In this case we do the same as we found a new
++ * be already expired. In this case we do the same as we found a new
+ * net and call the new_net handler
+ */
+ bool update_ie = _TRUE;
@@ -17852,21 +17838,21 @@ index 000000000000..00edd9cc6955
+ struct mlme_priv *pmlmepriv = &(((_adapter *)adapter)->mlmepriv);
+ //_queue *queue = &(pmlmepriv->scanned_queue);
+
-+_func_enter_;
++_func_enter_;
+
+ //_enter_critical_bh(&queue->lock, &irqL);
+
+ #if defined(CONFIG_P2P) && defined(CONFIG_P2P_REMOVE_GROUP_INFO)
+ rtw_WLAN_BSSID_EX_remove_p2p_attr(pnetwork, P2P_ATTR_GROUP_INFO);
+ #endif
-+
++
+ update_current_network(adapter, pnetwork);
-+
++
+ rtw_update_scanned_network(adapter, pnetwork);
+
+ //_exit_critical_bh(&queue->lock, &irqL);
-+
-+_func_exit_;
++
++_func_exit_;
+}
+
+//select the desired network based on the capability of the (i)bss.
@@ -17887,7 +17873,7 @@ index 000000000000..00edd9cc6955
+ uint wps_ielen;
+
+ int bselected = _TRUE;
-+
++
+ desired_encmode = psecuritypriv->ndisencryptstatus;
+ privacy = pnetwork->network.Privacy;
+
@@ -17898,9 +17884,9 @@ index 000000000000..00edd9cc6955
+ return _TRUE;
+ }
+ else
-+ {
++ {
+ return _FALSE;
-+ }
++ }
+ }
+ if (adapter->registrypriv.wifi_spec == 1) //for correct flow of 8021X to do....
+ {
@@ -17919,19 +17905,19 @@ index 000000000000..00edd9cc6955
+ }
+ }
+ }
-+
+
-+ if ((desired_encmode != Ndis802_11EncryptionDisabled) && (privacy == 0)) {
++
++ if ((desired_encmode != Ndis802_11EncryptionDisabled) && (privacy == 0)) {
+ DBG_871X("desired_encmode: %d, privacy: %d\n", desired_encmode, privacy);
+ bselected = _FALSE;
-+ }
++ }
+
+ if(check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == _TRUE)
+ {
+ if(pnetwork->network.InfrastructureMode != pmlmepriv->cur_network.network.InfrastructureMode)
+ bselected = _FALSE;
-+ }
-+
++ }
++
+
+ return bselected;
+}
@@ -17940,10 +17926,10 @@ index 000000000000..00edd9cc6955
+void rtw_atimdone_event_callback(_adapter *adapter , u8 *pbuf)
+{
+
-+_func_enter_;
-+ RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("receive atimdone_evet\n"));
-+_func_exit_;
-+ return;
++_func_enter_;
++ RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("receive atimdone_evet\n"));
++_func_exit_;
++ return;
+}
+
+
@@ -17954,7 +17940,7 @@ index 000000000000..00edd9cc6955
+ WLAN_BSSID_EX *pnetwork;
+ struct mlme_priv *pmlmepriv = &(adapter->mlmepriv);
+
-+_func_enter_;
++_func_enter_;
+
+ pnetwork = (WLAN_BSSID_EX *)pbuf;
+
@@ -17962,22 +17948,22 @@ index 000000000000..00edd9cc6955
+
+#ifdef CONFIG_RTL8712
+ //endian_convert
-+ pnetwork->Length = le32_to_cpu(pnetwork->Length);
-+ pnetwork->Ssid.SsidLength = le32_to_cpu(pnetwork->Ssid.SsidLength);
++ pnetwork->Length = le32_to_cpu(pnetwork->Length);
++ pnetwork->Ssid.SsidLength = le32_to_cpu(pnetwork->Ssid.SsidLength);
+ pnetwork->Privacy =le32_to_cpu( pnetwork->Privacy);
+ pnetwork->Rssi = le32_to_cpu(pnetwork->Rssi);
-+ pnetwork->NetworkTypeInUse =le32_to_cpu(pnetwork->NetworkTypeInUse);
++ pnetwork->NetworkTypeInUse =le32_to_cpu(pnetwork->NetworkTypeInUse);
+ pnetwork->Configuration.ATIMWindow = le32_to_cpu(pnetwork->Configuration.ATIMWindow);
+ pnetwork->Configuration.BeaconPeriod = le32_to_cpu(pnetwork->Configuration.BeaconPeriod);
+ pnetwork->Configuration.DSConfig =le32_to_cpu(pnetwork->Configuration.DSConfig);
+ pnetwork->Configuration.FHConfig.DwellTime=le32_to_cpu(pnetwork->Configuration.FHConfig.DwellTime);
+ pnetwork->Configuration.FHConfig.HopPattern=le32_to_cpu(pnetwork->Configuration.FHConfig.HopPattern);
+ pnetwork->Configuration.FHConfig.HopSet=le32_to_cpu(pnetwork->Configuration.FHConfig.HopSet);
-+ pnetwork->Configuration.FHConfig.Length=le32_to_cpu(pnetwork->Configuration.FHConfig.Length);
++ pnetwork->Configuration.FHConfig.Length=le32_to_cpu(pnetwork->Configuration.FHConfig.Length);
+ pnetwork->Configuration.Length = le32_to_cpu(pnetwork->Configuration.Length);
+ pnetwork->InfrastructureMode = le32_to_cpu(pnetwork->InfrastructureMode);
+ pnetwork->IELength = le32_to_cpu(pnetwork->IELength);
-+#endif
++#endif
+
+ len = get_WLAN_BSSID_EX_sz(pnetwork);
+ if(len > (sizeof(WLAN_BSSID_EX)))
@@ -17997,14 +17983,14 @@ index 000000000000..00edd9cc6955
+ {
+ struct wlan_network* ibss_wlan = NULL;
+ _irqL irqL;
-+
++
+ _rtw_memcpy(pmlmepriv->cur_network.network.IEs, pnetwork->IEs, 8);
+ _enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
+ ibss_wlan = rtw_find_network(&pmlmepriv->scanned_queue, pnetwork->MacAddress);
+ if(ibss_wlan)
+ {
-+ _rtw_memcpy(ibss_wlan->network.IEs , pnetwork->IEs, 8);
-+ _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
++ _rtw_memcpy(ibss_wlan->network.IEs , pnetwork->IEs, 8);
++ _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
+ goto exit;
+ }
+ _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
@@ -18013,21 +17999,21 @@ index 000000000000..00edd9cc6955
+
+ // lock pmlmepriv->lock when you accessing network_q
+ if ((check_fwstate(pmlmepriv, _FW_UNDER_LINKING)) == _FALSE)
-+ {
-+ if( pnetwork->Ssid.Ssid[0] == 0 )
++ {
++ if( pnetwork->Ssid.Ssid[0] == 0 )
+ {
+ pnetwork->Ssid.SsidLength = 0;
-+ }
++ }
+ rtw_add_network(adapter, pnetwork);
-+ }
++ }
++
++exit:
+
-+exit:
-+
+ _exit_critical_bh(&pmlmepriv->lock, &irqL);
+
-+_func_exit_;
++_func_exit_;
+
-+ return;
++ return;
+}
+
+
@@ -18037,14 +18023,14 @@ index 000000000000..00edd9cc6955
+ _irqL irqL;
+ u8 timer_cancelled = _FALSE;
+ struct mlme_priv *pmlmepriv = &(adapter->mlmepriv);
-+
-+#ifdef CONFIG_MLME_EXT
++
++#ifdef CONFIG_MLME_EXT
+
+ mlmeext_surveydone_event_callback(adapter);
+
+#endif
+
-+_func_enter_;
++_func_enter_;
+
+ _enter_critical_bh(&pmlmepriv->lock, &irqL);
+ if(pmlmepriv->wps_probe_req_ie)
@@ -18052,23 +18038,23 @@ index 000000000000..00edd9cc6955
+ u32 free_len = pmlmepriv->wps_probe_req_ie_len;
+ pmlmepriv->wps_probe_req_ie_len = 0;
+ rtw_mfree(pmlmepriv->wps_probe_req_ie, free_len);
-+ pmlmepriv->wps_probe_req_ie = NULL;
++ pmlmepriv->wps_probe_req_ie = NULL;
+ }
-+
++
+ RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("rtw_surveydone_event_callback: fw_state:%x\n\n", get_fwstate(pmlmepriv)));
-+
++
+ if (check_fwstate(pmlmepriv,_FW_UNDER_SURVEY))
+ {
+ //u8 timer_cancelled;
+
+ timer_cancelled = _TRUE;
+ //_cancel_timer(&pmlmepriv->scan_to_timer, &timer_cancelled);
-+
++
+ _clr_fwstate_(pmlmepriv, _FW_UNDER_SURVEY);
+ }
+ else {
-+
-+ RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("nic status =%x, survey done event comes too late!\n", get_fwstate(pmlmepriv)));
++
++ RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("nic status =%x, survey done event comes too late!\n", get_fwstate(pmlmepriv)));
+ }
+ _exit_critical_bh(&pmlmepriv->lock, &irqL);
+
@@ -18088,38 +18074,38 @@ index 000000000000..00edd9cc6955
+ {
+ if(check_fwstate(pmlmepriv, _FW_LINKED)==_FALSE)
+ {
-+ set_fwstate(pmlmepriv, _FW_UNDER_LINKING);
-+
-+ if(rtw_select_and_join_from_scanned_queue(pmlmepriv)==_SUCCESS)
-+ {
-+ _set_timer(&pmlmepriv->assoc_timer, MAX_JOIN_TIMEOUT );
-+ }
-+ else
-+ {
-+ WLAN_BSSID_EX *pdev_network = &(adapter->registrypriv.dev_network);
++ set_fwstate(pmlmepriv, _FW_UNDER_LINKING);
++
++ if(rtw_select_and_join_from_scanned_queue(pmlmepriv)==_SUCCESS)
++ {
++ _set_timer(&pmlmepriv->assoc_timer, MAX_JOIN_TIMEOUT );
++ }
++ else
++ {
++ WLAN_BSSID_EX *pdev_network = &(adapter->registrypriv.dev_network);
+ u8 *pibss = adapter->registrypriv.dev_network.MacAddress;
+
+ //pmlmepriv->fw_state ^= _FW_UNDER_SURVEY;//because don't set assoc_timer
+ _clr_fwstate_(pmlmepriv, _FW_UNDER_SURVEY);
+
+ RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("switching to adhoc master\n"));
-+
++
+ _rtw_memset(&pdev_network->Ssid, 0, sizeof(NDIS_802_11_SSID));
+ _rtw_memcpy(&pdev_network->Ssid, &pmlmepriv->assoc_ssid, sizeof(NDIS_802_11_SSID));
-+
++
+ rtw_update_registrypriv_dev_network(adapter);
+ rtw_generate_random_ibss(pibss);
+
-+ pmlmepriv->fw_state = WIFI_ADHOC_MASTER_STATE;
-+
++ pmlmepriv->fw_state = WIFI_ADHOC_MASTER_STATE;
++
+ if(rtw_createbss_cmd(adapter)!=_SUCCESS)
+ {
-+ RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("Error=>rtw_createbss_cmd status FAIL\n"));
-+ }
++ RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("Error=>rtw_createbss_cmd status FAIL\n"));
++ }
+
-+ pmlmepriv->to_join = _FALSE;
-+ }
-+ }
++ pmlmepriv->to_join = _FALSE;
++ }
++ }
+ }
+ else
+ {
@@ -18128,7 +18114,7 @@ index 000000000000..00edd9cc6955
+ pmlmepriv->to_join = _FALSE;
+ if(_SUCCESS == (s_ret=rtw_select_and_join_from_scanned_queue(pmlmepriv)))
+ {
-+ _set_timer(&pmlmepriv->assoc_timer, MAX_JOIN_TIMEOUT);
++ _set_timer(&pmlmepriv->assoc_timer, MAX_JOIN_TIMEOUT);
+ }
+ else if(s_ret == 2)//there is no need to wait for join
+ {
@@ -18192,7 +18178,7 @@ index 000000000000..00edd9cc6955
+ if (adapter->mlmepriv.widi_state == INTEL_WIDI_STATE_NONE)
+#endif
+ {
-+ struct mlme_ext_priv *pmlmeext = &adapter->mlmeextpriv;
++ struct mlme_ext_priv *pmlmeext = &adapter->mlmeextpriv;
+ if(pmlmeext->sitesurvey_res.bss_cnt == 0){
+ rtw_hal_sreset_reset(adapter);
+ }
@@ -18203,7 +18189,7 @@ index 000000000000..00edd9cc6955
+ rtw_cfg80211_surveydone_event_callback(adapter);
+#endif //CONFIG_IOCTL_CFG80211
+
-+_func_exit_;
++_func_exit_;
+
+}
+
@@ -18223,9 +18209,9 @@ index 000000000000..00edd9cc6955
+ _queue *free_queue = &pmlmepriv->free_bss_pool;
+ _queue *scan_queue = &pmlmepriv->scanned_queue;
+ _list *plist, *phead, *ptemp;
-+
-+_func_enter_;
-+
++
++_func_enter_;
++
+ RT_TRACE(_module_rtl871x_mlme_c_, _drv_notice_, ("+free_scanqueue\n"));
+ _enter_critical_bh(&scan_queue->lock, &irqL0);
+ _enter_critical_bh(&free_queue->lock, &irqL);
@@ -18241,13 +18227,13 @@ index 000000000000..00edd9cc6955
+ plist =ptemp;
+ pmlmepriv->num_of_scanned --;
+ }
-+
++
+ _exit_critical_bh(&free_queue->lock, &irqL);
+ _exit_critical_bh(&scan_queue->lock, &irqL0);
-+
++
+_func_exit_;
+}
-+
++
+/*
+*rtw_free_assoc_resources: the caller has to lock pmlmepriv->lock
+*/
@@ -18255,14 +18241,14 @@ index 000000000000..00edd9cc6955
+{
+ _irqL irqL;
+ struct wlan_network* pwlan = NULL;
-+ struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
-+ struct sta_priv *pstapriv = &adapter->stapriv;
++ struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
++ struct sta_priv *pstapriv = &adapter->stapriv;
+ struct wlan_network *tgt_network = &pmlmepriv->cur_network;
-+
++
+#ifdef CONFIG_TDLS
+ struct tdls_info *ptdlsinfo = &adapter->tdlsinfo;
-+#endif //CONFIG_TDLS
-+_func_enter_;
++#endif //CONFIG_TDLS
++_func_enter_;
+
+ RT_TRACE(_module_rtl871x_mlme_c_, _drv_notice_, ("+rtw_free_assoc_resources\n"));
+ RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("tgt_network->network.MacAddress="MAC_FMT" ssid=%s\n",
@@ -18271,7 +18257,7 @@ index 000000000000..00edd9cc6955
+ if(check_fwstate( pmlmepriv, WIFI_STATION_STATE|WIFI_AP_STATE))
+ {
+ struct sta_info* psta;
-+
++
+ psta = rtw_get_stainfo(&adapter->stapriv, tgt_network->network.MacAddress);
+
+#ifdef CONFIG_TDLS
@@ -18290,26 +18276,26 @@ index 000000000000..00edd9cc6955
+ }
+
+ _exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
-+
++
+ }
+
+ if(check_fwstate( pmlmepriv, WIFI_ADHOC_STATE|WIFI_ADHOC_MASTER_STATE|WIFI_AP_STATE))
+ {
+ struct sta_info* psta;
-+
++
+ rtw_free_all_stainfo(adapter);
+
+ psta = rtw_get_bcmc_stainfo(adapter);
-+ _enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
++ _enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
+ rtw_free_stainfo(adapter, psta);
-+ _exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
++ _exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
+
-+ rtw_init_bcmc_stainfo(adapter);
++ rtw_init_bcmc_stainfo(adapter);
+ }
+
+ if(lock_scanned_queue)
+ _enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
-+
++
+ pwlan = rtw_find_network(&pmlmepriv->scanned_queue, tgt_network->network.MacAddress);
+ if(pwlan)
+ {
@@ -18355,11 +18341,11 @@ index 000000000000..00edd9cc6955
+
+ if(lock_scanned_queue)
+ _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
-+
++
+ adapter->securitypriv.key_mask = 0;
+
+_func_exit_;
-+
++
+}
+
+/*
@@ -18369,14 +18355,14 @@ index 000000000000..00edd9cc6955
+{
+ struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
+ struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
-+
++
+_func_enter_;
+
+ RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("+rtw_indicate_connect\n"));
-+
++
+ pmlmepriv->to_join = _FALSE;
+
-+ if(!check_fwstate(&padapter->mlmepriv, _FW_LINKED))
++ if(!check_fwstate(&padapter->mlmepriv, _FW_LINKED))
+ {
+
+#ifdef CONFIG_SW_ANTENNA_DIVERSITY
@@ -18413,7 +18399,7 @@ index 000000000000..00edd9cc6955
+ rtw_set_scan_deny(padapter, 3000);
+
+ RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("-rtw_indicate_connect: fw_state=0x%08x\n", get_fwstate(pmlmepriv)));
-+
++
+_func_exit_;
+
+}
@@ -18424,10 +18410,10 @@ index 000000000000..00edd9cc6955
+*/
+void rtw_indicate_disconnect( _adapter *padapter )
+{
-+ struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
++ struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
++
++_func_enter_;
+
-+_func_enter_;
-+
+ RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("+rtw_indicate_disconnect\n"));
+
+ _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING|WIFI_UNDER_WPS);
@@ -18435,7 +18421,7 @@ index 000000000000..00edd9cc6955
+ if(rtw_to_roaming(padapter) > 0)
+ _clr_fwstate_(pmlmepriv, _FW_LINKED);
+
-+ if(check_fwstate(&padapter->mlmepriv, _FW_LINKED)
++ if(check_fwstate(&padapter->mlmepriv, _FW_LINKED)
+ || (rtw_to_roaming(padapter) <= 0)
+ )
+ {
@@ -18464,7 +18450,7 @@ index 000000000000..00edd9cc6955
+
+#endif
+
-+_func_exit_;
++_func_exit_;
+}
+
+inline void rtw_indicate_scan_done( _adapter *padapter, bool aborted)
@@ -18509,7 +18495,7 @@ index 000000000000..00edd9cc6955
+ int i;
+ struct sta_info *bmc_sta, *psta=NULL;
+ struct recv_reorder_ctrl *preorder_ctrl;
-+ struct sta_priv *pstapriv = &padapter->stapriv;
++ struct sta_priv *pstapriv = &padapter->stapriv;
+ struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
+
+ psta = rtw_get_stainfo(pstapriv, pnetwork->network.MacAddress);
@@ -18520,9 +18506,9 @@ index 000000000000..00edd9cc6955
+ if(psta) //update ptarget_sta
+ {
+ DBG_871X("%s\n", __FUNCTION__);
-+
++
+ psta->aid = pnetwork->join_res;
-+#ifdef CONFIG_CONCURRENT_MODE
++#ifdef CONFIG_CONCURRENT_MODE
+
+ if(PRIMARY_ADAPTER == padapter->adapter_type)
+ psta->mac_id=0;
@@ -18536,24 +18522,24 @@ index 000000000000..00edd9cc6955
+
+ //security related
+ if(padapter->securitypriv.dot11AuthAlgrthm== dot11AuthAlgrthm_8021X)
-+ {
++ {
+ padapter->securitypriv.binstallGrpkey=_FALSE;
-+ padapter->securitypriv.busetkipkey=_FALSE;
++ padapter->securitypriv.busetkipkey=_FALSE;
+ padapter->securitypriv.bgrpkey_handshake=_FALSE;
+
+ psta->ieee8021x_blocked=_TRUE;
+ psta->dot118021XPrivacy=padapter->securitypriv.dot11PrivacyAlgrthm;
-+
++
+ _rtw_memset((u8 *)&psta->dot118021x_UncstKey, 0, sizeof (union Keytype));
-+
++
+ _rtw_memset((u8 *)&psta->dot11tkiprxmickey, 0, sizeof (union Keytype));
+ _rtw_memset((u8 *)&psta->dot11tkiptxmickey, 0, sizeof (union Keytype));
-+
++
+ _rtw_memset((u8 *)&psta->dot11txpn, 0, sizeof (union pn48));
+#ifdef CONFIG_IEEE80211W
+ _rtw_memset((u8 *)&psta->dot11wtxpn, 0, sizeof (union pn48));
+#endif //CONFIG_IEEE80211W
-+ _rtw_memset((u8 *)&psta->dot11rxpn, 0, sizeof (union pn48));
++ _rtw_memset((u8 *)&psta->dot11rxpn, 0, sizeof (union pn48));
+ }
+
+ // Commented by Albert 2012/07/21
@@ -18583,7 +18569,7 @@ index 000000000000..00edd9cc6955
+ preorder_ctrl->wsize_b = 64;//max_ampdu_sz;//ex. 32(kbytes) -> wsize_b=32
+ }
+
-+
++
+ bmc_sta = rtw_get_bcmc_stainfo(padapter);
+ if(bmc_sta)
+ {
@@ -18602,35 +18588,35 @@ index 000000000000..00edd9cc6955
+ }
+ }
+
-+
++
+ //misc.
+ update_sta_info(padapter, psta);
-+
++
+ }
-+
++
+ return psta;
-+
++
+}
+
+//pnetwork : returns from rtw_joinbss_event_callback
+//ptarget_wlan: found from scanned_queue
+static void rtw_joinbss_update_network(_adapter *padapter, struct wlan_network *ptarget_wlan, struct wlan_network *pnetwork)
+{
-+ struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
++ struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
+ struct wlan_network *cur_network = &(pmlmepriv->cur_network);
+
+ DBG_871X("%s\n", __FUNCTION__);
-+
++
+ RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("\nfw_state:%x, BSSID:"MAC_FMT"\n"
+ ,get_fwstate(pmlmepriv), MAC_ARG(pnetwork->network.MacAddress)));
+
-+
++
+ // why not use ptarget_wlan??
+ _rtw_memcpy(&cur_network->network, &pnetwork->network, pnetwork->network.Length);
+
+ cur_network->aid = pnetwork->join_res;
+
-+
++
+#ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS
+ rtw_set_signal_stat_timer(&padapter->recvpriv);
+#endif
@@ -18650,19 +18636,19 @@ index 000000000000..00edd9cc6955
+#ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS
+ rtw_set_signal_stat_timer(&padapter->recvpriv);
+#endif
-+
++
+ //update fw_state //will clr _FW_UNDER_LINKING here indirectly
+ switch(pnetwork->network.InfrastructureMode)
-+ {
-+ case Ndis802_11Infrastructure:
-+
++ {
++ case Ndis802_11Infrastructure:
++
+ if(pmlmepriv->fw_state&WIFI_UNDER_WPS)
+ pmlmepriv->fw_state = WIFI_STATION_STATE|WIFI_UNDER_WPS;
+ else
+ pmlmepriv->fw_state = WIFI_STATION_STATE;
-+
++
+ break;
-+ case Ndis802_11IBSS:
++ case Ndis802_11IBSS:
+ pmlmepriv->fw_state = WIFI_ADHOC_STATE;
+ break;
+ default:
@@ -18671,10 +18657,10 @@ index 000000000000..00edd9cc6955
+ break;
+ }
+
-+ rtw_update_protection(padapter, (cur_network->network.IEs) + sizeof (NDIS_802_11_FIXED_IEs),
++ rtw_update_protection(padapter, (cur_network->network.IEs) + sizeof (NDIS_802_11_FIXED_IEs),
+ (cur_network->network.IELength));
-+
-+#ifdef CONFIG_80211N_HT
++
++#ifdef CONFIG_80211N_HT
+ rtw_update_ht_cap(padapter, cur_network->network.IEs, cur_network->network.IELength, (u8) cur_network->network.Configuration.DSConfig);
+#endif
+
@@ -18684,7 +18670,7 @@ index 000000000000..00edd9cc6955
+//Notes: the fucntion could be > passive_level (the same context as Rx tasklet)
+//pnetwork : returns from rtw_joinbss_event_callback
+//ptarget_wlan: found from scanned_queue
-+//if join_res > 0, for (fw_state==WIFI_STATION_STATE), we check if "ptarget_sta" & "ptarget_wlan" exist.
++//if join_res > 0, for (fw_state==WIFI_STATION_STATE), we check if "ptarget_sta" & "ptarget_wlan" exist.
+//if join_res > 0, for (fw_state==WIFI_ADHOC_STATE), we only check if "ptarget_wlan" exist.
+//if join_res > 0, update "cur_network->network" from "pnetwork->network" if (ptarget_wlan !=NULL).
+//
@@ -18695,14 +18681,14 @@ index 000000000000..00edd9cc6955
+ static u8 retry=0;
+ u8 timer_cancelled;
+ struct sta_info *ptarget_sta= NULL, *pcur_sta = NULL;
-+ struct sta_priv *pstapriv = &adapter->stapriv;
++ struct sta_priv *pstapriv = &adapter->stapriv;
+ struct mlme_priv *pmlmepriv = &(adapter->mlmepriv);
+ struct wlan_network *pnetwork = (struct wlan_network *)pbuf;
+ struct wlan_network *cur_network = &(pmlmepriv->cur_network);
+ struct wlan_network *pcur_wlan = NULL, *ptarget_wlan = NULL;
-+ unsigned int the_same_macaddr = _FALSE;
++ unsigned int the_same_macaddr = _FALSE;
+
-+_func_enter_;
++_func_enter_;
+
+#ifdef CONFIG_RTL8712
+ //endian_convert
@@ -18712,14 +18698,14 @@ index 000000000000..00edd9cc6955
+ pnetwork->network.Ssid.SsidLength = le32_to_cpu(pnetwork->network.Ssid.SsidLength);
+ pnetwork->network.Privacy =le32_to_cpu( pnetwork->network.Privacy);
+ pnetwork->network.Rssi = le32_to_cpu(pnetwork->network.Rssi);
-+ pnetwork->network.NetworkTypeInUse =le32_to_cpu(pnetwork->network.NetworkTypeInUse) ;
++ pnetwork->network.NetworkTypeInUse =le32_to_cpu(pnetwork->network.NetworkTypeInUse) ;
+ pnetwork->network.Configuration.ATIMWindow = le32_to_cpu(pnetwork->network.Configuration.ATIMWindow);
+ pnetwork->network.Configuration.BeaconPeriod = le32_to_cpu(pnetwork->network.Configuration.BeaconPeriod);
+ pnetwork->network.Configuration.DSConfig = le32_to_cpu(pnetwork->network.Configuration.DSConfig);
+ pnetwork->network.Configuration.FHConfig.DwellTime=le32_to_cpu(pnetwork->network.Configuration.FHConfig.DwellTime);
+ pnetwork->network.Configuration.FHConfig.HopPattern=le32_to_cpu(pnetwork->network.Configuration.FHConfig.HopPattern);
+ pnetwork->network.Configuration.FHConfig.HopSet=le32_to_cpu(pnetwork->network.Configuration.FHConfig.HopSet);
-+ pnetwork->network.Configuration.FHConfig.Length=le32_to_cpu(pnetwork->network.Configuration.FHConfig.Length);
++ pnetwork->network.Configuration.FHConfig.Length=le32_to_cpu(pnetwork->network.Configuration.FHConfig.Length);
+ pnetwork->network.Configuration.Length = le32_to_cpu(pnetwork->network.Configuration.Length);
+ pnetwork->network.InfrastructureMode = le32_to_cpu(pnetwork->network.InfrastructureMode);
+ pnetwork->network.IELength = le32_to_cpu(pnetwork->network.IELength );
@@ -18728,17 +18714,17 @@ index 000000000000..00edd9cc6955
+ RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("joinbss event call back received with res=%d\n", pnetwork->join_res));
+
+ rtw_get_encrypt_decrypt_from_registrypriv(adapter);
-+
++
+
+ if (pmlmepriv->assoc_ssid.SsidLength == 0)
+ {
-+ RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("@@@@@ joinbss event call back for Any SSid\n"));
++ RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("@@@@@ joinbss event call back for Any SSid\n"));
+ }
+ else
+ {
+ RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("@@@@@ rtw_joinbss_event_callback for SSid:%s\n", pmlmepriv->assoc_ssid.Ssid));
+ }
-+
++
+ the_same_macaddr = _rtw_memcmp(pnetwork->network.MacAddress, cur_network->network.MacAddress, ETH_ALEN);
+
+ pnetwork->network.Length = get_WLAN_BSSID_EX_sz(&pnetwork->network);
@@ -18749,7 +18735,7 @@ index 000000000000..00edd9cc6955
+ }
+
+ _enter_critical_bh(&pmlmepriv->lock, &irqL);
-+
++
+ RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("\n rtw_joinbss_event_callback !! _enter_critical \n"));
+
+ if(pnetwork->join_res > 0)
@@ -18763,7 +18749,7 @@ index 000000000000..00edd9cc6955
+ {
+ if(the_same_macaddr == _TRUE)
+ {
-+ ptarget_wlan = rtw_find_network(&pmlmepriv->scanned_queue, cur_network->network.MacAddress);
++ ptarget_wlan = rtw_find_network(&pmlmepriv->scanned_queue, cur_network->network.MacAddress);
+ }
+ else
+ {
@@ -18779,7 +18765,7 @@ index 000000000000..00edd9cc6955
+
+ ptarget_wlan = rtw_find_network(&pmlmepriv->scanned_queue, pnetwork->network.MacAddress);
+ if(check_fwstate(pmlmepriv, WIFI_STATION_STATE) == _TRUE){
-+ if(ptarget_wlan) ptarget_wlan->fixed = _TRUE;
++ if(ptarget_wlan) ptarget_wlan->fixed = _TRUE;
+ }
+ }
+
@@ -18788,13 +18774,13 @@ index 000000000000..00edd9cc6955
+ {
+ ptarget_wlan = rtw_find_network(&pmlmepriv->scanned_queue, pnetwork->network.MacAddress);
+ if(check_fwstate(pmlmepriv, WIFI_STATION_STATE) == _TRUE){
-+ if(ptarget_wlan) ptarget_wlan->fixed = _TRUE;
++ if(ptarget_wlan) ptarget_wlan->fixed = _TRUE;
+ }
+ }
-+
-+ //s2. update cur_network
++
++ //s2. update cur_network
+ if(ptarget_wlan)
-+ {
++ {
+ rtw_joinbss_update_network(adapter, ptarget_wlan, pnetwork);
+ }
+ else
@@ -18803,9 +18789,9 @@ index 000000000000..00edd9cc6955
+ _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
+ goto ignore_joinbss_callback;
+ }
-+
-+
-+ //s3. find ptarget_sta & update ptarget_sta after update cur_network only for station mode
++
++
++ //s3. find ptarget_sta & update ptarget_sta after update cur_network only for station mode
+ if(check_fwstate(pmlmepriv, WIFI_STATION_STATE) == _TRUE)
+ {
+ ptarget_sta = rtw_joinbss_update_stainfo(adapter, pnetwork);
@@ -18815,9 +18801,9 @@ index 000000000000..00edd9cc6955
+ _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
+ goto ignore_joinbss_callback;
+ }
-+ }
-+
-+ //s4. indicate connect
++ }
++
++ //s4. indicate connect
+ if(check_fwstate(pmlmepriv, WIFI_STATION_STATE) == _TRUE)
+ {
+ rtw_indicate_connect(adapter);
@@ -18829,39 +18815,39 @@ index 000000000000..00edd9cc6955
+ }
+
+
-+ //s5. Cancle assoc_timer
++ //s5. Cancle assoc_timer
+ _cancel_timer(&pmlmepriv->assoc_timer, &timer_cancelled);
-+
++
+ RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("Cancle assoc_timer\n"));
-+
++
+ }
+ else
+ {
-+ RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("rtw_joinbss_event_callback err: fw_state:%x", get_fwstate(pmlmepriv)));
++ RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("rtw_joinbss_event_callback err: fw_state:%x", get_fwstate(pmlmepriv)));
+ _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
+ goto ignore_joinbss_callback;
+ }
-+
++
+ _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
-+
++
+ }
-+ else if(pnetwork->join_res == -4)
++ else if(pnetwork->join_res == -4)
+ {
+ rtw_reset_securitypriv(adapter);
-+ _set_timer(&pmlmepriv->assoc_timer, 1);
++ _set_timer(&pmlmepriv->assoc_timer, 1);
+
+ //rtw_free_assoc_resources(adapter, 1);
+
+ if((check_fwstate(pmlmepriv, _FW_UNDER_LINKING)) == _TRUE)
-+ {
++ {
+ RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("fail! clear _FW_UNDER_LINKING ^^^fw_state=%x\n", get_fwstate(pmlmepriv)));
+ _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
-+ }
-+
++ }
++
+ }
+ else //if join_res < 0 (join fails), then try again
+ {
-+
++
+ #ifdef REJOIN
+ res = _FAIL;
+ if(retry < 2) {
@@ -18879,18 +18865,18 @@ index 000000000000..00edd9cc6955
+ {
+ _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
+ rtw_indicate_connect(adapter);
-+ }
++ }
+ else
+ {
+ RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("Set Assoc_Timer = 1; can't find match ssid in scanned_q \n"));
+ #endif
-+
++
+ _set_timer(&pmlmepriv->assoc_timer, 1);
+ //rtw_free_assoc_resources(adapter, 1);
+ _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
-+
++
+ #ifdef REJOIN
-+ retry = 0;
++ retry = 0;
+ }
+ #endif
+ }
@@ -18898,7 +18884,7 @@ index 000000000000..00edd9cc6955
+ignore_joinbss_callback:
+
+ _exit_critical_bh(&pmlmepriv->lock, &irqL);
-+ _func_exit_;
++ _func_exit_;
+}
+
+void rtw_joinbss_event_callback(_adapter *adapter, u8 *pbuf)
@@ -18911,7 +18897,7 @@ index 000000000000..00edd9cc6955
+
+ rtw_os_xmit_schedule(adapter);
+
-+#ifdef CONFIG_CONCURRENT_MODE
++#ifdef CONFIG_CONCURRENT_MODE
+ rtw_os_xmit_schedule(adapter->pbuddy_adapter);
+#endif
+
@@ -18924,22 +18910,22 @@ index 000000000000..00edd9cc6955
+
+void rtw_stassoc_event_callback(_adapter *adapter, u8 *pbuf)
+{
-+ _irqL irqL;
++ _irqL irqL;
+ struct sta_info *psta;
+ struct mlme_priv *pmlmepriv = &(adapter->mlmepriv);
+ struct stassoc_event *pstassoc = (struct stassoc_event*)pbuf;
+ struct wlan_network *cur_network = &(pmlmepriv->cur_network);
+ struct wlan_network *ptarget_wlan = NULL;
+
-+_func_enter_;
-+
++_func_enter_;
++
+ if(rtw_access_ctrl(adapter, pstassoc->macaddr) == _FALSE)
+ return;
+
+#if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME)
+ if(check_fwstate(pmlmepriv, WIFI_AP_STATE))
+ {
-+ psta = rtw_get_stainfo(&adapter->stapriv, pstassoc->macaddr);
++ psta = rtw_get_stainfo(&adapter->stapriv, pstassoc->macaddr);
+ if(psta)
+ {
+#ifdef CONFIG_IOCTL_CFG80211
@@ -18951,18 +18937,18 @@ index 000000000000..00edd9cc6955
+
+ _enter_critical_bh(&psta->lock, &irqL);
+ if(psta->passoc_req && psta->assoc_req_len>0)
-+ {
++ {
+ passoc_req = rtw_zmalloc(psta->assoc_req_len);
+ if(passoc_req)
+ {
+ assoc_req_len = psta->assoc_req_len;
+ _rtw_memcpy(passoc_req, psta->passoc_req, assoc_req_len);
-+
++
+ rtw_mfree(psta->passoc_req , psta->assoc_req_len);
+ psta->passoc_req = NULL;
+ psta->assoc_req_len = 0;
+ }
-+ }
++ }
+ _exit_critical_bh(&psta->lock, &irqL);
+
+ if(passoc_req && assoc_req_len>0)
@@ -18972,46 +18958,46 @@ index 000000000000..00edd9cc6955
+ rtw_mfree(passoc_req, assoc_req_len);
+ }
+#endif //(LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)) || defined(CONFIG_CFG80211_FORCE_COMPATIBLE_2_6_37_UNDER)
-+#endif //CONFIG_IOCTL_CFG80211
++#endif //CONFIG_IOCTL_CFG80211
+
+ //bss_cap_update_on_sta_join(adapter, psta);
+ //sta_info_update(adapter, psta);
+ ap_sta_info_defer_update(adapter, psta);
-+ }
-+
++ }
++
+ goto exit;
-+ }
-+#endif
++ }
++#endif
+
-+ psta = rtw_get_stainfo(&adapter->stapriv, pstassoc->macaddr);
++ psta = rtw_get_stainfo(&adapter->stapriv, pstassoc->macaddr);
+ if( psta != NULL)
+ {
-+ //the sta have been in sta_info_queue => do nothing
-+
++ //the sta have been in sta_info_queue => do nothing
++
+ RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("Error: rtw_stassoc_event_callback: sta has been in sta_hash_queue \n"));
-+
++
+ goto exit; //(between drv has received this event before and fw have not yet to set key to CAM_ENTRY)
+ }
+
-+ psta = rtw_alloc_stainfo(&adapter->stapriv, pstassoc->macaddr);
++ psta = rtw_alloc_stainfo(&adapter->stapriv, pstassoc->macaddr);
+ if (psta == NULL) {
+ RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("Can't alloc sta_info when rtw_stassoc_event_callback\n"));
+ goto exit;
-+ }
-+
++ }
++
+ //to do : init sta_info variable
+ psta->qos_option = 0;
+ psta->mac_id = (uint)pstassoc->cam_id;
+ //psta->aid = (uint)pstassoc->cam_id;
-+
++
+ if(adapter->securitypriv.dot11AuthAlgrthm==dot11AuthAlgrthm_8021X)
+ psta->dot118021XPrivacy = adapter->securitypriv.dot11PrivacyAlgrthm;
+
-+ psta->ieee8021x_blocked = _FALSE;
-+
++ psta->ieee8021x_blocked = _FALSE;
++
+ _enter_critical_bh(&pmlmepriv->lock, &irqL);
+
-+ if ( (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)==_TRUE ) ||
++ if ( (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)==_TRUE ) ||
+ (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)==_TRUE ) )
+ {
+ if(adapter->stapriv.asoc_sta_count== 2)
@@ -19029,31 +19015,31 @@ index 000000000000..00edd9cc6955
+
+
+ mlmeext_sta_add_event_callback(adapter, psta);
-+
++
+#ifdef CONFIG_RTL8711
-+ //submit SetStaKey_cmd to tell fw, fw will allocate an CAM entry for this sta
++ //submit SetStaKey_cmd to tell fw, fw will allocate an CAM entry for this sta
+ rtw_setstakey_cmd(adapter, (unsigned char*)psta, _FALSE);
+#endif
-+
++
+exit:
-+
-+_func_exit_;
++
++_func_exit_;
+
+}
+
+void rtw_stadel_event_callback(_adapter *adapter, u8 *pbuf)
+{
-+ _irqL irqL,irqL2;
++ _irqL irqL,irqL2;
+ struct sta_info *psta;
+ struct wlan_network* pwlan = NULL;
+ WLAN_BSSID_EX *pdev_network=NULL;
+ u8* pibss = NULL;
+ struct mlme_priv *pmlmepriv = &(adapter->mlmepriv);
+ struct stadel_event *pstadel = (struct stadel_event*)pbuf;
-+ struct sta_priv *pstapriv = &adapter->stapriv;
++ struct sta_priv *pstapriv = &adapter->stapriv;
+ struct wlan_network *tgt_network = &(pmlmepriv->cur_network);
-+
-+_func_enter_;
++
++_func_enter_;
+
+ if(check_fwstate(pmlmepriv, WIFI_AP_STATE))
+ {
@@ -19093,56 +19079,56 @@ index 000000000000..00edd9cc6955
+ rtw_indicate_disconnect(adapter);
+ _enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
+ // remove the network entry in scanned_queue
-+ pwlan = rtw_find_network(&pmlmepriv->scanned_queue, tgt_network->network.MacAddress);
-+ if (pwlan) {
++ pwlan = rtw_find_network(&pmlmepriv->scanned_queue, tgt_network->network.MacAddress);
++ if (pwlan) {
+ pwlan->fixed = _FALSE;
+ rtw_free_network_nolock(pmlmepriv, pwlan);
+ }
+ _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
+
+ _rtw_roaming(adapter, tgt_network);
-+
++
+#ifdef CONFIG_INTEL_WIDI
+ if (!rtw_to_roaming(adapter))
+ process_intel_widi_disconnect(adapter, 1);
+#endif // CONFIG_INTEL_WIDI
+ }
+
-+ if ( check_fwstate(pmlmepriv,WIFI_ADHOC_MASTER_STATE) ||
++ if ( check_fwstate(pmlmepriv,WIFI_ADHOC_MASTER_STATE) ||
+ check_fwstate(pmlmepriv,WIFI_ADHOC_STATE))
+ {
+ psta = rtw_get_stainfo(&adapter->stapriv, pstadel->macaddr);
-+
++
+ _enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
+ rtw_free_stainfo(adapter, psta);
+ _exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
-+
++
+ if(adapter->stapriv.asoc_sta_count== 1) //a sta + bc/mc_stainfo (not Ibss_stainfo)
-+ {
++ {
+ //rtw_indicate_disconnect(adapter);//removed@20091105
+ _enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
+ //free old ibss network
+ //pwlan = rtw_find_network(&pmlmepriv->scanned_queue, pstadel->macaddr);
+ pwlan = rtw_find_network(&pmlmepriv->scanned_queue, tgt_network->network.MacAddress);
-+ if(pwlan)
++ if(pwlan)
+ {
+ pwlan->fixed = _FALSE;
-+ rtw_free_network_nolock(pmlmepriv, pwlan);
++ rtw_free_network_nolock(pmlmepriv, pwlan);
+ }
+ _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
+ //re-create ibss
-+ pdev_network = &(adapter->registrypriv.dev_network);
++ pdev_network = &(adapter->registrypriv.dev_network);
+ pibss = adapter->registrypriv.dev_network.MacAddress;
+
+ _rtw_memcpy(pdev_network, &tgt_network->network, get_WLAN_BSSID_EX_sz(&tgt_network->network));
-+
++
+ _rtw_memset(&pdev_network->Ssid, 0, sizeof(NDIS_802_11_SSID));
+ _rtw_memcpy(&pdev_network->Ssid, &pmlmepriv->assoc_ssid, sizeof(NDIS_802_11_SSID));
-+
-+ rtw_update_registrypriv_dev_network(adapter);
++
++ rtw_update_registrypriv_dev_network(adapter);
+
+ rtw_generate_random_ibss(pibss);
-+
++
+ if(check_fwstate(pmlmepriv,WIFI_ADHOC_STATE))
+ {
+ set_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE);
@@ -19152,18 +19138,18 @@ index 000000000000..00edd9cc6955
+ if(rtw_createbss_cmd(adapter)!=_SUCCESS)
+ {
+
-+ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("***Error=>stadel_event_callback: rtw_createbss_cmd status FAIL*** \n "));
++ RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("***Error=>stadel_event_callback: rtw_createbss_cmd status FAIL*** \n "));
+
+ }
+
-+
++
+ }
-+
++
+ }
-+
++
+ _exit_critical_bh(&pmlmepriv->lock, &irqL2);
-+
-+_func_exit_;
++
++_func_exit_;
+
+}
+
@@ -19204,9 +19190,9 @@ index 000000000000..00edd9cc6955
+ _rtw_up_sema(&pmlmepriv->assoc_terminate);
+ return;
+ }
-+#endif
++#endif
+
-+_func_enter_;
++_func_enter_;
+#ifdef PLATFORM_FREEBSD
+ rtw_mtx_lock(NULL);
+ if (callout_pending(&adapter->mlmepriv.assoc_timer.callout)) {
@@ -19222,16 +19208,16 @@ index 000000000000..00edd9cc6955
+ return;
+ }
+ callout_deactivate(&adapter->mlmepriv.assoc_timer.callout);
-+
-+
++
++
+#endif
+
+ DBG_871X("%s, fw_state=%x\n", __FUNCTION__, get_fwstate(pmlmepriv));
-+
++
+ if(adapter->bDriverStopped ||adapter->bSurpriseRemoved)
+ return;
+
-+
++
+ _enter_critical_bh(&pmlmepriv->lock, &irqL);
+
+ #ifdef CONFIG_LAYER2_ROAMING
@@ -19259,8 +19245,8 @@ index 000000000000..00edd9cc6955
+ break;
+ }
+ }
-+
-+ } else
++
++ } else
+ #endif
+ {
+ rtw_indicate_disconnect(adapter);
@@ -19271,18 +19257,18 @@ index 000000000000..00edd9cc6955
+ rtw_cfg80211_indicate_disconnect(adapter);
+#endif //CONFIG_IOCTL_CFG80211
+
-+ }
++ }
+
+ _exit_critical_bh(&pmlmepriv->lock, &irqL);
-+
+
-+#ifdef CONFIG_DRVEXT_MODULE_WSC
-+ drvext_assoc_fail_indicate(&adapter->drvextpriv);
-+#endif
++
++#ifdef CONFIG_DRVEXT_MODULE_WSC
++ drvext_assoc_fail_indicate(&adapter->drvextpriv);
++#endif
+#ifdef PLATFORM_FREEBSD
+ rtw_mtx_unlock(NULL);
+#endif
-+
++
+_func_exit_;
+
+}
@@ -19292,14 +19278,14 @@ index 000000000000..00edd9cc6955
+* @adapter: pointer to _adapter structure
+*/
+void rtw_scan_timeout_handler (_adapter *adapter)
-+{
++{
+ _irqL irqL;
+ struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
-+
++
+ DBG_871X(FUNC_ADPT_FMT" fw_state=%x\n", FUNC_ADPT_ARG(adapter), get_fwstate(pmlmepriv));
+
+ _enter_critical_bh(&pmlmepriv->lock, &irqL);
-+
++
+ _clr_fwstate_(pmlmepriv, _FW_UNDER_SURVEY);
+
+ _exit_critical_bh(&pmlmepriv->lock, &irqL);
@@ -19319,13 +19305,13 @@ index 000000000000..00edd9cc6955
+ pmlmepriv->scan_interval--;
+ if(pmlmepriv->scan_interval==0)
+ {
-+/*
-+ if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY|_FW_UNDER_LINKING) == _TRUE)
++/*
++ if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY|_FW_UNDER_LINKING) == _TRUE)
+ {
+ DBG_871X("exit %s when _FW_UNDER_SURVEY|_FW_UNDER_LINKING -> \n", __FUNCTION__);
+ return;
+ }
-+
++
+ if(pmlmepriv->sitesurveyctrl.traffic_busy == _TRUE)
+ {
+ DBG_871X("%s exit cause traffic_busy(%x)\n",__FUNCTION__, pmlmepriv->sitesurveyctrl.traffic_busy);
@@ -19338,7 +19324,7 @@ index 000000000000..00edd9cc6955
+ {
+ if ((check_buddy_fwstate(padapter, _FW_UNDER_SURVEY|_FW_UNDER_LINKING) == _TRUE) ||
+ (padapter->pbuddy_adapter->mlmepriv.LinkDetectInfo.bBusyTraffic == _TRUE))
-+ {
++ {
+ DBG_871X("%s, but buddy_intf is under scanning or linking or BusyTraffic\n", __FUNCTION__);
+ return;
+ }
@@ -19347,12 +19333,12 @@ index 000000000000..00edd9cc6955
+
+ DBG_871X("%s\n", __FUNCTION__);
+
-+ rtw_set_802_11_bssid_list_scan(padapter, NULL, 0);
-+
++ rtw_set_802_11_bssid_list_scan(padapter, NULL, 0);
++
+ pmlmepriv->scan_interval = SCAN_INTERVAL;// 30*2 sec = 60sec
-+
++
+ }
-+
++
+ }
+
+}
@@ -19363,12 +19349,12 @@ index 000000000000..00edd9cc6955
+ struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
+#endif //CONFIG_AP_MODE
+ struct registry_priv *pregistrypriv = &adapter->registrypriv;
-+#ifdef CONFIG_CONCURRENT_MODE
-+ PADAPTER pbuddy_adapter = adapter->pbuddy_adapter;
++#ifdef CONFIG_CONCURRENT_MODE
++ PADAPTER pbuddy_adapter = adapter->pbuddy_adapter;
+#endif
+
+ if(!adapter)
-+ return;
++ return;
+
+ if(adapter->hw_init_completed == _FALSE)
+ return;
@@ -19383,27 +19369,27 @@ index 000000000000..00edd9cc6955
+ if(adapter->net_closed == _TRUE && pbuddy_adapter->net_closed == _TRUE)
+ {
+ return;
-+ }
++ }
+ }
+ else
+#endif //CONFIG_CONCURRENT_MODE
+ if(adapter->net_closed == _TRUE)
+ {
+ return;
-+ }
++ }
+
+ rtw_dynamic_chk_wk_cmd(adapter);
+
+ if(pregistrypriv->wifi_spec==1)
-+ {
++ {
+#ifdef CONFIG_P2P
+ struct wifidirect_info *pwdinfo = &adapter->wdinfo;
+ if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
-+#endif
++#endif
+ {
+ //auto site survey
+ rtw_auto_scan_handler(adapter);
-+ }
++ }
+ }
+
+#ifndef CONFIG_ACTIVE_KEEP_ALIVE_CHECK
@@ -19411,7 +19397,7 @@ index 000000000000..00edd9cc6955
+ if(check_fwstate(pmlmepriv, WIFI_AP_STATE) == _TRUE)
+ {
+ expire_timeout_chk(adapter);
-+ }
++ }
+#endif
+#endif //!CONFIG_ACTIVE_KEEP_ALIVE_CHECK
+
@@ -19421,8 +19407,8 @@ index 000000000000..00edd9cc6955
+ rcu_read_lock();
+#endif // (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 35))
+
-+#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35))
-+ if( adapter->pnetdev->br_port
++#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35))
++ if( adapter->pnetdev->br_port
+#else // (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35))
+ if( rcu_dereference(adapter->pnetdev->rx_handler_data)
+#endif // (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35))
@@ -19435,7 +19421,7 @@ index 000000000000..00edd9cc6955
+ if (adapter->pppoe_connection_in_progress > 0) {
+ adapter->pppoe_connection_in_progress--;
+ }
-+
++
+ // due to rtw_dynamic_check_timer_handlder() is called every 2 seconds
+ if (adapter->pppoe_connection_in_progress > 0) {
+ adapter->pppoe_connection_in_progress--;
@@ -19447,7 +19433,7 @@ index 000000000000..00edd9cc6955
+#endif // (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 35))
+
+#endif // CONFIG_BR_EXT
-+
++
+}
+
+
@@ -19482,18 +19468,18 @@ index 000000000000..00edd9cc6955
+ DBG_871X(FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(adapter));
+ ATOMIC_SET(&mlmepriv->set_scan_deny, 1);
+ _set_timer(&mlmepriv->set_scan_deny_timer, ms);
-+
++
+#ifdef CONFIG_CONCURRENT_MODE
+ if (!adapter->pbuddy_adapter)
+ return;
+
+ if (0)
+ DBG_871X(FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(adapter->pbuddy_adapter));
-+ b_mlmepriv = &adapter->pbuddy_adapter->mlmepriv;
++ b_mlmepriv = &adapter->pbuddy_adapter->mlmepriv;
+ ATOMIC_SET(&b_mlmepriv->set_scan_deny, 1);
-+ _set_timer(&b_mlmepriv->set_scan_deny_timer, ms);
++ _set_timer(&b_mlmepriv->set_scan_deny_timer, ms);
+#endif
-+
++
+}
+#endif
+
@@ -19541,7 +19527,7 @@ index 000000000000..00edd9cc6955
+ goto exit;
+ }
+#endif
-+
++
+ if(*candidate == NULL ||(*candidate)->network.Rssi<competitor->network.Rssi )
+ {
+ *candidate = competitor;
@@ -19565,7 +19551,7 @@ index 000000000000..00edd9cc6955
+#ifdef CONFIG_LAYER2_ROAMING
+ if(rtw_to_roaming(adapter)) { // roaming
+ if( (*candidate == NULL ||(*candidate)->network.Rssi<competitor->network.Rssi )
-+ && is_same_ess(&competitor->network, &pmlmepriv->cur_network.network)
++ && is_same_ess(&competitor->network, &pmlmepriv->cur_network.network)
+ //&&(!is_same_network(&competitor->network, &pmlmepriv->cur_network.network))
+ && rtw_get_passing_time_ms((u32)competitor->last_scanned) < RTW_SCAN_RESULT_EXPIRE
+ && rtw_is_desired_network(adapter, competitor)
@@ -19573,7 +19559,7 @@ index 000000000000..00edd9cc6955
+ *candidate = competitor;
+ updated = _TRUE;
+ }
-+
++
+ } else
+#endif
+ { // associate with ssid
@@ -19626,7 +19612,7 @@ index 000000000000..00edd9cc6955
+ _irqL irqL;
+ int ret;
+ _list *phead;
-+ _adapter *adapter;
++ _adapter *adapter;
+ _queue *queue = &(pmlmepriv->scanned_queue);
+ struct wlan_network *pnetwork = NULL;
+ struct wlan_network *candidate = NULL;
@@ -19635,7 +19621,7 @@ index 000000000000..00edd9cc6955
+_func_enter_;
+
+ _enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
-+ phead = get_list_head(queue);
++ phead = get_list_head(queue);
+ adapter = (_adapter *)pmlmepriv->nic_hdl;
+
+ pmlmepriv->pscanned = get_next( phead );
@@ -19648,7 +19634,7 @@ index 000000000000..00edd9cc6955
+ ret = _FAIL;
+ goto exit;
+ }
-+
++
+ pmlmepriv->pscanned = get_next(pmlmepriv->pscanned);
+
+ #if 0
@@ -19656,8 +19642,8 @@ index 000000000000..00edd9cc6955
+ #endif
+
+ rtw_check_join_candidate(pmlmepriv, &candidate, pnetwork);
-+
-+ }
++
++ }
+
+ if(candidate == NULL) {
+ DBG_871X("%s: return _FAIL(candidate == NULL)\n", __FUNCTION__);
@@ -19668,9 +19654,9 @@ index 000000000000..00edd9cc6955
+ candidate->network.Ssid.Ssid, MAC_ARG(candidate->network.MacAddress),
+ candidate->network.Configuration.DSConfig);
+ }
-+
+
-+ // check for situation of _FW_LINKED
++
++ // check for situation of _FW_LINKED
+ if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE)
+ {
+ DBG_871X("%s: _FW_LINKED while ask_for_joinbss!!!\n", __FUNCTION__);
@@ -19681,7 +19667,7 @@ index 000000000000..00edd9cc6955
+ DBG_871X("%s: _FW_LINKED and is same network, it needn't join again\n", __FUNCTION__);
+
+ rtw_indicate_connect(adapter);//rtw_indicate_connect again
-+
++
+ ret = 2;
+ goto exit;
+ }
@@ -19693,13 +19679,13 @@ index 000000000000..00edd9cc6955
+ rtw_free_assoc_resources(adapter, 0);
+ }
+ }
-+
++
+ #ifdef CONFIG_ANTENNA_DIVERSITY
+ rtw_hal_get_def_var(adapter, HAL_DEF_IS_SUPPORT_ANT_DIV, &(bSupportAntDiv));
-+ if(_TRUE == bSupportAntDiv)
++ if(_TRUE == bSupportAntDiv)
+ {
+ u8 CurrentAntenna;
-+ rtw_hal_get_def_var(adapter, HAL_DEF_CURRENT_ANTENNA, &(CurrentAntenna));
++ rtw_hal_get_def_var(adapter, HAL_DEF_CURRENT_ANTENNA, &(CurrentAntenna));
+ DBG_871X("#### Opt_Ant_(%s) , cur_Ant(%s)\n",
+ (2==candidate->network.PhyInfo.Optimum_antenna)?"A":"B",
+ (2==CurrentAntenna)?"A":"B"
@@ -19708,7 +19694,7 @@ index 000000000000..00edd9cc6955
+ #endif
+ set_fwstate(pmlmepriv, _FW_UNDER_LINKING);
+ ret = rtw_joinbss_cmd(adapter, candidate);
-+
++
+exit:
+ _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
+
@@ -19718,14 +19704,14 @@ index 000000000000..00edd9cc6955
+}
+#else
+int rtw_select_and_join_from_scanned_queue(struct mlme_priv *pmlmepriv )
-+{
++{
+ _irqL irqL;
+ _list *phead;
+#ifdef CONFIG_ANTENNA_DIVERSITY
+ u8 CurrentAntenna;
+#endif
+ unsigned char *dst_ssid, *src_ssid;
-+ _adapter *adapter;
++ _adapter *adapter;
+ _queue *queue = &(pmlmepriv->scanned_queue);
+ struct wlan_network *pnetwork = NULL;
+ struct wlan_network *pnetwork_max_rssi = NULL;
@@ -19736,7 +19722,7 @@ index 000000000000..00edd9cc6955
+
+_func_enter_;
+ _enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
-+ phead = get_list_head(queue);
++ phead = get_list_head(queue);
+ adapter = (_adapter *)pmlmepriv->nic_hdl;
+
+ pmlmepriv->pscanned = get_next( phead );
@@ -19747,12 +19733,12 @@ index 000000000000..00edd9cc6955
+ if(pnetwork==NULL){
+ RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("(2)rtw_select_and_join_from_scanned_queue return _FAIL:(pnetwork==NULL)\n"));
+ _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
-+ return _FAIL;
++ return _FAIL;
+ }
+
+ dst_ssid = pnetwork->network.Ssid.Ssid;
+ src_ssid = pmlmepriv->assoc_ssid.Ssid;
-+
++
+ pmlmepriv->pscanned = get_next(pmlmepriv->pscanned);
+
+ #if 0
@@ -19767,7 +19753,7 @@ index 000000000000..00edd9cc6955
+ //if((pmlmepriv->cur_network.network.InfrastructureMode==Ndis802_11AutoUnknown)||
+ // pmlmepriv->cur_network.network.InfrastructureMode == pnetwork->network.InfrastructureMode)
+ // goto ask_for_joinbss;
-+
++++
+ if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE)
+ {
+ if(is_same_network(&pmlmepriv->cur_network.network, &pnetwork->network))
@@ -19775,7 +19761,7 @@ index 000000000000..00edd9cc6955
+ //DBG_871X("select_and_join(1): _FW_LINKED and is same network, it needn't join again\n");
+
+ rtw_indicate_connect(adapter);//rtw_indicate_connect again
-+ _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
++ _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
+ return 2;
+ }
+ else
@@ -19785,7 +19771,7 @@ index 000000000000..00edd9cc6955
+ rtw_free_assoc_resources(adapter, 0);
+ _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
+ goto ask_for_joinbss;
-+
++++
+ }
+ }
+ else
@@ -19793,18 +19779,18 @@ index 000000000000..00edd9cc6955
+ _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
+ goto ask_for_joinbss;
+ }
-+
++
+ }
-+
++
+ } else if (pmlmepriv->assoc_ssid.SsidLength == 0) {
+ _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
-+ goto ask_for_joinbss;//anyway, join first selected(dequeued) pnetwork if ssid_len=0
-+
++ goto ask_for_joinbss;//anyway, join first selected(dequeued) pnetwork if ssid_len=0
++
+ #ifdef CONFIG_LAYER2_ROAMING
+ } else if (rtw_to_roaming(adapter) > 0) {
-+
++
+ if( (roaming_candidate == NULL ||roaming_candidate->network.Rssi<pnetwork->network.Rssi )
-+ && is_same_ess(&pnetwork->network, &pmlmepriv->cur_network.network)
++ && is_same_ess(&pnetwork->network, &pmlmepriv->cur_network.network)
+ //&&(!is_same_network(&pnetwork->network, &pmlmepriv->cur_network.network))
+ && rtw_get_time_interval_ms((u32)pnetwork->last_scanned,cur_time) < 5000
+ ) {
@@ -19825,7 +19811,7 @@ index 000000000000..00edd9cc6955
+ {
+ RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("dst_ssid=%s, src_ssid=%s \n", dst_ssid, src_ssid));
+#ifdef CONFIG_ANTENNA_DIVERSITY
-+ rtw_hal_get_def_var(adapter, HAL_DEF_CURRENT_ANTENNA, &(CurrentAntenna));
++ rtw_hal_get_def_var(adapter, HAL_DEF_CURRENT_ANTENNA, &(CurrentAntenna));
+ DBG_871X("#### dst_ssid=(%s) Opt_Ant_(%s) , cur_Ant(%s)\n", dst_ssid,
+ (2==pnetwork->network.PhyInfo.Optimum_antenna)?"A":"B",
+ (2==CurrentAntenna)?"A":"B");
@@ -19841,43 +19827,43 @@ index 000000000000..00edd9cc6955
+ if(pmlmepriv->assoc_by_rssi==_TRUE)//if the ssid is the same, select the bss which has the max rssi
+ {
+ if( NULL==pnetwork_max_rssi|| pnetwork->network.Rssi > pnetwork_max_rssi->network.Rssi)
-+ pnetwork_max_rssi = pnetwork;
++ pnetwork_max_rssi = pnetwork;
+ }
+ else if(rtw_is_desired_network(adapter, pnetwork) == _TRUE)
+ {
+ if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE)
+ {
-+#if 0
++#if 0
+ if(is_same_network(&pmlmepriv->cur_network.network, &pnetwork->network))
+ {
+ DBG_871X("select_and_join(2): _FW_LINKED and is same network, it needn't join again\n");
-+
++
+ rtw_indicate_connect(adapter);//rtw_indicate_connect again
-+
++
+ return 2;
+ }
+ else
-+#endif
++#endif
+ {
+ rtw_disassoc_cmd(adapter, 0, _TRUE);
+ //rtw_indicate_disconnect(adapter);//
+ rtw_free_assoc_resources(adapter, 0);
+ _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
-+ goto ask_for_joinbss;
++ goto ask_for_joinbss;
+ }
+ }
+ else
+ {
+ _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
+ goto ask_for_joinbss;
-+ }
++ }
+
+ }
-+
-+
++
++
+ }
-+
-+ }
++
++ }
+ _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
+ #ifdef CONFIG_LAYER2_ROAMING
+ if(rtw_to_roaming(adapter) > 0 && roaming_candidate ){
@@ -19897,13 +19883,13 @@ index 000000000000..00edd9cc6955
+ }
+
+ DBG_871X("(1)rtw_select_and_join_from_scanned_queue return _FAIL\n");
-+
-+_func_exit_;
++
++_func_exit_;
+
+ return _FAIL;
+
+ask_for_joinbss:
-+
++
+_func_exit_;
+
+ return rtw_joinbss_cmd(adapter, pnetwork);
@@ -19918,15 +19904,15 @@ index 000000000000..00edd9cc6955
+ struct setauth_parm *psetauthparm;
+ struct cmd_priv *pcmdpriv=&(adapter->cmdpriv);
+ sint res=_SUCCESS;
-+
-+_func_enter_;
++
++_func_enter_;
+
+ pcmd = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
+ if(pcmd==NULL){
+ res= _FAIL; //try again
+ goto exit;
+ }
-+
++
+ psetauthparm=(struct setauth_parm*)rtw_zmalloc(sizeof(struct setauth_parm));
+ if(psetauthparm==NULL){
+ rtw_mfree((unsigned char *)pcmd, sizeof(struct cmd_obj));
@@ -19936,10 +19922,10 @@ index 000000000000..00edd9cc6955
+
+ _rtw_memset(psetauthparm, 0, sizeof(struct setauth_parm));
+ psetauthparm->mode=(unsigned char)psecuritypriv->dot11AuthAlgrthm;
-+
++
+ pcmd->cmdcode = _SetAuth_CMD_;
-+ pcmd->parmbuf = (unsigned char *)psetauthparm;
-+ pcmd->cmdsz = (sizeof(struct setauth_parm));
++ pcmd->parmbuf = (unsigned char *)psetauthparm;
++ pcmd->cmdsz = (sizeof(struct setauth_parm));
+ pcmd->rsp = NULL;
+ pcmd->rspsz = 0;
+
@@ -19967,9 +19953,9 @@ index 000000000000..00edd9cc6955
+ struct cmd_priv *pcmdpriv = &(adapter->cmdpriv);
+ struct mlme_priv *pmlmepriv = &(adapter->mlmepriv);
+ sint res=_SUCCESS;
-+
++
+_func_enter_;
-+
++
+ pcmd = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
+ if(pcmd==NULL){
+ res= _FAIL; //try again
@@ -19984,10 +19970,10 @@ index 000000000000..00edd9cc6955
+
+ _rtw_memset(psetkeyparm, 0, sizeof(struct setkey_parm));
+
-+ if(psecuritypriv->dot11AuthAlgrthm ==dot11AuthAlgrthm_8021X){
-+ psetkeyparm->algorithm=(unsigned char)psecuritypriv->dot118021XGrpPrivacy;
++ if(psecuritypriv->dot11AuthAlgrthm ==dot11AuthAlgrthm_8021X){
++ psetkeyparm->algorithm=(unsigned char)psecuritypriv->dot118021XGrpPrivacy;
+ RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("\n rtw_set_key: psetkeyparm->algorithm=(unsigned char)psecuritypriv->dot118021XGrpPrivacy=%d \n", psetkeyparm->algorithm));
-+ }
++ }
+ else{
+ psetkeyparm->algorithm=(u8)psecuritypriv->dot11PrivacyAlgrthm;
+ RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("\n rtw_set_key: psetkeyparm->algorithm=(u8)psecuritypriv->dot11PrivacyAlgrthm=%d \n", psetkeyparm->algorithm));
@@ -20002,7 +19988,7 @@ index 000000000000..00edd9cc6955
+ RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("\n rtw_set_key: psetkeyparm->algorithm=%d psetkeyparm->keyid=(u8)keyid=%d \n",psetkeyparm->algorithm, keyid));
+
+ switch(psetkeyparm->algorithm){
-+
++
+ case _WEP40_:
+ keylen=5;
+ _rtw_memcpy(&(psetkeyparm->key[0]), &(psecuritypriv->dot11DefKey[keyid].skey[0]), keylen);
@@ -20012,12 +19998,12 @@ index 000000000000..00edd9cc6955
+ _rtw_memcpy(&(psetkeyparm->key[0]), &(psecuritypriv->dot11DefKey[keyid].skey[0]), keylen);
+ break;
+ case _TKIP_:
-+ keylen=16;
++ keylen=16;
+ _rtw_memcpy(&psetkeyparm->key, &psecuritypriv->dot118021XGrpKey[keyid], keylen);
+ psetkeyparm->grpkey=1;
+ break;
+ case _AES_:
-+ keylen=16;
++ keylen=16;
+ _rtw_memcpy(&psetkeyparm->key, &psecuritypriv->dot118021XGrpKey[keyid], keylen);
+ psetkeyparm->grpkey=1;
+ break;
@@ -20027,10 +20013,10 @@ index 000000000000..00edd9cc6955
+ goto exit;
+ }
+
-+
++
+ pcmd->cmdcode = _SetKey_CMD_;
-+ pcmd->parmbuf = (u8 *)psetkeyparm;
-+ pcmd->cmdsz = (sizeof(struct setkey_parm));
++ pcmd->parmbuf = (u8 *)psetkeyparm;
++ pcmd->cmdsz = (sizeof(struct setkey_parm));
+ pcmd->rsp = NULL;
+ pcmd->rspsz = 0;
+
@@ -20057,8 +20043,8 @@ index 000000000000..00edd9cc6955
+ i = 12; //after the fixed IE
+ while(i<in_len)
+ {
-+ ielength = initial_out_len;
-+
++ ielength = initial_out_len;
++
+ if(in_ie[i] == 0xDD && in_ie[i+2] == 0x00 && in_ie[i+3] == 0x50 && in_ie[i+4] == 0xF2 && in_ie[i+5] == 0x02 && i+5 < in_len) //WMM element ID and OUI
+ {
+
@@ -20066,29 +20052,29 @@ index 000000000000..00edd9cc6955
+ /*
+ for(j=i; j< i+(in_ie[i+1]+2); j++)
+ {
-+ out_ie[ielength] = in_ie[j];
++ out_ie[ielength] = in_ie[j];
+ ielength++;
+ }
+ out_ie[initial_out_len+8] = 0x00; //force the QoS Info Field to be zero
+ */
-+
++
+ for ( j = i; j < i + 9; j++ )
+ {
+ out_ie[ ielength] = in_ie[ j ];
+ ielength++;
-+ }
++ }
+ out_ie[ initial_out_len + 1 ] = 0x07;
+ out_ie[ initial_out_len + 6 ] = 0x00;
+ out_ie[ initial_out_len + 8 ] = 0x00;
-+
++
+ break;
+ }
+
+ i+=(in_ie[i+1]+2); // to the next IE element
+ }
-+
++
+ return ielength;
-+
++
+}
+
+
@@ -20110,30 +20096,30 @@ index 000000000000..00edd9cc6955
+
+ do
+ {
-+ if( ( psecuritypriv->PMKIDList[i].bUsed ) &&
++ if( ( psecuritypriv->PMKIDList[i].bUsed ) &&
+ ( _rtw_memcmp( psecuritypriv->PMKIDList[i].Bssid, bssid, ETH_ALEN ) == _TRUE ) )
+ {
+ break;
+ }
+ else
-+ {
++ {
+ i++;
+ //continue;
+ }
-+
++
+ }while(i<NUM_PMKID_CACHE);
+
+ if( i == NUM_PMKID_CACHE )
-+ {
++ {
+ i = -1;// Could not find.
+ }
+ else
-+ {
++ {
+ // There is one Pre-Authentication Key for the specific BSSID.
+ }
+
+ return (i);
-+
++
+}
+
+//
@@ -20141,27 +20127,27 @@ index 000000000000..00edd9cc6955
+// If the RSN IE length <= 20, the RSN IE didn't include the PMKID information
+// 0-11th element in the array are the fixed IE
+// 12th element in the array is the IE
-+// 13th element in the array is the IE length
++// 13th element in the array is the IE length
+//
+
+static int rtw_append_pmkid(_adapter *Adapter,int iEntry, u8 *ie, uint ie_len)
+{
+ struct security_priv *psecuritypriv=&Adapter->securitypriv;
+
-+ if(ie[13]<=20){
-+ // The RSN IE didn't include the PMK ID, append the PMK information
++ if(ie[13]<=20){
++ // The RSN IE didn't include the PMK ID, append the PMK information
+ ie[ie_len]=1;
+ ie_len++;
+ ie[ie_len]=0; //PMKID count = 0x0100
+ ie_len++;
+ _rtw_memcpy( &ie[ie_len], &psecuritypriv->PMKIDList[iEntry].PMKID, 16);
-+
++
+ ie_len+=16;
+ ie[13]+=18;//PMKID length = 2+16
+
+ }
+ return (ie_len);
-+
++
+}
+sint rtw_restruct_sec_ie(_adapter *adapter,u8 *in_ie, u8 *out_ie, uint in_len)
+{
@@ -20175,13 +20161,13 @@ index 000000000000..00edd9cc6955
+ struct security_priv *psecuritypriv=&adapter->securitypriv;
+ uint ndisauthmode=psecuritypriv->ndisauthtype;
+ uint ndissecuritytype = psecuritypriv->ndisencryptstatus;
-+
++
+_func_enter_;
+
+ RT_TRACE(_module_rtl871x_mlme_c_, _drv_notice_,
+ ("+rtw_restruct_sec_ie: ndisauthmode=%d ndissecuritytype=%d\n",
+ ndisauthmode, ndissecuritytype));
-+
++
+ //copy fixed ie only
+ _rtw_memcpy(out_ie, in_ie,12);
+ ielength=12;
@@ -20193,12 +20179,12 @@ index 000000000000..00edd9cc6955
+ if(check_fwstate(pmlmepriv, WIFI_UNDER_WPS))
+ {
+ _rtw_memcpy(out_ie+ielength, psecuritypriv->wps_ie, psecuritypriv->wps_ie_len);
-+
++
+ ielength += psecuritypriv->wps_ie_len;
+ }
+ else if((authmode==_WPA_IE_ID_)||(authmode==_WPA2_IE_ID_))
-+ {
-+ //copy RSN or SSN
++ {
++ //copy RSN or SSN
+ _rtw_memcpy(&out_ie[ielength], &psecuritypriv->supplicant_ie[0], psecuritypriv->supplicant_ie[1]+2);
+ /* debug for CONFIG_IEEE80211W
+ {
@@ -20210,9 +20196,9 @@ index 000000000000..00edd9cc6955
+ }*/
+ ielength+=psecuritypriv->supplicant_ie[1]+2;
+ rtw_report_sec_ie(adapter, authmode, psecuritypriv->supplicant_ie);
-+
++
+#ifdef CONFIG_DRVEXT_MODULE
-+ drvext_report_sec_ie(&adapter->drvextpriv, authmode, sec_ie);
++ drvext_report_sec_ie(&adapter->drvextpriv, authmode, sec_ie);
+#endif
+ }
+
@@ -20230,8 +20216,8 @@ index 000000000000..00edd9cc6955
+ }
+
+_func_exit_;
-+
-+ return ielength;
++
++ return ielength;
+}
+
+void rtw_init_registrypriv_dev_network( _adapter* adapter)
@@ -20240,29 +20226,29 @@ index 000000000000..00edd9cc6955
+ struct eeprom_priv* peepriv = &adapter->eeprompriv;
+ WLAN_BSSID_EX *pdev_network = &pregistrypriv->dev_network;
+ u8 *myhwaddr = myid(peepriv);
-+
++
+_func_enter_;
+
+ _rtw_memcpy(pdev_network->MacAddress, myhwaddr, ETH_ALEN);
+
+ _rtw_memcpy(&pdev_network->Ssid, &pregistrypriv->ssid, sizeof(NDIS_802_11_SSID));
-+
++
+ pdev_network->Configuration.Length=sizeof(NDIS_802_11_CONFIGURATION);
-+ pdev_network->Configuration.BeaconPeriod = 100;
++ pdev_network->Configuration.BeaconPeriod = 100;
+ pdev_network->Configuration.FHConfig.Length = 0;
+ pdev_network->Configuration.FHConfig.HopPattern = 0;
+ pdev_network->Configuration.FHConfig.HopSet = 0;
+ pdev_network->Configuration.FHConfig.DwellTime = 0;
-+
-+
-+_func_exit_;
-+
++
++
++_func_exit_;
++
+}
+
-+void rtw_update_registrypriv_dev_network(_adapter* adapter)
++void rtw_update_registrypriv_dev_network(_adapter* adapter)
+{
+ int sz=0;
-+ struct registry_priv* pregistrypriv = &adapter->registrypriv;
++ struct registry_priv* pregistrypriv = &adapter->registrypriv;
+ WLAN_BSSID_EX *pdev_network = &pregistrypriv->dev_network;
+ struct security_priv* psecuritypriv = &adapter->securitypriv;
+ struct wlan_network *cur_network = &adapter->mlmepriv.cur_network;
@@ -20276,9 +20262,9 @@ index 000000000000..00edd9cc6955
+ pxmitpriv->vcs_type = pregistrypriv->vcs_type;
+ //pxmitpriv->rts_thresh = pregistrypriv->rts_thresh;
+ pxmitpriv->frag_len = pregistrypriv->frag_thresh;
-+
++
+ adapter->qospriv.qos_option = pregistrypriv->wmm_enable;
-+#endif
++#endif
+
+ pdev_network->Privacy = (psecuritypriv->dot11PrivacyAlgrthm > 0 ? 1 : 0) ; // adhoc no 802.1x
+
@@ -20288,7 +20274,7 @@ index 000000000000..00edd9cc6955
+ {
+ case WIRELESS_11B:
+ pdev_network->NetworkTypeInUse = (Ndis802_11DS);
-+ break;
++ break;
+ case WIRELESS_11G:
+ case WIRELESS_11BG:
+ case WIRELESS_11_24N:
@@ -20310,9 +20296,9 @@ index 000000000000..00edd9cc6955
+ // TODO
+ break;
+ }
-+
++
+ pdev_network->Configuration.DSConfig = (pregistrypriv->channel);
-+ RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("pregistrypriv->channel=%d, pdev_network->Configuration.DSConfig=0x%x\n", pregistrypriv->channel, pdev_network->Configuration.DSConfig));
++ RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("pregistrypriv->channel=%d, pdev_network->Configuration.DSConfig=0x%x\n", pregistrypriv->channel, pdev_network->Configuration.DSConfig));
+
+ if(cur_network->network.InfrastructureMode == Ndis802_11IBSS)
+ pdev_network->Configuration.ATIMWindow = (0);
@@ -20331,8 +20317,8 @@ index 000000000000..00edd9cc6955
+
+ //notes: translate IELength & Length after assign the Length to cmdsz in createbss_cmd();
+ //pdev_network->IELength = cpu_to_le32(sz);
-+
-+_func_exit_;
++
++_func_exit_;
+
+}
+
@@ -20341,22 +20327,22 @@ index 000000000000..00edd9cc6955
+_func_enter_;
+
+
-+_func_exit_;
-+
++_func_exit_;
++
+}
+
-+//the fucntion is at passive_level
++//the fucntion is at passive_level
+void rtw_joinbss_reset(_adapter *padapter)
+{
+ u8 threshold;
+ struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
+
-+#ifdef CONFIG_80211N_HT
++#ifdef CONFIG_80211N_HT
+ struct ht_priv *phtpriv = &pmlmepriv->htpriv;
+#endif
+
+ //todo: if you want to do something io/reg/hw setting before join_bss, please add code here
-+
++
+
+
+
@@ -20373,7 +20359,7 @@ index 000000000000..00edd9cc6955
+ // TH=0 => means that validate usb rx aggregation, use init value.
+ if(phtpriv->ht_option)
+ {
-+ if(padapter->registrypriv.wifi_spec==1)
++ if(padapter->registrypriv.wifi_spec==1)
+ threshold = 1;
+ else
+ threshold = 0;
@@ -20386,14 +20372,14 @@ index 000000000000..00edd9cc6955
+ }
+#endif
+
-+#endif
++#endif
+
+}
+
+
+#ifdef CONFIG_80211N_HT
+
-+//the fucntion is >= passive_level
++//the fucntion is >= passive_level
+unsigned int rtw_restructure_ht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, uint in_len, uint *pout_len, u8 channel)
+{
+ u32 ielen, out_len;
@@ -20415,7 +20401,7 @@ index 000000000000..00edd9cc6955
+ if(pqospriv->qos_option == 0)
+ {
+ out_len = *pout_len;
-+ pframe = rtw_set_ie(out_ie+out_len, _VENDOR_SPECIFIC_IE_,
++ pframe = rtw_set_ie(out_ie+out_len, _VENDOR_SPECIFIC_IE_,
+ _WMM_IE_Length_, WMM_IE, pout_len);
+
+ pqospriv->qos_option = 1;
@@ -20439,7 +20425,7 @@ index 000000000000..00edd9cc6955
+
+ if ( cbw40_enable != 0 )
+ ht_capie.cap_info |= IEEE80211_HT_CAP_SUP_WIDTH | IEEE80211_HT_CAP_SGI_40;
-+
++
+
+
+ {
@@ -20451,44 +20437,44 @@ index 000000000000..00edd9cc6955
+ // ht_capie.cap_info = ht_capie.cap_info |IEEE80211_HT_CAP_MAX_AMSDU;
+ //}
+ }
-+
++
+ ht_capie.ampdu_params_info = (IEEE80211_HT_CAP_AMPDU_FACTOR&0x03);
+
+ if(padapter->securitypriv.dot11PrivacyAlgrthm == _AES_ )
+ ht_capie.ampdu_params_info |= (IEEE80211_HT_CAP_AMPDU_DENSITY&(0x07<<2));
+ else
-+ ht_capie.ampdu_params_info |= (IEEE80211_HT_CAP_AMPDU_DENSITY&0x00);
++ ht_capie.ampdu_params_info |= (IEEE80211_HT_CAP_AMPDU_DENSITY&0x00);
++
+
-+
-+ pframe = rtw_set_ie(out_ie+out_len, _HT_CAPABILITY_IE_,
++ pframe = rtw_set_ie(out_ie+out_len, _HT_CAPABILITY_IE_,
+ sizeof(struct rtw_ieee80211_ht_cap), (unsigned char*)&ht_capie, pout_len);
+
+
+ //_rtw_memcpy(out_ie+out_len, p, ielen+2);//gtest
+ //*pout_len = *pout_len + (ielen+2);
+
-+
++
+ phtpriv->ht_option = _TRUE;
+
+ p = rtw_get_ie(in_ie+12, _HT_ADD_INFO_IE_, &ielen, in_len-12);
+ if(p && (ielen==sizeof(struct ieee80211_ht_addt_info)))
+ {
-+ out_len = *pout_len;
++ out_len = *pout_len;
+ pframe = rtw_set_ie(out_ie+out_len, _HT_ADD_INFO_IE_, ielen, p+2 , pout_len);
+ }
+
+ }
-+
++
+ return (phtpriv->ht_option);
-+
++
+}
+
+//the fucntion is > passive_level (in critical_section)
+void rtw_update_ht_cap(_adapter *padapter, u8 *pie, uint ie_len, u8 channel)
-+{
++{
+ u8 *p, max_ampdu_sz;
-+ int len;
-+ //struct sta_info *bmc_sta, *psta;
++ int len;
++ //struct sta_info *bmc_sta, *psta;
+ struct rtw_ieee80211_ht_cap *pht_capie;
+ struct ieee80211_ht_addt_info *pht_addtinfo;
+ //struct recv_reorder_ctrl *preorder_ctrl;
@@ -20498,7 +20484,7 @@ index 000000000000..00edd9cc6955
+ struct registry_priv *pregistrypriv = &padapter->registrypriv;
+ //struct wlan_network *pcur_network = &(pmlmepriv->cur_network);;
+ struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
-+ struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
++ struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
+ u8 cbw40_enable=0;
+
+ if(!phtpriv->ht_option)
@@ -20527,25 +20513,25 @@ index 000000000000..00edd9cc6955
+ phtpriv->ampdu_enable = _TRUE;
+ }
+
-+
-+ //check Max Rx A-MPDU Size
++
++ //check Max Rx A-MPDU Size
+ len = 0;
+ p = rtw_get_ie(pie+sizeof (NDIS_802_11_FIXED_IEs), _HT_CAPABILITY_IE_, &len, ie_len-sizeof (NDIS_802_11_FIXED_IEs));
-+ if(p && len>0)
++ if(p && len>0)
+ {
+ pht_capie = (struct rtw_ieee80211_ht_cap *)(p+2);
+ max_ampdu_sz = (pht_capie->ampdu_params_info & IEEE80211_HT_CAP_AMPDU_FACTOR);
+ max_ampdu_sz = 1 << (max_ampdu_sz+3); // max_ampdu_sz (kbytes);
-+
++
+ //DBG_871X("rtw_update_ht_cap(): max_ampdu_sz=%d\n", max_ampdu_sz);
+ phtpriv->rx_ampdu_maxlen = max_ampdu_sz;
-+
++
+ }
+
+
+ len=0;
+ p = rtw_get_ie(pie+sizeof (NDIS_802_11_FIXED_IEs), _HT_ADD_INFO_IE_, &len, ie_len-sizeof (NDIS_802_11_FIXED_IEs));
-+ if(p && len>0)
++ if(p && len>0)
+ {
+ pht_addtinfo = (struct ieee80211_ht_addt_info *)(p+2);
+ //todo:
@@ -20563,7 +20549,7 @@ index 000000000000..00edd9cc6955
+
+ //update cur_bwmode & cur_ch_offset
+ if ((cbw40_enable) &&
-+ (pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info & BIT(1)) &&
++ (pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info & BIT(1)) &&
+ (pmlmeinfo->HT_info.infos[0] & BIT(2)))
+ {
+ int i;
@@ -20608,15 +20594,15 @@ index 000000000000..00edd9cc6955
+ case HT_EXTCHNL_OFFSET_UPPER:
+ pmlmeext->cur_ch_offset = HAL_PRIME_CHNL_OFFSET_LOWER;
+ break;
-+
++
+ case HT_EXTCHNL_OFFSET_LOWER:
+ pmlmeext->cur_ch_offset = HAL_PRIME_CHNL_OFFSET_UPPER;
+ break;
-+
++
+ default:
+ pmlmeext->cur_ch_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE;
+ break;
-+ }
++ }
+ }
+
+ //
@@ -20639,8 +20625,8 @@ index 000000000000..00edd9cc6955
+ //
+ pmlmeinfo->HT_protection = pmlmeinfo->HT_info.infos[1] & 0x3;
+
-+
-+
++
++
+#if 0 //move to rtw_update_sta_info_client()
+ //for A-MPDU Rx reordering buffer control for bmc_sta & sta_info
+ //if A-MPDU Rx is enabled, reseting rx_ordering_ctrl wstart_b(indicate_seq) to default value=0xffff
@@ -20680,7 +20666,7 @@ index 000000000000..00edd9cc6955
+ preorder_ctrl->wsize_b = 64;//max_ampdu_sz;//ex. 32(kbytes) -> wsize_b=32
+ }
+ }
-+#endif
++#endif
+
+}
+
@@ -20695,7 +20681,7 @@ index 000000000000..00edd9cc6955
+
+ if(bmcst || (padapter->mlmepriv.LinkDetectInfo.bTxBusyTraffic == _FALSE))
+ return;
-+
++
+ priority = pattrib->priority;
+
+ if (pattrib->psta)
@@ -20704,8 +20690,8 @@ index 000000000000..00edd9cc6955
+ {
+ DBG_871X("%s, call rtw_get_stainfo()\n", __func__);
+ psta = rtw_get_stainfo(&padapter->stapriv, pattrib->ra);
-+ }
-+
++ }
++
+ if(psta==NULL)
+ {
+ DBG_871X("%s, psta==NUL\n", __func__);
@@ -20716,12 +20702,12 @@ index 000000000000..00edd9cc6955
+ {
+ DBG_871X("%s, psta->state(0x%x) != _FW_LINKED\n", __func__, psta->state);
+ return;
-+ }
++ }
++
+
-+
+ phtpriv = &psta->htpriv;
+
-+ if((phtpriv->ht_option==_TRUE) && (phtpriv->ampdu_enable==_TRUE))
++ if((phtpriv->ht_option==_TRUE) && (phtpriv->ampdu_enable==_TRUE))
+ {
+ issued = (phtpriv->agg_enable_bitmap>>priority)&0x1;
+ issued |= (phtpriv->candidate_tid_bitmap>>priority)&0x1;
@@ -20733,7 +20719,7 @@ index 000000000000..00edd9cc6955
+ rtw_addbareq_cmd(padapter,(u8) priority, pattrib->ra);
+ }
+ }
-+
++
+}
+
+#endif
@@ -20771,7 +20757,7 @@ index 000000000000..00edd9cc6955
+ pnetwork = tgt_network;
+ else
+ pnetwork = &pmlmepriv->cur_network;
-+
++
+ if(0 < rtw_to_roaming(padapter)) {
+ DBG_871X("roaming from %s("MAC_FMT"), length:%d\n",
+ pnetwork->network.Ssid.Ssid, MAC_ARG(pnetwork->network.MacAddress),
@@ -20786,7 +20772,7 @@ index 000000000000..00edd9cc6955
+ } else {
+ DBG_871X("roaming do_join return %d\n", do_join_r);
+ pmlmepriv->to_roaming--;
-+
++
+ if(0< rtw_to_roaming(padapter)) {
+ continue;
+ } else {
@@ -20797,15 +20783,15 @@ index 000000000000..00edd9cc6955
+ }
+ }
+ }
-+
++
+}
+#endif
+
+#ifdef CONFIG_CONCURRENT_MODE
+sint rtw_buddy_adapter_up(_adapter *padapter)
-+{
++{
+ sint res = _FALSE;
-+
++
+ if(padapter == NULL)
+ return res;
+
@@ -20816,47 +20802,46 @@ index 000000000000..00edd9cc6955
+ }
+ else if( (padapter->pbuddy_adapter->bDriverStopped) || (padapter->pbuddy_adapter->bSurpriseRemoved) ||
+ (padapter->pbuddy_adapter->bup == _FALSE) || (padapter->pbuddy_adapter->hw_init_completed == _FALSE))
-+ {
++ {
+ res = _FALSE;
+ }
+ else
+ {
+ res = _TRUE;
-+ }
++ }
+
-+ return res;
++ return res;
+
+}
+
+sint check_buddy_fwstate(_adapter *padapter, sint state)
+{
+ if(padapter == NULL)
-+ return _FALSE;
-+
++ return _FALSE;
++
+ if(padapter->pbuddy_adapter == NULL)
-+ return _FALSE;
-+
-+ if ((state == WIFI_FW_NULL_STATE) &&
++ return _FALSE;
++
++ if ((state == WIFI_FW_NULL_STATE) &&
+ (padapter->pbuddy_adapter->mlmepriv.fw_state == WIFI_FW_NULL_STATE))
+ return _TRUE;
-+
++
+ if (padapter->pbuddy_adapter->mlmepriv.fw_state & state)
+ return _TRUE;
+
+ return _FALSE;
+}
+#endif //CONFIG_CONCURRENT_MODE
-+
diff --git a/drivers/net/wireless/realtek/rtl8192cu/core/rtw_mlme_ext.c b/drivers/net/wireless/realtek/rtl8192cu/core/rtw_mlme_ext.c
new file mode 100755
-index 000000000000..e20c116a9cf8
+index 000000000000..6ea526106fcd
--- /dev/null
+++ b/drivers/net/wireless/realtek/rtl8192cu/core/rtw_mlme_ext.c
-@@ -0,0 +1,13600 @@
+@@ -0,0 +1,13599 @@
+/******************************************************************************
+ *
+ * Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved.
-+ *
++ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
@@ -20944,8 +20929,8 @@ index 000000000000..e20c116a9cf8
+ //add for CONFIG_IEEE80211W
+ {RTW_WLAN_CATEGORY_UNPROTECTED_WNM, "ACTION_UNPROTECTED_WNM", &DoReserved},
+ {RTW_WLAN_CATEGORY_SELF_PROTECTED, "ACTION_SELF_PROTECTED", &DoReserved},
-+ {RTW_WLAN_CATEGORY_WMM, "ACTION_WMM", &OnAction_wmm},
-+ {RTW_WLAN_CATEGORY_P2P, "ACTION_P2P", &OnAction_p2p},
++ {RTW_WLAN_CATEGORY_WMM, "ACTION_WMM", &OnAction_wmm},
++ {RTW_WLAN_CATEGORY_P2P, "ACTION_P2P", &OnAction_p2p},
+};
+
+
@@ -21116,7 +21101,7 @@ index 000000000000..e20c116a9cf8
+ * Search the @param ch in given @param ch_set
+ * @ch_set: the given channel set
+ * @ch: the given channel number
-+ *
++ *
+ * return the index of channel_num in channel_set, -1 if not found
+ */
+int rtw_ch_set_search_ch(RT_CHANNEL_INFO *ch_set, const u32 ch)
@@ -21126,7 +21111,7 @@ index 000000000000..e20c116a9cf8
+ if(ch == ch_set[i].ChannelNum)
+ break;
+ }
-+
++
+ if(i >= ch_set[i].ChannelNum)
+ return -1;
+ return i;
@@ -21136,7 +21121,7 @@ index 000000000000..e20c116a9cf8
+ * Check the @param ch is fit with setband setting of @param adapter
+ * @adapter: the given adapter
+ * @ch: the given channel number
-+ *
++ *
+ * return _TRUE when check valid, _FALSE not valid
+ */
+bool rtw_mlme_band_check(_adapter *adapter, const u32 ch)
@@ -21284,7 +21269,7 @@ index 000000000000..e20c116a9cf8
+ if ((0 == (padapter->registrypriv.cbw40_enable & BIT(1))) &&
+ ((BW40MINUS == o->bw) || (BW40PLUS == o->bw)))
+ continue;
-+
++
+ if (reg == NULL) {
+ reg = &channel_list->reg_class[cla];
+ cla++;
@@ -21342,7 +21327,7 @@ index 000000000000..e20c116a9cf8
+ if(channel_set[chanset_size].ChannelNum >= 1 && channel_set[chanset_size].ChannelNum <= 11)
+ channel_set[chanset_size].ScanType = SCAN_ACTIVE;
+ else if((channel_set[chanset_size].ChannelNum >= 12 && channel_set[chanset_size].ChannelNum <= 14))
-+ channel_set[chanset_size].ScanType = SCAN_PASSIVE;
++ channel_set[chanset_size].ScanType = SCAN_PASSIVE;
+ }
+ else if(RT_CHANNEL_DOMAIN_WORLD_WIDE_13 == ChannelPlan ||
+ RT_CHANNEL_DOMAIN_WORLD_WIDE_5G == ChannelPlan ||
@@ -21368,7 +21353,7 @@ index 000000000000..e20c116a9cf8
+ {
+#ifdef CONFIG_DFS
+ channel_set[chanset_size].ChannelNum = RTW_ChannelPlan5G[Index5G].Channel[index];
-+ if ( channel_set[chanset_size].ChannelNum <= 48
++ if ( channel_set[chanset_size].ChannelNum <= 48
+ || channel_set[chanset_size].ChannelNum >= 149 )
+ {
+ if(RT_CHANNEL_DOMAIN_WORLD_WIDE_5G == ChannelPlan)//passive scan for all 5G channels
@@ -21382,7 +21367,7 @@ index 000000000000..e20c116a9cf8
+ }
+ chanset_size++;
+#else /* CONFIG_DFS */
-+ if ( RTW_ChannelPlan5G[Index5G].Channel[index] <= 48
++ if ( RTW_ChannelPlan5G[Index5G].Channel[index] <= 48
+ || RTW_ChannelPlan5G[Index5G].Channel[index] >= 149 ) {
+ channel_set[chanset_size].ChannelNum = RTW_ChannelPlan5G[Index5G].Channel[index];
+ if(RT_CHANNEL_DOMAIN_WORLD_WIDE_5G == ChannelPlan)//passive scan for all 5G channels
@@ -21416,21 +21401,21 @@ index 000000000000..e20c116a9cf8
+
+ init_mlme_ext_priv_value(padapter);
+ pmlmeinfo->bAcceptAddbaReq = pregistrypriv->bAcceptAddbaReq;
-+
++
+ init_mlme_ext_timer(padapter);
+
+#ifdef CONFIG_AP_MODE
-+ init_mlme_ap_info(padapter);
++ init_mlme_ap_info(padapter);
+#endif
+
+ pmlmeext->max_chan_nums = init_channel_set(padapter, pmlmepriv->ChannelPlan,pmlmeext->channel_set);
+ init_channel_list(padapter, pmlmeext->channel_set, pmlmeext->max_chan_nums, &pmlmeext->channel_list);
-+
++
+ pmlmeext->chan_scan_time = SURVEY_TO;
+ pmlmeext->mlmeext_init = _TRUE;
+
+
-+#ifdef CONFIG_ACTIVE_KEEP_ALIVE_CHECK
++#ifdef CONFIG_ACTIVE_KEEP_ALIVE_CHECK
+ pmlmeext->active_keep_alive_check = _TRUE;
+#endif
+
@@ -21454,46 +21439,46 @@ index 000000000000..e20c116a9cf8
+}
+
+static u8 cmp_pkt_chnl_diff(_adapter *padapter,u8* pframe,uint packet_len)
-+{ // if the channel is same, return 0. else return channel differential
++{ // if the channel is same, return 0. else return channel differential
+ uint len;
-+ u8 channel;
-+ u8 *p;
-+ p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + _BEACON_IE_OFFSET_, _DSSET_IE_, &len, packet_len - _BEACON_IE_OFFSET_);
-+ if (p)
-+ {
-+ channel = *(p + 2);
-+ if(padapter->mlmeextpriv.cur_channel >= channel)
-+ {
-+ return (padapter->mlmeextpriv.cur_channel - channel);
-+ }
-+ else
-+ {
-+ return (channel-padapter->mlmeextpriv.cur_channel);
-+ }
-+ }
-+ else
-+ {
-+ return 0;
++ u8 channel;
++ u8 *p;
++ p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + _BEACON_IE_OFFSET_, _DSSET_IE_, &len, packet_len - _BEACON_IE_OFFSET_);
++ if (p)
++ {
++ channel = *(p + 2);
++ if(padapter->mlmeextpriv.cur_channel >= channel)
++ {
++ return (padapter->mlmeextpriv.cur_channel - channel);
++ }
++ else
++ {
++ return (channel-padapter->mlmeextpriv.cur_channel);
++ }
++ }
++ else
++ {
++ return 0;
+ }
+}
+
+static void _mgt_dispatcher(_adapter *padapter, struct mlme_handler *ptable, union recv_frame *precv_frame)
+{
+ u8 bc_addr[ETH_ALEN] = {0xff,0xff,0xff,0xff,0xff,0xff};
-+ u8 *pframe = precv_frame->u.hdr.rx_data;
++ u8 *pframe = precv_frame->u.hdr.rx_data;
+
+ if(ptable->func)
+ {
-+ //receive the frames that ra(a1) is my address or ra(a1) is bc address.
++ //receive the frames that ra(a1) is my address or ra(a1) is bc address.
+ if (!_rtw_memcmp(GetAddr1Ptr(pframe), myid(&padapter->eeprompriv), ETH_ALEN) &&
-+ !_rtw_memcmp(GetAddr1Ptr(pframe), bc_addr, ETH_ALEN))
++ !_rtw_memcmp(GetAddr1Ptr(pframe), bc_addr, ETH_ALEN))
+ {
+ return;
+ }
-+
++
+ ptable->func(padapter, precv_frame);
+ }
-+
++
+}
+
+void mgt_dispatcher(_adapter *padapter, union recv_frame *precv_frame)
@@ -21583,7 +21568,7 @@ index 000000000000..e20c116a9cf8
+#endif
+
+#ifdef CONFIG_AP_MODE
-+ switch (GetFrameSubType(pframe))
++ switch (GetFrameSubType(pframe))
+ {
+ case WIFI_AUTH:
+ if(check_fwstate(pmlmepriv, WIFI_AP_STATE) == _TRUE)
@@ -21593,17 +21578,17 @@ index 000000000000..e20c116a9cf8
+ //pass through
+ case WIFI_ASSOCREQ:
+ case WIFI_REASSOCREQ:
-+ _mgt_dispatcher(padapter, ptable, precv_frame);
-+#ifdef CONFIG_HOSTAPD_MLME
++ _mgt_dispatcher(padapter, ptable, precv_frame);
++#ifdef CONFIG_HOSTAPD_MLME
+ if(check_fwstate(pmlmepriv, WIFI_AP_STATE) == _TRUE)
+ rtw_hostapd_mlme_rx(padapter, precv_frame);
-+#endif
++#endif
+ break;
+ case WIFI_PROBEREQ:
+ if(check_fwstate(pmlmepriv, WIFI_AP_STATE) == _TRUE)
+ {
-+#ifdef CONFIG_HOSTAPD_MLME
-+ rtw_hostapd_mlme_rx(padapter, precv_frame);
++#ifdef CONFIG_HOSTAPD_MLME
++ rtw_hostapd_mlme_rx(padapter, precv_frame);
+#else
+ _mgt_dispatcher(padapter, ptable, precv_frame);
+#endif
@@ -21611,23 +21596,23 @@ index 000000000000..e20c116a9cf8
+ else
+ _mgt_dispatcher(padapter, ptable, precv_frame);
+ break;
-+ case WIFI_BEACON:
++ case WIFI_BEACON:
+ _mgt_dispatcher(padapter, ptable, precv_frame);
+ break;
+ case WIFI_ACTION:
+ //if(check_fwstate(pmlmepriv, WIFI_AP_STATE) == _TRUE)
-+ _mgt_dispatcher(padapter, ptable, precv_frame);
++ _mgt_dispatcher(padapter, ptable, precv_frame);
+ break;
+ default:
-+ _mgt_dispatcher(padapter, ptable, precv_frame);
++ _mgt_dispatcher(padapter, ptable, precv_frame);
+ if(check_fwstate(pmlmepriv, WIFI_AP_STATE) == _TRUE)
-+ rtw_hostapd_mlme_rx(padapter, precv_frame);
++ rtw_hostapd_mlme_rx(padapter, precv_frame);
+ break;
+ }
+#else
+
-+ _mgt_dispatcher(padapter, ptable, precv_frame);
-+
++ _mgt_dispatcher(padapter, ptable, precv_frame);
++
+#endif
+
+}
@@ -21665,7 +21650,7 @@ index 000000000000..e20c116a9cf8
+
+ if (response == _TRUE)
+ issue_probersp_p2p( padapter, da);
-+
++
+ return _SUCCESS;
+}
+#endif //CONFIG_P2P
@@ -21693,9 +21678,9 @@ index 000000000000..e20c116a9cf8
+ struct wifidirect_info *pwdinfo = &(padapter->wdinfo);
+ struct rx_pkt_attrib *pattrib = &precv_frame->u.hdr.attrib;
+ u8 wifi_test_chk_rate = 1;
-+
-+ if ( !rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE) &&
-+ !rtw_p2p_chk_state(pwdinfo, P2P_STATE_IDLE) &&
++
++ if ( !rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE) &&
++ !rtw_p2p_chk_state(pwdinfo, P2P_STATE_IDLE) &&
+ !rtw_p2p_chk_role(pwdinfo, P2P_ROLE_CLIENT) &&
+ !rtw_p2p_chk_state(pwdinfo, P2P_STATE_FIND_PHASE_SEARCH) &&
+ !rtw_p2p_chk_state(pwdinfo, P2P_STATE_SCAN)
@@ -21725,7 +21710,7 @@ index 000000000000..e20c116a9cf8
+ {
+ p2p_listen_state_process( padapter, get_sa(pframe));
+
-+ return _SUCCESS;
++ return _SUCCESS;
+ }
+
+ if(rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO))
@@ -21744,7 +21729,7 @@ index 000000000000..e20c116a9cf8
+ return _SUCCESS;
+ }
+
-+ if(check_fwstate(pmlmepriv, _FW_LINKED) == _FALSE &&
++ if(check_fwstate(pmlmepriv, _FW_LINKED) == _FALSE &&
+ check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE|WIFI_AP_STATE)==_FALSE)
+ {
+ return _SUCCESS;
@@ -21833,7 +21818,7 @@ index 000000000000..e20c116a9cf8
+ DBG_871X("allocate new AID = (%d)\n", psta->aid);
+ }
+ }
-+
++
+ psta->qos_option = 1;
+ psta->htpriv.ht_option = _TRUE;
+ psta->ieee8021x_blocked = _FALSE;
@@ -21876,13 +21861,13 @@ index 000000000000..e20c116a9cf8
+ //don't process probe req
+ return _SUCCESS;
+ }
-+#endif
++#endif
+
+ p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + _PROBEREQ_IE_OFFSET_, _SSID_IE_, (int *)&ielen,
+ len - WLAN_HDR_A3_LEN - _PROBEREQ_IE_OFFSET_);
+
+
-+ //check (wildcard) SSID
++ //check (wildcard) SSID
+ if (p != NULL)
+ {
+ if(is_valid_p2p_probereq == _TRUE)
@@ -21899,11 +21884,11 @@ index 000000000000..e20c116a9cf8
+
+_issue_probersp:
+
-+ if(check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE &&
++ if(check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE &&
+ pmlmepriv->cur_network.join_res == _TRUE)
+ {
+ //DBG_871X("+issue_probersp during ap mode\n");
-+ issue_probersp(padapter, get_sa(pframe), is_valid_p2p_probereq);
++ issue_probersp(padapter, get_sa(pframe), is_valid_p2p_probereq);
+ }
+
+ }
@@ -21935,7 +21920,7 @@ index 000000000000..e20c116a9cf8
+ {
+ pwdinfo->tx_prov_disc_info.benable = _FALSE;
+ issue_p2p_provision_request( padapter,
-+ pwdinfo->tx_prov_disc_info.ssid.Ssid,
++ pwdinfo->tx_prov_disc_info.ssid.Ssid,
+ pwdinfo->tx_prov_disc_info.ssid.SsidLength,
+ pwdinfo->tx_prov_disc_info.peerDevAddr );
+ }
@@ -21943,11 +21928,11 @@ index 000000000000..e20c116a9cf8
+ {
+ pwdinfo->tx_prov_disc_info.benable = _FALSE;
+ issue_p2p_provision_request( padapter,
-+ NULL,
++ NULL,
+ 0,
+ pwdinfo->tx_prov_disc_info.peerDevAddr );
+ }
-+ }
++ }
+ }
+ return _SUCCESS;
+ }
@@ -21980,9 +21965,9 @@ index 000000000000..e20c116a9cf8
+
+ if (pmlmeext->sitesurvey_res.state == SCAN_PROCESS)
+ {
-+ report_survey_event(padapter, precv_frame);
++ report_survey_event(padapter, precv_frame);
+#ifdef CONFIG_CONCURRENT_MODE
-+ report_survey_event(padapter->pbuddy_adapter, precv_frame);
++ report_survey_event(padapter->pbuddy_adapter, precv_frame);
+#endif
+#ifdef CONFIG_DUALMAC_CONCURRENT
+ dc_report_survey_event(padapter, precv_frame);
@@ -22002,9 +21987,9 @@ index 000000000000..e20c116a9cf8
+ }
+ }
+ #endif
-+
++
+ return _SUCCESS;
-+
++
+}
+
+unsigned int OnBeacon(_adapter *padapter, union recv_frame *precv_frame)
@@ -22025,9 +22010,9 @@ index 000000000000..e20c116a9cf8
+ {
+ if ((*(p + 1 + ielen) == 0x2D) && (*(p + 2 + ielen) != 0x2D))
+ {
-+ /* Invalid value 0x2D is detected in Extended Supported Rates (ESR) IE. Try to fix the IE length to avoid failed Beacon parsing. */
-+ DBG_871X("[WIFIDBG] Error in ESR IE is detected in Beacon of BSSID:"MAC_FMT". Fix the length of ESR IE to avoid failed Beacon parsing.\n", MAC_ARG(GetAddr3Ptr(pframe)));
-+ *(p + 1) = ielen - 1;
++ /* Invalid value 0x2D is detected in Extended Supported Rates (ESR) IE. Try to fix the IE length to avoid failed Beacon parsing. */
++ DBG_871X("[WIFIDBG] Error in ESR IE is detected in Beacon of BSSID:"MAC_FMT". Fix the length of ESR IE to avoid failed Beacon parsing.\n", MAC_ARG(GetAddr3Ptr(pframe)));
++ *(p + 1) = ielen - 1;
+ }
+ }
+#endif
@@ -22036,7 +22021,7 @@ index 000000000000..e20c116a9cf8
+ {
+ report_survey_event(padapter, precv_frame);
+#ifdef CONFIG_CONCURRENT_MODE
-+ report_survey_event(padapter->pbuddy_adapter, precv_frame);
++ report_survey_event(padapter->pbuddy_adapter, precv_frame);
+#endif
+
+#ifdef CONFIG_DUALMAC_CONCURRENT
@@ -22051,7 +22036,7 @@ index 000000000000..e20c116a9cf8
+ if (pmlmeinfo->state & WIFI_FW_AUTH_NULL)
+ {
+ //check the vendor of the assoc AP
-+ pmlmeinfo->assoc_AP_vendor = check_assoc_AP(pframe+sizeof(struct rtw_ieee80211_hdr_3addr), len-sizeof(struct rtw_ieee80211_hdr_3addr));
++ pmlmeinfo->assoc_AP_vendor = check_assoc_AP(pframe+sizeof(struct rtw_ieee80211_hdr_3addr), len-sizeof(struct rtw_ieee80211_hdr_3addr));
+#ifdef CONFIG_P2P_PS
+ // do P2P PS Before link ? , ToDo
+ //process_p2p_ps_ie(padapter, (pframe + WLAN_HDR_A3_LEN), (len - WLAN_HDR_A3_LEN));
@@ -22070,16 +22055,16 @@ index 000000000000..e20c116a9cf8
+ {
+ if ((psta = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe))) != NULL)
+ {
-+ #ifdef CONFIG_PATCH_JOIN_WRONG_CHANNEL
++ #ifdef CONFIG_PATCH_JOIN_WRONG_CHANNEL
+ //Merge from 8712 FW code
-+ if (cmp_pkt_chnl_diff(padapter,pframe,len) != 0)
-+ { // join wrong channel, deauth and reconnect
++ if (cmp_pkt_chnl_diff(padapter,pframe,len) != 0)
++ { // join wrong channel, deauth and reconnect
+ issue_deauth(padapter, (&(pmlmeinfo->network))->MacAddress, WLAN_REASON_DEAUTH_LEAVING);
+
-+ report_del_sta_event(padapter,(&(pmlmeinfo->network))->MacAddress, WLAN_REASON_JOIN_WRONG_CHANNEL);
-+ pmlmeinfo->state &= (~WIFI_FW_ASSOC_SUCCESS);
++ report_del_sta_event(padapter,(&(pmlmeinfo->network))->MacAddress, WLAN_REASON_JOIN_WRONG_CHANNEL);
++ pmlmeinfo->state &= (~WIFI_FW_ASSOC_SUCCESS);
+ return _SUCCESS;
-+ }
++ }
+ #endif //CONFIG_PATCH_JOIN_WRONG_CHANNEL
+
+ //update WMM, ERP in the beacon
@@ -22089,7 +22074,7 @@ index 000000000000..e20c116a9cf8
+ //DBG_871X("update_bcn_info\n");
+ update_beacon_info(padapter, pframe, len, psta);
+ }
-+
++++
+#ifdef CONFIG_DFS
+ process_csa_ie(padapter, pframe, len); //channel switch announcement
+#endif //CONFIG_DFS
@@ -22136,7 +22121,7 @@ index 000000000000..e20c116a9cf8
+ }
+
+ //update TSF Value
-+ update_TSF(pmlmeext, pframe, len);
++ update_TSF(pmlmeext, pframe, len);
+
+ //report sta add event
+ report_add_sta_event(padapter, GetAddr2Ptr(pframe), cam_idx);
@@ -22154,21 +22139,21 @@ index 000000000000..e20c116a9cf8
+{ +{
+#ifdef CONFIG_AP_MODE
+ _irqL irqL;
-+ unsigned int auth_mode, seq, ie_len;
-+ unsigned char *sa, *p;
++ unsigned int auth_mode, seq, ie_len;
++ unsigned char *sa, *p;
+ u16 algorithm;
+ int status;
-+ static struct sta_info stat;
-+ struct sta_info *pstat=NULL;
++ static struct sta_info stat;
++ struct sta_info *pstat=NULL;
+ struct sta_priv *pstapriv = &padapter->stapriv;
+ struct security_priv *psecuritypriv = &padapter->securitypriv;
+ struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
+ struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
-+ u8 *pframe = precv_frame->u.hdr.rx_data;
++ u8 *pframe = precv_frame->u.hdr.rx_data;
+ uint len = precv_frame->u.hdr.len;
+
-+
-+#ifdef CONFIG_CONCURRENT_MODE
++
++#ifdef CONFIG_CONCURRENT_MODE
+ if(((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE) &&
+ check_buddy_fwstate(padapter, _FW_UNDER_LINKING|_FW_UNDER_SURVEY))
+ {
@@ -22181,15 +22166,15 @@ index 000000000000..e20c116a9cf8
+ return _FAIL;
+
+ DBG_871X("+OnAuth\n");
-+
++
+ sa = GetAddr2Ptr(pframe);
-+
++
+ auth_mode = psecuritypriv->dot11AuthAlgrthm;
+ seq = cpu_to_le16(*(u16*)((SIZE_PTR)pframe + WLAN_HDR_A3_LEN + 2));
+ algorithm = cpu_to_le16(*(u16*)((SIZE_PTR)pframe + WLAN_HDR_A3_LEN));
+
+ if (GetPrivacy(pframe))
-+ {
++ {
+#if 0 //TODO: SW rtw_wep_decrypt
+ if (SWCRYPTO)
+ {
@@ -22219,16 +22204,16 @@ index 000000000000..e20c116a9cf8
+
+ if ((algorithm > 0 && auth_mode == 0) || // rx a shared-key auth but shared not enabled
+ (algorithm == 0 && auth_mode == 1) ) // rx a open-system auth but shared-key is enabled
-+ {
++ {
+ DBG_871X("auth rejected due to bad alg [alg=%d, auth_mib=%d] %02X%02X%02X%02X%02X%02X\n",
+ algorithm, auth_mode, sa[0], sa[1], sa[2], sa[3], sa[4], sa[5]);
-+
++
+ status = _STATS_NO_SUPP_ALG_;
-+
++
+ goto auth_fail;
+ }
-+
-+#if 0 //ACL control
++
++#if 0 //ACL control
+ phead = &priv->wlan_acl_list;
+ plist = phead->next;
+ //check sa
@@ -22262,7 +22247,7 @@ index 000000000000..e20c116a9cf8
+ {
+ status = _STATS_UNABLE_HANDLE_STA_;
+ goto auth_fail;
-+ }
++ }
+#endif
+
+ pstat = rtw_get_stainfo(pstapriv, sa);
@@ -22277,18 +22262,18 @@ index 000000000000..e20c116a9cf8
+ status = _STATS_UNABLE_HANDLE_STA_;
+ goto auth_fail;
+ }
-+
++
+ pstat->state = WIFI_FW_AUTH_NULL;
+ pstat->auth_seq = 0;
-+
++
+ //pstat->flags = 0;
+ //pstat->capability = 0;
+ }
+ else
-+ {
++ {
+ _enter_critical_bh(&pstapriv->asoc_list_lock, &irqL);
+ if(rtw_is_list_empty(&pstat->asoc_list)==_FALSE)
-+ {
++ {
+ rtw_list_delete(&pstat->asoc_list);
+ pstapriv->asoc_list_cnt--;
+ if (pstat->expire_to > 0)
@@ -22297,18 +22282,18 @@ index 000000000000..e20c116a9cf8
+ }
+ }
+ _exit_critical_bh(&pstapriv->asoc_list_lock, &irqL);
-+
++
+ if (seq==1) {
-+ //TODO: STA re_auth and auth timeout
++ //TODO: STA re_auth and auth timeout
+ }
+ }
+
+ _enter_critical_bh(&pstapriv->auth_list_lock, &irqL);
+ if (rtw_is_list_empty(&pstat->auth_list))
-+ {
++ {
+ rtw_list_insert_tail(&pstat->auth_list, &pstapriv->auth_list);
+ pstapriv->auth_list_cnt++;
-+ }
++ }
+ _exit_critical_bh(&pstapriv->auth_list_lock, &irqL);
+
+ if (pstat->auth_seq == 0)
@@ -22344,9 +22329,9 @@ index 000000000000..e20c116a9cf8
+ if (seq == 1)
+ {
+ //prepare for the challenging txt...
-+
++
+ //get_random_bytes((void *)pstat->chg_txt, 128);//TODO:
-+
++
+ pstat->state &= ~WIFI_FW_AUTH_NULL;
+ pstat->state |= WIFI_FW_AUTH_STATE;
+ pstat->authalg = algorithm;
@@ -22356,7 +22341,7 @@ index 000000000000..e20c116a9cf8
+ {
+ //checking for challenging txt...
+ DBG_871X("checking for challenging txt...\n");
-+
++
+ p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + 4 + _AUTH_IE_OFFSET_ , _CHLGETXT_IE_, (int *)&ie_len,
+ len - WLAN_HDR_A3_LEN - _AUTH_IE_OFFSET_ - 4);
+
@@ -22366,7 +22351,7 @@ index 000000000000..e20c116a9cf8
+ status = _STATS_CHALLENGE_FAIL_;
+ goto auth_fail;
+ }
-+
++
+ if (_rtw_memcmp((void *)(p + 2), pstat->chg_txt, 128))
+ {
+ pstat->state &= (~WIFI_FW_AUTH_STATE);
@@ -22392,8 +22377,8 @@ index 000000000000..e20c116a9cf8
+
+
+ // Now, we are going to issue_auth...
-+ pstat->auth_seq = seq + 1;
-+
++ pstat->auth_seq = seq + 1;
++
+#ifdef CONFIG_NATIVEAP_MLME
+ issue_auth(padapter, pstat, (unsigned short)(_STATS_SUCCESSFUL_));
+#endif
@@ -22401,21 +22386,21 @@ index 000000000000..e20c116a9cf8
+ if (pstat->state & WIFI_FW_AUTH_SUCCESS)
+ pstat->auth_seq = 0;
+
-+
++
+ return _SUCCESS;
+
+auth_fail:
+
+ if(pstat)
+ rtw_free_stainfo(padapter , pstat);
-+
++
+ pstat = &stat;
+ _rtw_memset((char *)pstat, '\0', sizeof(stat));
+ pstat->auth_seq = 2;
-+ _rtw_memcpy(pstat->hwaddr, sa, 6);
-+
++ _rtw_memcpy(pstat->hwaddr, sa, 6);
++
+#ifdef CONFIG_NATIVEAP_MLME
-+ issue_auth(padapter, pstat, (unsigned short)status);
++ issue_auth(padapter, pstat, (unsigned short)status);
+#endif
+
+#endif
@@ -22459,7 +22444,7 @@ index 000000000000..e20c116a9cf8
+ pmlmeinfo->auth_algo = dot11AuthAlgrthm_Shared;
+ //pmlmeinfo->reauth_count = 0;
+ }
-+
++
+ set_link_timer(pmlmeext, 1);
+ goto authclnt_fail;
+ }
@@ -22528,7 +22513,7 @@ index 000000000000..e20c116a9cf8
+#ifdef CONFIG_AP_MODE
+ _irqL irqL;
+ u16 capab_info, listen_interval;
-+ struct rtw_ieee802_11_elems elems;
++ struct rtw_ieee802_11_elems elems;
+ struct sta_info *pstat;
+ unsigned char reassoc, *p, *pos, *wpa_ie;
+ unsigned char WMM_IE[] = {0x00, 0x50, 0xf2, 0x02, 0x00, 0x01};
@@ -22536,11 +22521,11 @@ index 000000000000..e20c116a9cf8
+ unsigned char supportRate[16];
+ int supportRateNum;
+ unsigned short status = _STATS_SUCCESSFUL_;
-+ unsigned short frame_type, ie_offset=0;
++ unsigned short frame_type, ie_offset=0;
+ struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
+ struct security_priv *psecuritypriv = &padapter->securitypriv;
+ struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
-+ struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
++ struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
+ WLAN_BSSID_EX *cur = &(pmlmeinfo->network);
+ struct sta_priv *pstapriv = &padapter->stapriv;
+ u8 *pframe = precv_frame->u.hdr.rx_data;
@@ -22567,26 +22552,26 @@ index 000000000000..e20c116a9cf8
+
+ if((pmlmeinfo->state&0x03) != WIFI_FW_AP_STATE)
+ return _FAIL;
-+
++
+ frame_type = GetFrameSubType(pframe);
+ if (frame_type == WIFI_ASSOCREQ)
+ {
+ reassoc = 0;
+ ie_offset = _ASOCREQ_IE_OFFSET_;
-+ }
++ }
+ else // WIFI_REASSOCREQ
+ {
+ reassoc = 1;
+ ie_offset = _REASOCREQ_IE_OFFSET_;
+ }
-+
++
+
+ if (pkt_len < IEEE80211_3ADDR_LEN + ie_offset) {
+ DBG_871X("handle_assoc(reassoc=%d) - too short payload (len=%lu)"
+ "\n", reassoc, (unsigned long)pkt_len);
+ return _FAIL;
+ }
-+
++
+ pstat = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe));
+ if (pstat == (struct sta_info *)NULL)
+ {
@@ -22595,13 +22580,13 @@ index 000000000000..e20c116a9cf8
+ }
+
+ capab_info = RTW_GET_LE16(pframe + WLAN_HDR_A3_LEN);
-+ //capab_info = le16_to_cpu(*(unsigned short *)(pframe + WLAN_HDR_A3_LEN));
++ //capab_info = le16_to_cpu(*(unsigned short *)(pframe + WLAN_HDR_A3_LEN));
+ //listen_interval = le16_to_cpu(*(unsigned short *)(pframe + WLAN_HDR_A3_LEN+2));
+ listen_interval = RTW_GET_LE16(pframe + WLAN_HDR_A3_LEN+2);
+
+ left = pkt_len - (IEEE80211_3ADDR_LEN + ie_offset);
+ pos = pframe + (IEEE80211_3ADDR_LEN + ie_offset);
-+
++
+
+ DBG_871X("%s\n", __FUNCTION__);
+
@@ -22616,7 +22601,7 @@ index 000000000000..e20c116a9cf8
+ else
+ {
+ pstat->state &= (~WIFI_FW_ASSOC_SUCCESS);
-+ pstat->state |= WIFI_FW_ASSOC_STATE;
++ pstat->state |= WIFI_FW_ASSOC_STATE;
+ }
+ }
+ else
@@ -22645,7 +22630,7 @@ index 000000000000..e20c116a9cf8
+ resp = WLAN_STATUS_ASSOC_DENIED_LISTEN_INT_TOO_LARGE;
+ goto fail;
+ }
-+
++
+ pstat->listen_interval = listen_interval;
+#endif
+
@@ -22654,7 +22639,7 @@ index 000000000000..e20c116a9cf8
+ !elems.ssid) {
+ DBG_871X("STA " MAC_FMT " sent invalid association request\n",
+ MAC_ARG(pstat->hwaddr));
-+ status = _STATS_FAILURE_;
++ status = _STATS_FAILURE_;
+ goto OnAssocReqFail;
+ }
+
@@ -22665,7 +22650,7 @@ index 000000000000..e20c116a9cf8
+ pkt_len - WLAN_HDR_A3_LEN - ie_offset);
+ if (p == NULL)
+ {
-+ status = _STATS_FAILURE_;
++ status = _STATS_FAILURE_;
+ }
+
+ if (ie_len == 0) // broadcast ssid, however it is not allowed in assocreq
@@ -22690,7 +22675,7 @@ index 000000000000..e20c116a9cf8
+ // use our own rate set as statoin used
+ //_rtw_memcpy(supportRate, AP_BSSRATE, AP_BSSRATE_LEN);
+ //supportRateNum = AP_BSSRATE_LEN;
-+
++
+ status = _STATS_FAILURE_;
+ goto OnAssocReqFail;
+ }
@@ -22701,26 +22686,26 @@ index 000000000000..e20c116a9cf8
+ p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + ie_offset, _EXT_SUPPORTEDRATES_IE_ , &ie_len,
+ pkt_len - WLAN_HDR_A3_LEN - ie_offset);
+ if (p != NULL) {
-+
++
+ if(supportRateNum<=sizeof(supportRate))
+ {
+ _rtw_memcpy(supportRate+supportRateNum, p+2, ie_len);
+ supportRateNum += ie_len;
-+ }
++ }
+ }
+ }
+
+ //todo: mask supportRate between AP & STA -> move to update raid
+ //get_matched_rate(pmlmeext, supportRate, &supportRateNum, 0);
+
-+ //update station supportRate
++ //update station supportRate
+ pstat->bssratelen = supportRateNum;
+ _rtw_memcpy(pstat->bssrateset, supportRate, supportRateNum);
+
+
+ //check RSN/WPA/WPS
+ pstat->dot8021xalg = 0;
-+ pstat->wpa_psk = 0;
++ pstat->wpa_psk = 0;
+ pstat->wpa_group_cipher = 0;
+ pstat->wpa2_group_cipher = 0;
+ pstat->wpa_pairwise_cipher = 0;
@@ -22728,19 +22713,19 @@ index 000000000000..e20c116a9cf8
+ _rtw_memset(pstat->wpa_ie, 0, sizeof(pstat->wpa_ie));
+ if((psecuritypriv->wpa_psk & BIT(1)) && elems.rsn_ie) {
+
-+ int group_cipher=0, pairwise_cipher=0;
-+
++ int group_cipher=0, pairwise_cipher=0;
++
+ wpa_ie = elems.rsn_ie;
+ wpa_ie_len = elems.rsn_ie_len;
+
+ if(rtw_parse_wpa2_ie(wpa_ie-2, wpa_ie_len+2, &group_cipher, &pairwise_cipher) == _SUCCESS)
+ {
-+ pstat->dot8021xalg = 1;//psk, todo:802.1x
++ pstat->dot8021xalg = 1;//psk, todo:802.1x
+ pstat->wpa_psk |= BIT(1);
+
-+ pstat->wpa2_group_cipher = group_cipher&psecuritypriv->wpa2_group_cipher;
++ pstat->wpa2_group_cipher = group_cipher&psecuritypriv->wpa2_group_cipher;
+ pstat->wpa2_pairwise_cipher = pairwise_cipher&psecuritypriv->wpa2_pairwise_cipher;
-+
++
+ if(!pstat->wpa2_group_cipher)
+ status = WLAN_STATUS_GROUP_CIPHER_NOT_VALID;
+
@@ -22750,35 +22735,35 @@ index 000000000000..e20c116a9cf8
+ else
+ {
+ status = WLAN_STATUS_INVALID_IE;
-+ }
-+
++ }
++
+ } else if ((psecuritypriv->wpa_psk & BIT(0)) && elems.wpa_ie) {
+
-+ int group_cipher=0, pairwise_cipher=0;
-+
++ int group_cipher=0, pairwise_cipher=0;
++
+ wpa_ie = elems.wpa_ie;
+ wpa_ie_len = elems.wpa_ie_len;
+
+ if(rtw_parse_wpa_ie(wpa_ie-2, wpa_ie_len+2, &group_cipher, &pairwise_cipher) == _SUCCESS)
+ {
-+ pstat->dot8021xalg = 1;//psk, todo:802.1x
++ pstat->dot8021xalg = 1;//psk, todo:802.1x
+ pstat->wpa_psk |= BIT(0);
+
-+ pstat->wpa_group_cipher = group_cipher&psecuritypriv->wpa_group_cipher;
++ pstat->wpa_group_cipher = group_cipher&psecuritypriv->wpa_group_cipher;
+ pstat->wpa_pairwise_cipher = pairwise_cipher&psecuritypriv->wpa_pairwise_cipher;
-+
++
+ if(!pstat->wpa_group_cipher)
+ status = WLAN_STATUS_GROUP_CIPHER_NOT_VALID;
+
+ if(!pstat->wpa_pairwise_cipher)
+ status = WLAN_STATUS_PAIRWISE_CIPHER_NOT_VALID;
-+
++
+ }
+ else
+ {
+ status = WLAN_STATUS_INVALID_IE;
+ }
-+
++
+ } else {
+ wpa_ie = NULL;
+ wpa_ie_len = 0;
@@ -22808,26 +22793,26 @@ index 000000000000..e20c116a9cf8
+
+ // AP support WPA/RSN, and sta is going to do WPS, but AP is not ready
+ // that the selected registrar of AP is _FLASE
-+ if((psecuritypriv->wpa_psk >0)
++ if((psecuritypriv->wpa_psk >0)
+ && (pstat->flags & (WLAN_STA_WPS|WLAN_STA_MAYBE_WPS)))
+ {
+ if(pmlmepriv->wps_beacon_ie)
-+ {
++ {
+ u8 selected_registrar = 0;
-+
++
+ rtw_get_wps_attr_content(pmlmepriv->wps_beacon_ie, pmlmepriv->wps_beacon_ie_len, WPS_ATTR_SELECTED_REGISTRAR , &selected_registrar, NULL);
+
+ if(!selected_registrar)
-+ {
++ {
+ DBG_871X("selected_registrar is _FALSE , or AP is not ready to do WPS\n");
-+
++
+ status = _STATS_UNABLE_HANDLE_STA_;
-+
++
+ goto OnAssocReqFail;
-+ }
-+ }
++ }
++ }
+ }
-+
++
+ }
+ else
+ {
@@ -22836,10 +22821,10 @@ index 000000000000..e20c116a9cf8
+ if(psecuritypriv->wpa_psk == 0)
+ {
+ DBG_871X("STA " MAC_FMT ": WPA/RSN IE in association "
-+ "request, but AP don't support WPA/RSN\n", MAC_ARG(pstat->hwaddr));
-+
++ "request, but AP don't support WPA/RSN\n", MAC_ARG(pstat->hwaddr));
++
+ status = WLAN_STATUS_INVALID_IE;
-+
++
+ goto OnAssocReqFail;
+
+ }
@@ -22856,10 +22841,10 @@ index 000000000000..e20c116a9cf8
+ copy_len = ((wpa_ie_len+2) > sizeof(pstat->wpa_ie)) ? (sizeof(pstat->wpa_ie)):(wpa_ie_len+2);
+ }
+
-+
++
+ if(copy_len>0)
+ _rtw_memcpy(pstat->wpa_ie, wpa_ie-2, copy_len);
-+
++
+ }
+
+
@@ -22872,51 +22857,51 @@ index 000000000000..e20c116a9cf8
+ pstat->uapsd_vi = 0;
+ pstat->uapsd_be = 0;
+ pstat->uapsd_bk = 0;
-+ if (pmlmepriv->qospriv.qos_option)
++ if (pmlmepriv->qospriv.qos_option)
+ {
+ p = pframe + WLAN_HDR_A3_LEN + ie_offset; ie_len = 0;
-+ for (;;)
++ for (;;)
+ {
+ p = rtw_get_ie(p, _VENDOR_SPECIFIC_IE_, &ie_len, pkt_len - WLAN_HDR_A3_LEN - ie_offset);
+ if (p != NULL) {
+ if (_rtw_memcmp(p+2, WMM_IE, 6)) {
+
+ pstat->flags |= WLAN_STA_WME;
-+
-+ pstat->qos_option = 1;
++
++ pstat->qos_option = 1;
+ pstat->qos_info = *(p+8);
-+
++
+ pstat->max_sp_len = (pstat->qos_info>>5)&0x3;
+
+ if((pstat->qos_info&0xf) !=0xf)
+ pstat->has_legacy_ac = _TRUE;
+ else
+ pstat->has_legacy_ac = _FALSE;
-+
++
+ if(pstat->qos_info&0xf)
+ {
+ if(pstat->qos_info&BIT(0))
+ pstat->uapsd_vo = BIT(0)|BIT(1);
+ else
+ pstat->uapsd_vo = 0;
-+
++
+ if(pstat->qos_info&BIT(1))
+ pstat->uapsd_vi = BIT(0)|BIT(1);
+ else
+ pstat->uapsd_vi = 0;
-+
++
+ if(pstat->qos_info&BIT(2))
+ pstat->uapsd_bk = BIT(0)|BIT(1);
+ else
+ pstat->uapsd_bk = 0;
-+
-+ if(pstat->qos_info&BIT(3))
++
++ if(pstat->qos_info&BIT(3))
+ pstat->uapsd_be = BIT(0)|BIT(1);
+ else
+ pstat->uapsd_be = 0;
-+
++
+ }
-+
++
+ break;
+ }
+ }
@@ -22931,32 +22916,32 @@ index 000000000000..e20c116a9cf8
+#ifdef CONFIG_80211N_HT
+ /* save HT capabilities in the sta object */
+ _rtw_memset(&pstat->htpriv.ht_cap, 0, sizeof(struct rtw_ieee80211_ht_cap));
-+ if (elems.ht_capabilities && elems.ht_capabilities_len >= sizeof(struct rtw_ieee80211_ht_cap))
++ if (elems.ht_capabilities && elems.ht_capabilities_len >= sizeof(struct rtw_ieee80211_ht_cap))
+ {
+ pstat->flags |= WLAN_STA_HT;
-+
++
+ pstat->flags |= WLAN_STA_WME;
-+
-+ _rtw_memcpy(&pstat->htpriv.ht_cap, elems.ht_capabilities, sizeof(struct rtw_ieee80211_ht_cap));
-+
++
++ _rtw_memcpy(&pstat->htpriv.ht_cap, elems.ht_capabilities, sizeof(struct rtw_ieee80211_ht_cap));
++
+ } else
+ pstat->flags &= ~WLAN_STA_HT;
+
-+
++
+ if((pmlmepriv->htpriv.ht_option == _FALSE) && (pstat->flags&WLAN_STA_HT))
+ {
+ status = _STATS_FAILURE_;
+ goto OnAssocReqFail;
+ }
-+
++
+
+ if ((pstat->flags & WLAN_STA_HT) &&
+ ((pstat->wpa2_pairwise_cipher&WPA_CIPHER_TKIP) ||
+ (pstat->wpa_pairwise_cipher&WPA_CIPHER_TKIP)))
-+ {
++ {
+ DBG_871X("HT: " MAC_FMT " tried to "
+ "use TKIP with HT association\n", MAC_ARG(pstat->hwaddr));
-+
++
+ //status = WLAN_STATUS_CIPHER_REJECTED_PER_POLICY;
+ //goto OnAssocReqFail;
+ }
@@ -22964,7 +22949,7 @@ index 000000000000..e20c116a9cf8
+
+ //
+ //if (hapd->iface->current_mode->mode == HOSTAPD_MODE_IEEE80211G)//?
-+ pstat->flags |= WLAN_STA_NONERP;
++ pstat->flags |= WLAN_STA_NONERP;
+ for (i = 0; i < pstat->bssratelen; i++) {
+ if ((pstat->bssrateset[i] & 0x7f) > 22) {
+ pstat->flags &= ~WLAN_STA_NONERP;
@@ -22977,15 +22962,15 @@ index 000000000000..e20c116a9cf8
+ else
+ pstat->flags &= ~WLAN_STA_SHORT_PREAMBLE;
+
-+
-+
++
++
+ if (status != _STATS_SUCCESSFUL_)
+ goto OnAssocReqFail;
+
+#ifdef CONFIG_P2P
+ pstat->is_p2p_device = _FALSE;
+ if(rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO))
-+ {
++ {
+ if( (p2pie=rtw_get_p2p_ie(pframe + WLAN_HDR_A3_LEN + ie_offset , pkt_len - WLAN_HDR_A3_LEN - ie_offset , NULL, &p2pielen)))
+ {
+ pstat->is_p2p_device = _TRUE;
@@ -23021,7 +23006,7 @@ index 000000000000..e20c116a9cf8
+ // identify if this is ralink sta
+ // Customer proprietary IE
+
-+
++
+
+ /* get a unique AID */
+ if (pstat->aid > 0) {
@@ -23030,29 +23015,29 @@ index 000000000000..e20c116a9cf8
+ for (pstat->aid = 1; pstat->aid <= NUM_STA; pstat->aid++)
+ if (pstapriv->sta_aid[pstat->aid - 1] == NULL)
+ break;
-+
++
+ //if (pstat->aid > NUM_STA) {
+ if (pstat->aid > pstapriv->max_num_sta) {
-+
++
+ pstat->aid = 0;
-+
++
+ DBG_871X(" no room for more AIDs\n");
+
+ status = WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA;
-+
++
+ goto OnAssocReqFail;
-+
-+
++
++
+ } else {
+ pstapriv->sta_aid[pstat->aid - 1] = pstat;
+ DBG_871X("allocate new AID = (%d)\n", pstat->aid);
-+ }
++ }
+ }
+
+
-+ pstat->state &= (~WIFI_FW_ASSOC_STATE);
++ pstat->state &= (~WIFI_FW_ASSOC_STATE);
+ pstat->state |= WIFI_FW_ASSOC_SUCCESS;
-+
++
+ _enter_critical_bh(&pstapriv->auth_list_lock, &irqL);
+ if (!rtw_is_list_empty(&pstat->auth_list))
+ {
@@ -23061,7 +23046,7 @@ index 000000000000..e20c116a9cf8
+ }
+ _exit_critical_bh(&pstapriv->auth_list_lock, &irqL);
+
-+ _enter_critical_bh(&pstapriv->asoc_list_lock, &irqL);
++ _enter_critical_bh(&pstapriv->asoc_list_lock, &irqL);
+ if (rtw_is_list_empty(&pstat->asoc_list))
+ {
+ pstat->expire_to = pstapriv->expire_to;
@@ -23070,7 +23055,7 @@ index 000000000000..e20c116a9cf8
+ }
+ _exit_critical_bh(&pstapriv->asoc_list_lock, &irqL);
+
-+ // now the station is qualified to join our BSS...
++ // now the station is qualified to join our BSS...
+ if(pstat && (pstat->state & WIFI_FW_ASSOC_SUCCESS) && (_STATS_SUCCESSFUL_==status))
+ {
+#ifdef CONFIG_NATIVEAP_MLME
@@ -23084,7 +23069,7 @@ index 000000000000..e20c116a9cf8
+ else
+ issue_asocrsp(padapter, status, pstat, WIFI_REASSOCRSP);
+
-+ //.2 - report to upper layer
++ //.2 - report to upper layer
+ DBG_871X("indicate_sta_join_event to upper layer - hostapd\n");
+
+#ifdef CONFIG_IOCTL_CFG80211
@@ -23107,7 +23092,7 @@ index 000000000000..e20c116a9cf8
+ _rtw_memcpy(pstat->passoc_req, pframe, pkt_len);
+ pstat->assoc_req_len = pkt_len;
+ }
-+ _exit_critical_bh(&pstat->lock, &irqL);
++ _exit_critical_bh(&pstat->lock, &irqL);
+ #endif //(LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) && !defined(CONFIG_CFG80211_FORCE_COMPATIBLE_2_6_37_UNDER)
+#else
+ rtw_indicate_sta_assoc_event(padapter, pstat);
@@ -23115,15 +23100,15 @@ index 000000000000..e20c116a9cf8
+
+ //.3-(1) report sta add event
+ report_add_sta_event(padapter, pstat->hwaddr, pstat->aid);
-+
-+/*
++
++/*
+ //issue assoc rsp before notify station join event.
+ if (frame_type == WIFI_ASSOCREQ)
+ issue_asocrsp(padapter, status, pstat, WIFI_ASSOCRSP);
+ else
+ issue_asocrsp(padapter, status, pstat, WIFI_REASSOCRSP);
-+*/
-+
++*/
++
+#endif
+ }
+
@@ -23135,7 +23120,7 @@ index 000000000000..e20c116a9cf8
+ issue_deauth(padapter, (void *)GetAddr2Ptr(pframe), status);
+#endif
+
-+ return _FAIL;
++ return _FAIL;
+
+OnAssocReqFail:
+
@@ -23151,7 +23136,7 @@ index 000000000000..e20c116a9cf8
+
+#endif /* CONFIG_AP_MODE */
+
-+ return _FAIL;
++ return _FAIL;
+
+}
+
@@ -23169,7 +23154,7 @@ index 000000000000..e20c116a9cf8
+ uint pkt_len = precv_frame->u.hdr.len;
+
+ DBG_871X("%s\n", __FUNCTION__);
-+
++
+ //check A1 matches or not
+ if (!_rtw_memcmp(myid(&(padapter->eeprompriv)), get_da(pframe), ETH_ALEN))
+ return _SUCCESS;
@@ -23220,7 +23205,7 @@ index 000000000000..e20c116a9cf8
+ DBG_871X( "[%s] Found WFD IE\n", __FUNCTION__ );
+ WFD_info_handler( padapter, pIE );
+ }
-+#endif
++#endif
+ break;
+
+ case _HT_CAPABILITY_IE_: //HT caps
@@ -23295,25 +23280,25 @@ index 000000000000..e20c116a9cf8
+
+#ifdef CONFIG_AP_MODE
+ if(check_fwstate(pmlmepriv, WIFI_AP_STATE) == _TRUE)
-+ {
++ {
+ _irqL irqL;
+ struct sta_info *psta;
+ struct sta_priv *pstapriv = &padapter->stapriv;
-+
-+ //_enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
++
++ //_enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
+ //rtw_free_stainfo(padapter, psta);
-+ //_exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
++ //_exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
+
+ DBG_871X("%s, STA:" MAC_FMT "\n", __FUNCTION__, MAC_ARG(GetAddr2Ptr(pframe)));
+
-+ psta = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe));
++ psta = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe));
+ if(psta)
+ {
+ u8 updated = _FALSE;
-+
++
+ _enter_critical_bh(&pstapriv->asoc_list_lock, &irqL);
+ if(rtw_is_list_empty(&psta->asoc_list)==_FALSE)
-+ {
++ {
+ rtw_list_delete(&psta->asoc_list);
+ pstapriv->asoc_list_cnt--;
+ updated = ap_free_sta(padapter, psta, _FALSE, reason);
@@ -23323,7 +23308,7 @@ index 000000000000..e20c116a9cf8
+
+ associated_clients_update(padapter, updated);
+ }
-+
++
+
+ return _SUCCESS;
+ }
@@ -23333,7 +23318,7 @@ index 000000000000..e20c116a9cf8
+ int ignore_received_deauth = 0;
+
+ // Commented by Albert 20130604
-+ // Before sending the auth frame to start the STA/GC mode connection with AP/GO,
++ // Before sending the auth frame to start the STA/GC mode connection with AP/GO,
+ // we will send the deauth first.
+ // However, the Win8.1 with BRCM Wi-Fi will send the deauth with reason code 6 to us after receieving our deauth.
+ // Added the following code to avoid this case.
@@ -23354,7 +23339,7 @@ index 000000000000..e20c116a9cf8
+ {
+ receive_disconnect(padapter, GetAddr3Ptr(pframe) ,reason);
+ }
-+ }
++ }
+ pmlmepriv->LinkDetectInfo.bBusyTraffic = _FALSE;
+ return _SUCCESS;
+
@@ -23389,29 +23374,29 @@ index 000000000000..e20c116a9cf8
+
+#ifdef CONFIG_AP_MODE
+ if(check_fwstate(pmlmepriv, WIFI_AP_STATE) == _TRUE)
-+ {
++ {
+ _irqL irqL;
+ struct sta_info *psta;
+ struct sta_priv *pstapriv = &padapter->stapriv;
-+
-+ //_enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
++
++ //_enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
+ //rtw_free_stainfo(padapter, psta);
-+ //_exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
++ //_exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
+
+ DBG_871X("%s, STA:" MAC_FMT "\n", __FUNCTION__, MAC_ARG(GetAddr2Ptr(pframe)));
+
-+ psta = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe));
++ psta = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe));
+ if(psta)
+ {
+ u8 updated = _FALSE;
-+
++
+ _enter_critical_bh(&pstapriv->asoc_list_lock, &irqL);
+ if(rtw_is_list_empty(&psta->asoc_list)==_FALSE)
+ {
+ rtw_list_delete(&psta->asoc_list);
+ pstapriv->asoc_list_cnt--;
+ updated = ap_free_sta(padapter, psta, _FALSE, reason);
-+
++
+ }
+ _exit_critical_bh(&pstapriv->asoc_list_lock, &irqL);
+
@@ -23424,9 +23409,9 @@ index 000000000000..e20c116a9cf8
+#endif
+ {
+ DBG_871X("%s, STA:" MAC_FMT "\n", __FUNCTION__, MAC_ARG(GetAddr3Ptr(pframe)));
-+
++
+ receive_disconnect(padapter, GetAddr3Ptr(pframe), reason);
-+ }
++ }
+ pmlmepriv->LinkDetectInfo.bBusyTraffic = _FALSE;
+ return _SUCCESS;
+
@@ -23445,12 +23430,12 @@ index 000000000000..e20c116a9cf8
+ struct mlme_ext_info *pmlmeinfo = &(mlmeext->mlmext_info);
+
+ if (!(pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS)) {
-+ ret = _SUCCESS;
++ ret = _SUCCESS;
+ goto exit;
+ }
+
+ if ((pmlmeinfo->state & 0x03) == WIFI_FW_STATION_STATE) {
-+
++
+ int ch_switch_mode = -1, ch = -1, ch_switch_cnt = -1;
+ int ch_offset = -1;
+ u8 bwmode;
@@ -23562,7 +23547,7 @@ index 000000000000..e20c116a9cf8
+ u8 *pframe = precv_frame->u.hdr.rx_data;
+ struct sta_priv *pstapriv = &padapter->stapriv;
+
-+ //check RA matches or not
++ //check RA matches or not
+ if (!_rtw_memcmp(myid(&(padapter->eeprompriv)), GetAddr1Ptr(pframe), ETH_ALEN))//for if1, sta/ap mode
+ return _SUCCESS;
+
@@ -23573,7 +23558,7 @@ index 000000000000..e20c116a9cf8
+*/
+ DBG_871X("%s\n", __FUNCTION__);
+
-+ if((pmlmeinfo->state&0x03) != WIFI_FW_AP_STATE)
++ if((pmlmeinfo->state&0x03) != WIFI_FW_AP_STATE)
+ if (!(pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS))
+ return _SUCCESS;
+
@@ -23589,7 +23574,7 @@ index 000000000000..e20c116a9cf8
+ if (category == RTW_WLAN_CATEGORY_BACK)// representing Block Ack
+ {
+#ifdef CONFIG_TDLS
-+ if((psta->tdls_sta_state & TDLS_LINKED_STATE) &&
++ if((psta->tdls_sta_state & TDLS_LINKED_STATE) &&
+ (psta->htpriv.ht_option==_TRUE) &&
+ (psta->htpriv.ampdu_enable==_TRUE) )
+ {
@@ -23611,7 +23596,7 @@ index 000000000000..e20c116a9cf8
+ _rtw_memcpy(&(pmlmeinfo->ADDBA_req), &(frame_body[2]), sizeof(struct ADDBA_request));
+ //process_addba_req(padapter, (u8*)&(pmlmeinfo->ADDBA_req), GetAddr3Ptr(pframe));
+ process_addba_req(padapter, (u8*)&(pmlmeinfo->ADDBA_req), addr);
-+
++
+ if(pmlmeinfo->bAcceptAddbaReq == _TRUE)
+ {
+ issue_action_BA(padapter, addr, RTW_WLAN_ACTION_ADDBA_RESP, 0);
@@ -23620,7 +23605,7 @@ index 000000000000..e20c116a9cf8
+ {
+ issue_action_BA(padapter, addr, RTW_WLAN_ACTION_ADDBA_RESP, 37);//reject ADDBA Req
+ }
-+
++
+ break;
+
+ case RTW_WLAN_ACTION_ADDBA_RESP: //ADDBA response
@@ -23630,14 +23615,14 @@ index 000000000000..e20c116a9cf8
+ tid = ((frame_body[5] >> 2) & 0x7);
+
+ if (status == 0)
-+ { //successful
++ { //successful
+ DBG_871X("agg_enable for TID=%d\n", tid);
-+ psta->htpriv.agg_enable_bitmap |= 1 << tid;
-+ psta->htpriv.candidate_tid_bitmap &= ~BIT(tid);
++ psta->htpriv.agg_enable_bitmap |= 1 << tid;
++ psta->htpriv.candidate_tid_bitmap &= ~BIT(tid);
+ }
+ else
-+ {
-+ psta->htpriv.agg_enable_bitmap &= ~BIT(tid);
++ {
++ psta->htpriv.agg_enable_bitmap &= ~BIT(tid);
+ }
+
+ //DBG_871X("marc: ADDBA RSP: %x\n", pmlmeinfo->agg_enable_bitmap);
@@ -23648,14 +23633,14 @@ index 000000000000..e20c116a9cf8
+ {
+ psta->htpriv.agg_enable_bitmap &= ~(1 << ((frame_body[3] >> 4) & 0xf));
+ psta->htpriv.candidate_tid_bitmap &=