Commit Graph

12960 Commits

Author SHA1 Message Date
Warner Losh
ec54f56441 Improve the mining of MAC address from the card:
o Add a fallback location for the MAC address.  Most of the early ne2000
  PC Cards were built from the same parts, so most of them have the same
  address in the CIS to grab the MAC from.  Use this address as our
  fallback if we don't find anything better.
o Add printf, in bootverbose, noting the MAC addresses that we find along
  the way.

# Better sanity checking of the MAC address is needed.  Will have to
# investigate using/creating a centralized function to do this as a number
# of other PC Card drivers each have their own ad-hoc tests.
2005-02-12 16:44:15 +00:00
Poul-Henning Kamp
c434197487 Fix prototype for ibeot() 2005-02-12 15:49:50 +00:00
Ruslan Ermilov
7becf838ce Two problems here:
1.  Dependency on netgraph module was broken (wrong version).
2.  Netgraph node type was never destroyed on unload.  This
    was masked by problem #1.

Fixed both by using NETGRAPH_INIT().  Now netgraph node type
is created on module load, as in the rest of netgraph modules.
2005-02-12 12:04:10 +00:00
Warner Losh
1d0fc8fda7 Add comment about MAC mining 2005-02-12 08:27:46 +00:00
Vinod Kashyap
fc01f80ec3 Bumped up the driver version, following recent changes. 2005-02-12 01:16:28 +00:00
Warner Losh
c5377c2c88 Really old PCMCIA cards stored the MAC address in the attribute memory
at some offset.  Unlike newer cards, the MAC address wasn't part of
the CIS as a specific FUNCE.  These older cards were having their MAC
address show up as 0:2:4:6:8:a because that's what's in the ROM
locations that would be there in a real ne2000.

This patch allows one to specify the offset for the MAC address for
these cards.  Specify one for the IBM Ethernet II card, as it is one
that has this problem.  One shouldn't specify this unless the MAC
address really isn't in the CIS at all.

Side note: The novell probe likely shouldn't read the MAC address, and
that should be moved to the bus specific attach routine(s), maybe as a
convenience function in if_ed_novell.c.

My IBM Ethernet II (aka Info Mover) now has a believable MAC address.
2005-02-12 00:45:22 +00:00
Poul-Henning Kamp
09dbf9afd3 Make sure the last command byte makes it onto the wire. 2005-02-11 22:24:02 +00:00
Warner Losh
d74c567254 Diff reduction with p4. 2005-02-11 07:50:03 +00:00
Poul-Henning Kamp
a3a7ba5989 Improve EOS handling. 2005-02-11 06:57:02 +00:00
Warner Losh
bd019eb78c Eliminate the ED_VENDOR_{PCCARD,LINKSYS} types. These cards really
are NOVELL NE2000 with just a tiny quirk that's non vendor specific.
Instead, use the chip_type of DL100XX instead.  This is more inline
with how the AX88190 support was added, and seems a little cleaner.
2005-02-11 06:02:27 +00:00
Warner Losh
8d50b6af00 Skip PNP probes. If there are isapnp or pnpbios instances of this driver,
then we can support them later.  This keeps the pbio probe from claiming
lots of otherwise unused pnpbios devices on my laptop.
2005-02-11 03:56:13 +00:00
Bill Paul
88d8970dea Merge in patch to support AP scanning via ifconfig and the new
net80211 API.

Submitted by: Stephane E. Potvin sepotvin at videotron dot ca
2005-02-11 02:13:12 +00:00
Warner Losh
f7167d3e91 Move enable/disable 16bit access routines into if_ed. Slightly
pessmize the error recover path through edintr by calling these
functions, rather than expanding it inline.  This error path already
does a lot in it, so an extra function call will be lost in the noise.
It also happens rarely.
2005-02-10 23:48:13 +00:00
Warner Losh
0cfebadeb9 use
while (complicated-expr)
		continune;
in preference to
	while (complicated-expr);

since the code generated is identical, and the former is easier to read,
especially for complicated-expr that reach to the end of the line...
2005-02-10 23:31:27 +00:00
Julian Elischer
c96e43721a Remove lots of tab/space errors introduced by massive cut-n-paste action.
Noticed from:	diffs of the last commit.
MFC after:	1 week
2005-02-10 22:38:51 +00:00
Julian Elischer
ade68ea226 Take into account that Pinnacle screwed up their PCI ID in the beginning..
Older cards have it reversed.
Also, use some already defined values instead of magic numbers.

PR:	 73324
Submitted by:	arne_woerner@yahoo.com
MFC after:	1 week
2005-02-10 22:26:28 +00:00
Vinod Kashyap
6cc7bd9464 1. Revert back to the way the older driver handled XPT_PATH_INQ. This seems to
fix the problem with device discovery seen by some people.
2. Change to make 3ware CLI/3DM work on amd64.
3. Fix a potential problem that could cause the driver to do strlen(NULL) when
   using older firmware.

Reviewed by:scottl
2005-02-10 18:07:33 +00:00
Poul-Henning Kamp
923da43e9b Statification 2005-02-10 12:08:55 +00:00
Poul-Henning Kamp
c711aea6ca Make a bunch of malloc types static.
Found by:	src/tools/tools/kernxref
2005-02-10 12:02:37 +00:00
Warner Losh
f2566fc59b Extricate probing of the gwether card (Gateway AT) from the middle of
probing the novell ne[12]000 cards.  It should be its own thing, ala
how we do the dl100xx support doing its own thing at the right time.
For the moment, it is just a function, which makes the mainline of the
generic probe easier to follow.

Also, correct a couple of comments that looked wrong.

# there may be a bug in setting up gwether, in that we set
# sc->rec_page_stop based on memsize, rather than sc->mem_size, so if
# these two are different, then the rec_page_stop will be wrong.  I'm
# hesitant to fix it without real hardware to test with.  Since
# gwether isn't in the hardware list of the man page nor in the commit
# messages, it is hard to know for sure.
2005-02-10 06:09:03 +00:00
Warner Losh
1e379d3696 Remove an ifdef that's been here for a long time. So long, in fact,
that it references a function parameter that's not been passed in for
more than 4 years.

This has been if 0'd since 1994.
2005-02-10 05:34:25 +00:00
Poul-Henning Kamp
954ad216af Constify. 2005-02-09 20:56:32 +00:00
Warner Losh
969eaf2179 Break out obscure ISA cards into their own files, as well as ne2000
and wd80x3 support.  Make the obscure ISA cards optional, and add
those options to NOTES on i386 (note: the ifdef around the whole code
is for module building).  Tweak pc98 ed support to include wd80x3 too.
Add goo for alpha too.

The affected cards are the 3Com 3C503, HP LAN+ and SIC (whatever that
is).  I couldn't find any of these for sale on ebay, so they are
untested.  If you have one of these cards, and send it to me, I'll
ensure that you have no future problems with it...

Minor cleanups as well by using functions rather than cut and paste
code for some probing operations (where the function call overhead is
lost in the noise).

Remove use of kvtop, since they aren't required anymore.  This driver
needs to get its memory mapped act together, however, and use bus
space.  It doesn't right now.

This reduces the size of if_ed.ko from about 51k to 33k on my laptop.
2005-02-09 20:03:40 +00:00
Wilko Bulte
1217303f75 add support for NetMos NM9805 1284 Printer port
Submitted by: Willy Offermans <W.K.Offermans@TUe.nl>

