Commit Graph

25854 Commits

Author SHA1 Message Date
Adrian Chadd
d3731e4b21 Revert a previous commit - this is causing hardware errors.
I'm not sure why this is failing.  The holding descriptor should be being
re-read when starting DMA of the next frame.  Obviously something here
isn't totally correct.

I'll review the TX queue handling and see if I can figure out why this
is failing.  I'll then re-revert this patch out and use the holding
descriptor again.
2013-05-08 07:30:33 +00:00
Adrian Chadd
2c47932c88 Implement STBC receive frame statistics.
The AR9280 and later can receive STBC.  This adds some statistics
tracking to count these frames.

A patch to athstats will be forthcoming.
2013-05-08 01:11:25 +00:00
David C Somayajulu
088fc97186 1. Updated Copyright Information
2. Added Flash Read/Update Support
3. Fixed TSO Handling

Submitted by: David C Somayajulu (davidcs@freebsd.org)
Reviewed by: George Neville-Neil (gnn@freebsd.org)
Approved by: George Neville-Neil (gnn@freebsd.org)
2013-05-07 22:58:42 +00:00
Adrian Chadd
7dcb2bea01 Re-work how transmit buffer limits are enforced - partly to fix the PR,
but partly to just tidy up things.

The problem here - there are too many TX buffers in the queue! By the
time one needs to transmit an EAPOL frame (for this PR, it's the response
to the group rekey notification from the AP) there are no ath_buf entries
free and the EAPOL frame doesn't go out.

Now, the problem!

* Enforcing the TX buffer limitation _before_ we dequeue the frame?
  Bad idea. Because..
* .. it means I can't check whether the mbuf has M_EAPOL set.

The solution(s):

* De-queue the frame first
* Don't bother doing the TX buffer minimum free check until after
  we know whether it's an EAPOL frame or not.
* If it's an EAPOL frame, allocate the buffer from the mgmt pool
  rather than the default pool.

Whilst I'm here:

* Add a tweak to limit how many buffers a single node can acquire.
* Don't enforce that for EAPOL frames.
* .. set that to default to 1/4 of the available buffers, or 32,
  whichever is more sane.

This doesn't fix issues due to a sleeping node or a very poor performing
node; but this doesn't make it worse.

Tested:

* AR5416 STA, TX'ing 100+ mbit UDP to an AP, but only 50mbit being received
  (thus the TX queue fills up.)
* .. with CCMP / WPA2 encryption configured
* .. and the group rekey time set to 10 seconds, just to elicit the
  behaviour very quickly.

PR:		kern/138379
2013-05-07 07:52:18 +00:00
Adrian Chadd
55cf0326a1 Simplify this bit of code! 2013-05-07 07:44:07 +00:00
Hiren Panchasara
c2553fb9b8 Fixing a clang warning about using uninitialized variable.
PR: 176712
Suggested by:	jhb
Approved by:	sbruno (mentor)
2013-05-06 21:57:44 +00:00
Grzegorz Bernacki
99eef68204 Move initialization of CESA decoding windows from common section
to driver specific files.

- window initialization is done during device attach
- CESA TDMA decoding windows values are set based on DTS,
 not copied from CPU registers
- remove unnecessary virtual mapping
- update dts file

Obtained from: Semihalf
2013-05-06 13:34:36 +00:00
Alexander Motin
6691312c46 Some fixes to snd_envy24ht(4) driver:
- Allow DMA addresses anywhere in the lower 4GB; Envy24HT has a 32-bit DMA
engine, not 28-bit like Envy24.
 - Mark interrupt handler as MPSAFE, seems to be correctly synchronized.

PR:		kern/152378
Submitted by:	Jason Harmening <jason.harmening@gmail.com>
MFC after:	1 month
2013-05-05 19:09:34 +00:00
Adrian Chadd
4136c09143 The holding buffer logic needs to be used for _all_ transmission, not
just "when the queue is busy."

