Commit Graph

23881 Commits

Author SHA1 Message Date
Eitan Adler
edfaa73726 Add additional Perle Speed LE serial cards
PR:		kern/168816
Submitted by:	Dennis Oyama <doyama@perle.com>
Approved by:	cperciva
MFC after:	1 week
2012-08-05 08:10:02 +00:00
Eitan Adler
2bd29f8f66 Remove variables which are initialized but never used thereafter
reported by gcc46 warning

Reviewed by:	scottl
Approved by:	cperciva
MFC after:	1 week
2012-08-05 08:08:34 +00:00
Konstantin Belousov
2ddfc13d8d Remove verbose unused commented out debugging printf.
MFC after:	1 week
Reviewed by:	alc
2012-08-04 18:10:04 +00:00
Gavin Atkinson
b5ba3bdb25 Support multiple interface devices. The driver had previously hardcoded
support for only the first port, but the CP2105 can have multiple ports.
Although this allowed the first port to mostly work on multi port devices,
there could be issues with this arrangement.

Update the man page to reflect support for both ports and the CP2105.

Many thanks to Silicon Labs (www.silabs.com) for providing a CP2105-EK
dev board for testing.

MFC after:	2 weeks
2012-08-04 15:11:36 +00:00
Matt Jacob
2468ec31b3 Add detach logic to SBus variant.
Obtained from:	Marius
MFC after:	1 month
2012-08-04 00:00:30 +00:00
Matt Jacob
de0627d021 Oops. We only do allocate room for extended commands
and responses for 2300 cards are newer.

Sponsored by:	Spectralogic
Noticed by:	Our Friend Manfred
MFC after:	1 month
X-MFC: 238869
2012-08-03 14:25:35 +00:00
Xin LI
0f3fae6159 Correct a typo.
Reported by:	Sascha Wildner <swildner dragonflybsd org>
Reviewed by:	scottl
MFC after:	3 days
2012-08-03 00:11:13 +00:00
Adrian Chadd
a6e829596d Fix an issue that crept in with the previous descriptor tidyup.
When forming aggregates, the last descriptor was now not being
correctly setup - instead, the "setuplasttxdesc" call was being
handed the first descriptor in the last subframe, rather than the
last descriptor in the last subframe.

This showed up as "bad series0 hwrate" messages, as the final
descriptor just didn't have any of the rate control information
squirreled away.

Tested:
	* AR9280 STA -> 11n AP, iperf TCP
2012-08-02 20:14:45 +00:00
Jaakko Heinonen
8cb51643e4 Disallow sectorsize larger than MAXPHYS and mediasize smaller than
sectorsize.

PR:		169947
Submitted by:	Filip Palian (original version)
Reviewed by:	kib
2012-08-02 15:05:34 +00:00
Luigi Rizzo
b3d5301688 fix some signed/unsigned warnings in the netmap code.
Unfortunately the original drivers still have a lot of
sign conversion/comparison warnings.
2012-08-02 11:59:43 +00:00
Luigi Rizzo
42a3a5bd91 Add a newline on an error message;
rename linux functions to avoid confusion;
fix error reporting on linux
2012-08-02 07:35:40 +00:00
Sean Bruno
8844c80848 CPU_NEXT() already handles wrapping around to the beginning. Also, in a
system with sparse CPU IDs, you can have a valid CPU ID > mp_ncpus (e.g. if
you have two CPUs 0 and 4, with mp_maxid == 4 and mp_ncpus == 2).

Introduced at svn r235210

Submitted by:	jhb@
Reviewed by:	jfv@
2012-08-02 00:00:34 +00:00
Alexander Motin
61c49b4dd1 Several fixes to allow firmware/BIOS flash access from user-level:
- remove special handling of zero length transfers in mpi_pre_fw_upload();
 - add missing MPS_CM_FLAGS_DATAIN flag in mpi_pre_fw_upload();
 - move mps_user_setup_request() call into proper place;
 - increase user command timeout from 30 to 60 seconds;
 - avoid NULL dereference panic in case of firmware crash.
