aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/mwl
Commit message (Collapse)AuthorAgeFilesLines
* Use an accessor function to access ifr_data.Brooks Davis2018-03-301-2/+2
| | | | | | | | | | | | | | | | This fixes 32-bit compat (no ioctl command defintions are required as struct ifreq is the same size). This is believed to be sufficent to fully support ifconfig on 32-bit systems. Reviewed by: kib Obtained from: CheriBSD MFC after: 1 week Relnotes: yes Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14900 Notes: svn path=/head/; revision=331797
* [net80211] convert all of the WME use over to a temporary copy of WME info.Adrian Chadd2018-01-021-1/+5
| | | | | | | | | | | | | | | | | | | | This removes the direct WME info access in the ieee80211com struct and instead provides a method of fetching the data. Right now it's a no-op but eventually it'll turn into a per-VAP method for drivers that support it (eg iwn, iwm, upcoming ath10k work) as things like p2p support require this kind of behaviour. Tested: * ath(4), STA and AP mode TODO: * yes, this is slightly stack size-y, but it is an important first step to get drivers migrated over to a sensible WME API. A lot of per-phy things need to be converted to per-VAP before P2P, 11ac firmware, etc stuff shows up. Notes: svn path=/head/; revision=327479
* kernel: Fix several typos and minor errorsEitan Adler2017-12-271-1/+1
| | | | | | | | | | | - duplicate words - typos - references to old versions of FreeBSD Reviewed by: imp, benno Notes: svn path=/head/; revision=327231
* sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-278-0/+16
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326255
* Shorten list of arguments to mbuf external storage freeing function.Gleb Smirnoff2017-10-091-5/+5
| | | | | | | | | | | | | | | | | | | | All of these arguments are stored in m_ext, so there is no reason to pass them in the argument list. Not all functions need the second argument, some don't even need the first one. The second argument lives in next cache line, so not dereferencing it is a performance gain. This was discovered in sendfile(2), which will be covered by next commits. The second goal of this commit is to bring even more flexibility to m_ext mbufs, allowing to create more fields in m_ext, opaque to the generic mbuf code, and potentially set and dereferenced by subsystems. Reviewed by: gallatin, kbowling Differential Revision: https://reviews.freebsd.org/D12615 Notes: svn path=/head/; revision=324446
* [net80211] RX parameter shuffle in net80211 in preparation for 4x4 NICs and ↵Adrian Chadd2017-02-201-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 160MHz channels. * Migrate the rx_params stuff out from ieee80211_freebsd.h where it doesn't belong - this isn't freebsd specific anymore. * Don't use a hard-coded number of chains in the ioctl header; now we can shuffle MAX_CHAINS around so it can be used in the right spot. * Extend the signal/noisefloor levels in the mimo stats struct to userland to include the signal and noisefloor levels for each 20MHz slice of a 160MHz channel. * Bump the number of EVM pilots in preparation for 4x4 and 160MHz channels. Tested: * ath(4), STA mode * iwn(4), STA mode * local ath10k port, STA mode TODO: * 11ax chips will come with 5GHz 8x8 hardware for lots of MU-MIMO - I'll re-bump it at that point. Note: * This breaks the driver and ifconfig ABI; please recompile the kernel, ifconfig and wpa_supplicant/hostapd. Notes: svn path=/head/; revision=313977
* net80211 + drivers: convert to ieee80211_crypto_get_key_wepidx().Andriy Voskoboinyk2016-12-071-1/+1
| | | | | | | Proposed by: adrian Notes: svn path=/head/; revision=309686
* mwl: switch to ieee80211_add_channel*().Andriy Voskoboinyk2016-05-191-98/+28
| | | | Notes: svn path=/head/; revision=300241
* mwl: drop unneeded NULL pointer check.Andriy Voskoboinyk2016-05-171-1/+1
| | | | | | | mh_streams[] is a fixed-length array, not a pointer. Notes: svn path=/head/; revision=300077
* sys/dev: minor spelling fixes.Pedro F. Giffuni2016-05-032-2/+2
| | | | | | | Most affect comments, very few have user-visible effects. Notes: svn path=/head/; revision=298955
* [mwl] s/struct device/device_t/Adrian Chadd2016-05-022-3/+2
| | | | | | | Submitted by: kmacy Notes: svn path=/head/; revision=298915
* net80211: enable promiscuous mode state change for non-monitor/ahdemo modesAndriy Voskoboinyk2016-04-211-8/+1
| | | | | | | | | | | | | | | | | | - Allow to enable/disable promiscuous mode when: * interface is not a member of bridge, or; * request was issued by user (ifconfig wlan0 promisc), or; * interface is in MONITOR or AHDEMO mode. - Drop local workarounds in mwl(4) and malo(4). Tested with: - Intel 3945BG, STA mode; - RTL8188CUS, MONITOR mode; Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D5472 Notes: svn path=/head/; revision=298389
* net80211: move ieee80211_free_node() call on error from ic_raw_xmit() to ↵Adrian Chadd2015-10-121-3/+0
| | | | | | | | | | | | | ieee80211_raw_output(). This doesn't free the mbuf upon error; the driver ic_raw_xmit method is still doing that. Submitted by: <s3erios@gmail.com> Differential Revision: https://reviews.freebsd.org/D3774 Notes: svn path=/head/; revision=289165
* net80211: drop ieee80211_beacon_offsets parameter from ↵Adrian Chadd2015-10-031-2/+1
| | | | | | | | | | ieee80211_beacon_alloc() and ieee80211_beacon_update() Submitted by: <s3erios@gmail.com> Differential Revision: https://reviews.freebsd.org/D3659 Notes: svn path=/head/; revision=288636
* net80211: drop redundant 3rd parameter from iv_key_set().Adrian Chadd2015-10-031-4/+14
| | | | | | | | | | | | The MAC can be fetched from the key struct. I added the ndis updates to make it compile. Submitted by: <s3erios@gmail.com> Differential Revision: https://reviews.freebsd.org/D3657 Notes: svn path=/head/; revision=288635
* net80211: include one copy of struct ieee80211_beacon_offsets into ieee80211vapAdrian Chadd2015-09-221-2/+2
| | | | | | | | Submitted by: Andriy Voskoboinyk <s3erios@gmail.com> Differential Revision: https://reviews.freebsd.org/D3658 Notes: svn path=/head/; revision=288095
* net80211 & wireless drivers: remove duplicate defines (noop)Adrian Chadd2015-09-221-27/+6
| | | | | | | | | | | | | | * 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 <s3erios@gmail.com> Differential Revision: https://reviews.freebsd.org/D3705 Notes: svn path=/head/; revision=288087
* Replay r286410. Change KPI of how device drivers that provide wirelessGleb Smirnoff2015-08-273-312/+204
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | connectivity 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 of the driver that created. Later, wlan(4) layer was introduced, and the wlanX interfaces become the actual interface, leaving original ones as "a parent interface" of wlanX. Kernelwise, the KPI between net80211 layer and a driver became a mix of methods that pass a pointer to struct ifnet as identifier and methods that pass pointer to struct ieee80211com. From user point of view, the parent interface just hangs on in the ifconfig list, and user can't do anything useful with it. Now, the struct ifnet goes away. The struct ieee80211com is the only KPI 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 testing changes to at least 8 drivers. Thanks to pluknet@, Oliver Hartmann, Olivier Cochard, gjb@, mmoll@, op@ and lev@, who also participated in testing. Reviewed by: adrian Sponsored by: Netflix Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=287197
* Revert the wifi ifnet changes until things are more baked and tested.Adrian Chadd2015-08-083-204/+312
| | | | | | | | | | | | * 286410 * 286413 * 286416 The initial commit broke a variety of debug and features that aren't in the GENERIC kernels but are enabled in other platforms. Notes: svn path=/head/; revision=286437
* Fix !MWL_DEBUG build.Gleb Smirnoff2015-08-071-4/+4
| | | | Notes: svn path=/head/; revision=286413
* Change KPI of how device drivers that provide wireless connectivity interactGleb Smirnoff2015-08-073-312/+204
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with the net80211 stack. Historical background: originally wireless devices created an interface, just like Ethernet devices do. Name of an interface matched the name of the driver that created. Later, wlan(4) layer was introduced, and the wlanX interfaces become the actual interface, leaving original ones as "a parent interface" of wlanX. Kernelwise, the KPI between net80211 layer and a driver became a mix of methods that pass a pointer to struct ifnet as identifier and methods that pass pointer to struct ieee80211com. From user point of view, the parent interface just hangs on in the ifconfig list, and user can't do anything useful with it. Now, the struct ifnet goes away. The struct ieee80211com is the only KPI 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 testing changes 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/net80211 Still, drivers: ndis, wtap, mwl, ipw, bwn, wi, upgt, uath were not tested. Changes to mwl, ipw, bwn, wi, upgt are trivial and chances of 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 this commit. Help with testing and debugging it is appreciated. Differential Revision: D2655, D2740 Sponsored by: Nginx, Inc. Sponsored by: Netflix Notes: svn path=/head/; revision=286410
* Change three methods in struct ieee80211com, namely ic_updateslot,Gleb Smirnoff2015-05-251-13/+13
| | | | | | | | | | | ic_update_mcast and ic_update_promisc, to pass pointer to the ieee80211com, not to the ifnet. Sponsored by: Netflix Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=283540
* Set ic_softc in all 802.11 drivers. Not required right now, but will beGleb Smirnoff2015-05-251-0/+1
| | | | | | | | | | used quite soon. Sponsored by: Netflix Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=283537
* Make net80211 drivers supply their device name to the net80211 layer, soGleb Smirnoff2015-05-251-0/+1
| | | | | | | | | | that the latter doesn't need to go through struct ifnet to get their name. Sponsored by: Netflix Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=283527
* CALLOUT_MPSAFE has lost its meaning since r141428, i.e., for more than tenJung-uk Kim2015-05-221-1/+1
| | | | | | | | | | | | | years for head. However, it is continuously misused as the mpsafe argument for callout_init(9). Deprecate the flag and clean up callout_init() calls to make them more consistent. Differential Revision: https://reviews.freebsd.org/D2613 Reviewed by: jhb MFC after: 2 weeks Notes: svn path=/head/; revision=283291
* Fix compilation with GCC in the PAE case.Marius Strobl2015-02-101-8/+7
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=278532
* Use the correct macro for listing the maximum bus space size.Adrian Chadd2014-12-171-2/+2
| | | | | | | Without this, it fails to compile on i386 PAE builds. Notes: svn path=/head/; revision=275870
* Mechanically convert to if_inc_counter().Gleb Smirnoff2014-09-181-8/+10
| | | | Notes: svn path=/head/; revision=271810
* All mbuf external free functions never fail, so let them be void.Gleb Smirnoff2014-07-111-2/+1
| | | | | | | Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=268529
* Pull in r267961 and r267973 again. Fix for issues reported will follow.Hans Petter Selasky2014-06-281-12/+6
| | | | Notes: svn path=/head/; revision=267992
* Revert r267961, r267973:Glen Barber2014-06-271-6/+12
| | | | | | | | | | | | | These changes prevent sysctl(8) from returning proper output, such as: 1) no output from sysctl(8) 2) erroneously returning ENOMEM with tools like truss(1) or uname(1) truss: can not get etype: Cannot allocate memory Notes: svn path=/head/; revision=267985
* Extend the meaning of the CTLFLAG_TUN flag to automatically check ifHans Petter Selasky2014-06-271-12/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | there is an environment variable which shall initialize the SYSCTL during early boot. This works for all SYSCTL types both statically and dynamically created ones, except for the SYSCTL NODE type and SYSCTLs which belong to VNETs. A new flag, CTLFLAG_NOFETCH, has been added to be used in the case a tunable sysctl has a custom initialisation function allowing the sysctl to still be marked as a tunable. The kernel SYSCTL API is mostly the same, with a few exceptions for some special operations like iterating childrens of a static/extern SYSCTL node. This operation should probably be made into a factored out common macro, hence some device drivers use this. The reason for changing the SYSCTL API was the need for a SYSCTL parent OID pointer and not only the SYSCTL parent OID list pointer in order to quickly generate the sysctl path. The motivation behind this patch is to avoid parameter loading cludges inside the OFED driver subsystem. Instead of adding special code to the OFED driver subsystem to post-load tunables into dynamically created sysctls, we generalize this in the kernel. Other changes: - Corrected a possibly incorrect sysctl name from "hw.cbb.intr_mask" to "hw.pcic.intr_mask". - Removed redundant TUNABLE statements throughout the kernel. - Some minor code rewrites in connection to removing not needed TUNABLE statements. - Added a missing SYSCTL_DECL(). - Wrapped two very long lines. - Avoid malloc()/free() inside sysctl string handling, in case it is called to initialize a sysctl from a tunable, hence malloc()/free() is not ready when sysctls from the sysctl dataset are registered. - Bumped FreeBSD version to indicate SYSCTL API change. MFC after: 2 weeks Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=267961
* Don't destroy bus_dma maps created by bus_dmamem_alloc(). In some cases,John Baldwin2014-06-102-28/+6
| | | | | | | | | | | | don't create a map before calling bus_dmamem_alloc() (such maps were leaked). It is believed that the extra destroy of the map was generally harmless since bus_dmamem_alloc() often uses special maps for which bus_dmamap_destroy() is a no-op (e.g. on x86). Reviewed by: scottl Notes: svn path=/head/; revision=267340
* Rename definition of IEEE80211_FC1_WEP to IEEE80211_FC1_PROTECTED.Kevin Lo2014-01-081-4/+5
| | | | | | | | | | | | | | The origin of WEP comes from IEEE Std 802.11-1997 where it defines whether the frame body of MAC frame has been encrypted using WEP algorithm or not. IEEE Std. 802.11-2007 changes WEP to Protected Frame, indicates whether the frame is protected by a cryptographic encapsulation algorithm. Reviewed by: adrian, rpaulo Notes: svn path=/head/; revision=260444
* In sys/dev/mwl/if_mwl.c, put the static RD4() function under #ifdefDimitry Andric2013-12-251-0/+2
| | | | | | | | | MWL_DEBUG guards, since it only used in DPRINTF statements. MFC after: 3 days Notes: svn path=/head/; revision=259869
* The r48589 promised to remove implicit inclusion of if_var.h soon. PrepareGleb Smirnoff2013-10-262-0/+4
| | | | | | | | | | | to this event, adding if_var.h to files that do need it. Also, include all includes that now are included due to implicit pollution via if_var.h Sponsored by: Netflix Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=257176
* Give (*ext_free) an int return value allowing for very sophisticatedAndre Oppermann2013-08-251-1/+2
| | | | | | | | | | | external mbuf buffer management capabilities in the future. For now only EXT_FREE_OK is defined with current legacy behavior. Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=254842
* Add an mbuf pointer parameter to (*ext_free) to give the externalAndre Oppermann2013-08-241-1/+1
| | | | | | | | | | | | | | | free function access to the mbuf the external memory was attached to. Mechanically adjust all users to include the mbuf parameter. This fixes a long standing annoyance for external free functions. Before one had to sacrifice one of the argument pointers for this. Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=254799
* Update PCI drivers to no longer look at the MEMIO-enabled bit in the PCIScott Long2013-08-121-30/+3
| | | | | | | | | | | | | | | | | | | | command register. The lazy BAR allocation code in FreeBSD sometimes disables this bit when it detects a range conflict, and will re-enable it on demand when a driver allocates the BAR. Thus, the bit is no longer a reliable indication of capability, and should not be checked. This results in the elimination of a lot of code from drivers, and also gives the opportunity to simplify a lot of drivers to use a helper API to set the busmaster enable bit. This changes fixes some recent reports of disk controllers and their associated drives/enclosures disappearing during boot. Submitted by: jhb Reviewed by: jfv, marius, achadd, achim MFC after: 1 day Notes: svn path=/head/; revision=254263
* Mechanically substitute flags from historic mbuf allocator withGleb Smirnoff2012-12-041-3/+3
| | | | | | | malloc(9) flags in sys/dev. Notes: svn path=/head/; revision=243857
* Fix the RX free list locking creation and destruction to be consistentAdrian Chadd2012-04-171-2/+8
| | | | | | | | | | | | even in the face of errors. If the RX descriptor list fails, the RX lock won't be initialised, but then the DMA free path wil try freeing it. This commit is brought to you by a working mwl(4). Notes: svn path=/head/; revision=234368
* Add missing #includeAdrian Chadd2012-04-171-0/+1
| | | | Notes: svn path=/head/; revision=234367
* Migrate the net80211 TX aggregation state to be from per-AC to per-TID.Adrian Chadd2012-04-152-10/+10
| | | | | | | | | | | TODO: * Test mwl(4) more thoroughly! Reviewed by: bschmidt (for iwn) Notes: svn path=/head/; revision=234324
* Fix some net80211 enum nits:Bernhard Schmidt2011-12-171-7/+7
| | | | | | | | | | | | | - ic_vap_create() uses an ieee80211_opmode argument - ieee80211_rate2media() takes an ieee80211_phymode argument - ieee80211_plcp2rate() takes an ieee80211_phytype argument - cast to enum ieee80211_protmode and ieee80211_roamingmode to silence compiler warnings Submitted by: arundel@ Notes: svn path=/head/; revision=228621
* Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.Ed Schouten2011-11-071-1/+2
| | | | | | | | | The SYSCTL_NODE macro defines a list that stores all child-elements of that node. If there's no SYSCTL_DECL macro anywhere else, there's no reason why it shouldn't be static. Notes: svn path=/head/; revision=227309
* Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs.Ed Schouten2011-11-071-1/+1
| | | | | | | This means that their use is restricted to a single C file. Notes: svn path=/head/; revision=227293
* Revert r220907 and r220915.Adrian Chadd2011-04-221-6/+6
| | | | | | | | Changing the size of struct ieee80211_mimo_info changes the STA info data, breaking ifconfig in general. Notes: svn path=/head/; revision=220935
* Convert to new ieee80211_mimo_info format.Adrian Chadd2011-04-211-6/+6
| | | | Notes: svn path=/head/; revision=220915
* Fix typos - remove duplicate "the".Rebecca Cran2011-02-211-1/+1
| | | | | | | | | PR: bin/154928 Submitted by: Eitan Adler <lists at eitanadler.com> MFC after: 3 days Notes: svn path=/head/; revision=218909
* The mwl's HAL manages an array of MWL_MBSS_MAX VAPs where the first 8 areBernhard Schmidt2010-12-311-1/+1
| | | | | | | | | | | | | | supposed to be APs and the later 24 are pre-configured as STAs. A wrong condition during initialization is responsible for not configuring the last 8 array members. This is results in being able to create more than 8, possible uninitialized, AP-VAPs. PR: kern/153549 Submitted by: Erik Fonnesbeck <efonnes at gmail.com> MFC after: 2 weeks Notes: svn path=/head/; revision=216835