Commit Graph

15415 Commits

Author SHA1 Message Date
Kevin Lo
afe898bca2 Remove unused structures.
Reviewed by: cognet and imp
Approved by: cognet and imp
2006-11-09 02:19:30 +00:00
John Baldwin
fa6f748fe3 Fix some edge cases in detach (including attach failures):
- Only call iwi_stop() if we got far enough along in iwi_attach() to
  alloc an ifnet.
- Release the firmware after stopping the interface and detaching the
  ifnet.

MFC after:	1 month
Reviewed by:	sam
2006-11-07 19:03:42 +00:00
John Baldwin
d65926888d Various whitespace cleanups. 2006-11-07 18:55:51 +00:00
Ruslan Ermilov
4f32adad48 Sometimes the vty switching has to be delayed; the vty
to be switched to is saved in sc->delayed_next_scr and
the actual switch is performed later.  It was possible
to get into the endless loop when attempting to switch
to a closed vty (which is not allowed and beep-alerted
when attempted) and when the visual beep was in effect.
This caused sc->delayed_next_scr to never be reset and
endless attempts to switch to a closed vty and endless
visual beeping.  How to repeat:

- boot into single-user
- run "kbdcontrol -b visual"
- quickly press Alt+F2 two times

PR:		kern/68016
X-MFC after:	6.2-RELEASE
2006-11-06 19:06:07 +00:00
Robert Watson
43593547a3 Add missing includes of priv.h. 2006-11-06 17:43:10 +00:00
Robert Watson
acd3428b7d Sweep kernel replacing suser(9) calls with priv(9) calls, assigning
specific privilege names to a broad range of privileges.  These may
require some future tweaking.

Sponsored by:           nCircle Network Security, Inc.
Obtained from:          TrustedBSD Project
Discussed on:           arch@
Reviewed (at least in part) by: mlaier, jmg, pjd, bde, ceri,
                        Alex Lyashkov <umka at sevcity dot net>,
                        Skip Ford <skip dot ford at verizon dot net>,
                        Antoine Brodin <antoine dot brodin at laposte dot net>
2006-11-06 13:42:10 +00:00
Rink Springer
42a4336a90 Added PCI ID's for:
- 0x1065: Intel 82562ET/EZ/GT/GZ PRO/100 VE Ethernet [1], as found on
  Tyan GS14 barebones.
- 0x1094: Intel Pro/100 946GZ (ICH7) Network Connection [2], as found on
  Intel 946GZis motherboards.

[1] Submitted by:	myself
[2] Submitted by:	Mike Tancsa <mike@sentex.net>
Reviewed by:		imp (mentor), jfv
Approved by:		imp (mentor)
MFC after:		3 days
2006-11-06 12:19:43 +00:00
Takanori Watanabe
7687221959 Prevent freeing wild pointer when bailing out. 2006-11-06 12:14:27 +00:00
Warner Losh
8e6c8e8c0c Doh! Actually commit checking against NULL for res.
Noticed by: dougb@
2006-11-04 06:56:51 +00:00
Scott Long
eae94b6727 Add PCI Id for ServeRAID 8k.
Submitted by: Danny Braniss
2006-11-03 04:57:23 +00:00
Matt Jacob
162eef1f09 Fix some negotiation issues (like not being able to negotiate async) 2006-11-02 23:19:00 +00:00
Matt Jacob
d993cb4daf add some missing MPT<>CAM and CAM<>MPT bogolocks 2006-11-02 23:18:25 +00:00
Matt Jacob
98981e638f Use 2K Login f/w. 2006-11-02 03:23:01 +00:00
Matt Jacob
10365e5a68 Add 4Gb (24XX) support and lay the foundation for a lot of new stuff. 2006-11-02 03:21:32 +00:00
Matt Jacob
bd3fd815a7 2nd and final commit that moves us to CAM_NEW_TRAN_CODE
as the default.