MFC after: 2 weeks
2005-02-09 18:38:28 +00:00
Warner Losh
13bf0bf2a8 Since we no longer use kvtop, we no longer need machine/md_var.h 2005-02-09 17:37:53 +00:00
Warner Losh
b3f44d7907 If either ed_probe_Novell or ed_attach returns an error, release the
resources too.
2005-02-09 17:35:13 +00:00
Scott Long
7e22e3674b Remove some unused variables. 2005-02-09 17:19:12 +00:00
Scott Long
29c711f038 Remove the messy locking dance around xpt_done() 2005-02-09 11:50:16 +00:00
Warner Losh
887a166c34 Remove DLINK_3, its unused. Remove NETGEAR FA410TX, since it is the
same as the LINKSYS COMBO_ECARD (which also seems to be the same as
another linksys product that also has a modem, but I can't find that
one at the moment).  Remove the PCM100, since it is now no longer
used.
2005-02-09 06:16:27 +00:00
Warner Losh
940e7b9e51 o Remove duplicate LINKSYS ETHERFAST entry.
o The COMBO_ECARD comes in many flavors, it seems, so probe both the DL10019
  and the AX88x90 on it.  Since this seems to work with no ill effects, maybe
  the probing should happen more generally rather than being table driven.
  Need to think more about this.
o Remove PCM100 because it is duplicative (the ETHERFAST is the pcm100 and
  apparently has the same IDs).  It was here for NetBSD because they match
  up an expected MAC address OID, but since we don't bother with that, we
  don't need to be so finely discriminating.
o Minor style nit.
2005-02-09 06:03:36 +00:00
Warner Losh
8a3b3c6288 Remove reference to softc from probe entirely... 2005-02-09 05:55:54 +00:00
Warner Losh
b7baa9d5a2 Minor style cleanup. Get rid of extra {}, extra blank lines and some
continued line indentation.  Should be no functional changes.
2005-02-09 00:50:59 +00:00
Warner Losh
374cde5568 o Remove ifdef PC98, since this file has diverged quite a bit from
if_ed_isa.c, and they seem to not be helpful anymore.
o Fix style issues from de-Pification.
o change from _isa_ to _cbus_ to the largest extent possible to reflect that
  this is really for cbus, not isa.
o Use ANSI function definitions.
o Use ed_clear_memory
o eliminate kvtop
2005-02-09 00:06:12 +00:00
Warner Losh
50f30261e7 No need to bzero softc. 2005-02-08 23:58:38 +00:00
Warner Losh
851a243f68 Convenience function to clear memory of the card, and then check to make
sure that it works by reading back as 0.
2005-02-08 23:57:43 +00:00
Robert Watson
78e21ab011 Simplify the "and if we're in the debugger, don't use locks" logic,
correcting some misthinking.

Discussed with (really this time):	bde
2005-02-08 17:56:04 +00:00
Bill Paul
b545a3b822 Next step on the road to IRPs: create and use an imitation of the
Windows DRIVER_OBJECT and DEVICE_OBJECT mechanism so that we can
simulate driver stacking.

In Windows, each loaded driver image is attached to a DRIVER_OBJECT
structure. Windows uses the registry to match up a given vendor/device
ID combination with a corresponding DRIVER_OBJECT. When a driver image
is first loaded, its DriverEntry() routine is invoked, which sets up
the AddDevice() function pointer in the DRIVER_OBJECT and creates
a dispatch table (based on IRP major codes). When a Windows bus driver
detects a new device, it creates a Physical Device Object (PDO) for
it. This is a DEVICE_OBJECT structure, with semantics analagous to
that of a device_t in FreeBSD. The Windows PNP manager will invoke
the driver's AddDevice() function and pass it pointers to the DRIVER_OBJECT
and the PDO.

The AddDevice() function then creates a new DRIVER_OBJECT structure of
its own. This is known as the Functional Device Object (FDO) and
corresponds roughly to a private softc instance. The driver uses
IoAttachDeviceToDeviceStack() to add this device object to the
driver stack for this PDO. Subsequent drivers (called filter drivers
in Windows-speak) can be loaded which add themselves to the stack.
When someone issues an IRP to a device, it travel along the stack
passing through several possible filter drivers until it reaches
the functional driver (which actually knows how to talk to the hardware)
at which point it will be completed. This is how Windows achieves
driver layering.

