Commit Graph

13415 Commits

Author SHA1 Message Date
Brooks Davis
7ba33d8222 Move if_alloc() up in fxp_attach() so there's an ifp before
mii_phy_probe() is called.

Committed via:	fxp0
2005-06-11 00:47:34 +00:00
Brooks Davis
f32e678d0c Add an evil hack to work around a cast from the softc to the ifnet that
I missed.  Since I did no rearrange any softcs, casting the result of
device_get_softc() to (struct ifnet **) and derefrencing it yeilds a
pointer to the ifp.  This makes at least vr(4) nics work.
2005-06-11 00:20:38 +00:00
Vinod Kashyap
faefda0be0 Acquire Giant before making some CAM calls that need Giant to be held. 2005-06-11 00:14:23 +00:00
Wes Peters
1026fbd360 Avoid deadlock in fxp driver when system runs out of mbufs.
MFC after:	1 week
Provided by:	Ernie Smallis <esmallis@stbernard.com>
2005-06-10 23:54:52 +00:00
Marius Strobl
169d14035a Wrap the calls to the ISA DMA specific sndbuf_dma*() functions of
sys/dev/sound/isa/sndbuf_dma.c (compilation depending on device isa)
in #ifdef DEV_ISA so sound(4) can be compiled without isa(4).

MFC after:	1 month
2005-06-10 21:33:14 +00:00
Marius Strobl
520b635320 - Hook up the new locations of the atkbdc(4), atkbd(4) and psm(4) source
files after they were repo-copied to sys/dev/atkbdc. The sources of
  atkbdc(4) and its children were moved to the new location in preparation
  for adding an EBus front-end to atkbdc(4) for use on sparc64; i.e. in
  order to not further scatter them over the whole tree which would have
  been the result of adding atkbdc_ebus.c in e.g. sys/sparc64/ebus. Another
  reason for the repo-copies was that some of the sources were misfiled,
  e.g. sys/isa/atkbd_isa.c wasn't ISA-specific at all but for hanging
  atkbd(4) off of atkbdc(4) and was renamed to atkbd_atkbdc.c accordingly.
  Most of sys/isa/psm.c, i.e. expect for its PSMC PNP part, also isn't
  ISA-specific.
- Separate the parts of atkbdc_isa.c which aren't actually ISA-specific
  but are shareable between different atkbdc(4) bus front-ends into
  atkbdc_subr.c (repo-copied from atkbdc_isa.c). While here use
  bus_generic_rl_alloc_resource() and bus_generic_rl_release_resource()
  respectively in atkbdc_isa.c instead of rolling own versions.
- Add sparc64 MD bits to atkbdc(4) and atkbd(4) and an EBus front-end for
  atkbdc(4). PS/2 controllers and input devices are used on a couple of
  Sun OEM boards and occur on either the EBus or the ISA bus. Depending on
  the board it's either the only on-board mean to connect a keyboard and
  mouse or an alternative to either RS232 or USB devices.
- Wrap the PSMC PNP part of psm.c in #ifdef DEV_ISA so it can be compiled
  without isa(4) (e.g. for EBus-only machines). This ISA-specific part
  isn't separated into its own source file, yet, as it requires more work
  than was feasible for 6.0 in order to do it in a clean way. Actually
  philip@ is working on a rewrite of psm(4) so a more comprehensive
  clean-up and separation of hardware dependent and independent parts is
  expected to happen after 6.0.

Tested on:	i386, sparc64 (AX1105, AXe and AXi boards)
Reviewed by:	philip
2005-06-10 20:56:38 +00:00
Brooks Davis
1b5a39d368 Revert the unnecessicary addition of some braces in fxp_attach(). Don't
explicitly free the ifp in fxp_detach(), the call to fxp_release() takes
care of it.
2005-06-10 20:42:02 +00:00
Marius Strobl
c016761c5e Delete a file that was meant to be renamed while repo-copying it but
wasn't and now is superfluous.
2005-06-10 17:36:34 +00:00
Brooks Davis
fc74a9f93a Stop embedding struct ifnet at the top of driver softcs. Instead the
struct ifnet or the layer 2 common structure it was embedded in have
been replaced with a struct ifnet pointer to be filled by a call to the
new function, if_alloc(). The layer 2 common structure is also allocated
via if_alloc() based on the interface type. It is hung off the new
struct ifnet member, if_l2com.

This change removes the size of these structures from the kernel ABI and
will allow us to better manage them as interfaces come and go.

Other changes of note:
 - Struct arpcom is no longer referenced in normal interface code.
   Instead the Ethernet address is accessed via the IFP2ENADDR() macro.
   To enforce this ac_enaddr has been renamed to _ac_enaddr.
 - The second argument to ether_ifattach is now always the mac address
   from driver private storage rather than sometimes being ac_enaddr.