Reviewed by multitudes.
2006-11-02 00:54:38 +00:00
Marius Strobl
9e264172bd Remove <sys/types.h>; including both <sys/param.h> and <sys/types.h>
violates style(9).
2006-11-02 00:05:15 +00:00
Marius Strobl
65deb9d947 - In sunkbd_probe_keyboard() don't bother to determine the keyboard layout
as we have no use for that info. Instead let this function return the
  keyboard ID and verify at its invocation in sunkbd_configure() that we're
  talking to a Sun type 4/5/6 keyboard, i.e. a keyboard supported by this
  driver.
- Add an option SUNKBD_EMULATE_ATKBD whose code is based on the respective
  code in ukbd(4) and like UKBD_EMULATE_ATSCANCODE causes this driver to
  emit AT keyboard/KB_101 compatible scan codes in K_RAW mode as assumed by
  kbdmux(4). Unlike UKBD_EMULATE_ATSCANCODE, SUNKBD_EMULATE_ATKBD also
  triggers the use of AT keyboard maps and thus allows to use the map files
  in share/syscons/keymaps with this driver at the cost of an additional
  translation (in ukbd(4) this just is the way of operation).
- Implement an option SUNKBD_DFLT_KEYMAP, which like the equivalent options
  of the other keyboard drivers allows to specify the default in-kernel
  keyboard map. For obvious reasons this made to only work when also using
  SUNKBD_EMULATE_ATKBD.
- Implement sunkbd_check(), sunkbd_check_char() and sunkbd_clear_state(),
  which are also required for interoperability with kbdmux(4).
- Implement K_CODE mode and FreeBSD keypad compose.
- As a minor hack define KBD_DFLT_KEYMAP also in the !SUNKBD_EMULATE_ATKBD
  case so we can obtain fkey_tab from <dev/kbd/kbdtables.h> rather than
  having to duplicate it and #ifdef some more code.
