MFC r344990:Fix ieee80211_radiotap(9) usage in wireless drivers:- Alignment issues: * Add missing __packed attributes + padding across all drivers; inmost places there was an assumption that pad
MFC r344990:Fix ieee80211_radiotap(9) usage in wireless drivers:- Alignment issues: * Add missing __packed attributes + padding across all drivers; inmost places there was an assumption that padding will be alwaysminimally suitable; in few places - e.g., in urtw(4) / rtwn(4) -padding was just missing. * Add __aligned(8) attribute for all Rx radiotap headers since they cancontain 64-bit TSF timestamp; it cannot appear in Tx radiotap headers, sojust drop the attribute here. Refresh ieee80211_radiotap(9) man pageaccordingly.- Since net80211 automatically updates channel frequency / flags inieee80211_radiotap_chan_change() drop duplicate setup for these fieldsin drivers.
show more ...
MFC r343474:Remove 2GHz channel list copies from wireless drivers.Wrap ieee80211_add_channel_list_2ghz into another functionwhich supplies default (1-14) channel list to it and dropits copies fr
MFC r343474:Remove 2GHz channel list copies from wireless drivers.Wrap ieee80211_add_channel_list_2ghz into another functionwhich supplies default (1-14) channel list to it and dropits copies from drivers.
Reapply, with minor tweaks, r338025, from the original commit:Remove unused and easy to misuse PNP macro parameterInspired by r338025, just remove the element size parameter to theMODULE_PNP_INF
Reapply, with minor tweaks, r338025, from the original commit:Remove unused and easy to misuse PNP macro parameterInspired by r338025, just remove the element size parameter to theMODULE_PNP_INFO macro entirely. The 'table' parameter is now required tohave correct pointer (or array) type. Since all invocations of the macroalready had this property and the emitted PNP data continues to include theelement size, there is no functional change.Mostly done with the coccinelle 'spatch' tool: $ cat modpnpsize0.cocci @normaltables@ identifier b,c; expression a,d,e; declarer MODULE_PNP_INFO; @@ MODULE_PNP_INFO(a,b,c,d, -sizeof(d[0]), e); @singletons@ identifier b,c,d; expression a; declarer MODULE_PNP_INFO; @@ MODULE_PNP_INFO(a,b,c,&d, -sizeof(d), 1); $ rg -l MODULE_PNP_INFO -- sys | \ xargs spatch --in-place --sp-file modpnpsize0.cocci(Note that coccinelle invokes diff(1) via a PATH search and expects diff totolerate the -B flag, which BSD diff does not. So I had to link gdiff intoPATH as diff to use spatch.)Tinderbox'd (-DMAKE_JUST_KERNELS).Approved by: re (glen)
Back out r338035 until Warner is finished churning GSoC PNP patchesI was not aware Warner was making or planning to make forward progress inthis area and have since been informed of that.It's ea
Back out r338035 until Warner is finished churning GSoC PNP patchesI was not aware Warner was making or planning to make forward progress inthis area and have since been informed of that.It's easy to apply/reapply when churn dies down.
Remove unused and easy to misuse PNP macro parameterInspired by r338025, just remove the element size parameter to theMODULE_PNP_INFO macro entirely. The 'table' parameter is now required tohave
Remove unused and easy to misuse PNP macro parameterInspired by r338025, just remove the element size parameter to theMODULE_PNP_INFO macro entirely. The 'table' parameter is now required tohave correct pointer (or array) type. Since all invocations of the macroalready had this property and the emitted PNP data continues to include theelement size, there is no functional change.Mostly done with the coccinelle 'spatch' tool: $ cat modpnpsize0.cocci @normaltables@ identifier b,c; expression a,d,e; declarer MODULE_PNP_INFO; @@ MODULE_PNP_INFO(a,b,c,d, -sizeof(d[0]), e); @singletons@ identifier b,c,d; expression a; declarer MODULE_PNP_INFO; @@ MODULE_PNP_INFO(a,b,c,&d, -sizeof(d), 1); $ rg -l MODULE_PNP_INFO -- sys | \ xargs spatch --in-place --sp-file modpnpsize0.cocci(Note that coccinelle invokes diff(1) via a PATH search and expects diff totolerate the -B flag, which BSD diff does not. So I had to link gdiff intoPATH as diff to use spatch.)Tinderbox'd (-DMAKE_JUST_KERNELS).
bwi(4): Set ic->ic_softc before bwi_getradiocaps to avoid bad derefSubmitted by: François Revol <[email protected]>Obtained from: Haiku (ba88131cfde64e21bedb4ebedd699cfa5e7fd314)MFC after: 1 week
Add PNP info to PCI attachment of bwi driverReviewed by: imp, chuckSubmitted by: Lakhan Shiva Kamireddy <[email protected]>Sponsored by: Google, Inc. (GSoC 2018)
sys/dev: further adoption of SPDX licensing ID tags.Mainly focus on files that use BSD 2-Clause license, however the tool Iwas using misidentified many licenses so this was mostly a manual - error
sys/dev: further adoption of SPDX licensing ID tags.Mainly focus on files that use BSD 2-Clause license, however the tool Iwas using misidentified many licenses so this was mostly a manual - errorprone - task.The Software Package Data Exchange (SPDX) group provides a specificationto make it easier for automated tools to detect and summarize well knownopensource licenses. We are gradually adopting the specification, notingthat the tags are considered only advisory and do not, in any way,superceed or replace the license texts.
sys/dev: further adoption of SPDX licensing ID tags.Mainly focus on files that use BSD 3-Clause license.The Software Package Data Exchange (SPDX) group provides a specificationto make it easier
sys/dev: further adoption of SPDX licensing ID tags.Mainly focus on files that use BSD 3-Clause license.The Software Package Data Exchange (SPDX) group provides a specificationto make it easier for automated tools to detect and summarize well knownopensource licenses. We are gradually adopting the specification, notingthat the tags are considered only advisory and do not, in any way,superceed or replace the license texts.Special thanks to Wind River for providing access to "The Duke ofHighlander" tool: an older (2014) run over FreeBSD tree was useful as astarting point.
Fix drivers that assume ticks starts at zero. These drivers all have logicsimilar to "if (ticks > localvar+interval) {localvar=ticks; ...}" wherelocalvar is initialized to zero. Ticks is initiali
Fix drivers that assume ticks starts at zero. These drivers all have logicsimilar to "if (ticks > localvar+interval) {localvar=ticks; ...}" wherelocalvar is initialized to zero. Ticks is initialized to a negative valuesince r278230, and that leads to these if statements never being true.
net80211 drivers: fix rate setup for EAPOL frames, obtain Tx parametersdirectly from the node.- Use ni_txparms directly instead of calculating them manually every time- Move M_EAPOL flag check up
net80211 drivers: fix rate setup for EAPOL frames, obtain Tx parametersdirectly from the node.- Use ni_txparms directly instead of calculating them manually every time- Move M_EAPOL flag check upper; otherwise it may be skipped due to'ucastrate' / 'mcastrate' check- Use 'mgtrate' for control frames too (see ifconfig(8), mgtrate parameter)- Add few more M_EAPOL checks where it was missing (zyd(4), ural(4),urtw(4))- Few unrelated cleanupsTested with: - Intel 6205 (iwn(4)), STA mode; - WUSB54GC (rum(4)), HOSTAP mode + RTL8188EU (rtwn(4)), STA mode.Reviewed by: adrianDifferential Revision: https://reviews.freebsd.org/D9811
net80211: ieee80211_ratectl*: switch to reusable KPIReplace various void * / int argument combinations with common structures:- ieee80211_ratectl_tx_status for *_tx_complete();- ieee80211_ratectl
net80211: ieee80211_ratectl*: switch to reusable KPIReplace various void * / int argument combinations with common structures:- ieee80211_ratectl_tx_status for *_tx_complete();- ieee80211_ratectl_tx_stats for *_tx_update();While here, improve amrr_tx_update() for a bit:1. In case, if receiver is not known (typical for Ralink USB drivers),refresh Tx rate for all nodes on the interface.2. There was a misuse:- otus(4) sends non-decreasing counters (as originally intended);- but ural(4), rum(4) and run(4) are using 'read & clear' registersto obtain statistics for some period of time (and those 'last period'values are used as arguments for tx_update()). If arguments are not bigenough, they are just discarded after the next call.Fix: move counting into *_tx_update()(now otus(4) will zero out all node counters after every tx_update() call)Tested with:- Intel 3945BG (wpi(4)), STA mode.- WUSB54GC (rum(4)), STA / HOSTAP mode.- RTL8188EU (urtwn(4)), STA mode.Reviewed by: adrianDifferential Revision: https://reviews.freebsd.org/D8037
bwi: switch to ieee80211_add_channel_list_2ghz().- Use device's channel list instead of default one (fromieee80211_init_channels()); adds 12 - 14 2GHz channels.- Add ic_getradiocaps() method.
sys/dev: minor spelling fixes.Most affect comments, very few have user-visible effects.
net80211 + drivers: hide size of 'bands' array behind a macro.Auto-replace 'howmany(IEEE80211_MODE_MAX, 8)' with 'IEEE80211_MODE_BYTES'.No functional changes.
sys/dev: use our nitems() macro when it is avaliable through param.h.No functional change, only trivial cases are done in this sweep,Drivers that can get further enhancements will be done independ
sys/dev: use our nitems() macro when it is avaliable through param.h.No functional change, only trivial cases are done in this sweep,Drivers that can get further enhancements will be done independently.Discussed in: freebsd-current
net80211 drivers: fix ieee80211_init_channels() usageFix out-of-bounds read (all) / write (11n capable) for driversthat are using ieee80211_init_channels() to initialize channel list.Tested with
net80211 drivers: fix ieee80211_init_channels() usageFix out-of-bounds read (all) / write (11n capable) for driversthat are using ieee80211_init_channels() to initialize channel list.Tested with: * RTL8188EU, STA mode. * RTL8188CUS, STA mode. * WUSB54GC, HOSTAP mode.Approved by: adrian (mentor)MFC after: 2 weeksDifferential Revision: https://reviews.freebsd.org/D4818
net80211: move ieee80211_free_node() call on error from ic_raw_xmit() to ieee80211_raw_output().This doesn't free the mbuf upon error; the driver ic_raw_xmit method is stilldoing that.Submitted
net80211: move ieee80211_free_node() call on error from ic_raw_xmit() to ieee80211_raw_output().This doesn't free the mbuf upon error; the driver ic_raw_xmit method is stilldoing that.Submitted by: <[email protected]>Differential Revision: https://reviews.freebsd.org/D3774
net80211 & wireless drivers: remove duplicate defines (noop)* IEEE80211_DIR_DSTODS(wh) -> IEEE80211_IS_DSTODS(wh).* N(a) -> nitems(a).* Remove LE_READ_2(p)/LE_READ_4(p) definitions (and include i
net80211 & wireless drivers: remove duplicate defines (noop)* IEEE80211_DIR_DSTODS(wh) -> IEEE80211_IS_DSTODS(wh).* N(a) -> nitems(a).* Remove LE_READ_2(p)/LE_READ_4(p) definitions (and include ieee80211_input.h instead).* <drvname>_TXOP_TO_US(txop) -> IEEE80211_TXOP_TO_US(txop).* Put IEEE80211_RV(v) into ieee80211_proto.h and remove local RV(v) definitions.Submitted by: Andriy Voskoboinyk <[email protected]>Differential Revision: https://reviews.freebsd.org/D3705
Replay r286410. Change KPI of how device drivers that provide wirelessconnectivity interact with the net80211 stack.Historical background: originally wireless devices created an interface,just li
Replay r286410. Change KPI of how device drivers that provide wirelessconnectivity interact with the net80211 stack.Historical background: originally wireless devices created an interface,just like Ethernet devices do. Name of an interface matched the name ofthe driver that created. Later, wlan(4) layer was introduced, and thewlanX interfaces become the actual interface, leaving original ones as"a parent interface" of wlanX. Kernelwise, the KPI between net80211 layerand a driver became a mix of methods that pass a pointer to struct ifnetas identifier and methods that pass pointer to struct ieee80211com. Fromuser point of view, the parent interface just hangs on in the ifconfiglist, and user can't do anything useful with it.Now, the struct ifnet goes away. The struct ieee80211com is the onlyKPI between a device driver and net80211. Details:- The struct ieee80211com is embedded into drivers softc.- Packets are sent via new ic_transmit method, which is very much like the previous if_transmit.- Bringing parent up/down is done via new ic_parent method, which notifies driver about any changes: number of wlan(4) interfaces, number of them in promisc or allmulti state.- Device specific ioctls (if any) are received on new ic_ioctl method.- Packets/errors accounting are done by the stack. In certain cases, when driver experiences errors and can not attribute them to any specific interface, driver updates ic_oerrors or ic_ierrors counters.Details on interface configuration with new world order:- A sequence of commands needed to bring up wireless DOESN"T change.- /etc/rc.conf parameters DON'T change.- List of devices that can be used to create wlan(4) interfaces is now provided by net.wlan.devices sysctl.Most drivers in this change were converted by me, except of wpi(4),that was done by Andriy Voskoboinyk. Big thanks to Kevin Lo for testingchanges to at least 8 drivers. Thanks to pluknet@, Oliver Hartmann,Olivier Cochard, gjb@, mmoll@, op@ and lev@, who also participated intesting.Reviewed by: adrianSponsored by: NetflixSponsored by: Nginx, Inc.
Convert more ifp->if_softc -> ic->ic_softc.These should be a big no-op.Tested:* make universe
Revert the wifi ifnet changes until things are more baked and tested.* 286410* 286413* 286416The initial commit broke a variety of debug and features that aren'tin the GENERIC kernels but are
Revert the wifi ifnet changes until things are more baked and tested.* 286410* 286413* 286416The initial commit broke a variety of debug and features that aren'tin the GENERIC kernels but are enabled in other platforms.
Change KPI of how device drivers that provide wireless connectivity interactwith the net80211 stack.Historical background: originally wireless devices created an interface,just like Ethernet devi
Change KPI of how device drivers that provide wireless connectivity interactwith the net80211 stack.Historical background: originally wireless devices created an interface,just like Ethernet devices do. Name of an interface matched the name ofthe driver that created. Later, wlan(4) layer was introduced, and thewlanX interfaces become the actual interface, leaving original ones as"a parent interface" of wlanX. Kernelwise, the KPI between net80211 layerand a driver became a mix of methods that pass a pointer to struct ifnetas identifier and methods that pass pointer to struct ieee80211com. Fromuser point of view, the parent interface just hangs on in the ifconfiglist, and user can't do anything useful with it.Now, the struct ifnet goes away. The struct ieee80211com is the onlyKPI between a device driver and net80211. Details:- The struct ieee80211com is embedded into drivers softc.- Packets are sent via new ic_transmit method, which is very much like the previous if_transmit.- Bringing parent up/down is done via new ic_parent method, which notifies driver about any changes: number of wlan(4) interfaces, number of them in promisc or allmulti state.- Device specific ioctls (if any) are received on new ic_ioctl method.- Packets/errors accounting are done by the stack. In certain cases, when driver experiences errors and can not attribute them to any specific interface, driver updates ic_oerrors or ic_ierrors counters.Details on interface configuration with new world order:- A sequence of commands needed to bring up wireless DOESN"T change.- /etc/rc.conf parameters DON'T change.- List of devices that can be used to create wlan(4) interfaces is now provided by net.wlan.devices sysctl.Most drivers in this change were converted by me, except of wpi(4),that was done by Andriy Voskoboinyk. Big thanks to Kevin Lo for testingchanges to at least 8 drivers. Thanks to Olivier Cochard, gjb@, mmoll@,op@ and lev@, who also participated in testing. Details here:https://wiki.freebsd.org/projects/ifnet/net80211Still, drivers: ndis, wtap, mwl, ipw, bwn, wi, upgt, uath were nottested. Changes to mwl, ipw, bwn, wi, upgt are trivial and chancesof problems are low. The wtap wasn't compilable even before this change.But the ndis driver is complex, and it is likely to be broken with thiscommit. Help with testing and debugging it is appreciated.Differential Revision: D2655, D2740Sponsored by: Nginx, Inc.Sponsored by: Netflix
Follow-up r283636 with a fix to the other abuses of BUS_SPACE_MAXSIZE_32BIT.It makes no sense to specify a segment size that's larger than the totalamount that you want to allocate.
To avoid sleeping in firmware_get() with bwi mutex held, callbwi_mac_fw_alloc() at the device attach, not in the interfaceinit.
123