Commit Graph

449 Commits

Author SHA1 Message Date
gmcgarry 0de5da9678 Replace most gcc-specific __attribute__ uses with BSD-style sys/cdef.h
preprocessor macros.
2008-09-08 23:36:53 +00:00
plunky c4df96ad44 change licence of my old code to two-clause BSD licence
remove my name from advertising list
2008-07-02 10:16:20 +00:00
cegger 708f88d69f use device_lookup_private to get softc 2008-06-12 23:06:14 +00:00
drochner 1a9e64b4a7 mechanical changes to use device_private() or device_lookup_private()
to get softcs, makes the code compile under the stricter type checking
introduced earlier today
2008-06-11 21:25:31 +00:00
cegger 96434039ad - use device_lookup_private to get softc
- ansify
fixes build errors about pointer type mismatches in assignment
2008-06-11 18:50:59 +00:00
mrg c2b95373bf remove clause #3 from my license where there are no other
copyright holders involved.
2008-05-29 14:51:25 +00:00
ad 5e4b324300 Properly fix the "hanging in tty" bug that was worked around with cv_wakeup()
some time again.
2008-05-25 19:22:21 +00:00
macallan 84e564d335 device_t 2008-05-17 18:09:03 +00:00
macallan dcb185e70d unbork previous by actually using CFATTACH_DECL_NEW(). Doh. 2008-05-17 17:55:50 +00:00
macallan a4e1a9b84e magic number reduction - no functional change 2008-05-17 02:00:08 +00:00
macallan f0f02f069c don't map more video memory than we really need 2008-05-17 00:22:31 +00:00
macallan 0c74b4e4a7 struct device * -> device_t 2008-05-16 15:57:21 +00:00
macallan e3c6619b77 struct device * -> device_t 2008-05-16 15:38:20 +00:00
macallan 042c09add2 move to 2 clause license 2008-05-09 03:12:49 +00:00
jdc 93d3122a7c Add more initialisation steps (read reset register; pause; set burst size
in config register).

This fixes the continuous interrupt stream previously seen.  It is now
possible to run `ifconfig gem0 up`.  However, "gem0: device timeout"
messages appear and we don't appear to receive any interrupts.
2008-05-06 21:24:40 +00:00
xtraeme dd178c786e mii_dev is a device_t now. 2008-05-04 17:14:41 +00:00
ad bf6eb72289 Another compile fix. 2008-04-29 18:07:11 +00:00
martin cf6ae11aea Pass the "right" softc to the soft interrupt handler 2008-04-29 15:59:34 +00:00
martin 682d4acc5f Make it compile 2008-04-29 14:46:57 +00:00
ad cef4f8fa35 Use sparc_softintr to pass down device interrupt to the correct IPL.
MI slowpath softints are fine for notifications but have to much latency
to provide the card with the next block to play/record. PR kern/37540.
2008-04-29 14:10:00 +00:00
martin 3028e483e4 Convert to new 2 clause license 2008-04-29 06:53:00 +00:00
martin ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
jdc 313a56c040 Set (and display) the chip revision.
Set the GEM_SUN_GEM flag.
2008-04-28 20:07:39 +00:00
ad 6d70f903e6 Network protocol interrupts can now block on locks, so merge the globals
proclist_mutex and proclist_lock into a single adaptive mutex (proc_lock).
Implications:

- Inspecting process state requires thread context, so signals can no longer
  be sent from a hardware interrupt handler. Signal activity must be
  deferred to a soft interrupt or kthread.

- As the proc state locking is simplified, it's now safe to take exit()
  and wait() out from under kernel_lock.

- The system spends less time at IPL_SCHED, and there is less lock activity.
2008-04-24 15:35:27 +00:00
tsutsui 968ad4b4c3 Since device_t is split out from softc, we have to allocate struct device
separately after allocating struct lsi64854_softc to fake it. (untested)

"lsc->sc_dev is not initialized" is pointed out by martin@.
2008-04-23 13:37:19 +00:00
ad 185116891b Don't send signals from a hardware interrupt handler. XXX This is still
dodgy, because sc->sc_asyncproc can exit and we don't find out about
that.
2008-04-21 00:30:21 +00:00
tsutsui 78a1d236b6 Split device_t/softc for MI ncr53c9x and some related devices,
with various cleanup.
2008-04-13 04:55:52 +00:00
cegger 0f2aceb852 use device_xname() and get rid of isp_name 2008-04-07 19:21:55 +00:00
cegger 4c5fa20d1f use aprint_*_dev and device_xname 2008-04-05 18:35:31 +00:00
tsutsui d9941582bf Split device_t/softc for le(4) and variants and misc cosmetic changes. 2008-04-04 12:25:06 +00:00
jdc 479872d6de Check the "shared-pins" property for the value "serdes".
Makes SBUS GEM 1000Base-SX cards attach.
2008-03-22 23:37:32 +00:00
mjacob 0e65dd74d1 Checkpoint of some fairly major isp(4) rototilling.
Reintroduce more of a 'channel' concept in preparation for NP-IV support.
This gets rid of the chanA/chanB concept as the 2400 can have up to 128
virtual channels. Actually, with MID firmware you can also have the 2200
and 2300 support 'channels, but they do it with an FL-Port topology.
Because FC cards can now have 'channels', just about every support
function for fibre channel had to be redone to have a channel index
as well.  Rototill isp_ioctl.h for channel stuff as well.

