Commit graph

371 commits

Author SHA1 Message Date
cinap_lenrek 14650e9c25 pci: Add Intel C216 chipset PCI support (from sources) 2013-04-12 23:07:40 +02:00
cinap_lenrek e60f177ad2 etheriwl: add pci id for Centrino Wireless-N 100 (thanks fgudin9) 2013-04-10 22:13:54 +02:00
cinap_lenrek 6bef56f037 intel ethernet: default to 16 byte cache line size when not properly initialized and disable checksum offload for igbe (from sources) 2013-04-03 21:51:42 +02:00
cinap_lenrek 81b394f30a pci: add pci bridge id for Intel 6 Series/C200 (from sources) 2013-04-03 21:47:50 +02:00
ppatience0 c70c20de12 ether82563: add untested devices from OpenBSD's em(4) Intel driver. also update some names according to OpenBSD's driver (previously added device, 0x10c0, is also from OpenBSD's driver). 2013-03-30 22:50:48 -04:00
ppatience0 10987d2dc7 ether82563: add 82562V-2 did 2013-03-24 01:51:43 -04:00
cinap_lenrek b9214d6662 wifi: cleanup
cleanup wifiencrypt()/wifidecrypt() routines moving tkip
and ccmp in separate routines so we dont use less stack
space.
2013-03-24 21:59:47 +01:00
cinap_lenrek 66a3ffe248 unrolling loops in aesCCMencrypt() and aesCCMdecrypt()
do the xoring word wise for 16-byte block instead
of doing it bytewise in a loop.
2013-03-23 20:52:54 +01:00
cinap_lenrek 49a4ac0728 wpa2 support continued... 2013-03-23 04:30:20 +01:00
cinap_lenrek e7131e9313 add experimental wpa2/ccmp support 2013-03-23 04:27:49 +01:00
cinap_lenrek f37465fd7f sysexec: fix possible segment overlap with temporary stack
the kernel uses fixed area (TSTKTOP, TSTKSIZ) of the address
space to temporarily map the new stack segment for exec. for
386 and arm, this area was right below the stack segment which
has the problem that the program can map arbitrary segments
there (even readonly).

alpha and ppc dont have this problem as they map the temporary
exec stack *above* the user reachable stack segement and segattach
prevents one from mapping anything above or overlaping the stack.

lots of arch code assumes USTKTOP being the end of userspace
address space and changing this to TSTKTOP would work, but results
in lots of hard to test changes.

instead, we'r going to map the temporary stack programmatically
finding a hole in the address space where to map it. we also lift
the size limitation for arguments and allow arguments to fill
the whole new stack segement.

the TSTKTOP and TSTKSIZ are not used anymore so they where removed.

references:

http://9fans.net/archive/2013/03/203
http://9fans.net/archive/2013/03/202
http://9fans.net/archive/2013/03/197
http://9fans.net/archive/2013/03/195
http://9fans.net/archive/2013/03/181
2013-03-16 02:37:07 +01:00
cinap_lenrek f0303b65ca merge 2013-03-12 21:08:47 +01:00
cinap_lenrek da66a67a94 ether8169: add RTL8101/8102E macid 2013-03-12 21:07:40 +01:00
ftrvxmtrx f28ccb0ed9 etheriwl: 6005 - set rom calibration flags and temperature sensor offset 2013-03-12 00:14:55 +01:00
cinap_lenrek 26792d8db5 wifi: add experimental wpa / tkip encryption support 2013-03-09 17:28:41 +01:00
cinap_lenrek 5c4f2f9d35 sdiahci: only wait for drives that are in the process of becoming ready when onlining, add *noahci option 2013-02-23 14:05:51 +01:00
ppatience0 82c816d15c ether8169: add another RTL8111/8168B mac id 2013-02-22 01:14:31 -05:00
cinap_lenrek 3612d281aa sdiahci: fix mistake 2013-02-22 13:47:04 +01:00
cinap_lenrek f5ff6d6f34 sdiahci: prevent nil pointer dereference on spurious interrupt status
on some controllers, we get bogus interrupt indication
for non present drives. ack the irq but ignore.
2013-02-22 12:23:01 +01:00
cinap_lenrek 56d9f57dc8 ether8169: add RTL8111e mac id (thanks glorfdev for the patch) 2013-02-22 10:37:47 +01:00
cinap_lenrek 00ba1aac9e etheriwl: fix rominit
we used use the *last* block in otp block list instead of
the block *before* the last block resulting in wrong eeprom
data (1000er series only)
2013-02-19 07:57:30 +01:00
khm e68130f082 add wifi link 1000 pci id 2013-02-18 21:04:19 -05:00
cinap_lenrek 012273f39d etheriwl: simplify 2013-02-16 21:37:36 +01:00
cinap_lenrek c5c9233c3d etheriwl: add otp rom initialization (for 1000er series, untested) 2013-02-16 21:16:05 +01:00
cinap_lenrek f6290afb14 etheriwl: use first available antenna from eeprom txantmask instead of hardcode to antenna A 2013-02-16 04:42:42 +01:00
ftrvxmtrx a8d97f31f6 etheriwl: move runtime dc calibration block to proper place 2013-02-16 03:28:21 +01:00
ftrvxmtrx d676eaf59a etheriwl: support for Centrino Advanced-N 6205 2013-02-16 02:56:40 +01:00
cinap_lenrek 126d7e6feb etheriwl: avoid leaking blocks when controller breaks 2013-02-15 22:56:54 +01:00
cinap_lenrek 8deac637d7 merge 2013-02-15 22:21:45 +01:00
cinap_lenrek 9bcf45da9a etheriwl: fix bugs, support for Centrino Ultimate-N 6300 2013-02-15 22:20:25 +01:00
ftrvxmtrx e712752229 pci: add intel qm67 pch 2013-02-14 01:04:45 +01:00
ppatience0 6d7bb96b22 merge 2013-02-13 07:37:26 -05:00
ppatience0 0734a0b836 ether8169: support for RTL8111/8168B 2013-02-13 07:12:51 -05:00
cinap_lenrek 0243f52bae etheriwl: dont let transmit change back receiver settings when in promisc mode, cleanup 2013-02-13 08:23:54 +01:00
cinap_lenrek 78fc90ec86 etheriwl: support for WiFi Link 4965 2013-02-12 14:28:22 +01:00
cinap_lenrek 8d271549cd wifi: filter SNAP ethernet orgcode only 2013-02-11 16:02:16 +01:00
cinap_lenrek 1f6a402c46 wifi: reset status when clearing essid 2013-02-11 02:10:36 +01:00
cinap_lenrek 6e0835f7d8 wifi: clear out ssid in node table entry, cleanup 2013-02-11 02:02:44 +01:00
cinap_lenrek 3376977d06 wifi: actually check if management replies are for us 2013-02-11 01:29:10 +01:00
cinap_lenrek ffb3ded366 etheriwl: automatic channel scanning, transmission handling, promisc mode
the channel= plan9.ini parameter isnt needed anymore as we now
hop the channels to scan for beacons. the status is also indicated
with the link led :-)