Reviewed by:	sobomax, sam
2005-06-10 16:49:24 +00:00
Takanori Watanabe
2e6e32da7b Make ichsmb(4) child device handling properly. 2005-06-10 16:12:43 +00:00
Markus Brueffer
4aea1563d6 - Only create the led(4) interface, if setting the thinklight is possible
- Initialize val_ec with the content of the volume EC register
  for ACPI_IBM_METHOD_VOLUME and ACPI_IBM_METHOD_MUTE in acpi_ibm_sysctl_set()
  if there is no CMOS handle present. This fixes setting volume and mute on
  such models.

Submitted by:	ru
Approved by:	philip
2005-06-10 11:56:18 +00:00
Benno Rice
22dfcd1b30 Identify the Intel ICH4 EHCI controller. 2005-06-10 08:28:22 +00:00
Søren Schmidt
0c818c44db Enable SATA hotplug support.
Submitted by:	Olivier Houchard
2005-06-10 07:43:10 +00:00
Xin LI
4c3763445d Only set mode when the incoming ioctl is IOC_VOID, until we have better
solution against the ioctl collisions.

Submitted by:	Antoine Brodin <antoine.brodin at laposte net>
PR:		kern/81867
2005-06-10 05:20:33 +00:00
Søren Schmidt
a9b4f88e01 Fix the long standing problem with poor transferrates on Intel ICHH type
chips. The DMA timing value was set on device 0 for all devices :/

Prodded by: Harald Schmalzbauer
2005-06-09 21:13:44 +00:00
Markus Brueffer
a4bfd6388f Import a mostly rewritten and extended version of acpi_ibm:
- Restructured for easier extensibility and maintainability
- To be more uniform with the other ACPI extras drivers and to better reflect
  their actual meaning, some sysctls were moved:
    o brightness -> lcd_brightness
    o keylight   -> thinklight
    o enable     -> events
    o misckey    -> hotkey
    o avail_mask -> availmask
    o key_mask   -> eventmask
- New "initialmask" sysctl, which holds the initial eventmask
- The "wlan" sysctl is now read-only, since writing to it didn't have
  any effect
- The "version" sysctl was removed, since it seems to be the same (0x100)
  on all models I have seen
- Support for more hotkeys by the "hotkey" sysctl
- Improved support of ACPI events. Disabled by default, since it unexpectedly
  changes the behaviour of some keys. (on my T41p there are now 24 different
  keypress events that get reported)
- write support for: volume, mute, lcd_brightness and thinklight
- led(4) interface for the thinklight [1]
- New sysctls "fan" and "fan_speed" to support reading of fan status and speed
- New sysctl "thermal" to support reading of up to 8 thermal sensors

Reviewed by:	philip
Approved by:	philip
Submitted by:	simon [1]
Inspired by:	The Linux ibm_acpi driver by Borislav Deianov
		  http://ibm-acpi.sourceforge.net/
		The ThinkPad Button program (tpb) by Markus Braun
		  http://www.nongnu.org/tpb/
Thanks to:	brueffer, dvl, njl, philip, simon, takawata and the many
		testers from freebsd-acpi@ and freebsd-mobile@
2005-06-09 20:17:32 +00:00
Joseph Koshy
f263522a45 MFP4:
- Implement sampling modes and logging support in hwpmc(4).

- Separate MI and MD parts of hwpmc(4) and allow sharing of
  PMC implementations across different architectures.
  Add support for P4 (EMT64) style PMCs to the amd64 code.

- New pmcstat(8) options: -E (exit time counts) -W (counts
  every context switch), -R (print log file).

- pmc(3) API changes, improve our ability to keep ABI compatibility
  in the future.  Add more 'alias' names for commonly used events.

- bug fixes & documentation.
2005-06-09 19:45:09 +00:00
Søren Schmidt
52ac6e8db8 Fix the register offset for the ATAPI count register thats used to
wrestle the older Promise chips to do 48bit addressing.

Spotted by:	Martin Birgmeier
2005-06-09 19:00:37 +00:00
Warner Losh
591223e66b Use tabs instead of spaces to indent, per style(9)
Noticed by: njl
2005-06-09 18:46:36 +00:00
Søren Schmidt
a3ebeaa87b Use the presence of ctlr->dmainit instead of r_res1 to find out when to
initialise DMA.
2005-06-09 12:31:07 +00:00
Sam Leffler
8371372b25 Change station mode beacon timer setup to insure the calculated
nextTbtt is always ahead of the h/w TSF.

Reviewed by:	avatar
2005-06-09 04:10:01 +00:00
Warner Losh
7999556019 My abstracting out the MAC reading code to fix pccard broke pci. Add
back the reading of the MAC address in the 'standard' way.