After talking with the MAC team, it turns out that the linked list
implementation sometimes will not accept a TxDP update and will
instead re-read the link pointer.  So even if the hardware has
finished transmitting a chain and has hit EOL/VEOL, it may still
re-read the link pointer to begin transmitting again.

So, always set ATH_BUF_BUSY on the last buffer in the chain (to
mark the last descriptor as the holding descriptor) and never
blank the axq_link pointer.

Tested:

* AR5416, STA mode

TODO:

* much more thorough testing with the pre-11n NICs, just to verify
  that they behave the same way.
* test TDMA on the 11n and non-11n hardware.
2013-05-04 04:03:50 +00:00
Navdeep Parhar
959cbee5b0 cxgbe: Switch to a better way to install firmware.
MFC after:	1 week
2013-05-03 20:09:17 +00:00
Navdeep Parhar
688dba74a5 cxgbe/tom: Do not use M_PROTO1 to mark rx zero-copy mbufs as special.
All the M_PROTOn flags are clobbered when an mbuf is appended to the
socket buffer.

MFC after:	1 week
2013-05-03 18:37:50 +00:00
Hans Petter Selasky
6c21893360 Fix compile warning. 2013-05-03 13:33:36 +00:00
Hans Petter Selasky
2c79a775ed - Add more defines to limit USB memory usage and number of allocations
in reduced memory systems.

- Split allocation and freeing of the configuration descriptor into a separate
function, so that the configuration descriptor can be made fixed size
to save memory allocations. This applies for both device and host mode.
2013-05-03 11:10:04 +00:00
Steven Hartland
5d0b98f2c3 Fix uninitialized warning in mps
Reviewed by:	pjd (mentor)
Approved by:	pjd (mentor)
MFC after:	2 weeks
2013-05-03 10:37:59 +00:00
Hans Petter Selasky
6a4dd49e2c Always put space before the comma before ##__VA_ARGS__ due to subtle compiler
differences.
2013-05-03 10:13:29 +00:00
Hans Petter Selasky
5b0752bbc1 Add some defines to limit USB memory usage in reduced memory systems. 2013-05-03 09:23:06 +00:00
Hans Petter Selasky
fa49bce566 Allow the default USB template to be specified at compile time. 2013-05-03 08:19:09 +00:00
Hans Petter Selasky
c77a24c24a Add new USB API to get the port path of a USB device.
MFC after:	2 weeks
Requested by:	emaste @
2013-05-03 07:44:58 +00:00
Alexander Motin
943a5fa82e Add IDs for HighPoint RocketRAID 640L/642L/644L -- new series of 4-port
6Gbps PCIe 2.0 x2 SATA controllers, based on Marvell 88SE9235 chips.

MFC after:	1 week
2013-05-02 16:09:06 +00:00
Luigi Rizzo
654ae8d68c remove trailing whitespace 2013-05-02 16:01:04 +00:00
Davide Italiano
31d7f0b7b0 Suppress a GCC warning. This warning is actually bogus and newer GCC
versions than the one in base (dim@ mentioned he tried on 4.7.3 and 4.8.1)
do not whine about it, so, at some point this workaround will be reverted.

Reported by:	ache
Discussed with:	dim
2013-05-02 14:55:21 +00:00
Eitan Adler
f7efb9e28e Update Intel email address.
PR:		docs/175349
Submitted by:	Lars Eggert <lars@netapp.com>
Discussed with:	jfv
2013-05-02 01:36:52 +00:00
Adrian Chadd
2f544eedb3 Add device identification and probe/attach support for the QCA9565.
The QCA9565 is a 1x1 2.4GHz 11n chip with integrated on-chip bluetooth.
The AR9300 HAL already has support for this chip; it just wasn't
included in the probe/attach path.

Tested:

* This commit brought to you over a QCA9565 wifi connection from
  FreeBSD.
