Commit Graph

33873 Commits

Author SHA1 Message Date
mlelstv
b6a6db8fe4 Make scsipi framework MPSAFE.
Data structures are now protected by a per-adapter mutex at IPL_BIO
that is created by the scsibus or atapibus instance when the adapter
is configured.
The enable reference counter and the channel freeze counter which are
currently used by HBA code before the adapter is configured, are made
atomic.
The target drivers are now all tagged as D_MPSAFE.

Almost all HBA drivers still require the kernel lock to present,
so all callbacks into HBA code are still protected by kernel lock
unless the driver is tagged as SCSIPI_ADAPT_MPSAFE.

TODO: refactor sd and cd to use dksubr.
2016-11-20 15:37:19 +00:00
phx
ac36483cc7 Fixed typo in name for MCP3304. 2016-11-20 12:38:04 +00:00
pgoyette
9300beb87f Avoid calling bufq_free() from critical code sections. 2016-11-20 02:38:24 +00:00
pgoyette
e38abff020 Avoid calling bufq_free() from critical section. 2016-11-20 02:34:27 +00:00
skrll
d86dfd8c85 Pull across various locking and reference counting fixes from nick-nhusb. 2016-11-19 09:49:20 +00:00
flxd
b0be1b67cd Add "getrealloc" and "setrealloc" commands to get/set automatic reallocation
parameters/enables for error recovery, similar to {get,set}cache.
Many old SCSI disks shipped with reallocation disabled, albeit supporting it.
Minor (cosmetic) fixup of scsi_disk_pages while there.
Based upon code in PR bin/29165 by Greg A. Woods.
OK christos@
2016-11-19 08:43:40 +00:00
joerg
0640809ae6 Remove extra pair of braces. 2016-11-18 11:46:04 +00:00
msaitoh
85f6e15ba0 Fix WOL related setting of the WUC register for other than PCH*
in wm_enable_wakeup(). Tested with 82567V(ICH8) and 82583V.
2016-11-18 06:55:00 +00:00
msaitoh
fdbe361397 8257[124] should not set WM_F_ARC_SUBSYS_VALID. 2016-11-17 03:40:08 +00:00
msaitoh
b1bf008a8e Fix flag check in wm_get_wakeup()
- 8254[17]* should not set WM_F_ARC_SUBSYS_VALID.
- Add missing WM_T_82541_2 and WM_T_82547_2
- Note that the setting of both Linux's FLAG_HAS_AMT and FreeBSD's has_amt
  flag is doubtful on 8257[34] and 82583.
2016-11-17 03:36:23 +00:00
macallan
0467dcceed pass clockframe aropund in voyager_intr() 2016-11-16 22:05:19 +00:00
msaitoh
107e16b729 Move the location of wm_smbustopci() call. 2016-11-16 09:27:49 +00:00
msaitoh
acd0729a35 Sync wm_smbustopci() with Linux and FreeBSD. This change effects PCH and
newer devices.
2016-11-16 08:56:17 +00:00
msaitoh
2ad9b79127 Fix a bug that 8257[56], 82580, I35[04] and I21[01] didn't use
wm_{get,release}_hw_control() correctly.
2016-11-16 08:14:39 +00:00
msaitoh
2e8289626c Add three workarounds for PCH_{LPT,SPT}. 2016-11-16 07:24:52 +00:00
msaitoh
6918c3ff19 Sort registers. No functional change. 2016-11-14 08:48:03 +00:00
msaitoh
135b46a176 Set CTRL_MEHE correctly (PCH_{LPT,SPT} only). 2016-11-14 05:38:39 +00:00
msaitoh
942fbad289 The MEHE bit in the CTRL register is not bit 17 but 19. 2016-11-11 07:31:03 +00:00
hauke
a664a38e53 Add entry for Intel Centrino Advanced-N 6235 bluetooth piggy-back
Add entry for Validity Sensors, Inc. VFS491
2016-11-10 15:38:51 +00:00
msaitoh
466c55b2a6 - Move I219 DMA workaround into wm_flush_desc_rings() and call it before
wm_reset().
- Rewite I219 TX DMA workaround based on OpenBSD's one.
- Add I219 RX DMA workaroud from OpenBSD.
2016-11-10 08:35:24 +00:00
msaitoh
48429bc512 Call wm_enable_phy_wakeup() on PCH2 and newer, too. Now these devices
can do WOL. Tested with Thinkpad X220(PCH2).
2016-11-10 06:57:15 +00:00
macallan
695edcefa4 - use bus_space_mmap()
- pass the right colour depth in ioctl()
should fix PR49639
2016-11-09 19:54:25 +00:00
msaitoh
a876d694e3 Fix wm_access_phy_wakeup_reg_bm(). This change has no effect because this
function is used for WUC register and our driver currenlty doesn't access
to it.
2016-11-08 10:37:39 +00:00
msaitoh
74d8c9752d Remove debug printf which was added in rev. 1.437. 2016-11-08 09:38:36 +00:00
msaitoh
1ff8d4e5e5 Call wm_enable_wakeup() in wm_detach() and wm_suspend(). Now wake on lan
works on Thinkpad X61(ICH8). Some workarounds will be required on PCH*.
2016-11-08 08:54:30 +00:00
msaitoh
c3c841d14e Set mii_mpd_{oui,rev}. 2016-11-08 08:48:35 +00:00
msaitoh
bb76968e7c Set mii_mpd_{oui,model,rev}. 2016-11-08 07:22:26 +00:00
msaitoh
50637e2302 Fix previous (s/MII_MAXREGADDR/MII_ADDRMASK/). 2016-11-07 08:57:43 +00:00
christos
b8606790f0 msk_init is too heavyweight and loses link. Provide a specialized way to
enter and exit promiscuous mode so that we don't lose seconds of traffic
each time we run tcpdump.
2016-11-06 21:51:31 +00:00
msaitoh
f124b4c080 Add "10/100" into non-gigabit devices' name. 2016-11-06 02:38:25 +00:00
mlelstv
2610f5dfb8 match RTL8188EU device from vendor ABOCOM. 2016-11-04 20:44:57 +00:00
mlelstv
a63f79cc7e regen 2016-11-04 20:40:11 +00:00
mlelstv
06f1a43972 add id for RTL8188EU from vendor ABOCOM 2016-11-04 20:39:33 +00:00
msaitoh
927c094fa1 - Fix workaround which did dummy read BM_WUC register. This code was changed to
drop BM_WUC_HOST_WU_BIT of BM_PROT_GEN_CFG register in FreeBSD r228386. The
  code was added rev. 1.149, but the location was not the best.
  Now I219 doesn't hang quickly after "ifconfig up".