handle all these flags on packet transmission like RTS for big
packets and sending data packets to the AP instead of broadcasting
everything.

properly setup bss hardware node table and filtering. now promisc
mode is only used when requested.

handle deauth message from ap.

increase node table to 32 entries.
2013-02-11 00:09:41 +01:00
stanley lieber c2f5d36d7f fix typo 2013-02-09 23:34:15 -06:00
cinap_lenrek 972e4e75ee merge 2013-02-10 05:05:40 +01:00
cinap_lenrek ccbfdd9e91 wifi: lie a bit more about the supported rates to get into more ap's 2013-02-10 04:55:57 +01:00
stanley lieber 20d2f551c2 add Intel (R) WiFi Link 5100 AGN, vid/did: 8086/4237 2013-02-09 21:54:44 -06:00
cinap_lenrek 97d136fb21 etheriwl: implement 4965 firmware bootstrap (untested) 2013-02-10 01:26:28 +01:00
cinap_lenrek 6ffe4e58b3 etheriwl: check RF-Kill switch on attach 2013-02-10 00:14:17 +01:00
cinap_lenrek 4204572000 etheriwl: fix mistake 2013-02-10 23:38:08 +01:00
cinap_lenrek 3a697585f0 etheriwl: work towards supporting other cards than 5300, gather channel information 2013-02-10 23:02:21 +01:00
cinap_lenrek ab6a2eb0b6 etheriwl: fix command queue handling
we have to decrement the queue counter for all tx rings
*including* the command ring 4.

