Commit Graph

4618 Commits

Author SHA1 Message Date
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
rpaulo
76c6161871 Driver for Ralink chipsets RT2460A, RT2560, RT2561S, RT2561 and RT2661
from FreeBSD/OpenBSD that supersedes ral*.[ch].

Not yet enabled because I don't have a CardBus controller to test and it
will most likely crash during detach.

I tried to include our modifications, but if something is missing please
tell me or add it.

Special thanks to minipci.biz for the donation of one PCI RT2661 and
one CardBus RT2661.
2006-06-04 20:38:06 +00:00
rpaulo
8420a4bdc7 Sean Boudreau: The eeprom bits are shifted out in host order.
Also present in the upcoming rt2560.c driver.
2006-06-03 12:02:51 +00:00
drochner
305932c524 Remove passing of an uninitialized variable found by gcc4.
(The variable was not used by the called function, so remove the
argument completely.)
2006-05-29 15:17:29 +00:00
he
732bd1213b Remove setting of xs_status to XS_STS_DONE before calling scspi_done().
After revision 1.135 of scsipi_base.c, it's a big no-no to set
XS_STS_DONE before calling scsipi_done().  Besides, scsipi_done()
sets XS_STS_DONE itself after checking that it's not already set.

This puts this driver back in working order; before this change
the probe of the logical drives would cause a hang.
2006-05-27 17:56:39 +00:00
blymn
a88dd3436a Clean up bogus whitespace 2006-05-26 12:52:45 +00:00
blymn
6b8a344329 Clean up bogus whitespace 2006-05-26 12:39:31 +00:00
blymn
44278a4fa1 Clean up bogus whitespace 2006-05-26 11:52:08 +00:00
christos
fe6055587f void casts to functions whose return values are ignored. 2006-05-21 23:56:09 +00:00
mrg
afda9ed915 initialise pos.x and pos.y to appease GCC4. 2006-05-20 07:09:08 +00:00
pavel
dbbc553deb Disable hw VLAN tagging, in a similar way that it was done in OpenBSD
(src/sys/dev/ic/re.c rev. 1.15). The disabled VLAN stripping is mine.
(The OpenBSD driver forgot to do this.)

The reason is that untagged packets get sometimes tagged incorrectly.
PR 32643.

Approved by martin@.
2006-05-16 22:39:24 +00:00
elad
2867b68bc3 integrate kauth. 2006-05-14 21:42:26 +00:00
christos
c0fdc5190f XXX: GCC uninitialized 2006-05-14 05:42:43 +00:00
dyoung
7153b68a4a Make rtwvar.h, rtw.c agree whether rtw_host_rfio and rtw_debug are
static or extern.  Problem noted by Tom Spindler.
2006-05-14 04:08:09 +00:00
xtraeme
3b291301d4 Remove code for the IT87xxF chipsets, it was included on its own
driver (it(4)).
2006-05-13 09:03:21 +00:00
tsutsui
337a4c703f According to the i8259 manual, EOI, R, and SL bits belong to OCW2 register
so rename them OCW3_* -> OCW2_*.
2006-05-12 10:58:12 +00:00
mrg
ce51c72be5 quell GCC 4.1 uninitialised variable warnings. 2006-05-11 23:54:39 +00:00
mrg
b18db50b21 cast the return value of several macros that evaluate to "(func() == FOO)"
to (void) to avoid "computed value not used" warnings.
2006-05-11 22:26:54 +00:00
mrg
ea9579cbb2 don't declare ahc_pci_ident_table[] and ahc_num_pci_devs extern, they aren't. 2006-05-11 01:02:15 +00:00
mrg
084c052803 quell GCC 4.1 uninitialised variable warnings.
XXX: we should audit the tree for which old ones are no longer needed
after getting the older compilers out of the tree..
2006-05-10 21:53:14 +00:00
drochner
f4f8d2a3de remove spl and locking stuff from interrupt handler 2006-05-10 10:27:49 +00:00
uebayasi
4a02e59152 Update URLs to ASAHI KASEI CODECs. 2006-05-10 09:07:57 +00:00
skrll
a9f4c28a3d Fix a bunch of cast lvalues. 2006-05-10 06:24:02 +00:00
jdc
94b7dad338 Remove call that sets XS_STS_DONE before we call scsipi_done().
This makes isp work again following the change in r1.135 of scsipi_base.c.
Also tested by David Hopper.
2006-05-07 17:31:48 +00:00
drochner
50d235e444 make sure "radiotap" capture data are aligned,
thanks to Pierrick Brossin for verifying the effect on "tcpdump" output
2006-05-05 09:04:05 +00:00
martin
c6795868de Fix some comments, mostly from Nenad Crnko in PR kern/33402. 2006-05-02 08:31:02 +00:00
rpaulo
6805a4a424 In vga_cnattach(), intialize typestr to NULL. 2006-04-26 16:09:22 +00:00
tsutsui
91174570f2 - use M_NOWAIT rather than M_WAITOK for malloc(9) to allocate RX buffer
in zstty_attach()
- check a return value of the malloc(9)