Project Evil now simulates most of this. if_ndis now has a modevent
handler which will use MOD_LOAD and MOD_UNLOAD events to drive the
creation and destruction of DRIVER_OBJECTs. (The load event also
does the relocation/dynalinking of the image.) We don't have a registry,
so the DRIVER_OBJECTS are stored in a linked list for now. Eventually,
the list entry will contain the vendor/device ID list extracted from
the .INF file. When ndis_probe() is called and detectes a supported
device, it will create a PDO for the device instance and attach it
to the DRIVER_OBJECT just as in Windows. ndis_attach() will then call
our NdisAddDevice() handler to create the FDO. The NDIS miniport block
is now a device extension hung off the FDO, just as it is in Windows.
The miniport characteristics table is now an extension hung off the
DRIVER_OBJECT as well (the characteristics are the same for all devices
handled by a given driver, so they don't need to be per-instance.)
We also do an IoAttachDeviceToDeviceStack() to put the FDO on the
stack for the PDO. There are a couple of fake bus drivers created
for the PCI and pccard buses. Eventually, there will be one for USB,
which will actually accept USB IRP.s

Things should still work just as before, only now we do things in
the proper order and maintain the correct framework to support passing
IRPs between drivers.

Various changes:

- corrected the comments about IRQL handling in subr_hal.c to more
  accurately reflect reality
- update ndiscvt to make the drv_data symbol in ndis_driver_data.h a
  global so that if_ndis_pci.o and/or if_ndis_pccard.o can see it.
- Obtain the softc pointer from the miniport block by referencing
  the PDO rather than a private pointer of our own (nmb_ifp is no
  longer used)
- implement IoAttachDeviceToDeviceStack(), IoDetachDevice(),
  IoGetAttachedDevice(), IoAllocateDriverObjectExtension(),
  IoGetDriverObjectExtension(), IoCreateDevice(), IoDeleteDevice(),
  IoAllocateIrp(), IoReuseIrp(), IoMakeAssociatedIrp(), IoFreeIrp(),
  IoInitializeIrp()
- fix a few mistakes in the driver_object and device_object definitions
- add a new module, kern_windrv.c, to handle the driver registration
  and relocation/dynalinkign duties (which don't really belong in
  kern_ndis.c).
- made ndis_block and ndis_chars in the ndis_softc stucture pointers
  and modified all references to it
- fixed NdisMRegisterMiniport() and NdisInitializeWrapper() so they
  work correctly with the new driver_object mechanism
- changed ndis_attach() to call NdisAddDevice() instead of ndis_load_driver()
  (which is now deprecated)
- used ExAllocatePoolWithTag()/ExFreePool() in lookaside list routines
  instead of kludged up alloc/free routines
- added kern_windrv.c to sys/modules/ndis/Makefile and files.i386.
2005-02-08 17:23:25 +00:00
Warner Losh
ad6da8a0fc Use ANSI function definitions, tweak a couple of prototypes to match (since
K&R prototypes needed to mismatch in the way that they were mismatched),
rename ds_getmcaf to ed_ds_getmcaf.  Remove a few register keywords.
2005-02-08 06:12:44 +00:00
Warner Losh
c1ed2c9eb2 use fixed types for the calls to ed_pio_readmem, ed_pio_writemem.
Make the special hp versions match the general ones.  Also use fixed
types in the WD80x3_generic probe, and change callers' arrays to
match.  Fix a couple of minor style issues by using newstyle function
definitions in a couple places.
2005-02-08 05:59:43 +00:00
Warner Losh
9d512034e3 Make it possible to unload ed. Move the ed_pccard_detach routine to
if_ed and rename it to ed_detach().  Tell other busses to use this
routine for detach.

Since I don't actually have any non-pccard ed hardware I can test
with, I've only tested with my pccards.

More improvements in this area likely are possible.

Prodded by: rwatson
2005-02-08 05:45:35 +00:00
Warner Losh
442b6e9e8c Fix style bugs introduced in the de__Pification of this code.
Style bug generically noted by: bde
2005-02-08 05:41:54 +00:00
Scott Long
8a87dc6fd9 Fix crashdumps on twe. The twe_immediate_request() path was not only
copying data to a temporary buffer before the I/O, but also copying that
temporary buffer back to the original data location after the I/O.  When
you're dumping kernel heap and stack and protected pages, this is very
very bad.

A belated thanks to Robert Watson for donating hardware for this (and future)
work.

MFC after: 3 days
2005-02-08 03:43:02 +00:00
Gleb Smirnoff
832f26462b Use if_link_state_change() instead of rt_ifmsg(). Remove include net/route.h.
Reviewed by:	wpaul, sam
2005-02-07 19:39:29 +00:00
John Baldwin
777a3021d3 Use kern_open() directly rather than a stackgap detour via open(). 2005-02-07 18:22:20 +00:00
Matthew N. Dodd
5b525a3230 Avoid using tsleep() in the resume path as it may result in the
system hanging if timer interrupts aren't running yet.

This allows my Thinkpad to resume successfully with APM.

Approved by:	 sos
MFC after:	 2 weeks
2005-02-07 17:14:42 +00:00
Nate Lawson
8b888c66d7 Remove handling _PSS notifies from acpi_cpu and let acpi_perf handle them. 2005-02-07 04:03:06 +00:00
Bernd Walter
b542a023e5 Enable interrupt routing as first choice on alpha.
The alpha default handler knows how to trigger a fallback.
2005-02-07 00:43:14 +00:00
Poul-Henning Kamp
a15fbb42c3 Allocate more space for softc. Amazing my machine survived this. 2005-02-06 22:45:12 +00:00
Warner Losh
cbf6a317a5 Move the $NetBSD$ tag to the top of the file, per standard NetBSD
practice (which we seem to mostly follow in the tree).  Move the
$FreeBSD$ tag to its more proper place after all copyright and license
notices.  Add '-' to the copyright notice for Christian E. Hopps so my
copyright script picks it up.
2005-02-06 21:15:19 +00:00
Warner Losh
108663cc87 ccs is a size_t. RAY_CCS_INDEX takes ccs and does math on it,
resulting in a size_t due to C's rules of arithmetic.  Rather than
bogusly cast the result to a uint8_t, fix the printf format specifier
to have a 'z' modifier which tells the compiler that the sizes really
do match.

It turns out that change 1.75 was incorrect to assume that this
'really' was a 8bit quantity.  It isn't.  Although the hardware
appears to limit things to < 256, it would be a bug that should be
caught by debug printf it it were.  Casting it to uint8_t would have
lost this useful information.

Aslo add 'z' to a nearby debug statement that's never compiled in.
2005-02-06 21:12:22 +00:00
Nate Lawson
8c5468e3f5 Remove acpi throttling support from the acpi_cpu(4) driver now that this
is supported by acpi_throttle(4).
2005-02-06 21:10:19 +00:00
Nate Lawson
7150dfc7e5 Break out acpi throttling support into a new relative cpufreq driver,
acpi_throttle(4).
2005-02-06 21:09:51 +00:00
Warner Losh
440b5ade31 Move resource allocation routines from cardbus_cis.c to cardbus.c.
They have nothing at all to do with CIS parsing.

Remove some unused funce parsing: nothing used the results.

Use more of pccard_cis.h's deifnitions for the cardbus specific cis
parsing we do.  More work is needed in this area.

This reduces the size of the cardbus module by 380 bytes or so...
2005-02-06 21:03:13 +00:00
Nate Lawson
3cc2f17689 Notify the OS that we're taking over Px states in acpi_perf(4) instead of
doing it in the cpu driver.  The previous code was incorrect anyway since
this value controls Px states, not throttling as the comment said.  Since
we didn't support Px states before, there was no impact.  Also, note that
we delay the write to SMI_CMD until after booting is complete since it
sometimes triggers a change in the frequency and we want to have all
drivers ready to detect/handle this.
2005-02-06 20:12:28 +00:00
Ian Dowse
1c7178ce25 Check that we have at least a 586-class CPU before calling do_cpuid().
This fixes booting on a number of 486 processors.

PR:		i386/75686
Reviewed by:	markm
MFC after:	1 week
2005-02-06 16:55:52 +00:00
Poul-Henning Kamp
df05d0fb93 Further elaborate the GPIB driver. We now support a minimal subset of
the ibfoo() API.
2005-02-06 15:22:23 +00:00
Poul-Henning Kamp
0c3c54da63 Since we are quite unlikely to ever face another platform which
uses the i8237 without trying to emulate the PC architecture move
the register definitions for the i8237 chip into the central include
file for the chip, except for the PC98 case which is magic.

Add new isa_dmatc() function which tells us as cheaply as possible
if the terminal count has been reached for a given channel.
2005-02-06 13:46:39 +00:00
David E. O'Brien
61d087cf53 Fix problem with some logitec usb wireless mice.
Submitted by:	Markus <mw@kpnqwest.ch>
Tested by:	Randy Bush <randy@psg.com>
2005-02-06 12:41:00 +00:00
Nate Lawson
3045c8af3f Staticize the legacy cpu devclasses and revert the name for the acpi_cpu
devclass.  As pointed out by dfr@, devclasses don't have to share the same
linkage if multiple drivers have the same name.  Newbus should match the
devclasses based on name and allocate non-conflicting unit numbers.
2005-02-06 07:36:08 +00:00
Nate Lawson
76ce4cc456 Convert to the new GAS APIs to allow for detach in the future. Also, check
the PERF_CTRL register in our probe method so that we can tell earlier
that another driver should handle this device due to FFixedHW.  This avoids
scaring users when attach failed when we really wanted probe to fail.
2005-02-05 22:30:57 +00:00
Nate Lawson
f4eb041868 Convert to the new GAS API so that we can free registers in the future. 2005-02-05 22:29:03 +00:00
Nate Lawson
e1c4bf3f42 Convert the acpi_bus_alloc_gas() and acpi_PkgGas() APIs to output the memory
type.  This is needed if the resource is to be released later.  The RID is
still also present, though less necessary since rman_get_rid() can be used
to obtain it from the resource.
2005-02-05 22:28:36 +00:00
Nate Lawson
0a9145a2f2 Use intr_disable/restore() instead of disable_intr() since the latter is
not MI.  This should fix build on non i386 platforms.
2005-02-05 16:31:58 +00:00
Gleb Smirnoff
e5d73ca252 Call if_link_state_change() when link status changes.
PR:		kern/76890
Reviewed by:	rwatson, sam
2005-02-04 18:36:04 +00:00
Nate Lawson
26d5f7dfa7 Don't print out a failure message when an attach for FFixedHW fails.
Instead, just fail to attach so another hardware-specific driver can
claim the device.  Also, clean up some small memory leaks in the failure
case.
2005-02-04 18:09:01 +00:00
Nate Lawson
b68b14adaf Return a special status of "not supported" for functional fixed hardware
since this type of register should be handled by another driver.
2005-02-04 18:07:03 +00:00
Warner Losh
c4241acbb3 Don't rely on indirect inclusion of machine/bus.h to use
bus_space_{read,write}_* routines.  This doesn't matter in the current
tree, but will matter soon (the rest of the tree appears to already be
clean).
2005-02-04 17:33:31 +00:00
Nate Lawson
7d3a06201d Make the devclass static for now until deciding whether to share them. 2005-02-04 07:25:44 +00:00
Nate Lawson
6cb2040baf Add the ACPI Performance states driver. This driver offers two or more
settings as exported via the ACPI _PSS method.  OEMs use this interface
to encapsulate chipset or processor-specific methods (e.g., SpeedStep or
Powernow) and export their settings in a standard way.  On systems that
have valid ACPI Performance states and a hardware-specific driver (e.g.,
ichss), acpi_perf(4) is preferred.
2005-02-04 05:45:07 +00:00
Nate Lawson
6c7b11ccfa Add a cpufreq driver for the SpeedStep capability in the ICH chipset. This
driver offers two settings.  Information for this driver was obtained from
the Intel datasheets and by reviewing the Linux driver.
2005-02-04 05:42:29 +00:00
Nate Lawson
98aa9cd052 Update the CPU attachments to return CPU_IVAR_PCPU as well as pass on
appropriate requests to any children.
2005-02-04 05:36:40 +00:00
Warner Losh
0ccd166961 Minor style nits
o remove unneeded {}
o no need to bzero sc
2005-02-04 02:32:43 +00:00
Warner Losh
e1500f0d18 Sort PANASONIC products numerically 2005-02-03 23:45:20 +00:00
Warner Losh
b73f46cfbb takawata tells me that KXLC0003 also works with this driver, so add it
to the list.  Note it is untested.

Also kill some whitespace at the end of the line...
2005-02-03 23:39:29 +00:00
Robert Watson
faabfac9ff When entering siocnputc() with (kdb_active), don't acquire (or
release) the sio spin mutex, as use of synchronization primitives in
the debugger can result in substantial problems.  With this patch in
place entering the debugger via a serial console is made
substantially more reliable.