zero the command buffer for the crystal callibration
command.
2013-02-09 19:12:51 +01:00
cinap_lenrek 09a5825832 etheriwl: experimental intel wifi link driver 2013-02-09 03:19:50 +01:00
cinap_lenrek d41f67c2b9 audio: fix delay control, increase default buffer delay to 40ms
just doing a single sleep isnt enougth, as we get woken
up for every block!
2013-02-01 15:23:38 +01:00
cinap_lenrek bc0e5ffa22 audiohda: fix vid typo 1003 -> 1003 2013-01-29 21:59:34 +01:00
cinap_lenrek bf37280c25 audiohda: add pci id for Intel P55 chipset and ATI HDMI (Radeon HD 8500) 2013-01-29 21:56:02 +01:00
cinap_lenrek 50cf738d69 acpi: remove "cannot get pci bus number for ..." debug prints
on almost all machines, we get tons of these prints for pci busses that
are not physically there but are described in the ACPI namespace. the
reason that we enumerate these is because we do not enumerate _INI and _STA
methods to check if they are present. we just match the information with
the PCI devices we enumerated with our generic pci code. this works fine and
doesnt require aml code to poke arround in pci config space.
2013-01-29 18:24:48 +01:00
cinap_lenrek c1cb685a32 audioac97: fix inverted recgain control, init to zero recgain
some controls are inverted. we reflect this by specifying
negative range in the volume table now and let genaudiovolread()
and genaudiovolwrite() do the conversion.
2013-01-27 17:20:42 +01:00
cinap_lenrek 866ee3ab5d audioac97, audiohda: dont block on close, just pad the last block with zeros 2013-01-27 14:00:42 +01:00
cinap_lenrek 361e029541 audioac97: set adc rate
set adc (recording) sample rate the same as playback for now.
make these separate entries later when we reintroduce in/out
attributes to volume controls.
2013-01-21 16:16:59 +01:00
cinap_lenrek 8cafbf3184 audiohda: automatically pick inpin 2013-01-19 02:30:33 +01:00
cinap_lenrek 1f8313acc1 audio: add port/audioif.h dependencies to mkfile 2013-01-19 01:23:34 +01:00
cinap_lenrek e4875c1ae7 audiohda: first attempt on audio recording support for intel hda audio, distinguish mode in audio code 2013-01-19 01:12:39 +01:00
cinap_lenrek 6a0e85ad9c audioac97: audio recording 2013-01-18 13:12:41 +01:00
cinap_lenrek aa0627162b remove non standard COM3 (eia2) serial port from i8250 uart.
access to non standard serial port COM3 at i/o port 0x200 causes
kernel panic on some machines (Toshiba Sattelite 1415-S115). also,
some machines have gameport at 0x200.

i readded uartisa to the pcf and pccpuf kernel configurations so
one can use plan9.ini to add non standard uarts like:

uart2=type=isa port=0x200 irq=5
2013-01-13 10:23:31 +01:00
cinap_lenrek d1665eaf4d add intel 82598 10gb ethernet to pcf and pccpuf configuration, add support for 82599 (from sources) 2013-01-09 06:41:37 +01:00
cinap_lenrek 0d5c57a132 vga: dont confuse io bar with mem bar in vgas3 and vgavesa
harmless bug. just make sure we loop over the memory
bars only and skip the io bars.
2013-01-06 23:39:02 +01:00
cinap_lenrek 6172dbd996 sdiahci: do port reset on stuck drive on boot 2013-01-04 23:09:16 +01:00
cinap_lenrek 34d0aae672 devvga: check if screen is setup before accepting hwgc vgactl 2013-01-03 15:33:51 +01:00
cinap_lenrek 2a1b43ad98 vga: make kernel vga drivers more stupid
previously, we had to maintain 3 sets of pci vid/did's:

1) in /lib/vgadb for detection
2) in the userspace driver in aux/vga
3) in the kernel mode driver

this change makes the kernel mode driver more dumb in
the cases where possible. we let userspace do the pci
enumeration and if needed, it can set the pci address
of the vga card. kernel mode drivers can assume to get
the right pci device passed in scr->pci for enable()
and linear() functions and just do very basic sanity
checking before mapping framebuffer and mmio regions.

vgalinearpciid() was removed as userspace is responsible
to pick pci device.

theres a new vgactl message "pcidev" where userspace
can set the bus address. we initialize scr->pci in
vgareset() to the first pci graphics card found. this
should cover cases when an old aux/vga binary is used
that doesnt use the new pcidev message.