Taken from com.c, and somehow this seems to fix PR port-sun2/32420 on tme.
2006-04-19 17:44:07 +00:00
tsutsui
a5abba7c76 u_intNN_t -> uintNN_t 2006-04-16 00:38:59 +00:00
tsutsui
cae22e3811 Use __arraycount(). 2006-04-16 00:35:10 +00:00
tsutsui
b96af9b308 i >= 0 can never be false if i is u_int. Noticed by OpenBSD. 2006-04-16 00:30:22 +00:00
jmcneill
f08bb8f847 * Add a flag AC97_HOST_INVERTED_EAMP. (kern/18880, kern/24488).
* Make reset callback optional; not all devices need it. (port-i386/14260, kern/12603, kern/12723, kern/24957).
2006-04-15 21:18:34 +00:00
jmmv
aec18036fd Remove the getwschar and putwschar accessops from wsdisplay drivers as
requested by uwe@.  These were wrong because they were receiving an
emulcookie yet they were accessops (thus having to receive an accesscookie).
Instead, just handle the WSDISPLAYIO_{GET,PUT}WSCHAR ioctls from the
driver's ioctl accessop.

As this reduces the amount of code needed to handle these operations to
two small functions in each driver, remove the WSDISPLAY_CHARFUNCS kernel
option.

Reviewed by, at least, uwe@ and macallan@.  No objections in tech-kern@.
2006-04-15 17:48:23 +00:00
tsutsui
ce21617f93 Add AHC_USETARGETDEFAULTS to ahc_flag, which enables to
use default target (but not for host) device settings on
ahc(4) interface without its SEEPROM (mostly on-board one).

This flag could be useful if host's BIOS (firmware) initializes
ahc(4) chip with some conservative (async, no tagged queuing etc.)
target settings for minimum support to load its primary loader etc.,
and it will be enabled in each attachment according to MD device
properties(9). Currently this property is set only on sgimips for
O2 on-board aic7880 adapters.