Set max DMA segment size to 24bit, as MPI SGE supports it.
Use mps_add_dmaseg() to add empty SGE instead of custom code.
Tune endianness safety.

Reviewed by:	Desai, Kashyap <Kashyap.Desai@lsi.com>
Sponsored by:	iXsystems, Inc.
2012-08-01 17:31:31 +00:00
Alexander Motin
1914fdecbe Fix kernel panic on camcontrol reset for specific target, caused by
uninitialized cm_targ in mpssas_action_resetdev().

Reviewed by:	Desai, Kashyap <Kashyap.Desai@lsi.com>
Sponsored by:	iXsystems, Inc.
MFC after:	3 days
2012-08-01 12:24:13 +00:00
Warner Losh
cc90639873 Add the chip select glue. 2012-08-01 01:18:36 +00:00
Adrian Chadd
9f579ef85d Fix a case of "mis-located braces".
PR:		kern/170302
2012-08-01 00:18:02 +00:00
Adrian Chadd
af01710118 Allow 802.11n hardware to support multi-rate retry when RTS/CTS is
enabled.

The legacy (pre-802.11n) hardware doesn't support this - although
the AR5212 era hardware supports MRR, it doesn't have all the bits
needed to support MRR + RTS/CTS.  The AR5416 and later support
a packet duration and RTS/CTS flags per rate scenario, so we should
support it.

Tested:

* AR9280, STA

PR:		kern/170302
2012-07-31 23:54:15 +00:00
Adrian Chadd
b0fa0cba65 Restore the PCI bridge configuration upon resume.
This allows my TI1510 cardbus/PCI bridge to work after a suspend/resume,
without having to unload/reload the cbb driver.

I've also tested this on stable/9.  I'll MFC it shortly.

PR:		kern/170058
Reviewed by:	jhb
MFC after:	1 day
2012-07-31 18:47:17 +00:00
Jack F Vogel
b4750260cd Clean up some unused leftover code from em
Make IRQ style a tuneable
Fix lock handling in the interrupt handler

MFC after:3 days
2012-07-31 18:44:10 +00:00
Adrian Chadd
8c08c07ac4 Shuffle the call to ath_hal_setuplasttxdesc() to _after_ the rate control
code is called and remove it from ath_buf_set_rate().

For the legacy (non-11n API) TX routines, ath_hal_filltxdesc() takes care
of setting up the intermediary and final descriptors right, complete
with copying the rate control info into the final descriptor so the
rate modules can grab it.

The 11n version doesn't do this - ath_hal_chaintxdesc() doesn't
copy the rate control bits over, nor does it clear isaggr/moreaggr/
pad delimiters.  So the call to setuplasttxdesc() is needed here.

So:

* legacy NICs - never call the 11n rate control stuff, so filltxdesc
  copies the rate control info right;
* 11n NICs transmitting legacy or 11n non-aggregate frames -
  ath_hal_set11nratescenario() is called to setup rate control and
  then ath_hal_filltxdesc() chains them together - so the rate control
  info is right;
* 11n aggregate frames - set11nratescenario() is called, then
  ath_hal_chaintxdesc() is called to chain a list of aggregate and subframes
  together. This requires a call to ath_hal_setuplasttxdesc() to complete
  things.

Tested:

* AR9280 in station mode

TODO:

* I really should make sure that the descriptor contents get blanked
  out correctly or garbage left over from aggregate frames may show
  up in non-aggregate frames, leading to badness.
2012-07-31 17:08:29 +00:00
Adrian Chadd
d34a73472a Push the rate control and descriptor chaining into the descriptor "set"
functions, for both legacy and 802.11n.

This will simplify supporting the EDMA chipsets as these two descriptor
setup functions can just be overridden in their entirety, hiding all of
the subtle differences in setting things up.

It's not a permanent solution, as eventually the AR5416 HAL should grow
similar versions of the 11n descriptor functions and then those can be
used.

TODO:

* Push the "clr11naggr" call into the legacy setds, just to ensure
  that retried frames don't end up with the aggregate bits set
  inappropriately;
