summaryrefslogtreecommitdiffstats
path: root/sys/dev
AgeCommit message (Collapse)AuthorFilesLines
2015-12-08No trailers has been the default and only option for 20 years, yet sometedu21-49/+42
drivers still set IFF_NOTRAILERS while others do not. Remove all usage of the flag from the drivers which in ancient times used it (and the modern drivers which blindly copied it from those drivers of yore). suggested by guenther. ok mpi
2015-12-08Match 3rd party Xbox 360 controllers, from Christian Heckendorf.mpi1-11/+15
Tested by jeremy@
2015-12-08dont need to repeatedly set if_start to the same function.dlg1-7/+1
2015-12-07enable snooping on Intel 100 Series HDAjsg1-1/+2
from and tested by daniel@
2015-12-07match on intel 100 seriesjsg1-2/+3
from and tested by daniel@
2015-12-06switch on the return value of bus_dmamap_load_mbuf not value != 0jsg1-3/+2
problem in rev 1.47 spotted by clang's -Wswitch-bool ok jmatthew@ kettenis@
2015-12-06typo in log entrymmcc1-2/+2
2015-12-05vioblk: Don't send flush ops if flush feature not presentsf1-1/+5
If we haven't negotiated the flush feature, don't send VIRTIO_BLK_T_FLUSH to the device. noticed by mlarkin@
2015-12-05make vioblk_scsi_cmd more normalsf1-13/+7
Declare all variables at the start of the function and get rid of the strangely-indented block around the second half of the function.
2015-12-05Make virtio_enqueue_commit return voidsf2-6/+4
The return value was unused
2015-12-05Make the bnx interrupt handler mpsafe, and perform rx and tx completionjmatthew2-218/+119
outside the kernel lock. Remove tx descriptor lists (essentially backing out if_bnx.c r1.77), add an interrupt barrier in bnx_stop, check the rx ring state before receiving packets, adjust the tx counter with atomic operations, and rework bnx_start to check for ring space before dequeueing and drop the packet if bnx_encap fails. tested on BCM5708 by me and on BCM5709 by Hrvoje Popovski ok dlg@
2015-12-05ifq_deq_rollback without a preceding ifq_deq_begin is fail.dlg1-2/+1
caused by a badly managed merge. found by and testing by sebastia@ ok mpi@
2015-12-04Activate functions should in general return 0 for events they don't handle.kettenis2-12/+10
ok deraadt@
2015-12-03ieee80211com's ic_sup_mcs array is smaller than it used to be because part ofstsp1-6/+4
it has been split out into new struct fields. The athn(4) driver was still assuming the old size and wrote beyond the ic_sup_mcs array. Make the driver write to the new ic_tx_mcs_set field instead. found by daniel@ with gcc 4.9 ok sthen@ kettenis@
2015-12-03tell the stack myx_start is mpsafe.dlg1-19/+9
as per the stack commit, the driver changes are: 1. setting ifp->if_xflags = IFXF_MPSAFE 2. only calling if_start() instead of its own start routine 3. clearing IFF_RUNNING before calling if_start_barrier() on its way down 4. only using IFQ_DEQUEUE (not ifq_deq_begin/commit/rollback)
2015-12-03Rework cas_start to check for space on the ring before dequeueing and dropjmatthew1-43/+60
the packet if encap fails, use m_defrag if the mbuf is too fragmented, adjust sc_tx_cnt using atomic operations, hold the kernel lock while calling cas_init and cas_start from the interrupt handler, use an interrupt barrier in cas_stop, and finally mark the interupt handler mpsafe. encouragement from dlg@ and kettenis@
2015-12-03Rewrite the tx handler to just use ifq_dequeue and drop packets thatclaudio1-13/+15
could not be sent either because the dma mapping failed or because m_defrag failed. Those errors are accounted as oerrors. dlg@ agrees.
2015-12-02Add missing parentheses. Fix from NetBSD.yasuoka1-2/+2
ok mpi
2015-12-02Do not change the status of a transfer before giving it back to thempi1-7/+7
stack. Unbreak polling mode when the host Babbles because a reset of the ring is necessary and xhci_waitintr() stops polling as soon as the xfer status changed. Problem reported by and ok krw@
2015-12-02Simplify fxp tx dma handling by using m_defrag instead of rolling our ownclaudio1-29/+13
version. Based on a very old diff from brad@, tested by me and David Hill OK kettenis@
2015-12-02Add an unmute quirk for IDT 92HD75B3/4 codecs with HP subids.jsg1-1/+4
This is required to get speaker audio on the HP Elitebook 2540p. Reported and fix tested by Mike Cond.
2015-12-01Teach ppb(4) how to allocate PCI bus numbers such that it can properlykettenis1-1/+61
condigure bridges left unconfigured by the system firmware. Not perfect yet, but good enough to make the Apple Thunderbolt Giabit Ethernet adapter work when inserted at boot time. ok deraadt@
2015-12-01Enable the GSE interrupt on Broadwell. Fixes acpi brightness control onkettenis1-1/+5
the MacBookPro12,1, 3rd gen Lenovo X1 Carbon (when hacked to use the standard acpi mechanism for this purpose) and probably many others. Seems this hasn't been figured out over in Linux land yet.
2015-12-01myx doesnt use atomic.h anymore.dlg1-19/+1
2015-11-30Add support for the touchpad found on the MacBooPro12,1.kettenis1-13/+61
ok jcs@
2015-11-29Make it possible to detach bge(4).kettenis2-72/+117
ok deraadt@
2015-11-29Unconnected xhci(4) super speed ports may come up with the XHCI_PS_WRC,kettenis2-2/+15
indicating a warm reset has happened. Communicate this as UPS_C_BH_PORT_RESET to the upper layers and make uhub(4) clear this bit such that we receive further connection status change notifications. Make sure we only do this for super speed (USB 3.0) hubs as high speed (USB 2.0) hubs use the same bit for UPS_C_PORT_L1. Make hotplugging USB 3.0 devices work on my MacBookPro12,1. ok mpi@
2015-11-29Clear the UPS_C_PORT_RESET feature when exploring. Apparently xhci(4) superkettenis1-1/+7
speed ports may have the XHCI_PS_PRC bit set after xhci(4) attaches. Just clearing this bit isn't enough though, since the device is already connected and no further connection status change is signalled. So fake one. This makes the integrated SD card reader in the MacBookPro12,1 attach. ok mpi@
2015-11-28rework dc_start and dc_encap to take advantage of m_defrag.dlg1-97/+73
if the chip needs coalesced packages in tx, set the tx dmamaps up to only use a single dma descriptor. use m_defrag when bus_dmamap_load_mbuf returns EFBIG rather than copying the packet to a separate mbuf with hand rolled code in dc_coal. that in turn makes the ifq_deq_begin, ifq_deq_commit, and ifq_deq_rollback handling more straightforward. tested by me on a hppa a180c with a "DEC 21142/3", and fred on bugs@ with a sparc64 netra x1 "Davicom DM9102".
2015-11-28regenkettenis2-2/+32
2015-11-28Add a few devices found on the MacBookPro12,1kettenis1-1/+7
2015-11-28Rework gem_start to check that there's enough space in the ring beforejmatthew4-73/+105
dequeueing a packet, then drop the packet if it can't be sent, rather than using two phase dequeue then commit. Adjust sc_tx_cnt using atomic operations, take the kernel lock before calling gem_start or gem_init from the interrupt handler, and use an interrupt barrier when taking the interface down. With all this done, we can mark the interrupt handler for pci (but not sbus) attached gem(4) as mpsafe. mpi@ wrote this initially, I fixed bugs to keep sparc64 happy and kept it up to date with ifq changes. ok mpi@ dlg@
2015-11-27Don't report a bus conflict for bridges that are left (partly) unconfigured bykettenis1-2/+2
the system firmware.
2015-11-27Attach the iPhone 6 as ugen(4), from Laurent GUALDI.mpi2-3/+6
2015-11-27regenmpi2-4/+9
2015-11-27iPhone 6, from Laurent GUALDI.mpi1-1/+2
2015-11-25Network drivers should not include <net/route.h> or <net/netisr.h>mpi12-25/+12
2015-11-25Small fixes related to the IFF_OACTIVE removal.mpi1-2/+2
2015-11-25add size to freetedu2-5/+5
2015-11-25trim unused variabledlg1-2/+1
2015-11-25replace IFF_OACTIVE manipulation with mpsafe operations.dlg114-723/+820
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-24regenkettenis2-2/+17
2015-11-24Add a few missing devices found on recent Apple hardware.kettenis1-1/+4
From Bryan Vyhmeister.
2015-11-24Fix inverted condition in previous.kettenis1-2/+2
Problem reported by Mikolaj Kucharski.
2015-11-24You only need <net/if_dl.h> if you're using LLADDR() or a sockaddr_dl.mpi118-241/+121
2015-11-24You need <netinet/ip.h> if you use "struct ip" for hw checksum.mpi3-7/+3
You never need <netinet/ip_var.h> nor <netinet/in_systm.h>.
2015-11-24No need for "vlan.h" if you don't check for "#if NVLAN > 0".mpi5-10/+5
2015-11-24No need to include <net/if_arp.h>mpi31-62/+31
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.mpi86-173/+87
2015-11-24No need to include <net/if_types.h> for <net/if_vlan_var.h>mpi4-8/+4