Matt Carlson [Mon, 25 Apr 2011 12:42:46 +0000 (12:42 +0000)]
tg3: Organize loopback test failure flags
As more test modes are added to each loopback mode, the need to
organise the results increases. This patch groups the results by
loopback mode, and then by test mode.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Matt Carlson [Mon, 25 Apr 2011 12:42:45 +0000 (12:42 +0000)]
tg3: Fix int generation hw bug for 5719 / 5720
On the 5719 and 5720, there is a bug where the hardware will
misinterpret a status tag update and leave interrupts permanently
disabled. This patch enables a hardware fix that works around the
issue.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Mon, 25 Apr 2011 20:03:02 +0000 (13:03 -0700)]
bluetooth: Fix use-before-initiailized var.
net/bluetooth/l2cap_core.c: In function ‘l2cap_recv_frame’:
net/bluetooth/l2cap_core.c:3612:15: warning: ‘sk’ may be used uninitialized in this function
net/bluetooth/l2cap_core.c:3612:15: note: ‘sk’ was declared here
Actually the problem is in the inline function l2cap_data_channel(), we
branch to the label 'done' which tests 'sk' before we set it to anything.
Initialize it to NULL to fix this.
Signed-off-by: David S. Miller <davem@davemloft.net>
Same WRB entry was being reused over different iterations of a
loop while issuing non-embedded IOCTL requests.Fixed couple of minor bugs
in this path as well.
Re-factored code to alloc/free memory for DMA outside of loop
Signed-off-by: Somnath Kotur <somnath.kotur@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
bonding: move processing of recv handlers into handle_frame()
Since now when bonding uses rx_handler, all traffic going into bond
device goes thru bond_handle_frame. So there's no need to go back into
bonding code later via ptype handlers. This patch converts
original ptype handlers into "bonding receive probes". These functions
are called from bond_handle_frame and they are registered per-mode.
Note that vlan packets are also handled because they are always untagged
thanks to vlan_untag()
Note that this also allows arpmon for eth-bond-bridge-vlan topology.
Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Michał Mirosław [Thu, 21 Apr 2011 12:42:15 +0000 (12:42 +0000)]
net: make WARN_ON in dev_disable_lro() useful
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Sun, 24 Apr 2011 17:54:56 +0000 (10:54 -0700)]
net: Remove __KERNEL__ cpp checks from include/net
These header files are never installed to user consumption, so any
__KERNEL__ cpp checks are superfluous.
Projects should also not copy these files into their userland utility
sources and try to use them there. If they insist on doing so, the
onus is on them to sanitize the headers as needed.
Signed-off-by: David S. Miller <davem@davemloft.net>
Matt Carlson [Wed, 20 Apr 2011 07:57:43 +0000 (07:57 +0000)]
tg3: Add additional EEE messaging
This patch adds link messages and an item to the sign-on banner to make
EEE status more visible.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Matt Carlson [Wed, 20 Apr 2011 07:57:42 +0000 (07:57 +0000)]
tg3: Add macro for SMDSP toggling
A common AUX CTRL operation in the driver is to enable and disable the
SMDSP. This patch consolidates the code so that the details of the
operation are in one place. This patch also adds code to make sure the
SMDSP is enabled before executing code that relies on it.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Matt Carlson [Wed, 20 Apr 2011 07:57:41 +0000 (07:57 +0000)]
tg3: Add write accessor for AUX CTRL phy reg
This patch adds a write accessor for the aux ctrl phy register.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Matt Carlson [Wed, 20 Apr 2011 07:57:40 +0000 (07:57 +0000)]
tg3: Add read accessor for AUX CTRL phy reg
This patch adds a read accessor for the aux ctrl register.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Matt Carlson [Wed, 20 Apr 2011 07:57:39 +0000 (07:57 +0000)]
tg3: Move phy accessor functions higher
Phy accessor functions should live closer to where the base phy read /
write routines are.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Matt Carlson [Wed, 20 Apr 2011 07:57:38 +0000 (07:57 +0000)]
tg3: Only allow phy ioctls while netif_running
When tg3 was new, phy accesses through ioctl were allowable at any time.
Then, the driver started shutting down the phy when the device was
closed. Phy accesses would be allowed when the driver first attached to
the device, but then would be forbidden after the device had been up'd
and down'd. After that, management firmware made it illegal to access
the phy unless the driver "owned" the device. Now that most firmware
is being moved over to the APE, it is less clear when phy accesses are
safe.
While it is possible to attempt to identify these conditions and code
the driver to navigate through the pitfalls, it could be perplexing to
the admin why phy accesses work in some cases and not others. This
patch brings some uniformity to the problem by only allowing phy
accesses while the driver has control of the device.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Matt Carlson [Wed, 20 Apr 2011 07:57:37 +0000 (07:57 +0000)]
tg3: Nullify RSS for loopback test
The loopback test assumes all traffic goes to the first rx queue. There
is a 1 in 4 chance this won't be true if RSS is enabled though. This
patch reprograms the RSS indirection table to route all rx packets to
the first queue.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Matt Carlson [Wed, 20 Apr 2011 07:57:36 +0000 (07:57 +0000)]
tg3: Adjust rx prod ring bd replenish thresholds
The oldest tg3 devices had large rx producer ring BD caches. Back then,
it made sense to make the BD cache replenish threshold only a function
of the number of rx buffers posted by the driver. Since then, the BD
cache sizes have shrunk to 25% of their original size and, in some
cases, the ring sizes have quadrupled in size. Under such conditions,
static BD cache replenish thresholds no longer match the hardware
constraints.
This patch attempts to factor in the BD cache size into the bd cache
replenish strategy, taking the existing hardware bugs into account.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Matt Carlson [Wed, 20 Apr 2011 07:57:35 +0000 (07:57 +0000)]
tg3: Workaround rx_discards stat bug
The 5717, 5718, 5719 A0, and 5720 A0 has a bug where the rx_discards
statistic counter will increment when dropping unwanted multicast
frames. This patch works around the problem by attempting to
recreate the data using other means. The resulting value will not be
accurate, but it can still serve as a problem indicator.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This patch implement event notification SCTP_SENDER_DRY_EVENT.
SCTP Socket API Extensions:
6.1.9. SCTP_SENDER_DRY_EVENT
When the SCTP stack has no more user data to send or retransmit, this
notification is given to the user. Also, at the time when a user app
subscribes to this event, if there is no data to be sent or
retransmit, the stack will immediately send up this notification.
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com> Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
sctp: change auth event type name to SCTP_AUTHENTICATION_EVENT
This patch change the auth event type name to SCTP_AUTHENTICATION_EVENT,
which is based on API extension compliance.
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com> Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This patch Implement socket option SCTP_GET_ASSOC_ID_LIST.
SCTP Socket API Extension:
8.2.6. Get the Current Identifiers of Associations
(SCTP_GET_ASSOC_ID_LIST)
This option gets the current list of SCTP association identifiers of
the SCTP associations handled by a one-to-many style socket.
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com> Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
sctp: move chunk from retransmit queue to abandoned list
If there is still data waiting to retransmit and remain in
retransmit queue, while doing the next retransmit, if the
chunk is abandoned, we should move it to abandoned list.
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com> Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
sctp: make heartbeat information in sctp_make_heartbeat()
Make heartbeat information in sctp_make_heartbeat() instead
of make it in sctp_sf_heartbeat() directly for common using.
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com> Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
sctp: fix to check the source address of COOKIE-ECHO chunk
SCTP does not check whether the source address of COOKIE-ECHO
chunk is the original address of INIT chunk or part of the any
address parameters saved in COOKIE in CLOSED state. So even if
the COOKIE-ECHO chunk is from any address but with correct COOKIE,
the COOKIE-ECHO chunk still be accepted. If the COOKIE is not from
a valid address, the assoc should not be established.
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com> Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
sctp: bail from sctp_endpoint_lookup_assoc() if not bound
The sctp_endpoint_lookup_assoc() function uses a port hash
to lookup the association and then checks to see if any of
them are on the current endpoint. However, if the current
endpoint is not bound, there can't be any associations on
it, thus we can bail early.
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com> Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
SCTP does not SCTP_STATE_EMPTY and we can never be in
that state. Remove useless code.
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com> Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
sctp: remove redundant check when walking through a list of TLV parameters
When pos.v <= (void *)chunk + end - ntohs(pos.p->length) and
ntohs(pos.p->length) >= sizeof(sctp_paramhdr_t) these two expressions are all true,
pos.v <= (void *)chunk + end - sizeof(sctp_paramhdr_t) *must* be true.
This patch removes this kind of redundant check.
It's same to _sctp_walk_errors macro.
Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com> Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com> Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Michał Mirosław [Tue, 19 Apr 2011 06:13:10 +0000 (06:13 +0000)]
net: tun: convert to hw_features
This changes offload setting behaviour to what I think is correct:
- offloads set via ethtool mean what admin wants to use (by default
he wants 'em all)
- offloads set via ioctl() mean what userspace is expecting to get
(this limits which admin wishes are granted)
- TUN_NOCHECKSUM is ignored, as it might cause broken packets when
forwarded (ip_summed == CHECKSUM_UNNECESSARY means that checksum
was verified, not that it can be ignored)
If TUN_NOCHECKSUM is implemented, it should set skb->csum_* and
skb->ip_summed (= CHECKSUM_PARTIAL) for known protocols and let others
be verified by kernel when necessary.
Michał Mirosław [Tue, 19 Apr 2011 03:35:06 +0000 (03:35 +0000)]
net: xen-netback: convert to hw_features
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Acked-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: David S. Miller <davem@davemloft.net>
sctp: Release all routes when processing acks ADD_IP or DEL_IP
When processing an ACK for ADD_IP parameter, we only release
the routes on non-active transports. This can cause a wrong
source address to be used. We can release the routes and
cause new route lookups and source address selection so that
new addresses can be used as source. Additionally, we don't need
to lookup routes for all transports at the same time. We can let
the transmit code path update the cached route when the transport
actually sends something.
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com> Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
We allow 0 port when adding new addresses. It only
makes sence to allow 0 port when removing addresses.
When removing the currently bound port will be used
when the port in the address is set to 0.
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com> Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
sctp: teach CACC algorithm about removed transports
When we have have to remove a transport due to ASCONF, we move
the data to a new active path. This can trigger CACC algorithm
to not mark that data as missing when SACKs arrive. This is
because the transport passed to the CACC algorithm is the one
this data is sitting on, not the one it was sent on (that one
may be gone). So, by sending the original transport (even if
it's NULL), we may start marking data as missing.
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com> Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Ivo van Doorn [Mon, 18 Apr 2011 13:35:12 +0000 (15:35 +0200)]
rt2x00: Implement get_antenna and set_antenna callback functions
Implement the get_antenna and set_antenna callback functions, which will
allow clients to control the antenna for all non-11n hardware (Antenna handling
in rt2800 is still a bit magical, so we can't use the set_antenna for those drivers
yet).
To best support the set_antenna callback some modifications are needed in the
diversity handling. We should never look at the default antenna settings to determine
if software diversity is enabled. Instead we should set the diversity flag when
possible, which will allow the link_tuner to automatically pick up the tuning.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Ivo van Doorn [Mon, 18 Apr 2011 13:34:41 +0000 (15:34 +0200)]
rt2x00: Implement get_ringparam callback function
With the get_ringparam callback function we can export ring parameters
to ethtool through the mac80211 interface.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Ivo van Doorn [Mon, 18 Apr 2011 13:34:22 +0000 (15:34 +0200)]
rt2x00: Optimize register access in rt2800usb
All register reads/writes in rt2800usb were previously done with
rt2800_register_read/rt2800_register_write. These however indirectly
call rt2x00usb_register_read/rt2x00usb_register_write which adds an
additional overhead of at least one call and several move instructions
to each register access.
Replacing the calls to rt2800_register_read/rt2800_register_write with
direct calls to rt2x00usb_register_read/rt2x00usb_register_write gets
rid of quite a number of instructions in the drivers hotpaths (IRQ
handling and txdone handling).
For consistency replace all references to rt2800_register_read/write
with the rt2x00usb_register_read/write variants.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Helmut Schaa [Mon, 18 Apr 2011 13:34:01 +0000 (15:34 +0200)]
rt2x00: Optimize register access in rt2800pci
All register reads/writes in rt2800pci were previously done with
rt2800_register_read/rt2800_register_write. These however indirectly
call rt2x00pci_register_read/rt2x00pci_register_write which adds an
additional overhead of at least one call and several move instructions
to each register access.
Replacing the calls to rt2800_register_read/rt2800_register_write with
direct calls to rt2x00pci_register_read/rt2x00pci_register_write gets
rid of quite a number of instructions in the drivers hotpaths (IRQ
handling and txdone handling).
For consistency replace all references to rt2800_register_read/write
with the rt2x00pci_register_read/write variants.
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
The two functions that are in rt2x00ht.c can be much better placed
closer to the places where the call-sites of these functions are (one
in rt2x00config.c and one in rt2x00queue.c) allowing us to make these
functions static.
Also, conditional compilations doesn't seem to be necessary anymore as
802.11n support is quite common nowadays.
This makes the code a bit easier readable and searchable.
Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
rt2x00: Enable support for RT53xx PCI devices by default.
Code seems to be feature-complete, so no reason to not enable
these devices by default.
Also, remove the sentence about the support for these devices being
non-functional.
Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
rt2x00: RT33xx device support is no longer experimental.
The rt33xx devices support for both PCI and USB devices has been in
the tree for a couple of months now, and seems to be functional and
not in a worse shape than the support for rt28xx and rt30xx devices.
No longer mark it as experimental and enable the support for these
devices by default.
Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Add USB IDs that are listed in the latest Ralink Windows and/or Linux drivers.
Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Both USB and PCI drivers allow a system administrator to dynamically add
USB/PCI IDs to the device table that a driver supports via the
/sys/bus/{usb,pci,pci_express}/drivers/<driver-name>/new_id files.
However, for the rt2x00 drivers using this method currently crashes the
system with a NULL pointer failure.
This is due to the set-up of rt2x00 where the probe functions require a
rt2x00_ops structure in the driver_info field of the probed device. As
this field is empty for the dynamically added devices this fails for
these devices.
Fix this by introducing driver-specific probe wrappers that do nothing
but calling the bus-specific probe functions with the rt2x00_ops structure
as an argument, rather than depending on the driver_info field.
Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Move the USB ID entry from the unknown devices to the list of RT35xx based
devices.
Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Helmut Schaa [Mon, 18 Apr 2011 13:31:31 +0000 (15:31 +0200)]
rt2x00: Always inline rt2x00pci_enable_interrupt
This allows the compiler to perform the necessary bitfield calculations
during compile time instead of run time and thus reduces the number of
instructions to run during each tasklet invocation. This should improve
performance in the RX hotpath.
This comes at the cost of a slight increase in the module size (for
example rt2800pci):
Before:
text data bss dec hex filename
14133 832 4 14969 3a79 drivers/net/wireless/rt2x00/rt2800pci.ko
After:
text data bss dec hex filename
14149 832 4 14985 3a89 drivers/net/wireless/rt2x00/rt2800pci.ko
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Ivo van Doorn [Mon, 18 Apr 2011 13:31:02 +0000 (15:31 +0200)]
rt2x00: Decrease association time for USB devices
When powersaving is enabled, assocaition times are very high
(for WPA2 networks, the time can easily be around the 3 seconds).
This is caused, because the flushing of the queues takes
too much time. Without the flushing callback mac80211 assumes
a timeout of 100ms while scanning. Limit all flush waiting
loops to the same maximum.
We can apply this maximum by passing the drop status to the
driver, which makes sure the driver performs extra actions
during the waiting for the queue to become empty.
After these changes, association times fall within the
healthy range of ~0.6 seconds with powersaving enabled.
The difference between association time between powersaving
enabled and disabled is now only ~0.1 second (which can also
be due to the measuring method).
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
TX status is reported by the hardware when a packet has been
sent (or after TX failed after possible retries), which is some
time after the DMA completion. Since the rt2800usb hardware can
not signal interrupts we have to use a timer, otherwise the
TX status would only be read by the next packet's TX DMA
completion, or by the watchdog thread.
Signed-off-by: Johannes Stezenbach <js@sig21.net> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
The watchdog just triggers rt2800usb_work_txdone() when it
detects a TX status timeout, thus rt2800usb_work_txdone() needs to
handle this case.
Signed-off-by: Johannes Stezenbach <js@sig21.net> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Add a timestamp to each queue entry which is updated whenever
the status of the entry changes, and remove the per-queue
timestamps. The previous check was incorrect and caused both
false positives and false negatives.
With the corrected check it comes apparent that the TX status
usually times out on rt2800usb unless there is sufficient traffic
(i.e. the next TX will complete the previous TX status).
Signed-off-by: Johannes Stezenbach <js@sig21.net> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Trying to fix the "TX status report missed" warnings
by reading the TX_STA_FIFO entries as quickly as possible.
The TX_STA_FIFO is too small in hardware, thus reading
it only from the workqueue is too slow and entries get lost.
Start an asynchronous read of the TX_STA_FIFO directly from
the TX URB completion callback (atomic context, thus it cannot
use the blocking rt2800_register_read()). If the async
read returns a valid FIFO entry, it is pushed into a larger
FIFO inside struct rt2x00_dev, until rt2800_txdone() picks
it up.
A .tx_dma_done callback is added to struct rt2x00lib_ops
to trigger the async read from the URB completion callback.
Signed-off-by: Johannes Stezenbach <js@sig21.net> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Helmut Schaa [Mon, 18 Apr 2011 13:28:50 +0000 (15:28 +0200)]
rt2x00: Use TXOP_HTTXOP for beacons
Use TXOP_HTTXOP for beacons to stay in sync with the legacy drivers.
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Helmut Schaa [Mon, 18 Apr 2011 13:28:27 +0000 (15:28 +0200)]
rt2x00: Update TX_SW_CFG2 init value
Bring the TX_SW_CFG2 initialisation for rt305x devices in sync with the
ralink legacy drivers.
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Helmut Schaa [Mon, 18 Apr 2011 13:28:04 +0000 (15:28 +0200)]
rt2x00: Use correct TBTT_SYNC config in AP mode
This seems to fix problems with some powersaving clients since a
positive value in TBTT_SYNC_CFG_TBTT_ADJUST introduces beacon skew,
which is not wanted in AP mode.
Also update the rest of the TBTT_SYNC config according to the
legacy drivers in AP mode.
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Helmut Schaa [Mon, 18 Apr 2011 13:27:43 +0000 (15:27 +0200)]
rt2x00: Make rt2x00_queue_entry_for_each more flexible
Allow passing a void pointer to rt2x00_queue_entry_for_each which in
turn in provided to the callback function.
Furthermore, allow the callback function to stop processing by returning
true. And also notify the caller of rt2x00_queue_entry_for_each if the
loop was canceled by the callback.
No functional changes, just preparation for an upcoming patch.
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Ivo van Doorn [Mon, 18 Apr 2011 13:27:06 +0000 (15:27 +0200)]
rt2x00: Split rt2x00dev->flags
The number of flags defined for the rt2x00dev->flags field,
has been growing over the years. Currently we are approaching
the maximum number of bits which are available in the field.
A secondary problem, is that one part of the field are initialized only
during boot, because the driver requirements are initialized or device
requirements are loaded from the EEPROM. In both cases, the flags are
fixed and will not change during device operation. The other flags are
the device state, and will change frequently. So far this resulted in the fact
that for some flags, the atomic bit accessors are used, while for the others
the non-atomic variants are used.
By splitting the flags up into a "flags" and "cap_flags" we can put all flags
which are fixed inside "cap_flags". This field can then be read non-atomically.
In the "flags" field we keep the device state, which is going to be read atomically.
This adds more room for more flags in the future, and sanitizes the field access methods.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Acked-by: Helmut Schaa <helmut.schaa@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Helmut Schaa [Mon, 18 Apr 2011 13:26:37 +0000 (15:26 +0200)]
rt2x00: Fix stuck queue in tx failure case
Since commit 0b7fde54f94979edc67bbf86b5adba702ebfefe8 "rt2x00: Protect
queue control with mutex" rt2x00 used rt2x00queue_pause_queue for
stopping a tx queue in mac80211. But in case of a failure in the tx
path rt2x00 still called ieee80211_stop_queue which stopped the queue
but prevented rt2x00queue_unpause_queue to wake the queue up again
resulting in a stuck tx queue.
Fix this by also using rt2x00queue_pause_queue in case of tx failures.
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
rt2x00: Enable WLAN LED on Ralink SoC (rt305x) devices
This patch adds WLAN LED support to the mac80211 rt2x00 driver for
Ralink SoC (rt305x) devices. The current WLAN LED drivers in
rt2800lib.c set the LED brightness via an MCU request, but do nothing
for SoC. This patch checks for SoC and sets the register to enable the
WLAN LED (instead of an MCU request). This enables the WLAN LED for
RT305x devices.
Signed-off-by: Layne Edwards <ledwards@astrumtech.net> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Sun, 17 Apr 2011 21:28:10 +0000 (23:28 +0200)]
ath9k: assign keycache slots to unencrypted stations
Frame filtering relies on having a valid destination index (keycache slot),
to keep track of the destination. Assigning a keycache slot (configured
to unencrypted, with no key data attached) improves powersave handling in
AP mode with no encryption.
The dummy keycache entry for a station is cleared, when a real key gets
added.
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Sun, 17 Apr 2011 21:28:09 +0000 (23:28 +0200)]
ath9k: fix powersave frame filtering/buffering in AP mode
This patch fixes a long standing issue of pending packets in the queue being
sent (and retransmitted many times) to sleeping stations.
This was made worse by aggregation through driver-internal retransmitting
of A-MDPU subframes.
Previously the hardware tx filter was cleared unconditionally for every
single packet - with this patch it uses the IEEE80211_TX_CTL_CLEAR_PS_FILT
for unaggregated frames.
A sta_notify driver op is added to stop aggregation for stations when they
enter powersave mode. Subframes stay buffered inside the driver, to ensure
that the BlockAck window keeps a sane state.
Since the driver uses software aggregation, the clearing of the tx filter
needs to be handled by the driver instead of mac80211 for aggregated frames.
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
While leaving the oper channel, beacon generation is stopped
by mac80211 and beacon slots are marked as inactive.
During the scan, ath9k configures beacon timers
based on IEEE80211_CONF_OFFCHANNEL which inturn generates
beacon alert even though bslot is inactive.
ath9k fails to disable beacon alert while moving to offchannel
if none of the beacon slot is active. This is causing beacon
transmission on foreign channel. This patch enables swba
based on active bslots.
This issue was reported with two vifs (AP+STA) and triggered
scan in STA vif in unassociated state.
Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Sun, 17 Apr 2011 15:45:00 +0000 (17:45 +0200)]
mac80211: add a function for setting the TIM bit for a specific station
This allows a driver to buffer frames for a PS station and tell mac80211
to wake it up even though mac80211 does not have any buffered frames for
it.
This is necessary for properly handling aggregation related buffering,
in ath9k, because the driver needs to keep its frames in order to keep
track of the Block-ACK window.
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
1) removal of unnecessary mwifiex_device structure
2) avoid passing adapter pointer to mwifiex_init_sw()
3) remove local variable drv_mode_info in mwifiex_add_card()
4) type change in mwifiex_bss_attr to match mwifiex_private
5) removal of more wordy comments
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sergei Shtylyov [Fri, 15 Apr 2011 15:23:11 +0000 (19:23 +0400)]
iwlegacy: use pci_dev->revision
Commit be663ab67077fac8e23eb8e231a8c1c94cb32e54 (iwlwifi: split the drivers for
agn and legacy devices 3945/4965) added code to read the 4965's revision ID from
the PCI configuration register while it's already stored by PCI subsystem in the
'revision' field of 'struct pci_dev'...
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
ath: fix 0x6C for beaconing/passive scan flags based on country IE
The 0x6C regulatory domain is just like the 0x6A regulatory
domain but differs in that 0x6C will allow adhoc and active
scan on its channels only if we are associated to an AP
with a country IE that allows those channels. The
ath_reg_apply_beaconing_flags() does just this -- we respect
the manufacturer's intent on only enabling beaconing modes
of operation if and only if blessed by the country IE.
Cc: David Quan <david.quan@atheros.com> Cc: Senthil Balasubramanian <senthilkumar@atheros.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Antonio Ospite [Wed, 13 Apr 2011 19:40:45 +0000 (21:40 +0200)]
rfkill: Regulator consumer driver for rfkill
Add a regulator consumer driver for rfkill to enable controlling radio
transmitters connected to voltage regulators using the regulator
framework.
A new "vrfkill" virtual supply is provided to use in platform code.
Signed-off-by: Guiming Zhuo <gmzhuo@gmail.com> Signed-off-by: Antonio Ospite <ospite@studenti.unina.it> Reviewed-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>