* .. ie, basic STA, pings, no iperf or antenna diversity checking just yet.
2013-05-02 00:59:39 +00:00
Eitan Adler
6e8e89a189 Remove ancient compatibility cruft.
Reviewed by:	delphij
2013-04-30 23:36:48 +00:00
Eitan Adler
772de24511 Add missing braces
Reviewed by:	swildner@dragonflybsd.org
Reviewed by:	delphij
2013-04-30 23:36:45 +00:00
Navdeep Parhar
88c4ff7bf1 Fix DDP breakage introduced in r248925. Bitwise OR has higher
precedence than ternary conditional.

MFC after:	1 week
2013-04-30 19:57:21 +00:00
Brooks Davis
c88b210b20 MFP4 change 222060:
On Intel devices, put the Factory PPR in kenv.  On some FPGA boards it may
be the only software accessable unique ID.

Sponsored by:	DARPA, AFRL
2013-04-30 18:48:11 +00:00
Brooks Davis
b3caab66ad MFP4 changes 222065 and 222068:
Add a simplebus attachment for cfi(4)'s FDT support and move
cfi_bus_fdt.c to sys/conf/files so non-ppc architectures are supported.

Sponsored by:	DARPA, AFRL
2013-04-30 18:33:29 +00:00
Brooks Davis
d8f45cbfe8 Partial MFC of change 228122:
Due to the requirement that tty prefixes be unique per driver, rename
the Altera JTAG UART devices to ttyj#.

Sponsored by:	DARPA, AFRL
2013-04-30 18:29:05 +00:00
Luigi Rizzo
9b2e4517d5 use netmap_rx_irq() and netmap_tx_irq() instead of replicating the
logic in the individual driver.
2013-04-30 16:51:58 +00:00
Luigi Rizzo
d61ba75247 use netmap_rx_irq() / netmap_tx_irq() to handle interrupts in
netmap mode, removing the logic from individual drivers.

(note: if_lem.c not updated yet due to some other pending modifications)
2013-04-30 16:18:29 +00:00
Luigi Rizzo
849bec0e76 Partial cleanup in preparation for upcoming changes:
- netmap_rx_irq()/netmap_tx_irq() can now be called by FreeBSD drivers
  hiding the logic for handling NIC interrupts in netmap mode.
  This also simplifies the case of NICs attached to VALE switches.
     Individual drivers will be updated with separate commits.

- use the same refcount() API for FreeBSD and linux

- plus some comments, typos and formatting fixes

Portions contributed by Michio Honda
2013-04-30 16:08:34 +00:00
Davide Italiano
c0c97b9962 malloc(9) cannot return NULL if M_WAITOK flag is specified. 2013-04-30 15:59:22 +00:00
Davide Italiano
38179e6e76 The Intel PMC architectural events have encodings which are identical to
those of some non-architectural core events. This is not a problem in the
general case as long as there's an 1:1 mapping between the two, but there
are few exceptions. For example, 3CH_01H on Nehalem/Westmere represents
both unhalted-reference-cycles and CPU_CLK_UNHALTED.REF_P.
CPU_CLK_UNHALTED.REF_P on the aforementioned architectures does not measure
reference (i.e. bus) but TSC, so there's the need to disambiguate.
In order to avoid the namespace collision rename all the architectural
events in a way they cannot be ambigous and refactor the architectural
events handling function to reflect this change.
While here, per Jim Harris request, rename
iap_architectural_event_is_unsupported() to iap_event_is_architectural().

Discussed with:	jimharris
Reviewed by:	jimharris, gnn
2013-04-30 15:31:45 +00:00
Davide Italiano
1c12d03f5e Complete r250097:
Do not change the initialization order in pmc_intel_initialize().
2013-04-30 14:56:41 +00:00
Davide Italiano
e1bd42c272 When hwpmc(4) module is unloaded it reports a double leakage. This happens
at least if FreeBSD is ran under VirtualBox. In order to avoid the leakage,
properly deallocate structures in case CPU claims that hw performance
monitoring counters are not supported.

Reported by:	hiren
2013-04-30 08:33:38 +00:00
Davide Italiano
9dc0d11127 Fixup Westmere hwpmc(4) support: add missing CPU flag so that
intrucion-retired, llc-misses and llc-reference events can now be
allocated.

