Commit Graph

13658 Commits

Author SHA1 Message Date
Søren Schmidt
70037ab36a Apply fix for "pr82261 DMA-support on Sparc64 broken"
The Acer chip or wiring that SUN uses has problems that this patch
tries to work around.
Original patch by Marius Strobl, hacked into shape by me..
2005-08-23 08:53:01 +00:00
Joseph Koshy
e753fde4e6 On x86 processors, turn off any 'INTERRUPT' capabilities on PMCs
if the CPU does not have its local APIC enabled.

MFC after:	3 days
2005-08-22 18:20:41 +00:00
Joseph Koshy
744d67975f Return EOPNOTSUPP instead of EINVAL if a PMC allocation request
specifies a PMC capability (e.g., sampling) that is not supported
by hardware.  Return EINVAL early if the PMC class passed in is
not recognized.

MFC after:	3 days
2005-08-22 18:18:20 +00:00
Joseph Koshy
a8eb16c5ea Print PMC capabilities at module load time.
MFC after:	3 days
2005-08-22 17:51:08 +00:00
Søren Schmidt
971846e49c Fix problem on Promise "mio" controllers and 48bit mode caused by last commit 2005-08-22 11:38:53 +00:00
Joseph Koshy
d4d6be499f Turn off sampling modes on the AMD64 till the time I can track down
the reason for the double fault seen when sampling under load.

MFC after:	3 days
2005-08-22 02:59:51 +00:00
Warner Losh
fa949fc86d if_ral_pccard does not depend on pccard module directly, but rather
depends, like all other pccard drivers, indirectly through kobj on
pccard.  Therefore, it is not appropriate to force pccard to be loaded
when if_ral.ko is loaded.  This makes it possible to load if_ral w/o
loading pccard.ko on, eg, pci only systems.
2005-08-22 00:20:28 +00:00
Damien Bergamini
30feefb1d2 Fix basic rates set for 802.11a/g operating modes. This can significantly
improve transfer rates in 802.11a/g.  Fix IFS settings in ral(4) too.

MFC after:	6 days
2005-08-21 14:16:20 +00:00
Damien Bergamini
fb533d55c6 Enhanced WME (802.11e) support. 2005-08-21 09:52:18 +00:00
Damien Bergamini
ec01dc2bbc Add some necessary bits for upcoming 802.11e support:
o management of multiple tx rings (up to 4)
o setting of WME IE in association requests

Some features are still missing though, like the possibility to override
the default cwmin/cwmax/asfn values of each tx queues.
2005-08-20 16:49:03 +00:00
Damien Bergamini
d599e39db8 Remove IEEE80211_C_WPA from capabilities flags. WPA support is not fully
implemented in ipw.

MFC after:	1 week
2005-08-20 15:03:41 +00:00
Damien Bergamini
4ab4bbc6fe Export adapter's internal statistics sysctl even if IPW_DEBUG is not defined.
MFC after:	1 week
2005-08-20 14:41:16 +00:00
Damien Bergamini
94a7a9a24d Export adapter's internal statistics sysctl even if IWI_DEBUG is not defined.
MFC after:	1 week
2005-08-20 14:34:54 +00:00
Damien Bergamini
e0454c269b Don't automatically start scanning in if_init() if IEEE80211_ROAMING_MANUAL
flag is set.

MFC after:	1 week
2005-08-20 14:28:37 +00:00
John Baldwin
c8b27aca43 Fixup locking and mark MPSAFE:
- Add locked versions of start and init.  The SRM_MEDIA code in dc_init()
  stayed in dc_init() instead of moving to dc_init_locked() to make the
  locking saner.
- Use callout_init_mtx().
- Fixup locking in detach and ioctl.
- Lock the driver in the ifmedia callouts.
- Don't recurse on the driver lock.
- De-spl.

MFC after:	3 days
2005-08-18 19:10:07 +00:00
John Baldwin
2a3e25a07f Fixup locking for sf(4) and mark MPSAFE:
- Add locked variants of start, init, and ifmedia_upd.
- Use callout_* instead of timeout/untimeout.
- Don't recurse on the driver lock.
- Fixup locking in ioctl.
- Lock the driver lock in the ifmedia handlers rather than across
  ifmedia_ioctl().

