18 Dec, 2009

4 commits


10 Dec, 2009

1 commit

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (42 commits)
    tree-wide: fix misspelling of "definition" in comments
    reiserfs: fix misspelling of "journaled"
    doc: Fix a typo in slub.txt.
    inotify: remove superfluous return code check
    hdlc: spelling fix in find_pvc() comment
    doc: fix regulator docs cut-and-pasteism
    mtd: Fix comment in Kconfig
    doc: Fix IRQ chip docs
    tree-wide: fix assorted typos all over the place
    drivers/ata/libata-sff.c: comment spelling fixes
    fix typos/grammos in Documentation/edac.txt
    sysctl: add missing comments
    fs/debugfs/inode.c: fix comment typos
    sgivwfb: Make use of ARRAY_SIZE.
    sky2: fix sky2_link_down copy/paste comment error
    tree-wide: fix typos "couter" -> "counter"
    tree-wide: fix typos "offest" -> "offset"
    fix kerneldoc for set_irq_msi()
    spidev: fix double "of of" in comment
    comment typo fix: sybsystem -> subsystem
    ...

    Linus Torvalds
     

08 Dec, 2009

1 commit


04 Dec, 2009

13 commits

  • fix some typos and punctuation in comments

    Signed-off-by: Thadeu Lima de Souza Cascardo
    Signed-off-by: Jiri Kosina

    Thadeu Lima de Souza Cascardo
     
  • By default the RFCOMM layer would still use L2CAP basic mode. For testing
    purposes this option enables RFCOMM to select enhanced retransmission
    mode.

    Signed-off-by: Marcel Holtmann

    Marcel Holtmann
     
  • For testing purposes it is important to modify the max transmit value.

    Signed-off-by: Marcel Holtmann

    Marcel Holtmann
     
  • SendRRorRNR needs to acknowledge received I-frames (actually every packet
    needs to acknowledge received I-frames by sending the proper packet
    sequence number), so ReqSeq is set to the next I-frame number sequence to
    be pulled by the reassembly function.
    SendRRorRNR tells the remote side about local busy conditions, it sends
    a Receiver Ready frame if local busy is false or a Receiver Not Ready
    if local busy is true.
    ReqSeq is the packet's field to send the number of the acknowledged
    packets.

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

    Gustavo F. Padovan
     
  • RejActioned is used to prevent retransmission when a entity is on the
    WAIT_F state, i.e., waiting for a frame with F-bit set due local busy
    condition or a expired retransmission timer. (When these two events raise
    they send a frame with the Poll bit set and enters in the WAIT_F state to
    wait for a frame with the Final bit set.)
    The local entity doesn't send I-frames(the data frames) until the receipt
    of a frame with F-bit set. When that happens it also set RejActioned to false.
    RejActioned is a mandatory feature of ERTM spec.

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

    Gustavo F. Padovan
     
  • As specified by ERTM spec an ERTM channel can acknowledge received
    I-frames(the data frames) by sending an I-frame with the proper ReqSeq
    value (i.e. ReqSeq is set to BufferSeq). Until now we aren't setting the
    ReqSeq value on I-frame control bits. That way we can save sending
    S-frames(Supervise frames) only to acknowledge receipt of I-frames. It
    is very helpful to the full-duplex channel.
    ReqSeq is the packet sequence number sent in an acknowledgement frame to
    acknowledge receipt of frames up to (ReqSeq - 1).
    BufferSeq controls the receiver buffer, it is used to delay
    acknowledgement of new frames to not cause buffer overflow. BufferSeq
    value is not increased until frames are pulled by reassembly function.

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

    Gustavo F. Padovan
     
  • SrejActioned is a flag that when set prevents local side to retransmit a
    I-frame(the data frame) already retransmitted. The local entity can
    retransmit again only when it receives a SREJ frame with the F-bit set.
    SREJ frame - Selective Reject frame - is sent when an entity wants the
    retransmission of a specific I-frame that was lost or corrupted.
    This bug can put ERTM in an unknown state once the entity can't
    retransmit.
    A frame with the Final bit set is expected when the local side sends a
    frame with the Poll bit set due to a local busy condition or a
    retransmission timer expired. (Receipt of P-bit shall always be replied by
    a frame with the F-bit set).
    pi->conn_state keeps informations about many ERTM flags including
    SrejActioned.

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

    Gustavo F. Padovan
     
  • Fix ERTM's full-duplex channel to work as specified by ERTM spec. ERTM
    needs to handle state vars, timers and counters to send and receive
    I-frames(the data frames), i.e., for both sides of data communication.
    We initialize all of them to the default values here.
    Full-duplex channel is a mandatory feature of ERTM spec.

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

    Gustavo F. Padovan
     
  • According to BNEP test specification the proper response should be sent
    for a setup connection request message after the BNEP connection setup
    has been completed.

    Signed-off-by: Vikram Kandukuri
    Signed-off-by: Marcel Holtmann

    Vikram Kandukuri
     
  • The tasklet schedule function helpers are just an obfuscation. So remove
    them and call the schedule functions directly.

    Signed-off-by: Marcel Holtmann

    Marcel Holtmann
     
  • For future simplification it is important that the hci_recv_frame
    function is no longer an inline function. So move it into the module
    itself and export it.

    Signed-off-by: Marcel Holtmann

    Marcel Holtmann
     
  • Sending commands to a down interface results in a timeout while clearly
    it should just return ENETDOWN. When using the ioctls this works fine,
    but not when using the HCI sockets sendmsg interface.

    Signed-off-by: Marcel Holtmann

    Marcel Holtmann
     
  • Implement raw output callback which is used by hidraw to send raw data to
    the underlying device.

    Without this patch, the userspace hidraw-based applications can't send
    output reports to HID Bluetooth devices.

    Reported-and-tested-by: Brian Gunn
    Signed-off-by: Jiri Kosina
    Signed-off-by: Marcel Holtmann

    Jiri Kosina
     

