summaryrefslogtreecommitdiff
path: root/sys/arch/sgi/dev
AgeCommit message (Collapse)Author
2017-09-08If you use sys/param.h, you don't need sys/types.hTheo de Raadt
2017-07-19Fix memory leak in iec_get(). If MCLGET fails free the mbuf as well.Claudio Jeker
Found by Ilja Van Sprundel OK bluhm@ deraadt@
2017-02-11Always leave one free slot in the Tx ring to avoid ambiguity with ringVisa Hankala
head and tail in the interrupt handler. This fixes an old bug that causes a Tx stall when Tx ring gets full.
2017-02-11Simplify ifq_deq_{begin,rollback,commit} sequence to ifq_dequeue.Visa Hankala
2017-01-22move counting if_opackets next to counting if_obytes in if_enqueue.David Gwynne
this means packets are consistently counted in one place, unlike the many and various ways that drivers thought they should do it. ok mpi@ deraadt@
2016-11-29m_free() and m_freem() test for NULL. Simplify callers which had their ownJonathan Gray
NULL tests. ok mpi@
2016-09-19Remove unused getdev() audio driver functions.Alexandre Ratchov
2016-09-14Remove drain(), query_encoding(), mappage() and get_default_params()Alexandre Ratchov
methods from all audio drivers and from the audio_if structure as they are never called.
2016-04-13G/C IFQ_SET_READY().Martin Pieuchot
2016-01-21Remove now uneeded bus_space_unmap calls in the DS1742W/Origin path thatJonathan Gray
have had uninitialised bus space handle arguments since the mapping became conditional in rev 1.9 confirmed with miod
2015-11-25replace IFF_OACTIVE manipulation with mpsafe operations.David Gwynne
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-24You only need <net/if_dl.h> if you're using LLADDR() or a sockaddr_dl.Martin Pieuchot
2015-11-24The only network driver needing <net/if_types.h> is upl(4) for IFT_OTHER.Martin Pieuchot
2015-11-20shuffle struct ifqueue so in flight mbufs are protected by a mutex.David Gwynne
the code is refactored so the IFQ macros call newly implemented ifq functions. the ifq code is split so each discipline (priq and hfsc in our case) is an opaque set of operations that the common ifq code can call. the common code does the locking, accounting (ifq_len manipulation), and freeing of the mbuf if the disciplines enqueue function rejects it. theyre kind of like bufqs in the block layer with their fifo and nscan disciplines. the new api also supports atomic switching of disciplines at runtime. the hfsc setup in pf_ioctl.c has been tweaked to build a complete hfsc_if structure which it attaches to the send queue in a single operation, rather than attaching to the interface up front and building up a list of queues. the send queue is now mutexed, which raises the expectation that packets can be enqueued or purged on one cpu while another cpu is dequeueing them in a driver for transmission. a lot of drivers use IFQ_POLL to peek at an mbuf and attempt to fit it on the ring before committing to it with a later IFQ_DEQUEUE operation. if the mbuf gets freed in between the POLL and DEQUEUE operations, fireworks will ensue. to avoid this, the ifq api introduces ifq_deq_begin, ifq_deq_rollback, and ifq_deq_commit. ifq_deq_begin allows a driver to take the ifq mutex and get a reference to the mbuf they wish to try and tx. if there's space, they can ifq_deq_commit it to remove the mbuf and release the mutex. if there's no space, ifq_deq_rollback simply releases the mutex. this api was developed to make updating the drivers using IFQ_POLL easy, instead of having to do significant semantic changes to avoid POLL that we cannot test on all the hardware. the common code has been tested pretty hard, and all the driver modifications are straightforward except for de(4). if that breaks it can be dealt with later. ok mpi@ jmatthew@
2015-10-25arp_ifinit() is no longer needed.Martin Pieuchot
2015-09-18Fix an uninitialized variable found by Maxime Villard's Brainy.Visa Hankala
While here, fix the size parameter of bus_dmamem_unmap() in iec_alloc_physical(). ok miod@
2015-09-08sizes for free(); ok semarieTheo de Raadt
2015-06-24Increment if_ipackets in if_input().Martin Pieuchot
Note that pseudo-drivers not using if_input() are not affected by this conversion. ok mikeb@, kettenis@, claudio@, dlg@
2015-05-11Remove all audio format conversion code from the kernel (btw holdingAlexandre Ratchov
the kernel_lock), as we already do better conversions in user-mode. Yet, no need for every single driver to fiddle with the conversion code as they are done transparently by common MI code. With help from armani and miod, support from mpi ok armani@
2015-03-11Convert to if_input(), tested by jasper@.Martin Pieuchot
2015-03-11Convert to if_input(), tested by jasper@, thanks!Martin Pieuchot
2015-02-11no md code wants lockmgr locks, so no md code needs to include sys/lock.hDavid Gwynne
with and ok miod@
2014-12-22unifdef INETTed Unangst
2014-12-13yet more mallocarray() changes.Doug Hogan
ok tedu@ deraadt@
2014-07-22<netinet/in_systm.h> is no longer needed.Martin Pieuchot
2014-07-12add a size argument to free. will be used soon, but for now default to 0.Ted Unangst
after discussions with beck deraadt kettenis.
2014-07-11It's init as a process that's special, not init's original thread.Philip Guenther
Remember initprocess instead of initproc. ok matthew@ blambert@
2014-05-19Format string fixes and removal of -Wno-format for sgi. Based upon anMiod Vallat
initial diff from jasper@
2013-12-29Force clock clamping after one byte received instead of three. There are stillMiod Vallat
circumstances where the pckbc code gets confused otherwise, on *some* controllers.
2013-12-25Instead of deciding which iockbc port is the keyboard port, and which one is theMiod Vallat
mouse port, depending upon the system time, match what the prom is doing and actually probe for a keyboard on both ports, and decide the first port with a keyboard is the keyboard port. If no keyboard is found, but a mouse is found, decide the keyboard port is the empty one. If no device is found, then we can try and pick the defaults, depending upon the system we are running on, as this used to be the case (i.e. coping with Fuel having keyboard on port 1 and mouse on port 0 when connecting devices according to the chassis' markings). This is necessary because different IO9 board revisions on Tezro come with different wirings, and we can not tell these boards apart. Discussed with "nullnilaki" (nullnilaki on gmail) who is the lucky owner of an Onyx 350 with correct wiring and a Tezro with inverted wiring. Tested on Octane and Fuel with all combinations of devices connected (mouse only, keyboard only, keyboard and mouse) in both ports, glass and serial console. XXX We probably want to allow for more pckbd attachment flexibility on non-x86 XXX platforms eventually (at least where the PS/2 slots are really independent, XXX so that we can attach pckbd to any port and better cope with human error XXX when connecting devices.
2013-10-21Add load_font and list_font accessops to all rasops-based wsdisplay drivers.Miod Vallat
Trivial except for tga(4) and gpx(4/vax) which need a bit more care setting up a new font.
2013-10-20Use C99 named initializers for struct wsdisplay_accessops fields.Miod Vallat
No functional change.
2013-08-17Most network drivers include netinet/in_var.h, but apparently theyAlexander Bluhm
don't have to. Remove these include lines from sgi drivers. test jsing@
2013-06-21enable 24-bit, lsb-aligned encoding, which is the device'sAlexandre Ratchov
native one. Allows encoding conversions to be handled in userland
2013-06-11Replace all ovbcopy with memmove; swap the src and dst arguments tooTheo de Raadt
ok otto
2013-05-30Enforce ca_activate tree-walks over the entire heirarchy for all events,Theo de Raadt
cleaning up some shutdown-hook related code on the way. (A few drivers related to sparc are still skipped at kettenis' request) ok kettenis mlarkin, tested by many others too
2013-05-27Correctly specify the visible part of the rightmost tile when the currentMiod Vallat
resolution is not a multiple of the tile size, in emulation (text) mode. The usual 1280x1024 resolution ended up with the correct value, by chance, but a width of 1600 would be wrong. (X11 was running fine) Tested on the 1600x1024 resolution of the 1600SW display. Thanks to Johan Sanchez for lending me a 1600SW monitor and an adapter board.
2013-05-15Introduce a global interrupt-aware mutex protecting dataAlexandre Ratchov
structures (including sound-card registers) from concurent access by syscall and interrupt code-paths. Since critical sections remain the same, calls to splraise/spllower can be safely replaced by calls to mtx_enter/mtx_leave with two exceptions: (1) mutexes are not reentrant (the inner splraise is thus removed), and (2) we're not allowed to sleep with a mutex (either msleep is used or the mutex is released before sleeping). ok and help from kettenis, a lot of work from armani
2012-10-03Don't include <mips64/archtype.h> unless you really need it.Miod Vallat
2012-08-10simplify pckbc_xt_translation()Alexandr Shadchin
* call only for set translation on (once in /sys/dev/pckbd.c) therefore we can delete unused code. * change behavior (more standard) - return zero on success ok miod@
2012-05-29Make it possible to disable the Sync-on-Green signal by setting theMike Belopuhov
ARCBios environment variable OSLoadOptions to "nosog". Now everyone can enjoy running O2 without an SGI monitor and don't turn vegetarian afterwards. All the essential bits come from NetBSD's crmfb driver except they've chosen to use a "SyncOnGreen" variable not saved by the ARCS. Pointers and corrections from and ok miod, jsing
2012-05-22When setting up the multicast filter, use the ac_multicnt field of the arpcomMiod Vallat
struct to know if there are multicast entries, instead of counting the number of entries in the list. No functional change. From brad.
2012-04-19Slightly tweak the emulation mode colormap to have fit in 4:8:4 instead ofMiod Vallat
8:8:8, and use the fast putchar code unconditionally: it turns out it expects the background color as 4:8:4. This fixes the `character background is too green and too light' effect that caused this code path to only be used for black background, and the slower code for the rest.
2012-04-18Split the existing impact@xbow attachment into generic impact routines, andMiod Vallat
bus-specific attachment; impactreg.h and impactvar.h move from sgi/xbow/ to sgi/dev/. Teach the generic impact code how to code with pre-ImpactSR boards, which have a slightly different register layout (information obtained from Peter Fuerst's Linux IP28 patches). Add an impact@gio attachment (unfortunately untested, no Impact GIO boards here). All Indigo 2 graphics options should be supported now (assuming the Extreme/Ultra will actually work with grtwo(4) out of the box). Tested not to disturb operation on IP30. ** ATTENTION! If you are building IP27 or IP30 kernels, be sure to rm impact.d ** before building a new kernel.
2012-04-16Move OpenGL {logic,raster}ops defines to a separate file, to avoid duplicatingMiod Vallat
these among frame buffer drivers. No functional change.
2012-03-28Work in progress support for the SGI Indigo, Indigo 2 and Indy systemsMiod Vallat
(IP20, IP22, IP24) in 64-bit mode, adapated from NetBSD. Currently limited to headless operation, input and video drivers will get ported soon. Should work on all R4000, R4440 and R5000 based systems. L2 cache on R5000SC Indy not supported yet (coming soon), R4600 not supported yet either (coming soon as well). Tested to boot multiuser on: Indigo2 R4000SC, Indy R4000PC, Indy R4000SC, Indy R5000SC, Indigo2 R4400SC. There are still glitches in the Ethernet driver which are being looked at. Expansion support is limited to the GIO E++ board; GIO boards with PCI-GIO bridges not ported yet due to the lack of hardware, and this kind of driver does not port blindly. Most of this work comes from NetBSD, polishing and integration work, as well as putting as many ``R4x00 in 64-bit mode'' erratas as necessary, by yours truly. More work is coming, as well as trying to get some easy way to boot install kernels (as older PROM can only boot ECOFF binaries, which won't do for the kernel).
2012-03-15uncached_base was introduced early in IP27 support, since these designs useMiod Vallat
subspaces in the CCA_NC uncached memory space. However, being coherent, there was never a need for bus_dma to use uncached addresses. This means that, on the only systems where uncached_base was not set to PHYS_TO_XKPHYS(0, CCA_NC), it was never used. Remove the variable, and replace PHYS_TO_UNCACHED() with PHYS_TO_XKPHYS(, CCA_NC). No functional change.
2011-06-24machdep.kbdreset enables a shutdown by Ctrl-Alt-Del on amd64 andChristian Weisgerber
i386. Stop abusing it on other archs for controling a shutdown by pressing the soft power button: * Add a MI sysctl hw.allowpowerdown; if set to 1 (the default) it allows a power button shutdown. * Make acpi(4)/acpibtn(4) honor hw.allowpowerdown. * Switch the various power button intercepts on landisk, sgi, sparc64 and zaurus over to hw.allowpowerdown. * Garbage collect the machdep.kbdreset sysctl on all archs other than amd64 and i386. ok miod@
2011-04-07Do not use NULL in integer comparisons. No functional change.Miod Vallat
ok matthew@ tedu@, also eyeballed by at least krw@ oga@ kettenis@ jsg@
2010-12-26Kill pmap_phys_address(), and force every driver's mmap() routine to returnMiod Vallat
a physical address [more precisely, something suitable to pass to pmap_enter()'sphysical address argument]. This allows MI drivers to implement mmap() routines without having to know about the pmap_phys_address() implementation and #ifdef obfuscation.