Tested by:	brueffer
MFC after:	3 days
2005-08-18 17:09:16 +00:00
Maxim Sobolev
536fde3465 In re_shutdown() mark interface as down since otherwise we will panic if
interrupt comes in later on, which can happen in some uncommon cases.

Another possible fix is to call re_detach() instead of re_stop(), like
ve(4) does, but I am not sure if the latter is really RTTD, so that stick
with this one-liner for now.

PR:		kern/80005
Approved by:	silence on -arch, no reply from selected network gurus
2005-08-18 14:29:01 +00:00
Brooks Davis
d3c497e1c8 Remove an unnecessicary bzero that was zeroing the softc's struct ifnet
pointer.

Submitted by:	brueffer
Reviewed by:	dfr
2005-08-17 18:53:06 +00:00
John Baldwin
8a8573fdb2 - Use htole32() instead of using bswap32() conditional on #if BYTE_ORDER.
- Don't set IFF_ALLMULTI in our ifnet's if_flags if we end up allowing
  all multicast due to limits in the MAC receive filters in hardware.

Requested by:	rwatson (2)
2005-08-17 17:46:51 +00:00
John Baldwin
6da5b383f1 Remove the unused TULIP_CSR_{READ,WRITE}BYTE macros. 2005-08-17 17:45:19 +00:00
John Baldwin
9eda9d7ac5 Add callout_drain()'s to foo_detach() after calling foo_stop() to make sure
that if softclock is running on another CPU and is blocked on our driver
lock, we will wait until it has acquired the lock, seen that it was
cancelled, dropped the lock, and awakened us so that we can safely destroy
the mutex.

MFC after:	3 days
2005-08-17 17:44:32 +00:00
Hajimu UMEMOTO
c219fd0c5e don't raise cpu speed over the value when passive cooling is in
effect.  since CPU speed is restored by degrees, we cannot use
the facility of saving cpu speed by CPUFREQ_set() effectively.
so, we need to save the value when passive cooling is in effect.

Repoeted by:	Kevin Oberman <oberman__at__es.net>
2005-08-17 17:01:25 +00:00
Søren Schmidt
85047b1b0c Add support for working around controllers that cannot do DMA in 48bit mode.
The workaround use PIO mode above ~137GB to allow using the disk.
Add the Acer chips with rev < 0xc4 as first candidate.
2005-08-17 15:00:33 +00:00
Søren Schmidt
fb235b243c Use the bio field instead of the driver field as intended. 2005-08-17 14:50:18 +00:00
John Baldwin
45f3f78ced Catch up to ic_curchan changes by making the same change here that was made
in ipw(4) in the earlier ic_curchan mega commit.

Submitted by:	Øyvind Kolbu oyvind at kolbu dot ws
Tested by:	Stefan Ehmann shoesoft at gmx dot net
2005-08-17 14:08:52 +00:00
Christian S.J. Peron
8677689134 Ensure that file flags such as schg, sappnd (and others) are honored
by md(4). Before this change, it was possible to by-pass these flags
by creating memory disks which used a file as a backing store and
writing to the device.

This was discussed by the security team, and although this is problematic,
it was decided that it was not critical as we never guarantee that root will
be restricted.

This change implements the following behavior changes:

-If the user specifies the readonly flag, unset write operations before
 opening the file. If the FWRITE mask is unset, the device will be
 created with the MD_READONLY mask set. (readonly)
-Add a check in g_md_access which checks to see if the MD_READONLY mask
 is set, if so return EROFS
-Do not gracefully downgrade access modes without telling the user. Instead
 make the user specify their intentions for the device (assuming the file is
 read only). This seems like the more correct way to handle things.

This is a RELENG_6 candidate.

PR:		kern/84635
Reviewed by:	phk
2005-08-17 01:24:55 +00:00
John Baldwin
ca5fc32d02 Fixup locking in if_my(4) and mark it MPSAFE:
- Add locked variants of my_start() and my_init().
- Assert that the lock is held in several places rather than recursing.
- Overhaul failure case handling in my_attach() so that it will actually
  clean up completely in each of the failure cases.
- Setup the interrupt after ether_ifattach() in my_attach().
- Remove unused callout handle from softc.
- Free the metadata for the descriptors my_in detach() (we leaked it
  before).