30 Nov, 2009

1 commit


17 Nov, 2009

1 commit


16 Nov, 2009

3 commits

  • Basic Mode is the default mode of operation of a L2CAP entity. In
    this case the RFC (Retransmission and Flow Control) configuration
    option should not be used at all.

    Normally remote L2CAP implementation should just ignore this option,
    but it can cause various side effects with other Bluetooth stacks
    that are not capable of handling unknown options.

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

    Gustavo F. Padovan
     
  • The default mode for SOCK_SEQPACKET is Basic Mode. So when no
    mode has been specified, Basic Mode shall be used.

    This is important for current application to keep working as
    expected and not cause a regression.

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

    Gustavo F. Padovan
     
  • This patch fixes double pairing issues with Secure Simple
    Paring support. It was observed that when pairing with SSP
    enabled, that the confirmation will be asked twice.

    http://www.spinics.net/lists/linux-bluetooth/msg02473.html

    This also causes bug when initiating SSP connection from
    Windows Vista.

    The reason is because bluetoothd does not store link keys
    since HCIGETAUTHINFO returns 0. Setting default to general
    bonding fixes these issues.

    Signed-off-by: Andrei Emeltchenko
    Signed-off-by: Marcel Holtmann

    Andrei Emeltchenko
     

06 Nov, 2009

2 commits

  • Before calling capable(CAP_NET_RAW) check if this operations is on behalf
    of the kernel or on behalf of userspace. Do not do the security check if
    it is on behalf of the kernel.

    Signed-off-by: Eric Paris
    Acked-by: Arnaldo Carvalho de Melo
    Signed-off-by: David S. Miller

    Eric Paris
     
  • The generic __sock_create function has a kern argument which allows the
    security system to make decisions based on if a socket is being created by
    the kernel or by userspace. This patch passes that flag to the
    net_proto_family specific create function, so it can do the same thing.

    Signed-off-by: Eric Paris
    Acked-by: Arnaldo Carvalho de Melo
    Signed-off-by: David S. Miller

    Eric Paris
     

27 Oct, 2009

1 commit


20 Oct, 2009