userspace drivers will now use the pci device that got
a match from /lib/vgadb and skip ther own enumeration.
this way, vga cards can be made to work by simply adding
an entry in vgadb with no need to modify userspace or
kernelspace drivers. this is not always possible if
the driver derives information from the specific card
model.
2013-01-02 01:19:51 +01:00
cinap_lenrek b821a76824 ether82563: fix phyerrata() 2012-12-31 21:50:08 +01:00
cinap_lenrek 6cadd03bbe fix utf and rune handling in preparation for 32bit runes 2012-12-31 21:09:46 +01:00
cinap_lenrek 6d99096136 sdiahci: add pci did for 82801fbm (ich6) SATA controller 2012-12-31 03:58:01 +01:00
cinap_lenrek 9ea4028246 ether82567: x200 ethernet (thanks ftrvxmtrx)
Apparently i82567m ether (ich9) _has_ flash. Provided patch fixes the ethernet for Thinkpad X200.
2012-12-29 12:02:59 +01:00
cinap_lenrek ec6714f5ed sdahci: fix mistake 2012-12-29 11:27:24 +01:00
cinap_lenrek b7b2fea16f sdahci: get dvd drive to work with x301 2012-12-28 03:54:06 +01:00
cinap_lenrek f9b9cab6a1 sdide: confusion 2012-12-28 03:39:39 +01:00
cinap_lenrek 1c090cd04f sdide: packet io byte count.
instead of setting the packet io byte count to some bullshit
value, use the dlen from the scsi request. limit transfer
byte count to 32k for atapi.
2012-12-26 17:58:15 +01:00
cinap_lenrek e7348f8ed2 sdiahci: prevent x301 dvd-ram from hanging machine
matushita dvd-ram on thinkpad x301 hangs on the inquiry command
done from scsiverify(). not sure whats wrong with it, but at least
this makes the machine boot.
2012-12-25 00:22:32 +01:00
cinap_lenrek f379992fcd adiahci: drive onlining, task file error (atapi) handling, missed interrupts, bios handoff, idle, cleanup
wait for the drives to become ready or missing in iaonline()
and iaverify() to prevent nobootprompt= race.

handle task file error status (this can happen for atapi)
under some circumstances and would hang the io if not
handled.

preventively poll interrupts from the checkdrive kproc in
case we loose interrupts (bad via machine).

implement bios handoff procedure.

make sure the port is idle before programming the port dma
regios in configdrive(), do not start command processing
on the port unless phylink has been established.
2012-12-24 18:07:18 +01:00
cinap_lenrek 9465269c40 ethervgbe: fix broken rx block handling 2012-12-20 09:44:10 +01:00
cinap_lenrek 30b8fa0eef pci: add southbridge for Viatech VT8235 2012-12-19 00:35:53 +01:00
cinap_lenrek 5d27a5972d pci: add southbridge for intel 82hb65 cougar point pch (thanks ftrvxmtrx) 2012-12-19 00:09:42 +01:00
cinap_lenrek 5d78632d41 pci: add Viatech VT8251 south bridge 2012-12-17 07:51:40 +01:00
cinap_lenrek 8f0ed00420 audiohda: add support for PCH (Dell E5420) 2012-12-10 10:01:52 +01:00
cinap_lenrek 3bf1e0798b audiohda: pikeshedding
use seprint() for audiostat.
2012-12-07 00:56:26 +01:00
cinap_lenrek 62721182c4 audiohda: fix getoutamprange()
same problem as previous commit. have to query
function group if not Wampovrcap.
2012-12-07 00:36:15 +01:00
cinap_lenrek 29aa499682 audiohda: handle default amp settings
widgets that do not have Wampovrcap have ther default
amplifier parameters stored in the aydio function group.
only if the amp override bit is *not* set, then the widget
stores its own amplifier parameters and we have to query
its node id, otherwise the audio function group node id.
2012-12-07 00:12:16 +01:00
cinap_lenrek 5a138029db move devusb to port
moved devusb to port, shifting the responsibility of how
to enable interrupts to the arch specific hci driver.
2012-12-06 18:53:17 +01:00
cinap_lenrek 75b1ec6716 audiohda: dont xspanalloc() Ctlr structure
theres no requirement for the Ctlr structure to be 8 byte aligned.
its not passed to hardware.
2012-12-06 17:19:13 +01:00
cinap_lenrek 50c9769bbd sdiahci: fix staggered spinup wait loop, fix confusion
setting Asud in the cmd register is not needed, because
Apwr is (Asud|Apod) already. the problem really was that
the drive comes up with sstatus Spresent (001), so we never
spun it up because (p->sstatus & Sphylink) == 0 was never
met (Sphylink being a mask (011) overlaping Spresent bit).

the spinup wait loop has to run only for the staggered spinup
case (h->cap & Hss) and it should wait for the drive to be
detected by the phy, not just cold presence detect.
2012-12-02 04:50:37 +01:00
cinap_lenrek a9206fa5ad sdiahci: make drive dvd drive spinup work, add *ahcidebug= boot parameter
thinkpad r400 dvd drive was not recognized. port status
indicated present device but no Sphylink because the
device did not spin up. setting the Asud bit in ahciconfigdrive()
made it come up clean.