- Fix locking in my_ioctl().
- Remove spls.

Tested by:	brueffer
MFC after:	3 days
2005-08-16 20:39:30 +00:00
Marius Strobl
1b279bfb52 - Change the code that determines whether to use a serial console and
which serial device to use in that case respectively to not rely on
  the OFW names of the input/output and stdin/stdout devices. Instead
  check whether input and output refers to the same device and is of
  type serial (uart(4) was already doing this) and for the fallback
  to a serial console in case a keyboard is the selected input device
  but unplugged do the same for stdin and stdout in case the input
  device is nonexistent (PS/2 and USB keyboards) or has a 'keyboard'
  property (RS232 keyboards). Additionally also check whether the OFW
  did a fallback to a serial console in the same way in case the
  output device is nonexistent. While at it save on some variables
  and for sys/boot/sparc64/loader/metadata.c move the code in question
  to a new function md_bootserial() so it can be kept in sync with
  uart_cpu_getdev_console() more easily.
  This fixes selecting a serial console and the appropriate device
  when using a device path for the 'input-device' and 'output-device'
  OFW environment variables instead of an alias for the serial device
  to use or when using a screen alias that additionally denotes a
  video mode (like e.g. 'screen:r1024x768x60') but no keyboard is
  plugged in (amongst others). It also makes the code select a serial
  console in case the OFW did the same due to a misconfiguration like
  both 'input-device' and 'output-device' set to 'keyboard' or to a
  nonexisting device (whether the OFW does a fallback to a serial
  console in case of a misconfiguration or one ends up with just no
  console at all highly depends on the OBP version however).
- Reduce the size of buffers that only ever need to hold the string
  'serial' accordingly. Double the size of buffers that may need to
  hold a device path as e.g. '/pci@8,700000/ebus@5/serial@1,400000:a'
  exceeds 32 chars.
- Remove the package handle of the '/options' node from the argument
  list of uart_cpu_getdev_dbgport() as it's unused there and future
  use is also unlikely.

MFC after:	1 week
2005-08-15 20:58:36 +00:00
Warner Losh
1dd467ac95 Some preliminary support for Megahertz XJEM and CCEM (same cards really)
combo cards.
2005-08-15 18:28:49 +00:00
Warner Losh
dfad9073ad Diff reduction to my tree: commit the trivial part of efforts to add
support for the really old Megahertz ethernet/modem combo cards.
2005-08-15 17:20:34 +00:00
Bjoern A. Zeeb
e3c18d1d11 * Solve "No PHY found" problem for more Yukon Lite variants.
* Catch a bus attach error.
* Improve locking.

MFC after:	6 days
2005-08-13 11:13:12 +00:00
Sam Leffler
b831470b4d fix handling of the current channel (missed in previous commit) 2005-08-13 00:30:26 +00:00
Sam Leffler
80f05a81d9 fix media_status so devd recognizes the device as an 802.11 interface
Submitted by:	Robert C. Noland III
2005-08-13 00:04:42 +00:00
Sam Leffler
6ee571b27a correct CTS duration calculation; SIFS+ACK should use the xmit rate not
the rate for CTS

MFC after:	3 days
Obtained from:	Atheros
2005-08-12 23:11:44 +00:00
Søren Schmidt
c7dc7718f6 Add support for the Promise PDC4071[89] chips used on fx the Fasttrak TX4300.
Docs kindly provided by Promise.
2005-08-12 16:54:11 +00:00
Nate Lawson
84cdcfb36f Modify the fix in rev 1.16 slightly. Instead of setting the cap to zero,
just skip summing it if it's unknown.

MFC after:	1 day
2005-08-11 17:12:57 +00:00
John Baldwin
22f6205d3b Use device_printf() and if_printf() and remove dc_unit from softc. 2005-08-10 20:33:46 +00:00
John Baldwin
fc8c1e5d98 Use if_printf() and device_printf() and axe sf_unit from the softc as a
result.
2005-08-10 20:24:39 +00:00
John Baldwin
bd295e68c6 - Remove pre-new-bus code under #if 0 and some other rotted code under
#if 0.
- Use pci_enable_busmaster() to enable busmastering instead of frobbing
  the command register directly.