2 commits

  • When shutdown ppp connection, lockdep waring about non-static key
    will happen, it is caused by the lock is not initialized properly
    at that time.

    Fix with tuning the lock/skb_queue_head init order

    [ 94.339261] INFO: trying to register non-static key.
    [ 94.342509] the code is fine but needs lockdep annotation.
    [ 94.342509] turning off the locking correctness validator.
    [ 94.342509] Pid: 0, comm: swapper Not tainted 2.6.31-mm1 #2
    [ 94.342509] Call Trace:
    [ 94.342509] [] register_lock_class+0x58/0x241
    [ 94.342509] [] ? __lock_acquire+0xb57/0xb73
    [ 94.342509] [] __lock_acquire+0xac/0xb73
    [ 94.342509] [] ? lock_release_non_nested+0x17b/0x1de
    [ 94.342509] [] lock_acquire+0x67/0x84
    [ 94.342509] [] ? skb_dequeue+0x15/0x41
    [ 94.342509] [] _spin_lock_irqsave+0x2f/0x3f
    [ 94.342509] [] ? skb_dequeue+0x15/0x41
    [ 94.342509] [] skb_dequeue+0x15/0x41
    [ 94.342509] [] ? _read_unlock+0x1d/0x20
    [ 94.342509] [] skb_queue_purge+0x14/0x1b
    [ 94.342509] [] l2cap_recv_frame+0xea1/0x115a [l2cap]
    [ 94.342509] [] ? __lock_acquire+0xb57/0xb73
    [ 94.342509] [] ? mark_lock+0x1e/0x1c7
    [ 94.342509] [] ? hci_rx_task+0xd2/0x1bc [bluetooth]
    [ 94.342509] [] l2cap_recv_acldata+0xb1/0x1c6 [l2cap]
    [ 94.342509] [] hci_rx_task+0x106/0x1bc [bluetooth]
    [ 94.342509] [] ? l2cap_recv_acldata+0x0/0x1c6 [l2cap]
    [ 94.342509] [] tasklet_action+0x69/0xc1
    [ 94.342509] [] __do_softirq+0x94/0x11e
    [ 94.342509] [] do_softirq+0x36/0x5a
    [ 94.342509] [] irq_exit+0x35/0x68
    [ 94.342509] [] do_IRQ+0x72/0x89
    [ 94.342509] [] common_interrupt+0x2e/0x34
    [ 94.342509] [] ? pm_qos_add_requirement+0x63/0x9d
    [ 94.342509] [] ? acpi_idle_enter_bm+0x209/0x238
    [ 94.342509] [] cpuidle_idle_call+0x5c/0x94
    [ 94.342509] [] cpu_idle+0x4e/0x6f
    [ 94.342509] [] rest_init+0x53/0x55
    [ 94.342509] [] start_kernel+0x2f0/0x2f5
    [ 94.342509] [] i386_start_kernel+0x91/0x96

    Reported-by: Oliver Hartkopp
    Signed-off-by: Dave Young
    Tested-by: Oliver Hartkopp
    Signed-off-by: David S. Miller

    Dave Young
     
  • Due to driver core changes dev_set_drvdata will call kzalloc which should be
    in might_sleep context, but hci_conn_add will be called in atomic context

    Like dev_set_name move dev_set_drvdata to work queue function.

    oops as following:

    Oct 2 17:41:59 darkstar kernel: [ 438.001341] BUG: sleeping function called from invalid context at mm/slqb.c:1546
    Oct 2 17:41:59 darkstar kernel: [ 438.001345] in_atomic(): 1, irqs_disabled(): 0, pid: 2133, name: sdptool
    Oct 2 17:41:59 darkstar kernel: [ 438.001348] 2 locks held by sdptool/2133:
    Oct 2 17:41:59 darkstar kernel: [ 438.001350] #0: (sk_lock-AF_BLUETOOTH-BTPROTO_L2CAP){+.+.+.}, at: [] lock_sock+0xa/0xc [l2cap]
    Oct 2 17:41:59 darkstar kernel: [ 438.001360] #1: (&hdev->lock){+.-.+.}, at: [] l2cap_sock_connect+0x103/0x26b [l2cap]
    Oct 2 17:41:59 darkstar kernel: [ 438.001371] Pid: 2133, comm: sdptool Not tainted 2.6.31-mm1 #2
    Oct 2 17:41:59 darkstar kernel: [ 438.001373] Call Trace:
    Oct 2 17:41:59 darkstar kernel: [ 438.001381] [] __might_sleep+0xde/0xe5
    Oct 2 17:41:59 darkstar kernel: [ 438.001386] [] __kmalloc+0x4a/0x15a
    Oct 2 17:41:59 darkstar kernel: [ 438.001392] [] ? kzalloc+0xb/0xd
    Oct 2 17:41:59 darkstar kernel: [ 438.001396] [] kzalloc+0xb/0xd
    Oct 2 17:41:59 darkstar kernel: [ 438.001400] [] device_private_init+0x15/0x3d
    Oct 2 17:41:59 darkstar kernel: [ 438.001405] [] dev_set_drvdata+0x18/0x26
    Oct 2 17:41:59 darkstar kernel: [ 438.001414] [] hci_conn_init_sysfs+0x40/0xd9 [bluetooth]
    Oct 2 17:41:59 darkstar kernel: [ 438.001422] [] ? hci_conn_add+0x128/0x186 [bluetooth]
    Oct 2 17:41:59 darkstar kernel: [ 438.001429] [] hci_conn_add+0x177/0x186 [bluetooth]
    Oct 2 17:41:59 darkstar kernel: [ 438.001437] [] hci_connect+0x3c/0xfb [bluetooth]
    Oct 2 17:41:59 darkstar kernel: [ 438.001442] [] l2cap_sock_connect+0x174/0x26b [l2cap]
    Oct 2 17:41:59 darkstar kernel: [ 438.001448] [] sys_connect+0x60/0x7a
    Oct 2 17:41:59 darkstar kernel: [ 438.001453] [] ? lock_release_non_nested+0x84/0x1de
    Oct 2 17:41:59 darkstar kernel: [ 438.001458] [] ? might_fault+0x47/0x81
    Oct 2 17:41:59 darkstar kernel: [ 438.001462] [] ? might_fault+0x47/0x81
    Oct 2 17:41:59 darkstar kernel: [ 438.001468] [] ? __copy_from_user_ll+0x11/0xce
    Oct 2 17:41:59 darkstar kernel: [ 438.001472] [] sys_socketcall+0x82/0x17b
    Oct 2 17:41:59 darkstar kernel: [ 438.001477] [] syscall_call+0x7/0xb

    Signed-off-by: Dave Young
    Signed-off-by: David S. Miller

    Dave Young
     