- Don't use the TX-buffer for writing the two command bytes for setting the
  keyboard LEDs as this consequently requires a hardware FIFO that is at
  least two bytes in depth, which the NMOS-variant of the Zilog SCCs doesn't
  have. Thus use an inlined version of uart_putc() to consecutively write
  the command bytes (a cleaner approach would be to do this via the soft
  interrupt handler but that variant wouldn't work while in ddb(4)). [1]
- Fix some minor style(9) bugs.

PR:		90316 [1]
Reviewed by:	marcel [1]
2006-11-02 00:01:15 +00:00
Pawel Jakub Dawidek
a777323904 Style nits. 2006-11-01 18:59:06 +00:00
Pawel Jakub Dawidek
5541f25ec7 Fix md(4) panic which occurs when I/O request different than
BIO_READ/BIO_WRITE is sent to vnode-backed provider (BIO_DELETE or
BIO_FLUSH).

Reported by:	ceri

Add support for BIO_FLUSH to vnode-backed md(4) devices based on
VOP_FSYNC().
2006-11-01 18:56:18 +00:00
John Baldwin
186d340f75 Fix compile botch in the last panic botch fix. :(
Pointy hat:	jhb
Reported by:	brueffer
2006-11-01 18:24:12 +00:00
John Baldwin
8d7b3b9566 Fix botch in last commit (I tested on 6.x which doesn't have TSO):
- Test the mac_type rather than if_hwassist (since ifp doesn't exist yet)
  to determine if the adapter supports TSO and thus to change the sizes
  for the bus_dma tag.

Reviewed by:	glebius
2006-11-01 15:36:47 +00:00
Kevin Lo
c0348f2e02 Document the cdp for controlling CD power.
Approved by: cognet
2006-11-01 03:45:24 +00:00
Pawel Jakub Dawidek
9cd394ea96 Implement BIO_FLUSH handling for da(4), amr(4), ata(4) and ataraid(4).
Sponsored by:	home.pl
2006-10-31 21:19:25 +00:00
John Baldwin
77cae244f8 Allocate receive and transmit data structures during attach() and free them
during detach() similar to other NIC drivers rather than allocating them
during init() and freeing them during stop():
- Move creation of tx bus_dma tag amd maps and tx_buffer_area from
  em_setup_transmit_structures() to em_allocate_transmit_structures().
- Call em_allocate_xxx_structures() in em_attach().
- Only call em_free_xxx_structures() in em_detach().
- Change em_setup_xxx_structures() to free any existing tx or rx buffers
  and in the case of rx repopulate the ring with newer buffers.

Reviewed by:	jfv
2006-10-31 17:21:14 +00:00
John Baldwin
7b2d1aabb1 - Use callout_init_mtx() to close various callout-related races.
- Drain the two timers in detach.
- Check IFF_DRV_RUNNING in the link task and bail w/o doing anything if
  it is clear.

Reviewed by:	jfv, scottl
2006-10-31 17:05:02 +00:00
Gleb Smirnoff
72f0301fef Rework the transmit register handling. In em_encap() store index of
the EOP descriptor in the first descriptor of the packet. And then
in em_txeof() search for DD bits set only in the EOP descriptors,
embedding the cleanup of all packet's descriptors into inner loop.

This change is important for future chips, where DD bit is going
to be set only on the EOP descriptors.

Submitted by:	jfv
2006-10-31 16:19:21 +00:00
John Baldwin
223eee05e4 Remove unused softc pointer variable from the probe routine.
CID:		1560
Found by:	Coverity Prevent (tm)
2006-10-31 16:13:38 +00:00
Gleb Smirnoff
7c007dd329 Merge new vendor release - 6.2.9.
Details:
o if_em.c changes:
  - Added several new PCI ids.
  - Check em_check_phy_reset_block() before doing SIOCSIFMEDIA ioctl.
  - Don't touch TARC registers, they are now handled in shared
    code in if_em_hw.c.
  - Move RDH and RDT setting to the end of
    em_initialize_receive_unit().
  - Declare em_read_pcie_cap_reg(), now empty.
o if_em_hw.c dropped in from vendor, then restored rev. 1.15.
o if_em_hw.h dropped in from vendor, then modified:
  - Added RX overrun interrupt flag to interrupt enable mask.
  - Remove declarations of em_io_read(), em_io_write().

Approved by:	jfv
2006-10-31 15:00:14 +00:00
Matt Jacob
fa9ed86506 The first of 3 major steps to move the CAM layer forward to using
the CAM_NEW_TRAN_CODE that has been in the tree for some years now.

This first step consists solely of adding to or correcting
CAM_NEW_TRAN_CODE pieces in the kernel source tree such
that a both a GENERIC (at least on i386) and a LINT build
with CAM_NEW_TRAN_CODE as an option will compile correctly
and run (at least with some the h/w I have).

After a short settle time, the other pieces (making
CAM_NEW_TRAN_CODE the default and updating libcam
and camcontrol) will be brought in.

This will be an incompatible change in that the size of structures
related to XPT_PATH_INQ and XPT_{GET,SET}_TRAN_SETTINGS change
in both size and content. However, basic system operation and
basic system utilities work well enough with this change.

Reviewed by:	freebsd-scsi and specific stakeholders
2006-10-31 05:53:29 +00:00
Scott Long
9df92bda76 Fix a typo in the device ID table that prevented 5708S chips from being
detected.

Submitted by: pyun
2006-10-31 03:28:25 +00:00
Kevin Lo
127ce9bca0 Add support for Option GT 3G/3G quad datacard in ubsa.
Approved by: cognet
2006-10-31 02:27:24 +00:00
Warner Losh
a12fb4e632 Assign start to the value we were able to allocate and use that to
write out the BAR.  Otherwise, we were trying to shift a 32-bit
quantity on 32-bit platforms.  Also, 'start' check sanity to where it
is known.
2006-10-30 22:46:33 +00:00
Warner Losh
b0a2d4b8a9 More fully support 64-bit bars. Prior to this commit, we supported
only those bars that had addresses assigned by the BIOS and where the
bridges were properly programmed.  Now even unprogrammed ones work.
This was needed for sun4v.  We still only implement up to 2GB memory
ranges, even for 64-bit bars.  PCI standards at least through 2.2 say
that this is the max (or 1GB is, I only know it is < 32bits).

o Always define pci_addr_t as uint64_t.  A pci address is always 64-bits,
  but some hosts can't address all of them.
o Preserve the upper half of the 64-bit word during resource probing.
o Test to make sure that 64-bit values can fit in a u_long (true on some
  platforms, but not others).  Don't use those that can't.
o minor pedantry about data sizes.
o Better bridge resource reporting in bootverbose case.
o Minor formatting changes to cope with different data types on different
  platforms.

Submitted by: jmg, with many changes by me to fully support 64-bit
addresses.
2006-10-30 19:18:46 +00:00
Takanori Watanabe
e4ab9f19d7 Driver for some ASUS desktop motherboard extras.
Though it is named after overclocking tool for ASUS motherboards,
it is not capable to change clock ratio or CPU core voltage.

This driver exports Templature, Power output voltage, Fan RPM under
dev.acpi_aiboost.0.*.

Descriptions for these values are set to sysctl describe, which can be
get by sysctl -d.
2006-10-30 05:38:48 +00:00
Marius Strobl
432120f2bb - Wrap code optimized for architectures without alignment constraints
in #ifdef __NO_STRICT_ALIGNMENT rather than #ifdef __i386__. This
  means that amd64 now also uses the optimized code. [1]
  While at it, fix a nearby style(9) bug.
- Remove the hw.dc_quick SYSCTL, which allowed to turn off the above
  mentioned optimization, as like the equivalent and already removed
- In dc_setcfg() suppress printing a warning when forcing the receiver
  and transceiver to idle state times out for chips where the status
  bits in question just never change (observed in detail with DM9102A)
  and therefore the warning would be highly likely false positive. [2]
- In dc_ifmedia_sts() add a missing DC_UNLOCK().

Tested by:	Hans-Joerg Sirtl on amd64 [1]
PR:		82681 [2]
Obtained from:	NetBSD tlp(4) [2]
MFC after:	1 week
2006-10-29 20:24:27 +00:00
Alexander Leidinger
394ebd352c MFP4:
Rename MAX_SAMPLE_RATES macro to OSS_MAX_SAMPLE_RATES.  The old
	macro clashed with those used in other applications and libaries
	(ex: RtAudio).  4Front responded by updating their spec, so we
	will follow suit.

Submitted by:	ryanb
Noticed by:	pointyhat/kris
2006-10-28 09:51:10 +00:00
Jack F Vogel
9251ddbfe7 Backout bogus checkin to HEAD
Approved by: scottl
2006-10-28 08:11:07 +00:00
Jack F Vogel
52f92a311c This is the merge of the Intel 6.2.9 driver. It provides all new shared code,
new device support, and it is hoped a more stable driver for 6.2. RELEASE.
This checkin was discussed and approved today by RE, scottl, jhb, and pdeuskar
2006-10-28 00:47:55 +00:00
Ruslan Ermilov
ac3912b020 Fix LEDs not working when atkbd is an active keyboard and the physical
keyboard is attached only after the system has already booted.

If USB keyboard is also present, and there's no kbdmux(4), the problem
has been hiding itself because as soon as we get to multi-user, the
USB keyboard becomes an active keyboard (see devd.conf), thus marking
atkbd inactive and letting the old code initialize the keyboard.

With kbdmux(4), or if there's no USB keyboard, the atkbd keyboard is
always active, whether it's physically attached or not, thus it never
initialized itself properly on a physical attach.

To fix this, move block that initialized the keyboard on attach upper
so it doesn't depend on the (KBD_IS_ACTIVE(kbd) && KBD_IS_BUSY(kbd))
condition.  Also move KBD_FOUND_DEVICE() a few lines upper so that
KDSETLED and KDSETREPEAT that follow it propagate to the controller.

MFC after:	3 days
2006-10-25 13:35:42 +00:00
Ruslan Ermilov
f280a8fbd3 Fix non-working CAPS LED under X by applying fix from atkbd.c,v 1.27:
: revision 1.27
: date: 2000/05/28 12:43:24;  author: ache;  state: Exp;  lines: +3 -2
: Manipulate with AltGR Led (really CapsLock Led) only in K_XLATE mode, because
: all other modes not set ALKED flag and it means that CapsLock always turned
: off for them.
: Real bug example is X11 which never turn on CapsLock with Russian keyboard.
:
: PR:             18651
: Submitted by:   "Mike E. Matsnev" <mike@po.cs.msu.su>

MFC after:	3 days
2006-10-25 12:22:19 +00:00
Ruslan Ermilov
9a583dc7ae Switch to using STAILQ_REMOVE_HEAD() instead of STAILQ_REMOVE_HEAD_UNTIL().
Submitted by:	Stepan A. Baranov

This corresponds to OpenBSD rev. 1.134:

: revision 1.134
: date: 2004/05/04 16:59:31;  author: grange;  state: Exp;  lines: +10 -10
: Remove useless ``elm'' argument from the SIMPLEQ_REMOVE_HEAD macro.
: This matches our SLIST behaviour and NetBSD's SIMPLEQ as well.
:
: ok millert krw deraadt
2006-10-24 11:17:46 +00:00
Scott Long
4eaefb8160 Refine the checksum hack a little. It appears that the chip can handle UDP
and TCP checksum offloading fine, it only has a problem with IP checksums on
IP fragments..  Barring a fix or workaround available from the hardware, the
real solution would be to have finer grained control in the stack over what
can and cannot be assisted in hardware.
2006-10-24 08:24:31 +00:00
Max Laier
aaae09da87 net80211 seems to give us more rates than specified via ic_sup_rates under
yet to be investigated circumstances. If that happens truncate to the number
of rates that the firmware supports.

Found by:	Jeremie Le Hen
Obtained from:	OpenBSD (w/ changes)
MFC after:	3 days
2006-10-23 00:34:07 +00:00
Alan Cox
2a53696fb8 The page queues lock is no longer required by vm_page_busy() or
vm_page_wakeup().  Reduce or eliminate its use accordingly.
2006-10-22 21:18:48 +00:00
Scott Long
49caa8a9f8 There seems to be a problem with txcsum and UDP. Turn it off until it is
understood better.  This fixes timeout problems with NFS.
2006-10-21 20:41:08 +00:00
Scott Long
61a1e7e66d Be more like the BGE driver. Ensure that at least 16 TX descriptors are
kept unused in the ring.  This check should probably be moved up to
bce_start_locked at some point, as it'll make the loop up there slightly
more efficient, and will eliminate a costly set of busdma operations when
the ring is full.  But this works for now.

This makes all of my UDP torture tests work.  I'll cautiously say that
it might even work for other users now.  Feedback is appreciated.
2006-10-21 07:54:39 +00:00
John-Mark Gurney
8946c28270 fix tab indentation for CP and RV...
If the length is zero, catch this early, instead of making dflen go negative
and letting bad things happen...  We also check to see if RV (checksum) is
0, and handle that has a checksum failure...

Properly handle checksum failures by not processing read-write VPD data,
and removing all the found read-only data...

Tested by:	oleg (dflen going negative)
2006-10-20 21:28:11 +00:00
Warner Losh
86663fabdd MFp4: when passing the transfer up the foodchain, make sure we go up
the food chain.  devi == NULL is the error condition.  Treat it as such.
2006-10-20 07:11:52 +00:00
Warner Losh
114b4164dd Preliminary MMC stack. This stack supports SD 1.0 cards only, but
should be easily adapted to SD 2.0 (aka SDHC), SDIO, MMC and MMCplus
cards.  At the present time, there's only one bridge driver for the
ARM9 based Atmel AT91RM9200.
2006-10-20 06:39:59 +00:00
David E. O'Brien
f220c6a2f9 style(9) 2006-10-19 10:04:46 +00:00