Commit Graph

15545 Commits

Author SHA1 Message Date
Kevin Lo
f910c56c11 Add header files <sys/lock.h> and <sys/mutex.h> for mtx_init() and friends.
Approved by: cognet
2006-12-07 15:24:38 +00:00
Ariff Abdullah
cc726a7f98 Don't try to workaround broken apps (if any). If this still the case,
lets fix the broken apps instead.
2006-12-07 07:48:58 +00:00
Ariff Abdullah
b45d0ec80d Remove comment that is no longer relevant since previous
buffering fix.
2006-12-07 07:48:20 +00:00
John Baldwin
5c356a4834 Fix compile with BCE_DEBUG. The last one tripped up gcc 2.95 on 4.x even
with BCE_DEBUG turned off.
2006-12-06 22:53:22 +00:00
Max Laier
294410acf6 Drop the iwi softc lock when calling back into net80211 on rx. This fixes a
LOR with direct dispatch in the netisr.

Reported and tested by:	Munehiro Matsuda
Submitted by:		jhb
LOR id:			194
2006-12-06 21:23:51 +00:00
John Baldwin
d78cd1ad55 Fix some edge cases in detach() as well as a memory leak if we fail to
talk to the BMC.

Reported by:	Alexander Logvinov : ports at logvinov_com
MFC after:	1 week
2006-12-06 15:10:11 +00:00
Colin Percival
8b0a738288 Correct a signedness bug which allowed members of the operator
group to read kernel memory.

Security:	FreeBSD-SA-06:25.kmem
2006-12-06 09:13:51 +00:00
Marius Strobl
fc64bae41b Use our own callout instead of if_slowtimo() for driving lance_watchdog()
in order to avoid races accessing if_timer.
2006-12-06 02:14:31 +00:00
Marius Strobl
05856e0b8f - Use the hme_tick() callout instead of if_slowtimo() for driving
hme_watchdog() in order to avoid races accessing if_timer.
- Use bus_get_dma_tag() so hme(4) works on platforms requiring it.
- Don't bother to set if_mtu to ETHERMTU, ether_ifattach() does that.
2006-12-06 02:07:20 +00:00
Marius Strobl
8cb37876d6 - Use the gem_tick() callout instead of if_slowtimo() for driving
gem_watchdog() in order to avoid races accessing if_timer.
  While at it relax the watchdog a bit by reloading it in gem_tint()
  if there are still packets enqueued.