* Remove the "setlasttxdesc" call from the 11n TX path and push it
  into setds_11n.
* Ensure that setds_11n will work correctly for non-aggregate frames;
* .. and then when it does, just unconditionally call "setds_11n" for
  11n NICs and "setds" for non-11n NICs.
2012-07-31 16:41:09 +00:00
Alexander Motin
3c5c555957 Add several performance optimizations to acpi_cpu_idle().
For C1 and C2 states use cpu_ticks() to measure sleep time instead of much
slower ACPI timer. We can't do it for C3, as TSC may stop there. But it is
less important there as wake up latency is high any way.

For C1 and C2 states do not check/clear bus mastering activity status, as
it is important only for C3. As side effect it can make CPU enter C2 instead
of C3 if last BM activity was two sleeps back (unlike one before), but
that may be even good because of collecting more statistics. Premature BM
wakeup from C3, entered because of overestimation, can easily be worse then
entering C2 from both performance and power consumption points of view.

Together on dual Xeon E5645 system on sequential 512 bytes read test this
change makes cpu_idle_acpi() as fast as simplest cpu_idle_hlt() and only
few percents slower then cpu_idle_mwait(), while deeper states are still
actively used during idle periods.

To help with diagnostics, add C-state type into dev.cpu.X.cx_supported.

Sponsored by:	iXsystems, Inc.
2012-07-31 10:58:50 +00:00
Monthadar Al Jaberi
a574db0838 Fix wtap to not panic in wtap_beacon_intrp.
* Changed KASSERT to be debug printf (DWTAP_PRINTF). If state is not
IEEE80211_S_RUN we return without scheduling a new callout;
* When net80211 stack changes state to IEEE802_11_INIT we stop the
beacon callout task;
2012-07-31 07:22:50 +00:00
Luigi Rizzo
d198a63d44 remove a redundant MALLOC_DECLARE 2012-07-31 05:51:48 +00:00
Max Khon
51cb024f1f - Change back "d_ofs" to int8_t to not pessimize padding and size of "struct puc_cfg".
- Use "puc_config_moxa" for Moxa boards that need d_ofs greater than 0x7f

Prodded by:	marcel@, gavin@
MFC after:	3 days
2012-07-31 05:23:23 +00:00
Adrian Chadd
f8418db57e Migrate some more TX side setup routines to be methods. 2012-07-31 03:09:48 +00:00
Adrian Chadd
746bab5b7f Break out the hardware handoff and TX DMA restart code into methods.
These (and a few others) will differ based on the underlying DMA
implementation.

For the EDMA NICs, simply stub them out in a fashion which will let
me focus on implementing the necessary descriptor API changes.
2012-07-31 02:28:32 +00:00
Adrian Chadd
3ba9052674 Placeholder ioctl for an upcoming rate control statistics API change. 2012-07-31 02:18:10 +00:00
Luigi Rizzo
0b8ed8e069 - move the inclusion of netmap headers to the common part of the code;
- more portable annotations for unused arguments;
2012-07-30 18:21:48 +00:00
Gleb Smirnoff
ba32fa9394 Return back double spacing. 2012-07-30 08:56:56 +00:00
Matt Jacob
767a02fb40 Grr.!$()!$$ I missed checking this in even though I *did* run
a tinderbox myself and caught the error.

Change to isp_send_cmd needs a final ecmd argument.

Sponsored by: Spectralogic
MFC after:	1 month
X-MFC: 238869
2012-07-29 14:21:42 +00:00
Adrian Chadd
0f4a46b376 Shuffle the rate control call to be consistent with non-aggregate TX.
The correct ordering for non-aggregate TX is:

* call ath_hal_setuptxdesc() to setup the first TX descriptor complete
  with the first TX rate/try count;
* call ath_hal_setupxtxdesc() to setup the multi-rate retry;
* .. or for 802.11n NICs, call ath_hal_set11nratescenario() for MRR and
  802.11n flags;
* then call ath_hal_filltxdesc() to setup intermediary descriptors
  in a multi-descriptor single frame.

