Commit graph

480585 commits

Author SHA1 Message Date
Sujith Manoharan
5555c95524 ath9k: Unify reset API
Instead of having ath_reset_internal() and ath_reset()
as two separate calls to perform a HW reset, have
one function. This makes sure that the behavior will
be the same at all callsites.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-27 14:16:14 -04:00
Sujith Manoharan
be247c1fae ath9k: Process beacons properly
When the current operating channel context has
been marked as ATH_CHANCTX_STATE_FORCE_ACTIVE,
do not process beacons that might be received,
since we have to wait for the station to become
authorized.

Also, since the cached TSF value will be zero
initially do not rearm the timer in this
case when a beacon is received, since it results
in spurious values.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-27 14:16:14 -04:00
Sujith Manoharan
b8f9279be0 ath9k: Enable multi-channel properly
In MCC mode, currently the decision to enable
the multi-channel state machine is done
based on the association status if one of
the interfaces assigned to a context is in
station mode.

This allows the driver to switch to the other
context before the current station is able to
complete the 4-way handshake in case it is
required and this causes problems.

Instead, enable multi-channel mode when the
station moves to the authorized state. This
disallows an early switch to the other channel.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-27 14:16:14 -04:00
Sujith Manoharan
df3c6eb34d ath9k: Use sta_state() callback
Instead of using the sta_add()/sta_remove() callbacks,
use the sta_state() callback since this gives
more fine-grained control.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-27 14:16:14 -04:00
Lorenzo Bianconi
992a36a641 ath9k: do not overwrite AR_PHY_RADAR_1 MSB
Do not overwrite AR_PHY_RADAR_1 most significant byte default value

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-27 14:16:14 -04:00
Dan Carpenter
9fdc723abf ipw2x00: clean up a condition
The original condition was "(PAGE_SIZE - len)" when "(len < PAGE_SIZE)"
is intended.

This condition is not really sufficient, but also not really needed...
If "len > PAGE_SIZE" then it we will print a warning message in dmesg
but there are no other effects.  Maybe we should just remove the
condition?

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-27 14:16:14 -04:00
Dan Carpenter
2aa01652cf ipw2x00: remove unused ->ibss_dfs pointer
The ->ibss_dfs pointer is always allocated with a user controlled
length.  This caused a static checker warning because what if the length
was zero?  In that case, any dereference of ->ibss_dfs would lead to an
Oops.

It turns out that this isn't a problem because the ->ibss_dfs pointer is
never used.  This patch deletes it along with all the related code.  In
particular the entire libipw_network_reset() function can be removed.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-27 14:16:13 -04:00
Stanislaw Gruszka
e9dc51aa2b rt2x00: tune multi-registers I/O timeout
We provide timeout value to rt2x00usb_vendor_request_buff() based on
number of registers to process. That value is passed down to
rt2x00usb_vendor_req_buff_lock() and ends in usb_control_msg(). But we
do not read/write all registers in rt2x00usb_vendor_req_buff_lock() at
once. We read/write them in chunks of 64 bytes in the loop, hence passed
timeout value to low level is too big.

Patch removes timeout argument from rt2x00usb_vendor_request_buff() and
use short REGISTER_TIMEOUT in rt2x00usb_vendor_req_buff_lock(). That
timeout value should be fine for 64 bytes and smaller requests. For
EEPROM read we introduced new timeout value equal to 2 seconds.

Patch fixes process uninterruptible sleep stalls for long period, when
USB bus has problem to satisfy a request and we wait very long time on
usb_start_wait_urb().

Reported-and-tested-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-27 14:16:13 -04:00
Rafał Miłecki
ab54bc8460 bcma: fill core details for every device
We were setting things like dma_dev, IRQ, etc. during core registration
only. We need such info for cores handled internally (e.g. ChipCommon)
as well.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-27 14:16:13 -04:00
John W. Linville
490f0dc4d5 Merge tag 'for-linville-20141024' of git://github.com/kvalo/ath
Conflicts:
	drivers/net/wireless/ath/wil6210/wil6210.h
