08 Oct, 2015

17 commits


07 Oct, 2015

1 commit

  • The Broadcom Bluetooth controllers have the chip name included in the
    ROM firmware or later in the patchram firmware. For debugging purposes
    read the local name and print it out. This is only done during setup
    stage and only once before loading the firmware and once after loading
    the firmware.

    For the Broadcom based controllers from Apple, the name is only read once
    after determining the chip id.

    Signed-off-by: Marcel Holtmann
    Signed-off-by: Johan Hedberg

    Marcel Holtmann
     

05 Oct, 2015

6 commits


04 Oct, 2015

1 commit

  • Add regmap ibt to support Intel Bluetooth silicon register access
    over HCI. Intel BT/FM combo chip allows to read/write some registers
    (e.g. FM registers) via its HCI interface.

    Read/Write operations are performed via a HCI transaction composed of
    a HCI command (host->controller) followed by a HCI command complete
    event (controller->host). Read/Write Command opcodes can be specified
    to the regmap init function.
    We define data formats which are intel/vendor specific.

    Register Read/Write HCI command payload (Host):
    Field: | REG ADDR | MODE | DATA_LEN | DATA... |
    size: | 32b | 8b | 8b | 8b* |

    Register Read HCI command complete event payload (Controller):
    Field: | CMD STATUS | REG ADDR | DATA... |
    size: | 8b | 32b | 8b* |

    Register Write HCI command complete event payload (Controller):
    Field: | CMD_STATUS |
    size: | 8b |

    Since this payload is HCI encapsulated, Little Endian byte order is
    used.

    Write/Read Example:

    If we write 0x0000002a at address 0x00008c04, with opcode_write 0xfc5d,
    The resulting transaction is (btmon trace):

    < HCI Command (0x3f|0x005d) plen 10 [hci0]
    04 8c 00 00 02 04 2a 00 00 00
    > HCI Event (0x0e) plen 4
    Unknown (0x3f|0x005d) ncmd 1
    00

    Then, if we read the same register with opcode_read 0xfc5e:

    < HCI Command (0x3f|0x005e) plen 6 [hci0]
    04 8c 00 00 02 04
    > HCI Event (0x0e) plen 12 [hci0]
    Unknown (0x3f|0x005e) ncmd 1
    00 04 8c 00 00 2a 00 00 00

    Signed-off-by: Loic Poulain
    Signed-off-by: Marcel Holtmann

    Loic Poulain
     

03 Oct, 2015

1 commit


01 Oct, 2015

7 commits

  • This reverts commit 9abc378c66e3d6f437eed77c1c534cbc183523f7
    ("ieee802154: 6lowpan: change datagram var types").

    The reason is that I forgot the IPv6 fragmentation here. Our MTU of
    lowpan interface is 1280 and skb->len should not above of that. If we
    reach a payload above 1280 in IPv6 header then we have a IPv6
    fragmentation above 802.15.4 6LoWPAN fragmentation. The type "u16" was
    fine, instead I added now a WARN_ON_ONCE if skb->len is above MTU which
    should never happen otherwise IPv6 on minimum MTU size is broken.

    Signed-off-by: Alexander Aring
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     
  • This device has always ACPI companion because driver supports only ACPI
    enumeration. Therefore there is no need to test it in bcm_acpi_probe() and
    we can pass it directly to acpi_dev_get_resources() (which will return
    -EINVAL in case of NULL argument is passed).

    Signed-off-by: Jarkko Nikula
    Signed-off-by: Marcel Holtmann

    Jarkko Nikula
     
  • Tree wide grep for "hci_bcm" doesn't reveal there is any code registering
    this platform device and "struct acpi_device_id" use for passing the
    platform data looks a debug/test code leftover to me.

    I'm assuming this driver effectively supports only ACPI enumeration and
    thus test for ACPI_HANDLE() and platform data can be removed.

    Signed-off-by: Jarkko Nikula
    Signed-off-by: Marcel Holtmann

    Jarkko Nikula
     
  • There is no need to call acpi_match_device() in driver's probe path and
    verify does it find a match to given ACPI _HIDs in .acpi_match_table as
    driver/platform/acpi core code has found the match prior calling the probe.

    Signed-off-by: Jarkko Nikula
    Signed-off-by: Marcel Holtmann

    Jarkko Nikula
     
  • Driver doesn't handle possible error from acpi_dev_get_resources(). Test it
    and return the error code in case of error.

    Signed-off-by: Jarkko Nikula
    Signed-off-by: Marcel Holtmann

    Jarkko Nikula
     
  • Caller of acpi_dev_get_resources() should free the constructed resource
    list by calling the acpi_dev_free_resource_list() in order to avoid memory
    leak.

    Signed-off-by: Jarkko Nikula
    Signed-off-by: Marcel Holtmann

    Jarkko Nikula
     
  • There is some unneeded code in "hci_intel" probing. First
    acpi_match_device() call is needless as driver/platform/acpi core code has
    already done the matching before calling the probe and the driver does not
    use the returned pointer to matching _HID other than checking is it NULL.

    Then tree wide grep for "hci_intel" doesn't reveal that there is any code
    registering this platform device so it looks this device is always backed
    with ACPI companion so also ACPI_HANDLE() test can be removed.

    Signed-off-by: Jarkko Nikula
    Signed-off-by: Marcel Holtmann

    Jarkko Nikula
     