Pick up a lot of work about fabric management (hopefully better) and keep
work in place that will allow for dynamic attachment/detachment of devices
(if I can figure out how to make the midlayer support it).

Merge the target code with external trees. Eventually it might even
be sorted out on NetBSD.

Update some firmware stuff.
2008-03-11 05:33:30 +00:00
mjacob f481874c89 Don't panic if you can't find the corresponding DMA device- just don't
configure the device.

It turns out that if you have a SUNW,fas card installed, the assumption
that dma devices pair with esp devices is then broken, but that's a problem
to fix another day.
2008-03-08 04:25:30 +00:00
nakayama 7817256e3e Fix previous.
sc_rsel and sc_wsel are in bpp_softc, not in lsi64854_softc.
2008-03-02 15:54:58 +00:00
rmind c6186face4 Welcome to 4.99.55:
- Add a lot of missing selinit() and seldestroy() calls.

- Merge selwakeup() and selnotify() calls into a single selnotify().

- Add an additional 'events' argument to selnotify() call.  It will
  indicate which event (POLL_IN, POLL_OUT, etc) happen.  If unknown,
  zero may be used.

Note: please pass appropriate value of 'events' where possible.
Proposed on: <tech-kern>
2008-03-01 14:16:49 +00:00
simonb 8b21752dcd KNF previous change. 2008-02-13 04:17:26 +00:00
dogcow 40aa5193f8 make it compile. 2008-02-13 02:11:42 +00:00
joerg e69482d49d Introduce device_find_by_xname and device_find_by_driver_unit to replace
alldevs iterations all over src.

Patch discussed with and improved on suggestioned from cube@.
2008-02-12 17:30:57 +00:00
dyoung b480b62270 Make many ethernet drivers share the common code for MII media
handling, ether_mediastatus() and ether_mediachange().  Check for
a non-ENXIO error return from mii_mediachg().  (ENXIO indicates
that a PHY is suspended.)

This patch shrinks the source code size by 979 lines.  There was
a 5100-byte savings on the NetBSD/i386 kernel configuration, ALL.

I have made a few miscellaneous changes, too:

gem(4): use LIST_EMPTY(), LIST_FOREACH().
mtd(4): handle media ioctls, for a change!
axe(4): do not track link status in sc->axe_link any longer
nfe(4), aue(4), axe(4), udav(4), url(4): do not reset all PHYs
        on a change of media

Except for the change to mtd(4), no functional changes are intended.

XXX This patch affects more architectures than I can feasibly
XXX compile and run.  I have compiled macppc, sparc64, i386.  I
XXX have run the patches on i386 boxen with bnx(4) and sip(4).
XXX Compiling and running on evbmips (MERAKI, ADM5120) is in
XXX progress.
2008-01-19 22:10:14 +00:00
martin 258a4b78cf With the new IPL world, things are easier for us: if we can get the
nell hardware interrupt handler run at IPL_VM, we can call the socket
drivers interrupt handler directly.
This is always possible on sparc64, but on sparc we might have to fall
back to the old softint bounce. Since this uses arbitrary IPLs, we
can not use the new softint_* for this - we'll have to use the old
sparc_softintr_* functions.
2008-01-06 02:29:58 +00:00
pooka 4e38160d4d Do not "return 1" from kqfilter for errors. That value is passed
directly to the userland caller and results in a mysterious EPERM.
Instead, return EINVAL or something else sensible depending on the
case.
2007-12-05 17:19:46 +00:00
ad 4b293a84e1 Interrupt handling changes, in discussion since February:
- Reduce available SPL levels for hardware devices to none, vm, sched, high.
- Acquire kernel_lock only for interrupts at IPL_VM.
- Implement threaded soft interrupts.
2007-12-03 15:33:00 +00:00
ad dc26833bb6 - Factor out too many copies of the same bit of tty code.
- Fix another tty signalling/wakeup problem.
2007-11-19 18:51:36 +00:00
ad d37935697b Merge tty changes from the vmlocking branch. 2007-11-07 15:56:11 +00:00
ad a2a3828545 machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h 2007-10-19 11:59:34 +00:00
ad 46ed8f7d77 Use the softint API. 2007-10-08 16:18:02 +00:00
martin eebdcf6078 Add a ddb command table at first attach to register "mach esp". 2007-09-22 23:32:27 +00:00
macallan a53919d5b0 clean up a little bit, while there let userland mmap the whole glint video
memory.
Note: this needs changes in the XF86 driver committed a few minutes ago.
2007-09-11 00:46:12 +00:00
dyoung dcd8923429 Change a bazillion occurrences of code resembling this,
error = (cmd == SIOCADDMULTI) ?
	    ether_addmulti(ifr, &sc->sc_ec) :
	    ether_delmulti(ifr, &sc->sc_ec);

	if (error == ENETRESET) {

to this,

	if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET) {

which does the same thing.

(A bazillion is a very large number.  This seems to make the i386
ALL kernel smaller by 3kB to 4kB.)

Use ifreq_getaddr() twice in es(4).

Whitespace nits.
2007-09-01 07:32:22 +00:00
macallan f9794c16db add screen blanking support 2007-09-01 03:45:14 +00:00