summaryrefslogtreecommitdiff
path: root/sys/dev/ic
AgeCommit message (Collapse)Author
2018-02-08Move bwfm(4) from ifq begin/commit/rollback semantics to the newerPatrick Wildt
ifq dequeue semantics. This basically means we need to check for available space before dequeuing a packet. As soon as we dequeue a packet we commit to it. On the PCIe backend this check can not be done easily since the flowring depends on the packet contents and we cannot take a peek. When there is no flowring we cache the mbuf and send it out as soon as the flowring opened up. Then the ifq can be restarted and traffic can flow. Typically we usually run out of packet ids, which can be checked without consulting the packet. The flowring probably never becomes full as the bwfm(4) firmware takes the packets off the ring without actually sending them out. Discussed with dlg@
2018-02-07Sporadically the network over gem(4) interface hang on sparc64 andAlexander Bluhm
macppc. Receiving packets stopped, ifconfig down/up made it work again. In the tick timeout handler refill the receive ring if it is empty. The logic is taken from hme(4). Also protect the register access and ifp counters with splnet(). In gem_rx_watchdog() is a workaround for a hardware bug. It resets the hardware when there is no progress. If the fifo pointers advanced a bit, it got stuck anyway. So restart the receive watchdog timeout in that case. OK mpi@
2018-02-07Move parsing the BCDC header on RX into a protocol specific RXPatrick Wildt
function so it can be shared with the SDIO attachment driver.
2018-02-07Move SDIO bus and protocol definitions from the shared headerPatrick Wildt
into one header specific to the SDIO attachment driver. Also add more register and protocol definitions to it.
2018-02-07Add helper to find out if the chip supports Save/Restore. Will be usedPatrick Wildt
in the SDIO bus glue.
2018-02-06Add support for chips which use SYSMEM memory. Code is a simplifiedPatrick Wildt
version of the SOCRAM one.
2018-02-06Support setting the Cortex-M3 cores to active mode.Patrick Wildt
2018-02-06remove a bit of dead code. ok bluhm deraadtTed Unangst
2018-02-05Move event packet handling into a serialized process context to removePatrick Wildt
a state transitioning race condition. Event packets, like completing authentication and the following association completion, are usually received shortly after another. The code that handles those events is scheduled using a task, so it can easily happen that the state change caused by the authentication packet was not done before the following association event arrived. By moving the event packet handling into the same context as the state task we serialize the processing and remove the race condition. Fixes connecting to the 5GHz WiFi AP used at a2k18. ok stsp@
2018-02-03Remove a pointless assignment introduced in previous commit.Stefan Sperling
CID 1464695; pointed out to me by mikeb@
2018-01-31Some wifi drivers don't call ieee80211_newstate() during some stateStefan Sperling
transitions, which means those state transition won't be shown in dmesg in interface debug mode. Make drivers print these transitions themselves. ok patrick@
2018-01-31Fix 11g ifmedia modes in ath(4) (shown by 'ifconfig ath0 media').Stefan Sperling
There was code which set them up but didn't include 11b channels which are part of 11g. And there was a hack which effectively stripped important flag bits away and wouldn't work for modes with overlapping channels (b/g). As a result, some flags were missing from 11g channels the driver reported to net80211, which skipped over those channels when building the media list. This gets us one step closer to supporting the AR5424. ok mpi@
2018-01-24Put the default case, which prints information about an event we do not yetPatrick Wildt
handle, into a debug printf. Also do not print a pointer to kernel buffers so that we don't leak kernel addresses. Spotted by and ok stsp@
2018-01-24We don't do booleans in the kernel, so replace a few occurrences of 'true'Patrick Wildt
with nicer integer equivalents. Spotted by and ok stsp@
2018-01-19dwiic: cleanup function prototypes after ACPI/PCI splitJoshua Stein
2018-01-11Extract the control channel number from the chanspec information andPatrick Wildt
apply the channel to the node, like iwm(4) does, when supplying the scan response to the net80211 stack. Our stack uses this information for node selection so it's elementary for it to be correct. Tested by jcs@
2018-01-10Attach nvme to additional Apple NVMe device, limit targets to 1Joshua Stein
ok dlg
2018-01-08Initial support for HOSTAP mode. With this bwfm(4) can spawn an accessPatrick Wildt
point including WPA2 support. We now have a different event mask per mode, so that events that are only useful for STA mode don't interfere with HOSTAP mode. Power savings is disabled when we act as AP. The connection events generate 802.11 frames for handling auth/assoc and deauth/deassoc so that our stack takes note of the connecting nodes.
2018-01-08Delete flowrings when we take the interface down or change itsPatrick Wildt
settings.
2018-01-07Create multiple transmit flowrings in station mode, four in total, basedPatrick Wildt
on TOS values. In AP mode create multiple flowrings per connected node.
2018-01-05To send out packets we need to create a flowring. Acting as station,Patrick Wildt
we typically have about four flowrings per priority. As access point we apparently need one, or four considering the priorities, flowrings per client. For now let's start with a single TX flowring. To setup a flowring we need to send a create request and can only start sending packets as soon as we are told that the ring is created. With this we can now do actual network traffic.
2018-01-05Drop incoming network packets as long as we are not in RUN state. ThisPatrick Wildt
happens when we successfully associate and the AP tries to initiate the WPA2 handshake but we haven't received the asynchronous ASSOC event yet. Dropping the packet will make the AP retry, and at that point we should have successfully associated. While there, don't feed the event packets to our network stack. It's been helpful for debugging but now it's time to let go.
2018-01-05When we receive an AUTH or ASSOC event even though we have alreadyPatrick Wildt
reached the RUN state, this probably means that we have roamed to a different AP. In that case throw us back into SCAN mode and let the stack look for a new AP to connect to. In the future it might be worthwhile to use the ROAM event information to read the new AP information to adjust our stack, but that is further down the road.
2018-01-04Receiving an AUTH event means that we successfully authenticated, thusPatrick Wildt
we have to move to the "trying to" ASSOC state. When association has finished we will receive an ASSOC event, so that we can move into the RUN state. After that point we will receive ethernet packets and the WPA2 handshake can occur. The SET_SSID event will now only be used to bring us back into SCAN when it notes an error, as it often completes after we have already done the WPA2 handshake and can not be used to switch between the different states.
2018-01-03assign 1 instead of the result of htole16(1) to a uint8_t.David Gwynne
on big endian archs the 1 is shifted to the high byte, which then gets lost when it's assigned to the uint8_t. at worst we lose the value, at best the compiler has a teary and fixes it. this is the fix for a compiler teary. ok claudio@
2018-01-03Since the PCI attachment code already uses mbufs for RX packets, we canPatrick Wildt
push the mbuf allocation down into the USB attachment code and now pass an mbuf to the bwfm(4) receive function.
2017-12-30Don't pull in <sys/file.h> just to get fcntl.hPhilip Guenther
ok deraadt@ krw@
2017-12-30Delete unnecessary <sys/file.h> includesPhilip Guenther
ok millert@ krw@
2017-12-26Fix channel initialization by not using the same loop variable in nestedPatrick Wildt
for-loops. Oops.
2017-12-18Read RAM size for chips with SOCRAM like the BCM4334 on one of myPatrick Wildt
Intel machines.
2017-12-18Read RAM size for chips with SOCRAM like the BCM4334 on one of myPatrick Wildt
Intel machines.
2017-12-18Pass the BSSID to the join command so that we connect to the AP thatPatrick Wildt
we chose instead of any AP the firmware chooses based on the SSID.
2017-12-18Pass scan type directly to the scan command instead of using the globalPatrick Wildt
variable.
2017-12-18Support setting the Cortex-A7 cores to active/passive mode andPatrick Wildt
fix up the code for the Cortex-R4 which works the same.
2017-12-17Pass Cortex-R4 reset vector to activation function.Patrick Wildt
2017-12-16Read RAM base address and size so we know where to put the firmware.Patrick Wildt
2017-12-16Implement setting the chip into active mode, as needed for setting upPatrick Wildt
the PCIe-based BCM43602's firmware in the PCI attachment driver.
2017-12-16Support setting the Cortex-R4, as found on a BCM43602, to passive mode.Patrick Wildt
2017-12-16Add some more Chip IDs to bwfm(4).Patrick Wildt
2017-12-12Nuke some forward-only struct's and functions and functions therebyKenneth R Westerback
made empty. Found by new ctfconv(1) feature and validated by clang. ok mpi@
2017-12-01Add quotes around the name of (unconfigured) devices like we do for otherMark Kettenis
iic(4) controllers. ok jcs@
2017-11-28The athn(4) PCI driver forgot about adding the default noisefloor toStefan Sperling
measured RSSI values. The same is already done for USB devices. RSSI values shown in ifconfig make sense now. ok kevlo@
2017-11-28In athn(4), fix a comment which misidentifies the field where RSSIStefan Sperling
values occur. Add macros to access RSSI info in ds_status4 as well. ok kevlo@
2017-11-16Add PCI attachment for dwiic(4) needed by Intel 100 Series machinesJoshua Stein
ok kettenis
2017-10-26Move common code to add/remove multicast filters to ieee80211_ioctl(9).Martin Pieuchot
ok jsg@, stsp@
2017-10-21Even though letting the firmware handle the handshake is nice fromPatrick Wildt
a user perspective, it's rather horrible from a security perspective. Especially since there has not only been the KRACK attack, but also exploited wireless firmware. Thus this commit changes the way that bwfm(4) is integrated into our network stack. Instead of making it an Ethernet controller with some WiFi capability, deeply integrate it into the net80211 stack. This way we can do the WPA handshake in software and we don't have to reimplement or copy too much code from the net80211 stack. Some code taken from NetBSD where Jared McNeill committed bwfm(4) with net80211 integration as well. Discussed with and "looks good" stsp@
2017-10-19spelling fix; from miodJason McIntyre
2017-10-19Disable promisc mode and accepting all multicast packets. These shouldPatrick Wildt
be properly enabled by the correct ioctls.
2017-10-18Pass the SIOCG80211ALLCHANS and SIOCG80211STATS ioctls to our net80211Patrick Wildt
which can handle those ioctls quite well for us.
2017-10-18Add a scan timeout so we can recover if the firmware decides not toPatrick Wildt
send us any answers to our request.