Fix some modules to export more used symbols(cherry picked from commit 5bb3134a8c21cb87b30e135ef168483f0333dabb)
[ath] [ath_hal] (etc, etc) - begin the task of re-modularising the HAL.In the deep past, when this code compiled as a binary module, ath_halbuilt as a module. This allowed custom, smaller HAL mod
[ath] [ath_hal] (etc, etc) - begin the task of re-modularising the HAL.In the deep past, when this code compiled as a binary module, ath_halbuilt as a module. This allowed custom, smaller HAL modules to be built.This was especially beneficial for small embedded platforms where youdidn't require /everything/ just to run.However, sometime around the HAL opening fanfare, the HAL landed hereas one big driver+HAL thing, and a lot of the (dirty) infrastructure(ie, #ifdef AH_SUPPORT_XXX) to build specific subsets of the HAL went away.This was retained in sys/conf/files as "ath_hal_XXX" but it wasn'treally floated up to the modules themselves.I'm now in a position where for the reaaaaaly embedded boards (both thereally old and the last couple generation of QCA MIPS boards) having acut down HAL module and driver loaded at runtime is /actually/ beneficial.This reduces the kernel size down by quite a bit. The MIPS modules looklike this:adrian@gertrude:~/work/freebsd/head-embedded/src % ls -l ../root/mips_ap/boot/kernel.CARAMBOLA2/ath*ko-r-xr-xr-x 1 adrian adrian 5076 May 23 23:45 ../root/mips_ap/boot/kernel.CARAMBOLA2/ath_dfs.ko-r-xr-xr-x 1 adrian adrian 100588 May 23 23:45 ../root/mips_ap/boot/kernel.CARAMBOLA2/ath_hal.ko-r-xr-xr-x 1 adrian adrian 627324 May 23 23:45 ../root/mips_ap/boot/kernel.CARAMBOLA2/ath_hal_ar9300.ko-r-xr-xr-x 1 adrian adrian 314588 May 23 23:45 ../root/mips_ap/boot/kernel.CARAMBOLA2/ath_main.ko-r-xr-xr-x 1 adrian adrian 23472 May 23 23:45 ../root/mips_ap/boot/kernel.CARAMBOLA2/ath_rate.koAnd the x86 versions, like this:root@gertrude:/home/adrian # ls -l /boot/kernel/ath*ko-r-xr-xr-x 1 root wheel 36632 May 24 18:32 /boot/kernel/ath_dfs.ko-r-xr-xr-x 1 root wheel 134440 May 24 18:32 /boot/kernel/ath_hal.ko-r-xr-xr-x 1 root wheel 82320 May 24 18:32 /boot/kernel/ath_hal_ar5210.ko-r-xr-xr-x 1 root wheel 104976 May 24 18:32 /boot/kernel/ath_hal_ar5211.ko-r-xr-xr-x 1 root wheel 236144 May 24 18:32 /boot/kernel/ath_hal_ar5212.ko-r-xr-xr-x 1 root wheel 336104 May 24 18:32 /boot/kernel/ath_hal_ar5416.ko-r-xr-xr-x 1 root wheel 598336 May 24 18:32 /boot/kernel/ath_hal_ar9300.ko-r-xr-xr-x 1 root wheel 406144 May 24 18:32 /boot/kernel/ath_main.ko-r-xr-xr-x 1 root wheel 55352 May 24 18:32 /boot/kernel/ath_rate.ko.. so you can see, not building the whole HAL can save quite a bit.For example, if you don't need AR9300 support, you can actually avoidwasting half a megabyte of RAM. On embedded routers this is quite abig deal.The AR9300 HAL can be later further shrunk because, hilariously,it indeed supports AH_SUPPORT_<xxx> for optionally adding chipset support.(I'll chase that down later as it's quite a big savings if you're onlybuilding for a single embedded target.)So:* Create a very hackish way to load/unload HAL modules* Create module metadata for each HAL subtype - ah_osdep_arXXXX.c* Create module metadata for ath_rate and ath_dfs (bluetooth is currently just built as part of it)* .. yes, this means we could actually build multiple rate control modules and pick one at load time, but I'd rather just glue this into net80211's rate control code. Oh well, baby steps.* Main driver is now "ath_main"* Create an "if_ath" module that does what the ye olde one did - load PCI glue, main driver, HAL and all child modules. In this way, if you have "if_ath_load=YES" in /boot/modules.conf it will load everything the old way and stuff should still work.* For module autoloading purposes, I actually /did/ fix up the name of the modules in if_ath_pci and if_ath_ahb.If you want to selectively load things (eg on ye cheape ARM/MIPS platformswhere RAM is at a premium) you should:* load ath_hal* load the chip modules in question* load ath_rate, ath_dfs* load ath_main* load if_ath_pci and/or if_ath_ahb depending upon your particular bus bind type - this is where probe/attach is done.TODO:* AR5312 module and associated pieces - yes, we have the SoC side support now so the wifi support would be good to "round things out";* Just nuke AH_SUPPORT_AR5416 for now and always bloat the packet structures; this'll simplify other things.* Should add a simple refcnt thing to the HAL RF/chip modules so you can't unload them whilst you're using them.* Manpage updates, UPDATING if appropriate, etc.
show more ...
Switch to ath hal source code. Note this removes the ath_halmodule; the ath module now brings in the hal support. Kernelconfig files are almost backwards compatible; supplyingdevice ath_halgiv
Switch to ath hal source code. Note this removes the ath_halmodule; the ath module now brings in the hal support. Kernelconfig files are almost backwards compatible; supplyingdevice ath_halgives you the same chip support that the binary hal did but youmust also includeoptions AH_SUPPORT_AR5416to enable the extended format descriptors used by 11n parts.It is now possible to control the chip support included in abuild by specifying exactly which chips are to be supportedin the config file; consult ath_hal(4) for information.
o move ath hal os glue code from the hal to the driver: this code was part of the hal distribution early on when the hal was built for each os but it's been portable for a long time so move the o
o move ath hal os glue code from the hal to the driver: this code was part of the hal distribution early on when the hal was built for each os but it's been portable for a long time so move the os-specific code out (and off the vendor branch)o correct the copyright on ah_osdep.?; it was mistakenly given a restricted license and not a dual-bsd/gpl licenseo remove the module api definition as it was never usedo fixup include paths for move of ah_osdep.hMFC after: 2 weeks
add powerpc glueMFC after: 1 month
fix braino that broke building on amd64Submitted by: Pascal HofsteeMFC after: 2 weeks
fix build on sparcMFC after: 1 month
Fix building for non-i386 platforms.Submitted by: Coleman Kane
Update/new modules for net80211 and ath changes.
nitpickingSubmitted by: Ruslan Ermilov <[email protected]>
module for atheros hal