- Don't bother to set if_mtu to ETHERMTU, ether_ifattach() does that.
- Fix inconsistencies in prototypes.
2006-12-06 02:04:25 +00:00
Marius Strobl
b1d161435e - Use our own callout (the dc_tick() callout uses varying periods
depending on the NIC and isn't used at all with HomePNA links)
  instead of if_slowtimo() for driving dc_watchdog() in order to
  avoid races accessing if_timer.
- Use bus_get_dma_tag() so dc(4) works on platforms requiring it.
- Don't bother to set if_mtu to ETHERMTU, ether_ifattach() does that.
- Remove an alpha remnant in dc_softc.
2006-12-06 01:56:38 +00:00
John Baldwin
81b6f8d5df Fix an off by one error in struct nve_tx_desc's frags[] array as a result
of the nvenet lib upgrade (the constant went from 63 (2^n - 1) to
32 (2^n)).  For reasons that are not obvious to me this fixes the driver
on at least some NICs.

MFC after:	3 days
2006-12-05 15:31:05 +00:00
Matt Jacob
dd9fc7c319 Make ISPCTL_PLOGX find a handle to log into the management server
with- not hope for the best. Change some things which were gated
off of 24XX to be gated off of 2K login support. Convert some
isp_prt calls to xpt_print calls.
2006-12-05 07:50:23 +00:00
Matt Jacob
351c7054ea Add a chip timeout to ENABLE/MODIFY/DISABLE lun calls.
MFC after:	1 month
2006-12-05 07:49:15 +00:00
Matt Jacob
a841a81629 use xpt_print function 2006-12-05 07:47:22 +00:00
Warner Losh
07defc61a9 const poison
submitted by: john wehle
2006-12-05 06:19:36 +00:00
Warner Losh
6c818b5fa3 More properly cleanup the iicbus child when deleting it.
These are from patches by John Wehle, but the commentary has been
updated by me.

Obtained from: ports/multimedia/pvr250, indirectly
2006-12-05 06:11:10 +00:00
Warner Losh
7362a1ad37 Reference Hauppage's cxm_iic bit-bang device here.
Add a note that suggests a cleanup.

Note: This patch was derived based on looking at the pvrxxx/pvr250
ports' Makefiles only, and may be incomplete.  It is not derived from
anything I saw from Hauppage.
2006-12-05 05:06:59 +00:00
Jung-uk Kim
7ee00338c5 - Add BGE_FLAG_JUMBO flag which idicates jumbo frame capability. Some day we
may be able to support jumbo frames for BCM5714 and BCM5780.
- Rename BGE_IS_5705_OR_BEYOND() to BGE_IS_5705_PLUS() for consistency.
2006-12-04 22:12:21 +00:00
Jung-uk Kim
0dae9719c3 Use bge_flags to save chipset family and remove dead code while I am here. 2006-12-04 19:50:49 +00:00
Gleb Smirnoff
426742bf4d Fix my error in rev. 1.152
Submitted by:	oleg
2006-12-04 14:35:17 +00:00
Marius Strobl
e46af1289e Remove the HME_LOCK_ASSERT() in hme_mifinit(), which was added in the
previous revision; it's actually ok when invoking hme_mifinit() from
hme_config() without the lock held.
2006-12-04 01:53:40 +00:00
Marius Strobl
f279f5ced4 - In hme_stop() mask all interrupts.
- In hme_eint() print MIF register contents on MIF interrupts.
- In hme_mifinit() don't bother to preserve the previous MIF config.
  This was mainly done in order to preserve the PHY select bit (external
  or internal PHY) but which only needs to be set as appropriate when
  reading from or writing to the desired PHY in hme_mii_{read,write}reg().
  Similarly don't bother to set the PHY select bit in hme_mii_statchg().
- In hme_mii_{read,write}reg() ignore requests to PHYs other than the
  external and internal PHY one.
- Move enabling/disabling the MII drivers of the external transceiver
  from hme_init_locked() and based on the sheer presence of an external
  to hme_mifinit() and based on the currently selected media, defaulting
  to the internal transceiver when the media hasn't been set, yet.
  Invoke hme_mifinit() from the newly added hme_mediachange_locked() so
  the setting of the MII drivers is updated when changing media.
  These changes keep the MII bus from wedging (which manifests in the HME
  and the PHYs no longer being able to communicate with each other) when
  the PHY device drivers isolate the unused PHY in two-PHY configurations
  as present in f.e. Netra t1 100 while changing media, either from
  hme_init_locked() (see also below) or via ifconfig(8). They also allow
  for using both transceivers/PHYs.
- In the newly added hme_mediachange_locked() also reset the PHYs in two-
  PHY configurations before invoking mii_mediachg(). This is required
  for successfully unisolating the previously unused PHY when switching
  between PHYs.
- Now that changing media should no longer cause problems back out rev.
  1.27 and re-enable setting the current media in hme_init_locked() (see
  the commit message of rev. 1.23 for more info).

These changes are roughly a merge of NetBSD gem.c rev. 1.32 - 1.35 (1.30
was already fixed differently in our 1.36; 1.31 and 1.32 were wrong) with
some parts reworked and things that don't make sense like setting the MII
drivers and restoring the previous MIF and XIF settings in hme_mii_{read,
write}reg() omitted.

MFC after:	2 weeks
2006-12-04 00:51:08 +00:00
Matt Jacob
c5da377e0e Fix a massive couple of botches here: the NVRAM settings
read wasn't flagging the SYNC mode was enabled. The temp
values for offset and sync period were uint8_t, but were
being assigned and shifted from a uint32_t value.

This didn't show up in testing because a random number
of 1030 cards set a bit that says "honor BIOS negotiation",
which means this whole code path was skipped.

This should clear up at least some of the negotation
issues that have been seen.
2006-12-03 07:59:12 +00:00
Matt Jacob
b61386a482 Fix XPT_GET_TRANSPORT_SETTINGS to zero validity and flags-
this was causing us to not negotiate sync at all, or at
random.
2006-12-03 07:22:15 +00:00
Matt Jacob
f2b93482b8 Forced commit: previous revision just correctly reflected that
the number of attached devices is 16 bits wide, not 8 bits wide.
2006-12-03 00:29:51 +00:00
Matt Jacob
a54067cc0e Fix a debug message which didn't quite get it right about data direction.
Fix things to use the LSI-Logic Fusion Library mask and shift names for
offset and sync, no matter how awkward they are, in preference to just
plain numbers.
2006-12-03 00:28:11 +00:00
Marius Strobl
f448ecb4f5 - Probe Davicom DM9102 PHYs.
- Don't set MIIF_NOISOLATE so amphy(4) can be used in configurations
  with multiple PHYs. There doesn't seem to be a problem with isolating
  AM79c873 and workalikes per se nor in combination with the NICs they're
  used with and amphy(4) was already adding IFM_NONE anyway.
- Use mii_phy_add_media() instead of mii_add_media() so the latter can
  be eventually retired.
- Take advantage of mii_phy_setmedia().
- Fix a whitespace nit.

Obtained from:	NetBSD dmphy(4) (except for the last item)
MFC after:	2 weeks
2006-12-02 21:21:16 +00:00
Marius Strobl
65169ee9c6 - In acphy_service() for the MII_TICK case don't bother to check whether
the currently selected media is of type IFM_AUTO as auto-negotiation
  doesn't need to be kicked anyway.
- Fix a whitespace nit.
- Probe another Altima PHY, which is a AC101 workalike and integrated
  in at least ADMtek ADM8511 but apparently is not mentioned in any
  publically available data sheet so the actual identifier is unknown.
- Don't set MIIF_NOISOLATE so acphy(4) can be used in configurations
  with multiple PHYs. There doesn't seem to be a problem with isolating
  AC101 and workalikes per se nor in combination with the NICs they're
  used with.
- Use mii_phy_add_media() instead of mii_add_media() so the latter can
  be eventually retired.
- Take advantage of mii_phy_setmedia().

Obtained from:	NetBSD (except for the first and second item)
MFC after:	2 weeks
2006-12-02 21:19:54 +00:00
Marius Strobl
18e13cb9aa - Add another Altima PHY, which is a AC101 workalike and integrated
in at least ADMtek ADM8511 but apparently is not mentioned in any
  publically available data sheet so the actual identifier is unknown.
- Add Davicom DM9102 PHY.
- Add DM9101 to the description of AMD 79C873 as at least some Davicom
  DM9101F identify identical to AMD 79C873.

Obtained from:	NetBSD
MFC after:	2 weeks
2006-12-02 21:18:56 +00:00
Marius Strobl
9dd3a16881 - Don't set MIIF_NOISOLATE so tdkphy(4) can be used in configurations
with multiple PHYs. There doesn't seem to be a problem with isolating
  78Q2120 per se nor in combination with the NICs they're used with and
  tdkphy(4) was already adding IFM_NONE anyway.
- Set MIIF_NOLOOP as loopback doesn't work with this PHY. The MIIF_NOLOOP
  flag currently triggers nothing but hopefully will be respected by
  mii_phy_setmedia() later on.
- Use mii_phy_add_media() instead of mii_add_media() so the latter can
  be eventually retired.
- Take advantage of mii_phy_setmedia().

Thanks to Hans-Joerg Sirtl for lending me test hardware.

Obtained from:	NetBSD tqphy(4)
MFC after:	2 weeks
2006-12-02 20:16:45 +00:00
Marius Strobl
ba76315fa2 - Don't set MIIF_NOISOLATE so rgephy(4) can be used in configurations
with multiple PHYs and un-comment case IFM_NONE in case MII_MEDIACHG
  rgephy_service(). There doesn't seem to be a problem with isolating
  RTL8169S and their internal PHY.
- Take advantage of mii_phy_add_media(). [1]

Obtained from:	NetBSD [1]
Tested by:	yongari
MFC after:	2 weeks
2006-12-02 19:48:53 +00:00
Marius Strobl
028ccec463 Some style changes to a couple of PHY drivers:
- Fix some whitespace nits.
- Fix some spelling in comments.
- Use MII_ANEGTICKS instead of 5.
- Don't define variables in nested scope.
- Remove superfluous returns at the end of void functions.
- Remove unused static global rgephy_mii_model.
- Remove dupe $Id$ in tdkphy(4).
- Sort brgphys table.

MFC after:	2 weeks
2006-12-02 19:36:25 +00:00
Ariff Abdullah
2229d0cfa2 Add support for Apple Intel/Mac.
- Playback and headphone/speaker automute works.
 - Recording untested due to me being deaf doing back-and-forth
   remote debugging.

Free Macbook donation is highly appreciated :)