MFC after:	1 week
Tested by:	kris
Discussed with:	bde
2005-02-03 10:35:05 +00:00
Peter Grehan
6109ca7e1a Fix up assignment of negative number to char. Char's are unsigned by
default on PowerPC.

Approved by:	mdodd
2005-02-03 02:35:28 +00:00
Warner Losh
ddf71f18a9 MF dev/wi: merge the pccard lists.
# this hasn't compiled for two weeks and no one noticed!

MFC After: 7 days or so
2005-02-03 00:40:35 +00:00
Pyun YongHyeon
fee4d88e0f Fix "Duplicate mbuf free panic".
The cause of "Duplicate mbuf free panic" is in the programming
error of hme_load_txmbuf(). The code path of the panic is the
following.

1. Due to unknown reason DMA engine was freezed. So TX descritors
   of HME become full and the last failed attempt to transmit a
   packet had set its associated mbuf address to hme_txdesc
   structure. Also the failed packet is requeued into interface
   queue structure in order to retrasmit it when there are more
   available TX descritors.

2. Since DMA engine was freezed, if_timer starts to decrement its
   counter. When if_timer expires it tries to reset HME. During
   the reset phase, hme_meminit() is called and it frees all
   associated mbuf with descriptors. The last failed mbuf is also
   freed here.

3. After HME reset completed, HME starts to retransmit packets
   by dequeing the first packet in interface queue.(Note! the
   packet was already freed in hme_meminit()!)

4. When a TX completion interrupt is posted by the HME, driver
   tries to free the successfylly transmitted mbuf. Since the
   mbuf was freed in step2, now we get "Duplicate mbuf free panic".

However, the real cause is in DMA engine freeze. Since no fatal
errors reported via interrupts, there might be other cause of
the freeze. I tried hard to understand the cause of DMA engine
freeze but couldn't find any clues. It seems that the freeze
happens under very high network loads(e.g. 7.5-8.0 MB/s TX speed).

Though this fix is not enough to eliminate DMA engine freeze it's
better than panic.

Reported by:	jhb via sparc64 ML
2005-02-02 08:35:11 +00:00
Poul-Henning Kamp
deb27882e8 Forgot to mark the IRQ as MPSAFE. 2005-02-01 20:34:47 +00:00
Warner Losh
8d2ad0b460 The two PLANEX cards listed in pccarddevs, identified only by their
CIS, weren't actually used anywhere (other than the generic PC Card
code when certain variables are defined).  They aren't used in NetBSD
either.  Make things simpler by removing them.  Change PLANEX_2 to
PLANEX and tweak wi and owi to use that instead.  The PLANEX id seems
to actually be pci ID assigned to planex, not its pcmcia id.  Ooops.
I don't know if this is a reporting error from where this entry came
from, or if it is a mistake on PLANEX's part.  I suspect the latter,
as ACTIONTEC and NEWMEDIA made the same mistake (although new media
may be because it uses an advansys chip inside).  Make a note of this
in the file.  The 0xc entires may be JEITA assigned, so note that as
well.

# This leaves just 3 entries that are totally unknown: airvast, archos
# and edimax although the arivast number is the same assigned to
# avertec in usb...
2005-02-01 18:28:09 +00:00
Poul-Henning Kamp
83820457eb Add a IEEE488 driver for PCIIA compatible cards.
This driver implements "unaddressed listen only mode", which is what
printers and plotters commonly do on GP-IB busses.

This means that you can capture print/plot like output from your
instruments by configuring them as necessary (good luck!) and

	cat -u /dev/gpib0l > /tmp/somefile

Since there is no way to know when no more output is comming you
will have to ctrl-C the cat process when it is done (that is why
the -u is important).
2005-02-01 16:59:23 +00:00
Warner Losh
7c61c21042 BUS_SPACE_UNRESTRICTED shouldn't be used with the bus_alloc_resource
interface.  Instead, move to the convenience _any interface.
2005-02-01 07:43:34 +00:00
Shunsuke Akiyama
4b6cd0347a Use a taskqueue to handle port status changes.
Calling ucom layer directly from interrupt context make a panic.

MFC after:	1 week
2005-01-31 13:58:10 +00:00
Marcel Moolenaar
a2e25ee10d Add the keyboard system device before we probe for the keyboard.
The presence or absence of a keyboard does not change whether an
UART is designed as a keyboard port or not and thus whether we
can use the port as a TTY or not.
We now call sunkbd_attach() even when we didn't previously find
a keyboard. Emit a useful message stating that no keyboard was
found, but don't do anything else.

MFC after: 5 days
2005-01-31 04:31:22 +00:00
Marcel Moolenaar
2554d6b9b4 Revert rev. 1.5.
It should be safe to attach to all Z8530 controllers again. In fact,
the keyboard works on Ultra 2 machines.

MFC after: 5 days
2005-01-31 04:25:48 +00:00
Scott Long
9e521c8906 Remove a dead vtophys() reference. 2005-01-31 01:26:22 +00:00
Marcel Moolenaar
e6fff3fa54 Fix a logic bug that caused DSR to never be deasserted.
MFC after: 5 days
2005-01-30 22:14:30 +00:00
Scott Long
7765040ebc Add crashdump support to the ips driver. It only works for the more modern
ServeRAID 4 - 7 models right now.  Support for older cards is possible, but
I don't have any hardware to experiment with.

Thanks to Jack Hammer at Adaptec for providing debugging hints.

