12 Sep, 2009
1 commit
-
The Ethernet framing is used for a lot of devices these days. Most
prominent are WiFi and WiMAX based devices. However for userspace
application it is important to classify these devices correctly and
not only see them as Ethernet devices. The daemons like HAL, DeviceKit
or even NetworkManager with udev support tries to do the classification
in userspace with a lot trickery and extra system calls. This is not
good and actually reaches its limitations. Especially since the kernel
does know the type of the Ethernet device it is pretty stupid.To solve this problem the underlying device type needs to be set and
then the value will be exported as DEVTYPE via uevents and available
within udev.# cat /sys/class/net/wlan0/uevent
DEVTYPE=wlan
INTERFACE=wlan0
IFINDEX=5This is similar to subsystems like USB and SCSI that distinguish
between hosts, devices, disks, partitions etc.The new SET_NETDEV_DEVTYPE() is a convenience helper to set the actual
device type. All device types are free form, but for convenience the
same strings as used with RFKILL are choosen.Signed-off-by: Marcel Holtmann
Signed-off-by: David S. Miller
01 Sep, 2009
1 commit
-
Signed-off-by: Stephen Hemminger
Signed-off-by: David S. Miller
26 Aug, 2009
3 commits
-
When called, 'Send RRorRNR' should send a RNR frame if local device is
busy or a RR frame otherwise.Signed-off-by: Gustavo F. Padovan
Signed-off-by: Marcel Holtmann -
Implement all issues related to RemoteBusy in the RECV state table.
Signed-off-by: Gustavo F. Padovan
Signed-off-by: Marcel Holtmann -
Implement the Recv ReqSeqAndFBit event when a RR frame with F bit set is
received.Signed-off-by: Gustavo F. Padovan
Signed-off-by: Marcel Holtmann
25 Aug, 2009
1 commit
-
Fix net/bluetooth/l2cap.c build errors:
l2cap.c:(.text+0x126035): undefined reference to `crc16'
l2cap.c:(.text+0x126323): undefined reference to `crc16'
l2cap.c:(.text+0x12668e): undefined reference to `crc16'
l2cap.c:(.text+0x12683b): undefined reference to `crc16'
l2cap.c:(.text+0x126956): undefined reference to `crc16'
net/built-in.o:l2cap.c:(.text+0x129041): more undefined references to `crc16' followSigned-off-by: Randy Dunlap
Signed-off-by: Andrew Morton
Signed-off-by: Marcel Holtmann
24 Aug, 2009
2 commits
-
Simplify more conversions to the right endian with the proper helpers.
Signed-off-by: Gustavo F. Padovan
Signed-off-by: Marcel Holtmann -
Avoid race conditions when accessing the L2CAP socket from within the
timeout handlers.Signed-off-by: Gustavo F. Padovan
Signed-off-by: Marcel Holtmann
23 Aug, 2009
21 commits
-
When using DEFER_SETUP on a RFCOMM socket, a SABM frame triggers
authorization which when rejected send a DM response. This is fine
according to the RFCOMM spec:the responding implementation may replace the "proper" response
on the Multiplexer Control channel with a DM frame, sent on the
referenced DLCI to indicate that the DLCI is not open, and that
the responder would not grant a request to open it later either.But some stacks doesn't seems to cope with this leaving DLCI 0 open after
receiving DM frame.To fix it properly a timer was introduced to rfcomm_session which is used
to set a timeout when the last active DLC of a session is unlinked, this
will give the remote stack some time to reply with a proper DISC frame on
DLCI 0 avoiding both sides sending DISC to each other on stacks that
follow the specification and taking care of those who don't by taking
down DLCI 0.Signed-off-by: Luiz Augusto von Dentz
Signed-off-by: Marcel Holtmann -
Support for receiving of SREJ frames as specified by the state table.
Signed-off-by: Gustavo F. Padovan
Signed-off-by: Marcel Holtmann -
When L2CAP loses an I-frame we send a SREJ frame to the transmitter side
requesting the lost packet. This patch implement all Recv I-frame events
on SREJ_SENT state table except the ones that deal with SendRej (the REJ
exception at receiver side is yet not implemented).Signed-off-by: Gustavo F. Padovan
Signed-off-by: Marcel Holtmann -
Implement CRC16 check for L2CAP packets. FCS is used by Streaming Mode and
Enhanced Retransmission Mode and is a extra check for the packet content.Using CRC16 is the default, L2CAP won't use FCS only when both side send
a "No FCS" request.Initially based on a patch from Nathan Holstein
Signed-off-by: Gustavo F. Padovan
Signed-off-by: Marcel Holtmann -
Streaming Mode is helpful for the Bluetooth streaming based profiles, such
as A2DP. It doesn't have any error control or flow control.Signed-off-by: Gustavo F. Padovan
Signed-off-by: Marcel Holtmann -
L2CAP uses retransmission and monitor timers to inquiry the other side
about unacked I-frames. After sending each I-frame we (re)start the
retransmission timer. If it expires, we start a monitor timer that send a
S-frame with P bit set and wait for S-frame with F bit set. If monitor
timer expires, try again, at a maximum of L2CAP_DEFAULT_MAX_TX.Signed-off-by: Gustavo F. Padovan
Signed-off-by: Marcel Holtmann -
When receiving an I-frame with unexpected txSeq, receiver side start the
recovery procedure by sending a REJ S-frame to the transmitter side. So
the transmitter can re-send the lost I-frame.This patch just adds a basic support for retransmission, it doesn't
mean that ERTM now has full support for packet retransmission.Signed-off-by: Gustavo F. Padovan
Signed-off-by: Marcel Holtmann -
ERTM should use Segmentation and Reassembly to break down a SDU in many
PDUs on sending data to the other side.On sending packets we queue all 'segments' until end of segmentation and
just the add them to the queue for sending. On receiving we create a new
SKB with the SDU reassembled.Initially based on a patch from Nathan Holstein
Signed-off-by: Gustavo F. Padovan
Signed-off-by: Marcel Holtmann -
This patch adds support for ERTM transfers, without retransmission, with
txWindow up to 63 and with acknowledgement of packets received. Now the
packets are queued before call l2cap_do_send(), so packets couldn't be
sent at the time we call l2cap_sock_sendmsg(). They will be sent in
an asynchronous way on later calls of l2cap_ertm_send(). Besides if an
error occurs on calling l2cap_do_send() we disconnect the channel.Initially based on a patch from Nathan Holstein
Signed-off-by: Gustavo F. Padovan
Signed-off-by: Marcel Holtmann -
The code for sending a disconnect request was repeated several times
within L2CAP source code. So move this into its own function.Signed-off-by: Gustavo F. Padovan
Signed-off-by: Marcel Holtmann -
Add support to config_req and config_rsp to configure ERTM and Streaming
mode. If the remote device specifies ERTM or Streaming mode, then the
same mode is proposed. Otherwise ERTM or Basic mode is used. And in case
of a state 2 device, the remote device should propose the same mode. If
not, then the channel gets disconnected.Signed-off-by: Gustavo F. Padovan
Signed-off-by: Marcel Holtmann -
When trying to establish a connection with Enhanced Retransmission mode
enabled, the RFC option needs to be added to the configuration.Signed-off-by: Marcel Holtmann
-
To enable Enhanced Retransmission mode it needs to be set via a socket
option. A different mode can be set on a socket, but on listen() and
connect() the mode is checked and ERTM is only allowed if it is enabled
via the module parameter.Signed-off-by: Marcel Holtmann
-
Since the Enhanced Retransmission mode for L2CAP is still under heavy
development disable it by default and provide a module option to enable
it manually for testing.Signed-off-by: Marcel Holtmann
-
The rfcomm_init bug fix went into the kernel premature before it got fully
reviewed and acknowledged by the Bluetooth maintainer. So fix up the coding
style now.Signed-off-by: Marcel Holtmann
-
hdev->req_lock is used as mutex so make it a mutex.
Signed-off-by: Thomas Gleixner
Signed-off-by: Marcel Holtmann -
The core exports the hci_conn_hold_device() and hci_conn_put_device()
functions for device reference of connections. Use this to ensure that
the uevents from the parent are send after the child ones.Based on a report by Brian Rogers
Signed-off-by: Marcel Holtmann
-
The device model itself has no real usable reference counting at the
moment and this causes problems if parents are deleted before their
children. The device model itself handles the memory details of this
correctly, but the uevent order is not consistent. This causes various
problems for systems like HAL or even X.So until device_put() does a proper cleanup, the device for Bluetooth
connection will be protected with an extra reference counting to ensure
the correct order of uevents when connections are terminated.This is not an automatic feature. Higher Bluetooth layers like HIDP or
BNEP should grab this new reference to ensure that their uevents are
send before the ones from the parent device.Based on a report by Brian Rogers
Signed-off-by: Marcel Holtmann
-
Currently the HID subsystem will create HIDRAW devices for the transport
driver, but it will not disconnect them. Until the HID subsytem gets
fixed, ensure that HIDRAW and HIDDEV devices are disconnected when the
Bluetooth HID device gets removed.Based on a patch from Brian Rogers
Signed-off-by: Marcel Holtmann
-
There is a test case in PTS tool; PTS will send the VIRTUAL_CABLE_UNPLUG
command to IUT. Then IUT should disconnect the channel and kill the HID
session when it receives the command. The VIRTUAL_CABLE_UNPLUG command
is parsed by HID transport, but it is not scheduled to do so. Add a
call to hidp_schedule() to kill the session.Signed-off-by: Jothikumar Mothilal
Signed-off-by: Marcel Holtmann -
The SCO sockets for Bluetooth audio setup and streaming are missing the
shutdown implementation. This hasn't been a problem so far, but with a
more deeper integration with PulseAudio it is important to shutdown SCO
sockets properly.Also the Headset profile 1.2 has more detailed qualification tests that
require that SCO and RFCOMM channels are terminated in the right order. A
proper shutdown function is necessary for this.Based on a report by Johan Hedberg
Signed-off-by: Marcel Holtmann
Tested-by: Johan Hedberg
13 Aug, 2009
1 commit
-
Conflicts:
arch/microblaze/include/asm/socket.h
06 Aug, 2009
1 commit
-
String literals are constant, and usually, we can also tag the array
of pointers const too, moving it to the .rodata section.Signed-off-by: Jan Engelhardt
Signed-off-by: David S. Miller
04 Aug, 2009
1 commit
-
rfcomm tty may be used before rfcomm_tty_driver initilized,
The problem is that now socket layer init before tty layer, if userspace
program do socket callback right here then oops will happen.reporting in:
http://marc.info/?l=linux-bluetooth&m=124404919324542&w=2make 3 changes:
1. remove #ifdef in rfcomm/core.c,
make it blank function when rfcomm tty not selected in rfcomm.h2. tune the rfcomm_init error patch to ensure
tty driver initilized before rfcomm socket usage.3. remove __exit for rfcomm_cleanup_sockets
because above change need call it in a __init function.Reported-by: Oliver Hartkopp
Tested-by: Oliver Hartkopp
Signed-off-by: Dave Young
Signed-off-by: David S. Miller
06 Jul, 2009
1 commit
-
This patch is the result of an automatic spatch transformation to convert
all ndo_start_xmit() return values of 0 to NETDEV_TX_OK.Some occurences are missed by the automatic conversion, those will be
handled in a seperate patch.Signed-off-by: Patrick McHardy
Signed-off-by: David S. Miller
18 Jun, 2009
1 commit
-
commit 2b85a34e911bf483c27cfdd124aeb1605145dc80
(net: No more expensive sock_hold()/sock_put() on each tx)
changed initial sk_wmem_alloc value.We need to take into account this offset when reporting
sk_wmem_alloc to user, in PROC_FS files or various
ioctls (SIOCOUTQ/TIOCOUTQ)Signed-off-by: Eric Dumazet
Signed-off-by: David S. Miller
14 Jun, 2009
1 commit
-
Since the re-write of the RFKILL subsystem it is no longer good to just
select RFKILL, but it is important to add a proper depends on rule.Based on a report by Alexander Beregalov
Signed-off-by: Marcel Holtmann
11 Jun, 2009
1 commit
08 Jun, 2009
4 commits
-
With the re-write of the RFKILL subsystem it is now possible to easily
integrate RFKILL soft-switch support into the Bluetooth subsystem. All
Bluetooth devices will now get automatically RFKILL support.Signed-off-by: Marcel Holtmann
-
The Bluetooth source uses some endian conversion helpers, that in the end
translate to kernel standard routines. So remove this obfuscation since it
is fully pointless.Signed-off-by: Marcel Holtmann
-
This adds the basic constants required to add support for L2CAP Enhanced
Retransmission feature.Based on a patch from Nathan Holstein
Signed-off-by: Marcel Holtmann
-
This patch fixes the errors without changing the l2cap.o binary:
text data bss dec hex filename
18059 568 0 18627 48c3 l2cap.o.after
18059 568 0 18627 48c3 l2cap.o.beforeSigned-off-by: Gustavo F. Padovan
Signed-off-by: Marcel Holtmann