summaryrefslogtreecommitdiff
path: root/sys/dev/pci/if_iwm.c
AgeCommit message (Collapse)Author
2016-01-25Keep track of HT protection settings in beacons and have 11n-capableStefan Sperling
drivers update hardware configuration accordingly. tested by myself, tb@, deraadt@, abieber@ ok mpi@
2016-01-07Fix A-MPDU parameters in link quality firmware commands in iwn(4) and iwm(4).Stefan Sperling
ok deraadt@
2016-01-06Initialize the A-MPDU parameters field in HT capability elements.Stefan Sperling
ok kettenis@
2016-01-06iwm(4) adjusts the firmware's tx rate retry table dynamically so we mustStefan Sperling
tell the firmware to always try the first rate in the table first. ok kettenis@
2016-01-05Remove the IEEE80211_NO_HT macro. Reduces ifdef spaghetti, enables 11n modeStefan Sperling
in bsd.rd, and might uncover some bugs. Suggested by tedu@ and deraadt@. ok sthen@ jasper@ deraadt@
2015-12-14Add initial 802.11n support to the iwm(4) driver.Stefan Sperling
Adds support for HT MCS 0-7 (theoretical limit 65 Mbit/s) and the reception of A-MSDU and A-MPDU aggregated frames. None of the optional 11n features are supported for now. MIMO, 40Mhz channels, short guard interval, etc. are left for future work. And we're not sending A-MSDU or A-MPDU frames yet either. Tested with various 11a/b/g/n access points. With some APs I'm seeing a noticable increase in throughput, especially on 5Ghz. Also, fix automatic rate selection by using the current Tx rate selected by AMRR as the upper bound for the firmware's rate table and updating the firmware's table whenever AMRR switches Tx rate, rather than setting the table just once after association and ignoring AMRR updates. ok mpi@ krw@ (earlier version), ok jasper@
2015-12-11Replace mountroothook_establish(9) by config_mountroot(9) a narrower APIMartin Pieuchot
similar to config_defer(9). ok mikeb@, deraadt@
2015-12-08When iwm(4) moves to AUTH state it asks the firmware for a "time event" toStefan Sperling
prevent it from moving off-channel during association. The firmware issues interrupts at beginning and end of the time event. The driver tried detecting the beginning with a tsleep() in the newstate task followed by a wakeup() from the interrupt handler. However, sometimes the newstate task did not get scheduled until the time event had already passed, and association was aborted. In rare cases the newstate task would even sleep forever and the iwm(4) interface would stop working until reboot. Fix these issues by issuing the time event and continuing association without checking for a "go" from the firmware. Our kernel does not provide the scheduling guarantees required for such precise synchronization so association is more likely to fail with the additional check than without. ok mpi@ tedu@
2015-11-25replace IFF_OACTIVE manipulation with mpsafe operations.David Gwynne
there are two things shared between the network stack and drivers in the send path: the send queue and the IFF_OACTIVE flag. the send queue is now protected by a mutex. this diff makes the oactive functionality mpsafe too. IFF_OACTIVE is part of if_flags. there are two problems with that. firstly, if_flags is a short and we dont have any MI atomic operations to manipulate a short. secondly, while we could make the IFF_OACTIVE operates mpsafe, all changes to other flags would have to be made safe at the same time, otherwise a read-modify-write cycle on their updates could clobber the oactive change. instead, this moves the oactive mark into struct ifqueue and provides an API for changing it. there's ifq_set_oactive, ifq_clr_oactive, and ifq_is_oactive. these are modelled on ifsq_set_oactive, ifsq_clr_oactive, and ifsq_is_oactive in dragonflybsd. this diff includes changes to all the drivers manipulating IFF_OACTIVE to now use the ifsq_{set,clr_is}_oactive API too. ok kettenis@ mpi@ jmatthew@ deraadt@
2015-11-24You only need <net/if_dl.h> if you're using LLADDR() or a sockaddr_dl.Martin Pieuchot
2015-11-24You need <netinet/ip.h> if you use "struct ip" for hw checksum.Martin Pieuchot
You never need <netinet/ip_var.h> nor <netinet/in_systm.h>.
2015-11-24No need to include <net/if_arp.h>Martin Pieuchot
This header is only needed because <netinet/if_ether.h> declares a structure that needs it. But it turns out that <net/if.h> already includes it as workaround. A proper solution would be to stop declarting "struct ether_arp" there. But no driver should need this header.
2015-11-24The only network driver needing <net/if_types.h> is upl(4) for IFT_OTHER.Martin Pieuchot
2015-11-04replace the ifqueues in net80211 with mbuf_queues.David Gwynne
the specific queues are ic_mgtq, ic_pwrsaveq, and ni_savedq. rtw had its own queue for beacons. tested by mpi@ and jmc@ ok mpi@
2015-10-25arp_ifinit() is no longer needed.Martin Pieuchot
2015-10-22remove some horrible iwm typedefsJonathan Gray
ok stsp@
2015-10-16Put some iwm(4) debug code into #ifdef IWM_DEBUG.Stefan Sperling
ok mpi@
2015-10-16Clean up iwm(4) scanning logic a bit: Reset sc_scanband in callers ofStefan Sperling
iwm_mvm_scan_request() and always call ieee80211_end_scan() when done. ok mpi@
2015-10-16Oops, committed old version of previous diff with a typo in it: NLL -> NULLStefan Sperling
2015-10-16In iwm(4), correctly size and map the mbuf used for large firmware commands.Stefan Sperling
Fixes occasional firmware errors while bringing the interface up or scanning. ok phessler@
2015-10-12Always initialise the index into iwm's tx queue array, fixing aStefan Sperling
potential crash. This must have somehow been working by magic. Fruther cleanup of QoS support in this driver is very much needed. ok mpi@
2015-10-11Add a symbolic name for the special '-1' value of iwm's sc_wantresp.Stefan Sperling
ok phessler
2015-10-10In iwm(4), set mbuf pointers to NULL after freeing mbufs.Stefan Sperling
ok phessler mpi zhuk
2015-10-06Make iwm(4) set the MAC address the same way other wireless drivers do.Stefan Sperling
ok mpi@
2015-10-05Simplify iwm(4) newstate task by only queuing one state transitionStefan Sperling
at a time. The newstate task now always transitions to the most recently requested state, rather than hopping along with every request. This allows us get rid of the silly newstate generation counter, and we can now task_del() a pending transition when the interface goes down. While several issues with this driver remain, I believe this change does not introduce new problems. Tested by myself, jasper@, and zhuk@
2015-09-27Fix bsd.rd upgrades over iwm(4), and fix `ifconfig iwm0 lladdr random`.Stefan Sperling
The bsd.rd problems happened because of the net80211 detach/attach hack which ran when the firmware is loaded for the first time. Do the minimum of what needs to be done instead. To fix lladdr random pick up a changing MAC address in the ioctl handler and don't overwrite a custom MAC address while loading the firmware. ok kettenis@
2015-09-27Align the way iwm(4) adds the MAC context with how it's done in Linux iwlwifi.Stefan Sperling
Noted by Adrian Chadd (FreeBSD). ok kettenis@
2015-09-26Make iwm(4) DPRINTFs show states by name instead of number.Stefan Sperling
2015-09-23In iwm(4), properly reset the RX ring by clearing RX buffer status memory.Stefan Sperling
Found by Matthew Dillon (Dragonfly). DMA sync hint from tedu@, ok mpi@
2015-09-23In iwm(4), while not associated, pass the broadcast ethernet address toStefan Sperling
the firmware, rather than zeros. Matches what Linux iwlwifi does. Spotted by Adrian Chadd (FreeBSD). ok mpi@
2015-07-19Make iwm(4) show command codes of unhandled firmware replies. Should makeStefan Sperling
debugging easier when it happens, as observed by matthieu@ (not reproducible on demand, unfortunately). ok mpi@
2015-06-15Remove comments referring to Linux iwlwifi source filenames from iwm(4).Stefan Sperling
Linux is a moving target so these comments provide little value. Discussed with kettenis and deraadt.
2015-06-15Make the wifi LED work with iwm(4).Stefan Sperling
The bad news: Many laptops sold with iwm(4) cards don't have a wifi LED :-( The good news: Laptops with LEDs and no wifi device white-list in BIOS actually exist! Tested in one such machine. ok kettenis@ deraadt@
2015-06-12Actually trigger iwm_init_task() from iwm_watchdog() as intended to giveStefan Sperling
recovery after device timeout a chance. Don't mess with the IFF_UP flag in the watchdog since this isn't done anywhere except intel wifi drivers which probably copied this pattern amongst each other. ok kettenis@
2015-05-30cleanup attach messageTheo de Raadt
2015-05-22Limit the number of dma segments used for transmitting packets toMark Kettenis
IWM_NUM_OF_TBS - 2. We have IWM_NUM_OF_TBS slots, but use two of those for sending commands to the firmware. Hopefully fixes the iwm0: hardware error, stopping device errors I've seen somewhat regularly. ok claudio@, deraadt@
2015-05-21Use m_defrag(9) instead of rolling our own version of it.Mark Kettenis
ok jca@
2015-03-23Not all iwm hardware supports the 5GHz band. Make setting 11a ratesJonathan Gray
and scanning conditional on the 5GHz support bit in the nvm. Problem reported and fix tested by Mattieu Baptiste. ok stsp@ kettenis@
2015-03-16convert timeout_add() calls using hz to timeout_add_msec()Jonathan Gray
2015-03-11Match on 3160. Untested but should work.Jonathan Gray
ok stsp@ kettenis@
2015-03-06Fix radiotap and fixed rates. Radiotap was reporting the wrong rate forMark Kettenis
data frames and fixed rates weren't really fixed and were converted into the wrong hardware rate. ok jsg@, deraadt@
2015-03-04stop the calibration timeout when stopping the interfaceJonathan Gray
ok kettenis@ deraadt@
2015-03-03Set/clear the IWM_MAC_FILTER_IN_BEACON flag under conditions that match whatMark Kettenis
Linux does. ok jsg@
2015-03-03Fix 11a support.Mark Kettenis
ok stsp@
2015-03-02match on 7265Jonathan Gray
ok kettenis@ stsp@ phessler@
2015-03-02Make setting the MAC context bit for 11g protection when transmittingJonathan Gray
OFDM frames conditional on the node via IEEE80211_F_USEPROT. ok kettenis@
2015-03-02Don't set CTS to self. Linux stopped setting this back inJonathan Gray
dc271ee0d04d12d6bfabacbec803289a7072fbd9 as it is known to cause problems. ok kettenis@
2015-03-02sc_fixed_ridx is initialised to 0 but tested as it it were initialisedJonathan Gray
to -1. The result of this is tx frames were always sent out at fixed rate 0 instead of ni_txrate. Match the iwn behaviour and test ic_fixed_rate for -1 instead. Problem spotted by kettenis@ in an earlier diff. ok kettenis@ stsp@
2015-03-02Correctly set lowest_present_ofdm in iwm_mvm_ack_rates().Jonathan Gray
ok kettenis@
2015-03-02init error to 0 in iwm_send_cmd()Jonathan Gray
ok stsp@ phessler@