2014-10-27 14:09:36 -04:00
Alexander Aring
be9d215fa9 mac802154: rx: change naming convention
This patch changes the naming convention of mac802154 rx file. It should
be more named like mac80211 stack. Furthermore we introduce a new frame
parsing implementation which is much similar the mac80211
implementation.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-10-27 18:07:50 +01:00
Alexander Aring
b89c33417f at86rf230: improve receive handling
Current behaviour it to copy the frame inclusive CRC into a skb, then
remove the CRC from the skb. This patch optimizes this by not copying
the CRC at the first place.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-10-27 18:07:50 +01:00
Alexander Aring
d0e73c4704 at86rf230: use ieee802154_is_valid_psdu_len helper
This patch adds the ieee802154_is_valid_psdu_len function to validate
the psdu length. If the psdu length is invalid we use the maximum
payload to receive also corrupted frames in monitor mode.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-10-27 18:07:49 +01:00
Alexander Aring
fa491001e4 ieee802154: add valid psdu length helper
This patch adds a generic valid psdu length check function helper. This
is useful to check the length field after receiving. For example the
at86rf231 doesn't filter invalid psdu length. Sometimes the CRC can also
be correct. If we get the lqi value with an invalid frame length the
kernel may crash because we dereference an invalid pointer in the
receive buffer.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-10-27 18:07:49 +01:00
Alexander Aring
e176b681b0 mac802154: rx: move rcu locking
Instead of twice lock and unlock mechanism this patch hold these locks
only once at one position.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-10-27 18:07:45 +01:00
Alexander Aring
9cf215d073 mac802154: rx: move skb_reset_mac_header
This patch moves the skb_reset_mac_header call before frame parsing
while wpan rx and before monitor deliver functionality.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-10-27 18:07:45 +01:00
Alexander Aring
c9ca640140 mac802154: rx: add monitor pkt_type information
This patch adds a PACKET_OTHERHOST setting when a monitor interface
receives a skb. All receiving skb's to the monitor interface should
be PACKET_OTHERHOST.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-10-27 18:07:44 +01:00
Alexander Aring
75a46f0ee7 mac802154: rx: add CHECKSUM_UNNECESSARY
This patch adds CHECKSUM_UNNECESSARY to skb->ip_summed before delivery.
There exist no transceiver with IP checksum functionality.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-10-27 18:07:44 +01:00
Alexander Aring
702dcf994a mac802154: rx: move skb->protocol setting
This patch moves the skb->protocol setting to the position when it's
needed. It's only needed when frame parsing was successful.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-10-27 18:07:43 +01:00
Alexander Aring
469100d6c2 mac802154: rx: rename remove mac802154_subif_rx
This patch removes the mac802154_subif_rx function and do the necessary
calls inside of ieee802154_rx function. The ieee802154_rx is small
enough to move the functionality inside this function.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-10-27 18:07:43 +01:00
Alexander Aring
4ca18be54f mac802154: tx: remove monitor receive while xmit
This removes the call of monitor receive funktion when any interface
type call xmit. There exist no such use case that a monitor interface
should receive the actual sending frame. One use case could be that a
wpan interface and monitor interface could be running at the same time
on one phy. Then the monitor interface receives the wpan frames also.
Furthermore we adding support for promiscous mode setting. With
promiscous mode setting we can't run a wpan and monitor interface at the
same time.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-10-27 18:07:42 +01:00
Alexander Aring
2a9820c9e2 mac802154: rx: move receive handling into rx.c
This patch removes all relevant receiving functions inclusive frame
parsing into rx file. Like mac80211 we should implement the complete
receive handling and parsing in this file.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-10-27 18:07:42 +01:00
Alexander Aring
c730c90316 mac802154: rx: document ieee802154_rx() context requirement
This patch is similar like d20ef63d32
("mac80211: document ieee80211_rx() context requirement"). The
netif_receive_skb call requires with softirqs disabled. This patch
adds a warning if softirqs are pending while calling ieee802154_rx.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-10-27 18:07:42 +01:00
Alexander Aring
c5c47e67bc mac802154: rx: use tasklet instead workqueue
Tasklets have much less overhead than workqueues. This patch also
removes the heap allocation for the worker on receiving path.
Like mac80211 we should prefer use a tasklet here instead a workqueue to
getting fast out of interrupt context when ieee802154_rx_irqsafe is
called by driver. Like wireless inside the tasklet context we should
call netif_receive_skb instead netif_rx_ni anymore.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-10-27 18:07:40 +01:00
Alexander Aring
61a2281458 ieee802154: drivers: use dev_alloc_skb
This patch change the allocation of skb inside the ieee802154 driver
layer to dev_alloc_skb. This changes also the gfp mask to GFP_ATOMIC
which is needed for upcomming change that the receiving is done by a
tasklet and not a workqueue anymore.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Cc: Alan Ott <alan@signal11.us>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-10-27 18:07:37 +01:00
Alexander Aring
061ef8f915 mac802154: tx: use put_unaligned_le16 for copy crc
This patch replaces the memcpy with a put_unaligned_le16. The placement
of crc inside of PSDU can also be unaligned. With memcpy this can fail
on some architectures.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Reported-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-10-27 18:07:36 +01:00
Martin Townsend
01141234f2 ieee802154: 6lowpan: rename process_data and lowpan_process_data
As we have decouple decompression from data delivery we can now rename all
occurences of process_data in receive path.

