Commit Graph

15639 Commits

Author SHA1 Message Date
Søren Schmidt
a4b0727299 Add new PATA only JMicron chip. 2007-01-04 07:56:12 +00:00
Luigi Rizzo
d64492c407 protect against multiple inclusion (this is useful when you
start working with third party usb modules, where sometimes it
is not easy to set the inclusion order so that there are no multiple
inclusions, yet you want to compile with high WARNS levels).

I am not sure if there is a standard for having a leading and/or trailing _
in the macro name, the usb code seems to use both.

There are still several unprotected headers here so it might be useful
to do the same thing on other files as well as the need arises.

MFC After: 3 days
2007-01-03 10:50:03 +00:00
Scott Long
a91d6dab2e Make sure that all of the fields in the header are clean. It was possible for
unsafe flags to leak from one command to another.
2007-01-02 04:12:34 +00:00
John-Mark Gurney
5afbb3a8b1 remove delays that have been unnecessary since 2002... The iicbb driver
has the proper delays...
2006-12-31 19:42:47 +00:00
John Baldwin
5583491044 Fix fat-fingering in previous commit.
Pointy hat to:	jhb
2006-12-29 16:38:22 +00:00
John Baldwin
0dea849ae9 Various bpf(4) related fixes to catch places up to the new bpf(4)
semantics.
- Stop testing bpf pointers for NULL.  In some cases use
  bpf_peers_present() and then call the function directly inside the
  conditional block instead of the macro.
- For places where the entire conditional block is the macro, remove the
  test and make the macro unconditional.
- Use BPF_MTAP() in if_pfsync on FreeBSD instead of an expanded version of
  the old semantics.

Reviewed by:	csjp (older version)
2006-12-29 13:59:50 +00:00
Yaroslav Tykhiy
9b3d1b0253 Fix a group of typos:
preceed -> precede,
preceeded -> preceded,
preceeding -> preceding.

Submitted by:	Andre Guibert de Bruet <andy@siliconlandmark.com>
2006-12-29 13:08:46 +00:00
Pyun YongHyeon
2271eac77c Piggyback watchdog timer handling with msk_tick which is called every
hz. This will result in slightly faster Tx processing as it does not
need lock operations for callouts in msk_start/msk_txeof.
2006-12-29 04:55:38 +00:00
Pyun YongHyeon
b55031fd1a Fix interrupt handling on a dual port card. Previously it ignored
the second port interrupt if the first port was in down state.
Since I don't have a dual port card it's just guess work.

Noticed by:	jhb
2006-12-29 03:56:29 +00:00
Pyun YongHyeon
298946a985 Fix MSI support. Now it correctly allocates SYS_RES_IRQ resources
on Yukon II which reports it can handle two messages.

Submitted by:	jhb
Tested by:	bms
2006-12-29 03:33:33 +00:00
John Baldwin
2dccd58192 Update __FreeBSD_version check for pci_find_extcap() now that it is
present in 6.x.
2006-12-28 21:55:47 +00:00
John Baldwin
9d1f363daf Disable MSI on the Intel E7505 chipset. It is reported broken on a Tyan
S2665ANF motherboard.

Reported by:	"Eugene M. Kim" <blue at white lv>
2006-12-28 06:14:42 +00:00
Jung-uk Kim
7be240e621 Fix shared authentication mode. 2006-12-28 00:05:40 +00:00
Sam Leffler
aaa70f2f6f Add half/quarter rate 11a channel support:
o change handling of regdomain-related mib knobs so they can be set
  post-attach: regdomain, countrycode, outdoor, and xchanmode; the
  hal will not permit changing the regdomain but we expose it for now
o on regdomain/countrycode change recalculate the channel list and
  push it to the net80211 layer (NB: looks to need more tweaking)
o setup rate tables for half/quarter rate channels
o honor half/quarter rate channel configs when changing channels
o honor half/quarter rate channel configs when setting the slot time
o use hack/nonstandard channel numbering scheme for the public safety
  band to avoid overlapping 2.4G channels on dual-band cards
o remove setup of ic_sup_rates; the net80211 layer can do this for us
  and it simplifies handling of half/quarter rate channels