- wm_gmii_hv_{read/write}reg*(): USE PHY address 1 for some special registers.
- Add check code for an 82578 workaround. Not completed yet(check only).
- wm_release_hw_control(): Remove extra line. No any effect.
2016-11-02 10:14:04 +00:00
msaitoh
31ec994666 Set mii_mpd_{oui,model,rev}. 2016-11-02 10:11:32 +00:00
msaitoh
8fd2b67f97 Set mii_mpd_{oui,model,rev}. 2016-11-02 07:01:54 +00:00
pgoyette
d2c5fd3368 Protect against buffer overflow. 2016-11-02 00:39:56 +00:00
jdolecek
3a357b71a7 reduce admin queue size to save memory; it's only ever used during
attach/detach and for nvmectl(8), so there is actually no point having it big
2016-11-01 14:46:31 +00:00
jdolecek
a2a95605bd pass maxphys from device rather then assuming MAXPHYS; it's clipped in ld(4)
if bigger then MAXPHYS

multiply the queue size by number of queues for ld(4) sc_maxqueuecnt, so
that ld_diskstart() would try to use full capacity, instead of throttling
to one queue worth of commands
2016-11-01 14:39:38 +00:00
jdolecek
b5e5261cdf tighter queue control - according to spec actual cap on number of commands
in flight is actually one less then queue size, head == tail means empty
queue
2016-11-01 14:24:35 +00:00
christos
683d8d5aa6 PR/51574: You can't always get what you want, but if you try sometime..
Remove unreachable code.
2016-10-31 12:18:10 +00:00
martin
4b719b6d22 Stopgap fix for in-kernel compilation (differences between humanize_number(3)
and humanize_number(9)), ok: msaitoh
2016-10-31 09:13:20 +00:00
msaitoh
457bdd14ee Decode Resizable BAR. 2016-10-31 05:10:45 +00:00
nonaka
ba5614b57d regen 2016-10-31 04:16:29 +00:00
nonaka
e40484001a Remove duplicated HUAWEI E353 entry. 2016-10-31 04:15:22 +00:00
dholland
9a414660b9 Regen. 2016-10-31 03:19:23 +00:00
dholland
11840f5367 Add extra ucom/u3g id for Huawei E353; from Ben Gergely in PR 49302. 2016-10-31 03:18:41 +00:00
knakahara
973dac0e9f Fix locking against myself at wm_turn{on,off} when NET_MPSAFE is defined.
Pointed out by ozaki-r@n.o, thanks.
2016-10-31 02:44:54 +00:00
mlelstv
797eebd407 Error recovery stops normal queue processing but didn't resume it
when the recovery succeeded. Add the missing calls to scsipi_channel_thaw
similar to kern/41867.
2016-10-30 23:56:05 +00:00
mlelstv
fc6e0636cf CAM status values are used as xs_status and must be mapped to XS values.
Add the missing mapping for CAM_CMD_TIMEOUT.
2016-10-30 23:35:10 +00:00
msaitoh
4ea63ab43a Fix PHY access on 82567(ICH8 or ICH10), 82574 and 82583:
- Use wm_gmii_bm_{read,write}reg() on 82574 and 82573.
- Issue page select correctly on BM PHYs.
2016-10-28 09:16:02 +00:00
msaitoh
e7ac631384 regen. 2016-10-28 07:26:41 +00:00
msaitoh
65b5af548f - Add some Core i7-800 and i5-700 devices from "Intel Core i7-800 and i5-700
Desktop Processor Series Datasheet - Volume 2" (Document Number 322910-003).
- Change some descriptions of Core i5-600 and i3-500 devices.
2016-10-28 07:25:25 +00:00
msaitoh
dd9c0d71d4 Change debug flags to be better than before. 2016-10-28 06:59:08 +00:00
msaitoh
f1c537b246 - Define WMPHY_I217, WMPHY_VF and WMPHY_210.
- Use BME1000_PHY_PAGE_SELECT in wm_gmii_bm_{read,write}reg(). This change has
  no effect because GG82563_PHY_PAGE_SELECT and BME1000_PHY_PAGE_SELECT have
  the same value.
2016-10-28 06:27:11 +00:00
msaitoh
5f6b90ba37 - Use MII_ADDRMASK.
- Remove debug printf().
2016-10-28 05:50:18 +00:00
msaitoh
cf241ff9b0 Define MII_ADDRBITS and MII_ADDRMASK. 2016-10-28 05:47:16 +00:00
knakahara
6922409509 Fix wm(4) input drop packet counter.
WMREG_RNBC is incremented when there is no available buffers in host
memory. However, ethernet controller can receive packets in such case
if there is space in phy's FIFO. That is, ethernet controller drops
packet only if there is no available buffers *and* there is no space
in phy's FIFO.
So, the number of dropped packets should be added WMREG_MPC only.

ok by msaitoh@n.o
2016-10-28 05:29:11 +00:00
msaitoh
28b17f4dc8 - Remove an 82578 workaround which was for PCH rev < 3. FreeBSD removed this
workaround in r228386.
- Add an 82578 workaround which is for PHY rev < 2. From FreeBSD and Linux.
- Add some DPRINTF()s.
2016-10-28 05:21:48 +00:00
knakahara
706f0d4ae8 Fix sc_stopping race.
To scale, separate sc_stopping flag to wm_softc and each tx,rx queues.