Reported by: Jeremie Le Hen ( jeremie at le-hen dot org )
2005-06-08 23:15:33 +00:00
Søren Schmidt
a77a43c709 Add support for the Intel 31244.
Most code by the submitters, hammered upon to get the right ATA fell by me.

Submitted by:	Olivier Houchard
Submitted by:	Jia-Shiun Li
2005-06-08 20:02:55 +00:00
Sam Leffler
0f2e86fb2a Set the correct IFS parameters for the beacon tx queue
when operating in ap and adhoc modes.
2005-06-07 00:12:40 +00:00
Sam Leffler
e8fd88a37b Misc keycache changes:
o purge ath_initkeytable; it's not needed
o add multicast key search support for supporting multiple group keys
  (disabled for now; requires updated hal)
o create keycache entry for stations using open auth so they get h/w
  antenna management support
o add keycache -> node mapping table; eliminates mac-based lookup in
  the net80211 layer
2005-06-06 16:39:21 +00:00
Søren Schmidt
167719c3b2 Apply the usual woodoo for 64bitness. 2005-06-06 15:49:09 +00:00
Søren Schmidt
b397739aab Add support for nVidia's software RAID "MediaShield".
HW Sponsored by:	Yahoo!
2005-06-06 13:35:24 +00:00
Warner Losh
8e656629c7 Not yet ready to burn this, so unmark power stuff.... non-type 0 busses still need to do this 2005-06-06 06:05:32 +00:00
Warner Losh
67ba65663f Correct comment 2005-06-06 03:22:51 +00:00
Brooks Davis
e904a5aa62 Remove some variables the last commit stopped using so the code compiles. 2005-06-06 02:12:12 +00:00
Warner Losh
f8749e3d9b As threatened by BURN_BRIDGES, restire PCIR_MAPS and PCIR_HEADERTYPE 2005-06-05 23:08:59 +00:00
Warner Losh
721aafa81b Use same RID we allocated the resource with to free it 2005-06-05 23:05:26 +00:00
Warner Losh
a865bfcb9c These registers are saved by pci bus code. Remove from #if 0'd code anyway 2005-06-05 22:57:32 +00:00
Warner Losh
0613b6f9c4 Power state management now done in PCI bus code 2005-06-05 22:53:09 +00:00
Warner Losh
95af165d7f The PCI bus code saves/restores these config registers now. 2005-06-05 22:50:55 +00:00
Warner Losh
4d3c2a319c Powerstate stuff now done in PCI bus driver 2005-06-05 22:48:15 +00:00
Warner Losh
7ed5d5cc72 The PCI bus code saves/restores these config registers now. 2005-06-05 22:45:19 +00:00
Søren Schmidt
b9203a8aca Make nVidia SATA hotplug support DTRT.
HW sponsored by: Yahoo!
2005-06-05 21:18:26 +00:00
Søren Schmidt
05c84db123 Unbreak the ICH6 AHCI support in !48Bit mode. 2005-06-05 18:37:56 +00:00
Takanori Watanabe
6193c1880d Make ichsmb loadable.
PR:	kern/81912
Submitted by:	 nork
2005-06-05 11:55:29 +00:00
Marius Strobl
fce21e7e25 After some input from bde@ and rereading the datasheet use a MTX_SPIN
mutex instead of a MTX_DEF one in order to defer preemption while
reading the date and time registers. If we don't manage to read them
within the time slot where we are guaranteed that no updates occur we
might actually read them during an update in which case the output is
undefined.
2005-06-04 23:24:50 +00:00
Marius Strobl
3a61f787fb Replace the band-aid for allowing to call sunkbd_configure() multiple
times which was added in the last revision with what should be a proper
solution as long as keyboards that were pluggged in after the kernel
has fully booted aren't supported. I.e. when sunkbd_configure() is
called for the high-level console probe make sure that the keyboard is
both successfully configured (i.e. also probed) and attached. The band-
aid left the possibility to attach the keyboard device to the high-level
console without attaching the keyboard device itself when the keyboard
is plugged in after uart(4) attached but before syscons(4) does.
2005-06-04 21:54:31 +00:00
Marius Strobl
852962d3c5 On AXi and AXmp boards the NS16550 (used to connect keyboard and mouse)
share their IRQ lines with the i8042. Any IRQ activity (typically during
attach) on the NS16550 used to connect the keyboard when actually the
PS/2 keyboard is selected in OFW causes interaction with the OBP i8042
driver resulting in a hang (and vice versa). As RS232 keyboards and mice
obviously aren't meant to be used in parallel with PS/2 ones on these
boards don't attach to these NS16550 in case the RS232 keyboard isn't
selected in order to prevent such hangs.