- Don't check to see if memory or I/O can be enabled by writing to the
  command register.  The PCI bus driver's bus_alloc_resource() method
  already checks this and will fail if it can't enable the bit.
2005-08-10 20:21:29 +00:00
John Baldwin
1261113169 - Use if_printf() and device_printf() instead of outputting my%d:
everywhere.  This means that my_unit is no longer used as well.  The
  watchdog routine now also prints 'my0: ...' rather than 'm0x0: ...'.
- Don't bzero the softc and don't try to free it in detach or if attach
  fails.
- A whitespace fix.
2005-08-10 20:15:56 +00:00
John Baldwin
3e17bf524e - Use callout_init_mtx() to close races between hme_stop() and hme_tick().
- Use the driver lock instead of Giant in a bus dma callback.
- Clear IFF_DRV_(RUNNING|OACTIVE) in hme_stop() instead of just clearing
  RUNNING in hme_ioctl() to be more like other ethernet drivers.
- Lock the driver lock around mii operations.
- Remove spls.
- Cleanup locking in hme_ioctl().

MFC after:	1 week
2005-08-10 20:12:25 +00:00
Sam Leffler
b5c9941514 Clarify/fix handling of the current channel:
o add ic_curchan and use it uniformly for specifying the current
  channel instead of overloading ic->ic_bss->ni_chan (or in some
  drivers ic_ibss_chan)
o add ieee80211_scanparams structure to encapsulate scanning-related
  state captured for rx frames
o move rx beacon+probe response frame handling into separate routines
o change beacon+probe response handling to treat the scan table
  more like a scan cache--look for an existing entry before adding
  a new one; this combined with ic_curchan use corrects handling of
  stations that were previously found at a different channel
o move adhoc neighbor discovery by beacon+probe response frames to
  a new ieee80211_add_neighbor routine

Reviewed by:	avatar
Tested by:	avatar, Michal Mertl
MFC after:	2 weeks
2005-08-10 16:22:30 +00:00
David E. O'Brien
c11ba30c9a Remove public declarations of variables that were forgotten when they were
made static.
2005-08-10 07:10:02 +00:00
David E. O'Brien
35038adf6e Fix FBSDid style nit. 2005-08-10 03:56:31 +00:00
David E. O'Brien
fba19691c7 Add proper copyright attribution. 2005-08-10 03:54:37 +00:00
John Baldwin
fcde23065f Call tulip_start() rather than tulip_ifstart() from the interrupt handler
to avoid recursing on the driver lock.  Not sure why my test box didn't
catch this earlier.

MFC after:	3 days
2005-08-09 21:53:26 +00:00
Paul Saab
7a0c10de8d There's no reason to check the valence. This allows ciss to work
on the P600.
2005-08-09 20:53:51 +00:00
Robert Watson
13f4c340ae Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE and
IFF_DRV_RUNNING, as well as the move from ifnet.if_flags to
ifnet.if_drv_flags.  Device drivers are now responsible for
synchronizing access to these flags, as they are in if_drv_flags.  This
helps prevent races between the network stack and device driver in
maintaining the interface flags field.

Many __FreeBSD__ and __FreeBSD_version checks maintained and continued;
some less so.

Reviewed by:	pjd, bz
MFC after:	7 days
2005-08-09 10:20:02 +00:00
John Baldwin
3212724cc0 - Use callout_init_mtx() to close a small race between callout_stop() and
the timeout routine.
- Fix locking in detach.
- Add locking in shutdown.
- Don't mess with the PCI command register in resume, the PCI bus driver
  already does this for us.
- Add locking to the non-serial ifmedia routines.
- Fix locking in ioctl.
- Remove spls and support for 4.x.

MFC after:	1 week
2005-08-08 21:03:54 +00:00
Robert Watson
6a113b3de7 Merge the dev_clone and dev_clone_cred event handlers into a single
event handler, dev_clone, which accepts a credential argument.
Implementors of the event can ignore it if they're not interested,
and most do.  This avoids having multiple event handler types and
fall-back/precedence logic in devfs.

This changes the kernel API for /dev cloning, and may affect third
party packages containg cloning kernel modules.

Requested by:	phk
MFC after:	3 days
2005-08-08 19:55:32 +00:00