Reviewed by:	jimharris, gnn
2013-04-30 08:18:08 +00:00
Navdeep Parhar
249b2994d4 Attach to the T580 (2 x 40G) card.
MFC after:	1 week.
2013-04-30 06:30:21 +00:00
Navdeep Parhar
8cf31b85b5 - Provide accurate ifmedia information so that 40G ports/transceivers are
displayed properly in ifconfig, etc.

- Use the same number of tx and rx queues for a 40G port as for a 10G port.

MFC after:	1 week
2013-04-30 05:51:52 +00:00
Navdeep Parhar
3cc9b3e283 cxgbe(4): Some updates to shared code.
Obtained from:	Chelsio
MFC after:	1 week
2013-04-30 05:32:07 +00:00
Sergey Kandaurov
f6fea6cebc Pass a format string to kproc_create() [1] and thus fix the build with
-DBKTR_NEW_MSP34XX_DRIVER and -Wformat-security.
This also allows to eliminates a superfluous malloc/snprintf/free on
intermediate buffer.

PR:		kern/175546
MFC after:	1 week
2013-04-30 05:08:17 +00:00
Carl Delsey
e47937d1b7 Add a new driver to support the Intel Non-Transparent Bridge(NTB).
The NTB allows you to connect two systems with this device using a PCI-e
link. The driver is made of two modules:
 - ntb_hw which is a basic hardware abstraction layer for the device.
 - if_ntb which implements the ntb network device and the communication
   protocol.

The driver is limited at the moment to CPU memcpy instead of using DMA, and
only Back-to-Back mode is supported. Also the network device isn't full
featured yet. These changes will be coming soon. The DMA change will also
bring in the ioat driver from the project branch it is on now.

This is an initial port of the GPL/BSD Linux driver contributed by Jon Mason
from Intel. Any bugs are my contributions.

Sponsored by: Intel
Reviewed by: jimharris, joel (man page only)
Approved by: jimharris (mentor)
2013-04-29 22:48:53 +00:00
Luigi Rizzo
28228e0816 whitespace - document alternative locking under linux 2013-04-29 19:30:35 +00:00
John Baldwin
897986b47e Only cleanup CMI-related state on detach if the system supports CMI.
PR:		kern/163268
MFC after:	1 week
2013-04-29 18:54:31 +00:00
Luigi Rizzo
d4b42e0869 whitespace changes:
remove $Id$ lines, and add blank lines around some #if / #elif /#endif
2013-04-29 18:00:53 +00:00
Xin LI
28cb773df8 Add missing braces.
Submitted by:	Sascha Wildner <saw online de>
Obtained from:	DragonFly
MFC after:	1 week
2013-04-29 17:00:26 +00:00
Luigi Rizzo
b865453e3e explicitly mark some variables as const 2013-04-29 16:58:21 +00:00
Adrian Chadd
8d06054291 Debugging changes!
* That lock isn't actually held during reset - just the whole TX/RX path
  is paused.  So, remove the assertion.

* Log the TX queue status - how many hardware frames are active in the
  MAC and whether the queue is active.
2013-04-29 07:28:29 +00:00
Sean Bruno
afbd1372e7 Silence warning from clang:
/home/sbruno/bsd/head/sys/dev/hptrr/hptrr_osm_bsd.c:178:66: warning: for loop has empty body [-Wempty-body]
                for (order=0, size=PAGE_SIZE; size<f->size; order++, size<<=1) ;
                                                                               ^
/home/sbruno/bsd/head/sys/dev/hptrr/hptrr_osm_bsd.c:178:66: note: put the semicolon on a separate line to silence this warning

Obtained from:	Yahoo! Inc.
MFC after:	2 weeks
2013-04-28 20:55:45 +00:00
Sean Bruno
3d3ddb44cd The controller does not zero this data structure, ever.
Zero it out here so we do not misinterpret the data error.

Obtained from:	Yahoo! Inc.
MFC after:	2 weeks
2013-04-28 20:46:32 +00:00