Tested by:	Dennis Pielken <mips128@gmx.net>
2006-12-02 17:12:24 +00:00
Marius Strobl
a35b933378 Add a helper function mii_phy_dev_probe(), which wraps around the
mii_phy_match() API and takes care of the PHY device probe based on
the struct mii_phydesc array and the match return value provided.
Convert PHY drivers to take advantage of mii_phy_dev_probe(),
converting drivers to provide a mii_phydesc table in the first
place where necessary.

Reviewed by:	yongari
MFC after:	2 weeks
2006-12-02 15:32:34 +00:00
Max Laier
d9cbee0c7d ALTQify ep(4).
Tested and Requested by:	Andy Brook
MFC after:			3 days
2006-12-01 20:29:55 +00:00
Sam Leffler
30e218c0a0 clarify shortcut return
Submitted by:	cognet, kevlo
MFC after:	1 week
2006-12-01 16:03:39 +00:00
Ruslan Ermilov
16f1e614d9 Grammar nit. 2006-12-01 13:07:52 +00:00
Ariff Abdullah
fbf953b58e Add inverted amplifier sense quirk for HP Compaq nx4300.
PR:		kern/106104
Submitted by:	Shun-ichi Kobayashi <koba@mbox.kudpc.kyoto-u.ac.jp>
MFC after:	3 days
2006-12-01 06:53:13 +00:00
Jung-uk Kim
d2d67b956c Fix white spaces. 2006-12-01 01:37:45 +00:00
Jung-uk Kim
7e6e2507b6 Simplify statistics updates, remove redundant register reads, and add
discarded RX packets to input error for BCM5705 or newer chipset as the others.
Unfortunately we cannot do the same for output errors because ifOutDiscards
equivalent register does not exist.  While I am here, replace misleading and
wrong BGE_RX_STATS/BGE_TX_STATS with BGE_MAC_STATS.  They were reversed but
worked accidently.
2006-12-01 01:08:52 +00:00
Ruslan Ermilov
03eab9f7a6 Fix the hardware VLAN tagging. TX was broken on little-endian
machines and both TX and RX were broken on big-endian machines.