Signed-off-by: Martin Townsend <mtownsend1973@gmail.com>
Acked-by: Alexander Aring <alex.aring@gmail.com>
Acked-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-10-27 15:51:16 +01:00
Martin Townsend
3c400b843d bluetooth:6lowpan: use consume_skb when packet processed successfully
Signed-off-by: Martin Townsend <mtownsend1973@gmail.com>
Acked-by: Alexander Aring <alex.aring@gmail.com>
Acked-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-10-27 15:51:16 +01:00
Martin Townsend
04dfd7386a 6lowpan: fix process_data return values
As process_data now returns just error codes fix up the calls to this
function to only drop the skb if an error code is returned.

Signed-off-by: Martin Townsend <mtownsend1973@gmail.com>
Acked-by: Alexander Aring <alex.aring@gmail.com>
Acked-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-10-27 15:51:15 +01:00
Martin Townsend
f8b361768e 6lowpan: remove skb_deliver from IPHC
Separating skb delivery from decompression ensures that we can support further
decompression schemes and removes the mixed return value of error codes with
NET_RX_FOO.

Signed-off-by: Martin Townsend <mtownsend1973@gmail.com>
Acked-by: Alexander Aring <alex.aring@gmail.com>
Acked-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-10-27 15:51:15 +01:00
Alexander Aring
f81f466ca5 mac802154: tx: make worker information static
This patch moves the worker information struct out of skb control block.
Instead control block we declare it static inside of tx.c file. We can do
that, because the worker can't be used twice at the same time. It's
protected by stop and wake netdev queue.

This patch fix an issue that the "struct ieee802154_xmit_cb" doesn't fit
into the skb control block on some kernel configuartion reported by
kbuild test robot.