Tested only in Public Safety Band with cards that have RF5112.
2006-12-27 19:07:09 +00:00
Bruce Evans
b64728e55e After rev.1.169, the "interrupt" coalescing parameters are not used in
bge_intr().  Some of them are used in bge_poll().  Simplify by only
initializing these for polling mode and not toggling them when switching
modes.  This also fixes missing synchronization with the coalescing
engine in the toggling.
2006-12-26 18:33:55 +00:00
Jung-uk Kim
0c4578975e Back out revision 1.33. usb/98983 was misfiled and the patch had no effect.
The originator confirmed the adapter works fine without the patch.

Tested by:	Massimo Lusetti (mlusetti at gmail dot com)
2006-12-26 17:43:46 +00:00
Alfred Perlstein
cc8317f2b0 Fix a deadlock in detach/shutdown.
The problem was that I was acquiring the driver sx lock and then waiting
for a taskqueue to drain, however the taskqueue itself would try to
acquire the lock as well leading to a deadlock.

To fix the problem roll my own exclusive lock that allows for lock
cancellation.  This is a normal exclusive lock, however if someone
marks it as "dead" then all waiters who request an error return will
get back an error instead of continuing to wait for the lock.

In this particular case, the shutdown and detach functions kill the
lock while the async task thread tries to acquire the lock but will
abort if the lock returns an error.

The other option was to drop the driver lock mid-detach and mid-shutdown,
mid-detach was a ok, however mid-shutdown was not.

While I'm here, fix a bug in what appears to be the mii link status
word in the softc going out to lunch.  Explicitly set the status
word to 1 after initializing the mii.  This would result in an interface
that would never respond to "if_start" requests as the mii interface
would always look down.
2006-12-23 17:18:18 +00:00
Remko Lodder
9409f9ed87 Fix a typo in ata-queue.c
PR:		kern/107100
Submitted by:	Stephen J. Roznowski <sjr at comcast dot net>
Approved by:	sos
2006-12-23 12:40:54 +00:00
Ariff Abdullah
65de329ee2 Fix distorted sound on Intel Desktop Board D101GGC (ATI SB450/ALC861).
Turn on ALC861 quirk as default since it seems affecting all hardwares
with the same codec.

Reported/Tested by:	Darryl Yeoh <drl@MyBSD.org.my>
2006-12-22 11:55:59 +00:00
John Polstra
bf6ef57a40 Re-enable MSI support for those chips on which it is believed to work
properly.
2006-12-22 02:59:58 +00:00
John Polstra
65b8185c34 Correct the BGE_CHIPID_BCM5750_B0 constant.
MFC after:	1 week
2006-12-22 01:10:36 +00:00
Warner Losh
ee9391865e ACPIIO_BATT_GET_UNITS would always return ENXIO. However, it should never
return an error since it returns a count of battery devices in the system.
Set it to 0 explicitly, since it is the only switch branch that doesn't set
it.

# I guess no one uses it.
2006-12-22 00:57:26 +00:00
Xin LI
ca7d624355 On amd64 platform, use linux32 headers so 32-bit Linux applications
would be able to work with aac(4).

This approach is used by some other drivers as well.  However, we
need a more generic way to do this in order to avoid having to
special case headers in individual drivers for each platform.

Obtained from:	Adaptec (version b11518)
Approved by:	scottl
2006-12-20 17:10:53 +00:00
Bruce Evans
5b01e77c64 In bge_txeof(), cancel the watchdog timeout if all descriptors have
been handled instead of when at least one descriptor was just handled.
For bge, it is normal to get a txeof when only a small fraction of the
queued tx descriptors have been handled, so the bug broke the watchdog
in a usual case.
2006-12-20 12:03:21 +00:00
Bruce Evans
b848e03260 Avoid a race and a pessimization in bge_intr():
- moved the synchronizing bus read to after the bus write for the first
  interrupt ack so that it actually synchronizes everything necessary.

  We were acking not only the status update that triggered the interrupt
  together with any status updates that occurred before we got around
  to the bus write for the ack, but also any status updates that occur
  after we do the bus write but before the write reaches the device.
  The corresponding race for the second interrupt ack resulted in
  sometimes returning from the interrupt handler with acked but
  unserviced interrupt events.  Such events then remain unserviced
  until further events cause another interrupt or the watchdog times
  out.

  The race was often lost on my 5705, apparently since my 5705 has broken
  event coalescing which causes a status update for almost every packet,
  so another status update is quite likely to occur while the interrupt
  handler is running.  Watchdog timeouts weren't very noticeable,
  apparently because bge_txeof() has one of the usual bugs resetting the
  watchdog.

