Commit Graph

2930 Commits

Author SHA1 Message Date
mjacob 168ee5d9a6 keep target mode up to date. 2002-06-15 00:17:28 +00:00
mjacob e02259aa26 Add support for ISP_FC_GETHINFO which can tell you connection topology,
current speed, loopid, etc.
2002-06-15 00:17:07 +00:00
mjacob 942d8435f7 Make sure we set maxluns even if isp_touched is already set.
Do a fallback on reading stuff from the fabric. Some devices/initiators
don't correctly register their type with the fabric nameserver.  This
seems to be due to a misinterpretation of what TYPE should mean for a
CT_HDR. In any case, do a fallback to try and catch these misentered
entities.

Add some stuff for default framesize and throttle. Fix some buglets.
2002-06-15 00:16:26 +00:00
thorpej 5b5608e8b2 Use M_IFMADDR instead of M_IPMADDR. From John Franklin, kern/16251. 2002-06-14 15:21:45 +00:00
augustss 74cfa48c7d Use consistent naming. 2002-06-13 15:27:23 +00:00
bouyer 6280502d5f Bump delay() between reset and IDENTIFY from 100 to 5000. Some ATAPI devices
wedge when talking to them too soon, and incorrectly react to WDC_RESET.
Close PR kern/17208 by Paul Goyette.
2002-06-12 09:55:47 +00:00
yamt 7d0fd357f6 make auto const variables static. 2002-06-08 16:51:38 +00:00
bjh21 00eaefef06 When copying a block with an odd size to or from the card, be very careful
not to overrun the end of it on the host side, since that might just slip over
a page boundary and cause an embarrassing kernel panic.
2002-06-07 00:01:19 +00:00
he 33afd46155 Add newlines to the WARNING messages printed for the dynamic standby bug. 2002-06-06 17:20:50 +00:00
martin 9ae19204d9 #if some tables and a helper function for debug output to make it
possible to compile this without ISDN debugging support.

Fixes PR kern/17161.
2002-06-04 19:51:18 +00:00
lukem 06de426449 SIMPLEQ rototill:
- implement SIMPLEQ_REMOVE(head, elm, type, field).  whilst it's O(n),
  this mirrors the functionality of SLIST_REMOVE() (the other
  singly-linked list type) and FreeBSD's STAILQ_REMOVE()
- remove the unnecessary elm arg from SIMPLEQ_REMOVE_HEAD().
  this mirrors the functionality of SLIST_REMOVE_HEAD() (the other
  singly-linked list type) and FreeBSD's STAILQ_REMOVE_HEAD()
- remove notes about SIMPLEQ not supporting arbitrary element removal
- use SIMPLEQ_FOREACH() instead of home-grown for loops
- use SIMPLEQ_EMPTY() appropriately
- use SIMPLEQ_*() instead of accessing sqh_first,sqh_last,sqe_next directly
- reorder manual page; be consistent about how the types are listed
- other minor cleanups
2002-06-01 23:50:52 +00:00
thorpej 96e504cc78 Fix a pasto in printf arguments which resulted in the aac kernel
version being mis-reported.
2002-05-31 17:36:29 +00:00
thorpej 12af01e337 Remove an unnecessary printf argument. 2002-05-31 17:34:08 +00:00
thorpej 7173dc3334 Remove shadow decl of num_errors which exactly duplicated the file-scope
decl.
2002-05-31 17:31:15 +00:00
thorpej eb00d53595 Remove duplicate TULIP_SET/TULIP_CLR. 2002-05-31 17:27:40 +00:00
mycroft 79056950e2 Mask off extraneous bits in the RX frame status when testing it. My cards set
bit 3 in ad hoc mode.
Also, some minor constant folding.
2002-05-31 15:52:55 +00:00
thorpej 34820075d5 Statements must follow labels. 2002-05-30 21:09:54 +00:00
martin 2fe85a6623 Uniformly pass a "struct isdn_l3_driver *" through layer 2, so we
do not have to search for that driver later while we already knew it
at layer 1.
2002-05-21 10:31:10 +00:00
augustss 54bb400a18 Add a driver for the IBM CPC700 chip. This chip is a host bridge for
PowerPC and provides a PCI-host bridge, interrupt controller, two com ports,
two IIC ports, a timer, and a DRAM controller.
The driver supports PCI, interrupts and com ports.
2002-05-21 02:58:25 +00:00
augustss 1c66d18529 Make it possible to override the way register access is done.
This is needed for some really screwball attachments of the CS8900.
2002-05-21 02:47:04 +00:00
mycroft 44024682c7 The FIX_RESUME_BUG hack does not work, so remove it.
Also, attempt to clarify the message slightly when updating the EEPROM.
2002-05-20 15:23:01 +00:00
bouyer af09484589 Be more verbose when returning XS_DRIVER_STUFFUP 2002-05-18 16:09:43 +00:00
mjacob c2d194880d Fix seveeral issues- but the most important of which is that we have
to check if we get a RQCS_DATA_UNDERRUN - if we're an FC card, we may
not have RQCS_RU set- if it isn't set, we just lost a DATA XFR IU in the
middle of the exchange. In this case, we have to bomb out the whole xfer.
We had been getting silent data corruption before.
2002-05-17 18:49:42 +00:00
thorpej 4daab7072a Don't access a scsipi channel's periph table directly; use
scsipi_lookup_periph().
2002-05-16 02:50:53 +00:00
matt 496a3cb868 Let's put a s = splnet(); to match the splx(s); already in the routine.
(yes, we were doing an splx with an uninitialized variable).
2002-05-15 23:51:49 +00:00
matt a61a41b6b0 Only enable detailed evcnts if GEM_COUNTERS is defined. But always count
interrupts.
2002-05-15 21:05:23 +00:00
matt 486ad92d2a Add evcnt stuff for interrupts.
Fix receiver lockups.  When writing the RX Kick register, we need back up
on descriptor since we advanced one in the for loop.  That will be the
last descriptor we haven't processed which is what we should write.
2002-05-15 02:36:11 +00:00
matt d6f9a400fe Fix initialization of GEM_RX_MAC_INTR. 1 means mask. 2002-05-14 23:33:41 +00:00
augustss 1906cd67ef ANSIfy. 2002-05-14 19:23:45 +00:00
matt 0dc8ee943d Eliminate more commons or redundant declarations. 2002-05-14 02:58:32 +00:00
wiz d30d25dc1a Spelling fixes, from Sergey Svishchev in kern/16650. 2002-05-12 15:48:36 +00:00
matt 3b2e959dfc Supress RX_MAC interrupts regarding the FRAME_COUNT register. 2002-05-11 20:53:52 +00:00
matt c1fc5d35dc Many fixes. Multicast hash filter works now. Autonegotiation with GigE
on Mac G4's now works.  XXX Checksum offload still needs to be done.
2002-05-11 00:36:02 +00:00
matt 2f836188fb If the detected media is gigabit, change the gem to use GMII mode otherwise
switch back to MII mode.  Keep a sliding window for TX segments and when it
gets > 2/3 full, request a TX interrupt (window gets reset when the h/w TX
queue is empty).  Add dv_xname to a few printfs.  With the above changes,
the gem driver will now work on Macintoshes, even in GigE mode.  On a 733
PowerMac G4 it gets ~355Mb/s TX and ~280Mb/s RX to/from an Alpha XP1000.