Sponsored by: ImproWare AG, Switzerland
2005-01-30 17:45:45 +00:00
Maxim Konovalov
7449260bfd o Fix a typo.
Submitted by:	Niclas Zeising
2005-01-30 16:42:23 +00:00
Marcel Moolenaar
c3c16fcb7b o Fix the various interrupt related problems caused by reverse
engineering the pending interrupt sources from the current
   state of the controller. For channel A we can always read the
   interrupt pending register (RR3). For channel B we can read
   the interrupt vector register (RR2) because it contains the
   modified vector and thus includes the interrupt source.
   Since we currently need puc(4) for the Z8530, we know that
   the interrupt handler for both channels will be called and
   thus that RR3 will always be read at least once, even if ch A
   has no pending interrupt.
   NOTE: The modified interrupt vector has no value that represent
   a lack of pending interrupt for channel B. That is, the
   value read when no interrupts are pending is the same as the
   value for the special receive condition. Fortunately, we don't
   actually have to depend on that interrupt source. This does
   mean that we need to properly handle the overflow condition,
   when we read received character from the chip.
o  The DSR signal is represented by the SYNC bit in the external
   status register (RR0). We now properly track DSR.
o  It's save to enable the external/status interrupt source. We
   now get interrupts when line signals (DSR, DCD or CTS) change.

Problems fixes:
o  interrupt storms.
o  blocked open(2).
o  lack of (hardware) flow control.
o  unable to report DSR.

MFC after: 5 days
2005-01-30 09:00:50 +00:00
Maxim Sobolev
4379219537 Boot away another stackgap (one of the lest ones in linuxlator/i386) by
providing special version of CDIOCREADSUBCHANNEL ioctl(), which assumes that
result has to be placed into kernel space not user space. In the long run
more generic solution has to be designed WRT emulating various ioctl()s
that operate on userspace buffers, but right now there is only one such
ioctl() is emulated, so that it makes little sense.

MFC after:	2 weeks
2005-01-30 08:12:37 +00:00
Robert Watson
03edfff39a Disable ethernet flow control in if_fxp by default, in order to prevent
unexpected surprises when a system panics or is left in the debugger.

Requested by:	kris
MFC after:	3 days
2005-01-29 23:13:20 +00:00
Nate Lawson
73c58ad19d Fix typo. 2005-01-29 19:45:31 +00:00
Bjoern A. Zeeb
9eed64cad9 Cleanup debugging code and put it under bootverbose
(includes minor style polishing).

Approved by:	rwatson (mentor)
2005-01-29 19:26:53 +00:00
Poul-Henning Kamp
d9aaa28f63 Use MAXMINOR 2005-01-29 16:50:04 +00:00
Poul-Henning Kamp
b0a5fd8e7a Better locking.
Add 'u' and 'U' "wait for next UTC second" in sequence mode.
2005-01-29 16:33:51 +00:00
Warner Losh
e937d4a295 The Olicom OC2220 has an ID of 0x101, not 0x2220 as I previously
thought.  I'm unsure why I thought this was the case, but it
definitely isn't for this card.  If another card with the other ID
makes an appearance, then we'll add a second entry for it.

# With this change my Olicom OC2220 is now working again, since I make
# this commit with that device. :-)
2005-01-29 04:20:01 +00:00
Matt Jacob
f3f3654d48 Roll firmware to the latest version. There are a bunch of features
in alternate f/w versions that will be pursued at some points.

MFC after:	1 month
2005-01-29 01:12:37 +00:00
Warner Losh
268334ebbd Fix the worst offenders of style(9) with a small style sweep. 2005-01-28 06:50:59 +00:00
Warner Losh
26cfd0d78b Cleanup tabs vs spaces. 2005-01-28 06:45:42 +00:00
Warner Losh
eb71b55c32 For the PC Card implementation of the CS8920M that's in my IBM
EtherJet, the interrupt is selected in the eeprom based on the layout
of the PC Card board.  Since this is encoded into the EEPROM, and has
no relationship to the IRQ that the pccard bridge routes the PC Card's
interrupt pin to.

As such, stop writing to that register.  This gets my EtherJet working.

# The eeprom reading code appears to be totally wrong for my EtherJet
# card.  This causes the card to bogusly detect the media options
# available.
2005-01-28 06:35:39 +00:00
Warner Losh
ad787127cf Setting hw.cs.recv_delay should set the delay, not the ignore the
eeprom checksum.
2005-01-28 06:13:29 +00:00
Scott Long
c11c59dc42 Remove all of the spl() markers. 2005-01-28 05:37:51 +00:00
Scott Long
03a908f2ce Lock the IPS driver and bring it out from under Giant. Also do some
significant clean up and optimizations:
- don't call bioq_disksort() on every command, the hardware will do that for
  us.
- remove all of the complicated bio deferral code.  bio's that can't be
  serviced immediately can just wait on the bioq.
- Only reserve one command object for doing control commands to the card.
  This simplifies a lot of code and significantly reduces the size of the
  command struct.
- Allocate commands out of a slab instead of embedding them into the softc.
- Call the command action method directly instead of having ips_get_free_cmd()
  call it indirectly.

MFC After: 1 week
2005-01-28 05:02:13 +00:00
Warner Losh
c1195b0646 error = is needed before ether_ioctl() so that unsupported/unknown
IOCLTs are properly handled.  This gets the cs driver properly
reporting things via ifconfig.

# my pccard still doesn't work.
2005-01-28 00:28:22 +00:00
Nate Lawson
286fceb541 Consistently use pcib for a printf. 2005-01-27 20:49:59 +00:00
Warner Losh
221db7416d Write cs_detach() and use it. This resolves the twin problems of the
cs1 interface linger on card eject, as well as the warnings about the
card still using resources.  Ooops.
2005-01-27 04:51:44 +00:00
Warner Losh
118c73087b Add back support for D-LINK DMR-650TX, and all the other OEMd versions
of this card (evidentally MultiMobile also sold this card as
MT5634ZLXI/E).

Reported by: Bastian Brinkman
2005-01-27 02:37:39 +00:00
Warner Losh
907c2b8ba1 Move 143 back to its rightful owner: Grey Cell systems, which OEMd enet cards 2005-01-27 02:33:03 +00:00
Warner Losh
fa9af110fd 64-bit clean fixes: Use %zx in preference to %x to print size_t items.
Cast a byte to uint8_t before printing.
2005-01-27 01:49:23 +00:00
Warner Losh
092b24f520 Fix a few printf problems on ia64 (and other 64-bit platforms). 2005-01-27 01:40:12 +00:00
Bruce M Simpson
3e19d3c0f0 Add PCI ID for Dell RAC IV/ERA Virtual UART (PowerEdge 1850).
Trim name of existing Dell RAC devices. Trim comments.

With help from:	dpk at dpk dot net
MFC after:	1 week
2005-01-27 01:17:32 +00:00
Poul-Henning Kamp
017a4322b5 If CDSR_OFLOW (stty dsrflow) is enabled on one or both sides of a
null-modem tty device emulate the speed settings faithfully.

The speed is emulated independently for the two directions, using
the slower of the local sides ispeed and the remote sides ospeed.

The emulated speed takes settings of bits/char, parity and stopbit
into account.

Inspired by:	The BSD-DK Editor Celebrity Deathmatch Contest
2005-01-26 23:42:18 +00:00
Robert Watson
645674fb54 Remove unused static declaration of ed_pccard_dl100xx(), which probably
accidentally snuck into a prior commit to if_ed, and prevented building
with -Werror.

Pointed out by:	csjp
2005-01-26 14:09:32 +00:00
Yaroslav Tykhiy
c96a57bbf5 Respect the current setting of IFCAP_VLAN_HWTAGGING on
the interface when going to toggle VLAN support for
internal reasons.  If the IFCAP_VLAN_HWTAGGING bit is
cleared, we should rely on the (re)init routine to turn
VLAN support off and never touch the relevant hardware bits.

This applies to other capability bits, too.  The user
obviously has a reason for clearing a capability bit,
e.g., if his particular NIC is buggy and hangs if a
certain hardware capability is turned on even for a
fraction of a second.