Pointed out by skrll@n.o, thanks.

ok by msaitoh@n.o
2016-10-28 04:14:13 +00:00
christos
50891658e9 don't escape the unescapable 2016-10-26 13:47:05 +00:00
msaitoh
ee7c3a705c Use wm_gmii_82544_{read,write}reg() on non-82567 ICH8, 9 and 10. 2016-10-26 10:21:44 +00:00
msaitoh
6dab41ac3a 82567V_3 is BME1000_E_2(bm). Tested with Advantech AIMB-212 1st Ethernet port. 2016-10-26 07:22:14 +00:00
msaitoh
dd491d735e 82567V-3 is not ICH9 but ICH8. 2016-10-26 06:51:35 +00:00
msaitoh
6bc56ea276 regen. 2016-10-26 06:50:43 +00:00
msaitoh
6213b9cfdb i82567V-3 is not ICH9 but ICH8. 2016-10-26 06:50:20 +00:00
pgoyette
1656c8e745 Avoid writing beyond the end of the buffer we were given.
This should actually cure the "stack overflow" reported earlier (and
was worked around by increasing the size of the buffer).
2016-10-26 06:10:39 +00:00
pgoyette
c9690682a0 Update the devlist2h.awk script to track the maximum lengths of vendor
and product strings, and report the max values at end of the run.

Update the Makefiles.{pci,usb,hdaudio}devs to point users at the places
which might need to be updated if the maximum lengths get larger.

Since this commit makes no changes to the generated files, we don't
need to regenerate them now.
2016-10-26 01:03:23 +00:00
pgoyette
a36b37e027 Replace numeric magic-number constant with something a bit more meaningful. 2016-10-25 09:15:55 +00:00
pgoyette
ecf94dda9c Increase max string length for PCI Product names. Affects only kernels
with PCIVERBOSE (or corresponding module).

We currently have a few product names that exceed the old limit, and
this is triggering an SSP check in pci_devinfo().  This commit doesn't
directly address the SSP issue, but pushes the can down the road...
2016-10-25 05:43:40 +00:00
jdolecek
b2524a8de9 revert 1.90 of dksubr.c and change sc_deferred back to simple pointer; the
global sc_busy flag guards against race so it's not actually necessary, and
this place is unlikely to need to be parallelized in near future

discussed with mlelstv@
2016-10-24 17:14:27 +00:00
msaitoh
1e6643fc30 Regen. 2016-10-24 06:04:26 +00:00
msaitoh
2dd13e0246 Add Xeon E7 v4 devices from "Intel Xeon Processor E7 v4 Product Famliy
Datasheet Volume 2: Registers".
2016-10-24 06:03:52 +00:00
jdolecek
40c6b2001f change sc_deferred to TAILQ (reusing bufq b_actq) to avoid possible buf leak
for MPSAFE drivers
2016-10-22 22:32:33 +00:00
msaitoh
72407ce3a1 - Fix previous commit in wm_kmrn_readreg().
- Use wm_gii_mdic_readreg/writereg() in wm_access_phy_wakeup_reg_bm()
  because these functions are called with taking lock.
- Add some DPRINTF()s.
2016-10-21 08:30:48 +00:00
msaitoh
b305a64424 - Rewrite PHY related lock stuff. Almost the same as FreeBSD.
This change will fix a bug that PHY read/write fail on some cases.
- Increase delay in wm_phy_resetisblocked(). Same as FreeBSD.
- Use semaphore in wm_hv_phy_workaround_ich8lan() and wm_k1_gig_workaround_hv()
2016-10-21 04:41:09 +00:00
jdolecek
f4a9f41e14 revert change from rev. 1.12:
"""
slightly optimize memory access - change struct nvme_queue so that the
struct dmamem members are allocated as part of it, instead of separate
kmem_alloc()s
"""

that change quite curiously caused completion queue corruption on MP systems,
regardless of MPSAFE setting for the pci/softintr interrupt
2016-10-20 19:20:40 +00:00
jdolecek
f583528dd2 revert rev. 1.7 - seems the polling damages command queue on live system 2016-10-20 18:42:28 +00:00
skrll
d3e93ac2c2 Fix regisers typo 2016-10-20 09:53:07 +00:00
msaitoh
41fb970045 - Move call of wm_reset() in wm_attach() after setting PHY and NVM related
flags because those flags are used in wm_reset().
- Use mutex for NVM access on ICH8 and newer devices. Same as FreeBSD.
2016-10-20 08:03:13 +00:00
msaitoh
555f67f524 Add newer I219 devices (not enabled). 2016-10-20 05:53:27 +00:00
msaitoh
777609a05f regen. 2016-10-20 05:52:32 +00:00
msaitoh
9e85476c80 Add newer I219 devices. 2016-10-20 05:52:09 +00:00
msaitoh
6c43b2fa50 - pci_conf_print_pwrbdgt_base_power(): From 0xf3 to 0xff of the Base power are
reserved above 300W (PCI 3.0 Errata).
- Emergency Power Reduction mechanism with PWRBRK signal ECN.
- Extended Message Data for MSI ECN.
- Fix typo in comment.
2016-10-20 04:11:02 +00:00
msaitoh
3846e4c65e Add more DPRINTF()s. 2016-10-20 04:06:53 +00:00
jdolecek
18cb818001 add debug code to check for completion queue corruption 2016-10-19 19:34:31 +00:00
jdolecek
684dc5aae2 follow advice of spec and block interrupts via INTMS/INTMC for intx handler;
this also makes it possible to offload the actual interrupt processing to softintr
handler, similar as for MSI/MSI-X
2016-10-19 19:31:23 +00:00
msaitoh
3dcd57986a No, functional change:
- Add WM_DEBUG_LOCK
- Add some KASSERT
- Modify comment.
2016-10-19 08:55:23 +00:00
msaitoh
40e237eae6 - Drop the host wakeup bit after resetting PHY on PCH and newer devices.
- Increase delay while toggling LANPHYPC
2016-10-19 08:22:57 +00:00
msaitoh
850dab4f61 Add VF Resizable BARs ECN. 2016-10-19 04:23:37 +00:00
msaitoh
c6dda59b2a regen. 2016-10-19 04:00:04 +00:00
msaitoh
28e6eeb62f Add Xeon 5[56]00 devices from
"Intel Xeon Processor 5500 Series Datasheet, Volume 2" and
"Intel Xeon Processor 5600 Series Datasheet, Volume 2"
2016-10-19 03:59:17 +00:00
jdolecek
9879797546 provide intr xname 2016-10-18 22:08:30 +00:00
jdolecek
e1d3e1b041 add isa_intr_establish_xname() to MD isa headers so that it can be used
by MI drivers
2016-10-18 22:04:33 +00:00
nat
c1b9bee02c Stop crash when switching vt or leaving X windows.
Improved upon and OK from christos@
2016-10-18 20:17:37 +00:00
aymeric
674ce7c434 add support for the MCP7940 based Pi Face Real Time Clock 2016-10-18 18:54:54 +00:00
nonaka
1648ffa057 fix a sync range size when number of bus_dma segment is greater than 2. 2016-10-18 07:48:05 +00:00
martin
95d7be9185 Make this compile again. 2016-10-18 03:38:50 +00:00
nat
7b977f0d18 Add a kthread to update display with framebuffer contents.
X11 will now work with wsfb(4).