XXX mii autoselect is still flakey.
2002-05-08 02:12:55 +00:00
uwe 58789acb68 Delint. Add /* CONSTCOND */. Add parens to macro argument to avoid
interesting interaction between cc -C and comma inside a comment after
macro definition.
2002-05-07 05:56:47 +00:00
bouyer 58e5d90faa Don't disable TARF_TAG when the 1010 workaround is active, otherwise
the target won't do tagged queuing again after e.g. a bus reset.
Just report to scsipi that we can't do tagged queuing.
2002-05-05 15:23:22 +00:00
thorpej 9a88d576c1 hme_init(): call mii_mediachg() to make sure the current media is set. 2002-05-05 03:02:38 +00:00
bouyer 8e978787e8 Keep track of the current SCSI mode (SE/HVD/LVD) and don't start PPR
negotiation if it's not a LVD bus.
Remove write to SIOP_STEST0, it's bogus and I don't know why it's there at
the first place.
2002-05-04 18:43:22 +00:00
bouyer 3dc7dba078 It seems that the 1010-33 has a bug: it sometimes generate spurious SCSI gross
errors for narrow transfers after a reselect. FreeBSD sym driver has a comment
about this, but their workaround (disable SCSI gross error reports) doesn't
work for me. Instead dissallow disconnect if the target is not wide
(FreeBSD doens't allow disconnect until the target has been fully probed, which
is why they may not have noticed my problem).
2002-05-04 18:11:06 +00:00
bouyer 56aff7332d Add 1010 only SCSI gross error disable bits. 2002-05-04 17:51:52 +00:00
bouyer 50bb653982 More debug printfs. 2002-05-04 17:51:16 +00:00
mycroft 3f47c5b658 Clean up some dead code.
Combine nway_reset() into nway_auto().
2002-05-03 08:48:12 +00:00
mycroft a5f6bd3b57 5) Be more liberal in blasting SIATXRX and SIASTAT in nway_auto(); in
particular, make sure that all the SIASTAT_ANS bits are in the right state
   so we don't do something inane.

Still doesn't actually bring the link up properly, but at least it negotiates
most of the time, and does it a little faster.
2002-05-03 06:56:20 +00:00
mycroft b3bd4ab122 More internal Nway issues:
1) Do not call tlp_sia_update_link() in Nway mode, and do not look at SIASTAT
   in any other place that nway_status(), where we first check that it's valid.
   In other places, look at IFM_ACTIVE after having call nway_status().
2) Eliminate stupid MII_MEDIACHG calls, and arrange for nway_service() to
   update status on every call.
3) Nuke the synchronous case of nway_auto() from orbit.
4) Do not call nway_statchg() when using manual configuration; tlp_sia_set()
   does everything we need.
2002-05-03 06:54:37 +00:00
mycroft 1489c15507 Fix multiple problems with 2114x internal Nway:
1) Set OPMODE_TTM in the default tsti_opmode, so that nway_status doesn't
   blow up and report the wrong media type when statically configured.  (This
   code is a hack.)
2) Do not set IFM_ACTIVE (i.e. ignore SIASTAT_LS*) when in auto-negotiation
   mode and negotiation has not completed (per 21143 manual).
3) Do not clear auto-negotiation mode; otherwise the chip will not
   renegotiate on a link failure.