add scsciverify() call in iaverify() for atapi inquiry.

keep in some of the debug prints and add a *ahcidebug= boot
parameter to enable them.
2012-12-02 01:39:03 +01:00
cinap_lenrek f98bdfece0 audiohda: add pci vid/did for lenovo thinkpad x230t 2012-11-28 01:20:58 +01:00
cinap_lenrek ffa54947bc usbehci: fix broken bios takeover
bios takeover was broken. bad Ceecpmask (was 8, should be 0xFF)
causing it to miss the legacy control ecap and properly take
overship of the controller. also the order seems wrong, we
have to takeover before we do anything with the controller.

remove the pci config space 0xc0 = 0x2000 write. this the
uhci legacy register. its not anywhere in the ehci spec.
2012-11-25 16:24:10 +01:00
cinap_lenrek f8f118423c usbohci: revert td overrun error handling change from sources
regarding the ohci spec, a overrun td might supply a full
packet of data. this change seemed to have caused nusb/kb to
fail with getting spurious zero byte reads. reverting for now.
2012-11-24 16:41:38 +01:00
cinap_lenrek f37d68003d usbohci: implement smm handover, timeouts, donehead dequeue.
implement SMM emulation driver handover in ohcireset(). this fixes
hang and defunct internal keyboard problems on a acer notebook.

dont spin forever waiting for the controller on soft reset in init().

check both, donehead pointer *and* interrupt status for
processed td event (Wdh) similar to the ohci spec example for
processed tds and unlink immidiately. acknowledge *all* the
interrupt status bits before masking. mask out unhandled
events.

various stuff:

check for christmas light interrupt status (cardbus controller
removed?)

add (missing?) break for Tddataovr error case in qhinterrupt().
(changed on sources, not clear why?)

mask interrupt events on shutdown() (from sources).
2012-11-24 03:51:57 +01:00
cinap_lenrek 4b4070a8b9 ratrace: fix race conditions and range check
the syscallno check in syscallfmt() was wrong. the unsigned
syscall number was cast to an signed integer. so negative
values would pass the check provoking bad memory access from
kernel. the check also has an off by one. one has to check
syscallno >= nsyscalls instead of syscallno > nsyscalls.

access to the p->syscalltrace string was not protected
from modification in devproc. you could awake the process
and cause it to free the string giving an opportunity for
the kernel to access bad memory. or someone could kill the
process (pexit would just free it).

now the string is protected by the usual p->debug qlock. we
also keep the string arround until it is overwritten again
or the process exists. this has the nice side effect that
one can inspect it after the process crashed.

another problem was that our validaddr() would error() instead
of pexiting the current process. the code was changed to only
access up->s.args after it was validated and copied instead of
accessing the user stack directly. this also prevents a sneaky
multithreaded process from chaning the arguments under us.

in case our validaddr() errors, we cannot assume valid user
stack after the waserror() if block. use up->s.arg[0] for the
noted() call to avoid bad access.
2012-11-23 20:27:09 +01:00
cinap_lenrek 83ffc3a1da pc kernel: make imagemem maxsize 10% less of mainmem maxsize 2012-10-06 07:05:08 +02:00
cinap_lenrek 9e7ecc41d5 devproc buffer overflow, strncpy
in devproc status read handler the p->status, p->text and p->user
could overflow the local statbuf buffer as they where copied into
it with code like: memmove(statbuf+someoff, p->text, strlen(p->text)).
now using readstr() which will truncate if the string is too long.

make strncpy() usage consistent, make sure results are always null
terminated.
2012-10-01 02:52:05 +02:00
cinap_lenrek 347ac6ef58 guesscpuhz(), apm suspend
use fastclock timer (pit2) to measure cpufreq in guesscpuhz(). this
gives a bigger period minimizing the danger of overrun as pit2 runs
at the constant maximum period of 0x10000 ticks. also use smaller
loop increments (1000) and bigger maximum loop upper bound.

move the loops < ... check to the bottom of the loop so we get the
effective count *before* adding the next loop increment.

ilock() while doing measurements in guesscpuhz() to prevent accidents
with other processors reading fastclock or doing guesscpuhz()
in parralel.

export new i8253reset() function for apm to reset the timers after
a apm bios suspend.
2012-09-30 19:41:34 +02:00
cinap_lenrek 2204bb7321 ether82557: timeout for ifstats DumpSC command 2012-09-30 16:16:20 +02:00
google c3cd4fe746 fix typo. 2012-09-19 21:13:36 +12:00
google 1f7eb17f4b Enable busmastering for SCH (Poulsbo) PATA controller. 2012-09-19 21:07:44 +12:00