30 Sep, 2015

7 commits

  • This patch fixes checkpatch warnings:
    - Comparison to NULL could be re-written
    - no space required after a cast

    Signed-off-by: Prasanna Karthik
    Signed-off-by: Marcel Holtmann

    Prasanna Karthik
     
  • Use instead of , fixes checkpatch
    Warning;

    Signed-off-by: Prasanna Karthik
    Signed-off-by: Marcel Holtmann

    Prasanna Karthik
     
  • This patch adds support for increment transmit and receive stats. The
    meaning of these stats are IPv6 based, which shows the stats after
    running the 6lowpan adaptation layer (uncompression/compression,
    fragmentation handling) on receive and before the adaptation layer
    when transmit.

    Signed-off-by: Alexander Aring
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     
  • This patch fixes the data frame sequence numer (dsn) while 6lowpan
    fragmentation for frag1. Currently we create one 802.15.4 header at
    first, then check if it's match into one frame and at the end construct
    many fragments and calling wpan_dev_hard_header for each of them,
    inclusive for the first fragment. This will make the first generated
    header to garbage, instead we copying this header for frag1 instead of
    generate a new one which skips one dsn.

    Signed-off-by: Alexander Aring
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     
  • This patch changes datagram size variable from u16 type to unsigned int.
    The reason is that an IPv6 header has an MAX_UIN16 payload length, but
    the datagram size is payload + IPv6 header length. This avoids overflows
    at some places.

    Signed-off-by: Alexander Aring
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     
  • This patch change the length check to len instead of mac_len for
    checking if the frame control field is available to dereference.
    We need to change it because I saw issues with af_packet raw sockets
    and the mrf24j40 which calls this functionality. The raw socket
    functionality doesn't set the mac_len but resets the skb_mac_header to
    skb->data which is still correct. The issue occur at mrf24j40 only,
    because the driver need to evaluate the fc fields.

    Signed-off-by: Alexander Aring
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     
  • This patch changes the mtu size of 802.15.4 interfaces. The current
    setting is the meaning of the maximum transport unit with mac header,
    which is 127 bytes according 802.15.4. The linux meaning of the mtu size
    field is the maximum payload of a mac frame. Like in ethernet, which is
    1500 bytes.

    We have dynamic length of mac frames in 802.15.4, this is why we assume
    the minimum header length which is hard_header_len. This contains fc and
    sequence fields. These can evaluated by driver layer without additional
    checks. We currently don't support to set the FCS from userspace, so we
    need to subtract this from mtu size as well.

    Signed-off-by: Alexander Aring
    Signed-off-by: Marcel Holtmann

    Alexander Aring