aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/bwn
Commit message (Collapse)AuthorAgeFilesLines
* bwn(4): Include SROM revision when printing device identification.Landon J. Fuller2019-07-021-2/+3
| | | | Notes: svn path=/head/; revision=349593
* Fix ieee80211_radiotap(9) usage in wireless drivers:Andriy Voskoboinyk2019-03-112-10/+2
| | | | | | | | | | | | | | | | | | | | | | | - Alignment issues: * Add missing __packed attributes + padding across all drivers; in most places there was an assumption that padding will be always minimally 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 can contain 64-bit TSF timestamp; it cannot appear in Tx radiotap headers, so just drop the attribute here. Refresh ieee80211_radiotap(9) man page accordingly. - Since net80211 automatically updates channel frequency / flags in ieee80211_radiotap_chan_change() drop duplicate setup for these fields in drivers. Tested with Netgear WG111 v3 (urtw(4)), STA mode. MFC after: 2 weeks Notes: svn path=/head/; revision=344990
* bwn(4): reuse ieee80211_tx_complete function.Andriy Voskoboinyk2019-01-311-7/+2
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=343604
* Fix a possible mbuf double free in bwn_dma_tx_start().Mark Johnston2018-12-121-11/+17
| | | | | | | | | | | | | | | | | | If bus_dmamap_load_mbuf() fails following a defrag, the caller of bwn_dma_tx_start() would free the original mbuf after m_defrag() had already done so. Fix this by returning the defragged mbuf to the caller instead. Update bwn_pio_tx_start() similarly for consistency. Reported by: Ilja Van Sprundel <ivansprundel@ioactive.com> Reviewed by: landonf Tested by: landonf MFC after: 3 days admbug: 820 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18342 Notes: svn path=/head/; revision=341990
* Reapply, with minor tweaks, r338025, from the original commit:Warner Losh2018-09-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove unused and easy to misuse PNP macro parameter Inspired by r338025, just remove the element size parameter to the MODULE_PNP_INFO macro entirely. The 'table' parameter is now required to have correct pointer (or array) type. Since all invocations of the macro already had this property and the emitted PNP data continues to include the element 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 to tolerate the -B flag, which BSD diff does not. So I had to link gdiff into PATH as diff to use spatch.) Tinderbox'd (-DMAKE_JUST_KERNELS). Approved by: re (glen) Notes: svn path=/head/; revision=338948
* Back out r338035 until Warner is finished churning GSoC PNP patchesConrad Meyer2018-08-191-2/+2
| | | | | | | | | | I was not aware Warner was making or planning to make forward progress in this area and have since been informed of that. It's easy to apply/reapply when churn dies down. Notes: svn path=/head/; revision=338037
* Remove unused and easy to misuse PNP macro parameterConrad Meyer2018-08-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Inspired by r338025, just remove the element size parameter to the MODULE_PNP_INFO macro entirely. The 'table' parameter is now required to have correct pointer (or array) type. Since all invocations of the macro already had this property and the emitted PNP data continues to include the element 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 to tolerate the -B flag, which BSD diff does not. So I had to link gdiff into PATH as diff to use spatch.) Tinderbox'd (-DMAKE_JUST_KERNELS). Notes: svn path=/head/; revision=338035
* Add PNP info to PCI attachment of bwn driverWarner Losh2018-06-131-0/+4
| | | | | | | | | Reviewed by: imp, chuck Submitted by: Lakhan Shiva Kamireddy <lakhanshiva@gmail.com> Sponsored by: Google, Inc. (GSoC 2018) Notes: svn path=/head/; revision=335081
* net80211: wrap protection frame allocation into ieee80211_alloc_prot()Andriy Voskoboinyk2018-03-091-52/+26
| | | | | | | | | | | | Move copy-pasted code for RTS/CTS frame allocation into net80211. While here, add stat / debug message for allocation failures (copied from run(4)) + return error here in bwn(4). Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D14628 Notes: svn path=/head/; revision=330688
* bwn(4): Conditionalize "RX decryption attempted" message on a newLandon J. Fuller2018-02-132-3/+4
| | | | | | | | | | | BWN_DEBUG_HWCRYPTO debug flag. The MAC will attempt decryption (and set BWN_RX_MAC_DEC) even if a key has not been supplied to the hardware; this is expected behavior, and there's no need to spam users' console with this debugging printf. Notes: svn path=/head/; revision=329241
* bwn(4): Fix outstanding bug in PHY-G tssi2dbm table generation caught byLandon J. Fuller2018-02-121-1/+1
| | | | | | | | -Wconstant-conversion, and remove now unnecessary warning suppression flags. Notes: svn path=/head/; revision=329184
* bwn(4): migrate bwn(4) to the native bhnd(9) interface, and drop siba_bwn.Landon J. Fuller2018-02-0517-4340/+1214
| | | | | | | | | | | | | - Remove the shim interface that allowed bwn(4) to use either siba_bwn or bhnd(4), replacing all siba_bwn calls with their bhnd(4) bus equivalents. - Drop the legay, now-unused siba_bwn bus driver. - Clean up bhnd(4) board flag defines referenced by bwn(4). Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D13518 Notes: svn path=/head/; revision=328912
* Revert r327828, r327949, r327953, r328016-r328026, r328041:Pedro F. Giffuni2018-01-212-3/+3
| | | | | | | | | | | | | | | | | | Uses of mallocarray(9). The use of mallocarray(9) has rocketed the required swap to build FreeBSD. This is likely caused by the allocation size attributes which put extra pressure on the compiler. Given that most of these checks are superfluous we have to choose better where to use mallocarray(9). We still have more uses of mallocarray(9) but hopefully this is enough to bring swap usage to a reasonable level. Reported by: wosch PR: 225197 Notes: svn path=/head/; revision=328218
* bhnd/bwn(4): Define a bhnd(4) softmodem device class for the v.90 modemLandon J. Fuller2018-01-192-4/+17
| | | | | | | | | codec core, and mark the core as unpopulated on all BCM4306 bwn(4) devices. Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=328183
* bwn(4): Add missing BCM4306 PCI IDs.Landon J. Fuller2018-01-191-0/+3
| | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=328182
* bwn(4): Fix DMA translation lookup on devices limited to 30-bit hostLandon J. Fuller2018-01-191-8/+29
| | | | | | | | | | | addressing. The host addressing constraint does not apply to device address space, and shouldn't be passed to bhnd_get_dma_translation() as the maximum supported device address width. Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=328181
* bwn(4): Enable, by default, the opt-in support for bhnd(4) introduced inLandon J. Fuller2018-01-172-2/+3
| | | | | | | | | | | | | | | | | | | | | | r326454. bwn(4)/bhnd(4) has been tested with most chipsets currently supported by bwn(4), and this change should be transparent to existing bwn(4) users; please report any regressions that you do encounter. To revert to using siba_bwn(4) instead of bhnd(4), place the following lines in loader.conf(5): hw.bwn_pci.preferred="0" Once we're satisfied that the switch to bhnd(4) has seen sufficient broader testing, bwn(4) will be migrated to use the native bhnd(9) interface directly, and support for siba_bwn(4) will be dropped (see D13518). Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=328098
* dev: make some use of mallocarray(9).Pedro F. Giffuni2018-01-132-3/+3
| | | | | | | | | | | | | | Focus on code where we are doing multiplications within malloc(9). None of these is likely to overflow, however the change is still useful as some static checkers can benefit from the allocation attributes we use for mallocarray. This initial sweep only covers malloc(9) calls with M_NOWAIT. No good reason but I started doing the changes before r327796 and at that time it was convenient to make sure the sorrounding code could handle NULL values. Notes: svn path=/head/; revision=327949
* [net80211] convert all of the WME use over to a temporary copy of WME info.Adrian Chadd2018-01-021-1/+4
| | | | | | | | | | | | | | | | | | | | 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
* bhnd(4)/bwn(4): Fix a number of small issues reported by Coverity.Landon J. Fuller2017-12-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Fix reference of uninitialized error value in bhndb_generic_resume() if the dynamic window count is 0. - Fix incorrect bhnd_pmu(4) UPTME_MASK and PLL0_PC2_WILD_INT_MASK constants. - Variable definitions referenced by our generated SPROM layouts will never be NULL, but add explicit asserts to make that clear. - Add missing variable initialization in bhnd_nvram_sprom_ident(). - Fix leak of driver array in bhnd_erom_probe_driver_classes(). - Fix zero-length memset() in bhndb_pci_eio_init(). - Fix an off-by-one error and potential invalid OOBSEL bit shift operation in bcma_dinfo_init_intrs(). - Remove dead code in siba_suspend_hw(). - Fix duplicate call to bhnd_pmu_enable_regulator() in both the enable and disable code paths of bhnd_compat_cc_pmu_set_ldoparef(). Reported by: Coverity CIDs: 1355194, 1362020, 1362022, 1373114, 1366563, 1373115, 1381569, 1381579, 1383555, 1383566, 1383571 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=326871
* Add basic bwn(4) support for the (BCMA-based) BCM43224 and BCM43225.Landon J. Fuller2017-12-144-5/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Add the BCM4322X D11 core revision and missing BCM43224 PCI device ID to our device tables. - Disable the DMA engine parity check (rather than adding parity support to the to-be-replaced bwn(4) DMA implementation). Currently, N-PHY support in bwn(4) is GPL licensed, and is not included by default. Until this is replaced with Broadcom's ISC-licensed N-PHY implementation, bwn(4) must be rebuilt to enable N-PHY support. To build bwn(4) with N-PHY support, add the following lines to your kernel configuration file and rebuild the kernel (and modules): options BWN_GPL_PHY To test bwn(4) with a BCM43224/BCM43225 device, install the firmware from the net/bwn-firmware-kmod port, and place the following lines in loader.conf(5): hw.bwn_pci.preferred="1" if_bwn_pci_load="YES bwn_v4_ucode_load="YES" bwn_v4_n_ucode_load="YES" bwn_v4_lp_ucode_load="YES" Approved by: adrian (mentor, implicit) Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=326841
* Introduce bwn(4) support for the bhnd(4) bus.Landon J. Fuller2017-12-0215-326/+3568
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, bwn(4) relies on the siba_bwn(4) bus driver to provide support for the on-chip SSB interconnect found in Broadcom's older PCI(e) Wi-Fi adapters. Non-PCI Wi-Fi adapters, as well as the newer BCMA interconnect found in post-2009 Broadcom Wi-Fi hardware, are not supported by siba_bwn(4). The bhnd(4) bus driver (also used by the FreeBSD/MIPS Broadcom port) provides a unified kernel interface to a superset of the hardware supported by siba_bwn; by attaching bwn(4) via bhnd(4), we can support both modern PCI(e) Wi-Fi devices based on the BCMA backplane interconnect, as well as Broadcom MIPS WiSoCs that include a D11 MAC core directly attached to their SSB or BCMA backplane. This diff introduces opt-in bwn(4) support for bhnd(4) by providing: - A small bwn(4) driver subclass, if_bwn_bhnd, that attaches via bhnd(4) instead of siba_bwn(4). - A bhndb(4)-based PCI host bridge driver, if_bwn_pci, that optionally probes at a higher priority than the siba_bwn(4) PCI driver. - A set of compatibility shims that perform translation of bwn(4)'s siba_bwn function calls into their bhnd(9) API equivalents when bwn(4) is attached via a bhnd(4) bus parent. When bwn(4) is attached via siba_bwn(4), all siba_bwn function calls are simply passed through to their original implementations. To test bwn(4) with bhnd(4), place the following lines in loader.conf(5): hw.bwn_pci.preferred="1" if_bwn_pci_load="YES bwn_v4_ucode_load="YES" bwn_v4_lp_ucode_load="YES" To verify that bwn(4) is using bhnd(4), you can check dmesg: bwn0: <Broadcom 802.11 MAC/PHY/Radio, rev 15> ... on bhnd0 ... or devinfo(8): pcib2 pci2 bwn_pci0 bhndb0 bhnd0 bwn0 ... bwn(4)/bhnd(4) has been tested for regressions with most chipsets currently supported by bwn(4), including: - BCM4312 - BCM4318 - BCM4321 With minimal changes to the DMA code (not included in this commit), I was also able to test support for newer BCMA devices by bringing up basic working Wi-Fi on two previously unsupported, BCMA-based N-PHY chipsets: - BCM43224 - BCM43225 Approved by: adrian (mentor, implicit) Sponsored by: The FreeBSD Foundation & Plausible Labs Differential Revision: https://reviews.freebsd.org/D13041 Notes: svn path=/head/; revision=326454
* sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-273-0/+6
| | | | | | | | | | | | | | | 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
* bwn(4): Fix trivial null dereferenceConrad Meyer2017-04-061-2/+7
| | | | | | | | Reported by: PVS-Studio Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=316582
* net80211 drivers: fix rate setup for EAPOL frames, obtain Tx parametersAndriy Voskoboinyk2017-02-261-2/+1
| | | | | | | | | | | | | | | | | | | | | | directly 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 cleanups Tested with: - Intel 6205 (iwn(4)), STA mode; - WUSB54GC (rum(4)), HOSTAP mode + RTL8188EU (rtwn(4)), STA mode. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D9811 Notes: svn path=/head/; revision=314315
* bhnd(4): Unify NVRAM/SPROM parsing, implement compact SPROM layout encoding.Landon J. Fuller2016-11-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Defined an abstract NVRAM I/O API (bhnd_nvram_io), decoupling NVRAM/SPROM parsing from the actual underlying NVRAM data provider (e.g. CFE firmware devices). - Defined an abstract NVRAM data API (bhnd_nvram_data), decoupling higher-level NVRAM operations (indexed lookup, data conversion, etc) from the underlying NVRAM file format parsing/serialization. - Implemented a new high-level bhnd_nvram_store API, providing indexed variable lookup, pending write tracking, etc on top of an arbitrary bhnd_nvram_data instance. - Migrated all bhnd(4) NVRAM device drivers to the common bhnd_nvram_store API. - Implemented a common bhnd_nvram_val API for parsing/encoding NVRAM variable values, including applying format-specific behavior when converting to/from the NVRAM string representations. - Dropped the now unnecessary bhnd_nvram driver, and moved the broadcom/mips-specific CFE NVRAM driver out into sys/mips/broadcom. - Implemented a new nvram_map file format: - Variable definitions are now defined separately from the SPROM layout. This will also allow us to define CIS tuple NVRAM mappings referencing the common NVRAM variable definitions. - Variables can now be defined within arbitrary named groups. - Textual descriptions and help information can be defined inline for both variables and variable groups. - Implemented a new, compact encoding of SPROM image layout offsets. - Source-level (but not build system) support for building the NVRAM file format APIs (bhnd_nvram_io, bhnd_nvram_data, bhnd_nvram_store) as a userspace library. The new compact SPROM image layout encoding is loosely modeled on Apple dyld compressed LINKEDIT symbol binding opcodes; it provides a compact state-machine encoding of the mapping between NVRAM variables and the SPROM image offset, mask, and shift instructions necessary to decode or encode the SPROM variable data. The compact encoding reduces the size of the generated SPROM layout data from roughly 60KB to 3KB. The sequential nature SPROM layout opcode tables also simplify iteration of the SPROM variables, as it's no longer neccessary to iterate the full NVRAM variable definition table, but instead simply scan the SPROM revision's layout opcode table. Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D8645 Notes: svn path=/head/; revision=309202
* net80211: ieee80211_ratectl*: switch to reusable KPIAndriy Voskoboinyk2016-10-021-39/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace 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' registers to obtain statistics for some period of time (and those 'last period' values are used as arguments for tx_update()). If arguments are not big enough, 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: adrian Differential Revision: https://reviews.freebsd.org/D8037 Notes: svn path=/head/; revision=306591
* bhnd(4): Implement backplane interrupt handling.Landon J. Fuller2016-09-051-20/+40
| | | | | | | | | | | | | | | | | | | | This adds bhnd(4) bus-level support for querying backplane interrupt vector routing, and delegating machine/bridge-specific interrupt handling to the concrete bhnd(4) driver implementation. On bhndb(4) bridged PCI devices, we provide the PCI/MSI interrupt directly to attached cores. On MIPS devices, we report a backplane interrupt count of 0, effectively disabling the bus-level interrupt assignment. This allows mips/broadcom to temporarily continue using hard-coded MIPS IRQs until bhnd_mips PIC support is implemented. Reviewed by: mizhka Approved by: adrian (mentor, implicit) Notes: svn path=/head/; revision=305444
* bwn(4): ignore BCM4321's unpopulated USB11 host controller core.Landon J. Fuller2016-09-052-3/+15
| | | | | | | | | | Broadcom Intensi-fi chipsets provided a common set of IP cores; on PCI/PCIe devices, the USB11 host controller is left floating. Approved by: adrian (mentor, implicit) Notes: svn path=/head/; revision=305443
* Migrate bhndb(4) to the new bhnd_erom API.Landon J. Fuller2016-09-042-3/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds support for probing and initializing bhndb(4) bridge state using the bhnd_erom API, ensuring that full bridge configuration is available *prior* to actually attaching and enumerating the bhnd(4) child device, allowing us to safely allocate bus-level agent/device resources during bhnd(4) bus enumeration. - Add a bhnd_erom_probe() method usable by bhndb(4). This is an analogue to the existing bhnd_erom_probe_static() method, and allows the bhndb bridge to discover the best available erom parser class prior to newbus probing of its children. - Add support for supplying identification hints when probing erom devices. This is required on early EXTIF-only chipsets, where chip identification registers are not available. - Migrate bhndb over to the new bhnd_erom API, using bhnd_core_info records rather than bridged bhnd(4) device_t references to determine the bridged chipsets' capability/bridge configuration. - The bhndb parent (e.g. if_bwn) is now required to supply a hardware priority table to the bridge. The default table is currently sufficient for our supported devices. - Drop the two-pass attach approach we used for compatibility with bhndb(4) in the bhnd(4) bus drivers, and instead perform bus enumeration immediately, and allocate bridged per-child bus-level resources during that enumeration. Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D7768 Notes: svn path=/head/; revision=305371
* bhnd(4): Implement NVRAM support required for PMU bring-up.Landon J. Fuller2016-08-161-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | - Added a generic bhnd_nvram_parser API, with support for the TLV format used on WGT634U devices, the standard BCM NVRAM format used on most modern devices, and the "board text file" format used on some hardware to supply external NVRAM data at runtime (e.g. via an EFI variable). - Extended the bhnd_bus_if and bhnd_nvram_if interfaces to support both string-based and primitive data type variable access, required for common behavior across both SPROM and NVRAM data sources. - Extended the existing SPROM implementation to support the new string-based NVRAM APIs. - Added an abstract bhnd_nvram driver, implementing the bhnd_nvram_if atop the bhnd_nvram_parser API. - Added a CFE-based bhnd_nvram driver to provide read-only access to NVRAM data on MIPS SoCs, pending implementation of a flash-aware bhnd_nvram driver. Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D7489 Notes: svn path=/head/; revision=304243
* [bwn] don't use a 1MB CCK RTS frame for 11a OFDM transmissions.Adrian Chadd2016-06-061-4/+5
| | | | Notes: svn path=/head/; revision=301485
* [bwn] Add missing firmware release calls.Adrian Chadd2016-06-051-0/+3
| | | | | | | | | | This trips me up whenever I'm fooling around with partially supported NICs that fail to fully attach or initialise - the firmware gets loaded and references, but something fails - and the firmware references aren't cleaned up. Notes: svn path=/head/; revision=301435
* [bwn] Enable PHY-LP 5GHz support for the one NIC I have tested it on so far.Adrian Chadd2016-06-051-11/+15
| | | | | | | | | | | | | | | | | | After perusing the PHY-LP code (don't ask why; honest) I discovered that it /has/ 5GHz support - but it's not ever used. I found one NIC - a BCM4312 w/ pci id 0x4315 - which advertised dual-band PHY-LP support. Turns out it works. Whilst here, move up the support bit logging code so I can use it to debug this. Tested: * BCM4312 (pci id 0x4315); 5GHz STA operation Notes: svn path=/head/; revision=301434
* [bwn] complain usefully if a PHY-N PHY is detected with no support is ↵Adrian Chadd2016-06-051-0/+3
| | | | | | | | | | compiled in. Log something other than "error 6" if the attach fails because the GPL PHY-N code isn't included. Notes: svn path=/head/; revision=301433
* [bwn] begin separating out the attach path from the SIBA specific bits.Adrian Chadd2016-05-241-24/+19
| | | | | | | | | | | | | | | | * convert phy_getinfo() to take a "gmode" flag, rather than the siba TGSHIGH flags and then check for 2GHz. This should ensure that gmode is set correctly even on DUALPHY NICs. * move the siba_powerup() call and the TGSHIGH decoding into a call to bwn_is_bus_siba(), and return an error if it's called on anything else. We don't yet do anything else, but when we do.. Tested: * BCM4322, 11a STA Notes: svn path=/head/; revision=300563
* [bwn] add BCM43225 to the BHND device list.Adrian Chadd2016-05-241-0/+1
| | | | | | | | | | | This is all for the bhnd(4) work in progress. It's enough to probe/attach all the bhnd internals, but we're missing OTP support and some cleanup code. And, well, all the rest of the bhnd(4) migration. So no, this won't give you BCM43225 support. Sorry! Notes: svn path=/head/; revision=300562
* [bwn] add extra debugging for non-SIBA devices.Adrian Chadd2016-05-242-3/+18
| | | | | | | | | | | | This is a no-op at the present moment, but will eventually remind me where the SIBA specific demons lie. Tested: * BCM4322, STA mode Notes: svn path=/head/; revision=300549
* wi: fix a typo.Andriy Voskoboinyk2016-05-201-1/+1
| | | | | | | | | | | The max size of bitmask is IEEE80211_MODE_BYTES, not IEEE80211_MODE_MAX. Reuse it in bwn(4) while I'm here. Noticed by: kevlo Notes: svn path=/head/; revision=300292
* [bwn] quieten the "invalid firmware state".Adrian Chadd2016-05-191-2/+5
| | | | | | | | | That pops up in the rev 5xx / 6xx microcode on the later cores (4312, 4322.) I'm not sure why this is happening yet and I'll dig into it, but Linux b43 does the same thing. Notes: svn path=/head/; revision=300195
* [bwn] program in the MAC capabilities somewhere where later microcodeAdrian Chadd2016-05-192-0/+16
| | | | | | | | | expects it. Obtained from: Linux b43 Notes: svn path=/head/; revision=300194
* [bwn] add extra debugging.Adrian Chadd2016-05-191-0/+15
| | | | Notes: svn path=/head/; revision=300189
* [bwn] toggle the PHY clock during chip reset.Adrian Chadd2016-05-191-4/+6
| | | | | | | | | | | | Tested: * BCM4311, STA mode * BCM4312, STA mode * BCM4321, STA mode * BCM4322, STA mde Notes: svn path=/head/; revision=300188
* [bwn] enable dual-phy on BCM4322MC.Adrian Chadd2016-05-191-1/+2
| | | | | | | | | Tested (with later commits): * BCM4322MC, STA mode, 2G + 5G Notes: svn path=/head/; revision=300187
* [bwn] rename TGS low registers to be consistent with naming scheme.Adrian Chadd2016-05-192-4/+4
| | | | Notes: svn path=/head/; revision=300186
* [bwn] add initial 5xx firmware API supportAdrian Chadd2016-05-182-39/+189
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add the new TX/RX frame formats; * Use the right TX/RX format based on the frame info; * Disable the 5xx firmware check, since now it should somewhat work (but note, we don't yet use it unless you manually add ucode11/initvals11 from the 5.x driver to bwn-kmod-firmware; * Misc: update some comments/debugging now I know what's actually going on. Tested: * BCM4321MC, STA mode, both 4xx and 666 firmware, DMA mode TODO: * The newer firmware ends up logging "warn: firmware state (0)"; not sure yet what's going on there. But, yes, it still works. I'm committing this via a BCM4321MC, 11a station, firmware rev 666. Obtained from: Linux b43 (TX/RX descriptor format for 5xx) Notes: svn path=/head/; revision=300114
* [bwn] correctly calculate RSSI level.Adrian Chadd2016-05-171-0/+12
| | | | | | | | | | | Tested: * BCM4311, PHY-G, STA mode * BCM4312, PHY-LP, STA mode * BCM4321, PHY-N, STA moe Notes: svn path=/head/; revision=300079
* [bwn] print out a very obvious notice that GPLv2 code is compiled in if it is.Adrian Chadd2016-05-171-0/+5
| | | | Notes: svn path=/head/; revision=300076
* [bwn] always allocate maximum size txhdr entries; prepare for fw 598Adrian Chadd2016-05-173-7/+23
| | | | | | | | | | | | | | | | | * always allocate maximum size txhdr entries * set the right rx header offset/framesize based on firmware This still isn't what's completely required for fw 598 support; there's more to come. Tested: * Apple BCM94321MC 11abgn NIC, 11a STA mode, firmware version 4xx. Obtained from: DragonflyBSD (txhdr entry sizing), fw 598 RX header size (linux b43) Notes: svn path=/head/; revision=300075
* [bwn] Add PHY-N call hooks.Adrian Chadd2016-05-171-0/+25
| | | | Notes: svn path=/head/; revision=300019