No objection on tech-kern (and netbsd-bugs), and closes PR kern/23276.
2006-04-15 14:22:52 +00:00
martti
09780f733e Merged changes between OpenBSD rev 1.13 and 1.14. 2006-04-15 12:36:23 +00:00
christos
0310ff8964 Coverity CID 1542: Off by one in test. 2006-04-14 22:30:13 +00:00
christos
c56f241b01 Coverity CID 2501: Make it painfully obvious that memh is initialized. 2006-04-14 21:12:00 +00:00
christos
a5fe7389ec Coverity CID 720: Remove dead code. 2006-04-14 21:06:47 +00:00
christos
62070a9393 Coverity CID 1091: Avoid NULL deref by moving offending code inside if
statement.
2006-04-14 20:56:26 +00:00
christos
8b8ee40c22 Coverity CID 1092: Get the status earlier to avoid NULL deref. 2006-04-14 20:53:38 +00:00
christos
1882f76728 Coverity CID 1099: Don't deref NULL if !DIAGNOSTIC 2006-04-14 20:51:41 +00:00
christos
fa0ae9e82b Coverity CID 1531: Clarify why we cannot overrun static here, and use
__arraycount() instead of #define constant.
2006-04-14 20:48:53 +00:00
christos
b7f5449dce Coverity CID 1534: Fix bogus code and array overruns. 2006-04-14 20:43:11 +00:00
christos
a66f866e5e Coverity CID 726: Remove bogus test. ni was checked for not NULL lines above,
and the if condition tries to free ni!
2006-04-14 20:33:57 +00:00
christos
838d9e686d Coverty CID 1317: Avoid negative index. 2006-04-14 20:31:28 +00:00
christos
bdbf984fe7 Coverity CID 725: Remove dead code. 2006-04-14 20:20:33 +00:00
jmmv
4652eeb82c Get rid of the memt and memh local variables in the pcdisplay_{get,put}wschar
functions.
2006-04-12 20:08:20 +00:00
jmmv
efbda7406a Convert to ANSI prototypes. 2006-04-12 20:06:16 +00:00
jmmv
7a51d4dddc Add an extra cookie to the ioctl and mmap wsdisplay accessops that points
to the screen on which they are being called.  The driver cannot guess
this by itself but it is needed to implement, at least, the getwschar and
putwschar functions in the correct place.  There are no functional changes
yet.

Tested on i386 (vga, vga_raster, machfb, vesafb), macppc and sparc64.
Suggested and reviewed by macallan@.
2006-04-12 19:38:22 +00:00
bouyer
2aa3711744 Don't use ppr_option uninitialized. Coverity ID 2504. 2006-04-10 22:35:28 +00:00
bouyer
98675b2b44 Don't use ppr_options uninitialized. Coverity ID 2506. 2006-04-10 22:32:56 +00:00
dyoung
3bda9d9f8c In atw_start, do not initialize lasttx with -1, but initialize it
with the next free transmit descriptor.  Now, it is more obvious
that lasttx is not an illegal negative index into the descriptor
ring.  Remove a superfluous assertion.

Addresses Coverity CID 1319.
2006-04-06 06:08:26 +00:00
dyoung
660587743a Correct sc_bbptype, sc_rftype bounds checks. Fixes Coverity CID
1541.
2006-04-06 05:47:23 +00:00
drochner
cd401662a8 Move the ga_getborder()/vga_setborder() calls from accessops to the
ioctl handler.
Also fix error reporting for the vga_getborder() call.
2006-04-05 15:19:54 +00:00
uwe
ccf4b50a2c KNF: no parentheses around return value. 2006-04-05 01:13:50 +00:00
uwe
a31a2f7d75 ANSI'ify. 2006-04-05 01:05:50 +00:00
uwe
0eaa91ef03 Add dc_stride member to igsfb_devconfig.
Eliminate all mentions of rasops_info from igsfb_ioctl(), we have all
the information in igsfb_devconfig now.  It's semantically correct to
serve that info from there, not from a cached copy in rasops_info.
2006-04-04 23:43:40 +00:00
uwe
771831be53 Use bus_space_vaddr() to get the address of the framebuffer. 2006-04-04 23:00:15 +00:00
uwe
fc2595db94 Use designated initializers for wsscreen structs. It takes less space
and is easier to read.  While here, update function name in comment.
2006-04-04 22:36:15 +00:00
uwe
3995a3168e Nuke delay() that sneaked in with one of old revisions. It's not
necessary.