With these changes, 10/100 selection is more stable, and auto-negotiation
comes up with the right status and detects link, but the link does not work
unless it's hardwired.  More work is needed.
2002-05-03 05:41:46 +00:00
thorpej 403f667b5a Handle platforms that don't provide stream methods.
From Hiroyuki Bessho, PR 16617.
2002-05-03 03:30:48 +00:00
thorpej 317ab784d9 Bump the number of Tx DMA segments from 8 to 16 (the zero-copy socket
code sometimes sees more than 8).
2002-05-03 00:07:02 +00:00
thorpej 5173cfae8a Bump the number of Tx DMA segments from 7 to 15 (the zero-copy socket
code sometimes sees more than 7).
2002-05-03 00:04:07 +00:00
ad 4137ec18e8 Fix pasto. 2002-05-02 12:44:31 +00:00
martin ea0ec5a299 Do not mask/unmask interrupts on IPAC to clear the interrupt status.
It is unclear if this realy is needed and if, on which type of cards. I
haven't run accross a card that needs it yet.  This may have been just
a copy & pasto from the ISAC interrupt handler carried over to IPAC.
2002-04-30 12:56:51 +00:00
bouyer c85510bdd7 Factor out initialisation of t_msgout.count
clear scntl4 in sdtr/wdtr negotiation
2002-04-29 15:45:05 +00:00
bouyer 1a268e6df1 Add a missing esiop_script_sync(), and debug messages improvements. 2002-04-29 15:44:16 +00:00
martin 8853536066 Patches from Matthias Drochner, slightly modified by me:
Remove the clear-the-irq-after-enabling it dance (which had bad side
effects on some cards). Instead disble the ISAC receiver when we have
interrupts disabled. Adjust the interrupt handler to properly deal with
subtle differences of the ISAC implementation in IPAC chips.
2002-04-29 13:42:42 +00:00
bouyer eea7ef4c53 Use a u_int32_t in script RAM instead of the SEM bit in ISTAT to pass flags
between script and driver. This allows more than one flag, and is easier to
manage (we almost can't read/write istat outside of the irq handler).
2002-04-27 18:46:49 +00:00
bouyer 5387f035d3 Implement a ring for the completed commands. This avoid a (problematic only
if error occurs after status is collected) race condition
when using the status byte to detect completed commands (a command descriptor
could be recycled before the device disconnected), and make the
interrupt routine handling completed commands more efficient (no need to
scan target * lun * tag array any more).
2002-04-27 17:39:51 +00:00
ad 77e08f053a Add a driver for Adaptec FSA RAID controllers, as often found in Dell
servers. Based on the FreeBSD/OpenBSD versions.
2002-04-26 02:05:07 +00:00
bouyer 4b307fe0af It's not safe to access the SCNTL1 register while the SCRIPT is running.
On the 1010 this can wedge the chip. So abort the script instead.
the abort interrupt will trigger a bus reset.
2002-04-25 20:05:10 +00:00
bouyer f66f6c27a6 - We can't share the per-lun DSA entry for untagged and tag table DSA;
there may be tagged commands still running when we queue a request sense
  command.
  Solve this by using 2 DSA entry per LUN
- Now that we have the command DSA before select, we can load T/L/Q in
  SCRATCHC. This makes the selection timeout handler simpler.
- Avoid a race condition when setting the free flag in the cmd ring (see
  comment in the script)
- don't forget to update the ID in the head of LUN table after a sync/wide
  negotiation. This fixes the command timeout at the first data command
  after negotiation (the bus reset handler did update the ID properly,
  so subsequent commands were OK).
- for DMA interrupts, clear fifo if it's not empty. Leaving the fifo dirty
  would prevent subsequent interrupts from coming in.
- Various improvements in debug messages
- misc cleanups.
2002-04-25 19:34:02 +00:00
ad 4a46e19dcf Set xs->error = XS_SENSE in the appropriate spot. 2002-04-25 18:45:35 +00:00
bouyer b46922a07a For a new command, use the id in the command table and get rid of the ID in the
scheduler slot. This costs a few more instructions but divide the size of the
scheduler ring by 2, saving 1k of onboard RAM (a bus with 15 devices would
overflow the on-board RAM by 128 bytes).
2002-04-24 09:43:14 +00:00
bouyer cd3578d7ef More copyright fixes, pointed out by Thomas. Thanks ! 2002-04-23 20:41:13 +00:00
bouyer c7454ad973 - factor out parts of (e)siop_attach() to siop_common_attach()
- Add support for DT transfers (aka Ultra/160) in esiop

Note that DT transfers are not enabled for 53c1010-33 rev 0 yet; if I trust
FreeBSD it has a bug which prevent them to do DT properly.
From the same source there may be issues with some revs of 53c1010-66.
2002-04-23 17:33:27 +00:00
bouyer 6d37782a49 Bump the space for SCSI messages from 8 to 16 octets, as 8 may not be
enouth for IDENTIFY + TAG + PPR.
Get rid of constants in C code by use of a offsetof macro.
2002-04-23 12:55:26 +00:00
ad ea92353d58 MLX_GET_SYSDRIVE expects the unit number returned in *arg. Should fix PR
14116.
2002-04-23 11:57:45 +00:00
bouyer cf06149dac Enable software LED control based on LED0 feature, not #define.
For now, set the LED0 feature if SIOP_SYMLED is defined in siop_pci_common.c.
From Jason R Thorpe.
2002-04-23 10:38:37 +00:00
bouyer b6fee4019d Add some new features:
- SF_BUS_ULTRA3, for Ultra/3 (80Mhz) busses
- SF_CHIP_LEDC,  led on GPIO0 with hardware control
- SF_CHIP_DT, support DT clocking.
2002-04-23 10:06:44 +00:00
ad 9a09578e25 Add a driver for ICP-Vortex GDT and Intel Storage RAID controllers. Parts
taken from OpenBSD. Test hardware kindly provided by Intel. This still needs
management bits, and doesn't support older controllers, but that shouldn't
be hard to fix.
2002-04-22 21:05:19 +00:00
bouyer 84b0f1e37d Adapt for script "wait MSG_OUT after select" change: now, when we get
selection timeout, SCRATCHE points to the slot which triggered the timeout,
not the next one.
2002-04-22 20:47:20 +00:00
bouyer 8ba368a0b6 Really, don't set siop_cmd->tag in setup_table() 2002-04-22 20:31:49 +00:00
bouyer 4cda08fb6e Add support for tagged queuing to esiop (256 tags per device).
For this add another indirecton: the DSA in the LUN table points to
a table of DSA indexed by the tag number when tagged command is in use.
For non tagged command, the LUN DSA still points to the tables describing the
xfer directly.
2002-04-22 15:53:39 +00:00
bouyer e3f96dde51 Fix last change: assign siop_cmd->tag in callers instead of siop_setuptables(),
and use siop_cmd->tag instead of xs->xs_tag_id. This way siop can use
xs->xs_tag_id + 1 without interferences with esiop.
2002-04-22 15:48:55 +00:00
augustss d32b5e84cc Add a driver for the Sony SPIC that handles jog dials etc.
This driver works on my SRX77, but probably little else.
It makes the jog dial appear as a wsmouse.
2002-04-22 12:42:11 +00:00
bouyer 72906f4578 In siop_setuptables(), use the proposed tag_id, not tag_id +1.
In siop.c bump siop_cmd->tag by one as tag id 0 is reserved for untagged cmds.
2002-04-22 09:43:44 +00:00
bouyer 8cfc41f9ed First cut at a esiop driver (enhanced siop). Doesn't implement tagged queuing
yet.
If is restricted to SIOP which implement the load/store instruction, and
has 10 scratch registers (basically, 825 and newer, possibly 770).
It implements a different interface between host and script, using a real
ring for command starts, and improved support for reconnect which will allow
256 tag per device. It uses interrupt on the fly to signal complete command,
which allows several commands to be serviced per interrupt and doesn't require
the script to stop to signal command completion.
2002-04-21 22:52:05 +00:00
bouyer 0852b37f15 Note that if siop_common_xfer is changed, the scripts need to be changed too. 2002-04-20 15:25:53 +00:00
mjacob acfd588eca Number of luns supported for SCC-2 is actually really 16384- top
3 bits are lun address modifiers.

Remove code that (incorrectly) thought it was asking the f/w to only
PLOGI if not already PLOGI'd. The current f/w documentation tells us
that we have this backwards.
2002-04-20 05:05:56 +00:00
bouyer 97fe8b91c5 Move a few things around, so that ic/siop_common.c and pci/siop_pci_common.c
can be compiled without including siopvar.h.
2002-04-20 00:15:54 +00:00
thorpej 46a2773ba8 * Fix the CS_IS_ENABLED() logic so that it actually evaluates to
"true" at the appropriate times for non-PCMCIA interfaces.  This
  means that the ENETRESET path in cs_ioctl() now runs, thus fixing
  multicast (and IPv6) on my Shark.  Yay.

* Simplify cs_hash_index(): Rather than taking the bottom 6 bits of
  a big-endian CRC32 and reversing them, just take the top 6 bits of
  a little-endian CRC32.
2002-04-18 21:58:02 +00:00
thorpej 036066e625 Define the Symbios Logic and Tekram NVRAM contents. 2002-04-18 21:08:43 +00:00
martin ff434a1201 Handle unexpected interrupts better. 2002-04-18 12:19:05 +00:00
bouyer 52cdca5f88 If SIOP_SYMLED is defined, drive the activity LED though GPIO pin 1. 2002-04-18 12:03:15 +00:00
onoe 86920876dd (force commit: no changes in the code)
WI_RID_SCAN_APS in previous commit works for Intel Pro/Wirelss 2011
with firmware 2.51.1.
It seems that the firmware automatically updated after the card runs on
Windows 2000 with 2011_2011B_CD_3.0 in Intel web site.
2002-04-18 05:24:28 +00:00
martin c8b77487a2 When clearing interrupts, clear IPAC interrupts for cards that have
one.
2002-04-17 17:34:48 +00:00
onoe fa97a362d4 Support WI_RID_SCAN_APS (wiconfig -D) for Symbol CF Card.
It apparently requires newer firmware (3.10.4), and doesn't work on
Intel PRO/Wireless 2011 (2.0.11).
2002-04-16 07:24:06 +00:00
onoe a40f47b098 Add support to Symbol Wireless Networker CF card.
The card is Type 1 CF card and it doesn't have firmware in.
So we need to download the firmware image into the card before
touching it.
XXX downloading code should be written in generic (bus independent),
    but I don't have enough information for now.
2002-04-15 15:05:58 +00:00
onoe dd80e6d577 Some fixes for Symbol card.
- The version string doesn't need to start with 'V'.
- Symbol firmware also support CREATE_IBSS.
- But it doesn't support ROAMING_MODE nor MICROWAVE_OVEN.
2002-04-14 19:55:23 +00:00
mycroft f00c3c2e40 tm_gpctl and tm_gpdata must be shifted right 16 bits. DOH.
This makes another CardBus tlp card work...
2002-04-14 19:10:18 +00:00
martin e4998611e9 Fix copyright notice. 2002-04-14 12:24:26 +00:00
christos db29511727 PR/16058: Tero Kivinen: Don't free rbuf or detach tty if rbuf allocation
failed during attach phase.
2002-04-13 17:05:16 +00:00
isaki 9ee0a509cd Fix minor typo in adpcm_estim[]. 2002-04-13 12:40:50 +00:00
martin 8d2451d1be When pruning state at interrupt enable time, also call the clearirq
routine for cards that provide it.
2002-04-13 11:03:54 +00:00
martin 0cdadad2cd Defer initialization of the ISAC chip until we enable interrupts - it gets
into a strange failure mode if we do it with disabled interrupt. When
(re-)enabling interrupts reset transmitter and receiver and clear any
pending state.
2002-04-13 10:28:36 +00:00
thorpej ff7306cf44 * Add a new hwflag, COM_HW_NO_TXPRELOAD, which tells comstart() to
not pre-load the chip's Tx buffer, but instead waits for the Tx Ready
  interrupt to transmit the first chunk of data.
* On the IOP310, set COM_HW_NO_TXPRELOAD, rather than COM_HW_TXFIFO_DISABLE.

This solves the "UART hangs" problem on the Npwr in a nicer way (i.e. we
get to use the FIFO, whee).  The COM_HW_NO_TXPRELOAD happens to match the
Linux 16550 driver's Tx algorithm, and the "UART hang" was never observed
on the Npwr running Linux.

Eventually, we might want to eliminate the COM_HW_NO_TXPRELOAD, and simply
always use its algorithm.  But it should be tested on more 16x50 variants
before we do that.

Kudos to Valeriy Ushakov <uwe@netbsd.org> for pointing out this solution
(which also happens to fix the stray UART interrupt issue on the Krups
Javastation), and to Allen Briggs <briggs@netbsd.org> for experimenting
with various methods of fixing this.
2002-04-12 19:32:30 +00:00
augustss d0c3f994ea Put device name at start of line. 2002-04-11 11:21:26 +00:00
mjacob 31045afa8c Clean up a bit from the last checkin so that the correct result pointers
are used- didn't make a difference, but hey...

Put in commented out GFF_ID code- for use in future attempts to search
the fabric- this probably has to go thru the management server path.

Don't whine about handles we can't find if these are aborted commands
(we know we can't find the handles because we destroy handles after
a successful mailbox abort- we don't wait for the F/W to decide whether
it wants to return a status IOCB after this happens).
2002-04-11 02:32:03 +00:00
martin f12d3f51e7 Remove some redundant tries to disable interupts. We already avoided enabling
them.
Fix a stupid typo when enabling/disabling interrupts: we clear pending
interrupts when enabling, not disbling isac interrupts.
2002-04-10 23:51:06 +00:00
ichiro 9d3869cb7c more description of Chips was added 2002-04-10 04:01:27 +00:00
bouyer 10b49b13b9 In wdc_exec_command(), for data commands, read the status register after
the data transfer. This is mandatory for data out commands (although none are
used for now), and not forbiddend for data in commands. Also record if we
did transfers any data.
May solve kern/16159 by making the probe more robust in face of fake identify.
2002-04-09 21:17:53 +00:00
chs 110d16d5ae add support for built-in NWay autonegotiation on 2114[23], Macronix
98713A, 98715, 98715A, 98725, and Lite-On 82C115.
2002-04-09 05:57:20 +00:00
martin 58502ab93e Combine sc_enabled and sc_dying into one field sc_intr_valid, they are used
for the same purpose (ignoring invalid interrupts).

For cards that are not able to stop all interrupts (or we don't know a way
to do that in software, at least) run the clearirq callback even when
ignoring an interrupt because we are not enabled. Otherwise the card would
stop interrupting.

Reserve a driver specific callout handle and an int value in the generic
isic_softc to allow card drivers to implement fancy blinkenlights.
2002-04-08 12:20:49 +00:00
isaki 485575c0fe Rewrite encode/decode algorithm completely.
It improves playing/recording quality greatly
and it was almost done by Yosuke Sugahara <penta@fuchu.or.jp>.
Thanks a lot!

Add support of slinear8, slinear16_le, slinear16_be.
2002-04-07 14:51:40 +00:00
martin 87b8f8f259 Remove leftover from my first, incomplete attempt to cope with detaching
pcmcia cards. Now that pcmcia attachements properly handle the activate
callback, this is no longer needed (and is suspect to cause completely
unrelated problems.)
2002-04-06 21:46:51 +00:00
mhitch d410426604 Interface byte counts are counted in ether_input() and ether_output(). Don't
count them when reading the NIC counters - it doubles the count.  Read the
NIC counters to prevent counter overflow interrupts, but don't add them to
the interface counters.  Don't bother reading the upper counts because they
are just latched when reading the totals.

Fixes final part of PR#11549.
2002-04-06 19:28:01 +00:00
thorpej 60e2bbd09a Add support for the "CPUSaver" receive interrupt mitigating microcode
on the following PRO/100 chips:

	* i82558 step A4
	* i82558 step B0
	* i82559 step A0
	* i82559S step A
	* i82550
	* i82550 step C

The interrupt delay is configurable on all microcodable chips.  The
maximum "bundle" size (packet count) is configurable on all but the
i82558.

The microcode is enabled by setting IFF_LINK0 on the interface.

Derived from code in FreeBSD.
2002-04-05 19:51:04 +00:00
bouyer e5727031fb Implement mstohz() as discussed on tech-kern, and use it in SCSI drivers
to convert xs->timeout to callout() parameter.
2002-04-05 18:27:45 +00:00
bouyer f6ef011e7e Properly identify LM81. From Sergey Svishchev in PR kern/13420. 2002-04-05 16:11:47 +00:00
thorpej f4f37ed5f5 Define the command block used for loading microcode into the chip. 2002-04-05 05:29:05 +00:00
mycroft cdb5a13a85 With certain 21140 and 21143 SROM formats, OPMODE_FD was never being set when
the interface was wired to full-duplex mode.  Duh.
Also, add OPMODE_TTM to OPMODE_MEDIA_BITS, to insure that it is changed when
we switch between 10 and 100.
2002-04-05 04:48:40 +00:00
uwe 6142b898f3 Clean up includes. 2002-04-05 03:29:05 +00:00
mjacob 83f4603dc7 Correct put of fc4_types to 32 bits, which is what it is. 2002-04-05 02:09:39 +00:00
ichiro 1fb4491ea4 Upps, fix typo 2002-04-05 00:59:38 +00:00
ichiro 7d1236beff fix minor bugs for lucent cards. (point out from Warner Losh) 2002-04-05 00:54:51 +00:00
mjacob c8513a96b0 Redo fabric evaluation to not use GET ALL NEXT (GA_NXT). Switches seem
to be trying to wriggle out of supporting this well. Instead, use
GID_FT to get a list of Port IDs and then use GPN_ID/GNN_ID to find the
port and node wwn. This should make working on fabrics a bit cleaner and
more stable.

This also caused some cleanup of SNS subcommand canonicalization so that
we can actually check for FS_ACC and FS_RJT, and if we get an FS_RJT,
print out the reason and explanation codes.

We'll keep the old GA_NXT method around if people want to uncomment a
controlling definition in ispvar.h.

This also had us clean up ISPASYNC_FABRICDEV to use a local lportdb argument
and to have the caller explicitly say that a device is at the end of the
fabric list.
2002-04-04 23:38:43 +00:00
thorpej 769ca97e2b Address Intel 82801BA/82801BAM Specification Update, Errata #30:
The ICH on-board Ethernet and some i82559 chips have a bug which
will cause a PCI protocol violation if the chip receives a CU_RESUME
command as it is entering the IDLE state by deasserting #CLKRUN.
(This is the so-called "resume bug" that we previously had an incomplete
work-around for on ICH chipsets.)

The work-around is to disable Dynamic Standby Mode, such that the
chip will never deasert #CLKRUN.  Dynamic Standby Mode is disabled
by clearing a bit in the EEPROM and updating the EEPROM (and EEPROM
checksum).

Unfortunately, the chip will only consult the EEPROM setting after
a PCI bus reset, so a system reboot is required once the EEPROM
has been updated (the EEPROM update only needs to happen once,
and the driver usses a warning instructing the user to reboot the
system once the work-around has been applied).

Issue pointed out by David Brownlee, and code more-or-less lifted
from FreeBSD.
2002-04-04 23:15:43 +00:00
thorpej 4a9f5c0fc7 Move the code which shifts bits into the EEPROM into its own function. 2002-04-04 21:11:16 +00:00
jdolecek 46d335a320 move wi_pci_reset() from ic/wi.c to pci/if_wi_pci.c, where is belongs 2002-04-04 17:43:31 +00:00
jdolecek e9ee3f796e fix sligh confusion on whether or not to supply dv_xname to printf() in
error cases of attach
Noticed in kern/16197 by George E Sollish.
2002-04-04 17:30:32 +00:00
hannken 747c45e3e4 Avoid dereferencing null pointer. `data->name == NULL' means default font. 2002-04-04 13:08:35 +00:00
ichiro ed93d4f3b5 space/TAB cosmetics 2002-04-04 07:15:17 +00:00
ichiro 7fadd48a2f using table driven for Prism2 family IDs/Names. 2002-04-04 07:06:16 +00:00
chs e340f273c4 add support for Cogent EM100 (aka Adaptec ANA-6910) TX and FX. 2002-04-04 05:45:54 +00:00
ichiro ff941b5271 s/WI_NIC_3842/WI_NIC_3842_EVA 2002-04-03 15:43:14 +00:00
ichiro a07b331747 add more IDs of PRISM family 2002-04-03 15:33:20 +00:00
isaki 677cd20c7f initialize codec variables every open(). 2002-04-02 15:22:37 +00:00
isaki fec379f5cd Correct ADPCM -> linear8 conversion routine.
Now, we can record on vs0 (but it's very noisy)
2002-04-02 15:19:00 +00:00
petrov 71419e9eb9 Return from interrupt handler after chip init(reset). 2002-04-02 09:48:27 +00:00
martin bf8b82a971 Move isic_intr_enable to a file not depending on the HSCX driver, so
ifpci-only configurations build again.

Remove the now unused controller enable function from the passive drivers
l2<->l1 interface.
2002-04-01 12:14:26 +00:00
martin 71b6502920 Do not bother to enable interrupts at attach time - we are going to disable
them again imediately
2002-04-01 12:12:26 +00:00
ichiro 2288447a2e add more IDs of PRISM family 2002-04-01 02:46:47 +00:00
bouyer bf5fb91f9c Fix typo in a comment. Reported by Alexander Yurchenko in private e-mail. 2002-03-31 19:47:39 +00:00
mjacob 9fff4c6833 Thanks to Jason Wright of OpenBSD- spotted that the offsets were all wrong
for bus_dmamap_sync calls. They'd been blindly ported from Solaris which
had *one* dma map for the entire control space, so offset was incremented
for the Request, Response and FC Scratch spaces. Tsk. There are three maps
in NetBSD. I should probably make them one anyway.
2002-03-31 17:56:54 +00:00
jdolecek 3679b97e61 add some bound checking
patch submitted by IWAMOTO Toshihiro in kern/13112
2002-03-31 10:44:44 +00:00
ichiro cf8b4530ef add more description of "Connection control characteristics" in Prism2 2002-03-31 06:09:37 +00:00
ichiro 42d7147fe3 typo fixed 2002-03-31 05:54:19 +00:00
ichiro 53f97402c6 Dont use magic number.
added parameter of WEP flags
2002-03-31 05:51:47 +00:00
ichiro 17a3f4351a delete incorrect register 2002-03-31 05:22:26 +00:00
ichiro 94e7948a7e add rx/tx status register 2002-03-31 05:12:55 +00:00
ichiro 5cebe8a050 mistake 2002-03-31 04:06:29 +00:00
ichiro d68d2ca3ec add more frame structure register 2002-03-31 03:36:15 +00:00
uwe 782296b588 First cut at framebuffer driver for Integraphics Systems IGA1682.
It's not finished yet, but it can do enough to get wscons working for
Krups JavaStation.
2002-03-30 19:48:55 +00:00
martin e5c92d53f8 Be a nice citizen, enable interrupts only when we are ready to talk
to the ISDN (i.e. when userland has /dev/isdn open).
2002-03-30 19:13:44 +00:00
martin ed4ba39c75 Add a command to layer 1 drivers to update LED state for controllers that
have status LEDs.
2002-03-30 17:54:17 +00:00
ichiro 7cd9648d72 added sc_pri_firmware_ver, and print Primary/Station firmware versions.
cosmetic change.
2002-03-30 16:44:59 +00:00
ichiro c05f3dd312 the kind of "firmware" was clarified.
firmware -> station firmware
2002-03-30 15:58:45 +00:00
ichiro 20417d89e0 add WI_RID_PRI_IDENTITY rid , (0xFD02)
Reflects the primary funcs firmware Identification number
2002-03-30 15:53:26 +00:00
tron 92ca7a2bc8 Apply changes provided by Thilo Manske in PR kern/16118:
1. Fix setting of nominal fan speeds with ENVSYS_STREINFO.
2. Treat Winbond 83781D specially because it has a programmable divisor for
   FAN3 unlike generic devices.
3. Set nominal RPMs.
4. Fix a typo in the code for setting FAN3's divisor for W83782 type
   hardware monitors.
2002-03-30 13:37:41 +00:00
martin e14f4779db Avoid duplicate expensive lookups by passing a pointer to the call
descriptor/a pointer to the layer 3 state directly to driver functions,
instead of their ID/index.
2002-03-30 11:15:41 +00:00
martin f5e2c967fc Split BRI attaching into two phases, so lower layer drivers can get their
BRI identifier and L3 driver state early on, then finish initializing and
announce the controller to userland when it's ready.
2002-03-29 20:29:53 +00:00
matt 8a30192c27 Correct a comment and cleanup slightly how the local ethernet is programmed
into the chip.
2002-03-29 00:00:10 +00:00
bouyer da0cf38ed5 In wdcintr(), it !WDCF_IRQ_WAIT, read the status register anyway to clear a
possible pending interrupt. This should avoid the interrupt loop described
in PR kern/15841.
It is safe to read status here, because if we're not waiting for an interrupt
we have no command pending, so the device should be idle.
2002-03-28 22:51:58 +00:00
onoe 45a8f0749c Fix to work Symbol firmware card, which cannot be initialized more than once.
Tested with 3Com 3CRWE737A and Intel Pro/Wireless 2011.
2002-03-27 08:01:22 +00:00
chs 150665fbb1 91C96 has the same chip ID as 91C94, list both in attach output. PR 11413. 2002-03-27 07:50:54 +00:00
martin ebd73ccd11 After Jason Thorpe explained to me how it is supposed to work, implement
(de)activate for pcmcia cards.
Implement detach/(de)activate for PCI cards.
Clean up internal state (free call-descriptors) if a controller is
detached while it has open connections.
2002-03-27 07:39:35 +00:00
chs 23825982c3 add support for SMC 9332DST. 2002-03-26 07:57:16 +00:00
chs 99b5d17961 move some prototypes from tulip.c to tulipvar.h so they can
be used by bus-specific code.
2002-03-26 07:41:40 +00:00
martin 0db68b667b Now that we have all pieces in place (and enough granularity to specify
B-channel and D-channel drivers separately) split the Fritz!PCI card
driver out of the isic driver.

The new device is called "ifpci" and uses the same D-channel driver as the
isic devices, but has it's own B-channel driver.
2002-03-25 16:39:52 +00:00
martin 909e313a80 Remove a leftover from the BRI registry at layer 2.
Initialize layer 2's idea of it's BRI id after attaching.
2002-03-25 14:44:46 +00:00
martin a994533d0a Make pcmcia cards detach properly.
Notify userland of attaching/detaching cards.
This partly fixes PR 15951.
2002-03-25 12:07:33 +00:00
dbj ea44522489 changes from Warner Losh to read firmware version for non prism2 cards 2002-03-25 09:10:54 +00:00
martin 8a2d9422bd Fix confusion about the return value from the internal MI probe routine.
Make the ISA probe actually (silently) fail if no card is found.

XXX - need to aquire the SBUS variant of this card some day or have
Jaromir find an MCA one.
2002-03-25 09:08:09 +00:00
martin 0bc69b6498 Now that we have all the pieces of the puzzle available start to unriddle
and move them in their proper places.

Move the BRI registry from layer 2 (duh!) to layer 4, so active cards
(which don't have layer 3 or layer 2 in their driver). Remove all remaining
hard coded controller and driver types. Remove any arbitrary hard coded
limits, at least those that show up in the internal API.

This fixes PR 15950.
2002-03-24 20:35:43 +00:00
jdolecek 9977ae0589 ncr53c9x_attach(): if sc_rev is NCR53C90_86C01, set it to ESP100 once
the variant name is printed.
This fixes a problem that the card would be treated as ESP100 in
ncr53c9x_reset(), but not on couple other places (pointed out by
Andy Doran in private e-mail).

g/c now redundant case entry in ncr53c9x_reset()
2002-03-24 17:16:19 +00:00
bjh21 cc685cb13e __arm26__ -> acorn26. This has the advantage of actually being defined. 2002-03-24 15:52:33 +00:00
bjh21 a90a7a1ab7 Mention the DS2401 Silicon Serial Number. 2002-03-24 15:51:45 +00:00
itohy 78b5427b7e Add wait-for-ready code between setting MCE and changing data format,
which is required by OPL3-SA2 (YMF711) chip.
Fixes PR kern/14819.
2002-03-23 23:40:32 +00:00
gmcgarry 4c3affa3f6 Remove FreeBSD RCSID. 2002-03-23 03:40:24 +00:00
martin 9cea4a0ab0 Bring the daic driver into the new ISDN world order.
Enable active card support in the ISDN subsystem. (Had been disabled since
it couldn't be tested before.)
2002-03-22 09:54:15 +00:00
mjacob d76d04685a Handle Port Unavailable the same as Port Logout (i.e., send a LIP).
Unconst pointer to f/w in the ispdv structure. Too many compilers get
unhappy over our walking the array. Make casts as appropriate so that
initialization in structure is still happy.

Limit length of fabric to 256. This will all go away soon.

Do a cleaner case of keeping multiple CPUs/threads from reading the
same response queue entries.
2002-03-22 02:34:05 +00:00
fredette d564a038af Fixed a possible overflow bug in the timeout calculation. 2002-03-22 00:15:21 +00:00
itohy a56d289043 I have Prism2 with 0.8.2 firmware, and have no problem
using WEP without promisc on the device.
2002-03-21 07:31:37 +00:00
thorpej 1a69060597 When getting the packet off the interface, make sure the payload is
aligned after the Ethernet header.

kern/15982, Hiroyuki Bessho <bsh@grotto.jp>
2002-03-20 17:42:23 +00:00
martin e2c42aeaa8 Remove all knowledge about specific application (layer 4) drivers from
the generic layer 4 and layer 3 management system.

This should make the layer 4 driver API LKM clean - finaly.

Make the Fritz!PCI driver work again after resent changes (oops!),
noted by Frank Kardel (PR 15948) and Matthias Scheeler.
2002-03-17 20:54:04 +00:00
atatat 31144d9976 Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command".  ERESTART is -1, which can lead to
confusion.  ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4.  No ioctl code should now return -1 anywhere.  The
ioctl() system call is now properly restartable.
2002-03-17 19:40:26 +00:00
martin 1e802e7eba Clean up the application (layer 4) driver vs. B channel driver interface.
One step further on the way to make layer 4 drivers LKMable.
2002-03-17 09:45:58 +00:00
dbj 28819987b7 don't set prism2 bit when WI_NIC_LUCENT is detected 2002-03-17 02:52:59 +00:00
chs 9846849435 in the TULIP_ROM_MB_21142_MII case of tlp_2114x_isv_tmsw_init(),
use "cp" instead of "ncp" as a temporary pointer into the SROM.
we still need the value of ncp here, it points to the next media block.
(update the copy of this code in tlp_21142_reset() just 'cause.)
this makes the BNC port on the Adaptec ANA-6911A work.
2002-03-16 17:38:35 +00:00
isaki 81b3e9fb81 Fix mis-increment bug in converter msm6258_ulinear8_to_adpcm().
This fix needs factor_denom.
2002-03-16 09:00:42 +00:00
martin f4be3308da Psssst, don't tell anybody I commited this.
Add an ugly hack, #ifdef WI_AT_BIGENDIAN_BUS_HACK, to make the wi driver
access the underlying bus in big endian byte order.

This makes it possible to use this driver (probably one of the most
interesting ones) in the pcmcia slot of a stp4020 (nell) adapter at sbus. The
sparc ports bus_space_{read,write}_* macros do not provide a way to do this
cleanly now as they ignore the bus_space_tag_t parameter.

XXX - make bus_space_{read,write}_* on sparc do the right thing.
2002-03-15 13:15:36 +00:00
tsutsui f54d57e135 Remove an arg name in prototype declaration. 2002-03-15 12:57:21 +00:00
chs 1ba402084f assume that 21143 SROM info blocks are in extended format (as the spec
requires), even if the bit to indicate this is not set.
this makes Phobos P430 4-port cards work.
2002-03-14 04:44:34 +00:00
ad 5d95c4499b Fix botch in previous. 2002-03-13 23:17:18 +00:00
ad b89e39b91a Reorganise the wsfont stuff slightly so that multiple display adapters
with different bit/byte order requirements can co-exist happily.
2002-03-13 15:05:13 +00:00
uwe a05702eaac Rework the driver to add EBus DMA support and improve APC DMA support.
Audio-related stuff is left almost intact.

* support audiocs at ebus playback and capture
    tested on krups and u5 (thanks, martin)
* make first attempt at supporting audiocs at sbus capture
* nb: full-duplex is not tested
* while here, fix CSAUDIO_MONITOR_MUTE to be of CSAUDIO_MONITOR_CLASS
    i.e. outputs.monitor.mute -> monitor.monitor.mute

Ok by pk, eeh.
2002-03-12 04:48:28 +00:00
ichiro 8596bfd754 fix 128bit WEP work with Prism2 Card.
from FreeBSD
2002-03-10 14:43:38 +00:00
itohy d5f39a2d9c Add explicit support of OPL3-SA2 (YMF711).
Not well tested....
2002-03-10 13:57:10 +00:00
augustss c93a7a4d14 Add a nic I don't really know much about, but it's used on my D-Link card. 2002-03-10 00:16:47 +00:00
thorpej a180cee23b Pool deals fairly well with physical memory shortage, but it doesn't
deal with shortages of the VM maps where the backing pages are mapped
(usually kmem_map).  Try to deal with this:

* Group all information about the backend allocator for a pool in a
  separate structure.  The pool references this structure, rather than
  the individual fields.
* Change the pool_init() API accordingly, and adjust all callers.
* Link all pools using the same backend allocator on a list.
* The backend allocator is responsible for waiting for physical memory
  to become available, but will still fail if it cannot callocate KVA
  space for the pages.  If this happens, carefully drain all pools using
  the same backend allocator, so that some KVA space can be freed.
* Change pool_reclaim() to indicate if it actually succeeded in freeing
  some pages, and use that information to make draining easier and more
  efficient.
* Get rid of PR_URGENT.  There was only one use of it, and it could be
  dealt with by the caller.

From art@openbsd.org.
2002-03-08 20:48:27 +00:00
mjacob 1d228ae84c Disable RIO (reduced interrupt operation) for 2200 boards- it seemed like
it worked- but I ran into a case with a 2204 where commands were being lost
right and left. Best be safe.

For target mode, or things called if we call isp_handle_other response- note
that we might have dropped locks by changing the output pointer so we bail
from the loop. It's the responsibility of the entity dropping the lock to
make sure that we let the f/w know we've read thus far into the response
queue (else we begin processing the same entries again- blech!).
2002-03-07 00:14:04 +00:00
dbj 5c7e9abe49 return EINPROGRESS instead of EINVAL when trying to read
the results of an AP scan that is not finished
2002-03-06 14:41:39 +00:00
itohy 1990961dc9 Fix ADPCM playback/recording. 2002-03-06 07:12:02 +00:00
itojun ac36f7cb2c bring in latest ALTQ from kjc. ALTQify some of the drivers. 2002-03-05 04:12:57 +00:00
simonb 64c7743a05 Don't "extern int cold;" - this is in <sys/kernel.h>. 2002-03-04 02:19:07 +00:00
dbj 47b3797fe7 Don't attempt to gather unrequested statistics.
Allow SIOCSWAVELAN with WI_RID_IFACE_STATS to request
an immediate statistics update.

We might in the future want to have SIOCGWAVELAN with
WI_RID_IFACE_STATS return an error if a statistics gathering is in
progress.  Then the caller could request fresh statistics and gather
them when they are done.  Instead, we currently just return whatever
statistics are available, which may be up to 60 seconds old.
2002-03-04 01:56:12 +00:00
dbj e9d22f79b0 fix byte swapping when gathering statistics
this should complete the fix to pr 14385
AP scanning and statistic gathering should work on le hosts now
2002-03-04 01:33:17 +00:00
dbj 918b9d4dec correctly handle AP scanning result when there are no APs 2002-03-04 01:30:04 +00:00
dbj 0dca7b4f6d used %02x instead of %x when printing out BSS ids 2002-03-04 01:21:07 +00:00
dbj 0812667818 s/Faild/Failed/ 2002-03-04 01:19:24 +00:00
bouyer 5d5c5c0ddd As siop_morecbd() is called from the kernel thread, protect access to the
queues with splbio.
2002-03-01 21:37:03 +00:00
dbj 2622b21584 use #ifdef WI_DEBUG instead of #if WI_DEBUG 2002-02-26 09:29:18 +00:00
dbj 44ab750650 avoid walking full length of unknown stats structure.
this partially addresses pr14385.
there is still a byte swapping bug retrieving the
stats structure.  Since both the type and the length
are incorrectly swapped, we would timeout while reading
an extra long section (caused by the byteswapped length)
of garbage data.
turning on WI_DEBUG now just reports the unknown info type
which can be seen to be obviously incorrectly swapped
on macppc
2002-02-26 09:18:54 +00:00