13 Oct, 2009

1 commit

  • Create a new socket level option to report number of queue overflows

    Recently I augmented the AF_PACKET protocol to report the number of frames lost
    on the socket receive queue between any two enqueued frames. This value was
    exported via a SOL_PACKET level cmsg. AFter I completed that work it was
    requested that this feature be generalized so that any datagram oriented socket
    could make use of this option. As such I've created this patch, It creates a
    new SOL_SOCKET level option called SO_RXQ_OVFL, which when enabled exports a
    SOL_SOCKET level cmsg that reports the nubmer of times the sk_receive_queue
    overflowed between any two given frames. It also augments the AF_PACKET
    protocol to take advantage of this new feature (as it previously did not touch
    sk->sk_drops, which this patch uses to record the overflow count). Tested
    successfully by me.

    Notes:

    1) Unlike my previous patch, this patch simply records the sk_drops value, which
    is not a number of drops between packets, but rather a total number of drops.
    Deltas must be computed in user space.

    2) While this patch currently works with datagram oriented protocols, it will
    also be accepted by non-datagram oriented protocols. I'm not sure if thats
    agreeable to everyone, but my argument in favor of doing so is that, for those
    protocols which aren't applicable to this option, sk_drops will always be zero,
    and reporting no drops on a receive queue that isn't used for those
    non-participating protocols seems reasonable to me. This also saves us having
    to code in a per-protocol opt in mechanism.

    3) This applies cleanly to net-next assuming that commit
    977750076d98c7ff6cbda51858bb5a5894a9d9ab (my af packet cmsg patch) is reverted

    Signed-off-by: Neil Horman
    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Neil Horman
     

07 Oct, 2009

1 commit


01 Oct, 2009

1 commit

  • This provides safety against negative optlen at the type
    level instead of depending upon (sometimes non-trivial)
    checks against this sprinkled all over the the place, in
    each and every implementation.

    Based upon work done by Arjan van de Ven and feedback
    from Linus Torvalds.

    Signed-off-by: David S. Miller

    David S. Miller
     

22 Sep, 2009

1 commit


17 Sep, 2009

1 commit


16 Sep, 2009

1 commit


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