OK christos@
2016-10-17 20:04:48 +00:00
nat
b82a1afd02 regen. 2016-10-17 20:00:25 +00:00
nat
23539045ab Add DisplayLink FY-DVI usb adaptor.
OK christos@
2016-10-17 19:58:42 +00:00
jdolecek
ee25a7878f provide stub intr xname establish for xen 2016-10-17 18:23:49 +00:00
flxd
c49ef5bc4b Add 53C810AP for FreeAXP's emulation of a DEC KZPAA adapter. 2016-10-17 16:02:10 +00:00
nat
c4d769f277 regen. 2016-10-16 18:49:17 +00:00
nat
529ceae0f0 Add quirk for C-Media USB Pnp sound card.
Without this I was unable to record.  The recording volume is still way to
low but it's possibly my microphone.

OK christos@
2016-10-16 18:47:49 +00:00
oster
5a54295bea Cleanup/remove unused asm_count. Reported by David Binderman in PR#51552.
Thanks!
2016-10-15 20:31:15 +00:00
kiyohara
cab58e4e51 Add White LED initialize function. 2016-10-15 14:40:41 +00:00
maxv
023431e1e1 There are several leaks in here, just fix one that should have been fixed
in rev1.21
2016-10-15 08:37:55 +00:00
maxv
f9c11d46d5 Memory leak, found by mootja; not tested, but obvious enough 2016-10-15 08:30:42 +00:00
nat
4aab7ca596 printf -> aprint_normal.
OK christos@
2016-10-15 07:10:15 +00:00
nat
333b297cf7 pad(4) must be open before corresponding audio device is opened.
OK christos@
2016-10-15 07:08:06 +00:00
flxd
b00016e53e regen 2016-10-14 15:01:39 +00:00
nonaka
7a9bb565aa Dump more FADT fields from ACPI 6.1. 2016-10-14 11:11:01 +00:00
jdolecek
9b6d6cfce1 provide intr xname 2016-10-13 20:05:06 +00:00
jdolecek
9270f1e85e provide intr xname 2016-10-13 17:11:09 +00:00
ryo
b4bcaf0489 /dev/mem cannot lseek over 0x80000000 on 32bit architectures. 2016-10-13 08:56:31 +00:00
nat
041ac2d003 Add support for Realtek 8192EU.
OK christos@
2016-10-12 03:23:29 +00:00
nat
79ff291203 regen 2016-10-12 03:09:10 +00:00
nat
9c9e8ee8be Add Realtek 8192EU usb wifi adaptor.
OK christos@
2016-10-12 03:07:11 +00:00
nat
989fb94197 IQ Calibration for urtwn devices.
Addresses PR/47781.

OK christos@
2016-10-12 02:56:45 +00:00
nat
c2d8ad4435 Stop urtwn devices from usb suspend, allow remote wifi activity wakeup.
Addresses PR/51111.

OK christos@
2016-10-12 02:50:44 +00:00
jdolecek
5248456d9b do not try to flush device when rebooting with RB_NOSYNC, so that machine
would still reboot if the device is wedged
2016-10-11 18:31:11 +00:00
skrll
b7cb5d9d35 Read sc_if_flags after taking core lock 2016-10-11 15:48:17 +00:00
maxv
303e5f4efd Memory leak, found by mootja; not tested, but obvious enough. By the way,
I guess we should be handling the return value of OF_getprop.
2016-10-11 13:04:57 +00:00
maxv
c312cb33a2 There are two memory leaks here, found by mootja; just add some XXXs. 2016-10-11 12:53:56 +00:00
kiyohara
4964aa11de The bus_dmamap_sync(PREREAD) is unnecessary for sent mbuf.
Moreover bus_dmamap_sync(POSTWRITE), before unload.
2016-10-10 14:23:35 +00:00
christos
9015c01fa3 PR/51540: Henning Petersen: replace , with ; 2016-10-09 14:49:51 +00:00
christos
56e7e9d8c8 PR/51540: Henning Petersen: replace , with ; 2016-10-09 14:35:33 +00:00
jdolecek
0d0b547d36 add defines for dataset management (from NVMe spec rev 1.2) 2016-10-08 16:05:32 +00:00
christos
11659cbe4a sync antenna vals with OpenBSD, some changes from FreeBSD. 2016-10-08 15:57:11 +00:00
nonaka
2f979a4f7a The maximum number of IO queue entries is hardware supported value. 2016-10-05 03:46:38 +00:00
christos
a40cffdfe3 regen 2016-10-04 21:36:56 +00:00
christos
cb71a6cf14 PR/51529: Jake Slazenger: D-Link DWA 125 rev. D1 USB wireless network adapter
support
2016-10-04 21:36:38 +00:00
jdolecek
1c7776052b react on ADAPTER_REQ_SET_XFER_MODE so that we set tagged queuing
pass tag type and set id
2016-10-04 18:23:24 +00:00
jdolecek
ef9bae815b vioscsi_req_get()/virtio_enqueue_prep() failing is actually perfectly
normal - observed failures included 10, 27, 61 in-flight commands,
so probably depends on particular command mix; return with
XS_RESOURCE_SHORTAGE rather then panic

