If I wanted to modify or add new variables to /etc/config/wireless, what's the process or processes that takes the wireless config file to then create the the hostapd configuration files? I know it somehow involves mac80211.sh getting passed some json, but that's all I've been able to figure out.
There's also hostapd.sh that does some part of the job. I haven't investigated what's up with the JSON in these scripts.
These scrips are run during wifi start|reload
or service network restart|reload
and such. They generate /var/run/hostapd*.conf files and restart hostapd.
Have a look at this patch for inspiration.
This lets the user specify “option country2” in /etc/config/wireless and through some logic winds up as “ vht_oper_centr_freq_seg1_idx” in the hostapd cfg.
Good luck.
Edit: I think I remember when you make a change like this you need to restart netifd or you won’t get the changes.