- don't disable device interrupts while bge_intr() is running.  Doing this
  just had the side effects of:
  - entering a device mode in which different coalescing parameters apply.
    Different coalescing parameters can be used to either inhibit or
    enhance the chance of getting another status update while in the
    interrupt handler.  This feature is useless with the current
    organization of the interrupt handler but might be useful with a
    taskqueue handler.
  - giving a race for ack+reenable/return.  This cannot be handled
    by simply rearranging the order of bus accesses like the race for
    ack+keepenable/entry.  It is necessary to sync the ack and then
    check for new events.
  - taking longer, especially with the extra code to avoid the race on
    ack+reenable/return.

Reviewed by:	ru, gleb, scottl
2006-12-20 11:14:45 +00:00
Marius Strobl
1d545c7a44 - Use the re_tick() callout instead of if_slowtimo() for driving
re_watchdog() in order to avoid races accessing if_timer.
- Use bus_get_dma_tag() so re(4) works on platforms requiring it.
- Remove invalid BUS_DMA_ALLOCNOW when creating the parent DMA tag
  and the tags that are used for static memory allocations.
- Don't bother to set if_mtu to ETHERMTU, ether_ifattach() does that.
- Remove an unused variable in re_intr().
2006-12-20 02:13:59 +00:00
Marius Strobl
3e0e67263b Fix a bug originally introduced in rev. 1.74; don't reloaded the
watchdog timer in dc_txeof() in case there are still unhandled
descriptors as dc_poll() invokes dc_poll() unconditionally.
Otherwise this would result in the watchdog timer constantly being
being reloaded and thus circumvent that the watchdog ever fires in
the DEVICE_POLLING case.

Pointed out by:	bde
2006-12-20 01:49:56 +00:00
Jung-uk Kim
45ee6ab350 Partially back out rev. 1.148 and use new ETHER_BPF_MTAP() macro for VLAN.
Remaining changes are cosmetic.
2006-12-20 01:12:07 +00:00
Jung-uk Kim
1beb06dd0d Use BMSR for link status in one more place and clean up more. 2006-12-20 00:34:12 +00:00
Jung-uk Kim
d56df7ca25 - Do not depend on auto negotiation for link speed/duplex status.
- Read link status from BMSR instead of auxilary status register.
- Clean up style(9) nits.
2006-12-20 00:08:47 +00:00
Bruce M Simpson
8f435158a3 Remove dependency on deprecated if_watchdog ABI.
Tested with a Sitecom RT2661 based card.
2006-12-19 17:37:41 +00:00
Ariff Abdullah
303f62b8a2 Fix distorted sound on Fujitsu Siemens AMILO Pa 1510.
Reported/Tested by:	infofarmer
2006-12-19 16:52:09 +00:00
Oleg Bulyzhin
5dda808582 - Add missing callout_drain() call.
- Synchronize bge_tick() with callout_reset/callout_stop() calls.
- Avoid using bge_tick() inside bge_link_upd(), use mii_pollstat() instead.

MFC after:	2 month
2006-12-19 08:57:46 +00:00
Oleg Bulyzhin
25ff664232 - Fix autonegotiation timer.
- Use MII_ANEGTICKS/MII_ANEGTICKS_GIGE defines instead of hardcoded value.
- Fix some comments.
- style(9)