do vioscsi_req_put() when initial bus_dmamap_load() fails, as suggested
by the XXX; the vq_done hook is called by virtio, but in that case we never
get to commit the request to it
2016-10-04 18:20:49 +00:00
kiyohara
b15ed47088 Add DS1340. 2016-10-04 15:06:59 +00:00
kiyohara
fa071fd5eb Add 88AP510. 2016-10-04 15:02:27 +00:00
kiyohara
55bfe0837c Regen. 2016-10-04 15:00:40 +00:00
kiyohara
a1eeae3332 Add Marvell 88AP510. 2016-10-04 14:55:32 +00:00
kiyohara
4c5b9cca2d Use ONFI_STATUS_WP instead of 0x80. 2016-10-04 14:47:18 +00:00
kiyohara
970906a863 Wait STATUS_RDY after ONFI_RESET. 2016-10-04 14:43:55 +00:00
skrll
cb7dd11fb0 Do not hold the softc lock (IPL_SOFTUSB) unnecessarily and specifically
across ucomparam (and the ucom_param method).  The method can sleep wait-
ing for transfers... any input/output will try to acquire the lock and get
stuck
2016-10-03 13:36:33 +00:00
dholland
226cad50eb Improve diagnostic print seen in PR 51524. 2016-10-03 00:32:37 +00:00
jdolecek
c7b1f4eb42 change scsipi_execute_xs() to default to simple tags for !XS_CTL_URGENT
if not specified by caller; this is mostly for documentation purposes
only, as sd(4) and cd(4) explicitly use simple tags already
2016-10-02 19:40:35 +00:00
christos
9c7db92f68 MFREE -> m_free 2016-10-02 14:16:02 +00:00
flxd
18cc5a59d9 Add tcu (MI). OK skrll@ 2016-10-01 15:24:35 +00:00
christos
684d040da8 remove unused variable. 2016-10-01 13:46:52 +00:00
mlelstv
8f96d6f598 Ignore completed transfers when detaching. This avoids a race condition
where the detach code has already freed the xfer structures.
2016-10-01 11:09:12 +00:00
mlelstv
4420de0cb1 Use pointer passed as argument. This is not really a change as
data->xfer is supposed to be the same.
2016-10-01 11:07:30 +00:00
mlelstv
da8283ba36 Use splusb() like the other drivers instead of splnet(). 2016-10-01 07:23:40 +00:00
mlelstv
60767f1d18 mcs is a 16bit value. 2016-10-01 07:21:45 +00:00
christos
efc6033743 remove stray debugging, fix debugging message. 2016-09-27 20:37:05 +00:00
christos
c6c0aa6669 works, tested without privacy, wep and wpa. Soft crypto only for now. 2016-09-27 20:16:35 +00:00
pgoyette
e31cf58e77 Add a missing ')' in the call to bswap64().
Should fix compile error of twa module for sparc and sparc64
2016-09-27 12:04:16 +00:00
pgoyette
b6d0aa6f21 Remove some debug printf's that slipped through. Thanks, wiz! 2016-09-27 08:05:34 +00:00
pgoyette
916bdfa5d4 Modularize the ld driver and all of its attachments. Ensure that all
parents are capable of rescan (or otherwise provide a means of attaching
children post-initialization).
2016-09-27 03:33:32 +00:00
mrg
d7cc9508b7 weak alias some pcmcia functions (to an returns error function) so this
links when pcmcia isn't in the kernel.  PR#7253.
2016-09-24 23:54:49 +00:00
mrg
62ee7dc27b introduce a better pci_drvname() and PCI_IOC_DRVNAME as pciio_drvnameonbus()
and PCI_IOC_DRVNAMEONBUS.  the new ones also take a (autoconf) PCI bus
number, which allows lookups for any device on any pci bus node.  use this
in pcictl which current reports the wrong values sometimes.

up next: use these in libpciaccess.
2016-09-24 23:12:54 +00:00
skrll
21e554b260 Truncate the transfer length if an overflow is seen rather than halting.
Don't consider an EP11_STAT_SETUP as an error as it's not valid for
host operation.

Should fix kern/51500: axe(4) at slhci(4) does not attach, but there are
more problems with axe(4)
2016-09-24 15:06:29 +00:00
skrll
8744f4b2f3 Use bit defines to create bit groups for SL11_EPSTAT 2016-09-24 14:55:16 +00:00
maya
f093c4a000 Fix inverted logic in iwm(4).
The PROT_REQUIRE flag in should be set for data frames above a certain
length, but we were setting it for !data frames above a certain length,
which makes no sense at all.

- taken from all other BSDs (OpenBSD, FreeBSD, DragonflyBSD...)
2016-09-23 19:53:52 +00:00
macallan
768a2a4278 - finally fix tcx_clearscreen() and tcx_eraserows() to actually work, and
not just by accident
- sprinkle volatile in order to force gcc 5.4 to emit ldd/std for 64bit
  accesses - BLIT and STIP spaces require those