It was introduced by commit fe24371d66
("mac802154: tx: remove kmalloc in xmit hotpath").

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-10-26 19:18:35 +01:00
Alexander Aring
955aee8b5c at86rf230: asynchronous xmit handling
This patch converts the sync xmit handling into an async xmit handling. The
driver was already prepared for this step, all other drivers need more
work to implement a xmit_async function.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-10-26 17:24:05 +01:00
Alexander Aring
1e7283a271 mac802154: tx: add comment at sync xmit callback
This patch adds a warning that xmit_sync callback is deprecated and
should be removed soon. The 802.15.4 subsystem will not accept synced
drivers anymore.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-10-26 17:24:05 +01:00
Alexander Aring
e5e584fcc2 mac802154: tx: change naming convention
This patch changes the naming convention of the tx functions like
mac80211. Just with an 802154 instead 80211 inside the name.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-10-26 17:24:05 +01:00
Alexander Aring
409c3b0c5f mac802154: tx: move stats tx increment
This patch moves the stats increment of successful transmitted packets
in the right place when the skb was really successful transmitted.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-10-26 17:24:05 +01:00
Alexander Aring
b7eec52bcb mac802154: tx: cleanup crc calculation
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-10-26 17:24:05 +01:00
Alexander Aring
cfa626cb37 mac802154: tx: use netdev print helpers
This patch replace the pr_foo printout function to netdev_foo printout
function. Inside the xmit handling, the interface is already known.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-10-26 17:24:04 +01:00
Alexander Aring
6001d5223d mac802154: tx: don't allow if down while sync tx
This patch holds rtnl lock while sync xmit inside of workqueue.
Otherwise we could down the interface while worker xmit handling.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-10-26 17:24:04 +01:00
Alexander Aring
ed0a5dce0c mac802154: tx: add support for xmit_async callback
This patch renames the existsing xmit callback to xmit_sync and
introduces an asynchronous xmit_async function. If ieee802154_ops
doesn't provide the xmit_async callback, then we have a fallback to
the xmit_sync callback.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Cc: Alan Ott <alan@signal11.us>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-10-26 17:24:04 +01:00
Alexander Aring
cdb66beaa0 mac802154: tx: fix error handling while xmit
In case of an error we should call kfree_skb instead of consume_skb which
is called by ieee802154_xmit_complete function.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-10-26 17:24:04 +01:00
Alexander Aring
18d60a0d49 mac802154: tx: use queue helpers in xmit worker
This patch uses the queue utility helpers inside the xmit worker of
mac802154 subsystem.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-10-26 17:24:03 +01:00
Alexander Aring
c208510351 mac802154: add netdev qeue helpers
This patch adds a new file net/mac802154/util.c which contains utility
functions for drivers, etc. This file contains functions to start and
stop queues for all virtual interfaces, this is useful for asynchronous
handling by driver level.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-10-26 17:24:03 +01:00
Alexander Aring
dc67c6b30f mac802154: tx: remove xmit channel context switch
This patch removes the channel hopping feature before xmit. There are
several issues to provide a real channel hopping (timing requirements,
etc...).

We don't have any known kernelspace protocol which really use this
feature. And I don't know an real user of this feature.
We simply drop this feature now.

This patch removes also the hold of pib lock which isn't needed by any
real driver xmit callback implementation.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-10-26 17:24:03 +01:00
Alexander Aring
e89e45f22a mac802154: tx: squash multiple dereferencing
This patch introduce some new stack variables to avoid multiple
dereferencing inside the xmit worker function.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-10-26 17:24:02 +01:00
Alexander Aring
fe24371d66 mac802154: tx: remove kmalloc in xmit hotpath
This patch removes the kmalloc allocation for workqueue data. This patch
replaces the kmalloc and uses the control block of skb. The control block
has enough space and isn't use by any other layer in this case.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-10-26 17:23:58 +01:00
Alexander Aring
50c6fb9965 mac802154: tx: move xmit callback to tx file
This patch moves the netdev xmit callback functions into the tx.c file.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-10-26 17:23:50 +01:00
Alexander Aring
c6f635faf3 mac802154: remove ieee802154_addr from driver_ops
This driver_ops callback function is never used by any driver.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-10-25 21:55:39 +02:00
Alexander Aring
f773054254 mac802154: rename dev_workqueue to workqueue
Small rename to use the name workqueue than dev_workqueue. To bring the
same naming convention like wireless into 802.15.4.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-10-25 21:55:38 +02:00
Alexander Aring
59d19cd70c mac802154: introduce IEEE802154_DEV_TO_SUB_IF
This function adds a wrapper to call netdev_priv to getting the sdata
attribute. This is similar like the IEEE80211_DEV_TO_SUB_IF function
inside wireless stack implementation.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-10-25 21:55:38 +02:00
Alexander Aring
60741361c3 mac802154: introduce hw_to_local function
This patch replace the mac802154_to_priv macro with a static inline
function named hw_to_local. This brings a similar naming convention like
mac80211 stack.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-10-25 21:55:38 +02:00