The chip design is crazy -- on RX, it puts the 16-bit VLAN tag
in network byte order (big-endian) in the 32-bit little-endian
register!

Thanks to John Baldwin for helping me document this change! ;-)

Tested by:	sat (amd64), test program (sparc64)
PR:		kern/105054
MFC after:	3 days
2006-11-30 21:01:59 +00:00
Maxim Konovalov
91d7721c0b o ciss.ko depends on cam and pci.
PR:		kern/105989
Submitted by:	nork
MFC after:	1 month
2006-11-30 15:14:17 +00:00
Gleb Smirnoff
df79d5278f - Instead of if_watchdog/if_timer interface use our own timer
that piggybacks on fxp_tick() callout.
2006-11-30 14:58:01 +00:00
Gleb Smirnoff
b74e67fbfb - Instead of if_watchdog/if_timer interface use our own timer
that piggybacks on bge_tick() callout.
- Lock bge_tick() using callout_init_mtx().
2006-11-30 13:40:39 +00:00
Christian Brueffer
b3ef1381d4 Remove pre-5.3 compatibility ifdefs.
Approved by:	rwatson (mentor)
MFC after:	5 days
2006-11-29 21:42:48 +00:00
Alfred Perlstein
06a061cef3 Stop INVARIANTS panics in if_aue with a stopgap.
aue_tick calls several synchronous usb functions from a timeout(9),
this is very broken since a timeout(9) is run as an interrupt
and the usb functions tsleep.

A stopgap fix is to schedule a taskqueue task from the timeout
and defer work to that taskqueue task.
2006-11-29 19:19:44 +00:00
Andrew Gallatin
a1480dfbad Fix mxge_submit_8rx() to behave like the comments says it does,
and ensure that it copies at most 32 bytes at a time.
2006-11-29 15:30:39 +00:00
Ariff Abdullah
57d90e7fbe Fix support for Medion MD MD95257 (GPIO2 quirk).
Reported by:	Chris Tophe <cohika@gmail.com>
2006-11-29 15:15:30 +00:00
Warner Losh
674a914028 MFp4:
Preliminary support for Atmel AT45D series of DataFlash on the
	SPI bus (ok, not really a hardware bus, but a logical
	connection).  This works only for the 8MB version of the part
	due to hard coding.  Both read and write are supported.
2006-11-29 08:05:55 +00:00