When we attach as console on netwinder, the timer is not yet attached,
so delay() resorts to a busy loop.  That loop takes BIGNUM seconds(!)
to complete.  That makes you think the machine wedged.
2006-04-04 22:25:23 +00:00
uwe
752f872bf4 Fix indentation nits. 2006-04-03 21:18:20 +00:00
uwe
d5925f5050 Honor RI_FULLCLEAR in igsfb_accel_eraserows. 2006-04-03 21:03:15 +00:00
uwe
774263e48a Properly fix cursor sprite endianness problems: always build
cc_sprite[] in little-endian, as that's how the card wants it.

Tested on netwinder (hardware bswap) by myself, and on current krups
kernel (no bswap) and 3.0 krups kernel (software bswap) by macallan.
2006-04-03 20:44:35 +00:00
gdamore
9a2b9dd63b Reorganize ath layout as requested by sam@ and suggested by dyoung@ in
http://mail-index.netbsd.org/tech-net/2006/03/15/0000.html.

The new layout almost precisely matches FreeBSD, and should make
future imports much easier.

At the same time, import the current 0.9.16.16 HAL from FreeBSD.  According
to sam@, this is the proper version we should be using.
2006-04-02 05:52:14 +00:00
thorpej
2709fdc80e Remove isp_unit -- it is not used. 2006-03-29 04:43:56 +00:00
thorpej
2be6494fc9 Use device_cfdata(). 2006-03-29 04:16:44 +00:00
thorpej
39cd836ee1 Use device_unit(). 2006-03-28 17:38:24 +00:00
dyoung
b307a01ecd Revamp ieee80211_get_rate. Now it does not use the rateset in the
ic->ic_bss, but it uses the rateset in its new ieee80211_node
argument, instead.  If the rate is fixed by ic->ic_fixed_rate, but
the fixed rate is not in the node's rateset, choose a reasonable
default: prefer the lowest basic rate or, if there is no basic
rate, prefer the lowest rate, period.

Change a printf complaint to a debug message.

Adapt drivers to suit new ieee80211_get_rate calling convention.

XXX I really need to replace ieee80211_get_rate with a bitrate
XXX adaptation algorithm.  Soon, soon....
2006-03-28 00:48:10 +00:00
dyoung
facc99b314 Set the channel frequency and flags in the radiotap headers in
rtw_tune instead of in rtw_start, rtw_intr_rx.
2006-03-27 22:03:36 +00:00
dyoung
3168e87b4f Remove unused argument ifflagsp from rtw_dmamap_load_txbuf. 2006-03-27 22:02:02 +00:00
dyoung
bf0b9fa559 Fix my typo in ath(4)'s radiotap presence field (receive direction)
so that the signal and noise are in dB, not dBm.  Since dBm signal
and noise come before the antenna field, the capture fields were
in the wrong order.  That made for some astonishing (and wrong)
radiotap captures.  dB signal and noise come after the antenna
field, so everything is in the right order, now.
2006-03-27 21:41:23 +00:00
rpaulo
4ed37fa0d7 Add support for the Conexant RS7112. From Frank Wille <frank@phoenix.owl.de>. 2006-03-25 23:10:50 +00:00
thorpej
246504f91c Use device_parent(). 2006-03-25 22:55:55 +00:00
he
77c27ad055 Add a driver, ciss(4), for the HP/Compaq drivers using the newer
"Command Interface to SCSI-3 Support" command interface.  Driver
ported from OpenBSD by Tonnerre Lombard -- thanks!
2006-03-21 20:42:14 +00:00
rtr
d6ba186243 avoid deref of NULL
coverity 2436 / run 6
2006-03-19 06:22:45 +00:00
chris
aee09871fa Fix eeprom == NULL and size test.
Fixes Coverity CID 1109: (sc)->eeprom_data tracked as NULL was
dereferenced.
2006-03-18 18:44:16 +00:00
bouyer
d3f24ba785 __wdcwait_reset(): if we hare there we have a wdc pointer, so no need to check
if wdc is not NULL here at all (we were doing it after wdc has been
dereferenced anyway).
Coverity ID 2441.
2006-03-18 10:59:58 +00:00
christos
7a151ba681 include if_ether.h if you want to use ether_sprintf() 2006-03-16 15:59:22 +00:00
tsutsui
6b6bdb9538 Oops, fix botch in previous. 2006-03-14 15:33:11 +00:00
tsutsui
4b0dbc6b50 TAB/space cleanup. 2006-03-14 15:24:30 +00:00
dyoung
8a1b831b7f NetBSD authorities apprehended and confiscated these leading spaces
pursuant to KNF regulation 100145.92, "All your leading ASCII-SP
is belong to us."  The code was set up the ASCII-TAB.
2006-03-12 03:34:37 +00:00
dyoung
c205496a96 Note in radiotap header file and manual page that radiotap fields
are little-endian.  Fix wi(4) and atw(4) to reflect this fact.
2006-03-12 03:22:02 +00:00
dyoung
f94708e4c4 Bug fix: fields in the radiotap header are little-endian, make it so. 2006-03-12 03:07:50 +00:00
dyoung
cb909aeabe Fix typo: change an impossible bitfield (ends at bit 32) to a
possible one (ends at bit 31).
2006-03-10 23:37:35 +00:00
lukem
a1f606d3fd Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.
2006-03-08 23:46:22 +00:00
dyoung
cafe884d2c Change macro names to avoid collisions:
BIT -> __BIT
BITS -> __BITS
2006-03-08 08:26:50 +00:00
dyoung
ce412dc403 Straggler from previous commit: rename macro LSHIFT->SHIFTIN. 2006-03-08 00:26:43 +00:00
dyoung
f66403a698 Move my bit-twiddling macros to libkern.h from my drivers, where
I had duplicated them.  Improve the macros' names.  Simplify their
implementation.

