aboutsummaryrefslogtreecommitdiff
path: root/net
AgeCommit message (Collapse)AuthorFilesLines
2010-07-21Bluetooth: Make l2cap_streaming_send() void.João Paulo Rechi Vita1-3/+2
It doesn't make sense to have a return value since we always set it to 0. Signed-off-by: João Paulo Rechi Vita <[email protected]> Acked-by: Gustavo F. Padovan <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2010-07-21Bluetooth: Fix l2cap_sock_connect error return.João Paulo Rechi Vita1-0/+1
Return a proper error value if socket is already connected. Signed-off-by: João Paulo Rechi Vita <[email protected]> Acked-by: Gustavo F. Padovan <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2010-07-21Bluetooth: Improve ERTM local busy handlingGustavo F. Padovan1-36/+47
Now we also check if can push skb userspace just after receive a new skb instead of only wait the l2cap_busy_work wake up from time to time to check the local busy condition. Signed-off-by: Gustavo F. Padovan <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2010-07-21Bluetooth: Add backlog queue to ERTM codeGustavo F. Padovan1-53/+79
backlog queue is the canonical mechanism to avoid race conditions due interrupts in bottom half context. After the socket lock is released the net core take care of push all skb in its backlog queue. Signed-off-by: Gustavo F. Padovan <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2010-07-21Bluetooth: Remove the send_lock spinlock from ERTMGustavo F. Padovan1-27/+1
Using a lock to deal with the ERTM race condition - interruption with new data from the hci layer - is wrong. We should use the native skb backlog queue. Signed-off-by: Gustavo F. Padovan <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2010-07-21Bluetooth: Don't accept ConfigReq if we aren't in the BT_CONFIG stateGustavo F. Padovan1-1/+7
If such event happens we shall reply with a Command Reject, because we are not expecting any configure request. Signed-off-by: Gustavo F. Padovan <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2010-07-21Bluetooth: Disconnect early if mode is not supportedGustavo F. Padovan1-16/+40
When mode is mandatory we shall not send connect request and report this to the userspace as well. Signed-off-by: Gustavo F. Padovan <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2010-07-21Bluetooth: Remove check for supported modeGustavo F. Padovan1-7/+2
Since now we have checks for the supported mode before on l2cap_info_rsp we can remove the check for it here. Signed-off-by: Gustavo F. Padovan <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2010-07-21Bluetooth: Refuse ConfigRsp with different modeGustavo F. Padovan1-1/+5
If our mode is Basic Mode we have to refuse any ConfigRsp that proposes a different mode. Signed-off-by: Gustavo F. Padovan <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2010-07-21Bluetooth: Actively send request for Basic ModeGustavo F. Padovan1-6/+11
The Profile Tuning Suite requires that we send a RFC containing the Basic Mode configuration when requesting Basic Mode. Signed-off-by: Gustavo F. Padovan <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2010-07-21Bluetooth: Prefer Basic Mode on receipt of ConfigReqGustavo F. Padovan1-3/+0
If we choose to use Basic Mode then we have to refuse the received mode and propose Basic Mode again. Signed-off-by: Gustavo F. Padovan <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2010-07-21Bluetooth: Disconnect the channel if we don't want the proposed modeGustavo F. Padovan1-1/+2
If the device is a STATE 2 then it should disconnect the channel if the remote device propose a mode different from its mandatory mode. Signed-off-by: Gustavo F. Padovan <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2010-07-21Bluetooth: Change the way we set ERTM mode as mandatoryGustavo F. Padovan1-4/+18
If the socket type is SOCK_STREAM we set Enhanced Retransmisson Mode or Streaming Mode as mandatory. That means that we will close the channel if the other side doesn't support or request the the mandatory mode. Basic mode can't be set as mandatory. Signed-off-by: Gustavo F. Padovan <[email protected]> Reviewed-by: João Paulo Rechi Vita <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2010-07-21Bluetooth: Tweaks to l2cap_send_i_or_rr_or_rnr() flowGustavo F. Padovan1-2/+1
l2cap_send_sframe() already set the F-bit if we set L2CAP_CONN_SEND_FBIT and unset L2CAP_CONN_SEND_FBIT after send the F-bit. Signed-off-by: Gustavo F. Padovan <[email protected]> Reviewed-by: João Paulo Rechi Vita <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2010-07-21Bluetooth: Add debug output to ERTM codeGustavo F. Padovan1-1/+22
Use the dynamic debug to output info about ERTM protocol stuff. The following script can be used to enable debug for ERTM: DEBUGFS="/sys/kernel/debug/dynamic_debug/control" echo -n 'func l2cap_send_disconn_req +p' > $DEBUGFS echo -n 'func l2cap_monitor_timeout +p' > $DEBUGFS echo -n 'func l2cap_retrans_timeout +p' > $DEBUGFS echo -n 'func l2cap_busy_work +p' > $DEBUGFS echo -n 'func l2cap_push_rx_skb +p' > $DEBUGFS echo -n 'func l2cap_data_channel_iframe +p' > $DEBUGFS echo -n 'func l2cap_data_channel_rrframe +p' > $DEBUGFS echo -n 'func l2cap_data_channel_rejframe +p' > $DEBUGFS echo -n 'func l2cap_data_channel_srejframe +p' > $DEBUGFS echo -n 'func l2cap_data_channel_rnrframe +p' > $DEBUGFS Signed-off-by: Gustavo F. Padovan <[email protected]> Reviewed-by: João Paulo Rechi Vita <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2010-07-21Bluetooth: Fix ERTM error reporting to the userspaceGustavo F. Padovan1-17/+22
If any error occurs during transfers we have to tell userspace that something wrong happened. Signed-off-by: Gustavo F. Padovan <[email protected]> Reviewed-by: João Paulo Rechi Vita <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2010-07-21Bluetooth: Fix missing retransmission action with RR(P=1)Gustavo F. Padovan1-2/+2
The Bluetooth SIG Profile Tuning Suite Software uses the CSA1 spec to run the L2CAP tests. The new 3.0 spec has a missing Retransmit-I-Frames action when the Remote side is Busy. We still start the retransmission timer if Remote is Busy and unacked frames > 0. We do everything we did before this change plus the Retransmission of I-frames. Signed-off-by: Gustavo F. Padovan <[email protected]> Reviewed-by: João Paulo Rechi Vita <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2010-07-21Bluetooth: Check packet FCS earlierGustavo F. Padovan1-11/+11
This way, if FCS is enabled and the packet is corrupted, we just drop it without read it len, which could be corrupted. Signed-off-by: Gustavo F. Padovan <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2010-07-21Bluetooth: Check the tx_window size on setsockoptGustavo F. Padovan1-0/+5
We have to check if the proposed tx_window value is not greater that maximum value supported. Signed-off-by: Gustavo F. Padovan <[email protected]> Reviewed-by: João Paulo Rechi Vita <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2010-07-21Bluetooth: Fix handle of received P-bitGustavo F. Padovan1-2/+12
ERTM spec mandates that after receive a P-bit we shall send an F-bit in response. This patch fixes this for retransmitted packets, on retransmitting we were missing to check for a pending F-bit to be sent. Also we were missing some annotation to send a F-bit. Signed-off-by: Gustavo F. Padovan <[email protected]> Reviewed-by: João Paulo Rechi Vita <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2010-07-21Bluetooth: Update buffer_seq before retransmit framesGustavo F. Padovan1-4/+4
Updating buffer_seq first make us able to ack the last I-frame received. This is also a requirement of the Profile Tuning Suite software. Signed-off-by: Gustavo F. Padovan <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2010-07-21Bluetooth: Stop ack_timer if ERTM enters in Local Busy or SREJ_SENTGustavo F. Padovan1-0/+4
The ack_timer is implemation specific, disabling it in such situation avoids some potencial errors in the ERTM protocol. Signed-off-by: Gustavo F. Padovan <[email protected]> Reviewed-by: João Paulo Rechi Vita <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2010-07-21Bluetooth: Reassigned copyright to Code Aurora ForumRon Shaffer2-2/+2
Qualcomm, Inc. has reassigned rights to Code Aurora Forum. Accordingly, as files are modified by Code Aurora Forum members, the copyright statement will be updated. Signed-off-by: Ron Shaffer <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2010-07-21Bluetooth: Add debugfs support for showing the blacklistJohan Hedberg1-0/+38
This patch adds a debugfs blacklist entry for each HCI device which can be used to list the current content of the blacklist. Signed-off-by: Johan Hedberg <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2010-07-21Bluetooth: Add blacklist support for incoming connectionsJohan Hedberg3-1/+94
In some circumstances it could be desirable to reject incoming connections on the baseband level. This patch adds this feature through two new ioctl's: HCIBLOCKADDR and HCIUNBLOCKADDR. Both take a simple Bluetooth address as a parameter. BDADDR_ANY can be used with HCIUNBLOCKADDR to remove all devices from the blacklist. Signed-off-by: Johan Hedberg <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2010-07-21Bluetooth: Fix L2CAP control bit field corruptionGustavo F. Padovan1-0/+4
When resending an I-frame, ERTM was reusing the control bits from the last time it was sent, that was causing a corruption in the new control field due to it dirty fields. This patches extracts only the SAR bits from the old field and reuse it to resend the packet, the others bits should be reset and receive the updated value. Signed-off-by: Gustavo F. Padovan <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2010-07-21Bluetooth: Proper shutdown ERTM when closing the channelGustavo F. Padovan1-22/+37
Fix a crash regarding the Monitor Timeout, it was running even after the shutdown of the ACL connection, which doesn't make sense. The same code also fixes another issue, before this patch L2CAP was sending many Disconnections Requests while we have to send only one. The issues are related to each other, a expired Monitor Timeout can trigger a Disconnection Request and then we may have a crash if the link was already deleted. Signed-off-by: Gustavo F. Padovan <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2010-07-21Bluetooth: Fix bug with ERTM minimum packet lengthNathan Holstein1-4/+4
ERTM and streaming mode L2CAP sockets have no minimum packet length. Only basic mode connections have minimum length. Instead, validate the packet containing all necessary control, FCS, and SAR fields. The patch fixes the drop of valid packets with length lower than 4. Signed-off-by: Nathan Holstein <[email protected]> Signed-off-by: Gustavo F. Padovan <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2010-07-21Bluetooth: Fix SREJ_QUEUE corruption in L2CAPJoão Paulo Rechi Vita1-1/+12
Since all TxSeq values are modulo, we shall not compare them directly. We have to compare their offset inside the TxWindow instead. Signed-off-by: João Paulo Rechi Vita <[email protected]> Acked-by: Gustavo F. Padovan <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2010-07-21Bluetooth: Fix bug in l2cap_ertm_send() behaviorGustavo F. Padovan1-6/+6
This patch makes l2cap_ertm_send() similar to the Send-Data action of the ERTM spec. We shall not check for RemoteBusy or WAIT_F state inside l2cap_ertm_send(). Such checks were causing a bug in the retransmission logic of ERTM and making ERTM stalls until the ACL is dropped. Signed-off-by: Gustavo F. Padovan <[email protected]> Reviewed-by: João Paulo Rechi Vita <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2010-07-21Bluetooth: Only check SAR bits if frame is an I-frameGustavo F. Padovan1-1/+1
The SAR bits doesn't make sense for an S-frame. It doesn't use SAR. Checking SAR for a S-frames can lead to L2CAP errors, it could close the channel with an invalid packet length, since we was removing the 2 of the of any frame that match SAR start bits, without check if it is an I-frame. Signed-off-by: Gustavo F. Padovan <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2010-07-21Bluetooth: Fix bug with ERTM vars incrementGustavo F. Padovan1-3/+4
All ERTM operations regarding the txWindow should be modulo 64, otherwise we confuse the ERTM logic and connections will break. Signed-off-by: Gustavo F. Padovan <[email protected]> Reviewed-by: João Paulo Rechi Vita <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2010-07-21Bluetooth: Fix drop of packets with invalid req_seq/tx_seqGustavo F. Padovan1-2/+3
We shall not use an unsigned var since we are expecting negatives value there. Using unsigned causes ERTM connection to close due to invalid ReqSeq numbers. Signed-off-by: Gustavo F. Padovan <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2010-07-21Bluetooth: Remove L2CAP Extended Features from KconfigGustavo F. Padovan2-17/+0
This reverts commit 84fb0a6334af0ccad3544f6972c055d90fbb9fbe which adds the L2CAP Extended Features to the Kconfig, that is actually not needed. One can use other mechanisms to enable L2CAP Extended Features. Signed-off-by: Gustavo F. Padovan <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2010-07-21Bluetooth: Remove max_tx and tx_window module paramenters from L2CAPGustavo F. Padovan1-10/+2
We don't need these parameters anymore since we have socket options for them. Signed-off-by: Gustavo F. Padovan <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2010-07-21mm: add context argument to shrinker callback to remaining shrinkersDave Chinner1-1/+1
Add the shrinkers missed in the first conversion of the API in commit 7f8275d0d660c146de6ee3017e1e2e594c49e820 ("mm: add context argument to shrinker callback"). Signed-off-by: Dave Chinner <[email protected]>
2010-07-20Merge branch 'master' of ↵David S. Miller13-18/+66
master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 Conflicts: drivers/vhost/net.c net/bridge/br_device.c Fix merge conflict in drivers/vhost/net.c with guidance from Stephen Rothwell. Revert the effects of net-2.6 commit 573201f36fd9c7c6d5218cdcd9948cee700b277d since net-next-2.6 has fixes that make bridge netpoll work properly thus we don't need it disabled. Signed-off-by: David S. Miller <[email protected]>
2010-07-20Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6Linus Torvalds15-49/+67
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (24 commits) bridge: Partially disable netpoll support tcp: fix crash in tcp_xmit_retransmit_queue IPv6: fix CoA check in RH2 input handler (mip6_rthdr_input()) ibmveth: lost IRQ while closing/opening device leads to service loss rt2x00: Fix lockdep warning in rt2x00lib_probe_dev() vhost: avoid pr_err on condition guest can trigger ipmr: Don't leak memory if fib lookup fails. vhost-net: avoid flush under lock net: fix problem in reading sock TX queue net/core: neighbour update Oops net: skb_tx_hash() fix relative to skb_orphan_try() rfs: call sock_rps_record_flow() in tcp_splice_read() xfrm: do not assume that template resolving always returns xfrms hostap_pci: set dev->base_addr during probe axnet_cs: use spin_lock_irqsave in ax_interrupt dsa: Fix Kconfig dependencies. act_nat: not all of the ICMP packets need an IP header payload r8169: incorrect identifier for a 8168dp Phonet: fix skb leak in pipe endpoint accept() Bluetooth: Update sec_level/auth_type for already existing connections ...
2010-07-20wireless: remove unnecessary reg_same_country_ie_hintJohn W. Linville1-45/+0
"Might as well remove reg_same_country_ie_hint() completely since we already dealt with suspend/resume through the regulatory hint disconnect." -- Luis Reported-by: Luis R. Rodriguez <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2010-07-20wireless: mark cfg80211_is_all_idle as staticJohn W. Linville1-1/+1
CHECK net/wireless/sme.c net/wireless/sme.c:38:6: warning: symbol 'cfg80211_is_all_idle' was not declared. Should it be static? It is not used elsewhere, so mark it static. Signed-off-by: John W. Linville <[email protected]>
2010-07-20wireless: correct sparse warning in generated regdb.cJohn W. Linville1-0/+1
CHECK net/wireless/regdb.c net/wireless/regdb.c:8:34: warning: symbol 'reg_regdb' was not declared. Should it be static? net/wireless/regdb.c:11:5: warning: symbol 'reg_regdb_size' was not declared. Should it be static? Simply include the also generated regdb.h. Signed-off-by: John W. Linville <[email protected]>
2010-07-20wireless: correct sparse warning in wext-compat.cJohn W. Linville1-0/+1
CHECK net/wireless/wext-compat.c net/wireless/wext-compat.c:1434:5: warning: symbol 'cfg80211_wext_siwpmksa' was not declared. Should it be static? Add declaration in cfg80211.h. Also add an EXPORT_SYMBOL_GPL, since all the peer functions have it. Signed-off-by: John W. Linville <[email protected]>
2010-07-20wireless: correct sparse warning in lib80211_crypt_tkip.cJohn W. Linville1-1/+1
CHECK net/wireless/lib80211_crypt_tkip.c net/wireless/lib80211_crypt_tkip.c:581:27: warning: cast to restricted __le16 Caused by dereferencing a "u8 *" and passing it to le16_to_cpu... Signed-off-by: John W. Linville <[email protected]>
2010-07-20wireless: only use alpha2 regulatory information from country IEJohn W. Linville1-613/+12
The meaning and/or usage of the country IE is somewhat poorly defined. In practice, this means that regulatory rulesets in a country IE are often incomplete and might be untrustworthy. This removes the code associated with interpreting those rulesets while preserving respect for country "alpha2" codes also contained in the country IE. Signed-off-by: John W. Linville <[email protected]>
2010-07-20drop_monitor: convert some kfree_skb call sites to consume_skbNeil Horman2-5/+6
Convert a few calls from kfree_skb to consume_skb Noticed while I was working on dropwatch that I was detecting lots of internal skb drops in several places. While some are legitimate, several were not, freeing skbs that were at the end of their life, rather than being discarded due to an error. This patch converts those calls sites from using kfree_skb to consume_skb, which quiets the in-kernel drop_monitor code from detecting them as drops. Tested successfully by myself Signed-off-by: Neil Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2010-07-20drop_monitor: Add error code to detect duplicate state changesNeil Horman1-2/+8
Patch to add -EAGAIN error to dropwatch netlink message handling code. -EAGAIN will be returned anytime userspace attempts to transition the state of the drop monitor service to a state that its already in. That allows user space to detect this condition, so it doesn't wait for a success ACK that will never arrive. Tested successfully by me Signed-off-by: Neil Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2010-07-20__dst_free(): put EXPORT_SYMBOLS after the fctNicolas Dichtel1-1/+1
Signed-off-by: Nicolas Dichtel <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2010-07-20mac80211: set carrier on for monitor interfaces on ieee80211_openDavid Gnedt1-0/+2
If a station interface is reused as monitor interface it is possible that the carrier is still set to off. This breaks packet injection on that monitor interface. Force the carrier on in monitor interface initialisation like it is also done for other interface types (e.g. adhoc, mesh point, ap). Signed-off-by: David Gnedt <[email protected]> Acked-by: Johannes Berg <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2010-07-20mac80211: move QoS-enable to BSS infoJohannes Berg3-12/+10
Ever since commit e1b3ec1a2a336c328c336cfa5485a5f0484cc90d Author: Stanislaw Gruszka <[email protected]> Date: Mon Mar 29 12:18:34 2010 +0200 mac80211: explicitly disable/enable QoS mac80211 is telling drivers, in particular iwlwifi, whether QoS is enabled or not. However, this is only relevant for station mode, since only then will any device send nullfunc frames and need to know whether they should be QoS frames or not. In other modes, there are (currently) no frames the device is supposed to send. When you now consider virtual interfaces, it becomes apparent that the current mechanism is inadequate since it enables/disables QoS on a global scale, where for nullfunc frames it has to be on a per-interface scale. Due to the above considerations, we can change the way mac80211 advertises the QoS state to drivers to only ever advertise it as "off" in station mode, and make it a per-BSS setting. Tested-by: Stanislaw Gruszka <[email protected]> Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2010-07-20mac80211: fix aggregation action frame handling with AP VLANsFelix Fietkau1-2/+2
When aggregation related action frames are enqueued for further work, and they originate from a STA that is part of an AP VLAN, they are currently enqueued for the AP interface. This breaks the sta_info_get() lookup in the actual work function, and because of that, aggregation sessions are not established for this STA. Fix this by replacing the sta_info_get call with a call to sta_info_get_bss. Signed-off-by: Felix Fietkau <[email protected]> Signed-off-by: John W. Linville <[email protected]>