Commit Graph

4618 Commits

Author SHA1 Message Date
tsutsui
90ee4817fb Umm, fix typo. 2006-11-22 14:32:28 +00:00
bouyer
37152360bf Move part of wdc_sataprobe() to sys/dev/ata/sata_subr.c so that it can be
shared with non-wdc SATA controllers.
2006-11-20 23:42:21 +00:00
tsutsui
34a152af6d No need to check ifp->if_capenable on RX checksumming. 2006-11-18 17:39:44 +00:00
tsutsui
d1beedb632 Fix some comments. 2006-11-18 10:37:24 +00:00
tsutsui
ea45dc497b Replace magic numbers with macro. 2006-11-18 07:40:13 +00:00
tsutsui
d56fc00c0d - sync HWREV definitions with FreeBSD
- recognize 8169SC/8100E/8101E (untested, but won't hurt working devices)
  XXX: 8100E/8101E don't support 1000M; need some flag to set if_baudrate
2006-11-18 07:22:06 +00:00
tsutsui
33b09955d2 Use bitmask ops rather than modulo in RE_NEXT_*() macro since
we can assume each number of descriptors and TX queue is a power of two.
2006-11-18 00:21:36 +00:00
tsutsui
654712938e - add some more register definitions from Realtek driver
- sort
2006-11-17 23:41:42 +00:00
tsutsui
6590e7b074 Prepare and use an inline function which sets 64 bit DMA address into
struct re_desc to avoid unnecessary 64 bit arithmetic on ILP32 ports.
2006-11-17 21:49:49 +00:00
tsutsui
80b92a7179 Use ETHER_HDR_LEN rather than sizeof(struct ether_header).
BTW, should we have the similar ip4csum-tx bug workaround for fxp(4)?
2006-11-17 21:35:24 +00:00
tsutsui
f48e88ab0d Add a workaround for hardware ip4csum-tx bug on re(4) chips.
See discussion on tech-kern and tech-net for details:
http://mail-index.netbsd.org/tech-net/2006/10/21/0000.html
http://mail-index.netbsd.org/tech-net/2006/11/04/0003.html
http://mail-index.netbsd.org/tech-net/2006/11/07/0002.html
http://mail-index.netbsd.org/tech-net/2006/11/12/0000.html
etc.
2006-11-17 21:29:36 +00:00
christos
168cd830d2 __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
bouyer
927492edcd wdc_sataprobe():
- wait up to 1s for SStatus_DET_DEV after SControl_DET_INIT toggle (from
  FreeBSD)
- reset the drive once we know it's there. It may be in some PM state and
  not able to properly reply to IDENTIFY. Tested by Teemu Rinta-aho,
  fixes PR kern/35049 and should also fix PR kern/35008.
2006-11-14 18:39:10 +00:00
dyoung
075fd7d1e9 Stop using typeof() in the bit-twiddling macros, per yamt@'s
suggestion.  This change requires that I use the __PRIuBITS format
string in atw and rtw, so do that.
2006-11-13 03:35:59 +00:00
plunky
57c0199dcf Tidy away wsmouse_input() abstractions and update
documentation to include the W direction.
2006-11-12 19:00:42 +00:00
tsutsui
d990bcf038 Replace RTK_ETHER_ALIGN with RE_ETHER_ALIGN, which I missed.
Pointed out by dieter roelants in PR kern/35041.
2006-11-12 15:12:02 +00:00
tsutsui
26a4066f11 Remove an extra semicolon. 2006-11-12 12:02:19 +00:00
itohy
96de608110 Oops, I didn't notice the file had been updated and overwrote
the changes in 1.93....
Rescue the changes in 1.93 (IPv4 checksum fix).
2006-11-12 07:16:14 +00:00
itohy
3b284b614d - In some rare cases, both Tx Complete and Dn Complete bits are set.
I'm not sure what it exactly means, but at least, the packet in question
  is reloaded in ex_txstat() and should not handle the Dn Complete event
  at the moment ---  it should be served on later interrupt.

- Reload packet on collision, too.
2006-11-12 07:07:39 +00:00
tsutsui
0d397b62fe - merge re_encap() into re_start() so that we can handle each error case
more flexible
- account a number of free txq and use it to see if packets are queued or sent
- assume free TX descriptors are not owned by the chip in re_start() and
  panic if there is any inconsistency on them #ifdef DIAGNOSTIC case.
- replace a magic number (reserved TX descs?) with macro
2006-11-12 03:09:37 +00:00
tsutsui
cad156cdf4 Add a workaround for a hardware ip4csum-tx bug which would sometimes put
wrong IPv4 checksum on sending 21 or 22 byte IP packets.

See discussion on tech-kern and tech-net for details:
http://mail-index.netbsd.org/tech-kern/2006/11/04/0004.html
2006-11-12 02:49:46 +00:00
tsutsui
6e1aa2e387 Minor style tweaks in re_txeof(). 2006-11-11 13:51:44 +00:00
tsutsui
216b5d71df - declare struct re_txq separately
- reorder bus_dma_segment_t members since they are used only on attach/detach
2006-11-11 13:41:06 +00:00
tsutsui
15ce034c2c Some minor tweaks in re_intr():
- check status bits at once (I'm not sure how gcc optimized them though)
- no need to check (ifp->if_flags & IFF_UP) twice
  (re_init() must be called at splnet() anyway)
- call re_start() only if the interrupt is actually handled here
- call re_start() directly rather than via (*ifp->if_start)()
2006-11-11 12:41:56 +00:00
tsutsui
82ada0b76e Clear a TX timeout only if all queued packets are handled. 2006-11-11 12:13:55 +00:00
tsutsui
677bbfc799 Remove a leftover comment.
(note bus_dmamap_sync(9) is still needed even if no changes are made to
 DMA descriptors but once they are fetched into the CPU cache)
2006-11-11 12:04:08 +00:00
tsutsui
319c2aeb6a - set descriptor DMA addresses before enabling TX and RX
- set RTK_EARLY_TX_THRESH before starting TX and RX
2006-11-11 11:31:30 +00:00
tsutsui
df320777c1 Call re_reset() after re_stop() in re_init().
Without this, re(4) on my macppc sometimes falls into mangled state
and generates many errors after ifconfig(8) or tcpdump(8) etc.
2006-11-10 21:49:02 +00:00
elad
87d047b739 Replace securelevel checks with kauth(9) calls. 2006-11-08 00:17:09 +00:00
tsutsui
a6058d8988 Rename prefixes of re(4) specific macro and structure members
from RTK_ or rtk_ to RE_ or re_ for maintainability of these sources.
Eventually we should split these files (and struct rtk_softc) into
three elements, rtk(4) specific one, re(4) specific one, and a common
(register definitions, eeprom and multicast functions etc) part.

While here, add a couple of comments around weird definitions.
2006-11-05 16:52:10 +00:00
tsutsui
7274f167d2 - make TX threshold macro more generic
- no need to bother to initialize sc_txthresh in rtk_attach()
  since it's done in rtk_init()
2006-11-05 15:49:41 +00:00
itohy
bb94735ed0 Restart transmitter, not reset the entire chip, on transmission errors
like Tx underrun.
This should improve performance on such errors.

Handle fifo threshold properly --- actually it did not handled at all.
Note that the Tx Complete interrupts occur only on errors, and ex_txstat()
is not good place to increment sc->tx_succ_ok.  Increase the sc->tx_succ_ok
count from 100 to 256, since the ex(4) does busmastering and underruns
should rarely happen in normal operations.

Possibly improve some situation for the hang-on-heavy-load problems,
such as kern/11450 and kern/27096.
2006-11-05 07:59:21 +00:00
itohy
4be0089972 Add definition for Tx Reclaim status (TXS_RECLAIM). 2006-11-05 05:57:53 +00:00
tsutsui
c5bcc82dd7 Preserve m_pkthdr.csum_flags in TX packets because
it could be lost if bus_dmamap_load_mbuf(9) returns EFBIG.
(though I've never seen the "too mamy segments" message
 which indicates the packet has more than 32 fragments)
2006-11-04 05:18:26 +00:00
tsutsui
445d5743e4 Pull a 8139C+ fix from FreeBSD if_re.c rev 1.73:
Ignore BMCR_LOOP and BMCR_ISO bits which have different meanings on 8139C+.

Tested by Brian A. Seklecki.
2006-11-03 17:16:58 +00:00
tsutsui
304b305c9e Minor cleanups:
- move some driver specific definitions from rtl81x9reg.h to rtl81x9var.h
- move several macro where related structures are declared
- remove unused macro
- fix some comments
- unwrap some lines
2006-11-03 17:01:54 +00:00
tsutsui
a8d1516f11 Use #define<space>, which seems consistent in these files. 2006-11-03 14:41:40 +00:00
garbled
8e03013027 Comment out the debug options to siop, and change the undef to define.
This way they will be compiled by the i386 DEBUG kernel and tested.
2006-11-02 15:08:30 +00:00
garbled
a68eec4cf9 Make these compile when SIOP_DEBUG is enabled, by nuking the reference to
t_offset, which no longer seems to exist.
2006-11-02 14:55:04 +00:00
itohy
74588a5b22 Turn on PHY power earlier in the initialization.
This should make 3c575CT work and fix following PRs:

kern/12965: 3com 575CT does not work
port-i386/16295: Problems in pci routing table and ex0 (3c575c-tx) networking
2006-10-29 05:56:35 +00:00
christos
f26b055a0e PR/34933: Sami Kantoluoto: RealTek 8168B found from Asus P5B motherboard
is not recognized
2006-10-28 23:18:34 +00:00
tsutsui
1696b0bb2f Put common data for each RX DMA descriptor into a new rxsoft structure
for micro optimization.
2006-10-28 03:42:55 +00:00
tsutsui
dee13e6f7d Remove redundant byteswap ops. 2006-10-27 13:26:34 +00:00
tsutsui
5ee73a035c Use common macro rather than local one. 2006-10-27 09:57:26 +00:00
bouyer
c55d38dab6 Exclude wdc_sataprobe() when no SATA controllers are present. Fix
build of *_TINY kernels.
2006-10-25 20:14:00 +00:00
bouyer
80b1feec65 Add sata registers to struct wdc_regs. Add wdc_sataprobe(), a function
probing drives using the standard SATA registers; taken from various
PCI sata drivers. Export wdc_drvprobe() too.
2006-10-25 17:33:02 +00:00
tsutsui
49466e5a5e Set RTK_RDESC_CMD_OWN in rtk_cmdstat of RX DMA descriptor after
all other descriptor data is written to avoid possible race condition.
2006-10-24 11:17:49 +00:00
tsutsui
5398897f34 Rename RTK_[TR]X_DESC_INC() macro to RTK_NEXT_[TR]X_DESC() and
change them to return rvalues to avoid possible side effects.
Also define RTK_NEXT_TXQ() for rtk_txq index and use it as well.
2006-10-22 01:47:53 +00:00
tsutsui
d438fee521 Rename a variable to clarify meaning of index. 2006-10-22 01:23:39 +00:00
tsutsui
bc366d3166 Tweak TX descriptor setup code in re_encap() to make it more readable a bit. 2006-10-21 21:29:14 +00:00
tsutsui
f89487b7e5 Use aprint_error(9) to print error messages. 2006-10-21 16:13:21 +00:00
tsutsui
5227317a1e Use CSR_WRITE_1() to write RTK_TXSTART register because it is localted
at an odd address (0xd9) and noted "8 bit" in rtl81x9reg.h.

XXX: FreeBSD and OpenBSD also use CSR_WRITE_1() to write RTK_GTXSTART
XXX: for 8169 even though there is a "16 bits" comment at GTXSTART macro.
XXX: Which is correct?
2006-10-21 03:44:47 +00:00
tsutsui
f236f53515 In re_newbuf():
- adjust m_data and m_len directly rather than calling m_adj(9)
- more cosmetics
2006-10-20 17:11:36 +00:00
tsutsui
2cc86b486f KNF, remove register decls, TAB/space cosmetics etc. 2006-10-20 16:46:47 +00:00
tsutsui
572ce0789f u_intNN_t -> uintNN_t 2006-10-20 16:31:08 +00:00
tsutsui
d27d349474 Use BUS_DMA_COHERENT on mapping DMA memory for TX/RX descriptors.
I can't think of a good way to avoid race condition between writeback and
DMA write against descriptors if cachelinesize > sizeof(struct rtk_desc)...

Anyway, now re(4) is functional on O2 (and probably other mips ports).
2006-10-20 15:44:00 +00:00
tsutsui
a7ca335bad Try to avoid race condition between cache writeback from CPU and DMA write
from re(4) chip as much as possible.
2006-10-20 15:19:01 +00:00
tsutsui
620e93c99c while (1) -> for (;;) 2006-10-20 14:51:06 +00:00
tsutsui
d2c63dd7b9 - bcopy -> memcpy
- bcmp -> memcmp
2006-10-20 14:28:55 +00:00
tsutsui
55b9847900 There is no particular reason to use BUS_DMA_ALLOCNOW on bus_dmamap_create(9). 2006-10-20 14:00:49 +00:00
tsutsui
920add0c28 Tweak a for() loop a bit in re_rxeof(). 2006-10-20 13:44:31 +00:00
tsutsui
38e9d649da Sync RX mbufs before setting up RX DMA descriptor. 2006-10-20 13:39:47 +00:00
tsutsui
e9a7d245ed - call bus_dmamap_sync(9) against DMA descriptors more properly
- make DMA descripter members volatile
Now re(4) works on sgimips O2.

XXX: Still re(4) sometimes stalls on NFS load on sgimips,
XXX: but I'm not sure it's sgimips specific or not.
2006-10-20 11:30:54 +00:00
tsutsui
92846c53e2 Use "#ifdef __NO_STRICT_ALIGNMENT" rather than
"#if defined(__i386__) || defined(__x86_64__)".

XXX: What will happen if RTL8168B is used on !__NO_STRICT_ALIGNMENT hosts?
XXX: If 8168B can't handle RX DMA into 32bit-unaligned memory, should we
XXX: implement some code to copy RX buffers like vge(4)?
XXX: Or is 8168B available only for on-board NIC for PCs?
2006-10-17 14:16:06 +00:00
tsutsui
aecd88d07b DMA memory for the TX ring should be aligned at RTK_RING_ALIGN,
not RTK_ETHER_ALIGN.
2006-10-17 14:03:26 +00:00
yamt
de1da31163 re_diag: constify. 2006-10-17 09:19:57 +00:00
pooka
5005d343ec * __unused games + other relevant fixes
* give me ANSI C or give me death (at least where it could be easily spotted)
2006-10-16 13:00:36 +00:00
yamt
e3c9a705bc re_start: fix tx stall. 2006-10-13 11:06:15 +00:00
yamt
04200ace96 re_txeof: fix watchdog timeout. 2006-10-13 11:02:38 +00:00
dogcow
e5fd0c244b more __unused; also, ew, K&R decls. 2006-10-12 20:16:59 +00:00
xtraeme
1b2a823a5f Use __unused in function arguments where appropiate. 2006-10-12 07:43:39 +00:00
christos
4d595fd7b1 - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
2006-10-12 01:30:41 +00:00
jkunz
007f7a7a2a Bringing up a fpa(4) interface on sparc(64) causes a hard kernel crash
(infinite loop) due to the way fpa(4) interacts with bus_dma(9).
This fixes the problem and makes fpa(4) usable on sparc(64).
2006-10-09 20:45:19 +00:00
gdt
058379036b Use IEEE80211_RADIOTAP_DBM_ANTSIGNAL (and NOISE) instead of DB,
because the Atheros values are at least close.
(discussed on tech-net)
2006-10-07 20:54:40 +00:00
peter
0e931e0449 Fix compilation with AN_DEBUG (use %zu instead of %d). 2006-10-07 14:30:27 +00:00
chs
33c1fd1917 add support for O_DIRECT (I/O directly to application memory,
bypassing any kernel caching for file data).
2006-10-05 14:48:32 +00:00
christos
b64edcaded fix empty if 2006-10-04 15:53:24 +00:00
christos
888446efb0 fix empty if 2006-10-04 15:41:25 +00:00
christos
53dabe0e36 fix empty if body. 2006-10-04 15:39:24 +00:00
christos
f2e38a9477 prevent empty body in if. 2006-10-04 15:36:23 +00:00
tsutsui
2f49bc32a3 Reorganize MI intersil7170(4) TOD clock driver:
- make intersil7170_softc more generic and allocate it during autoconf(9)
  rather than MALLOC(9) in attachment
- put todr_chip_handle_t, year0 value, and the century adjustment flag
  into the intersil7170_softc
- change the attachment function to just take the softc like mk48txx(4)
- split sys/dev/ic/intersil7170.h into intersil7170reg.h and intersil7170var.h
- cleanup some macro

Untested on real sun4 machines, but no objection on port-sparc
(and port-sun3) in three days.
2006-10-04 15:04:43 +00:00
christos
2f0f18be71 prevent empty if. 2006-10-04 15:03:25 +00:00
bjh21
439213ef2c Allow wd33c93 attachments to choose what DMA mode it should use, and arrange
to use burst mode on sec(4), which makes it slightly but significantly faster.
2006-10-01 22:02:55 +00:00
bjh21
7da05dea5d There's no need to explicitly deny DMA support, and that causes compile
problems when the kernel doesn't support IDE DMA.
2006-10-01 21:50:33 +00:00
elad
65792a0340 More from Matt Fleming:
Adapt to KAUTH_DEVICE_TTY_PRIVSET and KAUTH_DEVICE_TTY_OPEN.
2006-10-01 20:31:49 +00:00
elad
bdc51baebb Adapt MD code to KAUTH_DEVICE_TTY_OPEN, batch #2 from Matt Fleming, thanks!
Also, add forgotten splx() calls in some places.
2006-10-01 19:28:43 +00:00
bjh21
5375dc7f10 New driver, sec(4), for the Acorn SCSI Expansion Card. Unlike asc(4), this
driver uses the board's DMA system, uses the machine-independent WD33C93
driver, works on NetBSD/acorn26, and doesn't share a name with six other
machine-dependent SCSI drivers.  Not tested on acorn32, but it seems to
work tolerably well on my A540.
2006-10-01 12:39:35 +00:00
itohy
2a96724f93 Change Id to NetBSD 2006-10-01 12:11:52 +00:00
itohy
b2d7fb48f1 Use ATA timing, instead of busmaster wait, for adding waits.
Use default wait value 0x01.
2006-10-01 09:53:08 +00:00
tsutsui
def8ea24fa u_int8_t -> uint8_t 2006-10-01 06:02:53 +00:00
itohy
f87d591722 A little effort against kernel bloat....
Exclude ATA DMA support if no ATA DMA capable drivers are compiled in.
2006-09-30 15:56:17 +00:00
tsutsui
7db79c4e79 - KNF
- u_intNN_t -> uintNN_t
- misc cosmetics
2006-09-29 18:56:29 +00:00
tsutsui
60abfbb6b9 ANSIfy. 2006-09-29 18:27:51 +00:00
tsutsui
0afee5cb99 TAB/space cleanup. 2006-09-29 18:20:02 +00:00
tsutsui
ab86520375 Set a timeout only if any TX packet is actually queued. 2006-09-29 16:46:49 +00:00
tsutsui
7d6d7a0b22 rtk_intr() should return 1 only if any interrupts are actually handled. 2006-09-29 16:40:15 +00:00
tsutsui
4c0a796caa Use SIMPLEQ_EMPTY()' rather than SIMPLEQ_FIRST() == NULL'. 2006-09-29 16:38:16 +00:00
tsutsui
a63cbd1696 Handle more wraparound case on RX ring-buffer calculation.
(it might cause problem only if RTK_RXBUFLEN < 64KB)
2006-09-29 16:33:41 +00:00
christos
f6e519df16 Coverity CID 3015: Check before using (from Arnaud Lacombe) 2006-09-29 14:28:46 +00:00
tsutsui
ebd0b89ad0 Pull mii_readreg fix from FreeBSD if_rl.c rev 1.81:
> When reading PHY regs over the i2c bus, the turnaround ACK bit
> is read one clock edge too late. This bit is driven low by
> slave (as any other input data bits from slave) when the clock
> is LOW. The current code did read the bit after the clock was
> driven high again.
2006-09-29 14:03:07 +00:00
tsutsui
a7f43a90fe In rtk_txeof(), clear the timeout timer only if there is no pending packet. 2006-09-29 13:59:40 +00:00
tsutsui
2f6ae33af4 In rtk_rxeof():
- discard too short packets as well as too large ones
- trim CRC off rather than setting M_HASFCS

Closes PR kern/31348.
2006-09-29 08:33:06 +00:00
bjh21
24bcb8e38a wd33c93_minphys() doesn't exist any more, so don't declare it. 2006-09-26 23:27:36 +00:00
bjh21
334ef0cbc9 Merge my bjh21-wd33c93 branch. This improves message handling in general
and sync negotiation in particular.  Tested on sgimips (thanks to
Manuel Bouyer) and acorn26 (with my still-unfinished driver for the Acorn
SCSI Expansion Card).
2006-09-26 22:45:25 +00:00
jmcneill
fbd43a6ddc Add powerhook for RT2560-based cardbus wireless adapters. 2006-09-25 22:14:01 +00:00
jmcneill
f135e0d607 Add "name" parameter to powerhook_establish, to aid debugging. No objections
on tech-kern@
2006-09-24 03:53:07 +00:00
jmcneill
2c50610456 Call rt2560_stop() from rt2560_detach(). Fixes a panic on detach of cardbus
device on my Vaio. Fix from dyoung@.
2006-09-17 23:58:51 +00:00
christos
d5978e20f4 - use c99 initializers
- add missing initializer
2006-09-13 01:01:20 +00:00
tsutsui
c231727267 Fix a typo (settime -> gettime) so that we can get time. 2006-09-10 06:39:00 +00:00
itohy
cb2fb285ec Workbit NinjaATA-32 busmastering PIO IDE controller driver (njata)
This driver supports NinjaATA-32Bi and NPATA-32 chips,
which are used for CardBus ATA interface cards and
CardBus CompactFlash adapters.
2006-09-07 14:22:07 +00:00
itohy
6119b65726 Add PIOBM (busmastering transfer using ATA PIO mode) support.
The PIOBM is used by only one driver (will be added later,
stay tuned) and intruduce an attribute "ata_piobm" so that
it will be conditionally compiled in.
The "ata_dma" (busmastering transfer using ATA DMA mode) and
"ata_udma" (busmastering transfer using ATA Ultra DMA mode)
attributes are also added for consistency, but unused for now.
2006-09-07 12:46:47 +00:00
gdamore
1a001de39f Update to new friendlier todr entry points. While here, ANSIfy. 2006-09-07 05:09:29 +00:00
gdamore
a3925b6374 Updated to new clock_ymdhms support in kern_todr.
While here, ansify a few routines.
2006-09-07 05:02:16 +00:00
simonb
68c7194a9c Revert rev 1.9. As pointed out by Izumi Tsutsui, the \n is printed
by MD code.
2006-09-07 04:33:55 +00:00
gdamore
711d816d2d Switch to friendlier todr ymdhms entry points. Moved a consistency check
to common kern_todr.c while here.
2006-09-07 04:29:34 +00:00
dogcow
f2d329dca0 remove more vestiges of CCITT, LLC, HDLC, NS, and NSIP. 2006-09-07 02:40:31 +00:00
uwe
c7a7101b20 MI part of the Ricoh RS5C313 real time clock todr(9) driver.
Based on the code from landisk port.  With help from gdamore@
2006-09-07 01:12:00 +00:00
simonb
e099b5edda Add \n to end of autoconf message. 2006-09-06 06:26:54 +00:00
rumble
d5dbfe8cbd Make this work with timecounters. 2006-09-05 17:31:31 +00:00
gdamore
a37acb1b52 Remove unused todr_setcal/todr_getcal and all the assorted stub
implementations.
2006-09-04 23:45:30 +00:00
christos
00c11ed953 add missing initializers 2006-09-03 21:42:09 +00:00
christos
4e0d743b9e add missing initializers 2006-09-03 20:59:18 +00:00
christos
328ed75351 add missing decl 2006-09-03 06:42:44 +00:00
christos
5b7c1e90d5 add missing decl. 2006-09-03 05:23:59 +00:00
christos
26733bed2e - comment out impossible comparisons
- remove superfluous if statement
2006-09-03 05:10:24 +00:00
christos
7de21598de - add missing initializer
- correct function decl.
2006-09-03 05:04:57 +00:00
christos
a96f0dc641 avoid empty if statements 2006-09-03 04:27:11 +00:00
christos
5ec7f32544 add missing initializers 2006-09-02 17:02:57 +00:00
xtraeme
05670fe773 Remove unused variable to make this build again. 2006-09-02 09:26:47 +00:00
christos
7d1781d944 - fix incomplete initializer
- static goes first
2006-09-02 07:07:33 +00:00
christos
9f681d6f65 comment out impossible code 2006-09-02 07:00:23 +00:00
christos
b819e0b190 Add missing initializer 2006-09-02 06:54:18 +00:00
dyoung
8cd106d3d2 Per discussion on tech-kern and tech-userlevel, move the bit-twiddling
macros, __BIT, __BITS, SHIFTIN, SHIFTOUT, and __arraycount() from
lib/libkern/libkern.h to sys/cdefs.h.  Add a __-prefix to SHIFTIN
and SHIFTOUT, and add a manual page for the bit-twiddling macros,
bits(3).

Make the __BIT and __BITS macros "widthless," as best I can, by
changing their type to uintmax_t from uint32_t.  XXX The manual
page lags this change by a bit.

Define __PRIxBIT and __PRIxBITS printf(3) format strings.
2006-08-31 19:24:37 +00:00
rumble
e980865174 Phobos boards (my G130 at least) have a non-standard srom layout. Try to
identify it and pull out the enaddr.
2006-08-30 23:31:08 +00:00
christos
738af19b41 fix initializers. 2006-08-30 19:25:46 +00:00
christos
f5d9b98eb1 add missing initializer 2006-08-30 15:25:58 +00:00
christos
15a77ddab7 fix incomplete initializer 2006-08-30 00:40:56 +00:00
xtraeme
6c90d7030b Remove unused variable 'periph' to make this build. 2006-08-28 11:45:38 +00:00
christos
7546f55be3 add missing initializer 2006-08-28 00:01:36 +00:00
christos
1624b1a623 typo 2006-08-27 23:23:48 +00:00
christos
d22d88fc75 ifdef out unreachable code. 2006-08-27 23:23:02 +00:00
christos
925d11f2f5 complete declarations 2006-08-27 23:19:03 +00:00
bjh21
b42a1dca38 Revert revision 1.4: it seems to have caused serious problems on sgimips,
so I should probably leave it until I get my Indy going.
2006-08-27 22:32:54 +00:00
christos
9db6f7d836 #ifdef out unused ioctl (and wrong) 2006-08-27 20:26:34 +00:00
christos
9c90e26bcf Fix typo 2006-08-27 20:11:31 +00:00
bjh21
f379f539d2 Use symbolic names for CSR values after reset. 2006-08-27 13:13:36 +00:00
bjh21
eb74489b57 When receiving a SCSI message, it's important not to deassert ACK on the last
byte until we've worked out what to do with the message, since if we plan
to reply to it we have to assert ATN before deasserting ACK.  Implement this.
2006-08-26 23:55:22 +00:00
bjh21
604c7b6558 Use standard MSG_IS1BYTE, MSG_IS2BYTE, and MSG_ISEXTENDED macros rather
than rolling our own.
2006-08-26 22:37:07 +00:00
bjh21
c981542cbe Use the 'z' size modifier when printfing size_t, so that GCC doesn't complain
on systems were size_t isn't unsigned int.
2006-08-26 22:33:18 +00:00
bjh21
2cd3c4f0e6 Move the sgimips "sbic" driver from arch/sgimips/hpc/sbic.c to
dev/ic/wd33c93.c.  This may not be the best WD33C93 driver we've
got, but it's the most recently worked on and probably the most
portable, so it seems like a good basis for further work (and in
particular an acorn26 driver for the Acorn SCSI card).  There's
no functional change in this commit, and sgimips kernels still
compile.
2006-08-26 22:06:36 +00:00
christos
f0f1731b24 Acting as Elad's keyboard:
Place the securelevel checks in their logical locations.
This will be clearer in the future when code changes to use kauth(9) calls.

input and okay ad@
2006-08-23 15:44:29 +00:00
kent
dab6bf2001 implement auto-detection of volume resolutions 2006-08-23 11:24:07 +00:00
uwe
dee7f461a0 G/c unnecessary includes. 2006-08-18 02:42:38 +00:00
christos
35ca6c8b5b Fix all the -D*DEBUG* code that it was rotting away and did not even compile.
Mostly from Arnaud Lacombe, many thanks!
2006-08-17 17:11:27 +00:00
gdamore
f943f04933 2nd try. Fix errors (hopefully) that prevented this from compiling. This
has not been tested, as I lack the tools necessary to build this (and can't
bootstrap pmppc toolchain for some reason.)

Requested by garbled@
2006-08-16 21:28:36 +00:00
jmcneill
d7fd667c03 Provide a method for other display drivers to ask vga to free resources
it had claimed while acting as the initial console device. This allows
(for example) vga to be the initial console, and an accelerated
framebuffer driver to take over later.
2006-08-13 20:24:51 +00:00
nakayama
8f342cb589 Avoid gcc4 warnings; voice is unsigned so no need to check "voice < 0". 2006-08-12 00:34:39 +00:00
mrg
daf321dbca fix a GCC uninitialised variable warning only seen at -O3. 2006-08-08 10:32:09 +00:00
sanjayl
265929b20e 1st cut of Powermac G5 support (uses bridge mode). 2006-08-05 21:26:48 +00:00
kent
117c4cc6d5 add capability to support for S/PDIF.
If a codec supports for AC'97 S/PDIF, it will have an mixer "spdif.enable."
However, we can't change the value of the mixer without AC'97 host
driver's support.
2006-07-26 14:44:33 +00:00
martin
a4cb6f93d2 Remove unused variable to make it compile again. 2006-07-22 15:09:09 +00:00
elad
a6e0095c33 oops, no 'p' here. from xtraeme@. 2006-07-22 09:59:24 +00:00
elad
6f83bb0086 don't call kauth_authorize_generic() when holding a lock, from yamt@. 2006-07-22 09:22:21 +00:00
ad
3029ac48c7 - Use the LWP cached credentials where sane.
- Minor cosmetic changes.
2006-07-21 16:48:45 +00:00
christos
52f01eaf1c remove lhs cast for gcc4 2006-07-17 19:29:31 +00:00
seanb
13d47e9c25 Consistently establish / disestablish shutdown hook
in the bus layer and remove from common ath_attach().
Having it in both layers (on some bus architectures)
was causing a double call to ath_stop() on shutdown
which in turn was tickling the bus lockup described
therin on slower machines.
2006-07-14 13:37:25 +00:00
gdamore
34537908ab Add an option COM_REGMAP to allow com(4) to use an array of register indices.
This allows us to convert aucom to just another com attachment, and cleanup
some code in the com_arbus.c.

Additionally, we use a common com_cleanup routine rather than having a
zillion copies of it in the attachment points.

This has been tested on a number architectures, and it has been shown to get
close to comparable performance when COM_REGMAP is defined, and comparable
when it is not defined.

Approved by core@.  Fixes PR port-evbmips/32362.
2006-07-13 22:56:00 +00:00
skrll
b819728719 Note this driver is for the i82596CA and i82596DX/SX chips and provide
links to documentation on developers.intel.com
2006-07-12 05:12:06 +00:00
peter
58224a41e7 Add power hooks for "ep* at pcmcia?".
ok christos@
2006-07-11 22:49:47 +00:00
peter
09f0de7ce4 Add power hooks for "ne* at pcmcia?".
ok christos@
2006-07-11 22:48:37 +00:00
skrll
eb4039be03 KNF some comments and whitespace. 2006-07-08 16:24:08 +00:00
skrll
e5a112d805 Spelling in comments. No functional change. 2006-07-08 16:07:47 +00:00
rpaulo
81cc271bc5 Add missing semicolon. 2006-07-04 23:05:11 +00:00
rpaulo
32404d58a1 Coverity CID 3805: Close the firmware_handle on error and avoid leaks. 2006-07-04 18:26:29 +00:00
chap
710af63468 Ankh-Morpork, we have a MIDI driver....
Merge from chap-midi branch, after
~month for review
Comments by thorpej@ drochner@ and Alexandre Ratchov

Incorporated: points by thorpej@ drochner@; preliminary support for
a stats-collecting ioctl suggested by martin@ from comments by A.R.

PR kern/32441 kern/32442 kern/32567 kern/32588 kern/32694 kern/33590
kern/33614 and one instance of kern/32651

ok martin@
2006-06-30 13:56:25 +00:00
drochner
eff818776d add some common code to support the ACPI power management timer
independly of ACPI
2006-06-26 16:13:21 +00:00
jmcneill
507a433a4e Make sure that a powerhook was successfully established before trying to
disestablish it on detach.
2006-06-25 14:49:49 +00:00
perry
9c74364e5b Add a power hook for the com device. 2006-06-25 00:39:21 +00:00
jmcneill
52f7cdcc1f Hook the lid switch, sleep button, and hibernate button into sysmon. This
enables special Fn keys on Sony Vaio laptops.
2006-06-20 15:35:11 +00:00
christos
8b28dc1494 PR/33761: dieter roelants: NetBSD doesn't recognize a RealTek 8168B nic 2006-06-18 21:32:24 +00:00
christos
fcad4273ae PR/33763: dieter roelants: Realtek 8168B doesn't function. Don't align
for i386/x86_64. From FreeBSD.
2006-06-18 21:29:48 +00:00
rpaulo
656f536d09 Use IFQ_IS_EMPTY(). 2006-06-18 16:14:10 +00:00
rpaulo
7a69791e70 Remove IF_PREPEND() to comply with altq. I think the logic is safe to just
remove the macro call.
2006-06-18 15:44:49 +00:00
rpaulo
c545be67e3 When calling IF_DEQUEUE() check if the dequeued mbuf is NULL to comply
with altq.
2006-06-18 15:37:27 +00:00
christos
7b128daa3b stack police: Introduce an opl_match function that uses malloc instead of
allocating ~2K of softc on the stack.
2006-06-09 21:55:33 +00:00
drochner
c87a7b61b9 fix obvious botch in radiotap header alignment (untested) 2006-06-09 19:17:46 +00:00
rpaulo
f5a468f537 Revert previous. Wrong way of doing things... 2006-06-09 19:13:17 +00:00
gdamore
ef3b8c3cc3 Print bus_addr_t using PRIx64 (casting to uint64_t), which fixes builds
on 32-bit sparc (which have 64-bit bus_addr_t, but only 32-bit pointers.)
2006-06-08 22:42:24 +00:00
simonb
dfeb2fa259 Unwrap a not-too-long line. 2006-06-08 21:04:16 +00:00
rpaulo
69ae4b1781 Bring the following change from OpenBSD:
Keep track of the average RSSI using an Exponential Moving Average (EMA).
  Use it to dynamically tune radio receive sensitivity.

  The idea is simple:
  - increase sensitivity when the RSSI is bad to optimize throughput on
    long distance to the AP, and
  - decrease sensitivity when the RSSI is good to reduce noise level and
    optimize throughput on short distance to the AP

  The EMA allows to smooth RSSI variations so we don't end up changing the
  sensitivity too frequently.  We check if it would be worth updating the
  sensitivity every one second.
  RSSI thresholds were taken from the Ralink Tech. Linux driver.
2006-06-08 20:56:41 +00:00
rpaulo
24ba5ad5fd Rename sta variable. Pointed out by Havard Eidnes and Juergen Hannken-Illjes. 2006-06-08 13:00:35 +00:00
hannken
cbaa71d5f4 Add missing brace to make it compile again. 2006-06-08 10:56:49 +00:00
kardel
de4337ab21 merge FreeBSD timecounters from branch simonb-timecounters
- struct timeval time is gone
  time.tv_sec -> time_second
- struct timeval mono_time is gone
  mono_time.tv_sec -> time_uptime
- access to time via
	{get,}{micro,nano,bin}time()
	get* versions are fast but less precise
- support NTP nanokernel implementation (NTP API 4)
- further reading:
  Timecounter Paper: http://phk.freebsd.dk/pubs/timecounter.pdf
  NTP Nanokernel: http://www.eecis.udel.edu/~mills/ntp/html/kern.html
2006-06-07 22:33:33 +00:00
nakayama
dc8650e97c Add void cast to functions whose return values are ignored. 2006-06-07 15:34:47 +00:00
rpaulo
431dc1da44 Attachment framework for the rt2561.c and rt2661.c drivers.
From OpenBSD.
2006-06-06 21:00:41 +00:00
rpaulo
9fc70013c7 struct ifnet must be inside sc_ec. Fixes panics on detachment. 2006-06-06 20:48:27 +00:00
rpaulo
355b4c7b38 Oops, missing arg to firmware_free. 2006-06-06 01:18:25 +00:00
rpaulo
c54cf300da Don't leak memory on error. 2006-06-05 17:00:50 +00:00
rpaulo
7a35a95fe6 Add missing firmware_close(). 2006-06-05 16:59:41 +00:00
gdamore
b38b3d39ad Import new HAL 0.9.17.2. Approved by sam@
New HAL includes some driver changes to register accesses.
Adds support for WLAN devices on AR5312 family devices.
Adds support 32-bit SPARC ath devices (untested).
ath enabled in SPARC64 GENERIC builds.
This HAL is tested and known to work for i386 PCI devices, SPARC64 PCI devices,
and AR5312 WiSoC devices.  MIPS PCI devices appear to be busted (possibly only
on Alchemy hardware, unconfirmed), and cardbus support is untested due to
lack of test hardware.

Please report any new problems with this import to garrett@.
2006-06-05 05:14:37 +00:00