Ok'ed by:	marcel
2005-06-04 21:52:56 +00:00
Marius Strobl
ecf4269527 Change the semantics of uart_cpu_getdev_keyboard() to only match SCCs/
UARTs used to connect keyboards and not also PS/2 keyboards and only
return their package handle in case the keyboard is the preferred one
according to the OFW but otherwise still regardless of whether the
keyboard is used for stdin or not. This is simply achieved by looking
at the 'keyboard' alias and returning the corresponding package handle
in case it refers to a SCC/UART. This is change is done in order to
give the keyboard which the OFW or the user selected in OFW on boards
that support additional types of keyboards besides the RS232 ones also
preference in FreeBSD. It will be also used to determine on Sun AXi and
Sun AXmp boards whether a PS/2 or a RS232 is to be used as these are
sort of mutual exclusive there (see upcoming commit to uart_bus_ebus.c).
Note that Tatung AXi boards have the same issue but the former code
happened to already give the PS/2 keyboard preference by not identifying
the respective UART as keyboard system device there because the PS/2
keyboard node precedes the keyboard UART one in the OFW device tree of
these boards (which isn't the case for the Sun AXi).

Ok'ed by:	marcel
2005-06-04 21:33:18 +00:00
Marius Strobl
d89b911644 - In machfb_configure() when probed for the high-level console return
the number of registered adapters instead of determining again whether
  stdout is a supported card (and which might have failed to attach and
  register).
- Fix a bug in the handling of the FBIOSCURSOR IOCTL; the code was meant
  to return ENODEV for all invocations expect when used to disable the
  cursor and not just when used for enabling the cursor.
- In case the adapter is the OFW stdout move its OFW cursor to the start
  of the last line on halt so OFW output doesn't get intermixed with what
  FreeBSD left on the screen.
- Drop variable names in the prototypes of some functions in order to
  match the style of majority of the prototypes in this file.
2005-06-04 21:18:30 +00:00
Marius Strobl
df4b30bee2 - In creator_configure() when probed for the high-level console return
the number of registered adapters instead of determining again whether
  stdout is a supported card (and which might have failed to attach and
  register).
- Drop creator_set_mode() and move the relevant parts to creator_fill_rect()
  and creator_putc() respectively. This is a bit cleaner than having to
  make sure that creator_set_mode() was called before creator_fill_rect()
  or creator_putc() are used and matches better what Xorg does.
- Fix a bug in the handling of the FBIOSCURSOR IOCTL; the code was meant
  to return ENODEV for all invocations expect when used to disable the
  cursor and not just when used for enabling the cursor.
- In case the adapter is the OFW stdout move its OFW cursor to the start
  of the last line on halt so OFW output doesn't get intermixed with what
  FreeBSD left on the screen. With hindsight this is what the faking of a
  hardware cursor which was removed in the last revision really was about,
  i.e. to keep the OFW updated about the current cursor position. The new
  approach however is simpler while producing the same result and doesn't
  cause the first letter of the OFW output to be turned into a blank and
  a newline.
- Add variable names to the prototypes of creator_cursor_*() which were
  added in the last revision and list them alphabetically in order to match
  the style of this file.
2005-06-04 21:15:27 +00:00
Marius Strobl
fcff691970 Account for ebus(4) defaulting to SYS_RES_MEMORY for memory resources
since ebus.c rev. 1.22.
2005-06-04 20:29:28 +00:00
Marius Strobl
07945ccd23 - Take advantage of ebus(4) having switched to SYS_RES_MEMORY for memory
resources in ebus.c rev. 1.22 and collapse the resource allocation for
  both the EBus and SBus variants into auxio_attach_common().
- For the EBus variant make sure that the resource for controlling the
  LED is actually available; (in theory) we could have ended up using
  the resource without allocating it.
2005-06-04 20:27:39 +00:00
Warner Losh
f09aa88c33 In newbus land, ivars can only be accessed for direct child, or when
the driver has unholy private knowledge of its great-*cgrandchildren.
The ACPI allocation routine lacked such knowledge when it tried to do
a default allocation for all descendants, rather than just its
immeidate children, so would access grandchild's ivar in an unsafe
way.  This could lead to a panic when devices were present which had
no addresses setup by the BIOS, but which were later allocated in a
lazy manner via pci_alloc_map.  As such, only do the default
allocation adjustments for immediate children.  The manner that
acpi_sysres_find accesses the resource list, used later in
acpi_alloc_resource, is safe and proper so no additional test is
needed there.

This fixes a panic when probing an disabled ata controller on some
newer intel blades.

Reported by: dwhite
2005-06-03 20:12:12 +00:00
Warner Losh
f9937ed8f3 Mask off the bar's value after the probe test write before testing
against 0 in pci_alloc_map, just like we do in pci_add_map.  Also,
make sure that we restore the value to the BAR that was there before
if the bar is 0.  Chances are that it was 0 before the write too and
that the restoration is a nop, but better safe than sorry.

Notice by: dwhite
2005-06-03 19:41:06 +00:00