The flag adapter->em_insert_vlan_header still is set or
reset irrespective of the IFCAP_VLAN_HWTAGGING setting,
as before, in order to handle the case when a user sets
promiscuous mode on an interface first and later turns
its IFCAP_VLAN_HWTAGGING bit on.

This change might look orthogonal to rev#1.85, but in fact
it is not.  It introduces bugfixes that hopefully will make
implementing the general scheme mentioned in the commit
message of rev#1.85 easier.
2005-01-26 13:44:47 +00:00
Robert Watson
de13c80e9b Disable use of hardware VLAN tagging and stripping in if_em in the default
configuration: it appears to work properly in the non-promiscuous case, but
we've not yet implemented a more general solution that maintains full
functionality with promiscuous mode enabled.  While my hope is that we can
get one implemented soon, this will improve functionality substantially in
the mean time.

MFC after:	3 days
2005-01-26 11:40:58 +00:00
Warner Losh
72217cb810 Catchup to the iodata renaming 2005-01-26 06:30:55 +00:00
Warner Losh
b660732977 Kill stray debugging line not fully removed 2005-01-26 05:40:37 +00:00
Warner Losh
0158a52468 Rework how we deal with the DL10019 and DL10022 cards (as well as the
AX88190 ones, but that one only minorly):
	o don't set flags in the match routine.  They appear to be cleared
	  when probe/attach is called.  Before this change, they were
	  always treated as a simple ne2000, which would fail to get the
	  right NIC address.
	o Lookup device again in the probe routine and probe based on the
	  cards that you see.
	o Detect and report the DL10022 seprately from the DL10019 cards.

While I'm here:
	o remove a bad printf
	o change another bad printf to device_printf.
	o minor style(9) formatting tweaks.

# note: a lot of OEM entries are in the ed_pccard_products such that we can
# likely remove, or collapse, many of them.

This makes all of my DL100xx cards at least probe the ethernet address
correctly, which it wasn't doing before.  I can't seem to locate my
AX88xxx based cards, so those haven't been tested, but they were
busted before the change so they can't be any worse now...
2005-01-26 05:21:12 +00:00
Warner Losh
4550f56d6f Repair probe messages a bit. Previously, we'd print the ethernet
address, and additional information.  Then the printing of the
ethernet address was moved into ether_attach, and so we were printing
orphaned information about the card.  Now the probe message is
prefixed by edX:.  Prepare for it to move under bootverbose, but don't
move it there yet (the || 1 trick).
2005-01-26 05:12:16 +00:00
Warner Losh
f882eb5dad Turns out that Digital's DEPCM-BA and I-O Data PCLATE are both OEM
versions of the Racore PC Card Ethernet card.  Rearrange to reflect
this reality.  This ejects IODATA from 0x1bf, which belongs to Racore.

Thanks to Wilko for providing me with a dumpcis for the DEPCM card.

Also, added Nextcom Nexthawk card from NetBSD
2005-01-25 23:15:20 +00:00
Warner Losh
f52dffcb2a Use DIGITAL2 for DEPCM card 2005-01-25 18:50:25 +00:00
Warner Losh
17e7b2783f Unbreak the Digital DEPCM-BA. Since it doesn't seem to have a proper
manufacturer ID, we need to use -1 rather than 0x100 when matching.
Do this by defining and using DIGITAL2 .
2005-01-25 18:31:45 +00:00
Shunsuke Akiyama
7db2e52424 - Add support for new chips, PL-2303X and PL-2303HX.
- Update comment about datasheet.
- Fix minor typo in sysctl variable description.

Submitted by:	Michal Mertl <mime@traveller.cz>
MFC after:	1 week
2005-01-25 14:38:21 +00:00
Poul-Henning Kamp
33ae5dfb15 Remove dummy vendor id for DIGITAL now that we have the real one. 2005-01-25 08:51:28 +00:00
Warner Losh
f93ad95f27 Minor whitespace cleanup
Add Digitial vendor ID (from NetBSD)
Add Anycom vendor and products (from NetBSD)
2005-01-25 07:46:47 +00:00
Warner Losh
72d45750d4 Add NEXTCOM NEXTHAWK ethernet card.
From NetBSD
2005-01-25 07:25:49 +00:00
Warner Losh
102e51ce42 Remove obsolete comment from head this time. The RELENG_5 commit was
accidental, but harmless and correct so I'll not be reverting it unless
there's some hidden damage I can't see right now...
2005-01-25 04:45:25 +00:00
Warner Losh
c106422ff7 Add MagicRAM PC Card Ethernet as ne2000 clone 2005-01-25 02:50:58 +00:00
Sam Leffler
d3be6f5b0c Fixup radiotap handling of FCS and QoS frames per discussion with David Young:
o mark rx frames including FCS in the payload with the
  IEEE80211_RADIOTAP_F_FCS flag
o remove hack to copy 802.11 headers with padding out of line; instead mark
  the frames with IEEE80211_RADIOTAP_F_DATAPAD and require applications to
  do the work
o split precalculated radiotap flags into tx+rx now that they can be different

Note the full usefulness of these changes depends on updates to applications
that process radiotap data.
2005-01-24 20:31:24 +00:00
Sam Leffler
f818612b1b beacon handling fixups for adhoc mode:
o don't reclaim any previous beacon state in ath_beacon_alloc; do it
  explicitly in ath_newstate
o reference count the node held in the beacon frame state block
o process ibss merge more intelligently; let the state machine do the
  right thing instead of explicitly setting the new bssi id
o explicitly stop tx dma before doing beacon setup to handle the ibss
  merge case
2005-01-24 20:05:03 +00:00
Sam Leffler
f9e6219b15 switch to use bus_dmamap_load_mbuf_sg 2005-01-24 19:51:59 +00:00
Sam Leffler
4bacf7c1f3 o correct beacon interval calculation; the internal setting is in TU's not ms
o replace the private macro to convert MS->TU with the common one
2005-01-24 19:45:59 +00:00
Sam Leffler
acc4f7f50c statically allocate the station/neighbor node table; the deferred
allocation scheme introduced a race condition during device state
transitions
2005-01-24 19:32:10 +00:00
Warner Losh
7d98fccaf3 There have been a substantial number of changes to this file from the
NetBSD original, so add our copyright notice as well.
2005-01-24 19:13:47 +00:00
Bill Paul
df7b7cf4c3 Begin the first phase of trying to add IRP support (and ultimately
USB device support):

- Convert all of my locally chosen function names to their actual
  Windows equivalents, where applicable. This is a big no-op change
  since it doesn't affect functionality, but it helps avoid a bit
  of confusion (it's now a lot easier to see which functions are
  emulated Windows API routines and which are just locally defined).

- Turn ndis_buffer into an mdl, like it should have been. The structure
  is the same, but now it belongs to the subr_ntoskrnl module.

- Implement a bunch of MDL handling macros from Windows and use them where
  applicable.

- Correct the implementation of IoFreeMdl().

- Properly implement IoAllocateMdl() and MmBuildMdlForNonPagedPool().

- Add the definitions for struct irp and struct driver_object.

- Add IMPORT_FUNC() and IMPORT_FUNC_MAP() macros to make formatting
  the module function tables a little cleaner. (Should also help
  with AMD64 support later on.)

- Fix if_ndis.c to use KeRaiseIrql() and KeLowerIrql() instead of
  the previous calls to hal_raise_irql() and hal_lower_irql() which
  have been renamed.