2016-09-23 17:45:25 +00:00
jdolecek
471f5c28ab cache flush call must wait for completion; cap wait to 60 seconds just in case
controller won't respond
2016-09-20 21:18:08 +00:00
msaitoh
532993fe64 Change page of the OEM_BITS register back to 0 again. The document
(Intel Ethernet Connection I219 Datasheet) says its in page 0.
FreeBSD/Linux code access page 768. WHY?

This change will fix a bug that the LPLU function isn't disabled.

 See: http://mail-index.netbsd.org/source-changes-d/2016/09/19/msg008720.html
2016-09-20 09:24:12 +00:00
jdolecek
d0c39b253f fix mistake fallthrough in the ioctl switch introduced in previous commit 2016-09-19 23:37:10 +00:00
jdolecek
62548607cc fix DIOCCACHESYNC ioctl on ld(4) and raid(4) to work again; it got broken
when the code was switched over to dk_ioctl() - countrary to disk_ioctl(),
dk_ioctl() returns ENOTTY for ioctls it doesn't support, so must be called
as last resort, not first

bug was introduced in rev 1.83 (2015-05-02) for ld(4), and 1.335 (2016-01-03)
for raid(4)
2016-09-19 23:32:30 +00:00
jdolecek
72b4d8bcf5 slightly optimize memory access - change struct nvme_queue so that the
struct dmamem members are allocated as part of it, instead of separate
kmem_alloc()s
2016-09-19 22:11:41 +00:00
jdolecek
ac7944cb93 on further thought, just remove the separately allocated nvme_ns_context
altogether and fold into nvme_ccb; allocating this separately just isn't useful
2016-09-19 20:33:51 +00:00
jakllsch
824fbae66e Don't permanantly disable port if drive probe times out,
reinitialize port instead.
2016-09-19 19:07:53 +00:00
jdolecek
90b052c46b comment tyop and KNF; pointed out by Nick 2016-09-19 19:06:57 +00:00
jdolecek
555d0c6c9f must use PR_NOWAIT also during ldattach()/dkwedge discover, our i/o is there
called with a spin lock held, which triggers LOCKDEBUG panic
2016-09-18 21:52:36 +00:00
jdolecek
ef172b9f2e fix several bugs, make nvme(4) MPSAFE by default and also bump default
number of ioq from 128 to 1024; tested with VirtualBox and QEMU

* remove NVME_INTMC/NVME_INTMS writes in hw intr handler as this is not MPSAFE,
  fortunately they don't seem to be necessary; shaves two register writes
* need to use full mutex_enter() in nvme_q_complete(), to avoid small
  race between one handler exiting the loop and another entering
* for MSI, handover the command result processing to softintr; unfortunately
  can't easily do that for INTx interrupts as they require doorbell write
  to deassert
* unlock/relock q->q_cq_mtx before calling ccb_done to avoid potential deadlocks
* make sure to destroy queue mutexes when destroying the queue (LOCKDEBUG)
* make ns ctx pool per-device, so that it's deallocated properly on module
  unload
* handle ctx allocation failure in ld_nvme_dobio()
* remove splbio() calls in ld_nvme_dobio() and sync, the paths are exercised
  only for dump/shutdown, and that already disables interrupts
* free the ns ctx in ld_nvme_biodone() before calling lddone() to avoid
  memory starvation, as lddone() can trigger another i/o request
* be more careful with using PR_WAITOK, the paths are called from interrupt
  context and there we can't wait