The call to ath_hal_filltxdesc() routines seem to correctly (consistently?)
handle the intermediary descriptor flags, including copying the rate
control information to the final descriptor in the frame.  That's used
by the rate control module rather than the hardware.

Tested:

* Only on AR9280 STA mode, however it should work on other chips in
  both STA and AP mode.
2012-07-29 09:23:32 +00:00
Adrian Chadd
7ef7f613c2 Fix breakage introduced in r238824 - correctly calculate the descriptor
wrapping.

The previous code was only wrapping descriptor "block" boundaries rather
than individual descriptors.  It sounds equivalent but it isn't.

r238824 changed the descriptor allocation to enforce that an individual
descriptor doesn't wrap a 4KiB boundary rather than the whole block
of descriptors.  Eg, for TX descriptors, they're allocated in blocks
of 10 descriptors for each ath_buf (for scatter/gather DMA.)
2012-07-29 08:52:32 +00:00
Hiroki Sato
f3eaf5eb01 Add support for 88E1116R.
Sponsored by:	Plat'Home, Co.,Ltd.
2012-07-28 21:59:12 +00:00
Hiroki Sato
c8953e1273 Add support for Marvell 88F6282.
Sponsored by:	Plat'Home, Co.,Ltd.
2012-07-28 21:56:24 +00:00
Matt Jacob
387d8239fb -----------
MISC CHANGES

Add a new async event- ISP_TARGET_NOTIFY_ACK, that will guarantee
eventual delivery of a NOTIFY ACK. This is tons better than just
ignoring the return from isp_notify_ack and hoping for the best.

Clean up the lower level lun enable code to be a bit more sensible.

Fix a botch in isp_endcmd which was messing up the sense data.

Fix notify ack for SRR to use a sensible error code in the case
of a reject.

Clean up and make clear what kind of firmware we've loaded and
what capabilities it has.
-----------
FULL (252 byte) SENSE DATA

In CTIOs for the ISP, there's only a limimted amount of space
to load SENSE DATA for associated CHECK CONDITIONS (24 or 26
bytes). This makes it difficult to send full SENSE DATA that can
be up to 252 bytes.

Implement MODE 2 responses which have us build the FCP Response
in system memory which the ISP will put onto the wire directly.

On the initiator side, the same problem occurs in that a command
status response only has a limited amount of space for SENSE DATA.
This data is supplemented by status continuation responses that
the ISP pushes onto the response queue after the status response.
We now pull them all together so that full sense data can be
returned to the periph driver.

This is supported on 23XX, 24XX and 25XX cards.

This is also preparation for doing >16 byte CDBs.

-----------
FC TAPE

Implement full FC-TAPE on both initiator and target mode side.  This
capability is driven by firmware loaded, board type, board NVRAM
settings, or hint configuration options to enable or disable. This
is supported for 23XX, 24XX and 25XX cards.

On the initiator side, we pretty much just have to generate a command
reference number for each command we send out. This is FCP-4 compliant
in that we do this per ITL nexus to generate the allowed 1 thru 255
CRN.

In order to support the target side of FC-TAPE, we now pay attention
to more of the PRLI word 3 parameters which will tell us whether
an initiator wants confirmed responses. While we're at it, we'll
pay attention to the initiator view too and report it.

On sending back CTIOs, we will notice whether the initiator wants
confirmed responses and we'll set up flags to do so.

If a response or data frame is lost the initiator sends us an SRR
(Sequence Retransmit Request) ELS which shows up as an SRR notify
and all outstanding CTIOs are nuked with SRR Received status. The
SRR notify contains the offset that the initiator wants us to restart
the data transfer from or to retransmit the response frame.

If the ISP driver still has the CCB around for which the data segment
or response applies, it will retransmit.

However, we typically don't know about a lost data frame until we
send the FCP Response and the initiator totes up counters for data
moved and notices missing segments. In this case we've already
completed the data CCBs already and sent themn back up to the periph
driver.  Because there's no really clean mechanism yet in CAM to
handle this, a hack has been put into place to complete the CTIO
CCB with the CAM_MESSAGE_RECV status which will have a MODIFY DATA
POINTER extended message in it. The internal ISP target groks this
and ctl(8) will be modified to deal with this as well.

