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=5

    This 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

    Marcel Holtmann
     

01 Sep, 2009

1 commit


26 Aug, 2009

3 commits


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' follow

    Signed-off-by: Randy Dunlap
    Signed-off-by: Andrew Morton
    Signed-off-by: Marcel Holtmann

    Randy Dunlap
     

24 Aug, 2009

2 commits


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

    Luiz Augusto von Dentz
     
  • Support for receiving of SREJ frames as specified by the state table.

    Signed-off-by: Gustavo F. Padovan
    Signed-off-by: Marcel Holtmann

    Gustavo F. Padovan
     
  • 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

    Gustavo F. Padovan
     
  • 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

    Gustavo F. Padovan
     
  • 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

    Gustavo F. Padovan
     
  • 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

    Gustavo F. Padovan
     
  • 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

    Gustavo F. Padovan
     
  • 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

    Gustavo F. Padovan
     
  • 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

    Gustavo F. Padovan
     
  • 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

    Gustavo F. Padovan
     
  • 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

    Gustavo F. Padovan
     
  • 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

    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

    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

    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

    Marcel Holtmann
     
  • hdev->req_lock is used as mutex so make it a mutex.

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Marcel Holtmann

    Thomas Gleixner
     
  • 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

    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

    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

    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

    Vikram Kandukuri
     
  • 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

    Marcel Holtmann
     

13 Aug, 2009

1 commit


06 Aug, 2009

1 commit


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=2

    make 3 changes:
    1. remove #ifdef in rfcomm/core.c,
    make it blank function when rfcomm tty not selected in rfcomm.h

    2. 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

    Dave Young
     

06 Jul, 2009

1 commit


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

    Eric Dumazet
     

14 Jun, 2009

1 commit


11 Jun, 2009

1 commit


08 Jun, 2009

4 commits