2016-09-18 21:19:39 +00:00
jdolecek
6ade779a87 attach also the nvme_cdevsw when loaded as module, so /dev/nvme* works 2016-09-18 11:58:35 +00:00
jdolecek
8c05e900a8 add macros to read AQA subvalues, is used by nvme_dumpregs() 2016-09-17 23:59:30 +00:00
jdolecek
2242a2738d remove dev code included in previous commit by mistake 2016-09-17 20:15:09 +00:00
jdolecek
c1a81aa609 #ifdef out MSI related code on platforms not supporting MSI, so that it's
possible to load the driver as module on those platforms (the weak symbols
are not found by module load, claiming they don't exist); this makes it possible
to load the driver on e.g. sparc64, which is supposed to be working
under OpenBSD

unfortunately QEMU sparc64 emulator starts causing data access errors
on first device register read in nvme_attach(), so can't confirm the driver
is actually working on sparc64; same happens in QEMU when booting OpenBSD
image, so it seems to be emulator bug
2016-09-17 20:12:53 +00:00
jdolecek
4549505d3a make nvme_dumpregs() compile on LP64 hosts
sprinkle some delays() and extra checks into attach code, so that it follows
more closely what FreeBSD driver does, and is easier to cross-check
2016-09-17 19:52:16 +00:00
kardel
cb3bc0d1c8 ASC/ASCQ table updated from http://www.t10.org/lists/asc-num.txt 2016-07-30 2016-09-17 18:53:13 +00:00
jdolecek
49be6b2296 actually detach the ld {b,c}devsw on unload, and fail load if it's already
present
2016-09-17 12:58:51 +00:00
jdolecek
2cf9f7e548 need to set PCI_COMMAND_MASTER_ENABLE flag; fixes the driver under QEMU 2016-09-17 11:07:42 +00:00
skrll
d883e5109b Update from t-hash with some changes from me. 2016-09-17 06:29:50 +00:00
pgoyette
ffcbcf3569 Since the ld code included with the nvme module references stuff in
the dk_subr module, add a dependency.
2016-09-17 03:02:03 +00:00
pgoyette
0e4cb92ed4 We need sys/module.h for built-in modules as well as for the .kmod so
#include it unconditionally.
2016-09-16 23:20:31 +00:00
jdolecek
47d93d331f change nvme(4) ld to use fcfs as default strategy to lower i/o processing
overhead and hence lower latency; the sorting doesn't provide any benefit
for SSDs
2016-09-16 15:24:47 +00:00
jdolecek
e90b5bdddb modify ldattach() to have default strategy as a parameter 2016-09-16 15:20:50 +00:00
jdolecek
b8b74a3c4e introduce optional timeout for the polled commands; currently 5 seconds for
queue creation/deletion, 10 seconds for controller/namespace identify,
and unlimited for cache sync and passthrough commands

this makes device attach error out instead of hanging the kernel when
the device fails to respond properly, such as under QEMU currently
2016-09-16 12:57:26 +00:00
jdolecek
da4d70cb21 make nvme_dumpregs() compile when NVME_DEBUG is defined 2016-09-16 11:41:40 +00:00
jdolecek
8eedc00a82 make it possible to load nvme(4) as module to ease testing; currently somewhat
non-optimal, since it includes the ld(4) code also and hence requires the
kernel config to have 'no ld'
2016-09-16 11:35:07 +00:00
jdolecek
7a7d1b8dd0 fix nvme_pci_detach() to not pci_intr_disestablish(); the interrupts
are disestablished and handler pointers are set to NULL already by
nvme_detach(), leading to panic here; this was happening when running
on system without MSI/MSI-X

change all the alloc/dealloc code for sc_ih to use psc->psc_nintrs, so
that we avoid some duplicated logic
2016-09-16 10:59:28 +00:00
jdolecek
87d3a42c6b add IO flags for FUA and also LR while here 2016-09-16 10:54:45 +00:00
mlelstv
faca41fb2b Merge enough FreeBSD code to make RT5592 work. 2016-09-16 09:25:30 +00:00
msaitoh
8a17ee670f regen. 2016-09-16 05:42:58 +00:00
msaitoh
9587c2c061 - Add ASMEDIA ASM1083/1085/1142
- Add AMD RADEON 34xx HD Audio
- Add some Intel Core i7-6xxxK devices from "Intel Core i7 Processor Family
  for LGA2011-v3 Socket Datasheet - Volume 2 of 2: Registers"
- Add "Core i7-6xxxK" to some Intel devices' description.
2016-09-16 05:42:22 +00:00
jdolecek
f52dcd49ca remove last isolated islands using BUS_SPACE_BARRIER_SYNC and
BUS_SPACE_BARRIER_X_BEFORE_X - these were only ever defined for mips and ia64,
and never actually implemented even there
2016-09-15 21:45:37 +00:00
mlelstv
f7dd6a088f Fix error handling in cgdstrategy().
- check cgd_softc != NULL, may happen in rare memory shortage situations.
- no longer test geometry, the same check is done in dk_strategy which
  knows to check for an uninitialized geometry.
2016-09-14 23:16:30 +00:00
mlelstv
e371720fc5 Set b_resid in error path. 2016-09-14 23:05:05 +00:00
christos
9d57a94cea Adapt driver to final CPLD implementation. (Felix Deichmann) 2016-09-13 16:54:26 +00:00
skrll
990b8eeb89 tiny KNF 2016-09-13 07:30:32 +00:00
jakllsch
2d874a60e8 Make usscanner(4) useful by also attaching its children. 2016-09-10 15:46:36 +00:00
jakllsch
855b54844a umass(4) can present both atapibus(4) and scsibus(4), so attach cd(4), sd(4),
st(4), uk(4) at each.
2016-09-10 15:45:15 +00:00
jakllsch
db16b934ab Iterate over ia_ncompat array properly. 2016-09-10 13:16:12 +00:00
msaitoh
375093407f HV_OEM_BITS is not page 0 but page 768. 2016-09-09 06:34:10 +00:00
msaitoh
bc91867bec Add code to select page "0" for DDR4 and newer SPD ROM. If the value read
is not suitable as SPD ROM, try to select page 0 and try again. The passed
arguments of iic_exec(SPDCTL_SPA) might not be correct and/or our API of
iic_exec() should be improved. See the comment for the detail.

Use this change until we find a better (or correct?) way.
2016-09-09 05:36:59 +00:00
nonaka
4a15838ffa Fix to cannnot be opened a nvme(4) namespace device file. 2016-09-08 15:00:08 +00:00
nonaka
953af69b87 fix off-by-one error in namespace id range check. 2016-09-08 04:41:16 +00:00
jakllsch
42f53717b1 '#if 0' a static inline function used only by an already #if 0 function. 2016-09-07 14:21:01 +00:00
skrll
fe743c8bf7 Reduce scope of a variable. No functional change. 2016-09-06 06:46:15 +00:00
skrll
1d5354e153 Don't read beyond the end of an array 2016-09-06 06:27:17 +00:00
skrll
1b38ce07c0 kern/51458 (usb athn panic)
initialise buf in usc_tx_cmd
2016-09-05 20:58:51 +00:00
msaitoh
5e0f0bcd7f Fix the first two bytes' definitions of the DDR3 SPD ROM. This was not a real
bug because the definitions haven't used. From JEDEC Standard No. 21-C Annex K:
Serial Presense Detect (SPD) for DDR3 SDRAM Modules Document Release 6.
2016-09-05 04:06:55 +00:00
skrll
127090f73c Fix "spurious event" when command ring rolls over.
When the enqueue pointer of command ring points at the last TRB,
address of Link TRB was stored in sc_command_addr.
It should be address of 0th TRB of ring.

From t-hash
2016-09-03 12:07:41 +00:00
skrll
340c4aca0b Suppress stopping-endpoint in xhci_close_pipe if the endpoint is
already stopped.

From t-hash
2016-09-03 12:06:50 +00:00
skrll
36f4527ff8 Fix some typos. From t-hash. 2016-09-03 12:05:36 +00:00
skrll
cd52ae2b55 Style. No functional change. 2016-09-03 07:29:16 +00:00
skrll
1d28477297 Reduce scope of a variable. No functional change. 2016-09-03 07:23:27 +00:00
skrll
26818383d2 Bail out early from usbd_fill_devinfo if we're not a hub to use less
indentation in the code.

No functional change.  Same code before and after.
2016-09-03 07:20:12 +00:00
skrll
8318f41d96 Use __arraycount. No functional change. 2016-09-03 07:14:19 +00:00
msaitoh
e3883702cf regen. 2016-09-01 10:21:49 +00:00
msaitoh
1279f6d1b4 Add some 1st gen Core PCI devices. Mainly taken from "Intel Core, Pentium
Desktop Processor Series: Datasheet, Vol. 2"
2016-09-01 10:20:26 +00:00
ozaki-r
a3d385cde0 Fix initializing wrong queues
Pointed out by Mike Larkin.

PR kern/51448
2016-08-29 04:21:25 +00:00
skrll
d2a914bf3d Update XHCI_HCS2_MAXSPBUF to grab all the bits (revision 1.1) from
HCSPARAMS2.
2016-08-28 16:41:30 +00:00
skrll
b44d7a60e4 Fix harmless typo 2016-08-27 08:57:21 +00:00
skrll
fe050a90af flxd's axe(4) - I think. 2016-08-27 08:45:59 +00:00
skrll
d4fa68f869 Regen 2016-08-27 08:43:36 +00:00
skrll
6c9ddde92a Add flxd's axe(4) 2016-08-27 08:42:16 +00:00
macallan
a6c81d2139 fix a bunch of bugs & tpyos in chipsfb_mmap() so wsfb can actually work 2016-08-26 22:50:11 +00:00
skrll
4e8b65a17b Adjust evbmips_iointr to pass a clockframe pointer and use it for
pwmclock @ voyager.

Suggested by matt@

Hi macallan!
2016-08-26 15:45:47 +00:00
skrll
adbf506983 Fix scheduling of interrupt transfers. I can now use a hub with my flxd
ISA USB adapter
2016-08-25 20:14:02 +00:00
msaitoh
329fe36ab2 Sync with pcidevs rev. 1.1263. No functional change. 2016-08-23 09:47:50 +00:00
msaitoh
b2b512d615 Remove PCI_PRODUCT_CMDTECH_240's entry because CMDTECH_AAR_1210SA has
the same ID.
2016-08-23 09:46:45 +00:00
msaitoh
28cdbf0cd8 regen. 2016-08-23 09:34:47 +00:00
msaitoh
f09ac2ee6f Fix:
- ATI 0x4394 is AHCI SATA.
- ATI 0x4395 is Storage mode SATA.
2016-08-23 09:34:28 +00:00
msaitoh
fd789a9478 regen. 2016-08-23 09:20:00 +00:00
msaitoh
77fb8c3b5f Fix XE5_V3_IMC1_DDRIO_[34]'s values. 2016-08-23 09:19:44 +00:00
msaitoh
e0cd0693f7 regen. 2016-08-23 09:18:21 +00:00
msaitoh
cd76acd3b9 - Fix entries. The following problems were found while sorting entries:
- Remove the following entries because the value is duplicated:

    CMDTECH_240			(CMDTECH_AAR_1210SA has the same value)
    INTEL_C610_SATA_RAID	(INTEL_82801H_SATA_RAID has the same vaule)
    INTEL_C610_PCIE_1_3		(82801BA_HPB has the same value)
    GEFORCE_610M3		(GEFORCE_610M2 has the same value)

  - RADEON_RV350_NQ is not 0x4e41 but 0x4e51
  - 82801JD_SATA_RAID is not 0x3a02 but 0x3a05.

  - The following two entries have the same number. Fix one of them:

    DH89XXCL_USB_2 to 0x23b5		(was 0x23b4 (== DH89XXCL_USB_1))
    5500_HB to 0x3404 and change the desc (was 0x3403 (== 3400_HB))
    82X58_PCIE_0_1 to 0x3421		(was 0x3420 (== 82X58_PCIE_0_0))
    82801JI_THERMAL to 0x3a32		(was 0x3a30 (== 82801JI_SMB))

- Sort entries in device ID's order.
2016-08-23 09:18:01 +00:00
msaitoh
223fd57db4 Don't follow an incorrect pointer in an extended capability header. Tested
with Super Micro X10SDV-8C-TLN4F bus 255, device 12, function 0 (BIOS 1.1b).
2016-08-22 08:35:42 +00:00
jdolecek
3c404120db extract crc16 code from utoppy driver to a separate file in libkern, for use
by ext2fs; every usage gets their own copy of the table for now, as it's
fairly small, and too rare to be used to be useful pulling into every kernel
2016-08-20 19:44:46 +00:00
msaitoh
7f742aa6cd regen. 2016-08-19 10:22:49 +00:00
msaitoh
9cc25dcbbb Add more Xeon D devices. 2016-08-19 10:22:27 +00:00
jakllsch
91a739399d Reset b_resid when tossing transfer with non-zero b_error. 2016-08-19 03:23:39 +00:00
skrll
8329167f56 Put Link TRB always at the end of ring. Should fix ctrl xfer problem on
Intel xHC.

From t-hash.
2016-08-18 07:18:52 +00:00
skrll
e5efa3b9c9 Byte swap the address in xhci_new_device appropriately. From t-hash 2016-08-18 07:08:32 +00:00
skrll
e02779accf Spelling in comment 2016-08-17 22:02:19 +00:00
msaitoh
490105a602 regen. 2016-08-17 07:55:36 +00:00
msaitoh
326c49a0d9 Update Skylake devices. 2016-08-17 07:55:12 +00:00
msaitoh
3cc204e989 regen. 2016-08-17 06:45:09 +00:00
msaitoh
4d32491dbf Add Xeon D devices. 2016-08-17 06:44:45 +00:00
msaitoh
e60650bd19 Add Dynamic Power Allocation (DPA) ECN support. 2016-08-17 06:32:01 +00:00
jakllsch
c1abcaacd7 Fix fractional temperature conversion.
Previously 0 to 15 whole degrees were added for each 1/16th degree fraction.
2016-08-16 23:47:45 +00:00