MFC after:	2 month
2006-12-19 08:41:48 +00:00
Matt Jacob
06cacb29ca Restore revision 1.126 that got accidentally nuked. 2006-12-18 23:53:39 +00:00
Matt Jacob
805e1f828c Add back some CAM_NEW_TRAN code to make backporting to RELENG_6 easier. 2006-12-18 23:50:30 +00:00
Giorgos Keramidas
7810d9c616 Spell "Kensington Thinking Mouse" correctly. 2006-12-18 18:48:28 +00:00
Jung-uk Kim
7c929cf95b - Remove stale VPD support and its comment and get device name from VPD API.
- Do not repeatedly read vendor/device IDs while probing.
- Remove redundant bzero(3) for softc.  device_get_softc(9) does it for free[1].

Reviewed by:	glebius
Suggested by:	glebius[1]
2006-12-18 16:40:04 +00:00
Marius Strobl
b91805b4cd Correct the previous change:
- If we want mii_phy_add_media() to add 1000baseT media, we need to
  supply sc->mii_extcapabilities.
- Fix formatting when announcing autonegotiation support.
2006-12-18 02:14:26 +00:00
Matt Jacob
a4f3a2bef4 Try an experiment with using DMA to load firmware into a 2200- VERIFY
CHECKSUM fails. Oh well, but keep a couple of the changes.

Avoid overflow in usec counters when waiting for mailbox completion.
2006-12-17 16:59:19 +00:00
Ariff Abdullah
378e0c5c89 Latest updates for Envy24/24HT. Fix various issues with LOR and panic
during verbose booting.

Submitted by:	Konstantin Dimitrov <kosio.dimitrov@gmail.com>
2006-12-17 16:06:45 +00:00
Ariff Abdullah
5c46f47bd3 Add codec id for [1] Realtek ALC888 and [2] Sigmatel STAC9227
Found/Tested by:	[1] luigi
                	[2] Jean-Baptiste Quenot <jbq@caraldi.com>
2006-12-17 15:19:33 +00:00
Ariff Abdullah
dc9e52cfda Add support for Nvidia Nforce MCP04 AC97 controller.
PR:		kern/106829
Submitted by:	Frédéric Petit <fredantispam@free.fr>
2006-12-17 13:23:00 +00:00
Olivier Houchard
c29765b647 Do not special-case __ARMEB__, we handle that in the arm code.
Approved by:	sos
2006-12-16 14:00:54 +00:00
Ariff Abdullah
210bece19a Miscellaneous fixups and quirks for ASUS A7M, LG LW20 and
HP NX6325 laptops.
2006-12-16 09:14:58 +00:00
Matt Jacob
c3b65db84f Make some slight reorganization (bringing back in some
non-CAM_NEW_TRAN code) to make diffs to previous FreeBSD
versions more manageable.
2006-12-16 07:39:55 +00:00
Matt Jacob
3bda7a83b0 Implement ISP_RESET0 for PCI and SBUS attachments- isp_reset has
been modified to call ISP_RESET0 if it fails to do a reset. This
gives us a chance to disable interrupts.
2006-12-16 05:54:29 +00:00
Nick Hibma
9079fff550 Align the interfaces for the various watchdogs and make the interface
behave as expected.

Also:
- Return an error if WD_PASSIVE is passed in to the ioctl as only
  WD_ACTIVE is implemented at the moment. See sys/watchdog.h for an
  explanation of the difference between WD_ACTIVE and WD_PASSIVE.
- Remove the I_HAVE_TOTALLY_LOST_MY_SENSE_OF_HUMOR define. If you've
  lost your sense of humor, than don't add a define.

Specific changes:

i80321_wdog.c
  Don't roll your own passive watchdog tickle as this would defeat the
  purpose of an active (userland) watchdog tickle.

ichwd.c / ipmi.c:
  WD_ACTIVE means active patting of the watchdog by a userland process,
  not whether the watchdog is active. See sys/watchdog.h.

kern_clock.c:
  (software watchdog) Remove a check for WD_ACTIVE as this does not make
  sense here. This reverts r1.181.
2006-12-15 21:44:49 +00:00
Ariff Abdullah
7c302801bd Fix compilation using gcc 4.1.
Submitted by:	dougb
2006-12-15 05:15:17 +00:00
John Polstra
20aa3e4827 Disable bge MSI support for now. A couple of people warned me that there
are problems with it on several revisions of this chip.  I'll
re-enable it after I've sorted out which chip revisions work and which
don't.
2006-12-15 00:27:06 +00:00