Commit Graph

25094 Commits

Author SHA1 Message Date
tsutsui
200d1adc6c Add hardware checksum support for newer PCIe 8168/8111/8102 chips,
per device info taken from FreeBSD driver.  Tested by snj@ on 8111C.

Should closes PR kern/40955.

Note on old 8169 chips IP hw csum must be enabled to use TCP/UDP hw csums,
but I'm not sure if these newer chips still have the same restriction.
2009-03-21 07:58:30 +00:00
drochner
44eb10764a Putting a device into the unconfigured state by an ioctl seems legitimate,
so check for a non-NULL configuration descriptor before dereferencing.
Should fix a crash reported by Nicolas Joly per PR kern/41048.
(It still doesn't look good that the ioctl which unconfigures the device
returns EIO -- either it is legitimate or it isn't -- but since this
is a pullup candidate I don't dare to change user visible behaviour.)
2009-03-20 20:47:43 +00:00
tsutsui
3c5f553e65 Try to avoid zstty hangs on higher speed:
z8530sc.c:
 Check pending interrupts in a loop until all requests are handled.
 The old comments said it would cause horrible latency to sun3x floppy etc,
 but serial ports should have higher priority than disks anyway.

z8530tty.c:
 Don't enable and disable TX interrupts on each transmit start and completion
 because it could cause possible race conditions.
 Instead, set ZSWR0_RESET_TXINT on each TIE interrupt to clear the request
 as other kbd drivers attached at zs(4).

Tested on cobalt, macppc, news68k, sparc, and sun3.
2009-03-20 16:28:57 +00:00
msaitoh
4a8c9df3c3 Examine the management mode and mark DRV_LOAD (for ICH{8,9,10},80003,
8257{1,2,3,4}).

Add some error's printf().

Make the bank detect routine into the function.
2009-03-20 07:29:15 +00:00
tsutsui
4b2a9ec9d1 Access LDPS register in re_reset() only on 8169S single chip variants.
From OpenBSD and FreeBSD drivers via PR kern/41009, and
Realtek-supplied FreeBSD driver.
2009-03-20 06:31:31 +00:00
msaitoh
8a7c1f65b7 On i82563, the em driver says that the ready bit in the MDIC register may be
incorrectly set. Insert delay(200) like the em driver. Fixes PR#41014.
2009-03-20 06:27:53 +00:00
cegger
4f9cf8aa30 Correct bungled bcopy() -> memcpy() conversion 2009-03-20 05:26:37 +00:00
tsutsui
b1063595a6 Add braces missed on RX hardware cksum support.
Fixes RX failure on 82557/82558.
2009-03-19 15:28:04 +00:00
cegger
e2cb85904d bcopy -> memcpy 2009-03-18 17:06:41 +00:00
cegger
c363a9cb62 bzero -> memset 2009-03-18 16:00:08 +00:00
cegger
35fb64746b bcmp -> memcmp 2009-03-18 15:14:29 +00:00
cegger
a1f5aecf36 buildfix: undo previous 2009-03-18 10:41:46 +00:00
cegger
df7f595ecd Ansify function definitions w/o arguments. Generated with sed. 2009-03-18 10:22:21 +00:00
reinoud
83969672ba Fix long standing problem with CD/DVD writing with `dd'. If done this way the
device will remain in a wait-for-more-stuff-to-be-written state delaying other
SCSI calls, esp. some read-size or read-layout calls, until its told there is
no more comming.

To fix this, on last close explicitly flush the caches releasing the device
from this mode and allowing other SCSI commands to reach it.

This fixes PR 40528
2009-03-17 21:25:47 +00:00
dyoung
018696dd66 Handle child-detachment by NULL'ing the child pointer so that
auich_detach() does not subsequently dereference a dangling pointer.
2009-03-17 19:38:34 +00:00
dyoung
4a8da47938 Expand a lot of macros from sys/dev/usb/usb_port.h.
Handle child-detachment by NULL'ing the child pointer, so that
umass_detach() will not subsequently dereference the dangling
pointer.
2009-03-17 19:12:17 +00:00
dsl
98ae204731 Add some 'int' into function definitions where the K&R one didn't
specify a type.
2009-03-17 18:19:15 +00:00
dsl
7cc9af7d64 ANSIfy functions with function-pointer arguments 2009-03-16 23:11:09 +00:00
tsutsui
7a44ef30a5 Pull a fix from hme.c rev 1.73 (to #if 0'ed out part):
> Fix a bug in calculation of checksum deduction:
> - To get 16 bit one's complement value from uint32_t variable,
>   higher 16 bits should be ignored.
> - RFC 1624 describes methods to recalculate checksum field in headers,
>   i.e. one's complement of one's complement sum that could be 0x0000,
>   but we don't have to use the strategy to deduct one's complement sum
>   itself which won't be zero but should be 0xffff.
2009-03-16 12:13:04 +00:00
tsutsui
24a0836984 Fix a bug in calculation of checksum deduction:
- To get 16 bit one's complement value from uint32_t variable,
  higher 16 bits should be ignored.
- RFC 1624 describes methods to recalculate checksum field in headers,
  i.e. one's complement of one's complement sum that could be 0x0000,
  but we don't have to use the strategy to deduct one's complement sum
  itself which won't be zero but should be 0xffff.

Found on debugging mec(4) on sgimips O2.
2009-03-16 12:02:00 +00:00
cegger
05d33dc7bf ansify function definitions 2009-03-16 09:32:38 +00:00
cegger
dc56dbbd97 ansify function definitions 2009-03-15 21:23:31 +00:00
cegger
d3189d3544 ansify function definitions 2009-03-15 20:30:05 +00:00
cegger
317b4e018f ansify function definitions 2009-03-15 17:24:43 +00:00
cegger
b8817e4aed ansify function definitions 2009-03-15 17:14:40 +00:00
cegger
4b83748ce5 ansify function definitions 2009-03-15 15:52:12 +00:00
cegger
f7d20361b0 ansify function definitions 2009-03-15 15:40:33 +00:00
tsutsui
8d2f130b12 Tweak comments and conditionals about EXT_RFA and IPCB. 2009-03-15 14:48:11 +00:00
tsutsui
3acfa89d3b Adjust comments about sc_flags. 2009-03-15 14:18:38 +00:00
dsl
82357f6d42 ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
2009-03-14 21:04:01 +00:00
apb
2a86bfea6b Add FSYNC_CACHE flag to the VOP_FSYNC() call for the DIOCCACHESYNC ioctl.
PR 41015.
2009-03-14 18:00:37 +00:00
apb
caccc8126b Pass DIOCCACHESYNC ioctl down to the underlying disk.
Addresses PR 41016.
2009-03-14 17:56:47 +00:00
christos
19b058b35e PR/41015: Alan Barrett: vnd driver does not implement DIOCCACHESYNC 2009-03-14 16:33:25 +00:00
dsl
454af1c0e8 Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
2009-03-14 15:35:58 +00:00
dsl
02cdf4d2c8 Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
2009-03-14 14:45:51 +00:00
jmcneill
8cf7d77c2c Don't assume ACPI == x86, from kiyohara@kk.iij4u.or.jp 2009-03-14 13:56:41 +00:00
ad
0fa70e9b6f 'boot -z' bogons 2009-03-14 11:08:28 +00:00
jmcneill
b33d444d81 PR# kern/41008: possible simple mistake of field check in video(9)
video_set_format() requires hw->set_format to be set, not get_format,
from fukumoto@imasy.or.jp
2009-03-14 00:33:25 +00:00
jym
96f9080096 Fixes in the iwi(4) driver to better handle errors:
- bus_dmamap fixes, with checks against NULL
- move the rings' allocation code later in iwi_attach() to avoid NULL pointer
dereference if allocation fails
- avoid double free() in case of failure during attach. If an allocation fails,
do not free the ring directly, as it is handled by iwi_detach()
- only set ring->count for RX/TX rings when ring allocation is successful, or
else the for loop during detach will fail with a NULL dereference.
- call pci_intr_disestablish() if iwi_reset() fails during attach; driver is
in an incoherent state, interrupt handler should not be used.

Proposed by me on tech-net@, approved by christos@. Compiled and tested
with GENERIC and XEN3_DOM0 kernels.
2009-03-13 21:57:07 +00:00
yamt
34ccaa3db1 tprof_stop1: add an assertion. 2009-03-13 11:06:26 +00:00
bsh
01bbe49d65 Turn off interrupt disable bit in command status reg.
This is necessary to make S-ATA drives work on some motherboards with
SiS964 including my ASUS P4S800D.
2009-03-12 15:02:42 +00:00
jmcneill
143d119885 Add 'alternative memory' disk device driver. 2009-03-12 00:15:07 +00:00
yamt
0bbefb72ab fix breakage where db_regs_t != trapframe.
the problem pointed out by Martin Husemann on tech-kern@.
2009-03-11 13:48:47 +00:00
tsutsui
b057550bcf u_intNN_t -> uintNN_t 2009-03-11 13:12:41 +00:00
yamt
e1b625b4bc - adapt to MODULAR.
- some preparations to have more backends.
- add some comments.
2009-03-10 14:45:02 +00:00
msaitoh
9d35632b3f add an entry for 82567LF-3.
fix the register access for ICH10DO.
2009-03-10 03:41:50 +00:00
msaitoh
76b6d5d63e regen 2009-03-10 03:31:36 +00:00
msaitoh
9036c274a6 add i82567LF-3 LAN Controller 2009-03-10 03:30:55 +00:00
uebayasi
143d2214bf These don't need <sys/tty.h>. 2009-03-09 15:59:33 +00:00
christos
049ae3d056 Match Inter 82965PM, from Anon Ymous 2009-03-09 13:13:25 +00:00