ath9k_htc: Update to upstream's commit d19607454d656cb14d8c16dfbf161eebb542e8fe dated...
authorJason Self <j@jxself.org>
Fri, 29 Dec 2017 02:21:46 +0000 (18:21 -0800)
committerJason Self <j@jxself.org>
Fri, 29 Dec 2017 02:21:46 +0000 (18:21 -0800)
229 files changed:
WHENCE
ath9k_htc/.editorconfig [new file with mode: 0644]
ath9k_htc/.gitattributes [new file with mode: 0644]
ath9k_htc/.travis.yml [new file with mode: 0644]
ath9k_htc/Makefile
ath9k_htc/NOTICE.TXT
ath9k_htc/docs/atheros_ar7010.png [deleted file]
ath9k_htc/docs/atheros_ar9271.png [deleted file]
ath9k_htc/local/patches/binutils-2.27_fixup.patch [new file with mode: 0644]
ath9k_htc/local/patches/binutils-elf32-xtensa-sec_cache.patch [deleted file]
ath9k_htc/local/patches/binutils.patch
ath9k_htc/local/patches/gcc-6.3.0_fixup.patch [new file with mode: 0644]
ath9k_htc/local/patches/gcc.patch
ath9k_htc/target_firmware/CMakeLists.txt
ath9k_htc/target_firmware/Makefile
ath9k_htc/target_firmware/configure
ath9k_htc/target_firmware/firmware-crc.pl
ath9k_htc/target_firmware/include/rom.h [new file with mode: 0644]
ath9k_htc/target_firmware/magpie_fw_dev/target/adf/adf_nbuf.c
ath9k_htc/target_firmware/magpie_fw_dev/target/adf/adf_nbuf_pvt.h
ath9k_htc/target_firmware/magpie_fw_dev/target/adf/adf_net.c
ath9k_htc/target_firmware/magpie_fw_dev/target/adf/adf_net_pvt.h
ath9k_htc/target_firmware/magpie_fw_dev/target/adf/adf_os_atomic_pvt.h
ath9k_htc/target_firmware/magpie_fw_dev/target/adf/adf_os_defer_pvt.c
ath9k_htc/target_firmware/magpie_fw_dev/target/adf/adf_os_defer_pvt.h
ath9k_htc/target_firmware/magpie_fw_dev/target/adf/adf_os_dma.c
ath9k_htc/target_firmware/magpie_fw_dev/target/adf/adf_os_dma_pvt.h
ath9k_htc/target_firmware/magpie_fw_dev/target/adf/adf_os_io_pvt.h
ath9k_htc/target_firmware/magpie_fw_dev/target/adf/adf_os_irq_pvt.c
ath9k_htc/target_firmware/magpie_fw_dev/target/adf/adf_os_lock_pvt.h
ath9k_htc/target_firmware/magpie_fw_dev/target/adf/adf_os_mem_pvt.h
ath9k_htc/target_firmware/magpie_fw_dev/target/adf/adf_os_module_pvt.h
ath9k_htc/target_firmware/magpie_fw_dev/target/adf/adf_os_pci_pvt.h
ath9k_htc/target_firmware/magpie_fw_dev/target/adf/adf_os_time_pvt.h
ath9k_htc/target_firmware/magpie_fw_dev/target/adf/adf_os_timer_pvt.h
ath9k_htc/target_firmware/magpie_fw_dev/target/adf/adf_os_types_pvt.h
ath9k_htc/target_firmware/magpie_fw_dev/target/adf/adf_os_util_pvt.h
ath9k_htc/target_firmware/magpie_fw_dev/target/buf_pool/buf_pool_api.h
ath9k_htc/target_firmware/magpie_fw_dev/target/buf_pool/buf_pool_dynamic.c [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/buf_pool/buf_pool_static.c
ath9k_htc/target_firmware/magpie_fw_dev/target/buf_pool/buf_pool_static.h
ath9k_htc/target_firmware/magpie_fw_dev/target/cmnos/clock_api.h
ath9k_htc/target_firmware/magpie_fw_dev/target/cmnos/cmnos_api.h
ath9k_htc/target_firmware/magpie_fw_dev/target/cmnos/cmnos_clock.c [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/cmnos/cmnos_printf.c [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/cmnos/cmnos_sflash.c
ath9k_htc/target_firmware/magpie_fw_dev/target/cmnos/dbg_api.c
ath9k_htc/target_firmware/magpie_fw_dev/target/cmnos/dbg_api.h
ath9k_htc/target_firmware/magpie_fw_dev/target/cmnos/k2_cmnos_clock_patch.c
ath9k_htc/target_firmware/magpie_fw_dev/target/cmnos/k2_fw_cmnos_printf.c
ath9k_htc/target_firmware/magpie_fw_dev/target/hif/k2_HIF_usb_patch.c
ath9k_htc/target_firmware/magpie_fw_dev/target/hif/usb_api_magpie_patch.c
ath9k_htc/target_firmware/magpie_fw_dev/target/hif/usb_api_main_patch.c
ath9k_htc/target_firmware/magpie_fw_dev/target/htc/htc.c
ath9k_htc/target_firmware/magpie_fw_dev/target/htc/htc_api.h
ath9k_htc/target_firmware/magpie_fw_dev/target/htc/htc_internal.h
ath9k_htc/target_firmware/magpie_fw_dev/target/htc/htc_tgt.c [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/OTUS/OTUS_htc.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/OTUS/OTUS_misc.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/OTUS/OTUS_soc.h
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/adf_nbuf.h
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/adf_net.h
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/adf_net_sw.h
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/adf_net_types.h
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/adf_net_wcmd.h
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/adf_os_atomic.h
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/adf_os_bitops.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/adf_os_crypto.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/adf_os_defer.h
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/adf_os_dma.h
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/adf_os_lock.h
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/adf_os_mem.h
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/adf_os_module.h
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/adf_os_pci.h
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/adf_os_pseudo.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/adf_os_stdtypes.h
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/adf_os_time.h
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/adf_os_timer.h
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/adf_os_types.h
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/adf_os_util.h
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/allocram_api.h [new file with mode: 0755]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/asf_sm.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/athos_api.h [new file with mode: 0755]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/dma_engine_api.h [new file with mode: 0755]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/dma_lib.h [new file with mode: 0755]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/eeprom_api.h [new file with mode: 0755]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/hif_api.h [new file with mode: 0755]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/hif_gmac.h [new file with mode: 0755]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/hif_pci.h [new file with mode: 0755]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/hif_usb.h [new file with mode: 0755]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/intr_api.h [new file with mode: 0755]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/k2/Magpie_api.h
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/k2/allocram_api.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/k2/athos_api.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/k2/clock_api.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/k2/cmnos_api.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/k2/dma_engine_api.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/k2/dma_lib.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/k2/eeprom_api.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/k2/hif_api.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/k2/hif_gmac.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/k2/hif_pci.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/k2/hif_usb.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/k2/intr_api.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/k2/k2/rom_cfg.h
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/k2/k2_mem.h
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/k2/magpie_mem.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/k2/magpie_regdump.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/k2/mem_api.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/k2/misc_api.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/k2/opt_ah.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/k2/printf_api.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/k2/regdump.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/k2/romp_api.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/k2/string_api.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/k2/sys_cfg.h
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/k2/tasklet_api.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/k2/timer_api.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/k2/uart_api.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/k2/usb_table.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/k2/vbuf_api.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/k2/vdesc_api.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/k2/wdt_api.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/linux/compiler.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/magpie/Magpie_api.h
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/magpie/adf_nbuf_pvt.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/magpie/allocram_api.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/magpie/athos_api.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/magpie/buf_pool_api.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/magpie/clock_api.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/magpie/cmnos_api.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/magpie/dma_engine_api.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/magpie/dma_lib.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/magpie/eeprom_api.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/magpie/hif_api.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/magpie/hif_gmac.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/magpie/hif_pci.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/magpie/hif_usb.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/magpie/htc_api.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/magpie/intr_api.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/magpie/magpie/reg_defs.h
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/magpie/magpie/rom_cfg.h
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/magpie/magpie_mem.h
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/magpie/magpie_regdump.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/magpie/mem_api.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/magpie/misc_api.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/magpie/opt_ah.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/magpie/printf_api.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/magpie/regdump.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/magpie/romp_api.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/magpie/string_api.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/magpie/sys_cfg.h
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/magpie/tasklet_api.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/magpie/timer_api.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/magpie/uart_api.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/magpie/usb_table.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/magpie/vbuf_api.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/magpie/vdesc_api.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/magpie/wdt_api.h [deleted file]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/magpie_regdump.h [new file with mode: 0755]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/mem_api.h [new file with mode: 0755]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/misc_api.h [new file with mode: 0755]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/osapi.h
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/regdump.h [new file with mode: 0755]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/romp_api.h [new file with mode: 0755]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/string_api.h [new file with mode: 0755]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/tasklet_api.h [new file with mode: 0755]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/timer_api.h [new file with mode: 0755]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/uart_api.h [new file with mode: 0755]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/usb_api.h
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/usb_defs.h
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/usb_table.h [new file with mode: 0755]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/usbfifo_api.h
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/vbuf_api.h [new file with mode: 0755]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/vdesc_api.h [new file with mode: 0755]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/wdt_api.h [new file with mode: 0755]
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/xtensa-elf/xtensa/config/core.h
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/xtensa-elf/xtensa/corebits.h
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/xtensa-elf/xtensa/hal.h
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/xtensa-elf/xtensa/xtruntime.h
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/xtensa/config/core-isa.h
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/xtensa/config/core-matmap.h
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/xtensa/config/specreg.h
ath9k_htc/target_firmware/magpie_fw_dev/target/inc/xtensa/config/tie.h
ath9k_htc/target_firmware/magpie_fw_dev/target/init/app_start.c
ath9k_htc/target_firmware/magpie_fw_dev/target/init/app_start.h [new file with mode: 0644]
ath9k_htc/target_firmware/magpie_fw_dev/target/init/init.c
ath9k_htc/target_firmware/magpie_fw_dev/target/init/init.h
ath9k_htc/target_firmware/magpie_fw_dev/target/init/magpie.c
ath9k_htc/target_firmware/magpie_fw_dev/target/rompatch/HIF_usb_patch.c
ath9k_htc/target_firmware/magpie_fw_dev/target/rompatch/cmnos_clock_patch.c
ath9k_htc/target_firmware/magpie_fw_dev/target/wlan/wlan_pci.c
ath9k_htc/target_firmware/magpie_fw_dev/target/wlan/wlan_pci.h
ath9k_htc/target_firmware/magpie_fw_dev/target/wmi/wmi_internal.h
ath9k_htc/target_firmware/magpie_fw_dev/target/wmi/wmi_svc.c
ath9k_htc/target_firmware/magpie_fw_dev/target/wmi/wmi_svc_api.h
ath9k_htc/target_firmware/ram-k2.ld
ath9k_htc/target_firmware/ram-magpie.ld
ath9k_htc/target_firmware/rom-addrs-k2.ld
ath9k_htc/target_firmware/rom-addrs-magpie.ld
ath9k_htc/target_firmware/wlan/_ieee80211.h
ath9k_htc/target_firmware/wlan/ah.c
ath9k_htc/target_firmware/wlan/ah.h
ath9k_htc/target_firmware/wlan/ah_osdep.h
ath9k_htc/target_firmware/wlan/ar5416.h
ath9k_htc/target_firmware/wlan/ar5416Phy.c
ath9k_htc/target_firmware/wlan/ar5416_hw.c
ath9k_htc/target_firmware/wlan/ar5416desc.h
ath9k_htc/target_firmware/wlan/ar5416reg.h
ath9k_htc/target_firmware/wlan/ieee80211.h
ath9k_htc/target_firmware/wlan/ieee80211_node.h
ath9k_htc/target_firmware/wlan/ieee80211_output.c
ath9k_htc/target_firmware/wlan/ieee80211_var.h
ath9k_htc/target_firmware/wlan/if_ath.c
ath9k_htc/target_firmware/wlan/if_ath_pci.c
ath9k_htc/target_firmware/wlan/if_ath_pci.h
ath9k_htc/target_firmware/wlan/if_athrate.h
ath9k_htc/target_firmware/wlan/if_athvar.h
ath9k_htc/target_firmware/wlan/if_llc.h
ath9k_htc/target_firmware/wlan/if_owl.c
ath9k_htc/target_firmware/wlan/include/htc.h
ath9k_htc/target_firmware/wlan/include/htc_services.h
ath9k_htc/target_firmware/wlan/include/k2/wlan_cfg.h
ath9k_htc/target_firmware/wlan/include/magpie/wlan_cfg.h
ath9k_htc/target_firmware/wlan/include/wlan_hdr.h
ath9k_htc/target_firmware/wlan/include/wmi.h
ath9k_htc/target_firmware/wlan/ratectrl.h
ath9k_htc/target_firmware/wlan/ratectrl11n.h
ath9k_htc/target_firmware/wlan/ratectrl_11n_ln.c

diff --git a/WHENCE b/WHENCE
index 003bb8ee22575e8f0c7fd3f6a7d3c66670efdc37..4e57350eff495b233374910f035e998834668226 100644 (file)
--- a/WHENCE
+++ b/WHENCE
@@ -65,7 +65,8 @@ From http://wiki.erazor-zone.de/doku.php?id=wiki:projects:linux:as31
 
 Driver: ath9k_htc - Atheros HTC devices (USB)
 
-Version: 1.4.0
+Version: Based on commit d19607454d656cb14d8c16dfbf161eebb542e8fe 
+dated June 25 2017
 
 Licence: Free software. See ath9k_htc/LICENCE.TXT for details.
 
diff --git a/ath9k_htc/.editorconfig b/ath9k_htc/.editorconfig
new file mode 100644 (file)
index 0000000..6be3f2b
--- /dev/null
@@ -0,0 +1,21 @@
+# Copying and distribution of this file, with or without modification,
+# are permitted in any medium without royalty provided this notice is
+# preserved.  This file is offered as-is, without any warranty.
+# Names of contributors must not be used to endorse or promote products
+# derived from this file without specific prior written permission.
+
+# EditorConfig
+# http://EditorConfig.org
+
+# top-most EditorConfig file
+root = true
+
+# LF end-of-line, insert an empty new line and UTF-8
+[*]
+end_of_line = lf
+insert_final_newline = true
+charset = utf-8
+
+# Tab indentation
+[makefile,Makefile]
+indent_style = tab
diff --git a/ath9k_htc/.gitattributes b/ath9k_htc/.gitattributes
new file mode 100644 (file)
index 0000000..d1564d7
--- /dev/null
@@ -0,0 +1,2 @@
+.gitattributes export-ignore
+.gitignore export-ignore
\ No newline at end of file
diff --git a/ath9k_htc/.travis.yml b/ath9k_htc/.travis.yml
new file mode 100644 (file)
index 0000000..cfb0ee1
--- /dev/null
@@ -0,0 +1,24 @@
+# Copying and distribution of this file, with or without modification,
+# are permitted in any medium without royalty provided this notice is
+# preserved.  This file is offered as-is, without any warranty.
+# Names of contributors must not be used to endorse or promote products
+# derived from this file without specific prior written permission.
+
+# See YAML format https://en.wikipedia.org/wiki/YAML
+# See Travis CI (Continuous Integration) https://docs.travis-ci.com/
+
+
+language: c
+
+os:
+  - linux
+
+addons:
+  apt:
+    packages:
+      - cmake
+
+script:
+  - make toolchain
+  - make -C target_firmware
+  - make -C target_firmware clean
index 931c8bcc01794d6dd89b0da095a4f1bb28043fd6..9469c40deeb473e1998613672ff54abf1e5705be 100644 (file)
@@ -1,29 +1,34 @@
-GMP_VER=5.0.5
+GMP_VER=6.1.1
 GMP_URL=https://ftp.gnu.org/gnu/gmp/gmp-$(GMP_VER).tar.bz2
 GMP_TAR=gmp-$(GMP_VER).tar.bz2
 GMP_DIR=gmp-$(GMP_VER)
+GMP_SUM=a8109865f2893f1373b0a8ed5ff7429de8db696fc451b1036bd7bdf95bbeffd6
 
-MPFR_VER=3.1.1
+MPFR_VER=3.1.4
 MPFR_URL=https://ftp.gnu.org/gnu/mpfr/mpfr-$(MPFR_VER).tar.bz2
 MPFR_TAR=mpfr-$(MPFR_VER).tar.bz2
 MPFR_DIR=mpfr-$(MPFR_VER)
+MPFR_SUM=d3103a80cdad2407ed581f3618c4bed04e0c92d1cf771a65ead662cc397f7775
 
-MPC_VER=1.0.1
+MPC_VER=1.0.3
 MPC_URL=https://ftp.gnu.org/gnu/mpc/mpc-$(MPC_VER).tar.gz
 MPC_TAR=mpc-$(MPC_VER).tar.gz
 MPC_DIR=mpc-$(MPC_VER)
+MPC_SUM=617decc6ea09889fb08ede330917a00b16809b8db88c29c31bfbb49cbf88ecc3
 
-BINUTILS_VER=2.23.1
+BINUTILS_VER=2.27
 BINUTILS_URL=https://ftp.gnu.org/gnu/binutils/binutils-$(BINUTILS_VER).tar.bz2
 BINUTILS_TAR=binutils-$(BINUTILS_VER).tar.bz2
 BINUTILS_DIR=binutils-$(BINUTILS_VER)
-BINUTILS_PATCHES=local/patches/binutils.patch local/patches/binutils-elf32-xtensa-sec_cache.patch
+BINUTILS_PATCHES=local/patches/binutils.patch local/patches/binutils-2.27_fixup.patch
+BINUTILS_SUM=369737ce51587f92466041a97ab7d2358c6d9e1b6490b3940eb09fb0a9a6ac88
 
-GCC_VER=4.7.4
+GCC_VER=6.3.0
 GCC_URL=https://ftp.gnu.org/gnu/gcc/gcc-$(GCC_VER)/gcc-$(GCC_VER).tar.bz2
 GCC_TAR=gcc-$(GCC_VER).tar.bz2
 GCC_DIR=gcc-$(GCC_VER)
-GCC_PATCHES=local/patches/gcc.patch
+GCC_PATCHES=local/patches/gcc.patch local/patches/gcc-6.3.0_fixup.patch
+GCC_SUM=f06ae7f3f790fbf0f018f6d40e844451e6bc3b7bc96e128e63b09825c1f8b29f
 
 BASEDIR=$(shell pwd)
 TOOLCHAIN_DIR=$(BASEDIR)/toolchain
@@ -98,6 +103,7 @@ define Build
 $(DL_DIR)/$($(1)_TAR):
        mkdir -p $(DL_DIR)
        wget -N -P $(DL_DIR) $($(1)_URL)
+       printf "%s  %s\n" $($(1)_SUM) $$@ | shasum -a 256 -c
 
 $(DL_DIR)/$($(1)_DIR)/.prepared: $(DL_DIR)/$($(1)_TAR)
        tar -C $(DL_DIR) -x$(if $(findstring bz2,$($(1)_TAR)),j,z)f $(DL_DIR)/$($(1)_TAR)
index 0e7408348b272db27ec6f3850175984e8e13d56c..7ab5e318267a41dc39d1877fbdcbad0774a08968 100644 (file)
@@ -39,19 +39,18 @@ NOTICES:
  * Copyright (c) 2002-2005 Atheros Communications, Inc.
  * Copyright (c) 2008-2010, Atheros Communications Inc.
  *
- * Redistribution and use in source and binary forms are permitted
- * provided that the following conditions are met:
- * 1. The materials contained herein are unmodified and are used
- *    unmodified.
- * 2. Redistributions of source code must retain the above copyright
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
  *    notice, this list of conditions and the following NO
  *    ''WARRANTY'' disclaimer below (''Disclaimer''), without
  *    modification.
- * 3. Redistributions in binary form must reproduce at minimum a
+ * 2. Redistributions in binary form must reproduce at minimum a
  *    disclaimer similar to the Disclaimer below and any redistribution
  *    must be conditioned upon including a substantially similar
  *    Disclaimer requirement for further binary redistribution.
- * 4. Neither the names of the above-listed copyright holders nor the
+ * 3. Neither the names of the above-listed copyright holders nor the
  *    names of any contributors may be used to endorse or promote
  *    product derived from this software without specific prior written
  *    permission.
@@ -76,7 +75,7 @@ NOTICES:
 The following files are from ECoS with a GPLv2 licence with modification
 and linking caveats. Please see the licence below for more information:
 
-target_firmware/magpie_fw_dev/build/magpie_1_1/sboot/cmnos/printf/src/cmnos_printf.c
+sboot/magpie_1_1/sboot/cmnos/printf/src/cmnos_printf.c
 target_firmware/magpie_fw_dev/target/cmnos/cmnos_printf.c
 target_firmware/magpie_fw_dev/target/cmnos/k2_fw_cmnos_printf.c
 
@@ -95,9 +94,8 @@ target_firmware/magpie_fw_dev/target/cmnos/k2_fw_cmnos_printf.c
 // FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 // for more details.
 //
-// You should have received a copy of the GNU General Public License along
-// with eCos; if not, write to the Free Software Foundation, Inc.,
-// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+// You should have received a copy of the GNU General Public License
+// along with this program.  If not, see <http://www.gnu.org/licenses/>.
 //
 // As a special exception, if other files instantiate templates or use macros
 // or inline functions from this file, or you compile this file and link it
diff --git a/ath9k_htc/docs/atheros_ar7010.png b/ath9k_htc/docs/atheros_ar7010.png
deleted file mode 100755 (executable)
index d6615c7..0000000
Binary files a/ath9k_htc/docs/atheros_ar7010.png and /dev/null differ
diff --git a/ath9k_htc/docs/atheros_ar9271.png b/ath9k_htc/docs/atheros_ar9271.png
deleted file mode 100755 (executable)
index 94006c4..0000000
Binary files a/ath9k_htc/docs/atheros_ar9271.png and /dev/null differ
diff --git a/ath9k_htc/local/patches/binutils-2.27_fixup.patch b/ath9k_htc/local/patches/binutils-2.27_fixup.patch
new file mode 100644 (file)
index 0000000..fb61345
--- /dev/null
@@ -0,0 +1,13 @@
+diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c
+index d062044..ca261ae 100644
+--- a/gas/config/tc-xtensa.c
++++ b/gas/config/tc-xtensa.c
+@@ -2228,7 +2228,7 @@ xg_reverse_shift_count (char **cnt_argp)
+   cnt_arg = *cnt_argp;
+   /* replace the argument with "31-(argument)" */
+-  new_arg = concat ("31-(", cnt_argp, ")", (char *) NULL);
++  new_arg = concat ("31-(", cnt_arg, ")", (char *) NULL);
+   free (cnt_arg);
+   *cnt_argp = new_arg;
diff --git a/ath9k_htc/local/patches/binutils-elf32-xtensa-sec_cache.patch b/ath9k_htc/local/patches/binutils-elf32-xtensa-sec_cache.patch
deleted file mode 100644 (file)
index facf709..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
---- a/bfd/elf32-xtensa.c       2012-06-29 17:46:01.000000000 +0300
-+++ b/bfd/elf32-xtensa.c       2013-05-08 19:16:39.436716824 +0300
-@@ -6075,7 +6075,7 @@
-       release_internal_relocs (sec_cache->sec, sec_cache->relocs);
-       if (sec_cache->ptbl)
-       free (sec_cache->ptbl);
--      memset (sec_cache, 0, sizeof (sec_cache));
-+      memset (sec_cache, 0, sizeof (*sec_cache));
-     }
- }
-@@ -6117,7 +6117,7 @@
-   /* Fill in the new section cache.  */
-   clear_section_cache (sec_cache);
--  memset (sec_cache, 0, sizeof (sec_cache));
-+  memset (sec_cache, 0, sizeof (*sec_cache));
-   sec_cache->sec = sec;
-   sec_cache->contents = contents;
index 9a8ec65de09884f5eba74e603c58ce18162b8bd9..8246771675d3b850a5d94177e3f474b1e84652c1 100644 (file)
@@ -28869,16 +28869,6 @@ diff --git a/include/xtensa-config.h b/include/xtensa-config.h
 index 30f4f41..fe9b051 100644
 --- a/include/xtensa-config.h
 +++ b/include/xtensa-config.h
-@@ -1,7 +1,7 @@
- /* Xtensa configuration settings.
--   Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010
-+   Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
-    Free Software Foundation, Inc.
--   Contributed by Bob Wilson (bob.wilson@acm.org) at Tensilica.
-+   Contributed by Bob Wilson (bwilson@tensilica.com) at Tensilica.
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
 @@ -44,10 +44,7 @@
  #define XCHAL_HAVE_L32R                       1
  
diff --git a/ath9k_htc/local/patches/gcc-6.3.0_fixup.patch b/ath9k_htc/local/patches/gcc-6.3.0_fixup.patch
new file mode 100644 (file)
index 0000000..681c0ee
--- /dev/null
@@ -0,0 +1,49 @@
+diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
+index 015dd1049fb..df80ad9117e 100644
+--- a/gcc/config/xtensa/xtensa.c
++++ b/gcc/config/xtensa/xtensa.c
+@@ -1780,7 +1780,8 @@ xtensa_emit_call (int callop, rtx *operands)
+   rtx tgt = operands[callop];
+   if (GET_CODE (tgt) == CONST_INT)
+-    sprintf (result, "call%d\t0x%lx", WINDOW_SIZE, INTVAL (tgt));
++    sprintf (result, "call%d\t" HOST_WIDE_INT_PRINT_HEX,
++           WINDOW_SIZE, INTVAL (tgt));
+   else if (register_operand (tgt, VOIDmode))
+     sprintf (result, "callx%d\t%%%d", WINDOW_SIZE, callop);
+   else
+@@ -2351,14 +2352,14 @@ print_operand (FILE *file, rtx x, int letter)
+     case 'L':
+       if (GET_CODE (x) == CONST_INT)
+-      fprintf (file, "%ld", (32 - INTVAL (x)) & 0x1f);
++      fprintf (file, HOST_WIDE_INT_PRINT_DEC, (32 - INTVAL (x)) & 0x1f);
+       else
+       output_operand_lossage ("invalid %%L value");
+       break;
+     case 'R':
+       if (GET_CODE (x) == CONST_INT)
+-      fprintf (file, "%ld", INTVAL (x) & 0x1f);
++      fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (x) & 0x1f);
+       else
+       output_operand_lossage ("invalid %%R value");
+       break;
+@@ -2372,7 +2373,7 @@ print_operand (FILE *file, rtx x, int letter)
+     case 'd':
+       if (GET_CODE (x) == CONST_INT)
+-      fprintf (file, "%ld", INTVAL (x));
++      fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (x));
+       else
+       output_operand_lossage ("invalid %%d value");
+       break;
+@@ -2437,7 +2438,7 @@ print_operand (FILE *file, rtx x, int letter)
+       else if (GET_CODE (x) == MEM)
+       output_address (GET_MODE (x), XEXP (x, 0));
+       else if (GET_CODE (x) == CONST_INT)
+-      fprintf (file, "%ld", INTVAL (x));
++      fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (x));
+       else
+       output_addr_const (file, x);
+     }
index 9f43902bef595e4c9fbc977438f56d2b1a6197ce..b26cc568aa150df596d5abefc2becf65125d4194 100644 (file)
@@ -1,28 +1,8 @@
-From c7162b8a3db42e7faf47606d3aa3dd61e64aea17 Mon Sep 17 00:00:00 2001
-From: Sujith Manoharan <c_manoha@qca.qualcomm.com>
-Date: Mon, 7 Jan 2013 16:06:28 +0530
-Subject: [PATCH] gcc: AR9271/AR7010 config
-
-Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
----
- include/xtensa-config.h | 36 +++++++++++++++++-------------------
- 1 file changed, 17 insertions(+), 19 deletions(-)
-
 diff --git a/include/xtensa-config.h b/include/xtensa-config.h
-index 30f4f41..fe9b051 100644
+index 5ae4c80..8397564 100644
 --- a/include/xtensa-config.h
 +++ b/include/xtensa-config.h
-@@ -1,7 +1,7 @@
- /* Xtensa configuration settings.
--   Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010
-+   Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
-    Free Software Foundation, Inc.
--   Contributed by Bob Wilson (bob.wilson@acm.org) at Tensilica.
-+   Contributed by Bob Wilson (bwilson@tensilica.com) at Tensilica.
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-@@ -44,10 +44,7 @@
+@@ -43,10 +43,7 @@
  #define XCHAL_HAVE_L32R                       1
  
  #undef XSHAL_USE_ABSOLUTE_LITERALS
@@ -34,7 +14,7 @@ index 30f4f41..fe9b051 100644
  
  #undef XCHAL_HAVE_MAC16
  #define XCHAL_HAVE_MAC16              0
-@@ -59,10 +56,10 @@
+@@ -58,10 +55,10 @@
  #define XCHAL_HAVE_MUL32              1
  
  #undef XCHAL_HAVE_MUL32_HIGH
@@ -47,7 +27,7 @@ index 30f4f41..fe9b051 100644
  
  #undef XCHAL_HAVE_NSA
  #define XCHAL_HAVE_NSA                        1
-@@ -103,8 +100,6 @@
+@@ -102,8 +99,6 @@
  #undef XCHAL_HAVE_FP_RSQRT
  #define XCHAL_HAVE_FP_RSQRT           0
  
@@ -56,7 +36,7 @@ index 30f4f41..fe9b051 100644
  #undef XCHAL_HAVE_WINDOWED
  #define XCHAL_HAVE_WINDOWED           1
  
-@@ -119,32 +114,32 @@
+@@ -118,32 +113,32 @@
  
  
  #undef XCHAL_ICACHE_SIZE
@@ -97,7 +77,7 @@ index 30f4f41..fe9b051 100644
  
  
  #undef XCHAL_HAVE_DEBUG
-@@ -157,8 +152,11 @@
+@@ -156,8 +151,11 @@
  #define XCHAL_NUM_DBREAK              2
  
  #undef XCHAL_DEBUGLEVEL
@@ -110,6 +90,3 @@ index 30f4f41..fe9b051 100644
  
  #undef XCHAL_MAX_INSTRUCTION_SIZE
  #define XCHAL_MAX_INSTRUCTION_SIZE    3
--- 
-1.8.1
-
index 56e486a781228a7f7da609e16ef3ed6900dde92d..73cb9301776203b1ae4ed7b00d6e3cbbb328e076 100644 (file)
@@ -1,10 +1,56 @@
+##
+ # Copyright (c) 2013 Qualcomm Atheros, Inc.
+ #
+ # All rights reserved.
+ #
+ # Redistribution and use in source and binary forms, with or without
+ # modification, are permitted (subject to the limitations in the
+ # disclaimer below) provided that the following conditions are met:
+ #
+ #  * Redistributions of source code must retain the above copyright
+ #    notice, this list of conditions and the following disclaimer.
+ #
+ #  * Redistributions in binary form must reproduce the above copyright
+ #    notice, this list of conditions and the following disclaimer in the
+ #    documentation and/or other materials provided with the
+ #    distribution.
+ #
+ #  * Neither the name of Qualcomm Atheros nor the names of its
+ #    contributors may be used to endorse or promote products derived
+ #    from this software without specific prior written permission.
+ #
+ # NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
+ # GRANTED BY THIS LICENSE.  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
+ # HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+ # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ ##
+
 SET(CMAKE_C_COMPILER_WORKS 1)
 
 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
 PROJECT(ath9k_firmware NONE)
 ENABLE_LANGUAGE(C)
 
-ADD_DEFINITIONS(-g -Os -Wunused-label -Wunused-variable -Wunused-value -Wpointer-arith -Wundef -nostdlib -Wundef)
+ADD_DEFINITIONS(
+       -g -Os
+       -Wunused-label
+       -Wunused-variable
+       -Wunused-value
+       -Wpointer-arith
+       -nostdlib
+       -Wundef
+       -Wunused-but-set-variable
+       -Wmaybe-uninitialized
+)
 ADD_DEFINITIONS(
        -D_RAM_
        -DBIG_ENDIAN -D_BYTE_ORDER=_BIG_ENDIAN
@@ -77,6 +123,8 @@ ELSE()
 ENDIF()
 
 INCLUDE_DIRECTORIES(
+       ${CMAKE_SOURCE_DIR}/include
+       ${CMAKE_SOURCE_DIR}/magpie_fw_dev/target/
        ${CMAKE_SOURCE_DIR}/magpie_fw_dev/target/inc
        ${CMAKE_SOURCE_DIR}/magpie_fw_dev/target/inc/xtensa-elf
        ${CMAKE_SOURCE_DIR}/magpie_fw_dev/target/inc/${PLATFORM_NAME}
@@ -99,6 +147,7 @@ ADD_CUSTOM_COMMAND(
        DEPENDS firmware
        COMMAND ${CMAKE_C_COMPILER}
                -nostdlib
+               -fno-lto
                -Wl,--start-group
                ${CMAKE_BINARY_DIR}/libfirmware.a
                -Wl,--end-group
index d08e3cd05ce6d2143a5658a2dd5d693e7f776d17..bfe056508a8596fa20eaad2edbd3e7954a0f05f6 100644 (file)
@@ -1,3 +1,39 @@
+##
+ # Copyright (c) 2013 Qualcomm Atheros, Inc.
+ #
+ # All rights reserved.
+ #
+ # Redistribution and use in source and binary forms, with or without
+ # modification, are permitted (subject to the limitations in the
+ # disclaimer below) provided that the following conditions are met:
+ #
+ #  * Redistributions of source code must retain the above copyright
+ #    notice, this list of conditions and the following disclaimer.
+ #
+ #  * Redistributions in binary form must reproduce the above copyright
+ #    notice, this list of conditions and the following disclaimer in the
+ #    documentation and/or other materials provided with the
+ #    distribution.
+ #
+ #  * Neither the name of Qualcomm Atheros nor the names of its
+ #    contributors may be used to endorse or promote products derived
+ #    from this software without specific prior written permission.
+ #
+ # NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
+ # GRANTED BY THIS LICENSE.  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
+ # HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+ # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ ##
+
 all:
        [ -d build ] || ./configure || { rm -rf build; false; }
        +$(MAKE) -C build/k2
index 38117cdcde7d84b879c5045a2892315ba44ca5d7..e2d46396ad9baf33e20053cceccbb47d26317429 100755 (executable)
@@ -1,25 +1,58 @@
 #!/bin/sh
-TOOLCHAIN=$PWD/../toolchain/inst
+##
+ # Copyright (c) 2013 Qualcomm Atheros, Inc.
+ #
+ # All rights reserved.
+ #
+ # Redistribution and use in source and binary forms, with or without
+ # modification, are permitted (subject to the limitations in the
+ # disclaimer below) provided that the following conditions are met:
+ #
+ #  * Redistributions of source code must retain the above copyright
+ #    notice, this list of conditions and the following disclaimer.
+ #
+ #  * Redistributions in binary form must reproduce the above copyright
+ #    notice, this list of conditions and the following disclaimer in the
+ #    documentation and/or other materials provided with the
+ #    distribution.
+ #
+ #  * Neither the name of Qualcomm Atheros nor the names of its
+ #    contributors may be used to endorse or promote products derived
+ #    from this software without specific prior written permission.
+ #
+ # NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
+ # GRANTED BY THIS LICENSE.  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
+ # HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+ # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ ##
+
 TARGET=xtensa-elf
-PREFIX="$TOOLCHAIN/bin/$TARGET-"
-TOOLCHAIN_FILE=$PWD/build/toolchain.cmake
+
+[ -z "$CROSS_COMPILE" ] &&
+    CROSS_COMPILE="$PWD/../toolchain/inst/bin/$TARGET-"
+
+TOOLCHAIN_FILE="$PWD/build/toolchain.cmake"
 
 set -e
 rm -rf build
 mkdir -p build
 
 cat > "$TOOLCHAIN_FILE" <<EOF
-INCLUDE(CMakeForceCompiler)
-
-SET(CMAKE_SYSTEM_PROCESSOR xtensa)
-SET(CMAKE_FIND_ROOT_PATH ${TOOLCHAIN}/$TARGET)
-SET(CMAKE_STRIP :)
-
-CMAKE_FORCE_C_COMPILER(${PREFIX}gcc GNU)
+SET(CMAKE_SYSTEM_NAME Generic)
+SET(CMAKE_C_COMPILER  "${CROSS_COMPILE}gcc")
 EOF
 
 do_cmake() {
-       cmake -DCMAKE_TOOLCHAIN_FILE=$TOOLCHAIN_FILE "$@"
+       cmake -DCMAKE_TOOLCHAIN_FILE="$TOOLCHAIN_FILE" "$@"
 }
 
 mkdir -p build/k2 build/magpie
index 2e8c9d39b8de2cef392972c6db763e7d138979ac..415dc3ab0feb0e00488578b1feeeb3f9c95e4cbf 100755 (executable)
@@ -1,4 +1,40 @@
 #!/usr/bin/env perl
+##
+ # Copyright (c) 2013 Qualcomm Atheros, Inc.
+ #
+ # All rights reserved.
+ #
+ # Redistribution and use in source and binary forms, with or without
+ # modification, are permitted (subject to the limitations in the
+ # disclaimer below) provided that the following conditions are met:
+ #
+ #  * Redistributions of source code must retain the above copyright
+ #    notice, this list of conditions and the following disclaimer.
+ #
+ #  * Redistributions in binary form must reproduce the above copyright
+ #    notice, this list of conditions and the following disclaimer in the
+ #    documentation and/or other materials provided with the
+ #    distribution.
+ #
+ #  * Neither the name of Qualcomm Atheros nor the names of its
+ #    contributors may be used to endorse or promote products derived
+ #    from this software without specific prior written permission.
+ #
+ # NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
+ # GRANTED BY THIS LICENSE.  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
+ # HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+ # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ ##
+
 use strict;
 my $crc = 0;
 my $bytes;
diff --git a/ath9k_htc/target_firmware/include/rom.h b/ath9k_htc/target_firmware/include/rom.h
new file mode 100644 (file)
index 0000000..3412299
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2013 Qualcomm Atheros, Inc.
+ * Copyright (c) 2016 Oleksij Rempel <linux@rempel-privat.de>
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted (subject to the limitations in the
+ * disclaimer below) provided that the following conditions are met:
+ *
+ *  * Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ *  * Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the
+ *    distribution.
+ *
+ *  * Neither the name of Qualcomm Atheros nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
+ * GRANTED BY THIS LICENSE.  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
+ * HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _ATH_ROM_H_
+#define _ATH_ROM_H_
+
+#include <dt_defs.h>
+#include <hif_api.h>
+#include <htc.h>
+
+int strcmp(const char *s1, const char *s2);
+
+LOCAL BOOLEAN bSet_configuration(void);
+LOCAL void HTCControlSvcProcessMsg(HTC_ENDPOINT_ID EndpointID,
+               adf_nbuf_t hdr_buf, adf_nbuf_t pBuffers, void *arg);
+LOCAL void HTCMsgRecvHandler(adf_nbuf_t hdr_buf,
+               adf_nbuf_t buffer, void *context);
+
+void athos_indirection_table_install(void);
+
+void HIFusb_DescTraceDump(void);
+void _HIFusb_isr_handler(hif_handle_t);
+void _HIFusb_start(hif_handle_t);
+void mUsbEPinHighBandSet(uint8_t EPn, uint8_t dir, uint16_t size);
+void mUsbEPMap(uint8_t EPn, uint8_t MAP);
+void mUsbEPMxPtSzHigh(uint8_t EPn, uint8_t dir, uint16_t size);
+void mUsbEPMxPtSzLow(uint8_t EPn, uint8_t dir, uint16_t size);
+void mUsbFIFOConfig(uint8_t FIFOn, uint8_t cfg);
+void mUsbFIFOMap(uint8_t FIFOn, uint8_t MAP);
+
+#endif /* _ATH_ROM_H_ */
index 36bf86f817dd577c1b61ac351f51c48c3ef2d2e4..180a93ebb69537cad5b1ea0868c306936e44d805 100755 (executable)
@@ -39,7 +39,6 @@
  * user,hence these routines should be called to manipulate
  * anything inside it.
  */
-#include <adf_net.h>
 #include <osapi.h>
 #include "cmnos_api.h"
 #include <Magpie_api.h>
@@ -52,22 +51,22 @@ VDESC * __adf_nbuf_last(VBUF *buf);
 // #############################################################################
 
 /**
- *  
+ *
  * @brief allocate a new nbuf,
- * 
+ *
  * @param hdl (adf_net handle)
  * @param size (size of the new buf)
  * @param reserve (amount of space to reserve in the head)
- * 
+ *
  * @return newly allocated nbuf
  */
-__adf_nbuf_t 
-__adf_nbuf_alloc(adf_os_size_t size, a_uint32_t reserve, 
+__adf_nbuf_t
+__adf_nbuf_alloc(adf_os_size_t size, a_uint32_t reserve,
                  a_uint32_t align)
 {
     VBUF *buf = NULL;
     VDESC *desc;
-    
+
     buf = VBUF_alloc_vbuf();
     if ( buf != NULL ) {
         desc = VDESC_alloc_vdesc();
@@ -76,21 +75,21 @@ __adf_nbuf_alloc(adf_os_size_t size, a_uint32_t reserve,
         desc->next_desc = NULL;
         desc->data_offset = reserve;
         desc->data_size = 0;
-        desc->control = 0;    
-        
+        desc->control = 0;
+
         buf->desc_list = desc;
-        buf->buf_length = 0;    
+        buf->buf_length = 0;
     }
-    
+
     return buf;
-}   
-  
+}
+
 /**
  * @brief Free the nbuf
  * function to be called in
  * @param hdl
  * @param adf_nbuf
- * 
+ *
  */
 void __adf_nbuf_free(__adf_nbuf_t  buf)
 {
@@ -100,13 +99,13 @@ void __adf_nbuf_free(__adf_nbuf_t  buf)
 /**
  * @brief reallocate the head space, call it only after the you
  *        have called headroom
- * 
+ *
  * @param adf_nbuf
- * @param headroom   
- * 
+ * @param headroom
+ *
  * @return new nbuf
  */
-__adf_nbuf_t 
+__adf_nbuf_t
 __adf_nbuf_realloc_headroom(__adf_nbuf_t buf, a_uint32_t headroom)
 {
     adf_os_assert(0);
@@ -116,13 +115,13 @@ __adf_nbuf_realloc_headroom(__adf_nbuf_t buf, a_uint32_t headroom)
 /**
  * @brief expand the tailroom, mostly by adding the new tail
  *        buffer, also take care of the priv
- * 
+ *
  * @param buf
  * @param tailroom
- * 
+ *
  * @return struct mbuf * (buffer with the new tailroom)
  */
-__adf_nbuf_t 
+__adf_nbuf_t
 __adf_nbuf_realloc_tailroom(__adf_nbuf_t  buf, a_uint32_t tailroom)
 {
     adf_os_assert(0);
@@ -131,14 +130,14 @@ __adf_nbuf_realloc_tailroom(__adf_nbuf_t  buf, a_uint32_t tailroom)
 
 /**
  * @brief expand the headroom or tailroom or both
- * 
+ *
  * @param buf
  * @param headroom ( 0 if no headroom expansion req)
  * @param tailroom ( 0 if no tailroom expansion req)
- * 
+ *
  * @return struct mbuf* (NULL if something goofed up)
  */
-__adf_nbuf_t 
+__adf_nbuf_t
 __adf_nbuf_expand(__adf_nbuf_t buf, a_uint32_t headroom, a_uint32_t tailroom)
 {
     adf_os_assert(0);
@@ -147,19 +146,19 @@ __adf_nbuf_expand(__adf_nbuf_t buf, a_uint32_t headroom, a_uint32_t tailroom)
 
 /**
  * @brief put data in the head
- * 
+ *
  * @param buf
  * @param len (how much data to put)
- * 
+ *
  * @return new data pointer ,NULL if the len is more than the
  *         space available in the head frag.
  */
-a_uint8_t *       
+a_uint8_t *
 __adf_nbuf_push_head(__adf_nbuf_t buf, adf_os_size_t len)
 {
-    a_uint8_t *ptr = NULL; 
+    a_uint8_t *ptr = NULL;
     VDESC *desc = buf->desc_list;
-    
+
     desc->data_offset -= len;
     desc->data_size += len;
     buf->buf_length += len;
@@ -168,12 +167,12 @@ __adf_nbuf_push_head(__adf_nbuf_t buf, adf_os_size_t len)
 }
 
 /**
- * 
+ *
  * @brief add data in the end of tail
- * 
+ *
  * @param buf
  * @param len (how much data to put)
- * 
+ *
  * @return previous tail (data+len),NULL if the len is more than
  *         space available
  */
@@ -182,79 +181,79 @@ __adf_nbuf_put_tail(__adf_nbuf_t buf, adf_os_size_t len)
 {
     a_uint8_t *tail = NULL;
     VDESC *last_desc = __adf_nbuf_last(buf);
-    
+
     tail = last_desc->buf_addr + last_desc->data_offset + last_desc->data_size;
     last_desc->data_size += len;
     buf->buf_length += len;
-    
+
     return tail;
 }
 
 /**
  * @brief strip data from head
- * 
+ *
  * @param adf_nbuf
  * @param len (how much data to rip)
- * 
+ *
  * @return new data pointer
  */
-a_uint8_t * 
+a_uint8_t *
 __adf_nbuf_pull_head(__adf_nbuf_t buf, adf_os_size_t len)
 {
     a_uint8_t *ptr = NULL;
     VDESC *desc = buf->desc_list;
-    
+
     desc->data_offset += len;
     desc->data_size -= len;
     buf->buf_length -= len;
     ptr = desc->buf_addr + desc->data_offset;
-    
+
     return ptr;
 }
 /**
  * @brief strip data from tail, priv safe
- * 
+ *
  * @param buf
  * @param len (how much to strip down)
- * 
+ *
  */
-void 
+void
 __adf_nbuf_trim_tail(__adf_nbuf_t buf, adf_os_size_t len)
 {
     VDESC *last_desc = __adf_nbuf_last(buf);
-    
+
     adf_os_assert(buf != NULL);
     last_desc->data_size -= len;
     buf->buf_length -= len;
-    
+
     //adf_os_assert(0);    //0820
 }
 /**
  * @brief Copy assumes that we create a writeable copy of the
  *        nbuf which is equivalent in FreeBSD as duping the
  *        mbuf.
- * 
+ *
  * @param src
- * 
+ *
  * @return struct mbuf * (newly allocated buffer)
  */
-__adf_nbuf_t 
+__adf_nbuf_t
 __adf_nbuf_copy(__adf_nbuf_t src)
 {
-    __adf_nbuf_t buf = NULL; 
+    __adf_nbuf_t buf = NULL;
 
     adf_os_assert(src != NULL);
-    
+
     return buf;
 }
 /**
  * @brief make the writable copy of the nbuf
- * 
+ *
  * @param adf_nbuf
- * 
+ *
  * @return new nbuf
  */
-__adf_nbuf_t 
+__adf_nbuf_t
 __adf_nbuf_unshare(__adf_nbuf_t  src)
 {
     __adf_nbuf_t buf = NULL;
@@ -267,32 +266,32 @@ __adf_nbuf_unshare(__adf_nbuf_t  src)
 /**
  * @brief return the frag data & len, where frag no. is
  *        specified by the index
- * 
+ *
  * @param[in] buf
  * @param[out] sg (scatter/gather list of all the frags)
- * 
+ *
  */
-void  
+void
 __adf_nbuf_frag_info(__adf_nbuf_t buf, adf_os_sglist_t *sg)
 {
     VDESC *desc = buf->desc_list;
     int count = 0;
-    
+
     while( desc != NULL ) {
         sg->sg_segs[count].vaddr = desc->buf_addr + desc->data_offset;
         sg->sg_segs[count].len   = desc->data_size;
-        
-        count++;        
+
+        count++;
         desc = desc->next_desc;
     }
-    
+
     sg->nsegs = count;
 }
 /**
  * @brief retrieve the priv space pointer from nbuf
- * 
+ *
  * @param buf (nbuf to attach the priv space)
- * 
+ *
  * @return uint8_t* ( pointer to the data )
  */
 a_uint8_t *
@@ -304,15 +303,15 @@ __adf_nbuf_get_priv(__adf_nbuf_t buf)
 }
 
 /**
- * 
+ *
  * @brief append the nbuf to the queue
- * 
+ *
  * @param adf_qhead
  * @param adf_nbuf
- * 
+ *
  */
-void 
-__adf_nbuf_queue_add(__adf_nbuf_qhead_t  *qhead, 
+void
+__adf_nbuf_queue_add(__adf_nbuf_qhead_t  *qhead,
                      __adf_nbuf_t  buf)
 {
     qhead->qlen++;
@@ -330,12 +329,12 @@ __adf_nbuf_queue_add(__adf_nbuf_qhead_t  *qhead,
 
 /**
  * @brief dequeue an nbuf
- * 
+ *
  * @param adf_qhead
- * 
+ *
  * @return the nbuf
  */
-__adf_nbuf_t   
+__adf_nbuf_t
 __adf_nbuf_queue_remove(__adf_nbuf_qhead_t *qhead)
 {
     __adf_nbuf_t  b0 = NULL;
@@ -349,7 +348,7 @@ __adf_nbuf_queue_remove(__adf_nbuf_qhead_t *qhead)
         } else {
             qhead->head = qhead->head->next_buf;
         }
-    
+
         b0->next_buf = NULL;
     }
        return b0;
@@ -363,51 +362,51 @@ __adf_nbuf_queue_remove(__adf_nbuf_qhead_t *qhead)
 /**
  * @brief creates a streaming mapping (takes a pre allocated
  *        global tag for 4K mbuf sizes)
- * 
+ *
  * @param hdl
  * @param max_sz
  * @param dmap
- * 
+ *
  * @return a_status_t
  */
-a_status_t 
+a_status_t
 __adf_nbuf_dmamap_create(__adf_os_device_t osdev, __adf_os_dma_map_t *dmap)
 {
     a_status_t retval = A_STATUS_OK;
-    
+
     (*dmap) = A_ALLOCRAM(sizeof(struct __adf_dma_map));
     if(*dmap == NULL)
         return A_STATUS_ENOMEM;
-            
+
     (*dmap)->buf = NULL;
     return retval;
 }
 
 
-a_status_t 
-__adf_nbuf_map(__adf_os_device_t osdev, __adf_os_dma_map_t bmap, 
+a_status_t
+__adf_nbuf_map(__adf_os_device_t osdev, __adf_os_dma_map_t bmap,
                           __adf_nbuf_t buf, adf_os_dma_dir_t dir)
-{   
+{
     bmap->buf = buf;
-    
+
     return A_STATUS_OK;
 }
 
-void 
-__adf_nbuf_unmap(__adf_os_device_t osdev, __adf_os_dma_map_t bmap, 
+void
+__adf_nbuf_unmap(__adf_os_device_t osdev, __adf_os_dma_map_t bmap,
                             adf_os_dma_dir_t dir)
 {
     bmap->buf = NULL;
-    
+
     return;
 }
 
 void
-__adf_nbuf_dmamap_destroy(__adf_os_device_t osdev, 
+__adf_nbuf_dmamap_destroy(__adf_os_device_t osdev,
                           __adf_os_dma_map_t dmap)
 {
     //dmap->buf = NULL;
-    
+
     // Should not be called in FW!
     //return A_STATUS_OK;
 }
@@ -415,26 +414,26 @@ __adf_nbuf_dmamap_destroy(__adf_os_device_t osdev,
 
 
 /**
- * @brief return the dma map info 
- * 
+ * @brief return the dma map info
+ *
  * @param[in]  bmap
  * @param[out] sg (map_info ptr)
  */
-void 
+void
 __adf_nbuf_dmamap_info(__adf_os_dma_map_t bmap, adf_os_dmamap_info_t *sg)
 {
     VDESC *desc = bmap->buf->desc_list;
     int count = 0;
-    
+
     while( desc != NULL ) {
         sg->dma_segs[count].paddr = (adf_os_dma_addr_t)(desc->buf_addr + desc->data_offset);
         sg->dma_segs[count].len   = desc->data_size;
-        
-        count++;        
+
+        count++;
         desc = desc->next_desc;
     }
-    
-    sg->nsegs = count;    
+
+    sg->nsegs = count;
 }
 
 /**
@@ -445,18 +444,18 @@ __adf_nbuf_dmamap_info(__adf_os_dma_map_t bmap, adf_os_dmamap_info_t *sg)
 /**
  * @brief sets the cksum type & value for nbuf
  * XXX: not fully implemented
- * 
+ *
  * @param buf
  * @param cksum
  */
-void 
+void
 __adf_nbuf_set_rx_cksum(__adf_nbuf_t buf, adf_nbuf_rx_cksum_t *cksum)
 {
 
 }
 
-a_status_t      
-__adf_nbuf_get_vlan_info(adf_net_handle_t hdl, __adf_nbuf_t buf, 
+a_status_t
+__adf_nbuf_get_vlan_info(adf_net_handle_t hdl, __adf_nbuf_t buf,
                          adf_net_vlanhdr_t *vlan)
 {
     return A_STATUS_OK;
@@ -504,7 +503,7 @@ __adf_nbuf_create_frm_frag(__adf_nbuf_queue_t *qhead)
     }
 
     if (cnt != len) {
-        //adf_os_print("cnt: %x, len: %x, __adf_nbuf_queue_len: %x\n", cnt, len, 
+        //adf_os_print("cnt: %x, len: %x, __adf_nbuf_queue_len: %x\n", cnt, len,
         //             __adf_nbuf_queue_len(qhead));
         adf_os_assert(0);
     }
@@ -547,36 +546,36 @@ __adf_nbuf_split_to_frag(__adf_nbuf_t buf, __adf_nbuf_qhead_t *qhead)
     buf->desc_list = NULL;
     buf->buf_length = 0;
     VBUF_free_vbuf(buf);
-    
+
 }
 
 /**
  * @brief return the last mbuf
- * 
+ *
  * @param m0
- * 
+ *
  * @return struct mbuf*
  */
-VDESC * 
+VDESC *
 __adf_nbuf_last(VBUF *buf)
 {
     VDESC *desc = buf->desc_list;
-    
+
     //for(; desc->next_desc != NULL; desc = desc->next_desc)
     //    ;
     while(desc->next_desc != NULL)
     {
         desc = desc->next_desc;
     }
-    
+
     return desc;
 }
 
 /**
  * @brief num bytes in the head
- * 
+ *
  * @param adf_nbuf
- * 
+ *
  * @return num of bytes available
  */
 a_uint32_t
@@ -589,45 +588,45 @@ __adf_nbuf_headroom(__adf_nbuf_t  buf)
 /**
  * @brief num of bytes available in the tail excluding the priv
  *        portion
- * 
+ *
  * @param adf_nbuf
- * 
+ *
  * @return num of bytes
  */
 
-a_uint32_t 
+a_uint32_t
 __adf_nbuf_tailroom(__adf_nbuf_t  buf)
 {
     VDESC *last_desc = __adf_nbuf_last(buf);
-    
+
     return last_desc->buf_size - last_desc->data_offset - last_desc->data_size;
 }
 
 /**
  * @brief get the entire packet length
- * 
+ *
  * @param adf_nbuf
- * 
+ *
  * @return total length of packet (sum of all frag lengths)
- */ 
+ */
 a_uint32_t
 __adf_nbuf_len(__adf_nbuf_t  buf)
 {
-    return buf->buf_length; 
+    return buf->buf_length;
 }
 
 /**
  * @brief Clone the nbuf (will not create writeable copies)
- * 
+ *
  * @param adf_nbuf
- * 
+ *
  * @return Read-only copy of the nbuf (including clusters)
  */
-__adf_nbuf_t 
+__adf_nbuf_t
 __adf_nbuf_clone(__adf_nbuf_t  src)
 {
     __adf_nbuf_t buf = NULL;
-    
+
     return buf;
 }
 
@@ -641,9 +640,9 @@ __adf_nbuf_cat(__adf_nbuf_t dst, __adf_nbuf_t src)
 
 /*
  * @brief check if the mbuf is cloned or not
- * 
+ *
  * @param buf
- * 
+ *
  * @return a_bool_t
  */
 a_bool_t
@@ -655,19 +654,19 @@ __adf_nbuf_is_cloned(__adf_nbuf_t  buf)
  * @brief This will return the header's addr & m_len
  */
 void
-__adf_nbuf_peek_header(__adf_nbuf_t buf, a_uint8_t   **addr, 
+__adf_nbuf_peek_header(__adf_nbuf_t buf, a_uint8_t   **addr,
                        a_uint32_t      *len)
 {
     VDESC *desc = buf->desc_list;
-    
+
     *addr = desc->buf_addr + desc->data_offset;
-    *len = desc->data_size; 
+    *len = desc->data_size;
 }
 /**
  * @brief init the queue
  * @param qhead
  */
-void 
+void
 __adf_nbuf_queue_init(__adf_nbuf_qhead_t *qhead)
 {
     qhead->qlen = 0;
@@ -677,11 +676,11 @@ __adf_nbuf_queue_init(__adf_nbuf_qhead_t *qhead)
 /**
  * @brief return the length of queue
  * @param adf_qhead
- * 
+ *
  * @return length
- * 
+ *
  */
-a_uint32_t  
+a_uint32_t
 __adf_nbuf_queue_len(__adf_nbuf_qhead_t *qhead)
 {
     return qhead->qlen;
@@ -689,34 +688,34 @@ __adf_nbuf_queue_len(__adf_nbuf_qhead_t *qhead)
 /**
  * @brief returns the first guy in the Q
  * @param qhead
- * 
+ *
  * @return (NULL if the Q is empty)
  */
-__adf_nbuf_t   
+__adf_nbuf_t
 __adf_nbuf_queue_first(__adf_nbuf_queue_t *qhead)
 {
     return qhead->head;
 }
 /**
  * @brief return the next packet from packet chain
- * 
+ *
  * @param buf (packet)
- * 
+ *
  * @return (NULL if no packets are there)
  */
-__adf_nbuf_t   
+__adf_nbuf_t
 __adf_nbuf_queue_next(__adf_nbuf_t  buf)
 {
     return buf->next_buf;
 }
 /**
  * @brief check if the queue is empty or not
- * 
+ *
  * @param qhead
- * 
+ *
  * @return a_bool_t
  */
-a_bool_t  
+a_bool_t
 __adf_nbuf_is_queue_empty(__adf_nbuf_qhead_t *qhead)
 {
     return ((qhead->qlen == 0));
index 0b21fb8a21cd7b09079ba9667b17ded5b219619b..a4465836c8ac73beadf15880de71af199cf941e8 100755 (executable)
@@ -33,7 +33,7 @@
  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 /*
- *  FreeBSD specific prototypes 
+ *  FreeBSD specific prototypes
  */
 #ifndef _ADF_NBUF_PVT_H
 #define _ADF_NBUF_PVT_H
@@ -44,7 +44,7 @@
 //#include <adf_nbuf_api.h>
 
 #define __ADF_NBUF_NULL         NULL
-#define __ADF_NBUF_CTX_BUF      
+#define __ADF_NBUF_CTX_BUF
 
 typedef VBUF *     __adf_nbuf_t;
 
@@ -53,94 +53,94 @@ typedef VBUF *     __adf_nbuf_t;
  */
 typedef struct __adf_nbuf_qhead {
     VBUF             *head;
-    VBUF             *tail;    
+    VBUF             *tail;
     a_uint32_t        qlen;
 }__adf_nbuf_qhead_t;
 
 typedef __adf_nbuf_qhead_t         __adf_nbuf_queue_t;
 
-__adf_nbuf_t 
-__adf_nbuf_alloc(adf_os_size_t size, 
-                 a_uint32_t reserve, a_uint32_t align);                                
+__adf_nbuf_t
+__adf_nbuf_alloc(adf_os_size_t size,
+                 a_uint32_t reserve, a_uint32_t align);
 
-void 
+void
 __adf_nbuf_free(__adf_nbuf_t  buf);
 
-a_uint8_t *   
+a_uint8_t *
 __adf_nbuf_push_head(__adf_nbuf_t buf, adf_os_size_t size);
-a_uint8_t *    
+
+a_uint8_t *
 __adf_nbuf_pull_head(__adf_nbuf_t buf, adf_os_size_t size);
 
-a_uint8_t *    
+a_uint8_t *
 __adf_nbuf_put_tail(__adf_nbuf_t buf, adf_os_size_t size);
 
-void         
+void
 __adf_nbuf_trim_tail(__adf_nbuf_t buf, adf_os_size_t size);
 
-__adf_nbuf_t 
+__adf_nbuf_t
 __adf_nbuf_realloc_headroom(__adf_nbuf_t buf,
-                            a_uint32_t headroom);                           
-                            
-__adf_nbuf_t 
-__adf_nbuf_realloc_tailroom(__adf_nbuf_t buf, 
+                            a_uint32_t headroom);
+
+__adf_nbuf_t
+__adf_nbuf_realloc_tailroom(__adf_nbuf_t buf,
                             a_uint32_t tailroom);
-                                                
-__adf_nbuf_t 
+
+__adf_nbuf_t
 __adf_nbuf_expand(__adf_nbuf_t buf,
                                a_uint32_t headroom, a_uint32_t tailroom);
-                                                                               
-__adf_nbuf_t 
+
+__adf_nbuf_t
 __adf_nbuf_copy(__adf_nbuf_t src);
 
-__adf_nbuf_t 
+__adf_nbuf_t
 __adf_nbuf_unshare(__adf_nbuf_t  src);
 
-void         
+void
 __adf_nbuf_frag_info(__adf_nbuf_t buf, adf_os_sglist_t *sg);
 
-a_uint8_t *    
+a_uint8_t *
 __adf_nbuf_get_priv(__adf_nbuf_t buf);
-void         
-__adf_nbuf_queue_add(__adf_nbuf_qhead_t *qhead, 
+void
+__adf_nbuf_queue_add(__adf_nbuf_qhead_t *qhead,
                      __adf_nbuf_t buf);
-                                  
-__adf_nbuf_t 
+
+__adf_nbuf_t
 __adf_nbuf_queue_remove(__adf_nbuf_qhead_t *qhead);
 
-a_uint32_t     
-__adf_nbuf_tx_cksum_info(__adf_nbuf_t buf, 
-                         a_uint8_t **hdr_off, 
+a_uint32_t
+__adf_nbuf_tx_cksum_info(__adf_nbuf_t buf,
+                         a_uint8_t **hdr_off,
                          a_uint8_t **where);
-                                      
-void         
+
+void
 __adf_nbuf_set_rx_cksum(__adf_nbuf_t buf, adf_nbuf_rx_cksum_t *cksum);
-void         
+void
 __adf_nbuf_get_tso_info(__adf_nbuf_t buf, adf_nbuf_tso_t *tso);
 
-a_status_t   
-__adf_nbuf_get_vlan_info(adf_net_handle_t hdl, 
-                                      __adf_nbuf_t buf, 
-                                      adf_net_vlanhdr_t *vlan);                                                                                                
-                                       
-void         
+a_status_t
+__adf_nbuf_get_vlan_info(adf_net_handle_t hdl,
+                                      __adf_nbuf_t buf,
+                                      adf_net_vlanhdr_t *vlan);
+
+void
 __adf_nbuf_dmamap_info(__adf_os_dma_map_t bmap, adf_os_dmamap_info_t *sg);
 
 /**
  * @brief return the last mbuf
- * 
+ *
  * @param m0
- * 
+ *
  * @return struct mbuf*
  */
-VDESC * 
+VDESC *
 __adf_nbuf_last(VBUF *buf);
 
 /**
  * @brief num bytes in the head
- * 
+ *
  * @param adf_nbuf
- * 
+ *
  * @return num of bytes available
  */
 a_uint32_t
@@ -149,33 +149,33 @@ __adf_nbuf_headroom(__adf_nbuf_t  buf);
 /**
  * @brief num of bytes available in the tail excluding the priv
  *        portion
- * 
+ *
  * @param adf_nbuf
- * 
+ *
  * @return num of bytes
  */
 
-a_uint32_t 
+a_uint32_t
 __adf_nbuf_tailroom(__adf_nbuf_t  buf);
 
 /**
  * @brief get the entire packet length
- * 
+ *
  * @param adf_nbuf
- * 
+ *
  * @return total length of packet (sum of all frag lengths)
- */ 
+ */
 a_uint32_t
 __adf_nbuf_len(__adf_nbuf_t  buf);
 
 /**
  * @brief Clone the nbuf (will not create writeable copies)
- * 
+ *
  * @param adf_nbuf
- * 
+ *
  * @return Read-only copy of the nbuf (including clusters)
  */
-__adf_nbuf_t 
+__adf_nbuf_t
 __adf_nbuf_clone(__adf_nbuf_t  src);
 
 void
@@ -184,9 +184,9 @@ __adf_nbuf_cat(__adf_nbuf_t dst, __adf_nbuf_t src);
 
 /*
  * @brief check if the mbuf is cloned or not
- * 
+ *
  * @param buf
- * 
+ *
  * @return a_bool_t
  */
 a_bool_t
@@ -196,53 +196,53 @@ __adf_nbuf_is_cloned(__adf_nbuf_t  buf);
  * @brief This will return the header's addr & m_len
  */
 void
-__adf_nbuf_peek_header(__adf_nbuf_t buf, a_uint8_t   **addr, 
+__adf_nbuf_peek_header(__adf_nbuf_t buf, a_uint8_t   **addr,
                        a_uint32_t      *len);
 
 /**
  * @brief init the queue
  * @param qhead
  */
-void 
+void
 __adf_nbuf_queue_init(__adf_nbuf_qhead_t *qhead);
 
 /**
  * @brief return the length of queue
  * @param adf_qhead
- * 
+ *
  * @return length
- * 
+ *
  */
-a_uint32_t  
+a_uint32_t
 __adf_nbuf_queue_len(__adf_nbuf_qhead_t *qhead);
 
 /**
  * @brief returns the first guy in the Q
  * @param qhead
- * 
+ *
  * @return (NULL if the Q is empty)
  */
-__adf_nbuf_t   
+__adf_nbuf_t
 __adf_nbuf_queue_first(__adf_nbuf_queue_t *qhead);
 
 /**
  * @brief return the next packet from packet chain
- * 
+ *
  * @param buf (packet)
- * 
+ *
  * @return (NULL if no packets are there)
  */
-__adf_nbuf_t   
+__adf_nbuf_t
 __adf_nbuf_queue_next(__adf_nbuf_t  buf);
 
 /**
  * @brief check if the queue is empty or not
- * 
+ *
  * @param qhead
- * 
+ *
  * @return a_bool_t
  */
-a_bool_t  
+a_bool_t
 __adf_nbuf_is_queue_empty(__adf_nbuf_qhead_t *qhead);
 
 __adf_nbuf_t
@@ -250,10 +250,10 @@ __adf_nbuf_create_frm_frag(__adf_nbuf_queue_t *head);
 void
 __adf_nbuf_split_to_frag(__adf_nbuf_t buf, __adf_nbuf_queue_t *qhead);
 
-a_status_t      __adf_nbuf_dmamap_create(__adf_os_device_t osdev, 
+a_status_t      __adf_nbuf_dmamap_create(__adf_os_device_t osdev,
                                          __adf_os_dma_map_t *dmap);
 
-void            __adf_nbuf_dmamap_destroy(__adf_os_device_t osdev, 
+void            __adf_nbuf_dmamap_destroy(__adf_os_device_t osdev,
                                           __adf_os_dma_map_t dmap);
 
 a_status_t      __adf_nbuf_map(__adf_os_device_t osdev, __adf_os_dma_map_t dmap,
index ef754a98ce57d5a44af1c114a2f451a790cdf50f..d65fb7deaef2ca274b495cc854af6b25939b7cf3 100755 (executable)
@@ -37,9 +37,6 @@
  * @module_desc     Magpie Network Shim
  */
 
-#include <adf_net.h>
-//#include <asf_queue.h>
-//#include "adf_net_wcmd_pvt.h"
 #include <wlan_pci.h>
 
 /**
 /**
  * @brief register the driver into the shim
  * @param[in] drv
- * 
+ *
  * @return a_status_t
  */
 a_status_t
 __adf_net_register_drv(adf_drv_info_t *drv)
 {
-    wlan_pci_register_drv(drv);    
+    wlan_pci_register_drv(drv);
     return A_STATUS_OK;
 }
 
index 9858823f41cf53c5643892632381e9866d7a7040..00c513d418acf568344bf8938397058c4996707e 100755 (executable)
@@ -44,7 +44,7 @@
 #define __ADF_PCI_BAR0      0x10
 
 
-a_status_t 
+a_status_t
 __adf_net_register_drv(adf_drv_info_t *drv);
 
 void
@@ -80,7 +80,7 @@ __adf_net_carrier_on(adf_net_handle_t hdl)
 
 static inline void
 __adf_net_start_queue(adf_net_handle_t hdl)
-{   
+{
 
 }
 
@@ -118,8 +118,8 @@ static inline adf_net_handle_t __adf_net_dev_create(adf_drv_handle_t hdl, adf_de
     return NULL;
 }
 
-static inline adf_net_handle_t __adf_net_vdev_create(adf_net_handle_t dev_hdl, 
-                                       adf_drv_handle_t hdl, adf_vdev_sw_t *op, 
+static inline adf_net_handle_t __adf_net_vdev_create(adf_net_handle_t dev_hdl,
+                                       adf_drv_handle_t hdl, adf_vdev_sw_t *op,
                                        adf_net_dev_info_t *info)
 {
     return NULL;
@@ -140,6 +140,6 @@ static inline adf_os_handle_t
 __adf_net_hdl_to_os(adf_net_handle_t hdl)
 {
     return NULL;
-}    
+}
 
 #endif
index fcbcc2c1a8818d461328433b22968bc24cdbe60a..0225ccd0c9d140a2db7a57331c657fac98d2f8c0 100755 (executable)
 #ifndef __ADF_OS_ATOMIC_PVT_H
 #define __ADF_OS_ATOMIC_PVT_H
 
-//#include <sys/types.h>
-//#include <machine/atomic.h>
-
-#include <adf_os_types.h>
-
 typedef a_uint32_t  __adf_os_atomic_t;
 
 /**
  * @brief This initiallizes the varriable to zero
- * 
+ *
  * @param __adf_os_atomic_t (int pointer)
- * 
+ *
  */
 static inline void
 __adf_os_atomic_init(__adf_os_atomic_t *v)
@@ -78,7 +73,7 @@ static inline void
 __adf_os_atomic_write(__adf_os_atomic_t *v,a_uint32_t p)
 {
        atomic_store_rel_int(v,(int)p);
-} 
+}
  */
 
 #endif
index b19f0e5ae3c541cf2e3e61cce6e87163c4af9cb9..d27398abe1207107a6ac6b6735f1d1322886ac7b 100755 (executable)
@@ -34,7 +34,7 @@
  */
 #include "adf_os_defer_pvt.h"
 
-void 
+void
 __adf_os_defer_func(void *arg, int pending)
 {
        __adf_os_defer_ctx_t *ctx = (__adf_os_defer_ctx_t *)arg;
index 525a7f422336456a1260ccd4d1cf26fb71eac2db..66b4ee836b9d381d7196f74b337078ff30f88746 100755 (executable)
@@ -66,13 +66,13 @@ extern void __adf_os_defer_func(void *arg, int pending);
 
 /**
  * @brief initiallize the defer function (work or bh)
- * 
+ *
  * @param defer
  * @param func
  * @param arg
  */
 static inline void __adf_os_init_defer(__adf_os_defer_t  *defer,
-                                       adf_os_defer_fn_t    func, 
+                                       adf_os_defer_fn_t    func,
                                        void              *arg)
 {
     defer->ctx.caller_fn  = func;
@@ -97,27 +97,27 @@ static inline void  __adf_os_init_bh(adf_os_handle_t  hdl,
        //__adf_os_init_defer(bh, func, arg);
        A_TASKLET_INIT_TASK(func, arg, bh);
 }
-static inline void __adf_os_sched_work(adf_os_handle_t  hdl, 
+static inline void __adf_os_sched_work(adf_os_handle_t  hdl,
                                        __adf_os_work_t  * work)
 {
     //taskqueue_enqueue(taskqueue_thread, &work->tsk);
 }
-static inline void __adf_os_disable_work(adf_os_handle_t  hdl, 
+static inline void __adf_os_disable_work(adf_os_handle_t  hdl,
                                          __adf_os_work_t  * work)
 {
     //taskqueue_drain(taskqueue_thread, &work->tsk);
 }
 
-static inline void __adf_os_sched_bh(adf_os_handle_t  hdl, 
+static inline void __adf_os_sched_bh(adf_os_handle_t  hdl,
                                        __adf_os_bh_t  * bh)
 {
     A_TASKLET_SCHEDULE(bh);
 }
 
-static inline void __adf_os_disable_bh(adf_os_handle_t  hdl, 
+static inline void __adf_os_disable_bh(adf_os_handle_t  hdl,
                                        __adf_os_bh_t  * bh)
 {
     A_TASKLET_DISABLE(bh);
 }
 
-#endif 
+#endif
index 915e8e0b3eefd5f40cbc9fe6af3215bee0c4c952..c29f8e45f7f32e48673e412782ff98551e52f1fe 100755 (executable)
@@ -45,7 +45,7 @@ void __adf_os_dma_load(void *arg, bus_dma_segment_t *dseg, int nseg, int error)
        adf_os_assert(nseg == 1);
 
        ((bus_dma_segment_t *)arg)[0].ds_addr = dseg[0].ds_addr;
-       ((bus_dma_segment_t *)arg)[0].ds_len  = dseg[0].ds_len; 
+       ((bus_dma_segment_t *)arg)[0].ds_len  = dseg[0].ds_len;
 }
 #endif
 
@@ -53,29 +53,29 @@ void __adf_os_dma_load(void *arg, bus_dma_segment_t *dseg, int nseg, int error)
  * @brief Allocates a DMA region, uses the tag elem to store the
  *        tag value which constant for all the mappings done
  *        through this API.
- * 
+ *
  * @param osdev
  * @param size
  * @param coherent
  * @param dmap
- * 
+ *
  * @return void* (Virtual address)
  */
 inline void*
-__adf_os_dmamem_alloc(__adf_os_device_t osdev, adf_os_size_t size, 
+__adf_os_dmamem_alloc(__adf_os_device_t osdev, adf_os_size_t size,
                       a_bool_t coherent, __adf_os_dma_map_t *dmap)
-{    
+{
     (*dmap) = A_ALLOCRAM(sizeof(struct __adf_dma_map));
-    
+
        if((*dmap) == NULL){
                goto fail_malloc;
        }
-           
+
     (*dmap)->ds_addr = A_ALLOCRAM(size);
     (*dmap)->ds_len = size;
-    
+
     return (*dmap)->ds_addr;
-    
-fail_malloc: 
-    return NULL;            
+
+fail_malloc:
+    return NULL;
 }
index bf4180b0f4eca02490f0ece99f5f22107831bf68..342b2fcbbcdc85559d2de95d89966468516579dd 100755 (executable)
 #include <adf_os_util.h>
 
 inline void*
-__adf_os_dmamem_alloc(__adf_os_device_t osdev, adf_os_size_t size, 
+__adf_os_dmamem_alloc(__adf_os_device_t osdev, adf_os_size_t size,
                       a_bool_t coherent, __adf_os_dma_map_t *dmap);
 
-/* 
- * Free a previously mapped DMA buffer 
+/*
+ * Free a previously mapped DMA buffer
  * Direction doesnt matter, since this API is called at closing time.
  */
 static inline void
 __adf_os_dmamem_free(adf_os_device_t    osdev, __adf_os_size_t size, a_bool_t coherent,
                                          void *vaddr, __adf_os_dma_map_t dmap)
-{ 
+{
 
 }
 
@@ -57,7 +57,7 @@ __adf_os_dmamem_free(adf_os_device_t    osdev, __adf_os_size_t size, a_bool_t co
 //#define __adf_os_dmamem_map2addr(_dmap)    ((_dmap)->seg[0].ds_addr)
 #define __adf_os_dmamem_map2addr(_dmap) ((adf_os_dma_addr_t)(_dmap)->ds_addr)
 
-static inline void 
+static inline void
 __adf_os_dmamem_cache_sync(__adf_os_device_t osdev, __adf_os_dma_map_t dmap, adf_os_cache_sync_t sync)
 {
 
index 105216ffe25b3952c4a797465d77eabf3ce69c55..1b37cefc0d4faec75bb320205fd5b02ba3c46cbb 100755 (executable)
@@ -53,6 +53,6 @@
 #define __adf_os_htons(x)                          x
 #define __adf_os_htonl(x)                          x
 
-#define __adf_os_cpu_to_le16(x)                                __bswap16(x)                    
+#define __adf_os_cpu_to_le16(x)                                __bswap16(x)
 
 #endif
index 5a7dfb7230f6192f1a0d53e84b524669d4b65769..90212bc409f34aec3ceeeb7351d32ac5b9bef2ec 100755 (executable)
@@ -45,7 +45,7 @@ extern adf_os_drv_intr         g_wlan_intr;
  * @brief setup the Interrupt handler for the driver
  * @param[in] dev
  * @param[in] sc
- * 
+ *
  * @return int
  */
 
@@ -53,8 +53,8 @@ int
 __adf_os_setup_intr(__adf_os_device_t  osdev, adf_os_drv_intr fn)
 {
     g_wlan_intr = fn;
-    
-    return 0;    
+
+    return 0;
 }
 
 /**
@@ -65,5 +65,5 @@ __adf_os_setup_intr(__adf_os_device_t  osdev, adf_os_drv_intr fn)
 void
 __adf_os_free_intr(__adf_os_device_t osdev)
 {
-    g_wlan_intr = NULL;  
+    g_wlan_intr = NULL;
 }
index aa60e13ddd34c499ebb2a56ee1e260d58897f4e6..20ac8148320f8d0bc545e03b4856e107845835c2 100755 (executable)
@@ -40,7 +40,7 @@ typedef int           __adf_os_mutex_t;
 
 static inline void __adf_os_init_mutex(__adf_os_mutex_t *mtx)
 {
-       
+
 }
 
 static inline int __adf_os_mutex_acquire(__adf_os_mutex_t *mtx)
@@ -77,7 +77,7 @@ static inline void            __adf_os_spin_unlock_bh(__adf_os_spinlock_t     *lock)
 {
        //mtx_unlock_spin(lock);
 }
-static inline a_bool_t __adf_os_spinlock_irq_exec(adf_os_handle_t  hdl, __adf_os_spinlock_t *lock, 
+static inline a_bool_t __adf_os_spinlock_irq_exec(adf_os_handle_t  hdl, __adf_os_spinlock_t *lock,
                                                   adf_os_irqlocked_func_t func, void *arg)
 {
     return 0;
index b5bcfa1b492d8493100ce0b9575df8e34d81eb24..7b2f0e1bdbd225d6a143fd199d6feb315c781c2f 100755 (executable)
@@ -53,7 +53,7 @@ static inline void            __adf_os_mem_free(void *buf)
 /* move a memory buffer */
 static inline void             __adf_os_mem_copy(void *dst, const void *src, adf_os_size_t size)
 {
-    A_MEMCPY(dst,src,size);    
+    A_MEMCPY(dst,src,size);
 }
 
 /* set a memory buffer */
index 08a9617570f101747cca4e3ce393d9dded264dc6..08313ba0bf3f668dc638405cf107e880f3d227cc 100755 (executable)
 
 /**
  * @brief generic driver /module init function
- * 
+ *
  * @param mod (module data)
  * @param event (LOAD or UNLOAD)
  * @param arg (any extra argument needed if
- * 
+ *
  * @return int
  */
 /**
  * exit module macro
  */
-#define __adf_os_virt_module_exit(_fn)  
+#define __adf_os_virt_module_exit(_fn)
 
-#define __adf_os_module_dep(_name, _dep)    
+#define __adf_os_module_dep(_name, _dep)
 
 #endif
index c4d6b703f26cd0e2ac87910c755955c6a44861b0..4e7861f403d128c22220e4b1764d04a98468a670 100755 (executable)
@@ -47,7 +47,7 @@
 /**
  * exit module macro
  */
-#define __adf_os_pci_module_exit(_fn)   
+#define __adf_os_pci_module_exit(_fn)
 
 /**
  * initiallize the PCI driver structure
  * @param osdev
  * @param offset
  * @param val
- * 
+ *
  * @return int
  */
-static inline int 
+static inline int
 __adf_os_pci_config_read8(adf_os_device_t osdev, int offset, a_uint8_t *val)
 {
     (*val) = wlan_pci_config_read(offset, 1);
@@ -82,39 +82,39 @@ __adf_os_pci_config_read8(adf_os_device_t osdev, int offset, a_uint8_t *val)
      */
 }
 
-static inline int 
+static inline int
 __adf_os_pci_config_write8(adf_os_device_t osdev, int offset, a_uint8_t val)
 {
     wlan_pci_config_write(offset, val, 1);
-    return 0;    
+    return 0;
 }
 
-static inline int 
+static inline int
 __adf_os_pci_config_read16(adf_os_device_t osdev, int offset, a_uint16_t *val)
 {
     (*val) = wlan_pci_config_read(offset, 2);
     return 0;
 }
 
-static inline int 
+static inline int
 __adf_os_pci_config_write16(adf_os_device_t osdev, int offset, a_uint16_t val)
 {
     wlan_pci_config_write(offset, val, 2);
-    return 0;  
+    return 0;
 }
 
-static inline int 
+static inline int
 __adf_os_pci_config_read32(adf_os_device_t osdev, int offset, a_uint32_t *val)
 {
     (*val) = wlan_pci_config_read(offset, 4);
     return 0;
 }
 
-static inline int 
+static inline int
 __adf_os_pci_config_write32(adf_os_device_t osdev, int offset, a_uint32_t val)
 {
     wlan_pci_config_write(offset, val, 4);
-    return 0;  
+    return 0;
 }
 
 #endif
index 3b9d02a108780fa3dcaa82641e95d5c878d31047..708ff434b9f863e467c098046ecc8460e34037e1 100755 (executable)
@@ -42,7 +42,7 @@
  * @brief this code is modified version of tvtohz(9) which
  *        returns signed int which we don't require, hence we
  *        got rid of the type casting thing
- * 
+ *
  * @return unsigned long
  */
 static inline unsigned long
@@ -63,7 +63,7 @@ __adf_os_msecs_to_ticks(a_uint32_t msecs)
 static inline unsigned long
 __adf_os_getuptime(void)
 {
-    return MSEC_TO_TICK(A_MILLISECONDS());;      
+    return MSEC_TO_TICK(A_MILLISECONDS());;
 }
 
 static inline void
index 7ae74be0ad876ab4d0804e5137f92558fbbe6509..936ab856901a3c5c7bb9cb493c0eef4f4c8b7dff 100755 (executable)
@@ -39,7 +39,7 @@
 #include "Magpie_api.h"
 
 
-typedef struct 
+typedef struct
 {
        A_timer_t                               *magpie_timer;
        adf_os_timer_func_t     timer_func;
@@ -50,7 +50,7 @@ typedef struct
 void
 __adf_os_timer_func(A_HANDLE timer_handle, void *arg);
 
-/* 
+/*
  * Initialize a timer
  */
 static inline void
@@ -61,8 +61,8 @@ __adf_os_timer_init(adf_os_handle_t  hdl, __adf_os_timer_t   *timer,
     A_INIT_TIMER(timer->magpie_timer, __adf_os_timer_func, arg);
 }
 
-/* 
- * start a timer 
+/*
+ * start a timer
  */
 static inline void
 __adf_os_timer_start(__adf_os_timer_t *timer, int msec)
index dc8316c876350eeb9cc371cb992b836d39dba682..5ff6a1cbabf27f39c7d30cbcef0943c10f9a0b58 100755 (executable)
 /**
  * CACHE-SYNC (DMA)
  */
-#define __ADF_SYNC_PREREAD         0 
+#define __ADF_SYNC_PREREAD         0
 #define __ADF_SYNC_POSTREAD               1
 #define __ADF_SYNC_PREWRITE               2
 #define __ADF_SYNC_POSTWRITE      3
 
 #define __ADF_OS_DMA_TO_DEVICE     0
-#define __ADF_OS_DMA_FROM_DEVICE   1 
-      
+#define __ADF_OS_DMA_FROM_DEVICE   1
+
 
 struct __adf_softc;
 
@@ -86,24 +86,24 @@ enum __adf_net_wireless_evcode{
     __ADF_IEEE80211_SCAN = 105,
     __ADF_IEEE80211_REPLAY = 106,
     __ADF_IEEE80211_MICHAEL = 107,
-    __ADF_IEEE80211_REJOIN = 108, 
+    __ADF_IEEE80211_REJOIN = 108,
     __ADF_CUSTOM_PUSH_BUTTON = 109,
 };
 
 /* generic data types */
 struct __adf_device  {
-int dummy;    
-}; 
+int dummy;
+};
 
 typedef struct __adf_device *__adf_os_device_t;
 
 
 struct __adf_dma_map {
     VBUF *buf;
-    
+
     A_UINT32 *ds_addr;
     A_UINT16 ds_len;
-}; 
+};
 
 typedef struct __adf_dma_map *__adf_os_dma_map_t;
 
@@ -116,23 +116,23 @@ typedef int             __adf_os_off_t;
 #define __adf_os_iomem_t
 
 #if 0
-typedef int           __a_uint8_t;    
-typedef int            __a_int8_t;     
-typedef int          __a_uint16_t;   
-typedef int           __a_int16_t;    
-typedef int          __a_uint32_t;   
-typedef int           __a_int32_t;    
-typedef int          __a_uint64_t;   
-typedef int           __a_int64_t; 
+typedef int           __a_uint8_t;
+typedef int            __a_int8_t;
+typedef int          __a_uint16_t;
+typedef int           __a_int16_t;
+typedef int          __a_uint32_t;
+typedef int           __a_int32_t;
+typedef int          __a_uint64_t;
+typedef int           __a_int64_t;
 #else
 typedef A_UINT8           __a_uint8_t;
-typedef A_INT8            __a_int8_t;     
-typedef A_UINT16          __a_uint16_t;   
-typedef A_INT16          __a_int16_t;    
-typedef A_UINT32          __a_uint32_t;   
-typedef A_INT32          __a_int32_t;    
-typedef A_UINT64          __a_uint64_t;   
-typedef A_INT64           __a_int64_t;    
+typedef A_INT8            __a_int8_t;
+typedef A_UINT16          __a_uint16_t;
+typedef A_INT16          __a_int16_t;
+typedef A_UINT32          __a_uint32_t;
+typedef A_INT32          __a_int32_t;
+typedef A_UINT64          __a_uint64_t;
+typedef A_INT64           __a_int64_t;
 
 typedef A_UINT32            u_int32_t;
 typedef A_UINT16            u_int16_t;
@@ -150,7 +150,7 @@ typedef A_UINT64            u_int64_t;
 //#define __adf_os_print        my_printf
 #define __adf_os_print          A_PRINTF
 
-#if 1  
+#if 1
 #if defined(__XCC__)
 #include "stdarg.h"
 #define __va_list __gnuc_va_list
index 0efeb06318555e71f715a162d89572ecc17d908b..23b71b114d9a4a92cb2dec82cd30dae2269748f4 100755 (executable)
 
 #include <adf_os_types.h>
 
-#define __adf_os_unlikely(_expr)   
-#define __adf_os_likely(_expr)    
+#define __adf_os_unlikely(_expr)
+#define __adf_os_likely(_expr)
 
 /**
- * @brief memory barriers. 
+ * @brief memory barriers.
  */
 #define __adf_os_wmb()          oops no implementation...
 #define __adf_os_rmb()          oops no implementation...
 #define __adf_os_mb()           oops no implementation...
 
-#define __adf_os_min(_a, _b)   ((_a < _b) ? _a : _b)         
-#define __adf_os_max(_a, _b)    ((_a > _b) ? _a : _b)     
+#define __adf_os_min(_a, _b)   ((_a < _b) ? _a : _b)
+#define __adf_os_max(_a, _b)    ((_a > _b) ? _a : _b)
 
 #ifdef _DEBUG_BUILD_
 #define __adf_os_assert(expr)  do {\
 #define inline
 #endif
 
-static void inline     
+static void inline
 __adf_os_get_rand(adf_os_handle_t  hdl,__a_uint8_t *ptr, __a_uint32_t len)
 {
-#if 0    
+#if 0
        u_int8_t *dp = ptr;
        u_int32_t v;
        size_t nb;
@@ -93,7 +93,7 @@ __adf_os_get_rand(adf_os_handle_t  hdl,__a_uint8_t *ptr, __a_uint32_t len)
                dp += sizeof(u_int32_t);
                len -= nb;
        }
-#endif    
+#endif
 }
 
 
index b4ff2b585832fa38bbe3195dbe5ae31dad518a81..54cdd1d845ba52ac38888bb95f9affe1438a4623 100755 (executable)
@@ -34,9 +34,9 @@
  */
 /*
  * @File: buf_pool_api.h
- * 
+ *
  * @Abstract: BUF Pool api
- * 
+ *
  * @Notes:
  */
 
 /* endpoint defines */
 typedef enum
 {
-    POOL_ID_HTC_CONTROL         = 0, 
-    POOL_ID_WMI_SVC_CMD_REPLY   = 1,  
+    POOL_ID_HTC_CONTROL         = 0,
+    POOL_ID_WMI_SVC_CMD_REPLY   = 1,
     POOL_ID_WMI_SVC_EVENT       = 2,
     POOL_ID_WLAN_RX_BUF         = 3,
-    POOL_ID_MAX                 = 10 
+    POOL_ID_MAX                 = 10
 } BUF_POOL_ID;
 
 typedef void* pool_handle_t;
@@ -60,19 +60,19 @@ typedef void* pool_handle_t;
 /* hardware API table structure (API descriptions below) */
 struct buf_pool_api {
     pool_handle_t (*_init)(adf_os_handle_t handle);
-            
+
     void (*_shutdown)(pool_handle_t handle);
-    
+
     void (*_create_pool)(pool_handle_t handle, BUF_POOL_ID poolId, int nItems, int nSize);
-    
+
     adf_nbuf_t  (*_alloc_buf)(pool_handle_t handle, BUF_POOL_ID poolId, int reserve);
-    
+
     adf_nbuf_t  (*_alloc_buf_align)(pool_handle_t handle, BUF_POOL_ID poolId, int reserve, int align);
-    
+
     void (*_free_buf)(pool_handle_t handle, BUF_POOL_ID poolId, adf_nbuf_t buf);
-    
+
         /* room to expand this table by another table */
-    void *pReserved;    
+    void *pReserved;
 };
 
 extern void buf_pool_module_install(struct buf_pool_api *apis);
diff --git a/ath9k_htc/target_firmware/magpie_fw_dev/target/buf_pool/buf_pool_dynamic.c b/ath9k_htc/target_firmware/magpie_fw_dev/target/buf_pool/buf_pool_dynamic.c
deleted file mode 100755 (executable)
index 7e70fd5..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * Copyright (c) 2013 Qualcomm Atheros, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted (subject to the limitations in the
- * disclaimer below) provided that the following conditions are met:
- *
- *  * Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- *  * Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the
- *    distribution.
- *
- *  * Neither the name of Qualcomm Atheros nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
- *
- * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
- * GRANTED BY THIS LICENSE.  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
- * HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-/*
- * @File: 
- * 
- * @Abstract: Buf pool implementation: Dynamic version
- * 
- * @Notes: 
- */
-#include <adf_os_mem.h>
-#include <adf_os_module.h>
-#include <osapi.h>
-#include <Magpie_api.h> 
-//#include <os/cmnos_api.h>
-#include <buf_pool_api.h>
-LOCAL htc_handle_t _buf_pool_dynamic_init(adf_os_handle_t handle);
-LOCAL void _buf_pool_dynamic_create_pool(pool_handle_t handle, BUF_POOL_ID poolId, int nItems, int nSize);
-LOCAL adf_nbuf_t  _buf_pool_dynamic_alloc_buf(pool_handle_t handle, BUF_POOL_ID poolId, int reserve);
-LOCAL adf_nbuf_t  _buf_pool_dynamic_alloc_buf_align(pool_handle_t handle, BUF_POOL_ID poolId, int reserve, int align);
-LOCAL void _buf_pool_dynamic_free_buf(pool_handle_t handle, BUF_POOL_ID poolId, adf_nbuf_t buf);
-LOCAL void _buf_pool_dynamic_shutdown(pool_handle_t handle);
-       
-typedef struct _POOL_CONFIG {
-    int nSize;
-} POOL_CONFIG;
-       
-typedef struct _BUF_POOL_DYNAMIC_CONTEXT {
-    adf_os_handle_t  OSHandle;
-    POOL_CONFIG poolConf[POOL_ID_MAX]; 
-} BUF_POOL_DYNAMIC_CONTEXT;
-
-void buf_pool_module_install(struct buf_pool_api *pAPIs)
-{   
-    pAPIs->_init = _buf_pool_dynamic_init;
-    pAPIs->_create_pool = _buf_pool_dynamic_create_pool;
-    pAPIs->_alloc_buf = _buf_pool_dynamic_alloc_buf;
-    pAPIs->_alloc_buf_align = _buf_pool_dynamic_alloc_buf_align;
-    pAPIs->_free_buf = _buf_pool_dynamic_free_buf;
-    pAPIs->_shutdown = _buf_pool_dynamic_shutdown;
-}
-LOCAL pool_handle_t _buf_pool_dynamic_init(adf_os_handle_t handle)
-{
-    BUF_POOL_DYNAMIC_CONTEXT *ctx;
-    
-    ctx = (BUF_POOL_DYNAMIC_CONTEXT *)adf_os_mem_alloc(sizeof(BUF_POOL_DYNAMIC_CONTEXT));
-    ctx->OSHandle = handle;
-    
-    return ctx; 
-}      
-    
-LOCAL void _buf_pool_dynamic_shutdown(pool_handle_t handle) 
-{
-    BUF_POOL_DYNAMIC_CONTEXT *ctx = (BUF_POOL_DYNAMIC_CONTEXT *)handle;
-    
-    adf_os_mem_free(ctx);
-}
-
-LOCAL void _buf_pool_dynamic_create_pool(pool_handle_t handle, BUF_POOL_ID poolId, int nItems, int nSize)
-{
-    BUF_POOL_DYNAMIC_CONTEXT *ctx = (BUF_POOL_DYNAMIC_CONTEXT *)handle;
-    
-    ctx->poolConf[poolId].nSize = nSize;
-}
-            
-LOCAL adf_nbuf_t  _buf_pool_dynamic_alloc_buf(pool_handle_t handle, BUF_POOL_ID poolId, int reserve)
-{
-    BUF_POOL_DYNAMIC_CONTEXT *ctx = (BUF_POOL_DYNAMIC_CONTEXT *)handle;
-    POOL_CONFIG *poolConf = &ctx->poolConf[poolId];
-            
-    return adf_nbuf_alloc(poolConf->nSize, 
-                          reserve, 0);
-
-}
-    
-LOCAL adf_nbuf_t  _buf_pool_dynamic_alloc_buf_align(pool_handle_t handle, BUF_POOL_ID poolId, int reserve, int align)
-{
-    BUF_POOL_DYNAMIC_CONTEXT *ctx = (BUF_POOL_DYNAMIC_CONTEXT *)handle;
-    POOL_CONFIG *poolConf = &ctx->poolConf[poolId];
-
-    return adf_nbuf_alloc(poolConf->nSize, 
-                          reserve, align);
-
-}
-
-LOCAL void _buf_pool_dynamic_free_buf(pool_handle_t handle, BUF_POOL_ID poolId, adf_nbuf_t buf)
-{
-    //BUF_POOL_DYNAMIC_CONTEXT *ctx = (BUF_POOL_DYNAMIC_CONTEXT *)handle;
-        
-    adf_nbuf_free(buf);
-}
-
-adf_os_export_symbol(buf_pool_module_install);
index 6886e8aec59f4eb0f7e8491085e30e4561de962b..33a95fb3bfc464f2ce7068fa946fc7cf236150e2 100755 (executable)
  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 /*
- * @File: 
- * 
+ * @File:
+ *
  * @Abstract: Buf pool implementation: static version
- * 
- * @Notes: 
+ *
+ * @Notes:
  */
 
 #include <osapi.h>
-#include <Magpie_api.h> 
+#include <Magpie_api.h>
 #include <cmnos_api.h>
 #include <buf_pool_api.h>
 #include <vbuf_api.h>
 #include <vdesc_api.h>
-#include <adf_os_mem.h> 
+#include <adf_os_mem.h>
 
 #include "buf_pool_static.h"
 
@@ -55,12 +55,12 @@ LOCAL void _buf_pool_static_create_pool(pool_handle_t handle, BUF_POOL_ID poolId
 LOCAL adf_nbuf_t  _buf_pool_static_alloc_buf(pool_handle_t handle, BUF_POOL_ID poolId, int reserve);
 LOCAL adf_nbuf_t  _buf_pool_static_alloc_buf_align(pool_handle_t handle, BUF_POOL_ID poolId, int reserve, int align);
 LOCAL void _buf_pool_static_free_buf(pool_handle_t handle, BUF_POOL_ID poolId, adf_nbuf_t buf);
-LOCAL void _buf_pool_static_shutdown(pool_handle_t handle);      
+LOCAL void _buf_pool_static_shutdown(pool_handle_t handle);
 
 BUF_POOL_STATIC_CONTEXT g_poolCtx;
 
 void buf_pool_module_install(struct buf_pool_api *pAPIs)
-{   
+{
     pAPIs->_init = _buf_pool_static_init;
     pAPIs->_create_pool = _buf_pool_static_create_pool;
     pAPIs->_alloc_buf = _buf_pool_static_alloc_buf;
@@ -68,29 +68,29 @@ void buf_pool_module_install(struct buf_pool_api *pAPIs)
     pAPIs->_free_buf = _buf_pool_static_free_buf;
     pAPIs->_shutdown = _buf_pool_static_shutdown;
 }
+
 LOCAL pool_handle_t _buf_pool_static_init(adf_os_handle_t handle)
 {
 #if 1
     int i;
-    
+
     for(i=0; i < POOL_ID_MAX; i++) {
         g_poolCtx.bufQ[i] = NULL;
     }
-    
+
     return &g_poolCtx;
-#else    
+#else
     BUF_POOL_STATIC_CONTEXT *ctx;
-    
+
     //ctx = (BUF_POOL_static_CONTEXT *)A_ALLOCRAM(sizeof(BUF_POOL_static_CONTEXT));
     ctx = (BUF_POOL_STATIC_CONTEXT *)adf_os_mem_alloc(sizeof(BUF_POOL_STATIC_CONTEXT));
     ctx->NetHandle = handle;
-    
-    return ctx; 
-#endif    
-}      
-    
-LOCAL void _buf_pool_static_shutdown(pool_handle_t handle) 
+
+    return ctx;
+#endif
+}
+
+LOCAL void _buf_pool_static_shutdown(pool_handle_t handle)
 {
     // SHALL NOT BE USED in FW
 }
@@ -100,9 +100,9 @@ LOCAL void _buf_pool_static_create_pool(pool_handle_t handle, BUF_POOL_ID poolId
     int i;
     VBUF *buf;
     VDESC *desc;
-    
+
     //BUF_POOL_STATIC_CONTEXT *ctx = (BUF_POOL_STATIC_CONTEXT *)handle;
-    
+
     for ( i = 0; i < nItems; i++) {
         buf = VBUF_alloc_vbuf();
         desc = VDESC_alloc_vdesc();
@@ -111,10 +111,10 @@ LOCAL void _buf_pool_static_create_pool(pool_handle_t handle, BUF_POOL_ID poolId
         desc->buf_size = nSize;
         desc->data_offset = 0;
         desc->data_size = 0;
-        
-        buf->buf_length = 0;        
+
+        buf->buf_length = 0;
         buf->desc_list = desc;
-        
+
         if ( g_poolCtx.bufQ[poolId] == NULL ) {
             g_poolCtx.bufQ[poolId] = buf;
         } else {
@@ -123,21 +123,21 @@ LOCAL void _buf_pool_static_create_pool(pool_handle_t handle, BUF_POOL_ID poolId
         }
     }
 }
-            
+
 LOCAL adf_nbuf_t  _buf_pool_static_alloc_buf(pool_handle_t handle, BUF_POOL_ID poolId, int reserve)
 {
     VBUF *buf;
-    
+
     buf = g_poolCtx.bufQ[poolId];
     if ( buf != NULL ) {
         g_poolCtx.bufQ[poolId] = buf->next_buf;
-        
+
         buf->next_buf = NULL;
         buf->desc_list->data_offset = reserve;
         buf->desc_list->data_size = 0;
         buf->buf_length = 0;
     }
-    
+
     return buf;
 }
 
@@ -145,7 +145,7 @@ LOCAL adf_nbuf_t  _buf_pool_static_alloc_buf_align(pool_handle_t handle, BUF_POO
 {
     return _buf_pool_static_alloc_buf(handle, poolId, reserve);
 }
-    
+
 LOCAL void _buf_pool_static_free_buf(pool_handle_t handle, BUF_POOL_ID poolId, adf_nbuf_t buf)
 {
     if ( g_poolCtx.bufQ[poolId] == NULL ) {
index d882436ef6dc434f036d6f2e1175d73c60e7c9d0..02c55ade712cfa23889a59825da60303c4827c4c 100755 (executable)
  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 /*
- * @File: 
- * 
- * @Abstract: 
- * 
- * @Notes: 
+ * @File:
+ *
+ * @Abstract:
+ *
+ * @Notes:
  */
 
 #ifndef BUF_POOL_STATIC_H_
@@ -45,7 +45,7 @@
 
 typedef struct _BUF_POOL_STATIC_CONTEXT {
     VBUF *bufQ[POOL_ID_MAX];
-    
+
     // Left a door for extension the structure
     void *pReserved;
 } BUF_POOL_STATIC_CONTEXT;
index c7aae71f6f0dd6056691a9a242dba8dae3704164..b268ddbad0722bbe5f48b9794ea34429caf3d5c2 100755 (executable)
 #define MSEC_TO_TICK(msec)             ((msec)* TICK_MSEC_RATIO)
 
 struct clock_api {
-    void (* _clock_init)(A_UINT32 ref_clk);
-    void (* _clockregs_init)(void);
-    A_UINT32 (* _uart_frequency)(void);
-    void (* _delay_us)(int);
-    void (* _wlan_band_set)(int);
-    A_UINT32 (* _refclk_speed_get)(void);
-    A_UINT32 (* _milliseconds)(void);
-    void (* _sysclk_change)(void);
-    
-    void (* _clock_tick)(void);
+       void (* _clock_init)(A_UINT32 ref_clk);
+       void (* _clockregs_init)(void);
+       A_UINT32 (* _uart_frequency)(void);
+       void (* _delay_us)(int);
+       void (* _wlan_band_set)(int);
+       A_UINT32 (* _refclk_speed_get)(void);
+       A_UINT32 (* _milliseconds)(void);
+       void (* _sysclk_change)(void);
+
+#if defined(PROJECT_K2)
+       A_UINT32 (* _sysclk_get)(void);
+#endif
+
+       void (* _clock_tick)(void);
 };
 
 #endif /* __CLOCK_API_H__ */
index ccd30339c44ced0c1b1935050f12baf23868fc3c..08c66c2c6ac72b7048172e980674b7d5bb5be23c 100755 (executable)
@@ -70,7 +70,7 @@
 
 #if defined(PROJECT_K2)
 #if SYSTEM_MODULE_SFLASH
-#include "sflash_api.h"
+#include "cmnos/sflash_api.h"
 #endif
 #endif
 
@@ -117,7 +117,7 @@ do {                                                                    \
     asm volatile("rsr %0,%1" : "=r" (epc3) : "n" (EPC_3));              \
     asm volatile("rsr %0,%1" : "=r" (epc4) : "n" (EPC_4));              \
                                                                         \
-    A_PRINTF("\tepc1=0x%x, epc2=0x%x, epc3=0x%x, epc4=0x%x\n",            \
+    A_PRINTF("\tepc1=0x%x, epc2=0x%x, epc3=0x%x, epc4=0x%x\n",          \
                 epc1, epc2, epc3, epc4);                                \
     A_PRINTF("0x%08x, 0x%08x, 0x%08x, \n\r",                            \
         DEBUG_SYSTEM_STATE, WATCH_DOG_RESET_COUNTER,                    \
@@ -156,7 +156,7 @@ do {                                                                    \
 #define A_MEMMOVE(dst, src, size)
 
 #define A_MEMCMP(p1, p2, nbytes)
-#endif 
+#endif
 
 
 #if 1
@@ -179,20 +179,20 @@ do {                                                                    \
 
 #if SYSTEM_MODULE_UART
 /* Serial port support */
-#define A_UART_INIT()                 A_CMN(uart._uart_init())
+#define A_UART_INIT()               A_CMN(uart._uart_init())
 
 #define A_UART_HWINIT(freq, baud)     \
         A_CMN(uart._uart_hwinit((freq), (baud)))
 
-#define A_UART_ENABLED()              (HOST_INTEREST->hi_uart_enable)
+#define A_UART_ENABLED()            (HOST_INTEREST->hi_uart_enable)
 
-#define A_PUTS(str)                      A_CMN(uart._uart_str_out(str))
+#define A_PUTS(str)                 A_CMN(uart._uart_str_out(str))
 
-#define A_PUTC(ch)                      A_CMN(uart._uart_char_put(ch))
-#define A_GETC(pCh)                     A_CMN(uart._uart_char_get(pCh))
+#define A_PUTC(ch)                  A_CMN(uart._uart_char_put(ch))
+#define A_GETC(pCh)                 A_CMN(uart._uart_char_get(pCh))
 
-#define A_UART_TASK()                 A_CMN(uart._uart_task())
-#define A_UART_CONFIG(x)                 A_CMN(uart._uart_config(x))
+#define A_UART_TASK()               A_CMN(uart._uart_task())
+#define A_UART_CONFIG(x)            A_CMN(uart._uart_config(x))
 
 #else
 
@@ -200,9 +200,9 @@ do {                                                                    \
 
 #define A_UART_HWINIT(freq, baud)
 
-#define A_UART_ENABLED() 
+#define A_UART_ENABLED()
 
-#define A_PUTS(str)          
+#define A_PUTS(str)
 
 #define A_PUTC(ch)
 #define A_GETC(pCh)
@@ -228,7 +228,7 @@ do {                                                                    \
 #define A_MISALIGNED_LOAD_HANDLER(dump)  A_CMN(misc._misaligned_load_handler(dump))
 
 /* reture the host interface type */
-#define A_IS_HOST_PRESENT()              A_CMN(misc._is_host_present())
+#define A_IS_HOST_PRESENT()             A_CMN(misc._is_host_present())
 #define A_KBHIT(delay)                  A_CMN(misc._kbhit(delay))
 #define A_GET_ROM_VER()                 A_CMN(misc._rom_version_get())
 #else
@@ -247,7 +247,7 @@ do {                                                                    \
 #define A_IS_HOST_PRESENT()
 #define A_KBHIT(delay)
 #define A_GET_ROM_VER()
-#endif 
+#endif
 
 //#if SYSTEM_MODULE_DBG
 /* debug Support */
@@ -268,16 +268,16 @@ do {                                                                    \
 #define A_USB_EP0_SETUP()               A_CMN(usb._usb_ep0_setup())
 #define A_USB_EP0_TX_DATA()             A_CMN(usb._usb_ep0_tx_data())
 #define A_USB_EP0_RX_DATA()             A_CMN(usb._usb_ep0_rx_data())
-                          
+
 #define A_USB_GET_CONFIG()              A_CMN(usb._usb_get_configuration())
 #define A_USB_SET_CONFIG()              A_CMN(usb._usb_set_configuration())
-                          
+
 #define A_USB_GET_INTERFACE()           A_CMN(usb._usb_get_interface())
 #define A_USB_SET_INTERFACE()           A_CMN(usb._usb_set_interface())
-                          
+
 #define A_USB_STANDARD_CMD()            A_CMN(usb._usb_standard_cmd())
 #define A_USB_VENDOR_CMD()              A_CMN(usb._usb_vendor_cmd())
-                          
+
 #define A_USB_POWER_OFF()               A_CMN(usb._usb_power_off())
 #define A_USB_RESET_FIFO()              A_CMN(usb._usb_reset_fifo())
 #define A_USB_GEN_WDT()                 A_CMN(usb._usb_gen_wdt())
@@ -299,31 +299,31 @@ do {                                                                    \
 
 #else
 #define A_USB_INIT()
-#define A_USB_TASK()    
+#define A_USB_TASK()
 #define A_USB_INIT_PHY()
 
-#define A_USB_EP0_SETUP()     
-#define A_USB_EP0_TX()        
-#define A_USB_EP0_RX()        
-                              
-#define A_USB_GET_CONFIG()    
-#define A_USB_SET_CONFIG()    
-                              
-#define A_USB_GET_INTERFACE() 
-#define A_USB_SET_INTERFACE() 
-                              
-#define A_USB_STANDARD_CMD()  
-#define A_USB_VENDOR_CMD()    
-                              
+#define A_USB_EP0_SETUP()
+#define A_USB_EP0_TX()
+#define A_USB_EP0_RX()
+
+#define A_USB_GET_CONFIG()
+#define A_USB_SET_CONFIG()
+
+#define A_USB_GET_INTERFACE()
+#define A_USB_SET_INTERFACE()
+
+#define A_USB_STANDARD_CMD()
+#define A_USB_VENDOR_CMD()
+
 #define A_USB_POWER_OFF()
 #define A_USB_RESET_FIFO()
 #define A_USB_GEN_WDT()
 #define A_USB_JUMP_BOOT()
 
 #define A_USB_GET_DESCRIPTOR()
-#define A_USB_SET_ADDRESS()   
-#define A_USB_SET_FEATURE()   
-#define A_USB_CLEAR_FEATURE() 
+#define A_USB_SET_ADDRESS()
+#define A_USB_SET_FEATURE()
+#define A_USB_CLEAR_FEATURE()
 
 #define A_USB_GET_STATUS()
 #define A_USB_SETUP_DESC()
@@ -395,9 +395,9 @@ do {                                                                    \
 
 #if SYSTEM_MODULE_CLOCK
 
-#define A_CLOCK_INIT(refclk_guess)    A_CMN(clock._clock_init(refclk_guess))
-#define A_CLOCK_TICK()                A_CMN(clock._clock_tick())
-#define A_CLOCK_GET_TICK()            A_CMN(clock._clock_get_tick())
+#define A_CLOCK_INIT(refclk_guess)      A_CMN(clock._clock_init(refclk_guess))
+#define A_CLOCK_TICK()                  A_CMN(clock._clock_tick())
+#define A_CLOCK_GET_TICK()              A_CMN(clock._clock_get_tick())
 
 /*
  * Get the number of millisecond ticks since the system was started.
@@ -457,11 +457,8 @@ do {                                                                    \
 #define A_TIMER_RUN() \
     A_CMN(timer._timer_run())
 
-#define A_PCI_BOOT_INIT() \
-    A_CMN(pci.pci_boot_init()) 
-
 #define A_GMAC_BOOT_INIT() \
-    A_CMN(gmac.gmac_boot_init()) 
+    A_CMN(gmac.gmac_boot_init())
 
 #if SYSTEM_MODULE_ALLOCRAM
 /* Default size of ALLOCRAM area */
@@ -477,7 +474,7 @@ do {
     A_CMN(allocram.cmnos_allocram_init((astart), (asize)));                        \
 } while (0)
 
-#define A_ALLOCRAM(nbytes)    A_CMN(allocram.cmnos_allocram(0, (nbytes)))
+#define A_ALLOCRAM(nbytes)      A_CMN(allocram.cmnos_allocram(0, (nbytes)))
 
 #define A_ALLOCRAM_DEBUG()    A_CMN(allocram.cmnos_allocram_debug())
 
@@ -541,7 +538,7 @@ typedef struct _A_cmnos_indirection_table {
     int (* hal_linkage_check)(int sz, struct _A_os_linkage_check *);
     unsigned int *start_bss;
     void (* app_start)(void);
-    
+
 #if SYSTEM_MODULE_MEM
     struct mem_api    mem;
 #endif
@@ -562,9 +559,6 @@ typedef struct _A_cmnos_indirection_table {
 //    struct dbg_api      dbg;
 //#endif
 
-#if SYSTEM_MODULE_PCI
-   struct pci_api pci;
-#endif
 
 #if SYSTEM_MODULE_GMAC
    struct gmac_api gmac;
@@ -661,10 +655,6 @@ extern void cmnos_wdt_module_install(struct wdt_api *);
 extern void cmnos_eep_module_install(struct eep_api *);
 #endif
 
-#if SYSTEM_MODULE_PCI
-extern void cmnos_pci_module_install(struct pci_api *);
-#endif
-
 extern void cmnos_tasklet_module_install(struct tasklet_api *);
 
 extern void cmnos_string_module_install(struct string_api *tbl);
diff --git a/ath9k_htc/target_firmware/magpie_fw_dev/target/cmnos/cmnos_clock.c b/ath9k_htc/target_firmware/magpie_fw_dev/target/cmnos/cmnos_clock.c
deleted file mode 100755 (executable)
index d1b959d..0000000
+++ /dev/null
@@ -1,324 +0,0 @@
-/*
- * Copyright (c) 2013 Qualcomm Atheros, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted (subject to the limitations in the
- * disclaimer below) provided that the following conditions are met:
- *
- *  * Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- *  * Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the
- *    distribution.
- *
- *  * Neither the name of Qualcomm Atheros nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
- *
- * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
- * GRANTED BY THIS LICENSE.  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
- * HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#include "sys_cfg.h"
-
-#if SYSTEM_MODULE_CLOCK
-#include "athos_api.h"
-
-LOCAL A_UINT32 cticks = 0;
-
-#define  A_BAND_DEFAULT 0       // not ust now, avoiding compile error/warning, Ryan
-
-LOCAL int curr_band = A_BAND_DEFAULT;
-LOCAL void cmnos_pll_init(void);
-
-/* We accept frequencies within this deviation from an expected frequency.  */
-#define A_REFCLK_DEVIATION 800000
-
-#define A_REFCLK_UNKNOWN  SYS_CFG_REFCLK_UNKNOWN
-#define A_REFCLK_10_MHZ     SYS_CFG_REFCLK_10_MHZ
-#define A_REFCLK_20_MHZ     SYS_CFG_REFCLK_20_MHZ
-#define A_REFCLK_40_MHZ     SYS_CFG_REFCLK_40_MHZ
-
-LOCAL const struct cmnos_clock_s {
-    A_refclk_speed_t refclk_speed;
-    A_UINT32         ticks_per_sec;
-    // below are useless so far, ryan
-    A_UINT32         pll_ctrl_5ghz;
-    A_UINT32         pll_ctrl_24ghz;
-    A_UINT32         pll_settling_time;      /* 50us */
-} cmnos_clocking_table[] = {
-    {A_REFCLK_10_MHZ,
-     //10485760, 
-     10000000,
-     0x0,  
-     0x0,
-     0x0},
-
-    {A_REFCLK_20_MHZ,   
-     //20971520, 
-     20000000,
-     0x0,  
-     0x0,
-     0x0},
-
-    {A_REFCLK_40_MHZ,
-     //41943040, 
-     40000000, 
-     0x0,
-     0x0,
-     0x0},
-
-    {A_REFCLK_UNKNOWN,         
-     0, 
-     0x0, 
-     0x0,
-     0x0},
-};
-
-
-#define CMNOS_CLOCKING_TABLE_NUM_ENTRIES \
-    (sizeof(cmnos_clocking_table)/sizeof(cmnos_clocking_table[0]))
-
-LOCAL struct cmnos_clock_s *clock_info;
-
-
-LOCAL void cmnos_tick(void);
-
-/*
- * In case we have PLL initialization problems, software can arrange
- * (e.g. through BMI) to skip PLL initialization, and other software
- * can handle it.
- */
-int cmnos_skip_pll_init = 0;
-A_UINT32 pll_ctrl_setting_24ghz = 0;
-A_UINT32 pll_ctrl_setting_5ghz = 0;
-
-/*
- * Use default hardware values for clock-related registers.
- * The defaults can be overridden through BMI, EJTAG, or patches.
- *
- * CPU clock frequencies depend on what mode we're in (2.4GHz or 5GHz):
- * NB: AR6001 has a "reduced power" mode, but we don't use it.
- *
- *     AR6001/AR6002 FPGA CPU clock is always at 40MHz
- *
- *     AR6001 Rev 2.x supports 4 CPU speed selections:
- *       selector:  0   1    2       3
- *         2.4GHz: 44, 88, 141, refclk
- *         5  GHz: 40, 80, 128, refclk
- *
- *     AR6002 supports 7 CPU/SoC speed selections via CORE_CLK:
- *           CORE_CLK.DIV setting: 6,7    5     4     3   2     1   0
- *                        divisor: 16    14    12    10   8     6   4
- *         2.4GHz (pll at 352MHz): 22  25.1, 29.3, 35.2, 44, 58.7, 88
- *         5  GHz (pll at 320MHz): 20  22.9, 26.7,   32, 40, 53.3, 80
- */
-
-#if defined(DISABLE_SYNC_DURING_PLL_UPDATE_WAR)
-A_UINT32 cpu_clock_setting;
-#endif
-
-//A_COMPILE_TIME_ASSERT(verify_host_interest_small_enough,
-//                (sizeof(struct host_interest_s) <= HOST_INTEREST_MAX_SIZE))
-
-//A_COMPILE_TIME_ASSERT(verify_flash_is_present_addr,
-//                ((A_UINT32)&HOST_INTEREST->hi_flash_is_present) == FLASH_IS_PRESENT_TARGADDR)
-
-
-LOCAL void
-cmnos_delay_us(int us)
-{
-//    A_UINT32 start_time = A_RTC_REG_READ(LF_TIMER_COUNT0_ADDRESS);
-//    unsigned int num_LF_ticks = (us+29) / 30 + 1; /* ~30.5us per LF tick */
-    //A_UINT32 ref_clk = (clock_info->ticks_per_sec)/1000/1000;
-    A_UINT32 ref_clk = (clock_info->ticks_per_sec) >> 20;
-    A_UINT32 start_time = NOW();
-    unsigned int num_ticks = us*ref_clk; // system_freq == number of ticks per 1us
-    
-    while ( (NOW() - start_time) < num_ticks) {
-        /* busy spin */;
-    }
-}
-
-/*
- * Return the number of milliseconds since startup.
- * For this purpose, a "millisecond" is approximated by
- * 1/32 of a 32KHz clock.
- */
-LOCAL A_UINT32
-cmnos_milliseconds(void)
-{
-    //unsigned int lowfreq_timer;
-
-    //lowfreq_timer = A_RTC_REG_READ(LF_TIMER_COUNT0_ADDRESS);
-    //lowfreq_timer = NOW();
-
-    /* LF0 timer counts at 32KHz, so adjust to approximate Ms with >> 5.  */
-    //lowfreq_timer = lowfreq_timer;
-
-    /*
-     * NB: We do not account for wrap, which occurs every 36
-     * hours when the 32768Hz low frequency timer wraps the
-     * 32 bit counter.
-     */
-    cmnos_tick();
-
-    return cticks;
-}
-
-
-/* Expect 40MHz on AR6001 and 26MHz on AR6002 */
-//LOCAL A_refclk_speed_t cmnos_refclk_speed;
-
-LOCAL A_UINT32
-cmnos_refclk_speed_get(void)
-{
-    return clock_info->ticks_per_sec;
-}
-
-/* The UART is clocked at the reference clock frequency. */
-LOCAL A_UINT32
-cmnos_uart_frequency(void)
-{
-#if 0
-#if defined(FPGA)
-    return clock_info->ticks_per_sec;
-#else
-    return clock_info->ticks_per_sec;
-#endif
-#else
-    /* TBD */
-    /* do we need keep a struct to hold the data ?*/
-#endif
-}
-
-
-/*
- * Adjust any state that needs adjusting when the clock
- * speed changes.
- */
-LOCAL void
-cmnos_sysclk_change(void)
-{
-    /* OS may override this function */
-}
-
-
-LOCAL void
-cmnos_clockregs_init(void)
-{
-    /* TBD */
-    /* we might don't need this init() */
-}
-
-/*
- * Make whatever system-level changes are needed in order to operate
- * in the specified wireless band.
- *
- * For AR6K, we just need to set the PLL appropriately.
- */
-LOCAL void
-cmnos_wlan_band_set(int which_band)
-{
-    /* TBD */
-    /* we don't have wlan need to config */
-}
-
-LOCAL void
-cmnos_pll_init(void)
-{
-    /* TBD */
-    /* we don't have pll now, */
-}
-
-LOCAL void
-cmnos_clock_init(A_UINT32 ref_clk)
-{
-#if 1
-    unsigned int i;
-
-    /* Look up the nearest supported frequency. */
-    for (i = 0;
-         i < CMNOS_CLOCKING_TABLE_NUM_ENTRIES-1;
-         i++)
-    {
-        A_UINT32 ticks_per_sec;
-
-        ticks_per_sec = cmnos_clocking_table[i].ticks_per_sec;
-        if ((ref_clk > ticks_per_sec - A_REFCLK_DEVIATION) &&
-            (ref_clk < ticks_per_sec + A_REFCLK_DEVIATION))
-        {
-            break;
-        }
-    }
-
-    clock_info = (struct cmnos_clock_s *)&cmnos_clocking_table[i];
-//    HOST_INTEREST->hi_clock_info = (A_UINT32)clock_info;
-    
-#endif
-}
-
-////////////////////////////////////////////////////////////////////////
-// software emulate ticks on millisecond based
-LOCAL void
-cmnos_tick(void)
-{
-#if 0
-    
-    set_ccompare0(xthal_get_ccompare(XTENSA_TIMER_0)+ONE_MSEC);
-
-    cticks++;
-
-#else
-  static A_UINT32 last_tick = 0;
-    A_UINT32 current_tick = NOW();
-    A_UINT32 delta_tick;
-
-    // tick is 32 bit register, will overflow soon
-    if( current_tick < last_tick )
-    {
-        delta_tick = (A_UINT32 )((0xffffffff-last_tick)+current_tick+1)/(1000);
-    }
-    else
-    {
-        delta_tick = (A_UINT32 ) (current_tick - last_tick)/(1000);
-    }
-
-        if( delta_tick > 0 )
-            last_tick = current_tick;
-
-        cticks += delta_tick;
-#endif
-}
-
-////////////////////////////////////////////////////////////////////////
-
-void
-cmnos_clock_module_install(struct clock_api *tbl)
-{
-    tbl->_clock_init         = cmnos_clock_init;
-    tbl->_clockregs_init     = cmnos_clockregs_init;
-    tbl->_delay_us           = cmnos_delay_us;
-    tbl->_wlan_band_set      = cmnos_wlan_band_set;
-    tbl->_refclk_speed_get   = cmnos_refclk_speed_get;
-    tbl->_milliseconds       = cmnos_milliseconds;
-    tbl->_uart_frequency     = cmnos_uart_frequency;
-    tbl->_sysclk_change      = cmnos_sysclk_change;
-
-    tbl->_clock_tick         = cmnos_tick;
-}
-#endif /* SYSTEM_MODULE_CLOCK */
-
diff --git a/ath9k_htc/target_firmware/magpie_fw_dev/target/cmnos/cmnos_printf.c b/ath9k_htc/target_firmware/magpie_fw_dev/target/cmnos/cmnos_printf.c
deleted file mode 100755 (executable)
index 1f0a55e..0000000
+++ /dev/null
@@ -1,322 +0,0 @@
-//####ECOSGPLCOPYRIGHTBEGIN####
-// -------------------------------------------
-// This file is part of eCos, the Embedded Configurable Operating System.
-// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
-// Copyright (C) 2002 Gary Thomas
-//
-// eCos is free software; you can redistribute it and/or modify it under
-// the terms of the GNU General Public License as published by the Free
-// Software Foundation; either version 2 or (at your option) any later version.
-//
-// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
-// WARRANTY; without even the implied warranty of MERCHANTABILITY or
-// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-// for more details.
-//
-// You should have received a copy of the GNU General Public License along
-// with eCos; if not, write to the Free Software Foundation, Inc.,
-// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
-//
-// As a special exception, if other files instantiate templates or use macros
-// or inline functions from this file, or you compile this file and link it
-// with other works to produce a work based on this file, this file does not
-// by itself cause the resulting work to be covered by the GNU General Public
-// License. However the source code for this file must still be made available
-// in accordance with section (3) of the GNU General Public License.
-//
-// This exception does not invalidate any other reasons why a work based on
-// this file might be covered by the GNU General Public License.
-//
-// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
-// at http://sources.redhat.com/ecos/ecos-license/
-// -------------------------------------------
-//####ECOSGPLCOPYRIGHTEND####
-
-#include "dt_defs.h"
-#include "sys_cfg.h"
-
-#if SYSTEM_MODULE_PRINT
-
-#include "athos_api.h"
-
-#define is_digit(c) ((c >= '0') && (c <= '9'))
-
-#if defined(__GNUC__) && defined(__mips__)
-#define va_list __builtin_va_list
-#define va_arg __builtin_va_arg
-#define va_start __builtin_va_start
-#define va_end __builtin_va_end
-#define va_copy __builtin_va_copy
-#endif
-
-#if defined(__XCC__)
-#include "stdarg.h"
-#define va_list __gnuc_va_list
-#endif
-
-void
-cmnos_write_char(char c)
-{
-    if (c == '\n') {
-        A_PUTC('\r');
-        A_PUTC('\n');
-    } else if (c == '\r') {
-    } else {
-      A_PUTC(c);
-    }
-}
-
-void (*_putc)(char c) = cmnos_write_char;
-
-static int _cvt(unsigned long val, char *buf, long radix, char *digits)
-{
-    char temp[80];
-    char *cp = temp;
-    int length = 0;
-
-    if (val == 0) {
-        /* Special case */
-        *cp++ = '0';
-    } else {
-        while (val) {
-            *cp++ = digits[val % radix];
-            val /= radix;
-        }
-    }
-    while (cp != temp) {
-        *buf++ = *--cp;
-        length++;
-    }
-    *buf = '\0';
-    return (length);
-}
-
-
-static int cmnos_vprintf(void (*putc)(char c), const char *fmt, va_list ap)
-{
-    char buf[sizeof(long)*8];
-    char c, sign, *cp=buf;
-    int left_prec, right_prec, zero_fill, pad, pad_on_right, 
-        i, islong, islonglong;
-    long val = 0;
-    int res = 0, length = 0;
-
-    while ((c = *fmt++) != '\0') {
-        if (c == '%') {
-            c = *fmt++;
-            left_prec = right_prec = pad_on_right = islong = islonglong = 0;
-            if (c == '-') {
-                c = *fmt++;
-                pad_on_right++;
-            }
-            if (c == '0') {
-                zero_fill = TRUE;
-                c = *fmt++;
-            } else {
-                zero_fill = FALSE;
-            }
-            while (is_digit(c)) {
-                left_prec = (left_prec * 10) + (c - '0');
-                c = *fmt++;
-            }
-            if (c == '.') {
-                c = *fmt++;
-                zero_fill++;
-                while (is_digit(c)) {
-                    right_prec = (right_prec * 10) + (c - '0');
-                    c = *fmt++;
-                }
-            } else {
-                right_prec = left_prec;
-            }
-            sign = '\0';
-            if (c == 'l') {
-                // 'long' qualifier
-                c = *fmt++;
-               islong = 1;
-                if (c == 'l') {
-                    // long long qualifier
-                    c = *fmt++;
-                    islonglong = 1;
-                }
-            }
-            // Fetch value [numeric descriptors only]
-            switch (c) {
-            case 'p':
-               islong = 1;
-            case 'd':
-            case 'D':
-            case 'x':
-            case 'X':
-            case 'u':
-            case 'U':
-            case 'b':
-            case 'B':
-                if (islonglong) {
-                    val = va_arg(ap, long);
-               } else if (islong) {
-                    val = (long)va_arg(ap, long);
-               } else{
-                    val = (long)va_arg(ap, int);
-                }
-                if ((c == 'd') || (c == 'D')) {
-                    if (val < 0) {
-                        sign = '-';
-                        val = -val;
-                    }
-                } else {
-                    // Mask to unsigned, sized quantity
-                    if (islong) {
-                        val &= (1ULL << (sizeof(long) * 8)) - 1;
-                    } else{
-                        val &= (1ULL << (sizeof(int) * 8)) - 1;
-                    }
-                }
-                break;
-            default:
-                break;
-            }
-            // Process output
-            switch (c) {
-            case 'p':  // Pointer
-                (*putc)('0');
-                (*putc)('x');
-                zero_fill = TRUE;
-                left_prec = sizeof(unsigned long)*2;
-            case 'd':
-            case 'D':
-            case 'u':
-            case 'U':
-            case 'x':
-            case 'X':
-                switch (c) {
-                case 'd':
-                case 'D':
-                case 'u':
-                case 'U':
-                    length = _cvt(val, buf, 10, "0123456789");
-                    break;
-                case 'p':
-                case 'x':
-                    length = _cvt(val, buf, 16, "0123456789abcdef");
-                    break;
-                case 'X':
-                    length = _cvt(val, buf, 16, "0123456789ABCDEF");
-                    break;
-                }
-                cp = buf;
-                break;
-            case 's':
-            case 'S':
-                cp = va_arg(ap, char *);
-                if (cp == NULL)  {
-                    cp = "<null>";
-                }
-                length = 0;
-                while (cp[length] != '\0') length++;
-                break;
-            case 'c':
-            case 'C':
-                c = va_arg(ap, int /*char*/);
-                (*putc)(c);
-                res++;
-                continue;
-            case 'b':
-            case 'B':
-                length = left_prec;
-                if (left_prec == 0) {
-                    if (islonglong)
-                        length = sizeof(long)*8;
-                    else if (islong)
-                        length = sizeof(long)*8;
-                    else
-                        length = sizeof(int)*8;
-                }
-                for (i = 0;  i < length-1;  i++) {
-                    buf[i] = ((val & ((long)1<<i)) ? '1' : '.');
-                }
-                cp = buf;
-                break;
-            case '%':
-                (*putc)('%');
-                break;
-            default:
-                (*putc)('%');
-                (*putc)(c);
-                res += 2;
-            }
-            pad = left_prec - length;
-            if (sign != '\0') {
-                pad--;
-            }
-            if (zero_fill) {
-                c = '0';
-                if (sign != '\0') {
-                    (*putc)(sign);
-                    res++;
-                    sign = '\0';
-                }
-            } else {
-                c = ' ';
-            }
-            if (!pad_on_right) {
-                while (pad-- > 0) {
-                    (*putc)(c);
-                    res++;
-                }
-            }
-            if (sign != '\0') {
-                (*putc)(sign);
-                res++;
-            }
-            while (length-- > 0) {
-                c = *cp++;
-                (*putc)(c);
-                res++;
-            }
-            if (pad_on_right) {
-                while (pad-- > 0) {
-                    (*putc)(' ');
-                    res++;
-                }
-            }
-        } else {
-            (*putc)(c);
-            res++;
-        }
-    }
-    return (res);
-}
-
-int cmnos_printf(const char *fmt, ...)
-{
-    va_list ap;
-    int ret;
-
-    va_start(ap, fmt);
-
-    //if (A_SERIAL_ENABLED()) {
-    if (1) {
-        ret = cmnos_vprintf(_putc, fmt, ap);
-    } else {
-        ret = 0;
-    }
-
-    va_end(ap);
-
-    return (ret);
-}
-
-void
-cmnos_printf_init(void)
-{
-}
-
-void cmnos_printf_module_install(struct printf_api *tbl)
-{
-    tbl->_printf_init = cmnos_printf_init;
-    tbl->_printf = cmnos_printf;
-}
-
-#endif /* SYSTEM_MODULE_PRINT */
-
index 1d02293a4df83caf2697e71eab87d5f02bdb2cea..4641162762e442dc048027ba841b0346bd5e4955 100755 (executable)
@@ -449,7 +449,7 @@ cmnos_sflash_init(void)
 
     /* "Autosize-determination of the address size of serial flash" is obsolete according to Brian Yang's mail :
      *    The designers reached an conclusion that the spi master (the apb_spi interface control) will be
-     *    modified as ¡§presuming the attached flash model to be 24-bit addressing¡¨, i.e., no more
+     *    modified as presuming the attached flash model to be 24-bit addressing, i.e., no more
      *    auto-size detection!
      *    Hence you are free to force the 24-bit addressing in the *.c test code.
      */
index 451059bd0e19592679757a242e76d49dc1758396..04dce3de7e9aa323da3c51a6de6c962ba08650fc 100755 (executable)
@@ -32,6 +32,9 @@
  * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+
+#include <rom.h>
+
 #include "sys_cfg.h"
 #include "athos_api.h"
 
@@ -439,7 +442,7 @@ int db_help_cmd(char *cmd, char *param1, char *param2, char *param3)
 
 static int db_ldr_cmd(char *cmd, char *param1, char *param2, char *param3)
 {
-       unsigned long val;
+       unsigned long val = 0;
        unsigned long addr;
        char val_str[20];
        char addr_str[20];
@@ -561,7 +564,7 @@ static int db_intr_cmd(char *cmd, char *param1, char *param2, char *param3)
                        pending_intrs = A_INTR_GET_INTRENABLE()&(~CMNOS_IMASK_XTTIMER);
                        A_INTR_SET_INTRENABLE(pending_intrs);
                        A_PRINTF("- intr [0x%08x]\n\r", pending_intrs);
-            
+
                }
                else if( db_ascii_to_hex(param2, &data)==0 )
                {
@@ -569,7 +572,7 @@ static int db_intr_cmd(char *cmd, char *param1, char *param2, char *param3)
                                delay = data;
                        else
                                delay = 3;
-            
+
                        A_PRINTF("==>set cb to %d seconds \n\r", delay);
                }
 
@@ -620,7 +623,7 @@ static void clk_change(uint32_t clk, uint32_t ratio, uint32_t baud)
                clk_sel = 4;
                break;
         case 40:
-               clk_sel = 6;            
+               clk_sel = 6;
                break;
         default:
                clk_sel = 6;
@@ -637,7 +640,7 @@ static int db_clock_cmd(char *cmd, char *param1, char *param2, char *param3)
        uint32_t ratio = 1;
        uint32_t baud = 19200;
        uint32_t clk = 0;
-    
+
        if( db_ascii_to_int(param1, &clk) != -1 )
        {
                A_PRINTF("changing clock to %d\n", clk);
@@ -664,7 +667,7 @@ static int db_info_cmd(char *cmd, char *param1, char *param2, char *param3)
        return 1;
 
 #else
-    
+
        {
                uint32_t ccount1;
                uint32_t ccount2;
index fa771ec6b5feaa0684d6f1673bfed9fc162c0bff..956eec41d5338abba7f08aa6ee873d09483f8cb4 100755 (executable)
@@ -72,5 +72,6 @@ struct dbg_api {
     void (*_dbg_task)(void);
 };
 
+void cmnos_dbg_module_install(struct dbg_api *apis);
 
 #endif
index acfcab2e433359a3e1ffe726281936dc91bce52e..b6816a2694ee8e682a22cbf142bfb96e11f1ec50 100755 (executable)
@@ -38,7 +38,7 @@
 a_uint32_t ref_clk = 0;
 extern a_uint32_t cticks;
 
-// clock change 
+// clock change
 //
 void cmnos_clock_init_patch(a_uint32_t refclk)
 {
@@ -46,7 +46,7 @@ void cmnos_clock_init_patch(a_uint32_t refclk)
 }
 
 // retrieve current clock setting
-// 
+//
 a_uint32_t cmnos_refclk_speed_get_patch(void)
 {
     return ref_clk;
@@ -59,7 +59,7 @@ void cmnos_delay_us_patch(int us)
 {
     a_uint32_t start_time = NOW();
     unsigned int num_ticks = us*ref_clk; // system_freq == number of ticks per 1us
-    
+
     while ( (NOW() - start_time) < num_ticks) {
         /* busy spin */
         ;
@@ -84,11 +84,11 @@ void cmnos_tick_patch(void)
 }
 
 // get current sysmem up time in milliseconds based
-// 
+//
 a_uint32_t cmnos_milliseconds_patch(void)
 {
     cmnos_tick_patch();
-    
+
     return (cticks);
 }
 
index 32dc65ee34b2a3fa7eaf5df1a0c58a9721a897bf..9742564c55a771e7a07350aa9b7fc147ac8acc94 100755 (executable)
@@ -13,9 +13,8 @@
 // FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 // for more details.
 //
-// You should have received a copy of the GNU General Public License along
-// with eCos; if not, write to the Free Software Foundation, Inc.,
-// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+// You should have received a copy of the GNU General Public License
+// along with this program.  If not, see <http://www.gnu.org/licenses/>.
 //
 // As a special exception, if other files instantiate templates or use macros
 // or inline functions from this file, or you compile this file and link it
index ab8237f54f99653bbcdeca80d9d8088ba79e0a8a..6276f79d4c37e2bbcdfe77ef3076404744ac6c3d 100755 (executable)
 #include <hif_api.h>
 #include <Magpie_api.h>
 #include <vdesc_api.h>
-#include <adf_os_mem.h> 
+#include <adf_os_mem.h>
 #include <adf_os_io.h>
+#include <rom.h>
 
 #include "hif_usb.h"
 
 /*
- * -- support more than 64 bytes command on ep4 -- 
+ * -- support more than 64 bytes command on ep4 --
  */
 int _HIFusb_get_max_msg_len_patch(hif_handle_t handle, int pipe)
 {
@@ -54,7 +55,7 @@ int _HIFusb_get_max_msg_len_patch(hif_handle_t handle, int pipe)
         case HIF_USB_PIPE_INTERRUPT:
         case HIF_USB_PIPE_COMMAND:
             return 512;
-            
+
         default:
             return 1600;
     }
@@ -67,5 +68,5 @@ void _HIFusb_isr_handler_patch(hif_handle_t h)
 {
     A_USB_FW_TASK();
 
-    _HIFusb_isr_handler();
+    _HIFusb_isr_handler(h);
 }
index 699ce73a32bd9349581bf5744e7a441ba0d1e231..4586a0821b4cc8034928c391e26446ca3fd5d339 100755 (executable)
@@ -32,6 +32,9 @@
  * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+
+#include <init/app_start.h>
+
 #include "usb_defs.h"
 #include "usb_type.h"
 #include "usb_pre.h"
@@ -123,11 +126,11 @@ static void turn_off_merlin()
                default_data[6] = 0x1aaabe40;
                default_data[7] = 0xbe105554;
                default_data[8] = 0x00043007;
-        
+
                for(i=0; i<9; i++)
                {
                        A_DELAY_USECS(10);
-        
+
                        iowrite32(0x10ff4040, default_data[i]);
                }
                A_DELAY_USECS(10);
@@ -140,7 +143,7 @@ static void turn_off_merlin()
  * -- turn_off_phy --
  *
  * . write shift register to both pcie ep and rc
- * . 
+ * .
  */
 
 static void turn_off_phy()
@@ -161,16 +164,16 @@ static void turn_off_phy()
 
        for(i=0; i<9; i++)
        {
-               // check for the done bit to be set 
+               // check for the done bit to be set
 
                while (1)
                {
                        if (ioread32(0x40028) & BIT31)
                                break;
                }
-        
+
                A_DELAY_USECS(1);
-    
+
                iowrite32(0x40024, default_data[i]);
        }
        iowrite32(0x40028, BIT0);
@@ -178,12 +181,12 @@ static void turn_off_phy()
 
 static void turn_off_phy_rc()
 {
-    
+
        volatile uint32_t default_data[9];
        uint32_t i=0;
-    
+
        A_PRINTF("turn_off_phy_rc\n");
-    
+
        default_data[0] = 0x9248fd00;
        default_data[1] = 0x24924924;
        default_data[2] = 0xa8000019;
@@ -193,11 +196,11 @@ static void turn_off_phy_rc()
        default_data[6] = 0x1aaabe40;
        default_data[7] = 0xbe105554;
        default_data[8] = 0x00043007;
-        
+
        for(i=0; i<9; i++)
        {
-               // check for the done bit to be set 
-     
+               // check for the done bit to be set
+
                while (1)
                {
                        if (ioread32(0x40028) & BIT31)
@@ -218,7 +221,7 @@ volatile uint32_t gpio = 0x0;
  * -- patch zfTurnOffPower --
  *
  * . set suspend counter to non-zero value
- * . 
+ * .
  */
 void zfTurnOffPower_patch(void)
 {
@@ -234,13 +237,13 @@ void zfTurnOffPower_patch(void)
 
        //32clk wait for External ETH PLL stable
        A_DELAY_USECS(100);
-    
+
        iowrite32(0x52000, 0x70303); /* read back 0x703f7 */
        iowrite32(0x52008, 0x0e91c); /* read back 0x1e948 */
-    
+
        io32_set(MAGPIE_REG_SUSPEND_ENABLE_ADDR, BIT0);
 
-       // wake up, and turn on cpu, eth, pcie and usb pll 
+       // wake up, and turn on cpu, eth, pcie and usb pll
        _fw_power_on();
        // restore gpio and other settings
        _fw_restore_dma_fifo();
@@ -294,7 +297,7 @@ static void _fw_reset_dma_fifo()
        A_PRINTF("0x4048  0x%x ......\n", ioread32(0x10ff4048));
        A_PRINTF("0x404C  0x%x ......\n", ioread32(0x10ff404C));
        A_PRINTF("0x4088  0x%x ......\n", ioread32(0x10ff4088));
-         
+
        // turn off merlin
        turn_off_merlin();
        // pcie ep
@@ -305,7 +308,7 @@ static void _fw_reset_dma_fifo()
        io32_clr(0x40040, BIT0 | BIT1);
        A_PRINTF("turn_off_magpie_ep_end ......\n");
 
-       // pcie rc 
+       // pcie rc
        A_PRINTF("turn_off_magpie_rc_start ......\n");
        A_DELAY_USECS(measure_time);
        io32_clr(0x40040, BIT0);
@@ -315,7 +318,7 @@ static void _fw_reset_dma_fifo()
 
        A_PRINTF("0x4001C  %p ......\n", ioread32(0x4001c));
        A_PRINTF("0x40040  %p ......\n", ioread32(0x40040));
-    
+
        /* turn off pcie_pll - power down (bit16) */
        A_PRINTF(" before pwd PCIE PLL CFG:0x5601C: 0x%08x\n",
                 ioread32(0x5601C));
@@ -348,7 +351,7 @@ static void _fw_power_off()
         *  2. turn off CPU PLL
         *  3. turn off ETH PLL
         *  4. disable ETH PLL bypass and update
-        *  4.1 set suspend timeout 
+        *  4.1 set suspend timeout
         *  5. set SUSPEND_ENABLE
         */
 
@@ -371,14 +374,14 @@ static void _fw_power_off()
 }
 
 static void _fw_power_on()
-{ 
+{
     /*
      *  1. turn on CPU PLL
      *  2. disable CPU bypass
      *  3. turn on ETH PLL
      *  4. disable ETH PLL bypass and update
      *  5. turn on pcie pll
-     */    
+     */
 
        io32_clr(MAGPIE_REG_ETH_PLL_ADDR, BIT16);
 
@@ -389,7 +392,7 @@ static void _fw_power_on()
 static void _fw_restore_dma_fifo(void)
 {
        io32_clr(0x5601C, BIT18);
-    
+
        /* reset pcie_rc shift */
        io32_clr(0x50010, BIT10 | BIT8 | BIT7);
        A_DELAY_USECS(1);
index d1cc35e4e7132d7f49092456dab46ac3f7a1c7f5..97385ad60cda0e719d336f75fd46904699071e56 100644 (file)
@@ -1,5 +1,45 @@
+/*
+ * Copyright (c) 2013 Qualcomm Atheros, Inc.
+ * Copyright (c) 2016 Oleksij Rempel <linux@rempel-privat.de>
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted (subject to the limitations in the
+ * disclaimer below) provided that the following conditions are met:
+ *
+ *  * Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ *  * Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the
+ *    distribution.
+ *
+ *  * Neither the name of Qualcomm Atheros nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
+ * GRANTED BY THIS LICENSE.  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
+ * HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 /* shared patches for k2 and magpie */
 
+#include <ah_osdep.h>
+#include <rom.h>
+
 #include "usb_defs.h"
 #include "usb_type.h"
 #include "usb_pre.h"
@@ -133,7 +173,7 @@ void usb_status_in_patch(void)
 }
 
 /*
- * support more than 64 bytes command on ep4 
+ * support more than 64 bytes command on ep4
  */
 void usb_reg_out_patch(void)
 {
index 476155e82dfd6778cea3a6d51c634bd075cb1db1..a9a9a209da17a850765d947a666d629722d50826 100755 (executable)
  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 /*
- * @File: 
- * 
+ * @File:
+ *
  * @Abstract: host target communications
- * 
- * @Notes: 
+ *
+ * @Notes:
  */
 #include <osapi.h>
-#include <Magpie_api.h> 
+#include <Magpie_api.h>
 #include <htc.h>
 #include <htc_api.h>
 #include <hif_api.h>
-#include <adf_os_mem.h> 
-#include <adf_os_io.h> 
+#include <adf_os_mem.h>
+#include <adf_os_io.h>
 
-#include "htc_internal.h" 
+#include "htc_internal.h"
 
 #define A_UNCACHED_ADDR(addr) addr
 
@@ -74,106 +74,106 @@ void _HTC_PauseRecv(HTC_ENDPOINT_ID EndpointID);
 void _HTC_ResumeRecv(HTC_ENDPOINT_ID EndpointID);
 LOCAL void HTCProcessConnectMsg(HTC_CONTEXT *pHTC, HTC_CONNECT_SERVICE_MSG *pMsg);
 LOCAL void HTCProcessConfigPipeMsg(HTC_CONTEXT *pHTC, HTC_CONFIG_PIPE_MSG *pMsg);
-LOCAL void RedistributeCredit(adf_nbuf_t buf, int toPipeId);                         
+LOCAL void RedistributeCredit(adf_nbuf_t buf, int toPipeId);
 LOCAL void _HTC_Shutdown(htc_handle_t htcHandle);
 
-/* macro to check if the service wants to prevent credit dribbling by using 
+/* macro to check if the service wants to prevent credit dribbling by using
    a dynamic threshold */
 #define CHECK_AND_ADJUST_CREDIT_THRESHOLD(pEndpoint)                   \
        if ((pEndpoint)->ConnectionFlags & HTC_CONNECT_FLAGS_REDUCE_CREDIT_DRIBBLE) { \
                AdjustCreditThreshold((pEndpoint));                     \
-       }    
+       }
 
 LOCAL void HTC_AssembleBuffers(HTC_CONTEXT *pHTC, int Count, int Size)
 {
-       BUF_Pool_create_pool(pHTC->PoolHandle, POOL_ID_HTC_CONTROL, Count, Size);       
+       BUF_Pool_create_pool(pHTC->PoolHandle, POOL_ID_HTC_CONTROL, Count, Size);
 }
 
 LOCAL htc_handle_t _HTC_Init(HTC_SETUP_COMPLETE_CB SetupComplete,
                              HTC_CONFIG *pConfig)
 {
        HIF_CALLBACK hifCBConfig;
-       HTC_CONTEXT *pHTC;    
-    
+       HTC_CONTEXT *pHTC;
+
         pHTC = (HTC_CONTEXT *)adf_os_mem_alloc(sizeof(HTC_CONTEXT));
-    
+
        adf_os_mem_zero(pHTC, sizeof(HTC_CONTEXT));
 
        pHTC->OSHandle = pConfig->OSHandle;
        pHTC->PoolHandle = pConfig->PoolHandle;
        pHTC->hifHandle = pConfig->HIFHandle;
-                        
+
        hifCBConfig.send_buf_done = A_INDIR(htc._HTC_SendDoneHandler);
        hifCBConfig.recv_buf = A_INDIR(htc._HTC_MsgRecvHandler);
        hifCBConfig.context = pHTC;
-    
+
        /* initialize hardware layer */
        HIF_register_callback(pConfig->HIFHandle, &hifCBConfig);
-                             
+
         /* see if the host wants us to override the number of ctrl buffers */
        pHTC->NumBuffersForCreditRpts = 0;
-    
+
        if (0 == pHTC->NumBuffersForCreditRpts) {
                /* nothing to override, simply set default */
-               pHTC->NumBuffersForCreditRpts = HTC_DEFAULT_NUM_CTRL_BUFFERS; 
-       }    
-    
+               pHTC->NumBuffersForCreditRpts = HTC_DEFAULT_NUM_CTRL_BUFFERS;
+       }
+
        pHTC->MaxEpPendingCreditRpts = 0;
-    
+
        if (0 == pHTC->MaxEpPendingCreditRpts) {
-               pHTC->MaxEpPendingCreditRpts = HTC_DEFAULT_MAX_EP_PENDING_CREDIT_REPORTS;    
+               pHTC->MaxEpPendingCreditRpts = HTC_DEFAULT_MAX_EP_PENDING_CREDIT_REPORTS;
        }
        /* calculate the total allocation size based on the number of credit report buffers */
        pHTC->CtrlBufferAllocSize = MIN_CREDIT_BUFFER_ALLOC_SIZE * pHTC->NumBuffersForCreditRpts;
        /* we need at least enough buffer space for 1 ctrl message */
        pHTC->CtrlBufferAllocSize = A_MAX(pHTC->CtrlBufferAllocSize,MAX_HTC_SETUP_MSG_SIZE);
-    
+
        /* save the size of each buffer/credit we will receive */
        pHTC->RecvBufferSize = pConfig->CreditSize; //RecvBufferSize;
        pHTC->TotalCredits = pConfig->CreditNumber;
        pHTC->TotalCreditsAssigned = 0;
-     
+
        /* setup the pseudo service that handles HTC control messages */
        pHTC->HTCControlService.ProcessRecvMsg = A_INDIR(htc._HTC_ControlSvcProcessMsg);
        pHTC->HTCControlService.ProcessSendBufferComplete = A_INDIR(htc._HTC_ControlSvcProcessSendComplete);
        pHTC->HTCControlService.TrailerSpcCheckLimit = HTC_CTRL_BUFFER_CHECK_SIZE;
        pHTC->HTCControlService.MaxSvcMsgSize = MAX_HTC_SETUP_MSG_SIZE;
        pHTC->HTCControlService.ServiceCtx = pHTC;
-    
+
        /* automatically register this pseudo service to endpoint 1 */
        pHTC->Endpoints[ENDPOINT0].pService = &pHTC->HTCControlService;
-       HIF_get_default_pipe(pHTC->hifHandle, &pHTC->Endpoints[ENDPOINT0].UpLinkPipeID, 
+       HIF_get_default_pipe(pHTC->hifHandle, &pHTC->Endpoints[ENDPOINT0].UpLinkPipeID,
                             &pHTC->Endpoints[ENDPOINT0].DownLinkPipeID);
-    
+
        /* Initialize control pipe so we could receive the HTC control packets */
        // @TODO: msg size!
-       HIF_config_pipe(pHTC->hifHandle, pHTC->Endpoints[ENDPOINT0].UpLinkPipeID, 1);    
-    
+       HIF_config_pipe(pHTC->hifHandle, pHTC->Endpoints[ENDPOINT0].UpLinkPipeID, 1);
+
        /* set the first free endpoint */
        pHTC->CurrentEpIndex = ENDPOINT1;
        pHTC->SetupCompleteCb = SetupComplete;
-    
+
         /* setup buffers for just the setup phase, we only need 1 buffer to handle
         * setup */
        HTC_AssembleBuffers(pHTC, 4, MAX_HTC_SETUP_MSG_SIZE);
-   
+
        /* start hardware layer so that we can queue buffers */
        HIF_start(pHTC->hifHandle);
-    
+
        return pHTC;
 }
 
 LOCAL void _HTC_Shutdown(htc_handle_t htcHandle)
 {
        HTC_CONTEXT *pHTC = (HTC_CONTEXT *)htcHandle;
-    
+
        adf_os_mem_free(pHTC);
 }
 
 LOCAL void _HTC_RegisterService(htc_handle_t htcHandle, HTC_SERVICE *pService)
 {
        HTC_CONTEXT *pHTC = (HTC_CONTEXT *)htcHandle;
-    
+
         /* add it to the list */
        pService->pNext = pHTC->pServiceList;
        pHTC->pServiceList = pService;
@@ -185,20 +185,20 @@ LOCAL void _HTC_Ready(htc_handle_t htcHandle)
        HTC_READY_MSG *pReady;
        a_uint8_t *addr;
        HTC_CONTEXT *pHTC = (HTC_CONTEXT *)htcHandle;
-    
+
        pBuffer = HTCAllocMsgBuffer(pHTC);
-       
+
        /* an optimization... the header length is chosen to
         * be aligned on a 16 bit bounday, the fields in the message are designed to
         * be aligned */
-       addr = adf_nbuf_put_tail(pBuffer, sizeof(HTC_READY_MSG));       
-       pReady = (HTC_READY_MSG *)addr;     
-       A_MEMZERO(pReady,sizeof(HTC_READY_MSG));  
+       addr = adf_nbuf_put_tail(pBuffer, sizeof(HTC_READY_MSG));
+       pReady = (HTC_READY_MSG *)addr;
+       A_MEMZERO(pReady,sizeof(HTC_READY_MSG));
        pReady->MessageID = adf_os_htons(HTC_MSG_READY_ID);
        pReady->CreditSize = adf_os_htons((A_UINT16)pHTC->RecvBufferSize);
        pReady->CreditCount = adf_os_htons((A_UINT16)pHTC->TotalCredits);
        pReady->MaxEndpoints = ENDPOINT_MAX;
-       
+
        /* send out the message */
        HTC_SendMsg(pHTC, ENDPOINT0, pBuffer);
        /* now we need to wait for service connection requests */
@@ -206,24 +206,24 @@ LOCAL void _HTC_Ready(htc_handle_t htcHandle)
 
 LOCAL void ReturnBuffers(htc_handle_t htcHandle, HTC_ENDPOINT_ID EndpointID,
                         adf_nbuf_t pBuffers, A_BOOL sendCreditFlag)
-{   
+{
        int         nbufs = 1;
        HTC_CONTEXT *pHTC = (HTC_CONTEXT *)htcHandle;
-    
+
        /* supply some head-room again */
        adf_nbuf_push_head(pBuffers, HTC_HDR_LENGTH);
-              
+
        /* enqueue all buffers to the single mailbox */
-       HIF_return_recv_buf(pHTC->hifHandle, pHTC->Endpoints[EndpointID].UpLinkPipeID, pBuffers);    
-     
-       if (pHTC->StateFlags & HTC_STATE_SETUP_COMPLETE) {       
+       HIF_return_recv_buf(pHTC->hifHandle, pHTC->Endpoints[EndpointID].UpLinkPipeID, pBuffers);
+
+       if (pHTC->StateFlags & HTC_STATE_SETUP_COMPLETE) {
                A_UINT32    epCreditMask = (1 << EndpointID);
                /* we are running normally */
                /* update pending credit counts with the number of buffers that were added */
                pHTC->Endpoints[EndpointID].CreditsToReturn += (A_INT16)nbufs;
-               pHTC->Endpoints[EndpointID].CreditsConsumed -= (A_INT16)nbufs;  
+               pHTC->Endpoints[EndpointID].CreditsConsumed -= (A_INT16)nbufs;
                /* update bit map that this endpoint has non-zero credits */
-               pHTC->EpCreditPendingMap |= epCreditMask; 
+               pHTC->EpCreditPendingMap |= epCreditMask;
 
                if (sendCreditFlag) {
                        HTCCheckAndSendCreditReport(pHTC, epCreditMask,&pHTC->Endpoints[EndpointID],EndpointID);
@@ -231,11 +231,11 @@ LOCAL void ReturnBuffers(htc_handle_t htcHandle, HTC_ENDPOINT_ID EndpointID,
 
        } else {
                /* we have not started yet so all return operations are simply adding buffers
-                * to the interface at startup, so we can keep track of how many total 
+                * to the interface at startup, so we can keep track of how many total
                 * credits we get */
                /* update global count that will be returned to the host */
                pHTC->TotalCredits += nbufs;
-       }     
+       }
 }
 
 LOCAL void _HTC_ReturnBuffersList(htc_handle_t htcHandle,
@@ -264,38 +264,38 @@ LOCAL void _HTC_ReturnBuffers(htc_handle_t htcHandle, HTC_ENDPOINT_ID EndpointID
 {
        ReturnBuffers(htcHandle, EndpointID, pBuffers, TRUE);
 }
+
 LOCAL void _HTC_SendMsg(htc_handle_t htcHandle, HTC_ENDPOINT_ID EndpointID,
                        adf_nbuf_t pBuffers)
 {
        HTC_FRAME_HDR *pHTCHdr;
        int totsz;
-       HTC_CONTEXT *pHTC = (HTC_CONTEXT *)htcHandle;  
+       HTC_CONTEXT *pHTC = (HTC_CONTEXT *)htcHandle;
        HTC_BUF_CONTEXT *ctx;
-    
+
        ctx = (HTC_BUF_CONTEXT *)adf_nbuf_get_priv(pBuffers);
-    
+
        /* init total size (this does not include the space we will put in for the HTC header) */
        totsz = adf_nbuf_len(pBuffers);
-    
+
        /* the first buffer stores the header */
         /* back up buffer by a header size when we pass it down, by agreed upon convention the caller
-        * points the buffer to it's payload and leaves head room for the HTC header  
+        * points the buffer to it's payload and leaves head room for the HTC header
         * Note: in HTCSendDoneHandler(), we undo this so that the caller get's it's buffer
-        * back untainted */   
+        * back untainted */
        pHTCHdr = (HTC_FRAME_HDR *)adf_nbuf_push_head(pBuffers, HTC_HDR_LENGTH);
-    
+
        /* flag that this is the header buffer that was modified */
-       ctx->htc_flags |= HTC_FLAGS_BUF_HDR;   
+       ctx->htc_flags |= HTC_FLAGS_BUF_HDR;
        /* mark where this buffer came from */
-       ctx->end_point = EndpointID;      
+       ctx->end_point = EndpointID;
        /* the header start is ALWAYS aligned since we DMA it directly */
 
         /* set some fields, the rest of them will be filled below when we check for
         * trailer space */
        pHTCHdr->Flags = 0;
-       pHTCHdr->EndpointID = EndpointID;    
-       
+       pHTCHdr->EndpointID = EndpointID;
+
        /* check opportunistically if we can return any reports via a trailer */
        do {
                int               room,i,totalReportBytes;
@@ -304,7 +304,7 @@ LOCAL void _HTC_SendMsg(htc_handle_t htcHandle, HTC_ENDPOINT_ID EndpointID,
                HTC_RECORD_HDR    *pRecHdr;
                int               pipeMaxLen;
                A_UINT32          roomForPipeMaxLen;
-                          
+
                /* figure out how much room the last buffer can spare */
                pipeMaxLen = HIF_get_max_msg_len(pHTC->hifHandle,
                                                 pHTC->Endpoints[EndpointID].DownLinkPipeID);
@@ -312,52 +312,52 @@ LOCAL void _HTC_SendMsg(htc_handle_t htcHandle, HTC_ENDPOINT_ID EndpointID,
                if ( roomForPipeMaxLen < 0 ) {
                        roomForPipeMaxLen = 0;
                }
-                        
+
                room = adf_os_min( adf_nbuf_tailroom(pBuffers), roomForPipeMaxLen);
                if (room < (int)(sizeof(HTC_CREDIT_REPORT) + sizeof(HTC_RECORD_HDR))) {
                        /* no room for any reports */
-                       break;    
-               }   
+                       break;
+               }
                /* note, a record header only has 8 bit fields, so this is safe.
-                * we need an uncached pointer here too */            
+                * we need an uncached pointer here too */
                totalReportBytes = 0;
-        
-               /* get a copy */        
-               creditsPendingMap = pHTC->EpCreditPendingMap;   
-                           
+
+               /* get a copy */
+               creditsPendingMap = pHTC->EpCreditPendingMap;
+
                /* test pending map to see if we can send a report , if any
-                * credits are available, we might as well send them on the 
+                * credits are available, we might as well send them on the
                 * unused space in the buffer */
-               if (creditsPendingMap) { 
-            
+               if (creditsPendingMap) {
+
                        pRecHdr = (HTC_RECORD_HDR *)adf_nbuf_put_tail(pBuffers,
                                                              sizeof(HTC_RECORD_HDR));
-            
+
                        /* set the ID, the length will be updated with the number of credit reports we
                         * can fit (see below) */
                        pRecHdr->RecordID = HTC_RECORD_CREDITS;
                        pRecHdr->Length = 0;
-                       /* the credit report follows the record header */         
+                       /* the credit report follows the record header */
                        totalReportBytes += sizeof(HTC_RECORD_HDR);
                        room -= sizeof(HTC_RECORD_HDR);
-            
+
                        /* walkthrough pending credits map and build the records */
-                       for (i = 0; 
-                            (creditsPendingMap != 0) && (room >= (int)sizeof(HTC_CREDIT_REPORT)); 
-                            i++) {                
+                       for (i = 0;
+                            (creditsPendingMap != 0) && (room >= (int)sizeof(HTC_CREDIT_REPORT));
+                            i++) {
                                compareMask = (1 << i);
                                if (compareMask & creditsPendingMap) {
-                        
+
                                        pCreditRpt = (HTC_CREDIT_REPORT *)adf_nbuf_put_tail(pBuffers,
                                                                            sizeof(HTC_CREDIT_REPORT));
-                                    
+
                                        /* clear pending mask, we are going to return all these credits */
                                        creditsPendingMap &= ~(compareMask);
                                        /* add this record */
                                        pCreditRpt->EndpointID = i;
                                        pCreditRpt->Credits = (A_UINT8)pHTC->Endpoints[i].CreditsToReturn;
                                        /* remove pending credits, we always send deltas */
-                                       pHTC->Endpoints[i].CreditsToReturn = 0; 
+                                       pHTC->Endpoints[i].CreditsToReturn = 0;
                                        /* adjust new threshold for this endpoint if needed */
                                        CHECK_AND_ADJUST_CREDIT_THRESHOLD(&pHTC->Endpoints[i]);
                                        /* update this record length */
@@ -370,36 +370,36 @@ LOCAL void _HTC_SendMsg(htc_handle_t htcHandle, HTC_ENDPOINT_ID EndpointID,
                                        }
                                }
                        }
-            
-                       /* update new pending credits map */       
+
+                       /* update new pending credits map */
                        pHTC->EpCreditPendingMap = creditsPendingMap;
                }
-        
+
                if (totalReportBytes <= 0) {
                        break;
                }
-        
+
                /* must fit into a byte, this should never actually happen since
-                * the maximum possible number of endpoints is 32. 
+                * the maximum possible number of endpoints is 32.
                 * The trailer can have at most 1 credit record with up to 32  reports in the record.
                 * The trailer can have at most 1 lookahead record with only 1 lookahead report in the record.
                 */
-        
-               /* set header option bytes */ 
+
+               /* set header option bytes */
                pHTCHdr->ControlBytes[0] = totalReportBytes;
                /* HTC frame contains a trailer */
                pHTCHdr->Flags |= HTC_FLAGS_RECV_TRAILER;
                /* increment total size by the reports we added */
                totsz += totalReportBytes;
-               /* adjust the last buffer we used for adding on the trailer */                                 
+               /* adjust the last buffer we used for adding on the trailer */
        } while (FALSE);
-          
+
        if (totsz == 0) {
        }
-    
+
        /* set length for message (this includes any reports that were added above) */
-       pHTCHdr->PayloadLen = adf_os_htons(totsz);  
-       HIF_send_buffer(pHTC->hifHandle, pHTC->Endpoints[EndpointID].DownLinkPipeID, pBuffers);       
+       pHTCHdr->PayloadLen = adf_os_htons(totsz);
+       HIF_send_buffer(pHTC->hifHandle, pHTC->Endpoints[EndpointID].DownLinkPipeID, pBuffers);
 }
 
 void _HTC_PauseRecv(HTC_ENDPOINT_ID EndpointID)
@@ -412,19 +412,19 @@ void _HTC_ResumeRecv(HTC_ENDPOINT_ID EndpointID)
 
 int _HTC_GetReservedHeadroom(htc_handle_t htcHandle)
 {
-       HTC_CONTEXT *pHTC = (HTC_CONTEXT *)htcHandle;  
-    
+       HTC_CONTEXT *pHTC = (HTC_CONTEXT *)htcHandle;
+
        return HTC_HDR_LENGTH + HIF_get_reserved_headroom(pHTC->hifHandle);
 }
 
 void htc_module_install(struct htc_apis *pAPIs)
-{   
+{
        pAPIs->_HTC_Init = _HTC_Init;
        pAPIs->_HTC_ReturnBuffers = _HTC_ReturnBuffers;
        pAPIs->_HTC_ReturnBuffersList = _HTC_ReturnBuffersList;
        pAPIs->_HTC_Ready = _HTC_Ready;
        pAPIs->_HTC_RegisterService = _HTC_RegisterService;
-       pAPIs->_HTC_SendMsg = _HTC_SendMsg;   
+       pAPIs->_HTC_SendMsg = _HTC_SendMsg;
        pAPIs->_HTC_Shutdown = _HTC_Shutdown;
        pAPIs->_HTC_GetReservedHeadroom = _HTC_GetReservedHeadroom;
        pAPIs->_HTC_MsgRecvHandler = HTCMsgRecvHandler;
@@ -434,9 +434,9 @@ void htc_module_install(struct htc_apis *pAPIs)
 }
 
 /* free message to the free list */
-LOCAL void HTCFreeMsgBuffer(HTC_CONTEXT *pHTC, adf_nbuf_t buf) 
+LOCAL void HTCFreeMsgBuffer(HTC_CONTEXT *pHTC, adf_nbuf_t buf)
 {
-       BUF_Pool_free_buf(pHTC->PoolHandle, POOL_ID_HTC_CONTROL, buf);      
+       BUF_Pool_free_buf(pHTC->PoolHandle, POOL_ID_HTC_CONTROL, buf);
 }
 
 /* HTC control message allocator (also used for empty frames to send trailer options) */
@@ -444,26 +444,26 @@ LOCAL adf_nbuf_t HTCAllocMsgBuffer(HTC_CONTEXT *pHTC)
 {
        return BUF_Pool_alloc_buf(pHTC->PoolHandle,
                                  POOL_ID_HTC_CONTROL,
-                                 HTC_GetReservedHeadroom(pHTC));   
+                                 HTC_GetReservedHeadroom(pHTC));
 }
 
 LOCAL void HTCCheckAndSendCreditReport(HTC_CONTEXT *pHTC, A_UINT32 EpMask,
                                       HTC_ENDPOINT *pEndpoint, HTC_ENDPOINT_ID Eid)
 {
        adf_nbuf_t pCredBuffer;
-       HTC_BUF_CONTEXT *ctx;    
-        
+       HTC_BUF_CONTEXT *ctx;
+
        do {
                /* check if host needs credits */
                if (!(pHTC->EpHostNeedsCreditMap & EpMask)) {
                        /* host does not need any credits for this set */
-                       break;    
+                       break;
                }
                /* check if any are pending */
                if (!(pHTC->EpCreditPendingMap & EpMask)) {
                        /* nothing to send up */
-                       break;    
-               }  
+                       break;
+               }
                /* was an endpoint specified? */
                if (pEndpoint != NULL) {
                        /* see if a threshold is in effect for this endpoint */
@@ -474,19 +474,19 @@ LOCAL void HTCCheckAndSendCreditReport(HTC_CONTEXT *pHTC, A_UINT32 EpMask,
                                        break;
                                }
                        }
-         
+
                        if (pEndpoint->PendingCreditReports >= pHTC->MaxEpPendingCreditRpts) {
                                /* this endpoint already has some reports outstanding */
                                /* flag that as soon as a buffer is reaped, we issue a credit update to
                                 * pick up this credit that is being held up because the endpoint has already
-                                * exceeded the max outstanding credit report limit */    
+                                * exceeded the max outstanding credit report limit */
                                pHTC->StateFlags |= HTC_SEND_CREDIT_UPDATE_SOON;
-                               break;    
-                       }                         
+                               break;
+                       }
                }
-        
+
                /* if we get here we have some credits to send up */
-                        
+
                /* allocate a message buffer for the trailer */
                pCredBuffer = HTCAllocMsgBuffer(pHTC);
                if (NULL == pCredBuffer) {
@@ -494,25 +494,25 @@ LOCAL void HTCCheckAndSendCreditReport(HTC_CONTEXT *pHTC, A_UINT32 EpMask,
                         * have to wait until we get our endpoint 0 messages back.. */
                        /* mark that we need to send an update as soon as we can get a buffer back */
                        pHTC->StateFlags |= HTC_SEND_CREDIT_UPDATE_SOON;
-                       break;    
+                       break;
                }
-        
+
                ctx = (HTC_BUF_CONTEXT *)adf_nbuf_get_priv(pCredBuffer);
                if (pEndpoint != NULL) {
                        /* keep track of pending reports */
-                       pEndpoint->PendingCreditReports++; 
+                       pEndpoint->PendingCreditReports++;
                        /* save the endpoint in order to decrement the count when the send completes */
                        ctx->htc_flags = Eid | HTC_FLAGS_CREDIT_RPT;
-               }   
-            
+               }
+
                /* this is an empty message, the HTC_SendMsg will tack on a trailer in the remaining
                 * space, NOTE: no need to flush the cache, the header and trailers are assembled
                 * using uncached addresses */
-               HTC_SendMsg(pHTC, ENDPOINT0, pCredBuffer);    
-    
-       } while (FALSE);      
+               HTC_SendMsg(pHTC, ENDPOINT0, pCredBuffer);
+
+       } while (FALSE);
 }
-        
+
 /* called in response to the arrival of a service connection message */
 LOCAL void HTCProcessConnectMsg(HTC_CONTEXT *pHTC, HTC_CONNECT_SERVICE_MSG *pMsg)
 {
@@ -522,33 +522,33 @@ LOCAL void HTCProcessConnectMsg(HTC_CONTEXT *pHTC, HTC_CONNECT_SERVICE_MSG *pMsg
        HTC_CONNECT_SERVICE_RESPONSE_MSG *pRspMsg;
        int metaDataOutLen = 0;
        A_UINT16 serviceId = adf_os_ntohs(pMsg->ServiceID);
-    
+
        pBuffer = HTCAllocMsgBuffer(pHTC);
        /* note : this will be aligned */
        pRspMsg = (HTC_CONNECT_SERVICE_RESPONSE_MSG *)
                 adf_nbuf_put_tail(pBuffer, sizeof(HTC_CONNECT_SERVICE_RESPONSE_MSG));
-                                 
+
        A_MEMZERO(pRspMsg,sizeof(HTC_CONNECT_SERVICE_RESPONSE_MSG));
        pRspMsg->MessageID = adf_os_htons(HTC_MSG_CONNECT_SERVICE_RESPONSE_ID);
        /* reflect the service ID for this connect attempt */
        pRspMsg->ServiceID = adf_os_htons(serviceId);
 
        while (pService) {
-        
+
                if (pHTC->CurrentEpIndex >= ENDPOINT_MAX) {
                        /* no more endpoints */
                        connectStatus = HTC_SERVICE_NO_RESOURCES;
-                       break;    
+                       break;
                }
 
                if (serviceId == pService->ServiceID) {
-                       /* we found a match */             
-                       A_UINT8 *pMetaDataIN = NULL; 
+                       /* we found a match */
+                       A_UINT8 *pMetaDataIN = NULL;
                        A_UINT8 *pMetaDataOut;
-            
+
                        /* outgoing meta data resides in the space after the response message */
                        pMetaDataOut = ((A_UINT8 *)pRspMsg) + sizeof(HTC_CONNECT_SERVICE_RESPONSE_MSG);
-            
+
                        if (pMsg->ServiceMetaLength != 0) {
                                /* the meta data follows the connect service message */
                                pMetaDataIN = ((A_UINT8 *)pMsg) + sizeof(HTC_CONNECT_SERVICE_MSG);
@@ -561,7 +561,7 @@ LOCAL void HTCProcessConnectMsg(HTC_CONTEXT *pHTC, HTC_CONNECT_SERVICE_MSG *pMsg
                                                                 pMsg->ServiceMetaLength,
                                                                 pMetaDataOut,
                                                                 &metaDataOutLen);
-            
+
                        /* check if the service accepted this connection request */
                        if (HTC_SERVICE_SUCCESS == connectStatus) {
                                /* set the length of the response meta data going back to the host */
@@ -574,49 +574,49 @@ LOCAL void HTCProcessConnectMsg(HTC_CONTEXT *pHTC, HTC_CONNECT_SERVICE_MSG *pMsg
                                pHTC->Endpoints[pHTC->CurrentEpIndex].pService = pService;
                                /* set connection flags */
                                pHTC->Endpoints[pHTC->CurrentEpIndex].ConnectionFlags = pMsg->ConnectionFlags;
-                
+
                                pHTC->Endpoints[pHTC->CurrentEpIndex].DownLinkPipeID = pMsg->DownLinkPipeID;
                                pHTC->Endpoints[pHTC->CurrentEpIndex].UpLinkPipeID = pMsg->UpLinkPipeID;
-                
+
                                /* mark that we are now connected */
                                pService->ServiceFlags |= HTC_SERVICE_FLAGS_CONNECTED;
                                /* bump up our index, this EP is now in use */
-                               pHTC->CurrentEpIndex++;   
+                               pHTC->CurrentEpIndex++;
                        }
 
                        break;
-               }       
-        
-               pService = pService->pNext;   
+               }
+
+               pService = pService->pNext;
        }
-                   
-       pRspMsg->Status = connectStatus;    
-    
+
+       pRspMsg->Status = connectStatus;
+
        /* send out the response message */
-       HTC_SendMsg(pHTC, ENDPOINT0, pBuffer); 
+       HTC_SendMsg(pHTC, ENDPOINT0, pBuffer);
 }
 
 LOCAL void HTCProcessConfigPipeMsg(HTC_CONTEXT *pHTC, HTC_CONFIG_PIPE_MSG *pMsg)
 {
        adf_nbuf_t pBuffer;
        HTC_CONFIG_PIPE_RESPONSE_MSG *pRspMsg;
-        
+
        pBuffer = HTCAllocMsgBuffer(pHTC);
-       
+
        /* note : this will be aligned */
        pRspMsg = (HTC_CONFIG_PIPE_RESPONSE_MSG *)
-                adf_nbuf_put_tail(pBuffer, sizeof(HTC_CONFIG_PIPE_RESPONSE_MSG));    
-              
+                adf_nbuf_put_tail(pBuffer, sizeof(HTC_CONFIG_PIPE_RESPONSE_MSG));
+
        A_MEMZERO(pRspMsg,sizeof(HTC_CONFIG_PIPE_RESPONSE_MSG));
-    
+
        pRspMsg->MessageID = adf_os_htons(HTC_MSG_CONFIG_PIPE_RESPONSE_ID);
        /* reflect the service ID for this connect attempt */
        pRspMsg->PipeID = pMsg->PipeID;
 
        if ( HIF_is_pipe_supported(pHTC->hifHandle, pMsg->PipeID) ) {
-               pRspMsg->Status = 0;            
+               pRspMsg->Status = 0;
        } else {
-               pRspMsg->Status = 1; 
+               pRspMsg->Status = 1;
                goto config_done;
        }
 
@@ -626,65 +626,65 @@ LOCAL void HTCProcessConfigPipeMsg(HTC_CONTEXT *pHTC, HTC_CONFIG_PIPE_MSG *pMsg)
                pRspMsg->Status = 2;
                goto config_done;
        }
-    
+
        HIF_config_pipe(pHTC->hifHandle, pMsg->PipeID, pMsg->CreditCount);
-    
-config_done:      
+
+config_done:
        /* send out the response message */
-       HTC_SendMsg(pHTC, ENDPOINT0, pBuffer);             
+       HTC_SendMsg(pHTC, ENDPOINT0, pBuffer);
 }
 
 /* process an incomming control message from the host */
 LOCAL void HTCControlSvcProcessMsg(HTC_ENDPOINT_ID EndpointID, adf_nbuf_t hdr_buf,
                                   adf_nbuf_t pBuffers, void *arg)
-{  
+{
        A_BOOL setupComplete = FALSE;
        a_uint8_t *anbdata;
        a_uint32_t anblen;
        HTC_CONTEXT *pHTC = (HTC_CONTEXT *)arg;
        HTC_UNKNOWN_MSG  *pMsg;
-       
+
        adf_os_assert(hdr_buf == ADF_NBUF_NULL);
 
        /* we assume buffers are aligned such that we can access the message
         * parameters directly*/
        adf_nbuf_peek_header(pBuffers, &anbdata, &anblen);
        pMsg = (HTC_UNKNOWN_MSG *)anbdata;
-    
+
        /* we cannot handle fragmented messages across buffers */
-    
-       switch ( adf_os_ntohs(pMsg->MessageID) ) {        
+
+       switch ( adf_os_ntohs(pMsg->MessageID) ) {
         case HTC_MSG_CONNECT_SERVICE_ID:
-               HTCProcessConnectMsg(pHTC, (HTC_CONNECT_SERVICE_MSG *)pMsg); 
+               HTCProcessConnectMsg(pHTC, (HTC_CONNECT_SERVICE_MSG *)pMsg);
                break;
         case HTC_MSG_CONFIG_PIPE_ID:
-               HTCProcessConfigPipeMsg(pHTC, (HTC_CONFIG_PIPE_MSG *)pMsg); 
-               break;            
+               HTCProcessConfigPipeMsg(pHTC, (HTC_CONFIG_PIPE_MSG *)pMsg);
+               break;
         case HTC_MSG_SETUP_COMPLETE_ID:
                 /* the host has indicated that it has completed all
                   setup tasks and we can now let the services take over to
                   run the rest of the application */
-               setupComplete = TRUE;  
+               setupComplete = TRUE;
                /* can't get this more than once */
                break;
         default:
                ;
-       }  
-        
+       }
+
        if (pHTC->StateFlags & HTC_STATE_SETUP_COMPLETE) {
                /* recycle buffer only if we are fully running */
                HTC_ReturnBuffers(pHTC, ENDPOINT0,pBuffers);
        } else {
                /* supply some head-room again */
                adf_nbuf_push_head(pBuffers, HTC_HDR_LENGTH);
-            
+
                /* otherwise return the packet back to mbox */
-               HIF_return_recv_buf(pHTC->hifHandle, pHTC->Endpoints[EndpointID].UpLinkPipeID, pBuffers);        
+               HIF_return_recv_buf(pHTC->hifHandle, pHTC->Endpoints[EndpointID].UpLinkPipeID, pBuffers);
        }
 
-       if (setupComplete) {        
+       if (setupComplete) {
                /* mark that setup has completed */
-               pHTC->StateFlags |= HTC_STATE_SETUP_COMPLETE; 
+               pHTC->StateFlags |= HTC_STATE_SETUP_COMPLETE;
                if (pHTC->SetupCompleteCb != NULL) {
                        pHTC->SetupCompleteCb();
                }
@@ -698,25 +698,25 @@ LOCAL void HTCControlSvcProcessSendComplete(HTC_ENDPOINT_ID EndpointID,
        HTC_CONTEXT *pHTC = (HTC_CONTEXT *)arg;
        HTC_BUF_CONTEXT *ctx;
        HTC_ENDPOINT_ID creditRptEndpoint;
-    
-       ctx = (HTC_BUF_CONTEXT *)adf_nbuf_get_priv(pBuffers);       
-    
+
+       ctx = (HTC_BUF_CONTEXT *)adf_nbuf_get_priv(pBuffers);
+
        /* put them back into the pool */
-       if ( ctx->htc_flags & HTC_FLAGS_CREDIT_RPT ) {   
-               /* extract the endpoint number that requested this credit report */ 
-               creditRptEndpoint = ctx->htc_flags & HTC_FLAGS_CRPT_EP_MASK;    
-               pHTC->Endpoints[creditRptEndpoint].PendingCreditReports--;  
+       if ( ctx->htc_flags & HTC_FLAGS_CREDIT_RPT ) {
+               /* extract the endpoint number that requested this credit report */
+               creditRptEndpoint = ctx->htc_flags & HTC_FLAGS_CRPT_EP_MASK;
+               pHTC->Endpoints[creditRptEndpoint].PendingCreditReports--;
        }
-    
+
        HTCFreeMsgBuffer(pHTC, pBuffers);
-   
+
        if (pHTC->StateFlags & HTC_SEND_CREDIT_UPDATE_SOON) {
                /* this flag is set when the host could not send a credit report
                 * because we ran out of HTC control buffers */
                pHTC->StateFlags &= ~HTC_SEND_CREDIT_UPDATE_SOON;
                /* send out a report if anything is pending */
                HTCCheckAndSendCreditReport(pHTC, HTC_ANY_ENDPOINT_MASK,NULL,ENDPOINT_MAX);
-       }  
+       }
 }
 
 LOCAL void HTCSendDoneHandler(adf_nbuf_t buf, void *context)
@@ -724,18 +724,18 @@ LOCAL void HTCSendDoneHandler(adf_nbuf_t buf, void *context)
        A_UINT8 current_eid;
        HTC_CONTEXT *pHTC = (HTC_CONTEXT *)context;
        HTC_BUF_CONTEXT *ctx;
-      
+
        ctx = (HTC_BUF_CONTEXT *)adf_nbuf_get_priv(buf);
        current_eid = ctx->end_point;
-        
+
        /* Walk through the buffers and fixup the ones we used for HTC headers.
         * The buffer list may contain more than one string of HTC buffers comprising of an
-        * HTC message so we need to check every buffer */            
+        * HTC message so we need to check every buffer */
        adf_nbuf_pull_head(buf, HTC_HDR_LENGTH);
-                   
+
        pHTC->Endpoints[current_eid].pService->
-               ProcessSendBufferComplete(current_eid, 
-                                         buf, 
+               ProcessSendBufferComplete(current_eid,
+                                         buf,
                                          pHTC->Endpoints[current_eid].pService->ServiceCtx);
 }
 
@@ -744,43 +744,42 @@ LOCAL void AdjustCreditThreshold(HTC_ENDPOINT  *pEndpoint)
        A_INT16 creditsOutstanding = pEndpoint->CreditsToReturn + pEndpoint->CreditsConsumed;
         /* set the new threshold based on the number of credits that have been consumed
          * and which have not been returned by the app.
-         * Note: it is okay for this threshold to be zero which indicates no threshold 
-         * is in use */    
+         * Note: it is okay for this threshold to be zero which indicates no threshold
+         * is in use */
        switch (pEndpoint->ConnectionFlags & HTC_CONNECT_FLAGS_THRESHOLD_LEVEL_MASK) {
         case HTC_CONNECT_FLAGS_THRESHOLD_LEVEL_ONE_FOURTH :
                creditsOutstanding >>= 2;
-               break;                    
+               break;
         case HTC_CONNECT_FLAGS_THRESHOLD_LEVEL_ONE_HALF :
                creditsOutstanding >>= 1;
                break;
-        case HTC_CONNECT_FLAGS_THRESHOLD_LEVEL_THREE_FOURTHS :  
-               creditsOutstanding = (creditsOutstanding * 3) >> 2;                  
+        case HTC_CONNECT_FLAGS_THRESHOLD_LEVEL_THREE_FOURTHS :
+               creditsOutstanding = (creditsOutstanding * 3) >> 2;
                break;
-               /* default case is unity */    
+               /* default case is unity */
        }
-    
+
        pEndpoint->CreditReturnThreshhold = creditsOutstanding;
-    
+
 }
 
 LOCAL void RedistributeCredit(adf_nbuf_t buf, int toPipeId)
 {
 
 }
-            
+
 /* callback from the mailbox hardware layer when a full message arrives */
 LOCAL void HTCMsgRecvHandler(adf_nbuf_t hdr_buf, adf_nbuf_t buffer, void *context)
 {
-       A_UINT16 totsz;
        HTC_ENDPOINT  *pEndpoint;
        A_UINT32 eidMask;
-       int eid;    
+       int eid;
        a_uint8_t *anbdata;
        a_uint32_t anblen;
        HTC_FRAME_HDR *pHTCHdr;
        HTC_CONTEXT *pHTC = (HTC_CONTEXT *)context;
        adf_nbuf_t tmp_nbuf;
-                
+
        if (hdr_buf == ADF_NBUF_NULL) {
                /* HTC hdr is not in the hdr_buf */
                tmp_nbuf = buffer;
@@ -788,14 +787,12 @@ LOCAL void HTCMsgRecvHandler(adf_nbuf_t hdr_buf, adf_nbuf_t buffer, void *contex
        else {
                tmp_nbuf = hdr_buf;
        }
-                
-       adf_nbuf_peek_header(tmp_nbuf, &anbdata, &anblen);        
-       pHTCHdr = (HTC_FRAME_HDR *)anbdata; 
-      
-       totsz = adf_os_ntohs(pHTCHdr->PayloadLen); 
-    
-       eid = pHTCHdr->EndpointID; 
-    
+
+       adf_nbuf_peek_header(tmp_nbuf, &anbdata, &anblen);
+       pHTCHdr = (HTC_FRAME_HDR *)anbdata;
+
+       eid = pHTCHdr->EndpointID;
+
        pEndpoint = &pHTC->Endpoints[eid];
        eidMask = 1 << eid;
 
@@ -808,7 +805,7 @@ LOCAL void HTCMsgRecvHandler(adf_nbuf_t hdr_buf, adf_nbuf_t buffer, void *contex
 
        if (pHTC->StateFlags & HTC_STATE_SETUP_COMPLETE) {
                /* after setup we keep track of credit consumption to allow us to
-                * adjust thresholds to reduce credit dribbling */  
+                * adjust thresholds to reduce credit dribbling */
                pEndpoint->CreditsConsumed ++;
        }
 
@@ -816,35 +813,35 @@ LOCAL void HTCMsgRecvHandler(adf_nbuf_t hdr_buf, adf_nbuf_t buffer, void *contex
         * when we receive a frame with the NEED_CREDIT_UPDATE flag set .
         * if the host received credits through an opportunistic path, then it can
         * issue a another frame with this bit cleared, this signals the target to clear
-        * the "host-needs-credit" state */    
+        * the "host-needs-credit" state */
        if (pHTCHdr->Flags & HTC_FLAGS_NEED_CREDIT_UPDATE) {
                /* the host is running low (or is out) of credits on this
                 * endpoint, update mask */
-               pHTC->EpHostNeedsCreditMap |= eidMask; 
+               pHTC->EpHostNeedsCreditMap |= eidMask;
                /* check and set new threshold since host has reached a low credit situation */
-               CHECK_AND_ADJUST_CREDIT_THRESHOLD(pEndpoint);                          
+               CHECK_AND_ADJUST_CREDIT_THRESHOLD(pEndpoint);
        } else {
                /* clear the flag */
-               pHTC->EpHostNeedsCreditMap &= ~(eidMask);       
-               pEndpoint->CreditReturnThreshhold = 0; 
+               pHTC->EpHostNeedsCreditMap &= ~(eidMask);
+               pEndpoint->CreditReturnThreshhold = 0;
        }
 
-       /* Adjust the first buffer to point to the start of the actual 
+       /* Adjust the first buffer to point to the start of the actual
           payload, the first buffer contains the header */
        adf_nbuf_pull_head(tmp_nbuf, HTC_HDR_LENGTH);
-                    
+
        /* NOTE : This callback could re-queue the recv buffers within this calling context.
         *        The callback could also send a response message within the context of this callback
         *        as the result of parsing this message.  In either case, if there are
-        *        pending credits and the host needs them, a credit report will be sent either through 
+        *        pending credits and the host needs them, a credit report will be sent either through
         *        the response message trailer or a NULL message through HTC_ReturnBuffers().
-        */       
-        
+        */
+
        pEndpoint->pService->ProcessRecvMsg(eid, hdr_buf, buffer, pEndpoint->pService->ServiceCtx);
 
-       /* Calls to HTC_ReturnBuffers drives the endpoint credit reporting state machine. 
-        * We do not want to delay credits for too long in the event that the application is 
+       /* Calls to HTC_ReturnBuffers drives the endpoint credit reporting state machine.
+        * We do not want to delay credits for too long in the event that the application is
         * holding onto buffers for excessive periods of time.  This gives us "some" better
         * opportunities to send up credits. */
-       HTCCheckAndSendCreditReport(pHTC, eidMask, pEndpoint, eid); 
+       HTCCheckAndSendCreditReport(pHTC, eidMask, pEndpoint, eid);
 }
index 963c5640148c82314d647a1154cd41378206f06e..a7f01c690dd2da8cd21e425b5a03116d2eaa0262 100755 (executable)
  */
 /*
  * @File: htc_api.h
- * 
+ *
  * @Abstract: host-target communications API
- * 
- * @Notes: 
+ *
+ * @Notes:
  */
 
 #ifndef __HTC_API_H__
@@ -53,7 +53,7 @@
 
 typedef void (* HTC_SERVICE_ProcessRecvMsg)(HTC_ENDPOINT_ID EndpointID, adf_nbuf_t, adf_nbuf_t, void *ServiceCtx);
 typedef void (* HTC_SERVICE_ProcessSendBufferComplete)(HTC_ENDPOINT_ID EndpointID, adf_nbuf_t, void *ServiceCtx);
+
 /* HTC service structure :
  * the caller is required to allocate storage for the service structure and register the
  * structure using HTC_RegisterService()  The service must set the following fields:
@@ -65,31 +65,31 @@ typedef void (* HTC_SERVICE_ProcessSendBufferComplete)(HTC_ENDPOINT_ID EndpointI
  * */
 typedef struct _HTC_SERVICE {
        struct _HTC_SERVICE *pNext;
-        /* Callback for processing receive messages.  HTC calls this callback whenever a 
+        /* Callback for processing receive messages.  HTC calls this callback whenever a
          * message arrives on the endpoint assigned to this service.
          * HTC_BUFFER is a chain of buffers containing a full application message.
          * HTC_BUFFER->buffer points to the start of the msg buffer (past the HTC header) */
-       void (* ProcessRecvMsg)(HTC_ENDPOINT_ID EndpointID, adf_nbuf_t, adf_nbuf_t, void *ServiceCtx); 
+       void (* ProcessRecvMsg)(HTC_ENDPOINT_ID EndpointID, adf_nbuf_t, adf_nbuf_t, void *ServiceCtx);
         /* callback to process completed send buffers */
-       void (* ProcessSendBufferComplete)(HTC_ENDPOINT_ID EndpointID, adf_nbuf_t, void *ServiceCtx); 
+       void (* ProcessSendBufferComplete)(HTC_ENDPOINT_ID EndpointID, adf_nbuf_t, void *ServiceCtx);
         /* optional callback when a connection request occurs.
-         * The EndpointID is the assigned endpoint, the callback returns a connect 
+         * The EndpointID is the assigned endpoint, the callback returns a connect
          * response status code to allow or disallow the connection.
          * pDataIn points to the optional meta data supplied in the connection request
-         * pDataOut points to a buffer to send back meta data 
+         * pDataOut points to a buffer to send back meta data
          * If no callback is supplied, HTC assumes the connect is allowed  */
        A_UINT8 (* ProcessConnect)(struct _HTC_SERVICE *pService,
-                                  HTC_ENDPOINT_ID EndpointID, 
-                                  A_UINT8 *pDataIn, 
+                                  HTC_ENDPOINT_ID EndpointID,
+                                  A_UINT8 *pDataIn,
                                   int LengthIn,
                                   A_UINT8 *pDataOut,
-                                  int *pLengthOut); 
+                                  int *pLengthOut);
 
        A_UINT16  ServiceID;        /* service ID to match connection requests */
        A_UINT16  ServiceFlags;     /* service flags */
        A_UINT16  MaxSvcMsgSize;    /* maximum length of service-specific messages exchanged on the endpoint */
        A_UINT16  TrailerSpcCheckLimit;  /* amount of space in each send buffer that HTC can check for trailer
-                                           data. This should be set to the smallest HTC buffer that can be sent 
+                                           data. This should be set to the smallest HTC buffer that can be sent
                                            through the service. The service can disable trailer data insertion
                                            by setting this value to 0. */
        void      *ServiceCtx;
@@ -110,7 +110,7 @@ typedef struct _HTC_CONFIG {
 
 typedef struct _HTC_BUF_CONTEXT {
        A_UINT8         end_point;
-       A_UINT8         htc_flags;      /* htc flags (used by HTC layer only) */     
+       A_UINT8         htc_flags;      /* htc flags (used by HTC layer only) */
 } HTC_BUF_CONTEXT;
 
 typedef void* htc_handle_t;
@@ -119,20 +119,20 @@ typedef void* htc_handle_t;
  * setup complete function, supplied by HTC caller at HTC_init time.
  * HTC calls this function after the host has indicated that the service connection
  * phase is complete.
- * 
+ *
  */
 typedef void (* HTC_SETUP_COMPLETE_CB)(void);
 
 struct htc_apis {
-       htc_handle_t (* _HTC_Init)(HTC_SETUP_COMPLETE_CB, HTC_CONFIG *pConfig);    
+       htc_handle_t (* _HTC_Init)(HTC_SETUP_COMPLETE_CB, HTC_CONFIG *pConfig);
        void (* _HTC_Shutdown)(htc_handle_t);
        void (* _HTC_RegisterService)(htc_handle_t, HTC_SERVICE *);
        void (* _HTC_Ready)(htc_handle_t);
        void (* _HTC_ReturnBuffers)(htc_handle_t handle, HTC_ENDPOINT_ID EndpointID, adf_nbuf_t);
        void (* _HTC_ReturnBuffersList)(htc_handle_t handle, HTC_ENDPOINT_ID EndpointID, adf_nbuf_queue_t);
-       void (* _HTC_SendMsg)(htc_handle_t handle, HTC_ENDPOINT_ID EndpointID, adf_nbuf_t);        
+       void (* _HTC_SendMsg)(htc_handle_t handle, HTC_ENDPOINT_ID EndpointID, adf_nbuf_t);
        int  (* _HTC_GetReservedHeadroom)(htc_handle_t handle);
-    
+
        /* These APIs below are for patch purpose only */
        void (*_HTC_MsgRecvHandler)(adf_nbuf_t hdr_buf, adf_nbuf_t buf, void *context);
        void (*_HTC_SendDoneHandler)(adf_nbuf_t buf, void *context);
index 241bb033fd4087bf5f11ba6a55b09bb63d78ad0c..e2951d5f6b75365e121bb44685c623b73208708e 100755 (executable)
  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 /*
- * @File: 
- * 
+ * @File:
+ *
  * @Abstract: internal data and structure definitions for HTC
- * 
- * @Notes: 
+ *
+ * @Notes:
  */
 
 #ifndef HTC_INTERNAL_H_
@@ -49,7 +49,7 @@
                                           (sizeof(HTC_RECORD_HDR)) * 2  ) +            \
                                           HTC_HDR_LENGTH,                              \
                                           sizeof(A_UINT32)))
-/* minimum allocation for a credit message */                                   
+/* minimum allocation for a credit message */
 #define MIN_CREDIT_BUFFER_ALLOC_SIZE     (MIN_BUF_SIZE_FOR_RPTS)
 
 /* max ctrl buffers size for a setup message */
 
 #define HTC_DEFAULT_MAX_EP_PENDING_CREDIT_REPORTS 3  /* an EP should not have more than this many outstanding reports */
 
-#define HTC_FLAGS_CRPT_EP_MASK      0x1F     /* if the message is a credit report this is the endpoint 
+#define HTC_FLAGS_CRPT_EP_MASK      0x1F     /* if the message is a credit report this is the endpoint
                                                 that issued it */
 
 #define HTC_FLAGS_CREDIT_RPT       (1 << 5)  /* the buffer was a credit report */
 #define HTC_FLAGS_BUF_HDR          (1 << 6)  /* the buffer was manipulated and a header added */
 #define HTC_FLAGS_RECV_END_MSG     (1 << 7)  /* this buffer is the last buffer for the recev
-                                                message (used for recv pause logic) */     
-                                                                                                                              
+                                                message (used for recv pause logic) */
+
 #define HTC_MAILBOX                 0        /* we use mailbox 0 for all communications */
 #define HTC_ANY_ENDPOINT_MASK       0xFFFFFFFF
 #define HTC_LOOKAHEAD_POST_VALID    0x55
 typedef struct _HTC_ENDPOINT {
        A_INT16       CreditsToReturn;       /* credits that are ready to be returned to the host */
        HTC_SERVICE   *pService;             /* service that is bound to this endpoint */
-#ifdef HTC_PAUSE_RESUME_REF_COUNTING 
+#ifdef HTC_PAUSE_RESUME_REF_COUNTING
        int           PauseRefCount;         /* reference count */
 #endif
        A_INT16       CreditReturnThreshhold;   /* threshold before credits are returned via NULL pkts,
-                                                  this reduces dribbling effect */    
-       A_INT16       CreditsConsumed;          /* number of credits consumed (outstanding) on the endpoint */  
-       A_UINT16      ConnectionFlags;          /* HTC connection flags */          
-       int           PendingCreditReports;     /* no. of pending credit reports issued by this endpoint */    
+                                                  this reduces dribbling effect */
+       A_INT16       CreditsConsumed;          /* number of credits consumed (outstanding) on the endpoint */
+       A_UINT16      ConnectionFlags;          /* HTC connection flags */
+       int           PendingCreditReports;     /* no. of pending credit reports issued by this endpoint */
        A_UINT8       DownLinkPipeID;           /* The pipe ID to be use for the direction: target -> host */
        A_UINT8       UpLinkPipeID;             /* The pipe ID to be use for the direction: host   -> target */
 } HTC_ENDPOINT;
@@ -113,7 +113,7 @@ typedef struct _HTC_CONTEXT {
        pool_handle_t   PoolHandle;
 
        // Left a door for extension the structure
-       void *pReserved;      
+       void *pReserved;
 } HTC_CONTEXT;
 
 #define HTC_STATE_SETUP_COMPLETE    (1 << 0)  /* HTC host-target setup is complete */
diff --git a/ath9k_htc/target_firmware/magpie_fw_dev/target/htc/htc_tgt.c b/ath9k_htc/target_firmware/magpie_fw_dev/target/htc/htc_tgt.c
deleted file mode 100755 (executable)
index 313b09e..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 2013 Qualcomm Atheros, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted (subject to the limitations in the
- * disclaimer below) provided that the following conditions are met:
- *
- *  * Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- *  * Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the
- *    distribution.
- *
- *  * Neither the name of Qualcomm Atheros nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
- *
- * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
- * GRANTED BY THIS LICENSE.  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
- * HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#include <adf_os_types.h>
-#include <adf_os_dma.h>
-#include <adf_os_timer.h>
-#include <adf_os_time.h>
-#include <adf_os_lock.h>
-#include <adf_os_io.h>
-#include <adf_os_mem.h>
-#include <adf_os_module.h>
-
-#include <osapi.h>
-#include <Magpie_api.h>
-
-_A_magpie_indirection_table_t _indir_tbl;
-
-int init_htc_tgt(void);
-
-int init_htc_tgt(void)
-{
-       /* target-side HIF/HTC/WMI module installation */
-       BUF_POOL_MODULE_INSTALL();
-       HIF_MODULE_INSTALL();
-       HTC_MODULE_INSTALL();
-       WMI_SERVICE_MODULE_INSTALL();
-
-       adf_os_print("HTC Target Version 1.xx Loaded...\n");
-       return 0;
-}
-
-void exit_htc_tgt(void);
-
-void exit_htc_tgt(void)
-{
-       adf_os_print("HTC Target UnLoaded...\n");
-}
-
-adf_os_export_symbol(_indir_tbl);
-
-adf_os_virt_module_init(init_htc_tgt);
-adf_os_virt_module_exit(exit_htc_tgt);
-adf_os_module_dep(htc_tgt, adf_net);
-adf_os_module_dep(htc_tgt, inproc_hif);
diff --git a/ath9k_htc/target_firmware/magpie_fw_dev/target/inc/OTUS/OTUS_htc.h b/ath9k_htc/target_firmware/magpie_fw_dev/target/inc/OTUS/OTUS_htc.h
deleted file mode 100755 (executable)
index 70ec8e4..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Copyright (c) 2013 Qualcomm Atheros, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted (subject to the limitations in the
- * disclaimer below) provided that the following conditions are met:
- *
- *  * Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- *  * Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the
- *    distribution.
- *
- *  * Neither the name of Qualcomm Atheros nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
- *
- * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
- * GRANTED BY THIS LICENSE.  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
- * HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef __AR6K_HTC_H__
-#define __AR6K_HTC_H__
-
-/* Host/Target Communications for an AR6K Target */
-
-/* Number of mailboxes */
-#define AR6000_MBOX_COUNT  4
-
-/* ------ MBOX ID ------ */
-typedef enum
-{
-    ENDPOINT_UNUSED = -1,
-    ENDPOINT1 = 0,
-    ENDPOINT2,
-    ENDPOINT3,
-    ENDPOINT4,
-} HTC_ENDPOINT_ID;
-
-
-/* An AR6000 DMA Descriptor. See HTC_descriptor(). */
-struct AR6000_DMA_desc_s {
-    A_UINT32                  dma_control;
-    char                     *dma_data;
-    struct AR6000_DMA_desc_s *dma_next;
-};
-
-
-/*
- * Make a Mailbox DMA descriptor available to HTC.
- *
- * Once made available, there is no way to reclaim this memory.
- * The caller must guarantee that a descriptor exists for each
- * buffer that is used to send or receive.  It is expected that
- * the caller will supply a bunch of descriptors once during
- * initialization, and then forget about them.  The number of
- * buffers given to HTC for send+recv must never exceed the
- * number of descriptors given to HTC.
- *
- * HTC accesses descriptors via uncached accesses.  The caller
- * must guarantee not to place any other data in the same cache
- * line as a DMA descriptor!  In practice, this means that the
- * caller should allocate a block of memory for descriptors,
- * and the block should include padding at the start and end
- * to guarantee there will be no other data in the same cache
- * line.
- *
- * It would be far preferable to bury descriptors in the bufinfo
- * structure; but there are practical issues that prevent this.
- * It turns out that the most efficient way to add descriptors
- * to an active DMA engine requires HTC to "own and actively
- * manage" the descriptors.  HTC needs to make the association
- * between descriptors and buffers at the last possible moment.
- *
- * extern void _HTC_descriptor(struct AR6000_DMA_desc_s *descriptor);
- */
-
-/*
- * The following interfaces make it easy to allocate suitable
- * descriptors for HTC.  During initialization, simply use the
- * HTC_DESCRIPTORS_INIT macro and specify the number of descriptors
- * desired.  This number must be a constant, since it is used to
- * declare a static array!
- *
- * The descriptor array is padded with a cache line at the start
- * and another at the end.  This avoids false sharing between adjacent
- * cached data and uncached descriptors.
- */
-#define HTC_DESCRIPTOR_SPACE_SIZE(ndescs)                                   \
-    (((ndescs) * sizeof(struct AR6000_DMA_desc_s)) + 2*A_CACHE_LINE_SIZE)
-
-#define HTC_DESCRIPTORS_INIT(ndescs)                                        \
-{                                                                           \
-    static A_UINT8 HTC_descriptor_space[HTC_DESCRIPTOR_SPACE_SIZE(ndescs)]; \
-    struct AR6000_DMA_desc_s *desc;                                         \
-    int i;                                                                  \
-                                                                            \
-    A_DATA_CACHE_FLUSH(HTC_descriptor_space, sizeof(HTC_descriptor_space)); \
-                                                                            \
-    desc = (struct AR6000_DMA_desc_s *)                                     \
-        A_ROUND_UP((A_UINT32)HTC_descriptor_space, A_CACHE_LINE_SIZE);      \
-                                                                            \
-    for (i=0; i<(ndescs); i++) {                                            \
-        HTC_descriptor(desc);                                               \
-        desc++;                                                             \
-    }                                                                       \
-}
-
-#endif /* __AR6K_HTC_H__ */
diff --git a/ath9k_htc/target_firmware/magpie_fw_dev/target/inc/OTUS/OTUS_misc.h b/ath9k_htc/target_firmware/magpie_fw_dev/target/inc/OTUS/OTUS_misc.h
deleted file mode 100755 (executable)
index 4ac5c9b..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright (c) 2013 Qualcomm Atheros, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted (subject to the limitations in the
- * disclaimer below) provided that the following conditions are met:
- *
- *  * Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- *  * Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the
- *    distribution.
- *
- *  * Neither the name of Qualcomm Atheros nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
- *
- * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
- * GRANTED BY THIS LICENSE.  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
- * HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef __AR6K_MISC_H__
-#define __AR6K_MISC_H__
-
-/*
- * AR6001: CIS Tuple 0x82, "Board Hardware Configuration Information",
- * is set at chip reset according to board configuration.  Bits in this
- * register indicate what type of Host connection is in use. We don't
- * have proper header files to describe tuples, so the offset and layout
- * for the one tuple that firmwware needs is defined here.
- *
- * AR6002: The RESET_TUPLE_STATUS register in the GPIO block holds
- * Board Hardware Configuration Information.
- *
- * If the interface is SDIO, then the "INFO_MASK" must be "SDIO_NORMAL".
- * For debug purposes, a Target with the KeepAlive jumper may be booted
- * before the Host.  In this case, INFO_MASK is 0.
- *
- * For NON-SDIO Host interfaces, the INFO_MASK may hold board information.
- *
- * By convention, hostless boards set INTERFACE to SDIO, and INFO to
- * something OTHER than SDIO_NORMAL or 0.
- * 
- * Layout of Board HW Cfg Info is below.  These values are captured at
- * reset and made available to software.
- *
- * These 3 bits are available on AR6002 via RESET_TUPLE_STATUS_ADDRESS;
- * they are NOT available on AR6001.
- * bit 10: rftest               ???
- * bit  9: cmode[1]             Bits 9..8 indicate modes as follows:
- * bit  8: cmode[0]             0-->normal
- *                              1-->rftest
- *                              2-->functional test (ATE)
- *                              3-->ATPG/MBIST
- *
- * These 8 bits are available on AR6002 through RESET_TUPLE_STATUS_ADDRESS
- * and on both AR6001 and AR6002 through CIS Tuple 0x82.
- * bit  7: gpio9 (aka hmode0)    Bits 7..6 are the "Interface Config bits"
- * bit  6: tdo   (aka hmode1)
- * bit  5: clk_req
- * bit  4: sdio_cmd
- * bit  3: sdio_dat[3]
- * bit  2: sdio_dat[2]
- * bit  1: sdio_dat[1]
- * bit  0: sdio_dat[0]
- */
-
-#if defined(RESET_TUPLE_STATUS_ADDRESS)
-#define AR6K_BOARD_HWCFG_CMODE_MASK 0x300
-#define AR6K_BOARD_HWCFG_CMODE_ATE  0x200
-#else
-/*
- * CIS Tuple 0x82 happens to be located at offset 0x13c into CIS registers.
- * This may change across tapeouts, if CIS tuple information changes.
- */
-#define AR6K_BOARD_HWCFG_TUPLE_OFFSET    0x13c
-#endif
-
-#define AR6K_BOARD_HWCFG_INTERFACE_MASK  0xc0
-#define AR6K_BOARD_HWCFG_KEEP_ALIVE_MASK 0x20
-#define AR6K_BOARD_HWCFG_INFO_MASK       0x1f
-
-/* Values for INTERFACE_MASK indicate type of interface */
-#define AR6K_BOARD_HWCFG_SPI             0x00
-#define AR6K_BOARD_HWCFG_SDIO            0x40
-#define AR6K_BOARD_HWCFG_LBCF            0x80
-#define AR6K_BOARD_HWCFG_MSIO            0xc0
-
-#define AR6K_BOARD_HWCFG_SDIO_NORMAL     0x1f
-
-#endif /* __AR6K_MISC_H__ */
index 39561482c93d29e1bca8e7e8e8d246ebb091fd81..52bb6c633c38a6df2f97b5eccdcb91f6c85b95e1 100755 (executable)
@@ -96,7 +96,7 @@ typedef A_ULONG             A_ADDR;
     ((void *)((((A_UINT32)(addr)) & ~A_MIPS_KSEG_MASK) | A_MIPS_KSEG_CACHED))
 
 /* Read/Write a 32-bit AR6000 SOC register, specified by its physical address */
-#define A_SOC_ADDR_READ(addr) (*((volatile A_UINT32 *)A_UNCACHED_ADDR(addr))) 
+#define A_SOC_ADDR_READ(addr) (*((volatile A_UINT32 *)A_UNCACHED_ADDR(addr)))
 
 #define A_SOC_ADDR_WRITE(addr, val)                                           \
     do {                                                                      \
@@ -126,7 +126,7 @@ typedef A_ULONG             A_ADDR;
 #define A_UNCACHED_ADDR(addr)     (addr)
 #define A_CACHED_ADDR(addr)       (addr)
 
-#define A_SOC_ADDR_READ(addr) (*((volatile A_UINT32 *)(addr))) 
+#define A_SOC_ADDR_READ(addr) (*((volatile A_UINT32 *)(addr)))
 
 #define A_SOC_ADDR_WRITE(addr, val)                                           \
     do {                                                                      \
@@ -199,7 +199,7 @@ do {                                                                     \
                   HF_TIMER_CONTROL_RESET_MASK);                          \
 } while (0)
 
-/* 
+/*
  * Turn it OFF when you're done:
  */
 #define A_TIMESTAMP_DISABLE() A_RTC_REG_WRITE(HF_TIMER_CONTROL_ADDRESS, 0)
index 8ad5185202ea3d409e49bd02c61ed31aae033b40..8217326a057ecb64fa1c6df19a60c21fcc55e489 100755 (executable)
  */
 /**
  * @defgroup adf_nbuf_public network buffer API
- */ 
+ */
 
 /**
  * @ingroup adf_nbuf_public
  * @file adf_nbuf.h
  * This file defines the network buffer abstraction.
- */ 
+ */
 
 #ifndef _ADF_NBUF_H
 #define _ADF_NBUF_H
@@ -75,10 +75,10 @@ typedef __adf_nbuf_queue_t   adf_nbuf_queue_t;
  *          - need space in adf_drv's software descriptor
  *          - are typically created during adf_drv_create
  *          - need to be created before any API(adf_nbuf_map) that uses them
- * 
+ *
  * @param[in]  osdev os device
  * @param[out] dmap  map handle
- * 
+ *
  * @return status of the operation
  */
 static inline a_status_t
@@ -91,7 +91,7 @@ adf_nbuf_dmamap_create(adf_os_device_t osdev,
 
 /**
  * @brief Delete a dmap map
- * 
+ *
  * @param[in] osdev os device
  * @param[in] dmap
  */
@@ -113,9 +113,9 @@ adf_nbuf_dmamap_destroy(adf_os_device_t osdev, adf_os_dma_map_t dmap)
  * @return status of the operation
  */
 static inline a_status_t
-adf_nbuf_map(adf_os_device_t        osdev, 
-             adf_os_dma_map_t       bmap, 
-             adf_nbuf_t             buf, 
+adf_nbuf_map(adf_os_device_t        osdev,
+             adf_os_dma_map_t       bmap,
+             adf_nbuf_t             buf,
              adf_os_dma_dir_t       dir)
 {
     return __adf_nbuf_map(osdev, bmap, buf, dir);
@@ -130,8 +130,8 @@ adf_nbuf_map(adf_os_device_t        osdev,
  * @param[in] dir     DMA direction
  */
 static inline void
-adf_nbuf_unmap(adf_os_device_t      osdev, 
-               adf_os_dma_map_t     bmap, 
+adf_nbuf_unmap(adf_os_device_t      osdev,
+               adf_os_dma_map_t     bmap,
                adf_os_dma_dir_t     dir)
 {
     __adf_nbuf_unmap(osdev, bmap, dir);
@@ -139,7 +139,7 @@ adf_nbuf_unmap(adf_os_device_t      osdev,
 
 /**
  * @brief returns information about the mapped buf
- * 
+ *
  * @param[in]  bmap map handle
  * @param[out] sg   map info
  */
@@ -162,14 +162,14 @@ adf_nbuf_dmamap_info(adf_os_dma_map_t bmap, adf_os_dmamap_info_t *sg)
  * The nbuf created is guarenteed to have only 1 physical segment
  *
  * @param[in] hdl   platform device object
- * @param[in] size  data buffer size for this adf_nbuf including max header 
+ * @param[in] size  data buffer size for this adf_nbuf including max header
  *                  size
  * @param[in] reserve  headroom to start with.
  * @param[in] align    alignment for the start buffer.
  *
  * @return The new adf_nbuf instance or NULL if there's not enough memory.
  */
-static inline adf_nbuf_t 
+static inline adf_nbuf_t
 adf_nbuf_alloc(adf_os_size_t        size,
                int                  reserve,
                int                  align)
@@ -195,10 +195,10 @@ adf_nbuf_free(adf_nbuf_t buf)
  *        buf. Note that this can allocate a new buffer, or
  *        change geometry of the orignial buffer. The new buffer
  *        is returned in the (new_buf).
- * 
+ *
  * @param[in] buf (older buffer)
  * @param[in] headroom
- * 
+ *
  * @return newly allocated buffer
  */
 static inline adf_nbuf_t
@@ -211,10 +211,10 @@ adf_nbuf_realloc_headroom(adf_nbuf_t buf, a_uint32_t headroom)
 /**
  * @brief expand the tailroom to the new tailroom, but the buffer
  * remains the same
- * 
+ *
  * @param[in] buf       buffer
  * @param[in] tailroom  new tailroom
- * 
+ *
  * @return expanded buffer or NULL on failure
  */
 static inline adf_nbuf_t
@@ -232,11 +232,11 @@ adf_nbuf_realloc_tailroom(adf_nbuf_t buf, a_uint32_t tailroom)
  *        having an extra API is that some OS do this in more
  *        optimized way, rather than calling realloc (head/tail)
  *        back to back.
- * 
+ *
  * @param[in] buf       buffer
- * @param[in] headroom  new headroom  
+ * @param[in] headroom  new headroom
  * @param[in] tailroom  new tailroom
- * 
+ *
  * @return expanded buffer
  */
 static inline adf_nbuf_t
@@ -253,9 +253,9 @@ adf_nbuf_expand(adf_nbuf_t buf, a_uint32_t headroom, a_uint32_t tailroom)
  *        effect, it also "linearizes" a buffer (which is
  *        perhaps why you'll use it mostly). It creates a
  *        writeable copy.
- * 
+ *
  * @param[in] buf source nbuf to copy from
- * 
+ *
  * @return the new nbuf
  */
 static inline adf_nbuf_t
@@ -268,10 +268,10 @@ adf_nbuf_copy(adf_nbuf_t buf)
 /**
  * @brief link two nbufs, the new buf is piggybacked into the
  *        older one.
- * 
+ *
  * @param[in] dst   buffer to piggyback into
  * @param[in] src   buffer to put
- * 
+ *
  * @return status of the call
  */
 static inline void
@@ -283,12 +283,12 @@ adf_nbuf_cat(adf_nbuf_t dst,adf_nbuf_t src)
 
 /**
  * @brief clone the nbuf (copy is readonly)
- * 
+ *
  * @param[in] buf nbuf to clone from
- * 
+ *
  * @return cloned buffer
  */
-static inline adf_nbuf_t 
+static inline adf_nbuf_t
 adf_nbuf_clone(adf_nbuf_t buf)
 {
     return(__adf_nbuf_clone(buf));
@@ -301,12 +301,12 @@ adf_nbuf_clone(adf_nbuf_t buf)
  *         other users.If the nbuf is a clone then this function
  *         creates a new copy of the data. If the buffer is not
  *         a clone the original buffer is returned.
- * 
+ *
  * @param[in] buf   source nbuf to create a writable copy from
- * 
+ *
  * @return new buffer which is writeable
  */
-static inline adf_nbuf_t 
+static inline adf_nbuf_t
 adf_nbuf_unshare(adf_nbuf_t buf)
 {
     return(__adf_nbuf_unshare(buf));
@@ -322,9 +322,9 @@ adf_nbuf_unshare(adf_nbuf_t buf)
 
 /**
  * @brief return the amount of headroom int the current nbuf
- * 
+ *
  * @param[in] buf   buffer
- * 
+ *
  * @return amount of head room
  */
 static inline a_uint32_t
@@ -336,10 +336,10 @@ adf_nbuf_headroom(adf_nbuf_t buf)
 
 /**
  * @brief return the amount of tail space available
- * 
+ *
  * @param[in] buf   buffer
- * 
- * @return amount of tail room 
+ *
+ * @return amount of tail room
  */
 static inline a_uint32_t
 adf_nbuf_tailroom(adf_nbuf_t buf)
@@ -397,7 +397,7 @@ adf_nbuf_pull_head(adf_nbuf_t buf, adf_os_size_t size)
 
 
 /**
- * 
+ *
  * @brief trim data out from the end
  *
  * @param[in] buf   buf instance
@@ -427,9 +427,9 @@ adf_nbuf_len(adf_nbuf_t buf)
 
 /**
  * @brief test whether the nbuf is cloned or not
- * 
+ *
  * @param[in] buf   buffer
- * 
+ *
  * @return TRUE if it is cloned, else FALSE
  */
 static inline a_bool_t
@@ -446,19 +446,19 @@ adf_nbuf_is_cloned(adf_nbuf_t buf)
 
 /**
  * @brief return the frag pointer & length of the frag
- * 
+ *
  * @param[in]  buf   buffer
  * @param[out] sg    this will return all the frags of the nbuf
- * 
+ *
  */
-static inline void 
-adf_nbuf_frag_info(adf_nbuf_t buf, adf_os_sglist_t *sg) 
+static inline void
+adf_nbuf_frag_info(adf_nbuf_t buf, adf_os_sglist_t *sg)
 {
     __adf_nbuf_frag_info(buf, sg);
 }
 /**
  * @brief return the data pointer & length of the header
- * 
+ *
  * @param[in]  buf  nbuf
  * @param[out] addr data pointer
  * @param[out] len  length of the data
@@ -475,9 +475,9 @@ adf_nbuf_peek_header(adf_nbuf_t buf, a_uint8_t **addr, a_uint32_t *len)
 
 /**
  * @brief get the priv pointer from the nbuf'f private space
- * 
+ *
  * @param[in] buf
- * 
+ *
  * @return data pointer to typecast into your priv structure
  */
 static inline a_uint8_t *
@@ -533,9 +533,9 @@ adf_nbuf_queue_remove(adf_nbuf_queue_t *head)
 
 /**
  * @brief get the length of the queue
- * 
+ *
  * @param[in] head  buf queue head
- * 
+ *
  * @return length of the queue
  */
 static inline a_uint32_t
@@ -547,12 +547,12 @@ adf_nbuf_queue_len(adf_nbuf_queue_t *head)
 
 /**
  * @brief get the first guy/packet in the queue
- * 
+ *
  * @param[in] head  buf queue head
- * 
+ *
  * @return first buffer in queue
  */
-static inline adf_nbuf_t 
+static inline adf_nbuf_t
 adf_nbuf_queue_first(adf_nbuf_queue_t *head)
 {
     return (__adf_nbuf_queue_first(head));
@@ -562,9 +562,9 @@ adf_nbuf_queue_first(adf_nbuf_queue_t *head)
 /**
  * @brief get the next guy/packet of the given buffer (or
  *        packet)
- * 
+ *
  * @param[in] buf   buffer
- * 
+ *
  * @return next buffer/packet
  */
 static inline adf_nbuf_t
@@ -576,7 +576,7 @@ adf_nbuf_queue_next(adf_nbuf_t buf)
 
 /**
  * @brief Check if the buf queue is empty
- * 
+ *
  * @param[in] nbq   buf queue handle
  *
  * @return    TRUE  if queue is empty
@@ -598,7 +598,7 @@ adf_nbuf_is_queue_empty(adf_nbuf_queue_t * nbq)
 
 /**
  * @brief Gets the tx checksumming to be performed on this buf
- * 
+ *
  * @param[in]  buf       buffer
  * @param[out] hdr_off   the (tcp) header start
  * @param[out] where     the checksum offset
@@ -613,7 +613,7 @@ adf_nbuf_tx_cksum_info(adf_nbuf_t buf, a_uint8_t **hdr_off, a_uint8_t **where)
 /**
  * @brief Drivers that support hw checksumming use this to
  *        indicate checksum info to the stack.
- * 
+ *
  * @param[in]  buf      buffer
  * @param[in]  cksum    checksum
  */
@@ -627,7 +627,7 @@ adf_nbuf_set_rx_cksum(adf_nbuf_t buf, adf_nbuf_rx_cksum_t *cksum)
 /**
  * @brief Drivers that are capable of TCP Large segment offload
  *        use this to get the offload info out of an buf.
- * 
+ *
  * @param[in]  buf  buffer
  * @param[out] tso  offload info
  */
@@ -647,16 +647,16 @@ adf_nbuf_set_vlan_info(adf_nbuf_t buf, adf_net_vlan_tag_t vlan_tag)
 /**
  * @brief This function extracts the vid & priority from an
  *        nbuf
- * 
- * 
+ *
+ *
  * @param[in] hdl   net handle
  * @param[in] buf   buffer
  * @param[in] vlan  vlan header
- * 
+ *
  * @return status of the operation
  */
 static inline a_status_t
-adf_nbuf_get_vlan_info(adf_net_handle_t hdl, adf_nbuf_t buf, 
+adf_nbuf_get_vlan_info(adf_net_handle_t hdl, adf_nbuf_t buf,
                        adf_net_vlanhdr_t *vlan)
 {
     return __adf_nbuf_get_vlan_info(hdl, buf, vlan);
index 1cf82dff8a7942b4da3ed3e671a733eb4fc105e4..7b753bc1993bd50be7ff7b0d90de08be366e3f16 100755 (executable)
@@ -43,9 +43,9 @@
  */
 
 /**
- * @mainpage 
+ * @mainpage
  * @section Introduction
- * The Atheros Driver Framework provides a mechanism to run the Atheros 
+ * The Atheros Driver Framework provides a mechanism to run the Atheros
  * WLAN driver on a variety of Operating Systems and Platforms. It achieves
  * this by abstracting all OS-specific and platform-specific functionality
  * the driver requires. This ensures the core logic in the driver is OS-
@@ -58,7 +58,7 @@
  * This component abstracts the OS network buffer. See @ref adf_nbuf_public for details.
  * @subsection sec3 OS services
  * This component abstracts any OS services. See @ref adf_os_public for details.
- */ 
+ */
 
 #ifndef _ADF_NET_H
 #define _ADF_NET_H
 /*
  * check for a NULL handle
  * */
-#define ADF_NET_NULL        __ADF_NET_NULL 
+#define ADF_NET_NULL        __ADF_NET_NULL
 
 /**
  * @brief this register the driver to the shim, but won't get
  *        any handle until create device is called.
- * 
+ *
  * @param[in] drv driver info structure
- * 
+ *
  * @return status of operation
  */
-static inline a_status_t 
+static inline a_status_t
 adf_net_register_drv(adf_drv_info_t *drv)
 {
     return(__adf_net_register_drv(drv));
@@ -92,7 +92,7 @@ adf_net_register_drv(adf_drv_info_t *drv)
 
 /**
  * @brief deregister the driver from the shim
- * 
+ *
  * @param[in] name driver name passed in adf_drv_info_t
  *
  * @see adf_net_register_drv()
@@ -106,122 +106,48 @@ adf_net_unregister_drv(a_uint8_t *drv_name)
 
 /**
  * @brief register a real device with the kernel
- * 
+ *
  * @param[in] hdl driver handle for this device
  * @param[in] op per-device switch structure
  * @param[in] info basic device information
- * 
+ *
  * @return opaque device handle
  */
-static inline adf_net_handle_t 
-adf_net_dev_create(adf_drv_handle_t   hdl, 
-                   adf_dev_sw_t      *op, 
+static inline adf_net_handle_t
+adf_net_dev_create(adf_drv_handle_t   hdl,
+                   adf_dev_sw_t      *op,
                    adf_net_dev_info_t *info)
 {
     return (__adf_net_dev_create(hdl, op, info));
 }
 
-
-/**
- * @brief unregister a real device with the kernel
- * 
- * @param[in] hdl opaque device handle returned by adf_net_dev_create()
- * @see adf_net_dev_create()
- */
-static inline void
-adf_net_dev_delete(adf_net_handle_t hdl)
-{
-    __adf_net_dev_delete(hdl);
-}
-
-
 /**
  * @brief register a virtual device with the kernel.
  * A virtual device is always backed by a real device.
- * 
+ *
  * @param[in] dev_hdl opaque device handle for the real device
  * @param[in] hdl driver handle for this virtual device
  * @param[in] op per-virtual-device switch structure
  * @param[in] info basic virtual device information
- * 
+ *
  * @return opaque device handle
  *
  * @see adf_net_dev_create()
  */
-static inline adf_net_handle_t 
-adf_net_vdev_create(adf_net_handle_t   dev_hdl, 
-                    adf_drv_handle_t   hdl, 
-                    adf_vdev_sw_t     *op, 
-                    adf_net_dev_info_t *info) 
+static inline adf_net_handle_t
+adf_net_vdev_create(adf_net_handle_t   dev_hdl,
+                    adf_drv_handle_t   hdl,
+                    adf_vdev_sw_t     *op,
+                    adf_net_dev_info_t *info)
 {
     return (__adf_net_vdev_create(dev_hdl, hdl, op, info));
 }
 
-
 /**
- * @brief unregister the virtual device with the kernel.
- * 
- * @param[in] hdl opaque device handle returned by adf_net_vdev_create()
+ * @brief Checks if the interface is running or not
  *
- * @see adf_net_vdev_create()
- */
-static inline void
-adf_net_vdev_delete(adf_net_handle_t hdl)
-{
-    __adf_net_vdev_delete(hdl);
-}
-
-
-/**
- * @brief open the real device
- * 
  * @param[in] hdl opaque device handle
- * 
- * @return status of the operation
  *
- * @see adf_net_dev_create()
- */
-static inline a_status_t
-adf_net_dev_open(adf_net_handle_t hdl)
-{
-        return (__adf_net_dev_open(hdl));
-}
-
-
-/**
- * @brief close the real device
- * 
- * @param[in] hdl opaque device handle
- * 
- * @see adf_net_dev_open()
- */
-static inline void
-adf_net_dev_close(adf_net_handle_t hdl)
-{
-    __adf_net_dev_close(hdl);
-}
-
-
-/**
- * @brief transmit a network buffer using a device
- * 
- * @param[in] hdl opaque device handle
- * @param[in] pkt network buffer to transmit
- * 
- * @return status of the operation
- */
-static inline a_status_t 
-adf_net_dev_tx(adf_net_handle_t hdl, adf_nbuf_t pkt)
-{
-       return (__adf_net_dev_tx(hdl,pkt));
-}
-
-
-/**
- * @brief Checks if the interface is running or not
- * 
- * @param[in] hdl opaque device handle
- * 
  * @return true if running, false if not
  */
 static inline a_bool_t
@@ -232,9 +158,9 @@ adf_net_is_running(adf_net_handle_t hdl)
 
 /**
  * @brief Checks if the interface is up or not
- * 
+ *
  * @param[in] hdl opaque device handle
- * 
+ *
  * @return true if up, false if not
  */
 static inline a_bool_t
@@ -246,12 +172,12 @@ adf_net_is_up(adf_net_handle_t hdl)
 
 /**
  * @brief check whether the carrier is available or not
- * 
+ *
  * @param[in] hdl opaque device handle
- * 
+ *
  * @return a_bool_t true if available, false if not
  */
-static inline a_bool_t 
+static inline a_bool_t
 adf_net_carrier_ok(adf_net_handle_t hdl)
 {
     return(__adf_net_carrier_ok(hdl));
@@ -260,10 +186,10 @@ adf_net_carrier_ok(adf_net_handle_t hdl)
 
 /**
  * @brief inform the networking stack that the link is down
- * 
+ *
  * @param[in] hdl opaque device handle
  */
-static inline void 
+static inline void
 adf_net_carrier_off(adf_net_handle_t hdl)
 {
     __adf_net_carrier_off(hdl);
@@ -272,12 +198,12 @@ adf_net_carrier_off(adf_net_handle_t hdl)
 
 /**
  * @brief inform the networking stack that the link is up
- * 
+ *
  * @param[in] hdl opaque device handle
- * 
+ *
  * @see adf_net_carrier_off()
  */
-static inline void 
+static inline void
 adf_net_carrier_on(adf_net_handle_t hdl)
 {
     __adf_net_carrier_on(hdl);
@@ -291,12 +217,12 @@ adf_net_carrier_on(adf_net_handle_t hdl)
  */
 
 /**
- * @brief inform the networking stack that the device is ready to receive 
+ * @brief inform the networking stack that the device is ready to receive
  * transmit packets. Typically called during init.
- * 
+ *
  * @param[in] hdl opaque device handle
  */
-static inline void 
+static inline void
 adf_net_start_queue(adf_net_handle_t hdl)
 {
     __adf_net_start_queue(hdl);
@@ -305,10 +231,10 @@ adf_net_start_queue(adf_net_handle_t hdl)
 /**
  * @brief inform the networking stack to stop sending transmit packets.
  * Typically called if the driver runs out of resources for the device.
- * 
+ *
  * @param[in] hdl opaque device handle
  */
-static inline void    
+static inline void
 adf_net_stop_queue(adf_net_handle_t hdl)
 {
     __adf_net_stop_queue(hdl);
@@ -318,13 +244,13 @@ adf_net_stop_queue(adf_net_handle_t hdl)
 /**
  * @brief inform the native stack to resume sending packets
  * to transmit.Typically called when the driver has resources
- * available again for the device. 
+ * available again for the device.
  *
  * @note adf_net_wake_queue() is the counterpart of adf_net_stop_queue()
  *
  * @param[in] hdl opaque device handle
  */
-static inline void 
+static inline void
 adf_net_wake_queue(adf_net_handle_t hdl)
 {
     __adf_net_wake_queue(hdl);
@@ -333,61 +259,22 @@ adf_net_wake_queue(adf_net_handle_t hdl)
 
 /**
  * @brief Check the state of the queue
- * 
+ *
  * @param[in] hdl opaque device handle
- * 
+ *
  * @return true if stopped, false if not
  */
-static inline a_bool_t 
+static inline a_bool_t
 adf_net_queue_stopped(adf_net_handle_t hdl)
 {
     return(__adf_net_queue_stopped(hdl));
 }
 
-
-/**
- * @brief This indicates a packet to the networking stack
- * (minus the FCS). The driver should just strip
- * the FCS and give the packet as a whole. This is
- * necessary because different native stacks have
- * different expectation of how they want to recv the
- * packet. This fucntion will strip off whatever is
- * required for the OS interface. The routine will also
- * figure out whether its being called in irq context and
- * call the appropriate OS API.
- * 
- * @param[in] hdl opaque device handle
- * @param[in] pkt network buffer to indicate
- * @param[in] len length of buffer
- */
-static inline void 
-adf_net_indicate_packet(adf_net_handle_t hdl, adf_nbuf_t pkt, a_uint32_t len)
-{
-    __adf_net_indicate_packet(hdl, pkt, len);
-}
-
-/**
- * @brief use this when indicating a vlan tagged packet on RX
- * 
- * @param[in] hdl opaque device handle
- * @param[in] pkt network buffer to indicate
- * @param[in] len length of buffer
- * @param[in] vid vlan id
- * 
- * @return status of operation
- */
-static inline a_status_t 
-adf_net_indicate_vlanpkt(adf_net_handle_t hdl, adf_nbuf_t pkt, 
-                         a_uint32_t len, adf_net_vid_t *vid)
-{
-    return (__adf_net_indicate_vlanpkt(hdl, pkt, len, vid));
-}
-
 /**
  * @brief get interface name
- * 
+ *
  * @param[in] hdl opaque device handle
- * 
+ *
  * @return name of interface
  */
 static inline const a_uint8_t *
@@ -396,67 +283,13 @@ adf_net_ifname(adf_net_handle_t  hdl)
     return (__adf_net_ifname(hdl));
 }
 
-/**
- * @brief send management packets to apps (listener).
- * This is used for wireless applications.
- * 
- * @param[in] hdl opaque device handle
- * @param[in] pkt network buffer to send
- * @param[in] len length of buffer
- */
-static inline void
-adf_net_fw_mgmt_to_app(adf_net_handle_t hdl, adf_nbuf_t pkt, a_uint32_t len)
-{
-    __adf_net_fw_mgmt_to_app(hdl, pkt, len);
-}
-/**
- * @brief send wireless events to listening applications
- * 
- * @param[in] hdl opaque device handle
- * @param[in] what event to send
- * @param[in] data information about event
- * @param[in] data_len length of accompanying information
- */
-static inline void
-adf_net_send_wireless_event(adf_net_handle_t hdl, 
-                            adf_net_wireless_event_t what, 
-                            void *data, adf_os_size_t data_len)
-{
-    __adf_net_send_wireless_event(hdl, what, data, data_len); 
-}
-
-/**
- * @brief schedule the poll controller.
- * 
- * @param[in] hdl opaque device handle
- */
-static inline void 
-adf_net_poll_schedule(adf_net_handle_t hdl)
-{
-    __adf_net_poll_schedule(hdl);
-}
-
-
-/**
- * @brief per cpu deffered callback (e.g. for RSS)
- * 
- * @param[in] hdl opaque device handle
- * @param[in] cpu_msk
- * @param[in] arg
- */
-static inline void 
-adf_net_poll_schedule_cpu(adf_net_handle_t hdl, a_uint32_t cpu_msk, void *arg)
-{
-    __adf_net_poll_schedule_cpu(hdl, cpu_msk, arg);
-}
-
 /**
  * @brief Get OS Handle from OS device object.
  *
  * @param[in] osdev OS device object
- * 
+ *
  * @return OS handle
- */ 
+ */
 static inline adf_os_handle_t
 adf_net_dev_to_os(adf_os_device_t osdev)
 {
@@ -467,9 +300,9 @@ adf_net_dev_to_os(adf_os_device_t osdev)
  * @brief Get OS Handle from OS net handle.
  *
  * @param[in] osdev OS net handle
- * 
+ *
  * @return OS handle
- */ 
+ */
 static inline adf_os_handle_t
 adf_net_hdl_to_os(adf_net_handle_t hdl)
 {
index 40b8e58384773d82794e71044ebca6831abc7c3d..66783afc1873ce9b46d1b52fcba6de7c5f6b4854 100755 (executable)
@@ -36,7 +36,7 @@
  * @ingroup adf_net_public
  * @file adf_net_sw.h
  * This file defines the device and virtual device switch tables.
- */ 
+ */
 
 #ifndef __ADF_NET_SW_H
 #define __ADF_NET_SW_H
@@ -49,7 +49,7 @@ typedef struct _adf_dev_sw{
     /**
      * @brief Handler for device open - mandatory interface
      */
-    a_status_t        (*drv_open)      (adf_drv_handle_t hdl); 
+    a_status_t        (*drv_open)      (adf_drv_handle_t hdl);
     /**
      * @brief Handler for device close - mandatory interface
      */
@@ -66,7 +66,7 @@ typedef struct _adf_dev_sw{
     /**
      * @brief Handler for ioctl - mandatory interface
      */
-    a_status_t        (*drv_ioctl)     (adf_drv_handle_t hdl, int num, 
+    a_status_t        (*drv_ioctl)     (adf_drv_handle_t hdl, int num,
                                         void *data);
     /**
      * @brief Handler for transmission timeout - mandatory interface
@@ -77,17 +77,17 @@ typedef struct _adf_dev_sw{
      */
     a_status_t  (*drv_wcmd) (adf_drv_handle_t hdl, adf_net_wcmd_type_t cmd,
                                            adf_net_wcmd_data_t *data);
-    /** 
-     * @brief Handler for polling if polling/deferred processing required - 
+    /**
+     * @brief Handler for polling if polling/deferred processing required -
      * optional interface
      */
-    adf_net_poll_resp_t (*drv_poll) (adf_drv_handle_t hdl, int quota, 
+    adf_net_poll_resp_t (*drv_poll) (adf_drv_handle_t hdl, int quota,
                                      int *work_done);
     /**
      * @brief Handler for per cpu deffered callback (e.g. for RSS) - optional
      * interface
      */
-    adf_net_poll_resp_t (*drv_poll_cpu) (adf_drv_handle_t hdl, int quota, 
+    adf_net_poll_resp_t (*drv_poll_cpu) (adf_drv_handle_t hdl, int quota,
                                          int *work_done, void *arg);
     /**
      * @brief Handler for disabling receive interrupts for polling.
index 4238c38a2576966e3a401c859dce5069e1594306..dcd032cde3a591aa81d1eb39a3b3f3d4b7190c34 100755 (executable)
@@ -72,7 +72,7 @@ typedef enum {
 
 
 /**
- * @brief Indicates what features are supported by the interface. 
+ * @brief Indicates what features are supported by the interface.
  */
 #define ADF_NET_LINK_SUPP_10baseT_Half      (1 << 0)
 #define ADF_NET_LINK_SUPP_10baseT_Full      (1 << 1)
@@ -93,7 +93,7 @@ typedef enum {
                                            ADF_NET_LINK_SUPP_1000baseT_Full)
 
 /**
- * @brief Indicates what features are advertised by the interface. 
+ * @brief Indicates what features are advertised by the interface.
  */
 #define ADF_NET_LINK_ADV_10baseT_Half     (1 << 0)
 #define ADF_NET_LINK_ADV_10baseT_Full     (1 << 1)
@@ -196,7 +196,7 @@ typedef struct adf_net_vlanhdr{
 typedef struct adf_net_vid{
 #if defined (ADF_LITTLE_ENDIAN_MACHINE)
     a_uint16_t      val:12;
-    a_uint8_t       res:4;  
+    a_uint8_t       res:4;
 #elif defined (ADF_BIG_ENDIAN_MACHINE)
     a_uint8_t      res:4;
     a_uint16_t      val:12;
@@ -314,7 +314,7 @@ typedef union {
 }adf_net_cmd_data_t;
 
 /**
- * @brief For polled devices, adf_drv responds with one of the following status in 
+ * @brief For polled devices, adf_drv responds with one of the following status in
  * its poll function.
  */
 typedef enum {
@@ -368,7 +368,7 @@ typedef enum adf_net_wireless_events{
     ADF_IEEE80211_SCAN = __ADF_IEEE80211_SCAN,
     ADF_IEEE80211_REPLAY = __ADF_IEEE80211_REPLAY,
     ADF_IEEE80211_MICHAEL = __ADF_IEEE80211_MICHAEL,
-    ADF_IEEE80211_REJOIN = __ADF_IEEE80211_REJOIN, 
+    ADF_IEEE80211_REJOIN = __ADF_IEEE80211_REJOIN,
     ADF_CUSTOM_PUSH_BUTTON = __ADF_CUSTOM_PUSH_BUTTON
 }adf_net_wireless_event_t;
 
index ea0aebb2e987608f1880cf2a720f8b2427a6a335..196419582f14b213026a778a0c54a061e842fed0 100755 (executable)
@@ -34,7 +34,7 @@
  */
 /**
  * Copyright (c) Atheros Communications Inc. 2002-2008
- * 
+ *
  */
 
 #ifndef __ADF_NET_WCMD_H
@@ -50,8 +50,8 @@
  * Defines
  */
 #define ADF_NET_WCMD_NAME_SIZE          __ADF_OS_NAME_SIZE
-#define ADF_NET_WCMD_NICK_NAME          32 /**< Max Device nick name size*/     
-#define ADF_NET_WCMD_MODE_NAME_LEN      6 
+#define ADF_NET_WCMD_NICK_NAME          32 /**< Max Device nick name size*/
+#define ADF_NET_WCMD_MODE_NAME_LEN      6
 #define ADF_NET_WCMD_IE_MAXLEN          256 /** Max Len for IE */
 
 #define ADF_NET_WCMD_MAX_BITRATES       32
@@ -64,7 +64,7 @@
  * @brief key set/get info
  */
 #define ADF_NET_WCMD_KEYBUF_SIZE        16
-#define ADF_NET_WCMD_MICBUF_SIZE        16/**< space for tx+rx keys */ 
+#define ADF_NET_WCMD_MICBUF_SIZE        16/**< space for tx+rx keys */
 #define ADF_NET_WCMD_KEY_DEFAULT        0x80/**< default xmit key */
 #define ADF_NET_WCMD_ADDR_LEN           6
 #define ADF_NET_WCMD_KEYDATA_SZ          \
@@ -75,8 +75,8 @@
  */
 #define ADF_NET_WCMD_VAPKEY_XMIT        0x01/**< xmit */
 #define ADF_NET_WCMD_VAPKEY_RECV        0x02/**< recv */
-#define ADF_NET_WCMD_VAPKEY_GROUP       0x04/**< WPA group*/ 
-#define ADF_NET_WCMD_VAPKEY_SWCRYPT     0x10/**< Encrypt/decrypt*/ 
+#define ADF_NET_WCMD_VAPKEY_GROUP       0x04/**< WPA group*/
+#define ADF_NET_WCMD_VAPKEY_SWCRYPT     0x10/**< Encrypt/decrypt*/
 #define ADF_NET_WCMD_VAPKEY_SWMIC       0x20/**< Enmic/Demic */
 #define ADF_NET_WCMD_VAPKEY_DEFAULT     0x80/**< Default key */
 
  * @brief Ethtool specific
  */
 #define ADF_NET_WCMD_BUSINFO_LEN        32
-#define ADF_NET_WCMD_DRIVSIZ            32  
-#define ADF_NET_WCMD_VERSIZ             32  
-#define ADF_NET_WCMD_FIRMSIZ            32  
+#define ADF_NET_WCMD_DRIVSIZ            32
+#define ADF_NET_WCMD_VERSIZ             32
+#define ADF_NET_WCMD_FIRMSIZ            32
 /**
  * *******************************Enums******************
  */
@@ -133,21 +133,21 @@ typedef enum adf_net_wcmd_ciphermode{
  */
 typedef enum adf_net_wcmd_type{
     /* net80211 */
-    ADF_NET_WCMD_GET_RTS_THRES,     
-    ADF_NET_WCMD_SET_RTS_THRES,     
-    ADF_NET_WCMD_GET_FRAGMENT,  
-    ADF_NET_WCMD_SET_FRAGMENT,  
-    ADF_NET_WCMD_GET_VAPMODE,   
+    ADF_NET_WCMD_GET_RTS_THRES,
+    ADF_NET_WCMD_SET_RTS_THRES,
+    ADF_NET_WCMD_GET_FRAGMENT,
+    ADF_NET_WCMD_SET_FRAGMENT,
+    ADF_NET_WCMD_GET_VAPMODE,
     ADF_NET_WCMD_SET_VAPMODE,
-    ADF_NET_WCMD_GET_BSSID, 
-    ADF_NET_WCMD_SET_BSSID, 
-    ADF_NET_WCMD_GET_NICKNAME,      
-    ADF_NET_WCMD_SET_NICKNAME,      
-    ADF_NET_WCMD_GET_FREQUENCY,     
-    ADF_NET_WCMD_SET_FREQUENCY,     
-    ADF_NET_WCMD_GET_ESSID, 
-    ADF_NET_WCMD_SET_ESSID, 
-    ADF_NET_WCMD_GET_TX_POWER,  
+    ADF_NET_WCMD_GET_BSSID,
+    ADF_NET_WCMD_SET_BSSID,
+    ADF_NET_WCMD_GET_NICKNAME,
+    ADF_NET_WCMD_SET_NICKNAME,
+    ADF_NET_WCMD_GET_FREQUENCY,
+    ADF_NET_WCMD_SET_FREQUENCY,
+    ADF_NET_WCMD_GET_ESSID,
+    ADF_NET_WCMD_SET_ESSID,
+    ADF_NET_WCMD_GET_TX_POWER,
     ADF_NET_WCMD_SET_TX_POWER,
     ADF_NET_WCMD_GET_PARAM,
     ADF_NET_WCMD_SET_PARAM,
@@ -158,14 +158,14 @@ typedef enum adf_net_wcmd_type{
     ADF_NET_WCMD_SET_ENC,
     ADF_NET_WCMD_GET_KEY,
     ADF_NET_WCMD_SET_KEY,
-    ADF_NET_WCMD_GET_SCAN,      
-    ADF_NET_WCMD_SET_SCAN,      
-    ADF_NET_WCMD_GET_MODE,  
-    ADF_NET_WCMD_SET_MODE,  
-    ADF_NET_WCMD_GET_CHAN_LIST, 
-    ADF_NET_WCMD_SET_CHAN_LIST, 
-    ADF_NET_WCMD_GET_WMM_PARAM, 
-    ADF_NET_WCMD_SET_WMM_PARAM, 
+    ADF_NET_WCMD_GET_SCAN,
+    ADF_NET_WCMD_SET_SCAN,
+    ADF_NET_WCMD_GET_MODE,
+    ADF_NET_WCMD_SET_MODE,
+    ADF_NET_WCMD_GET_CHAN_LIST,
+    ADF_NET_WCMD_SET_CHAN_LIST,
+    ADF_NET_WCMD_GET_WMM_PARAM,
+    ADF_NET_WCMD_SET_WMM_PARAM,
     ADF_NET_WCMD_GET_VAPNAME,
     ADF_NET_WCMD_GET_IC_CAPS,
     ADF_NET_WCMD_GET_RETRIES,
@@ -202,7 +202,7 @@ typedef enum adf_net_wcmd_type{
     ADF_NET_WCMD_GET_DEV_DIALOG,
     ADF_NET_WCMD_GET_DEV_PHYERR,
     ADF_NET_WCMD_GET_DEV_CWM,
-    ADF_NET_WCMD_GET_DEV_ETHTOOL,       
+    ADF_NET_WCMD_GET_DEV_ETHTOOL,
     ADF_NET_WCMD_SET_DEV_MAC,
     ADF_NET_WCMD_SET_DEV_CAP,/*ATH_CAP*/
     /* Device write specific */
@@ -348,7 +348,7 @@ typedef enum adf_net_wcmd_param_id{
     ADF_NET_WCMD_PARAM_FAST_CC,/**< fast channel change */
     /**
      * 11n A-MPDU, A-MSDU support
-     */ 
+     */
     ADF_NET_WCMD_PARAM_AMPDU,/**< 11n a-mpdu support */
     ADF_NET_WCMD_PARAM_AMPDU_LIMIT,/**< a-mpdu length limit */
     ADF_NET_WCMD_PARAM_AMPDU_DENSITY,/**< a-mpdu density */
@@ -369,7 +369,7 @@ typedef enum adf_net_wcmd_param_id{
     ADF_NET_WCMD_PARAM_RB,/**< Switch in/out of RB */
     /**
      * RB Detection knobs.
-     */ 
+     */
     ADF_NET_WCMD_PARAM_RB_DETECT,/**< Do RB detection */
     ADF_N