The function renaming generated a lot of churn here, but there should
be very little operational effect.
2005-01-24 18:18:12 +00:00
Warner Losh
6c1b1bbc71 Add an entry for Magic Ram, Inc's ETHERNET PC CARD 933926 card I just
won on ebay.  Also, add a pointer to the PCMCIA's web site for the
registered tuples (== manufacturer ID's).
2005-01-24 17:59:59 +00:00
Warner Losh
d4c6cdea21 Ignore the expected function number.
NetBSD went this route a while ago.  FreeBSD originally tried this to
cope with multifunction cards.  However, it turns out that we're
better off not worrying about the function number, and instead worry
about the function type for the function.  This has worked well in
NetBSD, and all FreeBSD's relevant drivers have been converted.

# I'll rework the macros that specify them shortly, as soon as I can
# come up with a good, compatible way to deal...
2005-01-24 06:54:05 +00:00
Warner Losh
7d57300f4c u_intXX_t -> uintXX_t 2005-01-24 06:48:26 +00:00
Scott Long
35e050281e Add support for the LSI 320-2E PCI-Express controller. Fix a couple of bugs
in the ioctl handler.  Update the LSI copyrights for these.

Obtained from: LSI, Corp
2005-01-23 23:25:41 +00:00
Scott Long
a56d2b5a51 Add my copyright for the locking and busdma work. 2005-01-23 23:22:34 +00:00
Scott Long
da6297fcf9 Provide a needed argument to AT_MAKE_TAGID. 2005-01-23 22:33:59 +00:00
Scott Long
d563f671c3 Fix whitespace 2005-01-23 16:13:10 +00:00
Julian Elischer
2f4829e6cb Add code to do better auto detection of tuner types etc.
PR:		kern/75831
Submitted by:	Branko Lankester <branko@euro.net>
MFC after:	1 week
2005-01-23 07:13:09 +00:00
Matt Jacob
796a9ee342 Remember to snag firmware for the DELL OEM (6312) card
MFC after:	2 days
2005-01-23 06:37:28 +00:00
Matt Jacob
1b94141649 Add some macros for inserting tag ids.
MFC after:	2 weeks
2005-01-23 06:28:49 +00:00
Matt Jacob
182d1c037e Macroize the making of tag ids.
MFC after:	2 weeks
2005-01-23 06:28:08 +00:00
Matt Jacob
99334b0de4 Roll minor number.
MFC after:	2 weeks
2005-01-23 06:27:05 +00:00
Matt Jacob
f2e4186204 Don't set ZIO for 23XX for target mode (use fast posting instead).
Use the correct number of handles for multihandle returns.

Very, very, rarely on some SMP systems we've seen an 'unstable' type
in the response queue. I dunno whether or not it's a bug in our
handling, or whether there's a cache incoherency issue, but
try to guard against it.

MFC after:	2 weeks
2005-01-23 06:26:45 +00:00
Matt Jacob
dd1419abe1 Support the DELL OEM 2312 cards (1077,6312).
Many thanks to Stormweb for making the h/w available for testing.

MFC after:	2 days
2005-01-23 06:23:55 +00:00
Warner Losh
5fb99dcabe Bring in support for SUGOI LAN GIGA NIC made by System TALKS, Inc from
a RealTek 8169SB.

PR: 74262
Submitted by: Yoshikazu GOTO-san

# Submitter notes that he's unsure of the revision string for 8169SB
2005-01-22 22:40:53 +00:00
Pawel Jakub Dawidek
1db17c6db2 - Don't destroy UMA zone on error in mdcreate_malloc(), because we need it
in mddestroy() to properly free already allocated memory.
  This fixes a panic when we want to create too big memory backed device
  with preallocate memory (-o reserve).
- Remove redundant { }.

MFC after:	1 week
2005-01-22 19:56:03 +00:00
Poul-Henning Kamp
9d3a77c463 Add a couple of mtx_asserts() to try to narrow down the window on
a bug repeatedly reported.
2005-01-22 19:08:50 +00:00
Warner Losh
327f4aba35 we don't need the offset in the attr memory to get the ethernet
address, nor do we need the alignment requirements, so eliminate them.
This likely means that we can now collapse some of the entries as we
have no need of them anymore (they match other entries and were there
only to get the right attr memory offset of the enet addr).
2005-01-21 19:51:23 +00:00
Poul-Henning Kamp
27d62ec5a6 Remove prototype of undefined function so this compiles again. 2005-01-21 10:19:17 +00:00
Warner Losh
3b36b3703e Rework pccard attachment a little. Now both of my fe based ethernet
cards work.  These changes depend on the expanded funce parsing that
just was committed to pccard_cis.c.  In NetBSD the ethernet address
was read out of attr memory directly.  We rely on the kernel pccard
parser to pulll this information out of what appears to be an obsolete
funce with the information in it.

# I'm still getting the no rx interrupt sometimes with some hub/switches
# for reasons unknown...  But usually only one and only when dhclient
# runs.
2005-01-21 02:14:40 +00:00
Warner Losh
9cdd39c25f Some older PC Cards have a weird format for FUNCE tuples. They appear
as type 0, rather than the usualy type 4.  Assume that this format is
from an old standard and go with it.  The Fujitsu FMV-186A and Silicom
Ethernet cards I have both have tuples with this format, and they are
both pretty old cards.

# if somebody knows for sure, please let me know.
2005-01-21 02:11:48 +00:00
Paul Saab
f3f8276732 Remove 6422, V100 and add the P600.
Submitted by:	John Cagle
2005-01-20 22:51:38 +00:00
Warner Losh
ca44231197 Don't print 'unknown id' in the ep_pccard_identify routine. It is
expected to be unknown in some cases, and printing it clutters up
things too much.
2005-01-20 20:36:59 +00:00
Warner Losh
40cc58261a Remove now-stale comment 2005-01-20 20:32:56 +00:00
Warner Losh
0c2c006362 Only attach to network functions. This should be a nop since I'm not
aware of any fe based cards that do anything except network (well,
maybe the fujitsu scsi/lan card, but I've only seen two of those on
ebay in the last 3 years).
2005-01-20 20:08:18 +00:00
Warner Losh
4a17d9141c Include necessary declarations 2005-01-20 20:06:44 +00:00
Warner Losh
9273a2b597 Only match ethernet functions. I've not seen any multifunction cards
(from a PC Card sense), so this should be a nop.  The
pseudo-multifunction cards (eg Silicom ones) need a special driver
anyway..
2005-01-20 20:03:37 +00:00
Warner Losh
e30d646d97 Only attach to network functions. I'm not aware of any multifunction
(pccard sense) sn based cards, but this won't hurt.  The
pseudo-multifunction cards need a special driver anyway...
2005-01-20 19:59:31 +00:00
Warner Losh
ca33f4678a Only attach to network functions (unlikely to matter since I'm not
aware of any multi-function cs cards, but it doesn't hurt).
2005-01-20 19:56:22 +00:00
Warner Losh
a20e4848bd u_intXX_t -> uintXX_t while I'm here. 2005-01-20 19:39:33 +00:00
Warner Losh
0409a8c387 Only attach to network functions. 2005-01-20 19:37:22 +00:00
Warner Losh
52cba392e0 u_intXX_t -> uintXX_t
Fix a comment
2005-01-20 19:32:37 +00:00
Warner Losh
c5c0655590 Use Intersil chip names for the symbols, since many makers use the
intersil IDs but their own name in the CIS.
2005-01-20 18:34:22 +00:00
Warner Losh
7610c28cf1 Add support for SENAO SL-2511CD
Info submitted by: Paulo Fragoso
2005-01-20 17:46:05 +00:00
Warner Losh
4cd3a82d7b Minor tweaks to properly order things. 2005-01-20 17:34:15 +00:00
Warner Losh
787a196bb7 Mask off the upper bits of the resource before using it as an index
into a small array.  Also, re-save the dev in attach to avoid
depending on side effects of the probe.

Weird stuff Reported by: jeffr
2005-01-20 17:27:37 +00:00
Bruce M Simpson
0502030614 Add device description for the Dell Remote Access Card (DRAC) III and IV
virtual COM port. This makes the use of the Dell OpenManage tools on FreeBSD
considerably easier, and is based on Chuck Cranor's original patch for 4.6.

Reviewed by:	imp
Tested by:	dpk at dpk dot net
MFC after:	1 week
2005-01-20 15:40:50 +00:00
Warner Losh
e1239d17fe Minor nit 2005-01-20 07:05:59 +00:00
Warner Losh
bec6d0ea5a Although USBVERBOSE was an option in the config system, usb_subr.c failed
to recognize that.  Include opt_usb.h to pick it up, rather than usb_port.h.
2005-01-20 05:03:28 +00:00
Warner Losh
b72e9f1719 Fix spelling error
submitted by: Anders Hanssen
2005-01-19 20:21:44 +00:00
Sam Leffler
aa959e0d17 Update support for 795x parts:
o rework pll setup code to follow h/w specification
o add hint.hifn.X.pllconfig to specify reference clock setup
  requirements; default is pci66 which means the clock is
  derived from the PCI bus clock and the card resides in a
  66MHz slot

Tested on 7955 and 7956 cards; support for 7954 cards not enabled
since we have no cards to test against.

In collaboration with Poul-Henning Kamp.

Reviewed by:	phk
MFC after:	1 week
2005-01-19 17:03:35 +00:00
Shunsuke Akiyama
1f41d5d83a Fix USB serial device stalled after tcflush() was called.
PR:		kern/65769
MFC after:	3 days
2005-01-19 15:18:00 +00:00
Warner Losh
973bfe6c4a MFp4: overhaul of resource allocation
Rather than have a twisty maze of special case allocations, move
instead to a data driven allocation.  This should be the most robust
way to cope with the resource problems that the multiplicity of ways
of encoding 5 registers that have the misfortune of not being a power
of 2 nor contiguous.

Also, make it less impossible that pccard will work.  I've not been able
to get my libretto floppy working, but it now fails later than before.

phk and I had similar ideas on this during the 5.3 release cycle, but
it wasn't until recently that I could test more than one allocation
scenario.

MFC After: 1 month (5.4 if possible, 5.5 if not)
2005-01-19 07:46:38 +00:00
Warner Losh
33481e9d67 MFp4: u_intXX_t to uintXX_t. 2005-01-19 07:37:32 +00:00
Warner Losh
0ca891272b Simplify aha resource management, and fix a few bugs in unwinding
error cases.
2005-01-19 06:54:10 +00:00
Warner Losh
c3bd3b5978 Call wi_free after we turn off the interrupts. If we call it before,
then we reference parts of the softc.

# My appologies, but this was sent to me by someone whose name I've lost.
2005-01-19 01:26:44 +00:00
John Baldwin
b0977ecfd7 Don't create new-bus resources for ACPI extended IRQ resources that are
producers rather than consumers as new-bus resources only handle consumed
resources.  We already do this for the other ACPI resource types that
support the producer/consumer attribute.
2005-01-18 20:21:36 +00:00
John Baldwin
5e15a08100 For the sake of consistency, look up link devices relative to the root
object (/) rather than the pci bus object when walking the _PRT to force
attach devices.  We already look up relative to the root object when doing
interrupt routing.

Suggested by:	njl
2005-01-18 20:20:32 +00:00
John Baldwin
94b3af82c1 - Add support for link devices where _CRS just outright fails to execute.
For such devices, we require _PRS to exist and we warn if any of the
  resources in _PRS are not IRQ resources (since we'll have no way of knowing
  which of those resources to use without a working _CRS).  When it does
  come time to set resources, we build up a resource buffer from scratch
  as we do for devices with _CRS that only have IRQ resources.
- Fix a bug with setting extended IRQ resources where we set the IRQ value
  in the wrong resource structure meaning that whichever IRQ was listed in
  _PRS was used instead.  This might fix some weird issues on certain boxes
  where IRQs > 16 don't seem to work when using ACPI.
- Fix a bug with how we walked the resource buffer after _SRS to call
  config_intr() in that the 'end' variable was not properly updated, so we
  could either terminate the loop early or loop after the end of the
  buffer.

Tested by:	pjd
2005-01-18 20:18:46 +00:00
Sam Leffler
c4dc6d1307 adjust tx buffer allocation based on empirical testing:
o increase the max per-frame tx descriptor count and the number of tx
  buffers for forthcoming fast frame support
o correct the max scatter/gather count; it cannot be larger than the
  max(tx,rx,beacon) descriptor counts
2005-01-18 19:42:17 +00:00
Sam Leffler
aab26fb481 add missing statistic 2005-01-18 19:33:06 +00:00
Sam Leffler
4c24deac20 disable interrupts when transitioning to INIT state so we don't rx frames 2005-01-18 19:31:31 +00:00
Sam Leffler
f6b8ec160d replace hand-rolled code to compact an mbuf chain with m_defrag; this is
suboptimal but needed for fast frames which won't fit in a single cluster
2005-01-18 19:28:49 +00:00
Sam Leffler
80d2765fe2 setup the beacon xmit queue to not interrupt; we don't use them and
they make the led's flash unnecessarily in adhoc mode
2005-01-18 19:10:17 +00:00
Sam Leffler
3e50ec2c95 better led blinking 2005-01-18 19:03:04 +00:00
Sam Leffler
0a1b94c44c add paren's so we can supply a|b as a debug mask 2005-01-18 18:11:04 +00:00
Sam Leffler
0b19ce1eb7 o disable pci retry timeout to avoid problems when operating in C3 state
(fix imported from madwifi by Takanori Watanabe)
o eliminate save/restore of pci registers handled by the system
o eliminate duplicate zero of the softc (noted by njl)
o consolidate common code

MFC after:	1 week
2005-01-18 18:08:16 +00:00
Warner Losh
ddd8ec50b0 Go ahead and match on CIS3 and CIS4 strings as well. These are NULL
for the vast majority of our cards.  However, they are critically
needed to distinguish different fe based PC Cards (the FMV-182 from
the 182A) which need to be treated differently (the ethernet address
is loaded not from the standard CIS-based ethernet tuples, but from
differing locations in attribute space based on the version string in
CIS3.  This should have no impact for other users of this function.
2005-01-17 06:54:48 +00:00
Scott Long
5b4a781b96 Lock the AMR driver:
- Introduce the amr_io_lock to control access to command queues, bio queues,
  and the hardware.
- Eliminate the taskqueue and do all completion processing in the ithread.
- Assign a static slot number to each command instead of doing a linear
  search for free slots each time a command is needed.
- Modify the interrupt handler to more closely match what Linux does, for
  safety.
2005-01-16 07:34:26 +00:00
David E. O'Brien
7c804097a4 Fix kernel builds with INVARIANTS. 2005-01-16 02:39:18 +00:00
Scott Long
bd1954cc37 Use bus_dmamap_load_mbuf_sg() for loading rx buffers. 2005-01-15 22:05:59 +00:00
Scott Long
0ab6412830 Convert if_em to the new bus_dmamap_load_sg() interface. The old callback
was really just a waste of cycles, so this streamlines it considerably.
2005-01-15 20:52:15 +00:00
Warner Losh
2dd5c91ebb Use the standard FreeBSD license
Approved by: imp, jon
2005-01-13 19:12:10 +00:00
Warner Losh
523675f64c Use the standard FreeBSD license for these files.
Approved by: imp, jon
2005-01-13 19:05:25 +00:00