A brief description of each macro is below.

        BIT(n): Return a bitmask with bit m set, where the least
                significant bit is bit 0.

        BITS(m, n): Return a bitmask with bits m through n, inclusive,
                    set.  It does not matter whether m>n or m<=n.
                    The least significant bit is bit 0.

        A "bitfield" is a span of consecutive bits defined by a
        bitmask, where 1s select the bits in the bitfield.  SHIFTIN,
        SHIFTOUT, and SHIFTOUT_MASK help read and write bitfields
        from device registers.

        SHIFTIN(v, mask): Left-shift bits `v' into the bitfield
                          defined by `mask', and return them.  No
                          side-effects.

        SHIFTOUT(v, mask): Extract and return the bitfield selected
                           by `mask' from `v', right-shifting the
                           bits so that the rightmost selected bit
                           is at bit 0.  No side-effects.

        SHIFTOUT_MASK(mask): Right-shift the bits in `mask' so that
                             the rightmost non-zero bit is at bit
                             0.  This is useful for finding the
                             greatest unsigned value that a bitfield
                             can hold.  No side-effects.  Note that
                             SHIFTOUT_MASK(m) = SHIFTOUT(m, m).

Examples:

/*
 * Register definitions taken from the RFMD RF3000 manual.
 */
#define RF3000_GAINCTL          0x11            /* TX variable gain control */
#define         RF3000_GAINCTL_TXVGC_MASK       BITS(7, 2)
#define         RF3000_GAINCTL_SCRAMBLER        BIT(1)

/*
 * Shift the transmit power into the transmit-power field of the
 * gain-control register and write it to the baseband processor.
 */
atw_rf3000_write(sc, RF3000_GAINCTL,
    SHIFTIN(txpower, RF3000_GAINCTL_TXVGC_MASK));


/*
 * Register definitions taken from the ADMtek ADM8211 manual.
 *
 */
#define ATW_RXSTAT_OWN          BIT(31)         /* 1: NIC may fill descriptor */
/* ... */
#define ATW_RXSTAT_DA1          BIT(17)         /* DA bit 1, admin'd address */
#define ATW_RXSTAT_DA0          BIT(16)         /* DA bit 0, group address */
#define ATW_RXSTAT_RXDR_MASK    BITS(15,12)     /* RX data rate */
#define ATW_RXSTAT_FL_MASK      BITS(11,0)      /* RX frame length, last
                                                 * descriptor only
                                                 */

/* Extract the frame length from the Rx descriptor's
 * status field.
 */
len = SHIFTOUT(rxstat, ATW_RXSTAT_FL_MASK);
2006-03-08 00:24:06 +00:00
wiz
e2a71c2aab 'advertisment' -> 'advertisement', from leonardo chiquitto filho
via jmc@openbsd.
2006-03-07 18:15:28 +00:00
he
94da908135 Remove another instance of the SET/CLR/ISSET macro tripelet, now
found in <sys/types.h>.
2006-03-07 08:21:00 +00:00
rjs
b2e4ee2926 Remove SET/CLR/ISSET macros. 2006-03-05 19:10:30 +00:00
christos
1b2709754a cleanup more SET/CLR/ISSET lossage 2006-03-05 17:33:33 +00:00
thorpej
59c5bfcbfc LP54 -> LP64 in a comment. 2006-03-04 20:44:11 +00:00
dyoung
25e9e914b4 Miscellaneous ath(4) and net80211 updates and bug-fixes coming from
sam@ and various open source repositories:

ath(4):

        Ignore "phantom" beacon misses: should stabilize connections
        to access points (no more ceaseless link-UP/DOWN indications).
        Also, re-synchronize beacon timer using the TSF in the
        first beacon received after joining a BSS---this should
        also help suppress spurious beacon misses.  I am hopeful
        that this will help ath(4) lossage reported by perry@ and
        smb@.

        Add new configuration through sysctl.

        Use a shorter calibration interval until IQ calibration
        finishes.

        Report antenna noise through radiotap.

        Rudiments of Radar Detection / Dynamic Frequency Selection.

        Update to HAL version 0.9.16.13.

        Update open sources for changes to the HAL API.

        Add HALs for additional architectures: add big-endian ELF
        HALs for sparc64 and for PowerPC.  Also add a Alpha HAL.
        These new HALs are untested under NetBSD.

ath(4) + net80211:

        Make the multicast transmit rate configurable by ioctl.

        Miscellaneous bug fixes.
2006-03-02 03:38:26 +00:00
dyoung
cee154c1e6 Quiet ath(4) when debug output is enabled with the hw.athX.debug
sysctl: only print messages pertaining to transmission when
ATH_DEBUG_XMIT is set, instead of printing them when ATH_DEBUG_ANY
is set.

Patch via Sam Leffler.
2006-02-27 06:18:47 +00:00
wiz
5d1e8b2745 Fix some typos. 2006-02-25 02:28:55 +00:00
wiz
1ad8067cb3 Fix typos, reported by Alexey Dobriyan ("Gathered from Linux"),
forwarded by jmc@openbsd.
2006-02-25 00:58:34 +00:00
macallan
998a8ba3e2 clear the whole screen on startup, fix an endianness mismatch when creating
the cursor sprite - this needs to be tested ( and probably fixed ) on a
netwinder.
2006-02-24 18:35:09 +00:00
macallan
31038cb7db Add support for virtual consoles to igsfb.
Works fine on a Krups, needs testing on other ports.
2006-02-23 08:01:59 +00:00
thorpej
3ddf26777f Use device_is_active() rather than testing dv_flags for DVF_ACTIVE
directly.
2006-02-20 16:50:36 +00:00
jmcneill
b74d978f79 Prevent vga from attaching if vesafb is the console. Accessing VGA
registers after switching to a VESA linear framebuffer mode is not
guaranteed to work. This should fix the majority of the problems people
have been experiencing with vesafb.

XXX: Still doesn't fix the assertion in wscons with options DIAGNOSTIC.
2006-02-19 15:16:53 +00:00