At any rate, the data is retransmitted and an an FCP response is
sent. The whole point here is to successfully complete a command
so that you don't have to depend on ULP (SCSI) to have to recover,
which in the case of tape is not really possible (hence the name
FC-TAPE).

Sponsored by: Spectralogic
MFC after:	1 month
2012-07-28 20:06:29 +00:00
Adrian Chadd
ee3e4df90c Flesh out the multi-rate retry capability.
The existing method for testing for MRR is to call the "SetupXTXDesc"
HAL method and see if it returns AH_TRUE or AH_FALSE.  This capability
explicitly lists what number of multi-rate attempts are possible.

"1" means "one rate attempt supported".
2012-07-28 07:28:08 +00:00
Adrian Chadd
8443512a77 Commit missing #define from a previous check-in.
The AR9300 and later have an 8-deep TX FIFO for each hardware queue.
2012-07-28 07:25:00 +00:00
Adrian Chadd
79607afe3e Flesh out the initial TX FIFO storage for each hardware TX queue. 2012-07-28 04:42:05 +00:00
Adrian Chadd
4bf404ea10 Add a missing call to ath_txdma_teardown(). 2012-07-28 04:40:52 +00:00
Warner Losh
6020cc464d Make this compile again. Also note that it is AT91RM9200+KB9202B
specific still and needs some love to make it work on anything else.
2012-07-27 17:28:11 +00:00
Adrian Chadd
2f22eb1c0d Tidy up the TX status fields a little and add a couple new flags.
* shuffle things around so things fall on natural padding boundaries;
* add a couple of new flags to specify LDPC and whether to switch to the
  low power RX chain configuration after this TX has completed.

Obtained from:	Qualcomm Atheros
2012-07-27 12:08:49 +00:00
Adrian Chadd
ea75088478 Add STBC TX support for AR5416 HAL chips.
Specifically, however:

* AR9280 and later support 1-stream STBC RX;
* AR9280 and AR9287 support 1-stream STBC TX.

The STBC support isn't announced (yet) via net80211 and it isn't at all
chosen by the rate control code, so there's no real consumer of this
yet.

Obtained from:	Qualcomm Atheros
2012-07-27 11:54:05 +00:00
Adrian Chadd
9eba6394bd Add a STBC TX flag.
Obtained from:	Qualcomm Atheros
2012-07-27 11:45:57 +00:00
Adrian Chadd
8a17bf6787 Add some comments about what the two fields mean. 2012-07-27 11:44:48 +00:00
Adrian Chadd
3e647f1cb4 Introduce a couple more fields in the rate scenario setup as part of
(future) TPC support in the AR9300 HAL.

This is effectively a no-op for the moment as (a) TPC isn't really
supported, (b) the AR9300 HAL isn't yet public, and (c) the existing
HAL code doesn't use these fields.

Obtained from:	Qualcomm Atheros
2012-07-27 11:43:10 +00:00
Adrian Chadd
26463136ac Bring this API in line with what the reference driver and Linux ath9k
was doing.

Obtained from:	Qualcomm Atheros, Linux ath9k
2012-07-27 11:23:24 +00:00
Luigi Rizzo
01c7d25ff4 use __builtin_prefetch() for prefetch.
merge in the remaining part of the linux-specific glue so i do not need
to maintain two different distributions.
2012-07-27 10:52:21 +00:00
Adrian Chadd
ba3fd9d86a Allocate a descriptor ring for EDMA TX completion status.
Configure the hardware with said ring physical address and size.
2012-07-27 10:41:54 +00:00
Adrian Chadd
9ed9f02b67 Modify ath_descdma_cleanup() to handle ath_descdma instances with no
buffers.

ath_descdma is now being used for things other than the classical
combination of ath_buf + ath_desc allocations.  In this particular case,
don't try to free and blank out the ath_buf list if it's not passed in.
2012-07-27 10:38:17 +00:00